- (djm) Sync openbsd-compat with -current libc
This commit is contained in:
Damien Miller 2001-06-28 14:48:28 +10:00
parent 315f8b70b0
commit 180207ffe1
5 changed files with 19 additions and 16 deletions

View File

@ -1,3 +1,6 @@
20010628
- (djm) Sync openbsd-compat with -current libc
20010627 20010627
- (djm) Reintroduce pam_session call for non-pty sessions. - (djm) Reintroduce pam_session call for non-pty sessions.
- (djm) Remove redundant and incorrect test for max auth attempts in - (djm) Remove redundant and incorrect test for max auth attempts in
@ -5809,4 +5812,4 @@
- Wrote replacements for strlcpy and mkdtemp - Wrote replacements for strlcpy and mkdtemp
- Released 1.0pre1 - Released 1.0pre1
$Id: ChangeLog,v 1.1334 2001/06/28 00:24:41 stevesk Exp $ $Id: ChangeLog,v 1.1335 2001/06/28 04:48:28 djm Exp $

View File

@ -1,4 +1,4 @@
/* $OpenBSD: dirname.c,v 1.4 1999/05/30 17:10:30 espie Exp $ */ /* $OpenBSD: dirname.c,v 1.5 2001/06/27 00:58:54 lebel Exp $ */
/* /*
* Copyright (c) 1997 Todd C. Miller <Todd.Miller@courtesan.com> * Copyright (c) 1997 Todd C. Miller <Todd.Miller@courtesan.com>
@ -31,7 +31,7 @@
#ifndef HAVE_DIRNAME #ifndef HAVE_DIRNAME
#if defined(LIBC_SCCS) && !defined(lint) #if defined(LIBC_SCCS) && !defined(lint)
static char rcsid[] = "$OpenBSD: dirname.c,v 1.4 1999/05/30 17:10:30 espie Exp $"; static char rcsid[] = "$OpenBSD: dirname.c,v 1.5 2001/06/27 00:58:54 lebel Exp $";
#endif /* LIBC_SCCS and not lint */ #endif /* LIBC_SCCS and not lint */
#include <errno.h> #include <errno.h>
@ -74,8 +74,7 @@ dirname(path)
errno = ENAMETOOLONG; errno = ENAMETOOLONG;
return(NULL); return(NULL);
} }
(void)strncpy(bname, path, endp - path + 1); strlcpy(bname, path, endp - path + 2);
bname[endp - path + 1] = '\0';
return(bname); return(bname);
} }
#endif #endif

View File

@ -32,7 +32,7 @@
#if !defined(HAVE_REALPATH) || defined(BROKEN_REALPATH) #if !defined(HAVE_REALPATH) || defined(BROKEN_REALPATH)
#if defined(LIBC_SCCS) && !defined(lint) #if defined(LIBC_SCCS) && !defined(lint)
static char *rcsid = "$OpenBSD: realpath..c,v 1.4 1998/05/18 09:55:19 deraadt Exp $"; static char *rcsid = "$OpenBSD: realpath.c,v 1.5 2001/06/27 00:58:56 lebel Exp $";
#endif /* LIBC_SCCS and not lint */ #endif /* LIBC_SCCS and not lint */
#include <sys/param.h> #include <sys/param.h>
@ -82,8 +82,7 @@ realpath(const char *path, char *resolved)
* if it is a directory, then change to that directory. * if it is a directory, then change to that directory.
* get the current directory name and append the basename. * get the current directory name and append the basename.
*/ */
(void)strncpy(resolved, path, MAXPATHLEN - 1); strlcpy(resolved, path, MAXPATHLEN);
resolved[MAXPATHLEN - 1] = '\0';
loop: loop:
q = strrchr(resolved, '/'); q = strrchr(resolved, '/');
if (q != NULL) { if (q != NULL) {

View File

@ -1,4 +1,4 @@
/* $OpenBSD: strlcat.c,v 1.5 2001/01/13 16:17:24 millert Exp $ */ /* $OpenBSD: strlcat.c,v 1.8 2001/05/13 15:40:15 deraadt Exp $ */
/* /*
* Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com> * Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
@ -31,7 +31,7 @@
#ifndef HAVE_STRLCAT #ifndef HAVE_STRLCAT
#if defined(LIBC_SCCS) && !defined(lint) #if defined(LIBC_SCCS) && !defined(lint)
static char *rcsid = "$OpenBSD: strlcat.c,v 1.5 2001/01/13 16:17:24 millert Exp $"; static char *rcsid = "$OpenBSD: strlcat.c,v 1.8 2001/05/13 15:40:15 deraadt Exp $";
#endif /* LIBC_SCCS and not lint */ #endif /* LIBC_SCCS and not lint */
#include <sys/types.h> #include <sys/types.h>
@ -42,10 +42,11 @@ static char *rcsid = "$OpenBSD: strlcat.c,v 1.5 2001/01/13 16:17:24 millert Exp
* Appends src to string dst of size siz (unlike strncat, siz is the * Appends src to string dst of size siz (unlike strncat, siz is the
* full size of dst, not space left). At most siz-1 characters * full size of dst, not space left). At most siz-1 characters
* will be copied. Always NUL terminates (unless siz <= strlen(dst)). * will be copied. Always NUL terminates (unless siz <= strlen(dst)).
* Returns strlen(initial dst) + strlen(src); if retval >= siz, * Returns strlen(src) + MIN(siz, strlen(initial dst)).
* truncation occurred. * If retval >= siz, truncation occurred.
*/ */
size_t strlcat(dst, src, siz) size_t
strlcat(dst, src, siz)
char *dst; char *dst;
const char *src; const char *src;
size_t siz; size_t siz;

View File

@ -1,4 +1,4 @@
/* $OpenBSD: strlcpy.c,v 1.4 1999/05/01 18:56:41 millert Exp $ */ /* $OpenBSD: strlcpy.c,v 1.5 2001/05/13 15:40:16 deraadt Exp $ */
/* /*
* Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com> * Copyright (c) 1998 Todd C. Miller <Todd.Miller@courtesan.com>
@ -31,7 +31,7 @@
#ifndef HAVE_STRLCPY #ifndef HAVE_STRLCPY
#if defined(LIBC_SCCS) && !defined(lint) #if defined(LIBC_SCCS) && !defined(lint)
static char *rcsid = "$OpenBSD: strlcpy.c,v 1.4 1999/05/01 18:56:41 millert Exp $"; static char *rcsid = "$OpenBSD: strlcpy.c,v 1.5 2001/05/13 15:40:16 deraadt Exp $";
#endif /* LIBC_SCCS and not lint */ #endif /* LIBC_SCCS and not lint */
#include <sys/types.h> #include <sys/types.h>
@ -43,7 +43,8 @@ static char *rcsid = "$OpenBSD: strlcpy.c,v 1.4 1999/05/01 18:56:41 millert Exp
* will be copied. Always NUL terminates (unless siz == 0). * will be copied. Always NUL terminates (unless siz == 0).
* Returns strlen(src); if retval >= siz, truncation occurred. * Returns strlen(src); if retval >= siz, truncation occurred.
*/ */
size_t strlcpy(dst, src, siz) size_t
strlcpy(dst, src, siz)
char *dst; char *dst;
const char *src; const char *src;
size_t siz; size_t siz;