Skip to content

Commit 4b007b4

Browse files
committed
base: allow symlinks outside of the archive
The default behavior was changed by python 3.14, so we pass the argument to revert to the previous one.
1 parent 3fe09f2 commit 4b007b4

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

xbstrap/base.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import shutil
1212
import stat
1313
import subprocess
14+
import sys
1415
import tarfile
1516
import tempfile
1617
import urllib.request
@@ -3191,7 +3192,14 @@ def pull_archive(cfg, subject):
31913192
os.mkdir(subject.prefix_dir)
31923193
with tarfile.open(subject.archive_file, "r:gz") as tar:
31933194
for info in tar:
3194-
tar.extract(info, subject.prefix_dir)
3195+
if sys.version_info >= (3, 12):
3196+
# Maybe should have a more aggressive filter, but we have
3197+
# legitimate "evil-looking" tool tars (specifically, GCC
3198+
# tarballs link to the binutils directory, which is outside
3199+
# of the root)
3200+
tar.extract(info, subject.prefix_dir, filter="fully_trusted")
3201+
else:
3202+
tar.extract(info, subject.prefix_dir)
31953203
else:
31963204
# TODO: Also support packages here.
31973205
raise GenericError("Unexpected subject for pull-archive")

0 commit comments

Comments
 (0)