summaryrefslogtreecommitdiff
path: root/usr.bin/newsyslog
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2000-06-30 16:00:30 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2000-06-30 16:00:30 +0000
commitb643bb9badf4a995d989b8daf3e33ba8ee6ffda2 (patch)
tree87720e8aa60a5b4230d0072dfd2b3d422d7dd1cd /usr.bin/newsyslog
parent46239127052c30fac93140fbe021cdd151fdac8a (diff)
warnx?/errx? paranoia (use "%s" not a bare string unless it is a
constant). These are not security holes but it is worth fixing them anyway both for robustness and so folks looking for examples in the tree are not misled into doing something potentially dangerous. Furthermore, it is a bad idea to assume that pathnames will not include '%' in them and that error routines don't return strings with '%' in them (especially in light of the possibility of locales).
Diffstat (limited to 'usr.bin/newsyslog')
-rw-r--r--usr.bin/newsyslog/newsyslog.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/usr.bin/newsyslog/newsyslog.c b/usr.bin/newsyslog/newsyslog.c
index c9e13f4322b..d8ff177bf7b 100644
--- a/usr.bin/newsyslog/newsyslog.c
+++ b/usr.bin/newsyslog/newsyslog.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: newsyslog.c,v 1.33 2000/06/14 22:55:19 millert Exp $ */
+/* $OpenBSD: newsyslog.c,v 1.34 2000/06/30 16:00:19 millert Exp $ */
/*
* Copyright (c) 1999 Todd C. Miller <Todd.Miller@courtesan.com>
@@ -88,7 +88,7 @@ provided "as is" without express or implied warranty.
*/
#ifndef lint
-static char rcsid[] = "$OpenBSD: newsyslog.c,v 1.33 2000/06/14 22:55:19 millert Exp $";
+static char rcsid[] = "$OpenBSD: newsyslog.c,v 1.34 2000/06/30 16:00:19 millert Exp $";
#endif /* not lint */
#ifndef CONF
@@ -820,7 +820,7 @@ domonitor(log, whom)
fp = fopen(fname, "r");
if (fp == NULL) {
- warn(fname);
+ warn("%s", fname);
goto cleanup;
}
#ifdef QUAD_OFF_T
@@ -847,7 +847,7 @@ domonitor(log, whom)
/* Open logfile, seek. */
fp = fopen(log, "r");
if (fp == NULL) {
- warn(log);
+ warn("%s", log);
goto cleanup;
}
fseek(fp, osize, SEEK_SET);
@@ -877,7 +877,7 @@ update:
/* Reopen for writing and update file. */
fp = fopen(fname, "w");
if (fp == NULL) {
- warn(fname);
+ warn("%s", fname);
goto cleanup;
}
#ifdef QUAD_OFF_T