summaryrefslogtreecommitdiff
path: root/libpod
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2020-09-19 06:32:59 -0400
committerGitHub <noreply@github.com>2020-09-19 06:32:59 -0400
commitc2068f11cc18e344d0777bca88c890807a115443 (patch)
tree5b744e8f6d3a950407ddf4d015e0ed4883e7faae /libpod
parent5b7509c562e040ab8ed17990299c0b6eb52cecee (diff)
parent2f605dcc1c05c1081537a8eaf56ad256fb0c050c (diff)
downloadpodman-c2068f11cc18e344d0777bca88c890807a115443.tar.gz
podman-c2068f11cc18e344d0777bca88c890807a115443.tar.bz2
podman-c2068f11cc18e344d0777bca88c890807a115443.zip
Merge pull request #7694 from mheon/fix_exec_supplemental_groups
Preserve groups in exec sessions in ctrs with --user
Diffstat (limited to 'libpod')
-rw-r--r--libpod/container_exec.go7
1 files changed, 1 insertions, 6 deletions
diff --git a/libpod/container_exec.go b/libpod/container_exec.go
index f5f54c7cc..fce26acb0 100644
--- a/libpod/container_exec.go
+++ b/libpod/container_exec.go
@@ -980,11 +980,6 @@ func prepareForExec(c *Container, session *ExecSession) (*ExecOptions, error) {
capList = capabilities.AllCapabilities()
}
- user := c.config.User
- if session.Config.User != "" {
- user = session.Config.User
- }
-
if err := c.createExecBundle(session.ID()); err != nil {
return nil, err
}
@@ -995,7 +990,7 @@ func prepareForExec(c *Container, session *ExecSession) (*ExecOptions, error) {
opts.Env = session.Config.Environment
opts.Terminal = session.Config.Terminal
opts.Cwd = session.Config.WorkDir
- opts.User = user
+ opts.User = session.Config.User
opts.PreserveFDs = session.Config.PreserveFDs
opts.DetachKeys = session.Config.DetachKeys
opts.ExitCommand = session.Config.ExitCommand