aboutsummaryrefslogtreecommitdiff
path: root/libpod/container_internal.go
diff options
context:
space:
mode:
authorGiuseppe Scrivano <gscrivan@redhat.com>2018-06-12 18:47:27 +0200
committerAtomic Bot <atomic-devel@projectatomic.io>2018-06-27 14:07:17 +0000
commit20862c9746e9f0c4ec37e9d9e914f02a82acfb60 (patch)
treeee74c4e1a849553abad71a9de262d0ce92b478de /libpod/container_internal.go
parent4415bad6fe15d3a94fc729e5200d694d17151238 (diff)
downloadpodman-20862c9746e9f0c4ec37e9d9e914f02a82acfb60.tar.gz
podman-20862c9746e9f0c4ec37e9d9e914f02a82acfb60.tar.bz2
podman-20862c9746e9f0c4ec37e9d9e914f02a82acfb60.zip
rootless: do not configure additional groups
Additional groups are not allowed in an userNS. Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com> Closes: #936 Approved by: rhatdan
Diffstat (limited to 'libpod/container_internal.go')
-rw-r--r--libpod/container_internal.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/libpod/container_internal.go b/libpod/container_internal.go
index 3d94fa871..9d5335780 100644
--- a/libpod/container_internal.go
+++ b/libpod/container_internal.go
@@ -1286,7 +1286,7 @@ func (c *Container) generateSpec(ctx context.Context) (*spec.Spec, error) {
}
// Look up and add groups the user belongs to, if a group wasn't directly specified
- if !strings.Contains(c.config.User, ":") {
+ if !rootless.IsRootless() && !strings.Contains(c.config.User, ":") {
groups, err := chrootuser.GetAdditionalGroupsForUser(c.state.Mountpoint, uint64(g.Spec().Process.User.UID))
if err != nil && errors.Cause(err) != chrootuser.ErrNoSuchUser {
return nil, err