From: Howard Chu Date: Thu, 30 Dec 2010 17:28:19 +0000 (+0000) Subject: ITS#5862 Assert control for rootDSE/subschema X-Git-Tag: MIGRATION_CVS2GIT~325 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=97d9b07814397593c873ac055e933255606fee27;p=openldap ITS#5862 Assert control for rootDSE/subschema --- diff --git a/servers/slapd/search.c b/servers/slapd/search.c index 88e44e3c45..db434ff3ef 100644 --- a/servers/slapd/search.c +++ b/servers/slapd/search.c @@ -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; }