From bdd64bca363eb92c0e5d53e9e325268f3be1e3fb Mon Sep 17 00:00:00 2001 From: "Tim J. Robbins" Date: Sun, 23 Feb 2003 06:35:33 +0000 Subject: [PATCH] Correct some err() format string bugs. --- sbin/gbde/gbde.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/sbin/gbde/gbde.c b/sbin/gbde/gbde.c index 05344d36ff0a..5fbab19626e3 100644 --- a/sbin/gbde/gbde.c +++ b/sbin/gbde/gbde.c @@ -238,7 +238,7 @@ cmd_attach(const struct g_bde_softc *sc, const char *dest, const char *lfile) if (lfile != NULL) { ffd = open(lfile, O_RDONLY, 0); if (ffd < 0) - err(1, lfile); + err(1, "%s", lfile); read(ffd, buf + sizeof(sc->sha2), 16); close(ffd); } else { @@ -300,7 +300,7 @@ cmd_open(struct g_bde_softc *sc, int dfd , const char *l_opt, u_int *nkey) if (l_opt != NULL) { ffd = open(l_opt, O_RDONLY, 0); if (ffd < 0) - err(1, l_opt); + err(1, "%s", l_opt); read(ffd, keyloc, sizeof keyloc); close(ffd); } else { @@ -374,7 +374,7 @@ cmd_write(struct g_bde_key *gl, struct g_bde_softc *sc, int dfd , int key, const if (l_opt != NULL) { ffd = open(l_opt, O_WRONLY | O_CREAT | O_TRUNC, 0600); if (ffd < 0) - err(1, l_opt); + err(1, "%s", l_opt); write(ffd, keyloc, sizeof keyloc); close(ffd); } else if (gl->flags & 1) { @@ -476,7 +476,7 @@ cmd_init(struct g_bde_key *gl, int dfd, const char *f_opt, int i_opt, const char if (f_opt != NULL) { i = open(f_opt, O_RDONLY); if (i < 0) - err(1, f_opt); + err(1, "%s", f_opt); params = properties_read(i); close (i); } else { @@ -484,7 +484,7 @@ cmd_init(struct g_bde_key *gl, int dfd, const char *f_opt, int i_opt, const char q = strdup("/tmp/temp.XXXXXXXXXX"); i = mkstemp(q); if (i < 0) - err(1, q); + err(1, "%s", q); write(i, template, strlen(template)); close (i); if (i_opt) { @@ -496,7 +496,7 @@ cmd_init(struct g_bde_key *gl, int dfd, const char *f_opt, int i_opt, const char } i = open(q, O_RDONLY); if (i < 0) - err(1, f_opt); + err(1, "%s", f_opt); params = properties_read(i); close (i); unlink(q); @@ -753,7 +753,7 @@ main(int argc, char **argv) dfd = open(buf, O_RDWR | O_CREAT, 0644); } if (dfd < 0) - err(1, dest); + err(1, "%s", dest); } else { if (!memcmp(dest, _PATH_DEV, strlen(_PATH_DEV))) strcpy(dest, dest + strlen(_PATH_DEV));