ITS#3333 fix for compare

filterentry cleanup
This commit is contained in:
Kurt Zeilenga 2004-09-17 22:07:29 +00:00
parent 9c5768cd8e
commit a997b94f1f
2 changed files with 13 additions and 5 deletions

View File

@ -326,7 +326,7 @@ static int compare_entry(
Entry *e, Entry *e,
AttributeAssertion *ava ) AttributeAssertion *ava )
{ {
int rc = LDAP_NO_SUCH_ATTRIBUTE; int rc;
Attribute *a; Attribute *a;
if ( ! access_allowed( op, e, if ( ! access_allowed( op, e,
@ -335,11 +335,20 @@ static int compare_entry(
return LDAP_INSUFFICIENT_ACCESS; return LDAP_INSUFFICIENT_ACCESS;
} }
a = attrs_find( e->e_attrs, ava->aa_desc );
if( a == NULL ) return LDAP_NO_SUCH_ATTRIBUTE;
rc = LDAP_COMPARE_FALSE;
for(a = attrs_find( e->e_attrs, ava->aa_desc ); for(a = attrs_find( e->e_attrs, ava->aa_desc );
a != NULL; a != NULL;
a = attrs_find( a->a_next, ava->aa_desc )) a = attrs_find( a->a_next, ava->aa_desc ))
{ {
rc = LDAP_COMPARE_FALSE; if (( ava->aa_desc != a->a_desc ) && ! access_allowed( op,
e, a->a_desc, &ava->aa_value, ACL_COMPARE, NULL ) )
{
rc = LDAP_INSUFFICIENT_ACCESS;
break;
}
if ( value_find_ex( ava->aa_desc, if ( value_find_ex( ava->aa_desc,
SLAP_MR_ATTRIBUTE_VALUE_NORMALIZED_MATCH | SLAP_MR_ATTRIBUTE_VALUE_NORMALIZED_MATCH |

View File

@ -433,8 +433,8 @@ test_ava_filter(
MatchingRule *mr; MatchingRule *mr;
struct berval *bv; struct berval *bv;
if (( ava->aa_desc != a->a_desc ) && !access_allowed( op, e, if (( ava->aa_desc != a->a_desc ) && !access_allowed( op,
a->a_desc, &ava->aa_value, ACL_SEARCH, NULL )) e, a->a_desc, &ava->aa_value, ACL_SEARCH, NULL ))
{ {
rc = LDAP_INSUFFICIENT_ACCESS; rc = LDAP_INSUFFICIENT_ACCESS;
continue; continue;
@ -512,7 +512,6 @@ test_presence_filter(
} }
if ( desc == slap_schema.si_ad_hasSubordinates ) { if ( desc == slap_schema.si_ad_hasSubordinates ) {
/* /*
* XXX: fairly optimistic: if the function is defined, * XXX: fairly optimistic: if the function is defined,
* then PRESENCE must succeed, because hasSubordinate * then PRESENCE must succeed, because hasSubordinate