- (djm) Revert dirname fix, a better one is on its way.

This commit is contained in:
Damien Miller 2001-07-14 11:55:15 +10:00
parent c62f1fc3ff
commit 98273e3ade
2 changed files with 3 additions and 6 deletions

View File

@ -2,6 +2,7 @@
- (djm) Enable /etc/nologin check on PAM systems, as some lack the
pam_nologin module. Report from William Yodlowsky
<bsd@openbsd.rutgers.edu>
- (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 $

6
auth.c
View File

@ -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,