[or-cvs] r7010: Warn about open TransListenAddress values. (in tor/trunk: . src/or)

nickm at seul.org nickm at seul.org
Thu Aug 10 09:02:02 UTC 2006


Author: nickm
Date: 2006-08-10 05:02:02 -0400 (Thu, 10 Aug 2006)
New Revision: 7010

Modified:
   tor/trunk/
   tor/trunk/src/or/config.c
Log:
 r7302 at Kushana:  nickm | 2006-08-10 01:48:44 -0700
 Warn about open TransListenAddress values.



Property changes on: tor/trunk
___________________________________________________________________
Name: svk:merge
   - 17f730b7-d419-0410-b50f-85ee4b70197a:/local/or/tor/trunk:8245
1f724f9b-111a-0410-b636-93f1a77c1813:/local/or/tor/trunk:8207
96637b51-b116-0410-a10e-9941ebb49b64:/tor/branches/spec:7005
c95137ef-5f19-0410-b913-86e773d04f59:/tor/branches/eventdns:7014
c95137ef-5f19-0410-b913-86e773d04f59:/tor/branches/mmap:7030
c95137ef-5f19-0410-b913-86e773d04f59:/tor/branches/oo-connections:6950
c95137ef-5f19-0410-b913-86e773d04f59:/tor/branches/trans-ap:7301
   + 17f730b7-d419-0410-b50f-85ee4b70197a:/local/or/tor/trunk:8245
1f724f9b-111a-0410-b636-93f1a77c1813:/local/or/tor/trunk:8207
96637b51-b116-0410-a10e-9941ebb49b64:/tor/branches/spec:7005
c95137ef-5f19-0410-b913-86e773d04f59:/tor/branches/eventdns:7014
c95137ef-5f19-0410-b913-86e773d04f59:/tor/branches/mmap:7030
c95137ef-5f19-0410-b913-86e773d04f59:/tor/branches/oo-connections:6950
c95137ef-5f19-0410-b913-86e773d04f59:/tor/branches/trans-ap:7302

Modified: tor/trunk/src/or/config.c
===================================================================
--- tor/trunk/src/or/config.c	2006-08-10 09:01:54 UTC (rev 7009)
+++ tor/trunk/src/or/config.c	2006-08-10 09:02:02 UTC (rev 7010)
@@ -2069,23 +2069,31 @@
     REJECT("SocksPort must be defined if SocksListenAddress is defined.");
 #endif
 
-  /* XXX TransListenAddress should be checked here as well */
-  if (options->SocksListenAddress) {
-    config_line_t *line = NULL;
-    char *address = NULL;
-    for (line = options->SocksListenAddress; line; line = line->next) {
+  for (i = 0; i < 2; ++i) {
+    int is_socks = i==0;
+    config_line_t *line, *opt, *old;
+    if (is_socks) {
+      opt = options->SocksListenAddress;
+      old = old_options->SocksListenAddress;
+    } else {
+      opt = options->TransListenAddress;
+      old = old_options->TransListenAddress;
+    }
+    const char *tp = is_socks ? "SOCKS proxy" : "transparent proxy";
+
+    for (line = opt; line; line = line->next) {
+      char *address = NULL;
       uint16_t port;
       uint32_t addr;
       if (parse_addr_port(LOG_WARN, line->value, &address, &addr, &port)<0)
         continue; /* We'll warn about this later. */
       if (!is_internal_IP(addr, 1) &&
-          (!old_options || !config_lines_eq(old_options->SocksListenAddress,
-                                            options->SocksListenAddress))) {
+          (!old_options || !config_lines_eq(old, opt))) {
         log_warn(LD_CONFIG,
-             "You specified a public address '%s' for a SOCKS listener. Other "
+             "You specified a public address '%s' for a %s listener. Other "
              "people on the Internet might find your computer and use it as "
-             "an open SOCKS proxy. Please don't allow this unless you have "
-             "a good reason.", address);
+             "an open %s proxy. Please don't allow this unless you have "
+             "a good reason.", address, tp, tp);
       }
       tor_free(address);
     }



More information about the tor-commits mailing list