only optimize objectClass filters when (objectClass=*) is

presented... avoids (&(objectClass=*)(objectClass=foo)) problems.
This commit is contained in:
Kurt Zeilenga 2002-09-09 23:25:22 +00:00
parent 07a6d6c208
commit e6fdfd4cee

View 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;
}