summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorFederico G. Schwindt <fgsch@cvs.openbsd.org>2005-09-21 22:31:48 +0000
committerFederico G. Schwindt <fgsch@cvs.openbsd.org>2005-09-21 22:31:48 +0000
commit63e90dafb93b6a3e64ad9102d8e9c4045a03ea3a (patch)
tree99f3250956c6fc727a418211424d04cdcec06077 /usr.bin
parent92d794a50c11b41ae85a0bb9d7250ac45f4d111d (diff)
add ability to disable EPSV/EPRT from command-line.
from Thorsten Glaser via Matt Van Mater < matt dot vanmater at gmail dot com > with some minor mods. deraadt@ jmc@ ok
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/ftp/ftp.16
-rw-r--r--usr.bin/ftp/main.c12
2 files changed, 12 insertions, 6 deletions
diff --git a/usr.bin/ftp/ftp.1 b/usr.bin/ftp/ftp.1
index b5340a5fbd8..5783671acc7 100644
--- a/usr.bin/ftp/ftp.1
+++ b/usr.bin/ftp/ftp.1
@@ -1,4 +1,4 @@
-.\" $OpenBSD: ftp.1,v 1.52 2005/07/06 10:35:36 jmc Exp $
+.\" $OpenBSD: ftp.1,v 1.53 2005/09/21 22:31:47 fgsch Exp $
.\" $NetBSD: ftp.1,v 1.22 1997/08/18 10:20:22 lukem Exp $
.\"
.\" Copyright (c) 1985, 1989, 1990, 1993
@@ -38,7 +38,7 @@
.Nd ARPANET file transfer program
.Sh SYNOPSIS
.Nm ftp
-.Op Fl 46AadegimnptVv
+.Op Fl 46AadEegimnptVv
.Op Fl P Ar port
.Op Fl r Ar seconds
.Op Ar host Op Ar port
@@ -104,6 +104,8 @@ Causes
to bypass the normal login procedure and use an anonymous login instead.
.It Fl d
Enables debugging.
+.It Fl E
+Disables EPSV/EPRT command on IPv4 connections.
.It Fl e
Disables command line editing.
Useful for Emacs ange-ftp.
diff --git a/usr.bin/ftp/main.c b/usr.bin/ftp/main.c
index 3cefbd70acf..ca87d115d9b 100644
--- a/usr.bin/ftp/main.c
+++ b/usr.bin/ftp/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.58 2004/07/20 03:50:26 deraadt Exp $ */
+/* $OpenBSD: main.c,v 1.59 2005/09/21 22:31:47 fgsch Exp $ */
/* $NetBSD: main.c,v 1.24 1997/08/18 10:20:26 lukem Exp $ */
/*
@@ -66,7 +66,7 @@ static char copyright[] =
#endif /* not lint */
#if !defined(lint) && !defined(SMALL)
-static char rcsid[] = "$OpenBSD: main.c,v 1.58 2004/07/20 03:50:26 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: main.c,v 1.59 2005/09/21 22:31:47 fgsch Exp $";
#endif /* not lint and not SMALL */
/*
@@ -172,7 +172,7 @@ main(volatile int argc, char *argv[])
if (isatty(fileno(ttyout)) && !dumb_terminal && foregroundproc())
progress = 1; /* progress bar on if tty is usable */
- while ((ch = getopt(argc, argv, "46Aadegimno:pP:r:tvV")) != -1) {
+ while ((ch = getopt(argc, argv, "46AadEegimno:pP:r:tvV")) != -1) {
switch (ch) {
case '4':
family = PF_INET;
@@ -194,6 +194,10 @@ main(volatile int argc, char *argv[])
debug++;
break;
+ case 'E':
+ epsv4 = 0;
+ break;
+
case 'e':
#ifndef SMALL
editing = 0;
@@ -723,7 +727,7 @@ void
usage(void)
{
(void)fprintf(stderr,
- "usage: %s [-46AadegimnptVv] [-P port] [-r seconds] [host [port]]\n"
+ "usage: %s [-46AadEegimnptVv] [-P port] [-r seconds] [host [port]]\n"
" %s [-o output] ftp://[user:password@]host[:port]/file[/]\n"
" %s [-o output] http://host[:port]/file\n"
" %s [-o output] host:[/path/]file[/]\n",