From ef6ee899cbe80f72f185cd6d2d830356157a15cd Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Mon, 15 May 2000 19:28:26 +0000 Subject: [PATCH] Fix -USLAPD_SCHEMA_NOT_COMPAT bugs introduced in last commit --- servers/slapd/filter.c | 37 ++++++++++++------------------------- 1 file changed, 12 insertions(+), 25 deletions(-) diff --git a/servers/slapd/filter.c b/servers/slapd/filter.c index 345bac312d..1278915e02 100644 --- a/servers/slapd/filter.c +++ b/servers/slapd/filter.c @@ -93,12 +93,13 @@ get_filter( switch ( f->f_choice ) { case LDAP_FILTER_EQUALITY: Debug( LDAP_DEBUG_FILTER, "EQUALITY\n", 0, 0, 0 ); -#ifdef SLAPD_SCHEMA_NOT_COMPAT + if ( (err = get_ava( ber, &f->f_ava )) != LDAP_SUCCESS ) { *text = "error decoding filter"; break; } +#ifdef SLAPD_SCHEMA_NOT_COMPAT *fstr = ch_malloc( sizeof("(=)") + f->f_av_desc->ad_cname->bv_len + f->f_av_value->bv_len ); @@ -108,11 +109,6 @@ get_filter( f->f_av_value->bv_val ); #else - if ( (err = get_ava( ber, f->f_ava )) != LDAP_SUCCESS ) { - *text = "error decoding filter"; - break; - } - *fstr = ch_malloc( sizeof("(=)") + strlen( f->f_avtype ) + f->f_avvalue.bv_len); @@ -128,12 +124,13 @@ get_filter( case LDAP_FILTER_GE: Debug( LDAP_DEBUG_FILTER, "GE\n", 0, 0, 0 ); -#ifdef SLAPD_SCHEMA_NOT_COMPAT + if ( (err = get_ava( ber, &f->f_ava )) != LDAP_SUCCESS ) { *text = "decoding filter error"; break; } +#ifdef SLAPD_SCHEMA_NOT_COMPAT *fstr = ch_malloc( sizeof("(>=)") + f->f_av_desc->ad_cname->bv_len + f->f_av_value->bv_len ); @@ -143,12 +140,7 @@ get_filter( f->f_av_value->bv_val ); #else - if ( (err = get_ava( ber, f->f_ava )) != LDAP_SUCCESS ) { - *text = "decoding filter error"; - break; - } - - *fstr = ch_malloc( sizeof("(>=)" + *fstr = ch_malloc( sizeof("(>=)") + strlen( f->f_avtype ) + f->f_avvalue.bv_len); sprintf( *fstr, "(%s>=%s)", f->f_avtype, @@ -158,12 +150,14 @@ get_filter( case LDAP_FILTER_LE: Debug( LDAP_DEBUG_FILTER, "LE\n", 0, 0, 0 ); -#ifdef SLAPD_SCHEMA_NOT_COMPAT + if ( (err = get_ava( ber, &f->f_ava )) != LDAP_SUCCESS ) { *text = "decoding filter error"; break; } +#ifdef SLAPD_SCHEMA_NOT_COMPAT + *fstr = ch_malloc( sizeof("(<=)") + f->f_av_desc->ad_cname->bv_len + f->f_av_value->bv_len ); @@ -173,11 +167,7 @@ get_filter( f->f_av_value->bv_val ); #else - if ( (err = get_ava( ber, f->f_ava )) != LDAP_SUCCESS ) { - *text = "error decoding filter"; - break; - } - *fstr = ch_malloc( sizeof("(<=)" + *fstr = ch_malloc( sizeof("(<=)") + strlen( f->f_avtype ) + f->f_avvalue.bv_len); sprintf( *fstr, "(%s<=%s)", f->f_avtype, @@ -227,12 +217,13 @@ get_filter( case LDAP_FILTER_APPROX: Debug( LDAP_DEBUG_FILTER, "APPROX\n", 0, 0, 0 ); -#ifdef SLAPD_SCHEMA_NOT_COMPAT + if ( (err = get_ava( ber, &f->f_ava )) != LDAP_SUCCESS ) { *text = "decoding filter error"; break; } +#ifdef SLAPD_SCHEMA_NOT_COMPAT *fstr = ch_malloc( sizeof("(~=)") + f->f_av_desc->ad_cname->bv_len + f->f_av_value->bv_len ); @@ -242,11 +233,7 @@ get_filter( f->f_av_value->bv_val ); #else - if ( (err = get_ava( ber, f->f_ava )) != LDAP_SUCCESS ) { - *text = "error decoding filter"; - break; - } - *fstr = ch_malloc( sizeof("(~=)" + *fstr = ch_malloc( sizeof("(~=)") + strlen( f->f_avtype ) + f->f_avvalue.bv_len); sprintf( *fstr, "(%s~=%s)", f->f_avtype, -- 2.39.5