[tor-commits] [tor/maint-0.2.4] Fix an assert when disabling ORPort with accounting disabled.

nickm at torproject.org nickm at torproject.org
Tue Oct 8 16:17:08 UTC 2013


commit dece40fd7729934bc32906e94d3e5e746c01f970
Author: Nick Mathewson <nickm at torproject.org>
Date:   Wed Sep 18 10:26:32 2013 -0400

    Fix an assert when disabling ORPort with accounting disabled.
    
    The problem was that the server_identity_key_is_set() function could
    return true under conditions where we don't really have an identity
    key -- specifically, where we used to have one, but we stopped being a
    server.
    
    This is a fix for 6979; bugfix on 0.2.2.18-alpha where we added that
    assertion to get_server_identity_key().
---
 changes/bug6979 |    4 ++++
 src/or/router.c |    2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/changes/bug6979 b/changes/bug6979
new file mode 100644
index 0000000..55572ec
--- /dev/null
+++ b/changes/bug6979
@@ -0,0 +1,4 @@
+  o Minor bugfixes:
+    - Fix an assertion failure that would occur when disabling the
+      ORPort setting on a running Tor process while accounting was
+      enabled. Fixes bug 6979; bugfix on 0.2.2.18-alpha.
diff --git a/src/or/router.c b/src/or/router.c
index 1ace8e2..a3459ae 100644
--- a/src/or/router.c
+++ b/src/or/router.c
@@ -177,7 +177,7 @@ get_server_identity_key(void)
 int
 server_identity_key_is_set(void)
 {
-  return server_identitykey != NULL;
+  return server_mode(get_options()) && server_identitykey != NULL;
 }
 
 /** Set the current client identity key to <b>k</b>.





More information about the tor-commits mailing list