[SCM] Samba Shared Repository - branch master updated

Andrew Bartlett abartlet at samba.org
Fri Feb 19 08:56:50 MST 2010


The branch, master has been updated
       via  f74ce57... s4:rpc_server Add a 'if_version' parameter to the bind operation.
       via  9f22284... librpc When sending endpoint mapper requests, include the minor if_version
      from  ec0aa8a... s4-smbtorture: more work on devicemode tests.

http://gitweb.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit f74ce57cb584d9e9d99b26e0467cc0c4b541f84d
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Fri Feb 19 18:02:46 2010 +1100

    s4:rpc_server Add a 'if_version' parameter to the bind operation.
    
    This allows the interface version to be forwarded to the remote server
    in the RPC proxy, both in the endpoint lookup and the subsequent bind.
    
    Andrew Bartlett

commit 9f222841fedd3796c238146081c20591ae72747b
Author: Andrew Bartlett <abartlet at samba.org>
Date:   Fri Feb 19 16:33:45 2010 +1100

    librpc When sending endpoint mapper requests, include the minor if_version
    
    The minor version (in the upper 16 bits of syntax->if_version) needs
    to be pushed as the right hand side of the endpoint mapper floor (the
    same floor as the interface UUID and major if_version).
    
    Andrew Bartlett

-----------------------------------------------------------------------

Summary of changes:
 librpc/rpc/binding.c                      |   17 ++++++++++++++++-
 pidl/lib/Parse/Pidl/Samba4/COM/Stub.pm    |    2 +-
 pidl/lib/Parse/Pidl/Samba4/NDR/Server.pm  |    2 +-
 source4/rpc_server/dcerpc_server.c        |    4 ++--
 source4/rpc_server/dcerpc_server.h        |    2 +-
 source4/rpc_server/remote/dcesrv_remote.c |    4 +++-
 6 files changed, 24 insertions(+), 7 deletions(-)


Changeset truncated at 500 lines:

diff --git a/librpc/rpc/binding.c b/librpc/rpc/binding.c
index 20c3a38..3f15eef 100644
--- a/librpc/rpc/binding.c
+++ b/librpc/rpc/binding.c
@@ -417,6 +417,21 @@ static DATA_BLOB dcerpc_floor_pack_lhs_data(TALLOC_CTX *mem_ctx, const struct nd
 	return blob;
 }
 
