summaryrefslogtreecommitdiff
path: root/libexec
diff options
context:
space:
mode:
authorlukem <lukem@NetBSD.org>2005-10-03 00:02:25 +0000
committerlukem <lukem@NetBSD.org>2005-10-03 00:02:25 +0000
commitd7a2bc3a396a87567d9c44702ebfaa0c41bc989f (patch)
treeee18f86973affb105eae05aeeaddd0daa5951b9a /libexec
parent2484bb297269e7d37afad4167bec9d582e761523 (diff)
logxfer(): don't use the same buffer to store the results of two separate
concurrent realpath(3)s, otherwise we'll log the wrong information for a rename. Noted by Dmitry Sivachenko in private mail.
Diffstat (limited to 'libexec')
-rw-r--r--libexec/ftpd/ftpd.c11
-rw-r--r--libexec/ftpd/version.h4
2 files changed, 8 insertions, 7 deletions
diff --git a/libexec/ftpd/ftpd.c b/libexec/ftpd/ftpd.c
index 6132faa0bde..c410ffa3aba 100644
--- a/libexec/ftpd/ftpd.c
+++ b/libexec/ftpd/ftpd.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ftpd.c,v 1.168 2005/08/24 15:51:41 ginsbach Exp $ */
+/* $NetBSD: ftpd.c,v 1.169 2005/10/03 00:02:25 lukem Exp $ */
/*
* Copyright (c) 1997-2004 The NetBSD Foundation, Inc.
@@ -105,7 +105,7 @@ __COPYRIGHT(
#if 0
static char sccsid[] = "@(#)ftpd.c 8.5 (Berkeley) 4/28/95";
#else
-__RCSID("$NetBSD: ftpd.c,v 1.168 2005/08/24 15:51:41 ginsbach Exp $");
+__RCSID("$NetBSD: ftpd.c,v 1.169 2005/10/03 00:02:25 lukem Exp $");
#endif
#endif /* not lint */
@@ -3474,7 +3474,8 @@ void
logxfer(const char *command, off_t bytes, const char *file1, const char *file2,
const struct timeval *elapsed, const char *error)
{
- char buf[MAXPATHLEN * 2 + 100], realfile[MAXPATHLEN];
+ char buf[MAXPATHLEN * 2 + 100];
+ char realfile1[MAXPATHLEN], realfile2[MAXPATHLEN];
const char *r1, *r2;
char direction;
size_t len;
@@ -3484,10 +3485,10 @@ logxfer(const char *command, off_t bytes, const char *file1, const char *file2,
return;
r1 = r2 = NULL;
- if ((r1 = realpath(file1, realfile)) == NULL)
+ if ((r1 = realpath(file1, realfile1)) == NULL)
r1 = file1;
if (file2 != NULL)
- if ((r2 = realpath(file2, realfile)) == NULL)
+ if ((r2 = realpath(file2, realfile2)) == NULL)
r2 = file2;
/*
diff --git a/libexec/ftpd/version.h b/libexec/ftpd/version.h
index a4ab8190af2..1d4f7bdc127 100644
--- a/libexec/ftpd/version.h
+++ b/libexec/ftpd/version.h
@@ -1,4 +1,4 @@
-/* $NetBSD: version.h,v 1.62 2005/08/24 15:51:41 ginsbach Exp $ */
+/* $NetBSD: version.h,v 1.63 2005/10/03 00:02:25 lukem Exp $ */
/*-
* Copyright (c) 1999-2004 The NetBSD Foundation, Inc.
* All rights reserved.
@@ -36,5 +36,5 @@
*/
#ifndef FTPD_VERSION
-#define FTPD_VERSION "NetBSD-ftpd 20050824"
+#define FTPD_VERSION "NetBSD-ftpd 20051003"
#endif