version 1.38, 2000/05/17 18:08:13
|
version 1.39, 2000/05/17 18:29:26
|
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.37 2000/05/16 20:04:49 kurt Exp $ */ |
/* $OpenLDAP: pkg/ldap/servers/slapd/filter.c,v 1.38 2000/05/17 18:08:13 kurt Exp $ */ |
/* |
/* |
* Copyright 1998-2000 The OpenLDAP Foundation, All Rights Reserved. |
* Copyright 1998-2000 The OpenLDAP Foundation, All Rights Reserved. |
* COPYING RESTRICTIONS APPLY, see COPYRIGHT file |
* COPYING RESTRICTIONS APPLY, see COPYRIGHT file |
Line 429 get_substring_filter(
|
Line 429 get_substring_filter(
|
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 ) ) |
{ |
{ |
|
unsigned usage; |
|
|
rc = ber_scanf( ber, "O", &val ); |
rc = ber_scanf( ber, "O", &val ); |
if ( rc == LBER_ERROR ) { |
if ( rc == LBER_ERROR ) { |
rc = SLAPD_DISCONNECT; |
rc = SLAPD_DISCONNECT; |
Line 441 get_substring_filter(
|
Line 443 get_substring_filter(
|
goto return_error; |
goto return_error; |
} |
} |
|
|
rc = LDAP_PROTOCOL_ERROR; |
#ifdef SLAPD_SCHEMA_NOT_COMPAT |
|
switch ( tag ) { |
|
case LDAP_SUBSTRING_INITIAL: |
|
usage = SLAP_MR_SUBSTR_INITIAL; |
|
break; |
|
|
|
case LDAP_SUBSTRING_ANY: |
|
usage = SLAP_MR_SUBSTR_ANY; |
|
break; |
|
|
|
case LDAP_SUBSTRING_FINAL: |
|
usage = SLAP_MR_SUBSTR_FINAL; |
|
break; |
|
|
|
default: |
|
rc = LDAP_PROTOCOL_ERROR; |
|
|
|
Debug( LDAP_DEBUG_FILTER, |
|
" unknown substring choice=%ld\n", |
|
(long) tag, 0, 0 ); |
|
|
|
ber_bvfree( val ); |
|
goto return_error; |
|
} |
|
|
|
rc = value_normalize( f->f_sub_desc, usage, val, text ); |
|
|
|
if( rc != LDAP_SUCCESS ) { |
|
ber_bvfree( val ); |
|
goto return_error; |
|
} |
|
#else |
|
|
#ifndef SLAPD_SCHEMA_NOT_COMPAT |
|
/* we should call a substring syntax normalization routine */ |
/* we should call a substring syntax normalization routine */ |
value_normalize( val->bv_val, syntax ); |
value_normalize( val->bv_val, syntax ); |
/* this is bogus, value_normalize should take a berval */ |
/* this is bogus, value_normalize should take a berval */ |
val->bv_len = strlen( val->bv_val ); |
val->bv_len = strlen( val->bv_val ); |
#endif |
#endif |
|
|
|
rc = LDAP_PROTOCOL_ERROR; |
|
|
switch ( tag ) { |
switch ( tag ) { |
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 ); |
Line 457 get_substring_filter(
|
Line 491 get_substring_filter(
|
ber_bvfree( val ); |
ber_bvfree( val ); |
goto return_error; |
goto return_error; |
} |
} |
|
|
|
|
f->f_sub_initial = val; |
f->f_sub_initial = val; |
|
|
if( fstr ) { |
if( fstr ) { |