Make sure e_ndn is used!

This commit is contained in:
Kurt Zeilenga 1999-01-28 17:32:59 +00:00
parent 72ba4cfb71
commit 1d70b89234
2 changed files with 8 additions and 10 deletions

View File

@ -20,19 +20,17 @@ ldbm_back_add(
)
{
struct ldbminfo *li = (struct ldbminfo *) be->be_private;
char *dn, *pdn;
char *pdn;
Entry *p = NULL;
int rootlock = 0;
int rc = -1;
dn = e->e_ndn;
Debug(LDAP_DEBUG_ARGS, "==> ldbm_back_add: %s\n", dn, 0, 0);
Debug(LDAP_DEBUG_ARGS, "==> ldbm_back_add: %s\n", e->e_dn, 0, 0);
/* nobody else can add until we lock our parent */
ldap_pvt_thread_mutex_lock(&li->li_add_mutex);
if ( ( dn2id( be, dn ) ) != NOID ) {
if ( ( dn2id( be, e->e_ndn ) ) != NOID ) {
ldap_pvt_thread_mutex_unlock(&li->li_add_mutex);
entry_free( e );
send_ldap_result( conn, op, LDAP_ALREADY_EXISTS, "", "" );
@ -57,7 +55,7 @@ ldbm_back_add(
* 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 */
@ -199,7 +197,7 @@ ldbm_back_add(
}
/* 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, "", "" );
@ -211,7 +209,7 @@ ldbm_back_add(
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;

View File

@ -70,7 +70,7 @@ ldbm_back_delete(
e->e_rdwr.lt_readers_reading, e->e_rdwr.lt_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,
"<=- ldbm_back_delete: parent does not exist\n",
@ -118,7 +118,7 @@ ldbm_back_delete(
}
/* 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);