From 919eb5ad8b38cf694fb7d8b55e9d3243ed041a31 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pavel=20B=C5=99ezina?= Date: Tue, 16 Nov 2021 12:36:08 +0100 Subject: [PATCH] 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 --- nss-mdns.spec | 50 ++++++-------------------------------------------- 1 file changed, 6 insertions(+), 44 deletions(-) diff --git a/nss-mdns.spec b/nss-mdns.spec index f4d1aee..ea08145 100644 --- a/nss-mdns.spec +++ b/nss-mdns.spec @@ -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 - /\/ 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 - 0.15.1-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild