From nobody@FreeBSD.org  Thu Aug  9 14:43:39 2012
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 360BC106566C
	for <freebsd-gnats-submit@FreeBSD.org>; Thu,  9 Aug 2012 14:43:39 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id 218938FC0C
	for <freebsd-gnats-submit@FreeBSD.org>; Thu,  9 Aug 2012 14:43:39 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id q79Ehcgw076196
	for <freebsd-gnats-submit@FreeBSD.org>; Thu, 9 Aug 2012 14:43:38 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id q79Ehc0l076195;
	Thu, 9 Aug 2012 14:43:38 GMT
	(envelope-from nobody)
Message-Id: <201208091443.q79Ehc0l076195@red.freebsd.org>
Date: Thu, 9 Aug 2012 14:43:38 GMT
From: Wybe van der Ham <wybe@snth.eu>
To: freebsd-gnats-submit@FreeBSD.org
Subject: freebsd-update mirror finding is case sensitive
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         170503
>Category:       bin
>Synopsis:       freebsd-update(8) mirror finding is case sensitive
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    cperciva
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Aug 09 14:50:01 UTC 2012
>Closed-Date:    
>Last-Modified:  Sun Apr 13 23:26:24 UTC 2014
>Originator:     Wybe van der Ham
>Release:        8.3
>Organization:
none
>Environment:
FreeBSD testmachine 8.3-RELEASE FreeBSD 8.3-RELEASE #0: Mon Apr  9 21:47:23 UTC 2012     root@almeida.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  i386
>Description:
The freebsd-update script tries to find mirrors using SRV records. My Mikrotik router with built-in nameserver gives the following output:
# host -t srv _http._tcp.update.FreeBSD.org
_http._tcp.update.freebsd.org has SRV record 1 35 80 update4.FreeBSD.org.
_http._tcp.update.freebsd.org has SRV record 1 50 80 update5.FreeBSD.org.
_http._tcp.update.freebsd.org has SRV record 1 5 80 update3.FreeBSD.org.

The first part is converted to lowercase. The freebsd-update script checks (with sed) for "_http._tcp.update.FreeBSD.org", but that does not match the lowercase output.
freebsd-update is unable to find the mirrors, and freebsd-update fails.

The workaround for this problem is to change the Servername in /etc/freebsd-update.conf to all lowercase.
>How-To-Repeat:
Use a mikrotik router as nameserver or any other nameserver that returns the requested hostname in lowercase instead of the original casing.
>Fix:
Make the regular expression - used to strip away the "_http._tcp.update.freebsd.org has SRV record " - case insensitive:

Change:
sed -nE "s/${MLIST} (has SRV record|server selection) //p"
to
sed -nE "s/${MLIST} (has SRV record|server selection) //Ip"

>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->cperciva 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Sun Apr 13 23:24:27 UTC 2014 
Responsible-Changed-Why:  
Over to maintainer. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=170503 
>Unformatted:
