mirror of
https://github.com/saltstack/salt.git
synced 2025-04-16 09:40:20 +00:00
Use cmd /c with runas on Windows to allow compound commands
This commit is contained in:
parent
ab9e02a1a9
commit
8c8792d81b
1 changed files with 2 additions and 2 deletions
|
@ -209,7 +209,7 @@ def runas(cmdLine, username, password=None, cwd=None):
|
||||||
int(user_token),
|
int(user_token),
|
||||||
logonflags=1,
|
logonflags=1,
|
||||||
applicationname=None,
|
applicationname=None,
|
||||||
commandline=cmdLine,
|
commandline=f'cmd /c "{cmdLine}"',
|
||||||
currentdirectory=cwd,
|
currentdirectory=cwd,
|
||||||
creationflags=creationflags,
|
creationflags=creationflags,
|
||||||
startupinfo=startup_info,
|
startupinfo=startup_info,
|
||||||
|
@ -310,7 +310,7 @@ def runas_unpriv(cmd, username, password, cwd=None):
|
||||||
domain=domain,
|
domain=domain,
|
||||||
password=password,
|
password=password,
|
||||||
logonflags=salt.platform.win.LOGON_WITH_PROFILE,
|
logonflags=salt.platform.win.LOGON_WITH_PROFILE,
|
||||||
commandline=cmd,
|
commandline=f'cmd /c "{cmd}"',
|
||||||
startupinfo=startup_info,
|
startupinfo=startup_info,
|
||||||
currentdirectory=cwd,
|
currentdirectory=cwd,
|
||||||
)
|
)
|
||||||
|
|
Loading…
Add table
Reference in a new issue