]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
tests/krb5: Always heed the add_dollar parameter
authorJoseph Sutton <josephsutton@catalyst.net.nz>
Thu, 13 Apr 2023 23:49:41 +0000 (11:49 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 5 May 2023 02:54:31 +0000 (02:54 +0000)
Not just if the account to be created is a computer. This allows us to
create other types of accounts with a trailing dollar.

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

index 6802f73037928e61083e306e64330795912c1d34..285a1c3f5f4705c0d91f57330266a2ce54f27b1b 100644 (file)
@@ -747,12 +747,15 @@ class KDCBaseTest(RawKerberosTest):
 
     def create_account(self, samdb, name, account_type=AccountType.USER,
                        spn=None, upn=None, additional_details=None,
-                       ou=None, account_control=0, add_dollar=True,
+                       ou=None, account_control=0, add_dollar=None,
                        expired_password=False, force_nt4_hash=False):
         '''Create an account for testing.
            The dn of the created account is added to self.accounts,
            which is used by tearDownClass to clean up the created accounts.
         '''
+        if add_dollar is None and account_type is not self.AccountType.USER:
+            add_dollar = True
+
         if ou is None:
             if account_type is self.AccountType.COMPUTER:
                 guid = DS_GUID_COMPUTERS_CONTAINER
@@ -769,14 +772,14 @@ class KDCBaseTest(RawKerberosTest):
         # run failed
         delete_force(samdb, dn)
         account_name = name
+        if add_dollar:
+            account_name += '$'
         secure_schannel_type = SEC_CHAN_NULL
         if account_type is self.AccountType.USER:
             object_class = "user"
             account_control |= UF_NORMAL_ACCOUNT
         else:
             object_class = "computer"
-            if add_dollar:
-                account_name += '$'
             if account_type is self.AccountType.COMPUTER:
                 account_control |= UF_WORKSTATION_TRUST_ACCOUNT
                 secure_schannel_type = SEC_CHAN_WKSTA