Commit 4c192726 authored by Kurt Zeilenga's avatar Kurt Zeilenga
Browse files

Assert ID != NOID when fetching from the datastore.

Add additional abandon point to modrdn.
test005-modrdn still shows error.  Likely in dn2id, index, or idl codes.
parent 60033b38
......@@ -28,6 +28,7 @@ dn2id_add(
struct ldbminfo *li = (struct ldbminfo *) be->be_private;
Debug( LDAP_DEBUG_TRACE, "=> dn2id_add( \"%s\", %ld )\n", dn, id, 0 );
assert( id != NOID );
if ( (db = ldbm_cache_open( be, "dn2id", LDBM_SUFFIX, LDBM_WRCREAT ))
== NULL ) {
......@@ -141,6 +142,8 @@ dn2id(
(void) memcpy( (char *) &id, data.dptr, sizeof(ID) );
assert( id != NOID );
ldbm_datum_free( db->dbc_db, data );
Debug( LDAP_DEBUG_TRACE, "<= dn2id %ld\n", id, 0, 0 );
......@@ -196,6 +199,8 @@ dn2id_delete(
Debug( LDAP_DEBUG_TRACE, "=> dn2id_delete( \"%s\", %ld )\n", dn, id, 0 );
assert( id != NOID );
if ( (db = ldbm_cache_open( be, "dn2id", LDBM_SUFFIX, LDBM_WRCREAT ))
== NULL ) {
Debug( LDAP_DEBUG_ANY,
......@@ -213,7 +218,9 @@ dn2id_delete(
key.dsize = strlen( pdn ) + 2;
key.dptr = ch_malloc( key.dsize );
sprintf( key.dptr, "%c%s", DN_ONE_PREFIX, pdn );
(void) idl_delete_key( be, db, key, id );
free( key.dptr );
free( pdn );
}
......
......@@ -261,6 +261,14 @@ ldbm_back_modrdn(
Debug( LDAP_DEBUG_TRACE, "ldbm_back_modrdn: new ndn=%s\n",
new_ndn, 0, 0 );
/* check for abandon */
ldap_pvt_thread_mutex_lock( &op->o_abandonmutex );
if ( op->o_abandon ) {
ldap_pvt_thread_mutex_unlock( &op->o_abandonmutex );
goto return_results;
}
ldap_pvt_thread_mutex_unlock( &op->o_abandonmutex );
if (dn2id ( be, new_ndn ) != NOID) {
send_ldap_result( conn, op, LDAP_ALREADY_EXISTS,
NULL, NULL, NULL, NULL );
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment