Only try to get AdditionalGroups if they are configured.
Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
This commit is contained in:
parent
33b3f3801a
commit
ab3d3ce15e
|
@ -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...)
|
||||
|
|
Loading…
Reference in New Issue