瀏覽代碼

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().
Nick Mathewson 10 年之前
父節點
當前提交
dece40fd77
共有 2 個文件被更改,包括 5 次插入1 次删除
  1. 4 0
      changes/bug6979
  2. 1 1
      src/or/router.c

+ 4 - 0
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.

+ 1 - 1
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>.