Skip to content

Prepend cmd when using built-in commands on Windows - #67919

Merged
dwoz merged 19 commits into
saltstack:3006.xfrom
twangboy:fix_54821
May 27, 2025
Merged

dwoz merged 19 commits into
saltstack:3006.xfrom
twangboy:fix_54821

Conversation

@twangboy

@twangboy twangboy commented Mar 24, 2025 •

Copy link
Copy Markdown
Contributor

What does this PR do?

Fixes an issue with running commands on Windows using cmd.run. Some commands are built-in commands only available when run from a cmd prompt. This checks for a binary for the command. If the binary does not exist, it is assumed that this is a built-in command and prepends cmd /c to the command. There are also some operators built-in to cmd such as && and ||. If those are present and the command does not start with cmd, it will be prepended.

What issues does this PR fix or reference?

Fixes #54821

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 March 24, 2025 19:58
@twangboy twangboy self-assigned this Mar 24, 2025
@twangboy twangboy added this to the Sulfur v3006.11 milestone Mar 24, 2025
dmurphy18
dmurphy18 previously approved these changes Mar 24, 2025
@twangboy twangboy added the test:full Run the full test suite label Mar 25, 2025
@twangboy twangboy mentioned this pull request Apr 23, 2025
12 of 17 tasks

This branch was previously deployed

1 inactive deployment
ci — 6b3f5252 Deployed May 23, 2025 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.

3 participants