From 56888eac306244553562aa00b312318b79d1d6c1 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Thu, 23 Dec 2010 21:53:05 +0000 Subject: [PATCH] Move assertion checking to slap_compare_entry() --- servers/slapd/back-bdb/compare.c | 13 ------------- servers/slapd/compare.c | 7 +++++++ 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/servers/slapd/back-bdb/compare.c b/servers/slapd/back-bdb/compare.c index c333fa5247..095033eb14 100644 --- a/servers/slapd/back-bdb/compare.c +++ b/servers/slapd/back-bdb/compare.c @@ -122,19 +122,6 @@ dn2entry_retry: goto done; } - if ( get_assert( op ) && - ( test_filter( op, e, get_assertion( op )) != LDAP_COMPARE_TRUE )) - { - if ( !access_allowed( op, e, slap_schema.si_ad_entry, - NULL, ACL_DISCLOSE, NULL ) ) - { - rs->sr_err = LDAP_NO_SUCH_OBJECT; - } else { - rs->sr_err = LDAP_ASSERTION_FAILED; - } - goto return_results; - } - rs->sr_err = slap_compare_entry( op, e, op->orc_ava ); return_results: diff --git a/servers/slapd/compare.c b/servers/slapd/compare.c index 0cc3181645..269d80ffc5 100644 --- a/servers/slapd/compare.c +++ b/servers/slapd/compare.c @@ -362,6 +362,13 @@ int slap_compare_entry( goto done; } + if ( get_assert( op ) && + ( test_filter( op, e, get_assertion( op )) != LDAP_COMPARE_TRUE )) + { + rc = LDAP_ASSERTION_FAILED; + goto done; + } + a = attrs_find( e->e_attrs, ava->aa_desc ); if( a == NULL ) { rc = LDAP_NO_SUCH_ATTRIBUTE; -- 2.39.5