summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mdw@samba.org>2010-04-18 19:01:18 +0200
committerAndrew Tridgell <tridge@samba.org>2010-04-27 15:24:41 +1000
commit3b4137c7be94678e3bd3553fa05feea1efe0f5fd (patch)
tree22d9e56278a956b6498320d3c11bda096cd5785d
parent2780a18a9fc3aac355c141fe0393e1f8008e242f (diff)
downloadsamba-3b4137c7be94678e3bd3553fa05feea1efe0f5fd.tar.gz
samba-3b4137c7be94678e3bd3553fa05feea1efe0f5fd.tar.bz2
samba-3b4137c7be94678e3bd3553fa05feea1efe0f5fd.zip
s4:dcesrv_netr_DsRGetSiteName - provide an implementation according to the MS-NRPC docs
Signed-off-by: Andrew Tridgell <tridge@samba.org>
-rw-r--r--source4/rpc_server/netlogon/dcerpc_netlogon.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/source4/rpc_server/netlogon/dcerpc_netlogon.c b/source4/rpc_server/netlogon/dcerpc_netlogon.c
index c5a9b302ac..216c5a2c4f 100644
--- a/source4/rpc_server/netlogon/dcerpc_netlogon.c
+++ b/source4/rpc_server/netlogon/dcerpc_netlogon.c
@@ -1136,7 +1136,19 @@ static WERROR dcesrv_netr_NETRLOGONCOMPUTECLIENTDIGEST(struct dcesrv_call_state
static WERROR dcesrv_netr_DsRGetSiteName(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx,
struct netr_DsRGetSiteName *r)
{
- DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR);
+ struct ldb_context *sam_ctx;
+ 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;
+ }
+
+ *r->out.site = samdb_server_site_name(sam_ctx, mem_ctx);
+ W_ERROR_HAVE_NO_MEMORY(*r->out.site);
+
+ return WERR_OK;
}