diff options
author | Daniel J Walsh <dwalsh@redhat.com> | 2020-06-30 15:44:14 -0400 |
---|---|---|
committer | Valentin Rothberg <rothberg@redhat.com> | 2020-08-11 14:58:29 +0200 |
commit | 3dfd8630a51a37734ad8c51162c4d004b8ffffb2 (patch) | |
tree | 6ebf1d923f718c6717add408a11c714070ccc995 /cmd | |
parent | 92d01d76c63d0a286365f610151524fb24b74e16 (diff) | |
download | podman-3dfd8630a51a37734ad8c51162c4d004b8ffffb2.tar.gz podman-3dfd8630a51a37734ad8c51162c4d004b8ffffb2.tar.bz2 podman-3dfd8630a51a37734ad8c51162c4d004b8ffffb2.zip |
Add username to /etc/passwd inside of container if --userns keep-id
If I enter a continer with --userns keep-id, my UID will be present
inside of the container, but most likely my user will not be defined.
This patch will take information about the user and stick it into the
container.
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/podman/common/specgen.go | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/cmd/podman/common/specgen.go b/cmd/podman/common/specgen.go index 7716fc150..2333f2f7e 100644 --- a/cmd/podman/common/specgen.go +++ b/cmd/podman/common/specgen.go @@ -260,6 +260,8 @@ func FillOutSpecGen(s *specgen.SpecGenerator, c *ContainerCLIOpts, args []string // If some mappings are specified, assume a private user namespace if userNS.IsDefaultValue() && (!s.IDMappings.HostUIDMapping || !s.IDMappings.HostGIDMapping) { s.UserNS.NSMode = specgen.Private + } else { + s.UserNS.NSMode = specgen.NamespaceMode(userNS) } s.Terminal = c.TTY |