From c385e6d36334342195203e5bd368f772992911d1 Mon Sep 17 00:00:00 2001 From: Daniel J Walsh Date: Wed, 17 Jun 2020 14:53:04 -0400 Subject: Don't ignore --user flag in rootless --userns keepid Currently podman run --userns keep-id --user root:root fedora id The --user flag is ignored. Removing this makes the code work correctly. Signed-off-by: Daniel J Walsh --- pkg/specgen/generate/namespaces.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'pkg') diff --git a/pkg/specgen/generate/namespaces.go b/pkg/specgen/generate/namespaces.go index e67afe1bf..3815bbcc9 100644 --- a/pkg/specgen/generate/namespaces.go +++ b/pkg/specgen/generate/namespaces.go @@ -153,9 +153,7 @@ func namespaceOptions(ctx context.Context, s *specgen.SpecGenerator, rt *libpod. // User switch s.UserNS.NSMode { case specgen.KeepID: - if rootless.IsRootless() { - s.User = "" - } else { + if !rootless.IsRootless() { // keep-id as root doesn't need a user namespace s.UserNS.NSMode = specgen.Host } -- cgit v1.2.3-54-g00ecf