Paul Eggert wrote: > I do see a comment saying that gen_tempname generates "hard-to-predict" > names, which as you note is not correct on MS-DOS, nor even strictly > speaking on all POSIX platforms. I installed the first attached patch > into Gnulib to fix that comment.
Another comment fix is as below. Note that both comment fixes need to be propagated to glibc. 2022-08-15 Bruno Haible <br...@clisp.org> tempname: Fix a comment. * lib/tempname.c (try_tempname_len): Use of entropy makes the function more, not less, secure. diff --git a/lib/tempname.c b/lib/tempname.c index 75a939e571..e6520191d7 100644 --- a/lib/tempname.c +++ b/lib/tempname.c @@ -273,7 +273,7 @@ try_tempname_len (char *tmpl, int suffixlen, void *args, /* Whether to consume entropy when acquiring random bits. On the first try it's worth the entropy cost with __GT_NOCREATE, which is inherently insecure and can use the entropy to make it a bit - less secure. On the (rare) second and later attempts it might + more secure. On the (rare) second and later attempts it might help against DoS attacks. */ bool use_getrandom = tryfunc == try_nocreate;