]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
auth: improve SOA dnsname exception handling 10951/head
authorKees Monshouwer <mind04@monshouwer.org>
Fri, 5 Nov 2021 10:24:53 +0000 (11:24 +0100)
committermind04 <mind04@monshouwer.org>
Sun, 7 Nov 2021 17:08:33 +0000 (18:08 +0100)
modules/tinydnsbackend/tinydnsbackend.cc
pdns/backends/gsql/gsqlbackend.cc
pdns/dnsbackend.cc
pdns/pdnsutil.cc

index 9292d3803cf29f44b2688ca2abfa29bf7bdbc0e7..ae35c0feaaad9acb75f15962f635e6889c1606de 100644 (file)
@@ -184,7 +184,7 @@ void TinyDNSBackend::getAllDomains(vector<DomainInfo>* domains, bool getSerial,
           fillSOAData(rr.content, sd);
           di.serial = sd.serial;
         }
-        catch (const PDNSException& e) {
+        catch (...) {
           di.serial = 0;
         }
       }
index 83ac518f8913f462d9617df1293f5a0c55e0a7d5..be0c594155f485a517847581c8b840a7c133864f 100644 (file)
@@ -1449,7 +1449,7 @@ void GSQLBackend::getAllDomains(vector<DomainInfo>* domains, bool getSerial, boo
           fillSOAData(row[2], sd);
           di.serial = sd.serial;
         }
-        catch (const PDNSException& e) {
+        catch (...) {
           di.serial = 0;
         }
       }
index 719b051e06d9568a6f1f4f02dadea8b4b37d8bc9..991ab6f3d119f1c62168e18d5c813d9dbb3e9d2b 100644 (file)
@@ -263,7 +263,7 @@ bool DNSBackend::getSOA(const DNSName &domain, SOAData &sd)
       fillSOAData(rr.content, sd);
     }
   }
-  catch (const PDNSException& e) {
+  catch (...) {
     while (this->get(rr)) {
       ;
     }
index 8da10873ca82bcde3d323eac350088aeda0d5c54..5007f1763b5119552f2918c191dc5b624b5d3a71 100644 (file)
@@ -272,7 +272,14 @@ static int checkZone(DNSSECKeeper &dk, UeberBackend &B, const DNSName& zone, con
     }
   }
   catch (const PDNSException& e) {
-    cout << "[Error] SOA lookup failed: " << e.reason << endl;
+    cout << "[Error] SOA lookup failed for zone '" << zone << "': " << e.reason << endl;
+    numerrors++;
+    if (!sd.db) {
+      return 1;
+    }
+  }
+  catch (const std::exception& e) {
+    cout << "[Error] SOA lookup failed for zone '" << zone << "': " << e.what() << endl;
     numerrors++;
     if (!sd.db) {
       return 1;