summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source4/dsdb/samdb/ldb_modules/repl_meta_data.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c
index 18713d7e19..ca0291affd 100644
--- a/source4/dsdb/samdb/ldb_modules/repl_meta_data.c
+++ b/source4/dsdb/samdb/ldb_modules/repl_meta_data.c
@@ -641,6 +641,12 @@ static int replmd_replicated_uptodate_modify_callback(struct ldb_context *ldb,
#endif
}
+static int replmd_drsuapi_DsReplicaCursor2_compare(const struct drsuapi_DsReplicaCursor2 *c1,
+ const struct drsuapi_DsReplicaCursor2 *c2)
+{
+ return GUID_compare(&c1->source_dsa_invocation_id, &c2->source_dsa_invocation_id);
+}
+
static int replmd_replicated_uptodate_modify(struct replmd_replicated_request *ar)
{
NTSTATUS nt_status;
@@ -823,6 +829,13 @@ static int replmd_replicated_uptodate_modify(struct replmd_replicated_request *a
nuv.ctr.ctr2.count = ni;
/*
+ * sort the cursors
+ */
+ qsort(nuv.ctr.ctr2.cursors, nuv.ctr.ctr2.count,
+ sizeof(struct drsuapi_DsReplicaCursor2),
+ (comparison_fn_t)replmd_drsuapi_DsReplicaCursor2_compare);
+
+ /*
* create the change ldb_message
*/
msg = ldb_msg_new(ar->sub.mem_ctx);