Date: Thu, 6 Feb 2014 14:08:11 +0100 (CET) From: Oliver Fromme <oliver.fromme@secnetix.de> To: FreeBSD-gnats-submit@freebsd.org Cc: olli@secnetix.de Subject: bin/186510: [PATCH] Latest BIND port triggers problem in portsnap Message-ID: <201402061308.s16D8BCC005007@grabthar.secnetix.de> Resent-Message-ID: <201402061310.s16DA0Qx061403@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 186510 >Category: bin >Synopsis: [PATCH] Latest BIND port triggers problem in portsnap >Confidential: no >Severity: serious >Priority: high >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Thu Feb 06 13:10:00 UTC 2014 >Closed-Date: >Last-Modified: >Originator: Oliver Fromme >Release: FreeBSD 9.2 i386 >Organization: secnetix GmbH & Co. KG http://www.secnetix.de/bsd >Environment: $ pkg_info | grep bind bind99-base-9.9.5 $ grep BASE\$ /var/db/ports/dns_bind99/options OPTIONS_FILE_SET+=REPLACE_BASE The problem only affects FreeBSD 9 and earlier. FreeBSD 10+ is not affected by the problem because BIND was removed from the base system, so the "replace base" option of the port isn't supported anymore. NB: I decided to set the priority "high" for this PR, because the problem prevents affected users from updating the ports collection. It's also trivial to fix. >Description: Since I updated to the latest BIND 9.9.5 port, portsnap fails with this message: Looking up portsnap.FreeBSD.org mirrors... none found. It turns out that the reason for this is the fact that the output from the host(1) command changed with the latest BIND update. Before the update, the lines looked tlike this: _http._tcp.portsnap.FreeBSD.org has SRV record x y z ... With the new version, they look like this: _http._tcp.portsnap.freebsd.org has SRV record x y z ... That is, the names being looked up on the left are converted to lower case. The portsnap script contains a sed command that tries to match the lines with the host name. That match now fails because of the upper/lower case difference. This means that no mirrors are found. >How-To-Repeat: On a FreeBSD 9 machine, install the latest dns/bind99 port with the option "replace base" set, so that /usr/bin/host comes from the BIND port. Then try to use portsnap. >Fix: The fix is trivial: Add the "I" flag to the sed command in order to make it case-insensitive. The fix should be applied on all branches, including HEAD and FreeBSD 10, even though they are not affected by this particular problem. DNS names are generally case-insensitive, so a script should never rely on the case of output produced by a program. Therefore, when matching host names, it should *always* be done in a case-insensitive manner. PS: I'm sorry, I had to copy&paste the diff, so I probably broke the tab characters. But the patch is sufficiently trivial so the patch(1) command isn't really required. @@ -348,7 +348,7 @@ # "$name server selection ..."; we allow either format. MLIST="_http._tcp.${SERVERNAME}" host -t srv "${MLIST}" | - sed -nE "s/${MLIST} (has SRV record|server selection) //p" | + sed -nE "s/${MLIST} (has SRV record|server selection) //Ip" | cut -f 1,2,4 -d ' ' | sed -e 's/\.$//' | sort > serverlist_full >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201402061308.s16D8BCC005007>