[SCM] Samba Shared Repository - branch v3-2-stable updated - release-3-2-13-28-g7aea93c
Karolin Seeger
kseeger at samba.org
Tue Aug 11 07:44:15 MDT 2009
The branch, v3-2-stable has been updated
via 7aea93c3d1060f277aab87e85fb3066b4f666109 (commit)
via c34798994b8660586ff6447ba66b79a20580591c (commit)
via 2f1023ece2ed165815ac2d8bc70a29d9e9e2591e (commit)
from 62218f6a7e579f33db46da178d53cdb2db9d2b54 (commit)
http://gitweb.samba.org/?p=samba.git;a=shortlog;h=v3-2-stable
- Log -----------------------------------------------------------------
commit 7aea93c3d1060f277aab87e85fb3066b4f666109
Author: Michael Adam <obnox at samba.org>
Date: Fri Jun 26 14:09:10 2009 +0200
s3:passdb: fix bug #6509: use gid (not uid) cache in fetch_gid_from_cache().
With the previous code, the cache can never have been hit at all.
Michael
(cherry picked from commit 12277e145f4dcc589e84e4a90b2497728d2317b6)
commit c34798994b8660586ff6447ba66b79a20580591c
Author: Karolin Seeger <kseeger at samba.org>
Date: Tue Aug 11 15:41:21 2009 +0200
WHATSNEW: Update changes.
Karolin
(cherry picked from commit 9bcfbccad5d5983cfa42f31f6394f03c4678e79a)
commit 2f1023ece2ed165815ac2d8bc70a29d9e9e2591e
Author: Stefan Metzmacher <metze at samba.org>
Date: Tue Aug 11 11:17:14 2009 +0200
s3:winbindd: raise the timeout for lsa_Lookup*() calls from 10 to 35 seconds.
metze
(similar to commit 1e1445bc7672b17a1d689fa0f0732b05b6e04da5)
Fixes bug #6627.
(cherry picked from commit 91ac57e6b443732f64c92788d7a18ae568601763)
-----------------------------------------------------------------------
Summary of changes:
WHATSNEW.txt | 1 +
source/passdb/lookup_sid.c | 2 +-
source/winbindd/winbindd_ads.c | 21 +++++++++++++++++++++
source/winbindd/winbindd_rpc.c | 37 ++++++++++++++++++++++++++++++++++++-
4 files changed, 59 insertions(+), 2 deletions(-)
Changeset truncated at 500 lines:
diff --git a/WHATSNEW.txt b/WHATSNEW.txt
index f7ebc21..f29e92c 100644
--- a/WHATSNEW.txt
+++ b/WHATSNEW.txt
@@ -72,6 +72,7 @@ o Stefan Metzmacher <metze at samba.org>
* BUG 2346: Fix posix ACLs when setting an ACL without explicit ACE for the
owner.
* BUG 6526: Let parent_dirname() correctly return toplevel filenames.
+ * BUG 6627: Raise the timeout for lsa_Lookup*() calls from 10 to 35 seconds.
* Fix a crash bug if we timeout in net rpc trustdom list.
* Add '--request-timeout' option to 'net'.
diff --git a/source/passdb/lookup_sid.c b/source/passdb/lookup_sid.c
index 1971cae..3cd7d02 100644
--- a/source/passdb/lookup_sid.c
+++ b/source/passdb/lookup_sid.c
@@ -1085,7 +1085,7 @@ static bool fetch_gid_from_cache(gid_t *pgid, const DOM_SID *psid)
{
DATA_BLOB cache_value;
- if (!memcache_lookup(NULL, SID_UID_CACHE,
+ if (!memcache_lookup(NULL, SID_GID_CACHE,
data_blob_const(psid, ndr_size_dom_sid(psid, 0)),
&cache_value)) {
return false;
diff --git a/source/winbindd/winbindd_ads.c b/source/winbindd/winbindd_ads.c
index c130158..cef36c4 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 f6a9c66..81154df 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;
--
Samba Shared Repository
More information about the samba-cvs
mailing list