]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
auth: don't crash when a catalog SOA is invalid 14058/head
authorKees Monshouwer <mind04@monshouwer.org>
Tue, 9 Apr 2024 23:09:57 +0000 (01:09 +0200)
committerPeter van Dijk <peter.van.dijk@powerdns.com>
Mon, 13 May 2024 14:05:33 +0000 (16:05 +0200)
pdns/auth-primarycommunicator.cc
pdns/backends/gsql/gsqlbackend.cc

index 1b9ff3b3a49362071b85f80eca3ae7f183fcb89e..e425d0442550d20c5080ab670e750459e760ba0e 100644 (file)
@@ -157,16 +157,21 @@ void CommunicatorClass::getUpdatedProducers(UeberBackend* B, vector<DomainInfo>&
           continue;
         }
 
-        B->setDomainMetadata(di.zone, "CATALOG-HASH", mapHash);
-
-        g_log << Logger::Warning << "new CATALOG-HASH '" << mapHash << "' for zone '" << di.zone << "'" << endl;
-
         SOAData sd;
-        if (!B->getSOAUncached(di.zone, sd)) {
-          g_log << Logger::Warning << "SOA lookup failed for producer zone '" << di.zone << "'" << endl;
+        try {
+          if (!B->getSOAUncached(di.zone, sd)) {
+            g_log << Logger::Warning << "SOA lookup failed for producer zone '" << di.zone << "'" << endl;
+            continue;
+          }
+        }
+        catch (...) {
           continue;
         }
 
+        g_log << Logger::Warning << "new CATALOG-HASH '" << mapHash << "' for zone '" << di.zone << "'" << endl;
+
+        B->setDomainMetadata(di.zone, "CATALOG-HASH", mapHash);
+
         DNSResourceRecord rr;
         makeIncreasedSOARecord(sd, "EPOCH", "", rr);
         di.backend->startTransaction(sd.qname, -1);
index 8ebb3c8acff797991236a304dff4dec666b8dec7..09a090c74cc280b033ad33d5054e500b58bb2a06 100644 (file)
@@ -463,7 +463,7 @@ void GSQLBackend::getUnfreshSecondaryInfos(vector<DomainInfo>* unfreshDomains)
         continue;
       }
       catch (...) {
-        g_log << Logger::Warning << __PRETTY_FUNCTION__ << " error while parsing SOA data for zone '" << di.zone << endl;
+        g_log << Logger::Warning << __PRETTY_FUNCTION__ << " error while parsing SOA data for zone '" << di.zone << "'" << endl;
         continue;
       }