summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorGünther Deschner <gd@samba.org>2006-10-16 14:29:14 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:15:29 -0500
commit258f7b50dc3a513d6ea956e2231aa43a57fa81c7 (patch)
tree22937a508955b835886a44f913030d98ab10e47e /source3
parent25cba8669d7d97796ee880c779cdb036e45202b4 (diff)
downloadsamba-258f7b50dc3a513d6ea956e2231aa43a57fa81c7.tar.gz
samba-258f7b50dc3a513d6ea956e2231aa43a57fa81c7.tar.bz2
samba-258f7b50dc3a513d6ea956e2231aa43a57fa81c7.zip
r19340: Wait longer then 10 seconds for a samr_query_groupmem lookup to succeed.
Guenther (This used to be commit 37dd019e21cab2f0df314b0b741f79422fc10d1b)
Diffstat (limited to 'source3')
-rw-r--r--source3/nsswitch/winbindd_rpc.c9
-rw-r--r--source3/rpcclient/cmd_samr.c6
2 files changed, 15 insertions, 0 deletions
diff --git a/source3/nsswitch/winbindd_rpc.c b/source3/nsswitch/winbindd_rpc.c
index 06f0d2cb60..2e2b895352 100644
--- a/source3/nsswitch/winbindd_rpc.c
+++ b/source3/nsswitch/winbindd_rpc.c
@@ -615,6 +615,7 @@ static NTSTATUS lookup_groupmem(struct winbindd_domain *domain,
unsigned int j;
fstring sid_string;
struct rpc_pipe_client *cli;
+ unsigned int orig_timeout;
DEBUG(10,("rpc: lookup_groupmem %s sid=%s\n", domain->name,
sid_to_string(sid_string, group_sid)));
@@ -637,10 +638,18 @@ static NTSTATUS lookup_groupmem(struct winbindd_domain *domain,
/* Step #1: Get a list of user rids that are the members of the
group. */
+ /* 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_samr_query_groupmem(cli, mem_ctx,
&group_pol, num_names, &rid_mem,
name_types);
+ /* And restore our original timeout. */
+ cli_set_timeout(cli->cli, orig_timeout);
+
rpccli_samr_close(cli, mem_ctx, &group_pol);
if (!NT_STATUS_IS_OK(result))
diff --git a/source3/rpcclient/cmd_samr.c b/source3/rpcclient/cmd_samr.c
index fd3826d007..4ce613bde1 100644
--- a/source3/rpcclient/cmd_samr.c
+++ b/source3/rpcclient/cmd_samr.c
@@ -751,6 +751,7 @@ static NTSTATUS cmd_samr_query_groupmem(struct rpc_pipe_client *cli,
uint32 access_mask = MAXIMUM_ALLOWED_ACCESS;
int i;
fstring server;
+ unsigned int old_timeout;
if ((argc < 2) || (argc > 3)) {
printf("Usage: %s rid [access mask]\n", argv[0]);
@@ -785,10 +786,15 @@ static NTSTATUS cmd_samr_query_groupmem(struct rpc_pipe_client *cli,
if (!NT_STATUS_IS_OK(result))
goto done;
+ /* Make sure to wait for our DC's reply */
+ old_timeout = cli_set_timeout(cli->cli, 30000); /* 30 seconds. */
+
result = rpccli_samr_query_groupmem(cli, mem_ctx, &group_pol,
&num_members, &group_rids,
&group_attrs);
+ cli_set_timeout(cli->cli, old_timeout);
+
if (!NT_STATUS_IS_OK(result))
goto done;