From ae889935893c0db1dfa4d9dca9cb6f39d0a1873a Mon Sep 17 00:00:00 2001 From: Adam Goode Date: Sun, 19 Jan 2020 13:38:55 -0500 Subject: [PATCH] Properly work with or without authselect (BZ #1577243) --- nss-mdns.spec | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/nss-mdns.spec b/nss-mdns.spec index 1c4cf60..aff70ea 100644 --- a/nss-mdns.spec +++ b/nss-mdns.spec @@ -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 - 0.14.1-5 +- Properly work with or without authselect (BZ #1577243) + * Thu Jul 25 2019 Fedora Release Engineering - 0.14.1-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild