From 88153f4d34a0719cee3960acb6423d7a6a7845cb Mon Sep 17 00:00:00 2001 From: Sven Wegener Date: Tue, 3 Nov 2015 19:30:13 +0000 Subject: net-dns/pdns-recursor: cleanup Signed-off-by: Sven Wegener --- .../pdns-recursor-3.1.7.2-error-message.patch | 11 ---- .../files/pdns-recursor-3.5.3-fdlimit.patch | 67 ---------------------- .../files/pdns-recursor-3.6.1-CVE-2014-8601.patch | 52 ----------------- .../pdns-recursor/pdns-recursor-3.6.1-r1.ebuild | 59 ------------------- net-dns/pdns-recursor/pdns-recursor-3.6.2.ebuild | 55 ------------------ net-dns/pdns-recursor/pdns-recursor-3.6.3.ebuild | 55 ------------------ net-dns/pdns-recursor/pdns-recursor-3.7.1.ebuild | 61 -------------------- net-dns/pdns-recursor/pdns-recursor-3.7.2.ebuild | 61 -------------------- 8 files changed, 421 deletions(-) delete mode 100644 net-dns/pdns-recursor/files/pdns-recursor-3.1.7.2-error-message.patch delete mode 100644 net-dns/pdns-recursor/files/pdns-recursor-3.5.3-fdlimit.patch delete mode 100644 net-dns/pdns-recursor/files/pdns-recursor-3.6.1-CVE-2014-8601.patch delete mode 100644 net-dns/pdns-recursor/pdns-recursor-3.6.1-r1.ebuild delete mode 100644 net-dns/pdns-recursor/pdns-recursor-3.6.2.ebuild delete mode 100644 net-dns/pdns-recursor/pdns-recursor-3.6.3.ebuild delete mode 100644 net-dns/pdns-recursor/pdns-recursor-3.7.1.ebuild delete mode 100644 net-dns/pdns-recursor/pdns-recursor-3.7.2.ebuild (limited to 'net-dns') diff --git a/net-dns/pdns-recursor/files/pdns-recursor-3.1.7.2-error-message.patch b/net-dns/pdns-recursor/files/pdns-recursor-3.1.7.2-error-message.patch deleted file mode 100644 index 7fdf208037cd..000000000000 --- a/net-dns/pdns-recursor/files/pdns-recursor-3.1.7.2-error-message.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- pdns-recursor-3.1.7.2/rec_channel.cc -+++ pdns-recursor-3.1.7.2/rec_channel.cc -@@ -100,7 +100,7 @@ - strcpy(remote.sun_path,(path+"/"+fname).c_str()); - if(::connect(d_fd, (sockaddr*)&remote, sizeof(remote)) < 0) { - unlink(d_local.sun_path); -- throw AhuException("Unable to connect to remote '"+path+fname+"': "+string(strerror(errno))); -+ throw AhuException("Unable to connect to remote '"+path+"/"+fname+"': "+string(strerror(errno))); - } - } - diff --git a/net-dns/pdns-recursor/files/pdns-recursor-3.5.3-fdlimit.patch b/net-dns/pdns-recursor/files/pdns-recursor-3.5.3-fdlimit.patch deleted file mode 100644 index 3b6e8e25d972..000000000000 --- a/net-dns/pdns-recursor/files/pdns-recursor-3.5.3-fdlimit.patch +++ /dev/null @@ -1,67 +0,0 @@ ---- pdns-recursor-3.5.3/misc.cc -+++ pdns-recursor-3.5.3/misc.cc -@@ -22,6 +22,7 @@ - #include - #include - #include -+#include - #include - #include - #endif // WIN32 -@@ -697,3 +698,22 @@ - } while(!strchr(buffer, '\n')); - return true; - } -+ -+unsigned int getFilenumLimit(bool hardOrSoft) -+{ -+ struct rlimit rlim; -+ if(getrlimit(RLIMIT_NOFILE, &rlim) < 0) -+ unixDie("Requesting number of available file descriptors"); -+ return hardOrSoft ? rlim.rlim_max : rlim.rlim_cur; -+} -+ -+void setFilenumLimit(unsigned int lim) -+{ -+ struct rlimit rlim; -+ -+ if(getrlimit(RLIMIT_NOFILE, &rlim) < 0) -+ unixDie("Requesting number of available file descriptors"); -+ rlim.rlim_cur=lim; -+ if(setrlimit(RLIMIT_NOFILE, &rlim) < 0) -+ unixDie("Setting number of available file descriptors"); -+} ---- pdns-recursor-3.5.3/misc.hh -+++ pdns-recursor-3.5.3/misc.hh -@@ -445,4 +445,6 @@ - regex_t d_preg; - }; - -+unsigned int getFilenumLimit(bool hardOrSoft=0); -+void setFilenumLimit(unsigned int lim); - #endif ---- pdns-recursor-3.5.3/pdns_recursor.cc -+++ pdns-recursor-3.5.3/pdns_recursor.cc -@@ -1740,7 +1740,21 @@ - - g_tcpTimeout=::arg().asNum("client-tcp-timeout"); - g_maxTCPPerClient=::arg().asNum("max-tcp-per-client"); -- g_maxMThreads=::arg().asNum("max-mthreads"); -+ g_maxMThreads=::arg().asNum("max-mthreads"); -+ unsigned int availFDs=getFilenumLimit(); -+ if(g_maxMThreads * g_numThreads > availFDs) { -+ if(getFilenumLimit(true) >= g_maxMThreads * g_numThreads) { -+ setFilenumLimit(g_maxMThreads * g_numThreads); -+ L<get() || !(*t_pdl)->preresolve(dc->d_remote, g_listenSocketsAddresses[dc->d_socket], dc->d_mdp.d_qname, QType(dc->d_mdp.d_qtype), ret, res, &variableAnswer)) { -- res = sr.beginResolve(dc->d_mdp.d_qname, QType(dc->d_mdp.d_qtype), dc->d_mdp.d_qclass, ret); -+ try { -+ res = sr.beginResolve(dc->d_mdp.d_qname, QType(dc->d_mdp.d_qtype), dc->d_mdp.d_qclass, ret); -+ } -+ catch(ImmediateServFailException &e) { -+ L<d_mdp.d_qname<<"' because: "<get()) { - if(res == RCode::NoError) { -diff --git a/syncres.cc b/syncres.cc -index 4dc78b4..d09e44b 100644 ---- a/syncres.cc -+++ b/syncres.cc -@@ -923,6 +923,7 @@ int SyncRes::doResolveAt(set nameservers, string auth, - } - else { - s_outqueries++; d_outqueries++; -+ if(d_outqueries > 50) throw ImmediateServFailException("more than 50 queries sent while resolving "+qname); - TryTCP: - if(doTCP) { - LOG(prefix<toStringWithPort() <