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

process::Command::{arg,args} is now self-contradictory #123764

Open
workingjubilee opened this issue Apr 11, 2024 · 2 comments
Open

process::Command::{arg,args} is now self-contradictory #123764

workingjubilee opened this issue Apr 11, 2024 · 2 comments
Labels
A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools A-process Area: `std::process` and `std::env` O-windows Operating system: Windows T-libs Relevant to the library team, which will review and decide on the PR/issue. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.

Comments

@workingjubilee
Copy link
Member

Location

Currently it says

Note that the argument is not passed through a shell, but given literally to the program. This means that shell syntax like quotes, escaped characters, word splitting, glob patterns, variable substitution, etc. have no effect.

But then it adds the Windows-related caveat.

Summary

This states, more or less directly, that the preceding passage is actually a lie, and the reality is that we try to pass the arguments in a way that makes sense, and uses an API that bypasses the shell's command-line-interpreter concerns.

It made sense to land this initially in a "don't modify the existing wording, just plonk down a huge warning" way, but the text itself should be changed to account for the reality.

@workingjubilee workingjubilee added O-windows Operating system: Windows A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools A-process Area: `std::process` and `std::env` labels Apr 11, 2024
@rustbot rustbot added the needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. label Apr 11, 2024
@saethlin saethlin added T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. and removed needs-triage This issue may need triage. Remove it if it has been sufficiently triaged. labels Apr 11, 2024
@ChrisDenton
Copy link
Member

Note that the original intent of that paragraph was not as a security guarantee but to inform people that shell like syntax isn't needed. See #78599

I believe @jieyouxu would appreciate if this were still stated clearly.

@workingjubilee
Copy link
Member Author

I don't think that the final phrasing should obfuscate that, either, it should just be clearer that we're adopting a platform-specific approach.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-docs Area: documentation for any part of the project, including the compiler, standard library, and tools A-process Area: `std::process` and `std::env` O-windows Operating system: Windows T-libs Relevant to the library team, which will review and decide on the PR/issue. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

No branches or pull requests

4 participants