-
Notifications
You must be signed in to change notification settings - Fork 17.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
proposal: os/exec: use LookPathAbs by default #42950
Labels
Milestone
Comments
We now have three active proposals related to dot in path lookup:
Please try to keep comments on these limited to the specific issue they track. Thanks. |
This was referenced Dec 2, 2020
Retracting in favor of #43724. |
No change in consensus, so declined. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
exec.Command("ls") calls LookPath to find an "ls" executable to run.
If users are on Windows, or if they are on Unix with "." in their $PATH ahead of /bin, it will run ./ls when that exists.
That's almost never what you really want - see #38736 and related issues.
If we adopt #42420, perhaps we should also make exec.Command default to using LookPathAbs instead of LookPath (unless the command is explicitly "./ls" (
.\ls
on Windows)).The text was updated successfully, but these errors were encountered: