From: Nick Mathewson Date: Thu, 1 Dec 2016 14:50:17 +0000 (-0500) Subject: Merge branch 'maint-0.2.9' X-Git-Tag: tor-0.3.0.1-alpha~110 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5efbd41daa874154025c9cc8cbe65763f08306bc;p=thirdparty%2Ftor.git Merge branch 'maint-0.2.9' --- 5efbd41daa874154025c9cc8cbe65763f08306bc diff --cc src/or/rendservice.c index 8ffd0bc319,4d04da02aa..457821cb49 --- a/src/or/rendservice.c +++ b/src/or/rendservice.c @@@ -286,9 -296,9 +305,9 @@@ rend_add_service(smartlist_t *service_l * lock file. But this is enough to detect a simple mistake that * at least one person has actually made. */ - if (service->directory != NULL) { + if (!rend_service_is_ephemeral(service)) { /* Skip dupe for ephemeral services. */ - SMARTLIST_FOREACH(rend_service_list, rend_service_t*, ptr, + SMARTLIST_FOREACH(s_list, rend_service_t*, ptr, dupe = dupe || !strcmp(ptr->directory, service->directory)); if (dupe) { @@@ -299,9 -309,9 +318,9 @@@ return -1; } } - smartlist_add(rend_service_list, service); + smartlist_add(s_list, service); - log_debug(LD_REND,"Configuring service with directory \"%s\"", - service->directory); + log_debug(LD_REND,"Configuring service with directory %s", + rend_service_escaped_dir(service)); for (i = 0; i < smartlist_len(service->ports); ++i) { p = smartlist_get(service->ports, i); if (!(p->is_unix_addr)) { @@@ -1009,7 -1062,12 +1074,12 @@@ service_is_single_onion_poisoned(const char *poison_fname = NULL; file_status_t fstatus; + /* Passing a NULL service is a bug */ + if (BUG(!service)) { + return 0; + } + - if (!service->directory) { + if (rend_service_is_ephemeral(service)) { return 0; }