1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-02 09:47:23 +03:00

s4-netlogon: merge netr_GetAnyDCName from s3 idl (untested).

Guenther
This commit is contained in:
Günther Deschner 2008-10-28 01:23:04 +01:00
parent 2a329c4963
commit a674a3bbf3
4 changed files with 12 additions and 6 deletions

View File

@ -867,7 +867,7 @@ interface netlogon
WERROR netr_GetAnyDCName(
[in,unique] [string,charset(UTF16)] uint16 *logon_server,
[in,unique] [string,charset(UTF16)] uint16 *domainname,
[out,unique] [string,charset(UTF16)] uint16 *dcname
[out,ref] [string,charset(UTF16)] uint16 **dcname
);

View File

@ -916,15 +916,17 @@ static bool test_GetAnyDCName(struct torture_context *tctx,
{
NTSTATUS status;
struct netr_GetAnyDCName r;
const char *dcname = NULL;
r.in.logon_server = talloc_asprintf(tctx, "\\\\%s", dcerpc_server_name(p));
r.in.domainname = lp_workgroup(tctx->lp_ctx);
r.out.dcname = &dcname;
status = dcerpc_netr_GetAnyDCName(p, tctx, &r);
torture_assert_ntstatus_ok(tctx, status, "GetAnyDCName");
if (r.out.dcname) {
torture_comment(tctx, "\tDC is at '%s'\n", r.out.dcname);
if (dcname) {
torture_comment(tctx, "\tDC is at '%s'\n", dcname);
}
return true;
@ -1569,6 +1571,7 @@ static bool test_ManyGetDCName(struct torture_context *tctx,
struct lsa_EnumTrustDom t;
uint32_t resume_handle = 0;
struct netr_GetAnyDCName d;
const char *dcname = NULL;
int i;
@ -1620,6 +1623,7 @@ static bool test_ManyGetDCName(struct torture_context *tctx,
d.in.logon_server = talloc_asprintf(tctx, "\\\\%s",
dcerpc_server_name(p));
d.out.dcname = &dcname;
for (i=0; i<domains.count * 4; i++) {
struct lsa_DomainInfo *info =
@ -1631,7 +1635,7 @@ static bool test_ManyGetDCName(struct torture_context *tctx,
torture_assert_ntstatus_ok(tctx, status, "GetAnyDCName");
torture_comment(tctx, "\tDC for domain %s is %s\n", info->name.string,
d.out.dcname ? d.out.dcname : "unknown");
dcname ? dcname : "unknown");
}
return true;

View File

@ -81,6 +81,7 @@ static void getdcname_recv_domain(struct composite_context *ctx)
state, "\\\\%s",
dcerpc_server_name(domain->netlogon_pipe));
state->g.in.domainname = state->domain_name;
state->g.out.dcname = talloc(state, const char **);
req = dcerpc_netr_GetAnyDCName_send(domain->netlogon_pipe, state,
&state->g);
@ -111,7 +112,7 @@ NTSTATUS wb_cmd_getdcname_recv(struct composite_context *c,
talloc_get_type(c->private_data, struct cmd_getdcname_state);
NTSTATUS status = composite_wait(c);
if (NT_STATUS_IS_OK(status)) {
const char *p = state->g.out.dcname;
const char *p = *(state->g.out.dcname);
if (*p == '\\') p += 1;
if (*p == '\\') p += 1;
*dcname = talloc_strdup(mem_ctx, p);

View File

@ -161,6 +161,7 @@ static void trusted_dom_info_recv_dsr(struct rpc_request *req)
state, "\\\\%s",
dcerpc_server_name(state->my_domain->netlogon_pipe));
state->g.in.domainname = state->info->name;
state->g.out.dcname = talloc(state, const char *);
req = dcerpc_netr_GetAnyDCName_send(state->my_domain->netlogon_pipe,
state, &state->g);
@ -187,7 +188,7 @@ static void trusted_dom_info_recv_dcname(struct rpc_request *req)
state->info->num_dcs = 1;
state->info->dcs = talloc(state->info, struct nbt_dc_name);
state->info->dcs[0].name = talloc_steal(state->info,
state->g.out.dcname);
*(state->g.out.dcname));
if (*state->info->dcs[0].name == '\\') state->info->dcs[0].name++;
if (*state->info->dcs[0].name == '\\') state->info->dcs[0].name++;