]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
s4/torture: Prepare to handle Level 4 check with unknown func code
authorNoel Power <noel.power@suse.com>
Mon, 25 Sep 2023 09:30:30 +0000 (10:30 +0100)
committerNoel Power <npower@samba.org>
Tue, 4 Jun 2024 08:33:32 +0000 (08:33 +0000)
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 <noel.power@suse.com>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
source4/torture/rpc/netlogon.c

index c3715619cb7753145d40f47372abbba1d0ea527a..8e37e1a643e40fb7b0fef95af49e4cf7e3046204 100644 (file)
@@ -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");