clear sssd cache when uninstalling client

The SSSD cache is not cleared when uninstalling an IPA client. For tidiness we should wipe the cache. This can be done with sssctl.
Note that this tool is in sssd-tools which is not currently a dependency.

Resolves: https://pagure.io/freeipa/issue/7376
Reviewed-By: Christian Heimes <cheimes@redhat.com>
This commit is contained in:
amitkuma authored and Christian Heimes committed 2018-03-26 15:16:54 +02:00
1 parent 1fe795b75b
commit ccec8c6c41
3 files changed
+10 -1

No files matched your search

+1
View File
@@ -149,6 +149,7 @@ BuildRequires: nss-devel
BuildRequires: openssl-devel
BuildRequires: libini_config-devel
BuildRequires: cyrus-sasl-devel
BuildRequires: sssd-tools
%if ! %{ONLY_CLIENT}
# 1.3.3.9: DS_Sleep (https://fedorahosted.org/389/ticket/48005)
BuildRequires: 389-ds-base-devel >= 1.3.3.9
+8
View File
@@ -3140,6 +3140,14 @@ def uninstall(options):
remove_file(paths.SSSD_MC_GROUP)
remove_file(paths.SSSD_MC_PASSWD)
try:
run([paths.SSSCTL, "cache-remove", "-o", "--stop", "--start"])
except Exception:
logger.info(
"An error occurred while removing SSSD's cache."
"Please remove the cache manually by executing "
"sssctl cache-remove -o.")
if ipa_domain:
sssd_domain_ldb = "cache_" + ipa_domain + ".ldb"
sssd_ldb_file = os.path.join(paths.SSSD_DB, sssd_domain_ldb)
+1 -1
View File
@@ -378,6 +378,6 @@ class BasePathNamespace(object):
KEYCTL = '/usr/bin/keyctl'
GETENT = '/usr/bin/getent'
SSHD = '/usr/sbin/sshd'
SSSCTL = '/usr/sbin/sssctl'
paths = BasePathNamespace()