mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-01-30 13:30:57 +08:00
Make sure e_ndn is used!
This commit is contained in:
parent
72ba4cfb71
commit
1d70b89234
@ -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;
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user