From 713a8022573a1b917422d888e4bb901539d20a91 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Fri, 19 Apr 2024 01:17:46 +0200 Subject: [PATCH] s3:rpc_client: require DCERPC_BIND_ACK_RESULT_ACCEPTANCE for the negotiated presentation context We should fail if we didn't get DCERPC_BIND_ACK_RESULT_ACCEPTANCE. It's also not needed to require a single array element. We already checked above that we have at least one. The next patch will all bind time feature negotiation and that means we'll have 2 array elements... Signed-off-by: Stefan Metzmacher Reviewed-by: Andrew Bartlett --- source3/rpc_client/cli_pipe.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/source3/rpc_client/cli_pipe.c b/source3/rpc_client/cli_pipe.c index 4666bac6e49..15103093224 100644 --- a/source3/rpc_client/cli_pipe.c +++ b/source3/rpc_client/cli_pipe.c @@ -1679,9 +1679,10 @@ static bool check_bind_response(const struct dcerpc_bind_ack *r, return False; } - if (r->num_results != 0x1 || ctx.result != 0) { - DEBUG(2,("bind_rpc_pipe: bind denied results: %d reason: %x\n", - r->num_results, ctx.reason.value)); + if (ctx.result != DCERPC_BIND_ACK_RESULT_ACCEPTANCE) { + DBG_NOTICE("bind denied result: %d reason: %x\n", + ctx.result, ctx.reason.value); + return false; } DEBUG(5,("check_bind_response: accepted!\n"));