diff options
author | Joseph Sutton <josephsutton@catalyst.net.nz> | 2022-01-18 11:56:38 +1300 |
---|---|---|
committer | Jule Anger <janger@samba.org> | 2022-01-30 14:05:32 +0100 |
commit | 7368e0051a320fce48c1f303914b62985a40beb0 (patch) | |
tree | 43962c4efb258f4e54b0d460d55ae49838a73e23 | |
parent | d6ead5d33552c52da462440c6a72360a075addbe (diff) | |
download | samba-7368e0051a320fce48c1f303914b62985a40beb0.tar.gz |
CVE-2022-0336: pytest: Add a test for an SPN conflict with a re-added SPN
This test currently fails, as re-adding an SPN means that later checks
do not run.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14950
Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
-rw-r--r-- | python/samba/tests/ldap_spn.py | 7 | ||||
-rw-r--r-- | selftest/knownfail.d/ldap_spn | 1 |
2 files changed, 8 insertions, 0 deletions
diff --git a/python/samba/tests/ldap_spn.py b/python/samba/tests/ldap_spn.py index 8a398ffaa49..6ebdf8f9a32 100644 --- a/python/samba/tests/ldap_spn.py +++ b/python/samba/tests/ldap_spn.py @@ -268,6 +268,8 @@ class LdapSpnTestBase(TestCase): for k in ('dNSHostName', 'servicePrincipalName'): if isinstance(m.get(k), str): m[k] = m[k].format(dnsname=f"x.{REALM}") + elif isinstance(m.get(k), list): + m[k] = [x.format(dnsname=f"x.{REALM}") for x in m[k]] msg = ldb.Message.from_dict(samdb, m, op) @@ -727,6 +729,11 @@ class LdapSpnSambaOnlyTest(LdapSpnTestBase): ('user:C', 'host/{dnsname}', '*', ok), ('user:D', 'www/{dnsname}', 'D', denied), ), + ("add a conflict, along with a re-added SPN", + ('A', 'cifs/{dnsname}', '*', ok), + ('B', 'cifs/heeble.example.net', 'B', ok), + ('B', ['cifs/heeble.example.net', 'host/{dnsname}'], 'B', constraint), + ), ("changing dNSHostName after host", ('A', {'dNSHostName': '{dnsname}'}, '*', ok), diff --git a/selftest/knownfail.d/ldap_spn b/selftest/knownfail.d/ldap_spn index 63f9fe02ef7..16dafa91b66 100644 --- a/selftest/knownfail.d/ldap_spn +++ b/selftest/knownfail.d/ldap_spn @@ -1 +1,2 @@ samba.tests.ldap_spn.+LdapSpnTest.test_spn_dodgy_spns +samba.tests.ldap_spn.+LdapSpnSambaOnlyTest.test_spn_add_a_conflict_along_with_a_re_added_SPN |