main: add condition to isRootless()

Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
This commit is contained in:
Akihiro Suda
2018-05-10 12:17:37 +09:00
parent f103de57ec
commit cdb7f23d21

View File

@@ -234,7 +234,7 @@ func isRootless(context *cli.Context) (bool, error) {
// So we use system.GetParentNSeuid() here. // So we use system.GetParentNSeuid() here.
// //
// TODO(AkihiroSuda): how to support nested userns? // TODO(AkihiroSuda): how to support nested userns?
return system.GetParentNSeuid() != 0, nil return system.GetParentNSeuid() != 0 || system.RunningInUserNS(), nil
} }
func createContainer(context *cli.Context, id string, spec *specs.Spec) (libcontainer.Container, error) { func createContainer(context *cli.Context, id string, spec *specs.Spec) (libcontainer.Container, error) {