From a5eed39a76e257e4a257ddce89a1bff3618fc12a Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Tue, 24 Mar 2026 01:32:59 +0000 Subject: lib/mkhtemp.c: use standard suffix it may seem counterintuitive that a shorter suffix is better, but i think we should ideally look just like what is made my any other tool, and other mktemp tools generate: tmp.XXXXXXXXXX this is the default, but of course it could be changed. Signed-off-by: Leah Rowe --- util/libreboot-utils/lib/mkhtemp.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'util/libreboot-utils') diff --git a/util/libreboot-utils/lib/mkhtemp.c b/util/libreboot-utils/lib/mkhtemp.c index 7c2f1fde..8d58dcc5 100644 --- a/util/libreboot-utils/lib/mkhtemp.c +++ b/util/libreboot-utils/lib/mkhtemp.c @@ -50,8 +50,7 @@ new_tmp_common(int *fd, char **path, int type) #endif struct stat st; - char suffix[] = - "tmpXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"; + char suffix[] = "tmp.XXXXXXXXXX"; char *tmpdir = NULL; int close_errno; @@ -582,7 +581,7 @@ mkhtemp(int *fd, while (end > template && *--end == 'X') xc++; - if (xc < 12 || xc > len) { + if (xc < 6 || xc > len) { errno = EINVAL; return -1; } -- cgit v1.2.1