- /* get entry with reader lock */
- 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 ( matched != NULL ) {
- free( matched );
- }
- return( rc );
+ 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;