]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
auth: improve SOA dnsname exception handling 10952/head
authorKees Monshouwer <mind04@monshouwer.org>
Fri, 5 Nov 2021 10:53:36 +0000 (11:53 +0100)
committermind04 <mind04@monshouwer.org>
Mon, 8 Nov 2021 14:02:21 +0000 (15:02 +0100)
modules/tinydnsbackend/tinydnsbackend.cc
pdns/backends/gsql/gsqlbackend.cc
pdns/dnsbackend.cc
pdns/pdnsutil.cc

index 3936a23d9ea2e8c93728dcd1da22630624f85d96..a1a340cbc3e56298f507e8cb579f30e5d650bca7 100644 (file)
@@ -185,7 +185,7 @@ void TinyDNSBackend::getAllDomains(vector<DomainInfo>* domains, bool include_dis
         fillSOAData(rr.content, sd);
         di.serial = sd.serial;
       }
-      catch (const PDNSException& e) {
+      catch (...) {
         di.serial = 0;
       }
 
index 13b833ffb89fa969590ac7f7e400d9ed12967864..63aa8df20a4af02219d28b84c71d5a651f3d15e8 100644 (file)
@@ -1449,7 +1449,7 @@ void GSQLBackend::getAllDomains(vector<DomainInfo> *domains, bool include_disabl
           fillSOAData(row[2], sd);
           di.serial = sd.serial;
         }
-        catch (const PDNSException& e) {
+        catch (...) {
           di.serial = 0;
         }
       }
index b3253c85b7c09f63076b727386d35543e606243a..522ad65cc81ce4bd8bd2d8568f007c8a920daeab 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 e77d4f834d5f9d7a08e207add5d08e0a2f400156..9d1dd8a0f68bc5376a63afe92490b1a58005678a 100644 (file)
@@ -271,7 +271,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;