From 73f049c75f0b1ed269cb8ebcb5c2158d2bc8b614 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois=20Cami?= Date: Thu, 29 Aug 2019 14:24:40 +0200 Subject: [PATCH] authconfig.py: restore user-nsswitch.conf at uninstall time MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Calling authselect at uninstall time before restoring user-nsswitch.conf would result in a sudoers entry in nsswitch.conf which is not activated in the default sssd authselect profile. Make sure user-nsswitch.conf is restored before calling authselect. Fixes: https://pagure.io/freeipa/issue/8054 Signed-off-by: François Cami Reviewed-By: Thomas Woerner --- ipaplatform/redhat/authconfig.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ipaplatform/redhat/authconfig.py b/ipaplatform/redhat/authconfig.py index 9d98b5b64..758376f2b 100644 --- a/ipaplatform/redhat/authconfig.py +++ b/ipaplatform/redhat/authconfig.py @@ -167,6 +167,10 @@ class RedHatAuthSelect(RedHatAuthToolBase): 'authselect', 'features_list' ) statestore.delete_state('authselect', 'mkhomedir') + # https://pagure.io/freeipa/issue/8054 + if fstore.has_file(paths.NSSWITCH_CONF): + logger.info("Restoring user-nsswitch.conf") + fstore.restore_file(paths.NSSWITCH_CONF) # only non-empty features, https://pagure.io/freeipa/issue/7776 if features_state is not None: features = [