From 21c07ea0182ba3f51a05a4b8b8c9840a807a7576 Mon Sep 17 00:00:00 2001 From: Anil Madhavapeddy Date: Wed, 2 Jul 2003 00:21:18 +0000 Subject: bump randomness of mktemp to from 6 to 10 X's, as recommended by mktemp(3) --- usr.bin/error/pathnames.h | 4 ++-- usr.bin/file/compress.c | 4 ++-- usr.bin/lorder/lorder.sh | 6 +++--- usr.bin/msgs/pathnames.h | 4 ++-- usr.bin/patch/patch.c | 12 ++++++------ usr.bin/rwall/rwall.c | 6 +++--- usr.bin/tic/tic.c | 4 ++-- usr.bin/vi/common/exf.c | 4 ++-- usr.bin/vi/common/recover.c | 8 ++++---- usr.bin/wall/wall.c | 6 +++--- usr.bin/xinstall/xinstall.c | 6 +++--- usr.bin/xstr/pathnames.h | 4 ++-- 12 files changed, 34 insertions(+), 34 deletions(-) (limited to 'usr.bin') diff --git a/usr.bin/error/pathnames.h b/usr.bin/error/pathnames.h index 29b1f2890b4..c68fd925e10 100644 --- a/usr.bin/error/pathnames.h +++ b/usr.bin/error/pathnames.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pathnames.h,v 1.4 2003/06/03 02:56:07 millert Exp $ */ +/* $OpenBSD: pathnames.h,v 1.5 2003/07/02 00:21:16 avsm Exp $ */ /* $NetBSD: pathnames.h,v 1.3 1995/09/02 06:15:40 jtc Exp $ */ /* @@ -38,4 +38,4 @@ #define IG_FILE2 "llib-port" #define IG_FILE3 "/usr/lib/llib-lc" #define IG_FILE4 "/usr/lib/llib-port" -#define _PATH_TMPFILE "/tmp/ErrorXXXXXX" +#define _PATH_TMPFILE "/tmp/ErrorXXXXXXXXXX" diff --git a/usr.bin/file/compress.c b/usr.bin/file/compress.c index 462fbdc7704..636f3744a3f 100644 --- a/usr.bin/file/compress.c +++ b/usr.bin/file/compress.c @@ -1,4 +1,4 @@ -/* $OpenBSD: compress.c,v 1.9 2003/06/13 18:31:14 deraadt Exp $ */ +/* $OpenBSD: compress.c,v 1.10 2003/07/02 00:21:16 avsm Exp $ */ /* * compress routines: @@ -156,7 +156,7 @@ pipe2file(int fd, void *startbuf, size_t nbytes) char buf[4096]; int r, tfd; - (void)strlcpy(buf, "/tmp/file.XXXXXX", sizeof buf); + (void)strlcpy(buf, "/tmp/file.XXXXXXXXXX", sizeof buf); #ifndef HAVE_MKSTEMP { char *ptr = mktemp(buf); diff --git a/usr.bin/lorder/lorder.sh b/usr.bin/lorder/lorder.sh index 29eced70b3e..d4e0f0a8a37 100644 --- a/usr.bin/lorder/lorder.sh +++ b/usr.bin/lorder/lorder.sh @@ -1,5 +1,5 @@ #!/bin/sh - -# $OpenBSD: lorder.sh,v 1.13 2003/06/03 02:56:10 millert Exp $ +# $OpenBSD: lorder.sh,v 1.14 2003/07/02 00:21:16 avsm Exp $ # $NetBSD: lorder.sh.gnm,v 1.3 1995/12/20 04:45:11 cgd Exp $ # # Copyright (c) 1990, 1993 @@ -43,8 +43,8 @@ case $# in esac # temporary files -R=`mktemp /tmp/_referenceXXXXXX` || exit 1 -S=`mktemp /tmp/_symbolXXXXXX` || { +R=`mktemp /tmp/_referenceXXXXXXXXXX` || exit 1 +S=`mktemp /tmp/_symbolXXXXXXXXXX` || { rm -f ${R} exit 1 } diff --git a/usr.bin/msgs/pathnames.h b/usr.bin/msgs/pathnames.h index e6d52cc4fbc..447ef51c96e 100644 --- a/usr.bin/msgs/pathnames.h +++ b/usr.bin/msgs/pathnames.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pathnames.h,v 1.4 2003/06/03 02:56:13 millert Exp $ */ +/* $OpenBSD: pathnames.h,v 1.5 2003/07/02 00:21:16 avsm Exp $ */ /* $NetBSD: pathnames.h,v 1.3 1995/09/28 06:57:41 tls Exp $ */ /* @@ -35,4 +35,4 @@ #define _PATH_MSGS "/var/msgs" #define _PATH_MAIL "/usr/bin/Mail -f %s" #define _PATH_PAGER "/usr/bin/more -%d" -#define _PATH_TMPFILE "/tmp/msgXXXXXX" +#define _PATH_TMPFILE "/tmp/msgXXXXXXXXXX" diff --git a/usr.bin/patch/patch.c b/usr.bin/patch/patch.c index 1cac5ac5c98..58c924e9a8f 100644 --- a/usr.bin/patch/patch.c +++ b/usr.bin/patch/patch.c @@ -1,4 +1,4 @@ -/* $OpenBSD: patch.c,v 1.16 2003/04/05 17:17:53 deraadt Exp $ */ +/* $OpenBSD: patch.c,v 1.17 2003/07/02 00:21:16 avsm Exp $ */ /* patch - a program to apply diffs to original files * @@ -27,7 +27,7 @@ */ #ifndef lint -static char rcsid[] = "$OpenBSD: patch.c,v 1.16 2003/04/05 17:17:53 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: patch.c,v 1.17 2003/07/02 00:21:16 avsm Exp $"; #endif /* not lint */ #include "INTERN.h" @@ -102,25 +102,25 @@ char **argv; tmpdir = "/tmp"; } - if (asprintf(&TMPOUTNAME, "%s/patchoXXXXXX", tmpdir) == -1) + if (asprintf(&TMPOUTNAME, "%s/patchoXXXXXXXXXX", tmpdir) == -1) fatal1("cannot allocate memory"); if ((i = mkstemp(TMPOUTNAME)) < 0) pfatal2("can't create %s", TMPOUTNAME); Close(i); - if (asprintf(&TMPINNAME, "%s/patchiXXXXXX", tmpdir) == -1) + if (asprintf(&TMPINNAME, "%s/patchiXXXXXXXXXX", tmpdir) == -1) fatal1("cannot allocate memory"); if ((i = mkstemp(TMPINNAME)) < 0) pfatal2("can't create %s", TMPINNAME); Close(i); - if (asprintf(&TMPREJNAME, "%s/patchrXXXXXX", tmpdir) == -1) + if (asprintf(&TMPREJNAME, "%s/patchrXXXXXXXXXX", tmpdir) == -1) fatal1("cannot allocate memory"); if ((i = mkstemp(TMPREJNAME)) < 0) pfatal2("can't create %s", TMPREJNAME); Close(i); - if (asprintf(&TMPPATNAME, "%s/patchpXXXXXX", tmpdir) == -1) + if (asprintf(&TMPPATNAME, "%s/patchpXXXXXXXXXX", tmpdir) == -1) fatal1("cannot allocate memory"); if ((i = mkstemp(TMPPATNAME)) < 0) pfatal2("can't create %s", TMPPATNAME); diff --git a/usr.bin/rwall/rwall.c b/usr.bin/rwall/rwall.c index 391f8bdafec..89a1eb6a677 100644 --- a/usr.bin/rwall/rwall.c +++ b/usr.bin/rwall/rwall.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rwall.c,v 1.8 2003/06/10 22:20:50 deraadt Exp $ */ +/* $OpenBSD: rwall.c,v 1.9 2003/07/02 00:21:16 avsm Exp $ */ /* * Copyright (c) 1993 Christopher G. Demetriou @@ -38,7 +38,7 @@ char copyright[] = #ifndef lint /*static char sccsid[] = "from: @(#)wall.c 5.14 (Berkeley) 3/2/91";*/ -static char rcsid[] = "$OpenBSD: rwall.c,v 1.8 2003/06/10 22:20:50 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: rwall.c,v 1.9 2003/07/02 00:21:16 avsm Exp $"; #endif /* not lint */ /* @@ -119,7 +119,7 @@ makemsg(char *fname) int fd; char *whom, hostname[MAXHOSTNAMELEN], lbuf[100], tmpname[MAXPATHLEN]; - snprintf(tmpname, sizeof(tmpname), "%s/wall.XXXXXX", _PATH_TMP); + snprintf(tmpname, sizeof(tmpname), "%s/wall.XXXXXXXXXX", _PATH_TMP); if ((fd = mkstemp(tmpname)) == -1 || !(fp = fdopen(fd, "r+"))) { (void)fprintf(stderr, "wall: can't open temporary file.\n"); exit(1); diff --git a/usr.bin/tic/tic.c b/usr.bin/tic/tic.c index 6dc473b45b9..cea4446dab4 100644 --- a/usr.bin/tic/tic.c +++ b/usr.bin/tic/tic.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tic.c,v 1.26 2003/04/14 03:35:10 deraadt Exp $ */ +/* $OpenBSD: tic.c,v 1.27 2003/07/02 00:21:16 avsm Exp $ */ /**************************************************************************** * Copyright (c) 1998,1999,2000,2001 Free Software Foundation, Inc. * @@ -599,7 +599,7 @@ main(int argc, char *argv[]) source_file = "/usr/share/misc/termcap"; if ((termcap = getenv("TERMCAP")) != 0 && (namelst = make_namelist(getenv("TERM"))) != 0) { - strlcpy(my_tmpname, "/tmp/XXXXXX", sizeof my_tmpname); + strlcpy(my_tmpname, "/tmp/XXXXXXXXXX", sizeof my_tmpname); if (access(termcap, F_OK) == 0) { /* file exists */ source_file = termcap; diff --git a/usr.bin/vi/common/exf.c b/usr.bin/vi/common/exf.c index 1e7e1d608a4..f26a46b58a1 100644 --- a/usr.bin/vi/common/exf.c +++ b/usr.bin/vi/common/exf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: exf.c,v 1.17 2002/02/19 00:06:34 ericj Exp $ */ +/* $OpenBSD: exf.c,v 1.18 2003/07/02 00:21:16 avsm Exp $ */ /*- * Copyright (c) 1992, 1993, 1994 @@ -193,7 +193,7 @@ file_init(sp, frp, rcv_name, flags) if (opts_empty(sp, O_DIRECTORY, 0)) goto err; (void)snprintf(tname, sizeof(tname), - "%s/vi.XXXXXX", O_STR(sp, O_DIRECTORY)); + "%s/vi.XXXXXXXXXX", O_STR(sp, O_DIRECTORY)); fd = mkstemp(tname); if (fd == -1 || fchmod(fd, S_IRUSR | S_IWUSR) == -1) { msgq(sp, M_SYSERR, diff --git a/usr.bin/vi/common/recover.c b/usr.bin/vi/common/recover.c index 588022c1372..82375b21283 100644 --- a/usr.bin/vi/common/recover.c +++ b/usr.bin/vi/common/recover.c @@ -1,4 +1,4 @@ -/* $OpenBSD: recover.c,v 1.8 2002/02/16 21:27:57 millert Exp $ */ +/* $OpenBSD: recover.c,v 1.9 2003/07/02 00:21:16 avsm Exp $ */ /*- * Copyright (c) 1993, 1994 @@ -163,7 +163,7 @@ rcv_tmp(sp, ep, name) goto err; } - (void)snprintf(path, sizeof(path), "%s/vi.XXXXXX", dp); + (void)snprintf(path, sizeof(path), "%s/vi.XXXXXXXXXX", dp); if ((fd = rcv_mktemp(sp, path, dp, S_IRWXU)) == -1) goto err; (void)close(fd); @@ -300,7 +300,7 @@ rcv_sync(sp, flags) if (opts_empty(sp, O_RECDIR, 0)) goto err; dp = O_STR(sp, O_RECDIR); - (void)snprintf(buf, sizeof(buf), "%s/vi.XXXXXX", dp); + (void)snprintf(buf, sizeof(buf), "%s/vi.XXXXXXXXXX", dp); if ((fd = rcv_mktemp(sp, buf, dp, S_IRUSR | S_IWUSR)) == -1) goto err; sp->gp->scr_busy(sp, @@ -364,7 +364,7 @@ rcv_mailfile(sp, issync, cp_path) if (opts_empty(sp, O_RECDIR, 0)) return (1); dp = O_STR(sp, O_RECDIR); - (void)snprintf(mpath, sizeof(mpath), "%s/recover.XXXXXX", dp); + (void)snprintf(mpath, sizeof(mpath), "%s/recover.XXXXXXXXXX", dp); if ((fd = rcv_mktemp(sp, mpath, dp, S_IRUSR | S_IWUSR)) == -1) return (1); diff --git a/usr.bin/wall/wall.c b/usr.bin/wall/wall.c index d0d3c7ff823..73d9101b92c 100644 --- a/usr.bin/wall/wall.c +++ b/usr.bin/wall/wall.c @@ -1,4 +1,4 @@ -/* $OpenBSD: wall.c,v 1.19 2003/06/25 21:09:53 deraadt Exp $ */ +/* $OpenBSD: wall.c,v 1.20 2003/07/02 00:21:17 avsm Exp $ */ /* $NetBSD: wall.c,v 1.6 1994/11/17 07:17:58 jtc Exp $ */ /* @@ -40,7 +40,7 @@ static const char copyright[] = #if 0 static const char sccsid[] = "@(#)wall.c 8.2 (Berkeley) 11/16/93"; #endif -static const char rcsid[] = "$OpenBSD: wall.c,v 1.19 2003/06/25 21:09:53 deraadt Exp $"; +static const char rcsid[] = "$OpenBSD: wall.c,v 1.20 2003/07/02 00:21:17 avsm Exp $"; #endif /* not lint */ /* @@ -166,7 +166,7 @@ makemsg(char *fname) char tmpbuf[5]; char *ttynam; - snprintf(tmpname, sizeof(tmpname), "%s/wall.XXXXXX", _PATH_TMP); + snprintf(tmpname, sizeof(tmpname), "%s/wall.XXXXXXXXXX", _PATH_TMP); if ((fd = mkstemp(tmpname)) >= 0) { (void)unlink(tmpname); fp = fdopen(fd, "r+"); diff --git a/usr.bin/xinstall/xinstall.c b/usr.bin/xinstall/xinstall.c index 61fe0cb9096..564a12de1d5 100644 --- a/usr.bin/xinstall/xinstall.c +++ b/usr.bin/xinstall/xinstall.c @@ -1,4 +1,4 @@ -/* $OpenBSD: xinstall.c,v 1.35 2003/06/10 22:20:54 deraadt Exp $ */ +/* $OpenBSD: xinstall.c,v 1.36 2003/07/02 00:21:17 avsm Exp $ */ /* $NetBSD: xinstall.c,v 1.9 1995/12/20 10:25:17 jonathan Exp $ */ /* @@ -40,7 +40,7 @@ static char copyright[] = #if 0 static char sccsid[] = "@(#)xinstall.c 8.1 (Berkeley) 7/21/93"; #endif -static char rcsid[] = "$OpenBSD: xinstall.c,v 1.35 2003/06/10 22:20:54 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: xinstall.c,v 1.36 2003/07/02 00:21:17 avsm Exp $"; #endif /* not lint */ #include @@ -617,7 +617,7 @@ create_tempfile(char *path, char *temp, size_t tsize) p++; else p = temp; - (void)strncpy(p, "INS@XXXXXX", &temp[tsize - 1] - p); + (void)strncpy(p, "INS@XXXXXXXXXX", &temp[tsize - 1] - p); temp[tsize - 1] = '\0'; return(mkstemp(temp)); diff --git a/usr.bin/xstr/pathnames.h b/usr.bin/xstr/pathnames.h index 86d66fa187f..584b5cc64d0 100644 --- a/usr.bin/xstr/pathnames.h +++ b/usr.bin/xstr/pathnames.h @@ -1,4 +1,4 @@ -/* $OpenBSD: pathnames.h,v 1.4 2003/06/03 02:56:24 millert Exp $ */ +/* $OpenBSD: pathnames.h,v 1.5 2003/07/02 00:21:17 avsm Exp $ */ /* $NetBSD: pathnames.h,v 1.3 1994/11/14 04:56:22 jtc Exp $ */ /* @@ -32,4 +32,4 @@ * @(#)pathnames.h 8.1 (Berkeley) 6/9/93 */ -#define _PATH_TMPFILE "/tmp/xstrXXXXXX" +#define _PATH_TMPFILE "/tmp/xstrXXXXXXXXXX" -- cgit v1.2.3