aboutsummaryrefslogtreecommitdiff
path: root/pkg/specgen
diff options
context:
space:
mode:
authorMatthew Heon <mheon@redhat.com>2022-09-02 13:40:29 -0400
committerMatthew Heon <mheon@redhat.com>2022-09-02 15:51:36 -0400
commitd82a41687e614d9ac8b2d169dee47fe226835e4c (patch)
treeb557e257245d28db09c704bf40f4271efa73d165 /pkg/specgen
parent0e66f75f2a6d3792ae7fd2d77fe8a55b6fbdb0ce (diff)
downloadpodman-d82a41687e614d9ac8b2d169dee47fe226835e4c.tar.gz
podman-d82a41687e614d9ac8b2d169dee47fe226835e4c.tar.bz2
podman-d82a41687e614d9ac8b2d169dee47fe226835e4c.zip
Add container GID to additional groups
Mitigates a potential permissions issue. Mirrors Buildah PR #4200 and CRI-O PR #6159. Signed-off-by: Matthew Heon <mheon@redhat.com>
Diffstat (limited to 'pkg/specgen')
-rw-r--r--pkg/specgen/namespaces.go2
1 files changed, 2 insertions, 0 deletions
diff --git a/pkg/specgen/namespaces.go b/pkg/specgen/namespaces.go
index 8cc0fe6a9..b6bbee868 100644
--- a/pkg/specgen/namespaces.go
+++ b/pkg/specgen/namespaces.go
@@ -510,6 +510,7 @@ func SetupUserNS(idmappings *storage.IDMappingOptions, userns Namespace, g *gene
idmappings = mappings
g.SetProcessUID(uint32(uid))
g.SetProcessGID(uint32(gid))
+ g.AddProcessAdditionalGid(uint32(gid))
user = fmt.Sprintf("%d:%d", uid, gid)
if err := privateUserNamespace(idmappings, g); err != nil {
return user, err
@@ -522,6 +523,7 @@ func SetupUserNS(idmappings *storage.IDMappingOptions, userns Namespace, g *gene
idmappings = mappings
g.SetProcessUID(uint32(uid))
g.SetProcessGID(uint32(gid))
+ g.AddProcessAdditionalGid(uint32(gid))
user = fmt.Sprintf("%d:%d", uid, gid)
if err := privateUserNamespace(idmappings, g); err != nil {
return user, err