]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
tests/krb5: Set expected_status even if expect_status is not true
authorJoseph Sutton <josephsutton@catalyst.net.nz>
Wed, 17 May 2023 04:43:12 +0000 (16:43 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 18 May 2023 04:53:29 +0000 (04:53 +0000)
We might get an NTSTATUS code even if we aren’t explicitly saying that
we expect one.

Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
python/samba/tests/krb5/lockout_tests.py

index 4140e4f882586daa9099d77cdd7665e58a90bd2c..25be0ce36dcee0f7e150cc78d88381341264ecbc 100755 (executable)
@@ -147,12 +147,13 @@ def connect_kdc(pipe,
             error_code = rep.get('error-code')
             if error_code == KDC_ERR_CLIENT_REVOKED:
                 # The account was locked out.
+                kdc_exchange_dict['expected_status'] = (
+                    ntstatus.NT_STATUS_ACCOUNT_LOCKED_OUT)
+
                 if expect_status:
                     # Expect to get a LOCKED_OUT NTSTATUS code.
                     kdc_exchange_dict['expect_edata'] = True
                     kdc_exchange_dict['expect_status'] = True
-                    kdc_exchange_dict['expected_status'] = (
-                        ntstatus.NT_STATUS_ACCOUNT_LOCKED_OUT)
 
             elif error_code == KDC_ERR_PREAUTH_FAILED:
                 # Just a wrong password: the account wasn’t locked out. Don’t