Browse code

Windows: Plumb through user

Signed-off-by: John Howard <jhoward@microsoft.com>

John Howard authored on 2016/11/09 04:05:56
Showing 3 changed files
... ...
@@ -9,5 +9,6 @@ import (
9 9
 func execSetPlatformOpt(c *container.Container, ec *exec.Config, p *libcontainerd.Process) error {
10 10
 	// Process arguments need to be escaped before sending to OCI.
11 11
 	p.Args = escapeArgs(p.Args)
12
+	p.User.Username = ec.User
12 13
 	return nil
13 14
 }
... ...
@@ -301,6 +301,7 @@ func (clnt *client) AddProcess(ctx context.Context, containerID, processFriendly
301 301
 	// Configure the environment for the process
302 302
 	createProcessParms.Environment = setupEnvironmentVariables(procToAdd.Env)
303 303
 	createProcessParms.CommandLine = strings.Join(procToAdd.Args, " ")
304
+	createProcessParms.User = procToAdd.User.Username
304 305
 
305 306
 	logrus.Debugf("libcontainerd: commandLine: %s", createProcessParms.CommandLine)
306 307
 
... ...
@@ -81,6 +81,7 @@ func (ctr *container) start(attachStdio StdioCallback) error {
81 81
 	// Configure the environment for the process
82 82
 	createProcessParms.Environment = setupEnvironmentVariables(ctr.ociSpec.Process.Env)
83 83
 	createProcessParms.CommandLine = strings.Join(ctr.ociSpec.Process.Args, " ")
84
+	createProcessParms.User = ctr.ociSpec.Process.User.Username
84 85
 
85 86
 	// Start the command running in the container.
86 87
 	newProcess, err := ctr.hcsContainer.CreateProcess(createProcessParms)