]> git.sur5r.net Git - openldap/commitdiff
only optimize objectClass filters when (objectClass=*) is
authorKurt Zeilenga <kurt@openldap.org>
Mon, 9 Sep 2002 23:25:22 +0000 (23:25 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Mon, 9 Sep 2002 23:25:22 +0000 (23:25 +0000)
presented... avoids (&(objectClass=*)(objectClass=foo)) problems.

servers/slapd/back-bdb/search.c

index 0810625ada18c3764545946b665623d3b406c5dc..1635bbd87c55d49d43f23a812bff492d53eb808f 100644 (file)
@@ -731,16 +731,19 @@ static int oc_filter(
 
        switch(f->f_choice) {
        case LDAP_FILTER_PRESENT:
-               if (f->f_desc == slap_schema.si_ad_objectClass)
+               if (f->f_desc == slap_schema.si_ad_objectClass) {
                        rc = 1;
+               }
                break;
 
        case LDAP_FILTER_AND:
        case LDAP_FILTER_OR:
                cur++;
-               for (f=f->f_and; f; f=f->f_next)
-                       rc |= oc_filter(f, cur, max);
+               for (f=f->f_and; f; f=f->f_next) {
+                       (void) oc_filter(f, cur, max);
+               }
                break;
+
        default:
                break;
        }