diff options
author | des <des@FreeBSD.org> | 1999-06-07 16:35:15 +0000 |
---|---|---|
committer | des <des@FreeBSD.org> | 1999-06-07 16:35:15 +0000 |
commit | 53320672a008ee6ea85e8a2c435066893d6f1b98 (patch) | |
tree | 12baa9d8c3317b0b1fa2406b0ee61384539463b3 /usr.bin/ftp | |
parent | 1149f9c0c03c2747fd7d1216884ec8694768b9e7 (diff) | |
download | FreeBSD-src-53320672a008ee6ea85e8a2c435066893d6f1b98.zip FreeBSD-src-53320672a008ee6ea85e8a2c435066893d6f1b98.tar.gz |
Separate the pftp and FTP_PASSIVE_MODE tests so gate mode works again.
PR: bin/12070
Submitted by: Dominic Mitchell <Dom.Mitchell@palmerharvey.co.uk>
Specifically check that FTP_PASSIVE_MODE is set to YES, rather than
just checking if it is defined.
Discussed on: freebsd-current
Diffstat (limited to 'usr.bin/ftp')
-rw-r--r-- | usr.bin/ftp/main.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/usr.bin/ftp/main.c b/usr.bin/ftp/main.c index 2ba5ac0..d8e339d 100644 --- a/usr.bin/ftp/main.c +++ b/usr.bin/ftp/main.c @@ -1,4 +1,4 @@ -/* $Id$ */ +/* $Id: main.c,v 1.16 1997/12/13 20:38:19 pst Exp $ */ /* $NetBSD: main.c,v 1.26 1997/10/14 16:31:22 christos Exp $ */ /* @@ -44,7 +44,7 @@ __COPYRIGHT("@(#) Copyright (c) 1985, 1989, 1993, 1994\n\ #if 0 static char sccsid[] = "@(#)main.c 8.6 (Berkeley) 10/9/94"; #else -__RCSID("$Id$"); +__RCSID("$Id: main.c,v 1.16 1997/12/13 20:38:19 pst Exp $"); __RCSID_SOURCE("$NetBSD: main.c,v 1.26 1997/10/14 16:31:22 christos Exp $"); #endif #endif /* not lint */ @@ -78,7 +78,7 @@ main(argc, argv) int ch, top, rval; long port; struct passwd *pw = NULL; - char *cp, *ep, homedir[MAXPATHLEN]; + char *cp, *ep, homedir[MAXPATHLEN], *s; int dumbterm; (void) setlocale(LC_ALL, ""); @@ -131,7 +131,10 @@ main(argc, argv) cp = strrchr(argv[0], '/'); cp = (cp == NULL) ? argv[0] : cp + 1; - if (getenv("FTP_PASSIVE_MODE") || strcmp(cp, "pftp") == 0) + if ((s = getenv("FTP_PASSIVE_MODE")) != NULL + && strcasecmp(s, "yes") == 0) + passivemode = 1; + if (strcmp(cp, "pftp") == 0) passivemode = 1; else if (strcmp(cp, "gate-ftp") == 0) gatemode = 1; |