[or-cvs] r14214: Stop reading torrc when all we want to do is --hash-password (in tor/trunk: . src/or)

nickm at seul.org nickm at seul.org
Thu Mar 27 16:46:35 UTC 2008


Author: nickm
Date: 2008-03-27 12:46:34 -0400 (Thu, 27 Mar 2008)
New Revision: 14214

Modified:
   tor/trunk/
   tor/trunk/ChangeLog
   tor/trunk/src/or/config.c
Log:
 r19091 at catbus:  nickm | 2008-03-27 12:42:57 -0400
 Stop reading torrc when all we want to do is --hash-password.  Fix based on patch from Sebastian Hahn. Backport candidate.



Property changes on: tor/trunk
___________________________________________________________________
 svk:merge ticket from /tor/trunk [r19091] on 8246c3cf-6607-4228-993b-4d95d33730f1

Modified: tor/trunk/ChangeLog
===================================================================
--- tor/trunk/ChangeLog	2008-03-27 15:52:44 UTC (rev 14213)
+++ tor/trunk/ChangeLog	2008-03-27 16:46:34 UTC (rev 14214)
@@ -19,6 +19,9 @@
       leaks.  Bugfix on 0.2.0.19-alpha.
     - Free static hashtables for policy maps and for TLS connections on
       shutdown, so they don't look like memory leaks.  Bugfix on 0.2.0.x.
+    - Do not read the configuration file when we've only been told to
+      generate a password hash.  Bugfix on 0.0.9pre5.  Fix based on patch
+      from Sebastian Hahn.
 
   o Minor features:
     - Allow separate log levels to be configured for different logging

Modified: tor/trunk/src/or/config.c
===================================================================
--- tor/trunk/src/or/config.c	2008-03-27 15:52:44 UTC (rev 14213)
+++ tor/trunk/src/or/config.c	2008-03-27 16:46:34 UTC (rev 14214)
@@ -3681,9 +3681,13 @@
     }
   }
 
-  cf = load_torrc_from_disk(argc, argv);
-  if (!cf)
-    goto err;
+  if (command == CMD_HASH_PASSWORD) {
+    cf = tor_strdup("");
+  } else {
+    cf = load_torrc_from_disk(argc, argv);
+    if (!cf)
+      goto err;
+  }
 
   retval = options_init_from_string(cf, command, command_arg, &errmsg);
   tor_free(cf);



More information about the tor-commits mailing list