[tor-commits] [tor/master] Allow single DA if explicitly configured

nickm at torproject.org nickm at torproject.org
Mon Jul 9 14:18:10 UTC 2018


commit 97fad9948312417099fe3d8f5b17484be91ad3f9
Author: Gabriel L. Somlo <gsomlo at gmail.com>
Date:   Mon May 14 11:47:22 2018 -0400

    Allow single DA if explicitly configured
    
    When on a private network a single directory authority is explicitly
    configured, allow that DA's instace of tor to pick itself as its own
    DA, by having router_pick_dirserver_generic() set the PDS_ALLOW_SELF
    flag when the list of potential sources contains only one element.
    This would subsequently allow router_pick_trusteddirserver_impl() to
    calculate is 'requreother' condition as 'false', enabling it to pick
    itself as a valid DA candidate.
    
    Fixes #25928
    
    Signed-off-by: Gabriel Somlo <gsomlo at gmail.com>
---
 src/or/routerlist.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/or/routerlist.c b/src/or/routerlist.c
index 76a236ff2..e8391724b 100644
--- a/src/or/routerlist.c
+++ b/src/or/routerlist.c
@@ -1806,6 +1806,9 @@ router_pick_dirserver_generic(smartlist_t *sourcelist,
   const routerstatus_t *choice;
   int busy = 0;
 
+  if (smartlist_len(sourcelist) == 1)
+    flags |= PDS_ALLOW_SELF;
+
   choice = router_pick_trusteddirserver_impl(sourcelist, type, flags, &busy);
   if (choice || !(flags & PDS_RETRY_IF_NO_SERVERS))
     return choice;





More information about the tor-commits mailing list