summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ctm/ctm_rmail
diff options
context:
space:
mode:
authorkris <kris@FreeBSD.org>2001-05-06 03:03:45 +0000
committerkris <kris@FreeBSD.org>2001-05-06 03:03:45 +0000
commit08e03c867950bb514bac8b48cb92a19593e550ff (patch)
treeba16ae783c752f27ff9b16bc5793f1bedac840f1 /usr.sbin/ctm/ctm_rmail
parent43e5432dcb7ba27d1fd948003fd0048bca8ff12d (diff)
downloadFreeBSD-src-08e03c867950bb514bac8b48cb92a19593e550ff.zip
FreeBSD-src-08e03c867950bb514bac8b48cb92a19593e550ff.tar.gz
* fix ctm(8) to use mkstemp() instead of tempnam() for tempfile
creation. * Tag the internal err() function with __printflike to allow checking for non-constant format string arguments (none exist) * Use fmtcheck() to sanitize the tar command obtained via -t to make sure it doesn't contain extraneous format operators. Reviewed by: mikeh MFC after: 1 week
Diffstat (limited to 'usr.sbin/ctm/ctm_rmail')
-rw-r--r--usr.sbin/ctm/ctm_rmail/ctm_rmail.c2
-rw-r--r--usr.sbin/ctm/ctm_rmail/error.c7
-rw-r--r--usr.sbin/ctm/ctm_rmail/error.h4
3 files changed, 10 insertions, 3 deletions
diff --git a/usr.sbin/ctm/ctm_rmail/ctm_rmail.c b/usr.sbin/ctm/ctm_rmail/ctm_rmail.c
index 194394d..464f733 100644
--- a/usr.sbin/ctm/ctm_rmail/ctm_rmail.c
+++ b/usr.sbin/ctm/ctm_rmail/ctm_rmail.c
@@ -509,7 +509,7 @@ combine(char *delta, int npieces, char *dname, char *pname, char *tname)
err("cannot open '%s' for writing", tname);
}
else
- err("*mktemp: '%s'", tname);
+ err("*mkstemp: '%s'", tname);
return 0;
}
diff --git a/usr.sbin/ctm/ctm_rmail/error.c b/usr.sbin/ctm/ctm_rmail/error.c
index 724b117..56d3dc6 100644
--- a/usr.sbin/ctm/ctm_rmail/error.c
+++ b/usr.sbin/ctm/ctm_rmail/error.c
@@ -12,6 +12,11 @@
* Maybe you should write some free software too.
*/
+#ifndef lint
+static const char rcsid[] =
+ "$FreeBSD$";
+#endif /* not lint */
+
#include <stdio.h>
#include <string.h>
#include <stdarg.h>
@@ -58,7 +63,7 @@ err_prog_name(char *name)
* decoded and appended.
*/
void
-err(char *fmt, ...)
+err(const char *fmt, ...)
{
va_list ap;
time_t now;
diff --git a/usr.sbin/ctm/ctm_rmail/error.h b/usr.sbin/ctm/ctm_rmail/error.h
index b8bc452..c631b67 100644
--- a/usr.sbin/ctm/ctm_rmail/error.h
+++ b/usr.sbin/ctm/ctm_rmail/error.h
@@ -1,3 +1,5 @@
+/* $FreeBSD$ */
+
extern void err_set_log(char *log_file);
extern void err_prog_name(char *name);
-extern void err(char *fmt, ...);
+extern void err(const char *fmt, ...) __printflike(1, 2);
OpenPOWER on IntegriCloud