summaryrefslogtreecommitdiff
path: root/usr.bin/ftp
diff options
context:
space:
mode:
authorBob Beck <beck@cvs.openbsd.org>2007-03-06 05:16:02 +0000
committerBob Beck <beck@cvs.openbsd.org>2007-03-06 05:16:02 +0000
commit0e1ac31a8fd9648e4b712bc2d227c036835c44ba (patch)
tree28fb29d910cf18bd179d79210b514e4d212eff3e /usr.bin/ftp
parentc88b826decd6f63b15ab2e6f3de34a06da391018 (diff)
Since our ftp client opportuniticly tries EPSV, then falls back to PASV for
older clients, dont' spew out "500 unimplimented" when a sever that doesn't do EPSV doesn't like it, just notice, and fall back to PASV, then complain if that fails. ok deraadt@
Diffstat (limited to 'usr.bin/ftp')
-rw-r--r--usr.bin/ftp/ftp.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/usr.bin/ftp/ftp.c b/usr.bin/ftp/ftp.c
index 7f58335d237..252b27585f2 100644
--- a/usr.bin/ftp/ftp.c
+++ b/usr.bin/ftp/ftp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ftp.c,v 1.65 2006/06/23 20:35:25 steven Exp $ */
+/* $OpenBSD: ftp.c,v 1.66 2007/03/06 05:16:01 beck Exp $ */
/* $NetBSD: ftp.c,v 1.27 1997/08/18 10:20:23 lukem Exp $ */
/*
@@ -60,7 +60,7 @@
*/
#if !defined(lint) && !defined(SMALL)
-static const char rcsid[] = "$OpenBSD: ftp.c,v 1.65 2006/06/23 20:35:25 steven Exp $";
+static const char rcsid[] = "$OpenBSD: ftp.c,v 1.66 2007/03/06 05:16:01 beck Exp $";
#endif /* not lint and not SMALL */
#include <sys/types.h>
@@ -1164,7 +1164,16 @@ reinit:
switch (data_addr.su_family) {
case AF_INET:
if (epsv4 && !epsv4bad) {
+ int ov;
+ /* shut this command up in case it fails */
+ ov = verbose;
+ verbose = -1;
result = command(pasvcmd = "EPSV");
+ /*
+ * now back to whatever verbosity we had before
+ * and we can try PASV
+ */
+ verbose = ov;
if (code / 10 == 22 && code != 229) {
fputs(
"wrong server: return code must be 229\n",