From 98273e3adeac9aba6851bd74a662a3735fc2448b Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Sat, 14 Jul 2001 11:55:15 +1000 Subject: - (djm) Revert dirname fix, a better one is on its way. --- ChangeLog | 3 ++- auth.c | 6 +----- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index ce9cf665b..965af4249 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,7 @@ - (djm) Enable /etc/nologin check on PAM systems, as some lack the pam_nologin module. Report from William Yodlowsky + - (djm) Revert dirname fix, a better one is on its way. 20010711 - (djm) dirname(3) may modify its argument on glibc and other systems. @@ -5977,4 +5978,4 @@ - Wrote replacements for strlcpy and mkdtemp - Released 1.0pre1 -$Id: ChangeLog,v 1.1385 2001/07/14 01:54:05 djm Exp $ +$Id: ChangeLog,v 1.1386 2001/07/14 01:55:15 djm Exp $ diff --git a/auth.c b/auth.c index 436802342..84e0be761 100644 --- a/auth.c +++ b/auth.c @@ -368,11 +368,7 @@ secure_filename(FILE *f, const char *file, struct passwd *pw, char *cp; struct stat st; - strlcpy(homedir, pw->pw_dir, sizeof(homedir)); - if ((cp = dirname(homedir)) == NULL) - strlcpy(homedir, "/", sizeof(homedir)); - else - memmove(homedir, cp, strlen(cp)); + strlcpy(homedir, dirname(pw->pw_dir), sizeof(homedir)); if (realpath(file, buf) == NULL) { snprintf(err, errlen, "realpath %s failed: %s", file, -- cgit v1.2.3