/* $OpenLDAP$ */
-/*
- * Copyright 1999-2003 The OpenLDAP Foundation.
+/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
+ *
+ * Copyright 1999-2004 The OpenLDAP Foundation.
* All rights reserved.
*
- * Redistribution and use in source and binary forms are permitted only
- * as authorized by the OpenLDAP Public License. A copy of this
- * license is available at http://www.OpenLDAP.org/license.html or
- * in file LICENSE in the top-level directory of the distribution.
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted only as authorized by the OpenLDAP
+ * Public License.
+ *
+ * A copy of this license is available in the file LICENSE in the
+ * top-level directory of the distribution or, alternatively, at
+ * <http://www.OpenLDAP.org/license.html>.
*/
+
#include "portable.h"
#include <stdio.h>
#include "slap.h"
-#include "../../libraries/liblber/lber-int.h"
-
static int
test_mra_vrFilter(
- Backend *be,
- Connection *conn,
Operation *op,
Attribute *a,
MatchingRuleAssertion *mra,
static int
test_substrings_vrFilter(
- Backend *be,
- Connection *conn,
Operation *op,
Attribute *a,
ValuesReturnFilter *f,
static int
test_presence_vrFilter(
- Backend *be,
- Connection *conn,
Operation *op,
Attribute *a,
AttributeDescription *desc,
static int
test_ava_vrFilter(
- Backend *be,
- Connection *conn,
Operation *op,
Attribute *a,
AttributeAssertion *ava,
int
filter_matched_values(
- Backend *be,
- Connection *conn,
Operation *op,
Attribute *a,
char ***e_flags
Debug( LDAP_DEBUG_FILTER, "=> filter_matched_values\n", 0, 0, 0 );
#endif
- for ( vrf = op->vrFilter; vrf != NULL; vrf = vrf->vrf_next ) {
+ for ( vrf = op->o_vrFilter; vrf != NULL; vrf = vrf->vrf_next ) {
switch ( vrf->vrf_choice ) {
case SLAPD_FILTER_COMPUTED:
#ifdef NEW_LOGGING
#else
Debug( LDAP_DEBUG_FILTER, " EQUALITY\n", 0, 0, 0 );
#endif
- rc = test_ava_vrFilter( be, conn, op, a, vrf->vrf_ava,
+ rc = test_ava_vrFilter( op, a, vrf->vrf_ava,
LDAP_FILTER_EQUALITY, e_flags );
if( rc == -1 ) {
return rc;
Debug( LDAP_DEBUG_FILTER, " SUBSTRINGS\n", 0, 0, 0 );
#endif
- rc = test_substrings_vrFilter( be, conn, op, a,
+ rc = test_substrings_vrFilter( op, a,
vrf, e_flags );
if( rc == -1 ) {
return rc;
#else
Debug( LDAP_DEBUG_FILTER, " PRESENT\n", 0, 0, 0 );
#endif
- rc = test_presence_vrFilter( be, conn, op, a,
+ rc = test_presence_vrFilter( op, a,
vrf->vrf_desc, e_flags );
if( rc == -1 ) {
return rc;
break;
case LDAP_FILTER_GE:
- rc = test_ava_vrFilter( be, conn, op, a, vrf->vrf_ava,
+ rc = test_ava_vrFilter( op, a, vrf->vrf_ava,
LDAP_FILTER_GE, e_flags );
if( rc == -1 ) {
return rc;
break;
case LDAP_FILTER_LE:
- rc = test_ava_vrFilter( be, conn, op, a, vrf->vrf_ava,
+ rc = test_ava_vrFilter( op, a, vrf->vrf_ava,
LDAP_FILTER_LE, e_flags );
if( rc == -1 ) {
return rc;
#else
Debug( LDAP_DEBUG_FILTER, " EXT\n", 0, 0, 0 );
#endif
- rc = test_mra_vrFilter( be, conn, op, a,
+ rc = test_mra_vrFilter( op, a,
vrf->vrf_mra, e_flags );
if( rc == -1 ) {
return rc;
static int
test_ava_vrFilter(
- Backend *be,
- Connection *conn,
Operation *op,
Attribute *a,
AttributeAssertion *ava,
case LDAP_FILTER_APPROX:
mr = a->a_desc->ad_type->sat_approx;
if( mr != NULL ) break;
+ /* use EQUALITY matching rule if no APPROX rule */
- /* use EQUALITY matching rule if no APPROX rule */
case LDAP_FILTER_EQUALITY:
mr = a->a_desc->ad_type->sat_equality;
break;
mr = NULL;
}
- if( mr == NULL ) {
- continue;
-
- }
+ if( mr == NULL ) continue;
-#ifdef SLAP_NVALUES
bv = a->a_nvals;
-#else
- bv = a->a_vals;
-#endif
for ( j=0; bv->bv_val != NULL; bv++, j++ ) {
int ret;
int rc;
static int
test_presence_vrFilter(
- Backend *be,
- Connection *conn,
Operation *op,
Attribute *a,
AttributeDescription *desc,
static int
test_substrings_vrFilter(
- Backend *be,
- Connection *conn,
Operation *op,
Attribute *a,
ValuesReturnFilter *vrf,
continue;
}
-#ifdef SLAP_NVALUES
bv = a->a_nvals;
-#else
- bv = a->a_vals;
-#endif
for ( j = 0; bv->bv_val != NULL; bv++, j++ ) {
int ret;
int rc;
static int
test_mra_vrFilter(
- Backend *be,
- Connection *conn,
Operation *op,
Attribute *a,
MatchingRuleAssertion *mra,
continue;
}
-#ifdef SLAP_NVALUES
rc = asserted_value_validate_normalize( a->a_desc, mra->ma_rule,
SLAP_MR_EXT|SLAP_MR_VALUE_OF_ASSERTION_SYNTAX,
- &mra->ma_value, &value, &text );
-#else
- /* normalize for equality */
- rc = value_validate_normalize( a->a_desc,
- SLAP_MR_EQUALITY,
- &mra->ma_value, &value,
- &text );
-#endif
+ &mra->ma_value, &value, &text, op->o_tmpmemctx );
if( rc != LDAP_SUCCESS ) continue;
}
-#ifdef SLAP_NVALUES
bv = a->a_nvals;
-#else
- bv = a->a_vals;
-#endif
for ( j = 0; bv->bv_val != NULL; bv++, j++ ) {
int ret;
int rc;