From fe94230f7ebedfdcc5f087b442ee91d9c44b734f Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 19 Sep 2024 09:39:44 +0200 Subject: [PATCH] s3:lib/netapi: make use of dcerpc_binding_get_abstract_syntax() Signed-off-by: Stefan Metzmacher Reviewed-by: Ralph Boehme --- source3/lib/netapi/cm.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/source3/lib/netapi/cm.c b/source3/lib/netapi/cm.c index c54f955d617..da63fd921e9 100644 --- a/source3/lib/netapi/cm.c +++ b/source3/lib/netapi/cm.c @@ -163,7 +163,10 @@ static NTSTATUS pipe_cm_find(struct client_ipc_connection *ipc, struct client_pipe_connection *p; for (p = ipc->pipe_connections; p; p = p->next) { + struct dcerpc_binding_handle *bh = NULL; + const struct dcerpc_binding *bd = NULL; const char *ipc_remote_name; + struct ndr_syntax_id syntax; if (!rpccli_is_connected(p->pipe)) { return NT_STATUS_PIPE_EMPTY; @@ -171,9 +174,15 @@ static NTSTATUS pipe_cm_find(struct client_ipc_connection *ipc, ipc_remote_name = smbXcli_conn_remote_name(ipc->cli->conn); - if (strequal(ipc_remote_name, p->pipe->desthost) - && ndr_syntax_id_equal(&p->pipe->abstract_syntax, - &table->syntax_id)) { + if (!strequal(ipc_remote_name, p->pipe->desthost)) { + continue; + } + + bh = p->pipe->binding_handle; + bd = dcerpc_binding_handle_get_binding(bh); + syntax = dcerpc_binding_get_abstract_syntax(bd); + + if (ndr_syntax_id_equal(&syntax, &table->syntax_id)) { *presult = p->pipe; return NT_STATUS_OK; } -- 2.47.2