summaryrefslogtreecommitdiff
path: root/source3/rpc_server/srv_pipe.c
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2008-07-12 23:17:23 +0200
committerVolker Lendecke <vl@samba.org>2008-07-16 23:19:48 +0200
commite0f3ea2cbeb61cb02be85d2b315948985bac27a8 (patch)
tree8d6806f82cd2a72db4cea879a9f0309dbf650d32 /source3/rpc_server/srv_pipe.c
parente65ea7471e2447ed150ade9a2c4f0a67663fb8d2 (diff)
downloadsamba-e0f3ea2cbeb61cb02be85d2b315948985bac27a8.tar.gz
samba-e0f3ea2cbeb61cb02be85d2b315948985bac27a8.tar.bz2
samba-e0f3ea2cbeb61cb02be85d2b315948985bac27a8.zip
In api_pipe_bind_req(), check for the iface id, not the pipe name
This requires to store the rpc_interface in "struct rpc_table" (This used to be commit 654f8de8497aff29f9b1f1822b6a8e734ff329e0)
Diffstat (limited to 'source3/rpc_server/srv_pipe.c')
-rw-r--r--source3/rpc_server/srv_pipe.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/source3/rpc_server/srv_pipe.c b/source3/rpc_server/srv_pipe.c
index f8ec4bfc91..48e6646c75 100644
--- a/source3/rpc_server/srv_pipe.c
+++ b/source3/rpc_server/srv_pipe.c
@@ -718,6 +718,7 @@ struct rpc_table {
const char *clnt;
const char *srv;
} pipe;
+ struct ndr_syntax_id rpc_interface;
const struct api_struct *cmds;
int n_cmds;
};
@@ -1039,7 +1040,10 @@ bool check_bind_req(struct pipes_struct *p, RPC_IFACE* abstract,
Register commands to an RPC pipe
*******************************************************************/
-NTSTATUS rpc_pipe_register_commands(int version, const char *clnt, const char *srv, const struct api_struct *cmds, int size)
+NTSTATUS rpc_pipe_register_commands(int version, const char *clnt,
+ const char *srv,
+ const struct ndr_syntax_id *interface,
+ const struct api_struct *cmds, int size)
{
struct rpc_table *rpc_entry;
@@ -1079,6 +1083,7 @@ NTSTATUS rpc_pipe_register_commands(int version, const char *clnt, const char *s
ZERO_STRUCTP(rpc_entry);
rpc_entry->pipe.clnt = SMB_STRDUP(clnt);
rpc_entry->pipe.srv = SMB_STRDUP(srv);
+ rpc_entry->rpc_interface = *interface;
rpc_entry->cmds = cmds;
rpc_entry->n_cmds = size;
@@ -1575,16 +1580,22 @@ bool api_pipe_bind_req(pipes_struct *p, prs_struct *rpc_in_p)
goto err_exit;
}
+ if (hdr_rb.num_contexts == 0) {
+ DEBUG(0, ("api_pipe_bind_req: no rpc contexts around\n"));
+ goto err_exit;
+ }
+
/*
* Try and find the correct pipe name to ensure
* that this is a pipe name we support.
*/
-
for (i = 0; i < rpc_lookup_size; i++) {
- if (strequal(rpc_lookup[i].pipe.clnt, p->name)) {
+ if (ndr_syntax_id_equal(&rpc_lookup[i].rpc_interface,
+ &hdr_rb.rpc_context[0].abstract)) {
DEBUG(3, ("api_pipe_bind_req: \\PIPE\\%s -> \\PIPE\\%s\n",
rpc_lookup[i].pipe.clnt, rpc_lookup[i].pipe.srv));
+ fstrcpy(p->name, rpc_lookup[i].pipe.clnt);
fstrcpy(p->pipe_srv_name, rpc_lookup[i].pipe.srv);
break;
}