From 7343ce4730e6e11382b8d1f2d510fee8ca13cc57 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Thu, 16 Jan 2025 15:56:08 +0100 Subject: [PATCH] RHE:-9.6: 2.37.4-21 (sulogin, last) Resolves: RHEL-56354 RHEL-56983 --- ...s-parse_timestamp-fix-second-parsing.patch | 35 +++++++++++++ 0082-sulogin-fix-POSIX-locale-use.patch | 49 +++++++++++++++++++ util-linux.spec | 13 ++++- 3 files changed, 96 insertions(+), 1 deletion(-) create mode 100644 0081-lib-timeutils-parse_timestamp-fix-second-parsing.patch create mode 100644 0082-sulogin-fix-POSIX-locale-use.patch diff --git a/0081-lib-timeutils-parse_timestamp-fix-second-parsing.patch b/0081-lib-timeutils-parse_timestamp-fix-second-parsing.patch new file mode 100644 index 0000000..b8ef564 --- /dev/null +++ b/0081-lib-timeutils-parse_timestamp-fix-second-parsing.patch @@ -0,0 +1,35 @@ +From e851e4519f7ef21690cb300b4c229527502255a3 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= +Date: Fri, 20 Jan 2023 02:43:34 +0000 +Subject: lib/timeutils: parse_timestamp: fix second parsing +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Upstream: http://github.com/util-linux/util-linux/commit/2abb8394fa89303b21003bd8252e52751c07f08c +Addresses: https://issues.redhat.com/browse/RHEL-56354 +Signed-off-by: Thomas Weißschuh +Signed-off-by: Karel Zak +--- + lib/timeutils.c | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +diff --git a/lib/timeutils.c b/lib/timeutils.c +index 2e28ada8b..7ce727276 100644 +--- a/lib/timeutils.c ++++ b/lib/timeutils.c +@@ -320,10 +320,8 @@ int parse_timestamp(const char *t, usec_t *usec) + + tm = copy; + k = strptime(t, "%Y%m%d%H%M%S", &tm); +- if (k && *k == 0) { +- tm.tm_sec = 0; ++ if (k && *k == 0) + goto finish; +- } + + return -EINVAL; + +-- +2.47.1 + diff --git a/0082-sulogin-fix-POSIX-locale-use.patch b/0082-sulogin-fix-POSIX-locale-use.patch new file mode 100644 index 0000000..d1030fc --- /dev/null +++ b/0082-sulogin-fix-POSIX-locale-use.patch @@ -0,0 +1,49 @@ +From cc3d82a17b5ef7e55d67c2b9b369e7de97a20f43 Mon Sep 17 00:00:00 2001 +From: Karel Zak +Date: Thu, 16 Jan 2025 13:14:43 +0100 +Subject: 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 +--- + login-utils/sulogin.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/login-utils/sulogin.c b/login-utils/sulogin.c +index 4d48943ad..89e369b5c 100644 +--- a/login-utils/sulogin.c ++++ b/login-utils/sulogin.c +@@ -185,6 +185,7 @@ static void tcinit(struct console *con) + } + + setlocale(LC_CTYPE, "POSIX"); ++ setlocale(LC_MESSAGES, "POSIX"); + goto setattr; + } + #if defined(IUTF8) && defined(KDGKBMODE) +@@ -199,10 +200,12 @@ static void tcinit(struct console *con) + case K_XLATE: + default: + setlocale(LC_CTYPE, "POSIX"); ++ setlocale(LC_MESSAGES, "POSIX"); + break; + } + #else + setlocale(LC_CTYPE, "POSIX"); ++ setlocale(LC_MESSAGES, "POSIX"); + #endif + reset_virtual_console(tio, flags); + setattr: +-- +2.47.1 + diff --git a/util-linux.spec b/util-linux.spec index 9ff1aad..ddccaa5 100644 --- a/util-linux.spec +++ b/util-linux.spec @@ -2,7 +2,7 @@ Summary: A collection of basic system utilities Name: util-linux Version: 2.37.4 -Release: 20%{?dist} +Release: 21%{?dist} License: GPLv2 and GPLv2+ and LGPLv2+ and BSD with advertising and Public Domain URL: http://en.wikipedia.org/wiki/Util-linux @@ -229,6 +229,13 @@ Patch78: 0078-libblkid-Check-offset-in-LUKS2-header.patch Patch79: 0079-more-fix-poll-use.patch Patch80: 0080-more-make-sure-we-have-data-on-stderr.patch +### RHEL-9.6 +# +# RHEL-56354 - lib/timeutils: parse_timestamp: fix second parsing +Patch81: 0081-lib-timeutils-parse_timestamp-fix-second-parsing.patch +# RHEL-56983 - sulogin: fix POSIX locale use +Patch82: 0082-sulogin-fix-POSIX-locale-use.patch + %description The util-linux package contains a large variety of low-level system @@ -1063,6 +1070,10 @@ fi %{_libdir}/python*/site-packages/libmount/ %changelog +* Thu Jan 16 2025 Karel Zak 2.37.4-21 +- fix RHEL-56354 - lib/timeutils: parse_timestamp: fix second parsing +- fix RHEL-56983 - sulogin: fix POSIX locale use + * Thu Aug 22 2024 Karel Zak 2.37.4-20 - fix RHEL-25559 - more: make sure we have data on stderr