]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Fail more gracefully in default getBeforeAndAfterNamesAbsolute.
authorMiod Vallat <miod.vallat@powerdns.com>
Fri, 18 Apr 2025 10:59:14 +0000 (12:59 +0200)
committerMiod Vallat <miod.vallat@powerdns.com>
Fri, 18 Apr 2025 11:03:13 +0000 (13:03 +0200)
If invoked on a non-DNSSEC-capable backend, it should fail with a visible
error message rather than bluntly abort().

pdns/dnsbackend.hh

index 5b670f439a61905d8f92e1abb83b4e86fe9dd136..2cf72f6862a152874d759892856d5656b127c229 100644 (file)
@@ -247,11 +247,9 @@ public:
   virtual bool getTSIGKeys(std::vector<struct TSIGKey>& /* keys */) { return false; }
   virtual bool deleteTSIGKey(const DNSName& /* name */) { return false; }
 
-  virtual bool getBeforeAndAfterNamesAbsolute(uint32_t /* id */, const DNSName& /* qname */, DNSName& /* unhashed */, DNSName& /* before */, DNSName& /* after */)
+  virtual bool getBeforeAndAfterNamesAbsolute(uint32_t /* id */, const DNSName& qname, DNSName& /* unhashed */, DNSName& /* before */, DNSName& /* after */)
   {
-    std::cerr << "Default beforeAndAfterAbsolute called!" << std::endl;
-    abort();
-    return false;
+    throw PDNSException("DNSSEC operation invoked on non-DNSSEC capable backend, qname: '" + qname.toString() + "'");
   }
 
   virtual bool getBeforeAndAfterNames(uint32_t /* id */, const ZoneName& zonename, const DNSName& qname, DNSName& before, DNSName& after);