From: Kees Monshouwer Date: Tue, 9 Apr 2024 23:09:57 +0000 (+0200) Subject: auth: don't crash when a catalog SOA is invalid X-Git-Tag: auth-4.9.1~16^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F14058%2Fhead;p=thirdparty%2Fpdns.git auth: don't crash when a catalog SOA is invalid --- diff --git a/pdns/auth-primarycommunicator.cc b/pdns/auth-primarycommunicator.cc index 1b9ff3b3a4..e425d04425 100644 --- a/pdns/auth-primarycommunicator.cc +++ b/pdns/auth-primarycommunicator.cc @@ -157,16 +157,21 @@ void CommunicatorClass::getUpdatedProducers(UeberBackend* B, vector& 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); diff --git a/pdns/backends/gsql/gsqlbackend.cc b/pdns/backends/gsql/gsqlbackend.cc index 8ebb3c8acf..09a090c74c 100644 --- a/pdns/backends/gsql/gsqlbackend.cc +++ b/pdns/backends/gsql/gsqlbackend.cc @@ -463,7 +463,7 @@ void GSQLBackend::getUnfreshSecondaryInfos(vector* 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; }