[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor/master] Make sure sandbox-related getaddrinfo() functions always exist.



commit eaff47352a1ef607f6d97e9b35bd6d5eefdfcb26
Author: Nick Mathewson <nickm@xxxxxxxxxxxxxx>
Date:   Tue Nov 13 17:02:15 2018 -0500

    Make sure sandbox-related getaddrinfo() functions always exist.
---
 src/lib/net/resolve.c     | 9 +++++++++
 src/lib/net/resolve.h     | 2 +-
 src/lib/sandbox/sandbox.c | 5 -----
 3 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/src/lib/net/resolve.c b/src/lib/net/resolve.c
index 01f788296..95c1b171b 100644
--- a/src/lib/net/resolve.c
+++ b/src/lib/net/resolve.c
@@ -421,4 +421,13 @@ tor_make_getaddrinfo_cache_active(void)
 {
   sandbox_getaddrinfo_is_active = 1;
 }
+#else
+void
+sandbox_disable_getaddrinfo_cache(void)
+{
+}
+void
+tor_make_getaddrinfo_cache_active(void)
+{
+}
 #endif
diff --git a/src/lib/net/resolve.h b/src/lib/net/resolve.h
index bf870c44c..39157aaa6 100644
--- a/src/lib/net/resolve.h
+++ b/src/lib/net/resolve.h
@@ -42,7 +42,6 @@ int tor_getaddrinfo(const char *name, const char *servname,
                         struct addrinfo **res);
 void tor_freeaddrinfo(struct addrinfo *addrinfo);
 void tor_free_getaddrinfo_cache(void);
-void tor_make_getaddrinfo_cache_active(void);
 #else /* !(defined(USE_SANDBOX_GETADDRINFO)) */
 #define tor_getaddrinfo(name, servname, hints, res)  \
   getaddrinfo((name),(servname), (hints),(res))
@@ -54,5 +53,6 @@ void tor_make_getaddrinfo_cache_active(void);
 #endif /* defined(USE_SANDBOX_GETADDRINFO) */
 
 void sandbox_disable_getaddrinfo_cache(void);
+void tor_make_getaddrinfo_cache_active(void);
 
 #endif
diff --git a/src/lib/sandbox/sandbox.c b/src/lib/sandbox/sandbox.c
index 947781855..ea738b273 100644
--- a/src/lib/sandbox/sandbox.c
+++ b/src/lib/sandbox/sandbox.c
@@ -1798,9 +1798,4 @@ sandbox_is_active(void)
   return 0;
 }
 
-void
-sandbox_disable_getaddrinfo_cache(void)
-{
-}
-
 #endif /* !defined(USE_LIBSECCOMP) */



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits