From: Aki Tuomi Date: Sun, 8 Nov 2015 11:01:45 +0000 (+0200) Subject: Use zone name in startTransaction X-Git-Tag: dnsdist-1.0.0-alpha1~239^2^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7da0574835fd26b5b7a59b49de4f85909c8004b5;p=pdns Use zone name in startTransaction --- diff --git a/pdns/dnsseckeeper.hh b/pdns/dnsseckeeper.hh index aa056adc1..a702b58aa 100644 --- a/pdns/dnsseckeeper.hh +++ b/pdns/dnsseckeeper.hh @@ -98,9 +98,9 @@ public: bool TSIGGrantsAccess(const DNSName& zone, const DNSName& keyname); bool getTSIGForAccess(const DNSName& zone, const string& master, DNSName* keyname); - void startTransaction() + void startTransaction(const DNSName& zone, int zone_id) { - (*d_keymetadb->backends.begin())->startTransaction(DNSName(), -1); + (*d_keymetadb->backends.begin())->startTransaction(zone, zone_id); } void commitTransaction() diff --git a/pdns/pdnssec.cc b/pdns/pdnssec.cc index 6d6f42cd3..3b6c6ee00 100644 --- a/pdns/pdnssec.cc +++ b/pdns/pdnssec.cc @@ -240,7 +240,7 @@ bool rectifyZone(DNSSECKeeper& dk, const DNSName& zone) cerr<<"Non DNSSEC zone, only adding empty non-terminals"<startTransaction(DNSName(""), -1); + sd.db->startTransaction(zone, -1); bool realrr=true; uint32_t maxent = ::arg().asNum("max-ent-entries"); @@ -738,7 +738,7 @@ int increaseSerial(const DNSName& zone, DNSSECKeeper &dk) } rrs[0].content = serializeSOAData(sd); - sd.db->startTransaction(DNSName(), -1); + sd.db->startTransaction(zone, -1); if (! sd.db->replaceRRSet(sd.domain_id, zone, rr.qtype, rrs)) { sd.db->abortTransaction(); @@ -1763,18 +1763,18 @@ try return 0; } vector mustRectify; - dk.startTransaction(); unsigned int zoneErrors=0; for(unsigned int n = 1; n < cmds.size(); ++n) { DNSName zone(cmds[n]); + dk.startTransaction(zone, -1); if(secureZone(dk, zone)) { mustRectify.push_back(zone); } else { zoneErrors++; } + dk.commitTransaction(); } - dk.commitTransaction(); for(const auto& zone : mustRectify) rectifyZone(dk, zone);