diff options
Diffstat (limited to 'poky/meta/recipes-devtools/python')
11 files changed, 52 insertions, 224 deletions
diff --git a/poky/meta/recipes-devtools/python/python-cython.inc b/poky/meta/recipes-devtools/python/python-cython.inc index b1e71f3cc..da6eba254 100644 --- a/poky/meta/recipes-devtools/python/python-cython.inc +++ b/poky/meta/recipes-devtools/python/python-cython.inc @@ -7,7 +7,7 @@ LIC_FILES_CHKSUM = "file://LICENSE.txt;md5=e23fadd6ceef8c618fc1c65191d846fa" PYPI_PACKAGE = "Cython" BBCLASSEXTEND = "native nativesdk" -SRC_URI[sha256sum] = "e57acb89bd55943c8d8bf813763d20b9099cc7165c0f16b707631a7654be9cad" +SRC_URI[sha256sum] = "df6b83c7a6d1d967ea89a2903e4a931377634a297459652e4551734c48195406" UPSTREAM_CHECK_REGEX = "Cython-(?P<pver>.*)\.tar" inherit pypi diff --git a/poky/meta/recipes-devtools/python/python-pycryptodome.inc b/poky/meta/recipes-devtools/python/python-pycryptodome.inc index 68b084eb0..48481bcf9 100644 --- a/poky/meta/recipes-devtools/python/python-pycryptodome.inc +++ b/poky/meta/recipes-devtools/python/python-pycryptodome.inc @@ -3,7 +3,7 @@ DESCRIPTION = "PyCryptodome is a self-contained Python package of low-level\ cryptographic primitives." HOMEPAGE = "http://www.pycryptodome.org" LICENSE = "PD & BSD-2-Clause" -LIC_FILES_CHKSUM = "file://LICENSE.rst;md5=6dc0e2a13d2f25d6f123c434b761faba" +LIC_FILES_CHKSUM = "file://LICENSE.rst;md5=accfa6aeaceb3ba96676edf18e78302c" inherit pypi diff --git a/poky/meta/recipes-devtools/python/python3-cython_0.29.21.bb b/poky/meta/recipes-devtools/python/python3-cython_0.29.21.bb deleted file mode 100644 index 2ce6bdbd6..000000000 --- a/poky/meta/recipes-devtools/python/python3-cython_0.29.21.bb +++ /dev/null @@ -1,18 +0,0 @@ -inherit setuptools3 -require python-cython.inc - -RDEPENDS_${PN} += "\ - python3-setuptools \ -" - -# running build_ext a second time during install fails, because Python -# would then attempt to import cythonized modules built for the target -# architecture. -DISTUTILS_INSTALL_ARGS += "--skip-build" - -do_install_append() { - # rename scripts that would conflict with the Python 2 build of Cython - mv ${D}${bindir}/cython ${D}${bindir}/cython3 - mv ${D}${bindir}/cythonize ${D}${bindir}/cythonize3 - mv ${D}${bindir}/cygdb ${D}${bindir}/cygdb3 -} diff --git a/poky/meta/recipes-devtools/python/python3-cython_0.29.22.bb b/poky/meta/recipes-devtools/python/python3-cython_0.29.22.bb new file mode 100644 index 000000000..01f716c16 --- /dev/null +++ b/poky/meta/recipes-devtools/python/python3-cython_0.29.22.bb @@ -0,0 +1,33 @@ +inherit setuptools3 +require python-cython.inc + +RDEPENDS_${PN} += "\ + python3-setuptools \ +" + +# running build_ext a second time during install fails, because Python +# would then attempt to import cythonized modules built for the target +# architecture. +DISTUTILS_INSTALL_ARGS += "--skip-build" + +do_install_append() { + # rename scripts that would conflict with the Python 2 build of Cython + mv ${D}${bindir}/cython ${D}${bindir}/cython3 + mv ${D}${bindir}/cythonize ${D}${bindir}/cythonize3 + mv ${D}${bindir}/cygdb ${D}${bindir}/cygdb3 +} + +PACKAGEBUILDPKGD += "cython_fix_sources" + +cython_fix_sources () { + sed -i -e 's#${WORKDIR}#/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR}#g' \ + ${PKGD}/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR}/Cython-${PV}/Cython/Compiler/FlowControl.c \ + ${PKGD}/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR}/Cython-${PV}/Cython/Compiler/FusedNode.c \ + ${PKGD}/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR}/Cython-${PV}/Cython/Compiler/Scanning.c \ + ${PKGD}/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR}/Cython-${PV}/Cython/Compiler/Visitor.c \ + ${PKGD}/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR}/Cython-${PV}/Cython/Plex/Actions.c \ + ${PKGD}/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR}/Cython-${PV}/Cython/Plex/Scanners.c \ + ${PKGD}/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR}/Cython-${PV}/Cython/Runtime/refnanny.c \ + ${PKGD}/usr/src/debug/${PN}/${EXTENDPE}${PV}-${PR}/Cython-${PV}/Cython/Tempita/_tempita.c \ + ${PKGD}${libdir}/${PYTHON_DIR}/site-packages/Cython*/SOURCES.txt +} diff --git a/poky/meta/recipes-devtools/python/python3-git_3.1.13.bb b/poky/meta/recipes-devtools/python/python3-git_3.1.14.bb index 807767e56..911c8f148 100644 --- a/poky/meta/recipes-devtools/python/python3-git_3.1.13.bb +++ b/poky/meta/recipes-devtools/python/python3-git_3.1.14.bb @@ -12,7 +12,7 @@ PYPI_PACKAGE = "GitPython" inherit pypi setuptools3 -SRC_URI[sha256sum] = "8621a7e777e276a5ec838b59280ba5272dd144a18169c36c903d8b38b99f750a" +SRC_URI[sha256sum] = "be27633e7509e58391f10207cd32b2a6cf5b908f92d9cd30da2e514e1137af61" DEPENDS += " ${PYTHON_PN}-gitdb" diff --git a/poky/meta/recipes-devtools/python/python3-magic_0.4.18.bb b/poky/meta/recipes-devtools/python/python3-magic_0.4.22.bb index 101b96d31..b82892759 100644 --- a/poky/meta/recipes-devtools/python/python3-magic_0.4.18.bb +++ b/poky/meta/recipes-devtools/python/python3-magic_0.4.22.bb @@ -5,18 +5,18 @@ DESCRIPTION = "This module uses ctypes to access the libmagic file type \ HOMEPAGE = "http://github.com/ahupp/python-magic" LICENSE = "MIT" -LIC_FILES_CHKSUM = "file://LICENSE;md5=16a934f165e8c3245f241e77d401bb88" +LIC_FILES_CHKSUM = "file://LICENSE;md5=61495c152d794e6be5799a9edca149e3" PYPI_PACKAGE = "python-magic" inherit pypi setuptools3 -SRC_URI[md5sum] = "5edc6caa39cc62641850f6b1b6f284ba" -SRC_URI[sha256sum] = "b757db2a5289ea3f1ced9e60f072965243ea43a2221430048fd8cacab17be0ce" +SRC_URI[sha256sum] = "ca884349f2c92ce830e3f498c5b7c7051fe2942c3ee4332f65213b8ebff15a62" RDEPENDS_${PN} += "file \ ${PYTHON_PN}-ctypes \ ${PYTHON_PN}-io \ + ${PYTHON_PN}-logging \ ${PYTHON_PN}-shell" BBCLASSEXTEND = "native" diff --git a/poky/meta/recipes-devtools/python/python3-pycryptodome_3.10.1.bb b/poky/meta/recipes-devtools/python/python3-pycryptodome_3.10.1.bb new file mode 100644 index 000000000..28448b84f --- /dev/null +++ b/poky/meta/recipes-devtools/python/python3-pycryptodome_3.10.1.bb @@ -0,0 +1,5 @@ +require python-pycryptodome.inc +inherit setuptools3 + +SRC_URI[sha256sum] = "3e2e3a06580c5f190df843cdb90ea28d61099cf4924334d5297a995de68e4673" + diff --git a/poky/meta/recipes-devtools/python/python3-pycryptodome_3.9.9.bb b/poky/meta/recipes-devtools/python/python3-pycryptodome_3.9.9.bb deleted file mode 100644 index 1e84ce4df..000000000 --- a/poky/meta/recipes-devtools/python/python3-pycryptodome_3.9.9.bb +++ /dev/null @@ -1,5 +0,0 @@ -require python-pycryptodome.inc -inherit setuptools3 - -SRC_URI[sha256sum] = "910e202a557e1131b1c1b3f17a63914d57aac55cf9fb9b51644962841c3995c4" - diff --git a/poky/meta/recipes-devtools/python/python3-pycryptodomex_3.9.9.bb b/poky/meta/recipes-devtools/python/python3-pycryptodomex_3.10.1.bb index abff71efd..a6b3b3e93 100644 --- a/poky/meta/recipes-devtools/python/python3-pycryptodomex_3.9.9.bb +++ b/poky/meta/recipes-devtools/python/python3-pycryptodomex_3.10.1.bb @@ -1,7 +1,7 @@ require python-pycryptodome.inc inherit setuptools3 -SRC_URI[sha256sum] = "7b5b7c5896f8172ea0beb283f7f9428e0ab88ec248ce0a5b8c98d73e26267d51" +SRC_URI[sha256sum] = "541cd3e3e252fb19a7b48f420b798b53483302b7fe4d9954c947605d0a263d62" FILES_${PN}-tests = " \ ${PYTHON_SITEPACKAGES_DIR}/Cryptodome/SelfTest/ \ diff --git a/poky/meta/recipes-devtools/python/python3/CVE-2021-3177.patch b/poky/meta/recipes-devtools/python/python3/CVE-2021-3177.patch deleted file mode 100644 index a48207162..000000000 --- a/poky/meta/recipes-devtools/python/python3/CVE-2021-3177.patch +++ /dev/null @@ -1,191 +0,0 @@ -From c347cbe694743cee120457aa6626712f7799a932 Mon Sep 17 00:00:00 2001 -From: "Miss Islington (bot)" - <31488909+miss-islington@users.noreply.github.com> -Date: Mon, 18 Jan 2021 13:29:31 -0800 -Subject: [PATCH] closes bpo-42938: Replace snprintf with Python unicode - formatting in ctypes param reprs. (GH-24247) - -(cherry picked from commit 916610ef90a0d0761f08747f7b0905541f0977c7) - -Co-authored-by: Benjamin Peterson <benjamin@python.org> - -Co-authored-by: Benjamin Peterson <benjamin@python.org> - -CVE: CVE-2021-3177 -Upstream-Status: Backport [https://github.com/python/cpython/commit/c347cbe694743cee120457aa6626712f7799a932] -Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> ---- - Lib/ctypes/test/test_parameters.py | 43 ++++++++++++++++ - .../2021-01-18-09-27-31.bpo-42938.4Zn4Mp.rst | 2 + - Modules/_ctypes/callproc.c | 51 +++++++------------ - 3 files changed, 64 insertions(+), 32 deletions(-) - create mode 100644 Misc/NEWS.d/next/Security/2021-01-18-09-27-31.bpo-42938.4Zn4Mp.rst - -diff --git a/Lib/ctypes/test/test_parameters.py b/Lib/ctypes/test/test_parameters.py -index e4c25fd880cef..531894fdec838 100644 ---- a/Lib/ctypes/test/test_parameters.py -+++ b/Lib/ctypes/test/test_parameters.py -@@ -201,6 +201,49 @@ def __dict__(self): - with self.assertRaises(ZeroDivisionError): - WorseStruct().__setstate__({}, b'foo') - -+ def test_parameter_repr(self): -+ from ctypes import ( -+ c_bool, -+ c_char, -+ c_wchar, -+ c_byte, -+ c_ubyte, -+ c_short, -+ c_ushort, -+ c_int, -+ c_uint, -+ c_long, -+ c_ulong, -+ c_longlong, -+ c_ulonglong, -+ c_float, -+ c_double, -+ c_longdouble, -+ c_char_p, -+ c_wchar_p, -+ c_void_p, -+ ) -+ self.assertRegex(repr(c_bool.from_param(True)), r"^<cparam '\?' at 0x[A-Fa-f0-9]+>$") -+ self.assertEqual(repr(c_char.from_param(97)), "<cparam 'c' ('a')>") -+ self.assertRegex(repr(c_wchar.from_param('a')), r"^<cparam 'u' at 0x[A-Fa-f0-9]+>$") -+ self.assertEqual(repr(c_byte.from_param(98)), "<cparam 'b' (98)>") -+ self.assertEqual(repr(c_ubyte.from_param(98)), "<cparam 'B' (98)>") -+ self.assertEqual(repr(c_short.from_param(511)), "<cparam 'h' (511)>") -+ self.assertEqual(repr(c_ushort.from_param(511)), "<cparam 'H' (511)>") -+ self.assertRegex(repr(c_int.from_param(20000)), r"^<cparam '[li]' \(20000\)>$") -+ self.assertRegex(repr(c_uint.from_param(20000)), r"^<cparam '[LI]' \(20000\)>$") -+ self.assertRegex(repr(c_long.from_param(20000)), r"^<cparam '[li]' \(20000\)>$") -+ self.assertRegex(repr(c_ulong.from_param(20000)), r"^<cparam '[LI]' \(20000\)>$") -+ self.assertRegex(repr(c_longlong.from_param(20000)), r"^<cparam '[liq]' \(20000\)>$") -+ self.assertRegex(repr(c_ulonglong.from_param(20000)), r"^<cparam '[LIQ]' \(20000\)>$") -+ self.assertEqual(repr(c_float.from_param(1.5)), "<cparam 'f' (1.5)>") -+ self.assertEqual(repr(c_double.from_param(1.5)), "<cparam 'd' (1.5)>") -+ self.assertEqual(repr(c_double.from_param(1e300)), "<cparam 'd' (1e+300)>") -+ self.assertRegex(repr(c_longdouble.from_param(1.5)), r"^<cparam ('d' \(1.5\)|'g' at 0x[A-Fa-f0-9]+)>$") -+ self.assertRegex(repr(c_char_p.from_param(b'hihi')), "^<cparam 'z' \(0x[A-Fa-f0-9]+\)>$") -+ self.assertRegex(repr(c_wchar_p.from_param('hihi')), "^<cparam 'Z' \(0x[A-Fa-f0-9]+\)>$") -+ self.assertRegex(repr(c_void_p.from_param(0x12)), r"^<cparam 'P' \(0x0*12\)>$") -+ - ################################################################ - - if __name__ == '__main__': -diff --git a/Misc/NEWS.d/next/Security/2021-01-18-09-27-31.bpo-42938.4Zn4Mp.rst b/Misc/NEWS.d/next/Security/2021-01-18-09-27-31.bpo-42938.4Zn4Mp.rst -new file mode 100644 -index 0000000000000..7df65a156feab ---- /dev/null -+++ b/Misc/NEWS.d/next/Security/2021-01-18-09-27-31.bpo-42938.4Zn4Mp.rst -@@ -0,0 +1,2 @@ -+Avoid static buffers when computing the repr of :class:`ctypes.c_double` and -+:class:`ctypes.c_longdouble` values. -diff --git a/Modules/_ctypes/callproc.c b/Modules/_ctypes/callproc.c -index b0a36a30248f7..f2506de54498e 100644 ---- a/Modules/_ctypes/callproc.c -+++ b/Modules/_ctypes/callproc.c -@@ -489,58 +489,47 @@ is_literal_char(unsigned char c) - static PyObject * - PyCArg_repr(PyCArgObject *self) - { -- char buffer[256]; - switch(self->tag) { - case 'b': - case 'B': -- sprintf(buffer, "<cparam '%c' (%d)>", -+ return PyUnicode_FromFormat("<cparam '%c' (%d)>", - self->tag, self->value.b); -- break; - case 'h': - case 'H': -- sprintf(buffer, "<cparam '%c' (%d)>", -+ return PyUnicode_FromFormat("<cparam '%c' (%d)>", - self->tag, self->value.h); -- break; - case 'i': - case 'I': -- sprintf(buffer, "<cparam '%c' (%d)>", -+ return PyUnicode_FromFormat("<cparam '%c' (%d)>", - self->tag, self->value.i); -- break; - case 'l': - case 'L': -- sprintf(buffer, "<cparam '%c' (%ld)>", -+ return PyUnicode_FromFormat("<cparam '%c' (%ld)>", - self->tag, self->value.l); -- break; - - case 'q': - case 'Q': -- sprintf(buffer, --#ifdef MS_WIN32 -- "<cparam '%c' (%I64d)>", --#else -- "<cparam '%c' (%lld)>", --#endif -+ return PyUnicode_FromFormat("<cparam '%c' (%lld)>", - self->tag, self->value.q); -- break; - case 'd': -- sprintf(buffer, "<cparam '%c' (%f)>", -- self->tag, self->value.d); -- break; -- case 'f': -- sprintf(buffer, "<cparam '%c' (%f)>", -- self->tag, self->value.f); -- break; -- -+ case 'f': { -+ PyObject *f = PyFloat_FromDouble((self->tag == 'f') ? self->value.f : self->value.d); -+ if (f == NULL) { -+ return NULL; -+ } -+ PyObject *result = PyUnicode_FromFormat("<cparam '%c' (%R)>", self->tag, f); -+ Py_DECREF(f); -+ return result; -+ } - case 'c': - if (is_literal_char((unsigned char)self->value.c)) { -- sprintf(buffer, "<cparam '%c' ('%c')>", -+ return PyUnicode_FromFormat("<cparam '%c' ('%c')>", - self->tag, self->value.c); - } - else { -- sprintf(buffer, "<cparam '%c' ('\\x%02x')>", -+ return PyUnicode_FromFormat("<cparam '%c' ('\\x%02x')>", - self->tag, (unsigned char)self->value.c); - } -- break; - - /* Hm, are these 'z' and 'Z' codes useful at all? - Shouldn't they be replaced by the functionality of c_string -@@ -549,22 +538,20 @@ PyCArg_repr(PyCArgObject *self) - case 'z': - case 'Z': - case 'P': -- sprintf(buffer, "<cparam '%c' (%p)>", -+ return PyUnicode_FromFormat("<cparam '%c' (%p)>", - self->tag, self->value.p); - break; - - default: - if (is_literal_char((unsigned char)self->tag)) { -- sprintf(buffer, "<cparam '%c' at %p>", -+ return PyUnicode_FromFormat("<cparam '%c' at %p>", - (unsigned char)self->tag, (void *)self); - } - else { -- sprintf(buffer, "<cparam 0x%02x at %p>", -+ return PyUnicode_FromFormat("<cparam 0x%02x at %p>", - (unsigned char)self->tag, (void *)self); - } -- break; - } -- return PyUnicode_FromString(buffer); - } - - static PyMemberDef PyCArgType_members[] = { - diff --git a/poky/meta/recipes-devtools/python/python3_3.9.1.bb b/poky/meta/recipes-devtools/python/python3_3.9.2.bb index ad032e97a..af1843a18 100644 --- a/poky/meta/recipes-devtools/python/python3_3.9.1.bb +++ b/poky/meta/recipes-devtools/python/python3_3.9.2.bb @@ -1,9 +1,10 @@ SUMMARY = "The Python Programming Language" HOMEPAGE = "http://www.python.org" +DESCRIPTION = "Python is a programming language that lets you work more quickly and integrate your systems more effectively." LICENSE = "PSFv2" SECTION = "devel/python" -LIC_FILES_CHKSUM = "file://LICENSE;md5=33223c9ef60c31e3f0e866cb09b65e83" +LIC_FILES_CHKSUM = "file://LICENSE;md5=c22d2438294c784731bf9dd224a467b7" SRC_URI = "http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.xz \ file://run-ptest \ @@ -29,7 +30,6 @@ SRC_URI = "http://www.python.org/ftp/python/${PV}/Python-${PV}.tar.xz \ file://0001-Makefile-do-not-compile-.pyc-in-parallel.patch \ file://0020-configure.ac-setup.py-do-not-add-a-curses-include-pa.patch \ file://0001-Lib-sysconfig.py-use-libdir-values-from-configuratio.patch \ - file://CVE-2021-3177.patch \ " SRC_URI_append_class-native = " \ @@ -37,7 +37,7 @@ SRC_URI_append_class-native = " \ file://12-distutils-prefix-is-inside-staging-area.patch \ file://0001-Don-t-search-system-for-headers-libraries.patch \ " -SRC_URI[sha256sum] = "991c3f8ac97992f3d308fefeb03a64db462574eadbff34ce8bc5bb583d9903ff" +SRC_URI[sha256sum] = "3c2034c54f811448f516668dce09d24008a0716c3a794dd8639b5388cbde247d" # exclude pre-releases for both python 2.x and 3.x UPSTREAM_CHECK_REGEX = "[Pp]ython-(?P<pver>\d+(\.\d+)+).tar" @@ -178,6 +178,10 @@ do_install_append() { } do_install_append_class-nativesdk () { + # Make sure we use /usr/bin/env python + for PYTHSCRIPT in `grep -rIl ${bindir}/python ${D}${bindir}`; do + sed -i -e '1s|^#!.*|#!/usr/bin/env python3|' $PYTHSCRIPT + done create_wrapper ${D}${bindir}/python${PYTHON_MAJMIN} TERMINFO_DIRS='${sysconfdir}/terminfo:/etc/terminfo:/usr/share/terminfo:/usr/share/misc/terminfo:/lib/terminfo' PYTHONNOUSERSITE='1' } |