RAR archive mistaken as Tar archive #64

Closed
opened 2026-01-29 22:06:04 +00:00 by claunia · 2 comments
Owner

Originally created by @elgonzo on GitHub (Sep 7, 2015).

SharpCompress will not open and read the following RAR file correctly:

RAR file download link:http://wikisend.com/download/295490/RAR_identified_as_Tar.rar
Password: adamhathcock
(The download link expires after 90 days!)

The RAR archive is NOT in RAR5 format, and it contains only one file "PROTONIX.D64".

ArchiveFactory.Open(...) will return a SharpCompress.Archive.Tar.TarArchive instance for this RAR file.
And ReaderFactory.Open(...) will return a SharpCompress.Reader.Tar.TarReader.

SharpCompress version used: 0.11.1

Originally created by @elgonzo on GitHub (Sep 7, 2015). SharpCompress will not open and read the following RAR file correctly: RAR file download link:http://wikisend.com/download/295490/RAR_identified_as_Tar.rar Password: adamhathcock (**The download link expires after 90 days!**) The RAR archive is **NOT** in RAR5 format, and it contains only one file "PROTONIX.D64". _ArchiveFactory.Open(...)_ will return a _SharpCompress.Archive.Tar.TarArchive_ instance for this RAR file. And _ReaderFactory.Open(...)_ will return a _SharpCompress.Reader.Tar.TarReader_. SharpCompress version used: 0.11.1
Author
Owner

@elgonzo commented on GitHub (Sep 7, 2015):

I guess the file format check should be changed so that Tar is tested after other archive format tests such as RAR, 7z, GZip, etc...

In ArchiveFactory: https://github.com/adamhathcock/sharpcompress/blob/master/SharpCompress/Archive/ArchiveFactory.cs#L129
In ReaderFactory: https://github.com/adamhathcock/sharpcompress/blob/master/SharpCompress/Reader/ReaderFactory.cs#L65

@elgonzo commented on GitHub (Sep 7, 2015): I guess the file format check should be changed so that Tar is tested **after** other archive format tests such as RAR, 7z, GZip, etc... In ArchiveFactory: https://github.com/adamhathcock/sharpcompress/blob/master/SharpCompress/Archive/ArchiveFactory.cs#L129 In ReaderFactory: https://github.com/adamhathcock/sharpcompress/blob/master/SharpCompress/Reader/ReaderFactory.cs#L65
Author
Owner

@adamhathcock commented on GitHub (Jan 9, 2016):

Did your suggestion: 21087323af

@adamhathcock commented on GitHub (Jan 9, 2016): Did your suggestion: https://github.com/adamhathcock/sharpcompress/commit/21087323af2caa5cfb394eee30ecd919b68421c6
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/sharpcompress#64