Brian Harring [Thu, 23 Sep 2010 11:26:11 +0000 (07:26 -0400)]
not hugely happy with the implementation (specifically unconsumed passing), but rework the header reading to properly pair it's read_ahead/consume usage
Brian Harring [Thu, 23 Sep 2010 10:21:09 +0000 (06:21 -0400)]
correct a mismatch- you tell libarchive something is consumed only after you've actually consumed it. Once you've consumed a read_ahead block, the data it points to is volatile. Mainline trunk currently currently wouldn't cause issues with this usage, but the usage violates the api contract (and will have issues under libtransform) so fixing it.
Brian Harring [Wed, 1 Sep 2010 12:25:23 +0000 (08:25 -0400)]
fix tcp.sh to work (looks like upon importation it picked up some address scrubbing crap from gmail/websites). tweak the logic slightly also to just process available tar implementaitons for testing
Tim Kientzle [Sun, 15 Aug 2010 04:11:25 +0000 (00:11 -0400)]
When -R is specified, make sure to clear the uname/gname
fields. Add a TODO here for the -R parser to return
usable uname/gname text (only useful for tar output,
so not a huge priority right now).
Tim Kientzle [Sun, 25 Jul 2010 01:16:30 +0000 (21:16 -0400)]
Instead of trying a read-ahead after each filter stage,
just do it once after the full pipeline is built.
In particular, this catches errors on uncompressed
input at open time. Also, if any filter stage fails
to initialize, clean up the entire pipeline
immediately.
Tim Kientzle [Sun, 25 Jul 2010 01:11:34 +0000 (21:11 -0400)]
If opening the filter pipeline fails, immediately
close the pipeline and return with an error without
initializing the format writer. Ensure that close requests
propagate up the pipeline even if a particular
stage hasn't registered a closer.
In particular, this fixes a crash that occurs when
write openers would fail but the format would get
initialized anyway. At close time, formats such
as tar perform a write that would crash because the
pipeline wasn't fully initialized. With this
change, the format never gets initialized in
this case so it doesn't need to be cleaned up.
Tim Kientzle [Mon, 19 Jul 2010 05:24:09 +0000 (01:24 -0400)]
As reported by Aaron W Hsu, some ISO writers put a
Path Table starting at sector 18; the taster was rejecting
such archives (requiring that the path table start after
sector 18).
Tim Kientzle [Sat, 17 Jul 2010 23:23:16 +0000 (19:23 -0400)]
Virtualize archive_read_next_header(). In particular, attempts to
call this on a read_disk handle will fail immediately with a Null
pointer dereference instead of trying to run the archive_read
implementation, which fails with a much more inscrutable error.
Tim Kientzle [Tue, 13 Jul 2010 03:36:29 +0000 (23:36 -0400)]
As discussed on the libarchive-discuss mailing list,
don't use any special declaration marker for GNU C on Windows.
The explicit dllimport marker hasn't been needed for many years
and removing it allows the same headers to be used for either a
static or dynamic library.
On Windows, use BY_HANDLE_FILE_INFORMAION directly to set up a archive_entry
object instead of struct stat with archive_entry_copy_stat in
directory traversals.
Tim Kientzle [Sat, 3 Jul 2010 03:56:02 +0000 (23:56 -0400)]
Finish fixing the breakage from r2522: In particular, fcopyfile() seems
broken so we can't use the more straightforward (and more secure)
fd-oriented approach here.
Tim Kientzle [Sat, 3 Jul 2010 02:32:12 +0000 (22:32 -0400)]
Fix a counting error in the Mac pathname editing.
Using memmove() here is efficient, but a bit touchy.
This fixes bsdtar_test_copy, which was broken in r2522.
iso9660: fix joliet version/dot stripping code to handle wide characters.
Kientzle noticed that test_write_format_iso9660_filename failure
was introduced by rev 2514. See comments at:
http://code.google.com/p/libarchive/source/detail?r=2514
This fixes the problem by not comparing wchar_t against 'x' but L'x'.
Tim Kientzle [Wed, 30 Jun 2010 05:12:57 +0000 (01:12 -0400)]
Basic test for tar --newer-than option. So far, this
exercises very basic creation-time filtering and
extraction-time filtering but doesn't yet test the
directory-descent problem documented in Issue 97.
It did uncover a problem with extraction-time filtering
that is fixed here.
Tim Kientzle [Sat, 26 Jun 2010 18:41:38 +0000 (14:41 -0400)]
Choose the copy buffer size used for reading files
to be archived dynamically:
* At least 64k
* At least as large as the -b setting
In particular, this should speed up things noticably when large -b
values are in use. This is also the first cut at aligning the copy
buffer so we can take advantage of O_DIRECT someday.
Tim Kientzle [Sat, 26 Jun 2010 17:18:30 +0000 (13:18 -0400)]
Use -b setting when interpolating archives.
Simplify the handling of -b values by setting
a default early and then just using the value
instead of duplicating the logic.
Tim Kientzle [Sat, 26 Jun 2010 06:17:32 +0000 (02:17 -0400)]
Use intmax_t for %jd printf arguments.
We should probably be using archive_string_sprintf
here instead of printf to avoid the portability problem
(not all platforms have intmax_t, not all have %jd).
Tim Kientzle [Fri, 25 Jun 2010 23:26:45 +0000 (19:26 -0400)]
Various tar format improvements:
* Improve description of Apple extensions
* AIX ACL extensions
* Solaris ACL extensions
* Move numeric extensions section next to ustar section
* Add summary of tar header types
* Add LIBARCHIVE.* pax extensions
Tim Kientzle [Sat, 19 Jun 2010 02:48:53 +0000 (22:48 -0400)]
Add ARCHIVE_EXTRACT_MAC_METADATA flag to archive_write_disk. This
feeds the mac_metadata blob from the archive_entry to the Mac
copyfile() function to restore ACLs and xattrs. Restoring these attrs
on dirs is correctly deferred until end-of-archive.
Enable this for tar -p
This is the rest of the support for reading and restoring
Apple extensions to tar archives.
- Refactor hash function scan to use a compile+link test to increase
robustness
- Deal with missing getgrnam_r / getpwnam_r functions
- Properly define HAVE_SIGACTION for cmake
- Only use poll in filter_fork.c, if either poll.h or sys/poll.h exists
- \\ -> \e in man pages, drop empty BUGS section
- Deal with interrupted reads and continue
On Windows, remove chdir/SetCurrentDirectory from archive_read_disk.c
You cannot exceed the 260 bytes limit of path length, even if
you change the current working directory as POSIX system.
For example,
SetCurrentDirectory(<240-bytes-full-path>);
CreateFile(<21-bytes-path>);
^^^ it fails because the `full' path length of that file is 262 bytes.
This is Windows behavior. we should use wchar_t with '\\?\' prefix
to exceed the path limit.
Use FindFirstFile for the first entry to detect whether the entry is a symbolic link because GetFileInformationByHandle does not provide Reparse Point Tag.
It seems OpenBSD does not set MNT_LOCAL/ST_LOCAL to statvfs.f_flag.
ST_LOCAL and MNT_LOCAL are the same value on NetBSD, but OpenBSD
does not define ST_LOCAL so we should use it instead of MNT_LOCAL
to prevent OpenBSD.
Add archive_read_disk_current_filesystem_is_synthetic and
archive_read_disk_current_filesystem_is_remote, which provide
filesystem information. Currently those are supported on FreeBSD only.
I will guradually support other platform.
Add archive_read_disk_current_filesystem which returns an ID, which
is index of filesystem entry you've visited through directory traversals
in archive_read_disk.
Backout __la_lstat.
It seems using FILE_FLAG_OPEN_REPARSE_POINT flag to CreateFile has effect to other things, not only symbolic link.
We have to check Reparse Point Tags before using FILE_FLAG_OPEN_REPARSE_POINT.
Bring the code supporting directory traversals from bsdtar/tree.[ch]
into archive_read_disk.c and modify it.
Introduce new APIs archive_read_disk_open and archive_read_disk_descend.
TODO: - implement archive_read_data_block and others.
- adapt it to libarchive world, for example, use struct archive_string.
Make archive_read_next_header2 and archive_read_data_block virtualization.
This is a initial step of supporting directory traversals in archive_read_disk.