From 03a75afa79da19d9c7ac3b4c86b1a402a27e14e5 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Fri, 8 Jun 2012 12:26:32 +1000 Subject: s4-dsdb: Provide a way to force incoming renames to take priority This should mean that a samba-tool drs replicate --full-sync forces a replication of all objects, regardless of if we think the local name is newer and regards any local name as being in conflict. Andrew Bartlett --- source4/dsdb/samdb/ldb_modules/repl_meta_data.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'source4') diff --git a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c index 03248c28dd..6a2fbf4bc6 100644 --- a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c +++ b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c @@ -3466,7 +3466,8 @@ static int replmd_op_possible_conflict_callback(struct ldb_request *req, struct goto failed; } - rename_incoming_record = !replmd_replPropertyMetaData1_is_newer(omd_name, rmd_name); + rename_incoming_record = !(ar->objs->dsdb_repl_flags & DSDB_REPL_FLAG_PRIORITISE_INCOMING) && + !replmd_replPropertyMetaData1_is_newer(omd_name, rmd_name); if (rename_incoming_record) { struct GUID guid; @@ -3855,7 +3856,8 @@ static int replmd_replicated_handle_rename(struct replmd_replicated_request *ar, md_local = replmd_replPropertyMetaData1_find_attid(omd, DRSUAPI_ATTID_name); /* if there is no name attribute then we have to assume the object we've received is in fact newer */ - if (!md_remote || !md_local || + if (ar->objs->dsdb_repl_flags & DSDB_REPL_FLAG_PRIORITISE_INCOMING || + !md_remote || !md_local || replmd_replPropertyMetaData1_is_newer(md_local, md_remote)) { struct ldb_request *req; int ret; -- cgit