summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2009-08-11 11:17:14 +0200
committerKarolin Seeger <kseeger@samba.org>2009-08-11 15:38:38 +0200
commit91ac57e6b443732f64c92788d7a18ae568601763 (patch)
tree157a3ee0f77be1f3479ab68a08540e854d1d0bc0
parent2a955d009e714d28017a3043d294ad37289f6718 (diff)
downloadsamba-91ac57e6b443732f64c92788d7a18ae568601763.tar.gz
samba-91ac57e6b443732f64c92788d7a18ae568601763.tar.xz
samba-91ac57e6b443732f64c92788d7a18ae568601763.zip
s3:winbindd: raise the timeout for lsa_Lookup*() calls from 10 to 35 seconds.
metze (similar to commit 1e1445bc7672b17a1d689fa0f0732b05b6e04da5) Fixes bug #6627.
-rw-r--r--source/winbindd/winbindd_ads.c21
-rw-r--r--source/winbindd/winbindd_rpc.c37
2 files changed, 57 insertions, 1 deletions
diff --git a/source/winbindd/winbindd_ads.c b/source/winbindd/winbindd_ads.c
index c1301585b34..cef36c4555d 100644
--- a/source/winbindd/winbindd_ads.c
+++ b/source/winbindd/winbindd_ads.c
@@ -1119,6 +1119,7 @@ static NTSTATUS lookup_groupmem(struct winbindd_domain *domain,
/* handle sids not resolved from cache by lsa_lookup_sids */
if (num_nocache > 0) {
+ unsigned int orig_timeout;
status = cm_connect_lsa(domain, tmp_ctx, &cli, &lsa_policy);
@@ -1126,6 +1127,13 @@ static NTSTATUS lookup_groupmem(struct winbindd_domain *domain,
goto done;
}
+ /*
+ * This call can take a long time
+ * allow the server to time out.
+ * 35 seconds should do it.
+ */
+ orig_timeout = cli_set_timeout(cli->cli, 35000);
+
status = rpccli_lsa_lookup_sids(cli, tmp_ctx,
&lsa_policy,
num_nocache,
@@ -1134,6 +1142,9 @@ static NTSTATUS lookup_groupmem(struct winbindd_domain *domain,
&names_nocache,
&name_types_nocache);
+ /* And restore our original timeout. */
+ cli_set_timeout(cli->cli, orig_timeout);
+
if (!(NT_STATUS_IS_OK(status) ||
NT_STATUS_EQUAL(status, STATUS_SOME_UNMAPPED) ||
NT_STATUS_EQUAL(status, NT_STATUS_NONE_MAPPED)))
@@ -1148,6 +1159,13 @@ static NTSTATUS lookup_groupmem(struct winbindd_domain *domain,
goto done;
}
+ /*
+ * This call can take a long time
+ * allow the server to time out.
+ * 35 seconds should do it.
+ */
+ orig_timeout = cli_set_timeout(cli->cli, 35000);
+
status = rpccli_lsa_lookup_sids(cli, tmp_ctx,
&lsa_policy,
num_nocache,
@@ -1155,6 +1173,9 @@ static NTSTATUS lookup_groupmem(struct winbindd_domain *domain,
&domains_nocache,
&names_nocache,
&name_types_nocache);
+
+ /* And restore our original timeout. */
+ cli_set_timeout(cli->cli, orig_timeout);
}
if (NT_STATUS_IS_OK(status) ||
diff --git a/source/winbindd/winbindd_rpc.c b/source/winbindd/winbindd_rpc.c
index f6a9c666bcf..81154df0aac 100644
--- a/source/winbindd/winbindd_rpc.c
+++ b/source/winbindd/winbindd_rpc.c
@@ -279,6 +279,7 @@ static NTSTATUS msrpc_name_to_sid(struct winbindd_domain *domain,
char *full_name = NULL;
struct rpc_pipe_client *cli;
POLICY_HND lsa_policy;
+ unsigned int orig_timeout;
if (name == NULL || *name=='\0') {
full_name = talloc_asprintf(mem_ctx, "%s", domain_name);
@@ -302,9 +303,19 @@ static NTSTATUS msrpc_name_to_sid(struct winbindd_domain *domain,
if (!NT_STATUS_IS_OK(result))
return result;
+ /*
+ * This call can take a long time
+ * allow the server to time out.
+ * 35 seconds should do it.
+ */
+ orig_timeout = cli_set_timeout(cli->cli, 35000);
+
result = rpccli_lsa_lookup_names(cli, mem_ctx, &lsa_policy, 1,
(const char**) &full_name, NULL, 1, &sids, &types);
-
+
+ /* And restore our original timeout. */
+ cli_set_timeout(cli->cli, orig_timeout);
+
if (!NT_STATUS_IS_OK(result))
return result;
@@ -332,6 +343,7 @@ static NTSTATUS msrpc_sid_to_name(struct winbindd_domain *domain,
NTSTATUS result;
struct rpc_pipe_client *cli;
POLICY_HND lsa_policy;
+ unsigned int orig_timeout;
DEBUG(3,("sid_to_name [rpc] %s for domain %s\n", sid_string_dbg(sid),
domain->name ));
@@ -344,8 +356,19 @@ static NTSTATUS msrpc_sid_to_name(struct winbindd_domain *domain,
}
+ /*
+ * This call can take a long time
+ * allow the server to time out.
+ * 35 seconds should do it.
+ */
+ orig_timeout = cli_set_timeout(cli->cli, 35000);
+
result = rpccli_lsa_lookup_sids(cli, mem_ctx, &lsa_policy,
1, sid, &domains, &names, &types);
+
+ /* And restore our original timeout. */
+ cli_set_timeout(cli->cli, orig_timeout);
+
if (!NT_STATUS_IS_OK(result)) {
DEBUG(2,("msrpc_sid_to_name: rpccli_lsa_lookup_sids() failed (%s)\n",
nt_errstr(result)));
@@ -378,6 +401,7 @@ static NTSTATUS msrpc_rids_to_names(struct winbindd_domain *domain,
DOM_SID *sids;
size_t i;
char **ret_names;
+ unsigned int orig_timeout;
DEBUG(3, ("rids_to_names [rpc] for domain %s\n", domain->name ));
@@ -401,9 +425,20 @@ static NTSTATUS msrpc_rids_to_names(struct winbindd_domain *domain,
return result;
}
+ /*
+ * This call can take a long time
+ * allow the server to time out.
+ * 35 seconds should do it.
+ */
+ orig_timeout = cli_set_timeout(cli->cli, 35000);
+
result = rpccli_lsa_lookup_sids(cli, mem_ctx, &lsa_policy,
num_rids, sids, &domains,
names, types);
+
+ /* And restore our original timeout. */
+ cli_set_timeout(cli->cli, orig_timeout);
+
if (!NT_STATUS_IS_OK(result) &&
!NT_STATUS_EQUAL(result, STATUS_SOME_UNMAPPED)) {
return result;