posix: consume less entropy on tempname
authorAdhemerval Zanella <adhemerval.zanella@linaro.org>
Tue, 12 Jan 2021 12:17:09 +0000 (09:17 -0300)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Tue, 12 Jan 2021 12:50:54 +0000 (09:50 -0300)
commitf430293d842031f2afc3013f156e1018065e480e
tree0d2f41076707b5b25b41124ba169e0a7dab0a542
parent0400f928335a5e04c788e1c831d8825d42612c49
posix: consume less entropy on tempname

The first getrandom is used only for __GT_NOCREATE, which is inherently
insecure and can use the entropy as a small improvement.  On the
second and later attempts it might help against DoS attacks.

It sync with gnulib commit 854fbb81d91f7a0f2b463e7ace2499dee2f380f2.

Checked on x86_64-linux-gnu.
sysdeps/posix/tempname.c