Commit 60a4a8d8 authored by Kurt Zeilenga's avatar Kurt Zeilenga
Browse files

Check LOCK_ID() return

parent 391af545
......@@ -67,10 +67,17 @@ bdb_attribute(
txn = boi->boi_txn;
}
if ( txn != NULL )
if ( txn != NULL ) {
locker = TXN_ID ( txn );
else
LOCK_ID ( bdb->bi_dbenv, &locker );
} else {
rc = LOCK_ID ( bdb->bi_dbenv, &locker );
switch(rc) {
case 0:
break;
default:
return LDAP_OTHER;
}
}
if (target != NULL && dn_match(&target->e_nname, entry_ndn)) {
/* we already have a LOCKED copy of the entry */
......
......@@ -49,7 +49,15 @@ bdb_bind(
Debug( LDAP_DEBUG_ARGS, "==> bdb_bind: dn: %s\n", dn->bv_val, 0, 0);
#endif
LOCK_ID(bdb->bi_dbenv, &locker);
rc = LOCK_ID(bdb->bi_dbenv, &locker);
switch(rc) {
case 0:
break;
default:
send_ldap_result( conn, op, rc=LDAP_OTHER,
NULL, "internal error", NULL, NULL );
return rc;
}
dn2entry_retry:
/* get entry */
......
......@@ -34,7 +34,15 @@ bdb_compare(
u_int32_t locker;
DB_LOCK lock;
LOCK_ID ( bdb->bi_dbenv, &locker );
rc = LOCK_ID(bdb->bi_dbenv, &locker);
switch(rc) {
case 0:
break;
default:
send_ldap_result( conn, op, rc=LDAP_OTHER,
NULL, "internal error", NULL, NULL );
return rc;
}
dn2entry_retry:
/* get entry */
......
......@@ -79,10 +79,17 @@ bdb_group(
txn = boi->boi_txn;
}
if ( txn )
if ( txn ) {
locker = TXN_ID( txn );
else
} else {
LOCK_ID ( bdb->bi_dbenv, &locker );
switch(rc) {
case 0:
break;
default:
return 1;
}
}
if (dn_match(&target->e_name, gr_ndn)) {
/* we already have a LOCKED copy of the entry */
......
......@@ -39,7 +39,13 @@ bdb_referrals(
return rc;
}
LOCK_ID ( bdb->bi_dbenv, &locker );
rc = LOCK_ID(bdb->bi_dbenv, &locker);
switch(rc) {
case 0:
break;
default:
return LDAP_OTHER;
}
dn2entry_retry:
/* get entry */
......
......@@ -71,7 +71,15 @@ bdb_search(
manageDSAit = get_manageDSAit( op );
LOCK_ID (bdb->bi_dbenv, &locker );
rc = LOCK_ID (bdb->bi_dbenv, &locker );
switch(rc) {
case 0:
break;
default:
send_ldap_result( conn, op, rc=LDAP_OTHER,
NULL, "internal error", NULL, NULL );
return rc;
}
if ( nbase->bv_len == 0 ) {
/* DIT root special case */
......
Supports Markdown
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