Skip to content
This repository was archived by the owner on Dec 13, 2018. It is now read-only.

Commit ab3d3ce

Browse files
committed
Only try to get AdditionalGroups if they are configured.
Signed-off-by: Mrunal Patel <[email protected]>
1 parent 33b3f38 commit ab3d3ce

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

init_linux.go

+6-3
Original file line numberDiff line numberDiff line change
@@ -178,9 +178,12 @@ func setupUser(config *initConfig) error {
178178
return err
179179
}
180180

181-
addGroups, err := user.GetAdditionalGroupsPath(config.Config.AdditionalGroups, groupPath)
182-
if err != nil {
183-
return err
181+
var addGroups []int
182+
if len(config.Config.AdditionalGroups) > 0 {
183+
addGroups, err = user.GetAdditionalGroupsPath(config.Config.AdditionalGroups, groupPath)
184+
if err != nil {
185+
return err
186+
}
184187
}
185188

186189
suppGroups := append(execUser.Sgids, addGroups...)

0 commit comments

Comments
 (0)