diff options
author | Paul Traina <pst@FreeBSD.org> | 1994-09-29 20:55:25 +0000 |
---|---|---|
committer | Paul Traina <pst@FreeBSD.org> | 1994-09-29 20:55:25 +0000 |
commit | 1dcd7de0c3060a25cf1885141646d5f48842acd0 (patch) | |
tree | 459b9d758e9dc7548e339c1c902cf0bff4a8c962 /usr.bin/ftp | |
parent | 122c9247d493a97d5caf93de78cd8e59319ba4b9 (diff) | |
download | src-1dcd7de0c3060a25cf1885141646d5f48842acd0.tar.gz src-1dcd7de0c3060a25cf1885141646d5f48842acd0.zip |
Notes
Diffstat (limited to 'usr.bin/ftp')
-rw-r--r-- | usr.bin/ftp/Makefile | 2 | ||||
-rw-r--r-- | usr.bin/ftp/ftp.1 | 3 | ||||
-rw-r--r-- | usr.bin/ftp/main.c | 16 |
3 files changed, 18 insertions, 3 deletions
diff --git a/usr.bin/ftp/Makefile b/usr.bin/ftp/Makefile index fbb5a9189bdc..dc8197fb2b68 100644 --- a/usr.bin/ftp/Makefile +++ b/usr.bin/ftp/Makefile @@ -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> diff --git a/usr.bin/ftp/ftp.1 b/usr.bin/ftp/ftp.1 index 417da08d4446..47904077b2c4 100644 --- a/usr.bin/ftp/ftp.1 +++ b/usr.bin/ftp/ftp.1 @@ -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 diff --git a/usr.bin/ftp/main.c b/usr.bin/ftp/main.c index 52a95b03d93a..0edff5ee1473 100644 --- a/usr.bin/ftp/main.c +++ b/usr.bin/ftp/main.c @@ -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 */ /* |