@ -1,6 +1,6 @@
Name: nss-mdns
Version: 0.15.1
Release: 2 %{?dist}
Release: 3 %{?dist}
Summary: glibc plugin for .local name resolution
License: LGPLv2+
@ -42,51 +42,10 @@ rm -rf $RPM_BUILD_ROOT
%{?ldconfig}
%posttrans
function mod_nss() {
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
authselect enable-feature with-mdns4 &> /dev/null || :
%preun
function mod_nss() {
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
authselect disable-feature with-mdns4 &> /dev/null || :
%ldconfig_postun
@ -98,6 +57,9 @@ fi
%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
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild