]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
Check whether a client port is a Unix socket before using its IP addr
authorRobert Ransom <rransom.8774@gmail.com>
Thu, 20 Oct 2011 10:17:23 +0000 (03:17 -0700)
committerRobert Ransom <rransom.8774@gmail.com>
Thu, 20 Oct 2011 10:17:23 +0000 (03:17 -0700)
Bugfix on commit c1ac0695d5bc64b555c345e4be87b18bab3ae56b, not yet in any
release.  Fixes bug 4091; bug reported by SwissTorHelp.

src/or/config.c

index 388c45f5cf8e5e1873c2aabb4ded2ee6d159749c..59bbe1dd692d3438c3d1433bc246e1ac98192d8b 100644 (file)
@@ -5128,7 +5128,9 @@ static void
 warn_nonlocal_client_ports(const smartlist_t *ports, const char *portname)
 {
   SMARTLIST_FOREACH_BEGIN(ports, const port_cfg_t *, port) {
-    if (!tor_addr_is_internal(&port->addr, 1)) {
+    if (port->is_unix_addr) {
+      /* Unix sockets aren't accessible over a network. */
+    } else if (!tor_addr_is_internal(&port->addr, 1)) {
       log_warn(LD_CONFIG, "You specified a public address for %sPort. "
                "Other people on the Internet might find your computer and "
                "use it as an open proxy. Please don't allow this unless you "