summaryrefslogtreecommitdiff
path: root/net/powerdns-recursor/patches
diff options
context:
space:
mode:
Diffstat (limited to 'net/powerdns-recursor/patches')
-rw-r--r--net/powerdns-recursor/patches/patch-iputils.hh17
-rw-r--r--net/powerdns-recursor/patches/patch-misc.cc55
-rw-r--r--net/powerdns-recursor/patches/patch-misc.hh13
-rw-r--r--net/powerdns-recursor/patches/patch-pdns__recursor.cc22
-rw-r--r--net/powerdns-recursor/patches/patch-rec-carbon.cc31
-rw-r--r--net/powerdns-recursor/patches/patch-rec__control.cc22
-rw-r--r--net/powerdns-recursor/patches/patch-webserver.cc35
-rw-r--r--net/powerdns-recursor/patches/patch-ws-recursor.cc24
8 files changed, 202 insertions, 17 deletions
diff --git a/net/powerdns-recursor/patches/patch-iputils.hh b/net/powerdns-recursor/patches/patch-iputils.hh
deleted file mode 100644
index 22881982f7f..00000000000
--- a/net/powerdns-recursor/patches/patch-iputils.hh
+++ /dev/null
@@ -1,17 +0,0 @@
-$NetBSD: patch-iputils.hh,v 1.4 2017/06/15 07:15:57 fhajny Exp $
-
-- IP_PKTINFO structure different on NetBSD than expected.
-
---- iputils.hh.orig 2017-06-13 09:58:51.000000000 +0000
-+++ iputils.hh
-@@ -38,6 +38,10 @@
- #include <boost/tuple/tuple.hpp>
- #include <boost/tuple/tuple_comparison.hpp>
-
-+#if defined(IP_PKTINFO) && defined(__NetBSD__)
-+#undef IP_PKTINFO
-+#endif
-+
- #include "namespaces.hh"
-
- #ifdef __APPLE__
diff --git a/net/powerdns-recursor/patches/patch-misc.cc b/net/powerdns-recursor/patches/patch-misc.cc
new file mode 100644
index 00000000000..c32cbb24531
--- /dev/null
+++ b/net/powerdns-recursor/patches/patch-misc.cc
@@ -0,0 +1,55 @@
+$NetBSD: patch-misc.cc,v 1.1.2.2 2020/06/25 18:21:29 bsiegert Exp $
+
+backport changes based on PR #9127 from
+https://github.com/PowerDNS/pdns/pull/9127
+
+--- misc.cc.orig 2020-05-08 09:31:59.000000000 +0000
++++ misc.cc
+@@ -57,6 +57,7 @@
+ #include <sys/types.h>
+ #include <pwd.h>
+ #include <grp.h>
++#include <limits.h>
+ #ifdef __FreeBSD__
+ # include <pthread_np.h>
+ #endif
+@@ -1563,3 +1564,39 @@ bool setPipeBufferSize(int fd, size_t si
+ return false;
+ #endif /* F_SETPIPE_SZ */
+ }
++
++static size_t getMaxHostNameSize()
++{
++#if defined(HOST_NAME_MAX)
++ return HOST_NAME_MAX;
++#endif
++
++#if defined(_SC_HOST_NAME_MAX)
++ auto tmp = sysconf(_SC_HOST_NAME_MAX);
++ if (tmp != -1) {
++ return tmp;
++ }
++#endif
++
++ /* _POSIX_HOST_NAME_MAX */
++ return 255;
++}
++
++std::string getCarbonHostName()
++{
++ std::string hostname;
++ hostname.resize(getMaxHostNameSize() + 1, 0);
++
++ if (gethostname(const_cast<char*>(hostname.c_str()), hostname.size()) != 0) {
++ throw std::runtime_error(stringerror());
++ }
++
++ auto pos = hostname.find(".");
++ if (pos != std::string::npos) {
++ hostname.resize(pos);
++ }
++
++ boost::replace_all(hostname, ".", "_");
++
++ return hostname;
++}
diff --git a/net/powerdns-recursor/patches/patch-misc.hh b/net/powerdns-recursor/patches/patch-misc.hh
new file mode 100644
index 00000000000..b5b0bf8831f
--- /dev/null
+++ b/net/powerdns-recursor/patches/patch-misc.hh
@@ -0,0 +1,13 @@
+$NetBSD: patch-misc.hh,v 1.1.2.2 2020/06/25 18:21:29 bsiegert Exp $
+
+backport changes based on PR #9127 from
+https://github.com/PowerDNS/pdns/pull/9127
+
+--- misc.hh.orig 2020-05-08 09:31:59.000000000 +0000
++++ misc.hh
+@@ -607,3 +607,5 @@ bool isSettingThreadCPUAffinitySupported
+ int mapThreadToCPUList(pthread_t tid, const std::set<int>& cpus);
+
+ std::vector<ComboAddress> getResolvers(const std::string& resolvConfPath);
++
++std::string getCarbonHostName();
diff --git a/net/powerdns-recursor/patches/patch-pdns__recursor.cc b/net/powerdns-recursor/patches/patch-pdns__recursor.cc
new file mode 100644
index 00000000000..dfb097c10cf
--- /dev/null
+++ b/net/powerdns-recursor/patches/patch-pdns__recursor.cc
@@ -0,0 +1,22 @@
+$NetBSD: patch-pdns__recursor.cc,v 1.6.2.2 2020/06/25 18:21:29 bsiegert Exp $
+
+--- pdns_recursor.cc.orig 2020-05-08 09:31:59.000000000 +0000
++++ pdns_recursor.cc
+@@ -4673,7 +4673,7 @@ int main(int argc, char **argv)
+ ::arg().set("socket-group","Group of socket")="";
+ ::arg().set("socket-mode", "Permissions for socket")="";
+
+- ::arg().set("socket-dir",string("Where the controlsocket will live, ")+LOCALSTATEDIR+"/pdns-recursor when unset and not chrooted" )="";
++ ::arg().set("socket-dir",string("Where the controlsocket will live, ")+LOCALSTATEDIR+" when unset and not chrooted" )="";
+ ::arg().set("delegation-only","Which domains we only accept delegations from")="";
+ ::arg().set("query-local-address","Source IP address for sending queries")="0.0.0.0";
+ ::arg().set("query-local-address6","Source IPv6 address for sending queries. IF UNSET, IPv6 WILL NOT BE USED FOR OUTGOING QUERIES")="";
+@@ -4848,7 +4848,7 @@ int main(int argc, char **argv)
+
+ if (::arg()["socket-dir"].empty()) {
+ if (::arg()["chroot"].empty())
+- ::arg().set("socket-dir") = std::string(LOCALSTATEDIR) + "/pdns-recursor";
++ ::arg().set("socket-dir") = std::string(LOCALSTATEDIR);
+ else
+ ::arg().set("socket-dir") = "/";
+ }
diff --git a/net/powerdns-recursor/patches/patch-rec-carbon.cc b/net/powerdns-recursor/patches/patch-rec-carbon.cc
new file mode 100644
index 00000000000..42628a0d984
--- /dev/null
+++ b/net/powerdns-recursor/patches/patch-rec-carbon.cc
@@ -0,0 +1,31 @@
+$NetBSD: patch-rec-carbon.cc,v 1.1.2.2 2020/06/25 18:21:29 bsiegert Exp $
+
+backport changes based on PR #9127 from
+https://github.com/PowerDNS/pdns/pull/9127
+
+--- rec-carbon.cc.orig 2020-06-17 21:27:18.582569489 +0000
++++ rec-carbon.cc
+@@ -32,17 +32,13 @@ try
+ if(namespace_name.empty()) {
+ namespace_name="pdns";
+ }
+- if(hostname.empty()) {
+- char tmp[HOST_NAME_MAX+1];
+- memset(tmp, 0, sizeof(tmp));
+- if (gethostname(tmp, sizeof(tmp)) != 0) {
+- throw std::runtime_error("The 'carbon-ourname' setting has not been set and we are unable to determine the system's hostname: " + stringerror());
++ if (hostname.empty()) {
++ try {
++ hostname = getCarbonHostName();
++ }
++ catch(const std::exception& e) {
++ throw std::runtime_error(std::string("The 'carbon-ourname' setting has not been set and we are unable to determine the system's hostname: ") + e.what());
+ }
+- char *p = strchr(tmp, '.');
+- if(p) *p=0;
+-
+- hostname=tmp;
+- boost::replace_all(hostname, ".", "_");
+ }
+ if(instance_name.empty()) {
+ instance_name="recursor";
diff --git a/net/powerdns-recursor/patches/patch-rec__control.cc b/net/powerdns-recursor/patches/patch-rec__control.cc
new file mode 100644
index 00000000000..e8178f541e7
--- /dev/null
+++ b/net/powerdns-recursor/patches/patch-rec__control.cc
@@ -0,0 +1,22 @@
+$NetBSD: patch-rec__control.cc,v 1.1.2.2 2020/06/25 18:21:29 bsiegert Exp $
+
+--- rec_control.cc.orig 2020-05-08 09:30:45.000000000 +0000
++++ rec_control.cc
+@@ -39,7 +39,7 @@ static void initArguments(int argc, char
+ {
+ arg().set("config-dir","Location of configuration directory (recursor.conf)")=SYSCONFDIR;
+
+- arg().set("socket-dir",string("Where the controlsocket will live, ")+LOCALSTATEDIR+"/pdns-recursor when unset and not chrooted" )="";
++ arg().set("socket-dir",string("Where the controlsocket will live, ")+LOCALSTATEDIR+" when unset and not chrooted" )="";
+ arg().set("chroot","switch to chroot jail")="";
+ arg().set("process","When controlling multiple recursors, the target process number")="";
+ arg().set("timeout", "Number of seconds to wait for the recursor to respond")="5";
+@@ -72,7 +72,7 @@ static void initArguments(int argc, char
+
+ if (::arg()["socket-dir"].empty()) {
+ if (::arg()["chroot"].empty())
+- ::arg().set("socket-dir") = std::string(LOCALSTATEDIR) + "/pdns-recursor";
++ ::arg().set("socket-dir") = std::string(LOCALSTATEDIR);
+ else
+ ::arg().set("socket-dir") = ::arg()["chroot"] + "/";
+ } else if (!::arg()["chroot"].empty()) {
diff --git a/net/powerdns-recursor/patches/patch-webserver.cc b/net/powerdns-recursor/patches/patch-webserver.cc
new file mode 100644
index 00000000000..8d578b524c9
--- /dev/null
+++ b/net/powerdns-recursor/patches/patch-webserver.cc
@@ -0,0 +1,35 @@
+$NetBSD: patch-webserver.cc,v 1.1.2.2 2020/06/25 18:21:29 bsiegert Exp $
+
+boost 1.73 moved placeholders into std::placeholders namespace
+backport changes based on PR #9070 from
+https://github.com/PowerDNS/pdns/pull/9070/
+
+--- webserver.cc.orig 2020-05-08 09:30:45.000000000 +0000
++++ webserver.cc
+@@ -107,7 +107,7 @@ static void bareHandlerWrapper(WebServer
+
+ void WebServer::registerBareHandler(const string& url, HandlerFunction handler)
+ {
+- YaHTTP::THandlerFunction f = boost::bind(&bareHandlerWrapper, handler, _1, _2);
++ YaHTTP::THandlerFunction f = std::bind(&bareHandlerWrapper, handler, std::placeholders::_1, std::placeholders::_2);
+ YaHTTP::Router::Any(url, f);
+ }
+
+@@ -179,7 +179,7 @@ void WebServer::apiWrapper(WebServer::Ha
+ }
+
+ void WebServer::registerApiHandler(const string& url, HandlerFunction handler, bool allowPassword) {
+- HandlerFunction f = boost::bind(&WebServer::apiWrapper, this, handler, _1, _2, allowPassword);
++ HandlerFunction f = std::bind(&WebServer::apiWrapper, this, handler, std::placeholders::_1, std::placeholders::_2, allowPassword);
+ registerBareHandler(url, f);
+ }
+
+@@ -196,7 +196,7 @@ void WebServer::webWrapper(WebServer::Ha
+ }
+
+ void WebServer::registerWebHandler(const string& url, HandlerFunction handler) {
+- HandlerFunction f = boost::bind(&WebServer::webWrapper, this, handler, _1, _2);
++ HandlerFunction f = std::bind(&WebServer::webWrapper, this, handler, std::placeholders::_1, std::placeholders::_2);
+ registerBareHandler(url, f);
+ }
+
diff --git a/net/powerdns-recursor/patches/patch-ws-recursor.cc b/net/powerdns-recursor/patches/patch-ws-recursor.cc
new file mode 100644
index 00000000000..513eea5b7ca
--- /dev/null
+++ b/net/powerdns-recursor/patches/patch-ws-recursor.cc
@@ -0,0 +1,24 @@
+$NetBSD: patch-ws-recursor.cc,v 1.1.2.2 2020/06/25 18:21:29 bsiegert Exp $
+
+boost 1.73 moved placeholders into std::placeholders namespace
+backport changes based on PR #9070 from
+https://github.com/PowerDNS/pdns/pull/9070/
+
+--- ws-recursor.cc.orig 2020-05-08 09:31:59.000000000 +0000
++++ ws-recursor.cc
+@@ -512,7 +512,7 @@ RecursorWebServer::RecursorWebServer(FDM
+ d_ws->bind();
+
+ // legacy dispatch
+- d_ws->registerApiHandler("/jsonstat", boost::bind(&RecursorWebServer::jsonstat, this, _1, _2), true);
++ d_ws->registerApiHandler("/jsonstat", std::bind(&RecursorWebServer::jsonstat, this, std::placeholders::_1, std::placeholders::_2), true);
+ d_ws->registerApiHandler("/api/v1/servers/localhost/cache/flush", &apiServerCacheFlush);
+ d_ws->registerApiHandler("/api/v1/servers/localhost/config/allow-from", &apiServerConfigAllowFrom);
+ d_ws->registerApiHandler("/api/v1/servers/localhost/config", &apiServerConfig);
+@@ -743,5 +743,5 @@ void AsyncWebServer::go() {
+ auto server = std::dynamic_pointer_cast<AsyncServer>(d_server);
+ if (!server)
+ return;
+- server->asyncWaitForConnections(d_fdm, boost::bind(&AsyncWebServer::serveConnection, this, _1));
++ server->asyncWaitForConnections(d_fdm, std::bind(&AsyncWebServer::serveConnection, this, std::placeholders::_1));
+ }