]> git.sur5r.net Git - openldap/commitdiff
ITS#2453 - Handle computed filters, ignore Undefined filters.
authorHoward Chu <hyc@openldap.org>
Tue, 29 Apr 2003 02:55:43 +0000 (02:55 +0000)
committerHoward Chu <hyc@openldap.org>
Tue, 29 Apr 2003 02:55:43 +0000 (02:55 +0000)
servers/slapd/back-ldbm/filterindex.c

index 95ba7c6cf2bc45908a73a98952af41d310c82941..378480a5157832841ad720eb38bc95ea13263c82 100644 (file)
@@ -47,6 +47,23 @@ filter_candidates(
 
        result = NULL;
        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. list_candidates
+                * will take care of ignoring this filter.
+                */
+               /* FALLTHRU */
+               case LDAP_COMPARE_FALSE:
+                       result = NULL;
+                       break;
+               case LDAP_COMPARE_TRUE:
+                       result = idl_allids( op->o_bd );
+                       break;
+               }
+               break;
+
        case SLAPD_FILTER_DN_ONE:
 #ifdef NEW_LOGGING
                LDAP_LOG( FILTER, DETAIL1, 
@@ -692,6 +709,10 @@ 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