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.
Tim Kientzle [Sat, 5 Jun 2010 02:28:31 +0000 (22:28 -0400)]
Support for reading Mac OS-style metadata blobs.
This adds support for such blobs to archive_entry and
extends the tar reader to identify the special entries
and store them in the archive_entry.
Remaining: extend archive_write_disk to actually
restore the metadata to the file on disk.
On msys, include unistd.h before we redefine ftruncate() to
prevent build error from a type mismatch of ftruncate().
Msys has a unistd.h file and it defines ftruncate() with off_t, and
then it will causes build error after we redefine ftruncate() as
__la_ftruncate(int, int64_t).
Tim Kientzle [Mon, 31 May 2010 18:20:46 +0000 (14:20 -0400)]
Handle EINTR in write calls:
* In low-level writers, just retry after EINTR
* In archive_write, handle short writes by generating additional writes for the remainder of the block.
In particular, this fixes a problem with bsdtar failing if you try to use the SIGINT handler.
TRY_COMPILE requires specific include paths and library paths.
if there are no specific library, TRY_COMPILE wont link any additional
libraries, it means ARCHIVE_HASH_*_OPENSSL are never detected.
Tim Kientzle [Sun, 16 May 2010 20:33:30 +0000 (16:33 -0400)]
Properly support filter(-1) as a shorthand for "the last filter",
which is always the client proxy. In particular, tar uses this for
reporting position in the input stream.
Divide the code detecting ARCHIVE_HASH_*_WIN from CHECK_MD() to
clarify what CHECK_MD does. Basically, CHECK_MD prove that we
can map the HASH functions, which have several types of name, to
archive_{hash name}_init, archive_{hash name}_final and
archive_{hash name}_update through archive_hash.h.
But using ARCHIVE_HASH_*_WIN requires if ACLG_{hash name} is
available, and then __la_hash_*() used under the ARCHIVE_HASH_*_WIN
are defined at archive_windows.c. it's completely different the way
the CHECK_MD does.
Simplify an MD_CHECK macro in CMakeLists.txt.
Using MD_CHECK_{hash name} confuses a person who uses CMake -U option,
which removes a specified variable from CMakeCache.
Brian Harring [Tue, 11 May 2010 09:20:42 +0000 (05:20 -0400)]
fix fwrites... remember, semi modern glibc's, the return on it is marked for checking, thus when doing maintenance/dev builds (which converts warnings to errors) unchecked fwrites are compile failures