summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source4/dsdb/repl/drepl_out_helpers.c4
-rw-r--r--source4/dsdb/repl/drepl_out_pull.c11
-rw-r--r--source4/dsdb/repl/drepl_service.h5
3 files changed, 16 insertions, 4 deletions
diff --git a/source4/dsdb/repl/drepl_out_helpers.c b/source4/dsdb/repl/drepl_out_helpers.c
index 1225edecc7..4aa0e86b48 100644
--- a/source4/dsdb/repl/drepl_out_helpers.c
+++ b/source4/dsdb/repl/drepl_out_helpers.c
@@ -290,7 +290,7 @@ static void dreplsrv_op_pull_source_get_changes_send(struct dreplsrv_op_pull_sou
r->in.req->req8.max_object_count = 133;
r->in.req->req8.max_ndr_size = 1336811;
r->in.req->req8.extended_op = st->op->extended_op;
- r->in.req->req8.fsmo_info = 0;
+ r->in.req->req8.fsmo_info = st->op->fsmo_info;
r->in.req->req8.partial_attribute_set = NULL;
r->in.req->req8.partial_attribute_set_ex= NULL;
r->in.req->req8.mapping_ctr.num_mappings= 0;
@@ -306,7 +306,7 @@ static void dreplsrv_op_pull_source_get_changes_send(struct dreplsrv_op_pull_sou
r->in.req->req5.max_object_count = 133;
r->in.req->req5.max_ndr_size = 1336770;
r->in.req->req5.extended_op = st->op->extended_op;
- r->in.req->req5.fsmo_info = 0;
+ r->in.req->req5.fsmo_info = st->op->fsmo_info;
}
req = dcerpc_drsuapi_DsGetNCChanges_send(drsuapi->pipe, r, r);
diff --git a/source4/dsdb/repl/drepl_out_pull.c b/source4/dsdb/repl/drepl_out_pull.c
index ceec61848d..8a33006d06 100644
--- a/source4/dsdb/repl/drepl_out_pull.c
+++ b/source4/dsdb/repl/drepl_out_pull.c
@@ -35,7 +35,9 @@
WERROR dreplsrv_schedule_partition_pull_source(struct dreplsrv_service *s,
struct dreplsrv_partition_source_dsa *source,
- enum drsuapi_DsExtendedOperation extended_op)
+ enum drsuapi_DsExtendedOperation extended_op,
+ uint64_t fsmo_info,
+ dreplsrv_fsmo_callback_t callback)
{
struct dreplsrv_out_operation *op;
@@ -45,6 +47,8 @@ WERROR dreplsrv_schedule_partition_pull_source(struct dreplsrv_service *s,
op->service = s;
op->source_dsa = source;
op->extended_op = extended_op;
+ op->fsmo_info = fsmo_info;
+ op->callback = callback;
DLIST_ADD_END(s->ops.pending, op, struct dreplsrv_out_operation *);
@@ -59,7 +63,7 @@ static WERROR dreplsrv_schedule_partition_pull(struct dreplsrv_service *s,
struct dreplsrv_partition_source_dsa *cur;
for (cur = p->sources; cur; cur = cur->next) {
- status = dreplsrv_schedule_partition_pull_source(s, cur, DRSUAPI_EXOP_NONE);
+ status = dreplsrv_schedule_partition_pull_source(s, cur, DRSUAPI_EXOP_NONE, 0, NULL);
W_ERROR_NOT_OK_RETURN(status);
}
@@ -122,6 +126,9 @@ static void dreplsrv_pending_op_callback(struct dreplsrv_out_operation *op)
rf->consecutive_sync_failures));
done:
+ if (op->callback) {
+ op->callback(s, rf->result_last_attempt);
+ }
talloc_free(op);
s->ops.current = NULL;
dreplsrv_run_pending_ops(s);
diff --git a/source4/dsdb/repl/drepl_service.h b/source4/dsdb/repl/drepl_service.h
index eb3cd045f9..b9e8640ae9 100644
--- a/source4/dsdb/repl/drepl_service.h
+++ b/source4/dsdb/repl/drepl_service.h
@@ -100,6 +100,8 @@ struct dreplsrv_partition {
struct dreplsrv_partition_source_dsa *sources;
};
+typedef void (*dreplsrv_fsmo_callback_t)(struct dreplsrv_service *, WERROR );
+
struct dreplsrv_out_operation {
struct dreplsrv_out_operation *prev, *next;
@@ -110,6 +112,8 @@ struct dreplsrv_out_operation {
struct composite_context *creq;
enum drsuapi_DsExtendedOperation extended_op;
+ uint64_t fsmo_info;
+ dreplsrv_fsmo_callback_t callback;
};
struct dreplsrv_notify_operation {
@@ -208,6 +212,7 @@ struct dreplsrv_service {
} ops;
struct {
+ bool in_progress;
struct dreplsrv_partition_source_dsa *rid_manager_source_dsa;
} ridalloc;
};