filter_escape_value( f->f_av_value, &escaped );
*fstr = ch_malloc( sizeof("(=)")
- + f->f_av_desc->ad_cname->bv_len
+ + f->f_av_desc->ad_cname.bv_len
+ escaped.bv_len );
sprintf( *fstr, "(%s=%s)",
- f->f_av_desc->ad_cname->bv_val,
+ f->f_av_desc->ad_cname.bv_val,
escaped.bv_val );
ber_memfree( escaped.bv_val );
filter_escape_value( f->f_av_value, &escaped );
*fstr = ch_malloc( sizeof("(>=)")
- + f->f_av_desc->ad_cname->bv_len
+ + f->f_av_desc->ad_cname.bv_len
+ escaped.bv_len );
sprintf( *fstr, "(%s>=%s)",
- f->f_av_desc->ad_cname->bv_val,
+ f->f_av_desc->ad_cname.bv_val,
escaped.bv_val );
ber_memfree( escaped.bv_val );
filter_escape_value( f->f_av_value, &escaped );
*fstr = ch_malloc( sizeof("(<=)")
- + f->f_av_desc->ad_cname->bv_len
+ + f->f_av_desc->ad_cname.bv_len
+ escaped.bv_len );
sprintf( *fstr, "(%s<=%s)",
- f->f_av_desc->ad_cname->bv_val,
+ f->f_av_desc->ad_cname.bv_val,
escaped.bv_val );
ber_memfree( escaped.bv_val );
ch_free( type.bv_val );
*fstr = ch_malloc( sizeof("(=*)")
- + f->f_desc->ad_cname->bv_len );
+ + f->f_desc->ad_cname.bv_len );
sprintf( *fstr, "(%s=*)",
- f->f_desc->ad_cname->bv_val );
+ f->f_desc->ad_cname.bv_val );
} break;
filter_escape_value( f->f_av_value, &escaped );
*fstr = ch_malloc( sizeof("(~=)")
- + f->f_av_desc->ad_cname->bv_len
+ + f->f_av_desc->ad_cname.bv_len
+ escaped.bv_len );
sprintf( *fstr, "(%s~=%s)",
- f->f_av_desc->ad_cname->bv_val,
+ f->f_av_desc->ad_cname.bv_val,
escaped.bv_val );
ber_memfree( escaped.bv_val );
filter_escape_value( f->f_mr_value, &escaped );
*fstr = ch_malloc( sizeof("(:dn::=)")
- + (f->f_mr_desc ? f->f_mr_desc->ad_cname->bv_len : 0)
+ + (f->f_mr_desc ? f->f_mr_desc->ad_cname.bv_len : 0)
+ (f->f_mr_rule_text ? strlen(f->f_mr_rule_text) : 0)
+ escaped.bv_len );
sprintf( *fstr, "(%s%s%s%s:=%s)",
- (f->f_mr_desc ? f->f_mr_desc->ad_cname->bv_val : ""),
+ (f->f_mr_desc ? f->f_mr_desc->ad_cname.bv_val : ""),
(f->f_mr_dnattrs ? ":dn" : ""),
(f->f_mr_rule_text ? ":" : ""),
(f->f_mr_rule_text ? f->f_mr_rule_text : ""),
break;
default:
- (void) ber_skip_tag( ber, &len );
+ (void) ber_scanf( ber, "x" ); /* skip the element */
#ifdef NEW_LOGGING
LDAP_LOG(( "filter", LDAP_LEVEL_ERR,
"get_filter: conn %d unknown filter type=%lu\n",
if( fstr ) {
*fstr = ch_malloc( sizeof("(=" /*)*/) +
- f->f_sub_desc->ad_cname->bv_len );
- sprintf( *fstr, "(%s=" /*)*/, f->f_sub_desc->ad_cname->bv_val );
+ f->f_sub_desc->ad_cname.bv_len );
+ sprintf( *fstr, "(%s=" /*)*/, f->f_sub_desc->ad_cname.bv_val );
}
for ( tag = ber_first_element( ber, &len, &last ); tag != LBER_DEFAULT;
#else
Debug( LDAP_DEBUG_FILTER, " INITIAL\n", 0, 0, 0 );
#endif
- if ( f->f_sub_initial != NULL ) {
+
+ if ( f->f_sub_initial != NULL
+ || f->f_sub_any != NULL
+ || f->f_sub_final != NULL )
+ {
ber_bvfree( value );
goto return_error;
}
#else
Debug( LDAP_DEBUG_FILTER, " ANY\n", 0, 0, 0 );
#endif
+
+ if ( f->f_sub_final != NULL ) {
+ ber_bvfree( value );
+ goto return_error;
+ }
+
if( ber_bvecadd( &f->f_sub_any, value ) < 0 ) {
ber_bvfree( value );
goto return_error;
#else
Debug( LDAP_DEBUG_FILTER, " FINAL\n", 0, 0, 0 );
#endif
+
if ( f->f_sub_final != NULL ) {
ber_bvfree( value );
goto return_error;
}
+
f->f_sub_final = value;
if( fstr ) {
*fstr = NULL;
}
- ad_free( f->f_sub_desc, 1 );
ber_bvfree( f->f_sub_initial );
ber_bvecfree( f->f_sub_any );
ber_bvfree( f->f_sub_final );
switch ( f->f_choice ) {
case LDAP_FILTER_PRESENT:
- ad_free( f->f_desc, 1 );
break;
case LDAP_FILTER_EQUALITY:
break;
case LDAP_FILTER_SUBSTRINGS:
- ad_free( f->f_sub_desc, 1 );
if ( f->f_sub_initial != NULL ) {
ber_bvfree( f->f_sub_initial );
}
if ( f->f_sub_final != NULL ) {
ber_bvfree( f->f_sub_final );
}
+ ch_free( f->f_sub );
break;
case LDAP_FILTER_AND:
case LDAP_FILTER_EQUALITY:
filter_escape_value( f->f_av_value, &escaped );
fprintf( stderr, "(%s=%s)",
- f->f_av_desc->ad_cname->bv_val,
+ f->f_av_desc->ad_cname.bv_val,
escaped.bv_val );
ber_memfree( escaped.bv_val );
break;
case LDAP_FILTER_GE:
filter_escape_value( f->f_av_value, &escaped );
fprintf( stderr, "(%s>=%s)",
- f->f_av_desc->ad_cname->bv_val,
+ f->f_av_desc->ad_cname.bv_val,
escaped.bv_val );
ber_memfree( escaped.bv_val );
break;
case LDAP_FILTER_LE:
filter_escape_value( f->f_av_value, &escaped );
fprintf( stderr, "(%s<=%s)",
- f->f_ava->aa_desc->ad_cname->bv_val,
+ f->f_ava->aa_desc->ad_cname.bv_val,
escaped.bv_val );
ber_memfree( escaped.bv_val );
break;
case LDAP_FILTER_APPROX:
filter_escape_value( f->f_av_value, &escaped );
fprintf( stderr, "(%s~=%s)",
- f->f_ava->aa_desc->ad_cname->bv_val,
+ f->f_ava->aa_desc->ad_cname.bv_val,
escaped.bv_val );
ber_memfree( escaped.bv_val );
break;
case LDAP_FILTER_SUBSTRINGS:
fprintf( stderr, "(%s=" /*)*/,
- f->f_sub_desc->ad_cname->bv_val );
+ f->f_sub_desc->ad_cname.bv_val );
if ( f->f_sub_initial != NULL ) {
filter_escape_value( f->f_sub_initial, &escaped );
fprintf( stderr, "%s",
case LDAP_FILTER_PRESENT:
fprintf( stderr, "(%s=*)",
- f->f_desc->ad_cname->bv_val );
+ f->f_desc->ad_cname.bv_val );
break;
case LDAP_FILTER_AND: