]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
pdnsutil load-zone: ignore double SOA 3820/head
authorPieter Lexis <pieter.lexis@powerdns.com>
Wed, 4 May 2016 18:53:53 +0000 (20:53 +0200)
committerPieter Lexis <pieter.lexis@powerdns.com>
Wed, 4 May 2016 18:56:12 +0000 (20:56 +0200)
Closes #3818

pdns/pdnsutil.cc

index c3a432975b851ff7576905d0225b0d72e65d60a2..83a766a2254c89a8e21b7ea2f5ccbc4cb994a54e 100644 (file)
@@ -1122,11 +1122,18 @@ int loadZone(DNSName zone, const string& fname) {
     return EXIT_FAILURE;
   }
   rr.domain_id=di.id;  
+  bool haveSOA = false;
   while(zpt.get(rr)) {
     if(!rr.qname.isPartOf(zone) && rr.qname!=zone) {
       cerr<<"File contains record named '"<<rr.qname.toString()<<"' which is not part of zone '"<<zone.toString()<<"'"<<endl;
       return EXIT_FAILURE;
     }
+    if (rr.qtype == QType::SOA) {
+      if (haveSOA)
+        continue;
+      else
+        haveSOA = true;
+    }
     db->feedRecord(rr);
   }
   db->commitTransaction();