-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Windows runas command issue #44736
Comments
Would you mind submitting a PR for this? Thanks, |
maybe @twangboy can have a look ? |
@tsaridas That's probably fine. You'll also need to add it here: https://github.com/saltstack/salt/blob/develop/salt/utils/win_runas.py#L418 |
cmd.shell is meant to invoke the shell to run a command e.g. cmd.exe The above is a bad fix. Please try cmd.shell , these was some code updates which said if Windows the Shell use %COMSPEC%. |
@tsaridas Does |
@damon-atkins the only thing that cmd.shell does it enable python shell and calls cmd.run . In cmd._run when setting runas & password python_shell doesn't do anything since it exists before python_shell changes the command. https://github.com/saltstack/salt/blob/develop/salt/modules/cmdmod.py#L409 I can confirm tomorrow after some testing but code seems to be the same. |
So if cmd.shell does not result in runing |
may I suggest to change to |
That's fine the /s indicates its in |
@cachedout Should |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue. |
Thank you for updating this issue. It is no longer marked as stale. |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. If this issue is closed prematurely, please leave a comment and we will gladly reopen the issue. |
Thank you for updating this issue. It is no longer marked as stale. |
Description of Issue/Question
will not be able to find file.exe but when you do
it works.
Versions Report
Checked the code and it has always been like that so it affects all versions when runas is used.
Fix
https://github.com/saltstack/salt/blob/develop/salt/utils/win_runas.py#L344
can be changed to :
The text was updated successfully, but these errors were encountered: