]> granicus.if.org Git - pdns/commitdiff
Fix ordername for SOA record after update
authorAki Tuomi <cmouse@desteem.org>
Tue, 14 Oct 2014 06:42:33 +0000 (09:42 +0300)
committerPeter van Dijk <peter.van.dijk@netherlabs.nl>
Tue, 21 Oct 2014 11:58:01 +0000 (13:58 +0200)
pdns/pdnssec.cc

index 17b3f934f6800fa21d90cb4a2bfee97768c29a51..24342e2c238ffbe0dcce09868d938ab7b3ce1d48 100644 (file)
@@ -616,6 +616,28 @@ int increaseSerial(const string& zone, DNSSECKeeper &dk)
    cerr<<"Backend did not replace SOA record. Backend might not support this operation."<<endl;
    return -1;
   }
+
+  if (sd.db->doesDNSSEC()) {
+    NSEC3PARAMRecordContent ns3pr;
+    bool narrow;
+    bool haveNSEC3=dk.getNSEC3PARAM(zone, &ns3pr, &narrow);
+  
+    if(haveNSEC3)
+    {
+      if(!narrow) {
+        string hashed=toBase32Hex(hashQNameWithSalt(ns3pr.d_iterations, ns3pr.d_salt, rrs[0].qname));
+        if(g_verbose)
+          cerr<<"'"<<rrs[0].qname<<"' -> '"<< hashed <<"'"<<endl;
+        sd.db->updateDNSSECOrderAndAuthAbsolute(sd.domain_id, rrs[0].qname, hashed, 1);
+      }
+      else {
+        sd.db->nullifyDNSSECOrderNameAndUpdateAuth(sd.domain_id, rrs[0].qname, 1);
+      }
+    } else {
+      sd.db->updateDNSSECOrderAndAuth(sd.domain_id, zone, rrs[0].qname, 1);
+    }
+  }
+
   cout<<"SOA serial for zone "<<zone<<" set to "<<sd.serial<<endl;
   return 0;
 }