summaryrefslogtreecommitdiff
path: root/librpc
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2021-01-27 13:51:33 +0100
committerVolker Lendecke <vl@samba.org>2021-01-28 16:58:35 +0000
commit9c1d7632e35dc28061ff8bce51f162af35bfa4cb (patch)
tree25572f4ca48170841db3be26981f73f2172f2dd0 /librpc
parent230a89332f51b21384d140f5f6d1fb25f593ccb4 (diff)
downloadsamba-9c1d7632e35dc28061ff8bce51f162af35bfa4cb.tar.gz
librpc: Convert find_interface_by_uuid to search by syntax_id
All callers manually dissected the syntax id for this API. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Samuel Cabrero <scabrero@samba.org>
Diffstat (limited to 'librpc')
-rw-r--r--librpc/rpc/dcesrv_core.c18
-rw-r--r--librpc/rpc/dcesrv_core.h6
2 files changed, 12 insertions, 12 deletions
diff --git a/librpc/rpc/dcesrv_core.c b/librpc/rpc/dcesrv_core.c
index 0ef85e10df3..52008227242 100644
--- a/librpc/rpc/dcesrv_core.c
+++ b/librpc/rpc/dcesrv_core.c
@@ -149,12 +149,16 @@ static bool interface_match_by_uuid(const struct dcesrv_interface *iface,
/*
find the interface operations on an endpoint by uuid
*/
-_PUBLIC_ const struct dcesrv_interface *find_interface_by_uuid(const struct dcesrv_endpoint *endpoint,
- const struct GUID *uuid, uint32_t if_version)
+_PUBLIC_ const struct dcesrv_interface *find_interface_by_syntax_id(
+ const struct dcesrv_endpoint *endpoint,
+ const struct ndr_syntax_id *interface)
{
struct dcesrv_if_list *ifl;
for (ifl=endpoint->interface_list; ifl; ifl=ifl->next) {
- if (interface_match_by_uuid(ifl->iface, uuid, if_version)) {
+ if (interface_match_by_uuid(
+ ifl->iface,
+ &interface->uuid,
+ interface->if_version)) {
return ifl->iface;
}
}
@@ -1318,10 +1322,8 @@ static NTSTATUS dcesrv_check_or_create_context(struct dcesrv_call_state *call,
bool validate_only,
const struct ndr_syntax_id *supported_transfer)
{
- uint32_t if_version;
struct dcesrv_connection_context *context;
const struct dcesrv_interface *iface;
- struct GUID uuid;
NTSTATUS status;
const struct ndr_syntax_id *selected_transfer = NULL;
size_t i;
@@ -1357,10 +1359,8 @@ static NTSTATUS dcesrv_check_or_create_context(struct dcesrv_call_state *call,
ack->result = DCERPC_BIND_ACK_RESULT_PROVIDER_REJECTION;
ack->reason.value = DCERPC_BIND_ACK_REASON_ABSTRACT_SYNTAX_NOT_SUPPORTED;
- if_version = ctx->abstract_syntax.if_version;
- uuid = ctx->abstract_syntax.uuid;
-
- iface = find_interface_by_uuid(call->conn->endpoint, &uuid, if_version);
+ iface = find_interface_by_syntax_id(
+ call->conn->endpoint, &ctx->abstract_syntax);
if (iface == NULL) {
struct ndr_syntax_id_buf buf;
DBG_NOTICE("Request for unknown dcerpc interface %s\n",
diff --git a/librpc/rpc/dcesrv_core.h b/librpc/rpc/dcesrv_core.h
index 41ae622ecfe..333671cc3e3 100644
--- a/librpc/rpc/dcesrv_core.h
+++ b/librpc/rpc/dcesrv_core.h
@@ -626,9 +626,9 @@ _PUBLIC_ NTSTATUS dcesrv_connection_loop_start(struct dcesrv_connection *conn);
_PUBLIC_ NTSTATUS dcesrv_call_dispatch_local(struct dcesrv_call_state *call);
-_PUBLIC_ const struct dcesrv_interface *find_interface_by_uuid(
- const struct dcesrv_endpoint *endpoint,
- const struct GUID *uuid, uint32_t if_version);
+_PUBLIC_ const struct dcesrv_interface *find_interface_by_syntax_id(
+ const struct dcesrv_endpoint *endpoint,
+ const struct ndr_syntax_id *interface);
void _dcesrv_save_ndr_fuzz_seed(DATA_BLOB call_blob,
struct dcesrv_call_state *call,