]> granicus.if.org Git - pdns/commitdiff
detect duplicate cnames with pdnssec check-all-zones (Issue #545)
authorKees Monshouwer <mind04@monshouwer.org>
Mon, 9 Sep 2013 19:12:05 +0000 (21:12 +0200)
committermind04 <mind04@monshouwer.org>
Mon, 9 Sep 2013 21:20:00 +0000 (23:20 +0200)
pdns/pdnssec.cc

index 7cf4678c4111f7023bf2be5a354e59cecca9e814..a8f98e05d30f524eec649f3adeb54e096d12a31e 100644 (file)
@@ -352,9 +352,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)