Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/libexec/ftpd in closedataconn(), only close the passive data...



details:   https://anonhg.NetBSD.org/src/rev/7eca55733cf3
branches:  trunk
changeset: 520946:7eca55733cf3
user:      lukem <lukem%NetBSD.org@localhost>
date:      Mon Jan 21 11:25:20 2002 +0000

description:
in closedataconn(), only close the passive data fd if the main data
descriptor was set by dataconn().  this fixes a problem for clients (such
as lynx and netscape) that only sent PASV/EPSV after a transfer (RETR, LIST,
STOR) started and returned 150.  certain command sequences could return 550
(etc) before setting up the dataconn(), and would run into this bug. netbsd's
ftp didn't hit this bug because it always sends PASV/EPSV before a new
transfer command.

diffstat:

 libexec/ftpd/ftpd.c    |  9 +++++----
 libexec/ftpd/version.h |  4 ++--
 2 files changed, 7 insertions(+), 6 deletions(-)

diffs (46 lines):

diff -r dec362744979 -r 7eca55733cf3 libexec/ftpd/ftpd.c
--- a/libexec/ftpd/ftpd.c       Mon Jan 21 11:20:42 2002 +0000
+++ b/libexec/ftpd/ftpd.c       Mon Jan 21 11:25:20 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ftpd.c,v 1.135 2001/12/12 08:13:33 lukem Exp $ */
+/*     $NetBSD: ftpd.c,v 1.136 2002/01/21 11:25:20 lukem Exp $ */
 
 /*
  * Copyright (c) 1997-2001 The NetBSD Foundation, Inc.
@@ -109,7 +109,7 @@
 #if 0
 static char sccsid[] = "@(#)ftpd.c     8.5 (Berkeley) 4/28/95";
 #else
-__RCSID("$NetBSD: ftpd.c,v 1.135 2001/12/12 08:13:33 lukem Exp $");
+__RCSID("$NetBSD: ftpd.c,v 1.136 2002/01/21 11:25:20 lukem Exp $");
 #endif
 #endif /* not lint */
 
@@ -1570,8 +1570,9 @@
 closedataconn(FILE *fd)
 {
 
-       if (fd != NULL)
-               (void)fclose(fd);
+       if (fd == NULL)
+               return;
+       (void)fclose(fd);
        data = -1;
        if (pdata >= 0)
                (void)close(pdata);
diff -r dec362744979 -r 7eca55733cf3 libexec/ftpd/version.h
--- a/libexec/ftpd/version.h    Mon Jan 21 11:20:42 2002 +0000
+++ b/libexec/ftpd/version.h    Mon Jan 21 11:25:20 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: version.h,v 1.38 2001/12/06 02:00:07 lukem Exp $       */
+/*     $NetBSD: version.h,v 1.39 2002/01/21 11:25:21 lukem Exp $       */
 /*-
  * Copyright (c) 1999-2001 The NetBSD Foundation, Inc.
  * All rights reserved.
@@ -36,5 +36,5 @@
  */
 
 #ifndef FTPD_VERSION
-#define        FTPD_VERSION    "NetBSD-ftpd 20011206"
+#define        FTPD_VERSION    "NetBSD-ftpd 20020121"
 #endif



Home | Main Index | Thread Index | Old Index