Validate filter and compare inputs

This commit is contained in:
Kurt Zeilenga 2002-03-01 18:52:45 +00:00
parent a71cd15182
commit faa9956446
4 changed files with 14 additions and 4 deletions

View File

@ -63,7 +63,8 @@ get_ava(
return rc;
}
rc = value_normalize( aa->aa_desc, usage, &value, &aa->aa_value, text );
rc = value_validate_normalize( aa->aa_desc, usage,
&value, &aa->aa_value, text );
if( rc != LDAP_SUCCESS ) {
ch_free( aa );

View File

@ -136,7 +136,8 @@ do_compare(
goto cleanup;
}
rc = value_normalize( ava.aa_desc, SLAP_MR_EQUALITY, &value, &ava.aa_value, &text );
rc = value_validate_normalize( ava.aa_desc, SLAP_MR_EQUALITY,
&value, &ava.aa_value, &text );
if( rc != LDAP_SUCCESS ) {
send_ldap_result( conn, op, rc, NULL, text, NULL, NULL );
goto cleanup;

View File

@ -534,8 +534,15 @@ get_substring_filter(
goto return_error;
}
rc = value_normalize( f->f_sub_desc, usage, &value, &bv, text );
/* valiate using equality matching rule validator! */
rc = value_validate( f->f_sub_desc->ad_type->sat_equality,
&value, text );
if( rc != LDAP_SUCCESS ) {
goto return_error;
}
rc = value_normalize( f->f_sub_desc, usage,
&value, &bv, text );
if( rc != LDAP_SUCCESS ) {
goto return_error;
}

View File

@ -166,7 +166,8 @@ get_mra(
* OK, if no matching rule, normalize for equality, otherwise
* normalize for the matching rule.
*/
rc = value_normalize( ma->ma_desc, SLAP_MR_EQUALITY, &value, &ma->ma_value, text );
rc = value_validate_normalize( ma->ma_desc, SLAP_MR_EQUALITY,
&value, &ma->ma_value, text );
if( rc != LDAP_SUCCESS ) {
mra_free( ma, 1 );