From c52cacb1a291117b03aa7cdfb9a7bce321f9124e Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Thu, 20 Dec 2007 06:15:19 +0000 Subject: 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 --- ChangeLog | 2 ++ src/or/config.c | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) 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\"", -- cgit v1.2.3-54-g00ecf