From 8d040d66965d7de2ff878bf6efa21a8b93b358c3 Mon Sep 17 00:00:00 2001 From: Joseph Marrero Corchado Date: Mon, 16 Feb 2026 17:34:13 -0500 Subject: [PATCH] Add RPM macros to configure %%_passwd_path and %%_group_path Resolves: #RHEL-140819 --- macros.altfiles | 12 ++++++++++++ nss-altfiles.spec | 13 +++++++++++-- 2 files changed, 23 insertions(+), 2 deletions(-) create mode 100644 macros.altfiles diff --git a/macros.altfiles b/macros.altfiles new file mode 100644 index 0000000..e781626 --- /dev/null +++ b/macros.altfiles @@ -0,0 +1,12 @@ +# Configure RPM to find users/groups in nss-altfiles locations. +# +# Since RPM no longer uses NSS for user/group lookups (to avoid issues +# with chroot installations), we need to explicitly tell RPM where to +# find the passwd and group files used by nss-altfiles. +# +# See: https://github.com/rpm-software-management/rpm/pull/3672 +# See: https://issues.redhat.com/browse/RHEL-78693 +# See: https://issues.redhat.com/browse/RHEL-140819 + +%_passwd_path /usr/lib/passwd:/etc/passwd +%_group_path /usr/lib/group:/etc/group diff --git a/nss-altfiles.spec b/nss-altfiles.spec index e18297f..820e0a1 100644 --- a/nss-altfiles.spec +++ b/nss-altfiles.spec @@ -1,8 +1,9 @@ Summary: NSS module to look up from files in /usr/lib as well Name: nss-altfiles Version: 2.23.0 -Release: 5%{?dist} +Release: 6%{?dist} Source0: https://github.com/flatcar/nss-altfiles/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz +Source1: macros.altfiles Patch1: 0001-build-sys-Inherit-LDFLAGS.patch # From https://github.com/flatcar/nss-altfiles/commit/de2b32289bf701ce3c8167a1b58436866922085e Patch2: 0003-deprecate-RES_USE_INET6.patch @@ -26,15 +27,23 @@ in %{prefix}/lib/passwd, and from respective files for all other NSS maps. make %{?_smp_mflags} %install -make install DESTDIR=$RPM_BUILD_ROOT +%make_install +mkdir -p %{buildroot}%{_rpmmacrodir} +install -p -m 644 %{SOURCE1} %{buildroot}%{_rpmmacrodir}/macros.altfiles %files %doc README.md %{_libdir}/*.so.* +%{_rpmmacrodir}/macros.altfiles %ldconfig_scriptlets %changelog +* Mon Feb 16 2026 Joseph Marrero - 2.23.0-6 +- Add RPM macros to configure %%_passwd_path and %%_group_path +- Fixes user/group lookup for packages with non-root file ownership +- See: https://github.com/rpm-software-management/rpm/pull/3672 + * Tue Oct 29 2024 Troy Dawson - 2.23.0-5 - Bump release for October 2024 mass rebuild: Resolves: RHEL-64018