From b228d62898de0dc2f777df4ac3f353a27f4c8ba0 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Thu, 13 Sep 2007 17:40:11 +0000 Subject: [PATCH] r14427@Kushana: nickm | 2007-09-13 13:28:22 -0400 Backport: Do not load state when options->command is not RUN_TOR. (Resolves bug 499) svn:r11438 --- ChangeLog | 5 +++++ src/or/config.c | 10 +++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 73b7ab883d..77b283124b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,11 @@ Changes in version 0.1.2.18 - 2007-??-?? - Fix possible segfaults in functions called from rend_process_relay_cell(). + o Minor bugfixes: + - Don't try to access (or alter) the state file when running + --list-fingerprint or --verify-config or --hash-password. (Resolves + bug 499.) + Changes in version 0.1.2.17 - 2007-08-30 o Major bugfixes (security): diff --git a/src/or/config.c b/src/or/config.c index 3907875afc..39dc7aee90 100644 --- a/src/or/config.c +++ b/src/or/config.c @@ -917,16 +917,16 @@ options_act(or_options_t *old_options) tor_free(fn); } - /* Load state */ - if (! global_state) - if (or_state_load()) - return -1; - /* Bail out at this point if we're not going to be a client or server: * we want to not fork, and to log stuff to stderr. */ if (options->command != CMD_RUN_TOR) return 0; + /* Load state */ + if (! global_state) + if (or_state_load()) + return -1; + { smartlist_t *sl = smartlist_create(); char *errmsg = NULL;