[or-cvs] r8579: Make TrackExitHosts case-insensitive, and fix the behavior o (in tor/trunk: . src/or)

nickm at seul.org nickm at seul.org
Mon Oct 2 22:13:38 UTC 2006


Author: nickm
Date: 2006-10-02 18:13:37 -0400 (Mon, 02 Oct 2006)
New Revision: 8579

Modified:
   tor/trunk/
   tor/trunk/ChangeLog
   tor/trunk/src/or/circuituse.c
Log:
 r8850 at totoro:  nickm | 2006-10-02 17:21:11 -0400
 Make TrackExitHosts case-insensitive, and fix the behavior of .suffix TrackExitHosts items to avoid matching in the middle of an address. (Resolves an XXXX)



Property changes on: tor/trunk
___________________________________________________________________
 svk:merge ticket from /tor/trunk [r8850] on 96637b51-b116-0410-a10e-9941ebb49b64

Modified: tor/trunk/ChangeLog
===================================================================
--- tor/trunk/ChangeLog	2006-10-02 21:00:35 UTC (rev 8578)
+++ tor/trunk/ChangeLog	2006-10-02 22:13:37 UTC (rev 8579)
@@ -106,6 +106,8 @@
     - Make eventdns give strings for DNS errors, not just error numbers.
     - Be prepared in case we ever have a network with more than 2GB per
       second total advertised capacity.
+    - Make TrackExitHosts case-insensitive, and fix the behavior of .suffix
+      TrackExitHosts items to avoid matching in the middle of an address.
 
   o Documentation
     - Documented (and renamed) ServerDNSSearchDomains and

Modified: tor/trunk/src/or/circuituse.c
===================================================================
--- tor/trunk/src/or/circuituse.c	2006-10-02 21:00:35 UTC (rev 8578)
+++ tor/trunk/src/or/circuituse.c	2006-10-02 22:13:37 UTC (rev 8579)
@@ -1120,14 +1120,13 @@
 
   SMARTLIST_FOREACH(options->TrackHostExits, const char *, cp, {
     if (cp[0] == '.') { /* match end */
-      /* XXX strstr is probably really bad here. */
-      if ((str = strstr(conn->socks_request->address, &cp[1]))) {
+      if (!strcasecmpend(conn->socks_request->address, cp)) {
         if (str == conn->socks_request->address
           || strcmp(str, &cp[1]) == 0) {
           found_needle = 1;
         }
       }
-    } else if (strcmp(cp, conn->socks_request->address) == 0) {
+    } else if (strcasecmp(cp, conn->socks_request->address) == 0) {
       found_needle = 1;
     }
   });



More information about the tor-commits mailing list