From deb62446febd0363f5c713e454eed1ca33ace266 Mon Sep 17 00:00:00 2001 From: Stig Venaas Date: Sun, 7 Jul 2002 13:22:45 +0000 Subject: [PATCH] Added normalization to caseIgnoreIA5Indexer() --- servers/slapd/schema_init.c | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/servers/slapd/schema_init.c b/servers/slapd/schema_init.c index f37cbf19ce..f0ad77cb51 100644 --- a/servers/slapd/schema_init.c +++ b/servers/slapd/schema_init.c @@ -2797,6 +2797,7 @@ static int caseIgnoreIA5Indexer( BerVarray *keysp ) { int i; + int rc = LDAP_SUCCESS; size_t slen, mlen; BerVarray keys; HASH_CONTEXT HASHcontext; @@ -2819,7 +2820,21 @@ static int caseIgnoreIA5Indexer( for( i=0; values[i].bv_val != NULL; i++ ) { struct berval value; - ber_dupbv( &value, &values[i] ); + + if( mr->smr_normalize ) { + rc = (mr->smr_normalize)( use, syntax, mr, &values[i], &value ); + if( rc != LDAP_SUCCESS ) { + break; + } + } else if ( mr->smr_syntax->ssyn_normalize ) { + rc = (mr->smr_syntax->ssyn_normalize)( syntax, &values[i], &value ); + if( rc != LDAP_SUCCESS ) { + break; + } + } else { + ber_dupbv( &value, &values[i] ); + } + ldap_pvt_str2lower( value.bv_val ); HASH_Init( &HASHcontext ); @@ -2841,8 +2856,12 @@ static int caseIgnoreIA5Indexer( } keys[i].bv_val = NULL; + if( rc != LDAP_SUCCESS ) { + ber_bvarray_free( keys ); + keys = NULL; + } *keysp = keys; - return LDAP_SUCCESS; + return rc; } /* Index generation function */