From ba1905c6c74e0bcf789a2900d2eca23692faa1d6 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Thu, 23 Oct 2025 12:59:14 +0200 Subject: [PATCH 01/18] upgrade to upstream release v2.41.2 --- .gitignore | 1 + 0001-ldattach-add-ifndef-BOTHER.patch | 29 --------------------------- sources | 2 +- util-linux.spec | 7 +++---- 4 files changed, 5 insertions(+), 34 deletions(-) delete mode 100644 0001-ldattach-add-ifndef-BOTHER.patch diff --git a/.gitignore b/.gitignore index 1e5ca15..cdfd72d 100644 --- a/.gitignore +++ b/.gitignore @@ -101,3 +101,4 @@ /util-linux-2.40.4.tar.xz /util-linux-2.41.tar.xz /util-linux-2.41.1.tar.xz +/util-linux-2.41.2.tar.xz diff --git a/0001-ldattach-add-ifndef-BOTHER.patch b/0001-ldattach-add-ifndef-BOTHER.patch deleted file mode 100644 index 602a518..0000000 --- a/0001-ldattach-add-ifndef-BOTHER.patch +++ /dev/null @@ -1,29 +0,0 @@ -From 4d2fc6b99db2f17a2562548af63454134ee910ec Mon Sep 17 00:00:00 2001 -From: Karel Zak -Date: Tue, 24 Jun 2025 11:14:29 +0200 -Subject: [PATCH] ldattach: add ifndef BOTHER - -Signed-off-by: Karel Zak -(cherry picked from commit 5405c3e09057db82ed397e61443effa9614dbc4a) ---- - sys-utils/ldattach.c | 4 +++- - 1 file changed, 3 insertions(+), 1 deletion(-) - -diff --git a/sys-utils/ldattach.c b/sys-utils/ldattach.c -index e06047c71..25903b4eb 100644 ---- a/sys-utils/ldattach.c -+++ b/sys-utils/ldattach.c -@@ -241,7 +241,9 @@ static int my_cfsetspeed(struct termios *ts, int speed) - * checks for speed and supports Bxxx bit rates only)... - */ - #if _HAVE_STRUCT_TERMIOS_C_ISPEED --# define BOTHER 0010000 /* non standard rate */ -+# ifndef BOTHER -+# define BOTHER 0010000 /* non standard rate */ -+# endif - dbg("using non-standard speeds"); - ts->c_ospeed = ts->c_ispeed = speed; - ts->c_cflag &= ~CBAUD; --- -2.49.0 - diff --git a/sources b/sources index 9375746..ce7b5d9 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (util-linux-2.41.1.tar.xz) = 12cf37ab2d62d0378b16a40e0194ef7131ef1ad06737cca3f169cfc04b9da08a4233076c819b30705e8fb2c3b8d91a1d83aac4f036ce58b9cf5928f545e511a2 +SHA512 (util-linux-2.41.2.tar.xz) = 696c87e7cf185acc9b4b969ddade6155ea2945ae494eaecfd7b1f35d9607166cb09be79878fb793dd31b4d4dcac8c9be4be76af3886185db7ae8b58c303fb0cf diff --git a/util-linux.spec b/util-linux.spec index 1c611f7..ea4f5a9 100644 --- a/util-linux.spec +++ b/util-linux.spec @@ -1,7 +1,7 @@ ### Header Summary: Collection of basic system utilities Name: util-linux -Version: 2.41.1 +Version: 2.41.2 # -p -e rc1 Release: %autorelease -b7 License: GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-2.1-or-later AND BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause-UC AND LicenseRef-Fedora-Public-Domain @@ -114,9 +114,6 @@ Patch1: login-default-motd-file.patch # 2367956 - EROFS vs. the latest util-linux and kernel Patch2: 0001-libmount-disable-EROFS-backing-file-support.patch -# Upstream -Patch3: 0001-ldattach-add-ifndef-BOTHER.patch - %description The util-linux package contains a large variety of low-level system utilities that are necessary for a Linux system to function. Among @@ -733,11 +730,13 @@ fi %{compldir}/chcpu %{compldir}/chfn %{compldir}/chmem +%{compldir}/choom %{compldir}/chsh %{compldir}/col %{compldir}/colcrt %{compldir}/colrm %{compldir}/column +%{compldir}/coresched %{compldir}/ctrlaltdel %{compldir}/delpart %{compldir}/eject From 7ef16d92f732410f09ee5fe6a22e033caea7bda5 Mon Sep 17 00:00:00 2001 From: Fxzx micah Date: Tue, 18 Nov 2025 19:22:12 +0000 Subject: [PATCH 02/18] liblastlog2 uses /var/lib/lastlog You can verify it through man pam_lastlog2. --- util-linux.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/util-linux.spec b/util-linux.spec index ea4f5a9..0bc12e2 100644 --- a/util-linux.spec +++ b/util-linux.spec @@ -395,7 +395,7 @@ mkdir -p %{buildroot}%{_sysconfdir}/{pam.d,security/console.apps} # And a dirs that the makefiles don't create install -d %{buildroot}%{_rundir}/uuidd install -d %{buildroot}%{_sharedstatedir}/libuuid -install -d %{buildroot}%{_sharedstatedir}/liblastlog +install -d %{buildroot}%{_sharedstatedir}/lastlog # /etc/adjtime install -m 644 %{SOURCE5} %{buildroot}%{_sysconfdir}/adjtime @@ -969,7 +969,7 @@ fi %files -n liblastlog2 %license Documentation/licenses/COPYING.BSD-2-Clause -%dir %{_sharedstatedir}/liblastlog +%dir %{_sharedstatedir}/lastlog %{_libdir}/liblastlog2.so.* %{_pam_moduledir}/pam_lastlog2.so %{_tmpfilesdir}/lastlog2-tmpfiles.conf From 9c226720cb200a9bac460b0c6f4038b78e6bfe8d Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Tue, 2 Dec 2025 16:37:43 +0100 Subject: [PATCH 03/18] backport upstream patches for GCC-15 - regenerate Fedora patches from the Git tree --- 0000-login-use-O_CREAT-on-lastlog.patch | 27 ++++++++ ...un-motd.d-to-the-hardcoded-MOTD_FILE.patch | 27 ++++++++ ...t-disable-EROFS-backing-file-support.patch | 8 +-- ...lkid-use-snprintf-instead-of-sprintf.patch | 58 ++++++++++++++++ ...x-bsearch-macro-usage-with-glibc-C23.patch | 42 ++++++++++++ ...nst-qualifier-discarded-warnings-in-.patch | 57 ++++++++++++++++ ...fix-const-qualifier-warnings-for-C23.patch | 45 +++++++++++++ ...fix-const-qualifier-warnings-for-C23.patch | 67 +++++++++++++++++++ ...st-qualifier-warning-in-mnt_parse_mo.patch | 54 +++++++++++++++ ...st-qualifier-warning-in-blkid_parse_.patch | 54 +++++++++++++++ ...qualifier-warnings-in-parse_callerid.patch | 34 ++++++++++ ...ualifier-warning-in-new_counter_spec.patch | 34 ++++++++++ ...-const-qualifier-warning-in-strnrstr.patch | 34 ++++++++++ ...fix-const-qualifier-warnings-for-C23.patch | 67 +++++++++++++++++++ ...qualifier-warning-in-readlink_to_nam.patch | 33 +++++++++ ...fix-const-qualifier-warnings-for-C23.patch | 49 ++++++++++++++ ...nst-qualifier-warning-in-parse_block.patch | 33 +++++++++ ...-qualifier-warning-in-get_max_partno.patch | 34 ++++++++++ ...onst-qualifier-warning-in-read_speed.patch | 33 +++++++++ login-default-motd-file.patch | 13 ---- login-lastlog-create.patch | 12 ---- util-linux.spec | 33 ++++++--- 22 files changed, 809 insertions(+), 39 deletions(-) create mode 100644 0000-login-use-O_CREAT-on-lastlog.patch create mode 100644 0001-login-add-run-motd.d-to-the-hardcoded-MOTD_FILE.patch rename 0001-libmount-disable-EROFS-backing-file-support.patch => 0002-libmount-disable-EROFS-backing-file-support.patch (94%) create mode 100644 0003-libblkid-use-snprintf-instead-of-sprintf.patch create mode 100644 0004-lsfd-fix-bsearch-macro-usage-with-glibc-C23.patch create mode 100644 0005-lib-lscpu-fix-const-qualifier-discarded-warnings-in-.patch create mode 100644 0006-lsns-fix-const-qualifier-warnings-for-C23.patch create mode 100644 0007-libmount-fix-const-qualifier-warnings-for-C23.patch create mode 100644 0008-libmount-fix-const-qualifier-warning-in-mnt_parse_mo.patch create mode 100644 0009-libblkid-fix-const-qualifier-warning-in-blkid_parse_.patch create mode 100644 0010-dmesg-fix-const-qualifier-warnings-in-parse_callerid.patch create mode 100644 0011-lsfd-fix-const-qualifier-warning-in-new_counter_spec.patch create mode 100644 0012-lsfd-fix-const-qualifier-warning-in-strnrstr.patch create mode 100644 0013-logger-fix-const-qualifier-warnings-for-C23.patch create mode 100644 0014-namei-fix-const-qualifier-warning-in-readlink_to_nam.patch create mode 100644 0015-whereis-fix-const-qualifier-warnings-for-C23.patch create mode 100644 0016-enosys-fix-const-qualifier-warning-in-parse_block.patch create mode 100644 0017-partx-fix-const-qualifier-warning-in-get_max_partno.patch create mode 100644 0018-eject-fix-const-qualifier-warning-in-read_speed.patch delete mode 100644 login-default-motd-file.patch delete mode 100644 login-lastlog-create.patch diff --git a/0000-login-use-O_CREAT-on-lastlog.patch b/0000-login-use-O_CREAT-on-lastlog.patch new file mode 100644 index 0000000..39751c2 --- /dev/null +++ b/0000-login-use-O_CREAT-on-lastlog.patch @@ -0,0 +1,27 @@ +From a2357184ff3dc3beb001fcb12e1e4c0dcf8d0dbd Mon Sep 17 00:00:00 2001 +From: Karel Zak +Date: Tue, 2 Dec 2025 16:15:44 +0100 +Subject: login: use O_CREAT on lastlog + +Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=151635 +Signed-off-by: Karel Zak +--- + login-utils/login.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/login-utils/login.c b/login-utils/login.c +index 321f9d6ce..edc69fd9a 100644 +--- a/login-utils/login.c ++++ b/login-utils/login.c +@@ -682,7 +682,7 @@ static void log_lastlog(struct login_context *cxt) + sa.sa_handler = SIG_IGN; + sigaction(SIGXFSZ, &sa, &oldsa_xfsz); + +- fd = open(_PATH_LASTLOG, O_RDWR, 0); ++ fd = open(_PATH_LASTLOG, O_RDWR | O_CREAT, 0); + if (fd < 0) + goto done; + offset = cxt->pwd->pw_uid * sizeof(ll); +-- +2.51.1 + diff --git a/0001-login-add-run-motd.d-to-the-hardcoded-MOTD_FILE.patch b/0001-login-add-run-motd.d-to-the-hardcoded-MOTD_FILE.patch new file mode 100644 index 0000000..91d7f5c --- /dev/null +++ b/0001-login-add-run-motd.d-to-the-hardcoded-MOTD_FILE.patch @@ -0,0 +1,27 @@ +From 617a887a6ec7e433f6a9f4c60592ed38b12b9f18 Mon Sep 17 00:00:00 2001 +From: Karel Zak +Date: Tue, 2 Dec 2025 16:17:55 +0100 +Subject: login: add /run/motd.d` to the hardcoded MOTD_FILE + +Addresses: https://github.com/coreos/console-login-helper-messages/issues/60 +Signed-off-by: Karel Zak +--- + include/pathnames.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/include/pathnames.h b/include/pathnames.h +index 34ba11ca3..c91a077e1 100644 +--- a/include/pathnames.h ++++ b/include/pathnames.h +@@ -41,7 +41,7 @@ + #ifndef _PATH_MAILDIR + # define _PATH_MAILDIR "/var/spool/mail" + #endif +-#define _PATH_MOTDFILE "/usr/share/misc/motd:/run/motd:/etc/motd" ++#define _PATH_MOTDFILE "/usr/share/misc/motd:/run/motd:/run/motd.d:/etc/motd:/etc/motd.d" + #ifndef _PATH_NOLOGIN + # define _PATH_NOLOGIN "/etc/nologin" + #endif +-- +2.51.1 + diff --git a/0001-libmount-disable-EROFS-backing-file-support.patch b/0002-libmount-disable-EROFS-backing-file-support.patch similarity index 94% rename from 0001-libmount-disable-EROFS-backing-file-support.patch rename to 0002-libmount-disable-EROFS-backing-file-support.patch index 0735aa6..2cb17a1 100644 --- a/0001-libmount-disable-EROFS-backing-file-support.patch +++ b/0002-libmount-disable-EROFS-backing-file-support.patch @@ -1,7 +1,7 @@ -From 3b1b56c00b34e1d00349349a8a91d0add72ce97b Mon Sep 17 00:00:00 2001 +From 93a62761843ff76187bd542fe717fa0c9b8f73a7 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Tue, 24 Jun 2025 10:56:58 +0200 -Subject: [PATCH] libmount: disable EROFS backing file support +Subject: libmount: disable EROFS backing file support Let's temporarily use the old reliable loop devices rather than directly mounting EROFS images. It seems some tools need to adapt to the change. @@ -14,7 +14,7 @@ Signed-off-by: Karel Zak 2 files changed, 42 deletions(-) diff --git a/libmount/src/context_mount.c b/libmount/src/context_mount.c -index fbb200708..4d6d53194 100644 +index ee3eadb05..e1d06a61e 100644 --- a/libmount/src/context_mount.c +++ b/libmount/src/context_mount.c @@ -961,24 +961,6 @@ int mnt_context_finalize_mount(struct libmnt_context *cxt) @@ -85,5 +85,5 @@ index 444d69d6f..29e181fe8 100644 * prevent a regular file as a mount(2) source argument. A filesystem * that is able to mount regular files could be implemented. For this -- -2.49.0 +2.51.1 diff --git a/0003-libblkid-use-snprintf-instead-of-sprintf.patch b/0003-libblkid-use-snprintf-instead-of-sprintf.patch new file mode 100644 index 0000000..6372a17 --- /dev/null +++ b/0003-libblkid-use-snprintf-instead-of-sprintf.patch @@ -0,0 +1,58 @@ +From 0cd0a9dd42a3249bbbee4855fbc406c4ca5fdd5b Mon Sep 17 00:00:00 2001 +From: Karel Zak +Date: Mon, 6 Oct 2025 15:04:24 +0200 +Subject: libblkid: use snprintf() instead of sprintf() + +Replace sprintf() calls with snprintf() to ensure proper bounds +checking when formatting strings. + +In encode.c, the check now validates snprintf() return value instead +of pre-checking buffer size, providing more robust error handling. + +In probe.c, snprintf() is used with proper size calculation based on +remaining buffer space. + +Signed-off-by: Karel Zak +(cherry picked from commit 041380f4ca7244df624bf7efdb5e27fdd3144175) +(cherry picked from commit 917917253e60b0ba485cf6a27a2f993aa43e1eea) +--- + libblkid/src/encode.c | 6 ++++-- + libblkid/src/probe.c | 4 ++-- + 2 files changed, 6 insertions(+), 4 deletions(-) + +diff --git a/libblkid/src/encode.c b/libblkid/src/encode.c +index 8213873ee..4b83f6690 100644 +--- a/libblkid/src/encode.c ++++ b/libblkid/src/encode.c +@@ -191,9 +191,11 @@ int blkid_encode_string(const char *str, char *str_enc, size_t len) + j += seqlen; + i += (seqlen-1); + } else if (str[i] == '\\' || !is_whitelisted(str[i], NULL)) { +- if (len-j < 4) ++ int rc; ++ ++ rc = snprintf(&str_enc[j], len-j, "\\x%02x", (unsigned char) str[i]); ++ if (rc != 4) + goto err; +- sprintf(&str_enc[j], "\\x%02x", (unsigned char) str[i]); + j += 4; + } else { + if (len-j < 1) +diff --git a/libblkid/src/probe.c b/libblkid/src/probe.c +index 61b93021c..a38f5990e 100644 +--- a/libblkid/src/probe.c ++++ b/libblkid/src/probe.c +@@ -2012,8 +2012,8 @@ static void blkid_probe_log_csum_mismatch(blkid_probe pr, size_t n, const void * + int hex_size = min(sizeof(csum_hex), n * 2); + + for (int i = 0; i < hex_size; i+=2) { +- sprintf(&csum_hex[i], "%02X", ((const unsigned char *) csum)[i / 2]); +- sprintf(&expected_hex[i], "%02X", ((const unsigned char *) expected)[i / 2]); ++ snprintf(&csum_hex[i], sizeof(csum_hex) - i, "%02X", ((const unsigned char *) csum)[i / 2]); ++ snprintf(&expected_hex[i], sizeof(expected_hex) - i, "%02X", ((const unsigned char *) expected)[i / 2]); + } + + DBG(LOWPROBE, ul_debug( +-- +2.51.1 + diff --git a/0004-lsfd-fix-bsearch-macro-usage-with-glibc-C23.patch b/0004-lsfd-fix-bsearch-macro-usage-with-glibc-C23.patch new file mode 100644 index 0000000..c8fb5ea --- /dev/null +++ b/0004-lsfd-fix-bsearch-macro-usage-with-glibc-C23.patch @@ -0,0 +1,42 @@ +From 189960ccca3866461d4ee91c3b7ffb9dac6d0078 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Cristian=20Rodr=C3=ADguez?= +Date: Sat, 22 Nov 2025 10:41:08 -0300 +Subject: lsfd: fix bsearch macro usage with glibc C23 +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +C23 requires bsearch to be a const preserving macro, build now fails +with + +../lsfd-cmd/lsfd.c:1879:75: error: macro ‘bsearch’ passed 6 arguments, but takes just 5 + 1879 | nfds, sizeof(struct pollfd), pollfdcmp)) + | ^ +In file included from ../include/c.h:17, + from ../lsfd-cmd/lsfd.c:48: +/usr/include/stdlib.h:987:10: note: macro ‘bsearch’ defined here + 987 | # define bsearch(KEY, BASE, NMEMB, SIZE, COMPAR) \ + + add parenthesis around expression to fix it. + +(cherry picked from commit 711bda1441561bfd2eb6d45fe0bc789535c1f1a8) +--- + lsfd-cmd/lsfd.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lsfd-cmd/lsfd.c b/lsfd-cmd/lsfd.c +index 75cd1de58..9aae240fc 100644 +--- a/lsfd-cmd/lsfd.c ++++ b/lsfd-cmd/lsfd.c +@@ -1836,7 +1836,7 @@ static void mark_poll_fds_as_multiplexed(char *buf, + struct file *file = list_entry(f, struct file, files); + if (is_opened_file(file) && !file->multiplexed) { + int fd = file->association; +- if (bsearch(&(struct pollfd){.fd = fd,}, local.iov_base, ++ if (bsearch((&(struct pollfd){.fd = fd,}), local.iov_base, + nfds, sizeof(struct pollfd), pollfdcmp)) + file->multiplexed = 1; + } +-- +2.51.1 + diff --git a/0005-lib-lscpu-fix-const-qualifier-discarded-warnings-in-.patch b/0005-lib-lscpu-fix-const-qualifier-discarded-warnings-in-.patch new file mode 100644 index 0000000..a5064b0 --- /dev/null +++ b/0005-lib-lscpu-fix-const-qualifier-discarded-warnings-in-.patch @@ -0,0 +1,57 @@ +From 638055dbe76ca0b3f87bcc0879e5810fadece18c Mon Sep 17 00:00:00 2001 +From: Karel Zak +Date: Thu, 27 Nov 2025 10:27:07 +0100 +Subject: lib, lscpu: fix const qualifier discarded warnings in bsearch + +Fix compilation warnings from newer compilers with stricter +const-correctness checks. When bsearch() searches in const arrays, +the result pointer must also be const to avoid discarding the +const qualifier. + +Fixed in: +- lib/color-names.c: searching in static const basic_schemes[] +- sys-utils/lscpu-cputype.c: searching in const pattern arrays + +The warnings were: + lib/color-names.c:62:13: error: assignment discards 'const' + qualifier from pointer target type + [-Werror=discarded-qualifiers] + +Signed-off-by: Karel Zak +(cherry picked from commit 0cef3e4f5aac19bc3623883ca64c66538aa9b442) +--- + lib/color-names.c | 3 ++- + sys-utils/lscpu-cputype.c | 3 ++- + 2 files changed, 4 insertions(+), 2 deletions(-) + +diff --git a/lib/color-names.c b/lib/color-names.c +index 88c4ef957..daebcedae 100644 +--- a/lib/color-names.c ++++ b/lib/color-names.c +@@ -54,7 +54,8 @@ const char *color_sequence_from_colorname(const char *str) + { "white", UL_COLOR_WHITE }, + { "yellow", UL_COLOR_BOLD_YELLOW } + }; +- struct ul_color_name key = { .name = str }, *res; ++ struct ul_color_name key = { .name = str }; ++ const struct ul_color_name *res; + + if (!str) + return NULL; +diff --git a/sys-utils/lscpu-cputype.c b/sys-utils/lscpu-cputype.c +index 3937a00a8..99b112bf9 100644 +--- a/sys-utils/lscpu-cputype.c ++++ b/sys-utils/lscpu-cputype.c +@@ -444,7 +444,8 @@ static char *key_cleanup(char *str, int *keynum) + + static const struct cpuinfo_pattern *cpuinfo_parse_line(char *str, char **value, int *keynum) + { +- struct cpuinfo_pattern key = { .id = 0 }, *pat; ++ struct cpuinfo_pattern key = { .id = 0 }; ++ const struct cpuinfo_pattern *pat; + char *p, *v; + char buf[CPUTYPE_PATTERN_BUFSZ] = { 0 }; + +-- +2.51.1 + diff --git a/0006-lsns-fix-const-qualifier-warnings-for-C23.patch b/0006-lsns-fix-const-qualifier-warnings-for-C23.patch new file mode 100644 index 0000000..8478b21 --- /dev/null +++ b/0006-lsns-fix-const-qualifier-warnings-for-C23.patch @@ -0,0 +1,45 @@ +From 986936d454b1f9165f5b35196a732db71a8d3b46 Mon Sep 17 00:00:00 2001 +From: Karel Zak +Date: Thu, 27 Nov 2025 15:41:21 +0100 +Subject: lsns: fix const qualifier warnings for C23 + +Fix const qualifier discarded warnings in read_persistent_namespaces() +and is_path_included() functions. These warnings are reported by gcc 15 +which defaults to the C23 standard. + +The strchr() and strstr() functions return pointers into const strings, +so the receiving variables must be declared as const char *. + +Signed-off-by: Karel Zak +(cherry picked from commit dbe4c16973d5d0f69ba3bf1bd8942a51de9a0933) +--- + sys-utils/lsns.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +diff --git a/sys-utils/lsns.c b/sys-utils/lsns.c +index 812afe710..2ee078ac6 100644 +--- a/sys-utils/lsns.c ++++ b/sys-utils/lsns.c +@@ -1003,8 +1003,8 @@ static int read_persistent_namespaces(struct lsns *ls) + struct libmnt_fs *fs = NULL; + + while (mnt_table_next_fs(ls->tab, itr, &fs) == 0) { +- const char *root; +- char *p, *end = NULL; ++ const char *root, *p; ++ char *end = NULL; + ino_t ino; + int fd; + +@@ -1095,7 +1095,7 @@ static int is_path_included(const char *path_set, const char *elt, + { + size_t elt_len; + size_t path_set_len; +- char *tmp; ++ const char *tmp; + + + tmp = strstr(path_set, elt); +-- +2.51.1 + diff --git a/0007-libmount-fix-const-qualifier-warnings-for-C23.patch b/0007-libmount-fix-const-qualifier-warnings-for-C23.patch new file mode 100644 index 0000000..5f67a10 --- /dev/null +++ b/0007-libmount-fix-const-qualifier-warnings-for-C23.patch @@ -0,0 +1,67 @@ +From 04f796acef76bb18445f516f44838b95dba49883 Mon Sep 17 00:00:00 2001 +From: Karel Zak +Date: Thu, 27 Nov 2025 15:45:55 +0100 +Subject: libmount: fix const qualifier warnings for C23 + +Fix const qualifier discarded warnings in optlist_add_flags(), +mnt_opt_value_with(), and mnt_optstr_apply_flags() functions. +These warnings are reported by gcc 15 which defaults to the C23 standard. + +The strchr() and strstr() functions return pointers into const strings, +so the receiving variables must be declared as const char *. + +Signed-off-by: Karel Zak +(cherry picked from commit c0c79c41527365ca7de30c75daaa018ea01fff97) +--- + libmount/src/optlist.c | 7 +++---- + libmount/src/optstr.c | 2 +- + 2 files changed, 4 insertions(+), 5 deletions(-) + +diff --git a/libmount/src/optlist.c b/libmount/src/optlist.c +index 256c592fd..1d32c2dd6 100644 +--- a/libmount/src/optlist.c ++++ b/libmount/src/optlist.c +@@ -601,7 +601,7 @@ static int optlist_add_flags(struct libmnt_optlist *ls, unsigned long flags, + + for (ent = map; ent && ent->name; ent++) { + +- char *p; ++ const char *p; + size_t sz; + struct libmnt_opt *opt; + +@@ -621,7 +621,7 @@ static int optlist_add_flags(struct libmnt_optlist *ls, unsigned long flags, + sz = p - ent->name; + p -= sz; + } else { +- p = (char *) ent->name; ++ p = ent->name; + sz = strlen(ent->name); /* alone "name" */ + } + +@@ -1162,8 +1162,7 @@ const char *mnt_opt_get_value(struct libmnt_opt *opt) + /* check if option value is @str or comma separated @str */ + int mnt_opt_value_with(struct libmnt_opt *opt, const char *str) + { +- char *p; +- const char *start = opt->value; ++ const char *p, *start = opt->value; + size_t len; + + if (!str || !opt->value || !*opt->value) +diff --git a/libmount/src/optstr.c b/libmount/src/optstr.c +index ac20d8755..51526973d 100644 +--- a/libmount/src/optstr.c ++++ b/libmount/src/optstr.c +@@ -807,7 +807,7 @@ int mnt_optstr_apply_flags(char **optstr, unsigned long flags, + const struct libmnt_optmap *ent; + struct ul_buffer buf = UL_INIT_BUFFER; + size_t sz; +- char *p; ++ const char *p; + + ul_buffer_refer_string(&buf, *optstr); + +-- +2.51.1 + diff --git a/0008-libmount-fix-const-qualifier-warning-in-mnt_parse_mo.patch b/0008-libmount-fix-const-qualifier-warning-in-mnt_parse_mo.patch new file mode 100644 index 0000000..d4355db --- /dev/null +++ b/0008-libmount-fix-const-qualifier-warning-in-mnt_parse_mo.patch @@ -0,0 +1,54 @@ +From 1ba0d6e2c78f3423cb6427e4922f5949af7429e0 Mon Sep 17 00:00:00 2001 +From: Karel Zak +Date: Thu, 27 Nov 2025 16:24:11 +0100 +Subject: libmount: fix const qualifier warning in mnt_parse_mountinfo_line + +Fix const qualifier discarded warning in mnt_parse_mountinfo_line(). +This warning is reported by gcc 15 which defaults to the C23 standard. + +The strstr() function returns a pointer into a const string, so +introduce a separate 'sep' variable to hold this const pointer, +keeping 'p' for non-const unmangle() results that need to be freed. + +Signed-off-by: Karel Zak +(cherry picked from commit 530bf5c5b071753e149699c638ad1820daf5c205) +--- + libmount/src/tab_parse.c | 11 ++++++----- + 1 file changed, 6 insertions(+), 5 deletions(-) + +diff --git a/libmount/src/tab_parse.c b/libmount/src/tab_parse.c +index 3dd853880..3503c233c 100644 +--- a/libmount/src/tab_parse.c ++++ b/libmount/src/tab_parse.c +@@ -186,6 +186,7 @@ static int mnt_parse_mountinfo_line(struct libmnt_fs *fs, const char *s) + int rc = 0; + unsigned int maj, min; + char *p; ++ const char *sep; + + fs->flags |= MNT_FS_KERNEL; + +@@ -242,15 +243,15 @@ static int mnt_parse_mountinfo_line(struct libmnt_fs *fs, const char *s) + } + + /* (7) optional fields, terminated by " - " */ +- p = strstr(s, " - "); +- if (!p) { ++ sep = strstr(s, " - "); ++ if (!sep) { + DBG(TAB, ul_debug("mountinfo parse error: separator not found")); + return -EINVAL; + } +- if (p > s + 1) +- fs->opt_fields = strndup(s + 1, p - s - 1); ++ if (sep > s + 1) ++ fs->opt_fields = strndup(s + 1, sep - s - 1); + +- s = skip_separator(p + 3); ++ s = skip_separator(sep + 3); + + /* (8) FS type */ + p = unmangle(s, &s); +-- +2.51.1 + diff --git a/0009-libblkid-fix-const-qualifier-warning-in-blkid_parse_.patch b/0009-libblkid-fix-const-qualifier-warning-in-blkid_parse_.patch new file mode 100644 index 0000000..cd6b676 --- /dev/null +++ b/0009-libblkid-fix-const-qualifier-warning-in-blkid_parse_.patch @@ -0,0 +1,54 @@ +From 088509a327523fc25e2014c47035e587740ca564 Mon Sep 17 00:00:00 2001 +From: Karel Zak +Date: Thu, 27 Nov 2025 16:28:41 +0100 +Subject: libblkid: fix const qualifier warning in blkid_parse_tag_string + +Fix const qualifier discarded warning in blkid_parse_tag_string(). +This warning is reported by gcc 15 which defaults to the C23 standard. + +The strchr() function returns a pointer into a const string, so +introduce a separate 'eq' variable to hold this const pointer for +finding the '=' separator. Also move the 'cp' variable declaration +into the block where it's actually used for quote handling. + +Signed-off-by: Karel Zak +(cherry picked from commit c45442ef125270d0ab2cb539747ccaf737d60d37) +--- + libblkid/src/tag.c | 10 ++++++---- + 1 file changed, 6 insertions(+), 4 deletions(-) + +diff --git a/libblkid/src/tag.c b/libblkid/src/tag.c +index 178336505..f195c0625 100644 +--- a/libblkid/src/tag.c ++++ b/libblkid/src/tag.c +@@ -202,21 +202,23 @@ errout: + */ + int blkid_parse_tag_string(const char *token, char **ret_type, char **ret_val) + { +- char *name, *value, *cp; ++ char *name, *value; ++ const char *eq; + + DBG(TAG, ul_debug("trying to parse '%s' as a tag", token)); + +- if (!token || !(cp = strchr(token, '='))) ++ if (!token || !(eq = strchr(token, '='))) + return -1; + + name = strdup(token); + if (!name) + return -1; +- value = name + (cp - token); ++ value = name + (eq - token); + *value++ = '\0'; + if (*value == '"' || *value == '\'') { + char c = *value++; +- if (!(cp = strrchr(value, c))) ++ char *cp = strrchr(value, c); ++ if (!cp) + goto errout; /* missing closing quote */ + *cp = '\0'; + } +-- +2.51.1 + diff --git a/0010-dmesg-fix-const-qualifier-warnings-in-parse_callerid.patch b/0010-dmesg-fix-const-qualifier-warnings-in-parse_callerid.patch new file mode 100644 index 0000000..2d6f9d0 --- /dev/null +++ b/0010-dmesg-fix-const-qualifier-warnings-in-parse_callerid.patch @@ -0,0 +1,34 @@ +From d35ec59cf727c302cd499cc0d6efffd9efdcdce3 Mon Sep 17 00:00:00 2001 +From: Karel Zak +Date: Thu, 27 Nov 2025 16:33:04 +0100 +Subject: dmesg: fix const qualifier warnings in parse_callerid + +Fix const qualifier discarded warnings in parse_callerid(). +These warnings are reported by gcc 15 which defaults to the C23 standard. + +The strchr() and strstr() functions return pointers into const strings, +so the receiving variables must be declared as const char *. + +Signed-off-by: Karel Zak +(cherry picked from commit 40e6850d2b2ba2492d5f3e75656cb9bcce2806bb) +--- + sys-utils/dmesg.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/sys-utils/dmesg.c b/sys-utils/dmesg.c +index cccbd4067..cdf23b021 100644 +--- a/sys-utils/dmesg.c ++++ b/sys-utils/dmesg.c +@@ -844,8 +844,7 @@ static const char *parse_callerid(const char *p_str, const char *end, + const char *p_after; + const char *p_next; + size_t cid_size; +- char *p_scn; +- char *p_cid; ++ const char *p_scn, *p_cid; + + /* Check for PRINTK_CALLER prefix, must be before msg text */ + p_cid = strstr(p_str, DMESG_CALLER_PREFIX); +-- +2.51.1 + diff --git a/0011-lsfd-fix-const-qualifier-warning-in-new_counter_spec.patch b/0011-lsfd-fix-const-qualifier-warning-in-new_counter_spec.patch new file mode 100644 index 0000000..793e284 --- /dev/null +++ b/0011-lsfd-fix-const-qualifier-warning-in-new_counter_spec.patch @@ -0,0 +1,34 @@ +From 3a9950c35da4f1e7032d55f3c993fff390fde9c2 Mon Sep 17 00:00:00 2001 +From: Karel Zak +Date: Thu, 27 Nov 2025 16:35:56 +0100 +Subject: lsfd: fix const qualifier warning in new_counter_spec + +Fix const qualifier discarded warning in new_counter_spec(). +This warning is reported by gcc 15 which defaults to the C23 standard. + +The function modifies the input string by inserting a null terminator +to split it into name and expression parts, so the parameter should +be char * rather than const char *. + +Signed-off-by: Karel Zak +(cherry picked from commit 014d2779afb4118d7117442eeed562e2c7b7594f) +--- + lsfd-cmd/lsfd.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lsfd-cmd/lsfd.c b/lsfd-cmd/lsfd.c +index 9aae240fc..2e83acf91 100644 +--- a/lsfd-cmd/lsfd.c ++++ b/lsfd-cmd/lsfd.c +@@ -2278,7 +2278,7 @@ static struct libscols_filter *new_filter(const char *expr, bool debug, struct l + return f; + } + +-static struct counter_spec *new_counter_spec(const char *spec_str) ++static struct counter_spec *new_counter_spec(char *spec_str) + { + char *sep; + struct counter_spec *spec; +-- +2.51.1 + diff --git a/0012-lsfd-fix-const-qualifier-warning-in-strnrstr.patch b/0012-lsfd-fix-const-qualifier-warning-in-strnrstr.patch new file mode 100644 index 0000000..7c78c52 --- /dev/null +++ b/0012-lsfd-fix-const-qualifier-warning-in-strnrstr.patch @@ -0,0 +1,34 @@ +From 6b3fa46d97201628b893f81c3bf3202aedd6ce30 Mon Sep 17 00:00:00 2001 +From: Karel Zak +Date: Thu, 27 Nov 2025 16:38:18 +0100 +Subject: lsfd: fix const qualifier warning in strnrstr + +Fix const qualifier discarded warning in strnrstr(). +This warning is reported by gcc 15 which defaults to the C23 standard. + +The function returns a non-const pointer into the haystack parameter, +and callers modify the string through that pointer. Therefore, the +haystack parameter should be char * rather than const char *. + +Signed-off-by: Karel Zak +(cherry picked from commit 935f2ab21add95059a92208f69ef578708307481) +--- + lsfd-cmd/file.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/lsfd-cmd/file.c b/lsfd-cmd/file.c +index 32b08693d..5ea3ccc57 100644 +--- a/lsfd-cmd/file.c ++++ b/lsfd-cmd/file.c +@@ -387,7 +387,7 @@ void decode_source(char *buf, size_t bufsize, + dev_minor); + } + +-static char *strnrstr(const char *haystack, const char *needle, size_t needle_len) ++static char *strnrstr(char *haystack, const char *needle, size_t needle_len) + { + char *last = strstr(haystack, needle); + if (last == NULL) +-- +2.51.1 + diff --git a/0013-logger-fix-const-qualifier-warnings-for-C23.patch b/0013-logger-fix-const-qualifier-warnings-for-C23.patch new file mode 100644 index 0000000..7b661d7 --- /dev/null +++ b/0013-logger-fix-const-qualifier-warnings-for-C23.patch @@ -0,0 +1,67 @@ +From f7458f53c4cf63014de131434872e6c8fee6adab Mon Sep 17 00:00:00 2001 +From: Karel Zak +Date: Thu, 27 Nov 2025 16:43:38 +0100 +Subject: logger: fix const qualifier warnings for C23 + +Fix const qualifier discarded warnings in valid_structured_data_param() +and valid_structured_data_id() functions. These warnings are reported by +gcc 15 which defaults to the C23 standard. + +The strchr() and strstr() functions return pointers into const strings, +so the receiving variables must be declared as const char *. + +Signed-off-by: Karel Zak +(cherry picked from commit 22c3b959ef381b35a55ed00cf6acd2507b461d4b) +--- + misc-utils/logger.c | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) + +diff --git a/misc-utils/logger.c b/misc-utils/logger.c +index f332a7d27..2a45b12bf 100644 +--- a/misc-utils/logger.c ++++ b/misc-utils/logger.c +@@ -699,10 +699,10 @@ static char *get_structured_data_string(struct logger_ctl *ctl) + + static int valid_structured_data_param(const char *str) + { +- char *s; +- char *eq = strchr(str, '='), +- *qm1 = strchr(str, '"'), +- *qm2 = qm1 ? ul_strchr_escaped(qm1 + 1, '"') : NULL; ++ const char *s; ++ const char *eq = strchr(str, '='), ++ *qm1 = strchr(str, '"'), ++ *qm2 = qm1 ? ul_strchr_escaped(qm1 + 1, '"') : NULL; + + /* something is missing */ + if (!eq || !qm1 || !qm2) +@@ -710,7 +710,7 @@ static int valid_structured_data_param(const char *str) + + /* ']' need to be escaped */ + for (s = qm1 + 1; s && *s; ) { +- char *p = strchr(s, ']'); ++ const char *p = strchr(s, ']'); + if (!p) + break; + if (p > qm2 || p == ul_strchr_escaped(s, ']')) +@@ -720,7 +720,7 @@ static int valid_structured_data_param(const char *str) + + /* '\' is allowed only before '[]"\' chars */ + for (s = qm1 + 1; s && *s; ) { +- char *p = strchr(s, '\\'); ++ const char *p = strchr(s, '\\'); + if (!p) + break; + if (!strchr("[]\"\\", *(p + 1))) +@@ -739,7 +739,7 @@ static int valid_structured_data_param(const char *str) + */ + static int valid_structured_data_id(const char *str) + { +- char *at = strchr(str, '@'); ++ const char *at = strchr(str, '@'); + const char *p; + + /* standardized IDs without @ */ +-- +2.51.1 + diff --git a/0014-namei-fix-const-qualifier-warning-in-readlink_to_nam.patch b/0014-namei-fix-const-qualifier-warning-in-readlink_to_nam.patch new file mode 100644 index 0000000..e5c7da6 --- /dev/null +++ b/0014-namei-fix-const-qualifier-warning-in-readlink_to_nam.patch @@ -0,0 +1,33 @@ +From cb68695cf9d93fe8692c69ae3773e64364491d48 Mon Sep 17 00:00:00 2001 +From: Karel Zak +Date: Thu, 27 Nov 2025 16:44:47 +0100 +Subject: namei: fix const qualifier warning in readlink_to_namei + +Fix const qualifier discarded warning in readlink_to_namei(). +This warning is reported by gcc 15 which defaults to the C23 standard. + +The strrchr() function returns a pointer into a const string, so the +receiving variable must be declared as const char *. + +Signed-off-by: Karel Zak +(cherry picked from commit e318417f00982bf496fd2359853b07ada3e3c544) +--- + misc-utils/namei.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/misc-utils/namei.c b/misc-utils/namei.c +index 0a9ed8df8..2c3049284 100644 +--- a/misc-utils/namei.c ++++ b/misc-utils/namei.c +@@ -100,7 +100,7 @@ readlink_to_namei(struct namei *nm, const char *path) + if (sz < 1) + err(EXIT_FAILURE, _("failed to read symlink: %s"), path); + if (*sym != '/') { +- char *p = strrchr(path, '/'); ++ const char *p = strrchr(path, '/'); + + if (p) { + isrel = 1; +-- +2.51.1 + diff --git a/0015-whereis-fix-const-qualifier-warnings-for-C23.patch b/0015-whereis-fix-const-qualifier-warnings-for-C23.patch new file mode 100644 index 0000000..2d41aef --- /dev/null +++ b/0015-whereis-fix-const-qualifier-warnings-for-C23.patch @@ -0,0 +1,49 @@ +From bc377ab3489beb493e940f01cfad7a2997c32550 Mon Sep 17 00:00:00 2001 +From: Karel Zak +Date: Thu, 27 Nov 2025 16:46:22 +0100 +Subject: whereis: fix const qualifier warnings for C23 + +Fix const qualifier discarded warnings in dirlist_add_subdir() and +lookup() functions. These warnings are reported by gcc 15 which +defaults to the C23 standard. + +The strchr() and strrchr() functions return pointers into const strings, +so the receiving variables must be declared as const char *. + +Signed-off-by: Karel Zak +(cherry picked from commit 01018b74163f9122c75179a7c991b0aa0f8c603c) +--- + misc-utils/whereis.c | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +diff --git a/misc-utils/whereis.c b/misc-utils/whereis.c +index b575e57ae..310512b30 100644 +--- a/misc-utils/whereis.c ++++ b/misc-utils/whereis.c +@@ -269,7 +269,7 @@ static void dirlist_add_subdir(struct wh_dirlist **ls, int type, const char *dir + char buf[PATH_MAX], *d; + DIR *dirp; + struct dirent *dp; +- char *postfix; ++ const char *postfix; + size_t len; + + postfix = strchr(dir, '*'); +@@ -473,11 +473,12 @@ static void lookup(const char *pattern, struct wh_dirlist *ls, int want) + { + char patbuf[PATH_MAX] = { 0 }; + int count = 0; +- char *wait = NULL, *p; ++ char *wait = NULL; ++ const char *p; + + /* canonicalize pattern -- remove path suffix etc. */ + p = strrchr(pattern, '/'); +- p = p ? p + 1 : (char *) pattern; ++ p = p ? p + 1 : pattern; + xstrncpy(patbuf, p, PATH_MAX); + + DBG(SEARCH, ul_debug("lookup dirs for '%s' (%s), want: %s %s %s", +-- +2.51.1 + diff --git a/0016-enosys-fix-const-qualifier-warning-in-parse_block.patch b/0016-enosys-fix-const-qualifier-warning-in-parse_block.patch new file mode 100644 index 0000000..4af94c8 --- /dev/null +++ b/0016-enosys-fix-const-qualifier-warning-in-parse_block.patch @@ -0,0 +1,33 @@ +From d2d6d2bba6470d3b38a284d7de874901e3cb6662 Mon Sep 17 00:00:00 2001 +From: Karel Zak +Date: Thu, 27 Nov 2025 16:47:46 +0100 +Subject: enosys: fix const qualifier warning in parse_block + +Fix const qualifier discarded warning in parse_block(). +This warning is reported by gcc 15 which defaults to the C23 standard. + +The strchr() function returns a pointer into a const string, so the +receiving variable must be declared as const char *. + +Signed-off-by: Karel Zak +(cherry picked from commit 70379d240dcf975d140160bb4c14cf1b3fe70bcc) +--- + misc-utils/enosys.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/misc-utils/enosys.c b/misc-utils/enosys.c +index 6afb27107..5f780ae98 100644 +--- a/misc-utils/enosys.c ++++ b/misc-utils/enosys.c +@@ -105,7 +105,7 @@ static struct blocked_number *parse_block(const char *s, int ret, const struct s + struct blocked_number *blocked; + const char *name, *error_name; + long blocked_number; +- char *colon; ++ const char *colon; + bool found; + size_t i; + +-- +2.51.1 + diff --git a/0017-partx-fix-const-qualifier-warning-in-get_max_partno.patch b/0017-partx-fix-const-qualifier-warning-in-get_max_partno.patch new file mode 100644 index 0000000..07b20c2 --- /dev/null +++ b/0017-partx-fix-const-qualifier-warning-in-get_max_partno.patch @@ -0,0 +1,34 @@ +From d1ae6e00299866ae3ad8dd549302eaa9b499a24f Mon Sep 17 00:00:00 2001 +From: Karel Zak +Date: Thu, 27 Nov 2025 16:48:53 +0100 +Subject: partx: fix const qualifier warning in get_max_partno + +Fix const qualifier discarded warning in get_max_partno(). +This warning is reported by gcc 15 which defaults to the C23 standard. + +The strrchr() function returns a pointer into a const string, so the +receiving variable must be declared as const char *. + +Signed-off-by: Karel Zak +(cherry picked from commit 4c94ce5d05d97420df7a512bbbaee8c4017414ae) +--- + disk-utils/partx.c | 3 ++- + 1 file changed, 2 insertions(+), 1 deletion(-) + +diff --git a/disk-utils/partx.c b/disk-utils/partx.c +index 347d5daad..a2df5d4c0 100644 +--- a/disk-utils/partx.c ++++ b/disk-utils/partx.c +@@ -218,7 +218,8 @@ err: + + static int get_max_partno(const char *disk, dev_t devno) + { +- char path[PATH_MAX], *parent, *dirname = NULL; ++ char path[PATH_MAX], *dirname = NULL; ++ const char *parent; + struct stat st; + DIR *dir; + struct dirent *d; +-- +2.51.1 + diff --git a/0018-eject-fix-const-qualifier-warning-in-read_speed.patch b/0018-eject-fix-const-qualifier-warning-in-read_speed.patch new file mode 100644 index 0000000..7f0b421 --- /dev/null +++ b/0018-eject-fix-const-qualifier-warning-in-read_speed.patch @@ -0,0 +1,33 @@ +From 84b1a2c93dcdb5b51d1273fa85776b1007411b58 Mon Sep 17 00:00:00 2001 +From: Karel Zak +Date: Thu, 27 Nov 2025 16:50:19 +0100 +Subject: eject: fix const qualifier warning in read_speed + +Fix const qualifier discarded warning in read_speed(). +This warning is reported by gcc 15 which defaults to the C23 standard. + +The strrchr() function returns a pointer into a const string, so the +receiving variable must be declared as const char *. + +Signed-off-by: Karel Zak +(cherry picked from commit cc1f2ac99b99eede36a58cf115a56bdfbc977e52) +--- + sys-utils/eject.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/sys-utils/eject.c b/sys-utils/eject.c +index 545642475..e6d4db102 100644 +--- a/sys-utils/eject.c ++++ b/sys-utils/eject.c +@@ -493,7 +493,7 @@ static void select_speed(const struct eject_control *ctl) + static int read_speed(const char *devname) + { + int drive_number = -1; +- char *name; ++ const char *name; + FILE *f; + + f = fopen(_PATH_PROC_CDROMINFO, "r"); +-- +2.51.1 + diff --git a/login-default-motd-file.patch b/login-default-motd-file.patch deleted file mode 100644 index 3670848..0000000 --- a/login-default-motd-file.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/include/pathnames.h b/include/pathnames.h -index 3845d4c33..fac3a0783 100644 ---- a/include/pathnames.h -+++ b/include/pathnames.h -@@ -41,7 +41,7 @@ - #ifndef _PATH_MAILDIR - # define _PATH_MAILDIR "/var/spool/mail" - #endif --#define _PATH_MOTDFILE "/usr/share/misc/motd:/run/motd:/etc/motd" -+#define _PATH_MOTDFILE "/usr/share/misc/motd:/run/motd:/run/motd.d:/etc/motd:/etc/motd.d" - #ifndef _PATH_NOLOGIN - # define _PATH_NOLOGIN "/etc/nologin" - #endif diff --git a/login-lastlog-create.patch b/login-lastlog-create.patch deleted file mode 100644 index e2523d3..0000000 --- a/login-lastlog-create.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -up util-linux-2.36/login-utils/login.c.kzak util-linux-2.36/login-utils/login.c ---- util-linux-2.36/login-utils/login.c.kzak 2020-07-23 14:13:26.777030764 +0200 -+++ util-linux-2.36/login-utils/login.c 2020-07-23 14:11:22.793686983 +0200 -@@ -585,7 +585,7 @@ static void log_lastlog(struct login_con - sa.sa_handler = SIG_IGN; - sigaction(SIGXFSZ, &sa, &oldsa_xfsz); - -- fd = open(_PATH_LASTLOG, O_RDWR, 0); -+ fd = open(_PATH_LASTLOG, O_RDWR | O_CREAT, 0); - if (fd < 0) - goto done; - offset = cxt->pwd->pw_uid * sizeof(ll); diff --git a/util-linux.spec b/util-linux.spec index ea4f5a9..0ceb1e9 100644 --- a/util-linux.spec +++ b/util-linux.spec @@ -102,17 +102,30 @@ Provides: /usr/sbin/runuser Provides: /usr/sbin/sfdisk %endif -### Ready for upstream? -### -# 151635 - makeing /var/log/lastlog -Patch0: login-lastlog-create.patch -# Add `/run/motd.d` to the hardcoded MOTD_FILE -# https://github.com/coreos/console-login-helper-messages/issues/60 -Patch1: login-default-motd-file.patch +### Fedora specific patches +Patch0: 0000-login-use-O_CREAT-on-lastlog.patch +Patch1: 0001-login-add-run-motd.d-to-the-hardcoded-MOTD_FILE.patch -# https://github.com/dracut-ng/dracut-ng/issues/1384 -# 2367956 - EROFS vs. the latest util-linux and kernel -Patch2: 0001-libmount-disable-EROFS-backing-file-support.patch +### Temporary dracut workaround +Patch2: 0002-libmount-disable-EROFS-backing-file-support.patch + +### Upstream backports (mostly for gcc-15) +Patch3: 0003-libblkid-use-snprintf-instead-of-sprintf.patch +Patch4: 0004-lsfd-fix-bsearch-macro-usage-with-glibc-C23.patch +Patch5: 0005-lib-lscpu-fix-const-qualifier-discarded-warnings-in-.patch +Patch6: 0006-lsns-fix-const-qualifier-warnings-for-C23.patch +Patch7: 0007-libmount-fix-const-qualifier-warnings-for-C23.patch +Patch8: 0008-libmount-fix-const-qualifier-warning-in-mnt_parse_mo.patch +Patch9: 0009-libblkid-fix-const-qualifier-warning-in-blkid_parse_.patch +Patch10: 0010-dmesg-fix-const-qualifier-warnings-in-parse_callerid.patch +Patch11: 0011-lsfd-fix-const-qualifier-warning-in-new_counter_spec.patch +Patch12: 0012-lsfd-fix-const-qualifier-warning-in-strnrstr.patch +Patch13: 0013-logger-fix-const-qualifier-warnings-for-C23.patch +Patch14: 0014-namei-fix-const-qualifier-warning-in-readlink_to_nam.patch +Patch15: 0015-whereis-fix-const-qualifier-warnings-for-C23.patch +Patch16: 0016-enosys-fix-const-qualifier-warning-in-parse_block.patch +Patch17: 0017-partx-fix-const-qualifier-warning-in-get_max_partno.patch +Patch18: 0018-eject-fix-const-qualifier-warning-in-read_speed.patch %description The util-linux package contains a large variety of low-level system From df438c4170ebad73b9ba2e60cd68b562474ba0ff Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Mon, 15 Dec 2025 16:42:08 +0100 Subject: [PATCH 04/18] upgrade to upstream release v2.41.3 --- .gitignore | 1 + ...lkid-use-snprintf-instead-of-sprintf.patch | 58 ---------------- ...x-bsearch-macro-usage-with-glibc-C23.patch | 42 ------------ ...nst-qualifier-discarded-warnings-in-.patch | 57 ---------------- ...fix-const-qualifier-warnings-for-C23.patch | 45 ------------- ...fix-const-qualifier-warnings-for-C23.patch | 67 ------------------- ...st-qualifier-warning-in-mnt_parse_mo.patch | 54 --------------- ...st-qualifier-warning-in-blkid_parse_.patch | 54 --------------- ...qualifier-warnings-in-parse_callerid.patch | 34 ---------- ...ualifier-warning-in-new_counter_spec.patch | 34 ---------- ...-const-qualifier-warning-in-strnrstr.patch | 34 ---------- ...fix-const-qualifier-warnings-for-C23.patch | 67 ------------------- ...qualifier-warning-in-readlink_to_nam.patch | 33 --------- ...fix-const-qualifier-warnings-for-C23.patch | 49 -------------- ...nst-qualifier-warning-in-parse_block.patch | 33 --------- ...-qualifier-warning-in-get_max_partno.patch | 34 ---------- ...onst-qualifier-warning-in-read_speed.patch | 33 --------- sources | 2 +- util-linux.spec | 20 +----- 19 files changed, 3 insertions(+), 748 deletions(-) delete mode 100644 0003-libblkid-use-snprintf-instead-of-sprintf.patch delete mode 100644 0004-lsfd-fix-bsearch-macro-usage-with-glibc-C23.patch delete mode 100644 0005-lib-lscpu-fix-const-qualifier-discarded-warnings-in-.patch delete mode 100644 0006-lsns-fix-const-qualifier-warnings-for-C23.patch delete mode 100644 0007-libmount-fix-const-qualifier-warnings-for-C23.patch delete mode 100644 0008-libmount-fix-const-qualifier-warning-in-mnt_parse_mo.patch delete mode 100644 0009-libblkid-fix-const-qualifier-warning-in-blkid_parse_.patch delete mode 100644 0010-dmesg-fix-const-qualifier-warnings-in-parse_callerid.patch delete mode 100644 0011-lsfd-fix-const-qualifier-warning-in-new_counter_spec.patch delete mode 100644 0012-lsfd-fix-const-qualifier-warning-in-strnrstr.patch delete mode 100644 0013-logger-fix-const-qualifier-warnings-for-C23.patch delete mode 100644 0014-namei-fix-const-qualifier-warning-in-readlink_to_nam.patch delete mode 100644 0015-whereis-fix-const-qualifier-warnings-for-C23.patch delete mode 100644 0016-enosys-fix-const-qualifier-warning-in-parse_block.patch delete mode 100644 0017-partx-fix-const-qualifier-warning-in-get_max_partno.patch delete mode 100644 0018-eject-fix-const-qualifier-warning-in-read_speed.patch diff --git a/.gitignore b/.gitignore index cdfd72d..9c2726a 100644 --- a/.gitignore +++ b/.gitignore @@ -102,3 +102,4 @@ /util-linux-2.41.tar.xz /util-linux-2.41.1.tar.xz /util-linux-2.41.2.tar.xz +/util-linux-2.41.3.tar.xz diff --git a/0003-libblkid-use-snprintf-instead-of-sprintf.patch b/0003-libblkid-use-snprintf-instead-of-sprintf.patch deleted file mode 100644 index 6372a17..0000000 --- a/0003-libblkid-use-snprintf-instead-of-sprintf.patch +++ /dev/null @@ -1,58 +0,0 @@ -From 0cd0a9dd42a3249bbbee4855fbc406c4ca5fdd5b Mon Sep 17 00:00:00 2001 -From: Karel Zak -Date: Mon, 6 Oct 2025 15:04:24 +0200 -Subject: libblkid: use snprintf() instead of sprintf() - -Replace sprintf() calls with snprintf() to ensure proper bounds -checking when formatting strings. - -In encode.c, the check now validates snprintf() return value instead -of pre-checking buffer size, providing more robust error handling. - -In probe.c, snprintf() is used with proper size calculation based on -remaining buffer space. - -Signed-off-by: Karel Zak -(cherry picked from commit 041380f4ca7244df624bf7efdb5e27fdd3144175) -(cherry picked from commit 917917253e60b0ba485cf6a27a2f993aa43e1eea) ---- - libblkid/src/encode.c | 6 ++++-- - libblkid/src/probe.c | 4 ++-- - 2 files changed, 6 insertions(+), 4 deletions(-) - -diff --git a/libblkid/src/encode.c b/libblkid/src/encode.c -index 8213873ee..4b83f6690 100644 ---- a/libblkid/src/encode.c -+++ b/libblkid/src/encode.c -@@ -191,9 +191,11 @@ int blkid_encode_string(const char *str, char *str_enc, size_t len) - j += seqlen; - i += (seqlen-1); - } else if (str[i] == '\\' || !is_whitelisted(str[i], NULL)) { -- if (len-j < 4) -+ int rc; -+ -+ rc = snprintf(&str_enc[j], len-j, "\\x%02x", (unsigned char) str[i]); -+ if (rc != 4) - goto err; -- sprintf(&str_enc[j], "\\x%02x", (unsigned char) str[i]); - j += 4; - } else { - if (len-j < 1) -diff --git a/libblkid/src/probe.c b/libblkid/src/probe.c -index 61b93021c..a38f5990e 100644 ---- a/libblkid/src/probe.c -+++ b/libblkid/src/probe.c -@@ -2012,8 +2012,8 @@ static void blkid_probe_log_csum_mismatch(blkid_probe pr, size_t n, const void * - int hex_size = min(sizeof(csum_hex), n * 2); - - for (int i = 0; i < hex_size; i+=2) { -- sprintf(&csum_hex[i], "%02X", ((const unsigned char *) csum)[i / 2]); -- sprintf(&expected_hex[i], "%02X", ((const unsigned char *) expected)[i / 2]); -+ snprintf(&csum_hex[i], sizeof(csum_hex) - i, "%02X", ((const unsigned char *) csum)[i / 2]); -+ snprintf(&expected_hex[i], sizeof(expected_hex) - i, "%02X", ((const unsigned char *) expected)[i / 2]); - } - - DBG(LOWPROBE, ul_debug( --- -2.51.1 - diff --git a/0004-lsfd-fix-bsearch-macro-usage-with-glibc-C23.patch b/0004-lsfd-fix-bsearch-macro-usage-with-glibc-C23.patch deleted file mode 100644 index c8fb5ea..0000000 --- a/0004-lsfd-fix-bsearch-macro-usage-with-glibc-C23.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 189960ccca3866461d4ee91c3b7ffb9dac6d0078 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Cristian=20Rodr=C3=ADguez?= -Date: Sat, 22 Nov 2025 10:41:08 -0300 -Subject: lsfd: fix bsearch macro usage with glibc C23 -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -C23 requires bsearch to be a const preserving macro, build now fails -with - -../lsfd-cmd/lsfd.c:1879:75: error: macro ‘bsearch’ passed 6 arguments, but takes just 5 - 1879 | nfds, sizeof(struct pollfd), pollfdcmp)) - | ^ -In file included from ../include/c.h:17, - from ../lsfd-cmd/lsfd.c:48: -/usr/include/stdlib.h:987:10: note: macro ‘bsearch’ defined here - 987 | # define bsearch(KEY, BASE, NMEMB, SIZE, COMPAR) \ - - add parenthesis around expression to fix it. - -(cherry picked from commit 711bda1441561bfd2eb6d45fe0bc789535c1f1a8) ---- - lsfd-cmd/lsfd.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/lsfd-cmd/lsfd.c b/lsfd-cmd/lsfd.c -index 75cd1de58..9aae240fc 100644 ---- a/lsfd-cmd/lsfd.c -+++ b/lsfd-cmd/lsfd.c -@@ -1836,7 +1836,7 @@ static void mark_poll_fds_as_multiplexed(char *buf, - struct file *file = list_entry(f, struct file, files); - if (is_opened_file(file) && !file->multiplexed) { - int fd = file->association; -- if (bsearch(&(struct pollfd){.fd = fd,}, local.iov_base, -+ if (bsearch((&(struct pollfd){.fd = fd,}), local.iov_base, - nfds, sizeof(struct pollfd), pollfdcmp)) - file->multiplexed = 1; - } --- -2.51.1 - diff --git a/0005-lib-lscpu-fix-const-qualifier-discarded-warnings-in-.patch b/0005-lib-lscpu-fix-const-qualifier-discarded-warnings-in-.patch deleted file mode 100644 index a5064b0..0000000 --- a/0005-lib-lscpu-fix-const-qualifier-discarded-warnings-in-.patch +++ /dev/null @@ -1,57 +0,0 @@ -From 638055dbe76ca0b3f87bcc0879e5810fadece18c Mon Sep 17 00:00:00 2001 -From: Karel Zak -Date: Thu, 27 Nov 2025 10:27:07 +0100 -Subject: lib, lscpu: fix const qualifier discarded warnings in bsearch - -Fix compilation warnings from newer compilers with stricter -const-correctness checks. When bsearch() searches in const arrays, -the result pointer must also be const to avoid discarding the -const qualifier. - -Fixed in: -- lib/color-names.c: searching in static const basic_schemes[] -- sys-utils/lscpu-cputype.c: searching in const pattern arrays - -The warnings were: - lib/color-names.c:62:13: error: assignment discards 'const' - qualifier from pointer target type - [-Werror=discarded-qualifiers] - -Signed-off-by: Karel Zak -(cherry picked from commit 0cef3e4f5aac19bc3623883ca64c66538aa9b442) ---- - lib/color-names.c | 3 ++- - sys-utils/lscpu-cputype.c | 3 ++- - 2 files changed, 4 insertions(+), 2 deletions(-) - -diff --git a/lib/color-names.c b/lib/color-names.c -index 88c4ef957..daebcedae 100644 ---- a/lib/color-names.c -+++ b/lib/color-names.c -@@ -54,7 +54,8 @@ const char *color_sequence_from_colorname(const char *str) - { "white", UL_COLOR_WHITE }, - { "yellow", UL_COLOR_BOLD_YELLOW } - }; -- struct ul_color_name key = { .name = str }, *res; -+ struct ul_color_name key = { .name = str }; -+ const struct ul_color_name *res; - - if (!str) - return NULL; -diff --git a/sys-utils/lscpu-cputype.c b/sys-utils/lscpu-cputype.c -index 3937a00a8..99b112bf9 100644 ---- a/sys-utils/lscpu-cputype.c -+++ b/sys-utils/lscpu-cputype.c -@@ -444,7 +444,8 @@ static char *key_cleanup(char *str, int *keynum) - - static const struct cpuinfo_pattern *cpuinfo_parse_line(char *str, char **value, int *keynum) - { -- struct cpuinfo_pattern key = { .id = 0 }, *pat; -+ struct cpuinfo_pattern key = { .id = 0 }; -+ const struct cpuinfo_pattern *pat; - char *p, *v; - char buf[CPUTYPE_PATTERN_BUFSZ] = { 0 }; - --- -2.51.1 - diff --git a/0006-lsns-fix-const-qualifier-warnings-for-C23.patch b/0006-lsns-fix-const-qualifier-warnings-for-C23.patch deleted file mode 100644 index 8478b21..0000000 --- a/0006-lsns-fix-const-qualifier-warnings-for-C23.patch +++ /dev/null @@ -1,45 +0,0 @@ -From 986936d454b1f9165f5b35196a732db71a8d3b46 Mon Sep 17 00:00:00 2001 -From: Karel Zak -Date: Thu, 27 Nov 2025 15:41:21 +0100 -Subject: lsns: fix const qualifier warnings for C23 - -Fix const qualifier discarded warnings in read_persistent_namespaces() -and is_path_included() functions. These warnings are reported by gcc 15 -which defaults to the C23 standard. - -The strchr() and strstr() functions return pointers into const strings, -so the receiving variables must be declared as const char *. - -Signed-off-by: Karel Zak -(cherry picked from commit dbe4c16973d5d0f69ba3bf1bd8942a51de9a0933) ---- - sys-utils/lsns.c | 6 +++--- - 1 file changed, 3 insertions(+), 3 deletions(-) - -diff --git a/sys-utils/lsns.c b/sys-utils/lsns.c -index 812afe710..2ee078ac6 100644 ---- a/sys-utils/lsns.c -+++ b/sys-utils/lsns.c -@@ -1003,8 +1003,8 @@ static int read_persistent_namespaces(struct lsns *ls) - struct libmnt_fs *fs = NULL; - - while (mnt_table_next_fs(ls->tab, itr, &fs) == 0) { -- const char *root; -- char *p, *end = NULL; -+ const char *root, *p; -+ char *end = NULL; - ino_t ino; - int fd; - -@@ -1095,7 +1095,7 @@ static int is_path_included(const char *path_set, const char *elt, - { - size_t elt_len; - size_t path_set_len; -- char *tmp; -+ const char *tmp; - - - tmp = strstr(path_set, elt); --- -2.51.1 - diff --git a/0007-libmount-fix-const-qualifier-warnings-for-C23.patch b/0007-libmount-fix-const-qualifier-warnings-for-C23.patch deleted file mode 100644 index 5f67a10..0000000 --- a/0007-libmount-fix-const-qualifier-warnings-for-C23.patch +++ /dev/null @@ -1,67 +0,0 @@ -From 04f796acef76bb18445f516f44838b95dba49883 Mon Sep 17 00:00:00 2001 -From: Karel Zak -Date: Thu, 27 Nov 2025 15:45:55 +0100 -Subject: libmount: fix const qualifier warnings for C23 - -Fix const qualifier discarded warnings in optlist_add_flags(), -mnt_opt_value_with(), and mnt_optstr_apply_flags() functions. -These warnings are reported by gcc 15 which defaults to the C23 standard. - -The strchr() and strstr() functions return pointers into const strings, -so the receiving variables must be declared as const char *. - -Signed-off-by: Karel Zak -(cherry picked from commit c0c79c41527365ca7de30c75daaa018ea01fff97) ---- - libmount/src/optlist.c | 7 +++---- - libmount/src/optstr.c | 2 +- - 2 files changed, 4 insertions(+), 5 deletions(-) - -diff --git a/libmount/src/optlist.c b/libmount/src/optlist.c -index 256c592fd..1d32c2dd6 100644 ---- a/libmount/src/optlist.c -+++ b/libmount/src/optlist.c -@@ -601,7 +601,7 @@ static int optlist_add_flags(struct libmnt_optlist *ls, unsigned long flags, - - for (ent = map; ent && ent->name; ent++) { - -- char *p; -+ const char *p; - size_t sz; - struct libmnt_opt *opt; - -@@ -621,7 +621,7 @@ static int optlist_add_flags(struct libmnt_optlist *ls, unsigned long flags, - sz = p - ent->name; - p -= sz; - } else { -- p = (char *) ent->name; -+ p = ent->name; - sz = strlen(ent->name); /* alone "name" */ - } - -@@ -1162,8 +1162,7 @@ const char *mnt_opt_get_value(struct libmnt_opt *opt) - /* check if option value is @str or comma separated @str */ - int mnt_opt_value_with(struct libmnt_opt *opt, const char *str) - { -- char *p; -- const char *start = opt->value; -+ const char *p, *start = opt->value; - size_t len; - - if (!str || !opt->value || !*opt->value) -diff --git a/libmount/src/optstr.c b/libmount/src/optstr.c -index ac20d8755..51526973d 100644 ---- a/libmount/src/optstr.c -+++ b/libmount/src/optstr.c -@@ -807,7 +807,7 @@ int mnt_optstr_apply_flags(char **optstr, unsigned long flags, - const struct libmnt_optmap *ent; - struct ul_buffer buf = UL_INIT_BUFFER; - size_t sz; -- char *p; -+ const char *p; - - ul_buffer_refer_string(&buf, *optstr); - --- -2.51.1 - diff --git a/0008-libmount-fix-const-qualifier-warning-in-mnt_parse_mo.patch b/0008-libmount-fix-const-qualifier-warning-in-mnt_parse_mo.patch deleted file mode 100644 index d4355db..0000000 --- a/0008-libmount-fix-const-qualifier-warning-in-mnt_parse_mo.patch +++ /dev/null @@ -1,54 +0,0 @@ -From 1ba0d6e2c78f3423cb6427e4922f5949af7429e0 Mon Sep 17 00:00:00 2001 -From: Karel Zak -Date: Thu, 27 Nov 2025 16:24:11 +0100 -Subject: libmount: fix const qualifier warning in mnt_parse_mountinfo_line - -Fix const qualifier discarded warning in mnt_parse_mountinfo_line(). -This warning is reported by gcc 15 which defaults to the C23 standard. - -The strstr() function returns a pointer into a const string, so -introduce a separate 'sep' variable to hold this const pointer, -keeping 'p' for non-const unmangle() results that need to be freed. - -Signed-off-by: Karel Zak -(cherry picked from commit 530bf5c5b071753e149699c638ad1820daf5c205) ---- - libmount/src/tab_parse.c | 11 ++++++----- - 1 file changed, 6 insertions(+), 5 deletions(-) - -diff --git a/libmount/src/tab_parse.c b/libmount/src/tab_parse.c -index 3dd853880..3503c233c 100644 ---- a/libmount/src/tab_parse.c -+++ b/libmount/src/tab_parse.c -@@ -186,6 +186,7 @@ static int mnt_parse_mountinfo_line(struct libmnt_fs *fs, const char *s) - int rc = 0; - unsigned int maj, min; - char *p; -+ const char *sep; - - fs->flags |= MNT_FS_KERNEL; - -@@ -242,15 +243,15 @@ static int mnt_parse_mountinfo_line(struct libmnt_fs *fs, const char *s) - } - - /* (7) optional fields, terminated by " - " */ -- p = strstr(s, " - "); -- if (!p) { -+ sep = strstr(s, " - "); -+ if (!sep) { - DBG(TAB, ul_debug("mountinfo parse error: separator not found")); - return -EINVAL; - } -- if (p > s + 1) -- fs->opt_fields = strndup(s + 1, p - s - 1); -+ if (sep > s + 1) -+ fs->opt_fields = strndup(s + 1, sep - s - 1); - -- s = skip_separator(p + 3); -+ s = skip_separator(sep + 3); - - /* (8) FS type */ - p = unmangle(s, &s); --- -2.51.1 - diff --git a/0009-libblkid-fix-const-qualifier-warning-in-blkid_parse_.patch b/0009-libblkid-fix-const-qualifier-warning-in-blkid_parse_.patch deleted file mode 100644 index cd6b676..0000000 --- a/0009-libblkid-fix-const-qualifier-warning-in-blkid_parse_.patch +++ /dev/null @@ -1,54 +0,0 @@ -From 088509a327523fc25e2014c47035e587740ca564 Mon Sep 17 00:00:00 2001 -From: Karel Zak -Date: Thu, 27 Nov 2025 16:28:41 +0100 -Subject: libblkid: fix const qualifier warning in blkid_parse_tag_string - -Fix const qualifier discarded warning in blkid_parse_tag_string(). -This warning is reported by gcc 15 which defaults to the C23 standard. - -The strchr() function returns a pointer into a const string, so -introduce a separate 'eq' variable to hold this const pointer for -finding the '=' separator. Also move the 'cp' variable declaration -into the block where it's actually used for quote handling. - -Signed-off-by: Karel Zak -(cherry picked from commit c45442ef125270d0ab2cb539747ccaf737d60d37) ---- - libblkid/src/tag.c | 10 ++++++---- - 1 file changed, 6 insertions(+), 4 deletions(-) - -diff --git a/libblkid/src/tag.c b/libblkid/src/tag.c -index 178336505..f195c0625 100644 ---- a/libblkid/src/tag.c -+++ b/libblkid/src/tag.c -@@ -202,21 +202,23 @@ errout: - */ - int blkid_parse_tag_string(const char *token, char **ret_type, char **ret_val) - { -- char *name, *value, *cp; -+ char *name, *value; -+ const char *eq; - - DBG(TAG, ul_debug("trying to parse '%s' as a tag", token)); - -- if (!token || !(cp = strchr(token, '='))) -+ if (!token || !(eq = strchr(token, '='))) - return -1; - - name = strdup(token); - if (!name) - return -1; -- value = name + (cp - token); -+ value = name + (eq - token); - *value++ = '\0'; - if (*value == '"' || *value == '\'') { - char c = *value++; -- if (!(cp = strrchr(value, c))) -+ char *cp = strrchr(value, c); -+ if (!cp) - goto errout; /* missing closing quote */ - *cp = '\0'; - } --- -2.51.1 - diff --git a/0010-dmesg-fix-const-qualifier-warnings-in-parse_callerid.patch b/0010-dmesg-fix-const-qualifier-warnings-in-parse_callerid.patch deleted file mode 100644 index 2d6f9d0..0000000 --- a/0010-dmesg-fix-const-qualifier-warnings-in-parse_callerid.patch +++ /dev/null @@ -1,34 +0,0 @@ -From d35ec59cf727c302cd499cc0d6efffd9efdcdce3 Mon Sep 17 00:00:00 2001 -From: Karel Zak -Date: Thu, 27 Nov 2025 16:33:04 +0100 -Subject: dmesg: fix const qualifier warnings in parse_callerid - -Fix const qualifier discarded warnings in parse_callerid(). -These warnings are reported by gcc 15 which defaults to the C23 standard. - -The strchr() and strstr() functions return pointers into const strings, -so the receiving variables must be declared as const char *. - -Signed-off-by: Karel Zak -(cherry picked from commit 40e6850d2b2ba2492d5f3e75656cb9bcce2806bb) ---- - sys-utils/dmesg.c | 3 +-- - 1 file changed, 1 insertion(+), 2 deletions(-) - -diff --git a/sys-utils/dmesg.c b/sys-utils/dmesg.c -index cccbd4067..cdf23b021 100644 ---- a/sys-utils/dmesg.c -+++ b/sys-utils/dmesg.c -@@ -844,8 +844,7 @@ static const char *parse_callerid(const char *p_str, const char *end, - const char *p_after; - const char *p_next; - size_t cid_size; -- char *p_scn; -- char *p_cid; -+ const char *p_scn, *p_cid; - - /* Check for PRINTK_CALLER prefix, must be before msg text */ - p_cid = strstr(p_str, DMESG_CALLER_PREFIX); --- -2.51.1 - diff --git a/0011-lsfd-fix-const-qualifier-warning-in-new_counter_spec.patch b/0011-lsfd-fix-const-qualifier-warning-in-new_counter_spec.patch deleted file mode 100644 index 793e284..0000000 --- a/0011-lsfd-fix-const-qualifier-warning-in-new_counter_spec.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 3a9950c35da4f1e7032d55f3c993fff390fde9c2 Mon Sep 17 00:00:00 2001 -From: Karel Zak -Date: Thu, 27 Nov 2025 16:35:56 +0100 -Subject: lsfd: fix const qualifier warning in new_counter_spec - -Fix const qualifier discarded warning in new_counter_spec(). -This warning is reported by gcc 15 which defaults to the C23 standard. - -The function modifies the input string by inserting a null terminator -to split it into name and expression parts, so the parameter should -be char * rather than const char *. - -Signed-off-by: Karel Zak -(cherry picked from commit 014d2779afb4118d7117442eeed562e2c7b7594f) ---- - lsfd-cmd/lsfd.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/lsfd-cmd/lsfd.c b/lsfd-cmd/lsfd.c -index 9aae240fc..2e83acf91 100644 ---- a/lsfd-cmd/lsfd.c -+++ b/lsfd-cmd/lsfd.c -@@ -2278,7 +2278,7 @@ static struct libscols_filter *new_filter(const char *expr, bool debug, struct l - return f; - } - --static struct counter_spec *new_counter_spec(const char *spec_str) -+static struct counter_spec *new_counter_spec(char *spec_str) - { - char *sep; - struct counter_spec *spec; --- -2.51.1 - diff --git a/0012-lsfd-fix-const-qualifier-warning-in-strnrstr.patch b/0012-lsfd-fix-const-qualifier-warning-in-strnrstr.patch deleted file mode 100644 index 7c78c52..0000000 --- a/0012-lsfd-fix-const-qualifier-warning-in-strnrstr.patch +++ /dev/null @@ -1,34 +0,0 @@ -From 6b3fa46d97201628b893f81c3bf3202aedd6ce30 Mon Sep 17 00:00:00 2001 -From: Karel Zak -Date: Thu, 27 Nov 2025 16:38:18 +0100 -Subject: lsfd: fix const qualifier warning in strnrstr - -Fix const qualifier discarded warning in strnrstr(). -This warning is reported by gcc 15 which defaults to the C23 standard. - -The function returns a non-const pointer into the haystack parameter, -and callers modify the string through that pointer. Therefore, the -haystack parameter should be char * rather than const char *. - -Signed-off-by: Karel Zak -(cherry picked from commit 935f2ab21add95059a92208f69ef578708307481) ---- - lsfd-cmd/file.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/lsfd-cmd/file.c b/lsfd-cmd/file.c -index 32b08693d..5ea3ccc57 100644 ---- a/lsfd-cmd/file.c -+++ b/lsfd-cmd/file.c -@@ -387,7 +387,7 @@ void decode_source(char *buf, size_t bufsize, - dev_minor); - } - --static char *strnrstr(const char *haystack, const char *needle, size_t needle_len) -+static char *strnrstr(char *haystack, const char *needle, size_t needle_len) - { - char *last = strstr(haystack, needle); - if (last == NULL) --- -2.51.1 - diff --git a/0013-logger-fix-const-qualifier-warnings-for-C23.patch b/0013-logger-fix-const-qualifier-warnings-for-C23.patch deleted file mode 100644 index 7b661d7..0000000 --- a/0013-logger-fix-const-qualifier-warnings-for-C23.patch +++ /dev/null @@ -1,67 +0,0 @@ -From f7458f53c4cf63014de131434872e6c8fee6adab Mon Sep 17 00:00:00 2001 -From: Karel Zak -Date: Thu, 27 Nov 2025 16:43:38 +0100 -Subject: logger: fix const qualifier warnings for C23 - -Fix const qualifier discarded warnings in valid_structured_data_param() -and valid_structured_data_id() functions. These warnings are reported by -gcc 15 which defaults to the C23 standard. - -The strchr() and strstr() functions return pointers into const strings, -so the receiving variables must be declared as const char *. - -Signed-off-by: Karel Zak -(cherry picked from commit 22c3b959ef381b35a55ed00cf6acd2507b461d4b) ---- - misc-utils/logger.c | 14 +++++++------- - 1 file changed, 7 insertions(+), 7 deletions(-) - -diff --git a/misc-utils/logger.c b/misc-utils/logger.c -index f332a7d27..2a45b12bf 100644 ---- a/misc-utils/logger.c -+++ b/misc-utils/logger.c -@@ -699,10 +699,10 @@ static char *get_structured_data_string(struct logger_ctl *ctl) - - static int valid_structured_data_param(const char *str) - { -- char *s; -- char *eq = strchr(str, '='), -- *qm1 = strchr(str, '"'), -- *qm2 = qm1 ? ul_strchr_escaped(qm1 + 1, '"') : NULL; -+ const char *s; -+ const char *eq = strchr(str, '='), -+ *qm1 = strchr(str, '"'), -+ *qm2 = qm1 ? ul_strchr_escaped(qm1 + 1, '"') : NULL; - - /* something is missing */ - if (!eq || !qm1 || !qm2) -@@ -710,7 +710,7 @@ static int valid_structured_data_param(const char *str) - - /* ']' need to be escaped */ - for (s = qm1 + 1; s && *s; ) { -- char *p = strchr(s, ']'); -+ const char *p = strchr(s, ']'); - if (!p) - break; - if (p > qm2 || p == ul_strchr_escaped(s, ']')) -@@ -720,7 +720,7 @@ static int valid_structured_data_param(const char *str) - - /* '\' is allowed only before '[]"\' chars */ - for (s = qm1 + 1; s && *s; ) { -- char *p = strchr(s, '\\'); -+ const char *p = strchr(s, '\\'); - if (!p) - break; - if (!strchr("[]\"\\", *(p + 1))) -@@ -739,7 +739,7 @@ static int valid_structured_data_param(const char *str) - */ - static int valid_structured_data_id(const char *str) - { -- char *at = strchr(str, '@'); -+ const char *at = strchr(str, '@'); - const char *p; - - /* standardized IDs without @ */ --- -2.51.1 - diff --git a/0014-namei-fix-const-qualifier-warning-in-readlink_to_nam.patch b/0014-namei-fix-const-qualifier-warning-in-readlink_to_nam.patch deleted file mode 100644 index e5c7da6..0000000 --- a/0014-namei-fix-const-qualifier-warning-in-readlink_to_nam.patch +++ /dev/null @@ -1,33 +0,0 @@ -From cb68695cf9d93fe8692c69ae3773e64364491d48 Mon Sep 17 00:00:00 2001 -From: Karel Zak -Date: Thu, 27 Nov 2025 16:44:47 +0100 -Subject: namei: fix const qualifier warning in readlink_to_namei - -Fix const qualifier discarded warning in readlink_to_namei(). -This warning is reported by gcc 15 which defaults to the C23 standard. - -The strrchr() function returns a pointer into a const string, so the -receiving variable must be declared as const char *. - -Signed-off-by: Karel Zak -(cherry picked from commit e318417f00982bf496fd2359853b07ada3e3c544) ---- - misc-utils/namei.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/misc-utils/namei.c b/misc-utils/namei.c -index 0a9ed8df8..2c3049284 100644 ---- a/misc-utils/namei.c -+++ b/misc-utils/namei.c -@@ -100,7 +100,7 @@ readlink_to_namei(struct namei *nm, const char *path) - if (sz < 1) - err(EXIT_FAILURE, _("failed to read symlink: %s"), path); - if (*sym != '/') { -- char *p = strrchr(path, '/'); -+ const char *p = strrchr(path, '/'); - - if (p) { - isrel = 1; --- -2.51.1 - diff --git a/0015-whereis-fix-const-qualifier-warnings-for-C23.patch b/0015-whereis-fix-const-qualifier-warnings-for-C23.patch deleted file mode 100644 index 2d41aef..0000000 --- a/0015-whereis-fix-const-qualifier-warnings-for-C23.patch +++ /dev/null @@ -1,49 +0,0 @@ -From bc377ab3489beb493e940f01cfad7a2997c32550 Mon Sep 17 00:00:00 2001 -From: Karel Zak -Date: Thu, 27 Nov 2025 16:46:22 +0100 -Subject: whereis: fix const qualifier warnings for C23 - -Fix const qualifier discarded warnings in dirlist_add_subdir() and -lookup() functions. These warnings are reported by gcc 15 which -defaults to the C23 standard. - -The strchr() and strrchr() functions return pointers into const strings, -so the receiving variables must be declared as const char *. - -Signed-off-by: Karel Zak -(cherry picked from commit 01018b74163f9122c75179a7c991b0aa0f8c603c) ---- - misc-utils/whereis.c | 7 ++++--- - 1 file changed, 4 insertions(+), 3 deletions(-) - -diff --git a/misc-utils/whereis.c b/misc-utils/whereis.c -index b575e57ae..310512b30 100644 ---- a/misc-utils/whereis.c -+++ b/misc-utils/whereis.c -@@ -269,7 +269,7 @@ static void dirlist_add_subdir(struct wh_dirlist **ls, int type, const char *dir - char buf[PATH_MAX], *d; - DIR *dirp; - struct dirent *dp; -- char *postfix; -+ const char *postfix; - size_t len; - - postfix = strchr(dir, '*'); -@@ -473,11 +473,12 @@ static void lookup(const char *pattern, struct wh_dirlist *ls, int want) - { - char patbuf[PATH_MAX] = { 0 }; - int count = 0; -- char *wait = NULL, *p; -+ char *wait = NULL; -+ const char *p; - - /* canonicalize pattern -- remove path suffix etc. */ - p = strrchr(pattern, '/'); -- p = p ? p + 1 : (char *) pattern; -+ p = p ? p + 1 : pattern; - xstrncpy(patbuf, p, PATH_MAX); - - DBG(SEARCH, ul_debug("lookup dirs for '%s' (%s), want: %s %s %s", --- -2.51.1 - diff --git a/0016-enosys-fix-const-qualifier-warning-in-parse_block.patch b/0016-enosys-fix-const-qualifier-warning-in-parse_block.patch deleted file mode 100644 index 4af94c8..0000000 --- a/0016-enosys-fix-const-qualifier-warning-in-parse_block.patch +++ /dev/null @@ -1,33 +0,0 @@ -From d2d6d2bba6470d3b38a284d7de874901e3cb6662 Mon Sep 17 00:00:00 2001 -From: Karel Zak -Date: Thu, 27 Nov 2025 16:47:46 +0100 -Subject: enosys: fix const qualifier warning in parse_block - -Fix const qualifier discarded warning in parse_block(). -This warning is reported by gcc 15 which defaults to the C23 standard. - -The strchr() function returns a pointer into a const string, so the -receiving variable must be declared as const char *. - -Signed-off-by: Karel Zak -(cherry picked from commit 70379d240dcf975d140160bb4c14cf1b3fe70bcc) ---- - misc-utils/enosys.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/misc-utils/enosys.c b/misc-utils/enosys.c -index 6afb27107..5f780ae98 100644 ---- a/misc-utils/enosys.c -+++ b/misc-utils/enosys.c -@@ -105,7 +105,7 @@ static struct blocked_number *parse_block(const char *s, int ret, const struct s - struct blocked_number *blocked; - const char *name, *error_name; - long blocked_number; -- char *colon; -+ const char *colon; - bool found; - size_t i; - --- -2.51.1 - diff --git a/0017-partx-fix-const-qualifier-warning-in-get_max_partno.patch b/0017-partx-fix-const-qualifier-warning-in-get_max_partno.patch deleted file mode 100644 index 07b20c2..0000000 --- a/0017-partx-fix-const-qualifier-warning-in-get_max_partno.patch +++ /dev/null @@ -1,34 +0,0 @@ -From d1ae6e00299866ae3ad8dd549302eaa9b499a24f Mon Sep 17 00:00:00 2001 -From: Karel Zak -Date: Thu, 27 Nov 2025 16:48:53 +0100 -Subject: partx: fix const qualifier warning in get_max_partno - -Fix const qualifier discarded warning in get_max_partno(). -This warning is reported by gcc 15 which defaults to the C23 standard. - -The strrchr() function returns a pointer into a const string, so the -receiving variable must be declared as const char *. - -Signed-off-by: Karel Zak -(cherry picked from commit 4c94ce5d05d97420df7a512bbbaee8c4017414ae) ---- - disk-utils/partx.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/disk-utils/partx.c b/disk-utils/partx.c -index 347d5daad..a2df5d4c0 100644 ---- a/disk-utils/partx.c -+++ b/disk-utils/partx.c -@@ -218,7 +218,8 @@ err: - - static int get_max_partno(const char *disk, dev_t devno) - { -- char path[PATH_MAX], *parent, *dirname = NULL; -+ char path[PATH_MAX], *dirname = NULL; -+ const char *parent; - struct stat st; - DIR *dir; - struct dirent *d; --- -2.51.1 - diff --git a/0018-eject-fix-const-qualifier-warning-in-read_speed.patch b/0018-eject-fix-const-qualifier-warning-in-read_speed.patch deleted file mode 100644 index 7f0b421..0000000 --- a/0018-eject-fix-const-qualifier-warning-in-read_speed.patch +++ /dev/null @@ -1,33 +0,0 @@ -From 84b1a2c93dcdb5b51d1273fa85776b1007411b58 Mon Sep 17 00:00:00 2001 -From: Karel Zak -Date: Thu, 27 Nov 2025 16:50:19 +0100 -Subject: eject: fix const qualifier warning in read_speed - -Fix const qualifier discarded warning in read_speed(). -This warning is reported by gcc 15 which defaults to the C23 standard. - -The strrchr() function returns a pointer into a const string, so the -receiving variable must be declared as const char *. - -Signed-off-by: Karel Zak -(cherry picked from commit cc1f2ac99b99eede36a58cf115a56bdfbc977e52) ---- - sys-utils/eject.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/sys-utils/eject.c b/sys-utils/eject.c -index 545642475..e6d4db102 100644 ---- a/sys-utils/eject.c -+++ b/sys-utils/eject.c -@@ -493,7 +493,7 @@ static void select_speed(const struct eject_control *ctl) - static int read_speed(const char *devname) - { - int drive_number = -1; -- char *name; -+ const char *name; - FILE *f; - - f = fopen(_PATH_PROC_CDROMINFO, "r"); --- -2.51.1 - diff --git a/sources b/sources index ce7b5d9..96ed8d3 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (util-linux-2.41.2.tar.xz) = 696c87e7cf185acc9b4b969ddade6155ea2945ae494eaecfd7b1f35d9607166cb09be79878fb793dd31b4d4dcac8c9be4be76af3886185db7ae8b58c303fb0cf +SHA512 (util-linux-2.41.3.tar.xz) = 3d299f0e05a4c982a04dbcbaaeff1222152feedf51c56c5dbdeb75999c68269d652a994f5cdf4c1ee42bb7b28475dd0792192c299fd9bc3b45198c5b153dad00 diff --git a/util-linux.spec b/util-linux.spec index 3068e99..0426af4 100644 --- a/util-linux.spec +++ b/util-linux.spec @@ -1,7 +1,7 @@ ### Header Summary: Collection of basic system utilities Name: util-linux -Version: 2.41.2 +Version: 2.41.3 # -p -e rc1 Release: %autorelease -b7 License: GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-2.1-or-later AND BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause-UC AND LicenseRef-Fedora-Public-Domain @@ -109,24 +109,6 @@ Patch1: 0001-login-add-run-motd.d-to-the-hardcoded-MOTD_FILE.patch ### Temporary dracut workaround Patch2: 0002-libmount-disable-EROFS-backing-file-support.patch -### Upstream backports (mostly for gcc-15) -Patch3: 0003-libblkid-use-snprintf-instead-of-sprintf.patch -Patch4: 0004-lsfd-fix-bsearch-macro-usage-with-glibc-C23.patch -Patch5: 0005-lib-lscpu-fix-const-qualifier-discarded-warnings-in-.patch -Patch6: 0006-lsns-fix-const-qualifier-warnings-for-C23.patch -Patch7: 0007-libmount-fix-const-qualifier-warnings-for-C23.patch -Patch8: 0008-libmount-fix-const-qualifier-warning-in-mnt_parse_mo.patch -Patch9: 0009-libblkid-fix-const-qualifier-warning-in-blkid_parse_.patch -Patch10: 0010-dmesg-fix-const-qualifier-warnings-in-parse_callerid.patch -Patch11: 0011-lsfd-fix-const-qualifier-warning-in-new_counter_spec.patch -Patch12: 0012-lsfd-fix-const-qualifier-warning-in-strnrstr.patch -Patch13: 0013-logger-fix-const-qualifier-warnings-for-C23.patch -Patch14: 0014-namei-fix-const-qualifier-warning-in-readlink_to_nam.patch -Patch15: 0015-whereis-fix-const-qualifier-warnings-for-C23.patch -Patch16: 0016-enosys-fix-const-qualifier-warning-in-parse_block.patch -Patch17: 0017-partx-fix-const-qualifier-warning-in-get_max_partno.patch -Patch18: 0018-eject-fix-const-qualifier-warning-in-read_speed.patch - %description The util-linux package contains a large variety of low-level system utilities that are necessary for a Linux system to function. Among From 4bac19fd38f59e72be7356578115428100710afc Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Mon, 15 Dec 2025 16:53:44 +0100 Subject: [PATCH 05/18] add completition bits blkpr lsfd --- util-linux.spec | 3 +++ 1 file changed, 3 insertions(+) diff --git a/util-linux.spec b/util-linux.spec index 0426af4..fad72a3 100644 --- a/util-linux.spec +++ b/util-linux.spec @@ -719,7 +719,9 @@ fi %{_sbindir}/zramctl %{compldir}/addpart +%{compldir}/bits %{compldir}/blkdiscard +%{compldir}/blkpr %{compldir}/blkzone %{compldir}/cal %{compldir}/chcpu @@ -758,6 +760,7 @@ fi %{compldir}/lsblk %{compldir}/lscpu %{compldir}/lsclocks +%{compldir}/lsfd %{compldir}/lsipc %{compldir}/lsirq %{compldir}/lslocks From 06dbf9bb28d4f669f1aace6aa46607fbe9396284 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Mon, 12 Jan 2026 11:55:59 +0100 Subject: [PATCH 06/18] fix built on new gcc (bison based code and libblkid API) --- ...nore-Wunused-but-set-variable-for-bi.patch | 63 +++++++++++++++++++ ...const-from-blkid_partitions_get_name.patch | 44 +++++++++++++ util-linux.spec | 5 ++ 3 files changed, 112 insertions(+) create mode 100644 0003-build-sys-gcc-ignore-Wunused-but-set-variable-for-bi.patch create mode 100644 0004-blkid-Drop-const-from-blkid_partitions_get_name.patch diff --git a/0003-build-sys-gcc-ignore-Wunused-but-set-variable-for-bi.patch b/0003-build-sys-gcc-ignore-Wunused-but-set-variable-for-bi.patch new file mode 100644 index 0000000..2b48c5a --- /dev/null +++ b/0003-build-sys-gcc-ignore-Wunused-but-set-variable-for-bi.patch @@ -0,0 +1,63 @@ +From b3e1a72d0272c8dc26db8c11c61cd4fed6a6b95f Mon Sep 17 00:00:00 2001 +From: Christian Goeschel Ndjomouo +Date: Tue, 6 Jan 2026 10:43:45 -0500 +Subject: build-sys: (gcc) ignore -Wunused-but-set-variable for bison + +[kzak@redhat.com: - merge two Christian's patches to make it more portable] + +Signed-off-by: Christian Goeschel Ndjomouo +Signed-off-by: Karel Zak +(cherry picked from commit db9047892a45c06bceb5768e7bb8c887289b9859) +(cherry picked from commit 718e4a76dd1262ce97f83dbc0c0fe9f97564ecbb) +--- + libsmartcols/src/filter-parser.y | 11 +++++++---- + sys-utils/hwclock-parse-date.y | 11 +++++++---- + 2 files changed, 14 insertions(+), 8 deletions(-) + +diff --git a/libsmartcols/src/filter-parser.y b/libsmartcols/src/filter-parser.y +index a7d41408e..23b05df33 100644 +--- a/libsmartcols/src/filter-parser.y ++++ b/libsmartcols/src/filter-parser.y +@@ -1,9 +1,12 @@ + %{ +-#ifdef __clang__ +-/* clang detects yynerrs as unused. +- * Will be fixed in future versions of bison. ++/* ++ * Compilers detect yynerrs as unused. Let's hope it will be fixed in future ++ * versions of Bison. + */ +-#pragma clang diagnostic ignored "-Wunused-but-set-variable" ++#if defined(__GNUC__) && !defined(__clang__) ++# pragma GCC diagnostic ignored "-Wunused-but-set-variable" ++#elif defined(__clang__) ++# pragma clang diagnostic ignored "-Wunused-but-set-variable" + #endif + + #include +diff --git a/sys-utils/hwclock-parse-date.y b/sys-utils/hwclock-parse-date.y +index 0d996cc87..7d6c38268 100644 +--- a/sys-utils/hwclock-parse-date.y ++++ b/sys-utils/hwclock-parse-date.y +@@ -34,11 +34,14 @@ + * TZ strings in dates. + */ + +-#ifdef __clang__ +-/* clang 15 detects yynerrs as unused. +- * Will be fixed in future versions of bison. ++/* ++ * Compilers detect yynerrs as unused. Let's hope it will be fixed in future ++ * versions of Bison. + */ +-#pragma clang diagnostic ignored "-Wunused-but-set-variable" ++#if defined(__GNUC__) && !defined(__clang__) ++# pragma GCC diagnostic ignored "-Wunused-but-set-variable" ++#elif defined(__clang__) ++# pragma clang diagnostic ignored "-Wunused-but-set-variable" + #endif + + /** +-- +2.52.0 + diff --git a/0004-blkid-Drop-const-from-blkid_partitions_get_name.patch b/0004-blkid-Drop-const-from-blkid_partitions_get_name.patch new file mode 100644 index 0000000..749b7f9 --- /dev/null +++ b/0004-blkid-Drop-const-from-blkid_partitions_get_name.patch @@ -0,0 +1,44 @@ +From b994886e18307ef3002a63679fba4a6177f476cf Mon Sep 17 00:00:00 2001 +From: Daan De Meyer +Date: Wed, 26 Nov 2025 15:08:25 +0100 +Subject: blkid: Drop const from blkid_partitions_get_name() + +const for idx is useless as the value is copied anyway, so drop the +const. AFAIK this doesn't change ABI. + +(cherry picked from commit b243de928aab8565e264f4af1d776cc860689f64) +(cherry picked from commit 479133958af89a2afda442e158107b465301dfbb) +--- + libblkid/src/blkid.h.in | 2 +- + libblkid/src/partitions/partitions.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/libblkid/src/blkid.h.in b/libblkid/src/blkid.h.in +index 91fc3b0be..031650dbc 100644 +--- a/libblkid/src/blkid.h.in ++++ b/libblkid/src/blkid.h.in +@@ -340,7 +340,7 @@ extern uint64_t blkid_topology_get_diskseq(blkid_topology tp) + * partitions probing + */ + extern int blkid_known_pttype(const char *pttype); +-extern int blkid_partitions_get_name(const size_t idx, const char **name); ++extern int blkid_partitions_get_name(size_t idx, const char **name); + + extern int blkid_probe_enable_partitions(blkid_probe pr, int enable) + __ul_attribute__((nonnull)); +diff --git a/libblkid/src/partitions/partitions.c b/libblkid/src/partitions/partitions.c +index 9df813c92..e838b3db1 100644 +--- a/libblkid/src/partitions/partitions.c ++++ b/libblkid/src/partitions/partitions.c +@@ -907,7 +907,7 @@ int blkid_known_pttype(const char *pttype) + * + * Returns: -1 if @idx is out of range, or 0 on success. + */ +-int blkid_partitions_get_name(const size_t idx, const char **name) ++int blkid_partitions_get_name(size_t idx, const char **name) + { + if (idx < ARRAY_SIZE(idinfos)) { + *name = idinfos[idx]->name; +-- +2.52.0 + diff --git a/util-linux.spec b/util-linux.spec index fad72a3..c67d24b 100644 --- a/util-linux.spec +++ b/util-linux.spec @@ -109,6 +109,11 @@ Patch1: 0001-login-add-run-motd.d-to-the-hardcoded-MOTD_FILE.patch ### Temporary dracut workaround Patch2: 0002-libmount-disable-EROFS-backing-file-support.patch +# Upstream backports +Patch3: 0003-build-sys-gcc-ignore-Wunused-but-set-variable-for-bi.patch +Patch4: 0004-blkid-Drop-const-from-blkid_partitions_get_name.patch + + %description The util-linux package contains a large variety of low-level system utilities that are necessary for a Linux system to function. Among From 4737f2d70274faa77e4b5e9ef117edb248599c14 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Mon, 12 Jan 2026 12:15:47 +0100 Subject: [PATCH 07/18] enable BuildRequires for parsers --- util-linux.spec | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/util-linux.spec b/util-linux.spec index c67d24b..f1f58a4 100644 --- a/util-linux.spec +++ b/util-linux.spec @@ -44,7 +44,8 @@ BuildRequires: librtas-devel #BuildRequires: autoconf #BuildRequires: automake #BuildRequires: libtool -#BuildRequires: bison +BuildRequires: bison +BuildRequires: flex ### Sources Source0: https://www.kernel.org/pub/linux/utils/util-linux/v%{upstream_major}/util-linux-%{upstream_version}.tar.xz From 47417a6e2e9737412879c5fd2ae1a8fea98e19af Mon Sep 17 00:00:00 2001 From: Nuo Cheng Date: Sat, 6 Dec 2025 01:10:43 +0000 Subject: [PATCH 08/18] Update util-linux-su.pamd fix variables not set in /etc/environment through command 'su --login' --- util-linux-su.pamd | 1 + 1 file changed, 1 insertion(+) diff --git a/util-linux-su.pamd b/util-linux-su.pamd index 030657f..5733201 100644 --- a/util-linux-su.pamd +++ b/util-linux-su.pamd @@ -1,4 +1,5 @@ #%PAM-1.0 +auth required pam_env.so auth sufficient pam_rootok.so # Uncomment the following line to implicitly trust users in the "wheel" group. #auth sufficient pam_wheel.so trust use_uid From 196be3f2a16d94149800f747c1468bfea7b9707a Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 17 Jan 2026 19:43:43 +0000 Subject: [PATCH 09/18] Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild From da7125e4bb4140112a50af0a7ff4b03d3b3d1d1b Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Thu, 2 Apr 2026 14:26:48 +0200 Subject: [PATCH 10/18] upgrade to upstream release v2.42 --- .gitignore | 1 + ...t-disable-EROFS-backing-file-support.patch | 89 ------------------- ...nore-Wunused-but-set-variable-for-bi.patch | 63 ------------- ...const-from-blkid_partitions_get_name.patch | 44 --------- sources | 2 +- util-linux.spec | 18 ++-- 6 files changed, 11 insertions(+), 206 deletions(-) delete mode 100644 0002-libmount-disable-EROFS-backing-file-support.patch delete mode 100644 0003-build-sys-gcc-ignore-Wunused-but-set-variable-for-bi.patch delete mode 100644 0004-blkid-Drop-const-from-blkid_partitions_get_name.patch diff --git a/.gitignore b/.gitignore index 9c2726a..fa4f8f4 100644 --- a/.gitignore +++ b/.gitignore @@ -103,3 +103,4 @@ /util-linux-2.41.1.tar.xz /util-linux-2.41.2.tar.xz /util-linux-2.41.3.tar.xz +/util-linux-2.42.tar.xz diff --git a/0002-libmount-disable-EROFS-backing-file-support.patch b/0002-libmount-disable-EROFS-backing-file-support.patch deleted file mode 100644 index 2cb17a1..0000000 --- a/0002-libmount-disable-EROFS-backing-file-support.patch +++ /dev/null @@ -1,89 +0,0 @@ -From 93a62761843ff76187bd542fe717fa0c9b8f73a7 Mon Sep 17 00:00:00 2001 -From: Karel Zak -Date: Tue, 24 Jun 2025 10:56:58 +0200 -Subject: libmount: disable EROFS backing file support - -Let's temporarily use the old reliable loop devices rather than directly -mounting EROFS images. It seems some tools need to adapt to the change. -See https://github.com/dracut-ng/dracut-ng/issues/1384 - -Signed-off-by: Karel Zak ---- - libmount/src/context_mount.c | 35 ----------------------------------- - libmount/src/hook_loopdev.c | 7 ------- - 2 files changed, 42 deletions(-) - -diff --git a/libmount/src/context_mount.c b/libmount/src/context_mount.c -index ee3eadb05..e1d06a61e 100644 ---- a/libmount/src/context_mount.c -+++ b/libmount/src/context_mount.c -@@ -961,24 +961,6 @@ int mnt_context_finalize_mount(struct libmnt_context *cxt) - return rc; - } - --static int is_erofs_regfile(struct libmnt_context *cxt) --{ -- const char *type = mnt_fs_get_fstype(cxt->fs); -- const char *src = mnt_fs_get_srcpath(cxt->fs); -- unsigned long flags = 0; -- struct stat st; -- -- if (!type || strcmp(type, "erofs") != 0) -- return 0; -- if (mnt_context_get_user_mflags(cxt, &flags)) -- return 0; -- if (flags & (MNT_MS_LOOP | MNT_MS_OFFSET | MNT_MS_SIZELIMIT)) -- return 0; /* it's already loopdev */ -- if (!src || stat(src, &st) != 0 || !S_ISREG(st.st_mode)) -- return 0; -- return 1; --} -- - /** - * mnt_context_mount: - * @cxt: mount context -@@ -1083,23 +1065,6 @@ again: - } - } - -- /* -- * Try mount EROFS image again with loop device. -- * See hook_loopdev.c:is_loopdev_required() for more details. -- */ -- if (rc && mnt_context_get_syscall_errno(cxt) == ENOTBLK -- && is_erofs_regfile(cxt)) { -- struct libmnt_optlist *ol = mnt_context_get_optlist(cxt); -- -- mnt_context_reset_status(cxt); -- DBG(CXT, ul_debugobj(cxt, "enabling loop= for EROFS")); -- mnt_optlist_append_flags(ol, MNT_MS_LOOP, cxt->map_userspace); -- -- rc = mnt_context_call_hooks(cxt, MNT_STAGE_PREP_SOURCE); -- if (!rc) -- goto again; -- } -- - if (rc == 0) - rc = mnt_context_call_hooks(cxt, MNT_STAGE_POST); - -diff --git a/libmount/src/hook_loopdev.c b/libmount/src/hook_loopdev.c -index 444d69d6f..29e181fe8 100644 ---- a/libmount/src/hook_loopdev.c -+++ b/libmount/src/hook_loopdev.c -@@ -468,13 +468,6 @@ static int is_loopdev_required(struct libmnt_context *cxt, struct libmnt_optlist - } - } - -- /* The EROFS kernel driver can be compiled with EROFS_FS_BACKED_BY_FILE, -- * allowing for the mounting of a regular file as a filesystem without -- * a loop device. -- */ -- if (type && strcmp(type, "erofs") == 0) -- return 0; -- - /* Note that there is no restriction (on kernel side) that would - * prevent a regular file as a mount(2) source argument. A filesystem - * that is able to mount regular files could be implemented. For this --- -2.51.1 - diff --git a/0003-build-sys-gcc-ignore-Wunused-but-set-variable-for-bi.patch b/0003-build-sys-gcc-ignore-Wunused-but-set-variable-for-bi.patch deleted file mode 100644 index 2b48c5a..0000000 --- a/0003-build-sys-gcc-ignore-Wunused-but-set-variable-for-bi.patch +++ /dev/null @@ -1,63 +0,0 @@ -From b3e1a72d0272c8dc26db8c11c61cd4fed6a6b95f Mon Sep 17 00:00:00 2001 -From: Christian Goeschel Ndjomouo -Date: Tue, 6 Jan 2026 10:43:45 -0500 -Subject: build-sys: (gcc) ignore -Wunused-but-set-variable for bison - -[kzak@redhat.com: - merge two Christian's patches to make it more portable] - -Signed-off-by: Christian Goeschel Ndjomouo -Signed-off-by: Karel Zak -(cherry picked from commit db9047892a45c06bceb5768e7bb8c887289b9859) -(cherry picked from commit 718e4a76dd1262ce97f83dbc0c0fe9f97564ecbb) ---- - libsmartcols/src/filter-parser.y | 11 +++++++---- - sys-utils/hwclock-parse-date.y | 11 +++++++---- - 2 files changed, 14 insertions(+), 8 deletions(-) - -diff --git a/libsmartcols/src/filter-parser.y b/libsmartcols/src/filter-parser.y -index a7d41408e..23b05df33 100644 ---- a/libsmartcols/src/filter-parser.y -+++ b/libsmartcols/src/filter-parser.y -@@ -1,9 +1,12 @@ - %{ --#ifdef __clang__ --/* clang detects yynerrs as unused. -- * Will be fixed in future versions of bison. -+/* -+ * Compilers detect yynerrs as unused. Let's hope it will be fixed in future -+ * versions of Bison. - */ --#pragma clang diagnostic ignored "-Wunused-but-set-variable" -+#if defined(__GNUC__) && !defined(__clang__) -+# pragma GCC diagnostic ignored "-Wunused-but-set-variable" -+#elif defined(__clang__) -+# pragma clang diagnostic ignored "-Wunused-but-set-variable" - #endif - - #include -diff --git a/sys-utils/hwclock-parse-date.y b/sys-utils/hwclock-parse-date.y -index 0d996cc87..7d6c38268 100644 ---- a/sys-utils/hwclock-parse-date.y -+++ b/sys-utils/hwclock-parse-date.y -@@ -34,11 +34,14 @@ - * TZ strings in dates. - */ - --#ifdef __clang__ --/* clang 15 detects yynerrs as unused. -- * Will be fixed in future versions of bison. -+/* -+ * Compilers detect yynerrs as unused. Let's hope it will be fixed in future -+ * versions of Bison. - */ --#pragma clang diagnostic ignored "-Wunused-but-set-variable" -+#if defined(__GNUC__) && !defined(__clang__) -+# pragma GCC diagnostic ignored "-Wunused-but-set-variable" -+#elif defined(__clang__) -+# pragma clang diagnostic ignored "-Wunused-but-set-variable" - #endif - - /** --- -2.52.0 - diff --git a/0004-blkid-Drop-const-from-blkid_partitions_get_name.patch b/0004-blkid-Drop-const-from-blkid_partitions_get_name.patch deleted file mode 100644 index 749b7f9..0000000 --- a/0004-blkid-Drop-const-from-blkid_partitions_get_name.patch +++ /dev/null @@ -1,44 +0,0 @@ -From b994886e18307ef3002a63679fba4a6177f476cf Mon Sep 17 00:00:00 2001 -From: Daan De Meyer -Date: Wed, 26 Nov 2025 15:08:25 +0100 -Subject: blkid: Drop const from blkid_partitions_get_name() - -const for idx is useless as the value is copied anyway, so drop the -const. AFAIK this doesn't change ABI. - -(cherry picked from commit b243de928aab8565e264f4af1d776cc860689f64) -(cherry picked from commit 479133958af89a2afda442e158107b465301dfbb) ---- - libblkid/src/blkid.h.in | 2 +- - libblkid/src/partitions/partitions.c | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/libblkid/src/blkid.h.in b/libblkid/src/blkid.h.in -index 91fc3b0be..031650dbc 100644 ---- a/libblkid/src/blkid.h.in -+++ b/libblkid/src/blkid.h.in -@@ -340,7 +340,7 @@ extern uint64_t blkid_topology_get_diskseq(blkid_topology tp) - * partitions probing - */ - extern int blkid_known_pttype(const char *pttype); --extern int blkid_partitions_get_name(const size_t idx, const char **name); -+extern int blkid_partitions_get_name(size_t idx, const char **name); - - extern int blkid_probe_enable_partitions(blkid_probe pr, int enable) - __ul_attribute__((nonnull)); -diff --git a/libblkid/src/partitions/partitions.c b/libblkid/src/partitions/partitions.c -index 9df813c92..e838b3db1 100644 ---- a/libblkid/src/partitions/partitions.c -+++ b/libblkid/src/partitions/partitions.c -@@ -907,7 +907,7 @@ int blkid_known_pttype(const char *pttype) - * - * Returns: -1 if @idx is out of range, or 0 on success. - */ --int blkid_partitions_get_name(const size_t idx, const char **name) -+int blkid_partitions_get_name(size_t idx, const char **name) - { - if (idx < ARRAY_SIZE(idinfos)) { - *name = idinfos[idx]->name; --- -2.52.0 - diff --git a/sources b/sources index 96ed8d3..51a58d9 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (util-linux-2.41.3.tar.xz) = 3d299f0e05a4c982a04dbcbaaeff1222152feedf51c56c5dbdeb75999c68269d652a994f5cdf4c1ee42bb7b28475dd0792192c299fd9bc3b45198c5b153dad00 +SHA512 (util-linux-2.42.tar.xz) = 909bba6c38d43ca4cb9bd974c399b4f0537b54709ac43e8acc823d9d9979fbc7523572469eb452b13c86116675d6d2ebb3764444781204f7e5bd0156252635d7 diff --git a/util-linux.spec b/util-linux.spec index f1f58a4..9809b9f 100644 --- a/util-linux.spec +++ b/util-linux.spec @@ -1,7 +1,7 @@ ### Header Summary: Collection of basic system utilities Name: util-linux -Version: 2.41.3 +Version: 2.42 # -p -e rc1 Release: %autorelease -b7 License: GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-2.1-or-later AND BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause-UC AND LicenseRef-Fedora-Public-Domain @@ -107,14 +107,6 @@ Provides: /usr/sbin/sfdisk Patch0: 0000-login-use-O_CREAT-on-lastlog.patch Patch1: 0001-login-add-run-motd.d-to-the-hardcoded-MOTD_FILE.patch -### Temporary dracut workaround -Patch2: 0002-libmount-disable-EROFS-backing-file-support.patch - -# Upstream backports -Patch3: 0003-build-sys-gcc-ignore-Wunused-but-set-variable-for-bi.patch -Patch4: 0004-blkid-Drop-const-from-blkid_partitions_get_name.patch - - %description The util-linux package contains a large variety of low-level system utilities that are necessary for a Linux system to function. Among @@ -561,6 +553,7 @@ fi %{_bindir}/colcrt %{_bindir}/colrm %{_bindir}/column +%{_bindir}/copyfilerange %{_bindir}/coresched %{_bindir}/eject %{_bindir}/enosys @@ -568,6 +561,7 @@ fi %{_bindir}/fallocate %{_bindir}/fincore %{_bindir}/fadvise +%{_bindir}/getino %{_bindir}/getopt %{_bindir}/hexdump %{_bindir}/irqtop @@ -617,6 +611,7 @@ fi %{_mandir}/man1/colcrt.1* %{_mandir}/man1/colrm.1* %{_mandir}/man1/column.1* +%{_mandir}/man1/copyfilerange.1* %{_mandir}/man1/coresched.1.* %{_mandir}/man1/eject.1* %{_mandir}/man1/enosys.1* @@ -624,6 +619,7 @@ fi %{_mandir}/man1/fadvise.1* %{_mandir}/man1/fallocate.1* %{_mandir}/man1/fincore.1* +%{_mandir}/man1/getino.1* %{_mandir}/man1/getopt.1* %{_mandir}/man1/hexdump.1* %{_mandir}/man1/irqtop.1* @@ -739,6 +735,7 @@ fi %{compldir}/colcrt %{compldir}/colrm %{compldir}/column +%{compldir}/copyfilerange %{compldir}/coresched %{compldir}/ctrlaltdel %{compldir}/delpart @@ -754,6 +751,7 @@ fi %{compldir}/fsck.minix %{compldir}/fsfreeze %{compldir}/fstrim +%{compldir}/getino %{compldir}/getopt %{compldir}/hexdump %{compldir}/irqtop @@ -987,10 +985,12 @@ fi %{_libdir}/pkgconfig/lastlog2.pc %{_mandir}/man3/lastlog2.3.* %{_mandir}/man3/ll2_import_lastlog.3* +%{_mandir}/man3/ll2_new_context.3* %{_mandir}/man3/ll2_read_all.3* %{_mandir}/man3/ll2_read_entry.3* %{_mandir}/man3/ll2_remove_entry.3* %{_mandir}/man3/ll2_rename_user.3* +%{_mandir}/man3/ll2_unref_context.3* %{_mandir}/man3/ll2_update_login_time.3* %{_mandir}/man3/ll2_write_entry.3* From f89132526858f8e537f7dd4d6ca729eb19e0c804 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Tue, 19 May 2026 13:29:13 +0200 Subject: [PATCH 11/18] upgrade to upstream release v2.42.1 - fix pam_lastlog2 libpam linking (rhbz#2453457) --- .gitignore | 1 + ...ix-libpam-linking-in-autotools-build.patch | 59 +++++++++++++++++++ sources | 2 +- util-linux.spec | 5 +- 4 files changed, 64 insertions(+), 3 deletions(-) create mode 100644 0002-pam_lastlog2-fix-libpam-linking-in-autotools-build.patch diff --git a/.gitignore b/.gitignore index fa4f8f4..99b84c3 100644 --- a/.gitignore +++ b/.gitignore @@ -104,3 +104,4 @@ /util-linux-2.41.2.tar.xz /util-linux-2.41.3.tar.xz /util-linux-2.42.tar.xz +/util-linux-2.42.1.tar.xz diff --git a/0002-pam_lastlog2-fix-libpam-linking-in-autotools-build.patch b/0002-pam_lastlog2-fix-libpam-linking-in-autotools-build.patch new file mode 100644 index 0000000..375d025 --- /dev/null +++ b/0002-pam_lastlog2-fix-libpam-linking-in-autotools-build.patch @@ -0,0 +1,59 @@ +From 5549462c4d10e7b9c67d2cf4e99a7735770e816d Mon Sep 17 00:00:00 2001 +From: Karel Zak +Date: Tue, 19 May 2026 10:54:57 +0200 +Subject: [PATCH] pam_lastlog2: fix libpam linking in autotools build + +Move -lpam from LDFLAGS to LIBADD. When -lpam is in LDFLAGS it +appears on the linker command line before object files, so the +--as-needed linker flag (default on Fedora) discards it before +seeing any undefined PAM symbols. This results in pam_lastlog2.so +missing libpam.so in its ELF NEEDED entries. + +The module then fails to load with dlopen() if the calling process +does not itself link against libpam (e.g., systemd in Fedora 44+): + + PAM unable to dlopen(pam_lastlog2.so): undefined symbol: pam_syslog + +Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2453457 +Signed-off-by: Karel Zak +(cherry picked from commit 5683ed6320e00205146cbb3d0c76462733530eca) +--- + Makefile.in | 4 ++-- + pam_lastlog2/src/Makemodule.am | 4 ++-- + 2 files changed, 4 insertions(+), 4 deletions(-) + +diff --git a/Makefile.in b/Makefile.in +index 1234567..abcdefg 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -7596,9 +7596,9 @@ + @BUILD_PAM_LASTLOG2_TRUE@ $(SOLIB_CFLAGS) \ + @BUILD_PAM_LASTLOG2_TRUE@ -I$(ul_liblastlog2_incdir) + +-@BUILD_PAM_LASTLOG2_TRUE@pam_lastlog2_la_LIBADD = liblastlog2.la ++@BUILD_PAM_LASTLOG2_TRUE@pam_lastlog2_la_LIBADD = liblastlog2.la -lpam + @BUILD_PAM_LASTLOG2_TRUE@pam_lastlog2_la_LDFLAGS = $(SOLIB_LDFLAGS) \ +-@BUILD_PAM_LASTLOG2_TRUE@ -lpam -module -avoid-version -shared \ ++@BUILD_PAM_LASTLOG2_TRUE@ -module -avoid-version -shared \ + @BUILD_PAM_LASTLOG2_TRUE@ $(am__append_609) + POMAN_PO_FILES = $(wildcard po-man/*.po) + @ENABLE_ASCIIDOC_TRUE@@ENABLE_POMAN_TRUE@PO_STAMPS = po4a-gen.stamp +diff --git a/pam_lastlog2/src/Makemodule.am b/pam_lastlog2/src/Makemodule.am +index 629930853..876171e9f 100644 +--- a/pam_lastlog2/src/Makemodule.am ++++ b/pam_lastlog2/src/Makemodule.am +@@ -11,9 +11,9 @@ pam_lastlog2_la_CFLAGS = \ + $(SOLIB_CFLAGS) \ + -I$(ul_liblastlog2_incdir) + +-pam_lastlog2_la_LIBADD = liblastlog2.la ++pam_lastlog2_la_LIBADD = liblastlog2.la -lpam + +-pam_lastlog2_la_LDFLAGS = $(SOLIB_LDFLAGS) -lpam -module -avoid-version -shared ++pam_lastlog2_la_LDFLAGS = $(SOLIB_LDFLAGS) -module -avoid-version -shared + if HAVE_VSCRIPT + pam_lastlog2_la_LDFLAGS += $(VSCRIPT_LDFLAGS),$(top_srcdir)/pam_lastlog2/src/pam_lastlog2.sym + endif +-- +2.52.0 + diff --git a/sources b/sources index 51a58d9..aaa0b65 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (util-linux-2.42.tar.xz) = 909bba6c38d43ca4cb9bd974c399b4f0537b54709ac43e8acc823d9d9979fbc7523572469eb452b13c86116675d6d2ebb3764444781204f7e5bd0156252635d7 +SHA512 (util-linux-2.42.1.tar.xz) = 18dd2cfc353e389e4eeb37375473e7b3d0ab7fcd059a881d7cd0815ddcaa7b5795db92fcf56e531089267c8e69936c4fd3abd97786aa111b115996203aadbca2 diff --git a/util-linux.spec b/util-linux.spec index 9809b9f..7f000f7 100644 --- a/util-linux.spec +++ b/util-linux.spec @@ -1,9 +1,9 @@ ### Header Summary: Collection of basic system utilities Name: util-linux -Version: 2.42 +Version: 2.42.1 # -p -e rc1 -Release: %autorelease -b7 +Release: %autorelease License: GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-2.1-or-later AND BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause-UC AND LicenseRef-Fedora-Public-Domain URL: https://en.wikipedia.org/wiki/Util-linux @@ -106,6 +106,7 @@ Provides: /usr/sbin/sfdisk ### Fedora specific patches Patch0: 0000-login-use-O_CREAT-on-lastlog.patch Patch1: 0001-login-add-run-motd.d-to-the-hardcoded-MOTD_FILE.patch +Patch2: 0002-pam_lastlog2-fix-libpam-linking-in-autotools-build.patch %description The util-linux package contains a large variety of low-level system From ad160404f25800844ad14e6afad574c237c75942 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Tue, 19 May 2026 13:49:26 +0200 Subject: [PATCH 12/18] fix pam_lastlog2 patch to modify only Makefile.in --- ...ix-libpam-linking-in-autotools-build.patch | 21 ++----------------- 1 file changed, 2 insertions(+), 19 deletions(-) diff --git a/0002-pam_lastlog2-fix-libpam-linking-in-autotools-build.patch b/0002-pam_lastlog2-fix-libpam-linking-in-autotools-build.patch index 375d025..233a7f8 100644 --- a/0002-pam_lastlog2-fix-libpam-linking-in-autotools-build.patch +++ b/0002-pam_lastlog2-fix-libpam-linking-in-autotools-build.patch @@ -18,9 +18,8 @@ Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2453457 Signed-off-by: Karel Zak (cherry picked from commit 5683ed6320e00205146cbb3d0c76462733530eca) --- - Makefile.in | 4 ++-- - pam_lastlog2/src/Makemodule.am | 4 ++-- - 2 files changed, 4 insertions(+), 4 deletions(-) + Makefile.in | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile.in b/Makefile.in index 1234567..abcdefg 100644 @@ -38,22 +37,6 @@ index 1234567..abcdefg 100644 @BUILD_PAM_LASTLOG2_TRUE@ $(am__append_609) POMAN_PO_FILES = $(wildcard po-man/*.po) @ENABLE_ASCIIDOC_TRUE@@ENABLE_POMAN_TRUE@PO_STAMPS = po4a-gen.stamp -diff --git a/pam_lastlog2/src/Makemodule.am b/pam_lastlog2/src/Makemodule.am -index 629930853..876171e9f 100644 ---- a/pam_lastlog2/src/Makemodule.am -+++ b/pam_lastlog2/src/Makemodule.am -@@ -11,9 +11,9 @@ pam_lastlog2_la_CFLAGS = \ - $(SOLIB_CFLAGS) \ - -I$(ul_liblastlog2_incdir) - --pam_lastlog2_la_LIBADD = liblastlog2.la -+pam_lastlog2_la_LIBADD = liblastlog2.la -lpam - --pam_lastlog2_la_LDFLAGS = $(SOLIB_LDFLAGS) -lpam -module -avoid-version -shared -+pam_lastlog2_la_LDFLAGS = $(SOLIB_LDFLAGS) -module -avoid-version -shared - if HAVE_VSCRIPT - pam_lastlog2_la_LDFLAGS += $(VSCRIPT_LDFLAGS),$(top_srcdir)/pam_lastlog2/src/pam_lastlog2.sym - endif -- 2.52.0 From 49c5ecdbfba0787839a9f956c9edc14ff6732a03 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Wed, 20 May 2026 10:28:46 +0200 Subject: [PATCH 13/18] make util-linux-i18n noarch (rhbz#2453891) --- util-linux.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/util-linux.spec b/util-linux.spec index 7f000f7..d22ef6c 100644 --- a/util-linux.spec +++ b/util-linux.spec @@ -315,6 +315,7 @@ mountinfo, etc) and mount filesystems. Summary: Internationalization pack for util-linux Requires: util-linux = %{version}-%{release} License: GPL-2.0-or-later +BuildArch: noarch %description -n util-linux-i18n Internationalization pack with translated messages and manual pages for From 62e94b8fcbad1c982cb623aee26d7e00838bf4d9 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Wed, 20 May 2026 11:07:37 +0200 Subject: [PATCH 14/18] revert util-linux-i18n noarch (rhbz#2453891) --- util-linux.spec | 1 - 1 file changed, 1 deletion(-) diff --git a/util-linux.spec b/util-linux.spec index d22ef6c..7f000f7 100644 --- a/util-linux.spec +++ b/util-linux.spec @@ -315,7 +315,6 @@ mountinfo, etc) and mount filesystems. Summary: Internationalization pack for util-linux Requires: util-linux = %{version}-%{release} License: GPL-2.0-or-later -BuildArch: noarch %description -n util-linux-i18n Internationalization pack with translated messages and manual pages for From e20697608b0484e6be54a7368c5e178f2457d9ff Mon Sep 17 00:00:00 2001 From: Python Maint Date: Wed, 3 Jun 2026 17:43:18 +0200 Subject: [PATCH 15/18] Rebuilt for Python 3.15 From d3c879ee069eb7fcc931120f4bc72b5b43b1ce95 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Tue, 16 Jun 2026 14:54:51 +0200 Subject: [PATCH 16/18] upgrade to upstream release v2.42.2 --- .gitignore | 1 + ...ix-libpam-linking-in-autotools-build.patch | 42 ------------------- sources | 2 +- util-linux.spec | 3 +- 4 files changed, 3 insertions(+), 45 deletions(-) delete mode 100644 0002-pam_lastlog2-fix-libpam-linking-in-autotools-build.patch diff --git a/.gitignore b/.gitignore index 99b84c3..15c7c05 100644 --- a/.gitignore +++ b/.gitignore @@ -105,3 +105,4 @@ /util-linux-2.41.3.tar.xz /util-linux-2.42.tar.xz /util-linux-2.42.1.tar.xz +/util-linux-2.42.2.tar.xz diff --git a/0002-pam_lastlog2-fix-libpam-linking-in-autotools-build.patch b/0002-pam_lastlog2-fix-libpam-linking-in-autotools-build.patch deleted file mode 100644 index 233a7f8..0000000 --- a/0002-pam_lastlog2-fix-libpam-linking-in-autotools-build.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 5549462c4d10e7b9c67d2cf4e99a7735770e816d Mon Sep 17 00:00:00 2001 -From: Karel Zak -Date: Tue, 19 May 2026 10:54:57 +0200 -Subject: [PATCH] pam_lastlog2: fix libpam linking in autotools build - -Move -lpam from LDFLAGS to LIBADD. When -lpam is in LDFLAGS it -appears on the linker command line before object files, so the ---as-needed linker flag (default on Fedora) discards it before -seeing any undefined PAM symbols. This results in pam_lastlog2.so -missing libpam.so in its ELF NEEDED entries. - -The module then fails to load with dlopen() if the calling process -does not itself link against libpam (e.g., systemd in Fedora 44+): - - PAM unable to dlopen(pam_lastlog2.so): undefined symbol: pam_syslog - -Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=2453457 -Signed-off-by: Karel Zak -(cherry picked from commit 5683ed6320e00205146cbb3d0c76462733530eca) ---- - Makefile.in | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/Makefile.in b/Makefile.in -index 1234567..abcdefg 100644 ---- a/Makefile.in -+++ b/Makefile.in -@@ -7596,9 +7596,9 @@ - @BUILD_PAM_LASTLOG2_TRUE@ $(SOLIB_CFLAGS) \ - @BUILD_PAM_LASTLOG2_TRUE@ -I$(ul_liblastlog2_incdir) - --@BUILD_PAM_LASTLOG2_TRUE@pam_lastlog2_la_LIBADD = liblastlog2.la -+@BUILD_PAM_LASTLOG2_TRUE@pam_lastlog2_la_LIBADD = liblastlog2.la -lpam - @BUILD_PAM_LASTLOG2_TRUE@pam_lastlog2_la_LDFLAGS = $(SOLIB_LDFLAGS) \ --@BUILD_PAM_LASTLOG2_TRUE@ -lpam -module -avoid-version -shared \ -+@BUILD_PAM_LASTLOG2_TRUE@ -module -avoid-version -shared \ - @BUILD_PAM_LASTLOG2_TRUE@ $(am__append_609) - POMAN_PO_FILES = $(wildcard po-man/*.po) - @ENABLE_ASCIIDOC_TRUE@@ENABLE_POMAN_TRUE@PO_STAMPS = po4a-gen.stamp --- -2.52.0 - diff --git a/sources b/sources index aaa0b65..8420d1b 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (util-linux-2.42.1.tar.xz) = 18dd2cfc353e389e4eeb37375473e7b3d0ab7fcd059a881d7cd0815ddcaa7b5795db92fcf56e531089267c8e69936c4fd3abd97786aa111b115996203aadbca2 +SHA512 (util-linux-2.42.2.tar.xz) = 7415add0be2930654e322830808dde03ff6d511bd357f0679e6b6287a13ca79fe58ce4ac05edef86b76fb381b3a36ca2da9d3c31b5dc0a1d889c203156a57277 diff --git a/util-linux.spec b/util-linux.spec index 7f000f7..d92cb07 100644 --- a/util-linux.spec +++ b/util-linux.spec @@ -1,7 +1,7 @@ ### Header Summary: Collection of basic system utilities Name: util-linux -Version: 2.42.1 +Version: 2.42.2 # -p -e rc1 Release: %autorelease License: GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-2.1-or-later AND BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause-UC AND LicenseRef-Fedora-Public-Domain @@ -106,7 +106,6 @@ Provides: /usr/sbin/sfdisk ### Fedora specific patches Patch0: 0000-login-use-O_CREAT-on-lastlog.patch Patch1: 0001-login-add-run-motd.d-to-the-hardcoded-MOTD_FILE.patch -Patch2: 0002-pam_lastlog2-fix-libpam-linking-in-autotools-build.patch %description The util-linux package contains a large variety of low-level system From 9213a0ec8f2e3348008b124ea36bb7be3d88c745 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 17 Jul 2026 08:18:23 +0000 Subject: [PATCH 17/18] Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild From a0317f94b5e9504715995fb11d8e8555737683cf Mon Sep 17 00:00:00 2001 From: Python Maint Date: Wed, 22 Jul 2026 10:16:14 +0200 Subject: [PATCH 18/18] Rebuilt for Python 3.15.0b4 ABI change