Add -p flag and pftp alias for passive ftp

This commit is contained in:
Paul Traina 1994-09-29 20:55:25 +00:00
parent 122c9247d4
commit 1dcd7de0c3
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=3209
3 changed files with 18 additions and 3 deletions

View file

@ -2,5 +2,7 @@
PROG= ftp
SRCS= cmds.c cmdtab.c ftp.c main.c ruserpass.c domacro.c
LINKS= ${BINDIR}/ftp ${BINDIR}/pftp
MLINKS= ftp.1 pftp.1
.include <bsd.prog.mk>

View file

@ -45,6 +45,7 @@ file transfer program
.Op Fl d
.Op Fl i
.Op Fl n
.Op Fl p
.Op Fl g
.Op Ar host
.Sh DESCRIPTION
@ -85,6 +86,8 @@ multiple file transfers.
Enables debugging.
.It Fl g
Disables file name globbing.
.It Fl p
Enable passive mode operation for use behind connection filtering firewalls.
.El
.Pp
The client host with which

View file

@ -58,6 +58,7 @@ static char sccsid[] = "@(#)main.c 8.4 (Berkeley) 4/3/94";
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include "ftp_var.h"
@ -76,8 +77,14 @@ main(argc, argv)
doglob = 1;
interactive = 1;
autologin = 1;
passivemode = 0;
while ((ch = getopt(argc, argv, "dgintv")) != EOF) {
cp = strrchr(argv[0], '/');
cp = (cp == NULL) ? argv[0] : cp+1;
if (strcmp(cp, "pftp") == 0)
passivemode = 1;
while ((ch = getopt(argc, argv, "dginptv")) != EOF) {
switch (ch) {
case 'd':
options |= SO_DEBUG;
@ -96,6 +103,10 @@ main(argc, argv)
autologin = 0;
break;
case 'p':
passivemode = 1;
break;
case 't':
trace++;
break;
@ -106,7 +117,7 @@ main(argc, argv)
default:
(void)fprintf(stderr,
"usage: ftp [-dgintv] [host [port]]\n");
"usage: ftp [-dginptv] [host [port]]\n");
exit(1);
}
}
@ -118,7 +129,6 @@ main(argc, argv)
verbose++;
cpend = 0; /* no pending replies */
proxy = 0; /* proxy not active */
passivemode = 0;/* passive mode not active */
crflag = 1; /* strip c.r. on ascii gets */
sendport = -1; /* not using ports */
/*