/*
check if any links need upgrading from w2k format
*/
-static int replmd_check_upgrade_links(struct parsed_dn *dns, uint32_t count,
+static int replmd_check_upgrade_links(struct ldb_context *ldb,
+ struct parsed_dn *dns, uint32_t count,
struct ldb_message_element *el,
- const struct GUID *invocation_id)
+ const struct GUID *invocation_id,
+ const char *ldap_oid)
{
uint32_t i;
for (i=0; i<count; i++) {
NTSTATUS status;
uint32_t version;
int ret;
+ if (dns[i].dsdb_dn == NULL) {
+ dns[i].dsdb_dn = dsdb_dn_parse(dns, ldb, dns[i].v,
+ ldap_oid);
+ if (dns[i].dsdb_dn == NULL) {
+ return LDB_ERR_INVALID_DN_SYNTAX;
+ }
+ }
status = dsdb_get_extended_dn_uint32(dns[i].dsdb_dn->dn,
&version, "RMD_VERSION");
return LDB_ERR_OPERATIONS_ERROR;
}
- ret = replmd_check_upgrade_links(old_dns, old_num_values, old_el, invocation_id);
+ ret = replmd_check_upgrade_links(ldb, old_dns, old_num_values,
+ old_el, invocation_id,
+ schema_attr->syntax->ldap_oid);
if (ret != LDB_SUCCESS) {
talloc_free(tmp_ctx);
return ret;
return LDB_ERR_OPERATIONS_ERROR;
}
- ret = replmd_check_upgrade_links(old_dns, old_el->num_values, old_el, invocation_id);
+ ret = replmd_check_upgrade_links(ldb, old_dns, old_el->num_values,
+ old_el, invocation_id,
+ schema_attr->syntax->ldap_oid);
if (ret != LDB_SUCCESS) {
talloc_free(tmp_ctx);
return ret;
return LDB_ERR_OPERATIONS_ERROR;
}
- ret = replmd_check_upgrade_links(old_dns, old_num_values, old_el, invocation_id);
+ ret = replmd_check_upgrade_links(ldb, old_dns, old_num_values,
+ old_el, invocation_id,
+ schema_attr->syntax->ldap_oid);
if (ret != LDB_SUCCESS) {
talloc_free(tmp_ctx);
return ret;
return LDB_ERR_OPERATIONS_ERROR;
}
- ret = replmd_check_upgrade_links(pdn_list, old_el->num_values, old_el, our_invocation_id);
+ ret = replmd_check_upgrade_links(ldb, pdn_list, old_el->num_values,
+ old_el, our_invocation_id,
+ attr->syntax->ldap_oid);
if (ret != LDB_SUCCESS) {
talloc_free(tmp_ctx);
return ret;