From: Gary Lockyer Date: Wed, 15 Apr 2020 22:49:29 +0000 (+1200) Subject: CVE-2020-10704: ldapserver tests: Python 2 comaptibility X-Git-Tag: samba-4.10.15~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fdc00bf95f5ad45ddffc8f1ab31ecd577e25518d;p=thirdparty%2Fsamba.git CVE-2020-10704: ldapserver tests: Python 2 comaptibility The test python/samba/tests/ldap_raw.py does not run under python 3 which means the CI task build_ad_dc_py2 fails. The test is run and passes in the CI task build_ad_dc. This patch adds a check for the Python version and skips the tests if running under python 2, allowing CI to run for V4.10. This patch is only applied to version 4.10. Signed-off-by: Gary Lockyer --- diff --git a/python/samba/tests/ldap_raw.py b/python/samba/tests/ldap_raw.py index 334fabce230..2e55f785c88 100644 --- a/python/samba/tests/ldap_raw.py +++ b/python/samba/tests/ldap_raw.py @@ -19,6 +19,7 @@ # import socket +import sys import samba.tests from samba.tests import TestCase @@ -162,6 +163,13 @@ class RawLdapTest(TestCase): ''' Check that an LDAP search request equal to the maximum size is accepted ''' + # + # Test is not compatable with python 2 so skip it for the + # backports. + # + if sys.version_info < (3, 0): + self.skipTest("Test is not python2 compatable") + return # Lets build an ldap search packet to query the RootDSE header = encode_string(None) # Base DN, "" @@ -200,6 +208,13 @@ class RawLdapTest(TestCase): Test that a search query longer than the maximum permitted size is rejected. ''' + # + # Test is not compatable with python 2 so skip it for the + # backports. + # + if sys.version_info < (3, 0): + self.skipTest("Test is not python2 compatable") + return # Lets build an ldap search packet to query the RootDSE header = encode_string(None) # Base DN, ""