Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 1 Aug 2011 07:59:03 +0000 (UTC)
From:      Martin Matuska <mm@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-8@freebsd.org
Subject:   svn commit: r224561 - in stable/8/lib/libarchive: . libarchive_fe test
Message-ID:  <201108010759.p717x30G083625@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: mm
Date: Mon Aug  1 07:59:02 2011
New Revision: 224561
URL: http://svn.freebsd.org/changeset/base/224561

Log:
  Sync libarchive with 9-CURRENT:
  
  MFC on lib/libarchive:
  196961,200351,201077,201079-201097,201099-201112,201155-201157,
  201159-201163,201165,201167-201171,201246-201250,201253,202868-202869,
  202871-202873,203952,208027,208169,208184,208263,208291,210825,213573,
  214822,214867,214905,216258,221472,224152
  
  MFC 196961 (kientzle):
  Update tests to match r195873, which corrected how hardlinked files
  on iso9660 images were returned.  While I'm poking around, update
  some comments around this area to try to clarify what's going on and
  what still remains to be improved.
  
  MFC 200351 (kientzle):
  Merge two cpio fixes from libarchive.googlecode.com:
   1) Avoid an infinite loop in the header resync for certain malformed
      archives.
   2) Don't try to match hardlinks if the nlinks count is < 2.   This
      reduces the likelihood of a false hardlink match due to ino truncation.
  
  MFC 201077 (kientzle):
  Update format manpages for libarchive.
  
  MFC 201079 (kientzle):
  Update the hard-coded configuration for libarchive.
  
  MFC 201080 (kientzle):
  Remove some unused variables and dead assignments.
  
  MFC 201081 (kientzle):
  Remove a dead assignment.
  
  MFC 201082 (kientzle):
  Catch certain gzip failures at close time.
  
  MFC 201083 (kientzle):
  Compatibility fix for some older systems with non-POSIX getgrnam_r/getpwnam_r
  and a minor style fix for the hash function.
  
  MFC 201084 (kientzle):
  Sync with googlecode some changes that have no impact on FreeBSD.
  
  MFC 201085 (kientzle):
  Compatibility:  I found some more compilers that don't like 'inline' keyword.
  Protection:  Discourage people from using this header outside libarchive.
  
  MFC 201086 (kientzle):
  Discourage people from using this header outside of libarchive.
  
  MFC 201087 (kientzle):
  Enforce this as an internal-only header.
  
  MFC 201088 (kientzle):
  Allow more formats to be active at a time; discourage outside use.
  
  MFC 201089 (kientzle):
  Portability: terminate abnormally via abort() instead of segfault,
  watch the return value from write(), and avoid signed arithmetic on
  unsigned values.
  
  MFC 201091 (kientzle):
  Remove dead assignment.
  
  MFC 201092 (kientzle):
  Discourage outside use of this internal header.
  
  MFC 201093 (kientzle):
  Portability:  Set the file descriptor to binary mode on Win32
  
  MFC 201094 (kientzle):
  Eliminate an unused assignment.
  
  MFC 201095 (kientzle):
  Remove an unused variable and an unnecessary increment.
  
  MFC 201096 (kientzle):
  Various portability fixes, plus:
   * New "ino64" field.
   * New UTF8 interfaces for hardlink/symlink updates
  
  MFC 201097 (kientzle):
  Portability fixes.
  
  MFC 201099 (kientzle):
  Use new ino64 interface.
  
  MFC 201110 (kientzle):
  Clarify an example so Linux folks won't keep getting confused by this
  point.
  
  MFC 201111 (kientzle):
  Remove some dead assignments, fix some declarations.
  
  MFC 201112 (kientzle):
  Portability.
  
  MFC 201155 (kientzle):
  64-bit ino support and discourage bad use of this header.
  
  MFC 201156 (kientzle):
  Various style and portability fixes, including:
   * Enforce option interface can only be used before the archive is opened
   * Correctly handle large skips on platforms with 32-bit off_t
   * Use int64_t instead of off_t
  
  MFC 201157 (kientzle):
  Catch decompression failures earlier.  In particular, this gives
  immediate feedback if we fail to fork an external decompression program.
  
  MFC 201159 (kientzle):
  Various fixes when creating objects on disk:
   * Write xattrs last instead of first (required on platforms that use
     system xattrs for security attributes)
   * Better handling of chdir() failures
   * Don't bother trying to shorten files via seek()/write()
   * Fix build on systems that lack link()/symlink()/mknod()
   * Prefer futimens()/utimensat() when they're present
  
  MFC 201160 (kientzle):
  Various style fixes to the 'newc' cpio writer:
   * Warn about truncation of ino
   * Use a macro to hide the somewhat obscure pad-to-multiple-of-4 calculation
   * Eliminate some unused variables
  
  MFC 201161 (kientzle):
  Style fixes to tar reader:
    For portability, prefer int64_t to off_t.
    Improve numeric overflow handling when parsing.
    Fix some variable types.
    Eliminate some unused results.
  
  MFC 201162 (kientzle):
  Style and portability fixes for pax writer.  Mostly very routine, except for:
   * Use ino64 where appropriate
   * Don't pass atime or nsec to ustar formatter
  
  MFC 201163 (kientzle):
  Be a little more skeptical of dev/ino matches when reading cpio files.
  This eliminates some false-positives in the hardlink detection logic.
  
  MFC 201165 (kientzle):
  Minor style fixes plus a fix for an obscure crash on certain malformed
  mtree files.
  
  MFC 201167 (kientzle):
  If we're linking against liblzma, allow the decompressor to use up to
  1<<30 bytes of memory, which is required for some streams.
  
  Also, try to make the taster more discriminating about raw lzma streams.
  The detection here is still really weak, though; please use xz instead
  of lzma.
  
  MFC 201168 (kientzle):
  Zip write support for libarchive.
  
  The initial implementation was developed by Anselm Strauss as part of
  Google Summer of Code 2008, then completed by Joerg Sonnenberger.
  
  MFC 201169 (kientzle):
  Clear extraneous error messages.
  
  MFC 201170 (kientzle):
  Essentially eliminate problems with false hardlinks in POSIX cpio
  archives by generating synthetic ino values and mapping values
  from disk into the new values.
  
  MFC 201171 (kientzle):
  Rationalize the support for cryptographic hashes.
  
  MFC 201246 (kientzle):
  Merge Michihiro NAKAJIMA's significant work on the ISO9660 reader
  from googlecode:
   * Support for zisofs compressed entries
   * Support for relocated deep directories
   * Direct calculation of link counts for accurate nlink values
     even on images that lack Rockridge extensions
   * Faster handling of the internal file lists.
   * Better detection of ISO variants
  
  MFC 201247 (kientzle):
  A raft of test changes and improvements from the Googlecode repository.
  In particular, this includes tests for the new features I've merged
  over the last few days.
  
  MFC 201248 (kientzle):
  UU decoder.  Now that libarchive can recursively taste input streams,
  you can do things like this:  tar xvf archive.tar.gz.uu
  
  MFC 201249 (kientzle):
  Libarchive in FreeBSD is now synced up with 2.7.901a from
  libarchive.googlecode.com
  
  MFC 201250 (kientzle):
  Reserve constants for RPM unwrapper and XAR reader.
  
  MFC 201253 (kientzle):
  Remove some test files that are no longer used.
  
  MFC 202868 (kientzle):
  Fix a memory leak when a filter fails to initialize.
  
  MFC 202869 (kientzle):
  Initialize the allocated 'struct zip'.
  
  MFC 202871 (kientzle):
  If we can't stat a file, return the correct ARCHIVE_FAILED (this entry can't
  be processed any further) and a suitable error string.
  In particular, this improves the error-reporting when cpio -o is
  given a nonexistent filename.
  
  MFC 202872 (kientzle):
  Use a simpler memory-management strategy for the file objects.
  Instead of trying to reference-count them and free them as soon
  as they are no longer needed, we now just keep them around and free
  them all when we release the archive object.  This fixes a number
  of minor memory leaks, especially when reading damaged archives.
  
  MFC 202873 (kientzle):
  Don't try to hardlink block or character device nodes that come out
  of cpio archives.
  
  MFC 203952 (uqs):
  Add missing newline in last line of file.
  
  Uncovered via:	fromcvs vs. svn
  
  MFC 208027 (uqs):
  mdoc: move CAVEATS, BUGS and SECURITY CONSIDERATIONS sections to the
  bottom of the manpages and order them consistently.
  
  GNU groff doesn't care about the ordering, and doesn't even mention
  CAVEATS and SECURITY CONSIDERATIONS as common sections and where to put
  them.
  
  Found by:       mdocml lint run
  
  MFC 208169 (kientzle):
  Reorganize slightly in preparation for making lzma and bz2 support
  conditional.
  
  MFC 208184 (delphij):
  Fix build.
  
  MFC 208263 (kientzle):
  Retry reads that fail with EINTR.  This fixes a problem
  with bsdtar failing on SIGINT.
  
  MFC 208291 (uqs):
  mdoc: consistently spell our email addresses <foo@FreeBSD.org>
  
  MFC 210825 (joel):
  Fix typo.
  
  MFC 213573 (uqs):
  mdoc: drop redundant .Pp and .LP calls
  
  They have no effect when coming in pairs, or before .Bl/.Bd
  
  MFC 214822 (kientzle):
  Clarify the naming:  Methods that free an object should
  be called "free".  Retain the old "finish" names to preserve
  source compatibility for now.
  
  MFC 214867 (uqs):
  Fix manpage markup.
  
  MFC 214905 (kientzle):
  If the Zip reader doesn't see a PK signature block
  because there's inter-entry garbage, just scan forward
  to find the next one.  This allows us to handle a lot
  of Zip archives that have been modified in-place.
  
  Thanks to:	Gleb Kurtsou for sending me a sample archive
  
  MFC 216258 (kientzle):
  Don't write data into an empty "file."
  
  In particular, this check avoids a warning when
  extracting directory entries from certain GNU tar
  archives that store directory contents.
  
  MFC 221472 (obrien):
  libarchive is mixing libmd and libcrypto -- correct to use one or the other.
  [mixing the two can be quite bad -- they define the same context structures,
   but with differing structure members (and sizes)]
  
  MFC 224152 (mm):
  - Update libarchive to 2.8.4
  - Add support for extracting xar and rpm archives
  - Add libarchive_fe subdir (common code for tar and cpio)

