]> git.sur5r.net Git - openldap/commitdiff
Don't access entry after commit; it may be gone if the cache is full
authorHoward Chu <hyc@openldap.org>
Sat, 30 Oct 2004 23:48:26 +0000 (23:48 +0000)
committerHoward Chu <hyc@openldap.org>
Sat, 30 Oct 2004 23:48:26 +0000 (23:48 +0000)
servers/slapd/back-bdb/delete.c
servers/slapd/back-bdb/modify.c
servers/slapd/back-bdb/modrdn.c

index 1547239337100d13b356e2e60a2206c2ba4f0df3..33924d40706abb80d92e4e66c88cd7fed1e33cc1 100644 (file)
@@ -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;
index a81facfb75dfa2d726afe31dd8ba20018e3db438..fe613d1dbd2d65925af7ab5dfe9c4044df675a14 100644 (file)
@@ -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;
index d234353ae341366291fe95faf08b88a241b70391..014ad8a9b75c4b869db68d641560c8388c60816f 100644 (file)
@@ -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;