salt icon indicating copy to clipboard operation
salt copied to clipboard

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

Open twangboy opened this issue 9 months ago • 0 comments

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.

  • [x] Docs
  • [x] Changelog - https://docs.saltproject.io/en/master/topics/development/changelog.html
  • [x] Tests written/updated

Commits signed with GPG?

Yes

twangboy avatar Apr 26 '24 18:04 twangboy