commit 5efbd41daa874154025c9cc8cbe65763f08306bc Merge: a776293 f8a7972 Author: Nick Mathewson nickm@torproject.org Date: Thu Dec 1 09:50:17 2016 -0500
Merge branch 'maint-0.2.9'
changes/bug20638 | 5 + src/or/config.c | 34 ----- src/or/rendservice.c | 349 +++++++++++++++++++++++++++++++++++---------------- src/or/rendservice.h | 16 ++- src/test/test_hs.c | 120 ++++++++++++++---- 5 files changed, 347 insertions(+), 177 deletions(-)
diff --cc src/or/rendservice.c index 8ffd0bc,4d04da0..457821c --- 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; }
tor-commits@lists.torproject.org