mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 09:23:56 +00:00
Revert "add try/except when getting process owner"
This reverts commit 4e71d74ff1
.
This commit is contained in:
parent
e6565b50a3
commit
1ba039be8b
@ -68,16 +68,16 @@ def _get_process_info(proc):
|
||||
|
||||
def _get_process_owner(process):
|
||||
owner = {}
|
||||
try:
|
||||
domain, error_code, user = process.GetOwner()
|
||||
domain, error_code, user = process.GetOwner()
|
||||
if not error_code:
|
||||
owner['user'] = user.encode('utf-8')
|
||||
owner['user_domain'] = domain.encode('utf-8')
|
||||
if process.ProcessId in [0, 4] and error_code == 2:
|
||||
# Access Denied for System Idle Process and System
|
||||
owner['user'] = 'SYSTEM'
|
||||
owner['user_domain'] = 'NT AUTHORITY'
|
||||
except Exception as exc:
|
||||
elif process.ProcessId in [0, 4] and error_code == 2:
|
||||
# Access Denied for System Idle Process and System
|
||||
owner['user'] = 'SYSTEM'
|
||||
owner['user_domain'] = 'NT AUTHORITY'
|
||||
else:
|
||||
log.warning('Error getting owner of process; PID=\'{0}\'; Error: {1}'
|
||||
.format(process.ProcessId, exc))
|
||||
.format(process.ProcessId, error_code))
|
||||
|
||||
return owner
|
||||
|
Loading…
Reference in New Issue
Block a user