Bug 213411 - freebsd-update does not form a valid MLIST when host -t srv returns non caps reply
Summary: freebsd-update does not form a valid MLIST when host -t srv returns non caps ...
Status: Closed DUPLICATE of bug 170503
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: 10.2-RELEASE
Hardware: amd64 Any
: --- Affects Some People
Assignee: Colin Percival
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2016-10-12 10:14 UTC by George Mamalakis
Modified: 2016-10-15 19:49 UTC (History)
1 user (show)

See Also:


Attachments
Patch that just makes the sed statement case insensitive. (502 bytes, patch)
2016-10-12 10:14 UTC, George Mamalakis
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description George Mamalakis 2016-10-12 10:14:01 UTC
Created attachment 175655 [details]
Patch that just makes the sed statement case insensitive.

freebsd-update fetch fails to find a valid mirror list on some FreeBSD systems (tested with 10.1-RELEASE and 10.2-RELEASE), by returning:

Looking up update.FreeBSD.org mirrors... none found.
Fetching metadata signature for 10.2-RELEASE from update.FreeBSD.org...

Reason:

Depending on the DNS server a FreeBSD box asks, the answer to a query like:

host -tsrv _http._tcp.update.FREEBSD.org

can be either:
_http._tcp.update.freebsd.org has SRV record 1 5 80 update3.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 35 80 update4.freebsd.org.
_http._tcp.update.freebsd.org has SRV record 1 40 80 update6.freebsd.org.

or:
_http._tcp.update.FREEBSD.org has SRV record 1 50 80 update5.freebsd.org.
_http._tcp.update.FREEBSD.org has SRV record 1 40 80 update6.freebsd.org.
_http._tcp.update.FREEBSD.org has SRV record 1 5 80 update3.freebsd.org.
_http._tcp.update.FREEBSD.org has SRV record 1 35 80 update4.freebsd.org.

freebsd-update script forms a list of available mirror servers by executing such a query and by running various sed commands on its output. If the reply does not contain FREEBSD in caps, the produced list turns out to be empty - which is wrong, since the reply is not empty (and since FQDNs are case insensitive). This happens because the SERVERNAME variable of freebsd-update takes its value (update.FREEBSD.org) from /etc/freebsd-update.conf, which has caps in it.

It's strange that some DNS servers reply with caps when asked with caps and others don't, but this is a different issue...

A patch that makes the sed statement case insensitive is provided. Another possible patch that would resolve the issue would be to change /etc/freebsd-update.conf's record to use lower case, but IMHO, the script is wrong because FQDNs are case insensitive and it doesn't take it into account.
Comment 1 Colin Percival freebsd_committer 2016-10-15 19:49:17 UTC
Fixed in HEAD, will MFC soon.

*** This bug has been marked as a duplicate of bug 170503 ***