summaryrefslogtreecommitdiff
path: root/libpod/container_api.go
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2018-10-30 11:49:15 -0700
committerGitHub <noreply@github.com>2018-10-30 11:49:15 -0700
commit319a7a7043c581c9227a07dd98588a0cdf1e7027 (patch)
tree68cdb071cf8419ca2693742360db1869f6bc8afa /libpod/container_api.go
parentce24ce7c530f8fb0354d3af7b394240a3915b733 (diff)
parent1dd7f13dfbc1dd377eabace0239b1c05cd60b144 (diff)
downloadpodman-319a7a7043c581c9227a07dd98588a0cdf1e7027.tar.gz
podman-319a7a7043c581c9227a07dd98588a0cdf1e7027.tar.bz2
podman-319a7a7043c581c9227a07dd98588a0cdf1e7027.zip
Merge pull request #1715 from baude/getusergroup
get user and group information using securejoin and runc's user library
Diffstat (limited to 'libpod/container_api.go')
-rw-r--r--libpod/container_api.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/libpod/container_api.go b/libpod/container_api.go
index e522038a3..30c67eb2a 100644
--- a/libpod/container_api.go
+++ b/libpod/container_api.go
@@ -10,8 +10,8 @@ import (
"time"
"github.com/containers/libpod/libpod/driver"
- "github.com/containers/libpod/pkg/chrootuser"
"github.com/containers/libpod/pkg/inspect"
+ "github.com/containers/libpod/pkg/lookup"
"github.com/containers/storage/pkg/stringid"
"github.com/docker/docker/daemon/caps"
"github.com/pkg/errors"
@@ -292,13 +292,13 @@ func (c *Container) Exec(tty, privileged bool, env, cmd []string, user string) e
// the host
hostUser := ""
if user != "" {
- uid, gid, err := chrootuser.GetUser(c.state.Mountpoint, user)
+ execUser, err := lookup.GetUserGroupInfo(c.state.Mountpoint, user, nil)
if err != nil {
- return errors.Wrapf(err, "error getting user to launch exec session as")
+ return err
}
// runc expects user formatted as uid:gid
- hostUser = fmt.Sprintf("%d:%d", uid, gid)
+ hostUser = fmt.Sprintf("%d:%d", execUser.Uid, execUser.Gid)
}
// Generate exec session ID