From: Jo Sutton Date: Tue, 25 Jun 2024 00:51:48 +0000 (+1200) Subject: tests/krb5: Allow creation of disabled accounts for testing X-Git-Tag: samba-4.19.8~38 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7cc2b7b0288684f0d5444293ecc2562cc94c407f;p=thirdparty%2Fsamba.git tests/krb5: Allow creation of disabled accounts for testing BUG: https://bugzilla.samba.org/show_bug.cgi?id=15655 Signed-off-by: Jo Sutton Reviewed-by: Douglas Bagnall (backported from commit 6dc6168719cf232ac2c1d747f10aad9b13300c02) [jsutton@samba.org Fixed conflicting import statements in python/samba/tests/krb5/kdc_base_test.py] [jsutton@samba.org Fixed conflicting import statements in python/samba/tests/krb5/kdc_base_test.py] --- diff --git a/python/samba/tests/krb5/kdc_base_test.py b/python/samba/tests/krb5/kdc_base_test.py index 7d6cad9a785..6e8549be11b 100644 --- a/python/samba/tests/krb5/kdc_base_test.py +++ b/python/samba/tests/krb5/kdc_base_test.py @@ -74,6 +74,7 @@ from samba.dsdb import ( GTYPE_SECURITY_DOMAIN_LOCAL_GROUP, GTYPE_SECURITY_GLOBAL_GROUP, GTYPE_SECURITY_UNIVERSAL_GROUP, + UF_ACCOUNTDISABLE, UF_WORKSTATION_TRUST_ACCOUNT, UF_NO_AUTH_DATA_REQUIRED, UF_NORMAL_ACCOUNT, @@ -1714,7 +1715,8 @@ class KDCBaseTest(TestCaseInTempDir, RawKerberosTest): 'assigned_policy': None, 'assigned_silo': None, 'logon_hours': None, - 'smartcard_required': False + 'smartcard_required': False, + 'enabled': True, } account_opts = { @@ -1768,7 +1770,8 @@ class KDCBaseTest(TestCaseInTempDir, RawKerberosTest): assigned_policy, assigned_silo, logon_hours, - smartcard_required): + smartcard_required, + enabled): if account_type is self.AccountType.USER: self.assertIsNone(delegation_to_spn) self.assertIsNone(delegation_from_dn) @@ -1793,6 +1796,8 @@ class KDCBaseTest(TestCaseInTempDir, RawKerberosTest): user_account_control |= UF_NO_AUTH_DATA_REQUIRED if smartcard_required: user_account_control |= UF_SMARTCARD_REQUIRED + if not enabled: + user_account_control |= UF_ACCOUNTDISABLE if additional_details: details = {k: v for k, v in additional_details}