+static DATA_BLOB dcerpc_floor_pack_rhs_if_version_data(TALLOC_CTX *mem_ctx, const struct ndr_syntax_id *syntax)
+{
+	DATA_BLOB blob;
+	struct ndr_push *ndr = ndr_push_init_ctx(mem_ctx, NULL);
+
+	ndr->flags |= LIBNDR_FLAG_NOALIGN;
+
+	ndr_push_uint16(ndr, NDR_SCALARS, syntax->if_version >> 16);
+
+	blob = ndr_push_blob(ndr);
+	talloc_steal(mem_ctx, blob.data);
+	talloc_free(ndr);
+	return blob;
+}
+
 const char *dcerpc_floor_get_rhs_data(TALLOC_CTX *mem_ctx, struct epm_floor *epm_floor)
 {
 	switch (epm_floor->lhs.protocol) {
@@ -697,7 +712,7 @@ _PUBLIC_ NTSTATUS dcerpc_binding_build_tower(TALLOC_CTX *mem_ctx,
 
 	tower->floors[0].lhs.lhs_data = dcerpc_floor_pack_lhs_data(tower->floors, &binding->object);
 
-	tower->floors[0].rhs.uuid.unknown = data_blob_talloc_zero(tower->floors, 2);
+	tower->floors[0].rhs.uuid.unknown = dcerpc_floor_pack_rhs_if_version_data(tower->floors, &binding->object);
 
 	/* Floor 1 */
 	tower->floors[1].lhs.protocol = EPM_PROTOCOL_UUID;
diff --git a/pidl/lib/Parse/Pidl/Samba4/COM/Stub.pm b/pidl/lib/Parse/Pidl/Samba4/COM/Stub.pm
index 150acbf..239f5ba 100644
--- a/pidl/lib/Parse/Pidl/Samba4/COM/Stub.pm
+++ b/pidl/lib/Parse/Pidl/Samba4/COM/Stub.pm
@@ -89,7 +89,7 @@ sub Boilerplate_Iface($)
 	my $if_version = $interface->{PROPERTIES}->{version};
 
 	pidl "
-static NTSTATUS $name\__op_bind(struct dcesrv_call_state *dce_call, const struct dcesrv_interface *iface)
+static NTSTATUS $name\__op_bind(struct dcesrv_call_state *dce_call, const struct dcesrv_interface *iface, uint32_t if_version)
 {
 #ifdef DCESRV_INTERFACE_$uname\_BIND
 	return DCESRV_INTERFACE_$uname\_BIND(dce_call,iface);
diff --git a/pidl/lib/Parse/Pidl/Samba4/NDR/Server.pm b/pidl/lib/Parse/Pidl/Samba4/NDR/Server.pm
index bb0c18e..20c94c8 100644
--- a/pidl/lib/Parse/Pidl/Samba4/NDR/Server.pm
+++ b/pidl/lib/Parse/Pidl/Samba4/NDR/Server.pm
@@ -81,7 +81,7 @@ sub Boilerplate_Iface($)
 	my $if_version = $interface->{PROPERTIES}->{version};
 
 	pidl "
-static NTSTATUS $name\__op_bind(struct dcesrv_call_state *dce_call, const struct dcesrv_interface *iface)
+static NTSTATUS $name\__op_bind(struct dcesrv_call_state *dce_call, const struct dcesrv_interface *iface, uint32_t if_version)
 {
 #ifdef DCESRV_INTERFACE_$uname\_BIND
 	return DCESRV_INTERFACE_$uname\_BIND(dce_call,iface);
diff --git a/source4/rpc_server/dcerpc_server.c b/source4/rpc_server/dcerpc_server.c
index 918646f..bc06c06 100644
--- a/source4/rpc_server/dcerpc_server.c
+++ b/source4/rpc_server/dcerpc_server.c
@@ -648,7 +648,7 @@ static NTSTATUS dcesrv_bind(struct dcesrv_call_state *call)
 		call->context = context;
 		talloc_set_destructor(context, dcesrv_connection_context_destructor);
 
-		status = iface->bind(call, iface);
+		status = iface->bind(call, iface, if_version);
 		if (!NT_STATUS_IS_OK(status)) {
 			char *uuid_str = GUID_string(call, &uuid);
 			DEBUG(2,("Request for dcerpc interface %s/%d rejected: %s\n",
@@ -827,7 +827,7 @@ static NTSTATUS dcesrv_alter_new_context(struct dcesrv_call_state *call, uint32_
 	call->context = context;
 	talloc_set_destructor(context, dcesrv_connection_context_destructor);
 
-	status = iface->bind(call, iface);
+	status = iface->bind(call, iface, if_version);
 	if (!NT_STATUS_IS_OK(status)) {
 		/* we don't want to trigger the iface->unbind() hook */
 		context->iface = NULL;
diff --git a/source4/rpc_server/dcerpc_server.h b/source4/rpc_server/dcerpc_server.h
index 3a9c8fe..0628730 100644
--- a/source4/rpc_server/dcerpc_server.h
+++ b/source4/rpc_server/dcerpc_server.h
@@ -44,7 +44,7 @@ struct dcesrv_interface {
 	struct ndr_syntax_id syntax_id;
 
 	/* this function is called when the client binds to this interface  */
-	NTSTATUS (*bind)(struct dcesrv_call_state *, const struct dcesrv_interface *);
+	NTSTATUS (*bind)(struct dcesrv_call_state *, const struct dcesrv_interface *, uint32_t if_version);
 
 	/* this function is called when the client disconnects the endpoint */
 	void (*unbind)(struct dcesrv_connection_context *, const struct dcesrv_interface *);
diff --git a/source4/rpc_server/remote/dcesrv_remote.c b/source4/rpc_server/remote/dcesrv_remote.c
index 9c4174b..45944bc 100644
--- a/source4/rpc_server/remote/dcesrv_remote.c
+++ b/source4/rpc_server/remote/dcesrv_remote.c
@@ -37,7 +37,7 @@ static NTSTATUS remote_op_reply(struct dcesrv_call_state *dce_call, TALLOC_CTX *
 	return NT_STATUS_OK;
 }
 
-static NTSTATUS remote_op_bind(struct dcesrv_call_state *dce_call, const struct dcesrv_interface *iface)
+static NTSTATUS remote_op_bind(struct dcesrv_call_state *dce_call, const struct dcesrv_interface *iface, uint32_t if_version)
 {
         NTSTATUS status;
 	const struct ndr_interface_table *table;
@@ -121,6 +121,8 @@ static NTSTATUS remote_op_bind(struct dcesrv_call_state *dce_call, const struct
 		b->assoc_group_id = dce_call->context->assoc_group->proxied_id;
 	}
 
+	b->object.if_version = if_version;
+
 	pipe_conn_req = dcerpc_pipe_connect_b_send(dce_call->context, b, table,
 						   credentials, dce_call->event_ctx, dce_call->conn->dce_ctx->lp_ctx);
 	status = dcerpc_pipe_connect_b_recv(pipe_conn_req, dce_call->context, &(priv->c_pipe));


-- 
Samba Shared Repository


More information about the samba-cvs mailing list