Add RPM macros to configure %%_passwd_path and %%_group_path

Resolves: #RHEL-140819
This commit is contained in:
Joseph Marrero Corchado 2026-02-16 17:34:13 -05:00
parent ee9efceb6f
commit 8d040d6696
2 changed files with 23 additions and 2 deletions

12
macros.altfiles Normal file
View File

@ -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

View File

@ -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 <jmarrero@redhat.com> - 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 <tdawson@redhat.com> - 2.23.0-5
- Bump release for October 2024 mass rebuild:
Resolves: RHEL-64018