- if (dn[0] != NULL) {
- LDAPRDN rdn = dn[0];
-
- for (i = 0; rdn[i] != NULL; i++) {
- LDAPAVA *ava = &rdn[0][i];
- struct berval *vals[2];
- Slapi_Attr *a = NULL;
-
- /* 0 means attr exists */
- if (slapi_entry_attr_find(e, ava->la_attr.bv_val, &a) == 0 &&
- a != NULL &&
- slapi_attr_value_find(a, &ava->la_value) == 0)
- {
- /* RDN in entry */
- continue;
- } /* else RDN not in entry */
-
- vals[0] = &ava->la_value;
- vals[1] = NULL;
-
- slapi_entry_attr_merge(e, ava->la_attr.bv_val, vals);
- }
- }
-
- ldap_dnfree(dn);
-