ldap/servers/slapd/back-ldbm/id2entry.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
New commits:
commit c26ba79b19bb580a6fb8bf8d6d096bf888d197d6
Author: Noriko Hosoi <nhosoi(a)redhat.com>
Date: Mon Feb 22 12:00:10 2010 -0800
567370 - dncache: assertion failure in id2entry_delete
https://bugzilla.redhat.com/show_bug.cgi?id=567370
Descriptino: When deleting an entry, if the dn is in the dn cache,
it should be removed. The original code was trying to remove it
regardless of the existence in the dn cache. Fixed it so that
only when the dn is in the cache, it's removed.
diff --git a/ldap/servers/slapd/back-ldbm/id2entry.c
b/ldap/servers/slapd/back-ldbm/id2entry.c
index 05a0181..21f21fc 100644
--- a/ldap/servers/slapd/back-ldbm/id2entry.c
+++ b/ldap/servers/slapd/back-ldbm/id2entry.c
@@ -190,10 +190,14 @@ id2entry_delete( backend *be, struct backentry *e, back_txn *txn )
if (entryrdn_get_switch())
{
ldbm_instance *inst = (ldbm_instance *)be->be_instance_info;
- Slapi_DN *sdn = slapi_sdn_dup(slapi_entry_get_sdn_const(e->ep_entry));
- struct backdn *bdn = backdn_init(sdn, e->ep_id, 1);
- CACHE_REMOVE(&inst->inst_dncache, bdn);
- CACHE_RETURN(&inst->inst_dncache, &bdn);
+ struct backdn *bdn = dncache_find_id(&inst->inst_dncache, e->ep_id);
+ if (bdn) {
+ slapi_log_error(SLAPI_LOG_CACHE, ID2ENTRY,
+ "dncache_find_id returned: %s\n",
+ slapi_sdn_get_dn(bdn->dn_sdn));
+ CACHE_REMOVE(&inst->inst_dncache, bdn);
+ CACHE_RETURN(&inst->inst_dncache, &bdn);
+ }
}
rc = db->del( db,db_txn,&key,0 );