aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2007-12-20 06:15:19 +0000
committerNick Mathewson <nickm@torproject.org>2007-12-20 06:15:19 +0000
commitc52cacb1a291117b03aa7cdfb9a7bce321f9124e (patch)
treec2c4d308cb2542e48283e9a781f4855e20310134
parent349e55e6cb5b2150ca1ef8e1f3acfa506ba8d399 (diff)
downloadtor-c52cacb1a291117b03aa7cdfb9a7bce321f9124e.tar.gz
tor-c52cacb1a291117b03aa7cdfb9a7bce321f9124e.zip
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. svn:r12885
-rw-r--r--ChangeLog2
-rw-r--r--src/or/config.c3
2 files changed, 4 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 3fed9a75d2..2a43c8c2cc 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -29,6 +29,8 @@ Changes in version 0.1.2.19 - 2007-??-??
- 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
diff --git a/src/or/config.c b/src/or/config.c
index 89a3442c84..71925b98e8 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -789,7 +789,8 @@ options_act_reversible(or_options_t *old_options, char **msg)
}
/* 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\"",