Do not remove mdns from nsswitch.conf during upgrade

%post needs to be moved to %posttrans in order to fix the issue
since %postun is run from the old buggy package.
epel8
Pavel Březina 5 years ago
parent a1d226a68d
commit 3cdb8fface

@ -1,6 +1,6 @@
Name: nss-mdns
Version: 0.14.1
Release: 6%{?dist}
Release: 7%{?dist}
Summary: glibc plugin for .local name resolution
License: LGPLv2+
@ -40,6 +40,7 @@ rm -rf $RPM_BUILD_ROOT
%post
%{?ldconfig}
%posttrans
function mod_nss() {
if [ -f "$1" ] ; then
# sed-fu to add mdns4_minimal to the hosts line of /etc/nsswitch.conf
@ -73,15 +74,17 @@ function mod_nss() {
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"
if [ "$1" -eq 0 ] ; then
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
fi
%ldconfig_postun
@ -94,6 +97,9 @@ fi
%changelog
* Tue Mar 17 2020 Pavel Březina <pbrezina@redhat.com> - 0.14.1-7
- Do not remove mdns from nsswitch.conf during upgrade
* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.14.1-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild

Loading…
Cancel
Save