summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2005-05-03 00:36:57 +0000
committerNick Mathewson <nickm@torproject.org>2005-05-03 00:36:57 +0000
commit4666b801faf3e19f8919fab091f9881a516033a3 (patch)
tree8a57696303aebbc2fb5fefb81e142f34ebe4368a
parent14bac4dad4257ac911a3e7a60806c6940ac4d372 (diff)
downloadtor-4666b801faf3e19f8919fab091f9881a516033a3.tar.gz
tor-4666b801faf3e19f8919fab091f9881a516033a3.zip
If DataDir is ~/.tor, and that expands to /.tor, then default to LOCALSTATEDIR/tor instead.
svn:r4170
-rw-r--r--src/or/config.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/or/config.c b/src/or/config.c
index 0f2e395242..d663c2c1d5 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -2336,7 +2336,10 @@ normalize_data_directory(or_options_t *options) {
if (!options->DataDirectory && !strcmp(fn,"/.tor")) {
/* If our homedir is /, we probably don't want to use it. */
/* XXXX Default to /var/lib/tor? */
- log_fn(LOG_WARN, "Defaulting to 'DataDirectory %s', which may not be what you want", fn);
+ log_fn(LOG_WARN, "Default DataDirectory is ~/.tor, which works out to %s, which is probably not what you want. Using %s/tor instead", fn, LOCALSTATEDIR);
+ tor_free(fn);
+ fn = tor_strdup(LOCALSTATEDIR"/tor");
+
}
tor_free(options->DataDirectory);
options->DataDirectory = fn;