From 56048bda0a15abec37b680d15e945b95ef504e4b Mon Sep 17 00:00:00 2001 From: Michael Schurter Date: Tue, 2 Apr 2019 11:25:45 -0700 Subject: [PATCH] executor/linux: comment this bizarre code --- drivers/shared/executor/executor_linux.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/shared/executor/executor_linux.go b/drivers/shared/executor/executor_linux.go index 3cd8bfda5..6c978e787 100644 --- a/drivers/shared/executor/executor_linux.go +++ b/drivers/shared/executor/executor_linux.go @@ -163,7 +163,10 @@ func (l *LibcontainerExecutor) Launch(command *ExecCommand) (*ProcessState, erro } // Turn relative-to-chroot path into absolute path to avoid - // libcontainer trying to resolve the binary using $PATH + // libcontainer trying to resolve the binary using $PATH. + // Do *not* use filepath.Join as it will translate ".."s returned by + // filepath.Rel. Prepending "/" will cause the path to be rooted in the + // chroot which is the desired behavior. path = "/" + rel combined := append([]string{path}, command.Args...)