From 46b41a3da4f8fdea751e7a44f0d0542c86d4c1d2 Mon Sep 17 00:00:00 2001 From: Mrunal Patel Date: Wed, 17 Oct 2018 12:38:43 -0700 Subject: [PATCH] user: Always return supplementary groups The caller can ignore it if they don't care about using them. Signed-off-by: Mrunal Patel --- libcontainer/user/user.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libcontainer/user/user.go b/libcontainer/user/user.go index 7b912bbf8b4..f563e1106ab 100644 --- a/libcontainer/user/user.go +++ b/libcontainer/user/user.go @@ -417,8 +417,8 @@ func GetExecUser(userSpec string, defaults *ExecUser, passwd, group io.Reader) ( // Okay, so it's numeric. We can just roll with this. } - } else if len(groups) > 0 { - // Supplementary group ids only make sense if in the implicit form. + } + if len(groups) > 0 { user.Sgids = make([]int, len(groups)) for i, group := range groups { user.Sgids[i] = group.Gid