Browse Source

r14425@Kushana: nickm | 2007-09-13 13:00:57 -0400
Do not load state when options->command is not RUN_TOR. (Resolves bug 499; backport candidate)


svn:r11437

Nick Mathewson 17 years ago
parent
commit
5fcc48d389
3 changed files with 6 additions and 6 deletions
  1. 3 0
      ChangeLog
  2. 1 1
      doc/TODO
  3. 2 5
      src/or/config.c

+ 3 - 0
ChangeLog

@@ -36,6 +36,9 @@ Changes in version 0.2.0.7-alpha - 2007-??-??
       a way to trigger this remotely.)
     - Fix a memory leak when freeing incomplete requests from DNSPort.
       (Found by Niels Provos with valgrind.)
+    - Don't try to access (or alter) the state file when running
+      --list-fingerprint or --verify-config or --hash-password. (Resolves
+      bug 499.)
 
   o Code simplifications and refactoring:
     - Revamp file-writing logic so we don't need to have the entire contents

+ 1 - 1
doc/TODO

@@ -103,7 +103,7 @@ Things we'd like to do in 0.2.0.x:
       extra-stable case.
     - Streamline how we pick entry nodes: Make choose_random_entry() have
       less magic and less control logic.
-    - Maybe move NT services into their own module.
+    o Maybe move NT services into their own module.
     - Refactor networkstatus generation:
       - Include "v" line in getinfo values.
 

+ 2 - 5
src/or/config.c

@@ -1007,13 +1007,10 @@ options_act(or_options_t *old_options)
   }
 
   /* Load state */
-  if (! global_state) {
+  if (! global_state && options->command == CMD_RUN_TOR) {
     if (or_state_load())
       return -1;
-
-    /* XXXX020 make this conditional? */
-    if (options->command == CMD_RUN_TOR)
-      rep_hist_load_mtbf_data(time(NULL));
+    rep_hist_load_mtbf_data(time(NULL));
   }
 
   /* Bail out at this point if we're not going to be a client or server: