]> git.ipfire.org Git - thirdparty/util-linux.git/commit
sulogin: fix POSIX locale use
authorKarel Zak <kzak@redhat.com>
Thu, 16 Jan 2025 12:14:43 +0000 (13:14 +0100)
committerKarel Zak <kzak@redhat.com>
Thu, 16 Jan 2025 12:14:43 +0000 (13:14 +0100)
commitaa11f9a2e163a57455255b03a03bf841cbf5be72
tree2c862a174c01bbd15356dd5902abe9b28792f479
parent23901d227c6e948a9f3a413a5f3e0ca41bc8f8fa
sulogin: fix POSIX locale use

In some cases, sulogin can set LC_CTYPE="POSIX" while retaining the
original LC_MESSAGES. In this scenario, the gettext() function may not
work as intended and sulogin returns "???" (for example for
ja_JP.UTF-8). GNU gettext FAQ:

 This symptom occurs when the LC_CTYPE facet of the locale is not set;
 then gettext() doesn't know which character set to use, and converts
 all messages to ASCII, as far as possible.

Addresses: https://issues.redhat.com/browse/RHEL-56983
Addresses: https://github.com/util-linux/util-linux/issues/2185
Signed-off-by: Karel Zak <kzak@redhat.com>
login-utils/sulogin.c