]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
tests/krb5: Allow creation of disabled accounts for testing
authorJo Sutton <josutton@catalyst.net.nz>
Tue, 25 Jun 2024 00:51:48 +0000 (12:51 +1200)
committerDouglas Bagnall <dbagnall@samba.org>
Thu, 27 Jun 2024 04:29:41 +0000 (04:29 +0000)
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15655

Signed-off-by: Jo Sutton <josutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
python/samba/tests/krb5/kdc_base_test.py

index eb3497c554e068cf4364436506641a83de99720f..df5e22be4ae39ce487e52ca0960ecf3b580060f9 100644 (file)
@@ -79,6 +79,7 @@ from samba.dsdb import (
     GTYPE_SECURITY_DOMAIN_LOCAL_GROUP,
     GTYPE_SECURITY_GLOBAL_GROUP,
     GTYPE_SECURITY_UNIVERSAL_GROUP,
+    UF_ACCOUNTDISABLE,
     UF_NO_AUTH_DATA_REQUIRED,
     UF_NORMAL_ACCOUNT,
     UF_NOT_DELEGATED,
@@ -2016,7 +2017,8 @@ class KDCBaseTest(TestCaseInTempDir, RawKerberosTest):
             'assigned_policy': None,
             'assigned_silo': None,
             'logon_hours': None,
-            'smartcard_required': False
+            'smartcard_required': False,
+            'enabled': True,
         }
 
         account_opts = {
@@ -2074,7 +2076,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)
@@ -2100,6 +2103,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}