Skip to content

[3006.x] Fix issues with the cmd module on Windows - #66447

Merged
s0undt3ch merged 3 commits into
saltstack:3006.xfrom
twangboy:fix_61166
May 14, 2024
Merged

s0undt3ch merged 3 commits into
saltstack:3006.xfrom
twangboy:fix_61166

Conversation

@twangboy

@twangboy twangboy commented Apr 26, 2024 •

Copy link
Copy Markdown
Contributor

What does this PR do?

Fixes various issues with the cmd module on Windows:

  • Piping stderr to stdout is not optional for cmd.run
  • Scripts are called using the -Command & parameter for powershell.exe
  • stderr is cleared if it contains CLIXML (only for encoded commands)
  • cmd.powershell now accepts commands as lists
  • Makes sure returned JSON data is valid before trying to load it
  • Strips whitespace from the stdout in win_runas

What issues does this PR fix or reference?

Fixes #61166

Merge requirements satisfied?

[NOTICE] Bug fixes or features added to Salt require tests.

Commits signed with GPG?

Yes

@twangboy
twangboy requested a review from a team as a code owner April 26, 2024 18:10
@twangboy
twangboy requested review from felippeb and removed request for a team April 26, 2024 18:10
@salt-project-bot-prod-environment salt-project-bot-prod-environment Bot changed the title Fix issues with the cmd module on Windows [3006.x] Fix issues with the cmd module on Windows Apr 26, 2024
twangboy added 3 commits May 14, 2024 08:55
stderr is no longer piped to stdout by default for cmd.run
Scripts are called using the -File paramter for powershell.exe
stderr is cleared if it contains CLIXML (only for encoded commands)
cmd.powershell now accepts lists as commands
Makes sure returned JSON data is valid before trying to load it
Strips whitespace from the stdout in win_runas

This branch was previously deployed

1 inactive deployment
ci — 8f33dc50 Deployed May 14, 2024 by twangboy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test:full Run the full test suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants