From cbcd11f2fb232780452882ef5f1116611385b6a8 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 24 Sep 2024 09:05:15 +0200 Subject: [PATCH] dcesrv_core: return NAK_REASON_PROTOCOL_VERSION_NOT_SUPPORTED for binds without contexts This is the error Windows 2022 (and 2025 preview) return. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14356 Signed-off-by: Stefan Metzmacher Reviewed-by: Andreas Schneider (cherry picked from commit 8e6696b2ac6990f3d6bac804c9a0f1a2b8f0ada0) --- librpc/rpc/dcesrv_core.c | 3 ++- source4/selftest/tests.py | 2 -- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/librpc/rpc/dcesrv_core.c b/librpc/rpc/dcesrv_core.c index 16063299d83..8ecb7da5cb6 100644 --- a/librpc/rpc/dcesrv_core.c +++ b/librpc/rpc/dcesrv_core.c @@ -1141,7 +1141,8 @@ static NTSTATUS dcesrv_bind(struct dcesrv_call_state *call) } if (call->pkt.u.bind.num_contexts < 1) { - return dcesrv_bind_nak(call, 0); + return dcesrv_bind_nak(call, + DCERPC_BIND_NAK_REASON_PROTOCOL_VERSION_NOT_SUPPORTED); } ack_ctx_list = talloc_zero_array(call, struct dcerpc_ack_ctx, diff --git a/source4/selftest/tests.py b/source4/selftest/tests.py index 69d670fe7b4..7787c968952 100755 --- a/source4/selftest/tests.py +++ b/source4/selftest/tests.py @@ -1371,14 +1371,12 @@ planoldpythontestsuite("ad_dc", "samba.tests.dcerpc.dnsserver", extra_args=['-U" planoldpythontestsuite("chgdcpass", "samba.tests.dcerpc.raw_protocol", environ={"MAX_NUM_AUTH": "8", "ALLOW_BIND_AUTH_PAD": "1", - "LEGACY_BIND_NACK_NO_REASON": "1", "USERNAME": "$DC_USERNAME", "PASSWORD": "$DC_PASSWORD"}) planoldpythontestsuite("ad_member", "samba.tests.dcerpc.raw_protocol", environ={"MAX_NUM_AUTH": "8", "ALLOW_BIND_AUTH_PAD": "1", "AUTH_LEVEL_CONNECT_LSA": "1", - "LEGACY_BIND_NACK_NO_REASON": "1", "USERNAME": "$DC_USERNAME", "PASSWORD": "$DC_PASSWORD"})