From 0171dd64d553d2690f94f05e2c7b22d4f5771aba Mon Sep 17 00:00:00 2001 From: Gerard Wagener Date: Thu, 21 Jan 2010 10:46:58 +0100 Subject: [PATCH] Discard empty subtrees induced by sshd --- aha/ahalib.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/aha/ahalib.py b/aha/ahalib.py index 3933a064381..592f835e0e2 100644 --- a/aha/ahalib.py +++ b/aha/ahalib.py @@ -230,6 +230,12 @@ class ProcessTrees: # f is file object # pid is the root process def desc_root_process(self,f,pid): + vec = self.recover_process_vector(pid) + #Sometimes SSHD clones processes that are not related + #to users, small trees about a length of 2 + if (len(vec) == 0): + return + f.write("** user root process %d **\n"%pid) sshinfo = self.search_ssh_info(pid) if sshinfo: @@ -240,7 +246,6 @@ class ProcessTrees: obj=datetime.datetime.fromtimestamp(float(ts)) f.write("Connection date: %s\n"%str(obj)) #Add process vector - vec = self.recover_process_vector(pid) f.write("Process vector: %s\n"%','.join(vec)) f.write('\n') def exportUserListTxt(self,filename):