From: Stefan Metzmacher Date: Tue, 28 Feb 2023 23:42:28 +0000 (+0100) Subject: s4:dsdb/repl_meta_data: let replmd_process_backlink() use dsdb_module_obj_by_guid() X-Git-Tag: talloc-2.4.1~1295 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c9fac2e912a30d92cceaea63ea684985a6d7c545;p=thirdparty%2Fsamba.git s4:dsdb/repl_meta_data: let replmd_process_backlink() use dsdb_module_obj_by_guid() This will simplify the following changes. BUG: https://bugzilla.samba.org/show_bug.cgi?id=12967 Signed-off-by: Stefan Metzmacher 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 871e1d56ec2..0fb5bcf9d67 100644 --- a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c +++ b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c @@ -425,6 +425,8 @@ static int linked_attr_modify(struct ldb_module *module, static int replmd_process_backlink(struct ldb_module *module, struct la_backlink *bl, struct ldb_request *parent) { struct ldb_dn *target_dn, *source_dn; + struct ldb_message *old_msg = NULL; + const char *attrs[] = { NULL }; int ret; struct ldb_context *ldb = ldb_module_get_ctx(module); struct ldb_message *msg; @@ -437,7 +439,12 @@ static int replmd_process_backlink(struct ldb_module *module, struct la_backlink - construct ldb_message - either an add or a delete */ - ret = dsdb_module_dn_by_guid(module, frame, &bl->target_guid, &target_dn, parent); + ret = dsdb_module_obj_by_guid(module, + frame, + &old_msg, + &bl->target_guid, + attrs, + parent); if (ret != LDB_SUCCESS) { struct GUID_txt_buf guid_str; DBG_WARNING("Failed to find target DN for linked attribute with GUID %s\n", @@ -446,6 +453,7 @@ static int replmd_process_backlink(struct ldb_module *module, struct la_backlink talloc_free(frame); return LDB_SUCCESS; } + target_dn = old_msg->dn; msg = ldb_msg_new(frame); if (msg == NULL) {