Revert "executor/linux: add defensive checks to binary path"

This reverts commit cb36f4537e.
This commit is contained in:
Michael Schurter
2019-04-02 11:17:12 -07:00
parent cb36f4537e
commit 21e895e2e7
2 changed files with 2 additions and 8 deletions

View File

@@ -1085,7 +1085,7 @@ func TestTaskRunner_Download_ChrootExec(t *testing.T) {
// Wait for task to run and exit
select {
case <-tr.WaitCh():
case <-time.After(time.Duration(testutil.TestMultiplier()*30) * time.Second):
case <-time.After(time.Duration(testutil.TestMultiplier()*15) * time.Second):
require.Fail(t, "timed out waiting for task runner to exit")
}

View File

@@ -162,15 +162,9 @@ func (l *LibcontainerExecutor) Launch(command *ExecCommand) (*ProcessState, erro
return nil, fmt.Errorf("failed to determine relative path base=%q target=%q: %v", command.TaskDir, path, err)
}
// filepath.Rel will only return leading dots if the path escapes the
// TaskDir
if strings.HasPrefix(rel, "..") {
return nil, fmt.Errorf("command path %q escapes task dir %q", path, command.TaskDir)
}
// Turn relative-to-chroot path into absolute path to avoid
// libcontainer trying to resolve the binary using $PATH
path = filepath.Join("/", rel)
path = "/" + rel
combined := append([]string{path}, command.Args...)
stdout, err := command.Stdout()