AttributeDescription *password = slap_schema.si_ad_userPassword;
+ u_int32_t locker;
+ DB_LOCK lock;
+
+#ifdef NEW_LOGGING
+ LDAP_LOG ( OPERATION, ARGS, "==> bdb_bind: dn: %s\n", dn->bv_val, 0, 0 );
+#else
Debug( LDAP_DEBUG_ARGS, "==> bdb_bind: dn: %s\n", dn->bv_val, 0, 0);
+#endif
+ LOCK_ID(bdb->bi_dbenv, &locker);
+
+dn2entry_retry:
/* get entry */
- rc = bdb_dn2entry( be, NULL, ndn, &e, &matched, 0 );
+ rc = bdb_dn2entry_r( be, NULL, ndn, &e, &matched, 0, locker, &lock );
switch(rc) {
case DB_NOTFOUND:
case 0:
break;
+ case LDAP_BUSY:
+ send_ldap_result( conn, op, LDAP_BUSY,
+ NULL, "ldap server busy", NULL, NULL );
+ LOCK_ID_FREE(bdb->bi_dbenv, locker);
+ return LDAP_BUSY;
+ case DB_LOCK_DEADLOCK:
+ case DB_LOCK_NOTGRANTED:
+ goto dn2entry_retry;
default:
send_ldap_result( conn, op, rc=LDAP_OTHER,
NULL, "internal error", NULL, NULL );
+ LOCK_ID_FREE(bdb->bi_dbenv, locker);
return rc;
}
? get_entry_referrals( be, conn, op, matched )
: NULL;
- bdb_entry_return( be, matched );
+ bdb_cache_return_entry_r( bdb->bi_dbenv, &bdb->bi_cache, matched, &lock );
matched = NULL;
} else {
NULL, NULL, NULL, NULL );
}
+ LOCK_ID_FREE(bdb->bi_dbenv, locker);
+
ber_bvarray_free( refs );
free( matched_dn );
ber_dupbv( edn, &e->e_name );
/* check for deleted */
+#ifdef BDB_SUBENTRIES
+ if ( is_entry_subentry( e ) ) {
+ /* entry is an subentry, don't allow bind */
+#ifdef NEW_LOGGING
+ LDAP_LOG ( OPERATION, DETAIL1,
+ "bdb_bind: entry is subentry\n", 0, 0, 0 );
+#else
+ Debug( LDAP_DEBUG_TRACE, "entry is subentry\n", 0,
+ 0, 0 );
+#endif
+ send_ldap_result( conn, op, rc = LDAP_INVALID_CREDENTIALS,
+ NULL, NULL, NULL, NULL );
+
+ goto done;
+ }
+#endif
+
+#ifdef BDB_ALIASES
if ( is_entry_alias( e ) ) {
/* entry is an alias, don't allow bind */
+#ifdef NEW_LOGGING
+ LDAP_LOG ( OPERATION, DETAIL1, "bdb_bind: entry is alias\n", 0, 0, 0 );
+#else
Debug( LDAP_DEBUG_TRACE, "entry is alias\n", 0,
0, 0 );
+#endif
send_ldap_result( conn, op, rc = LDAP_ALIAS_PROBLEM,
NULL, "entry is alias", NULL, NULL );
goto done;
}
+#endif
if ( is_entry_referral( e ) ) {
/* entry is a referral, don't allow bind */
BerVarray refs = get_entry_referrals( be,
conn, op, e );
+#ifdef NEW_LOGGING
+ LDAP_LOG ( OPERATION, DETAIL1,
+ "bdb_bind: entry is referral\n", 0, 0, 0 );
+#else
Debug( LDAP_DEBUG_TRACE, "entry is referral\n", 0,
0, 0 );
+#endif
if( refs != NULL ) {
send_ldap_result( conn, op, rc = LDAP_REFERRAL,
}
if ( ! access_allowed( be, conn, op, e,
- password, NULL, ACL_AUTH ) )
+ password, NULL, ACL_AUTH, NULL ) )
{
send_ldap_result( conn, op, rc = LDAP_INSUFFICIENT_ACCESS,
NULL, NULL, NULL, NULL );
}
if ( ! access_allowed( be, conn, op, e,
- krbattr, NULL, ACL_AUTH ) )
+ krbattr, NULL, ACL_AUTH, NULL ) )
{
send_ldap_result( conn, op, rc = LDAP_INSUFFICIENT_ACCESS,
NULL, NULL, NULL, NULL );
done:
/* free entry and reader lock */
if( e != NULL ) {
- bdb_entry_return( be, e );
+ bdb_cache_return_entry_r( bdb->bi_dbenv, &bdb->bi_cache, e, &lock );
}
+ LOCK_ID_FREE(bdb->bi_dbenv, locker);
+
/* front end with send result on success (rc==0) */
return rc;
}