add passive mode option

This commit is contained in:
Kelvin Sherlock 2012-09-08 17:13:31 -04:00
parent faef86c362
commit 7666e5ed8b
5 changed files with 11 additions and 0 deletions

View File

@ -1864,6 +1864,12 @@ LOOP:
return(new);
}
void setpassive(int argc, char **argv)
{
code = togglevar(argc, argv, &passivemode,
verbose ? "Passive mode" : (char *)NULL);
}
void setsunique (int argc, char **argv)
{
code = togglevar(argc, argv, &sunique, "Store unique");

View File

@ -10,6 +10,7 @@ void setbell (int argc, char **argv);
void settrace (int argc, char **argv);
void sethash (int argc, char **argv);
void setverbose (int argc, char **argv);
void setpassive (int argc, char **argv);
void setport (int argc, char **argv);
void setprompt (int argc, char **argv);
void setglob (int argc, char **argv);

View File

@ -49,6 +49,7 @@ char newerhelp[] = "get file if remote file is newer than local file ";
char nlisthelp[] = "nlist contents of remote directory";
char nmaphelp[] = "set templates for default file name mapping";
char ntranshelp[] = "set translation table for default file name mapping";
char passivehelp[] = "enter passive transfer mode";
char porthelp[] = "toggle use of PORT cmd for each data connection";
char prompthelp[] = "force interactive prompting on multiple commands";
char proxyhelp[] = "issue command on alternate connection";
@ -122,6 +123,7 @@ struct cmd cmdtab[] = {
{ "nlist", nlisthelp, 1, 1, 1, ls },
{ "ntrans", ntranshelp, 0, 0, 1, setntrans },
{ "open", connecthelp, 0, 0, 1, setpeer },
{ "passive", passivehelp, 0, 0, 0, setpassive },
{ "prompt", prompthelp, 0, 0, 0, setprompt },
{ "proxy", proxyhelp, 0, 0, 1, doproxy },
{ "sendport", porthelp, 0, 0, 0, setport },

View File

@ -61,6 +61,7 @@ extern int mapflag; /* use mapin mapout templates on file names */
extern int code; /* return/reply code for ftp command */
extern int crflag; /* if 1, strip car. rets. on ascii gets */
extern char pasv[64]; /* passive port for proxy data connection */
extern int passivemode; /* passive mode enabled */
extern char *altarg; /* argv[1] with no shell-like preprocessing */
extern char ntin[17]; /* input translation table */
extern char ntout[17]; /* output translation table */

View File

@ -53,6 +53,7 @@ static char homedir[MAXPATHLEN];
doglob = 1;
interactive = 1;
autologin = 1;
passivemode = 1;
argc--, argv++;
while (argc > 0 && **argv == '-') {
for (cp = *argv + 1; *cp; cp++)