From: Robin Geuze Date: Tue, 11 Feb 2020 17:05:09 +0000 (+0100) Subject: Make check-zone also check whether there are duplicate key value pair domaindatas... X-Git-Tag: dnsdist-1.6.0-alpha2~50^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=aebc8d98eedc5b5203c25098d52eda211ffb6177;p=thirdparty%2Fpdns.git Make check-zone also check whether there are duplicate key value pair domaindatas for the zone --- diff --git a/pdns/pdnsutil.cc b/pdns/pdnsutil.cc index ecabdd61fa..08cfbf8ed7 100644 --- a/pdns/pdnsutil.cc +++ b/pdns/pdnsutil.cc @@ -713,6 +713,27 @@ static int checkZone(DNSSECKeeper &dk, UeberBackend &B, const DNSName& zone, con } } + std::map> metadatas; + if (!B.getAllDomainMetadata(zone, metadatas)) { + cout << "[Error] Unable to retrieve metadata for zone " << zone << endl; + numerrors++; + } + + for (const auto &metaData : metadatas) { + set seen; + set messaged; + + for (const auto &value : metaData.second) { + if (seen.count(value) <= 0) { + seen.insert(value); + } else if (messaged.count(value) <= 0) { + cout << "[Error] Found duplicate metadata key value pair for zone " << zone << " with key " << metaData.first << " and value " << value << endl; + numerrors++; + messaged.insert(value); + } + } + } + cout<<"Checked "<