From d0173c9548857f855d95ba4bb5b068841f356049 Mon Sep 17 00:00:00 2001 From: Florence Blanc-Renaud Date: Fri, 14 Sep 2018 18:08:26 +0200 Subject: [PATCH] authselect: harden uninstallation of ipa client When ipa client is uninstalled, the content of sysrestore.state is read to restore the previous authselect profile and features. The code should properly handle the case where sysrestore.state contains the header for the authselect section, but the key=value for profile and features are missing. Fixes https://pagure.io/freeipa/issue/7657 Reviewed-By: Rob Crittenden --- ipaplatform/redhat/authconfig.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ipaplatform/redhat/authconfig.py b/ipaplatform/redhat/authconfig.py index ba85537dc..ab3775e9e 100644 --- a/ipaplatform/redhat/authconfig.py +++ b/ipaplatform/redhat/authconfig.py @@ -162,8 +162,10 @@ class RedHatAuthSelect(RedHatAuthToolBase): profile = 'sssd' features = '' else: - profile = statestore.restore_state('authselect', 'profile') - features = statestore.restore_state('authselect', 'features_list') + profile = \ + statestore.restore_state('authselect', 'profile') or 'sssd' + features = \ + statestore.restore_state('authselect', 'features_list') or '' statestore.delete_state('authselect', 'mkhomedir') cmd = [paths.AUTHSELECT, "select", profile, features, "--force"]