Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

catch a race condition during process' sockets retrieval ; added READ…

…ME file.
  • Loading branch information...
commit cebe052a43470cc492c8fc7cf7bb63572587c5bf 1 parent 869becc
Damien Leroux authored October 11, 2009

Showing 2 changed files with 15 additions and 1 deletion. Show diff stats Hide diff stats

  1. 11  README
  2. 5  processinfo.py
11  README
... ...
@@ -0,0 +1,11 @@
  1
+To run, create a file ~/quileecherc.
  2
+Each line in this file can define value for one of those keys :
  3
+- hostname : the local hostname (as of the interface you'll listen on)
  4
+- ssh_no_users : a comma-separated list (without spaces) of directories in /home that MUSTN'T appear in the sshd filter
  5
+- default_filters : a comma-separated list (without spaces) of program names to filter
  6
+Syntax to assign values to a key is :
  7
+key = value
  8
+Spaces around key and values are optional.
  9
+No comment, no empty line in the rc file.
  10
+To install, just drop the scripts in a safe place (e.g. /usr/local) and symlink qui_leeche.py anywhere in the $PATH.
  11
+
5  processinfo.py
@@ -49,7 +49,10 @@ def get_sockets() :
49 49
 	return dict( [ (k[9], k) for k in map(str.split, open('/proc/net/tcp').readlines()[1:]) ] )
50 50
 
51 51
 def get_process_remote_peers(p, socks) :
52  
-	psocks = get_process_sockets(p)
  52
+	try :
  53
+		psocks = get_process_sockets(p)
  54
+	except :
  55
+		return []
53 56
 	ret = []
54 57
 	def unpack_ip(ipstr) :
55 58
 		return socket.inet_ntoa('%c%c%c%c'%tuple([int(ipstr[2*i:2*i+2], 16) for i in xrange(3,-1,-1)]))

0 notes on commit cebe052

Please sign in to comment.
Something went wrong with that request. Please try again.