From 1d94d2966ad14311b3ad3c010f1116e81dc7ed42 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Thu, 15 Feb 2024 11:39:09 -0500 Subject: [PATCH 01/57] Backport https://github.com/util-linux/util-linux/commit/211a9da0b4e9704eea210d7944b723fa78272c79 xref https://github.com/coreos/rpm-ostree/issues/4830 --- ...apply-landlock-without-configuration.patch | 32 +++++++++++++++++++ util-linux.spec | 2 ++ 2 files changed, 34 insertions(+) create mode 100644 0001-setpriv-apply-landlock-without-configuration.patch diff --git a/0001-setpriv-apply-landlock-without-configuration.patch b/0001-setpriv-apply-landlock-without-configuration.patch new file mode 100644 index 0000000..287e5da --- /dev/null +++ b/0001-setpriv-apply-landlock-without-configuration.patch @@ -0,0 +1,32 @@ +From 211a9da0b4e9704eea210d7944b723fa78272c79 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= +Date: Wed, 31 Jan 2024 18:01:08 +0100 +Subject: [PATCH] setpriv: apply landlock without configuration +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Fixes #2746 + +Signed-off-by: Thomas Weißschuh +--- + sys-utils/setpriv-landlock.c | 3 +++ + 1 file changed, 3 insertions(+) + +diff --git a/sys-utils/setpriv-landlock.c b/sys-utils/setpriv-landlock.c +index 153e748f6..00ad38c61 100644 +--- a/sys-utils/setpriv-landlock.c ++++ b/sys-utils/setpriv-landlock.c +@@ -166,6 +166,9 @@ void do_landlock(const struct setpriv_landlock_opts *opts) + struct list_head *entry; + int fd, ret; + ++ if (!opts->access_fs) ++ return; ++ + const struct landlock_ruleset_attr ruleset_attr = { + .handled_access_fs = opts->access_fs, + }; +-- +2.41.0 + diff --git a/util-linux.spec b/util-linux.spec index 85ab6d6..839ef65 100644 --- a/util-linux.spec +++ b/util-linux.spec @@ -98,6 +98,8 @@ Patch0: login-lastlog-create.patch # https://github.com/coreos/console-login-helper-messages/issues/60 Patch1: login-default-motd-file.patch +Patch2: 0001-setpriv-apply-landlock-without-configuration.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 0bd50d406feb47fb2a7f2b37a948bf4db506667e Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Wed, 21 Feb 2024 11:30:53 +0100 Subject: [PATCH 02/57] use SPDX based identifiers for license field --- util-linux.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util-linux.spec b/util-linux.spec index 839ef65..826ae17 100644 --- a/util-linux.spec +++ b/util-linux.spec @@ -3,7 +3,7 @@ Summary: Collection of basic system utilities Name: util-linux Version: 2.40 Release: %autorelease -p -e rc1 -License: GPLv2 and GPLv2+ and LGPLv2+ and BSD with advertising and Public Domain +License: GPL-1.0-or-later AND GPL-2.0 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 ### Macros From f0320c8ef7c46d0e3ac0ae50328ad7d0d136d318 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Wed, 28 Feb 2024 14:27:30 +0100 Subject: [PATCH 03/57] fix license related stuff Signed-off-by: Karel Zak (cherry picked from commit 2cc6ef8a87016c91db7fe5599abd8a863c77acdf) --- ...e-proper-XSPD-identifier-for-GPL-2.0.patch | 387 ++++++++++++++++++ util-linux.spec | 55 +-- 2 files changed, 419 insertions(+), 23 deletions(-) create mode 100644 0001-docs-use-proper-XSPD-identifier-for-GPL-2.0.patch diff --git a/0001-docs-use-proper-XSPD-identifier-for-GPL-2.0.patch b/0001-docs-use-proper-XSPD-identifier-for-GPL-2.0.patch new file mode 100644 index 0000000..4e9c6ff --- /dev/null +++ b/0001-docs-use-proper-XSPD-identifier-for-GPL-2.0.patch @@ -0,0 +1,387 @@ +Basede on upstream: + 9769e7b9562d5b856e95a93d0935f864be00baf9 + 1ea0695525dc89afaf3ef78807426e494683dc33 + +diff --git a/Documentation/licenses/COPYING.GPL-2.0-only b/Documentation/licenses/COPYING.GPL-2.0-only +new file mode 100644 +index 000000000..d159169d1 +--- /dev/null ++++ b/Documentation/licenses/COPYING.GPL-2.0-only +@@ -0,0 +1,339 @@ ++ GNU GENERAL PUBLIC LICENSE ++ Version 2, June 1991 ++ ++ Copyright (C) 1989, 1991 Free Software Foundation, Inc., ++ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ++ Everyone is permitted to copy and distribute verbatim copies ++ of this license document, but changing it is not allowed. ++ ++ Preamble ++ ++ The licenses for most software are designed to take away your ++freedom to share and change it. By contrast, the GNU General Public ++License is intended to guarantee your freedom to share and change free ++software--to make sure the software is free for all its users. This ++General Public License applies to most of the Free Software ++Foundation's software and to any other program whose authors commit to ++using it. (Some other Free Software Foundation software is covered by ++the GNU Lesser General Public License instead.) You can apply it to ++your programs, too. ++ ++ When we speak of free software, we are referring to freedom, not ++price. Our General Public Licenses are designed to make sure that you ++have the freedom to distribute copies of free software (and charge for ++this service if you wish), that you receive source code or can get it ++if you want it, that you can change the software or use pieces of it ++in new free programs; and that you know you can do these things. ++ ++ To protect your rights, we need to make restrictions that forbid ++anyone to deny you these rights or to ask you to surrender the rights. ++These restrictions translate to certain responsibilities for you if you ++distribute copies of the software, or if you modify it. ++ ++ For example, if you distribute copies of such a program, whether ++gratis or for a fee, you must give the recipients all the rights that ++you have. You must make sure that they, too, receive or can get the ++source code. And you must show them these terms so they know their ++rights. ++ ++ We protect your rights with two steps: (1) copyright the software, and ++(2) offer you this license which gives you legal permission to copy, ++distribute and/or modify the software. ++ ++ Also, for each author's protection and ours, we want to make certain ++that everyone understands that there is no warranty for this free ++software. If the software is modified by someone else and passed on, we ++want its recipients to know that what they have is not the original, so ++that any problems introduced by others will not reflect on the original ++authors' reputations. ++ ++ Finally, any free program is threatened constantly by software ++patents. We wish to avoid the danger that redistributors of a free ++program will individually obtain patent licenses, in effect making the ++program proprietary. To prevent this, we have made it clear that any ++patent must be licensed for everyone's free use or not licensed at all. ++ ++ The precise terms and conditions for copying, distribution and ++modification follow. ++ ++ GNU GENERAL PUBLIC LICENSE ++ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION ++ ++ 0. This License applies to any program or other work which contains ++a notice placed by the copyright holder saying it may be distributed ++under the terms of this General Public License. The "Program", below, ++refers to any such program or work, and a "work based on the Program" ++means either the Program or any derivative work under copyright law: ++that is to say, a work containing the Program or a portion of it, ++either verbatim or with modifications and/or translated into another ++language. (Hereinafter, translation is included without limitation in ++the term "modification".) Each licensee is addressed as "you". ++ ++Activities other than copying, distribution and modification are not ++covered by this License; they are outside its scope. The act of ++running the Program is not restricted, and the output from the Program ++is covered only if its contents constitute a work based on the ++Program (independent of having been made by running the Program). ++Whether that is true depends on what the Program does. ++ ++ 1. You may copy and distribute verbatim copies of the Program's ++source code as you receive it, in any medium, provided that you ++conspicuously and appropriately publish on each copy an appropriate ++copyright notice and disclaimer of warranty; keep intact all the ++notices that refer to this License and to the absence of any warranty; ++and give any other recipients of the Program a copy of this License ++along with the Program. ++ ++You may charge a fee for the physical act of transferring a copy, and ++you may at your option offer warranty protection in exchange for a fee. ++ ++ 2. You may modify your copy or copies of the Program or any portion ++of it, thus forming a work based on the Program, and copy and ++distribute such modifications or work under the terms of Section 1 ++above, provided that you also meet all of these conditions: ++ ++ a) You must cause the modified files to carry prominent notices ++ stating that you changed the files and the date of any change. ++ ++ b) You must cause any work that you distribute or publish, that in ++ whole or in part contains or is derived from the Program or any ++ part thereof, to be licensed as a whole at no charge to all third ++ parties under the terms of this License. ++ ++ c) If the modified program normally reads commands interactively ++ when run, you must cause it, when started running for such ++ interactive use in the most ordinary way, to print or display an ++ announcement including an appropriate copyright notice and a ++ notice that there is no warranty (or else, saying that you provide ++ a warranty) and that users may redistribute the program under ++ these conditions, and telling the user how to view a copy of this ++ License. (Exception: if the Program itself is interactive but ++ does not normally print such an announcement, your work based on ++ the Program is not required to print an announcement.) ++ ++These requirements apply to the modified work as a whole. If ++identifiable sections of that work are not derived from the Program, ++and can be reasonably considered independent and separate works in ++themselves, then this License, and its terms, do not apply to those ++sections when you distribute them as separate works. But when you ++distribute the same sections as part of a whole which is a work based ++on the Program, the distribution of the whole must be on the terms of ++this License, whose permissions for other licensees extend to the ++entire whole, and thus to each and every part regardless of who wrote it. ++ ++Thus, it is not the intent of this section to claim rights or contest ++your rights to work written entirely by you; rather, the intent is to ++exercise the right to control the distribution of derivative or ++collective works based on the Program. ++ ++In addition, mere aggregation of another work not based on the Program ++with the Program (or with a work based on the Program) on a volume of ++a storage or distribution medium does not bring the other work under ++the scope of this License. ++ ++ 3. You may copy and distribute the Program (or a work based on it, ++under Section 2) in object code or executable form under the terms of ++Sections 1 and 2 above provided that you also do one of the following: ++ ++ a) Accompany it with the complete corresponding machine-readable ++ source code, which must be distributed under the terms of Sections ++ 1 and 2 above on a medium customarily used for software interchange; or, ++ ++ b) Accompany it with a written offer, valid for at least three ++ years, to give any third party, for a charge no more than your ++ cost of physically performing source distribution, a complete ++ machine-readable copy of the corresponding source code, to be ++ distributed under the terms of Sections 1 and 2 above on a medium ++ customarily used for software interchange; or, ++ ++ c) Accompany it with the information you received as to the offer ++ to distribute corresponding source code. (This alternative is ++ allowed only for noncommercial distribution and only if you ++ received the program in object code or executable form with such ++ an offer, in accord with Subsection b above.) ++ ++The source code for a work means the preferred form of the work for ++making modifications to it. For an executable work, complete source ++code means all the source code for all modules it contains, plus any ++associated interface definition files, plus the scripts used to ++control compilation and installation of the executable. However, as a ++special exception, the source code distributed need not include ++anything that is normally distributed (in either source or binary ++form) with the major components (compiler, kernel, and so on) of the ++operating system on which the executable runs, unless that component ++itself accompanies the executable. ++ ++If distribution of executable or object code is made by offering ++access to copy from a designated place, then offering equivalent ++access to copy the source code from the same place counts as ++distribution of the source code, even though third parties are not ++compelled to copy the source along with the object code. ++ ++ 4. You may not copy, modify, sublicense, or distribute the Program ++except as expressly provided under this License. Any attempt ++otherwise to copy, modify, sublicense or distribute the Program is ++void, and will automatically terminate your rights under this License. ++However, parties who have received copies, or rights, from you under ++this License will not have their licenses terminated so long as such ++parties remain in full compliance. ++ ++ 5. You are not required to accept this License, since you have not ++signed it. However, nothing else grants you permission to modify or ++distribute the Program or its derivative works. These actions are ++prohibited by law if you do not accept this License. Therefore, by ++modifying or distributing the Program (or any work based on the ++Program), you indicate your acceptance of this License to do so, and ++all its terms and conditions for copying, distributing or modifying ++the Program or works based on it. ++ ++ 6. Each time you redistribute the Program (or any work based on the ++Program), the recipient automatically receives a license from the ++original licensor to copy, distribute or modify the Program subject to ++these terms and conditions. You may not impose any further ++restrictions on the recipients' exercise of the rights granted herein. ++You are not responsible for enforcing compliance by third parties to ++this License. ++ ++ 7. If, as a consequence of a court judgment or allegation of patent ++infringement or for any other reason (not limited to patent issues), ++conditions are imposed on you (whether by court order, agreement or ++otherwise) that contradict the conditions of this License, they do not ++excuse you from the conditions of this License. If you cannot ++distribute so as to satisfy simultaneously your obligations under this ++License and any other pertinent obligations, then as a consequence you ++may not distribute the Program at all. For example, if a patent ++license would not permit royalty-free redistribution of the Program by ++all those who receive copies directly or indirectly through you, then ++the only way you could satisfy both it and this License would be to ++refrain entirely from distribution of the Program. ++ ++If any portion of this section is held invalid or unenforceable under ++any particular circumstance, the balance of the section is intended to ++apply and the section as a whole is intended to apply in other ++circumstances. ++ ++It is not the purpose of this section to induce you to infringe any ++patents or other property right claims or to contest validity of any ++such claims; this section has the sole purpose of protecting the ++integrity of the free software distribution system, which is ++implemented by public license practices. Many people have made ++generous contributions to the wide range of software distributed ++through that system in reliance on consistent application of that ++system; it is up to the author/donor to decide if he or she is willing ++to distribute software through any other system and a licensee cannot ++impose that choice. ++ ++This section is intended to make thoroughly clear what is believed to ++be a consequence of the rest of this License. ++ ++ 8. If the distribution and/or use of the Program is restricted in ++certain countries either by patents or by copyrighted interfaces, the ++original copyright holder who places the Program under this License ++may add an explicit geographical distribution limitation excluding ++those countries, so that distribution is permitted only in or among ++countries not thus excluded. In such case, this License incorporates ++the limitation as if written in the body of this License. ++ ++ 9. The Free Software Foundation may publish revised and/or new versions ++of the General Public License from time to time. Such new versions will ++be similar in spirit to the present version, but may differ in detail to ++address new problems or concerns. ++ ++Each version is given a distinguishing version number. If the Program ++specifies a version number of this License which applies to it and "any ++later version", you have the option of following the terms and conditions ++either of that version or of any later version published by the Free ++Software Foundation. If the Program does not specify a version number of ++this License, you may choose any version ever published by the Free Software ++Foundation. ++ ++ 10. If you wish to incorporate parts of the Program into other free ++programs whose distribution conditions are different, write to the author ++to ask for permission. For software which is copyrighted by the Free ++Software Foundation, write to the Free Software Foundation; we sometimes ++make exceptions for this. Our decision will be guided by the two goals ++of preserving the free status of all derivatives of our free software and ++of promoting the sharing and reuse of software generally. ++ ++ NO WARRANTY ++ ++ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY ++FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN ++OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES ++PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED ++OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF ++MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS ++TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE ++PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, ++REPAIR OR CORRECTION. ++ ++ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING ++WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR ++REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, ++INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING ++OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED ++TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY ++YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER ++PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE ++POSSIBILITY OF SUCH DAMAGES. ++ ++ END OF TERMS AND CONDITIONS ++ ++ How to Apply These Terms to Your New Programs ++ ++ If you develop a new program, and you want it to be of the greatest ++possible use to the public, the best way to achieve this is to make it ++free software which everyone can redistribute and change under these terms. ++ ++ To do so, attach the following notices to the program. It is safest ++to attach them to the start of each source file to most effectively ++convey the exclusion of warranty; and each file should have at least ++the "copyright" line and a pointer to where the full notice is found. ++ ++ ++ Copyright (C) ++ ++ This program is free software; you can redistribute it and/or modify ++ it under the terms of the GNU General Public License as published by ++ the Free Software Foundation; either version 2 of the License, or ++ (at your option) any later version. ++ ++ This program is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++ GNU General Public License for more details. ++ ++ You should have received a copy of the GNU General Public License along ++ with this program; if not, write to the Free Software Foundation, Inc., ++ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. ++ ++Also add information on how to contact you by electronic and paper mail. ++ ++If the program is interactive, make it output a short notice like this ++when it starts in an interactive mode: ++ ++ Gnomovision version 69, Copyright (C) year name of author ++ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. ++ This is free software, and you are welcome to redistribute it ++ under certain conditions; type `show c' for details. ++ ++The hypothetical commands `show w' and `show c' should show the appropriate ++parts of the General Public License. Of course, the commands you use may ++be called something other than `show w' and `show c'; they could even be ++mouse-clicks or menu items--whatever suits your program. ++ ++You should also get your employer (if you work as a programmer) or your ++school, if any, to sign a "copyright disclaimer" for the program, if ++necessary. Here is a sample; alter the names: ++ ++ Yoyodyne, Inc., hereby disclaims all copyright interest in the program ++ `Gnomovision' (which makes passes at compilers) written by James Hacker. ++ ++ , 1 April 1989 ++ Ty Coon, President of Vice ++ ++This General Public License does not permit incorporating your program into ++proprietary programs. If your program is a subroutine library, you may ++consider it more useful to permit linking proprietary applications with the ++library. If this is what you want to do, use the GNU Lesser General ++Public License instead of this License. +diff --git a/README.licensing b/README.licensing +index 2af646246..4454f8392 100644 +--- a/README.licensing ++++ b/README.licensing +@@ -4,7 +4,7 @@ There is code under: + + * GPL-1.0-or-later - GNU General Public License version 1, or any later version + +- * GPL-2.0 - GNU General Public License version 2 ++ * GPL-2.0-only - GNU General Public License version 2 + + * GPL-2.0-or-later - GNU General Public License version 2, or any later version + +diff --git a/sys-utils/lscpu-dmi.c b/sys-utils/lscpu-dmi.c +index d8fc3dc7b..2171f7623 100644 +--- a/sys-utils/lscpu-dmi.c ++++ b/sys-utils/lscpu-dmi.c +@@ -1,5 +1,5 @@ + /* +- * SPDX-License-Identifier: GPL-2.0 ++ * SPDX-License-Identifier: GPL-2.0-only + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by +diff --git a/sys-utils/nsenter.c b/sys-utils/nsenter.c +index 73ada265b..8f7bac922 100644 +--- a/sys-utils/nsenter.c ++++ b/sys-utils/nsenter.c +@@ -1,5 +1,5 @@ + /* +- * SPDX-License-Identifier: GPL-2.0 ++ * SPDX-License-Identifier: GPL-2.0-only + * + * This program is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License as published by the +-- +2.43.2 + diff --git a/util-linux.spec b/util-linux.spec index 826ae17..15ecb20 100644 --- a/util-linux.spec +++ b/util-linux.spec @@ -3,7 +3,7 @@ Summary: Collection of basic system utilities Name: util-linux Version: 2.40 Release: %autorelease -p -e rc1 -License: GPL-1.0-or-later AND GPL-2.0 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 +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 ### Macros @@ -98,7 +98,9 @@ Patch0: login-lastlog-create.patch # https://github.com/coreos/console-login-helper-messages/issues/60 Patch1: login-default-motd-file.patch +#### Upstream Patch2: 0001-setpriv-apply-landlock-without-configuration.patch +Patch3: 0001-docs-use-proper-XSPD-identifier-for-GPL-2.0.patch %description The util-linux package contains a large variety of low-level system @@ -109,7 +111,8 @@ program. %package -n util-linux-core Summary: The most essential utilities from the util-linux suite -License: GPLv2 and GPLv2+ and LGPLv2+ and BSD with advertising and Public Domain +License: GPL-2.0-only AND GPL-2.0-or-later AND BSD-2-Clause AND BSD-3-Clause AND BSD-4-Clause-UC AND LicenseRef-Fedora-Public-Domain + Provides: /bin/dmesg Provides: /bin/kill Provides: /bin/more @@ -135,7 +138,7 @@ minimal installations. %package -n libfdisk Summary: Partitioning library for fdisk-like programs -License: LGPLv2+ +License: LGPL-2.1-or-later %description -n libfdisk This is library for fdisk-like programs, part of util-linux. @@ -143,7 +146,7 @@ This is library for fdisk-like programs, part of util-linux. %package -n libfdisk-devel Summary: Partitioning library for fdisk-like programs -License: LGPLv2+ +License: LGPL-2.1-or-later Requires: libfdisk%{?_isa} = %{version}-%{release} Requires: pkgconfig @@ -154,7 +157,7 @@ part of util-linux. %package -n libsmartcols Summary: Formatting library for ls-like programs -License: LGPLv2+ +License: LGPL-2.1-or-later %description -n libsmartcols This is library for ls-like terminal programs, part of util-linux. @@ -162,7 +165,7 @@ This is library for ls-like terminal programs, part of util-linux. %package -n libsmartcols-devel Summary: Formatting library for ls-like programs -License: LGPLv2+ +License: LGPL-2.1-or-later Requires: libsmartcols%{?_isa} = %{version}-%{release} Requires: pkgconfig @@ -173,7 +176,7 @@ part of util-linux. %package -n libmount Summary: Device mounting library -License: LGPLv2+ +License: LGPL-2.1-or-later Requires: libblkid%{?_isa} = %{version}-%{release} Requires: libuuid%{?_isa} = %{version}-%{release} Conflicts: filesystem < 3 @@ -184,7 +187,7 @@ This is the device mounting library, part of util-linux. %package -n libmount-devel Summary: Device mounting library -License: LGPLv2+ +License: LGPL-2.1-or-later Requires: libmount%{?_isa} = %{version}-%{release} Requires: pkgconfig @@ -195,7 +198,7 @@ part of util-linux. %package -n libblkid Summary: Block device ID library -License: LGPLv2+ +License: LGPL-2.1-or-later Requires: libuuid%{?_isa} = %{version}-%{release} Conflicts: filesystem < 3 @@ -205,7 +208,7 @@ This is block device identification library, part of util-linux. %package -n libblkid-devel Summary: Block device ID library -License: LGPLv2+ +License: LGPL-2.1-or-later Requires: libblkid%{?_isa} = %{version}-%{release} Requires: pkgconfig @@ -216,7 +219,7 @@ part of util-linux. %package -n libuuid Summary: Universally unique ID library -License: BSD +License: BSD-3-Clause Conflicts: filesystem < 3 %description -n libuuid @@ -233,7 +236,7 @@ See also the "uuid" package, which is a separate implementation. %package -n libuuid-devel Summary: Universally unique ID library -License: BSD +License: BSD-3-Clause AND LGPL-2.1-or-later Requires: libuuid%{?_isa} = %{version}-%{release} Requires: pkgconfig @@ -254,7 +257,7 @@ See also the "uuid-devel" package, which is a separate implementation. %package -n uuidd Summary: Helper daemon to guarantee uniqueness of time-based UUIDs Requires: libuuid = %{version}-%{release} -License: GPLv2 +License: GPL-2.0-only Requires(pre): shadow-utils %{?systemd_ordering} @@ -267,7 +270,7 @@ SMP systems. %package -n %{pypkg}-libmount Summary: Python bindings for the libmount library Requires: libmount%{?_isa} = %{version}-%{release} -License: LGPLv2+ +License: LGPL-2.1-or-later %description -n %{pypkg}-libmount The libmount-python package contains a module that permits applications @@ -279,7 +282,7 @@ mountinfo, etc) and mount filesystems. %package -n util-linux-i18n Summary: Internationalization pack for util-linux Requires: util-linux = %{version}-%{release} -License: GPLv2 +License: GPL-2.0-or-later %description -n util-linux-i18n Internationalization pack with translated messages and manual pages for @@ -777,6 +780,7 @@ fi %files -n util-linux-core +%license Documentation/licenses/* %attr(4755,root,root) %{_bindir}/mount %attr(4755,root,root) %{_bindir}/umount %{_bindir}/chrt @@ -868,7 +872,7 @@ fi %files -n uuidd -%license Documentation/licenses/COPYING.GPL-2.0-or-later +%license Documentation/licenses/COPYING.GPL-2.0-only %{_mandir}/man8/uuidd.8* %{_sbindir}/uuidd %{_unitdir}/uuidd.* @@ -879,41 +883,44 @@ fi %files -n libfdisk -%license Documentation/licenses/COPYING.LGPL-2.1-or-later libfdisk/COPYING +%license Documentation/licenses/COPYING.LGPL-2.1-or-later %{_libdir}/libfdisk.so.* %files -n libfdisk-devel +%license Documentation/licenses/COPYING.LGPL-2.1-or-later %{_libdir}/libfdisk.so %{_includedir}/libfdisk %{_libdir}/pkgconfig/fdisk.pc %files -n libsmartcols -%license Documentation/licenses/COPYING.LGPL-2.1-or-later libsmartcols/COPYING +%license Documentation/licenses/COPYING.LGPL-2.1-or-later %{_libdir}/libsmartcols.so.* %files -n libsmartcols-devel +%license Documentation/licenses/COPYING.LGPL-2.1-or-later %{_libdir}/libsmartcols.so %{_includedir}/libsmartcols %{_libdir}/pkgconfig/smartcols.pc %files -n libmount -%license Documentation/licenses/COPYING.LGPL-2.1-or-later libmount/COPYING +%license Documentation/licenses/COPYING.LGPL-2.1-or-later %{_libdir}/libmount.so.* %files -n libmount-devel +%license Documentation/licenses/COPYING.LGPL-2.1-or-later %{_libdir}/libmount.so %{_includedir}/libmount %{_libdir}/pkgconfig/mount.pc %files -n libblkid -%doc libblkid/COPYING +%license Documentation/licenses/COPYING.LGPL-2.1-or-later %{_libdir}/libblkid.so.* %files -n libblkid-devel -%doc libblkid/COPYING +%license Documentation/licenses/COPYING.LGPL-2.1-or-later %{_libdir}/libblkid.so %{_includedir}/blkid %{_mandir}/man3/libblkid.3* @@ -921,10 +928,11 @@ fi %files -n libuuid -%license Documentation/licenses/COPYING.BSD-3-Clause libuuid/COPYING +%license Documentation/licenses/COPYING.BSD-3-Clause %{_libdir}/libuuid.so.* %files -n libuuid-devel +%license Documentation/licenses/COPYING.BSD-3-Clause Documentation/licenses/COPYING.LGPL-2.1-or-later %{_libdir}/libuuid.so %{_includedir}/uuid %{_mandir}/man3/uuid.3* @@ -942,10 +950,11 @@ fi %{_libdir}/pkgconfig/uuid.pc %files -n %{pypkg}-libmount -%license Documentation/licenses/COPYING.LGPL-2.1-or-later libmount/COPYING +%license Documentation/licenses/COPYING.LGPL-2.1-or-later %{_libdir}/python*/site-packages/libmount/ %files -n util-linux-i18n -f %{name}.lang +%license Documentation/licenses/COPYING.GPL-2.0-or-later %changelog %autochangelog From bc83b318ded4e7ed042511c40b1c4e14928ba841 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Fri, 29 Mar 2024 08:13:14 +0100 Subject: [PATCH 04/57] upgrade to v2.40 --- .gitignore | 1 + ...e-proper-XSPD-identifier-for-GPL-2.0.patch | 387 ------------------ ...apply-landlock-without-configuration.patch | 32 -- sources | 2 +- util-linux.spec | 14 +- 5 files changed, 6 insertions(+), 430 deletions(-) delete mode 100644 0001-docs-use-proper-XSPD-identifier-for-GPL-2.0.patch delete mode 100644 0001-setpriv-apply-landlock-without-configuration.patch diff --git a/.gitignore b/.gitignore index 3e24365..fb30fd7 100644 --- a/.gitignore +++ b/.gitignore @@ -95,3 +95,4 @@ /util-linux-2.39.2.tar.xz /util-linux-2.39.3.tar.xz /util-linux-2.40-rc1.tar.xz +/util-linux-2.40.tar.xz diff --git a/0001-docs-use-proper-XSPD-identifier-for-GPL-2.0.patch b/0001-docs-use-proper-XSPD-identifier-for-GPL-2.0.patch deleted file mode 100644 index 4e9c6ff..0000000 --- a/0001-docs-use-proper-XSPD-identifier-for-GPL-2.0.patch +++ /dev/null @@ -1,387 +0,0 @@ -Basede on upstream: - 9769e7b9562d5b856e95a93d0935f864be00baf9 - 1ea0695525dc89afaf3ef78807426e494683dc33 - -diff --git a/Documentation/licenses/COPYING.GPL-2.0-only b/Documentation/licenses/COPYING.GPL-2.0-only -new file mode 100644 -index 000000000..d159169d1 ---- /dev/null -+++ b/Documentation/licenses/COPYING.GPL-2.0-only -@@ -0,0 +1,339 @@ -+ GNU GENERAL PUBLIC LICENSE -+ Version 2, June 1991 -+ -+ Copyright (C) 1989, 1991 Free Software Foundation, Inc., -+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA -+ Everyone is permitted to copy and distribute verbatim copies -+ of this license document, but changing it is not allowed. -+ -+ Preamble -+ -+ The licenses for most software are designed to take away your -+freedom to share and change it. By contrast, the GNU General Public -+License is intended to guarantee your freedom to share and change free -+software--to make sure the software is free for all its users. This -+General Public License applies to most of the Free Software -+Foundation's software and to any other program whose authors commit to -+using it. (Some other Free Software Foundation software is covered by -+the GNU Lesser General Public License instead.) You can apply it to -+your programs, too. -+ -+ When we speak of free software, we are referring to freedom, not -+price. Our General Public Licenses are designed to make sure that you -+have the freedom to distribute copies of free software (and charge for -+this service if you wish), that you receive source code or can get it -+if you want it, that you can change the software or use pieces of it -+in new free programs; and that you know you can do these things. -+ -+ To protect your rights, we need to make restrictions that forbid -+anyone to deny you these rights or to ask you to surrender the rights. -+These restrictions translate to certain responsibilities for you if you -+distribute copies of the software, or if you modify it. -+ -+ For example, if you distribute copies of such a program, whether -+gratis or for a fee, you must give the recipients all the rights that -+you have. You must make sure that they, too, receive or can get the -+source code. And you must show them these terms so they know their -+rights. -+ -+ We protect your rights with two steps: (1) copyright the software, and -+(2) offer you this license which gives you legal permission to copy, -+distribute and/or modify the software. -+ -+ Also, for each author's protection and ours, we want to make certain -+that everyone understands that there is no warranty for this free -+software. If the software is modified by someone else and passed on, we -+want its recipients to know that what they have is not the original, so -+that any problems introduced by others will not reflect on the original -+authors' reputations. -+ -+ Finally, any free program is threatened constantly by software -+patents. We wish to avoid the danger that redistributors of a free -+program will individually obtain patent licenses, in effect making the -+program proprietary. To prevent this, we have made it clear that any -+patent must be licensed for everyone's free use or not licensed at all. -+ -+ The precise terms and conditions for copying, distribution and -+modification follow. -+ -+ GNU GENERAL PUBLIC LICENSE -+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION -+ -+ 0. This License applies to any program or other work which contains -+a notice placed by the copyright holder saying it may be distributed -+under the terms of this General Public License. The "Program", below, -+refers to any such program or work, and a "work based on the Program" -+means either the Program or any derivative work under copyright law: -+that is to say, a work containing the Program or a portion of it, -+either verbatim or with modifications and/or translated into another -+language. (Hereinafter, translation is included without limitation in -+the term "modification".) Each licensee is addressed as "you". -+ -+Activities other than copying, distribution and modification are not -+covered by this License; they are outside its scope. The act of -+running the Program is not restricted, and the output from the Program -+is covered only if its contents constitute a work based on the -+Program (independent of having been made by running the Program). -+Whether that is true depends on what the Program does. -+ -+ 1. You may copy and distribute verbatim copies of the Program's -+source code as you receive it, in any medium, provided that you -+conspicuously and appropriately publish on each copy an appropriate -+copyright notice and disclaimer of warranty; keep intact all the -+notices that refer to this License and to the absence of any warranty; -+and give any other recipients of the Program a copy of this License -+along with the Program. -+ -+You may charge a fee for the physical act of transferring a copy, and -+you may at your option offer warranty protection in exchange for a fee. -+ -+ 2. You may modify your copy or copies of the Program or any portion -+of it, thus forming a work based on the Program, and copy and -+distribute such modifications or work under the terms of Section 1 -+above, provided that you also meet all of these conditions: -+ -+ a) You must cause the modified files to carry prominent notices -+ stating that you changed the files and the date of any change. -+ -+ b) You must cause any work that you distribute or publish, that in -+ whole or in part contains or is derived from the Program or any -+ part thereof, to be licensed as a whole at no charge to all third -+ parties under the terms of this License. -+ -+ c) If the modified program normally reads commands interactively -+ when run, you must cause it, when started running for such -+ interactive use in the most ordinary way, to print or display an -+ announcement including an appropriate copyright notice and a -+ notice that there is no warranty (or else, saying that you provide -+ a warranty) and that users may redistribute the program under -+ these conditions, and telling the user how to view a copy of this -+ License. (Exception: if the Program itself is interactive but -+ does not normally print such an announcement, your work based on -+ the Program is not required to print an announcement.) -+ -+These requirements apply to the modified work as a whole. If -+identifiable sections of that work are not derived from the Program, -+and can be reasonably considered independent and separate works in -+themselves, then this License, and its terms, do not apply to those -+sections when you distribute them as separate works. But when you -+distribute the same sections as part of a whole which is a work based -+on the Program, the distribution of the whole must be on the terms of -+this License, whose permissions for other licensees extend to the -+entire whole, and thus to each and every part regardless of who wrote it. -+ -+Thus, it is not the intent of this section to claim rights or contest -+your rights to work written entirely by you; rather, the intent is to -+exercise the right to control the distribution of derivative or -+collective works based on the Program. -+ -+In addition, mere aggregation of another work not based on the Program -+with the Program (or with a work based on the Program) on a volume of -+a storage or distribution medium does not bring the other work under -+the scope of this License. -+ -+ 3. You may copy and distribute the Program (or a work based on it, -+under Section 2) in object code or executable form under the terms of -+Sections 1 and 2 above provided that you also do one of the following: -+ -+ a) Accompany it with the complete corresponding machine-readable -+ source code, which must be distributed under the terms of Sections -+ 1 and 2 above on a medium customarily used for software interchange; or, -+ -+ b) Accompany it with a written offer, valid for at least three -+ years, to give any third party, for a charge no more than your -+ cost of physically performing source distribution, a complete -+ machine-readable copy of the corresponding source code, to be -+ distributed under the terms of Sections 1 and 2 above on a medium -+ customarily used for software interchange; or, -+ -+ c) Accompany it with the information you received as to the offer -+ to distribute corresponding source code. (This alternative is -+ allowed only for noncommercial distribution and only if you -+ received the program in object code or executable form with such -+ an offer, in accord with Subsection b above.) -+ -+The source code for a work means the preferred form of the work for -+making modifications to it. For an executable work, complete source -+code means all the source code for all modules it contains, plus any -+associated interface definition files, plus the scripts used to -+control compilation and installation of the executable. However, as a -+special exception, the source code distributed need not include -+anything that is normally distributed (in either source or binary -+form) with the major components (compiler, kernel, and so on) of the -+operating system on which the executable runs, unless that component -+itself accompanies the executable. -+ -+If distribution of executable or object code is made by offering -+access to copy from a designated place, then offering equivalent -+access to copy the source code from the same place counts as -+distribution of the source code, even though third parties are not -+compelled to copy the source along with the object code. -+ -+ 4. You may not copy, modify, sublicense, or distribute the Program -+except as expressly provided under this License. Any attempt -+otherwise to copy, modify, sublicense or distribute the Program is -+void, and will automatically terminate your rights under this License. -+However, parties who have received copies, or rights, from you under -+this License will not have their licenses terminated so long as such -+parties remain in full compliance. -+ -+ 5. You are not required to accept this License, since you have not -+signed it. However, nothing else grants you permission to modify or -+distribute the Program or its derivative works. These actions are -+prohibited by law if you do not accept this License. Therefore, by -+modifying or distributing the Program (or any work based on the -+Program), you indicate your acceptance of this License to do so, and -+all its terms and conditions for copying, distributing or modifying -+the Program or works based on it. -+ -+ 6. Each time you redistribute the Program (or any work based on the -+Program), the recipient automatically receives a license from the -+original licensor to copy, distribute or modify the Program subject to -+these terms and conditions. You may not impose any further -+restrictions on the recipients' exercise of the rights granted herein. -+You are not responsible for enforcing compliance by third parties to -+this License. -+ -+ 7. If, as a consequence of a court judgment or allegation of patent -+infringement or for any other reason (not limited to patent issues), -+conditions are imposed on you (whether by court order, agreement or -+otherwise) that contradict the conditions of this License, they do not -+excuse you from the conditions of this License. If you cannot -+distribute so as to satisfy simultaneously your obligations under this -+License and any other pertinent obligations, then as a consequence you -+may not distribute the Program at all. For example, if a patent -+license would not permit royalty-free redistribution of the Program by -+all those who receive copies directly or indirectly through you, then -+the only way you could satisfy both it and this License would be to -+refrain entirely from distribution of the Program. -+ -+If any portion of this section is held invalid or unenforceable under -+any particular circumstance, the balance of the section is intended to -+apply and the section as a whole is intended to apply in other -+circumstances. -+ -+It is not the purpose of this section to induce you to infringe any -+patents or other property right claims or to contest validity of any -+such claims; this section has the sole purpose of protecting the -+integrity of the free software distribution system, which is -+implemented by public license practices. Many people have made -+generous contributions to the wide range of software distributed -+through that system in reliance on consistent application of that -+system; it is up to the author/donor to decide if he or she is willing -+to distribute software through any other system and a licensee cannot -+impose that choice. -+ -+This section is intended to make thoroughly clear what is believed to -+be a consequence of the rest of this License. -+ -+ 8. If the distribution and/or use of the Program is restricted in -+certain countries either by patents or by copyrighted interfaces, the -+original copyright holder who places the Program under this License -+may add an explicit geographical distribution limitation excluding -+those countries, so that distribution is permitted only in or among -+countries not thus excluded. In such case, this License incorporates -+the limitation as if written in the body of this License. -+ -+ 9. The Free Software Foundation may publish revised and/or new versions -+of the General Public License from time to time. Such new versions will -+be similar in spirit to the present version, but may differ in detail to -+address new problems or concerns. -+ -+Each version is given a distinguishing version number. If the Program -+specifies a version number of this License which applies to it and "any -+later version", you have the option of following the terms and conditions -+either of that version or of any later version published by the Free -+Software Foundation. If the Program does not specify a version number of -+this License, you may choose any version ever published by the Free Software -+Foundation. -+ -+ 10. If you wish to incorporate parts of the Program into other free -+programs whose distribution conditions are different, write to the author -+to ask for permission. For software which is copyrighted by the Free -+Software Foundation, write to the Free Software Foundation; we sometimes -+make exceptions for this. Our decision will be guided by the two goals -+of preserving the free status of all derivatives of our free software and -+of promoting the sharing and reuse of software generally. -+ -+ NO WARRANTY -+ -+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY -+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN -+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES -+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED -+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF -+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS -+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE -+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, -+REPAIR OR CORRECTION. -+ -+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING -+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR -+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, -+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING -+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED -+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY -+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER -+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE -+POSSIBILITY OF SUCH DAMAGES. -+ -+ END OF TERMS AND CONDITIONS -+ -+ How to Apply These Terms to Your New Programs -+ -+ If you develop a new program, and you want it to be of the greatest -+possible use to the public, the best way to achieve this is to make it -+free software which everyone can redistribute and change under these terms. -+ -+ To do so, attach the following notices to the program. It is safest -+to attach them to the start of each source file to most effectively -+convey the exclusion of warranty; and each file should have at least -+the "copyright" line and a pointer to where the full notice is found. -+ -+ -+ Copyright (C) -+ -+ This program is free software; you can redistribute it and/or modify -+ it under the terms of the GNU General Public License as published by -+ the Free Software Foundation; either version 2 of the License, or -+ (at your option) any later version. -+ -+ This program is distributed in the hope that it will be useful, -+ but WITHOUT ANY WARRANTY; without even the implied warranty of -+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+ GNU General Public License for more details. -+ -+ You should have received a copy of the GNU General Public License along -+ with this program; if not, write to the Free Software Foundation, Inc., -+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -+ -+Also add information on how to contact you by electronic and paper mail. -+ -+If the program is interactive, make it output a short notice like this -+when it starts in an interactive mode: -+ -+ Gnomovision version 69, Copyright (C) year name of author -+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. -+ This is free software, and you are welcome to redistribute it -+ under certain conditions; type `show c' for details. -+ -+The hypothetical commands `show w' and `show c' should show the appropriate -+parts of the General Public License. Of course, the commands you use may -+be called something other than `show w' and `show c'; they could even be -+mouse-clicks or menu items--whatever suits your program. -+ -+You should also get your employer (if you work as a programmer) or your -+school, if any, to sign a "copyright disclaimer" for the program, if -+necessary. Here is a sample; alter the names: -+ -+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program -+ `Gnomovision' (which makes passes at compilers) written by James Hacker. -+ -+ , 1 April 1989 -+ Ty Coon, President of Vice -+ -+This General Public License does not permit incorporating your program into -+proprietary programs. If your program is a subroutine library, you may -+consider it more useful to permit linking proprietary applications with the -+library. If this is what you want to do, use the GNU Lesser General -+Public License instead of this License. -diff --git a/README.licensing b/README.licensing -index 2af646246..4454f8392 100644 ---- a/README.licensing -+++ b/README.licensing -@@ -4,7 +4,7 @@ There is code under: - - * GPL-1.0-or-later - GNU General Public License version 1, or any later version - -- * GPL-2.0 - GNU General Public License version 2 -+ * GPL-2.0-only - GNU General Public License version 2 - - * GPL-2.0-or-later - GNU General Public License version 2, or any later version - -diff --git a/sys-utils/lscpu-dmi.c b/sys-utils/lscpu-dmi.c -index d8fc3dc7b..2171f7623 100644 ---- a/sys-utils/lscpu-dmi.c -+++ b/sys-utils/lscpu-dmi.c -@@ -1,5 +1,5 @@ - /* -- * SPDX-License-Identifier: GPL-2.0 -+ * SPDX-License-Identifier: GPL-2.0-only - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by -diff --git a/sys-utils/nsenter.c b/sys-utils/nsenter.c -index 73ada265b..8f7bac922 100644 ---- a/sys-utils/nsenter.c -+++ b/sys-utils/nsenter.c -@@ -1,5 +1,5 @@ - /* -- * SPDX-License-Identifier: GPL-2.0 -+ * SPDX-License-Identifier: GPL-2.0-only - * - * This program is free software; you can redistribute it and/or modify it - * under the terms of the GNU General Public License as published by the --- -2.43.2 - diff --git a/0001-setpriv-apply-landlock-without-configuration.patch b/0001-setpriv-apply-landlock-without-configuration.patch deleted file mode 100644 index 287e5da..0000000 --- a/0001-setpriv-apply-landlock-without-configuration.patch +++ /dev/null @@ -1,32 +0,0 @@ -From 211a9da0b4e9704eea210d7944b723fa78272c79 Mon Sep 17 00:00:00 2001 -From: =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= -Date: Wed, 31 Jan 2024 18:01:08 +0100 -Subject: [PATCH] setpriv: apply landlock without configuration -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -Fixes #2746 - -Signed-off-by: Thomas Weißschuh ---- - sys-utils/setpriv-landlock.c | 3 +++ - 1 file changed, 3 insertions(+) - -diff --git a/sys-utils/setpriv-landlock.c b/sys-utils/setpriv-landlock.c -index 153e748f6..00ad38c61 100644 ---- a/sys-utils/setpriv-landlock.c -+++ b/sys-utils/setpriv-landlock.c -@@ -166,6 +166,9 @@ void do_landlock(const struct setpriv_landlock_opts *opts) - struct list_head *entry; - int fd, ret; - -+ if (!opts->access_fs) -+ return; -+ - const struct landlock_ruleset_attr ruleset_attr = { - .handled_access_fs = opts->access_fs, - }; --- -2.41.0 - diff --git a/sources b/sources index 07a0cbb..26ecdeb 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (util-linux-2.40-rc1.tar.xz) = ba307c4686c7989c1d563f19ca6a1c06c237de2fe063a51e28aaefee7a1afab49deb94abd80b4263c2d671f791798112b287dc3f1b3d73d755119e01883aaeb0 +SHA512 (util-linux-2.40.tar.xz) = f06e61d4ee0e196223f7341ec75a16a6671f82d6e353823490ecff17e947bb169a6b65177e3ab0da6e733e079b24d6a77905a0e8bbfed82ca9aa22a3facb6180 diff --git a/util-linux.spec b/util-linux.spec index 15ecb20..bf1d64c 100644 --- a/util-linux.spec +++ b/util-linux.spec @@ -2,12 +2,13 @@ Summary: Collection of basic system utilities Name: util-linux Version: 2.40 -Release: %autorelease -p -e rc1 +# -e rc1 +Release: %autorelease -p 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 ### Macros -%global upstream_version %{version}-rc1 +%global upstream_version %{version} %global upstream_major %(eval echo %{version} | sed -e 's/\([[:digit:]]*\)\.\([[:digit:]]*\)\.[[:digit:]]*$/\1.\2/') %global compldir %{_datadir}/bash-completion/completions/ @@ -48,7 +49,6 @@ Source0: https://www.kernel.org/pub/linux/utils/util-linux/v%{upstream_major}/ut Source1: util-linux-login.pamd Source2: util-linux-remote.pamd Source3: util-linux-chsh-chfn.pamd -Source4: uuidd-tmpfiles.conf Source5: adjtime Source12: util-linux-su.pamd Source13: util-linux-su-l.pamd @@ -98,10 +98,6 @@ Patch0: login-lastlog-create.patch # https://github.com/coreos/console-login-helper-messages/issues/60 Patch1: login-default-motd-file.patch -#### Upstream -Patch2: 0001-setpriv-apply-landlock-without-configuration.patch -Patch3: 0001-docs-use-proper-XSPD-identifier-for-GPL-2.0.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 @@ -345,13 +341,11 @@ mkdir -p %{buildroot}%{_bindir} mkdir -p %{buildroot}%{_mandir}/man{1,6,8,5} mkdir -p %{buildroot}%{_sbindir} mkdir -p %{buildroot}%{_sysconfdir}/{pam.d,security/console.apps} -mkdir -p %{buildroot}%{_tmpfilesdir}/tmpfiles.d # install util-linux %make_install # And a dirs uuidd needs that the makefiles don't create -install -m 644 %{SOURCE4} %{buildroot}%{_tmpfilesdir}/uuidd.conf install -d %{buildroot}/run/uuidd install -d %{buildroot}/var/lib/libuuid @@ -879,7 +873,7 @@ fi %dir %attr(2775, uuidd, uuidd) /var/lib/libuuid %dir %attr(2775, uuidd, uuidd) /run/uuidd %{compldir}/uuidd -%{_tmpfilesdir}/uuidd.conf +%{_tmpfilesdir}/uuidd-tmpfiles.conf %files -n libfdisk From 981295a856c8c691e1305e6876da93b85df026a1 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Mon, 8 Apr 2024 10:58:15 +0200 Subject: [PATCH 05/57] remove pre-release option --- util-linux.spec | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/util-linux.spec b/util-linux.spec index bf1d64c..18e254a 100644 --- a/util-linux.spec +++ b/util-linux.spec @@ -2,8 +2,8 @@ Summary: Collection of basic system utilities Name: util-linux Version: 2.40 -# -e rc1 -Release: %autorelease -p +# -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 URL: https://en.wikipedia.org/wiki/Util-linux From e345fc8ab4fb999c4065c8d9a98e4deaef6e9242 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Mon, 6 May 2024 11:12:57 +0200 Subject: [PATCH 06/57] upgrade to stable v2.40.1 --- .gitignore | 1 + sources | 2 +- util-linux.spec | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index fb30fd7..9ecda1d 100644 --- a/.gitignore +++ b/.gitignore @@ -96,3 +96,4 @@ /util-linux-2.39.3.tar.xz /util-linux-2.40-rc1.tar.xz /util-linux-2.40.tar.xz +/util-linux-2.40.1.tar.xz diff --git a/sources b/sources index 26ecdeb..442de23 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (util-linux-2.40.tar.xz) = f06e61d4ee0e196223f7341ec75a16a6671f82d6e353823490ecff17e947bb169a6b65177e3ab0da6e733e079b24d6a77905a0e8bbfed82ca9aa22a3facb6180 +SHA512 (util-linux-2.40.1.tar.xz) = 58ec6eb41d4b6bfc544a80e95c71b5f3798ab4d2a9435d3ee9e5edd56f9b3f09bcb154bdd70e002dc018938937e2e946ae731dcda0f86b362fc43423689e41fc diff --git a/util-linux.spec b/util-linux.spec index 18e254a..3d52c8d 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 +Version: 2.40.1 # -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 From 8472af8e2cef61f096a69a8fcf25e8429fd741f8 Mon Sep 17 00:00:00 2001 From: Python Maint Date: Fri, 7 Jun 2024 08:51:30 +0200 Subject: [PATCH 07/57] Rebuilt for Python 3.13 From abe9339a371a544b2ad4ac8a7a152da0fae82a04 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Thu, 4 Jul 2024 10:39:33 +0200 Subject: [PATCH 08/57] upgrade from v2.40.1 to v2.40.2 https://kernel.org/pub/linux/utils/util-linux/v2.40/v2.40.2-ReleaseNotes --- .gitignore | 1 + sources | 2 +- util-linux.spec | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 9ecda1d..89553dd 100644 --- a/.gitignore +++ b/.gitignore @@ -97,3 +97,4 @@ /util-linux-2.40-rc1.tar.xz /util-linux-2.40.tar.xz /util-linux-2.40.1.tar.xz +/util-linux-2.40.2.tar.xz diff --git a/sources b/sources index 442de23..6967bee 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (util-linux-2.40.1.tar.xz) = 58ec6eb41d4b6bfc544a80e95c71b5f3798ab4d2a9435d3ee9e5edd56f9b3f09bcb154bdd70e002dc018938937e2e946ae731dcda0f86b362fc43423689e41fc +SHA512 (util-linux-2.40.2.tar.xz) = ffe20b915a518a150401d429b0338bc7022190e4ca0ef91a6d9eea345db8c1e11ad01784163b8fcf978506f3f5cad473f29d5d4ef93a4c66a5ae0ebd9fb0c8f2 diff --git a/util-linux.spec b/util-linux.spec index 3d52c8d..0042b1a 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.1 +Version: 2.40.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 From 480d4cbafaacec08ea9fe60d03b1f1380845ba6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Mon, 8 Apr 2024 21:24:08 +0200 Subject: [PATCH 09/57] Add workaround for borked autotools installation https://fedoraproject.org/wiki/Changes/Unify_bin_and_sbin Without this, build on a system with merged-sbin fails. [skip changelog] --- util-linux.spec | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/util-linux.spec b/util-linux.spec index 0042b1a..6cd737d 100644 --- a/util-linux.spec +++ b/util-linux.spec @@ -434,6 +434,11 @@ find %{buildroot}%{_mandir}/man8 -regextype posix-egrep \ -regex ".*(linux32|linux64|s390|s390x|i386|ppc|ppc64|ppc32|sparc|sparc64|sparc32|sparc32bash|mips|mips64|mips32|ia64|x86_64|uname26)\.8.*" \ -printf "%{_mandir}/man8/%f*\n" >> %{name}.files +%if "%{_sbindir}" == "%{_bindir}" +# Autotools installation script gets the location wrong :( +mv -v %{buildroot}/usr/sbin/* %{buildroot}/usr/bin/ +%endif + %post %systemd_post fstrim.{service,timer} From c96f6dfba772a76c1c998e395fc9640156baf5a9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Wed, 10 Apr 2024 22:05:23 +0200 Subject: [PATCH 10/57] Add compat Providess for binaries under /usr/sbin https://fedoraproject.org/wiki/Changes/Unify_bin_and_sbin Requires:/usr/sbin/runuser is present in knot. BuildRequires: /usr/sbin{fsck,sfdisk} used by some other packages. --- util-linux.spec | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/util-linux.spec b/util-linux.spec index 6cd737d..3919360 100644 --- a/util-linux.spec +++ b/util-linux.spec @@ -90,6 +90,14 @@ Requires: libsmartcols = %{version}-%{release} Requires: libfdisk = %{version}-%{release} Requires: util-linux-core = %{version}-%{release} +%if "%{_sbindir}" == "%{_bindir}" +# Compat symlinks for Requires in other packages. +# We rely on filesystem to create the symlinks for us. +Requires: filesystem(unmerged-sbin-symlinks) +Provides: /usr/sbin/runuser +Provides: /usr/sbin/sfdisk +%endif + ### Ready for upstream? ### # 151635 - makeing /var/log/lastlog @@ -127,6 +135,13 @@ Requires: libsmartcols = %{version}-%{release} # old versions of e2fsprogs contain fsck, uuidgen Conflicts: e2fsprogs < 1.41.8-5 +%if "%{_sbindir}" == "%{_bindir}" +# Compat symlinks for Requires in other packages. +# We rely on filesystem to create the symlinks for us. +Requires: filesystem(unmerged-sbin-symlinks) +Provides: /usr/sbin/fsck +%endif + %description -n util-linux-core This is a very basic set of Linux utilities that is necessary on minimal installations. From 479766f342fa0b4b2f2e89090ce623d0c8987e72 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sat, 20 Jul 2024 08:28:34 +0000 Subject: [PATCH 11/57] Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild From 0921016466e03ce6d9700c3d15ef74fae6fa7296 Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Wed, 14 Aug 2024 13:28:56 +0200 Subject: [PATCH 12/57] Fix whitespace issues --- util-linux.spec | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/util-linux.spec b/util-linux.spec index 3919360..ae2dbca 100644 --- a/util-linux.spec +++ b/util-linux.spec @@ -494,7 +494,7 @@ fi %files -f %{name}.files %doc README NEWS AUTHORS -%doc Documentation/deprecated.txt +%doc Documentation/deprecated.txt %license Documentation/licenses/* %doc misc-utils/getopt-*.{bash,tcsh} @@ -972,4 +972,3 @@ fi %changelog %autochangelog - From 6975c91b719e1ad13d96215197d8b80ce1c62eac Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Wed, 14 Aug 2024 13:29:11 +0200 Subject: [PATCH 13/57] Remove setgid and tty group from /usr/bin/write We already require root privileges for /usr/bin/wall so let's do the same for /usr/bin/write. """ -rwxr-xr-x 1 root root 28456 Aug 14 02:00 /usr/bin/wall -rwxr-xr-x 1 root root 36792 Aug 14 02:00 /usr/bin/wdctl -rwxr-xr-x 1 root root 33160 Aug 14 02:00 /usr/bin/whereis -rwxr-xr-x 1 root root 24352 Aug 14 02:00 /usr/bin/write """ --- util-linux.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util-linux.spec b/util-linux.spec index ae2dbca..e1fc728 100644 --- a/util-linux.spec +++ b/util-linux.spec @@ -511,7 +511,6 @@ fi %attr(4755,root,root) %{_bindir}/su %attr(755,root,root) %{_bindir}/login -%attr(2755,root,tty) %{_bindir}/write %attr(4711,root,root) %{_bindir}/chfn %attr(4711,root,root) %{_bindir}/chsh @@ -570,6 +569,7 @@ fi %{_bindir}/wall %{_bindir}/wdctl %{_bindir}/whereis +%{_bindir}/write %{_mandir}/man1/cal.1* %{_mandir}/man1/chfn.1* %{_mandir}/man1/choom.1* From 5a2471d6e5b0055cb607b30dc2e9613b312ffb74 Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Fri, 23 Aug 2024 11:27:11 +0200 Subject: [PATCH 14/57] Move script utilities to util-linux-script subpackage This allows installing util-linux without pulling in the libutempter library which includes a setgid binary that I'd like to avoid installing on my systems. --- util-linux.spec | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/util-linux.spec b/util-linux.spec index e1fc728..6f01ef4 100644 --- a/util-linux.spec +++ b/util-linux.spec @@ -299,6 +299,12 @@ License: GPL-2.0-or-later Internationalization pack with translated messages and manual pages for util-linux commands. +%package -n util-linux-script +Summary: The various script utilities +Requires: util-linux = %{version}-%{release} + +%description -n util-linux-script +The script, scriptreplay and scriptlive utilities. %prep %autosetup -p1 -n %{name}-%{upstream_version} @@ -553,9 +559,6 @@ fi %{_bindir}/prlimit %{_bindir}/rename %{_bindir}/rev -%{_bindir}/script -%{_bindir}/scriptlive -%{_bindir}/scriptreplay %{_bindir}/setarch %{_bindir}/setpgid %{_bindir}/setpriv @@ -970,5 +973,10 @@ fi %files -n util-linux-i18n -f %{name}.lang %license Documentation/licenses/COPYING.GPL-2.0-or-later +%files -n util-linux-script +%{_bindir}/script +%{_bindir}/scriptlive +%{_bindir}/scriptreplay + %changelog %autochangelog From 61d2c55ceb565b0fdc391aded5bd9af71ca026ec Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Tue, 3 Sep 2024 12:15:12 +0200 Subject: [PATCH 15/57] improve util-linux-script subpackage --- util-linux.spec | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/util-linux.spec b/util-linux.spec index 6f01ef4..4017fe7 100644 --- a/util-linux.spec +++ b/util-linux.spec @@ -300,11 +300,11 @@ Internationalization pack with translated messages and manual pages for util-linux commands. %package -n util-linux-script -Summary: The various script utilities +Summary: Utilities for creating and replaying typescripts of terminal session Requires: util-linux = %{version}-%{release} %description -n util-linux-script -The script, scriptreplay and scriptlive utilities. +The utilities scripts, scriptreplay, and scriptlive are used to create and replay terminal sessions. %prep %autosetup -p1 -n %{name}-%{upstream_version} @@ -609,9 +609,6 @@ fi %{_mandir}/man1/rename.1* %{_mandir}/man1/rev.1* %{_mandir}/man1/runuser.1* -%{_mandir}/man1/script.1* -%{_mandir}/man1/scriptlive.1* -%{_mandir}/man1/scriptreplay.1* %{_mandir}/man1/setpgid.1* %{_mandir}/man1/setpriv.1* %{_mandir}/man1/setterm.1* @@ -748,9 +745,6 @@ fi %{compldir}/rfkill %{compldir}/rtcwake %{compldir}/runuser -%{compldir}/script -%{compldir}/scriptlive -%{compldir}/scriptreplay %{compldir}/setarch %{compldir}/setpriv %{compldir}/setpgid @@ -977,6 +971,12 @@ fi %{_bindir}/script %{_bindir}/scriptlive %{_bindir}/scriptreplay +%{_mandir}/man1/script.1* +%{_mandir}/man1/scriptlive.1* +%{_mandir}/man1/scriptreplay.1* +%{compldir}/script +%{compldir}/scriptlive +%{compldir}/scriptreplay %changelog %autochangelog From 240d76d679c764ffc52573db7022ac296420c049 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Sun, 12 Jan 2025 14:42:55 +0100 Subject: [PATCH 16/57] Rebuilt for the bin-sbin merge (2nd attempt) https://fedoraproject.org/wiki/Changes/Unify_bin_and_sbin From d6af9bf445c328efa44d6c3a7acb654a25552975 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Wed, 15 Jan 2025 11:19:34 +0100 Subject: [PATCH 17/57] upgrade to v2.40.4 https://www.kernel.org/pub/linux/utils/util-linux/v2.40/v2.40.4-ReleaseNotes https://www.kernel.org/pub/linux/utils/util-linux/v2.40/v2.40.3-ReleaseNotes --- .gitignore | 1 + sources | 2 +- util-linux.spec | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index 89553dd..9be7f90 100644 --- a/.gitignore +++ b/.gitignore @@ -98,3 +98,4 @@ /util-linux-2.40.tar.xz /util-linux-2.40.1.tar.xz /util-linux-2.40.2.tar.xz +/util-linux-2.40.4.tar.xz diff --git a/sources b/sources index 6967bee..ed7ccad 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (util-linux-2.40.2.tar.xz) = ffe20b915a518a150401d429b0338bc7022190e4ca0ef91a6d9eea345db8c1e11ad01784163b8fcf978506f3f5cad473f29d5d4ef93a4c66a5ae0ebd9fb0c8f2 +SHA512 (util-linux-2.40.4.tar.xz) = 0024955056ba7b4c54040a917f9919f49692e57ba6d42d17a6c29c1eefe88bf48b1214a545072b71c468829a63a8f15237f49733e9127c134e11126d1e435124 diff --git a/util-linux.spec b/util-linux.spec index 4017fe7..7d3d4c5 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.2 +Version: 2.40.4 # -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 From 0298d7d2a249367d277f081baec724dcc6431c19 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sun, 19 Jan 2025 14:00:04 +0000 Subject: [PATCH 18/57] Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild From 56f4756f3ac033f9cc7b2be94847a3cb38ad8da1 Mon Sep 17 00:00:00 2001 From: Yaakov Selkowitz Date: Fri, 3 Jan 2025 16:18:03 -0500 Subject: [PATCH 19/57] Conditionalize pam dependency pam is a host service, and is not used inside of flatpaks or toolboxes. --- util-linux.spec | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/util-linux.spec b/util-linux.spec index 7d3d4c5..beae061 100644 --- a/util-linux.spec +++ b/util-linux.spec @@ -81,7 +81,8 @@ Obsoletes: util-linux-user < 2.39-1 Provides: util-linux-user = %{version}-%{release} Requires(post): coreutils -Requires: pam >= 1.1.3-7, /etc/pam.d/system-auth +Requires: (pam >= 1.1.3-7 if systemd) +Requires: (/etc/pam.d/system-auth if systemd) Requires: audit-libs >= 1.0.6 Requires: libuuid = %{version}-%{release} Requires: libblkid = %{version}-%{release} From 3abb2f6222109a9a7e9ab9126cb338a407f574ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Esser?= Date: Sat, 1 Feb 2025 19:58:02 +0100 Subject: [PATCH 20/57] Add explicit BR: libxcrypt-devel MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Björn Esser --- util-linux.spec | 1 + 1 file changed, 1 insertion(+) diff --git a/util-linux.spec b/util-linux.spec index 7d3d4c5..d66fdbb 100644 --- a/util-linux.spec +++ b/util-linux.spec @@ -21,6 +21,7 @@ BuildRequires: make BuildRequires: audit-libs-devel >= 1.0.6 BuildRequires: gettext-devel BuildRequires: libselinux-devel +BuildRequires: libxcrypt-devel BuildRequires: ncurses-devel BuildRequires: readline-devel BuildRequires: pam-devel From 674f706e83053354b74c7ac65bfa41df8c316a52 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Tue, 4 Feb 2025 10:43:12 +0100 Subject: [PATCH 21/57] add sysusers config for uuidd --- util-linux-uuidd-sysusers.conf | 1 + util-linux.spec | 6 ++++++ 2 files changed, 7 insertions(+) create mode 100644 util-linux-uuidd-sysusers.conf 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 d66fdbb..b8d0028 100644 --- a/util-linux.spec +++ b/util-linux.spec @@ -56,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 @@ -371,6 +374,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 @@ -892,6 +897,7 @@ fi %dir %attr(2775, uuidd, uuidd) /run/uuidd %{compldir}/uuidd %{_tmpfilesdir}/uuidd-tmpfiles.conf +%{_sysusersdir}/uuidd.conf %files -n libfdisk From 3e609994974fb1e87c8c5617fd5d2ed69c8f1c33 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Wed, 12 Feb 2025 12:13:29 +0100 Subject: [PATCH 22/57] remove useradd (replaced by sysusers config) --- util-linux.spec | 7 ------- 1 file changed, 7 deletions(-) diff --git a/util-linux.spec b/util-linux.spec index b09fbd5..1b968ec 100644 --- a/util-linux.spec +++ b/util-linux.spec @@ -477,13 +477,6 @@ mv -v %{buildroot}/usr/sbin/* %{buildroot}/usr/bin/ %systemd_postun_with_restart fstrim.timer %systemd_postun fstrim.service -%pre -n uuidd -getent group uuidd >/dev/null || groupadd -r uuidd -getent passwd uuidd >/dev/null || \ -useradd -r -g uuidd -d /var/lib/libuuid -s /sbin/nologin \ - -c "UUID generator helper daemon" uuidd -exit 0 - # Please, keep uuidd running after installation! Note that systemd_post is # "systemctl preset" and it enable/disable service only. %post -n uuidd From cd951d5e56b2bbb23183c0c8a5338580fb43343c Mon Sep 17 00:00:00 2001 From: Dusty Mabe Date: Wed, 19 Feb 2025 14:50:05 -0500 Subject: [PATCH 23/57] backport blkid: allow up to 64k erofs block sizes This is a backport of [1], which should help us use EROFS in live media on ppc64le [2]. [1] https://github.com/karelzak/util-linux/commit/ff0ac0f27dc3de7d250b2a69f6452bfeec104f8c [2] https://github.com/coreos/fedora-coreos-tracker/issues/1877 --- ...id-allow-up-to-64k-erofs-block-sizes.patch | 33 +++++++++++++++++++ util-linux.spec | 3 ++ 2 files changed, 36 insertions(+) create mode 100644 0001-blkid-allow-up-to-64k-erofs-block-sizes.patch 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/util-linux.spec b/util-linux.spec index 1b968ec..f5198a1 100644 --- a/util-linux.spec +++ b/util-linux.spec @@ -111,6 +111,9 @@ 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 From e873a14a1d864adc9912834adb50e2237ea8c0b0 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Mon, 12 May 2025 14:16:44 +0200 Subject: [PATCH 24/57] 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 25/57] 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 26/57] 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 27/57] 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 28/57] 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 29/57] 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 30/57] 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 31/57] 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 32/57] 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 33/57] 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 34/57] 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 35/57] 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 36/57] 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 37/57] 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 38/57] 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 39/57] 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 40/57] 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 41/57] 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 42/57] 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 43/57] 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 44/57] add completition bits blkpr lsfd --- util-linux.spec | 3 +++ 1 file changed, 3 insertions(+) diff --git a/util-linux.spec b/util-linux.spec index 0426af4..fad72a3 100644 --- a/util-linux.spec +++ b/util-linux.spec @@ -719,7 +719,9 @@ fi %{_sbindir}/zramctl %{compldir}/addpart +%{compldir}/bits %{compldir}/blkdiscard +%{compldir}/blkpr %{compldir}/blkzone %{compldir}/cal %{compldir}/chcpu @@ -758,6 +760,7 @@ fi %{compldir}/lsblk %{compldir}/lscpu %{compldir}/lsclocks +%{compldir}/lsfd %{compldir}/lsipc %{compldir}/lsirq %{compldir}/lslocks From 06dbf9bb28d4f669f1aace6aa46607fbe9396284 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Mon, 12 Jan 2026 11:55:59 +0100 Subject: [PATCH 45/57] 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 46/57] 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 47/57] 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 48/57] Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild From da7125e4bb4140112a50af0a7ff4b03d3b3d1d1b Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Thu, 2 Apr 2026 14:26:48 +0200 Subject: [PATCH 49/57] 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 50/57] 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 51/57] 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 52/57] 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 53/57] 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 54/57] 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 55/57] 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 56/57] 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 57/57] Rebuilt for Python 3.15.0b4 ABI change