diff options
author | Matthias Dieter Wallnöfer <mdw@samba.org> | 2010-04-22 10:28:37 +0200 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2010-04-27 15:24:42 +1000 |
commit | 4686305feb13f6c824843cb2ab8d55f59254303c (patch) | |
tree | 9a83c884edfbac5bfc0e9312d082ec6ec2cd1e58 /source4/rpc_server | |
parent | a66bdbec86f2da8b53518b05018f2c17261b9003 (diff) | |
download | samba-4686305feb13f6c824843cb2ab8d55f59254303c.tar.gz samba-4686305feb13f6c824843cb2ab8d55f59254303c.tar.bz2 samba-4686305feb13f6c824843cb2ab8d55f59254303c.zip |
s4:dcesrv_netr_DsrGetDcSiteCoverageW - provide a basic implementation
Does for now only return DC's primary site.
Signed-off-by: Andrew Tridgell <tridge@samba.org>
Diffstat (limited to 'source4/rpc_server')
-rw-r--r-- | source4/rpc_server/netlogon/dcerpc_netlogon.c | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/source4/rpc_server/netlogon/dcerpc_netlogon.c b/source4/rpc_server/netlogon/dcerpc_netlogon.c index 216c5a2c4f..c7bbbb3701 100644 --- a/source4/rpc_server/netlogon/dcerpc_netlogon.c +++ b/source4/rpc_server/netlogon/dcerpc_netlogon.c @@ -1786,7 +1786,29 @@ static WERROR dcesrv_netr_DsRAddressToSitenamesW(struct dcesrv_call_state *dce_c static WERROR dcesrv_netr_DsrGetDcSiteCoverageW(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, struct netr_DsrGetDcSiteCoverageW *r) { - DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR); + struct ldb_context *sam_ctx; + struct DcSitesCtr *ctr; + struct loadparm_context *lp_ctx = dce_call->conn->dce_ctx->lp_ctx; + + sam_ctx = samdb_connect(mem_ctx, dce_call->event_ctx, lp_ctx, + dce_call->conn->auth_state.session_info); + if (sam_ctx == NULL) { + return WERR_DS_UNAVAILABLE; + } + + ctr = talloc(mem_ctx, struct DcSitesCtr); + W_ERROR_HAVE_NO_MEMORY(ctr); + + *r->out.ctr = ctr; + + /* For now only return our default site */ + ctr->num_sites = 1; + ctr->sites = talloc_array(ctr, struct lsa_String, ctr->num_sites); + W_ERROR_HAVE_NO_MEMORY(ctr->sites); + ctr->sites[0].string = samdb_server_site_name(sam_ctx, mem_ctx); + W_ERROR_HAVE_NO_MEMORY(ctr->sites[0].string); + + return WERR_OK; } |