From 8b32d9ad2de96679108fd7bffe804da10a652b2f Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Fri, 6 Jul 2012 15:35:42 +1000 Subject: s4-dsdb: Use parent_object_guid to find the correct parent for new objects This allows the parent to be renmaed while a new object is added on another replica. This rename may also be a delete, in which case we must move it to lostandfound. Andrew Bartlett --- source4/dsdb/repl/replicated_objects.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'source4/dsdb/repl') diff --git a/source4/dsdb/repl/replicated_objects.c b/source4/dsdb/repl/replicated_objects.c index 481ff60217..ec4dffe0be 100644 --- a/source4/dsdb/repl/replicated_objects.c +++ b/source4/dsdb/repl/replicated_objects.c @@ -203,6 +203,7 @@ WERROR dsdb_convert_object_ex(struct ldb_context *ldb, struct ldb_message *msg; struct replPropertyMetaDataBlob *md; struct ldb_val guid_value; + struct ldb_val parent_guid_value; NTTIME whenChanged = 0; time_t whenChanged_t; const char *whenChanged_s; @@ -375,8 +376,18 @@ WERROR dsdb_convert_object_ex(struct ldb_context *ldb, return ntstatus_to_werror(nt_status); } + if (in->parent_object_guid) { + nt_status = GUID_to_ndr_blob(in->parent_object_guid, msg, &parent_guid_value); + if (!NT_STATUS_IS_OK(nt_status)) { + return ntstatus_to_werror(nt_status); + } + } else { + parent_guid_value = data_blob_null; + } + out->msg = msg; out->guid_value = guid_value; + out->parent_guid_value = parent_guid_value; out->when_changed = whenChanged_s; out->meta_data = md; return WERR_OK; -- cgit