svn commit: samba r21535 - in branches/SAMBA_4_0/source: libcli/util librpc/rpc script/tests torture/rpc winbind

tridge at samba.org tridge at samba.org
Mon Feb 26 05:37:20 GMT 2007


Author: tridge
Date: 2007-02-26 05:37:19 +0000 (Mon, 26 Feb 2007)
New Revision: 21535

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=21535

Log:

- 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

Modified:
   branches/SAMBA_4_0/source/libcli/util/clilsa.c
   branches/SAMBA_4_0/source/librpc/rpc/dcerpc.c
   branches/SAMBA_4_0/source/librpc/rpc/dcerpc_connect.c
   branches/SAMBA_4_0/source/librpc/rpc/dcerpc_smb.c
   branches/SAMBA_4_0/source/librpc/rpc/dcerpc_smb2.c
   branches/SAMBA_4_0/source/script/tests/test_posix.sh
   branches/SAMBA_4_0/source/torture/rpc/samba3rpc.c
   branches/SAMBA_4_0/source/winbind/wb_async_helpers.c
   branches/SAMBA_4_0/source/winbind/wb_connect_lsa.c
   branches/SAMBA_4_0/source/winbind/wb_connect_sam.c
   branches/SAMBA_4_0/source/winbind/wb_init_domain.c


Changeset:
Modified: branches/SAMBA_4_0/source/libcli/util/clilsa.c
===================================================================
--- branches/SAMBA_4_0/source/libcli/util/clilsa.c	2007-02-26 01:03:19 UTC (rev 21534)
+++ branches/SAMBA_4_0/source/libcli/util/clilsa.c	2007-02-26 05:37:19 UTC (rev 21535)
@@ -86,7 +86,7 @@
 	}
 
 	/* open the LSA pipe */
-	status = dcerpc_pipe_open_smb(lsa->pipe->conn, lsa->ipc_tree, DCERPC_LSARPC_NAME);
+	status = dcerpc_pipe_open_smb(lsa->pipe, lsa->ipc_tree, DCERPC_LSARPC_NAME);
 	if (!NT_STATUS_IS_OK(status)) {
 		talloc_free(lsa);
 		return status;

Modified: branches/SAMBA_4_0/source/librpc/rpc/dcerpc.c
===================================================================
--- branches/SAMBA_4_0/source/librpc/rpc/dcerpc.c	2007-02-26 01:03:19 UTC (rev 21534)
+++ branches/SAMBA_4_0/source/librpc/rpc/dcerpc.c	2007-02-26 05:37:19 UTC (rev 21535)
@@ -110,6 +110,7 @@
 	p->last_fault_code = 0;
 	p->context_id = 0;
 	p->request_timeout = DCERPC_REQUEST_TIMEOUT;
+	p->binding = NULL;
 
 	ZERO_STRUCT(p->syntax);
 	ZERO_STRUCT(p->transfer_syntax);

Modified: branches/SAMBA_4_0/source/librpc/rpc/dcerpc_connect.c
===================================================================
--- branches/SAMBA_4_0/source/librpc/rpc/dcerpc_connect.c	2007-02-26 01:03:19 UTC (rev 21534)
+++ branches/SAMBA_4_0/source/librpc/rpc/dcerpc_connect.c	2007-02-26 05:37:19 UTC (rev 21535)
@@ -78,7 +78,7 @@
 	s->io.pipe_name = s->io.binding->endpoint;
 
 	/* send named pipe open request */
-	open_ctx = dcerpc_pipe_open_smb_send(s->io.pipe->conn, s->tree, s->io.pipe_name);
+	open_ctx = dcerpc_pipe_open_smb_send(s->io.pipe, s->tree, s->io.pipe_name);
 	if (composite_nomem(open_ctx, c)) return;
 
 	composite_continue(c, open_ctx, continue_pipe_open_smb, c);
@@ -192,7 +192,7 @@
 	s->io.pipe_name = s->io.binding->endpoint;
 
 	/* send named pipe open request */
-	open_req = dcerpc_pipe_open_smb2_send(s->io.pipe->conn, s->tree, s->io.pipe_name);
+	open_req = dcerpc_pipe_open_smb2_send(s->io.pipe, s->tree, s->io.pipe_name);
 	if (composite_nomem(open_req, c)) return;
 
 	composite_continue(c, open_req, continue_pipe_open_smb2, c);
@@ -969,7 +969,7 @@
 			return c;
 		}
 
-		pipe_smb_req = dcerpc_pipe_open_smb_send(s->pipe2->conn, s->tree,
+		pipe_smb_req = dcerpc_pipe_open_smb_send(s->pipe2, s->tree,
 							 s->binding->endpoint);
 		composite_continue(c, pipe_smb_req, continue_open_smb, c);
 		return c;

Modified: branches/SAMBA_4_0/source/librpc/rpc/dcerpc_smb.c
===================================================================
--- branches/SAMBA_4_0/source/librpc/rpc/dcerpc_smb.c	2007-02-26 01:03:19 UTC (rev 21534)
+++ branches/SAMBA_4_0/source/librpc/rpc/dcerpc_smb.c	2007-02-26 05:37:19 UTC (rev 21535)
@@ -390,14 +390,27 @@
 
 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 @@
 	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);
 }

