Tim Kientzle [Sat, 12 Feb 2011 19:23:29 +0000 (14:23 -0500)]
Restore basic documentation for archive_read_finish
and archive_write_finish so that developers who need
to support libarchive 2.x won't be too confused
by the name change.
Simply set -1 to a file offset not to appear before any directories;
some version of xorriso set its parent directory offset to the offset
of empty files.
Add a test for reading the iso images made by that xorriso.
Tim Kientzle [Sun, 6 Feb 2011 05:45:30 +0000 (00:45 -0500)]
Followup on Issue 134:
1) Port test_open_failure to libarchive 2.8 branch to test
the problem reported in Issue 134.
This test also shows that archive_read_open() sometimes
fails to report open errors correctly.
2) Fix the bug in archive_read.c
3) Comment out the tests that close functions are invoked
promptly when open fails; that's fully fixed in libarchive 3.0,
but I don't think it's worth fixing here.
Properly restore birthtime on Windows; use W32API directly in
archive_write_disk.c and remove __la_futimes()/__la_utimes()
functions and related definitions, which were used in
archive_write_disk.c only.
Improve checking of statfs in LSB.
Use HAVE_SYS_STATFS_H to use statfs on linux instead of HAVE_SYS_VFS_H
and add checking of HAVE_SYS_STATVFS_H to use statvfs.
Tim Kientzle [Mon, 24 Jan 2011 04:57:05 +0000 (23:57 -0500)]
When fetching the file contents from disk, obey local system
limitations. (This should probably be rewritten to use
archive_read_disk_entry_from_file().)
Tim Kientzle [Mon, 24 Jan 2011 04:55:26 +0000 (23:55 -0500)]
Start using int64_t for uid/gid variables and int for mode variables.
The case to consider here is when a system with narrow types is
used to modify an archive that was created and will later be extracted
on a system with wide types. If we're not actually dealing with
the local filesystem, we should not be constrained by its limitations.
If the offset of a file entry is zero, set -1 to the offset, which is
calculated from its location, to make sure the entry will appear after
directory entries.
Some ISO image writer(xorriso) set zero to the location of a symlink entry.
It causes that our ISO-reader cannot read following directory entries at all
since we expect directory entries is located before file entries and we
are sorting all entry in an ISO image by the offset to read the contents
of the entries in stream.
Tim Kientzle [Sun, 23 Jan 2011 06:14:21 +0000 (01:14 -0500)]
Ensure that int64_t, int32_t, int16_t, intmax_t, uint64_t, uint32_t,
uint16_t, and uintmax_t are all defined by probing the available
integer types and their sizes during the configure, then using that
information to typedef the required types at compile time.
On Windows, set 'Creation time' to both birthtime and ctime, because
CRT stat() Microsoft provides set 'Creation time' to st_ctime.
It seems we should do that not to confuse applications about ctime.
Tim Kientzle [Sat, 22 Jan 2011 23:05:58 +0000 (18:05 -0500)]
Eliminate a bunch of off_t uses.
Most of these are from the libarchive 2 API that's no longer supported.
A few are places where int64_t offsets need to be mapped down to system
APIs that might only be 32 bits; those are a little trickier.
Do not set a default value to struct fileystem.xfer_align and related
variables when we could not get a filesystem alignment because of a lack
of statfs/statvfs family of functions to know what we can trust the alignment.
Reduce performing fchdir().
For example, when the disk read object was opened with
archive_read_disk_open("file.txt")(not a directory),
performing fchdir() is really unneeded.
Avoid the difference between posix and Windows about behavior of
directory traversals; posix version changes working directory
everywhere while traversing a directory tree, but Windows version
does not at all. The difference will probably make user confused.
Change posix version behavior close to Windows version by restoring
working directory when the function returns. This change includes
the intention removing chdir() operation by using openat()-style
operations if the platform supports it.
Set PATH_MAX to the size the 2nd argument of getcwd function instead of zero.
If the size is zero, Solaris getcwd will return NULL because
the size will be used for malloc argument as allocating memory
size.
Update a test for directory traversals;
1. add a test for archive_read_disk_set_symlink_hybrid(),
2. add a test for archive_read_disk_set_symlink_logical().
Tim Kientzle [Sat, 8 Jan 2011 22:15:08 +0000 (17:15 -0500)]
As discussed in Issue 125, we're misusing CHECK_SYMBOL_EXISTS to
test the usability of various functions. CHECK_SYMBOL_EXISTS
doesn't attempt to link anything, so can't verify that the symbol
is actually present in libraries.
In particular, this causes problems in some cross-compile
environments (such as the LSB build environment), where the
system headers may define some symbols (such as major()) that
can't be linked against the cross libraries.
Change a compression type of test_compat_mac_gnutar.tgz.uu from gzip
to compress so that test_compat_mac_gnutar does not fail on Windows platform,
which does not have libz by default.