]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
tests/krb5: Allow specifying an encoded security descriptor
authorJoseph Sutton <josephsutton@catalyst.net.nz>
Thu, 27 Apr 2023 04:20:25 +0000 (16:20 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Fri, 5 May 2023 02:54:31 +0000 (02:54 +0000)
If we get a string, we’ll still assume it’s a DN and create a security
descriptor using it.

This is useful in cases where we don’t have a DN (e.g., the account is
not created yet).

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 abb577fa9686b8ac6e024e84c10b7c628799d4fa..bc7a510d1172ddc5e59402f9117cadb1556bef6a 100644 (file)
@@ -1770,10 +1770,11 @@ class KDCBaseTest(RawKerberosTest):
             details['msDS-AllowedToDelegateTo'] = delegation_to_spn
 
         if delegation_from_dn:
-            security_descriptor = self.get_security_descriptor(
-                delegation_from_dn)
+            if isinstance(delegation_from_dn, str):
+                delegation_from_dn = self.get_security_descriptor(
+                    delegation_from_dn)
             details['msDS-AllowedToActOnBehalfOfOtherIdentity'] = (
-                security_descriptor)
+                delegation_from_dn)
 
         if spn is None and account_type is not self.AccountType.USER:
             spn = 'host/' + user_name