Compare commits
2 Commits
| Author | SHA256 | Date | |
|---|---|---|---|
| 8241c9e124 | |||
| e177d18cec |
3
.gitattributes
vendored
3
.gitattributes
vendored
@@ -1,4 +1,4 @@
|
|||||||
## Default LFS
|
*.changes merge=merge-changes
|
||||||
*.7z filter=lfs diff=lfs merge=lfs -text
|
*.7z filter=lfs diff=lfs merge=lfs -text
|
||||||
*.bsp filter=lfs diff=lfs merge=lfs -text
|
*.bsp filter=lfs diff=lfs merge=lfs -text
|
||||||
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
*.bz2 filter=lfs diff=lfs merge=lfs -text
|
||||||
@@ -12,6 +12,7 @@
|
|||||||
*.pdf filter=lfs diff=lfs merge=lfs -text
|
*.pdf filter=lfs diff=lfs merge=lfs -text
|
||||||
*.png filter=lfs diff=lfs merge=lfs -text
|
*.png filter=lfs diff=lfs merge=lfs -text
|
||||||
*.rpm filter=lfs diff=lfs merge=lfs -text
|
*.rpm filter=lfs diff=lfs merge=lfs -text
|
||||||
|
*.tar filter=lfs diff=lfs merge=lfs -text
|
||||||
*.tbz filter=lfs diff=lfs merge=lfs -text
|
*.tbz filter=lfs diff=lfs merge=lfs -text
|
||||||
*.tbz2 filter=lfs diff=lfs merge=lfs -text
|
*.tbz2 filter=lfs diff=lfs merge=lfs -text
|
||||||
*.tgz filter=lfs diff=lfs merge=lfs -text
|
*.tgz filter=lfs diff=lfs merge=lfs -text
|
||||||
|
|||||||
5
.gitignore
vendored
5
.gitignore
vendored
@@ -1 +1,4 @@
|
|||||||
.osc
|
*.obscpio
|
||||||
|
*.osc
|
||||||
|
_build.*
|
||||||
|
.pbuild
|
||||||
|
|||||||
@@ -1,126 +0,0 @@
|
|||||||
From 7a7d2de96b22a9adf9208afcc9547e1001569fef Mon Sep 17 00:00:00 2001
|
|
||||||
From: =?UTF-8?q?Alex=20Gr=C3=B6nholm?= <alex.gronholm@nextday.fi>
|
|
||||||
Date: Thu, 22 Jan 2026 01:41:14 +0200
|
|
||||||
Subject: [PATCH] Fixed security issue around wheel unpack (#675)
|
|
||||||
|
|
||||||
A maliciously crafted wheel could cause the permissions of a file outside the unpack tree to be altered.
|
|
||||||
|
|
||||||
Fixes CVE-2026-24049.
|
|
||||||
---
|
|
||||||
docs/news.rst | 2 ++
|
|
||||||
src/wheel/_commands/unpack.py | 4 ++--
|
|
||||||
tests/commands/test_unpack.py | 23 +++++++++++++++++++++++
|
|
||||||
3 files changed, 27 insertions(+), 2 deletions(-)
|
|
||||||
|
|
||||||
Index: wheel-0.42.0/src/wheel/cli/unpack.py
|
|
||||||
===================================================================
|
|
||||||
--- wheel-0.42.0.orig/src/wheel/cli/unpack.py
|
|
||||||
+++ wheel-0.42.0/src/wheel/cli/unpack.py
|
|
||||||
@@ -19,12 +19,12 @@ def unpack(path: str, dest: str = ".") -
|
|
||||||
destination = Path(dest) / namever
|
|
||||||
print(f"Unpacking to: {destination}...", end="", flush=True)
|
|
||||||
for zinfo in wf.filelist:
|
|
||||||
- wf.extract(zinfo, destination)
|
|
||||||
+ target_path = Path(wf.extract(zinfo, destination))
|
|
||||||
|
|
||||||
# Set permissions to the same values as they were set in the archive
|
|
||||||
# We have to do this manually due to
|
|
||||||
# https://github.com/python/cpython/issues/59999
|
|
||||||
permissions = zinfo.external_attr >> 16 & 0o777
|
|
||||||
- destination.joinpath(zinfo.filename).chmod(permissions)
|
|
||||||
+ target_path.chmod(permissions)
|
|
||||||
|
|
||||||
print("OK")
|
|
||||||
Index: wheel-0.42.0/tests/cli/test_unpack.py
|
|
||||||
===================================================================
|
|
||||||
--- wheel-0.42.0.orig/tests/cli/test_unpack.py
|
|
||||||
+++ wheel-0.42.0/tests/cli/test_unpack.py
|
|
||||||
@@ -8,6 +8,7 @@ import pytest
|
|
||||||
from wheel.cli.unpack import unpack
|
|
||||||
from wheel.wheelfile import WheelFile
|
|
||||||
|
|
||||||
+from .util import run_command
|
|
||||||
|
|
||||||
def test_unpack(wheel_paths, tmp_path):
|
|
||||||
"""
|
|
||||||
@@ -34,3 +35,26 @@ def test_unpack_executable_bit(tmp_path)
|
|
||||||
unpack(str(wheel_path), str(tmp_path))
|
|
||||||
assert not script_path.is_dir()
|
|
||||||
assert stat.S_IMODE(script_path.stat().st_mode) == 0o755
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+@pytest.mark.skipif(
|
|
||||||
+ platform.system() == "Windows", reason="Windows does not support chmod()"
|
|
||||||
+)
|
|
||||||
+def test_chmod_outside_unpack_tree(tmp_path_factory: TempPathFactory) -> None:
|
|
||||||
+ wheel_path = tmp_path_factory.mktemp("build") / "test-1.0-py3-none-any.whl"
|
|
||||||
+ with WheelFile(wheel_path, "w") as wf:
|
|
||||||
+ wf.writestr(
|
|
||||||
+ "test-1.0.dist-info/METADATA",
|
|
||||||
+ "Metadata-Version: 2.4\nName: test\nVersion: 1.0\n",
|
|
||||||
+ )
|
|
||||||
+ wf.writestr("../../system-file", b"malicious data")
|
|
||||||
+
|
|
||||||
+ extract_root_path = tmp_path_factory.mktemp("extract")
|
|
||||||
+ system_file = extract_root_path / "system-file"
|
|
||||||
+ extract_path = extract_root_path / "subdir"
|
|
||||||
+ system_file.write_bytes(b"important data")
|
|
||||||
+ system_file.chmod(0o755)
|
|
||||||
+ run_command("unpack", "--dest", extract_path, wheel_path)
|
|
||||||
+
|
|
||||||
+ assert system_file.read_bytes() == b"important data"
|
|
||||||
+ assert stat.S_IMODE(system_file.stat().st_mode) == 0o755
|
|
||||||
Index: wheel-0.42.0/tests/cli/util.py
|
|
||||||
===================================================================
|
|
||||||
--- /dev/null
|
|
||||||
+++ wheel-0.42.0/tests/cli/util.py
|
|
||||||
@@ -0,0 +1,43 @@
|
|
||||||
+from __future__ import annotations
|
|
||||||
+
|
|
||||||
+import sys
|
|
||||||
+from io import StringIO
|
|
||||||
+from os import PathLike
|
|
||||||
+from subprocess import CalledProcessError
|
|
||||||
+from unittest.mock import patch
|
|
||||||
+
|
|
||||||
+import pytest
|
|
||||||
+
|
|
||||||
+from wheel.cli import main
|
|
||||||
+
|
|
||||||
+
|
|
||||||
+def run_command(
|
|
||||||
+ command: str, *args: str | PathLike, catch_systemexit: bool = True
|
|
||||||
+) -> str:
|
|
||||||
+ returncode = 0
|
|
||||||
+ stdout = StringIO()
|
|
||||||
+ stderr = StringIO()
|
|
||||||
+ args = ("wheel", command) + tuple(str(arg) for arg in args)
|
|
||||||
+ with (
|
|
||||||
+ patch.object(sys, "argv", args),
|
|
||||||
+ patch.object(sys, "stdout", stdout),
|
|
||||||
+ patch.object(sys, "stderr", stderr),
|
|
||||||
+ ):
|
|
||||||
+ try:
|
|
||||||
+ main()
|
|
||||||
+ except SystemExit as exc:
|
|
||||||
+ if not catch_systemexit:
|
|
||||||
+ raise CalledProcessError(
|
|
||||||
+ exc.code, args, stdout.getvalue(), stderr.getvalue()
|
|
||||||
+ ) from exc
|
|
||||||
+
|
|
||||||
+ returncode = exc.code
|
|
||||||
+
|
|
||||||
+ if returncode:
|
|
||||||
+ pytest.fail(
|
|
||||||
+ f"'wheel {command}' exited with return code {returncode}\n"
|
|
||||||
+ f"arguments: {args}\n"
|
|
||||||
+ f"error output:\n{stderr.getvalue()}"
|
|
||||||
+ )
|
|
||||||
+
|
|
||||||
+ return stdout.getvalue()
|
|
||||||
Index: wheel-0.42.0/tests/cli/__init__.py
|
|
||||||
===================================================================
|
|
||||||
--- /dev/null
|
|
||||||
+++ wheel-0.42.0/tests/cli/__init__.py
|
|
||||||
@@ -0,0 +1 @@
|
|
||||||
+
|
|
||||||
@@ -1,7 +1,37 @@
|
|||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Wed Jan 28 09:12:46 UTC 2026 - Nico Krapp <nico.krapp@suse.com>
|
Mon Feb 9 11:01:06 UTC 2026 - Daniel Garcia <daniel.garcia@suse.com>
|
||||||
|
|
||||||
- Add CVE-2026-24049.patch to fix CVE-2026-24049 (bsc#1257100)
|
- Add pythons_for_pypi macro. This macro will help to build the python
|
||||||
|
minimal stack for different python versions.
|
||||||
|
|
||||||
|
-------------------------------------------------------------------
|
||||||
|
Tue Jan 27 10:15:40 UTC 2026 - Nico Krapp <nico.krapp@suse.com>
|
||||||
|
|
||||||
|
- Update to 0.46.3
|
||||||
|
* Fixed ImportError: cannot import name '_setuptools_logging' from 'wheel'
|
||||||
|
when installed alongside an old version of setuptools and running the
|
||||||
|
bdist_wheel command
|
||||||
|
- Update to 0.46.2 (fixes CVE-2026-24049, bsc#1257100)
|
||||||
|
* Restored the bdist_wheel command for compatibility with setuptools older
|
||||||
|
than v70.1
|
||||||
|
* Importing wheel.bdist_wheel now emits a FutureWarning instead of a
|
||||||
|
DeprecationWarning
|
||||||
|
* Fixed wheel unpack potentially altering the permissions of files outside
|
||||||
|
of the destination tree with maliciously crafted wheels (CVE-2026-24049)
|
||||||
|
- Update to 0.46.1
|
||||||
|
* Temporarily restored the wheel.macosx_libfile module
|
||||||
|
- Update to 0.46.0
|
||||||
|
* Dropped support for Python 3.8
|
||||||
|
* Removed the bdist_wheel setuptools command implementation and entry point.
|
||||||
|
The wheel.bdist_wheel module is now just an alias to
|
||||||
|
setuptools.command.bdist_wheel, emitting a deprecation warning on import.
|
||||||
|
* Removed vendored packaging in favor of a run-time dependency on it
|
||||||
|
* Made the wheel.metadata module private (with a deprecation warning if it's
|
||||||
|
imported
|
||||||
|
* Made the wheel.cli package private (no deprecation warning)
|
||||||
|
* Fixed an exception when calling the convert command with an empty
|
||||||
|
description field
|
||||||
|
- drop tests.patch, merged upstream
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Thu Mar 27 10:29:43 UTC 2025 - Markéta Machová <mmachova@suse.com>
|
Thu Mar 27 10:29:43 UTC 2025 - Markéta Machová <mmachova@suse.com>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#
|
#
|
||||||
# spec file for package python-wheel
|
# spec file for package python-wheel
|
||||||
#
|
#
|
||||||
# Copyright (c) 2025 SUSE LLC
|
# Copyright (c) 2026 SUSE LLC and contributors
|
||||||
#
|
#
|
||||||
# All modifications and additions to the file contributed by third parties
|
# All modifications and additions to the file contributed by third parties
|
||||||
# remain the property of their copyright owners, unless otherwise agreed
|
# remain the property of their copyright owners, unless otherwise agreed
|
||||||
@@ -30,21 +30,19 @@
|
|||||||
%define psuffix %{nil}
|
%define psuffix %{nil}
|
||||||
%bcond_with test
|
%bcond_with test
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
|
%{?pythons_for_pypi}
|
||||||
%{?sle15_python_module_pythons}
|
%{?sle15_python_module_pythons}
|
||||||
Name: python-wheel%{psuffix}
|
Name: python-wheel%{psuffix}
|
||||||
Version: 0.45.1
|
Version: 0.46.3
|
||||||
Release: 0
|
Release: 0
|
||||||
Summary: A built-package format for Python
|
Summary: A built-package format for Python
|
||||||
License: MIT
|
License: MIT
|
||||||
Group: Development/Languages/Python
|
Group: Development/Languages/Python
|
||||||
URL: https://github.com/pypa/wheel
|
URL: https://github.com/pypa/wheel
|
||||||
Source: https://github.com/pypa/wheel/archive/%{version}.tar.gz#/wheel-%{version}.tar.gz
|
Source: https://github.com/pypa/wheel/archive/%{version}.tar.gz#/wheel-%{version}.tar.gz
|
||||||
# PATCH-FIX-UPSTREAM https://github.com/pypa/wheel/pull/651 fix test failures
|
|
||||||
Patch0: tests.patch
|
|
||||||
# PATCH-FIX-UPSTREAM CVE-2026-24049.patch bsc#1257100 gh#pypa/wheel@7a7d2de
|
|
||||||
Patch1: CVE-2026-24049.patch
|
|
||||||
# Bootstrap: Don't BuildRequire setuptools or pip here!
|
# Bootstrap: Don't BuildRequire setuptools or pip here!
|
||||||
BuildRequires: %{python_module base >= 3.8}
|
BuildRequires: %{python_module base >= 3.9}
|
||||||
BuildRequires: %{python_module flit-core}
|
BuildRequires: %{python_module flit-core}
|
||||||
BuildRequires: fdupes
|
BuildRequires: fdupes
|
||||||
BuildRequires: python-rpm-macros >= 20210929
|
BuildRequires: python-rpm-macros >= 20210929
|
||||||
@@ -61,6 +59,7 @@ BuildRequires: %{python_module devel}
|
|||||||
BuildRequires: %{python_module pytest >= 3.0.0}
|
BuildRequires: %{python_module pytest >= 3.0.0}
|
||||||
BuildRequires: %{python_module wheel >= %{version}}
|
BuildRequires: %{python_module wheel >= %{version}}
|
||||||
%endif
|
%endif
|
||||||
|
Requires: python-packaging >= 26.0
|
||||||
%python_subpackages
|
%python_subpackages
|
||||||
|
|
||||||
%description
|
%description
|
||||||
@@ -102,7 +101,10 @@ export PYTHONPATH=build/env/lib/python%{$python_bin_suffix}/site-packages
|
|||||||
export LC_ALL=en_US.utf8
|
export LC_ALL=en_US.utf8
|
||||||
export PYTHONDONTWRITEBYTECODE=1
|
export PYTHONDONTWRITEBYTECODE=1
|
||||||
# license tests failing with setuptools 77: https://github.com/pypa/wheel/issues/658
|
# license tests failing with setuptools 77: https://github.com/pypa/wheel/issues/658
|
||||||
%pytest -k "not (test_licenses_default or test_licenses_deprecated or test_licenses_override)"
|
skip="test_licenses_default or test_licenses_deprecated or test_licenses_override"
|
||||||
|
# requires packaging >= 26.0: https://github.com/pypa/wheel/issues/677
|
||||||
|
skip+=" or test_pkginfo_to_metadata"
|
||||||
|
%pytest -vv -k "not (${skip})"
|
||||||
%endif
|
%endif
|
||||||
|
|
||||||
%if !%{with test}
|
%if !%{with test}
|
||||||
|
|||||||
125
tests.patch
125
tests.patch
@@ -1,125 +0,0 @@
|
|||||||
From 3028d38b5aec19f966660de8e24c45bb5c23f359 Mon Sep 17 00:00:00 2001
|
|
||||||
From: shenxianpeng <xianpeng.shen@gmail.com>
|
|
||||||
Date: Sun, 16 Mar 2025 01:35:32 +0800
|
|
||||||
Subject: [PATCH] Fixed test failures (#651)
|
|
||||||
|
|
||||||
---
|
|
||||||
tests/test_bdist_wheel.py | 4 ++--
|
|
||||||
tests/test_tagopt.py | 18 +++++++++---------
|
|
||||||
tests/testdata/unicode.dist/setup.py | 2 +-
|
|
||||||
3 files changed, 12 insertions(+), 12 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/tests/test_bdist_wheel.py b/tests/test_bdist_wheel.py
|
|
||||||
index fcb2dfc4..21eddd02 100644
|
|
||||||
--- a/tests/test_bdist_wheel.py
|
|
||||||
+++ b/tests/test_bdist_wheel.py
|
|
||||||
@@ -79,9 +79,9 @@ def test_no_scripts(wheel_paths):
|
|
||||||
|
|
||||||
|
|
||||||
def test_unicode_record(wheel_paths):
|
|
||||||
- path = next(path for path in wheel_paths if "unicode.dist" in path)
|
|
||||||
+ path = next(path for path in wheel_paths if "unicode_dist" in path)
|
|
||||||
with ZipFile(path) as zf:
|
|
||||||
- record = zf.read("unicode.dist-0.1.dist-info/RECORD")
|
|
||||||
+ record = zf.read("unicode_dist-0.1.dist-info/RECORD")
|
|
||||||
|
|
||||||
assert "åäö_日本語.py".encode() in record
|
|
||||||
|
|
||||||
diff --git a/tests/test_tagopt.py b/tests/test_tagopt.py
|
|
||||||
index 5335af44..5733e1a9 100644
|
|
||||||
--- a/tests/test_tagopt.py
|
|
||||||
+++ b/tests/test_tagopt.py
|
|
||||||
@@ -14,7 +14,7 @@
|
|
||||||
from setuptools import setup, Extension
|
|
||||||
|
|
||||||
setup(
|
|
||||||
- name="Test",
|
|
||||||
+ name="test",
|
|
||||||
version="1.0",
|
|
||||||
author_email="author@example.com",
|
|
||||||
py_modules=["test"],
|
|
||||||
@@ -63,7 +63,7 @@ def test_default_tag(temp_pkg):
|
|
||||||
assert dist_dir.is_dir()
|
|
||||||
wheels = list(dist_dir.iterdir())
|
|
||||||
assert len(wheels) == 1
|
|
||||||
- assert wheels[0].name == f"Test-1.0-py{sys.version_info[0]}-none-any.whl"
|
|
||||||
+ assert wheels[0].name == f"test-1.0-py{sys.version_info[0]}-none-any.whl"
|
|
||||||
assert wheels[0].suffix == ".whl"
|
|
||||||
|
|
||||||
|
|
||||||
@@ -76,7 +76,7 @@ def test_build_number(temp_pkg):
|
|
||||||
assert dist_dir.is_dir()
|
|
||||||
wheels = list(dist_dir.iterdir())
|
|
||||||
assert len(wheels) == 1
|
|
||||||
- assert wheels[0].name == f"Test-1.0-1-py{sys.version_info[0]}-none-any.whl"
|
|
||||||
+ assert wheels[0].name == f"test-1.0-1-py{sys.version_info[0]}-none-any.whl"
|
|
||||||
assert wheels[0].suffix == ".whl"
|
|
||||||
|
|
||||||
|
|
||||||
@@ -89,7 +89,7 @@ def test_explicit_tag(temp_pkg):
|
|
||||||
assert dist_dir.is_dir()
|
|
||||||
wheels = list(dist_dir.iterdir())
|
|
||||||
assert len(wheels) == 1
|
|
||||||
- assert wheels[0].name.startswith("Test-1.0-py32-")
|
|
||||||
+ assert wheels[0].name.startswith("test-1.0-py32-")
|
|
||||||
assert wheels[0].suffix == ".whl"
|
|
||||||
|
|
||||||
|
|
||||||
@@ -101,7 +101,7 @@ def test_universal_tag(temp_pkg):
|
|
||||||
assert dist_dir.is_dir()
|
|
||||||
wheels = list(dist_dir.iterdir())
|
|
||||||
assert len(wheels) == 1
|
|
||||||
- assert wheels[0].name.startswith("Test-1.0-py2.py3-")
|
|
||||||
+ assert wheels[0].name.startswith("test-1.0-py2.py3-")
|
|
||||||
assert wheels[0].suffix == ".whl"
|
|
||||||
|
|
||||||
|
|
||||||
@@ -114,7 +114,7 @@ def test_universal_beats_explicit_tag(temp_pkg):
|
|
||||||
assert dist_dir.is_dir()
|
|
||||||
wheels = list(dist_dir.iterdir())
|
|
||||||
assert len(wheels) == 1
|
|
||||||
- assert wheels[0].name.startswith("Test-1.0-py2.py3-")
|
|
||||||
+ assert wheels[0].name.startswith("test-1.0-py2.py3-")
|
|
||||||
assert wheels[0].suffix == ".whl"
|
|
||||||
|
|
||||||
|
|
||||||
@@ -129,7 +129,7 @@ def test_universal_in_setup_cfg(temp_pkg):
|
|
||||||
assert dist_dir.is_dir()
|
|
||||||
wheels = list(dist_dir.iterdir())
|
|
||||||
assert len(wheels) == 1
|
|
||||||
- assert wheels[0].name.startswith("Test-1.0-py2.py3-")
|
|
||||||
+ assert wheels[0].name.startswith("test-1.0-py2.py3-")
|
|
||||||
assert wheels[0].suffix == ".whl"
|
|
||||||
|
|
||||||
|
|
||||||
@@ -144,7 +144,7 @@ def test_pythontag_in_setup_cfg(temp_pkg):
|
|
||||||
assert dist_dir.is_dir()
|
|
||||||
wheels = list(dist_dir.iterdir())
|
|
||||||
assert len(wheels) == 1
|
|
||||||
- assert wheels[0].name.startswith("Test-1.0-py32-")
|
|
||||||
+ assert wheels[0].name.startswith("test-1.0-py32-")
|
|
||||||
assert wheels[0].suffix == ".whl"
|
|
||||||
|
|
||||||
|
|
||||||
@@ -157,7 +157,7 @@ def test_legacy_wheel_section_in_setup_cfg(temp_pkg):
|
|
||||||
assert dist_dir.is_dir()
|
|
||||||
wheels = list(dist_dir.iterdir())
|
|
||||||
assert len(wheels) == 1
|
|
||||||
- assert wheels[0].name.startswith("Test-1.0-py2.py3-")
|
|
||||||
+ assert wheels[0].name.startswith("test-1.0-py2.py3-")
|
|
||||||
assert wheels[0].suffix == ".whl"
|
|
||||||
|
|
||||||
|
|
||||||
diff --git a/tests/testdata/unicode.dist/setup.py b/tests/testdata/unicode.dist/setup.py
|
|
||||||
index ec66d1e6..46ef0a10 100644
|
|
||||||
--- a/tests/testdata/unicode.dist/setup.py
|
|
||||||
+++ b/tests/testdata/unicode.dist/setup.py
|
|
||||||
@@ -3,7 +3,7 @@
|
|
||||||
from setuptools import setup
|
|
||||||
|
|
||||||
setup(
|
|
||||||
- name="unicode.dist",
|
|
||||||
+ name="unicode_dist",
|
|
||||||
version="0.1",
|
|
||||||
description="A testing distribution \N{SNOWMAN}",
|
|
||||||
packages=["unicodedist"],
|
|
||||||
BIN
wheel-0.45.1.tar.gz
LFS
BIN
wheel-0.45.1.tar.gz
LFS
Binary file not shown.
BIN
wheel-0.46.3.tar.gz
LFS
Normal file
BIN
wheel-0.46.3.tar.gz
LFS
Normal file
Binary file not shown.
Reference in New Issue
Block a user