]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
traling dot in DNAME content 3021/head
authorKees Monshouwer <mind04@monshouwer.org>
Fri, 11 Dec 2015 00:30:44 +0000 (01:30 +0100)
committermind04 <mind04@monshouwer.org>
Fri, 11 Dec 2015 08:16:19 +0000 (09:16 +0100)
modules/bindbackend/bindbackend2.cc
pdns/dnsrecords.cc
pdns/pdnssec.cc
pdns/resolver.cc

index 39abbd30c7d5d3272f63c6890b8b0ce6e09f1fcf..de879f2b8da9b5b1c1efe3afd63b53b6a5defa30 100644 (file)
@@ -276,6 +276,7 @@ bool Bind2Backend::feedRecord(const DNSResourceRecord &r, string *ordername)
     *d_of<<qname<<"\t"<<r.ttl<<"\t"<<r.qtype.getName()<<"\t"<<r.priority<<"\t"<<content<<endl;
     break;
   case QType::CNAME:
+  case QType::DNAME:
   case QType::NS:
     if(!stripDomainSuffix(&content, domain))
       content=stripDot(content)+".";
index 413051d7f1bde442ecbb47b9f2fd7233ac52136b..d9ee49a9062b14816db754f8f6e055822146839b 100644 (file)
@@ -26,7 +26,7 @@
 
 void DNSResourceRecord::setContent(const string &cont) {
   content = cont;
-  if(!content.empty() && (qtype==QType::MX || qtype==QType::NS || qtype==QType::CNAME))
+  if(!content.empty() && (qtype==QType::MX || qtype==QType::NS || qtype==QType::CNAME || qtype==QType::DNAME))
     boost::erase_tail(content, 1);
 
   if(qtype.getCode() == QType::MX) {
@@ -58,6 +58,7 @@ string DNSResourceRecord::getZoneRepresentation() const {
       if (*(content.rbegin()) != '.') ret<<".";
     break;
     case QType::CNAME:
+    case QType::DNAME:
     case QType::NS:
       ret<<content;
       if (*(content.rbegin()) != '.') ret<<".";
index 539a6db104f2670744f49198a0812f89305d0ca9..63defb4c067def2bb273ae3012f1a4be15eb4b5c 100644 (file)
@@ -607,7 +607,7 @@ int checkZone(DNSSECKeeper &dk, UeberBackend &B, const std::string& zone)
       numerrors++;
     }
 
-    if ( (rr.qtype.getCode() == QType::NS || rr.qtype.getCode() == QType::SRV || rr.qtype.getCode() == QType::MX || rr.qtype.getCode() == QType::CNAME) &&
+    if ( (rr.qtype.getCode() == QType::NS || rr.qtype.getCode() == QType::SRV || rr.qtype.getCode() == QType::MX || rr.qtype.getCode() == QType::CNAME || rr.qtype.getCode() == QType::DNAME) &&
          rr.content[rr.content.size()-1] == '.') {
       cout<<"[Warning] The record "<<rr.qname<<" with type "<<rr.qtype.getName()<<" has a trailing dot in the content ("<<rr.content<<"). Your backend might not work well with this."<<endl;
       numwarnings++;
index d0357167bbe2b121ec88bd28cb4db63b748eb976..501ee2554b9960c34e9e9152118782b0b3feccee 100644 (file)
@@ -203,7 +203,7 @@ static int parseResult(MOADNSParser& mdp, const std::string& origQname, uint16_t
 
     uint16_t qtype=rr.qtype.getCode();
 
-    if(!rr.content.empty() && (qtype==QType::MX || qtype==QType::NS || qtype==QType::CNAME))
+    if(!rr.content.empty() && (qtype==QType::MX || qtype==QType::NS || qtype==QType::CNAME || qtype==QType::DNAME))
       boost::erase_tail(rr.content, 1);
 
     if(rr.qtype.getCode() == QType::MX) {