On 30/06/15 16:10, Martin Basti wrote:
On 30/06/15 15:18, Martin Basti wrote:
On 30/06/15 14:47, Simo Sorce wrote:
On Tue, 2015-06-30 at 13:19 +0200, Tomas Babej wrote:
On 06/30/2015 01:08 PM, Martin Basti wrote:
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.

Pushed to ipa-4-1: 222427cb37a037f24ca76a9bcf614a2711a2ba96

This patch break ipa-client-install --uninstall when the first part of
sssd uninstall fails, and exception is thrown and we 'pass', but then
domain is not set and we use it.

Please revert or fix it.

Simo.

I will fix it.

Fix attached.



+ rebased patch for ipa-4-1 attached



--
Martin Basti

From c0f6c237ecd1834c90895ead16d8eb8737499df5 Mon Sep 17 00:00:00 2001
From: Martin Basti <mba...@redhat.com>
Date: Tue, 30 Jun 2015 15:55:40 +0200
Subject: [PATCH] FIX: Clear SSSD caches when uninstalling the client

https://fedorahosted.org/freeipa/ticket/5049
---
 ipa-client/ipa-install/ipa-client-install | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/ipa-client/ipa-install/ipa-client-install b/ipa-client/ipa-install/ipa-client-install
index 9d6640a99cdb9a5371e402cd44333fdd8f9e2363..e0de79402f31562384f723a018a4f205916a024f 100755
--- a/ipa-client/ipa-install/ipa-client-install
+++ b/ipa-client/ipa-install/ipa-client-install
@@ -481,6 +481,7 @@ def uninstall(options, env):
     statestore._load()
 
     hostname = None
+    ipa_domain = None
     was_sssd_configured = False
     try:
         sssdconfig = SSSDConfig.SSSDConfig()
@@ -505,6 +506,10 @@ def uninstall(options, env):
                     hostname = domain.get_option('ipa_hostname')
                 except SSSDConfig.NoOptionError:
                     continue
+                try:
+                    ipa_domain = domain.get_option('ipa_domain')
+                except SSSDConfig.NoOptionError:
+                    pass
     except Exception, e:
         # We were unable to read existing SSSD config. This might mean few things:
         # - sssd wasn't installed
@@ -634,14 +639,14 @@ def uninstall(options, env):
     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)
+    if 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)
+        sssd_domain_ccache = "ccache_" + ipa_domain.upper()
+        sssd_ccache_file = os.path.join(paths.SSSD_DB, sssd_domain_ccache)
+        remove_file(sssd_ccache_file)
 
     # Next if-elif-elif construction deals with sssd.conf file.
     # Old pre-IPA domains are preserved due merging the old sssd.conf
-- 
2.4.3

From f4eee8b9e91772b04a169abf34bf1542ecbbe23e Mon Sep 17 00:00:00 2001
From: Martin Basti <mba...@redhat.com>
Date: Tue, 30 Jun 2015 15:55:40 +0200
Subject: [PATCH] FIX: Clear SSSD caches when uninstalling the client

https://fedorahosted.org/freeipa/ticket/5049
---
 ipa-client/ipa-install/ipa-client-install | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/ipa-client/ipa-install/ipa-client-install b/ipa-client/ipa-install/ipa-client-install
index 8bc3fbe9aa0f8f24e3ddf9818f4047d2d803c991..a1564583ca2d461413da7ea5929b91851cd3f3e1 100755
--- a/ipa-client/ipa-install/ipa-client-install
+++ b/ipa-client/ipa-install/ipa-client-install
@@ -479,6 +479,7 @@ def uninstall(options, env):
     statestore._load()
 
     hostname = None
+    ipa_domain = None
     was_sssd_configured = False
     try:
         sssdconfig = SSSDConfig.SSSDConfig()
@@ -503,6 +504,10 @@ def uninstall(options, env):
                     hostname = domain.get_option('ipa_hostname')
                 except SSSDConfig.NoOptionError:
                     continue
+                try:
+                    ipa_domain = domain.get_option('ipa_domain')
+                except SSSDConfig.NoOptionError:
+                    pass
     except Exception, e:
         # We were unable to read existing SSSD config. This might mean few things:
         # - sssd wasn't installed
@@ -632,14 +637,14 @@ def uninstall(options, env):
     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)
+    if 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)
+        sssd_domain_ccache = "ccache_" + ipa_domain.upper()
+        sssd_ccache_file = os.path.join(paths.SSSD_DB, sssd_domain_ccache)
+        remove_file(sssd_ccache_file)
 
     # Next if-elif-elif construction deals with sssd.conf file.
     # Old pre-IPA domains are preserved due merging the old sssd.conf
-- 
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