summaryrefslogtreecommitdiff
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
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).
-rw-r--r--bin/chmod/chmod.c6
-rw-r--r--bin/dd/conv.c12
-rw-r--r--games/monop/cards.c8
-rw-r--r--games/monop/execute.c10
-rw-r--r--games/monop/initdeck.c8
-rw-r--r--kerberosIV/src/appl/bsd/rshd.c2
-rw-r--r--kerberosIV/src/kuser/klist.c2
-rw-r--r--lib/libcompat/regexp/regerror.c6
-rw-r--r--lib/libutil/passwd.c6
-rw-r--r--sbin/brconfig/brconfig.c4
-rw-r--r--sbin/ccdconfig/ccdconfig.c8
-rw-r--r--sbin/disklabel/disklabel.c6
-rw-r--r--sbin/kbd/kbd_i386.c4
-rw-r--r--sbin/mount_nfs/mount_nfs.c4
-rw-r--r--sbin/ping6/ping6.c10
-rw-r--r--sbin/swapctl/swapctl.c4
-rw-r--r--sbin/sysctl/sysctl.c6
-rw-r--r--sys/arch/hppa/stand/mkboot/mkboot.c22
-rw-r--r--usr.bin/biff/biff.c8
-rw-r--r--usr.bin/calendar/calendar.c6
-rw-r--r--usr.bin/compress/main.c6
-rw-r--r--usr.bin/error/main.c6
-rw-r--r--usr.bin/file/apprentice.c6
-rw-r--r--usr.bin/finger/util.c6
-rw-r--r--usr.bin/fsplit/fsplit.c8
-rw-r--r--usr.bin/fstat/fstat.c6
-rw-r--r--usr.bin/ftp/fetch.c6
-rw-r--r--usr.bin/ftp/ftp.c10
-rw-r--r--usr.bin/indent/indent.c18
-rw-r--r--usr.bin/ktrace/ktrace.c14
-rw-r--r--usr.bin/learn/src/learn.c8
-rw-r--r--usr.bin/mail/aux.c6
-rw-r--r--usr.bin/mail/cmd1.c6
-rw-r--r--usr.bin/mail/cmd3.c6
-rw-r--r--usr.bin/mail/collect.c14
-rw-r--r--usr.bin/mail/edit.c16
-rw-r--r--usr.bin/mail/lex.c14
-rw-r--r--usr.bin/mail/main.c6
-rw-r--r--usr.bin/mail/names.c14
-rw-r--r--usr.bin/mail/popen.c6
-rw-r--r--usr.bin/mail/quit.c36
-rw-r--r--usr.bin/mail/send.c16
-rw-r--r--usr.bin/newsyslog/newsyslog.c10
-rw-r--r--usr.bin/passwd/yp_passwd.c6
-rw-r--r--usr.bin/script/script.c6
-rw-r--r--usr.bin/sort/files.c8
-rw-r--r--usr.bin/sort/msort.c6
-rw-r--r--usr.bin/sort/sort.c16
-rw-r--r--usr.bin/sort/tmp.c8
-rw-r--r--usr.bin/strip/strip.c8
-rw-r--r--usr.bin/su/su.c6
-rw-r--r--usr.bin/talk/init_disp.c8
-rw-r--r--usr.bin/tcopy/tcopy.c8
-rw-r--r--usr.bin/uniq/uniq.c6
-rw-r--r--usr.bin/vmstat/dkstats.c4
-rw-r--r--usr.sbin/edquota/edquota.c12
-rw-r--r--usr.sbin/eeprom/eehandlers.c6
-rw-r--r--usr.sbin/eeprom/main.c4
-rw-r--r--usr.sbin/fdformat/fdformat.c4
-rw-r--r--usr.sbin/kvm_mkdb/nlist.c6
-rw-r--r--usr.sbin/netgroup_mkdb/netgroup_mkdb.c8
-rw-r--r--usr.sbin/pccon/pccon.c4
-rw-r--r--usr.sbin/pwd_mkdb/pwd_mkdb.c6
-rw-r--r--usr.sbin/traceroute6/traceroute6.c12
-rw-r--r--usr.sbin/vnconfig/vnconfig.c2
-rw-r--r--usr.sbin/ypserv/revnetgroup/revnetgroup.c6
66 files changed, 274 insertions, 272 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) :
diff --git a/bin/dd/conv.c b/bin/dd/conv.c
index f1853cf7dd7..bccf281e865 100644
--- a/bin/dd/conv.c
+++ b/bin/dd/conv.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: conv.c,v 1.5 1997/02/14 07:05:19 millert Exp $ */
+/* $OpenBSD: conv.c,v 1.6 2000/06/30 16:00:04 millert Exp $ */
/* $NetBSD: conv.c,v 1.6 1996/02/20 19:29:02 jtc Exp $ */
/*-
@@ -42,7 +42,7 @@
#if 0
static char sccsid[] = "@(#)conv.c 8.3 (Berkeley) 4/2/94";
#else
-static char rcsid[] = "$OpenBSD: conv.c,v 1.5 1997/02/14 07:05:19 millert Exp $";
+static char rcsid[] = "$OpenBSD: conv.c,v 1.6 2000/06/30 16:00:04 millert Exp $";
#endif
#endif /* not lint */
@@ -101,10 +101,10 @@ def_close()
/* Build a smaller version (i.e. for a miniroot) */
/* These can not be called, but just in case... */
static char no_block[] = "unblock and -DNO_CONV?";
-void block() { errx(1, no_block + 2); }
-void block_close() { errx(1, no_block + 2); }
-void unblock() { errx(1, no_block); }
-void unblock_close() { errx(1, no_block); }
+void block() { errx(1, "%s", no_block + 2); }
+void block_close() { errx(1, "%s", no_block + 2); }
+void unblock() { errx(1, "%s", no_block); }
+void unblock_close() { errx(1, "%s", no_block); }
#else /* NO_CONV */
/*
diff --git a/games/monop/cards.c b/games/monop/cards.c
index 2de4a31bed5..5e3702371aa 100644
--- a/games/monop/cards.c
+++ b/games/monop/cards.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cards.c,v 1.3 1998/09/20 23:36:50 pjanzen Exp $ */
+/* $OpenBSD: cards.c,v 1.4 2000/06/30 16:00:04 millert Exp $ */
/* $NetBSD: cards.c,v 1.3 1995/03/23 08:34:35 cgd Exp $ */
/*
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)cards.c 8.1 (Berkeley) 5/31/93";
#else
-static char rcsid[] = "$OpenBSD: cards.c,v 1.3 1998/09/20 23:36:50 pjanzen Exp $";
+static char rcsid[] = "$OpenBSD: cards.c,v 1.4 2000/06/30 16:00:04 millert Exp $";
#endif
#endif /* not lint */
@@ -72,7 +72,7 @@ init_decks()
{
if ((deckf = fopen(cardfile, "r")) == NULL)
file_err:
- err(1, cardfile);
+ err(1, "%s", cardfile);
if (fread(&deck[0].num_cards, sizeof(deck[0].num_cards), 1, deckf) != 1)
goto file_err;
if (fread(&deck[0].last_card, sizeof(deck[0].last_card), 1, deckf) != 1)
@@ -108,7 +108,7 @@ set_up(dp)
errx(1, "malloc");
for (i = 0 ; i < dp->num_cards ; i++) {
if (fread(&dp->offsets[i], sizeof(dp->offsets[i]), 1, deckf) != 1)
- err(1, cardfile);
+ err(1, "%s", cardfile);
dp->offsets[i] = ntohl(dp->offsets[i]);
}
dp->last_card = 0;
diff --git a/games/monop/execute.c b/games/monop/execute.c
index 770942efa0e..9e9b5e332f2 100644
--- a/games/monop/execute.c
+++ b/games/monop/execute.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: execute.c,v 1.3 1998/11/29 19:45:11 pjanzen Exp $ */
+/* $OpenBSD: execute.c,v 1.4 2000/06/30 16:00:04 millert Exp $ */
/* $NetBSD: execute.c,v 1.3 1995/03/23 08:34:38 cgd Exp $ */
/*
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)execute.c 8.1 (Berkeley) 5/31/93";
#else
-static char rcsid[] = "$OpenBSD: execute.c,v 1.3 1998/11/29 19:45:11 pjanzen Exp $";
+static char rcsid[] = "$OpenBSD: execute.c,v 1.4 2000/06/30 16:00:04 millert Exp $";
#endif
#endif /* not lint */
@@ -220,7 +220,7 @@ save()
return;
if ((outf=creat(buf, 0644)) < 0) {
- warn(buf);
+ warn("%s", buf);
return;
}
printf("\"%s\" ", buf);
@@ -267,12 +267,12 @@ rest_f(file)
STAT sbuf;
if ((inf = open(file, O_RDONLY)) < 0) {
- warn(file);
+ warn("%s", file);
return FALSE;
}
printf("\"%s\" ", file);
if (fstat(inf, &sbuf) < 0) /* get file stats */
- err(1, file);
+ err(1, "%s", file);
#if 0
start = (((int) etext + (SEGSIZE-1)) / SEGSIZE ) * SEGSIZE;
#else
diff --git a/games/monop/initdeck.c b/games/monop/initdeck.c
index 1f712d86f7d..0201660691f 100644
--- a/games/monop/initdeck.c
+++ b/games/monop/initdeck.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: initdeck.c,v 1.6 1998/09/20 23:36:51 pjanzen Exp $ */
+/* $OpenBSD: initdeck.c,v 1.7 2000/06/30 16:00:04 millert Exp $ */
/* $NetBSD: initdeck.c,v 1.3 1995/03/23 08:34:43 cgd Exp $ */
/*
@@ -44,7 +44,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)initdeck.c 8.1 (Berkeley) 5/31/93";
#else
-static char rcsid[] = "$OpenBSD: initdeck.c,v 1.6 1998/09/20 23:36:51 pjanzen Exp $";
+static char rcsid[] = "$OpenBSD: initdeck.c,v 1.7 2000/06/30 16:00:04 millert Exp $";
#endif
#endif /* not lint */
@@ -94,7 +94,7 @@ main(ac, av)
getargs(ac, av);
if ((inf = fopen(infile, "r")) == NULL)
- err(1, infile);
+ err(1, "%s", infile);
count();
/*
* allocate space for pointers.
@@ -106,7 +106,7 @@ main(ac, av)
errx(1, "malloc");
fseek(inf, 0L, 0);
if ((outf = fopen(outfile, "w")) == NULL)
- err(1, outfile);
+ err(1, "%s", outfile);
fwrite(&deck[0].num_cards, sizeof(deck[0].num_cards), 1, outf);
fwrite(&deck[0].last_card, sizeof(deck[0].last_card), 1, outf);
diff --git a/kerberosIV/src/appl/bsd/rshd.c b/kerberosIV/src/appl/bsd/rshd.c
index 8d7ae3b1d79..bf9cc4f3709 100644
--- a/kerberosIV/src/appl/bsd/rshd.c
+++ b/kerberosIV/src/appl/bsd/rshd.c
@@ -596,7 +596,7 @@ doit(struct sockaddr_in *fromp)
krb_afslog(0, 0);
}
execle(pwd->pw_shell, cp, "-c", cmdbuf, 0, envinit);
- err(1, pwd->pw_shell);
+ err(1, "%s", pwd->pw_shell);
}
/*
diff --git a/kerberosIV/src/kuser/klist.c b/kerberosIV/src/kuser/klist.c
index 2c53c3705d8..2ee1c525990 100644
--- a/kerberosIV/src/kuser/klist.c
+++ b/kerberosIV/src/kuser/klist.c
@@ -317,7 +317,7 @@ display_srvtab(char *file)
printf("%-15s %-15s %-15s %d\n",serv,inst,rlm,vno);
}
if (count < 0)
- warn(file);
+ warn("%s", file);
close(stab);
}
diff --git a/lib/libcompat/regexp/regerror.c b/lib/libcompat/regexp/regerror.c
index c1b96806d47..3f129ea329b 100644
--- a/lib/libcompat/regexp/regerror.c
+++ b/lib/libcompat/regexp/regerror.c
@@ -1,6 +1,6 @@
-/* $OpenBSD: regerror.c,v 1.3 1999/08/02 17:10:47 downsj Exp $ */
+/* $OpenBSD: regerror.c,v 1.4 2000/06/30 16:00:06 millert Exp $ */
#ifndef lint
-static char *rcsid = "$OpenBSD: regerror.c,v 1.3 1999/08/02 17:10:47 downsj Exp $";
+static char *rcsid = "$OpenBSD: regerror.c,v 1.4 2000/06/30 16:00:06 millert Exp $";
#endif /* not lint */
#include <regexp.h>
@@ -15,7 +15,7 @@ v8_regerror(s)
if (_new_regerror != NULL)
_new_regerror(s);
else
- warnx(s);
+ warnx("%s", s);
return;
}
diff --git a/lib/libutil/passwd.c b/lib/libutil/passwd.c
index 456f878cc99..5de35e97e5d 100644
--- a/lib/libutil/passwd.c
+++ b/lib/libutil/passwd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: passwd.c,v 1.20 1998/11/16 07:10:32 deraadt Exp $ */
+/* $OpenBSD: passwd.c,v 1.21 2000/06/30 16:00:07 millert Exp $ */
/*
* Copyright (c) 1987, 1993, 1994, 1995
@@ -34,7 +34,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: passwd.c,v 1.20 1998/11/16 07:10:32 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: passwd.c,v 1.21 2000/06/30 16:00:07 millert Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/types.h>
@@ -579,7 +579,7 @@ pw_error(name, err, eval)
char *master = pw_file(_PATH_MASTERPASSWD);
if (err)
- warn(name);
+ warn("%s", name);
if (master)
warnx("%s: unchanged", master);
pw_abort();
diff --git a/sbin/brconfig/brconfig.c b/sbin/brconfig/brconfig.c
index 6e34b52a106..6d131839079 100644
--- a/sbin/brconfig/brconfig.c
+++ b/sbin/brconfig/brconfig.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: brconfig.c,v 1.6 2000/02/04 06:32:04 deraadt Exp $ */
+/* $OpenBSD: brconfig.c,v 1.7 2000/06/30 16:00:08 millert Exp $ */
/*
* Copyright (c) 1999, 2000 Jason L. Wright (jason@thought.net)
@@ -545,7 +545,7 @@ bridge_list(s, brdg, delim)
if (inbuf == NULL)
err(1, "malloc");
if (ioctl(s, SIOCBRDGIFS, &bifc) < 0)
- err(1, brdg);
+ err(1, "%s", brdg);
if (bifc.ifbic_len + sizeof(*reqp) < len)
break;
len *= 2;
diff --git a/sbin/ccdconfig/ccdconfig.c b/sbin/ccdconfig/ccdconfig.c
index 3e842304cfb..a187a4da5ea 100644
--- a/sbin/ccdconfig/ccdconfig.c
+++ b/sbin/ccdconfig/ccdconfig.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ccdconfig.c,v 1.12 1998/08/15 20:16:34 deraadt Exp $ */
+/* $OpenBSD: ccdconfig.c,v 1.13 2000/06/30 16:00:07 millert Exp $ */
/* $NetBSD: ccdconfig.c,v 1.6 1996/05/16 07:11:18 thorpej Exp $ */
/*-
@@ -492,7 +492,7 @@ do_io(path, cmd, cciop)
#define KVM_ABORT(kd, str) { \
(void)kvm_close((kd)); \
warnx((str)); \
- warnx(kvm_geterr((kd))); \
+ warnx("%s", kvm_geterr((kd))); \
return (1); \
}
@@ -629,7 +629,7 @@ print_ccd_info(cs, kd)
readsize) != readsize) {
printf("\n");
warnx("can't read component info");
- warnx(kvm_geterr(kd));
+ warnx("%s", kvm_geterr(kd));
goto done;
}
@@ -639,7 +639,7 @@ print_ccd_info(cs, kd)
cip[i].ci_pathlen) != cip[i].ci_pathlen) {
printf("\n");
warnx("can't read component pathname");
- warnx(kvm_geterr(kd));
+ warnx("%s", kvm_geterr(kd));
goto done;
}
printf((i + 1 < cs->sc_nccdisks) ? "%s " : "%s\n", path);
diff --git a/sbin/disklabel/disklabel.c b/sbin/disklabel/disklabel.c
index aed8700bef1..f67ab2bdec9 100644
--- a/sbin/disklabel/disklabel.c
+++ b/sbin/disklabel/disklabel.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: disklabel.c,v 1.68 1999/08/17 09:13:14 millert Exp $ */
+/* $OpenBSD: disklabel.c,v 1.69 2000/06/30 16:00:08 millert Exp $ */
/*
* Copyright (c) 1987, 1993
@@ -43,7 +43,7 @@ static char copyright[] =
#endif /* not lint */
#ifndef lint
-static char rcsid[] = "$OpenBSD: disklabel.c,v 1.68 1999/08/17 09:13:14 millert Exp $";
+static char rcsid[] = "$OpenBSD: disklabel.c,v 1.69 2000/06/30 16:00:08 millert Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -732,7 +732,7 @@ readlabel(f)
msg = "disk label corrupted";
}
}
- warnx(msg);
+ warnx("%s", msg);
return(NULL);
} else {
if (cflag && ioctl(f, DIOCRLDINFO) < 0)
diff --git a/sbin/kbd/kbd_i386.c b/sbin/kbd/kbd_i386.c
index bcdb59a8ce4..290e3cb4193 100644
--- a/sbin/kbd/kbd_i386.c
+++ b/sbin/kbd/kbd_i386.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kbd_i386.c,v 1.8 1998/07/06 13:42:26 pefo Exp $ */
+/* $OpenBSD: kbd_i386.c,v 1.9 2000/06/30 16:00:09 millert Exp $ */
/*
* Copyright (c) 1996 Juergen Hannken-Illjes
@@ -145,6 +145,6 @@ kbd_set(name, verbose)
snprintf(buf, sizeof(buf), "kcon -m %s", name);
if (system(buf))
- err(1, name);
+ err(1, "%s", name);
}
}
diff --git a/sbin/mount_nfs/mount_nfs.c b/sbin/mount_nfs/mount_nfs.c
index 84d2406255f..59b5a8f84e5 100644
--- a/sbin/mount_nfs/mount_nfs.c
+++ b/sbin/mount_nfs/mount_nfs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mount_nfs.c,v 1.17 1999/06/17 20:53:28 millert Exp $ */
+/* $OpenBSD: mount_nfs.c,v 1.18 2000/06/30 16:00:08 millert Exp $ */
/* $NetBSD: mount_nfs.c,v 1.12.4.1 1996/05/25 22:48:05 fvdl Exp $ */
/*
@@ -437,7 +437,7 @@ main(argc, argv)
if (errno == EOPNOTSUPP)
errx(1, "%s: Filesystem not supported by kernel", name);
else
- err(1, name);
+ err(1, "%s", name);
}
if (nfsargsp->flags & (NFSMNT_NQNFS | NFSMNT_KERB)) {
if ((opflags & ISBGRND) == 0) {
diff --git a/sbin/ping6/ping6.c b/sbin/ping6/ping6.c
index d8bc8cd27b9..c1b0edf3075 100644
--- a/sbin/ping6/ping6.c
+++ b/sbin/ping6/ping6.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ping6.c,v 1.8 2000/06/20 20:00:03 itojun Exp $ */
+/* $OpenBSD: ping6.c,v 1.9 2000/06/30 16:00:10 millert Exp $ */
/* $KAME: ping6.c,v 1.55 2000/06/12 16:18:32 itojun Exp $ */
/*
@@ -554,9 +554,9 @@ main(argc, argv)
#ifdef IPSEC_POLICY_IPSEC
if (options & F_POLICY) {
if (setpolicy(s, policy_in) < 0)
- errx(1, ipsec_strerror());
+ errx(1, "%s", ipsec_strerror());
if (setpolicy(s, policy_out) < 0)
- errx(1, ipsec_strerror());
+ errx(1, "%s", ipsec_strerror());
}
#else
if (options & F_AUTHHDR) {
@@ -734,7 +734,7 @@ main(argc, argv)
struct addrinfo *iaip;
if ((error = getaddrinfo(argv[hops], NULL, &hints, &iaip)))
- errx(1, gai_strerror(error));
+ errx(1, "%s", gai_strerror(error));
if (SIN6(res->ai_addr)->sin6_family != AF_INET6)
errx(1,
"bad addr family of an intermediate addr");
@@ -1912,7 +1912,7 @@ setpolicy(so, policy)
buf = ipsec_set_policy(policy, strlen(policy));
if (buf == NULL)
- errx(1, ipsec_strerror());
+ errx(1, "%s", ipsec_strerror());
if (setsockopt(s, IPPROTO_IPV6, IPV6_IPSEC_POLICY,
buf, ipsec_get_policylen(buf)) < 0)
warnx("Unable to set IPSec policy");
diff --git a/sbin/swapctl/swapctl.c b/sbin/swapctl/swapctl.c
index 1997cb0c3ee..78148c25006 100644
--- a/sbin/swapctl/swapctl.c
+++ b/sbin/swapctl/swapctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: swapctl.c,v 1.2 2000/02/26 04:06:23 hugh Exp $ */
+/* $OpenBSD: swapctl.c,v 1.3 2000/06/30 16:00:09 millert Exp $ */
/* $NetBSD: swapctl.c,v 1.9 1998/07/26 20:23:15 mycroft Exp $ */
/*
@@ -406,7 +406,7 @@ do_fstab()
* Determine blk-ness.
*/
if (stat(spec, &st) < 0) {
- warn(spec);
+ warn("%s", spec);
continue;
}
if (S_ISBLK(st.st_mode))
diff --git a/sbin/sysctl/sysctl.c b/sbin/sysctl/sysctl.c
index 59f1c9e0488..cd583e05c28 100644
--- a/sbin/sysctl/sysctl.c
+++ b/sbin/sysctl/sysctl.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sysctl.c,v 1.52 2000/06/14 16:54:46 provos Exp $ */
+/* $OpenBSD: sysctl.c,v 1.53 2000/06/30 16:00:10 millert Exp $ */
/* $NetBSD: sysctl.c,v 1.9 1995/09/30 07:12:50 thorpej Exp $ */
/*
@@ -44,7 +44,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)sysctl.c 8.5 (Berkeley) 5/9/95";
#else
-static char *rcsid = "$OpenBSD: sysctl.c,v 1.52 2000/06/14 16:54:46 provos Exp $";
+static char *rcsid = "$OpenBSD: sysctl.c,v 1.53 2000/06/30 16:00:10 millert Exp $";
#endif
#endif /* not lint */
@@ -576,7 +576,7 @@ parse(string, flags)
if (special & BIOSGEO)
return;
default:
- warn(string);
+ warn("%s", string);
return;
}
}
diff --git a/sys/arch/hppa/stand/mkboot/mkboot.c b/sys/arch/hppa/stand/mkboot/mkboot.c
index 789162a3378..aee82debf4b 100644
--- a/sys/arch/hppa/stand/mkboot/mkboot.c
+++ b/sys/arch/hppa/stand/mkboot/mkboot.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mkboot.c,v 1.7 1999/05/23 17:19:22 aaron Exp $ */
+/* $OpenBSD: mkboot.c,v 1.8 2000/06/30 16:00:11 millert Exp $ */
/*
* Copyright (c) 1990, 1993
@@ -43,7 +43,7 @@ static char copyright[] =
#endif /* not lint */
#ifndef lint
-static char rcsid[] = "$OpenBSD: mkboot.c,v 1.7 1999/05/23 17:19:22 aaron Exp $";
+static char rcsid[] = "$OpenBSD: mkboot.c,v 1.8 2000/06/30 16:00:11 millert Exp $";
#endif /* not lint */
#endif
@@ -192,7 +192,7 @@ main(argc, argv)
lseek(to, 0, SEEK_END);
if (close(to) < 0)
- err(1, to_file);
+ err(1, "%s", to_file);
return(0);
}
@@ -209,7 +209,7 @@ putfile(from_file, to)
struct lif_load load;
if ((from = open(from_file, O_RDONLY)) < 0)
- err(1, from_file);
+ err(1, "%s", from_file);
n = read(from, &ex, sizeof(ex));
if (n != sizeof(ex))
@@ -263,12 +263,12 @@ putfile(from_file, to)
for (lseek(from, 0, 0); ; n = sizeof(buf)) {
bzero(buf, sizeof(buf));
if ((n = read(from, buf, n)) < 0)
- err(1, from_file);
+ err(1, "%s", from_file);
else if (n == 0)
break;
if (write(to, buf, n) != n)
- err(1, to_file);
+ err(1, "%s", to_file);
total += n;
check_sum = cksum(check_sum, (int *)buf, n);
@@ -286,7 +286,7 @@ putfile(from_file, to)
/* insert the header */
lseek(to, -total, SEEK_CUR);
if (write(to, &load, sizeof(load)) != sizeof(load))
- err(1, to_file);
+ err(1, "%s", to_file);
lseek(to, total - sizeof(load), SEEK_CUR);
bzero(buf, sizeof(buf));
@@ -294,7 +294,7 @@ putfile(from_file, to)
n = sizeof(int) - total % sizeof(int);
if (total % sizeof(int)) {
if (write(to, buf, n) != n)
- err(1, to_file);
+ err(1, "%s", to_file);
else
total += n;
}
@@ -315,15 +315,15 @@ putfile(from_file, to)
check_sum = htobe32(-check_sum);
if (write(to, &check_sum, sizeof(int)) != sizeof(int))
- err(1, to_file);
+ err(1, "%s", to_file);
n -= sizeof(int);
if (write(to, buf, n) != n)
- err(1, to_file);
+ err(1, "%s", to_file);
if (close(from) < 0 )
- err(1, from_file);
+ err(1, "%s", from_file);
return total;
}
diff --git a/usr.bin/biff/biff.c b/usr.bin/biff/biff.c
index ab96190e5e1..0f36c3ab18a 100644
--- a/usr.bin/biff/biff.c
+++ b/usr.bin/biff/biff.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: biff.c,v 1.5 1998/12/07 20:10:09 deraadt Exp $ */
+/* $OpenBSD: biff.c,v 1.6 2000/06/30 16:00:11 millert Exp $ */
/* $NetBSD: biff.c,v 1.3 1995/03/26 02:34:22 glass Exp $ */
/*
@@ -44,7 +44,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)biff.c 8.1 (Berkeley) 6/6/93";
#else
-static char rcsid[] = "$OpenBSD: biff.c,v 1.5 1998/12/07 20:10:09 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: biff.c,v 1.6 2000/06/30 16:00:11 millert Exp $";
#endif
#endif /* not lint */
@@ -93,11 +93,11 @@ main(argc, argv)
switch(argv[0][0]) {
case 'n':
if (chmod(name, sb.st_mode & ~S_IXUSR) < 0)
- err(2, name);
+ err(2, "%s", name);
break;
case 'y':
if (chmod(name, sb.st_mode | S_IXUSR) < 0)
- err(2, name);
+ err(2, "%s", name);
break;
default:
usage();
diff --git a/usr.bin/calendar/calendar.c b/usr.bin/calendar/calendar.c
index cef979181ef..93405efdbd4 100644
--- a/usr.bin/calendar/calendar.c
+++ b/usr.bin/calendar/calendar.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: calendar.c,v 1.12 1998/12/13 07:31:07 pjanzen Exp $ */
+/* $OpenBSD: calendar.c,v 1.13 2000/06/30 16:00:11 millert Exp $ */
/*
* Copyright (c) 1989, 1993, 1994
@@ -43,7 +43,7 @@ static const char copyright[] =
#if 0
static const char sccsid[] = "@(#)calendar.c 8.3 (Berkeley) 3/25/94";
#else
-static char rcsid[] = "$OpenBSD: calendar.c,v 1.12 1998/12/13 07:31:07 pjanzen Exp $";
+static char rcsid[] = "$OpenBSD: calendar.c,v 1.13 2000/06/30 16:00:11 millert Exp $";
#endif
#endif /* not lint */
@@ -85,7 +85,7 @@ main(argc, argv)
case '-': /* backward contemptible */
case 'a':
if (getuid())
- errx(1, strerror(EPERM));
+ errx(1, "%s", strerror(EPERM));
doall = 1;
break;
diff --git a/usr.bin/compress/main.c b/usr.bin/compress/main.c
index 4deacf6eb28..69bb3c6e8b5 100644
--- a/usr.bin/compress/main.c
+++ b/usr.bin/compress/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.13 2000/03/10 06:53:51 d Exp $ */
+/* $OpenBSD: main.c,v 1.14 2000/06/30 16:00:12 millert Exp $ */
/*-
* Copyright (c) 1992, 1993
@@ -41,7 +41,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)compress.c 8.2 (Berkeley) 1/7/94";
#else
-static char rcsid[] = "$OpenBSD: main.c,v 1.13 2000/03/10 06:53:51 d Exp $";
+static char rcsid[] = "$OpenBSD: main.c,v 1.14 2000/06/30 16:00:12 millert Exp $";
#endif
#endif /* not lint */
@@ -267,7 +267,7 @@ main(argc, argv)
isreg = oreg = !exists || S_ISREG(sb.st_mode);
if (stat(infile, &sb) != 0 && verbose >= 0)
- err(1, infile);
+ err(1, "%s", infile);
if (!S_ISREG(sb.st_mode))
isreg = 0;
diff --git a/usr.bin/error/main.c b/usr.bin/error/main.c
index d86c178dc10..5b890cf6e7b 100644
--- a/usr.bin/error/main.c
+++ b/usr.bin/error/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.3 1998/07/10 14:09:55 mickey Exp $ */
+/* $OpenBSD: main.c,v 1.4 2000/06/30 16:00:12 millert Exp $ */
/* $NetBSD: main.c,v 1.3 1995/09/02 06:15:37 jtc Exp $ */
/*
@@ -44,7 +44,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)main.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: main.c,v 1.3 1998/07/10 14:09:55 mickey Exp $";
+static char rcsid[] = "$OpenBSD: main.c,v 1.4 2000/06/30 16:00:12 millert Exp $";
#endif /* not lint */
#include <signal.h>
@@ -164,7 +164,7 @@ main(argc, argv)
if (argc > 3)
errx(3, "Only takes 0 or 1 arguments\n");
if ( (errorfile = fopen(argv[1], "r")) == NULL)
- err(4, argv[1]);
+ err(4, "%s", argv[1]);
}
if ( (queryfile = fopen(im_on, "r")) == NULL){
if (query){
diff --git a/usr.bin/file/apprentice.c b/usr.bin/file/apprentice.c
index 6c62bc59b64..195b254ca13 100644
--- a/usr.bin/file/apprentice.c
+++ b/usr.bin/file/apprentice.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: apprentice.c,v 1.9 1999/12/06 00:32:28 deraadt Exp $ */
+/* $OpenBSD: apprentice.c,v 1.10 2000/06/30 16:00:13 millert Exp $ */
/*
* apprentice - make one pass through /etc/magic, learning its secrets.
@@ -36,7 +36,7 @@
#include "file.h"
#ifndef lint
-static char *moduleid = "$OpenBSD: apprentice.c,v 1.9 1999/12/06 00:32:28 deraadt Exp $";
+static char *moduleid = "$OpenBSD: apprentice.c,v 1.10 2000/06/30 16:00:13 millert Exp $";
#endif /* lint */
#define EATAB {while (isascii((unsigned char) *l) && \
@@ -108,7 +108,7 @@ int check; /* non-zero? checking-only run. */
f = fopen(fn, "r");
if (f==NULL) {
if (errno != ENOENT)
- warn(fn);
+ warn("%s", fn);
return -1;
}
diff --git a/usr.bin/finger/util.c b/usr.bin/finger/util.c
index 7eeaf066450..ffcee4d063f 100644
--- a/usr.bin/finger/util.c
+++ b/usr.bin/finger/util.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: util.c,v 1.11 1999/08/17 09:13:15 millert Exp $ */
+/* $OpenBSD: util.c,v 1.12 2000/06/30 16:00:13 millert Exp $ */
/*
* Copyright (c) 1989 The Regents of the University of California.
@@ -39,7 +39,7 @@
#ifndef lint
/*static char sccsid[] = "from: @(#)util.c 5.14 (Berkeley) 1/17/91";*/
-static char rcsid[] = "$OpenBSD: util.c,v 1.11 1999/08/17 09:13:15 millert Exp $";
+static char rcsid[] = "$OpenBSD: util.c,v 1.12 2000/06/30 16:00:13 millert Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -114,7 +114,7 @@ userinfo(pn, pw)
pn->mailrecv = -1; /* -1 == not_valid */
if (stat(tbuf, &sb) < 0) {
if (errno != ENOENT) {
- warn(tbuf);
+ warn("%s", tbuf);
return;
}
} else if (sb.st_size != 0) {
diff --git a/usr.bin/fsplit/fsplit.c b/usr.bin/fsplit/fsplit.c
index d399d4557a0..b1d700bd14e 100644
--- a/usr.bin/fsplit/fsplit.c
+++ b/usr.bin/fsplit/fsplit.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fsplit.c,v 1.6 2000/01/30 02:28:37 espie Exp $ */
+/* $OpenBSD: fsplit.c,v 1.7 2000/06/30 16:00:13 millert Exp $ */
/*
* Copyright (c) 1983, 1993
@@ -44,7 +44,7 @@ static char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)fsplit.c 8.1 (Berkeley) 6/6/93";*/
-static char rcsid[] = "$OpenBSD: fsplit.c,v 1.6 2000/01/30 02:28:37 espie Exp $";
+static char rcsid[] = "$OpenBSD: fsplit.c,v 1.7 2000/06/30 16:00:13 millert Exp $";
#endif /* not lint */
#include <ctype.h>
@@ -168,12 +168,12 @@ main(argc, argv)
fd = open(x, O_CREAT|O_EXCL|O_RDWR, 0666);
if (fd == -1)
- err(1, x);
+ err(1, "%s", x);
ofp = fdopen(fd, "w");
if (ofp == NULL) {
close(fd);
unlink(x);
- err(1, x);
+ err(1, "%s", x);
}
nflag = 0;
rv = 0;
diff --git a/usr.bin/fstat/fstat.c b/usr.bin/fstat/fstat.c
index 8adbd6d2706..84a0d7a733d 100644
--- a/usr.bin/fstat/fstat.c
+++ b/usr.bin/fstat/fstat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fstat.c,v 1.26 2000/01/17 16:26:19 itojun Exp $ */
+/* $OpenBSD: fstat.c,v 1.27 2000/06/30 16:00:14 millert Exp $ */
/*-
* Copyright (c) 1988, 1993
@@ -41,7 +41,7 @@ static char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)fstat.c 8.1 (Berkeley) 6/6/93";*/
-static char *rcsid = "$OpenBSD: fstat.c,v 1.26 2000/01/17 16:26:19 itojun Exp $";
+static char *rcsid = "$OpenBSD: fstat.c,v 1.27 2000/06/30 16:00:14 millert Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -1018,7 +1018,7 @@ getfname(filename)
DEVS *cur;
if (stat(filename, &statbuf)) {
- warn(filename);
+ warn("%s", filename);
return(0);
}
if ((cur = malloc(sizeof(DEVS))) == NULL)
diff --git a/usr.bin/ftp/fetch.c b/usr.bin/ftp/fetch.c
index 6b887364eb8..bc307e5f862 100644
--- a/usr.bin/ftp/fetch.c
+++ b/usr.bin/ftp/fetch.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fetch.c,v 1.32 2000/05/25 16:09:26 itojun Exp $ */
+/* $OpenBSD: fetch.c,v 1.33 2000/06/30 16:00:15 millert Exp $ */
/* $NetBSD: fetch.c,v 1.14 1997/08/18 10:20:20 lukem Exp $ */
/*-
@@ -38,7 +38,7 @@
*/
#ifndef lint
-static char rcsid[] = "$OpenBSD: fetch.c,v 1.32 2000/05/25 16:09:26 itojun Exp $";
+static char rcsid[] = "$OpenBSD: fetch.c,v 1.33 2000/06/30 16:00:15 millert Exp $";
#endif /* not lint */
/*
@@ -338,7 +338,7 @@ again:
}
freeaddrinfo(res0);
if (s < 0) {
- warn(cause);
+ warn("%s", cause);
goto cleanup_url_get;
}
diff --git a/usr.bin/ftp/ftp.c b/usr.bin/ftp/ftp.c
index a29bbe1ffea..0e360768ff8 100644
--- a/usr.bin/ftp/ftp.c
+++ b/usr.bin/ftp/ftp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ftp.c,v 1.37 2000/06/27 00:19:16 fgsch Exp $ */
+/* $OpenBSD: ftp.c,v 1.38 2000/06/30 16:00:14 millert Exp $ */
/* $NetBSD: ftp.c,v 1.27 1997/08/18 10:20:23 lukem Exp $ */
/*
@@ -67,7 +67,7 @@
#if 0
static char sccsid[] = "@(#)ftp.c 8.6 (Berkeley) 10/27/94";
#else
-static char rcsid[] = "$OpenBSD: ftp.c,v 1.37 2000/06/27 00:19:16 fgsch Exp $";
+static char rcsid[] = "$OpenBSD: ftp.c,v 1.38 2000/06/30 16:00:14 millert Exp $";
#endif
#endif /* not lint */
@@ -165,7 +165,7 @@ hookup(host, port)
error = getaddrinfo(host, pbuf, &hints, &res0);
}
if (error) {
- warn(gai_strerror(error));
+ warn("%s", gai_strerror(error));
code = -1;
return (0);
}
@@ -216,7 +216,7 @@ hookup(host, port)
break;
}
if (s < 0) {
- warn(cause);
+ warn("%s", cause);
code = -1;
freeaddrinfo(res0);
return 0;
@@ -1276,6 +1276,8 @@ reinit:
* What we've got at this point is a string of comma separated
* one-byte unsigned integer values, separated by commas.
*/
+ if (!pasvcmd)
+ goto bad;
if (strcmp(pasvcmd, "PASV") == 0) {
if (data_addr.su_family != AF_INET) {
fputs(
diff --git a/usr.bin/indent/indent.c b/usr.bin/indent/indent.c
index e229d6797af..50a75cbf32f 100644
--- a/usr.bin/indent/indent.c
+++ b/usr.bin/indent/indent.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: indent.c,v 1.6 1999/05/19 03:17:16 alex Exp $ */
+/* $OpenBSD: indent.c,v 1.7 2000/06/30 16:00:15 millert Exp $ */
/*
* Copyright (c) 1985 Sun Microsystems, Inc.
@@ -45,7 +45,7 @@ char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)indent.c 5.16 (Berkeley) 2/26/91";*/
-static char rcsid[] = "$OpenBSD: indent.c,v 1.6 1999/05/19 03:17:16 alex Exp $";
+static char rcsid[] = "$OpenBSD: indent.c,v 1.7 2000/06/30 16:00:15 millert Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -190,7 +190,7 @@ main(argc, argv)
in_name = argv[i]; /* remember name of input file */
input = fopen(in_name, "r");
if (input == NULL) /* check for open error */
- err(1, in_name);
+ err(1, "%s", in_name);
continue;
}
else if (output == 0) { /* we have the output file */
@@ -200,7 +200,7 @@ main(argc, argv)
errx(1, "input and output files must be different");
output = fopen(out_name, "w");
if (output == NULL) /* check for create error */
- err(1, out_name);
+ err(1, "%s", out_name);
continue;
}
errx(1, "unknown parameter: %s", argv[i]);
@@ -1155,23 +1155,23 @@ bakcopy()
/* copy in_name to backup file */
bakchn = creat(bakfile, 0600);
if (bakchn < 0)
- err(1, bakfile);
+ err(1, "%s", bakfile);
while ((n = read(fileno(input), buff, sizeof buff)) > 0)
if (write(bakchn, buff, n) != n)
- err(1, bakfile);
+ err(1, "%s", bakfile);
if (n < 0)
- err(1, in_name);
+ err(1, "%s", in_name);
close(bakchn);
fclose(input);
/* re-open backup file as the input file */
input = fopen(bakfile, "r");
if (input == NULL)
- err(1, bakfile);
+ err(1, "%s", bakfile);
/* now the original input file will be the output */
output = fopen(in_name, "w");
if (output == NULL) {
unlink(bakfile);
- err(1, in_name);
+ err(1, "%s", in_name);
}
}
diff --git a/usr.bin/ktrace/ktrace.c b/usr.bin/ktrace/ktrace.c
index 8d4c5821fe1..e7747debb42 100644
--- a/usr.bin/ktrace/ktrace.c
+++ b/usr.bin/ktrace/ktrace.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ktrace.c,v 1.8 1999/08/17 09:13:15 millert Exp $ */
+/* $OpenBSD: ktrace.c,v 1.9 2000/06/30 16:00:15 millert Exp $ */
/* $NetBSD: ktrace.c,v 1.4 1995/08/31 23:01:44 jtc Exp $ */
/*-
@@ -44,7 +44,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)ktrace.c 8.2 (Berkeley) 4/28/95";
#endif
-static char *rcsid = "$OpenBSD: ktrace.c,v 1.8 1999/08/17 09:13:15 millert Exp $";
+static char *rcsid = "$OpenBSD: ktrace.c,v 1.9 2000/06/30 16:00:15 millert Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -136,14 +136,14 @@ main(argc, argv)
ops |= pid ? KTROP_CLEAR : KTROP_CLEARFILE;
if (ktrace(tracefile, ops, trpoints, pid) < 0)
- err(1, tracefile);
+ err(1, "%s", tracefile);
exit(0);
}
omask = umask(S_IRWXG|S_IRWXO);
if (append) {
if ((fd = open(tracefile, O_CREAT | O_WRONLY, DEFFILEMODE)) < 0)
- err(1, tracefile);
+ err(1, "%s", tracefile);
if (fstat(fd, &sb) != 0 || sb.st_uid != getuid())
errx(1, "Refuse to append to %s: not owned by you.",
tracefile);
@@ -152,19 +152,19 @@ main(argc, argv)
err(1, "unlink %s", tracefile);
if ((fd = open(tracefile, O_CREAT | O_EXCL | O_WRONLY,
DEFFILEMODE)) < 0)
- err(1, tracefile);
+ err(1, "%s", tracefile);
}
(void)umask(omask);
(void)close(fd);
if (*argv) {
if (ktrace(tracefile, ops, trpoints, getpid()) < 0)
- err(1, tracefile);
+ err(1, "%s", tracefile);
execvp(argv[0], &argv[0]);
err(1, "exec of '%s' failed", argv[0]);
}
else if (ktrace(tracefile, ops, trpoints, pid) < 0)
- err(1, tracefile);
+ err(1, "%s", tracefile);
exit(0);
}
diff --git a/usr.bin/learn/src/learn.c b/usr.bin/learn/src/learn.c
index dc5cc919269..3cabb520065 100644
--- a/usr.bin/learn/src/learn.c
+++ b/usr.bin/learn/src/learn.c
@@ -2,7 +2,7 @@
* learn, from V7 UNIX: one of the earliest Computer Based Training (CBT)
* programs still in existence.
*
- * $OpenBSD: learn.c,v 1.3 1999/08/17 09:13:15 millert Exp $
+ * $OpenBSD: learn.c,v 1.4 2000/06/30 16:00:23 millert Exp $
*/
/****************************************************************
@@ -387,7 +387,7 @@ retry:
scrin = fopen(tbuff, "r");
if (scrin == NULL) {
fprintf(stderr, "No script.\n");
- err(1, tbuff);
+ err(1, "%s", tbuff);
wrapup(1);
}
@@ -861,7 +861,7 @@ retry:
f = fopen(fnam, "r");
if (f==NULL) {
fprintf(stderr, "No script for lesson %s.\n", level);
- err(1, fnam);
+ err(1, "%s", fnam);
wrapup(1);
}
while (fgets(zb, 200, f)) {
@@ -971,7 +971,7 @@ start(char *lesson)
if (access(where, R_OK)==0) /* there is a file */
return;
fprintf(stderr, "No lesson %s\n",lesson);
- err(1, where);
+ err(1, "%s", where);
wrapup(1);
}
diff --git a/usr.bin/mail/aux.c b/usr.bin/mail/aux.c
index f82bd763a69..f418991eebc 100644
--- a/usr.bin/mail/aux.c
+++ b/usr.bin/mail/aux.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: aux.c,v 1.14 2000/04/25 16:42:22 millert Exp $ */
+/* $OpenBSD: aux.c,v 1.15 2000/06/30 16:00:18 millert Exp $ */
/* $NetBSD: aux.c,v 1.5 1997/05/13 06:15:52 mikel Exp $ */
/*
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)aux.c 8.1 (Berkeley) 6/6/93";
#else
-static char rcsid[] = "$OpenBSD: aux.c,v 1.14 2000/04/25 16:42:22 millert Exp $";
+static char rcsid[] = "$OpenBSD: aux.c,v 1.15 2000/06/30 16:00:18 millert Exp $";
#endif
#endif /* not lint */
@@ -294,7 +294,7 @@ source(v)
if ((cp = expand(*arglist)) == NULL)
return(1);
if ((fi = Fopen(cp, "r")) == NULL) {
- warn(cp);
+ warn("%s", cp);
return(1);
}
if (ssp >= NOFILE - 1) {
diff --git a/usr.bin/mail/cmd1.c b/usr.bin/mail/cmd1.c
index 2e83ef729f3..b53a92c40cc 100644
--- a/usr.bin/mail/cmd1.c
+++ b/usr.bin/mail/cmd1.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd1.c,v 1.15 2000/04/26 15:47:29 millert Exp $ */
+/* $OpenBSD: cmd1.c,v 1.16 2000/06/30 16:00:18 millert Exp $ */
/* $NetBSD: cmd1.c,v 1.9 1997/07/09 05:29:48 mikel Exp $ */
/*-
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)cmd1.c 8.2 (Berkeley) 4/20/95";
#else
-static char rcsid[] = "$OpenBSD: cmd1.c,v 1.15 2000/04/26 15:47:29 millert Exp $";
+static char rcsid[] = "$OpenBSD: cmd1.c,v 1.16 2000/06/30 16:00:18 millert Exp $";
#endif
#endif /* not lint */
@@ -335,7 +335,7 @@ type1(msgvec, doign, page)
cp = _PATH_MORE;
obuf = Popen(cp, "w");
if (obuf == NULL) {
- warn(cp);
+ warn("%s", cp);
obuf = stdout;
} else
(void)signal(SIGPIPE, brokpipe);
diff --git a/usr.bin/mail/cmd3.c b/usr.bin/mail/cmd3.c
index f02e27e3eb4..19f2dfa9200 100644
--- a/usr.bin/mail/cmd3.c
+++ b/usr.bin/mail/cmd3.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd3.c,v 1.11 2000/04/25 16:42:22 millert Exp $ */
+/* $OpenBSD: cmd3.c,v 1.12 2000/06/30 16:00:16 millert Exp $ */
/* $NetBSD: cmd3.c,v 1.8 1997/07/09 05:29:49 mikel Exp $ */
/*
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)cmd3.c 8.2 (Berkeley) 4/20/95";
#else
-static char rcsid[] = "$OpenBSD: cmd3.c,v 1.11 2000/04/25 16:42:22 millert Exp $";
+static char rcsid[] = "$OpenBSD: cmd3.c,v 1.12 2000/06/30 16:00:16 millert Exp $";
#endif
#endif /* not lint */
@@ -188,7 +188,7 @@ schdir(v)
if ((cp = expand(*arglist)) == NULL)
return(1);
if (chdir(cp) < 0) {
- warn(cp);
+ warn("%s", cp);
return(1);
}
return(0);
diff --git a/usr.bin/mail/collect.c b/usr.bin/mail/collect.c
index 1ad6274da1e..4e39ded1d9e 100644
--- a/usr.bin/mail/collect.c
+++ b/usr.bin/mail/collect.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: collect.c,v 1.18 2000/04/26 15:47:30 millert Exp $ */
+/* $OpenBSD: collect.c,v 1.19 2000/06/30 16:00:17 millert Exp $ */
/* $NetBSD: collect.c,v 1.9 1997/07/09 05:25:45 mikel Exp $ */
/*
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)collect.c 8.2 (Berkeley) 4/19/94";
#else
-static char rcsid[] = "$OpenBSD: collect.c,v 1.18 2000/04/26 15:47:30 millert Exp $";
+static char rcsid[] = "$OpenBSD: collect.c,v 1.19 2000/06/30 16:00:17 millert Exp $";
#endif
#endif /* not lint */
@@ -123,7 +123,7 @@ collect(hp, printheaders)
"%s/mail.RsXXXXXXXXXX", tmpdir);
if ((fd = mkstemp(tempname)) == -1 ||
(collf = Fdopen(fd, "w+")) == NULL) {
- warn(tempname);
+ warn("%s", tempname);
goto err;
}
(void)rm(tempname);
@@ -305,7 +305,7 @@ cont:
break;
}
if ((fbuf = Fopen(cp, "r")) == NULL) {
- warn(cp);
+ warn("%s", cp);
break;
}
printf("\"%s\" ", cp);
@@ -465,7 +465,7 @@ exwrite(name, fp, f)
lc++;
(void)putc(c, of);
if (ferror(of)) {
- warn(name);
+ warn("%s", name);
(void)Fclose(of);
return(-1);
}
@@ -516,7 +516,7 @@ mespipe(fp, cmd)
"%s/mail.ReXXXXXXXXXX", tmpdir);
if ((fd = mkstemp(tempname)) == -1 ||
(nf = Fdopen(fd, "w+")) == NULL) {
- warn(tempname);
+ warn("%s", tempname);
goto out;
}
(void)rm(tempname);
@@ -590,7 +590,7 @@ forward(ms, fp, fn, f)
touch(mp);
printf(" %d", *msgvec);
if (sendmessage(mp, fp, ig, tabst) < 0) {
- warn(fn);
+ warn("%s", fn);
return(-1);
}
}
diff --git a/usr.bin/mail/edit.c b/usr.bin/mail/edit.c
index 43e7095b13e..04e7ace6ea5 100644
--- a/usr.bin/mail/edit.c
+++ b/usr.bin/mail/edit.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: edit.c,v 1.7 1997/11/14 00:23:45 millert Exp $ */
+/* $OpenBSD: edit.c,v 1.8 2000/06/30 16:00:18 millert Exp $ */
/* $NetBSD: edit.c,v 1.5 1996/06/08 19:48:20 christos Exp $ */
/*
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)edit.c 8.1 (Berkeley) 6/6/93";
#else
-static char rcsid[] = "$OpenBSD: edit.c,v 1.7 1997/11/14 00:23:45 millert Exp $";
+static char rcsid[] = "$OpenBSD: edit.c,v 1.8 2000/06/30 16:00:18 millert Exp $";
#endif
#endif /* not lint */
@@ -161,11 +161,11 @@ run_editor(fp, size, type, readonly)
"%s/mail.ReXXXXXXXXXX", tmpdir);
if ((t = mkstemp(tempname)) == -1 ||
(nf = Fdopen(t, "w")) == NULL) {
- warn(tempname);
+ warn("%s", tempname);
goto out;
}
if (readonly && fchmod(t, 0400) == -1) {
- warn(tempname);
+ warn("%s", tempname);
(void)rm(tempname);
goto out;
}
@@ -182,13 +182,13 @@ run_editor(fp, size, type, readonly)
modtime = statb.st_mtime;
if (ferror(nf)) {
(void)Fclose(nf);
- warn(tempname);
+ warn("%s", tempname);
(void)rm(tempname);
nf = NULL;
goto out;
}
if (Fclose(nf) < 0) {
- warn(tempname);
+ warn("%s", tempname);
(void)rm(tempname);
nf = NULL;
goto out;
@@ -209,7 +209,7 @@ run_editor(fp, size, type, readonly)
goto out;
}
if (stat(tempname, &statb) < 0) {
- warn(tempname);
+ warn("%s", tempname);
goto out;
}
if (modtime == statb.st_mtime) {
@@ -220,7 +220,7 @@ run_editor(fp, size, type, readonly)
* Now switch to new file.
*/
if ((nf = Fopen(tempname, "a+")) == NULL) {
- warn(tempname);
+ warn("%s", tempname);
(void)rm(tempname);
goto out;
}
diff --git a/usr.bin/mail/lex.c b/usr.bin/mail/lex.c
index b1405843e5f..5b6099013f3 100644
--- a/usr.bin/mail/lex.c
+++ b/usr.bin/mail/lex.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lex.c,v 1.19 2000/04/25 16:42:22 millert Exp $ */
+/* $OpenBSD: lex.c,v 1.20 2000/06/30 16:00:19 millert Exp $ */
/* $NetBSD: lex.c,v 1.10 1997/05/17 19:55:13 pk Exp $ */
/*
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)lex.c 8.2 (Berkeley) 4/20/95";
#else
-static char rcsid[] = "$OpenBSD: lex.c,v 1.19 2000/04/25 16:42:22 millert Exp $";
+static char rcsid[] = "$OpenBSD: lex.c,v 1.20 2000/06/30 16:00:19 millert Exp $";
#endif
#endif /* not lint */
@@ -79,7 +79,7 @@ setfile(name)
if ((ibuf = Fopen(name, "r")) == NULL) {
if (!isedit && errno == ENOENT)
goto nomail;
- warn(name);
+ warn("%s", name);
return(-1);
}
@@ -93,7 +93,7 @@ setfile(name)
case S_IFDIR:
(void)Fclose(ibuf);
errno = EISDIR;
- warn(name);
+ warn("%s", name);
return(-1);
case S_IFREG:
@@ -102,7 +102,7 @@ setfile(name)
default:
(void)Fclose(ibuf);
errno = EINVAL;
- warn(name);
+ warn("%s", name);
return(-1);
}
@@ -143,10 +143,10 @@ setfile(name)
"%s/mail.RxXXXXXXXXXX", tmpdir);
if ((fd = mkstemp(tempname)) == -1 ||
(otf = fdopen(fd, "w")) == NULL)
- err(1, tempname);
+ err(1, "%s", tempname);
(void)fcntl(fileno(otf), F_SETFD, 1);
if ((itf = fopen(tempname, "r")) == NULL)
- err(1, tempname);
+ err(1, "%s", tempname);
(void)fcntl(fileno(itf), F_SETFD, 1);
(void)rm(tempname);
setptr(ibuf, 0);
diff --git a/usr.bin/mail/main.c b/usr.bin/mail/main.c
index d413952827e..94e262fa549 100644
--- a/usr.bin/mail/main.c
+++ b/usr.bin/mail/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.11 1998/09/27 21:16:42 millert Exp $ */
+/* $OpenBSD: main.c,v 1.12 2000/06/30 16:00:19 millert Exp $ */
/* $NetBSD: main.c,v 1.7 1997/05/13 06:15:57 mikel Exp $ */
/*
@@ -44,7 +44,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)main.c 8.2 (Berkeley) 4/20/95";
#else
-static char rcsid[] = "$OpenBSD: main.c,v 1.11 1998/09/27 21:16:42 millert Exp $";
+static char rcsid[] = "$OpenBSD: main.c,v 1.12 2000/06/30 16:00:19 millert Exp $";
#endif
#endif /* not lint */
@@ -107,7 +107,7 @@ main(argc, argv)
*/
Tflag = optarg;
if ((i = creat(Tflag, 0600)) < 0)
- err(1, Tflag);
+ err(1, "%s", Tflag);
(void)close(i);
break;
case 'u':
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);
diff --git a/usr.bin/mail/popen.c b/usr.bin/mail/popen.c
index 82664f8cc0c..e93e6c36564 100644
--- a/usr.bin/mail/popen.c
+++ b/usr.bin/mail/popen.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: popen.c,v 1.23 1998/09/27 21:16:42 millert Exp $ */
+/* $OpenBSD: popen.c,v 1.24 2000/06/30 16:00:18 millert Exp $ */
/* $NetBSD: popen.c,v 1.6 1997/05/13 06:48:42 mikel Exp $ */
/*
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)popen.c 8.1 (Berkeley) 6/6/93";
#else
-static char rcsid[] = "$OpenBSD: popen.c,v 1.23 1998/09/27 21:16:42 millert Exp $";
+static char rcsid[] = "$OpenBSD: popen.c,v 1.24 2000/06/30 16:00:18 millert Exp $";
#endif
#endif /* not lint */
@@ -263,7 +263,7 @@ start_command(cmd, nset, infd, outfd, a0, a1, a2)
argv[i] = NULL;
prepare_child(nset, infd, outfd);
execvp(argv[0], argv);
- warn(argv[0]);
+ warn("%s", argv[0]);
_exit(1);
}
return(pid);
diff --git a/usr.bin/mail/quit.c b/usr.bin/mail/quit.c
index 310fc71a753..3119f691731 100644
--- a/usr.bin/mail/quit.c
+++ b/usr.bin/mail/quit.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: quit.c,v 1.12 2000/04/26 15:47:31 millert Exp $ */
+/* $OpenBSD: quit.c,v 1.13 2000/06/30 16:00:18 millert Exp $ */
/* $NetBSD: quit.c,v 1.6 1996/12/28 07:11:07 tls Exp $ */
/*
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)quit.c 8.2 (Berkeley) 4/28/95";
#else
-static char rcsid[] = "$OpenBSD: quit.c,v 1.12 2000/04/26 15:47:31 millert Exp $";
+static char rcsid[] = "$OpenBSD: quit.c,v 1.13 2000/06/30 16:00:18 millert Exp $";
#endif
#endif /* not lint */
@@ -221,13 +221,13 @@ quit()
"%s/mail.RmXXXXXXXXXX", tmpdir);
if ((fd = mkstemp(tempname)) == -1 ||
(obuf = Fdopen(fd, "w")) == NULL) {
- warn(tempname);
+ warn("%s", tempname);
(void)Fclose(fbuf);
spool_unlock();
return;
}
if ((ibuf = Fopen(tempname, "r")) == NULL) {
- warn(tempname);
+ warn("%s", tempname);
(void)rm(tempname);
(void)Fclose(obuf);
(void)Fclose(fbuf);
@@ -241,7 +241,7 @@ quit()
(void)Fclose(abuf);
}
if (ferror(obuf)) {
- warn(tempname);
+ warn("%s", tempname);
(void)Fclose(ibuf);
(void)Fclose(obuf);
(void)Fclose(fbuf);
@@ -251,7 +251,7 @@ quit()
(void)Fclose(obuf);
(void)close(creat(mbox, 0600));
if ((obuf = Fopen(mbox, "r+")) == NULL) {
- warn(mbox);
+ warn("%s", mbox);
(void)Fclose(ibuf);
(void)Fclose(fbuf);
spool_unlock();
@@ -260,7 +260,7 @@ quit()
}
else {
if ((obuf = Fopen(mbox, "a")) == NULL) {
- warn(mbox);
+ warn("%s", mbox);
(void)Fclose(fbuf);
spool_unlock();
return;
@@ -270,7 +270,7 @@ quit()
for (mp = &message[0]; mp < &message[msgCount]; mp++)
if (mp->m_flag & MBOX)
if (sendmessage(mp, obuf, saveignore, NULL) < 0) {
- warn(mbox);
+ warn("%s", mbox);
(void)Fclose(ibuf);
(void)Fclose(obuf);
(void)Fclose(fbuf);
@@ -298,7 +298,7 @@ quit()
}
trunc(obuf);
if (ferror(obuf)) {
- warn(mbox);
+ warn("%s", mbox);
(void)Fclose(obuf);
(void)Fclose(fbuf);
spool_unlock();
@@ -371,7 +371,7 @@ writeback(res)
p = 0;
if ((obuf = Fopen(mailname, "r+")) == NULL) {
- warn(mailname);
+ warn("%s", mailname);
return(-1);
}
#ifndef APPEND
@@ -383,7 +383,7 @@ writeback(res)
if ((mp->m_flag&MPRESERVE)||(mp->m_flag&MTOUCH)==0) {
p++;
if (sendmessage(mp, obuf, NULL, NULL) < 0) {
- warn(mailname);
+ warn("%s", mailname);
(void)Fclose(obuf);
return(-1);
}
@@ -396,7 +396,7 @@ writeback(res)
fflush(obuf);
trunc(obuf);
if (ferror(obuf)) {
- warn(mailname);
+ warn("%s", mailname);
(void)Fclose(obuf);
return(-1);
}
@@ -457,12 +457,12 @@ edstop()
tmpdir);
if ((fd = mkstemp(tempname)) == -1 ||
(obuf = Fdopen(fd, "w")) == NULL) {
- warn(tempname);
+ warn("%s", tempname);
relsesigs();
reset(0);
}
if ((ibuf = Fopen(mailname, "r")) == NULL) {
- warn(mailname);
+ warn("%s", mailname);
(void)Fclose(obuf);
(void)rm(tempname);
relsesigs();
@@ -474,7 +474,7 @@ edstop()
(void)Fclose(ibuf);
(void)Fclose(obuf);
if ((ibuf = Fopen(tempname, "r")) == NULL) {
- warn(tempname);
+ warn("%s", tempname);
(void)rm(tempname);
relsesigs();
reset(0);
@@ -484,7 +484,7 @@ edstop()
printf("\"%s\" ", mailname);
fflush(stdout);
if ((obuf = Fopen(mailname, "r+")) == NULL) {
- warn(mailname);
+ warn("%s", mailname);
relsesigs();
reset(0);
}
@@ -495,7 +495,7 @@ edstop()
continue;
c++;
if (sendmessage(mp, obuf, NULL, NULL) < 0) {
- warn(mailname);
+ warn("%s", mailname);
relsesigs();
reset(0);
}
@@ -508,7 +508,7 @@ edstop()
}
fflush(obuf);
if (ferror(obuf)) {
- warn(mailname);
+ warn("%s", mailname);
relsesigs();
reset(0);
}
diff --git a/usr.bin/mail/send.c b/usr.bin/mail/send.c
index df12fe6d35e..fde6063e667 100644
--- a/usr.bin/mail/send.c
+++ b/usr.bin/mail/send.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: send.c,v 1.10 2000/04/26 15:47:31 millert Exp $ */
+/* $OpenBSD: send.c,v 1.11 2000/06/30 16:00:18 millert Exp $ */
/* $NetBSD: send.c,v 1.6 1996/06/08 19:48:39 christos Exp $ */
/*
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)send.c 8.1 (Berkeley) 6/6/93";
#else
-static char rcsid[] = "$OpenBSD: send.c,v 1.10 2000/04/26 15:47:31 millert Exp $";
+static char rcsid[] = "$OpenBSD: send.c,v 1.11 2000/06/30 16:00:18 millert Exp $";
#endif
#endif /* not lint */
@@ -385,7 +385,7 @@ mail1(hp, printheaders)
else
cp = _PATH_SENDMAIL;
execv(cp, namelist);
- warn(cp);
+ warn("%s", cp);
_exit(1);
}
if (value("verbose") != NULL)
@@ -439,11 +439,11 @@ infix(hp, fi)
"%s/mail.RsXXXXXXXXXX", tmpdir);
if ((fd = mkstemp(tempname)) == -1 ||
(nfo = Fdopen(fd, "w")) == NULL) {
- warn(tempname);
+ warn("%s", tempname);
return(fi);
}
if ((nfi = Fopen(tempname, "r")) == NULL) {
- warn(tempname);
+ warn("%s", tempname);
(void)Fclose(nfo);
(void)rm(tempname);
return(fi);
@@ -462,7 +462,7 @@ infix(hp, fi)
}
(void)fflush(nfo);
if (ferror(nfo)) {
- warn(tempname);
+ warn("%s", tempname);
(void)Fclose(nfo);
(void)Fclose(nfi);
rewind(fi);
@@ -550,7 +550,7 @@ savemail(name, fi)
time_t now;
if ((fo = Fopen(name, "a")) == NULL) {
- warn(name);
+ warn("%s", name);
return(-1);
}
(void)time(&now);
@@ -560,7 +560,7 @@ savemail(name, fi)
(void)putc('\n', fo);
(void)fflush(fo);
if (ferror(fo))
- warn(name);
+ warn("%s", name);
(void)Fclose(fo);
rewind(fi);
return(0);
diff --git a/usr.bin/newsyslog/newsyslog.c b/usr.bin/newsyslog/newsyslog.c
index c9e13f4322b..d8ff177bf7b 100644
--- a/usr.bin/newsyslog/newsyslog.c
+++ b/usr.bin/newsyslog/newsyslog.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: newsyslog.c,v 1.33 2000/06/14 22:55:19 millert Exp $ */
+/* $OpenBSD: newsyslog.c,v 1.34 2000/06/30 16:00:19 millert Exp $ */
/*
* Copyright (c) 1999 Todd C. Miller <Todd.Miller@courtesan.com>
@@ -88,7 +88,7 @@ provided "as is" without express or implied warranty.
*/
#ifndef lint
-static char rcsid[] = "$OpenBSD: newsyslog.c,v 1.33 2000/06/14 22:55:19 millert Exp $";
+static char rcsid[] = "$OpenBSD: newsyslog.c,v 1.34 2000/06/30 16:00:19 millert Exp $";
#endif /* not lint */
#ifndef CONF
@@ -820,7 +820,7 @@ domonitor(log, whom)
fp = fopen(fname, "r");
if (fp == NULL) {
- warn(fname);
+ warn("%s", fname);
goto cleanup;
}
#ifdef QUAD_OFF_T
@@ -847,7 +847,7 @@ domonitor(log, whom)
/* Open logfile, seek. */
fp = fopen(log, "r");
if (fp == NULL) {
- warn(log);
+ warn("%s", log);
goto cleanup;
}
fseek(fp, osize, SEEK_SET);
@@ -877,7 +877,7 @@ update:
/* Reopen for writing and update file. */
fp = fopen(fname, "w");
if (fp == NULL) {
- warn(fname);
+ warn("%s", fname);
goto cleanup;
}
#ifdef QUAD_OFF_T
diff --git a/usr.bin/passwd/yp_passwd.c b/usr.bin/passwd/yp_passwd.c
index 112e9feef1c..fd7f362c72e 100644
--- a/usr.bin/passwd/yp_passwd.c
+++ b/usr.bin/passwd/yp_passwd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: yp_passwd.c,v 1.12 1998/07/13 02:15:01 deraadt Exp $ */
+/* $OpenBSD: yp_passwd.c,v 1.13 2000/06/30 16:00:20 millert Exp $ */
/*
* Copyright (c) 1988 The Regents of the University of California.
@@ -34,7 +34,7 @@
*/
#ifndef lint
/*static char sccsid[] = "from: @(#)yp_passwd.c 1.0 2/2/93";*/
-static char rcsid[] = "$OpenBSD: yp_passwd.c,v 1.12 1998/07/13 02:15:01 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: yp_passwd.c,v 1.13 2000/06/30 16:00:20 millert Exp $";
#endif /* not lint */
#ifdef YP
@@ -72,7 +72,7 @@ pw_error(name, err, eval)
int err, eval;
{
if(err)
- warn(name);
+ warn("%s", name);
warnx("YP passwd database unchanged.");
exit(eval);
diff --git a/usr.bin/script/script.c b/usr.bin/script/script.c
index 187c4ec7ec9..e39c0030bc6 100644
--- a/usr.bin/script/script.c
+++ b/usr.bin/script/script.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: script.c,v 1.12 2000/04/16 20:28:54 espie Exp $ */
+/* $OpenBSD: script.c,v 1.13 2000/06/30 16:00:20 millert Exp $ */
/* $NetBSD: script.c,v 1.3 1994/12/21 08:55:43 jtc Exp $ */
/*
@@ -44,7 +44,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)script.c 8.1 (Berkeley) 6/6/93";
#endif
-static char rcsid[] = "$OpenBSD: script.c,v 1.12 2000/04/16 20:28:54 espie Exp $";
+static char rcsid[] = "$OpenBSD: script.c,v 1.13 2000/06/30 16:00:20 millert Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -115,7 +115,7 @@ main(argc, argv)
fname = "typescript";
if ((fscript = fopen(fname, aflg ? "a" : "w")) == NULL)
- err(1, fname);
+ err(1, "%s", fname);
(void)tcgetattr(STDIN_FILENO, &tt);
(void)ioctl(STDIN_FILENO, TIOCGWINSZ, &win);
diff --git a/usr.bin/sort/files.c b/usr.bin/sort/files.c
index 35208ff7aee..90317da4872 100644
--- a/usr.bin/sort/files.c
+++ b/usr.bin/sort/files.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: files.c,v 1.5 1997/06/30 05:36:16 millert Exp $ */
+/* $OpenBSD: files.c,v 1.6 2000/06/30 16:00:23 millert Exp $ */
/*-
* Copyright (c) 1993
@@ -40,7 +40,7 @@
#if 0
static char sccsid[] = "@(#)files.c 8.1 (Berkeley) 6/6/93";
#else
-static char rcsid[] = "$OpenBSD: files.c,v 1.5 1997/06/30 05:36:16 millert Exp $";
+static char rcsid[] = "$OpenBSD: files.c,v 1.6 2000/06/30 16:00:23 millert Exp $";
#endif
#endif /* not lint */
@@ -157,7 +157,7 @@ makeline(flno, filelist, nfiles, buffer, bufend, dummy2)
if (fileno >= nfiles)
return (EOF);
if (!(fp = fopen(filelist.names[fileno], "r")))
- err(2, filelist.names[fileno]);
+ err(2, "%s", filelist.names[fileno]);
fileno++;
}
while ((pos < end) && ((c = getc(fp)) != EOF)) {
@@ -225,7 +225,7 @@ makekey(flno, filelist, nfiles, buffer, bufend, ftbl)
return (EOF);
dbdesc = fopen(filelist.names[fileno], "r");
if (!dbdesc)
- err(2, filelist.names[fileno]);
+ err(2, "%s", filelist.names[fileno]);
fileno++;
get = seq;
}
diff --git a/usr.bin/sort/msort.c b/usr.bin/sort/msort.c
index 6da0e01ef04..ff4877aa615 100644
--- a/usr.bin/sort/msort.c
+++ b/usr.bin/sort/msort.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: msort.c,v 1.7 1999/05/24 17:57:18 millert Exp $ */
+/* $OpenBSD: msort.c,v 1.8 2000/06/30 16:00:23 millert Exp $ */
/*-
* Copyright (c) 1993
@@ -40,7 +40,7 @@
#if 0
static char sccsid[] = "@(#)msort.c 8.1 (Berkeley) 6/6/93";
#else
-static char rcsid[] = "$OpenBSD: msort.c,v 1.7 1999/05/24 17:57:18 millert Exp $";
+static char rcsid[] = "$OpenBSD: msort.c,v 1.8 2000/06/30 16:00:23 millert Exp $";
#endif
#endif /* not lint */
@@ -125,7 +125,7 @@ fmerge(binno, files, nfiles, get, outfp, fput, ftbl)
for (i = 0; i < last; i++)
if (!(l_fstack[i+MAXFCT-1-16].fp =
fopen(files.names[j + i], "r")))
- err(2, files.names[j+i]);
+ err(2, "%s", files.names[j+i]);
merge(MAXFCT-1-16, last, get, tout, put, ftbl);
} else {
for (i = 0; i< last; i++)
diff --git a/usr.bin/sort/sort.c b/usr.bin/sort/sort.c
index a070694d9ec..0332a340b6b 100644
--- a/usr.bin/sort/sort.c
+++ b/usr.bin/sort/sort.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sort.c,v 1.13 1999/11/30 16:41:41 espie Exp $ */
+/* $OpenBSD: sort.c,v 1.14 2000/06/30 16:00:23 millert Exp $ */
/*-
* Copyright (c) 1993
@@ -46,7 +46,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)sort.c 8.1 (Berkeley) 6/6/93";
#else
-static char rcsid[] = "$OpenBSD: sort.c,v 1.13 1999/11/30 16:41:41 espie Exp $";
+static char rcsid[] = "$OpenBSD: sort.c,v 1.14 2000/06/30 16:00:23 millert Exp $";
#endif
#endif /* not lint */
@@ -217,7 +217,7 @@ main(argc, argv)
argv[i] = devstdin;
}
} else if ((ch = access(argv[i], R_OK)))
- err(2, argv[i]);
+ err(2, "%s", argv[i]);
}
if (!(fldtab->flags & (I|D|N) || fldtab[1].icol.num)) {
@@ -271,7 +271,7 @@ main(argc, argv)
errno = 0;
if (access(outpath, W_OK))
- err(2, outpath);
+ err(2, "%s", outpath);
act.sa_handler = onsig;
(void)snprintf(toutpath, sizeof(toutpath), "%sXXXXXXXXXX",
outpath);
@@ -282,7 +282,7 @@ main(argc, argv)
if ((outfd = mkstemp(toutpath)) == -1 ||
fchmod(outfd, DEFFILEMODE & ~um) == -1 ||
(outfp = fdopen(outfd, "w")) == 0)
- err(2, toutpath);
+ err(2, "%s", toutpath);
outfile = toutpath;
(void)atexit(cleanup);
@@ -291,14 +291,14 @@ main(argc, argv)
} else
outfile = outpath;
if (outfp == NULL && (outfp = fopen(outfile, "w")) == NULL)
- err(2, outfile);
+ err(2, "%s", outfile);
if (mflag)
fmerge(-1, filelist, argc-optind, get, outfp, putline, fldtab);
else
fsort(-1, 0, filelist, argc-optind, outfp, fldtab);
if (outfile != outpath) {
if (access(outfile, 0))
- err(2, outfile);
+ err(2, "%s", outfile);
(void)unlink(outpath);
if (link(outfile, outpath))
err(2, "cannot link %s: output left in %s",
@@ -332,7 +332,7 @@ usage(msg)
extern char *__progname;
if (msg)
- warnx(msg);
+ warnx("%s", msg);
(void)fprintf(stderr, "usage: %s [-T dir] [-o output] [-cmubdfinrH] "
"[-t char] [-R char] [-k keydef] ... [files]\n", __progname);
exit(2);
diff --git a/usr.bin/sort/tmp.c b/usr.bin/sort/tmp.c
index 58d5a91314f..4f092c2f2dc 100644
--- a/usr.bin/sort/tmp.c
+++ b/usr.bin/sort/tmp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tmp.c,v 1.2 1997/06/16 02:21:57 millert Exp $ */
+/* $OpenBSD: tmp.c,v 1.3 2000/06/30 16:00:23 millert Exp $ */
/*-
* Copyright (c) 1993
@@ -40,7 +40,7 @@
#if 0
static char sccsid[] = "@(#)tmp.c 8.1 (Berkeley) 6/6/93";
#else
-static char rcsid[] = "$OpenBSD: tmp.c,v 1.2 1997/06/16 02:21:57 millert Exp $";
+static char rcsid[] = "$OpenBSD: tmp.c,v 1.3 2000/06/30 16:00:23 millert Exp $";
#endif
#endif /* not lint */
@@ -75,9 +75,9 @@ ftmp()
sigfillset(&set);
(void)sigprocmask(SIG_BLOCK, &set, &oset);
if ((fd = mkstemp(path)) < 0)
- err(2, path);
+ err(2, "%s", path);
if (!(fp = fdopen(fd, "w+")))
- err(2, path);
+ err(2, "%s", path);
(void)unlink(path);
(void)sigprocmask(SIG_SETMASK, &oset, NULL);
diff --git a/usr.bin/strip/strip.c b/usr.bin/strip/strip.c
index 29a18f332ce..b94c6dde4aa 100644
--- a/usr.bin/strip/strip.c
+++ b/usr.bin/strip/strip.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: strip.c,v 1.11 1999/05/10 16:14:07 espie Exp $ */
+/* $OpenBSD: strip.c,v 1.12 2000/06/30 16:00:20 millert Exp $ */
/*
* Copyright (c) 1988 Regents of the University of California.
@@ -41,7 +41,7 @@ char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)strip.c 5.8 (Berkeley) 11/6/91";*/
-static char rcsid[] = "$OpenBSD: strip.c,v 1.11 1999/05/10 16:14:07 espie Exp $";
+static char rcsid[] = "$OpenBSD: strip.c,v 1.12 2000/06/30 16:00:20 millert Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -201,7 +201,7 @@ s_sym(fn, fd, ep, sp)
/* Truncate the file. */
if (ftruncate(fd, neweof - (char *)ep)) {
- warn(fn);
+ warn("%s", fn);
return 1;
}
@@ -295,7 +295,7 @@ s_stab(fn, fd, ep, sp)
/* Truncate to the current length. */
if (ftruncate(fd, (char *)nsym + len - (char *)ep)) {
- warn(fn);
+ warn("%s", fn);
return 1;
}
diff --git a/usr.bin/su/su.c b/usr.bin/su/su.c
index 444d6a1c7e7..437db42e158 100644
--- a/usr.bin/su/su.c
+++ b/usr.bin/su/su.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: su.c,v 1.31 1998/03/25 21:27:27 art Exp $ */
+/* $OpenBSD: su.c,v 1.32 2000/06/30 16:00:21 millert Exp $ */
/*
* Copyright (c) 1988 The Regents of the University of California.
@@ -41,7 +41,7 @@ char copyright[] =
#ifndef lint
/*static char sccsid[] = "from: @(#)su.c 5.26 (Berkeley) 7/6/91";*/
-static char rcsid[] = "$OpenBSD: su.c,v 1.31 1998/03/25 21:27:27 art Exp $";
+static char rcsid[] = "$OpenBSD: su.c,v 1.32 2000/06/30 16:00:21 millert Exp $";
#endif /* not lint */
#include <sys/param.h>
@@ -300,7 +300,7 @@ badlogin:
(void)setpriority(PRIO_PROCESS, 0, prio);
execv(shell, np);
- err(1, shell);
+ err(1, "%s", shell);
}
int
diff --git a/usr.bin/talk/init_disp.c b/usr.bin/talk/init_disp.c
index 75fe1286b92..3ad5114be47 100644
--- a/usr.bin/talk/init_disp.c
+++ b/usr.bin/talk/init_disp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: init_disp.c,v 1.10 1999/03/23 17:00:38 millert Exp $ */
+/* $OpenBSD: init_disp.c,v 1.11 2000/06/30 16:00:21 millert Exp $ */
/* $NetBSD: init_disp.c,v 1.6 1994/12/09 02:14:17 jtc Exp $ */
/*
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)init_disp.c 8.2 (Berkeley) 2/16/94";
#endif
-static char rcsid[] = "$OpenBSD: init_disp.c,v 1.10 1999/03/23 17:00:38 millert Exp $";
+static char rcsid[] = "$OpenBSD: init_disp.c,v 1.11 2000/06/30 16:00:21 millert Exp $";
#endif /* not lint */
/*
@@ -157,9 +157,9 @@ quit(warning, do_perror)
send_delete();
if (warning) {
if (do_perror)
- warn(warning);
+ warn("%s", warning);
else
- warnx(warning);
+ warnx("%s", warning);
}
exit(0);
}
diff --git a/usr.bin/tcopy/tcopy.c b/usr.bin/tcopy/tcopy.c
index bd0575cd036..7964d9678fb 100644
--- a/usr.bin/tcopy/tcopy.c
+++ b/usr.bin/tcopy/tcopy.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tcopy.c,v 1.4 1997/04/16 03:43:56 millert Exp $ */
+/* $OpenBSD: tcopy.c,v 1.5 2000/06/30 16:00:22 millert Exp $ */
/* $NetBSD: tcopy.c,v 1.5 1997/04/15 07:23:08 lukem Exp $ */
/*
@@ -44,7 +44,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)tcopy.c 8.3 (Berkeley) 1/23/95";
#endif
-static char rcsid[] = "$OpenBSD: tcopy.c,v 1.4 1997/04/16 03:43:56 millert Exp $";
+static char rcsid[] = "$OpenBSD: tcopy.c,v 1.5 2000/06/30 16:00:22 millert Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -131,7 +131,7 @@ main(argc, argv)
inf = argv[0];
if ((outp = open(argv[1], op == VERIFY ? O_RDONLY :
op == COPY ? O_WRONLY : O_RDWR, DEFFILEMODE)) < 0) {
- err(3, argv[1]);
+ err(3, "%s", argv[1]);
}
break;
default:
@@ -139,7 +139,7 @@ main(argc, argv)
}
if ((inp = open(inf, O_RDONLY, 0)) < 0)
- err(1, inf);
+ err(1, "%s", inf);
buff = getspace(maxblk);
diff --git a/usr.bin/uniq/uniq.c b/usr.bin/uniq/uniq.c
index 8e81fdde0ea..82c0cfa572d 100644
--- a/usr.bin/uniq/uniq.c
+++ b/usr.bin/uniq/uniq.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uniq.c,v 1.5 1997/07/25 22:21:40 mickey Exp $ */
+/* $OpenBSD: uniq.c,v 1.6 2000/06/30 16:00:22 millert Exp $ */
/* $NetBSD: uniq.c,v 1.7 1995/08/31 22:03:48 jtc Exp $ */
/*
@@ -47,7 +47,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)uniq.c 8.3 (Berkeley) 5/4/95";
#endif
-static char rcsid[] = "$OpenBSD: uniq.c,v 1.5 1997/07/25 22:21:40 mickey Exp $";
+static char rcsid[] = "$OpenBSD: uniq.c,v 1.6 2000/06/30 16:00:22 millert Exp $";
#endif /* not lint */
#include <errno.h>
@@ -210,7 +210,7 @@ file(name, mode)
FILE *fp;
if ((fp = fopen(name, mode)) == NULL)
- err(1, name);
+ err(1, "%s", name);
return(fp);
}
diff --git a/usr.bin/vmstat/dkstats.c b/usr.bin/vmstat/dkstats.c
index 60e54d0162e..44f22330101 100644
--- a/usr.bin/vmstat/dkstats.c
+++ b/usr.bin/vmstat/dkstats.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dkstats.c,v 1.6 1999/06/21 20:48:01 art Exp $ */
+/* $OpenBSD: dkstats.c,v 1.7 2000/06/30 16:00:22 millert Exp $ */
/* $NetBSD: dkstats.c,v 1.1 1996/05/10 23:19:27 thorpej Exp $ */
/*
@@ -84,7 +84,7 @@ char **dr_name;
#define KVM_ERROR(_string) { \
warnx((_string)); \
- errx(1, kvm_geterr(kd)); \
+ errx(1, "%s", kvm_geterr(kd)); \
}
/*
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,
diff --git a/usr.sbin/eeprom/eehandlers.c b/usr.sbin/eeprom/eehandlers.c
index 6a192c1e407..add02041ea1 100644
--- a/usr.sbin/eeprom/eehandlers.c
+++ b/usr.sbin/eeprom/eehandlers.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: eehandlers.c,v 1.5 1996/08/31 12:56:06 deraadt Exp $ */
+/* $OpenBSD: eehandlers.c,v 1.6 2000/06/30 16:00:24 millert Exp $ */
/* $NetBSD: eehandlers.c,v 1.2 1996/02/28 01:13:22 thorpej Exp $ */
/*-
@@ -79,14 +79,14 @@ static int doio __P((struct keytabent *, u_char *, ssize_t, int));
}
#define FAILEDREAD(kt) { \
- warnx(err_str); \
+ warnx("%s", err_str); \
warnx("failed to read field `%s'", (kt)->kt_keyword); \
++eval; \
return; \
}
#define FAILEDWRITE(kt) { \
- warnx(err_str); \
+ warnx("%s", err_str); \
warnx("failed to update field `%s'", (kt)->kt_keyword); \
++eval; \
return; \
diff --git a/usr.sbin/eeprom/main.c b/usr.sbin/eeprom/main.c
index 48fccb98b8c..b269dae231c 100644
--- a/usr.sbin/eeprom/main.c
+++ b/usr.sbin/eeprom/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.5 1998/07/08 22:13:26 deraadt Exp $ */
+/* $OpenBSD: main.c,v 1.6 2000/06/30 16:00:25 millert Exp $ */
/* $NetBSD: main.c,v 1.3 1996/05/16 16:00:55 thorpej Exp $ */
/*-
@@ -264,7 +264,7 @@ action(line)
* the generic op_handler.
*/
if ((cp = op_handler(keyword, arg)) != NULL)
- warnx(cp);
+ warnx("%s", cp);
return;
} else
#endif /* __sparc__ */
diff --git a/usr.sbin/fdformat/fdformat.c b/usr.sbin/fdformat/fdformat.c
index ac9a07348b3..ec83e0c109d 100644
--- a/usr.sbin/fdformat/fdformat.c
+++ b/usr.sbin/fdformat/fdformat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fdformat.c,v 1.8 1998/08/13 05:36:56 deraadt Exp $ */
+/* $OpenBSD: fdformat.c,v 1.9 2000/06/30 16:00:25 millert Exp $ */
/*
* Copyright (C) 1992-1994 by Joerg Wunsch, Dresden
@@ -247,7 +247,7 @@ main(argc, argv)
usage();
if ((fd = opendev(argv[optind], O_RDWR, OPENDEV_PART, &devname)) < 0)
- err(1, devname);
+ err(1, "%s", devname);
if (ioctl(fd, FD_GTYPE, &fdt) < 0)
errx(1, "not a floppy disk: %s", devname);
diff --git a/usr.sbin/kvm_mkdb/nlist.c b/usr.sbin/kvm_mkdb/nlist.c
index 3227173cdcb..36091a46826 100644
--- a/usr.sbin/kvm_mkdb/nlist.c
+++ b/usr.sbin/kvm_mkdb/nlist.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nlist.c,v 1.18 1999/03/24 05:25:57 millert Exp $ */
+/* $OpenBSD: nlist.c,v 1.19 2000/06/30 16:00:25 millert Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "from: @(#)nlist.c 8.1 (Berkeley) 6/6/93";
#else
-static char *rcsid = "$OpenBSD: nlist.c,v 1.18 1999/03/24 05:25:57 millert Exp $";
+static char *rcsid = "$OpenBSD: nlist.c,v 1.19 2000/06/30 16:00:25 millert Exp $";
#endif
#endif /* not lint */
@@ -393,7 +393,7 @@ __elf_knlist(fd, db)
if (feof(fp))
fmterr = "corrupted symbol table";
else
- warn(kfile);
+ warn("%s", kfile);
return (-1);
}
if (!sbuf.st_name)
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);
diff --git a/usr.sbin/pccon/pccon.c b/usr.sbin/pccon/pccon.c
index 382b9a8f995..6f0da89ce22 100644
--- a/usr.sbin/pccon/pccon.c
+++ b/usr.sbin/pccon/pccon.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pccon.c,v 1.1 1997/03/03 11:59:12 downsj Exp $ */
+/* $OpenBSD: pccon.c,v 1.2 2000/06/30 16:00:29 millert Exp $ */
/*
* Copyright (c) 1997, Jason Downs. All rights reserved.
@@ -69,7 +69,7 @@ int main(argc, argv)
fd = open (dev, O_RDWR);
if (fd < 0)
- err (1, dev);
+ err (1, "%s", dev);
if (blank >= 0) {
if (ioctl(fd, CONSOLE_SET_BLANK, &blank) < 0)
diff --git a/usr.sbin/pwd_mkdb/pwd_mkdb.c b/usr.sbin/pwd_mkdb/pwd_mkdb.c
index 0424c963381..96f17d86cd0 100644
--- a/usr.sbin/pwd_mkdb/pwd_mkdb.c
+++ b/usr.sbin/pwd_mkdb/pwd_mkdb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pwd_mkdb.c,v 1.20 1999/04/21 21:15:12 alex Exp $ */
+/* $OpenBSD: pwd_mkdb.c,v 1.21 2000/06/30 16:00:26 millert Exp $ */
/*-
* Copyright (c) 1991, 1993, 1994
@@ -45,7 +45,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "from: @(#)pwd_mkdb.c 8.5 (Berkeley) 4/20/94";
#else
-static char *rcsid = "$OpenBSD: pwd_mkdb.c,v 1.20 1999/04/21 21:15:12 alex Exp $";
+static char *rcsid = "$OpenBSD: pwd_mkdb.c,v 1.21 2000/06/30 16:00:26 millert Exp $";
#endif
#endif /* not lint */
@@ -357,7 +357,7 @@ error(name)
char *name;
{
- warn(name);
+ warn("%s", name);
cleanup();
exit(1);
}
diff --git a/usr.sbin/traceroute6/traceroute6.c b/usr.sbin/traceroute6/traceroute6.c
index de64088c9ac..242f30e8f96 100644
--- a/usr.sbin/traceroute6/traceroute6.c
+++ b/usr.sbin/traceroute6/traceroute6.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: traceroute6.c,v 1.10 2000/06/12 16:37:10 itojun Exp $ */
+/* $OpenBSD: traceroute6.c,v 1.11 2000/06/30 16:00:29 millert Exp $ */
/* $KAME: traceroute6.c,v 1.29 2000/06/12 16:29:18 itojun Exp $ */
/*
@@ -597,9 +597,9 @@ main(argc, argv)
* turned off.
*/
if (setpolicy(rcvsock, "in bypass") < 0)
- errx(1, ipsec_strerror());
+ errx(1, "%s", ipsec_strerror());
if (setpolicy(rcvsock, "out bypass") < 0)
- errx(1, ipsec_strerror());
+ errx(1, "%s", ipsec_strerror());
#else
{
int level = IPSEC_LEVEL_NONE;
@@ -671,9 +671,9 @@ main(argc, argv)
* turned off.
*/
if (setpolicy(sndsock, "in bypass") < 0)
- errx(1, ipsec_strerror());
+ errx(1, "%s", ipsec_strerror());
if (setpolicy(sndsock, "out bypass") < 0)
- errx(1, ipsec_strerror());
+ errx(1, "%s", ipsec_strerror());
#else
{
int level = IPSEC_LEVEL_BYPASS;
@@ -891,7 +891,7 @@ setpolicy(so, policy)
buf = ipsec_set_policy(policy, strlen(policy));
if (buf == NULL) {
- warnx(ipsec_strerror());
+ warnx("%s", ipsec_strerror());
return -1;
}
(void)setsockopt(so, IPPROTO_IPV6, IPV6_IPSEC_POLICY,
diff --git a/usr.sbin/vnconfig/vnconfig.c b/usr.sbin/vnconfig/vnconfig.c
index 34273377c4c..611437caaa0 100644
--- a/usr.sbin/vnconfig/vnconfig.c
+++ b/usr.sbin/vnconfig/vnconfig.c
@@ -121,7 +121,7 @@ config(dev, file, action, key)
err(4, "%s", rdev);
f = fopen(rdev, "rw");
if (f == NULL) {
- warn(rdev);
+ warn("%s", rdev);
rv = -1;
goto out;
}
diff --git a/usr.sbin/ypserv/revnetgroup/revnetgroup.c b/usr.sbin/ypserv/revnetgroup/revnetgroup.c
index cad2577ea9a..a727450c4c8 100644
--- a/usr.sbin/ypserv/revnetgroup/revnetgroup.c
+++ b/usr.sbin/ypserv/revnetgroup/revnetgroup.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: revnetgroup.c,v 1.1 1997/04/15 22:06:15 maja Exp $ */
+/* $OpenBSD: revnetgroup.c,v 1.2 2000/06/30 16:00:27 millert Exp $ */
/*
* Copyright (c) 1995
* Bill Paul <wpaul@ctr.columbia.edu>. All rights reserved.
@@ -47,7 +47,7 @@
#include "hash.h"
#ifndef lint
-static const char rcsid[] = "$OpenBSD: revnetgroup.c,v 1.1 1997/04/15 22:06:15 maja Exp $";
+static const char rcsid[] = "$OpenBSD: revnetgroup.c,v 1.2 2000/06/30 16:00:27 millert Exp $";
#endif
/* Default location of netgroup file. */
@@ -118,7 +118,7 @@ main(argc, argv)
if (strcmp(netgroup, "-")) {
if ((fp = fopen(netgroup, "r")) == NULL) {
- err(1,netgroup);
+ err(1, "%s", netgroup);
}
} else {
fp = stdin;