From: Mark Zealey Date: Wed, 10 Jul 2019 11:17:32 +0000 (+0300) Subject: Fix SERVFAIL when backend returns empty DNSName X-Git-Tag: dnsdist-1.4.0-rc1~56^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=41147d678b30612d2431b59a898879368f1c4b06;p=pdns 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. --- diff --git a/pdns/ueberbackend.cc b/pdns/ueberbackend.cc index 2c3dd363b..e33b9030e 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();