version 1.72.2.5, 2002/08/30 01:06:18
|
version 1.72.2.6, 2002/09/01 04:01:22
|
Line 1
|
Line 1
|
/* filter.c - routines for parsing and dealing with filters */ |
/* filter.c - routines for parsing and dealing with filters */ |
/* $OpenLDAP: pkg/ldap/servers/slapd/filter.c,v 1.72.2.4 2002/07/28 19:17:36 kurt Exp $ */ |
/* $OpenLDAP: pkg/ldap/servers/slapd/filter.c,v 1.72.2.5 2002/08/30 01:06:18 kurt Exp $ */ |
/* |
/* |
* Copyright 1998-2002 The OpenLDAP Foundation, All Rights Reserved. |
* Copyright 1998-2002 The OpenLDAP Foundation, All Rights Reserved. |
* COPYING RESTRICTIONS APPLY, see COPYRIGHT file |
* COPYING RESTRICTIONS APPLY, see COPYRIGHT file |
Line 70 get_filter(
|
Line 70 get_filter(
|
* lessOrEqual [6] AttributeValueAssertion, |
* lessOrEqual [6] AttributeValueAssertion, |
* present [7] AttributeType,, |
* present [7] AttributeType,, |
* approxMatch [8] AttributeValueAssertion |
* approxMatch [8] AttributeValueAssertion |
* extensibleMatch [9] MatchingRuleAssertion |
* extensibleMatch [9] MatchingRuleAssertion |
* } |
* } |
* |
* |
* SubstringFilter ::= SEQUENCE { |
* SubstringFilter ::= SEQUENCE { |
Line 742 filter2bv( Filter *f, struct berval *fst
|
Line 742 filter2bv( Filter *f, struct berval *fst
|
|
|
break; |
break; |
|
|
case LDAP_FILTER_EXT: |
case LDAP_FILTER_EXT: { |
filter_escape_value( &f->f_mr_value, &tmp ); |
|
#ifndef SLAP_X_MRA_MATCH_DNATTRS |
|
fstr->bv_len = f->f_mr_desc->ad_cname.bv_len + |
|
( f->f_mr_dnattrs ? sizeof(":dn")-1 : 0 ) + |
|
( f->f_mr_rule_text.bv_len ? f->f_mr_rule_text.bv_len+1 : 0 ) + |
|
tmp.bv_len + ( sizeof("(:=)") - 1 ); |
|
fstr->bv_val = malloc( fstr->bv_len + 1 ); |
|
|
|
snprintf( fstr->bv_val, fstr->bv_len + 1, "(%s%s%s%s:=%s)", |
|
f->f_mr_desc->ad_cname.bv_val, |
|
f->f_mr_dnattrs ? ":dn" : "", |
|
f->f_mr_rule_text.bv_len ? ":" : "", |
|
f->f_mr_rule_text.bv_len ? f->f_mr_rule_text.bv_val : "", |
|
tmp.bv_val ); |
|
#else /* SLAP_X_MRA_MATCH_DNATTRS */ |
|
{ |
|
struct berval ad; |
struct berval ad; |
|
filter_escape_value( &f->f_mr_value, &tmp ); |
|
|
if ( f->f_mr_desc ) { |
if ( f->f_mr_desc ) { |
ad = f->f_mr_desc->ad_cname; |
ad = f->f_mr_desc->ad_cname; |
Line 780 filter2bv( Filter *f, struct berval *fst
|
Line 765 filter2bv( Filter *f, struct berval *fst
|
f->f_mr_rule_text.bv_len ? ":" : "", |
f->f_mr_rule_text.bv_len ? ":" : "", |
f->f_mr_rule_text.bv_len ? f->f_mr_rule_text.bv_val : "", |
f->f_mr_rule_text.bv_len ? f->f_mr_rule_text.bv_val : "", |
tmp.bv_val ); |
tmp.bv_val ); |
} |
|
#endif /* SLAP_X_MRA_MATCH_DNATTRS */ |
|
ber_memfree( tmp.bv_val ); |
ber_memfree( tmp.bv_val ); |
break; |
} break; |
|
|
case SLAPD_FILTER_COMPUTED: |
case SLAPD_FILTER_COMPUTED: |
ber_str2bv( |
ber_str2bv( |
Line 1308 simple_vrFilter2bv( ValuesReturnFilter *
|
Line 1291 simple_vrFilter2bv( ValuesReturnFilter *
|
f->f_desc->ad_cname.bv_val ); |
f->f_desc->ad_cname.bv_val ); |
break; |
break; |
|
|
case LDAP_FILTER_EXT: |
case LDAP_FILTER_EXT: { |
filter_escape_value( &f->f_mr_value, &tmp ); |
|
|
|
#ifndef SLAP_X_MRA_MATCH_DNATTRS |
|
fstr->bv_len = f->f_mr_desc->ad_cname.bv_len + |
|
( f->f_mr_dnattrs ? sizeof(":dn")-1 : 0 ) + |
|
( f->f_mr_rule_text.bv_len ? f->f_mr_rule_text.bv_len+1 : 0 ) + |
|
tmp.bv_len + ( sizeof("(:=)") - 1 ); |
|
fstr->bv_val = malloc( fstr->bv_len + 1 ); |
|
|
|
snprintf( fstr->bv_val, fstr->bv_len + 1, "(%s%s%s%s:=%s)", |
|
f->f_mr_desc->ad_cname.bv_val, |
|
f->f_mr_dnattrs ? ":dn" : "", |
|
f->f_mr_rule_text.bv_len ? ":" : "", |
|
f->f_mr_rule_text.bv_len ? f->f_mr_rule_text.bv_val : "", |
|
tmp.bv_val ); |
|
#else /* SLAP_X_MRA_MATCH_DNATTRS */ |
|
{ |
|
struct berval ad; |
struct berval ad; |
|
filter_escape_value( &f->f_mr_value, &tmp ); |
|
|
if ( f->f_mr_desc ) { |
if ( f->f_mr_desc ) { |
ad = f->f_mr_desc->ad_cname; |
ad = f->f_mr_desc->ad_cname; |
Line 1347 simple_vrFilter2bv( ValuesReturnFilter *
|
Line 1314 simple_vrFilter2bv( ValuesReturnFilter *
|
f->f_mr_rule_text.bv_len ? ":" : "", |
f->f_mr_rule_text.bv_len ? ":" : "", |
f->f_mr_rule_text.bv_len ? f->f_mr_rule_text.bv_val : "", |
f->f_mr_rule_text.bv_len ? f->f_mr_rule_text.bv_val : "", |
tmp.bv_val ); |
tmp.bv_val ); |
} |
|
#endif /* SLAP_X_MRA_MATCH_DNATTRS */ |
|
|
|
ber_memfree( tmp.bv_val ); |
ber_memfree( tmp.bv_val ); |
break; |
} break; |
|
|
case SLAPD_FILTER_COMPUTED: |
case SLAPD_FILTER_COMPUTED: |
ber_str2bv( |
ber_str2bv( |