diff options
author | Joseph Sutton <josephsutton@catalyst.net.nz> | 2023-04-14 11:49:41 +1200 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2023-05-05 02:54:31 +0000 |
commit | 8a3dacd39ec60b3132c7151da82c22e5c26fa17e (patch) | |
tree | f119e8f38ad742eb72a63aed84daac4859c12ad0 /python | |
parent | 1ba0953d65b238cd1c0545052008aa53fea50433 (diff) | |
download | samba-8a3dacd39ec60b3132c7151da82c22e5c26fa17e.tar.gz |
tests/krb5: Always heed the add_dollar parameter
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>
Diffstat (limited to 'python')
-rw-r--r-- | python/samba/tests/krb5/kdc_base_test.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/python/samba/tests/krb5/kdc_base_test.py b/python/samba/tests/krb5/kdc_base_test.py index 6802f730379..285a1c3f5f4 100644 --- a/python/samba/tests/krb5/kdc_base_test.py +++ b/python/samba/tests/krb5/kdc_base_test.py @@ -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 |