HomeSoftware Heritage

Uncompress `safe` archive

This commit no longer exists in the repository. It may have been part of a branch which was deleted.

Description

Uncompress safe archive

Check that, for one archive, no files are uncompressed outside of the
destination folder. If ok, the archive is considered safe.

If there are at least one, a ValueError is raised, thus stopping the
archive loading.

This follows reading the warning footnote in the tarfile.extractall api
https://docs.python.org/3.4/library/tarfile.html#tarfile.TarFile.extractall.

Note that the warning also exists for zipfile.extractall
(https://docs.python.org/3.4/library/zipfile.html#zipfile.ZipFile.extractall)
but is invalidated by the zipfile.extract api doc
(https://docs.python.org/3.4/library/zipfile.html#zipfile.ZipFile.extract)
and its implementation (extractall uses extract).

Details

Provenance
ardumontAuthored on
ardumontPushed on Nov 2 2015, 4:16 PM

Commit No Longer Exists

This commit no longer exists in the repository.