[PATCH 2/2] posix: Improve randomness on try_tempname_len

Paul Eggert eggert@cs.ucla.edu
Tue Jan 12 01:06:42 GMT 2021


On 1/11/21 4:29 AM, Adhemerval Zanella wrote:

> The idea is to always issue getrandom for __GT_DIR or __GT_FILE on first try,
> as you suggested initially [1].  I followed your idea [2]:... > [1] 
https://sourceware.org/pipermail/libc-alpha/2020-September/117535.html
> [2] https://sourceware.org/pipermail/libc-alpha/2020-September/117539.html

Ah, thanks, I'd forgotten about that conversation.

I looked at the patch 
<https://sourceware.org/pipermail/libc-alpha/2021-January/121302.html> 
again. A couple of small things. First, it uses bool so needs to include 
stdbool.h. Second, the generated code's a bit smaller if we call 
random_bits only once. I added those two changes and installed the 
attached patch to Gnulib master on savannah, with the idea being that 
Gnulib's tempname.c can be identical to glibc's.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-tempname-consume-less-entropy.patch
Type: text/x-patch
Size: 3481 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/libc-alpha/attachments/20210111/a10d12bd/attachment.bin>


More information about the Libc-alpha mailing list