s4:rpc_server Add a 'if_version' parameter to the bind operation. rpc-proxy
authorAndrew Bartlett <abartlet@samba.org>
Fri, 19 Feb 2010 07:02:46 +0000 (18:02 +1100)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 19 Feb 2010 07:02:46 +0000 (18:02 +1100)
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

pidl/lib/Parse/Pidl/Samba4/COM/Stub.pm
pidl/lib/Parse/Pidl/Samba4/NDR/Server.pm
source4/rpc_server/dcerpc_server.c
source4/rpc_server/dcerpc_server.h
source4/rpc_server/remote/dcesrv_remote.c

index 150acbfde9b3e50b7230b55e962597fd349bc6f0..239f5baaeedf96883e37553d652cfc2036d9d495 100644 (file)
@@ -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);
index bb0c18e13c8bfe5bf79777187e5e9181ea1ff54f..20c94c89e05e4f52bcf49e9c51991dc6382940df 100644 (file)
@@ -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);
index 918646ff06cbf405c0c47d2df7fbec722c287262..bc06c065dae54d8583070ffc533fce005773e322 100644 (file)
@@ -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;
index 3a9c8feb75f151ab0c9f3d35415ca19358b7aace..0628730f263af70057708475511a74804e29a406 100644 (file)
@@ -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 *);
index 9c4174be96bfe53d9ef29fdfea5e9f6469f19bb7..45944bc227ecacb973989156339c4ea04c4022a6 100644 (file)
@@ -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));