On 30/06/15 13:00, Tomas Babej wrote:

On 06/29/2015 03:50 PM, Martin Basti wrote:
On 29/06/15 13:46, Jakub Hrozek wrote:
On Fri, Jun 05, 2015 at 11:31:54AM -0600, Gabe Alford wrote:
Thanks. Updated patch attached.

On Fri, Jun 5, 2015 at 9:53 AM, Jakub Hrozek <jhro...@redhat.com> wrote:

On Fri, Jun 05, 2015 at 09:46:05AM -0600, Gabe Alford wrote:
How should ​
https://www.redhat.com/archives/freeipa-users/2015-June/msg00116.html
be
handled where the user cleared out the db cache?
Ah, I confused that one with another issue Jan Pazdziora had, which was
incidentally about client uninstall as well.

In that case, you can just remove the single ldb file that corresponds
to the domain that the client is leaving. Maybe it would be safer to mv
the files instead of remove them, but I guess if you run --uninstall,
you really want just to purge everything..

btw do the ipa installer tools support multiple domains at all?

--
Manage your subscription for the Freeipa-devel mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-devel
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code

  From 40f7c3780baaf0b42d10c94c8527c9359a42247f Mon Sep 17 00:00:00 2001
From: Gabe <redhatri...@gmail.com>
Date: Fri, 5 Jun 2015 11:27:46 -0600
Subject: [PATCH] Clear SSSD caches when uninstalling the client

https://fedorahosted.org/freeipa/ticket/5049
Conceptually LGTM, but I haven't tested the patch.

ACK, I did testing.

Pushed to master: 37729936dd6fe9c3396cbb8a682a4674af8b5537

For ipa-4-1 the patch requires a rebase.
Rebased patch for ipa-4-1 attached.

--
Martin Basti

From bba9b00058226b42fff1d3805138584a352be9ac Mon Sep 17 00:00:00 2001
From: Gabe <redhatri...@gmail.com>
Date: Fri, 5 Jun 2015 11:27:46 -0600
Subject: [PATCH] Clear SSSD caches when uninstalling the client

https://fedorahosted.org/freeipa/ticket/5049
---
 ipa-client/ipa-install/ipa-client-install | 13 +++++++++++++
 ipaplatform/base/paths.py                 |  1 +
 2 files changed, 14 insertions(+)

diff --git a/ipa-client/ipa-install/ipa-client-install b/ipa-client/ipa-install/ipa-client-install
index cc2650f97f3c500d15de98b7b0f928dc3f2a6b13..9d6640a99cdb9a5371e402cd44333fdd8f9e2363 100755
--- a/ipa-client/ipa-install/ipa-client-install
+++ b/ipa-client/ipa-install/ipa-client-install
@@ -630,6 +630,19 @@ def uninstall(options, env):
             "Failed to remove krb5/LDAP configuration: %s", str(e))
         return CLIENT_INSTALL_ERROR
 
+    # Clean up the SSSD cache before SSSD service is stopped or restarted
+    remove_file(paths.SSSD_MC_GROUP)
+    remove_file(paths.SSSD_MC_PASSWD)
+
+    ipa_domain = domain.get_option('ipa_domain')
+    sssd_domain_ldb = "cache_" + ipa_domain + ".ldb"
+    sssd_ldb_file = os.path.join(paths.SSSD_DB, sssd_domain_ldb)
+    remove_file(sssd_ldb_file)
+
+    sssd_domain_ccache = "ccache_" + ipa_domain.upper()
+    sssd_ccache_file = os.path.join(paths.SSSD_DB, sssd_domain_ccache)
+    remove_file(sssd_domain_ccache)
+
     # Next if-elif-elif construction deals with sssd.conf file.
     # Old pre-IPA domains are preserved due merging the old sssd.conf
     # during the installation of ipa-client but any new domains are
diff --git a/ipaplatform/base/paths.py b/ipaplatform/base/paths.py
index f4653feb900c4269419974d64169d9853abef8db..803f044e1c6e40ccd7fb8ab8a11bcf0cfb66b4c6 100644
--- a/ipaplatform/base/paths.py
+++ b/ipaplatform/base/paths.py
@@ -287,6 +287,7 @@ class BasePathNamespace(object):
     VAR_LIB_PKI_TOMCAT_DIR = "/var/lib/pki/pki-tomcat"
     CA_BACKUP_KEYS_P12 = "/var/lib/pki/pki-tomcat/alias/ca_backup_keys.p12"
     SAMBA_DIR = "/var/lib/samba/"
+    SSSD_DB = "/var/lib/sss/db"
     SSSD_MC_GROUP = "/var/lib/sss/mc/group"
     SSSD_MC_PASSWD = "/var/lib/sss/mc/passwd"
     SSSD_PUBCONF_KNOWN_HOSTS = "/var/lib/sss/pubconf/known_hosts"
-- 
2.4.3

-- 
Manage your subscription for the Freeipa-devel mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-devel
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code

Reply via email to