Added:
  stable/8/lib/libarchive/archive_crc32.h
     - copied unchanged from r201112, head/lib/libarchive/archive_crc32.h
  stable/8/lib/libarchive/archive_entry_xattr.c
     - copied unchanged from r201097, head/lib/libarchive/archive_entry_xattr.c
  stable/8/lib/libarchive/archive_hash.h
     - copied, changed from r201171, head/lib/libarchive/archive_hash.h
  stable/8/lib/libarchive/archive_read_support_compression_rpm.c
     - copied unchanged from r224152, head/lib/libarchive/archive_read_support_compression_rpm.c
  stable/8/lib/libarchive/archive_read_support_compression_uu.c
     - copied, changed from r201250, head/lib/libarchive/archive_read_support_compression_uu.c
  stable/8/lib/libarchive/archive_read_support_format_xar.c
     - copied unchanged from r224152, head/lib/libarchive/archive_read_support_format_xar.c
  stable/8/lib/libarchive/archive_write_set_format_zip.c
     - copied, changed from r201171, head/lib/libarchive/archive_write_set_format_zip.c
  stable/8/lib/libarchive/libarchive_fe/
     - copied from r224152, head/lib/libarchive/libarchive_fe/
  stable/8/lib/libarchive/test/test_compat_cpio.c
     - copied unchanged from r201250, head/lib/libarchive/test/test_compat_cpio.c
  stable/8/lib/libarchive/test/test_compat_cpio_1.cpio.uu
     - copied unchanged from r201250, head/lib/libarchive/test/test_compat_cpio_1.cpio.uu
  stable/8/lib/libarchive/test/test_compat_lzma.c
     - copied unchanged from r201250, head/lib/libarchive/test/test_compat_lzma.c
  stable/8/lib/libarchive/test/test_compat_lzma_1.tlz.uu
     - copied unchanged from r201250, head/lib/libarchive/test/test_compat_lzma_1.tlz.uu
  stable/8/lib/libarchive/test/test_compat_lzma_2.tlz.uu
     - copied unchanged from r201250, head/lib/libarchive/test/test_compat_lzma_2.tlz.uu
  stable/8/lib/libarchive/test/test_compat_lzma_3.tlz.uu
     - copied unchanged from r201250, head/lib/libarchive/test/test_compat_lzma_3.tlz.uu
  stable/8/lib/libarchive/test/test_compat_zip_2.zip.uu
     - copied unchanged from r214905, head/lib/libarchive/test/test_compat_zip_2.zip.uu
  stable/8/lib/libarchive/test/test_fuzz_1.iso.Z.uu
     - copied unchanged from r201250, head/lib/libarchive/test/test_fuzz_1.iso.Z.uu
  stable/8/lib/libarchive/test/test_read_format_ar.ar.uu
     - copied unchanged from r201250, head/lib/libarchive/test/test_read_format_ar.ar.uu
  stable/8/lib/libarchive/test/test_read_format_cpio_bin_lzma.c
     - copied unchanged from r201250, head/lib/libarchive/test/test_read_format_cpio_bin_lzma.c
  stable/8/lib/libarchive/test/test_read_format_cpio_svr4_bzip2_rpm.c
     - copied unchanged from r224152, head/lib/libarchive/test/test_read_format_cpio_svr4_bzip2_rpm.c
  stable/8/lib/libarchive/test/test_read_format_cpio_svr4_bzip2_rpm.rpm.uu
     - copied unchanged from r224152, head/lib/libarchive/test/test_read_format_cpio_svr4_bzip2_rpm.rpm.uu
  stable/8/lib/libarchive/test/test_read_format_cpio_svr4_gzip_rpm.c
     - copied unchanged from r224152, head/lib/libarchive/test/test_read_format_cpio_svr4_gzip_rpm.c
  stable/8/lib/libarchive/test/test_read_format_cpio_svr4_gzip_rpm.rpm.uu
     - copied unchanged from r224152, head/lib/libarchive/test/test_read_format_cpio_svr4_gzip_rpm.rpm.uu
  stable/8/lib/libarchive/test/test_read_format_iso.iso.Z.uu
     - copied unchanged from r201250, head/lib/libarchive/test/test_read_format_iso.iso.Z.uu
  stable/8/lib/libarchive/test/test_read_format_iso_joliet.iso.Z.uu
     - copied unchanged from r201250, head/lib/libarchive/test/test_read_format_iso_joliet.iso.Z.uu
  stable/8/lib/libarchive/test/test_read_format_iso_joliet_long.iso.Z.uu
     - copied unchanged from r201250, head/lib/libarchive/test/test_read_format_iso_joliet_long.iso.Z.uu
  stable/8/lib/libarchive/test/test_read_format_iso_joliet_rockridge.iso.Z.uu
     - copied unchanged from r201250, head/lib/libarchive/test/test_read_format_iso_joliet_rockridge.iso.Z.uu
  stable/8/lib/libarchive/test/test_read_format_iso_multi_extent.c
     - copied unchanged from r201250, head/lib/libarchive/test/test_read_format_iso_multi_extent.c
  stable/8/lib/libarchive/test/test_read_format_iso_multi_extent.iso.Z.uu
     - copied unchanged from r201250, head/lib/libarchive/test/test_read_format_iso_multi_extent.iso.Z.uu
  stable/8/lib/libarchive/test/test_read_format_iso_rockridge.iso.Z.uu
     - copied unchanged from r201250, head/lib/libarchive/test/test_read_format_iso_rockridge.iso.Z.uu
  stable/8/lib/libarchive/test/test_read_format_iso_rockridge_ce.iso.Z.uu
     - copied unchanged from r201250, head/lib/libarchive/test/test_read_format_iso_rockridge_ce.iso.Z.uu
  stable/8/lib/libarchive/test/test_read_format_iso_rockridge_new.iso.Z.uu
     - copied unchanged from r201250, head/lib/libarchive/test/test_read_format_iso_rockridge_new.iso.Z.uu
  stable/8/lib/libarchive/test/test_read_format_iso_rockridge_rr_moved.iso.Z.uu
     - copied unchanged from r201250, head/lib/libarchive/test/test_read_format_iso_rockridge_rr_moved.iso.Z.uu
  stable/8/lib/libarchive/test/test_read_format_iso_zisofs.iso.Z.uu
     - copied unchanged from r201250, head/lib/libarchive/test/test_read_format_iso_zisofs.iso.Z.uu
  stable/8/lib/libarchive/test/test_read_format_isojoliet_long.c
     - copied unchanged from r201250, head/lib/libarchive/test/test_read_format_isojoliet_long.c
  stable/8/lib/libarchive/test/test_read_format_isojoliet_rr.c
     - copied unchanged from r201250, head/lib/libarchive/test/test_read_format_isojoliet_rr.c
  stable/8/lib/libarchive/test/test_read_format_isorr_ce.c
     - copied unchanged from r201250, head/lib/libarchive/test/test_read_format_isorr_ce.c
  stable/8/lib/libarchive/test/test_read_format_isorr_new_bz2.c
     - copied unchanged from r201250, head/lib/libarchive/test/test_read_format_isorr_new_bz2.c
  stable/8/lib/libarchive/test/test_read_format_isorr_rr_moved.c
     - copied unchanged from r201250, head/lib/libarchive/test/test_read_format_isorr_rr_moved.c
  stable/8/lib/libarchive/test/test_read_format_isozisofs_bz2.c
     - copied unchanged from r201250, head/lib/libarchive/test/test_read_format_isozisofs_bz2.c
  stable/8/lib/libarchive/test/test_read_format_mtree.mtree.uu
     - copied unchanged from r201250, head/lib/libarchive/test/test_read_format_mtree.mtree.uu
  stable/8/lib/libarchive/test/test_read_format_tlz.c
     - copied unchanged from r201250, head/lib/libarchive/test/test_read_format_tlz.c
  stable/8/lib/libarchive/test/test_read_format_xar.c
     - copied unchanged from r224152, head/lib/libarchive/test/test_read_format_xar.c
  stable/8/lib/libarchive/test/test_read_uu.c
     - copied unchanged from r201250, head/lib/libarchive/test/test_read_uu.c
  stable/8/lib/libarchive/test/test_write_disk_symlink.c
     - copied unchanged from r201250, head/lib/libarchive/test/test_write_disk_symlink.c
  stable/8/lib/libarchive/test/test_write_format_zip.c
     - copied unchanged from r201250, head/lib/libarchive/test/test_write_format_zip.c
  stable/8/lib/libarchive/test/test_write_format_zip_empty.c
     - copied unchanged from r201250, head/lib/libarchive/test/test_write_format_zip_empty.c
  stable/8/lib/libarchive/test/test_write_format_zip_no_compression.c
     - copied unchanged from r201250, head/lib/libarchive/test/test_write_format_zip_no_compression.c
