summaryrefslogtreecommitdiffstats
path: root/source4/librpc
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2014-02-12 12:11:51 +0100
committerGünther Deschner <gd@samba.org>2014-02-13 11:54:13 +0100
commit1228a935ac35c73c53bdf8fbd33ed9c748300079 (patch)
tree89a8fa3820d99b7283c3de6b7f2bb9c59f8fdd80 /source4/librpc
parent6a193326d5c6f65a743d05704eab7ea5f07c469d (diff)
downloadsamba-1228a935ac35c73c53bdf8fbd33ed9c748300079.tar.gz
samba-1228a935ac35c73c53bdf8fbd33ed9c748300079.tar.xz
samba-1228a935ac35c73c53bdf8fbd33ed9c748300079.zip
s4:librpc/rpc: use dcerpc_binding_dup() before modifying the given binding
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
Diffstat (limited to 'source4/librpc')
-rw-r--r--source4/librpc/rpc/dcerpc.h4
-rw-r--r--source4/librpc/rpc/dcerpc_connect.c7
2 files changed, 6 insertions, 5 deletions
diff --git a/source4/librpc/rpc/dcerpc.h b/source4/librpc/rpc/dcerpc.h
index b4b2913cce..a28c3c4a93 100644
--- a/source4/librpc/rpc/dcerpc.h
+++ b/source4/librpc/rpc/dcerpc.h
@@ -168,7 +168,7 @@ NTSTATUS dcerpc_secondary_connection_recv(struct composite_context *c,
struct dcerpc_pipe **p2);
struct composite_context* dcerpc_pipe_connect_b_send(TALLOC_CTX *parent_ctx,
- struct dcerpc_binding *binding,
+ const struct dcerpc_binding *binding,
const struct ndr_interface_table *table,
struct cli_credentials *credentials,
struct tevent_context *ev,
@@ -179,7 +179,7 @@ NTSTATUS dcerpc_pipe_connect_b_recv(struct composite_context *c, TALLOC_CTX *mem
NTSTATUS dcerpc_pipe_connect_b(TALLOC_CTX *parent_ctx,
struct dcerpc_pipe **pp,
- struct dcerpc_binding *binding,
+ const struct dcerpc_binding *binding,
const struct ndr_interface_table *table,
struct cli_credentials *credentials,
struct tevent_context *ev,
diff --git a/source4/librpc/rpc/dcerpc_connect.c b/source4/librpc/rpc/dcerpc_connect.c
index 15a3c3beb8..f398312361 100644
--- a/source4/librpc/rpc/dcerpc_connect.c
+++ b/source4/librpc/rpc/dcerpc_connect.c
@@ -799,7 +799,7 @@ static void dcerpc_connect_timeout_handler(struct tevent_context *ev, struct tev
specified binding structure to determine the endpoint and options
*/
_PUBLIC_ struct composite_context* dcerpc_pipe_connect_b_send(TALLOC_CTX *parent_ctx,
- struct dcerpc_binding *binding,
+ const struct dcerpc_binding *binding,
const struct ndr_interface_table *table,
struct cli_credentials *credentials,
struct tevent_context *ev,
@@ -826,7 +826,8 @@ _PUBLIC_ struct composite_context* dcerpc_pipe_connect_b_send(TALLOC_CTX *parent
s->pipe->conn->packet_log_dir = lpcfg_lock_directory(lp_ctx);
/* store parameters in state structure */
- s->binding = binding;
+ s->binding = dcerpc_binding_dup(s, binding);
+ if (composite_nomem(s->binding, c)) return c;
s->table = table;
s->credentials = credentials;
s->lp_ctx = lp_ctx;
@@ -896,7 +897,7 @@ _PUBLIC_ NTSTATUS dcerpc_pipe_connect_b_recv(struct composite_context *c, TALLOC
*/
_PUBLIC_ NTSTATUS dcerpc_pipe_connect_b(TALLOC_CTX *parent_ctx,
struct dcerpc_pipe **pp,
- struct dcerpc_binding *binding,
+ const struct dcerpc_binding *binding,
const struct ndr_interface_table *table,
struct cli_credentials *credentials,
struct tevent_context *ev,