commit 2e607ff51931b35ee531fa60b83487b3f4f944a7 Merge: a0be2f1 e1a25f0 Author: Nick Mathewson nickm@torproject.org Date: Mon Sep 29 13:02:50 2014 -0400
Merge remote-tracking branch 'origin/maint-0.2.5'
changes/13295 | 5 +++++ src/common/sandbox.c | 21 +++++++++++++++++++++ src/common/sandbox.h | 2 ++ src/tools/tor-resolve.c | 2 ++ 4 files changed, 30 insertions(+)
diff --cc src/common/sandbox.c index c7e4dcd,dbbaa59..36022c9 --- a/src/common/sandbox.c +++ b/src/common/sandbox.c @@@ -1292,11 -1380,23 +1292,23 @@@ static HT_HEAD(getaddrinfo_cache, cache HT_PROTOTYPE(getaddrinfo_cache, cached_getaddrinfo_item_t, node, cached_getaddrinfo_item_hash, cached_getaddrinfo_items_eq); -HT_GENERATE(getaddrinfo_cache, cached_getaddrinfo_item_t, node, - cached_getaddrinfo_item_hash, - cached_getaddrinfo_items_eq, - 0.6, tor_malloc_, tor_realloc_, tor_free_); +HT_GENERATE2(getaddrinfo_cache, cached_getaddrinfo_item_t, node, + cached_getaddrinfo_item_hash, + cached_getaddrinfo_items_eq, + 0.6, tor_reallocarray_, tor_free_)
+ /** If true, don't try to cache getaddrinfo results. */ + static int sandbox_getaddrinfo_cache_disabled = 0; + + /** Tell the sandbox layer not to try to cache getaddrinfo results. Used as in + * tor-resolve, when we have no intention of initializing crypto or of + * installing the sandbox.*/ + void + sandbox_disable_getaddrinfo_cache(void) + { + sandbox_getaddrinfo_cache_disabled = 1; + } + int sandbox_getaddrinfo(const char *name, const char *servname, const struct addrinfo *hints,
tor-commits@lists.torproject.org