Only try to get AdditionalGroups if they are configured.

Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
This commit is contained in:
Mrunal Patel 2015-06-12 12:40:42 -04:00
parent 33b3f3801a
commit ab3d3ce15e
1 changed files with 6 additions and 3 deletions

View File

@ -178,9 +178,12 @@ func setupUser(config *initConfig) error {
return err
}
addGroups, err := user.GetAdditionalGroupsPath(config.Config.AdditionalGroups, groupPath)
if err != nil {
return err
var addGroups []int
if len(config.Config.AdditionalGroups) > 0 {
addGroups, err = user.GetAdditionalGroupsPath(config.Config.AdditionalGroups, groupPath)
if err != nil {
return err
}
}
suppGroups := append(execUser.Sgids, addGroups...)