unshare: fix creating a userns when running as root
this check would prevent the function to ever be used when running
as root, since we won't check what capabilities are currently
available to the process.
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
(cherry picked from commit 1af3928e9b)
This commit is contained in:
parent
472e26b16f
commit
1f6c35b28e
|
|
@ -448,7 +448,7 @@ type Runnable interface {
|
|||
// 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.
|
||||
if os.Geteuid() == 0 && IsRootless() {
|
||||
if os.Geteuid() == 0 && GetRootlessUID() > 0 {
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue