]> git.sur5r.net Git - openldap/commitdiff
ITS#5862 Assert control for rootDSE/subschema
authorHoward Chu <hyc@openldap.org>
Thu, 30 Dec 2010 17:28:19 +0000 (17:28 +0000)
committerHoward Chu <hyc@openldap.org>
Thu, 30 Dec 2010 17:28:19 +0000 (17:28 +0000)
servers/slapd/search.c

index 88e44e3c45baaf5c646f3733c57feaa5de9f4558..db434ff3ef0615bf3730f65a2a061f02b13ff138 100644 (file)
@@ -274,6 +274,12 @@ fe_op_search( Operation *op, SlapReply *rs )
                        goto return_results;
 
                } else if ( entry != NULL ) {
+                       if ( get_assert( op ) &&
+                               ( test_filter( op, entry, get_assertion( op )) != LDAP_COMPARE_TRUE )) {
+                               rs->sr_err = LDAP_ASSERTION_FAILED;
+                               goto fail1;
+                       }
+
                        rs->sr_err = test_filter( op, entry, op->ors_filter );
 
                        if( rs->sr_err == LDAP_COMPARE_TRUE ) {
@@ -292,9 +298,9 @@ fe_op_search( Operation *op, SlapReply *rs )
                                rs->sr_entry = NULL;
                                rs->sr_operational_attrs = NULL;
                        }
-                       entry_free( entry );
-
                        rs->sr_err = LDAP_SUCCESS;
+fail1:
+                       entry_free( entry );
                        send_ldap_result( op, rs );
                        goto return_results;
                }