#include "librpc/gen_ndr/ndr_misc.h"
#include "librpc/gen_ndr/ndr_drsuapi.h"
#include "librpc/gen_ndr/ndr_drsblobs.h"
+#include "librpc/gen_ndr/ndr_irpc.h"
#include "param/param.h"
static WERROR dreplsrv_init_creds(struct dreplsrv_service *service)
if (!ntds_guid) {
return WERR_DS_UNAVAILABLE;
}
-
service->ntds_guid = *ntds_guid;
bind_info28 = &service->bind_info28;
return NT_STATUS_OK;
}
+static NTSTATUS drepl_take_FSMO_role(struct irpc_message *msg,
+ struct drepl_takeFSMORole *r)
+{
+ struct dreplsrv_service *service = talloc_get_type(msg->private_data,
+ struct dreplsrv_service);
+ r->out.result = werror_to_ntstatus(dreplsrv_fsmo_role_check(service, r->in.role));
+ return NT_STATUS_OK;
+}
+
/*
startup the dsdb replicator service task
*/
irpc_add_name(task->msg_ctx, "dreplsrv");
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);
messaging_register(task->msg_ctx, service, MSG_DREPL_ALLOCATE_RID, dreplsrv_allocate_rid);
}