]> git.sur5r.net Git - openldap/commitdiff
Validate filter and compare inputs
authorKurt Zeilenga <kurt@openldap.org>
Fri, 1 Mar 2002 18:52:45 +0000 (18:52 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Fri, 1 Mar 2002 18:52:45 +0000 (18:52 +0000)
servers/slapd/ava.c
servers/slapd/compare.c
servers/slapd/filter.c
servers/slapd/mra.c

index c9c2c1fee9bf9e95a9e22daf1a09dbe8f96f1c0c..72ddab449c762e0e24af56a6968cc104458f989b 100644 (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 );
index 91cf820c37d023e6bbf43070537b13484fa9ed67..87a88e4886c107b8e3a295d79660b60db3cec6c9 100644 (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;
index b456d71966fbed557f2efc19f40c484ed429dea5..3e9d764ab7d94b17bb24429ea28ff9f030323959 100644 (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;
                }
index 87b4a47dda779fc9b6fd5d655690eeae8a9ea171..0223e44704764d5108e56a61718714554ff11057 100644 (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 );