summaryrefslogtreecommitdiff
path: root/libmat2/archive.py (follow)
AgeCommit message (Collapse)Author
2025-04-03Properly handle an exceptionjvoisin
``` Traceback (most recent call last): File "/builds/jvoisin/mat2/tests/test_deep_cleaning.py", line 147, in test_office meta = p.get_meta() File "/builds/jvoisin/mat2/libmat2/archive.py", line 155, in get_meta zin.extract(member=item, path=temp_folder) ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.13/zipfile/__init__.py", line 1762, in extract return self._extract_member(member, path, pwd) ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.13/zipfile/__init__.py", line 1829, in _extract_member os.makedirs(upperdirs, exist_ok=True) ~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^ File "<frozen os>", line 227, in makedirs OSError: [Errno 28] No space left on device: '/tmp/tmptl1ibyv6/word/theme' ``` This should never happen™, but just in case…
2023-11-13parsers: Inherit the sandbox option when creating additional parsersRomain Vigier
2023-07-11Harden get_meta in archive.py against variants of CVE-2022-35410Jason Smalls
2023-05-03Use proper type annotations instead of commentsjvoisin
2023-05-03Make use of is_dir/isdir for archivesjvoisin
2023-01-28Another typing passjvoisin
2023-01-28Fix the type annotationsjvoisin
2022-11-21Remove pyflakesjvoisin
Isn't borderline useless compared to mypy and pylint
2022-10-09Remove deprecated pylint checksjvoisin
2022-08-28Simplify the typing annotationsjvoisin
2022-07-05Prevent arbitrary file read via zip archivesjvoisin
A zip file with a file pointing to /etc/passwd would, upon being cleaned by mat2, produce a file with the filesystem's /etc/passwd file.
2022-07-05Show a scary message in case of path traversal attemptjvoisin
2022-05-05Minor cleanupjvoisin
2021-12-13Make libmat2 more robust against corrupted zip filesjvoisin
2021-12-09Please the linters wrt. the previous commitjvoisin
2021-12-08zip archives: keep individual files compression typeDenis 'GNUtoo' Carikli
While hardcoding the compression to zipfile.ZIP_DEFLATED works for most use cases of mat, being able to produce cleaned up uncompressed zip files is useful for content that cannot be compressed more. In addition it also enables to use mat2 for reproducible builds of Android bootanimation files file that don't support compression. Signed-off-by: Denis 'GNUtoo' Carikli <GNUtoo@cyberdimension.org>
2021-11-23Make the linter happierjvoisin
2020-03-08Vastly improve ppt compatibilityjvoisin
2019-11-30This is mat2, not MAT2georg
Closes #131
2019-10-12Remove a useless `\`jvoisin
2019-10-12Replace abstractstaticmethod with abstractmethodjvoisin
Apparently, abstractstaticmethod is deprecated since python3.3.
2019-09-01Mark a comment as FPjvoisin
2019-07-20Fix mypyjvoisin
2019-07-13Compress cleaned zip archives by defaultjvoisin
2019-05-01Add some verification for "dangerous" tarfilesjvoisin
2019-04-27Handle weird permissions in tar archivesjvoisin
2019-04-27Improve the display of tarfile's members mtimejvoisin
2019-04-27Add support for compressed tar filesjvoisin
2019-04-27Add tar archive supportjvoisin
2019-02-25Document the previous commitjvoisin
2019-02-24In archive-based formats, the `mimetype` file comes firstjvoisin
This should improve epub compatibility, along with other formats as a side-effect
2019-02-04Refactor a bit office get_meta handlingjvoisin
This should make easier to get more metadata from archive-based file formats.
2019-02-03Whenever possible, use bwrap for subprocessesintrigeri
This should closes #90
2018-10-25Add support for zip filesjvoisin
2018-10-25Improve archive-based parser's robustness against corrupted embedded filesjvoisin
2018-10-25Implement get_meta() for archivesjvoisin
2018-10-12Bump mypy typing coveragejvoisin
2018-10-03Improve mat2's cli reliabilityjvoisin
- Replace some class members by instance members - Don't thread the cleaning process anymore for now
2018-10-02Use [Content_Types].xml to improve MS Office coveragejvoisin
2018-09-24Second pass of minor formattingjvoisin
2018-09-24Fix some minor formatting issuesjvoisin
2018-09-18Insert archive members in lexicographic orderjvoisin
2018-09-06Make pylint happyjvoisin
2018-09-06Split office and archivesjvoisin