From: Otto Date: Tue, 13 Apr 2021 08:47:38 +0000 (+0200) Subject: Stop using potentially offensive names internally and warn about X-Git-Tag: dnsdist-1.6.0-rc1~11^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3d324e0067dcbc158a280282a5772f3309a4ef81;p=thirdparty%2Fpdns.git Stop using potentially offensive names internally and warn about deprecated settings. --- diff --git a/pdns/arguments.cc b/pdns/arguments.cc index 865d30756a..4ece63184d 100644 --- a/pdns/arguments.cc +++ b/pdns/arguments.cc @@ -347,6 +347,25 @@ bool ArgvMap::parmIsset(const string &var) return d_params.find(var) != d_params.end(); } +// ATM Shared between Recursor and Auth, is that a good idea? +static const map deprecateList = { + { "stats-api-blacklist", "stats-api-disabled-list" }, + { "stats-carbon-blacklist", "stats-carbon-disabled-list" }, + { "stats-rec-control-blacklist", "stats-rec-control-disabled-list" }, + { "stats-snmp-blacklist", "stats-snmp-disabled-list" }, + { "edns-subnet-whitelist", "edns-subnet-allow-list" }, + { "new-domain-whitelist", "new-domain-ignore-list" }, + { "snmp-master-socket", "snmp-daemon-socket" } +}; + +static void warnIfDeprecated(const string& var) +{ + const auto msg = deprecateList.find(var); + if (msg != deprecateList.end()) { + g_log << Logger::Warning << "'" << var << "' is deprecated and will be removed in a future release, use '" << msg->second << "' instead" << endl; + } +} + void ArgvMap::parseOne(const string &arg, const string &parseOnly, bool lax) { string var, val; @@ -380,6 +399,7 @@ void ArgvMap::parseOne(const string &arg, const string &parseOnly, bool lax) boost::trim(var); if(var!="" && (parseOnly.empty() || var==parseOnly)) { + warnIfDeprecated(var); pos=val.find_first_not_of(" \t"); // strip leading whitespace if(pos && pos!=string::npos) val=val.substr(pos); diff --git a/pdns/ixfr.cc b/pdns/ixfr.cc index dfda4d3f50..7b47f1affd 100644 --- a/pdns/ixfr.cc +++ b/pdns/ixfr.cc @@ -26,12 +26,12 @@ #include "dnssecinfra.hh" #include "tsigverifier.hh" -vector, vector > > processIXFRRecords(const ComboAddress& master, const DNSName& zone, - const vector& records, const std::shared_ptr& masterSOA) +vector, vector > > processIXFRRecords(const ComboAddress& primary, const DNSName& zone, + const vector& records, const std::shared_ptr& primarySOA) { vector, vector > > ret; - if (records.size() == 0 || masterSOA == nullptr) { + if (records.size() == 0 || primarySOA == nullptr) { return ret; } @@ -51,14 +51,14 @@ vector, vector > > processIXFRRecords(const Co auto sr = getRR(records[pos]); if (!sr) { - throw std::runtime_error("Error getting the content of the first SOA record of this IXFR sequence for zone '"+zone.toLogString()+"' from master '"+master.toStringWithPort()+"'"); + throw std::runtime_error("Error getting the content of the first SOA record of this IXFR sequence for zone '"+zone.toLogString()+"' from primary '"+primary.toStringWithPort()+"'"); } - // cerr<<"Serial is "<d_st.serial<<", final serial is "<d_st.serial<d_st.serial<<", final serial is "<d_st.serial<d_st.serial == masterSOA->d_st.serial) { + if (sr->d_st.serial == primarySOA->d_st.serial) { if (records.size() == 2) { // if the entire update is two SOAs records with the same // serial, this is actually an empty AXFR! @@ -77,12 +77,12 @@ vector, vector > > processIXFRRecords(const Co } if (pos >= records.size()) { - throw std::runtime_error("No SOA record to finish the removals part of the IXFR sequence of zone '" + zone.toLogString() + "' from " + master.toStringWithPort()); + throw std::runtime_error("No SOA record to finish the removals part of the IXFR sequence of zone '" + zone.toLogString() + "' from " + primary.toStringWithPort()); } sr = getRR(records[pos]); if (!sr) { - throw std::runtime_error("Invalid SOA record to finish the removals part of the IXFR sequence of zone '" + zone.toLogString() + "' from " + master.toStringWithPort()); + throw std::runtime_error("Invalid SOA record to finish the removals part of the IXFR sequence of zone '" + zone.toLogString() + "' from " + primary.toStringWithPort()); } // this is the serial of the zone after the removals @@ -97,22 +97,22 @@ vector, vector > > processIXFRRecords(const Co } if (pos >= records.size()) { - throw std::runtime_error("No SOA record to finish the additions part of the IXFR sequence of zone '" + zone.toLogString() + "' from " + master.toStringWithPort()); + throw std::runtime_error("No SOA record to finish the additions part of the IXFR sequence of zone '" + zone.toLogString() + "' from " + primary.toStringWithPort()); } sr = getRR(records[pos]); if (!sr) { - throw std::runtime_error("Invalid SOA record to finish the additions part of the IXFR sequence of zone '" + zone.toLogString() + "' from " + master.toStringWithPort()); + throw std::runtime_error("Invalid SOA record to finish the additions part of the IXFR sequence of zone '" + zone.toLogString() + "' from " + primary.toStringWithPort()); } if (sr->d_st.serial != newSerial) { - throw std::runtime_error("Invalid serial (" + std::to_string(sr->d_st.serial) + ", expecting " + std::to_string(newSerial) + ") in the SOA record finishing the additions part of the IXFR sequence of zone '" + zone.toLogString() + "' from " + master.toStringWithPort()); + throw std::runtime_error("Invalid serial (" + std::to_string(sr->d_st.serial) + ", expecting " + std::to_string(newSerial) + ") in the SOA record finishing the additions part of the IXFR sequence of zone '" + zone.toLogString() + "' from " + primary.toStringWithPort()); } - if (newSerial == masterSOA->d_st.serial) { + if (newSerial == primarySOA->d_st.serial) { // this was the last sequence if (pos != (records.size() - 1)) { - throw std::runtime_error("Trailing records after the last IXFR sequence of zone '" + zone.toLogString() + "' from " + master.toStringWithPort()); + throw std::runtime_error("Trailing records after the last IXFR sequence of zone '" + zone.toLogString() + "' from " + primary.toStringWithPort()); } } @@ -123,7 +123,7 @@ vector, vector > > processIXFRRecords(const Co } // Returns pairs of "remove & add" vectors. If you get an empty remove, it means you got an AXFR! -vector, vector > > getIXFRDeltas(const ComboAddress& master, const DNSName& zone, const DNSRecord& oursr, +vector, vector > > getIXFRDeltas(const ComboAddress& primary, const DNSName& zone, const DNSRecord& oursr, const TSIGTriplet& tt, const ComboAddress* laddr, size_t maxReceivedBytes) { vector, vector > > ret; @@ -137,7 +137,7 @@ vector, vector > > getIXFRDeltas(const ComboAd pw.commit(); TSIGRecordContent trc; - TSIGTCPVerifier tsigVerifier(tt, master, trc); + TSIGTCPVerifier tsigVerifier(tt, primary, trc); if(!tt.algo.empty()) { TSIGHashEnum the; getTSIGHashEnum(tt.algo, the); @@ -156,22 +156,22 @@ vector, vector > > getIXFRDeltas(const ComboAd string msg((const char*)&len, 2); msg.append((const char*)&packet[0], packet.size()); - Socket s(master.sin4.sin_family, SOCK_STREAM); + Socket s(primary.sin4.sin_family, SOCK_STREAM); // cout<<"going to connect"< masterSOA = nullptr; + // CURRENT PRIMARY SOA + std::shared_ptr primarySOA = nullptr; vector records; size_t receivedBytes = 0; int8_t ixfrInProgress = -2; @@ -191,7 +191,7 @@ vector, vector > > getIXFRDeltas(const ComboAd break; if (maxReceivedBytes > 0 && (maxReceivedBytes - receivedBytes) < (size_t) len) - throw std::runtime_error("Reached the maximum number of received bytes in an IXFR delta for zone '"+zone.toLogString()+"' from master "+master.toStringWithPort()); + throw std::runtime_error("Reached the maximum number of received bytes in an IXFR delta for zone '"+zone.toLogString()+"' from primary "+primary.toStringWithPort()); reply.resize(len); readn2(s.getHandle(), &reply.at(0), len); @@ -199,7 +199,7 @@ vector, vector > > getIXFRDeltas(const ComboAd MOADNSParser mdp(false, reply); if(mdp.d_header.rcode) - throw std::runtime_error("Got an error trying to IXFR zone '"+zone.toLogString()+"' from master '"+master.toStringWithPort()+"': "+RCode::to_s(mdp.d_header.rcode)); + throw std::runtime_error("Got an error trying to IXFR zone '"+zone.toLogString()+"' from primary '"+primary.toStringWithPort()+"': "+RCode::to_s(mdp.d_header.rcode)); // cout<<"Got a response, rcode: "<, vector > > getIXFRDeltas(const ComboAd for(auto& r: mdp.d_answers) { // cout<getZoneRepresentation()<(r.first); if (!sr) { - throw std::runtime_error("Error getting the content of the first SOA record of the IXFR answer for zone '"+zone.toLogString()+"' from master '"+master.toStringWithPort()+"'"); + throw std::runtime_error("Error getting the content of the first SOA record of the IXFR answer for zone '"+zone.toLogString()+"' from primary '"+primary.toStringWithPort()+"'"); } if(sr->d_st.serial == std::dynamic_pointer_cast(oursr.d_content)->d_st.serial) { // we are up to date return ret; } - masterSOA = sr; + primarySOA = sr; } else if (r.first.d_type == QType::SOA) { auto sr = getRR(r.first); if (!sr) { - throw std::runtime_error("Error getting the content of SOA record of IXFR answer for zone '"+zone.toLogString()+"' from master '"+master.toStringWithPort()+"'"); + throw std::runtime_error("Error getting the content of SOA record of IXFR answer for zone '"+zone.toLogString()+"' from primary '"+primary.toStringWithPort()+"'"); } // we hit the last SOA record // IXFR is considered to be done if we hit the last SOA record twice - if (masterSOA->d_st.serial == sr->d_st.serial) { + if (primarySOA->d_st.serial == sr->d_st.serial) { ixfrInProgress++; } } @@ -245,7 +245,7 @@ vector, vector > > getIXFRDeltas(const ComboAd if(r.first.d_type == QType::OPT) continue; - throw std::runtime_error("Unexpected record (" +QType(r.first.d_type).getName()+") in non-answer section ("+std::to_string(r.first.d_place)+")in IXFR response for zone '"+zone.toLogString()+"' from master '"+master.toStringWithPort()); + throw std::runtime_error("Unexpected record (" +QType(r.first.d_type).getName()+") in non-answer section ("+std::to_string(r.first.d_place)+")in IXFR response for zone '"+zone.toLogString()+"' from primary '"+primary.toStringWithPort()); } r.first.d_name.makeUsRelative(zone); @@ -255,5 +255,5 @@ vector, vector > > getIXFRDeltas(const ComboAd // cout<<"Got "<, vector > > getIXFRDeltas(const ComboAddress& master, const DNSName& zone, +vector, vector > > getIXFRDeltas(const ComboAddress& primary, const DNSName& zone, const DNSRecord& sr, const TSIGTriplet& tt=TSIGTriplet(), const ComboAddress* laddr=0, size_t maxReceivedBytes=0); -vector, vector > > processIXFRRecords(const ComboAddress& master, const DNSName& zone, - const vector& records, const std::shared_ptr& masterSOA); +vector, vector > > processIXFRRecords(const ComboAddress& primary, const DNSName& zone, + const vector& records, const std::shared_ptr& primarySOA); diff --git a/pdns/pdns_recursor.cc b/pdns/pdns_recursor.cc index 5ff39d9fc8..dd9c4b2219 100644 --- a/pdns/pdns_recursor.cc +++ b/pdns/pdns_recursor.cc @@ -1308,7 +1308,7 @@ static bool checkFrameStreamExport(LocalStateHolder& luaconfsLoc static bool nodCheckNewDomain(const DNSName& dname) { bool ret = false; - // First check the (sub)domain isn't whitelisted for NOD purposes + // First check the (sub)domain isn't ignored for NOD purposes if (!g_nodDomainWL.check(dname)) { // Now check the NODDB (note this is probabilistic so can have FNs/FPs) if (t_nodDBp && t_nodDBp->isNewDomain(dname)) { @@ -4499,7 +4499,7 @@ static void setupNODThread() } } -static void parseNODWhitelist(const std::string& wlist) +static void parseNODIgnorelist(const std::string& wlist) { vector parts; stringtok(parts, wlist, ",; "); @@ -4514,8 +4514,8 @@ static void setupNODGlobal() g_nodEnabled = ::arg().mustDo("new-domain-tracking"); g_nodLookupDomain = DNSName(::arg()["new-domain-lookup"]); g_nodLog = ::arg().mustDo("new-domain-log"); - parseNODWhitelist(::arg()["new-domain-whitelist"]); - parseNODWhitelist(::arg()["new-domain-ignore-list"]); + parseNODIgnorelist(::arg()["new-domain-whitelist"]); + parseNODIgnorelist(::arg()["new-domain-ignore-list"]); // Setup Unique DNS Response subsystem g_udrEnabled = ::arg().mustDo("unique-response-tracking"); @@ -4767,8 +4767,8 @@ static int serviceMain(int argc, char*argv[]) SyncRes::setECSScopeZeroAddress(nm); } - SyncRes::parseEDNSSubnetWhitelist(::arg()["edns-subnet-whitelist"]); - SyncRes::parseEDNSSubnetWhitelist(::arg()["edns-subnet-allow-list"]); + SyncRes::parseEDNSSubnetAllowlist(::arg()["edns-subnet-whitelist"]); + SyncRes::parseEDNSSubnetAllowlist(::arg()["edns-subnet-allow-list"]); SyncRes::parseEDNSSubnetAddFor(::arg()["ecs-add-for"]); g_useIncomingECS = ::arg().mustDo("use-incoming-edns-subnet"); @@ -5057,15 +5057,15 @@ static int serviceMain(int argc, char*argv[]) g_useKernelTimestamp = ::arg().mustDo("protobuf-use-kernel-timestamp"); - blacklistStats(StatComponent::API, ::arg()["stats-api-blacklist"]); - blacklistStats(StatComponent::Carbon, ::arg()["stats-carbon-blacklist"]); - blacklistStats(StatComponent::RecControl, ::arg()["stats-rec-control-blacklist"]); - blacklistStats(StatComponent::SNMP, ::arg()["stats-snmp-blacklist"]); + disableStats(StatComponent::API, ::arg()["stats-api-blacklist"]); + disableStats(StatComponent::Carbon, ::arg()["stats-carbon-blacklist"]); + disableStats(StatComponent::RecControl, ::arg()["stats-rec-control-blacklist"]); + disableStats(StatComponent::SNMP, ::arg()["stats-snmp-blacklist"]); - blacklistStats(StatComponent::API, ::arg()["stats-api-disabled-list"]); - blacklistStats(StatComponent::Carbon, ::arg()["stats-carbon-disabled-list"]); - blacklistStats(StatComponent::RecControl, ::arg()["stats-rec-control-disabled-list"]); - blacklistStats(StatComponent::SNMP, ::arg()["stats-snmp-disabled-list"]); + disableStats(StatComponent::API, ::arg()["stats-api-disabled-list"]); + disableStats(StatComponent::Carbon, ::arg()["stats-carbon-disabled-list"]); + disableStats(StatComponent::RecControl, ::arg()["stats-rec-control-disabled-list"]); + disableStats(StatComponent::SNMP, ::arg()["stats-snmp-disabled-list"]); if (::arg().mustDo("snmp-agent")) { string setting = ::arg()["snmp-daemon-socket"]; @@ -5572,22 +5572,22 @@ int main(int argc, char **argv) ::arg().set("snmp-master-socket", "If set and snmp-agent is set, the socket to use to register to the SNMP daemon (deprecated)")=""; ::arg().set("snmp-daemon-socket", "If set and snmp-agent is set, the socket to use to register to the SNMP daemon")=""; - std::string defaultBlacklistedStats = "cache-bytes, packetcache-bytes, special-memory-usage"; + std::string defeaultDisabledStats = "cache-bytes, packetcache-bytes, special-memory-usage"; for (size_t idx = 0; idx < 32; idx++) { - defaultBlacklistedStats += ", ecs-v4-response-bits-" + std::to_string(idx + 1); + defeaultDisabledStats += ", ecs-v4-response-bits-" + std::to_string(idx + 1); } for (size_t idx = 0; idx < 128; idx++) { - defaultBlacklistedStats += ", ecs-v6-response-bits-" + std::to_string(idx + 1); + defeaultDisabledStats += ", ecs-v6-response-bits-" + std::to_string(idx + 1); } - ::arg().set("stats-api-blacklist", "List of statistics that are disabled when retrieving the complete list of statistics via the API (deprecated)")=defaultBlacklistedStats; - ::arg().set("stats-carbon-blacklist", "List of statistics that are prevented from being exported via Carbon (deprecated)")=defaultBlacklistedStats; - ::arg().set("stats-rec-control-blacklist", "List of statistics that are prevented from being exported via rec_control get-all (deprecated)")=defaultBlacklistedStats; - ::arg().set("stats-snmp-blacklist", "List of statistics that are prevented from being exported via SNMP (deprecated)")=defaultBlacklistedStats; + ::arg().set("stats-api-blacklist", "List of statistics that are disabled when retrieving the complete list of statistics via the API (deprecated)")=defeaultDisabledStats; + ::arg().set("stats-carbon-blacklist", "List of statistics that are prevented from being exported via Carbon (deprecated)")=defeaultDisabledStats; + ::arg().set("stats-rec-control-blacklist", "List of statistics that are prevented from being exported via rec_control get-all (deprecated)")=defeaultDisabledStats; + ::arg().set("stats-snmp-blacklist", "List of statistics that are prevented from being exported via SNMP (deprecated)")=defeaultDisabledStats; - ::arg().set("stats-api-disabled-list", "List of statistics that are disabled when retrieving the complete list of statistics via the API")=defaultBlacklistedStats; - ::arg().set("stats-carbon-disabled-list", "List of statistics that are prevented from being exported via Carbon")=defaultBlacklistedStats; - ::arg().set("stats-rec-control-disabled-list", "List of statistics that are prevented from being exported via rec_control get-all")=defaultBlacklistedStats; - ::arg().set("stats-snmp-disabled-list", "List of statistics that are prevented from being exported via SNMP")=defaultBlacklistedStats; + ::arg().set("stats-api-disabled-list", "List of statistics that are disabled when retrieving the complete list of statistics via the API")=defeaultDisabledStats; + ::arg().set("stats-carbon-disabled-list", "List of statistics that are prevented from being exported via Carbon")=defeaultDisabledStats; + ::arg().set("stats-rec-control-disabled-list", "List of statistics that are prevented from being exported via rec_control get-all")=defeaultDisabledStats; + ::arg().set("stats-snmp-disabled-list", "List of statistics that are prevented from being exported via SNMP")=defeaultDisabledStats; ::arg().set("tcp-fast-open", "Enable TCP Fast Open support on the listening sockets, using the supplied numerical value as the queue size")="0"; ::arg().set("tcp-fast-open-connect", "Enable TCP Fast Open support on outgoing sockets")="no"; @@ -5642,7 +5642,7 @@ int main(int argc, char **argv) ::arg().set("edns-padding-from", "List of netmasks (proxy IP in case of XPF or proxy-protocol presence, client IP otherwise) for which EDNS padding will be enabled in responses, provided that 'edns-padding-mode' applies")=""; ::arg().set("edns-padding-mode", "Whether to add EDNS padding to all responses ('always') or only to responses for queries containing the EDNS padding option ('padded-queries-only', the default). In both modes, padding will only be added to responses for queries coming from `edns-padding-from`_ sources")="padded-queries-only"; - ::arg().set("edns-padding-tag", "Packetcache tag associated to responses sent with EDNS padding, to prevent sending these to non-whitelisted clients.")="7830"; + ::arg().set("edns-padding-tag", "Packetcache tag associated to responses sent with EDNS padding, to prevent sending these toclients for which padding is not enabled.")="7830"; ::arg().setCmd("help","Provide a helpful message"); ::arg().setCmd("version","Print version string"); diff --git a/pdns/rec-lua-conf.cc b/pdns/rec-lua-conf.cc index fa6a4c13bd..15e53c82d8 100644 --- a/pdns/rec-lua-conf.cc +++ b/pdns/rec-lua-conf.cc @@ -205,7 +205,7 @@ static void parseFrameStreamOptions(boost::optional vars, } #endif /* HAVE_FSTRM */ -static void rpzPrimary(LuaConfigItems& lci, luaConfigDelayedThreads& delayedThreads, const boost::variant > >& masters_, const string& zoneName, boost::optional options) +static void rpzPrimary(LuaConfigItems& lci, luaConfigDelayedThreads& delayedThreads, const boost::variant>>& primaries_, const string& zoneName, boost::optional options) { boost::optional defpol; bool defpolOverrideLocal = true; @@ -216,13 +216,13 @@ static void rpzPrimary(LuaConfigItems& lci, luaConfigDelayedThreads& delayedThre uint16_t axfrTimeout = 20; uint32_t maxTTL = std::numeric_limits::max(); ComboAddress localAddress; - std::vector masters; - if (masters_.type() == typeid(string)) { - masters.push_back(ComboAddress(boost::get(masters_), 53)); + std::vector primaries; + if (primaries_.type() == typeid(string)) { + primaries.push_back(ComboAddress(boost::get(primaries_), 53)); } else { - for (const auto& master : boost::get>>(masters_)) { - masters.push_back(ComboAddress(master.second, 53)); + for (const auto& primary : boost::get>>(primaries_)) { + primaries.push_back(ComboAddress(primary.second, 53)); } } @@ -274,10 +274,10 @@ static void rpzPrimary(LuaConfigItems& lci, luaConfigDelayedThreads& delayedThre } if (localAddress != ComboAddress()) { - // We were passed a localAddress, check if its AF matches the masters' - for (const auto& master : masters) { - if (localAddress.sin4.sin_family != master.sin4.sin_family) { - throw PDNSException("Primary address("+master.toString()+") is not of the same Address Family as the local address ("+localAddress.toString()+")."); + // We were passed a localAddress, check if its AF matches the primaries' + for (const auto& primary : primaries) { + if (localAddress.sin4.sin_family != primary.sin4.sin_family) { + throw PDNSException("Primary address("+primary.toString()+") is not of the same Address Family as the local address ("+localAddress.toString()+")."); } } } @@ -314,7 +314,7 @@ static void rpzPrimary(LuaConfigItems& lci, luaConfigDelayedThreads& delayedThre exit(1); // FIXME proper exit code? } - delayedThreads.rpzMasterThreads.push_back(std::make_tuple(masters, defpol, defpolOverrideLocal, maxTTL, zoneIdx, tt, maxReceivedXFRMBytes, localAddress, axfrTimeout, refresh, sr, dumpFile)); + delayedThreads.rpzPrimaryThreads.push_back(std::make_tuple(primaries, defpol, defpolOverrideLocal, maxTTL, zoneIdx, tt, maxReceivedXFRMBytes, localAddress, axfrTimeout, refresh, sr, dumpFile)); } void loadRecursorLuaConfig(const std::string& fname, luaConfigDelayedThreads& delayedThreads) @@ -385,11 +385,12 @@ void loadRecursorLuaConfig(const std::string& fname, luaConfigDelayedThreads& de } }); - Lua.writeFunction("rpzMaster", [&lci, &delayedThreads](const boost::variant > >& masters_, const string& zoneName, boost::optional options) { - rpzPrimary(lci, delayedThreads, masters_, zoneName, options); + Lua.writeFunction("rpzMaster", [&lci, &delayedThreads](const boost::variant > >& primaries_, const string& zoneName, boost::optional options) { + g_log< > >& masters_, const string& zoneName, boost::optional options) { - rpzPrimary(lci, delayedThreads, masters_, zoneName, options); + Lua.writeFunction("rpzPrimary", [&lci, &delayedThreads](const boost::variant > >& primaries_, const string& zoneName, boost::optional options) { + rpzPrimary(lci, delayedThreads, primaries_, zoneName, options); }); typedef vector > > > > argvec_t; @@ -618,9 +619,9 @@ void loadRecursorLuaConfig(const std::string& fname, luaConfigDelayedThreads& de void startLuaConfigDelayedThreads(const luaConfigDelayedThreads& delayedThreads, uint64_t generation) { - for (const auto& rpzMaster : delayedThreads.rpzMasterThreads) { + for (const auto& rpzPrimary : delayedThreads.rpzPrimaryThreads) { try { - std::thread t(RPZIXFRTracker, std::get<0>(rpzMaster), std::get<1>(rpzMaster), std::get<2>(rpzMaster), std::get<3>(rpzMaster), std::get<4>(rpzMaster), std::get<5>(rpzMaster), std::get<6>(rpzMaster) * 1024 * 1024, std::get<7>(rpzMaster), std::get<8>(rpzMaster), std::get<9>(rpzMaster), std::get<10>(rpzMaster), std::get<11>(rpzMaster), generation); + std::thread t(RPZIXFRTracker, std::get<0>(rpzPrimary), std::get<1>(rpzPrimary), std::get<2>(rpzPrimary), std::get<3>(rpzPrimary), std::get<4>(rpzPrimary), std::get<5>(rpzPrimary), std::get<6>(rpzPrimary) * 1024 * 1024, std::get<7>(rpzPrimary), std::get<8>(rpzPrimary), std::get<9>(rpzPrimary), std::get<10>(rpzPrimary), std::get<11>(rpzPrimary), generation); t.detach(); } catch(const std::exception& e) { diff --git a/pdns/rec-lua-conf.hh b/pdns/rec-lua-conf.hh index 0ffff69c01..4b1fc27dd2 100644 --- a/pdns/rec-lua-conf.hh +++ b/pdns/rec-lua-conf.hh @@ -85,7 +85,7 @@ extern GlobalStateHolder g_luaconfs; struct luaConfigDelayedThreads { - std::vector, boost::optional, bool, uint32_t, size_t, TSIGTriplet, size_t, ComboAddress, uint16_t, uint32_t, std::shared_ptr, std::string> > rpzMasterThreads; + std::vector, boost::optional, bool, uint32_t, size_t, TSIGTriplet, size_t, ComboAddress, uint16_t, uint32_t, std::shared_ptr, std::string> > rpzPrimaryThreads; }; void loadRecursorLuaConfig(const std::string& fname, luaConfigDelayedThreads& delayedThreads); diff --git a/pdns/rec-snmp.cc b/pdns/rec-snmp.cc index c4a1b2fdc8..e7e894010f 100644 --- a/pdns/rec-snmp.cc +++ b/pdns/rec-snmp.cc @@ -194,7 +194,7 @@ static void registerCounter64Stat(const std::string& name, const oid statOID[], s_statsMap[statOID[statOIDLength - 1]] = name.c_str(); netsnmp_register_scalar(netsnmp_create_handler_registration(name.c_str(), - isStatBlacklisted(StatComponent::SNMP, name) ? + isStatDisabled(StatComponent::SNMP, name) ? handleDisabledCounter64Stats : handleCounter64Stats, statOID, statOIDLength, diff --git a/pdns/rec-snmp.hh b/pdns/rec-snmp.hh index c803fa5495..38c63a95c4 100644 --- a/pdns/rec-snmp.hh +++ b/pdns/rec-snmp.hh @@ -28,7 +28,7 @@ class RecursorSNMPAgent; class RecursorSNMPAgent: public SNMPAgent { public: - RecursorSNMPAgent(const std::string& name, const std::string& masterSocket); + RecursorSNMPAgent(const std::string& name, const std::string& daemonSocket); bool sendCustomTrap(const std::string& reason); }; diff --git a/pdns/rec_channel.hh b/pdns/rec_channel.hh index d6ca9fbcc2..287a793832 100644 --- a/pdns/rec_channel.hh +++ b/pdns/rec_channel.hh @@ -109,9 +109,9 @@ std::vector* pleaseGetTimeouts(); DNSName getRegisteredName(const DNSName& dom); std::atomic* getDynMetric(const std::string& str, const std::string& prometheusName); boost::optional getStatByName(const std::string& name); -bool isStatBlacklisted(StatComponent component, const std::string& name); -void blacklistStat(StatComponent component, const string& name); -void blacklistStats(StatComponent component, const string& stats); +bool isStatDisabled(StatComponent component, const std::string& name); +void disableStat(StatComponent component, const string& name); +void disableStats(StatComponent component, const string& stats); void registerAllStats(); diff --git a/pdns/rec_channel_rec.cc b/pdns/rec_channel_rec.cc index 08ca90b8a9..43971c2394 100644 --- a/pdns/rec_channel_rec.cc +++ b/pdns/rec_channel_rec.cc @@ -53,24 +53,24 @@ struct dynmetrics { static map d_dynmetrics; -static std::map> s_blacklistedStats; +static std::map> s_disabledStats; -bool isStatBlacklisted(StatComponent component, const string& name) +bool isStatDisabled(StatComponent component, const string& name) { - return s_blacklistedStats[component].count(name) != 0; + return s_disabledStats[component].count(name) != 0; } -void blacklistStat(StatComponent component, const string& name) +void disableStat(StatComponent component, const string& name) { - s_blacklistedStats[component].insert(name); + s_disabledStats[component].insert(name); } -void blacklistStats(StatComponent component, const string& stats) +void disableStats(StatComponent component, const string& stats) { - std::vector blacklistedStats; - stringtok(blacklistedStats, stats, ", "); - auto& map = s_blacklistedStats[component]; - for (const auto &st : blacklistedStats) { + std::vector disabledStats; + stringtok(disabledStats, stats, ", "); + auto& map = s_disabledStats[component]; + for (const auto &st : disabledStats) { map.insert(st); } } @@ -144,21 +144,21 @@ boost::optional getStatByName(const std::string& name) StatsMap getAllStatsMap(StatComponent component) { StatsMap ret; - const auto& blacklistMap = s_blacklistedStats.at(component); + const auto& disabledlistMap = s_disabledStats.at(component); for(const auto& the32bits : d_get32bitpointers) { - if (blacklistMap.count(the32bits.first) == 0) { + if (disabledlistMap.count(the32bits.first) == 0) { ret.insert(make_pair(the32bits.first, StatsMapEntry{getPrometheusName(the32bits.first), std::to_string(*the32bits.second)})); } } for(const auto& atomic : d_getatomics) { - if (blacklistMap.count(atomic.first) == 0) { + if (disabledlistMap.count(atomic.first) == 0) { ret.insert(make_pair(atomic.first, StatsMapEntry{getPrometheusName(atomic.first), std::to_string(atomic.second->load())})); } } for(const auto& the64bitmembers : d_get64bitmembers) { - if (blacklistMap.count(the64bitmembers.first) == 0) { + if (disabledlistMap.count(the64bitmembers.first) == 0) { ret.insert(make_pair(the64bitmembers.first, StatsMapEntry{getPrometheusName(the64bitmembers.first), std::to_string(the64bitmembers.second())})); } } @@ -166,7 +166,7 @@ StatsMap getAllStatsMap(StatComponent component) { std::lock_guard l(d_dynmetricslock); for(const auto& a : d_dynmetrics) { - if (blacklistMap.count(a.first) == 0) { + if (disabledlistMap.count(a.first) == 0) { ret.insert(make_pair(a.first, StatsMapEntry{a.second.d_prometheusName, std::to_string(*a.second.d_ptr)})); } } diff --git a/pdns/rpzloader.cc b/pdns/rpzloader.cc index 6c87e7d91e..7d521ca6a0 100644 --- a/pdns/rpzloader.cc +++ b/pdns/rpzloader.cc @@ -186,17 +186,17 @@ static void RPZRecordToPolicy(const DNSRecord& dr, std::shared_ptr loadRPZFromServer(const ComboAddress& master, const DNSName& zoneName, std::shared_ptr zone, boost::optional defpol, bool defpolOverrideLocal, uint32_t maxTTL, const TSIGTriplet& tt, size_t maxReceivedBytes, const ComboAddress& localAddress, uint16_t axfrTimeout) +static shared_ptr loadRPZFromServer(const ComboAddress& primary, const DNSName& zoneName, std::shared_ptr zone, boost::optional defpol, bool defpolOverrideLocal, uint32_t maxTTL, const TSIGTriplet& tt, size_t maxReceivedBytes, const ComboAddress& localAddress, uint16_t axfrTimeout) { - g_log< chunk; @@ -350,7 +350,7 @@ static bool dumpZoneToDisk(const DNSName& zoneName, const std::shared_ptr& masters, boost::optional defpol, bool defpolOverrideLocal, uint32_t maxTTL, size_t zoneIdx, const TSIGTriplet& tt, size_t maxReceivedBytes, const ComboAddress& localAddress, const uint16_t axfrTimeout, const uint32_t refreshFromConf, std::shared_ptr sr, std::string dumpZoneFileName, uint64_t configGeneration) +void RPZIXFRTracker(const std::vector& primaries, boost::optional defpol, bool defpolOverrideLocal, uint32_t maxTTL, size_t zoneIdx, const TSIGTriplet& tt, size_t maxReceivedBytes, const ComboAddress& localAddress, const uint16_t axfrTimeout, const uint32_t refreshFromConf, std::shared_ptr sr, std::string dumpZoneFileName, uint64_t configGeneration) { setThreadName("pdns-r/RPZIXFR"); bool isPreloaded = sr != nullptr; @@ -373,9 +373,9 @@ void RPZIXFRTracker(const std::vector& masters, boost::optional newZone = std::make_shared(*oldZone); - for (const auto& master : masters) { + for (const auto& primary : primaries) { try { - sr = loadRPZFromServer(master, zoneName, newZone, defpol, defpolOverrideLocal, maxTTL, tt, maxReceivedBytes, localAddress, axfrTimeout); + sr = loadRPZFromServer(primary, zoneName, newZone, defpol, defpolOverrideLocal, maxTTL, tt, maxReceivedBytes, localAddress, axfrTimeout); newZone->setSerial(sr->d_st.serial); newZone->setRefresh(sr->d_st.refresh); refresh = std::max(refreshFromConf ? refreshFromConf : newZone->getRefresh(), 1U); @@ -389,15 +389,15 @@ void RPZIXFRTracker(const std::vector& masters, boost::optional& masters, boost::optional, vector > > deltas; - for (const auto& master : masters) { - g_log<(dr)->d_st.serial<(dr)->d_st.serial< loadRPZFromFile(const std::string& fname, std::shared_ptr zone, boost::optional defpol, bool defpolOverrideLocal, uint32_t maxTTL); -void RPZIXFRTracker(const std::vector& masters, boost::optional defpol, bool defpolOverrideLocal, uint32_t maxTTL, size_t zoneIdx, const TSIGTriplet& tt, size_t maxReceivedBytes, const ComboAddress& localAddress, const uint16_t axfrTimeout, const uint32_t reloadFromConf, shared_ptr sr, std::string dumpZoneFileName, uint64_t configGeneration); +void RPZIXFRTracker(const std::vector& primaries, boost::optional defpol, bool defpolOverrideLocal, uint32_t maxTTL, size_t zoneIdx, const TSIGTriplet& tt, size_t maxReceivedBytes, const ComboAddress& localAddress, const uint16_t axfrTimeout, const uint32_t reloadFromConf, shared_ptr sr, std::string dumpZoneFileName, uint64_t configGeneration); struct rpzStats { diff --git a/pdns/syncres.cc b/pdns/syncres.cc index 9b39a588ac..c6e54e50cc 100644 --- a/pdns/syncres.cc +++ b/pdns/syncres.cc @@ -3670,7 +3670,7 @@ bool SyncRes::processRecords(const std::string& prefix, const DNSName& qname, co ne.d_ttd = d_now.tv_sec + lowestTTL; if (!wasVariable()) { - if (qtype.getCode()) { // prevents us from blacking out a whole domain + if (qtype.getCode()) { // prevents us from NXDOMAIN'ing a whole domain g_negCache->add(ne); } } @@ -4303,10 +4303,10 @@ boost::optional SyncRes::getEDNSSubnetMask(const DNSName& dn, const Com return boost::none; } -void SyncRes::parseEDNSSubnetWhitelist(const std::string& wlist) +void SyncRes::parseEDNSSubnetAllowlist(const std::string& alist) { vector parts; - stringtok(parts, wlist, ",; "); + stringtok(parts, alist, ",; "); for(const auto& a : parts) { try { s_ednsremotesubnets.addMask(Netmask(a)); diff --git a/pdns/syncres.hh b/pdns/syncres.hh index 1a32e196f8..6c4f8d2668 100644 --- a/pdns/syncres.hh +++ b/pdns/syncres.hh @@ -447,7 +447,7 @@ public: { s_dontQuery = nullptr; } - static void parseEDNSSubnetWhitelist(const std::string& wlist); + static void parseEDNSSubnetAllowlist(const std::string& alist); static void parseEDNSSubnetAddFor(const std::string& subnetlist); static void addEDNSLocalSubnet(const std::string& subnet) { diff --git a/pdns/ws-recursor.cc b/pdns/ws-recursor.cc index 2ed46e5c5e..25a68af64d 100644 --- a/pdns/ws-recursor.cc +++ b/pdns/ws-recursor.cc @@ -439,8 +439,8 @@ static void prometheusMetrics(HttpRequest *req, HttpResponse *resp) { std::ostringstream output; - // Argument controls blacklisting of any stats. So - // stats-api-blacklist will be used to block returned stats. + // Argument controls disabling of any stats. So + // stats-api-disabled-list will be used to block returned stats. auto varmap = getAllStatsMap(StatComponent::API); for (const auto& tup : varmap) { std::string metricName = tup.first;