summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
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;