Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tar filetype doesn't match for Pre-POSIX.1-1988 tar headers #109

Open
DiscordSaver opened this issue Jan 18, 2022 · 1 comment
Open

Tar filetype doesn't match for Pre-POSIX.1-1988 tar headers #109

DiscordSaver opened this issue Jan 18, 2022 · 1 comment

Comments

@DiscordSaver
Copy link

Was testing against a large collection of archive files and noticed it wouldn't flag certain tar files a tar file. After researching it turns out those files were Pre-POSIX. You can grab a sample file from https://getsamplefiles.com/sample-archive-files/tar

@uzzz
Copy link

uzzz commented Jan 24, 2022

Yeah, that's true. Pre-posix (also known as v7) tar doesn't have magic field filled in its header block. The way the tools like tar, file, etc deal with it is they calculate the block's (512 bytes) checksum and then compare it with stored value. It requires a but if code but in principle, it is not hard to add and I'm happy to send a PR if you think it worth it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants