Skip to content

Commit

Permalink
Extract tar files with "data" filter in Windows build scripts (#8606)
Browse files Browse the repository at this point in the history
Co-authored-by: Andrew Murray <radarhere@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
  • Loading branch information
3 people authored Dec 18, 2024
1 parent feeacf4 commit de8335b
Showing 1 changed file with 5 additions and 1 deletion.
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 @@ -507,7 +508,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, 12):
tgz.extractall(sources_dir, filter="data")
else:
tgz.extractall(sources_dir)
else:
msg = "Unknown archive type: " + filename
raise RuntimeError(msg)
Expand Down

0 comments on commit de8335b

Please sign in to comment.