mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-24 00:29:35 -05:00
working modrdn...
(need to fix leaks on transaction retries)
This commit is contained in:
parent
d4dee7c427
commit
f106722ebf
2 changed files with 20 additions and 14 deletions
|
|
@ -17,8 +17,7 @@ bdb_dn2id_add(
|
|||
BackendDB *be,
|
||||
DB_TXN *txn,
|
||||
const char *dn,
|
||||
ID id
|
||||
)
|
||||
ID id )
|
||||
{
|
||||
int rc;
|
||||
DBT key, data;
|
||||
|
|
@ -212,8 +211,13 @@ bdb_dn2id(
|
|||
/* fetch it */
|
||||
rc = db->get( db, txn, &key, &data, 0 );
|
||||
|
||||
Debug( LDAP_DEBUG_TRACE, "<= bdb_dn2id: id=0x%08lx: %s (%d)\n",
|
||||
*id, db_strerror( rc ), rc );
|
||||
if( rc != 0 ) {
|
||||
Debug( LDAP_DEBUG_TRACE, "<= bdb_dn2id: get failed: %s (%d)\n",
|
||||
db_strerror( rc ), rc, 0 );
|
||||
} else {
|
||||
Debug( LDAP_DEBUG_TRACE, "<= bdb_dn2id: got id=0x%08lx\n",
|
||||
*id, 0, 0 );
|
||||
}
|
||||
|
||||
ch_free( key.data );
|
||||
return rc;
|
||||
|
|
|
|||
|
|
@ -300,16 +300,18 @@ retry: rc = txn_abort( ltid );
|
|||
new_ndn, 0, 0 );
|
||||
|
||||
rc = bdb_dn2id ( be, ltid, new_ndn, &id );
|
||||
if( rc != 0 ) {
|
||||
switch( rc ) {
|
||||
case DB_LOCK_DEADLOCK:
|
||||
case DB_LOCK_NOTGRANTED:
|
||||
goto retry;
|
||||
default:
|
||||
rc = LDAP_OTHER;
|
||||
text = "internal error";
|
||||
}
|
||||
|
||||
switch( rc ) {
|
||||
case DB_LOCK_DEADLOCK:
|
||||
case DB_LOCK_NOTGRANTED:
|
||||
goto retry;
|
||||
case DB_NOTFOUND:
|
||||
break;
|
||||
case 0:
|
||||
rc = LDAP_ALREADY_EXISTS;
|
||||
goto return_results;
|
||||
default:
|
||||
rc = LDAP_OTHER;
|
||||
text = "internal error";
|
||||
goto return_results;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue