char *pdn = NULL;
Entry *p = NULL;
int rc;
- const char *text = NULL;
+ const char *text;
AttributeDescription *children = slap_schema.si_ad_children;
DB_TXN *ltid = NULL;
struct bdb_op_info opinfo;
/* begin transaction */
rc = txn_begin( bdb->bi_dbenv, NULL, <id, 0 );
+ text = NULL;
if( rc != 0 ) {
Debug( LDAP_DEBUG_TRACE,
"bdb_add: txn_begin failed: %s (%d)\n",
? get_entry_referrals( be, conn, op, matched )
: NULL;
bdb_entry_return( be, matched );
+ matched = NULL;
} else {
matched_dn = NULL;
: NULL;
bdb_entry_return( be, matched );
+ matched = NULL;
+
} else {
refs = default_referral;
}
done:
/* free entry and reader lock */
- bdb_entry_return( be, e );
+ if( e != NULL ) {
+ bdb_entry_return( be, e );
+ }
/* front end with send result on success (rc==0) */
return rc;
? get_entry_referrals( be, conn, op, matched )
: NULL;
bdb_entry_return( be, matched );
+ matched = NULL;
+
} else {
refs = default_referral;
}
done:
/* free entry */
- if( e != NULL ) bdb_entry_return( be, e );
+ if( e != NULL ) {
+ bdb_entry_return( be, e );
+ }
return rc;
}
\ No newline at end of file
char *pdn = NULL;
Entry *e, *p = NULL;
int rc;
- const char *text = NULL;
+ const char *text;
int manageDSAit = get_manageDSAit( op );
AttributeDescription *children = slap_schema.si_ad_children;
DB_TXN *ltid = NULL;
/* begin transaction */
rc = txn_begin( bdb->bi_dbenv, NULL, <id, 0 );
+ text = NULL;
if( rc != 0 ) {
Debug( LDAP_DEBUG_TRACE,
"bdb_delete: txn_begin failed: %s (%d)\n",
? get_entry_referrals( be, conn, op, matched )
: NULL;
bdb_entry_return( be, matched );
+ matched = NULL;
+
} else {
refs = default_referral;
}
children, NULL, ACL_WRITE );
bdb_entry_return( be, p );
+ p = NULL;
if ( !rc ) {
Debug( LDAP_DEBUG_TRACE,
done:
/* free entry */
- if( e != NULL ) bdb_entry_return( be, e );
+ if( e != NULL ) {
+ bdb_entry_return( be, e );
+ }
if( ltid != NULL ) {
txn_abort( ltid );
data.ulen = sizeof( ids );
data.flags = DB_DBT_USERMEM;
- /* fetch the key and grab a write lock */
+ /* fetch the key for read/modify/write */
rc = db->get( db, tid, key, &data, DB_RMW );
if( rc == DB_NOTFOUND ) {
data.ulen = sizeof( ids );
data.flags = DB_DBT_USERMEM;
- /* fetch the key and grab a write lock */
+ /* fetch the key for read/modify/write */
rc = db->get( db, tid, key, &data, DB_RMW );
if ( rc != 0 ) {
/* begin transaction */
rc = txn_begin( bdb->bi_dbenv, NULL, <id, 0 );
+ text = NULL;
if( rc != 0 ) {
Debug( LDAP_DEBUG_TRACE,
"bdb_modify: txn_begin failed: %s (%d)\n",
? get_entry_referrals( be, conn, op, matched )
: NULL;
bdb_entry_return( be, matched );
+ matched = NULL;
} else {
refs = default_referral;
op->o_private = NULL;
}
- bdb_entry_return( be, e );
+ if( e != NULL ) {
+ bdb_entry_return( be, e );
+ }
return rc;
}
Entry *e, *p = NULL;
Entry *matched;
int rc;
- const char *text = NULL;
+ const char *text;
DB_TXN * ltid;
struct bdb_op_info opinfo;
}
}
+
/* begin transaction */
rc = txn_begin( bdb->bi_dbenv, NULL, <id, 0 );
+ text = NULL;
if( rc != 0 ) {
Debug( LDAP_DEBUG_TRACE,
"bdb_delete: txn_begin failed: %s (%d)\n",
? get_entry_referrals( be, conn, op, matched )
: NULL;
bdb_entry_return( be, matched );
+ matched = NULL;
+
} else {
refs = default_referral;
}
/* delete old one */
rc = bdb_dn2id_delete( be, ltid, e->e_ndn, e->e_id );
if ( rc != 0 ) {
+ switch( rc ) {
+ case DB_LOCK_DEADLOCK:
+ case DB_LOCK_NOTGRANTED:
+ goto retry;
+ }
rc = LDAP_OTHER;
text = "DN index delete fail";
goto return_results;
/* add new one */
rc = bdb_dn2id_add( be, ltid, e->e_ndn, e->e_id );
if ( rc != 0 ) {
+ switch( rc ) {
+ case DB_LOCK_DEADLOCK:
+ case DB_LOCK_NOTGRANTED:
+ goto retry;
+ }
rc = LDAP_OTHER;
text = "DN index add failed";
goto return_results;
rc = bdb_modify_internal( be, conn, op, ltid, &mod[0], e, &text );
if( rc != LDAP_SUCCESS ) {
+ switch( rc ) {
+ case DB_LOCK_DEADLOCK:
+ case DB_LOCK_NOTGRANTED:
+ goto retry;
+ }
goto return_results;
}
*/
/* id2entry index */
- rc = bdb_id2entry_add( be, ltid, e );
+ rc = bdb_id2entry_update( be, ltid, e );
if ( rc != 0 ) {
+ switch( rc ) {
+ case DB_LOCK_DEADLOCK:
+ case DB_LOCK_NOTGRANTED:
+ goto retry;
+ }
rc = LDAP_OTHER;
text = "entry update failed";
goto return_results;
}
- rc = LDAP_SUCCESS;
-
rc = txn_commit( ltid, 0 );
ltid = NULL;
op->o_private = NULL;
dn = id ? id->bv_val : op->o_dn;
- Debug( LDAP_DEBUG_TRACE, "passwd: \"%s\"%s\n",
+ Debug( LDAP_DEBUG_TRACE, "bdb_exop_passwd: \"%s\"%s\n",
dn, id ? " (proxy)" : "", 0 );
if( dn == NULL || dn[0] == '\0' ) {
}
if (0) {
- /* transaction retry */
-retry: rc = txn_abort( ltid );
+retry: /* transaction retry */
+ Debug( LDAP_DEBUG_TRACE, "bdb_exop_passwd: retrying...\n", 0, 0, 0 );
+ rc = txn_abort( ltid );
ltid = NULL;
op->o_private = NULL;
if( rc != 0 ) {
/* begin transaction */
rc = txn_begin( bdb->bi_dbenv, NULL, <id, 0 );
+ *text = NULL;
if( rc != 0 ) {
Debug( LDAP_DEBUG_TRACE,
"bdb_exop_passwd: txn_begin failed: %s (%d)\n",
case DB_LOCK_DEADLOCK:
case DB_LOCK_NOTGRANTED:
bdb_entry_return( be, e );
+ e = NULL;
goto retry;
}
*text = "entry update failed";
: NULL;
bdb_entry_return( be, matched );
+ matched = NULL;
}
if( refs != NULL ) {
ber_bvecfree( refs );
free( matched_dn );
bdb_entry_return( be, matched );
+ matched = NULL;
}
return rc;
conn, op, e );
bdb_entry_return( be, e );
+ e = NULL;
Debug( LDAP_DEBUG_TRACE, "bdb_search: entry is referral\n",
0, 0, 0 );
cursor = e->e_id;
bdb_entry_return( be, e );
+ e = NULL;
if ( candidates[0] == 0 ) {
Debug( LDAP_DEBUG_TRACE, "bdb_search: no candidates\n",
/* check size limit */
if ( --slimit == -1 ) {
bdb_entry_return( be, e );
+ e = NULL;
send_search_result( conn, op,
rc = LDAP_SIZELIMIT_EXCEEDED, NULL, NULL,
v2refs, NULL, nentries );
break;
case -1: /* connection closed */
bdb_entry_return( be, e );
+ e = NULL;
rc = LDAP_OTHER;
goto done;
}