diff options
author | Kamen Mazdrashki <kamenim@samba.org> | 2010-09-15 16:45:37 +0300 |
---|---|---|
committer | Kamen Mazdrashki <kamenim@samba.org> | 2010-09-16 00:15:38 +0300 |
commit | 7f1db0d8df6c5b68c9eb9a2d578ce79a43ce0719 (patch) | |
tree | 398949bd034d01aafd9bc1b09838cefcd999e8da /source4/rpc_server | |
parent | 7b20b795ab024fda4e159852b60d829f7ae793c7 (diff) | |
download | samba-7f1db0d8df6c5b68c9eb9a2d578ce79a43ce0719.tar.gz samba-7f1db0d8df6c5b68c9eb9a2d578ce79a43ce0719.tar.bz2 samba-7f1db0d8df6c5b68c9eb9a2d578ce79a43ce0719.zip |
s4-drs: Wait DsReplicaSync for as long as it takes to complete
In case the caller wants sync execution, we should
not cancel the call for internal timeout reason,
but rather wait for its execution
Diffstat (limited to 'source4/rpc_server')
-rw-r--r-- | source4/rpc_server/drsuapi/dcesrv_drsuapi.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/source4/rpc_server/drsuapi/dcesrv_drsuapi.c b/source4/rpc_server/drsuapi/dcesrv_drsuapi.c index 4a6c37005c..9d388b2fbb 100644 --- a/source4/rpc_server/drsuapi/dcesrv_drsuapi.c +++ b/source4/rpc_server/drsuapi/dcesrv_drsuapi.c @@ -266,16 +266,33 @@ static WERROR dcesrv_drsuapi_DsReplicaSync(struct dcesrv_call_state *dce_call, T struct drsuapi_DsReplicaSync *r) { WERROR status; + uint32_t timeout; status = drs_security_level_check(dce_call, "DsReplicaSync", SECURITY_DOMAIN_CONTROLLER, NULL); if (!W_ERROR_IS_OK(status)) { return status; } - dcesrv_irpc_forward_rpc_call(dce_call, mem_ctx, r, NDR_DRSUAPI_DSREPLICASYNC, + if (r->in.level != 1) { + DEBUG(0,("DsReplicaSync called with unsupported level %d\n", r->in.level)); + return WERR_DS_DRA_INVALID_PARAMETER; + } + + if (r->in.req->req1.options & DRSUAPI_DRS_ASYNC_OP) { + timeout = IRPC_CALL_TIMEOUT; + } else { + /* + * use Infinite time for timeout in case + * the caller made a sync call + */ + timeout = IRPC_CALL_TIMEOUT_INF; + } + + dcesrv_irpc_forward_rpc_call(dce_call, mem_ctx, + r, NDR_DRSUAPI_DSREPLICASYNC, &ndr_table_drsuapi, "dreplsrv", "DsReplicaSync", - IRPC_CALL_TIMEOUT); + timeout); return WERR_OK; } |