]> git.sur5r.net Git - openldap/commitdiff
ITS#4817 fix from HEAD
authorHoward Chu <hyc@openldap.org>
Fri, 26 Jan 2007 18:31:35 +0000 (18:31 +0000)
committerHoward Chu <hyc@openldap.org>
Fri, 26 Jan 2007 18:31:35 +0000 (18:31 +0000)
servers/slapd/entry.c

index c3e50bd64319e365bcf0ba95099e57ae7f0d083b..eee5addac23ba18498ba5b94c1f2adaaee8ac838 100644 (file)
@@ -173,6 +173,8 @@ str2entry2( char *s, int checkvals )
                goto fail;
        }
 
+#define bvcasematch(bv1, bv2)  ( ((bv1)->bv_len == (bv2)->bv_len) && (strncasecmp((bv1)->bv_val, (bv2)->bv_val, (bv1)->bv_len) == 0) )
+
        /* Make sure all attributes with multiple values are contiguous */
        if ( checkvals ) {
                int j, k;
@@ -181,7 +183,7 @@ str2entry2( char *s, int checkvals )
 
                for (i=0; i<lines; i++) {
                        for ( j=i+1; j<lines; j++ ) {
-                               if ( bvmatch( type+i, type+j )) {
+                               if ( bvcasematch( type+i, type+j )) {
                                        /* out of order, move intervening attributes down */
                                        if ( j != i+1 ) {
                                                bv = vals[j];
@@ -204,7 +206,7 @@ str2entry2( char *s, int checkvals )
 
        for ( i=0; i<=lines; i++ ) {
                ad_prev = ad;
-               if ( !ad || ( i<lines && !bvmatch( type+i, &ad->ad_cname ))) {
+               if ( !ad || ( i<lines && !bvcasematch( type+i, &ad->ad_cname ))) {
                        ad = NULL;
                        rc = slap_bv2ad( type+i, &ad, &text );