Deleted:
  stable/8/lib/libarchive/test/test_fuzz_1.iso.uu
  stable/8/lib/libarchive/test/test_read_format_iso_gz.iso.gz.uu
  stable/8/lib/libarchive/test/test_read_format_isojoliet_bz2.iso.bz2.uu
  stable/8/lib/libarchive/test/test_read_format_isojolietrr_bz2.iso.bz2.uu
  stable/8/lib/libarchive/test/test_read_format_isorr_bz2.iso.bz2.uu
Modified:
  stable/8/lib/libarchive/Makefile
  stable/8/lib/libarchive/README
  stable/8/lib/libarchive/archive.h
  stable/8/lib/libarchive/archive_check_magic.c
  stable/8/lib/libarchive/archive_endian.h
  stable/8/lib/libarchive/archive_entry.c
  stable/8/lib/libarchive/archive_entry.h
  stable/8/lib/libarchive/archive_entry_link_resolver.c
  stable/8/lib/libarchive/archive_entry_private.h
  stable/8/lib/libarchive/archive_entry_stat.c
  stable/8/lib/libarchive/archive_platform.h
  stable/8/lib/libarchive/archive_private.h
  stable/8/lib/libarchive/archive_read.3
  stable/8/lib/libarchive/archive_read.c
  stable/8/lib/libarchive/archive_read_disk.3
  stable/8/lib/libarchive/archive_read_disk.c
  stable/8/lib/libarchive/archive_read_disk_entry_from_file.c
  stable/8/lib/libarchive/archive_read_disk_private.h
  stable/8/lib/libarchive/archive_read_disk_set_standard_lookup.c
  stable/8/lib/libarchive/archive_read_extract.c
  stable/8/lib/libarchive/archive_read_open_fd.c
  stable/8/lib/libarchive/archive_read_open_file.c
  stable/8/lib/libarchive/archive_read_open_filename.c
  stable/8/lib/libarchive/archive_read_private.h
  stable/8/lib/libarchive/archive_read_support_compression_all.c
  stable/8/lib/libarchive/archive_read_support_compression_bzip2.c
  stable/8/lib/libarchive/archive_read_support_compression_compress.c
  stable/8/lib/libarchive/archive_read_support_compression_gzip.c
  stable/8/lib/libarchive/archive_read_support_compression_program.c
  stable/8/lib/libarchive/archive_read_support_compression_xz.c
  stable/8/lib/libarchive/archive_read_support_format_all.c
  stable/8/lib/libarchive/archive_read_support_format_ar.c
  stable/8/lib/libarchive/archive_read_support_format_cpio.c
  stable/8/lib/libarchive/archive_read_support_format_iso9660.c
  stable/8/lib/libarchive/archive_read_support_format_mtree.c
  stable/8/lib/libarchive/archive_read_support_format_raw.c
  stable/8/lib/libarchive/archive_read_support_format_tar.c
  stable/8/lib/libarchive/archive_read_support_format_zip.c
  stable/8/lib/libarchive/archive_string.c
  stable/8/lib/libarchive/archive_string.h
  stable/8/lib/libarchive/archive_virtual.c
  stable/8/lib/libarchive/archive_write.3
  stable/8/lib/libarchive/archive_write.c
  stable/8/lib/libarchive/archive_write_disk.3
  stable/8/lib/libarchive/archive_write_disk.c
  stable/8/lib/libarchive/archive_write_disk_private.h
  stable/8/lib/libarchive/archive_write_disk_set_standard_lookup.c
  stable/8/lib/libarchive/archive_write_open_fd.c
  stable/8/lib/libarchive/archive_write_private.h
  stable/8/lib/libarchive/archive_write_set_compression_bzip2.c
  stable/8/lib/libarchive/archive_write_set_compression_compress.c
  stable/8/lib/libarchive/archive_write_set_compression_gzip.c
  stable/8/lib/libarchive/archive_write_set_compression_none.c
  stable/8/lib/libarchive/archive_write_set_compression_program.c
  stable/8/lib/libarchive/archive_write_set_compression_xz.c
  stable/8/lib/libarchive/archive_write_set_format.c
  stable/8/lib/libarchive/archive_write_set_format_ar.c
  stable/8/lib/libarchive/archive_write_set_format_by_name.c
  stable/8/lib/libarchive/archive_write_set_format_cpio.c
  stable/8/lib/libarchive/archive_write_set_format_cpio_newc.c
  stable/8/lib/libarchive/archive_write_set_format_mtree.c
  stable/8/lib/libarchive/archive_write_set_format_pax.c
  stable/8/lib/libarchive/config_freebsd.h
  stable/8/lib/libarchive/cpio.5
  stable/8/lib/libarchive/filter_fork.c
  stable/8/lib/libarchive/filter_fork.h
  stable/8/lib/libarchive/libarchive-formats.5
  stable/8/lib/libarchive/libarchive.3
  stable/8/lib/libarchive/libarchive_internals.3
  stable/8/lib/libarchive/tar.5
  stable/8/lib/libarchive/test/Makefile
  stable/8/lib/libarchive/test/main.c
  stable/8/lib/libarchive/test/read_open_memory.c
  stable/8/lib/libarchive/test/test.h
  stable/8/lib/libarchive/test/test_acl_freebsd.c
  stable/8/lib/libarchive/test/test_acl_pax.c
  stable/8/lib/libarchive/test/test_compat_bzip2.c
  stable/8/lib/libarchive/test/test_compat_solaris_tar_acl.c
  stable/8/lib/libarchive/test/test_compat_zip.c
  stable/8/lib/libarchive/test/test_entry.c
  stable/8/lib/libarchive/test/test_entry_strmode.c
  stable/8/lib/libarchive/test/test_extattr_freebsd.c
  stable/8/lib/libarchive/test/test_fuzz.c
  stable/8/lib/libarchive/test/test_open_fd.c
  stable/8/lib/libarchive/test/test_open_file.c
  stable/8/lib/libarchive/test/test_pax_filename_encoding.c
  stable/8/lib/libarchive/test/test_read_compress_program.c
  stable/8/lib/libarchive/test/test_read_data_large.c
  stable/8/lib/libarchive/test/test_read_disk.c
  stable/8/lib/libarchive/test/test_read_disk_entry_from_file.c
  stable/8/lib/libarchive/test/test_read_extract.c
  stable/8/lib/libarchive/test/test_read_format_ar.c
  stable/8/lib/libarchive/test/test_read_format_cpio_bin_bz2.c
  stable/8/lib/libarchive/test/test_read_format_iso_gz.c
  stable/8/lib/libarchive/test/test_read_format_isojoliet_bz2.c
  stable/8/lib/libarchive/test/test_read_format_isorr_bz2.c
  stable/8/lib/libarchive/test/test_read_format_mtree.c
  stable/8/lib/libarchive/test/test_read_format_pax_bz2.c
  stable/8/lib/libarchive/test/test_read_format_tar.c
  stable/8/lib/libarchive/test/test_read_format_tbz.c
  stable/8/lib/libarchive/test/test_read_large.c
  stable/8/lib/libarchive/test/test_read_truncated.c
  stable/8/lib/libarchive/test/test_tar_large.c
  stable/8/lib/libarchive/test/test_ustar_filenames.c
  stable/8/lib/libarchive/test/test_write_compress_program.c
  stable/8/lib/libarchive/test/test_write_disk.c
  stable/8/lib/libarchive/test/test_write_disk_failures.c
  stable/8/lib/libarchive/test/test_write_disk_hardlink.c
  stable/8/lib/libarchive/test/test_write_disk_perms.c
  stable/8/lib/libarchive/test/test_write_disk_secure.c
  stable/8/lib/libarchive/test/test_write_disk_sparse.c
  stable/8/lib/libarchive/test/test_write_disk_times.c
  stable/8/lib/libarchive/test/test_write_format_cpio.c
  stable/8/lib/libarchive/test/test_write_format_cpio_empty.c
  stable/8/lib/libarchive/test/test_write_format_cpio_newc.c
  stable/8/lib/libarchive/test/test_write_format_cpio_odc.c
  stable/8/lib/libarchive/test/test_write_format_tar_ustar.c
