Properly work with or without authselect (BZ #1577243)

epel8
Adam Goode 5 years ago
parent 923eb4834c
commit ae88993589

@ -1,13 +1,13 @@
Name: nss-mdns
Version: 0.14.1
Release: 4%{?dist}
Release: 5%{?dist}
Summary: glibc plugin for .local name resolution
License: LGPLv2+
URL: https://github.com/lathiat/nss-mdns
Source0: https://github.com/lathiat/nss-mdns/releases/download/v%{version}/nss-mdns-%{version}.tar.gz
BuildRequires: gcc
BuildRequires: gcc
BuildRequires: pkgconfig(check)
Requires: avahi
@ -41,7 +41,7 @@ rm -rf $RPM_BUILD_ROOT
%{?ldconfig}
function mod_nss() {
if [ -f "$1" ] ; then
if [ -f "$1" ] ; then
# sed-fu to add mdns4_minimal to the hosts line of /etc/nsswitch.conf
sed -i.bak '
/^hosts:/ !b
@ -52,9 +52,9 @@ function mod_nss() {
}
FILE="$(readlink /etc/nsswitch.conf || echo /etc/nsswitch.conf)"
if [ "$FILE" = "/etc/authselect/nsswitch.conf" ] && authselect check &>/dev/null; then
if [ "$FILE" = "/etc/authselect/nsswitch.conf" ] && authselect check &>/dev/null; then
mod_nss "/etc/authselect/user-nsswitch.conf"
authselect apply-changes &> /dev/null || :
authselect apply-changes &> /dev/null || :
else
mod_nss "$FILE"
# also apply the same changes to user-nsswitch.conf to affect
@ -64,7 +64,7 @@ fi
%preun
function mod_nss() {
if [ -f "$1" ] ; then
if [ -f "$1" ] ; then
# sed-fu to remove mdns4_minimal from the hosts line of /etc/nsswitch.conf
sed -i.bak '
/^hosts:/ !b
@ -74,9 +74,9 @@ function mod_nss() {
}
FILE="$(readlink /etc/nsswitch.conf || echo /etc/nsswitch.conf)"
if [ "$FILE" = "/etc/authselect/nsswitch.conf" ] && authselect check &>/dev/null; then
if [ "$FILE" = "/etc/authselect/nsswitch.conf" ] && authselect check &>/dev/null; then
mod_nss "/etc/authselect/user-nsswitch.conf"
authselect apply-changes &> /dev/null || :
authselect apply-changes &> /dev/null || :
else
mod_nss "$FILE"
# also apply the same changes to user-nsswitch.conf to affect
@ -94,6 +94,9 @@ fi
%changelog
* Sun Jan 19 2020 Adam Goode <adam@spicenitz.org> - 0.14.1-5
- Properly work with or without authselect (BZ #1577243)
* Thu Jul 25 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.14.1-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild

Loading…
Cancel
Save