Skip to content

Commit 5207ff7

Browse files
author
John Howard
committed
Windows: Plumb through user
Signed-off-by: John Howard <jhoward@microsoft.com>
1 parent 4b63ad3 commit 5207ff7

File tree

3 files changed

+3
-0
lines changed

3 files changed

+3
-0
lines changed

daemon/exec_windows.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,6 @@ import (
99
func execSetPlatformOpt(c *container.Container, ec *exec.Config, p *libcontainerd.Process) error {
1010
// Process arguments need to be escaped before sending to OCI.
1111
p.Args = escapeArgs(p.Args)
12+
p.User.Username = ec.User
1213
return nil
1314
}

libcontainerd/client_windows.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,7 @@ func (clnt *client) AddProcess(ctx context.Context, containerID, processFriendly
301301
// Configure the environment for the process
302302
createProcessParms.Environment = setupEnvironmentVariables(procToAdd.Env)
303303
createProcessParms.CommandLine = strings.Join(procToAdd.Args, " ")
304+
createProcessParms.User = procToAdd.User.Username
304305

305306
logrus.Debugf("libcontainerd: commandLine: %s", createProcessParms.CommandLine)
306307

libcontainerd/container_windows.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,7 @@ func (ctr *container) start(attachStdio StdioCallback) error {
8181
// Configure the environment for the process
8282
createProcessParms.Environment = setupEnvironmentVariables(ctr.ociSpec.Process.Env)
8383
createProcessParms.CommandLine = strings.Join(ctr.ociSpec.Process.Args, " ")
84+
createProcessParms.User = ctr.ociSpec.Process.User.Username
8485

8586
// Start the command running in the container.
8687
newProcess, err := ctr.hcsContainer.CreateProcess(createProcessParms)

0 commit comments

Comments
 (0)