Permalink
Browse files

Fix ordername for SOA record after update

  • Loading branch information...
1 parent 535f4e3 commit 6e82a2323edefcb8eca0a7e0d6377e63d6d57c4b @cmouse cmouse committed with Habbie Oct 14, 2014
Showing with 22 additions and 0 deletions.
  1. +22 −0 pdns/pdnssec.cc
View
@@ -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;
}

0 comments on commit 6e82a23

Please sign in to comment.