Skip to content

Allows use of inline powershell for cmd.script args - #56197

Merged
dwoz merged 2 commits into
saltstack:masterfrom
lorengordon:file-or-no-file
Mar 10, 2020
Merged

dwoz merged 2 commits into
saltstack:masterfrom
lorengordon:file-or-no-file

Conversation

@lorengordon

@lorengordon lorengordon commented Feb 18, 2020 •

Copy link
Copy Markdown
Contributor

What does this PR do?

Using powershell.exe with -File when the source shell is cmd treats all args as literal strings, which prevents usage of inline powershell. This patch just removes the -File argument, which still works with a script, but allows powershell to process any inline powershell that may be passed to one of the script args.

What issues does this PR fix or reference?

Fixes #56195

Previous Behavior

Args passed to cmd.script with shell=powershell were treated as literal strings

New Behavior

Args are processed by powershell

Tests written?

[NOTICE] Bug fixes or features added to Salt require tests.
Please review the test documentation for details on how to implement tests into Salt's test suite.

Yes

Commits signed with GPG?

Yes

@lorengordon
lorengordon requested a review from a team as a code owner February 18, 2020 23:29
@ghost
ghost requested a review from twangboy February 18, 2020 23:29
@lorengordon
lorengordon force-pushed the file-or-no-file branch 4 times, most recently from 9b6d31c to c660a6d Compare February 20, 2020 03:28
@lorengordon
lorengordon requested a review from a team February 21, 2020 16:29
@twangboy twangboy added v3000.1 vulnerable version Merge Ready labels Mar 9, 2020
@dwoz
dwoz merged commit 3e57d58 into saltstack:master Mar 10, 2020
@lorengordon
lorengordon deleted the file-or-no-file branch March 11, 2020 12:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v3000.1 vulnerable version

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Windows: Using inline powershell in args with cmd.script and shell: powershell

3 participants