From 41147d678b30612d2431b59a898879368f1c4b06 Mon Sep 17 00:00:00 2001 From: Mark Zealey Date: Wed, 10 Jul 2019 14:17:32 +0300 Subject: [PATCH] Fix SERVFAIL when backend returns empty DNSName According to the documentation on UeberBackend::getAuth(), a backend returning an empty DNSName should signal that no matching parent zone exists in this backend. However commit ae14c1f36a raises an exception if isPartOf() is called on an empty DNSName so we need to switch the order of the logic to prevent a SERVFAIL as a result. --- pdns/ueberbackend.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pdns/ueberbackend.cc b/pdns/ueberbackend.cc index 2c3dd363b0..e33b9030ea 100644 --- a/pdns/ueberbackend.cc +++ b/pdns/ueberbackend.cc @@ -330,7 +330,7 @@ bool UeberBackend::getAuth(const DNSName &target, const QType& qtype, SOAData* s DLOG(g_log<getAuth(shorter, sd)) { DLOG(g_log<qname<qname) && !sd->qname.empty()) { + if(!sd->qname.empty() && !shorter.isPartOf(sd->qname)) { throw PDNSException("getAuth() returned an SOA for the wrong zone. Zone '"+sd->qname.toLogString()+"' is not part of '"+shorter.toLogString()+"'"); } j->first = sd->qname.wirelength(); -- 2.47.2