mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 08:58:59 +00:00
parent
ef4509e779
commit
20fff15e89
@ -310,8 +310,8 @@ def runas_system(cmd, username, password):
|
||||
|
||||
except win32security.error as exc:
|
||||
# User doesn't have admin, use existing token
|
||||
if exc[0] == winerror.ERROR_NO_SUCH_LOGON_SESSION \
|
||||
or exc[0] == winerror.ERROR_PRIVILEGE_NOT_HELD:
|
||||
if exc.winerror == winerror.ERROR_NO_SUCH_LOGON_SESSION \
|
||||
or exc.winerror == winerror.ERROR_PRIVILEGE_NOT_HELD:
|
||||
elevated_token = token
|
||||
else:
|
||||
raise
|
||||
|
Loading…
Reference in New Issue
Block a user