spec: remove nsswitch.conf scriptlet

Related to: https://fedoraproject.org/wiki/Changes/Make_Authselect_Mandatory

mdns is now supported in authselect. Users are now expected to use authselect
to configure the system and packages should no longer support non-authselect
configurations.

Resolves: rhbz#2023745
epel9
Pavel Březina 3 years ago
parent 66e3ffe086
commit 919eb5ad8b

@ -1,6 +1,6 @@
Name: nss-mdns Name: nss-mdns
Version: 0.15.1 Version: 0.15.1
Release: 2%{?dist} Release: 3%{?dist}
Summary: glibc plugin for .local name resolution Summary: glibc plugin for .local name resolution
License: LGPLv2+ License: LGPLv2+
@ -42,51 +42,10 @@ rm -rf $RPM_BUILD_ROOT
%{?ldconfig} %{?ldconfig}
%posttrans %posttrans
function mod_nss() { authselect enable-feature with-mdns4 &> /dev/null || :
if [ -f "$1" ] ; then
# sed-fu to add mdns4_minimal to the hosts line of /etc/nsswitch.conf
sed -i.bak '
/^hosts:/ !b
/\<mdns\(4\|6\)\?\(_minimal\)\?\>/ b
s/\<\(files\( myhostname\)\?[[:blank:]]\+\)/\1mdns4_minimal [NOTFOUND=return] /g
' "$1"
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
%preun %preun
function mod_nss() { authselect disable-feature with-mdns4 &> /dev/null || :
if [ -f "$1" ] ; then
# sed-fu to remove mdns4_minimal from the hosts line of /etc/nsswitch.conf
sed -i.bak '
/^hosts:/ !b
s/[[:blank:]]\+mdns\(4\|6\)\?\(_minimal\( \[NOTFOUND=return\]\)\?\)\?//g
' "$1"
fi
}
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 %ldconfig_postun
@ -98,6 +57,9 @@ fi
%changelog %changelog
* Tue Nov 16 2021 Pavel Březina - 0.15.1-3
- Rely only on authselect for nsswitch.conf changes (#2023745)
* Thu Jul 22 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.15.1-2 * Thu Jul 22 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.15.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild

Loading…
Cancel
Save