)
{
struct ldbminfo *li = (struct ldbminfo *) be->be_private;
- char *dn = NULL, *pdn;
+ char *pdn;
Entry *p = NULL;
int rootlock = 0;
int rc = -1;
- dn = dn_normalize( ch_strdup( e->e_dn ) );
-
- Debug(LDAP_DEBUG_ARGS, "==> ldbm_back_add: %s\n", dn, 0, 0);
+ Debug(LDAP_DEBUG_ARGS, "==> ldbm_back_add: %s\n", e->e_ndn, 0, 0);
/* nobody else can add until we lock our parent */
pthread_mutex_lock(&li->li_add_mutex);
- if ( ( dn2id( be, dn ) ) != NOID ) {
+ if ( ( dn2id( be, e->e_ndn ) ) != NOID ) {
pthread_mutex_unlock(&li->li_add_mutex);
entry_free( e );
- free( dn );
send_ldap_result( conn, op, LDAP_ALREADY_EXISTS, "", "" );
return( -1 );
}
0, 0, 0 );
entry_free( e );
- free( dn );
send_ldap_result( conn, op, LDAP_OBJECT_CLASS_VIOLATION, "",
"" );
return( -1 );
* add the entry.
*/
- if ( (pdn = dn_parent( be, dn )) != NULL ) {
+ if ( (pdn = dn_parent( be, e->e_ndn )) != NULL ) {
char *matched = NULL;
/* get parent with writer lock */
}
entry_free( e );
- free( dn );
free( pdn );
return -1;
}
cache_return_entry_w( &li->li_cache, p );
entry_free( e );
- free( dn );
return -1;
}
"", "" );
entry_free( e );
- free( dn );
return -1;
}
0, 0, 0 );
entry_free(e);
- free( dn );
send_ldap_result( conn, op, LDAP_OPERATIONS_ERROR, "", "" );
return( -1 );
entry_rdwr_unlock(e, 1);;
entry_free( e );
- free( dn );
send_ldap_result( conn, op, LDAP_ALREADY_EXISTS, "", "" );
return( -1 );
}
/* dn2id index */
- if ( dn2id_add( be, dn, e->e_id ) != 0 ) {
+ if ( dn2id_add( be, e->e_ndn, e->e_id ) != 0 ) {
Debug( LDAP_DEBUG_TRACE, "dn2id_add failed\n", 0,
0, 0 );
send_ldap_result( conn, op, LDAP_OPERATIONS_ERROR, "", "" );
if ( id2entry_add( be, e ) != 0 ) {
Debug( LDAP_DEBUG_TRACE, "id2entry_add failed\n", 0,
0, 0 );
- (void) dn2id_delete( be, dn );
+ (void) dn2id_delete( be, e->e_ndn );
send_ldap_result( conn, op, LDAP_OPERATIONS_ERROR, "", "" );
goto return_results;
rc = 0;
return_results:;
- if ( dn != NULL )
- free( dn );
-
if (p != NULL) {
/* free parent and writer lock */
cache_return_entry_w( &li->li_cache, p );
e->e_rdwr.readers_reading, e->e_rdwr.writer_writing, 0);
/* delete from parent's id2children entry */
- if( (pdn = dn_parent( be, dn )) != NULL ) {
+ if( (pdn = dn_parent( be, e->e_ndn )) != NULL ) {
if( (p = dn2entry_w( be, pdn, &matched )) == NULL) {
Debug( LDAP_DEBUG_TRACE, "parent does not exist\n",
0, 0, 0);
}
/* delete from dn2id mapping */
- if ( dn2id_delete( be, e->e_dn ) != 0 ) {
+ if ( dn2id_delete( be, e->e_ndn ) != 0 ) {
Debug(LDAP_DEBUG_ARGS,
"<=- ldbm_back_delete: operations error %s\n",
dn, 0, 0);