1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-03 13:47:25 +03:00

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 <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
Douglas Bagnall 2024-05-03 11:19:16 +12:00 committed by Andrew Bartlett
parent fb724c6110
commit 473502d170
2 changed files with 8 additions and 2 deletions

View File

@ -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):

View File

@ -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