Re: [Freeipa-devel] [PATCH] 0148: ipa-sam: when deleting subtree, deal with possible LDAP errors

2014-04-08 Thread Sumit Bose
On Tue, Mar 11, 2014 at 03:39:57PM +0100, Petr Spacek wrote:
> On 11.3.2014 15:32, Alexander Bokovoy wrote:
> >after discussing with Petr Spacek, following patch fixes ticket 4224.
> 
> Code seems okay but I didn't do functional test.

To just close this tread the changes form this patch are already
applied by 'ipa-sam: cache gid to sid and uid to sid requests in idmap
cache'

master: d6a7923f71eb69bac53d6ff904086a9abd103dbc
ipa-3-3: 13cd4faf551d7781d27c36bef0e7cbf515e072d2

bye,
Sumit
> 
> -- 
> Petr^2 Spacek
> 
> ___
> Freeipa-devel mailing list
> Freeipa-devel@redhat.com
> https://www.redhat.com/mailman/listinfo/freeipa-devel

___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel


Re: [Freeipa-devel] [PATCH] 0148: ipa-sam: when deleting subtree, deal with possible LDAP errors

2014-03-11 Thread Petr Spacek

On 11.3.2014 15:32, Alexander Bokovoy wrote:

after discussing with Petr Spacek, following patch fixes ticket 4224.


Code seems okay but I didn't do functional test.

--
Petr^2 Spacek

___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel


[Freeipa-devel] [PATCH] 0148: ipa-sam: when deleting subtree, deal with possible LDAP errors

2014-03-11 Thread Alexander Bokovoy

Hi,

after discussing with Petr Spacek, following patch fixes ticket 4224.

--
/ Alexander Bokovoy
>From 83803494757e078c3a2850ddbb5eb886fd067dd1 Mon Sep 17 00:00:00 2001
From: Alexander Bokovoy 
Date: Tue, 11 Mar 2014 16:28:12 +0200
Subject: [PATCH 3/3] ipa-sam: when deleting subtree make sure to deal with
 LDAP failures

https://fedorahosted.org/freeipa/ticket/4224
---
 daemons/ipa-sam/ipa_sam.c | 13 +++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/daemons/ipa-sam/ipa_sam.c b/daemons/ipa-sam/ipa_sam.c
index 1ca504d..7a8eeb4 100644
--- a/daemons/ipa-sam/ipa_sam.c
+++ b/daemons/ipa-sam/ipa_sam.c
@@ -2456,10 +2456,16 @@ static int delete_subtree(struct ldapsam_privates 
*ldap_state, char* dn)
rc = smbldap_search(ldap_state->smbldap_state, dn, scope, filter, NULL, 
0, &result);
TALLOC_FREE(filter);
 
-   if (result != NULL) {
-   smbldap_talloc_autofree_ldapmsg(dn, result);
+   if (rc != LDAP_SUCCESS) {
+   return rc;
}
 
+   if (result == NULL) {
+   return LDAP_NO_MEMORY;
+   }
+
+   smbldap_talloc_autofree_ldapmsg(dn, result);
+
for (entry = ldap_first_entry(state, result);
 entry != NULL;
 entry = ldap_next_entry(state, entry)) {
@@ -2467,6 +2473,9 @@ static int delete_subtree(struct ldapsam_privates 
*ldap_state, char* dn)
/* remove child entries */
if ((entry_dn != NULL) && (strcmp(entry_dn, dn) != 0)) {
rc = smbldap_delete(ldap_state->smbldap_state, 
entry_dn);
+   if (rc != LDAP_SUCCESS) {
+   return rc;
+   }
}
}
rc = smbldap_delete(ldap_state->smbldap_state, dn);
-- 
1.8.3.1

___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel