a few changes from Mike Heffner <mheffner@vt.edu> in private email:

- totally clear a glob buffer before use, because FreeBSD depends on
  some of the other fields being cleared (other than just gl_offs)
- in strend(), ensure that the source string isn't too large
- remove unnecessarily complicated sizing of proctitle, since snprintf()
  will truncate it anyway
This commit is contained in:
lukem 2001-09-19 00:50:52 +00:00
parent f228785e54
commit 53c91d8f76
3 changed files with 9 additions and 11 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: conf.c,v 1.43 2001/06/26 19:30:44 lukem Exp $ */
/* $NetBSD: conf.c,v 1.44 2001/09/19 00:50:52 lukem Exp $ */
/*-
* Copyright (c) 1997-2001 The NetBSD Foundation, Inc.
@ -38,7 +38,7 @@
#include <sys/cdefs.h>
#ifndef lint
__RCSID("$NetBSD: conf.c,v 1.43 2001/06/26 19:30:44 lukem Exp $");
__RCSID("$NetBSD: conf.c,v 1.44 2001/09/19 00:50:52 lukem Exp $");
#endif /* not lint */
#include <sys/types.h>
@ -597,7 +597,7 @@ show_chdir_messages(int code)
if (EMPTYSTR(curclass.notify))
return;
gl.gl_offs = 0;
memset(&gl, 0, sizeof(gl));
if (glob(curclass.notify, GLOB_LIMIT, NULL, &gl) != 0
|| gl.gl_matchc == 0) {
globfree(&gl);
@ -801,7 +801,7 @@ strend(const char *s1, char *s2)
l1 = strlen(s1);
l2 = strlen(s2);
if (l2 >= l1)
if (l2 >= l1 || l1 >= sizeof(buf))
return(NULL);
strlcpy(buf, s1, sizeof(buf));

View File

@ -1,4 +1,4 @@
/* $NetBSD: ftpd.c,v 1.128 2001/07/08 07:27:14 lukem Exp $ */
/* $NetBSD: ftpd.c,v 1.129 2001/09/19 00:50:52 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.128 2001/07/08 07:27:14 lukem Exp $");
__RCSID("$NetBSD: ftpd.c,v 1.129 2001/09/19 00:50:52 lukem Exp $");
#endif
#endif /* not lint */
@ -1126,9 +1126,7 @@ pass(const char *passwd)
reply(230, "Guest login ok, access restrictions apply.");
#if HAVE_SETPROCTITLE
snprintf(proctitle, sizeof(proctitle),
"%s: anonymous/%.*s", remotehost,
(int) (sizeof(proctitle) - sizeof(remotehost) -
sizeof(": anonymous/")), passwd);
"%s: anonymous/%s", remotehost, passwd);
setproctitle("%s", proctitle);
#endif /* HAVE_SETPROCTITLE */
if (logging)

View File

@ -1,4 +1,4 @@
/* $NetBSD: version.h,v 1.33 2001/06/26 19:30:45 lukem Exp $ */
/* $NetBSD: version.h,v 1.34 2001/09/19 00:50:53 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 20010627"
#define FTPD_VERSION "NetBSD-ftpd 20010919"
#endif