From ba93d0e5c8418eb11a5fa0bb48c1ec3a0ebd403b Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 21 Sep 2007 10:25:33 +0000 Subject: r25275: w2k3 (as PDC emulator) returns WERR_NO_SUCH_DOMAIN to netlogon_getanydcname() when called for it's own domain. So we should use netlogon_getdcname() which returns WERR_OK:-) gd: feel free to usage rpccli_netlogon_dsr_getdcname(), but please make sure the new WINBIND-STRUCT-GETDCNAME test is still passing. metze (This used to be commit 9a9c164366a252ab8268b687699d54048ced993f) --- source3/winbindd/winbindd_misc.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'source3') diff --git a/source3/winbindd/winbindd_misc.c b/source3/winbindd/winbindd_misc.c index 30386cc6eb..5513e1790b 100644 --- a/source3/winbindd/winbindd_misc.c +++ b/source3/winbindd/winbindd_misc.c @@ -236,6 +236,7 @@ enum winbindd_result winbindd_dual_getdcname(struct winbindd_domain *domain, NTSTATUS result; WERROR werr; unsigned int orig_timeout; + struct winbindd_domain *req_domain; state->request.domain_name [sizeof(state->request.domain_name)-1] = '\0'; @@ -255,9 +256,18 @@ enum winbindd_result winbindd_dual_getdcname(struct winbindd_domain *domain, orig_timeout = cli_set_timeout(netlogon_pipe->cli, 35000); - werr = rpccli_netlogon_getanydcname(netlogon_pipe, state->mem_ctx, domain->dcname, - state->request.domain_name, - dcname_slash); + req_domain = find_domain_from_name_noinit(state->request.domain_name); + if (req_domain == domain) { + werr = rpccli_netlogon_getdcname(netlogon_pipe, state->mem_ctx, + domain->dcname, + state->request.domain_name, + dcname_slash); + } else { + werr = rpccli_netlogon_getanydcname(netlogon_pipe, state->mem_ctx, + domain->dcname, + state->request.domain_name, + dcname_slash); + } /* And restore our original timeout. */ cli_set_timeout(netlogon_pipe->cli, orig_timeout); -- cgit