Modified: branches/SAMBA_4_0/source/librpc/rpc/dcerpc_smb2.c
===================================================================
--- branches/SAMBA_4_0/source/librpc/rpc/dcerpc_smb2.c	2007-02-26 01:03:19 UTC (rev 21534)
+++ branches/SAMBA_4_0/source/librpc/rpc/dcerpc_smb2.c	2007-02-26 05:37:19 UTC (rev 21535)
@@ -362,7 +362,7 @@
 
 static void pipe_open_recv(struct smb2_request *req);
 
-struct composite_context *dcerpc_pipe_open_smb2_send(struct dcerpc_connection *c, 
+struct composite_context *dcerpc_pipe_open_smb2_send(struct dcerpc_pipe *p, 
 						     struct smb2_tree *tree,
 						     const char *pipe_name)
 {
@@ -370,6 +370,7 @@
 	struct pipe_open_smb2_state *state;
 	struct smb2_create io;
 	struct smb2_request *req;
+	struct dcerpc_connection *c = p->conn;
 
 	ctx = composite_create(c, c->event_ctx);
 	if (ctx == NULL) return NULL;
@@ -463,11 +464,11 @@
 	return status;
 }
 
-NTSTATUS dcerpc_pipe_open_smb2(struct dcerpc_connection *c,
+NTSTATUS dcerpc_pipe_open_smb2(struct dcerpc_pipe *p,
 			       struct smb2_tree *tree,
 			       const char *pipe_name)
 {
-	struct composite_context *ctx =	dcerpc_pipe_open_smb2_send(c, tree, pipe_name);
+	struct composite_context *ctx =	dcerpc_pipe_open_smb2_send(p, tree, pipe_name);
 	return dcerpc_pipe_open_smb2_recv(ctx);
 }
 

Modified: branches/SAMBA_4_0/source/script/tests/test_posix.sh
===================================================================
--- branches/SAMBA_4_0/source/script/tests/test_posix.sh	2007-02-26 01:03:19 UTC (rev 21534)
+++ branches/SAMBA_4_0/source/script/tests/test_posix.sh	2007-02-26 05:37:19 UTC (rev 21535)
@@ -28,7 +28,7 @@
 #
 # please add tests you want to be skipped here!
 #
-skipped="BASE-CHARSET BASE-DEFER_OPEN BASE-DELAYWRITE RAW-COMPOSITE RAW-OPLOCK RAW-ACLS BASE-IOMETER"
+skipped="BASE-CHARSET BASE-DEFER_OPEN BASE-DELAYWRITE RAW-COMPOSITE RAW-OPLOCK BASE-IOMETER"
 skipped="$skipped BASE-SAMBA3ERROR BASE-CASETABLE BASE-NTTRANS BASE-BENCH-HOLDCON BASE-SCAN-MAXFID"
 skipped="$skipped RAW-BENCH-OPLOCK RAW-SAMBA3HIDE RAW-SAMBA3CLOSEERR RAW-SAMBA3CHECKFSP RAW-SAMBA3BADPATH"
 skipped="$skipped RAW-SCAN-EAMAX SMB2-LOCK SMB2-NOTIFY"

Modified: branches/SAMBA_4_0/source/torture/rpc/samba3rpc.c
===================================================================
--- branches/SAMBA_4_0/source/torture/rpc/samba3rpc.c	2007-02-26 01:03:19 UTC (rev 21534)
+++ branches/SAMBA_4_0/source/torture/rpc/samba3rpc.c	2007-02-26 05:37:19 UTC (rev 21535)
@@ -107,7 +107,7 @@
 		goto done;
 	}
 
-	status = dcerpc_pipe_open_smb(lsa_pipe->conn, cli->tree, "\\lsarpc");
+	status = dcerpc_pipe_open_smb(lsa_pipe, cli->tree, "\\lsarpc");
 	if (!NT_STATUS_IS_OK(status)) {
 		d_printf("dcerpc_pipe_open_smb failed: %s\n",
 			 nt_errstr(status));
@@ -223,7 +223,7 @@
 		goto done;
 	}
 
-	status = dcerpc_pipe_open_smb(lsa_pipe->conn, cli->tree, "\\lsarpc");
+	status = dcerpc_pipe_open_smb(lsa_pipe, cli->tree, "\\lsarpc");
 	if (!NT_STATUS_IS_OK(status)) {
 		d_printf("dcerpc_pipe_open_smb failed: %s\n",
 			 nt_errstr(status));
@@ -362,7 +362,7 @@
 		goto fail;
 	}
 
-	status = dcerpc_pipe_open_smb(samr_pipe->conn, cli->tree, "\\samr");
+	status = dcerpc_pipe_open_smb(samr_pipe, cli->tree, "\\samr");
 	if (!NT_STATUS_IS_OK(status)) {
 		d_printf("dcerpc_pipe_open_smb failed: %s\n",
 			 nt_errstr(status));
@@ -822,7 +822,7 @@
 		goto done;
 	}
 
-	status = dcerpc_pipe_open_smb(net_pipe->conn, cli->tree, "\\netlogon");
+	status = dcerpc_pipe_open_smb(net_pipe, cli->tree, "\\netlogon");
 	if (!NT_STATUS_IS_OK(status)) {
 		d_printf("dcerpc_pipe_open_smb failed: %s\n",
 			 nt_errstr(status));
@@ -923,7 +923,7 @@
 		goto done;
 	}
 
-	status = dcerpc_pipe_open_smb(net_pipe->conn, cli->tree, "\\netlogon");
+	status = dcerpc_pipe_open_smb(net_pipe, cli->tree, "\\netlogon");
 	if (!NT_STATUS_IS_OK(status)) {
 		d_printf("dcerpc_pipe_open_smb failed: %s\n",
 			 nt_errstr(status));
@@ -1374,7 +1374,7 @@
 		return NT_STATUS_NO_MEMORY;
 	}
 
-	status = dcerpc_pipe_open_smb(result->conn, tree, pipe_name);
+	status = dcerpc_pipe_open_smb(result, tree, pipe_name);
 	if (!NT_STATUS_IS_OK(status)) {
 		d_printf("dcerpc_pipe_open_smb failed: %s\n",
 			 nt_errstr(status));

Modified: branches/SAMBA_4_0/source/winbind/wb_async_helpers.c
===================================================================
--- branches/SAMBA_4_0/source/winbind/wb_async_helpers.c	2007-02-26 01:03:19 UTC (rev 21534)
+++ branches/SAMBA_4_0/source/winbind/wb_async_helpers.c	2007-02-26 05:37:19 UTC (rev 21535)
@@ -81,7 +81,7 @@
 		goto failed;
 	}
 
-	creq = dcerpc_pipe_open_smb_send(state->p->conn, tree, "\\netlogon");
+	creq = dcerpc_pipe_open_smb_send(state->p, tree, "\\netlogon");
 	if (creq == NULL) {
 		c->status = NT_STATUS_NO_MEMORY;
 		goto failed;

Modified: branches/SAMBA_4_0/source/winbind/wb_connect_lsa.c
===================================================================
--- branches/SAMBA_4_0/source/winbind/wb_connect_lsa.c	2007-02-26 01:03:19 UTC (rev 21534)
+++ branches/SAMBA_4_0/source/winbind/wb_connect_lsa.c	2007-02-26 05:37:19 UTC (rev 21535)
@@ -72,7 +72,7 @@
 	state->lsa_pipe = dcerpc_pipe_init(state, result->event_ctx);
 	if (state->lsa_pipe == NULL) goto failed;
 
-	ctx = dcerpc_pipe_open_smb_send(state->lsa_pipe->conn, tree,
+	ctx = dcerpc_pipe_open_smb_send(state->lsa_pipe, tree,
 					"\\lsarpc");
 	ctx->async.fn = init_lsa_recv_pipe;
 	ctx->async.private_data = state;

Modified: branches/SAMBA_4_0/source/winbind/wb_connect_sam.c
===================================================================
--- branches/SAMBA_4_0/source/winbind/wb_connect_sam.c	2007-02-26 01:03:19 UTC (rev 21534)
+++ branches/SAMBA_4_0/source/winbind/wb_connect_sam.c	2007-02-26 05:37:19 UTC (rev 21535)
@@ -80,7 +80,7 @@
 	state->samr_pipe = dcerpc_pipe_init(state, result->event_ctx);
 	if (state->samr_pipe == NULL) goto failed;
 
-	ctx = dcerpc_pipe_open_smb_send(state->samr_pipe->conn, tree,
+	ctx = dcerpc_pipe_open_smb_send(state->samr_pipe, tree,
 					"\\samr");
 	ctx->async.fn = connect_samr_recv_pipe;
 	ctx->async.private_data = state;

Modified: branches/SAMBA_4_0/source/winbind/wb_init_domain.c
===================================================================
--- branches/SAMBA_4_0/source/winbind/wb_init_domain.c	2007-02-26 01:03:19 UTC (rev 21534)
+++ branches/SAMBA_4_0/source/winbind/wb_init_domain.c	2007-02-26 05:37:19 UTC (rev 21535)
@@ -193,7 +193,7 @@
 		return;
 	}
 
-	ctx = dcerpc_pipe_open_smb_send(state->domain->netlogon_pipe->conn,
+	ctx = dcerpc_pipe_open_smb_send(state->domain->netlogon_pipe,
 					tree, "\\netlogon");
 	composite_continue(state->ctx, ctx, init_domain_recv_netlogonpipe,
 			   state);



More information about the samba-cvs mailing list