From: Kees Monshouwer Date: Sat, 2 Jan 2016 18:43:18 +0000 (+0100) Subject: trailing dots in bind slave zones X-Git-Tag: dnsdist-1.0.0-alpha2~104^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=aa6d20455cb671550b07d8263f8f3382ee9c46ee;p=pdns trailing dots in bind slave zones --- diff --git a/modules/bindbackend/bindbackend2.cc b/modules/bindbackend/bindbackend2.cc index 18c9d3c07..2ff20b895 100644 --- a/modules/bindbackend/bindbackend2.cc +++ b/modules/bindbackend/bindbackend2.cc @@ -257,13 +257,14 @@ bool Bind2Backend::feedRecord(const DNSResourceRecord &rr, string *ordername) BB2DomainInfo bbd; safeGetBBDomainInfo(d_transaction_id, &bbd); - string name=bbd.d_name.toStringNoDot(); - string qname=rr.qname.toStringNoDot(); + string name=bbd.d_name.toString(); + string qname=rr.qname.toString(); if(!stripDomainSuffix(&qname, name)) throw DBException("out-of-zone data '"+qname+".' during AXFR of zone '"+name+".'"); - string content=rr.content; + shared_ptr drc(DNSRecordContent::mastermake(rr.qtype.getCode(), 1, rr.content)); + string content = drc->getZoneRepresentation(); // SOA needs stripping too! XXX FIXME - also, this should not be here I think switch(rr.qtype.getCode()) { @@ -272,8 +273,7 @@ bool Bind2Backend::feedRecord(const DNSResourceRecord &rr, string *ordername) case QType::CNAME: case QType::DNAME: case QType::NS: - if(!stripDomainSuffix(&content, name)) - content=stripDot(content)+"."; + stripDomainSuffix(&content, name); // falltrough default: *d_of<