Skip to content

Commit 11b7f1e

Browse files
rudyflycardyok
authored andcommitted
AdditionalGids must include effective group ID
cherry-pick moby commit: moby/moby@e44d7f7 Signed-off-by: Rudy Zhang <[email protected]>
1 parent 3cad3d6 commit 11b7f1e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

pkg/user/user.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010
"strings"
1111

1212
"github.com/alibaba/pouch/pkg/log"
13+
1314
"github.com/opencontainers/runc/libcontainer/user"
1415
)
1516

@@ -61,7 +62,8 @@ func Get(passwdPath, groupPath, username string, groups []string) (uint32, uint3
6162
uid := uint32(execUser.Uid)
6263
gid := uint32(execUser.Gid)
6364
sgids := append(execUser.Sgids, addGroups...)
64-
var additionalGids []uint32
65+
66+
additionalGids := []uint32{gid}
6567
for _, g := range sgids {
6668
additionalGids = append(additionalGids, uint32(g))
6769
}

0 commit comments

Comments
 (0)