version 1.3, 1998/08/20 06:10:06
|
version 1.3.10.2, 1998/10/21 21:49:46
|
Line 1
|
Line 1
|
/* filter.c - routines for parsing and dealing with filters */ |
/* filter.c - routines for parsing and dealing with filters */ |
|
|
|
#include "portable.h" |
|
|
#include <stdio.h> |
#include <stdio.h> |
#include <string.h> |
|
#include <sys/types.h> |
#include <ac/socket.h> |
#include <sys/socket.h> |
#include <ac/string.h> |
|
|
#include "slap.h" |
#include "slap.h" |
|
|
static int get_filter_list(); |
static int get_filter_list(); |
Line 54 get_filter( Connection *conn, BerElement
|
Line 57 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 COMPAT30 |
#ifdef LDAP_COMPAT30 |
if ( conn->c_version == 30 ) { |
if ( conn->c_version == 30 ) { |
switch ( f->f_choice ) { |
switch ( f->f_choice ) { |
case LDAP_FILTER_EQUALITY: |
case LDAP_FILTER_EQUALITY: |
Line 192 get_filter_list( Connection *conn, BerEl
|
Line 195 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 COMPAT30 |
#ifdef LDAP_COMPAT30 |
if ( conn->c_version == 30 ) { |
if ( conn->c_version == 30 ) { |
(void) ber_skip_tag( ber, &len ); |
(void) ber_skip_tag( ber, &len ); |
} |
} |
Line 233 get_substring_filter(
|
Line 236 get_substring_filter(
|
|
|
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 COMPAT30 |
#ifdef LDAP_COMPAT30 |
if ( conn->c_version == 30 ) { |
if ( conn->c_version == 30 ) { |
(void) ber_skip_tag( ber, &len ); |
(void) ber_skip_tag( ber, &len ); |
} |
} |
Line 251 get_substring_filter(
|
Line 254 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 COMPAT30 |
#ifdef LDAP_COMPAT30 |
if ( conn->c_version == 30 ) { |
if ( conn->c_version == 30 ) { |
rc = ber_scanf( ber, "{a}", &val ); |
rc = ber_scanf( ber, "{a}", &val ); |
} else |
} else |
Line 269 get_substring_filter(
|
Line 272 get_substring_filter(
|
value_normalize( val, syntax ); |
value_normalize( val, syntax ); |
|
|
switch ( tag ) { |
switch ( tag ) { |
#ifdef COMPAT30 |
#ifdef LDAP_COMPAT30 |
case LDAP_SUBSTRING_INITIAL_30: |
case LDAP_SUBSTRING_INITIAL_30: |
#endif |
#endif |
case LDAP_SUBSTRING_INITIAL: |
case LDAP_SUBSTRING_INITIAL: |
Line 283 get_substring_filter(
|
Line 286 get_substring_filter(
|
strcat( *fstr, val ); |
strcat( *fstr, val ); |
break; |
break; |
|
|
#ifdef COMPAT30 |
#ifdef LDAP_COMPAT30 |
case LDAP_SUBSTRING_ANY_30: |
case LDAP_SUBSTRING_ANY_30: |
#endif |
#endif |
case LDAP_SUBSTRING_ANY: |
case LDAP_SUBSTRING_ANY: |
Line 295 get_substring_filter(
|
Line 298 get_substring_filter(
|
strcat( *fstr, val ); |
strcat( *fstr, val ); |
break; |
break; |
|
|
#ifdef COMPAT30 |
#ifdef LDAP_COMPAT30 |
case LDAP_SUBSTRING_FINAL_30: |
case LDAP_SUBSTRING_FINAL_30: |
#endif |
#endif |
case LDAP_SUBSTRING_FINAL: |
case LDAP_SUBSTRING_FINAL: |