mirror of
https://github.com/freebsd/freebsd-src
synced 2024-09-16 06:52:27 +00:00
Nothing says that /var/log can't be not a directory but a symbolic link
to a directory. Therefore, use stat(2) instead of lstat(2) to check if /var/log exists. MFC after: 7 days
This commit is contained in:
parent
15a66c21c0
commit
ea6902220d
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=131581
|
@ -2247,9 +2247,9 @@ createlog(const struct conf_entry *ent)
|
|||
slash = strrchr(tempfile, '/');
|
||||
if (slash != NULL) {
|
||||
*slash = '\0';
|
||||
failed = lstat(tempfile, &st);
|
||||
failed = stat(tempfile, &st);
|
||||
if (failed && errno != ENOENT)
|
||||
err(1, "Error on lstat(%s)", tempfile);
|
||||
err(1, "Error on stat(%s)", tempfile);
|
||||
if (failed)
|
||||
createdir(ent, tempfile);
|
||||
else if (!S_ISDIR(st.st_mode))
|
||||
|
|
Loading…
Reference in a new issue