Revert "spec: remove nsswitch.conf scriptlet"

This reverts commit 2afe364ac4.

Unfortunately the build failed on dependencies:
DEBUG util.py:444:  Error:
DEBUG util.py:444:   Problem: package authselect-libs-1.3.0-1.fc36.x86_64 conflicts with glibc < 2.34.9000-27 provided by glibc-2.34.9000-26.fc36.x86_64
DEBUG util.py:444:    - package util-linux-2.37.2-1.fc36.x86_64 requires /etc/pam.d/system-auth, but none of the providers can be installed
DEBUG util.py:444:    - package gawk-5.1.1-1.fc36.x86_64 requires libm.so.6()(64bit), but none of the providers can be installed
DEBUG util.py:444:    - package gawk-5.1.1-1.fc36.x86_64 requires libm.so.6(GLIBC_2.2.5)(64bit), but none of the providers can be installed
DEBUG util.py:444:    - package gawk-5.1.1-1.fc36.x86_64 requires libm.so.6(GLIBC_2.29)(64bit), but none of the providers can be installed
DEBUG util.py:444:    - package gawk-5.1.1-1.fc36.x86_64 requires rtld(GNU_HASH), but none of the providers can be installed
DEBUG util.py:444:    - package gawk-5.1.1-1.fc36.x86_64 requires libc.so.6(GLIBC_2.34)(64bit), but none of the providers can be installed
DEBUG util.py:444:    - conflicting requests

I need to build the package again in rawhide, so this needs to be reverted
for now.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2021-12-09 18:48:08 +01:00
parent 2afe364ac4
commit 1634b1b16a

View File

@ -783,6 +783,39 @@ systemctl --no-reload preset systemd-oomd.service &>/dev/null || :
%post libs
%{?ldconfig}
function mod_nss() {
if [ -f "$1" ] ; then
# Add nss-systemd to passwd and group
grep -E -q '^(passwd|group):.* systemd' "$1" ||
sed -i.bak -r -e '
s/^(passwd|group):(.*)/\1:\2 systemd/
' "$1" &>/dev/null || :
# Add nss-resolve to hosts
if grep -E -q '^hosts:.* resolve' "$1"; then
sed -i.bak -r -e '
s/^(hosts):(.*) files( .*) myhostname dns/\1:\2 files myhostname\3 dns/
' "$1" &>/dev/null || :
else
sed -i.bak -r -e '
s/^(hosts):(.*) files( mdns4_minimal .NOTFOUND=return.)? dns myhostname/\1:\2 files myhostname\3 resolve [!UNAVAIL=return] dns/
' "$1" &>/dev/null || :
fi
fi
}
FILE="$(readlink /etc/nsswitch.conf || echo /etc/nsswitch.conf)"
if [ "$FILE" = "/etc/authselect/nsswitch.conf" ] && authselect check &>/dev/null; then
mod_nss "/etc/authselect/user-nsswitch.conf"
authselect apply-changes &> /dev/null || :
else
mod_nss "$FILE"
# also apply the same changes to user-nsswitch.conf to affect
# possible future authselect configuration
mod_nss "/etc/authselect/user-nsswitch.conf"
fi
# check if nobody or nfsnobody is defined
export SYSTEMD_NSS_BYPASS_SYNTHETIC=1
if getent passwd nfsnobody &>/dev/null; then
@ -975,9 +1008,6 @@ fi
%files standalone-sysusers -f .file-list-standalone-sysusers
%changelog
* Thu Dec 9 2021 Pavel Březina <pbrezina@redhat.com> - 250~rc1-2
- Remove nsswitch.conf scriptlets (#2023743)
* Thu Dec 9 2021 Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> - 250~rc1-1
- Version 250-rc1,
see https://raw.githubusercontent.com/systemd/systemd/v250-rc1/NEWS for