Back out the fluff, leave the meat

This commit is contained in:
Paul Traina 1994-10-07 07:48:18 +00:00
parent ccf5ce89c2
commit d456d8f48d
6 changed files with 30 additions and 2 deletions

View File

@ -7,7 +7,7 @@ DPADD= $(LIBREADLINE) $(LIBTERMCAP)
LDADD= -lreadline -ltermcap
CFLAGS+= -DGZCAT=\"/usr/bin/gzcat\" -DREADLINE -DCURSES -DNO_CURSES_H \
-DSYSLOG -DTRY_ABOR -DGATEWAY
-DSYSLOG -DTRY_ABOR -DGATEWAY -DPASSIVEMODE
MK= $(CC) $(CFLAGS) $(LDADD)

View File

@ -36,12 +36,14 @@
#include "copyright.h"
/* cmds.c globals */
#ifdef PASSIVEMODE
int passivemode; /* no reverse FTP connections */
#endif
int curtype; /* file transfer type */
char *typeabbrs = "abiet";
str32 curtypename; /* name of file transfer type */
int verbose; /* verbosity level of output */
int mprompt; /* interactively prompt on m* cmds */
int passivemode; /* use passive ftp connections */
int debug; /* debugging level */
int options; /* used during socket creation */
int macnum; /* number of defined macros */
@ -2057,6 +2059,10 @@ int show_version(int argc, char **argv)
#ifdef NET_ERRNO_H
DStrs[nDStrs++] = "NET_ERRNO_H";
#endif
#ifdef PASSIVEMODE
DStrs[nDStrs++] = "PASSIVEMODE";
#endif
/* DONE with #ifdefs for now! */
@ -2209,11 +2215,14 @@ int unimpl(int argc, char **argv)
return (NOERR);
} /* unimpl */
#ifdef PASSIVEMODE
int setpassive(int argc, char **argv)
{
passivemode = !passivemode;
printf( "Passive mode %s.\n", (passivemode ? "ON" : "OFF") );
return NOERR;
}
#endif
/* eof cmds.c */

View File

@ -121,7 +121,10 @@ int unimpl(int argc, char **argv);
long GetDateSizeFromLSLine(char *fName, unsigned long *mod_time);
long GetDateAndSize(char *fName, unsigned long *mod_time);
int SetTypeByNumber(int i);
#ifdef PASSIVEMODE
int setpassive(int argc, char **argv);
#endif
/* In util.c: */
void cmd_help(struct cmd *c);

View File

@ -90,7 +90,10 @@ Examples:\n\
#define PAGEHELP "view a file on the remote host with your $PAGER"
#define PAGEUSAGE REMOTEFILE
#ifdef PASSIVEMODE
#define PASSIVEHELP "enter passive transfer mode"
#endif
#define PDIRUSAGE " [flags] [remote-files]"
@ -188,7 +191,9 @@ struct cmd cmdtab[] = {
{ "ntrans", 0, 1, unimpl, UNIMPLHELP, UNIMPLUSAGE },
{ "open", 0, 0, cmdOpen, OPENHELP, OPENUSAGE },
{ "p", 1, 1, get, PAGEHELP, PAGEUSAGE },
#ifdef PASSIVEMODE
{ "passive", 0, 0, setpassive, PASSIVEHELP, EMPTYSTR },
#endif
{ "page", 1, 0, get, PAGEHELP, PAGEUSAGE },
{ "pdir", 1, 0, ls,
"view a remote directory listing (long mode) with your $PAGER",

View File

@ -99,7 +99,9 @@ extern struct userinfo uinfo;
extern struct macel macros[];
extern struct lslist *lshead, *lstail;
extern int is_ls;
#ifdef PASSIVEMODE
extern int passivemode;
#endif
#ifdef GATEWAY
extern string gateway;
@ -1691,11 +1693,14 @@ int initconn(void)
int on = 1, rval;
string str;
Sig_t oldintr;
#ifdef PASSIVEMODE
int a1, a2, a3, a4, p1, p2;
unsigned char n[6];
#endif
oldintr = Signal(SIGINT, SIG_IGN);
#ifdef PASSIVEMODE
if (passivemode) {
data = socket(AF_INET, SOCK_STREAM, 0);
if (data < 0) {
@ -1745,6 +1750,7 @@ int initconn(void)
rval = 0;
goto Return;
}
#endif
noport:
data_addr = myctladdr;
@ -1853,8 +1859,10 @@ dataconn(char *mode)
#ifdef SOCKS
s = Raccept(data, (struct sockaddr *) &from, &fromlen);
#else
#ifdef PASSIVEMODE
if (passivemode)
return( fdopen( data, mode ));
#endif
s = Accept(data, &from, &fromlen);
#endif
if (s < 0) {

View File

@ -1257,6 +1257,9 @@ disables reading of the RC file;
this is provided for compatibility with
.RB `` "ftp \-n" ''.
.TP
.B \-P
toggle passive mode (defaults to on). Useful for work behind firewalls.
.TP
.BI \-V " x"
sets verbosity to level
.I x