diff options
author | Joseph Sutton <josephsutton@catalyst.net.nz> | 2021-10-19 15:02:10 +1300 |
---|---|---|
committer | Jule Anger <janger@samba.org> | 2021-11-08 10:46:43 +0100 |
commit | 02e371103544428cee502bb2432feb799cd8b6a8 (patch) | |
tree | 5a6ddd2b2e3cf0b7f9c5bc74350a1e21dd481f27 /python/samba | |
parent | 4b012b23eb4ca87302729d9818266be62de3e485 (diff) | |
download | samba-02e371103544428cee502bb2432feb799cd8b6a8.tar.gz |
CVE-2020-25719 tests/krb5: Add method to get unique username for test accounts
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14686
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'python/samba')
-rw-r--r-- | python/samba/tests/krb5/kdc_base_test.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/python/samba/tests/krb5/kdc_base_test.py b/python/samba/tests/krb5/kdc_base_test.py index a0da89041c4..e85574c51cb 100644 --- a/python/samba/tests/krb5/kdc_base_test.py +++ b/python/samba/tests/krb5/kdc_base_test.py @@ -711,8 +711,7 @@ class KDCBaseTest(RawKerberosTest): rodc_dn = self.get_server_dn(rodc_samdb) - user_name = self.account_base + str(self.account_id) - type(self).account_id += 1 + user_name = self.get_new_username() if name_prefix is not None: user_name = name_prefix + user_name if name_suffix is not None: @@ -821,6 +820,12 @@ class KDCBaseTest(RawKerberosTest): return creds + def get_new_username(self): + user_name = self.account_base + str(self.account_id) + type(self).account_id += 1 + + return user_name + def get_client_creds(self, allow_missing_password=False, allow_missing_keys=True): |