Backend *be,
Connection *conn,
Operation *op,
- const char *extoid,
+ const void *opdata,
const char **text )
{
int rc;
return LDAP_OTHER;
}
- if (( extoid == NULL || strcmp( extoid, LDAP_EXOP_START_TLS ) ) ) {
+ if ( op->o_tag != LDAP_REQ_EXTENDED
+ || strcmp( (const char *) opdata, LDAP_EXOP_START_TLS ) )
+ {
/* these checks don't apply to StartTLS */
if( op->o_tag == LDAP_REQ_EXTENDED ) {
}
}
- if (( extoid == NULL || strcmp( extoid, LDAP_EXOP_START_TLS ) )
- || op->o_tag == LDAP_REQ_BIND )
+ if ( op->o_tag != LDAP_REQ_BIND &&
+ ( op->o_tag != LDAP_REQ_EXTENDED ||
+ strcmp( (const char *) opdata, LDAP_EXOP_START_TLS ) ) )
{
- /* these checks don't apply to StartTLS or Bind */
+ /* these checks don't apply to Bind or StartTLS */
if( requires & SLAP_REQUIRE_STRONG ) {
/* should check mechanism */
"conn=%ld op=%d SRCH base=\"%s\" scope=%d filter=\"%s\"\n",
op->o_connid, op->o_opid, base, scope, fstr );
+ manageDSAit = get_manageDSAit( op );
+
+ if( scope != LDAP_SCOPE_BASE && nbase[0] == '\0' &&
+ default_search_nbase != NULL )
+ {
+ ch_free( base );
+ ch_free( nbase );
+ base = ch_strdup( default_search_base );
+ nbase = ch_strdup( default_search_nbase );
+ }
+
+ /* Select backend */
+ be = select_backend( nbase, manageDSAit );
+
+ /* check restrictions */
+ rc = backend_check_restrictions( be, conn, op, NULL, &text ) ;
+ if( rc != LDAP_SUCCESS ) {
+ send_ldap_result( conn, op, rc,
+ NULL, text, NULL, NULL );
+ goto return_results;
+ }
+
if ( scope == LDAP_SCOPE_BASE ) {
Entry *entry = NULL;
}
}
- if( nbase[0] == '\0' && default_search_nbase != NULL ) {
- ch_free( base );
- ch_free( nbase );
- base = ch_strdup( default_search_base );
- nbase = ch_strdup( default_search_nbase );
- }
-
- manageDSAit = get_manageDSAit( op );
-
- /*
- * We could be serving multiple database backends. Select the
- * appropriate one, or send a referral to our "referral server"
- * if we don't hold it.
- */
- if ( (be = select_backend( nbase, manageDSAit )) == NULL ) {
+ if ( be == NULL ) {
+ /* no backend, return a referral (or noSuchObject) */
send_ldap_result( conn, op, rc = LDAP_REFERRAL,
NULL, NULL, default_referral, NULL );
goto return_results;
}
- /* check restrictions */
- rc = backend_check_restrictions( be, conn, op, NULL, &text ) ;
- if( rc != LDAP_SUCCESS ) {
- send_ldap_result( conn, op, rc,
- NULL, text, NULL, NULL );
- goto return_results;
- }
-
/* check for referrals */
rc = backend_check_referrals( be, conn, op, base, nbase );
if ( rc != LDAP_SUCCESS ) {