diff options
author | Kevin Krakauer <krakauer@google.com> | 2018-08-24 14:41:38 -0700 |
---|---|---|
committer | Shentubot <shentubot@google.com> | 2018-08-24 14:42:40 -0700 |
commit | 02dfceab6d4c4a2a3342ef69be0265b7ab03e5d7 (patch) | |
tree | 31a84af980c995689395641e2a1cc2b5281e9e02 /runsc/boot/loader.go | |
parent | 7b0dfb0cdbdcb402c000d30399dbfd2eeebe1266 (diff) |
runsc: Allow runsc to properly search the PATH for executable name.
Previously, runsc improperly attempted to find an executable in the container's
PATH.
We now search the PATH via the container's fsgofer rather than the host FS,
eliminating the confusing differences between paths on the host and within a
container.
PiperOrigin-RevId: 210159488
Change-Id: I228174dbebc4c5356599036d6efaa59f28ff28d2
Diffstat (limited to 'runsc/boot/loader.go')
-rw-r--r-- | runsc/boot/loader.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/runsc/boot/loader.go b/runsc/boot/loader.go index 7debf0ac2..2f212c704 100644 --- a/runsc/boot/loader.go +++ b/runsc/boot/loader.go @@ -428,6 +428,10 @@ func (l *Loader) startContainer(k *kernel.Kernel, spec *specs.Spec, conf *Config return 0, fmt.Errorf("failed to create new process: %v", err) } + if procArgs.Filename, err = GetExecutablePathInternal(procArgs.NewContext(k), &procArgs); err != nil { + return 0, err + } + tg, err := l.k.CreateProcess(procArgs) if err != nil { return 0, fmt.Errorf("failed to create process in sentry: %v", err) |