From: Douglas Bagnall Date: Wed, 15 Nov 2023 00:03:27 +0000 (+1300) Subject: pytests: sid_strings: do not fail if epoch ending has zeros X-Git-Tag: samba-4.19.3~24 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a5b61b469a2303c31ca681a10bc70fb7cb86668e;p=thirdparty%2Fsamba.git pytests: sid_strings: do not fail if epoch ending has zeros To avoid collisions in random OID strings, we started using the epoch date modulus 100 million. The trouble is we did not strip out the leading zeros, so the field might be '00000123' when it should be '123', if the date happened not to correspond to an epoch with a zero in the eighth to last place. This has been the case for most of the last 1041 days, but fortunately the bug was only introduced earlier this year. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15520 Signed-off-by: Douglas Bagnall Reviewed-by: Martin Schwenke (cherry picked from commit 426ca4cf4b667aae03f0344cee449e972de90ac7) Autobuild-User(v4-19-test): Jule Anger Autobuild-Date(v4-19-test): Mon Nov 20 10:00:15 UTC 2023 on atb-devel-224 --- diff --git a/python/samba/tests/sid_strings.py b/python/samba/tests/sid_strings.py index 5ff1edc0642..139849a4981 100644 --- a/python/samba/tests/sid_strings.py +++ b/python/samba/tests/sid_strings.py @@ -98,7 +98,7 @@ class SidStringBase(TestCase): class_dn = f'CN={class_name},{self.schema_dn}' - governs_id = f'1.3.6.1.4.1.7165.4.6.2.9.{self.timestamp[-8:]}.{suffix}' + governs_id = f'1.3.6.1.4.1.7165.4.6.2.9.1{self.timestamp[-7:]}.{suffix}' # expected_sid can be a SID string, an error code, None, or a # special value indicating a deferred error, as follows: