]> git.ipfire.org Git - thirdparty/libarchive.git/commit
RAR5 reader: add support for 'version' extra field and ignore unknown fields. 1182/head
authorGrzegorz Antoniak <ga@anadoxin.org>
Fri, 26 Apr 2019 04:54:56 +0000 (06:54 +0200)
committerGrzegorz Antoniak <ga@anadoxin.org>
Sat, 27 Apr 2019 05:41:40 +0000 (07:41 +0200)
commit4a94ef4eee112224ae19e05651caad28c7f04751
tree0d33643408f190de70b27aba4afec91cd27fdea9
parentba6bbc3aa4706b4af8b68a468cd2d0f45172042c
RAR5 reader: add support for 'version' extra field and ignore unknown fields.

This commit adds support for the VERSION extra field appended to FILE
base block. This field allows to add version support for files inside
the archive. If the file name is 'abc' and its version is 15, libarchive
will unpack this file as 'abc;15'. Changing of file names is needed
because there can be multiple files inside the archive with the same
names and different versions. In order for the user to not be confused
which file is which, RAR5 reader changes the name.

Also this commit contains a unit test for VERSION extra field support.

Another change this commit introduces is ignoring of unknown extra
fields. Before applying the commit, RAR5 reader was failing to unpack
the file if an unknown field was encountered. But since the reader knows
the unknown field's size, it can skip it and ignore it, then proceed
with parsing the structure. After applying this commit, RAR5 reader will
skip and ignore unknown fields.

Unknown fields that are skipped include fields in FILE's extra header,
as well as unsupported REDIR types.
libarchive/archive_read_support_format_rar5.c
libarchive/test/test_read_format_rar5.c
libarchive/test/test_read_format_rar5_extra_field_version.rar.uu [new file with mode: 0644]