Tim Kientzle [Fri, 11 Sep 2009 05:28:37 +0000 (01:28 -0400)]
Real hardlink detection on Windows (yes, Windows stat() really does seem to be that broken!). Also, expose the core hardlink test as a non-assertion so we can assert it false.
In particular, this fixes test_option_l on Windows.
Tim Kientzle [Fri, 11 Sep 2009 02:24:42 +0000 (22:24 -0400)]
Check whether platform permits filenames with control characters
before we try to actually test with one. In particular, this should
fix this test on Windows. (On platforms that permit control
characters in filenames, this test verifies that the -null option
really does treat LF characters as part of a filename instead of as a
line terminator.)
Even on platforms that don't support control characters, we can
test most of the line-parsing capabilities.
Charles Wilson [Thu, 10 Sep 2009 18:17:34 +0000 (14:17 -0400)]
Fix compiler warnings on MinGW with gcc-4.4.0
* tar/test/main.c (assertion_file_time): Silence 'var may
be used uninitialized' warning.
* cpio/test/main.c (assertion_file_time): Silence 'var may
be used uninitialized' warning.
* libarchive/test/main.c: Don't re-#define chdir.
(assertion_file_time): Silence 'var may be used uninitialized' warning.
Tim Kientzle [Thu, 10 Sep 2009 04:36:02 +0000 (00:36 -0400)]
Propagate the recent overhaul of libarchive/test/main.c to the tar and
cpio test suites, update run_all_tests to take advantage of the new
default test output.
Tim Kientzle [Tue, 8 Sep 2009 03:47:47 +0000 (23:47 -0400)]
Reading zip archives failed if you only gave
archive_read_support_format_zip() because of a bug in how the
read-ahead logic handled read(0) requests. Change the compat_zip test
to exercise this case and fix the underlying bug.
Tim Kientzle [Sun, 6 Sep 2009 06:44:40 +0000 (02:44 -0400)]
Add new assertions to verify atime, birthtime, and mtime, both
for exact values and "recent". Sketch in support for FreeBSD
(including high-res), Windows (including high-res and birthtime),
and generic POSIX.
Inspired in part by the discovery that stat() on Windows shifts mtime
values depending on DST settings, so the old code that used stat()
breaks in weird ways on Windows. GetFileTime() seems to not have this
problem, but using that requires that we not use stat().
Tim Kientzle [Sat, 5 Sep 2009 02:41:09 +0000 (22:41 -0400)]
Probe for CreateHardLinkW and use it only if it's found.
(Needed for MinGW, which doesn't have new enough Windows
headers to compile calls to CreateHardLinkW.)
Tim Kientzle [Thu, 3 Sep 2009 04:37:38 +0000 (00:37 -0400)]
Rename all externally visible shim functions to start with __la_ so
they don't conflict with "stat", etc, simulations that might be used
by various applications.
Tim Kientzle [Tue, 1 Sep 2009 01:34:07 +0000 (21:34 -0400)]
CreateHardLinkA is supported on Win2k and later, which is good
enough for now. (Plus, I was having inexplicable problems getting
the dynamic probe to work for this function.)
Tim Kientzle [Mon, 31 Aug 2009 04:43:36 +0000 (00:43 -0400)]
If the starting path isn't a pattern, then we don't feed it to FindFirstFile(), so we can't rely on FIND_FILE_DATA to determine whether it's a dir or not. So, add support for GetFileInformationByHandle(). This needs to be extended so that we use this info to fill the archive_entry instead of Windows' anemic stat() data.
Tim Kientzle [Mon, 31 Aug 2009 03:45:49 +0000 (23:45 -0400)]
We should only use FindFirstFile for the path provided on the command line if it actually has wildcard characters in it. Otherwise, we can use the same code used on Posix.
Tim Kientzle [Sat, 29 Aug 2009 04:33:18 +0000 (00:33 -0400)]
Minor updates to minitar: Support compress on write, add full
user/group lookups by default and an option to suppress them. With
all of the suppression macros, this compiles to about the same size as
does examples/untar.c.
Tim Kientzle [Sat, 29 Aug 2009 03:42:55 +0000 (23:42 -0400)]
Fix a handful of bugs in untar.c and significantly extend the opening
commentary, which hasn't really been updated since 2006 or so. In
particular, I went back and rechecked the sizes on modern FreeBSD and
found that things have bloated quite a bit: statically compiled,
untar.c is now about 25% larger than hello.c, where it used to be
almost 25% smaller.
Tim Kientzle [Sun, 23 Aug 2009 03:18:13 +0000 (23:18 -0400)]
Rewrite a lot of the test assertion framework.
Mostly, this was done just to simplify the code, but it also brings
the file/line reporting into one place where it can be adjusted to
suit different environments (e.g., Visual Studio expects "file.c(89):
message" instead of "file.c:89: message").
Tim Kientzle [Sun, 16 Aug 2009 00:21:30 +0000 (20:21 -0400)]
Issue 36: Fix acl probing on Linux.
I used the additional library checks directly from the patch provided.
Probing the functions properly proved a bit more challenging because
the indicated headers aren't the same on all systems. Instead, I
generalized the existing header tests to build up a list ${INCLUDE}
of all headers present on the local system and used that.
Tim Kientzle [Tue, 11 Aug 2009 15:55:52 +0000 (11:55 -0400)]
Probe acl_get_link and acl_get_link_np so that ACLs are properly
read from symlinks. Without this, link-related tests fail for cpio
on FreeBSD. (Same as r1357, but for autoconf-generated builds.)
Tim Kientzle [Tue, 11 Aug 2009 15:14:32 +0000 (11:14 -0400)]
Fix cpio symlink tests on FreeBSD; the link-sensitive ACL routines
weren't being properly configured, which was causing the regular
Posix mode bits to get overwritten.
Tim Kientzle [Fri, 7 Aug 2009 04:01:06 +0000 (00:01 -0400)]
Test whether printf() supports %jd, %ju, %lld, or %llu.
This needs to be implemented in the autoconf machinery
and tar and cpio need to be taught to use it when printing
very large numbers.
Tim Kientzle [Thu, 6 Aug 2009 05:29:00 +0000 (01:29 -0400)]
Fix bsdcpio build on VS9. There's still a minor build issue on MinGW that I need to track down. I think some of the cpio_windows.c shims aren't needed and can be removed.