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

Only split "commands" on semicolon #7192

Merged
merged 2 commits into from
May 14, 2018
Merged

Only split "commands" on semicolon #7192

merged 2 commits into from
May 14, 2018

Conversation

pjquirk
Copy link
Member

@pjquirk pjquirk commented May 14, 2018

The SSH task can execute a set of commands, a script file, or an inline script. When running the first option, it would split the input on newlines and then send those lines to a method that split them again on semicolons and finally send each string separately as a command. To run the latter two, the task would create a command to run a file like, <script path> <args>, and then it would then pass this to the same method that used above. So if <args> had a semicolon in it, the task would incorrectly split on that semicolon.

The fix here is to only split on semicolons in the first case, so I moved the splitting out from the helper method to the only place that uses it.

@@ -16,7 +16,7 @@
"author": "Microsoft Corporation",
"version": {
"Major": 0,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it possible for this change to break existing build definitions? Could a user be relying on wrong behavior? If so, we may want to bump the major version number.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't believe so. If the user is executing a script file and then passing in more commands in the "Arguments" field to be run after the script, they should just put the commands in the script.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought about it, I think it is better to not break major version here. There is a way to unblock users relying on this behavior but that would be strange.

@pjquirk pjquirk merged commit 655d3b4 into master May 14, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants