]> git.sur5r.net Git - openldap/commitdiff
Must use case-insensitive comparisons on attr types
authorHoward Chu <hyc@openldap.org>
Fri, 26 Jan 2007 02:18:44 +0000 (02:18 +0000)
committerHoward Chu <hyc@openldap.org>
Fri, 26 Jan 2007 02:18:44 +0000 (02:18 +0000)
servers/slapd/entry.c

index ca2296fee647ec0a99758ba07631d21fe0a8c777..dda4e185023f86f3a4f92125f5d595eba0397611 100644 (file)
@@ -207,6 +207,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;
@@ -215,7 +217,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];
@@ -238,7 +240,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 );