From 40b3959a0dca395ddf5b1507a237a38f75068041 Mon Sep 17 00:00:00 2001 From: Remi Gacogne Date: Tue, 24 Dec 2019 16:27:23 +0100 Subject: [PATCH] auth: Make DNSSECKeeper::clear{All,}Caches() static --- pdns/dnsseckeeper.hh | 8 +++++--- pdns/dynhandler.cc | 7 +++---- pdns/tcpreceiver.cc | 4 ++-- pdns/ws-auth.cc | 3 +-- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/pdns/dnsseckeeper.hh b/pdns/dnsseckeeper.hh index f280f4de98..c23db851de 100644 --- a/pdns/dnsseckeeper.hh +++ b/pdns/dnsseckeeper.hh @@ -181,9 +181,13 @@ public: if(d_ourDB) delete d_keymetadb; } + + static uint64_t dbdnssecCacheSizes(const std::string& str); + static void clearAllCaches(); + static void clearCaches(const DNSName& name); + bool doesDNSSEC(); bool isSecuredZone(const DNSName& zone); - static uint64_t dbdnssecCacheSizes(const std::string& str); keyset_t getEntryPoints(const DNSName& zname); keyset_t getKeys(const DNSName& zone, bool useCache = true); DNSSECPrivateKey getKeyById(const DNSName& zone, unsigned int id); @@ -198,8 +202,6 @@ public: bool checkNSEC3PARAM(const NSEC3PARAMRecordContent& ns3p, string& msg); bool setNSEC3PARAM(const DNSName& zname, const NSEC3PARAMRecordContent& n3p, const bool& narrow=false); bool unsetNSEC3PARAM(const DNSName& zname); - void clearAllCaches(); - void clearCaches(const DNSName& name); bool getPreRRSIGs(UeberBackend& db, const DNSName& signer, const DNSName& qname, const DNSName& wildcardname, const QType& qtype, DNSResourceRecord::Place, vector& rrsigs, uint32_t signTTL); bool isPresigned(const DNSName& zname); bool setPresigned(const DNSName& zname); diff --git a/pdns/dynhandler.cc b/pdns/dynhandler.cc index 7541fdb656..9e8f36c240 100644 --- a/pdns/dynhandler.cc +++ b/pdns/dynhandler.cc @@ -122,7 +122,6 @@ string DLUptimeHandler(const vector&parts, Utility::pid_t ppid) string DLPurgeHandler(const vector&parts, Utility::pid_t ppid) { - DNSSECKeeper dk; ostringstream os; int ret=0; @@ -130,14 +129,14 @@ string DLPurgeHandler(const vector&parts, Utility::pid_t ppid) for (vector::const_iterator i=++parts.begin();i& q, } DNSSECKeeper dk(&db); - dk.clearCaches(target); + DNSSECKeeper::clearCaches(target); bool securedZone = dk.isSecuredZone(target); bool presignedZone = dk.isPresigned(target); @@ -1110,7 +1110,7 @@ int TCPNameserver::doIXFR(std::unique_ptr& q, int outsock) NSEC3PARAMRecordContent ns3pr; bool narrow; - dk.clearCaches(q->qdomain); + DNSSECKeeper::clearCaches(q->qdomain); bool securedZone = dk.isSecuredZone(q->qdomain); if(dk.getNSEC3PARAM(q->qdomain, &ns3pr, &narrow)) { if(narrow) { diff --git a/pdns/ws-auth.cc b/pdns/ws-auth.cc index 85d64d7752..7beb49c6d5 100644 --- a/pdns/ws-auth.cc +++ b/pdns/ws-auth.cc @@ -1747,8 +1747,7 @@ static void apiServerZoneDetail(HttpRequest* req, HttpResponse* resp) { throw ApiException("Deleting domain '"+zonename.toString()+"' failed: backend delete failed/unsupported"); // clear caches - DNSSECKeeper dk(&B); - dk.clearCaches(zonename); + DNSSECKeeper::clearCaches(zonename); purgeAuthCaches(zonename.toString() + "$"); // empty body on success -- 2.47.2