summaryrefslogtreecommitdiffstats
path: root/usr.sbin/edquota
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>2000-06-30 16:00:03 +0000
committermillert <millert@openbsd.org>2000-06-30 16:00:03 +0000
commitb638aa94715d7c4b461552b23f350ea53e1afd5a (patch)
treeaa7fbc4972a0b2e67a2a10a222aefffd0c85c9a5 /usr.sbin/edquota
parentMy previous two attempts at fixing the "scrolling region" problem were wrong. (diff)
downloadwireguard-openbsd-b638aa94715d7c4b461552b23f350ea53e1afd5a.tar.xz
wireguard-openbsd-b638aa94715d7c4b461552b23f350ea53e1afd5a.zip
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.sbin/edquota')
-rw-r--r--usr.sbin/edquota/edquota.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/usr.sbin/edquota/edquota.c b/usr.sbin/edquota/edquota.c
index fa5c7b4ddc5..953232edea5 100644
--- a/usr.sbin/edquota/edquota.c
+++ b/usr.sbin/edquota/edquota.c
@@ -42,7 +42,7 @@ static char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)edquota.c 8.1 (Berkeley) 6/6/93";*/
-static char *rcsid = "$Id: edquota.c,v 1.23 1999/06/15 17:21:25 deraadt Exp $";
+static char *rcsid = "$Id: edquota.c,v 1.24 2000/06/30 16:00:24 millert Exp $";
#endif /* not lint */
/*
@@ -117,7 +117,7 @@ main(argc, argv)
if (argc < 2)
usage();
if (getuid())
- errx(1, strerror(EPERM));
+ errx(1, "%s", strerror(EPERM));
quotatype = USRQUOTA;
while ((ch = getopt(argc, argv, "ugtp:")) != -1) {
switch(ch) {
@@ -156,7 +156,7 @@ main(argc, argv)
exit(0);
}
if ((tmpfd = mkstemp(tmpfil)) == -1)
- errx(1, tmpfil);
+ errx(1, "%s", tmpfil);
if (tflag) {
protoprivs = getprivs(0, quotatype);
if (writetimes(protoprivs, tmpfd, quotatype) == 0) {
@@ -344,7 +344,7 @@ putprivs(id, quotatype, quplist)
lseek(fd, (off_t)(id * sizeof (struct dqblk)), 0);
if (write(fd, &qup->dqblk, sizeof (struct dqblk)) !=
sizeof (struct dqblk))
- warn(qup->qfname);
+ warn("%s", qup->qfname);
close(fd);
}
}
@@ -424,7 +424,7 @@ writeprivs(quplist, outfd, name, quotatype)
ftruncate(outfd, 0);
lseek(outfd, 0, SEEK_SET);
if ((fd = fdopen(dup(outfd), "w")) == NULL)
- err(1, tmpfil);
+ err(1, "%s", tmpfil);
(void)fprintf(fd, "Quotas for %s %s:\n", qfextension[quotatype], name);
for (qup = quplist; qup; qup = qup->next) {
(void)fprintf(fd, "%s: %s %d, limits (soft = %d, hard = %d)\n",
@@ -564,7 +564,7 @@ writetimes(quplist, outfd, quotatype)
ftruncate(outfd, 0);
lseek(outfd, 0, SEEK_SET);
if ((fd = fdopen(dup(outfd), "w")) == NULL)
- err(1, tmpfil);
+ err(1, "%s", tmpfil);
(void)fprintf(fd,
"Time units may be: days, hours, minutes, or seconds\n");
(void)fprintf(fd,