]> git.sur5r.net Git - openldap/commitdiff
Fix X-ORDERED SIBLINGS
authorHoward Chu <hyc@openldap.org>
Thu, 21 Apr 2005 06:39:58 +0000 (06:39 +0000)
committerHoward Chu <hyc@openldap.org>
Thu, 21 Apr 2005 06:39:58 +0000 (06:39 +0000)
servers/slapd/at.c
servers/slapd/bconfig.c
servers/slapd/mods.c
servers/slapd/slap.h

index c0fec00e7ede5f265b0b105bdb131ad73fa71e03..14ed55b749c779902a5ddbb20865fefa50fc3e8b 100644 (file)
@@ -519,11 +519,16 @@ at_add(
        if ( sat->sat_extensions ) {
                for (i=0; sat->sat_extensions[i]; i++) {
                        if (!strcasecmp( sat->sat_extensions[i]->lsei_name,
-                               "X-ORDERED" ) && sat->sat_extensions[i]->lsei_values &&
-                               !strcasecmp( sat->sat_extensions[i]->lsei_values[0],
-                               "VALUES" )) {
-                               sat->sat_flags |= SLAP_AT_ORDERED;
-                               break;
+                               "X-ORDERED" ) && sat->sat_extensions[i]->lsei_values ) {
+                               if ( !strcasecmp( sat->sat_extensions[i]->lsei_values[0],
+                                       "VALUES" )) {
+                                       sat->sat_flags |= SLAP_AT_ORDERED_VAL;
+                                       break;
+                               } else if ( !strcasecmp( sat->sat_extensions[i]->lsei_values[0],
+                                       "SIBLINGS" )) {
+                                       sat->sat_flags |= SLAP_AT_ORDERED_SIB;
+                                       break;
+                               }
                        }
                }
        }
index 66e9070527d796b4439b563a03d92f524968ddde..2161ca324c6ea6062dee1830c23a166cfdcf1bfc 100644 (file)
@@ -3189,7 +3189,7 @@ check_vals( ConfigTable *ct, ConfigArgs *ca, void *ptr, int isAttr )
                vals = ml->sml_values;
        }
 
-       if ( a && ( ad->ad_type->sat_flags & SLAP_AT_ORDERED )) {
+       if ( a && ( ad->ad_type->sat_flags & SLAP_AT_ORDERED_VAL )) {
                sort = 1;
                rc = ordered_value_sort( a, 1 );
                if ( rc )
index 8e46c7c6275e2c8ce79fd2b9197c4f046d13ebb0..3ba189856a14dfc7a104208bc335f08b3b6581b3 100644 (file)
@@ -143,7 +143,7 @@ modify_add_values(
        }
 
        /* no - add them */
-       if ( mod->sm_desc->ad_type->sat_flags & SLAP_AT_ORDERED ) {
+       if ( mod->sm_desc->ad_type->sat_flags & SLAP_AT_ORDERED_VAL ) {
                rc = ordered_value_add( e, mod->sm_desc, a,
                        pmod.sm_values, pmod.sm_nvalues );
        } else {
@@ -333,7 +333,7 @@ modify_delete_vindex(
                                mod->sm_desc->ad_cname.bv_val );
                        rc = LDAP_NO_SUCH_ATTRIBUTE;
                }
-       } else if ( a->a_desc->ad_type->sat_flags & SLAP_AT_ORDERED ) {
+       } else if ( a->a_desc->ad_type->sat_flags & SLAP_AT_ORDERED_VAL ) {
        /* For an ordered attribute, renumber the value indices */
                ordered_value_sort( a, 1 );
        }
index 29e3b5a7805c186302cab6b6add77e4c6d9130b7..67f73a0d2fd793bf0e7be3feefd063b3e91c803b 100644 (file)
@@ -659,7 +659,9 @@ typedef struct slap_attribute_type {
 #endif
 #define        SLAP_AT_DYNAMIC         0x0400U /* dynamically generated */
 
-#define        SLAP_AT_ORDERED         0x0001U /* values are ordered */
+#define        SLAP_AT_ORDERED_VAL             0x0001U /* values are ordered */
+#define        SLAP_AT_ORDERED_SIB             0x0002U /* siblings are ordered */
+#define        SLAP_AT_ORDERED         0x0003U /* value has order index */
 #define        SLAP_AT_HARDCODE        0x10000U        /* This is hardcoded schema */
 
        slap_mask_t                                     sat_flags;