From e873a14a1d864adc9912834adb50e2237ea8c0b0 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Mon, 12 May 2025 14:16:44 +0200 Subject: [PATCH 01/37] upgrade to upstream release v2.41 ... https://www.kernel.org/pub/linux/utils/util-linux/v2.41/v2.41-ReleaseNotes - add lastlog2 library and PAM module - add new utils bits, coresched and lastlog2 --- .gitignore | 1 + ...mount-fix-no-canonicalize-regression.patch | 44 ++++++++ ...id-allow-up-to-64k-erofs-block-sizes.patch | 33 ------ ...ed-reference-to-add_namespace_for_ns.patch | 58 ++++++++++ ...e-compilation-without-USE_NS_GET_API.patch | 41 +++++++ ...scription-for-PACKET.PROTOCOL-column.patch | 42 +++++++ ...n-the-protocol-field-of-proc-net-pac.patch | 64 +++++++++++ ...include-cctype-fix-string-comparison.patch | 106 ++++++++++++++++++ ...dmnt-fix-k-option-parsing-regression.patch | 86 ++++++++++++++ ...unt-api-utils-include-linux-unistd.h.patch | 40 +++++++ ...not-use-strerror-on-shared-libraries.patch | 71 ++++++++++++ sources | 2 +- util-linux-uuidd-sysusers.conf | 1 - util-linux.spec | 84 ++++++++++++-- 14 files changed, 627 insertions(+), 46 deletions(-) create mode 100644 0000-libmount-fix-no-canonicalize-regression.patch delete mode 100644 0001-blkid-allow-up-to-64k-erofs-block-sizes.patch create mode 100644 0001-lsns-fix-undefined-reference-to-add_namespace_for_ns.patch create mode 100644 0002-lsns-enhance-compilation-without-USE_NS_GET_API.patch create mode 100644 0003-lsfd-fix-the-description-for-PACKET.PROTOCOL-column.patch create mode 100644 0004-lsfd-bug-fix-scan-the-protocol-field-of-proc-net-pac.patch create mode 100644 0005-include-cctype-fix-string-comparison.patch create mode 100644 0006-findmnt-fix-k-option-parsing-regression.patch create mode 100644 0007-include-mount-api-utils-include-linux-unistd.h.patch create mode 100644 0008-Do-not-use-strerror-on-shared-libraries.patch delete mode 100644 util-linux-uuidd-sysusers.conf diff --git a/.gitignore b/.gitignore index 9be7f90..d5db0c0 100644 --- a/.gitignore +++ b/.gitignore @@ -99,3 +99,4 @@ /util-linux-2.40.1.tar.xz /util-linux-2.40.2.tar.xz /util-linux-2.40.4.tar.xz +/util-linux-2.41.tar.xz diff --git a/0000-libmount-fix-no-canonicalize-regression.patch b/0000-libmount-fix-no-canonicalize-regression.patch new file mode 100644 index 0000000..7a19896 --- /dev/null +++ b/0000-libmount-fix-no-canonicalize-regression.patch @@ -0,0 +1,44 @@ +From a131545a35afeaf3b48fa42ddc876dd14f942486 Mon Sep 17 00:00:00 2001 +From: Karel Zak +Date: Mon, 24 Mar 2025 14:31:05 +0100 +Subject: libmount: fix --no-canonicalize regression + +Fixes: https://github.com/util-linux/util-linux/issues/3474 +Signed-off-by: Karel Zak +(cherry picked from commit 7dbfe31a83f45d5aef2b508697e9511c569ffbc8) +(cherry picked from commit 77723beaaaca654f72ac9538772e69fbafa8835d) +--- + libmount/src/context.c | 3 --- + sys-utils/mount.8.adoc | 2 +- + 2 files changed, 1 insertion(+), 4 deletions(-) + +diff --git a/libmount/src/context.c b/libmount/src/context.c +index 0323cb23d..15a8ad3bb 100644 +--- a/libmount/src/context.c ++++ b/libmount/src/context.c +@@ -530,9 +530,6 @@ int mnt_context_is_xnocanonicalize( + assert(cxt); + assert(type); + +- if (mnt_context_is_nocanonicalize(cxt)) +- return 1; +- + ol = mnt_context_get_optlist(cxt); + if (!ol) + return 0; +diff --git a/sys-utils/mount.8.adoc b/sys-utils/mount.8.adoc +index 4f23f8d1f..5103b91c5 100644 +--- a/sys-utils/mount.8.adoc ++++ b/sys-utils/mount.8.adoc +@@ -756,7 +756,7 @@ Allow to make a target directory (mountpoint) if it does not exist yet. The opti + *X-mount.nocanonicalize*[**=**_type_]:: + Allows disabling of canonicalization for mount source and target paths. By default, the `mount` command resolves all paths to their absolute paths without symlinks. However, this behavior may not be desired in certain situations, such as when binding a mount over a symlink, or a symlink over a directory or another symlink. The optional argument _type_ can be either "source" or "target" (mountpoint). If no _type_ is specified, then canonicalization is disabled for both types. This mount option does not affect the conversion of source tags (e.g. LABEL= or UUID=) and fstab processing. + + +-The command line option *--no-canonicalize* overrides this mount option and affects all path and tag conversions in all situations, but it does not modify flags for open_tree syscalls. ++The command-line option *--no-canonicalize* overrides this mount option and affects all path and tag conversions in all situations, but for backward compatibility, it does not modify open_tree syscall flags and does not allow the bind-mount over a symlink use case. + + + Note that *mount*(8) still sanitizes and canonicalizes the source and target paths specified on the command line by non-root users, regardless of the X-mount.nocanonicalize setting. + +-- +2.49.0 + diff --git a/0001-blkid-allow-up-to-64k-erofs-block-sizes.patch b/0001-blkid-allow-up-to-64k-erofs-block-sizes.patch deleted file mode 100644 index 825c7d0..0000000 --- a/0001-blkid-allow-up-to-64k-erofs-block-sizes.patch +++ /dev/null @@ -1,33 +0,0 @@ -From ff0ac0f27dc3de7d250b2a69f6452bfeec104f8c Mon Sep 17 00:00:00 2001 -From: Eric Sandeen -Date: Fri, 24 Jan 2025 08:37:12 -0600 -Subject: [PATCH] blkid: allow up to 64k erofs block sizes - -Today, mkfs.erofs defaults to page size for block size, but blkid -does not recognize this. Increase the limit to 64k. - -Reviewed-by: Gao Xiang -Signed-off-by: Eric Sandeen -Signed-off-by: Karel Zak ---- - libblkid/src/superblocks/erofs.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/libblkid/src/superblocks/erofs.c b/libblkid/src/superblocks/erofs.c -index 05822460b..57fd80220 100644 ---- a/libblkid/src/superblocks/erofs.c -+++ b/libblkid/src/superblocks/erofs.c -@@ -73,8 +73,8 @@ static int probe_erofs(blkid_probe pr, const struct blkid_idmag *mag) - if (!sb) - return errno ? -errno : BLKID_PROBE_NONE; - -- /* EROFS is restricted to 4KiB block size */ -- if (sb->blkszbits > 31 || (1U << sb->blkszbits) > 4096) -+ /* block size must be between 512 and 64k */ -+ if (sb->blkszbits < 9 || sb->blkszbits > 16) - return BLKID_PROBE_NONE; - - if (!erofs_verify_checksum(pr, mag, sb)) --- -2.48.1 - diff --git a/0001-lsns-fix-undefined-reference-to-add_namespace_for_ns.patch b/0001-lsns-fix-undefined-reference-to-add_namespace_for_ns.patch new file mode 100644 index 0000000..e2ae158 --- /dev/null +++ b/0001-lsns-fix-undefined-reference-to-add_namespace_for_ns.patch @@ -0,0 +1,58 @@ +From 5f4a11bf3d99512c369b6ba901046d0943ee6d09 Mon Sep 17 00:00:00 2001 +From: Thomas Devoogdt +Date: Tue, 25 Mar 2025 11:58:18 +0100 +Subject: lsns: fix undefined reference to add_namespace_for_nsfd #3483 + +Fixes: + +sys-utils/lsns-lsns.o: In function `read_process': +lsns.c:(.text+0x9e8): undefined reference to `add_namespace_for_nsfd' +collect2: error: ld returned 1 exit status + +Signed-off-by: Thomas Devoogdt +(cherry picked from commit 2ced43400f35f7bd45b29364e04166a63a06e16a) +(cherry picked from commit bd36a077e16eca888d843a0c30e77379aedfe350) +--- + sys-utils/lsns.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/sys-utils/lsns.c b/sys-utils/lsns.c +index 6b2dcba96..d046d69e3 100644 +--- a/sys-utils/lsns.c ++++ b/sys-utils/lsns.c +@@ -587,7 +587,10 @@ static void add_namespace_from_sock(struct lsns *ls, pid_t pid, uint64_t fd) + if (get_namespace(ls, sb.st_ino)) + goto out_nsfd; + ++#ifdef USE_NS_GET_API + add_namespace_for_nsfd(ls, nsfd, sb.st_ino); ++#endif ++ + out_nsfd: + close(nsfd); + out_sk: +@@ -608,6 +611,7 @@ static void add_namespace_from_sock(struct lsns *ls __attribute__((__unused__)), + { + } + #endif /* HAVE_LINUX_NET_NAMESPACE_H */ ++ + /* Read namespaces open(2)ed explicitly by the process specified by `pc'. */ + static void read_opened_namespaces(struct lsns *ls, struct path_cxt *pc, pid_t pid) + { +@@ -627,11 +631,13 @@ static void read_opened_namespaces(struct lsns *ls, struct path_cxt *pc, pid_t p + if (st.st_dev == ls->nsfs_dev) { + if (get_namespace(ls, st.st_ino)) + continue; ++#ifdef USE_NS_GET_API + int fd = ul_path_openf(pc, O_RDONLY, "fd/%ju", (uintmax_t) num); + if (fd >= 0) { + add_namespace_for_nsfd(ls, fd, st.st_ino); + close(fd); + } ++#endif + } else if ((st.st_mode & S_IFMT) == S_IFSOCK) { + add_namespace_from_sock(ls, pid, num); + } +-- +2.49.0 + diff --git a/0002-lsns-enhance-compilation-without-USE_NS_GET_API.patch b/0002-lsns-enhance-compilation-without-USE_NS_GET_API.patch new file mode 100644 index 0000000..07685a2 --- /dev/null +++ b/0002-lsns-enhance-compilation-without-USE_NS_GET_API.patch @@ -0,0 +1,41 @@ +From 45389b02bdc8adeeb35b81dd7ef1e20f0e84bd69 Mon Sep 17 00:00:00 2001 +From: Karel Zak +Date: Tue, 1 Apr 2025 14:36:36 +0200 +Subject: lsns: enhance compilation without USE_NS_GET_API + +- Move add_namespace_for_nsfd() declaration to the #ifdef block +(based on c62ed3d58602fd29fe12085f7caf03761ed91b81) + +References: 2ced43400f35f7bd45b29364e04166a63a06e16a +Signed-off-by: Karel Zak +(cherry picked from commit 05d494d32bd9941ae0edbe591cefc047de3e9052) +--- + sys-utils/lsns.c | 5 +++-- + 1 file changed, 3 insertions(+), 2 deletions(-) + +diff --git a/sys-utils/lsns.c b/sys-utils/lsns.c +index d046d69e3..ede7a3992 100644 +--- a/sys-utils/lsns.c ++++ b/sys-utils/lsns.c +@@ -304,6 +304,9 @@ static inline const struct colinfo *get_column_info(unsigned num) + } + + #ifdef USE_NS_GET_API ++static struct lsns_namespace *add_namespace_for_nsfd(struct lsns *ls, int fd, ino_t ino); ++ ++ + /* Get the inode number for the parent namespace of the namespace `fd' specifies. + * If `pfd' is non-null, the file descriptor opening the parent namespace.*/ + static int get_parent_ns_ino(int fd, enum lsns_type lsns_type, ino_t *pino, int *pfd) +@@ -422,8 +425,6 @@ error: + return rc; + } + +-static struct lsns_namespace *add_namespace_for_nsfd(struct lsns *ls, int fd, ino_t ino); +- + static struct lsns_namespace *get_namespace(struct lsns *ls, ino_t ino) + { + struct list_head *p; +-- +2.49.0 + diff --git a/0003-lsfd-fix-the-description-for-PACKET.PROTOCOL-column.patch b/0003-lsfd-fix-the-description-for-PACKET.PROTOCOL-column.patch new file mode 100644 index 0000000..7a396cf --- /dev/null +++ b/0003-lsfd-fix-the-description-for-PACKET.PROTOCOL-column.patch @@ -0,0 +1,42 @@ +From 6b7fa6aa3a0f59c81cba859563548dd5a0e3213c Mon Sep 17 00:00:00 2001 +From: Masatake YAMATO +Date: Mon, 6 Jan 2025 02:55:19 +0900 +Subject: lsfd: fix the description for PACKET.PROTOCOL column + +Signed-off-by: Masatake YAMATO +(cherry picked from commit df3b38fab56001537364302479b33cb104ef7411) +(cherry picked from commit b7b96894c2f27f8a361f5bab2a239c9f64034557) +--- + lsfd-cmd/lsfd.1.adoc | 2 +- + lsfd-cmd/lsfd.c | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/lsfd-cmd/lsfd.1.adoc b/lsfd-cmd/lsfd.1.adoc +index e9a01d26a..bd6885f82 100644 +--- a/lsfd-cmd/lsfd.1.adoc ++++ b/lsfd-cmd/lsfd.1.adoc +@@ -386,7 +386,7 @@ PACKET.IFACE <``string``>:: + Interface name associated with the packet socket. + + PACKET.PROTOCOL <``string``>:: +-L3 protocol associated with the packet socket. ++L2 protocol associated with the packet socket. + + PARTITION <``string``>:: + Block device name resolved by `/proc/partition`. +diff --git a/lsfd-cmd/lsfd.c b/lsfd-cmd/lsfd.c +index 66c60a4e8..714083e70 100644 +--- a/lsfd-cmd/lsfd.c ++++ b/lsfd-cmd/lsfd.c +@@ -311,7 +311,7 @@ static const struct colinfo infos[] = { + N_("net interface associated with the packet socket") }, + [COL_PACKET_PROTOCOL] = { "PACKET.PROTOCOL", + 0, SCOLS_FL_RIGHT,SCOLS_JSON_STRING, +- N_("L3 protocol associated with the packet socket") }, ++ N_("L2 protocol associated with the packet socket") }, + [COL_PARTITION] = { "PARTITION", + 0, SCOLS_FL_RIGHT, SCOLS_JSON_STRING, + N_("block device name resolved by /proc/partition") }, +-- +2.49.0 + diff --git a/0004-lsfd-bug-fix-scan-the-protocol-field-of-proc-net-pac.patch b/0004-lsfd-bug-fix-scan-the-protocol-field-of-proc-net-pac.patch new file mode 100644 index 0000000..09efd07 --- /dev/null +++ b/0004-lsfd-bug-fix-scan-the-protocol-field-of-proc-net-pac.patch @@ -0,0 +1,64 @@ +From 20066a4dba10ea4893e0c8ec0d939e6a16f949d0 Mon Sep 17 00:00:00 2001 +From: Masatake YAMATO +Date: Mon, 6 Jan 2025 03:30:25 +0900 +Subject: lsfd: (bug fix) scan the protocol field of /proc/net/packet as a hex + number + +Signed-off-by: Masatake YAMATO +(cherry picked from commit 0da7e8201aa7b9b2c5d0e901c0ccfd6f3bdc54d3) +(cherry picked from commit 798e4da071a96b14c7449bced9f16dc351dc5d84) +--- + lsfd-cmd/sock-xinfo.c | 2 +- + tests/expected/lsfd/mkfds-mapped-packet-socket | 4 ++-- + tests/ts/lsfd/mkfds-mapped-packet-socket | 3 ++- + 3 files changed, 5 insertions(+), 4 deletions(-) + +diff --git a/lsfd-cmd/sock-xinfo.c b/lsfd-cmd/sock-xinfo.c +index f6811213a..42d8e0919 100644 +--- a/lsfd-cmd/sock-xinfo.c ++++ b/lsfd-cmd/sock-xinfo.c +@@ -2373,7 +2373,7 @@ static void load_xinfo_from_proc_packet(ino_t netns_inode) + unsigned long inode; + struct packet_xinfo *pkt; + +- if (sscanf(line, "%*x %*d %" SCNu16 " %" SCNu16 " %u %*d %*d %*d %lu", ++ if (sscanf(line, "%*x %*d %" SCNu16 " %" SCNx16 " %u %*d %*d %*d %lu", + &type, &protocol, &iface, &inode) < 4) + continue; + +diff --git a/tests/expected/lsfd/mkfds-mapped-packet-socket b/tests/expected/lsfd/mkfds-mapped-packet-socket +index ec8795b70..2e9db5eb5 100644 +--- a/tests/expected/lsfd/mkfds-mapped-packet-socket ++++ b/tests/expected/lsfd/mkfds-mapped-packet-socket +@@ -1,8 +1,8 @@ + PACKET + SOCK.PROTONAME: 0 +-type=raw protocol=all iface=lo raw PACKET lo all ++type=raw protocol=ppptalk iface=lo raw PACKET lo ppptalk + NAME,SOCK.TYPE,SOCK.PROTONAME,PACKET.IFACE,PACKET.PROTOCOL: 0 + PACKET + SOCK.PROTONAME: 0 +-type=dgram protocol=all iface=lo dgram PACKET lo all ++type=dgram protocol=ppptalk iface=lo dgram PACKET lo ppptalk + NAME,SOCK.TYPE,SOCK.PROTONAME,PACKET.IFACE,PACKET.PROTOCOL: 0 +diff --git a/tests/ts/lsfd/mkfds-mapped-packet-socket b/tests/ts/lsfd/mkfds-mapped-packet-socket +index 12c5ef6bc..c3a73c54e 100755 +--- a/tests/ts/lsfd/mkfds-mapped-packet-socket ++++ b/tests/ts/lsfd/mkfds-mapped-packet-socket +@@ -35,11 +35,12 @@ FD=3 + EXPR= + INTERFACE=lo + SOCKTYPE= ++PROTOCOL=$(printf "%d" 0x10) + ERR= + + for SOCKTYPE in RAW DGRAM; do + coproc MKFDS { "$TS_HELPER_MKFDS" mapped-packet-socket $FD \ +- interface=${INTERFACE} socktype=${SOCKTYPE}; } ++ interface=${INTERFACE} socktype=${SOCKTYPE} protocol=${PROTOCOL}; } + if read -u ${MKFDS[0]} PID; then + EXPR='(ASSOC == "shm") and (STTYPE == "SOCK") and (MODE == "-w-")' + ${TS_CMD_LSFD} -p "$PID" -n -o SOCK.PROTONAME -Q "${EXPR}" +-- +2.49.0 + diff --git a/0005-include-cctype-fix-string-comparison.patch b/0005-include-cctype-fix-string-comparison.patch new file mode 100644 index 0000000..9facf54 --- /dev/null +++ b/0005-include-cctype-fix-string-comparison.patch @@ -0,0 +1,106 @@ +From 63317155429b35347f869f5996e5c354a398c6d3 Mon Sep 17 00:00:00 2001 +From: Karel Zak +Date: Wed, 2 Apr 2025 11:00:47 +0200 +Subject: include/cctype: fix string comparison + +Reimplement c_strcasecmp() and c_strncasecmp() to be libc compatible +and fix c_strncasecmp() to avoid \0 misinterpretation. The original +implementation was pretty stupid (sorry). + +Signed-off-by: Karel Zak +(cherry picked from commit 259157b0c1a00806ff75188325e40ba10adf12ce) +(cherry picked from commit e6a7001bb539256cdd71e4f032c2842151814556) +--- + include/cctype.h | 55 ++++++++++++++++++++++++++++++++---------------- + 1 file changed, 37 insertions(+), 18 deletions(-) + +diff --git a/include/cctype.h b/include/cctype.h +index b673b6cff..e55c008b8 100644 +--- a/include/cctype.h ++++ b/include/cctype.h +@@ -23,6 +23,9 @@ + #ifndef UTIL_LINUX_CCTYPE_H + #define UTIL_LINUX_CCTYPE_H + ++#include ++#include ++ + /** + * The functions defined in this file assume the "C" locale and a character + * set without diacritics (ASCII-US or EBCDIC-US or something like that). +@@ -317,38 +320,54 @@ static inline int c_toupper (int c) + } + } + ++#define C_CTYPE_CMP(c1, c2) (((c1) > (c2)) - ((c1) < (c2))) ++ + static inline int c_strncasecmp(const char *a, const char *b, size_t n) + { +- int res = 0; ++ const unsigned char *p1 = (const unsigned char *) a; ++ const unsigned char *p2 = (const unsigned char *) b; ++ unsigned char x, y; + +- for (; n > 0; a++, b++, n--) { +- unsigned int x = (unsigned int) *a; +- unsigned int y = (unsigned int) *b; ++ if (n == 0 || p1 == p2) ++ return 0; + +- res = c_tolower(x) - c_tolower(y); +- if (res) +- break; +- } +- return res; ++ do { ++ x = c_tolower(*p1); ++ y = c_tolower(*p2); ++ ++ if (--n == 0 || x == '\0') ++ break; ++ ++p1, ++p2; ++ } while (x == y); ++ ++ if (UCHAR_MAX <= INT_MAX) ++ return x - y; ++ ++ return C_CTYPE_CMP(x, y); + } + + static inline int c_strcasecmp(const char *a, const char *b) + { +- int res = 0; ++ const unsigned char *p1 = (const unsigned char *) a; ++ const unsigned char *p2 = (const unsigned char *) b; ++ unsigned char x, y; + +- if (a == b) ++ if (p1 == p2) + return 0; + +- for (; *a != '\0'; a++, b++) { +- unsigned int x = (unsigned int) *a; +- unsigned int y = (unsigned int) *b; ++ do { ++ x = c_tolower(*p1); ++ y = c_tolower(*p2); + +- res = c_tolower(x) - c_tolower(y); +- if (res) ++ if (x == '\0') + break; +- } ++ ++p1, ++p2; ++ } while (x == y); + +- return res; ++ if (UCHAR_MAX <= INT_MAX) ++ return x - y; ++ ++ return C_CTYPE_CMP(x, y); + } + + #endif /* UTIL_LINUX_CCTYPE_H */ +-- +2.49.0 + diff --git a/0006-findmnt-fix-k-option-parsing-regression.patch b/0006-findmnt-fix-k-option-parsing-regression.patch new file mode 100644 index 0000000..111846d --- /dev/null +++ b/0006-findmnt-fix-k-option-parsing-regression.patch @@ -0,0 +1,86 @@ +From 450ec45368df36601f44ff4b385e04a5ca2f1134 Mon Sep 17 00:00:00 2001 +From: Karel Zak +Date: Mon, 7 Apr 2025 12:35:02 +0200 +Subject: findmnt: fix -k option parsing regression + +It's a really bad idea to change any existing short option to support +optional arguments. + +Fixes: https://github.com/util-linux/util-linux/issues/3512 +References: 841d15e5d13dd0cc56e450c8dcc592211d66be27 +Signed-off-by: Karel Zak +(cherry picked from commit 0ecaef693ea60aab709e79dd4a8eb2865ec08967) +(cherry picked from commit 9d4df7905ec03c3ea6e9bdf0aaa91e862168d29a) +--- + misc-utils/findmnt.8.adoc | 2 +- + misc-utils/findmnt.c | 13 +++++++++---- + 2 files changed, 10 insertions(+), 5 deletions(-) + +diff --git a/misc-utils/findmnt.8.adoc b/misc-utils/findmnt.8.adoc +index fe29afe77..bea0496ff 100644 +--- a/misc-utils/findmnt.8.adoc ++++ b/misc-utils/findmnt.8.adoc +@@ -87,7 +87,7 @@ Use JSON output format. + *-k*, *--kernel*[_=method_]:: + Reads information about filesystems from the kernel. This is the default output. The format is tree-like and only includes mount options managed by the kernel (see also *--mtab*). + + +-The optional argument _method_ can be either: ++The optional argument _method_ is supported only for the long variant (--kernel). The short variant (-k) defaults to the mountinfo method for backward compatibility. The supported methods can be either: + + + * *mountinfo* - this is the default method and it reads data from the _/proc/self/mountinfo_ file. + + +diff --git a/misc-utils/findmnt.c b/misc-utils/findmnt.c +index fbfb84c94..b183a9c05 100644 +--- a/misc-utils/findmnt.c ++++ b/misc-utils/findmnt.c +@@ -1530,7 +1530,8 @@ static void __attribute__((__noreturn__)) usage(void) + fputs(_(" -F, --tab-file alternative file for -s, -m or -k options\n"), out); + fputs(_(" -m, --mtab search in table of mounted filesystems\n" + " (includes user space mount options)\n"), out); +- fputs(_(" -k, --kernel[=] search in kernel mount table (default)\n" ++ fputs(_(" -k alias to '--kernel mountinfo'\n"), out); ++ fputs(_(" --kernel[=] search in kernel mount table (default)\n" + " is mountinfo or listmount\n"), out); + fputs(_(" -N, --task use alternative namespace (/proc//mountinfo file)\n"), out); + fputs(_(" -p, --poll[=] monitor changes in table of mounted filesystems\n"), out); +@@ -1763,7 +1764,8 @@ int main(int argc, char *argv[]) + FINDMNT_OPT_SHADOWED, + FINDMNT_OPT_HYPERLINK, + FINDMNT_OPT_ID, +- FINDMNT_OPT_UNIQ_ID ++ FINDMNT_OPT_UNIQ_ID, ++ FINDMNT_OPT_KERNEL + }; + + static const struct option longopts[] = { +@@ -1780,7 +1782,7 @@ int main(int argc, char *argv[]) + { "help", no_argument, NULL, 'h' }, + { "invert", no_argument, NULL, 'i' }, + { "json", no_argument, NULL, 'J' }, +- { "kernel", optional_argument, NULL, 'k' }, ++ { "kernel", optional_argument, NULL, FINDMNT_OPT_KERNEL }, + { "list", no_argument, NULL, 'l' }, + { "mountpoint", required_argument, NULL, 'M' }, + { "mtab", no_argument, NULL, 'm' }, +@@ -1843,7 +1845,7 @@ int main(int argc, char *argv[]) + findmnt.flags |= FL_TREE; + + while ((c = getopt_long(argc, argv, +- "AabCcDd:ehIiJfF:o:O:p::PQ:k::lmM:nN:rst:uvRS:T:Uw:VxyH", ++ "AabCcDd:ehIiJfF:o:O:p::PQ:klmM:nN:rst:uvRS:T:Uw:VxyH", + longopts, NULL)) != -1) { + + err_exclusive_options(c, longopts, excl, excl_st); +@@ -1940,6 +1942,9 @@ int main(int argc, char *argv[]) + findmnt.flags &= ~FL_TREE; + break; + case 'k': ++ tabtype = TABTYPE_KERNEL_MOUNTINFO; ++ break; ++ case FINDMNT_OPT_KERNEL: + if (optarg) { + if (strcmp(optarg, "mountinfo") == 0) + tabtype = TABTYPE_KERNEL_MOUNTINFO; +-- +2.49.0 + diff --git a/0007-include-mount-api-utils-include-linux-unistd.h.patch b/0007-include-mount-api-utils-include-linux-unistd.h.patch new file mode 100644 index 0000000..01d3375 --- /dev/null +++ b/0007-include-mount-api-utils-include-linux-unistd.h.patch @@ -0,0 +1,40 @@ +From 598b6e97f6eb90771d3e7d57135405b2f2d20843 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= +Date: Sat, 19 Apr 2025 22:02:11 +0200 +Subject: include/mount-api-utils: include linux/unistd.h +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +If SYS_statmount/SYS_listmount is not provided by the libc, +util-linux will fall back to __NR_statmount/__NR_listmount from the +kernel UAPI headers. +However it is not guaranteed that these symbols are actually visible in +mount-api-utils. + +Include linux/unistd.h which provides syscall numbers. +While this header is specific to Linux, the code is already using +linux/mount.h. + +Signed-off-by: Thomas Weißschuh +(cherry picked from commit 0033f97482a7979e0de71de0a16b583e8d74dbdc) +(cherry picked from commit 7e9665e31d57d16efa304d4421eb8c9d98d8eaf1) +--- + include/mount-api-utils.h | 1 + + 1 file changed, 1 insertion(+) + +diff --git a/include/mount-api-utils.h b/include/mount-api-utils.h +index 5e1905c45..02bb326c6 100644 +--- a/include/mount-api-utils.h ++++ b/include/mount-api-utils.h +@@ -8,6 +8,7 @@ + #ifdef HAVE_LINUX_MOUNT_H + #include + #include ++#include + #include + #include + +-- +2.49.0 + diff --git a/0008-Do-not-use-strerror-on-shared-libraries.patch b/0008-Do-not-use-strerror-on-shared-libraries.patch new file mode 100644 index 0000000..d8b071a --- /dev/null +++ b/0008-Do-not-use-strerror-on-shared-libraries.patch @@ -0,0 +1,71 @@ +From f83c532a797b98f5e4d3f894744f3f2065c414ea Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Cristian=20Rodr=C3=ADguez?= +Date: Sun, 13 Apr 2025 09:22:47 -0400 +Subject: Do not use strerror on shared libraries + +Using strerror is not safe in shared libraries as it is unknown +what the calling apps may do with the storage behind the scenes. +Using %m is ok, except in contexts that need to be as-safe. + +(cherry picked from commit c5850c36e14085cddf8db9e19d447d928fa153d0) +(cherry picked from commit 1f7a5b3c3cc1ad1ab1b72e68d0ae49cb171c5c45) +--- + libblkid/src/verify.c | 8 ++++---- + liblastlog2/src/lastlog2.c | 8 ++++---- + 2 files changed, 8 insertions(+), 8 deletions(-) + +diff --git a/libblkid/src/verify.c b/libblkid/src/verify.c +index 3b9754f57..abd3d1246 100644 +--- a/libblkid/src/verify.c ++++ b/libblkid/src/verify.c +@@ -73,8 +73,8 @@ blkid_dev blkid_verify(blkid_cache cache, blkid_dev dev) + diff = (uintmax_t)now - dev->bid_time; + + if (stat(dev->bid_name, &st) < 0) { +- DBG(PROBE, ul_debug("blkid_verify: error %s (%d) while " +- "trying to stat %s", strerror(errno), errno, ++ DBG(PROBE, ul_debug("blkid_verify: error %m (%d) while " ++ "trying to stat %s", errno, + dev->bid_name)); + open_err: + if ((errno == EPERM) || (errno == EACCES) || (errno == ENOENT)) { +@@ -128,8 +128,8 @@ blkid_dev blkid_verify(blkid_cache cache, blkid_dev dev) + + fd = open(dev->bid_name, O_RDONLY|O_CLOEXEC|O_NONBLOCK); + if (fd < 0) { +- DBG(PROBE, ul_debug("blkid_verify: error %s (%d) while " +- "opening %s", strerror(errno), errno, ++ DBG(PROBE, ul_debug("blkid_verify: error %m (%d) while " ++ "opening %s", errno, + dev->bid_name)); + goto open_err; + } +diff --git a/liblastlog2/src/lastlog2.c b/liblastlog2/src/lastlog2.c +index 2d3ab2050..020c77106 100644 +--- a/liblastlog2/src/lastlog2.c ++++ b/liblastlog2/src/lastlog2.c +@@ -559,8 +559,8 @@ ll2_import_lastlog(struct ll2_context *context, const char *lastlog_file, + + ll_fp = fopen(lastlog_file, "r"); + if (ll_fp == NULL) { +- if (error && asprintf(error, "Failed to open '%s': %s", +- lastlog_file, strerror(errno)) < 0) ++ if (error && asprintf(error, "Failed to open '%s': %m", ++ lastlog_file) < 0) + return -ENOMEM; + + return -1; +@@ -569,8 +569,8 @@ ll2_import_lastlog(struct ll2_context *context, const char *lastlog_file, + + if (fstat(fileno(ll_fp), &statll) != 0) { + retval = -1; +- if (error && asprintf(error, "Cannot get size of '%s': %s", +- lastlog_file, strerror(errno)) < 0) ++ if (error && asprintf(error, "Cannot get size of '%s': %m", ++ lastlog_file) < 0) + retval = -ENOMEM; + + goto done; +-- +2.49.0 + diff --git a/sources b/sources index ed7ccad..1094aa2 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (util-linux-2.40.4.tar.xz) = 0024955056ba7b4c54040a917f9919f49692e57ba6d42d17a6c29c1eefe88bf48b1214a545072b71c468829a63a8f15237f49733e9127c134e11126d1e435124 +SHA512 (util-linux-2.41.tar.xz) = 800ff92ee7a047732c0accb9dd759d6ed659947373ca72e0dd3ca601d0a6fed9db92c0838cfaff6bcdb8c08bdc1ffa675721893f42945885c57ccd59ab676318 diff --git a/util-linux-uuidd-sysusers.conf b/util-linux-uuidd-sysusers.conf deleted file mode 100644 index afd02eb..0000000 --- a/util-linux-uuidd-sysusers.conf +++ /dev/null @@ -1 +0,0 @@ -u uuidd - "UUID generator helper daemon" /var/lib/libuuid diff --git a/util-linux.spec b/util-linux.spec index f5198a1..b61f83c 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.40.4 +Version: 2.41 # -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 @@ -56,9 +56,6 @@ Source13: util-linux-su-l.pamd Source14: util-linux-runuser.pamd Source15: util-linux-runuser-l.pamd -# temporary, will be in upstream >= v2.41 -Source16: util-linux-uuidd-sysusers.conf - ### Obsoletes & Conflicts & Provides Conflicts: initscripts < 9.79-4 Conflicts: bash-completion < 1:2.1-1 @@ -93,6 +90,7 @@ Requires: libblkid = %{version}-%{release} Requires: libmount = %{version}-%{release} Requires: libsmartcols = %{version}-%{release} Requires: libfdisk = %{version}-%{release} +Requires: liblastlog2 = %{version}-%{release} Requires: util-linux-core = %{version}-%{release} %if "%{_sbindir}" == "%{_bindir}" @@ -111,8 +109,17 @@ Patch0: login-lastlog-create.patch # https://github.com/coreos/console-login-helper-messages/issues/60 Patch1: login-default-motd-file.patch -# Backport better support for erofs on ppc64le -Patch2: 0001-blkid-allow-up-to-64k-erofs-block-sizes.patch +# Upstream patches (to be included in v2.41.1) +Patch2: 0000-libmount-fix-no-canonicalize-regression.patch +Patch3: 0001-lsns-fix-undefined-reference-to-add_namespace_for_ns.patch +Patch4: 0002-lsns-enhance-compilation-without-USE_NS_GET_API.patch +Patch5: 0003-lsfd-fix-the-description-for-PACKET.PROTOCOL-column.patch +Patch6: 0004-lsfd-bug-fix-scan-the-protocol-field-of-proc-net-pac.patch +Patch7: 0005-include-cctype-fix-string-comparison.patch +Patch8: 0006-findmnt-fix-k-option-parsing-regression.patch +Patch9: 0007-include-mount-api-utils-include-linux-unistd.h.patch +Patch10: 0008-Do-not-use-strerror-on-shared-libraries.patch + %description The util-linux package contains a large variety of low-level system @@ -215,6 +222,25 @@ This is the device mounting development library and headers, part of util-linux. +%package -n liblastlog2 +Summary: lastlog database library and PAM module +License: BSD-2-Clause + +%description -n liblastlog2 +This is the lastlog database library and PAM module, part of util-linux. + + +%package -n liblastlog2-devel +Summary: lastlog database library +License: BSD-2-Clause +Requires: liblastlog2%{?_isa} = %{version}-%{release} +Requires: pkgconfig + +%description -n liblastlog2-devel +This is the lastlog database development library and headers, +part of util-linux. + + %package -n libblkid Summary: Block device ID library License: LGPL-2.1-or-later @@ -335,7 +361,6 @@ export DAEMON_LDFLAGS="$SUID_LDFLAGS" --disable-silent-rules \ --disable-bfs \ --disable-pg \ - --disable-liblastlog2 \ --enable-chfn-chsh \ --enable-usrdir-path \ --enable-write \ @@ -378,8 +403,6 @@ mkdir -p %{buildroot}%{_sysconfdir}/{pam.d,security/console.apps} install -d %{buildroot}/run/uuidd install -d %{buildroot}/var/lib/libuuid -install -m 644 -D %{SOURCE16} %{buildroot}%{_sysusersdir}/uuidd.conf - # /etc/adjtime install -m 644 %{SOURCE5} %{buildroot}%{_sysconfdir}/adjtime @@ -440,7 +463,7 @@ rm -f %{buildroot}/sbin/sfdisk \ ln -sf ../proc/self/mounts %{buildroot}/etc/mtab # remove static libs -rm -f %{buildroot}%{_libdir}/lib{uuid,blkid,mount,smartcols,fdisk}.a +rm -f %{buildroot}%{_libdir}/lib{uuid,blkid,mount,smartcols,fdisk,lastlog2}.a # temporary remove to avoid conflicts with bash-completion pkg rm -f %{buildroot}%{compldir}/{mount,umount} @@ -473,6 +496,14 @@ mv -v %{buildroot}/usr/sbin/* %{buildroot}/usr/bin/ %post %systemd_post fstrim.{service,timer} +### Enable after completing migration to lastlog2 +# %post -n liblastlog2 +# %systemd_post lastlog2-import.service +# +# %postun -n liblastlog2 +# %systemd_postun lastlog2-import.service +### + %preun %systemd_preun fstrim.{service,timer} @@ -525,6 +556,7 @@ fi %{_unitdir}/fstrim.* +%{_bindir}/bits %{_bindir}/cal %{_bindir}/chmem %{_bindir}/choom @@ -532,6 +564,7 @@ fi %{_bindir}/colcrt %{_bindir}/colrm %{_bindir}/column +%{_bindir}/coresched %{_bindir}/eject %{_bindir}/enosys %{_bindir}/exch @@ -544,6 +577,7 @@ fi %{_bindir}/isosize %{_bindir}/last %{_bindir}/lastb +%{_bindir}/lastlog2 %{_bindir}/look %{_bindir}/lsblk %{_bindir}/lscpu @@ -576,6 +610,8 @@ fi %{_bindir}/wdctl %{_bindir}/whereis %{_bindir}/write + +%{_mandir}/man1/bits.1* %{_mandir}/man1/cal.1* %{_mandir}/man1/chfn.1* %{_mandir}/man1/choom.1* @@ -584,6 +620,7 @@ fi %{_mandir}/man1/colcrt.1* %{_mandir}/man1/colrm.1* %{_mandir}/man1/column.1* +%{_mandir}/man1/coresched.1.* %{_mandir}/man1/eject.1* %{_mandir}/man1/enosys.1* %{_mandir}/man1/exch.1* @@ -643,6 +680,7 @@ fi %{_mandir}/man8/fsfreeze.8* %{_mandir}/man8/fstrim.8* %{_mandir}/man8/isosize.8* +%{_mandir}/man8/lastlog2.8* %{_mandir}/man8/ldattach.8* %{_mandir}/man8/lsblk.8* %{_mandir}/man8/lslocks.8* @@ -721,6 +759,7 @@ fi %{compldir}/isosize %{compldir}/last %{compldir}/lastb +%{compldir}/lastlog2 %{compldir}/ldattach %{compldir}/look %{compldir}/lsblk @@ -894,7 +933,7 @@ fi %dir %attr(2775, uuidd, uuidd) /run/uuidd %{compldir}/uuidd %{_tmpfilesdir}/uuidd-tmpfiles.conf -%{_sysusersdir}/uuidd.conf +%{_sysusersdir}/uuidd-sysusers.conf %files -n libfdisk @@ -930,6 +969,29 @@ fi %{_libdir}/pkgconfig/mount.pc +%files -n liblastlog2 +%license Documentation/licenses/COPYING.BSD-2-Clause +%{_libdir}/liblastlog2.so.* +%{_pam_moduledir}/pam_lastlog2.so +%{_tmpfilesdir}/lastlog2-tmpfiles.conf +%{_unitdir}/lastlog2* +%{_mandir}/man8/pam_lastlog2.8* + +%files -n liblastlog2-devel +%license Documentation/licenses/COPYING.BSD-2-Clause +%{_libdir}/liblastlog2.so +%{_includedir}/liblastlog2 +%{_libdir}/pkgconfig/lastlog2.pc +%{_mandir}/man3/lastlog2.3.* +%{_mandir}/man3/ll2_import_lastlog.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_update_login_time.3* +%{_mandir}/man3/ll2_write_entry.3* + + %files -n libblkid %license Documentation/licenses/COPYING.LGPL-2.1-or-later %{_libdir}/libblkid.so.* From 67c133a8d4483b6606f954c1a160eff44d065656 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Mon, 12 May 2025 14:33:31 +0200 Subject: [PATCH 02/37] add BuildRequires for lastlog2 --- util-linux.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/util-linux.spec b/util-linux.spec index b61f83c..82d6963 100644 --- a/util-linux.spec +++ b/util-linux.spec @@ -35,6 +35,7 @@ BuildRequires: %{pypkg}-devel BuildRequires: gcc BuildRequires: rubygem-asciidoctor BuildRequires: po4a +BuildRequires: sqlite-devel %ifarch ppc64le BuildRequires: librtas-devel %endif From ca46de6072d6aff16c71749055009504658e10fd Mon Sep 17 00:00:00 2001 From: Python Maint Date: Mon, 2 Jun 2025 20:26:03 +0200 Subject: [PATCH 03/37] Rebuilt for Python 3.14 From 0e7e2e7599287de6b61a12f8450daa6824c46b9d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miro=20Hron=C4=8Dok?= Date: Mon, 9 Jun 2025 12:40:32 +0200 Subject: [PATCH 04/37] Revert to util-linux-2.40.4-7 to rebuild it for Python 3.14 The revert is needed because of https://bodhi.fedoraproject.org/updates/FEDORA-2025-dd6b6950ff failures. This reverts commit e873a14a1d864adc9912834adb50e2237ea8c0b0 --- .gitignore | 1 - ...mount-fix-no-canonicalize-regression.patch | 44 -------- ...id-allow-up-to-64k-erofs-block-sizes.patch | 33 ++++++ ...ed-reference-to-add_namespace_for_ns.patch | 58 ---------- ...e-compilation-without-USE_NS_GET_API.patch | 41 ------- ...scription-for-PACKET.PROTOCOL-column.patch | 42 ------- ...n-the-protocol-field-of-proc-net-pac.patch | 64 ----------- ...include-cctype-fix-string-comparison.patch | 106 ------------------ ...dmnt-fix-k-option-parsing-regression.patch | 86 -------------- ...unt-api-utils-include-linux-unistd.h.patch | 40 ------- ...not-use-strerror-on-shared-libraries.patch | 71 ------------ sources | 2 +- util-linux-uuidd-sysusers.conf | 1 + util-linux.spec | 87 ++------------ 14 files changed, 47 insertions(+), 629 deletions(-) delete mode 100644 0000-libmount-fix-no-canonicalize-regression.patch create mode 100644 0001-blkid-allow-up-to-64k-erofs-block-sizes.patch delete mode 100644 0001-lsns-fix-undefined-reference-to-add_namespace_for_ns.patch delete mode 100644 0002-lsns-enhance-compilation-without-USE_NS_GET_API.patch delete mode 100644 0003-lsfd-fix-the-description-for-PACKET.PROTOCOL-column.patch delete mode 100644 0004-lsfd-bug-fix-scan-the-protocol-field-of-proc-net-pac.patch delete mode 100644 0005-include-cctype-fix-string-comparison.patch delete mode 100644 0006-findmnt-fix-k-option-parsing-regression.patch delete mode 100644 0007-include-mount-api-utils-include-linux-unistd.h.patch delete mode 100644 0008-Do-not-use-strerror-on-shared-libraries.patch create mode 100644 util-linux-uuidd-sysusers.conf diff --git a/.gitignore b/.gitignore index d5db0c0..9be7f90 100644 --- a/.gitignore +++ b/.gitignore @@ -99,4 +99,3 @@ /util-linux-2.40.1.tar.xz /util-linux-2.40.2.tar.xz /util-linux-2.40.4.tar.xz -/util-linux-2.41.tar.xz diff --git a/0000-libmount-fix-no-canonicalize-regression.patch b/0000-libmount-fix-no-canonicalize-regression.patch deleted file mode 100644 index 7a19896..0000000 --- a/0000-libmount-fix-no-canonicalize-regression.patch +++ /dev/null @@ -1,44 +0,0 @@ -From a131545a35afeaf3b48fa42ddc876dd14f942486 Mon Sep 17 00:00:00 2001 -From: Karel Zak -Date: Mon, 24 Mar 2025 14:31:05 +0100 -Subject: libmount: fix --no-canonicalize regression - -Fixes: https://github.com/util-linux/util-linux/issues/3474 -Signed-off-by: Karel Zak -(cherry picked from commit 7dbfe31a83f45d5aef2b508697e9511c569ffbc8) -(cherry picked from commit 77723beaaaca654f72ac9538772e69fbafa8835d) ---- - libmount/src/context.c | 3 --- - sys-utils/mount.8.adoc | 2 +- - 2 files changed, 1 insertion(+), 4 deletions(-) - -diff --git a/libmount/src/context.c b/libmount/src/context.c -index 0323cb23d..15a8ad3bb 100644 ---- a/libmount/src/context.c -+++ b/libmount/src/context.c -@@ -530,9 +530,6 @@ int mnt_context_is_xnocanonicalize( - assert(cxt); - assert(type); - -- if (mnt_context_is_nocanonicalize(cxt)) -- return 1; -- - ol = mnt_context_get_optlist(cxt); - if (!ol) - return 0; -diff --git a/sys-utils/mount.8.adoc b/sys-utils/mount.8.adoc -index 4f23f8d1f..5103b91c5 100644 ---- a/sys-utils/mount.8.adoc -+++ b/sys-utils/mount.8.adoc -@@ -756,7 +756,7 @@ Allow to make a target directory (mountpoint) if it does not exist yet. The opti - *X-mount.nocanonicalize*[**=**_type_]:: - Allows disabling of canonicalization for mount source and target paths. By default, the `mount` command resolves all paths to their absolute paths without symlinks. However, this behavior may not be desired in certain situations, such as when binding a mount over a symlink, or a symlink over a directory or another symlink. The optional argument _type_ can be either "source" or "target" (mountpoint). If no _type_ is specified, then canonicalization is disabled for both types. This mount option does not affect the conversion of source tags (e.g. LABEL= or UUID=) and fstab processing. - + --The command line option *--no-canonicalize* overrides this mount option and affects all path and tag conversions in all situations, but it does not modify flags for open_tree syscalls. -+The command-line option *--no-canonicalize* overrides this mount option and affects all path and tag conversions in all situations, but for backward compatibility, it does not modify open_tree syscall flags and does not allow the bind-mount over a symlink use case. - + - Note that *mount*(8) still sanitizes and canonicalizes the source and target paths specified on the command line by non-root users, regardless of the X-mount.nocanonicalize setting. - --- -2.49.0 - diff --git a/0001-blkid-allow-up-to-64k-erofs-block-sizes.patch b/0001-blkid-allow-up-to-64k-erofs-block-sizes.patch new file mode 100644 index 0000000..825c7d0 --- /dev/null +++ b/0001-blkid-allow-up-to-64k-erofs-block-sizes.patch @@ -0,0 +1,33 @@ +From ff0ac0f27dc3de7d250b2a69f6452bfeec104f8c Mon Sep 17 00:00:00 2001 +From: Eric Sandeen +Date: Fri, 24 Jan 2025 08:37:12 -0600 +Subject: [PATCH] blkid: allow up to 64k erofs block sizes + +Today, mkfs.erofs defaults to page size for block size, but blkid +does not recognize this. Increase the limit to 64k. + +Reviewed-by: Gao Xiang +Signed-off-by: Eric Sandeen +Signed-off-by: Karel Zak +--- + libblkid/src/superblocks/erofs.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/libblkid/src/superblocks/erofs.c b/libblkid/src/superblocks/erofs.c +index 05822460b..57fd80220 100644 +--- a/libblkid/src/superblocks/erofs.c ++++ b/libblkid/src/superblocks/erofs.c +@@ -73,8 +73,8 @@ static int probe_erofs(blkid_probe pr, const struct blkid_idmag *mag) + if (!sb) + return errno ? -errno : BLKID_PROBE_NONE; + +- /* EROFS is restricted to 4KiB block size */ +- if (sb->blkszbits > 31 || (1U << sb->blkszbits) > 4096) ++ /* block size must be between 512 and 64k */ ++ if (sb->blkszbits < 9 || sb->blkszbits > 16) + return BLKID_PROBE_NONE; + + if (!erofs_verify_checksum(pr, mag, sb)) +-- +2.48.1 + diff --git a/0001-lsns-fix-undefined-reference-to-add_namespace_for_ns.patch b/0001-lsns-fix-undefined-reference-to-add_namespace_for_ns.patch deleted file mode 100644 index e2ae158..0000000 --- a/0001-lsns-fix-undefined-reference-to-add_namespace_for_ns.patch +++ /dev/null @@ -1,58 +0,0 @@ -From 5f4a11bf3d99512c369b6ba901046d0943ee6d09 Mon Sep 17 00:00:00 2001 -From: Thomas Devoogdt -Date: Tue, 25 Mar 2025 11:58:18 +0100 -Subject: lsns: fix undefined reference to add_namespace_for_nsfd #3483 - -Fixes: - -sys-utils/lsns-lsns.o: In function `read_process': -lsns.c:(.text+0x9e8): undefined reference to `add_namespace_for_nsfd' -collect2: error: ld returned 1 exit status - -Signed-off-by: Thomas Devoogdt -(cherry picked from commit 2ced43400f35f7bd45b29364e04166a63a06e16a) -(cherry picked from commit bd36a077e16eca888d843a0c30e77379aedfe350) ---- - sys-utils/lsns.c | 6 ++++++ - 1 file changed, 6 insertions(+) - -diff --git a/sys-utils/lsns.c b/sys-utils/lsns.c -index 6b2dcba96..d046d69e3 100644 ---- a/sys-utils/lsns.c -+++ b/sys-utils/lsns.c -@@ -587,7 +587,10 @@ static void add_namespace_from_sock(struct lsns *ls, pid_t pid, uint64_t fd) - if (get_namespace(ls, sb.st_ino)) - goto out_nsfd; - -+#ifdef USE_NS_GET_API - add_namespace_for_nsfd(ls, nsfd, sb.st_ino); -+#endif -+ - out_nsfd: - close(nsfd); - out_sk: -@@ -608,6 +611,7 @@ static void add_namespace_from_sock(struct lsns *ls __attribute__((__unused__)), - { - } - #endif /* HAVE_LINUX_NET_NAMESPACE_H */ -+ - /* Read namespaces open(2)ed explicitly by the process specified by `pc'. */ - static void read_opened_namespaces(struct lsns *ls, struct path_cxt *pc, pid_t pid) - { -@@ -627,11 +631,13 @@ static void read_opened_namespaces(struct lsns *ls, struct path_cxt *pc, pid_t p - if (st.st_dev == ls->nsfs_dev) { - if (get_namespace(ls, st.st_ino)) - continue; -+#ifdef USE_NS_GET_API - int fd = ul_path_openf(pc, O_RDONLY, "fd/%ju", (uintmax_t) num); - if (fd >= 0) { - add_namespace_for_nsfd(ls, fd, st.st_ino); - close(fd); - } -+#endif - } else if ((st.st_mode & S_IFMT) == S_IFSOCK) { - add_namespace_from_sock(ls, pid, num); - } --- -2.49.0 - diff --git a/0002-lsns-enhance-compilation-without-USE_NS_GET_API.patch b/0002-lsns-enhance-compilation-without-USE_NS_GET_API.patch deleted file mode 100644 index 07685a2..0000000 --- a/0002-lsns-enhance-compilation-without-USE_NS_GET_API.patch +++ /dev/null @@ -1,41 +0,0 @@ -From 45389b02bdc8adeeb35b81dd7ef1e20f0e84bd69 Mon Sep 17 00:00:00 2001 -From: Karel Zak -Date: Tue, 1 Apr 2025 14:36:36 +0200 -Subject: lsns: enhance compilation without USE_NS_GET_API - -- Move add_namespace_for_nsfd() declaration to the #ifdef block -(based on c62ed3d58602fd29fe12085f7caf03761ed91b81) - -References: 2ced43400f35f7bd45b29364e04166a63a06e16a -Signed-off-by: Karel Zak -(cherry picked from commit 05d494d32bd9941ae0edbe591cefc047de3e9052) ---- - sys-utils/lsns.c | 5 +++-- - 1 file changed, 3 insertions(+), 2 deletions(-) - -diff --git a/sys-utils/lsns.c b/sys-utils/lsns.c -index d046d69e3..ede7a3992 100644 ---- a/sys-utils/lsns.c -+++ b/sys-utils/lsns.c -@@ -304,6 +304,9 @@ static inline const struct colinfo *get_column_info(unsigned num) - } - - #ifdef USE_NS_GET_API -+static struct lsns_namespace *add_namespace_for_nsfd(struct lsns *ls, int fd, ino_t ino); -+ -+ - /* Get the inode number for the parent namespace of the namespace `fd' specifies. - * If `pfd' is non-null, the file descriptor opening the parent namespace.*/ - static int get_parent_ns_ino(int fd, enum lsns_type lsns_type, ino_t *pino, int *pfd) -@@ -422,8 +425,6 @@ error: - return rc; - } - --static struct lsns_namespace *add_namespace_for_nsfd(struct lsns *ls, int fd, ino_t ino); -- - static struct lsns_namespace *get_namespace(struct lsns *ls, ino_t ino) - { - struct list_head *p; --- -2.49.0 - diff --git a/0003-lsfd-fix-the-description-for-PACKET.PROTOCOL-column.patch b/0003-lsfd-fix-the-description-for-PACKET.PROTOCOL-column.patch deleted file mode 100644 index 7a396cf..0000000 --- a/0003-lsfd-fix-the-description-for-PACKET.PROTOCOL-column.patch +++ /dev/null @@ -1,42 +0,0 @@ -From 6b7fa6aa3a0f59c81cba859563548dd5a0e3213c Mon Sep 17 00:00:00 2001 -From: Masatake YAMATO -Date: Mon, 6 Jan 2025 02:55:19 +0900 -Subject: lsfd: fix the description for PACKET.PROTOCOL column - -Signed-off-by: Masatake YAMATO -(cherry picked from commit df3b38fab56001537364302479b33cb104ef7411) -(cherry picked from commit b7b96894c2f27f8a361f5bab2a239c9f64034557) ---- - lsfd-cmd/lsfd.1.adoc | 2 +- - lsfd-cmd/lsfd.c | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/lsfd-cmd/lsfd.1.adoc b/lsfd-cmd/lsfd.1.adoc -index e9a01d26a..bd6885f82 100644 ---- a/lsfd-cmd/lsfd.1.adoc -+++ b/lsfd-cmd/lsfd.1.adoc -@@ -386,7 +386,7 @@ PACKET.IFACE <``string``>:: - Interface name associated with the packet socket. - - PACKET.PROTOCOL <``string``>:: --L3 protocol associated with the packet socket. -+L2 protocol associated with the packet socket. - - PARTITION <``string``>:: - Block device name resolved by `/proc/partition`. -diff --git a/lsfd-cmd/lsfd.c b/lsfd-cmd/lsfd.c -index 66c60a4e8..714083e70 100644 ---- a/lsfd-cmd/lsfd.c -+++ b/lsfd-cmd/lsfd.c -@@ -311,7 +311,7 @@ static const struct colinfo infos[] = { - N_("net interface associated with the packet socket") }, - [COL_PACKET_PROTOCOL] = { "PACKET.PROTOCOL", - 0, SCOLS_FL_RIGHT,SCOLS_JSON_STRING, -- N_("L3 protocol associated with the packet socket") }, -+ N_("L2 protocol associated with the packet socket") }, - [COL_PARTITION] = { "PARTITION", - 0, SCOLS_FL_RIGHT, SCOLS_JSON_STRING, - N_("block device name resolved by /proc/partition") }, --- -2.49.0 - diff --git a/0004-lsfd-bug-fix-scan-the-protocol-field-of-proc-net-pac.patch b/0004-lsfd-bug-fix-scan-the-protocol-field-of-proc-net-pac.patch deleted file mode 100644 index 09efd07..0000000 --- a/0004-lsfd-bug-fix-scan-the-protocol-field-of-proc-net-pac.patch +++ /dev/null @@ -1,64 +0,0 @@ -From 20066a4dba10ea4893e0c8ec0d939e6a16f949d0 Mon Sep 17 00:00:00 2001 -From: Masatake YAMATO -Date: Mon, 6 Jan 2025 03:30:25 +0900 -Subject: lsfd: (bug fix) scan the protocol field of /proc/net/packet as a hex - number - -Signed-off-by: Masatake YAMATO -(cherry picked from commit 0da7e8201aa7b9b2c5d0e901c0ccfd6f3bdc54d3) -(cherry picked from commit 798e4da071a96b14c7449bced9f16dc351dc5d84) ---- - lsfd-cmd/sock-xinfo.c | 2 +- - tests/expected/lsfd/mkfds-mapped-packet-socket | 4 ++-- - tests/ts/lsfd/mkfds-mapped-packet-socket | 3 ++- - 3 files changed, 5 insertions(+), 4 deletions(-) - -diff --git a/lsfd-cmd/sock-xinfo.c b/lsfd-cmd/sock-xinfo.c -index f6811213a..42d8e0919 100644 ---- a/lsfd-cmd/sock-xinfo.c -+++ b/lsfd-cmd/sock-xinfo.c -@@ -2373,7 +2373,7 @@ static void load_xinfo_from_proc_packet(ino_t netns_inode) - unsigned long inode; - struct packet_xinfo *pkt; - -- if (sscanf(line, "%*x %*d %" SCNu16 " %" SCNu16 " %u %*d %*d %*d %lu", -+ if (sscanf(line, "%*x %*d %" SCNu16 " %" SCNx16 " %u %*d %*d %*d %lu", - &type, &protocol, &iface, &inode) < 4) - continue; - -diff --git a/tests/expected/lsfd/mkfds-mapped-packet-socket b/tests/expected/lsfd/mkfds-mapped-packet-socket -index ec8795b70..2e9db5eb5 100644 ---- a/tests/expected/lsfd/mkfds-mapped-packet-socket -+++ b/tests/expected/lsfd/mkfds-mapped-packet-socket -@@ -1,8 +1,8 @@ - PACKET - SOCK.PROTONAME: 0 --type=raw protocol=all iface=lo raw PACKET lo all -+type=raw protocol=ppptalk iface=lo raw PACKET lo ppptalk - NAME,SOCK.TYPE,SOCK.PROTONAME,PACKET.IFACE,PACKET.PROTOCOL: 0 - PACKET - SOCK.PROTONAME: 0 --type=dgram protocol=all iface=lo dgram PACKET lo all -+type=dgram protocol=ppptalk iface=lo dgram PACKET lo ppptalk - NAME,SOCK.TYPE,SOCK.PROTONAME,PACKET.IFACE,PACKET.PROTOCOL: 0 -diff --git a/tests/ts/lsfd/mkfds-mapped-packet-socket b/tests/ts/lsfd/mkfds-mapped-packet-socket -index 12c5ef6bc..c3a73c54e 100755 ---- a/tests/ts/lsfd/mkfds-mapped-packet-socket -+++ b/tests/ts/lsfd/mkfds-mapped-packet-socket -@@ -35,11 +35,12 @@ FD=3 - EXPR= - INTERFACE=lo - SOCKTYPE= -+PROTOCOL=$(printf "%d" 0x10) - ERR= - - for SOCKTYPE in RAW DGRAM; do - coproc MKFDS { "$TS_HELPER_MKFDS" mapped-packet-socket $FD \ -- interface=${INTERFACE} socktype=${SOCKTYPE}; } -+ interface=${INTERFACE} socktype=${SOCKTYPE} protocol=${PROTOCOL}; } - if read -u ${MKFDS[0]} PID; then - EXPR='(ASSOC == "shm") and (STTYPE == "SOCK") and (MODE == "-w-")' - ${TS_CMD_LSFD} -p "$PID" -n -o SOCK.PROTONAME -Q "${EXPR}" --- -2.49.0 - diff --git a/0005-include-cctype-fix-string-comparison.patch b/0005-include-cctype-fix-string-comparison.patch deleted file mode 100644 index 9facf54..0000000 --- a/0005-include-cctype-fix-string-comparison.patch +++ /dev/null @@ -1,106 +0,0 @@ -From 63317155429b35347f869f5996e5c354a398c6d3 Mon Sep 17 00:00:00 2001 -From: Karel Zak -Date: Wed, 2 Apr 2025 11:00:47 +0200 -Subject: include/cctype: fix string comparison - -Reimplement c_strcasecmp() and c_strncasecmp() to be libc compatible -and fix c_strncasecmp() to avoid \0 misinterpretation. The original -implementation was pretty stupid (sorry). - -Signed-off-by: Karel Zak -(cherry picked from commit 259157b0c1a00806ff75188325e40ba10adf12ce) -(cherry picked from commit e6a7001bb539256cdd71e4f032c2842151814556) ---- - include/cctype.h | 55 ++++++++++++++++++++++++++++++++---------------- - 1 file changed, 37 insertions(+), 18 deletions(-) - -diff --git a/include/cctype.h b/include/cctype.h -index b673b6cff..e55c008b8 100644 ---- a/include/cctype.h -+++ b/include/cctype.h -@@ -23,6 +23,9 @@ - #ifndef UTIL_LINUX_CCTYPE_H - #define UTIL_LINUX_CCTYPE_H - -+#include -+#include -+ - /** - * The functions defined in this file assume the "C" locale and a character - * set without diacritics (ASCII-US or EBCDIC-US or something like that). -@@ -317,38 +320,54 @@ static inline int c_toupper (int c) - } - } - -+#define C_CTYPE_CMP(c1, c2) (((c1) > (c2)) - ((c1) < (c2))) -+ - static inline int c_strncasecmp(const char *a, const char *b, size_t n) - { -- int res = 0; -+ const unsigned char *p1 = (const unsigned char *) a; -+ const unsigned char *p2 = (const unsigned char *) b; -+ unsigned char x, y; - -- for (; n > 0; a++, b++, n--) { -- unsigned int x = (unsigned int) *a; -- unsigned int y = (unsigned int) *b; -+ if (n == 0 || p1 == p2) -+ return 0; - -- res = c_tolower(x) - c_tolower(y); -- if (res) -- break; -- } -- return res; -+ do { -+ x = c_tolower(*p1); -+ y = c_tolower(*p2); -+ -+ if (--n == 0 || x == '\0') -+ break; -+ ++p1, ++p2; -+ } while (x == y); -+ -+ if (UCHAR_MAX <= INT_MAX) -+ return x - y; -+ -+ return C_CTYPE_CMP(x, y); - } - - static inline int c_strcasecmp(const char *a, const char *b) - { -- int res = 0; -+ const unsigned char *p1 = (const unsigned char *) a; -+ const unsigned char *p2 = (const unsigned char *) b; -+ unsigned char x, y; - -- if (a == b) -+ if (p1 == p2) - return 0; - -- for (; *a != '\0'; a++, b++) { -- unsigned int x = (unsigned int) *a; -- unsigned int y = (unsigned int) *b; -+ do { -+ x = c_tolower(*p1); -+ y = c_tolower(*p2); - -- res = c_tolower(x) - c_tolower(y); -- if (res) -+ if (x == '\0') - break; -- } -+ ++p1, ++p2; -+ } while (x == y); - -- return res; -+ if (UCHAR_MAX <= INT_MAX) -+ return x - y; -+ -+ return C_CTYPE_CMP(x, y); - } - - #endif /* UTIL_LINUX_CCTYPE_H */ --- -2.49.0 - diff --git a/0006-findmnt-fix-k-option-parsing-regression.patch b/0006-findmnt-fix-k-option-parsing-regression.patch deleted file mode 100644 index 111846d..0000000 --- a/0006-findmnt-fix-k-option-parsing-regression.patch +++ /dev/null @@ -1,86 +0,0 @@ -From 450ec45368df36601f44ff4b385e04a5ca2f1134 Mon Sep 17 00:00:00 2001 -From: Karel Zak -Date: Mon, 7 Apr 2025 12:35:02 +0200 -Subject: findmnt: fix -k option parsing regression - -It's a really bad idea to change any existing short option to support -optional arguments. - -Fixes: https://github.com/util-linux/util-linux/issues/3512 -References: 841d15e5d13dd0cc56e450c8dcc592211d66be27 -Signed-off-by: Karel Zak -(cherry picked from commit 0ecaef693ea60aab709e79dd4a8eb2865ec08967) -(cherry picked from commit 9d4df7905ec03c3ea6e9bdf0aaa91e862168d29a) ---- - misc-utils/findmnt.8.adoc | 2 +- - misc-utils/findmnt.c | 13 +++++++++---- - 2 files changed, 10 insertions(+), 5 deletions(-) - -diff --git a/misc-utils/findmnt.8.adoc b/misc-utils/findmnt.8.adoc -index fe29afe77..bea0496ff 100644 ---- a/misc-utils/findmnt.8.adoc -+++ b/misc-utils/findmnt.8.adoc -@@ -87,7 +87,7 @@ Use JSON output format. - *-k*, *--kernel*[_=method_]:: - Reads information about filesystems from the kernel. This is the default output. The format is tree-like and only includes mount options managed by the kernel (see also *--mtab*). - + --The optional argument _method_ can be either: -+The optional argument _method_ is supported only for the long variant (--kernel). The short variant (-k) defaults to the mountinfo method for backward compatibility. The supported methods can be either: - + - * *mountinfo* - this is the default method and it reads data from the _/proc/self/mountinfo_ file. - + -diff --git a/misc-utils/findmnt.c b/misc-utils/findmnt.c -index fbfb84c94..b183a9c05 100644 ---- a/misc-utils/findmnt.c -+++ b/misc-utils/findmnt.c -@@ -1530,7 +1530,8 @@ static void __attribute__((__noreturn__)) usage(void) - fputs(_(" -F, --tab-file alternative file for -s, -m or -k options\n"), out); - fputs(_(" -m, --mtab search in table of mounted filesystems\n" - " (includes user space mount options)\n"), out); -- fputs(_(" -k, --kernel[=] search in kernel mount table (default)\n" -+ fputs(_(" -k alias to '--kernel mountinfo'\n"), out); -+ fputs(_(" --kernel[=] search in kernel mount table (default)\n" - " is mountinfo or listmount\n"), out); - fputs(_(" -N, --task use alternative namespace (/proc//mountinfo file)\n"), out); - fputs(_(" -p, --poll[=] monitor changes in table of mounted filesystems\n"), out); -@@ -1763,7 +1764,8 @@ int main(int argc, char *argv[]) - FINDMNT_OPT_SHADOWED, - FINDMNT_OPT_HYPERLINK, - FINDMNT_OPT_ID, -- FINDMNT_OPT_UNIQ_ID -+ FINDMNT_OPT_UNIQ_ID, -+ FINDMNT_OPT_KERNEL - }; - - static const struct option longopts[] = { -@@ -1780,7 +1782,7 @@ int main(int argc, char *argv[]) - { "help", no_argument, NULL, 'h' }, - { "invert", no_argument, NULL, 'i' }, - { "json", no_argument, NULL, 'J' }, -- { "kernel", optional_argument, NULL, 'k' }, -+ { "kernel", optional_argument, NULL, FINDMNT_OPT_KERNEL }, - { "list", no_argument, NULL, 'l' }, - { "mountpoint", required_argument, NULL, 'M' }, - { "mtab", no_argument, NULL, 'm' }, -@@ -1843,7 +1845,7 @@ int main(int argc, char *argv[]) - findmnt.flags |= FL_TREE; - - while ((c = getopt_long(argc, argv, -- "AabCcDd:ehIiJfF:o:O:p::PQ:k::lmM:nN:rst:uvRS:T:Uw:VxyH", -+ "AabCcDd:ehIiJfF:o:O:p::PQ:klmM:nN:rst:uvRS:T:Uw:VxyH", - longopts, NULL)) != -1) { - - err_exclusive_options(c, longopts, excl, excl_st); -@@ -1940,6 +1942,9 @@ int main(int argc, char *argv[]) - findmnt.flags &= ~FL_TREE; - break; - case 'k': -+ tabtype = TABTYPE_KERNEL_MOUNTINFO; -+ break; -+ case FINDMNT_OPT_KERNEL: - if (optarg) { - if (strcmp(optarg, "mountinfo") == 0) - tabtype = TABTYPE_KERNEL_MOUNTINFO; --- -2.49.0 - diff --git a/0007-include-mount-api-utils-include-linux-unistd.h.patch b/0007-include-mount-api-utils-include-linux-unistd.h.patch deleted file mode 100644 index 01d3375..0000000 --- a/0007-include-mount-api-utils-include-linux-unistd.h.patch +++ /dev/null @@ -1,40 +0,0 @@ -From 598b6e97f6eb90771d3e7d57135405b2f2d20843 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= -Date: Sat, 19 Apr 2025 22:02:11 +0200 -Subject: include/mount-api-utils: include linux/unistd.h -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -If SYS_statmount/SYS_listmount is not provided by the libc, -util-linux will fall back to __NR_statmount/__NR_listmount from the -kernel UAPI headers. -However it is not guaranteed that these symbols are actually visible in -mount-api-utils. - -Include linux/unistd.h which provides syscall numbers. -While this header is specific to Linux, the code is already using -linux/mount.h. - -Signed-off-by: Thomas Weißschuh -(cherry picked from commit 0033f97482a7979e0de71de0a16b583e8d74dbdc) -(cherry picked from commit 7e9665e31d57d16efa304d4421eb8c9d98d8eaf1) ---- - include/mount-api-utils.h | 1 + - 1 file changed, 1 insertion(+) - -diff --git a/include/mount-api-utils.h b/include/mount-api-utils.h -index 5e1905c45..02bb326c6 100644 ---- a/include/mount-api-utils.h -+++ b/include/mount-api-utils.h -@@ -8,6 +8,7 @@ - #ifdef HAVE_LINUX_MOUNT_H - #include - #include -+#include - #include - #include - --- -2.49.0 - diff --git a/0008-Do-not-use-strerror-on-shared-libraries.patch b/0008-Do-not-use-strerror-on-shared-libraries.patch deleted file mode 100644 index d8b071a..0000000 --- a/0008-Do-not-use-strerror-on-shared-libraries.patch +++ /dev/null @@ -1,71 +0,0 @@ -From f83c532a797b98f5e4d3f894744f3f2065c414ea Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Cristian=20Rodr=C3=ADguez?= -Date: Sun, 13 Apr 2025 09:22:47 -0400 -Subject: Do not use strerror on shared libraries - -Using strerror is not safe in shared libraries as it is unknown -what the calling apps may do with the storage behind the scenes. -Using %m is ok, except in contexts that need to be as-safe. - -(cherry picked from commit c5850c36e14085cddf8db9e19d447d928fa153d0) -(cherry picked from commit 1f7a5b3c3cc1ad1ab1b72e68d0ae49cb171c5c45) ---- - libblkid/src/verify.c | 8 ++++---- - liblastlog2/src/lastlog2.c | 8 ++++---- - 2 files changed, 8 insertions(+), 8 deletions(-) - -diff --git a/libblkid/src/verify.c b/libblkid/src/verify.c -index 3b9754f57..abd3d1246 100644 ---- a/libblkid/src/verify.c -+++ b/libblkid/src/verify.c -@@ -73,8 +73,8 @@ blkid_dev blkid_verify(blkid_cache cache, blkid_dev dev) - diff = (uintmax_t)now - dev->bid_time; - - if (stat(dev->bid_name, &st) < 0) { -- DBG(PROBE, ul_debug("blkid_verify: error %s (%d) while " -- "trying to stat %s", strerror(errno), errno, -+ DBG(PROBE, ul_debug("blkid_verify: error %m (%d) while " -+ "trying to stat %s", errno, - dev->bid_name)); - open_err: - if ((errno == EPERM) || (errno == EACCES) || (errno == ENOENT)) { -@@ -128,8 +128,8 @@ blkid_dev blkid_verify(blkid_cache cache, blkid_dev dev) - - fd = open(dev->bid_name, O_RDONLY|O_CLOEXEC|O_NONBLOCK); - if (fd < 0) { -- DBG(PROBE, ul_debug("blkid_verify: error %s (%d) while " -- "opening %s", strerror(errno), errno, -+ DBG(PROBE, ul_debug("blkid_verify: error %m (%d) while " -+ "opening %s", errno, - dev->bid_name)); - goto open_err; - } -diff --git a/liblastlog2/src/lastlog2.c b/liblastlog2/src/lastlog2.c -index 2d3ab2050..020c77106 100644 ---- a/liblastlog2/src/lastlog2.c -+++ b/liblastlog2/src/lastlog2.c -@@ -559,8 +559,8 @@ ll2_import_lastlog(struct ll2_context *context, const char *lastlog_file, - - ll_fp = fopen(lastlog_file, "r"); - if (ll_fp == NULL) { -- if (error && asprintf(error, "Failed to open '%s': %s", -- lastlog_file, strerror(errno)) < 0) -+ if (error && asprintf(error, "Failed to open '%s': %m", -+ lastlog_file) < 0) - return -ENOMEM; - - return -1; -@@ -569,8 +569,8 @@ ll2_import_lastlog(struct ll2_context *context, const char *lastlog_file, - - if (fstat(fileno(ll_fp), &statll) != 0) { - retval = -1; -- if (error && asprintf(error, "Cannot get size of '%s': %s", -- lastlog_file, strerror(errno)) < 0) -+ if (error && asprintf(error, "Cannot get size of '%s': %m", -+ lastlog_file) < 0) - retval = -ENOMEM; - - goto done; --- -2.49.0 - diff --git a/sources b/sources index 1094aa2..ed7ccad 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (util-linux-2.41.tar.xz) = 800ff92ee7a047732c0accb9dd759d6ed659947373ca72e0dd3ca601d0a6fed9db92c0838cfaff6bcdb8c08bdc1ffa675721893f42945885c57ccd59ab676318 +SHA512 (util-linux-2.40.4.tar.xz) = 0024955056ba7b4c54040a917f9919f49692e57ba6d42d17a6c29c1eefe88bf48b1214a545072b71c468829a63a8f15237f49733e9127c134e11126d1e435124 diff --git a/util-linux-uuidd-sysusers.conf b/util-linux-uuidd-sysusers.conf new file mode 100644 index 0000000..afd02eb --- /dev/null +++ b/util-linux-uuidd-sysusers.conf @@ -0,0 +1 @@ +u uuidd - "UUID generator helper daemon" /var/lib/libuuid diff --git a/util-linux.spec b/util-linux.spec index 82d6963..a8e890d 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.41 +Version: 2.40.4 # -p -e rc1 -Release: %autorelease +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 URL: https://en.wikipedia.org/wiki/Util-linux @@ -35,7 +35,6 @@ BuildRequires: %{pypkg}-devel BuildRequires: gcc BuildRequires: rubygem-asciidoctor BuildRequires: po4a -BuildRequires: sqlite-devel %ifarch ppc64le BuildRequires: librtas-devel %endif @@ -57,6 +56,9 @@ Source13: util-linux-su-l.pamd Source14: util-linux-runuser.pamd Source15: util-linux-runuser-l.pamd +# temporary, will be in upstream >= v2.41 +Source16: util-linux-uuidd-sysusers.conf + ### Obsoletes & Conflicts & Provides Conflicts: initscripts < 9.79-4 Conflicts: bash-completion < 1:2.1-1 @@ -91,7 +93,6 @@ Requires: libblkid = %{version}-%{release} Requires: libmount = %{version}-%{release} Requires: libsmartcols = %{version}-%{release} Requires: libfdisk = %{version}-%{release} -Requires: liblastlog2 = %{version}-%{release} Requires: util-linux-core = %{version}-%{release} %if "%{_sbindir}" == "%{_bindir}" @@ -110,17 +111,8 @@ Patch0: login-lastlog-create.patch # https://github.com/coreos/console-login-helper-messages/issues/60 Patch1: login-default-motd-file.patch -# Upstream patches (to be included in v2.41.1) -Patch2: 0000-libmount-fix-no-canonicalize-regression.patch -Patch3: 0001-lsns-fix-undefined-reference-to-add_namespace_for_ns.patch -Patch4: 0002-lsns-enhance-compilation-without-USE_NS_GET_API.patch -Patch5: 0003-lsfd-fix-the-description-for-PACKET.PROTOCOL-column.patch -Patch6: 0004-lsfd-bug-fix-scan-the-protocol-field-of-proc-net-pac.patch -Patch7: 0005-include-cctype-fix-string-comparison.patch -Patch8: 0006-findmnt-fix-k-option-parsing-regression.patch -Patch9: 0007-include-mount-api-utils-include-linux-unistd.h.patch -Patch10: 0008-Do-not-use-strerror-on-shared-libraries.patch - +# Backport better support for erofs on ppc64le +Patch2: 0001-blkid-allow-up-to-64k-erofs-block-sizes.patch %description The util-linux package contains a large variety of low-level system @@ -223,25 +215,6 @@ This is the device mounting development library and headers, part of util-linux. -%package -n liblastlog2 -Summary: lastlog database library and PAM module -License: BSD-2-Clause - -%description -n liblastlog2 -This is the lastlog database library and PAM module, part of util-linux. - - -%package -n liblastlog2-devel -Summary: lastlog database library -License: BSD-2-Clause -Requires: liblastlog2%{?_isa} = %{version}-%{release} -Requires: pkgconfig - -%description -n liblastlog2-devel -This is the lastlog database development library and headers, -part of util-linux. - - %package -n libblkid Summary: Block device ID library License: LGPL-2.1-or-later @@ -362,6 +335,7 @@ export DAEMON_LDFLAGS="$SUID_LDFLAGS" --disable-silent-rules \ --disable-bfs \ --disable-pg \ + --disable-liblastlog2 \ --enable-chfn-chsh \ --enable-usrdir-path \ --enable-write \ @@ -404,6 +378,8 @@ mkdir -p %{buildroot}%{_sysconfdir}/{pam.d,security/console.apps} install -d %{buildroot}/run/uuidd install -d %{buildroot}/var/lib/libuuid +install -m 644 -D %{SOURCE16} %{buildroot}%{_sysusersdir}/uuidd.conf + # /etc/adjtime install -m 644 %{SOURCE5} %{buildroot}%{_sysconfdir}/adjtime @@ -464,7 +440,7 @@ rm -f %{buildroot}/sbin/sfdisk \ ln -sf ../proc/self/mounts %{buildroot}/etc/mtab # remove static libs -rm -f %{buildroot}%{_libdir}/lib{uuid,blkid,mount,smartcols,fdisk,lastlog2}.a +rm -f %{buildroot}%{_libdir}/lib{uuid,blkid,mount,smartcols,fdisk}.a # temporary remove to avoid conflicts with bash-completion pkg rm -f %{buildroot}%{compldir}/{mount,umount} @@ -497,14 +473,6 @@ mv -v %{buildroot}/usr/sbin/* %{buildroot}/usr/bin/ %post %systemd_post fstrim.{service,timer} -### Enable after completing migration to lastlog2 -# %post -n liblastlog2 -# %systemd_post lastlog2-import.service -# -# %postun -n liblastlog2 -# %systemd_postun lastlog2-import.service -### - %preun %systemd_preun fstrim.{service,timer} @@ -557,7 +525,6 @@ fi %{_unitdir}/fstrim.* -%{_bindir}/bits %{_bindir}/cal %{_bindir}/chmem %{_bindir}/choom @@ -565,7 +532,6 @@ fi %{_bindir}/colcrt %{_bindir}/colrm %{_bindir}/column -%{_bindir}/coresched %{_bindir}/eject %{_bindir}/enosys %{_bindir}/exch @@ -578,7 +544,6 @@ fi %{_bindir}/isosize %{_bindir}/last %{_bindir}/lastb -%{_bindir}/lastlog2 %{_bindir}/look %{_bindir}/lsblk %{_bindir}/lscpu @@ -611,8 +576,6 @@ fi %{_bindir}/wdctl %{_bindir}/whereis %{_bindir}/write - -%{_mandir}/man1/bits.1* %{_mandir}/man1/cal.1* %{_mandir}/man1/chfn.1* %{_mandir}/man1/choom.1* @@ -621,7 +584,6 @@ fi %{_mandir}/man1/colcrt.1* %{_mandir}/man1/colrm.1* %{_mandir}/man1/column.1* -%{_mandir}/man1/coresched.1.* %{_mandir}/man1/eject.1* %{_mandir}/man1/enosys.1* %{_mandir}/man1/exch.1* @@ -681,7 +643,6 @@ fi %{_mandir}/man8/fsfreeze.8* %{_mandir}/man8/fstrim.8* %{_mandir}/man8/isosize.8* -%{_mandir}/man8/lastlog2.8* %{_mandir}/man8/ldattach.8* %{_mandir}/man8/lsblk.8* %{_mandir}/man8/lslocks.8* @@ -760,7 +721,6 @@ fi %{compldir}/isosize %{compldir}/last %{compldir}/lastb -%{compldir}/lastlog2 %{compldir}/ldattach %{compldir}/look %{compldir}/lsblk @@ -934,7 +894,7 @@ fi %dir %attr(2775, uuidd, uuidd) /run/uuidd %{compldir}/uuidd %{_tmpfilesdir}/uuidd-tmpfiles.conf -%{_sysusersdir}/uuidd-sysusers.conf +%{_sysusersdir}/uuidd.conf %files -n libfdisk @@ -970,29 +930,6 @@ fi %{_libdir}/pkgconfig/mount.pc -%files -n liblastlog2 -%license Documentation/licenses/COPYING.BSD-2-Clause -%{_libdir}/liblastlog2.so.* -%{_pam_moduledir}/pam_lastlog2.so -%{_tmpfilesdir}/lastlog2-tmpfiles.conf -%{_unitdir}/lastlog2* -%{_mandir}/man8/pam_lastlog2.8* - -%files -n liblastlog2-devel -%license Documentation/licenses/COPYING.BSD-2-Clause -%{_libdir}/liblastlog2.so -%{_includedir}/liblastlog2 -%{_libdir}/pkgconfig/lastlog2.pc -%{_mandir}/man3/lastlog2.3.* -%{_mandir}/man3/ll2_import_lastlog.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_update_login_time.3* -%{_mandir}/man3/ll2_write_entry.3* - - %files -n libblkid %license Documentation/licenses/COPYING.LGPL-2.1-or-later %{_libdir}/libblkid.so.* From 8e9f6cee443c7d9b32c37baef8a1df3a457aea16 Mon Sep 17 00:00:00 2001 From: Python Maint Date: Mon, 9 Jun 2025 12:42:27 +0200 Subject: [PATCH 05/37] Rebuilt for Python 3.14 From bf8d5779df3e8f1996add8b6492db0ed0db39626 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Mon, 12 May 2025 14:16:44 +0200 Subject: [PATCH 06/37] upgrade to upstream release v2.41.1 ... https://www.kernel.org/pub/linux/utils/util-linux/v2.41/v2.41-ReleaseNotes - add lastlog2 library and PAM module - add new utils bits, coresched and lastlog2 --- .gitignore | 2 + ...id-allow-up-to-64k-erofs-block-sizes.patch | 33 -------- sources | 2 +- util-linux-uuidd-sysusers.conf | 1 - util-linux.spec | 75 ++++++++++++++++--- 5 files changed, 66 insertions(+), 47 deletions(-) delete mode 100644 0001-blkid-allow-up-to-64k-erofs-block-sizes.patch delete mode 100644 util-linux-uuidd-sysusers.conf diff --git a/.gitignore b/.gitignore index 9be7f90..1e5ca15 100644 --- a/.gitignore +++ b/.gitignore @@ -99,3 +99,5 @@ /util-linux-2.40.1.tar.xz /util-linux-2.40.2.tar.xz /util-linux-2.40.4.tar.xz +/util-linux-2.41.tar.xz +/util-linux-2.41.1.tar.xz diff --git a/0001-blkid-allow-up-to-64k-erofs-block-sizes.patch b/0001-blkid-allow-up-to-64k-erofs-block-sizes.patch deleted file mode 100644 index 825c7d0..0000000 --- a/0001-blkid-allow-up-to-64k-erofs-block-sizes.patch +++ /dev/null @@ -1,33 +0,0 @@ -From ff0ac0f27dc3de7d250b2a69f6452bfeec104f8c Mon Sep 17 00:00:00 2001 -From: Eric Sandeen -Date: Fri, 24 Jan 2025 08:37:12 -0600 -Subject: [PATCH] blkid: allow up to 64k erofs block sizes - -Today, mkfs.erofs defaults to page size for block size, but blkid -does not recognize this. Increase the limit to 64k. - -Reviewed-by: Gao Xiang -Signed-off-by: Eric Sandeen -Signed-off-by: Karel Zak ---- - libblkid/src/superblocks/erofs.c | 4 ++-- - 1 file changed, 2 insertions(+), 2 deletions(-) - -diff --git a/libblkid/src/superblocks/erofs.c b/libblkid/src/superblocks/erofs.c -index 05822460b..57fd80220 100644 ---- a/libblkid/src/superblocks/erofs.c -+++ b/libblkid/src/superblocks/erofs.c -@@ -73,8 +73,8 @@ static int probe_erofs(blkid_probe pr, const struct blkid_idmag *mag) - if (!sb) - return errno ? -errno : BLKID_PROBE_NONE; - -- /* EROFS is restricted to 4KiB block size */ -- if (sb->blkszbits > 31 || (1U << sb->blkszbits) > 4096) -+ /* block size must be between 512 and 64k */ -+ if (sb->blkszbits < 9 || sb->blkszbits > 16) - return BLKID_PROBE_NONE; - - if (!erofs_verify_checksum(pr, mag, sb)) --- -2.48.1 - diff --git a/sources b/sources index ed7ccad..9375746 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (util-linux-2.40.4.tar.xz) = 0024955056ba7b4c54040a917f9919f49692e57ba6d42d17a6c29c1eefe88bf48b1214a545072b71c468829a63a8f15237f49733e9127c134e11126d1e435124 +SHA512 (util-linux-2.41.1.tar.xz) = 12cf37ab2d62d0378b16a40e0194ef7131ef1ad06737cca3f169cfc04b9da08a4233076c819b30705e8fb2c3b8d91a1d83aac4f036ce58b9cf5928f545e511a2 diff --git a/util-linux-uuidd-sysusers.conf b/util-linux-uuidd-sysusers.conf deleted file mode 100644 index afd02eb..0000000 --- a/util-linux-uuidd-sysusers.conf +++ /dev/null @@ -1 +0,0 @@ -u uuidd - "UUID generator helper daemon" /var/lib/libuuid diff --git a/util-linux.spec b/util-linux.spec index a8e890d..b6be115 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.40.4 +Version: 2.41.1 # -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 @@ -35,6 +35,7 @@ BuildRequires: %{pypkg}-devel BuildRequires: gcc BuildRequires: rubygem-asciidoctor BuildRequires: po4a +BuildRequires: sqlite-devel %ifarch ppc64le BuildRequires: librtas-devel %endif @@ -56,9 +57,6 @@ Source13: util-linux-su-l.pamd Source14: util-linux-runuser.pamd Source15: util-linux-runuser-l.pamd -# temporary, will be in upstream >= v2.41 -Source16: util-linux-uuidd-sysusers.conf - ### Obsoletes & Conflicts & Provides Conflicts: initscripts < 9.79-4 Conflicts: bash-completion < 1:2.1-1 @@ -93,6 +91,7 @@ Requires: libblkid = %{version}-%{release} Requires: libmount = %{version}-%{release} Requires: libsmartcols = %{version}-%{release} Requires: libfdisk = %{version}-%{release} +Requires: liblastlog2 = %{version}-%{release} Requires: util-linux-core = %{version}-%{release} %if "%{_sbindir}" == "%{_bindir}" @@ -111,9 +110,6 @@ Patch0: login-lastlog-create.patch # https://github.com/coreos/console-login-helper-messages/issues/60 Patch1: login-default-motd-file.patch -# Backport better support for erofs on ppc64le -Patch2: 0001-blkid-allow-up-to-64k-erofs-block-sizes.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 @@ -215,6 +211,25 @@ This is the device mounting development library and headers, part of util-linux. +%package -n liblastlog2 +Summary: lastlog database library and PAM module +License: BSD-2-Clause + +%description -n liblastlog2 +This is the lastlog database library and PAM module, part of util-linux. + + +%package -n liblastlog2-devel +Summary: lastlog database library +License: BSD-2-Clause +Requires: liblastlog2%{?_isa} = %{version}-%{release} +Requires: pkgconfig + +%description -n liblastlog2-devel +This is the lastlog database development library and headers, +part of util-linux. + + %package -n libblkid Summary: Block device ID library License: LGPL-2.1-or-later @@ -335,7 +350,6 @@ export DAEMON_LDFLAGS="$SUID_LDFLAGS" --disable-silent-rules \ --disable-bfs \ --disable-pg \ - --disable-liblastlog2 \ --enable-chfn-chsh \ --enable-usrdir-path \ --enable-write \ @@ -378,8 +392,6 @@ mkdir -p %{buildroot}%{_sysconfdir}/{pam.d,security/console.apps} install -d %{buildroot}/run/uuidd install -d %{buildroot}/var/lib/libuuid -install -m 644 -D %{SOURCE16} %{buildroot}%{_sysusersdir}/uuidd.conf - # /etc/adjtime install -m 644 %{SOURCE5} %{buildroot}%{_sysconfdir}/adjtime @@ -440,7 +452,7 @@ rm -f %{buildroot}/sbin/sfdisk \ ln -sf ../proc/self/mounts %{buildroot}/etc/mtab # remove static libs -rm -f %{buildroot}%{_libdir}/lib{uuid,blkid,mount,smartcols,fdisk}.a +rm -f %{buildroot}%{_libdir}/lib{uuid,blkid,mount,smartcols,fdisk,lastlog2}.a # temporary remove to avoid conflicts with bash-completion pkg rm -f %{buildroot}%{compldir}/{mount,umount} @@ -473,6 +485,14 @@ mv -v %{buildroot}/usr/sbin/* %{buildroot}/usr/bin/ %post %systemd_post fstrim.{service,timer} +### Enable after completing migration to lastlog2 +# %post -n liblastlog2 +# %systemd_post lastlog2-import.service +# +# %postun -n liblastlog2 +# %systemd_postun lastlog2-import.service +### + %preun %systemd_preun fstrim.{service,timer} @@ -525,6 +545,7 @@ fi %{_unitdir}/fstrim.* +%{_bindir}/bits %{_bindir}/cal %{_bindir}/chmem %{_bindir}/choom @@ -532,6 +553,7 @@ fi %{_bindir}/colcrt %{_bindir}/colrm %{_bindir}/column +%{_bindir}/coresched %{_bindir}/eject %{_bindir}/enosys %{_bindir}/exch @@ -544,6 +566,7 @@ fi %{_bindir}/isosize %{_bindir}/last %{_bindir}/lastb +%{_bindir}/lastlog2 %{_bindir}/look %{_bindir}/lsblk %{_bindir}/lscpu @@ -576,6 +599,8 @@ fi %{_bindir}/wdctl %{_bindir}/whereis %{_bindir}/write + +%{_mandir}/man1/bits.1* %{_mandir}/man1/cal.1* %{_mandir}/man1/chfn.1* %{_mandir}/man1/choom.1* @@ -584,6 +609,7 @@ fi %{_mandir}/man1/colcrt.1* %{_mandir}/man1/colrm.1* %{_mandir}/man1/column.1* +%{_mandir}/man1/coresched.1.* %{_mandir}/man1/eject.1* %{_mandir}/man1/enosys.1* %{_mandir}/man1/exch.1* @@ -643,6 +669,7 @@ fi %{_mandir}/man8/fsfreeze.8* %{_mandir}/man8/fstrim.8* %{_mandir}/man8/isosize.8* +%{_mandir}/man8/lastlog2.8* %{_mandir}/man8/ldattach.8* %{_mandir}/man8/lsblk.8* %{_mandir}/man8/lslocks.8* @@ -721,6 +748,7 @@ fi %{compldir}/isosize %{compldir}/last %{compldir}/lastb +%{compldir}/lastlog2 %{compldir}/ldattach %{compldir}/look %{compldir}/lsblk @@ -894,7 +922,7 @@ fi %dir %attr(2775, uuidd, uuidd) /run/uuidd %{compldir}/uuidd %{_tmpfilesdir}/uuidd-tmpfiles.conf -%{_sysusersdir}/uuidd.conf +%{_sysusersdir}/uuidd-sysusers.conf %files -n libfdisk @@ -930,6 +958,29 @@ fi %{_libdir}/pkgconfig/mount.pc +%files -n liblastlog2 +%license Documentation/licenses/COPYING.BSD-2-Clause +%{_libdir}/liblastlog2.so.* +%{_pam_moduledir}/pam_lastlog2.so +%{_tmpfilesdir}/lastlog2-tmpfiles.conf +%{_unitdir}/lastlog2* +%{_mandir}/man8/pam_lastlog2.8* + +%files -n liblastlog2-devel +%license Documentation/licenses/COPYING.BSD-2-Clause +%{_libdir}/liblastlog2.so +%{_includedir}/liblastlog2 +%{_libdir}/pkgconfig/lastlog2.pc +%{_mandir}/man3/lastlog2.3.* +%{_mandir}/man3/ll2_import_lastlog.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_update_login_time.3* +%{_mandir}/man3/ll2_write_entry.3* + + %files -n libblkid %license Documentation/licenses/COPYING.LGPL-2.1-or-later %{_libdir}/libblkid.so.* From 404f522557b6fe86fbfddc6a5b1657c055dbc791 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Tue, 24 Jun 2025 10:45:43 +0200 Subject: [PATCH 07/37] remove obsolete patch --- ...-regression-when-mounting-with-atime.patch | 133 ------------------ 1 file changed, 133 deletions(-) delete mode 100644 libmount-Fix-regression-when-mounting-with-atime.patch diff --git a/libmount-Fix-regression-when-mounting-with-atime.patch b/libmount-Fix-regression-when-mounting-with-atime.patch deleted file mode 100644 index 1c98653..0000000 --- a/libmount-Fix-regression-when-mounting-with-atime.patch +++ /dev/null @@ -1,133 +0,0 @@ -From 2b99ee2526ae61be761b0e31c50e106dbec5e9e4 Mon Sep 17 00:00:00 2001 -From: Filipe Manana -Date: Thu, 17 Aug 2023 10:20:13 +0100 -Subject: [PATCH] libmount: Fix regression when mounting with atime - -A regression was introduced in v2.39 that causes mounting with the atime -option to fail: - - $ mkfs.ext4 -F /dev/sdi - $ mount -o atime /dev/sdi /mnt/sdi - mount: /mnt/sdi: not mount point or bad option. - dmesg(1) may have more information after failed mount system call. - -The failure comes from the mount_setattr(2) call returning -EINVAL. This -is because we pass an invalid value for the attr_clr argument. From a -strace capture we have: - - mount_setattr(4, "", AT_EMPTY_PATH, {attr_set=0, attr_clr=MOUNT_ATTR_NOATIME, propagation=0 /* MS_??? */, userns_fd=0}, 32) = -1 EINVAL (Invalid argument) - -We can't pass MOUNT_ATTR_NOATIME to mount_setattr(2) through the attr_clr -argument because all atime options are exclusive, so in order to set atime -one has to pass MOUNT_ATTR__ATIME to attr_clr and leave attr_set as -MOUNT_ATTR_RELATIME (which is defined as a value of 0). - -This can be read from the man page for mount_setattr(2) and also from the -kernel source: - - $ cat fs/namespace.c - static int build_mount_kattr(const struct mount_attr *attr, size_t usize, - struct mount_kattr *kattr, unsigned int flags) - { - (...) - /* - * Since the MOUNT_ATTR_ values are an enum, not a bitmap, - * users wanting to transition to a different atime setting cannot - * simply specify the atime setting in @attr_set, but must also - * specify MOUNT_ATTR__ATIME in the @attr_clr field. - * So ensure that MOUNT_ATTR__ATIME can't be partially set in - * @attr_clr and that @attr_set can't have any atime bits set if - * MOUNT_ATTR__ATIME isn't set in @attr_clr. - */ - if (attr->attr_clr & MOUNT_ATTR__ATIME) { - if ((attr->attr_clr & MOUNT_ATTR__ATIME) != MOUNT_ATTR__ATIME) - return -EINVAL; - - /* - * Clear all previous time settings as they are mutually - * exclusive. - */ - kattr->attr_clr |= MNT_RELATIME | MNT_NOATIME; - switch (attr->attr_set & MOUNT_ATTR__ATIME) { - case MOUNT_ATTR_RELATIME: - kattr->attr_set |= MNT_RELATIME; - break; - case MOUNT_ATTR_NOATIME: - kattr->attr_set |= MNT_NOATIME; - break; - case MOUNT_ATTR_STRICTATIME: - break; - default: - return -EINVAL; - } - (...) - -So fix this by setting attr_clr MOUNT_ATTR__ATIME if we want to clear any -atime related option. - -Signed-off-by: Filipe Manana ---- - libmount/src/optlist.c | 13 ++++++++++++- - tests/expected/libmount/context-mount-flags | 3 +++ - tests/ts/libmount/context | 9 ++++++++- - 3 files changed, 23 insertions(+), 2 deletions(-) - -diff --git a/libmount/src/optlist.c b/libmount/src/optlist.c -index e93810b47..d0afc94f7 100644 ---- a/libmount/src/optlist.c -+++ b/libmount/src/optlist.c -@@ -875,7 +875,18 @@ int mnt_optlist_get_attrs(struct libmnt_optlist *ls, uint64_t *set, uint64_t *cl - - if (opt->ent->mask & MNT_INVERT) { - DBG(OPTLIST, ul_debugobj(ls, " clr: %s", opt->ent->name)); -- *clr |= x; -+ /* -+ * All atime settings are mutually exclusive so *clr must -+ * have MOUNT_ATTR__ATIME set. -+ * -+ * See the function fs/namespace.c:build_mount_kattr() -+ * in the linux kernel source. -+ */ -+ if (x == MOUNT_ATTR_RELATIME || x == MOUNT_ATTR_NOATIME || -+ x == MOUNT_ATTR_STRICTATIME) -+ *clr |= MOUNT_ATTR__ATIME; -+ else -+ *clr |= x; - } else { - DBG(OPTLIST, ul_debugobj(ls, " set: %s", opt->ent->name)); - *set |= x; -diff --git a/tests/expected/libmount/context-mount-flags b/tests/expected/libmount/context-mount-flags -index 960641863..eb71323dd 100644 ---- a/tests/expected/libmount/context-mount-flags -+++ b/tests/expected/libmount/context-mount-flags -@@ -3,3 +3,6 @@ ro,nosuid,noexec - successfully mounted - rw,nosuid,noexec - successfully umounted -+successfully mounted -+rw,relatime -+successfully umounted -diff --git a/tests/ts/libmount/context b/tests/ts/libmount/context -index f5b47185e..a5d2e81a3 100755 ---- a/tests/ts/libmount/context -+++ b/tests/ts/libmount/context -@@ -116,8 +116,15 @@ $TS_CMD_FINDMNT --kernel --mountpoint $MOUNTPOINT -o VFS-OPTIONS -n >> $TS_OUTPU - - ts_run $TESTPROG --umount $MOUNTPOINT >> $TS_OUTPUT 2>> $TS_ERRLOG - is_mounted $DEVICE && echo "$DEVICE still mounted" >> $TS_OUTPUT 2>> $TS_ERRLOG --ts_finalize_subtest - -+# Test that the atime option works after the migration to use the new kernel mount APIs. -+ts_run $TESTPROG --mount -o atime $DEVICE $MOUNTPOINT >> $TS_OUTPUT 2>> $TS_ERRLOG -+$TS_CMD_FINDMNT --kernel --mountpoint $MOUNTPOINT -o VFS-OPTIONS -n >> $TS_OUTPUT 2>> $TS_ERRLOG -+is_mounted $DEVICE || echo "$DEVICE not mounted" >> $TS_OUTPUT 2>> $TS_ERRLOG -+ts_run $TESTPROG --umount $MOUNTPOINT >> $TS_OUTPUT 2>> $TS_ERRLOG -+is_mounted $DEVICE && echo "$DEVICE still mounted" >> $TS_OUTPUT 2>> $TS_ERRLOG -+ -+ts_finalize_subtest - - ts_init_subtest "mount-loopdev" - mkdir -p $MOUNTPOINT &> /dev/null --- -2.40.1 - From b309d832e231b7d3be1f54d586c6419399812281 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Tue, 24 Jun 2025 11:02:22 +0200 Subject: [PATCH 08/37] Temporarily disable support for EROFS backing files. --- ...t-disable-EROFS-backing-file-support.patch | 89 +++++++++++++++++++ util-linux.spec | 4 + 2 files changed, 93 insertions(+) create mode 100644 0001-libmount-disable-EROFS-backing-file-support.patch diff --git a/0001-libmount-disable-EROFS-backing-file-support.patch b/0001-libmount-disable-EROFS-backing-file-support.patch new file mode 100644 index 0000000..0735aa6 --- /dev/null +++ b/0001-libmount-disable-EROFS-backing-file-support.patch @@ -0,0 +1,89 @@ +From 3b1b56c00b34e1d00349349a8a91d0add72ce97b 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 + +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 fbb200708..4d6d53194 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.49.0 + diff --git a/util-linux.spec b/util-linux.spec index b6be115..59baae4 100644 --- a/util-linux.spec +++ b/util-linux.spec @@ -110,6 +110,10 @@ Patch0: login-lastlog-create.patch # https://github.com/coreos/console-login-helper-messages/issues/60 Patch1: login-default-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 + %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 7d135acec2bbf111f8b9b4920fb9f8f3791e4ef3 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Tue, 24 Jun 2025 11:17:59 +0200 Subject: [PATCH 09/37] Fix ldattach build on recent glibc headers. --- 0001-ldattach-add-ifndef-BOTHER.patch | 29 +++++++++++++++++++++++++++ util-linux.spec | 3 +++ 2 files changed, 32 insertions(+) create mode 100644 0001-ldattach-add-ifndef-BOTHER.patch diff --git a/0001-ldattach-add-ifndef-BOTHER.patch b/0001-ldattach-add-ifndef-BOTHER.patch new file mode 100644 index 0000000..602a518 --- /dev/null +++ b/0001-ldattach-add-ifndef-BOTHER.patch @@ -0,0 +1,29 @@ +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/util-linux.spec b/util-linux.spec index 59baae4..c6ebe25 100644 --- a/util-linux.spec +++ b/util-linux.spec @@ -114,6 +114,9 @@ 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 From 0382798ff415262c223a4bccc959fa6c5bb0dd30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luk=C3=A1=C5=A1=20Zaoral?= Date: Tue, 24 Jun 2025 14:19:13 +0200 Subject: [PATCH 10/37] tests: migrate from STI to TMT Related: https://fedoraproject.org/wiki/Changes/DisableSTI --- .fmf/version | 1 + plans/ci.fmf | 5 +++++ tests/tests.yml | 13 ------------- tests/various/main.fmf | 13 +++++++++++++ tests/various/runtest.sh | 1 - 5 files changed, 19 insertions(+), 14 deletions(-) create mode 100644 .fmf/version create mode 100644 plans/ci.fmf delete mode 100644 tests/tests.yml create mode 100644 tests/various/main.fmf diff --git a/.fmf/version b/.fmf/version new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/.fmf/version @@ -0,0 +1 @@ +1 diff --git a/plans/ci.fmf b/plans/ci.fmf new file mode 100644 index 0000000..c1627f9 --- /dev/null +++ b/plans/ci.fmf @@ -0,0 +1,5 @@ +summary: Basic smoke test +discover: + how: fmf +execute: + how: tmt diff --git a/tests/tests.yml b/tests/tests.yml deleted file mode 100644 index 1cd94fc..0000000 --- a/tests/tests.yml +++ /dev/null @@ -1,13 +0,0 @@ -# Test which run in classic and docker environemnt -- hosts: localhost - tags: - - classic - - container - - atomic - roles: - - role: standard-test-beakerlib - tests: - - various - required_packages: - - util-linux - - util-linux-user diff --git a/tests/various/main.fmf b/tests/various/main.fmf new file mode 100644 index 0000000..c71537e --- /dev/null +++ b/tests/various/main.fmf @@ -0,0 +1,13 @@ +summary: This test groups small sanity and regression tests for util-linux +description: '' +contact: Miroslav Vadkerti +component: + - util-linux +test: ./runtest.sh +framework: beakerlib +recommend: + - util-linux + - util-linux-user +duration: 10m +extra-summary: /CoreOS/util-linux/Sanity/various +extra-task: /CoreOS/util-linux/Sanity/various diff --git a/tests/various/runtest.sh b/tests/various/runtest.sh index 32871f4..4394d41 100755 --- a/tests/various/runtest.sh +++ b/tests/various/runtest.sh @@ -27,7 +27,6 @@ # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # Include Beaker environment -#. /usr/bin/rhts-environment.sh || exit 1 . /usr/share/beakerlib/beakerlib.sh || exit 1 PACKAGE="util-linux" From 164a6760ec0921afe1f043a6d08505636ca1bded Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Tue, 15 Jul 2025 14:24:23 +0200 Subject: [PATCH 11/37] enable lastlog2-import.service --- util-linux.spec | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/util-linux.spec b/util-linux.spec index c6ebe25..bab8288 100644 --- a/util-linux.spec +++ b/util-linux.spec @@ -489,24 +489,26 @@ find %{buildroot}%{_mandir}/man8 -regextype posix-egrep \ mv -v %{buildroot}/usr/sbin/* %{buildroot}/usr/bin/ %endif + %post %systemd_post fstrim.{service,timer} -### Enable after completing migration to lastlog2 -# %post -n liblastlog2 -# %systemd_post lastlog2-import.service -# -# %postun -n liblastlog2 -# %systemd_postun lastlog2-import.service -### +%post -n liblastlog2 +%systemd_post lastlog2-import.service + %preun %systemd_preun fstrim.{service,timer} + %postun %systemd_postun_with_restart fstrim.timer %systemd_postun fstrim.service +%postun -n liblastlog2 +%systemd_postun lastlog2-import.service + + # Please, keep uuidd running after installation! Note that systemd_post is # "systemctl preset" and it enable/disable service only. %post -n uuidd From 04d2b6b0adde9e77f06540a80df3769cc6445ab0 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 25 Jul 2025 19:54:31 +0000 Subject: [PATCH 12/37] Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild From 39c148ff89d0a3239125c1cd5da72b47dc1e7e4f Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Tue, 5 Aug 2025 09:49:01 +0200 Subject: [PATCH 13/37] add /var/lib/liblastlog to files list --- util-linux.spec | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/util-linux.spec b/util-linux.spec index bab8288..8c13e0a 100644 --- a/util-linux.spec +++ b/util-linux.spec @@ -395,9 +395,10 @@ mkdir -p %{buildroot}%{_sysconfdir}/{pam.d,security/console.apps} # install util-linux %make_install -# And a dirs uuidd needs that the makefiles don't create +# And a dirs that the makefiles don't create install -d %{buildroot}/run/uuidd install -d %{buildroot}/var/lib/libuuid +install -d %{buildroot}/var/lib/liblastlog # /etc/adjtime install -m 644 %{SOURCE5} %{buildroot}%{_sysconfdir}/adjtime @@ -969,6 +970,7 @@ fi %files -n liblastlog2 %license Documentation/licenses/COPYING.BSD-2-Clause +%dir /var/lib/liblastlog %{_libdir}/liblastlog2.so.* %{_pam_moduledir}/pam_lastlog2.so %{_tmpfilesdir}/lastlog2-tmpfiles.conf From b9ed3a9a740e6d0f49f22c9b6c7631ef3a6e6809 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Tue, 5 Aug 2025 09:59:26 +0200 Subject: [PATCH 14/37] use RPM macros for /var/lib and /run --- util-linux.spec | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/util-linux.spec b/util-linux.spec index 8c13e0a..1c611f7 100644 --- a/util-linux.spec +++ b/util-linux.spec @@ -396,9 +396,9 @@ mkdir -p %{buildroot}%{_sysconfdir}/{pam.d,security/console.apps} %make_install # And a dirs that the makefiles don't create -install -d %{buildroot}/run/uuidd -install -d %{buildroot}/var/lib/libuuid -install -d %{buildroot}/var/lib/liblastlog +install -d %{buildroot}%{_rundir}/uuidd +install -d %{buildroot}%{_sharedstatedir}/libuuid +install -d %{buildroot}%{_sharedstatedir}/liblastlog # /etc/adjtime install -m 644 %{SOURCE5} %{buildroot}%{_sysconfdir}/adjtime @@ -928,8 +928,8 @@ fi %{_mandir}/man8/uuidd.8* %{_sbindir}/uuidd %{_unitdir}/uuidd.* -%dir %attr(2775, uuidd, uuidd) /var/lib/libuuid -%dir %attr(2775, uuidd, uuidd) /run/uuidd +%dir %attr(2775, uuidd, uuidd) %{_sharedstatedir}/libuuid +%dir %attr(2775, uuidd, uuidd) %{_rundir}/uuidd %{compldir}/uuidd %{_tmpfilesdir}/uuidd-tmpfiles.conf %{_sysusersdir}/uuidd-sysusers.conf @@ -970,7 +970,7 @@ fi %files -n liblastlog2 %license Documentation/licenses/COPYING.BSD-2-Clause -%dir /var/lib/liblastlog +%dir %{_sharedstatedir}/liblastlog %{_libdir}/liblastlog2.so.* %{_pam_moduledir}/pam_lastlog2.so %{_tmpfilesdir}/lastlog2-tmpfiles.conf From 5679a7db71825414f41f195a67d8273e7f58ccd9 Mon Sep 17 00:00:00 2001 From: Python Maint Date: Fri, 15 Aug 2025 15:21:47 +0200 Subject: [PATCH 15/37] Rebuilt for Python 3.14.0rc2 bytecode From 9e2caeba0d5c3d0e7a09f8cf545645d4b794646a Mon Sep 17 00:00:00 2001 From: Python Maint Date: Fri, 19 Sep 2025 15:01:56 +0200 Subject: [PATCH 16/37] Rebuilt for Python 3.14.0rc3 bytecode From ba1905c6c74e0bcf789a2900d2eca23692faa1d6 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Thu, 23 Oct 2025 12:59:14 +0200 Subject: [PATCH 17/37] 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 18/37] 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 19/37] 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 20/37] 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 21/37] 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 33bdaab085f650cbf31d7acc9201dd59ed4fa523 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Mon, 15 Dec 2025 18:05:02 +0100 Subject: [PATCH 22/37] fix setpwnam() buffer use [CVE-2025-14104] - libblkid: use snprintf() instead of sprintf() --- ...lkid-use-snprintf-instead-of-sprintf.patch | 58 +++++++++++++++++++ ...x-setpwnam-buffer-use-CVE-2025-14104.patch | 50 ++++++++++++++++ util-linux.spec | 4 ++ 3 files changed, 112 insertions(+) create mode 100644 0003-libblkid-use-snprintf-instead-of-sprintf.patch create mode 100644 0004-login-utils-fix-setpwnam-buffer-use-CVE-2025-14104.patch 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..ee4eb7d --- /dev/null +++ b/0003-libblkid-use-snprintf-instead-of-sprintf.patch @@ -0,0 +1,58 @@ +From 3e44cf04e74c1f3fed36ecc76842be414328daa7 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 7c561cf44..1f1031fda 100644 +--- a/libblkid/src/probe.c ++++ b/libblkid/src/probe.c +@@ -1978,8 +1978,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]); + } + + ul_debug( +-- +2.51.1 + diff --git a/0004-login-utils-fix-setpwnam-buffer-use-CVE-2025-14104.patch b/0004-login-utils-fix-setpwnam-buffer-use-CVE-2025-14104.patch new file mode 100644 index 0000000..671a079 --- /dev/null +++ b/0004-login-utils-fix-setpwnam-buffer-use-CVE-2025-14104.patch @@ -0,0 +1,50 @@ +From 1747ac6607bf87733423f27388819a889f658bc5 Mon Sep 17 00:00:00 2001 +From: Karel Zak +Date: Mon, 8 Dec 2025 13:36:41 +0100 +Subject: login-utils: fix setpwnam() buffer use [CVE-2025-14104] + +This issue has been originally fixed in the master branch, but +unfortunately was not backported to stable/v2.41 yet. + +References: aaa9e718c88d6916b003da7ebcfe38a3c88df8e6 +References: 9a36d77012c4c771f8d51eba46b6e62c29bf572a +Signed-off-by: Karel Zak +(cherry picked from commit 9753e6ad9705104c3b05713f79ad6732cc4c7b30) +--- + login-utils/setpwnam.c | 13 ++++++++----- + 1 file changed, 8 insertions(+), 5 deletions(-) + +diff --git a/login-utils/setpwnam.c b/login-utils/setpwnam.c +index 3e3c1abde..7778e98f7 100644 +--- a/login-utils/setpwnam.c ++++ b/login-utils/setpwnam.c +@@ -99,7 +99,8 @@ int setpwnam(struct passwd *pwd, const char *prefix) + goto fail; + + namelen = strlen(pwd->pw_name); +- ++ if (namelen > buflen) ++ buflen += namelen; + linebuf = malloc(buflen); + if (!linebuf) + goto fail; +@@ -126,10 +127,12 @@ int setpwnam(struct passwd *pwd, const char *prefix) + } + + /* Is this the username we were sent to change? */ +- if (!found && linebuf[namelen] == ':' && +- !strncmp(linebuf, pwd->pw_name, namelen)) { +- /* Yes! So go forth in the name of the Lord and +- * change it! */ ++ if (!found && ++ strncmp(linebuf, pwd->pw_name, namelen) == 0 && ++ strlen(linebuf) > namelen && ++ linebuf[namelen] == ':') { ++ /* Yes! But this time let’s not walk past the end of the buffer ++ * in the name of the Lord, SUID, or anything else. */ + if (putpwent(pwd, fp) < 0) + goto fail; + found = 1; +-- +2.51.1 + diff --git a/util-linux.spec b/util-linux.spec index f5198a1..70f2665 100644 --- a/util-linux.spec +++ b/util-linux.spec @@ -114,6 +114,10 @@ Patch1: login-default-motd-file.patch # Backport better support for erofs on ppc64le Patch2: 0001-blkid-allow-up-to-64k-erofs-block-sizes.patch +Patch3: 0003-libblkid-use-snprintf-instead-of-sprintf.patch +Patch4: 0004-login-utils-fix-setpwnam-buffer-use-CVE-2025-14104.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 06dbf9bb28d4f669f1aace6aa46607fbe9396284 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Mon, 12 Jan 2026 11:55:59 +0100 Subject: [PATCH 23/37] 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 24/37] 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 25/37] 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 26/37] Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild From a957d6ce9e0b622a9ed168588a0f45951dfdb9dd Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Tue, 27 Jan 2026 10:15:10 +0100 Subject: [PATCH 27/37] wall: Always use utmp as a fallback [BZ#2283049] - clean up the patches section in the spec file - re-sync patches with Git (see https://github.com/karelzak/util-linux-work/tree/fedora/f42) --- 0000-login-use-O_CREAT-on-lastlog.patch | 28 ++++ ...un-motd.d-to-the-hardcoded-MOTD_FILE.patch | 28 ++++ ...id-allow-up-to-64k-erofs-block-sizes.patch | 6 +- ...lkid-use-snprintf-instead-of-sprintf.patch | 4 +- ...x-setpwnam-buffer-use-CVE-2025-14104.patch | 4 +- 0005-wall-always-use-utmp-as-fallback.patch | 137 ++++++++++++++++++ ...-regression-when-mounting-with-atime.patch | 133 ----------------- login-default-motd-file.patch | 13 -- login-lastlog-create.patch | 12 -- util-linux.spec | 20 +-- 10 files changed, 210 insertions(+), 175 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-blkid-allow-up-to-64k-erofs-block-sizes.patch => 0002-blkid-allow-up-to-64k-erofs-block-sizes.patch (89%) create mode 100644 0005-wall-always-use-utmp-as-fallback.patch delete mode 100644 libmount-Fix-regression-when-mounting-with-atime.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..492ab7d --- /dev/null +++ b/0000-login-use-O_CREAT-on-lastlog.patch @@ -0,0 +1,28 @@ +From 1a2ec6f6dbb1c74694403ff5bcfcbd36830ff2a4 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 +(cherry picked from commit 85902de01452198bc15199f5e5c147df31b38212) +--- + 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 c8544f6a1..3de0398e9 100644 +--- a/login-utils/login.c ++++ b/login-utils/login.c +@@ -681,7 +681,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.52.0 + 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..247cf53 --- /dev/null +++ b/0001-login-add-run-motd.d-to-the-hardcoded-MOTD_FILE.patch @@ -0,0 +1,28 @@ +From 84ee1e47e64fcabb83c39611d92a0496d086e0bb 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 +(cherry picked from commit c8e1485a02c031926eb4ae0fc1e2ce380584be98) +--- + include/pathnames.h | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/include/pathnames.h b/include/pathnames.h +index de456c53e..ac28a9a50 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.52.0 + diff --git a/0001-blkid-allow-up-to-64k-erofs-block-sizes.patch b/0002-blkid-allow-up-to-64k-erofs-block-sizes.patch similarity index 89% rename from 0001-blkid-allow-up-to-64k-erofs-block-sizes.patch rename to 0002-blkid-allow-up-to-64k-erofs-block-sizes.patch index 825c7d0..2603097 100644 --- a/0001-blkid-allow-up-to-64k-erofs-block-sizes.patch +++ b/0002-blkid-allow-up-to-64k-erofs-block-sizes.patch @@ -1,7 +1,7 @@ -From ff0ac0f27dc3de7d250b2a69f6452bfeec104f8c Mon Sep 17 00:00:00 2001 +From fa9260ab4d778c4c9958fd5a10644abf41ae6583 Mon Sep 17 00:00:00 2001 From: Eric Sandeen Date: Fri, 24 Jan 2025 08:37:12 -0600 -Subject: [PATCH] blkid: allow up to 64k erofs block sizes +Subject: blkid: allow up to 64k erofs block sizes Today, mkfs.erofs defaults to page size for block size, but blkid does not recognize this. Increase the limit to 64k. @@ -29,5 +29,5 @@ index 05822460b..57fd80220 100644 if (!erofs_verify_checksum(pr, mag, sb)) -- -2.48.1 +2.52.0 diff --git a/0003-libblkid-use-snprintf-instead-of-sprintf.patch b/0003-libblkid-use-snprintf-instead-of-sprintf.patch index ee4eb7d..1b411ac 100644 --- a/0003-libblkid-use-snprintf-instead-of-sprintf.patch +++ b/0003-libblkid-use-snprintf-instead-of-sprintf.patch @@ -1,4 +1,4 @@ -From 3e44cf04e74c1f3fed36ecc76842be414328daa7 Mon Sep 17 00:00:00 2001 +From 83a413885e608296db220c009b2b1d015bb61e9c 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() @@ -54,5 +54,5 @@ index 7c561cf44..1f1031fda 100644 ul_debug( -- -2.51.1 +2.52.0 diff --git a/0004-login-utils-fix-setpwnam-buffer-use-CVE-2025-14104.patch b/0004-login-utils-fix-setpwnam-buffer-use-CVE-2025-14104.patch index 671a079..9f75f0e 100644 --- a/0004-login-utils-fix-setpwnam-buffer-use-CVE-2025-14104.patch +++ b/0004-login-utils-fix-setpwnam-buffer-use-CVE-2025-14104.patch @@ -1,4 +1,4 @@ -From 1747ac6607bf87733423f27388819a889f658bc5 Mon Sep 17 00:00:00 2001 +From 4d3bc36c528e8833e47cbd5b12063056ef9c0122 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Mon, 8 Dec 2025 13:36:41 +0100 Subject: login-utils: fix setpwnam() buffer use [CVE-2025-14104] @@ -46,5 +46,5 @@ index 3e3c1abde..7778e98f7 100644 goto fail; found = 1; -- -2.51.1 +2.52.0 diff --git a/0005-wall-always-use-utmp-as-fallback.patch b/0005-wall-always-use-utmp-as-fallback.patch new file mode 100644 index 0000000..5228609 --- /dev/null +++ b/0005-wall-always-use-utmp-as-fallback.patch @@ -0,0 +1,137 @@ +From 0a856e72df9b6c37497e4e394841d893754b0fa8 Mon Sep 17 00:00:00 2001 +From: Karel Zak +Date: Mon, 3 Jun 2024 14:32:18 +0200 +Subject: wall: always use utmp as fallback + +Wall(1) can be compiled with systemd support to read the names of ttys +from the systemd session list. However, this may not work on all systems. +In case of failure, the best option is to use the traditional +utmp method as a fallback. + +This commit uses strv (string vector) to collect tty names from both +sources (systemd and utmp) and then sends a message to all ttys. + +Addresses: https://bugzilla.redhat.com/show_bug.cgi?id=2283049 +Signed-off-by: Karel Zak +(cherry picked from commit 0af497c6688b53a3a176176bfbcdca821bd856ec) +--- + term-utils/wall.c | 57 ++++++++++++++++++++++++++++++++--------------- + 1 file changed, 39 insertions(+), 18 deletions(-) + +diff --git a/term-utils/wall.c b/term-utils/wall.c +index 125fde438..22c3918bb 100644 +--- a/term-utils/wall.c ++++ b/term-utils/wall.c +@@ -78,6 +78,7 @@ + #include "closestream.h" + #include "timeutils.h" + #include "pwdutils.h" ++#include "strv.h" + + #define TERM_WIDTH 79 + #define WRITE_TIME_OUT 300 /* in seconds */ +@@ -190,19 +191,30 @@ static int is_gr_member(const char *login, const struct group_workspace *buf) + return 0; + } + ++static int has_tty(char **ttys, char *name) ++{ ++ char **str; ++ ++ STRV_FOREACH(str, ttys) { ++ if (strcmp(*str, name) == 0) ++ return 1; ++ } ++ ++ return 0; ++} ++ + int main(int argc, char **argv) + { + int ch; + struct iovec iov; + struct utmpx *utmpptr; +- char *p; + char line[sizeof(utmpptr->ut_line) + 1]; + int print_banner = TRUE; + struct group_workspace *group_buf = NULL; + char *mbuf, *fname = NULL; + size_t mbufsize; + unsigned timeout = WRITE_TIME_OUT; +- char **mvec = NULL; ++ char **mvec = NULL, **ttys = NULL, **str; + int mvecsz = 0; + + static const struct option longopts[] = { +@@ -265,30 +277,30 @@ int main(int argc, char **argv) + int sessions; + + sessions = sd_get_sessions(&sessions_list); +- if (sessions < 0) +- errx(EXIT_FAILURE, _("error getting sessions: %s"), +- strerror(-sessions)); ++ if (sessions < 0) { ++ warnx(_("error getting sessions: %s"), strerror(-sessions)); ++ goto utmp; ++ } + + for (int i = 0; i < sessions; i++) { + char *name, *tty; + int r; + +- if ((r = sd_session_get_username(sessions_list[i], &name)) < 0) +- errx(EXIT_FAILURE, _("get user name failed: %s"), strerror (-r)); +- +- if (!(group_buf && !is_gr_member(name, group_buf))) { +- if (sd_session_get_tty(sessions_list[i], &tty) >= 0) { +- if ((p = ttymsg(&iov, 1, tty, timeout)) != NULL) +- warnx("%s", p); +- +- free(tty); +- } ++ if ((r = sd_session_get_username(sessions_list[i], &name)) < 0) { ++ warnx(_("get user name failed: %s"), strerror (-r)); ++ goto utmp; + } ++ if (!(group_buf && !is_gr_member(name, group_buf)) ++ && sd_session_get_tty(sessions_list[i], &tty) >= 0 ++ && strv_consume(&ttys, tty) < 0) ++ err(EXIT_FAILURE, _("failed to allocate lines list")); ++ + free(name); + free(sessions_list[i]); + } + free(sessions_list); +- } else ++ } ++utmp: + #endif + { + while ((utmpptr = getutxent())) { +@@ -310,12 +322,21 @@ int main(int argc, char **argv) + continue; + + mem2strcpy(line, utmpptr->ut_line, sizeof(utmpptr->ut_line), sizeof(line)); +- if ((p = ttymsg(&iov, 1, line, timeout)) != NULL) +- warnx("%s", p); ++ if (has_tty(ttys, line)) ++ continue; ++ if (strv_extend(&ttys, line) < 0) ++ err(EXIT_FAILURE, _("failed to allocate lines list")); + } + endutxent(); + } + ++ STRV_FOREACH(str, ttys) { ++ char *er = ttymsg(&iov, 1, *str, timeout); ++ if (er) ++ warnx("%s", er); ++ } ++ ++ strv_free(ttys); + free(mbuf); + free_group_workspace(group_buf); + exit(EXIT_SUCCESS); +-- +2.52.0 + diff --git a/libmount-Fix-regression-when-mounting-with-atime.patch b/libmount-Fix-regression-when-mounting-with-atime.patch deleted file mode 100644 index 1c98653..0000000 --- a/libmount-Fix-regression-when-mounting-with-atime.patch +++ /dev/null @@ -1,133 +0,0 @@ -From 2b99ee2526ae61be761b0e31c50e106dbec5e9e4 Mon Sep 17 00:00:00 2001 -From: Filipe Manana -Date: Thu, 17 Aug 2023 10:20:13 +0100 -Subject: [PATCH] libmount: Fix regression when mounting with atime - -A regression was introduced in v2.39 that causes mounting with the atime -option to fail: - - $ mkfs.ext4 -F /dev/sdi - $ mount -o atime /dev/sdi /mnt/sdi - mount: /mnt/sdi: not mount point or bad option. - dmesg(1) may have more information after failed mount system call. - -The failure comes from the mount_setattr(2) call returning -EINVAL. This -is because we pass an invalid value for the attr_clr argument. From a -strace capture we have: - - mount_setattr(4, "", AT_EMPTY_PATH, {attr_set=0, attr_clr=MOUNT_ATTR_NOATIME, propagation=0 /* MS_??? */, userns_fd=0}, 32) = -1 EINVAL (Invalid argument) - -We can't pass MOUNT_ATTR_NOATIME to mount_setattr(2) through the attr_clr -argument because all atime options are exclusive, so in order to set atime -one has to pass MOUNT_ATTR__ATIME to attr_clr and leave attr_set as -MOUNT_ATTR_RELATIME (which is defined as a value of 0). - -This can be read from the man page for mount_setattr(2) and also from the -kernel source: - - $ cat fs/namespace.c - static int build_mount_kattr(const struct mount_attr *attr, size_t usize, - struct mount_kattr *kattr, unsigned int flags) - { - (...) - /* - * Since the MOUNT_ATTR_ values are an enum, not a bitmap, - * users wanting to transition to a different atime setting cannot - * simply specify the atime setting in @attr_set, but must also - * specify MOUNT_ATTR__ATIME in the @attr_clr field. - * So ensure that MOUNT_ATTR__ATIME can't be partially set in - * @attr_clr and that @attr_set can't have any atime bits set if - * MOUNT_ATTR__ATIME isn't set in @attr_clr. - */ - if (attr->attr_clr & MOUNT_ATTR__ATIME) { - if ((attr->attr_clr & MOUNT_ATTR__ATIME) != MOUNT_ATTR__ATIME) - return -EINVAL; - - /* - * Clear all previous time settings as they are mutually - * exclusive. - */ - kattr->attr_clr |= MNT_RELATIME | MNT_NOATIME; - switch (attr->attr_set & MOUNT_ATTR__ATIME) { - case MOUNT_ATTR_RELATIME: - kattr->attr_set |= MNT_RELATIME; - break; - case MOUNT_ATTR_NOATIME: - kattr->attr_set |= MNT_NOATIME; - break; - case MOUNT_ATTR_STRICTATIME: - break; - default: - return -EINVAL; - } - (...) - -So fix this by setting attr_clr MOUNT_ATTR__ATIME if we want to clear any -atime related option. - -Signed-off-by: Filipe Manana ---- - libmount/src/optlist.c | 13 ++++++++++++- - tests/expected/libmount/context-mount-flags | 3 +++ - tests/ts/libmount/context | 9 ++++++++- - 3 files changed, 23 insertions(+), 2 deletions(-) - -diff --git a/libmount/src/optlist.c b/libmount/src/optlist.c -index e93810b47..d0afc94f7 100644 ---- a/libmount/src/optlist.c -+++ b/libmount/src/optlist.c -@@ -875,7 +875,18 @@ int mnt_optlist_get_attrs(struct libmnt_optlist *ls, uint64_t *set, uint64_t *cl - - if (opt->ent->mask & MNT_INVERT) { - DBG(OPTLIST, ul_debugobj(ls, " clr: %s", opt->ent->name)); -- *clr |= x; -+ /* -+ * All atime settings are mutually exclusive so *clr must -+ * have MOUNT_ATTR__ATIME set. -+ * -+ * See the function fs/namespace.c:build_mount_kattr() -+ * in the linux kernel source. -+ */ -+ if (x == MOUNT_ATTR_RELATIME || x == MOUNT_ATTR_NOATIME || -+ x == MOUNT_ATTR_STRICTATIME) -+ *clr |= MOUNT_ATTR__ATIME; -+ else -+ *clr |= x; - } else { - DBG(OPTLIST, ul_debugobj(ls, " set: %s", opt->ent->name)); - *set |= x; -diff --git a/tests/expected/libmount/context-mount-flags b/tests/expected/libmount/context-mount-flags -index 960641863..eb71323dd 100644 ---- a/tests/expected/libmount/context-mount-flags -+++ b/tests/expected/libmount/context-mount-flags -@@ -3,3 +3,6 @@ ro,nosuid,noexec - successfully mounted - rw,nosuid,noexec - successfully umounted -+successfully mounted -+rw,relatime -+successfully umounted -diff --git a/tests/ts/libmount/context b/tests/ts/libmount/context -index f5b47185e..a5d2e81a3 100755 ---- a/tests/ts/libmount/context -+++ b/tests/ts/libmount/context -@@ -116,8 +116,15 @@ $TS_CMD_FINDMNT --kernel --mountpoint $MOUNTPOINT -o VFS-OPTIONS -n >> $TS_OUTPU - - ts_run $TESTPROG --umount $MOUNTPOINT >> $TS_OUTPUT 2>> $TS_ERRLOG - is_mounted $DEVICE && echo "$DEVICE still mounted" >> $TS_OUTPUT 2>> $TS_ERRLOG --ts_finalize_subtest - -+# Test that the atime option works after the migration to use the new kernel mount APIs. -+ts_run $TESTPROG --mount -o atime $DEVICE $MOUNTPOINT >> $TS_OUTPUT 2>> $TS_ERRLOG -+$TS_CMD_FINDMNT --kernel --mountpoint $MOUNTPOINT -o VFS-OPTIONS -n >> $TS_OUTPUT 2>> $TS_ERRLOG -+is_mounted $DEVICE || echo "$DEVICE not mounted" >> $TS_OUTPUT 2>> $TS_ERRLOG -+ts_run $TESTPROG --umount $MOUNTPOINT >> $TS_OUTPUT 2>> $TS_ERRLOG -+is_mounted $DEVICE && echo "$DEVICE still mounted" >> $TS_OUTPUT 2>> $TS_ERRLOG -+ -+ts_finalize_subtest - - ts_init_subtest "mount-loopdev" - mkdir -p $MOUNTPOINT &> /dev/null --- -2.40.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 70f2665..6ae4593 100644 --- a/util-linux.spec +++ b/util-linux.spec @@ -103,19 +103,19 @@ 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 - -# Backport better support for erofs on ppc64le -Patch2: 0001-blkid-allow-up-to-64k-erofs-block-sizes.patch +# 151635 - login: use O_CREAT on lastlog +Patch0: 0000-login-use-O_CREAT-on-lastlog.patch +# login: add /run/motd.d` to the hardcoded MOTD_FILE +Patch1: 0001-login-add-run-motd.d-to-the-hardcoded-MOTD_FILE.patch +# blkid: allow up to 64k erofs block sizes +Patch2: 0002-blkid-allow-up-to-64k-erofs-block-sizes.patch +# libblkid: use snprintf() instead of sprintf() Patch3: 0003-libblkid-use-snprintf-instead-of-sprintf.patch +# login-utils: fix setpwnam() buffer use [CVE-2025-14104] Patch4: 0004-login-utils-fix-setpwnam-buffer-use-CVE-2025-14104.patch +# wall: always use utmp as fallback +Patch5: 0005-wall-always-use-utmp-as-fallback.patch %description From ac7d4ef0e230eb35c3d96f1bfee6e1fde6224b37 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Wed, 28 Jan 2026 11:54:02 +0100 Subject: [PATCH 28/37] agetty: fix stdin conversion to tty name [BZ#2326710] --- ...tty-fix-stdin-conversion-to-tty-name.patch | 39 +++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 0006-agetty-fix-stdin-conversion-to-tty-name.patch diff --git a/0006-agetty-fix-stdin-conversion-to-tty-name.patch b/0006-agetty-fix-stdin-conversion-to-tty-name.patch new file mode 100644 index 0000000..0e8ebce --- /dev/null +++ b/0006-agetty-fix-stdin-conversion-to-tty-name.patch @@ -0,0 +1,39 @@ +From 5bb099a5d86a26dcac5d32b1c75e6d9f84b298bf Mon Sep 17 00:00:00 2001 +From: Karel Zak +Date: Mon, 24 Feb 2025 13:37:04 +0100 +Subject: agetty: fix stdin conversion to tty name + +Addresses: https://github.com/util-linux/util-linux/issues/3304 +Signed-off-by: Karel Zak +(cherry picked from commit bd6c104f931329ce6fbc5a1250c8c80a1d8223ee) +(cherry picked from commit c69353a5e03779b4840f260ba52a7d2bb7b8943c) +--- + term-utils/agetty.c | 10 +++++++--- + 1 file changed, 7 insertions(+), 3 deletions(-) + +diff --git a/term-utils/agetty.c b/term-utils/agetty.c +index a3823137d..34a39a51b 100644 +--- a/term-utils/agetty.c ++++ b/term-utils/agetty.c +@@ -928,11 +928,15 @@ static void parse_args(int argc, char **argv, struct options *op) + + /* resolve the tty path in case it was provided as stdin */ + if (strcmp(op->tty, "-") == 0) { ++ int fd; ++ const char *name = op->tty; ++ + op->tty_is_stdin = 1; +- int fd = get_terminal_name(NULL, &op->tty, NULL); +- if (fd < 0) { ++ fd = get_terminal_name(NULL, &name, NULL); ++ if (fd >= 0) ++ op->tty = name; /* set real device name */ ++ else + log_warn(_("could not get terminal name: %d"), fd); +- } + } + + /* On virtual console remember the line which is used for */ +-- +2.52.0 + From da7125e4bb4140112a50af0a7ff4b03d3b3d1d1b Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Thu, 2 Apr 2026 14:26:48 +0200 Subject: [PATCH 29/37] 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 30/37] 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 31/37] 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 32/37] 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 33/37] 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 34/37] 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 35/37] 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 36/37] 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 37/37] Rebuilt for Python 3.15.0b4 ABI change