Go to file
Carlos O'Donell 684fbab755 locale: Handle loading a missing locale twice (Bug 14247)
Delay setting file->decided until the data has been successfully loaded
by _nl_load_locale().  If the function fails to load the data then we
must return and error and leave decided untouched to allow the caller to
attempt to load the data again at a later time.  We should not set
decided to 1 early in the function since doing so may prevent attempting
to load it again. We want to try loading it again because that allows an
open to fail and set errno correctly.

On the other side of this problem is that if we are called again with
the same inputs we will fetch the cached version of the object and carry
out no open syscalls and that fails to set errno so we must set errno to
ENOENT in that case.  There is a second code path that has to be handled
where the name of the locale matches but the codeset doesn't match.

These changes ensure that errno is correctly set on failure in all the
return paths in _nl_find_locale().

Adds tst-locale-loadlocale to cover the bug.

No regressions on x86_64.

Co-authored-by: Jeff Law <law@redhat.com>
Reviewed-by: Adhemerval Zanella  <adhemerval.zanella@linaro.org>
2024-04-22 16:03:00 -04:00
advisories advisories: Add Reported-By 2024-04-18 08:52:46 -04:00
argp
assert
benchtests benchtests: Add random() benchmark 2024-04-18 14:30:21 +01:00
bits login: Use unsigned 32-bit types for seconds-since-epoch 2024-04-19 14:38:17 +02:00
catgets
ChangeLog.old
conform
csu
ctype
debug
dirent
dlfcn
elf elf: Do not check for loader mmap on tst-decorate-maps (BZ 31553) 2024-04-22 15:39:48 -03:00
gmon
gnulib
hesiod
htl htl: Implement some support for TLS_DTV_AT_TP 2024-03-23 23:00:30 +01:00
hurd hurd: Stop relying on VM_MAX_ADDRESS 2024-03-23 22:44:02 +01:00
iconv
iconvdata iconv: ISO-2022-CN-EXT: fix out-of-bound writes when writing escape sequence (CVE-2024-2961) 2024-04-17 09:21:40 -03:00
include posix: Sync tempname with gnulib 2024-04-10 14:53:39 -03:00
inet
intl
io Always define __USE_TIME_BITS64 when 64 bit time_t is used 2024-04-02 15:28:36 -03:00
libio posix: Sync tempname with gnulib 2024-04-10 14:53:39 -03:00
locale locale: Handle loading a missing locale twice (Bug 14247) 2024-04-22 16:03:00 -04:00
localedata locale: Handle loading a missing locale twice (Bug 14247) 2024-04-22 16:03:00 -04:00
login login: Use unsigned 32-bit types for seconds-since-epoch 2024-04-19 14:38:17 +02:00
mach
malloc
manual aarch64: Enhanced CPU diagnostics for ld.so 2024-04-08 16:48:55 +02:00
math math: x86 trunc traps when FE_INEXACT is enabled (BZ 31603) 2024-04-04 14:29:28 -03:00
mathvec
misc misc: Add support for Linux uio.h RWF_NOAPPEND flag 2024-04-04 09:41:27 +01:00
nis
nptl nptl: Add tst-pthread-key1-static for BZ #21777 2024-04-09 05:27:03 -07:00
nptl_db
nscd
nss
po
posix Always define __USE_TIME_BITS64 when 64 bit time_t is used 2024-04-02 15:28:36 -03:00
resolv Always define __USE_TIME_BITS64 when 64 bit time_t is used 2024-04-02 15:28:36 -03:00
resource Always define __USE_TIME_BITS64 when 64 bit time_t is used 2024-04-02 15:28:36 -03:00
rt Always define __USE_TIME_BITS64 when 64 bit time_t is used 2024-04-02 15:28:36 -03:00
scripts Use --enable-obsolete in build-many-glibcs.py for nios2-linux-gnu 2024-04-19 17:03:56 +00:00
setjmp
signal Always define __USE_TIME_BITS64 when 64 bit time_t is used 2024-04-02 15:28:36 -03:00
socket socket: Add new test for connect 2024-04-10 18:10:22 +02:00
soft-fp
stdio-common posix: Sync tempname with gnulib 2024-04-10 14:53:39 -03:00
stdlib stdlib: Fix tst-makecontext2 log when swapcontext fails 2024-03-23 08:36:28 +00:00
string wcsmbs: Ensure wcstr worst-case linear execution time (BZ 23865) 2024-04-11 14:21:32 -03:00
sunrpc
support libsupport: Add xgetpeername 2024-04-10 18:10:22 +02:00
sysdeps login: Use unsigned 32-bit types for seconds-since-epoch 2024-04-19 14:38:17 +02:00
sysvipc Always define __USE_TIME_BITS64 when 64 bit time_t is used 2024-04-02 15:28:36 -03:00
termios
time Always define __USE_TIME_BITS64 when 64 bit time_t is used 2024-04-02 15:28:36 -03:00
timezone timezone: sync to TZDB 2024a 2024-04-07 13:35:48 -07:00
wcsmbs wcsmbs: Ensure wcstr worst-case linear execution time (BZ 23865) 2024-04-11 14:21:32 -03:00
wctype
.clang-format
.gitattributes
.gitignore
abi-tags
aclocal.m4
config.h.in timezone: sync to TZDB 2024a 2024-04-07 13:35:48 -07:00
config.make.in
configure elf: Enable TLS descriptor tests on aarch64 2024-03-19 14:53:30 -03:00
configure.ac elf: Enable TLS descriptor tests on aarch64 2024-03-19 14:53:30 -03:00
CONTRIBUTED-BY
COPYING
COPYING.LIB
extra-lib.mk
gen-locales.mk locale: Handle loading a missing locale twice (Bug 14247) 2024-04-22 16:03:00 -04:00
INSTALL
libc-abis
libof-iterator.mk
LICENSES
MAINTAINERS
Makeconfig Use crtbeginT.o and crtend.o for non-PIE static executables 2024-04-08 09:25:36 -07:00
Makefile
Makefile.help
Makefile.in
Makerules
NEWS login: Use unsigned 32-bit types for seconds-since-epoch 2024-04-19 14:38:17 +02:00
o-iterator.mk
README
Rules
SECURITY.md
SHARED-FILES posix: Sync tempname with gnulib 2024-04-10 14:53:39 -03:00
shlib-versions
test-skeleton.c
version.h

