diff options
author | Nalin Dahyabhai <nalin@redhat.com> | 2018-05-04 11:26:56 -0400 |
---|---|---|
committer | Atomic Bot <atomic-devel@projectatomic.io> | 2018-05-17 17:05:44 +0000 |
commit | e686269da34ed4208f4ed517c0587ab38e8eaf2c (patch) | |
tree | 1ddf505de4e1713ed48efe1bff05fcda3234faff /pkg/chrootuser/user_basic.go | |
parent | 796d6c894a0c99fcfd47f036a278a1a11c446332 (diff) | |
download | podman-e686269da34ed4208f4ed517c0587ab38e8eaf2c.tar.gz podman-e686269da34ed4208f4ed517c0587ab38e8eaf2c.tar.bz2 podman-e686269da34ed4208f4ed517c0587ab38e8eaf2c.zip |
chrootuser: default to GID 0 when given a numeric --user
When we're given a numeric --user value, default to GID 0 if the numeric
ID doesn't correspond to a user entry in /etc/passwd that can provide us
with the user's primary group ID.
Make sure that GetAdditionalGroupsForUser() returns wrapped errors.
Also test various user:group forms.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #728
Approved by: mheon
Diffstat (limited to 'pkg/chrootuser/user_basic.go')
-rw-r--r-- | pkg/chrootuser/user_basic.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/pkg/chrootuser/user_basic.go b/pkg/chrootuser/user_basic.go index 4f89af557..4ed7918e9 100644 --- a/pkg/chrootuser/user_basic.go +++ b/pkg/chrootuser/user_basic.go @@ -17,3 +17,7 @@ func lookupGroupInContainer(rootdir, groupname string) (uint64, error) { func lookupGroupForUIDInContainer(rootdir string, userid uint64) (string, uint64, error) { return "", 0, errors.New("primary group lookup by uid not supported") } + +func lookupAdditionalGroupsForUIDInContainer(rootdir string, userid uint64) (gid []uint32, err error) { + return nil, errors.New("supplemental groups list lookup by uid not supported") +} |