forked from pool/python311
add test_UDPLITE_support.patch
This commit is contained in:
@@ -1,3 +1,10 @@
|
||||
-------------------------------------------------------------------
|
||||
Mon Jun 29 06:37:10 UTC 2026 - Jiri Slaby <jslaby@suse.cz>
|
||||
|
||||
- Add test_UDPLITE_support.patch which improves testing for the
|
||||
support of IPPROTO_UDPLITE, which could be not present although
|
||||
header files are (bsc#1268375).
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Sat Jun 6 00:00:00 UTC 2026 - Matej Cepl <mcepl@suse.com>
|
||||
|
||||
|
||||
@@ -190,6 +190,9 @@ Patch25: gh139257-Support-docutils-0.22.patch
|
||||
# PATCH-FIX-UPSTREAM CVE-2025-15366-imap-ctrl-chars.patch bsc#1257044 mcepl@suse.com
|
||||
# Reject control characters in wsgiref.headers.Headers
|
||||
Patch33: CVE-2025-15366-imap-ctrl-chars.patch
|
||||
# PATCH-FIX-OPENSUSE test_UDPLITE_support.patch mcepl@suse.com
|
||||
# improve testing of the presence of IPPROTO_UDPLITE support
|
||||
Patch34: test_UDPLITE_support.patch
|
||||
# PATCH-FIX-UPSTREAM CVE-2025-15367-poplib-ctrl-chars.patch bsc#1257041 mcepl@suse.com
|
||||
# Reject control characters in poplib
|
||||
Patch35: CVE-2025-15367-poplib-ctrl-chars.patch
|
||||
|
||||
@@ -8,18 +8,18 @@ Subject: [PATCH] gh-141707: Skip TarInfo DIRTYPE normalization during GNU long
|
||||
Co-authored-by: Seth Michael Larson <seth@python.org>
|
||||
Co-authored-by: Eashwar Ranganathan <eashwar@eashwar.com>
|
||||
---
|
||||
Lib/tarfile.py | 29 ++++++++++++++++---
|
||||
Lib/test/test_tarfile.py | 19 ++++++++++++
|
||||
Misc/ACKS | 1 +
|
||||
...-11-18-06-35-53.gh-issue-141707.DBmQIy.rst | 2 ++
|
||||
Lib/tarfile.py | 29 ++++++++--
|
||||
Lib/test/test_tarfile.py | 19 ++++++
|
||||
Misc/ACKS | 1
|
||||
Misc/NEWS.d/next/Library/2025-11-18-06-35-53.gh-issue-141707.DBmQIy.rst | 2
|
||||
4 files changed, 47 insertions(+), 4 deletions(-)
|
||||
create mode 100644 Misc/NEWS.d/next/Library/2025-11-18-06-35-53.gh-issue-141707.DBmQIy.rst
|
||||
|
||||
diff --git a/Lib/tarfile.py b/Lib/tarfile.py
|
||||
index c04c576ea22d2d..e2d9f9e6c61b31 100755
|
||||
--- a/Lib/tarfile.py
|
||||
+++ b/Lib/tarfile.py
|
||||
@@ -1245,6 +1245,20 @@ def _create_pax_generic_header(cls, pax_headers, type, encoding):
|
||||
Index: Python-3.11.15/Lib/tarfile.py
|
||||
===================================================================
|
||||
--- Python-3.11.15.orig/Lib/tarfile.py 2026-06-29 17:39:12.586198443 +0200
|
||||
+++ Python-3.11.15/Lib/tarfile.py 2026-06-29 17:39:23.342401172 +0200
|
||||
@@ -1244,6 +1244,20 @@
|
||||
@classmethod
|
||||
def frombuf(cls, buf, encoding, errors):
|
||||
"""Construct a TarInfo object from a 512 byte bytes object.
|
||||
@@ -40,7 +40,7 @@ index c04c576ea22d2d..e2d9f9e6c61b31 100755
|
||||
"""
|
||||
if len(buf) == 0:
|
||||
raise EmptyHeaderError("empty header")
|
||||
@@ -1275,7 +1289,7 @@ def frombuf(cls, buf, encoding, errors):
|
||||
@@ -1274,7 +1288,7 @@
|
||||
|
||||
# Old V7 tar format represents a directory as a regular
|
||||
# file with a trailing slash.
|
||||
@@ -49,7 +49,7 @@ index c04c576ea22d2d..e2d9f9e6c61b31 100755
|
||||
obj.type = DIRTYPE
|
||||
|
||||
# The old GNU sparse format occupies some of the unused
|
||||
@@ -1310,8 +1324,15 @@ def fromtarfile(cls, tarfile):
|
||||
@@ -1309,8 +1323,15 @@
|
||||
"""Return the next TarInfo object from TarFile object
|
||||
tarfile.
|
||||
"""
|
||||
@@ -66,7 +66,7 @@ index c04c576ea22d2d..e2d9f9e6c61b31 100755
|
||||
obj.offset = tarfile.fileobj.tell() - BLOCKSIZE
|
||||
return obj._proc_member(tarfile)
|
||||
|
||||
@@ -1369,7 +1390,7 @@ def _proc_gnulong(self, tarfile):
|
||||
@@ -1368,7 +1389,7 @@
|
||||
|
||||
# Fetch the next header and process it.
|
||||
try:
|
||||
@@ -75,7 +75,7 @@ index c04c576ea22d2d..e2d9f9e6c61b31 100755
|
||||
except HeaderError as e:
|
||||
raise SubsequentHeaderError(str(e)) from None
|
||||
|
||||
@@ -1504,7 +1525,7 @@ def _proc_pax(self, tarfile):
|
||||
@@ -1503,7 +1524,7 @@
|
||||
|
||||
# Fetch the next header.
|
||||
try:
|
||||
@@ -84,11 +84,11 @@ index c04c576ea22d2d..e2d9f9e6c61b31 100755
|
||||
except HeaderError as e:
|
||||
raise SubsequentHeaderError(str(e)) from None
|
||||
|
||||
diff --git a/Lib/test/test_tarfile.py b/Lib/test/test_tarfile.py
|
||||
index 366aac781df1e7..11066c005629c2 100644
|
||||
--- a/Lib/test/test_tarfile.py
|
||||
+++ b/Lib/test/test_tarfile.py
|
||||
@@ -1105,6 +1105,25 @@ def test_longname_directory(self):
|
||||
Index: Python-3.11.15/Lib/test/test_tarfile.py
|
||||
===================================================================
|
||||
--- Python-3.11.15.orig/Lib/test/test_tarfile.py 2026-06-29 17:39:12.586198443 +0200
|
||||
+++ Python-3.11.15/Lib/test/test_tarfile.py 2026-06-29 17:39:23.344304018 +0200
|
||||
@@ -1105,6 +1105,25 @@
|
||||
self.assertIsNotNone(tar.getmember(longdir))
|
||||
self.assertIsNotNone(tar.getmember(longdir.removesuffix('/')))
|
||||
|
||||
@@ -114,11 +114,11 @@ index 366aac781df1e7..11066c005629c2 100644
|
||||
class GNUReadTest(LongnameTest, ReadTest, unittest.TestCase):
|
||||
|
||||
subdir = "gnu"
|
||||
diff --git a/Misc/ACKS b/Misc/ACKS
|
||||
index 89474408a6bbd4..1c0f5d7f782fd3 100644
|
||||
--- a/Misc/ACKS
|
||||
+++ b/Misc/ACKS
|
||||
@@ -1462,6 +1462,7 @@ Dhushyanth Ramasamy
|
||||
Index: Python-3.11.15/Misc/ACKS
|
||||
===================================================================
|
||||
--- Python-3.11.15.orig/Misc/ACKS 2026-06-29 17:39:12.586198443 +0200
|
||||
+++ Python-3.11.15/Misc/ACKS 2026-06-29 17:39:23.344820622 +0200
|
||||
@@ -1462,6 +1462,7 @@
|
||||
Ashwin Ramaswami
|
||||
Jeff Ramnani
|
||||
Bayard Randel
|
||||
@@ -126,11 +126,10 @@ index 89474408a6bbd4..1c0f5d7f782fd3 100644
|
||||
Varpu Rantala
|
||||
Brodie Rao
|
||||
Rémi Rampin
|
||||
diff --git a/Misc/NEWS.d/next/Library/2025-11-18-06-35-53.gh-issue-141707.DBmQIy.rst b/Misc/NEWS.d/next/Library/2025-11-18-06-35-53.gh-issue-141707.DBmQIy.rst
|
||||
new file mode 100644
|
||||
index 00000000000000..1f5b8ed90b8a90
|
||||
--- /dev/null
|
||||
+++ b/Misc/NEWS.d/next/Library/2025-11-18-06-35-53.gh-issue-141707.DBmQIy.rst
|
||||
Index: Python-3.11.15/Misc/NEWS.d/next/Library/2025-11-18-06-35-53.gh-issue-141707.DBmQIy.rst
|
||||
===================================================================
|
||||
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
|
||||
+++ Python-3.11.15/Misc/NEWS.d/next/Library/2025-11-18-06-35-53.gh-issue-141707.DBmQIy.rst 2026-06-29 17:39:23.344986104 +0200
|
||||
@@ -0,0 +1,2 @@
|
||||
+Don't change :class:`tarfile.TarInfo` type from ``AREGTYPE`` to ``DIRTYPE`` when parsing
|
||||
+GNU long name or link headers.
|
||||
|
||||
@@ -0,0 +1,40 @@
|
||||
---
|
||||
Lib/test/test_socket.py | 18 +++++++++++++++++-
|
||||
1 file changed, 17 insertions(+), 1 deletion(-)
|
||||
|
||||
Index: Python-3.11.15/Lib/test/test_socket.py
|
||||
===================================================================
|
||||
--- Python-3.11.15.orig/Lib/test/test_socket.py 2026-06-29 17:36:41.094343156 +0200
|
||||
+++ Python-3.11.15/Lib/test/test_socket.py 2026-06-29 17:38:44.155662592 +0200
|
||||
@@ -132,6 +132,22 @@
|
||||
return (cid is not None)
|
||||
|
||||
|
||||
+def _have_socket_udplite():
|
||||
+ """Check whether UDPLITE sockets are supported on this host."""
|
||||
+ if not hasattr(socket, "IPPROTO_UDPLITE"):
|
||||
+ return False
|
||||
+ # Older Android versions block UDPLITE with SELinux.
|
||||
+ if support.is_android and platform.android_ver().api_level < 29:
|
||||
+ return False
|
||||
+ try:
|
||||
+ s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDPLITE)
|
||||
+ except (AttributeError, OSError):
|
||||
+ return False
|
||||
+ else:
|
||||
+ s.close()
|
||||
+ return True
|
||||
+
|
||||
+
|
||||
def _have_socket_bluetooth():
|
||||
"""Check whether AF_BLUETOOTH sockets are supported on this host."""
|
||||
try:
|
||||
@@ -169,7 +185,7 @@
|
||||
|
||||
HAVE_SOCKET_VSOCK = _have_socket_vsock()
|
||||
|
||||
-HAVE_SOCKET_UDPLITE = hasattr(socket, "IPPROTO_UDPLITE")
|
||||
+HAVE_SOCKET_UDPLITE = _have_socket_udplite()
|
||||
|
||||
HAVE_SOCKET_BLUETOOTH = _have_socket_bluetooth()
|
||||
|
||||
Reference in New Issue
Block a user