mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
Merge pull request #50415 from flassman/pass-cwd-to-runas_system
cwd needs to be passed from runas() to runas_system()
This commit is contained in:
commit
93095cbd45
@ -271,7 +271,7 @@ def make_inheritable(token):
|
||||
win32con.DUPLICATE_SAME_ACCESS)
|
||||
|
||||
|
||||
def runas_system(cmd, username, password):
|
||||
def runas_system(cmd, username, password, cwd=None):
|
||||
# This only works as system, when salt is running as a service for example
|
||||
|
||||
# Check for a domain
|
||||
@ -352,7 +352,7 @@ def runas_system(cmd, username, password):
|
||||
1,
|
||||
0,
|
||||
user_environment,
|
||||
None,
|
||||
cwd,
|
||||
startup_info)
|
||||
|
||||
hProcess, hThread, PId, TId = \
|
||||
@ -397,7 +397,7 @@ def runas(cmd, username, password, cwd=None):
|
||||
# This only works when not running under the system account
|
||||
# Debug mode for example
|
||||
if salt.utils.win_functions.get_current_user() == 'SYSTEM':
|
||||
return runas_system(cmd, username, password)
|
||||
return runas_system(cmd, username, password, cwd)
|
||||
|
||||
# Create a pipe to set as stdout in the child. The write handle needs to be
|
||||
# inheritable.
|
||||
|
Loading…
Reference in New Issue
Block a user