]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
CVE-2020-25719 tests/krb5: Add method to get unique username for test accounts
authorJoseph Sutton <josephsutton@catalyst.net.nz>
Tue, 19 Oct 2021 02:02:10 +0000 (15:02 +1300)
committerJule Anger <janger@samba.org>
Mon, 8 Nov 2021 09:52:10 +0000 (10:52 +0100)
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>
python/samba/tests/krb5/kdc_base_test.py

index a0da89041c4f33dd7713e7cc2513033f8411ed2b..e85574c51cb5b101499992de43eec4c5eff1f23f 100644 (file)
@@ -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):