From: Howard Chu Date: Sat, 30 Oct 2004 23:48:26 +0000 (+0000) Subject: Don't access entry after commit; it may be gone if the cache is full X-Git-Tag: OPENLDAP_REL_ENG_2_3_0ALPHA~382 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=501f749c05cf37d0d84b15d0f5f3a892eb61ad40;p=openldap Don't access entry after commit; it may be gone if the cache is full --- diff --git a/servers/slapd/back-bdb/delete.c b/servers/slapd/back-bdb/delete.c index 1547239337..33924d4070 100644 --- a/servers/slapd/back-bdb/delete.c +++ b/servers/slapd/back-bdb/delete.c @@ -36,6 +36,7 @@ bdb_delete( Operation *op, SlapReply *rs ) AttributeDescription *entry = slap_schema.si_ad_entry; DB_TXN *ltid = NULL, *lt2; struct bdb_op_info opinfo; + ID eid; u_int32_t locker = 0; DB_LOCK lock, plock; @@ -458,6 +459,8 @@ retry: /* transaction retry */ goto return_results; } + eid = e->e_id; + #if 0 /* Do we want to reclaim deleted IDs? */ ldap_pvt_thread_mutex_lock( &bdb->bi_lastid_mutex ); if ( e->e_id == bdb->bi_lastid ) { @@ -545,7 +548,7 @@ retry: /* transaction retry */ Debug( LDAP_DEBUG_TRACE, "bdb_delete: deleted%s id=%08lx dn=\"%s\"\n", op->o_noop ? " (no-op)" : "", - e->e_id, e->e_dn ); + eid, op->o_req_dn.bv_val ); rs->sr_err = LDAP_SUCCESS; rs->sr_text = NULL; if( num_ctrls ) rs->sr_ctrls = ctrls; diff --git a/servers/slapd/back-bdb/modify.c b/servers/slapd/back-bdb/modify.c index a81facfb75..fe613d1dbd 100644 --- a/servers/slapd/back-bdb/modify.c +++ b/servers/slapd/back-bdb/modify.c @@ -626,7 +626,7 @@ retry: /* transaction retry */ Debug( LDAP_DEBUG_TRACE, "bdb_modify: updated%s id=%08lx dn=\"%s\"\n", op->o_noop ? " (no-op)" : "", - e->e_id, e->e_dn ); + dummy.e_id, op->o_req_dn.bv_val ); rs->sr_err = LDAP_SUCCESS; rs->sr_text = NULL; diff --git a/servers/slapd/back-bdb/modrdn.c b/servers/slapd/back-bdb/modrdn.c index d234353ae3..014ad8a9b7 100644 --- a/servers/slapd/back-bdb/modrdn.c +++ b/servers/slapd/back-bdb/modrdn.c @@ -866,7 +866,7 @@ retry: /* transaction retry */ op->o_private = NULL; if( rs->sr_err != LDAP_SUCCESS ) { - Debug( LDAP_DEBUG_TRACE, "bdb_add: %s : %s (%d)\n", + Debug( LDAP_DEBUG_TRACE, "bdb_modrdn: %s : %s (%d)\n", rs->sr_text, db_strerror(rs->sr_err), rs->sr_err ); rs->sr_err = LDAP_OTHER; @@ -876,7 +876,7 @@ retry: /* transaction retry */ Debug(LDAP_DEBUG_TRACE, "bdb_modrdn: rdn modified%s id=%08lx dn=\"%s\"\n", op->o_noop ? " (no-op)" : "", - e->e_id, e->e_dn ); + dummy.e_id, op->o_req_dn.bv_val ); rs->sr_text = NULL; if( num_ctrls ) rs->sr_ctrls = ctrls;