+ } else {
+ for ( i = 0; mods->sml_bvalues[i].bv_val != NULL; i++ ) {
+ int rc, match;
+ const char *text = NULL;
+ struct berval asserted;
+
+ rc = value_normalize( mods->sml_desc,
+ SLAP_MR_EQUALITY,
+ &mods->sml_bvalues[i],
+ &asserted,
+ &text );
+
+ if( rc != LDAP_SUCCESS ) return rc;
+
+ for ( j = 0; j < i; j++ ) {
+ int rc = value_match( &match, mods->sml_desc, mr,
+ SLAP_MR_VALUE_SYNTAX_MATCH,
+ &mods->sml_bvalues[j], &asserted, &text );
+
+ if( rc == LDAP_SUCCESS && match == 0 ) {
+ free( asserted.bv_val );
+ snprintf( textbuf, textlen,
+ "%s: value #%d provided more than once",
+ mods->sml_desc->ad_cname.bv_val, j );
+ return LDAP_TYPE_OR_VALUE_EXISTS;
+ }
+ }
+
+ free( asserted.bv_val );
+ }
+ }
+ }
+
+ attr = ch_calloc( 1, sizeof(Attribute) );
+
+ /* move ad to attr structure */
+ attr->a_desc = mods->sml_desc;
+ mods->sml_desc = NULL;
+
+ /* move values to attr structure */
+ /* should check for duplicates */
+ attr->a_vals = mods->sml_bvalues;
+ mods->sml_bvalues = NULL;
+
+ *tail = attr;
+ tail = &attr->a_next;
+ }