Diff for /servers/slapd/filter.c between versions 1.11.2.1 and 1.12

version 1.11.2.1, 1999/07/09 12:41:10 version 1.12, 1999/06/28 22:03:34
Line 52  get_filter( Connection *conn, BerElement Line 52  get_filter( Connection *conn, BerElement
         err = 0;          err = 0;
         *fstr = NULL;          *fstr = NULL;
         f->f_choice = ber_peek_tag( ber, &len );          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 ) {          switch ( f->f_choice ) {
         case LDAP_FILTER_EQUALITY:          case LDAP_FILTER_EQUALITY:
                 Debug( LDAP_DEBUG_FILTER, "EQUALITY\n", 0, 0, 0 );                  Debug( LDAP_DEBUG_FILTER, "EQUALITY\n", 0, 0, 0 );
Line 193  get_filter_list( Connection *conn, BerEl Line 175  get_filter_list( Connection *conn, BerEl
   
         Debug( LDAP_DEBUG_FILTER, "begin get_filter_list\n", 0, 0, 0 );          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;          *fstr = NULL;
         new = f;          new = f;
         for ( tag = ber_first_element( ber, &len, &last ); tag != LBER_DEFAULT;          for ( tag = ber_first_element( ber, &len, &last ); tag != LBER_DEFAULT;
Line 232  get_substring_filter( Line 209  get_substring_filter(
         ber_len_t       len;          ber_len_t       len;
         ber_tag_t       rc;          ber_tag_t       rc;
         char            *val, *last;          char            *val, *last;
           int             syntax;
   
         Debug( LDAP_DEBUG_FILTER, "begin get_substring_filter\n", 0, 0, 0 );          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 ) {          if ( ber_scanf( ber, "{a" /*}*/, &f->f_sub_type ) == LBER_ERROR ) {
                 return( LDAP_PROTOCOL_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_initial = NULL;
         f->f_sub_any = NULL;          f->f_sub_any = NULL;
         f->f_sub_final = NULL;          f->f_sub_final = NULL;
Line 251  get_substring_filter( Line 226  get_substring_filter(
         sprintf( *fstr, "(%s=", f->f_sub_type );          sprintf( *fstr, "(%s=", f->f_sub_type );
         for ( tag = ber_first_element( ber, &len, &last ); tag != LBER_DEFAULT;          for ( tag = ber_first_element( ber, &len, &last ); tag != LBER_DEFAULT;
             tag = ber_next_element( ber, &len, last ) ) {              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 );                          rc = ber_scanf( ber, "a", &val );
                 if ( rc == LBER_ERROR ) {                  if ( rc == LBER_ERROR ) {
                         return( LDAP_PROTOCOL_ERROR );                          return( LDAP_PROTOCOL_ERROR );
Line 266  get_substring_filter( Line 236  get_substring_filter(
                         }                          }
                         return( LDAP_INVALID_SYNTAX );                          return( LDAP_INVALID_SYNTAX );
                 }                  }
                   value_normalize( val, syntax );
   
                 switch ( tag ) {                  switch ( tag ) {
 #ifdef LDAP_COMPAT30  
                 case LDAP_SUBSTRING_INITIAL_30:  
 #endif  
                 case LDAP_SUBSTRING_INITIAL:                  case LDAP_SUBSTRING_INITIAL:
                         Debug( LDAP_DEBUG_FILTER, "  INITIAL\n", 0, 0, 0 );                          Debug( LDAP_DEBUG_FILTER, "  INITIAL\n", 0, 0, 0 );
                         if ( f->f_sub_initial != NULL ) {                          if ( f->f_sub_initial != NULL ) {
Line 282  get_substring_filter( Line 250  get_substring_filter(
                         strcat( *fstr, val );                          strcat( *fstr, val );
                         break;                          break;
   
 #ifdef LDAP_COMPAT30  
                 case LDAP_SUBSTRING_ANY_30:  
 #endif  
                 case LDAP_SUBSTRING_ANY:                  case LDAP_SUBSTRING_ANY:
                         Debug( LDAP_DEBUG_FILTER, "  ANY\n", 0, 0, 0 );                          Debug( LDAP_DEBUG_FILTER, "  ANY\n", 0, 0, 0 );
                         charray_add( &f->f_sub_any, val );                          charray_add( &f->f_sub_any, val );
Line 294  get_substring_filter( Line 259  get_substring_filter(
                         strcat( *fstr, val );                          strcat( *fstr, val );
                         break;                          break;
   
 #ifdef LDAP_COMPAT30  
                 case LDAP_SUBSTRING_FINAL_30:  
 #endif  
                 case LDAP_SUBSTRING_FINAL:                  case LDAP_SUBSTRING_FINAL:
                         Debug( LDAP_DEBUG_FILTER, "  FINAL\n", 0, 0, 0 );                          Debug( LDAP_DEBUG_FILTER, "  FINAL\n", 0, 0, 0 );
                         if ( f->f_sub_final != NULL ) {                          if ( f->f_sub_final != NULL ) {

Removed from v.1.11.2.1  
changed lines
  Added in v.1.12


______________
© Copyright 1998-2020, OpenLDAP Foundation, info@OpenLDAP.org