#endif
Debug(LDAP_DEBUG_ARGS, "==> " LDAP_XSTRING(bdb_add) ": %s\n",
- op->oq_add.rs_e->e_name.bv_val, 0, 0);
+ op->ora_e->e_name.bv_val, 0, 0);
#ifdef LDAP_X_TXN
if( op->o_txnSpec ) {
ctrls[num_ctrls] = 0;
/* check entry's schema */
- rs->sr_err = entry_schema_check( op, op->oq_add.rs_e, NULL,
+ rs->sr_err = entry_schema_check( op, op->ora_e, NULL,
get_relax(op), 1, NULL, &rs->sr_text, textbuf, textlen );
if ( rs->sr_err != LDAP_SUCCESS ) {
Debug( LDAP_DEBUG_TRACE,
goto return_results;
}
- subentry = is_entry_subentry( op->oq_add.rs_e );
+ subentry = is_entry_subentry( op->ora_e );
/* Get our reader TXN */
rs->sr_err = bdb_reader_get( op, bdb->bi_dbenv, &rtxn );
/*
* Get the parent dn and see if the corresponding entry exists.
*/
- if ( be_issuffix( op->o_bd, &op->oq_add.rs_e->e_nname ) ) {
+ if ( be_issuffix( op->o_bd, &op->ora_e->e_nname ) ) {
pdn = slap_empty_bv;
} else {
- dnParent( &op->oq_add.rs_e->e_nname, &pdn );
+ dnParent( &op->ora_e->e_nname, &pdn );
}
/* get entry or parent */
goto retry;
}
+ bdb_unlocked_cache_return_entry_r( bdb, p );
+ p = NULL;
+
Debug( LDAP_DEBUG_TRACE,
LDAP_XSTRING(bdb_add) ": no write access to parent\n",
0, 0, 0 );
if ( p != (Entry *)&slap_entry_root ) {
if ( is_entry_subentry( p ) ) {
+ bdb_unlocked_cache_return_entry_r( bdb, p );
+ p = NULL;
/* parent is a subentry, don't allow add */
Debug( LDAP_DEBUG_TRACE,
LDAP_XSTRING(bdb_add) ": parent is subentry\n",
}
if ( is_entry_alias( p ) ) {
+ bdb_unlocked_cache_return_entry_r( bdb, p );
+ p = NULL;
/* parent is an alias, don't allow add */
Debug( LDAP_DEBUG_TRACE,
LDAP_XSTRING(bdb_add) ": parent is alias\n",
}
p = NULL;
- rs->sr_err = access_allowed( op, op->oq_add.rs_e,
+ rs->sr_err = access_allowed( op, op->ora_e,
entry, NULL, ACL_WADD, NULL );
if ( ! rs->sr_err ) {
rs->sr_text = "internal error";
goto return_results;
}
- op->oq_add.rs_e->e_id = eid;
+ op->ora_e->e_id = eid;
}
/* nested transaction */
}
/* dn2id index */
- rs->sr_err = bdb_dn2id_add( op, lt2, ei, op->oq_add.rs_e );
+ rs->sr_err = bdb_dn2id_add( op, lt2, ei, op->ora_e );
if ( rs->sr_err != 0 ) {
Debug( LDAP_DEBUG_TRACE,
LDAP_XSTRING(bdb_add) ": dn2id_add failed: %s (%d)\n",
}
/* attribute indexes */
- rs->sr_err = bdb_index_entry_add( op, lt2, op->oq_add.rs_e );
+ rs->sr_err = bdb_index_entry_add( op, lt2, op->ora_e );
if ( rs->sr_err != LDAP_SUCCESS ) {
Debug( LDAP_DEBUG_TRACE,
LDAP_XSTRING(bdb_add) ": index_entry_add failed\n",
}
/* id2entry index */
- rs->sr_err = bdb_id2entry_add( op->o_bd, lt2, op->oq_add.rs_e );
+ rs->sr_err = bdb_id2entry_add( op->o_bd, lt2, op->ora_e );
if ( rs->sr_err != 0 ) {
Debug( LDAP_DEBUG_TRACE,
LDAP_XSTRING(bdb_add) ": id2entry_add failed\n",
postread_ctrl = &ctrls[num_ctrls++];
ctrls[num_ctrls] = NULL;
}
- if ( slap_read_controls( op, rs, op->oq_add.rs_e,
+ if ( slap_read_controls( op, rs, op->ora_e,
&slap_post_read_bv, postread_ctrl ) )
{
Debug( LDAP_DEBUG_TRACE,
Debug(LDAP_DEBUG_TRACE,
LDAP_XSTRING(bdb_add) ": added%s id=%08lx dn=\"%s\"\n",
op->o_noop ? " (no-op)" : "",
- op->oq_add.rs_e->e_id, op->oq_add.rs_e->e_dn );
+ op->ora_e->e_id, op->ora_e->e_dn );
rs->sr_text = NULL;
if( num_ctrls ) rs->sr_ctrls = ctrls;