Directory Properties:
  stable/8/lib/libarchive/   (props changed)

Modified: stable/8/lib/libarchive/Makefile
==============================================================================
--- stable/8/lib/libarchive/Makefile	Mon Aug  1 04:29:04 2011	(r224560)
+++ stable/8/lib/libarchive/Makefile	Mon Aug  1 07:59:02 2011	(r224561)
@@ -2,8 +2,8 @@
 .include <bsd.own.mk>
 
 LIB=	archive
-DPADD=	${LIBZ} ${LIBMD}
-LDADD=	-lz -lmd
+DPADD=	${LIBZ}
+LDADD=	-lz
 
 DPADD+=	${LIBBZ2}
 LDADD+=	-lbz2
@@ -13,6 +13,9 @@ DPADD+=	${LIBLZMA}
 LDADD+=	-llzma
 CFLAGS+= -DHAVE_LIBLZMA=1 -DHAVE_LZMA_H=1
 
+DPADD+= ${LIBBSDXML}
+LDADD+= -lbsdxml
+
 # FreeBSD SHLIB_MAJOR value is managed as part of the FreeBSD system.
 # It has no real relation to the libarchive version number.
 SHLIB_MAJOR= 5
@@ -24,6 +27,9 @@ CFLAGS+=	-I${.OBJDIR}
 CFLAGS+=	-DWITH_OPENSSL
 DPADD+=	${LIBCRYPTO}
 LDADD+=	-lcrypto
+.else
+DPADD+=	${LIBMD}
+LDADD+=	-lmd
 .endif
 
 WARNS?=	6
@@ -38,6 +44,7 @@ SRCS=	archive_check_magic.c				\
 	archive_entry_stat.c				\
 	archive_entry_strmode.c				\
 	archive_entry_link_resolver.c			\
+	archive_entry_xattr.c				\
 	archive_read.c					\
 	archive_read_data_into_fd.c			\
 	archive_read_disk.c				\
@@ -54,6 +61,8 @@ SRCS=	archive_check_magic.c				\
 	archive_read_support_compression_gzip.c		\
 	archive_read_support_compression_none.c		\
 	archive_read_support_compression_program.c	\
+	archive_read_support_compression_rpm.c		\
+	archive_read_support_compression_uu.c		\
 	archive_read_support_compression_xz.c		\
 	archive_read_support_format_all.c		\
 	archive_read_support_format_ar.c		\
@@ -63,6 +72,7 @@ SRCS=	archive_check_magic.c				\
 	archive_read_support_format_mtree.c		\
 	archive_read_support_format_raw.c		\
 	archive_read_support_format_tar.c		\
+	archive_read_support_format_xar.c		\
 	archive_read_support_format_zip.c		\
 	archive_string.c				\
 	archive_string_sprintf.c			\
@@ -90,6 +100,7 @@ SRCS=	archive_check_magic.c				\
 	archive_write_set_format_pax.c			\
 	archive_write_set_format_shar.c			\
 	archive_write_set_format_ustar.c		\
+	archive_write_set_format_zip.c			\
 	filter_fork.c
 
 # Man pages to be installed.

Modified: stable/8/lib/libarchive/README
==============================================================================
--- stable/8/lib/libarchive/README	Mon Aug  1 04:29:04 2011	(r224560)
+++ stable/8/lib/libarchive/README	Mon Aug  1 07:59:02 2011	(r224561)
@@ -21,6 +21,7 @@ Currently, the library automatically det
   * gzip compression
   * bzip2 compression
   * compress/LZW compression
+  * lzma and xz compression
   * GNU tar format (including GNU long filenames, long link names, and
     sparse files)
   * Solaris 9 extended tar format (including ACLs)
@@ -30,18 +31,26 @@ Currently, the library automatically det
   * POSIX octet-oriented cpio
   * SVR4 ASCII cpio
   * Binary cpio (big-endian or little-endian)
-  * ISO9660 CD-ROM images (with optional Rockridge extensions)
+  * ISO9660 CD-ROM images (with optional Rockridge or Joliet extensions)
   * ZIP archives (with uncompressed or "deflate" compressed entries)
+  * GNU and BSD 'ar' archives
+  * 'mtree' format
 
 The library can write:
   * gzip compression
   * bzip2 compression
+  * compress/LZW compression
+  * lzma and xz compression
   * POSIX ustar
   * POSIX pax interchange format
   * "restricted" pax format, which will create ustar archives except for
     entries that require pax extensions (for long filenames, ACLs, etc).
   * POSIX octet-oriented cpio
+  * SVR4 "newc" cpio
   * shar archives
+  * ZIP archives (with uncompressed or "deflate" compressed entries)
+  * GNU and BSD 'ar' archives
+  * 'mtree' format
 
 Notes:
  * This is a heavily stream-oriented system.  There is no direct

Modified: stable/8/lib/libarchive/archive.h
==============================================================================
--- stable/8/lib/libarchive/archive.h	Mon Aug  1 04:29:04 2011	(r224560)
+++ stable/8/lib/libarchive/archive.h	Mon Aug  1 07:59:02 2011	(r224561)
@@ -35,12 +35,16 @@
  * this header!  If you must conditionalize, use predefined compiler and/or
  * platform macros.
  */
+#if defined(__BORLANDC__) && __BORLANDC__ >= 0x560
+# define __LA_STDINT_H <stdint.h>
+#elif !defined(__WATCOMC__) && !defined(_MSC_VER) && !defined(__INTERIX) && !defined(__BORLANDC__)
+# define __LA_STDINT_H <inttypes.h>
+#endif
 
 #include <sys/stat.h>
 #include <sys/types.h>  /* Linux requires this for off_t */
-#if !defined(__WATCOMC__) && !defined(_MSC_VER) && !defined(__INTERIX)
-/* Header unavailable on Watcom C or MS Visual C++ or SFU. */
-#include <inttypes.h> /* int64_t, etc. */
+#ifdef __LA_STDINT_H
+# include __LA_STDINT_H /* int64_t, etc. */
 #endif
 #include <stdio.h> /* For FILE * */
 
@@ -48,13 +52,20 @@
 /* These should match the types used in 'struct stat' */
 #if defined(_WIN32) && !defined(__CYGWIN__)
 #define	__LA_INT64_T	__int64
-# if	defined(_WIN64)
+# if defined(_SSIZE_T_DEFINED)
+#  define	__LA_SSIZE_T	ssize_t
+# elif defined(_WIN64)
 #  define	__LA_SSIZE_T	__int64
 # else
 #  define	__LA_SSIZE_T	long
 # endif
-#define	__LA_UID_T	unsigned int
-#define	__LA_GID_T	unsigned int
+# if defined(__BORLANDC__)
+#  define	__LA_UID_T	uid_t
+#  define	__LA_GID_T	gid_t
+# else
+#  define	__LA_UID_T	short
+#  define	__LA_GID_T	short
+# endif
 #else
 #include <unistd.h>  /* ssize_t, uid_t, and gid_t */
 #define	__LA_INT64_T	int64_t
