From 6345812f49ab0bc3a257ef61da0520f5b1d97458 Mon Sep 17 00:00:00 2001 From: Howard Chu Date: Fri, 27 Feb 2009 01:28:22 +0000 Subject: [PATCH] More for prev commit --- servers/slapd/back-ldap/search.c | 4 +++- servers/slapd/back-meta/search.c | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/servers/slapd/back-ldap/search.c b/servers/slapd/back-ldap/search.c index 8f49187c50..2539706e19 100644 --- a/servers/slapd/back-ldap/search.c +++ b/servers/slapd/back-ldap/search.c @@ -819,8 +819,10 @@ ldap_build_entry( if ( attr->a_desc->ad_type->sat_flags & SLAP_AT_SORTED_VAL ) { while ( attr->a_numvals > 1 ) { int rc = slap_sort_vals( (Modifications *)attr, &text, &i, op->o_tmpmemctx ); - if ( rc != LDAP_TYPE_OR_VALUE_EXISTS ) + if ( rc != LDAP_TYPE_OR_VALUE_EXISTS ) { + attr->a_flags |= SLAP_ATTR_SORTED_VALS; break; + } /* Strip duplicate values */ if ( attr->a_nvals != attr->a_vals ) diff --git a/servers/slapd/back-meta/search.c b/servers/slapd/back-meta/search.c index 8927ef2697..180cd7788e 100644 --- a/servers/slapd/back-meta/search.c +++ b/servers/slapd/back-meta/search.c @@ -2168,8 +2168,10 @@ next_attr:; while ( attr->a_numvals > 1 ) { int i; int rc = slap_sort_vals( (Modifications *)attr, &text, &i, op->o_tmpmemctx ); - if ( rc != LDAP_TYPE_OR_VALUE_EXISTS ) + if ( rc != LDAP_TYPE_OR_VALUE_EXISTS ) { + attr->a_flags |= SLAP_ATTR_SORTED_VALS; break; + } /* Strip duplicate values */ if ( attr->a_nvals != attr->a_vals ) -- 2.39.5