]> git.sur5r.net Git - openldap/commitdiff
Move assertion checking to slap_compare_entry()
authorHoward Chu <hyc@openldap.org>
Thu, 23 Dec 2010 21:53:05 +0000 (21:53 +0000)
committerHoward Chu <hyc@openldap.org>
Thu, 23 Dec 2010 21:53:05 +0000 (21:53 +0000)
servers/slapd/back-bdb/compare.c
servers/slapd/compare.c

index c333fa5247f26b9b42b5ab2dea41f13462e1e971..095033eb14419dca83285c50bd706817aae3cdf4 100644 (file)
@@ -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:
index 0cc3181645d7ce7f22120f6e9b439f2657d94391..269d80ffc57a25f5c1715afc17f702122547824b 100644 (file)
@@ -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;