Filter *f,
const char **text );
-static int filter_escape_value(
- struct berval *in,
- struct berval *out );
-
static void simple_vrFilter2bv(
ValuesReturnFilter *f,
struct berval *fstr );
}
#ifdef SLAP_NVALUES
- /* validate using equality matching rule validator! */
+ /* validate/normalize using equality matching rule validator! */
rc = asserted_value_validate_normalize(
- f->f_sub_desc, f->f_sub_desc->ad_type->sat_substr,
+ f->f_sub_desc, f->f_sub_desc->ad_type->sat_equality,
usage, &value, &bv, text );
if( rc != LDAP_SUCCESS ) {
goto return_error;
fstr->bv_len = f->f_av_desc->ad_cname.bv_len +
tmp.bv_len + ( sizeof("(=)") - 1 );
- fstr->bv_val = malloc( fstr->bv_len + 1 );
+ fstr->bv_val = ch_malloc( fstr->bv_len + 1 );
snprintf( fstr->bv_val, fstr->bv_len + 1, "(%s=%s)",
f->f_av_desc->ad_cname.bv_val,
fstr->bv_len = f->f_av_desc->ad_cname.bv_len +
tmp.bv_len + ( sizeof("(>=)") - 1 );
- fstr->bv_val = malloc( fstr->bv_len + 1 );
+ fstr->bv_val = ch_malloc( fstr->bv_len + 1 );
snprintf( fstr->bv_val, fstr->bv_len + 1, "(%s>=%s)",
f->f_av_desc->ad_cname.bv_val,
fstr->bv_len = f->f_av_desc->ad_cname.bv_len +
tmp.bv_len + ( sizeof("(<=)") - 1 );
- fstr->bv_val = malloc( fstr->bv_len + 1 );
+ fstr->bv_val = ch_malloc( fstr->bv_len + 1 );
snprintf( fstr->bv_val, fstr->bv_len + 1, "(%s<=%s)",
f->f_av_desc->ad_cname.bv_val,
fstr->bv_len = f->f_av_desc->ad_cname.bv_len +
tmp.bv_len + ( sizeof("(~=)") - 1 );
- fstr->bv_val = malloc( fstr->bv_len + 1 );
+ fstr->bv_val = ch_malloc( fstr->bv_len + 1 );
snprintf( fstr->bv_val, fstr->bv_len + 1, "(%s~=%s)",
f->f_av_desc->ad_cname.bv_val,
case LDAP_FILTER_SUBSTRINGS:
fstr->bv_len = f->f_sub_desc->ad_cname.bv_len +
( sizeof("(=*)") - 1 );
- fstr->bv_val = malloc( fstr->bv_len + 128 );
+ fstr->bv_val = ch_malloc( fstr->bv_len + 128 );
snprintf( fstr->bv_val, fstr->bv_len + 1, "(%s=*)",
f->f_sub_desc->ad_cname.bv_val );
case LDAP_FILTER_PRESENT:
fstr->bv_len = f->f_desc->ad_cname.bv_len +
( sizeof("(=*)") - 1 );
- fstr->bv_val = malloc( fstr->bv_len + 1 );
+ fstr->bv_val = ch_malloc( fstr->bv_len + 1 );
snprintf( fstr->bv_val, fstr->bv_len + 1, "(%s=*)",
f->f_desc->ad_cname.bv_val );
case LDAP_FILTER_OR:
case LDAP_FILTER_NOT:
fstr->bv_len = sizeof("(%)") - 1;
- fstr->bv_val = malloc( fstr->bv_len + 128 );
+ fstr->bv_val = ch_malloc( fstr->bv_len + 128 );
snprintf( fstr->bv_val, fstr->bv_len + 1, "(%c)",
f->f_choice == LDAP_FILTER_AND ? '&' :
( 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 );
+ fstr->bv_val = ch_malloc( fstr->bv_len + 1 );
snprintf( fstr->bv_val, fstr->bv_len + 1, "(%s%s%s%s:=%s)",
ad.bv_val,
}
}
-static int filter_escape_value(
+int
+filter_escape_value(
struct berval *in,
struct berval *out )
{
}
fstr->bv_len = sizeof("()") - 1;
- fstr->bv_val = malloc( fstr->bv_len + 128 );
+ fstr->bv_val = ch_malloc( fstr->bv_len + 128 );
snprintf( fstr->bv_val, fstr->bv_len + 1, "()");
fstr->bv_len = vrf->vrf_av_desc->ad_cname.bv_len +
tmp.bv_len + ( sizeof("(=)") - 1 );
- fstr->bv_val = malloc( fstr->bv_len + 1 );
+ fstr->bv_val = ch_malloc( fstr->bv_len + 1 );
snprintf( fstr->bv_val, fstr->bv_len + 1, "(%s=%s)",
vrf->vrf_av_desc->ad_cname.bv_val,
fstr->bv_len = vrf->vrf_av_desc->ad_cname.bv_len +
tmp.bv_len + ( sizeof("(>=)") - 1 );
- fstr->bv_val = malloc( fstr->bv_len + 1 );
+ fstr->bv_val = ch_malloc( fstr->bv_len + 1 );
snprintf( fstr->bv_val, fstr->bv_len + 1, "(%s>=%s)",
vrf->vrf_av_desc->ad_cname.bv_val,
fstr->bv_len = vrf->vrf_av_desc->ad_cname.bv_len +
tmp.bv_len + ( sizeof("(<=)") - 1 );
- fstr->bv_val = malloc( fstr->bv_len + 1 );
+ fstr->bv_val = ch_malloc( fstr->bv_len + 1 );
snprintf( fstr->bv_val, fstr->bv_len + 1, "(%s<=%s)",
vrf->vrf_av_desc->ad_cname.bv_val,
fstr->bv_len = vrf->vrf_av_desc->ad_cname.bv_len +
tmp.bv_len + ( sizeof("(~=)") - 1 );
- fstr->bv_val = malloc( fstr->bv_len + 1 );
+ fstr->bv_val = ch_malloc( fstr->bv_len + 1 );
snprintf( fstr->bv_val, fstr->bv_len + 1, "(%s~=%s)",
vrf->vrf_av_desc->ad_cname.bv_val,
case LDAP_FILTER_SUBSTRINGS:
fstr->bv_len = vrf->vrf_sub_desc->ad_cname.bv_len +
( sizeof("(=*)") - 1 );
- fstr->bv_val = malloc( fstr->bv_len + 128 );
+ fstr->bv_val = ch_malloc( fstr->bv_len + 128 );
snprintf( fstr->bv_val, fstr->bv_len + 1, "(%s=*)",
vrf->vrf_sub_desc->ad_cname.bv_val );
case LDAP_FILTER_PRESENT:
fstr->bv_len = vrf->vrf_desc->ad_cname.bv_len +
( sizeof("(=*)") - 1 );
- fstr->bv_val = malloc( fstr->bv_len + 1 );
+ fstr->bv_val = ch_malloc( fstr->bv_len + 1 );
snprintf( fstr->bv_val, fstr->bv_len + 1, "(%s=*)",
vrf->vrf_desc->ad_cname.bv_val );
( vrf->vrf_mr_dnattrs ? sizeof(":dn")-1 : 0 ) +
( vrf->vrf_mr_rule_text.bv_len ? vrf->vrf_mr_rule_text.bv_len+1 : 0 ) +
tmp.bv_len + ( sizeof("(:=)") - 1 );
- fstr->bv_val = malloc( fstr->bv_len + 1 );
+ fstr->bv_val = ch_malloc( fstr->bv_len + 1 );
snprintf( fstr->bv_val, fstr->bv_len + 1, "(%s%s%s%s:=%s)",
ad.bv_val,
}
#ifdef SLAP_NVALUES
- /* validate using equality matching rule validator! */
+ /* validate/normalize using equality matching rule validator! */
rc = asserted_value_validate_normalize(
- vrf->vrf_sub_desc, vrf->vrf_sub_desc->ad_type->sat_substr,
+ vrf->vrf_sub_desc, vrf->vrf_sub_desc->ad_type->sat_equality,
usage, &value, &bv, text );
if( rc != LDAP_SUCCESS ) {
goto return_error;