diff -Nru python3.10-3.10.12/debian/changelog python3.10-3.10.12/debian/changelog --- python3.10-3.10.12/debian/changelog 2023-11-20 17:14:05.000000000 +0200 +++ python3.10-3.10.12/debian/changelog 2024-05-28 11:55:28.000000000 +0300 @@ -1,3 +1,9 @@ +python3.10 (3.10.12-1~22.04.3ubuntu3) jammy; urgency=medium + + * Backport fix to relax netrc file parsing. Closes: #2067361. + + -- Eero Aaltonen Mon, 28 May 2024 11:55:28 +0300 + python3.10 (3.10.12-1~22.04.3) jammy-security; urgency=medium * SECURITY UPDATE: TLS handshake bypass diff -Nru python3.10-3.10.12/debian/control python3.10-3.10.12/debian/control --- python3.10-3.10.12/debian/control 2023-06-11 08:26:13.000000000 +0300 +++ python3.10-3.10.12/debian/control 2024-05-27 15:37:11.000000000 +0300 @@ -1,7 +1,8 @@ Source: python3.10 Section: python Priority: optional -Maintainer: Matthias Klose +Maintainer: Ubuntu Core Developers +XSBC-Original-Maintainer: Matthias Klose Build-Depends: debhelper (>= 11), dpkg-dev (>= 1.17.11), quilt, autoconf, lsb-release, sharutils, diff -Nru python3.10-3.10.12/debian/patches/netrc-relax-parsing.diff python3.10-3.10.12/debian/patches/netrc-relax-parsing.diff --- python3.10-3.10.12/debian/patches/netrc-relax-parsing.diff 1970-01-01 02:00:00.000000000 +0200 +++ python3.10-3.10.12/debian/patches/netrc-relax-parsing.diff 2024-05-23 14:00:17.000000000 +0300 @@ -0,0 +1,28 @@ +Description: relax netrc parsing to allow only login for a machine + Parsing a netrc file with an entry containing just machine and login + would fail with "malformed machine entry <> terminated by ''". + This check has already been relaxed in Python 3.11. + Minimal change of upstream fix. +Author: Eero Aaltonen +Bug: https://bugs.python.org/issue34908 +Applied-Upstream: https://github.com/python/cpython/pull/26330/commits/7f5ddb4a75fcb64046e3fc2af885960d2800a5b3 + +--- a/Lib/netrc.py ++++ b/Lib/netrc.py +@@ -67,14 +67,13 @@ + "bad toplevel token %r" % tt, file, lexer.lineno) + + # We're looking at start of an entry for a named machine or default. +- login = '' +- account = password = None ++ login = account = password = '' + self.hosts[entryname] = {} + while 1: + tt = lexer.get_token() + if (tt.startswith('#') or + tt in {'', 'machine', 'default', 'macdef'}): +- if password: ++ if password or login: + self.hosts[entryname] = (login, account, password) + lexer.push_token(tt) + break diff -Nru python3.10-3.10.12/debian/patches/series python3.10-3.10.12/debian/patches/series --- python3.10-3.10.12/debian/patches/series 2023-11-14 23:18:29.000000000 +0200 +++ python3.10-3.10.12/debian/patches/series 2024-05-23 14:06:29.000000000 +0300 @@ -41,3 +41,4 @@ fix-ia64.diff gh-78214.diff CVE-2023-40217.patch +netrc-relax-parsing.diff