aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2011-05-30 23:50:37 -0400
committerSebastian Hahn <sebastian@torproject.org>2011-10-26 22:09:44 +0200
commitcecc5b7aa1030eddcf1a613d103b81f5cb98e959 (patch)
tree8cfa14c81c803bd0b07116af7e9c3230f3632d32
parent55d9e4b8bad18a99d51b0b6347cef46e730dceda (diff)
downloadtor-cecc5b7aa1030eddcf1a613d103b81f5cb98e959.tar.gz
tor-cecc5b7aa1030eddcf1a613d103b81f5cb98e959.zip
stop asserting at boot
The patch for 3228 made us try to run init_keys() before we had loaded our state file, resulting in an assert inside init_keys. We had moved it too early in the function. Now it's later in the function, but still above the accounting calls.
-rw-r--r--src/or/config.c23
1 files changed, 11 insertions, 12 deletions
diff --git a/src/or/config.c b/src/or/config.c
index ea389ffda9..16b5e9cfa4 100644
--- a/src/or/config.c
+++ b/src/or/config.c
@@ -1277,18 +1277,6 @@ options_act(or_options_t *old_options)
return -1;
}
- /* We want to reinit keys as needed before we do much of anything else:
- keys are important, and other things can depend on them. */
- if (running_tor &&
- (transition_affects_workers ||
- (options->V3AuthoritativeDir && (!old_options ||
- !old_options->V3AuthoritativeDir)))) {
- if (init_keys() < 0) {
- log_warn(LD_BUG,"Error initializing keys; exiting");
- return -1;
- }
- }
-
if (consider_adding_dir_authorities(options, old_options) < 0)
return -1;
@@ -1333,6 +1321,17 @@ options_act(or_options_t *old_options)
finish_daemon(options->DataDirectory);
}
+ /* We want to reinit keys as needed before we do much of anything else:
+ keys are important, and other things can depend on them. */
+ if (transition_affects_workers ||
+ (options->V3AuthoritativeDir && (!old_options ||
+ !old_options->V3AuthoritativeDir))) {
+ if (init_keys() < 0) {
+ log_warn(LD_BUG,"Error initializing keys; exiting");
+ return -1;
+ }
+ }
+
/* Write our PID to the PID file. If we do not have write permissions we
* will log a warning */
if (running_tor && options->PidFile)