Skip to content

Conversation

@qkaiser
Copy link
Contributor

@qkaiser qkaiser commented Apr 25, 2023

Fixes #563

tarfile python library does not perform any kind of defensive programming and will trigger OS level errors like ENAMETOOLONG trying to write files that have long names.

This commit adds two checks to our safe implementation of tarfile so that we log the issue with a warning and skip the file.

Note: tar files with such entries (long name, empty name) do not happen naturally and must be synthesized. That's why decided to skip them, in a similar fashion than GNU tar and 7zip.

…me).

tarfile python library does not perform any kind of defensive
programming and will trigger OS level errors like ENAMETOOLONG trying to
write files that have long names.

This commit adds two checks to our safe implementation of tarfile so
that we log the issue with a warning and skip the file.

Note: tar files with such entries (long name, empty name) do not happen
naturally and must be synthesized. That's why decided to skip them, in a
similar fashion than GNU tar and 7zip.
@qkaiser qkaiser added bug Something isn't working format:archive labels Apr 25, 2023
@qkaiser qkaiser requested a review from vlaci April 25, 2023 13:09
@qkaiser qkaiser self-assigned this Apr 25, 2023
Copy link
Contributor

@e3krisztian e3krisztian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eventually we should report these problems through report objects, not just logging.
This needs a public API change, as there is no reporting infrastructure for extractors, yet.

@vlaci vlaci merged commit 5d9fd6d into main Apr 26, 2023
@vlaci vlaci deleted the 563-tar-filename-too-long branch April 26, 2023 15:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working format:archive

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Files hiding in long filenames

4 participants