Skip to content

Commit 5c73abb

Browse files
Merge pull request opencontainers#1450 from vrothberg/sgid-non-numeric
libcontainer/user: add supplementary groups only for non-numeric users
2 parents 51b501d + 7742113 commit 5c73abb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

libcontainer/user/user.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -358,8 +358,8 @@ func GetExecUser(userSpec string, defaults *ExecUser, passwd, group io.Reader) (
358358

359359
// Okay, so it's numeric. We can just roll with this.
360360
}
361-
} else if len(groups) > 0 {
362-
// Supplementary group ids only make sense if in the implicit form.
361+
} else if len(groups) > 0 && uidErr != nil {
362+
// Supplementary group ids only make sense if in the implicit form for non-numeric users.
363363
user.Sgids = make([]int, len(groups))
364364
for i, group := range groups {
365365
user.Sgids[i] = group.Gid

0 commit comments

Comments
 (0)