From 60fd088c480e474c3db8870f1288462a8452cea3 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 26 Feb 2007 05:37:19 +0000 Subject: 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) --- source4/librpc/rpc/dcerpc_smb.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) (limited to 'source4/librpc/rpc/dcerpc_smb.c') 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); } -- cgit