From 00056ab43192dc83b823e51126772ba4c19d0519 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 6 Oct 2006 21:35:26 +0000 Subject: r19159: The getdc call can take a long time. Allow for timeouts. Jeremy. (This used to be commit 99bebb65273c78d9867254c47438577bb21af4ee) --- source3/nsswitch/winbindd_cm.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'source3/nsswitch') diff --git a/source3/nsswitch/winbindd_cm.c b/source3/nsswitch/winbindd_cm.c index b947ce75ec..45fce21450 100644 --- a/source3/nsswitch/winbindd_cm.c +++ b/source3/nsswitch/winbindd_cm.c @@ -294,7 +294,7 @@ static BOOL get_dc_name_via_netlogon(const struct winbindd_domain *domain, NTSTATUS result; WERROR werr; TALLOC_CTX *mem_ctx; - + unsigned int orig_timeout; fstring tmp; char *p; @@ -320,9 +320,17 @@ static BOOL get_dc_name_via_netlogon(const struct winbindd_domain *domain, return False; } + /* This call can take a long time - allow the server to time out. + 35 seconds should do it. */ + + orig_timeout = cli_set_timeout(netlogon_pipe->cli, 35000); + werr = rpccli_netlogon_getdcname(netlogon_pipe, mem_ctx, our_domain->dcname, domain->name, tmp); + /* And restore our original timeout. */ + cli_set_timeout(netlogon_pipe->cli, orig_timeout); + talloc_destroy(mem_ctx); if (!W_ERROR_IS_OK(werr)) { -- cgit