@@ -118,13 +129,13 @@ extern "C" {
  *             (ARCHIVE_API_VERSION * 1000000 + ARCHIVE_API_FEATURE * 1000)
  * #endif
  */
-#define	ARCHIVE_VERSION_NUMBER 2007000
+#define	ARCHIVE_VERSION_NUMBER 2008004
 __LA_DECL int		archive_version_number(void);
 
 /*
  * Textual name/version of the library, useful for version displays.
  */
-#define	ARCHIVE_VERSION_STRING "libarchive 2.7.0"
+#define	ARCHIVE_VERSION_STRING "libarchive 2.8.4"
 __LA_DECL const char *	archive_version_string(void);
 
 #if ARCHIVE_VERSION_NUMBER < 3000000
@@ -232,6 +243,8 @@ typedef int	archive_close_callback(struc
 #define	ARCHIVE_COMPRESSION_PROGRAM	4
 #define	ARCHIVE_COMPRESSION_LZMA	5
 #define	ARCHIVE_COMPRESSION_XZ		6
+#define	ARCHIVE_COMPRESSION_UU		7
+#define	ARCHIVE_COMPRESSION_RPM		8
 
 /*
  * Codes returned by archive_format.
@@ -273,6 +286,7 @@ typedef int	archive_close_callback(struc
 #define	ARCHIVE_FORMAT_AR_BSD			(ARCHIVE_FORMAT_AR | 2)
 #define	ARCHIVE_FORMAT_MTREE			0x80000
 #define	ARCHIVE_FORMAT_RAW			0x90000
+#define	ARCHIVE_FORMAT_XAR			0xA0000
 
 /*-
  * Basic outline for reading an archive:
@@ -307,6 +321,8 @@ __LA_DECL int		 archive_read_support_com
 				(struct archive *, const char *,
 				    const void * /* match */, size_t);
 
+__LA_DECL int		 archive_read_support_compression_rpm(struct archive *);
+__LA_DECL int		 archive_read_support_compression_uu(struct archive *);
 __LA_DECL int		 archive_read_support_compression_xz(struct archive *);
 
 __LA_DECL int		 archive_read_support_format_all(struct archive *);
@@ -318,6 +334,7 @@ __LA_DECL int		 archive_read_support_for
 __LA_DECL int		 archive_read_support_format_mtree(struct archive *);
 __LA_DECL int		 archive_read_support_format_raw(struct archive *);
 __LA_DECL int		 archive_read_support_format_tar(struct archive *);
+__LA_DECL int		 archive_read_support_format_xar(struct archive *);
 __LA_DECL int		 archive_read_support_format_zip(struct archive *);
 
 
@@ -469,11 +486,10 @@ __LA_DECL void		archive_read_extract_set
 /* Close the file and release most resources. */
 __LA_DECL int		 archive_read_close(struct archive *);
 /* Release all resources and destroy the object. */
-/* Note that archive_read_finish will call archive_read_close for you. */
-#if ARCHIVE_VERSION_NUMBER < 2000000
-/* Erroneously declared to return void in libarchive 1.x */
-__LA_DECL void		 archive_read_finish(struct archive *);
-#else
+/* Note that archive_read_free will call archive_read_close for you. */
+__LA_DECL int		 archive_read_free(struct archive *);
+#if ARCHIVE_VERSION_NUMBER < 4000000
+/* Synonym for archive_read_free() for backwards compatibility. */
 __LA_DECL int		 archive_read_finish(struct archive *);
 #endif
 
@@ -490,7 +506,7 @@ __LA_DECL int		 archive_read_finish(stru
  *      - archive_write_header to write the header
  *      - archive_write_data to write the entry data
  *   5) archive_write_close to close the output
- *   6) archive_write_finish to cleanup the writer and release resources
+ *   6) archive_write_free to cleanup the writer and release resources
  */
 __LA_DECL struct archive	*archive_write_new(void);
 __LA_DECL int		 archive_write_set_bytes_per_block(struct archive *,
@@ -529,6 +545,7 @@ __LA_DECL int		 archive_write_set_format
 __LA_DECL int		 archive_write_set_format_shar(struct archive *);
 __LA_DECL int		 archive_write_set_format_shar_dump(struct archive *);
 __LA_DECL int		 archive_write_set_format_ustar(struct archive *);
+__LA_DECL int		 archive_write_set_format_zip(struct archive *);
 __LA_DECL int		 archive_write_open(struct archive *, void *,
 		     archive_open_callback *, archive_write_callback *,
 		     archive_close_callback *);
@@ -570,13 +587,12 @@ __LA_DECL __LA_SSIZE_T	 archive_write_da
 #endif
 __LA_DECL int		 archive_write_finish_entry(struct archive *);
 __LA_DECL int		 archive_write_close(struct archive *);
-#if ARCHIVE_VERSION_NUMBER < 2000000
-/* Return value was incorrect in libarchive 1.x. */
-__LA_DECL void		 archive_write_finish(struct archive *);
-#else
-/* Libarchive 2.x and later returns an error if this fails. */
-/* It can fail if the archive wasn't already closed, in which case
- * archive_write_finish() will implicitly call archive_write_close(). */
+
+/* This can fail if the archive wasn't already closed, in which case
+ * archive_write_free() will implicitly call archive_write_close(). */
+__LA_DECL int		 archive_write_free(struct archive *);
+#if ARCHIVE_VERSION_NUMBER < 4000000
+/* Synonym for archive_write_free() for backwards compatibility. */
 __LA_DECL int		 archive_write_finish(struct archive *);
 #endif
 
@@ -605,7 +621,7 @@ __LA_DECL int		archive_write_set_options
  *      - construct an appropriate struct archive_entry structure
  *      - archive_write_header to create the file/dir/etc on disk
  *      - archive_write_data to write the entry data
- *   4) archive_write_finish to cleanup the writer and release resources
+ *   4) archive_write_free to cleanup the writer and release resources
  *
  * In particular, you can use this in conjunction with archive_read()
  * to pull entries out of an archive and create them on disk.

Modified: stable/8/lib/libarchive/archive_check_magic.c
==============================================================================
--- stable/8/lib/libarchive/archive_check_magic.c	Mon Aug  1 04:29:04 2011	(r224560)
+++ stable/8/lib/libarchive/archive_check_magic.c	Mon Aug  1 07:59:02 2011	(r224561)
@@ -50,7 +50,16 @@ __FBSDID("$FreeBSD$");
 static void
 errmsg(const char *m)
 {
-	write(2, m, strlen(m));
+	size_t s = strlen(m);
+	ssize_t written;
+
+	while (s > 0) {
+		written = write(2, m, strlen(m));
+		if (written <= 0)
+			return;
+		m += written;
+		s -= written;
+	}
 }
 
 static void
@@ -60,8 +69,7 @@ diediedie(void)
 	/* Cause a breakpoint exception  */
 	DebugBreak();
 #endif
-	*(char *)0 = 1;	/* Deliberately segfault and force a coredump. */
-	_exit(1);	/* If that didn't work, just exit with an error. */
+	abort();        /* Terminate the program abnormally. */
 }
 
 static const char *
@@ -85,7 +93,7 @@ write_all_states(unsigned int states)
 	unsigned int lowbit;
 
 	/* A trick for computing the lowest set bit. */
