diff options
author | OpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com> | 2020-06-02 20:51:13 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-06-02 20:51:13 +0200 |
commit | c4ccd7cbc1509bab6183c47f740cbf2cc4ee0424 (patch) | |
tree | e93a98054a8cb3f956aaf94b96705371f80cbdcc /libpod | |
parent | 37ac21ff085b6e17adec3c0d9945524aa41029ae (diff) | |
parent | 77e4b077b9d8989b1300689103a5489bd1ad9a8b (diff) | |
download | podman-c4ccd7cbc1509bab6183c47f740cbf2cc4ee0424.tar.gz podman-c4ccd7cbc1509bab6183c47f740cbf2cc4ee0424.tar.bz2 podman-c4ccd7cbc1509bab6183c47f740cbf2cc4ee0424.zip |
Merge pull request #6435 from QiWang19/uid
check --user range for rootless containers
Diffstat (limited to 'libpod')
-rw-r--r-- | libpod/container_internal_linux.go | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libpod/container_internal_linux.go b/libpod/container_internal_linux.go index 2bd6099f0..d08e012a6 100644 --- a/libpod/container_internal_linux.go +++ b/libpod/container_internal_linux.go @@ -325,6 +325,11 @@ func (c *Container) generateSpec(ctx context.Context) (*spec.Spec, error) { } if c.config.User != "" { + if rootless.IsRootless() { + if err := util.CheckRootlessUIDRange(execUser.Uid); err != nil { + return nil, err + } + } // User and Group must go together g.SetProcessUID(uint32(execUser.Uid)) g.SetProcessGID(uint32(execUser.Gid)) |