summaryrefslogtreecommitdiff
path: root/source3/winbindd/winbindd_rpc.c
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2009-08-11 13:50:16 +0200
committerStefan Metzmacher <metze@samba.org>2009-08-11 13:53:33 +0200
commit1e1445bc7672b17a1d689fa0f0732b05b6e04da5 (patch)
treeb5ff2238ac1787fecbe3a75380d8ed914f3c3305 /source3/winbindd/winbindd_rpc.c
parente13c14e7e440f56069aac6c6568b56e48e7ea825 (diff)
downloadsamba-1e1445bc7672b17a1d689fa0f0732b05b6e04da5.tar.gz
samba-1e1445bc7672b17a1d689fa0f0732b05b6e04da5.tar.bz2
samba-1e1445bc7672b17a1d689fa0f0732b05b6e04da5.zip
s3:winbindd: raise the timeout for lsa_Lookup*() calls from 10 to 35 seconds.
metze
Diffstat (limited to 'source3/winbindd/winbindd_rpc.c')
-rw-r--r--source3/winbindd/winbindd_rpc.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/source3/winbindd/winbindd_rpc.c b/source3/winbindd/winbindd_rpc.c
index 037fae09c6..3aa4231506 100644
--- a/source3/winbindd/winbindd_rpc.c
+++ b/source3/winbindd/winbindd_rpc.c
@@ -281,6 +281,7 @@ static NTSTATUS msrpc_name_to_sid(struct winbindd_domain *domain,
struct policy_handle lsa_policy;
NTSTATUS name_map_status = NT_STATUS_UNSUCCESSFUL;
char *mapped_name = NULL;
+ unsigned int orig_timeout;
if (name == NULL || *name=='\0') {
full_name = talloc_asprintf(mem_ctx, "%s", domain_name);
@@ -314,9 +315,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 = rpccli_set_timeout(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. */
+ rpccli_set_timeout(cli, orig_timeout);
+
if (!NT_STATUS_IS_OK(result))
return result;
@@ -346,6 +357,7 @@ static NTSTATUS msrpc_sid_to_name(struct winbindd_domain *domain,
struct policy_handle lsa_policy;
NTSTATUS name_map_status = NT_STATUS_UNSUCCESSFUL;
char *mapped_name = NULL;
+ unsigned int orig_timeout;
DEBUG(3,("sid_to_name [rpc] %s for domain %s\n", sid_string_dbg(sid),
domain->name ));
@@ -358,8 +370,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 = rpccli_set_timeout(cli, 35000);
+
result = rpccli_lsa_lookup_sids(cli, mem_ctx, &lsa_policy,
1, sid, &domains, &names, &types);
+
+ /* And restore our original timeout. */
+ rpccli_set_timeout(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)));
@@ -400,6 +423,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 ));
@@ -423,9 +447,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 = rpccli_set_timeout(cli, 35000);
+
result = rpccli_lsa_lookup_sids(cli, mem_ctx, &lsa_policy,
num_rids, sids, &domains,
names, types);
+
+ /* And restore our original timeout. */
+ rpccli_set_timeout(cli, orig_timeout);
+
if (!NT_STATUS_IS_OK(result) &&
!NT_STATUS_EQUAL(result, STATUS_SOME_UNMAPPED)) {
return result;