[tor-bugs] #4438 [Tor Directory Authority]: Dirauth sometimes exits when SafeLogging is toggled

Tor Bug Tracker & Wiki torproject-admin at torproject.org
Tue Nov 8 11:33:34 UTC 2011


#4438: Dirauth sometimes exits when SafeLogging is toggled
-------------------------------------+--------------------------------------
 Reporter:  Sebastian                |          Owner:                    
     Type:  defect                   |         Status:  new               
 Priority:  normal                   |      Milestone:  Tor: 0.2.3.x-final
Component:  Tor Directory Authority  |        Version:                    
 Keywords:                           |         Parent:                    
   Points:                           |   Actualpoints:                    
-------------------------------------+--------------------------------------

Comment(by Sebastian):

 Here's a better patch idea, inspired by a comment from frosty_un.

 {{{

 diff --git a/src/or/router.c b/src/or/router.c
 index c9f141b..c2700a0 100644
 --- a/src/or/router.c
 +++ b/src/or/router.c
 @@ -646,15 +646,26 @@ init_keys(void)
        return -1;
      }
      if (mydesc) {
 +      was_router_added_t added;
        ri = router_parse_entry_from_string(mydesc, NULL, 1, 0, NULL);
        if (!ri) {
          log_err(LD_GENERAL,"Generated a routerinfo we couldn't parse.");
          return -1;
        }
 -      if (!WRA_WAS_ADDED(dirserv_add_descriptor(ri, &m, "self"))) {
 -        log_err(LD_GENERAL,"Unable to add own descriptor to directory:
 %s",
 -                m?m:"<unknown error>");
 -        return -1;
 +      added = dirserv_add_descriptor(ri, &m, "self");
 +      if (!WRA_WAS_ADDED(added)) {
 +        if (WRA_WAS_REJECTED) {
 +          log_err(LD_GENERAL, "Unable to add own descriptor to directory:
 %s",
 +                  m?m:"<unknown error>");
 +          return -1;
 +        } else {
 +          /* If the descriptor wasn't rejected, that's ok. This can
 happen
 +           * when some config options are toggled that affect workers,
 but
 +           * we don't really need new keys yet so the descriptor doesn't
 +           * change and the old one is still fresh. */
 +          log_info(LD_GENERAL, "Couldn't add own descriptor to directory:
 %s",
 +                   m?m:"unknown error>");
 +        }
        }
      }
    }
 }}}

-- 
Ticket URL: <https://trac.torproject.org/projects/tor/ticket/4438#comment:4>
Tor Bug Tracker & Wiki <https://trac.torproject.org/>
The Tor Project: anonymity online


More information about the tor-bugs mailing list