Skip to content

Commit

Permalink
s4-dsdb: Provide a way to force incoming renames to take priority
Browse files Browse the repository at this point in the history
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
  • Loading branch information
abartlet committed Jul 29, 2012
1 parent 26eb354 commit 03a75af
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions source4/dsdb/samdb/ldb_modules/repl_meta_data.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 03a75af

Please sign in to comment.