From 75f8b53d53138650460b9aeb777966cc45b1e882 Mon Sep 17 00:00:00 2001 From: Natanael Copa Date: Fri, 10 Aug 2018 13:08:09 +0000 Subject: community/pdns-recursor: rebuild against boost-1.67 --- community/pdns-recursor/boost-1.67.patch | 2175 ++++++++++++++++++++++++++++++ 1 file changed, 2175 insertions(+) create mode 100644 community/pdns-recursor/boost-1.67.patch (limited to 'community/pdns-recursor/boost-1.67.patch') diff --git a/community/pdns-recursor/boost-1.67.patch b/community/pdns-recursor/boost-1.67.patch new file mode 100644 index 0000000000..3ad1e35f8d --- /dev/null +++ b/community/pdns-recursor/boost-1.67.patch @@ -0,0 +1,2175 @@ +diff --git a/arguments.cc b/arguments.cc +index 935c9ea..5e62d41 100644 +--- a/arguments.cc ++++ b/arguments.cc +@@ -443,7 +443,7 @@ bool ArgvMap::file(const char *fname, bool lax, bool included) + set("include-dir","Directory to include configuration files from"); + + if(!parseFile(fname, "", lax)) { +- L << Logger::Warning << "Unable to open " << fname << std::endl; ++ g_log << Logger::Warning << "Unable to open " << fname << std::endl; + return false; + } + +@@ -453,7 +453,7 @@ bool ArgvMap::file(const char *fname, bool lax, bool included) + gatherIncludes(extraConfigs); + for(const std::string& fn : extraConfigs) { + if (!file(fn.c_str(), lax, true)) { +- L << Logger::Error << fn << " could not be parsed" << std::endl; ++ g_log << Logger::Error << fn << " could not be parsed" << std::endl; + throw ArgException(fn + " could not be parsed"); + } + } +@@ -471,18 +471,18 @@ void ArgvMap::gatherIncludes(std::vector &extraConfigs) { + + // stat + if (stat(params["include-dir"].c_str(), &st)) { +- L << Logger::Error << params["include-dir"] << " does not exist!" << std::endl; ++ g_log << Logger::Error << params["include-dir"] << " does not exist!" << std::endl; + throw ArgException(params["include-dir"] + " does not exist!"); + } + + // wonder if it's accessible directory + if (!S_ISDIR(st.st_mode)) { +- L << Logger::Error << params["include-dir"] << " is not a directory" << std::endl; ++ g_log << Logger::Error << params["include-dir"] << " is not a directory" << std::endl; + throw ArgException(params["include-dir"] + " is not a directory"); + } + + if (!(dir = opendir(params["include-dir"].c_str()))) { +- L << Logger::Error << params["include-dir"] << " is not accessible" << std::endl; ++ g_log << Logger::Error << params["include-dir"] << " is not accessible" << std::endl; + throw ArgException(params["include-dir"] + " is not accessible"); + } + +@@ -494,7 +494,7 @@ void ArgvMap::gatherIncludes(std::vector &extraConfigs) { + namebuf << params["include-dir"].c_str() << "/" << ent->d_name; // FIXME: Use some path separator + // ensure it's readable file + if (stat(namebuf.str().c_str(), &st) || !S_ISREG(st.st_mode)) { +- L << Logger::Error << namebuf.str() << " is not a file" << std::endl; ++ g_log << Logger::Error << namebuf.str() << " is not a file" << std::endl; + closedir(dir); + throw ArgException(namebuf.str() + " does not exist!"); + } +diff --git a/dns.hh b/dns.hh +index 88a658c..bce6202 100644 +--- a/dns.hh ++++ b/dns.hh +@@ -225,7 +225,7 @@ inline uint16_t * getFlagsFromDNSHeader(struct dnsheader * dh) + #define FLAGS_CD_OFFSET (12) + #endif + +-#define L theL() ++#define g_log theL() + extern time_t s_starttime; + + uint32_t hashQuestion(const char* packet, uint16_t len, uint32_t init); +diff --git a/gss_context.cc b/gss_context.cc +index 55c54be..8ef1061 100644 +--- a/gss_context.cc ++++ b/gss_context.cc +@@ -456,17 +456,17 @@ bool gss_add_signature(const DNSName& context, const std::string& message, std:: + string tmp_mac; + GssContext gssctx(context); + if (!gssctx.valid()) { +- L<d_rcode = RCode::FormErr; + g_stats.serverParseError++; + #ifdef HAVE_PROTOBUF +@@ -287,7 +287,7 @@ int asyncresolve(const ComboAddress& ip, const DNSName& domain, int type, bool d + return 1; // success - oddly enough + } + catch(...) { +- L< size) { +- L< *nearMissLimit) { +- L< "<<*nearMissLimit<<") bogus answers for '"< "<<*nearMissLimit<<") bogus answers for '"<count(d_remote) && !(*t_tcpClientCounts)[d_remote]--) +@@ -866,12 +866,12 @@ static void startDoResolve(void *p) + + + if(!g_quiet || tracedQuery) { +- L<getTid()<<"/"<numProcesses()<<"] " << (dc->d_tcp ? "TCP " : "") << "question for '"<d_mdp.d_qname<<"|" ++ g_log<getTid()<<"/"<numProcesses()<<"] " << (dc->d_tcp ? "TCP " : "") << "question for '"<d_mdp.d_qname<<"|" + <d_mdp.d_qtype)<<"' from "<getRemote(); + if(!dc->d_ednssubnet.source.empty()) { +- L<<" (ecs "<d_ednssubnet.source.toString()<<")"; ++ g_log<<" (ecs "<d_ednssubnet.source.toString()<<")"; + } +- L<getTid()); +@@ -934,7 +934,7 @@ static void startDoResolve(void *p) + } + catch(ImmediateServFailException &e) { + if(g_logCommonErrors) +- L<getRemote()<<" during resolve of '"<d_mdp.d_qname<<"' because: "<getRemote()<<" during resolve of '"<d_mdp.d_qname<<"' because: "<d_mdp.d_qname<<"|"<d_mdp.d_qtype).getName()<<" for "<d_remote.toStringWithPort()<d_mdp.d_qname<<"|"<d_mdp.d_qtype).getName()<<" for "<d_remote.toStringWithPort()<d_mdp.d_qname<<"|"<d_mdp.d_qtype).getName()<<" for "<d_remote.toStringWithPort()<<" validates correctly"<d_mdp.d_qname<<"|"<d_mdp.d_qtype).getName()<<" for "<d_remote.toStringWithPort()<<" validates correctly"<d_mdp.d_qname<<"|"<d_mdp.d_qtype).getName()<<" for "<d_remote.toStringWithPort()<<" validates as Insecure"<d_mdp.d_qname<<"|"<d_mdp.d_qtype).getName()<<" for "<d_remote.toStringWithPort()<<" validates as Insecure"<ad=0; + } + else if(state == Bogus) { + if(g_dnssecLogBogus || sr.doLog() || g_dnssecmode == DNSSECMode::ValidateForLog) { +- L<d_mdp.d_qname<<"|"<d_mdp.d_qtype).getName()<<" for "<d_remote.toStringWithPort()<<" validates as Bogus"<d_mdp.d_qname<<"|"<d_mdp.d_qtype).getName()<<" for "<d_remote.toStringWithPort()<<" validates as Bogus"<cd && (g_dnssecmode == DNSSECMode::ValidateAll || dc->d_mdp.d_header.ad || DNSSECOK)) { + if(sr.doLog()) { +- L<d_mdp.d_qname<<"|"<d_mdp.d_qtype).getName()<<" because recursor or query demands it for Bogus results"<d_mdp.d_qname<<"|"<d_mdp.d_qtype).getName()<<" because recursor or query demands it for Bogus results"<rcode=RCode::ServFail; + goto sendit; + } else { + if(sr.doLog()) { +- L<d_mdp.d_qname<<"|"<d_mdp.d_qtype).getName()<<" Bogus validation since neither config nor query demands this"<d_mdp.d_qname<<"|"<d_mdp.d_qtype).getName()<<" Bogus validation since neither config nor query demands this"<getRemote()<<" during validation of '"<d_mdp.d_qname<<"|"<d_mdp.d_qtype).getName()<<"' because: "<getRemote()<<" during validation of '"<d_mdp.d_qname<<"|"<d_mdp.d_qtype).getName()<<"' because: "<rcode=RCode::ServFail; + goto sendit; + } +@@ -1203,7 +1203,7 @@ static void startDoResolve(void *p) + addCMsgSrcAddr(&msgh, cbuf, &dc->d_local, 0); + } + if(sendmsg(dc->d_socket, &msgh, 0) < 0 && g_logCommonErrors) +- L<d_remote.toStringWithPort()<<" failed with: "<d_remote.toStringWithPort()<<" failed with: "<insertResponsePacket(dc->d_tag, dc->d_qhash, dc->d_mdp.d_qname, dc->d_mdp.d_qtype, dc->d_mdp.d_qclass, +@@ -1229,11 +1229,11 @@ static void startDoResolve(void *p) + bool hadError=true; + + if(wret == 0) +- L<getRemote()<getRemote()<getRemote()<<": "<< strerror(errno) <getRemote()<<": "<< strerror(errno) <getRemote()<<" for "<d_mdp.d_qname<<" (size="<< (2 + packet.size()) <<", sent "<getRemote()<<" for "<d_mdp.d_qname<<" (size="<< (2 + packet.size()) <<", sent "<d_now); + if(!g_quiet) { +- L<getTid()<<"/"<numProcesses()<<"] answer to "<<(dc->d_mdp.d_header.rd?"":"non-rd ")<<"question '"<d_mdp.d_qname<<"|"<d_mdp.d_qtype); +- L<<"': "<ancount)<<" answers, "<arcount)<<" additional, took "<getTid()<<"/"<numProcesses()<<"] answer to "<<(dc->d_mdp.d_header.rd?"":"non-rd ")<<"question '"<d_mdp.d_qname<<"|"<d_mdp.d_qtype); ++ g_log<<"': "<ancount)<<" answers, "<arcount)<<" additional, took "<d_mdp.d_qname<<", "<d_mdp.d_qname<<", "<getMaxStackUsage(), g_stats.maxMThreadStackUsage); +@@ -1449,7 +1449,7 @@ static void handleRunningTCPQuestion(int fd, FDMultiplexer::funcparam_t& var) + } + if(!bytes || bytes < 0) { + if(g_logCommonErrors) +- L<d_remote.toString() <<" disconnected after first byte"<d_remote.toString() <<" disconnected after first byte"<removeReadFD(fd); + return; + } +@@ -1457,7 +1457,7 @@ static void handleRunningTCPQuestion(int fd, FDMultiplexer::funcparam_t& var) + else if(conn->state==TCPConnection::GETQUESTION) { + ssize_t bytes=recv(conn->getFD(), conn->data + conn->bytesread, conn->qlen - conn->bytesread, 0); + if(!bytes || bytes < 0 || bytes > std::numeric_limits::max()) { +- L<d_remote.toString() <<" disconnected while reading question body"<d_remote.toString() <<" disconnected while reading question body"<removeReadFD(fd); + return; + } +@@ -1472,7 +1472,7 @@ static void handleRunningTCPQuestion(int fd, FDMultiplexer::funcparam_t& var) + catch(MOADNSException &mde) { + g_stats.clientParseError++; + if(g_logCommonErrors) +- L<d_remote.toString() <d_remote.toString() <d_tcpConnection = conn; // carry the torch +@@ -1516,14 +1516,14 @@ static void handleRunningTCPQuestion(int fd, FDMultiplexer::funcparam_t& var) + } + catch(const std::exception& e) { + if(g_logCommonErrors) +- L<d_mdp.d_header.qr) { + delete dc; + g_stats.ignoredCount++; +- L<d_remote.toString() <<" on server socket!"<d_remote.toString() <<" on server socket!"<d_mdp.d_header.opcode) { + delete dc; + g_stats.ignoredCount++; +- L<d_remote.toString() <<" on server socket!"<d_remote.toString() <<" on server socket!"<push_back(addr); + if(t_allowFrom && !t_allowFrom->match(&addr)) { + if(!g_quiet) +- L<getTid()<<"] dropping TCP query from "<getTid()<<"] dropping TCP query from "<= sizeof(struct dnsheader)) { + struct dnsheader tmpdh; +@@ -1773,14 +1773,14 @@ static string* doProcessUDPQuestion(const std::string& question, const ComboAddr + } + } + catch(std::exception& e) { +- L<ipfilter(fromaddr, destaddr, *dh)) { + if(!g_quiet) +- L<getTid()<<"/"<numProcesses()<<"] DROPPED question from "<getTid()<<"/"<numProcesses()<<"] DROPPED question from "<numProcesses() > g_maxMThreads) { + if(!g_quiet) +- L<getTid()<<"/"<numProcesses()<<"] DROPPED question from "<getTid()<<"/"<numProcesses()<<"] DROPPED question from "<match(&fromaddr)) { + if(!g_quiet) +- L<getTid()<<"] dropping UDP query from "<getTid()<<"] dropping UDP query from "<getTid()<<"] dropping UDP query from "<getTid()<<"] dropping UDP query from "<qr) { + g_stats.ignoredCount++; + if(g_logCommonErrors) +- L<opcode) { + g_stats.ignoredCount++; + if(g_logCommonErrors) +- L<opcode<<" from "<opcode<<" from "<= 0) { + if(i==locals.begin()) +- L<(pleaseGetCacheMisses); + + if(g_stats.qcounter && (cacheHits + cacheMisses) && SyncRes::s_queries && SyncRes::s_outqueries) { +- L<(pleaseGetCacheSize)<< " cache entries, "<< + broadcastAccFunction(pleaseGetNegCacheSize)<<" negative entries, "<< + (int)((cacheHits*100.0)/(cacheHits+cacheMisses))<<"% cache hits"<(pleaseGetThrottleSize) <<", ns speeds: " + << broadcastAccFunction(pleaseGetNsSpeedsSize)<(pleaseGetConcurrentQueries)<<" queries running, "<(pleaseGetPacketCacheSize) << ++ g_log<(pleaseGetPacketCacheSize) << + " packet cache entries, "<<(int)(100.0*broadcastAccFunction(pleaseGetPacketCacheHits)/SyncRes::s_queries) << "% packet cache hits"<(s_distributorThreadID)) { +- L<wantAnswer) { + if(write(g_pipes[t_id].writeFromThread, &resp, sizeof(resp)) != sizeof(resp)) { +@@ -2396,7 +2396,7 @@ vector >& operator+=(vector >&a, + template T broadcastAccFunction(const boost::function& func) + { + if (t_id != s_handlerThreadID) { +- L<" : pident.domain.toString())<<", "<d_waiters.size()<<" waiters"<" : pident.domain.toString())<<", "<d_waiters.size()<<" waiters"<= 0) { +@@ -2629,13 +2629,13 @@ FDMultiplexer* getMultiplexer() + return ret; + } + catch(FDMultiplexerException &fe) { +- L<= wantFDs) { + setFilenumLimit(wantFDs); +- L<addMask(line); + } +- L<size() <<" allow-from ranges from file '"<<::arg()["allow-from-file"]<<"' - overriding 'allow-from' setting"<size() <<" allow-from ranges from file '"<<::arg()["allow-from-file"]<<"' - overriding 'allow-from' setting"< ips; + stringtok(ips, ::arg()["allow-from"], ", "); + +- L<::const_iterator i = ips.begin(); i!= ips.end(); ++i) { + allowFrom->addMask(*i); + if(i!=ips.begin()) +- L< > parseCPUMap() + const std::string value = ::arg()["cpu-map"]; + + if (!value.empty() && !isSettingThreadCPUAffinitySupported()) { +- L< > parseCPUMap() + } + } + catch(const std::exception& e) { +- L< >& cpusMap, uns + if (cpuMapping != cpusMap.cend()) { + int rc = mapThreadToCPUList(tid, cpuMapping->second); + if (rc == 0) { +- L<second) { +- L<second) { +- L<= 0) + theL().setFacility(val); + else +- L< addrs; + if(!::arg()["query-local-address6"].empty()) { + SyncRes::s_doIPv6=true; +- L<::const_iterator i = ips.begin(); i!= ips.end(); ++i) { + SyncRes::addDontQuery(*i); + if(i!=ips.begin()) +- L< workers(g_numThreads); + if(g_numThreads == 1) { +- L<(new boost::uuids::random_generator()); + #endif +- L<(::arg()["lua-dns-script"]); +- L<getName() << "' multiplexer"<getName() << "' multiplexer"<addReadFD(g_pipes[t_id].readToThread, handlePipeRequest); +@@ -3320,7 +3320,7 @@ try + for(expired_t::iterator i=expired.begin() ; i != expired.end(); ++i) { + shared_ptr conn=any_cast >(i->second); + if(g_logCommonErrors) +- L<d_remote.toString() <d_remote.toString() <removeReadFD(i->first); + } + } +@@ -3363,15 +3363,15 @@ try + } + } + catch(PDNSException &ae) { +- L<(dynamic_cast(DSRecordContent::make(what))); + lci.dsAnchors[who].insert(*ds); + }); + broadcastAccFunction(boost::bind(pleaseWipePacketCache, who, true)); +- L< + #include "dnsrecords.hh" + #include +-#undef L ++#undef g_log + #include + #include + #include +@@ -42,7 +42,7 @@ + #include "validate.hh" + #undef max + +-#define L theL() ++#define g_log theL() + #include "namespaces.hh" + using namespace ::boost::multi_index; + +diff --git a/reczones.cc b/reczones.cc +index 7adb343..2021ce8 100644 +--- a/reczones.cc ++++ b/reczones.cc +@@ -119,10 +119,10 @@ static void makeNameToIPZone(std::shared_ptr newMap, const + ad.d_records.insert(dr); + + if(newMap->count(dr.d_name)) { +- L< newMap, cons + } + + if(newMap->count(dr.d_name)) { +- L<::const_iterator iter = servers.begin(); iter != servers.end(); ++iter) { + if(verbose && iter != servers.begin()) +- L<<", "; ++ g_log<<", "; + + ComboAddress addr=parseIPAndPort(*iter, 53); + if(verbose) +- L< original=SyncRes::getDomainMap(); + + try { +- L< parseAuthAndForwards() + // headers.first=toCanonic("", headers.first); + if(n==0) { + ad.d_rdForward = false; +- L< parseAuthAndForwards() + } + } + else { +- L< parseAuthAndForwards() + } + + if(!::arg()["forward-zones-file"].empty()) { +- L< parseAuthAndForwards() + ad.d_name = DNSName(domain); + (*newMap)[ad.d_name]=ad; + } +- L<size() - before<<" forwarding instructions from file '"<<::arg()["forward-zones-file"]<<"'"<size() - before<<" forwarding instructions from file '"<<::arg()["forward-zones-file"]<<"'"< parseAuthAndForwards() + + ifstream ifs(fname.c_str()); + if(!ifs) { +- L< parseAuthAndForwards() + } + } + if(::arg().mustDo("serve-rfc1918")) { +- L< loadRPZFromServer(const ComboAddress& master, const DNSName& zoneName, std::shared_ptr zone, boost::optional defpol, uint32_t maxTTL, const TSIGTriplet& tt, size_t maxReceivedBytes, const ComboAddress& localAddress, uint16_t axfrTimeout) + { +- L< loadRPZFromServer(const ComboAddress& master, const + throw PDNSException("Total AXFR time exceeded!"); + } + if(last != time(0)) { +- L<getZoneRepresentation()<getZoneRepresentation()< oldZone = luaconfsLocal->dfe.getZone(zoneIdx); + if (!oldZone) { +- L<getRefresh(); +@@ -337,7 +337,7 @@ void RPZIXFRTracker(const ComboAddress& master, boost::optional(dr)->d_st.serial<(dr)->d_st.serial<, vector > > deltas; + + ComboAddress local(localAddress); +@@ -347,13 +347,13 @@ void RPZIXFRTracker(const ComboAddress& master, boost::optionaldfe.getZone(zoneIdx); + /* we need to make a _full copy_ of the zone we are going to work on */ +@@ -365,7 +365,7 @@ void RPZIXFRTracker(const ComboAddress& master, boost::optionalclear(); + fullUpdate = true; + } +@@ -378,11 +378,11 @@ void RPZIXFRTracker(const ComboAddress& master, boost::optionald_st.serial<(rr); +- // L<d_st.serial<d_st.serial<d_st.serial<d_st.serial<setSerial(sr->d_st.serial); + setRPZZoneNewState(polName, sr->d_st.serial, newZone->size(), fullUpdate); + +diff --git a/secpoll-recursor.cc b/secpoll-recursor.cc +index 3248b84..d88a7eb 100644 +--- a/secpoll-recursor.cc ++++ b/secpoll-recursor.cc +@@ -55,7 +55,7 @@ void doSecPoll(time_t* last_secpoll) + } + + if(state == Bogus) { +- L<body.empty()) { +- L<body, err); + if (doc.is_null()) { +- L<headers["access-control-allow-origin"] = "*"; + + if (api_key.empty()) { +- L<url.path << "\": Authentication failed, API Key missing in config" << endl; ++ g_log<url.path << "\": Authentication failed, API Key missing in config" << endl; + throw HttpUnauthorizedException("X-API-Key"); + } + bool auth_ok = req->compareHeader("x-api-key", api_key) || req->getvars["api-key"]==api_key; + + if (!auth_ok) { +- L<url.path << "\": Authentication by API Key failed" << endl; ++ g_log<url.path << "\": Authentication by API Key failed" << endl; + throw HttpUnauthorizedException("X-API-Key"); + } + +@@ -181,7 +181,7 @@ static void webWrapper(WebServer::HandlerFunction handler, HttpRequest* req, Htt + if (!web_password.empty()) { + bool auth_ok = req->compareAuthorization(web_password); + if (!auth_ok) { +- L<url.path << "\": Web Authentication failed" << endl; ++ g_log<url.path << "\": Web Authentication failed" << endl; + throw HttpUnauthorizedException("Basic"); + } + } +@@ -206,11 +206,11 @@ void WebServer::handleRequest(HttpRequest& req, HttpResponse& resp) const + + try { + if (!req.complete) { +- L<writenWithTimeout(reply.c_str(), reply.size(), timeout); + } + catch(PDNSException &e) { +- L<d_local.toStringWithPort()<d_local.toStringWithPort()<getRemote(remote)) +- L<