From: Kees Monshouwer Date: Mon, 15 Jul 2019 08:55:28 +0000 (+0200) Subject: auth: improve the handling of duplicate id's in bindbackend X-Git-Tag: dnsdist-1.4.0-rc3~12^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a46366f0623951d81c060df49ba83d9fc1b50706;p=pdns auth: improve the handling of duplicate id's in bindbackend duplicate id's are not allowed in powerdns and will still result in undefined behavior --- diff --git a/modules/bindbackend/bindbackend2.cc b/modules/bindbackend/bindbackend2.cc index bfd52c1df..089227154 100644 --- a/modules/bindbackend/bindbackend2.cc +++ b/modules/bindbackend/bindbackend2.cc @@ -1067,7 +1067,7 @@ void Bind2Backend::lookup(const QType &qtype, const DNSName &qname, int zoneId, g_log<= 0) { - if ((found = safeGetBBDomainInfo(zoneId, &bbd))) { + if ((found = (safeGetBBDomainInfo(zoneId, &bbd) && qname.isPartOf(bbd.d_name)))) { domain = bbd.d_name; } } else { @@ -1079,7 +1079,7 @@ void Bind2Backend::lookup(const QType &qtype, const DNSName &qname, int zoneId, if(!found) { if(mustlog) - g_log<