summaryrefslogtreecommitdiff
path: root/source4/dsdb/repl
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2012-07-06 15:35:42 +1000
committerAndrew Bartlett <abartlet@samba.org>2012-07-06 08:10:18 +0200
commit8b32d9ad2de96679108fd7bffe804da10a652b2f (patch)
treeef096445a62d12eaee8720abad5a76c79e34ada3 /source4/dsdb/repl
parent7abe51f8404f1788d4ed497d26b83b3097073229 (diff)
downloadsamba-8b32d9ad2de96679108fd7bffe804da10a652b2f.tar.gz
samba-8b32d9ad2de96679108fd7bffe804da10a652b2f.tar.bz2
samba-8b32d9ad2de96679108fd7bffe804da10a652b2f.zip
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
Diffstat (limited to 'source4/dsdb/repl')
-rw-r--r--source4/dsdb/repl/replicated_objects.c11
1 files changed, 11 insertions, 0 deletions
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;