1
0
mirror of https://github.com/samba-team/samba.git synced 2025-03-09 08:58:35 +03:00

s4-repl: take advantage of async RPC forwarding

This uses async RPC forwarding for the DsReplicaSync call
This commit is contained in:
Andrew Tridgell 2009-09-15 20:51:10 -07:00
parent f80363c90a
commit 30d13288e5
2 changed files with 7 additions and 26 deletions

View File

@ -113,18 +113,16 @@ static NTSTATUS drepl_replica_sync(struct irpc_message *msg,
{
struct dreplsrv_service *service = talloc_get_type(msg->private_data,
struct dreplsrv_service);
WERROR werr;
struct GUID *guid = &r->in.req.req1.naming_context->guid;
werr = dreplsrv_schedule_partition_pull_by_guid(service, msg, guid);
if (W_ERROR_IS_OK(werr)) {
r->out.result = dreplsrv_schedule_partition_pull_by_guid(service, msg, guid);
if (W_ERROR_IS_OK(r->out.result)) {
DEBUG(3,("drepl_replica_sync: forcing sync of partition %s\n",
GUID_string(msg, guid)));
dreplsrv_run_pending_ops(service);
} else {
DEBUG(3,("drepl_replica_sync: failed setup of sync of partition %s - %s\n",
GUID_string(msg, guid), win_errstr(werr)));
return NT_STATUS_INTERNAL_ERROR;
GUID_string(msg, guid), win_errstr(r->out.result)));
}
return NT_STATUS_OK;
}

View File

@ -28,7 +28,6 @@
#include "lib/ldb/include/ldb_errors.h"
#include "param/param.h"
#include "librpc/gen_ndr/ndr_drsblobs.h"
#include "messaging/irpc.h"
#include "rpc_server/drsuapi/dcesrv_drsuapi.h"
#include "libcli/security/security.h"
@ -232,35 +231,19 @@ static WERROR dcesrv_drsuapi_DsUnbind(struct dcesrv_call_state *dce_call, TALLOC
static WERROR dcesrv_drsuapi_DsReplicaSync(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
struct drsuapi_DsReplicaSync *r)
{
struct server_id *repld;
struct irpc_request *ireq;
if (security_session_user_level(dce_call->conn->auth_state.session_info) <
SECURITY_DOMAIN_CONTROLLER) {
DEBUG(0,("DsReplicaSync refused for security token\n"));
return WERR_DS_DRA_ACCESS_DENIED;
}
repld = irpc_servers_byname(dce_call->msg_ctx, mem_ctx, "dreplsrv");
if (repld == NULL || repld[0].id == 0) {
DEBUG(0,("DsReplicaSync: Unable to find dreplsrv task\n"));
return WERR_DS_DRA_INTERNAL_ERROR;
}
ireq = IRPC_CALL_SEND(dce_call->msg_ctx, repld[0],
drsuapi, DRSUAPI_DSREPLICASYNC,
r, mem_ctx);
if (ireq == NULL) {
DEBUG(0,("DsReplicaSync: Failed to forward request to dreplsrv task\n"));
return WERR_DS_DRA_INTERNAL_ERROR;
}
/* we are not interested in a reply */
talloc_free(ireq);
dcesrv_irpc_forward_rpc_call(dce_call, mem_ctx, r, NDR_DRSUAPI_DSREPLICASYNC,
&ndr_table_drsuapi,
"dreplsrv", "DsReplicaSync");
return WERR_OK;
}
/*
drsuapi_DsReplicaAdd
*/