execsnoop: fix get_pid

This commit is contained in:
springzfx
2020-05-23 13:49:09 +08:00
parent 5dbce18f95
commit 388ba6a4c8

View File

@@ -89,7 +89,10 @@ def attach(pid, path, proxy=True):
def processAlreadyRunning():
from subprocess import check_output
def get_pid(name):
return map(int,check_output(["pidof",name]).split())
try:
return map(int,check_output(["pidof",name]).split())
except:
return []
global exec_path_proxy, exec_path_noproxy
for path in exec_path_proxy:
for pid in get_pid(path):