archive: Add support for RAR 5.0 format
authorJohan Gunnarsson <johan.gunnarsson@gmail.com>
Sat, 2 Nov 2019 23:23:00 +0000 (00:23 +0100)
committerSebastian Ramacher <sramacher@debian.org>
Tue, 21 Jan 2025 18:02:47 +0000 (19:02 +0100)
libarchive 3.4.0 adds support for RAR 5.0. See
https://www.rarlab.com/technote.htm#rarsign for description of signatures.

Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
(cherry picked from commit 059f6f5690005853f3e3160f5f896301b2f52ecd)

Gbp-Pq: Name 0061-archive-Add-support-for-RAR-5.0-format.patch

modules/stream_extractor/archive.c

index af69a29094c5c07eb42945959d4fd36669954937..75bbe01879448bfe27b4d2a37addd4e357405b86 100644 (file)
@@ -454,7 +454,10 @@ static int probe( stream_t* source )
     } const magicbytes[] = {
         /* keep heaviest at top */
         { 257, 5, "ustar" },              //TAR
-        { 0,   7, "Rar!\x1A\x07" },       //RAR
+#if ARCHIVE_VERSION_NUMBER >= 3004000
+        { 0,   8, "Rar!\x1A\x07\x01" },   //RAR5.0
+#endif
+        { 0,   7, "Rar!\x1A\x07" },       //RAR4.x
         { 0,   6, "7z\xBC\xAF\x27\x1C" }, //7z
         { 0,   4, "xar!" },               //XAR
         { 0,   4, "PK\x03\x04" },         //ZIP