Tim Kientzle [Mon, 9 Apr 2012 05:06:43 +0000 (22:06 -0700)]
Resuscitate the old NFS4 support code and make it work on FreeBSD-CURRENT.
This includes a new test that archive_write_disk and archive_read_disk
consistently read/write ACL information to/from disk.
This new test currently passes on FreeBSD-CURRENT.
Avoid a warning that Clang Static Analyzer complained
"Access to field 'unconsumed' results in a dereference of a null
pointer (loaded from field 'entry_cfdata."
Dan McGee [Tue, 27 Mar 2012 22:22:40 +0000 (17:22 -0500)]
Fixes for GCC 4.7.0
Fixes the following compile error exposed with GCC 4.7.0:
libarchive/archive_string.c: In function 'cesu8_to_unicode':
libarchive/archive_string.c:2450:11: error: 'wc' may be used uninitialized in this function [-Werror=uninitialized]
cc1: all warnings being treated as errors
As well as a test failure that depends on signed integer wraparound,
which is a very bad thing to do in C [1]. Mark the intermediate result
as volatile to prevent the compiler optimizing away the arithmetic and
the logical test.
Dan McGee [Tue, 27 Mar 2012 22:06:32 +0000 (17:06 -0500)]
Fix segfault in iso9660 reader
Some odd ISO images do some funny things with RockRidge and Joliet data.
In this particular case, Joliet is used on the CD image, but the first
directory record has no RockRidge data. However, subsequent directory
entries (in the Joliet volume descriptor!) have RockRidge data attached,
although what is noticeably missing are type "NM" or name entries.
This causes seenRockridge to get flipped on, which makes the bad
assumption that seenJoliet is false. This means that when we reach the
code searching for the "rr_moved" special file, we strcmp() against NULL
because our filename is really in file->utf16be_bytes.
This is by far the easiest fix (and likely most correct fix) to this
madness; I have no idea whether a UTF-16 encoded "rr_moved" file can
even exist with whatever mastering software was used on this ISO.
Also note that if you explicitly disable Joliet processing, you get a
very different file listing on this ISO; apparently this is a cleaver
way to hide files from prying eyes in the Windows world:
Merge from master branch.
- Use memcpy when copying an uncompressed block for CAB reader performance.
- Improve the listing performance of CAB reader; Do not decode compressed
data until archive_read_data* is invoked.
Issue 250:problem extracting from CAB file.
- Do not clear ds->rbytes_avail when coming back to ST_RD_R0, ST_RD_R1
and ST_RD_R2 statuses with a full of compressed data.
- Correctly skip 16 bits when there is no current bits stream data.
Issue 250:problem extracting from CAB file.
- Do not clear ds->rbytes_avail when coming back to ST_RD_R0, ST_RD_R1
and ST_RD_R2 statuses with a full of compressed data.
- Correctly skip 16 bits when there is no current bits stream data.
Fix the bug which the patch for issue 249 made, which bug is that
sometimes sumcheck error hppens when listing a CAB file whose
compression type is none.
- Do not consume extra bytes when the compression type is none.
- Improve test_read_format_cab to just read file names, not read
file contents such as "bsdtar tf".
Fix the bug which the patch for issue 249 made, which bug is that
sometimes sumcheck error hppens when listing a CAB file whose
compression type is none.
Do not consume extra bytes when the compression type is none.
Brad King [Wed, 11 Jan 2012 13:15:09 +0000 (08:15 -0500)]
Declare mbstate_t and wcrtomb for Borland
The Borland C++ 5.81 runtime library provides wcrtomb but only the C++
header <cwchar> actually declares the API. Since this is C code we
cannot use the header, so declare it ourselves.
Brad King [Wed, 11 Jan 2012 13:15:03 +0000 (08:15 -0500)]
Implement custom lseek for Borland
Restore Windows 64-bit lseek removed by upstream svn revision 3826
(Cast away __la_lseek(), use _lseeki64() instead, 2011-11-21). We
need it on Borland.
Rename some internal functions as other related functions.
archive_strcpy_in_locale ==> archive_strcpy_l
archive_strncpy_in_locale ==> archive_strncpy_l
archive_strncat_in_locale ==> archive_strncat_l
Impelment Unicode normalization Form D in libarchive itself in order not to rely on CoreServices framework on Mac OS.
It passes all NormalizationTest.txt released The Unicode Consortium(http://www.unicode.org).
Fix issue 238.
Skip the setup sparse on linux without a check of errno if
ioctl(,FS_IOC_FIEMAP,) failed because the errno is not fixed
, for example, some file system returns ENOTTY, another returns
EOPNOTSUPP, or EINVAL and so on. We cannot decide what errno
exactly indicates an unsupported error.
Simplify a check whether the current filesystem libarchive_test is running
supports FIEMAP on linux; do not check an errno ioctl() returns to use the
same logic to a check of sparse support as libarchive does.
Simplify a check whether the current filesystem libarchive_test is running
supports FIEMAP on linux; do not check an errno ioctl() returns to use the
same logic to a check of sparse support as libarchive does.
Brad King [Wed, 11 Jan 2012 13:15:53 +0000 (08:15 -0500)]
Define _XOPEN_SOURCE=500 on HP-UX
The HP-UX <wchar.h> header provides 'mbstate_t' in C89/C90 mode only if
_XOPEN_SOURCE is defined to exactly 500. Type 'mbstate_t' was
introduced in C89/C90 Normative Amendment 1, aka C94/C95, adding support
international character sets. It is part of C99 but not C89/C90.
Brad King [Wed, 11 Jan 2012 13:15:42 +0000 (08:15 -0500)]
Check for 'struct statvfs' member 'f_iosize'
Configure the result as definition HAVE_STRUCT_STATVFS_F_IOSIZE and use
the member only if it exists. At least one platform (IRIX) provides
struct statvfs without this member.
Brad King [Wed, 11 Jan 2012 13:15:25 +0000 (08:15 -0500)]
Fix Windows NT API usage in VS 6
VS 6 warns verbosely when WINVER >= 0x0500. Avoid defining WINVER and
_WIN32_WINNT to higher than 0x0400 on VS 6. Provide missing API
declarations in archive_windows.h when we do not get them from
<windows.h>. Provide GetVolumePathNameW because VS 6 does not declare
it regardless of the API version.
Do not overwrite CMAKE_BUILD_TYPE if it has already been set.
Record CMAKE_BUILD_TYPE in CACHE so that you can edit CMAKE_BUILD_TYPE
easily through GUI.
Do not overwrite CMAKE_BUILD_TYPE if it has already been set.
Record CMAKE_BUILD_TYPE in CACHE so that you can edit CMAKE_BUILD_TYPE
easily through GUI.
Find out what macro is needed or acceptable to use a external library
such as zlib on CMake build system On Windows. Because if the library
is static library, a macro must be defined to use it on Windows.