]> git.sur5r.net Git - openldap/commitdiff
ITS#6845 set a_flags in attr_alloc()
authorHoward Chu <hyc@openldap.org>
Tue, 1 Mar 2011 00:28:37 +0000 (00:28 +0000)
committerHoward Chu <hyc@openldap.org>
Tue, 1 Mar 2011 00:28:37 +0000 (00:28 +0000)
servers/slapd/add.c
servers/slapd/attr.c

index 76bd732123bdf1160c26e2ace30b78e251ef61e5..c69ccefd6c1dadd1c5faff0f596fa1bbce40eaed 100644 (file)
@@ -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;
index fe2eded94ab796382ce23a1d3fced42ceae4d608..51f50758fcef64af13444d83e73127ebdaacf357 100644 (file)
@@ -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;
 }