File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 1111import shutil
1212import stat
1313import subprocess
14+ import sys
1415import tarfile
1516import tempfile
1617import 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" )
You can’t perform that action at this time.
0 commit comments