diff --git a/client/allocrunner/taskrunner/task_runner_test.go b/client/allocrunner/taskrunner/task_runner_test.go index 45f5ed92a..99900b785 100644 --- a/client/allocrunner/taskrunner/task_runner_test.go +++ b/client/allocrunner/taskrunner/task_runner_test.go @@ -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") } diff --git a/drivers/shared/executor/executor_linux.go b/drivers/shared/executor/executor_linux.go index 7b700b641..3cd8bfda5 100644 --- a/drivers/shared/executor/executor_linux.go +++ b/drivers/shared/executor/executor_linux.go @@ -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()