]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Fix missing randomness in __gen_tempname (bug 32214)
authorAndreas Schwab <schwab@suse.de>
Wed, 25 Sep 2024 09:49:30 +0000 (11:49 +0200)
committerFlorian Weimer <fweimer@redhat.com>
Mon, 20 Jan 2025 07:06:47 +0000 (08:06 +0100)
Make sure to update the random value also if getrandom fails.

Fixes: 686d542025 ("posix: Sync tempname with gnulib")
(cherry picked from commit 5f62cf88c4530c11904482775b7582bd7f6d80d2)

NEWS
sysdeps/posix/tempname.c

diff --git a/NEWS b/NEWS
index 97a1e1f5d4902dc7803192e4da0e48c2794e2e8c..57feba81cd85236f5a15f6dd0c9ca77152b1a8be 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -18,6 +18,7 @@ The following bugs are resolved with this release:
   [32026] strerror/strsignal TLS not handled correctly for secondary namespaces
   [32052] Name space violation in fortify wrappers
   [32137] libio: Attempt wide backup free only for non-legacy code
+  [32214] Fix missing randomness in __gen_tempname
   [32231] elf: Change ldconfig auxcache magic number
   [32245] glibc -Wstringop-overflow= build failure on hppa
   [32470] x86: Avoid integer truncation with large cache sizes
index c00fe0c18110fef74495e9cd3155a97775350d5a..fc30958a0cb24dc4d62b2d831ee7f8b7e07c1961 100644 (file)
@@ -117,6 +117,8 @@ random_bits (random_value *r, random_value s)
      succeed.  */
 #if !_LIBC
   *r = mix_random_values (v, clock ());
+#else
+  *r = v;
 #endif
   return false;
 }