summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2008-04-19 23:27:35 +0200
committerVolker Lendecke <vl@samba.org>2008-04-20 00:14:26 +0200
commite1102b8f48aeebe7d4e730d2b432a1503b425210 (patch)
tree3179083bb844b6537f3a88c1df2100f51fb6fc81 /source3
parent9048cafbeaf82d1916de6538024fd660612dd25f (diff)
downloadsamba-e1102b8f48aeebe7d4e730d2b432a1503b425210.tar.gz
samba-e1102b8f48aeebe7d4e730d2b432a1503b425210.tar.bz2
samba-e1102b8f48aeebe7d4e730d2b432a1503b425210.zip
Introduce rpccli_set_timeout()
Reduce dependency on "cli" member of rpc_pipe_client struct (This used to be commit 2e4c1ba38963cffe4c3f25ab24bc28975f2fc291)
Diffstat (limited to 'source3')
-rw-r--r--source3/rpc_client/cli_pipe.c6
-rw-r--r--source3/rpcclient/cmd_netlogon.c10
-rw-r--r--source3/rpcclient/cmd_samr.c5
-rw-r--r--source3/rpcclient/rpcclient.c2
-rw-r--r--source3/winbindd/winbindd_cm.c4
-rw-r--r--source3/winbindd/winbindd_misc.c4
-rw-r--r--source3/winbindd/winbindd_rpc.c4
7 files changed, 22 insertions, 13 deletions
diff --git a/source3/rpc_client/cli_pipe.c b/source3/rpc_client/cli_pipe.c
index 3ef3f05cc6..64fcc16bde 100644
--- a/source3/rpc_client/cli_pipe.c
+++ b/source3/rpc_client/cli_pipe.c
@@ -2173,6 +2173,12 @@ static NTSTATUS rpc_pipe_bind(struct rpc_pipe_client *cli,
return NT_STATUS_OK;
}
+unsigned int rpccli_set_timeout(struct rpc_pipe_client *cli,
+ unsigned int timeout)
+{
+ return cli_set_timeout(cli->cli, timeout);
+}
+
/****************************************************************************
Open a named pipe over SMB to a remote server.
*
diff --git a/source3/rpcclient/cmd_netlogon.c b/source3/rpcclient/cmd_netlogon.c
index a30dd740e2..12d8cf3052 100644
--- a/source3/rpcclient/cmd_netlogon.c
+++ b/source3/rpcclient/cmd_netlogon.c
@@ -101,14 +101,15 @@ static WERROR cmd_netlogon_getanydcname(struct rpc_pipe_client *cli,
}
/* Make sure to wait for our DC's reply */
- old_timeout = cli_set_timeout(cli->cli, MAX(cli->cli->timeout,30000)); /* 30 seconds. */
+ old_timeout = rpccli_set_timeout(cli, 30000); /* 30 seconds. */
+ rpccli_set_timeout(cli, MAX(old_timeout, 30000)); /* At least 30 sec */
status = rpccli_netr_GetAnyDCName(cli, mem_ctx,
cli->desthost,
argv[1],
&dcname,
&werr);
- cli_set_timeout(cli->cli, old_timeout);
+ rpccli_set_timeout(cli, old_timeout);
if (!NT_STATUS_IS_OK(status)) {
return ntstatus_to_werror(status);
@@ -140,14 +141,15 @@ static WERROR cmd_netlogon_getdcname(struct rpc_pipe_client *cli,
}
/* Make sure to wait for our DC's reply */
- old_timeout = cli_set_timeout(cli->cli, MAX(cli->cli->timeout,30000)); /* 30 seconds. */
+ old_timeout = rpccli_set_timeout(cli, 30000); /* 30 seconds. */
+ rpccli_set_timeout(cli, MAX(30000, old_timeout)); /* At least 30 sec */
status = rpccli_netr_GetDcName(cli, mem_ctx,
cli->desthost,
argv[1],
&dcname,
&werr);
- cli_set_timeout(cli->cli, old_timeout);
+ rpccli_set_timeout(cli, old_timeout);
if (!NT_STATUS_IS_OK(status)) {
return ntstatus_to_werror(status);
diff --git a/source3/rpcclient/cmd_samr.c b/source3/rpcclient/cmd_samr.c
index e58354d0d3..4a820cd618 100644
--- a/source3/rpcclient/cmd_samr.c
+++ b/source3/rpcclient/cmd_samr.c
@@ -735,13 +735,14 @@ static NTSTATUS cmd_samr_query_groupmem(struct rpc_pipe_client *cli,
goto done;
/* Make sure to wait for our DC's reply */
- old_timeout = cli_set_timeout(cli->cli, MAX(cli->cli->timeout,30000)); /* 30 seconds. */
+ old_timeout = rpccli_set_timeout(cli, 30000); /* 30 seconds. */
+ rpccli_set_timeout(cli, MAX(30000, old_timeout)); /* At least 30 sec */
result = rpccli_samr_QueryGroupMember(cli, mem_ctx,
&group_pol,
&rids);
- cli_set_timeout(cli->cli, old_timeout);
+ rpccli_set_timeout(cli, old_timeout);
if (!NT_STATUS_IS_OK(result))
goto done;
diff --git a/source3/rpcclient/rpcclient.c b/source3/rpcclient/rpcclient.c
index 52dba2291b..8592e0a3b6 100644
--- a/source3/rpcclient/rpcclient.c
+++ b/source3/rpcclient/rpcclient.c
@@ -420,7 +420,7 @@ static NTSTATUS cmd_timeout(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
continue;
}
- cli_set_timeout(tmp_set->rpc_pipe->cli, timeout);
+ rpccli_set_timeout(tmp_set->rpc_pipe, timeout);
}
}
}
diff --git a/source3/winbindd/winbindd_cm.c b/source3/winbindd/winbindd_cm.c
index 71d2c029ee..8fcbae77ff 100644
--- a/source3/winbindd/winbindd_cm.c
+++ b/source3/winbindd/winbindd_cm.c
@@ -598,7 +598,7 @@ static bool get_dc_name_via_netlogon(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(netlogon_pipe->cli, 35000);
+ orig_timeout = rpccli_set_timeout(netlogon_pipe, 35000);
if (our_domain->active_directory) {
struct netr_DsRGetDCNameInfo *domain_info = NULL;
@@ -638,7 +638,7 @@ static bool get_dc_name_via_netlogon(struct winbindd_domain *domain,
}
/* And restore our original timeout. */
- cli_set_timeout(netlogon_pipe->cli, orig_timeout);
+ rpccli_set_timeout(netlogon_pipe, orig_timeout);
if (!NT_STATUS_IS_OK(result)) {
DEBUG(10,("rpccli_netr_GetAnyDCName failed: %s\n",
diff --git a/source3/winbindd/winbindd_misc.c b/source3/winbindd/winbindd_misc.c
index 93986d174e..bde2eafb53 100644
--- a/source3/winbindd/winbindd_misc.c
+++ b/source3/winbindd/winbindd_misc.c
@@ -333,7 +333,7 @@ enum winbindd_result winbindd_dual_getdcname(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(netlogon_pipe->cli, 35000);
+ orig_timeout = rpccli_set_timeout(netlogon_pipe, 35000);
req_domain = find_domain_from_name_noinit(state->request.domain_name);
if (req_domain == domain) {
@@ -352,7 +352,7 @@ enum winbindd_result winbindd_dual_getdcname(struct winbindd_domain *domain,
&werr);
}
/* And restore our original timeout. */
- cli_set_timeout(netlogon_pipe->cli, orig_timeout);
+ rpccli_set_timeout(netlogon_pipe, orig_timeout);
if (!NT_STATUS_IS_OK(result)) {
DEBUG(5,("Error requesting DCname for domain %s: %s\n",
diff --git a/source3/winbindd/winbindd_rpc.c b/source3/winbindd/winbindd_rpc.c
index 2a7704c8a5..bb79d7ec12 100644
--- a/source3/winbindd/winbindd_rpc.c
+++ b/source3/winbindd/winbindd_rpc.c
@@ -750,14 +750,14 @@ static NTSTATUS lookup_groupmem(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);
+ orig_timeout = rpccli_set_timeout(cli, 35000);
result = rpccli_samr_QueryGroupMember(cli, mem_ctx,
&group_pol,
&rids);
/* And restore our original timeout. */
- cli_set_timeout(cli->cli, orig_timeout);
+ rpccli_set_timeout(cli, orig_timeout);
rpccli_samr_Close(cli, mem_ctx, &group_pol);