version 1.69, 2002/01/04 20:17:46
|
version 1.70, 2002/01/06 05:11:01
|
Line 1
|
Line 1
|
/* filter.c - routines for parsing and dealing with filters */ |
/* filter.c - routines for parsing and dealing with filters */ |
/* $OpenLDAP: pkg/ldap/servers/slapd/filter.c,v 1.68 2001/12/31 05:44:36 hyc Exp $ */ |
/* $OpenLDAP: pkg/ldap/servers/slapd/filter.c,v 1.69 2002/01/04 20:17:46 kurt Exp $ */ |
/* |
/* |
* Copyright 1998-2002 The OpenLDAP Foundation, All Rights Reserved. |
* Copyright 1998-2002 The OpenLDAP Foundation, All Rights Reserved. |
* COPYING RESTRICTIONS APPLY, see COPYRIGHT file |
* COPYING RESTRICTIONS APPLY, see COPYRIGHT file |
Line 204 get_filter(
|
Line 204 get_filter(
|
#else |
#else |
Debug( LDAP_DEBUG_FILTER, "PRESENT\n", 0, 0, 0 ); |
Debug( LDAP_DEBUG_FILTER, "PRESENT\n", 0, 0, 0 ); |
#endif |
#endif |
if ( ber_scanf( ber, "o", &type ) == LBER_ERROR ) { |
if ( ber_scanf( ber, "m", &type ) == LBER_ERROR ) { |
err = SLAPD_DISCONNECT; |
err = SLAPD_DISCONNECT; |
*text = "error decoding filter"; |
*text = "error decoding filter"; |
break; |
break; |
Line 219 get_filter(
|
Line 219 get_filter(
|
f->f_result = LDAP_COMPARE_FALSE; |
f->f_result = LDAP_COMPARE_FALSE; |
ber_str2bv("(unrecognized=*)", |
ber_str2bv("(unrecognized=*)", |
sizeof("(unrecognized=*)")-1, 1, fstr); |
sizeof("(unrecognized=*)")-1, 1, fstr); |
ch_free( type.bv_val ); |
|
err = LDAP_SUCCESS; |
err = LDAP_SUCCESS; |
break; |
break; |
} |
} |
|
|
ch_free( type.bv_val ); |
|
|
|
fstr->bv_len = sizeof("(=*)") - 1 |
fstr->bv_len = sizeof("(=*)") - 1 |
+ f->f_desc->ad_cname.bv_len; |
+ f->f_desc->ad_cname.bv_len; |
fstr->bv_val = ch_malloc( fstr->bv_len + 1); |
fstr->bv_val = ch_malloc( fstr->bv_len + 1); |
Line 467 get_substring_filter(
|
Line 464 get_substring_filter(
|
#else |
#else |
Debug( LDAP_DEBUG_FILTER, "begin get_substring_filter\n", 0, 0, 0 ); |
Debug( LDAP_DEBUG_FILTER, "begin get_substring_filter\n", 0, 0, 0 ); |
#endif |
#endif |
if ( ber_scanf( ber, "{o" /*}*/, &bv ) == LBER_ERROR ) { |
if ( ber_scanf( ber, "{m" /*}*/, &bv ) == LBER_ERROR ) { |
return SLAPD_DISCONNECT; |
return SLAPD_DISCONNECT; |
} |
} |
|
|
Line 475 get_substring_filter(
|
Line 472 get_substring_filter(
|
f->f_sub_desc = NULL; |
f->f_sub_desc = NULL; |
rc = slap_bv2ad( &bv, &f->f_sub_desc, text ); |
rc = slap_bv2ad( &bv, &f->f_sub_desc, text ); |
|
|
ch_free( bv.bv_val ); |
|
|
|
if( rc != LDAP_SUCCESS ) { |
if( rc != LDAP_SUCCESS ) { |
text = NULL; |
text = NULL; |
ch_free( f->f_sub ); |
ch_free( f->f_sub ); |
Line 500 get_substring_filter(
|
Line 495 get_substring_filter(
|
{ |
{ |
unsigned usage; |
unsigned usage; |
|
|
rc = ber_scanf( ber, "o", &value ); |
rc = ber_scanf( ber, "m", &value ); |
if ( rc == LBER_ERROR ) { |
if ( rc == LBER_ERROR ) { |
rc = SLAPD_DISCONNECT; |
rc = SLAPD_DISCONNECT; |
goto return_error; |
goto return_error; |
Line 536 get_substring_filter(
|
Line 531 get_substring_filter(
|
" unknown substring choice=%ld\n", |
" unknown substring choice=%ld\n", |
(long) tag, 0, 0 ); |
(long) tag, 0, 0 ); |
#endif |
#endif |
free( value.bv_val ); |
|
goto return_error; |
goto return_error; |
} |
} |
|
|
rc = value_normalize( f->f_sub_desc, usage, &value, &bv, text ); |
rc = value_normalize( f->f_sub_desc, usage, &value, &bv, text ); |
free( value.bv_val ); |
|
|
|
if( rc != LDAP_SUCCESS ) { |
if( rc != LDAP_SUCCESS ) { |
goto return_error; |
goto return_error; |