From: Kees Monshouwer Date: Sun, 4 Jun 2017 11:29:48 +0000 (+0200) Subject: auth: some small rectify improvements X-Git-Tag: rec-4.1.0-alpha1~91^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=cb045f619bed271e86f428abdc70a6e42198c0ad;p=pdns auth: some small rectify improvements --- diff --git a/pdns/pdnsutil.cc b/pdns/pdnsutil.cc index 852eb53e9..b4f80ab98 100644 --- a/pdns/pdnsutil.cc +++ b/pdns/pdnsutil.cc @@ -156,7 +156,6 @@ bool rectifyZone(DNSSECKeeper& dk, const DNSName& zone) DNSResourceRecord rr; set qnames, nsset, dsnames, insnonterm, delnonterm; map nonterm; - bool doent=true; vector rrs; while(sd.db->get(rr)) { @@ -171,8 +170,7 @@ bool rectifyZone(DNSSECKeeper& dk, const DNSName& zone) dsnames.insert(rr.qname); } else - if(doent) - delnonterm.insert(rr.qname); + delnonterm.insert(rr.qname); } NSEC3PARAMRecordContent ns3pr; @@ -223,6 +221,7 @@ bool rectifyZone(DNSSECKeeper& dk, const DNSName& zone) sd.db->startTransaction(zone, -1); bool realrr=true; + bool doent=true; uint32_t maxent = ::arg().asNum("max-ent-entries"); dononterm:; diff --git a/pdns/tcpreceiver.cc b/pdns/tcpreceiver.cc index 58e1622e0..b3d718ce4 100644 --- a/pdns/tcpreceiver.cc +++ b/pdns/tcpreceiver.cc @@ -821,10 +821,10 @@ int TCPNameserver::doAXFR(const DNSName &target, shared_ptr q, int ou DNSName shorter(zrr.dr.d_name); do { if (shorter==target) // apex is always auth - continue; + break; if(nsset.count(shorter) && !(zrr.dr.d_name==shorter && zrr.dr.d_type == QType::DS)) { zrr.auth=false; - continue; + break; } } while(shorter.chopOff()); } @@ -872,7 +872,7 @@ int TCPNameserver::doAXFR(const DNSName &target, shared_ptr q, int ou for(const auto& nt : nonterm) { DNSZoneRecord zrr; zrr.dr.d_name=nt; - zrr.dr.d_type=0; // was TYPE0 + zrr.dr.d_type=QType::ENT; zrr.auth=true; zrrs.push_back(zrr); }