1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Merge pull request #28184 from Microsoft/jjh/user

Windows: Plumb through user
This commit is contained in:
Victor Vieux 2016-11-09 11:32:42 -08:00 committed by GitHub
commit f67d4b897a
3 changed files with 3 additions and 0 deletions

View file

@ -9,5 +9,6 @@ import (
func execSetPlatformOpt(c *container.Container, ec *exec.Config, p *libcontainerd.Process) error { func execSetPlatformOpt(c *container.Container, ec *exec.Config, p *libcontainerd.Process) error {
// Process arguments need to be escaped before sending to OCI. // Process arguments need to be escaped before sending to OCI.
p.Args = escapeArgs(p.Args) p.Args = escapeArgs(p.Args)
p.User.Username = ec.User
return nil return nil
} }

View file

@ -301,6 +301,7 @@ func (clnt *client) AddProcess(ctx context.Context, containerID, processFriendly
// Configure the environment for the process // Configure the environment for the process
createProcessParms.Environment = setupEnvironmentVariables(procToAdd.Env) createProcessParms.Environment = setupEnvironmentVariables(procToAdd.Env)
createProcessParms.CommandLine = strings.Join(procToAdd.Args, " ") createProcessParms.CommandLine = strings.Join(procToAdd.Args, " ")
createProcessParms.User = procToAdd.User.Username
logrus.Debugf("libcontainerd: commandLine: %s", createProcessParms.CommandLine) logrus.Debugf("libcontainerd: commandLine: %s", createProcessParms.CommandLine)

View file

@ -81,6 +81,7 @@ func (ctr *container) start(attachStdio StdioCallback) error {
// Configure the environment for the process // Configure the environment for the process
createProcessParms.Environment = setupEnvironmentVariables(ctr.ociSpec.Process.Env) createProcessParms.Environment = setupEnvironmentVariables(ctr.ociSpec.Process.Env)
createProcessParms.CommandLine = strings.Join(ctr.ociSpec.Process.Args, " ") createProcessParms.CommandLine = strings.Join(ctr.ociSpec.Process.Args, " ")
createProcessParms.User = ctr.ociSpec.Process.User.Username
// Start the command running in the container. // Start the command running in the container.
newProcess, err := ctr.hcsContainer.CreateProcess(createProcessParms) newProcess, err := ctr.hcsContainer.CreateProcess(createProcessParms)