}
if (rdn_m) {
- ret = ldb_msg_add_value(msg, rdn_attr->lDAPDisplayName, rdn_value, NULL);
- if (ret != LDB_SUCCESS) {
- return WERR_FOOBAR;
+ struct ldb_message_element *el;
+ el = ldb_msg_find_element(msg, rdn_attr->lDAPDisplayName);
+ if (!el) {
+ ret = ldb_msg_add_value(msg, rdn_attr->lDAPDisplayName, rdn_value, NULL);
+ if (ret != LDB_SUCCESS) {
+ return WERR_FOOBAR;
+ }
+ } else {
+ if (el->num_values != 1) {
+ DEBUG(0,(__location__ ": Unexpected num_values=%u\n",
+ el->num_values));
+ return WERR_FOOBAR;
+ }
+ if (!ldb_val_equal_exact(&el->values[0], rdn_value)) {
+ DEBUG(0,(__location__ ": RDN value changed? '%*.*s' '%*.*s'\n",
+ (int)el->values[0].length, (int)el->values[0].length, el->values[0].data,
+ (int)rdn_value->length, (int)rdn_value->length, rdn_value->data));
+ return WERR_FOOBAR;
+ }
}
rdn_m->attid = rdn_attid;
status = dsdb_convert_object_ex(ldb, schema,
cur, gensec_skey,
out->objects, &out->objects[i]);
- W_ERROR_NOT_OK_RETURN(status);
+ if (!W_ERROR_IS_OK(status)) {
+ DEBUG(0,("Failed to convert object %s\n", cur->object.identifier->dn));
+ return status;
+ }
}
if (i != out->num_objects) {
return WERR_FOOBAR;
return WERR_FOOBAR;
}
+ DEBUG(2,("Replicated %u objects (%u linked attributes) for %s\n",
+ out->num_objects, out->linked_attributes_count,
+ ldb_dn_get_linearized(out->partition_dn)));
+
+
if (_out) {
*_out = out;
} else {
msg->num_elements);
W_ERROR_HAVE_NO_MEMORY(msg->elements);
- /*
- * TODO:
- *
- * The DsAddEntry() call which creates a nTDSDSA object,
- * also adds a servicePrincipalName in the following form
- * to the computer account of the new domain controller
- * referenced by the "serverReferenece" attribute.
- *
- * E3514235-4B06-11D1-AB04-00C04FC2DCD2/<new-ntdsdsa-object-guid-as-string>/<domain-dns-name>
- *
- * also note that the "serverReference" isn't added to the new object!
- */
-
for (i=0; i < msg->num_elements; i++) {
struct drsuapi_DsReplicaAttribute *a;
struct ldb_message_element *e;
W_ERROR_NOT_OK_RETURN(status);
}
+
*_msg = msg;
+
return WERR_OK;
}
num_objects);
W_ERROR_HAVE_NO_MEMORY(objects);
- ret = ldb_transaction_start(ldb);
- if (ret != 0) {
- goto cancel;
- }
-
for (i=0; i < num_objects; i++) {
struct dom_sid *sid = NULL;
ret = ldb_add(ldb, objects[i]);
}
}
- ret = ldb_transaction_commit(ldb);
- if (ret != 0) {
- goto cancel;
- }
-
talloc_free(objects);
*_num = num_objects;