- if ( (e = dn2entry( be, dn, &matched )) == NULL ) {
- /* allow noauth binds */
- if ( method == LDAP_AUTH_SIMPLE && cred->bv_len == 0 ) {
- /*
- * bind successful, but return 1 so we don't
- * authorize based on noauth credentials
- */
- send_ldap_result( conn, op, LDAP_SUCCESS, NULL, NULL );
- rc = 1;
- } else if ( be_isroot_pw( be, dn, cred ) ) {
- /* front end will send result */
- rc = 0;
- } else {
- send_ldap_result( conn, op, LDAP_NO_SUCH_OBJECT,
- matched, NULL );
- rc = 1;
- }
- if ( matched != NULL ) {
- free( matched );
+ AttributeDescription *password = slap_schema.si_ad_userPassword;
+
+ Debug(LDAP_DEBUG_ARGS,
+ "==> ldbm_back_bind: dn: %s\n", op->o_req_dn.bv_val, 0, 0);
+
+ if ( op->oq_bind.rb_method == LDAP_AUTH_SIMPLE && be_isroot_pw( op ) ) {
+ ber_dupbv( &op->oq_bind.rb_edn, be_root_dn( op->o_bd ) );
+ /* front end will send result */
+ return LDAP_SUCCESS;
+ }
+
+ /* grab giant lock for reading */
+ ldap_pvt_thread_rdwr_rlock(&li->li_giant_rwlock);
+
+ /* get entry with reader lock */
+ if ( (e = dn2entry_r( op->o_bd, &op->o_req_ndn, &matched )) == NULL ) {
+ if( matched != NULL ) {
+ cache_return_entry_r( &li->li_cache, matched );