summaryrefslogtreecommitdiffstats
path: root/meta-python/recipes-devtools/python/python3-virtualenv
diff options
context:
space:
mode:
Diffstat (limited to 'meta-python/recipes-devtools/python/python3-virtualenv')
-rw-r--r--meta-python/recipes-devtools/python/python3-virtualenv/CVE-2026-22702.patch60
1 files changed, 60 insertions, 0 deletions
diff --git a/meta-python/recipes-devtools/python/python3-virtualenv/CVE-2026-22702.patch b/meta-python/recipes-devtools/python/python3-virtualenv/CVE-2026-22702.patch
new file mode 100644
index 0000000000..a0b6d80a42
--- /dev/null
+++ b/meta-python/recipes-devtools/python/python3-virtualenv/CVE-2026-22702.patch
@@ -0,0 +1,60 @@
1From 2e9f44a74a8adbaf641475c58f1cfa1bb7ab15e1 Mon Sep 17 00:00:00 2001
2From: =?UTF-8?q?Bern=C3=A1t=20G=C3=A1bor?= <gaborjbernat@gmail.com>
3Date: Fri, 9 Jan 2026 10:19:39 -0800
4Subject: [PATCH] Merge pull request #3013 from gaborbernat/fix-sec
5
6CVE: CVE-2026-22702
7Upstream-Status: Backport [https://github.com/pypa/virtualenv/commit/dec4cec5d16edaf83a00a658f32d1e032661cebc]
8Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com>
9---
10 src/virtualenv/app_data/__init__.py | 11 +++++------
11 src/virtualenv/util/lock.py | 7 +++----
12 2 files changed, 8 insertions(+), 10 deletions(-)
13
14diff --git a/src/virtualenv/app_data/__init__.py b/src/virtualenv/app_data/__init__.py
15index d7f1480..7a9d38e 100644
16--- a/src/virtualenv/app_data/__init__.py
17+++ b/src/virtualenv/app_data/__init__.py
18@@ -36,12 +36,11 @@ def make_app_data(folder, **kwargs):
19 if is_read_only:
20 return ReadOnlyAppData(folder)
21
22- if not os.path.isdir(folder):
23- try:
24- os.makedirs(folder)
25- LOGGER.debug("created app data folder %s", folder)
26- except OSError as exception:
27- LOGGER.info("could not create app data folder %s due to %r", folder, exception)
28+ try:
29+ os.makedirs(folder, exist_ok=True)
30+ LOGGER.debug("created app data folder %s", folder)
31+ except OSError as exception:
32+ LOGGER.info("could not create app data folder %s due to %r", folder, exception)
33
34 if os.access(folder, os.W_OK):
35 return AppDataDiskFolder(folder)
36diff --git a/src/virtualenv/util/lock.py b/src/virtualenv/util/lock.py
37index b250e03..82c8eed 100644
38--- a/src/virtualenv/util/lock.py
39+++ b/src/virtualenv/util/lock.py
40@@ -17,9 +17,8 @@ LOGGER = logging.getLogger(__name__)
41 class _CountedFileLock(FileLock):
42 def __init__(self, lock_file) -> None:
43 parent = os.path.dirname(lock_file)
44- if not os.path.isdir(parent):
45- with suppress(OSError):
46- os.makedirs(parent)
47+ with suppress(OSError):
48+ os.makedirs(parent, exist_ok=True)
49
50 super().__init__(lock_file)
51 self.count = 0
52@@ -117,7 +116,7 @@ class ReentrantFileLock(PathLockBase):
53 # a lock, but that lock might then become expensive, and it's not clear where that lock should live.
54 # Instead here we just ignore if we fail to create the directory.
55 with suppress(OSError):
56- os.makedirs(str(self.path))
57+ os.makedirs(str(self.path), exist_ok=True)
58
59 try:
60 lock.acquire(0.0001)