[or-cvs] workaround for user error: some people were putting "Addres...

Roger Dingledine arma at seul.org
Fri Apr 29 18:52:07 UTC 2005


Update of /home2/or/cvsroot/tor/src/or
In directory moria.mit.edu:/home2/arma/work/onion/cvs/tor/src/or

Modified Files:
	config.c 
Log Message:
workaround for user error: some people were putting "Address  " in their
torrc, and they had a buggy resolver that resolved " " to 0.0.0.0. Oops.


Index: config.c
===================================================================
RCS file: /home2/or/cvsroot/tor/src/or/config.c,v
retrieving revision 1.337
retrieving revision 1.338
diff -u -d -r1.337 -r1.338
--- config.c	27 Apr 2005 04:13:59 -0000	1.337
+++ config.c	29 Apr 2005 18:52:05 -0000	1.338
@@ -951,7 +951,14 @@
 
   tor_assert(addr);
 
-  if (address) {
+  /* workaround: some people were leaving "Address  " in their torrc,
+   * and they had a buggy resolver that resolved " " to 0.0.0.0. Oops.
+   */
+  if (address)
+    while (TOR_ISSPACE(*address))
+      address++;
+
+  if (address && *address) {
     strlcpy(hostname, address, sizeof(hostname));
   } else { /* then we need to guess our address */
     explicit_ip = 0; /* it's implicit */



More information about the tor-commits mailing list