mirror of
https://github.com/kemko/nomad.git
synced 2026-01-06 18:35:44 +03:00
executor_linux: Remove unreachable PATH= code (#9778)
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.
This commit is contained in:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user