- (djm) dirname(3) may modify its argument on glibc and other systems.
Patch from markus@, spotted by Tom Holroyd <tomh@po.crl.go.jp>
This commit is contained in:
parent
024acc46e6
commit
eec0c25f2a
|
@ -1,3 +1,7 @@
|
|||
20010711
|
||||
- (djm) dirname(3) may modify its argument on glibc and other systems.
|
||||
Patch from markus@, spotted by Tom Holroyd <tomh@po.crl.go.jp>
|
||||
|
||||
20010704
|
||||
- OpenBSD CVS Sync
|
||||
- markus@cvs.openbsd.org 2001/06/25 08:25:41
|
||||
|
@ -5968,4 +5972,4 @@
|
|||
- Wrote replacements for strlcpy and mkdtemp
|
||||
- Released 1.0pre1
|
||||
|
||||
$Id: ChangeLog,v 1.1383 2001/07/05 04:27:20 tim Exp $
|
||||
$Id: ChangeLog,v 1.1384 2001/07/11 11:32:20 djm Exp $
|
||||
|
|
6
auth.c
6
auth.c
|
@ -368,7 +368,11 @@ secure_filename(FILE *f, const char *file, struct passwd *pw,
|
|||
char *cp;
|
||||
struct stat st;
|
||||
|
||||
strlcpy(homedir, dirname(pw->pw_dir), sizeof(homedir));
|
||||
strlcpy(homedir, pw->pw_dir, sizeof(homedir));
|
||||
if ((cp = dirname(homedir)) == NULL)
|
||||
strlcpy(homedir, "/", sizeof(homedir));
|
||||
else
|
||||
memmove(homedir, cp, strlen(cp));
|
||||
|
||||
if (realpath(file, buf) == NULL) {
|
||||
snprintf(err, errlen, "realpath %s failed: %s", file,
|
||||
|
|
Loading…
Reference in New Issue