mirror of
https://github.com/containers/podman.git
synced 2025-12-16 12:29:28 +08:00
Update vendor containers/(common,storage,buildah,image)
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
This commit is contained in:
17
vendor/github.com/containers/storage/pkg/unshare/unshare.go
generated
vendored
17
vendor/github.com/containers/storage/pkg/unshare/unshare.go
generated
vendored
@@ -5,18 +5,12 @@ import (
|
||||
"os"
|
||||
"os/user"
|
||||
"sync"
|
||||
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
var (
|
||||
homeDirOnce sync.Once
|
||||
homeDirErr error
|
||||
homeDir string
|
||||
|
||||
hasCapSysAdminOnce sync.Once
|
||||
hasCapSysAdminRet bool
|
||||
hasCapSysAdminErr error
|
||||
)
|
||||
|
||||
// HomeDir returns the home directory for the current user.
|
||||
@@ -36,14 +30,3 @@ func HomeDir() (string, error) {
|
||||
})
|
||||
return homeDir, homeDirErr
|
||||
}
|
||||
|
||||
func bailOnError(err error, format string, a ...interface{}) { // nolint: golint,goprintffuncname
|
||||
if err != nil {
|
||||
if format != "" {
|
||||
logrus.Errorf("%s: %v", fmt.Sprintf(format, a...), err)
|
||||
} else {
|
||||
logrus.Errorf("%v", err)
|
||||
}
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
|
||||
17
vendor/github.com/containers/storage/pkg/unshare/unshare_linux.go
generated
vendored
17
vendor/github.com/containers/storage/pkg/unshare/unshare_linux.go
generated
vendored
@@ -400,6 +400,12 @@ func hasFullUsersMappings() (bool, error) {
|
||||
return bytes.Contains(content, []byte("4294967295")), nil
|
||||
}
|
||||
|
||||
var (
|
||||
hasCapSysAdminOnce sync.Once
|
||||
hasCapSysAdminRet bool
|
||||
hasCapSysAdminErr error
|
||||
)
|
||||
|
||||
// IsRootless tells us if we are running in rootless mode
|
||||
func IsRootless() bool {
|
||||
isRootlessOnce.Do(func() {
|
||||
@@ -445,6 +451,17 @@ type Runnable interface {
|
||||
Run() error
|
||||
}
|
||||
|
||||
func bailOnError(err error, format string, a ...interface{}) { // nolint: golint,goprintffuncname
|
||||
if err != nil {
|
||||
if format != "" {
|
||||
logrus.Errorf("%s: %v", fmt.Sprintf(format, a...), err)
|
||||
} else {
|
||||
logrus.Errorf("%v", err)
|
||||
}
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
|
||||
// MaybeReexecUsingUserNamespace re-exec the process in a new namespace
|
||||
func MaybeReexecUsingUserNamespace(evenForRoot bool) {
|
||||
// If we've already been through this once, no need to try again.
|
||||
|
||||
Reference in New Issue
Block a user