diff options
author | millert <millert@openbsd.org> | 2000-06-30 16:00:03 +0000 |
---|---|---|
committer | millert <millert@openbsd.org> | 2000-06-30 16:00:03 +0000 |
commit | b638aa94715d7c4b461552b23f350ea53e1afd5a (patch) | |
tree | aa7fbc4972a0b2e67a2a10a222aefffd0c85c9a5 /usr.sbin/netgroup_mkdb | |
parent | My previous two attempts at fixing the "scrolling region" problem were wrong. (diff) | |
download | wireguard-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/netgroup_mkdb')
-rw-r--r-- | usr.sbin/netgroup_mkdb/netgroup_mkdb.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.sbin/netgroup_mkdb/netgroup_mkdb.c b/usr.sbin/netgroup_mkdb/netgroup_mkdb.c index 9ca16a1d0ac..f0b56ef022b 100644 --- a/usr.sbin/netgroup_mkdb/netgroup_mkdb.c +++ b/usr.sbin/netgroup_mkdb/netgroup_mkdb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: netgroup_mkdb.c,v 1.7 1997/09/12 04:07:17 millert Exp $ */ +/* $OpenBSD: netgroup_mkdb.c,v 1.8 2000/06/30 16:00:26 millert Exp $ */ /* * Copyright (c) 1994 Christos Zoulas @@ -31,7 +31,7 @@ * SUCH DAMAGE. */ #ifndef lint -static char *rcsid = "$OpenBSD: netgroup_mkdb.c,v 1.7 1997/09/12 04:07:17 millert Exp $"; +static char *rcsid = "$OpenBSD: netgroup_mkdb.c,v 1.8 2000/06/30 16:00:26 millert Exp $"; #endif #include <sys/types.h> @@ -165,7 +165,7 @@ main(argc, argv) db = dbopen(buf, O_RDWR | O_CREAT | O_EXCL, (S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH), DB_HASH, NULL); if (!db) - err(1, buf); + err(1, "%s", buf); ng_write(db, ndb, _NG_KEYBYNAME); ng_rwrite(db, udb, _NG_KEYBYUSER); @@ -212,7 +212,7 @@ ng_load(fname) /* Open the netgroup file */ if ((fp = fopen(fname, "r")) == NULL) - err(1, fname); + err(1, "%s", fname); db = dbopen(NULL, O_RDWR | O_CREAT | O_EXCL, 0, DB_HASH, NULL); |