--- servers/slapd/filter.c 1999/07/09 12:41:10 1.11.2.1 +++ servers/slapd/filter.c 1999/06/28 22:03:34 1.12 @@ -52,25 +52,7 @@ get_filter( Connection *conn, BerElement err = 0; *fstr = NULL; f->f_choice = ber_peek_tag( ber, &len ); -#ifdef LDAP_COMPAT30 - if ( conn->c_version == 30 ) { - switch ( f->f_choice ) { - case LDAP_FILTER_EQUALITY: - case LDAP_FILTER_GE: - case LDAP_FILTER_LE: - case LDAP_FILTER_PRESENT: - case LDAP_FILTER_PRESENT_30: - case LDAP_FILTER_APPROX: - (void) ber_skip_tag( ber, &len ); - if ( f->f_choice == LDAP_FILTER_PRESENT_30 ) { - f->f_choice = LDAP_FILTER_PRESENT; - } - break; - default: - break; - } - } -#endif + switch ( f->f_choice ) { case LDAP_FILTER_EQUALITY: Debug( LDAP_DEBUG_FILTER, "EQUALITY\n", 0, 0, 0 ); @@ -193,11 +175,6 @@ get_filter_list( Connection *conn, BerEl Debug( LDAP_DEBUG_FILTER, "begin get_filter_list\n", 0, 0, 0 ); -#ifdef LDAP_COMPAT30 - if ( conn->c_version == 30 ) { - (void) ber_skip_tag( ber, &len ); - } -#endif *fstr = NULL; new = f; for ( tag = ber_first_element( ber, &len, &last ); tag != LBER_DEFAULT; @@ -232,17 +209,15 @@ get_substring_filter( ber_len_t len; ber_tag_t rc; char *val, *last; + int syntax; Debug( LDAP_DEBUG_FILTER, "begin get_substring_filter\n", 0, 0, 0 ); -#ifdef LDAP_COMPAT30 - if ( conn->c_version == 30 ) { - (void) ber_skip_tag( ber, &len ); - } -#endif if ( ber_scanf( ber, "{a" /*}*/, &f->f_sub_type ) == LBER_ERROR ) { return( LDAP_PROTOCOL_ERROR ); } + attr_normalize( f->f_sub_type ); + syntax = attr_syntax( f->f_sub_type ); f->f_sub_initial = NULL; f->f_sub_any = NULL; f->f_sub_final = NULL; @@ -251,11 +226,6 @@ get_substring_filter( sprintf( *fstr, "(%s=", f->f_sub_type ); for ( tag = ber_first_element( ber, &len, &last ); tag != LBER_DEFAULT; tag = ber_next_element( ber, &len, last ) ) { -#ifdef LDAP_COMPAT30 - if ( conn->c_version == 30 ) { - rc = ber_scanf( ber, "{a}", &val ); - } else -#endif rc = ber_scanf( ber, "a", &val ); if ( rc == LBER_ERROR ) { return( LDAP_PROTOCOL_ERROR ); @@ -266,11 +236,9 @@ get_substring_filter( } return( LDAP_INVALID_SYNTAX ); } + value_normalize( val, syntax ); switch ( tag ) { -#ifdef LDAP_COMPAT30 - case LDAP_SUBSTRING_INITIAL_30: -#endif case LDAP_SUBSTRING_INITIAL: Debug( LDAP_DEBUG_FILTER, " INITIAL\n", 0, 0, 0 ); if ( f->f_sub_initial != NULL ) { @@ -282,9 +250,6 @@ get_substring_filter( strcat( *fstr, val ); break; -#ifdef LDAP_COMPAT30 - case LDAP_SUBSTRING_ANY_30: -#endif case LDAP_SUBSTRING_ANY: Debug( LDAP_DEBUG_FILTER, " ANY\n", 0, 0, 0 ); charray_add( &f->f_sub_any, val ); @@ -294,9 +259,6 @@ get_substring_filter( strcat( *fstr, val ); break; -#ifdef LDAP_COMPAT30 - case LDAP_SUBSTRING_FINAL_30: -#endif case LDAP_SUBSTRING_FINAL: Debug( LDAP_DEBUG_FILTER, " FINAL\n", 0, 0, 0 ); if ( f->f_sub_final != NULL ) {