summaryrefslogtreecommitdiffstats
path: root/usr.bin/fetch/ftp.c
diff options
context:
space:
mode:
authorfenner <fenner@FreeBSD.org>1999-02-03 20:43:29 +0000
committerfenner <fenner@FreeBSD.org>1999-02-03 20:43:29 +0000
commitadb8ba8144ce2b91bea380dfab072db7d773206b (patch)
tree17e9ea8360bb7bd5d29a6860b2e0b27313efbc19 /usr.bin/fetch/ftp.c
parentaf6685ec337a58b54afcd24d9b93bd69225e9d73 (diff)
downloadFreeBSD-src-adb8ba8144ce2b91bea380dfab072db7d773206b.zip
FreeBSD-src-adb8ba8144ce2b91bea380dfab072db7d773206b.tar.gz
Warn about collapsing multiple slashes into 1 in ftp URL's.
Look at the FTP_PASSIVE_MODE environment variable like the man page says. PR: bin/9464 Submitted by: John A. Shue <John.Shue@symmetron.com> Add references to RFC's 1790, 959, 850. PR: doc/6564
Diffstat (limited to 'usr.bin/fetch/ftp.c')
-rw-r--r--usr.bin/fetch/ftp.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/usr.bin/fetch/ftp.c b/usr.bin/fetch/ftp.c
index 45c8ecf..78b57ff 100644
--- a/usr.bin/fetch/ftp.c
+++ b/usr.bin/fetch/ftp.c
@@ -26,7 +26,7 @@
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Id: ftp.c,v 1.10 1998/09/20 00:01:26 jkh Exp $
+ * $Id: ftp.c,v 1.11 1998/12/08 13:00:49 cracauer Exp $
*/
#include <sys/types.h>
@@ -180,9 +180,10 @@ ftp_parse(struct fetch_state *fs, const char *uri)
* we just pretend that multiple slashes are a
* single slash.
*/
- if (*r == '\0')
+ if (*r == '\0') {
+ warnx("skipping double slash in FTP URL; see man page or RFC1738.");
ftps->ftp_remote_ndirs--;
- else
+ } else
*dp++ = percent_decode(r);
r = s;
}
@@ -366,6 +367,8 @@ ftp_retrieve(struct fetch_state *fs)
}
} else
ftpBinary(ftp);
+ if (getenv("FTP_PASSIVE_MODE"))
+ fs->fs_passive_mode = 1;
ftpPassive(ftp, fs->fs_passive_mode);
for (i = 0, dp = ftps->ftp_remote_dirs; i < ftps->ftp_remote_ndirs; i++, dp++) {
if ((status = ftpChdir(ftp, *dp)) != 0) {
OpenPOWER on IntegriCloud