summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1998-02-17 23:19:10 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1998-02-17 23:19:10 +0000
commit4bf25be6f082822cb2e8f1578e000cb51110b1ff (patch)
treee17e0fe3ff3b0caa4f2bbf7ef5e33a52f70b08dd
parent9bdfc4054ea376a63d1541ca018b4fd33e5ca041 (diff)
Use ftp's new -o flag and give the user the option of using
active ftp (default is passive with auto-fallback to active).
-rw-r--r--distrib/miniroot/install.sub32
1 files changed, 18 insertions, 14 deletions
diff --git a/distrib/miniroot/install.sub b/distrib/miniroot/install.sub
index 372029ec0ff..d59a3f30fed 100644
--- a/distrib/miniroot/install.sub
+++ b/distrib/miniroot/install.sub
@@ -1,5 +1,5 @@
#!/bin/sh
-# $OpenBSD: install.sub,v 1.50 1998/01/10 02:22:57 deraadt Exp $
+# $OpenBSD: install.sub,v 1.51 1998/02/17 23:19:09 millert Exp $
# $NetBSD: install.sub,v 1.5.2.8 1996/09/02 23:25:02 pk Exp $
#
# Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -633,7 +633,7 @@ install_url() {
# Get several parameters from the user, and xfer
# files from the server.
# Note: _ftp_server_ip, _ftp_server_dir, _ftp_server_login,
- # _ftp_server_password, and _ftp_passive must be global.
+ # _ftp_server_password, and _ftp_active must be global.
local _sets
local _f
@@ -665,16 +665,20 @@ install_url() {
export http_proxy=${_proxy_host}
fi
if [ "${_url_type}" = "ftp" -a "X$ftp_proxy" = "X" ]; then
- # Use passive mode ftp? (incompatible with proxy)
- case "${_ftp_passive}" in
- -p) resp=y ;;
+ # Use active mode ftp? (irrelevant if using a proxy)
+ case "${_ftp_active}" in
+ -A) resp=y ;;
*) resp=n ;;
esac
- echo -n "Do you want to use passive ftp? [${resp}] "
+ echo "By default, ftp will attempt a passive connection and fall back to a normal"
+ echo "(active) connection if that doesn't work. However, there are some very"
+ echo "old ftp servers that claim to support passive mode, but really do not."
+ echo "In this case, you should explicately request an active session."
+ echo -n "Do you want to use active ftp? [${resp}] "
getresp "${resp}"
case "$resp" in
- y*|Y*) _ftp_passive=-p ;;
- *) unset _ftp_passive ;;
+ y*|Y*) _ftp_active=-A ;;
+ *) unset _ftp_active ;;
esac
fi
@@ -684,7 +688,7 @@ install_url() {
case "$resp" in
n*|N*) ;;
*)
- ftp ${_ftp_passive} -V -a ftp://ftp.openbsd.org/pub/OpenBSD/${VERSION_MAJOR}.${VERSION_MINOR}/ftplist | grep "^${_url_type}:"
+ ftp ${_ftp_active} -V -a -o - ftp://ftp.openbsd.org/pub/OpenBSD/${VERSION_MAJOR}.${VERSION_MINOR}/ftplist | grep "^${_url_type}:"
;;
esac
@@ -743,7 +747,7 @@ install_url() {
else
# Assumes index file is "index.txt" for http (or proxy)
# We can't use index.html since the format is server-dependent
- _file_list=`eval ftp -V ${_url_type}://\\$_${_url_type}_server_ip/\\$_${_url_type}_server_dir/index.txt | sed 's/ //'`
+ _file_list=`eval ftp -o - -V ${_url_type}://\\$_${_url_type}_server_ip/\\$_${_url_type}_server_dir/index.txt | sed 's/ //'`
fi
_sets=""
@@ -880,15 +884,15 @@ install_url() {
echo ""
if [ "X${_f}" = "X${_kernel}" ]; then
if [ "${_url_type}" = "ftp" -a "X${ftp_proxy}" = X"" ]; then
- ( cd /mnt ; ftp ${_ftp_passive} -V ftp://${_ftp_server_login}:${_ftp_server_password}@${_ftp_server_ip}/${_ftp_server_dir}/${_f} )
+ ( cd /mnt ; ftp -o - ${_ftp_active} -V ftp://${_ftp_server_login}:${_ftp_server_password}@${_ftp_server_ip}/${_ftp_server_dir}/${_f} )
else
- ( cd /mnt ; eval ftp -V ${_url_type}://\$_${_url_type}_server_ip/\$_${_url_type}_server_dir/${_f} )
+ ( cd /mnt ; eval ftp -o - -V ${_url_type}://\$_${_url_type}_server_ip/\$_${_url_type}_server_dir/${_f} )
fi
else
if [ "${_url_type}" = "ftp" -a "X${ftp_proxy}" = X"" ]; then
- ( cd /mnt ; ftp ${_ftp_passive} -V ftp://${_ftp_server_login}:${_ftp_server_password}@${_ftp_server_ip}/${_ftp_server_dir}/${_f} | tar zxvpf - )
+ ( cd /mnt ; ftp -o - ${_ftp_active} -V ftp://${_ftp_server_login}:${_ftp_server_password}@${_ftp_server_ip}/${_ftp_server_dir}/${_f} | tar zxvpf - )
else
- ( cd /mnt ; eval ftp -V ${_url_type}://\$_${_url_type}_server_ip/\$_${_url_type}_server_dir/${_f} | tar zxvpf - )
+ ( cd /mnt ; eval ftp -o - -V ${_url_type}://\$_${_url_type}_server_ip/\$_${_url_type}_server_dir/${_f} | tar zxvpf - )
fi
fi
if [ $? -ne 0 ]; then