Tim Kientzle [Sun, 1 Nov 2009 21:46:24 +0000 (16:46 -0500)]
Extend the fuzz tester:
* Compress test_fuzz_1.iso so we can save space in source control and so we can fuzz a compressed file.
* Extract the "ar" sample file so we can use it in the fuzz tester.
The file queue which has "CL" extension(called cl_files) must use its
cl_offset(which indicates a offset of the relocated directory entry)
for heap key. The function relocate_dir()'s algorithm expects cl_files
in order of cl_offset.
Tim Kientzle [Sun, 1 Nov 2009 06:56:20 +0000 (01:56 -0500)]
Make the __FBSDID() handling more platform-agnostic by using
HAVE_SYS_CDEFS_H to control the inclusion of sys/cdefs.h and
defining a fake __FBSDID() macro if we need one. In particular,
this deals a lot more gracefully with systems that are not
FreeBSD but use FreeBSD-derived system headers.
See Issue 46 on libarchive.googlecode.com for discussion.
Submitted by: cpr420
Tim Kientzle [Sun, 1 Nov 2009 02:14:14 +0000 (22:14 -0400)]
Trying to figure out what printf modifiers to use on what platforms to
display 64-bit values is getting to be real PITA. Just roll our
own conversion and use that.
Improve handling of Rockridge extensions' rr_moved directory and
following sub directories.
Add corresponding test.
Unfortunately, some tests need tweaks due to difference of ordering of
hardlink files(which have the same offset); it's characteristic of heap.
Split a part of reading subdirectories from
archive_read_format_iso9660_read_header function.
This is preparation of support RRIP "CL" and "RE" extensions
for proper handling of "rr_moved" directory.
Fix a bug; reading extensions recorded by SUSP CE extension
did not work and sometimes stole file contents.
Add test for this case.
libarchive 2.7.* have had these following bugs.
1. When length of symlink name is longer than about 70,
it cannot get modify/access times recorded by "TF" extension
and maybe next file is stolen a part of its contents by
that process.
2. When length of file name is longer than about 80,
it cannot get modify/access times recorded by "TF" extension
and maybe it's stolen a part of its contents by that process.
3. When length of file name is longer than about 100,
it cannot get file mode, user id and group id recorded by "PX"
extension and as above.
4. When length of file name is longer than about 142,
it gets wrong file name(shorter name) and as above.
Condition of stealing file contents:
if file->offset - iso9660->current_position < file->ce_size
in next_entry_seek function, that process consumed file contents
of which were data of extensions.
That process read wrong data whether that process consumed file
contents or not.
RRIP "RR" extension is obsolete; it appeared only early version of
RRIP standard. Do not use it for seenRockridge flag. Use other
RRIP extensions instead.
The 5th parameter of RRIP "PX" extension is not inode.
RRIP Standrd says that parameter, FILE SERIAL NUMBER, shall have the same
meaning as and may be used for the st_ino field of POSIX:5.6.1.
It can treat as inode but not value of inode of directories or files.
According to SUSP Stnadrd, SUSP "SP" extension must be recorded
in the root directory entry, so it has to be checked only once
and then disable all SUSP processing if not found.
Split a test mixed Joliet and Rock Ridge from test_read_format_isojoliet_bz2.c
and fix script that describes how to make test data for that test.
Remove test_read_format_isojolietrr_bz2.iso.bz2.uu which was wrong data;
access time of hardlinke file wasn't changed by touch command.
Add new test data test_read_format_isojoliet_rr.iso.bz2.uu instead.
Improve mixed Joliet and Rock Ridge extentions.
We can get uid,gid and other attributes which is recorded by Rock Ridge
extentions whether Joliet extentions recorded or not.
Fix reading the root directory; it did not read Rock Ridge extentions
of the one.
Allow longer Joliet names which is up to 103 UCS2 characters(206 bytes)
from 64 UCS2 characters(103 bytes). mkisofs can record that longer
Joliet names by their option -joliet-long.
Tim Kientzle [Thu, 1 Oct 2009 03:49:04 +0000 (23:49 -0400)]
Fix remaing bsdtar tests on Cygwin by treating Cygwin like Posix.
This does not (yet) implement the policies regarding path separators
that were recently hashed out on the libarchive-discuss mailing list.
Old mkisofs made wrong "SL" System User Entries of RRIP for
symbolic files.
New test iso image is made by latest mkisofs that bug is fixed.
Keep previous test data and Its test code because we need
to check that libarchive can handle that wrong iso images.
Tim Kientzle [Sat, 26 Sep 2009 18:02:14 +0000 (14:02 -0400)]
Rework how filenames get generated so I can spend less time
counting characters to try to make sense of failures.
Putting the sample filenames in a generated array removes a lot
of confusing code from the validation logic.
Tim Kientzle [Thu, 24 Sep 2009 15:16:11 +0000 (11:16 -0400)]
New Windows-only support to populate an archive entry from
a BY_HANDLE_FILE_INFORMATION structure (which is really
the Windows version of "struct stat").
Tim Kientzle [Thu, 24 Sep 2009 15:11:32 +0000 (11:11 -0400)]
Fix tar archiving of hardlinks on Windows: tree.c uses
Windows stat() call which doesn't actually provide
link count or inode values. Passing this data down into
libarchive (to avoid redundant stat() calls) meant that
hardlink detection simply failed on Windows. Until
I can work up something better, this simply avoids passing
stat() data from tree down into libarchive on Windows.
This allows libarchive to do the GetFileInfoByHandle
which provides useful information.