-
Notifications
You must be signed in to change notification settings - Fork 5.5k
cmdmod enhancements for Windows #68156
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
base: 3006.x
Are you sure you want to change the base?
Conversation
Hi there! Welcome to the Salt Community! Thank you for making your first contribution. We have a lengthy process for issues and PRs. Someone from the Core Team will follow up as soon as possible. In the meantime, here’s some information that may help as you continue your Salt journey. There are lots of ways to get involved in our community. Every month, there are around a dozen opportunities to meet with other contributors and the Salt Core team and collaborate in real time. The best way to keep track is by subscribing to the Salt Community Events Calendar. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have a few questions about some of the tests. Also, this needs a changelog. Additionally, please make these changes against the 3006.x branch as these issue also exist there.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A few questions and changes. Thanks for adding a changelog.
Got some pre-commit failures
|
Fixed tests and added two changes:
Thanks for the review. |
What does this PR do?
Change the behavior of the cmdmod execution module.
shell / python_shell
Respect user input for the
shell
parameter. Same aspython_shell
, it is disabled by default for all functions exceptcmd.shell
. This prevents unnecessary calls to the shell and possibly unsafe command executions.cmd.run
and other similar functions now requireshell
to be specified explicitly if shell functionality is required.cmd._run
subprocess.list2cmdline
only if required in case the shell is cmd.exe or if impersonating another user and passing the command string toCreateProcess
.-File
instead of-Command
. This makes it possible to pass arguments as a list and not having to worry about escaping characters. In contrast to the previous behavior with-Command
, the arguments are not evaluated as commands. When PowerShell commands are a requirement,cmd.shell
orcmd.powershell
should be used instead, e.g. Windows: Using inline powershell in args withcmd.script
andshell: powershell
#56195 .cmd.script
cmd.powershell
What issues does this PR fix or reference?
#56195
#68096
#68118
Merge requirements satisfied?
Commits signed with GPG?
No