Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extract tar files with "data" filter in Windows build scripts #8606

Merged
merged 2 commits into from
Dec 18, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion winbuild/build_prepare.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import shutil
import struct
import subprocess
import sys
from typing import Any


Expand Down Expand Up @@ -520,7 +521,10 @@ def extract_dep(url: str, filename: str, prefs: dict[str, str]) -> None:
if sources_dir_abs != member_prefix:
msg = "Attempted Path Traversal in Tar File"
raise RuntimeError(msg)
tgz.extractall(sources_dir)
if sys.version_info <= (3, 11):
tgz.extractall(sources_dir)
else:
tgz.extractall(sources_dir, filter="data")
radarhere marked this conversation as resolved.
Show resolved Hide resolved
else:
msg = "Unknown archive type: " + filename
raise RuntimeError(msg)
Expand Down
Loading