From 854b433489096f0e69548730bbc196c281e823f6 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Thu, 21 Apr 2005 06:39:58 +0000 Subject: [PATCH] Fix X-ORDERED SIBLINGS --- servers/slapd/at.c | 15 ++++++++++----- servers/slapd/bconfig.c | 2 +- servers/slapd/mods.c | 4 ++-- servers/slapd/slap.h | 4 +++- 4 files changed, 16 insertions(+), 9 deletions(-) diff --git a/servers/slapd/at.c b/servers/slapd/at.c index c0fec00e7e..14ed55b749 100644 --- a/servers/slapd/at.c +++ b/servers/slapd/at.c @@ -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; + } } } } diff --git a/servers/slapd/bconfig.c b/servers/slapd/bconfig.c index 66e9070527..2161ca324c 100644 --- a/servers/slapd/bconfig.c +++ b/servers/slapd/bconfig.c @@ -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 ) diff --git a/servers/slapd/mods.c b/servers/slapd/mods.c index 8e46c7c627..3ba189856a 100644 --- a/servers/slapd/mods.c +++ b/servers/slapd/mods.c @@ -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 ); } diff --git a/servers/slapd/slap.h b/servers/slapd/slap.h index 29e3b5a780..67f73a0d2f 100644 --- a/servers/slapd/slap.h +++ b/servers/slapd/slap.h @@ -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; -- 2.39.5