mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2025-01-11 17:04:19 +01:00
1. If checking for directory-ness, check "dir" and "dir/" to catch
the case where we have a symlink pointing at a dir. 2. Restore stomped character before returning in make_hierarchy()
This commit is contained in:
parent
3b006d8ebd
commit
95452c412e
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=57330
@ -45,12 +45,18 @@ make_hierarchy(char *dir)
|
|||||||
if ((cp2 = index(cp1, '/')) !=NULL )
|
if ((cp2 = index(cp1, '/')) !=NULL )
|
||||||
*cp2 = '\0';
|
*cp2 = '\0';
|
||||||
if (fexists(dir)) {
|
if (fexists(dir)) {
|
||||||
if (!isdir(dir))
|
if (!isdir(dir)) {
|
||||||
|
if (cp2)
|
||||||
|
*cp2 = '/';
|
||||||
return FAIL;
|
return FAIL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (vsystem("mkdir %s", dir))
|
if (vsystem("mkdir %s", dir)) {
|
||||||
|
if (cp2)
|
||||||
|
*cp2 = '/';
|
||||||
return FAIL;
|
return FAIL;
|
||||||
|
}
|
||||||
apply_perms(NULL, dir);
|
apply_perms(NULL, dir);
|
||||||
}
|
}
|
||||||
/* Put it back */
|
/* Put it back */
|
||||||
|
Loading…
Reference in New Issue
Block a user