summaryrefslogtreecommitdiff
path: root/src/or/main.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/main.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/main.c')
-rw-r--r--src/or/main.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/or/main.c b/src/or/main.c
index 3af6adb99b..7125b8c5ad 100644
--- a/src/or/main.c
+++ b/src/or/main.c
@@ -692,6 +692,7 @@ static int prepare_for_poll(void) {
* retry all connections, re-upload all descriptors, and so on. */
static int do_hup(void) {
char keydir[512];
+ or_options_t *options = get_options();
log_fn(LOG_NOTICE,"Received sighup. Reloading config.");
has_completed_circuit=0;
@@ -702,11 +703,12 @@ static int do_hup(void) {
log_fn(LOG_ERR,"Reading config failed--see warnings above. For usage, try -h.");
return -1;
}
+ options = get_options();
/*XXX this should move to options_act, but only once it's been
* removed from init_keys() */
- if(authdir_mode(get_options())) {
+ if(authdir_mode(options)) {
/* reload the approved-routers file */
- tor_snprintf(keydir,sizeof(keydir),"%s/approved-routers", get_data_directory());
+ tor_snprintf(keydir,sizeof(keydir),"%s/approved-routers", options->DataDirectory);
log_fn(LOG_INFO,"Reloading approved fingerprints from %s...",keydir);
if(dirserv_parse_fingerprint_file(keydir) < 0) {
log_fn(LOG_WARN, "Error reloading fingerprints. Continuing with old list.");
@@ -714,14 +716,14 @@ static int do_hup(void) {
}
/* Fetch a new directory. Even authdirservers do this. */
directory_get_from_dirserver(DIR_PURPOSE_FETCH_DIR, NULL, 0);
- if(server_mode(get_options())) {
+ if(server_mode(options)) {
/* Restart cpuworker and dnsworker processes, so they get up-to-date
* configuration options. */
cpuworkers_rotate();
dnsworkers_rotate();
/* Rebuild fresh descriptor as needed. */
router_rebuild_descriptor();
- tor_snprintf(keydir,sizeof(keydir),"%s/router.desc", get_data_directory());
+ tor_snprintf(keydir,sizeof(keydir),"%s/router.desc", options->DataDirectory);
log_fn(LOG_INFO,"Dumping descriptor to %s...",keydir);
if (write_str_to_file(keydir, router_get_my_descriptor(), 0)) {
return -1;