From: Peter van Dijk Date: Thu, 23 Sep 2021 15:25:16 +0000 (+0200) Subject: auth: remove attodot feature; fixes #10254 X-Git-Tag: auth-4.6.0-alpha1^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=400b7df8dc97020bb32c72c93af76a611f3ced8c;p=thirdparty%2Fpdns.git auth: remove attodot feature; fixes #10254 --- diff --git a/docs/upgrading.rst b/docs/upgrading.rst index 51e6307907..9387cc9711 100644 --- a/docs/upgrading.rst +++ b/docs/upgrading.rst @@ -8,9 +8,29 @@ Please upgrade to the PowerDNS Authoritative Server 4.0.0 from 3.4.2+. See the `3.X `__ upgrade notes if your version is older than 3.4.2. -4.4.x to 4.5.0 or master +4.5.x to 4.6.0 or master ------------------------ +Automatic conversion of ``@`` signs in SOA +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Before version 4.5.0, PowerDNS would automatically replace ``@`` in the SOA RNAME with ``.``, making it easy for users to enter their hostmaster email address without having to think about syntax. +However, this feature interacts badly with handling of presigned zones. +In version 4.5.0, this feature was accidentally broken in the implementation of the zone cache. +In 4.6.0, this automatic conversion is fully removed. +If you still have ``@`` signs in any SOA RNAMEs, 4.6.0 will serve those out literally. + +4.4.x to 4.5.0 +-------------- + +Automatic conversion of ``@`` signs in SOA +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Before version 4.5.0, PowerDNS would automatically replace ``@`` in the SOA RNAME with ``.``, making it easy for users to enter their hostmaster email address without having to think about syntax. +In version 4.5.0, this feature was accidentally broken in the implementation of the zone cache, and the replacement would only happen if the zone cache was disabled. +Note that in 4.6.0, this automatic conversion is fully removed. +If you still have ``@`` signs in any SOA RNAMEs, 4.5.0 will serve those out literally if the zone cache is enabled. + Record type changes ^^^^^^^^^^^^^^^^^^^ diff --git a/pdns/dns.cc b/pdns/dns.cc index cd0ce26cc6..03dfff715d 100644 --- a/pdns/dns.cc +++ b/pdns/dns.cc @@ -99,20 +99,3 @@ uint32_t hashQuestion(const char* packet, uint16_t len, uint32_t init) return ret; } - -string& attodot(string &str) -{ - if(str.find_first_of('@')==string::npos) - return str; - - for (unsigned int i = 0; i < str.length(); i++) - { - if (str[i] == '@') { - str[i] = '.'; - break; - } else if (str[i] == '.') { - str.insert(i++, "\\"); - } - } - return str; -} diff --git a/pdns/dns.hh b/pdns/dns.hh index b5ca2ada1f..764ea46a81 100644 --- a/pdns/dns.hh +++ b/pdns/dns.hh @@ -243,5 +243,3 @@ struct TSIGTriplet DNSName name, algo; string secret; }; - -string &attodot(string &str); //!< for when you need to insert an email address in the SOA diff --git a/pdns/dnsbackend.cc b/pdns/dnsbackend.cc index f2c86729c8..befa19bba0 100644 --- a/pdns/dnsbackend.cc +++ b/pdns/dnsbackend.cc @@ -340,7 +340,7 @@ void fillSOAData(const string &content, SOAData &data) try { data.nameserver = DNSName(parts.at(0)); - data.hostmaster = DNSName(attodot(parts.at(1))); // ahu@ds9a.nl -> ahu.ds9a.nl, piet.puk@ds9a.nl -> piet\.puk.ds9a.nl + data.hostmaster = DNSName(parts.at(1)); data.serial = pdns_stou(parts.at(2).c_str()); data.refresh = pdns_stou(parts.at(3).c_str()); data.retry = pdns_stou(parts.at(4).c_str());