From: Douglas Bagnall Date: Thu, 2 May 2024 23:19:16 +0000 (+1200) Subject: pytest: sid_strings: Windows does allow lowercase s-1-... SIDs X-Git-Tag: tdb-1.4.11~821 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=473502d170190b6bfe8da29708d347b16e0a2f7f;p=thirdparty%2Fsamba.git pytest: sid_strings: Windows does allow lowercase s-1-... SIDs And so should we. Right now, these tests won't pass against Windows because they rely on ldb pre-parsing of the SIDs, so they fail before Windows gets to see them. Running them against Windows looks something like this, BTW: SAMBA_SID_STRINGS_SKIP_LOCAL=1 \ SMB_CONF_PATH=st/ad_dc/etc/smb.conf \ PYTHONPATH=bin/default/python \ DC_SERVER=192.168.122.126 \ DC_USERNAME=Administrator DC_PASSWORD='xxx' \ python3 python/samba/tests/sid_strings.py When things are right, the only failing tests should be from the SidStringBehavioursThatSambaPrefers suite. 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 dab7cc28480..737f2b89b3f 100644 --- a/python/samba/tests/sid_strings.py +++ b/python/samba/tests/sid_strings.py @@ -453,7 +453,8 @@ class SidStringsAsDnInSearchBase(SidStringBase): 'S-1-99999999999999999999999999999999999999-32-11111111111': ldb.ERR_INVALID_DN_SYNTAX, 'S-10-5-32-579': ldb.ERR_INVALID_DN_SYNTAX, 'S-2-5-32-579': ldb.ERR_INVALID_DN_SYNTAX, - 's-1-5-32-579': ldb.ERR_INVALID_DN_SYNTAX, + 's-1-5-32-5791': ldb.ERR_NO_SUCH_OBJECT, + 's-1-5-32-545': None, 'AA': ldb.ERR_INVALID_DN_SYNTAX, } @@ -517,7 +518,8 @@ class SidStringsAsDnSearchWithDnObject(SidStringBase): None), 'S-10-5-32-579': (None, ldb.ERR_INVALID_DN_SYNTAX), 'S-2-5-32-579': (None, ldb.ERR_INVALID_DN_SYNTAX), - 's-1-5-32-579': ('parse error', None), + 's-1-5-32-545': (None, None), + 's-1-5-1234-5678': (None, ldb.ERR_NO_SUCH_OBJECT), } def _test_sid_string_with_args(self, code, expected): diff --git a/selftest/knownfail.d/sid-strings b/selftest/knownfail.d/sid-strings index f9943c5c2b6..a56d92986e3 100644 --- a/selftest/knownfail.d/sid-strings +++ b/selftest/knownfail.d/sid-strings @@ -54,6 +54,8 @@ ^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 ^samba.tests.sid_strings.+.SidStringsAsDnInSearchBase.test_sid_string_S-1-5-3.2-579.ad_dc +^samba.tests.sid_strings.+.SidStringsAsDnInSearchBase.test_sid_string_s-1-5-32-545.ad_dc +^samba.tests.sid_strings.+.SidStringsAsDnInSearchBase.test_sid_string_s-1-5-32-5791.ad_dc ^samba.tests.sid_strings.+.SidStringsAsDnInSearchBase.test_sid_string_S-10-5-32-579.ad_dc ^samba.tests.sid_strings.+.SidStringsAsDnInSearchBase.test_sid_string_S-2-5-32-579.ad_dc ^samba.tests.sid_strings.+.SidStringsAsDnSearchWithDnObject.test_sid_string_S-0-5-32-579.ad_dc @@ -62,6 +64,8 @@ ^samba.tests.sid_strings.+.SidStringsAsDnSearchWithDnObject.test_sid_string_S-1-0xABcDef123-0xABCDef123-579.ad_dc ^samba.tests.sid_strings.+.SidStringsAsDnSearchWithDnObject.test_sid_string_S-1-3-0.ad_dc ^samba.tests.sid_strings.+.SidStringsAsDnSearchWithDnObject.test_sid_string_S-1-5-3.2-579.ad_dc +^samba.tests.sid_strings.+.SidStringsAsDnSearchWithDnObject.test_sid_string_s-1-5-1234-5678.ad_dc +^samba.tests.sid_strings.+.SidStringsAsDnSearchWithDnObject.test_sid_string_s-1-5-32-545.ad_dc ^samba.tests.sid_strings.+.SidStringsAsDnSearchWithDnObject.test_sid_string_S-10-5-32-579.ad_dc ^samba.tests.sid_strings.+.SidStringsAsDnSearchWithDnObject.test_sid_string_S-2-5-32-579.ad_dc ^samba.tests.sid_strings.+.SidStringsThatStartWithS.test_sid_string_.S-1-1-1-1-1-1-1.ad_dc