mirror of
https://github.com/samba-team/samba.git
synced 2025-02-02 09:47:23 +03:00
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>
This commit is contained in:
parent
230a89332f
commit
9c1d7632e3
@ -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",
|
||||
|
@ -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,
|
||||
|
@ -401,9 +401,8 @@ static NTSTATUS make_internal_dcesrv_connection(TALLOC_CTX *mem_ctx,
|
||||
context->conn = conn;
|
||||
context->context_id = 0;
|
||||
context->transfer_syntax = *(conn->preferred_transfer);
|
||||
context->iface = find_interface_by_uuid(conn->endpoint,
|
||||
&ndr_table->syntax_id.uuid,
|
||||
ndr_table->syntax_id.if_version);
|
||||
context->iface = find_interface_by_syntax_id(
|
||||
conn->endpoint, &ndr_table->syntax_id);
|
||||
if (context->iface == NULL) {
|
||||
status = NT_STATUS_RPC_INTERFACE_NOT_FOUND;
|
||||
goto fail;
|
||||
|
@ -433,9 +433,8 @@ static NTSTATUS make_internal_dcesrv_connection(TALLOC_CTX *mem_ctx,
|
||||
context->conn = conn;
|
||||
context->context_id = 0;
|
||||
context->transfer_syntax = *(conn->preferred_transfer);
|
||||
context->iface = find_interface_by_uuid(conn->endpoint,
|
||||
&ndr_table->syntax_id.uuid,
|
||||
ndr_table->syntax_id.if_version);
|
||||
context->iface = find_interface_by_syntax_id(
|
||||
conn->endpoint, &ndr_table->syntax_id);
|
||||
if (context->iface == NULL) {
|
||||
status = NT_STATUS_RPC_INTERFACE_NOT_FOUND;
|
||||
goto fail;
|
||||
|
Loading…
x
Reference in New Issue
Block a user