summaryrefslogtreecommitdiff
path: root/src/or/router.c
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2004-11-09 07:05:53 +0000
committerRoger Dingledine <arma@torproject.org>2004-11-09 07:05:53 +0000
commit6521c2ce51b3b808dd8ef5c47dc9995acce149e5 (patch)
tree4957b0a02b4e397c146f9b2f4c462acf8fb02b54 /src/or/router.c
parent48a0b6c476dee067685a66a955cdffc8a37ea9d3 (diff)
downloadtor-6521c2ce51b3b808dd8ef5c47dc9995acce149e5.tar.gz
tor-6521c2ce51b3b808dd8ef5c47dc9995acce149e5.zip
Stop using the wrong DataDirectory when we're validating.
Also validate/normalize the DataDirectory better. svn:r2732
Diffstat (limited to 'src/or/router.c')
-rw-r--r--src/or/router.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/or/router.c b/src/or/router.c
index 7530c34e77..c47080e562 100644
--- a/src/or/router.c
+++ b/src/or/router.c
@@ -103,9 +103,9 @@ void rotate_onion_key(void)
char fname_prev[512];
crypto_pk_env_t *prkey;
tor_snprintf(fname,sizeof(fname),
- "%s/keys/secret_onion_key",get_data_directory());
+ "%s/keys/secret_onion_key",get_options()->DataDirectory);
tor_snprintf(fname_prev,sizeof(fname_prev),
- "%s/keys/secret_onion_key.old",get_data_directory());
+ "%s/keys/secret_onion_key.old",get_options()->DataDirectory);
if (!(prkey = crypto_new_pk_env())) {
log(LOG_ERR, "Error creating crypto environment.");
goto error;
@@ -258,12 +258,7 @@ int init_keys(void) {
return 0;
}
/* Make sure DataDirectory exists, and is private. */
- datadir = get_data_directory();
- tor_assert(datadir);
- if (strlen(datadir) > (512-128)) {
- log_fn(LOG_ERR, "DataDirectory is too long.");
- return -1;
- }
+ datadir = options->DataDirectory;
if (check_private_dir(datadir, 1)) {
return -1;
}