From: Noel Power Date: Mon, 25 Sep 2023 09:30:30 +0000 (+0100) Subject: s4/torture: Prepare to handle Level 4 check with unknown func code X-Git-Tag: tdb-1.4.11~480 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=1297c7ca65ba485febee4eabe32a8e1c793b187c;p=thirdparty%2Fsamba.git s4/torture: Prepare to handle Level 4 check with unknown func code A future (next) commit will change the NETLOGON_CONTROL_SET_DBFLAG test to use levels 1 - 4 (current test just tests 1 - 3). A side affect of this test is that the following test will now test passing an unknown function code against against Level 4 (previously level 3). Unfortunately s4 and s3 netlogon server results differ when handling a level 4 request with an unknown function code. s3 server returns WERR_NOT_SUPPORTED and s4 server returns WERR_INVALID_PARAMETER. For level 3 both return WERR_NOT_SUPPORTED. MS-NRPC doesn't seem to specifically indicate the required response in this case. this commit modifies the test to cater for either response (for either level) A future commit could explore the test response combinations more thorougly. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15465 Signed-off-by: Noel Power Reviewed-by: Douglas Bagnall --- diff --git a/source4/torture/rpc/netlogon.c b/source4/torture/rpc/netlogon.c index c3715619cb7..8e37e1a643e 100644 --- a/source4/torture/rpc/netlogon.c +++ b/source4/torture/rpc/netlogon.c @@ -4087,7 +4087,10 @@ static bool test_LogonControl2Ex(struct torture_context *tctx, torture_assert_ntstatus_ok(tctx, status, "LogonControl2Ex"); switch (secure_channel_type) { case SEC_CHAN_NULL: - torture_assert_werr_equal(tctx, r.out.result, WERR_NOT_SUPPORTED, "LogonControl2Ex"); + torture_assert(tctx, + W_ERROR_EQUAL(r.out.result, WERR_NOT_SUPPORTED) || + W_ERROR_EQUAL(r.out.result, WERR_INVALID_PARAMETER), + "LogonControl2Ex"); break; default: torture_assert_werr_equal(tctx, r.out.result, WERR_ACCESS_DENIED, "LogonControl2Ex");