Skip to content

Commit

Permalink
revert tar security fix, since tarfile.data_filter is busted in man…
Browse files Browse the repository at this point in the history
…y python versions

- see: python/cpython#107845
  • Loading branch information
telamonian committed Aug 30, 2024
1 parent 7cbf6ba commit 9a2e052
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions comfy_cli/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,9 @@ def _filter(tinfo: tarfile.TarInfo, _path: PathLike):
barProg.advance(barTask, _size)
_size = tinfo.size

return tarfile.data_filter(tinfo, _path)
# TODO: ideally we'd use data_filter here, but it's busted: https://github.com/python/cpython/issues/107845
# return tarfile.data_filter(tinfo, _path)
return tinfo
else:
_filter = None

Expand Down Expand Up @@ -215,13 +217,13 @@ def create_tarball(

_size = 0

def _filter(tinfo: tarfile.TarInfo, _path: PathLike):
def _filter(tinfo: tarfile.TarInfo):
nonlocal _size
pathProg.update(pathTask, description=tinfo.path)
barProg.advance(barTask, _size)
_size = Path(tinfo.path).stat().st_size

return tarfile.data_filter(tinfo, _path)
return tinfo
else:
_filter = None

Expand Down

0 comments on commit 9a2e052

Please sign in to comment.