This directory contains the sources of the GNU C Library.
See the file "version.h" for what release version you have.

The GNU C Library is the standard system C library for all GNU systems,
and is an important part of what makes up a GNU system.  It provides the
system API for all programs written in C and C-compatible languages such
as C++ and Objective C; the runtime facilities of other programming
languages use the C library to access the underlying operating system.

In GNU/Linux systems, the C library works with the Linux kernel to
implement the operating system behavior seen by user applications.
In GNU/Hurd systems, it works with a microkernel and Hurd servers.

The GNU C Library implements much of the POSIX.1 functionality in the
GNU/Hurd system, using configurations i[4567]86-*-gnu and x86_64-gnu.

When working with Linux kernels, this version of the GNU C Library
requires Linux kernel version 3.2 or later.

Also note that the shared version of the libgcc_s library must be
installed for the pthread library to work correctly.

The GNU C Library supports these configurations for using Linux kernels:

	aarch64*-*-linux-gnu
	alpha*-*-linux-gnu
	arc*-*-linux-gnu
	arm-*-linux-gnueabi
	csky-*-linux-gnuabiv2
	hppa-*-linux-gnu
	i[4567]86-*-linux-gnu
	x86_64-*-linux-gnu	Can build either x86_64 or x32
	loongarch64-*-linux-gnu Hardware floating point, LE only.
	m68k-*-linux-gnu
	microblaze*-*-linux-gnu
	mips-*-linux-gnu
	mips64-*-linux-gnu
	or1k-*-linux-gnu
	powerpc-*-linux-gnu	Hardware or software floating point, BE only.
	powerpc64*-*-linux-gnu	Big-endian and little-endian.
	s390-*-linux-gnu
	s390x-*-linux-gnu
	riscv32-*-linux-gnu
	riscv64-*-linux-gnu
	sh[34]-*-linux-gnu
	sparc*-*-linux-gnu
	sparc64*-*-linux-gnu

If you are interested in doing a port, please contact the glibc
maintainers; see https://www.gnu.org/software/libc/ for more
information.

See the file INSTALL to find out how to configure, build, and install
the GNU C Library.  You might also consider reading the WWW pages for
the C library at https://www.gnu.org/software/libc/.

The GNU C Library is (almost) completely documented by the Texinfo manual
found in the `manual/' subdirectory.  The manual is still being updated
and contains some known errors and omissions; we regret that we do not
have the resources to work on the manual as much as we would like.  For
corrections to the manual, please file a bug in the `manual' component,
following the bug-reporting instructions below.  Please be sure to check
the manual in the current development sources to see if your problem has
already been corrected.

Please see https://www.gnu.org/software/libc/bugs.html for bug reporting
information.  We are now using the Bugzilla system to track all bug reports.
This web page gives detailed information on how to report bugs properly.

The GNU C Library is free software.  See the file COPYING.LIB for copying
conditions, and LICENSES for notices about a few contributions that require
these additional notices to be distributed.  License copyright years may be
listed using range notation, e.g., 1996-2015, indicating that every year in
the range, inclusive, is a copyrightable year that would otherwise be listed
individually.