mirror of
https://github.com/containers/podman.git
synced 2025-11-30 01:58:46 +08:00
Merge pull request #20601 from giuseppe/use-rootless-from-storage
rootless: use functionalities from c/storage
This commit is contained in:
5
vendor/github.com/containers/storage/pkg/unshare/unshare_darwin.go
generated
vendored
5
vendor/github.com/containers/storage/pkg/unshare/unshare_darwin.go
generated
vendored
@@ -25,6 +25,11 @@ func GetRootlessUID() int {
|
||||
return os.Getuid()
|
||||
}
|
||||
|
||||
// GetRootlessGID returns the GID of the user in the parent userNS
|
||||
func GetRootlessGID() int {
|
||||
return os.Getgid()
|
||||
}
|
||||
|
||||
// RootlessEnv returns the environment settings for the rootless containers
|
||||
func RootlessEnv() []string {
|
||||
return append(os.Environ(), UsernsEnvName+"=")
|
||||
|
||||
10
vendor/github.com/containers/storage/pkg/unshare/unshare_linux.go
generated
vendored
10
vendor/github.com/containers/storage/pkg/unshare/unshare_linux.go
generated
vendored
@@ -441,6 +441,16 @@ func GetRootlessUID() int {
|
||||
return os.Getuid()
|
||||
}
|
||||
|
||||
// GetRootlessGID returns the GID of the user in the parent userNS
|
||||
func GetRootlessGID() int {
|
||||
gidEnv := getenv("_CONTAINERS_ROOTLESS_GID")
|
||||
if gidEnv != "" {
|
||||
u, _ := strconv.Atoi(gidEnv)
|
||||
return u
|
||||
}
|
||||
return os.Getgid()
|
||||
}
|
||||
|
||||
// RootlessEnv returns the environment settings for the rootless containers
|
||||
func RootlessEnv() []string {
|
||||
return append(os.Environ(), UsernsEnvName+"=done")
|
||||
|
||||
5
vendor/github.com/containers/storage/pkg/unshare/unshare_unsupported.go
generated
vendored
5
vendor/github.com/containers/storage/pkg/unshare/unshare_unsupported.go
generated
vendored
@@ -25,6 +25,11 @@ func GetRootlessUID() int {
|
||||
return os.Getuid()
|
||||
}
|
||||
|
||||
// GetRootlessGID returns the GID of the user in the parent userNS
|
||||
func GetRootlessGID() int {
|
||||
return os.Getgid()
|
||||
}
|
||||
|
||||
// RootlessEnv returns the environment settings for the rootless containers
|
||||
func RootlessEnv() []string {
|
||||
return append(os.Environ(), UsernsEnvName+"=")
|
||||
|
||||
Reference in New Issue
Block a user