From ab3d3ce15e7a7ff146b072f8b86720cc4daf8b7e Mon Sep 17 00:00:00 2001 From: Mrunal Patel Date: Fri, 12 Jun 2015 12:40:42 -0400 Subject: [PATCH] Only try to get AdditionalGroups if they are configured. Signed-off-by: Mrunal Patel --- init_linux.go | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/init_linux.go b/init_linux.go index 521de51c..f36e354f 100644 --- a/init_linux.go +++ b/init_linux.go @@ -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...)