- if ( (e = dn2entry_r( 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 */
- *edn = ch_strdup( be_root_dn( be ) );
- rc = 0;
- } else {
- send_ldap_result( conn, op, LDAP_NO_SUCH_OBJECT, matched, NULL );
- rc = 1;
+ if ( (e = dn2entry_r( op->o_bd, &op->o_req_ndn, &matched )) == NULL ) {
+ if( matched != NULL ) {
+ cache_return_entry_r( &li->li_cache, matched );