diff options
author | Andrew Tridgell <tridge@samba.org> | 2007-02-26 05:37:19 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:48:54 -0500 |
commit | 60fd088c480e474c3db8870f1288462a8452cea3 (patch) | |
tree | 0dca322c8fa84e0c0a34603a5c62f7cc5a21a92e /source4/librpc/rpc/dcerpc_smb.c | |
parent | b8c219a270e50f165a326c3657618c78e2ff58c5 (diff) | |
download | samba-60fd088c480e474c3db8870f1288462a8452cea3.tar.gz samba-60fd088c480e474c3db8870f1288462a8452cea3.tar.bz2 samba-60fd088c480e474c3db8870f1288462a8452cea3.zip |
r21535: - fixed a crash in the RAW-ACLS test. When a dcerpc_pipe is created
using the pattern in the clilsa code, it didn't fill in the p->binding
structure. This affects nearly all users of dcerpc_pipe_open_smb(), so
the simplest fix is to ensure that dcerpc_pipe_open_smb() initialises
the binding if its not already there.
- re-enable the RAW-ACLS test
(This used to be commit d8875c286d2be49c01703d8fd58bbc1842054bd9)
Diffstat (limited to 'source4/librpc/rpc/dcerpc_smb.c')
-rw-r--r-- | source4/librpc/rpc/dcerpc_smb.c | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/source4/librpc/rpc/dcerpc_smb.c b/source4/librpc/rpc/dcerpc_smb.c index 1a80de75a8..d6d2cf0dfb 100644 --- a/source4/librpc/rpc/dcerpc_smb.c +++ b/source4/librpc/rpc/dcerpc_smb.c @@ -390,13 +390,26 @@ struct pipe_open_smb_state { static void pipe_open_recv(struct smbcli_request *req); -struct composite_context *dcerpc_pipe_open_smb_send(struct dcerpc_connection *c, +struct composite_context *dcerpc_pipe_open_smb_send(struct dcerpc_pipe *p, struct smbcli_tree *tree, const char *pipe_name) { struct composite_context *ctx; struct pipe_open_smb_state *state; struct smbcli_request *req; + struct dcerpc_connection *c = p->conn; + + /* if we don't have a binding on this pipe yet, then create one */ + if (p->binding == NULL) { + NTSTATUS status; + char *s = talloc_asprintf(p, "ncacn_np:%s", tree->session->transport->socket->hostname); + if (s == NULL) return NULL; + status = dcerpc_parse_binding(p, s, &p->binding); + talloc_free(s); + if (!NT_STATUS_IS_OK(status)) { + return NULL; + } + } ctx = composite_create(c, c->event_ctx); if (ctx == NULL) return NULL; @@ -494,11 +507,11 @@ NTSTATUS dcerpc_pipe_open_smb_recv(struct composite_context *c) return status; } -NTSTATUS dcerpc_pipe_open_smb(struct dcerpc_connection *c, +NTSTATUS dcerpc_pipe_open_smb(struct dcerpc_pipe *p, struct smbcli_tree *tree, const char *pipe_name) { - struct composite_context *ctx = dcerpc_pipe_open_smb_send(c, tree, + struct composite_context *ctx = dcerpc_pipe_open_smb_send(p, tree, pipe_name); return dcerpc_pipe_open_smb_recv(ctx); } |