-	while ((lowbit = states & (-states)) != 0) {
+	while ((lowbit = states & (1 + ~states)) != 0) {
 		states &= ~lowbit;		/* Clear the low bit. */
 		errmsg(state_name(lowbit));
 		if (states != 0)

Copied: stable/8/lib/libarchive/archive_crc32.h (from r201112, head/lib/libarchive/archive_crc32.h)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ stable/8/lib/libarchive/archive_crc32.h	Mon Aug  1 07:59:02 2011	(r224561, copy of r201112, head/lib/libarchive/archive_crc32.h)
@@ -0,0 +1,66 @@
+/*-
+ * Copyright (c) 2009 Joerg  Sonnenberger
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef __LIBARCHIVE_BUILD
+#error This header is only to be used internally to libarchive.
+#endif
+
+/*
+ * When zlib is unavailable, we should still be able to validate
+ * uncompressed zip archives.  That requires us to be able to compute
+ * the CRC32 check value.  This is a drop-in compatible replacement
+ * for crc32() from zlib.  It's slower than the zlib implementation,
+ * but still pretty fast: This runs about 300MB/s on my 3GHz P4
+ * compared to about 800MB/s for the zlib implementation.
+ */
+static unsigned long
+crc32(unsigned long crc, const void *_p, size_t len)
+{
+	unsigned long crc2, b, i;
+	const unsigned char *p = _p;
+	static volatile int crc_tbl_inited = 0;
+	static unsigned long crc_tbl[256];
+
+	if (!crc_tbl_inited) {
+		for (b = 0; b < 256; ++b) {
+			crc2 = b;
+			for (i = 8; i > 0; --i) {
+				if (crc2 & 1)
+					crc2 = (crc2 >> 1) ^ 0xedb88320UL;
+				else    
+					crc2 = (crc2 >> 1);
+			}
+			crc_tbl[b] = crc2;
+		}
+		crc_tbl_inited = 1;
+	}
+
+	crc = crc ^ 0xffffffffUL;
+	while (len--)
+		crc = crc_tbl[(crc ^ *p++) & 0xff] ^ (crc >> 8);
+	return (crc ^ 0xffffffffUL);
+}

Modified: stable/8/lib/libarchive/archive_endian.h
==============================================================================
--- stable/8/lib/libarchive/archive_endian.h	Mon Aug  1 04:29:04 2011	(r224560)
+++ stable/8/lib/libarchive/archive_endian.h	Mon Aug  1 07:59:02 2011	(r224561)
@@ -28,6 +28,10 @@
  * Borrowed from FreeBSD's <sys/endian.h>
  */
 
+#ifndef __LIBARCHIVE_BUILD
+#error This header is only to be used internally to libarchive.
+#endif
+
 /* Note:  This is a purely internal header! */
 /* Do not use this outside of libarchive internal code! */
 
@@ -41,7 +45,7 @@
  * - SGI MIPSpro
  * - Microsoft Visual C++ 6.0 (supposedly newer versions too)
  */
-#if defined(__WATCOMC__) || defined(__sgi)
+#if defined(__WATCOMC__) || defined(__sgi) || defined(__hpux) || defined(__BORLANDC__)
 #define	inline
 #elif defined(_MSC_VER)
 #define inline __inline

Modified: stable/8/lib/libarchive/archive_entry.c
==============================================================================
--- stable/8/lib/libarchive/archive_entry.c	Mon Aug  1 04:29:04 2011	(r224560)
+++ stable/8/lib/libarchive/archive_entry.c	Mon Aug  1 07:59:02 2011	(r224561)
@@ -32,12 +32,12 @@ __FBSDID("$FreeBSD$");
 #ifdef HAVE_SYS_TYPES_H
 #include <sys/types.h>
 #endif
-#ifdef MAJOR_IN_MKDEV
+#if MAJOR_IN_MKDEV
 #include <sys/mkdev.h>
-#else
-#ifdef MAJOR_IN_SYSMACROS
+#define HAVE_MAJOR
+#elif MAJOR_IN_SYSMACROS
 #include <sys/sysmacros.h>
-#endif
+#define HAVE_MAJOR
 #endif
 #ifdef HAVE_LIMITS_H
 #include <limits.h>
@@ -75,6 +75,13 @@ __FBSDID("$FreeBSD$");
 #undef max
 #define	max(a, b)	((a)>(b)?(a):(b))
 
+#if !defined(HAVE_MAJOR) && !defined(major)
+/* Replacement for major/minor/makedev. */
+#define	major(x) ((int)(0x00ff & ((x) >> 8)))
+#define	minor(x) ((int)(0xffff00ff & (x)))
+#define	makedev(maj,min) ((0xff00 & ((maj)<<8)) | (0xffff00ff & (min)))
+#endif
+
 /* Play games to come up with a suitable makedev() definition. */
 #ifdef __QNXNTO__
 /* QNX.  <sigh> */
@@ -215,7 +222,7 @@ static const wchar_t *
 aes_get_wcs(struct aes *aes)
 {
 	wchar_t *w;
-	int r;
+	size_t r;
 
 	/* Return WCS form if we already have it. */
 	if (aes->aes_set & AES_SET_WCS)
@@ -233,7 +240,7 @@ aes_get_wcs(struct aes *aes)
 		if (w == NULL)
 			__archive_errx(1, "No memory for aes_get_wcs()");
 		r = mbstowcs(w, aes->aes_mbs.s, wcs_length);
-		if (r > 0) {
+		if (r != (size_t)-1 && r != 0) {
 			w[r] = 0;
 			aes->aes_set |= AES_SET_WCS;
 			return (aes->aes_wcs = w);
@@ -618,6 +625,12 @@ archive_entry_ino(struct archive_entry *
 	return (entry->ae_stat.aest_ino);
 }
 
+int64_t
+archive_entry_ino64(struct archive_entry *entry)
+{
+	return (entry->ae_stat.aest_ino);
+}
+
 mode_t
 archive_entry_mode(struct archive_entry *entry)
 {
@@ -818,6 +831,13 @@ archive_entry_set_ino(struct archive_ent
 }
 
 void
+archive_entry_set_ino64(struct archive_entry *entry, int64_t ino)
+{
+	entry->stat_valid = 0;
+	entry->ae_stat.aest_ino = ino;
+}
+
+void
 archive_entry_set_hardlink(struct archive_entry *entry, const char *target)
 {
 	aes_set_mbs(&entry->ae_hardlink, target);
@@ -847,6 +867,16 @@ archive_entry_copy_hardlink_w(struct arc
 		entry->ae_set &= ~AE_SET_HARDLINK;
 }
 
+int
+archive_entry_update_hardlink_utf8(struct archive_entry *entry, const char *target)
+{
+	if (target != NULL)
+		entry->ae_set |= AE_SET_HARDLINK;
+	else
+		entry->ae_set &= ~AE_SET_HARDLINK;
+	return (aes_update_utf8(&entry->ae_hardlink, target));
+}
+
 void
 archive_entry_set_atime(struct archive_entry *entry, time_t t, long ns)
 {
@@ -1095,6 +1125,16 @@ archive_entry_copy_symlink_w(struct arch
 		entry->ae_set &= ~AE_SET_SYMLINK;
 }
 
+int
+archive_entry_update_symlink_utf8(struct archive_entry *entry, const char *linkname)
+{
+	if (linkname != NULL)
+		entry->ae_set |= AE_SET_SYMLINK;
+	else
+		entry->ae_set &= ~AE_SET_SYMLINK;
+	return (aes_update_utf8(&entry->ae_symlink, linkname));
+}
+
 void
 archive_entry_set_uid(struct archive_entry *entry, uid_t u)
 {
@@ -1186,7 +1226,7 @@ archive_entry_acl_add_entry_w(struct arc
 	archive_entry_acl_add_entry_w_len(entry, type, permset, tag, id, name, wcslen(name));
 }
 
-void
+static void
 archive_entry_acl_add_entry_w_len(struct archive_entry *entry,
     int type, int permset, int tag, int id, const wchar_t *name, size_t len)
 {
@@ -1595,7 +1635,7 @@ __archive_entry_acl_parse_w(struct archi
 		const wchar_t *end;
 	} field[4], name;
 
-	int fields;
+	int fields, n;
 	int type, tag, permset, id;
 	wchar_t sep;
 
@@ -1615,6 +1655,10 @@ __archive_entry_acl_parse_w(struct archi
 			++fields;
 		} while (sep == L':');
 
+		/* Set remaining fields to blank. */
+		for (n = fields; n < 4; ++n)
+			field[n].start = field[n].end = NULL;
+
 		/* Check for a numeric ID in field 1 or 3. */
 		id = -1;
 		isint_w(field[1].start, field[1].end, &id);
@@ -1626,7 +1670,7 @@ __archive_entry_acl_parse_w(struct archi
 		 * Solaris extension:  "defaultuser::rwx" is the
 		 * default ACL corresponding to "user::rwx", etc.
 		 */
-		if (field[0].end-field[0].start > 7
+		if (field[0].end - field[0].start > 7
 		    && wmemcmp(field[0].start, L"default", 7) == 0) {
 			type = ARCHIVE_ENTRY_ACL_TYPE_DEFAULT;
 			field[0].start += 7;
@@ -1653,7 +1697,7 @@ __archive_entry_acl_parse_w(struct archi
 		} else if (prefix_w(field[0].start, field[0].end, L"other")) {
 			if (fields == 2
 			    && field[1].start < field[1].end
-			    && ismode_w(field[1].start, field[2].end, &permset)) {
+			    && ismode_w(field[1].start, field[1].end, &permset)) {
 				/* This is Solaris-style "other:rwx" */
 			} else if (fields == 3
 			    && field[1].start == field[1].end
@@ -1687,98 +1731,6 @@ __archive_entry_acl_parse_w(struct archi
 }
 
 /*
- * extended attribute handling
- */
-
-void
-archive_entry_xattr_clear(struct archive_entry *entry)
-{
-	struct ae_xattr	*xp;
-
-	while (entry->xattr_head != NULL) {
-		xp = entry->xattr_head->next;
-		free(entry->xattr_head->name);
-		free(entry->xattr_head->value);
-		free(entry->xattr_head);
-		entry->xattr_head = xp;
-	}
-
-	entry->xattr_head = NULL;
-}
-
-void
-archive_entry_xattr_add_entry(struct archive_entry *entry,
-	const char *name, const void *value, size_t size)
-{
-	struct ae_xattr	*xp;
-
-	for (xp = entry->xattr_head; xp != NULL; xp = xp->next)
-		;
-
-	if ((xp = (struct ae_xattr *)malloc(sizeof(struct ae_xattr))) == NULL)
-		/* XXX Error XXX */
-		return;
-
-	xp->name = strdup(name);
-	if ((xp->value = malloc(size)) != NULL) {
-		memcpy(xp->value, value, size);
-		xp->size = size;
-	} else
-		xp->size = 0;
-
-	xp->next = entry->xattr_head;
-	entry->xattr_head = xp;
-}
-
-
-/*
- * returns number of the extended attribute entries
- */
-int
-archive_entry_xattr_count(struct archive_entry *entry)
-{
-	struct ae_xattr *xp;
-	int count = 0;
-
-	for (xp = entry->xattr_head; xp != NULL; xp = xp->next)
-		count++;
-
-	return count;
-}
-
-int
-archive_entry_xattr_reset(struct archive_entry * entry)
-{
-	entry->xattr_p = entry->xattr_head;
-
-	return archive_entry_xattr_count(entry);
-}
-
-int
-archive_entry_xattr_next(struct archive_entry * entry,
-	const char **name, const void **value, size_t *size)
-{
-	if (entry->xattr_p) {
-		*name = entry->xattr_p->name;
-		*value = entry->xattr_p->value;
-		*size = entry->xattr_p->size;
-
-		entry->xattr_p = entry->xattr_p->next;
-
-		return (ARCHIVE_OK);
-	} else {
-		*name = NULL;
-		*value = NULL;
-		*size = (size_t)0;
-		return (ARCHIVE_WARN);
-	}
-}
-
-/*
- * end of xattr handling
- */
-
-/*
  * Parse a string to a positive decimal integer.  Returns true if
  * the string is non-empty and consists only of decimal digits,
  * false otherwise.
@@ -1814,6 +1766,8 @@ ismode_w(const wchar_t *start, const wch
 {
 	const wchar_t *p;
 
+	if (start >= end)
+		return (0);
 	p = start;
 	*permset = 0;
 	while (p < end) {
@@ -1988,6 +1942,18 @@ static struct flag {
 	{ "nouunlnk",	L"nouunlnk",		UF_NOUNLINK,	0 },
 	{ "nouunlink",	L"nouunlink",		UF_NOUNLINK,	0 },
 #endif
+#ifdef EXT2_UNRM_FL
+        { "nouunlink",	L"nouunlink",		EXT2_UNRM_FL,	0},
+#endif
+
+#ifdef EXT2_BTREE_FL
+        { "nobtree",	L"nobtree",       	EXT2_BTREE_FL,	0 },
+#endif
+
+#ifdef EXT2_ECOMPR_FL
+        { "nocomperr",	L"nocomperr",       	EXT2_ECOMPR_FL,	0 },
+#endif
+
 #ifdef EXT2_COMPR_FL				/* 'c' */
         { "nocompress",	L"nocompress",       	EXT2_COMPR_FL,	0 },
 #endif
@@ -1995,6 +1961,46 @@ static struct flag {
 #ifdef EXT2_NOATIME_FL				/* 'A' */
         { "noatime",	L"noatime",		0,		EXT2_NOATIME_FL},
 #endif
+
+#ifdef EXT2_DIRTY_FL
+        { "nocompdirty",L"nocompdirty",		EXT2_DIRTY_FL,		0},
+#endif
+
+#ifdef EXT2_COMPRBLK_FL
+#ifdef EXT2_NOCOMPR_FL
+        { "nocomprblk",	L"nocomprblk",		EXT2_COMPRBLK_FL, EXT2_NOCOMPR_FL},
+#else
+        { "nocomprblk",	L"nocomprblk",		EXT2_COMPRBLK_FL,	0},
+#endif
+#endif
+#ifdef EXT2_DIRSYNC_FL
+        { "nodirsync",	L"nodirsync",		EXT2_DIRSYNC_FL,	0},
+#endif
+#ifdef EXT2_INDEX_FL
+        { "nohashidx",	L"nohashidx",		EXT2_INDEX_FL,		0},
+#endif
+#ifdef EXT2_IMAGIC_FL
+        { "noimagic",	L"noimagic",		EXT2_IMAGIC_FL,		0},
+#endif
+#ifdef EXT3_JOURNAL_DATA_FL
+        { "nojournal",	L"nojournal",		EXT3_JOURNAL_DATA_FL,	0},
+#endif
+#ifdef EXT2_SECRM_FL
+        { "nosecuredeletion",L"nosecuredeletion",EXT2_SECRM_FL,		0},
+#endif
+#ifdef EXT2_SYNC_FL
+        { "nosync",	L"nosync",		EXT2_SYNC_FL,		0},
+#endif
+#ifdef EXT2_NOTAIL_FL
+        { "notail",	L"notail",		0,		EXT2_NOTAIL_FL},
+#endif
+#ifdef EXT2_TOPDIR_FL
+        { "notopdir",	L"notopdir",		EXT2_TOPDIR_FL,		0},
+#endif
+#ifdef EXT2_RESERVED_FL
+        { "noreserved",	L"noreserved",		EXT2_RESERVED_FL,	0},
+#endif
+
 	{ NULL,		NULL,			0,		0 }
 };
 

Modified: stable/8/lib/libarchive/archive_entry.h
==============================================================================
--- stable/8/lib/libarchive/archive_entry.h	Mon Aug  1 04:29:04 2011	(r224560)
+++ stable/8/lib/libarchive/archive_entry.h	Mon Aug  1 07:59:02 2011	(r224561)
@@ -40,14 +40,25 @@
 #include <stddef.h>  /* for wchar_t */
 #include <time.h>
 
+#if defined(_WIN32) && !defined(__CYGWIN__)
+#include <windows.h>
+#endif
+
 /* Get appropriate definitions of standard POSIX-style types. */
 /* These should match the types used in 'struct stat' */
 #if defined(_WIN32) && !defined(__CYGWIN__)
 #define	__LA_INT64_T	__int64
-#define	__LA_UID_T	unsigned int
-#define	__LA_GID_T	unsigned int
-#define	__LA_DEV_T	unsigned int
-#define	__LA_MODE_T	unsigned short
+# if defined(__BORLANDC__)
+#  define	__LA_UID_T	uid_t
+#  define	__LA_GID_T	gid_t
+#  define	__LA_DEV_T	dev_t
+#  define	__LA_MODE_T	mode_t
+# else
+#  define	__LA_UID_T	short
+#  define	__LA_GID_T	short
+#  define	__LA_DEV_T	unsigned int
+#  define	__LA_MODE_T	unsigned short
+# endif
 #else
 #include <unistd.h>
 #define	__LA_INT64_T	int64_t
@@ -194,6 +205,7 @@ __LA_DECL const wchar_t	*archive_entry_g
 __LA_DECL const char	*archive_entry_hardlink(struct archive_entry *);
 __LA_DECL const wchar_t	*archive_entry_hardlink_w(struct archive_entry *);
 __LA_DECL __LA_INO_T	 archive_entry_ino(struct archive_entry *);
+__LA_DECL __LA_INT64_T	 archive_entry_ino64(struct archive_entry *);
 __LA_DECL __LA_MODE_T	 archive_entry_mode(struct archive_entry *);
 __LA_DECL time_t	 archive_entry_mtime(struct archive_entry *);
 __LA_DECL long		 archive_entry_mtime_nsec(struct archive_entry *);
@@ -227,6 +239,10 @@ __LA_DECL const wchar_t	*archive_entry_u
 
 __LA_DECL void	archive_entry_set_atime(struct archive_entry *, time_t, long);
 __LA_DECL void  archive_entry_unset_atime(struct archive_entry *);
+#if defined(_WIN32) && !defined(__CYGWIN__)
+__LA_DECL void archive_entry_copy_bhfi(struct archive_entry *,
+									   BY_HANDLE_FILE_INFORMATION *);
+#endif
 __LA_DECL void	archive_entry_set_birthtime(struct archive_entry *, time_t, long);
 __LA_DECL void  archive_entry_unset_birthtime(struct archive_entry *);
 __LA_DECL void	archive_entry_set_ctime(struct archive_entry *, time_t, long);
@@ -251,7 +267,14 @@ __LA_DECL int	archive_entry_update_gname
 __LA_DECL void	archive_entry_set_hardlink(struct archive_entry *, const char *);
 __LA_DECL void	archive_entry_copy_hardlink(struct archive_entry *, const char *);
 __LA_DECL void	archive_entry_copy_hardlink_w(struct archive_entry *, const wchar_t *);
+__LA_DECL int	archive_entry_update_hardlink_utf8(struct archive_entry *, const char *);
+#if ARCHIVE_VERSION_NUMBER >= 3000000
+/* Starting with libarchive 3.0, this will be synonym for ino64. */
+__LA_DECL void	archive_entry_set_ino(struct archive_entry *, __LA_INT64_T);
+#else
 __LA_DECL void	archive_entry_set_ino(struct archive_entry *, unsigned long);
+#endif
+__LA_DECL void	archive_entry_set_ino64(struct archive_entry *, __LA_INT64_T);
 __LA_DECL void	archive_entry_set_link(struct archive_entry *, const char *);
 __LA_DECL void	archive_entry_copy_link(struct archive_entry *, const char *);
 __LA_DECL void	archive_entry_copy_link_w(struct archive_entry *, const wchar_t *);
@@ -274,6 +297,7 @@ __LA_DECL void	archive_entry_copy_source
 __LA_DECL void	archive_entry_set_symlink(struct archive_entry *, const char *);
 __LA_DECL void	archive_entry_copy_symlink(struct archive_entry *, const char *);
 __LA_DECL void	archive_entry_copy_symlink_w(struct archive_entry *, const wchar_t *);
+__LA_DECL int	archive_entry_update_symlink_utf8(struct archive_entry *, const char *);
 __LA_DECL void	archive_entry_set_uid(struct archive_entry *, __LA_UID_T);
 __LA_DECL void	archive_entry_set_uname(struct archive_entry *, const char *);
 __LA_DECL void	archive_entry_copy_uname(struct archive_entry *, const char *);

Modified: stable/8/lib/libarchive/archive_entry_link_resolver.c
==============================================================================
--- stable/8/lib/libarchive/archive_entry_link_resolver.c	Mon Aug  1 04:29:04 2011	(r224560)
+++ stable/8/lib/libarchive/archive_entry_link_resolver.c	Mon Aug  1 07:59:02 2011	(r224561)
@@ -181,8 +181,10 @@ archive_entry_linkify(struct archive_ent
 	/* If it has only one link, then we're done. */
 	if (archive_entry_nlink(*e) == 1)
 		return;
-	/* Directories never have hardlinks. */
-	if (archive_entry_filetype(*e) == AE_IFDIR)
+	/* Directories, devices never have hardlinks. */
+	if (archive_entry_filetype(*e) == AE_IFDIR
+	    || archive_entry_filetype(*e) == AE_IFBLK
+	    || archive_entry_filetype(*e) == AE_IFCHR)
 		return;
 
 	switch (res->strategy) {
@@ -249,7 +251,7 @@ find_entry(struct archive_entry_linkreso
 	struct links_entry	*le;
 	int			 hash, bucket;
 	dev_t			 dev;
-	ino_t			 ino;
+	int64_t			 ino;
 
 	/* Free a held entry. */
 	if (res->spare != NULL) {
@@ -264,15 +266,15 @@ find_entry(struct archive_entry_linkreso
 		return (NULL);
 
 	dev = archive_entry_dev(entry);
-	ino = archive_entry_ino(entry);
-	hash = dev ^ ino;
+	ino = archive_entry_ino64(entry);
+	hash = (int)(dev ^ ino);
 
 	/* Try to locate this entry in the links cache. */
 	bucket = hash % res->number_buckets;
 	for (le = res->buckets[bucket]; le != NULL; le = le->next) {
 		if (le->hash == hash
 		    && dev == archive_entry_dev(le->canonical)
-		    && ino == archive_entry_ino(le->canonical)) {
+		    && ino == archive_entry_ino64(le->canonical)) {
 			/*
 			 * Decrement link count each time and release
 			 * the entry if it hits zero.  This saves
@@ -350,7 +352,7 @@ insert_entry(struct archive_entry_linkre
 	if (res->number_entries > res->number_buckets * 2)
 		grow_hash(res);
 
-	hash = archive_entry_dev(entry) ^ archive_entry_ino(entry);
+	hash = archive_entry_dev(entry) ^ archive_entry_ino64(entry);
 	bucket = hash % res->number_buckets;
 
 	/* If we could allocate the entry, record it. */

Modified: stable/8/lib/libarchive/archive_entry_private.h
==============================================================================
--- stable/8/lib/libarchive/archive_entry_private.h	Mon Aug  1 04:29:04 2011	(r224560)
+++ stable/8/lib/libarchive/archive_entry_private.h	Mon Aug  1 07:59:02 2011	(r224561)
@@ -25,6 +25,10 @@
  * $FreeBSD$
  */
 
+#ifndef __LIBARCHIVE_BUILD
+#error This header is only to be used internally to libarchive.
+#endif
+
 #ifndef ARCHIVE_ENTRY_PRIVATE_H_INCLUDED
 #define	ARCHIVE_ENTRY_PRIVATE_H_INCLUDED
 
@@ -115,7 +119,7 @@ struct archive_entry {
 		int64_t		aest_birthtime;
 		uint32_t	aest_birthtime_nsec;
 		gid_t		aest_gid;
-		ino_t		aest_ino;
+		int64_t		aest_ino;
 		mode_t		aest_mode;
 		uint32_t	aest_nlink;
 		uint64_t	aest_size;

Modified: stable/8/lib/libarchive/archive_entry_stat.c
==============================================================================
--- stable/8/lib/libarchive/archive_entry_stat.c	Mon Aug  1 04:29:04 2011	(r224560)
+++ stable/8/lib/libarchive/archive_entry_stat.c	Mon Aug  1 07:59:02 2011	(r224561)
@@ -72,7 +72,7 @@ archive_entry_stat(struct archive_entry 
 	st->st_dev = archive_entry_dev(entry);
 	st->st_gid = archive_entry_gid(entry);
 	st->st_uid = archive_entry_uid(entry);
-	st->st_ino = archive_entry_ino(entry);
+	st->st_ino = archive_entry_ino64(entry);
 	st->st_nlink = archive_entry_nlink(entry);
 	st->st_rdev = archive_entry_rdev(entry);
 	st->st_size = archive_entry_size(entry);

Copied: stable/8/lib/libarchive/archive_entry_xattr.c (from r201097, head/lib/libarchive/archive_entry_xattr.c)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ stable/8/lib/libarchive/archive_entry_xattr.c	Mon Aug  1 07:59:02 2011	(r224561, copy of r201097, head/lib/libarchive/archive_entry_xattr.c)
@@ -0,0 +1,158 @@
+/*-
+ * Copyright (c) 2003-2007 Tim Kientzle
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "archive_platform.h"
+__FBSDID("$FreeBSD$");
+
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_LIMITS_H
+#include <limits.h>
+#endif
+#ifdef HAVE_LINUX_FS_H
+#include <linux/fs.h>	/* for Linux file flags */
+#endif
+/*
+ * Some Linux distributions have both linux/ext2_fs.h and ext2fs/ext2_fs.h.
+ * As the include guards don't agree, the order of include is important.
+ */
+#ifdef HAVE_LINUX_EXT2_FS_H
+#include <linux/ext2_fs.h>	/* for Linux file flags */
+#endif
+#if defined(HAVE_EXT2FS_EXT2_FS_H) && !defined(__CYGWIN__)
+#include <ext2fs/ext2_fs.h>	/* for Linux file flags */
+#endif
+#include <stddef.h>
+#include <stdio.h>
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+#ifdef HAVE_WCHAR_H
+#include <wchar.h>
+#endif
+
+#include "archive.h"
+#include "archive_entry.h"
+#include "archive_private.h"
+#include "archive_entry_private.h"
+
+/*
+ * extended attribute handling
+ */
+
+void
+archive_entry_xattr_clear(struct archive_entry *entry)
+{
+	struct ae_xattr	*xp;
+
+	while (entry->xattr_head != NULL) {
+		xp = entry->xattr_head->next;
+		free(entry->xattr_head->name);
+		free(entry->xattr_head->value);
+		free(entry->xattr_head);
+		entry->xattr_head = xp;
+	}
+
+	entry->xattr_head = NULL;
+}
+
+void
+archive_entry_xattr_add_entry(struct archive_entry *entry,
+	const char *name, const void *value, size_t size)
+{
+	struct ae_xattr	*xp;
+
+	for (xp = entry->xattr_head; xp != NULL; xp = xp->next)
+		;
+
+	if ((xp = (struct ae_xattr *)malloc(sizeof(struct ae_xattr))) == NULL)
+		/* XXX Error XXX */
+		return;
+
+	xp->name = strdup(name);
+	if ((xp->value = malloc(size)) != NULL) {
+		memcpy(xp->value, value, size);
+		xp->size = size;
+	} else
+		xp->size = 0;
+
+	xp->next = entry->xattr_head;
+	entry->xattr_head = xp;
+}
+
+
+/*

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201108010759.p717x30G083625>