On 1/4/21 9:03 AM, Adhemerval Zanella wrote: > For __GT_NOCREATE (mktemp, tempnam, tmpnam) getrandom is also used > on first try, otherwise randomness is obtained using the clock plus > a linear congruential generator. Why not use getrandom in the first try also for __GT_DIR (mkdtemp) and __GT_FILE (mkostemp, mkostemps, mkstemp, mkstemps, tmpfile)? That is what Gnulib tempname.c is doing now. This not only simplifies the code, it improves resistance to some (admittedly less-likely) attacks. > Also for getrandom GRND_NONBLOCK is used to avoid blocking indefinitely > on some older kernels. Thanks, I installed that part of the proposal into Gnulib by installing the attached. The idea is for tempname.c to be identical after we get the abovementioned issue worked out.