summaryrefslogtreecommitdiffstats
path: root/usr.sbin/newsyslog
diff options
context:
space:
mode:
authorbrooks <brooks@FreeBSD.org>2004-10-05 22:16:31 +0000
committerbrooks <brooks@FreeBSD.org>2004-10-05 22:16:31 +0000
commit626003d7272828ee3551b129c2815f2acff54be3 (patch)
tree5f903abb72d10da71af8559a6c08eed398da43d3 /usr.sbin/newsyslog
parentd5dfe59f9e8beaaf3a967d05adf9c1ce3cf75679 (diff)
downloadFreeBSD-src-626003d7272828ee3551b129c2815f2acff54be3.zip
FreeBSD-src-626003d7272828ee3551b129c2815f2acff54be3.tar.gz
Don't prepend the directory specified by -d when the file is a relative
path. Doing so makes no sense. I'm not sure allowing relative paths makes sense either, but I'm not going to break that now.
Diffstat (limited to 'usr.sbin/newsyslog')
-rw-r--r--usr.sbin/newsyslog/newsyslog.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/usr.sbin/newsyslog/newsyslog.c b/usr.sbin/newsyslog/newsyslog.c
index 590dbf6..632cc6a 100644
--- a/usr.sbin/newsyslog/newsyslog.c
+++ b/usr.sbin/newsyslog/newsyslog.c
@@ -340,7 +340,7 @@ init_entry(const char *fname, struct conf_entry *src_entry)
if (tempwork == NULL)
err(1, "malloc of conf_entry for %s", fname);
- if (destdir == NULL)
+ if (destdir == NULL || fname[0] != '/')
tempwork->log = strdup(fname);
else
asprintf(&tempwork->log, "%s%s", destdir, fname);
OpenPOWER on IntegriCloud