From 56b4e4b62ce452515ec1b390eb578f55a195fdf9 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Mon, 31 Oct 2005 02:12:13 +0000 Subject: r11402: In response to comments by volker, expand our Netlogon DsRGetDCName IDL and testsuites. The server-side of this remains a stub, we should probably be doing ldb searches for the server reference record. Andrew Bartlett (This used to be commit 0141ed309a664e7a9893c95232c2dcb9768f9315) --- source4/rpc_server/netlogon/dcerpc_netlogon.c | 87 +++++++++++++++++++-------- 1 file changed, 61 insertions(+), 26 deletions(-) (limited to 'source4/rpc_server/netlogon/dcerpc_netlogon.c') diff --git a/source4/rpc_server/netlogon/dcerpc_netlogon.c b/source4/rpc_server/netlogon/dcerpc_netlogon.c index 63c211baec..e482a229b7 100644 --- a/source4/rpc_server/netlogon/dcerpc_netlogon.c +++ b/source4/rpc_server/netlogon/dcerpc_netlogon.c @@ -719,16 +719,6 @@ static WERROR netr_NETRENUMERATETRUSTEDDOMAINS(struct dcesrv_call_state *dce_cal } -/* - netr_DSRGETDCNAME -*/ -static WERROR netr_DSRGETDCNAME(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, - struct netr_DSRGETDCNAME *r) -{ - DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR); -} - - /* netr_NETRLOGONDUMMYROUTINE1 */ @@ -779,21 +769,12 @@ static WERROR netr_NETRLOGONCOMPUTECLIENTDIGEST(struct dcesrv_call_state *dce_ca } -/* - netr_DSRGETDCNAMEX -*/ -static WERROR netr_DSRGETDCNAMEX(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, - struct netr_DSRGETDCNAMEX *r) -{ - DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR); -} - /* - netr_DSRGETSITENAME + netr_DsRGetSiteName */ -static WERROR netr_DSRGETSITENAME(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, - struct netr_DSRGETSITENAME *r) +static WERROR netr_DsRGetSiteName(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, + struct netr_DsRGetSiteName *r) { DCESRV_FAULT(DCERPC_FAULT_OP_RNG_ERROR); } @@ -1016,10 +997,10 @@ static WERROR netr_DSRADDRESSTOSITENAMESW(struct dcesrv_call_state *dce_call, TA /* - netr_DrsGetDCNameEx2 + netr_DsRGetDCNameEx2 */ -static WERROR netr_DrsGetDCNameEx2(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, - struct netr_DrsGetDCNameEx2 *r) +static WERROR netr_DsRGetDCNameEx2(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, + struct netr_DsRGetDCNameEx2 *r) { const char * const attrs[] = { "dnsDomain", "objectGUID", NULL }; void *sam_ctx; @@ -1040,7 +1021,7 @@ static WERROR netr_DrsGetDCNameEx2(struct dcesrv_call_state *dce_call, TALLOC_CT return WERR_NO_SUCH_DOMAIN; } - r->out.info = talloc(mem_ctx, struct netr_DrsGetDCNameEx2Info); + r->out.info = talloc(mem_ctx, struct netr_DsRGetDCNameInfo); if (!r->out.info) { return WERR_NOMEM; } @@ -1061,6 +1042,60 @@ static WERROR netr_DrsGetDCNameEx2(struct dcesrv_call_state *dce_call, TALLOC_CT return WERR_OK; } +/* + netr_DsRGetDCNameEx +*/ +static WERROR netr_DsRGetDCNameEx(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, + struct netr_DsRGetDCNameEx *r) +{ + struct netr_DsRGetDCNameEx2 r2; + WERROR werr; + + ZERO_STRUCT(r2); + + r2.in.server_unc = r->in.server_unc; + r2.in.client_account = NULL; + r2.in.mask = 0; + r2.in.domain_guid = r->in.domain_guid; + r2.in.domain_name = r->in.domain_name; + r2.in.site_name = r->in.site_name; + r2.in.flags = r->in.flags; + r2.out.info = NULL; + + werr = netr_DsRGetDCNameEx2(dce_call, mem_ctx, &r2); + + r->out.info = r2.out.info; + + return werr; +} + +/* + netr_DsRGetDCName +*/ +static WERROR netr_DsRGetDCName(struct dcesrv_call_state *dce_call, TALLOC_CTX *mem_ctx, + struct netr_DsRGetDCName *r) +{ + struct netr_DsRGetDCNameEx2 r2; + WERROR werr; + + ZERO_STRUCT(r2); + + r2.in.server_unc = r->in.server_unc; + r2.in.client_account = NULL; + r2.in.mask = 0; + r2.in.domain_name = r->in.domain_name; + r2.in.domain_guid = r->in.domain_guid; + + r2.in.site_name = NULL; /* should fill in from site GUID */ + r2.in.flags = r->in.flags; + r2.out.info = NULL; + + werr = netr_DsRGetDCNameEx2(dce_call, mem_ctx, &r2); + + r->out.info = r2.out.info; + + return werr; +} /* netr_NETRLOGONGETTIMESERVICEPARENTDOMAIN -- cgit