From: Douglas Bagnall Date: Thu, 2 May 2024 02:24:18 +0000 (+1200) Subject: pytest: sid_strings: use more reliable well known SID X-Git-Tag: tdb-1.4.11~822 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fb724c61107b76d32b500802f960aa8e049ccbd8;p=thirdparty%2Fsamba.git pytest: sid_strings: use more reliable well known SID 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 Reviewed-by: Andrew Bartlett --- diff --git a/python/samba/tests/sid_strings.py b/python/samba/tests/sid_strings.py index 108351cc102..dab7cc28480 100644 --- a/python/samba/tests/sid_strings.py +++ b/python/samba/tests/sid_strings.py @@ -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), diff --git a/selftest/knownfail.d/sid-strings b/selftest/knownfail.d/sid-strings index c64510e330b..f9943c5c2b6 100644 --- a/selftest/knownfail.d/sid-strings +++ b/selftest/knownfail.d/sid-strings @@ -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