[or-cvs] r9346: Adapt a patch from goodell to let the contrib/exitlist scrip (in tor/trunk: . contrib)

arma at seul.org arma at seul.org
Sun Jan 14 03:16:07 UTC 2007


Author: arma
Date: 2007-01-13 22:16:06 -0500 (Sat, 13 Jan 2007)
New Revision: 9346

Modified:
   tor/trunk/ChangeLog
   tor/trunk/contrib/exitlist
Log:
Adapt a patch from goodell to let the contrib/exitlist script
take arguments rather than require direct editing.


Modified: tor/trunk/ChangeLog
===================================================================
--- tor/trunk/ChangeLog	2007-01-13 17:56:17 UTC (rev 9345)
+++ tor/trunk/ChangeLog	2007-01-14 03:16:06 UTC (rev 9346)
@@ -1,9 +1,10 @@
 Changes in version 0.1.2.7-alpha - 2007-??-??
-
  o Minor features:
     - Check for addresses with invalid characters at the exit as well as at
       the client, and warn less verbosely when they fail.  You can override
       this by setting ServerDNSAllowNonRFC953Addresses to 1.
+    - Adapt a patch from goodell to let the contrib/exitlist script
+      take arguments rather than require direct editing.
 
  o Major bugfixes:
     - Fix a crash bug in the presence of DNS hijacking  (reported by Andrew

Modified: tor/trunk/contrib/exitlist
===================================================================
--- tor/trunk/contrib/exitlist	2007-01-13 17:56:17 UTC (rev 9345)
+++ tor/trunk/contrib/exitlist	2007-01-14 03:16:06 UTC (rev 9346)
@@ -10,11 +10,11 @@
 
  example usage (Tor 0.1.0.x and earlier):
 
-    python exitlist < ~/.tor/cached-directory
+    python exitlist 18.244.0.188:80 < ~/.tor/cached-directory
 
  example usage (Tor 0.1.1.10-alpha and later):
 
-    cat ~/.tor/cached-routers* | python exitlist
+    cat ~/.tor/cached-routers* | python exitlist 18.244.0.188:80
 
  If you're using Tor 0.1.1.18-rc or later, you should look at
  the "FetchUselessDescriptors" config option in the man page.
@@ -41,10 +41,11 @@
 #
 # Change this list to contain all of the target services you are interested
 # in.  It must contain one entry per line, each consisting of an IPv4 address,
-# a colon, and a port number.
+# a colon, and a port number. This default is only used if we don't learn
+# about any addresses from the command-line.
 #
 ADDRESSES_OF_INTEREST = """
-    192.168.0.1:80
+    1.2.3.4:80
 """
 
 
@@ -208,6 +209,29 @@
     return lst
 
 def run():
+    global VERBOSE
+    global INVERSE
+    global ADDRESSES_OF_INTEREST
+
+    if len(sys.argv) > 1:
+        try:
+            opts, pargs = getopt.getopt(sys.argv[1:], "vx")
+        except getopt.GetoptError, e:
+            print """
+usage: %s [-v] [-x] [host:port [host:port [...]]]
+    -v  verbose output
+    -x  invert results
+""" % sys.argv[0]
+            sys.exit(0)
+
+        for o, a in opts:
+            if o == "-v":
+                VERBOSE = True
+            if o == "-x":
+                INVERSE = True
+        if len(pargs):
+            ADDRESSES_OF_INTEREST = "\n".join(pargs)
+
     servers = []
     policy = []
     name = ip = None



More information about the tor-commits mailing list