From 8c949c5266f5b51f3e4264e0241f7bec8d454824 Mon Sep 17 00:00:00 2001 From: Peter van Dijk Date: Thu, 4 Oct 2012 07:09:11 +0000 Subject: [PATCH] make additional lookups smarter about trailing dots. make pdnssec error about trailing dots in names. make pdnssec warn about trailing dots in names inside content. strip dot from SRV hostnames during axfr. Patches by Ruben d'Arco. Fixes #289. git-svn-id: svn://svn.powerdns.com/pdns/trunk/pdns@2748 d19b8d6e-7fed-0310-83ef-9ca221ded41b --- pdns/packethandler.cc | 8 ++------ pdns/pdnssec.cc | 24 ++++++++++++++++++------ pdns/slavecommunicator.cc | 6 ++++-- 3 files changed, 24 insertions(+), 14 deletions(-) diff --git a/pdns/packethandler.cc b/pdns/packethandler.cc index 1986dbf15..25fe56474 100644 --- a/pdns/packethandler.cc +++ b/pdns/packethandler.cc @@ -362,15 +362,11 @@ int PacketHandler::doAdditionalProcessingAndDropAA(DNSPacket *p, DNSPacket *r, c vector crrs; - for(vector::const_iterator i=arrs.begin(); - i!=arrs.end(); ++i) + for(vector::const_iterator i=arrs.begin(); i!=arrs.end(); ++i) crrs.push_back(**i); // we now have a copy, push_back on packet might reallocate! - for(vector::const_iterator i=crrs.begin(); - i!=crrs.end(); - ++i) { - + for(vector::const_iterator i=crrs.begin(); i!=crrs.end(); ++i) { if(r->d.aa && !i->qname.empty() && i->qtype.getCode()==QType::NS && !B.getSOA(i->qname,sd,p)) { // drop AA in case of non-SOA-level NS answer, except for root referral r->setA(false); // i->d_place=DNSResourceRecord::AUTHORITY; // XXX FIXME diff --git a/pdns/pdnssec.cc b/pdns/pdnssec.cc index 3f4a7fc1a..fea7d5694 100644 --- a/pdns/pdnssec.cc +++ b/pdns/pdnssec.cc @@ -270,7 +270,7 @@ int checkZone(DNSSECKeeper& dk, const std::string& zone) } sd.db->list(zone, sd.domain_id); DNSResourceRecord rr; - uint64_t numrecords=0, numerrors=0; + uint64_t numrecords=0, numerrors=0, numwarnings=0; while(sd.db->get(rr)) { if(!rr.qtype.getCode()) @@ -283,20 +283,32 @@ int checkZone(DNSSECKeeper& dk, const std::string& zone) } if(rr.qtype.getCode() == QType::URL || rr.qtype.getCode() == QType::MBOXFW) { - cout<<"The recordtype "<(rr.priority)+" "+rr.content; + if ( (rr.qtype.getCode() == QType::NS || rr.qtype.getCode() == QType::SRV || rr.qtype.getCode() == QType::MX) && + rr.content[rr.content.size()-1] == '.') { + cout<<"[Warning] The record "<domain_id=domain_id; + if (i->qtype.getCode() == QType::SRV) + i->content = stripDot(i->content); #if 0 if(i->qtype.getCode()>=60000) throw DBException("Database can't store unknown record type "+lexical_cast(i->qtype.getCode()-1024)); -- 2.50.0