summaryrefslogtreecommitdiff
path: root/usr.bin/mail/names.c
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/mail/names.c
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/mail/names.c')
-rw-r--r--usr.bin/mail/names.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/usr.bin/mail/names.c b/usr.bin/mail/names.c
index 70d2269f0b3..b9cce0f469f 100644
--- a/usr.bin/mail/names.c
+++ b/usr.bin/mail/names.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: names.c,v 1.10 2000/03/23 19:32:13 millert Exp $ */
+/* $OpenBSD: names.c,v 1.11 2000/06/30 16:00:16 millert Exp $ */
/* $NetBSD: names.c,v 1.5 1996/06/08 19:48:32 christos Exp $ */
/*
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)names.c 8.1 (Berkeley) 6/6/93";
#else
-static char rcsid[] = "$OpenBSD: names.c,v 1.10 2000/03/23 19:32:13 millert Exp $";
+static char rcsid[] = "$OpenBSD: names.c,v 1.11 2000/06/30 16:00:16 millert Exp $";
#endif
#endif /* not lint */
@@ -260,14 +260,14 @@ outof(names, fo, hp)
"%s/mail.ReXXXXXXXXXX", tmpdir);
if ((fd = mkstemp(tempname)) == -1 ||
(fout = Fdopen(fd, "a")) == NULL) {
- warn(tempname);
+ warn("%s", tempname);
senderr++;
goto cant;
}
image = open(tempname, O_RDWR);
(void)rm(tempname);
if (image < 0) {
- warn(tempname);
+ warn("%s", tempname);
senderr++;
(void)Fclose(fout);
goto cant;
@@ -281,7 +281,7 @@ outof(names, fo, hp)
(void)putc('\n', fout);
(void)fflush(fout);
if (ferror(fout))
- warn(tempname);
+ warn("%s", tempname);
(void)Fclose(fout);
}
@@ -319,7 +319,7 @@ outof(names, fo, hp)
} else {
int f;
if ((fout = Fopen(fname, "a")) == NULL) {
- warn(fname);
+ warn("%s", fname);
senderr++;
goto cant;
}
@@ -339,7 +339,7 @@ outof(names, fo, hp)
(void)putc(c, fout);
if (ferror(fout)) {
senderr++;
- warn(fname);
+ warn("%s", fname);
}
(void)Fclose(fout);
(void)Fclose(fin);