-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Command does not escape arguments as expected on windows #29494
Copy link
Copy link
Closed
Labels
C-bugCategory: This is a bug.Category: This is a bug.I-needs-decisionIssue: In need of a decision.Issue: In need of a decision.O-windowsOperating system: WindowsOperating system: WindowsP-lowLow priorityLow priorityT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.
Metadata
Metadata
Assignees
Labels
C-bugCategory: This is a bug.Category: This is a bug.I-needs-decisionIssue: In need of a decision.Issue: In need of a decision.O-windowsOperating system: WindowsOperating system: WindowsP-lowLow priorityLow priorityT-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Currently the windows implementation of Command will automatically attempt to escape arguments before concatenating them into a single command line string to be passed to CreateProcess. However, the escaping method used doesn't work for many windows command-line tools, including
cmd,msiexecand others.As an example, it is impossible to specify arguments like this:
ARG="some parameter with spaces"because Command will try to quote the entire thing, whereas msiexec expects only the value to be quoted.
What's required is a way to pass arguments through unchanged: I suggest an
arg_raworarg_unescapedmethod be added to Command. This function can either be a windows-specific extension, or a no-op on other platforms. The advantage of the latter is that it avoids the need tocfgout code that relies on it at compile time.