- /* Must do an internal search */
-
-#ifdef NEW_LOGGING
- LDAP_LOG(( "sasl", LDAP_LEVEL_DETAIL1,
- "slap_sasl2dn: performing internal search (base=%s, scope=%d)\n",
- searchbase.bv_val, scope ));
-#else
- Debug( LDAP_DEBUG_TRACE,
- "slap_sasl2dn: performing internal search (base=%s, scope=%d)\n",
- searchbase.bv_val, scope, 0 );
-#endif
-
- be = select_backend( &searchbase, 0, 1 );
- if(( be == NULL ) || ( be->be_search == NULL))
- goto FINISHED;
- suffix_alias( be, &searchbase );
-
- ldap_pvt_thread_mutex_init( &op.o_abandonmutex );
- op.o_tag = LDAP_REQ_SEARCH;
- op.o_protocol = LDAP_VERSION3;
- op.o_ndn = *saslname;
- op.o_callback = &cb;
- op.o_time = slap_get_time();
-
- (*be->be_search)( be, /*conn*/NULL, &op, /*base*/NULL, &searchbase,
- scope, /*deref=*/1, /*sizelimit=*/1, /*time=*/0, filter, /*fstr=*/NULL,
- /*attrs=*/NULL, /*attrsonly=*/0 );
-
- ldap_pvt_thread_mutex_destroy( &op.o_abandonmutex );
-
-FINISHED:
- if( searchbase.bv_len ) ch_free( searchbase.bv_val );
- if( filter ) filter_free( filter );
- if( uri.bv_val ) ch_free( uri.bv_val );
-
-#ifdef NEW_LOGGING
- LDAP_LOG(( "sasl", LDAP_LEVEL_ENTRY,
- "slap_sasl2dn: Converted SASL name to %s\n",
- dn->bv_len ? dn->bv_val : "<nothing>" ));
-#else
- Debug( LDAP_DEBUG_TRACE, "<==slap_sasl2dn: Converted SASL name to %s\n",
- dn->bv_len ? dn->bv_val : "<nothing>", 0, 0 );
-#endif
-
- return;