From 98839c40c74aed19324962c365ebc2cb8520f91e Mon Sep 17 00:00:00 2001 From: Wolfram Schneider Date: Sat, 12 Feb 2022 11:35:51 +0000 Subject: [PATCH] better unique file names Our mktemp(1) implementation uses 8-X for a temp file by default. That's ok, but we should increase the value from 8 to 10 as many other OS already did. PR: 261438 --- usr.bin/mktemp/mktemp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/usr.bin/mktemp/mktemp.c b/usr.bin/mktemp/mktemp.c index 0b320e8c5c85..754cc8da7e4e 100644 --- a/usr.bin/mktemp/mktemp.c +++ b/usr.bin/mktemp/mktemp.c @@ -97,9 +97,9 @@ main(int argc, char **argv) if (tflag) { tmpdir = getenv("TMPDIR"); if (tmpdir == NULL) - asprintf(&name, "%s%s.XXXXXXXX", _PATH_TMP, prefix); + asprintf(&name, "%s%s.XXXXXXXXXX", _PATH_TMP, prefix); else - asprintf(&name, "%s/%s.XXXXXXXX", tmpdir, prefix); + asprintf(&name, "%s/%s.XXXXXXXXXX", tmpdir, prefix); /* if this fails, the program is in big trouble already */ if (name == NULL) { if (qflag)