summaryrefslogtreecommitdiffstats
path: root/usr.sbin/portsnap
diff options
context:
space:
mode:
authorcperciva <cperciva@FreeBSD.org>2005-09-15 13:29:10 +0000
committercperciva <cperciva@FreeBSD.org>2005-09-15 13:29:10 +0000
commitba5243d89406151fe76991cd01becd6b2ccc441b (patch)
tree5233bb11533d34633e2a8c0641a72c56ec7f2c1d /usr.sbin/portsnap
parent8042203ca34695f539eb975aafef32e91361b551 (diff)
downloadFreeBSD-src-ba5243d89406151fe76991cd01becd6b2ccc441b.zip
FreeBSD-src-ba5243d89406151fe76991cd01becd6b2ccc441b.tar.gz
Portsnap uses host(1) to search for mirrors, but this is only available
when the base system is not compiled with NO_BIND set. Before we start searching for mirrors, make sure that host(1) can be found, and if it doesn't exist then fallback to the A record instead of the SRV records. Submitted by: Luca Morettoni
Diffstat (limited to 'usr.sbin/portsnap')
-rw-r--r--usr.sbin/portsnap/portsnap/portsnap.sh6
1 files changed, 6 insertions, 0 deletions
diff --git a/usr.sbin/portsnap/portsnap/portsnap.sh b/usr.sbin/portsnap/portsnap/portsnap.sh
index a9c9aa6..0f87ab9 100644
--- a/usr.sbin/portsnap/portsnap/portsnap.sh
+++ b/usr.sbin/portsnap/portsnap/portsnap.sh
@@ -315,6 +315,12 @@ update_check_params() {
#
# We also ignore the Port field, since we are always going to use port 80.
fetch_pick_server() {
+# Check that host(1) exists (i.e., that the system wasn't built with the
+# NO_BIND flag set) and don't try to find a mirror if it doesn't exist.
+ if ! which -s host; then
+ return
+ fi
+
echo -n "Looking up ${SERVERNAME} mirrors..."
# Issue the SRV query and pull out the Priority, Weight, and Target fields.
OpenPOWER on IntegriCloud