You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bug description
When trying to kill a process and failing with "Access Denied" through the Process.kill method, psutil will not throw an exception if the returned handle doesn't have the requested permission.
The bug is in psutil_proc_kill in _psutil_windows.c. The current flow is:
OpenProcess with PROCESS_TERMINATE
TerminateProcess
if TerminateProcess failed with access denied - do nothing.
Unfortunately, a valid handle can return from OpenProcess without the PROCESS_TERMINATE access right.
This might happen if the process is protected by windows or an anti-malware program.
A valid solution might be checking if the process is alive after failing to kill it (Using WaitForSingleObject).
If the process is dead - do nothing.
Otherwise - throw an exception.
Platform
Bug description
When trying to kill a process and failing with "Access Denied" through the Process.kill method, psutil will not throw an exception if the returned handle doesn't have the requested permission.
The bug is in
psutil_proc_kill
in_psutil_windows.c
. The current flow is:Unfortunately, a valid handle can return from OpenProcess without the PROCESS_TERMINATE access right.
This might happen if the process is protected by windows or an anti-malware program.
This behavior was added to solve #1099.
Reproduce
On a computer with eset installed:
The text was updated successfully, but these errors were encountered: