summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2010-02-19 18:02:46 +1100
committerAndrew Bartlett <abartlet@samba.org>2010-02-20 02:55:29 +1100
commitf74ce57cb584d9e9d99b26e0467cc0c4b541f84d (patch)
treeb29c48fa0065acdc2c5c9213c09b65993e353882
parent9f222841fedd3796c238146081c20591ae72747b (diff)
downloadsamba-f74ce57cb584d9e9d99b26e0467cc0c4b541f84d.tar.gz
samba-f74ce57cb584d9e9d99b26e0467cc0c4b541f84d.tar.bz2
samba-f74ce57cb584d9e9d99b26e0467cc0c4b541f84d.zip
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
-rw-r--r--pidl/lib/Parse/Pidl/Samba4/COM/Stub.pm2
-rw-r--r--pidl/lib/Parse/Pidl/Samba4/NDR/Server.pm2
-rw-r--r--source4/rpc_server/dcerpc_server.c4
-rw-r--r--source4/rpc_server/dcerpc_server.h2
-rw-r--r--source4/rpc_server/remote/dcesrv_remote.c4
5 files changed, 8 insertions, 6 deletions
diff --git a/pidl/lib/Parse/Pidl/Samba4/COM/Stub.pm b/pidl/lib/Parse/Pidl/Samba4/COM/Stub.pm
index 150acbfde9..239f5baaee 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 bb0c18e13c..20c94c89e0 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 918646ff06..bc06c065da 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 3a9c8feb75..0628730f26 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 9c4174be96..45944bc227 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));