diff --git a/servers/slapd/add.c b/servers/slapd/add.c index 76bd732123..c69ccefd6c 100644 --- a/servers/slapd/add.c +++ b/servers/slapd/add.c @@ -500,9 +500,6 @@ slap_mods2entry( } else { attr->a_nvals = attr->a_vals; } - /* slap_mods_check() gives us sorted results */ - if ( attr->a_desc->ad_type->sat_flags & SLAP_AT_SORTED_VAL ) - attr->a_flags |= SLAP_ATTR_SORTED_VALS; *tail = attr; tail = &attr->a_next; diff --git a/servers/slapd/attr.c b/servers/slapd/attr.c index fe2eded94a..51f50758fc 100644 --- a/servers/slapd/attr.c +++ b/servers/slapd/attr.c @@ -88,6 +88,8 @@ attr_alloc( AttributeDescription *ad ) ldap_pvt_thread_mutex_unlock( &attr_mutex ); a->a_desc = ad; + if ( ad && ( ad->ad_type->sat_flags & SLAP_AT_SORTED_VAL )) + a->a_flags |= SLAP_ATTR_SORTED_VALS; return a; }