summaryrefslogtreecommitdiff
path: root/libexec
diff options
context:
space:
mode:
authorlukem <lukem@NetBSD.org>2002-01-21 11:25:20 +0000
committerlukem <lukem@NetBSD.org>2002-01-21 11:25:20 +0000
commit0d1261454ee9fa87f9514a3656e9dbeacefd5d38 (patch)
tree4ef42c72323f396fa937db47384f47f61f99a3a0 /libexec
parent12f71ce4b8c9c7f80462519d0709b9f259f257d7 (diff)
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 (limited to 'libexec')
-rw-r--r--libexec/ftpd/ftpd.c9
-rw-r--r--libexec/ftpd/version.h4
2 files changed, 7 insertions, 6 deletions
diff --git a/libexec/ftpd/ftpd.c b/libexec/ftpd/ftpd.c
index 0a2983e3040..9ef91d16a03 100644
--- a/libexec/ftpd/ftpd.c
+++ b/libexec/ftpd/ftpd.c
@@ -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 @@ __COPYRIGHT(
#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 @@ void
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 --git a/libexec/ftpd/version.h b/libexec/ftpd/version.h
index d37ad846b62..0cbe7b415a0 100644
--- a/libexec/ftpd/version.h
+++ b/libexec/ftpd/version.h
@@ -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