summaryrefslogtreecommitdiff
path: root/bin/chmod
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 /bin/chmod
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 'bin/chmod')
-rw-r--r--bin/chmod/chmod.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/bin/chmod/chmod.c b/bin/chmod/chmod.c
index 2fb32b07e81..7b0031cd8f7 100644
--- a/bin/chmod/chmod.c
+++ b/bin/chmod/chmod.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: chmod.c,v 1.9 2000/06/09 17:50:16 mickey Exp $ */
+/* $OpenBSD: chmod.c,v 1.10 2000/06/30 16:00:03 millert Exp $ */
/* $NetBSD: chmod.c,v 1.12 1995/03/21 09:02:09 cgd Exp $ */
/*
@@ -44,7 +44,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)chmod.c 8.8 (Berkeley) 4/1/94";
#else
-static char rcsid[] = "$OpenBSD: chmod.c,v 1.9 2000/06/09 17:50:16 mickey Exp $";
+static char rcsid[] = "$OpenBSD: chmod.c,v 1.10 2000/06/30 16:00:03 millert Exp $";
#endif
#endif /* not lint */
@@ -237,7 +237,7 @@ done: argv += optind;
}
if (ischmod && chmod(p->fts_accpath, oct ? omode :
getmode(set, p->fts_statp->st_mode)) && !fflag) {
- warn(p->fts_path);
+ warn("%s", p->fts_path);
rval = 1;
} else if (!ischmod &&
(hflag ? lchown(p->fts_accpath, uid, gid) :