From: Howard Chu Date: Tue, 13 May 2003 01:16:26 +0000 (+0000) Subject: ITS#2506 - fix prev patch, don't ignore undefined filters. treat as False, X-Git-Tag: OPENLDAP_REL_ENG_2_2_0ALPHA~144 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=fb52e37e06034526b1071f4dd7e0333fbb0c1d13;p=openldap ITS#2506 - fix prev patch, don't ignore undefined filters. treat as False, test_filter will never match them anyway. --- diff --git a/servers/slapd/back-bdb/filterindex.c b/servers/slapd/back-bdb/filterindex.c index 50be97d332..1664212466 100644 --- a/servers/slapd/back-bdb/filterindex.c +++ b/servers/slapd/back-bdb/filterindex.c @@ -60,6 +60,11 @@ bdb_filter_candidates( switch ( f->f_choice ) { case SLAPD_FILTER_COMPUTED: switch( f->f_result ) { + case SLAPD_COMPARE_UNDEFINED: + /* This technically is not the same as FALSE, but it + * certainly will produce no matches. + */ + /* FALLTHRU */ case LDAP_COMPARE_FALSE: BDB_IDL_ZERO( ids ); break; @@ -67,7 +72,8 @@ bdb_filter_candidates( struct bdb_info *bdb = (struct bdb_info *)op->o_bd->be_private; BDB_IDL_ALL( bdb, ids ); } break; - case SLAPD_COMPARE_UNDEFINED: + case LDAP_SUCCESS: + /* this is a pre-computed scope, leave it alone */ break; } break; @@ -232,11 +238,6 @@ list_candidates( #endif for ( f = flist; f != NULL; f = f->f_next ) { - /* Ignore undefined filters */ - if ( f->f_choice == SLAPD_FILTER_COMPUTED && - f->f_result == SLAPD_COMPARE_UNDEFINED ) { - continue; - } rc = bdb_filter_candidates( op, f, save, tmp, save+BDB_IDL_UM_SIZE ); diff --git a/servers/slapd/back-bdb/search.c b/servers/slapd/back-bdb/search.c index 7dd31cbe65..3a0bd7cd09 100644 --- a/servers/slapd/back-bdb/search.c +++ b/servers/slapd/back-bdb/search.c @@ -1556,7 +1556,7 @@ static int search_candidates( f.f_and = &nf; /* Dummy; we compute scope separately now */ nf.f_choice = SLAPD_FILTER_COMPUTED; - nf.f_result = SLAPD_COMPARE_UNDEFINED; + nf.f_result = LDAP_SUCCESS; nf.f_next = xf.f_or == op->oq_search.rs_filter ? op->oq_search.rs_filter : &xf ; /* Filter depth increased again, adding dummy clause */ diff --git a/servers/slapd/back-ldbm/filterindex.c b/servers/slapd/back-ldbm/filterindex.c index 378480a515..79a2ee45b6 100644 --- a/servers/slapd/back-ldbm/filterindex.c +++ b/servers/slapd/back-ldbm/filterindex.c @@ -51,8 +51,7 @@ filter_candidates( switch( f->f_result ) { case SLAPD_COMPARE_UNDEFINED: /* This technically is not the same as FALSE, but it - * certainly will produce no matches. list_candidates - * will take care of ignoring this filter. + * certainly will produce no matches. */ /* FALLTHRU */ case LDAP_COMPARE_FALSE: @@ -709,10 +708,6 @@ list_candidates( idl = NULL; for ( f = flist; f != NULL; f = f->f_next ) { - if ( f->f_choice == SLAPD_FILTER_COMPUTED && - f->f_result == SLAPD_COMPARE_UNDEFINED ) { - continue; - } if ( (tmp = filter_candidates( op, f )) == NULL && ftype == LDAP_FILTER_AND ) { #ifdef NEW_LOGGING