[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] r12885: Backport: Don't try to create the datadir when we are only v (in tor/branches/tor-0_1_2-patches: . src/or)



Author: nickm
Date: 2007-12-20 01:15:19 -0500 (Thu, 20 Dec 2007)
New Revision: 12885

Modified:
   tor/branches/tor-0_1_2-patches/
   tor/branches/tor-0_1_2-patches/ChangeLog
   tor/branches/tor-0_1_2-patches/src/or/config.c
Log:
 r17275@catbus:  nickm | 2007-12-20 01:15:04 -0500
 Backport: Don't try to create the datadir when we are only verifying the configuration or hashing a password. Resolves bug 540.



Property changes on: tor/branches/tor-0_1_2-patches
___________________________________________________________________
 svk:merge ticket from /tor/012 [r17275] on 8246c3cf-6607-4228-993b-4d95d33730f1

Modified: tor/branches/tor-0_1_2-patches/ChangeLog
===================================================================
--- tor/branches/tor-0_1_2-patches/ChangeLog	2007-12-20 06:15:09 UTC (rev 12884)
+++ tor/branches/tor-0_1_2-patches/ChangeLog	2007-12-20 06:15:19 UTC (rev 12885)
@@ -29,6 +29,8 @@
     - When we decide to send a 503 response to a request for servers, do
       not then also send the server descriptors: this defeats the whole
       purpose.  Fixes bug 539.
+    - Don't try to create the datadir when running --verify-config or
+      --hash-password. Resolves bug 540.
 
 
 Changes in version 0.1.2.18 - 2007-10-28

Modified: tor/branches/tor-0_1_2-patches/src/or/config.c
===================================================================
--- tor/branches/tor-0_1_2-patches/src/or/config.c	2007-12-20 06:15:09 UTC (rev 12884)
+++ tor/branches/tor-0_1_2-patches/src/or/config.c	2007-12-20 06:15:19 UTC (rev 12885)
@@ -789,7 +789,8 @@
   }
 
   /* Ensure data directory is private; create if possible. */
-  if (check_private_dir(options->DataDirectory, CPD_CREATE)<0) {
+  if (check_private_dir(options->DataDirectory,
+               options->command == CMD_RUN_TOR ? CPD_CREATE : CPD_CHECK)<0) {
     char buf[1024];
     int tmp = tor_snprintf(buf, sizeof(buf),
               "Couldn't access/create private data directory \"%s\"",