summaryrefslogtreecommitdiff
path: root/source4/rpc_server
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2005-12-27 14:28:01 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:47:48 -0500
commitacd6a086b341096fcbea1775ce748587fcc8020a (patch)
tree202c9407be50a6fe215c4e6ab7ccaf843807b6c3 /source4/rpc_server
parent1f8bb5bd8552bb02204225e312ab36e7844920c1 (diff)
downloadsamba-acd6a086b341096fcbea1775ce748587fcc8020a.tar.gz
samba-acd6a086b341096fcbea1775ce748587fcc8020a.tar.bz2
samba-acd6a086b341096fcbea1775ce748587fcc8020a.zip
r12510: Change the DCE/RPC interfaces to take a pointer to a
dcerpc_interface_table struct rather then a tuple of interface name, UUID and version. This removes the requirement for having a global list of DCE/RPC interfaces, except for these parts of the code that use that list explicitly (ndrdump and the scanner torture test). This should also allow us to remove the hack that put the authservice parameter in the dcerpc_binding struct as it can now be read directly from dcerpc_interface_table. I will now modify some of these functions to take a dcerpc_syntax_id structure rather then a full dcerpc_interface_table. (This used to be commit 8aae0f168e54c01d0866ad6e0da141dbd828574f)
Diffstat (limited to 'source4/rpc_server')
-rw-r--r--source4/rpc_server/remote/dcesrv_remote.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/source4/rpc_server/remote/dcesrv_remote.c b/source4/rpc_server/remote/dcesrv_remote.c
index 9ba2419859..b4f45614f1 100644
--- a/source4/rpc_server/remote/dcesrv_remote.c
+++ b/source4/rpc_server/remote/dcesrv_remote.c
@@ -31,6 +31,7 @@ struct dcesrv_remote_private {
static NTSTATUS remote_op_bind(struct dcesrv_call_state *dce_call, const struct dcesrv_interface *iface)
{
NTSTATUS status;
+ const struct dcerpc_interface_table *table;
struct dcesrv_remote_private *private;
const char *binding = lp_parm_string(-1, "dcerpc_remote", "binding");
const char *user, *pass, *domain;
@@ -48,7 +49,7 @@ static NTSTATUS remote_op_bind(struct dcesrv_call_state *dce_call, const struct
dce_call->context->private = private;
if (!binding) {
- DEBUG(0,("You must specify a ncacn binding string\n"));
+ DEBUG(0,("You must specify a DCE/RPC binding string\n"));
return NT_STATUS_INVALID_PARAMETER;
}
@@ -56,6 +57,12 @@ static NTSTATUS remote_op_bind(struct dcesrv_call_state *dce_call, const struct
pass = lp_parm_string(-1, "dcerpc_remote", "password");
domain = lp_parm_string(-1, "dceprc_remote", "domain");
+ table = idl_iface_by_uuid(iface->uuid); /* FIXME: What about if_version ? */
+ if (!table) {
+ dce_call->fault_code = DCERPC_FAULT_UNK_IF;
+ return NT_STATUS_NET_WRITE_FAULT;
+ }
+
if (user && pass) {
DEBUG(5, ("dcerpc_remote: RPC Proxy: Using specified account\n"));
credentials = cli_credentials_init(private);
@@ -88,8 +95,7 @@ static NTSTATUS remote_op_bind(struct dcesrv_call_state *dce_call, const struct
}
status = dcerpc_pipe_connect(private,
- &(private->c_pipe), binding,
- iface->uuid, iface->if_version,
+ &(private->c_pipe), binding, table,
credentials, dce_call->event_ctx);
talloc_free(credentials);
@@ -272,13 +278,10 @@ static BOOL remote_op_interface_by_uuid(struct dcesrv_interface *iface, const ch
static BOOL remote_op_interface_by_name(struct dcesrv_interface *iface, const char *name)
{
- const struct dcerpc_interface_list *l;
+ const struct dcerpc_interface_table *tbl = idl_iface_by_name(name);
- for (l=librpc_dcerpc_pipes();l;l=l->next) {
- if (strcmp(l->table->name, name)==0) {
- return remote_fill_interface(iface, l->table);
- }
- }
+ if (tbl)
+ return remote_fill_interface(iface, tbl);
return False;
}