mirror of
git://git.openembedded.org/meta-openembedded
synced 2026-09-30 03:22:48 +00:00
python3-virtualenv: patch CVE-2026-22702
Details: https://nvd.nist.gov/vuln/detail/CVE-2026-22702 Backport the patch that is referenced by the NVD advisory. Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com> Signed-off-by: Anuj Mittal <anuj.mittal@oss.qualcomm.com>
This commit is contained in:
parent
ea9fb97f53
commit
87ce1e904b
@ -0,0 +1,60 @@
|
|||||||
|
From 2e9f44a74a8adbaf641475c58f1cfa1bb7ab15e1 Mon Sep 17 00:00:00 2001
|
||||||
|
From: =?UTF-8?q?Bern=C3=A1t=20G=C3=A1bor?= <gaborjbernat@gmail.com>
|
||||||
|
Date: Fri, 9 Jan 2026 10:19:39 -0800
|
||||||
|
Subject: [PATCH] Merge pull request #3013 from gaborbernat/fix-sec
|
||||||
|
|
||||||
|
CVE: CVE-2026-22702
|
||||||
|
Upstream-Status: Backport [https://github.com/pypa/virtualenv/commit/dec4cec5d16edaf83a00a658f32d1e032661cebc]
|
||||||
|
Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
|
||||||
|
---
|
||||||
|
src/virtualenv/app_data/__init__.py | 11 +++++------
|
||||||
|
src/virtualenv/util/lock.py | 7 +++----
|
||||||
|
2 files changed, 8 insertions(+), 10 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/virtualenv/app_data/__init__.py b/src/virtualenv/app_data/__init__.py
|
||||||
|
index d7f1480..7a9d38e 100644
|
||||||
|
--- a/src/virtualenv/app_data/__init__.py
|
||||||
|
+++ b/src/virtualenv/app_data/__init__.py
|
||||||
|
@@ -36,12 +36,11 @@ def make_app_data(folder, **kwargs):
|
||||||
|
if is_read_only:
|
||||||
|
return ReadOnlyAppData(folder)
|
||||||
|
|
||||||
|
- if not os.path.isdir(folder):
|
||||||
|
- try:
|
||||||
|
- os.makedirs(folder)
|
||||||
|
- LOGGER.debug("created app data folder %s", folder)
|
||||||
|
- except OSError as exception:
|
||||||
|
- LOGGER.info("could not create app data folder %s due to %r", folder, exception)
|
||||||
|
+ try:
|
||||||
|
+ os.makedirs(folder, exist_ok=True)
|
||||||
|
+ LOGGER.debug("created app data folder %s", folder)
|
||||||
|
+ except OSError as exception:
|
||||||
|
+ LOGGER.info("could not create app data folder %s due to %r", folder, exception)
|
||||||
|
|
||||||
|
if os.access(folder, os.W_OK):
|
||||||
|
return AppDataDiskFolder(folder)
|
||||||
|
diff --git a/src/virtualenv/util/lock.py b/src/virtualenv/util/lock.py
|
||||||
|
index b250e03..82c8eed 100644
|
||||||
|
--- a/src/virtualenv/util/lock.py
|
||||||
|
+++ b/src/virtualenv/util/lock.py
|
||||||
|
@@ -17,9 +17,8 @@ LOGGER = logging.getLogger(__name__)
|
||||||
|
class _CountedFileLock(FileLock):
|
||||||
|
def __init__(self, lock_file) -> None:
|
||||||
|
parent = os.path.dirname(lock_file)
|
||||||
|
- if not os.path.isdir(parent):
|
||||||
|
- with suppress(OSError):
|
||||||
|
- os.makedirs(parent)
|
||||||
|
+ with suppress(OSError):
|
||||||
|
+ os.makedirs(parent, exist_ok=True)
|
||||||
|
|
||||||
|
super().__init__(lock_file)
|
||||||
|
self.count = 0
|
||||||
|
@@ -117,7 +116,7 @@ class ReentrantFileLock(PathLockBase):
|
||||||
|
# a lock, but that lock might then become expensive, and it's not clear where that lock should live.
|
||||||
|
# Instead here we just ignore if we fail to create the directory.
|
||||||
|
with suppress(OSError):
|
||||||
|
- os.makedirs(str(self.path))
|
||||||
|
+ os.makedirs(str(self.path), exist_ok=True)
|
||||||
|
|
||||||
|
try:
|
||||||
|
lock.acquire(0.0001)
|
||||||
@ -6,6 +6,7 @@ HOMEPAGE = "https://github.com/pypa/virtualenv"
|
|||||||
LICENSE = "MIT"
|
LICENSE = "MIT"
|
||||||
LIC_FILES_CHKSUM = "file://LICENSE;md5=0ce089158cf60a8ab6abb452b6405538"
|
LIC_FILES_CHKSUM = "file://LICENSE;md5=0ce089158cf60a8ab6abb452b6405538"
|
||||||
|
|
||||||
|
SRC_URI += "file://CVE-2026-22702.patch"
|
||||||
SRC_URI[sha256sum] = "643d3914d73d3eeb0c552cbb12d7e82adf0e504dbf86a3182f8771a153a1971c"
|
SRC_URI[sha256sum] = "643d3914d73d3eeb0c552cbb12d7e82adf0e504dbf86a3182f8771a153a1971c"
|
||||||
|
|
||||||
BBCLASSEXTEND = "native nativesdk"
|
BBCLASSEXTEND = "native nativesdk"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user