Tim Kientzle [Wed, 24 Sep 2008 21:43:07 +0000 (17:43 -0400)]
On FreeBSD, we know how to write birthtime to disk.
Add a new test to exercise different time specifications and
make sure that omitted timestamps, high-res timestamps are
all handled correctly.
Tim Kientzle [Thu, 11 Sep 2008 22:46:08 +0000 (18:46 -0400)]
Style fixes: Use Unix-style line endings for consistency with
rest of source (fortunately, most Windows code editors are
agnostic about line endings). Remove trailing spaces, tab
after #define, remove a couple of definitions that are
not actually used in the source.
Tim Kientzle [Tue, 29 Jul 2008 20:48:57 +0000 (16:48 -0400)]
Modify test_basic to verify that cpio is ignoring umask
when copying files. In particular, this verifies the
recent fix to cpio.c to set ARCHIVE_EXTRACT_PERM.
Tim Kientzle [Tue, 29 Jul 2008 20:27:19 +0000 (16:27 -0400)]
Preserve all permissions by default.
In particular, this fixes the curiosity that cpio -dumpl would
apply umask to the new dirs (which got created) but not
to the new files (which are just links to the existing files).
Thanks to Kris Kennaway for reminding me about this one.
Tim Kientzle [Sat, 26 Jul 2008 21:20:32 +0000 (17:20 -0400)]
If the size is unknown, don't limit data writes.
This seems to straighten out some of the disk-write semantics
and should solve a problem with Zip extraction when the
size of the file is not known in advance.
Tim Kientzle [Sat, 26 Jul 2008 21:17:48 +0000 (17:17 -0400)]
Provide a hook for unsetting the size field.
Use it in the link resolver for correctly marking hard links
where the size of the linked-to file is actually unknown.
Tim Kientzle [Sat, 26 Jul 2008 10:32:39 +0000 (06:32 -0400)]
Add a bitmap in the entry to track which values have been
set. Change the ad hoc symlink and hardlink tracking to use
the new bitmap, add tracking for atime and size fields.
This is motivated by some errors restoring Zip entries where
the file size is not known and by errors restoring file
times (utimes(2) sets both atime and mtime, old tar archives
only store mtime).
PR: bin/124915
- don't push data line wise to the compressor, accumulate it
in local buffer
- reduce required error checking as fewer writes to the
compressor need attention
- explicitly initialise the work string, don't depend on memset
for that
- optimise inner loop of sed backend to take ~25% less time
- simplify and optimise uuencoding to always work on full lines,
padding them explicitly with NUL (harmless changes in output).
Overall uuencoding requires more than 50% less time.
Tim Kientzle [Fri, 27 Jun 2008 00:08:58 +0000 (20:08 -0400)]
On systems that use SysV-style SGID handling for directories,
the SGID bit can be set intrinsically by the system.
When handling EXTRACT_PERM (tar -p) on such systems, we need
to do an additional chmod() on directories, even if the
dir creation used the correct full mode.
Tim Kientzle [Thu, 26 Jun 2008 08:51:21 +0000 (04:51 -0400)]
When hardlinking files for -l by using archive_write_header(),
ensure that we're just doing a bare hardlink without any accompanying
data. (Remember that cpio allows hardlinks to have data.)
Otherwise, -l creates a link and then opens the linked files
for overwrite, resulting in the files being erased.
Tim Kientzle [Wed, 18 Jun 2008 21:15:25 +0000 (17:15 -0400)]
Use times at least a full 24 hours after the Epoch for testing.
In particular, this should fix tests on systems that lack timegm(),
whose mktime() cannot handle times prior to the Epoch, when run
in timezones with negative offsets from GMT.
Extend mtree quoting support to the full c-style quoting from
the strvis(3) man page and to allow line continuation.
As with the other changes, this aims to be correct first, so it
can certainly be optimised.
Tim Kientzle [Sun, 15 Jun 2008 19:49:20 +0000 (15:49 -0400)]
Separate out the BZip2-compressed ISO image into a separate
file, to make it easier to update the image. While I'm here,
fix the instructions in the C source for this test about how
to regenerate the reference file from scratch.
Tim Kientzle [Sun, 15 Jun 2008 03:20:28 +0000 (23:20 -0400)]
Back out change 143007; go back to using platform getopt_long
if it exists.
(I intend to re-add this getopt_long implementation at a later
date, but I'm trying to stabilize the libarchive 2.5 release
and this is a bit disruptive.)
Tim Kientzle [Sat, 14 Jun 2008 21:27:26 +0000 (17:27 -0400)]
Fix the link resolver to never match dirs as hardlinks.
In particular, this seems to fix some recent port build failures
(the use of tar in these ports is rather bizarre, but it did work
with tar's old link-matching code).
Thanks to: Kris Kennaway
Tim Kientzle [Sat, 14 Jun 2008 15:11:37 +0000 (11:11 -0400)]
On some platforms, the GID bit is inherited by subdirectories.
This caused a lot of false failures in the libarchive test
harness. Be a little more careful: the GID bit on created
directories should only be checked if ARCHIVE_EXTRACT_PERM
was used when the dir was created.
Submitted by: Carey Evans
Tim Kientzle [Sat, 14 Jun 2008 14:45:42 +0000 (10:45 -0400)]
Flush stdout after printing the name of the test;
this ensures that any errors from that test appear after the
name of the test. <sigh>
Submitted by: Carey Evans
Tim Kientzle [Sat, 14 Jun 2008 14:36:30 +0000 (10:36 -0400)]
Use wctomb(), which is present in C90, instead of wcrtomb(),
which wasn't introduced until C99. In particular, this allows
the new locale support to work on FreeBSD 4, which doesn't
implement C99 wide character functions.
Include an autoconf check for wctomb(); if it's not present at
all, use the built-in UTF-8 functions instead so that pax
extended headers (which are stored in UTF-8) can still be minimally
supported.