[release/0.9] Fix commandline double quoting for job containers#1226
Merged
dcantah merged 2 commits intomicrosoft:release/0.9from Nov 10, 2021
Merged
[release/0.9] Fix commandline double quoting for job containers#1226dcantah merged 2 commits intomicrosoft:release/0.9from
dcantah merged 2 commits intomicrosoft:release/0.9from
Conversation
|
Why is this not a cherry-pick of #1207? |
Contributor
Author
Sorry, it is. Forgot to -x |
We already escape the arguments passed to us by Containerd to form a Windows style commandline, however the commandline was being split back into arguments and then passed to exec.Cmd from the go stdlib. exec.Cmd internally also does escaping, which ended up applying some extra quotes in some cases where the commandline had double/single quotes present. This change just passes the commandline as is to the Cmdline field on the Windows syscall.SysProcAttr. Go takes this field as is and doesn't do any further processing on it which is the behavior we desire. Signed-off-by: Daniel Canter <dcanter@microsoft.com> (cherry picked from commit 7cb95b6) Signed-off-by: Daniel Canter <dcanter@microsoft.com>
4b4aed0 to
07893ac
Compare
Contributor
Author
|
@katiewasnothere fixed |
|
Can you add the tests in from that PR as well? |
This change adds a test to verify that commandlines with quotes don't get additional quotes added on to them when combining the arguments given. Signed-off-by: Daniel Canter <dcanter@microsoft.com> (cherry picked from commit bc5e914) Signed-off-by: Daniel Canter <dcanter@microsoft.com>
Contributor
Author
|
@katiewasnothere done |
katiewasnothere
approved these changes
Nov 10, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We already escape the arguments passed to us by Containerd to form a
Windows style commandline, however the commandline was being split back
into arguments and then passed to exec.Cmd from the go stdlib. exec.Cmd
internally also does escaping, which ended up applying some extra quotes
in some cases where the commandline had double/single quotes present. This change
just passes the commandline as is to the Cmdline field on the Windows
syscall.SysProcAttr. Go takes this field as is and doesn't do any further
processing on it which is the behavior we desire.
Signed-off-by: Daniel Canter dcanter@microsoft.com
(cherry picked from commit 7cb95b6)
Signed-off-by: Daniel Canter dcanter@microsoft.com