From aa6d20455cb671550b07d8263f8f3382ee9c46ee Mon Sep 17 00:00:00 2001 From: Kees Monshouwer Date: Sat, 2 Jan 2016 19:43:18 +0100 Subject: [PATCH] trailing dots in bind slave zones --- modules/bindbackend/bindbackend2.cc | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/bindbackend/bindbackend2.cc b/modules/bindbackend/bindbackend2.cc index 18c9d3c073..2ff20b8951 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<