Permalink
Browse files

detect duplicate cnames with pdnssec check-all-zones (Issue #545)

  • Loading branch information...
1 parent 3dfb45f commit e31946710621fffca2ab8f2002a1821115d4c38b @mind04 mind04 committed with mind04 Sep 9, 2013
Showing with 9 additions and 2 deletions.
  1. +9 −2 pdns/pdnssec.cc
View
@@ -350,9 +350,16 @@ int checkZone(DNSSECKeeper &dk, UeberBackend &B, const std::string& zone)
if(!rr.qtype.getCode())
continue;
-
+
if (rr.qtype.getCode() == QType::CNAME) {
- cnames.insert(rr.qname);
+ if (!cnames.count(rr.qname))
+ cnames.insert(rr.qname);
+ else
+ {
+ cout<<"[Error] Duplicate CNAME found at '"<<rr.qname<<"'. These do not belong in the database."<<endl;
+ numerrors++;
+ continue;
+ }
}
else {
if (rr.qtype.getCode() != QType::RRSIG)

0 comments on commit e319467

Please sign in to comment.