summaryrefslogtreecommitdiffstats
path: root/usr.bin/ncftp
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>1995-01-24 00:37:11 +0000
committerache <ache@FreeBSD.org>1995-01-24 00:37:11 +0000
commit91f1983c7d5a5dd7d391cc2767f5836742fb45f7 (patch)
treef52cc8ccf2962654d95874fc1855c28f2061d4d2 /usr.bin/ncftp
parent73e7d767e2332b4ad930e19a23e366a146c41c06 (diff)
downloadFreeBSD-src-91f1983c7d5a5dd7d391cc2767f5836742fb45f7.zip
FreeBSD-src-91f1983c7d5a5dd7d391cc2767f5836742fb45f7.tar.gz
Upgrade. My recent fix applied by author.
Diffstat (limited to 'usr.bin/ncftp')
-rw-r--r--usr.bin/ncftp/ftp.c4
-rw-r--r--usr.bin/ncftp/main.c6
-rw-r--r--usr.bin/ncftp/open.c13
-rw-r--r--usr.bin/ncftp/patchlevel.h3
4 files changed, 18 insertions, 8 deletions
diff --git a/usr.bin/ncftp/ftp.c b/usr.bin/ncftp/ftp.c
index 5152b55..4cb8d8d 100644
--- a/usr.bin/ncftp/ftp.c
+++ b/usr.bin/ncftp/ftp.c
@@ -1883,11 +1883,11 @@ dataconn(char *mode)
FILE *fp;
int s, fromlen = sizeof (from);
+ if (using_pasv)
+ return( fdopen( data, mode ));
#ifdef SOCKS
s = Raccept(data, (struct sockaddr *) &from, &fromlen);
#else
- if (using_pasv)
- return( fdopen( data, mode ));
s = Accept(data, &from, &fromlen);
#endif
if (s < 0) {
diff --git a/usr.bin/ncftp/main.c b/usr.bin/ncftp/main.c
index f7c1d75..d7aa1b8 100644
--- a/usr.bin/ncftp/main.c
+++ b/usr.bin/ncftp/main.c
@@ -2,7 +2,7 @@
#define _main_c_
-#define FTP_VERSION "1.9.1 (January 1, 1995)"
+#define FTP_VERSION "1.9.2 (January 20, 1995)"
/* #define BETA 1 */ /* If defined, it prints a little warning message. */
@@ -345,7 +345,9 @@ Examples:\n\
makeargv();
/* setpeer uses this to tell if it was called from the cmd-line. */
eventnumber = 0L;
- (void) cmdOpen(margc, margv);
+ if (cmdOpen(margc, margv) != NOERR) {
+ exit(1);
+ }
}
eventnumber = 1L;
diff --git a/usr.bin/ncftp/open.c b/usr.bin/ncftp/open.c
index fbbe794..23b017a 100644
--- a/usr.bin/ncftp/open.c
+++ b/usr.bin/ncftp/open.c
@@ -29,6 +29,7 @@ int anon_open = dANONOPEN;
/* Anonymous logins by default? */
int connected = 0; /* TRUE if connected to server */
/* If TRUE, set binary each connection. */
+int www = 0; /* TRUE if use URL */
Hostname hostname; /* Name of current host */
RemoteSiteInfo gRmtInfo;
#ifdef GATEWAY
@@ -107,7 +108,7 @@ void InitOpenOptions(OpenOptions *openopt)
int GetOpenOptions(int argc, char **argv, OpenOptions *openopt)
{
- int opt, www;
+ int opt;
char *cp, *hostp, *cpath;
/* First setup the openopt variables. */
@@ -467,6 +468,7 @@ int Open(OpenOptions *openopt)
int siteInRC;
char *user, *pass, *acct;
int login_verbosity, oldv;
+ int result = CMDERR;
macnum = 0; /* Reset macros. */
@@ -593,6 +595,7 @@ int Open(OpenOptions *openopt)
*/
(void) _cd(NULL);
}
+ result = NOERR;
break; /* we are connected, so break the redial loop. */
/* end if we are connected */
} else {
@@ -606,7 +609,7 @@ nextdial:
disconnect(0, NULL);
continue; /* Try re-dialing. */
}
- return (NOERR);
+ return (result);
} /* Open */
@@ -615,6 +618,7 @@ nextdial:
int cmdOpen(int argc, char **argv)
{
OpenOptions openopt;
+ int result = NOERR;
/* If there is already a site open, close that one so we can
* open a new one.
@@ -631,9 +635,10 @@ int cmdOpen(int argc, char **argv)
gRmtInfo.hasMDTM = 1;
if ((GetOpenOptions(argc, argv, &openopt) == USAGE) ||
- (Open(&openopt) == USAGE))
+ ((result = Open(&openopt)) == USAGE))
return USAGE;
- return NOERR;
+ /* Return an error if colon-mode/URL didn't work. */
+ return (openopt.colonmodepath[0] != '\0' ? result : NOERR);
} /* cmdOpen */
/* eof open.c */
diff --git a/usr.bin/ncftp/patchlevel.h b/usr.bin/ncftp/patchlevel.h
index db9f5f5..ff9c90d 100644
--- a/usr.bin/ncftp/patchlevel.h
+++ b/usr.bin/ncftp/patchlevel.h
@@ -1,3 +1,6 @@
+v1.9.2 - January 20, 1995. Another passive mode fix with the SOCKS library.
+ Trying to avoid going into the interactive shell if colon-mode fails.
+
v1.9.1 - January 1, 1995. Passive mode fix with the SOCKS library.
v1.9.0 - December 22, 1994. The program won't exit from the interactive shell
OpenPOWER on IntegriCloud