]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
pytest: sid_strings: use more reliable well known SID
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Thu, 2 May 2024 02:24:18 +0000 (14:24 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Tue, 7 May 2024 23:25:35 +0000 (23:25 +0000)
It seems as if the well-known SID S-1-5-32-579
(DOMAIN_ALIAS_RID_ACCESS_CONTROL_ASSISTANCE_OPS) is
not always present -- specifically, it was not there on the
Windows machine used to develop these tests, but it is there on
the one I am now using.

S-1-5-32-545 (DOMAIN_ALIAS_RID_USERS) is surely going to exist,
so we use that instead.

That changes some of the assertions, making some NO_SUCH_OBJECTs
into successes.

For these tests we are only interested in the parsing of the SIDs, not
their meaning, so it's OK to change it.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=10763

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
python/samba/tests/sid_strings.py
selftest/knownfail.d/sid-strings

index 108351cc102b83d999a893834575eeb24c639bac..dab7cc2848055225caf0c61a836018692af0fa10 100644 (file)
@@ -410,9 +410,9 @@ class SidStringsAsDnInSearchBase(SidStringBase):
     """
     skip_local = True
     cases = {' S-1-1-1-1-1-1-1': ldb.ERR_INVALID_DN_SYNTAX,
-             'S-0-5-32-579': ldb.ERR_INVALID_DN_SYNTAX,
+             'S-0-5-32-545': ldb.ERR_INVALID_DN_SYNTAX,
              'S-000000000001-5-20-243': ldb.ERR_INVALID_DN_SYNTAX,
-             'S-000000001-5-32-579': ldb.ERR_INVALID_DN_SYNTAX,
+             'S-000000001-5-32-545': ldb.ERR_INVALID_DN_SYNTAX,
              'S-01-05-020-0243': ldb.ERR_NO_SUCH_OBJECT,
              'S-01-5-32-11579': ldb.ERR_NO_SUCH_OBJECT,
              'S-0x1-0-0-579': ldb.ERR_INVALID_DN_SYNTAX,
@@ -423,7 +423,7 @@ class SidStringsAsDnInSearchBase(SidStringBase):
              'S-1-0': ldb.ERR_NO_SUCH_OBJECT,
              'S-1-0-0-579': ldb.ERR_NO_SUCH_OBJECT,
              'S-1-0x05-32-11579': ldb.ERR_NO_SUCH_OBJECT,
-             'S-1-0x5-0x20-0x243': ldb.ERR_NO_SUCH_OBJECT,
+             'S-1-0x5-0x20-0x221': None,
              'S-1-0x50000000-32-579': ldb.ERR_NO_SUCH_OBJECT,
              'S-1-0x500000000-0x500000000-579': ldb.ERR_NO_SUCH_OBJECT,
              'S-1-0x500000000-32-579': ldb.ERR_NO_SUCH_OBJECT,
@@ -439,7 +439,7 @@ class SidStringsAsDnInSearchBase(SidStringBase):
              'S-1-3-99': ldb.ERR_NO_SUCH_OBJECT,
              'S-1-5-0-579': ldb.ERR_NO_SUCH_OBJECT,
              'S-1-5-040-579': ldb.ERR_NO_SUCH_OBJECT,
-             'S-1-5-0x20-579': ldb.ERR_NO_SUCH_OBJECT,
+             'S-1-5-0x20-545': None,
              'S-1-5-11111111111111111111111111111111111-579': ldb.ERR_INVALID_DN_SYNTAX,
              'S-1-5-18446744073709551615-579': ldb.ERR_INVALID_DN_SYNTAX,
              'S-1-5-18446744073709551616-579': ldb.ERR_INVALID_DN_SYNTAX,
@@ -488,7 +488,7 @@ class SidStringsAsDnSearchWithDnObject(SidStringBase):
              'S-1-0': (None, ldb.ERR_NO_SUCH_OBJECT),
              'S-1-0-0-579': (None, ldb.ERR_NO_SUCH_OBJECT),
              'S-1-0x05-32-579': (None, None),
-             'S-1-0x5-0x20-0x243': (None, ldb.ERR_NO_SUCH_OBJECT),
+             'S-1-0x5-0x20-0x221': (None, None),
              'S-1-0x50000000-32-579': (None, ldb.ERR_NO_SUCH_OBJECT),
              'S-1-0x500000000-0x500000000-579': (None, ldb.ERR_NO_SUCH_OBJECT),
              'S-1-0x500000000-32-579': (None, ldb.ERR_NO_SUCH_OBJECT),
@@ -504,7 +504,7 @@ class SidStringsAsDnSearchWithDnObject(SidStringBase):
              'S-1-3-99': (None, ldb.ERR_NO_SUCH_OBJECT),
              'S-1-5-0-579': (None, ldb.ERR_NO_SUCH_OBJECT),
              'S-1-5-040-579': (None, ldb.ERR_NO_SUCH_OBJECT),
-             'S-1-5-0x20-579': (None, ldb.ERR_NO_SUCH_OBJECT),
+             'S-1-5-0x20-545': (None, None),
              'S-1-5-11111111111111111111111111111111111-579': ('parse error', None),
              'S-1-5-18446744073709551615-579': ('parse error', None),
              'S-1-5-18446744073709551616-579': ('parse error', None),
index c64510e330b4af34b1ecf276b9f6e75bbe2f199f..f9943c5c2b667b9fa16bbe599112280ac8af4392 100644 (file)
@@ -49,7 +49,7 @@
 ^samba.tests.sid_strings.+.SidStringTests.test_sid_string_internal_Aa.ad_dc
 ^samba.tests.sid_strings.+.SidStringTests.test_sid_string_internal_aA.ad_dc
 ^samba.tests.sid_strings.+.SidStringTests.test_sid_string_internal_aa.ad_dc
-^samba.tests.sid_strings.+.SidStringsAsDnInSearchBase.test_sid_string_S-0-5-32-579.ad_dc
+^samba.tests.sid_strings.+.SidStringsAsDnInSearchBase.test_sid_string_S-0-5-32-545.ad_dc
 ^samba.tests.sid_strings.+.SidStringsAsDnInSearchBase.test_sid_string_S-1-0x500000000-0x500000000-579.ad_dc
 ^samba.tests.sid_strings.+.SidStringsAsDnInSearchBase.test_sid_string_S-1-0xABcDef123-0xABCDef123-579.ad_dc
 ^samba.tests.sid_strings.+.SidStringsAsDnInSearchBase.test_sid_string_S-1-3-0.ad_dc