From: Douglas Bagnall Date: Thu, 29 Dec 2016 02:09:15 +0000 (+1300) Subject: replmd: replmd_check_upgrade_links() needs to first parses DNs X-Git-Tag: talloc-2.1.9~244 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c1bceb2528a6c1bdaec39d9d87cc34c1ef8c28df;p=thirdparty%2Fsamba.git replmd: replmd_check_upgrade_links() needs to first parses DNs Because we now load the dns with get_parsed_dns_trusted we have to manually explode them in the upgrade tests. Signed-off-by: Douglas Bagnall Reviewed-by: Andrew Bartlett --- diff --git a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c index 46f29942d84..b4dacccd8e8 100644 --- a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c +++ b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c @@ -2092,15 +2092,24 @@ static int replmd_update_la_val(TALLOC_CTX *mem_ctx, struct ldb_val *v, struct d /* 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; idn, &version, "RMD_VERSION"); @@ -2279,7 +2288,9 @@ static int replmd_modify_la_add(struct ldb_module *module, 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; @@ -2433,7 +2444,9 @@ static int replmd_modify_la_delete(struct ldb_module *module, 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; @@ -2672,7 +2685,9 @@ static int replmd_modify_la_replace(struct ldb_module *module, 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; @@ -6421,7 +6436,9 @@ linked_attributes[0]: 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;