Checking if it was possible to get the pid from socket inode.

This commit is contained in:
Simone Margaritelli 2017-04-17 17:44:02 +02:00
parent ba62bd8b64
commit 606bb4d87c

View file

@ -66,7 +66,8 @@ def get_process_name_by_connection( src_addr, src_p, dst_addr, dst_p, proto = 't
if src_ip == src_addr and src_port == src_p and dst_ip == dst_addr and dst_port == dst_p:
pid = get_pid_of_inode(inode)
return ( pid, os.readlink( "/proc/%s/exe" % pid ) )
if pid is not None:
return ( pid, os.readlink( "/proc/%s/exe" % pid ) )
logging.error( "Could not find process for %s connection %s:%s -> %s:%s inside %s" % (
proto,