summaryrefslogtreecommitdiff
path: root/pkg/specgen/generate/namespaces.go
diff options
context:
space:
mode:
authorDaniel J Walsh <dwalsh@redhat.com>2020-06-17 14:53:04 -0400
committerDaniel J Walsh <dwalsh@redhat.com>2020-06-17 17:13:58 -0400
commitc385e6d36334342195203e5bd368f772992911d1 (patch)
tree615012a9961a0a4f818e43f9071d8dd9e88a4a4f /pkg/specgen/generate/namespaces.go
parent7b5073b46e4ba3914ce526fa60ef91346f50f577 (diff)
downloadpodman-c385e6d36334342195203e5bd368f772992911d1.tar.gz
podman-c385e6d36334342195203e5bd368f772992911d1.tar.bz2
podman-c385e6d36334342195203e5bd368f772992911d1.zip
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 <dwalsh@redhat.com>
Diffstat (limited to 'pkg/specgen/generate/namespaces.go')
-rw-r--r--pkg/specgen/generate/namespaces.go4
1 files changed, 1 insertions, 3 deletions
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
}