tests/krb5: Remove local variable
authorJoseph Sutton <josephsutton@catalyst.net.nz>
Thu, 24 Aug 2023 22:52:31 +0000 (10:52 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 30 Aug 2023 02:15:29 +0000 (02:15 +0000)
This seems a bit clearer to me.

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 457119e548913820999bf1cd867e9970c68dd990..e2eea2100739ea4b7369acee71b0310859dae609 100644 (file)
@@ -1605,8 +1605,6 @@ class KDCBaseTest(TestCaseInTempDir, RawKerberosTest):
 
         found_logon_info = True
 
-        user_sid = security.dom_sid(f'{domain_sid}-{user_rid}')
-
         pac_buffers = pac.buffers
         for pac_buffer in pac_buffers:
             # Find the LOGON_INFO PAC buffer.
@@ -1660,7 +1658,8 @@ class KDCBaseTest(TestCaseInTempDir, RawKerberosTest):
             elif pac_buffer.type == krb5pac.PAC_TYPE_UPN_DNS_INFO:
                 upn_dns_info_ex = pac_buffer.info.ex
 
-                upn_dns_info_ex.objectsid = user_sid
+                upn_dns_info_ex.objectsid = security.dom_sid(
+                    f'{domain_sid}-{user_rid}')
 
             # But don't replace the user's SID in the Requester SID buffer, or
             # we'll get a SID mismatch.