Windows: escape entrypoint before passing to libcontainerd

This makes Windows behavior consistent with Linux -- the entry point must
be an executable, not an executable and set of arguments.

Signed-off-by: John Starks <jostarks@microsoft.com>
Upstream-commit: 6fa0239772e672eefb98cef91ca8d806b86182b0
Component: engine
This commit is contained in:
John Starks
2016-03-30 12:59:50 -07:00
parent 403cc82fb3
commit 6a83b0bb5c
2 changed files with 4 additions and 7 deletions
+1 -2
View File
@@ -8,7 +8,6 @@ import (
func execSetPlatformOpt(c *container.Container, ec *exec.Config, p *libcontainerd.Process) error {
// Process arguments need to be escaped before sending to OCI.
// TODO (jstarks): escape the entrypoint too once the tests are fixed to not rely on this behavior
p.Args = append([]string{p.Args[0]}, escapeArgs(p.Args[1:])...)
p.Args = escapeArgs(p.Args)
return nil
}
+3 -5
View File
@@ -63,11 +63,9 @@ func (daemon *Daemon) createSpec(c *container.Container) (*libcontainerd.Spec, e
}
// In s.Process
if c.Config.ArgsEscaped {
s.Process.Args = append([]string{c.Path}, c.Args...)
} else {
// TODO (jstarks): escape the entrypoint too once the tests are fixed to not rely on this behavior
s.Process.Args = append([]string{c.Path}, escapeArgs(c.Args)...)
s.Process.Args = append([]string{c.Path}, c.Args...)
if !c.Config.ArgsEscaped {
s.Process.Args = escapeArgs(s.Process.Args)
}
s.Process.Cwd = c.Config.WorkingDir
s.Process.Env = c.CreateDaemonEnvironment(linkedEnv)