s4-repl: cleanup the extended op calls in repl server
[kamenim/samba.git] / source4 / dsdb / repl / drepl_service.c
index 2c436172f1563566b2e161851e5a617202f36f5c..ae765a597998c5cd518df0955d0154368ce1d04a 100644 (file)
@@ -170,7 +170,7 @@ static WERROR _drepl_schedule_replication(struct dreplsrv_service *service,
                                          TALLOC_CTX *mem_ctx)
 {
        WERROR werr;
-       dreplsrv_fsmo_callback_t fn_callback = NULL;
+       dreplsrv_extended_callback_t fn_callback = NULL;
 
        if (data) {
                fn_callback = _drepl_replica_sync_done_cb;
@@ -351,6 +351,26 @@ static NTSTATUS drepl_take_FSMO_role(struct irpc_message *msg,
        return NT_STATUS_OK;
 }
 
+/**
+ * Called when the auth code wants us to try and replicate
+ * a users secrets
+ */
+static NTSTATUS drepl_trigger_repl_secret(struct irpc_message *msg,
+                                         struct drepl_trigger_repl_secret *r)
+{
+       struct dreplsrv_service *service = talloc_get_type(msg->private_data,
+                                                          struct dreplsrv_service);
+
+
+       drepl_repl_secret(service, r->in.user_dn);
+
+       /* we are not going to be sending a reply to this request */
+       msg->no_reply = true;
+
+       return NT_STATUS_OK;
+}
+
+
 /*
   startup the dsdb replicator service task
 */
@@ -441,6 +461,7 @@ static void dreplsrv_task_init(struct task_server *task)
        IRPC_REGISTER(task->msg_ctx, irpc, DREPLSRV_REFRESH, dreplsrv_refresh, service);
        IRPC_REGISTER(task->msg_ctx, drsuapi, DRSUAPI_DSREPLICASYNC, drepl_replica_sync, service);
        IRPC_REGISTER(task->msg_ctx, irpc, DREPL_TAKEFSMOROLE, drepl_take_FSMO_role, service);
+       IRPC_REGISTER(task->msg_ctx, irpc, DREPL_TRIGGER_REPL_SECRET, drepl_trigger_repl_secret, service);
        messaging_register(task->msg_ctx, service, MSG_DREPL_ALLOCATE_RID, dreplsrv_allocate_rid);
 }