Revert "add try/except when getting process owner"

This reverts commit 4e71d74ff1.
This commit is contained in:
Thomas S Hatch 2013-05-25 03:17:00 -06:00
parent e6565b50a3
commit 1ba039be8b

View File

@ -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