summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsobomax <sobomax@FreeBSD.org>2004-07-04 17:24:12 +0000
committersobomax <sobomax@FreeBSD.org>2004-07-04 17:24:12 +0000
commitbee9cba70cb678cdd927bc761766011085e3d20c (patch)
tree21eeb0f379e3675e0f981c044c5143ade90bc99e
parent6190bf9bc443171837211153171aa7106a2f1462 (diff)
downloadFreeBSD-src-bee9cba70cb678cdd927bc761766011085e3d20c.zip
FreeBSD-src-bee9cba70cb678cdd927bc761766011085e3d20c.tar.gz
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
-rw-r--r--usr.sbin/newsyslog/newsyslog.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/newsyslog/newsyslog.c b/usr.sbin/newsyslog/newsyslog.c
index df944e3..0a28c3f 100644
--- a/usr.sbin/newsyslog/newsyslog.c
+++ b/usr.sbin/newsyslog/newsyslog.c
@@ -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))
OpenPOWER on IntegriCloud