Skip to content

Commit

Permalink
executor_linux: Remove unreachable PATH= code (#9778)
Browse files Browse the repository at this point in the history
This has to have been unused because the HasPrefix operation is
backwards, meaning a Command.Env that includes PATH= never would have
worked; the default path was always used.
  • Loading branch information
Kris Hicks committed Jan 15, 2021
1 parent 182aa4a commit bcd4752
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions drivers/shared/executor/executor_linux.go
Original file line number Diff line number Diff line change
Expand Up @@ -833,13 +833,7 @@ func lookupTaskBin(command *ExecCommand) (string, error) {
return "", fmt.Errorf("file %s not found under path %s", bin, taskDir)
}

// Find the PATH
path := "/usr/local/bin:/usr/bin:/bin"
for _, e := range command.Env {
if strings.HasPrefix("PATH=", e) {
path = e[5:]
}
}

return lookPathIn(path, taskDir, bin)
}
Expand Down

0 comments on commit bcd4752

Please sign in to comment.