diff options
Diffstat (limited to 'libpod/container_internal.go')
-rw-r--r-- | libpod/container_internal.go | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/libpod/container_internal.go b/libpod/container_internal.go index 62960fa0f..561b8853d 100644 --- a/libpod/container_internal.go +++ b/libpod/container_internal.go @@ -9,7 +9,6 @@ import ( "os" "path/filepath" "regexp" - "strconv" "strings" "syscall" "time" @@ -956,17 +955,17 @@ func (c *Container) generateSpec(ctx context.Context) (*spec.Spec, error) { return nil, errors.Wrapf(ErrCtrStateInvalid, "container %s must be mounted in order to add additional groups", c.ID()) } for _, group := range c.config.Groups { - _, gid, err := chrootuser.GetUser(c.state.Mountpoint, strconv.Itoa(int(g.Spec().Process.User.UID))+":"+group) + gid, err := chrootuser.GetGroup(c.state.Mountpoint, group) if err != nil { return nil, err } - g.AddProcessAdditionalGid(uint32(gid)) + g.AddProcessAdditionalGid(gid) } } // Look up and add groups the user belongs to groups, err := chrootuser.GetAdditionalGroupsForUser(c.state.Mountpoint, uint64(g.Spec().Process.User.UID)) - if err != nil { + if err != nil && err != chrootuser.ErrNoSuchUser { return nil, err } for _, gid := range groups { |