Skip to content
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

Closed
rsc opened this issue Dec 2, 2020 · 3 comments
Closed

proposal: os/exec: use LookPathAbs by default #42950

rsc opened this issue Dec 2, 2020 · 3 comments

Comments

@rsc
Copy link
Contributor

rsc commented Dec 2, 2020

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)).

@gopherbot gopherbot added this to the Proposal milestone Dec 2, 2020
@rsc
Copy link
Contributor Author

rsc commented Dec 2, 2020

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.

@rsc
Copy link
Contributor Author

rsc commented Jan 20, 2021

Retracting in favor of #43724.

@rsc rsc closed this as completed Jan 20, 2021
@rsc
Copy link
Contributor Author

rsc commented Jan 20, 2021

No change in consensus, so declined.
— rsc for the proposal review group

@golang golang locked and limited conversation to collaborators Jan 20, 2022
@rsc rsc moved this to Declined in Proposals Aug 10, 2022
@rsc rsc added this to Proposals Aug 10, 2022
@rsc rsc removed this from Proposals Oct 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants