]> git.ipfire.org Git - ipfire-2.x.git/blob - src/patches/samba/samba-3.6.99-fix_rpcclient_timeout_command.patch
Merge branch 'core110'
[ipfire-2.x.git] / src / patches / samba / samba-3.6.99-fix_rpcclient_timeout_command.patch
1 From fe30cb2d1932401b5507af9f12149506cf0ae749 Mon Sep 17 00:00:00 2001
2 From: Andreas Schneider <asn@samba.org>
3 Date: Tue, 7 Apr 2015 16:12:18 +0200
4 Subject: [PATCH] PATCHSET25: rpcclient: Fix the timeout command
5
6 https://bugzilla.samba.org/show_bug.cgi?id=11199
7
8 Signed-off-by: Andreas Schneider <asn@samba.org>
9 Reviewed-by: Stefan Metzmacher <metze@samba.org>
10
11 (cherry picked from commit 2bca4cdc6f83dce48c73a33288c4fd3ae80f883b)
12 ---
13 source3/rpcclient/rpcclient.c | 23 +++++++----------------
14 1 file changed, 7 insertions(+), 16 deletions(-)
15
16 diff --git a/source3/rpcclient/rpcclient.c b/source3/rpcclient/rpcclient.c
17 index c2f3e4c..0dbcd01 100644
18 --- a/source3/rpcclient/rpcclient.c
19 +++ b/source3/rpcclient/rpcclient.c
20 @@ -481,8 +481,6 @@ static NTSTATUS cmd_seal(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
21 static NTSTATUS cmd_timeout(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
22 int argc, const char **argv)
23 {
24 - struct cmd_list *tmp;
25 -
26 if (argc > 2) {
27 printf("Usage: %s timeout\n", argv[0]);
28 return NT_STATUS_OK;
29 @@ -490,19 +488,6 @@ static NTSTATUS cmd_timeout(struct rpc_pipe_client *cli, TALLOC_CTX *mem_ctx,
30
31 if (argc == 2) {
32 timeout = atoi(argv[1]);
33 -
34 - for (tmp = cmd_list; tmp; tmp = tmp->next) {
35 -
36 - struct cmd_set *tmp_set;
37 -
38 - for (tmp_set = tmp->cmd_set; tmp_set->name; tmp_set++) {
39 - if (tmp_set->rpc_pipe == NULL) {
40 - continue;
41 - }
42 -
43 - rpccli_set_timeout(tmp_set->rpc_pipe, timeout);
44 - }
45 - }
46 }
47
48 printf("timeout is %d\n", timeout);
49 @@ -791,6 +776,11 @@ static NTSTATUS do_cmd(struct cli_state *cli,
50 }
51 }
52
53 + /* Set timeout for new connections */
54 + if (cmd_entry->rpc_pipe) {
55 + rpccli_set_timeout(cmd_entry->rpc_pipe, timeout);
56 + }
57 +
58 /* Run command */
59
60 if ( cmd_entry->returntype == RPC_RTYPE_NTSTATUS ) {
61 @@ -1124,7 +1114,8 @@ out_free:
62
63 /* Load command lists */
64
65 - timeout = cli_set_timeout(cli, 10000);
66 + timeout = 10000;
67 + cli_set_timeout(cli, timeout);
68
69 cmd_set = rpcclient_command_list;
70
71 --
72 2.1.0
73