From: Andreas Schwab Date: Wed, 25 Sep 2024 09:49:30 +0000 (+0200) Subject: Fix missing randomness in __gen_tempname (bug 32214) X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=473597d8167f86afee3544215db108b170ec13c0;p=thirdparty%2Fglibc.git Fix missing randomness in __gen_tempname (bug 32214) Make sure to update the random value also if getrandom fails. Fixes: 686d542025 ("posix: Sync tempname with gnulib") (cherry picked from commit 5f62cf88c4530c11904482775b7582bd7f6d80d2) --- diff --git a/NEWS b/NEWS index 97a1e1f5d4..57feba81cd 100644 --- 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 diff --git a/sysdeps/posix/tempname.c b/sysdeps/posix/tempname.c index c00fe0c181..fc30958a0c 100644 --- a/sysdeps/posix/tempname.c +++ b/sysdeps/posix/tempname.c @@ -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; }