[Midnightbsd-cvs] src [11134] trunk/contrib/libarchive: mark as pdf
laffer1 at midnightbsd.org
laffer1 at midnightbsd.org
Tue Jun 19 16:42:35 EDT 2018
Revision: 11134
http://svnweb.midnightbsd.org/src/?rev=11134
Author: laffer1
Date: 2018-06-19 16:42:35 -0400 (Tue, 19 Jun 2018)
Log Message:
-----------
mark as pdf
Modified Paths:
--------------
trunk/contrib/libarchive/CMakeLists.txt
trunk/contrib/libarchive/Makefile.am
trunk/contrib/libarchive/Makefile.in
trunk/contrib/libarchive/NEWS
trunk/contrib/libarchive/aclocal.m4
trunk/contrib/libarchive/build/autoconf/config.guess
trunk/contrib/libarchive/build/autoconf/config.rpath
trunk/contrib/libarchive/build/autoconf/config.sub
trunk/contrib/libarchive/build/autoconf/install-sh
trunk/contrib/libarchive/build/autoconf/ltmain.sh
trunk/contrib/libarchive/build/autogen.sh
trunk/contrib/libarchive/build/cmake/config.h.in
trunk/contrib/libarchive/build/version
trunk/contrib/libarchive/cat/bsdcat.c
trunk/contrib/libarchive/cat/test/CMakeLists.txt
trunk/contrib/libarchive/cat/test/test.h
trunk/contrib/libarchive/cat/test/test_version.c
trunk/contrib/libarchive/config.h.in
trunk/contrib/libarchive/configure
trunk/contrib/libarchive/configure.ac
trunk/contrib/libarchive/cpio/cpio.c
trunk/contrib/libarchive/cpio/test/CMakeLists.txt
trunk/contrib/libarchive/cpio/test/test.h
trunk/contrib/libarchive/cpio/test/test_option_J_upper.c
trunk/contrib/libarchive/cpio/test/test_option_Z_upper.c
trunk/contrib/libarchive/cpio/test/test_option_a.c
trunk/contrib/libarchive/cpio/test/test_option_b64encode.c
trunk/contrib/libarchive/cpio/test/test_option_grzip.c
trunk/contrib/libarchive/cpio/test/test_option_lrzip.c
trunk/contrib/libarchive/cpio/test/test_option_lz4.c
trunk/contrib/libarchive/cpio/test/test_option_lzma.c
trunk/contrib/libarchive/cpio/test/test_option_lzop.c
trunk/contrib/libarchive/cpio/test/test_option_u.c
trunk/contrib/libarchive/cpio/test/test_option_uuencode.c
trunk/contrib/libarchive/cpio/test/test_option_version.c
trunk/contrib/libarchive/cpio/test/test_option_xz.c
trunk/contrib/libarchive/cpio/test/test_option_y.c
trunk/contrib/libarchive/cpio/test/test_option_z.c
trunk/contrib/libarchive/cpio/test/test_owner_parse.c
trunk/contrib/libarchive/doc/html/archive_entry.3.html
trunk/contrib/libarchive/doc/html/archive_entry_acl.3.html
trunk/contrib/libarchive/doc/html/archive_entry_linkify.3.html
trunk/contrib/libarchive/doc/html/archive_entry_paths.3.html
trunk/contrib/libarchive/doc/html/archive_entry_perms.3.html
trunk/contrib/libarchive/doc/html/archive_entry_stat.3.html
trunk/contrib/libarchive/doc/html/archive_entry_time.3.html
trunk/contrib/libarchive/doc/html/archive_read.3.html
trunk/contrib/libarchive/doc/html/archive_read_add_passphrase.3.html
trunk/contrib/libarchive/doc/html/archive_read_data.3.html
trunk/contrib/libarchive/doc/html/archive_read_disk.3.html
trunk/contrib/libarchive/doc/html/archive_read_extract.3.html
trunk/contrib/libarchive/doc/html/archive_read_filter.3.html
trunk/contrib/libarchive/doc/html/archive_read_format.3.html
trunk/contrib/libarchive/doc/html/archive_read_free.3.html
trunk/contrib/libarchive/doc/html/archive_read_header.3.html
trunk/contrib/libarchive/doc/html/archive_read_new.3.html
trunk/contrib/libarchive/doc/html/archive_read_open.3.html
trunk/contrib/libarchive/doc/html/archive_read_set_options.3.html
trunk/contrib/libarchive/doc/html/archive_util.3.html
trunk/contrib/libarchive/doc/html/archive_write.3.html
trunk/contrib/libarchive/doc/html/archive_write_blocksize.3.html
trunk/contrib/libarchive/doc/html/archive_write_data.3.html
trunk/contrib/libarchive/doc/html/archive_write_disk.3.html
trunk/contrib/libarchive/doc/html/archive_write_filter.3.html
trunk/contrib/libarchive/doc/html/archive_write_finish_entry.3.html
trunk/contrib/libarchive/doc/html/archive_write_format.3.html
trunk/contrib/libarchive/doc/html/archive_write_free.3.html
trunk/contrib/libarchive/doc/html/archive_write_header.3.html
trunk/contrib/libarchive/doc/html/archive_write_new.3.html
trunk/contrib/libarchive/doc/html/archive_write_open.3.html
trunk/contrib/libarchive/doc/html/archive_write_set_options.3.html
trunk/contrib/libarchive/doc/html/archive_write_set_passphrase.3.html
trunk/contrib/libarchive/doc/html/bsdcpio.1.html
trunk/contrib/libarchive/doc/html/bsdtar.1.html
trunk/contrib/libarchive/doc/html/cpio.5.html
trunk/contrib/libarchive/doc/html/libarchive-formats.5.html
trunk/contrib/libarchive/doc/html/libarchive.3.html
trunk/contrib/libarchive/doc/html/libarchive_changes.3.html
trunk/contrib/libarchive/doc/html/libarchive_internals.3.html
trunk/contrib/libarchive/doc/html/mtree.5.html
trunk/contrib/libarchive/doc/html/tar.5.html
trunk/contrib/libarchive/doc/man/archive_entry.3
trunk/contrib/libarchive/doc/man/archive_entry_acl.3
trunk/contrib/libarchive/doc/man/archive_entry_paths.3
trunk/contrib/libarchive/doc/man/archive_entry_perms.3
trunk/contrib/libarchive/doc/man/archive_read_disk.3
trunk/contrib/libarchive/doc/man/archive_read_format.3
trunk/contrib/libarchive/doc/man/archive_read_open.3
trunk/contrib/libarchive/doc/man/archive_write_data.3
trunk/contrib/libarchive/doc/man/archive_write_disk.3
trunk/contrib/libarchive/doc/man/archive_write_finish_entry.3
trunk/contrib/libarchive/doc/man/archive_write_open.3
trunk/contrib/libarchive/doc/man/bsdtar.1
trunk/contrib/libarchive/doc/man/libarchive-formats.5
trunk/contrib/libarchive/doc/man/libarchive_changes.3
trunk/contrib/libarchive/doc/man/mtree.5
trunk/contrib/libarchive/doc/man/tar.5
trunk/contrib/libarchive/doc/pdf/archive_entry.3.pdf
trunk/contrib/libarchive/doc/pdf/archive_entry_acl.3.pdf
trunk/contrib/libarchive/doc/pdf/archive_entry_linkify.3.pdf
trunk/contrib/libarchive/doc/pdf/archive_entry_paths.3.pdf
trunk/contrib/libarchive/doc/pdf/archive_entry_perms.3.pdf
trunk/contrib/libarchive/doc/pdf/archive_entry_stat.3.pdf
trunk/contrib/libarchive/doc/pdf/archive_entry_time.3.pdf
trunk/contrib/libarchive/doc/pdf/archive_read.3.pdf
trunk/contrib/libarchive/doc/pdf/archive_read_disk.3.pdf
trunk/contrib/libarchive/doc/pdf/archive_read_set_options.3.pdf
trunk/contrib/libarchive/doc/pdf/archive_util.3.pdf
trunk/contrib/libarchive/doc/pdf/archive_write.3.pdf
trunk/contrib/libarchive/doc/pdf/archive_write_disk.3.pdf
trunk/contrib/libarchive/doc/pdf/archive_write_set_options.3.pdf
trunk/contrib/libarchive/doc/pdf/bsdcpio.1.pdf
trunk/contrib/libarchive/doc/pdf/bsdtar.1.pdf
trunk/contrib/libarchive/doc/pdf/cpio.5.pdf
trunk/contrib/libarchive/doc/pdf/libarchive-formats.5.pdf
trunk/contrib/libarchive/doc/pdf/libarchive.3.pdf
trunk/contrib/libarchive/doc/pdf/libarchive_internals.3.pdf
trunk/contrib/libarchive/doc/pdf/mtree.5.pdf
trunk/contrib/libarchive/doc/pdf/tar.5.pdf
trunk/contrib/libarchive/doc/text/archive_entry.3.txt
trunk/contrib/libarchive/doc/text/archive_entry_acl.3.txt
trunk/contrib/libarchive/doc/text/archive_entry_paths.3.txt
trunk/contrib/libarchive/doc/text/archive_entry_perms.3.txt
trunk/contrib/libarchive/doc/text/archive_read_disk.3.txt
trunk/contrib/libarchive/doc/text/archive_read_open.3.txt
trunk/contrib/libarchive/doc/text/archive_write_data.3.txt
trunk/contrib/libarchive/doc/text/archive_write_disk.3.txt
trunk/contrib/libarchive/doc/text/archive_write_finish_entry.3.txt
trunk/contrib/libarchive/doc/text/archive_write_format.3.txt
trunk/contrib/libarchive/doc/text/archive_write_open.3.txt
trunk/contrib/libarchive/doc/text/bsdtar.1.txt
trunk/contrib/libarchive/doc/text/libarchive-formats.5.txt
trunk/contrib/libarchive/doc/text/libarchive_changes.3.txt
trunk/contrib/libarchive/doc/text/mtree.5.txt
trunk/contrib/libarchive/doc/text/tar.5.txt
trunk/contrib/libarchive/doc/wiki/ManPageArchiveEntryAcl3.wiki
trunk/contrib/libarchive/doc/wiki/ManPageArchiveEntryPaths3.wiki
trunk/contrib/libarchive/doc/wiki/ManPageArchiveEntryPerms3.wiki
trunk/contrib/libarchive/doc/wiki/ManPageArchiveReadDisk3.wiki
trunk/contrib/libarchive/doc/wiki/ManPageArchiveReadFormat3.wiki
trunk/contrib/libarchive/doc/wiki/ManPageArchiveReadOpen3.wiki
trunk/contrib/libarchive/doc/wiki/ManPageArchiveWriteData3.wiki
trunk/contrib/libarchive/doc/wiki/ManPageArchiveWriteDisk3.wiki
trunk/contrib/libarchive/doc/wiki/ManPageArchiveWriteFinishEntry3.wiki
trunk/contrib/libarchive/doc/wiki/ManPageArchiveWriteOpen3.wiki
trunk/contrib/libarchive/doc/wiki/ManPageBsdtar1.wiki
trunk/contrib/libarchive/doc/wiki/ManPageLibarchiveChanges3.wiki
trunk/contrib/libarchive/doc/wiki/ManPageLibarchiveFormats5.wiki
trunk/contrib/libarchive/doc/wiki/ManPageMtree5.wiki
trunk/contrib/libarchive/doc/wiki/ManPageTar5.wiki
trunk/contrib/libarchive/examples/minitar/minitar.c
trunk/contrib/libarchive/libarchive/CMakeLists.txt
trunk/contrib/libarchive/libarchive/archive.h
trunk/contrib/libarchive/libarchive/archive_acl.c
trunk/contrib/libarchive/libarchive/archive_acl_private.h
trunk/contrib/libarchive/libarchive/archive_check_magic.c
trunk/contrib/libarchive/libarchive/archive_cryptor.c
trunk/contrib/libarchive/libarchive/archive_cryptor_private.h
trunk/contrib/libarchive/libarchive/archive_digest.c
trunk/contrib/libarchive/libarchive/archive_digest_private.h
trunk/contrib/libarchive/libarchive/archive_entry.3
trunk/contrib/libarchive/libarchive/archive_entry.c
trunk/contrib/libarchive/libarchive/archive_entry.h
trunk/contrib/libarchive/libarchive/archive_entry_acl.3
trunk/contrib/libarchive/libarchive/archive_entry_locale.h
trunk/contrib/libarchive/libarchive/archive_entry_paths.3
trunk/contrib/libarchive/libarchive/archive_entry_perms.3
trunk/contrib/libarchive/libarchive/archive_entry_sparse.c
trunk/contrib/libarchive/libarchive/archive_entry_strmode.c
trunk/contrib/libarchive/libarchive/archive_getdate.c
trunk/contrib/libarchive/libarchive/archive_hmac.c
trunk/contrib/libarchive/libarchive/archive_hmac_private.h
trunk/contrib/libarchive/libarchive/archive_match.c
trunk/contrib/libarchive/libarchive/archive_options.c
trunk/contrib/libarchive/libarchive/archive_pack_dev.c
trunk/contrib/libarchive/libarchive/archive_platform.h
trunk/contrib/libarchive/libarchive/archive_random.c
trunk/contrib/libarchive/libarchive/archive_rb.c
trunk/contrib/libarchive/libarchive/archive_read.c
trunk/contrib/libarchive/libarchive/archive_read_append_filter.c
trunk/contrib/libarchive/libarchive/archive_read_disk.3
trunk/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c
trunk/contrib/libarchive/libarchive/archive_read_disk_posix.c
trunk/contrib/libarchive/libarchive/archive_read_disk_private.h
trunk/contrib/libarchive/libarchive/archive_read_disk_set_standard_lookup.c
trunk/contrib/libarchive/libarchive/archive_read_disk_windows.c
trunk/contrib/libarchive/libarchive/archive_read_extract2.c
trunk/contrib/libarchive/libarchive/archive_read_format.3
trunk/contrib/libarchive/libarchive/archive_read_open.3
trunk/contrib/libarchive/libarchive/archive_read_open_filename.c
trunk/contrib/libarchive/libarchive/archive_read_open_memory.c
trunk/contrib/libarchive/libarchive/archive_read_private.h
trunk/contrib/libarchive/libarchive/archive_read_support_filter_lz4.c
trunk/contrib/libarchive/libarchive/archive_read_support_filter_lzop.c
trunk/contrib/libarchive/libarchive/archive_read_support_filter_program.c
trunk/contrib/libarchive/libarchive/archive_read_support_filter_uu.c
trunk/contrib/libarchive/libarchive/archive_read_support_filter_xz.c
trunk/contrib/libarchive/libarchive/archive_read_support_format_7zip.c
trunk/contrib/libarchive/libarchive/archive_read_support_format_ar.c
trunk/contrib/libarchive/libarchive/archive_read_support_format_cab.c
trunk/contrib/libarchive/libarchive/archive_read_support_format_cpio.c
trunk/contrib/libarchive/libarchive/archive_read_support_format_iso9660.c
trunk/contrib/libarchive/libarchive/archive_read_support_format_lha.c
trunk/contrib/libarchive/libarchive/archive_read_support_format_mtree.c
trunk/contrib/libarchive/libarchive/archive_read_support_format_rar.c
trunk/contrib/libarchive/libarchive/archive_read_support_format_tar.c
trunk/contrib/libarchive/libarchive/archive_read_support_format_warc.c
trunk/contrib/libarchive/libarchive/archive_read_support_format_xar.c
trunk/contrib/libarchive/libarchive/archive_read_support_format_zip.c
trunk/contrib/libarchive/libarchive/archive_string.c
trunk/contrib/libarchive/libarchive/archive_string.h
trunk/contrib/libarchive/libarchive/archive_string_composition.h
trunk/contrib/libarchive/libarchive/archive_string_sprintf.c
trunk/contrib/libarchive/libarchive/archive_util.c
trunk/contrib/libarchive/libarchive/archive_windows.c
trunk/contrib/libarchive/libarchive/archive_windows.h
trunk/contrib/libarchive/libarchive/archive_write.c
trunk/contrib/libarchive/libarchive/archive_write_add_filter.c
trunk/contrib/libarchive/libarchive/archive_write_add_filter_by_name.c
trunk/contrib/libarchive/libarchive/archive_write_add_filter_lz4.c
trunk/contrib/libarchive/libarchive/archive_write_add_filter_program.c
trunk/contrib/libarchive/libarchive/archive_write_add_filter_xz.c
trunk/contrib/libarchive/libarchive/archive_write_data.3
trunk/contrib/libarchive/libarchive/archive_write_disk.3
trunk/contrib/libarchive/libarchive/archive_write_disk_posix.c
trunk/contrib/libarchive/libarchive/archive_write_disk_private.h
trunk/contrib/libarchive/libarchive/archive_write_disk_set_standard_lookup.c
trunk/contrib/libarchive/libarchive/archive_write_disk_windows.c
trunk/contrib/libarchive/libarchive/archive_write_finish_entry.3
trunk/contrib/libarchive/libarchive/archive_write_format.3
trunk/contrib/libarchive/libarchive/archive_write_open.3
trunk/contrib/libarchive/libarchive/archive_write_open_memory.c
trunk/contrib/libarchive/libarchive/archive_write_set_format.c
trunk/contrib/libarchive/libarchive/archive_write_set_format_7zip.c
trunk/contrib/libarchive/libarchive/archive_write_set_format_ar.c
trunk/contrib/libarchive/libarchive/archive_write_set_format_by_name.c
trunk/contrib/libarchive/libarchive/archive_write_set_format_cpio.c
trunk/contrib/libarchive/libarchive/archive_write_set_format_cpio_newc.c
trunk/contrib/libarchive/libarchive/archive_write_set_format_filter_by_ext.c
trunk/contrib/libarchive/libarchive/archive_write_set_format_gnutar.c
trunk/contrib/libarchive/libarchive/archive_write_set_format_iso9660.c
trunk/contrib/libarchive/libarchive/archive_write_set_format_mtree.c
trunk/contrib/libarchive/libarchive/archive_write_set_format_pax.c
trunk/contrib/libarchive/libarchive/archive_write_set_format_shar.c
trunk/contrib/libarchive/libarchive/archive_write_set_format_ustar.c
trunk/contrib/libarchive/libarchive/archive_write_set_format_v7tar.c
trunk/contrib/libarchive/libarchive/archive_write_set_format_warc.c
trunk/contrib/libarchive/libarchive/archive_write_set_format_xar.c
trunk/contrib/libarchive/libarchive/archive_write_set_format_zip.c
trunk/contrib/libarchive/libarchive/config_freebsd.h
trunk/contrib/libarchive/libarchive/libarchive-formats.5
trunk/contrib/libarchive/libarchive/libarchive_changes.3
trunk/contrib/libarchive/libarchive/mtree.5
trunk/contrib/libarchive/libarchive/tar.5
trunk/contrib/libarchive/libarchive/test/CMakeLists.txt
trunk/contrib/libarchive/libarchive/test/list.h
trunk/contrib/libarchive/libarchive/test/read_open_memory.c
trunk/contrib/libarchive/libarchive/test/test.h
trunk/contrib/libarchive/libarchive/test/test_acl_nfs4.c
trunk/contrib/libarchive/libarchive/test/test_acl_pax.c
trunk/contrib/libarchive/libarchive/test/test_acl_posix1e.c
trunk/contrib/libarchive/libarchive/test/test_archive_api_feature.c
trunk/contrib/libarchive/libarchive/test/test_archive_cmdline.c
trunk/contrib/libarchive/libarchive/test/test_archive_read_add_passphrase.c
trunk/contrib/libarchive/libarchive/test/test_archive_read_close_twice_open_filename.c
trunk/contrib/libarchive/libarchive/test/test_archive_string.c
trunk/contrib/libarchive/libarchive/test/test_compat_gtar.c
trunk/contrib/libarchive/libarchive/test/test_compat_solaris_tar_acl.c
trunk/contrib/libarchive/libarchive/test/test_compat_solaris_tar_acl.tar.uu
trunk/contrib/libarchive/libarchive/test/test_compat_uudecode.c
trunk/contrib/libarchive/libarchive/test/test_fuzz.c
trunk/contrib/libarchive/libarchive/test/test_pax_filename_encoding.c
trunk/contrib/libarchive/libarchive/test/test_read_disk.c
trunk/contrib/libarchive/libarchive/test/test_read_disk_directory_traversals.c
trunk/contrib/libarchive/libarchive/test/test_read_filter_lzop.c
trunk/contrib/libarchive/libarchive/test/test_read_filter_lzop_multiple_parts.c
trunk/contrib/libarchive/libarchive/test/test_read_format_7zip.c
trunk/contrib/libarchive/libarchive/test/test_read_format_cpio_afio.c
trunk/contrib/libarchive/libarchive/test/test_read_format_isorr_bz2.c
trunk/contrib/libarchive/libarchive/test/test_read_format_mtree.c
trunk/contrib/libarchive/libarchive/test/test_read_format_raw.c
trunk/contrib/libarchive/libarchive/test/test_read_format_zip.c
trunk/contrib/libarchive/libarchive/test/test_read_format_zip_comment_stored.c
trunk/contrib/libarchive/libarchive/test/test_read_format_zip_filename.c
trunk/contrib/libarchive/libarchive/test/test_read_format_zip_mac_metadata.c
trunk/contrib/libarchive/libarchive/test/test_read_format_zip_malformed.c
trunk/contrib/libarchive/libarchive/test/test_read_format_zip_nested.c
trunk/contrib/libarchive/libarchive/test/test_read_format_zip_padded.c
trunk/contrib/libarchive/libarchive/test/test_read_format_zip_sfx.c
trunk/contrib/libarchive/libarchive/test/test_read_format_zip_traditional_encryption_data.c
trunk/contrib/libarchive/libarchive/test/test_read_format_zip_winzip_aes.c
trunk/contrib/libarchive/libarchive/test/test_read_format_zip_winzip_aes_large.c
trunk/contrib/libarchive/libarchive/test/test_read_set_format.c
trunk/contrib/libarchive/libarchive/test/test_sparse_basic.c
trunk/contrib/libarchive/libarchive/test/test_write_disk_appledouble.c
trunk/contrib/libarchive/libarchive/test/test_write_filter_lz4.c
trunk/contrib/libarchive/libarchive/test/test_write_filter_lzop.c
trunk/contrib/libarchive/libarchive/test/test_write_format_iso9660.c
trunk/contrib/libarchive/libarchive/test/test_write_format_iso9660_zisofs.c
trunk/contrib/libarchive/libarchive/test/test_write_format_pax.c
trunk/contrib/libarchive/libarchive/test/test_write_format_xar_empty.c
trunk/contrib/libarchive/libarchive/test/test_write_format_zip_compression_store.c
trunk/contrib/libarchive/libarchive/test/test_write_format_zip_empty.c
trunk/contrib/libarchive/libarchive/test/test_write_format_zip_empty_zip64.c
trunk/contrib/libarchive/libarchive/test/test_write_format_zip_large.c
trunk/contrib/libarchive/libarchive/test/test_write_format_zip_zip64.c
trunk/contrib/libarchive/libarchive/xxhash.c
trunk/contrib/libarchive/tar/bsdtar.1
trunk/contrib/libarchive/tar/bsdtar.c
trunk/contrib/libarchive/tar/bsdtar.h
trunk/contrib/libarchive/tar/cmdline.c
trunk/contrib/libarchive/tar/creation_set.c
trunk/contrib/libarchive/tar/read.c
trunk/contrib/libarchive/tar/test/CMakeLists.txt
trunk/contrib/libarchive/tar/test/list.h
trunk/contrib/libarchive/tar/test/test.h
trunk/contrib/libarchive/tar/test/test_copy.c
trunk/contrib/libarchive/tar/test/test_leading_slash.c
trunk/contrib/libarchive/tar/test/test_missing_file.c
trunk/contrib/libarchive/tar/test/test_option_a.c
trunk/contrib/libarchive/tar/test/test_option_b.c
trunk/contrib/libarchive/tar/test/test_option_b64encode.c
trunk/contrib/libarchive/tar/test/test_option_gid_gname.c
trunk/contrib/libarchive/tar/test/test_option_grzip.c
trunk/contrib/libarchive/tar/test/test_option_j.c
trunk/contrib/libarchive/tar/test/test_option_lrzip.c
trunk/contrib/libarchive/tar/test/test_option_lz4.c
trunk/contrib/libarchive/tar/test/test_option_lzma.c
trunk/contrib/libarchive/tar/test/test_option_lzop.c
trunk/contrib/libarchive/tar/test/test_option_nodump.c
trunk/contrib/libarchive/tar/test/test_option_r.c
trunk/contrib/libarchive/tar/test/test_option_uid_uname.c
trunk/contrib/libarchive/tar/test/test_option_uuencode.c
trunk/contrib/libarchive/tar/test/test_option_xz.c
trunk/contrib/libarchive/tar/test/test_option_z.c
trunk/contrib/libarchive/tar/test/test_stdio.c
trunk/contrib/libarchive/tar/test/test_symlink_dir.c
trunk/contrib/libarchive/tar/test/test_version.c
trunk/contrib/libarchive/tar/test/test_windows.c
trunk/contrib/libarchive/tar/util.c
trunk/contrib/libarchive/tar/write.c
Added Paths:
-----------
trunk/contrib/libarchive/README.md
trunk/contrib/libarchive/contrib/android/
trunk/contrib/libarchive/libarchive/archive_disk_acl_darwin.c
trunk/contrib/libarchive/libarchive/archive_disk_acl_freebsd.c
trunk/contrib/libarchive/libarchive/archive_disk_acl_linux.c
trunk/contrib/libarchive/libarchive/archive_disk_acl_sunos.c
trunk/contrib/libarchive/libarchive/archive_openssl_evp_private.h
trunk/contrib/libarchive/libarchive/archive_openssl_hmac_private.h
trunk/contrib/libarchive/libarchive/archive_platform_acl.h
trunk/contrib/libarchive/libarchive/archive_platform_xattr.h
trunk/contrib/libarchive/libarchive/archive_version_details.c
trunk/contrib/libarchive/libarchive/test/test_acl_pax_nfs4.tar.uu
trunk/contrib/libarchive/libarchive/test/test_acl_pax_posix1e.tar.uu
trunk/contrib/libarchive/libarchive/test/test_acl_platform_nfs4.c
trunk/contrib/libarchive/libarchive/test/test_acl_platform_posix1e.c
trunk/contrib/libarchive/libarchive/test/test_acl_text.c
trunk/contrib/libarchive/libarchive/test/test_compat_gtar_2.tar.uu
trunk/contrib/libarchive/libarchive/test/test_compat_perl_archive_tar.c
trunk/contrib/libarchive/libarchive/test/test_compat_perl_archive_tar.tar.uu
trunk/contrib/libarchive/libarchive/test/test_compat_plexus_archiver_tar.c
trunk/contrib/libarchive/libarchive/test/test_compat_plexus_archiver_tar.tar.uu
trunk/contrib/libarchive/libarchive/test/test_compat_star_acl.c
trunk/contrib/libarchive/libarchive/test/test_compat_star_acl_nfs4.tar.uu
trunk/contrib/libarchive/libarchive/test/test_compat_star_acl_posix1e.tar.uu
trunk/contrib/libarchive/libarchive/test/test_read_format_raw.bufr.uu
trunk/contrib/libarchive/libarchive/test/test_read_format_zip_jar.c
trunk/contrib/libarchive/libarchive/test/test_read_format_zip_jar.jar.uu
trunk/contrib/libarchive/libarchive/test/test_read_format_zip_with_invalid_traditional_eocd.c
trunk/contrib/libarchive/libarchive/test/test_read_format_zip_with_invalid_traditional_eocd.zip.uu
trunk/contrib/libarchive/libarchive/test/test_read_pax_schily_xattr.c
trunk/contrib/libarchive/libarchive/test/test_read_pax_schily_xattr.tar.uu
trunk/contrib/libarchive/libarchive/test/test_xattr_platform.c
trunk/contrib/libarchive/tar/test/test_option_acls.c
trunk/contrib/libarchive/tar/test/test_option_fflags.c
trunk/contrib/libarchive/tar/test/test_option_xattrs.c
trunk/contrib/libarchive/test_utils/test_common.h
trunk/contrib/libarchive/test_utils/test_main.c
Removed Paths:
-------------
trunk/contrib/libarchive/README
trunk/contrib/libarchive/build/cmake/CheckStructMember.cmake
trunk/contrib/libarchive/build/cmake/FindLZMA.cmake
trunk/contrib/libarchive/libarchive/test/test_acl_pax.tar.uu
Property Changed:
----------------
trunk/contrib/libarchive/
trunk/contrib/libarchive/doc/pdf/archive_entry.3.pdf
trunk/contrib/libarchive/doc/pdf/archive_entry_acl.3.pdf
trunk/contrib/libarchive/doc/pdf/archive_entry_linkify.3.pdf
trunk/contrib/libarchive/doc/pdf/archive_entry_paths.3.pdf
trunk/contrib/libarchive/doc/pdf/archive_entry_perms.3.pdf
trunk/contrib/libarchive/doc/pdf/archive_entry_stat.3.pdf
trunk/contrib/libarchive/doc/pdf/archive_entry_time.3.pdf
trunk/contrib/libarchive/doc/pdf/archive_read.3.pdf
trunk/contrib/libarchive/doc/pdf/archive_read_disk.3.pdf
trunk/contrib/libarchive/doc/pdf/archive_read_set_options.3.pdf
trunk/contrib/libarchive/doc/pdf/archive_util.3.pdf
trunk/contrib/libarchive/doc/pdf/archive_write.3.pdf
trunk/contrib/libarchive/doc/pdf/archive_write_disk.3.pdf
trunk/contrib/libarchive/doc/pdf/archive_write_set_options.3.pdf
trunk/contrib/libarchive/doc/pdf/bsdcpio.1.pdf
trunk/contrib/libarchive/doc/pdf/bsdtar.1.pdf
trunk/contrib/libarchive/doc/pdf/cpio.5.pdf
trunk/contrib/libarchive/doc/pdf/libarchive-formats.5.pdf
trunk/contrib/libarchive/doc/pdf/libarchive.3.pdf
trunk/contrib/libarchive/doc/pdf/libarchive_internals.3.pdf
trunk/contrib/libarchive/doc/pdf/mtree.5.pdf
trunk/contrib/libarchive/doc/pdf/tar.5.pdf
Index: trunk/contrib/libarchive
===================================================================
--- trunk/contrib/libarchive 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive 2018-06-19 20:42:35 UTC (rev 11134)
Property changes on: trunk/contrib/libarchive
___________________________________________________________________
Modified: svn:mergeinfo
## -1,2 +1,2 ##
/branches/KIENTZLE/contrib/libarchive:4569-6386
-/vendor/libarchive/dist:6387-9169
\ No newline at end of property
+/vendor/libarchive/dist:6387-11133
\ No newline at end of property
Modified: trunk/contrib/libarchive/CMakeLists.txt
===================================================================
--- trunk/contrib/libarchive/CMakeLists.txt 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/CMakeLists.txt 2018-06-19 20:42:35 UTC (rev 11134)
@@ -15,7 +15,7 @@
# RelWithDebInfo : Release build with Debug Info
# MinSizeRel : Release Min Size build
IF(NOT CMAKE_BUILD_TYPE)
- SET(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Build Type" FORCE)
+ SET(CMAKE_BUILD_TYPE "Release" CACHE STRING "Build Type" FORCE)
ENDIF(NOT CMAKE_BUILD_TYPE)
# Set a value type to properly display CMAKE_BUILD_TYPE on GUI if the
# value type is "UNINITIALIZED".
@@ -44,13 +44,13 @@
#
FILE(STRINGS ${CMAKE_CURRENT_SOURCE_DIR}/build/version _version)
STRING(REGEX REPLACE
- "^([0-9])[0-9][0-9][0-9][0-9][0-9][0-9][a-z]?$" "\\1" _major ${_version})
+ "^([0-9])[0-9][0-9][0-9][0-9][0-9][0-9][a-z]*$" "\\1" _major ${_version})
STRING(REGEX REPLACE
- "^[0-9]([0-9][0-9][0-9])[0-9][0-9][0-9][a-z]?$" "\\1" _minor ${_version})
+ "^[0-9]([0-9][0-9][0-9])[0-9][0-9][0-9][a-z]*$" "\\1" _minor ${_version})
STRING(REGEX REPLACE
- "^[0-9][0-9][0-9][0-9]([0-9][0-9][0-9])[a-z]?$" "\\1" _revision ${_version})
+ "^[0-9][0-9][0-9][0-9]([0-9][0-9][0-9])[a-z]*$" "\\1" _revision ${_version})
STRING(REGEX REPLACE
- "^[0-9][0-9][0-9][0-9][0-9][0-9][0-9]([a-z]?)$" "\\1" _quality ${_version})
+ "^[0-9][0-9][0-9][0-9][0-9][0-9][0-9]([a-z]*)$" "\\1" _quality ${_version})
SET(_version_number ${_major}${_minor}${_revision})
STRING(REGEX REPLACE "[0]*([^0]*[0-9])$" "\\1" _trimmed_minor ${_minor})
STRING(REGEX REPLACE "[0]*([^0]*[0-9])$" "\\1" _trimmed_revision ${_revision})
@@ -179,13 +179,15 @@
OPTION(ENABLE_NETTLE "Enable use of Nettle" ON)
OPTION(ENABLE_OPENSSL "Enable use of OpenSSL" ON)
-OPTION(ENABLE_LZMA "Enable the use of the system found LZMA library if found" ON)
-OPTION(ENABLE_ZLIB "Enable the use of the system found ZLIB library if found" ON)
-OPTION(ENABLE_BZip2 "Enable the use of the system found BZip2 library if found" ON)
-OPTION(ENABLE_LIBXML2 "Enable the use of the system found libxml2 library if found" ON)
-OPTION(ENABLE_EXPAT "Enable the use of the system found EXPAT library if found" ON)
-OPTION(ENABLE_PCREPOSIX "Enable the use of the system found PCREPOSIX library if found" ON)
-OPTION(ENABLE_LibGCC "Enable the use of the system found LibGCC library if found" ON)
+OPTION(ENABLE_LZO "Enable the use of the system LZO library if found" OFF)
+OPTION(ENABLE_LZMA "Enable the use of the system LZMA library if found" ON)
+
+OPTION(ENABLE_ZLIB "Enable the use of the system ZLIB library if found" ON)
+OPTION(ENABLE_BZip2 "Enable the use of the system BZip2 library if found" ON)
+OPTION(ENABLE_LIBXML2 "Enable the use of the system libxml2 library if found" ON)
+OPTION(ENABLE_EXPAT "Enable the use of the system EXPAT library if found" ON)
+OPTION(ENABLE_PCREPOSIX "Enable the use of the system PCREPOSIX library if found" ON)
+OPTION(ENABLE_LibGCC "Enable the use of the system LibGCC library if found" ON)
# CNG is used for encrypt/decrypt Zip archives on Windows.
OPTION(ENABLE_CNG "Enable the use of CNG(Crypto Next Generation)" ON)
@@ -274,7 +276,7 @@
INCLUDE(CheckIncludeFile)
INCLUDE(CheckIncludeFiles)
INCLUDE(CheckLibraryExists)
-INCLUDE(CheckStructMember)
+INCLUDE(CheckStructHasMember)
INCLUDE(CheckSymbolExists)
INCLUDE(CheckTypeExists)
INCLUDE(CheckTypeSize)
@@ -452,20 +454,21 @@
# Find LZMA
#
IF(ENABLE_LZMA)
- FIND_PACKAGE(LZMA)
+ FIND_PACKAGE(LibLZMA)
ELSE()
- SET(LZMA_FOUND FALSE) # Override cached value
- SET(LZMADEC_FOUND FALSE) # Override cached value
+ SET(LIBZMA_FOUND FALSE) # Override cached value
ENDIF()
-IF(LZMA_FOUND)
+IF(LIBLZMA_FOUND)
SET(HAVE_LIBLZMA 1)
SET(HAVE_LZMA_H 1)
- INCLUDE_DIRECTORIES(${LZMA_INCLUDE_DIR})
- LIST(APPEND ADDITIONAL_LIBS ${LZMA_LIBRARIES})
+ SET(CMAKE_REQUIRED_INCLUDES ${LIBLZMA_INCLUDE_DIR})
+ SET(CMAKE_REQUIRED_LIBRARIES ${LIBLZMA_LIBRARIES})
+ INCLUDE_DIRECTORIES(${LIBLZMA_INCLUDE_DIRS})
+ LIST(APPEND ADDITIONAL_LIBS ${LIBLZMA_LIBRARIES})
# Test if a macro is needed for the library.
TRY_MACRO_FOR_LIBRARY(
- "${LZMA_INCLUDE_DIR}" "${LZMA_LIBRARIES}"
+ "${LIBLZMA_INCLUDE_DIRS}" "${LIBLZMA_LIBRARIES}"
COMPILES
"#include <lzma.h>\nint main() {return (int)lzma_version_number(); }"
"WITHOUT_LZMA_API_STATIC;LZMA_API_STATIC")
@@ -472,26 +475,25 @@
IF(NOT WITHOUT_LZMA_API_STATIC AND LZMA_API_STATIC)
ADD_DEFINITIONS(-DLZMA_API_STATIC)
ENDIF(NOT WITHOUT_LZMA_API_STATIC AND LZMA_API_STATIC)
-ELSEIF(LZMADEC_FOUND)
- SET(HAVE_LIBLZMADEC 1)
- SET(HAVE_LZMADEC_H 1)
- INCLUDE_DIRECTORIES(${LZMADEC_INCLUDE_DIR})
- LIST(APPEND ADDITIONAL_LIBS ${LZMADEC_LIBRARIES})
-ELSE(LZMA_FOUND)
+ELSE(LIBLZMA_FOUND)
# LZMA not found and will not be used.
-ENDIF(LZMA_FOUND)
+ENDIF(LIBLZMA_FOUND)
#
# Find LZO2
#
-IF (LZO2_INCLUDE_DIR)
- # Already in cache, be silent
- SET(LZO2_FIND_QUIETLY TRUE)
-ENDIF (LZO2_INCLUDE_DIR)
+IF(ENABLE_LZO)
+ IF (LZO2_INCLUDE_DIR)
+ # Already in cache, be silent
+ SET(LZO2_FIND_QUIETLY TRUE)
+ ENDIF (LZO2_INCLUDE_DIR)
-FIND_PATH(LZO2_INCLUDE_DIR lzo/lzoconf.h)
-FIND_LIBRARY(LZO2_LIBRARY NAMES lzo2 liblzo2)
-INCLUDE(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(LZO2 DEFAULT_MSG LZO2_LIBRARY LZO2_INCLUDE_DIR)
+ FIND_PATH(LZO2_INCLUDE_DIR lzo/lzoconf.h)
+ FIND_LIBRARY(LZO2_LIBRARY NAMES lzo2 liblzo2)
+ INCLUDE(FindPackageHandleStandardArgs)
+ FIND_PACKAGE_HANDLE_STANDARD_ARGS(LZO2 DEFAULT_MSG LZO2_LIBRARY LZO2_INCLUDE_DIR)
+ELSE(ENABLE_LZO)
+ SET(LIBZMA_FOUND FALSE) # Override cached value
+ENDIF(ENABLE_LZO)
IF(LZO2_FOUND)
SET(HAVE_LIBLZO2 1)
SET(HAVE_LZO_LZOCONF_H 1)
@@ -550,6 +552,7 @@
# Alphabetize the rest unless there's a compelling reason
LA_CHECK_INCLUDE_FILE("acl/libacl.h" HAVE_ACL_LIBACL_H)
+LA_CHECK_INCLUDE_FILE("attr/xattr.h" HAVE_ATTR_XATTR_H)
LA_CHECK_INCLUDE_FILE("ctype.h" HAVE_CTYPE_H)
LA_CHECK_INCLUDE_FILE("copyfile.h" HAVE_COPYFILE_H)
LA_CHECK_INCLUDE_FILE("direct.h" HAVE_DIRECT_H)
@@ -570,8 +573,14 @@
LA_CHECK_INCLUDE_FILE("linux/types.h" HAVE_LINUX_TYPES_H)
LA_CHECK_INCLUDE_FILE("linux/fiemap.h" HAVE_LINUX_FIEMAP_H)
LA_CHECK_INCLUDE_FILE("linux/fs.h" HAVE_LINUX_FS_H)
+
+CHECK_C_SOURCE_COMPILES("#include <sys/ioctl.h>
+#include <linux/fs.h>
+int main(void) { return FS_IOC_GETFLAGS; }" HAVE_WORKING_FS_IOC_GETFLAGS)
+
LA_CHECK_INCLUDE_FILE("linux/magic.h" HAVE_LINUX_MAGIC_H)
LA_CHECK_INCLUDE_FILE("locale.h" HAVE_LOCALE_H)
+LA_CHECK_INCLUDE_FILE("membership.h" HAVE_MEMBERSHIP_H)
LA_CHECK_INCLUDE_FILE("memory.h" HAVE_MEMORY_H)
LA_CHECK_INCLUDE_FILE("paths.h" HAVE_PATHS_H)
LA_CHECK_INCLUDE_FILE("poll.h" HAVE_POLL_H)
@@ -589,11 +598,13 @@
LA_CHECK_INCLUDE_FILE("strings.h" HAVE_STRINGS_H)
LA_CHECK_INCLUDE_FILE("sys/acl.h" HAVE_SYS_ACL_H)
LA_CHECK_INCLUDE_FILE("sys/cdefs.h" HAVE_SYS_CDEFS_H)
+LA_CHECK_INCLUDE_FILE("sys/extattr.h" HAVE_SYS_EXTATTR_H)
LA_CHECK_INCLUDE_FILE("sys/ioctl.h" HAVE_SYS_IOCTL_H)
LA_CHECK_INCLUDE_FILE("sys/mkdev.h" HAVE_SYS_MKDEV_H)
LA_CHECK_INCLUDE_FILE("sys/mount.h" HAVE_SYS_MOUNT_H)
LA_CHECK_INCLUDE_FILE("sys/param.h" HAVE_SYS_PARAM_H)
LA_CHECK_INCLUDE_FILE("sys/poll.h" HAVE_SYS_POLL_H)
+LA_CHECK_INCLUDE_FILE("sys/richacl.h" HAVE_SYS_RICHACL_H)
LA_CHECK_INCLUDE_FILE("sys/select.h" HAVE_SYS_SELECT_H)
LA_CHECK_INCLUDE_FILE("sys/stat.h" HAVE_SYS_STAT_H)
LA_CHECK_INCLUDE_FILE("sys/statfs.h" HAVE_SYS_STATFS_H)
@@ -603,6 +614,7 @@
LA_CHECK_INCLUDE_FILE("sys/utsname.h" HAVE_SYS_UTSNAME_H)
LA_CHECK_INCLUDE_FILE("sys/vfs.h" HAVE_SYS_VFS_H)
LA_CHECK_INCLUDE_FILE("sys/wait.h" HAVE_SYS_WAIT_H)
+LA_CHECK_INCLUDE_FILE("sys/xattr.h" HAVE_SYS_XATTR_H)
LA_CHECK_INCLUDE_FILE("time.h" HAVE_TIME_H)
LA_CHECK_INCLUDE_FILE("unistd.h" HAVE_UNISTD_H)
LA_CHECK_INCLUDE_FILE("utime.h" HAVE_UTIME_H)
@@ -611,10 +623,13 @@
LA_CHECK_INCLUDE_FILE("windows.h" HAVE_WINDOWS_H)
IF(ENABLE_CNG)
LA_CHECK_INCLUDE_FILE("Bcrypt.h" HAVE_BCRYPT_H)
+ IF(HAVE_BCRYPT_H)
+ LIST(APPEND ADDITIONAL_LIBS "Bcrypt")
+ ENDIF(HAVE_BCRYPT_H)
ELSE(ENABLE_CNG)
UNSET(HAVE_BCRYPT_H CACHE)
ENDIF(ENABLE_CNG)
-# Following files need windwos.h, so we should test it after windows.h test.
+# Following files need windows.h, so we should test it after windows.h test.
LA_CHECK_INCLUDE_FILE("wincrypt.h" HAVE_WINCRYPT_H)
LA_CHECK_INCLUDE_FILE("winioctl.h" HAVE_WINIOCTL_H)
@@ -1188,7 +1203,6 @@
CHECK_FUNCTION_EXISTS_GLIBC(chown HAVE_CHOWN)
CHECK_FUNCTION_EXISTS_GLIBC(chroot HAVE_CHROOT)
CHECK_FUNCTION_EXISTS_GLIBC(ctime_r HAVE_CTIME_R)
-CHECK_FUNCTION_EXISTS_GLIBC(dirfd HAVE_DIRFD)
CHECK_FUNCTION_EXISTS_GLIBC(fchdir HAVE_FCHDIR)
CHECK_FUNCTION_EXISTS_GLIBC(fchflags HAVE_FCHFLAGS)
CHECK_FUNCTION_EXISTS_GLIBC(fchmod HAVE_FCHMOD)
@@ -1274,6 +1288,14 @@
CMAKE_POP_CHECK_STATE() # Restore the state of the variables
+CHECK_C_SOURCE_COMPILES(
+ "#include <sys/types.h>\n#include <sys/mount.h>\nint main(void) { struct vfsconf v; return sizeof(v);}"
+ HAVE_STRUCT_VFSCONF)
+
+CHECK_C_SOURCE_COMPILES(
+ "#include <sys/types.h>\n#include <sys/mount.h>\nint main(void) { struct xvfsconf v; return sizeof(v);}"
+ HAVE_STRUCT_XVFSCONF)
+
# Make sure we have the POSIX version of readdir_r, not the
# older 2-argument version.
CHECK_C_SOURCE_COMPILES(
@@ -1280,6 +1302,10 @@
"#include <dirent.h>\nint main() {DIR *d = opendir(\".\"); struct dirent e,*r; return readdir_r(d,&e,&r);}"
HAVE_READDIR_R)
+# dirfd can be either a function or a macro.
+CHECK_C_SOURCE_COMPILES(
+ "#include <dirent.h>\nint main() {DIR *d = opendir(\".\"); return dirfd(d);}"
+ HAVE_DIRFD)
# Only detect readlinkat() if we also have AT_FDCWD in unistd.h.
# NOTE: linux requires fcntl.h for AT_FDCWD.
@@ -1299,6 +1325,10 @@
"#include <sys/sysmacros.h>\nint main() { return major(256); }"
MAJOR_IN_SYSMACROS)
+CHECK_C_SOURCE_COMPILES(
+ "#include <lzma.h>\n#if LZMA_VERSION < 50020000\n#error unsupported\n#endif\nint main(void){lzma_stream_encoder_mt(0, 0); return 0;}"
+ HAVE_LZMA_STREAM_ENCODER_MT)
+
IF(HAVE_STRERROR_R)
SET(HAVE_DECL_STRERROR_R 1)
ENDIF(HAVE_STRERROR_R)
@@ -1332,47 +1362,47 @@
# Check struct members
#
# Check for tm_gmtoff in struct tm
-CHECK_STRUCT_MEMBER("struct tm" tm_gmtoff
+CHECK_STRUCT_HAS_MEMBER("struct tm" tm_gmtoff
"time.h" HAVE_STRUCT_TM_TM_GMTOFF)
-CHECK_STRUCT_MEMBER("struct tm" __tm_gmtoff
+CHECK_STRUCT_HAS_MEMBER("struct tm" __tm_gmtoff
"time.h" HAVE_STRUCT_TM___TM_GMTOFF)
# Check for f_namemax in struct statfs
-CHECK_STRUCT_MEMBER("struct statfs" f_namemax
+CHECK_STRUCT_HAS_MEMBER("struct statfs" f_namemax
"sys/param.h;sys/mount.h" HAVE_STRUCT_STATFS_F_NAMEMAX)
# Check for birthtime in struct stat
-CHECK_STRUCT_MEMBER("struct stat" st_birthtime
+CHECK_STRUCT_HAS_MEMBER("struct stat" st_birthtime
"sys/types.h;sys/stat.h" HAVE_STRUCT_STAT_ST_BIRTHTIME)
# Check for high-resolution timestamps in struct stat
-CHECK_STRUCT_MEMBER("struct stat" st_birthtimespec.tv_nsec
+CHECK_STRUCT_HAS_MEMBER("struct stat" st_birthtimespec.tv_nsec
"sys/types.h;sys/stat.h" HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC)
-CHECK_STRUCT_MEMBER("struct stat" st_mtimespec.tv_nsec
+CHECK_STRUCT_HAS_MEMBER("struct stat" st_mtimespec.tv_nsec
"sys/types.h;sys/stat.h" HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC)
-CHECK_STRUCT_MEMBER("struct stat" st_mtim.tv_nsec
+CHECK_STRUCT_HAS_MEMBER("struct stat" st_mtim.tv_nsec
"sys/types.h;sys/stat.h" HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC)
-CHECK_STRUCT_MEMBER("struct stat" st_mtime_n
+CHECK_STRUCT_HAS_MEMBER("struct stat" st_mtime_n
"sys/types.h;sys/stat.h" HAVE_STRUCT_STAT_ST_MTIME_N)
-CHECK_STRUCT_MEMBER("struct stat" st_umtime
+CHECK_STRUCT_HAS_MEMBER("struct stat" st_umtime
"sys/types.h;sys/stat.h" HAVE_STRUCT_STAT_ST_UMTIME)
-CHECK_STRUCT_MEMBER("struct stat" st_mtime_usec
+CHECK_STRUCT_HAS_MEMBER("struct stat" st_mtime_usec
"sys/types.h;sys/stat.h" HAVE_STRUCT_STAT_ST_MTIME_USEC)
# Check for block size support in struct stat
-CHECK_STRUCT_MEMBER("struct stat" st_blksize
+CHECK_STRUCT_HAS_MEMBER("struct stat" st_blksize
"sys/types.h;sys/stat.h" HAVE_STRUCT_STAT_ST_BLKSIZE)
# Check for st_flags in struct stat (BSD fflags)
-CHECK_STRUCT_MEMBER("struct stat" st_flags
+CHECK_STRUCT_HAS_MEMBER("struct stat" st_flags
"sys/types.h;sys/stat.h" HAVE_STRUCT_STAT_ST_FLAGS)
IF(HAVE_SYS_STATVFS_H)
- CHECK_STRUCT_MEMBER("struct statvfs" f_iosize
+ CHECK_STRUCT_HAS_MEMBER("struct statvfs" f_iosize
"sys/types.h;sys/statvfs.h" HAVE_STRUCT_STATVFS_F_IOSIZE)
ENDIF()
#
#
-CHECK_STRUCT_MEMBER("struct tm" tm_sec
+CHECK_STRUCT_HAS_MEMBER("struct tm" tm_sec
"sys/types.h;sys/time.h;time.h" TIME_WITH_SYS_TIME)
#
@@ -1508,60 +1538,105 @@
# Check for Extended Attribute libraries, headers, and functions
#
IF(ENABLE_XATTR)
- LA_CHECK_INCLUDE_FILE(attr/xattr.h HAVE_ATTR_XATTR_H)
- LA_CHECK_INCLUDE_FILE(sys/xattr.h HAVE_SYS_XATTR_H)
- LA_CHECK_INCLUDE_FILE(sys/extattr.h HAVE_SYS_EXTATTR_H)
CHECK_LIBRARY_EXISTS(attr "setxattr" "" HAVE_LIBATTR)
IF(HAVE_LIBATTR)
SET(CMAKE_REQUIRED_LIBRARIES "attr")
ENDIF(HAVE_LIBATTR)
CHECK_SYMBOL_EXISTS(EXTATTR_NAMESPACE_USER "sys/types.h;sys/extattr.h" HAVE_DECL_EXTATTR_NAMESPACE_USER)
- CHECK_FUNCTION_EXISTS_GLIBC(extattr_get_file HAVE_EXTATTR_GET_FILE)
- CHECK_FUNCTION_EXISTS_GLIBC(extattr_list_file HAVE_EXTATTR_LIST_FILE)
- CHECK_FUNCTION_EXISTS_GLIBC(extattr_set_fd HAVE_EXTATTR_SET_FD)
- CHECK_FUNCTION_EXISTS_GLIBC(extattr_set_file HAVE_EXTATTR_SET_FILE)
- CHECK_FUNCTION_EXISTS_GLIBC(fgetxattr HAVE_FGETXATTR)
- CHECK_FUNCTION_EXISTS_GLIBC(flistxattr HAVE_FLISTXATTR)
- CHECK_FUNCTION_EXISTS_GLIBC(fsetxattr HAVE_FSETXATTR)
- CHECK_FUNCTION_EXISTS_GLIBC(getxattr HAVE_GETXATTR)
- CHECK_FUNCTION_EXISTS_GLIBC(lgetxattr HAVE_LGETXATTR)
- CHECK_FUNCTION_EXISTS_GLIBC(listxattr HAVE_LISTXATTR)
- CHECK_FUNCTION_EXISTS_GLIBC(llistxattr HAVE_LLISTXATTR)
- CHECK_FUNCTION_EXISTS_GLIBC(lsetxattr HAVE_LSETXATTR)
- CHECK_FUNCTION_EXISTS_GLIBC(fgetea HAVE_FGETEA)
- CHECK_FUNCTION_EXISTS_GLIBC(flistea HAVE_FLISTEA)
- CHECK_FUNCTION_EXISTS_GLIBC(fsetea HAVE_FSETEA)
- CHECK_FUNCTION_EXISTS_GLIBC(getea HAVE_GETEA)
- CHECK_FUNCTION_EXISTS_GLIBC(lgetea HAVE_LGETEA)
- CHECK_FUNCTION_EXISTS_GLIBC(listea HAVE_LISTEA)
- CHECK_FUNCTION_EXISTS_GLIBC(llistea HAVE_LLISTEA)
- CHECK_FUNCTION_EXISTS_GLIBC(lsetea HAVE_LSETEA)
+ CHECK_SYMBOL_EXISTS(XATTR_NOFOLLOW "sys/xattr.h" HAVE_DECL_XATTR_NOFOLLOW)
+ IF(HAVE_SYS_XATTR_H AND HAVE_DECL_XATTR_NOFOLLOW)
+ CHECK_FUNCTION_EXISTS(fgetxattr HAVE_FGETXATTR)
+ CHECK_FUNCTION_EXISTS(flistxattr HAVE_FLISTXATTR)
+ CHECK_FUNCTION_EXISTS(fsetxattr HAVE_FSETXATTR)
+ CHECK_FUNCTION_EXISTS(getxattr HAVE_GETXATTR)
+ CHECK_FUNCTION_EXISTS(listxattr HAVE_LISTXATTR)
+ CHECK_FUNCTION_EXISTS(setxattr HAVE_SETXATTR)
+ IF(HAVE_FGETXATTR AND
+ HAVE_FLISTXATTR AND
+ HAVE_FSETXATTR AND
+ HAVE_GETXATTR AND
+ HAVE_LISTXATTR AND
+ HAVE_SETXATTR)
+ SET(ARCHIVE_XATTR_DARWIN TRUE)
+ ENDIF()
+ ELSEIF(HAVE_SYS_EXTATTR_H AND HAVE_DECL_EXTATTR_NAMESPACE_USER)
+ # FreeBSD xattr support
+ CHECK_FUNCTION_EXISTS(extattr_get_fd HAVE_EXTATTR_GET_FD)
+ CHECK_FUNCTION_EXISTS(extattr_get_file HAVE_EXTATTR_GET_FILE)
+ CHECK_FUNCTION_EXISTS(extattr_get_link HAVE_EXTATTR_GET_LINK)
+ CHECK_FUNCTION_EXISTS(extattr_list_fd HAVE_EXTATTR_LIST_FD)
+ CHECK_FUNCTION_EXISTS(extattr_list_file HAVE_EXTATTR_LIST_FILE)
+ CHECK_FUNCTION_EXISTS(extattr_list_link HAVE_EXTATTR_LIST_LINK)
+ CHECK_FUNCTION_EXISTS(extattr_set_fd HAVE_EXTATTR_SET_FD)
+ CHECK_FUNCTION_EXISTS(extattr_set_link HAVE_EXTATTR_SET_LINK)
+ IF(HAVE_EXTATTR_GET_FD AND
+ HAVE_EXTATTR_GET_FILE AND
+ HAVE_EXTATTR_GET_LINK AND
+ HAVE_EXTATTR_LIST_FD AND
+ HAVE_EXTATTR_LIST_FILE AND
+ HAVE_EXTATTR_LIST_LINK AND
+ HAVE_EXTATTR_SET_FD AND
+ HAVE_EXTATTR_SET_LINK)
+ SET(ARCHIVE_XATTR_FREEBSD TRUE)
+ ENDIF()
+ ELSEIF(HAVE_SYS_XATTR_H OR HAVE_ATTR_XATTR_H)
+ # Linux xattr support
+ CHECK_FUNCTION_EXISTS_GLIBC(fgetxattr HAVE_FGETXATTR)
+ CHECK_FUNCTION_EXISTS_GLIBC(flistxattr HAVE_FLISTXATTR)
+ CHECK_FUNCTION_EXISTS_GLIBC(fsetxattr HAVE_FSETXATTR)
+ CHECK_FUNCTION_EXISTS_GLIBC(getxattr HAVE_GETXATTR)
+ CHECK_FUNCTION_EXISTS_GLIBC(lgetxattr HAVE_LGETXATTR)
+ CHECK_FUNCTION_EXISTS_GLIBC(listxattr HAVE_LISTXATTR)
+ CHECK_FUNCTION_EXISTS_GLIBC(llistxattr HAVE_LLISTXATTR)
+ CHECK_FUNCTION_EXISTS_GLIBC(lsetxattr HAVE_LSETXATTR)
+ IF(HAVE_FGETXATTR AND
+ HAVE_FLISTXATTR AND
+ HAVE_FSETXATTR AND
+ HAVE_GETXATTR AND
+ HAVE_LGETXATTR AND
+ HAVE_LISTXATTR AND
+ HAVE_LLISTXATTR AND
+ HAVE_LSETXATTR)
+ SET(ARCHIVE_XATTR_LINUX TRUE)
+ ENDIF()
+ ELSEIF(HAVE_SYS_EA_H)
+ # AIX xattr support
+ CHECK_FUNCTION_EXISTS(fgetea HAVE_FGETEA)
+ CHECK_FUNCTION_EXISTS(flistea HAVE_FLISTEA)
+ CHECK_FUNCTION_EXISTS(fsetea HAVE_FSETEA)
+ CHECK_FUNCTION_EXISTS(getea HAVE_GETEA)
+ CHECK_FUNCTION_EXISTS(lgetea HAVE_LGETEA)
+ CHECK_FUNCTION_EXISTS(listea HAVE_LISTEA)
+ CHECK_FUNCTION_EXISTS(llistea HAVE_LLISTEA)
+ CHECK_FUNCTION_EXISTS(lsetea HAVE_LSETEA)
+ IF(HAVE_FGETEA AND
+ HAVE_FLISTEA AND
+ HAVE_FSETEA AND
+ HAVE_GETEA AND
+ HAVE_LGETEA AND
+ HAVE_LISTEA AND
+ HAVE_LLISTEA AND
+ HAVE_LSETEA)
+ SET(ARCHIVE_XATTR_AIX TRUE)
+ ENDIF()
+ ENDIF()
+
+ IF(ARCHIVE_XATTR_DARWIN)
+ MESSAGE(STATUS "Extended attributes support: Darwin")
+ ELSEIF(ARCHIVE_XATTR_FREEBSD)
+ MESSAGE(STATUS "Extended attributes support: FreeBSD")
+ ELSEIF(ARCHIVE_XATTR_LINUX)
+ MESSAGE(STATUS "Extended attributes support: Linux")
+ ELSEIF(ARCHIVE_XATTR_AIX)
+ MESSAGE(STATUS "Extended attributes support: AIX")
+ ELSE()
+ MESSAGE(STATUS "Extended attributes support: none")
+ ENDIF()
ELSE(ENABLE_XATTR)
- SET(HAVE_ATTR_LIB FALSE)
- SET(HAVE_ATTR_XATTR_H FALSE)
- SET(HAVE_DECL_EXTATTR_NAMESPACE_USER FALSE)
- SET(HAVE_EXTATTR_GET_FILE FALSE)
- SET(HAVE_EXTATTR_LIST_FILE FALSE)
- SET(HAVE_EXTATTR_SET_FD FALSE)
- SET(HAVE_EXTATTR_SET_FILE FALSE)
- SET(HAVE_FGETEA FALSE)
- SET(HAVE_FGETXATTR FALSE)
- SET(HAVE_FLISTEA FALSE)
- SET(HAVE_FLISTXATTR FALSE)
- SET(HAVE_FSETEA FALSE)
- SET(HAVE_FSETXATTR FALSE)
- SET(HAVE_GETEA FALSE)
- SET(HAVE_GETXATTR FALSE)
- SET(HAVE_LGETEA FALSE)
- SET(HAVE_LGETXATTR FALSE)
- SET(HAVE_LISTEA FALSE)
- SET(HAVE_LISTXATTR FALSE)
- SET(HAVE_LLISTEA FALSE)
- SET(HAVE_LLISTXATTR FALSE)
- SET(HAVE_LSETEA FALSE)
- SET(HAVE_LSETXATTR FALSE)
- SET(HAVE_SYS_EXTATTR_H FALSE)
- SET(HAVE_SYS_XATTR_H FALSE)
+ SET(ARCHIVE_XATTR_DARWIN FALSE)
+ SET(ARCHIVE_XATTR_FREEBSD FALSE)
+ SET(ARCHIVE_XATTR_LINUX FALSE)
+ SET(ARCHIVE_XATTR_AIX FALSE)
ENDIF(ENABLE_XATTR)
#
@@ -1573,6 +1648,11 @@
# which makes the following checks rather more complex than I would like.
#
IF(ENABLE_ACL)
+ # Solaris and derivates ACLs
+ CHECK_FUNCTION_EXISTS(acl HAVE_ACL)
+ CHECK_FUNCTION_EXISTS(facl HAVE_FACL)
+
+ # Libacl
CHECK_LIBRARY_EXISTS(acl "acl_get_file" "" HAVE_LIBACL)
IF(HAVE_LIBACL)
SET(CMAKE_REQUIRED_LIBRARIES "acl")
@@ -1579,44 +1659,201 @@
FIND_LIBRARY(ACL_LIBRARY NAMES acl)
LIST(APPEND ADDITIONAL_LIBS ${ACL_LIBRARY})
ENDIF(HAVE_LIBACL)
- #
- CHECK_FUNCTION_EXISTS_GLIBC(acl_create_entry HAVE_ACL_CREATE_ENTRY)
- CHECK_FUNCTION_EXISTS_GLIBC(acl_init HAVE_ACL_INIT)
- CHECK_FUNCTION_EXISTS_GLIBC(acl_set_fd HAVE_ACL_SET_FD)
- CHECK_FUNCTION_EXISTS_GLIBC(acl_set_fd_np HAVE_ACL_SET_FD_NP)
- CHECK_FUNCTION_EXISTS_GLIBC(acl_set_file HAVE_ACL_SET_FILE)
- CHECK_TYPE_EXISTS(acl_permset_t "${INCLUDES}" HAVE_ACL_PERMSET_T)
- # The "acl_get_perm()" function was omitted from the POSIX draft.
- # (It's a pretty obvious oversight; otherwise, there's no way to
- # test for specific permissions in a permset.) Linux uses the obvious
- # name, FreeBSD adds _np to mark it as "non-Posix extension."
- # Test for both as a double-check that we really have POSIX-style ACL support.
- CHECK_FUNCTION_EXISTS(acl_get_perm HAVE_ACL_GET_PERM)
- CHECK_FUNCTION_EXISTS(acl_get_perm_np HAVE_ACL_GET_PERM_NP)
- CHECK_FUNCTION_EXISTS(acl_get_link HAVE_ACL_GET_LINK)
- CHECK_FUNCTION_EXISTS(acl_get_link_np HAVE_ACL_GET_LINK_NP)
- CHECK_FUNCTION_EXISTS(acl_is_trivial_np HAVE_ACL_IS_TRIVIAL_NP)
- CHECK_FUNCTION_EXISTS(acl_set_link_np HAVE_ACL_SET_LINK_NP)
+ CHECK_TYPE_EXISTS(acl_t "sys/types.h;sys/acl.h" HAVE_ACL_T)
+ CHECK_TYPE_EXISTS(acl_entry_t "sys/types.h;sys/acl.h" HAVE_ACL_ENTRY_T)
+ CHECK_TYPE_EXISTS(acl_permset_t "sys/types.h;sys/acl.h" HAVE_ACL_PERMSET_T)
+ CHECK_TYPE_EXISTS(acl_tag_t "sys/types.h;sys/acl.h" HAVE_ACL_TAG_T)
- # MacOS has an acl.h that isn't POSIX. It can be detected by
- # checking for ACL_USER
- CHECK_SYMBOL_EXISTS(ACL_USER "${INCLUDES}" HAVE_ACL_USER)
+ IF(HAVE_ACL AND HAVE_FACL)
+ CHECK_TYPE_EXISTS(aclent_t "sys/acl.h" HAVE_ACLENT_T)
+ IF(HAVE_ACLENT_T)
+ CHECK_SYMBOL_EXISTS(GETACL "sys/acl.h" HAVE_DECL_GETACL)
+ CHECK_SYMBOL_EXISTS(GETACLCNT "sys/acl.h" HAVE_DECL_GETACLCNT)
+ CHECK_SYMBOL_EXISTS(SETACL "sys/acl.h" HAVE_DECL_SETACL)
+ IF(HAVE_DECL_GETACL AND
+ HAVE_DECL_GETACLCNT AND
+ HAVE_DECL_SETACL)
+ SET(ARCHIVE_ACL_SUNOS TRUE)
+ ENDIF()
+ CHECK_TYPE_EXISTS(ace_t "sys/acl.h" HAVE_ACE_T)
+ IF(HAVE_ACE_T)
+ CHECK_SYMBOL_EXISTS(ACE_GETACL "sys/acl.h" HAVE_DECL_ACE_GETACL)
+ CHECK_SYMBOL_EXISTS(ACE_GETACLCNT "sys/acl.h" HAVE_DECL_ACE_GETACLCNT)
+ CHECK_SYMBOL_EXISTS(ACE_SETACL "sys/acl.h" HAVE_DECL_ACE_SETACL)
+ IF(HAVE_DECL_ACE_GETACL AND
+ HAVE_DECL_ACE_GETACLCNT AND
+ HAVE_DECL_ACE_SETACL)
+ SET(ARCHIVE_ACL_SUNOS_NFS4 TRUE)
+ ENDIF()
+ ENDIF(HAVE_ACE_T)
+ ENDIF(HAVE_ACLENT_T)
+ ENDIF(HAVE_ACL AND HAVE_FACL)
+
+ IF(HAVE_ACL_T AND HAVE_ACL_ENTRY_T AND HAVE_ACL_PERMSET_T AND HAVE_ACL_TAG_T)
+ CHECK_FUNCTION_EXISTS_GLIBC(acl_add_perm HAVE_ACL_ADD_PERM)
+ CHECK_FUNCTION_EXISTS_GLIBC(acl_clear_perms HAVE_ACL_CLEAR_PERMS)
+ CHECK_FUNCTION_EXISTS_GLIBC(acl_create_entry HAVE_ACL_CREATE_ENTRY)
+ CHECK_FUNCTION_EXISTS_GLIBC(acl_delete_def_file HAVE_ACL_DELETE_DEF_FILE)
+ CHECK_FUNCTION_EXISTS_GLIBC(acl_free HAVE_ACL_FREE)
+ CHECK_FUNCTION_EXISTS_GLIBC(acl_get_entry HAVE_ACL_GET_ENTRY)
+ CHECK_FUNCTION_EXISTS_GLIBC(acl_get_fd HAVE_ACL_GET_FD)
+ CHECK_FUNCTION_EXISTS_GLIBC(acl_get_file HAVE_ACL_GET_FILE)
+ CHECK_FUNCTION_EXISTS_GLIBC(acl_get_permset HAVE_ACL_GET_PERMSET)
+ CHECK_FUNCTION_EXISTS_GLIBC(acl_get_qualifier HAVE_ACL_GET_QUALIFIER)
+ CHECK_FUNCTION_EXISTS_GLIBC(acl_get_tag_type HAVE_ACL_GET_TAG_TYPE)
+ CHECK_FUNCTION_EXISTS_GLIBC(acl_init HAVE_ACL_INIT)
+ CHECK_FUNCTION_EXISTS_GLIBC(acl_set_fd HAVE_ACL_SET_FD)
+ CHECK_FUNCTION_EXISTS_GLIBC(acl_set_file HAVE_ACL_SET_FILE)
+ CHECK_FUNCTION_EXISTS_GLIBC(acl_set_qualifier HAVE_ACL_SET_QUALIFIER)
+ CHECK_FUNCTION_EXISTS_GLIBC(acl_set_tag_type HAVE_ACL_SET_TAG_TYPE)
+ IF(HAVE_ACL_ADD_PERM AND
+ HAVE_ACL_CLEAR_PERMS AND
+ HAVE_ACL_CREATE_ENTRY AND
+ HAVE_ACL_DELETE_DEF_FILE AND
+ HAVE_ACL_FREE AND
+ HAVE_ACL_GET_ENTRY AND
+ HAVE_ACL_GET_FD AND
+ HAVE_ACL_GET_FILE AND
+ HAVE_ACL_GET_PERMSET AND
+ HAVE_ACL_GET_QUALIFIER AND
+ HAVE_ACL_GET_TAG_TYPE AND
+ HAVE_ACL_INIT AND
+ HAVE_ACL_SET_FD AND
+ HAVE_ACL_SET_FILE AND
+ HAVE_ACL_SET_QUALIFIER AND
+ HAVE_ACL_SET_TAG_TYPE)
+ SET(HAVE_POSIX_ACL_FUNCS 1)
+ ENDIF()
+
+ CHECK_FUNCTION_EXISTS_GLIBC(acl_get_perm HAVE_ACL_GET_PERM)
+
+ IF(HAVE_POSIX_ACL_FUNCS AND HAVE_ACL_LIBACL_H AND HAVE_LIBACL AND
+ HAVE_ACL_GET_PERM)
+ SET(ARCHIVE_ACL_LIBACL TRUE)
+ ELSE()
+ CHECK_FUNCTION_EXISTS(acl_add_flag_np HAVE_ACL_ADD_FLAG_NP)
+ CHECK_FUNCTION_EXISTS(acl_clear_flags_np HAVE_ACL_CLEAR_FLAGS_NP)
+ CHECK_FUNCTION_EXISTS(acl_get_brand_np HAVE_ACL_GET_BRAND_NP)
+ CHECK_FUNCTION_EXISTS(acl_get_entry_type_np HAVE_ACL_GET_ENTRY_TYPE_NP)
+ CHECK_FUNCTION_EXISTS(acl_get_flag_np HAVE_ACL_GET_FLAG_NP)
+ CHECK_FUNCTION_EXISTS(acl_get_flagset_np HAVE_ACL_GET_FLAGSET_NP)
+ CHECK_FUNCTION_EXISTS(acl_get_fd_np HAVE_ACL_GET_FD_NP)
+ CHECK_FUNCTION_EXISTS(acl_get_link_np HAVE_ACL_GET_LINK_NP)
+ CHECK_FUNCTION_EXISTS(acl_get_perm_np HAVE_ACL_GET_PERM_NP)
+ CHECK_FUNCTION_EXISTS(acl_is_trivial_np HAVE_ACL_IS_TRIVIAL_NP)
+ CHECK_FUNCTION_EXISTS(acl_set_entry_type_np HAVE_ACL_SET_ENTRY_TYPE_NP)
+ CHECK_FUNCTION_EXISTS(acl_set_fd_np HAVE_ACL_SET_FD_NP)
+ CHECK_FUNCTION_EXISTS(acl_set_link_np HAVE_ACL_SET_LINK_NP)
+ CHECK_FUNCTION_EXISTS(mbr_gid_to_uuid HAVE_MBR_GID_TO_UUID)
+ CHECK_FUNCTION_EXISTS(mbr_uid_to_uuid HAVE_MBR_UID_TO_UUID)
+ CHECK_FUNCTION_EXISTS(mbr_uuid_to_id HAVE_MBR_UUID_TO_ID)
+
+ CHECK_C_SOURCE_COMPILES("#include <sys/types.h>
+#include <sys/acl.h>
+int main(void) { return ACL_TYPE_EXTENDED; }" HAVE_DECL_ACL_TYPE_EXTENDED)
+ CHECK_C_SOURCE_COMPILES("#include <sys/types.h>
+#include <sys/acl.h>
+int main(void) { return ACL_SYNCHRONIZE; }" HAVE_DECL_ACL_SYNCHRONIZE)
+ CHECK_SYMBOL_EXISTS(ACL_TYPE_NFS4 "sys/acl.h" HAVE_DECL_ACL_TYPE_NFS4)
+ CHECK_SYMBOL_EXISTS(ACL_USER "sys/acl.h" HAVE_DECL_ACL_USER)
+
+ IF(HAVE_POSIX_ACL_FUNCS AND
+ HAVE_ACL_GET_FD_NP AND
+ HAVE_ACL_GET_PERM_NP AND
+ NOT HAVE_ACL_GET_PERM AND
+ HAVE_ACL_SET_FD_NP)
+ IF(HAVE_DECL_ACL_USER)
+ SET(ARCHIVE_ACL_FREEBSD TRUE)
+ IF(HAVE_DECL_ACL_TYPE_NFS4 AND
+ HAVE_ACL_ADD_FLAG_NP AND
+ HAVE_ACL_CLEAR_FLAGS_NP AND
+ HAVE_ACL_GET_BRAND_NP AND
+ HAVE_ACL_GET_ENTRY_TYPE_NP AND
+ HAVE_ACL_GET_FLAGSET_NP AND
+ HAVE_ACL_SET_ENTRY_TYPE_NP)
+ SET(ARCHIVE_ACL_FREEBSD_NFS4 TRUE)
+ ENDIF()
+ ELSEIF(HAVE_DECL_ACL_TYPE_EXTENDED AND
+ HAVE_MEMBERSHIP_H AND
+ HAVE_ACL_ADD_FLAG_NP AND
+ HAVE_ACL_CLEAR_FLAGS_NP AND
+ HAVE_ACL_GET_FLAGSET_NP AND
+ HAVE_ACL_GET_LINK_NP AND
+ HAVE_ACL_SET_LINK_NP AND
+ HAVE_MBR_UID_TO_UUID AND
+ HAVE_MBR_GID_TO_UUID AND
+ HAVE_MBR_UUID_TO_ID)
+ SET(ARCHIVE_ACL_DARWIN TRUE)
+ ENDIF()
+ ENDIF()
+ ENDIF()
+ ENDIF(HAVE_ACL_T AND HAVE_ACL_ENTRY_T AND HAVE_ACL_PERMSET_T AND
+ HAVE_ACL_TAG_T)
+
+ # Richacl
+ CHECK_LIBRARY_EXISTS(richacl "richacl_get_file" "" HAVE_LIBRICHACL)
+ IF(HAVE_LIBRICHACL)
+ SET(CMAKE_REQUIRED_LIBRARIES "richacl")
+ FIND_LIBRARY(RICHACL_LIBRARY NAMES richacl)
+ LIST(APPEND ADDITIONAL_LIBS ${RICHACL_LIBRARY})
+ ENDIF(HAVE_LIBRICHACL)
+
+ CHECK_STRUCT_HAS_MEMBER("struct richace" e_type "sys/richacl.h"
+ HAVE_STRUCT_RICHACE)
+ CHECK_STRUCT_HAS_MEMBER("struct richacl" a_flags "sys/richacl.h"
+ HAVE_STRUCT_RICHACL)
+
+ IF(HAVE_LIBRICHACL AND HAVE_STRUCT_RICHACL AND HAVE_STRUCT_RICHACE)
+ CHECK_FUNCTION_EXISTS_GLIBC(richacl_alloc HAVE_RICHACL_ALLOC)
+ CHECK_FUNCTION_EXISTS_GLIBC(richacl_equiv_mode HAVE_RICHACL_EQUIV_MODE)
+ CHECK_FUNCTION_EXISTS_GLIBC(richacl_free HAVE_RICHACL_FREE)
+ CHECK_FUNCTION_EXISTS_GLIBC(richacl_get_fd HAVE_RICHACL_GET_FD)
+ CHECK_FUNCTION_EXISTS_GLIBC(richacl_get_file HAVE_RICHACL_GET_FILE)
+ CHECK_FUNCTION_EXISTS_GLIBC(richacl_set_fd HAVE_RICHACL_SET_FD)
+ CHECK_FUNCTION_EXISTS_GLIBC(richacl_set_file HAVE_RICHACL_SET_FILE)
+ IF(HAVE_RICHACL_ALLOC AND
+ HAVE_RICHACL_EQUIV_MODE AND
+ HAVE_RICHACL_FREE AND
+ HAVE_RICHACL_GET_FD AND
+ HAVE_RICHACL_GET_FILE AND
+ HAVE_RICHACL_SET_FD AND
+ HAVE_RICHACL_SET_FILE)
+ SET(ARCHIVE_ACL_LIBRICHACL TRUE)
+ ENDIF()
+ ENDIF(HAVE_LIBRICHACL AND HAVE_STRUCT_RICHACL AND HAVE_STRUCT_RICHACE)
+
+ IF(ARCHIVE_ACL_DARWIN)
+ MESSAGE(STATUS "ACL support: Darwin (limited NFSv4)")
+ ELSEIF(ARCHIVE_ACL_FREEBSD_NFS4)
+ MESSAGE(STATUS "ACL support: FreeBSD (POSIX.1e and NFSv4)")
+ ELSEIF(ARCHIVE_ACL_FREEBSD)
+ MESSAGE(STATUS "ACL support: FreeBSD (POSIX.1e)")
+ ELSEIF(ARCHIVE_ACL_LIBACL OR ARCHIVE_ACL_LIBRICHACL)
+ IF(ARCHIVE_ACL_LIBACL AND ARCHIVE_ACL_LIBRICHACL)
+ MESSAGE(STATUS "ACL support: libacl (POSIX.1e) + librichacl (NFSv4)")
+ ELSEIF(ARCHIVE_ACL_LIBRICHACL)
+ MESSAGE(STATUS "ACL support: librichacl (NFSv4)")
+ ELSE()
+ MESSAGE(STATUS "ACL support: libacl (POSIX.1e)")
+ ENDIF()
+ ELSEIF(ARCHIVE_ACL_SUNOS_NFS4)
+ MESSAGE(STATUS "ACL support: Solaris (POSIX.1e and NFSv4)")
+ ELSEIF(ARCHIVE_ACL_SUNOS)
+ MESSAGE(STATUS "ACL support: Solaris (POSIX.1e)")
+ ELSE()
+ MESSAGE(STATUS "ACL support: none")
+ ENDIF()
+
ELSE(ENABLE_ACL)
# If someone runs cmake, then disables ACL support, we need
# to forcibly override the cached values for these.
- SET(HAVE_ACL_CREATE_ENTRY FALSE)
- SET(HAVE_ACL_GET_LINK FALSE)
- SET(HAVE_ACL_GET_LINK_NP FALSE)
- SET(HAVE_ACL_GET_PERM FALSE)
- SET(HAVE_ACL_GET_PERM_NP FALSE)
- SET(HAVE_ACL_INIT FALSE)
- SET(HAVE_ACL_LIB FALSE)
- SET(HAVE_ACL_PERMSET_T FALSE)
- SET(HAVE_ACL_SET_FD FALSE)
- SET(HAVE_ACL_SET_FD_NP FALSE)
- SET(HAVE_ACL_SET_FILE FALSE)
- SET(HAVE_ACL_USER FALSE)
+ SET(ARCHIVE_ACL_DARWIN FALSE)
+ SET(ARCHIVE_ACL_FREEBSD FALSE)
+ SET(ARCHIVE_ACL_FREEBSD_NFS4 FALSE)
+ SET(ARCHIVE_ACL_LIBACL FALSE)
+ SET(ARCHIVE_ACL_SUNOS FALSE)
+ SET(ARCHIVE_ACL_SUNOS_NFS4 FALSE)
ENDIF(ENABLE_ACL)
#
Modified: trunk/contrib/libarchive/Makefile.am
===================================================================
--- trunk/contrib/libarchive/Makefile.am 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/Makefile.am 2018-06-19 20:42:35 UTC (rev 11134)
@@ -33,6 +33,7 @@
#
EXTRA_DIST= \
CMakeLists.txt \
+ README.md \
build/autogen.sh \
build/bump-version.sh \
build/clean.sh \
@@ -117,6 +118,8 @@
libarchive/archive_hmac.c \
libarchive/archive_hmac_private.h \
libarchive/archive_match.c \
+ libarchive/archive_openssl_evp_private.h \
+ libarchive/archive_openssl_hmac_private.h \
libarchive/archive_options.c \
libarchive/archive_options_private.h \
libarchive/archive_pack_dev.h \
@@ -124,6 +127,8 @@
libarchive/archive_pathmatch.c \
libarchive/archive_pathmatch.h \
libarchive/archive_platform.h \
+ libarchive/archive_platform_acl.h \
+ libarchive/archive_platform_xattr.h \
libarchive/archive_ppmd_private.h \
libarchive/archive_ppmd7.c \
libarchive/archive_ppmd7_private.h \
@@ -183,9 +188,9 @@
libarchive/archive_string_composition.h \
libarchive/archive_string_sprintf.c \
libarchive/archive_util.c \
+ libarchive/archive_version_details.c \
libarchive/archive_virtual.c \
libarchive/archive_write.c \
- libarchive/archive_write_disk_acl.c \
libarchive/archive_write_disk_posix.c \
libarchive/archive_write_disk_private.h \
libarchive/archive_write_disk_set_standard_lookup.c \
@@ -244,6 +249,22 @@
libarchive/filter_fork_windows.c
endif
+if INC_LINUX_ACL
+libarchive_la_SOURCES+= libarchive/archive_disk_acl_linux.c
+else
+if INC_SUNOS_ACL
+libarchive_la_SOURCES+= libarchive/archive_disk_acl_sunos.c
+else
+if INC_DARWIN_ACL
+libarchive_la_SOURCES+= libarchive/archive_disk_acl_darwin.c
+else
+if INC_FREEBSD_ACL
+libarchive_la_SOURCES+= libarchive/archive_disk_acl_freebsd.c
+endif
+endif
+endif
+endif
+
# -no-undefined marks that libarchive doesn't rely on symbols
# defined in the application. This is mandatory for cygwin.
libarchive_la_LDFLAGS= -no-undefined -version-info $(ARCHIVE_LIBTOOL_VERSION)
@@ -307,7 +328,9 @@
# Sources needed by all test programs
test_utils_SOURCES= \
test_utils/test_utils.c \
- test_utils/test_utils.h
+ test_utils/test_utils.h \
+ test_utils/test_main.c \
+ test_utils/test_common.h
#
#
@@ -317,14 +340,14 @@
libarchive_test_SOURCES= \
$(libarchive_la_SOURCES) \
$(test_utils_SOURCES) \
- libarchive/test/main.c \
libarchive/test/read_open_memory.c \
libarchive/test/test.h \
- libarchive/test/test_acl_freebsd_posix1e.c \
- libarchive/test/test_acl_freebsd_nfs4.c \
libarchive/test/test_acl_nfs4.c \
libarchive/test/test_acl_pax.c \
+ libarchive/test/test_acl_platform_nfs4.c \
+ libarchive/test/test_acl_platform_posix1e.c \
libarchive/test/test_acl_posix1e.c \
+ libarchive/test/test_acl_text.c \
libarchive/test/test_archive_api_feature.c \
libarchive/test/test_archive_clear_error.c \
libarchive/test/test_archive_cmdline.c \
@@ -369,8 +392,11 @@
libarchive/test/test_compat_lzop.c \
libarchive/test/test_compat_mac.c \
libarchive/test/test_compat_pax_libarchive_2x.c \
+ libarchive/test/test_compat_perl_archive_tar.c \
+ libarchive/test/test_compat_plexus_archiver_tar.c \
libarchive/test/test_compat_solaris_tar_acl.c \
libarchive/test/test_compat_solaris_pax_sparse.c \
+ libarchive/test/test_compat_star_acl.c \
libarchive/test/test_compat_tar_hardlink.c \
libarchive/test/test_compat_uudecode.c \
libarchive/test/test_compat_uudecode_large.c \
@@ -449,6 +475,7 @@
libarchive/test/test_read_format_lha_bugfix_0.c \
libarchive/test/test_read_format_lha_filename.c \
libarchive/test/test_read_format_mtree.c \
+ libarchive/test/test_read_format_mtree_crash747.c \
libarchive/test/test_read_format_pax_bz2.c \
libarchive/test/test_read_format_rar.c \
libarchive/test/test_read_format_rar_encryption_data.c \
@@ -475,6 +502,8 @@
libarchive/test/test_read_format_zip_encryption_partially.c \
libarchive/test/test_read_format_zip_encryption_header.c \
libarchive/test/test_read_format_zip_filename.c \
+ libarchive/test/test_read_format_zip_high_compression.c \
+ libarchive/test/test_read_format_zip_jar.c \
libarchive/test/test_read_format_zip_mac_metadata.c \
libarchive/test/test_read_format_zip_malformed.c \
libarchive/test/test_read_format_zip_msdos.c \
@@ -486,7 +515,9 @@
libarchive/test/test_read_format_zip_winzip_aes.c \
libarchive/test/test_read_format_zip_winzip_aes_large.c \
libarchive/test/test_read_format_zip_zip64.c \
+ libarchive/test/test_read_format_zip_with_invalid_traditional_eocd.c \
libarchive/test/test_read_large.c \
+ libarchive/test/test_read_pax_schily_xattr.c \
libarchive/test/test_read_pax_truncated.c \
libarchive/test/test_read_position.c \
libarchive/test/test_read_set_format.c \
@@ -509,6 +540,9 @@
libarchive/test/test_write_disk_no_hfs_compression.c \
libarchive/test/test_write_disk_perms.c \
libarchive/test/test_write_disk_secure.c \
+ libarchive/test/test_write_disk_secure744.c \
+ libarchive/test/test_write_disk_secure745.c \
+ libarchive/test/test_write_disk_secure746.c \
libarchive/test/test_write_disk_sparse.c \
libarchive/test/test_write_disk_symlink.c \
libarchive/test/test_write_disk_times.c \
@@ -570,9 +604,16 @@
libarchive/test/test_write_format_zip_zip64.c \
libarchive/test/test_write_open_memory.c \
libarchive/test/test_write_read_format_zip.c \
+ libarchive/test/test_xattr_platform.c \
libarchive/test/test_zip_filename_encoding.c
-libarchive_test_CPPFLAGS= -I$(top_srcdir)/libarchive -I$(top_srcdir)/test_utils -I$(top_builddir)/libarchive/test -DLIBARCHIVE_STATIC $(PLATFORMCPPFLAGS)
+libarchive_test_CPPFLAGS= \
+ -I$(top_srcdir)/libarchive \
+ -I$(top_srcdir)/libarchive/test \
+ -I$(top_srcdir)/test_utils \
+ -I$(top_builddir)/libarchive/test \
+ -DLIBARCHIVE_STATIC $(PLATFORMCPPFLAGS)
+
libarchive_test_LDADD= $(LTLIBICONV)
# The "list.h" file just lists all of the tests defined in all of the sources.
@@ -586,12 +627,14 @@
libarchive_test_EXTRA_DIST=\
libarchive/test/list.h \
- libarchive/test/test_acl_pax.tar.uu \
+ libarchive/test/test_acl_pax_posix1e.tar.uu \
+ libarchive/test/test_acl_pax_nfs4.tar.uu \
libarchive/test/test_archive_string_conversion.txt.Z.uu \
libarchive/test/test_compat_bzip2_1.tbz.uu \
libarchive/test/test_compat_bzip2_2.tbz.uu \
libarchive/test/test_compat_cpio_1.cpio.uu \
libarchive/test/test_compat_gtar_1.tar.uu \
+ libarchive/test/test_compat_gtar_2.tar.uu \
libarchive/test/test_compat_gzip_1.tgz.uu \
libarchive/test/test_compat_gzip_2.tgz.uu \
libarchive/test/test_compat_lz4_1.tar.lz4.uu \
@@ -617,9 +660,13 @@
libarchive/test/test_compat_mac-1.tar.Z.uu \
libarchive/test/test_compat_mac-2.tar.Z.uu \
libarchive/test/test_compat_pax_libarchive_2x.tar.Z.uu \
+ libarchive/test/test_compat_perl_archive_tar.tar.uu \
+ libarchive/test/test_compat_plexus_archiver_tar.tar.uu \
libarchive/test/test_compat_solaris_pax_sparse_1.pax.Z.uu \
libarchive/test/test_compat_solaris_pax_sparse_2.pax.Z.uu \
libarchive/test/test_compat_solaris_tar_acl.tar.uu \
+ libarchive/test/test_compat_star_acl_nfs4.tar.uu \
+ libarchive/test/test_compat_star_acl_posix1e.tar.uu \
libarchive/test/test_compat_tar_hardlink_1.tar.uu \
libarchive/test/test_compat_uudecode_large.tar.Z.uu \
libarchive/test/test_compat_xz_1.txz.uu \
@@ -657,6 +704,7 @@
libarchive/test/test_read_filter_lrzip.tar.lrz.uu \
libarchive/test/test_read_filter_lzop.tar.lzo.uu \
libarchive/test/test_read_filter_lzop_multiple_parts.tar.lzo.uu \
+ libarchive/test/test_read_format_mtree_crash747.mtree.bz2.uu \
libarchive/test/test_read_format_7zip_bcj2_bzip2.7z.uu \
libarchive/test/test_read_format_7zip_bcj2_copy_1.7z.uu \
libarchive/test/test_read_format_7zip_bcj2_copy_2.7z.uu \
@@ -760,6 +808,7 @@
libarchive/test/test_read_format_rar_subblock.rar.uu \
libarchive/test/test_read_format_rar_unicode.rar.uu \
libarchive/test/test_read_format_rar_windows.rar.uu \
+ libarchive/test/test_read_format_raw.bufr.uu \
libarchive/test/test_read_format_raw.data.Z.uu \
libarchive/test/test_read_format_raw.data.uu \
libarchive/test/test_read_format_tar_concatenated.tar.uu \
@@ -782,7 +831,9 @@
libarchive/test/test_read_format_zip_filename_utf8_jp.zip.uu \
libarchive/test/test_read_format_zip_filename_utf8_ru.zip.uu \
libarchive/test/test_read_format_zip_filename_utf8_ru2.zip.uu \
+ libarchive/test/test_read_format_zip_high_compression.zip.uu \
libarchive/test/test_read_format_zip_length_at_end.zip.uu \
+ libarchive/test/test_read_format_zip_jar.jar.uu \
libarchive/test/test_read_format_zip_mac_metadata.zip.uu \
libarchive/test/test_read_format_zip_malformed1.zip.uu \
libarchive/test/test_read_format_zip_msdos.zip.uu \
@@ -799,6 +850,7 @@
libarchive/test/test_read_format_zip_winzip_aes256.zip.uu \
libarchive/test/test_read_format_zip_winzip_aes256_large.zip.uu \
libarchive/test/test_read_format_zip_winzip_aes256_stored.zip.uu \
+ libarchive/test/test_read_format_zip_with_invalid_traditional_eocd.zip.uu \
libarchive/test/test_read_format_zip_zip64a.zip.uu \
libarchive/test/test_read_format_zip_zip64b.zip.uu \
libarchive/test/test_read_large_splitted_rar_aa.uu \
@@ -806,6 +858,7 @@
libarchive/test/test_read_large_splitted_rar_ac.uu \
libarchive/test/test_read_large_splitted_rar_ad.uu \
libarchive/test/test_read_large_splitted_rar_ae.uu \
+ libarchive/test/test_read_pax_schily_xattr.tar.uu \
libarchive/test/test_read_splitted_rar_aa.uu \
libarchive/test/test_read_splitted_rar_ab.uu \
libarchive/test/test_read_splitted_rar_ac.uu \
@@ -893,7 +946,6 @@
bsdtar_test_SOURCES= \
$(test_utils_SOURCES) \
- tar/test/main.c \
tar/test/test.h \
tar/test/test_0.c \
tar/test/test_basic.c \
@@ -920,10 +972,12 @@
tar/test/test_option_T_upper.c \
tar/test/test_option_U_upper.c \
tar/test/test_option_X_upper.c \
+ tar/test/test_option_acls.c \
tar/test/test_option_a.c \
tar/test/test_option_b.c \
tar/test/test_option_b64encode.c \
tar/test/test_option_exclude.c \
+ tar/test/test_option_fflags.c \
tar/test/test_option_gid_gname.c \
tar/test/test_option_grzip.c \
tar/test/test_option_j.c \
@@ -943,6 +997,7 @@
tar/test/test_option_s.c \
tar/test/test_option_uid_uname.c \
tar/test/test_option_uuencode.c \
+ tar/test/test_option_xattrs.c \
tar/test/test_option_xz.c \
tar/test/test_option_z.c \
tar/test/test_patterns.c \
@@ -956,7 +1011,8 @@
bsdtar_test_CPPFLAGS=\
-I$(top_srcdir)/libarchive -I$(top_srcdir)/libarchive_fe \
-I$(top_srcdir)/test_utils \
- -I$(top_srcdir)/tar -I$(top_builddir)/tar/test \
+ -I$(top_srcdir)/tar -I$(top_srcdir)/tar/test \
+ -I$(top_builddir)/tar/test \
$(PLATFORMCPPFLAGS)
tar/test/list.h: Makefile
@@ -1051,7 +1107,6 @@
bsdcpio_test_SOURCES= \
$(test_utils_SOURCES) \
cpio/cmdline.c \
- cpio/test/main.c \
cpio/test/test.h \
cpio/test/test_0.c \
cpio/test/test_basic.c \
@@ -1103,7 +1158,8 @@
bsdcpio_test_CPPFLAGS= \
-I$(top_srcdir)/libarchive -I$(top_srcdir)/libarchive_fe \
-I$(top_srcdir)/test_utils \
- -I$(top_srcdir)/cpio -I$(top_builddir)/cpio/test \
+ -I$(top_srcdir)/cpio -I$(top_srcdir)/cpio/test \
+ -I$(top_builddir)/cpio/test \
$(PLATFORMCPPFLAGS)
bsdcpio_test_LDADD=libarchive_fe.la
@@ -1198,7 +1254,6 @@
bsdcat_test_SOURCES= \
$(test_utils_SOURCES) \
- cat/test/main.c \
cat/test/test.h \
cat/test/test_0.c \
cat/test/test_empty_gz.c \
@@ -1219,7 +1274,8 @@
bsdcat_test_CPPFLAGS= \
-I$(top_srcdir)/libarchive -I$(top_srcdir)/libarchive_fe \
-I$(top_srcdir)/test_utils \
- -I$(top_srcdir)/cat -I$(top_builddir)/cat/test \
+ -I$(top_srcdir)/cat -I$(top_srcdir)/cat/test \
+ -I$(top_builddir)/cat/test \
$(PLATFORMCPPFLAGS)
bsdcat_test_LDADD=libarchive_fe.la
Modified: trunk/contrib/libarchive/Makefile.in
===================================================================
--- trunk/contrib/libarchive/Makefile.in 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/Makefile.in 2018-06-19 20:42:35 UTC (rev 11134)
@@ -104,15 +104,19 @@
@INC_WINDOWS_FILES_TRUE@ libarchive/archive_write_disk_windows.c \
@INC_WINDOWS_FILES_TRUE@ libarchive/filter_fork_windows.c
- at INC_WINDOWS_FILES_TRUE@am__append_2 = \
+ at INC_LINUX_ACL_TRUE@am__append_2 = libarchive/archive_disk_acl_linux.c
+ at INC_LINUX_ACL_FALSE@@INC_SUNOS_ACL_TRUE at am__append_3 = libarchive/archive_disk_acl_sunos.c
+ at INC_DARWIN_ACL_TRUE@@INC_LINUX_ACL_FALSE@@INC_SUNOS_ACL_FALSE at am__append_4 = libarchive/archive_disk_acl_darwin.c
+ at INC_DARWIN_ACL_FALSE@@INC_FREEBSD_ACL_TRUE@@INC_LINUX_ACL_FALSE@@INC_SUNOS_ACL_FALSE at am__append_5 = libarchive/archive_disk_acl_freebsd.c
+ at INC_WINDOWS_FILES_TRUE@am__append_6 = \
@INC_WINDOWS_FILES_TRUE@ tar/bsdtar_windows.h \
@INC_WINDOWS_FILES_TRUE@ tar/bsdtar_windows.c
- at INC_WINDOWS_FILES_TRUE@am__append_3 = \
+ at INC_WINDOWS_FILES_TRUE@am__append_7 = \
@INC_WINDOWS_FILES_TRUE@ cpio/cpio_windows.h \
@INC_WINDOWS_FILES_TRUE@ cpio/cpio_windows.c
- at INC_WINDOWS_FILES_TRUE@am__append_4 =
+ at INC_WINDOWS_FILES_TRUE@am__append_8 =
subdir = .
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = \
@@ -191,11 +195,15 @@
libarchive/archive_entry_xattr.c libarchive/archive_getdate.c \
libarchive/archive_getdate.h libarchive/archive_hmac.c \
libarchive/archive_hmac_private.h libarchive/archive_match.c \
+ libarchive/archive_openssl_evp_private.h \
+ libarchive/archive_openssl_hmac_private.h \
libarchive/archive_options.c \
libarchive/archive_options_private.h \
libarchive/archive_pack_dev.h libarchive/archive_pack_dev.c \
libarchive/archive_pathmatch.c libarchive/archive_pathmatch.h \
libarchive/archive_platform.h \
+ libarchive/archive_platform_acl.h \
+ libarchive/archive_platform_xattr.h \
libarchive/archive_ppmd_private.h libarchive/archive_ppmd7.c \
libarchive/archive_ppmd7_private.h \
libarchive/archive_private.h libarchive/archive_random.c \
@@ -249,8 +257,8 @@
libarchive/archive_string.c libarchive/archive_string.h \
libarchive/archive_string_composition.h \
libarchive/archive_string_sprintf.c libarchive/archive_util.c \
+ libarchive/archive_version_details.c \
libarchive/archive_virtual.c libarchive/archive_write.c \
- libarchive/archive_write_disk_acl.c \
libarchive/archive_write_disk_posix.c \
libarchive/archive_write_disk_private.h \
libarchive/archive_write_disk_set_standard_lookup.c \
@@ -299,7 +307,11 @@
libarchive/archive_read_disk_windows.c \
libarchive/archive_windows.h libarchive/archive_windows.c \
libarchive/archive_write_disk_windows.c \
- libarchive/filter_fork_windows.c
+ libarchive/filter_fork_windows.c \
+ libarchive/archive_disk_acl_linux.c \
+ libarchive/archive_disk_acl_sunos.c \
+ libarchive/archive_disk_acl_darwin.c \
+ libarchive/archive_disk_acl_freebsd.c
am__dirstamp = $(am__leading_dot)dirstamp
@INC_WINDOWS_FILES_TRUE at am__objects_1 = \
@INC_WINDOWS_FILES_TRUE@ libarchive/archive_entry_copy_bhfi.lo \
@@ -307,6 +319,11 @@
@INC_WINDOWS_FILES_TRUE@ libarchive/archive_windows.lo \
@INC_WINDOWS_FILES_TRUE@ libarchive/archive_write_disk_windows.lo \
@INC_WINDOWS_FILES_TRUE@ libarchive/filter_fork_windows.lo
+ at INC_LINUX_ACL_TRUE@am__objects_2 = \
+ at INC_LINUX_ACL_TRUE@ libarchive/archive_disk_acl_linux.lo
+ at INC_LINUX_ACL_FALSE@@INC_SUNOS_ACL_TRUE at am__objects_3 = libarchive/archive_disk_acl_sunos.lo
+ at INC_DARWIN_ACL_TRUE@@INC_LINUX_ACL_FALSE@@INC_SUNOS_ACL_FALSE at am__objects_4 = libarchive/archive_disk_acl_darwin.lo
+ at INC_DARWIN_ACL_FALSE@@INC_FREEBSD_ACL_TRUE@@INC_LINUX_ACL_FALSE@@INC_SUNOS_ACL_FALSE at am__objects_5 = libarchive/archive_disk_acl_freebsd.lo
am_libarchive_la_OBJECTS = libarchive/archive_acl.lo \
libarchive/archive_check_magic.lo \
libarchive/archive_cmdline.lo libarchive/archive_cryptor.lo \
@@ -367,9 +384,9 @@
libarchive/archive_read_support_format_zip.lo \
libarchive/archive_string.lo \
libarchive/archive_string_sprintf.lo \
- libarchive/archive_util.lo libarchive/archive_virtual.lo \
- libarchive/archive_write.lo \
- libarchive/archive_write_disk_acl.lo \
+ libarchive/archive_util.lo \
+ libarchive/archive_version_details.lo \
+ libarchive/archive_virtual.lo libarchive/archive_write.lo \
libarchive/archive_write_disk_posix.lo \
libarchive/archive_write_disk_set_standard_lookup.lo \
libarchive/archive_write_open_fd.lo \
@@ -411,7 +428,8 @@
libarchive/archive_write_set_options.lo \
libarchive/archive_write_set_passphrase.lo \
libarchive/filter_fork_posix.lo libarchive/xxhash.lo \
- $(am__objects_1)
+ $(am__objects_1) $(am__objects_2) $(am__objects_3) \
+ $(am__objects_4) $(am__objects_5)
libarchive_la_OBJECTS = $(am_libarchive_la_OBJECTS)
AM_V_lt = $(am__v_lt_ at AM_V@)
am__v_lt_ = $(am__v_lt_ at AM_DEFAULT_V@)
@@ -432,16 +450,16 @@
@BUILD_BSDCPIO_TRUE at am__EXEEXT_5 = bsdcpio_test$(EXEEXT)
@BUILD_BSDCAT_TRUE at am__EXEEXT_6 = bsdcat_test$(EXEEXT)
PROGRAMS = $(bin_PROGRAMS)
-am__objects_2 =
+am__objects_6 =
am_bsdcat_OBJECTS = cat/bsdcat-bsdcat.$(OBJEXT) \
- cat/bsdcat-cmdline.$(OBJEXT) $(am__objects_2)
+ cat/bsdcat-cmdline.$(OBJEXT) $(am__objects_6)
bsdcat_OBJECTS = $(am_bsdcat_OBJECTS)
bsdcat_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(bsdcat_LDFLAGS) $(LDFLAGS) -o $@
-am__objects_3 = test_utils/bsdcat_test-test_utils.$(OBJEXT)
-am_bsdcat_test_OBJECTS = $(am__objects_3) \
- cat/test/bsdcat_test-main.$(OBJEXT) \
+am__objects_7 = test_utils/bsdcat_test-test_utils.$(OBJEXT) \
+ test_utils/bsdcat_test-test_main.$(OBJEXT)
+am_bsdcat_test_OBJECTS = $(am__objects_7) \
cat/test/bsdcat_test-test_0.$(OBJEXT) \
cat/test/bsdcat_test-test_empty_gz.$(OBJEXT) \
cat/test/bsdcat_test-test_empty_lz4.$(OBJEXT) \
@@ -461,18 +479,18 @@
bsdcat_test_DEPENDENCIES = libarchive_fe.la
am__bsdcpio_SOURCES_DIST = cpio/cmdline.c cpio/cpio.c cpio/cpio.h \
cpio/cpio_platform.h cpio/cpio_windows.h cpio/cpio_windows.c
- at INC_WINDOWS_FILES_TRUE@am__objects_4 = \
+ at INC_WINDOWS_FILES_TRUE@am__objects_8 = \
@INC_WINDOWS_FILES_TRUE@ cpio/bsdcpio-cpio_windows.$(OBJEXT)
am_bsdcpio_OBJECTS = cpio/bsdcpio-cmdline.$(OBJEXT) \
- cpio/bsdcpio-cpio.$(OBJEXT) $(am__objects_4)
+ cpio/bsdcpio-cpio.$(OBJEXT) $(am__objects_8)
bsdcpio_OBJECTS = $(am_bsdcpio_OBJECTS)
bsdcpio_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(bsdcpio_LDFLAGS) $(LDFLAGS) -o $@
-am__objects_5 = test_utils/bsdcpio_test-test_utils.$(OBJEXT)
-am_bsdcpio_test_OBJECTS = $(am__objects_5) \
+am__objects_9 = test_utils/bsdcpio_test-test_utils.$(OBJEXT) \
+ test_utils/bsdcpio_test-test_main.$(OBJEXT)
+am_bsdcpio_test_OBJECTS = $(am__objects_9) \
cpio/bsdcpio_test-cmdline.$(OBJEXT) \
- cpio/test/bsdcpio_test-main.$(OBJEXT) \
cpio/test/bsdcpio_test-test_0.$(OBJEXT) \
cpio/test/bsdcpio_test-test_basic.$(OBJEXT) \
cpio/test/bsdcpio_test-test_cmdline.$(OBJEXT) \
@@ -525,20 +543,20 @@
tar/bsdtar_platform.h tar/cmdline.c tar/creation_set.c \
tar/read.c tar/subst.c tar/util.c tar/write.c \
tar/bsdtar_windows.h tar/bsdtar_windows.c
- at INC_WINDOWS_FILES_TRUE@am__objects_6 = \
+ at INC_WINDOWS_FILES_TRUE@am__objects_10 = \
@INC_WINDOWS_FILES_TRUE@ tar/bsdtar-bsdtar_windows.$(OBJEXT)
am_bsdtar_OBJECTS = tar/bsdtar-bsdtar.$(OBJEXT) \
tar/bsdtar-cmdline.$(OBJEXT) tar/bsdtar-creation_set.$(OBJEXT) \
tar/bsdtar-read.$(OBJEXT) tar/bsdtar-subst.$(OBJEXT) \
tar/bsdtar-util.$(OBJEXT) tar/bsdtar-write.$(OBJEXT) \
- $(am__objects_6)
+ $(am__objects_10)
bsdtar_OBJECTS = $(am_bsdtar_OBJECTS)
bsdtar_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
$(bsdtar_LDFLAGS) $(LDFLAGS) -o $@
-am__objects_7 = test_utils/bsdtar_test-test_utils.$(OBJEXT)
-am_bsdtar_test_OBJECTS = $(am__objects_7) \
- tar/test/bsdtar_test-main.$(OBJEXT) \
+am__objects_11 = test_utils/bsdtar_test-test_utils.$(OBJEXT) \
+ test_utils/bsdtar_test-test_main.$(OBJEXT)
+am_bsdtar_test_OBJECTS = $(am__objects_11) \
tar/test/bsdtar_test-test_0.$(OBJEXT) \
tar/test/bsdtar_test-test_basic.$(OBJEXT) \
tar/test/bsdtar_test-test_copy.$(OBJEXT) \
@@ -564,10 +582,12 @@
tar/test/bsdtar_test-test_option_T_upper.$(OBJEXT) \
tar/test/bsdtar_test-test_option_U_upper.$(OBJEXT) \
tar/test/bsdtar_test-test_option_X_upper.$(OBJEXT) \
+ tar/test/bsdtar_test-test_option_acls.$(OBJEXT) \
tar/test/bsdtar_test-test_option_a.$(OBJEXT) \
tar/test/bsdtar_test-test_option_b.$(OBJEXT) \
tar/test/bsdtar_test-test_option_b64encode.$(OBJEXT) \
tar/test/bsdtar_test-test_option_exclude.$(OBJEXT) \
+ tar/test/bsdtar_test-test_option_fflags.$(OBJEXT) \
tar/test/bsdtar_test-test_option_gid_gname.$(OBJEXT) \
tar/test/bsdtar_test-test_option_grzip.$(OBJEXT) \
tar/test/bsdtar_test-test_option_j.$(OBJEXT) \
@@ -587,6 +607,7 @@
tar/test/bsdtar_test-test_option_s.$(OBJEXT) \
tar/test/bsdtar_test-test_option_uid_uname.$(OBJEXT) \
tar/test/bsdtar_test-test_option_uuencode.$(OBJEXT) \
+ tar/test/bsdtar_test-test_option_xattrs.$(OBJEXT) \
tar/test/bsdtar_test-test_option_xz.$(OBJEXT) \
tar/test/bsdtar_test-test_option_z.$(OBJEXT) \
tar/test/bsdtar_test-test_patterns.$(OBJEXT) \
@@ -618,11 +639,15 @@
libarchive/archive_entry_xattr.c libarchive/archive_getdate.c \
libarchive/archive_getdate.h libarchive/archive_hmac.c \
libarchive/archive_hmac_private.h libarchive/archive_match.c \
+ libarchive/archive_openssl_evp_private.h \
+ libarchive/archive_openssl_hmac_private.h \
libarchive/archive_options.c \
libarchive/archive_options_private.h \
libarchive/archive_pack_dev.h libarchive/archive_pack_dev.c \
libarchive/archive_pathmatch.c libarchive/archive_pathmatch.h \
libarchive/archive_platform.h \
+ libarchive/archive_platform_acl.h \
+ libarchive/archive_platform_xattr.h \
libarchive/archive_ppmd_private.h libarchive/archive_ppmd7.c \
libarchive/archive_ppmd7_private.h \
libarchive/archive_private.h libarchive/archive_random.c \
@@ -676,8 +701,8 @@
libarchive/archive_string.c libarchive/archive_string.h \
libarchive/archive_string_composition.h \
libarchive/archive_string_sprintf.c libarchive/archive_util.c \
+ libarchive/archive_version_details.c \
libarchive/archive_virtual.c libarchive/archive_write.c \
- libarchive/archive_write_disk_acl.c \
libarchive/archive_write_disk_posix.c \
libarchive/archive_write_disk_private.h \
libarchive/archive_write_disk_set_standard_lookup.c \
@@ -726,13 +751,19 @@
libarchive/archive_read_disk_windows.c \
libarchive/archive_windows.h libarchive/archive_windows.c \
libarchive/archive_write_disk_windows.c \
- libarchive/filter_fork_windows.c test_utils/test_utils.c \
- test_utils/test_utils.h libarchive/test/main.c \
- libarchive/test/read_open_memory.c libarchive/test/test.h \
- libarchive/test/test_acl_freebsd_posix1e.c \
- libarchive/test/test_acl_freebsd_nfs4.c \
- libarchive/test/test_acl_nfs4.c libarchive/test/test_acl_pax.c \
+ libarchive/filter_fork_windows.c \
+ libarchive/archive_disk_acl_linux.c \
+ libarchive/archive_disk_acl_sunos.c \
+ libarchive/archive_disk_acl_darwin.c \
+ libarchive/archive_disk_acl_freebsd.c test_utils/test_utils.c \
+ test_utils/test_utils.h test_utils/test_main.c \
+ test_utils/test_common.h libarchive/test/read_open_memory.c \
+ libarchive/test/test.h libarchive/test/test_acl_nfs4.c \
+ libarchive/test/test_acl_pax.c \
+ libarchive/test/test_acl_platform_nfs4.c \
+ libarchive/test/test_acl_platform_posix1e.c \
libarchive/test/test_acl_posix1e.c \
+ libarchive/test/test_acl_text.c \
libarchive/test/test_archive_api_feature.c \
libarchive/test/test_archive_clear_error.c \
libarchive/test/test_archive_cmdline.c \
@@ -777,8 +808,11 @@
libarchive/test/test_compat_lzop.c \
libarchive/test/test_compat_mac.c \
libarchive/test/test_compat_pax_libarchive_2x.c \
+ libarchive/test/test_compat_perl_archive_tar.c \
+ libarchive/test/test_compat_plexus_archiver_tar.c \
libarchive/test/test_compat_solaris_tar_acl.c \
libarchive/test/test_compat_solaris_pax_sparse.c \
+ libarchive/test/test_compat_star_acl.c \
libarchive/test/test_compat_tar_hardlink.c \
libarchive/test/test_compat_uudecode.c \
libarchive/test/test_compat_uudecode_large.c \
@@ -857,6 +891,7 @@
libarchive/test/test_read_format_lha_bugfix_0.c \
libarchive/test/test_read_format_lha_filename.c \
libarchive/test/test_read_format_mtree.c \
+ libarchive/test/test_read_format_mtree_crash747.c \
libarchive/test/test_read_format_pax_bz2.c \
libarchive/test/test_read_format_rar.c \
libarchive/test/test_read_format_rar_encryption_data.c \
@@ -883,6 +918,8 @@
libarchive/test/test_read_format_zip_encryption_partially.c \
libarchive/test/test_read_format_zip_encryption_header.c \
libarchive/test/test_read_format_zip_filename.c \
+ libarchive/test/test_read_format_zip_high_compression.c \
+ libarchive/test/test_read_format_zip_jar.c \
libarchive/test/test_read_format_zip_mac_metadata.c \
libarchive/test/test_read_format_zip_malformed.c \
libarchive/test/test_read_format_zip_msdos.c \
@@ -894,7 +931,9 @@
libarchive/test/test_read_format_zip_winzip_aes.c \
libarchive/test/test_read_format_zip_winzip_aes_large.c \
libarchive/test/test_read_format_zip_zip64.c \
+ libarchive/test/test_read_format_zip_with_invalid_traditional_eocd.c \
libarchive/test/test_read_large.c \
+ libarchive/test/test_read_pax_schily_xattr.c \
libarchive/test/test_read_pax_truncated.c \
libarchive/test/test_read_position.c \
libarchive/test/test_read_set_format.c \
@@ -917,6 +956,9 @@
libarchive/test/test_write_disk_no_hfs_compression.c \
libarchive/test/test_write_disk_perms.c \
libarchive/test/test_write_disk_secure.c \
+ libarchive/test/test_write_disk_secure744.c \
+ libarchive/test/test_write_disk_secure745.c \
+ libarchive/test/test_write_disk_secure746.c \
libarchive/test/test_write_disk_sparse.c \
libarchive/test/test_write_disk_symlink.c \
libarchive/test/test_write_disk_times.c \
@@ -978,13 +1020,18 @@
libarchive/test/test_write_format_zip_zip64.c \
libarchive/test/test_write_open_memory.c \
libarchive/test/test_write_read_format_zip.c \
+ libarchive/test/test_xattr_platform.c \
libarchive/test/test_zip_filename_encoding.c
- at INC_WINDOWS_FILES_TRUE@am__objects_8 = libarchive/libarchive_test-archive_entry_copy_bhfi.$(OBJEXT) \
+ at INC_WINDOWS_FILES_TRUE@am__objects_12 = libarchive/libarchive_test-archive_entry_copy_bhfi.$(OBJEXT) \
@INC_WINDOWS_FILES_TRUE@ libarchive/libarchive_test-archive_read_disk_windows.$(OBJEXT) \
@INC_WINDOWS_FILES_TRUE@ libarchive/libarchive_test-archive_windows.$(OBJEXT) \
@INC_WINDOWS_FILES_TRUE@ libarchive/libarchive_test-archive_write_disk_windows.$(OBJEXT) \
@INC_WINDOWS_FILES_TRUE@ libarchive/libarchive_test-filter_fork_windows.$(OBJEXT)
-am__objects_9 = libarchive/libarchive_test-archive_acl.$(OBJEXT) \
+ at INC_LINUX_ACL_TRUE@am__objects_13 = libarchive/libarchive_test-archive_disk_acl_linux.$(OBJEXT)
+ at INC_LINUX_ACL_FALSE@@INC_SUNOS_ACL_TRUE at am__objects_14 = libarchive/libarchive_test-archive_disk_acl_sunos.$(OBJEXT)
+ at INC_DARWIN_ACL_TRUE@@INC_LINUX_ACL_FALSE@@INC_SUNOS_ACL_FALSE at am__objects_15 = libarchive/libarchive_test-archive_disk_acl_darwin.$(OBJEXT)
+ at INC_DARWIN_ACL_FALSE@@INC_FREEBSD_ACL_TRUE@@INC_LINUX_ACL_FALSE@@INC_SUNOS_ACL_FALSE at am__objects_16 = libarchive/libarchive_test-archive_disk_acl_freebsd.$(OBJEXT)
+am__objects_17 = libarchive/libarchive_test-archive_acl.$(OBJEXT) \
libarchive/libarchive_test-archive_check_magic.$(OBJEXT) \
libarchive/libarchive_test-archive_cmdline.$(OBJEXT) \
libarchive/libarchive_test-archive_cryptor.$(OBJEXT) \
@@ -1052,9 +1099,9 @@
libarchive/libarchive_test-archive_string.$(OBJEXT) \
libarchive/libarchive_test-archive_string_sprintf.$(OBJEXT) \
libarchive/libarchive_test-archive_util.$(OBJEXT) \
+ libarchive/libarchive_test-archive_version_details.$(OBJEXT) \
libarchive/libarchive_test-archive_virtual.$(OBJEXT) \
libarchive/libarchive_test-archive_write.$(OBJEXT) \
- libarchive/libarchive_test-archive_write_disk_acl.$(OBJEXT) \
libarchive/libarchive_test-archive_write_disk_posix.$(OBJEXT) \
libarchive/libarchive_test-archive_write_disk_set_standard_lookup.$(OBJEXT) \
libarchive/libarchive_test-archive_write_open_fd.$(OBJEXT) \
@@ -1096,16 +1143,19 @@
libarchive/libarchive_test-archive_write_set_options.$(OBJEXT) \
libarchive/libarchive_test-archive_write_set_passphrase.$(OBJEXT) \
libarchive/libarchive_test-filter_fork_posix.$(OBJEXT) \
- libarchive/libarchive_test-xxhash.$(OBJEXT) $(am__objects_8)
-am__objects_10 = test_utils/libarchive_test-test_utils.$(OBJEXT)
-am_libarchive_test_OBJECTS = $(am__objects_9) $(am__objects_10) \
- libarchive/test/libarchive_test-main.$(OBJEXT) \
+ libarchive/libarchive_test-xxhash.$(OBJEXT) $(am__objects_12) \
+ $(am__objects_13) $(am__objects_14) $(am__objects_15) \
+ $(am__objects_16)
+am__objects_18 = test_utils/libarchive_test-test_utils.$(OBJEXT) \
+ test_utils/libarchive_test-test_main.$(OBJEXT)
+am_libarchive_test_OBJECTS = $(am__objects_17) $(am__objects_18) \
libarchive/test/libarchive_test-read_open_memory.$(OBJEXT) \
- libarchive/test/libarchive_test-test_acl_freebsd_posix1e.$(OBJEXT) \
- libarchive/test/libarchive_test-test_acl_freebsd_nfs4.$(OBJEXT) \
libarchive/test/libarchive_test-test_acl_nfs4.$(OBJEXT) \
libarchive/test/libarchive_test-test_acl_pax.$(OBJEXT) \
+ libarchive/test/libarchive_test-test_acl_platform_nfs4.$(OBJEXT) \
+ libarchive/test/libarchive_test-test_acl_platform_posix1e.$(OBJEXT) \
libarchive/test/libarchive_test-test_acl_posix1e.$(OBJEXT) \
+ libarchive/test/libarchive_test-test_acl_text.$(OBJEXT) \
libarchive/test/libarchive_test-test_archive_api_feature.$(OBJEXT) \
libarchive/test/libarchive_test-test_archive_clear_error.$(OBJEXT) \
libarchive/test/libarchive_test-test_archive_cmdline.$(OBJEXT) \
@@ -1150,8 +1200,11 @@
libarchive/test/libarchive_test-test_compat_lzop.$(OBJEXT) \
libarchive/test/libarchive_test-test_compat_mac.$(OBJEXT) \
libarchive/test/libarchive_test-test_compat_pax_libarchive_2x.$(OBJEXT) \
+ libarchive/test/libarchive_test-test_compat_perl_archive_tar.$(OBJEXT) \
+ libarchive/test/libarchive_test-test_compat_plexus_archiver_tar.$(OBJEXT) \
libarchive/test/libarchive_test-test_compat_solaris_tar_acl.$(OBJEXT) \
libarchive/test/libarchive_test-test_compat_solaris_pax_sparse.$(OBJEXT) \
+ libarchive/test/libarchive_test-test_compat_star_acl.$(OBJEXT) \
libarchive/test/libarchive_test-test_compat_tar_hardlink.$(OBJEXT) \
libarchive/test/libarchive_test-test_compat_uudecode.$(OBJEXT) \
libarchive/test/libarchive_test-test_compat_uudecode_large.$(OBJEXT) \
@@ -1230,6 +1283,7 @@
libarchive/test/libarchive_test-test_read_format_lha_bugfix_0.$(OBJEXT) \
libarchive/test/libarchive_test-test_read_format_lha_filename.$(OBJEXT) \
libarchive/test/libarchive_test-test_read_format_mtree.$(OBJEXT) \
+ libarchive/test/libarchive_test-test_read_format_mtree_crash747.$(OBJEXT) \
libarchive/test/libarchive_test-test_read_format_pax_bz2.$(OBJEXT) \
libarchive/test/libarchive_test-test_read_format_rar.$(OBJEXT) \
libarchive/test/libarchive_test-test_read_format_rar_encryption_data.$(OBJEXT) \
@@ -1256,6 +1310,8 @@
libarchive/test/libarchive_test-test_read_format_zip_encryption_partially.$(OBJEXT) \
libarchive/test/libarchive_test-test_read_format_zip_encryption_header.$(OBJEXT) \
libarchive/test/libarchive_test-test_read_format_zip_filename.$(OBJEXT) \
+ libarchive/test/libarchive_test-test_read_format_zip_high_compression.$(OBJEXT) \
+ libarchive/test/libarchive_test-test_read_format_zip_jar.$(OBJEXT) \
libarchive/test/libarchive_test-test_read_format_zip_mac_metadata.$(OBJEXT) \
libarchive/test/libarchive_test-test_read_format_zip_malformed.$(OBJEXT) \
libarchive/test/libarchive_test-test_read_format_zip_msdos.$(OBJEXT) \
@@ -1267,7 +1323,9 @@
libarchive/test/libarchive_test-test_read_format_zip_winzip_aes.$(OBJEXT) \
libarchive/test/libarchive_test-test_read_format_zip_winzip_aes_large.$(OBJEXT) \
libarchive/test/libarchive_test-test_read_format_zip_zip64.$(OBJEXT) \
+ libarchive/test/libarchive_test-test_read_format_zip_with_invalid_traditional_eocd.$(OBJEXT) \
libarchive/test/libarchive_test-test_read_large.$(OBJEXT) \
+ libarchive/test/libarchive_test-test_read_pax_schily_xattr.$(OBJEXT) \
libarchive/test/libarchive_test-test_read_pax_truncated.$(OBJEXT) \
libarchive/test/libarchive_test-test_read_position.$(OBJEXT) \
libarchive/test/libarchive_test-test_read_set_format.$(OBJEXT) \
@@ -1290,6 +1348,9 @@
libarchive/test/libarchive_test-test_write_disk_no_hfs_compression.$(OBJEXT) \
libarchive/test/libarchive_test-test_write_disk_perms.$(OBJEXT) \
libarchive/test/libarchive_test-test_write_disk_secure.$(OBJEXT) \
+ libarchive/test/libarchive_test-test_write_disk_secure744.$(OBJEXT) \
+ libarchive/test/libarchive_test-test_write_disk_secure745.$(OBJEXT) \
+ libarchive/test/libarchive_test-test_write_disk_secure746.$(OBJEXT) \
libarchive/test/libarchive_test-test_write_disk_sparse.$(OBJEXT) \
libarchive/test/libarchive_test-test_write_disk_symlink.$(OBJEXT) \
libarchive/test/libarchive_test-test_write_disk_times.$(OBJEXT) \
@@ -1351,6 +1412,7 @@
libarchive/test/libarchive_test-test_write_format_zip_zip64.$(OBJEXT) \
libarchive/test/libarchive_test-test_write_open_memory.$(OBJEXT) \
libarchive/test/libarchive_test-test_write_read_format_zip.$(OBJEXT) \
+ libarchive/test/libarchive_test-test_xattr_platform.$(OBJEXT) \
libarchive/test/libarchive_test-test_zip_filename_encoding.$(OBJEXT)
libarchive_test_OBJECTS = $(am_libarchive_test_OBJECTS)
libarchive_test_DEPENDENCIES = $(am__DEPENDENCIES_1)
@@ -1618,7 +1680,7 @@
$(top_srcdir)/build/autoconf/missing \
$(top_srcdir)/build/autoconf/test-driver \
$(top_srcdir)/build/pkgconfig/libarchive.pc.in COPYING INSTALL \
- NEWS README build/autoconf/compile build/autoconf/config.guess \
+ NEWS build/autoconf/compile build/autoconf/config.guess \
build/autoconf/config.rpath build/autoconf/config.sub \
build/autoconf/depcomp build/autoconf/install-sh \
build/autoconf/ltmain.sh build/autoconf/missing
@@ -1689,6 +1751,8 @@
LN_S = @LN_S@
LTLIBICONV = @LTLIBICONV@
LTLIBOBJS = @LTLIBOBJS@
+LT_SYS_LIBRARY_PATH = @LT_SYS_LIBRARY_PATH@
+MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
@@ -1760,6 +1824,7 @@
prefix = @prefix@
program_transform_name = @program_transform_name@
psdir = @psdir@
+runstatedir = @runstatedir@
sbindir = @sbindir@
sharedstatedir = @sharedstatedir@
srcdir = @srcdir@
@@ -1792,6 +1857,7 @@
#
EXTRA_DIST = \
CMakeLists.txt \
+ README.md \
build/autogen.sh \
build/bump-version.sh \
build/clean.sh \
@@ -1845,11 +1911,15 @@
libarchive/archive_entry_xattr.c libarchive/archive_getdate.c \
libarchive/archive_getdate.h libarchive/archive_hmac.c \
libarchive/archive_hmac_private.h libarchive/archive_match.c \
+ libarchive/archive_openssl_evp_private.h \
+ libarchive/archive_openssl_hmac_private.h \
libarchive/archive_options.c \
libarchive/archive_options_private.h \
libarchive/archive_pack_dev.h libarchive/archive_pack_dev.c \
libarchive/archive_pathmatch.c libarchive/archive_pathmatch.h \
libarchive/archive_platform.h \
+ libarchive/archive_platform_acl.h \
+ libarchive/archive_platform_xattr.h \
libarchive/archive_ppmd_private.h libarchive/archive_ppmd7.c \
libarchive/archive_ppmd7_private.h \
libarchive/archive_private.h libarchive/archive_random.c \
@@ -1903,8 +1973,8 @@
libarchive/archive_string.c libarchive/archive_string.h \
libarchive/archive_string_composition.h \
libarchive/archive_string_sprintf.c libarchive/archive_util.c \
+ libarchive/archive_version_details.c \
libarchive/archive_virtual.c libarchive/archive_write.c \
- libarchive/archive_write_disk_acl.c \
libarchive/archive_write_disk_posix.c \
libarchive/archive_write_disk_private.h \
libarchive/archive_write_disk_set_standard_lookup.c \
@@ -1949,7 +2019,8 @@
libarchive/archive_write_set_passphrase.c \
libarchive/archive_xxhash.h libarchive/config_freebsd.h \
libarchive/filter_fork_posix.c libarchive/filter_fork.h \
- libarchive/xxhash.c $(am__append_1)
+ libarchive/xxhash.c $(am__append_1) $(am__append_2) \
+ $(am__append_3) $(am__append_4) $(am__append_5)
# -no-undefined marks that libarchive doesn't rely on symbols
# defined in the application. This is mandatory for cygwin.
@@ -2016,7 +2087,9 @@
# Sources needed by all test programs
test_utils_SOURCES = \
test_utils/test_utils.c \
- test_utils/test_utils.h
+ test_utils/test_utils.h \
+ test_utils/test_main.c \
+ test_utils/test_common.h
#
@@ -2027,14 +2100,14 @@
libarchive_test_SOURCES = \
$(libarchive_la_SOURCES) \
$(test_utils_SOURCES) \
- libarchive/test/main.c \
libarchive/test/read_open_memory.c \
libarchive/test/test.h \
- libarchive/test/test_acl_freebsd_posix1e.c \
- libarchive/test/test_acl_freebsd_nfs4.c \
libarchive/test/test_acl_nfs4.c \
libarchive/test/test_acl_pax.c \
+ libarchive/test/test_acl_platform_nfs4.c \
+ libarchive/test/test_acl_platform_posix1e.c \
libarchive/test/test_acl_posix1e.c \
+ libarchive/test/test_acl_text.c \
libarchive/test/test_archive_api_feature.c \
libarchive/test/test_archive_clear_error.c \
libarchive/test/test_archive_cmdline.c \
@@ -2079,8 +2152,11 @@
libarchive/test/test_compat_lzop.c \
libarchive/test/test_compat_mac.c \
libarchive/test/test_compat_pax_libarchive_2x.c \
+ libarchive/test/test_compat_perl_archive_tar.c \
+ libarchive/test/test_compat_plexus_archiver_tar.c \
libarchive/test/test_compat_solaris_tar_acl.c \
libarchive/test/test_compat_solaris_pax_sparse.c \
+ libarchive/test/test_compat_star_acl.c \
libarchive/test/test_compat_tar_hardlink.c \
libarchive/test/test_compat_uudecode.c \
libarchive/test/test_compat_uudecode_large.c \
@@ -2159,6 +2235,7 @@
libarchive/test/test_read_format_lha_bugfix_0.c \
libarchive/test/test_read_format_lha_filename.c \
libarchive/test/test_read_format_mtree.c \
+ libarchive/test/test_read_format_mtree_crash747.c \
libarchive/test/test_read_format_pax_bz2.c \
libarchive/test/test_read_format_rar.c \
libarchive/test/test_read_format_rar_encryption_data.c \
@@ -2185,6 +2262,8 @@
libarchive/test/test_read_format_zip_encryption_partially.c \
libarchive/test/test_read_format_zip_encryption_header.c \
libarchive/test/test_read_format_zip_filename.c \
+ libarchive/test/test_read_format_zip_high_compression.c \
+ libarchive/test/test_read_format_zip_jar.c \
libarchive/test/test_read_format_zip_mac_metadata.c \
libarchive/test/test_read_format_zip_malformed.c \
libarchive/test/test_read_format_zip_msdos.c \
@@ -2196,7 +2275,9 @@
libarchive/test/test_read_format_zip_winzip_aes.c \
libarchive/test/test_read_format_zip_winzip_aes_large.c \
libarchive/test/test_read_format_zip_zip64.c \
+ libarchive/test/test_read_format_zip_with_invalid_traditional_eocd.c \
libarchive/test/test_read_large.c \
+ libarchive/test/test_read_pax_schily_xattr.c \
libarchive/test/test_read_pax_truncated.c \
libarchive/test/test_read_position.c \
libarchive/test/test_read_set_format.c \
@@ -2219,6 +2300,9 @@
libarchive/test/test_write_disk_no_hfs_compression.c \
libarchive/test/test_write_disk_perms.c \
libarchive/test/test_write_disk_secure.c \
+ libarchive/test/test_write_disk_secure744.c \
+ libarchive/test/test_write_disk_secure745.c \
+ libarchive/test/test_write_disk_secure746.c \
libarchive/test/test_write_disk_sparse.c \
libarchive/test/test_write_disk_symlink.c \
libarchive/test/test_write_disk_times.c \
@@ -2280,19 +2364,28 @@
libarchive/test/test_write_format_zip_zip64.c \
libarchive/test/test_write_open_memory.c \
libarchive/test/test_write_read_format_zip.c \
+ libarchive/test/test_xattr_platform.c \
libarchive/test/test_zip_filename_encoding.c
-libarchive_test_CPPFLAGS = -I$(top_srcdir)/libarchive -I$(top_srcdir)/test_utils -I$(top_builddir)/libarchive/test -DLIBARCHIVE_STATIC $(PLATFORMCPPFLAGS)
+libarchive_test_CPPFLAGS = \
+ -I$(top_srcdir)/libarchive \
+ -I$(top_srcdir)/libarchive/test \
+ -I$(top_srcdir)/test_utils \
+ -I$(top_builddir)/libarchive/test \
+ -DLIBARCHIVE_STATIC $(PLATFORMCPPFLAGS)
+
libarchive_test_LDADD = $(LTLIBICONV)
libarchive_TESTS_ENVIRONMENT = LIBARCHIVE_TEST_FILES=`cd $(top_srcdir);/bin/pwd`/libarchive/test LRZIP=NOCONFIG
libarchive_test_EXTRA_DIST = \
libarchive/test/list.h \
- libarchive/test/test_acl_pax.tar.uu \
+ libarchive/test/test_acl_pax_posix1e.tar.uu \
+ libarchive/test/test_acl_pax_nfs4.tar.uu \
libarchive/test/test_archive_string_conversion.txt.Z.uu \
libarchive/test/test_compat_bzip2_1.tbz.uu \
libarchive/test/test_compat_bzip2_2.tbz.uu \
libarchive/test/test_compat_cpio_1.cpio.uu \
libarchive/test/test_compat_gtar_1.tar.uu \
+ libarchive/test/test_compat_gtar_2.tar.uu \
libarchive/test/test_compat_gzip_1.tgz.uu \
libarchive/test/test_compat_gzip_2.tgz.uu \
libarchive/test/test_compat_lz4_1.tar.lz4.uu \
@@ -2318,9 +2411,13 @@
libarchive/test/test_compat_mac-1.tar.Z.uu \
libarchive/test/test_compat_mac-2.tar.Z.uu \
libarchive/test/test_compat_pax_libarchive_2x.tar.Z.uu \
+ libarchive/test/test_compat_perl_archive_tar.tar.uu \
+ libarchive/test/test_compat_plexus_archiver_tar.tar.uu \
libarchive/test/test_compat_solaris_pax_sparse_1.pax.Z.uu \
libarchive/test/test_compat_solaris_pax_sparse_2.pax.Z.uu \
libarchive/test/test_compat_solaris_tar_acl.tar.uu \
+ libarchive/test/test_compat_star_acl_nfs4.tar.uu \
+ libarchive/test/test_compat_star_acl_posix1e.tar.uu \
libarchive/test/test_compat_tar_hardlink_1.tar.uu \
libarchive/test/test_compat_uudecode_large.tar.Z.uu \
libarchive/test/test_compat_xz_1.txz.uu \
@@ -2358,6 +2455,7 @@
libarchive/test/test_read_filter_lrzip.tar.lrz.uu \
libarchive/test/test_read_filter_lzop.tar.lzo.uu \
libarchive/test/test_read_filter_lzop_multiple_parts.tar.lzo.uu \
+ libarchive/test/test_read_format_mtree_crash747.mtree.bz2.uu \
libarchive/test/test_read_format_7zip_bcj2_bzip2.7z.uu \
libarchive/test/test_read_format_7zip_bcj2_copy_1.7z.uu \
libarchive/test/test_read_format_7zip_bcj2_copy_2.7z.uu \
@@ -2461,6 +2559,7 @@
libarchive/test/test_read_format_rar_subblock.rar.uu \
libarchive/test/test_read_format_rar_unicode.rar.uu \
libarchive/test/test_read_format_rar_windows.rar.uu \
+ libarchive/test/test_read_format_raw.bufr.uu \
libarchive/test/test_read_format_raw.data.Z.uu \
libarchive/test/test_read_format_raw.data.uu \
libarchive/test/test_read_format_tar_concatenated.tar.uu \
@@ -2483,7 +2582,9 @@
libarchive/test/test_read_format_zip_filename_utf8_jp.zip.uu \
libarchive/test/test_read_format_zip_filename_utf8_ru.zip.uu \
libarchive/test/test_read_format_zip_filename_utf8_ru2.zip.uu \
+ libarchive/test/test_read_format_zip_high_compression.zip.uu \
libarchive/test/test_read_format_zip_length_at_end.zip.uu \
+ libarchive/test/test_read_format_zip_jar.jar.uu \
libarchive/test/test_read_format_zip_mac_metadata.zip.uu \
libarchive/test/test_read_format_zip_malformed1.zip.uu \
libarchive/test/test_read_format_zip_msdos.zip.uu \
@@ -2500,6 +2601,7 @@
libarchive/test/test_read_format_zip_winzip_aes256.zip.uu \
libarchive/test/test_read_format_zip_winzip_aes256_large.zip.uu \
libarchive/test/test_read_format_zip_winzip_aes256_stored.zip.uu \
+ libarchive/test/test_read_format_zip_with_invalid_traditional_eocd.zip.uu \
libarchive/test/test_read_format_zip_zip64a.zip.uu \
libarchive/test/test_read_format_zip_zip64b.zip.uu \
libarchive/test/test_read_large_splitted_rar_aa.uu \
@@ -2507,6 +2609,7 @@
libarchive/test/test_read_large_splitted_rar_ac.uu \
libarchive/test/test_read_large_splitted_rar_ad.uu \
libarchive/test/test_read_large_splitted_rar_ae.uu \
+ libarchive/test/test_read_pax_schily_xattr.tar.uu \
libarchive/test/test_read_splitted_rar_aa.uu \
libarchive/test/test_read_splitted_rar_ab.uu \
libarchive/test/test_read_splitted_rar_ac.uu \
@@ -2543,7 +2646,7 @@
#
bsdtar_SOURCES = tar/bsdtar.c tar/bsdtar.h tar/bsdtar_platform.h \
tar/cmdline.c tar/creation_set.c tar/read.c tar/subst.c \
- tar/util.c tar/write.c $(am__append_2)
+ tar/util.c tar/write.c $(am__append_6)
bsdtar_DEPENDENCIES = libarchive.la libarchive_fe.la
@STATIC_BSDTAR_FALSE at bsdtar_ldstatic =
@STATIC_BSDTAR_TRUE at bsdtar_ldstatic = -static
@@ -2569,7 +2672,6 @@
#
bsdtar_test_SOURCES = \
$(test_utils_SOURCES) \
- tar/test/main.c \
tar/test/test.h \
tar/test/test_0.c \
tar/test/test_basic.c \
@@ -2596,10 +2698,12 @@
tar/test/test_option_T_upper.c \
tar/test/test_option_U_upper.c \
tar/test/test_option_X_upper.c \
+ tar/test/test_option_acls.c \
tar/test/test_option_a.c \
tar/test/test_option_b.c \
tar/test/test_option_b64encode.c \
tar/test/test_option_exclude.c \
+ tar/test/test_option_fflags.c \
tar/test/test_option_gid_gname.c \
tar/test/test_option_grzip.c \
tar/test/test_option_j.c \
@@ -2619,6 +2723,7 @@
tar/test/test_option_s.c \
tar/test/test_option_uid_uname.c \
tar/test/test_option_uuencode.c \
+ tar/test/test_option_xattrs.c \
tar/test/test_option_xz.c \
tar/test/test_option_z.c \
tar/test/test_patterns.c \
@@ -2632,7 +2737,8 @@
bsdtar_test_CPPFLAGS = \
-I$(top_srcdir)/libarchive -I$(top_srcdir)/libarchive_fe \
-I$(top_srcdir)/test_utils \
- -I$(top_srcdir)/tar -I$(top_builddir)/tar/test \
+ -I$(top_srcdir)/tar -I$(top_srcdir)/tar/test \
+ -I$(top_builddir)/tar/test \
$(PLATFORMCPPFLAGS)
@BUILD_BSDTAR_FALSE at bsdtar_test_programs =
@@ -2668,7 +2774,7 @@
#
#
bsdcpio_SOURCES = cpio/cmdline.c cpio/cpio.c cpio/cpio.h \
- cpio/cpio_platform.h $(am__append_3)
+ cpio/cpio_platform.h $(am__append_7)
bsdcpio_DEPENDENCIES = libarchive.la libarchive_fe.la
@STATIC_BSDCPIO_FALSE at bsdcpio_ldstatic =
@STATIC_BSDCPIO_TRUE at bsdcpio_ldstatic = -static
@@ -2697,7 +2803,6 @@
bsdcpio_test_SOURCES = \
$(test_utils_SOURCES) \
cpio/cmdline.c \
- cpio/test/main.c \
cpio/test/test.h \
cpio/test/test_0.c \
cpio/test/test_basic.c \
@@ -2749,7 +2854,8 @@
bsdcpio_test_CPPFLAGS = \
-I$(top_srcdir)/libarchive -I$(top_srcdir)/libarchive_fe \
-I$(top_srcdir)/test_utils \
- -I$(top_srcdir)/cpio -I$(top_builddir)/cpio/test \
+ -I$(top_srcdir)/cpio -I$(top_srcdir)/cpio/test \
+ -I$(top_builddir)/cpio/test \
$(PLATFORMCPPFLAGS)
bsdcpio_test_LDADD = libarchive_fe.la
@@ -2792,7 +2898,7 @@
#
#
bsdcat_SOURCES = cat/bsdcat.c cat/bsdcat.h cat/bsdcat_platform.h \
- cat/cmdline.c $(am__append_4)
+ cat/cmdline.c $(am__append_8)
bsdcat_DEPENDENCIES = libarchive.la libarchive_fe.la
@STATIC_BSDCAT_FALSE at bsdcat_ldstatic =
@STATIC_BSDCAT_TRUE at bsdcat_ldstatic = -static
@@ -2817,7 +2923,6 @@
#
bsdcat_test_SOURCES = \
$(test_utils_SOURCES) \
- cat/test/main.c \
cat/test/test.h \
cat/test/test_0.c \
cat/test/test_empty_gz.c \
@@ -2838,7 +2943,8 @@
bsdcat_test_CPPFLAGS = \
-I$(top_srcdir)/libarchive -I$(top_srcdir)/libarchive_fe \
-I$(top_srcdir)/test_utils \
- -I$(top_srcdir)/cat -I$(top_builddir)/cat/test \
+ -I$(top_srcdir)/cat -I$(top_srcdir)/cat/test \
+ -I$(top_builddir)/cat/test \
$(PLATFORMCPPFLAGS)
bsdcat_test_LDADD = libarchive_fe.la
@@ -2866,7 +2972,7 @@
.SUFFIXES: .c .lo .log .o .obj .test .test$(EXEEXT) .trs
am--refresh: Makefile
@:
-$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
@@ -2892,9 +2998,9 @@
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
$(SHELL) ./config.status --recheck
-$(top_srcdir)/configure: $(am__configure_deps)
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
$(am__cd) $(srcdir) && $(AUTOCONF)
-$(ACLOCAL_M4): $(am__aclocal_m4_deps)
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
$(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
$(am__aclocal_m4_deps):
@@ -2905,7 +3011,7 @@
stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
@rm -f stamp-h1
cd $(top_builddir) && $(SHELL) ./config.status config.h
-$(srcdir)/config.h.in: $(am__configure_deps)
+$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
($(am__cd) $(top_srcdir) && $(AUTOHEADER))
rm -f stamp-h1
touch $@
@@ -3133,12 +3239,12 @@
libarchive/$(DEPDIR)/$(am__dirstamp)
libarchive/archive_util.lo: libarchive/$(am__dirstamp) \
libarchive/$(DEPDIR)/$(am__dirstamp)
+libarchive/archive_version_details.lo: libarchive/$(am__dirstamp) \
+ libarchive/$(DEPDIR)/$(am__dirstamp)
libarchive/archive_virtual.lo: libarchive/$(am__dirstamp) \
libarchive/$(DEPDIR)/$(am__dirstamp)
libarchive/archive_write.lo: libarchive/$(am__dirstamp) \
libarchive/$(DEPDIR)/$(am__dirstamp)
-libarchive/archive_write_disk_acl.lo: libarchive/$(am__dirstamp) \
- libarchive/$(DEPDIR)/$(am__dirstamp)
libarchive/archive_write_disk_posix.lo: libarchive/$(am__dirstamp) \
libarchive/$(DEPDIR)/$(am__dirstamp)
libarchive/archive_write_disk_set_standard_lookup.lo: \
@@ -3263,6 +3369,14 @@
libarchive/$(DEPDIR)/$(am__dirstamp)
libarchive/filter_fork_windows.lo: libarchive/$(am__dirstamp) \
libarchive/$(DEPDIR)/$(am__dirstamp)
+libarchive/archive_disk_acl_linux.lo: libarchive/$(am__dirstamp) \
+ libarchive/$(DEPDIR)/$(am__dirstamp)
+libarchive/archive_disk_acl_sunos.lo: libarchive/$(am__dirstamp) \
+ libarchive/$(DEPDIR)/$(am__dirstamp)
+libarchive/archive_disk_acl_darwin.lo: libarchive/$(am__dirstamp) \
+ libarchive/$(DEPDIR)/$(am__dirstamp)
+libarchive/archive_disk_acl_freebsd.lo: libarchive/$(am__dirstamp) \
+ libarchive/$(DEPDIR)/$(am__dirstamp)
libarchive.la: $(libarchive_la_OBJECTS) $(libarchive_la_DEPENDENCIES) $(EXTRA_libarchive_la_DEPENDENCIES)
$(AM_V_CCLD)$(libarchive_la_LINK) -rpath $(libdir) $(libarchive_la_OBJECTS) $(libarchive_la_LIBADD) $(LIBS)
@@ -3364,6 +3478,9 @@
test_utils/bsdcat_test-test_utils.$(OBJEXT): \
test_utils/$(am__dirstamp) \
test_utils/$(DEPDIR)/$(am__dirstamp)
+test_utils/bsdcat_test-test_main.$(OBJEXT): \
+ test_utils/$(am__dirstamp) \
+ test_utils/$(DEPDIR)/$(am__dirstamp)
cat/test/$(am__dirstamp):
@$(MKDIR_P) cat/test
@: > cat/test/$(am__dirstamp)
@@ -3370,8 +3487,6 @@
cat/test/$(DEPDIR)/$(am__dirstamp):
@$(MKDIR_P) cat/test/$(DEPDIR)
@: > cat/test/$(DEPDIR)/$(am__dirstamp)
-cat/test/bsdcat_test-main.$(OBJEXT): cat/test/$(am__dirstamp) \
- cat/test/$(DEPDIR)/$(am__dirstamp)
cat/test/bsdcat_test-test_0.$(OBJEXT): cat/test/$(am__dirstamp) \
cat/test/$(DEPDIR)/$(am__dirstamp)
cat/test/bsdcat_test-test_empty_gz.$(OBJEXT): \
@@ -3425,6 +3540,9 @@
test_utils/bsdcpio_test-test_utils.$(OBJEXT): \
test_utils/$(am__dirstamp) \
test_utils/$(DEPDIR)/$(am__dirstamp)
+test_utils/bsdcpio_test-test_main.$(OBJEXT): \
+ test_utils/$(am__dirstamp) \
+ test_utils/$(DEPDIR)/$(am__dirstamp)
cpio/bsdcpio_test-cmdline.$(OBJEXT): cpio/$(am__dirstamp) \
cpio/$(DEPDIR)/$(am__dirstamp)
cpio/test/$(am__dirstamp):
@@ -3433,8 +3551,6 @@
cpio/test/$(DEPDIR)/$(am__dirstamp):
@$(MKDIR_P) cpio/test/$(DEPDIR)
@: > cpio/test/$(DEPDIR)/$(am__dirstamp)
-cpio/test/bsdcpio_test-main.$(OBJEXT): cpio/test/$(am__dirstamp) \
- cpio/test/$(DEPDIR)/$(am__dirstamp)
cpio/test/bsdcpio_test-test_0.$(OBJEXT): cpio/test/$(am__dirstamp) \
cpio/test/$(DEPDIR)/$(am__dirstamp)
cpio/test/bsdcpio_test-test_basic.$(OBJEXT): \
@@ -3560,6 +3676,9 @@
test_utils/bsdtar_test-test_utils.$(OBJEXT): \
test_utils/$(am__dirstamp) \
test_utils/$(DEPDIR)/$(am__dirstamp)
+test_utils/bsdtar_test-test_main.$(OBJEXT): \
+ test_utils/$(am__dirstamp) \
+ test_utils/$(DEPDIR)/$(am__dirstamp)
tar/test/$(am__dirstamp):
@$(MKDIR_P) tar/test
@: > tar/test/$(am__dirstamp)
@@ -3566,8 +3685,6 @@
tar/test/$(DEPDIR)/$(am__dirstamp):
@$(MKDIR_P) tar/test/$(DEPDIR)
@: > tar/test/$(DEPDIR)/$(am__dirstamp)
-tar/test/bsdtar_test-main.$(OBJEXT): tar/test/$(am__dirstamp) \
- tar/test/$(DEPDIR)/$(am__dirstamp)
tar/test/bsdtar_test-test_0.$(OBJEXT): tar/test/$(am__dirstamp) \
tar/test/$(DEPDIR)/$(am__dirstamp)
tar/test/bsdtar_test-test_basic.$(OBJEXT): tar/test/$(am__dirstamp) \
@@ -3618,6 +3735,8 @@
tar/test/$(am__dirstamp) tar/test/$(DEPDIR)/$(am__dirstamp)
tar/test/bsdtar_test-test_option_X_upper.$(OBJEXT): \
tar/test/$(am__dirstamp) tar/test/$(DEPDIR)/$(am__dirstamp)
+tar/test/bsdtar_test-test_option_acls.$(OBJEXT): \
+ tar/test/$(am__dirstamp) tar/test/$(DEPDIR)/$(am__dirstamp)
tar/test/bsdtar_test-test_option_a.$(OBJEXT): \
tar/test/$(am__dirstamp) tar/test/$(DEPDIR)/$(am__dirstamp)
tar/test/bsdtar_test-test_option_b.$(OBJEXT): \
@@ -3626,6 +3745,8 @@
tar/test/$(am__dirstamp) tar/test/$(DEPDIR)/$(am__dirstamp)
tar/test/bsdtar_test-test_option_exclude.$(OBJEXT): \
tar/test/$(am__dirstamp) tar/test/$(DEPDIR)/$(am__dirstamp)
+tar/test/bsdtar_test-test_option_fflags.$(OBJEXT): \
+ tar/test/$(am__dirstamp) tar/test/$(DEPDIR)/$(am__dirstamp)
tar/test/bsdtar_test-test_option_gid_gname.$(OBJEXT): \
tar/test/$(am__dirstamp) tar/test/$(DEPDIR)/$(am__dirstamp)
tar/test/bsdtar_test-test_option_grzip.$(OBJEXT): \
@@ -3664,6 +3785,8 @@
tar/test/$(am__dirstamp) tar/test/$(DEPDIR)/$(am__dirstamp)
tar/test/bsdtar_test-test_option_uuencode.$(OBJEXT): \
tar/test/$(am__dirstamp) tar/test/$(DEPDIR)/$(am__dirstamp)
+tar/test/bsdtar_test-test_option_xattrs.$(OBJEXT): \
+ tar/test/$(am__dirstamp) tar/test/$(DEPDIR)/$(am__dirstamp)
tar/test/bsdtar_test-test_option_xz.$(OBJEXT): \
tar/test/$(am__dirstamp) tar/test/$(DEPDIR)/$(am__dirstamp)
tar/test/bsdtar_test-test_option_z.$(OBJEXT): \
@@ -3890,6 +4013,9 @@
libarchive/libarchive_test-archive_util.$(OBJEXT): \
libarchive/$(am__dirstamp) \
libarchive/$(DEPDIR)/$(am__dirstamp)
+libarchive/libarchive_test-archive_version_details.$(OBJEXT): \
+ libarchive/$(am__dirstamp) \
+ libarchive/$(DEPDIR)/$(am__dirstamp)
libarchive/libarchive_test-archive_virtual.$(OBJEXT): \
libarchive/$(am__dirstamp) \
libarchive/$(DEPDIR)/$(am__dirstamp)
@@ -3896,9 +4022,6 @@
libarchive/libarchive_test-archive_write.$(OBJEXT): \
libarchive/$(am__dirstamp) \
libarchive/$(DEPDIR)/$(am__dirstamp)
-libarchive/libarchive_test-archive_write_disk_acl.$(OBJEXT): \
- libarchive/$(am__dirstamp) \
- libarchive/$(DEPDIR)/$(am__dirstamp)
libarchive/libarchive_test-archive_write_disk_posix.$(OBJEXT): \
libarchive/$(am__dirstamp) \
libarchive/$(DEPDIR)/$(am__dirstamp)
@@ -4040,9 +4163,24 @@
libarchive/libarchive_test-filter_fork_windows.$(OBJEXT): \
libarchive/$(am__dirstamp) \
libarchive/$(DEPDIR)/$(am__dirstamp)
+libarchive/libarchive_test-archive_disk_acl_linux.$(OBJEXT): \
+ libarchive/$(am__dirstamp) \
+ libarchive/$(DEPDIR)/$(am__dirstamp)
+libarchive/libarchive_test-archive_disk_acl_sunos.$(OBJEXT): \
+ libarchive/$(am__dirstamp) \
+ libarchive/$(DEPDIR)/$(am__dirstamp)
+libarchive/libarchive_test-archive_disk_acl_darwin.$(OBJEXT): \
+ libarchive/$(am__dirstamp) \
+ libarchive/$(DEPDIR)/$(am__dirstamp)
+libarchive/libarchive_test-archive_disk_acl_freebsd.$(OBJEXT): \
+ libarchive/$(am__dirstamp) \
+ libarchive/$(DEPDIR)/$(am__dirstamp)
test_utils/libarchive_test-test_utils.$(OBJEXT): \
test_utils/$(am__dirstamp) \
test_utils/$(DEPDIR)/$(am__dirstamp)
+test_utils/libarchive_test-test_main.$(OBJEXT): \
+ test_utils/$(am__dirstamp) \
+ test_utils/$(DEPDIR)/$(am__dirstamp)
libarchive/test/$(am__dirstamp):
@$(MKDIR_P) libarchive/test
@: > libarchive/test/$(am__dirstamp)
@@ -4049,27 +4187,27 @@
libarchive/test/$(DEPDIR)/$(am__dirstamp):
@$(MKDIR_P) libarchive/test/$(DEPDIR)
@: > libarchive/test/$(DEPDIR)/$(am__dirstamp)
-libarchive/test/libarchive_test-main.$(OBJEXT): \
- libarchive/test/$(am__dirstamp) \
- libarchive/test/$(DEPDIR)/$(am__dirstamp)
libarchive/test/libarchive_test-read_open_memory.$(OBJEXT): \
libarchive/test/$(am__dirstamp) \
libarchive/test/$(DEPDIR)/$(am__dirstamp)
-libarchive/test/libarchive_test-test_acl_freebsd_posix1e.$(OBJEXT): \
+libarchive/test/libarchive_test-test_acl_nfs4.$(OBJEXT): \
libarchive/test/$(am__dirstamp) \
libarchive/test/$(DEPDIR)/$(am__dirstamp)
-libarchive/test/libarchive_test-test_acl_freebsd_nfs4.$(OBJEXT): \
+libarchive/test/libarchive_test-test_acl_pax.$(OBJEXT): \
libarchive/test/$(am__dirstamp) \
libarchive/test/$(DEPDIR)/$(am__dirstamp)
-libarchive/test/libarchive_test-test_acl_nfs4.$(OBJEXT): \
+libarchive/test/libarchive_test-test_acl_platform_nfs4.$(OBJEXT): \
libarchive/test/$(am__dirstamp) \
libarchive/test/$(DEPDIR)/$(am__dirstamp)
-libarchive/test/libarchive_test-test_acl_pax.$(OBJEXT): \
+libarchive/test/libarchive_test-test_acl_platform_posix1e.$(OBJEXT): \
libarchive/test/$(am__dirstamp) \
libarchive/test/$(DEPDIR)/$(am__dirstamp)
libarchive/test/libarchive_test-test_acl_posix1e.$(OBJEXT): \
libarchive/test/$(am__dirstamp) \
libarchive/test/$(DEPDIR)/$(am__dirstamp)
+libarchive/test/libarchive_test-test_acl_text.$(OBJEXT): \
+ libarchive/test/$(am__dirstamp) \
+ libarchive/test/$(DEPDIR)/$(am__dirstamp)
libarchive/test/libarchive_test-test_archive_api_feature.$(OBJEXT): \
libarchive/test/$(am__dirstamp) \
libarchive/test/$(DEPDIR)/$(am__dirstamp)
@@ -4202,6 +4340,12 @@
libarchive/test/libarchive_test-test_compat_pax_libarchive_2x.$(OBJEXT): \
libarchive/test/$(am__dirstamp) \
libarchive/test/$(DEPDIR)/$(am__dirstamp)
+libarchive/test/libarchive_test-test_compat_perl_archive_tar.$(OBJEXT): \
+ libarchive/test/$(am__dirstamp) \
+ libarchive/test/$(DEPDIR)/$(am__dirstamp)
+libarchive/test/libarchive_test-test_compat_plexus_archiver_tar.$(OBJEXT): \
+ libarchive/test/$(am__dirstamp) \
+ libarchive/test/$(DEPDIR)/$(am__dirstamp)
libarchive/test/libarchive_test-test_compat_solaris_tar_acl.$(OBJEXT): \
libarchive/test/$(am__dirstamp) \
libarchive/test/$(DEPDIR)/$(am__dirstamp)
@@ -4208,6 +4352,9 @@
libarchive/test/libarchive_test-test_compat_solaris_pax_sparse.$(OBJEXT): \
libarchive/test/$(am__dirstamp) \
libarchive/test/$(DEPDIR)/$(am__dirstamp)
+libarchive/test/libarchive_test-test_compat_star_acl.$(OBJEXT): \
+ libarchive/test/$(am__dirstamp) \
+ libarchive/test/$(DEPDIR)/$(am__dirstamp)
libarchive/test/libarchive_test-test_compat_tar_hardlink.$(OBJEXT): \
libarchive/test/$(am__dirstamp) \
libarchive/test/$(DEPDIR)/$(am__dirstamp)
@@ -4442,6 +4589,9 @@
libarchive/test/libarchive_test-test_read_format_mtree.$(OBJEXT): \
libarchive/test/$(am__dirstamp) \
libarchive/test/$(DEPDIR)/$(am__dirstamp)
+libarchive/test/libarchive_test-test_read_format_mtree_crash747.$(OBJEXT): \
+ libarchive/test/$(am__dirstamp) \
+ libarchive/test/$(DEPDIR)/$(am__dirstamp)
libarchive/test/libarchive_test-test_read_format_pax_bz2.$(OBJEXT): \
libarchive/test/$(am__dirstamp) \
libarchive/test/$(DEPDIR)/$(am__dirstamp)
@@ -4520,6 +4670,12 @@
libarchive/test/libarchive_test-test_read_format_zip_filename.$(OBJEXT): \
libarchive/test/$(am__dirstamp) \
libarchive/test/$(DEPDIR)/$(am__dirstamp)
+libarchive/test/libarchive_test-test_read_format_zip_high_compression.$(OBJEXT): \
+ libarchive/test/$(am__dirstamp) \
+ libarchive/test/$(DEPDIR)/$(am__dirstamp)
+libarchive/test/libarchive_test-test_read_format_zip_jar.$(OBJEXT): \
+ libarchive/test/$(am__dirstamp) \
+ libarchive/test/$(DEPDIR)/$(am__dirstamp)
libarchive/test/libarchive_test-test_read_format_zip_mac_metadata.$(OBJEXT): \
libarchive/test/$(am__dirstamp) \
libarchive/test/$(DEPDIR)/$(am__dirstamp)
@@ -4553,9 +4709,15 @@
libarchive/test/libarchive_test-test_read_format_zip_zip64.$(OBJEXT): \
libarchive/test/$(am__dirstamp) \
libarchive/test/$(DEPDIR)/$(am__dirstamp)
+libarchive/test/libarchive_test-test_read_format_zip_with_invalid_traditional_eocd.$(OBJEXT): \
+ libarchive/test/$(am__dirstamp) \
+ libarchive/test/$(DEPDIR)/$(am__dirstamp)
libarchive/test/libarchive_test-test_read_large.$(OBJEXT): \
libarchive/test/$(am__dirstamp) \
libarchive/test/$(DEPDIR)/$(am__dirstamp)
+libarchive/test/libarchive_test-test_read_pax_schily_xattr.$(OBJEXT): \
+ libarchive/test/$(am__dirstamp) \
+ libarchive/test/$(DEPDIR)/$(am__dirstamp)
libarchive/test/libarchive_test-test_read_pax_truncated.$(OBJEXT): \
libarchive/test/$(am__dirstamp) \
libarchive/test/$(DEPDIR)/$(am__dirstamp)
@@ -4622,6 +4784,15 @@
libarchive/test/libarchive_test-test_write_disk_secure.$(OBJEXT): \
libarchive/test/$(am__dirstamp) \
libarchive/test/$(DEPDIR)/$(am__dirstamp)
+libarchive/test/libarchive_test-test_write_disk_secure744.$(OBJEXT): \
+ libarchive/test/$(am__dirstamp) \
+ libarchive/test/$(DEPDIR)/$(am__dirstamp)
+libarchive/test/libarchive_test-test_write_disk_secure745.$(OBJEXT): \
+ libarchive/test/$(am__dirstamp) \
+ libarchive/test/$(DEPDIR)/$(am__dirstamp)
+libarchive/test/libarchive_test-test_write_disk_secure746.$(OBJEXT): \
+ libarchive/test/$(am__dirstamp) \
+ libarchive/test/$(DEPDIR)/$(am__dirstamp)
libarchive/test/libarchive_test-test_write_disk_sparse.$(OBJEXT): \
libarchive/test/$(am__dirstamp) \
libarchive/test/$(DEPDIR)/$(am__dirstamp)
@@ -4805,6 +4976,9 @@
libarchive/test/libarchive_test-test_write_read_format_zip.$(OBJEXT): \
libarchive/test/$(am__dirstamp) \
libarchive/test/$(DEPDIR)/$(am__dirstamp)
+libarchive/test/libarchive_test-test_xattr_platform.$(OBJEXT): \
+ libarchive/test/$(am__dirstamp) \
+ libarchive/test/$(DEPDIR)/$(am__dirstamp)
libarchive/test/libarchive_test-test_zip_filename_encoding.$(OBJEXT): \
libarchive/test/$(am__dirstamp) \
libarchive/test/$(DEPDIR)/$(am__dirstamp)
@@ -4833,7 +5007,6 @@
@AMDEP_TRUE@@am__include@ @am__quote at cat/$(DEPDIR)/bsdcat-bsdcat.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at cat/$(DEPDIR)/bsdcat-cmdline.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at cat/test/$(DEPDIR)/bsdcat_test-main.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at cat/test/$(DEPDIR)/bsdcat_test-test_0.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at cat/test/$(DEPDIR)/bsdcat_test-test_empty_gz.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at cat/test/$(DEPDIR)/bsdcat_test-test_empty_lz4.Po at am__quote@
@@ -4853,7 +5026,6 @@
@AMDEP_TRUE@@am__include@ @am__quote at cpio/$(DEPDIR)/bsdcpio-cpio.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at cpio/$(DEPDIR)/bsdcpio-cpio_windows.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at cpio/$(DEPDIR)/bsdcpio_test-cmdline.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at cpio/test/$(DEPDIR)/bsdcpio_test-main.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at cpio/test/$(DEPDIR)/bsdcpio_test-test_0.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at cpio/test/$(DEPDIR)/bsdcpio_test-test_basic.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at cpio/test/$(DEPDIR)/bsdcpio_test-test_cmdline.Po at am__quote@
@@ -4905,6 +5077,10 @@
@AMDEP_TRUE@@am__include@ @am__quote at libarchive/$(DEPDIR)/archive_cmdline.Plo at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at libarchive/$(DEPDIR)/archive_cryptor.Plo at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at libarchive/$(DEPDIR)/archive_digest.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at libarchive/$(DEPDIR)/archive_disk_acl_darwin.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at libarchive/$(DEPDIR)/archive_disk_acl_freebsd.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at libarchive/$(DEPDIR)/archive_disk_acl_linux.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at libarchive/$(DEPDIR)/archive_disk_acl_sunos.Plo at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at libarchive/$(DEPDIR)/archive_entry.Plo at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at libarchive/$(DEPDIR)/archive_entry_copy_bhfi.Plo at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at libarchive/$(DEPDIR)/archive_entry_copy_stat.Plo at am__quote@
@@ -4970,6 +5146,7 @@
@AMDEP_TRUE@@am__include@ @am__quote at libarchive/$(DEPDIR)/archive_string.Plo at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at libarchive/$(DEPDIR)/archive_string_sprintf.Plo at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at libarchive/$(DEPDIR)/archive_util.Plo at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at libarchive/$(DEPDIR)/archive_version_details.Plo at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at libarchive/$(DEPDIR)/archive_virtual.Plo at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at libarchive/$(DEPDIR)/archive_windows.Plo at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at libarchive/$(DEPDIR)/archive_write.Plo at am__quote@
@@ -4987,7 +5164,6 @@
@AMDEP_TRUE@@am__include@ @am__quote at libarchive/$(DEPDIR)/archive_write_add_filter_program.Plo at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at libarchive/$(DEPDIR)/archive_write_add_filter_uuencode.Plo at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at libarchive/$(DEPDIR)/archive_write_add_filter_xz.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at libarchive/$(DEPDIR)/archive_write_disk_acl.Plo at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at libarchive/$(DEPDIR)/archive_write_disk_posix.Plo at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at libarchive/$(DEPDIR)/archive_write_disk_set_standard_lookup.Plo at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at libarchive/$(DEPDIR)/archive_write_disk_windows.Plo at am__quote@
@@ -5022,6 +5198,10 @@
@AMDEP_TRUE@@am__include@ @am__quote at libarchive/$(DEPDIR)/libarchive_test-archive_cmdline.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at libarchive/$(DEPDIR)/libarchive_test-archive_cryptor.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at libarchive/$(DEPDIR)/libarchive_test-archive_digest.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at libarchive/$(DEPDIR)/libarchive_test-archive_disk_acl_darwin.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at libarchive/$(DEPDIR)/libarchive_test-archive_disk_acl_freebsd.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at libarchive/$(DEPDIR)/libarchive_test-archive_disk_acl_linux.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at libarchive/$(DEPDIR)/libarchive_test-archive_disk_acl_sunos.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at libarchive/$(DEPDIR)/libarchive_test-archive_entry.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at libarchive/$(DEPDIR)/libarchive_test-archive_entry_copy_bhfi.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at libarchive/$(DEPDIR)/libarchive_test-archive_entry_copy_stat.Po at am__quote@
@@ -5087,6 +5267,7 @@
@AMDEP_TRUE@@am__include@ @am__quote at libarchive/$(DEPDIR)/libarchive_test-archive_string.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at libarchive/$(DEPDIR)/libarchive_test-archive_string_sprintf.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at libarchive/$(DEPDIR)/libarchive_test-archive_util.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at libarchive/$(DEPDIR)/libarchive_test-archive_version_details.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at libarchive/$(DEPDIR)/libarchive_test-archive_virtual.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at libarchive/$(DEPDIR)/libarchive_test-archive_windows.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at libarchive/$(DEPDIR)/libarchive_test-archive_write.Po at am__quote@
@@ -5104,7 +5285,6 @@
@AMDEP_TRUE@@am__include@ @am__quote at libarchive/$(DEPDIR)/libarchive_test-archive_write_add_filter_program.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at libarchive/$(DEPDIR)/libarchive_test-archive_write_add_filter_uuencode.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at libarchive/$(DEPDIR)/libarchive_test-archive_write_add_filter_xz.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at libarchive/$(DEPDIR)/libarchive_test-archive_write_disk_acl.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at libarchive/$(DEPDIR)/libarchive_test-archive_write_disk_posix.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at libarchive/$(DEPDIR)/libarchive_test-archive_write_disk_set_standard_lookup.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at libarchive/$(DEPDIR)/libarchive_test-archive_write_disk_windows.Po at am__quote@
@@ -5136,13 +5316,13 @@
@AMDEP_TRUE@@am__include@ @am__quote at libarchive/$(DEPDIR)/libarchive_test-filter_fork_windows.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at libarchive/$(DEPDIR)/libarchive_test-xxhash.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at libarchive/$(DEPDIR)/xxhash.Plo at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at libarchive/test/$(DEPDIR)/libarchive_test-main.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at libarchive/test/$(DEPDIR)/libarchive_test-read_open_memory.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at libarchive/test/$(DEPDIR)/libarchive_test-test_acl_freebsd_nfs4.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at libarchive/test/$(DEPDIR)/libarchive_test-test_acl_freebsd_posix1e.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at libarchive/test/$(DEPDIR)/libarchive_test-test_acl_nfs4.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at libarchive/test/$(DEPDIR)/libarchive_test-test_acl_pax.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at libarchive/test/$(DEPDIR)/libarchive_test-test_acl_platform_nfs4.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at libarchive/test/$(DEPDIR)/libarchive_test-test_acl_platform_posix1e.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at libarchive/test/$(DEPDIR)/libarchive_test-test_acl_posix1e.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at libarchive/test/$(DEPDIR)/libarchive_test-test_acl_text.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at libarchive/test/$(DEPDIR)/libarchive_test-test_archive_api_feature.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at libarchive/test/$(DEPDIR)/libarchive_test-test_archive_clear_error.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at libarchive/test/$(DEPDIR)/libarchive_test-test_archive_cmdline.Po at am__quote@
@@ -5187,8 +5367,11 @@
@AMDEP_TRUE@@am__include@ @am__quote at libarchive/test/$(DEPDIR)/libarchive_test-test_compat_lzop.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at libarchive/test/$(DEPDIR)/libarchive_test-test_compat_mac.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at libarchive/test/$(DEPDIR)/libarchive_test-test_compat_pax_libarchive_2x.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at libarchive/test/$(DEPDIR)/libarchive_test-test_compat_perl_archive_tar.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at libarchive/test/$(DEPDIR)/libarchive_test-test_compat_plexus_archiver_tar.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at libarchive/test/$(DEPDIR)/libarchive_test-test_compat_solaris_pax_sparse.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at libarchive/test/$(DEPDIR)/libarchive_test-test_compat_solaris_tar_acl.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at libarchive/test/$(DEPDIR)/libarchive_test-test_compat_star_acl.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at libarchive/test/$(DEPDIR)/libarchive_test-test_compat_tar_hardlink.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at libarchive/test/$(DEPDIR)/libarchive_test-test_compat_uudecode.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at libarchive/test/$(DEPDIR)/libarchive_test-test_compat_uudecode_large.Po at am__quote@
@@ -5267,6 +5450,7 @@
@AMDEP_TRUE@@am__include@ @am__quote at libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_lha_bugfix_0.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_lha_filename.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_mtree.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_mtree_crash747.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_pax_bz2.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_rar.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_rar_encryption_data.Po at am__quote@
@@ -5293,6 +5477,8 @@
@AMDEP_TRUE@@am__include@ @am__quote at libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_zip_encryption_header.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_zip_encryption_partially.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_zip_filename.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_zip_high_compression.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_zip_jar.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_zip_mac_metadata.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_zip_malformed.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_zip_msdos.Po at am__quote@
@@ -5303,8 +5489,10 @@
@AMDEP_TRUE@@am__include@ @am__quote at libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_zip_traditional_encryption_data.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_zip_winzip_aes.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_zip_winzip_aes_large.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_zip_with_invalid_traditional_eocd.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_zip_zip64.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at libarchive/test/$(DEPDIR)/libarchive_test-test_read_large.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at libarchive/test/$(DEPDIR)/libarchive_test-test_read_pax_schily_xattr.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at libarchive/test/$(DEPDIR)/libarchive_test-test_read_pax_truncated.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at libarchive/test/$(DEPDIR)/libarchive_test-test_read_position.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at libarchive/test/$(DEPDIR)/libarchive_test-test_read_set_format.Po at am__quote@
@@ -5327,6 +5515,9 @@
@AMDEP_TRUE@@am__include@ @am__quote at libarchive/test/$(DEPDIR)/libarchive_test-test_write_disk_no_hfs_compression.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at libarchive/test/$(DEPDIR)/libarchive_test-test_write_disk_perms.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at libarchive/test/$(DEPDIR)/libarchive_test-test_write_disk_secure.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at libarchive/test/$(DEPDIR)/libarchive_test-test_write_disk_secure744.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at libarchive/test/$(DEPDIR)/libarchive_test-test_write_disk_secure745.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at libarchive/test/$(DEPDIR)/libarchive_test-test_write_disk_secure746.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at libarchive/test/$(DEPDIR)/libarchive_test-test_write_disk_sparse.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at libarchive/test/$(DEPDIR)/libarchive_test-test_write_disk_symlink.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at libarchive/test/$(DEPDIR)/libarchive_test-test_write_disk_times.Po at am__quote@
@@ -5388,6 +5579,7 @@
@AMDEP_TRUE@@am__include@ @am__quote at libarchive/test/$(DEPDIR)/libarchive_test-test_write_format_zip_zip64.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at libarchive/test/$(DEPDIR)/libarchive_test-test_write_open_memory.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at libarchive/test/$(DEPDIR)/libarchive_test-test_write_read_format_zip.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at libarchive/test/$(DEPDIR)/libarchive_test-test_xattr_platform.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at libarchive/test/$(DEPDIR)/libarchive_test-test_zip_filename_encoding.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at libarchive_fe/$(DEPDIR)/libarchive_fe_la-err.Plo at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at libarchive_fe/$(DEPDIR)/libarchive_fe_la-line_reader.Plo at am__quote@
@@ -5400,7 +5592,6 @@
@AMDEP_TRUE@@am__include@ @am__quote at tar/$(DEPDIR)/bsdtar-subst.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at tar/$(DEPDIR)/bsdtar-util.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at tar/$(DEPDIR)/bsdtar-write.Po at am__quote@
- at AMDEP_TRUE@@am__include@ @am__quote at tar/test/$(DEPDIR)/bsdtar_test-main.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at tar/test/$(DEPDIR)/bsdtar_test-test_0.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at tar/test/$(DEPDIR)/bsdtar_test-test_basic.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at tar/test/$(DEPDIR)/bsdtar_test-test_copy.Po at am__quote@
@@ -5427,9 +5618,11 @@
@AMDEP_TRUE@@am__include@ @am__quote at tar/test/$(DEPDIR)/bsdtar_test-test_option_U_upper.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at tar/test/$(DEPDIR)/bsdtar_test-test_option_X_upper.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at tar/test/$(DEPDIR)/bsdtar_test-test_option_a.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at tar/test/$(DEPDIR)/bsdtar_test-test_option_acls.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at tar/test/$(DEPDIR)/bsdtar_test-test_option_b.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at tar/test/$(DEPDIR)/bsdtar_test-test_option_b64encode.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at tar/test/$(DEPDIR)/bsdtar_test-test_option_exclude.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at tar/test/$(DEPDIR)/bsdtar_test-test_option_fflags.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at tar/test/$(DEPDIR)/bsdtar_test-test_option_gid_gname.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at tar/test/$(DEPDIR)/bsdtar_test-test_option_grzip.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at tar/test/$(DEPDIR)/bsdtar_test-test_option_j.Po at am__quote@
@@ -5449,6 +5642,7 @@
@AMDEP_TRUE@@am__include@ @am__quote at tar/test/$(DEPDIR)/bsdtar_test-test_option_s.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at tar/test/$(DEPDIR)/bsdtar_test-test_option_uid_uname.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at tar/test/$(DEPDIR)/bsdtar_test-test_option_uuencode.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at tar/test/$(DEPDIR)/bsdtar_test-test_option_xattrs.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at tar/test/$(DEPDIR)/bsdtar_test-test_option_xz.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at tar/test/$(DEPDIR)/bsdtar_test-test_option_z.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at tar/test/$(DEPDIR)/bsdtar_test-test_patterns.Po at am__quote@
@@ -5458,9 +5652,13 @@
@AMDEP_TRUE@@am__include@ @am__quote at tar/test/$(DEPDIR)/bsdtar_test-test_symlink_dir.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at tar/test/$(DEPDIR)/bsdtar_test-test_version.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at tar/test/$(DEPDIR)/bsdtar_test-test_windows.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at test_utils/$(DEPDIR)/bsdcat_test-test_main.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at test_utils/$(DEPDIR)/bsdcat_test-test_utils.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at test_utils/$(DEPDIR)/bsdcpio_test-test_main.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at test_utils/$(DEPDIR)/bsdcpio_test-test_utils.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at test_utils/$(DEPDIR)/bsdtar_test-test_main.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at test_utils/$(DEPDIR)/bsdtar_test-test_utils.Po at am__quote@
+ at AMDEP_TRUE@@am__include@ @am__quote at test_utils/$(DEPDIR)/libarchive_test-test_main.Po at am__quote@
@AMDEP_TRUE@@am__include@ @am__quote at test_utils/$(DEPDIR)/libarchive_test-test_utils.Po at am__quote@
.c.o:
@@ -5550,19 +5748,19 @@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcat_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_utils/bsdcat_test-test_utils.obj `if test -f 'test_utils/test_utils.c'; then $(CYGPATH_W) 'test_utils/test_utils.c'; else $(CYGPATH_W) '$(srcdir)/test_utils/test_utils.c'; fi`
-cat/test/bsdcat_test-main.o: cat/test/main.c
- at am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcat_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cat/test/bsdcat_test-main.o -MD -MP -MF cat/test/$(DEPDIR)/bsdcat_test-main.Tpo -c -o cat/test/bsdcat_test-main.o `test -f 'cat/test/main.c' || echo '$(srcdir)/'`cat/test/main.c
- at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) cat/test/$(DEPDIR)/bsdcat_test-main.Tpo cat/test/$(DEPDIR)/bsdcat_test-main.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cat/test/main.c' object='cat/test/bsdcat_test-main.o' libtool=no @AMDEPBACKSLASH@
+test_utils/bsdcat_test-test_main.o: test_utils/test_main.c
+ at am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcat_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_utils/bsdcat_test-test_main.o -MD -MP -MF test_utils/$(DEPDIR)/bsdcat_test-test_main.Tpo -c -o test_utils/bsdcat_test-test_main.o `test -f 'test_utils/test_main.c' || echo '$(srcdir)/'`test_utils/test_main.c
+ at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) test_utils/$(DEPDIR)/bsdcat_test-test_main.Tpo test_utils/$(DEPDIR)/bsdcat_test-test_main.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test_utils/test_main.c' object='test_utils/bsdcat_test-test_main.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcat_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cat/test/bsdcat_test-main.o `test -f 'cat/test/main.c' || echo '$(srcdir)/'`cat/test/main.c
+ at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcat_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_utils/bsdcat_test-test_main.o `test -f 'test_utils/test_main.c' || echo '$(srcdir)/'`test_utils/test_main.c
-cat/test/bsdcat_test-main.obj: cat/test/main.c
- at am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcat_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cat/test/bsdcat_test-main.obj -MD -MP -MF cat/test/$(DEPDIR)/bsdcat_test-main.Tpo -c -o cat/test/bsdcat_test-main.obj `if test -f 'cat/test/main.c'; then $(CYGPATH_W) 'cat/test/main.c'; else $(CYGPATH_W) '$(srcdir)/cat/test/main.c'; fi`
- at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) cat/test/$(DEPDIR)/bsdcat_test-main.Tpo cat/test/$(DEPDIR)/bsdcat_test-main.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cat/test/main.c' object='cat/test/bsdcat_test-main.obj' libtool=no @AMDEPBACKSLASH@
+test_utils/bsdcat_test-test_main.obj: test_utils/test_main.c
+ at am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcat_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_utils/bsdcat_test-test_main.obj -MD -MP -MF test_utils/$(DEPDIR)/bsdcat_test-test_main.Tpo -c -o test_utils/bsdcat_test-test_main.obj `if test -f 'test_utils/test_main.c'; then $(CYGPATH_W) 'test_utils/test_main.c'; else $(CYGPATH_W) '$(srcdir)/test_utils/test_main.c'; fi`
+ at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) test_utils/$(DEPDIR)/bsdcat_test-test_main.Tpo test_utils/$(DEPDIR)/bsdcat_test-test_main.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test_utils/test_main.c' object='test_utils/bsdcat_test-test_main.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcat_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cat/test/bsdcat_test-main.obj `if test -f 'cat/test/main.c'; then $(CYGPATH_W) 'cat/test/main.c'; else $(CYGPATH_W) '$(srcdir)/cat/test/main.c'; fi`
+ at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcat_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_utils/bsdcat_test-test_main.obj `if test -f 'test_utils/test_main.c'; then $(CYGPATH_W) 'test_utils/test_main.c'; else $(CYGPATH_W) '$(srcdir)/test_utils/test_main.c'; fi`
cat/test/bsdcat_test-test_0.o: cat/test/test_0.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcat_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cat/test/bsdcat_test-test_0.o -MD -MP -MF cat/test/$(DEPDIR)/bsdcat_test-test_0.Tpo -c -o cat/test/bsdcat_test-test_0.o `test -f 'cat/test/test_0.c' || echo '$(srcdir)/'`cat/test/test_0.c
@@ -5830,6 +6028,20 @@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_utils/bsdcpio_test-test_utils.obj `if test -f 'test_utils/test_utils.c'; then $(CYGPATH_W) 'test_utils/test_utils.c'; else $(CYGPATH_W) '$(srcdir)/test_utils/test_utils.c'; fi`
+test_utils/bsdcpio_test-test_main.o: test_utils/test_main.c
+ at am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_utils/bsdcpio_test-test_main.o -MD -MP -MF test_utils/$(DEPDIR)/bsdcpio_test-test_main.Tpo -c -o test_utils/bsdcpio_test-test_main.o `test -f 'test_utils/test_main.c' || echo '$(srcdir)/'`test_utils/test_main.c
+ at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) test_utils/$(DEPDIR)/bsdcpio_test-test_main.Tpo test_utils/$(DEPDIR)/bsdcpio_test-test_main.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test_utils/test_main.c' object='test_utils/bsdcpio_test-test_main.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_utils/bsdcpio_test-test_main.o `test -f 'test_utils/test_main.c' || echo '$(srcdir)/'`test_utils/test_main.c
+
+test_utils/bsdcpio_test-test_main.obj: test_utils/test_main.c
+ at am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_utils/bsdcpio_test-test_main.obj -MD -MP -MF test_utils/$(DEPDIR)/bsdcpio_test-test_main.Tpo -c -o test_utils/bsdcpio_test-test_main.obj `if test -f 'test_utils/test_main.c'; then $(CYGPATH_W) 'test_utils/test_main.c'; else $(CYGPATH_W) '$(srcdir)/test_utils/test_main.c'; fi`
+ at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) test_utils/$(DEPDIR)/bsdcpio_test-test_main.Tpo test_utils/$(DEPDIR)/bsdcpio_test-test_main.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test_utils/test_main.c' object='test_utils/bsdcpio_test-test_main.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_utils/bsdcpio_test-test_main.obj `if test -f 'test_utils/test_main.c'; then $(CYGPATH_W) 'test_utils/test_main.c'; else $(CYGPATH_W) '$(srcdir)/test_utils/test_main.c'; fi`
+
cpio/bsdcpio_test-cmdline.o: cpio/cmdline.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpio/bsdcpio_test-cmdline.o -MD -MP -MF cpio/$(DEPDIR)/bsdcpio_test-cmdline.Tpo -c -o cpio/bsdcpio_test-cmdline.o `test -f 'cpio/cmdline.c' || echo '$(srcdir)/'`cpio/cmdline.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) cpio/$(DEPDIR)/bsdcpio_test-cmdline.Tpo cpio/$(DEPDIR)/bsdcpio_test-cmdline.Po
@@ -5844,20 +6056,6 @@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpio/bsdcpio_test-cmdline.obj `if test -f 'cpio/cmdline.c'; then $(CYGPATH_W) 'cpio/cmdline.c'; else $(CYGPATH_W) '$(srcdir)/cpio/cmdline.c'; fi`
-cpio/test/bsdcpio_test-main.o: cpio/test/main.c
- at am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpio/test/bsdcpio_test-main.o -MD -MP -MF cpio/test/$(DEPDIR)/bsdcpio_test-main.Tpo -c -o cpio/test/bsdcpio_test-main.o `test -f 'cpio/test/main.c' || echo '$(srcdir)/'`cpio/test/main.c
- at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) cpio/test/$(DEPDIR)/bsdcpio_test-main.Tpo cpio/test/$(DEPDIR)/bsdcpio_test-main.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cpio/test/main.c' object='cpio/test/bsdcpio_test-main.o' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpio/test/bsdcpio_test-main.o `test -f 'cpio/test/main.c' || echo '$(srcdir)/'`cpio/test/main.c
-
-cpio/test/bsdcpio_test-main.obj: cpio/test/main.c
- at am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpio/test/bsdcpio_test-main.obj -MD -MP -MF cpio/test/$(DEPDIR)/bsdcpio_test-main.Tpo -c -o cpio/test/bsdcpio_test-main.obj `if test -f 'cpio/test/main.c'; then $(CYGPATH_W) 'cpio/test/main.c'; else $(CYGPATH_W) '$(srcdir)/cpio/test/main.c'; fi`
- at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) cpio/test/$(DEPDIR)/bsdcpio_test-main.Tpo cpio/test/$(DEPDIR)/bsdcpio_test-main.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='cpio/test/main.c' object='cpio/test/bsdcpio_test-main.obj' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o cpio/test/bsdcpio_test-main.obj `if test -f 'cpio/test/main.c'; then $(CYGPATH_W) 'cpio/test/main.c'; else $(CYGPATH_W) '$(srcdir)/cpio/test/main.c'; fi`
-
cpio/test/bsdcpio_test-test_0.o: cpio/test/test_0.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdcpio_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT cpio/test/bsdcpio_test-test_0.o -MD -MP -MF cpio/test/$(DEPDIR)/bsdcpio_test-test_0.Tpo -c -o cpio/test/bsdcpio_test-test_0.o `test -f 'cpio/test/test_0.c' || echo '$(srcdir)/'`cpio/test/test_0.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) cpio/test/$(DEPDIR)/bsdcpio_test-test_0.Tpo cpio/test/$(DEPDIR)/bsdcpio_test-test_0.Po
@@ -6628,19 +6826,19 @@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_utils/bsdtar_test-test_utils.obj `if test -f 'test_utils/test_utils.c'; then $(CYGPATH_W) 'test_utils/test_utils.c'; else $(CYGPATH_W) '$(srcdir)/test_utils/test_utils.c'; fi`
-tar/test/bsdtar_test-main.o: tar/test/main.c
- at am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tar/test/bsdtar_test-main.o -MD -MP -MF tar/test/$(DEPDIR)/bsdtar_test-main.Tpo -c -o tar/test/bsdtar_test-main.o `test -f 'tar/test/main.c' || echo '$(srcdir)/'`tar/test/main.c
- at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) tar/test/$(DEPDIR)/bsdtar_test-main.Tpo tar/test/$(DEPDIR)/bsdtar_test-main.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tar/test/main.c' object='tar/test/bsdtar_test-main.o' libtool=no @AMDEPBACKSLASH@
+test_utils/bsdtar_test-test_main.o: test_utils/test_main.c
+ at am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_utils/bsdtar_test-test_main.o -MD -MP -MF test_utils/$(DEPDIR)/bsdtar_test-test_main.Tpo -c -o test_utils/bsdtar_test-test_main.o `test -f 'test_utils/test_main.c' || echo '$(srcdir)/'`test_utils/test_main.c
+ at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) test_utils/$(DEPDIR)/bsdtar_test-test_main.Tpo test_utils/$(DEPDIR)/bsdtar_test-test_main.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test_utils/test_main.c' object='test_utils/bsdtar_test-test_main.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tar/test/bsdtar_test-main.o `test -f 'tar/test/main.c' || echo '$(srcdir)/'`tar/test/main.c
+ at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_utils/bsdtar_test-test_main.o `test -f 'test_utils/test_main.c' || echo '$(srcdir)/'`test_utils/test_main.c
-tar/test/bsdtar_test-main.obj: tar/test/main.c
- at am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tar/test/bsdtar_test-main.obj -MD -MP -MF tar/test/$(DEPDIR)/bsdtar_test-main.Tpo -c -o tar/test/bsdtar_test-main.obj `if test -f 'tar/test/main.c'; then $(CYGPATH_W) 'tar/test/main.c'; else $(CYGPATH_W) '$(srcdir)/tar/test/main.c'; fi`
- at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) tar/test/$(DEPDIR)/bsdtar_test-main.Tpo tar/test/$(DEPDIR)/bsdtar_test-main.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tar/test/main.c' object='tar/test/bsdtar_test-main.obj' libtool=no @AMDEPBACKSLASH@
+test_utils/bsdtar_test-test_main.obj: test_utils/test_main.c
+ at am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_utils/bsdtar_test-test_main.obj -MD -MP -MF test_utils/$(DEPDIR)/bsdtar_test-test_main.Tpo -c -o test_utils/bsdtar_test-test_main.obj `if test -f 'test_utils/test_main.c'; then $(CYGPATH_W) 'test_utils/test_main.c'; else $(CYGPATH_W) '$(srcdir)/test_utils/test_main.c'; fi`
+ at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) test_utils/$(DEPDIR)/bsdtar_test-test_main.Tpo test_utils/$(DEPDIR)/bsdtar_test-test_main.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test_utils/test_main.c' object='test_utils/bsdtar_test-test_main.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tar/test/bsdtar_test-main.obj `if test -f 'tar/test/main.c'; then $(CYGPATH_W) 'tar/test/main.c'; else $(CYGPATH_W) '$(srcdir)/tar/test/main.c'; fi`
+ at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_utils/bsdtar_test-test_main.obj `if test -f 'test_utils/test_main.c'; then $(CYGPATH_W) 'test_utils/test_main.c'; else $(CYGPATH_W) '$(srcdir)/test_utils/test_main.c'; fi`
tar/test/bsdtar_test-test_0.o: tar/test/test_0.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tar/test/bsdtar_test-test_0.o -MD -MP -MF tar/test/$(DEPDIR)/bsdtar_test-test_0.Tpo -c -o tar/test/bsdtar_test-test_0.o `test -f 'tar/test/test_0.c' || echo '$(srcdir)/'`tar/test/test_0.c
@@ -6992,6 +7190,20 @@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tar/test/bsdtar_test-test_option_X_upper.obj `if test -f 'tar/test/test_option_X_upper.c'; then $(CYGPATH_W) 'tar/test/test_option_X_upper.c'; else $(CYGPATH_W) '$(srcdir)/tar/test/test_option_X_upper.c'; fi`
+tar/test/bsdtar_test-test_option_acls.o: tar/test/test_option_acls.c
+ at am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tar/test/bsdtar_test-test_option_acls.o -MD -MP -MF tar/test/$(DEPDIR)/bsdtar_test-test_option_acls.Tpo -c -o tar/test/bsdtar_test-test_option_acls.o `test -f 'tar/test/test_option_acls.c' || echo '$(srcdir)/'`tar/test/test_option_acls.c
+ at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) tar/test/$(DEPDIR)/bsdtar_test-test_option_acls.Tpo tar/test/$(DEPDIR)/bsdtar_test-test_option_acls.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tar/test/test_option_acls.c' object='tar/test/bsdtar_test-test_option_acls.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tar/test/bsdtar_test-test_option_acls.o `test -f 'tar/test/test_option_acls.c' || echo '$(srcdir)/'`tar/test/test_option_acls.c
+
+tar/test/bsdtar_test-test_option_acls.obj: tar/test/test_option_acls.c
+ at am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tar/test/bsdtar_test-test_option_acls.obj -MD -MP -MF tar/test/$(DEPDIR)/bsdtar_test-test_option_acls.Tpo -c -o tar/test/bsdtar_test-test_option_acls.obj `if test -f 'tar/test/test_option_acls.c'; then $(CYGPATH_W) 'tar/test/test_option_acls.c'; else $(CYGPATH_W) '$(srcdir)/tar/test/test_option_acls.c'; fi`
+ at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) tar/test/$(DEPDIR)/bsdtar_test-test_option_acls.Tpo tar/test/$(DEPDIR)/bsdtar_test-test_option_acls.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tar/test/test_option_acls.c' object='tar/test/bsdtar_test-test_option_acls.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tar/test/bsdtar_test-test_option_acls.obj `if test -f 'tar/test/test_option_acls.c'; then $(CYGPATH_W) 'tar/test/test_option_acls.c'; else $(CYGPATH_W) '$(srcdir)/tar/test/test_option_acls.c'; fi`
+
tar/test/bsdtar_test-test_option_a.o: tar/test/test_option_a.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tar/test/bsdtar_test-test_option_a.o -MD -MP -MF tar/test/$(DEPDIR)/bsdtar_test-test_option_a.Tpo -c -o tar/test/bsdtar_test-test_option_a.o `test -f 'tar/test/test_option_a.c' || echo '$(srcdir)/'`tar/test/test_option_a.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) tar/test/$(DEPDIR)/bsdtar_test-test_option_a.Tpo tar/test/$(DEPDIR)/bsdtar_test-test_option_a.Po
@@ -7048,6 +7260,20 @@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tar/test/bsdtar_test-test_option_exclude.obj `if test -f 'tar/test/test_option_exclude.c'; then $(CYGPATH_W) 'tar/test/test_option_exclude.c'; else $(CYGPATH_W) '$(srcdir)/tar/test/test_option_exclude.c'; fi`
+tar/test/bsdtar_test-test_option_fflags.o: tar/test/test_option_fflags.c
+ at am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tar/test/bsdtar_test-test_option_fflags.o -MD -MP -MF tar/test/$(DEPDIR)/bsdtar_test-test_option_fflags.Tpo -c -o tar/test/bsdtar_test-test_option_fflags.o `test -f 'tar/test/test_option_fflags.c' || echo '$(srcdir)/'`tar/test/test_option_fflags.c
+ at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) tar/test/$(DEPDIR)/bsdtar_test-test_option_fflags.Tpo tar/test/$(DEPDIR)/bsdtar_test-test_option_fflags.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tar/test/test_option_fflags.c' object='tar/test/bsdtar_test-test_option_fflags.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tar/test/bsdtar_test-test_option_fflags.o `test -f 'tar/test/test_option_fflags.c' || echo '$(srcdir)/'`tar/test/test_option_fflags.c
+
+tar/test/bsdtar_test-test_option_fflags.obj: tar/test/test_option_fflags.c
+ at am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tar/test/bsdtar_test-test_option_fflags.obj -MD -MP -MF tar/test/$(DEPDIR)/bsdtar_test-test_option_fflags.Tpo -c -o tar/test/bsdtar_test-test_option_fflags.obj `if test -f 'tar/test/test_option_fflags.c'; then $(CYGPATH_W) 'tar/test/test_option_fflags.c'; else $(CYGPATH_W) '$(srcdir)/tar/test/test_option_fflags.c'; fi`
+ at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) tar/test/$(DEPDIR)/bsdtar_test-test_option_fflags.Tpo tar/test/$(DEPDIR)/bsdtar_test-test_option_fflags.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tar/test/test_option_fflags.c' object='tar/test/bsdtar_test-test_option_fflags.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tar/test/bsdtar_test-test_option_fflags.obj `if test -f 'tar/test/test_option_fflags.c'; then $(CYGPATH_W) 'tar/test/test_option_fflags.c'; else $(CYGPATH_W) '$(srcdir)/tar/test/test_option_fflags.c'; fi`
+
tar/test/bsdtar_test-test_option_gid_gname.o: tar/test/test_option_gid_gname.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tar/test/bsdtar_test-test_option_gid_gname.o -MD -MP -MF tar/test/$(DEPDIR)/bsdtar_test-test_option_gid_gname.Tpo -c -o tar/test/bsdtar_test-test_option_gid_gname.o `test -f 'tar/test/test_option_gid_gname.c' || echo '$(srcdir)/'`tar/test/test_option_gid_gname.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) tar/test/$(DEPDIR)/bsdtar_test-test_option_gid_gname.Tpo tar/test/$(DEPDIR)/bsdtar_test-test_option_gid_gname.Po
@@ -7314,6 +7540,20 @@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tar/test/bsdtar_test-test_option_uuencode.obj `if test -f 'tar/test/test_option_uuencode.c'; then $(CYGPATH_W) 'tar/test/test_option_uuencode.c'; else $(CYGPATH_W) '$(srcdir)/tar/test/test_option_uuencode.c'; fi`
+tar/test/bsdtar_test-test_option_xattrs.o: tar/test/test_option_xattrs.c
+ at am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tar/test/bsdtar_test-test_option_xattrs.o -MD -MP -MF tar/test/$(DEPDIR)/bsdtar_test-test_option_xattrs.Tpo -c -o tar/test/bsdtar_test-test_option_xattrs.o `test -f 'tar/test/test_option_xattrs.c' || echo '$(srcdir)/'`tar/test/test_option_xattrs.c
+ at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) tar/test/$(DEPDIR)/bsdtar_test-test_option_xattrs.Tpo tar/test/$(DEPDIR)/bsdtar_test-test_option_xattrs.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tar/test/test_option_xattrs.c' object='tar/test/bsdtar_test-test_option_xattrs.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tar/test/bsdtar_test-test_option_xattrs.o `test -f 'tar/test/test_option_xattrs.c' || echo '$(srcdir)/'`tar/test/test_option_xattrs.c
+
+tar/test/bsdtar_test-test_option_xattrs.obj: tar/test/test_option_xattrs.c
+ at am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tar/test/bsdtar_test-test_option_xattrs.obj -MD -MP -MF tar/test/$(DEPDIR)/bsdtar_test-test_option_xattrs.Tpo -c -o tar/test/bsdtar_test-test_option_xattrs.obj `if test -f 'tar/test/test_option_xattrs.c'; then $(CYGPATH_W) 'tar/test/test_option_xattrs.c'; else $(CYGPATH_W) '$(srcdir)/tar/test/test_option_xattrs.c'; fi`
+ at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) tar/test/$(DEPDIR)/bsdtar_test-test_option_xattrs.Tpo tar/test/$(DEPDIR)/bsdtar_test-test_option_xattrs.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='tar/test/test_option_xattrs.c' object='tar/test/bsdtar_test-test_option_xattrs.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o tar/test/bsdtar_test-test_option_xattrs.obj `if test -f 'tar/test/test_option_xattrs.c'; then $(CYGPATH_W) 'tar/test/test_option_xattrs.c'; else $(CYGPATH_W) '$(srcdir)/tar/test/test_option_xattrs.c'; fi`
+
tar/test/bsdtar_test-test_option_xz.o: tar/test/test_option_xz.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(bsdtar_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT tar/test/bsdtar_test-test_option_xz.o -MD -MP -MF tar/test/$(DEPDIR)/bsdtar_test-test_option_xz.Tpo -c -o tar/test/bsdtar_test-test_option_xz.o `test -f 'tar/test/test_option_xz.c' || echo '$(srcdir)/'`tar/test/test_option_xz.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) tar/test/$(DEPDIR)/bsdtar_test-test_option_xz.Tpo tar/test/$(DEPDIR)/bsdtar_test-test_option_xz.Po
@@ -8392,6 +8632,20 @@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_test-archive_util.obj `if test -f 'libarchive/archive_util.c'; then $(CYGPATH_W) 'libarchive/archive_util.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/archive_util.c'; fi`
+libarchive/libarchive_test-archive_version_details.o: libarchive/archive_version_details.c
+ at am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_test-archive_version_details.o -MD -MP -MF libarchive/$(DEPDIR)/libarchive_test-archive_version_details.Tpo -c -o libarchive/libarchive_test-archive_version_details.o `test -f 'libarchive/archive_version_details.c' || echo '$(srcdir)/'`libarchive/archive_version_details.c
+ at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libarchive/$(DEPDIR)/libarchive_test-archive_version_details.Tpo libarchive/$(DEPDIR)/libarchive_test-archive_version_details.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libarchive/archive_version_details.c' object='libarchive/libarchive_test-archive_version_details.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_test-archive_version_details.o `test -f 'libarchive/archive_version_details.c' || echo '$(srcdir)/'`libarchive/archive_version_details.c
+
+libarchive/libarchive_test-archive_version_details.obj: libarchive/archive_version_details.c
+ at am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_test-archive_version_details.obj -MD -MP -MF libarchive/$(DEPDIR)/libarchive_test-archive_version_details.Tpo -c -o libarchive/libarchive_test-archive_version_details.obj `if test -f 'libarchive/archive_version_details.c'; then $(CYGPATH_W) 'libarchive/archive_version_details.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/archive_version_details.c'; fi`
+ at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libarchive/$(DEPDIR)/libarchive_test-archive_version_details.Tpo libarchive/$(DEPDIR)/libarchive_test-archive_version_details.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libarchive/archive_version_details.c' object='libarchive/libarchive_test-archive_version_details.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_test-archive_version_details.obj `if test -f 'libarchive/archive_version_details.c'; then $(CYGPATH_W) 'libarchive/archive_version_details.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/archive_version_details.c'; fi`
+
libarchive/libarchive_test-archive_virtual.o: libarchive/archive_virtual.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_test-archive_virtual.o -MD -MP -MF libarchive/$(DEPDIR)/libarchive_test-archive_virtual.Tpo -c -o libarchive/libarchive_test-archive_virtual.o `test -f 'libarchive/archive_virtual.c' || echo '$(srcdir)/'`libarchive/archive_virtual.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libarchive/$(DEPDIR)/libarchive_test-archive_virtual.Tpo libarchive/$(DEPDIR)/libarchive_test-archive_virtual.Po
@@ -8420,20 +8674,6 @@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_test-archive_write.obj `if test -f 'libarchive/archive_write.c'; then $(CYGPATH_W) 'libarchive/archive_write.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/archive_write.c'; fi`
-libarchive/libarchive_test-archive_write_disk_acl.o: libarchive/archive_write_disk_acl.c
- at am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_test-archive_write_disk_acl.o -MD -MP -MF libarchive/$(DEPDIR)/libarchive_test-archive_write_disk_acl.Tpo -c -o libarchive/libarchive_test-archive_write_disk_acl.o `test -f 'libarchive/archive_write_disk_acl.c' || echo '$(srcdir)/'`libarchive/archive_write_disk_acl.c
- at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libarchive/$(DEPDIR)/libarchive_test-archive_write_disk_acl.Tpo libarchive/$(DEPDIR)/libarchive_test-archive_write_disk_acl.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libarchive/archive_write_disk_acl.c' object='libarchive/libarchive_test-archive_write_disk_acl.o' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_test-archive_write_disk_acl.o `test -f 'libarchive/archive_write_disk_acl.c' || echo '$(srcdir)/'`libarchive/archive_write_disk_acl.c
-
-libarchive/libarchive_test-archive_write_disk_acl.obj: libarchive/archive_write_disk_acl.c
- at am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_test-archive_write_disk_acl.obj -MD -MP -MF libarchive/$(DEPDIR)/libarchive_test-archive_write_disk_acl.Tpo -c -o libarchive/libarchive_test-archive_write_disk_acl.obj `if test -f 'libarchive/archive_write_disk_acl.c'; then $(CYGPATH_W) 'libarchive/archive_write_disk_acl.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/archive_write_disk_acl.c'; fi`
- at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libarchive/$(DEPDIR)/libarchive_test-archive_write_disk_acl.Tpo libarchive/$(DEPDIR)/libarchive_test-archive_write_disk_acl.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libarchive/archive_write_disk_acl.c' object='libarchive/libarchive_test-archive_write_disk_acl.obj' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_test-archive_write_disk_acl.obj `if test -f 'libarchive/archive_write_disk_acl.c'; then $(CYGPATH_W) 'libarchive/archive_write_disk_acl.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/archive_write_disk_acl.c'; fi`
-
libarchive/libarchive_test-archive_write_disk_posix.o: libarchive/archive_write_disk_posix.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_test-archive_write_disk_posix.o -MD -MP -MF libarchive/$(DEPDIR)/libarchive_test-archive_write_disk_posix.Tpo -c -o libarchive/libarchive_test-archive_write_disk_posix.o `test -f 'libarchive/archive_write_disk_posix.c' || echo '$(srcdir)/'`libarchive/archive_write_disk_posix.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libarchive/$(DEPDIR)/libarchive_test-archive_write_disk_posix.Tpo libarchive/$(DEPDIR)/libarchive_test-archive_write_disk_posix.Po
@@ -9092,6 +9332,62 @@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_test-filter_fork_windows.obj `if test -f 'libarchive/filter_fork_windows.c'; then $(CYGPATH_W) 'libarchive/filter_fork_windows.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/filter_fork_windows.c'; fi`
+libarchive/libarchive_test-archive_disk_acl_linux.o: libarchive/archive_disk_acl_linux.c
+ at am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_test-archive_disk_acl_linux.o -MD -MP -MF libarchive/$(DEPDIR)/libarchive_test-archive_disk_acl_linux.Tpo -c -o libarchive/libarchive_test-archive_disk_acl_linux.o `test -f 'libarchive/archive_disk_acl_linux.c' || echo '$(srcdir)/'`libarchive/archive_disk_acl_linux.c
+ at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libarchive/$(DEPDIR)/libarchive_test-archive_disk_acl_linux.Tpo libarchive/$(DEPDIR)/libarchive_test-archive_disk_acl_linux.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libarchive/archive_disk_acl_linux.c' object='libarchive/libarchive_test-archive_disk_acl_linux.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_test-archive_disk_acl_linux.o `test -f 'libarchive/archive_disk_acl_linux.c' || echo '$(srcdir)/'`libarchive/archive_disk_acl_linux.c
+
+libarchive/libarchive_test-archive_disk_acl_linux.obj: libarchive/archive_disk_acl_linux.c
+ at am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_test-archive_disk_acl_linux.obj -MD -MP -MF libarchive/$(DEPDIR)/libarchive_test-archive_disk_acl_linux.Tpo -c -o libarchive/libarchive_test-archive_disk_acl_linux.obj `if test -f 'libarchive/archive_disk_acl_linux.c'; then $(CYGPATH_W) 'libarchive/archive_disk_acl_linux.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/archive_disk_acl_linux.c'; fi`
+ at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libarchive/$(DEPDIR)/libarchive_test-archive_disk_acl_linux.Tpo libarchive/$(DEPDIR)/libarchive_test-archive_disk_acl_linux.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libarchive/archive_disk_acl_linux.c' object='libarchive/libarchive_test-archive_disk_acl_linux.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_test-archive_disk_acl_linux.obj `if test -f 'libarchive/archive_disk_acl_linux.c'; then $(CYGPATH_W) 'libarchive/archive_disk_acl_linux.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/archive_disk_acl_linux.c'; fi`
+
+libarchive/libarchive_test-archive_disk_acl_sunos.o: libarchive/archive_disk_acl_sunos.c
+ at am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_test-archive_disk_acl_sunos.o -MD -MP -MF libarchive/$(DEPDIR)/libarchive_test-archive_disk_acl_sunos.Tpo -c -o libarchive/libarchive_test-archive_disk_acl_sunos.o `test -f 'libarchive/archive_disk_acl_sunos.c' || echo '$(srcdir)/'`libarchive/archive_disk_acl_sunos.c
+ at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libarchive/$(DEPDIR)/libarchive_test-archive_disk_acl_sunos.Tpo libarchive/$(DEPDIR)/libarchive_test-archive_disk_acl_sunos.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libarchive/archive_disk_acl_sunos.c' object='libarchive/libarchive_test-archive_disk_acl_sunos.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_test-archive_disk_acl_sunos.o `test -f 'libarchive/archive_disk_acl_sunos.c' || echo '$(srcdir)/'`libarchive/archive_disk_acl_sunos.c
+
+libarchive/libarchive_test-archive_disk_acl_sunos.obj: libarchive/archive_disk_acl_sunos.c
+ at am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_test-archive_disk_acl_sunos.obj -MD -MP -MF libarchive/$(DEPDIR)/libarchive_test-archive_disk_acl_sunos.Tpo -c -o libarchive/libarchive_test-archive_disk_acl_sunos.obj `if test -f 'libarchive/archive_disk_acl_sunos.c'; then $(CYGPATH_W) 'libarchive/archive_disk_acl_sunos.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/archive_disk_acl_sunos.c'; fi`
+ at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libarchive/$(DEPDIR)/libarchive_test-archive_disk_acl_sunos.Tpo libarchive/$(DEPDIR)/libarchive_test-archive_disk_acl_sunos.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libarchive/archive_disk_acl_sunos.c' object='libarchive/libarchive_test-archive_disk_acl_sunos.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_test-archive_disk_acl_sunos.obj `if test -f 'libarchive/archive_disk_acl_sunos.c'; then $(CYGPATH_W) 'libarchive/archive_disk_acl_sunos.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/archive_disk_acl_sunos.c'; fi`
+
+libarchive/libarchive_test-archive_disk_acl_darwin.o: libarchive/archive_disk_acl_darwin.c
+ at am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_test-archive_disk_acl_darwin.o -MD -MP -MF libarchive/$(DEPDIR)/libarchive_test-archive_disk_acl_darwin.Tpo -c -o libarchive/libarchive_test-archive_disk_acl_darwin.o `test -f 'libarchive/archive_disk_acl_darwin.c' || echo '$(srcdir)/'`libarchive/archive_disk_acl_darwin.c
+ at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libarchive/$(DEPDIR)/libarchive_test-archive_disk_acl_darwin.Tpo libarchive/$(DEPDIR)/libarchive_test-archive_disk_acl_darwin.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libarchive/archive_disk_acl_darwin.c' object='libarchive/libarchive_test-archive_disk_acl_darwin.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_test-archive_disk_acl_darwin.o `test -f 'libarchive/archive_disk_acl_darwin.c' || echo '$(srcdir)/'`libarchive/archive_disk_acl_darwin.c
+
+libarchive/libarchive_test-archive_disk_acl_darwin.obj: libarchive/archive_disk_acl_darwin.c
+ at am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_test-archive_disk_acl_darwin.obj -MD -MP -MF libarchive/$(DEPDIR)/libarchive_test-archive_disk_acl_darwin.Tpo -c -o libarchive/libarchive_test-archive_disk_acl_darwin.obj `if test -f 'libarchive/archive_disk_acl_darwin.c'; then $(CYGPATH_W) 'libarchive/archive_disk_acl_darwin.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/archive_disk_acl_darwin.c'; fi`
+ at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libarchive/$(DEPDIR)/libarchive_test-archive_disk_acl_darwin.Tpo libarchive/$(DEPDIR)/libarchive_test-archive_disk_acl_darwin.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libarchive/archive_disk_acl_darwin.c' object='libarchive/libarchive_test-archive_disk_acl_darwin.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_test-archive_disk_acl_darwin.obj `if test -f 'libarchive/archive_disk_acl_darwin.c'; then $(CYGPATH_W) 'libarchive/archive_disk_acl_darwin.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/archive_disk_acl_darwin.c'; fi`
+
+libarchive/libarchive_test-archive_disk_acl_freebsd.o: libarchive/archive_disk_acl_freebsd.c
+ at am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_test-archive_disk_acl_freebsd.o -MD -MP -MF libarchive/$(DEPDIR)/libarchive_test-archive_disk_acl_freebsd.Tpo -c -o libarchive/libarchive_test-archive_disk_acl_freebsd.o `test -f 'libarchive/archive_disk_acl_freebsd.c' || echo '$(srcdir)/'`libarchive/archive_disk_acl_freebsd.c
+ at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libarchive/$(DEPDIR)/libarchive_test-archive_disk_acl_freebsd.Tpo libarchive/$(DEPDIR)/libarchive_test-archive_disk_acl_freebsd.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libarchive/archive_disk_acl_freebsd.c' object='libarchive/libarchive_test-archive_disk_acl_freebsd.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_test-archive_disk_acl_freebsd.o `test -f 'libarchive/archive_disk_acl_freebsd.c' || echo '$(srcdir)/'`libarchive/archive_disk_acl_freebsd.c
+
+libarchive/libarchive_test-archive_disk_acl_freebsd.obj: libarchive/archive_disk_acl_freebsd.c
+ at am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/libarchive_test-archive_disk_acl_freebsd.obj -MD -MP -MF libarchive/$(DEPDIR)/libarchive_test-archive_disk_acl_freebsd.Tpo -c -o libarchive/libarchive_test-archive_disk_acl_freebsd.obj `if test -f 'libarchive/archive_disk_acl_freebsd.c'; then $(CYGPATH_W) 'libarchive/archive_disk_acl_freebsd.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/archive_disk_acl_freebsd.c'; fi`
+ at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libarchive/$(DEPDIR)/libarchive_test-archive_disk_acl_freebsd.Tpo libarchive/$(DEPDIR)/libarchive_test-archive_disk_acl_freebsd.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libarchive/archive_disk_acl_freebsd.c' object='libarchive/libarchive_test-archive_disk_acl_freebsd.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/libarchive_test-archive_disk_acl_freebsd.obj `if test -f 'libarchive/archive_disk_acl_freebsd.c'; then $(CYGPATH_W) 'libarchive/archive_disk_acl_freebsd.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/archive_disk_acl_freebsd.c'; fi`
+
test_utils/libarchive_test-test_utils.o: test_utils/test_utils.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_utils/libarchive_test-test_utils.o -MD -MP -MF test_utils/$(DEPDIR)/libarchive_test-test_utils.Tpo -c -o test_utils/libarchive_test-test_utils.o `test -f 'test_utils/test_utils.c' || echo '$(srcdir)/'`test_utils/test_utils.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) test_utils/$(DEPDIR)/libarchive_test-test_utils.Tpo test_utils/$(DEPDIR)/libarchive_test-test_utils.Po
@@ -9106,19 +9402,19 @@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_utils/libarchive_test-test_utils.obj `if test -f 'test_utils/test_utils.c'; then $(CYGPATH_W) 'test_utils/test_utils.c'; else $(CYGPATH_W) '$(srcdir)/test_utils/test_utils.c'; fi`
-libarchive/test/libarchive_test-main.o: libarchive/test/main.c
- at am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-main.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-main.Tpo -c -o libarchive/test/libarchive_test-main.o `test -f 'libarchive/test/main.c' || echo '$(srcdir)/'`libarchive/test/main.c
- at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libarchive/test/$(DEPDIR)/libarchive_test-main.Tpo libarchive/test/$(DEPDIR)/libarchive_test-main.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libarchive/test/main.c' object='libarchive/test/libarchive_test-main.o' libtool=no @AMDEPBACKSLASH@
+test_utils/libarchive_test-test_main.o: test_utils/test_main.c
+ at am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_utils/libarchive_test-test_main.o -MD -MP -MF test_utils/$(DEPDIR)/libarchive_test-test_main.Tpo -c -o test_utils/libarchive_test-test_main.o `test -f 'test_utils/test_main.c' || echo '$(srcdir)/'`test_utils/test_main.c
+ at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) test_utils/$(DEPDIR)/libarchive_test-test_main.Tpo test_utils/$(DEPDIR)/libarchive_test-test_main.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test_utils/test_main.c' object='test_utils/libarchive_test-test_main.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-main.o `test -f 'libarchive/test/main.c' || echo '$(srcdir)/'`libarchive/test/main.c
+ at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_utils/libarchive_test-test_main.o `test -f 'test_utils/test_main.c' || echo '$(srcdir)/'`test_utils/test_main.c
-libarchive/test/libarchive_test-main.obj: libarchive/test/main.c
- at am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-main.obj -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-main.Tpo -c -o libarchive/test/libarchive_test-main.obj `if test -f 'libarchive/test/main.c'; then $(CYGPATH_W) 'libarchive/test/main.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/main.c'; fi`
- at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libarchive/test/$(DEPDIR)/libarchive_test-main.Tpo libarchive/test/$(DEPDIR)/libarchive_test-main.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libarchive/test/main.c' object='libarchive/test/libarchive_test-main.obj' libtool=no @AMDEPBACKSLASH@
+test_utils/libarchive_test-test_main.obj: test_utils/test_main.c
+ at am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT test_utils/libarchive_test-test_main.obj -MD -MP -MF test_utils/$(DEPDIR)/libarchive_test-test_main.Tpo -c -o test_utils/libarchive_test-test_main.obj `if test -f 'test_utils/test_main.c'; then $(CYGPATH_W) 'test_utils/test_main.c'; else $(CYGPATH_W) '$(srcdir)/test_utils/test_main.c'; fi`
+ at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) test_utils/$(DEPDIR)/libarchive_test-test_main.Tpo test_utils/$(DEPDIR)/libarchive_test-test_main.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='test_utils/test_main.c' object='test_utils/libarchive_test-test_main.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-main.obj `if test -f 'libarchive/test/main.c'; then $(CYGPATH_W) 'libarchive/test/main.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/main.c'; fi`
+ at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o test_utils/libarchive_test-test_main.obj `if test -f 'test_utils/test_main.c'; then $(CYGPATH_W) 'test_utils/test_main.c'; else $(CYGPATH_W) '$(srcdir)/test_utils/test_main.c'; fi`
libarchive/test/libarchive_test-read_open_memory.o: libarchive/test/read_open_memory.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-read_open_memory.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-read_open_memory.Tpo -c -o libarchive/test/libarchive_test-read_open_memory.o `test -f 'libarchive/test/read_open_memory.c' || echo '$(srcdir)/'`libarchive/test/read_open_memory.c
@@ -9134,34 +9430,6 @@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-read_open_memory.obj `if test -f 'libarchive/test/read_open_memory.c'; then $(CYGPATH_W) 'libarchive/test/read_open_memory.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/read_open_memory.c'; fi`
-libarchive/test/libarchive_test-test_acl_freebsd_posix1e.o: libarchive/test/test_acl_freebsd_posix1e.c
- at am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_acl_freebsd_posix1e.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_acl_freebsd_posix1e.Tpo -c -o libarchive/test/libarchive_test-test_acl_freebsd_posix1e.o `test -f 'libarchive/test/test_acl_freebsd_posix1e.c' || echo '$(srcdir)/'`libarchive/test/test_acl_freebsd_posix1e.c
- at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libarchive/test/$(DEPDIR)/libarchive_test-test_acl_freebsd_posix1e.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_acl_freebsd_posix1e.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libarchive/test/test_acl_freebsd_posix1e.c' object='libarchive/test/libarchive_test-test_acl_freebsd_posix1e.o' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_acl_freebsd_posix1e.o `test -f 'libarchive/test/test_acl_freebsd_posix1e.c' || echo '$(srcdir)/'`libarchive/test/test_acl_freebsd_posix1e.c
-
-libarchive/test/libarchive_test-test_acl_freebsd_posix1e.obj: libarchive/test/test_acl_freebsd_posix1e.c
- at am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_acl_freebsd_posix1e.obj -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_acl_freebsd_posix1e.Tpo -c -o libarchive/test/libarchive_test-test_acl_freebsd_posix1e.obj `if test -f 'libarchive/test/test_acl_freebsd_posix1e.c'; then $(CYGPATH_W) 'libarchive/test/test_acl_freebsd_posix1e.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_acl_freebsd_posix1e.c'; fi`
- at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libarchive/test/$(DEPDIR)/libarchive_test-test_acl_freebsd_posix1e.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_acl_freebsd_posix1e.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libarchive/test/test_acl_freebsd_posix1e.c' object='libarchive/test/libarchive_test-test_acl_freebsd_posix1e.obj' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_acl_freebsd_posix1e.obj `if test -f 'libarchive/test/test_acl_freebsd_posix1e.c'; then $(CYGPATH_W) 'libarchive/test/test_acl_freebsd_posix1e.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_acl_freebsd_posix1e.c'; fi`
-
-libarchive/test/libarchive_test-test_acl_freebsd_nfs4.o: libarchive/test/test_acl_freebsd_nfs4.c
- at am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_acl_freebsd_nfs4.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_acl_freebsd_nfs4.Tpo -c -o libarchive/test/libarchive_test-test_acl_freebsd_nfs4.o `test -f 'libarchive/test/test_acl_freebsd_nfs4.c' || echo '$(srcdir)/'`libarchive/test/test_acl_freebsd_nfs4.c
- at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libarchive/test/$(DEPDIR)/libarchive_test-test_acl_freebsd_nfs4.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_acl_freebsd_nfs4.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libarchive/test/test_acl_freebsd_nfs4.c' object='libarchive/test/libarchive_test-test_acl_freebsd_nfs4.o' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_acl_freebsd_nfs4.o `test -f 'libarchive/test/test_acl_freebsd_nfs4.c' || echo '$(srcdir)/'`libarchive/test/test_acl_freebsd_nfs4.c
-
-libarchive/test/libarchive_test-test_acl_freebsd_nfs4.obj: libarchive/test/test_acl_freebsd_nfs4.c
- at am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_acl_freebsd_nfs4.obj -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_acl_freebsd_nfs4.Tpo -c -o libarchive/test/libarchive_test-test_acl_freebsd_nfs4.obj `if test -f 'libarchive/test/test_acl_freebsd_nfs4.c'; then $(CYGPATH_W) 'libarchive/test/test_acl_freebsd_nfs4.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_acl_freebsd_nfs4.c'; fi`
- at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libarchive/test/$(DEPDIR)/libarchive_test-test_acl_freebsd_nfs4.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_acl_freebsd_nfs4.Po
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libarchive/test/test_acl_freebsd_nfs4.c' object='libarchive/test/libarchive_test-test_acl_freebsd_nfs4.obj' libtool=no @AMDEPBACKSLASH@
- at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
- at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_acl_freebsd_nfs4.obj `if test -f 'libarchive/test/test_acl_freebsd_nfs4.c'; then $(CYGPATH_W) 'libarchive/test/test_acl_freebsd_nfs4.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_acl_freebsd_nfs4.c'; fi`
-
libarchive/test/libarchive_test-test_acl_nfs4.o: libarchive/test/test_acl_nfs4.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_acl_nfs4.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_acl_nfs4.Tpo -c -o libarchive/test/libarchive_test-test_acl_nfs4.o `test -f 'libarchive/test/test_acl_nfs4.c' || echo '$(srcdir)/'`libarchive/test/test_acl_nfs4.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libarchive/test/$(DEPDIR)/libarchive_test-test_acl_nfs4.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_acl_nfs4.Po
@@ -9190,6 +9458,34 @@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_acl_pax.obj `if test -f 'libarchive/test/test_acl_pax.c'; then $(CYGPATH_W) 'libarchive/test/test_acl_pax.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_acl_pax.c'; fi`
+libarchive/test/libarchive_test-test_acl_platform_nfs4.o: libarchive/test/test_acl_platform_nfs4.c
+ at am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_acl_platform_nfs4.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_acl_platform_nfs4.Tpo -c -o libarchive/test/libarchive_test-test_acl_platform_nfs4.o `test -f 'libarchive/test/test_acl_platform_nfs4.c' || echo '$(srcdir)/'`libarchive/test/test_acl_platform_nfs4.c
+ at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libarchive/test/$(DEPDIR)/libarchive_test-test_acl_platform_nfs4.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_acl_platform_nfs4.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libarchive/test/test_acl_platform_nfs4.c' object='libarchive/test/libarchive_test-test_acl_platform_nfs4.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_acl_platform_nfs4.o `test -f 'libarchive/test/test_acl_platform_nfs4.c' || echo '$(srcdir)/'`libarchive/test/test_acl_platform_nfs4.c
+
+libarchive/test/libarchive_test-test_acl_platform_nfs4.obj: libarchive/test/test_acl_platform_nfs4.c
+ at am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_acl_platform_nfs4.obj -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_acl_platform_nfs4.Tpo -c -o libarchive/test/libarchive_test-test_acl_platform_nfs4.obj `if test -f 'libarchive/test/test_acl_platform_nfs4.c'; then $(CYGPATH_W) 'libarchive/test/test_acl_platform_nfs4.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_acl_platform_nfs4.c'; fi`
+ at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libarchive/test/$(DEPDIR)/libarchive_test-test_acl_platform_nfs4.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_acl_platform_nfs4.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libarchive/test/test_acl_platform_nfs4.c' object='libarchive/test/libarchive_test-test_acl_platform_nfs4.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_acl_platform_nfs4.obj `if test -f 'libarchive/test/test_acl_platform_nfs4.c'; then $(CYGPATH_W) 'libarchive/test/test_acl_platform_nfs4.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_acl_platform_nfs4.c'; fi`
+
+libarchive/test/libarchive_test-test_acl_platform_posix1e.o: libarchive/test/test_acl_platform_posix1e.c
+ at am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_acl_platform_posix1e.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_acl_platform_posix1e.Tpo -c -o libarchive/test/libarchive_test-test_acl_platform_posix1e.o `test -f 'libarchive/test/test_acl_platform_posix1e.c' || echo '$(srcdir)/'`libarchive/test/test_acl_platform_posix1e.c
+ at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libarchive/test/$(DEPDIR)/libarchive_test-test_acl_platform_posix1e.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_acl_platform_posix1e.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libarchive/test/test_acl_platform_posix1e.c' object='libarchive/test/libarchive_test-test_acl_platform_posix1e.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_acl_platform_posix1e.o `test -f 'libarchive/test/test_acl_platform_posix1e.c' || echo '$(srcdir)/'`libarchive/test/test_acl_platform_posix1e.c
+
+libarchive/test/libarchive_test-test_acl_platform_posix1e.obj: libarchive/test/test_acl_platform_posix1e.c
+ at am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_acl_platform_posix1e.obj -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_acl_platform_posix1e.Tpo -c -o libarchive/test/libarchive_test-test_acl_platform_posix1e.obj `if test -f 'libarchive/test/test_acl_platform_posix1e.c'; then $(CYGPATH_W) 'libarchive/test/test_acl_platform_posix1e.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_acl_platform_posix1e.c'; fi`
+ at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libarchive/test/$(DEPDIR)/libarchive_test-test_acl_platform_posix1e.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_acl_platform_posix1e.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libarchive/test/test_acl_platform_posix1e.c' object='libarchive/test/libarchive_test-test_acl_platform_posix1e.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_acl_platform_posix1e.obj `if test -f 'libarchive/test/test_acl_platform_posix1e.c'; then $(CYGPATH_W) 'libarchive/test/test_acl_platform_posix1e.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_acl_platform_posix1e.c'; fi`
+
libarchive/test/libarchive_test-test_acl_posix1e.o: libarchive/test/test_acl_posix1e.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_acl_posix1e.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_acl_posix1e.Tpo -c -o libarchive/test/libarchive_test-test_acl_posix1e.o `test -f 'libarchive/test/test_acl_posix1e.c' || echo '$(srcdir)/'`libarchive/test/test_acl_posix1e.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libarchive/test/$(DEPDIR)/libarchive_test-test_acl_posix1e.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_acl_posix1e.Po
@@ -9204,6 +9500,20 @@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_acl_posix1e.obj `if test -f 'libarchive/test/test_acl_posix1e.c'; then $(CYGPATH_W) 'libarchive/test/test_acl_posix1e.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_acl_posix1e.c'; fi`
+libarchive/test/libarchive_test-test_acl_text.o: libarchive/test/test_acl_text.c
+ at am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_acl_text.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_acl_text.Tpo -c -o libarchive/test/libarchive_test-test_acl_text.o `test -f 'libarchive/test/test_acl_text.c' || echo '$(srcdir)/'`libarchive/test/test_acl_text.c
+ at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libarchive/test/$(DEPDIR)/libarchive_test-test_acl_text.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_acl_text.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libarchive/test/test_acl_text.c' object='libarchive/test/libarchive_test-test_acl_text.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_acl_text.o `test -f 'libarchive/test/test_acl_text.c' || echo '$(srcdir)/'`libarchive/test/test_acl_text.c
+
+libarchive/test/libarchive_test-test_acl_text.obj: libarchive/test/test_acl_text.c
+ at am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_acl_text.obj -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_acl_text.Tpo -c -o libarchive/test/libarchive_test-test_acl_text.obj `if test -f 'libarchive/test/test_acl_text.c'; then $(CYGPATH_W) 'libarchive/test/test_acl_text.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_acl_text.c'; fi`
+ at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libarchive/test/$(DEPDIR)/libarchive_test-test_acl_text.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_acl_text.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libarchive/test/test_acl_text.c' object='libarchive/test/libarchive_test-test_acl_text.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_acl_text.obj `if test -f 'libarchive/test/test_acl_text.c'; then $(CYGPATH_W) 'libarchive/test/test_acl_text.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_acl_text.c'; fi`
+
libarchive/test/libarchive_test-test_archive_api_feature.o: libarchive/test/test_archive_api_feature.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_archive_api_feature.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_archive_api_feature.Tpo -c -o libarchive/test/libarchive_test-test_archive_api_feature.o `test -f 'libarchive/test/test_archive_api_feature.c' || echo '$(srcdir)/'`libarchive/test/test_archive_api_feature.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libarchive/test/$(DEPDIR)/libarchive_test-test_archive_api_feature.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_archive_api_feature.Po
@@ -9820,6 +10130,34 @@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_compat_pax_libarchive_2x.obj `if test -f 'libarchive/test/test_compat_pax_libarchive_2x.c'; then $(CYGPATH_W) 'libarchive/test/test_compat_pax_libarchive_2x.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_compat_pax_libarchive_2x.c'; fi`
+libarchive/test/libarchive_test-test_compat_perl_archive_tar.o: libarchive/test/test_compat_perl_archive_tar.c
+ at am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_compat_perl_archive_tar.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_compat_perl_archive_tar.Tpo -c -o libarchive/test/libarchive_test-test_compat_perl_archive_tar.o `test -f 'libarchive/test/test_compat_perl_archive_tar.c' || echo '$(srcdir)/'`libarchive/test/test_compat_perl_archive_tar.c
+ at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libarchive/test/$(DEPDIR)/libarchive_test-test_compat_perl_archive_tar.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_compat_perl_archive_tar.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libarchive/test/test_compat_perl_archive_tar.c' object='libarchive/test/libarchive_test-test_compat_perl_archive_tar.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_compat_perl_archive_tar.o `test -f 'libarchive/test/test_compat_perl_archive_tar.c' || echo '$(srcdir)/'`libarchive/test/test_compat_perl_archive_tar.c
+
+libarchive/test/libarchive_test-test_compat_perl_archive_tar.obj: libarchive/test/test_compat_perl_archive_tar.c
+ at am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_compat_perl_archive_tar.obj -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_compat_perl_archive_tar.Tpo -c -o libarchive/test/libarchive_test-test_compat_perl_archive_tar.obj `if test -f 'libarchive/test/test_compat_perl_archive_tar.c'; then $(CYGPATH_W) 'libarchive/test/test_compat_perl_archive_tar.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_compat_perl_archive_tar.c'; fi`
+ at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libarchive/test/$(DEPDIR)/libarchive_test-test_compat_perl_archive_tar.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_compat_perl_archive_tar.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libarchive/test/test_compat_perl_archive_tar.c' object='libarchive/test/libarchive_test-test_compat_perl_archive_tar.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_compat_perl_archive_tar.obj `if test -f 'libarchive/test/test_compat_perl_archive_tar.c'; then $(CYGPATH_W) 'libarchive/test/test_compat_perl_archive_tar.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_compat_perl_archive_tar.c'; fi`
+
+libarchive/test/libarchive_test-test_compat_plexus_archiver_tar.o: libarchive/test/test_compat_plexus_archiver_tar.c
+ at am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_compat_plexus_archiver_tar.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_compat_plexus_archiver_tar.Tpo -c -o libarchive/test/libarchive_test-test_compat_plexus_archiver_tar.o `test -f 'libarchive/test/test_compat_plexus_archiver_tar.c' || echo '$(srcdir)/'`libarchive/test/test_compat_plexus_archiver_tar.c
+ at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libarchive/test/$(DEPDIR)/libarchive_test-test_compat_plexus_archiver_tar.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_compat_plexus_archiver_tar.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libarchive/test/test_compat_plexus_archiver_tar.c' object='libarchive/test/libarchive_test-test_compat_plexus_archiver_tar.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_compat_plexus_archiver_tar.o `test -f 'libarchive/test/test_compat_plexus_archiver_tar.c' || echo '$(srcdir)/'`libarchive/test/test_compat_plexus_archiver_tar.c
+
+libarchive/test/libarchive_test-test_compat_plexus_archiver_tar.obj: libarchive/test/test_compat_plexus_archiver_tar.c
+ at am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_compat_plexus_archiver_tar.obj -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_compat_plexus_archiver_tar.Tpo -c -o libarchive/test/libarchive_test-test_compat_plexus_archiver_tar.obj `if test -f 'libarchive/test/test_compat_plexus_archiver_tar.c'; then $(CYGPATH_W) 'libarchive/test/test_compat_plexus_archiver_tar.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_compat_plexus_archiver_tar.c'; fi`
+ at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libarchive/test/$(DEPDIR)/libarchive_test-test_compat_plexus_archiver_tar.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_compat_plexus_archiver_tar.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libarchive/test/test_compat_plexus_archiver_tar.c' object='libarchive/test/libarchive_test-test_compat_plexus_archiver_tar.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_compat_plexus_archiver_tar.obj `if test -f 'libarchive/test/test_compat_plexus_archiver_tar.c'; then $(CYGPATH_W) 'libarchive/test/test_compat_plexus_archiver_tar.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_compat_plexus_archiver_tar.c'; fi`
+
libarchive/test/libarchive_test-test_compat_solaris_tar_acl.o: libarchive/test/test_compat_solaris_tar_acl.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_compat_solaris_tar_acl.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_compat_solaris_tar_acl.Tpo -c -o libarchive/test/libarchive_test-test_compat_solaris_tar_acl.o `test -f 'libarchive/test/test_compat_solaris_tar_acl.c' || echo '$(srcdir)/'`libarchive/test/test_compat_solaris_tar_acl.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libarchive/test/$(DEPDIR)/libarchive_test-test_compat_solaris_tar_acl.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_compat_solaris_tar_acl.Po
@@ -9848,6 +10186,20 @@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_compat_solaris_pax_sparse.obj `if test -f 'libarchive/test/test_compat_solaris_pax_sparse.c'; then $(CYGPATH_W) 'libarchive/test/test_compat_solaris_pax_sparse.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_compat_solaris_pax_sparse.c'; fi`
+libarchive/test/libarchive_test-test_compat_star_acl.o: libarchive/test/test_compat_star_acl.c
+ at am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_compat_star_acl.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_compat_star_acl.Tpo -c -o libarchive/test/libarchive_test-test_compat_star_acl.o `test -f 'libarchive/test/test_compat_star_acl.c' || echo '$(srcdir)/'`libarchive/test/test_compat_star_acl.c
+ at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libarchive/test/$(DEPDIR)/libarchive_test-test_compat_star_acl.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_compat_star_acl.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libarchive/test/test_compat_star_acl.c' object='libarchive/test/libarchive_test-test_compat_star_acl.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_compat_star_acl.o `test -f 'libarchive/test/test_compat_star_acl.c' || echo '$(srcdir)/'`libarchive/test/test_compat_star_acl.c
+
+libarchive/test/libarchive_test-test_compat_star_acl.obj: libarchive/test/test_compat_star_acl.c
+ at am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_compat_star_acl.obj -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_compat_star_acl.Tpo -c -o libarchive/test/libarchive_test-test_compat_star_acl.obj `if test -f 'libarchive/test/test_compat_star_acl.c'; then $(CYGPATH_W) 'libarchive/test/test_compat_star_acl.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_compat_star_acl.c'; fi`
+ at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libarchive/test/$(DEPDIR)/libarchive_test-test_compat_star_acl.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_compat_star_acl.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libarchive/test/test_compat_star_acl.c' object='libarchive/test/libarchive_test-test_compat_star_acl.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_compat_star_acl.obj `if test -f 'libarchive/test/test_compat_star_acl.c'; then $(CYGPATH_W) 'libarchive/test/test_compat_star_acl.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_compat_star_acl.c'; fi`
+
libarchive/test/libarchive_test-test_compat_tar_hardlink.o: libarchive/test/test_compat_tar_hardlink.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_compat_tar_hardlink.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_compat_tar_hardlink.Tpo -c -o libarchive/test/libarchive_test-test_compat_tar_hardlink.o `test -f 'libarchive/test/test_compat_tar_hardlink.c' || echo '$(srcdir)/'`libarchive/test/test_compat_tar_hardlink.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libarchive/test/$(DEPDIR)/libarchive_test-test_compat_tar_hardlink.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_compat_tar_hardlink.Po
@@ -10940,6 +11292,20 @@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_read_format_mtree.obj `if test -f 'libarchive/test/test_read_format_mtree.c'; then $(CYGPATH_W) 'libarchive/test/test_read_format_mtree.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_read_format_mtree.c'; fi`
+libarchive/test/libarchive_test-test_read_format_mtree_crash747.o: libarchive/test/test_read_format_mtree_crash747.c
+ at am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_read_format_mtree_crash747.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_mtree_crash747.Tpo -c -o libarchive/test/libarchive_test-test_read_format_mtree_crash747.o `test -f 'libarchive/test/test_read_format_mtree_crash747.c' || echo '$(srcdir)/'`libarchive/test/test_read_format_mtree_crash747.c
+ at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_mtree_crash747.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_mtree_crash747.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libarchive/test/test_read_format_mtree_crash747.c' object='libarchive/test/libarchive_test-test_read_format_mtree_crash747.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_read_format_mtree_crash747.o `test -f 'libarchive/test/test_read_format_mtree_crash747.c' || echo '$(srcdir)/'`libarchive/test/test_read_format_mtree_crash747.c
+
+libarchive/test/libarchive_test-test_read_format_mtree_crash747.obj: libarchive/test/test_read_format_mtree_crash747.c
+ at am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_read_format_mtree_crash747.obj -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_mtree_crash747.Tpo -c -o libarchive/test/libarchive_test-test_read_format_mtree_crash747.obj `if test -f 'libarchive/test/test_read_format_mtree_crash747.c'; then $(CYGPATH_W) 'libarchive/test/test_read_format_mtree_crash747.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_read_format_mtree_crash747.c'; fi`
+ at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_mtree_crash747.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_mtree_crash747.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libarchive/test/test_read_format_mtree_crash747.c' object='libarchive/test/libarchive_test-test_read_format_mtree_crash747.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_read_format_mtree_crash747.obj `if test -f 'libarchive/test/test_read_format_mtree_crash747.c'; then $(CYGPATH_W) 'libarchive/test/test_read_format_mtree_crash747.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_read_format_mtree_crash747.c'; fi`
+
libarchive/test/libarchive_test-test_read_format_pax_bz2.o: libarchive/test/test_read_format_pax_bz2.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_read_format_pax_bz2.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_pax_bz2.Tpo -c -o libarchive/test/libarchive_test-test_read_format_pax_bz2.o `test -f 'libarchive/test/test_read_format_pax_bz2.c' || echo '$(srcdir)/'`libarchive/test/test_read_format_pax_bz2.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_pax_bz2.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_pax_bz2.Po
@@ -11304,6 +11670,34 @@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_read_format_zip_filename.obj `if test -f 'libarchive/test/test_read_format_zip_filename.c'; then $(CYGPATH_W) 'libarchive/test/test_read_format_zip_filename.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_read_format_zip_filename.c'; fi`
+libarchive/test/libarchive_test-test_read_format_zip_high_compression.o: libarchive/test/test_read_format_zip_high_compression.c
+ at am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_read_format_zip_high_compression.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_zip_high_compression.Tpo -c -o libarchive/test/libarchive_test-test_read_format_zip_high_compression.o `test -f 'libarchive/test/test_read_format_zip_high_compression.c' || echo '$(srcdir)/'`libarchive/test/test_read_format_zip_high_compression.c
+ at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_zip_high_compression.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_zip_high_compression.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libarchive/test/test_read_format_zip_high_compression.c' object='libarchive/test/libarchive_test-test_read_format_zip_high_compression.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_read_format_zip_high_compression.o `test -f 'libarchive/test/test_read_format_zip_high_compression.c' || echo '$(srcdir)/'`libarchive/test/test_read_format_zip_high_compression.c
+
+libarchive/test/libarchive_test-test_read_format_zip_high_compression.obj: libarchive/test/test_read_format_zip_high_compression.c
+ at am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_read_format_zip_high_compression.obj -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_zip_high_compression.Tpo -c -o libarchive/test/libarchive_test-test_read_format_zip_high_compression.obj `if test -f 'libarchive/test/test_read_format_zip_high_compression.c'; then $(CYGPATH_W) 'libarchive/test/test_read_format_zip_high_compression.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_read_format_zip_high_compression.c'; fi`
+ at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_zip_high_compression.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_zip_high_compression.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libarchive/test/test_read_format_zip_high_compression.c' object='libarchive/test/libarchive_test-test_read_format_zip_high_compression.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_read_format_zip_high_compression.obj `if test -f 'libarchive/test/test_read_format_zip_high_compression.c'; then $(CYGPATH_W) 'libarchive/test/test_read_format_zip_high_compression.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_read_format_zip_high_compression.c'; fi`
+
+libarchive/test/libarchive_test-test_read_format_zip_jar.o: libarchive/test/test_read_format_zip_jar.c
+ at am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_read_format_zip_jar.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_zip_jar.Tpo -c -o libarchive/test/libarchive_test-test_read_format_zip_jar.o `test -f 'libarchive/test/test_read_format_zip_jar.c' || echo '$(srcdir)/'`libarchive/test/test_read_format_zip_jar.c
+ at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_zip_jar.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_zip_jar.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libarchive/test/test_read_format_zip_jar.c' object='libarchive/test/libarchive_test-test_read_format_zip_jar.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_read_format_zip_jar.o `test -f 'libarchive/test/test_read_format_zip_jar.c' || echo '$(srcdir)/'`libarchive/test/test_read_format_zip_jar.c
+
+libarchive/test/libarchive_test-test_read_format_zip_jar.obj: libarchive/test/test_read_format_zip_jar.c
+ at am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_read_format_zip_jar.obj -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_zip_jar.Tpo -c -o libarchive/test/libarchive_test-test_read_format_zip_jar.obj `if test -f 'libarchive/test/test_read_format_zip_jar.c'; then $(CYGPATH_W) 'libarchive/test/test_read_format_zip_jar.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_read_format_zip_jar.c'; fi`
+ at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_zip_jar.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_zip_jar.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libarchive/test/test_read_format_zip_jar.c' object='libarchive/test/libarchive_test-test_read_format_zip_jar.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_read_format_zip_jar.obj `if test -f 'libarchive/test/test_read_format_zip_jar.c'; then $(CYGPATH_W) 'libarchive/test/test_read_format_zip_jar.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_read_format_zip_jar.c'; fi`
+
libarchive/test/libarchive_test-test_read_format_zip_mac_metadata.o: libarchive/test/test_read_format_zip_mac_metadata.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_read_format_zip_mac_metadata.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_zip_mac_metadata.Tpo -c -o libarchive/test/libarchive_test-test_read_format_zip_mac_metadata.o `test -f 'libarchive/test/test_read_format_zip_mac_metadata.c' || echo '$(srcdir)/'`libarchive/test/test_read_format_zip_mac_metadata.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_zip_mac_metadata.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_zip_mac_metadata.Po
@@ -11458,6 +11852,20 @@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_read_format_zip_zip64.obj `if test -f 'libarchive/test/test_read_format_zip_zip64.c'; then $(CYGPATH_W) 'libarchive/test/test_read_format_zip_zip64.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_read_format_zip_zip64.c'; fi`
+libarchive/test/libarchive_test-test_read_format_zip_with_invalid_traditional_eocd.o: libarchive/test/test_read_format_zip_with_invalid_traditional_eocd.c
+ at am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_read_format_zip_with_invalid_traditional_eocd.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_zip_with_invalid_traditional_eocd.Tpo -c -o libarchive/test/libarchive_test-test_read_format_zip_with_invalid_traditional_eocd.o `test -f 'libarchive/test/test_read_format_zip_with_invalid_traditional_eocd.c' || echo '$(srcdir)/'`libarchive/test/test_read_format_zip_with_invalid_traditional_eocd.c
+ at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_zip_with_invalid_traditional_eocd.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_zip_with_invalid_traditional_eocd.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libarchive/test/test_read_format_zip_with_invalid_traditional_eocd.c' object='libarchive/test/libarchive_test-test_read_format_zip_with_invalid_traditional_eocd.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_read_format_zip_with_invalid_traditional_eocd.o `test -f 'libarchive/test/test_read_format_zip_with_invalid_traditional_eocd.c' || echo '$(srcdir)/'`libarchive/test/test_read_format_zip_with_invalid_traditional_eocd.c
+
+libarchive/test/libarchive_test-test_read_format_zip_with_invalid_traditional_eocd.obj: libarchive/test/test_read_format_zip_with_invalid_traditional_eocd.c
+ at am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_read_format_zip_with_invalid_traditional_eocd.obj -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_zip_with_invalid_traditional_eocd.Tpo -c -o libarchive/test/libarchive_test-test_read_format_zip_with_invalid_traditional_eocd.obj `if test -f 'libarchive/test/test_read_format_zip_with_invalid_traditional_eocd.c'; then $(CYGPATH_W) 'libarchive/test/test_read_format_zip_with_invalid_traditional_eocd.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_read_format_zip_with_invalid_traditional_eocd.c'; fi`
+ at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_zip_with_invalid_traditional_eocd.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_read_format_zip_with_invalid_traditional_eocd.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libarchive/test/test_read_format_zip_with_invalid_traditional_eocd.c' object='libarchive/test/libarchive_test-test_read_format_zip_with_invalid_traditional_eocd.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_read_format_zip_with_invalid_traditional_eocd.obj `if test -f 'libarchive/test/test_read_format_zip_with_invalid_traditional_eocd.c'; then $(CYGPATH_W) 'libarchive/test/test_read_format_zip_with_invalid_traditional_eocd.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_read_format_zip_with_invalid_traditional_eocd.c'; fi`
+
libarchive/test/libarchive_test-test_read_large.o: libarchive/test/test_read_large.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_read_large.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_read_large.Tpo -c -o libarchive/test/libarchive_test-test_read_large.o `test -f 'libarchive/test/test_read_large.c' || echo '$(srcdir)/'`libarchive/test/test_read_large.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libarchive/test/$(DEPDIR)/libarchive_test-test_read_large.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_read_large.Po
@@ -11472,6 +11880,20 @@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_read_large.obj `if test -f 'libarchive/test/test_read_large.c'; then $(CYGPATH_W) 'libarchive/test/test_read_large.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_read_large.c'; fi`
+libarchive/test/libarchive_test-test_read_pax_schily_xattr.o: libarchive/test/test_read_pax_schily_xattr.c
+ at am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_read_pax_schily_xattr.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_read_pax_schily_xattr.Tpo -c -o libarchive/test/libarchive_test-test_read_pax_schily_xattr.o `test -f 'libarchive/test/test_read_pax_schily_xattr.c' || echo '$(srcdir)/'`libarchive/test/test_read_pax_schily_xattr.c
+ at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libarchive/test/$(DEPDIR)/libarchive_test-test_read_pax_schily_xattr.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_read_pax_schily_xattr.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libarchive/test/test_read_pax_schily_xattr.c' object='libarchive/test/libarchive_test-test_read_pax_schily_xattr.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_read_pax_schily_xattr.o `test -f 'libarchive/test/test_read_pax_schily_xattr.c' || echo '$(srcdir)/'`libarchive/test/test_read_pax_schily_xattr.c
+
+libarchive/test/libarchive_test-test_read_pax_schily_xattr.obj: libarchive/test/test_read_pax_schily_xattr.c
+ at am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_read_pax_schily_xattr.obj -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_read_pax_schily_xattr.Tpo -c -o libarchive/test/libarchive_test-test_read_pax_schily_xattr.obj `if test -f 'libarchive/test/test_read_pax_schily_xattr.c'; then $(CYGPATH_W) 'libarchive/test/test_read_pax_schily_xattr.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_read_pax_schily_xattr.c'; fi`
+ at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libarchive/test/$(DEPDIR)/libarchive_test-test_read_pax_schily_xattr.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_read_pax_schily_xattr.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libarchive/test/test_read_pax_schily_xattr.c' object='libarchive/test/libarchive_test-test_read_pax_schily_xattr.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_read_pax_schily_xattr.obj `if test -f 'libarchive/test/test_read_pax_schily_xattr.c'; then $(CYGPATH_W) 'libarchive/test/test_read_pax_schily_xattr.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_read_pax_schily_xattr.c'; fi`
+
libarchive/test/libarchive_test-test_read_pax_truncated.o: libarchive/test/test_read_pax_truncated.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_read_pax_truncated.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_read_pax_truncated.Tpo -c -o libarchive/test/libarchive_test-test_read_pax_truncated.o `test -f 'libarchive/test/test_read_pax_truncated.c' || echo '$(srcdir)/'`libarchive/test/test_read_pax_truncated.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libarchive/test/$(DEPDIR)/libarchive_test-test_read_pax_truncated.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_read_pax_truncated.Po
@@ -11780,6 +12202,48 @@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_write_disk_secure.obj `if test -f 'libarchive/test/test_write_disk_secure.c'; then $(CYGPATH_W) 'libarchive/test/test_write_disk_secure.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_write_disk_secure.c'; fi`
+libarchive/test/libarchive_test-test_write_disk_secure744.o: libarchive/test/test_write_disk_secure744.c
+ at am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_write_disk_secure744.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_write_disk_secure744.Tpo -c -o libarchive/test/libarchive_test-test_write_disk_secure744.o `test -f 'libarchive/test/test_write_disk_secure744.c' || echo '$(srcdir)/'`libarchive/test/test_write_disk_secure744.c
+ at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libarchive/test/$(DEPDIR)/libarchive_test-test_write_disk_secure744.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_write_disk_secure744.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libarchive/test/test_write_disk_secure744.c' object='libarchive/test/libarchive_test-test_write_disk_secure744.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_write_disk_secure744.o `test -f 'libarchive/test/test_write_disk_secure744.c' || echo '$(srcdir)/'`libarchive/test/test_write_disk_secure744.c
+
+libarchive/test/libarchive_test-test_write_disk_secure744.obj: libarchive/test/test_write_disk_secure744.c
+ at am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_write_disk_secure744.obj -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_write_disk_secure744.Tpo -c -o libarchive/test/libarchive_test-test_write_disk_secure744.obj `if test -f 'libarchive/test/test_write_disk_secure744.c'; then $(CYGPATH_W) 'libarchive/test/test_write_disk_secure744.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_write_disk_secure744.c'; fi`
+ at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libarchive/test/$(DEPDIR)/libarchive_test-test_write_disk_secure744.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_write_disk_secure744.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libarchive/test/test_write_disk_secure744.c' object='libarchive/test/libarchive_test-test_write_disk_secure744.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_write_disk_secure744.obj `if test -f 'libarchive/test/test_write_disk_secure744.c'; then $(CYGPATH_W) 'libarchive/test/test_write_disk_secure744.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_write_disk_secure744.c'; fi`
+
+libarchive/test/libarchive_test-test_write_disk_secure745.o: libarchive/test/test_write_disk_secure745.c
+ at am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_write_disk_secure745.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_write_disk_secure745.Tpo -c -o libarchive/test/libarchive_test-test_write_disk_secure745.o `test -f 'libarchive/test/test_write_disk_secure745.c' || echo '$(srcdir)/'`libarchive/test/test_write_disk_secure745.c
+ at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libarchive/test/$(DEPDIR)/libarchive_test-test_write_disk_secure745.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_write_disk_secure745.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libarchive/test/test_write_disk_secure745.c' object='libarchive/test/libarchive_test-test_write_disk_secure745.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_write_disk_secure745.o `test -f 'libarchive/test/test_write_disk_secure745.c' || echo '$(srcdir)/'`libarchive/test/test_write_disk_secure745.c
+
+libarchive/test/libarchive_test-test_write_disk_secure745.obj: libarchive/test/test_write_disk_secure745.c
+ at am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_write_disk_secure745.obj -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_write_disk_secure745.Tpo -c -o libarchive/test/libarchive_test-test_write_disk_secure745.obj `if test -f 'libarchive/test/test_write_disk_secure745.c'; then $(CYGPATH_W) 'libarchive/test/test_write_disk_secure745.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_write_disk_secure745.c'; fi`
+ at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libarchive/test/$(DEPDIR)/libarchive_test-test_write_disk_secure745.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_write_disk_secure745.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libarchive/test/test_write_disk_secure745.c' object='libarchive/test/libarchive_test-test_write_disk_secure745.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_write_disk_secure745.obj `if test -f 'libarchive/test/test_write_disk_secure745.c'; then $(CYGPATH_W) 'libarchive/test/test_write_disk_secure745.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_write_disk_secure745.c'; fi`
+
+libarchive/test/libarchive_test-test_write_disk_secure746.o: libarchive/test/test_write_disk_secure746.c
+ at am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_write_disk_secure746.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_write_disk_secure746.Tpo -c -o libarchive/test/libarchive_test-test_write_disk_secure746.o `test -f 'libarchive/test/test_write_disk_secure746.c' || echo '$(srcdir)/'`libarchive/test/test_write_disk_secure746.c
+ at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libarchive/test/$(DEPDIR)/libarchive_test-test_write_disk_secure746.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_write_disk_secure746.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libarchive/test/test_write_disk_secure746.c' object='libarchive/test/libarchive_test-test_write_disk_secure746.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_write_disk_secure746.o `test -f 'libarchive/test/test_write_disk_secure746.c' || echo '$(srcdir)/'`libarchive/test/test_write_disk_secure746.c
+
+libarchive/test/libarchive_test-test_write_disk_secure746.obj: libarchive/test/test_write_disk_secure746.c
+ at am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_write_disk_secure746.obj -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_write_disk_secure746.Tpo -c -o libarchive/test/libarchive_test-test_write_disk_secure746.obj `if test -f 'libarchive/test/test_write_disk_secure746.c'; then $(CYGPATH_W) 'libarchive/test/test_write_disk_secure746.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_write_disk_secure746.c'; fi`
+ at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libarchive/test/$(DEPDIR)/libarchive_test-test_write_disk_secure746.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_write_disk_secure746.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libarchive/test/test_write_disk_secure746.c' object='libarchive/test/libarchive_test-test_write_disk_secure746.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_write_disk_secure746.obj `if test -f 'libarchive/test/test_write_disk_secure746.c'; then $(CYGPATH_W) 'libarchive/test/test_write_disk_secure746.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_write_disk_secure746.c'; fi`
+
libarchive/test/libarchive_test-test_write_disk_sparse.o: libarchive/test/test_write_disk_sparse.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_write_disk_sparse.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_write_disk_sparse.Tpo -c -o libarchive/test/libarchive_test-test_write_disk_sparse.o `test -f 'libarchive/test/test_write_disk_sparse.c' || echo '$(srcdir)/'`libarchive/test/test_write_disk_sparse.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libarchive/test/$(DEPDIR)/libarchive_test-test_write_disk_sparse.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_write_disk_sparse.Po
@@ -12634,6 +13098,20 @@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
@am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_write_read_format_zip.obj `if test -f 'libarchive/test/test_write_read_format_zip.c'; then $(CYGPATH_W) 'libarchive/test/test_write_read_format_zip.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_write_read_format_zip.c'; fi`
+libarchive/test/libarchive_test-test_xattr_platform.o: libarchive/test/test_xattr_platform.c
+ at am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_xattr_platform.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_xattr_platform.Tpo -c -o libarchive/test/libarchive_test-test_xattr_platform.o `test -f 'libarchive/test/test_xattr_platform.c' || echo '$(srcdir)/'`libarchive/test/test_xattr_platform.c
+ at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libarchive/test/$(DEPDIR)/libarchive_test-test_xattr_platform.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_xattr_platform.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libarchive/test/test_xattr_platform.c' object='libarchive/test/libarchive_test-test_xattr_platform.o' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_xattr_platform.o `test -f 'libarchive/test/test_xattr_platform.c' || echo '$(srcdir)/'`libarchive/test/test_xattr_platform.c
+
+libarchive/test/libarchive_test-test_xattr_platform.obj: libarchive/test/test_xattr_platform.c
+ at am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_xattr_platform.obj -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_xattr_platform.Tpo -c -o libarchive/test/libarchive_test-test_xattr_platform.obj `if test -f 'libarchive/test/test_xattr_platform.c'; then $(CYGPATH_W) 'libarchive/test/test_xattr_platform.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_xattr_platform.c'; fi`
+ at am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libarchive/test/$(DEPDIR)/libarchive_test-test_xattr_platform.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_xattr_platform.Po
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='libarchive/test/test_xattr_platform.c' object='libarchive/test/libarchive_test-test_xattr_platform.obj' libtool=no @AMDEPBACKSLASH@
+ at AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+ at am__fastdepCC_FALSE@ $(AM_V_CC at am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c -o libarchive/test/libarchive_test-test_xattr_platform.obj `if test -f 'libarchive/test/test_xattr_platform.c'; then $(CYGPATH_W) 'libarchive/test/test_xattr_platform.c'; else $(CYGPATH_W) '$(srcdir)/libarchive/test/test_xattr_platform.c'; fi`
+
libarchive/test/libarchive_test-test_zip_filename_encoding.o: libarchive/test/test_zip_filename_encoding.c
@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libarchive_test_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -MT libarchive/test/libarchive_test-test_zip_filename_encoding.o -MD -MP -MF libarchive/test/$(DEPDIR)/libarchive_test-test_zip_filename_encoding.Tpo -c -o libarchive/test/libarchive_test-test_zip_filename_encoding.o `test -f 'libarchive/test/test_zip_filename_encoding.c' || echo '$(srcdir)/'`libarchive/test/test_zip_filename_encoding.c
@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) libarchive/test/$(DEPDIR)/libarchive_test-test_zip_filename_encoding.Tpo libarchive/test/$(DEPDIR)/libarchive_test-test_zip_filename_encoding.Po
Modified: trunk/contrib/libarchive/NEWS
===================================================================
--- trunk/contrib/libarchive/NEWS 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/NEWS 2018-06-19 20:42:35 UTC (rev 11134)
@@ -1,3 +1,27 @@
+Jul 09, 2017: libarchive 3.3.2 released
+
+Mar 16, 2017: NFSv4 ACL support for Linux (librichacl)
+
+Feb 26, 2017: libarchive 3.3.1 released
+ Security & Feature release
+
+Feb 19, 2017: libarchive 3.3.0 released
+ Security & Feature release
+
+Jan 29, 2017: Limited NFSv4 ACL support for Mac OS (Darwin)
+
+Jan 10, 2017: POSIX.1e and NFSv4 ACL support for Solaris and derivates
+
+Dec 27, 2016: NFSv4 ACL read and write support for pax
+ Deprecated functions: archive_entry_acl_text(), archive_entry_acl_text_w()
+
+Nov, 2016: libarchive is now being tested by the OSS-Fuzz project
+
+Oct 26, 2016: Remove liblzmadec support
+
+Oct 23, 2016: libarchive 3.2.2 released
+ Security release
+
Jun 20, 2016: libarchive 3.2.1 released
This fixes a handful of security and other critical issues with 3.2.0
@@ -273,7 +297,7 @@
* libarchive: Mark which entry strings are set; be accurate about
distinguishing empty strings ("") from unset ones (NULL)
* tar: Don't crash reading entries with empty filenames
- * libarchive_test, bsdtar_test, bsdcpio_test: Better detaults:
+ * libarchive_test, bsdtar_test, bsdcpio_test: Better defaults:
run all tests, delete temp dirs, summarize repeated failures
* -no-undefined to libtool for Cygwin
* libarchive_test: Skip large file tests on systems with 32-bit off_t
Deleted: trunk/contrib/libarchive/README
===================================================================
--- trunk/contrib/libarchive/README 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/README 2018-06-19 20:42:35 UTC (rev 11134)
@@ -1,163 +0,0 @@
-README for libarchive bundle.
-
-Questions? Issues?
- * http://www.libarchive.org is the home for ongoing
- libarchive development, including documentation, and
- links to the libarchive mailing lists.
- * To report an issue, use the issue tracker at
- https://github.com/libarchive/libarchive/issues
- * To submit an enhancement to libarchive, please submit
- a pull request via GitHub.
- https://github.com/libarchive/libarchive/pulls
-
-This distribution bundle includes the following components:
- * libarchive: a library for reading and writing streaming archives
- * tar: the 'bsdtar' program is a full-featured 'tar'
- implementation built on libarchive
- * cpio: the 'bsdcpio' program is a different interface to
- essentially the same functionality
- * cat: the 'bsdcat' program is a simple replacement tool for
- zcat, bzcat, xzcat, and such
- * examples: Some small example programs that you may find useful.
- * examples/minitar: a compact sample demonstrating use of libarchive.
- * contrib: Various items sent to me by third parties;
- please contact the authors with any questions.
-
-The top-level directory contains the following information files:
- * NEWS - highlights of recent changes
- * COPYING - what you can do with this
- * INSTALL - installation instructions
- * README - this file
- * configure - configuration script, see INSTALL for details.
- * CMakeLists.txt - input for "cmake" build tool, see INSTALL
-
-The following files in the top-level directory are used by the
-'configure' script:
- * Makefile.am, aclocal.m4, configure.ac
- - used to build this distribution, only needed by maintainers
- * Makefile.in, config.h.in
- - templates used by configure script
-
-Guide to Documentation installed by this system:
- * bsdtar.1 explains the use of the bsdtar program
- * bsdcpio.1 explains the use of the bsdcpio program
- * bsdcat.1 explains the use of the bsdcat program
- * libarchive.3 gives an overview of the library as a whole
- * archive_read.3, archive_write.3, archive_write_disk.3, and
- archive_read_disk.3 provide detailed calling sequences for the read
- and write APIs
- * archive_entry.3 details the "struct archive_entry" utility class
- * archive_internals.3 provides some insight into libarchive's
- internal structure and operation.
- * libarchive-formats.5 documents the file formats supported by the library
- * cpio.5, mtree.5, and tar.5 provide detailed information about these
- popular archive formats, including hard-to-find details about
- modern cpio and tar variants.
-The manual pages above are provided in the 'doc' directory in
-a number of different formats.
-
-You should also read the copious comments in "archive.h" and the
-source code for the sample programs for more details. Please let us
-know about any errors or omissions you find.
-
-Currently, the library automatically detects and reads the following fomats:
- * GNU tar format (including GNU long filenames, long link names, and sparse files)
- * Solaris 9 extended tar format (including ACLs)
- * Old V7 tar archives
- * POSIX ustar
- * POSIX pax interchange format
- * POSIX octet-oriented cpio
- * SVR4 ASCII cpio
- * POSIX octet-oriented cpio
- * Binary cpio (big-endian or little-endian)
- * 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
- * 7-Zip archives
- * Microsoft CAB format
- * LHA and LZH archives
- * RAR archives
- * XAR archives
-
-The library also detects and handles any of the following before evaluating the archive:
- * uuencoded files
- * files with RPM wrapper
- * gzip compression
- * bzip2 compression
- * compress/LZW compression
- * lzma, lzip, and xz compression
- * lz4 compression
- * lzop compression
-
-The library can create archives in any of the following formats:
- * 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).
- * Old GNU tar format
- * Old V7 tar format
- * POSIX octet-oriented cpio
- * SVR4 "newc" cpio
- * shar archives
- * ZIP archives (with uncompressed or "deflate" compressed entries)
- * GNU and BSD 'ar' archives
- * 'mtree' format
- * ISO9660 format
- * 7-Zip archives
- * XAR archives
-
-When creating archives, the result can be filtered with any of the following:
- * uuencode
- * gzip compression
- * bzip2 compression
- * compress/LZW compression
- * lzma, lzip, and xz compression
- * lz4 compression
- * lzop compression
-
-Notes about the library architecture:
-
- * This is a heavily stream-oriented system. There is no direct
- support for in-place modification or random access.
-
- * The library is designed to be extended with new compression and
- archive formats. The only requirement is that the format be
- readable or writable as a stream and that each archive entry be
- independent. There are articles on the libarchive Wiki explaining
- how to extend libarchive.
-
- * On read, compression and format are always detected automatically.
-
- * I've attempted to minimize static link pollution. If you don't
- explicitly invoke a particular feature (such as support for a
- particular compression or format), it won't get pulled in to
- statically-linked programs. In particular, if you don't explicitly
- enable a particular compression or decompression support, you won't
- need to link against the corresponding compression or decompression
- libraries. This also reduces the size of statically-linked
- binaries in environments where that matters.
-
- * On read, the library accepts whatever blocks you hand it.
- Your read callback is free to pass the library a byte at a time
- or mmap the entire archive and give it to the library at once.
- On write, the library always produces correctly-blocked output.
-
- * The object-style approach allows you to have multiple archive streams
- open at once. bsdtar uses this in its "@archive" extension.
-
- * The archive itself is read/written using callback functions.
- You can read an archive directly from an in-memory buffer or
- write it to a socket, if you wish. There are some utility
- functions to provide easy-to-use "open file," etc, capabilities.
-
- * The read/write APIs are designed to allow individual entries
- to be read or written to any data source: You can create
- a block of data in memory and add it to a tar archive without
- first writing a temporary file. You can also read an entry from
- an archive and write the data directly to a socket. If you want
- to read/write entries to disk, there are convenience functions to
- make this especially easy.
-
- * Note: "pax interchange format" is really an extended tar format,
- despite what the name says.
Copied: trunk/contrib/libarchive/README.md (from rev 11133, vendor/libarchive/dist/README.md)
===================================================================
--- trunk/contrib/libarchive/README.md (rev 0)
+++ trunk/contrib/libarchive/README.md 2018-06-19 20:42:35 UTC (rev 11134)
@@ -0,0 +1,222 @@
+# Welcome to libarchive!
+
+The libarchive project develops a portable, efficient C library that
+can read and write streaming archives in a variety of formats. It
+also includes implementations of the common `tar`, `cpio`, and `zcat`
+command-line tools that use the libarchive library.
+
+## Questions? Issues?
+
+* http://www.libarchive.org is the home for ongoing
+ libarchive development, including documentation,
+ and links to the libarchive mailing lists.
+* To report an issue, use the issue tracker at
+ https://github.com/libarchive/libarchive/issues
+* To submit an enhancement to libarchive, please
+ submit a pull request via GitHub: https://github.com/libarchive/libarchive/pulls
+
+## Contents of the Distribution
+
+This distribution bundle includes the following major components:
+
+* **libarchive**: a library for reading and writing streaming archives
+* **tar**: the 'bsdtar' program is a full-featured 'tar' implementation built on libarchive
+* **cpio**: the 'bsdcpio' program is a different interface to essentially the same functionality
+* **cat**: the 'bsdcat' program is a simple replacement tool for zcat, bzcat, xzcat, and such
+* **examples**: Some small example programs that you may find useful.
+* **examples/minitar**: a compact sample demonstrating use of libarchive.
+* **contrib**: Various items sent to me by third parties; please contact the authors with any questions.
+
+The top-level directory contains the following information files:
+
+* **NEWS** - highlights of recent changes
+* **COPYING** - what you can do with this
+* **INSTALL** - installation instructions
+* **README** - this file
+* **CMakeLists.txt** - input for "cmake" build tool, see INSTALL
+* **configure** - configuration script, see INSTALL for details. If your copy of the source lacks a `configure` script, you can try to construct it by running the script in `build/autogen.sh` (or use `cmake`).
+
+The following files in the top-level directory are used by the 'configure' script:
+* `Makefile.am`, `aclocal.m4`, `configure.ac` - used to build this distribution, only needed by maintainers
+* `Makefile.in`, `config.h.in` - templates used by configure script
+
+## Documentation
+
+In addition to the informational articles and documentation
+in the online [libarchive Wiki](https://github.com/libarchive/libarchive/wiki),
+the distribution also includes a number of manual pages:
+
+ * bsdtar.1 explains the use of the bsdtar program
+ * bsdcpio.1 explains the use of the bsdcpio program
+ * bsdcat.1 explains the use of the bsdcat program
+ * libarchive.3 gives an overview of the library as a whole
+ * archive_read.3, archive_write.3, archive_write_disk.3, and
+ archive_read_disk.3 provide detailed calling sequences for the read
+ and write APIs
+ * archive_entry.3 details the "struct archive_entry" utility class
+ * archive_internals.3 provides some insight into libarchive's
+ internal structure and operation.
+ * libarchive-formats.5 documents the file formats supported by the library
+ * cpio.5, mtree.5, and tar.5 provide detailed information about these
+ popular archive formats, including hard-to-find details about
+ modern cpio and tar variants.
+
+The manual pages above are provided in the 'doc' directory in
+a number of different formats.
+
+You should also read the copious comments in `archive.h` and the
+source code for the sample programs for more details. Please let us
+know about any errors or omissions you find.
+
+## Supported Formats
+
+Currently, the library automatically detects and reads the following fomats:
+ * Old V7 tar archives
+ * POSIX ustar
+ * GNU tar format (including GNU long filenames, long link names, and sparse files)
+ * Solaris 9 extended tar format (including ACLs)
+ * POSIX pax interchange format
+ * POSIX octet-oriented cpio
+ * SVR4 ASCII cpio
+ * POSIX octet-oriented cpio
+ * Binary cpio (big-endian or little-endian)
+ * ISO9660 CD-ROM images (with optional Rockridge or Joliet extensions)
+ * ZIP archives (with uncompressed or "deflate" compressed entries, including support for encrypted Zip archives)
+ * GNU and BSD 'ar' archives
+ * 'mtree' format
+ * 7-Zip archives
+ * Microsoft CAB format
+ * LHA and LZH archives
+ * RAR archives (with some limitations due to RAR's proprietary status)
+ * XAR archives
+
+The library also detects and handles any of the following before evaluating the archive:
+ * uuencoded files
+ * files with RPM wrapper
+ * gzip compression
+ * bzip2 compression
+ * compress/LZW compression
+ * lzma, lzip, and xz compression
+ * lz4 compression
+ * lzop compression
+
+The library can create archives in any of the following formats:
+ * 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).
+ * Old GNU tar format
+ * Old V7 tar format
+ * POSIX octet-oriented cpio
+ * SVR4 "newc" cpio
+ * shar archives
+ * ZIP archives (with uncompressed or "deflate" compressed entries)
+ * GNU and BSD 'ar' archives
+ * 'mtree' format
+ * ISO9660 format
+ * 7-Zip archives
+ * XAR archives
+
+When creating archives, the result can be filtered with any of the following:
+ * uuencode
+ * gzip compression
+ * bzip2 compression
+ * compress/LZW compression
+ * lzma, lzip, and xz compression
+ * lz4 compression
+ * lzop compression
+
+## Notes about the Library Design
+
+The following notes address many of the most common
+questions we are asked about libarchive:
+
+* This is a heavily stream-oriented system. That means that
+ it is optimized to read or write the archive in a single
+ pass from beginning to end. For example, this allows
+ libarchive to process archives too large to store on disk
+ by processing them on-the-fly as they are read from or
+ written to a network or tape drive. This also makes
+ libarchive useful for tools that need to produce
+ archives on-the-fly (such as webservers that provide
+ archived contents of a users account).
+
+* In-place modification and random access to the contents
+ of an archive are not directly supported. For some formats,
+ this is not an issue: For example, tar.gz archives are not
+ designed for random access. In some other cases, libarchive
+ can re-open an archive and scan it from the beginning quickly
+ enough to provide the needed abilities even without true
+ random access. Of course, some applications do require true
+ random access; those applications should consider alternatives
+ to libarchive.
+
+* The library is designed to be extended with new compression and
+ archive formats. The only requirement is that the format be
+ readable or writable as a stream and that each archive entry be
+ independent. There are articles on the libarchive Wiki explaining
+ how to extend libarchive.
+
+* On read, compression and format are always detected automatically.
+
+* The same API is used for all formats; in particular, it's very
+ easy for software using libarchive to transparently handle
+ any of libarchive's archiving formats.
+
+* Libarchive's automatic support for decompression can be used
+ without archiving by explicitly selecting the "raw" and "empty"
+ formats.
+
+* I've attempted to minimize static link pollution. If you don't
+ explicitly invoke a particular feature (such as support for a
+ particular compression or format), it won't get pulled in to
+ statically-linked programs. In particular, if you don't explicitly
+ enable a particular compression or decompression support, you won't
+ need to link against the corresponding compression or decompression
+ libraries. This also reduces the size of statically-linked
+ binaries in environments where that matters.
+
+* The library is generally _thread safe_ depending on the platform:
+ it does not define any global variables of its own. However, some
+ platforms do not provide fully thread-safe versions of key C library
+ functions. On those platforms, libarchive will use the non-thread-safe
+ functions. Patches to improve this are of great interest to us.
+
+* In particular, libarchive's modules to read or write a directory
+ tree do use `chdir()` to optimize the directory traversals. This
+ can cause problems for programs that expect to do disk access from
+ multiple threads. Of course, those modules are completely
+ optional and you can use the rest of libarchive without them.
+
+* The library is _not_ thread aware, however. It does no locking
+ or thread management of any kind. If you create a libarchive
+ object and need to access it from multiple threads, you will
+ need to provide your own locking.
+
+* On read, the library accepts whatever blocks you hand it.
+ Your read callback is free to pass the library a byte at a time
+ or mmap the entire archive and give it to the library at once.
+ On write, the library always produces correctly-blocked output.
+
+* The object-style approach allows you to have multiple archive streams
+ open at once. bsdtar uses this in its "@archive" extension.
+
+* The archive itself is read/written using callback functions.
+ You can read an archive directly from an in-memory buffer or
+ write it to a socket, if you wish. There are some utility
+ functions to provide easy-to-use "open file," etc, capabilities.
+
+* The read/write APIs are designed to allow individual entries
+ to be read or written to any data source: You can create
+ a block of data in memory and add it to a tar archive without
+ first writing a temporary file. You can also read an entry from
+ an archive and write the data directly to a socket. If you want
+ to read/write entries to disk, there are convenience functions to
+ make this especially easy.
+
+* Note: The "pax interchange format" is a POSIX standard extended tar
+ format that should be used when the older _ustar_ format is not
+ appropriate. It has many advantages over other tar formats
+ (including the legacy GNU tar format) and is widely supported by
+ current tar implementations.
+
Modified: trunk/contrib/libarchive/aclocal.m4
===================================================================
--- trunk/contrib/libarchive/aclocal.m4 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/aclocal.m4 2018-06-19 20:42:35 UTC (rev 11134)
@@ -22,9 +22,7 @@
# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
#
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
-# 2006, 2007, 2008, 2009, 2010, 2011 Free Software
-# Foundation, Inc.
+# Copyright (C) 1996-2001, 2003-2015 Free Software Foundation, Inc.
# Written by Gordon Matzigkeit, 1996
#
# This file is free software; the Free Software Foundation gives
@@ -32,36 +30,30 @@
# modifications, as long as this notice is preserved.
m4_define([_LT_COPYING], [dnl
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
-# 2006, 2007, 2008, 2009, 2010, 2011 Free Software
-# Foundation, Inc.
-# Written by Gordon Matzigkeit, 1996
+# Copyright (C) 2014 Free Software Foundation, Inc.
+# This is free software; see the source for copying conditions. There is NO
+# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+# GNU Libtool is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of of the License, or
+# (at your option) any later version.
#
-# This file is part of GNU Libtool.
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program or library that is built
+# using GNU Libtool, you may include this file under the same
+# distribution terms that you use for the rest of that program.
#
-# GNU Libtool is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
-#
-# As a special exception to the GNU General Public License,
-# if you distribute this file as part of a program or library that
-# is built using GNU Libtool, you may include this file under the
-# same distribution terms that you use for the rest of that program.
-#
-# GNU Libtool is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# GNU Libtool is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with GNU Libtool; see the file COPYING. If not, a copy
-# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
-# obtained by writing to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
])
-# serial 57 LT_INIT
+# serial 58 LT_INIT
# LT_PREREQ(VERSION)
@@ -89,7 +81,7 @@
# LT_INIT([OPTIONS])
# ------------------
AC_DEFUN([LT_INIT],
-[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
+[AC_PREREQ([2.62])dnl We use AC_PATH_PROGS_FEATURE_CHECK
AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
AC_BEFORE([$0], [LT_LANG])dnl
AC_BEFORE([$0], [LT_OUTPUT])dnl
@@ -113,7 +105,7 @@
_LT_SET_OPTIONS([$0], [$1])
# This can be used to rebuild libtool when needed
-LIBTOOL_DEPS="$ltmain"
+LIBTOOL_DEPS=$ltmain
# Always use our own libtool.
LIBTOOL='$(SHELL) $(top_builddir)/libtool'
@@ -133,19 +125,36 @@
dnl AC_DEFUN([AM_PROG_LIBTOOL], [])
+# _LT_PREPARE_CC_BASENAME
+# -----------------------
+m4_defun([_LT_PREPARE_CC_BASENAME], [
+# Calculate cc_basename. Skip known compiler wrappers and cross-prefix.
+func_cc_basename ()
+{
+ for cc_temp in @S|@*""; do
+ case $cc_temp in
+ compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
+ distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
+ \-*) ;;
+ *) break;;
+ esac
+ done
+ func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+}
+])# _LT_PREPARE_CC_BASENAME
+
+
# _LT_CC_BASENAME(CC)
# -------------------
-# Calculate cc_basename. Skip known compiler wrappers and cross-prefix.
+# It would be clearer to call AC_REQUIREs from _LT_PREPARE_CC_BASENAME,
+# but that macro is also expanded into generated libtool script, which
+# arranges for $SED and $ECHO to be set by different means.
m4_defun([_LT_CC_BASENAME],
-[for cc_temp in $1""; do
- case $cc_temp in
- compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
- distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
- \-*) ;;
- *) break;;
- esac
-done
-cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+[m4_require([_LT_PREPARE_CC_BASENAME])dnl
+AC_REQUIRE([_LT_DECL_SED])dnl
+AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
+func_cc_basename $1
+cc_basename=$func_cc_basename_result
])
@@ -152,7 +161,7 @@
# _LT_FILEUTILS_DEFAULTS
# ----------------------
# It is okay to use these file commands and assume they have been set
-# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
+# sensibly after 'm4_require([_LT_FILEUTILS_DEFAULTS])'.
m4_defun([_LT_FILEUTILS_DEFAULTS],
[: ${CP="cp -f"}
: ${MV="mv -f"}
@@ -199,15 +208,16 @@
m4_require([_LT_CMD_OLD_ARCHIVE])dnl
m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
m4_require([_LT_WITH_SYSROOT])dnl
+m4_require([_LT_CMD_TRUNCATE])dnl
_LT_CONFIG_LIBTOOL_INIT([
-# See if we are running on zsh, and set the options which allow our
+# See if we are running on zsh, and set the options that allow our
# commands through without removal of \ escapes INIT.
-if test -n "\${ZSH_VERSION+set}" ; then
+if test -n "\${ZSH_VERSION+set}"; then
setopt NO_GLOB_SUBST
fi
])
-if test -n "${ZSH_VERSION+set}" ; then
+if test -n "${ZSH_VERSION+set}"; then
setopt NO_GLOB_SUBST
fi
@@ -220,7 +230,7 @@
# AIX sometimes has problems with the GCC collect2 program. For some
# reason, if we set the COLLECT_NAMES environment variable, the problems
# vanish in a puff of smoke.
- if test "X${COLLECT_NAMES+set}" != Xset; then
+ if test set != "${COLLECT_NAMES+set}"; then
COLLECT_NAMES=
export COLLECT_NAMES
fi
@@ -231,14 +241,14 @@
ofile=libtool
can_build_shared=yes
-# All known linkers require a `.a' archive for static linking (except MSVC,
+# All known linkers require a '.a' archive for static linking (except MSVC,
# which needs '.lib').
libext=a
-with_gnu_ld="$lt_cv_prog_gnu_ld"
+with_gnu_ld=$lt_cv_prog_gnu_ld
-old_CC="$CC"
-old_CFLAGS="$CFLAGS"
+old_CC=$CC
+old_CFLAGS=$CFLAGS
# Set sane defaults for various variables
test -z "$CC" && CC=cc
@@ -291,14 +301,14 @@
# _LT_PROG_LTMAIN
# ---------------
-# Note that this code is called both from `configure', and `config.status'
+# Note that this code is called both from 'configure', and 'config.status'
# now that we use AC_CONFIG_COMMANDS to generate libtool. Notably,
-# `config.status' has no value for ac_aux_dir unless we are using Automake,
+# 'config.status' has no value for ac_aux_dir unless we are using Automake,
# so we pass a copy along to make sure it has a sensible value anyway.
m4_defun([_LT_PROG_LTMAIN],
[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
-ltmain="$ac_aux_dir/ltmain.sh"
+ltmain=$ac_aux_dir/ltmain.sh
])# _LT_PROG_LTMAIN
@@ -305,7 +315,7 @@
# So that we can recreate a full libtool script including additional
# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
-# in macros and then make a single call at the end using the `libtool'
+# in macros and then make a single call at the end using the 'libtool'
# label.
@@ -437,8 +447,8 @@
# _LT_CONFIG_STATUS_DECLARE([VARNAME])
# ------------------------------------
-# Quote a variable value, and forward it to `config.status' so that its
-# declaration there will have the same value as in `configure'. VARNAME
+# Quote a variable value, and forward it to 'config.status' so that its
+# declaration there will have the same value as in 'configure'. VARNAME
# must have a single quote delimited value for this to work.
m4_define([_LT_CONFIG_STATUS_DECLARE],
[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
@@ -462,7 +472,7 @@
# Output comment and list of tags supported by the script
m4_defun([_LT_LIBTOOL_TAGS],
[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
-available_tags="_LT_TAGS"dnl
+available_tags='_LT_TAGS'dnl
])
@@ -490,7 +500,7 @@
# _LT_LIBTOOL_CONFIG_VARS
# -----------------------
# Produce commented declarations of non-tagged libtool config variables
-# suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
+# suitable for insertion in the LIBTOOL CONFIG section of the 'libtool'
# script. Tagged libtool config variables (even for the LIBTOOL CONFIG
# section) are produced by _LT_LIBTOOL_TAG_VARS.
m4_defun([_LT_LIBTOOL_CONFIG_VARS],
@@ -516,8 +526,8 @@
# Send accumulated output to $CONFIG_STATUS. Thanks to the lists of
# variables for single and double quote escaping we saved from calls
# to _LT_DECL, we can put quote escaped variables declarations
-# into `config.status', and then the shell code to quote escape them in
-# for loops in `config.status'. Finally, any additional code accumulated
+# into 'config.status', and then the shell code to quote escape them in
+# for loops in 'config.status'. Finally, any additional code accumulated
# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
m4_defun([_LT_CONFIG_COMMANDS],
[AC_PROVIDE_IFELSE([LT_OUTPUT],
@@ -563,7 +573,7 @@
]], lt_decl_quote_varnames); do
case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
*[[\\\\\\\`\\"\\\$]]*)
- eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
+ eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
;;
*)
eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
@@ -576,7 +586,7 @@
]], lt_decl_dquote_varnames); do
case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
*[[\\\\\\\`\\"\\\$]]*)
- eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
+ eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
;;
*)
eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
@@ -592,7 +602,7 @@
# Generate a child script FILE with all initialization necessary to
# reuse the environment learned by the parent script, and make the
# file executable. If COMMENT is supplied, it is inserted after the
-# `#!' sequence but before initialization text begins. After this
+# '#!' sequence but before initialization text begins. After this
# macro, additional text can be appended to FILE to form the body of
# the child script. The macro ends with non-zero status if the
# file could not be fully written (such as if the disk is full).
@@ -614,7 +624,7 @@
_AS_PREPARE
exec AS_MESSAGE_FD>&1
_ASEOF
-test $lt_write_fail = 0 && chmod +x $1[]dnl
+test 0 = "$lt_write_fail" && chmod +x $1[]dnl
m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
# LT_OUTPUT
@@ -637,7 +647,7 @@
} >&AS_MESSAGE_LOG_FD
lt_cl_help="\
-\`$as_me' creates a local libtool stub from the current configuration,
+'$as_me' creates a local libtool stub from the current configuration,
for use in further configure time tests before the real libtool is
generated.
@@ -659,7 +669,7 @@
This config.lt script is free software; the Free Software Foundation
gives unlimited permision to copy, distribute and modify it."
-while test $[#] != 0
+while test 0 != $[#]
do
case $[1] in
--version | --v* | -V )
@@ -672,10 +682,10 @@
lt_cl_silent=: ;;
-*) AC_MSG_ERROR([unrecognized option: $[1]
-Try \`$[0] --help' for more information.]) ;;
+Try '$[0] --help' for more information.]) ;;
*) AC_MSG_ERROR([unrecognized argument: $[1]
-Try \`$[0] --help' for more information.]) ;;
+Try '$[0] --help' for more information.]) ;;
esac
shift
done
@@ -701,7 +711,7 @@
# open by configure. Here we exec the FD to /dev/null, effectively closing
# config.log, so it can be properly (re)opened and appended to by config.lt.
lt_cl_success=:
-test "$silent" = yes &&
+test yes = "$silent" &&
lt_config_lt_args="$lt_config_lt_args --quiet"
exec AS_MESSAGE_LOG_FD>/dev/null
$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
@@ -721,27 +731,30 @@
_LT_CONFIG_SAVE_COMMANDS([
m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
m4_if(_LT_TAG, [C], [
- # See if we are running on zsh, and set the options which allow our
+ # See if we are running on zsh, and set the options that allow our
# commands through without removal of \ escapes.
- if test -n "${ZSH_VERSION+set}" ; then
+ if test -n "${ZSH_VERSION+set}"; then
setopt NO_GLOB_SUBST
fi
- cfgfile="${ofile}T"
+ cfgfile=${ofile}T
trap "$RM \"$cfgfile\"; exit 1" 1 2 15
$RM "$cfgfile"
cat <<_LT_EOF >> "$cfgfile"
#! $SHELL
+# Generated automatically by $as_me ($PACKAGE) $VERSION
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
-# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
-# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-# NOTE: Changes made to this file will be lost: look at ltmain.sh.
-#
+# Provide generalized library-building support services.
+# Written by Gordon Matzigkeit, 1996
+
_LT_COPYING
_LT_LIBTOOL_TAGS
+# Configured defaults for sys_lib_dlsearch_path munging.
+: \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"}
+
# ### BEGIN LIBTOOL CONFIG
_LT_LIBTOOL_CONFIG_VARS
_LT_LIBTOOL_TAG_VARS
@@ -749,6 +762,17 @@
_LT_EOF
+ cat <<'_LT_EOF' >> "$cfgfile"
+
+# ### BEGIN FUNCTIONS SHARED WITH CONFIGURE
+
+_LT_PREPARE_MUNGE_PATH_LIST
+_LT_PREPARE_CC_BASENAME
+
+# ### END FUNCTIONS SHARED WITH CONFIGURE
+
+_LT_EOF
+
case $host_os in
aix3*)
cat <<\_LT_EOF >> "$cfgfile"
@@ -755,7 +779,7 @@
# AIX sometimes has problems with the GCC collect2 program. For some
# reason, if we set the COLLECT_NAMES environment variable, the problems
# vanish in a puff of smoke.
-if test "X${COLLECT_NAMES+set}" != Xset; then
+if test set != "${COLLECT_NAMES+set}"; then
COLLECT_NAMES=
export COLLECT_NAMES
fi
@@ -772,8 +796,6 @@
sed '$q' "$ltmain" >> "$cfgfile" \
|| (rm -f "$cfgfile"; exit 1)
- _LT_PROG_REPLACE_SHELLFNS
-
mv -f "$cfgfile" "$ofile" ||
(rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
chmod +x "$ofile"
@@ -791,7 +813,6 @@
[m4_if([$1], [], [
PACKAGE='$PACKAGE'
VERSION='$VERSION'
- TIMESTAMP='$TIMESTAMP'
RM='$RM'
ofile='$ofile'], [])
])dnl /_LT_CONFIG_SAVE_COMMANDS
@@ -988,7 +1009,7 @@
AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
[lt_cv_apple_cc_single_mod=no
- if test -z "${LT_MULTI_MODULE}"; then
+ if test -z "$LT_MULTI_MODULE"; then
# By default we will add the -single_module flag. You can override
# by either setting the environment variable LT_MULTI_MODULE
# non-empty at configure time, or by adding -multi_module to the
@@ -1006,7 +1027,7 @@
cat conftest.err >&AS_MESSAGE_LOG_FD
# Otherwise, if the output was created with a 0 exit code from
# the compiler, it worked.
- elif test -f libconftest.dylib && test $_lt_result -eq 0; then
+ elif test -f libconftest.dylib && test 0 = "$_lt_result"; then
lt_cv_apple_cc_single_mod=yes
else
cat conftest.err >&AS_MESSAGE_LOG_FD
@@ -1024,7 +1045,7 @@
AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
[lt_cv_ld_exported_symbols_list=yes],
[lt_cv_ld_exported_symbols_list=no])
- LDFLAGS="$save_LDFLAGS"
+ LDFLAGS=$save_LDFLAGS
])
AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
@@ -1046,7 +1067,7 @@
_lt_result=$?
if test -s conftest.err && $GREP force_load conftest.err; then
cat conftest.err >&AS_MESSAGE_LOG_FD
- elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then
+ elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then
lt_cv_ld_force_load=yes
else
cat conftest.err >&AS_MESSAGE_LOG_FD
@@ -1056,9 +1077,9 @@
])
case $host_os in
rhapsody* | darwin1.[[012]])
- _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
+ _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;;
darwin1.*)
- _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+ _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
darwin*) # darwin 5.x on
# if running on 10.5 or later, the deployment target defaults
# to the OS version, if on x86, and 10.4, the deployment
@@ -1065,23 +1086,23 @@
# target defaults to 10.4. Don't you love it?
case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
- _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
- 10.[[012]]*)
- _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+ _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
+ 10.[[012]][[,.]]*)
+ _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
10.*)
- _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+ _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
esac
;;
esac
- if test "$lt_cv_apple_cc_single_mod" = "yes"; then
+ if test yes = "$lt_cv_apple_cc_single_mod"; then
_lt_dar_single_mod='$single_module'
fi
- if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
- _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
+ if test yes = "$lt_cv_ld_exported_symbols_list"; then
+ _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym'
else
- _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib'
fi
- if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
+ if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then
_lt_dsymutil='~$DSYMUTIL $lib || :'
else
_lt_dsymutil=
@@ -1101,8 +1122,8 @@
_LT_TAGVAR(hardcode_direct, $1)=no
_LT_TAGVAR(hardcode_automatic, $1)=yes
_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
- if test "$lt_cv_ld_force_load" = "yes"; then
- _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
+ if test yes = "$lt_cv_ld_force_load"; then
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes],
[FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes])
else
@@ -1109,21 +1130,21 @@
_LT_TAGVAR(whole_archive_flag_spec, $1)=''
fi
_LT_TAGVAR(link_all_deplibs, $1)=yes
- _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
+ _LT_TAGVAR(allow_undefined_flag, $1)=$_lt_dar_allow_undefined
case $cc_basename in
- ifort*) _lt_dar_can_shared=yes ;;
+ ifort*|nagfor*) _lt_dar_can_shared=yes ;;
*) _lt_dar_can_shared=$GCC ;;
esac
- if test "$_lt_dar_can_shared" = "yes"; then
+ if test yes = "$_lt_dar_can_shared"; then
output_verbose_link_cmd=func_echo_all
- _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
- _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
- _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
- _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
+ _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil"
+ _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil"
+ _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil"
+ _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil"
m4_if([$1], [CXX],
-[ if test "$lt_cv_apple_cc_single_mod" != "yes"; then
- _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}"
- _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}"
+[ if test yes != "$lt_cv_apple_cc_single_mod"; then
+ _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dsymutil"
+ _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \$lib-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$lib-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring$_lt_dar_export_syms$_lt_dsymutil"
fi
],[])
else
@@ -1143,7 +1164,7 @@
# Allow to override them for all tags through lt_cv_aix_libpath.
m4_defun([_LT_SYS_MODULE_PATH_AIX],
[m4_require([_LT_DECL_SED])dnl
-if test "${lt_cv_aix_libpath+set}" = set; then
+if test set = "${lt_cv_aix_libpath+set}"; then
aix_libpath=$lt_cv_aix_libpath
else
AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
@@ -1161,7 +1182,7 @@
_LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
fi],[])
if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
- _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib"
+ _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=/usr/lib:/lib
fi
])
aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
@@ -1181,8 +1202,8 @@
# -----------------------
# Find how we can fake an echo command that does not interpret backslash.
# In particular, with Autoconf 2.60 or later we add some code to the start
-# of the generated configure script which will find a shell with a builtin
-# printf (which we can use as an echo command).
+# of the generated configure script that will find a shell with a builtin
+# printf (that we can use as an echo command).
m4_defun([_LT_PROG_ECHO_BACKSLASH],
[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
@@ -1210,10 +1231,10 @@
# Invoke $ECHO with all args, space-separated.
func_echo_all ()
{
- $ECHO "$*"
+ $ECHO "$*"
}
-case "$ECHO" in
+case $ECHO in
printf*) AC_MSG_RESULT([printf]) ;;
print*) AC_MSG_RESULT([print -r]) ;;
*) AC_MSG_RESULT([cat]) ;;
@@ -1239,16 +1260,17 @@
AC_DEFUN([_LT_WITH_SYSROOT],
[AC_MSG_CHECKING([for sysroot])
AC_ARG_WITH([sysroot],
-[ --with-sysroot[=DIR] Search for dependent libraries within DIR
- (or the compiler's sysroot if not specified).],
+[AS_HELP_STRING([--with-sysroot@<:@=DIR@:>@],
+ [Search for dependent libraries within DIR (or the compiler's sysroot
+ if not specified).])],
[], [with_sysroot=no])
dnl lt_sysroot will always be passed unquoted. We quote it here
dnl in case the user passed a directory name.
lt_sysroot=
-case ${with_sysroot} in #(
+case $with_sysroot in #(
yes)
- if test "$GCC" = yes; then
+ if test yes = "$GCC"; then
lt_sysroot=`$CC --print-sysroot 2>/dev/null`
fi
;; #(
@@ -1258,7 +1280,7 @@
no|'')
;; #(
*)
- AC_MSG_RESULT([${with_sysroot}])
+ AC_MSG_RESULT([$with_sysroot])
AC_MSG_ERROR([The sysroot must be an absolute path.])
;;
esac
@@ -1265,7 +1287,7 @@
AC_MSG_RESULT([${lt_sysroot:-no}])
_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
-[dependent libraries, and in which our libraries should be installed.])])
+[dependent libraries, and where our libraries should be installed.])])
# _LT_ENABLE_LOCK
# ---------------
@@ -1273,21 +1295,22 @@
[AC_ARG_ENABLE([libtool-lock],
[AS_HELP_STRING([--disable-libtool-lock],
[avoid locking (might break parallel builds)])])
-test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+test no = "$enable_libtool_lock" || enable_libtool_lock=yes
# Some flags need to be propagated to the compiler or linker for good
# libtool support.
case $host in
ia64-*-hpux*)
- # Find out which ABI we are using.
+ # Find out what ABI is being produced by ac_compile, and set mode
+ # options accordingly.
echo 'int i;' > conftest.$ac_ext
if AC_TRY_EVAL(ac_compile); then
case `/usr/bin/file conftest.$ac_objext` in
*ELF-32*)
- HPUX_IA64_MODE="32"
+ HPUX_IA64_MODE=32
;;
*ELF-64*)
- HPUX_IA64_MODE="64"
+ HPUX_IA64_MODE=64
;;
esac
fi
@@ -1294,10 +1317,11 @@
rm -rf conftest*
;;
*-*-irix6*)
- # Find out which ABI we are using.
+ # Find out what ABI is being produced by ac_compile, and set linker
+ # options accordingly.
echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
if AC_TRY_EVAL(ac_compile); then
- if test "$lt_cv_prog_gnu_ld" = yes; then
+ if test yes = "$lt_cv_prog_gnu_ld"; then
case `/usr/bin/file conftest.$ac_objext` in
*32-bit*)
LD="${LD-ld} -melf32bsmip"
@@ -1326,9 +1350,46 @@
rm -rf conftest*
;;
+mips64*-*linux*)
+ # Find out what ABI is being produced by ac_compile, and set linker
+ # options accordingly.
+ echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
+ if AC_TRY_EVAL(ac_compile); then
+ emul=elf
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ emul="${emul}32"
+ ;;
+ *64-bit*)
+ emul="${emul}64"
+ ;;
+ esac
+ case `/usr/bin/file conftest.$ac_objext` in
+ *MSB*)
+ emul="${emul}btsmip"
+ ;;
+ *LSB*)
+ emul="${emul}ltsmip"
+ ;;
+ esac
+ case `/usr/bin/file conftest.$ac_objext` in
+ *N32*)
+ emul="${emul}n32"
+ ;;
+ esac
+ LD="${LD-ld} -m $emul"
+ fi
+ rm -rf conftest*
+ ;;
+
x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
- # Find out which ABI we are using.
+ # Find out what ABI is being produced by ac_compile, and set linker
+ # options accordingly. Note that the listed cases only cover the
+ # situations where additional linker options are needed (such as when
+ # doing 32-bit compilation for a host where ld defaults to 64-bit, or
+ # vice versa); the common cases where no linker options are needed do
+ # not appear in the list.
echo 'int i;' > conftest.$ac_ext
if AC_TRY_EVAL(ac_compile); then
case `/usr/bin/file conftest.o` in
@@ -1347,10 +1408,10 @@
;;
esac
;;
- powerpc64le-*)
+ powerpc64le-*linux*)
LD="${LD-ld} -m elf32lppclinux"
;;
- powerpc64-*)
+ powerpc64-*linux*)
LD="${LD-ld} -m elf32ppclinux"
;;
s390x-*linux*)
@@ -1369,10 +1430,10 @@
x86_64-*linux*)
LD="${LD-ld} -m elf_x86_64"
;;
- powerpcle-*)
+ powerpcle-*linux*)
LD="${LD-ld} -m elf64lppc"
;;
- powerpc-*)
+ powerpc-*linux*)
LD="${LD-ld} -m elf64ppc"
;;
s390*-*linux*|s390*-*tpf*)
@@ -1390,19 +1451,20 @@
*-*-sco3.2v5*)
# On SCO OpenServer 5, we need -belf to get full-featured binaries.
- SAVE_CFLAGS="$CFLAGS"
+ SAVE_CFLAGS=$CFLAGS
CFLAGS="$CFLAGS -belf"
AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
[AC_LANG_PUSH(C)
AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
AC_LANG_POP])
- if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+ if test yes != "$lt_cv_cc_needs_belf"; then
# this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
- CFLAGS="$SAVE_CFLAGS"
+ CFLAGS=$SAVE_CFLAGS
fi
;;
*-*solaris*)
- # Find out which ABI we are using.
+ # Find out what ABI is being produced by ac_compile, and set linker
+ # options accordingly.
echo 'int i;' > conftest.$ac_ext
if AC_TRY_EVAL(ac_compile); then
case `/usr/bin/file conftest.o` in
@@ -1410,7 +1472,7 @@
case $lt_cv_prog_gnu_ld in
yes*)
case $host in
- i?86-*-solaris*)
+ i?86-*-solaris*|x86_64-*-solaris*)
LD="${LD-ld} -m elf_x86_64"
;;
sparc*-*-solaris*)
@@ -1419,7 +1481,7 @@
esac
# GNU ld 2.21 introduced _sol2 emulations. Use them if available.
if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
- LD="${LD-ld}_sol2"
+ LD=${LD-ld}_sol2
fi
;;
*)
@@ -1435,7 +1497,7 @@
;;
esac
-need_locks="$enable_libtool_lock"
+need_locks=$enable_libtool_lock
])# _LT_ENABLE_LOCK
@@ -1454,11 +1516,11 @@
[echo conftest.$ac_objext > conftest.lst
lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
AC_TRY_EVAL([lt_ar_try])
- if test "$ac_status" -eq 0; then
+ if test 0 -eq "$ac_status"; then
# Ensure the archiver fails upon bogus file names.
rm -f conftest.$ac_objext libconftest.a
AC_TRY_EVAL([lt_ar_try])
- if test "$ac_status" -ne 0; then
+ if test 0 -ne "$ac_status"; then
lt_cv_ar_at_file=@
fi
fi
@@ -1466,7 +1528,7 @@
])
])
-if test "x$lt_cv_ar_at_file" = xno; then
+if test no = "$lt_cv_ar_at_file"; then
archiver_list_spec=
else
archiver_list_spec=$lt_cv_ar_at_file
@@ -1497,7 +1559,7 @@
if test -n "$RANLIB"; then
case $host_os in
- openbsd*)
+ bitrig* | openbsd*)
old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
;;
*)
@@ -1533,7 +1595,7 @@
[$2=no
m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
echo "$lt_simple_compile_test_code" > conftest.$ac_ext
- lt_compiler_flag="$3"
+ lt_compiler_flag="$3" ## exclude from sc_useless_quotes_in_assignment
# Insert the option either (1) after the last *FLAGS variable, or
# (2) before a word containing "conftest.", or (3) at the end.
# Note that $ac_compile itself does not contain backslashes and begins
@@ -1560,7 +1622,7 @@
$RM conftest*
])
-if test x"[$]$2" = xyes; then
+if test yes = "[$]$2"; then
m4_if([$5], , :, [$5])
else
m4_if([$6], , :, [$6])
@@ -1582,7 +1644,7 @@
m4_require([_LT_DECL_SED])dnl
AC_CACHE_CHECK([$1], [$2],
[$2=no
- save_LDFLAGS="$LDFLAGS"
+ save_LDFLAGS=$LDFLAGS
LDFLAGS="$LDFLAGS $3"
echo "$lt_simple_link_test_code" > conftest.$ac_ext
if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
@@ -1601,10 +1663,10 @@
fi
fi
$RM -r conftest*
- LDFLAGS="$save_LDFLAGS"
+ LDFLAGS=$save_LDFLAGS
])
-if test x"[$]$2" = xyes; then
+if test yes = "[$]$2"; then
m4_if([$4], , :, [$4])
else
m4_if([$5], , :, [$5])
@@ -1625,7 +1687,7 @@
AC_MSG_CHECKING([the maximum length of command line arguments])
AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
i=0
- teststring="ABCD"
+ teststring=ABCD
case $build_os in
msdosdjgpp*)
@@ -1665,7 +1727,7 @@
lt_cv_sys_max_cmd_len=8192;
;;
- netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
+ bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*)
# This has been around since 386BSD, at least. Likely further.
if test -x /sbin/sysctl; then
lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
@@ -1716,13 +1778,13 @@
*)
lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
if test -n "$lt_cv_sys_max_cmd_len" && \
- test undefined != "$lt_cv_sys_max_cmd_len"; then
+ test undefined != "$lt_cv_sys_max_cmd_len"; then
lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
else
# Make teststring a little bigger before we do anything with it.
# a 1K string should be a reasonable start.
- for i in 1 2 3 4 5 6 7 8 ; do
+ for i in 1 2 3 4 5 6 7 8; do
teststring=$teststring$teststring
done
SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
@@ -1729,9 +1791,9 @@
# If test is not a shell built-in, we'll probably end up computing a
# maximum length that is only half of the actual maximum length, but
# we can't tell.
- while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \
+ while { test X`env echo "$teststring$teststring" 2>/dev/null` \
= "X$teststring$teststring"; } >/dev/null 2>&1 &&
- test $i != 17 # 1/2 MB should be enough
+ test 17 != "$i" # 1/2 MB should be enough
do
i=`expr $i + 1`
teststring=$teststring$teststring
@@ -1747,7 +1809,7 @@
;;
esac
])
-if test -n $lt_cv_sys_max_cmd_len ; then
+if test -n "$lt_cv_sys_max_cmd_len"; then
AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
else
AC_MSG_RESULT(none)
@@ -1775,7 +1837,7 @@
# ----------------------------------------------------------------
m4_defun([_LT_TRY_DLOPEN_SELF],
[m4_require([_LT_HEADER_DLFCN])dnl
-if test "$cross_compiling" = yes; then :
+if test yes = "$cross_compiling"; then :
[$4]
else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
@@ -1822,9 +1884,9 @@
# endif
#endif
-/* When -fvisbility=hidden is used, assume the code has been annotated
+/* When -fvisibility=hidden is used, assume the code has been annotated
correspondingly for the symbols needed. */
-#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
int fnord () __attribute__((visibility("default")));
#endif
@@ -1850,7 +1912,7 @@
return status;
}]
_LT_EOF
- if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
+ if AC_TRY_EVAL(ac_link) && test -s "conftest$ac_exeext" 2>/dev/null; then
(./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
lt_status=$?
case x$lt_status in
@@ -1871,7 +1933,7 @@
# ------------------
AC_DEFUN([LT_SYS_DLOPEN_SELF],
[m4_require([_LT_HEADER_DLFCN])dnl
-if test "x$enable_dlopen" != xyes; then
+if test yes != "$enable_dlopen"; then
enable_dlopen=unknown
enable_dlopen_self=unknown
enable_dlopen_self_static=unknown
@@ -1881,44 +1943,52 @@
case $host_os in
beos*)
- lt_cv_dlopen="load_add_on"
+ lt_cv_dlopen=load_add_on
lt_cv_dlopen_libs=
lt_cv_dlopen_self=yes
;;
mingw* | pw32* | cegcc*)
- lt_cv_dlopen="LoadLibrary"
+ lt_cv_dlopen=LoadLibrary
lt_cv_dlopen_libs=
;;
cygwin*)
- lt_cv_dlopen="dlopen"
+ lt_cv_dlopen=dlopen
lt_cv_dlopen_libs=
;;
darwin*)
- # if libdl is installed we need to link against it
+ # if libdl is installed we need to link against it
AC_CHECK_LIB([dl], [dlopen],
- [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
- lt_cv_dlopen="dyld"
+ [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],[
+ lt_cv_dlopen=dyld
lt_cv_dlopen_libs=
lt_cv_dlopen_self=yes
])
;;
+ tpf*)
+ # Don't try to run any link tests for TPF. We know it's impossible
+ # because TPF is a cross-compiler, and we know how we open DSOs.
+ lt_cv_dlopen=dlopen
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=no
+ ;;
+
*)
AC_CHECK_FUNC([shl_load],
- [lt_cv_dlopen="shl_load"],
+ [lt_cv_dlopen=shl_load],
[AC_CHECK_LIB([dld], [shl_load],
- [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
+ [lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld],
[AC_CHECK_FUNC([dlopen],
- [lt_cv_dlopen="dlopen"],
+ [lt_cv_dlopen=dlopen],
[AC_CHECK_LIB([dl], [dlopen],
- [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
+ [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl],
[AC_CHECK_LIB([svld], [dlopen],
- [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
+ [lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld],
[AC_CHECK_LIB([dld], [dld_link],
- [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
+ [lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld])
])
])
])
@@ -1927,21 +1997,21 @@
;;
esac
- if test "x$lt_cv_dlopen" != xno; then
+ if test no = "$lt_cv_dlopen"; then
+ enable_dlopen=no
+ else
enable_dlopen=yes
- else
- enable_dlopen=no
fi
case $lt_cv_dlopen in
dlopen)
- save_CPPFLAGS="$CPPFLAGS"
- test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+ save_CPPFLAGS=$CPPFLAGS
+ test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
- save_LDFLAGS="$LDFLAGS"
+ save_LDFLAGS=$LDFLAGS
wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
- save_LIBS="$LIBS"
+ save_LIBS=$LIBS
LIBS="$lt_cv_dlopen_libs $LIBS"
AC_CACHE_CHECK([whether a program can dlopen itself],
@@ -1951,7 +2021,7 @@
lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
])
- if test "x$lt_cv_dlopen_self" = xyes; then
+ if test yes = "$lt_cv_dlopen_self"; then
wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
lt_cv_dlopen_self_static, [dnl
@@ -1961,9 +2031,9 @@
])
fi
- CPPFLAGS="$save_CPPFLAGS"
- LDFLAGS="$save_LDFLAGS"
- LIBS="$save_LIBS"
+ CPPFLAGS=$save_CPPFLAGS
+ LDFLAGS=$save_LDFLAGS
+ LIBS=$save_LIBS
;;
esac
@@ -2055,8 +2125,8 @@
m4_require([_LT_FILEUTILS_DEFAULTS])dnl
_LT_COMPILER_C_O([$1])
-hard_links="nottested"
-if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
+hard_links=nottested
+if test no = "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" && test no != "$need_locks"; then
# do not overwrite the value of need_locks provided by the user
AC_MSG_CHECKING([if we can lock with hard links])
hard_links=yes
@@ -2066,8 +2136,8 @@
ln conftest.a conftest.b 2>&5 || hard_links=no
ln conftest.a conftest.b 2>/dev/null && hard_links=no
AC_MSG_RESULT([$hard_links])
- if test "$hard_links" = no; then
- AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
+ if test no = "$hard_links"; then
+ AC_MSG_WARN(['$CC' does not support '-c -o', so 'make -j' may be unsafe])
need_locks=warn
fi
else
@@ -2094,8 +2164,8 @@
_LT_DECL([], [objdir], [0],
[The name of the directory that contains temporary libtool files])dnl
m4_pattern_allow([LT_OBJDIR])dnl
-AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
- [Define to the sub-directory in which libtool stores uninstalled libraries.])
+AC_DEFINE_UNQUOTED([LT_OBJDIR], "$lt_cv_objdir/",
+ [Define to the sub-directory where libtool stores uninstalled libraries.])
])# _LT_CHECK_OBJDIR
@@ -2107,15 +2177,15 @@
_LT_TAGVAR(hardcode_action, $1)=
if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
test -n "$_LT_TAGVAR(runpath_var, $1)" ||
- test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
+ test yes = "$_LT_TAGVAR(hardcode_automatic, $1)"; then
# We can hardcode non-existent directories.
- if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
+ if test no != "$_LT_TAGVAR(hardcode_direct, $1)" &&
# If the only mechanism to avoid hardcoding is shlibpath_var, we
# have to relink, otherwise we might link with an installed library
# when we should be linking with a yet-to-be-installed one
- ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
- test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
+ ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" &&
+ test no != "$_LT_TAGVAR(hardcode_minus_L, $1)"; then
# Linking always hardcodes the temporary library directory.
_LT_TAGVAR(hardcode_action, $1)=relink
else
@@ -2129,12 +2199,12 @@
fi
AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
-if test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
- test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
+if test relink = "$_LT_TAGVAR(hardcode_action, $1)" ||
+ test yes = "$_LT_TAGVAR(inherit_rpath, $1)"; then
# Fast installation is not supported
enable_fast_install=no
-elif test "$shlibpath_overrides_runpath" = yes ||
- test "$enable_shared" = no; then
+elif test yes = "$shlibpath_overrides_runpath" ||
+ test no = "$enable_shared"; then
# Fast installation is not necessary
enable_fast_install=needless
fi
@@ -2158,7 +2228,7 @@
# FIXME - insert some real tests, host_os isn't really good enough
case $host_os in
darwin*)
- if test -n "$STRIP" ; then
+ if test -n "$STRIP"; then
striplib="$STRIP -x"
old_striplib="$STRIP -S"
AC_MSG_RESULT([yes])
@@ -2176,6 +2246,47 @@
])# _LT_CMD_STRIPLIB
+# _LT_PREPARE_MUNGE_PATH_LIST
+# ---------------------------
+# Make sure func_munge_path_list() is defined correctly.
+m4_defun([_LT_PREPARE_MUNGE_PATH_LIST],
+[[# func_munge_path_list VARIABLE PATH
+# -----------------------------------
+# VARIABLE is name of variable containing _space_ separated list of
+# directories to be munged by the contents of PATH, which is string
+# having a format:
+# "DIR[:DIR]:"
+# string "DIR[ DIR]" will be prepended to VARIABLE
+# ":DIR[:DIR]"
+# string "DIR[ DIR]" will be appended to VARIABLE
+# "DIRP[:DIRP]::[DIRA:]DIRA"
+# string "DIRP[ DIRP]" will be prepended to VARIABLE and string
+# "DIRA[ DIRA]" will be appended to VARIABLE
+# "DIR[:DIR]"
+# VARIABLE will be replaced by "DIR[ DIR]"
+func_munge_path_list ()
+{
+ case x at S|@2 in
+ x)
+ ;;
+ *:)
+ eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'` \@S|@@S|@1\"
+ ;;
+ x:*)
+ eval @S|@1=\"\@S|@@S|@1 `$ECHO @S|@2 | $SED 's/:/ /g'`\"
+ ;;
+ *::*)
+ eval @S|@1=\"\@S|@@S|@1\ `$ECHO @S|@2 | $SED -e 's/.*:://' -e 's/:/ /g'`\"
+ eval @S|@1=\"`$ECHO @S|@2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \@S|@@S|@1\"
+ ;;
+ *)
+ eval @S|@1=\"`$ECHO @S|@2 | $SED 's/:/ /g'`\"
+ ;;
+ esac
+}
+]])# _LT_PREPARE_PATH_LIST
+
+
# _LT_SYS_DYNAMIC_LINKER([TAG])
# -----------------------------
# PORTME Fill in your ld.so characteristics
@@ -2186,17 +2297,18 @@
m4_require([_LT_DECL_OBJDUMP])dnl
m4_require([_LT_DECL_SED])dnl
m4_require([_LT_CHECK_SHELL_FEATURES])dnl
+m4_require([_LT_PREPARE_MUNGE_PATH_LIST])dnl
AC_MSG_CHECKING([dynamic linker characteristics])
m4_if([$1],
[], [
-if test "$GCC" = yes; then
+if test yes = "$GCC"; then
case $host_os in
- darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
- *) lt_awk_arg="/^libraries:/" ;;
+ darwin*) lt_awk_arg='/^libraries:/,/LR/' ;;
+ *) lt_awk_arg='/^libraries:/' ;;
esac
case $host_os in
- mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;;
- *) lt_sed_strip_eq="s,=/,/,g" ;;
+ mingw* | cegcc*) lt_sed_strip_eq='s|=\([[A-Za-z]]:\)|\1|g' ;;
+ *) lt_sed_strip_eq='s|=/|/|g' ;;
esac
lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
case $lt_search_path_spec in
@@ -2212,21 +2324,28 @@
;;
esac
# Ok, now we have the path, separated by spaces, we can step through it
- # and add multilib dir if necessary.
+ # and add multilib dir if necessary...
lt_tmp_lt_search_path_spec=
- lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
+ lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
+ # ...but if some path component already ends with the multilib dir we assume
+ # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer).
+ case "$lt_multi_os_dir; $lt_search_path_spec " in
+ "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*)
+ lt_multi_os_dir=
+ ;;
+ esac
for lt_sys_path in $lt_search_path_spec; do
- if test -d "$lt_sys_path/$lt_multi_os_dir"; then
- lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
- else
+ if test -d "$lt_sys_path$lt_multi_os_dir"; then
+ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir"
+ elif test -n "$lt_multi_os_dir"; then
test -d "$lt_sys_path" && \
lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
fi
done
lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
-BEGIN {RS=" "; FS="/|\n";} {
- lt_foo="";
- lt_count=0;
+BEGIN {RS = " "; FS = "/|\n";} {
+ lt_foo = "";
+ lt_count = 0;
for (lt_i = NF; lt_i > 0; lt_i--) {
if ($lt_i != "" && $lt_i != ".") {
if ($lt_i == "..") {
@@ -2233,7 +2352,7 @@
lt_count++;
} else {
if (lt_count == 0) {
- lt_foo="/" $lt_i lt_foo;
+ lt_foo = "/" $lt_i lt_foo;
} else {
lt_count--;
}
@@ -2247,7 +2366,7 @@
# for these hosts.
case $host_os in
mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
- $SED 's,/\([[A-Za-z]]:\),\1,g'` ;;
+ $SED 's|/\([[A-Za-z]]:\)|\1|g'` ;;
esac
sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
else
@@ -2256,7 +2375,7 @@
library_names_spec=
libname_spec='lib$name'
soname_spec=
-shrext_cmds=".so"
+shrext_cmds=.so
postinstall_cmds=
postuninstall_cmds=
finish_cmds=
@@ -2273,14 +2392,17 @@
# flags to be left without arguments
need_version=unknown
+AC_ARG_VAR([LT_SYS_LIBRARY_PATH],
+[User-defined run-time library search path.])
+
case $host_os in
aix3*)
version_type=linux # correct to gnu/linux during the next big refactor
- library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+ library_names_spec='$libname$release$shared_ext$versuffix $libname.a'
shlibpath_var=LIBPATH
# AIX 3 has no versioning support, so we append a major version to the name.
- soname_spec='${libname}${release}${shared_ext}$major'
+ soname_spec='$libname$release$shared_ext$major'
;;
aix[[4-9]]*)
@@ -2288,21 +2410,21 @@
need_lib_prefix=no
need_version=no
hardcode_into_libs=yes
- if test "$host_cpu" = ia64; then
+ if test ia64 = "$host_cpu"; then
# AIX 5 supports IA64
- library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+ library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext'
shlibpath_var=LD_LIBRARY_PATH
else
# With GCC up to 2.95.x, collect2 would create an import file
# for dependence libraries. The import file would start with
- # the line `#! .'. This would cause the generated library to
- # depend on `.', always an invalid library. This was fixed in
+ # the line '#! .'. This would cause the generated library to
+ # depend on '.', always an invalid library. This was fixed in
# development snapshots of GCC prior to 3.0.
case $host_os in
aix4 | aix4.[[01]] | aix4.[[01]].*)
if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
echo ' yes '
- echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
+ echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then
:
else
can_build_shared=no
@@ -2309,20 +2431,70 @@
fi
;;
esac
- # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+ # Using Import Files as archive members, it is possible to support
+ # filename-based versioning of shared library archives on AIX. While
+ # this would work for both with and without runtime linking, it will
+ # prevent static linking of such archives. So we do filename-based
+ # shared library versioning with .so extension only, which is used
+ # when both runtime linking and shared linking is enabled.
+ # Unfortunately, runtime linking may impact performance, so we do
+ # not want this to be the default eventually. Also, we use the
+ # versioned .so libs for executables only if there is the -brtl
+ # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only.
+ # To allow for filename-based versioning support, we need to create
+ # libNAME.so.V as an archive file, containing:
+ # *) an Import File, referring to the versioned filename of the
+ # archive as well as the shared archive member, telling the
+ # bitwidth (32 or 64) of that shared object, and providing the
+ # list of exported symbols of that shared object, eventually
+ # decorated with the 'weak' keyword
+ # *) the shared object with the F_LOADONLY flag set, to really avoid
+ # it being seen by the linker.
+ # At run time we better use the real file rather than another symlink,
+ # but for link time we create the symlink libNAME.so -> libNAME.so.V
+
+ case $with_aix_soname,$aix_use_runtimelinking in
+ # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct
# soname into executable. Probably we can add versioning support to
# collect2, so additional links can be useful in future.
- if test "$aix_use_runtimelinking" = yes; then
+ aix,yes) # traditional libtool
+ dynamic_linker='AIX unversionable lib.so'
# If using run time linking (on AIX 4.2 or later) use lib<name>.so
# instead of lib<name>.a to let people know that these are not
# typical AIX shared libraries.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- else
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ ;;
+ aix,no) # traditional AIX only
+ dynamic_linker='AIX lib.a[(]lib.so.V[)]'
# We preserve .a as extension for shared libraries through AIX4.2
# and later when we are not doing run time linking.
- library_names_spec='${libname}${release}.a $libname.a'
- soname_spec='${libname}${release}${shared_ext}$major'
- fi
+ library_names_spec='$libname$release.a $libname.a'
+ soname_spec='$libname$release$shared_ext$major'
+ ;;
+ svr4,*) # full svr4 only
+ dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)]"
+ library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
+ # We do not specify a path in Import Files, so LIBPATH fires.
+ shlibpath_overrides_runpath=yes
+ ;;
+ *,yes) # both, prefer svr4
+ dynamic_linker="AIX lib.so.V[(]$shared_archive_member_spec.o[)], lib.a[(]lib.so.V[)]"
+ library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
+ # unpreferred sharedlib libNAME.a needs extra handling
+ postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"'
+ postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"'
+ # We do not specify a path in Import Files, so LIBPATH fires.
+ shlibpath_overrides_runpath=yes
+ ;;
+ *,no) # both, prefer aix
+ dynamic_linker="AIX lib.a[(]lib.so.V[)], lib.so.V[(]$shared_archive_member_spec.o[)]"
+ library_names_spec='$libname$release.a $libname.a'
+ soname_spec='$libname$release$shared_ext$major'
+ # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling
+ postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)'
+ postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"'
+ ;;
+ esac
shlibpath_var=LIBPATH
fi
;;
@@ -2332,18 +2504,18 @@
powerpc)
# Since July 2007 AmigaOS4 officially supports .so libraries.
# When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
;;
m68k)
library_names_spec='$libname.ixlibrary $libname.a'
# Create ${libname}_ixlibrary.a entries in /sys/libs.
- finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+ finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
;;
esac
;;
beos*)
- library_names_spec='${libname}${shared_ext}'
+ library_names_spec='$libname$shared_ext'
dynamic_linker="$host_os ld.so"
shlibpath_var=LIBRARY_PATH
;;
@@ -2351,8 +2523,8 @@
bsdi[[45]]*)
version_type=linux # correct to gnu/linux during the next big refactor
need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
shlibpath_var=LD_LIBRARY_PATH
sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
@@ -2364,7 +2536,7 @@
cygwin* | mingw* | pw32* | cegcc*)
version_type=windows
- shrext_cmds=".dll"
+ shrext_cmds=.dll
need_version=no
need_lib_prefix=no
@@ -2373,8 +2545,8 @@
# gcc
library_names_spec='$libname.dll.a'
# DLL is installed to $(libdir)/../bin by postinstall_cmds
- postinstall_cmds='base_file=`basename \${file}`~
- dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+ postinstall_cmds='base_file=`basename \$file`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
dldir=$destdir/`dirname \$dlpath`~
test -d \$dldir || mkdir -p \$dldir~
$install_prog $dir/$dlname \$dldir/$dlname~
@@ -2390,17 +2562,17 @@
case $host_os in
cygwin*)
# Cygwin DLLs use 'cyg' prefix rather than 'lib'
- soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+ soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
m4_if([$1], [],[
sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
;;
mingw* | cegcc*)
# MinGW DLLs use traditional 'lib' prefix
- soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+ soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
;;
pw32*)
# pw32 DLLs use 'pw' prefix rather than 'lib'
- library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+ library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
;;
esac
dynamic_linker='Win32 ld.exe'
@@ -2409,8 +2581,8 @@
*,cl*)
# Native MSVC
libname_spec='$name'
- soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
- library_names_spec='${libname}.dll.lib'
+ soname_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext'
+ library_names_spec='$libname.dll.lib'
case $build_os in
mingw*)
@@ -2437,7 +2609,7 @@
sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
;;
*)
- sys_lib_search_path_spec="$LIB"
+ sys_lib_search_path_spec=$LIB
if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
# It is most probably a Windows format PATH.
sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
@@ -2450,8 +2622,8 @@
esac
# DLL is installed to $(libdir)/../bin by postinstall_cmds
- postinstall_cmds='base_file=`basename \${file}`~
- dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+ postinstall_cmds='base_file=`basename \$file`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
dldir=$destdir/`dirname \$dlpath`~
test -d \$dldir || mkdir -p \$dldir~
$install_prog $dir/$dlname \$dldir/$dlname'
@@ -2464,7 +2636,7 @@
*)
# Assume MSVC wrapper
- library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
+ library_names_spec='$libname`echo $release | $SED -e 's/[[.]]/-/g'`$versuffix$shared_ext $libname.lib'
dynamic_linker='Win32 ld.exe'
;;
esac
@@ -2477,8 +2649,8 @@
version_type=darwin
need_lib_prefix=no
need_version=no
- library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
- soname_spec='${libname}${release}${major}$shared_ext'
+ library_names_spec='$libname$release$major$shared_ext $libname$shared_ext'
+ soname_spec='$libname$release$major$shared_ext'
shlibpath_overrides_runpath=yes
shlibpath_var=DYLD_LIBRARY_PATH
shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
@@ -2491,8 +2663,8 @@
version_type=linux # correct to gnu/linux during the next big refactor
need_lib_prefix=no
need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
- soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
shlibpath_var=LD_LIBRARY_PATH
;;
@@ -2510,12 +2682,13 @@
version_type=freebsd-$objformat
case $version_type in
freebsd-elf*)
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
need_version=no
need_lib_prefix=no
;;
freebsd-*)
- library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
need_version=yes
;;
esac
@@ -2545,10 +2718,10 @@
need_lib_prefix=no
need_version=no
dynamic_linker="$host_os runtime_loader"
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
shlibpath_var=LIBRARY_PATH
- shlibpath_overrides_runpath=yes
+ shlibpath_overrides_runpath=no
sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
hardcode_into_libs=yes
;;
@@ -2566,14 +2739,15 @@
dynamic_linker="$host_os dld.so"
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- if test "X$HPUX_IA64_MODE" = X32; then
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ if test 32 = "$HPUX_IA64_MODE"; then
sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+ sys_lib_dlsearch_path_spec=/usr/lib/hpux32
else
sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+ sys_lib_dlsearch_path_spec=/usr/lib/hpux64
fi
- sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
;;
hppa*64*)
shrext_cmds='.sl'
@@ -2581,8 +2755,8 @@
dynamic_linker="$host_os dld.sl"
shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
;;
@@ -2591,8 +2765,8 @@
dynamic_linker="$host_os dld.sl"
shlibpath_var=SHLIB_PATH
shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
;;
esac
# HP-UX runs *really* slowly unless shared libraries are mode 555, ...
@@ -2605,8 +2779,8 @@
version_type=linux # correct to gnu/linux during the next big refactor
need_lib_prefix=no
need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=no
@@ -2617,7 +2791,7 @@
case $host_os in
nonstopux*) version_type=nonstopux ;;
*)
- if test "$lt_cv_prog_gnu_ld" = yes; then
+ if test yes = "$lt_cv_prog_gnu_ld"; then
version_type=linux # correct to gnu/linux during the next big refactor
else
version_type=irix
@@ -2625,8 +2799,8 @@
esac
need_lib_prefix=no
need_version=no
- soname_spec='${libname}${release}${shared_ext}$major'
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+ soname_spec='$libname$release$shared_ext$major'
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext'
case $host_os in
irix5* | nonstopux*)
libsuff= shlibsuff=
@@ -2645,8 +2819,8 @@
esac
shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
shlibpath_overrides_runpath=no
- sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
- sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+ sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff"
+ sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff"
hardcode_into_libs=yes
;;
@@ -2655,13 +2829,33 @@
dynamic_linker=no
;;
+linux*android*)
+ version_type=none # Android doesn't support versioned libraries.
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$shared_ext'
+ soname_spec='$libname$release$shared_ext'
+ finish_cmds=
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+
+ # This implies no fast_install, which is unacceptable.
+ # Some rework will be needed to allow for fast_install
+ # before this can be enabled.
+ hardcode_into_libs=yes
+
+ dynamic_linker='Android linker'
+ # Don't embed -rpath directories since the linker doesn't support them.
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ ;;
+
# This must be glibc/ELF.
linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
version_type=linux # correct to gnu/linux during the next big refactor
need_lib_prefix=no
need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=no
@@ -2686,7 +2880,12 @@
# before this can be enabled.
hardcode_into_libs=yes
- # Append ld.so.conf contents to the search path
+ # Ideally, we could use ldconfig to report *all* directores which are
+ # searched for libraries, however this is still not possible. Aside from not
+ # being certain /sbin/ldconfig is available, command
+ # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64,
+ # even though it is searched at run-time. Try to do the best guess by
+ # appending ld.so.conf contents (and includes) to the search path.
if test -f /etc/ld.so.conf; then
lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
@@ -2718,12 +2917,12 @@
need_lib_prefix=no
need_version=no
if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
dynamic_linker='NetBSD (a.out) ld.so'
else
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
dynamic_linker='NetBSD ld.elf_so'
fi
shlibpath_var=LD_LIBRARY_PATH
@@ -2733,7 +2932,7 @@
newsos6)
version_type=linux # correct to gnu/linux during the next big refactor
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=yes
;;
@@ -2742,8 +2941,8 @@
version_type=qnx
need_lib_prefix=no
need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=no
hardcode_into_libs=yes
@@ -2750,39 +2949,49 @@
dynamic_linker='ldqnx.so'
;;
-openbsd*)
+openbsd* | bitrig*)
version_type=sunos
- sys_lib_dlsearch_path_spec="/usr/lib"
+ sys_lib_dlsearch_path_spec=/usr/lib
need_lib_prefix=no
- # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
- case $host_os in
- openbsd3.3 | openbsd3.3.*) need_version=yes ;;
- *) need_version=no ;;
- esac
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
+ need_version=no
+ else
+ need_version=yes
+ fi
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
shlibpath_var=LD_LIBRARY_PATH
- if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- case $host_os in
- openbsd2.[[89]] | openbsd2.[[89]].*)
- shlibpath_overrides_runpath=no
- ;;
- *)
- shlibpath_overrides_runpath=yes
- ;;
- esac
- else
- shlibpath_overrides_runpath=yes
- fi
+ shlibpath_overrides_runpath=yes
;;
os2*)
libname_spec='$name'
- shrext_cmds=".dll"
+ version_type=windows
+ shrext_cmds=.dll
+ need_version=no
need_lib_prefix=no
- library_names_spec='$libname${shared_ext} $libname.a'
+ # OS/2 can only load a DLL with a base name of 8 characters or less.
+ soname_spec='`test -n "$os2dllname" && libname="$os2dllname";
+ v=$($ECHO $release$versuffix | tr -d .-);
+ n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _);
+ $ECHO $n$v`$shared_ext'
+ library_names_spec='${libname}_dll.$libext'
dynamic_linker='OS/2 ld.exe'
- shlibpath_var=LIBPATH
+ shlibpath_var=BEGINLIBPATH
+ sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ postinstall_cmds='base_file=`basename \$file`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname~
+ chmod a+x \$dldir/$dlname~
+ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+ eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+ fi'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $RM \$dlpath'
;;
osf3* | osf4* | osf5*)
@@ -2789,11 +2998,11 @@
version_type=osf
need_lib_prefix=no
need_version=no
- soname_spec='${libname}${release}${shared_ext}$major'
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='$libname$release$shared_ext$major'
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
shlibpath_var=LD_LIBRARY_PATH
sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
- sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
;;
rdos*)
@@ -2804,8 +3013,8 @@
version_type=linux # correct to gnu/linux during the next big refactor
need_lib_prefix=no
need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=yes
hardcode_into_libs=yes
@@ -2815,11 +3024,11 @@
sunos4*)
version_type=sunos
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=yes
- if test "$with_gnu_ld" = yes; then
+ if test yes = "$with_gnu_ld"; then
need_lib_prefix=no
fi
need_version=yes
@@ -2827,8 +3036,8 @@
sysv4 | sysv4.3*)
version_type=linux # correct to gnu/linux during the next big refactor
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
shlibpath_var=LD_LIBRARY_PATH
case $host_vendor in
sni)
@@ -2849,24 +3058,24 @@
;;
sysv4*MP*)
- if test -d /usr/nec ;then
+ if test -d /usr/nec; then
version_type=linux # correct to gnu/linux during the next big refactor
- library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
- soname_spec='$libname${shared_ext}.$major'
+ library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext'
+ soname_spec='$libname$shared_ext.$major'
shlibpath_var=LD_LIBRARY_PATH
fi
;;
sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
- version_type=freebsd-elf
+ version_type=sco
need_lib_prefix=no
need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=yes
hardcode_into_libs=yes
- if test "$with_gnu_ld" = yes; then
+ if test yes = "$with_gnu_ld"; then
sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
else
sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
@@ -2884,7 +3093,7 @@
version_type=linux # correct to gnu/linux during the next big refactor
need_lib_prefix=no
need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=no
hardcode_into_libs=yes
@@ -2892,8 +3101,8 @@
uts4*)
version_type=linux # correct to gnu/linux during the next big refactor
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
shlibpath_var=LD_LIBRARY_PATH
;;
@@ -2902,20 +3111,30 @@
;;
esac
AC_MSG_RESULT([$dynamic_linker])
-test "$dynamic_linker" = no && can_build_shared=no
+test no = "$dynamic_linker" && can_build_shared=no
variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
-if test "$GCC" = yes; then
+if test yes = "$GCC"; then
variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
fi
-if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
- sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then
+ sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec
fi
-if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
- sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+
+if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then
+ sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec
fi
+# remember unaugmented sys_lib_dlsearch_path content for libtool script decls...
+configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec
+
+# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code
+func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH"
+
+# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool
+configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH
+
_LT_DECL([], [variables_saved_for_relink], [1],
[Variables whose values should be saved in libtool wrapper scripts and
restored at link time])
@@ -2948,14 +3167,16 @@
[Whether we should hardcode library paths into libraries])
_LT_DECL([], [sys_lib_search_path_spec], [2],
[Compile-time system search path for libraries])
-_LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
- [Run-time system search path for libraries])
+_LT_DECL([sys_lib_dlsearch_path_spec], [configure_time_dlsearch_path], [2],
+ [Detected run-time system search path for libraries])
+_LT_DECL([], [configure_time_lt_sys_library_path], [2],
+ [Explicit LT_SYS_LIBRARY_PATH set during ./configure time])
])# _LT_SYS_DYNAMIC_LINKER
# _LT_PATH_TOOL_PREFIX(TOOL)
# --------------------------
-# find a file program which can recognize shared library
+# find a file program that can recognize shared library
AC_DEFUN([_LT_PATH_TOOL_PREFIX],
[m4_require([_LT_DECL_EGREP])dnl
AC_MSG_CHECKING([for $1])
@@ -2962,25 +3183,25 @@
AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
[case $MAGIC_CMD in
[[\\/*] | ?:[\\/]*])
- lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+ lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path.
;;
*)
- lt_save_MAGIC_CMD="$MAGIC_CMD"
- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ lt_save_MAGIC_CMD=$MAGIC_CMD
+ lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
dnl $ac_dummy forces splitting on constant user-supplied paths.
dnl POSIX.2 word splitting is done only on the output of word expansions,
dnl not every word. This closes a longstanding sh security hole.
ac_dummy="m4_if([$2], , $PATH, [$2])"
for ac_dir in $ac_dummy; do
- IFS="$lt_save_ifs"
+ IFS=$lt_save_ifs
test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/$1; then
- lt_cv_path_MAGIC_CMD="$ac_dir/$1"
+ if test -f "$ac_dir/$1"; then
+ lt_cv_path_MAGIC_CMD=$ac_dir/"$1"
if test -n "$file_magic_test_file"; then
case $deplibs_check_method in
"file_magic "*)
file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
- MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+ MAGIC_CMD=$lt_cv_path_MAGIC_CMD
if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
$EGREP "$file_magic_regex" > /dev/null; then
:
@@ -3003,11 +3224,11 @@
break
fi
done
- IFS="$lt_save_ifs"
- MAGIC_CMD="$lt_save_MAGIC_CMD"
+ IFS=$lt_save_ifs
+ MAGIC_CMD=$lt_save_MAGIC_CMD
;;
esac])
-MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+MAGIC_CMD=$lt_cv_path_MAGIC_CMD
if test -n "$MAGIC_CMD"; then
AC_MSG_RESULT($MAGIC_CMD)
else
@@ -3025,7 +3246,7 @@
# _LT_PATH_MAGIC
# --------------
-# find a file program which can recognize a shared library
+# find a file program that can recognize a shared library
m4_defun([_LT_PATH_MAGIC],
[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
if test -z "$lt_cv_path_MAGIC_CMD"; then
@@ -3052,16 +3273,16 @@
AC_ARG_WITH([gnu-ld],
[AS_HELP_STRING([--with-gnu-ld],
[assume the C compiler uses GNU ld @<:@default=no@:>@])],
- [test "$withval" = no || with_gnu_ld=yes],
+ [test no = "$withval" || with_gnu_ld=yes],
[with_gnu_ld=no])dnl
ac_prog=ld
-if test "$GCC" = yes; then
+if test yes = "$GCC"; then
# Check if gcc -print-prog-name=ld gives a path.
AC_MSG_CHECKING([for ld used by $CC])
case $host in
*-*-mingw*)
- # gcc leaves a trailing carriage return which upsets mingw
+ # gcc leaves a trailing carriage return, which upsets mingw
ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
*)
ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
@@ -3075,7 +3296,7 @@
while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
done
- test -z "$LD" && LD="$ac_prog"
+ test -z "$LD" && LD=$ac_prog
;;
"")
# If it fails, then pretend we aren't using GCC.
@@ -3086,7 +3307,7 @@
with_gnu_ld=unknown
;;
esac
-elif test "$with_gnu_ld" = yes; then
+elif test yes = "$with_gnu_ld"; then
AC_MSG_CHECKING([for GNU ld])
else
AC_MSG_CHECKING([for non-GNU ld])
@@ -3093,30 +3314,30 @@
fi
AC_CACHE_VAL(lt_cv_path_LD,
[if test -z "$LD"; then
- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
for ac_dir in $PATH; do
- IFS="$lt_save_ifs"
+ IFS=$lt_save_ifs
test -z "$ac_dir" && ac_dir=.
if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
- lt_cv_path_LD="$ac_dir/$ac_prog"
+ lt_cv_path_LD=$ac_dir/$ac_prog
# Check to see if the program is GNU ld. I'd rather use --version,
# but apparently some variants of GNU ld only accept -v.
# Break only if it was the GNU/non-GNU ld that we prefer.
case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
*GNU* | *'with BFD'*)
- test "$with_gnu_ld" != no && break
+ test no != "$with_gnu_ld" && break
;;
*)
- test "$with_gnu_ld" != yes && break
+ test yes != "$with_gnu_ld" && break
;;
esac
fi
done
- IFS="$lt_save_ifs"
+ IFS=$lt_save_ifs
else
- lt_cv_path_LD="$LD" # Let the user override the test with a path.
+ lt_cv_path_LD=$LD # Let the user override the test with a path.
fi])
-LD="$lt_cv_path_LD"
+LD=$lt_cv_path_LD
if test -n "$LD"; then
AC_MSG_RESULT($LD)
else
@@ -3170,13 +3391,13 @@
reload_cmds='$LD$reload_flag -o $output$reload_objs'
case $host_os in
cygwin* | mingw* | pw32* | cegcc*)
- if test "$GCC" != yes; then
+ if test yes != "$GCC"; then
reload_cmds=false
fi
;;
darwin*)
- if test "$GCC" = yes; then
- reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
+ if test yes = "$GCC"; then
+ reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs'
else
reload_cmds='$LD$reload_flag -o $output$reload_objs'
fi
@@ -3187,6 +3408,43 @@
])# _LT_CMD_RELOAD
+# _LT_PATH_DD
+# -----------
+# find a working dd
+m4_defun([_LT_PATH_DD],
+[AC_CACHE_CHECK([for a working dd], [ac_cv_path_lt_DD],
+[printf 0123456789abcdef0123456789abcdef >conftest.i
+cat conftest.i conftest.i >conftest2.i
+: ${lt_DD:=$DD}
+AC_PATH_PROGS_FEATURE_CHECK([lt_DD], [dd],
+[if "$ac_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
+ cmp -s conftest.i conftest.out \
+ && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=:
+fi])
+rm -f conftest.i conftest2.i conftest.out])
+])# _LT_PATH_DD
+
+
+# _LT_CMD_TRUNCATE
+# ----------------
+# find command to truncate a binary pipe
+m4_defun([_LT_CMD_TRUNCATE],
+[m4_require([_LT_PATH_DD])
+AC_CACHE_CHECK([how to truncate binary pipes], [lt_cv_truncate_bin],
+[printf 0123456789abcdef0123456789abcdef >conftest.i
+cat conftest.i conftest.i >conftest2.i
+lt_cv_truncate_bin=
+if "$ac_cv_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
+ cmp -s conftest.i conftest.out \
+ && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1"
+fi
+rm -f conftest.i conftest2.i conftest.out
+test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"])
+_LT_DECL([lt_truncate_bin], [lt_cv_truncate_bin], [1],
+ [Command to truncate a binary pipe])
+])# _LT_CMD_TRUNCATE
+
+
# _LT_CHECK_MAGIC_METHOD
# ----------------------
# how to check for library dependencies
@@ -3202,13 +3460,13 @@
# Need to set the preceding variable on all platforms that support
# interlibrary dependencies.
# 'none' -- dependencies not supported.
-# `unknown' -- same as none, but documents that we really don't know.
+# 'unknown' -- same as none, but documents that we really don't know.
# 'pass_all' -- all dependencies passed with no checks.
# 'test_compile' -- check by making test program.
# 'file_magic [[regex]]' -- check by looking for files in library path
-# which responds to the $file_magic_cmd with a given extended regex.
-# If you have `file' or equivalent on your system and you're not sure
-# whether `pass_all' will *always* work, you probably want this one.
+# that responds to the $file_magic_cmd with a given extended regex.
+# If you have 'file' or equivalent on your system and you're not sure
+# whether 'pass_all' will *always* work, you probably want this one.
case $host_os in
aix[[4-9]]*)
@@ -3235,8 +3493,7 @@
# Base MSYS/MinGW do not provide the 'file' command needed by
# func_win32_libid shell function, so use a weaker test based on 'objdump',
# unless we find 'file', for example because we are cross-compiling.
- # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
- if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
+ if ( file / ) >/dev/null 2>&1; then
lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
lt_cv_file_magic_cmd='func_win32_libid'
else
@@ -3332,8 +3589,8 @@
lt_cv_deplibs_check_method=pass_all
;;
-openbsd*)
- if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+openbsd* | bitrig*)
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
else
lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
@@ -3386,6 +3643,9 @@
tpf*)
lt_cv_deplibs_check_method=pass_all
;;
+os2*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
esac
])
@@ -3426,33 +3686,38 @@
AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
[if test -n "$NM"; then
# Let the user override the test.
- lt_cv_path_NM="$NM"
+ lt_cv_path_NM=$NM
else
- lt_nm_to_check="${ac_tool_prefix}nm"
+ lt_nm_to_check=${ac_tool_prefix}nm
if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
lt_nm_to_check="$lt_nm_to_check nm"
fi
for lt_tmp_nm in $lt_nm_to_check; do
- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
- IFS="$lt_save_ifs"
+ IFS=$lt_save_ifs
test -z "$ac_dir" && ac_dir=.
- tmp_nm="$ac_dir/$lt_tmp_nm"
- if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+ tmp_nm=$ac_dir/$lt_tmp_nm
+ if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then
# Check to see if the nm accepts a BSD-compat flag.
- # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+ # Adding the 'sed 1q' prevents false positives on HP-UX, which says:
# nm: unknown option "B" ignored
# Tru64's nm complains that /dev/null is an invalid object file
- case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
- */dev/null* | *'Invalid file or object type'*)
+ # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty
+ case $build_os in
+ mingw*) lt_bad_file=conftest.nm/nofile ;;
+ *) lt_bad_file=/dev/null ;;
+ esac
+ case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in
+ *$lt_bad_file* | *'Invalid file or object type'*)
lt_cv_path_NM="$tmp_nm -B"
- break
+ break 2
;;
*)
case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
*/dev/null*)
lt_cv_path_NM="$tmp_nm -p"
- break
+ break 2
;;
*)
lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
@@ -3463,12 +3728,12 @@
esac
fi
done
- IFS="$lt_save_ifs"
+ IFS=$lt_save_ifs
done
: ${lt_cv_path_NM=no}
fi])
-if test "$lt_cv_path_NM" != "no"; then
- NM="$lt_cv_path_NM"
+if test no != "$lt_cv_path_NM"; then
+ NM=$lt_cv_path_NM
else
# Didn't find any BSD compatible name lister, look for dumpbin.
if test -n "$DUMPBIN"; then :
@@ -3475,9 +3740,9 @@
# Let the user override the test.
else
AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
- case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
+ case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in
*COFF*)
- DUMPBIN="$DUMPBIN -symbols"
+ DUMPBIN="$DUMPBIN -symbols -headers"
;;
*)
DUMPBIN=:
@@ -3485,8 +3750,8 @@
esac
fi
AC_SUBST([DUMPBIN])
- if test "$DUMPBIN" != ":"; then
- NM="$DUMPBIN"
+ if test : != "$DUMPBIN"; then
+ NM=$DUMPBIN
fi
fi
test -z "$NM" && NM=nm
@@ -3532,8 +3797,8 @@
case $host_os in
cygwin* | mingw* | pw32* | cegcc*)
- # two different shell functions defined in ltmain.sh
- # decide which to use based on capabilities of $DLLTOOL
+ # two different shell functions defined in ltmain.sh;
+ # decide which one to use based on capabilities of $DLLTOOL
case `$DLLTOOL --help 2>&1` in
*--identify-strict*)
lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
@@ -3545,7 +3810,7 @@
;;
*)
# fallback: assume linklib IS sharedlib
- lt_cv_sharedlib_from_linklib_cmd="$ECHO"
+ lt_cv_sharedlib_from_linklib_cmd=$ECHO
;;
esac
])
@@ -3572,7 +3837,7 @@
lt_cv_path_mainfest_tool=yes
fi
rm -f conftest*])
-if test "x$lt_cv_path_mainfest_tool" != xyes; then
+if test yes != "$lt_cv_path_mainfest_tool"; then
MANIFEST_TOOL=:
fi
_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
@@ -3579,6 +3844,21 @@
])# _LT_PATH_MANIFEST_TOOL
+# _LT_DLL_DEF_P([FILE])
+# ---------------------
+# True iff FILE is a Windows DLL '.def' file.
+# Keep in sync with func_dll_def_p in the libtool script
+AC_DEFUN([_LT_DLL_DEF_P],
+[dnl
+ test DEF = "`$SED -n dnl
+ -e '\''s/^[[ ]]*//'\'' dnl Strip leading whitespace
+ -e '\''/^\(;.*\)*$/d'\'' dnl Delete empty lines and comments
+ -e '\''s/^\(EXPORTS\|LIBRARY\)\([[ ]].*\)*$/DEF/p'\'' dnl
+ -e q dnl Only consider the first "real" line
+ $1`" dnl
+])# _LT_DLL_DEF_P
+
+
# LT_LIB_M
# --------
# check for math library
@@ -3590,11 +3870,11 @@
# These system don't have libm, or don't need it
;;
*-ncr-sysv4.3*)
- AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
+ AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM=-lmw)
AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
;;
*)
- AC_CHECK_LIB(m, cos, LIBM="-lm")
+ AC_CHECK_LIB(m, cos, LIBM=-lm)
;;
esac
AC_SUBST([LIBM])
@@ -3613,7 +3893,7 @@
_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
-if test "$GCC" = yes; then
+if test yes = "$GCC"; then
case $cc_basename in
nvcc*)
_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
@@ -3665,7 +3945,7 @@
symcode='[[ABCDGISTW]]'
;;
hpux*)
- if test "$host_cpu" = ia64; then
+ if test ia64 = "$host_cpu"; then
symcode='[[ABCDEGRST]]'
fi
;;
@@ -3698,15 +3978,45 @@
symcode='[[ABCDGIRSTW]]' ;;
esac
+if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+ # Gets list of data symbols to import.
+ lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'"
+ # Adjust the below global symbol transforms to fixup imported variables.
+ lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'"
+ lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'"
+ lt_c_name_lib_hook="\
+ -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\
+ -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'"
+else
+ # Disable hooks by default.
+ lt_cv_sys_global_symbol_to_import=
+ lt_cdecl_hook=
+ lt_c_name_hook=
+ lt_c_name_lib_hook=
+fi
+
# Transform an extracted symbol line into a proper C declaration.
# Some systems (esp. on ia64) link data and code symbols differently,
# so use this general approach.
-lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+lt_cv_sys_global_symbol_to_cdecl="sed -n"\
+$lt_cdecl_hook\
+" -e 's/^T .* \(.*\)$/extern int \1();/p'"\
+" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'"
# Transform an extracted symbol line into symbol name and symbol address
-lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'"
-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'"
+lt_cv_sys_global_symbol_to_c_name_address="sed -n"\
+$lt_c_name_hook\
+" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\
+" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'"
+# Transform an extracted symbol line into symbol name with lib prefix and
+# symbol address.
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\
+$lt_c_name_lib_hook\
+" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\
+" -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\
+" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'"
+
# Handle CRLF in mingw tool chain
opt_cr=
case $build_os in
@@ -3723,8 +4033,8 @@
# Write the raw and C identifiers.
if test "$lt_cv_nm_interface" = "MS dumpbin"; then
- # Fake it for dumpbin and say T for any non-static function
- # and D for any global variable.
+ # Fake it for dumpbin and say T for any non-static function,
+ # D for any global variable and I for any imported variable.
# Also find C++ and __fastcall symbols from MSVC++,
# which start with @ or ?.
lt_cv_sys_global_symbol_pipe="$AWK ['"\
@@ -3731,13 +4041,16 @@
" {last_section=section; section=\$ 3};"\
" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
+" /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\
+" /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\
+" /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\
" \$ 0!~/External *\|/{next};"\
" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
" {if(hide[section]) next};"\
-" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
-" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
-" s[1]~/^[@?]/{print s[1], s[1]; next};"\
-" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
+" {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\
+" {split(\$ 0,a,/\||\r/); split(a[2],s)};"\
+" s[1]~/^[@?]/{print f,s[1],s[1]; next};"\
+" s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\
" ' prfx=^$ac_symprfx]"
else
lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
@@ -3777,11 +4090,11 @@
if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
cat <<_LT_EOF > conftest.$ac_ext
/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
-#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
-/* DATA imports from DLLs on WIN32 con't be const, because runtime
+#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
+/* DATA imports from DLLs on WIN32 can't be const, because runtime
relocations are performed -- see ld's documentation on pseudo-relocs. */
# define LT@&t at _DLSYM_CONST
-#elif defined(__osf__)
+#elif defined __osf__
/* This system does not cope well with relocations in const data. */
# define LT@&t at _DLSYM_CONST
#else
@@ -3807,7 +4120,7 @@
{
{ "@PROGRAM@", (void *) 0 },
_LT_EOF
- $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
+ $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
cat <<\_LT_EOF >> conftest.$ac_ext
{0, (void *) 0}
};
@@ -3827,9 +4140,9 @@
mv conftest.$ac_objext conftstm.$ac_objext
lt_globsym_save_LIBS=$LIBS
lt_globsym_save_CFLAGS=$CFLAGS
- LIBS="conftstm.$ac_objext"
+ LIBS=conftstm.$ac_objext
CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
- if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
+ if AC_TRY_EVAL(ac_link) && test -s conftest$ac_exeext; then
pipe_works=yes
fi
LIBS=$lt_globsym_save_LIBS
@@ -3850,7 +4163,7 @@
rm -rf conftest* conftst*
# Do not use the global_symbol_pipe unless it works.
- if test "$pipe_works" = yes; then
+ if test yes = "$pipe_works"; then
break
else
lt_cv_sys_global_symbol_pipe=
@@ -3877,6 +4190,8 @@
[Take the output of nm and produce a listing of raw symbols and C names])
_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
[Transform the output of nm in a proper C declaration])
+_LT_DECL([global_symbol_to_import], [lt_cv_sys_global_symbol_to_import], [1],
+ [Transform the output of nm into a list of symbols to manually relocate])
_LT_DECL([global_symbol_to_c_name_address],
[lt_cv_sys_global_symbol_to_c_name_address], [1],
[Transform the output of nm in a C name address pair])
@@ -3883,6 +4198,8 @@
_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
[lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
[Transform the output of nm in a C name address pair when lib prefix is needed])
+_LT_DECL([nm_interface], [lt_cv_nm_interface], [1],
+ [The name lister interface])
_LT_DECL([], [nm_file_list_spec], [1],
[Specify filename containing input files for $NM])
]) # _LT_CMD_GLOBAL_SYMBOLS
@@ -3898,7 +4215,7 @@
m4_if([$1], [CXX], [
# C++ specific cases for pic, static, wl, etc.
- if test "$GXX" = yes; then
+ if test yes = "$GXX"; then
_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
@@ -3905,10 +4222,11 @@
case $host_os in
aix*)
# All AIX code is PIC.
- if test "$host_cpu" = ia64; then
+ if test ia64 = "$host_cpu"; then
# AIX 5 now supports IA64 processor
_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
fi
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
;;
amigaos*)
@@ -3919,8 +4237,8 @@
;;
m68k)
# FIXME: we need at least 68020 code to build shared libraries, but
- # adding the `-m68020' flag to GCC prevents building anything better,
- # like `-m68040'.
+ # adding the '-m68020' flag to GCC prevents building anything better,
+ # like '-m68040'.
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
;;
esac
@@ -3936,6 +4254,11 @@
# (--disable-auto-import) libraries
m4_if([$1], [GCJ], [],
[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+ case $host_os in
+ os2*)
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
+ ;;
+ esac
;;
darwin* | rhapsody*)
# PIC is the default on this platform
@@ -3985,7 +4308,7 @@
case $host_os in
aix[[4-9]]*)
# All AIX code is PIC.
- if test "$host_cpu" = ia64; then
+ if test ia64 = "$host_cpu"; then
# AIX 5 now supports IA64 processor
_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
else
@@ -4026,14 +4349,14 @@
case $cc_basename in
CC*)
_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
- if test "$host_cpu" != ia64; then
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
+ if test ia64 != "$host_cpu"; then
_LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
fi
;;
aCC*)
_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
case $host_cpu in
hppa*64*|ia64*)
# +Z the default
@@ -4070,7 +4393,7 @@
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
;;
ecpc* )
- # old Intel C++ for x86_64 which still supported -KPIC.
+ # old Intel C++ for x86_64, which still supported -KPIC.
_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
@@ -4215,7 +4538,7 @@
fi
],
[
- if test "$GCC" = yes; then
+ if test yes = "$GCC"; then
_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
_LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
@@ -4222,10 +4545,11 @@
case $host_os in
aix*)
# All AIX code is PIC.
- if test "$host_cpu" = ia64; then
+ if test ia64 = "$host_cpu"; then
# AIX 5 now supports IA64 processor
_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
fi
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
;;
amigaos*)
@@ -4236,8 +4560,8 @@
;;
m68k)
# FIXME: we need at least 68020 code to build shared libraries, but
- # adding the `-m68020' flag to GCC prevents building anything better,
- # like `-m68040'.
+ # adding the '-m68020' flag to GCC prevents building anything better,
+ # like '-m68040'.
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
;;
esac
@@ -4254,6 +4578,11 @@
# (--disable-auto-import) libraries
m4_if([$1], [GCJ], [],
[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+ case $host_os in
+ os2*)
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
+ ;;
+ esac
;;
darwin* | rhapsody*)
@@ -4324,7 +4653,7 @@
case $host_os in
aix*)
_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
- if test "$host_cpu" = ia64; then
+ if test ia64 = "$host_cpu"; then
# AIX 5 now supports IA64 processor
_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
else
@@ -4332,11 +4661,30 @@
fi
;;
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+ case $cc_basename in
+ nagfor*)
+ # NAG Fortran compiler
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
+ esac
+ ;;
+
mingw* | cygwin* | pw32* | os2* | cegcc*)
# This hack is so that the source file can tell whether it is being
# built for inclusion in a dll (and should export symbols for example).
m4_if([$1], [GCJ], [],
[_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+ case $host_os in
+ os2*)
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-static'
+ ;;
+ esac
;;
hpux9* | hpux10* | hpux11*)
@@ -4352,7 +4700,7 @@
;;
esac
# Is there a better lt_prog_compiler_static that works with the bundled CC?
- _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='$wl-a ${wl}archive'
;;
irix5* | irix6* | nonstopux*)
@@ -4363,7 +4711,7 @@
linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
case $cc_basename in
- # old Intel for x86_64 which still supported -KPIC.
+ # old Intel for x86_64, which still supported -KPIC.
ecc*)
_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
@@ -4388,6 +4736,12 @@
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
;;
+ tcc*)
+ # Fabrice Bellard et al's Tiny C Compiler
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
# Portland Group compilers (*not* the Pentium gcc compiler,
# which looks to be a dead project)
@@ -4485,7 +4839,7 @@
;;
sysv4*MP*)
- if test -d /usr/nec ;then
+ if test -d /usr/nec; then
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
fi
@@ -4514,7 +4868,7 @@
fi
])
case $host_os in
- # For platforms which do not support PIC, -DPIC is meaningless:
+ # For platforms that do not support PIC, -DPIC is meaningless:
*djgpp*)
_LT_TAGVAR(lt_prog_compiler_pic, $1)=
;;
@@ -4580,17 +4934,21 @@
case $host_os in
aix[[4-9]]*)
# If we're using GNU nm, then we don't want the "-C" option.
- # -C means demangle to AIX nm, but means don't demangle with GNU nm
- # Also, AIX nm treats weak defined symbols like other global defined
- # symbols, whereas GNU nm marks them as "W".
+ # -C means demangle to GNU nm, but means don't demangle to AIX nm.
+ # Without the "-l" option, or with the "-B" option, AIX nm treats
+ # weak defined symbols like other global defined symbols, whereas
+ # GNU nm marks them as "W".
+ # While the 'weak' keyword is ignored in the Export File, we need
+ # it in the Import File for the 'aix-soname' feature, so we have
+ # to replace the "-B" option with "-P" for AIX nm.
if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
- _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
else
- _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
fi
;;
pw32*)
- _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
+ _LT_TAGVAR(export_symbols_cmds, $1)=$ltdll_cmds
;;
cygwin* | mingw* | cegcc*)
case $cc_basename in
@@ -4639,9 +4997,9 @@
# included in the symbol list
_LT_TAGVAR(include_expsyms, $1)=
# exclude_expsyms can be an extended regexp of symbols to exclude
- # it will be wrapped by ` (' and `)$', so one must not match beginning or
- # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
- # as well as any symbol that contains `d'.
+ # it will be wrapped by ' (' and ')$', so one must not match beginning or
+ # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc',
+ # as well as any symbol that contains 'd'.
_LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
# Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
# platforms (ab)use it in PIC code, but their linkers get confused if
@@ -4657,7 +5015,7 @@
# FIXME: the MSVC++ port hasn't been tested in a loooong time
# When not using gcc, we currently assume that we are using
# Microsoft Visual C++.
- if test "$GCC" != yes; then
+ if test yes != "$GCC"; then
with_gnu_ld=no
fi
;;
@@ -4665,7 +5023,7 @@
# we just hope/assume this is gcc and not c89 (= MSVC++)
with_gnu_ld=yes
;;
- openbsd*)
+ openbsd* | bitrig*)
with_gnu_ld=no
;;
linux* | k*bsd*-gnu | gnu*)
@@ -4678,7 +5036,7 @@
# On some targets, GNU ld is compatible enough with the native linker
# that we're better off using the native interface for both.
lt_use_gnu_ld_interface=no
- if test "$with_gnu_ld" = yes; then
+ if test yes = "$with_gnu_ld"; then
case $host_os in
aix*)
# The AIX port of GNU ld has always aspired to compatibility
@@ -4700,24 +5058,24 @@
esac
fi
- if test "$lt_use_gnu_ld_interface" = yes; then
+ if test yes = "$lt_use_gnu_ld_interface"; then
# If archive_cmds runs LD, not CC, wlarc should be empty
- wlarc='${wl}'
+ wlarc='$wl'
# Set some defaults for GNU ld with shared library support. These
# are reset later if shared libraries are not supported. Putting them
# here allows them to be overridden if necessary.
runpath_var=LD_RUN_PATH
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
# ancient GNU ld didn't support --whole-archive et. al.
if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
- _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
else
_LT_TAGVAR(whole_archive_flag_spec, $1)=
fi
supports_anon_versioning=no
- case `$LD -v 2>&1` in
+ case `$LD -v | $SED -e 's/([^)]\+)\s\+//' 2>&1` in
*GNU\ gold*) supports_anon_versioning=yes ;;
*\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
*\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
@@ -4730,7 +5088,7 @@
case $host_os in
aix[[3-9]]*)
# On AIX/PPC, the GNU linker is very broken
- if test "$host_cpu" != ia64; then
+ if test ia64 != "$host_cpu"; then
_LT_TAGVAR(ld_shlibs, $1)=no
cat <<_LT_EOF 1>&2
@@ -4749,7 +5107,7 @@
case $host_cpu in
powerpc)
# see comment about AmigaOS4 .so support
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
_LT_TAGVAR(archive_expsym_cmds, $1)=''
;;
m68k)
@@ -4765,7 +5123,7 @@
_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
# Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
# support --undefined. This deserves some investigation. FIXME
- _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
else
_LT_TAGVAR(ld_shlibs, $1)=no
fi
@@ -4775,7 +5133,7 @@
# _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
# as there is no search path for DLLs.
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols'
_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
_LT_TAGVAR(always_export_symbols, $1)=no
_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
@@ -4783,16 +5141,16 @@
_LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
- # If the export-symbols file already is a .def file (1st line
- # is EXPORTS), use it as is; otherwise, prepend...
- _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
- cp $export_symbols $output_objdir/$soname.def;
- else
- echo EXPORTS > $output_objdir/$soname.def;
- cat $export_symbols >> $output_objdir/$soname.def;
- fi~
- $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ # If the export-symbols file already is a .def file, use it as
+ # is; otherwise, prepend EXPORTS...
+ _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
+ cp $export_symbols $output_objdir/$soname.def;
+ else
+ echo EXPORTS > $output_objdir/$soname.def;
+ cat $export_symbols >> $output_objdir/$soname.def;
+ fi~
+ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
else
_LT_TAGVAR(ld_shlibs, $1)=no
fi
@@ -4799,15 +5157,43 @@
;;
haiku*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
_LT_TAGVAR(link_all_deplibs, $1)=yes
;;
+ os2*)
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ shrext_cmds=.dll
+ _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+ $ECHO EXPORTS >> $output_objdir/$libname.def~
+ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
+ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+ emximp -o $lib $output_objdir/$libname.def'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+ $ECHO EXPORTS >> $output_objdir/$libname.def~
+ prefix_cmds="$SED"~
+ if test EXPORTS = "`$SED 1q $export_symbols`"; then
+ prefix_cmds="$prefix_cmds -e 1d";
+ fi~
+ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
+ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
+ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+ emximp -o $lib $output_objdir/$libname.def'
+ _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ ;;
+
interix[[3-9]]*)
_LT_TAGVAR(hardcode_direct, $1)=no
_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
# Instead, shared libraries are loaded at an image base (0x10000000 by
# default) and relocated if they conflict, which is a slow very memory
@@ -4814,30 +5200,30 @@
# consuming and fragmenting process. To avoid this, we pick a random,
# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
# time. Moving up from 0x10000000 also allows more sbrk(2) space.
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
;;
gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
tmp_diet=no
- if test "$host_os" = linux-dietlibc; then
+ if test linux-dietlibc = "$host_os"; then
case $cc_basename in
diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn)
esac
fi
if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
- && test "$tmp_diet" = no
+ && test no = "$tmp_diet"
then
tmp_addflag=' $pic_flag'
tmp_sharedflag='-shared'
case $cc_basename,$host_cpu in
pgcc*) # Portland Group C compiler
- _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
tmp_addflag=' $pic_flag'
;;
pgf77* | pgf90* | pgf95* | pgfortran*)
# Portland Group f77 and f90 compilers
- _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
tmp_addflag=' $pic_flag -Mnomain' ;;
ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
tmp_addflag=' -i_dynamic' ;;
@@ -4848,42 +5234,47 @@
lf95*) # Lahey Fortran 8.1
_LT_TAGVAR(whole_archive_flag_spec, $1)=
tmp_sharedflag='--shared' ;;
+ nagfor*) # NAGFOR 5.3
+ tmp_sharedflag='-Wl,-shared' ;;
xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
tmp_sharedflag='-qmkshrobj'
tmp_addflag= ;;
nvcc*) # Cuda Compiler Driver 2.2
- _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
_LT_TAGVAR(compiler_needs_object, $1)=yes
;;
esac
case `$CC -V 2>&1 | sed 5q` in
*Sun\ C*) # Sun C 5.9
- _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
_LT_TAGVAR(compiler_needs_object, $1)=yes
tmp_sharedflag='-G' ;;
*Sun\ F*) # Sun Fortran 8.3
tmp_sharedflag='-G' ;;
esac
- _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
- if test "x$supports_anon_versioning" = xyes; then
+ if test yes = "$supports_anon_versioning"; then
_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
- cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
- echo "local: *; };" >> $output_objdir/$libname.ver~
- $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
fi
case $cc_basename in
+ tcc*)
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='-rdynamic'
+ ;;
xlf* | bgf* | bgxlf* | mpixlf*)
# IBM XL Fortran 10.1 on PPC cannot create shared libs itself
_LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
_LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
- if test "x$supports_anon_versioning" = xyes; then
+ if test yes = "$supports_anon_versioning"; then
_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
- cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
- echo "local: *; };" >> $output_objdir/$libname.ver~
- $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
fi
;;
esac
@@ -4897,8 +5288,8 @@
_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
wlarc=
else
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
fi
;;
@@ -4916,8 +5307,8 @@
_LT_EOF
elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
else
_LT_TAGVAR(ld_shlibs, $1)=no
fi
@@ -4929,7 +5320,7 @@
_LT_TAGVAR(ld_shlibs, $1)=no
cat <<_LT_EOF 1>&2
-*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot
*** reliably create shared libraries on SCO systems. Therefore, libtool
*** is disabling shared libraries support. We urge you to upgrade GNU
*** binutils to release 2.16.91.0.3 or newer. Another option is to modify
@@ -4944,9 +5335,9 @@
# DT_RUNPATH tag from executables and libraries. But doing so
# requires that you compile everything twice, which is a pain.
if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
else
_LT_TAGVAR(ld_shlibs, $1)=no
fi
@@ -4963,8 +5354,8 @@
*)
if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
else
_LT_TAGVAR(ld_shlibs, $1)=no
fi
@@ -4971,7 +5362,7 @@
;;
esac
- if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
+ if test no = "$_LT_TAGVAR(ld_shlibs, $1)"; then
runpath_var=
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
_LT_TAGVAR(export_dynamic_flag_spec, $1)=
@@ -4987,7 +5378,7 @@
# Note: this linker hardcodes the directories in LIBPATH if there
# are no directories specified by -L.
_LT_TAGVAR(hardcode_minus_L, $1)=yes
- if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
+ if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then
# Neither direct hardcoding nor static linking is supported with a
# broken collect2.
_LT_TAGVAR(hardcode_direct, $1)=unsupported
@@ -4995,34 +5386,57 @@
;;
aix[[4-9]]*)
- if test "$host_cpu" = ia64; then
+ if test ia64 = "$host_cpu"; then
# On IA64, the linker does run time linking by default, so we don't
# have to do anything special.
aix_use_runtimelinking=no
exp_sym_flag='-Bexport'
- no_entry_flag=""
+ no_entry_flag=
else
# If we're using GNU nm, then we don't want the "-C" option.
- # -C means demangle to AIX nm, but means don't demangle with GNU nm
- # Also, AIX nm treats weak defined symbols like other global
- # defined symbols, whereas GNU nm marks them as "W".
+ # -C means demangle to GNU nm, but means don't demangle to AIX nm.
+ # Without the "-l" option, or with the "-B" option, AIX nm treats
+ # weak defined symbols like other global defined symbols, whereas
+ # GNU nm marks them as "W".
+ # While the 'weak' keyword is ignored in the Export File, we need
+ # it in the Import File for the 'aix-soname' feature, so we have
+ # to replace the "-B" option with "-P" for AIX nm.
if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
- _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
else
- _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ _LT_TAGVAR(export_symbols_cmds, $1)='`func_echo_all $NM | $SED -e '\''s/B\([[^B]]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && ([substr](\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
fi
aix_use_runtimelinking=no
# Test if we are trying to use run time linking or normal
# AIX style linking. If -brtl is somewhere in LDFLAGS, we
- # need to do runtime linking.
+ # have runtime linking enabled, and use it for executables.
+ # For shared libraries, we enable/disable runtime linking
+ # depending on the kind of the shared library created -
+ # when "with_aix_soname,aix_use_runtimelinking" is:
+ # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables
+ # "aix,yes" lib.so shared, rtl:yes, for executables
+ # lib.a static archive
+ # "both,no" lib.so.V(shr.o) shared, rtl:yes
+ # lib.a(lib.so.V) shared, rtl:no, for executables
+ # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
+ # lib.a(lib.so.V) shared, rtl:no
+ # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables
+ # lib.a static archive
case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
for ld_flag in $LDFLAGS; do
- if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+ if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then
aix_use_runtimelinking=yes
break
fi
done
+ if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
+ # With aix-soname=svr4, we create the lib.so.V shared archives only,
+ # so we don't have lib.a shared libs to link our executables.
+ # We have to force runtime linking in this case.
+ aix_use_runtimelinking=yes
+ LDFLAGS="$LDFLAGS -Wl,-brtl"
+ fi
;;
esac
@@ -5041,13 +5455,21 @@
_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
_LT_TAGVAR(hardcode_libdir_separator, $1)=':'
_LT_TAGVAR(link_all_deplibs, $1)=yes
- _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
+ _LT_TAGVAR(file_list_spec, $1)='$wl-f,'
+ case $with_aix_soname,$aix_use_runtimelinking in
+ aix,*) ;; # traditional, no import file
+ svr4,* | *,yes) # use import file
+ # The Import File defines what to hardcode.
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=no
+ ;;
+ esac
- if test "$GCC" = yes; then
+ if test yes = "$GCC"; then
case $host_os in aix4.[[012]]|aix4.[[012]].*)
# We only want to do this on AIX 4.2 and lower, the check
# below for broken collect2 doesn't work under 4.3+
- collect2name=`${CC} -print-prog-name=collect2`
+ collect2name=`$CC -print-prog-name=collect2`
if test -f "$collect2name" &&
strings "$collect2name" | $GREP resolve_lib_name >/dev/null
then
@@ -5066,30 +5488,36 @@
;;
esac
shared_flag='-shared'
- if test "$aix_use_runtimelinking" = yes; then
- shared_flag="$shared_flag "'${wl}-G'
+ if test yes = "$aix_use_runtimelinking"; then
+ shared_flag="$shared_flag "'$wl-G'
fi
- _LT_TAGVAR(link_all_deplibs, $1)=no
+ # Need to ensure runtime linking is disabled for the traditional
+ # shared library, or the linker may eventually find shared libraries
+ # /with/ Import File - we do not want to mix them.
+ shared_flag_aix='-shared'
+ shared_flag_svr4='-shared $wl-G'
else
# not using gcc
- if test "$host_cpu" = ia64; then
+ if test ia64 = "$host_cpu"; then
# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
# chokes on -Wl,-G. The following line is correct:
shared_flag='-G'
else
- if test "$aix_use_runtimelinking" = yes; then
- shared_flag='${wl}-G'
+ if test yes = "$aix_use_runtimelinking"; then
+ shared_flag='$wl-G'
else
- shared_flag='${wl}-bM:SRE'
+ shared_flag='$wl-bM:SRE'
fi
+ shared_flag_aix='$wl-bM:SRE'
+ shared_flag_svr4='$wl-G'
fi
fi
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall'
# It seems that -bexpall does not export symbols beginning with
# underscore (_), so it is better to generate a list of symbols to export.
_LT_TAGVAR(always_export_symbols, $1)=yes
- if test "$aix_use_runtimelinking" = yes; then
+ if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then
# Warning - without using the other runtime loading flags (-brtl),
# -berok will link without error, but may produce a broken library.
_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
@@ -5096,32 +5524,44 @@
# Determine the default libpath from the value encoded in an
# empty executable.
_LT_SYS_MODULE_PATH_AIX([$1])
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag
else
- if test "$host_cpu" = ia64; then
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+ if test ia64 = "$host_cpu"; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib'
_LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
- _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+ _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols"
else
# Determine the default libpath from the value encoded in an
# empty executable.
_LT_SYS_MODULE_PATH_AIX([$1])
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
# Warning - without using the other run time loading flags,
# -berok will link without error, but may produce a broken library.
- _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
- _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
- if test "$with_gnu_ld" = yes; then
+ _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok'
+ _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok'
+ if test yes = "$with_gnu_ld"; then
# We only use this code for GNU lds that support --whole-archive.
- _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
else
# Exported symbols can be pulled into shared objects from archives
_LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
fi
_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
- # This is similar to how AIX traditionally builds its shared libraries.
- _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
+ # -brtl affects multiple linker settings, -berok does not and is overridden later
+ compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`'
+ if test svr4 != "$with_aix_soname"; then
+ # This is similar to how AIX traditionally builds its shared libraries.
+ _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname'
+ fi
+ if test aix != "$with_aix_soname"; then
+ _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp'
+ else
+ # used by -dlpreopen to get the symbols
+ _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir'
+ fi
+ _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d'
fi
fi
;;
@@ -5130,7 +5570,7 @@
case $host_cpu in
powerpc)
# see comment about AmigaOS4 .so support
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
_LT_TAGVAR(archive_expsym_cmds, $1)=''
;;
m68k)
@@ -5160,16 +5600,17 @@
# Tell ltmain to make .lib files, not .a files.
libext=lib
# Tell ltmain to make .dll files, not .so files.
- shrext_cmds=".dll"
+ shrext_cmds=.dll
# FIXME: Setting linknames here is a bad hack.
- _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
- _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
- sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
- else
- sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
- fi~
- $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
- linknames='
+ _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
+ _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
+ cp "$export_symbols" "$output_objdir/$soname.def";
+ echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
+ else
+ $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
+ fi~
+ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+ linknames='
# The linker will not automatically build a static lib if we build a DLL.
# _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
@@ -5178,18 +5619,18 @@
# Don't use ranlib
_LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
_LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
- lt_tool_outputfile="@TOOL_OUTPUT@"~
- case $lt_outputfile in
- *.exe|*.EXE) ;;
- *)
- lt_outputfile="$lt_outputfile.exe"
- lt_tool_outputfile="$lt_tool_outputfile.exe"
- ;;
- esac~
- if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
- $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
- $RM "$lt_outputfile.manifest";
- fi'
+ lt_tool_outputfile="@TOOL_OUTPUT@"~
+ case $lt_outputfile in
+ *.exe|*.EXE) ;;
+ *)
+ lt_outputfile=$lt_outputfile.exe
+ lt_tool_outputfile=$lt_tool_outputfile.exe
+ ;;
+ esac~
+ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
+ $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+ $RM "$lt_outputfile.manifest";
+ fi'
;;
*)
# Assume MSVC wrapper
@@ -5198,7 +5639,7 @@
# Tell ltmain to make .lib files, not .a files.
libext=lib
# Tell ltmain to make .dll files, not .so files.
- shrext_cmds=".dll"
+ shrext_cmds=.dll
# FIXME: Setting linknames here is a bad hack.
_LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
# The linker will automatically build a .lib file if we build a DLL.
@@ -5248,12 +5689,12 @@
;;
hpux9*)
- if test "$GCC" = yes; then
- _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ if test yes = "$GCC"; then
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
else
- _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
fi
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
_LT_TAGVAR(hardcode_libdir_separator, $1)=:
_LT_TAGVAR(hardcode_direct, $1)=yes
@@ -5260,21 +5701,21 @@
# hardcode_minus_L: Not really in the search PATH,
# but as the default location of the library.
_LT_TAGVAR(hardcode_minus_L, $1)=yes
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
;;
hpux10*)
- if test "$GCC" = yes && test "$with_gnu_ld" = no; then
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ if test yes,no = "$GCC,$with_gnu_ld"; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
else
_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
fi
- if test "$with_gnu_ld" = no; then
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ if test no = "$with_gnu_ld"; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
_LT_TAGVAR(hardcode_libdir_separator, $1)=:
_LT_TAGVAR(hardcode_direct, $1)=yes
_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
# hardcode_minus_L: Not really in the search PATH,
# but as the default location of the library.
_LT_TAGVAR(hardcode_minus_L, $1)=yes
@@ -5282,25 +5723,25 @@
;;
hpux11*)
- if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+ if test yes,no = "$GCC,$with_gnu_ld"; then
case $host_cpu in
hppa*64*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
;;
ia64*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
;;
*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
;;
esac
else
case $host_cpu in
hppa*64*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
;;
ia64*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
;;
*)
m4_if($1, [], [
@@ -5308,14 +5749,14 @@
# (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
_LT_LINKER_OPTION([if $CC understands -b],
_LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
- [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
+ [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
[_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
- [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
+ [_LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
;;
esac
fi
- if test "$with_gnu_ld" = no; then
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ if test no = "$with_gnu_ld"; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
_LT_TAGVAR(hardcode_libdir_separator, $1)=:
case $host_cpu in
@@ -5326,7 +5767,7 @@
*)
_LT_TAGVAR(hardcode_direct, $1)=yes
_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
# hardcode_minus_L: Not really in the search PATH,
# but as the default location of the library.
@@ -5337,8 +5778,8 @@
;;
irix5* | irix6* | nonstopux*)
- if test "$GCC" = yes; then
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ if test yes = "$GCC"; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
# Try to use the -exported_symbol ld option, if it does not
# work, assume that -exports_file does not work either and
# implicitly export all symbols.
@@ -5345,8 +5786,8 @@
# This should be the same for all languages, so no per-tag cache variable.
AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
[lt_cv_irix_exported_symbol],
- [save_LDFLAGS="$LDFLAGS"
- LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
+ [save_LDFLAGS=$LDFLAGS
+ LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null"
AC_LINK_IFELSE(
[AC_LANG_SOURCE(
[AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
@@ -5359,21 +5800,32 @@
end]])])],
[lt_cv_irix_exported_symbol=yes],
[lt_cv_irix_exported_symbol=no])
- LDFLAGS="$save_LDFLAGS"])
- if test "$lt_cv_irix_exported_symbol" = yes; then
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
+ LDFLAGS=$save_LDFLAGS])
+ if test yes = "$lt_cv_irix_exported_symbol"; then
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib'
fi
+ _LT_TAGVAR(link_all_deplibs, $1)=no
else
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib'
fi
_LT_TAGVAR(archive_cmds_need_lc, $1)='no'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
_LT_TAGVAR(hardcode_libdir_separator, $1)=:
_LT_TAGVAR(inherit_rpath, $1)=yes
_LT_TAGVAR(link_all_deplibs, $1)=yes
;;
+ linux*)
+ case $cc_basename in
+ tcc*)
+ # Fabrice Bellard et al's Tiny C Compiler
+ _LT_TAGVAR(ld_shlibs, $1)=yes
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ ;;
+
netbsd* | netbsdelf*-gnu)
if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
@@ -5388,7 +5840,7 @@
newsos6)
_LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
_LT_TAGVAR(hardcode_direct, $1)=yes
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
_LT_TAGVAR(hardcode_libdir_separator, $1)=:
_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
;;
@@ -5396,27 +5848,19 @@
*nto* | *qnx*)
;;
- openbsd*)
+ openbsd* | bitrig*)
if test -f /usr/libexec/ld.so; then
_LT_TAGVAR(hardcode_direct, $1)=yes
_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
- if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
else
- case $host_os in
- openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
- _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
- ;;
- *)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
- ;;
- esac
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
fi
else
_LT_TAGVAR(ld_shlibs, $1)=no
@@ -5427,33 +5871,53 @@
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
_LT_TAGVAR(hardcode_minus_L, $1)=yes
_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
- _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
- _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+ shrext_cmds=.dll
+ _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+ $ECHO EXPORTS >> $output_objdir/$libname.def~
+ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
+ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+ emximp -o $lib $output_objdir/$libname.def'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+ $ECHO EXPORTS >> $output_objdir/$libname.def~
+ prefix_cmds="$SED"~
+ if test EXPORTS = "`$SED 1q $export_symbols`"; then
+ prefix_cmds="$prefix_cmds -e 1d";
+ fi~
+ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
+ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
+ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+ emximp -o $lib $output_objdir/$libname.def'
+ _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
;;
osf3*)
- if test "$GCC" = yes; then
- _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ if test yes = "$GCC"; then
+ _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
else
_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
fi
_LT_TAGVAR(archive_cmds_need_lc, $1)='no'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
_LT_TAGVAR(hardcode_libdir_separator, $1)=:
;;
osf4* | osf5*) # as osf3* with the addition of -msym flag
- if test "$GCC" = yes; then
- _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ if test yes = "$GCC"; then
+ _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
else
_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
_LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
- $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
+ $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp'
# Both c and cxx compiler support -rpath directly
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
@@ -5464,24 +5928,24 @@
solaris*)
_LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
- if test "$GCC" = yes; then
- wlarc='${wl}'
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ if test yes = "$GCC"; then
+ wlarc='$wl'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
- $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+ $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
else
case `$CC -V 2>&1` in
*"Compilers 5.0"*)
wlarc=''
- _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ _LT_TAGVAR(archive_cmds, $1)='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags'
_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
- $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
+ $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
;;
*)
- wlarc='${wl}'
- _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
+ wlarc='$wl'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags'
_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
- $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+ $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
;;
esac
fi
@@ -5491,11 +5955,11 @@
solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
*)
# The compiler driver will combine and reorder linker options,
- # but understands `-z linker_flag'. GCC discards it without `$wl',
+ # but understands '-z linker_flag'. GCC discards it without '$wl',
# but is careful enough not to reorder.
# Supported since Solaris 2.6 (maybe 2.5.1?)
- if test "$GCC" = yes; then
- _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+ if test yes = "$GCC"; then
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
else
_LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
fi
@@ -5505,10 +5969,10 @@
;;
sunos4*)
- if test "x$host_vendor" = xsequent; then
+ if test sequent = "$host_vendor"; then
# Use $CC to link under sequent, because it throws in some extra .o
# files that make .init and .fini sections work.
- _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags'
else
_LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
fi
@@ -5557,43 +6021,43 @@
;;
sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
- _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+ _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
_LT_TAGVAR(archive_cmds_need_lc, $1)=no
_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
runpath_var='LD_RUN_PATH'
- if test "$GCC" = yes; then
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ if test yes = "$GCC"; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
else
- _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
fi
;;
sysv5* | sco3.2v5* | sco5v6*)
- # Note: We can NOT use -z defs as we might desire, because we do not
+ # Note: We CANNOT use -z defs as we might desire, because we do not
# link with -lc, and that would cause any symbols used from libc to
# always be unresolved, which means just about no library would
# ever link correctly. If we're not using GNU ld we use -z text
# though, which does catch some bad symbols but isn't as heavy-handed
# as -z defs.
- _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
- _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
+ _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
+ _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs'
_LT_TAGVAR(archive_cmds_need_lc, $1)=no
_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir'
_LT_TAGVAR(hardcode_libdir_separator, $1)=':'
_LT_TAGVAR(link_all_deplibs, $1)=yes
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport'
runpath_var='LD_RUN_PATH'
- if test "$GCC" = yes; then
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ if test yes = "$GCC"; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
else
- _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
fi
;;
@@ -5608,10 +6072,10 @@
;;
esac
- if test x$host_vendor = xsni; then
+ if test sni = "$host_vendor"; then
case $host in
sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Blargedynsym'
;;
esac
fi
@@ -5618,7 +6082,7 @@
fi
])
AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
-test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no
_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
@@ -5635,7 +6099,7 @@
# Assume -lc should be added
_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
- if test "$enable_shared" = yes && test "$GCC" = yes; then
+ if test yes,yes = "$GCC,$enable_shared"; then
case $_LT_TAGVAR(archive_cmds, $1) in
*'~'*)
# FIXME: we may have to deal with multi-command sequences.
@@ -5715,12 +6179,12 @@
_LT_TAGDECL([], [hardcode_libdir_separator], [1],
[Whether we need a single "-rpath" flag with a separated argument])
_LT_TAGDECL([], [hardcode_direct], [0],
- [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
+ [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
DIR into the resulting binary])
_LT_TAGDECL([], [hardcode_direct_absolute], [0],
- [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
+ [Set to "yes" if using DIR/libNAME$shared_ext during linking hardcodes
DIR into the resulting binary and the resulting library dependency is
- "absolute", i.e impossible to change by setting ${shlibpath_var} if the
+ "absolute", i.e impossible to change by setting $shlibpath_var if the
library is relocated])
_LT_TAGDECL([], [hardcode_minus_L], [0],
[Set to "yes" if using the -LDIR flag during linking hardcodes DIR
@@ -5761,10 +6225,10 @@
# ------------------------
# Ensure that the configuration variables for a C compiler are suitably
# defined. These variables are subsequently used by _LT_CONFIG to write
-# the compiler configuration to `libtool'.
+# the compiler configuration to 'libtool'.
m4_defun([_LT_LANG_C_CONFIG],
[m4_require([_LT_DECL_EGREP])dnl
-lt_save_CC="$CC"
+lt_save_CC=$CC
AC_LANG_PUSH(C)
# Source file extension for C test sources.
@@ -5800,18 +6264,18 @@
LT_SYS_DLOPEN_SELF
_LT_CMD_STRIPLIB
- # Report which library types will actually be built
+ # Report what library types will actually be built
AC_MSG_CHECKING([if libtool supports shared libraries])
AC_MSG_RESULT([$can_build_shared])
AC_MSG_CHECKING([whether to build shared libraries])
- test "$can_build_shared" = "no" && enable_shared=no
+ test no = "$can_build_shared" && enable_shared=no
# On AIX, shared libraries and static libraries use the same namespace, and
# are all built from PIC.
case $host_os in
aix3*)
- test "$enable_shared" = yes && enable_static=no
+ test yes = "$enable_shared" && enable_static=no
if test -n "$RANLIB"; then
archive_cmds="$archive_cmds~\$RANLIB \$lib"
postinstall_cmds='$RANLIB $lib'
@@ -5819,8 +6283,12 @@
;;
aix[[4-9]]*)
- if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
- test "$enable_shared" = yes && enable_static=no
+ if test ia64 != "$host_cpu"; then
+ case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
+ yes,aix,yes) ;; # shared object as lib.so file only
+ yes,svr4,*) ;; # shared object as lib.so archive member only
+ yes,*) enable_static=no ;; # shared object in lib.a archive as well
+ esac
fi
;;
esac
@@ -5828,13 +6296,13 @@
AC_MSG_CHECKING([whether to build static libraries])
# Make sure either enable_shared or enable_static is yes.
- test "$enable_shared" = yes || enable_static=yes
+ test yes = "$enable_shared" || enable_static=yes
AC_MSG_RESULT([$enable_static])
_LT_CONFIG($1)
fi
AC_LANG_POP
-CC="$lt_save_CC"
+CC=$lt_save_CC
])# _LT_LANG_C_CONFIG
@@ -5842,14 +6310,14 @@
# --------------------------
# Ensure that the configuration variables for a C++ compiler are suitably
# defined. These variables are subsequently used by _LT_CONFIG to write
-# the compiler configuration to `libtool'.
+# the compiler configuration to 'libtool'.
m4_defun([_LT_LANG_CXX_CONFIG],
[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
m4_require([_LT_DECL_EGREP])dnl
m4_require([_LT_PATH_MANIFEST_TOOL])dnl
-if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
- ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
- (test "X$CXX" != "Xg++"))) ; then
+if test -n "$CXX" && ( test no != "$CXX" &&
+ ( (test g++ = "$CXX" && `g++ -v >/dev/null 2>&1` ) ||
+ (test g++ != "$CXX"))); then
AC_PROG_CXXCPP
else
_lt_caught_CXX_error=yes
@@ -5891,7 +6359,7 @@
# the CXX compiler isn't working. Some variables (like enable_shared)
# are currently assumed to apply to all compilers on this platform,
# and will be corrupted by setting them based on a non-working compiler.
-if test "$_lt_caught_CXX_error" != yes; then
+if test yes != "$_lt_caught_CXX_error"; then
# Code to be used in simple compile tests
lt_simple_compile_test_code="int some_variable = 0;"
@@ -5933,13 +6401,13 @@
if test -n "$compiler"; then
# We don't want -fno-exception when compiling C++ code, so set the
# no_builtin_flag separately
- if test "$GXX" = yes; then
+ if test yes = "$GXX"; then
_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
else
_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
fi
- if test "$GXX" = yes; then
+ if test yes = "$GXX"; then
# Set up default GNU C++ configuration
LT_PATH_LD
@@ -5946,22 +6414,22 @@
# Check if GNU C++ uses GNU ld as the underlying linker, since the
# archiving commands below assume that GNU ld is being used.
- if test "$with_gnu_ld" = yes; then
- _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ if test yes = "$with_gnu_ld"; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
# If archive_cmds runs LD, not CC, wlarc should be empty
# XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
# investigate it a little bit more. (MM)
- wlarc='${wl}'
+ wlarc='$wl'
# ancient GNU ld didn't support --whole-archive et. al.
if eval "`$CC -print-prog-name=ld` --help 2>&1" |
$GREP 'no-whole-archive' > /dev/null; then
- _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
else
_LT_TAGVAR(whole_archive_flag_spec, $1)=
fi
@@ -5997,18 +6465,30 @@
_LT_TAGVAR(ld_shlibs, $1)=no
;;
aix[[4-9]]*)
- if test "$host_cpu" = ia64; then
+ if test ia64 = "$host_cpu"; then
# On IA64, the linker does run time linking by default, so we don't
# have to do anything special.
aix_use_runtimelinking=no
exp_sym_flag='-Bexport'
- no_entry_flag=""
+ no_entry_flag=
else
aix_use_runtimelinking=no
# Test if we are trying to use run time linking or normal
# AIX style linking. If -brtl is somewhere in LDFLAGS, we
- # need to do runtime linking.
+ # have runtime linking enabled, and use it for executables.
+ # For shared libraries, we enable/disable runtime linking
+ # depending on the kind of the shared library created -
+ # when "with_aix_soname,aix_use_runtimelinking" is:
+ # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables
+ # "aix,yes" lib.so shared, rtl:yes, for executables
+ # lib.a static archive
+ # "both,no" lib.so.V(shr.o) shared, rtl:yes
+ # lib.a(lib.so.V) shared, rtl:no, for executables
+ # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
+ # lib.a(lib.so.V) shared, rtl:no
+ # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables
+ # lib.a static archive
case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
for ld_flag in $LDFLAGS; do
case $ld_flag in
@@ -6018,6 +6498,13 @@
;;
esac
done
+ if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
+ # With aix-soname=svr4, we create the lib.so.V shared archives only,
+ # so we don't have lib.a shared libs to link our executables.
+ # We have to force runtime linking in this case.
+ aix_use_runtimelinking=yes
+ LDFLAGS="$LDFLAGS -Wl,-brtl"
+ fi
;;
esac
@@ -6036,13 +6523,21 @@
_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
_LT_TAGVAR(hardcode_libdir_separator, $1)=':'
_LT_TAGVAR(link_all_deplibs, $1)=yes
- _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
+ _LT_TAGVAR(file_list_spec, $1)='$wl-f,'
+ case $with_aix_soname,$aix_use_runtimelinking in
+ aix,*) ;; # no import file
+ svr4,* | *,yes) # use import file
+ # The Import File defines what to hardcode.
+ _LT_TAGVAR(hardcode_direct, $1)=no
+ _LT_TAGVAR(hardcode_direct_absolute, $1)=no
+ ;;
+ esac
- if test "$GXX" = yes; then
+ if test yes = "$GXX"; then
case $host_os in aix4.[[012]]|aix4.[[012]].*)
# We only want to do this on AIX 4.2 and lower, the check
# below for broken collect2 doesn't work under 4.3+
- collect2name=`${CC} -print-prog-name=collect2`
+ collect2name=`$CC -print-prog-name=collect2`
if test -f "$collect2name" &&
strings "$collect2name" | $GREP resolve_lib_name >/dev/null
then
@@ -6060,64 +6555,84 @@
fi
esac
shared_flag='-shared'
- if test "$aix_use_runtimelinking" = yes; then
- shared_flag="$shared_flag "'${wl}-G'
+ if test yes = "$aix_use_runtimelinking"; then
+ shared_flag=$shared_flag' $wl-G'
fi
+ # Need to ensure runtime linking is disabled for the traditional
+ # shared library, or the linker may eventually find shared libraries
+ # /with/ Import File - we do not want to mix them.
+ shared_flag_aix='-shared'
+ shared_flag_svr4='-shared $wl-G'
else
# not using gcc
- if test "$host_cpu" = ia64; then
+ if test ia64 = "$host_cpu"; then
# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
# chokes on -Wl,-G. The following line is correct:
shared_flag='-G'
else
- if test "$aix_use_runtimelinking" = yes; then
- shared_flag='${wl}-G'
+ if test yes = "$aix_use_runtimelinking"; then
+ shared_flag='$wl-G'
else
- shared_flag='${wl}-bM:SRE'
+ shared_flag='$wl-bM:SRE'
fi
+ shared_flag_aix='$wl-bM:SRE'
+ shared_flag_svr4='$wl-G'
fi
fi
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-bexpall'
# It seems that -bexpall does not export symbols beginning with
# underscore (_), so it is better to generate a list of symbols to
# export.
_LT_TAGVAR(always_export_symbols, $1)=yes
- if test "$aix_use_runtimelinking" = yes; then
+ if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then
# Warning - without using the other runtime loading flags (-brtl),
# -berok will link without error, but may produce a broken library.
- _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
+ # The "-G" linker flag allows undefined symbols.
+ _LT_TAGVAR(no_undefined_flag, $1)='-bernotok'
# Determine the default libpath from the value encoded in an empty
# executable.
_LT_SYS_MODULE_PATH_AIX([$1])
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag
else
- if test "$host_cpu" = ia64; then
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+ if test ia64 = "$host_cpu"; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $libdir:/usr/lib:/lib'
_LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
- _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+ _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols"
else
# Determine the default libpath from the value encoded in an
# empty executable.
_LT_SYS_MODULE_PATH_AIX([$1])
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-blibpath:$libdir:'"$aix_libpath"
# Warning - without using the other run time loading flags,
# -berok will link without error, but may produce a broken library.
- _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
- _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
- if test "$with_gnu_ld" = yes; then
+ _LT_TAGVAR(no_undefined_flag, $1)=' $wl-bernotok'
+ _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-berok'
+ if test yes = "$with_gnu_ld"; then
# We only use this code for GNU lds that support --whole-archive.
- _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
else
# Exported symbols can be pulled into shared objects from archives
_LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
fi
_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
- # This is similar to how AIX traditionally builds its shared
- # libraries.
- _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
+ # -brtl affects multiple linker settings, -berok does not and is overridden later
+ compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([[, ]]\\)%-berok\\1%g"`'
+ if test svr4 != "$with_aix_soname"; then
+ # This is similar to how AIX traditionally builds its shared
+ # libraries. Need -bnortl late, we may have -brtl in LDFLAGS.
+ _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname'
+ fi
+ if test aix != "$with_aix_soname"; then
+ _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp'
+ else
+ # used by -dlpreopen to get the symbols
+ _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$MV $output_objdir/$realname.d/$soname $output_objdir'
+ fi
+ _LT_TAGVAR(archive_expsym_cmds, $1)="$_LT_TAGVAR(archive_expsym_cmds, $1)"'~$RM -r $output_objdir/$realname.d'
fi
fi
;;
@@ -6127,7 +6642,7 @@
_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
# Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
# support --undefined. This deserves some investigation. FIXME
- _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
else
_LT_TAGVAR(ld_shlibs, $1)=no
fi
@@ -6155,16 +6670,17 @@
# Tell ltmain to make .lib files, not .a files.
libext=lib
# Tell ltmain to make .dll files, not .so files.
- shrext_cmds=".dll"
+ shrext_cmds=.dll
# FIXME: Setting linknames here is a bad hack.
- _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
- _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
- $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
- else
- $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
- fi~
- $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
- linknames='
+ _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
+ _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
+ cp "$export_symbols" "$output_objdir/$soname.def";
+ echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
+ else
+ $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
+ fi~
+ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+ linknames='
# The linker will not automatically build a static lib if we build a DLL.
# _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
@@ -6171,19 +6687,19 @@
# Don't use ranlib
_LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
_LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
- lt_tool_outputfile="@TOOL_OUTPUT@"~
- case $lt_outputfile in
- *.exe|*.EXE) ;;
- *)
- lt_outputfile="$lt_outputfile.exe"
- lt_tool_outputfile="$lt_tool_outputfile.exe"
- ;;
- esac~
- func_to_tool_file "$lt_outputfile"~
- if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
- $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
- $RM "$lt_outputfile.manifest";
- fi'
+ lt_tool_outputfile="@TOOL_OUTPUT@"~
+ case $lt_outputfile in
+ *.exe|*.EXE) ;;
+ *)
+ lt_outputfile=$lt_outputfile.exe
+ lt_tool_outputfile=$lt_tool_outputfile.exe
+ ;;
+ esac~
+ func_to_tool_file "$lt_outputfile"~
+ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
+ $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+ $RM "$lt_outputfile.manifest";
+ fi'
;;
*)
# g++
@@ -6190,22 +6706,22 @@
# _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
# as there is no search path for DLLs.
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-all-symbols'
_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
_LT_TAGVAR(always_export_symbols, $1)=no
_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
- # If the export-symbols file already is a .def file (1st line
- # is EXPORTS), use it as is; otherwise, prepend...
- _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
- cp $export_symbols $output_objdir/$soname.def;
- else
- echo EXPORTS > $output_objdir/$soname.def;
- cat $export_symbols >> $output_objdir/$soname.def;
- fi~
- $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ # If the export-symbols file already is a .def file, use it as
+ # is; otherwise, prepend EXPORTS...
+ _LT_TAGVAR(archive_expsym_cmds, $1)='if _LT_DLL_DEF_P([$export_symbols]); then
+ cp $export_symbols $output_objdir/$soname.def;
+ else
+ echo EXPORTS > $output_objdir/$soname.def;
+ cat $export_symbols >> $output_objdir/$soname.def;
+ fi~
+ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
else
_LT_TAGVAR(ld_shlibs, $1)=no
fi
@@ -6216,6 +6732,34 @@
_LT_DARWIN_LINKER_FEATURES($1)
;;
+ os2*)
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(hardcode_minus_L, $1)=yes
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ shrext_cmds=.dll
+ _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+ $ECHO EXPORTS >> $output_objdir/$libname.def~
+ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
+ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+ emximp -o $lib $output_objdir/$libname.def'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+ $ECHO EXPORTS >> $output_objdir/$libname.def~
+ prefix_cmds="$SED"~
+ if test EXPORTS = "`$SED 1q $export_symbols`"; then
+ prefix_cmds="$prefix_cmds -e 1d";
+ fi~
+ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
+ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
+ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+ emximp -o $lib $output_objdir/$libname.def'
+ _LT_TAGVAR(old_archive_From_new_cmds, $1)='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ ;;
+
dgux*)
case $cc_basename in
ec++*)
@@ -6251,14 +6795,14 @@
;;
haiku*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
_LT_TAGVAR(link_all_deplibs, $1)=yes
;;
hpux9*)
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
_LT_TAGVAR(hardcode_libdir_separator, $1)=:
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
_LT_TAGVAR(hardcode_direct, $1)=yes
_LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
# but as the default
@@ -6270,7 +6814,7 @@
_LT_TAGVAR(ld_shlibs, $1)=no
;;
aCC*)
- _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
# Commands to make compiler produce verbose output that lists
# what "hidden" libraries, object files and flags are used when
# linking a shared library.
@@ -6279,11 +6823,11 @@
# explicitly linking system object files so we need to strip them
# from the output so that they don't get included in the library
# dependencies.
- output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
;;
*)
- if test "$GXX" = yes; then
- _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ if test yes = "$GXX"; then
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
else
# FIXME: insert proper C++ library support
_LT_TAGVAR(ld_shlibs, $1)=no
@@ -6293,8 +6837,8 @@
;;
hpux10*|hpux11*)
- if test $with_gnu_ld = no; then
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+ if test no = "$with_gnu_ld"; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl+b $wl$libdir'
_LT_TAGVAR(hardcode_libdir_separator, $1)=:
case $host_cpu in
@@ -6301,7 +6845,7 @@
hppa*64*|ia64*)
;;
*)
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
;;
esac
fi
@@ -6327,13 +6871,13 @@
aCC*)
case $host_cpu in
hppa*64*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
;;
ia64*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
;;
*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
;;
esac
# Commands to make compiler produce verbose output that lists
@@ -6344,20 +6888,20 @@
# explicitly linking system object files so we need to strip them
# from the output so that they don't get included in the library
# dependencies.
- output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+ output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
;;
*)
- if test "$GXX" = yes; then
- if test $with_gnu_ld = no; then
+ if test yes = "$GXX"; then
+ if test no = "$with_gnu_ld"; then
case $host_cpu in
hppa*64*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC $wl+h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
;;
ia64*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
;;
*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
;;
esac
fi
@@ -6372,8 +6916,8 @@
interix[[3-9]]*)
_LT_TAGVAR(hardcode_direct, $1)=no
_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
# Instead, shared libraries are loaded at an image base (0x10000000 by
# default) and relocated if they conflict, which is a slow very memory
@@ -6380,14 +6924,14 @@
# consuming and fragmenting process. To avoid this, we pick a random,
# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
# time. Moving up from 0x10000000 also allows more sbrk(2) space.
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
;;
irix5* | irix6*)
case $cc_basename in
CC*)
# SGI C++
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
# Archives containing C++ object files must be created using
# "CC -ar", where "CC" is the IRIX C++ compiler. This is
@@ -6396,17 +6940,17 @@
_LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
;;
*)
- if test "$GXX" = yes; then
- if test "$with_gnu_ld" = no; then
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ if test yes = "$GXX"; then
+ if test no = "$with_gnu_ld"; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
else
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` -o $lib'
fi
fi
_LT_TAGVAR(link_all_deplibs, $1)=yes
;;
esac
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
_LT_TAGVAR(hardcode_libdir_separator, $1)=:
_LT_TAGVAR(inherit_rpath, $1)=yes
;;
@@ -6419,8 +6963,8 @@
# KCC will only create a shared library if the output file
# ends with ".so" (or ".sl" for HP-UX), so rename the library
# to its proper name (with version) after linking.
- _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
+ _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib $wl-retain-symbols-file,$export_symbols; mv \$templib $lib'
# Commands to make compiler produce verbose output that lists
# what "hidden" libraries, object files and flags are used when
# linking a shared library.
@@ -6429,10 +6973,10 @@
# explicitly linking system object files so we need to strip them
# from the output so that they don't get included in the library
# dependencies.
- output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+ output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
# Archives containing C++ object files must be created using
# "CC -Bstatic", where "CC" is the KAI C++ compiler.
@@ -6446,8 +6990,8 @@
# earlier do not add the objects themselves.
case `$CC -V 2>&1` in
*"Version 7."*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
;;
*) # Version 8.0 or newer
tmp_idyn=
@@ -6454,14 +6998,14 @@
case $host_cpu in
ia64*) tmp_idyn=' -i_dynamic';;
esac
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
;;
esac
_LT_TAGVAR(archive_cmds_need_lc, $1)=no
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
- _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive$convenience $wl--no-whole-archive'
;;
pgCC* | pgcpp*)
# Portland Group C++ compiler
@@ -6468,37 +7012,37 @@
case `$CC -V` in
*pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
_LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
- rm -rf $tpldir~
- $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
- compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
+ compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
_LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
- rm -rf $tpldir~
- $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
- $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
- $RANLIB $oldlib'
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
+ $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
+ $RANLIB $oldlib'
_LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
- rm -rf $tpldir~
- $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
- $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
_LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
- rm -rf $tpldir~
- $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
- $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+ rm -rf $tpldir~
+ $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+ $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
;;
*) # Version 6 and above use weak symbols
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
;;
esac
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
- _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl--rpath $wl$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
;;
cxx*)
# Compaq C++
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname -o $lib $wl-retain-symbols-file $wl$export_symbols'
runpath_var=LD_RUN_PATH
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
@@ -6512,18 +7056,18 @@
# explicitly linking system object files so we need to strip them
# from the output so that they don't get included in the library
# dependencies.
- output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed'
+ output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed'
;;
xl* | mpixl* | bgxl*)
# IBM XL 8.0 on PPC, with GNU ld
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
- _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- if test "x$supports_anon_versioning" = xyes; then
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl--export-dynamic'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+ if test yes = "$supports_anon_versioning"; then
_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
- cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
- echo "local: *; };" >> $output_objdir/$libname.ver~
- $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $CC -qmkshrobj $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
fi
;;
*)
@@ -6531,10 +7075,10 @@
*Sun\ C*)
# Sun C++ 5.9
_LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
- _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file $wl$export_symbols'
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
- _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
_LT_TAGVAR(compiler_needs_object, $1)=yes
# Not sure whether something based on
@@ -6592,22 +7136,17 @@
_LT_TAGVAR(ld_shlibs, $1)=yes
;;
- openbsd2*)
- # C++ shared libraries are fairly broken
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
-
- openbsd*)
+ openbsd* | bitrig*)
if test -f /usr/libexec/ld.so; then
_LT_TAGVAR(hardcode_direct, $1)=yes
_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
- if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
- _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
+ if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`"; then
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-retain-symbols-file,$export_symbols -o $lib'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-E'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
fi
output_verbose_link_cmd=func_echo_all
else
@@ -6623,9 +7162,9 @@
# KCC will only create a shared library if the output file
# ends with ".so" (or ".sl" for HP-UX), so rename the library
# to its proper name (with version) after linking.
- _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+ _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\$tempext\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath,$libdir'
_LT_TAGVAR(hardcode_libdir_separator, $1)=:
# Archives containing C++ object files must be created using
@@ -6643,17 +7182,17 @@
cxx*)
case $host in
osf3*)
- _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $soname `test -n "$verstring" && func_echo_all "$wl-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
;;
*)
_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
_LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
- echo "-hidden">> $lib.exp~
- $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~
- $RM $lib.exp'
+ echo "-hidden">> $lib.exp~
+ $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname $wl-input $wl$lib.exp `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~
+ $RM $lib.exp'
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
;;
esac
@@ -6668,21 +7207,21 @@
# explicitly linking system object files so we need to strip them
# from the output so that they don't get included in the library
# dependencies.
- output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+ output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list= ; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
;;
*)
- if test "$GXX" = yes && test "$with_gnu_ld" = no; then
- _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+ if test yes,no = "$GXX,$with_gnu_ld"; then
+ _LT_TAGVAR(allow_undefined_flag, $1)=' $wl-expect_unresolved $wl\*'
case $host in
osf3*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
;;
*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
;;
esac
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-rpath $wl$libdir'
_LT_TAGVAR(hardcode_libdir_separator, $1)=:
# Commands to make compiler produce verbose output that lists
@@ -6728,9 +7267,9 @@
# Sun C++ 4.2, 5.x and Centerline C++
_LT_TAGVAR(archive_cmds_need_lc,$1)=yes
_LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
- _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G$allow_undefined_flag -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
- $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+ $CC -G$allow_undefined_flag $wl-M $wl$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
@@ -6738,7 +7277,7 @@
solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
*)
# The compiler driver will combine and reorder linker options,
- # but understands `-z linker_flag'.
+ # but understands '-z linker_flag'.
# Supported since Solaris 2.6 (maybe 2.5.1?)
_LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
;;
@@ -6755,7 +7294,7 @@
;;
gcx*)
# Green Hills C++ Compiler
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
# The C++ compiler must be used to create the archive.
_LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
@@ -6762,12 +7301,12 @@
;;
*)
# GNU C++ compiler with Solaris linker
- if test "$GXX" = yes && test "$with_gnu_ld" = no; then
- _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
+ if test yes,no = "$GXX,$with_gnu_ld"; then
+ _LT_TAGVAR(no_undefined_flag, $1)=' $wl-z ${wl}defs'
if $CC --version | $GREP -v '^2\.7' > /dev/null; then
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
- $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+ $CC -shared $pic_flag -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
# Commands to make compiler produce verbose output that lists
# what "hidden" libraries, object files and flags are used when
@@ -6774,11 +7313,11 @@
# linking a shared library.
output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
else
- # g++ 2.7 appears to require `-G' NOT `-shared' on this
+ # g++ 2.7 appears to require '-G' NOT '-shared' on this
# platform.
- _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags $wl-h $wl$soname -o $lib'
_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
- $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+ $CC -G -nostdlib $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
# Commands to make compiler produce verbose output that lists
# what "hidden" libraries, object files and flags are used when
@@ -6786,11 +7325,11 @@
output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
fi
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R $wl$libdir'
case $host_os in
solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
*)
- _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+ _LT_TAGVAR(whole_archive_flag_spec, $1)='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
;;
esac
fi
@@ -6799,7 +7338,7 @@
;;
sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
- _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+ _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
_LT_TAGVAR(archive_cmds_need_lc, $1)=no
_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
runpath_var='LD_RUN_PATH'
@@ -6806,45 +7345,45 @@
case $cc_basename in
CC*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
;;
*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
;;
esac
;;
sysv5* | sco3.2v5* | sco5v6*)
- # Note: We can NOT use -z defs as we might desire, because we do not
+ # Note: We CANNOT use -z defs as we might desire, because we do not
# link with -lc, and that would cause any symbols used from libc to
# always be unresolved, which means just about no library would
# ever link correctly. If we're not using GNU ld we use -z text
# though, which does catch some bad symbols but isn't as heavy-handed
# as -z defs.
- _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
- _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
+ _LT_TAGVAR(no_undefined_flag, $1)='$wl-z,text'
+ _LT_TAGVAR(allow_undefined_flag, $1)='$wl-z,nodefs'
_LT_TAGVAR(archive_cmds_need_lc, $1)=no
_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='$wl-R,$libdir'
_LT_TAGVAR(hardcode_libdir_separator, $1)=':'
_LT_TAGVAR(link_all_deplibs, $1)=yes
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='$wl-Bexport'
runpath_var='LD_RUN_PATH'
case $cc_basename in
CC*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
_LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
- '"$_LT_TAGVAR(old_archive_cmds, $1)"
+ '"$_LT_TAGVAR(old_archive_cmds, $1)"
_LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
- '"$_LT_TAGVAR(reload_cmds, $1)"
+ '"$_LT_TAGVAR(reload_cmds, $1)"
;;
*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
;;
esac
;;
@@ -6875,10 +7414,10 @@
esac
AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
- test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+ test no = "$_LT_TAGVAR(ld_shlibs, $1)" && can_build_shared=no
- _LT_TAGVAR(GCC, $1)="$GXX"
- _LT_TAGVAR(LD, $1)="$LD"
+ _LT_TAGVAR(GCC, $1)=$GXX
+ _LT_TAGVAR(LD, $1)=$LD
## CAVEAT EMPTOR:
## There is no encapsulation within the following macros, do not change
@@ -6905,7 +7444,7 @@
lt_cv_path_LD=$lt_save_path_LD
lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
-fi # test "$_lt_caught_CXX_error" != yes
+fi # test yes != "$_lt_caught_CXX_error"
AC_LANG_POP
])# _LT_LANG_CXX_CONFIG
@@ -6927,13 +7466,14 @@
AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
func_stripname_cnf ()
{
- case ${2} in
- .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
- *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
+ case @S|@2 in
+ .*) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%\\\\@S|@2\$%%"`;;
+ *) func_stripname_result=`$ECHO "@S|@3" | $SED "s%^@S|@1%%; s%@S|@2\$%%"`;;
esac
} # func_stripname_cnf
])# _LT_FUNC_STRIPNAME_CNF
+
# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
# ---------------------------------
# Figure out "hidden" library dependencies from verbose
@@ -7017,13 +7557,13 @@
pre_test_object_deps_done=no
for p in `eval "$output_verbose_link_cmd"`; do
- case ${prev}${p} in
+ case $prev$p in
-L* | -R* | -l*)
# Some compilers place space between "-{L,R}" and the path.
# Remove the space.
- if test $p = "-L" ||
- test $p = "-R"; then
+ if test x-L = "$p" ||
+ test x-R = "$p"; then
prev=$p
continue
fi
@@ -7039,16 +7579,16 @@
case $p in
=*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
esac
- if test "$pre_test_object_deps_done" = no; then
- case ${prev} in
+ if test no = "$pre_test_object_deps_done"; then
+ case $prev in
-L | -R)
# Internal compiler library paths should come after those
# provided the user. The postdeps already come after the
# user supplied libs so there is no need to process them.
if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
- _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
+ _LT_TAGVAR(compiler_lib_search_path, $1)=$prev$p
else
- _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
+ _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} $prev$p"
fi
;;
# The "-l" case would never come before the object being
@@ -7056,9 +7596,9 @@
esac
else
if test -z "$_LT_TAGVAR(postdeps, $1)"; then
- _LT_TAGVAR(postdeps, $1)="${prev}${p}"
+ _LT_TAGVAR(postdeps, $1)=$prev$p
else
- _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
+ _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} $prev$p"
fi
fi
prev=
@@ -7073,15 +7613,15 @@
continue
fi
- if test "$pre_test_object_deps_done" = no; then
+ if test no = "$pre_test_object_deps_done"; then
if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
- _LT_TAGVAR(predep_objects, $1)="$p"
+ _LT_TAGVAR(predep_objects, $1)=$p
else
_LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
fi
else
if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
- _LT_TAGVAR(postdep_objects, $1)="$p"
+ _LT_TAGVAR(postdep_objects, $1)=$p
else
_LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
fi
@@ -7112,51 +7652,6 @@
_LT_TAGVAR(postdep_objects,$1)=
_LT_TAGVAR(postdeps,$1)=
;;
-
-linux*)
- case `$CC -V 2>&1 | sed 5q` in
- *Sun\ C*)
- # Sun C++ 5.9
-
- # The more standards-conforming stlport4 library is
- # incompatible with the Cstd library. Avoid specifying
- # it if it's in CXXFLAGS. Ignore libCrun as
- # -library=stlport4 depends on it.
- case " $CXX $CXXFLAGS " in
- *" -library=stlport4 "*)
- solaris_use_stlport4=yes
- ;;
- esac
-
- if test "$solaris_use_stlport4" != yes; then
- _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
- fi
- ;;
- esac
- ;;
-
-solaris*)
- case $cc_basename in
- CC* | sunCC*)
- # The more standards-conforming stlport4 library is
- # incompatible with the Cstd library. Avoid specifying
- # it if it's in CXXFLAGS. Ignore libCrun as
- # -library=stlport4 depends on it.
- case " $CXX $CXXFLAGS " in
- *" -library=stlport4 "*)
- solaris_use_stlport4=yes
- ;;
- esac
-
- # Adding this requires a known-good setup of shared libraries for
- # Sun compiler versions before 5.6, else PIC objects from an old
- # archive will be linked into the output, leading to subtle bugs.
- if test "$solaris_use_stlport4" != yes; then
- _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
- fi
- ;;
- esac
- ;;
esac
])
@@ -7165,7 +7660,7 @@
esac
_LT_TAGVAR(compiler_lib_search_dirs, $1)=
if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
- _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
+ _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | $SED -e 's! -L! !g' -e 's!^ !!'`
fi
_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
[The directories searched by this compiler when creating a shared library])
@@ -7185,10 +7680,10 @@
# --------------------------
# Ensure that the configuration variables for a Fortran 77 compiler are
# suitably defined. These variables are subsequently used by _LT_CONFIG
-# to write the compiler configuration to `libtool'.
+# to write the compiler configuration to 'libtool'.
m4_defun([_LT_LANG_F77_CONFIG],
[AC_LANG_PUSH(Fortran 77)
-if test -z "$F77" || test "X$F77" = "Xno"; then
+if test -z "$F77" || test no = "$F77"; then
_lt_disable_F77=yes
fi
@@ -7225,7 +7720,7 @@
# the F77 compiler isn't working. Some variables (like enable_shared)
# are currently assumed to apply to all compilers on this platform,
# and will be corrupted by setting them based on a non-working compiler.
-if test "$_lt_disable_F77" != yes; then
+if test yes != "$_lt_disable_F77"; then
# Code to be used in simple compile tests
lt_simple_compile_test_code="\
subroutine t
@@ -7247,7 +7742,7 @@
_LT_LINKER_BOILERPLATE
# Allow CC to be a program name with arguments.
- lt_save_CC="$CC"
+ lt_save_CC=$CC
lt_save_GCC=$GCC
lt_save_CFLAGS=$CFLAGS
CC=${F77-"f77"}
@@ -7261,13 +7756,13 @@
AC_MSG_RESULT([$can_build_shared])
AC_MSG_CHECKING([whether to build shared libraries])
- test "$can_build_shared" = "no" && enable_shared=no
+ test no = "$can_build_shared" && enable_shared=no
# On AIX, shared libraries and static libraries use the same namespace, and
# are all built from PIC.
case $host_os in
aix3*)
- test "$enable_shared" = yes && enable_static=no
+ test yes = "$enable_shared" && enable_static=no
if test -n "$RANLIB"; then
archive_cmds="$archive_cmds~\$RANLIB \$lib"
postinstall_cmds='$RANLIB $lib'
@@ -7274,8 +7769,12 @@
fi
;;
aix[[4-9]]*)
- if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
- test "$enable_shared" = yes && enable_static=no
+ if test ia64 != "$host_cpu"; then
+ case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
+ yes,aix,yes) ;; # shared object as lib.so file only
+ yes,svr4,*) ;; # shared object as lib.so archive member only
+ yes,*) enable_static=no ;; # shared object in lib.a archive as well
+ esac
fi
;;
esac
@@ -7283,11 +7782,11 @@
AC_MSG_CHECKING([whether to build static libraries])
# Make sure either enable_shared or enable_static is yes.
- test "$enable_shared" = yes || enable_static=yes
+ test yes = "$enable_shared" || enable_static=yes
AC_MSG_RESULT([$enable_static])
- _LT_TAGVAR(GCC, $1)="$G77"
- _LT_TAGVAR(LD, $1)="$LD"
+ _LT_TAGVAR(GCC, $1)=$G77
+ _LT_TAGVAR(LD, $1)=$LD
## CAVEAT EMPTOR:
## There is no encapsulation within the following macros, do not change
@@ -7304,9 +7803,9 @@
fi # test -n "$compiler"
GCC=$lt_save_GCC
- CC="$lt_save_CC"
- CFLAGS="$lt_save_CFLAGS"
-fi # test "$_lt_disable_F77" != yes
+ CC=$lt_save_CC
+ CFLAGS=$lt_save_CFLAGS
+fi # test yes != "$_lt_disable_F77"
AC_LANG_POP
])# _LT_LANG_F77_CONFIG
@@ -7316,11 +7815,11 @@
# -------------------------
# Ensure that the configuration variables for a Fortran compiler are
# suitably defined. These variables are subsequently used by _LT_CONFIG
-# to write the compiler configuration to `libtool'.
+# to write the compiler configuration to 'libtool'.
m4_defun([_LT_LANG_FC_CONFIG],
[AC_LANG_PUSH(Fortran)
-if test -z "$FC" || test "X$FC" = "Xno"; then
+if test -z "$FC" || test no = "$FC"; then
_lt_disable_FC=yes
fi
@@ -7357,7 +7856,7 @@
# the FC compiler isn't working. Some variables (like enable_shared)
# are currently assumed to apply to all compilers on this platform,
# and will be corrupted by setting them based on a non-working compiler.
-if test "$_lt_disable_FC" != yes; then
+if test yes != "$_lt_disable_FC"; then
# Code to be used in simple compile tests
lt_simple_compile_test_code="\
subroutine t
@@ -7379,7 +7878,7 @@
_LT_LINKER_BOILERPLATE
# Allow CC to be a program name with arguments.
- lt_save_CC="$CC"
+ lt_save_CC=$CC
lt_save_GCC=$GCC
lt_save_CFLAGS=$CFLAGS
CC=${FC-"f95"}
@@ -7395,13 +7894,13 @@
AC_MSG_RESULT([$can_build_shared])
AC_MSG_CHECKING([whether to build shared libraries])
- test "$can_build_shared" = "no" && enable_shared=no
+ test no = "$can_build_shared" && enable_shared=no
# On AIX, shared libraries and static libraries use the same namespace, and
# are all built from PIC.
case $host_os in
aix3*)
- test "$enable_shared" = yes && enable_static=no
+ test yes = "$enable_shared" && enable_static=no
if test -n "$RANLIB"; then
archive_cmds="$archive_cmds~\$RANLIB \$lib"
postinstall_cmds='$RANLIB $lib'
@@ -7408,8 +7907,12 @@
fi
;;
aix[[4-9]]*)
- if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
- test "$enable_shared" = yes && enable_static=no
+ if test ia64 != "$host_cpu"; then
+ case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
+ yes,aix,yes) ;; # shared object as lib.so file only
+ yes,svr4,*) ;; # shared object as lib.so archive member only
+ yes,*) enable_static=no ;; # shared object in lib.a archive as well
+ esac
fi
;;
esac
@@ -7417,11 +7920,11 @@
AC_MSG_CHECKING([whether to build static libraries])
# Make sure either enable_shared or enable_static is yes.
- test "$enable_shared" = yes || enable_static=yes
+ test yes = "$enable_shared" || enable_static=yes
AC_MSG_RESULT([$enable_static])
- _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
- _LT_TAGVAR(LD, $1)="$LD"
+ _LT_TAGVAR(GCC, $1)=$ac_cv_fc_compiler_gnu
+ _LT_TAGVAR(LD, $1)=$LD
## CAVEAT EMPTOR:
## There is no encapsulation within the following macros, do not change
@@ -7441,7 +7944,7 @@
GCC=$lt_save_GCC
CC=$lt_save_CC
CFLAGS=$lt_save_CFLAGS
-fi # test "$_lt_disable_FC" != yes
+fi # test yes != "$_lt_disable_FC"
AC_LANG_POP
])# _LT_LANG_FC_CONFIG
@@ -7451,7 +7954,7 @@
# --------------------------
# Ensure that the configuration variables for the GNU Java Compiler compiler
# are suitably defined. These variables are subsequently used by _LT_CONFIG
-# to write the compiler configuration to `libtool'.
+# to write the compiler configuration to 'libtool'.
m4_defun([_LT_LANG_GCJ_CONFIG],
[AC_REQUIRE([LT_PROG_GCJ])dnl
AC_LANG_SAVE
@@ -7485,7 +7988,7 @@
CFLAGS=$GCJFLAGS
compiler=$CC
_LT_TAGVAR(compiler, $1)=$CC
-_LT_TAGVAR(LD, $1)="$LD"
+_LT_TAGVAR(LD, $1)=$LD
_LT_CC_BASENAME([$compiler])
# GCJ did not exist at the time GCC didn't implicitly link libc in.
@@ -7518,7 +8021,7 @@
# --------------------------
# Ensure that the configuration variables for the GNU Go compiler
# are suitably defined. These variables are subsequently used by _LT_CONFIG
-# to write the compiler configuration to `libtool'.
+# to write the compiler configuration to 'libtool'.
m4_defun([_LT_LANG_GO_CONFIG],
[AC_REQUIRE([LT_PROG_GO])dnl
AC_LANG_SAVE
@@ -7552,7 +8055,7 @@
CFLAGS=$GOFLAGS
compiler=$CC
_LT_TAGVAR(compiler, $1)=$CC
-_LT_TAGVAR(LD, $1)="$LD"
+_LT_TAGVAR(LD, $1)=$LD
_LT_CC_BASENAME([$compiler])
# Go did not exist at the time GCC didn't implicitly link libc in.
@@ -7585,7 +8088,7 @@
# -------------------------
# Ensure that the configuration variables for the Windows resource compiler
# are suitably defined. These variables are subsequently used by _LT_CONFIG
-# to write the compiler configuration to `libtool'.
+# to write the compiler configuration to 'libtool'.
m4_defun([_LT_LANG_RC_CONFIG],
[AC_REQUIRE([LT_PROG_RC])dnl
AC_LANG_SAVE
@@ -7601,7 +8104,7 @@
lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
# Code to be used in simple link tests
-lt_simple_link_test_code="$lt_simple_compile_test_code"
+lt_simple_link_test_code=$lt_simple_compile_test_code
# ltmain only uses $CC for tagged configurations so make sure $CC is set.
_LT_TAG_COMPILER
@@ -7611,7 +8114,7 @@
_LT_LINKER_BOILERPLATE
# Allow CC to be a program name with arguments.
-lt_save_CC="$CC"
+lt_save_CC=$CC
lt_save_CFLAGS=$CFLAGS
lt_save_GCC=$GCC
GCC=
@@ -7640,7 +8143,7 @@
[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
[m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
[AC_CHECK_TOOL(GCJ, gcj,)
- test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
+ test set = "${GCJFLAGS+set}" || GCJFLAGS="-g -O2"
AC_SUBST(GCJFLAGS)])])[]dnl
])
@@ -7749,7 +8252,7 @@
# Add /usr/xpg4/bin/sed as it is typically found on Solaris
# along with /bin/sed that truncates output.
for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
- test ! -f $lt_ac_sed && continue
+ test ! -f "$lt_ac_sed" && continue
cat /dev/null > conftest.in
lt_ac_count=0
echo $ECHO_N "0123456789$ECHO_C" >conftest.in
@@ -7766,9 +8269,9 @@
$lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
cmp -s conftest.out conftest.nl || break
# 10000 chars as input seems more than enough
- test $lt_ac_count -gt 10 && break
+ test 10 -lt "$lt_ac_count" && break
lt_ac_count=`expr $lt_ac_count + 1`
- if test $lt_ac_count -gt $lt_ac_max; then
+ if test "$lt_ac_count" -gt "$lt_ac_max"; then
lt_ac_max=$lt_ac_count
lt_cv_path_SED=$lt_ac_sed
fi
@@ -7792,27 +8295,7 @@
# Find out whether the shell is Bourne or XSI compatible,
# or has some other useful features.
m4_defun([_LT_CHECK_SHELL_FEATURES],
-[AC_MSG_CHECKING([whether the shell understands some XSI constructs])
-# Try some XSI features
-xsi_shell=no
-( _lt_dummy="a/b/c"
- test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
- = c,a/b,b/c, \
- && eval 'test $(( 1 + 1 )) -eq 2 \
- && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
- && xsi_shell=yes
-AC_MSG_RESULT([$xsi_shell])
-_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])
-
-AC_MSG_CHECKING([whether the shell understands "+="])
-lt_shell_append=no
-( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
- >/dev/null 2>&1 \
- && lt_shell_append=yes
-AC_MSG_RESULT([$lt_shell_append])
-_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
-
-if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+[if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
lt_unset=unset
else
lt_unset=false
@@ -7836,102 +8319,9 @@
])# _LT_CHECK_SHELL_FEATURES
-# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY)
-# ------------------------------------------------------
-# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and
-# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY.
-m4_defun([_LT_PROG_FUNCTION_REPLACE],
-[dnl {
-sed -e '/^$1 ()$/,/^} # $1 /c\
-$1 ()\
-{\
-m4_bpatsubsts([$2], [$], [\\], [^\([ ]\)], [\\\1])
-} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \
- && mv -f "$cfgfile.tmp" "$cfgfile" \
- || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-])
-
-
-# _LT_PROG_REPLACE_SHELLFNS
-# -------------------------
-# Replace existing portable implementations of several shell functions with
-# equivalent extended shell implementations where those features are available..
-m4_defun([_LT_PROG_REPLACE_SHELLFNS],
-[if test x"$xsi_shell" = xyes; then
- _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl
- case ${1} in
- */*) func_dirname_result="${1%/*}${2}" ;;
- * ) func_dirname_result="${3}" ;;
- esac])
-
- _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl
- func_basename_result="${1##*/}"])
-
- _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl
- case ${1} in
- */*) func_dirname_result="${1%/*}${2}" ;;
- * ) func_dirname_result="${3}" ;;
- esac
- func_basename_result="${1##*/}"])
-
- _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl
- # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
- # positional parameters, so assign one to ordinary parameter first.
- func_stripname_result=${3}
- func_stripname_result=${func_stripname_result#"${1}"}
- func_stripname_result=${func_stripname_result%"${2}"}])
-
- _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl
- func_split_long_opt_name=${1%%=*}
- func_split_long_opt_arg=${1#*=}])
-
- _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl
- func_split_short_opt_arg=${1#??}
- func_split_short_opt_name=${1%"$func_split_short_opt_arg"}])
-
- _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl
- case ${1} in
- *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
- *) func_lo2o_result=${1} ;;
- esac])
-
- _LT_PROG_FUNCTION_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo])
-
- _LT_PROG_FUNCTION_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))])
-
- _LT_PROG_FUNCTION_REPLACE([func_len], [ func_len_result=${#1}])
-fi
-
-if test x"$lt_shell_append" = xyes; then
- _LT_PROG_FUNCTION_REPLACE([func_append], [ eval "${1}+=\\${2}"])
-
- _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl
- func_quote_for_eval "${2}"
-dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \
- eval "${1}+=\\\\ \\$func_quote_for_eval_result"])
-
- # Save a `func_append' function call where possible by direct use of '+='
- sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
- && mv -f "$cfgfile.tmp" "$cfgfile" \
- || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
- test 0 -eq $? || _lt_function_replace_fail=:
-else
- # Save a `func_append' function call even when '+=' is not available
- sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
- && mv -f "$cfgfile.tmp" "$cfgfile" \
- || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
- test 0 -eq $? || _lt_function_replace_fail=:
-fi
-
-if test x"$_lt_function_replace_fail" = x":"; then
- AC_MSG_WARN([Unable to substitute extended shell functions in $ofile])
-fi
-])
-
# _LT_PATH_CONVERSION_FUNCTIONS
# -----------------------------
-# Determine which file name conversion functions should be used by
+# Determine what file name conversion functions should be used by
# func_to_host_file (and, implicitly, by func_to_host_path). These are needed
# for certain cross-compile configurations and native mingw.
m4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
@@ -7998,8 +8388,8 @@
# Helper functions for option handling. -*- Autoconf -*-
#
-# Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation,
-# Inc.
+# Copyright (C) 2004-2005, 2007-2009, 2011-2015 Free Software
+# Foundation, Inc.
# Written by Gary V. Vaughan, 2004
#
# This file is free software; the Free Software Foundation gives
@@ -8006,7 +8396,7 @@
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
-# serial 7 ltoptions.m4
+# serial 8 ltoptions.m4
# This is to help aclocal find these macros, as it can't see m4_define.
AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
@@ -8027,7 +8417,7 @@
[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
_LT_MANGLE_DEFUN([$1], [$2]),
- [m4_warning([Unknown $1 option `$2'])])[]dnl
+ [m4_warning([Unknown $1 option '$2'])])[]dnl
])
@@ -8073,13 +8463,15 @@
dnl
dnl If no reference was made to various pairs of opposing options, then
dnl we run the default mode handler for the pair. For example, if neither
- dnl `shared' nor `disable-shared' was passed, we enable building of shared
+ dnl 'shared' nor 'disable-shared' was passed, we enable building of shared
dnl archives by default:
_LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
_LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
_LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
_LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
- [_LT_ENABLE_FAST_INSTALL])
+ [_LT_ENABLE_FAST_INSTALL])
+ _LT_UNLESS_OPTIONS([LT_INIT], [aix-soname=aix aix-soname=both aix-soname=svr4],
+ [_LT_WITH_AIX_SONAME([aix])])
])
])# _LT_SET_OPTIONS
@@ -8107,7 +8499,7 @@
[_LT_SET_OPTION([LT_INIT], [dlopen])
AC_DIAGNOSE([obsolete],
[$0: Remove this warning and the call to _LT_SET_OPTION when you
-put the `dlopen' option into LT_INIT's first parameter.])
+put the 'dlopen' option into LT_INIT's first parameter.])
])
dnl aclocal-1.4 backwards compatibility:
@@ -8143,7 +8535,7 @@
_LT_SET_OPTION([LT_INIT], [win32-dll])
AC_DIAGNOSE([obsolete],
[$0: Remove this warning and the call to _LT_SET_OPTION when you
-put the `win32-dll' option into LT_INIT's first parameter.])
+put the 'win32-dll' option into LT_INIT's first parameter.])
])
dnl aclocal-1.4 backwards compatibility:
@@ -8152,9 +8544,9 @@
# _LT_ENABLE_SHARED([DEFAULT])
# ----------------------------
-# implement the --enable-shared flag, and supports the `shared' and
-# `disable-shared' LT_INIT options.
-# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
+# implement the --enable-shared flag, and supports the 'shared' and
+# 'disable-shared' LT_INIT options.
+# DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'.
m4_define([_LT_ENABLE_SHARED],
[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
AC_ARG_ENABLE([shared],
@@ -8167,14 +8559,14 @@
*)
enable_shared=no
# Look at the argument we got. We use all the common list separators.
- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
for pkg in $enableval; do
- IFS="$lt_save_ifs"
+ IFS=$lt_save_ifs
if test "X$pkg" = "X$p"; then
enable_shared=yes
fi
done
- IFS="$lt_save_ifs"
+ IFS=$lt_save_ifs
;;
esac],
[enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
@@ -8206,9 +8598,9 @@
# _LT_ENABLE_STATIC([DEFAULT])
# ----------------------------
-# implement the --enable-static flag, and support the `static' and
-# `disable-static' LT_INIT options.
-# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
+# implement the --enable-static flag, and support the 'static' and
+# 'disable-static' LT_INIT options.
+# DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'.
m4_define([_LT_ENABLE_STATIC],
[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
AC_ARG_ENABLE([static],
@@ -8221,14 +8613,14 @@
*)
enable_static=no
# Look at the argument we got. We use all the common list separators.
- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
for pkg in $enableval; do
- IFS="$lt_save_ifs"
+ IFS=$lt_save_ifs
if test "X$pkg" = "X$p"; then
enable_static=yes
fi
done
- IFS="$lt_save_ifs"
+ IFS=$lt_save_ifs
;;
esac],
[enable_static=]_LT_ENABLE_STATIC_DEFAULT)
@@ -8260,9 +8652,9 @@
# _LT_ENABLE_FAST_INSTALL([DEFAULT])
# ----------------------------------
-# implement the --enable-fast-install flag, and support the `fast-install'
-# and `disable-fast-install' LT_INIT options.
-# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
+# implement the --enable-fast-install flag, and support the 'fast-install'
+# and 'disable-fast-install' LT_INIT options.
+# DEFAULT is either 'yes' or 'no'. If omitted, it defaults to 'yes'.
m4_define([_LT_ENABLE_FAST_INSTALL],
[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
AC_ARG_ENABLE([fast-install],
@@ -8275,14 +8667,14 @@
*)
enable_fast_install=no
# Look at the argument we got. We use all the common list separators.
- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
for pkg in $enableval; do
- IFS="$lt_save_ifs"
+ IFS=$lt_save_ifs
if test "X$pkg" = "X$p"; then
enable_fast_install=yes
fi
done
- IFS="$lt_save_ifs"
+ IFS=$lt_save_ifs
;;
esac],
[enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
@@ -8299,7 +8691,7 @@
[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
AC_DIAGNOSE([obsolete],
[$0: Remove this warning and the call to _LT_SET_OPTION when you put
-the `fast-install' option into LT_INIT's first parameter.])
+the 'fast-install' option into LT_INIT's first parameter.])
])
AU_DEFUN([AC_DISABLE_FAST_INSTALL],
@@ -8306,7 +8698,7 @@
[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
AC_DIAGNOSE([obsolete],
[$0: Remove this warning and the call to _LT_SET_OPTION when you put
-the `disable-fast-install' option into LT_INIT's first parameter.])
+the 'disable-fast-install' option into LT_INIT's first parameter.])
])
dnl aclocal-1.4 backwards compatibility:
@@ -8314,11 +8706,64 @@
dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
+# _LT_WITH_AIX_SONAME([DEFAULT])
+# ----------------------------------
+# implement the --with-aix-soname flag, and support the `aix-soname=aix'
+# and `aix-soname=both' and `aix-soname=svr4' LT_INIT options. DEFAULT
+# is either `aix', `both' or `svr4'. If omitted, it defaults to `aix'.
+m4_define([_LT_WITH_AIX_SONAME],
+[m4_define([_LT_WITH_AIX_SONAME_DEFAULT], [m4_if($1, svr4, svr4, m4_if($1, both, both, aix))])dnl
+shared_archive_member_spec=
+case $host,$enable_shared in
+power*-*-aix[[5-9]]*,yes)
+ AC_MSG_CHECKING([which variant of shared library versioning to provide])
+ AC_ARG_WITH([aix-soname],
+ [AS_HELP_STRING([--with-aix-soname=aix|svr4|both],
+ [shared library versioning (aka "SONAME") variant to provide on AIX, @<:@default=]_LT_WITH_AIX_SONAME_DEFAULT[@:>@.])],
+ [case $withval in
+ aix|svr4|both)
+ ;;
+ *)
+ AC_MSG_ERROR([Unknown argument to --with-aix-soname])
+ ;;
+ esac
+ lt_cv_with_aix_soname=$with_aix_soname],
+ [AC_CACHE_VAL([lt_cv_with_aix_soname],
+ [lt_cv_with_aix_soname=]_LT_WITH_AIX_SONAME_DEFAULT)
+ with_aix_soname=$lt_cv_with_aix_soname])
+ AC_MSG_RESULT([$with_aix_soname])
+ if test aix != "$with_aix_soname"; then
+ # For the AIX way of multilib, we name the shared archive member
+ # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o',
+ # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File.
+ # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag,
+ # the AIX toolchain works better with OBJECT_MODE set (default 32).
+ if test 64 = "${OBJECT_MODE-32}"; then
+ shared_archive_member_spec=shr_64
+ else
+ shared_archive_member_spec=shr
+ fi
+ fi
+ ;;
+*)
+ with_aix_soname=aix
+ ;;
+esac
+
+_LT_DECL([], [shared_archive_member_spec], [0],
+ [Shared archive member basename, for filename based shared library versioning on AIX])dnl
+])# _LT_WITH_AIX_SONAME
+
+LT_OPTION_DEFINE([LT_INIT], [aix-soname=aix], [_LT_WITH_AIX_SONAME([aix])])
+LT_OPTION_DEFINE([LT_INIT], [aix-soname=both], [_LT_WITH_AIX_SONAME([both])])
+LT_OPTION_DEFINE([LT_INIT], [aix-soname=svr4], [_LT_WITH_AIX_SONAME([svr4])])
+
+
# _LT_WITH_PIC([MODE])
# --------------------
-# implement the --with-pic flag, and support the `pic-only' and `no-pic'
+# implement the --with-pic flag, and support the 'pic-only' and 'no-pic'
# LT_INIT options.
-# MODE is either `yes' or `no'. If omitted, it defaults to `both'.
+# MODE is either 'yes' or 'no'. If omitted, it defaults to 'both'.
m4_define([_LT_WITH_PIC],
[AC_ARG_WITH([pic],
[AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
@@ -8329,20 +8774,18 @@
*)
pic_mode=default
# Look at the argument we got. We use all the common list separators.
- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
for lt_pkg in $withval; do
- IFS="$lt_save_ifs"
+ IFS=$lt_save_ifs
if test "X$lt_pkg" = "X$lt_p"; then
pic_mode=yes
fi
done
- IFS="$lt_save_ifs"
+ IFS=$lt_save_ifs
;;
esac],
- [pic_mode=default])
+ [pic_mode=m4_default([$1], [default])])
-test -z "$pic_mode" && pic_mode=m4_default([$1], [default])
-
_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
])# _LT_WITH_PIC
@@ -8354,7 +8797,7 @@
[_LT_SET_OPTION([LT_INIT], [pic-only])
AC_DIAGNOSE([obsolete],
[$0: Remove this warning and the call to _LT_SET_OPTION when you
-put the `pic-only' option into LT_INIT's first parameter.])
+put the 'pic-only' option into LT_INIT's first parameter.])
])
dnl aclocal-1.4 backwards compatibility:
@@ -8377,7 +8820,8 @@
# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*-
#
-# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
+# Copyright (C) 2004-2005, 2007-2008, 2011-2015 Free Software
+# Foundation, Inc.
# Written by Gary V. Vaughan, 2004
#
# This file is free software; the Free Software Foundation gives
@@ -8410,7 +8854,7 @@
# ------------
# Manipulate m4 lists.
# These macros are necessary as long as will still need to support
-# Autoconf-2.59 which quotes differently.
+# Autoconf-2.59, which quotes differently.
m4_define([lt_car], [[$1]])
m4_define([lt_cdr],
[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
@@ -8421,7 +8865,7 @@
# lt_append(MACRO-NAME, STRING, [SEPARATOR])
# ------------------------------------------
-# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
+# Redefine MACRO-NAME to hold its former content plus 'SEPARATOR''STRING'.
# Note that neither SEPARATOR nor STRING are expanded; they are appended
# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
# No SEPARATOR is output if MACRO-NAME was previously undefined (different
@@ -8501,7 +8945,7 @@
# ltversion.m4 -- version numbers -*- Autoconf -*-
#
-# Copyright (C) 2004 Free Software Foundation, Inc.
+# Copyright (C) 2004, 2011-2015 Free Software Foundation, Inc.
# Written by Scott James Remnant, 2004
#
# This file is free software; the Free Software Foundation gives
@@ -8510,15 +8954,15 @@
# @configure_input@
-# serial 3337 ltversion.m4
+# serial 4179 ltversion.m4
# This file is part of GNU Libtool
-m4_define([LT_PACKAGE_VERSION], [2.4.2])
-m4_define([LT_PACKAGE_REVISION], [1.3337])
+m4_define([LT_PACKAGE_VERSION], [2.4.6])
+m4_define([LT_PACKAGE_REVISION], [2.4.6])
AC_DEFUN([LTVERSION_VERSION],
-[macro_version='2.4.2'
-macro_revision='1.3337'
+[macro_version='2.4.6'
+macro_revision='2.4.6'
_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
_LT_DECL(, macro_revision, 0)
])
@@ -8525,7 +8969,8 @@
# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*-
#
-# Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
+# Copyright (C) 2004-2005, 2007, 2009, 2011-2015 Free Software
+# Foundation, Inc.
# Written by Scott James Remnant, 2004.
#
# This file is free software; the Free Software Foundation gives
@@ -8536,7 +8981,7 @@
# These exist entirely to fool aclocal when bootstrapping libtool.
#
-# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
+# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN),
# which have later been changed to m4_define as they aren't part of the
# exported API, or moved to Autoconf or Automake where they belong.
#
@@ -8550,7 +8995,7 @@
# included after everything else. This provides aclocal with the
# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
# because those macros already exist, or will be overwritten later.
-# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.
+# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.
#
# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
# Yes, that means every name once taken will need to remain here until
@@ -8622,32 +9067,63 @@
m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])])
m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])])
-# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
-# serial 1 (pkg-config-0.24)
-#
-# Copyright © 2004 Scott James Remnant <scott at netsplit.com>.
-#
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 2 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful, but
-# WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-# General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program; if not, write to the Free Software
-# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-#
-# As a special exception to the GNU General Public License, if you
-# distribute this file as part of a program that contains a
-# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
+dnl pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
+dnl serial 11 (pkg-config-0.29.1)
+dnl
+dnl Copyright © 2004 Scott James Remnant <scott at netsplit.com>.
+dnl Copyright © 2012-2015 Dan Nicholson <dbn.lists at gmail.com>
+dnl
+dnl This program is free software; you can redistribute it and/or modify
+dnl it under the terms of the GNU General Public License as published by
+dnl the Free Software Foundation; either version 2 of the License, or
+dnl (at your option) any later version.
+dnl
+dnl This program is distributed in the hope that it will be useful, but
+dnl WITHOUT ANY WARRANTY; without even the implied warranty of
+dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+dnl General Public License for more details.
+dnl
+dnl You should have received a copy of the GNU General Public License
+dnl along with this program; if not, write to the Free Software
+dnl Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
+dnl 02111-1307, USA.
+dnl
+dnl As a special exception to the GNU General Public License, if you
+dnl distribute this file as part of a program that contains a
+dnl configuration script generated by Autoconf, you may include it under
+dnl the same distribution terms that you use for the rest of that
+dnl program.
-# PKG_PROG_PKG_CONFIG([MIN-VERSION])
-# ----------------------------------
+dnl PKG_PREREQ(MIN-VERSION)
+dnl -----------------------
+dnl Since: 0.29
+dnl
+dnl Verify that the version of the pkg-config macros are at least
+dnl MIN-VERSION. Unlike PKG_PROG_PKG_CONFIG, which checks the user's
+dnl installed version of pkg-config, this checks the developer's version
+dnl of pkg.m4 when generating configure.
+dnl
+dnl To ensure that this macro is defined, also add:
+dnl m4_ifndef([PKG_PREREQ],
+dnl [m4_fatal([must install pkg-config 0.29 or later before running autoconf/autogen])])
+dnl
+dnl See the "Since" comment for each macro you use to see what version
+dnl of the macros you require.
+m4_defun([PKG_PREREQ],
+[m4_define([PKG_MACROS_VERSION], [0.29.1])
+m4_if(m4_version_compare(PKG_MACROS_VERSION, [$1]), -1,
+ [m4_fatal([pkg.m4 version $1 or higher is required but ]PKG_MACROS_VERSION[ found])])
+])dnl PKG_PREREQ
+
+dnl PKG_PROG_PKG_CONFIG([MIN-VERSION])
+dnl ----------------------------------
+dnl Since: 0.16
+dnl
+dnl Search for the pkg-config tool and set the PKG_CONFIG variable to
+dnl first found in the path. Checks that the version of pkg-config found
+dnl is at least MIN-VERSION. If MIN-VERSION is not specified, 0.9.0 is
+dnl used since that's the first version where most current features of
+dnl pkg-config existed.
AC_DEFUN([PKG_PROG_PKG_CONFIG],
[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$])
@@ -8669,18 +9145,19 @@
PKG_CONFIG=""
fi
fi[]dnl
-])# PKG_PROG_PKG_CONFIG
+])dnl PKG_PROG_PKG_CONFIG
-# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
-#
-# Check to see whether a particular set of modules exists. Similar
-# to PKG_CHECK_MODULES(), but does not set variables or print errors.
-#
-# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
-# only at the first occurence in configure.ac, so if the first place
-# it's called might be skipped (such as if it is within an "if", you
-# have to call PKG_CHECK_EXISTS manually
-# --------------------------------------------------------------
+dnl PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+dnl -------------------------------------------------------------------
+dnl Since: 0.18
+dnl
+dnl Check to see whether a particular set of modules exists. Similar to
+dnl PKG_CHECK_MODULES(), but does not set variables or print errors.
+dnl
+dnl Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG])
+dnl only at the first occurence in configure.ac, so if the first place
+dnl it's called might be skipped (such as if it is within an "if", you
+dnl have to call PKG_CHECK_EXISTS manually
AC_DEFUN([PKG_CHECK_EXISTS],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
if test -n "$PKG_CONFIG" && \
@@ -8690,8 +9167,10 @@
$3])dnl
fi])
-# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
-# ---------------------------------------------
+dnl _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
+dnl ---------------------------------------------
+dnl Internal wrapper calling pkg-config via PKG_CONFIG and setting
+dnl pkg_failed based on the result.
m4_define([_PKG_CONFIG],
[if test -n "$$1"; then
pkg_cv_[]$1="$$1"
@@ -8703,10 +9182,11 @@
else
pkg_failed=untried
fi[]dnl
-])# _PKG_CONFIG
+])dnl _PKG_CONFIG
-# _PKG_SHORT_ERRORS_SUPPORTED
-# -----------------------------
+dnl _PKG_SHORT_ERRORS_SUPPORTED
+dnl ---------------------------
+dnl Internal check to see if pkg-config supports short errors.
AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
@@ -8714,19 +9194,17 @@
else
_pkg_short_errors_supported=no
fi[]dnl
-])# _PKG_SHORT_ERRORS_SUPPORTED
+])dnl _PKG_SHORT_ERRORS_SUPPORTED
-# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
-# [ACTION-IF-NOT-FOUND])
-#
-#
-# Note that if there is a possibility the first call to
-# PKG_CHECK_MODULES might not happen, you should be sure to include an
-# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
-#
-#
-# --------------------------------------------------------------
+dnl PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
+dnl [ACTION-IF-NOT-FOUND])
+dnl --------------------------------------------------------------
+dnl Since: 0.4.0
+dnl
+dnl Note that if there is a possibility the first call to
+dnl PKG_CHECK_MODULES might not happen, you should be sure to include an
+dnl explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
AC_DEFUN([PKG_CHECK_MODULES],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
@@ -8780,16 +9258,40 @@
AC_MSG_RESULT([yes])
$3
fi[]dnl
-])# PKG_CHECK_MODULES
+])dnl PKG_CHECK_MODULES
-# PKG_INSTALLDIR(DIRECTORY)
-# -------------------------
-# Substitutes the variable pkgconfigdir as the location where a module
-# should install pkg-config .pc files. By default the directory is
-# $libdir/pkgconfig, but the default can be changed by passing
-# DIRECTORY. The user can override through the --with-pkgconfigdir
-# parameter.
+dnl PKG_CHECK_MODULES_STATIC(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
+dnl [ACTION-IF-NOT-FOUND])
+dnl ---------------------------------------------------------------------
+dnl Since: 0.29
+dnl
+dnl Checks for existence of MODULES and gathers its build flags with
+dnl static libraries enabled. Sets VARIABLE-PREFIX_CFLAGS from --cflags
+dnl and VARIABLE-PREFIX_LIBS from --libs.
+dnl
+dnl Note that if there is a possibility the first call to
+dnl PKG_CHECK_MODULES_STATIC might not happen, you should be sure to
+dnl include an explicit call to PKG_PROG_PKG_CONFIG in your
+dnl configure.ac.
+AC_DEFUN([PKG_CHECK_MODULES_STATIC],
+[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
+_save_PKG_CONFIG=$PKG_CONFIG
+PKG_CONFIG="$PKG_CONFIG --static"
+PKG_CHECK_MODULES($@)
+PKG_CONFIG=$_save_PKG_CONFIG[]dnl
+])dnl PKG_CHECK_MODULES_STATIC
+
+
+dnl PKG_INSTALLDIR([DIRECTORY])
+dnl -------------------------
+dnl Since: 0.27
+dnl
+dnl Substitutes the variable pkgconfigdir as the location where a module
+dnl should install pkg-config .pc files. By default the directory is
+dnl $libdir/pkgconfig, but the default can be changed by passing
+dnl DIRECTORY. The user can override through the --with-pkgconfigdir
+dnl parameter.
AC_DEFUN([PKG_INSTALLDIR],
[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])])
m4_pushdef([pkg_description],
@@ -8800,16 +9302,18 @@
AC_SUBST([pkgconfigdir], [$with_pkgconfigdir])
m4_popdef([pkg_default])
m4_popdef([pkg_description])
-]) dnl PKG_INSTALLDIR
+])dnl PKG_INSTALLDIR
-# PKG_NOARCH_INSTALLDIR(DIRECTORY)
-# -------------------------
-# Substitutes the variable noarch_pkgconfigdir as the location where a
-# module should install arch-independent pkg-config .pc files. By
-# default the directory is $datadir/pkgconfig, but the default can be
-# changed by passing DIRECTORY. The user can override through the
-# --with-noarch-pkgconfigdir parameter.
+dnl PKG_NOARCH_INSTALLDIR([DIRECTORY])
+dnl --------------------------------
+dnl Since: 0.27
+dnl
+dnl Substitutes the variable noarch_pkgconfigdir as the location where a
+dnl module should install arch-independent pkg-config .pc files. By
+dnl default the directory is $datadir/pkgconfig, but the default can be
+dnl changed by passing DIRECTORY. The user can override through the
+dnl --with-noarch-pkgconfigdir parameter.
AC_DEFUN([PKG_NOARCH_INSTALLDIR],
[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])])
m4_pushdef([pkg_description],
@@ -8820,13 +9324,15 @@
AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir])
m4_popdef([pkg_default])
m4_popdef([pkg_description])
-]) dnl PKG_NOARCH_INSTALLDIR
+])dnl PKG_NOARCH_INSTALLDIR
-# PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
-# [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
-# -------------------------------------------
-# Retrieves the value of the pkg-config variable for the given module.
+dnl PKG_CHECK_VAR(VARIABLE, MODULE, CONFIG-VARIABLE,
+dnl [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
+dnl -------------------------------------------
+dnl Since: 0.28
+dnl
+dnl Retrieves the value of the pkg-config variable for the given module.
AC_DEFUN([PKG_CHECK_VAR],
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
AC_ARG_VAR([$1], [value of $3 for $2, overriding pkg-config])dnl
@@ -8835,7 +9341,7 @@
AS_VAR_COPY([$1], [pkg_cv_][$1])
AS_VAR_IF([$1], [""], [$5], [$4])dnl
-])# PKG_CHECK_VAR
+])dnl PKG_CHECK_VAR
# Copyright (C) 2002-2014 Free Software Foundation, Inc.
#
@@ -9462,6 +9968,42 @@
rmdir .tst 2>/dev/null
AC_SUBST([am__leading_dot])])
+# Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
+# From Jim Meyering
+
+# Copyright (C) 1996-2014 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_MAINTAINER_MODE([DEFAULT-MODE])
+# ----------------------------------
+# Control maintainer-specific portions of Makefiles.
+# Default is to disable them, unless 'enable' is passed literally.
+# For symmetry, 'disable' may be passed as well. Anyway, the user
+# can override the default with the --enable/--disable switch.
+AC_DEFUN([AM_MAINTAINER_MODE],
+[m4_case(m4_default([$1], [disable]),
+ [enable], [m4_define([am_maintainer_other], [disable])],
+ [disable], [m4_define([am_maintainer_other], [enable])],
+ [m4_define([am_maintainer_other], [enable])
+ m4_warn([syntax], [unexpected argument to AM@&t at _MAINTAINER_MODE: $1])])
+AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
+ dnl maintainer-mode's default is 'disable' unless 'enable' is passed
+ AC_ARG_ENABLE([maintainer-mode],
+ [AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode],
+ am_maintainer_other[ make rules and dependencies not useful
+ (and sometimes confusing) to the casual installer])],
+ [USE_MAINTAINER_MODE=$enableval],
+ [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
+ AC_MSG_RESULT([$USE_MAINTAINER_MODE])
+ AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
+ MAINT=$MAINTAINER_MODE_TRUE
+ AC_SUBST([MAINT])dnl
+]
+)
+
# Check to see how 'make' treats includes. -*- Autoconf -*-
# Copyright (C) 2001-2014 Free Software Foundation, Inc.
Modified: trunk/contrib/libarchive/build/autoconf/config.guess
===================================================================
--- trunk/contrib/libarchive/build/autoconf/config.guess 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/build/autoconf/config.guess 2018-06-19 20:42:35 UTC (rev 11134)
@@ -1,8 +1,8 @@
#! /bin/sh
# Attempt to guess a canonical system name.
-# Copyright 1992-2016 Free Software Foundation, Inc.
+# Copyright 1992-2017 Free Software Foundation, Inc.
-timestamp='2016-05-15'
+timestamp='2017-05-27'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@@ -50,7 +50,7 @@
GNU config.guess ($timestamp)
Originally written by Per Bothner.
-Copyright 1992-2016 Free Software Foundation, Inc.
+Copyright 1992-2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -837,10 +837,11 @@
UNAME_PROCESSOR=`/usr/bin/uname -p`
case ${UNAME_PROCESSOR} in
amd64)
- echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
- *)
- echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+ UNAME_PROCESSOR=x86_64 ;;
+ i386)
+ UNAME_PROCESSOR=i586 ;;
esac
+ echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
exit ;;
i*:CYGWIN*:*)
echo ${UNAME_MACHINE}-pc-cygwin
@@ -1000,6 +1001,9 @@
eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; }
;;
+ mips64el:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
openrisc*:Linux:*:*)
echo or1k-unknown-linux-${LIBC}
exit ;;
@@ -1032,6 +1036,9 @@
ppcle:Linux:*:*)
echo powerpcle-unknown-linux-${LIBC}
exit ;;
+ riscv32:Linux:*:* | riscv64:Linux:*:*)
+ echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+ exit ;;
s390:Linux:*:* | s390x:Linux:*:*)
echo ${UNAME_MACHINE}-ibm-linux-${LIBC}
exit ;;
@@ -1297,8 +1304,8 @@
if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then
if [ "$CC_FOR_BUILD" != no_compiler_found ]; then
if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
- (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
- grep IS_64BIT_ARCH >/dev/null
+ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
+ grep IS_64BIT_ARCH >/dev/null
then
case $UNAME_PROCESSOR in
i386) UNAME_PROCESSOR=x86_64 ;;
@@ -1305,6 +1312,13 @@
powerpc) UNAME_PROCESSOR=powerpc64 ;;
esac
fi
+ # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc
+ if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \
+ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
+ grep IS_PPC >/dev/null
+ then
+ UNAME_PROCESSOR=powerpc
+ fi
fi
elif test "$UNAME_PROCESSOR" = i386 ; then
# Avoid executing cc on OS X 10.9, as it ships with a stub
@@ -1328,15 +1342,18 @@
*:QNX:*:4*)
echo i386-pc-qnx
exit ;;
- NEO-?:NONSTOP_KERNEL:*:*)
+ NEO-*:NONSTOP_KERNEL:*:*)
echo neo-tandem-nsk${UNAME_RELEASE}
exit ;;
NSE-*:NONSTOP_KERNEL:*:*)
echo nse-tandem-nsk${UNAME_RELEASE}
exit ;;
- NSR-?:NONSTOP_KERNEL:*:*)
+ NSR-*:NONSTOP_KERNEL:*:*)
echo nsr-tandem-nsk${UNAME_RELEASE}
exit ;;
+ NSX-*:NONSTOP_KERNEL:*:*)
+ echo nsx-tandem-nsk${UNAME_RELEASE}
+ exit ;;
*:NonStop-UX:*:*)
echo mips-compaq-nonstopux
exit ;;
Modified: trunk/contrib/libarchive/build/autoconf/config.rpath
===================================================================
--- trunk/contrib/libarchive/build/autoconf/config.rpath 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/build/autoconf/config.rpath 2018-06-19 20:42:35 UTC (rev 11134)
@@ -63,7 +63,7 @@
aix*)
wl='-Wl,'
;;
- mingw* | cygwin* | pw32* | os2* | cegcc*)
+ mingw* | cygwin* | msys* | pw32* | os2* | cegcc*)
;;
hpux9* | hpux10* | hpux11*)
wl='-Wl,'
@@ -155,7 +155,7 @@
hardcode_minus_L=no
case "$host_os" in
- cygwin* | mingw* | pw32* | cegcc*)
+ cygwin* | msys* | mingw* | pw32* | cegcc*)
# FIXME: the MSVC++ port hasn't been tested in a loooong time
# When not using gcc, we currently assume that we are using
# Microsoft Visual C++.
@@ -204,7 +204,7 @@
ld_shlibs=no
fi
;;
- cygwin* | mingw* | pw32* | cegcc*)
+ cygwin* | msys* | mingw* | pw32* | cegcc*)
# hardcode_libdir_flag_spec is actually meaningless, as there is
# no search path for DLLs.
hardcode_libdir_flag_spec='-L$libdir'
@@ -354,7 +354,7 @@
;;
bsdi[45]*)
;;
- cygwin* | mingw* | pw32* | cegcc*)
+ cygwin* | msys* | mingw* | pw32* | cegcc*)
# When not using gcc, we currently assume that we are using
# Microsoft Visual C++.
# hardcode_libdir_flag_spec is actually meaningless, as there is
@@ -543,7 +543,7 @@
bsdi[45]*)
library_names_spec='$libname$shrext'
;;
- cygwin* | mingw* | pw32* | cegcc*)
+ cygwin* | msys* | mingw* | pw32* | cegcc*)
shrext=.dll
library_names_spec='$libname.dll.a $libname.lib'
;;
Modified: trunk/contrib/libarchive/build/autoconf/config.sub
===================================================================
--- trunk/contrib/libarchive/build/autoconf/config.sub 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/build/autoconf/config.sub 2018-06-19 20:42:35 UTC (rev 11134)
@@ -1,8 +1,8 @@
#! /bin/sh
# Configuration validation subroutine script.
-# Copyright 1992-2016 Free Software Foundation, Inc.
+# Copyright 1992-2017 Free Software Foundation, Inc.
-timestamp='2016-06-20'
+timestamp='2017-04-02'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
@@ -67,7 +67,7 @@
version="\
GNU config.sub ($timestamp)
-Copyright 1992-2016 Free Software Foundation, Inc.
+Copyright 1992-2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
@@ -117,7 +117,7 @@
nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \
- kopensolaris*-gnu* | \
+ kopensolaris*-gnu* | cloudabi*-eabi* | \
storm-chaos* | os2-emx* | rtmk-nova*)
os=-$maybe_os
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
@@ -263,7 +263,7 @@
| fido | fr30 | frv | ft32 \
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
| hexagon \
- | i370 | i860 | i960 | ia64 \
+ | i370 | i860 | i960 | ia16 | ia64 \
| ip2k | iq2000 \
| k1om \
| le32 | le64 \
@@ -301,6 +301,7 @@
| open8 | or1k | or1knd | or32 \
| pdp10 | pdp11 | pj | pjl \
| powerpc | powerpc64 | powerpc64le | powerpcle \
+ | pru \
| pyramid \
| riscv32 | riscv64 \
| rl78 | rx \
@@ -314,6 +315,7 @@
| ubicom32 \
| v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
| visium \
+ | wasm32 \
| we32k \
| x86 | xc16x | xstormy16 | xtensa \
| z8k | z80)
@@ -387,7 +389,7 @@
| h8300-* | h8500-* \
| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
| hexagon-* \
- | i*86-* | i860-* | i960-* | ia64-* \
+ | i*86-* | i860-* | i960-* | ia16-* | ia64-* \
| ip2k-* | iq2000-* \
| k1om-* \
| le32-* | le64-* \
@@ -428,6 +430,7 @@
| orion-* \
| pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
+ | pru-* \
| pyramid-* \
| riscv32-* | riscv64-* \
| rl78-* | romp-* | rs6000-* | rx-* \
@@ -444,6 +447,7 @@
| v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
| vax-* \
| visium-* \
+ | wasm32-* \
| we32k-* \
| x86-* | x86_64-* | xc16x-* | xps100-* \
| xstormy16-* | xtensa*-* \
@@ -946,6 +950,9 @@
nsr-tandem)
basic_machine=nsr-tandem
;;
+ nsx-tandem)
+ basic_machine=nsx-tandem
+ ;;
op50n-* | op60c-*)
basic_machine=hppa1.1-oki
os=-proelf
@@ -1030,7 +1037,7 @@
ppc-* | ppcbe-*)
basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
- ppcle | powerpclittle | ppc-le | powerpc-little)
+ ppcle | powerpclittle)
basic_machine=powerpcle-unknown
;;
ppcle-* | powerpclittle-*)
@@ -1040,7 +1047,7 @@
;;
ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
- ppc64le | powerpc64little | ppc64-le | powerpc64-little)
+ ppc64le | powerpc64little)
basic_machine=powerpc64le-unknown
;;
ppc64le-* | powerpc64little-*)
@@ -1241,6 +1248,9 @@
basic_machine=a29k-wrs
os=-vxworks
;;
+ wasm32)
+ basic_machine=wasm32-unknown
+ ;;
w65*)
basic_machine=w65-wdc
os=-none
@@ -1395,7 +1405,7 @@
| -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
| -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
- | -chorusos* | -chorusrdb* | -cegcc* \
+ | -chorusos* | -chorusrdb* | -cegcc* | -glidix* \
| -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
| -midipix* | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \
| -linux-newlib* | -linux-musl* | -linux-uclibc* \
@@ -1407,7 +1417,7 @@
| -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
| -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
| -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* \
- | -onefs* | -tirtos* | -phoenix*)
+ | -onefs* | -tirtos* | -phoenix* | -fuchsia* | -redox*)
# Remember, each alternative MUST END IN *, to match a version number.
;;
-qnx*)
@@ -1636,6 +1646,9 @@
sparc-* | *-sun)
os=-sunos4.1.1
;;
+ pru-*)
+ os=-elf
+ ;;
*-be)
os=-beos
;;
Modified: trunk/contrib/libarchive/build/autoconf/install-sh
===================================================================
--- trunk/contrib/libarchive/build/autoconf/install-sh 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/build/autoconf/install-sh 2018-06-19 20:42:35 UTC (rev 11134)
@@ -1,7 +1,7 @@
#!/bin/sh
# install - install a program, script, or datafile
-scriptversion=2013-12-25.23; # UTC
+scriptversion=2014-09-12.12; # UTC
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
@@ -324,11 +324,17 @@
# is incompatible with FreeBSD 'install' when (umask & 300) != 0.
;;
*)
+ # $RANDOM is not portable (e.g. dash); use it when possible to
+ # lower collision chance
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
- trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
+ trap 'ret=$?; rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null; exit $ret' 0
+ # As "mkdir -p" follows symlinks and we work in /tmp possibly; so
+ # create the $tmpdir first (and fail if unsuccessful) to make sure
+ # that nobody tries to guess the $tmpdir name.
if (umask $mkdir_umask &&
- exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
+ $mkdirprog $mkdir_mode "$tmpdir" &&
+ exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1
then
if test -z "$dir_arg" || {
# Check for POSIX incompatibilities with -m.
@@ -335,23 +341,24 @@
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
# other-writable bit of parent directory when it shouldn't.
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
- ls_ld_tmpdir=`ls -ld "$tmpdir"`
+ test_tmpdir="$tmpdir/a"
+ ls_ld_tmpdir=`ls -ld "$test_tmpdir"`
case $ls_ld_tmpdir in
d????-?r-*) different_mode=700;;
d????-?--*) different_mode=755;;
*) false;;
esac &&
- $mkdirprog -m$different_mode -p -- "$tmpdir" && {
- ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
+ $mkdirprog -m$different_mode -p -- "$test_tmpdir" && {
+ ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"`
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
}
}
then posix_mkdir=:
fi
- rmdir "$tmpdir/d" "$tmpdir"
+ rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir"
else
# Remove any dirs left behind by ancient mkdir implementations.
- rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
+ rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null
fi
trap '' 0;;
esac;;
Modified: trunk/contrib/libarchive/build/autoconf/ltmain.sh
===================================================================
--- trunk/contrib/libarchive/build/autoconf/ltmain.sh 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/build/autoconf/ltmain.sh 2018-06-19 20:42:35 UTC (rev 11134)
@@ -1,9 +1,12 @@
+#! /bin/sh
+## DO NOT EDIT - This file generated from ./build-aux/ltmain.in
+## by inline-source v2014-01-03.01
-# libtool (GNU libtool) 2.4.2
+# libtool (GNU libtool) 2.4.6
+# Provide generalized library-building support services.
# Written by Gordon Matzigkeit <gord at gnu.ai.mit.edu>, 1996
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
-# 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
+# Copyright (C) 1996-2015 Free Software Foundation, Inc.
# This is free software; see the source for copying conditions. There is NO
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
@@ -23,438 +26,709 @@
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with GNU Libtool; see the file COPYING. If not, a copy
-# can be downloaded from http://www.gnu.org/licenses/gpl.html,
-# or obtained by writing to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
-# Usage: $progname [OPTION]... [MODE-ARG]...
-#
-# Provide generalized library-building support services.
-#
-# --config show all configuration variables
-# --debug enable verbose shell tracing
-# -n, --dry-run display commands without modifying any files
-# --features display basic configuration information and exit
-# --mode=MODE use operation mode MODE
-# --preserve-dup-deps don't remove duplicate dependency libraries
-# --quiet, --silent don't print informational messages
-# --no-quiet, --no-silent
-# print informational messages (default)
-# --no-warn don't display warning messages
-# --tag=TAG use configuration variables from tag TAG
-# -v, --verbose print more informational messages than default
-# --no-verbose don't print the extra informational messages
-# --version print version information
-# -h, --help, --help-all print short, long, or detailed help message
-#
-# MODE must be one of the following:
-#
-# clean remove files from the build directory
-# compile compile a source file into a libtool object
-# execute automatically set library path, then run a program
-# finish complete the installation of libtool libraries
-# install install libraries or executables
-# link create a library or an executable
-# uninstall remove libraries from an installed directory
-#
-# MODE-ARGS vary depending on the MODE. When passed as first option,
-# `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that.
-# Try `$progname --help --mode=MODE' for a more detailed description of MODE.
-#
-# When reporting a bug, please describe a test case to reproduce it and
-# include the following information:
-#
-# host-triplet: $host
-# shell: $SHELL
-# compiler: $LTCC
-# compiler flags: $LTCFLAGS
-# linker: $LD (gnu? $with_gnu_ld)
-# $progname: (GNU libtool) 2.4.2 Debian-2.4.2-1.11
-# automake: $automake_version
-# autoconf: $autoconf_version
-#
-# Report bugs to <bug-libtool at gnu.org>.
-# GNU libtool home page: <http://www.gnu.org/software/libtool/>.
-# General help using GNU software: <http://www.gnu.org/gethelp/>.
PROGRAM=libtool
PACKAGE=libtool
-VERSION="2.4.2 Debian-2.4.2-1.11"
-TIMESTAMP=""
-package_revision=1.3337
+VERSION="2.4.6 Debian-2.4.6-1"
+package_revision=2.4.6
-# Be Bourne compatible
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+
+## ------ ##
+## Usage. ##
+## ------ ##
+
+# Run './libtool --help' for help with using this script from the
+# command line.
+
+
+## ------------------------------- ##
+## User overridable command paths. ##
+## ------------------------------- ##
+
+# After configure completes, it has a better idea of some of the
+# shell tools we need than the defaults used by the functions shared
+# with bootstrap, so set those here where they can still be over-
+# ridden by the user, but otherwise take precedence.
+
+: ${AUTOCONF="autoconf"}
+: ${AUTOMAKE="automake"}
+
+
+## -------------------------- ##
+## Source external libraries. ##
+## -------------------------- ##
+
+# Much of our low-level functionality needs to be sourced from external
+# libraries, which are installed to $pkgauxdir.
+
+# Set a version string for this script.
+scriptversion=2015-01-20.17; # UTC
+
+# General shell script boiler plate, and helper functions.
+# Written by Gary V. Vaughan, 2004
+
+# Copyright (C) 2004-2015 Free Software Foundation, Inc.
+# This is free software; see the source for copying conditions. There is NO
+# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+
+# As a special exception to the GNU General Public License, if you distribute
+# this file as part of a program or library that is built using GNU Libtool,
+# you may include this file under the same distribution terms that you use
+# for the rest of that program.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNES FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# Please report bugs or propose patches to gary at gnu.org.
+
+
+## ------ ##
+## Usage. ##
+## ------ ##
+
+# Evaluate this file near the top of your script to gain access to
+# the functions and variables defined here:
+#
+# . `echo "$0" | ${SED-sed} 's|[^/]*$||'`/build-aux/funclib.sh
+#
+# If you need to override any of the default environment variable
+# settings, do that before evaluating this file.
+
+
+## -------------------- ##
+## Shell normalisation. ##
+## -------------------- ##
+
+# Some shells need a little help to be as Bourne compatible as possible.
+# Before doing anything else, make sure all that help has been provided!
+
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
emulate sh
NULLCMD=:
- # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+ # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
# is contrary to our usage. Disable this feature.
alias -g '${1+"$@"}'='"$@"'
setopt NO_GLOB_SUBST
else
- case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
+ case `(set -o) 2>/dev/null` in *posix*) set -o posix ;; esac
fi
-BIN_SH=xpg4; export BIN_SH # for Tru64
-DUALCASE=1; export DUALCASE # for MKS sh
-# A function that is used when there is no print builtin or printf.
-func_fallback_echo ()
-{
- eval 'cat <<_LTECHO_EOF
-$1
-_LTECHO_EOF'
-}
-
-# NLS nuisances: We save the old values to restore during execute mode.
-lt_user_locale=
-lt_safe_locale=
-for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
+# NLS nuisances: We save the old values in case they are required later.
+_G_user_locale=
+_G_safe_locale=
+for _G_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
do
- eval "if test \"\${$lt_var+set}\" = set; then
- save_$lt_var=\$$lt_var
- $lt_var=C
- export $lt_var
- lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\"
- lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\"
+ eval "if test set = \"\${$_G_var+set}\"; then
+ save_$_G_var=\$$_G_var
+ $_G_var=C
+ export $_G_var
+ _G_user_locale=\"$_G_var=\\\$save_\$_G_var; \$_G_user_locale\"
+ _G_safe_locale=\"$_G_var=C; \$_G_safe_locale\"
fi"
done
-LC_ALL=C
-LANGUAGE=C
-export LANGUAGE LC_ALL
-$lt_unset CDPATH
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+# Make sure IFS has a sensible default
+sp=' '
+nl='
+'
+IFS="$sp $nl"
-# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
-# is ksh but when the shell is invoked as "sh" and the current value of
-# the _XPG environment variable is not equal to 1 (one), the special
-# positional parameter $0, within a function call, is the name of the
-# function.
-progpath="$0"
+# There are apparently some retarded systems that use ';' as a PATH separator!
+if test "${PATH_SEPARATOR+set}" != set; then
+ PATH_SEPARATOR=:
+ (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+ (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+ PATH_SEPARATOR=';'
+ }
+fi
+## ------------------------- ##
+## Locate command utilities. ##
+## ------------------------- ##
+
+
+# func_executable_p FILE
+# ----------------------
+# Check that FILE is an executable regular file.
+func_executable_p ()
+{
+ test -f "$1" && test -x "$1"
+}
+
+
+# func_path_progs PROGS_LIST CHECK_FUNC [PATH]
+# --------------------------------------------
+# Search for either a program that responds to --version with output
+# containing "GNU", or else returned by CHECK_FUNC otherwise, by
+# trying all the directories in PATH with each of the elements of
+# PROGS_LIST.
+#
+# CHECK_FUNC should accept the path to a candidate program, and
+# set $func_check_prog_result if it truncates its output less than
+# $_G_path_prog_max characters.
+func_path_progs ()
+{
+ _G_progs_list=$1
+ _G_check_func=$2
+ _G_PATH=${3-"$PATH"}
+
+ _G_path_prog_max=0
+ _G_path_prog_found=false
+ _G_save_IFS=$IFS; IFS=${PATH_SEPARATOR-:}
+ for _G_dir in $_G_PATH; do
+ IFS=$_G_save_IFS
+ test -z "$_G_dir" && _G_dir=.
+ for _G_prog_name in $_G_progs_list; do
+ for _exeext in '' .EXE; do
+ _G_path_prog=$_G_dir/$_G_prog_name$_exeext
+ func_executable_p "$_G_path_prog" || continue
+ case `"$_G_path_prog" --version 2>&1` in
+ *GNU*) func_path_progs_result=$_G_path_prog _G_path_prog_found=: ;;
+ *) $_G_check_func $_G_path_prog
+ func_path_progs_result=$func_check_prog_result
+ ;;
+ esac
+ $_G_path_prog_found && break 3
+ done
+ done
+ done
+ IFS=$_G_save_IFS
+ test -z "$func_path_progs_result" && {
+ echo "no acceptable sed could be found in \$PATH" >&2
+ exit 1
+ }
+}
+
+
+# We want to be able to use the functions in this file before configure
+# has figured out where the best binaries are kept, which means we have
+# to search for them ourselves - except when the results are already set
+# where we skip the searches.
+
+# Unless the user overrides by setting SED, search the path for either GNU
+# sed, or the sed that truncates its output the least.
+test -z "$SED" && {
+ _G_sed_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
+ for _G_i in 1 2 3 4 5 6 7; do
+ _G_sed_script=$_G_sed_script$nl$_G_sed_script
+ done
+ echo "$_G_sed_script" 2>/dev/null | sed 99q >conftest.sed
+ _G_sed_script=
+
+ func_check_prog_sed ()
+ {
+ _G_path_prog=$1
+
+ _G_count=0
+ printf 0123456789 >conftest.in
+ while :
+ do
+ cat conftest.in conftest.in >conftest.tmp
+ mv conftest.tmp conftest.in
+ cp conftest.in conftest.nl
+ echo '' >> conftest.nl
+ "$_G_path_prog" -f conftest.sed <conftest.nl >conftest.out 2>/dev/null || break
+ diff conftest.out conftest.nl >/dev/null 2>&1 || break
+ _G_count=`expr $_G_count + 1`
+ if test "$_G_count" -gt "$_G_path_prog_max"; then
+ # Best one so far, save it but keep looking for a better one
+ func_check_prog_result=$_G_path_prog
+ _G_path_prog_max=$_G_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test 10 -lt "$_G_count" && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out
+ }
+
+ func_path_progs "sed gsed" func_check_prog_sed $PATH:/usr/xpg4/bin
+ rm -f conftest.sed
+ SED=$func_path_progs_result
+}
+
+
+# Unless the user overrides by setting GREP, search the path for either GNU
+# grep, or the grep that truncates its output the least.
+test -z "$GREP" && {
+ func_check_prog_grep ()
+ {
+ _G_path_prog=$1
+
+ _G_count=0
+ _G_path_prog_max=0
+ printf 0123456789 >conftest.in
+ while :
+ do
+ cat conftest.in conftest.in >conftest.tmp
+ mv conftest.tmp conftest.in
+ cp conftest.in conftest.nl
+ echo 'GREP' >> conftest.nl
+ "$_G_path_prog" -e 'GREP$' -e '-(cannot match)-' <conftest.nl >conftest.out 2>/dev/null || break
+ diff conftest.out conftest.nl >/dev/null 2>&1 || break
+ _G_count=`expr $_G_count + 1`
+ if test "$_G_count" -gt "$_G_path_prog_max"; then
+ # Best one so far, save it but keep looking for a better one
+ func_check_prog_result=$_G_path_prog
+ _G_path_prog_max=$_G_count
+ fi
+ # 10*(2^10) chars as input seems more than enough
+ test 10 -lt "$_G_count" && break
+ done
+ rm -f conftest.in conftest.tmp conftest.nl conftest.out
+ }
+
+ func_path_progs "grep ggrep" func_check_prog_grep $PATH:/usr/xpg4/bin
+ GREP=$func_path_progs_result
+}
+
+
+## ------------------------------- ##
+## User overridable command paths. ##
+## ------------------------------- ##
+
+# All uppercase variable names are used for environment variables. These
+# variables can be overridden by the user before calling a script that
+# uses them if a suitable command of that name is not already available
+# in the command search PATH.
+
: ${CP="cp -f"}
-test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'}
+: ${ECHO="printf %s\n"}
+: ${EGREP="$GREP -E"}
+: ${FGREP="$GREP -F"}
+: ${LN_S="ln -s"}
: ${MAKE="make"}
: ${MKDIR="mkdir"}
: ${MV="mv -f"}
: ${RM="rm -f"}
: ${SHELL="${CONFIG_SHELL-/bin/sh}"}
-: ${Xsed="$SED -e 1s/^X//"}
-# Global variables:
-EXIT_SUCCESS=0
-EXIT_FAILURE=1
-EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing.
-EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake.
-exit_status=$EXIT_SUCCESS
+## -------------------- ##
+## Useful sed snippets. ##
+## -------------------- ##
-# Make sure IFS has a sensible default
-lt_nl='
-'
-IFS=" $lt_nl"
+sed_dirname='s|/[^/]*$||'
+sed_basename='s|^.*/||'
-dirname="s,/[^/]*$,,"
-basename="s,^.*/,,"
+# Sed substitution that helps us do robust quoting. It backslashifies
+# metacharacters that are still active within double-quoted strings.
+sed_quote_subst='s|\([`"$\\]\)|\\\1|g'
-# func_dirname file append nondir_replacement
-# Compute the dirname of FILE. If nonempty, add APPEND to the result,
-# otherwise set result to NONDIR_REPLACEMENT.
-func_dirname ()
-{
- func_dirname_result=`$ECHO "${1}" | $SED "$dirname"`
- if test "X$func_dirname_result" = "X${1}"; then
- func_dirname_result="${3}"
- else
- func_dirname_result="$func_dirname_result${2}"
- fi
-} # func_dirname may be replaced by extended shell implementation
+# Same as above, but do not quote variable references.
+sed_double_quote_subst='s/\(["`\\]\)/\\\1/g'
+# Sed substitution that turns a string into a regex matching for the
+# string literally.
+sed_make_literal_regex='s|[].[^$\\*\/]|\\&|g'
-# func_basename file
-func_basename ()
-{
- func_basename_result=`$ECHO "${1}" | $SED "$basename"`
-} # func_basename may be replaced by extended shell implementation
+# Sed substitution that converts a w32 file name or path
+# that contains forward slashes, into one that contains
+# (escaped) backslashes. A very naive implementation.
+sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
+# Re-'\' parameter expansions in output of sed_double_quote_subst that
+# were '\'-ed in input to the same. If an odd number of '\' preceded a
+# '$' in input to sed_double_quote_subst, that '$' was protected from
+# expansion. Since each input '\' is now two '\'s, look for any number
+# of runs of four '\'s followed by two '\'s and then a '$'. '\' that '$'.
+_G_bs='\\'
+_G_bs2='\\\\'
+_G_bs4='\\\\\\\\'
+_G_dollar='\$'
+sed_double_backslash="\
+ s/$_G_bs4/&\\
+/g
+ s/^$_G_bs2$_G_dollar/$_G_bs&/
+ s/\\([^$_G_bs]\\)$_G_bs2$_G_dollar/\\1$_G_bs2$_G_bs$_G_dollar/g
+ s/\n//g"
-# func_dirname_and_basename file append nondir_replacement
-# perform func_basename and func_dirname in a single function
-# call:
-# dirname: Compute the dirname of FILE. If nonempty,
-# add APPEND to the result, otherwise set result
-# to NONDIR_REPLACEMENT.
-# value returned in "$func_dirname_result"
-# basename: Compute filename of FILE.
-# value retuned in "$func_basename_result"
-# Implementation must be kept synchronized with func_dirname
-# and func_basename. For efficiency, we do not delegate to
-# those functions but instead duplicate the functionality here.
-func_dirname_and_basename ()
-{
- # Extract subdirectory from the argument.
- func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"`
- if test "X$func_dirname_result" = "X${1}"; then
- func_dirname_result="${3}"
- else
- func_dirname_result="$func_dirname_result${2}"
- fi
- func_basename_result=`$ECHO "${1}" | $SED -e "$basename"`
-} # func_dirname_and_basename may be replaced by extended shell implementation
+## ----------------- ##
+## Global variables. ##
+## ----------------- ##
-# func_stripname prefix suffix name
-# strip PREFIX and SUFFIX off of NAME.
-# PREFIX and SUFFIX must not contain globbing or regex special
-# characters, hashes, percent signs, but SUFFIX may contain a leading
-# dot (in which case that matches only a dot).
-# func_strip_suffix prefix name
-func_stripname ()
-{
- case ${2} in
- .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
- *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
- esac
-} # func_stripname may be replaced by extended shell implementation
+# Except for the global variables explicitly listed below, the following
+# functions in the '^func_' namespace, and the '^require_' namespace
+# variables initialised in the 'Resource management' section, sourcing
+# this file will not pollute your global namespace with anything
+# else. There's no portable way to scope variables in Bourne shell
+# though, so actually running these functions will sometimes place
+# results into a variable named after the function, and often use
+# temporary variables in the '^_G_' namespace. If you are careful to
+# avoid using those namespaces casually in your sourcing script, things
+# should continue to work as you expect. And, of course, you can freely
+# overwrite any of the functions or variables defined here before
+# calling anything to customize them.
+EXIT_SUCCESS=0
+EXIT_FAILURE=1
+EXIT_MISMATCH=63 # $? = 63 is used to indicate version mismatch to missing.
+EXIT_SKIP=77 # $? = 77 is used to indicate a skipped test to automake.
-# These SED scripts presuppose an absolute path with a trailing slash.
-pathcar='s,^/\([^/]*\).*$,\1,'
-pathcdr='s,^/[^/]*,,'
-removedotparts=':dotsl
- s@/\./@/@g
- t dotsl
- s,/\.$,/,'
-collapseslashes='s@/\{1,\}@/@g'
-finalslash='s,/*$,/,'
+# Allow overriding, eg assuming that you follow the convention of
+# putting '$debug_cmd' at the start of all your functions, you can get
+# bash to show function call trace with:
+#
+# debug_cmd='eval echo "${FUNCNAME[0]} $*" >&2' bash your-script-name
+debug_cmd=${debug_cmd-":"}
+exit_cmd=:
-# func_normal_abspath PATH
-# Remove doubled-up and trailing slashes, "." path components,
-# and cancel out any ".." path components in PATH after making
-# it an absolute path.
-# value returned in "$func_normal_abspath_result"
-func_normal_abspath ()
-{
- # Start from root dir and reassemble the path.
- func_normal_abspath_result=
- func_normal_abspath_tpath=$1
- func_normal_abspath_altnamespace=
- case $func_normal_abspath_tpath in
- "")
- # Empty path, that just means $cwd.
- func_stripname '' '/' "`pwd`"
- func_normal_abspath_result=$func_stripname_result
- return
- ;;
- # The next three entries are used to spot a run of precisely
- # two leading slashes without using negated character classes;
- # we take advantage of case's first-match behaviour.
- ///*)
- # Unusual form of absolute path, do nothing.
- ;;
- //*)
- # Not necessarily an ordinary path; POSIX reserves leading '//'
- # and for example Cygwin uses it to access remote file shares
- # over CIFS/SMB, so we conserve a leading double slash if found.
- func_normal_abspath_altnamespace=/
- ;;
- /*)
- # Absolute path, do nothing.
- ;;
- *)
- # Relative path, prepend $cwd.
- func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
- ;;
- esac
- # Cancel out all the simple stuff to save iterations. We also want
- # the path to end with a slash for ease of parsing, so make sure
- # there is one (and only one) here.
- func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
- -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"`
- while :; do
- # Processed it all yet?
- if test "$func_normal_abspath_tpath" = / ; then
- # If we ascended to the root using ".." the result may be empty now.
- if test -z "$func_normal_abspath_result" ; then
- func_normal_abspath_result=/
- fi
- break
- fi
- func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \
- -e "$pathcar"`
- func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
- -e "$pathcdr"`
- # Figure out what to do with it
- case $func_normal_abspath_tcomponent in
- "")
- # Trailing empty path component, ignore it.
- ;;
- ..)
- # Parent dir; strip last assembled component from result.
- func_dirname "$func_normal_abspath_result"
- func_normal_abspath_result=$func_dirname_result
- ;;
- *)
- # Actual path component, append it.
- func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent
- ;;
- esac
- done
- # Restore leading double-slash if one was found on entry.
- func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result
-}
+# By convention, finish your script with:
+#
+# exit $exit_status
+#
+# so that you can set exit_status to non-zero if you want to indicate
+# something went wrong during execution without actually bailing out at
+# the point of failure.
+exit_status=$EXIT_SUCCESS
-# func_relative_path SRCDIR DSTDIR
-# generates a relative path from SRCDIR to DSTDIR, with a trailing
-# slash if non-empty, suitable for immediately appending a filename
-# without needing to append a separator.
-# value returned in "$func_relative_path_result"
-func_relative_path ()
-{
- func_relative_path_result=
- func_normal_abspath "$1"
- func_relative_path_tlibdir=$func_normal_abspath_result
- func_normal_abspath "$2"
- func_relative_path_tbindir=$func_normal_abspath_result
+# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
+# is ksh but when the shell is invoked as "sh" and the current value of
+# the _XPG environment variable is not equal to 1 (one), the special
+# positional parameter $0, within a function call, is the name of the
+# function.
+progpath=$0
- # Ascend the tree starting from libdir
- while :; do
- # check if we have found a prefix of bindir
- case $func_relative_path_tbindir in
- $func_relative_path_tlibdir)
- # found an exact match
- func_relative_path_tcancelled=
- break
- ;;
- $func_relative_path_tlibdir*)
- # found a matching prefix
- func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"
- func_relative_path_tcancelled=$func_stripname_result
- if test -z "$func_relative_path_result"; then
- func_relative_path_result=.
- fi
- break
- ;;
- *)
- func_dirname $func_relative_path_tlibdir
- func_relative_path_tlibdir=${func_dirname_result}
- if test "x$func_relative_path_tlibdir" = x ; then
- # Have to descend all the way to the root!
- func_relative_path_result=../$func_relative_path_result
- func_relative_path_tcancelled=$func_relative_path_tbindir
- break
- fi
- func_relative_path_result=../$func_relative_path_result
- ;;
- esac
- done
+# The name of this program.
+progname=`$ECHO "$progpath" |$SED "$sed_basename"`
- # Now calculate path; take care to avoid doubling-up slashes.
- func_stripname '' '/' "$func_relative_path_result"
- func_relative_path_result=$func_stripname_result
- func_stripname '/' '/' "$func_relative_path_tcancelled"
- if test "x$func_stripname_result" != x ; then
- func_relative_path_result=${func_relative_path_result}/${func_stripname_result}
- fi
-
- # Normalisation. If bindir is libdir, return empty string,
- # else relative path ending with a slash; either way, target
- # file name can be directly appended.
- if test ! -z "$func_relative_path_result"; then
- func_stripname './' '' "$func_relative_path_result/"
- func_relative_path_result=$func_stripname_result
- fi
-}
-
-# The name of this program:
-func_dirname_and_basename "$progpath"
-progname=$func_basename_result
-
-# Make sure we have an absolute path for reexecution:
+# Make sure we have an absolute progpath for reexecution:
case $progpath in
[\\/]*|[A-Za-z]:\\*) ;;
*[\\/]*)
- progdir=$func_dirname_result
+ progdir=`$ECHO "$progpath" |$SED "$sed_dirname"`
progdir=`cd "$progdir" && pwd`
- progpath="$progdir/$progname"
+ progpath=$progdir/$progname
;;
*)
- save_IFS="$IFS"
+ _G_IFS=$IFS
IFS=${PATH_SEPARATOR-:}
for progdir in $PATH; do
- IFS="$save_IFS"
+ IFS=$_G_IFS
test -x "$progdir/$progname" && break
done
- IFS="$save_IFS"
+ IFS=$_G_IFS
test -n "$progdir" || progdir=`pwd`
- progpath="$progdir/$progname"
+ progpath=$progdir/$progname
;;
esac
-# Sed substitution that helps us do robust quoting. It backslashifies
-# metacharacters that are still active within double-quoted strings.
-Xsed="${SED}"' -e 1s/^X//'
-sed_quote_subst='s/\([`"$\\]\)/\\\1/g'
-# Same as above, but do not quote variable references.
-double_quote_subst='s/\(["`\\]\)/\\\1/g'
+## ----------------- ##
+## Standard options. ##
+## ----------------- ##
-# Sed substitution that turns a string into a regex matching for the
-# string literally.
-sed_make_literal_regex='s,[].[^$\\*\/],\\&,g'
+# The following options affect the operation of the functions defined
+# below, and should be set appropriately depending on run-time para-
+# meters passed on the command line.
-# Sed substitution that converts a w32 file name or path
-# which contains forward slashes, into one that contains
-# (escaped) backslashes. A very naive implementation.
-lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
-
-# Re-`\' parameter expansions in output of double_quote_subst that were
-# `\'-ed in input to the same. If an odd number of `\' preceded a '$'
-# in input to double_quote_subst, that '$' was protected from expansion.
-# Since each input `\' is now two `\'s, look for any number of runs of
-# four `\'s followed by two `\'s and then a '$'. `\' that '$'.
-bs='\\'
-bs2='\\\\'
-bs4='\\\\\\\\'
-dollar='\$'
-sed_double_backslash="\
- s/$bs4/&\\
-/g
- s/^$bs2$dollar/$bs&/
- s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g
- s/\n//g"
-
-# Standard options:
opt_dry_run=false
-opt_help=false
opt_quiet=false
opt_verbose=false
-opt_warning=:
-# func_echo arg...
-# Echo program name prefixed message, along with the current mode
-# name if it has been set yet.
-func_echo ()
+# Categories 'all' and 'none' are always available. Append any others
+# you will pass as the first argument to func_warning from your own
+# code.
+warning_categories=
+
+# By default, display warnings according to 'opt_warning_types'. Set
+# 'warning_func' to ':' to elide all warnings, or func_fatal_error to
+# treat the next displayed warning as a fatal error.
+warning_func=func_warn_and_continue
+
+# Set to 'all' to display all warnings, 'none' to suppress all
+# warnings, or a space delimited list of some subset of
+# 'warning_categories' to display only the listed warnings.
+opt_warning_types=all
+
+
+## -------------------- ##
+## Resource management. ##
+## -------------------- ##
+
+# This section contains definitions for functions that each ensure a
+# particular resource (a file, or a non-empty configuration variable for
+# example) is available, and if appropriate to extract default values
+# from pertinent package files. Call them using their associated
+# 'require_*' variable to ensure that they are executed, at most, once.
+#
+# It's entirely deliberate that calling these functions can set
+# variables that don't obey the namespace limitations obeyed by the rest
+# of this file, in order that that they be as useful as possible to
+# callers.
+
+
+# require_term_colors
+# -------------------
+# Allow display of bold text on terminals that support it.
+require_term_colors=func_require_term_colors
+func_require_term_colors ()
{
- $ECHO "$progname: ${opt_mode+$opt_mode: }$*"
+ $debug_cmd
+
+ test -t 1 && {
+ # COLORTERM and USE_ANSI_COLORS environment variables take
+ # precedence, because most terminfo databases neglect to describe
+ # whether color sequences are supported.
+ test -n "${COLORTERM+set}" && : ${USE_ANSI_COLORS="1"}
+
+ if test 1 = "$USE_ANSI_COLORS"; then
+ # Standard ANSI escape sequences
+ tc_reset='[0m'
+ tc_bold='[1m'; tc_standout='[7m'
+ tc_red='[31m'; tc_green='[32m'
+ tc_blue='[34m'; tc_cyan='[36m'
+ else
+ # Otherwise trust the terminfo database after all.
+ test -n "`tput sgr0 2>/dev/null`" && {
+ tc_reset=`tput sgr0`
+ test -n "`tput bold 2>/dev/null`" && tc_bold=`tput bold`
+ tc_standout=$tc_bold
+ test -n "`tput smso 2>/dev/null`" && tc_standout=`tput smso`
+ test -n "`tput setaf 1 2>/dev/null`" && tc_red=`tput setaf 1`
+ test -n "`tput setaf 2 2>/dev/null`" && tc_green=`tput setaf 2`
+ test -n "`tput setaf 4 2>/dev/null`" && tc_blue=`tput setaf 4`
+ test -n "`tput setaf 5 2>/dev/null`" && tc_cyan=`tput setaf 5`
+ }
+ fi
+ }
+
+ require_term_colors=:
}
-# func_verbose arg...
-# Echo program name prefixed message in verbose mode only.
-func_verbose ()
+
+## ----------------- ##
+## Function library. ##
+## ----------------- ##
+
+# This section contains a variety of useful functions to call in your
+# scripts. Take note of the portable wrappers for features provided by
+# some modern shells, which will fall back to slower equivalents on
+# less featureful shells.
+
+
+# func_append VAR VALUE
+# ---------------------
+# Append VALUE onto the existing contents of VAR.
+
+ # We should try to minimise forks, especially on Windows where they are
+ # unreasonably slow, so skip the feature probes when bash or zsh are
+ # being used:
+ if test set = "${BASH_VERSION+set}${ZSH_VERSION+set}"; then
+ : ${_G_HAVE_ARITH_OP="yes"}
+ : ${_G_HAVE_XSI_OPS="yes"}
+ # The += operator was introduced in bash 3.1
+ case $BASH_VERSION in
+ [12].* | 3.0 | 3.0*) ;;
+ *)
+ : ${_G_HAVE_PLUSEQ_OP="yes"}
+ ;;
+ esac
+ fi
+
+ # _G_HAVE_PLUSEQ_OP
+ # Can be empty, in which case the shell is probed, "yes" if += is
+ # useable or anything else if it does not work.
+ test -z "$_G_HAVE_PLUSEQ_OP" \
+ && (eval 'x=a; x+=" b"; test "a b" = "$x"') 2>/dev/null \
+ && _G_HAVE_PLUSEQ_OP=yes
+
+if test yes = "$_G_HAVE_PLUSEQ_OP"
+then
+ # This is an XSI compatible shell, allowing a faster implementation...
+ eval 'func_append ()
+ {
+ $debug_cmd
+
+ eval "$1+=\$2"
+ }'
+else
+ # ...otherwise fall back to using expr, which is often a shell builtin.
+ func_append ()
+ {
+ $debug_cmd
+
+ eval "$1=\$$1\$2"
+ }
+fi
+
+
+# func_append_quoted VAR VALUE
+# ----------------------------
+# Quote VALUE and append to the end of shell variable VAR, separated
+# by a space.
+if test yes = "$_G_HAVE_PLUSEQ_OP"; then
+ eval 'func_append_quoted ()
+ {
+ $debug_cmd
+
+ func_quote_for_eval "$2"
+ eval "$1+=\\ \$func_quote_for_eval_result"
+ }'
+else
+ func_append_quoted ()
+ {
+ $debug_cmd
+
+ func_quote_for_eval "$2"
+ eval "$1=\$$1\\ \$func_quote_for_eval_result"
+ }
+fi
+
+
+# func_append_uniq VAR VALUE
+# --------------------------
+# Append unique VALUE onto the existing contents of VAR, assuming
+# entries are delimited by the first character of VALUE. For example:
+#
+# func_append_uniq options " --another-option option-argument"
+#
+# will only append to $options if " --another-option option-argument "
+# is not already present somewhere in $options already (note spaces at
+# each end implied by leading space in second argument).
+func_append_uniq ()
{
- $opt_verbose && func_echo ${1+"$@"}
+ $debug_cmd
- # A bug in bash halts the script if the last line of a function
- # fails when set -e is in force, so we need another command to
- # work around that:
- :
+ eval _G_current_value='`$ECHO $'$1'`'
+ _G_delim=`expr "$2" : '\(.\)'`
+
+ case $_G_delim$_G_current_value$_G_delim in
+ *"$2$_G_delim"*) ;;
+ *) func_append "$@" ;;
+ esac
}
-# func_echo_all arg...
+
+# func_arith TERM...
+# ------------------
+# Set func_arith_result to the result of evaluating TERMs.
+ test -z "$_G_HAVE_ARITH_OP" \
+ && (eval 'test 2 = $(( 1 + 1 ))') 2>/dev/null \
+ && _G_HAVE_ARITH_OP=yes
+
+if test yes = "$_G_HAVE_ARITH_OP"; then
+ eval 'func_arith ()
+ {
+ $debug_cmd
+
+ func_arith_result=$(( $* ))
+ }'
+else
+ func_arith ()
+ {
+ $debug_cmd
+
+ func_arith_result=`expr "$@"`
+ }
+fi
+
+
+# func_basename FILE
+# ------------------
+# Set func_basename_result to FILE with everything up to and including
+# the last / stripped.
+if test yes = "$_G_HAVE_XSI_OPS"; then
+ # If this shell supports suffix pattern removal, then use it to avoid
+ # forking. Hide the definitions single quotes in case the shell chokes
+ # on unsupported syntax...
+ _b='func_basename_result=${1##*/}'
+ _d='case $1 in
+ */*) func_dirname_result=${1%/*}$2 ;;
+ * ) func_dirname_result=$3 ;;
+ esac'
+
+else
+ # ...otherwise fall back to using sed.
+ _b='func_basename_result=`$ECHO "$1" |$SED "$sed_basename"`'
+ _d='func_dirname_result=`$ECHO "$1" |$SED "$sed_dirname"`
+ if test "X$func_dirname_result" = "X$1"; then
+ func_dirname_result=$3
+ else
+ func_append func_dirname_result "$2"
+ fi'
+fi
+
+eval 'func_basename ()
+{
+ $debug_cmd
+
+ '"$_b"'
+}'
+
+
+# func_dirname FILE APPEND NONDIR_REPLACEMENT
+# -------------------------------------------
+# Compute the dirname of FILE. If nonempty, add APPEND to the result,
+# otherwise set result to NONDIR_REPLACEMENT.
+eval 'func_dirname ()
+{
+ $debug_cmd
+
+ '"$_d"'
+}'
+
+
+# func_dirname_and_basename FILE APPEND NONDIR_REPLACEMENT
+# --------------------------------------------------------
+# Perform func_basename and func_dirname in a single function
+# call:
+# dirname: Compute the dirname of FILE. If nonempty,
+# add APPEND to the result, otherwise set result
+# to NONDIR_REPLACEMENT.
+# value returned in "$func_dirname_result"
+# basename: Compute filename of FILE.
+# value retuned in "$func_basename_result"
+# For efficiency, we do not delegate to the functions above but instead
+# duplicate the functionality here.
+eval 'func_dirname_and_basename ()
+{
+ $debug_cmd
+
+ '"$_b"'
+ '"$_d"'
+}'
+
+
+# func_echo ARG...
+# ----------------
+# Echo program name prefixed message.
+func_echo ()
+{
+ $debug_cmd
+
+ _G_message=$*
+
+ func_echo_IFS=$IFS
+ IFS=$nl
+ for _G_line in $_G_message; do
+ IFS=$func_echo_IFS
+ $ECHO "$progname: $_G_line"
+ done
+ IFS=$func_echo_IFS
+}
+
+
+# func_echo_all ARG...
+# --------------------
# Invoke $ECHO with all args, space-separated.
func_echo_all ()
{
@@ -461,237 +735,530 @@
$ECHO "$*"
}
-# func_error arg...
-# Echo program name prefixed message to standard error.
-func_error ()
+
+# func_echo_infix_1 INFIX ARG...
+# ------------------------------
+# Echo program name, followed by INFIX on the first line, with any
+# additional lines not showing INFIX.
+func_echo_infix_1 ()
{
- $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2
+ $debug_cmd
+
+ $require_term_colors
+
+ _G_infix=$1; shift
+ _G_indent=$_G_infix
+ _G_prefix="$progname: $_G_infix: "
+ _G_message=$*
+
+ # Strip color escape sequences before counting printable length
+ for _G_tc in "$tc_reset" "$tc_bold" "$tc_standout" "$tc_red" "$tc_green" "$tc_blue" "$tc_cyan"
+ do
+ test -n "$_G_tc" && {
+ _G_esc_tc=`$ECHO "$_G_tc" | $SED "$sed_make_literal_regex"`
+ _G_indent=`$ECHO "$_G_indent" | $SED "s|$_G_esc_tc||g"`
+ }
+ done
+ _G_indent="$progname: "`echo "$_G_indent" | $SED 's|.| |g'`" " ## exclude from sc_prohibit_nested_quotes
+
+ func_echo_infix_1_IFS=$IFS
+ IFS=$nl
+ for _G_line in $_G_message; do
+ IFS=$func_echo_infix_1_IFS
+ $ECHO "$_G_prefix$tc_bold$_G_line$tc_reset" >&2
+ _G_prefix=$_G_indent
+ done
+ IFS=$func_echo_infix_1_IFS
}
-# func_warning arg...
-# Echo program name prefixed warning message to standard error.
-func_warning ()
+
+# func_error ARG...
+# -----------------
+# Echo program name prefixed message to standard error.
+func_error ()
{
- $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2
+ $debug_cmd
- # bash bug again:
- :
+ $require_term_colors
+
+ func_echo_infix_1 " $tc_standout${tc_red}error$tc_reset" "$*" >&2
}
-# func_fatal_error arg...
+
+# func_fatal_error ARG...
+# -----------------------
# Echo program name prefixed message to standard error, and exit.
func_fatal_error ()
{
- func_error ${1+"$@"}
+ $debug_cmd
+
+ func_error "$*"
exit $EXIT_FAILURE
}
-# func_fatal_help arg...
-# Echo program name prefixed message to standard error, followed by
-# a help hint, and exit.
-func_fatal_help ()
-{
- func_error ${1+"$@"}
- func_fatal_error "$help"
-}
-help="Try \`$progname --help' for more information." ## default
-
-# func_grep expression filename
+# func_grep EXPRESSION FILENAME
+# -----------------------------
# Check whether EXPRESSION matches any line of FILENAME, without output.
func_grep ()
{
+ $debug_cmd
+
$GREP "$1" "$2" >/dev/null 2>&1
}
-# func_mkdir_p directory-path
+# func_len STRING
+# ---------------
+# Set func_len_result to the length of STRING. STRING may not
+# start with a hyphen.
+ test -z "$_G_HAVE_XSI_OPS" \
+ && (eval 'x=a/b/c;
+ test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \
+ && _G_HAVE_XSI_OPS=yes
+
+if test yes = "$_G_HAVE_XSI_OPS"; then
+ eval 'func_len ()
+ {
+ $debug_cmd
+
+ func_len_result=${#1}
+ }'
+else
+ func_len ()
+ {
+ $debug_cmd
+
+ func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len`
+ }
+fi
+
+
+# func_mkdir_p DIRECTORY-PATH
+# ---------------------------
# Make sure the entire path to DIRECTORY-PATH is available.
func_mkdir_p ()
{
- my_directory_path="$1"
- my_dir_list=
+ $debug_cmd
- if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then
+ _G_directory_path=$1
+ _G_dir_list=
- # Protect directory names starting with `-'
- case $my_directory_path in
- -*) my_directory_path="./$my_directory_path" ;;
+ if test -n "$_G_directory_path" && test : != "$opt_dry_run"; then
+
+ # Protect directory names starting with '-'
+ case $_G_directory_path in
+ -*) _G_directory_path=./$_G_directory_path ;;
esac
# While some portion of DIR does not yet exist...
- while test ! -d "$my_directory_path"; do
+ while test ! -d "$_G_directory_path"; do
# ...make a list in topmost first order. Use a colon delimited
# list incase some portion of path contains whitespace.
- my_dir_list="$my_directory_path:$my_dir_list"
+ _G_dir_list=$_G_directory_path:$_G_dir_list
# If the last portion added has no slash in it, the list is done
- case $my_directory_path in */*) ;; *) break ;; esac
+ case $_G_directory_path in */*) ;; *) break ;; esac
# ...otherwise throw away the child directory and loop
- my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"`
+ _G_directory_path=`$ECHO "$_G_directory_path" | $SED -e "$sed_dirname"`
done
- my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'`
+ _G_dir_list=`$ECHO "$_G_dir_list" | $SED 's|:*$||'`
- save_mkdir_p_IFS="$IFS"; IFS=':'
- for my_dir in $my_dir_list; do
- IFS="$save_mkdir_p_IFS"
- # mkdir can fail with a `File exist' error if two processes
+ func_mkdir_p_IFS=$IFS; IFS=:
+ for _G_dir in $_G_dir_list; do
+ IFS=$func_mkdir_p_IFS
+ # mkdir can fail with a 'File exist' error if two processes
# try to create one of the directories concurrently. Don't
# stop in that case!
- $MKDIR "$my_dir" 2>/dev/null || :
+ $MKDIR "$_G_dir" 2>/dev/null || :
done
- IFS="$save_mkdir_p_IFS"
+ IFS=$func_mkdir_p_IFS
# Bail out if we (or some other process) failed to create a directory.
- test -d "$my_directory_path" || \
- func_fatal_error "Failed to create \`$1'"
+ test -d "$_G_directory_path" || \
+ func_fatal_error "Failed to create '$1'"
fi
}
-# func_mktempdir [string]
+# func_mktempdir [BASENAME]
+# -------------------------
# Make a temporary directory that won't clash with other running
# libtool processes, and avoids race conditions if possible. If
-# given, STRING is the basename for that directory.
+# given, BASENAME is the basename for that directory.
func_mktempdir ()
{
- my_template="${TMPDIR-/tmp}/${1-$progname}"
+ $debug_cmd
- if test "$opt_dry_run" = ":"; then
+ _G_template=${TMPDIR-/tmp}/${1-$progname}
+
+ if test : = "$opt_dry_run"; then
# Return a directory name, but don't create it in dry-run mode
- my_tmpdir="${my_template}-$$"
+ _G_tmpdir=$_G_template-$$
else
# If mktemp works, use that first and foremost
- my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
+ _G_tmpdir=`mktemp -d "$_G_template-XXXXXXXX" 2>/dev/null`
- if test ! -d "$my_tmpdir"; then
+ if test ! -d "$_G_tmpdir"; then
# Failing that, at least try and use $RANDOM to avoid a race
- my_tmpdir="${my_template}-${RANDOM-0}$$"
+ _G_tmpdir=$_G_template-${RANDOM-0}$$
- save_mktempdir_umask=`umask`
+ func_mktempdir_umask=`umask`
umask 0077
- $MKDIR "$my_tmpdir"
- umask $save_mktempdir_umask
+ $MKDIR "$_G_tmpdir"
+ umask $func_mktempdir_umask
fi
# If we're not in dry-run mode, bomb out on failure
- test -d "$my_tmpdir" || \
- func_fatal_error "cannot create temporary directory \`$my_tmpdir'"
+ test -d "$_G_tmpdir" || \
+ func_fatal_error "cannot create temporary directory '$_G_tmpdir'"
fi
- $ECHO "$my_tmpdir"
+ $ECHO "$_G_tmpdir"
}
-# func_quote_for_eval arg
-# Aesthetically quote ARG to be evaled later.
-# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT
-# is double-quoted, suitable for a subsequent eval, whereas
-# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters
-# which are still active within double quotes backslashified.
-func_quote_for_eval ()
+# func_normal_abspath PATH
+# ------------------------
+# Remove doubled-up and trailing slashes, "." path components,
+# and cancel out any ".." path components in PATH after making
+# it an absolute path.
+func_normal_abspath ()
{
- case $1 in
- *[\\\`\"\$]*)
- func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;;
- *)
- func_quote_for_eval_unquoted_result="$1" ;;
- esac
+ $debug_cmd
- case $func_quote_for_eval_unquoted_result in
- # Double-quote args containing shell metacharacters to delay
- # word splitting, command substitution and and variable
- # expansion for a subsequent eval.
- # Many Bourne shells cannot handle close brackets correctly
- # in scan sets, so we specify it separately.
- *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
- func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\""
+ # These SED scripts presuppose an absolute path with a trailing slash.
+ _G_pathcar='s|^/\([^/]*\).*$|\1|'
+ _G_pathcdr='s|^/[^/]*||'
+ _G_removedotparts=':dotsl
+ s|/\./|/|g
+ t dotsl
+ s|/\.$|/|'
+ _G_collapseslashes='s|/\{1,\}|/|g'
+ _G_finalslash='s|/*$|/|'
+
+ # Start from root dir and reassemble the path.
+ func_normal_abspath_result=
+ func_normal_abspath_tpath=$1
+ func_normal_abspath_altnamespace=
+ case $func_normal_abspath_tpath in
+ "")
+ # Empty path, that just means $cwd.
+ func_stripname '' '/' "`pwd`"
+ func_normal_abspath_result=$func_stripname_result
+ return
;;
+ # The next three entries are used to spot a run of precisely
+ # two leading slashes without using negated character classes;
+ # we take advantage of case's first-match behaviour.
+ ///*)
+ # Unusual form of absolute path, do nothing.
+ ;;
+ //*)
+ # Not necessarily an ordinary path; POSIX reserves leading '//'
+ # and for example Cygwin uses it to access remote file shares
+ # over CIFS/SMB, so we conserve a leading double slash if found.
+ func_normal_abspath_altnamespace=/
+ ;;
+ /*)
+ # Absolute path, do nothing.
+ ;;
*)
- func_quote_for_eval_result="$func_quote_for_eval_unquoted_result"
+ # Relative path, prepend $cwd.
+ func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
+ ;;
esac
+
+ # Cancel out all the simple stuff to save iterations. We also want
+ # the path to end with a slash for ease of parsing, so make sure
+ # there is one (and only one) here.
+ func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
+ -e "$_G_removedotparts" -e "$_G_collapseslashes" -e "$_G_finalslash"`
+ while :; do
+ # Processed it all yet?
+ if test / = "$func_normal_abspath_tpath"; then
+ # If we ascended to the root using ".." the result may be empty now.
+ if test -z "$func_normal_abspath_result"; then
+ func_normal_abspath_result=/
+ fi
+ break
+ fi
+ func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \
+ -e "$_G_pathcar"`
+ func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
+ -e "$_G_pathcdr"`
+ # Figure out what to do with it
+ case $func_normal_abspath_tcomponent in
+ "")
+ # Trailing empty path component, ignore it.
+ ;;
+ ..)
+ # Parent dir; strip last assembled component from result.
+ func_dirname "$func_normal_abspath_result"
+ func_normal_abspath_result=$func_dirname_result
+ ;;
+ *)
+ # Actual path component, append it.
+ func_append func_normal_abspath_result "/$func_normal_abspath_tcomponent"
+ ;;
+ esac
+ done
+ # Restore leading double-slash if one was found on entry.
+ func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result
}
-# func_quote_for_expand arg
+# func_notquiet ARG...
+# --------------------
+# Echo program name prefixed message only when not in quiet mode.
+func_notquiet ()
+{
+ $debug_cmd
+
+ $opt_quiet || func_echo ${1+"$@"}
+
+ # A bug in bash halts the script if the last line of a function
+ # fails when set -e is in force, so we need another command to
+ # work around that:
+ :
+}
+
+
+# func_relative_path SRCDIR DSTDIR
+# --------------------------------
+# Set func_relative_path_result to the relative path from SRCDIR to DSTDIR.
+func_relative_path ()
+{
+ $debug_cmd
+
+ func_relative_path_result=
+ func_normal_abspath "$1"
+ func_relative_path_tlibdir=$func_normal_abspath_result
+ func_normal_abspath "$2"
+ func_relative_path_tbindir=$func_normal_abspath_result
+
+ # Ascend the tree starting from libdir
+ while :; do
+ # check if we have found a prefix of bindir
+ case $func_relative_path_tbindir in
+ $func_relative_path_tlibdir)
+ # found an exact match
+ func_relative_path_tcancelled=
+ break
+ ;;
+ $func_relative_path_tlibdir*)
+ # found a matching prefix
+ func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"
+ func_relative_path_tcancelled=$func_stripname_result
+ if test -z "$func_relative_path_result"; then
+ func_relative_path_result=.
+ fi
+ break
+ ;;
+ *)
+ func_dirname $func_relative_path_tlibdir
+ func_relative_path_tlibdir=$func_dirname_result
+ if test -z "$func_relative_path_tlibdir"; then
+ # Have to descend all the way to the root!
+ func_relative_path_result=../$func_relative_path_result
+ func_relative_path_tcancelled=$func_relative_path_tbindir
+ break
+ fi
+ func_relative_path_result=../$func_relative_path_result
+ ;;
+ esac
+ done
+
+ # Now calculate path; take care to avoid doubling-up slashes.
+ func_stripname '' '/' "$func_relative_path_result"
+ func_relative_path_result=$func_stripname_result
+ func_stripname '/' '/' "$func_relative_path_tcancelled"
+ if test -n "$func_stripname_result"; then
+ func_append func_relative_path_result "/$func_stripname_result"
+ fi
+
+ # Normalisation. If bindir is libdir, return '.' else relative path.
+ if test -n "$func_relative_path_result"; then
+ func_stripname './' '' "$func_relative_path_result"
+ func_relative_path_result=$func_stripname_result
+ fi
+
+ test -n "$func_relative_path_result" || func_relative_path_result=.
+
+ :
+}
+
+
+# func_quote_for_eval ARG...
+# --------------------------
+# Aesthetically quote ARGs to be evaled later.
+# This function returns two values:
+# i) func_quote_for_eval_result
+# double-quoted, suitable for a subsequent eval
+# ii) func_quote_for_eval_unquoted_result
+# has all characters that are still active within double
+# quotes backslashified.
+func_quote_for_eval ()
+{
+ $debug_cmd
+
+ func_quote_for_eval_unquoted_result=
+ func_quote_for_eval_result=
+ while test 0 -lt $#; do
+ case $1 in
+ *[\\\`\"\$]*)
+ _G_unquoted_arg=`printf '%s\n' "$1" |$SED "$sed_quote_subst"` ;;
+ *)
+ _G_unquoted_arg=$1 ;;
+ esac
+ if test -n "$func_quote_for_eval_unquoted_result"; then
+ func_append func_quote_for_eval_unquoted_result " $_G_unquoted_arg"
+ else
+ func_append func_quote_for_eval_unquoted_result "$_G_unquoted_arg"
+ fi
+
+ case $_G_unquoted_arg in
+ # Double-quote args containing shell metacharacters to delay
+ # word splitting, command substitution and variable expansion
+ # for a subsequent eval.
+ # Many Bourne shells cannot handle close brackets correctly
+ # in scan sets, so we specify it separately.
+ *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
+ _G_quoted_arg=\"$_G_unquoted_arg\"
+ ;;
+ *)
+ _G_quoted_arg=$_G_unquoted_arg
+ ;;
+ esac
+
+ if test -n "$func_quote_for_eval_result"; then
+ func_append func_quote_for_eval_result " $_G_quoted_arg"
+ else
+ func_append func_quote_for_eval_result "$_G_quoted_arg"
+ fi
+ shift
+ done
+}
+
+
+# func_quote_for_expand ARG
+# -------------------------
# Aesthetically quote ARG to be evaled later; same as above,
# but do not quote variable references.
func_quote_for_expand ()
{
+ $debug_cmd
+
case $1 in
*[\\\`\"]*)
- my_arg=`$ECHO "$1" | $SED \
- -e "$double_quote_subst" -e "$sed_double_backslash"` ;;
+ _G_arg=`$ECHO "$1" | $SED \
+ -e "$sed_double_quote_subst" -e "$sed_double_backslash"` ;;
*)
- my_arg="$1" ;;
+ _G_arg=$1 ;;
esac
- case $my_arg in
+ case $_G_arg in
# Double-quote args containing shell metacharacters to delay
# word splitting and command substitution for a subsequent eval.
# Many Bourne shells cannot handle close brackets correctly
# in scan sets, so we specify it separately.
*[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*|"")
- my_arg="\"$my_arg\""
+ _G_arg=\"$_G_arg\"
;;
esac
- func_quote_for_expand_result="$my_arg"
+ func_quote_for_expand_result=$_G_arg
}
-# func_show_eval cmd [fail_exp]
-# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is
+# func_stripname PREFIX SUFFIX NAME
+# ---------------------------------
+# strip PREFIX and SUFFIX from NAME, and store in func_stripname_result.
+# PREFIX and SUFFIX must not contain globbing or regex special
+# characters, hashes, percent signs, but SUFFIX may contain a leading
+# dot (in which case that matches only a dot).
+if test yes = "$_G_HAVE_XSI_OPS"; then
+ eval 'func_stripname ()
+ {
+ $debug_cmd
+
+ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
+ # positional parameters, so assign one to ordinary variable first.
+ func_stripname_result=$3
+ func_stripname_result=${func_stripname_result#"$1"}
+ func_stripname_result=${func_stripname_result%"$2"}
+ }'
+else
+ func_stripname ()
+ {
+ $debug_cmd
+
+ case $2 in
+ .*) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%\\\\$2\$%%"`;;
+ *) func_stripname_result=`$ECHO "$3" | $SED -e "s%^$1%%" -e "s%$2\$%%"`;;
+ esac
+ }
+fi
+
+
+# func_show_eval CMD [FAIL_EXP]
+# -----------------------------
+# Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is
# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
# is given, then evaluate it.
func_show_eval ()
{
- my_cmd="$1"
- my_fail_exp="${2-:}"
+ $debug_cmd
- ${opt_silent-false} || {
- func_quote_for_expand "$my_cmd"
- eval "func_echo $func_quote_for_expand_result"
- }
+ _G_cmd=$1
+ _G_fail_exp=${2-':'}
- if ${opt_dry_run-false}; then :; else
- eval "$my_cmd"
- my_status=$?
- if test "$my_status" -eq 0; then :; else
- eval "(exit $my_status); $my_fail_exp"
+ func_quote_for_expand "$_G_cmd"
+ eval "func_notquiet $func_quote_for_expand_result"
+
+ $opt_dry_run || {
+ eval "$_G_cmd"
+ _G_status=$?
+ if test 0 -ne "$_G_status"; then
+ eval "(exit $_G_status); $_G_fail_exp"
fi
- fi
+ }
}
-# func_show_eval_locale cmd [fail_exp]
-# Unless opt_silent is true, then output CMD. Then, if opt_dryrun is
+# func_show_eval_locale CMD [FAIL_EXP]
+# ------------------------------------
+# Unless opt_quiet is true, then output CMD. Then, if opt_dryrun is
# not true, evaluate CMD. If the evaluation of CMD fails, and FAIL_EXP
# is given, then evaluate it. Use the saved locale for evaluation.
func_show_eval_locale ()
{
- my_cmd="$1"
- my_fail_exp="${2-:}"
+ $debug_cmd
- ${opt_silent-false} || {
- func_quote_for_expand "$my_cmd"
+ _G_cmd=$1
+ _G_fail_exp=${2-':'}
+
+ $opt_quiet || {
+ func_quote_for_expand "$_G_cmd"
eval "func_echo $func_quote_for_expand_result"
}
- if ${opt_dry_run-false}; then :; else
- eval "$lt_user_locale
- $my_cmd"
- my_status=$?
- eval "$lt_safe_locale"
- if test "$my_status" -eq 0; then :; else
- eval "(exit $my_status); $my_fail_exp"
+ $opt_dry_run || {
+ eval "$_G_user_locale
+ $_G_cmd"
+ _G_status=$?
+ eval "$_G_safe_locale"
+ if test 0 -ne "$_G_status"; then
+ eval "(exit $_G_status); $_G_fail_exp"
fi
- fi
+ }
}
+
# func_tr_sh
+# ----------
# Turn $1 into a string suitable for a shell variable name.
# Result is stored in $func_tr_sh_result. All characters
# not in the set a-zA-Z0-9_ are replaced with '_'. Further,
@@ -698,206 +1265,873 @@
# if $1 begins with a digit, a '_' is prepended as well.
func_tr_sh ()
{
- case $1 in
- [0-9]* | *[!a-zA-Z0-9_]*)
- func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'`
- ;;
- * )
- func_tr_sh_result=$1
- ;;
- esac
+ $debug_cmd
+
+ case $1 in
+ [0-9]* | *[!a-zA-Z0-9_]*)
+ func_tr_sh_result=`$ECHO "$1" | $SED -e 's/^\([0-9]\)/_\1/' -e 's/[^a-zA-Z0-9_]/_/g'`
+ ;;
+ * )
+ func_tr_sh_result=$1
+ ;;
+ esac
}
-# func_version
-# Echo version message to standard output and exit.
-func_version ()
+# func_verbose ARG...
+# -------------------
+# Echo program name prefixed message in verbose mode only.
+func_verbose ()
{
- $opt_debug
+ $debug_cmd
- $SED -n '/(C)/!b go
- :more
- /\./!{
- N
- s/\n# / /
- b more
- }
- :go
- /^# '$PROGRAM' (GNU /,/# warranty; / {
- s/^# //
- s/^# *$//
- s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/
- p
- }' < "$progpath"
- exit $?
+ $opt_verbose && func_echo "$*"
+
+ :
}
-# func_usage
-# Echo short help message to standard output and exit.
-func_usage ()
+
+# func_warn_and_continue ARG...
+# -----------------------------
+# Echo program name prefixed warning message to standard error.
+func_warn_and_continue ()
{
- $opt_debug
+ $debug_cmd
- $SED -n '/^# Usage:/,/^# *.*--help/ {
- s/^# //
- s/^# *$//
- s/\$progname/'$progname'/
- p
- }' < "$progpath"
- echo
- $ECHO "run \`$progname --help | more' for full usage"
- exit $?
+ $require_term_colors
+
+ func_echo_infix_1 "${tc_red}warning$tc_reset" "$*" >&2
}
-# func_help [NOEXIT]
-# Echo long help message to standard output and exit,
-# unless 'noexit' is passed as argument.
+
+# func_warning CATEGORY ARG...
+# ----------------------------
+# Echo program name prefixed warning message to standard error. Warning
+# messages can be filtered according to CATEGORY, where this function
+# elides messages where CATEGORY is not listed in the global variable
+# 'opt_warning_types'.
+func_warning ()
+{
+ $debug_cmd
+
+ # CATEGORY must be in the warning_categories list!
+ case " $warning_categories " in
+ *" $1 "*) ;;
+ *) func_internal_error "invalid warning category '$1'" ;;
+ esac
+
+ _G_category=$1
+ shift
+
+ case " $opt_warning_types " in
+ *" $_G_category "*) $warning_func ${1+"$@"} ;;
+ esac
+}
+
+
+# func_sort_ver VER1 VER2
+# -----------------------
+# 'sort -V' is not generally available.
+# Note this deviates from the version comparison in automake
+# in that it treats 1.5 < 1.5.0, and treats 1.4.4a < 1.4-p3a
+# but this should suffice as we won't be specifying old
+# version formats or redundant trailing .0 in bootstrap.conf.
+# If we did want full compatibility then we should probably
+# use m4_version_compare from autoconf.
+func_sort_ver ()
+{
+ $debug_cmd
+
+ printf '%s\n%s\n' "$1" "$2" \
+ | sort -t. -k 1,1n -k 2,2n -k 3,3n -k 4,4n -k 5,5n -k 6,6n -k 7,7n -k 8,8n -k 9,9n
+}
+
+# func_lt_ver PREV CURR
+# ---------------------
+# Return true if PREV and CURR are in the correct order according to
+# func_sort_ver, otherwise false. Use it like this:
+#
+# func_lt_ver "$prev_ver" "$proposed_ver" || func_fatal_error "..."
+func_lt_ver ()
+{
+ $debug_cmd
+
+ test "x$1" = x`func_sort_ver "$1" "$2" | $SED 1q`
+}
+
+
+# Local variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'before-save-hook 'time-stamp)
+# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC"
+# time-stamp-time-zone: "UTC"
+# End:
+#! /bin/sh
+
+# Set a version string for this script.
+scriptversion=2014-01-07.03; # UTC
+
+# A portable, pluggable option parser for Bourne shell.
+# Written by Gary V. Vaughan, 2010
+
+# Copyright (C) 2010-2015 Free Software Foundation, Inc.
+# This is free software; see the source for copying conditions. There is NO
+# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+# Please report bugs or propose patches to gary at gnu.org.
+
+
+## ------ ##
+## Usage. ##
+## ------ ##
+
+# This file is a library for parsing options in your shell scripts along
+# with assorted other useful supporting features that you can make use
+# of too.
+#
+# For the simplest scripts you might need only:
+#
+# #!/bin/sh
+# . relative/path/to/funclib.sh
+# . relative/path/to/options-parser
+# scriptversion=1.0
+# func_options ${1+"$@"}
+# eval set dummy "$func_options_result"; shift
+# ...rest of your script...
+#
+# In order for the '--version' option to work, you will need to have a
+# suitably formatted comment like the one at the top of this file
+# starting with '# Written by ' and ending with '# warranty; '.
+#
+# For '-h' and '--help' to work, you will also need a one line
+# description of your script's purpose in a comment directly above the
+# '# Written by ' line, like the one at the top of this file.
+#
+# The default options also support '--debug', which will turn on shell
+# execution tracing (see the comment above debug_cmd below for another
+# use), and '--verbose' and the func_verbose function to allow your script
+# to display verbose messages only when your user has specified
+# '--verbose'.
+#
+# After sourcing this file, you can plug processing for additional
+# options by amending the variables from the 'Configuration' section
+# below, and following the instructions in the 'Option parsing'
+# section further down.
+
+## -------------- ##
+## Configuration. ##
+## -------------- ##
+
+# You should override these variables in your script after sourcing this
+# file so that they reflect the customisations you have added to the
+# option parser.
+
+# The usage line for option parsing errors and the start of '-h' and
+# '--help' output messages. You can embed shell variables for delayed
+# expansion at the time the message is displayed, but you will need to
+# quote other shell meta-characters carefully to prevent them being
+# expanded when the contents are evaled.
+usage='$progpath [OPTION]...'
+
+# Short help message in response to '-h' and '--help'. Add to this or
+# override it after sourcing this library to reflect the full set of
+# options your script accepts.
+usage_message="\
+ --debug enable verbose shell tracing
+ -W, --warnings=CATEGORY
+ report the warnings falling in CATEGORY [all]
+ -v, --verbose verbosely report processing
+ --version print version information and exit
+ -h, --help print short or long help message and exit
+"
+
+# Additional text appended to 'usage_message' in response to '--help'.
+long_help_message="
+Warning categories include:
+ 'all' show all warnings
+ 'none' turn off all the warnings
+ 'error' warnings are treated as fatal errors"
+
+# Help message printed before fatal option parsing errors.
+fatal_help="Try '\$progname --help' for more information."
+
+
+
+## ------------------------- ##
+## Hook function management. ##
+## ------------------------- ##
+
+# This section contains functions for adding, removing, and running hooks
+# to the main code. A hook is just a named list of of function, that can
+# be run in order later on.
+
+# func_hookable FUNC_NAME
+# -----------------------
+# Declare that FUNC_NAME will run hooks added with
+# 'func_add_hook FUNC_NAME ...'.
+func_hookable ()
+{
+ $debug_cmd
+
+ func_append hookable_fns " $1"
+}
+
+
+# func_add_hook FUNC_NAME HOOK_FUNC
+# ---------------------------------
+# Request that FUNC_NAME call HOOK_FUNC before it returns. FUNC_NAME must
+# first have been declared "hookable" by a call to 'func_hookable'.
+func_add_hook ()
+{
+ $debug_cmd
+
+ case " $hookable_fns " in
+ *" $1 "*) ;;
+ *) func_fatal_error "'$1' does not accept hook functions." ;;
+ esac
+
+ eval func_append ${1}_hooks '" $2"'
+}
+
+
+# func_remove_hook FUNC_NAME HOOK_FUNC
+# ------------------------------------
+# Remove HOOK_FUNC from the list of functions called by FUNC_NAME.
+func_remove_hook ()
+{
+ $debug_cmd
+
+ eval ${1}_hooks='`$ECHO "\$'$1'_hooks" |$SED "s| '$2'||"`'
+}
+
+
+# func_run_hooks FUNC_NAME [ARG]...
+# ---------------------------------
+# Run all hook functions registered to FUNC_NAME.
+# It is assumed that the list of hook functions contains nothing more
+# than a whitespace-delimited list of legal shell function names, and
+# no effort is wasted trying to catch shell meta-characters or preserve
+# whitespace.
+func_run_hooks ()
+{
+ $debug_cmd
+
+ case " $hookable_fns " in
+ *" $1 "*) ;;
+ *) func_fatal_error "'$1' does not support hook funcions.n" ;;
+ esac
+
+ eval _G_hook_fns=\$$1_hooks; shift
+
+ for _G_hook in $_G_hook_fns; do
+ eval $_G_hook '"$@"'
+
+ # store returned options list back into positional
+ # parameters for next 'cmd' execution.
+ eval _G_hook_result=\$${_G_hook}_result
+ eval set dummy "$_G_hook_result"; shift
+ done
+
+ func_quote_for_eval ${1+"$@"}
+ func_run_hooks_result=$func_quote_for_eval_result
+}
+
+
+
+## --------------- ##
+## Option parsing. ##
+## --------------- ##
+
+# In order to add your own option parsing hooks, you must accept the
+# full positional parameter list in your hook function, remove any
+# options that you action, and then pass back the remaining unprocessed
+# options in '<hooked_function_name>_result', escaped suitably for
+# 'eval'. Like this:
+#
+# my_options_prep ()
+# {
+# $debug_cmd
+#
+# # Extend the existing usage message.
+# usage_message=$usage_message'
+# -s, --silent don'\''t print informational messages
+# '
+#
+# func_quote_for_eval ${1+"$@"}
+# my_options_prep_result=$func_quote_for_eval_result
+# }
+# func_add_hook func_options_prep my_options_prep
+#
+#
+# my_silent_option ()
+# {
+# $debug_cmd
+#
+# # Note that for efficiency, we parse as many options as we can
+# # recognise in a loop before passing the remainder back to the
+# # caller on the first unrecognised argument we encounter.
+# while test $# -gt 0; do
+# opt=$1; shift
+# case $opt in
+# --silent|-s) opt_silent=: ;;
+# # Separate non-argument short options:
+# -s*) func_split_short_opt "$_G_opt"
+# set dummy "$func_split_short_opt_name" \
+# "-$func_split_short_opt_arg" ${1+"$@"}
+# shift
+# ;;
+# *) set dummy "$_G_opt" "$*"; shift; break ;;
+# esac
+# done
+#
+# func_quote_for_eval ${1+"$@"}
+# my_silent_option_result=$func_quote_for_eval_result
+# }
+# func_add_hook func_parse_options my_silent_option
+#
+#
+# my_option_validation ()
+# {
+# $debug_cmd
+#
+# $opt_silent && $opt_verbose && func_fatal_help "\
+# '--silent' and '--verbose' options are mutually exclusive."
+#
+# func_quote_for_eval ${1+"$@"}
+# my_option_validation_result=$func_quote_for_eval_result
+# }
+# func_add_hook func_validate_options my_option_validation
+#
+# You'll alse need to manually amend $usage_message to reflect the extra
+# options you parse. It's preferable to append if you can, so that
+# multiple option parsing hooks can be added safely.
+
+
+# func_options [ARG]...
+# ---------------------
+# All the functions called inside func_options are hookable. See the
+# individual implementations for details.
+func_hookable func_options
+func_options ()
+{
+ $debug_cmd
+
+ func_options_prep ${1+"$@"}
+ eval func_parse_options \
+ ${func_options_prep_result+"$func_options_prep_result"}
+ eval func_validate_options \
+ ${func_parse_options_result+"$func_parse_options_result"}
+
+ eval func_run_hooks func_options \
+ ${func_validate_options_result+"$func_validate_options_result"}
+
+ # save modified positional parameters for caller
+ func_options_result=$func_run_hooks_result
+}
+
+
+# func_options_prep [ARG]...
+# --------------------------
+# All initialisations required before starting the option parse loop.
+# Note that when calling hook functions, we pass through the list of
+# positional parameters. If a hook function modifies that list, and
+# needs to propogate that back to rest of this script, then the complete
+# modified list must be put in 'func_run_hooks_result' before
+# returning.
+func_hookable func_options_prep
+func_options_prep ()
+{
+ $debug_cmd
+
+ # Option defaults:
+ opt_verbose=false
+ opt_warning_types=
+
+ func_run_hooks func_options_prep ${1+"$@"}
+
+ # save modified positional parameters for caller
+ func_options_prep_result=$func_run_hooks_result
+}
+
+
+# func_parse_options [ARG]...
+# ---------------------------
+# The main option parsing loop.
+func_hookable func_parse_options
+func_parse_options ()
+{
+ $debug_cmd
+
+ func_parse_options_result=
+
+ # this just eases exit handling
+ while test $# -gt 0; do
+ # Defer to hook functions for initial option parsing, so they
+ # get priority in the event of reusing an option name.
+ func_run_hooks func_parse_options ${1+"$@"}
+
+ # Adjust func_parse_options positional parameters to match
+ eval set dummy "$func_run_hooks_result"; shift
+
+ # Break out of the loop if we already parsed every option.
+ test $# -gt 0 || break
+
+ _G_opt=$1
+ shift
+ case $_G_opt in
+ --debug|-x) debug_cmd='set -x'
+ func_echo "enabling shell trace mode"
+ $debug_cmd
+ ;;
+
+ --no-warnings|--no-warning|--no-warn)
+ set dummy --warnings none ${1+"$@"}
+ shift
+ ;;
+
+ --warnings|--warning|-W)
+ test $# = 0 && func_missing_arg $_G_opt && break
+ case " $warning_categories $1" in
+ *" $1 "*)
+ # trailing space prevents matching last $1 above
+ func_append_uniq opt_warning_types " $1"
+ ;;
+ *all)
+ opt_warning_types=$warning_categories
+ ;;
+ *none)
+ opt_warning_types=none
+ warning_func=:
+ ;;
+ *error)
+ opt_warning_types=$warning_categories
+ warning_func=func_fatal_error
+ ;;
+ *)
+ func_fatal_error \
+ "unsupported warning category: '$1'"
+ ;;
+ esac
+ shift
+ ;;
+
+ --verbose|-v) opt_verbose=: ;;
+ --version) func_version ;;
+ -\?|-h) func_usage ;;
+ --help) func_help ;;
+
+ # Separate optargs to long options (plugins may need this):
+ --*=*) func_split_equals "$_G_opt"
+ set dummy "$func_split_equals_lhs" \
+ "$func_split_equals_rhs" ${1+"$@"}
+ shift
+ ;;
+
+ # Separate optargs to short options:
+ -W*)
+ func_split_short_opt "$_G_opt"
+ set dummy "$func_split_short_opt_name" \
+ "$func_split_short_opt_arg" ${1+"$@"}
+ shift
+ ;;
+
+ # Separate non-argument short options:
+ -\?*|-h*|-v*|-x*)
+ func_split_short_opt "$_G_opt"
+ set dummy "$func_split_short_opt_name" \
+ "-$func_split_short_opt_arg" ${1+"$@"}
+ shift
+ ;;
+
+ --) break ;;
+ -*) func_fatal_help "unrecognised option: '$_G_opt'" ;;
+ *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;;
+ esac
+ done
+
+ # save modified positional parameters for caller
+ func_quote_for_eval ${1+"$@"}
+ func_parse_options_result=$func_quote_for_eval_result
+}
+
+
+# func_validate_options [ARG]...
+# ------------------------------
+# Perform any sanity checks on option settings and/or unconsumed
+# arguments.
+func_hookable func_validate_options
+func_validate_options ()
+{
+ $debug_cmd
+
+ # Display all warnings if -W was not given.
+ test -n "$opt_warning_types" || opt_warning_types=" $warning_categories"
+
+ func_run_hooks func_validate_options ${1+"$@"}
+
+ # Bail if the options were screwed!
+ $exit_cmd $EXIT_FAILURE
+
+ # save modified positional parameters for caller
+ func_validate_options_result=$func_run_hooks_result
+}
+
+
+
+## ----------------- ##
+## Helper functions. ##
+## ----------------- ##
+
+# This section contains the helper functions used by the rest of the
+# hookable option parser framework in ascii-betical order.
+
+
+# func_fatal_help ARG...
+# ----------------------
+# Echo program name prefixed message to standard error, followed by
+# a help hint, and exit.
+func_fatal_help ()
+{
+ $debug_cmd
+
+ eval \$ECHO \""Usage: $usage"\"
+ eval \$ECHO \""$fatal_help"\"
+ func_error ${1+"$@"}
+ exit $EXIT_FAILURE
+}
+
+
+# func_help
+# ---------
+# Echo long help message to standard output and exit.
func_help ()
{
- $opt_debug
+ $debug_cmd
- $SED -n '/^# Usage:/,/# Report bugs to/ {
- :print
- s/^# //
- s/^# *$//
- s*\$progname*'$progname'*
- s*\$host*'"$host"'*
- s*\$SHELL*'"$SHELL"'*
- s*\$LTCC*'"$LTCC"'*
- s*\$LTCFLAGS*'"$LTCFLAGS"'*
- s*\$LD*'"$LD"'*
- s/\$with_gnu_ld/'"$with_gnu_ld"'/
- s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/
- s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/
- p
- d
- }
- /^# .* home page:/b print
- /^# General help using/b print
- ' < "$progpath"
- ret=$?
- if test -z "$1"; then
- exit $ret
- fi
+ func_usage_message
+ $ECHO "$long_help_message"
+ exit 0
}
-# func_missing_arg argname
+
+# func_missing_arg ARGNAME
+# ------------------------
# Echo program name prefixed message to standard error and set global
# exit_cmd.
func_missing_arg ()
{
- $opt_debug
+ $debug_cmd
- func_error "missing argument for $1."
+ func_error "Missing argument for '$1'."
exit_cmd=exit
}
-# func_split_short_opt shortopt
+# func_split_equals STRING
+# ------------------------
+# Set func_split_equals_lhs and func_split_equals_rhs shell variables after
+# splitting STRING at the '=' sign.
+test -z "$_G_HAVE_XSI_OPS" \
+ && (eval 'x=a/b/c;
+ test 5aa/bb/cc = "${#x}${x%%/*}${x%/*}${x#*/}${x##*/}"') 2>/dev/null \
+ && _G_HAVE_XSI_OPS=yes
+
+if test yes = "$_G_HAVE_XSI_OPS"
+then
+ # This is an XSI compatible shell, allowing a faster implementation...
+ eval 'func_split_equals ()
+ {
+ $debug_cmd
+
+ func_split_equals_lhs=${1%%=*}
+ func_split_equals_rhs=${1#*=}
+ test "x$func_split_equals_lhs" = "x$1" \
+ && func_split_equals_rhs=
+ }'
+else
+ # ...otherwise fall back to using expr, which is often a shell builtin.
+ func_split_equals ()
+ {
+ $debug_cmd
+
+ func_split_equals_lhs=`expr "x$1" : 'x\([^=]*\)'`
+ func_split_equals_rhs=
+ test "x$func_split_equals_lhs" = "x$1" \
+ || func_split_equals_rhs=`expr "x$1" : 'x[^=]*=\(.*\)$'`
+ }
+fi #func_split_equals
+
+
+# func_split_short_opt SHORTOPT
+# -----------------------------
# Set func_split_short_opt_name and func_split_short_opt_arg shell
# variables after splitting SHORTOPT after the 2nd character.
-func_split_short_opt ()
+if test yes = "$_G_HAVE_XSI_OPS"
+then
+ # This is an XSI compatible shell, allowing a faster implementation...
+ eval 'func_split_short_opt ()
+ {
+ $debug_cmd
+
+ func_split_short_opt_arg=${1#??}
+ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}
+ }'
+else
+ # ...otherwise fall back to using expr, which is often a shell builtin.
+ func_split_short_opt ()
+ {
+ $debug_cmd
+
+ func_split_short_opt_name=`expr "x$1" : 'x-\(.\)'`
+ func_split_short_opt_arg=`expr "x$1" : 'x-.\(.*\)$'`
+ }
+fi #func_split_short_opt
+
+
+# func_usage
+# ----------
+# Echo short help message to standard output and exit.
+func_usage ()
{
- my_sed_short_opt='1s/^\(..\).*$/\1/;q'
- my_sed_short_rest='1s/^..\(.*\)$/\1/;q'
+ $debug_cmd
- func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"`
- func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"`
-} # func_split_short_opt may be replaced by extended shell implementation
+ func_usage_message
+ $ECHO "Run '$progname --help |${PAGER-more}' for full usage"
+ exit 0
+}
-# func_split_long_opt longopt
-# Set func_split_long_opt_name and func_split_long_opt_arg shell
-# variables after splitting LONGOPT at the `=' sign.
-func_split_long_opt ()
+# func_usage_message
+# ------------------
+# Echo short help message to standard output.
+func_usage_message ()
{
- my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q'
- my_sed_long_arg='1s/^--[^=]*=//'
+ $debug_cmd
- func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"`
- func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"`
-} # func_split_long_opt may be replaced by extended shell implementation
+ eval \$ECHO \""Usage: $usage"\"
+ echo
+ $SED -n 's|^# ||
+ /^Written by/{
+ x;p;x
+ }
+ h
+ /^Written by/q' < "$progpath"
+ echo
+ eval \$ECHO \""$usage_message"\"
+}
-exit_cmd=:
+# func_version
+# ------------
+# Echo version message to standard output and exit.
+func_version ()
+{
+ $debug_cmd
+ printf '%s\n' "$progname $scriptversion"
+ $SED -n '
+ /(C)/!b go
+ :more
+ /\./!{
+ N
+ s|\n# | |
+ b more
+ }
+ :go
+ /^# Written by /,/# warranty; / {
+ s|^# ||
+ s|^# *$||
+ s|\((C)\)[ 0-9,-]*[ ,-]\([1-9][0-9]* \)|\1 \2|
+ p
+ }
+ /^# Written by / {
+ s|^# ||
+ p
+ }
+ /^warranty; /q' < "$progpath"
+ exit $?
+}
-magic="%%%MAGIC variable%%%"
-magic_exe="%%%MAGIC EXE variable%%%"
+# Local variables:
+# mode: shell-script
+# sh-indentation: 2
+# eval: (add-hook 'before-save-hook 'time-stamp)
+# time-stamp-pattern: "10/scriptversion=%:y-%02m-%02d.%02H; # UTC"
+# time-stamp-time-zone: "UTC"
+# End:
-# Global variables.
-nonopt=
-preserve_args=
-lo2o="s/\\.lo\$/.${objext}/"
-o2lo="s/\\.${objext}\$/.lo/"
-extracted_archives=
-extracted_serial=0
+# Set a version string.
+scriptversion='(GNU libtool) 2.4.6 Debian-2.4.6-1'
-# If this variable is set in any of the actions, the command in it
-# will be execed at the end. This prevents here-documents from being
-# left over by shells.
-exec_cmd=
-# func_append var value
-# Append VALUE to the end of shell variable VAR.
-func_append ()
+# func_echo ARG...
+# ----------------
+# Libtool also displays the current mode in messages, so override
+# funclib.sh func_echo with this custom definition.
+func_echo ()
{
- eval "${1}=\$${1}\${2}"
-} # func_append may be replaced by extended shell implementation
+ $debug_cmd
-# func_append_quoted var value
-# Quote VALUE and append to the end of shell variable VAR, separated
-# by a space.
-func_append_quoted ()
-{
- func_quote_for_eval "${2}"
- eval "${1}=\$${1}\\ \$func_quote_for_eval_result"
-} # func_append_quoted may be replaced by extended shell implementation
+ _G_message=$*
+ func_echo_IFS=$IFS
+ IFS=$nl
+ for _G_line in $_G_message; do
+ IFS=$func_echo_IFS
+ $ECHO "$progname${opt_mode+: $opt_mode}: $_G_line"
+ done
+ IFS=$func_echo_IFS
+}
-# func_arith arithmetic-term...
-func_arith ()
+
+# func_warning ARG...
+# -------------------
+# Libtool warnings are not categorized, so override funclib.sh
+# func_warning with this simpler definition.
+func_warning ()
{
- func_arith_result=`expr "${@}"`
-} # func_arith may be replaced by extended shell implementation
+ $debug_cmd
+ $warning_func ${1+"$@"}
+}
-# func_len string
-# STRING may not start with a hyphen.
-func_len ()
-{
- func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len`
-} # func_len may be replaced by extended shell implementation
+## ---------------- ##
+## Options parsing. ##
+## ---------------- ##
-# func_lo2o object
-func_lo2o ()
-{
- func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
-} # func_lo2o may be replaced by extended shell implementation
+# Hook in the functions to make sure our own options are parsed during
+# the option parsing loop.
+usage='$progpath [OPTION]... [MODE-ARG]...'
-# func_xform libobj-or-source
-func_xform ()
+# Short help message in response to '-h'.
+usage_message="Options:
+ --config show all configuration variables
+ --debug enable verbose shell tracing
+ -n, --dry-run display commands without modifying any files
+ --features display basic configuration information and exit
+ --mode=MODE use operation mode MODE
+ --no-warnings equivalent to '-Wnone'
+ --preserve-dup-deps don't remove duplicate dependency libraries
+ --quiet, --silent don't print informational messages
+ --tag=TAG use configuration variables from tag TAG
+ -v, --verbose print more informational messages than default
+ --version print version information
+ -W, --warnings=CATEGORY report the warnings falling in CATEGORY [all]
+ -h, --help, --help-all print short, long, or detailed help message
+"
+
+# Additional text appended to 'usage_message' in response to '--help'.
+func_help ()
{
- func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'`
-} # func_xform may be replaced by extended shell implementation
+ $debug_cmd
+ func_usage_message
+ $ECHO "$long_help_message
-# func_fatal_configuration arg...
+MODE must be one of the following:
+
+ clean remove files from the build directory
+ compile compile a source file into a libtool object
+ execute automatically set library path, then run a program
+ finish complete the installation of libtool libraries
+ install install libraries or executables
+ link create a library or an executable
+ uninstall remove libraries from an installed directory
+
+MODE-ARGS vary depending on the MODE. When passed as first option,
+'--mode=MODE' may be abbreviated as 'MODE' or a unique abbreviation of that.
+Try '$progname --help --mode=MODE' for a more detailed description of MODE.
+
+When reporting a bug, please describe a test case to reproduce it and
+include the following information:
+
+ host-triplet: $host
+ shell: $SHELL
+ compiler: $LTCC
+ compiler flags: $LTCFLAGS
+ linker: $LD (gnu? $with_gnu_ld)
+ version: $progname $scriptversion
+ automake: `($AUTOMAKE --version) 2>/dev/null |$SED 1q`
+ autoconf: `($AUTOCONF --version) 2>/dev/null |$SED 1q`
+
+Report bugs to <bug-libtool at gnu.org>.
+GNU libtool home page: <http://www.gnu.org/s/libtool/>.
+General help using GNU software: <http://www.gnu.org/gethelp/>."
+ exit 0
+}
+
+
+# func_lo2o OBJECT-NAME
+# ---------------------
+# Transform OBJECT-NAME from a '.lo' suffix to the platform specific
+# object suffix.
+
+lo2o=s/\\.lo\$/.$objext/
+o2lo=s/\\.$objext\$/.lo/
+
+if test yes = "$_G_HAVE_XSI_OPS"; then
+ eval 'func_lo2o ()
+ {
+ case $1 in
+ *.lo) func_lo2o_result=${1%.lo}.$objext ;;
+ * ) func_lo2o_result=$1 ;;
+ esac
+ }'
+
+ # func_xform LIBOBJ-OR-SOURCE
+ # ---------------------------
+ # Transform LIBOBJ-OR-SOURCE from a '.o' or '.c' (or otherwise)
+ # suffix to a '.lo' libtool-object suffix.
+ eval 'func_xform ()
+ {
+ func_xform_result=${1%.*}.lo
+ }'
+else
+ # ...otherwise fall back to using sed.
+ func_lo2o ()
+ {
+ func_lo2o_result=`$ECHO "$1" | $SED "$lo2o"`
+ }
+
+ func_xform ()
+ {
+ func_xform_result=`$ECHO "$1" | $SED 's|\.[^.]*$|.lo|'`
+ }
+fi
+
+
+# func_fatal_configuration ARG...
+# -------------------------------
# Echo program name prefixed message to standard error, followed by
# a configuration failure hint, and exit.
func_fatal_configuration ()
{
- func_error ${1+"$@"}
- func_error "See the $PACKAGE documentation for more information."
- func_fatal_error "Fatal configuration error."
+ func__fatal_error ${1+"$@"} \
+ "See the $PACKAGE documentation for more information." \
+ "Fatal configuration error."
}
# func_config
+# -----------
# Display the configuration for all the tags in this script.
func_config ()
{
@@ -915,17 +2149,19 @@
exit $?
}
+
# func_features
+# -------------
# Display the features supported by this script.
func_features ()
{
echo "host: $host"
- if test "$build_libtool_libs" = yes; then
+ if test yes = "$build_libtool_libs"; then
echo "enable shared libraries"
else
echo "disable shared libraries"
fi
- if test "$build_old_libs" = yes; then
+ if test yes = "$build_old_libs"; then
echo "enable static libraries"
else
echo "disable static libraries"
@@ -934,314 +2170,350 @@
exit $?
}
-# func_enable_tag tagname
+
+# func_enable_tag TAGNAME
+# -----------------------
# Verify that TAGNAME is valid, and either flag an error and exit, or
# enable the TAGNAME tag. We also add TAGNAME to the global $taglist
# variable here.
func_enable_tag ()
{
- # Global variable:
- tagname="$1"
+ # Global variable:
+ tagname=$1
- re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
- re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
- sed_extractcf="/$re_begincf/,/$re_endcf/p"
+ re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
+ re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
+ sed_extractcf=/$re_begincf/,/$re_endcf/p
- # Validate tagname.
- case $tagname in
- *[!-_A-Za-z0-9,/]*)
- func_fatal_error "invalid tag name: $tagname"
- ;;
- esac
+ # Validate tagname.
+ case $tagname in
+ *[!-_A-Za-z0-9,/]*)
+ func_fatal_error "invalid tag name: $tagname"
+ ;;
+ esac
- # Don't test for the "default" C tag, as we know it's
- # there but not specially marked.
- case $tagname in
- CC) ;;
+ # Don't test for the "default" C tag, as we know it's
+ # there but not specially marked.
+ case $tagname in
+ CC) ;;
*)
- if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
- taglist="$taglist $tagname"
+ if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
+ taglist="$taglist $tagname"
- # Evaluate the configuration. Be careful to quote the path
- # and the sed script, to avoid splitting on whitespace, but
- # also don't use non-portable quotes within backquotes within
- # quotes we have to do it in 2 steps:
- extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
- eval "$extractedcf"
- else
- func_error "ignoring unknown tag $tagname"
- fi
- ;;
- esac
+ # Evaluate the configuration. Be careful to quote the path
+ # and the sed script, to avoid splitting on whitespace, but
+ # also don't use non-portable quotes within backquotes within
+ # quotes we have to do it in 2 steps:
+ extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
+ eval "$extractedcf"
+ else
+ func_error "ignoring unknown tag $tagname"
+ fi
+ ;;
+ esac
}
+
# func_check_version_match
+# ------------------------
# Ensure that we are using m4 macros, and libtool script from the same
# release of libtool.
func_check_version_match ()
{
- if test "$package_revision" != "$macro_revision"; then
- if test "$VERSION" != "$macro_version"; then
- if test -z "$macro_version"; then
- cat >&2 <<_LT_EOF
+ if test "$package_revision" != "$macro_revision"; then
+ if test "$VERSION" != "$macro_version"; then
+ if test -z "$macro_version"; then
+ cat >&2 <<_LT_EOF
$progname: Version mismatch error. This is $PACKAGE $VERSION, but the
$progname: definition of this LT_INIT comes from an older release.
$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
$progname: and run autoconf again.
_LT_EOF
- else
- cat >&2 <<_LT_EOF
+ else
+ cat >&2 <<_LT_EOF
$progname: Version mismatch error. This is $PACKAGE $VERSION, but the
$progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
$progname: and run autoconf again.
_LT_EOF
- fi
- else
- cat >&2 <<_LT_EOF
+ fi
+ else
+ cat >&2 <<_LT_EOF
$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision,
$progname: but the definition of this LT_INIT comes from revision $macro_revision.
$progname: You should recreate aclocal.m4 with macros from revision $package_revision
$progname: of $PACKAGE $VERSION and run autoconf again.
_LT_EOF
+ fi
+
+ exit $EXIT_MISMATCH
fi
-
- exit $EXIT_MISMATCH
- fi
}
-# Shorthand for --mode=foo, only valid as the first argument
-case $1 in
-clean|clea|cle|cl)
- shift; set dummy --mode clean ${1+"$@"}; shift
- ;;
-compile|compil|compi|comp|com|co|c)
- shift; set dummy --mode compile ${1+"$@"}; shift
- ;;
-execute|execut|execu|exec|exe|ex|e)
- shift; set dummy --mode execute ${1+"$@"}; shift
- ;;
-finish|finis|fini|fin|fi|f)
- shift; set dummy --mode finish ${1+"$@"}; shift
- ;;
-install|instal|insta|inst|ins|in|i)
- shift; set dummy --mode install ${1+"$@"}; shift
- ;;
-link|lin|li|l)
- shift; set dummy --mode link ${1+"$@"}; shift
- ;;
-uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
- shift; set dummy --mode uninstall ${1+"$@"}; shift
- ;;
-esac
+# libtool_options_prep [ARG]...
+# -----------------------------
+# Preparation for options parsed by libtool.
+libtool_options_prep ()
+{
+ $debug_mode
+ # Option defaults:
+ opt_config=false
+ opt_dlopen=
+ opt_dry_run=false
+ opt_help=false
+ opt_mode=
+ opt_preserve_dup_deps=false
+ opt_quiet=false
+ nonopt=
+ preserve_args=
-# Option defaults:
-opt_debug=:
-opt_dry_run=false
-opt_config=false
-opt_preserve_dup_deps=false
-opt_features=false
-opt_finish=false
-opt_help=false
-opt_help_all=false
-opt_silent=:
-opt_warning=:
-opt_verbose=:
-opt_silent=false
-opt_verbose=false
+ # Shorthand for --mode=foo, only valid as the first argument
+ case $1 in
+ clean|clea|cle|cl)
+ shift; set dummy --mode clean ${1+"$@"}; shift
+ ;;
+ compile|compil|compi|comp|com|co|c)
+ shift; set dummy --mode compile ${1+"$@"}; shift
+ ;;
+ execute|execut|execu|exec|exe|ex|e)
+ shift; set dummy --mode execute ${1+"$@"}; shift
+ ;;
+ finish|finis|fini|fin|fi|f)
+ shift; set dummy --mode finish ${1+"$@"}; shift
+ ;;
+ install|instal|insta|inst|ins|in|i)
+ shift; set dummy --mode install ${1+"$@"}; shift
+ ;;
+ link|lin|li|l)
+ shift; set dummy --mode link ${1+"$@"}; shift
+ ;;
+ uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
+ shift; set dummy --mode uninstall ${1+"$@"}; shift
+ ;;
+ esac
+ # Pass back the list of options.
+ func_quote_for_eval ${1+"$@"}
+ libtool_options_prep_result=$func_quote_for_eval_result
+}
+func_add_hook func_options_prep libtool_options_prep
-# Parse options once, thoroughly. This comes as soon as possible in the
-# script to make things like `--version' happen as quickly as we can.
+
+# libtool_parse_options [ARG]...
+# ---------------------------------
+# Provide handling for libtool specific options.
+libtool_parse_options ()
{
- # this just eases exit handling
- while test $# -gt 0; do
- opt="$1"
- shift
- case $opt in
- --debug|-x) opt_debug='set -x'
- func_echo "enabling shell trace mode"
- $opt_debug
- ;;
- --dry-run|--dryrun|-n)
- opt_dry_run=:
- ;;
- --config)
- opt_config=:
-func_config
- ;;
- --dlopen|-dlopen)
- optarg="$1"
- opt_dlopen="${opt_dlopen+$opt_dlopen
-}$optarg"
- shift
- ;;
- --preserve-dup-deps)
- opt_preserve_dup_deps=:
- ;;
- --features)
- opt_features=:
-func_features
- ;;
- --finish)
- opt_finish=:
-set dummy --mode finish ${1+"$@"}; shift
- ;;
- --help)
- opt_help=:
- ;;
- --help-all)
- opt_help_all=:
-opt_help=': help-all'
- ;;
- --mode)
- test $# = 0 && func_missing_arg $opt && break
- optarg="$1"
- opt_mode="$optarg"
-case $optarg in
- # Valid mode arguments:
- clean|compile|execute|finish|install|link|relink|uninstall) ;;
+ $debug_cmd
- # Catch anything else as an error
- *) func_error "invalid argument for $opt"
- exit_cmd=exit
- break
- ;;
-esac
- shift
- ;;
- --no-silent|--no-quiet)
- opt_silent=false
-func_append preserve_args " $opt"
- ;;
- --no-warning|--no-warn)
- opt_warning=false
-func_append preserve_args " $opt"
- ;;
- --no-verbose)
- opt_verbose=false
-func_append preserve_args " $opt"
- ;;
- --silent|--quiet)
- opt_silent=:
-func_append preserve_args " $opt"
- opt_verbose=false
- ;;
- --verbose|-v)
- opt_verbose=:
-func_append preserve_args " $opt"
-opt_silent=false
- ;;
- --tag)
- test $# = 0 && func_missing_arg $opt && break
- optarg="$1"
- opt_tag="$optarg"
-func_append preserve_args " $opt $optarg"
-func_enable_tag "$optarg"
- shift
- ;;
+ # Perform our own loop to consume as many options as possible in
+ # each iteration.
+ while test $# -gt 0; do
+ _G_opt=$1
+ shift
+ case $_G_opt in
+ --dry-run|--dryrun|-n)
+ opt_dry_run=:
+ ;;
- -\?|-h) func_usage ;;
- --help) func_help ;;
- --version) func_version ;;
+ --config) func_config ;;
- # Separate optargs to long options:
- --*=*)
- func_split_long_opt "$opt"
- set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"}
- shift
- ;;
+ --dlopen|-dlopen)
+ opt_dlopen="${opt_dlopen+$opt_dlopen
+}$1"
+ shift
+ ;;
- # Separate non-argument short options:
- -\?*|-h*|-n*|-v*)
- func_split_short_opt "$opt"
- set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"}
- shift
- ;;
+ --preserve-dup-deps)
+ opt_preserve_dup_deps=: ;;
- --) break ;;
- -*) func_fatal_help "unrecognized option \`$opt'" ;;
- *) set dummy "$opt" ${1+"$@"}; shift; break ;;
- esac
- done
+ --features) func_features ;;
- # Validate options:
+ --finish) set dummy --mode finish ${1+"$@"}; shift ;;
- # save first non-option argument
- if test "$#" -gt 0; then
- nonopt="$opt"
- shift
- fi
+ --help) opt_help=: ;;
- # preserve --debug
- test "$opt_debug" = : || func_append preserve_args " --debug"
+ --help-all) opt_help=': help-all' ;;
- case $host in
- *cygwin* | *mingw* | *pw32* | *cegcc*)
- # don't eliminate duplications in $postdeps and $predeps
- opt_duplicate_compiler_generated_deps=:
- ;;
- *)
- opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
- ;;
- esac
+ --mode) test $# = 0 && func_missing_arg $_G_opt && break
+ opt_mode=$1
+ case $1 in
+ # Valid mode arguments:
+ clean|compile|execute|finish|install|link|relink|uninstall) ;;
- $opt_help || {
- # Sanity checks first:
- func_check_version_match
+ # Catch anything else as an error
+ *) func_error "invalid argument for $_G_opt"
+ exit_cmd=exit
+ break
+ ;;
+ esac
+ shift
+ ;;
- if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
- func_fatal_configuration "not configured to build any kind of library"
- fi
+ --no-silent|--no-quiet)
+ opt_quiet=false
+ func_append preserve_args " $_G_opt"
+ ;;
- # Darwin sucks
- eval std_shrext=\"$shrext_cmds\"
+ --no-warnings|--no-warning|--no-warn)
+ opt_warning=false
+ func_append preserve_args " $_G_opt"
+ ;;
- # Only execute mode is allowed to have -dlopen flags.
- if test -n "$opt_dlopen" && test "$opt_mode" != execute; then
- func_error "unrecognized option \`-dlopen'"
- $ECHO "$help" 1>&2
- exit $EXIT_FAILURE
+ --no-verbose)
+ opt_verbose=false
+ func_append preserve_args " $_G_opt"
+ ;;
+
+ --silent|--quiet)
+ opt_quiet=:
+ opt_verbose=false
+ func_append preserve_args " $_G_opt"
+ ;;
+
+ --tag) test $# = 0 && func_missing_arg $_G_opt && break
+ opt_tag=$1
+ func_append preserve_args " $_G_opt $1"
+ func_enable_tag "$1"
+ shift
+ ;;
+
+ --verbose|-v) opt_quiet=false
+ opt_verbose=:
+ func_append preserve_args " $_G_opt"
+ ;;
+
+ # An option not handled by this hook function:
+ *) set dummy "$_G_opt" ${1+"$@"}; shift; break ;;
+ esac
+ done
+
+
+ # save modified positional parameters for caller
+ func_quote_for_eval ${1+"$@"}
+ libtool_parse_options_result=$func_quote_for_eval_result
+}
+func_add_hook func_parse_options libtool_parse_options
+
+
+
+# libtool_validate_options [ARG]...
+# ---------------------------------
+# Perform any sanity checks on option settings and/or unconsumed
+# arguments.
+libtool_validate_options ()
+{
+ # save first non-option argument
+ if test 0 -lt $#; then
+ nonopt=$1
+ shift
fi
- # Change the help message to a mode-specific one.
- generic_help="$help"
- help="Try \`$progname --help --mode=$opt_mode' for more information."
- }
+ # preserve --debug
+ test : = "$debug_cmd" || func_append preserve_args " --debug"
+ case $host in
+ # Solaris2 added to fix http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16452
+ # see also: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59788
+ *cygwin* | *mingw* | *pw32* | *cegcc* | *solaris2* | *os2*)
+ # don't eliminate duplications in $postdeps and $predeps
+ opt_duplicate_compiler_generated_deps=:
+ ;;
+ *)
+ opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
+ ;;
+ esac
- # Bail if the options were screwed
- $exit_cmd $EXIT_FAILURE
+ $opt_help || {
+ # Sanity checks first:
+ func_check_version_match
+
+ test yes != "$build_libtool_libs" \
+ && test yes != "$build_old_libs" \
+ && func_fatal_configuration "not configured to build any kind of library"
+
+ # Darwin sucks
+ eval std_shrext=\"$shrext_cmds\"
+
+ # Only execute mode is allowed to have -dlopen flags.
+ if test -n "$opt_dlopen" && test execute != "$opt_mode"; then
+ func_error "unrecognized option '-dlopen'"
+ $ECHO "$help" 1>&2
+ exit $EXIT_FAILURE
+ fi
+
+ # Change the help message to a mode-specific one.
+ generic_help=$help
+ help="Try '$progname --help --mode=$opt_mode' for more information."
+ }
+
+ # Pass back the unparsed argument list
+ func_quote_for_eval ${1+"$@"}
+ libtool_validate_options_result=$func_quote_for_eval_result
}
+func_add_hook func_validate_options libtool_validate_options
+# Process options as early as possible so that --help and --version
+# can return quickly.
+func_options ${1+"$@"}
+eval set dummy "$func_options_result"; shift
+
## ----------- ##
## Main. ##
## ----------- ##
+magic='%%%MAGIC variable%%%'
+magic_exe='%%%MAGIC EXE variable%%%'
+
+# Global variables.
+extracted_archives=
+extracted_serial=0
+
+# If this variable is set in any of the actions, the command in it
+# will be execed at the end. This prevents here-documents from being
+# left over by shells.
+exec_cmd=
+
+
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+ eval 'cat <<_LTECHO_EOF
+$1
+_LTECHO_EOF'
+}
+
+# func_generated_by_libtool
+# True iff stdin has been generated by Libtool. This function is only
+# a basic sanity check; it will hardly flush out determined imposters.
+func_generated_by_libtool_p ()
+{
+ $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
+}
+
# func_lalib_p file
-# True iff FILE is a libtool `.la' library or `.lo' object file.
+# True iff FILE is a libtool '.la' library or '.lo' object file.
# This function is only a basic sanity check; it will hardly flush out
# determined imposters.
func_lalib_p ()
{
test -f "$1" &&
- $SED -e 4q "$1" 2>/dev/null \
- | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
+ $SED -e 4q "$1" 2>/dev/null | func_generated_by_libtool_p
}
# func_lalib_unsafe_p file
-# True iff FILE is a libtool `.la' library or `.lo' object file.
+# True iff FILE is a libtool '.la' library or '.lo' object file.
# This function implements the same check as func_lalib_p without
# resorting to external programs. To this end, it redirects stdin and
# closes it afterwards, without saving the original file descriptor.
# As a safety measure, use it only where a negative result would be
-# fatal anyway. Works if `file' does not exist.
+# fatal anyway. Works if 'file' does not exist.
func_lalib_unsafe_p ()
{
lalib_p=no
@@ -1249,13 +2521,13 @@
for lalib_p_l in 1 2 3 4
do
read lalib_p_line
- case "$lalib_p_line" in
+ case $lalib_p_line in
\#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
esac
done
exec 0<&5 5<&-
fi
- test "$lalib_p" = yes
+ test yes = "$lalib_p"
}
# func_ltwrapper_script_p file
@@ -1264,7 +2536,8 @@
# determined imposters.
func_ltwrapper_script_p ()
{
- func_lalib_p "$1"
+ test -f "$1" &&
+ $lt_truncate_bin < "$1" 2>/dev/null | func_generated_by_libtool_p
}
# func_ltwrapper_executable_p file
@@ -1289,7 +2562,7 @@
{
func_dirname_and_basename "$1" "" "."
func_stripname '' '.exe' "$func_basename_result"
- func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
+ func_ltwrapper_scriptname_result=$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper
}
# func_ltwrapper_p file
@@ -1308,11 +2581,13 @@
# FAIL_CMD may read-access the current command in variable CMD!
func_execute_cmds ()
{
- $opt_debug
+ $debug_cmd
+
save_ifs=$IFS; IFS='~'
for cmd in $1; do
+ IFS=$sp$nl
+ eval cmd=\"$cmd\"
IFS=$save_ifs
- eval cmd=\"$cmd\"
func_show_eval "$cmd" "${2-:}"
done
IFS=$save_ifs
@@ -1324,10 +2599,11 @@
# Note that it is not necessary on cygwin/mingw to append a dot to
# FILE even if both FILE and FILE.exe exist: automatic-append-.exe
# behavior happens only for exec(3), not for open(2)! Also, sourcing
-# `FILE.' does not work on cygwin managed mounts.
+# 'FILE.' does not work on cygwin managed mounts.
func_source ()
{
- $opt_debug
+ $debug_cmd
+
case $1 in
*/* | *\\*) . "$1" ;;
*) . "./$1" ;;
@@ -1354,10 +2630,10 @@
# store the result into func_replace_sysroot_result.
func_replace_sysroot ()
{
- case "$lt_sysroot:$1" in
+ case $lt_sysroot:$1 in
?*:"$lt_sysroot"*)
func_stripname "$lt_sysroot" '' "$1"
- func_replace_sysroot_result="=$func_stripname_result"
+ func_replace_sysroot_result='='$func_stripname_result
;;
*)
# Including no sysroot.
@@ -1374,7 +2650,8 @@
# arg is usually of the form 'gcc ...'
func_infer_tag ()
{
- $opt_debug
+ $debug_cmd
+
if test -n "$available_tags" && test -z "$tagname"; then
CC_quoted=
for arg in $CC; do
@@ -1393,7 +2670,7 @@
for z in $available_tags; do
if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
# Evaluate the configuration.
- eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
+ eval "`$SED -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
CC_quoted=
for arg in $CC; do
# Double-quote args containing other shell metacharacters.
@@ -1418,7 +2695,7 @@
# line option must be used.
if test -z "$tagname"; then
func_echo "unable to infer tagged configuration"
- func_fatal_error "specify a tag with \`--tag'"
+ func_fatal_error "specify a tag with '--tag'"
# else
# func_verbose "using $tagname tagged configuration"
fi
@@ -1434,15 +2711,15 @@
# but don't create it if we're doing a dry run.
func_write_libtool_object ()
{
- write_libobj=${1}
- if test "$build_libtool_libs" = yes; then
- write_lobj=\'${2}\'
+ write_libobj=$1
+ if test yes = "$build_libtool_libs"; then
+ write_lobj=\'$2\'
else
write_lobj=none
fi
- if test "$build_old_libs" = yes; then
- write_oldobj=\'${3}\'
+ if test yes = "$build_old_libs"; then
+ write_oldobj=\'$3\'
else
write_oldobj=none
fi
@@ -1450,7 +2727,7 @@
$opt_dry_run || {
cat >${write_libobj}T <<EOF
# $write_libobj - a libtool object file
-# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+# Generated by $PROGRAM (GNU $PACKAGE) $VERSION
#
# Please DO NOT delete this file!
# It is necessary for linking the library.
@@ -1462,7 +2739,7 @@
non_pic_object=$write_oldobj
EOF
- $MV "${write_libobj}T" "${write_libobj}"
+ $MV "${write_libobj}T" "$write_libobj"
}
}
@@ -1482,8 +2759,9 @@
# be empty on error (or when ARG is empty)
func_convert_core_file_wine_to_w32 ()
{
- $opt_debug
- func_convert_core_file_wine_to_w32_result="$1"
+ $debug_cmd
+
+ func_convert_core_file_wine_to_w32_result=$1
if test -n "$1"; then
# Unfortunately, winepath does not exit with a non-zero error code, so we
# are forced to check the contents of stdout. On the other hand, if the
@@ -1491,9 +2769,9 @@
# *an error message* to stdout. So we must check for both error code of
# zero AND non-empty stdout, which explains the odd construction:
func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null`
- if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then
+ if test "$?" -eq 0 && test -n "$func_convert_core_file_wine_to_w32_tmp"; then
func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" |
- $SED -e "$lt_sed_naive_backslashify"`
+ $SED -e "$sed_naive_backslashify"`
else
func_convert_core_file_wine_to_w32_result=
fi
@@ -1514,9 +2792,10 @@
# are convertible, then the result may be empty.
func_convert_core_path_wine_to_w32 ()
{
- $opt_debug
+ $debug_cmd
+
# unfortunately, winepath doesn't convert paths, only file names
- func_convert_core_path_wine_to_w32_result=""
+ func_convert_core_path_wine_to_w32_result=
if test -n "$1"; then
oldIFS=$IFS
IFS=:
@@ -1523,9 +2802,9 @@
for func_convert_core_path_wine_to_w32_f in $1; do
IFS=$oldIFS
func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f"
- if test -n "$func_convert_core_file_wine_to_w32_result" ; then
+ if test -n "$func_convert_core_file_wine_to_w32_result"; then
if test -z "$func_convert_core_path_wine_to_w32_result"; then
- func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result"
+ func_convert_core_path_wine_to_w32_result=$func_convert_core_file_wine_to_w32_result
else
func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result"
fi
@@ -1554,7 +2833,8 @@
# environment variable; do not put it in $PATH.
func_cygpath ()
{
- $opt_debug
+ $debug_cmd
+
if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then
func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null`
if test "$?" -ne 0; then
@@ -1563,7 +2843,7 @@
fi
else
func_cygpath_result=
- func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'"
+ func_error "LT_CYGPATH is empty or specifies non-existent file: '$LT_CYGPATH'"
fi
}
#end: func_cygpath
@@ -1574,10 +2854,11 @@
# result in func_convert_core_msys_to_w32_result.
func_convert_core_msys_to_w32 ()
{
- $opt_debug
+ $debug_cmd
+
# awkward: cmd appends spaces to result
func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null |
- $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"`
+ $SED -e 's/[ ]*$//' -e "$sed_naive_backslashify"`
}
#end: func_convert_core_msys_to_w32
@@ -1588,13 +2869,14 @@
# func_to_host_file_result to ARG1).
func_convert_file_check ()
{
- $opt_debug
- if test -z "$2" && test -n "$1" ; then
+ $debug_cmd
+
+ if test -z "$2" && test -n "$1"; then
func_error "Could not determine host file name corresponding to"
- func_error " \`$1'"
+ func_error " '$1'"
func_error "Continuing, but uninstalled executables may not work."
# Fallback:
- func_to_host_file_result="$1"
+ func_to_host_file_result=$1
fi
}
# end func_convert_file_check
@@ -1606,10 +2888,11 @@
# func_to_host_file_result to a simplistic fallback value (see below).
func_convert_path_check ()
{
- $opt_debug
+ $debug_cmd
+
if test -z "$4" && test -n "$3"; then
func_error "Could not determine the host path corresponding to"
- func_error " \`$3'"
+ func_error " '$3'"
func_error "Continuing, but uninstalled executables may not work."
# Fallback. This is a deliberately simplistic "conversion" and
# should not be "improved". See libtool.info.
@@ -1618,7 +2901,7 @@
func_to_host_path_result=`echo "$3" |
$SED -e "$lt_replace_pathsep_chars"`
else
- func_to_host_path_result="$3"
+ func_to_host_path_result=$3
fi
fi
}
@@ -1630,9 +2913,10 @@
# and appending REPL if ORIG matches BACKPAT.
func_convert_path_front_back_pathsep ()
{
- $opt_debug
+ $debug_cmd
+
case $4 in
- $1 ) func_to_host_path_result="$3$func_to_host_path_result"
+ $1 ) func_to_host_path_result=$3$func_to_host_path_result
;;
esac
case $4 in
@@ -1646,7 +2930,7 @@
##################################################
# $build to $host FILE NAME CONVERSION FUNCTIONS #
##################################################
-# invoked via `$to_host_file_cmd ARG'
+# invoked via '$to_host_file_cmd ARG'
#
# In each case, ARG is the path to be converted from $build to $host format.
# Result will be available in $func_to_host_file_result.
@@ -1657,7 +2941,8 @@
# in func_to_host_file_result.
func_to_host_file ()
{
- $opt_debug
+ $debug_cmd
+
$to_host_file_cmd "$1"
}
# end func_to_host_file
@@ -1669,7 +2954,8 @@
# in (the comma separated) LAZY, no conversion takes place.
func_to_tool_file ()
{
- $opt_debug
+ $debug_cmd
+
case ,$2, in
*,"$to_tool_file_cmd",*)
func_to_tool_file_result=$1
@@ -1687,7 +2973,7 @@
# Copy ARG to func_to_host_file_result.
func_convert_file_noop ()
{
- func_to_host_file_result="$1"
+ func_to_host_file_result=$1
}
# end func_convert_file_noop
@@ -1698,11 +2984,12 @@
# func_to_host_file_result.
func_convert_file_msys_to_w32 ()
{
- $opt_debug
- func_to_host_file_result="$1"
+ $debug_cmd
+
+ func_to_host_file_result=$1
if test -n "$1"; then
func_convert_core_msys_to_w32 "$1"
- func_to_host_file_result="$func_convert_core_msys_to_w32_result"
+ func_to_host_file_result=$func_convert_core_msys_to_w32_result
fi
func_convert_file_check "$1" "$func_to_host_file_result"
}
@@ -1714,8 +3001,9 @@
# func_to_host_file_result.
func_convert_file_cygwin_to_w32 ()
{
- $opt_debug
- func_to_host_file_result="$1"
+ $debug_cmd
+
+ func_to_host_file_result=$1
if test -n "$1"; then
# because $build is cygwin, we call "the" cygpath in $PATH; no need to use
# LT_CYGPATH in this case.
@@ -1731,11 +3019,12 @@
# and a working winepath. Returns result in func_to_host_file_result.
func_convert_file_nix_to_w32 ()
{
- $opt_debug
- func_to_host_file_result="$1"
+ $debug_cmd
+
+ func_to_host_file_result=$1
if test -n "$1"; then
func_convert_core_file_wine_to_w32 "$1"
- func_to_host_file_result="$func_convert_core_file_wine_to_w32_result"
+ func_to_host_file_result=$func_convert_core_file_wine_to_w32_result
fi
func_convert_file_check "$1" "$func_to_host_file_result"
}
@@ -1747,12 +3036,13 @@
# Returns result in func_to_host_file_result.
func_convert_file_msys_to_cygwin ()
{
- $opt_debug
- func_to_host_file_result="$1"
+ $debug_cmd
+
+ func_to_host_file_result=$1
if test -n "$1"; then
func_convert_core_msys_to_w32 "$1"
func_cygpath -u "$func_convert_core_msys_to_w32_result"
- func_to_host_file_result="$func_cygpath_result"
+ func_to_host_file_result=$func_cygpath_result
fi
func_convert_file_check "$1" "$func_to_host_file_result"
}
@@ -1765,13 +3055,14 @@
# in func_to_host_file_result.
func_convert_file_nix_to_cygwin ()
{
- $opt_debug
- func_to_host_file_result="$1"
+ $debug_cmd
+
+ func_to_host_file_result=$1
if test -n "$1"; then
# convert from *nix to w32, then use cygpath to convert from w32 to cygwin.
func_convert_core_file_wine_to_w32 "$1"
func_cygpath -u "$func_convert_core_file_wine_to_w32_result"
- func_to_host_file_result="$func_cygpath_result"
+ func_to_host_file_result=$func_cygpath_result
fi
func_convert_file_check "$1" "$func_to_host_file_result"
}
@@ -1781,7 +3072,7 @@
#############################################
# $build to $host PATH CONVERSION FUNCTIONS #
#############################################
-# invoked via `$to_host_path_cmd ARG'
+# invoked via '$to_host_path_cmd ARG'
#
# In each case, ARG is the path to be converted from $build to $host format.
# The result will be available in $func_to_host_path_result.
@@ -1805,10 +3096,11 @@
to_host_path_cmd=
func_init_to_host_path_cmd ()
{
- $opt_debug
+ $debug_cmd
+
if test -z "$to_host_path_cmd"; then
func_stripname 'func_convert_file_' '' "$to_host_file_cmd"
- to_host_path_cmd="func_convert_path_${func_stripname_result}"
+ to_host_path_cmd=func_convert_path_$func_stripname_result
fi
}
@@ -1818,7 +3110,8 @@
# in func_to_host_path_result.
func_to_host_path ()
{
- $opt_debug
+ $debug_cmd
+
func_init_to_host_path_cmd
$to_host_path_cmd "$1"
}
@@ -1829,7 +3122,7 @@
# Copy ARG to func_to_host_path_result.
func_convert_path_noop ()
{
- func_to_host_path_result="$1"
+ func_to_host_path_result=$1
}
# end func_convert_path_noop
@@ -1840,8 +3133,9 @@
# func_to_host_path_result.
func_convert_path_msys_to_w32 ()
{
- $opt_debug
- func_to_host_path_result="$1"
+ $debug_cmd
+
+ func_to_host_path_result=$1
if test -n "$1"; then
# Remove leading and trailing path separator characters from ARG. MSYS
# behavior is inconsistent here; cygpath turns them into '.;' and ';.';
@@ -1849,7 +3143,7 @@
func_stripname : : "$1"
func_to_host_path_tmp1=$func_stripname_result
func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
- func_to_host_path_result="$func_convert_core_msys_to_w32_result"
+ func_to_host_path_result=$func_convert_core_msys_to_w32_result
func_convert_path_check : ";" \
"$func_to_host_path_tmp1" "$func_to_host_path_result"
func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
@@ -1863,8 +3157,9 @@
# func_to_host_file_result.
func_convert_path_cygwin_to_w32 ()
{
- $opt_debug
- func_to_host_path_result="$1"
+ $debug_cmd
+
+ func_to_host_path_result=$1
if test -n "$1"; then
# See func_convert_path_msys_to_w32:
func_stripname : : "$1"
@@ -1883,14 +3178,15 @@
# a working winepath. Returns result in func_to_host_file_result.
func_convert_path_nix_to_w32 ()
{
- $opt_debug
- func_to_host_path_result="$1"
+ $debug_cmd
+
+ func_to_host_path_result=$1
if test -n "$1"; then
# See func_convert_path_msys_to_w32:
func_stripname : : "$1"
func_to_host_path_tmp1=$func_stripname_result
func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
- func_to_host_path_result="$func_convert_core_path_wine_to_w32_result"
+ func_to_host_path_result=$func_convert_core_path_wine_to_w32_result
func_convert_path_check : ";" \
"$func_to_host_path_tmp1" "$func_to_host_path_result"
func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
@@ -1904,8 +3200,9 @@
# Returns result in func_to_host_file_result.
func_convert_path_msys_to_cygwin ()
{
- $opt_debug
- func_to_host_path_result="$1"
+ $debug_cmd
+
+ func_to_host_path_result=$1
if test -n "$1"; then
# See func_convert_path_msys_to_w32:
func_stripname : : "$1"
@@ -1912,7 +3209,7 @@
func_to_host_path_tmp1=$func_stripname_result
func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
func_cygpath -u -p "$func_convert_core_msys_to_w32_result"
- func_to_host_path_result="$func_cygpath_result"
+ func_to_host_path_result=$func_cygpath_result
func_convert_path_check : : \
"$func_to_host_path_tmp1" "$func_to_host_path_result"
func_convert_path_front_back_pathsep ":*" "*:" : "$1"
@@ -1927,8 +3224,9 @@
# func_to_host_file_result.
func_convert_path_nix_to_cygwin ()
{
- $opt_debug
- func_to_host_path_result="$1"
+ $debug_cmd
+
+ func_to_host_path_result=$1
if test -n "$1"; then
# Remove leading and trailing path separator characters from
# ARG. msys behavior is inconsistent here, cygpath turns them
@@ -1937,7 +3235,7 @@
func_to_host_path_tmp1=$func_stripname_result
func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result"
- func_to_host_path_result="$func_cygpath_result"
+ func_to_host_path_result=$func_cygpath_result
func_convert_path_check : : \
"$func_to_host_path_tmp1" "$func_to_host_path_result"
func_convert_path_front_back_pathsep ":*" "*:" : "$1"
@@ -1946,13 +3244,31 @@
# end func_convert_path_nix_to_cygwin
+# func_dll_def_p FILE
+# True iff FILE is a Windows DLL '.def' file.
+# Keep in sync with _LT_DLL_DEF_P in libtool.m4
+func_dll_def_p ()
+{
+ $debug_cmd
+
+ func_dll_def_p_tmp=`$SED -n \
+ -e 's/^[ ]*//' \
+ -e '/^\(;.*\)*$/d' \
+ -e 's/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p' \
+ -e q \
+ "$1"`
+ test DEF = "$func_dll_def_p_tmp"
+}
+
+
# func_mode_compile arg...
func_mode_compile ()
{
- $opt_debug
+ $debug_cmd
+
# Get the compilation command and the source file.
base_compile=
- srcfile="$nonopt" # always keep a non-empty value in "srcfile"
+ srcfile=$nonopt # always keep a non-empty value in "srcfile"
suppress_opt=yes
suppress_output=
arg_mode=normal
@@ -1965,12 +3281,12 @@
case $arg_mode in
arg )
# do not "continue". Instead, add this to base_compile
- lastarg="$arg"
+ lastarg=$arg
arg_mode=normal
;;
target )
- libobj="$arg"
+ libobj=$arg
arg_mode=normal
continue
;;
@@ -1980,7 +3296,7 @@
case $arg in
-o)
test -n "$libobj" && \
- func_fatal_error "you cannot specify \`-o' more than once"
+ func_fatal_error "you cannot specify '-o' more than once"
arg_mode=target
continue
;;
@@ -2009,12 +3325,12 @@
func_stripname '-Wc,' '' "$arg"
args=$func_stripname_result
lastarg=
- save_ifs="$IFS"; IFS=','
+ save_ifs=$IFS; IFS=,
for arg in $args; do
- IFS="$save_ifs"
+ IFS=$save_ifs
func_append_quoted lastarg "$arg"
done
- IFS="$save_ifs"
+ IFS=$save_ifs
func_stripname ' ' '' "$lastarg"
lastarg=$func_stripname_result
@@ -2027,8 +3343,8 @@
# Accept the current argument as the source file.
# The previous "srcfile" becomes the current argument.
#
- lastarg="$srcfile"
- srcfile="$arg"
+ lastarg=$srcfile
+ srcfile=$arg
;;
esac # case $arg
;;
@@ -2043,13 +3359,13 @@
func_fatal_error "you must specify an argument for -Xcompile"
;;
target)
- func_fatal_error "you must specify a target with \`-o'"
+ func_fatal_error "you must specify a target with '-o'"
;;
*)
# Get the name of the library object.
test -z "$libobj" && {
func_basename "$srcfile"
- libobj="$func_basename_result"
+ libobj=$func_basename_result
}
;;
esac
@@ -2069,7 +3385,7 @@
case $libobj in
*.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
*)
- func_fatal_error "cannot determine name of library object from \`$libobj'"
+ func_fatal_error "cannot determine name of library object from '$libobj'"
;;
esac
@@ -2078,8 +3394,8 @@
for arg in $later; do
case $arg in
-shared)
- test "$build_libtool_libs" != yes && \
- func_fatal_configuration "can not build a shared library"
+ test yes = "$build_libtool_libs" \
+ || func_fatal_configuration "cannot build a shared library"
build_old_libs=no
continue
;;
@@ -2105,17 +3421,17 @@
func_quote_for_eval "$libobj"
test "X$libobj" != "X$func_quote_for_eval_result" \
&& $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"' &()|`$[]' \
- && func_warning "libobj name \`$libobj' may not contain shell special characters."
+ && func_warning "libobj name '$libobj' may not contain shell special characters."
func_dirname_and_basename "$obj" "/" ""
- objname="$func_basename_result"
- xdir="$func_dirname_result"
- lobj=${xdir}$objdir/$objname
+ objname=$func_basename_result
+ xdir=$func_dirname_result
+ lobj=$xdir$objdir/$objname
test -z "$base_compile" && \
func_fatal_help "you must specify a compilation command"
# Delete any leftover library objects.
- if test "$build_old_libs" = yes; then
+ if test yes = "$build_old_libs"; then
removelist="$obj $lobj $libobj ${libobj}T"
else
removelist="$lobj $libobj ${libobj}T"
@@ -2127,7 +3443,7 @@
pic_mode=default
;;
esac
- if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
+ if test no = "$pic_mode" && test pass_all != "$deplibs_check_method"; then
# non-PIC code in shared libraries is not supported
pic_mode=default
fi
@@ -2134,9 +3450,9 @@
# Calculate the filename of the output object if compiler does
# not support -o with -c
- if test "$compiler_c_o" = no; then
- output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext}
- lockfile="$output_obj.lock"
+ if test no = "$compiler_c_o"; then
+ output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.$objext
+ lockfile=$output_obj.lock
else
output_obj=
need_locks=no
@@ -2145,12 +3461,12 @@
# Lock this critical section if it is needed
# We use this script file to make the link, it avoids creating a new file
- if test "$need_locks" = yes; then
+ if test yes = "$need_locks"; then
until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
func_echo "Waiting for $lockfile to be removed"
sleep 2
done
- elif test "$need_locks" = warn; then
+ elif test warn = "$need_locks"; then
if test -f "$lockfile"; then
$ECHO "\
*** ERROR, $lockfile exists and contains:
@@ -2158,7 +3474,7 @@
This indicates that another process is trying to use the same
temporary object file, and libtool could not work around it because
-your compiler does not support \`-c' and \`-o' together. If you
+your compiler does not support '-c' and '-o' together. If you
repeat this compilation, it may succeed, by chance, but you had better
avoid parallel builds (make -j) in this platform, or get a better
compiler."
@@ -2180,11 +3496,11 @@
qsrcfile=$func_quote_for_eval_result
# Only build a PIC object if we are building libtool libraries.
- if test "$build_libtool_libs" = yes; then
+ if test yes = "$build_libtool_libs"; then
# Without this assignment, base_compile gets emptied.
fbsd_hideous_sh_bug=$base_compile
- if test "$pic_mode" != no; then
+ if test no != "$pic_mode"; then
command="$base_compile $qsrcfile $pic_flag"
else
# Don't build PIC code
@@ -2201,7 +3517,7 @@
func_show_eval_locale "$command" \
'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
- if test "$need_locks" = warn &&
+ if test warn = "$need_locks" &&
test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
$ECHO "\
*** ERROR, $lockfile contains:
@@ -2212,7 +3528,7 @@
This indicates that another process is trying to use the same
temporary object file, and libtool could not work around it because
-your compiler does not support \`-c' and \`-o' together. If you
+your compiler does not support '-c' and '-o' together. If you
repeat this compilation, it may succeed, by chance, but you had better
avoid parallel builds (make -j) in this platform, or get a better
compiler."
@@ -2228,20 +3544,20 @@
fi
# Allow error messages only from the first compilation.
- if test "$suppress_opt" = yes; then
+ if test yes = "$suppress_opt"; then
suppress_output=' >/dev/null 2>&1'
fi
fi
# Only build a position-dependent object if we build old libraries.
- if test "$build_old_libs" = yes; then
- if test "$pic_mode" != yes; then
+ if test yes = "$build_old_libs"; then
+ if test yes != "$pic_mode"; then
# Don't build PIC code
command="$base_compile $qsrcfile$pie_flag"
else
command="$base_compile $qsrcfile $pic_flag"
fi
- if test "$compiler_c_o" = yes; then
+ if test yes = "$compiler_c_o"; then
func_append command " -o $obj"
fi
@@ -2250,7 +3566,7 @@
func_show_eval_locale "$command" \
'$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
- if test "$need_locks" = warn &&
+ if test warn = "$need_locks" &&
test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
$ECHO "\
*** ERROR, $lockfile contains:
@@ -2261,7 +3577,7 @@
This indicates that another process is trying to use the same
temporary object file, and libtool could not work around it because
-your compiler does not support \`-c' and \`-o' together. If you
+your compiler does not support '-c' and '-o' together. If you
repeat this compilation, it may succeed, by chance, but you had better
avoid parallel builds (make -j) in this platform, or get a better
compiler."
@@ -2281,7 +3597,7 @@
func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
# Unlock the critical section if it was locked
- if test "$need_locks" != no; then
+ if test no != "$need_locks"; then
removelist=$lockfile
$RM "$lockfile"
fi
@@ -2291,7 +3607,7 @@
}
$opt_help || {
- test "$opt_mode" = compile && func_mode_compile ${1+"$@"}
+ test compile = "$opt_mode" && func_mode_compile ${1+"$@"}
}
func_mode_help ()
@@ -2311,7 +3627,7 @@
Remove files from the build directory.
RM is the name of the program to use to delete files associated with each FILE
-(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
+(typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed
to RM.
If FILE is a libtool library, object or program, all the files associated
@@ -2330,16 +3646,16 @@
-no-suppress do not suppress compiler output for multiple passes
-prefer-pic try to build PIC objects only
-prefer-non-pic try to build non-PIC objects only
- -shared do not build a \`.o' file suitable for static linking
- -static only build a \`.o' file suitable for static linking
+ -shared do not build a '.o' file suitable for static linking
+ -static only build a '.o' file suitable for static linking
-Wc,FLAG pass FLAG directly to the compiler
-COMPILE-COMMAND is a command to be used in creating a \`standard' object file
+COMPILE-COMMAND is a command to be used in creating a 'standard' object file
from the given SOURCEFILE.
The output file name is determined by removing the directory component from
-SOURCEFILE, then substituting the C source code suffix \`.c' with the
-library object suffix, \`.lo'."
+SOURCEFILE, then substituting the C source code suffix '.c' with the
+library object suffix, '.lo'."
;;
execute)
@@ -2352,7 +3668,7 @@
-dlopen FILE add the directory containing FILE to the library path
-This mode sets the library path environment variable according to \`-dlopen'
+This mode sets the library path environment variable according to '-dlopen'
flags.
If any of the ARGS are libtool executable wrappers, then they are translated
@@ -2371,7 +3687,7 @@
Each LIBDIR is a directory that contains libtool libraries.
The commands that this mode executes may require superuser privileges. Use
-the \`--dry-run' option if you just want to see what would be executed."
+the '--dry-run' option if you just want to see what would be executed."
;;
install)
@@ -2381,7 +3697,7 @@
Install executables or libraries.
INSTALL-COMMAND is the installation command. The first component should be
-either the \`install' or \`cp' program.
+either the 'install' or 'cp' program.
The following components of INSTALL-COMMAND are treated specially:
@@ -2407,7 +3723,7 @@
-avoid-version do not add a version suffix if possible
-bindir BINDIR specify path to binaries directory (for systems where
libraries must be found in the PATH setting at runtime)
- -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime
+ -dlopen FILE '-dlpreopen' FILE if it cannot be dlopened at runtime
-dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
-export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
-export-symbols SYMFILE
@@ -2421,7 +3737,8 @@
-no-install link a not-installable executable
-no-undefined declare that a library does not refer to external symbols
-o OUTPUT-FILE create OUTPUT-FILE from the specified objects
- -objectlist FILE Use a list of object files found in FILE to specify objects
+ -objectlist FILE use a list of object files found in FILE to specify objects
+ -os2dllname NAME force a short DLL name on OS/2 (no effect on other OSes)
-precious-files-regex REGEX
don't remove output files matching REGEX
-release RELEASE specify package release information
@@ -2441,20 +3758,20 @@
-Xlinker FLAG pass linker-specific FLAG directly to the linker
-XCClinker FLAG pass link-specific FLAG to the compiler driver (CC)
-All other options (arguments beginning with \`-') are ignored.
+All other options (arguments beginning with '-') are ignored.
-Every other argument is treated as a filename. Files ending in \`.la' are
+Every other argument is treated as a filename. Files ending in '.la' are
treated as uninstalled libtool libraries, other files are standard or library
object files.
-If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
-only library objects (\`.lo' files) may be specified, and \`-rpath' is
+If the OUTPUT-FILE ends in '.la', then a libtool library is created,
+only library objects ('.lo' files) may be specified, and '-rpath' is
required, except when creating a convenience library.
-If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
-using \`ar' and \`ranlib', or on Windows using \`lib'.
+If OUTPUT-FILE ends in '.a' or '.lib', then a standard library is created
+using 'ar' and 'ranlib', or on Windows using 'lib'.
-If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
+If OUTPUT-FILE ends in '.lo' or '.$objext', then a reloadable object file
is created, otherwise an executable program is created."
;;
@@ -2465,7 +3782,7 @@
Remove libraries from an installation directory.
RM is the name of the program to use to delete files associated with each FILE
-(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed
+(typically '/bin/rm'). RM-OPTIONS are options (such as '-f') to be passed
to RM.
If FILE is a libtool library, all the files associated with it are deleted.
@@ -2473,17 +3790,17 @@
;;
*)
- func_fatal_help "invalid operation mode \`$opt_mode'"
+ func_fatal_help "invalid operation mode '$opt_mode'"
;;
esac
echo
- $ECHO "Try \`$progname --help' for more information about other modes."
+ $ECHO "Try '$progname --help' for more information about other modes."
}
# Now that we've collected a possible --mode arg, show help if necessary
if $opt_help; then
- if test "$opt_help" = :; then
+ if test : = "$opt_help"; then
func_mode_help
else
{
@@ -2491,7 +3808,7 @@
for opt_mode in compile link execute install finish uninstall clean; do
func_mode_help
done
- } | sed -n '1p; 2,$s/^Usage:/ or: /p'
+ } | $SED -n '1p; 2,$s/^Usage:/ or: /p'
{
func_help noexit
for opt_mode in compile link execute install finish uninstall clean; do
@@ -2499,7 +3816,7 @@
func_mode_help
done
} |
- sed '1d
+ $SED '1d
/^When reporting/,/^Report/{
H
d
@@ -2516,9 +3833,10 @@
# func_mode_execute arg...
func_mode_execute ()
{
- $opt_debug
+ $debug_cmd
+
# The first argument is the command name.
- cmd="$nonopt"
+ cmd=$nonopt
test -z "$cmd" && \
func_fatal_help "you must specify a COMMAND"
@@ -2525,7 +3843,7 @@
# Handle -dlopen flags immediately.
for file in $opt_dlopen; do
test -f "$file" \
- || func_fatal_help "\`$file' is not a file"
+ || func_fatal_help "'$file' is not a file"
dir=
case $file in
@@ -2535,7 +3853,7 @@
# Check to see that this really is a libtool archive.
func_lalib_unsafe_p "$file" \
- || func_fatal_help "\`$lib' is not a valid libtool archive"
+ || func_fatal_help "'$lib' is not a valid libtool archive"
# Read the libtool library.
dlname=
@@ -2546,18 +3864,18 @@
if test -z "$dlname"; then
# Warn if it was a shared library.
test -n "$library_names" && \
- func_warning "\`$file' was not linked with \`-export-dynamic'"
+ func_warning "'$file' was not linked with '-export-dynamic'"
continue
fi
func_dirname "$file" "" "."
- dir="$func_dirname_result"
+ dir=$func_dirname_result
if test -f "$dir/$objdir/$dlname"; then
func_append dir "/$objdir"
else
if test ! -f "$dir/$dlname"; then
- func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'"
+ func_fatal_error "cannot find '$dlname' in '$dir' or '$dir/$objdir'"
fi
fi
;;
@@ -2565,11 +3883,11 @@
*.lo)
# Just add the directory containing the .lo file.
func_dirname "$file" "" "."
- dir="$func_dirname_result"
+ dir=$func_dirname_result
;;
*)
- func_warning "\`-dlopen' is ignored for non-libtool libraries and objects"
+ func_warning "'-dlopen' is ignored for non-libtool libraries and objects"
continue
;;
esac
@@ -2576,7 +3894,7 @@
# Get the absolute pathname.
absdir=`cd "$dir" && pwd`
- test -n "$absdir" && dir="$absdir"
+ test -n "$absdir" && dir=$absdir
# Now add the directory to shlibpath_var.
if eval "test -z \"\$$shlibpath_var\""; then
@@ -2588,7 +3906,7 @@
# This variable tells wrapper scripts just to set shlibpath_var
# rather than running their programs.
- libtool_execute_magic="$magic"
+ libtool_execute_magic=$magic
# Check if any of the arguments is a wrapper script.
args=
@@ -2601,12 +3919,12 @@
if func_ltwrapper_script_p "$file"; then
func_source "$file"
# Transform arg to wrapped name.
- file="$progdir/$program"
+ file=$progdir/$program
elif func_ltwrapper_executable_p "$file"; then
func_ltwrapper_scriptname "$file"
func_source "$func_ltwrapper_scriptname_result"
# Transform arg to wrapped name.
- file="$progdir/$program"
+ file=$progdir/$program
fi
;;
esac
@@ -2614,8 +3932,16 @@
func_append_quoted args "$file"
done
- if test "X$opt_dry_run" = Xfalse; then
+ if $opt_dry_run; then
+ # Display what would be done.
if test -n "$shlibpath_var"; then
+ eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
+ echo "export $shlibpath_var"
+ fi
+ $ECHO "$cmd$args"
+ exit $EXIT_SUCCESS
+ else
+ if test -n "$shlibpath_var"; then
# Export the shlibpath_var.
eval "export $shlibpath_var"
fi
@@ -2631,25 +3957,18 @@
done
# Now prepare to actually exec the command.
- exec_cmd="\$cmd$args"
- else
- # Display what would be done.
- if test -n "$shlibpath_var"; then
- eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
- echo "export $shlibpath_var"
- fi
- $ECHO "$cmd$args"
- exit $EXIT_SUCCESS
+ exec_cmd=\$cmd$args
fi
}
-test "$opt_mode" = execute && func_mode_execute ${1+"$@"}
+test execute = "$opt_mode" && func_mode_execute ${1+"$@"}
# func_mode_finish arg...
func_mode_finish ()
{
- $opt_debug
+ $debug_cmd
+
libs=
libdirs=
admincmds=
@@ -2663,11 +3982,11 @@
if func_lalib_unsafe_p "$opt"; then
func_append libs " $opt"
else
- func_warning "\`$opt' is not a valid libtool archive"
+ func_warning "'$opt' is not a valid libtool archive"
fi
else
- func_fatal_error "invalid argument \`$opt'"
+ func_fatal_error "invalid argument '$opt'"
fi
done
@@ -2682,12 +4001,12 @@
# Remove sysroot references
if $opt_dry_run; then
for lib in $libs; do
- echo "removing references to $lt_sysroot and \`=' prefixes from $lib"
+ echo "removing references to $lt_sysroot and '=' prefixes from $lib"
done
else
tmpdir=`func_mktempdir`
for lib in $libs; do
- sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \
+ $SED -e "$sysroot_cmd s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \
> $tmpdir/tmp-la
mv -f $tmpdir/tmp-la $lib
done
@@ -2712,7 +4031,7 @@
fi
# Exit here if they wanted silent mode.
- $opt_silent && exit $EXIT_SUCCESS
+ $opt_quiet && exit $EXIT_SUCCESS
if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
echo "----------------------------------------------------------------------"
@@ -2723,14 +4042,14 @@
echo
echo "If you ever happen to want to link against installed libraries"
echo "in a given directory, LIBDIR, you must either use libtool, and"
- echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
+ echo "specify the full pathname of the library, or use the '-LLIBDIR'"
echo "flag during linking and do at least one of the following:"
if test -n "$shlibpath_var"; then
- echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
+ echo " - add LIBDIR to the '$shlibpath_var' environment variable"
echo " during execution"
fi
if test -n "$runpath_var"; then
- echo " - add LIBDIR to the \`$runpath_var' environment variable"
+ echo " - add LIBDIR to the '$runpath_var' environment variable"
echo " during linking"
fi
if test -n "$hardcode_libdir_flag_spec"; then
@@ -2737,13 +4056,13 @@
libdir=LIBDIR
eval flag=\"$hardcode_libdir_flag_spec\"
- $ECHO " - use the \`$flag' linker flag"
+ $ECHO " - use the '$flag' linker flag"
fi
if test -n "$admincmds"; then
$ECHO " - have your system administrator run these commands:$admincmds"
fi
if test -f /etc/ld.so.conf; then
- echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
+ echo " - have your system administrator add LIBDIR to '/etc/ld.so.conf'"
fi
echo
@@ -2762,18 +4081,20 @@
exit $EXIT_SUCCESS
}
-test "$opt_mode" = finish && func_mode_finish ${1+"$@"}
+test finish = "$opt_mode" && func_mode_finish ${1+"$@"}
# func_mode_install arg...
func_mode_install ()
{
- $opt_debug
+ $debug_cmd
+
# There may be an optional sh(1) argument at the beginning of
# install_prog (especially on Windows NT).
- if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
+ if test "$SHELL" = "$nonopt" || test /bin/sh = "$nonopt" ||
# Allow the use of GNU shtool's install command.
- case $nonopt in *shtool*) :;; *) false;; esac; then
+ case $nonopt in *shtool*) :;; *) false;; esac
+ then
# Aesthetically quote it.
func_quote_for_eval "$nonopt"
install_prog="$func_quote_for_eval_result "
@@ -2800,7 +4121,7 @@
opts=
prev=
install_type=
- isdir=no
+ isdir=false
stripme=
no_mode=:
for arg
@@ -2813,7 +4134,7 @@
fi
case $arg in
- -d) isdir=yes ;;
+ -d) isdir=: ;;
-f)
if $install_cp; then :; else
prev=$arg
@@ -2831,7 +4152,7 @@
*)
# If the previous option needed an argument, then skip it.
if test -n "$prev"; then
- if test "x$prev" = x-m && test -n "$install_override_mode"; then
+ if test X-m = "X$prev" && test -n "$install_override_mode"; then
arg2=$install_override_mode
no_mode=false
fi
@@ -2856,7 +4177,7 @@
func_fatal_help "you must specify an install program"
test -n "$prev" && \
- func_fatal_help "the \`$prev' option requires an argument"
+ func_fatal_help "the '$prev' option requires an argument"
if test -n "$install_override_mode" && $no_mode; then
if $install_cp; then :; else
@@ -2878,19 +4199,19 @@
dest=$func_stripname_result
# Check to see that the destination is a directory.
- test -d "$dest" && isdir=yes
- if test "$isdir" = yes; then
- destdir="$dest"
+ test -d "$dest" && isdir=:
+ if $isdir; then
+ destdir=$dest
destname=
else
func_dirname_and_basename "$dest" "" "."
- destdir="$func_dirname_result"
- destname="$func_basename_result"
+ destdir=$func_dirname_result
+ destname=$func_basename_result
# Not a directory, so check to see that there is only one file specified.
set dummy $files; shift
test "$#" -gt 1 && \
- func_fatal_help "\`$dest' is not a directory"
+ func_fatal_help "'$dest' is not a directory"
fi
case $destdir in
[\\/]* | [A-Za-z]:[\\/]*) ;;
@@ -2899,7 +4220,7 @@
case $file in
*.lo) ;;
*)
- func_fatal_help "\`$destdir' must be an absolute directory name"
+ func_fatal_help "'$destdir' must be an absolute directory name"
;;
esac
done
@@ -2908,7 +4229,7 @@
# This variable tells wrapper scripts just to set variables rather
# than running their programs.
- libtool_install_magic="$magic"
+ libtool_install_magic=$magic
staticlibs=
future_libdirs=
@@ -2928,7 +4249,7 @@
# Check to see that this really is a libtool archive.
func_lalib_unsafe_p "$file" \
- || func_fatal_help "\`$file' is not a valid libtool archive"
+ || func_fatal_help "'$file' is not a valid libtool archive"
library_names=
old_library=
@@ -2950,7 +4271,7 @@
fi
func_dirname "$file" "/" ""
- dir="$func_dirname_result"
+ dir=$func_dirname_result
func_append dir "$objdir"
if test -n "$relink_command"; then
@@ -2964,7 +4285,7 @@
# are installed into $libdir/../bin (currently, that works fine)
# but it's something to keep an eye on.
test "$inst_prefix_dir" = "$destdir" && \
- func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir"
+ func_fatal_error "error: cannot install '$file' to a directory not ending in $libdir"
if test -n "$inst_prefix_dir"; then
# Stick the inst_prefix_dir data into the link command.
@@ -2973,32 +4294,39 @@
relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
fi
- func_warning "relinking \`$file'"
+ func_warning "relinking '$file'"
func_show_eval "$relink_command" \
- 'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"'
+ 'func_fatal_error "error: relink '\''$file'\'' with the above command before installing it"'
fi
# See the names of the shared library.
set dummy $library_names; shift
if test -n "$1"; then
- realname="$1"
+ realname=$1
shift
- srcname="$realname"
- test -n "$relink_command" && srcname="$realname"T
+ srcname=$realname
+ test -n "$relink_command" && srcname=${realname}T
# Install the shared library and build the symlinks.
func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \
'exit $?'
- tstripme="$stripme"
+ tstripme=$stripme
case $host_os in
cygwin* | mingw* | pw32* | cegcc*)
case $realname in
*.dll.a)
- tstripme=""
+ tstripme=
;;
esac
;;
+ os2*)
+ case $realname in
+ *_dll.a)
+ tstripme=
+ ;;
+ esac
+ ;;
esac
if test -n "$tstripme" && test -n "$striplib"; then
func_show_eval "$striplib $destdir/$realname" 'exit $?'
@@ -3006,7 +4334,7 @@
if test "$#" -gt 0; then
# Delete the old symlinks, and create new ones.
- # Try `ln -sf' first, because the `ln' binary might depend on
+ # Try 'ln -sf' first, because the 'ln' binary might depend on
# the symlink we replace! Solaris /bin/ln does not understand -f,
# so we also need to try rm && ln -s.
for linkname
@@ -3017,14 +4345,14 @@
fi
# Do each command in the postinstall commands.
- lib="$destdir/$realname"
+ lib=$destdir/$realname
func_execute_cmds "$postinstall_cmds" 'exit $?'
fi
# Install the pseudo-library for information purposes.
func_basename "$file"
- name="$func_basename_result"
- instname="$dir/$name"i
+ name=$func_basename_result
+ instname=$dir/${name}i
func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
# Maybe install the static library, too.
@@ -3036,11 +4364,11 @@
# Figure out destination file name, if it wasn't already specified.
if test -n "$destname"; then
- destfile="$destdir/$destname"
+ destfile=$destdir/$destname
else
func_basename "$file"
- destfile="$func_basename_result"
- destfile="$destdir/$destfile"
+ destfile=$func_basename_result
+ destfile=$destdir/$destfile
fi
# Deduce the name of the destination old-style object file.
@@ -3050,11 +4378,11 @@
staticdest=$func_lo2o_result
;;
*.$objext)
- staticdest="$destfile"
+ staticdest=$destfile
destfile=
;;
*)
- func_fatal_help "cannot copy a libtool object to \`$destfile'"
+ func_fatal_help "cannot copy a libtool object to '$destfile'"
;;
esac
@@ -3063,7 +4391,7 @@
func_show_eval "$install_prog $file $destfile" 'exit $?'
# Install the old object if enabled.
- if test "$build_old_libs" = yes; then
+ if test yes = "$build_old_libs"; then
# Deduce the name of the old-style object file.
func_lo2o "$file"
staticobj=$func_lo2o_result
@@ -3075,23 +4403,23 @@
*)
# Figure out destination file name, if it wasn't already specified.
if test -n "$destname"; then
- destfile="$destdir/$destname"
+ destfile=$destdir/$destname
else
func_basename "$file"
- destfile="$func_basename_result"
- destfile="$destdir/$destfile"
+ destfile=$func_basename_result
+ destfile=$destdir/$destfile
fi
# If the file is missing, and there is a .exe on the end, strip it
# because it is most likely a libtool script we actually want to
# install
- stripped_ext=""
+ stripped_ext=
case $file in
*.exe)
if test ! -f "$file"; then
func_stripname '' '.exe' "$file"
file=$func_stripname_result
- stripped_ext=".exe"
+ stripped_ext=.exe
fi
;;
esac
@@ -3119,9 +4447,9 @@
# Check the variables that should have been set.
test -z "$generated_by_libtool_version" && \
- func_fatal_error "invalid libtool wrapper script \`$wrapper'"
+ func_fatal_error "invalid libtool wrapper script '$wrapper'"
- finalize=yes
+ finalize=:
for lib in $notinst_deplibs; do
# Check to see that each library is installed.
libdir=
@@ -3128,10 +4456,10 @@
if test -f "$lib"; then
func_source "$lib"
fi
- libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test
+ libfile=$libdir/`$ECHO "$lib" | $SED 's%^.*/%%g'`
if test -n "$libdir" && test ! -f "$libfile"; then
- func_warning "\`$lib' has not been installed in \`$libdir'"
- finalize=no
+ func_warning "'$lib' has not been installed in '$libdir'"
+ finalize=false
fi
done
@@ -3139,29 +4467,29 @@
func_source "$wrapper"
outputname=
- if test "$fast_install" = no && test -n "$relink_command"; then
+ if test no = "$fast_install" && test -n "$relink_command"; then
$opt_dry_run || {
- if test "$finalize" = yes; then
+ if $finalize; then
tmpdir=`func_mktempdir`
func_basename "$file$stripped_ext"
- file="$func_basename_result"
- outputname="$tmpdir/$file"
+ file=$func_basename_result
+ outputname=$tmpdir/$file
# Replace the output file specification.
relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'`
- $opt_silent || {
+ $opt_quiet || {
func_quote_for_expand "$relink_command"
eval "func_echo $func_quote_for_expand_result"
}
if eval "$relink_command"; then :
else
- func_error "error: relink \`$file' with the above command before installing it"
+ func_error "error: relink '$file' with the above command before installing it"
$opt_dry_run || ${RM}r "$tmpdir"
continue
fi
- file="$outputname"
+ file=$outputname
else
- func_warning "cannot relink \`$file'"
+ func_warning "cannot relink '$file'"
fi
}
else
@@ -3198,10 +4526,10 @@
for file in $staticlibs; do
func_basename "$file"
- name="$func_basename_result"
+ name=$func_basename_result
# Set up the ranlib parameters.
- oldlib="$destdir/$name"
+ oldlib=$destdir/$name
func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
tool_oldlib=$func_to_tool_file_result
@@ -3216,18 +4544,18 @@
done
test -n "$future_libdirs" && \
- func_warning "remember to run \`$progname --finish$future_libdirs'"
+ func_warning "remember to run '$progname --finish$future_libdirs'"
if test -n "$current_libdirs"; then
# Maybe just do a dry run.
$opt_dry_run && current_libdirs=" -n$current_libdirs"
- exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
+ exec_cmd='$SHELL "$progpath" $preserve_args --finish$current_libdirs'
else
exit $EXIT_SUCCESS
fi
}
-test "$opt_mode" = install && func_mode_install ${1+"$@"}
+test install = "$opt_mode" && func_mode_install ${1+"$@"}
# func_generate_dlsyms outputname originator pic_p
@@ -3235,16 +4563,17 @@
# a dlpreopen symbol table.
func_generate_dlsyms ()
{
- $opt_debug
- my_outputname="$1"
- my_originator="$2"
- my_pic_p="${3-no}"
- my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'`
+ $debug_cmd
+
+ my_outputname=$1
+ my_originator=$2
+ my_pic_p=${3-false}
+ my_prefix=`$ECHO "$my_originator" | $SED 's%[^a-zA-Z0-9]%_%g'`
my_dlsyms=
- if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+ if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
if test -n "$NM" && test -n "$global_symbol_pipe"; then
- my_dlsyms="${my_outputname}S.c"
+ my_dlsyms=${my_outputname}S.c
else
func_error "not configured to extract global symbols from dlpreopened files"
fi
@@ -3255,7 +4584,7 @@
"") ;;
*.c)
# Discover the nlist of each of the dlfiles.
- nlist="$output_objdir/${my_outputname}.nm"
+ nlist=$output_objdir/$my_outputname.nm
func_show_eval "$RM $nlist ${nlist}S ${nlist}T"
@@ -3263,23 +4592,23 @@
func_verbose "creating $output_objdir/$my_dlsyms"
$opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\
-/* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */
-/* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */
+/* $my_dlsyms - symbol resolution table for '$my_outputname' dlsym emulation. */
+/* Generated by $PROGRAM (GNU $PACKAGE) $VERSION */
#ifdef __cplusplus
extern \"C\" {
#endif
-#if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
+#if defined __GNUC__ && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
#pragma GCC diagnostic ignored \"-Wstrict-prototypes\"
#endif
/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
-#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
-/* DATA imports from DLLs on WIN32 con't be const, because runtime
+#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
+/* DATA imports from DLLs on WIN32 can't be const, because runtime
relocations are performed -- see ld's documentation on pseudo-relocs. */
# define LT_DLSYM_CONST
-#elif defined(__osf__)
+#elif defined __osf__
/* This system does not cope well with relocations in const data. */
# define LT_DLSYM_CONST
#else
@@ -3286,11 +4615,13 @@
# define LT_DLSYM_CONST const
#endif
+#define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0)
+
/* External symbol declarations for the compiler. */\
"
- if test "$dlself" = yes; then
- func_verbose "generating symbol list for \`$output'"
+ if test yes = "$dlself"; then
+ func_verbose "generating symbol list for '$output'"
$opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
@@ -3298,7 +4629,7 @@
progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP`
for progfile in $progfiles; do
func_to_tool_file "$progfile" func_convert_file_msys_to_w32
- func_verbose "extracting global C symbols from \`$func_to_tool_file_result'"
+ func_verbose "extracting global C symbols from '$func_to_tool_file_result'"
$opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'"
done
@@ -3318,10 +4649,10 @@
# Prepare the list of exported symbols
if test -z "$export_symbols"; then
- export_symbols="$output_objdir/$outputname.exp"
+ export_symbols=$output_objdir/$outputname.exp
$opt_dry_run || {
$RM $export_symbols
- eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
+ eval "$SED -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
case $host in
*cygwin* | *mingw* | *cegcc* )
eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
@@ -3331,7 +4662,7 @@
}
else
$opt_dry_run || {
- eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
+ eval "$SED -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
eval '$MV "$nlist"T "$nlist"'
case $host in
@@ -3345,9 +4676,9 @@
fi
for dlprefile in $dlprefiles; do
- func_verbose "extracting global C symbols from \`$dlprefile'"
+ func_verbose "extracting global C symbols from '$dlprefile'"
func_basename "$dlprefile"
- name="$func_basename_result"
+ name=$func_basename_result
case $host in
*cygwin* | *mingw* | *cegcc* )
# if an import library, we need to obtain dlname
@@ -3354,13 +4685,13 @@
if func_win32_import_lib_p "$dlprefile"; then
func_tr_sh "$dlprefile"
eval "curr_lafile=\$libfile_$func_tr_sh_result"
- dlprefile_dlbasename=""
+ dlprefile_dlbasename=
if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then
# Use subshell, to avoid clobbering current variable values
dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"`
- if test -n "$dlprefile_dlname" ; then
+ if test -n "$dlprefile_dlname"; then
func_basename "$dlprefile_dlname"
- dlprefile_dlbasename="$func_basename_result"
+ dlprefile_dlbasename=$func_basename_result
else
# no lafile. user explicitly requested -dlpreopen <import library>.
$sharedlib_from_linklib_cmd "$dlprefile"
@@ -3368,7 +4699,7 @@
fi
fi
$opt_dry_run || {
- if test -n "$dlprefile_dlbasename" ; then
+ if test -n "$dlprefile_dlbasename"; then
eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"'
else
func_warning "Could not compute DLL name from $name"
@@ -3424,6 +4755,11 @@
echo '/* NONE */' >> "$output_objdir/$my_dlsyms"
fi
+ func_show_eval '$RM "${nlist}I"'
+ if test -n "$global_symbol_to_import"; then
+ eval "$global_symbol_to_import"' < "$nlist"S > "$nlist"I'
+ fi
+
echo >> "$output_objdir/$my_dlsyms" "\
/* The mapping between symbol names and symbols. */
@@ -3432,12 +4768,31 @@
void *address;
} lt_dlsymlist;
extern LT_DLSYM_CONST lt_dlsymlist
-lt_${my_prefix}_LTX_preloaded_symbols[];
+lt_${my_prefix}_LTX_preloaded_symbols[];\
+"
+
+ if test -s "$nlist"I; then
+ echo >> "$output_objdir/$my_dlsyms" "\
+static void lt_syminit(void)
+{
+ LT_DLSYM_CONST lt_dlsymlist *symbol = lt_${my_prefix}_LTX_preloaded_symbols;
+ for (; symbol->name; ++symbol)
+ {"
+ $SED 's/.*/ if (STREQ (symbol->name, \"&\")) symbol->address = (void *) \&&;/' < "$nlist"I >> "$output_objdir/$my_dlsyms"
+ echo >> "$output_objdir/$my_dlsyms" "\
+ }
+}"
+ fi
+ echo >> "$output_objdir/$my_dlsyms" "\
LT_DLSYM_CONST lt_dlsymlist
lt_${my_prefix}_LTX_preloaded_symbols[] =
-{\
- { \"$my_originator\", (void *) 0 },"
+{ {\"$my_originator\", (void *) 0},"
+ if test -s "$nlist"I; then
+ echo >> "$output_objdir/$my_dlsyms" "\
+ {\"@INIT@\", (void *) <_syminit},"
+ fi
+
case $need_lib_prefix in
no)
eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms"
@@ -3478,9 +4833,7 @@
*-*-hpux*)
pic_flag_for_symtable=" $pic_flag" ;;
*)
- if test "X$my_pic_p" != Xno; then
- pic_flag_for_symtable=" $pic_flag"
- fi
+ $my_pic_p && pic_flag_for_symtable=" $pic_flag"
;;
esac
;;
@@ -3497,10 +4850,10 @@
func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'
# Clean up the generated files.
- func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"'
+ func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T" "${nlist}I"'
# Transform the symbol file into the correct name.
- symfileobj="$output_objdir/${my_outputname}S.$objext"
+ symfileobj=$output_objdir/${my_outputname}S.$objext
case $host in
*cygwin* | *mingw* | *cegcc* )
if test -f "$output_objdir/$my_outputname.def"; then
@@ -3518,7 +4871,7 @@
esac
;;
*)
- func_fatal_error "unknown suffix for \`$my_dlsyms'"
+ func_fatal_error "unknown suffix for '$my_dlsyms'"
;;
esac
else
@@ -3532,6 +4885,32 @@
fi
}
+# func_cygming_gnu_implib_p ARG
+# This predicate returns with zero status (TRUE) if
+# ARG is a GNU/binutils-style import library. Returns
+# with nonzero status (FALSE) otherwise.
+func_cygming_gnu_implib_p ()
+{
+ $debug_cmd
+
+ func_to_tool_file "$1" func_convert_file_msys_to_w32
+ func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'`
+ test -n "$func_cygming_gnu_implib_tmp"
+}
+
+# func_cygming_ms_implib_p ARG
+# This predicate returns with zero status (TRUE) if
+# ARG is an MS-style import library. Returns
+# with nonzero status (FALSE) otherwise.
+func_cygming_ms_implib_p ()
+{
+ $debug_cmd
+
+ func_to_tool_file "$1" func_convert_file_msys_to_w32
+ func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'`
+ test -n "$func_cygming_ms_implib_tmp"
+}
+
# func_win32_libid arg
# return the library type of file 'arg'
#
@@ -3541,8 +4920,9 @@
# Despite the name, also deal with 64 bit binaries.
func_win32_libid ()
{
- $opt_debug
- win32_libid_type="unknown"
+ $debug_cmd
+
+ win32_libid_type=unknown
win32_fileres=`file -L $1 2>/dev/null`
case $win32_fileres in
*ar\ archive\ import\ library*) # definitely import
@@ -3552,16 +4932,29 @@
# Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD.
if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
$EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
- func_to_tool_file "$1" func_convert_file_msys_to_w32
- win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" |
- $SED -n -e '
+ case $nm_interface in
+ "MS dumpbin")
+ if func_cygming_ms_implib_p "$1" ||
+ func_cygming_gnu_implib_p "$1"
+ then
+ win32_nmres=import
+ else
+ win32_nmres=
+ fi
+ ;;
+ *)
+ func_to_tool_file "$1" func_convert_file_msys_to_w32
+ win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" |
+ $SED -n -e '
1,100{
/ I /{
- s,.*,import,
+ s|.*|import|
p
q
}
}'`
+ ;;
+ esac
case $win32_nmres in
import*) win32_libid_type="x86 archive import";;
*) win32_libid_type="x86 archive static";;
@@ -3593,7 +4986,8 @@
# $sharedlib_from_linklib_result
func_cygming_dll_for_implib ()
{
- $opt_debug
+ $debug_cmd
+
sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"`
}
@@ -3610,7 +5004,8 @@
# specified import library.
func_cygming_dll_for_implib_fallback_core ()
{
- $opt_debug
+ $debug_cmd
+
match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"`
$OBJDUMP -s --section "$1" "$2" 2>/dev/null |
$SED '/^Contents of section '"$match_literal"':/{
@@ -3646,8 +5041,8 @@
/./p' |
# we now have a list, one entry per line, of the stringified
# contents of the appropriate section of all members of the
- # archive which possess that section. Heuristic: eliminate
- # all those which have a first or second character that is
+ # archive that possess that section. Heuristic: eliminate
+ # all those that have a first or second character that is
# a '.' (that is, objdump's representation of an unprintable
# character.) This should work for all archives with less than
# 0x302f exports -- but will fail for DLLs whose name actually
@@ -3658,30 +5053,6 @@
$SED -e '/^\./d;/^.\./d;q'
}
-# func_cygming_gnu_implib_p ARG
-# This predicate returns with zero status (TRUE) if
-# ARG is a GNU/binutils-style import library. Returns
-# with nonzero status (FALSE) otherwise.
-func_cygming_gnu_implib_p ()
-{
- $opt_debug
- func_to_tool_file "$1" func_convert_file_msys_to_w32
- func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'`
- test -n "$func_cygming_gnu_implib_tmp"
-}
-
-# func_cygming_ms_implib_p ARG
-# This predicate returns with zero status (TRUE) if
-# ARG is an MS-style import library. Returns
-# with nonzero status (FALSE) otherwise.
-func_cygming_ms_implib_p ()
-{
- $opt_debug
- func_to_tool_file "$1" func_convert_file_msys_to_w32
- func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'`
- test -n "$func_cygming_ms_implib_tmp"
-}
-
# func_cygming_dll_for_implib_fallback ARG
# Platform-specific function to extract the
# name of the DLL associated with the specified
@@ -3695,16 +5066,17 @@
# $sharedlib_from_linklib_result
func_cygming_dll_for_implib_fallback ()
{
- $opt_debug
- if func_cygming_gnu_implib_p "$1" ; then
+ $debug_cmd
+
+ if func_cygming_gnu_implib_p "$1"; then
# binutils import library
sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"`
- elif func_cygming_ms_implib_p "$1" ; then
+ elif func_cygming_ms_implib_p "$1"; then
# ms-generated import library
sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"`
else
# unknown
- sharedlib_from_linklib_result=""
+ sharedlib_from_linklib_result=
fi
}
@@ -3712,10 +5084,11 @@
# func_extract_an_archive dir oldlib
func_extract_an_archive ()
{
- $opt_debug
- f_ex_an_ar_dir="$1"; shift
- f_ex_an_ar_oldlib="$1"
- if test "$lock_old_archive_extraction" = yes; then
+ $debug_cmd
+
+ f_ex_an_ar_dir=$1; shift
+ f_ex_an_ar_oldlib=$1
+ if test yes = "$lock_old_archive_extraction"; then
lockfile=$f_ex_an_ar_oldlib.lock
until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
func_echo "Waiting for $lockfile to be removed"
@@ -3724,7 +5097,7 @@
fi
func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \
'stat=$?; rm -f "$lockfile"; exit $stat'
- if test "$lock_old_archive_extraction" = yes; then
+ if test yes = "$lock_old_archive_extraction"; then
$opt_dry_run || rm -f "$lockfile"
fi
if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
@@ -3738,22 +5111,23 @@
# func_extract_archives gentop oldlib ...
func_extract_archives ()
{
- $opt_debug
- my_gentop="$1"; shift
+ $debug_cmd
+
+ my_gentop=$1; shift
my_oldlibs=${1+"$@"}
- my_oldobjs=""
- my_xlib=""
- my_xabs=""
- my_xdir=""
+ my_oldobjs=
+ my_xlib=
+ my_xabs=
+ my_xdir=
for my_xlib in $my_oldlibs; do
# Extract the objects.
case $my_xlib in
- [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
+ [\\/]* | [A-Za-z]:[\\/]*) my_xabs=$my_xlib ;;
*) my_xabs=`pwd`"/$my_xlib" ;;
esac
func_basename "$my_xlib"
- my_xlib="$func_basename_result"
+ my_xlib=$func_basename_result
my_xlib_u=$my_xlib
while :; do
case " $extracted_archives " in
@@ -3765,7 +5139,7 @@
esac
done
extracted_archives="$extracted_archives $my_xlib_u"
- my_xdir="$my_gentop/$my_xlib_u"
+ my_xdir=$my_gentop/$my_xlib_u
func_mkdir_p "$my_xdir"
@@ -3778,22 +5152,23 @@
cd $my_xdir || exit $?
darwin_archive=$my_xabs
darwin_curdir=`pwd`
- darwin_base_archive=`basename "$darwin_archive"`
+ func_basename "$darwin_archive"
+ darwin_base_archive=$func_basename_result
darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`
if test -n "$darwin_arches"; then
darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`
darwin_arch=
func_verbose "$darwin_base_archive has multiple architectures $darwin_arches"
- for darwin_arch in $darwin_arches ; do
- func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
- $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
- cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
- func_extract_an_archive "`pwd`" "${darwin_base_archive}"
+ for darwin_arch in $darwin_arches; do
+ func_mkdir_p "unfat-$$/$darwin_base_archive-$darwin_arch"
+ $LIPO -thin $darwin_arch -output "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive" "$darwin_archive"
+ cd "unfat-$$/$darwin_base_archive-$darwin_arch"
+ func_extract_an_archive "`pwd`" "$darwin_base_archive"
cd "$darwin_curdir"
- $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
+ $RM "unfat-$$/$darwin_base_archive-$darwin_arch/$darwin_base_archive"
done # $darwin_arches
## Okay now we've a bunch of thin objects, gotta fatten them up :)
- darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u`
+ darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$sed_basename" | sort -u`
darwin_file=
darwin_files=
for darwin_file in $darwin_filelist; do
@@ -3815,7 +5190,7 @@
my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP`
done
- func_extract_archives_result="$my_oldobjs"
+ func_extract_archives_result=$my_oldobjs
}
@@ -3830,7 +5205,7 @@
#
# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
# variable will take. If 'yes', then the emitted script
-# will assume that the directory in which it is stored is
+# will assume that the directory where it is stored is
# the $objdir directory. This is a cygwin/mingw-specific
# behavior.
func_emit_wrapper ()
@@ -3841,7 +5216,7 @@
#! $SHELL
# $output - temporary wrapper script for $objdir/$outputname
-# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+# Generated by $PROGRAM (GNU $PACKAGE) $VERSION
#
# The $output program cannot be directly executed until all the libtool
# libraries that it depends on are installed.
@@ -3898,9 +5273,9 @@
# Very basic option parsing. These options are (a) specific to
# the libtool wrapper, (b) are identical between the wrapper
-# /script/ and the wrapper /executable/ which is used only on
+# /script/ and the wrapper /executable/ that is used only on
# windows platforms, and (c) all begin with the string "--lt-"
-# (application programs are unlikely to have options which match
+# (application programs are unlikely to have options that match
# this pattern).
#
# There are only two supported options: --lt-debug and
@@ -3933,7 +5308,7 @@
# Print the debug banner immediately:
if test -n \"\$lt_option_debug\"; then
- echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2
+ echo \"$outputname:$output:\$LINENO: libtool wrapper (GNU $PACKAGE) $VERSION\" 1>&2
fi
}
@@ -3944,7 +5319,7 @@
lt_dump_args_N=1;
for lt_arg
do
- \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\"
+ \$ECHO \"$outputname:$output:\$LINENO: newargv[\$lt_dump_args_N]: \$lt_arg\"
lt_dump_args_N=\`expr \$lt_dump_args_N + 1\`
done
}
@@ -3958,7 +5333,7 @@
*-*-mingw | *-*-os2* | *-cegcc*)
$ECHO "\
if test -n \"\$lt_option_debug\"; then
- \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2
+ \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir\\\\\$program\" 1>&2
func_lt_dump_args \${1+\"\$@\"} 1>&2
fi
exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
@@ -3968,7 +5343,7 @@
*)
$ECHO "\
if test -n \"\$lt_option_debug\"; then
- \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2
+ \$ECHO \"$outputname:$output:\$LINENO: newargv[0]: \$progdir/\$program\" 1>&2
func_lt_dump_args \${1+\"\$@\"} 1>&2
fi
exec \"\$progdir/\$program\" \${1+\"\$@\"}
@@ -4043,13 +5418,13 @@
test -n \"\$absdir\" && thisdir=\"\$absdir\"
"
- if test "$fast_install" = yes; then
+ if test yes = "$fast_install"; then
$ECHO "\
program=lt-'$outputname'$exeext
progdir=\"\$thisdir/$objdir\"
if test ! -f \"\$progdir/\$program\" ||
- { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
+ { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | $SED 1q\`; \\
test \"X\$file\" != \"X\$progdir/\$program\"; }; then
file=\"\$\$-\$program\"
@@ -4066,7 +5441,7 @@
if test -n \"\$relink_command\"; then
if relink_command_output=\`eval \$relink_command 2>&1\`; then :
else
- $ECHO \"\$relink_command_output\" >&2
+ \$ECHO \"\$relink_command_output\" >&2
$RM \"\$progdir/\$file\"
exit 1
fi
@@ -4101,7 +5476,7 @@
fi
# Export our shlibpath_var if we have one.
- if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
+ if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
$ECHO "\
# Add our own library path to $shlibpath_var
$shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
@@ -4121,7 +5496,7 @@
fi
else
# The program doesn't exist.
- \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
+ \$ECHO \"\$0: error: '\$progdir/\$program' does not exist\" 1>&2
\$ECHO \"This script is just a wrapper for \$program.\" 1>&2
\$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
exit 1
@@ -4140,7 +5515,7 @@
cat <<EOF
/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
- Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+ Generated by $PROGRAM (GNU $PACKAGE) $VERSION
The $output program cannot be directly executed until all the libtool
libraries that it depends on are installed.
@@ -4175,22 +5550,24 @@
#include <fcntl.h>
#include <sys/stat.h>
+#define STREQ(s1, s2) (strcmp ((s1), (s2)) == 0)
+
/* declarations of non-ANSI functions */
-#if defined(__MINGW32__)
+#if defined __MINGW32__
# ifdef __STRICT_ANSI__
int _putenv (const char *);
# endif
-#elif defined(__CYGWIN__)
+#elif defined __CYGWIN__
# ifdef __STRICT_ANSI__
char *realpath (const char *, char *);
int putenv (char *);
int setenv (const char *, const char *, int);
# endif
-/* #elif defined (other platforms) ... */
+/* #elif defined other_platform || defined ... */
#endif
/* portability defines, excluding path handling macros */
-#if defined(_MSC_VER)
+#if defined _MSC_VER
# define setmode _setmode
# define stat _stat
# define chmod _chmod
@@ -4197,25 +5574,21 @@
# define getcwd _getcwd
# define putenv _putenv
# define S_IXUSR _S_IEXEC
-# ifndef _INTPTR_T_DEFINED
-# define _INTPTR_T_DEFINED
-# define intptr_t int
-# endif
-#elif defined(__MINGW32__)
+#elif defined __MINGW32__
# define setmode _setmode
# define stat _stat
# define chmod _chmod
# define getcwd _getcwd
# define putenv _putenv
-#elif defined(__CYGWIN__)
+#elif defined __CYGWIN__
# define HAVE_SETENV
# define FOPEN_WB "wb"
-/* #elif defined (other platforms) ... */
+/* #elif defined other platforms ... */
#endif
-#if defined(PATH_MAX)
+#if defined PATH_MAX
# define LT_PATHMAX PATH_MAX
-#elif defined(MAXPATHLEN)
+#elif defined MAXPATHLEN
# define LT_PATHMAX MAXPATHLEN
#else
# define LT_PATHMAX 1024
@@ -4234,8 +5607,8 @@
# define PATH_SEPARATOR ':'
#endif
-#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
- defined (__OS2__)
+#if defined _WIN32 || defined __MSDOS__ || defined __DJGPP__ || \
+ defined __OS2__
# define HAVE_DOS_BASED_FILE_SYSTEM
# define FOPEN_WB "wb"
# ifndef DIR_SEPARATOR_2
@@ -4268,10 +5641,10 @@
#define XMALLOC(type, num) ((type *) xmalloc ((num) * sizeof(type)))
#define XFREE(stale) do { \
- if (stale) { free ((void *) stale); stale = 0; } \
+ if (stale) { free (stale); stale = 0; } \
} while (0)
-#if defined(LT_DEBUGWRAPPER)
+#if defined LT_DEBUGWRAPPER
static int lt_debug = 1;
#else
static int lt_debug = 0;
@@ -4300,11 +5673,16 @@
EOF
cat <<EOF
-volatile const char * MAGIC_EXE = "$magic_exe";
+#if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 5)
+# define externally_visible volatile
+#else
+# define externally_visible __attribute__((externally_visible)) volatile
+#endif
+externally_visible const char * MAGIC_EXE = "$magic_exe";
const char * LIB_PATH_VARNAME = "$shlibpath_var";
EOF
- if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
+ if test yes = "$shlibpath_overrides_runpath" && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
func_to_host_path "$temp_rpath"
cat <<EOF
const char * LIB_PATH_VALUE = "$func_to_host_path_result";
@@ -4328,7 +5706,7 @@
EOF
fi
- if test "$fast_install" = yes; then
+ if test yes = "$fast_install"; then
cat <<EOF
const char * TARGET_PROGRAM_NAME = "lt-$outputname"; /* hopefully, no .exe */
EOF
@@ -4357,12 +5735,12 @@
char *actual_cwrapper_name;
char *target_name;
char *lt_argv_zero;
- intptr_t rval = 127;
+ int rval = 127;
int i;
program_name = (char *) xstrdup (base_name (argv[0]));
- newargz = XMALLOC (char *, argc + 1);
+ newargz = XMALLOC (char *, (size_t) argc + 1);
/* very simple arg parsing; don't want to rely on getopt
* also, copy all non cwrapper options to newargz, except
@@ -4371,10 +5749,10 @@
newargc=0;
for (i = 1; i < argc; i++)
{
- if (strcmp (argv[i], dumpscript_opt) == 0)
+ if (STREQ (argv[i], dumpscript_opt))
{
EOF
- case "$host" in
+ case $host in
*mingw* | *cygwin* )
# make stdout use "unix" line endings
echo " setmode(1,_O_BINARY);"
@@ -4385,12 +5763,12 @@
lt_dump_script (stdout);
return 0;
}
- if (strcmp (argv[i], debug_opt) == 0)
+ if (STREQ (argv[i], debug_opt))
{
lt_debug = 1;
continue;
}
- if (strcmp (argv[i], ltwrapper_option_prefix) == 0)
+ if (STREQ (argv[i], ltwrapper_option_prefix))
{
/* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
namespace, but it is not one of the ones we know about and
@@ -4413,7 +5791,7 @@
EOF
cat <<EOF
/* The GNU banner must be the first non-error debug message */
- lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\n");
+ lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE) $VERSION\n");
EOF
cat <<"EOF"
lt_debugprintf (__FILE__, __LINE__, "(main) argv[0]: %s\n", argv[0]);
@@ -4524,7 +5902,7 @@
cat <<"EOF"
/* execv doesn't actually work on mingw as expected on unix */
newargz = prepare_spawn (newargz);
- rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
+ rval = (int) _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
if (rval == -1)
{
/* failed to start process */
@@ -4569,7 +5947,7 @@
{
const char *base;
-#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+#if defined HAVE_DOS_BASED_FILE_SYSTEM
/* Skip over the disk name in MSDOS pathnames. */
if (isalpha ((unsigned char) name[0]) && name[1] == ':')
name += 2;
@@ -4628,7 +6006,7 @@
const char *p_next;
/* static buffer for getcwd */
char tmp[LT_PATHMAX + 1];
- int tmp_len;
+ size_t tmp_len;
char *concat_name;
lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n",
@@ -4638,7 +6016,7 @@
return NULL;
/* Absolute path? */
-#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+#if defined HAVE_DOS_BASED_FILE_SYSTEM
if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':')
{
concat_name = xstrdup (wrapper);
@@ -4656,7 +6034,7 @@
return concat_name;
XFREE (concat_name);
}
-#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+#if defined HAVE_DOS_BASED_FILE_SYSTEM
}
#endif
@@ -4679,7 +6057,7 @@
for (q = p; *q; q++)
if (IS_PATH_SEPARATOR (*q))
break;
- p_len = q - p;
+ p_len = (size_t) (q - p);
p_next = (*q == '\0' ? q : q + 1);
if (p_len == 0)
{
@@ -4798,7 +6176,7 @@
if (patlen <= len)
{
str += len - patlen;
- if (strcmp (str, pat) == 0)
+ if (STREQ (str, pat))
*str = '\0';
}
return str;
@@ -4863,7 +6241,7 @@
char *str = xstrdup (value);
setenv (name, str, 1);
#else
- int len = strlen (name) + 1 + strlen (value) + 1;
+ size_t len = strlen (name) + 1 + strlen (value) + 1;
char *str = XMALLOC (char, len);
sprintf (str, "%s=%s", name, value);
if (putenv (str) != EXIT_SUCCESS)
@@ -4880,8 +6258,8 @@
char *new_value;
if (orig_value && *orig_value)
{
- int orig_value_len = strlen (orig_value);
- int add_len = strlen (add);
+ size_t orig_value_len = strlen (orig_value);
+ size_t add_len = strlen (add);
new_value = XMALLOC (char, add_len + orig_value_len + 1);
if (to_end)
{
@@ -4912,10 +6290,10 @@
{
char *new_value = lt_extend_str (getenv (name), value, 0);
/* some systems can't cope with a ':'-terminated path #' */
- int len = strlen (new_value);
- while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
+ size_t len = strlen (new_value);
+ while ((len > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
{
- new_value[len-1] = '\0';
+ new_value[--len] = '\0';
}
lt_setenv (name, new_value);
XFREE (new_value);
@@ -5082,7 +6460,8 @@
# True if ARG is an import lib, as indicated by $file_magic_cmd
func_win32_import_lib_p ()
{
- $opt_debug
+ $debug_cmd
+
case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in
*import*) : ;;
*) false ;;
@@ -5089,20 +6468,39 @@
esac
}
+# func_suncc_cstd_abi
+# !!ONLY CALL THIS FOR SUN CC AFTER $compile_command IS FULLY EXPANDED!!
+# Several compiler flags select an ABI that is incompatible with the
+# Cstd library. Avoid specifying it if any are in CXXFLAGS.
+func_suncc_cstd_abi ()
+{
+ $debug_cmd
+
+ case " $compile_command " in
+ *" -compat=g "*|*\ -std=c++[0-9][0-9]\ *|*" -library=stdcxx4 "*|*" -library=stlport4 "*)
+ suncc_use_cstd_abi=no
+ ;;
+ *)
+ suncc_use_cstd_abi=yes
+ ;;
+ esac
+}
+
# func_mode_link arg...
func_mode_link ()
{
- $opt_debug
+ $debug_cmd
+
case $host in
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
# It is impossible to link a dll without this setting, and
# we shouldn't force the makefile maintainer to figure out
- # which system we are compiling for in order to pass an extra
+ # what system we are compiling for in order to pass an extra
# flag for every libtool invocation.
# allow_undefined=no
# FIXME: Unfortunately, there are problems with the above when trying
- # to make a dll which has undefined symbols, in which case not
+ # to make a dll that has undefined symbols, in which case not
# even a static library is built. For now, we need to specify
# -no-undefined on the libtool link line when we can be certain
# that all symbols are satisfied, otherwise we get a static library.
@@ -5146,10 +6544,11 @@
module=no
no_install=no
objs=
+ os2dllname=
non_pic_objects=
precious_files_regex=
prefer_static_libs=no
- preload=no
+ preload=false
prev=
prevarg=
release=
@@ -5161,7 +6560,7 @@
vinfo=
vinfo_number=no
weak_libs=
- single_module="${wl}-single_module"
+ single_module=$wl-single_module
func_infer_tag $base_compile
# We need to know -static, to get the right output filenames.
@@ -5169,8 +6568,8 @@
do
case $arg in
-shared)
- test "$build_libtool_libs" != yes && \
- func_fatal_configuration "can not build a shared library"
+ test yes != "$build_libtool_libs" \
+ && func_fatal_configuration "cannot build a shared library"
build_old_libs=no
break
;;
@@ -5177,7 +6576,7 @@
-all-static | -static | -static-libtool-libs)
case $arg in
-all-static)
- if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
+ if test yes = "$build_libtool_libs" && test -z "$link_static_flag"; then
func_warning "complete static linking is impossible in this configuration"
fi
if test -n "$link_static_flag"; then
@@ -5210,7 +6609,7 @@
# Go through the arguments, transforming them on the way.
while test "$#" -gt 0; do
- arg="$1"
+ arg=$1
shift
func_quote_for_eval "$arg"
qarg=$func_quote_for_eval_unquoted_result
@@ -5227,21 +6626,21 @@
case $prev in
bindir)
- bindir="$arg"
+ bindir=$arg
prev=
continue
;;
dlfiles|dlprefiles)
- if test "$preload" = no; then
+ $preload || {
# Add the symbol object into the linking commands.
func_append compile_command " @SYMFILE@"
func_append finalize_command " @SYMFILE@"
- preload=yes
- fi
+ preload=:
+ }
case $arg in
*.la | *.lo) ;; # We handle these cases below.
force)
- if test "$dlself" = no; then
+ if test no = "$dlself"; then
dlself=needless
export_dynamic=yes
fi
@@ -5249,9 +6648,9 @@
continue
;;
self)
- if test "$prev" = dlprefiles; then
+ if test dlprefiles = "$prev"; then
dlself=yes
- elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
+ elif test dlfiles = "$prev" && test yes != "$dlopen_self"; then
dlself=yes
else
dlself=needless
@@ -5261,7 +6660,7 @@
continue
;;
*)
- if test "$prev" = dlfiles; then
+ if test dlfiles = "$prev"; then
func_append dlfiles " $arg"
else
func_append dlprefiles " $arg"
@@ -5272,14 +6671,14 @@
esac
;;
expsyms)
- export_symbols="$arg"
+ export_symbols=$arg
test -f "$arg" \
- || func_fatal_error "symbol file \`$arg' does not exist"
+ || func_fatal_error "symbol file '$arg' does not exist"
prev=
continue
;;
expsyms_regex)
- export_symbols_regex="$arg"
+ export_symbols_regex=$arg
prev=
continue
;;
@@ -5297,10 +6696,16 @@
continue
;;
inst_prefix)
- inst_prefix_dir="$arg"
+ inst_prefix_dir=$arg
prev=
continue
;;
+ mllvm)
+ # Clang does not use LLVM to link, so we can simply discard any
+ # '-mllvm $arg' options when doing the link step.
+ prev=
+ continue
+ ;;
objectlist)
if test -f "$arg"; then
save_arg=$arg
@@ -5321,21 +6726,21 @@
if test -z "$pic_object" ||
test -z "$non_pic_object" ||
- test "$pic_object" = none &&
- test "$non_pic_object" = none; then
- func_fatal_error "cannot find name of object for \`$arg'"
+ test none = "$pic_object" &&
+ test none = "$non_pic_object"; then
+ func_fatal_error "cannot find name of object for '$arg'"
fi
# Extract subdirectory from the argument.
func_dirname "$arg" "/" ""
- xdir="$func_dirname_result"
+ xdir=$func_dirname_result
- if test "$pic_object" != none; then
+ if test none != "$pic_object"; then
# Prepend the subdirectory the object is found in.
- pic_object="$xdir$pic_object"
+ pic_object=$xdir$pic_object
- if test "$prev" = dlfiles; then
- if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
+ if test dlfiles = "$prev"; then
+ if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then
func_append dlfiles " $pic_object"
prev=
continue
@@ -5346,7 +6751,7 @@
fi
# CHECK ME: I think I busted this. -Ossama
- if test "$prev" = dlprefiles; then
+ if test dlprefiles = "$prev"; then
# Preload the old-style object.
func_append dlprefiles " $pic_object"
prev=
@@ -5354,23 +6759,23 @@
# A PIC object.
func_append libobjs " $pic_object"
- arg="$pic_object"
+ arg=$pic_object
fi
# Non-PIC object.
- if test "$non_pic_object" != none; then
+ if test none != "$non_pic_object"; then
# Prepend the subdirectory the object is found in.
- non_pic_object="$xdir$non_pic_object"
+ non_pic_object=$xdir$non_pic_object
# A standard non-PIC object
func_append non_pic_objects " $non_pic_object"
- if test -z "$pic_object" || test "$pic_object" = none ; then
- arg="$non_pic_object"
+ if test -z "$pic_object" || test none = "$pic_object"; then
+ arg=$non_pic_object
fi
else
# If the PIC object exists, use it instead.
# $xdir was prepended to $pic_object above.
- non_pic_object="$pic_object"
+ non_pic_object=$pic_object
func_append non_pic_objects " $non_pic_object"
fi
else
@@ -5378,7 +6783,7 @@
if $opt_dry_run; then
# Extract subdirectory from the argument.
func_dirname "$arg" "/" ""
- xdir="$func_dirname_result"
+ xdir=$func_dirname_result
func_lo2o "$arg"
pic_object=$xdir$objdir/$func_lo2o_result
@@ -5386,24 +6791,29 @@
func_append libobjs " $pic_object"
func_append non_pic_objects " $non_pic_object"
else
- func_fatal_error "\`$arg' is not a valid libtool object"
+ func_fatal_error "'$arg' is not a valid libtool object"
fi
fi
done
else
- func_fatal_error "link input file \`$arg' does not exist"
+ func_fatal_error "link input file '$arg' does not exist"
fi
arg=$save_arg
prev=
continue
;;
+ os2dllname)
+ os2dllname=$arg
+ prev=
+ continue
+ ;;
precious_regex)
- precious_files_regex="$arg"
+ precious_files_regex=$arg
prev=
continue
;;
release)
- release="-$arg"
+ release=-$arg
prev=
continue
;;
@@ -5415,7 +6825,7 @@
func_fatal_error "only absolute run-paths are allowed"
;;
esac
- if test "$prev" = rpath; then
+ if test rpath = "$prev"; then
case "$rpath " in
*" $arg "*) ;;
*) func_append rpath " $arg" ;;
@@ -5430,7 +6840,7 @@
continue
;;
shrext)
- shrext_cmds="$arg"
+ shrext_cmds=$arg
prev=
continue
;;
@@ -5470,7 +6880,7 @@
esac
fi # test -n "$prev"
- prevarg="$arg"
+ prevarg=$arg
case $arg in
-all-static)
@@ -5484,7 +6894,7 @@
-allow-undefined)
# FIXME: remove this flag sometime in the future.
- func_fatal_error "\`-allow-undefined' must not be used because it is the default"
+ func_fatal_error "'-allow-undefined' must not be used because it is the default"
;;
-avoid-version)
@@ -5516,7 +6926,7 @@
if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
func_fatal_error "more than one -exported-symbols argument is not allowed"
fi
- if test "X$arg" = "X-export-symbols"; then
+ if test X-export-symbols = "X$arg"; then
prev=expsyms
else
prev=expsyms_regex
@@ -5550,9 +6960,9 @@
func_stripname "-L" '' "$arg"
if test -z "$func_stripname_result"; then
if test "$#" -gt 0; then
- func_fatal_error "require no space between \`-L' and \`$1'"
+ func_fatal_error "require no space between '-L' and '$1'"
else
- func_fatal_error "need path for \`-L' option"
+ func_fatal_error "need path for '-L' option"
fi
fi
func_resolve_sysroot "$func_stripname_result"
@@ -5563,8 +6973,8 @@
*)
absdir=`cd "$dir" && pwd`
test -z "$absdir" && \
- func_fatal_error "cannot determine absolute directory name of \`$dir'"
- dir="$absdir"
+ func_fatal_error "cannot determine absolute directory name of '$dir'"
+ dir=$absdir
;;
esac
case "$deplibs " in
@@ -5599,7 +7009,7 @@
;;
-l*)
- if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
+ if test X-lc = "X$arg" || test X-lm = "X$arg"; then
case $host in
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*)
# These systems don't actually have a C or math library (as such)
@@ -5607,11 +7017,11 @@
;;
*-*-os2*)
# These systems don't actually have a C library (as such)
- test "X$arg" = "X-lc" && continue
+ test X-lc = "X$arg" && continue
;;
- *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+ *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*)
# Do not include libc due to us having libc/libc_r.
- test "X$arg" = "X-lc" && continue
+ test X-lc = "X$arg" && continue
;;
*-*-rhapsody* | *-*-darwin1.[012])
# Rhapsody C and math libraries are in the System framework
@@ -5620,16 +7030,16 @@
;;
*-*-sco3.2v5* | *-*-sco5v6*)
# Causes problems with __ctype
- test "X$arg" = "X-lc" && continue
+ test X-lc = "X$arg" && continue
;;
*-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
# Compiler inserts libc in the correct place for threads to work
- test "X$arg" = "X-lc" && continue
+ test X-lc = "X$arg" && continue
;;
esac
- elif test "X$arg" = "X-lc_r"; then
+ elif test X-lc_r = "X$arg"; then
case $host in
- *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+ *-*-openbsd* | *-*-freebsd* | *-*-dragonfly* | *-*-bitrig*)
# Do not include libc_r directly, use -pthread flag.
continue
;;
@@ -5639,6 +7049,11 @@
continue
;;
+ -mllvm)
+ prev=mllvm
+ continue
+ ;;
+
-module)
module=yes
continue
@@ -5668,7 +7083,7 @@
;;
-multi_module)
- single_module="${wl}-multi_module"
+ single_module=$wl-multi_module
continue
;;
@@ -5682,8 +7097,8 @@
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)
# The PATH hackery in wrapper scripts is required on Windows
# and Darwin in order for the loader to find any dlls it needs.
- func_warning "\`-no-install' is ignored for $host"
- func_warning "assuming \`-no-fast-install' instead"
+ func_warning "'-no-install' is ignored for $host"
+ func_warning "assuming '-no-fast-install' instead"
fast_install=no
;;
*) no_install=yes ;;
@@ -5701,6 +7116,11 @@
continue
;;
+ -os2dllname)
+ prev=os2dllname
+ continue
+ ;;
+
-o) prev=output ;;
-precious-files-regex)
@@ -5788,14 +7208,14 @@
func_stripname '-Wc,' '' "$arg"
args=$func_stripname_result
arg=
- save_ifs="$IFS"; IFS=','
+ save_ifs=$IFS; IFS=,
for flag in $args; do
- IFS="$save_ifs"
+ IFS=$save_ifs
func_quote_for_eval "$flag"
func_append arg " $func_quote_for_eval_result"
func_append compiler_flags " $func_quote_for_eval_result"
done
- IFS="$save_ifs"
+ IFS=$save_ifs
func_stripname ' ' '' "$arg"
arg=$func_stripname_result
;;
@@ -5804,15 +7224,15 @@
func_stripname '-Wl,' '' "$arg"
args=$func_stripname_result
arg=
- save_ifs="$IFS"; IFS=','
+ save_ifs=$IFS; IFS=,
for flag in $args; do
- IFS="$save_ifs"
+ IFS=$save_ifs
func_quote_for_eval "$flag"
func_append arg " $wl$func_quote_for_eval_result"
func_append compiler_flags " $wl$func_quote_for_eval_result"
func_append linker_flags " $func_quote_for_eval_result"
done
- IFS="$save_ifs"
+ IFS=$save_ifs
func_stripname ' ' '' "$arg"
arg=$func_stripname_result
;;
@@ -5835,7 +7255,7 @@
# -msg_* for osf cc
-msg_*)
func_quote_for_eval "$arg"
- arg="$func_quote_for_eval_result"
+ arg=$func_quote_for_eval_result
;;
# Flags to be passed through unchanged, with rationale:
@@ -5847,15 +7267,20 @@
# -m*, -t[45]*, -txscale* architecture-specific flags for GCC
# -F/path path to uninstalled frameworks, gcc on darwin
# -p, -pg, --coverage, -fprofile-* profiling flags for GCC
+ # -fstack-protector* stack protector flags for GCC
# @file GCC response files
# -tp=* Portland pgcc target processor selection
# --sysroot=* for sysroot support
- # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
+ # -O*, -g*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
+ # -specs=* GCC specs files
+ # -stdlib=* select c++ std lib with clang
+ # -fsanitize=* Clang/GCC memory and address sanitizer
-64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
-t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
- -O*|-flto*|-fwhopr*|-fuse-linker-plugin)
+ -O*|-g*|-flto*|-fwhopr*|-fuse-linker-plugin|-fstack-protector*|-stdlib=*| \
+ -specs=*|-fsanitize=*)
func_quote_for_eval "$arg"
- arg="$func_quote_for_eval_result"
+ arg=$func_quote_for_eval_result
func_append compile_command " $arg"
func_append finalize_command " $arg"
func_append compiler_flags " $arg"
@@ -5862,10 +7287,29 @@
continue
;;
+ -Z*)
+ if test os2 = "`expr $host : '.*\(os2\)'`"; then
+ # OS/2 uses -Zxxx to specify OS/2-specific options
+ compiler_flags="$compiler_flags $arg"
+ func_append compile_command " $arg"
+ func_append finalize_command " $arg"
+ case $arg in
+ -Zlinker | -Zstack)
+ prev=xcompiler
+ ;;
+ esac
+ continue
+ else
+ # Otherwise treat like 'Some other compiler flag' below
+ func_quote_for_eval "$arg"
+ arg=$func_quote_for_eval_result
+ fi
+ ;;
+
# Some other compiler flag.
-* | +*)
func_quote_for_eval "$arg"
- arg="$func_quote_for_eval_result"
+ arg=$func_quote_for_eval_result
;;
*.$objext)
@@ -5886,21 +7330,21 @@
if test -z "$pic_object" ||
test -z "$non_pic_object" ||
- test "$pic_object" = none &&
- test "$non_pic_object" = none; then
- func_fatal_error "cannot find name of object for \`$arg'"
+ test none = "$pic_object" &&
+ test none = "$non_pic_object"; then
+ func_fatal_error "cannot find name of object for '$arg'"
fi
# Extract subdirectory from the argument.
func_dirname "$arg" "/" ""
- xdir="$func_dirname_result"
+ xdir=$func_dirname_result
- if test "$pic_object" != none; then
+ test none = "$pic_object" || {
# Prepend the subdirectory the object is found in.
- pic_object="$xdir$pic_object"
+ pic_object=$xdir$pic_object
- if test "$prev" = dlfiles; then
- if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
+ if test dlfiles = "$prev"; then
+ if test yes = "$build_libtool_libs" && test yes = "$dlopen_support"; then
func_append dlfiles " $pic_object"
prev=
continue
@@ -5911,7 +7355,7 @@
fi
# CHECK ME: I think I busted this. -Ossama
- if test "$prev" = dlprefiles; then
+ if test dlprefiles = "$prev"; then
# Preload the old-style object.
func_append dlprefiles " $pic_object"
prev=
@@ -5919,23 +7363,23 @@
# A PIC object.
func_append libobjs " $pic_object"
- arg="$pic_object"
- fi
+ arg=$pic_object
+ }
# Non-PIC object.
- if test "$non_pic_object" != none; then
+ if test none != "$non_pic_object"; then
# Prepend the subdirectory the object is found in.
- non_pic_object="$xdir$non_pic_object"
+ non_pic_object=$xdir$non_pic_object
# A standard non-PIC object
func_append non_pic_objects " $non_pic_object"
- if test -z "$pic_object" || test "$pic_object" = none ; then
- arg="$non_pic_object"
+ if test -z "$pic_object" || test none = "$pic_object"; then
+ arg=$non_pic_object
fi
else
# If the PIC object exists, use it instead.
# $xdir was prepended to $pic_object above.
- non_pic_object="$pic_object"
+ non_pic_object=$pic_object
func_append non_pic_objects " $non_pic_object"
fi
else
@@ -5943,7 +7387,7 @@
if $opt_dry_run; then
# Extract subdirectory from the argument.
func_dirname "$arg" "/" ""
- xdir="$func_dirname_result"
+ xdir=$func_dirname_result
func_lo2o "$arg"
pic_object=$xdir$objdir/$func_lo2o_result
@@ -5951,7 +7395,7 @@
func_append libobjs " $pic_object"
func_append non_pic_objects " $non_pic_object"
else
- func_fatal_error "\`$arg' is not a valid libtool object"
+ func_fatal_error "'$arg' is not a valid libtool object"
fi
fi
;;
@@ -5967,11 +7411,11 @@
# A libtool-controlled library.
func_resolve_sysroot "$arg"
- if test "$prev" = dlfiles; then
+ if test dlfiles = "$prev"; then
# This library was specified with -dlopen.
func_append dlfiles " $func_resolve_sysroot_result"
prev=
- elif test "$prev" = dlprefiles; then
+ elif test dlprefiles = "$prev"; then
# The library was specified with -dlpreopen.
func_append dlprefiles " $func_resolve_sysroot_result"
prev=
@@ -5986,7 +7430,7 @@
# Unknown arguments in both finalize_command and compile_command need
# to be aesthetically quoted because they are evaled later.
func_quote_for_eval "$arg"
- arg="$func_quote_for_eval_result"
+ arg=$func_quote_for_eval_result
;;
esac # arg
@@ -5998,9 +7442,9 @@
done # argument parsing loop
test -n "$prev" && \
- func_fatal_help "the \`$prevarg' option requires an argument"
+ func_fatal_help "the '$prevarg' option requires an argument"
- if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
+ if test yes = "$export_dynamic" && test -n "$export_dynamic_flag_spec"; then
eval arg=\"$export_dynamic_flag_spec\"
func_append compile_command " $arg"
func_append finalize_command " $arg"
@@ -6009,12 +7453,12 @@
oldlibs=
# calculate the name of the file, without its directory
func_basename "$output"
- outputname="$func_basename_result"
- libobjs_save="$libobjs"
+ outputname=$func_basename_result
+ libobjs_save=$libobjs
if test -n "$shlibpath_var"; then
# get the directories listed in $shlibpath_var
- eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\`
+ eval shlib_search_path=\`\$ECHO \"\$$shlibpath_var\" \| \$SED \'s/:/ /g\'\`
else
shlib_search_path=
fi
@@ -6021,8 +7465,11 @@
eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
+ # Definition is injected by LT_CONFIG during libtool generation.
+ func_munge_path_list sys_lib_dlsearch_path "$LT_SYS_LIBRARY_PATH"
+
func_dirname "$output" "/" ""
- output_objdir="$func_dirname_result$objdir"
+ output_objdir=$func_dirname_result$objdir
func_to_tool_file "$output_objdir/"
tool_output_objdir=$func_to_tool_file_result
# Create the object directory.
@@ -6045,7 +7492,7 @@
# Find all interdependent deplibs by searching for libraries
# that are linked more than once (e.g. -la -lb -la)
for deplib in $deplibs; do
- if $opt_preserve_dup_deps ; then
+ if $opt_preserve_dup_deps; then
case "$libs " in
*" $deplib "*) func_append specialdeplibs " $deplib" ;;
esac
@@ -6053,7 +7500,7 @@
func_append libs " $deplib"
done
- if test "$linkmode" = lib; then
+ if test lib = "$linkmode"; then
libs="$predeps $libs $compiler_lib_search_path $postdeps"
# Compute libraries that are listed more than once in $predeps
@@ -6085,7 +7532,7 @@
case $file in
*.la) ;;
*)
- func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file"
+ func_fatal_help "libraries can '-dlopen' only libtool libraries: $file"
;;
esac
done
@@ -6093,7 +7540,7 @@
prog)
compile_deplibs=
finalize_deplibs=
- alldeplibs=no
+ alldeplibs=false
newdlfiles=
newdlprefiles=
passes="conv scan dlopen dlpreopen link"
@@ -6105,7 +7552,7 @@
for pass in $passes; do
# The preopen pass in lib mode reverses $deplibs; put it back here
# so that -L comes before libs that need it for instance...
- if test "$linkmode,$pass" = "lib,link"; then
+ if test lib,link = "$linkmode,$pass"; then
## FIXME: Find the place where the list is rebuilt in the wrong
## order, and fix it there properly
tmp_deplibs=
@@ -6112,18 +7559,18 @@
for deplib in $deplibs; do
tmp_deplibs="$deplib $tmp_deplibs"
done
- deplibs="$tmp_deplibs"
+ deplibs=$tmp_deplibs
fi
- if test "$linkmode,$pass" = "lib,link" ||
- test "$linkmode,$pass" = "prog,scan"; then
- libs="$deplibs"
+ if test lib,link = "$linkmode,$pass" ||
+ test prog,scan = "$linkmode,$pass"; then
+ libs=$deplibs
deplibs=
fi
- if test "$linkmode" = prog; then
+ if test prog = "$linkmode"; then
case $pass in
- dlopen) libs="$dlfiles" ;;
- dlpreopen) libs="$dlprefiles" ;;
+ dlopen) libs=$dlfiles ;;
+ dlpreopen) libs=$dlprefiles ;;
link)
libs="$deplibs %DEPLIBS%"
test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs"
@@ -6130,7 +7577,7 @@
;;
esac
fi
- if test "$linkmode,$pass" = "lib,dlpreopen"; then
+ if test lib,dlpreopen = "$linkmode,$pass"; then
# Collect and forward deplibs of preopened libtool libs
for lib in $dlprefiles; do
# Ignore non-libtool-libs
@@ -6151,26 +7598,26 @@
esac
done
done
- libs="$dlprefiles"
+ libs=$dlprefiles
fi
- if test "$pass" = dlopen; then
+ if test dlopen = "$pass"; then
# Collect dlpreopened libraries
- save_deplibs="$deplibs"
+ save_deplibs=$deplibs
deplibs=
fi
for deplib in $libs; do
lib=
- found=no
+ found=false
case $deplib in
-mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
|-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
- if test "$linkmode,$pass" = "prog,link"; then
+ if test prog,link = "$linkmode,$pass"; then
compile_deplibs="$deplib $compile_deplibs"
finalize_deplibs="$deplib $finalize_deplibs"
else
func_append compiler_flags " $deplib"
- if test "$linkmode" = lib ; then
+ if test lib = "$linkmode"; then
case "$new_inherited_linker_flags " in
*" $deplib "*) ;;
* ) func_append new_inherited_linker_flags " $deplib" ;;
@@ -6180,13 +7627,13 @@
continue
;;
-l*)
- if test "$linkmode" != lib && test "$linkmode" != prog; then
- func_warning "\`-l' is ignored for archives/objects"
+ if test lib != "$linkmode" && test prog != "$linkmode"; then
+ func_warning "'-l' is ignored for archives/objects"
continue
fi
func_stripname '-l' '' "$deplib"
name=$func_stripname_result
- if test "$linkmode" = lib; then
+ if test lib = "$linkmode"; then
searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
else
searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
@@ -6194,31 +7641,22 @@
for searchdir in $searchdirs; do
for search_ext in .la $std_shrext .so .a; do
# Search the libtool library
- lib="$searchdir/lib${name}${search_ext}"
+ lib=$searchdir/lib$name$search_ext
if test -f "$lib"; then
- if test "$search_ext" = ".la"; then
- found=yes
+ if test .la = "$search_ext"; then
+ found=:
else
- found=no
+ found=false
fi
break 2
fi
done
done
- if test "$found" != yes; then
- # deplib doesn't seem to be a libtool library
- if test "$linkmode,$pass" = "prog,link"; then
- compile_deplibs="$deplib $compile_deplibs"
- finalize_deplibs="$deplib $finalize_deplibs"
- else
- deplibs="$deplib $deplibs"
- test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
- fi
- continue
- else # deplib is a libtool library
+ if $found; then
+ # deplib is a libtool library
# If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
# We need to do some special things here, and not later.
- if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ if test yes = "$allow_libtool_libs_with_static_runtimes"; then
case " $predeps $postdeps " in
*" $deplib "*)
if func_lalib_p "$lib"; then
@@ -6226,19 +7664,19 @@
old_library=
func_source "$lib"
for l in $old_library $library_names; do
- ll="$l"
+ ll=$l
done
- if test "X$ll" = "X$old_library" ; then # only static version available
- found=no
+ if test "X$ll" = "X$old_library"; then # only static version available
+ found=false
func_dirname "$lib" "" "."
- ladir="$func_dirname_result"
+ ladir=$func_dirname_result
lib=$ladir/$old_library
- if test "$linkmode,$pass" = "prog,link"; then
+ if test prog,link = "$linkmode,$pass"; then
compile_deplibs="$deplib $compile_deplibs"
finalize_deplibs="$deplib $finalize_deplibs"
else
deplibs="$deplib $deplibs"
- test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
+ test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs"
fi
continue
fi
@@ -6247,15 +7685,25 @@
*) ;;
esac
fi
+ else
+ # deplib doesn't seem to be a libtool library
+ if test prog,link = "$linkmode,$pass"; then
+ compile_deplibs="$deplib $compile_deplibs"
+ finalize_deplibs="$deplib $finalize_deplibs"
+ else
+ deplibs="$deplib $deplibs"
+ test lib = "$linkmode" && newdependency_libs="$deplib $newdependency_libs"
+ fi
+ continue
fi
;; # -l
*.ltframework)
- if test "$linkmode,$pass" = "prog,link"; then
+ if test prog,link = "$linkmode,$pass"; then
compile_deplibs="$deplib $compile_deplibs"
finalize_deplibs="$deplib $finalize_deplibs"
else
deplibs="$deplib $deplibs"
- if test "$linkmode" = lib ; then
+ if test lib = "$linkmode"; then
case "$new_inherited_linker_flags " in
*" $deplib "*) ;;
* ) func_append new_inherited_linker_flags " $deplib" ;;
@@ -6268,7 +7716,7 @@
case $linkmode in
lib)
deplibs="$deplib $deplibs"
- test "$pass" = conv && continue
+ test conv = "$pass" && continue
newdependency_libs="$deplib $newdependency_libs"
func_stripname '-L' '' "$deplib"
func_resolve_sysroot "$func_stripname_result"
@@ -6275,11 +7723,11 @@
func_append newlib_search_path " $func_resolve_sysroot_result"
;;
prog)
- if test "$pass" = conv; then
+ if test conv = "$pass"; then
deplibs="$deplib $deplibs"
continue
fi
- if test "$pass" = scan; then
+ if test scan = "$pass"; then
deplibs="$deplib $deplibs"
else
compile_deplibs="$deplib $compile_deplibs"
@@ -6290,13 +7738,13 @@
func_append newlib_search_path " $func_resolve_sysroot_result"
;;
*)
- func_warning "\`-L' is ignored for archives/objects"
+ func_warning "'-L' is ignored for archives/objects"
;;
esac # linkmode
continue
;; # -L
-R*)
- if test "$pass" = link; then
+ if test link = "$pass"; then
func_stripname '-R' '' "$deplib"
func_resolve_sysroot "$func_stripname_result"
dir=$func_resolve_sysroot_result
@@ -6314,7 +7762,7 @@
lib=$func_resolve_sysroot_result
;;
*.$libext)
- if test "$pass" = conv; then
+ if test conv = "$pass"; then
deplibs="$deplib $deplibs"
continue
fi
@@ -6325,7 +7773,7 @@
case " $dlpreconveniencelibs " in
*" $deplib "*) ;;
*)
- valid_a_lib=no
+ valid_a_lib=false
case $deplibs_check_method in
match_pattern*)
set dummy $deplibs_check_method; shift
@@ -6332,15 +7780,20 @@
match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \
| $EGREP "$match_pattern_regex" > /dev/null; then
- valid_a_lib=yes
+ valid_a_lib=:
fi
;;
pass_all)
- valid_a_lib=yes
+ valid_a_lib=:
;;
esac
- if test "$valid_a_lib" != yes; then
+ if $valid_a_lib; then
echo
+ $ECHO "*** Warning: Linking the shared library $output against the"
+ $ECHO "*** static library $deplib is not portable!"
+ deplibs="$deplib $deplibs"
+ else
+ echo
$ECHO "*** Warning: Trying to link with static lib archive $deplib."
echo "*** I have the capability to make that library automatically link in when"
echo "*** you link to this library. But I can only do this if you have a"
@@ -6347,11 +7800,6 @@
echo "*** shared version of the library, which you do not appear to have"
echo "*** because the file extensions .$libext of this argument makes me believe"
echo "*** that it is just a static archive that I should not use here."
- else
- echo
- $ECHO "*** Warning: Linking the shared library $output against the"
- $ECHO "*** static library $deplib is not portable!"
- deplibs="$deplib $deplibs"
fi
;;
esac
@@ -6358,7 +7806,7 @@
continue
;;
prog)
- if test "$pass" != link; then
+ if test link != "$pass"; then
deplibs="$deplib $deplibs"
else
compile_deplibs="$deplib $compile_deplibs"
@@ -6369,10 +7817,10 @@
esac # linkmode
;; # *.$libext
*.lo | *.$objext)
- if test "$pass" = conv; then
+ if test conv = "$pass"; then
deplibs="$deplib $deplibs"
- elif test "$linkmode" = prog; then
- if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
+ elif test prog = "$linkmode"; then
+ if test dlpreopen = "$pass" || test yes != "$dlopen_support" || test no = "$build_libtool_libs"; then
# If there is no dlopen support or we're linking statically,
# we need to preload.
func_append newdlprefiles " $deplib"
@@ -6385,22 +7833,20 @@
continue
;;
%DEPLIBS%)
- alldeplibs=yes
+ alldeplibs=:
continue
;;
esac # case $deplib
- if test "$found" = yes || test -f "$lib"; then :
- else
- func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'"
- fi
+ $found || test -f "$lib" \
+ || func_fatal_error "cannot find the library '$lib' or unhandled argument '$deplib'"
# Check to see that this really is a libtool archive.
func_lalib_unsafe_p "$lib" \
- || func_fatal_error "\`$lib' is not a valid libtool archive"
+ || func_fatal_error "'$lib' is not a valid libtool archive"
func_dirname "$lib" "" "."
- ladir="$func_dirname_result"
+ ladir=$func_dirname_result
dlname=
dlopen=
@@ -6430,19 +7876,19 @@
done
fi
dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
- if test "$linkmode,$pass" = "lib,link" ||
- test "$linkmode,$pass" = "prog,scan" ||
- { test "$linkmode" != prog && test "$linkmode" != lib; }; then
+ if test lib,link = "$linkmode,$pass" ||
+ test prog,scan = "$linkmode,$pass" ||
+ { test prog != "$linkmode" && test lib != "$linkmode"; }; then
test -n "$dlopen" && func_append dlfiles " $dlopen"
test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen"
fi
- if test "$pass" = conv; then
+ if test conv = "$pass"; then
# Only check for convenience libraries
deplibs="$lib $deplibs"
if test -z "$libdir"; then
if test -z "$old_library"; then
- func_fatal_error "cannot find name of link library for \`$lib'"
+ func_fatal_error "cannot find name of link library for '$lib'"
fi
# It is a libtool convenience library, so add in its objects.
func_append convenience " $ladir/$objdir/$old_library"
@@ -6450,7 +7896,7 @@
tmp_libs=
for deplib in $dependency_libs; do
deplibs="$deplib $deplibs"
- if $opt_preserve_dup_deps ; then
+ if $opt_preserve_dup_deps; then
case "$tmp_libs " in
*" $deplib "*) func_append specialdeplibs " $deplib" ;;
esac
@@ -6457,8 +7903,8 @@
fi
func_append tmp_libs " $deplib"
done
- elif test "$linkmode" != prog && test "$linkmode" != lib; then
- func_fatal_error "\`$lib' is not a convenience library"
+ elif test prog != "$linkmode" && test lib != "$linkmode"; then
+ func_fatal_error "'$lib' is not a convenience library"
fi
continue
fi # $pass = conv
@@ -6467,26 +7913,26 @@
# Get the name of the library we link against.
linklib=
if test -n "$old_library" &&
- { test "$prefer_static_libs" = yes ||
- test "$prefer_static_libs,$installed" = "built,no"; }; then
+ { test yes = "$prefer_static_libs" ||
+ test built,no = "$prefer_static_libs,$installed"; }; then
linklib=$old_library
else
for l in $old_library $library_names; do
- linklib="$l"
+ linklib=$l
done
fi
if test -z "$linklib"; then
- func_fatal_error "cannot find name of link library for \`$lib'"
+ func_fatal_error "cannot find name of link library for '$lib'"
fi
# This library was specified with -dlopen.
- if test "$pass" = dlopen; then
- if test -z "$libdir"; then
- func_fatal_error "cannot -dlopen a convenience library: \`$lib'"
- fi
+ if test dlopen = "$pass"; then
+ test -z "$libdir" \
+ && func_fatal_error "cannot -dlopen a convenience library: '$lib'"
if test -z "$dlname" ||
- test "$dlopen_support" != yes ||
- test "$build_libtool_libs" = no; then
+ test yes != "$dlopen_support" ||
+ test no = "$build_libtool_libs"
+ then
# If there is no dlname, no dlopen support or we're linking
# statically, we need to preload. We also need to preload any
# dependent libraries so libltdl's deplib preloader doesn't
@@ -6500,40 +7946,40 @@
# We need an absolute path.
case $ladir in
- [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
+ [\\/]* | [A-Za-z]:[\\/]*) abs_ladir=$ladir ;;
*)
abs_ladir=`cd "$ladir" && pwd`
if test -z "$abs_ladir"; then
- func_warning "cannot determine absolute directory name of \`$ladir'"
+ func_warning "cannot determine absolute directory name of '$ladir'"
func_warning "passing it literally to the linker, although it might fail"
- abs_ladir="$ladir"
+ abs_ladir=$ladir
fi
;;
esac
func_basename "$lib"
- laname="$func_basename_result"
+ laname=$func_basename_result
# Find the relevant object directory and library name.
- if test "X$installed" = Xyes; then
+ if test yes = "$installed"; then
if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
- func_warning "library \`$lib' was moved."
- dir="$ladir"
- absdir="$abs_ladir"
- libdir="$abs_ladir"
+ func_warning "library '$lib' was moved."
+ dir=$ladir
+ absdir=$abs_ladir
+ libdir=$abs_ladir
else
- dir="$lt_sysroot$libdir"
- absdir="$lt_sysroot$libdir"
+ dir=$lt_sysroot$libdir
+ absdir=$lt_sysroot$libdir
fi
- test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
+ test yes = "$hardcode_automatic" && avoidtemprpath=yes
else
if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
- dir="$ladir"
- absdir="$abs_ladir"
+ dir=$ladir
+ absdir=$abs_ladir
# Remove this search path later
func_append notinst_path " $abs_ladir"
else
- dir="$ladir/$objdir"
- absdir="$abs_ladir/$objdir"
+ dir=$ladir/$objdir
+ absdir=$abs_ladir/$objdir
# Remove this search path later
func_append notinst_path " $abs_ladir"
fi
@@ -6542,11 +7988,11 @@
name=$func_stripname_result
# This library was specified with -dlpreopen.
- if test "$pass" = dlpreopen; then
- if test -z "$libdir" && test "$linkmode" = prog; then
- func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'"
+ if test dlpreopen = "$pass"; then
+ if test -z "$libdir" && test prog = "$linkmode"; then
+ func_fatal_error "only libraries may -dlpreopen a convenience library: '$lib'"
fi
- case "$host" in
+ case $host in
# special handling for platforms with PE-DLLs.
*cygwin* | *mingw* | *cegcc* )
# Linker will automatically link against shared library if both
@@ -6590,9 +8036,9 @@
if test -z "$libdir"; then
# Link the convenience library
- if test "$linkmode" = lib; then
+ if test lib = "$linkmode"; then
deplibs="$dir/$old_library $deplibs"
- elif test "$linkmode,$pass" = "prog,link"; then
+ elif test prog,link = "$linkmode,$pass"; then
compile_deplibs="$dir/$old_library $compile_deplibs"
finalize_deplibs="$dir/$old_library $finalize_deplibs"
else
@@ -6602,14 +8048,14 @@
fi
- if test "$linkmode" = prog && test "$pass" != link; then
+ if test prog = "$linkmode" && test link != "$pass"; then
func_append newlib_search_path " $ladir"
deplibs="$lib $deplibs"
- linkalldeplibs=no
- if test "$link_all_deplibs" != no || test -z "$library_names" ||
- test "$build_libtool_libs" = no; then
- linkalldeplibs=yes
+ linkalldeplibs=false
+ if test no != "$link_all_deplibs" || test -z "$library_names" ||
+ test no = "$build_libtool_libs"; then
+ linkalldeplibs=:
fi
tmp_libs=
@@ -6621,7 +8067,7 @@
;;
esac
# Need to link against all dependency_libs?
- if test "$linkalldeplibs" = yes; then
+ if $linkalldeplibs; then
deplibs="$deplib $deplibs"
else
# Need to hardcode shared library paths
@@ -6628,7 +8074,7 @@
# or/and link against static libraries
newdependency_libs="$deplib $newdependency_libs"
fi
- if $opt_preserve_dup_deps ; then
+ if $opt_preserve_dup_deps; then
case "$tmp_libs " in
*" $deplib "*) func_append specialdeplibs " $deplib" ;;
esac
@@ -6638,15 +8084,15 @@
continue
fi # $linkmode = prog...
- if test "$linkmode,$pass" = "prog,link"; then
+ if test prog,link = "$linkmode,$pass"; then
if test -n "$library_names" &&
- { { test "$prefer_static_libs" = no ||
- test "$prefer_static_libs,$installed" = "built,yes"; } ||
+ { { test no = "$prefer_static_libs" ||
+ test built,yes = "$prefer_static_libs,$installed"; } ||
test -z "$old_library"; }; then
# We need to hardcode the library path
- if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
+ if test -n "$shlibpath_var" && test -z "$avoidtemprpath"; then
# Make sure the rpath contains only unique directories.
- case "$temp_rpath:" in
+ case $temp_rpath: in
*"$absdir:"*) ;;
*) func_append temp_rpath "$absdir:" ;;
esac
@@ -6675,9 +8121,9 @@
esac
fi # $linkmode,$pass = prog,link...
- if test "$alldeplibs" = yes &&
- { test "$deplibs_check_method" = pass_all ||
- { test "$build_libtool_libs" = yes &&
+ if $alldeplibs &&
+ { test pass_all = "$deplibs_check_method" ||
+ { test yes = "$build_libtool_libs" &&
test -n "$library_names"; }; }; then
# We only need to search for static libraries
continue
@@ -6686,19 +8132,19 @@
link_static=no # Whether the deplib will be linked statically
use_static_libs=$prefer_static_libs
- if test "$use_static_libs" = built && test "$installed" = yes; then
+ if test built = "$use_static_libs" && test yes = "$installed"; then
use_static_libs=no
fi
if test -n "$library_names" &&
- { test "$use_static_libs" = no || test -z "$old_library"; }; then
+ { test no = "$use_static_libs" || test -z "$old_library"; }; then
case $host in
- *cygwin* | *mingw* | *cegcc*)
+ *cygwin* | *mingw* | *cegcc* | *os2*)
# No point in relinking DLLs because paths are not encoded
func_append notinst_deplibs " $lib"
need_relink=no
;;
*)
- if test "$installed" = no; then
+ if test no = "$installed"; then
func_append notinst_deplibs " $lib"
need_relink=yes
fi
@@ -6708,16 +8154,16 @@
# Warn about portability, can't link against -module's on some
# systems (darwin). Don't bleat about dlopened modules though!
- dlopenmodule=""
+ dlopenmodule=
for dlpremoduletest in $dlprefiles; do
if test "X$dlpremoduletest" = "X$lib"; then
- dlopenmodule="$dlpremoduletest"
+ dlopenmodule=$dlpremoduletest
break
fi
done
- if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then
+ if test -z "$dlopenmodule" && test yes = "$shouldnotlink" && test link = "$pass"; then
echo
- if test "$linkmode" = prog; then
+ if test prog = "$linkmode"; then
$ECHO "*** Warning: Linking the executable $output against the loadable module"
else
$ECHO "*** Warning: Linking the shared library $output against the loadable module"
@@ -6724,8 +8170,8 @@
fi
$ECHO "*** $linklib is not portable!"
fi
- if test "$linkmode" = lib &&
- test "$hardcode_into_libs" = yes; then
+ if test lib = "$linkmode" &&
+ test yes = "$hardcode_into_libs"; then
# Hardcode the library path.
# Skip directories that are in the system default run-time
# search path.
@@ -6753,30 +8199,30 @@
# figure out the soname
set dummy $library_names
shift
- realname="$1"
+ realname=$1
shift
libname=`eval "\\$ECHO \"$libname_spec\""`
# use dlname if we got it. it's perfectly good, no?
if test -n "$dlname"; then
- soname="$dlname"
+ soname=$dlname
elif test -n "$soname_spec"; then
# bleh windows
case $host in
- *cygwin* | mingw* | *cegcc*)
+ *cygwin* | mingw* | *cegcc* | *os2*)
func_arith $current - $age
major=$func_arith_result
- versuffix="-$major"
+ versuffix=-$major
;;
esac
eval soname=\"$soname_spec\"
else
- soname="$realname"
+ soname=$realname
fi
# Make a new name for the extract_expsyms_cmds to use
- soroot="$soname"
+ soroot=$soname
func_basename "$soroot"
- soname="$func_basename_result"
+ soname=$func_basename_result
func_stripname 'lib' '.dll' "$soname"
newlib=libimp-$func_stripname_result.a
@@ -6783,13 +8229,13 @@
# If the library has no export list, then create one now
if test -f "$output_objdir/$soname-def"; then :
else
- func_verbose "extracting exported symbol list from \`$soname'"
+ func_verbose "extracting exported symbol list from '$soname'"
func_execute_cmds "$extract_expsyms_cmds" 'exit $?'
fi
# Create $newlib
if test -f "$output_objdir/$newlib"; then :; else
- func_verbose "generating import library for \`$soname'"
+ func_verbose "generating import library for '$soname'"
func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?'
fi
# make sure the library variables are pointing to the new library
@@ -6797,7 +8243,7 @@
linklib=$newlib
fi # test -n "$old_archive_from_expsyms_cmds"
- if test "$linkmode" = prog || test "$opt_mode" != relink; then
+ if test prog = "$linkmode" || test relink != "$opt_mode"; then
add_shlibpath=
add_dir=
add=
@@ -6804,51 +8250,51 @@
lib_linked=yes
case $hardcode_action in
immediate | unsupported)
- if test "$hardcode_direct" = no; then
- add="$dir/$linklib"
+ if test no = "$hardcode_direct"; then
+ add=$dir/$linklib
case $host in
- *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
- *-*-sysv4*uw2*) add_dir="-L$dir" ;;
+ *-*-sco3.2v5.0.[024]*) add_dir=-L$dir ;;
+ *-*-sysv4*uw2*) add_dir=-L$dir ;;
*-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
- *-*-unixware7*) add_dir="-L$dir" ;;
+ *-*-unixware7*) add_dir=-L$dir ;;
*-*-darwin* )
- # if the lib is a (non-dlopened) module then we can not
+ # if the lib is a (non-dlopened) module then we cannot
# link against it, someone is ignoring the earlier warnings
if /usr/bin/file -L $add 2> /dev/null |
- $GREP ": [^:]* bundle" >/dev/null ; then
+ $GREP ": [^:]* bundle" >/dev/null; then
if test "X$dlopenmodule" != "X$lib"; then
$ECHO "*** Warning: lib $linklib is a module, not a shared library"
- if test -z "$old_library" ; then
+ if test -z "$old_library"; then
echo
echo "*** And there doesn't seem to be a static archive available"
echo "*** The link will probably fail, sorry"
else
- add="$dir/$old_library"
+ add=$dir/$old_library
fi
elif test -n "$old_library"; then
- add="$dir/$old_library"
+ add=$dir/$old_library
fi
fi
esac
- elif test "$hardcode_minus_L" = no; then
+ elif test no = "$hardcode_minus_L"; then
case $host in
- *-*-sunos*) add_shlibpath="$dir" ;;
+ *-*-sunos*) add_shlibpath=$dir ;;
esac
- add_dir="-L$dir"
- add="-l$name"
- elif test "$hardcode_shlibpath_var" = no; then
- add_shlibpath="$dir"
- add="-l$name"
+ add_dir=-L$dir
+ add=-l$name
+ elif test no = "$hardcode_shlibpath_var"; then
+ add_shlibpath=$dir
+ add=-l$name
else
lib_linked=no
fi
;;
relink)
- if test "$hardcode_direct" = yes &&
- test "$hardcode_direct_absolute" = no; then
- add="$dir/$linklib"
- elif test "$hardcode_minus_L" = yes; then
- add_dir="-L$absdir"
+ if test yes = "$hardcode_direct" &&
+ test no = "$hardcode_direct_absolute"; then
+ add=$dir/$linklib
+ elif test yes = "$hardcode_minus_L"; then
+ add_dir=-L$absdir
# Try looking first in the location we're being installed to.
if test -n "$inst_prefix_dir"; then
case $libdir in
@@ -6857,10 +8303,10 @@
;;
esac
fi
- add="-l$name"
- elif test "$hardcode_shlibpath_var" = yes; then
- add_shlibpath="$dir"
- add="-l$name"
+ add=-l$name
+ elif test yes = "$hardcode_shlibpath_var"; then
+ add_shlibpath=$dir
+ add=-l$name
else
lib_linked=no
fi
@@ -6868,7 +8314,7 @@
*) lib_linked=no ;;
esac
- if test "$lib_linked" != yes; then
+ if test yes != "$lib_linked"; then
func_fatal_configuration "unsupported hardcode properties"
fi
@@ -6878,15 +8324,15 @@
*) func_append compile_shlibpath "$add_shlibpath:" ;;
esac
fi
- if test "$linkmode" = prog; then
+ if test prog = "$linkmode"; then
test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
test -n "$add" && compile_deplibs="$add $compile_deplibs"
else
test -n "$add_dir" && deplibs="$add_dir $deplibs"
test -n "$add" && deplibs="$add $deplibs"
- if test "$hardcode_direct" != yes &&
- test "$hardcode_minus_L" != yes &&
- test "$hardcode_shlibpath_var" = yes; then
+ if test yes != "$hardcode_direct" &&
+ test yes != "$hardcode_minus_L" &&
+ test yes = "$hardcode_shlibpath_var"; then
case :$finalize_shlibpath: in
*":$libdir:"*) ;;
*) func_append finalize_shlibpath "$libdir:" ;;
@@ -6895,33 +8341,33 @@
fi
fi
- if test "$linkmode" = prog || test "$opt_mode" = relink; then
+ if test prog = "$linkmode" || test relink = "$opt_mode"; then
add_shlibpath=
add_dir=
add=
# Finalize command for both is simple: just hardcode it.
- if test "$hardcode_direct" = yes &&
- test "$hardcode_direct_absolute" = no; then
- add="$libdir/$linklib"
- elif test "$hardcode_minus_L" = yes; then
- add_dir="-L$libdir"
- add="-l$name"
- elif test "$hardcode_shlibpath_var" = yes; then
+ if test yes = "$hardcode_direct" &&
+ test no = "$hardcode_direct_absolute"; then
+ add=$libdir/$linklib
+ elif test yes = "$hardcode_minus_L"; then
+ add_dir=-L$libdir
+ add=-l$name
+ elif test yes = "$hardcode_shlibpath_var"; then
case :$finalize_shlibpath: in
*":$libdir:"*) ;;
*) func_append finalize_shlibpath "$libdir:" ;;
esac
- add="-l$name"
- elif test "$hardcode_automatic" = yes; then
+ add=-l$name
+ elif test yes = "$hardcode_automatic"; then
if test -n "$inst_prefix_dir" &&
- test -f "$inst_prefix_dir$libdir/$linklib" ; then
- add="$inst_prefix_dir$libdir/$linklib"
+ test -f "$inst_prefix_dir$libdir/$linklib"; then
+ add=$inst_prefix_dir$libdir/$linklib
else
- add="$libdir/$linklib"
+ add=$libdir/$linklib
fi
else
# We cannot seem to hardcode it, guess we'll fake it.
- add_dir="-L$libdir"
+ add_dir=-L$libdir
# Try looking first in the location we're being installed to.
if test -n "$inst_prefix_dir"; then
case $libdir in
@@ -6930,10 +8376,10 @@
;;
esac
fi
- add="-l$name"
+ add=-l$name
fi
- if test "$linkmode" = prog; then
+ if test prog = "$linkmode"; then
test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
else
@@ -6941,12 +8387,12 @@
test -n "$add" && deplibs="$add $deplibs"
fi
fi
- elif test "$linkmode" = prog; then
+ elif test prog = "$linkmode"; then
# Here we assume that one of hardcode_direct or hardcode_minus_L
# is not unsupported. This is valid on all known static and
# shared platforms.
- if test "$hardcode_direct" != unsupported; then
- test -n "$old_library" && linklib="$old_library"
+ if test unsupported != "$hardcode_direct"; then
+ test -n "$old_library" && linklib=$old_library
compile_deplibs="$dir/$linklib $compile_deplibs"
finalize_deplibs="$dir/$linklib $finalize_deplibs"
else
@@ -6953,9 +8399,9 @@
compile_deplibs="-l$name -L$dir $compile_deplibs"
finalize_deplibs="-l$name -L$dir $finalize_deplibs"
fi
- elif test "$build_libtool_libs" = yes; then
+ elif test yes = "$build_libtool_libs"; then
# Not a shared library
- if test "$deplibs_check_method" != pass_all; then
+ if test pass_all != "$deplibs_check_method"; then
# We're trying link a shared library against a static one
# but the system doesn't support it.
@@ -6962,11 +8408,11 @@
# Just print a warning and add the library to dependency_libs so
# that the program can be linked against the static library.
echo
- $ECHO "*** Warning: This system can not link to static lib archive $lib."
+ $ECHO "*** Warning: This system cannot link to static lib archive $lib."
echo "*** I have the capability to make that library automatically link in when"
echo "*** you link to this library. But I can only do this if you have a"
echo "*** shared version of the library, which you do not appear to have."
- if test "$module" = yes; then
+ if test yes = "$module"; then
echo "*** But as you try to build a module library, libtool will still create "
echo "*** a static module, that should work as long as the dlopening application"
echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
@@ -6973,11 +8419,11 @@
if test -z "$global_symbol_pipe"; then
echo
echo "*** However, this would only work if libtool was able to extract symbol"
- echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
+ echo "*** lists from a program, using 'nm' or equivalent, but libtool could"
echo "*** not find such a program. So, this module is probably useless."
- echo "*** \`nm' from GNU binutils and a full rebuild may help."
+ echo "*** 'nm' from GNU binutils and a full rebuild may help."
fi
- if test "$build_old_libs" = no; then
+ if test no = "$build_old_libs"; then
build_libtool_libs=module
build_old_libs=yes
else
@@ -6990,11 +8436,11 @@
fi
fi # link shared/static library?
- if test "$linkmode" = lib; then
+ if test lib = "$linkmode"; then
if test -n "$dependency_libs" &&
- { test "$hardcode_into_libs" != yes ||
- test "$build_old_libs" = yes ||
- test "$link_static" = yes; }; then
+ { test yes != "$hardcode_into_libs" ||
+ test yes = "$build_old_libs" ||
+ test yes = "$link_static"; }; then
# Extract -R from dependency_libs
temp_deplibs=
for libdir in $dependency_libs; do
@@ -7008,12 +8454,12 @@
*) func_append temp_deplibs " $libdir";;
esac
done
- dependency_libs="$temp_deplibs"
+ dependency_libs=$temp_deplibs
fi
func_append newlib_search_path " $absdir"
# Link against this library
- test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
+ test no = "$link_static" && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
# ... and its dependency_libs
tmp_libs=
for deplib in $dependency_libs; do
@@ -7023,7 +8469,7 @@
func_resolve_sysroot "$func_stripname_result";;
*) func_resolve_sysroot "$deplib" ;;
esac
- if $opt_preserve_dup_deps ; then
+ if $opt_preserve_dup_deps; then
case "$tmp_libs " in
*" $func_resolve_sysroot_result "*)
func_append specialdeplibs " $func_resolve_sysroot_result" ;;
@@ -7032,12 +8478,12 @@
func_append tmp_libs " $func_resolve_sysroot_result"
done
- if test "$link_all_deplibs" != no; then
+ if test no != "$link_all_deplibs"; then
# Add the search paths of all dependency libraries
for deplib in $dependency_libs; do
path=
case $deplib in
- -L*) path="$deplib" ;;
+ -L*) path=$deplib ;;
*.la)
func_resolve_sysroot "$deplib"
deplib=$func_resolve_sysroot_result
@@ -7045,12 +8491,12 @@
dir=$func_dirname_result
# We need an absolute path.
case $dir in
- [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
+ [\\/]* | [A-Za-z]:[\\/]*) absdir=$dir ;;
*)
absdir=`cd "$dir" && pwd`
if test -z "$absdir"; then
- func_warning "cannot determine absolute directory name of \`$dir'"
- absdir="$dir"
+ func_warning "cannot determine absolute directory name of '$dir'"
+ absdir=$dir
fi
;;
esac
@@ -7058,35 +8504,35 @@
case $host in
*-*-darwin*)
depdepl=
- eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
- if test -n "$deplibrary_names" ; then
- for tmp in $deplibrary_names ; do
+ eval deplibrary_names=`$SED -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
+ if test -n "$deplibrary_names"; then
+ for tmp in $deplibrary_names; do
depdepl=$tmp
done
- if test -f "$absdir/$objdir/$depdepl" ; then
- depdepl="$absdir/$objdir/$depdepl"
- darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
+ if test -f "$absdir/$objdir/$depdepl"; then
+ depdepl=$absdir/$objdir/$depdepl
+ darwin_install_name=`$OTOOL -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
if test -z "$darwin_install_name"; then
- darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
+ darwin_install_name=`$OTOOL64 -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
fi
- func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
- func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}"
+ func_append compiler_flags " $wl-dylib_file $wl$darwin_install_name:$depdepl"
+ func_append linker_flags " -dylib_file $darwin_install_name:$depdepl"
path=
fi
fi
;;
*)
- path="-L$absdir/$objdir"
+ path=-L$absdir/$objdir
;;
esac
else
- eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
+ eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
test -z "$libdir" && \
- func_fatal_error "\`$deplib' is not a valid libtool archive"
+ func_fatal_error "'$deplib' is not a valid libtool archive"
test "$absdir" != "$libdir" && \
- func_warning "\`$deplib' seems to be moved"
+ func_warning "'$deplib' seems to be moved"
- path="-L$absdir"
+ path=-L$absdir
fi
;;
esac
@@ -7098,8 +8544,8 @@
fi # link_all_deplibs != no
fi # linkmode = lib
done # for deplib in $libs
- if test "$pass" = link; then
- if test "$linkmode" = "prog"; then
+ if test link = "$pass"; then
+ if test prog = "$linkmode"; then
compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
else
@@ -7106,15 +8552,15 @@
compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
fi
fi
- dependency_libs="$newdependency_libs"
- if test "$pass" = dlpreopen; then
+ dependency_libs=$newdependency_libs
+ if test dlpreopen = "$pass"; then
# Link the dlpreopened libraries before other libraries
for deplib in $save_deplibs; do
deplibs="$deplib $deplibs"
done
fi
- if test "$pass" != dlopen; then
- if test "$pass" != conv; then
+ if test dlopen != "$pass"; then
+ test conv = "$pass" || {
# Make sure lib_search_path contains only unique directories.
lib_search_path=
for dir in $newlib_search_path; do
@@ -7124,12 +8570,12 @@
esac
done
newlib_search_path=
- fi
+ }
- if test "$linkmode,$pass" != "prog,link"; then
- vars="deplibs"
+ if test prog,link = "$linkmode,$pass"; then
+ vars="compile_deplibs finalize_deplibs"
else
- vars="compile_deplibs finalize_deplibs"
+ vars=deplibs
fi
for var in $vars dependency_libs; do
# Add libraries to $var in reverse order
@@ -7187,62 +8633,93 @@
eval $var=\"$tmp_libs\"
done # for var
fi
+
+ # Add Sun CC postdeps if required:
+ test CXX = "$tagname" && {
+ case $host_os in
+ linux*)
+ case `$CC -V 2>&1 | sed 5q` in
+ *Sun\ C*) # Sun C++ 5.9
+ func_suncc_cstd_abi
+
+ if test no != "$suncc_use_cstd_abi"; then
+ func_append postdeps ' -library=Cstd -library=Crun'
+ fi
+ ;;
+ esac
+ ;;
+
+ solaris*)
+ func_cc_basename "$CC"
+ case $func_cc_basename_result in
+ CC* | sunCC*)
+ func_suncc_cstd_abi
+
+ if test no != "$suncc_use_cstd_abi"; then
+ func_append postdeps ' -library=Cstd -library=Crun'
+ fi
+ ;;
+ esac
+ ;;
+ esac
+ }
+
# Last step: remove runtime libs from dependency_libs
# (they stay in deplibs)
tmp_libs=
- for i in $dependency_libs ; do
+ for i in $dependency_libs; do
case " $predeps $postdeps $compiler_lib_search_path " in
*" $i "*)
- i=""
+ i=
;;
esac
- if test -n "$i" ; then
+ if test -n "$i"; then
func_append tmp_libs " $i"
fi
done
dependency_libs=$tmp_libs
done # for pass
- if test "$linkmode" = prog; then
- dlfiles="$newdlfiles"
+ if test prog = "$linkmode"; then
+ dlfiles=$newdlfiles
fi
- if test "$linkmode" = prog || test "$linkmode" = lib; then
- dlprefiles="$newdlprefiles"
+ if test prog = "$linkmode" || test lib = "$linkmode"; then
+ dlprefiles=$newdlprefiles
fi
case $linkmode in
oldlib)
- if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
- func_warning "\`-dlopen' is ignored for archives"
+ if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
+ func_warning "'-dlopen' is ignored for archives"
fi
case " $deplibs" in
*\ -l* | *\ -L*)
- func_warning "\`-l' and \`-L' are ignored for archives" ;;
+ func_warning "'-l' and '-L' are ignored for archives" ;;
esac
test -n "$rpath" && \
- func_warning "\`-rpath' is ignored for archives"
+ func_warning "'-rpath' is ignored for archives"
test -n "$xrpath" && \
- func_warning "\`-R' is ignored for archives"
+ func_warning "'-R' is ignored for archives"
test -n "$vinfo" && \
- func_warning "\`-version-info/-version-number' is ignored for archives"
+ func_warning "'-version-info/-version-number' is ignored for archives"
test -n "$release" && \
- func_warning "\`-release' is ignored for archives"
+ func_warning "'-release' is ignored for archives"
test -n "$export_symbols$export_symbols_regex" && \
- func_warning "\`-export-symbols' is ignored for archives"
+ func_warning "'-export-symbols' is ignored for archives"
# Now set the variables for building old libraries.
build_libtool_libs=no
- oldlibs="$output"
+ oldlibs=$output
func_append objs "$old_deplibs"
;;
lib)
- # Make sure we only generate libraries of the form `libNAME.la'.
+ # Make sure we only generate libraries of the form 'libNAME.la'.
case $outputname in
lib*)
func_stripname 'lib' '.la' "$outputname"
@@ -7251,10 +8728,10 @@
eval libname=\"$libname_spec\"
;;
*)
- test "$module" = no && \
- func_fatal_help "libtool library \`$output' must begin with \`lib'"
+ test no = "$module" \
+ && func_fatal_help "libtool library '$output' must begin with 'lib'"
- if test "$need_lib_prefix" != no; then
+ if test no != "$need_lib_prefix"; then
# Add the "lib" prefix for modules if required
func_stripname '' '.la' "$outputname"
name=$func_stripname_result
@@ -7268,8 +8745,8 @@
esac
if test -n "$objs"; then
- if test "$deplibs_check_method" != pass_all; then
- func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs"
+ if test pass_all != "$deplibs_check_method"; then
+ func_fatal_error "cannot build libtool library '$output' from non-libtool objects on this host:$objs"
else
echo
$ECHO "*** Warning: Linking the shared library $output against the non-libtool"
@@ -7278,21 +8755,21 @@
fi
fi
- test "$dlself" != no && \
- func_warning "\`-dlopen self' is ignored for libtool libraries"
+ test no = "$dlself" \
+ || func_warning "'-dlopen self' is ignored for libtool libraries"
set dummy $rpath
shift
- test "$#" -gt 1 && \
- func_warning "ignoring multiple \`-rpath's for a libtool library"
+ test 1 -lt "$#" \
+ && func_warning "ignoring multiple '-rpath's for a libtool library"
- install_libdir="$1"
+ install_libdir=$1
oldlibs=
if test -z "$rpath"; then
- if test "$build_libtool_libs" = yes; then
+ if test yes = "$build_libtool_libs"; then
# Building a libtool convenience library.
- # Some compilers have problems with a `.al' extension so
+ # Some compilers have problems with a '.al' extension so
# convenience libraries should have the same extension an
# archive normally would.
oldlibs="$output_objdir/$libname.$libext $oldlibs"
@@ -7301,20 +8778,20 @@
fi
test -n "$vinfo" && \
- func_warning "\`-version-info/-version-number' is ignored for convenience libraries"
+ func_warning "'-version-info/-version-number' is ignored for convenience libraries"
test -n "$release" && \
- func_warning "\`-release' is ignored for convenience libraries"
+ func_warning "'-release' is ignored for convenience libraries"
else
# Parse the version information argument.
- save_ifs="$IFS"; IFS=':'
+ save_ifs=$IFS; IFS=:
set dummy $vinfo 0 0 0
shift
- IFS="$save_ifs"
+ IFS=$save_ifs
test -n "$7" && \
- func_fatal_help "too many parameters to \`-version-info'"
+ func_fatal_help "too many parameters to '-version-info'"
# convert absolute version numbers to libtool ages
# this retains compatibility with .la files and attempts
@@ -7322,45 +8799,45 @@
case $vinfo_number in
yes)
- number_major="$1"
- number_minor="$2"
- number_revision="$3"
+ number_major=$1
+ number_minor=$2
+ number_revision=$3
#
# There are really only two kinds -- those that
# use the current revision as the major version
# and those that subtract age and use age as
# a minor version. But, then there is irix
- # which has an extra 1 added just for fun
+ # that has an extra 1 added just for fun
#
case $version_type in
# correct linux to gnu/linux during the next big refactor
- darwin|linux|osf|windows|none)
+ darwin|freebsd-elf|linux|osf|windows|none)
func_arith $number_major + $number_minor
current=$func_arith_result
- age="$number_minor"
- revision="$number_revision"
+ age=$number_minor
+ revision=$number_revision
;;
- freebsd-aout|freebsd-elf|qnx|sunos)
- current="$number_major"
- revision="$number_minor"
- age="0"
+ freebsd-aout|qnx|sunos)
+ current=$number_major
+ revision=$number_minor
+ age=0
;;
irix|nonstopux)
func_arith $number_major + $number_minor
current=$func_arith_result
- age="$number_minor"
- revision="$number_minor"
+ age=$number_minor
+ revision=$number_minor
lt_irix_increment=no
;;
*)
- func_fatal_configuration "$modename: unknown library version type \`$version_type'"
+ func_fatal_configuration "$modename: unknown library version type '$version_type'"
;;
esac
;;
no)
- current="$1"
- revision="$2"
- age="$3"
+ current=$1
+ revision=$2
+ age=$3
;;
esac
@@ -7368,8 +8845,8 @@
case $current in
0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
*)
- func_error "CURRENT \`$current' must be a nonnegative integer"
- func_fatal_error "\`$vinfo' is not valid version information"
+ func_error "CURRENT '$current' must be a nonnegative integer"
+ func_fatal_error "'$vinfo' is not valid version information"
;;
esac
@@ -7376,8 +8853,8 @@
case $revision in
0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
*)
- func_error "REVISION \`$revision' must be a nonnegative integer"
- func_fatal_error "\`$vinfo' is not valid version information"
+ func_error "REVISION '$revision' must be a nonnegative integer"
+ func_fatal_error "'$vinfo' is not valid version information"
;;
esac
@@ -7384,14 +8861,14 @@
case $age in
0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
*)
- func_error "AGE \`$age' must be a nonnegative integer"
- func_fatal_error "\`$vinfo' is not valid version information"
+ func_error "AGE '$age' must be a nonnegative integer"
+ func_fatal_error "'$vinfo' is not valid version information"
;;
esac
if test "$age" -gt "$current"; then
- func_error "AGE \`$age' is greater than the current interface number \`$current'"
- func_fatal_error "\`$vinfo' is not valid version information"
+ func_error "AGE '$age' is greater than the current interface number '$current'"
+ func_fatal_error "'$vinfo' is not valid version information"
fi
# Calculate the version variables.
@@ -7406,26 +8883,36 @@
# verstring for coding it into the library header
func_arith $current - $age
major=.$func_arith_result
- versuffix="$major.$age.$revision"
+ versuffix=$major.$age.$revision
# Darwin ld doesn't like 0 for these options...
func_arith $current + 1
minor_current=$func_arith_result
- xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
+ xlcverstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision"
verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
+ # On Darwin other compilers
+ case $CC in
+ nagfor*)
+ verstring="$wl-compatibility_version $wl$minor_current $wl-current_version $wl$minor_current.$revision"
+ ;;
+ *)
+ verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
+ ;;
+ esac
;;
freebsd-aout)
- major=".$current"
- versuffix=".$current.$revision";
+ major=.$current
+ versuffix=.$current.$revision
;;
freebsd-elf)
- major=".$current"
- versuffix=".$current"
+ func_arith $current - $age
+ major=.$func_arith_result
+ versuffix=$major.$age.$revision
;;
irix | nonstopux)
- if test "X$lt_irix_increment" = "Xno"; then
+ if test no = "$lt_irix_increment"; then
func_arith $current - $age
else
func_arith $current - $age + 1
@@ -7436,69 +8923,74 @@
nonstopux) verstring_prefix=nonstopux ;;
*) verstring_prefix=sgi ;;
esac
- verstring="$verstring_prefix$major.$revision"
+ verstring=$verstring_prefix$major.$revision
# Add in all the interfaces that we are compatible with.
loop=$revision
- while test "$loop" -ne 0; do
+ while test 0 -ne "$loop"; do
func_arith $revision - $loop
iface=$func_arith_result
func_arith $loop - 1
loop=$func_arith_result
- verstring="$verstring_prefix$major.$iface:$verstring"
+ verstring=$verstring_prefix$major.$iface:$verstring
done
- # Before this point, $major must not contain `.'.
+ # Before this point, $major must not contain '.'.
major=.$major
- versuffix="$major.$revision"
+ versuffix=$major.$revision
;;
linux) # correct to gnu/linux during the next big refactor
func_arith $current - $age
major=.$func_arith_result
- versuffix="$major.$age.$revision"
+ versuffix=$major.$age.$revision
;;
osf)
func_arith $current - $age
major=.$func_arith_result
- versuffix=".$current.$age.$revision"
- verstring="$current.$age.$revision"
+ versuffix=.$current.$age.$revision
+ verstring=$current.$age.$revision
# Add in all the interfaces that we are compatible with.
loop=$age
- while test "$loop" -ne 0; do
+ while test 0 -ne "$loop"; do
func_arith $current - $loop
iface=$func_arith_result
func_arith $loop - 1
loop=$func_arith_result
- verstring="$verstring:${iface}.0"
+ verstring=$verstring:$iface.0
done
# Make executables depend on our current version.
- func_append verstring ":${current}.0"
+ func_append verstring ":$current.0"
;;
qnx)
- major=".$current"
- versuffix=".$current"
+ major=.$current
+ versuffix=.$current
;;
+ sco)
+ major=.$current
+ versuffix=.$current
+ ;;
+
sunos)
- major=".$current"
- versuffix=".$current.$revision"
+ major=.$current
+ versuffix=.$current.$revision
;;
windows)
# Use '-' rather than '.', since we only want one
- # extension on DOS 8.3 filesystems.
+ # extension on DOS 8.3 file systems.
func_arith $current - $age
major=$func_arith_result
- versuffix="-$major"
+ versuffix=-$major
;;
*)
- func_fatal_configuration "unknown library version type \`$version_type'"
+ func_fatal_configuration "unknown library version type '$version_type'"
;;
esac
@@ -7512,42 +9004,45 @@
verstring=
;;
*)
- verstring="0.0"
+ verstring=0.0
;;
esac
- if test "$need_version" = no; then
+ if test no = "$need_version"; then
versuffix=
else
- versuffix=".0.0"
+ versuffix=.0.0
fi
fi
# Remove version info from name if versioning should be avoided
- if test "$avoid_version" = yes && test "$need_version" = no; then
+ if test yes,no = "$avoid_version,$need_version"; then
major=
versuffix=
- verstring=""
+ verstring=
fi
# Check to see if the archive will have undefined symbols.
- if test "$allow_undefined" = yes; then
- if test "$allow_undefined_flag" = unsupported; then
- func_warning "undefined symbols not allowed in $host shared libraries"
- build_libtool_libs=no
- build_old_libs=yes
+ if test yes = "$allow_undefined"; then
+ if test unsupported = "$allow_undefined_flag"; then
+ if test yes = "$build_old_libs"; then
+ func_warning "undefined symbols not allowed in $host shared libraries; building static only"
+ build_libtool_libs=no
+ else
+ func_fatal_error "can't build $host shared library unless -no-undefined is specified"
+ fi
fi
else
# Don't allow undefined symbols.
- allow_undefined_flag="$no_undefined_flag"
+ allow_undefined_flag=$no_undefined_flag
fi
fi
- func_generate_dlsyms "$libname" "$libname" "yes"
+ func_generate_dlsyms "$libname" "$libname" :
func_append libobjs " $symfileobj"
- test "X$libobjs" = "X " && libobjs=
+ test " " = "$libobjs" && libobjs=
- if test "$opt_mode" != relink; then
+ if test relink != "$opt_mode"; then
# Remove our outputs, but don't remove object files since they
# may have been created when compiling PIC objects.
removelist=
@@ -7556,8 +9051,8 @@
case $p in
*.$objext | *.gcno)
;;
- $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
- if test "X$precious_files_regex" != "X"; then
+ $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/$libname$release.*)
+ if test -n "$precious_files_regex"; then
if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
then
continue
@@ -7573,11 +9068,11 @@
fi
# Now set the variables for building old libraries.
- if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
+ if test yes = "$build_old_libs" && test convenience != "$build_libtool_libs"; then
func_append oldlibs " $output_objdir/$libname.$libext"
# Transform .lo files to .o files.
- oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP`
+ oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; $lo2o" | $NL2SP`
fi
# Eliminate all temporary directories.
@@ -7598,13 +9093,13 @@
*) func_append finalize_rpath " $libdir" ;;
esac
done
- if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
+ if test yes != "$hardcode_into_libs" || test yes = "$build_old_libs"; then
dependency_libs="$temp_xrpath $dependency_libs"
fi
fi
# Make sure dlfiles contains only unique files that won't be dlpreopened
- old_dlfiles="$dlfiles"
+ old_dlfiles=$dlfiles
dlfiles=
for lib in $old_dlfiles; do
case " $dlprefiles $dlfiles " in
@@ -7614,7 +9109,7 @@
done
# Make sure dlprefiles contains only unique files
- old_dlprefiles="$dlprefiles"
+ old_dlprefiles=$dlprefiles
dlprefiles=
for lib in $old_dlprefiles; do
case "$dlprefiles " in
@@ -7623,7 +9118,7 @@
esac
done
- if test "$build_libtool_libs" = yes; then
+ if test yes = "$build_libtool_libs"; then
if test -n "$rpath"; then
case $host in
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*)
@@ -7647,7 +9142,7 @@
;;
*)
# Add libc to deplibs on all other systems if necessary.
- if test "$build_libtool_need_lc" = "yes"; then
+ if test yes = "$build_libtool_need_lc"; then
func_append deplibs " -lc"
fi
;;
@@ -7663,9 +9158,9 @@
# I'm not sure if I'm treating the release correctly. I think
# release should show up in the -l (ie -lgmp5) so we don't want to
# add it in twice. Is that correct?
- release=""
- versuffix=""
- major=""
+ release=
+ versuffix=
+ major=
newdeplibs=
droppeddeps=no
case $deplibs_check_method in
@@ -7694,20 +9189,20 @@
-l*)
func_stripname -l '' "$i"
name=$func_stripname_result
- if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ if test yes = "$allow_libtool_libs_with_static_runtimes"; then
case " $predeps $postdeps " in
*" $i "*)
func_append newdeplibs " $i"
- i=""
+ i=
;;
esac
fi
- if test -n "$i" ; then
+ if test -n "$i"; then
libname=`eval "\\$ECHO \"$libname_spec\""`
deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
set dummy $deplib_matches; shift
deplib_match=$1
- if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
+ if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0; then
func_append newdeplibs " $i"
else
droppeddeps=yes
@@ -7737,20 +9232,20 @@
$opt_dry_run || $RM conftest
if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
ldd_output=`ldd conftest`
- if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ if test yes = "$allow_libtool_libs_with_static_runtimes"; then
case " $predeps $postdeps " in
*" $i "*)
func_append newdeplibs " $i"
- i=""
+ i=
;;
esac
fi
- if test -n "$i" ; then
+ if test -n "$i"; then
libname=`eval "\\$ECHO \"$libname_spec\""`
deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
set dummy $deplib_matches; shift
deplib_match=$1
- if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
+ if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0; then
func_append newdeplibs " $i"
else
droppeddeps=yes
@@ -7787,15 +9282,15 @@
-l*)
func_stripname -l '' "$a_deplib"
name=$func_stripname_result
- if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ if test yes = "$allow_libtool_libs_with_static_runtimes"; then
case " $predeps $postdeps " in
*" $a_deplib "*)
func_append newdeplibs " $a_deplib"
- a_deplib=""
+ a_deplib=
;;
esac
fi
- if test -n "$a_deplib" ; then
+ if test -n "$a_deplib"; then
libname=`eval "\\$ECHO \"$libname_spec\""`
if test -n "$file_magic_glob"; then
libnameglob=`func_echo_all "$libname" | $SED -e $file_magic_glob`
@@ -7802,9 +9297,9 @@
else
libnameglob=$libname
fi
- test "$want_nocaseglob" = yes && nocaseglob=`shopt -p nocaseglob`
+ test yes = "$want_nocaseglob" && nocaseglob=`shopt -p nocaseglob`
for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
- if test "$want_nocaseglob" = yes; then
+ if test yes = "$want_nocaseglob"; then
shopt -s nocaseglob
potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
$nocaseglob
@@ -7822,12 +9317,12 @@
# We might still enter an endless loop, since a link
# loop can be closed while we follow links,
# but so what?
- potlib="$potent_lib"
+ potlib=$potent_lib
while test -h "$potlib" 2>/dev/null; do
- potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
+ potliblink=`ls -ld $potlib | $SED 's/.* -> //'`
case $potliblink in
- [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
- *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";;
+ [\\/]* | [A-Za-z]:[\\/]*) potlib=$potliblink;;
+ *) potlib=`$ECHO "$potlib" | $SED 's|[^/]*$||'`"$potliblink";;
esac
done
if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
@@ -7834,13 +9329,13 @@
$SED -e 10q |
$EGREP "$file_magic_regex" > /dev/null; then
func_append newdeplibs " $a_deplib"
- a_deplib=""
+ a_deplib=
break 2
fi
done
done
fi
- if test -n "$a_deplib" ; then
+ if test -n "$a_deplib"; then
droppeddeps=yes
echo
$ECHO "*** Warning: linker path does not have real file for library $a_deplib."
@@ -7848,7 +9343,7 @@
echo "*** you link to this library. But I can only do this if you have a"
echo "*** shared version of the library, which you do not appear to have"
echo "*** because I did check the linker path looking for a file starting"
- if test -z "$potlib" ; then
+ if test -z "$potlib"; then
$ECHO "*** with $libname but no candidates were found. (...for file magic test)"
else
$ECHO "*** with $libname and none of the candidates passed a file format test"
@@ -7871,30 +9366,30 @@
-l*)
func_stripname -l '' "$a_deplib"
name=$func_stripname_result
- if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+ if test yes = "$allow_libtool_libs_with_static_runtimes"; then
case " $predeps $postdeps " in
*" $a_deplib "*)
func_append newdeplibs " $a_deplib"
- a_deplib=""
+ a_deplib=
;;
esac
fi
- if test -n "$a_deplib" ; then
+ if test -n "$a_deplib"; then
libname=`eval "\\$ECHO \"$libname_spec\""`
for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
for potent_lib in $potential_libs; do
- potlib="$potent_lib" # see symlink-check above in file_magic test
+ potlib=$potent_lib # see symlink-check above in file_magic test
if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \
$EGREP "$match_pattern_regex" > /dev/null; then
func_append newdeplibs " $a_deplib"
- a_deplib=""
+ a_deplib=
break 2
fi
done
done
fi
- if test -n "$a_deplib" ; then
+ if test -n "$a_deplib"; then
droppeddeps=yes
echo
$ECHO "*** Warning: linker path does not have real file for library $a_deplib."
@@ -7902,7 +9397,7 @@
echo "*** you link to this library. But I can only do this if you have a"
echo "*** shared version of the library, which you do not appear to have"
echo "*** because I did check the linker path looking for a file starting"
- if test -z "$potlib" ; then
+ if test -z "$potlib"; then
$ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
else
$ECHO "*** with $libname and none of the candidates passed a file format test"
@@ -7918,18 +9413,18 @@
done # Gone through all deplibs.
;;
none | unknown | *)
- newdeplibs=""
+ newdeplibs=
tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'`
- if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
- for i in $predeps $postdeps ; do
+ if test yes = "$allow_libtool_libs_with_static_runtimes"; then
+ for i in $predeps $postdeps; do
# can't use Xsed below, because $i might contain '/'
- tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"`
+ tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s|$i||"`
done
fi
case $tmp_deplibs in
*[!\ \ ]*)
echo
- if test "X$deplibs_check_method" = "Xnone"; then
+ if test none = "$deplibs_check_method"; then
echo "*** Warning: inter-library dependencies are not supported in this platform."
else
echo "*** Warning: inter-library dependencies are not known to be supported."
@@ -7953,8 +9448,8 @@
;;
esac
- if test "$droppeddeps" = yes; then
- if test "$module" = yes; then
+ if test yes = "$droppeddeps"; then
+ if test yes = "$module"; then
echo
echo "*** Warning: libtool could not satisfy all declared inter-library"
$ECHO "*** dependencies of module $libname. Therefore, libtool will create"
@@ -7963,12 +9458,12 @@
if test -z "$global_symbol_pipe"; then
echo
echo "*** However, this would only work if libtool was able to extract symbol"
- echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
+ echo "*** lists from a program, using 'nm' or equivalent, but libtool could"
echo "*** not find such a program. So, this module is probably useless."
- echo "*** \`nm' from GNU binutils and a full rebuild may help."
+ echo "*** 'nm' from GNU binutils and a full rebuild may help."
fi
- if test "$build_old_libs" = no; then
- oldlibs="$output_objdir/$libname.$libext"
+ if test no = "$build_old_libs"; then
+ oldlibs=$output_objdir/$libname.$libext
build_libtool_libs=module
build_old_libs=yes
else
@@ -7979,14 +9474,14 @@
echo "*** automatically added whenever a program is linked with this library"
echo "*** or is declared to -dlopen it."
- if test "$allow_undefined" = no; then
+ if test no = "$allow_undefined"; then
echo
echo "*** Since this library must not contain undefined symbols,"
echo "*** because either the platform does not support them or"
echo "*** it was explicitly requested with -no-undefined,"
echo "*** libtool will only create a static version of it."
- if test "$build_old_libs" = no; then
- oldlibs="$output_objdir/$libname.$libext"
+ if test no = "$build_old_libs"; then
+ oldlibs=$output_objdir/$libname.$libext
build_libtool_libs=module
build_old_libs=yes
else
@@ -8032,7 +9527,7 @@
*) func_append new_libs " $deplib" ;;
esac
done
- deplibs="$new_libs"
+ deplibs=$new_libs
# All the library-specific variables (install_libdir is set above).
library_names=
@@ -8040,18 +9535,18 @@
dlname=
# Test again, we may have decided not to build it any more
- if test "$build_libtool_libs" = yes; then
- # Remove ${wl} instances when linking with ld.
+ if test yes = "$build_libtool_libs"; then
+ # Remove $wl instances when linking with ld.
# FIXME: should test the right _cmds variable.
case $archive_cmds in
*\$LD\ *) wl= ;;
esac
- if test "$hardcode_into_libs" = yes; then
+ if test yes = "$hardcode_into_libs"; then
# Hardcode the library paths
hardcode_libdirs=
dep_rpath=
- rpath="$finalize_rpath"
- test "$opt_mode" != relink && rpath="$compile_rpath$rpath"
+ rpath=$finalize_rpath
+ test relink = "$opt_mode" || rpath=$compile_rpath$rpath
for libdir in $rpath; do
if test -n "$hardcode_libdir_flag_spec"; then
if test -n "$hardcode_libdir_separator"; then
@@ -8058,7 +9553,7 @@
func_replace_sysroot "$libdir"
libdir=$func_replace_sysroot_result
if test -z "$hardcode_libdirs"; then
- hardcode_libdirs="$libdir"
+ hardcode_libdirs=$libdir
else
# Just accumulate the unique libdirs.
case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
@@ -8083,7 +9578,7 @@
# Substitute the hardcoded libdirs into the rpath.
if test -n "$hardcode_libdir_separator" &&
test -n "$hardcode_libdirs"; then
- libdir="$hardcode_libdirs"
+ libdir=$hardcode_libdirs
eval "dep_rpath=\"$hardcode_libdir_flag_spec\""
fi
if test -n "$runpath_var" && test -n "$perm_rpath"; then
@@ -8097,8 +9592,8 @@
test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
fi
- shlibpath="$finalize_shlibpath"
- test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
+ shlibpath=$finalize_shlibpath
+ test relink = "$opt_mode" || shlibpath=$compile_shlibpath$shlibpath
if test -n "$shlibpath"; then
eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
fi
@@ -8108,19 +9603,19 @@
eval library_names=\"$library_names_spec\"
set dummy $library_names
shift
- realname="$1"
+ realname=$1
shift
if test -n "$soname_spec"; then
eval soname=\"$soname_spec\"
else
- soname="$realname"
+ soname=$realname
fi
if test -z "$dlname"; then
dlname=$soname
fi
- lib="$output_objdir/$realname"
+ lib=$output_objdir/$realname
linknames=
for link
do
@@ -8134,7 +9629,7 @@
delfiles=
if test -n "$export_symbols" && test -n "$include_expsyms"; then
$opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
- export_symbols="$output_objdir/$libname.uexp"
+ export_symbols=$output_objdir/$libname.uexp
func_append delfiles " $export_symbols"
fi
@@ -8143,7 +9638,7 @@
cygwin* | mingw* | cegcc*)
if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
# exporting using user supplied symfile
- if test "x`$SED 1q $export_symbols`" != xEXPORTS; then
+ func_dll_def_p "$export_symbols" || {
# and it's NOT already a .def file. Must figure out
# which of the given symbols are data symbols and tag
# them as such. So, trigger use of export_symbols_cmds.
@@ -8150,10 +9645,10 @@
# export_symbols gets reassigned inside the "prepare
# the list of exported symbols" if statement, so the
# include_expsyms logic still works.
- orig_export_symbols="$export_symbols"
+ orig_export_symbols=$export_symbols
export_symbols=
always_export_symbols=yes
- fi
+ }
fi
;;
esac
@@ -8160,14 +9655,14 @@
# Prepare the list of exported symbols
if test -z "$export_symbols"; then
- if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
- func_verbose "generating symbol list for \`$libname.la'"
- export_symbols="$output_objdir/$libname.exp"
+ if test yes = "$always_export_symbols" || test -n "$export_symbols_regex"; then
+ func_verbose "generating symbol list for '$libname.la'"
+ export_symbols=$output_objdir/$libname.exp
$opt_dry_run || $RM $export_symbols
cmds=$export_symbols_cmds
- save_ifs="$IFS"; IFS='~'
+ save_ifs=$IFS; IFS='~'
for cmd1 in $cmds; do
- IFS="$save_ifs"
+ IFS=$save_ifs
# Take the normal branch if the nm_file_list_spec branch
# doesn't work or if tool conversion is not needed.
case $nm_file_list_spec~$to_tool_file_cmd in
@@ -8181,7 +9676,7 @@
try_normal_branch=no
;;
esac
- if test "$try_normal_branch" = yes \
+ if test yes = "$try_normal_branch" \
&& { test "$len" -lt "$max_cmd_len" \
|| test "$max_cmd_len" -le -1; }
then
@@ -8192,7 +9687,7 @@
output_la=$func_basename_result
save_libobjs=$libobjs
save_output=$output
- output=${output_objdir}/${output_la}.nm
+ output=$output_objdir/$output_la.nm
func_to_tool_file "$output"
libobjs=$nm_file_list_spec$func_to_tool_file_result
func_append delfiles " $output"
@@ -8215,8 +9710,8 @@
break
fi
done
- IFS="$save_ifs"
- if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then
+ IFS=$save_ifs
+ if test -n "$export_symbols_regex" && test : != "$skipped_export"; then
func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
fi
@@ -8224,16 +9719,16 @@
fi
if test -n "$export_symbols" && test -n "$include_expsyms"; then
- tmp_export_symbols="$export_symbols"
- test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
+ tmp_export_symbols=$export_symbols
+ test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols
$opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
fi
- if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then
+ if test : != "$skipped_export" && test -n "$orig_export_symbols"; then
# The given exports_symbols file has to be filtered, so filter it.
- func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
+ func_verbose "filter symbol list for '$libname.la' to tag DATA exports"
# FIXME: $output_objdir/$libname.filter potentially contains lots of
- # 's' commands which not all seds can handle. GNU sed should be fine
+ # 's' commands, which not all seds can handle. GNU sed should be fine
# though. Also, the filter scales superlinearly with the number of
# global variables. join(1) would be nice here, but unfortunately
# isn't a blessed tool.
@@ -8252,11 +9747,11 @@
;;
esac
done
- deplibs="$tmp_deplibs"
+ deplibs=$tmp_deplibs
if test -n "$convenience"; then
if test -n "$whole_archive_flag_spec" &&
- test "$compiler_needs_object" = yes &&
+ test yes = "$compiler_needs_object" &&
test -z "$libobjs"; then
# extract the archives, so we have objects to list.
# TODO: could optimize this to just extract one archive.
@@ -8267,7 +9762,7 @@
eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
test "X$libobjs" = "X " && libobjs=
else
- gentop="$output_objdir/${outputname}x"
+ gentop=$output_objdir/${outputname}x
func_append generated " $gentop"
func_extract_archives $gentop $convenience
@@ -8276,18 +9771,18 @@
fi
fi
- if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
+ if test yes = "$thread_safe" && test -n "$thread_safe_flag_spec"; then
eval flag=\"$thread_safe_flag_spec\"
func_append linker_flags " $flag"
fi
# Make a backup of the uninstalled library when relinking
- if test "$opt_mode" = relink; then
+ if test relink = "$opt_mode"; then
$opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
fi
# Do each of the archive commands.
- if test "$module" = yes && test -n "$module_cmds" ; then
+ if test yes = "$module" && test -n "$module_cmds"; then
if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
eval test_cmds=\"$module_expsym_cmds\"
cmds=$module_expsym_cmds
@@ -8305,7 +9800,7 @@
fi
fi
- if test "X$skipped_export" != "X:" &&
+ if test : != "$skipped_export" &&
func_len " $test_cmds" &&
len=$func_len_result &&
test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
@@ -8338,8 +9833,8 @@
last_robj=
k=1
- if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then
- output=${output_objdir}/${output_la}.lnkscript
+ if test -n "$save_libobjs" && test : != "$skipped_export" && test yes = "$with_gnu_ld"; then
+ output=$output_objdir/$output_la.lnkscript
func_verbose "creating GNU ld script: $output"
echo 'INPUT (' > $output
for obj in $save_libobjs
@@ -8351,14 +9846,14 @@
func_append delfiles " $output"
func_to_tool_file "$output"
output=$func_to_tool_file_result
- elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then
- output=${output_objdir}/${output_la}.lnk
+ elif test -n "$save_libobjs" && test : != "$skipped_export" && test -n "$file_list_spec"; then
+ output=$output_objdir/$output_la.lnk
func_verbose "creating linker input file list: $output"
: > $output
set x $save_libobjs
shift
firstobj=
- if test "$compiler_needs_object" = yes; then
+ if test yes = "$compiler_needs_object"; then
firstobj="$1 "
shift
fi
@@ -8373,7 +9868,7 @@
else
if test -n "$save_libobjs"; then
func_verbose "creating reloadable object files..."
- output=$output_objdir/$output_la-${k}.$objext
+ output=$output_objdir/$output_la-$k.$objext
eval test_cmds=\"$reload_cmds\"
func_len " $test_cmds"
len0=$func_len_result
@@ -8385,13 +9880,13 @@
func_len " $obj"
func_arith $len + $func_len_result
len=$func_arith_result
- if test "X$objlist" = X ||
+ if test -z "$objlist" ||
test "$len" -lt "$max_cmd_len"; then
func_append objlist " $obj"
else
# The command $test_cmds is almost too long, add a
# command to the queue.
- if test "$k" -eq 1 ; then
+ if test 1 -eq "$k"; then
# The first file doesn't have a previous command to add.
reload_objs=$objlist
eval concat_cmds=\"$reload_cmds\"
@@ -8401,10 +9896,10 @@
reload_objs="$objlist $last_robj"
eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\"
fi
- last_robj=$output_objdir/$output_la-${k}.$objext
+ last_robj=$output_objdir/$output_la-$k.$objext
func_arith $k + 1
k=$func_arith_result
- output=$output_objdir/$output_la-${k}.$objext
+ output=$output_objdir/$output_la-$k.$objext
objlist=" $obj"
func_len " $last_robj"
func_arith $len0 + $func_len_result
@@ -8416,9 +9911,9 @@
# files will link in the last one created.
test -z "$concat_cmds" || concat_cmds=$concat_cmds~
reload_objs="$objlist $last_robj"
- eval concat_cmds=\"\${concat_cmds}$reload_cmds\"
+ eval concat_cmds=\"\$concat_cmds$reload_cmds\"
if test -n "$last_robj"; then
- eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\"
+ eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
fi
func_append delfiles " $output"
@@ -8426,9 +9921,9 @@
output=
fi
- if ${skipped_export-false}; then
- func_verbose "generating symbol list for \`$libname.la'"
- export_symbols="$output_objdir/$libname.exp"
+ ${skipped_export-false} && {
+ func_verbose "generating symbol list for '$libname.la'"
+ export_symbols=$output_objdir/$libname.exp
$opt_dry_run || $RM $export_symbols
libobjs=$output
# Append the command to create the export file.
@@ -8437,16 +9932,16 @@
if test -n "$last_robj"; then
eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
fi
- fi
+ }
test -n "$save_libobjs" &&
func_verbose "creating a temporary reloadable object file: $output"
# Loop through the commands generated above and execute them.
- save_ifs="$IFS"; IFS='~'
+ save_ifs=$IFS; IFS='~'
for cmd in $concat_cmds; do
- IFS="$save_ifs"
- $opt_silent || {
+ IFS=$save_ifs
+ $opt_quiet || {
func_quote_for_expand "$cmd"
eval "func_echo $func_quote_for_expand_result"
}
@@ -8454,7 +9949,7 @@
lt_exit=$?
# Restore the uninstalled library and exit
- if test "$opt_mode" = relink; then
+ if test relink = "$opt_mode"; then
( cd "$output_objdir" && \
$RM "${realname}T" && \
$MV "${realname}U" "$realname" )
@@ -8463,7 +9958,7 @@
exit $lt_exit
}
done
- IFS="$save_ifs"
+ IFS=$save_ifs
if test -n "$export_symbols_regex" && ${skipped_export-false}; then
func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
@@ -8471,18 +9966,18 @@
fi
fi
- if ${skipped_export-false}; then
+ ${skipped_export-false} && {
if test -n "$export_symbols" && test -n "$include_expsyms"; then
- tmp_export_symbols="$export_symbols"
- test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
+ tmp_export_symbols=$export_symbols
+ test -n "$orig_export_symbols" && tmp_export_symbols=$orig_export_symbols
$opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
fi
if test -n "$orig_export_symbols"; then
# The given exports_symbols file has to be filtered, so filter it.
- func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
+ func_verbose "filter symbol list for '$libname.la' to tag DATA exports"
# FIXME: $output_objdir/$libname.filter potentially contains lots of
- # 's' commands which not all seds can handle. GNU sed should be fine
+ # 's' commands, which not all seds can handle. GNU sed should be fine
# though. Also, the filter scales superlinearly with the number of
# global variables. join(1) would be nice here, but unfortunately
# isn't a blessed tool.
@@ -8491,7 +9986,7 @@
export_symbols=$output_objdir/$libname.def
$opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
fi
- fi
+ }
libobjs=$output
# Restore the value of output.
@@ -8505,7 +10000,7 @@
# value of $libobjs for piecewise linking.
# Do each of the archive commands.
- if test "$module" = yes && test -n "$module_cmds" ; then
+ if test yes = "$module" && test -n "$module_cmds"; then
if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
cmds=$module_expsym_cmds
else
@@ -8527,7 +10022,7 @@
# Add any objects from preloaded convenience libraries
if test -n "$dlprefiles"; then
- gentop="$output_objdir/${outputname}x"
+ gentop=$output_objdir/${outputname}x
func_append generated " $gentop"
func_extract_archives $gentop $dlprefiles
@@ -8535,11 +10030,12 @@
test "X$libobjs" = "X " && libobjs=
fi
- save_ifs="$IFS"; IFS='~'
+ save_ifs=$IFS; IFS='~'
for cmd in $cmds; do
- IFS="$save_ifs"
+ IFS=$sp$nl
eval cmd=\"$cmd\"
- $opt_silent || {
+ IFS=$save_ifs
+ $opt_quiet || {
func_quote_for_expand "$cmd"
eval "func_echo $func_quote_for_expand_result"
}
@@ -8547,7 +10043,7 @@
lt_exit=$?
# Restore the uninstalled library and exit
- if test "$opt_mode" = relink; then
+ if test relink = "$opt_mode"; then
( cd "$output_objdir" && \
$RM "${realname}T" && \
$MV "${realname}U" "$realname" )
@@ -8556,10 +10052,10 @@
exit $lt_exit
}
done
- IFS="$save_ifs"
+ IFS=$save_ifs
# Restore the uninstalled library and exit
- if test "$opt_mode" = relink; then
+ if test relink = "$opt_mode"; then
$opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
if test -n "$convenience"; then
@@ -8579,39 +10075,39 @@
done
# If -module or -export-dynamic was specified, set the dlname.
- if test "$module" = yes || test "$export_dynamic" = yes; then
+ if test yes = "$module" || test yes = "$export_dynamic"; then
# On all known operating systems, these are identical.
- dlname="$soname"
+ dlname=$soname
fi
fi
;;
obj)
- if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
- func_warning "\`-dlopen' is ignored for objects"
+ if test -n "$dlfiles$dlprefiles" || test no != "$dlself"; then
+ func_warning "'-dlopen' is ignored for objects"
fi
case " $deplibs" in
*\ -l* | *\ -L*)
- func_warning "\`-l' and \`-L' are ignored for objects" ;;
+ func_warning "'-l' and '-L' are ignored for objects" ;;
esac
test -n "$rpath" && \
- func_warning "\`-rpath' is ignored for objects"
+ func_warning "'-rpath' is ignored for objects"
test -n "$xrpath" && \
- func_warning "\`-R' is ignored for objects"
+ func_warning "'-R' is ignored for objects"
test -n "$vinfo" && \
- func_warning "\`-version-info' is ignored for objects"
+ func_warning "'-version-info' is ignored for objects"
test -n "$release" && \
- func_warning "\`-release' is ignored for objects"
+ func_warning "'-release' is ignored for objects"
case $output in
*.lo)
test -n "$objs$old_deplibs" && \
- func_fatal_error "cannot build library object \`$output' from non-libtool objects"
+ func_fatal_error "cannot build library object '$output' from non-libtool objects"
libobj=$output
func_lo2o "$libobj"
@@ -8619,7 +10115,7 @@
;;
*)
libobj=
- obj="$output"
+ obj=$output
;;
esac
@@ -8632,17 +10128,19 @@
# the extraction.
reload_conv_objs=
gentop=
- # reload_cmds runs $LD directly, so let us get rid of
- # -Wl from whole_archive_flag_spec and hope we can get by with
- # turning comma into space..
- wl=
-
+ # if reload_cmds runs $LD directly, get rid of -Wl from
+ # whole_archive_flag_spec and hope we can get by with turning comma
+ # into space.
+ case $reload_cmds in
+ *\$LD[\ \$]*) wl= ;;
+ esac
if test -n "$convenience"; then
if test -n "$whole_archive_flag_spec"; then
eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
- reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'`
+ test -n "$wl" || tmp_whole_archive_flags=`$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'`
+ reload_conv_objs=$reload_objs\ $tmp_whole_archive_flags
else
- gentop="$output_objdir/${obj}x"
+ gentop=$output_objdir/${obj}x
func_append generated " $gentop"
func_extract_archives $gentop $convenience
@@ -8651,12 +10149,12 @@
fi
# If we're not building shared, we need to use non_pic_objs
- test "$build_libtool_libs" != yes && libobjs="$non_pic_objects"
+ test yes = "$build_libtool_libs" || libobjs=$non_pic_objects
# Create the old-style object.
- reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
+ reload_objs=$objs$old_deplibs' '`$ECHO "$libobjs" | $SP2NL | $SED "/\.$libext$/d; /\.lib$/d; $lo2o" | $NL2SP`' '$reload_conv_objs
- output="$obj"
+ output=$obj
func_execute_cmds "$reload_cmds" 'exit $?'
# Exit if we aren't doing a library object file.
@@ -8668,7 +10166,7 @@
exit $EXIT_SUCCESS
fi
- if test "$build_libtool_libs" != yes; then
+ test yes = "$build_libtool_libs" || {
if test -n "$gentop"; then
func_show_eval '${RM}r "$gentop"'
fi
@@ -8678,12 +10176,12 @@
# $show "echo timestamp > $libobj"
# $opt_dry_run || eval "echo timestamp > $libobj" || exit $?
exit $EXIT_SUCCESS
- fi
+ }
- if test -n "$pic_flag" || test "$pic_mode" != default; then
+ if test -n "$pic_flag" || test default != "$pic_mode"; then
# Only do commands if we really have different PIC objects.
reload_objs="$libobjs $reload_conv_objs"
- output="$libobj"
+ output=$libobj
func_execute_cmds "$reload_cmds" 'exit $?'
fi
@@ -8700,16 +10198,14 @@
output=$func_stripname_result.exe;;
esac
test -n "$vinfo" && \
- func_warning "\`-version-info' is ignored for programs"
+ func_warning "'-version-info' is ignored for programs"
test -n "$release" && \
- func_warning "\`-release' is ignored for programs"
+ func_warning "'-release' is ignored for programs"
- test "$preload" = yes \
- && test "$dlopen_support" = unknown \
- && test "$dlopen_self" = unknown \
- && test "$dlopen_self_static" = unknown && \
- func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support."
+ $preload \
+ && test unknown,unknown,unknown = "$dlopen_support,$dlopen_self,$dlopen_self_static" \
+ && func_warning "'LT_INIT([dlopen])' not used. Assuming no dlopen support."
case $host in
*-*-rhapsody* | *-*-darwin1.[012])
@@ -8723,11 +10219,11 @@
*-*-darwin*)
# Don't allow lazy linking, it breaks C++ global constructors
# But is supposedly fixed on 10.4 or later (yay!).
- if test "$tagname" = CXX ; then
+ if test CXX = "$tagname"; then
case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
10.[0123])
- func_append compile_command " ${wl}-bind_at_load"
- func_append finalize_command " ${wl}-bind_at_load"
+ func_append compile_command " $wl-bind_at_load"
+ func_append finalize_command " $wl-bind_at_load"
;;
esac
fi
@@ -8763,7 +10259,7 @@
*) func_append new_libs " $deplib" ;;
esac
done
- compile_deplibs="$new_libs"
+ compile_deplibs=$new_libs
func_append compile_command " $compile_deplibs"
@@ -8787,7 +10283,7 @@
if test -n "$hardcode_libdir_flag_spec"; then
if test -n "$hardcode_libdir_separator"; then
if test -z "$hardcode_libdirs"; then
- hardcode_libdirs="$libdir"
+ hardcode_libdirs=$libdir
else
# Just accumulate the unique libdirs.
case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
@@ -8810,7 +10306,7 @@
fi
case $host in
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
- testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'`
+ testbindir=`$ECHO "$libdir" | $SED -e 's*/lib$*/bin*'`
case :$dllsearchpath: in
*":$libdir:"*) ;;
::) dllsearchpath=$libdir;;
@@ -8827,10 +10323,10 @@
# Substitute the hardcoded libdirs into the rpath.
if test -n "$hardcode_libdir_separator" &&
test -n "$hardcode_libdirs"; then
- libdir="$hardcode_libdirs"
+ libdir=$hardcode_libdirs
eval rpath=\" $hardcode_libdir_flag_spec\"
fi
- compile_rpath="$rpath"
+ compile_rpath=$rpath
rpath=
hardcode_libdirs=
@@ -8838,7 +10334,7 @@
if test -n "$hardcode_libdir_flag_spec"; then
if test -n "$hardcode_libdir_separator"; then
if test -z "$hardcode_libdirs"; then
- hardcode_libdirs="$libdir"
+ hardcode_libdirs=$libdir
else
# Just accumulate the unique libdirs.
case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
@@ -8863,18 +10359,18 @@
# Substitute the hardcoded libdirs into the rpath.
if test -n "$hardcode_libdir_separator" &&
test -n "$hardcode_libdirs"; then
- libdir="$hardcode_libdirs"
+ libdir=$hardcode_libdirs
eval rpath=\" $hardcode_libdir_flag_spec\"
fi
- finalize_rpath="$rpath"
+ finalize_rpath=$rpath
- if test -n "$libobjs" && test "$build_old_libs" = yes; then
+ if test -n "$libobjs" && test yes = "$build_old_libs"; then
# Transform all the library objects into standard objects.
compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
fi
- func_generate_dlsyms "$outputname" "@PROGRAM@" "no"
+ func_generate_dlsyms "$outputname" "@PROGRAM@" false
# template prelinking step
if test -n "$prelink_cmds"; then
@@ -8881,27 +10377,25 @@
func_execute_cmds "$prelink_cmds" 'exit $?'
fi
- wrappers_required=yes
+ wrappers_required=:
case $host in
*cegcc* | *mingw32ce*)
# Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway.
- wrappers_required=no
+ wrappers_required=false
;;
*cygwin* | *mingw* )
- if test "$build_libtool_libs" != yes; then
- wrappers_required=no
- fi
+ test yes = "$build_libtool_libs" || wrappers_required=false
;;
*)
- if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
- wrappers_required=no
+ if test no = "$need_relink" || test yes != "$build_libtool_libs"; then
+ wrappers_required=false
fi
;;
esac
- if test "$wrappers_required" = no; then
+ $wrappers_required || {
# Replace the output file specification.
compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
- link_command="$compile_command$compile_rpath"
+ link_command=$compile_command$compile_rpath
# We have no uninstalled library dependencies, so finalize right now.
exit_status=0
@@ -8914,12 +10408,12 @@
fi
# Delete the generated files.
- if test -f "$output_objdir/${outputname}S.${objext}"; then
- func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"'
+ if test -f "$output_objdir/${outputname}S.$objext"; then
+ func_show_eval '$RM "$output_objdir/${outputname}S.$objext"'
fi
exit $exit_status
- fi
+ }
if test -n "$compile_shlibpath$finalize_shlibpath"; then
compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
@@ -8949,9 +10443,9 @@
fi
fi
- if test "$no_install" = yes; then
+ if test yes = "$no_install"; then
# We don't need to create a wrapper script.
- link_command="$compile_var$compile_command$compile_rpath"
+ link_command=$compile_var$compile_command$compile_rpath
# Replace the output file specification.
link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
# Delete the old output file.
@@ -8968,27 +10462,28 @@
exit $EXIT_SUCCESS
fi
- if test "$hardcode_action" = relink; then
- # Fast installation is not supported
- link_command="$compile_var$compile_command$compile_rpath"
- relink_command="$finalize_var$finalize_command$finalize_rpath"
+ case $hardcode_action,$fast_install in
+ relink,*)
+ # Fast installation is not supported
+ link_command=$compile_var$compile_command$compile_rpath
+ relink_command=$finalize_var$finalize_command$finalize_rpath
- func_warning "this platform does not like uninstalled shared libraries"
- func_warning "\`$output' will be relinked during installation"
- else
- if test "$fast_install" != no; then
- link_command="$finalize_var$compile_command$finalize_rpath"
- if test "$fast_install" = yes; then
- relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'`
- else
- # fast_install is set to needless
- relink_command=
- fi
- else
- link_command="$compile_var$compile_command$compile_rpath"
- relink_command="$finalize_var$finalize_command$finalize_rpath"
- fi
- fi
+ func_warning "this platform does not like uninstalled shared libraries"
+ func_warning "'$output' will be relinked during installation"
+ ;;
+ *,yes)
+ link_command=$finalize_var$compile_command$finalize_rpath
+ relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'`
+ ;;
+ *,no)
+ link_command=$compile_var$compile_command$compile_rpath
+ relink_command=$finalize_var$finalize_command$finalize_rpath
+ ;;
+ *,needless)
+ link_command=$finalize_var$compile_command$finalize_rpath
+ relink_command=
+ ;;
+ esac
# Replace the output file specification.
link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
@@ -9045,8 +10540,8 @@
func_dirname_and_basename "$output" "" "."
output_name=$func_basename_result
output_path=$func_dirname_result
- cwrappersource="$output_path/$objdir/lt-$output_name.c"
- cwrapper="$output_path/$output_name.exe"
+ cwrappersource=$output_path/$objdir/lt-$output_name.c
+ cwrapper=$output_path/$output_name.exe
$RM $cwrappersource $cwrapper
trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
@@ -9067,7 +10562,7 @@
trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15
$opt_dry_run || {
# note: this script will not be executed, so do not chmod.
- if test "x$build" = "x$host" ; then
+ if test "x$build" = "x$host"; then
$cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result
else
func_emit_wrapper no > $func_ltwrapper_scriptname_result
@@ -9090,25 +10585,27 @@
# See if we need to build an old-fashioned archive.
for oldlib in $oldlibs; do
- if test "$build_libtool_libs" = convenience; then
- oldobjs="$libobjs_save $symfileobj"
- addlibs="$convenience"
- build_libtool_libs=no
- else
- if test "$build_libtool_libs" = module; then
- oldobjs="$libobjs_save"
+ case $build_libtool_libs in
+ convenience)
+ oldobjs="$libobjs_save $symfileobj"
+ addlibs=$convenience
build_libtool_libs=no
- else
+ ;;
+ module)
+ oldobjs=$libobjs_save
+ addlibs=$old_convenience
+ build_libtool_libs=no
+ ;;
+ *)
oldobjs="$old_deplibs $non_pic_objects"
- if test "$preload" = yes && test -f "$symfileobj"; then
- func_append oldobjs " $symfileobj"
- fi
- fi
- addlibs="$old_convenience"
- fi
+ $preload && test -f "$symfileobj" \
+ && func_append oldobjs " $symfileobj"
+ addlibs=$old_convenience
+ ;;
+ esac
if test -n "$addlibs"; then
- gentop="$output_objdir/${outputname}x"
+ gentop=$output_objdir/${outputname}x
func_append generated " $gentop"
func_extract_archives $gentop $addlibs
@@ -9116,13 +10613,13 @@
fi
# Do each command in the archive commands.
- if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
+ if test -n "$old_archive_from_new_cmds" && test yes = "$build_libtool_libs"; then
cmds=$old_archive_from_new_cmds
else
# Add any objects from preloaded convenience libraries
if test -n "$dlprefiles"; then
- gentop="$output_objdir/${outputname}x"
+ gentop=$output_objdir/${outputname}x
func_append generated " $gentop"
func_extract_archives $gentop $dlprefiles
@@ -9143,7 +10640,7 @@
:
else
echo "copying selected object files to avoid basename conflicts..."
- gentop="$output_objdir/${outputname}x"
+ gentop=$output_objdir/${outputname}x
func_append generated " $gentop"
func_mkdir_p "$gentop"
save_oldobjs=$oldobjs
@@ -9152,7 +10649,7 @@
for obj in $save_oldobjs
do
func_basename "$obj"
- objbase="$func_basename_result"
+ objbase=$func_basename_result
case " $oldobjs " in
" ") oldobjs=$obj ;;
*[\ /]"$objbase "*)
@@ -9221,11 +10718,11 @@
else
# the above command should be used before it gets too long
oldobjs=$objlist
- if test "$obj" = "$last_oldobj" ; then
+ if test "$obj" = "$last_oldobj"; then
RANLIB=$save_RANLIB
fi
test -z "$concat_cmds" || concat_cmds=$concat_cmds~
- eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
+ eval concat_cmds=\"\$concat_cmds$old_archive_cmds\"
objlist=
len=$len0
fi
@@ -9232,7 +10729,7 @@
done
RANLIB=$save_RANLIB
oldobjs=$objlist
- if test "X$oldobjs" = "X" ; then
+ if test -z "$oldobjs"; then
eval cmds=\"\$concat_cmds\"
else
eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
@@ -9249,7 +10746,7 @@
case $output in
*.la)
old_library=
- test "$build_old_libs" = yes && old_library="$libname.$libext"
+ test yes = "$build_old_libs" && old_library=$libname.$libext
func_verbose "creating $output"
# Preserve any variables that may affect compiler behavior
@@ -9264,9 +10761,9 @@
fi
done
# Quote the link command for shipping.
- relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
+ relink_command="(cd `pwd`; $SHELL \"$progpath\" $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
- if test "$hardcode_automatic" = yes ; then
+ if test yes = "$hardcode_automatic"; then
relink_command=
fi
@@ -9273,11 +10770,11 @@
# Only create the output if not a dry run.
$opt_dry_run || {
for installed in no yes; do
- if test "$installed" = yes; then
+ if test yes = "$installed"; then
if test -z "$install_libdir"; then
break
fi
- output="$output_objdir/$outputname"i
+ output=$output_objdir/${outputname}i
# Replace all uninstalled libtool libraries with the installed ones
newdependency_libs=
for deplib in $dependency_libs; do
@@ -9284,11 +10781,11 @@
case $deplib in
*.la)
func_basename "$deplib"
- name="$func_basename_result"
+ name=$func_basename_result
func_resolve_sysroot "$deplib"
- eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result`
+ eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result`
test -z "$libdir" && \
- func_fatal_error "\`$deplib' is not a valid libtool archive"
+ func_fatal_error "'$deplib' is not a valid libtool archive"
func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name"
;;
-L*)
@@ -9304,7 +10801,7 @@
*) func_append newdependency_libs " $deplib" ;;
esac
done
- dependency_libs="$newdependency_libs"
+ dependency_libs=$newdependency_libs
newdlfiles=
for lib in $dlfiles; do
@@ -9311,16 +10808,16 @@
case $lib in
*.la)
func_basename "$lib"
- name="$func_basename_result"
- eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+ name=$func_basename_result
+ eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
test -z "$libdir" && \
- func_fatal_error "\`$lib' is not a valid libtool archive"
+ func_fatal_error "'$lib' is not a valid libtool archive"
func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name"
;;
*) func_append newdlfiles " $lib" ;;
esac
done
- dlfiles="$newdlfiles"
+ dlfiles=$newdlfiles
newdlprefiles=
for lib in $dlprefiles; do
case $lib in
@@ -9330,34 +10827,34 @@
# didn't already link the preopened objects directly into
# the library:
func_basename "$lib"
- name="$func_basename_result"
- eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+ name=$func_basename_result
+ eval libdir=`$SED -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
test -z "$libdir" && \
- func_fatal_error "\`$lib' is not a valid libtool archive"
+ func_fatal_error "'$lib' is not a valid libtool archive"
func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name"
;;
esac
done
- dlprefiles="$newdlprefiles"
+ dlprefiles=$newdlprefiles
else
newdlfiles=
for lib in $dlfiles; do
case $lib in
- [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
+ [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;;
*) abs=`pwd`"/$lib" ;;
esac
func_append newdlfiles " $abs"
done
- dlfiles="$newdlfiles"
+ dlfiles=$newdlfiles
newdlprefiles=
for lib in $dlprefiles; do
case $lib in
- [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
+ [\\/]* | [A-Za-z]:[\\/]*) abs=$lib ;;
*) abs=`pwd`"/$lib" ;;
esac
func_append newdlprefiles " $abs"
done
- dlprefiles="$newdlprefiles"
+ dlprefiles=$newdlprefiles
fi
$RM $output
# place dlname in correct position for cygwin
@@ -9373,10 +10870,9 @@
case $host,$output,$installed,$module,$dlname in
*cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll)
# If a -bindir argument was supplied, place the dll there.
- if test "x$bindir" != x ;
- then
+ if test -n "$bindir"; then
func_relative_path "$install_libdir" "$bindir"
- tdlname=$func_relative_path_result$dlname
+ tdlname=$func_relative_path_result/$dlname
else
# Otherwise fall back on heuristic.
tdlname=../bin/$dlname
@@ -9385,7 +10881,7 @@
esac
$ECHO > $output "\
# $outputname - a libtool library file
-# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+# Generated by $PROGRAM (GNU $PACKAGE) $VERSION
#
# Please DO NOT delete this file!
# It is necessary for linking the library.
@@ -9399,7 +10895,7 @@
# The name of the static archive.
old_library='$old_library'
-# Linker flags that can not go in dependency_libs.
+# Linker flags that cannot go in dependency_libs.
inherited_linker_flags='$new_inherited_linker_flags'
# Libraries that this one depends upon.
@@ -9425,7 +10921,7 @@
# Directory that this library needs to be installed in:
libdir='$install_libdir'"
- if test "$installed" = no && test "$need_relink" = yes; then
+ if test no,yes = "$installed,$need_relink"; then
$ECHO >> $output "\
relink_command=\"$relink_command\""
fi
@@ -9440,27 +10936,29 @@
exit $EXIT_SUCCESS
}
-{ test "$opt_mode" = link || test "$opt_mode" = relink; } &&
- func_mode_link ${1+"$@"}
+if test link = "$opt_mode" || test relink = "$opt_mode"; then
+ func_mode_link ${1+"$@"}
+fi
# func_mode_uninstall arg...
func_mode_uninstall ()
{
- $opt_debug
- RM="$nonopt"
+ $debug_cmd
+
+ RM=$nonopt
files=
- rmforce=
+ rmforce=false
exit_status=0
# This variable tells wrapper scripts just to set variables rather
# than running their programs.
- libtool_install_magic="$magic"
+ libtool_install_magic=$magic
for arg
do
case $arg in
- -f) func_append RM " $arg"; rmforce=yes ;;
+ -f) func_append RM " $arg"; rmforce=: ;;
-*) func_append RM " $arg" ;;
*) func_append files " $arg" ;;
esac
@@ -9473,18 +10971,18 @@
for file in $files; do
func_dirname "$file" "" "."
- dir="$func_dirname_result"
- if test "X$dir" = X.; then
- odir="$objdir"
+ dir=$func_dirname_result
+ if test . = "$dir"; then
+ odir=$objdir
else
- odir="$dir/$objdir"
+ odir=$dir/$objdir
fi
func_basename "$file"
- name="$func_basename_result"
- test "$opt_mode" = uninstall && odir="$dir"
+ name=$func_basename_result
+ test uninstall = "$opt_mode" && odir=$dir
# Remember odir for removal later, being careful to avoid duplicates
- if test "$opt_mode" = clean; then
+ if test clean = "$opt_mode"; then
case " $rmdirs " in
*" $odir "*) ;;
*) func_append rmdirs " $odir" ;;
@@ -9499,11 +10997,11 @@
elif test -d "$file"; then
exit_status=1
continue
- elif test "$rmforce" = yes; then
+ elif $rmforce; then
continue
fi
- rmfiles="$file"
+ rmfiles=$file
case $name in
*.la)
@@ -9517,7 +11015,7 @@
done
test -n "$old_library" && func_append rmfiles " $odir/$old_library"
- case "$opt_mode" in
+ case $opt_mode in
clean)
case " $library_names " in
*" $dlname "*) ;;
@@ -9528,12 +11026,12 @@
uninstall)
if test -n "$library_names"; then
# Do each command in the postuninstall commands.
- func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
+ func_execute_cmds "$postuninstall_cmds" '$rmforce || exit_status=1'
fi
if test -n "$old_library"; then
# Do each command in the old_postuninstall commands.
- func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
+ func_execute_cmds "$old_postuninstall_cmds" '$rmforce || exit_status=1'
fi
# FIXME: should reinstall the best remaining shared library.
;;
@@ -9549,14 +11047,12 @@
func_source $dir/$name
# Add PIC object to the list of files to remove.
- if test -n "$pic_object" &&
- test "$pic_object" != none; then
+ if test -n "$pic_object" && test none != "$pic_object"; then
func_append rmfiles " $dir/$pic_object"
fi
# Add non-PIC object to the list of files to remove.
- if test -n "$non_pic_object" &&
- test "$non_pic_object" != none; then
+ if test -n "$non_pic_object" && test none != "$non_pic_object"; then
func_append rmfiles " $dir/$non_pic_object"
fi
fi
@@ -9563,7 +11059,7 @@
;;
*)
- if test "$opt_mode" = clean ; then
+ if test clean = "$opt_mode"; then
noexename=$name
case $file in
*.exe)
@@ -9590,12 +11086,12 @@
# note $name still contains .exe if it was in $file originally
# as does the version of $file that was added into $rmfiles
- func_append rmfiles " $odir/$name $odir/${name}S.${objext}"
- if test "$fast_install" = yes && test -n "$relink_command"; then
+ func_append rmfiles " $odir/$name $odir/${name}S.$objext"
+ if test yes = "$fast_install" && test -n "$relink_command"; then
func_append rmfiles " $odir/lt-$name"
fi
- if test "X$noexename" != "X$name" ; then
- func_append rmfiles " $odir/lt-${noexename}.c"
+ if test "X$noexename" != "X$name"; then
+ func_append rmfiles " $odir/lt-$noexename.c"
fi
fi
fi
@@ -9604,7 +11100,7 @@
func_show_eval "$RM $rmfiles" 'exit_status=1'
done
- # Try to remove the ${objdir}s in the directories where we deleted files
+ # Try to remove the $objdir's in the directories where we deleted files
for dir in $rmdirs; do
if test -d "$dir"; then
func_show_eval "rmdir $dir >/dev/null 2>&1"
@@ -9614,16 +11110,17 @@
exit $exit_status
}
-{ test "$opt_mode" = uninstall || test "$opt_mode" = clean; } &&
- func_mode_uninstall ${1+"$@"}
+if test uninstall = "$opt_mode" || test clean = "$opt_mode"; then
+ func_mode_uninstall ${1+"$@"}
+fi
test -z "$opt_mode" && {
- help="$generic_help"
+ help=$generic_help
func_fatal_help "you must specify a MODE"
}
test -z "$exec_cmd" && \
- func_fatal_help "invalid operation mode \`$opt_mode'"
+ func_fatal_help "invalid operation mode '$opt_mode'"
if test -n "$exec_cmd"; then
eval exec "$exec_cmd"
@@ -9634,7 +11131,7 @@
# The TAGs below are defined such that we never get into a situation
-# in which we disable both kinds of libraries. Given conflicting
+# where we disable both kinds of libraries. Given conflicting
# choices, we go for a static library, that is the most portable,
# since we can't tell whether shared libraries were disabled because
# the user asked for that or because the platform doesn't support
@@ -9657,5 +11154,3 @@
# mode:shell-script
# sh-indentation:2
# End:
-# vi:sw=2
-
Modified: trunk/contrib/libarchive/build/autogen.sh
===================================================================
--- trunk/contrib/libarchive/build/autogen.sh 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/build/autogen.sh 2018-06-19 20:42:35 UTC (rev 11134)
@@ -51,6 +51,7 @@
# Remove developer CFLAGS if a release build is being made
if [ -n "${MAKE_LIBARCHIVE_RELEASE}" ]; then
perl -p -i -e "s/^(DEV_CFLAGS.*)/# \$1/" Makefile.am
+ perl -p -i -e 's/CMAKE_BUILD_TYPE "[A-Za-z]*"/CMAKE_BUILD_TYPE "Release"/' CMakeLists.txt
fi
set -xe
Deleted: trunk/contrib/libarchive/build/cmake/CheckStructMember.cmake
===================================================================
--- trunk/contrib/libarchive/build/cmake/CheckStructMember.cmake 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/build/cmake/CheckStructMember.cmake 2018-06-19 20:42:35 UTC (rev 11134)
@@ -1,43 +0,0 @@
-# - Check if the given struct or class has the specified member variable
-# CHECK_STRUCT_MEMBER (STRUCT MEMBER HEADER VARIABLE)
-#
-# STRUCT - the name of the struct or class you are interested in
-# MEMBER - the member which existence you want to check
-# HEADER - the header(s) where the prototype should be declared
-# VARIABLE - variable to store the result
-#
-# The following variables may be set before calling this macro to
-# modify the way the check is run:
-#
-# CMAKE_REQUIRED_FLAGS = string of compile command line flags
-# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar)
-# CMAKE_REQUIRED_INCLUDES = list of include directories
-
-# Copyright (c) 2006, Alexander Neundorf, <neundorf at kde.org>
-#
-# Redistribution and use is allowed according to the terms of the BSD license.
-# For details see the accompanying COPYING-CMAKE-SCRIPTS file.
-
-
-INCLUDE(CheckCSourceCompiles)
-
-MACRO (CHECK_STRUCT_MEMBER _STRUCT _MEMBER _HEADER _RESULT)
- SET(_INCLUDE_FILES)
- FOREACH (it ${_HEADER})
- SET(_INCLUDE_FILES "${_INCLUDE_FILES}#include <${it}>\n")
- ENDFOREACH (it)
-
- SET(_CHECK_STRUCT_MEMBER_SOURCE_CODE "
-${_INCLUDE_FILES}
-int main()
-{
- static ${_STRUCT} tmp;
- if (sizeof(tmp.${_MEMBER}))
- return 0;
- return 0;
-}
-")
- CHECK_C_SOURCE_COMPILES("${_CHECK_STRUCT_MEMBER_SOURCE_CODE}" ${_RESULT})
-
-ENDMACRO (CHECK_STRUCT_MEMBER)
-
Deleted: trunk/contrib/libarchive/build/cmake/FindLZMA.cmake
===================================================================
--- trunk/contrib/libarchive/build/cmake/FindLZMA.cmake 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/build/cmake/FindLZMA.cmake 2018-06-19 20:42:35 UTC (rev 11134)
@@ -1,48 +0,0 @@
-# - Find lzma and lzmadec
-# Find the native LZMA includes and library
-#
-# LZMA_INCLUDE_DIR - where to find lzma.h, etc.
-# LZMA_LIBRARIES - List of libraries when using liblzma.
-# LZMA_FOUND - True if liblzma found.
-# LZMADEC_INCLUDE_DIR - where to find lzmadec.h, etc.
-# LZMADEC_LIBRARIES - List of libraries when using liblzmadec.
-# LZMADEC_FOUND - True if liblzmadec found.
-
-IF (LZMA_INCLUDE_DIR)
- # Already in cache, be silent
- SET(LZMA_FIND_QUIETLY TRUE)
-ENDIF (LZMA_INCLUDE_DIR)
-
-FIND_PATH(LZMA_INCLUDE_DIR lzma.h)
-FIND_LIBRARY(LZMA_LIBRARY NAMES lzma liblzma)
-
-# handle the QUIETLY and REQUIRED arguments and set LZMA_FOUND to TRUE if
-# all listed variables are TRUE
-INCLUDE(FindPackageHandleStandardArgs)
-FIND_PACKAGE_HANDLE_STANDARD_ARGS(LZMA DEFAULT_MSG LZMA_LIBRARY LZMA_INCLUDE_DIR)
-
-IF(LZMA_FOUND)
- SET( LZMA_LIBRARIES ${LZMA_LIBRARY} )
-ELSE(LZMA_FOUND)
- SET( LZMA_LIBRARIES )
-
- IF (LZMADEC_INCLUDE_DIR)
- # Already in cache, be silent
- SET(LZMADEC_FIND_QUIETLY TRUE)
- ENDIF (LZMADEC_INCLUDE_DIR)
-
- FIND_PATH(LZMADEC_INCLUDE_DIR lzmadec.h)
- FIND_LIBRARY(LZMADEC_LIBRARY NAMES lzmadec )
-
- # handle the QUIETLY and REQUIRED arguments and set LZMADEC_FOUND to TRUE if
- # all listed variables are TRUE
- INCLUDE(FindPackageHandleStandardArgs)
- FIND_PACKAGE_HANDLE_STANDARD_ARGS(LZMADEC DEFAULT_MSG LZMADEC_LIBRARY
- LZMADEC_INCLUDE_DIR)
-
- IF(LZMADEC_FOUND)
- SET( LZMADEC_LIBRARIES ${LZMADEC_LIBRARY} )
- ELSE(LZMADEC_FOUND)
- SET( LZMADEC_LIBRARIES )
- ENDIF(LZMADEC_FOUND)
-ENDIF(LZMA_FOUND)
Modified: trunk/contrib/libarchive/build/cmake/config.h.in
===================================================================
--- trunk/contrib/libarchive/build/cmake/config.h.in 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/build/cmake/config.h.in 2018-06-19 20:42:35 UTC (rev 11134)
@@ -179,6 +179,27 @@
/* Define ZLIB_WINAPI if zlib was built on Visual Studio. */
#cmakedefine ZLIB_WINAPI 1
+/* Darwin ACL support */
+#cmakedefine ARCHIVE_ACL_DARWIN 1
+
+/* FreeBSD ACL support */
+#cmakedefine ARCHIVE_ACL_FREEBSD 1
+
+/* FreeBSD NFSv4 ACL support */
+#cmakedefine ARCHIVE_ACL_FREEBSD_NFS4 1
+
+/* Linux POSIX.1e ACL support via libacl */
+#cmakedefine ARCHIVE_ACL_LIBACL 1
+
+/* Linux NFSv4 ACL support via librichacl */
+#cmakedefine ARCHIVE_ACL_LIBRICHACL 1
+
+/* Solaris ACL support */
+#cmakedefine ARCHIVE_ACL_SUNOS 1
+
+/* Solaris NFSv4 ACL support */
+#cmakedefine ARCHIVE_ACL_SUNOS_NFS4 1
+
/* MD5 via ARCHIVE_CRYPTO_MD5_LIBC supported. */
#cmakedefine ARCHIVE_CRYPTO_MD5_LIBC 1
@@ -281,6 +302,18 @@
/* SHA512 via ARCHIVE_CRYPTO_SHA512_WIN supported. */
#cmakedefine ARCHIVE_CRYPTO_SHA512_WIN 1
+/* AIX xattr support */
+#cmakedefine ARCHIVE_XATTR_AIX 1
+
+/* Darwin xattr support */
+#cmakedefine ARCHIVE_XATTR_DARWIN 1
+
+/* FreeBSD xattr support */
+#cmakedefine ARCHIVE_XATTR_FREEBSD 1
+
+/* Linux xattr support */
+#cmakedefine ARCHIVE_XATTR_LINUX 1
+
/* Version number of bsdcpio */
#cmakedefine BSDCPIO_VERSION_STRING "${BSDCPIO_VERSION_STRING}"
@@ -293,6 +326,9 @@
/* Define to 1 if you have the `acl_create_entry' function. */
#cmakedefine HAVE_ACL_CREATE_ENTRY 1
+/* Define to 1 if you have the `acl_get_fd_np' function. */
+#cmakedefine HAVE_ACL_GET_FD_NP 1
+
/* Define to 1 if you have the `acl_get_link' function. */
#cmakedefine HAVE_ACL_GET_LINK 1
@@ -323,9 +359,6 @@
/* Define to 1 if you have the `acl_set_file' function. */
#cmakedefine HAVE_ACL_SET_FILE 1
-/* True for systems with POSIX ACL support */
-#cmakedefine HAVE_ACL_USER 1
-
/* Define to 1 if you have the `arc4random_buf' function. */
#cmakedefine HAVE_ARC4RANDOM_BUF 1
@@ -362,6 +395,34 @@
/* Define to 1 if you have the `cygwin_conv_path' function. */
#cmakedefine HAVE_CYGWIN_CONV_PATH 1
+/* Define to 1 if you have the declaration of `ACE_GETACL', and to 0 if you
+ don't. */
+#cmakedefine HAVE_DECL_ACE_GETACL 1
+
+/* Define to 1 if you have the declaration of `ACE_GETACLCNT', and to 0 if you
+ don't. */
+#cmakedefine HAVE_DECL_ACE_GETACLCNT 1
+
+/* Define to 1 if you have the declaration of `ACE_SETACL', and to 0 if you
+ don't. */
+#cmakedefine HAVE_DECL_ACE_SETACL 1
+
+/* Define to 1 if you have the declaration of `ACL_SYNCHRONIZE', and to 0 if
+ you don't. */
+#cmakedefine HAVE_DECL_ACL_SYNCHRONIZE 1
+
+/* Define to 1 if you have the declaration of `ACL_TYPE_EXTENDED', and to 0 if
+ you don't. */
+#cmakedefine HAVE_DECL_ACL_TYPE_EXTENDED 1
+
+/* Define to 1 if you have the declaration of `ACL_TYPE_NFS4', and to 0 if you
+ don't. */
+#cmakedefine HAVE_DECL_ACL_TYPE_NFS4 1
+
+/* Define to 1 if you have the declaration of `ACL_USER', and to 0 if you
+ don't. */
+#cmakedefine HAVE_DECL_ACL_USER 1
+
/* Define to 1 if you have the declaration of `INT32_MAX', and to 0 if you
don't. */
#cmakedefine HAVE_DECL_INT32_MAX 1
@@ -386,6 +447,10 @@
don't. */
#cmakedefine HAVE_DECL_INTMAX_MIN 1
+/* Define to 1 if you have the declaration of `SETACL', and to 0 if you don't.
+ */
+#cmakedefine HAVE_DECL_SETACL 1
+
/* Define to 1 if you have the declaration of `SIZE_MAX', and to 0 if you
don't. */
#cmakedefine HAVE_DECL_SIZE_MAX 1
@@ -410,6 +475,10 @@
don't. */
#cmakedefine HAVE_DECL_UINTMAX_MAX 1
+/* Define to 1 if you have the declaration of `XATTR_NOFOLLOW', and to 0 if
+ you don't. */
+#cmakedefine HAVE_DECL_XATTR_NOFOLLOW 1
+
/* Define to 1 if you have the <direct.h> header file. */
#cmakedefine HAVE_DIRECT_H 1
@@ -459,6 +528,14 @@
/* Define to 1 if EXTATTR_NAMESPACE_USER is defined in sys/extattr.h. */
#cmakedefine HAVE_DECL_EXTATTR_NAMESPACE_USER 1
+/* Define to 1 if you have the declaration of `GETACL', and to 0 if you don't.
+ */
+#cmakedefine HAVE_DECL_GETACL 1
+
+/* Define to 1 if you have the declaration of `GETACLCNT', and to 0 if you
+ don't. */
+#cmakedefine HAVE_DECL_GETACLCNT 1
+
/* Define to 1 if you have the `fchdir' function. */
#cmakedefine HAVE_FCHDIR 1
@@ -721,6 +798,9 @@
/* Define to 1 if you have the <lzma.h> header file. */
#cmakedefine HAVE_LZMA_H 1
+/* Define to 1 if you have a working `lzma_stream_encoder_mt' function. */
+#cmakedefine HAVE_LZMA_STREAM_ENCODER_MT 1
+
/* Define to 1 if you have the <lzo/lzo1x.h> header file. */
#cmakedefine HAVE_LZO_LZO1X_H 1
@@ -730,6 +810,9 @@
/* Define to 1 if you have the `mbrtowc' function. */
#cmakedefine HAVE_MBRTOWC 1
+/* Define to 1 if you have the <membership.h> header file. */
+#cmakedefine HAVE_MEMBERSHIP_H 1
+
/* Define to 1 if you have the `memmove' function. */
#cmakedefine HAVE_MEMMOVE 1
@@ -923,6 +1006,12 @@
/* Define to 1 if `__tm_gmtoff' is a member of `struct tm'. */
#cmakedefine HAVE_STRUCT_TM___TM_GMTOFF 1
+/* Define to 1 if you have `struct vfsconf'. */
+#cmakedefine HAVE_STRUCT_VFSCONF 1
+
+/* Define to 1 if you have `struct xvfsconf'. */
+#cmakedefine HAVE_STRUCT_XVFSCONF 1
+
/* Define to 1 if you have the `symlink' function. */
#cmakedefine HAVE_SYMLINK 1
@@ -961,6 +1050,9 @@
/* Define to 1 if you have the <sys/poll.h> header file. */
#cmakedefine HAVE_SYS_POLL_H 1
+/* Define to 1 if you have the <sys/richacl.h> header file. */
+#cmakedefine HAVE_SYS_RICHACL_H 1
+
/* Define to 1 if you have the <sys/select.h> header file. */
#cmakedefine HAVE_SYS_SELECT_H 1
@@ -1081,6 +1173,9 @@
/* Define to 1 if you have a working EXT2_IOC_GETFLAGS */
#cmakedefine HAVE_WORKING_EXT2_IOC_GETFLAGS 1
+/* Define to 1 if you have a working FS_IOC_GETFLAGS */
+#cmakedefine HAVE_WORKING_FS_IOC_GETFLAGS 1
+
/* Define to 1 if you have the <zlib.h> header file. */
#cmakedefine HAVE_ZLIB_H 1
Modified: trunk/contrib/libarchive/build/version
===================================================================
--- trunk/contrib/libarchive/build/version 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/build/version 2018-06-19 20:42:35 UTC (rev 11134)
@@ -1 +1 @@
-3002001
+3003002
Modified: trunk/contrib/libarchive/cat/bsdcat.c
===================================================================
--- trunk/contrib/libarchive/cat/bsdcat.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/cat/bsdcat.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -142,5 +142,8 @@
bsdcat_next();
}
+ if (a != NULL)
+ archive_read_free(a);
+
exit(exit_status);
}
Modified: trunk/contrib/libarchive/cat/test/CMakeLists.txt
===================================================================
--- trunk/contrib/libarchive/cat/test/CMakeLists.txt 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/cat/test/CMakeLists.txt 2018-06-19 20:42:35 UTC (rev 11134)
@@ -6,7 +6,7 @@
IF(ENABLE_CAT AND ENABLE_TEST)
SET(bsdcat_test_SOURCES
../../test_utils/test_utils.c
- main.c
+ ../../test_utils/test_main.c
test.h
test_0.c
test_empty_gz.c
@@ -29,6 +29,16 @@
# Register target
#
ADD_EXECUTABLE(bsdcat_test ${bsdcat_test_SOURCES})
+ IF(ENABLE_ACL)
+ SET(TEST_ACL_LIBS "")
+ IF(HAVE_LIBACL)
+ LIST(APPEND TEST_ACL_LIBS ${ACL_LIBRARY})
+ ENDIF(HAVE_LIBACL)
+ IF(HAVE_LIBRICHACL)
+ LIST(APPEND TEST_ACL_LIBS ${RICHACL_LIBRARY})
+ ENDIF(HAVE_LIBRICHACL)
+ TARGET_LINK_LIBRARIES(bsdcat_test ${TEST_ACL_LIBS})
+ ENDIF(ENABLE_ACL)
SET_PROPERTY(TARGET bsdcat_test PROPERTY COMPILE_DEFINITIONS LIST_H)
#
@@ -54,11 +64,13 @@
INCLUDE(${CMAKE_CURRENT_BINARY_DIR}/list.h)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/test_utils)
+ INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/cat/test)
# Experimental new test handling
ADD_CUSTOM_TARGET(run_bsdcat_test
COMMAND bsdcat_test -p $<TARGET_FILE:bsdcat>
- -r ${CMAKE_CURRENT_SOURCE_DIR})
+ -r ${CMAKE_CURRENT_SOURCE_DIR}
+ -vv)
ADD_DEPENDENCIES(run_bsdcat_test bsdcat)
ADD_DEPENDENCIES(run_all_tests run_bsdcat_test)
Modified: trunk/contrib/libarchive/cat/test/test.h
===================================================================
--- trunk/contrib/libarchive/cat/test/test.h 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/cat/test/test.h 2018-06-19 20:42:35 UTC (rev 11134)
@@ -22,324 +22,19 @@
* (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: stable/11/contrib/libarchive/cat/test/test.h 307138 2016-10-12 10:28:22Z mm $
+ * $FreeBSD$
*/
/* Every test program should #include "test.h" as the first thing. */
-/*
- * The goal of this file (and the matching test.c) is to
- * simplify the very repetitive test-*.c test programs.
- */
-#if defined(HAVE_CONFIG_H)
-/* Most POSIX platforms use the 'configure' script to build config.h */
-#include "config.h"
-#elif defined(__FreeBSD__)
-/* Building as part of FreeBSD system requires a pre-built config.h. */
-#include "config_freebsd.h"
-#elif defined(_WIN32) && !defined(__CYGWIN__)
-/* Win32 can't run the 'configure' script. */
-#include "config_windows.h"
-#else
-/* Warn if the library hasn't been (automatically or manually) configured. */
-#error Oops: No config.h and no pre-built configuration in test.h.
-#endif
+#define KNOWNREF "test_expand.Z.uu"
+#define ENVBASE "BSDCAT" /* Prefix for environment variables. */
+#define PROGRAM "bsdcat" /* Name of program being tested. */
+#define PROGRAM_ALIAS "cat" /* Generic alias for program */
+#undef LIBRARY /* Not testing a library. */
+#undef EXTRA_DUMP /* How to dump extra data */
+#undef EXTRA_ERRNO /* How to dump errno */
+/* How to generate extra version info. */
+#define EXTRA_VERSION (systemf("%s --version", testprog) ? "" : "")
-#include <sys/types.h> /* Windows requires this before sys/stat.h */
-#include <sys/stat.h>
-
-#if HAVE_DIRENT_H
-#include <dirent.h>
-#endif
-#ifdef HAVE_DIRECT_H
-#include <direct.h>
-#define dirent direct
-#endif
-#include <errno.h>
-#include <fcntl.h>
-#ifdef HAVE_IO_H
-#include <io.h>
-#endif
-#ifdef HAVE_STDINT_H
-#include <stdint.h>
-#endif
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include <time.h>
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-#include <wchar.h>
-#ifdef HAVE_WINDOWS_H
-#include <windows.h>
-#endif
-
-/*
- * System-specific tweaks. We really want to minimize these
- * as much as possible, since they make it harder to understand
- * the mainline code.
- */
-
-/* Windows (including Visual Studio and MinGW but not Cygwin) */
-#if defined(_WIN32) && !defined(__CYGWIN__)
-#if !defined(__BORLANDC__)
-#undef chdir
-#define chdir _chdir
-#define strdup _strdup
-#endif
-#endif
-
-/* Visual Studio */
-#if defined(_MSC_VER) && _MSC_VER < 1900
-#define snprintf sprintf_s
-#endif
-
-#if defined(__BORLANDC__)
-#pragma warn -8068 /* Constant out of range in comparison. */
-#endif
-
-/* Haiku OS and QNX */
-#if defined(__HAIKU__) || defined(__QNXNTO__)
-/* Haiku and QNX have typedefs in stdint.h (needed for int64_t) */
-#include <stdint.h>
-#endif
-
-/* Get a real definition for __FBSDID if we can */
-#if HAVE_SYS_CDEFS_H
-#include <sys/cdefs.h>
-#endif
-
-/* If not, define it so as to avoid dangling semicolons. */
-#ifndef __FBSDID
-#define __FBSDID(a) struct _undefined_hack
-#endif
-
-#ifndef O_BINARY
-#define O_BINARY 0
-#endif
-
-/*
- * Redefine DEFINE_TEST for use in defining the test functions.
- */
-#undef DEFINE_TEST
-#define DEFINE_TEST(name) void name(void); void name(void)
-
-/* An implementation of the standard assert() macro */
-#define assert(e) assertion_assert(__FILE__, __LINE__, (e), #e, NULL)
-/* chdir() and error if it fails */
-#define assertChdir(path) \
- assertion_chdir(__FILE__, __LINE__, path)
-/* Assert two integers are the same. Reports value of each one if not. */
-#define assertEqualInt(v1,v2) \
- assertion_equal_int(__FILE__, __LINE__, (v1), #v1, (v2), #v2, NULL)
-/* Assert two strings are the same. Reports value of each one if not. */
-#define assertEqualString(v1,v2) \
- assertion_equal_string(__FILE__, __LINE__, (v1), #v1, (v2), #v2, NULL, 0)
-#define assertEqualUTF8String(v1,v2) \
- assertion_equal_string(__FILE__, __LINE__, (v1), #v1, (v2), #v2, NULL, 1)
-/* As above, but v1 and v2 are wchar_t * */
-#define assertEqualWString(v1,v2) \
- assertion_equal_wstring(__FILE__, __LINE__, (v1), #v1, (v2), #v2, NULL)
-/* As above, but raw blocks of bytes. */
-#define assertEqualMem(v1, v2, l) \
- assertion_equal_mem(__FILE__, __LINE__, (v1), #v1, (v2), #v2, (l), #l, NULL)
-/* Assert that memory is full of a specified byte */
-#define assertMemoryFilledWith(v1, l, b) \
- assertion_memory_filled_with(__FILE__, __LINE__, (v1), #v1, (l), #l, (b), #b, NULL)
-/* Assert two files are the same. */
-#define assertEqualFile(f1, f2) \
- assertion_equal_file(__FILE__, __LINE__, (f1), (f2))
-/* Assert that a file is empty. */
-#define assertEmptyFile(pathname) \
- assertion_empty_file(__FILE__, __LINE__, (pathname))
-/* Assert that a file is not empty. */
-#define assertNonEmptyFile(pathname) \
- assertion_non_empty_file(__FILE__, __LINE__, (pathname))
-#define assertFileAtime(pathname, sec, nsec) \
- assertion_file_atime(__FILE__, __LINE__, pathname, sec, nsec)
-#define assertFileAtimeRecent(pathname) \
- assertion_file_atime_recent(__FILE__, __LINE__, pathname)
-#define assertFileBirthtime(pathname, sec, nsec) \
- assertion_file_birthtime(__FILE__, __LINE__, pathname, sec, nsec)
-#define assertFileBirthtimeRecent(pathname) \
- assertion_file_birthtime_recent(__FILE__, __LINE__, pathname)
-/* Assert that a file exists; supports printf-style arguments. */
-#define assertFileExists(pathname) \
- assertion_file_exists(__FILE__, __LINE__, pathname)
-/* Assert that a file exists. */
-#define assertFileNotExists(pathname) \
- assertion_file_not_exists(__FILE__, __LINE__, pathname)
-/* Assert that file contents match a string. */
-#define assertFileContents(data, data_size, pathname) \
- assertion_file_contents(__FILE__, __LINE__, data, data_size, pathname)
-#define assertFileMtime(pathname, sec, nsec) \
- assertion_file_mtime(__FILE__, __LINE__, pathname, sec, nsec)
-#define assertFileMtimeRecent(pathname) \
- assertion_file_mtime_recent(__FILE__, __LINE__, pathname)
-#define assertFileNLinks(pathname, nlinks) \
- assertion_file_nlinks(__FILE__, __LINE__, pathname, nlinks)
-#define assertFileSize(pathname, size) \
- assertion_file_size(__FILE__, __LINE__, pathname, size)
-#define assertTextFileContents(text, pathname) \
- assertion_text_file_contents(__FILE__, __LINE__, text, pathname)
-#define assertFileContainsLinesAnyOrder(pathname, lines) \
- assertion_file_contains_lines_any_order(__FILE__, __LINE__, pathname, lines)
-#define assertIsDir(pathname, mode) \
- assertion_is_dir(__FILE__, __LINE__, pathname, mode)
-#define assertIsHardlink(path1, path2) \
- assertion_is_hardlink(__FILE__, __LINE__, path1, path2)
-#define assertIsNotHardlink(path1, path2) \
- assertion_is_not_hardlink(__FILE__, __LINE__, path1, path2)
-#define assertIsReg(pathname, mode) \
- assertion_is_reg(__FILE__, __LINE__, pathname, mode)
-#define assertIsSymlink(pathname, contents) \
- assertion_is_symlink(__FILE__, __LINE__, pathname, contents)
-/* Create a directory, report error if it fails. */
-#define assertMakeDir(dirname, mode) \
- assertion_make_dir(__FILE__, __LINE__, dirname, mode)
-#define assertMakeFile(path, mode, contents) \
- assertion_make_file(__FILE__, __LINE__, path, mode, -1, contents)
-#define assertMakeBinFile(path, mode, csize, contents) \
- assertion_make_file(__FILE__, __LINE__, path, mode, csize, contents)
-#define assertMakeHardlink(newfile, oldfile) \
- assertion_make_hardlink(__FILE__, __LINE__, newfile, oldfile)
-#define assertMakeSymlink(newfile, linkto) \
- assertion_make_symlink(__FILE__, __LINE__, newfile, linkto)
-#define assertNodump(path) \
- assertion_nodump(__FILE__, __LINE__, path)
-#define assertUmask(mask) \
- assertion_umask(__FILE__, __LINE__, mask)
-#define assertUtimes(pathname, atime, atime_nsec, mtime, mtime_nsec) \
- assertion_utimes(__FILE__, __LINE__, pathname, atime, atime_nsec, mtime, mtime_nsec)
-
-/*
- * This would be simple with C99 variadic macros, but I don't want to
- * require that. Instead, I insert a function call before each
- * skipping() call to pass the file and line information down. Crude,
- * but effective.
- */
-#define skipping \
- skipping_setup(__FILE__, __LINE__);test_skipping
-
-/* Function declarations. These are defined in test_utility.c. */
-void failure(const char *fmt, ...);
-int assertion_assert(const char *, int, int, const char *, void *);
-int assertion_chdir(const char *, int, const char *);
-int assertion_empty_file(const char *, int, const char *);
-int assertion_equal_file(const char *, int, const char *, const char *);
-int assertion_equal_int(const char *, int, long long, const char *, long long, const char *, void *);
-int assertion_equal_mem(const char *, int, const void *, const char *, const void *, const char *, size_t, const char *, void *);
-int assertion_memory_filled_with(const char *, int, const void *, const char *, size_t, const char *, char, const char *, void *);
-int assertion_equal_string(const char *, int, const char *v1, const char *, const char *v2, const char *, void *, int);
-int assertion_equal_wstring(const char *, int, const wchar_t *v1, const char *, const wchar_t *v2, const char *, void *);
-int assertion_file_atime(const char *, int, const char *, long, long);
-int assertion_file_atime_recent(const char *, int, const char *);
-int assertion_file_birthtime(const char *, int, const char *, long, long);
-int assertion_file_birthtime_recent(const char *, int, const char *);
-int assertion_file_contains_lines_any_order(const char *, int, const char *, const char **);
-int assertion_file_contents(const char *, int, const void *, int, const char *);
-int assertion_file_exists(const char *, int, const char *);
-int assertion_file_mode(const char *, int, const char *, int);
-int assertion_file_mtime(const char *, int, const char *, long, long);
-int assertion_file_mtime_recent(const char *, int, const char *);
-int assertion_file_nlinks(const char *, int, const char *, int);
-int assertion_file_not_exists(const char *, int, const char *);
-int assertion_file_size(const char *, int, const char *, long);
-int assertion_is_dir(const char *, int, const char *, int);
-int assertion_is_hardlink(const char *, int, const char *, const char *);
-int assertion_is_not_hardlink(const char *, int, const char *, const char *);
-int assertion_is_reg(const char *, int, const char *, int);
-int assertion_is_symlink(const char *, int, const char *, const char *);
-int assertion_make_dir(const char *, int, const char *, int);
-int assertion_make_file(const char *, int, const char *, int, int, const void *);
-int assertion_make_hardlink(const char *, int, const char *newpath, const char *);
-int assertion_make_symlink(const char *, int, const char *newpath, const char *);
-int assertion_nodump(const char *, int, const char *);
-int assertion_non_empty_file(const char *, int, const char *);
-int assertion_text_file_contents(const char *, int, const char *buff, const char *f);
-int assertion_umask(const char *, int, int);
-int assertion_utimes(const char *, int, const char *, long, long, long, long );
-
-void skipping_setup(const char *, int);
-void test_skipping(const char *fmt, ...);
-
-/* Like sprintf, then system() */
-int systemf(const char * fmt, ...);
-
-/* Delay until time() returns a value after this. */
-void sleepUntilAfter(time_t);
-
-/* Return true if this platform can create symlinks. */
-int canSymlink(void);
-
-/* Return true if this platform can run the "bzip2" program. */
-int canBzip2(void);
-
-/* Return true if this platform can run the "grzip" program. */
-int canGrzip(void);
-
-/* Return true if this platform can run the "gzip" program. */
-int canGzip(void);
-
-/* Return true if this platform can run the specified command. */
-int canRunCommand(const char *);
-
-/* Return true if this platform can run the "lrzip" program. */
-int canLrzip(void);
-
-/* Return true if this platform can run the "lz4" program. */
-int canLz4(void);
-
-/* Return true if this platform can run the "lzip" program. */
-int canLzip(void);
-
-/* Return true if this platform can run the "lzma" program. */
-int canLzma(void);
-
-/* Return true if this platform can run the "lzop" program. */
-int canLzop(void);
-
-/* Return true if this platform can run the "xz" program. */
-int canXz(void);
-
-/* Return true if this filesystem can handle nodump flags. */
-int canNodump(void);
-
-/* Return true if the file has large i-node number(>0xffffffff). */
-int is_LargeInode(const char *);
-
-/* Suck file into string allocated via malloc(). Call free() when done. */
-/* Supports printf-style args: slurpfile(NULL, "%s/myfile", refdir); */
-char *slurpfile(size_t *, const char *fmt, ...);
-
-/* Dump block of bytes to a file. */
-void dumpfile(const char *filename, void *, size_t);
-
-/* Extracts named reference file to the current directory. */
-void extract_reference_file(const char *);
-/* Copies named reference file to the current directory. */
-void copy_reference_file(const char *);
-
-/* Extracts a list of files to the current directory.
- * List must be NULL terminated.
- */
-void extract_reference_files(const char **);
-
-/* Path to working directory for current test */
-extern const char *testworkdir;
-
-/*
- * Special interfaces for program test harness.
- */
-
-/* Pathname of exe to be tested. */
-extern const char *testprogfile;
-/* Name of exe to use in printf-formatted command strings. */
-/* On Windows, this includes leading/trailing quotes. */
-extern const char *testprog;
-
-#ifdef USE_DMALLOC
-#include <dmalloc.h>
-#endif
+#include "test_common.h"
Modified: trunk/contrib/libarchive/cat/test/test_version.c
===================================================================
--- trunk/contrib/libarchive/cat/test/test_version.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/cat/test/test_version.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2003-2007 Tim Kientzle
+ * Copyright (c) 2003-2017 Tim Kientzle
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -30,68 +30,5 @@
DEFINE_TEST(test_version)
{
- int r;
- char *p, *q;
- size_t s;
-
-
- r = systemf("%s --version >version.stdout 2>version.stderr", testprog);
- failure("Unable to run %s --version", testprog);
- if (!assert(r == 0))
- return;
-
- /* --version should generate nothing to stdout. */
- assertEmptyFile("version.stderr");
- /* Verify format of version message. */
- q = p = slurpfile(&s, "version.stdout");
- /* Version message should start with name of program, then space. */
- assert(s > 6);
- failure("Version must start with 'bsdcat': ``%s''", p);
- if (!assertEqualMem(q, "bsdcat ", 7))
- return;
- q += 7; s -= 7;
- /* Version number is a series of digits and periods. */
- while (s > 0 && (*q == '.' || (*q >= '0' && *q <= '9'))) {
- ++q;
- --s;
- }
- /* Version number terminated by space. */
- failure("No space after bsdcat version: ``%s''", p);
- assert(s > 1);
- /* Skip a single trailing a,b,c, or d. */
- if (*q == 'a' || *q == 'b' || *q == 'c' || *q == 'd')
- ++q;
- failure("No space after bsdcat version: ``%s''", p);
- assert(*q == ' ');
- ++q; --s;
- /* Separator. */
- failure("No `-' between bsdcat and libarchive versions: ``%s''", p);
- assertEqualMem(q, "- ", 2);
- q += 2; s -= 2;
- /* libarchive name and version number */
- failure("Not long enough for libarchive version: ``%s''", p);
- assert(s > 11);
- failure("Libarchive version must start with `libarchive': ``%s''", p);
- assertEqualMem(q, "libarchive ", 11);
- q += 11; s -= 11;
- /* Version number is a series of digits and periods. */
- while (s > 0 && (*q == '.' || (*q >= '0' && *q <= '9'))) {
- ++q;
- --s;
- }
- /* Skip a single trailing a,b,c, or d. */
- if (*q == 'a' || *q == 'b' || *q == 'c' || *q == 'd')
- ++q;
- /* Skip arbitrary third-party version numbers. */
- while (s > 0 && (*q == ' ' || *q == '-' || *q == '/' || *q == '.' || isalnum(*q))) {
- ++q;
- --s;
- }
- /* All terminated by end-of-line. */
- assert(s >= 1);
- /* Skip an optional CR character (e.g., Windows) */
- failure("Version output must end with \\n or \\r\\n");
- if (*q == '\r') { ++q; --s; }
- assertEqualMem(q, "\n", 1);
- free(p);
+ assertVersion(testprog, "bsdcat");
}
Modified: trunk/contrib/libarchive/config.h.in
===================================================================
--- trunk/contrib/libarchive/config.h.in 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/config.h.in 2018-06-19 20:42:35 UTC (rev 11134)
@@ -1,5 +1,26 @@
/* config.h.in. Generated from configure.ac by autoheader. */
+/* Darwin ACL support */
+#undef ARCHIVE_ACL_DARWIN
+
+/* FreeBSD ACL support */
+#undef ARCHIVE_ACL_FREEBSD
+
+/* FreeBSD NFSv4 ACL support */
+#undef ARCHIVE_ACL_FREEBSD_NFS4
+
+/* Linux POSIX.1e ACL support via libacl */
+#undef ARCHIVE_ACL_LIBACL
+
+/* Linux NFSv4 ACL support via librichacl */
+#undef ARCHIVE_ACL_LIBRICHACL
+
+/* Solaris ACL support */
+#undef ARCHIVE_ACL_SUNOS
+
+/* Solaris NFSv4 ACL support */
+#undef ARCHIVE_ACL_SUNOS_NFS4
+
/* MD5 via ARCHIVE_CRYPTO_MD5_LIBC supported. */
#undef ARCHIVE_CRYPTO_MD5_LIBC
@@ -117,6 +138,18 @@
/* SHA512 via ARCHIVE_CRYPTO_SHA512_WIN supported. */
#undef ARCHIVE_CRYPTO_SHA512_WIN
+/* AIX xattr support */
+#undef ARCHIVE_XATTR_AIX
+
+/* Darwin xattr support */
+#undef ARCHIVE_XATTR_DARWIN
+
+/* FreeBSD xattr support */
+#undef ARCHIVE_XATTR_FREEBSD
+
+/* Linux xattr support */
+#undef ARCHIVE_XATTR_LINUX
+
/* Version number of bsdcat */
#undef BSDCAT_VERSION_STRING
@@ -126,12 +159,63 @@
/* Version number of bsdtar */
#undef BSDTAR_VERSION_STRING
+/* Define to 1 if the system has the type `ace_t'. */
+#undef HAVE_ACE_T
+
+/* Define to 1 if you have the `acl' function. */
+#undef HAVE_ACL
+
+/* Define to 1 if the system has the type `aclent_t'. */
+#undef HAVE_ACLENT_T
+
+/* Define to 1 if you have the `acl_add_flag_np' function. */
+#undef HAVE_ACL_ADD_FLAG_NP
+
+/* Define to 1 if you have the `acl_add_perm' function. */
+#undef HAVE_ACL_ADD_PERM
+
+/* Define to 1 if you have the `acl_clear_flags_np' function. */
+#undef HAVE_ACL_CLEAR_FLAGS_NP
+
+/* Define to 1 if you have the `acl_clear_perms' function. */
+#undef HAVE_ACL_CLEAR_PERMS
+
/* Define to 1 if you have the `acl_create_entry' function. */
#undef HAVE_ACL_CREATE_ENTRY
-/* Define to 1 if you have the `acl_get_link' function. */
-#undef HAVE_ACL_GET_LINK
+/* Define to 1 if you have the `acl_delete_def_file' function. */
+#undef HAVE_ACL_DELETE_DEF_FILE
+/* Define to 1 if the system has the type `acl_entry_t'. */
+#undef HAVE_ACL_ENTRY_T
+
+/* Define to 1 if you have the `acl_free' function. */
+#undef HAVE_ACL_FREE
+
+/* Define to 1 if you have the `acl_get_brand_np' function. */
+#undef HAVE_ACL_GET_BRAND_NP
+
+/* Define to 1 if you have the `acl_get_entry' function. */
+#undef HAVE_ACL_GET_ENTRY
+
+/* Define to 1 if you have the `acl_get_entry_type_np' function. */
+#undef HAVE_ACL_GET_ENTRY_TYPE_NP
+
+/* Define to 1 if you have the `acl_get_fd' function. */
+#undef HAVE_ACL_GET_FD
+
+/* Define to 1 if you have the `acl_get_fd_np' function. */
+#undef HAVE_ACL_GET_FD_NP
+
+/* Define to 1 if you have the `acl_get_file' function. */
+#undef HAVE_ACL_GET_FILE
+
+/* Define to 1 if you have the `acl_get_flagset_np' function. */
+#undef HAVE_ACL_GET_FLAGSET_NP
+
+/* Define to 1 if you have the `acl_get_flag_np' function. */
+#undef HAVE_ACL_GET_FLAG_NP
+
/* Define to 1 if you have the `acl_get_link_np' function. */
#undef HAVE_ACL_GET_LINK_NP
@@ -138,12 +222,24 @@
/* Define to 1 if you have the `acl_get_perm' function. */
#undef HAVE_ACL_GET_PERM
+/* Define to 1 if you have the `acl_get_permset' function. */
+#undef HAVE_ACL_GET_PERMSET
+
/* Define to 1 if you have the `acl_get_perm_np' function. */
#undef HAVE_ACL_GET_PERM_NP
+/* Define to 1 if you have the `acl_get_qualifier' function. */
+#undef HAVE_ACL_GET_QUALIFIER
+
+/* Define to 1 if you have the `acl_get_tag_type' function. */
+#undef HAVE_ACL_GET_TAG_TYPE
+
/* Define to 1 if you have the `acl_init' function. */
#undef HAVE_ACL_INIT
+/* Define to 1 if you have the `acl_is_trivial_np' function. */
+#undef HAVE_ACL_IS_TRIVIAL_NP
+
/* Define to 1 if you have the <acl/libacl.h> header file. */
#undef HAVE_ACL_LIBACL_H
@@ -150,6 +246,9 @@
/* Define to 1 if the system has the type `acl_permset_t'. */
#undef HAVE_ACL_PERMSET_T
+/* Define to 1 if you have the `acl_set_entry_type_np' function. */
+#undef HAVE_ACL_SET_ENTRY_TYPE_NP
+
/* Define to 1 if you have the `acl_set_fd' function. */
#undef HAVE_ACL_SET_FD
@@ -159,9 +258,21 @@
/* Define to 1 if you have the `acl_set_file' function. */
#undef HAVE_ACL_SET_FILE
-/* True for systems with POSIX ACL support */
-#undef HAVE_ACL_USER
+/* Define to 1 if you have the `acl_set_link_np' function. */
+#undef HAVE_ACL_SET_LINK_NP
+/* Define to 1 if you have the `acl_set_qualifier' function. */
+#undef HAVE_ACL_SET_QUALIFIER
+
+/* Define to 1 if you have the `acl_set_tag_type' function. */
+#undef HAVE_ACL_SET_TAG_TYPE
+
+/* Define to 1 if the system has the type `acl_t'. */
+#undef HAVE_ACL_T
+
+/* Define to 1 if the system has the type `acl_tag_t'. */
+#undef HAVE_ACL_TAG_T
+
/* Define to 1 if you have the `arc4random_buf' function. */
#undef HAVE_ARC4RANDOM_BUF
@@ -168,7 +279,7 @@
/* Define to 1 if you have the <attr/xattr.h> header file. */
#undef HAVE_ATTR_XATTR_H
-/* Define to 1 if you have the <Bcrypt.h> header file. */
+/* Define to 1 if you have the <bcrypt.h> header file. */
#undef HAVE_BCRYPT_H
/* Define to 1 if you have the <bzlib.h> header file. */
@@ -195,10 +306,46 @@
/* Define to 1 if you have the `cygwin_conv_path' function. */
#undef HAVE_CYGWIN_CONV_PATH
+/* Define to 1 if you have the declaration of `ACE_GETACL', and to 0 if you
+ don't. */
+#undef HAVE_DECL_ACE_GETACL
+
+/* Define to 1 if you have the declaration of `ACE_GETACLCNT', and to 0 if you
+ don't. */
+#undef HAVE_DECL_ACE_GETACLCNT
+
+/* Define to 1 if you have the declaration of `ACE_SETACL', and to 0 if you
+ don't. */
+#undef HAVE_DECL_ACE_SETACL
+
+/* Define to 1 if you have the declaration of `ACL_SYNCHRONIZE', and to 0 if
+ you don't. */
+#undef HAVE_DECL_ACL_SYNCHRONIZE
+
+/* Define to 1 if you have the declaration of `ACL_TYPE_EXTENDED', and to 0 if
+ you don't. */
+#undef HAVE_DECL_ACL_TYPE_EXTENDED
+
+/* Define to 1 if you have the declaration of `ACL_TYPE_NFS4', and to 0 if you
+ don't. */
+#undef HAVE_DECL_ACL_TYPE_NFS4
+
+/* Define to 1 if you have the declaration of `ACL_USER', and to 0 if you
+ don't. */
+#undef HAVE_DECL_ACL_USER
+
/* Define to 1 if you have the declaration of `EXTATTR_NAMESPACE_USER', and to
0 if you don't. */
#undef HAVE_DECL_EXTATTR_NAMESPACE_USER
+/* Define to 1 if you have the declaration of `GETACL', and to 0 if you don't.
+ */
+#undef HAVE_DECL_GETACL
+
+/* Define to 1 if you have the declaration of `GETACLCNT', and to 0 if you
+ don't. */
+#undef HAVE_DECL_GETACLCNT
+
/* Define to 1 if you have the declaration of `INT32_MAX', and to 0 if you
don't. */
#undef HAVE_DECL_INT32_MAX
@@ -223,6 +370,10 @@
don't. */
#undef HAVE_DECL_INTMAX_MIN
+/* Define to 1 if you have the declaration of `SETACL', and to 0 if you don't.
+ */
+#undef HAVE_DECL_SETACL
+
/* Define to 1 if you have the declaration of `SIZE_MAX', and to 0 if you
don't. */
#undef HAVE_DECL_SIZE_MAX
@@ -247,11 +398,15 @@
don't. */
#undef HAVE_DECL_UINTMAX_MAX
+/* Define to 1 if you have the declaration of `XATTR_NOFOLLOW', and to 0 if
+ you don't. */
+#undef HAVE_DECL_XATTR_NOFOLLOW
+
/* Define to 1 if you have the <dirent.h> header file, and it defines `DIR'.
*/
#undef HAVE_DIRENT_H
-/* Define to 1 if you have the `dirfd' function. */
+/* Define to 1 if you have a dirfd function or macro */
#undef HAVE_DIRFD
/* Define to 1 if you have the <dlfcn.h> header file. */
@@ -278,18 +433,33 @@
/* Define to 1 if you have the <ext2fs/ext2_fs.h> header file. */
#undef HAVE_EXT2FS_EXT2_FS_H
+/* Define to 1 if you have the `extattr_get_fd' function. */
+#undef HAVE_EXTATTR_GET_FD
+
/* Define to 1 if you have the `extattr_get_file' function. */
#undef HAVE_EXTATTR_GET_FILE
+/* Define to 1 if you have the `extattr_get_link' function. */
+#undef HAVE_EXTATTR_GET_LINK
+
+/* Define to 1 if you have the `extattr_list_fd' function. */
+#undef HAVE_EXTATTR_LIST_FD
+
/* Define to 1 if you have the `extattr_list_file' function. */
#undef HAVE_EXTATTR_LIST_FILE
+/* Define to 1 if you have the `extattr_list_link' function. */
+#undef HAVE_EXTATTR_LIST_LINK
+
/* Define to 1 if you have the `extattr_set_fd' function. */
#undef HAVE_EXTATTR_SET_FD
-/* Define to 1 if you have the `extattr_set_file' function. */
-#undef HAVE_EXTATTR_SET_FILE
+/* Define to 1 if you have the `extattr_set_link' function. */
+#undef HAVE_EXTATTR_SET_LINK
+/* Define to 1 if you have the `facl' function. */
+#undef HAVE_FACL
+
/* Define to 1 if you have the `fchdir' function. */
#undef HAVE_FCHDIR
@@ -452,9 +622,6 @@
/* Define to 1 if you have the `lzma' library (-llzma). */
#undef HAVE_LIBLZMA
-/* Define to 1 if you have the `lzmadec' library (-llzmadec). */
-#undef HAVE_LIBLZMADEC
-
/* Define to 1 if you have the `lzo2' library (-llzo2). */
#undef HAVE_LIBLZO2
@@ -473,6 +640,9 @@
/* Define to 1 if you have the `regex' library (-lregex). */
#undef HAVE_LIBREGEX
+/* Define to 1 if you have the `richacl' library (-lrichacl). */
+#undef HAVE_LIBRICHACL
+
/* Define to 1 if you have the `xml2' library (-lxml2). */
#undef HAVE_LIBXML2
@@ -552,9 +722,6 @@
/* Define to 1 if you have the <lz4.h> header file. */
#undef HAVE_LZ4_H
-/* Define to 1 if you have the <lzmadec.h> header file. */
-#undef HAVE_LZMADEC_H
-
/* Define to 1 if you have the <lzma.h> header file. */
#undef HAVE_LZMA_H
@@ -570,9 +737,21 @@
/* Define to 1 if you have the `mbrtowc' function. */
#undef HAVE_MBRTOWC
+/* Define to 1 if you have the `mbr_gid_to_uuid' function. */
+#undef HAVE_MBR_GID_TO_UUID
+
+/* Define to 1 if you have the `mbr_uid_to_uuid' function. */
+#undef HAVE_MBR_UID_TO_UUID
+
+/* Define to 1 if you have the `mbr_uuid_to_id' function. */
+#undef HAVE_MBR_UUID_TO_ID
+
/* Define to 1 if you have the <md5.h> header file. */
#undef HAVE_MD5_H
+/* Define to 1 if you have the <membership.h> header file. */
+#undef HAVE_MEMBERSHIP_H
+
/* Define to 1 if you have the `memmove' function. */
#undef HAVE_MEMMOVE
@@ -669,6 +848,27 @@
/* Define to 1 if you have the <regex.h> header file. */
#undef HAVE_REGEX_H
+/* Define to 1 if you have the `richacl_alloc' function. */
+#undef HAVE_RICHACL_ALLOC
+
+/* Define to 1 if you have the `richacl_equiv_mode' function. */
+#undef HAVE_RICHACL_EQUIV_MODE
+
+/* Define to 1 if you have the `richacl_free' function. */
+#undef HAVE_RICHACL_FREE
+
+/* Define to 1 if you have the `richacl_get_fd' function. */
+#undef HAVE_RICHACL_GET_FD
+
+/* Define to 1 if you have the `richacl_get_file' function. */
+#undef HAVE_RICHACL_GET_FILE
+
+/* Define to 1 if you have the `richacl_set_fd' function. */
+#undef HAVE_RICHACL_SET_FD
+
+/* Define to 1 if you have the `richacl_set_file' function. */
+#undef HAVE_RICHACL_SET_FILE
+
/* Define to 1 if you have the <ripemd.h> header file. */
#undef HAVE_RIPEMD_H
@@ -681,6 +881,9 @@
/* Define to 1 if you have the `setlocale' function. */
#undef HAVE_SETLOCALE
+/* Define to 1 if you have the `setxattr' function. */
+#undef HAVE_SETXATTR
+
/* Define to 1 if you have the <sha256.h> header file. */
#undef HAVE_SHA256_H
@@ -745,6 +948,12 @@
/* Define to 1 if you have the `strrchr' function. */
#undef HAVE_STRRCHR
+/* Define to 1 if the system has the type `struct richace'. */
+#undef HAVE_STRUCT_RICHACE
+
+/* Define to 1 if the system has the type `struct richacl'. */
+#undef HAVE_STRUCT_RICHACL
+
/* Define to 1 if `f_namemax' is a member of `struct statfs'. */
#undef HAVE_STRUCT_STATFS_F_NAMEMAX
@@ -784,6 +993,12 @@
/* Define to 1 if `__tm_gmtoff' is a member of `struct tm'. */
#undef HAVE_STRUCT_TM___TM_GMTOFF
+/* Define to 1 if the system has the type `struct vfsconf'. */
+#undef HAVE_STRUCT_VFSCONF
+
+/* Define to 1 if the system has the type `struct xvfsconf'. */
+#undef HAVE_STRUCT_XVFSCONF
+
/* Define to 1 if you have the `symlink' function. */
#undef HAVE_SYMLINK
@@ -822,6 +1037,9 @@
/* Define to 1 if you have the <sys/poll.h> header file. */
#undef HAVE_SYS_POLL_H
+/* Define to 1 if you have the <sys/richacl.h> header file. */
+#undef HAVE_SYS_RICHACL_H
+
/* Define to 1 if you have the <sys/select.h> header file. */
#undef HAVE_SYS_SELECT_H
@@ -942,6 +1160,9 @@
/* Define to 1 if you have a working EXT2_IOC_GETFLAGS */
#undef HAVE_WORKING_EXT2_IOC_GETFLAGS
+/* Define to 1 if you have a working FS_IOC_GETFLAGS */
+#undef HAVE_WORKING_FS_IOC_GETFLAGS
+
/* Define to 1 if you have the <zlib.h> header file. */
#undef HAVE_ZLIB_H
@@ -973,8 +1194,7 @@
slash. */
#undef LSTAT_FOLLOWS_SLASHED_SYMLINK
-/* Define to the sub-directory in which libtool stores uninstalled libraries.
- */
+/* Define to the sub-directory where libtool stores uninstalled libraries. */
#undef LT_OBJDIR
/* Define to 1 if `major', `minor', and `makedev' are declared in <mkdev.h>.
Modified: trunk/contrib/libarchive/configure
===================================================================
--- trunk/contrib/libarchive/configure 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/configure 2018-06-19 20:42:35 UTC (rev 11134)
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for libarchive 3.2.1.
+# Generated by GNU Autoconf 2.69 for libarchive 3.3.2.
#
# Report bugs to <libarchive-discuss at googlegroups.com>.
#
@@ -590,8 +590,8 @@
# Identity of this package.
PACKAGE_NAME='libarchive'
PACKAGE_TARNAME='libarchive'
-PACKAGE_VERSION='3.2.1'
-PACKAGE_STRING='libarchive 3.2.1'
+PACKAGE_VERSION='3.3.2'
+PACKAGE_STRING='libarchive 3.3.2'
PACKAGE_BUGREPORT='libarchive-discuss at googlegroups.com'
PACKAGE_URL=''
@@ -635,6 +635,14 @@
ac_subst_vars='am__EXEEXT_FALSE
am__EXEEXT_TRUE
LTLIBOBJS
+INC_FREEBSD_ACL_FALSE
+INC_FREEBSD_ACL_TRUE
+INC_DARWIN_ACL_FALSE
+INC_DARWIN_ACL_TRUE
+INC_SUNOS_ACL_FALSE
+INC_SUNOS_ACL_TRUE
+INC_LINUX_ACL_FALSE
+INC_LINUX_ACL_TRUE
LIBOBJS
LIBXML2_PC_LIBS
LIBXML2_PC_CFLAGS
@@ -655,6 +663,7 @@
STATIC_BSDTAR_TRUE
BUILD_BSDTAR_FALSE
BUILD_BSDTAR_TRUE
+LT_SYS_LIBRARY_PATH
OTOOL64
OTOOL
LIPO
@@ -714,6 +723,9 @@
BSDTAR_VERSION_STRING
BSDCPIO_VERSION_STRING
ARCHIVE_LIBTOOL_VERSION
+MAINT
+MAINTAINER_MODE_FALSE
+MAINTAINER_MODE_TRUE
AM_BACKSLASH
AM_DEFAULT_VERBOSITY
AM_DEFAULT_V
@@ -760,6 +772,7 @@
docdir
oldincludedir
includedir
+runstatedir
localstatedir
sharedstatedir
sysconfdir
@@ -783,11 +796,13 @@
ac_user_opts='
enable_option_checking
enable_silent_rules
+enable_maintainer_mode
enable_dependency_tracking
enable_shared
enable_static
with_pic
enable_fast_install
+with_aix_soname
with_gnu_ld
with_sysroot
enable_libtool_lock
@@ -796,7 +811,6 @@
enable_bsdcpio
with_zlib
with_bz2lib
-with_lzmadec
with_iconv
enable_rpath
with_libiconv_prefix
@@ -803,6 +817,7 @@
with_lz4
with_lzma
with_lzo2
+with_cng
with_nettle
with_openssl
with_xml2
@@ -821,6 +836,7 @@
LIBS
CPPFLAGS
CPP
+LT_SYS_LIBRARY_PATH
PKG_CONFIG
PKG_CONFIG_PATH
PKG_CONFIG_LIBDIR
@@ -864,6 +880,7 @@
sysconfdir='${prefix}/etc'
sharedstatedir='${prefix}/com'
localstatedir='${prefix}/var'
+runstatedir='${localstatedir}/run'
includedir='${prefix}/include'
oldincludedir='/usr/include'
docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
@@ -1116,6 +1133,15 @@
| -silent | --silent | --silen | --sile | --sil)
silent=yes ;;
+ -runstatedir | --runstatedir | --runstatedi | --runstated \
+ | --runstate | --runstat | --runsta | --runst | --runs \
+ | --run | --ru | --r)
+ ac_prev=runstatedir ;;
+ -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
+ | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
+ | --run=* | --ru=* | --r=*)
+ runstatedir=$ac_optarg ;;
+
-sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
ac_prev=sbindir ;;
-sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
@@ -1253,7 +1279,7 @@
for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \
datadir sysconfdir sharedstatedir localstatedir includedir \
oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
- libdir localedir mandir
+ libdir localedir mandir runstatedir
do
eval ac_val=\$$ac_var
# Remove trailing slashes.
@@ -1366,7 +1392,7 @@
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures libarchive 3.2.1 to adapt to many kinds of systems.
+\`configure' configures libarchive 3.3.2 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1406,6 +1432,7 @@
--sysconfdir=DIR read-only single-machine data [PREFIX/etc]
--sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com]
--localstatedir=DIR modifiable single-machine data [PREFIX/var]
+ --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run]
--libdir=DIR object code libraries [EPREFIX/lib]
--includedir=DIR C header files [PREFIX/include]
--oldincludedir=DIR C header files for non-gcc [/usr/include]
@@ -1436,7 +1463,7 @@
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of libarchive 3.2.1:";;
+ short | recursive ) echo "Configuration of libarchive 3.3.2:";;
esac
cat <<\_ACEOF
@@ -1446,6 +1473,9 @@
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
--enable-silent-rules less verbose build output (undo: "make V=1")
--disable-silent-rules verbose build output (undo: "make V=0")
+ --disable-maintainer-mode
+ disable make rules and dependencies not useful (and
+ sometimes confusing) to the casual installer
--enable-dependency-tracking
do not reject slow dependency extractors
--disable-dependency-tracking
@@ -1488,12 +1518,14 @@
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
--with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use
both]
+ --with-aix-soname=aix|svr4|both
+ shared library versioning (aka "SONAME") variant to
+ provide on AIX, [default=aix].
--with-gnu-ld assume the C compiler uses GNU ld [default=no]
- --with-sysroot=DIR Search for dependent libraries within DIR
- (or the compiler's sysroot if not specified).
+ --with-sysroot[=DIR] Search for dependent libraries within DIR (or the
+ compiler's sysroot if not specified).
--without-zlib Don't build support for gzip through zlib
--without-bz2lib Don't build support for bzip2 through bz2lib
- --without-lzmadec Don't build support for lzma through lzmadec
--without-iconv Don't try to link against iconv
--with-gnu-ld assume the C compiler uses GNU ld default=no
--with-libiconv-prefix[=DIR] search for libiconv in DIR/include and DIR/lib
@@ -1500,7 +1532,8 @@
--without-libiconv-prefix don't search for libiconv in includedir and libdir
--without-lz4 Don't build support for lz4 through liblz4
--without-lzma Don't build support for xz through lzma
- --without-lzo2 Don't build support for lzop through liblzo2
+ --with-lzo2 Build with LZO support from liblzo2
+ --without-cng Don't build support of CNG(Crypto Next Generation)
--without-nettle Don't build with crypto support from Nettle
--without-openssl Don't build support for mtree and xar hashes through
openssl
@@ -1516,6 +1549,8 @@
CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
you have headers in a nonstandard directory <include dir>
CPP C preprocessor
+ LT_SYS_LIBRARY_PATH
+ User-defined run-time library search path.
PKG_CONFIG path to pkg-config utility
PKG_CONFIG_PATH
directories to add to pkg-config's search path
@@ -1592,7 +1627,7 @@
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-libarchive configure 3.2.1
+libarchive configure 3.3.2
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -2431,7 +2466,7 @@
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by libarchive $as_me 3.2.1, which was
+It was created by libarchive $as_me 3.3.2, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -3300,7 +3335,7 @@
# Define the identity of the package.
PACKAGE='libarchive'
- VERSION='3.2.1'
+ VERSION='3.3.2'
cat >>confdefs.h <<_ACEOF
@@ -3393,6 +3428,29 @@
fi
fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5
+$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; }
+ # Check whether --enable-maintainer-mode was given.
+if test "${enable_maintainer_mode+set}" = set; then :
+ enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval
+else
+ USE_MAINTAINER_MODE=yes
+fi
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5
+$as_echo "$USE_MAINTAINER_MODE" >&6; }
+ if test $USE_MAINTAINER_MODE = yes; then
+ MAINTAINER_MODE_TRUE=
+ MAINTAINER_MODE_FALSE='#'
+else
+ MAINTAINER_MODE_TRUE='#'
+ MAINTAINER_MODE_FALSE=
+fi
+
+ MAINT=$MAINTAINER_MODE_TRUE
+
+
# Check whether --enable-silent-rules was given.
if test "${enable_silent_rules+set}" = set; then :
enableval=$enable_silent_rules;
@@ -3437,7 +3495,7 @@
# Libtool interface version bumps on any API change, so increments
# whenever libarchive minor version does.
-ARCHIVE_MINOR=$(( (3002001 / 1000) % 1000 ))
+ARCHIVE_MINOR=$(( (3003002 / 1000) % 1000 ))
# Libarchive 2.7 == libtool interface 9 = 2 + 7
# Libarchive 2.8 == libtool interface 10 = 2 + 8
# Libarchive 2.9 == libtool interface 11 = 2 + 8
@@ -3445,37 +3503,37 @@
# Libarchive 3.1 == libtool interface 13
ARCHIVE_INTERFACE=`echo $((13 + ${ARCHIVE_MINOR}))`
# Libarchive revision is bumped on any source change === libtool revision
-ARCHIVE_REVISION=$(( 3002001 % 1000 ))
+ARCHIVE_REVISION=$(( 3003002 % 1000 ))
# Libarchive minor is bumped on any interface addition === libtool age
ARCHIVE_LIBTOOL_VERSION=$ARCHIVE_INTERFACE:$ARCHIVE_REVISION:$ARCHIVE_MINOR
# Stick the version numbers into config.h
-$as_echo "#define LIBARCHIVE_VERSION_STRING \"3.2.1\"" >>confdefs.h
+$as_echo "#define LIBARCHIVE_VERSION_STRING \"3.3.2\"" >>confdefs.h
cat >>confdefs.h <<_ACEOF
-#define LIBARCHIVE_VERSION_NUMBER "3002001"
+#define LIBARCHIVE_VERSION_NUMBER "3003002"
_ACEOF
-$as_echo "#define BSDCPIO_VERSION_STRING \"3.2.1\"" >>confdefs.h
+$as_echo "#define BSDCPIO_VERSION_STRING \"3.3.2\"" >>confdefs.h
-$as_echo "#define BSDTAR_VERSION_STRING \"3.2.1\"" >>confdefs.h
+$as_echo "#define BSDTAR_VERSION_STRING \"3.3.2\"" >>confdefs.h
-$as_echo "#define BSDCAT_VERSION_STRING \"3.2.1\"" >>confdefs.h
+$as_echo "#define BSDCAT_VERSION_STRING \"3.3.2\"" >>confdefs.h
# The shell variables here must be the same as the AC_SUBST() variables
# below, but the shell variable names apparently cannot be the same as
# the m4 macro names above. Why? Ask autoconf.
-BSDCPIO_VERSION_STRING=3.2.1
-BSDTAR_VERSION_STRING=3.2.1
-BSDCAT_VERSION_STRING=3.2.1
-LIBARCHIVE_VERSION_STRING=3.2.1
-LIBARCHIVE_VERSION_NUMBER=3002001
+BSDCPIO_VERSION_STRING=3.3.2
+BSDTAR_VERSION_STRING=3.3.2
+BSDCAT_VERSION_STRING=3.3.2
+LIBARCHIVE_VERSION_STRING=3.3.2
+LIBARCHIVE_VERSION_NUMBER=3003002
# Substitute the above version numbers into the various files below.
# Yes, I believe this is the fourth time we define what are essentially
@@ -3571,7 +3629,7 @@
inc_cygwin_files=no
case "$host_os" in
*mingw* ) inc_windows_files=yes ;;
- *cygwin*) inc_cygwin_files=yes ;;
+ *cygwin* | *msys*) inc_cygwin_files=yes ;;
esac
if test $inc_windows_files = yes; then
INC_WINDOWS_FILES_TRUE=
@@ -5407,8 +5465,8 @@
-macro_version='2.4.2'
-macro_revision='1.3337'
+macro_version='2.4.6'
+macro_revision='2.4.6'
@@ -5422,7 +5480,7 @@
-ltmain="$ac_aux_dir/ltmain.sh"
+ltmain=$ac_aux_dir/ltmain.sh
# Backslashify metacharacters that are still active within
# double-quoted strings.
@@ -5471,7 +5529,7 @@
$ECHO ""
}
-case "$ECHO" in
+case $ECHO in
printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5
$as_echo "printf" >&6; } ;;
print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5
@@ -5664,19 +5722,19 @@
# Check whether --with-gnu-ld was given.
if test "${with_gnu_ld+set}" = set; then :
- withval=$with_gnu_ld; test "$withval" = no || with_gnu_ld=yes
+ withval=$with_gnu_ld; test no = "$withval" || with_gnu_ld=yes
else
with_gnu_ld=no
fi
ac_prog=ld
-if test "$GCC" = yes; then
+if test yes = "$GCC"; then
# Check if gcc -print-prog-name=ld gives a path.
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5
$as_echo_n "checking for ld used by $CC... " >&6; }
case $host in
*-*-mingw*)
- # gcc leaves a trailing carriage return which upsets mingw
+ # gcc leaves a trailing carriage return, which upsets mingw
ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
*)
ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
@@ -5690,7 +5748,7 @@
while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
done
- test -z "$LD" && LD="$ac_prog"
+ test -z "$LD" && LD=$ac_prog
;;
"")
# If it fails, then pretend we aren't using GCC.
@@ -5701,7 +5759,7 @@
with_gnu_ld=unknown
;;
esac
-elif test "$with_gnu_ld" = yes; then
+elif test yes = "$with_gnu_ld"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
$as_echo_n "checking for GNU ld... " >&6; }
else
@@ -5712,32 +5770,32 @@
$as_echo_n "(cached) " >&6
else
if test -z "$LD"; then
- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
for ac_dir in $PATH; do
- IFS="$lt_save_ifs"
+ IFS=$lt_save_ifs
test -z "$ac_dir" && ac_dir=.
if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
- lt_cv_path_LD="$ac_dir/$ac_prog"
+ lt_cv_path_LD=$ac_dir/$ac_prog
# Check to see if the program is GNU ld. I'd rather use --version,
# but apparently some variants of GNU ld only accept -v.
# Break only if it was the GNU/non-GNU ld that we prefer.
case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
*GNU* | *'with BFD'*)
- test "$with_gnu_ld" != no && break
+ test no != "$with_gnu_ld" && break
;;
*)
- test "$with_gnu_ld" != yes && break
+ test yes != "$with_gnu_ld" && break
;;
esac
fi
done
- IFS="$lt_save_ifs"
+ IFS=$lt_save_ifs
else
- lt_cv_path_LD="$LD" # Let the user override the test with a path.
+ lt_cv_path_LD=$LD # Let the user override the test with a path.
fi
fi
-LD="$lt_cv_path_LD"
+LD=$lt_cv_path_LD
if test -n "$LD"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
$as_echo "$LD" >&6; }
@@ -5780,33 +5838,38 @@
else
if test -n "$NM"; then
# Let the user override the test.
- lt_cv_path_NM="$NM"
+ lt_cv_path_NM=$NM
else
- lt_nm_to_check="${ac_tool_prefix}nm"
+ lt_nm_to_check=${ac_tool_prefix}nm
if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
lt_nm_to_check="$lt_nm_to_check nm"
fi
for lt_tmp_nm in $lt_nm_to_check; do
- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
- IFS="$lt_save_ifs"
+ IFS=$lt_save_ifs
test -z "$ac_dir" && ac_dir=.
- tmp_nm="$ac_dir/$lt_tmp_nm"
- if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+ tmp_nm=$ac_dir/$lt_tmp_nm
+ if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext"; then
# Check to see if the nm accepts a BSD-compat flag.
- # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+ # Adding the 'sed 1q' prevents false positives on HP-UX, which says:
# nm: unknown option "B" ignored
# Tru64's nm complains that /dev/null is an invalid object file
- case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
- */dev/null* | *'Invalid file or object type'*)
+ # MSYS converts /dev/null to NUL, MinGW nm treats NUL as empty
+ case $build_os in
+ mingw*) lt_bad_file=conftest.nm/nofile ;;
+ *) lt_bad_file=/dev/null ;;
+ esac
+ case `"$tmp_nm" -B $lt_bad_file 2>&1 | sed '1q'` in
+ *$lt_bad_file* | *'Invalid file or object type'*)
lt_cv_path_NM="$tmp_nm -B"
- break
+ break 2
;;
*)
case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
*/dev/null*)
lt_cv_path_NM="$tmp_nm -p"
- break
+ break 2
;;
*)
lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
@@ -5817,7 +5880,7 @@
esac
fi
done
- IFS="$lt_save_ifs"
+ IFS=$lt_save_ifs
done
: ${lt_cv_path_NM=no}
fi
@@ -5824,8 +5887,8 @@
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5
$as_echo "$lt_cv_path_NM" >&6; }
-if test "$lt_cv_path_NM" != "no"; then
- NM="$lt_cv_path_NM"
+if test no != "$lt_cv_path_NM"; then
+ NM=$lt_cv_path_NM
else
# Didn't find any BSD compatible name lister, look for dumpbin.
if test -n "$DUMPBIN"; then :
@@ -5931,9 +5994,9 @@
fi
fi
- case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
+ case `$DUMPBIN -symbols -headers /dev/null 2>&1 | sed '1q'` in
*COFF*)
- DUMPBIN="$DUMPBIN -symbols"
+ DUMPBIN="$DUMPBIN -symbols -headers"
;;
*)
DUMPBIN=:
@@ -5941,8 +6004,8 @@
esac
fi
- if test "$DUMPBIN" != ":"; then
- NM="$DUMPBIN"
+ if test : != "$DUMPBIN"; then
+ NM=$DUMPBIN
fi
fi
test -z "$NM" && NM=nm
@@ -5993,7 +6056,7 @@
$as_echo_n "(cached) " >&6
else
i=0
- teststring="ABCD"
+ teststring=ABCD
case $build_os in
msdosdjgpp*)
@@ -6033,7 +6096,7 @@
lt_cv_sys_max_cmd_len=8192;
;;
- netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
+ bitrig* | darwin* | dragonfly* | freebsd* | netbsd* | openbsd*)
# This has been around since 386BSD, at least. Likely further.
if test -x /sbin/sysctl; then
lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
@@ -6084,13 +6147,13 @@
*)
lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
if test -n "$lt_cv_sys_max_cmd_len" && \
- test undefined != "$lt_cv_sys_max_cmd_len"; then
+ test undefined != "$lt_cv_sys_max_cmd_len"; then
lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
else
# Make teststring a little bigger before we do anything with it.
# a 1K string should be a reasonable start.
- for i in 1 2 3 4 5 6 7 8 ; do
+ for i in 1 2 3 4 5 6 7 8; do
teststring=$teststring$teststring
done
SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
@@ -6097,9 +6160,9 @@
# If test is not a shell built-in, we'll probably end up computing a
# maximum length that is only half of the actual maximum length, but
# we can't tell.
- while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \
+ while { test X`env echo "$teststring$teststring" 2>/dev/null` \
= "X$teststring$teststring"; } >/dev/null 2>&1 &&
- test $i != 17 # 1/2 MB should be enough
+ test 17 != "$i" # 1/2 MB should be enough
do
i=`expr $i + 1`
teststring=$teststring$teststring
@@ -6117,7 +6180,7 @@
fi
-if test -n $lt_cv_sys_max_cmd_len ; then
+if test -n "$lt_cv_sys_max_cmd_len"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5
$as_echo "$lt_cv_sys_max_cmd_len" >&6; }
else
@@ -6135,30 +6198,6 @@
: ${MV="mv -f"}
: ${RM="rm -f"}
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5
-$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; }
-# Try some XSI features
-xsi_shell=no
-( _lt_dummy="a/b/c"
- test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
- = c,a/b,b/c, \
- && eval 'test $(( 1 + 1 )) -eq 2 \
- && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
- && xsi_shell=yes
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5
-$as_echo "$xsi_shell" >&6; }
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5
-$as_echo_n "checking whether the shell understands \"+=\"... " >&6; }
-lt_shell_append=no
-( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \
- >/dev/null 2>&1 \
- && lt_shell_append=yes
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5
-$as_echo "$lt_shell_append" >&6; }
-
-
if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
lt_unset=unset
else
@@ -6281,13 +6320,13 @@
reload_cmds='$LD$reload_flag -o $output$reload_objs'
case $host_os in
cygwin* | mingw* | pw32* | cegcc*)
- if test "$GCC" != yes; then
+ if test yes != "$GCC"; then
reload_cmds=false
fi
;;
darwin*)
- if test "$GCC" = yes; then
- reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
+ if test yes = "$GCC"; then
+ reload_cmds='$LTCC $LTCFLAGS -nostdlib $wl-r -o $output$reload_objs'
else
reload_cmds='$LD$reload_flag -o $output$reload_objs'
fi
@@ -6412,13 +6451,13 @@
# Need to set the preceding variable on all platforms that support
# interlibrary dependencies.
# 'none' -- dependencies not supported.
-# `unknown' -- same as none, but documents that we really don't know.
+# 'unknown' -- same as none, but documents that we really don't know.
# 'pass_all' -- all dependencies passed with no checks.
# 'test_compile' -- check by making test program.
# 'file_magic [[regex]]' -- check by looking for files in library path
-# which responds to the $file_magic_cmd with a given extended regex.
-# If you have `file' or equivalent on your system and you're not sure
-# whether `pass_all' will *always* work, you probably want this one.
+# that responds to the $file_magic_cmd with a given extended regex.
+# If you have 'file' or equivalent on your system and you're not sure
+# whether 'pass_all' will *always* work, you probably want this one.
case $host_os in
aix[4-9]*)
@@ -6445,8 +6484,7 @@
# Base MSYS/MinGW do not provide the 'file' command needed by
# func_win32_libid shell function, so use a weaker test based on 'objdump',
# unless we find 'file', for example because we are cross-compiling.
- # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
- if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
+ if ( file / ) >/dev/null 2>&1; then
lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
lt_cv_file_magic_cmd='func_win32_libid'
else
@@ -6542,8 +6580,8 @@
lt_cv_deplibs_check_method=pass_all
;;
-openbsd*)
- if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+openbsd* | bitrig*)
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$'
else
lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
@@ -6596,6 +6634,9 @@
tpf*)
lt_cv_deplibs_check_method=pass_all
;;
+os2*)
+ lt_cv_deplibs_check_method=pass_all
+ ;;
esac
fi
@@ -6750,8 +6791,8 @@
case $host_os in
cygwin* | mingw* | pw32* | cegcc*)
- # two different shell functions defined in ltmain.sh
- # decide which to use based on capabilities of $DLLTOOL
+ # two different shell functions defined in ltmain.sh;
+ # decide which one to use based on capabilities of $DLLTOOL
case `$DLLTOOL --help 2>&1` in
*--identify-strict*)
lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
@@ -6763,7 +6804,7 @@
;;
*)
# fallback: assume linklib IS sharedlib
- lt_cv_sharedlib_from_linklib_cmd="$ECHO"
+ lt_cv_sharedlib_from_linklib_cmd=$ECHO
;;
esac
@@ -6917,7 +6958,7 @@
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }
- if test "$ac_status" -eq 0; then
+ if test 0 -eq "$ac_status"; then
# Ensure the archiver fails upon bogus file names.
rm -f conftest.$ac_objext libconftest.a
{ { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
@@ -6925,7 +6966,7 @@
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }
- if test "$ac_status" -ne 0; then
+ if test 0 -ne "$ac_status"; then
lt_cv_ar_at_file=@
fi
fi
@@ -6938,7 +6979,7 @@
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5
$as_echo "$lt_cv_ar_at_file" >&6; }
-if test "x$lt_cv_ar_at_file" = xno; then
+if test no = "$lt_cv_ar_at_file"; then
archiver_list_spec=
else
archiver_list_spec=$lt_cv_ar_at_file
@@ -7155,7 +7196,7 @@
if test -n "$RANLIB"; then
case $host_os in
- openbsd*)
+ bitrig* | openbsd*)
old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
;;
*)
@@ -7245,7 +7286,7 @@
symcode='[ABCDGISTW]'
;;
hpux*)
- if test "$host_cpu" = ia64; then
+ if test ia64 = "$host_cpu"; then
symcode='[ABCDEGRST]'
fi
;;
@@ -7278,15 +7319,45 @@
symcode='[ABCDGIRSTW]' ;;
esac
+if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+ # Gets list of data symbols to import.
+ lt_cv_sys_global_symbol_to_import="sed -n -e 's/^I .* \(.*\)$/\1/p'"
+ # Adjust the below global symbol transforms to fixup imported variables.
+ lt_cdecl_hook=" -e 's/^I .* \(.*\)$/extern __declspec(dllimport) char \1;/p'"
+ lt_c_name_hook=" -e 's/^I .* \(.*\)$/ {\"\1\", (void *) 0},/p'"
+ lt_c_name_lib_hook="\
+ -e 's/^I .* \(lib.*\)$/ {\"\1\", (void *) 0},/p'\
+ -e 's/^I .* \(.*\)$/ {\"lib\1\", (void *) 0},/p'"
+else
+ # Disable hooks by default.
+ lt_cv_sys_global_symbol_to_import=
+ lt_cdecl_hook=
+ lt_c_name_hook=
+ lt_c_name_lib_hook=
+fi
+
# Transform an extracted symbol line into a proper C declaration.
# Some systems (esp. on ia64) link data and code symbols differently,
# so use this general approach.
-lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+lt_cv_sys_global_symbol_to_cdecl="sed -n"\
+$lt_cdecl_hook\
+" -e 's/^T .* \(.*\)$/extern int \1();/p'"\
+" -e 's/^$symcode$symcode* .* \(.*\)$/extern char \1;/p'"
# Transform an extracted symbol line into symbol name and symbol address
-lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'"
-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'"
+lt_cv_sys_global_symbol_to_c_name_address="sed -n"\
+$lt_c_name_hook\
+" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\
+" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/p'"
+# Transform an extracted symbol line into symbol name with lib prefix and
+# symbol address.
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n"\
+$lt_c_name_lib_hook\
+" -e 's/^: \(.*\) .*$/ {\"\1\", (void *) 0},/p'"\
+" -e 's/^$symcode$symcode* .* \(lib.*\)$/ {\"\1\", (void *) \&\1},/p'"\
+" -e 's/^$symcode$symcode* .* \(.*\)$/ {\"lib\1\", (void *) \&\1},/p'"
+
# Handle CRLF in mingw tool chain
opt_cr=
case $build_os in
@@ -7303,8 +7374,8 @@
# Write the raw and C identifiers.
if test "$lt_cv_nm_interface" = "MS dumpbin"; then
- # Fake it for dumpbin and say T for any non-static function
- # and D for any global variable.
+ # Fake it for dumpbin and say T for any non-static function,
+ # D for any global variable and I for any imported variable.
# Also find C++ and __fastcall symbols from MSVC++,
# which start with @ or ?.
lt_cv_sys_global_symbol_pipe="$AWK '"\
@@ -7311,13 +7382,16 @@
" {last_section=section; section=\$ 3};"\
" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
+" /^ *Symbol name *: /{split(\$ 0,sn,\":\"); si=substr(sn[2],2)};"\
+" /^ *Type *: code/{print \"T\",si,substr(si,length(prfx))};"\
+" /^ *Type *: data/{print \"I\",si,substr(si,length(prfx))};"\
" \$ 0!~/External *\|/{next};"\
" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
" {if(hide[section]) next};"\
-" {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
-" {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
-" s[1]~/^[@?]/{print s[1], s[1]; next};"\
-" s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
+" {f=\"D\"}; \$ 0~/\(\).*\|/{f=\"T\"};"\
+" {split(\$ 0,a,/\||\r/); split(a[2],s)};"\
+" s[1]~/^[@?]/{print f,s[1],s[1]; next};"\
+" s[1]~prfx {split(s[1],t,\"@\"); print f,t[1],substr(t[1],length(prfx))}"\
" ' prfx=^$ac_symprfx"
else
lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
@@ -7365,11 +7439,11 @@
if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
cat <<_LT_EOF > conftest.$ac_ext
/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
-#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
-/* DATA imports from DLLs on WIN32 con't be const, because runtime
+#if defined _WIN32 || defined __CYGWIN__ || defined _WIN32_WCE
+/* DATA imports from DLLs on WIN32 can't be const, because runtime
relocations are performed -- see ld's documentation on pseudo-relocs. */
# define LT_DLSYM_CONST
-#elif defined(__osf__)
+#elif defined __osf__
/* This system does not cope well with relocations in const data. */
# define LT_DLSYM_CONST
#else
@@ -7395,7 +7469,7 @@
{
{ "@PROGRAM@", (void *) 0 },
_LT_EOF
- $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/ {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
+ $SED "s/^$symcode$symcode* .* \(.*\)$/ {\"\1\", (void *) \&\1},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
cat <<\_LT_EOF >> conftest.$ac_ext
{0, (void *) 0}
};
@@ -7415,13 +7489,13 @@
mv conftest.$ac_objext conftstm.$ac_objext
lt_globsym_save_LIBS=$LIBS
lt_globsym_save_CFLAGS=$CFLAGS
- LIBS="conftstm.$ac_objext"
+ LIBS=conftstm.$ac_objext
CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
(eval $ac_link) 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } && test -s conftest${ac_exeext}; then
+ test $ac_status = 0; } && test -s conftest$ac_exeext; then
pipe_works=yes
fi
LIBS=$lt_globsym_save_LIBS
@@ -7442,7 +7516,7 @@
rm -rf conftest* conftst*
# Do not use the global_symbol_pipe unless it works.
- if test "$pipe_works" = yes; then
+ if test yes = "$pipe_works"; then
break
else
lt_cv_sys_global_symbol_pipe=
@@ -7495,6 +7569,16 @@
+
+
+
+
+
+
+
+
+
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
$as_echo_n "checking for sysroot... " >&6; }
@@ -7507,9 +7591,9 @@
lt_sysroot=
-case ${with_sysroot} in #(
+case $with_sysroot in #(
yes)
- if test "$GCC" = yes; then
+ if test yes = "$GCC"; then
lt_sysroot=`$CC --print-sysroot 2>/dev/null`
fi
;; #(
@@ -7519,8 +7603,8 @@
no|'')
;; #(
*)
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5
-$as_echo "${with_sysroot}" >&6; }
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_sysroot" >&5
+$as_echo "$with_sysroot" >&6; }
as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5
;;
esac
@@ -7532,18 +7616,99 @@
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a working dd" >&5
+$as_echo_n "checking for a working dd... " >&6; }
+if ${ac_cv_path_lt_DD+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ printf 0123456789abcdef0123456789abcdef >conftest.i
+cat conftest.i conftest.i >conftest2.i
+: ${lt_DD:=$DD}
+if test -z "$lt_DD"; then
+ ac_path_lt_DD_found=false
+ # Loop through the user's path and test for each of PROGNAME-LIST
+ as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_prog in dd; do
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ ac_path_lt_DD="$as_dir/$ac_prog$ac_exec_ext"
+ as_fn_executable_p "$ac_path_lt_DD" || continue
+if "$ac_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
+ cmp -s conftest.i conftest.out \
+ && ac_cv_path_lt_DD="$ac_path_lt_DD" ac_path_lt_DD_found=:
+fi
+ $ac_path_lt_DD_found && break 3
+ done
+ done
+ done
+IFS=$as_save_IFS
+ if test -z "$ac_cv_path_lt_DD"; then
+ :
+ fi
+else
+ ac_cv_path_lt_DD=$lt_DD
+fi
+
+rm -f conftest.i conftest2.i conftest.out
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_lt_DD" >&5
+$as_echo "$ac_cv_path_lt_DD" >&6; }
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to truncate binary pipes" >&5
+$as_echo_n "checking how to truncate binary pipes... " >&6; }
+if ${lt_cv_truncate_bin+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ printf 0123456789abcdef0123456789abcdef >conftest.i
+cat conftest.i conftest.i >conftest2.i
+lt_cv_truncate_bin=
+if "$ac_cv_path_lt_DD" bs=32 count=1 <conftest2.i >conftest.out 2>/dev/null; then
+ cmp -s conftest.i conftest.out \
+ && lt_cv_truncate_bin="$ac_cv_path_lt_DD bs=4096 count=1"
+fi
+rm -f conftest.i conftest2.i conftest.out
+test -z "$lt_cv_truncate_bin" && lt_cv_truncate_bin="$SED -e 4q"
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_truncate_bin" >&5
+$as_echo "$lt_cv_truncate_bin" >&6; }
+
+
+
+
+
+
+
+# Calculate cc_basename. Skip known compiler wrappers and cross-prefix.
+func_cc_basename ()
+{
+ for cc_temp in $*""; do
+ case $cc_temp in
+ compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+ distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+ \-*) ;;
+ *) break;;
+ esac
+ done
+ func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+}
+
# Check whether --enable-libtool-lock was given.
if test "${enable_libtool_lock+set}" = set; then :
enableval=$enable_libtool_lock;
fi
-test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+test no = "$enable_libtool_lock" || enable_libtool_lock=yes
# Some flags need to be propagated to the compiler or linker for good
# libtool support.
case $host in
ia64-*-hpux*)
- # Find out which ABI we are using.
+ # Find out what ABI is being produced by ac_compile, and set mode
+ # options accordingly.
echo 'int i;' > conftest.$ac_ext
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
(eval $ac_compile) 2>&5
@@ -7552,10 +7717,10 @@
test $ac_status = 0; }; then
case `/usr/bin/file conftest.$ac_objext` in
*ELF-32*)
- HPUX_IA64_MODE="32"
+ HPUX_IA64_MODE=32
;;
*ELF-64*)
- HPUX_IA64_MODE="64"
+ HPUX_IA64_MODE=64
;;
esac
fi
@@ -7562,7 +7727,8 @@
rm -rf conftest*
;;
*-*-irix6*)
- # Find out which ABI we are using.
+ # Find out what ABI is being produced by ac_compile, and set linker
+ # options accordingly.
echo '#line '$LINENO' "configure"' > conftest.$ac_ext
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
(eval $ac_compile) 2>&5
@@ -7569,7 +7735,7 @@
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
test $ac_status = 0; }; then
- if test "$lt_cv_prog_gnu_ld" = yes; then
+ if test yes = "$lt_cv_prog_gnu_ld"; then
case `/usr/bin/file conftest.$ac_objext` in
*32-bit*)
LD="${LD-ld} -melf32bsmip"
@@ -7598,9 +7764,50 @@
rm -rf conftest*
;;
+mips64*-*linux*)
+ # Find out what ABI is being produced by ac_compile, and set linker
+ # options accordingly.
+ echo '#line '$LINENO' "configure"' > conftest.$ac_ext
+ if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+ (eval $ac_compile) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }; then
+ emul=elf
+ case `/usr/bin/file conftest.$ac_objext` in
+ *32-bit*)
+ emul="${emul}32"
+ ;;
+ *64-bit*)
+ emul="${emul}64"
+ ;;
+ esac
+ case `/usr/bin/file conftest.$ac_objext` in
+ *MSB*)
+ emul="${emul}btsmip"
+ ;;
+ *LSB*)
+ emul="${emul}ltsmip"
+ ;;
+ esac
+ case `/usr/bin/file conftest.$ac_objext` in
+ *N32*)
+ emul="${emul}n32"
+ ;;
+ esac
+ LD="${LD-ld} -m $emul"
+ fi
+ rm -rf conftest*
+ ;;
+
x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \
s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
- # Find out which ABI we are using.
+ # Find out what ABI is being produced by ac_compile, and set linker
+ # options accordingly. Note that the listed cases only cover the
+ # situations where additional linker options are needed (such as when
+ # doing 32-bit compilation for a host where ld defaults to 64-bit, or
+ # vice versa); the common cases where no linker options are needed do
+ # not appear in the list.
echo 'int i;' > conftest.$ac_ext
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
(eval $ac_compile) 2>&5
@@ -7623,10 +7830,10 @@
;;
esac
;;
- powerpc64le-*)
+ powerpc64le-*linux*)
LD="${LD-ld} -m elf32lppclinux"
;;
- powerpc64-*)
+ powerpc64-*linux*)
LD="${LD-ld} -m elf32ppclinux"
;;
s390x-*linux*)
@@ -7645,10 +7852,10 @@
x86_64-*linux*)
LD="${LD-ld} -m elf_x86_64"
;;
- powerpcle-*)
+ powerpcle-*linux*)
LD="${LD-ld} -m elf64lppc"
;;
- powerpc-*)
+ powerpc-*linux*)
LD="${LD-ld} -m elf64ppc"
;;
s390*-*linux*|s390*-*tpf*)
@@ -7666,7 +7873,7 @@
*-*-sco3.2v5*)
# On SCO OpenServer 5, we need -belf to get full-featured binaries.
- SAVE_CFLAGS="$CFLAGS"
+ SAVE_CFLAGS=$CFLAGS
CFLAGS="$CFLAGS -belf"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5
$as_echo_n "checking whether the C compiler needs -belf... " >&6; }
@@ -7706,13 +7913,14 @@
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5
$as_echo "$lt_cv_cc_needs_belf" >&6; }
- if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+ if test yes != "$lt_cv_cc_needs_belf"; then
# this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
- CFLAGS="$SAVE_CFLAGS"
+ CFLAGS=$SAVE_CFLAGS
fi
;;
*-*solaris*)
- # Find out which ABI we are using.
+ # Find out what ABI is being produced by ac_compile, and set linker
+ # options accordingly.
echo 'int i;' > conftest.$ac_ext
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
(eval $ac_compile) 2>&5
@@ -7724,7 +7932,7 @@
case $lt_cv_prog_gnu_ld in
yes*)
case $host in
- i?86-*-solaris*)
+ i?86-*-solaris*|x86_64-*-solaris*)
LD="${LD-ld} -m elf_x86_64"
;;
sparc*-*-solaris*)
@@ -7733,7 +7941,7 @@
esac
# GNU ld 2.21 introduced _sol2 emulations. Use them if available.
if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
- LD="${LD-ld}_sol2"
+ LD=${LD-ld}_sol2
fi
;;
*)
@@ -7749,7 +7957,7 @@
;;
esac
-need_locks="$enable_libtool_lock"
+need_locks=$enable_libtool_lock
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args.
@@ -7860,7 +8068,7 @@
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5
$as_echo "$lt_cv_path_mainfest_tool" >&6; }
-if test "x$lt_cv_path_mainfest_tool" != xyes; then
+if test yes != "$lt_cv_path_mainfest_tool"; then
MANIFEST_TOOL=:
fi
@@ -8363,7 +8571,7 @@
$as_echo_n "(cached) " >&6
else
lt_cv_apple_cc_single_mod=no
- if test -z "${LT_MULTI_MODULE}"; then
+ if test -z "$LT_MULTI_MODULE"; then
# By default we will add the -single_module flag. You can override
# by either setting the environment variable LT_MULTI_MODULE
# non-empty at configure time, or by adding -multi_module to the
@@ -8381,7 +8589,7 @@
cat conftest.err >&5
# Otherwise, if the output was created with a 0 exit code from
# the compiler, it worked.
- elif test -f libconftest.dylib && test $_lt_result -eq 0; then
+ elif test -f libconftest.dylib && test 0 = "$_lt_result"; then
lt_cv_apple_cc_single_mod=yes
else
cat conftest.err >&5
@@ -8420,7 +8628,7 @@
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
- LDFLAGS="$save_LDFLAGS"
+ LDFLAGS=$save_LDFLAGS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5
@@ -8449,7 +8657,7 @@
_lt_result=$?
if test -s conftest.err && $GREP force_load conftest.err; then
cat conftest.err >&5
- elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then
+ elif test -f conftest && test 0 = "$_lt_result" && $GREP forced_load conftest >/dev/null 2>&1; then
lt_cv_ld_force_load=yes
else
cat conftest.err >&5
@@ -8462,9 +8670,9 @@
$as_echo "$lt_cv_ld_force_load" >&6; }
case $host_os in
rhapsody* | darwin1.[012])
- _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
+ _lt_dar_allow_undefined='$wl-undefined ${wl}suppress' ;;
darwin1.*)
- _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+ _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
darwin*) # darwin 5.x on
# if running on 10.5 or later, the deployment target defaults
# to the OS version, if on x86, and 10.4, the deployment
@@ -8471,23 +8679,23 @@
# target defaults to 10.4. Don't you love it?
case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
10.0,*86*-darwin8*|10.0,*-darwin[91]*)
- _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
- 10.[012]*)
- _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+ _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
+ 10.[012][,.]*)
+ _lt_dar_allow_undefined='$wl-flat_namespace $wl-undefined ${wl}suppress' ;;
10.*)
- _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+ _lt_dar_allow_undefined='$wl-undefined ${wl}dynamic_lookup' ;;
esac
;;
esac
- if test "$lt_cv_apple_cc_single_mod" = "yes"; then
+ if test yes = "$lt_cv_apple_cc_single_mod"; then
_lt_dar_single_mod='$single_module'
fi
- if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
- _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
+ if test yes = "$lt_cv_ld_exported_symbols_list"; then
+ _lt_dar_export_syms=' $wl-exported_symbols_list,$output_objdir/$libname-symbols.expsym'
else
- _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
+ _lt_dar_export_syms='~$NMEDIT -s $output_objdir/$libname-symbols.expsym $lib'
fi
- if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
+ if test : != "$DSYMUTIL" && test no = "$lt_cv_ld_force_load"; then
_lt_dsymutil='~$DSYMUTIL $lib || :'
else
_lt_dsymutil=
@@ -8495,6 +8703,41 @@
;;
esac
+# func_munge_path_list VARIABLE PATH
+# -----------------------------------
+# VARIABLE is name of variable containing _space_ separated list of
+# directories to be munged by the contents of PATH, which is string
+# having a format:
+# "DIR[:DIR]:"
+# string "DIR[ DIR]" will be prepended to VARIABLE
+# ":DIR[:DIR]"
+# string "DIR[ DIR]" will be appended to VARIABLE
+# "DIRP[:DIRP]::[DIRA:]DIRA"
+# string "DIRP[ DIRP]" will be prepended to VARIABLE and string
+# "DIRA[ DIRA]" will be appended to VARIABLE
+# "DIR[:DIR]"
+# VARIABLE will be replaced by "DIR[ DIR]"
+func_munge_path_list ()
+{
+ case x$2 in
+ x)
+ ;;
+ *:)
+ eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\"
+ ;;
+ x:*)
+ eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\"
+ ;;
+ *::*)
+ eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\"
+ eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\"
+ ;;
+ *)
+ eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\"
+ ;;
+ esac
+}
+
for ac_header in dlfcn.h
do :
ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default
@@ -8529,14 +8772,14 @@
*)
enable_shared=no
# Look at the argument we got. We use all the common list separators.
- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
for pkg in $enableval; do
- IFS="$lt_save_ifs"
+ IFS=$lt_save_ifs
if test "X$pkg" = "X$p"; then
enable_shared=yes
fi
done
- IFS="$lt_save_ifs"
+ IFS=$lt_save_ifs
;;
esac
else
@@ -8560,14 +8803,14 @@
*)
enable_static=no
# Look at the argument we got. We use all the common list separators.
- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
for pkg in $enableval; do
- IFS="$lt_save_ifs"
+ IFS=$lt_save_ifs
if test "X$pkg" = "X$p"; then
enable_static=yes
fi
done
- IFS="$lt_save_ifs"
+ IFS=$lt_save_ifs
;;
esac
else
@@ -8591,14 +8834,14 @@
*)
pic_mode=default
# Look at the argument we got. We use all the common list separators.
- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
for lt_pkg in $withval; do
- IFS="$lt_save_ifs"
+ IFS=$lt_save_ifs
if test "X$lt_pkg" = "X$lt_p"; then
pic_mode=yes
fi
done
- IFS="$lt_save_ifs"
+ IFS=$lt_save_ifs
;;
esac
else
@@ -8606,7 +8849,6 @@
fi
-test -z "$pic_mode" && pic_mode=default
@@ -8613,7 +8855,6 @@
-
# Check whether --enable-fast-install was given.
if test "${enable_fast_install+set}" = set; then :
enableval=$enable_fast_install; p=${PACKAGE-default}
@@ -8623,14 +8864,14 @@
*)
enable_fast_install=no
# Look at the argument we got. We use all the common list separators.
- lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ lt_save_ifs=$IFS; IFS=$IFS$PATH_SEPARATOR,
for pkg in $enableval; do
- IFS="$lt_save_ifs"
+ IFS=$lt_save_ifs
if test "X$pkg" = "X$p"; then
enable_fast_install=yes
fi
done
- IFS="$lt_save_ifs"
+ IFS=$lt_save_ifs
;;
esac
else
@@ -8644,11 +8885,63 @@
+ shared_archive_member_spec=
+case $host,$enable_shared in
+power*-*-aix[5-9]*,yes)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking which variant of shared library versioning to provide" >&5
+$as_echo_n "checking which variant of shared library versioning to provide... " >&6; }
+# Check whether --with-aix-soname was given.
+if test "${with_aix_soname+set}" = set; then :
+ withval=$with_aix_soname; case $withval in
+ aix|svr4|both)
+ ;;
+ *)
+ as_fn_error $? "Unknown argument to --with-aix-soname" "$LINENO" 5
+ ;;
+ esac
+ lt_cv_with_aix_soname=$with_aix_soname
+else
+ if ${lt_cv_with_aix_soname+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_with_aix_soname=aix
+fi
+ with_aix_soname=$lt_cv_with_aix_soname
+fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_aix_soname" >&5
+$as_echo "$with_aix_soname" >&6; }
+ if test aix != "$with_aix_soname"; then
+ # For the AIX way of multilib, we name the shared archive member
+ # based on the bitwidth used, traditionally 'shr.o' or 'shr_64.o',
+ # and 'shr.imp' or 'shr_64.imp', respectively, for the Import File.
+ # Even when GNU compilers ignore OBJECT_MODE but need '-maix64' flag,
+ # the AIX toolchain works better with OBJECT_MODE set (default 32).
+ if test 64 = "${OBJECT_MODE-32}"; then
+ shared_archive_member_spec=shr_64
+ else
+ shared_archive_member_spec=shr
+ fi
+ fi
+ ;;
+*)
+ with_aix_soname=aix
+ ;;
+esac
+
+
+
+
+
+
+
+
+
+
# This can be used to rebuild libtool when needed
-LIBTOOL_DEPS="$ltmain"
+LIBTOOL_DEPS=$ltmain
# Always use our own libtool.
LIBTOOL='$(SHELL) $(top_builddir)/libtool'
@@ -8697,7 +8990,7 @@
-if test -n "${ZSH_VERSION+set}" ; then
+if test -n "${ZSH_VERSION+set}"; then
setopt NO_GLOB_SUBST
fi
@@ -8736,7 +9029,7 @@
# AIX sometimes has problems with the GCC collect2 program. For some
# reason, if we set the COLLECT_NAMES environment variable, the problems
# vanish in a puff of smoke.
- if test "X${COLLECT_NAMES+set}" != Xset; then
+ if test set != "${COLLECT_NAMES+set}"; then
COLLECT_NAMES=
export COLLECT_NAMES
fi
@@ -8747,14 +9040,14 @@
ofile=libtool
can_build_shared=yes
-# All known linkers require a `.a' archive for static linking (except MSVC,
+# All known linkers require a '.a' archive for static linking (except MSVC,
# which needs '.lib').
libext=a
-with_gnu_ld="$lt_cv_prog_gnu_ld"
+with_gnu_ld=$lt_cv_prog_gnu_ld
-old_CC="$CC"
-old_CFLAGS="$CFLAGS"
+old_CC=$CC
+old_CFLAGS=$CFLAGS
# Set sane defaults for various variables
test -z "$CC" && CC=cc
@@ -8763,15 +9056,8 @@
test -z "$LD" && LD=ld
test -z "$ac_objext" && ac_objext=o
-for cc_temp in $compiler""; do
- case $cc_temp in
- compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
- distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
- \-*) ;;
- *) break;;
- esac
-done
-cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+func_cc_basename $compiler
+cc_basename=$func_cc_basename_result
# Only perform the check for file, if the check method requires it
@@ -8786,22 +9072,22 @@
else
case $MAGIC_CMD in
[\\/*] | ?:[\\/]*)
- lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+ lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path.
;;
*)
- lt_save_MAGIC_CMD="$MAGIC_CMD"
- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ lt_save_MAGIC_CMD=$MAGIC_CMD
+ lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
for ac_dir in $ac_dummy; do
- IFS="$lt_save_ifs"
+ IFS=$lt_save_ifs
test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/${ac_tool_prefix}file; then
- lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file"
+ if test -f "$ac_dir/${ac_tool_prefix}file"; then
+ lt_cv_path_MAGIC_CMD=$ac_dir/"${ac_tool_prefix}file"
if test -n "$file_magic_test_file"; then
case $deplibs_check_method in
"file_magic "*)
file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
- MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+ MAGIC_CMD=$lt_cv_path_MAGIC_CMD
if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
$EGREP "$file_magic_regex" > /dev/null; then
:
@@ -8824,13 +9110,13 @@
break
fi
done
- IFS="$lt_save_ifs"
- MAGIC_CMD="$lt_save_MAGIC_CMD"
+ IFS=$lt_save_ifs
+ MAGIC_CMD=$lt_save_MAGIC_CMD
;;
esac
fi
-MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+MAGIC_CMD=$lt_cv_path_MAGIC_CMD
if test -n "$MAGIC_CMD"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
$as_echo "$MAGIC_CMD" >&6; }
@@ -8852,22 +9138,22 @@
else
case $MAGIC_CMD in
[\\/*] | ?:[\\/]*)
- lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+ lt_cv_path_MAGIC_CMD=$MAGIC_CMD # Let the user override the test with a path.
;;
*)
- lt_save_MAGIC_CMD="$MAGIC_CMD"
- lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+ lt_save_MAGIC_CMD=$MAGIC_CMD
+ lt_save_ifs=$IFS; IFS=$PATH_SEPARATOR
ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
for ac_dir in $ac_dummy; do
- IFS="$lt_save_ifs"
+ IFS=$lt_save_ifs
test -z "$ac_dir" && ac_dir=.
- if test -f $ac_dir/file; then
- lt_cv_path_MAGIC_CMD="$ac_dir/file"
+ if test -f "$ac_dir/file"; then
+ lt_cv_path_MAGIC_CMD=$ac_dir/"file"
if test -n "$file_magic_test_file"; then
case $deplibs_check_method in
"file_magic "*)
file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
- MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+ MAGIC_CMD=$lt_cv_path_MAGIC_CMD
if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
$EGREP "$file_magic_regex" > /dev/null; then
:
@@ -8890,13 +9176,13 @@
break
fi
done
- IFS="$lt_save_ifs"
- MAGIC_CMD="$lt_save_MAGIC_CMD"
+ IFS=$lt_save_ifs
+ MAGIC_CMD=$lt_save_MAGIC_CMD
;;
esac
fi
-MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+MAGIC_CMD=$lt_cv_path_MAGIC_CMD
if test -n "$MAGIC_CMD"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
$as_echo "$MAGIC_CMD" >&6; }
@@ -8917,7 +9203,7 @@
# Use C for the default configuration in the libtool script
-lt_save_CC="$CC"
+lt_save_CC=$CC
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -8975,7 +9261,7 @@
lt_prog_compiler_no_builtin_flag=
-if test "$GCC" = yes; then
+if test yes = "$GCC"; then
case $cc_basename in
nvcc*)
lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;;
@@ -8991,7 +9277,7 @@
lt_cv_prog_compiler_rtti_exceptions=no
ac_outfile=conftest.$ac_objext
echo "$lt_simple_compile_test_code" > conftest.$ac_ext
- lt_compiler_flag="-fno-rtti -fno-exceptions"
+ lt_compiler_flag="-fno-rtti -fno-exceptions" ## exclude from sc_useless_quotes_in_assignment
# Insert the option either (1) after the last *FLAGS variable, or
# (2) before a word containing "conftest.", or (3) at the end.
# Note that $ac_compile itself does not contain backslashes and begins
@@ -9021,7 +9307,7 @@
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; }
-if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
+if test yes = "$lt_cv_prog_compiler_rtti_exceptions"; then
lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions"
else
:
@@ -9039,7 +9325,7 @@
lt_prog_compiler_static=
- if test "$GCC" = yes; then
+ if test yes = "$GCC"; then
lt_prog_compiler_wl='-Wl,'
lt_prog_compiler_static='-static'
@@ -9046,10 +9332,11 @@
case $host_os in
aix*)
# All AIX code is PIC.
- if test "$host_cpu" = ia64; then
+ if test ia64 = "$host_cpu"; then
# AIX 5 now supports IA64 processor
lt_prog_compiler_static='-Bstatic'
fi
+ lt_prog_compiler_pic='-fPIC'
;;
amigaos*)
@@ -9060,8 +9347,8 @@
;;
m68k)
# FIXME: we need at least 68020 code to build shared libraries, but
- # adding the `-m68020' flag to GCC prevents building anything better,
- # like `-m68040'.
+ # adding the '-m68020' flag to GCC prevents building anything better,
+ # like '-m68040'.
lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4'
;;
esac
@@ -9077,6 +9364,11 @@
# Although the cygwin gcc ignores -fPIC, still need this for old-style
# (--disable-auto-import) libraries
lt_prog_compiler_pic='-DDLL_EXPORT'
+ case $host_os in
+ os2*)
+ lt_prog_compiler_static='$wl-static'
+ ;;
+ esac
;;
darwin* | rhapsody*)
@@ -9147,7 +9439,7 @@
case $host_os in
aix*)
lt_prog_compiler_wl='-Wl,'
- if test "$host_cpu" = ia64; then
+ if test ia64 = "$host_cpu"; then
# AIX 5 now supports IA64 processor
lt_prog_compiler_static='-Bstatic'
else
@@ -9155,10 +9447,29 @@
fi
;;
+ darwin* | rhapsody*)
+ # PIC is the default on this platform
+ # Common symbols not allowed in MH_DYLIB files
+ lt_prog_compiler_pic='-fno-common'
+ case $cc_basename in
+ nagfor*)
+ # NAG Fortran compiler
+ lt_prog_compiler_wl='-Wl,-Wl,,'
+ lt_prog_compiler_pic='-PIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
+ esac
+ ;;
+
mingw* | cygwin* | pw32* | os2* | cegcc*)
# This hack is so that the source file can tell whether it is being
# built for inclusion in a dll (and should export symbols for example).
lt_prog_compiler_pic='-DDLL_EXPORT'
+ case $host_os in
+ os2*)
+ lt_prog_compiler_static='$wl-static'
+ ;;
+ esac
;;
hpux9* | hpux10* | hpux11*)
@@ -9174,7 +9485,7 @@
;;
esac
# Is there a better lt_prog_compiler_static that works with the bundled CC?
- lt_prog_compiler_static='${wl}-a ${wl}archive'
+ lt_prog_compiler_static='$wl-a ${wl}archive'
;;
irix5* | irix6* | nonstopux*)
@@ -9185,7 +9496,7 @@
linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
case $cc_basename in
- # old Intel for x86_64 which still supported -KPIC.
+ # old Intel for x86_64, which still supported -KPIC.
ecc*)
lt_prog_compiler_wl='-Wl,'
lt_prog_compiler_pic='-KPIC'
@@ -9210,6 +9521,12 @@
lt_prog_compiler_pic='-PIC'
lt_prog_compiler_static='-Bstatic'
;;
+ tcc*)
+ # Fabrice Bellard et al's Tiny C Compiler
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-fPIC'
+ lt_prog_compiler_static='-static'
+ ;;
pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
# Portland Group compilers (*not* the Pentium gcc compiler,
# which looks to be a dead project)
@@ -9307,7 +9624,7 @@
;;
sysv4*MP*)
- if test -d /usr/nec ;then
+ if test -d /usr/nec; then
lt_prog_compiler_pic='-Kconform_pic'
lt_prog_compiler_static='-Bstatic'
fi
@@ -9336,7 +9653,7 @@
fi
case $host_os in
- # For platforms which do not support PIC, -DPIC is meaningless:
+ # For platforms that do not support PIC, -DPIC is meaningless:
*djgpp*)
lt_prog_compiler_pic=
;;
@@ -9368,7 +9685,7 @@
lt_cv_prog_compiler_pic_works=no
ac_outfile=conftest.$ac_objext
echo "$lt_simple_compile_test_code" > conftest.$ac_ext
- lt_compiler_flag="$lt_prog_compiler_pic -DPIC"
+ lt_compiler_flag="$lt_prog_compiler_pic -DPIC" ## exclude from sc_useless_quotes_in_assignment
# Insert the option either (1) after the last *FLAGS variable, or
# (2) before a word containing "conftest.", or (3) at the end.
# Note that $ac_compile itself does not contain backslashes and begins
@@ -9398,7 +9715,7 @@
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5
$as_echo "$lt_cv_prog_compiler_pic_works" >&6; }
-if test x"$lt_cv_prog_compiler_pic_works" = xyes; then
+if test yes = "$lt_cv_prog_compiler_pic_works"; then
case $lt_prog_compiler_pic in
"" | " "*) ;;
*) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;;
@@ -9430,7 +9747,7 @@
$as_echo_n "(cached) " >&6
else
lt_cv_prog_compiler_static_works=no
- save_LDFLAGS="$LDFLAGS"
+ save_LDFLAGS=$LDFLAGS
LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
echo "$lt_simple_link_test_code" > conftest.$ac_ext
if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
@@ -9449,13 +9766,13 @@
fi
fi
$RM -r conftest*
- LDFLAGS="$save_LDFLAGS"
+ LDFLAGS=$save_LDFLAGS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5
$as_echo "$lt_cv_prog_compiler_static_works" >&6; }
-if test x"$lt_cv_prog_compiler_static_works" = xyes; then
+if test yes = "$lt_cv_prog_compiler_static_works"; then
:
else
lt_prog_compiler_static=
@@ -9575,8 +9892,8 @@
-hard_links="nottested"
-if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then
+hard_links=nottested
+if test no = "$lt_cv_prog_compiler_c_o" && test no != "$need_locks"; then
# do not overwrite the value of need_locks provided by the user
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5
$as_echo_n "checking if we can lock with hard links... " >&6; }
@@ -9588,9 +9905,9 @@
ln conftest.a conftest.b 2>/dev/null && hard_links=no
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5
$as_echo "$hard_links" >&6; }
- if test "$hard_links" = no; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
-$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+ if test no = "$hard_links"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&5
+$as_echo "$as_me: WARNING: '$CC' does not support '-c -o', so 'make -j' may be unsafe" >&2;}
need_locks=warn
fi
else
@@ -9633,9 +9950,9 @@
# included in the symbol list
include_expsyms=
# exclude_expsyms can be an extended regexp of symbols to exclude
- # it will be wrapped by ` (' and `)$', so one must not match beginning or
- # end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
- # as well as any symbol that contains `d'.
+ # it will be wrapped by ' (' and ')$', so one must not match beginning or
+ # end of line. Example: 'a|bc|.*d.*' will exclude the symbols 'a' and 'bc',
+ # as well as any symbol that contains 'd'.
exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
# Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
# platforms (ab)use it in PIC code, but their linkers get confused if
@@ -9650,7 +9967,7 @@
# FIXME: the MSVC++ port hasn't been tested in a loooong time
# When not using gcc, we currently assume that we are using
# Microsoft Visual C++.
- if test "$GCC" != yes; then
+ if test yes != "$GCC"; then
with_gnu_ld=no
fi
;;
@@ -9658,7 +9975,7 @@
# we just hope/assume this is gcc and not c89 (= MSVC++)
with_gnu_ld=yes
;;
- openbsd*)
+ openbsd* | bitrig*)
with_gnu_ld=no
;;
linux* | k*bsd*-gnu | gnu*)
@@ -9671,7 +9988,7 @@
# On some targets, GNU ld is compatible enough with the native linker
# that we're better off using the native interface for both.
lt_use_gnu_ld_interface=no
- if test "$with_gnu_ld" = yes; then
+ if test yes = "$with_gnu_ld"; then
case $host_os in
aix*)
# The AIX port of GNU ld has always aspired to compatibility
@@ -9693,24 +10010,24 @@
esac
fi
- if test "$lt_use_gnu_ld_interface" = yes; then
+ if test yes = "$lt_use_gnu_ld_interface"; then
# If archive_cmds runs LD, not CC, wlarc should be empty
- wlarc='${wl}'
+ wlarc='$wl'
# Set some defaults for GNU ld with shared library support. These
# are reset later if shared libraries are not supported. Putting them
# here allows them to be overridden if necessary.
runpath_var=LD_RUN_PATH
- hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
- export_dynamic_flag_spec='${wl}--export-dynamic'
+ hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
+ export_dynamic_flag_spec='$wl--export-dynamic'
# ancient GNU ld didn't support --whole-archive et. al.
if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
- whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+ whole_archive_flag_spec=$wlarc'--whole-archive$convenience '$wlarc'--no-whole-archive'
else
whole_archive_flag_spec=
fi
supports_anon_versioning=no
- case `$LD -v 2>&1` in
+ case `$LD -v | $SED -e 's/(^)\+)\s\+//' 2>&1` in
*GNU\ gold*) supports_anon_versioning=yes ;;
*\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
*\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
@@ -9723,7 +10040,7 @@
case $host_os in
aix[3-9]*)
# On AIX/PPC, the GNU linker is very broken
- if test "$host_cpu" != ia64; then
+ if test ia64 != "$host_cpu"; then
ld_shlibs=no
cat <<_LT_EOF 1>&2
@@ -9742,7 +10059,7 @@
case $host_cpu in
powerpc)
# see comment about AmigaOS4 .so support
- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
archive_expsym_cmds=''
;;
m68k)
@@ -9758,7 +10075,7 @@
allow_undefined_flag=unsupported
# Joseph Beckenbach <jrb3 at best.com> says some releases of gcc
# support --undefined. This deserves some investigation. FIXME
- archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
else
ld_shlibs=no
fi
@@ -9768,7 +10085,7 @@
# _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless,
# as there is no search path for DLLs.
hardcode_libdir_flag_spec='-L$libdir'
- export_dynamic_flag_spec='${wl}--export-all-symbols'
+ export_dynamic_flag_spec='$wl--export-all-symbols'
allow_undefined_flag=unsupported
always_export_symbols=no
enable_shared_with_static_runtimes=yes
@@ -9776,16 +10093,16 @@
exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'
if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
- # If the export-symbols file already is a .def file (1st line
- # is EXPORTS), use it as is; otherwise, prepend...
- archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
- cp $export_symbols $output_objdir/$soname.def;
- else
- echo EXPORTS > $output_objdir/$soname.def;
- cat $export_symbols >> $output_objdir/$soname.def;
- fi~
- $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ # If the export-symbols file already is a .def file, use it as
+ # is; otherwise, prepend EXPORTS...
+ archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then
+ cp $export_symbols $output_objdir/$soname.def;
+ else
+ echo EXPORTS > $output_objdir/$soname.def;
+ cat $export_symbols >> $output_objdir/$soname.def;
+ fi~
+ $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname $wl--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
else
ld_shlibs=no
fi
@@ -9792,15 +10109,43 @@
;;
haiku*)
- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
link_all_deplibs=yes
;;
+ os2*)
+ hardcode_libdir_flag_spec='-L$libdir'
+ hardcode_minus_L=yes
+ allow_undefined_flag=unsupported
+ shrext_cmds=.dll
+ archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+ $ECHO EXPORTS >> $output_objdir/$libname.def~
+ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
+ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+ emximp -o $lib $output_objdir/$libname.def'
+ archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+ $ECHO EXPORTS >> $output_objdir/$libname.def~
+ prefix_cmds="$SED"~
+ if test EXPORTS = "`$SED 1q $export_symbols`"; then
+ prefix_cmds="$prefix_cmds -e 1d";
+ fi~
+ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
+ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
+ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+ emximp -o $lib $output_objdir/$libname.def'
+ old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
+ enable_shared_with_static_runtimes=yes
+ ;;
+
interix[3-9]*)
hardcode_direct=no
hardcode_shlibpath_var=no
- hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
- export_dynamic_flag_spec='${wl}-E'
+ hardcode_libdir_flag_spec='$wl-rpath,$libdir'
+ export_dynamic_flag_spec='$wl-E'
# Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
# Instead, shared libraries are loaded at an image base (0x10000000 by
# default) and relocated if they conflict, which is a slow very memory
@@ -9807,30 +10152,30 @@
# consuming and fragmenting process. To avoid this, we pick a random,
# 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
# time. Moving up from 0x10000000 also allows more sbrk(2) space.
- archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
- archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+ archive_expsym_cmds='sed "s|^|_|" $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-h,$soname $wl--retain-symbols-file,$output_objdir/$soname.expsym $wl--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
;;
gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
tmp_diet=no
- if test "$host_os" = linux-dietlibc; then
+ if test linux-dietlibc = "$host_os"; then
case $cc_basename in
diet\ *) tmp_diet=yes;; # linux-dietlibc with static linking (!diet-dyn)
esac
fi
if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
- && test "$tmp_diet" = no
+ && test no = "$tmp_diet"
then
tmp_addflag=' $pic_flag'
tmp_sharedflag='-shared'
case $cc_basename,$host_cpu in
pgcc*) # Portland Group C compiler
- whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
tmp_addflag=' $pic_flag'
;;
pgf77* | pgf90* | pgf95* | pgfortran*)
# Portland Group f77 and f90 compilers
- whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
tmp_addflag=' $pic_flag -Mnomain' ;;
ecc*,ia64* | icc*,ia64*) # Intel C compiler on ia64
tmp_addflag=' -i_dynamic' ;;
@@ -9841,42 +10186,47 @@
lf95*) # Lahey Fortran 8.1
whole_archive_flag_spec=
tmp_sharedflag='--shared' ;;
+ nagfor*) # NAGFOR 5.3
+ tmp_sharedflag='-Wl,-shared' ;;
xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below)
tmp_sharedflag='-qmkshrobj'
tmp_addflag= ;;
nvcc*) # Cuda Compiler Driver 2.2
- whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ whole_archive_flag_spec='$wl--whole-archive`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
compiler_needs_object=yes
;;
esac
case `$CC -V 2>&1 | sed 5q` in
*Sun\ C*) # Sun C 5.9
- whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+ whole_archive_flag_spec='$wl--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` $wl--no-whole-archive'
compiler_needs_object=yes
tmp_sharedflag='-G' ;;
*Sun\ F*) # Sun Fortran 8.3
tmp_sharedflag='-G' ;;
esac
- archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
- if test "x$supports_anon_versioning" = xyes; then
+ if test yes = "$supports_anon_versioning"; then
archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
- cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
- echo "local: *; };" >> $output_objdir/$libname.ver~
- $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-version-script $wl$output_objdir/$libname.ver -o $lib'
fi
case $cc_basename in
+ tcc*)
+ export_dynamic_flag_spec='-rdynamic'
+ ;;
xlf* | bgf* | bgxlf* | mpixlf*)
# IBM XL Fortran 10.1 on PPC cannot create shared libs itself
whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive'
- hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
- if test "x$supports_anon_versioning" = xyes; then
+ if test yes = "$supports_anon_versioning"; then
archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
- cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
- echo "local: *; };" >> $output_objdir/$libname.ver~
- $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+ cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+ echo "local: *; };" >> $output_objdir/$libname.ver~
+ $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
fi
;;
esac
@@ -9890,8 +10240,8 @@
archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
wlarc=
else
- archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
fi
;;
@@ -9909,8 +10259,8 @@
_LT_EOF
elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
- archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
else
ld_shlibs=no
fi
@@ -9922,7 +10272,7 @@
ld_shlibs=no
cat <<_LT_EOF 1>&2
-*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 cannot
*** reliably create shared libraries on SCO systems. Therefore, libtool
*** is disabling shared libraries support. We urge you to upgrade GNU
*** binutils to release 2.16.91.0.3 or newer. Another option is to modify
@@ -9937,9 +10287,9 @@
# DT_RUNPATH tag from executables and libraries. But doing so
# requires that you compile everything twice, which is a pain.
if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
- hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+ archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
else
ld_shlibs=no
fi
@@ -9956,8 +10306,8 @@
*)
if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
- archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
+ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname $wl-retain-symbols-file $wl$export_symbols -o $lib'
else
ld_shlibs=no
fi
@@ -9964,7 +10314,7 @@
;;
esac
- if test "$ld_shlibs" = no; then
+ if test no = "$ld_shlibs"; then
runpath_var=
hardcode_libdir_flag_spec=
export_dynamic_flag_spec=
@@ -9980,7 +10330,7 @@
# Note: this linker hardcodes the directories in LIBPATH if there
# are no directories specified by -L.
hardcode_minus_L=yes
- if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
+ if test yes = "$GCC" && test -z "$lt_prog_compiler_static"; then
# Neither direct hardcoding nor static linking is supported with a
# broken collect2.
hardcode_direct=unsupported
@@ -9988,34 +10338,57 @@
;;
aix[4-9]*)
- if test "$host_cpu" = ia64; then
+ if test ia64 = "$host_cpu"; then
# On IA64, the linker does run time linking by default, so we don't
# have to do anything special.
aix_use_runtimelinking=no
exp_sym_flag='-Bexport'
- no_entry_flag=""
+ no_entry_flag=
else
# If we're using GNU nm, then we don't want the "-C" option.
- # -C means demangle to AIX nm, but means don't demangle with GNU nm
- # Also, AIX nm treats weak defined symbols like other global
- # defined symbols, whereas GNU nm marks them as "W".
+ # -C means demangle to GNU nm, but means don't demangle to AIX nm.
+ # Without the "-l" option, or with the "-B" option, AIX nm treats
+ # weak defined symbols like other global defined symbols, whereas
+ # GNU nm marks them as "W".
+ # While the 'weak' keyword is ignored in the Export File, we need
+ # it in the Import File for the 'aix-soname' feature, so we have
+ # to replace the "-B" option with "-P" for AIX nm.
if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
- export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { if (\$ 2 == "W") { print \$ 3 " weak" } else { print \$ 3 } } }'\'' | sort -u > $export_symbols'
else
- export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+ export_symbols_cmds='`func_echo_all $NM | $SED -e '\''s/B\([^B]*\)$/P\1/'\''` -PCpgl $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) && (substr(\$ 1,1,1) != ".")) { if ((\$ 2 == "W") || (\$ 2 == "V") || (\$ 2 == "Z")) { print \$ 1 " weak" } else { print \$ 1 } } }'\'' | sort -u > $export_symbols'
fi
aix_use_runtimelinking=no
# Test if we are trying to use run time linking or normal
# AIX style linking. If -brtl is somewhere in LDFLAGS, we
- # need to do runtime linking.
+ # have runtime linking enabled, and use it for executables.
+ # For shared libraries, we enable/disable runtime linking
+ # depending on the kind of the shared library created -
+ # when "with_aix_soname,aix_use_runtimelinking" is:
+ # "aix,no" lib.a(lib.so.V) shared, rtl:no, for executables
+ # "aix,yes" lib.so shared, rtl:yes, for executables
+ # lib.a static archive
+ # "both,no" lib.so.V(shr.o) shared, rtl:yes
+ # lib.a(lib.so.V) shared, rtl:no, for executables
+ # "both,yes" lib.so.V(shr.o) shared, rtl:yes, for executables
+ # lib.a(lib.so.V) shared, rtl:no
+ # "svr4,*" lib.so.V(shr.o) shared, rtl:yes, for executables
+ # lib.a static archive
case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
for ld_flag in $LDFLAGS; do
- if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+ if (test x-brtl = "x$ld_flag" || test x-Wl,-brtl = "x$ld_flag"); then
aix_use_runtimelinking=yes
break
fi
done
+ if test svr4,no = "$with_aix_soname,$aix_use_runtimelinking"; then
+ # With aix-soname=svr4, we create the lib.so.V shared archives only,
+ # so we don't have lib.a shared libs to link our executables.
+ # We have to force runtime linking in this case.
+ aix_use_runtimelinking=yes
+ LDFLAGS="$LDFLAGS -Wl,-brtl"
+ fi
;;
esac
@@ -10034,13 +10407,21 @@
hardcode_direct_absolute=yes
hardcode_libdir_separator=':'
link_all_deplibs=yes
- file_list_spec='${wl}-f,'
+ file_list_spec='$wl-f,'
+ case $with_aix_soname,$aix_use_runtimelinking in
+ aix,*) ;; # traditional, no import file
+ svr4,* | *,yes) # use import file
+ # The Import File defines what to hardcode.
+ hardcode_direct=no
+ hardcode_direct_absolute=no
+ ;;
+ esac
- if test "$GCC" = yes; then
+ if test yes = "$GCC"; then
case $host_os in aix4.[012]|aix4.[012].*)
# We only want to do this on AIX 4.2 and lower, the check
# below for broken collect2 doesn't work under 4.3+
- collect2name=`${CC} -print-prog-name=collect2`
+ collect2name=`$CC -print-prog-name=collect2`
if test -f "$collect2name" &&
strings "$collect2name" | $GREP resolve_lib_name >/dev/null
then
@@ -10059,36 +10440,42 @@
;;
esac
shared_flag='-shared'
- if test "$aix_use_runtimelinking" = yes; then
- shared_flag="$shared_flag "'${wl}-G'
+ if test yes = "$aix_use_runtimelinking"; then
+ shared_flag="$shared_flag "'$wl-G'
fi
- link_all_deplibs=no
+ # Need to ensure runtime linking is disabled for the traditional
+ # shared library, or the linker may eventually find shared libraries
+ # /with/ Import File - we do not want to mix them.
+ shared_flag_aix='-shared'
+ shared_flag_svr4='-shared $wl-G'
else
# not using gcc
- if test "$host_cpu" = ia64; then
+ if test ia64 = "$host_cpu"; then
# VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
# chokes on -Wl,-G. The following line is correct:
shared_flag='-G'
else
- if test "$aix_use_runtimelinking" = yes; then
- shared_flag='${wl}-G'
+ if test yes = "$aix_use_runtimelinking"; then
+ shared_flag='$wl-G'
else
- shared_flag='${wl}-bM:SRE'
+ shared_flag='$wl-bM:SRE'
fi
+ shared_flag_aix='$wl-bM:SRE'
+ shared_flag_svr4='$wl-G'
fi
fi
- export_dynamic_flag_spec='${wl}-bexpall'
+ export_dynamic_flag_spec='$wl-bexpall'
# It seems that -bexpall does not export symbols beginning with
# underscore (_), so it is better to generate a list of symbols to export.
always_export_symbols=yes
- if test "$aix_use_runtimelinking" = yes; then
+ if test aix,yes = "$with_aix_soname,$aix_use_runtimelinking"; then
# Warning - without using the other runtime loading flags (-brtl),
# -berok will link without error, but may produce a broken library.
allow_undefined_flag='-berok'
# Determine the default libpath from the value encoded in an
# empty executable.
- if test "${lt_cv_aix_libpath+set}" = set; then
+ if test set = "${lt_cv_aix_libpath+set}"; then
aix_libpath=$lt_cv_aix_libpath
else
if ${lt_cv_aix_libpath_+:} false; then :
@@ -10123,7 +10510,7 @@
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
if test -z "$lt_cv_aix_libpath_"; then
- lt_cv_aix_libpath_="/usr/lib:/lib"
+ lt_cv_aix_libpath_=/usr/lib:/lib
fi
fi
@@ -10131,17 +10518,17 @@
aix_libpath=$lt_cv_aix_libpath_
fi
- hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
- archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+ hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath"
+ archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs $wl'$no_entry_flag' $compiler_flags `if test -n "$allow_undefined_flag"; then func_echo_all "$wl$allow_undefined_flag"; else :; fi` $wl'$exp_sym_flag:\$export_symbols' '$shared_flag
else
- if test "$host_cpu" = ia64; then
- hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
+ if test ia64 = "$host_cpu"; then
+ hardcode_libdir_flag_spec='$wl-R $libdir:/usr/lib:/lib'
allow_undefined_flag="-z nodefs"
- archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+ archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\$wl$no_entry_flag"' $compiler_flags $wl$allow_undefined_flag '"\$wl$exp_sym_flag:\$export_symbols"
else
# Determine the default libpath from the value encoded in an
# empty executable.
- if test "${lt_cv_aix_libpath+set}" = set; then
+ if test set = "${lt_cv_aix_libpath+set}"; then
aix_libpath=$lt_cv_aix_libpath
else
if ${lt_cv_aix_libpath_+:} false; then :
@@ -10176,7 +10563,7 @@
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
if test -z "$lt_cv_aix_libpath_"; then
- lt_cv_aix_libpath_="/usr/lib:/lib"
+ lt_cv_aix_libpath_=/usr/lib:/lib
fi
fi
@@ -10184,21 +10571,33 @@
aix_libpath=$lt_cv_aix_libpath_
fi
- hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+ hardcode_libdir_flag_spec='$wl-blibpath:$libdir:'"$aix_libpath"
# Warning - without using the other run time loading flags,
# -berok will link without error, but may produce a broken library.
- no_undefined_flag=' ${wl}-bernotok'
- allow_undefined_flag=' ${wl}-berok'
- if test "$with_gnu_ld" = yes; then
+ no_undefined_flag=' $wl-bernotok'
+ allow_undefined_flag=' $wl-berok'
+ if test yes = "$with_gnu_ld"; then
# We only use this code for GNU lds that support --whole-archive.
- whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+ whole_archive_flag_spec='$wl--whole-archive$convenience $wl--no-whole-archive'
else
# Exported symbols can be pulled into shared objects from archives
whole_archive_flag_spec='$convenience'
fi
archive_cmds_need_lc=yes
- # This is similar to how AIX traditionally builds its shared libraries.
- archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+ archive_expsym_cmds='$RM -r $output_objdir/$realname.d~$MKDIR $output_objdir/$realname.d'
+ # -brtl affects multiple linker settings, -berok does not and is overridden later
+ compiler_flags_filtered='`func_echo_all "$compiler_flags " | $SED -e "s%-brtl\\([, ]\\)%-berok\\1%g"`'
+ if test svr4 != "$with_aix_soname"; then
+ # This is similar to how AIX traditionally builds its shared libraries.
+ archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_aix' -o $output_objdir/$realname.d/$soname $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$realname.d/$soname'
+ fi
+ if test aix != "$with_aix_soname"; then
+ archive_expsym_cmds="$archive_expsym_cmds"'~$CC '$shared_flag_svr4' -o $output_objdir/$realname.d/$shared_archive_member_spec.o $libobjs $deplibs $wl-bnoentry '$compiler_flags_filtered'$wl-bE:$export_symbols$allow_undefined_flag~$STRIP -e $output_objdir/$realname.d/$shared_archive_member_spec.o~( func_echo_all "#! $soname($shared_archive_member_spec.o)"; if test shr_64 = "$shared_archive_member_spec"; then func_echo_all "# 64"; else func_echo_all "# 32"; fi; cat $export_symbols ) > $output_objdir/$realname.d/$shared_archive_member_spec.imp~$AR $AR_FLAGS $output_objdir/$soname $output_objdir/$realname.d/$shared_archive_member_spec.o $output_objdir/$realname.d/$shared_archive_member_spec.imp'
+ else
+ # used by -dlpreopen to get the symbols
+ archive_expsym_cmds="$archive_expsym_cmds"'~$MV $output_objdir/$realname.d/$soname $output_objdir'
+ fi
+ archive_expsym_cmds="$archive_expsym_cmds"'~$RM -r $output_objdir/$realname.d'
fi
fi
;;
@@ -10207,7 +10606,7 @@
case $host_cpu in
powerpc)
# see comment about AmigaOS4 .so support
- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags $wl-soname $wl$soname -o $lib'
archive_expsym_cmds=''
;;
m68k)
@@ -10237,16 +10636,17 @@
# Tell ltmain to make .lib files, not .a files.
libext=lib
# Tell ltmain to make .dll files, not .so files.
- shrext_cmds=".dll"
+ shrext_cmds=.dll
# FIXME: Setting linknames here is a bad hack.
- archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
- archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
- sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
- else
- sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
- fi~
- $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
- linknames='
+ archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~linknames='
+ archive_expsym_cmds='if test DEF = "`$SED -n -e '\''s/^[ ]*//'\'' -e '\''/^\(;.*\)*$/d'\'' -e '\''s/^\(EXPORTS\|LIBRARY\)\([ ].*\)*$/DEF/p'\'' -e q $export_symbols`" ; then
+ cp "$export_symbols" "$output_objdir/$soname.def";
+ echo "$tool_output_objdir$soname.def" > "$output_objdir/$soname.exp";
+ else
+ $SED -e '\''s/^/-link -EXPORT:/'\'' < $export_symbols > $output_objdir/$soname.exp;
+ fi~
+ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+ linknames='
# The linker will not automatically build a static lib if we build a DLL.
# _LT_TAGVAR(old_archive_from_new_cmds, )='true'
enable_shared_with_static_runtimes=yes
@@ -10255,18 +10655,18 @@
# Don't use ranlib
old_postinstall_cmds='chmod 644 $oldlib'
postlink_cmds='lt_outputfile="@OUTPUT@"~
- lt_tool_outputfile="@TOOL_OUTPUT@"~
- case $lt_outputfile in
- *.exe|*.EXE) ;;
- *)
- lt_outputfile="$lt_outputfile.exe"
- lt_tool_outputfile="$lt_tool_outputfile.exe"
- ;;
- esac~
- if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
- $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
- $RM "$lt_outputfile.manifest";
- fi'
+ lt_tool_outputfile="@TOOL_OUTPUT@"~
+ case $lt_outputfile in
+ *.exe|*.EXE) ;;
+ *)
+ lt_outputfile=$lt_outputfile.exe
+ lt_tool_outputfile=$lt_tool_outputfile.exe
+ ;;
+ esac~
+ if test : != "$MANIFEST_TOOL" && test -f "$lt_outputfile.manifest"; then
+ $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+ $RM "$lt_outputfile.manifest";
+ fi'
;;
*)
# Assume MSVC wrapper
@@ -10275,7 +10675,7 @@
# Tell ltmain to make .lib files, not .a files.
libext=lib
# Tell ltmain to make .dll files, not .so files.
- shrext_cmds=".dll"
+ shrext_cmds=.dll
# FIXME: Setting linknames here is a bad hack.
archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
# The linker will automatically build a .lib file if we build a DLL.
@@ -10294,24 +10694,24 @@
hardcode_direct=no
hardcode_automatic=yes
hardcode_shlibpath_var=unsupported
- if test "$lt_cv_ld_force_load" = "yes"; then
- whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
+ if test yes = "$lt_cv_ld_force_load"; then
+ whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience $wl-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
else
whole_archive_flag_spec=''
fi
link_all_deplibs=yes
- allow_undefined_flag="$_lt_dar_allow_undefined"
+ allow_undefined_flag=$_lt_dar_allow_undefined
case $cc_basename in
- ifort*) _lt_dar_can_shared=yes ;;
+ ifort*|nagfor*) _lt_dar_can_shared=yes ;;
*) _lt_dar_can_shared=$GCC ;;
esac
- if test "$_lt_dar_can_shared" = "yes"; then
+ if test yes = "$_lt_dar_can_shared"; then
output_verbose_link_cmd=func_echo_all
- archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
- module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
- archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
- module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
+ archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dsymutil"
+ module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dsymutil"
+ archive_expsym_cmds="sed 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod$_lt_dar_export_syms$_lt_dsymutil"
+ module_expsym_cmds="sed -e 's|^|_|' < \$export_symbols > \$output_objdir/\$libname-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags$_lt_dar_export_syms$_lt_dsymutil"
else
ld_shlibs=no
@@ -10353,12 +10753,12 @@
;;
hpux9*)
- if test "$GCC" = yes; then
- archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ if test yes = "$GCC"; then
+ archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag $wl+b $wl$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
else
- archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test "x$output_objdir/$soname" = "x$lib" || mv $output_objdir/$soname $lib'
fi
- hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ hardcode_libdir_flag_spec='$wl+b $wl$libdir'
hardcode_libdir_separator=:
hardcode_direct=yes
@@ -10365,21 +10765,21 @@
# hardcode_minus_L: Not really in the search PATH,
# but as the default location of the library.
hardcode_minus_L=yes
- export_dynamic_flag_spec='${wl}-E'
+ export_dynamic_flag_spec='$wl-E'
;;
hpux10*)
- if test "$GCC" = yes && test "$with_gnu_ld" = no; then
- archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ if test yes,no = "$GCC,$with_gnu_ld"; then
+ archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
else
archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
fi
- if test "$with_gnu_ld" = no; then
- hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ if test no = "$with_gnu_ld"; then
+ hardcode_libdir_flag_spec='$wl+b $wl$libdir'
hardcode_libdir_separator=:
hardcode_direct=yes
hardcode_direct_absolute=yes
- export_dynamic_flag_spec='${wl}-E'
+ export_dynamic_flag_spec='$wl-E'
# hardcode_minus_L: Not really in the search PATH,
# but as the default location of the library.
hardcode_minus_L=yes
@@ -10387,25 +10787,25 @@
;;
hpux11*)
- if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+ if test yes,no = "$GCC,$with_gnu_ld"; then
case $host_cpu in
hppa*64*)
- archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_cmds='$CC -shared $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
;;
ia64*)
- archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
;;
*)
- archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ archive_cmds='$CC -shared $pic_flag $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
;;
esac
else
case $host_cpu in
hppa*64*)
- archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_cmds='$CC -b $wl+h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
;;
ia64*)
- archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ archive_cmds='$CC -b $wl+h $wl$soname $wl+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
;;
*)
@@ -10417,7 +10817,7 @@
$as_echo_n "(cached) " >&6
else
lt_cv_prog_compiler__b=no
- save_LDFLAGS="$LDFLAGS"
+ save_LDFLAGS=$LDFLAGS
LDFLAGS="$LDFLAGS -b"
echo "$lt_simple_link_test_code" > conftest.$ac_ext
if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
@@ -10436,14 +10836,14 @@
fi
fi
$RM -r conftest*
- LDFLAGS="$save_LDFLAGS"
+ LDFLAGS=$save_LDFLAGS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5
$as_echo "$lt_cv_prog_compiler__b" >&6; }
-if test x"$lt_cv_prog_compiler__b" = xyes; then
- archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+if test yes = "$lt_cv_prog_compiler__b"; then
+ archive_cmds='$CC -b $wl+h $wl$soname $wl+b $wl$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
else
archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
fi
@@ -10451,8 +10851,8 @@
;;
esac
fi
- if test "$with_gnu_ld" = no; then
- hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+ if test no = "$with_gnu_ld"; then
+ hardcode_libdir_flag_spec='$wl+b $wl$libdir'
hardcode_libdir_separator=:
case $host_cpu in
@@ -10463,7 +10863,7 @@
*)
hardcode_direct=yes
hardcode_direct_absolute=yes
- export_dynamic_flag_spec='${wl}-E'
+ export_dynamic_flag_spec='$wl-E'
# hardcode_minus_L: Not really in the search PATH,
# but as the default location of the library.
@@ -10474,8 +10874,8 @@
;;
irix5* | irix6* | nonstopux*)
- if test "$GCC" = yes; then
- archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ if test yes = "$GCC"; then
+ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
# Try to use the -exported_symbol ld option, if it does not
# work, assume that -exports_file does not work either and
# implicitly export all symbols.
@@ -10485,8 +10885,8 @@
if ${lt_cv_irix_exported_symbol+:} false; then :
$as_echo_n "(cached) " >&6
else
- save_LDFLAGS="$LDFLAGS"
- LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
+ save_LDFLAGS=$LDFLAGS
+ LDFLAGS="$LDFLAGS -shared $wl-exported_symbol ${wl}foo $wl-update_registry $wl/dev/null"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int foo (void) { return 0; }
@@ -10498,24 +10898,35 @@
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
- LDFLAGS="$save_LDFLAGS"
+ LDFLAGS=$save_LDFLAGS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5
$as_echo "$lt_cv_irix_exported_symbol" >&6; }
- if test "$lt_cv_irix_exported_symbol" = yes; then
- archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
+ if test yes = "$lt_cv_irix_exported_symbol"; then
+ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations $wl-exports_file $wl$export_symbols -o $lib'
fi
+ link_all_deplibs=no
else
- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
+ archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
+ archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -exports_file $export_symbols -o $lib'
fi
archive_cmds_need_lc='no'
- hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
hardcode_libdir_separator=:
inherit_rpath=yes
link_all_deplibs=yes
;;
+ linux*)
+ case $cc_basename in
+ tcc*)
+ # Fabrice Bellard et al's Tiny C Compiler
+ ld_shlibs=yes
+ archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ ;;
+ esac
+ ;;
+
netbsd* | netbsdelf*-gnu)
if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags' # a.out
@@ -10530,7 +10941,7 @@
newsos6)
archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
hardcode_direct=yes
- hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
hardcode_libdir_separator=:
hardcode_shlibpath_var=no
;;
@@ -10538,27 +10949,19 @@
*nto* | *qnx*)
;;
- openbsd*)
+ openbsd* | bitrig*)
if test -f /usr/libexec/ld.so; then
hardcode_direct=yes
hardcode_shlibpath_var=no
hardcode_direct_absolute=yes
- if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
- hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
- export_dynamic_flag_spec='${wl}-E'
+ archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags $wl-retain-symbols-file,$export_symbols'
+ hardcode_libdir_flag_spec='$wl-rpath,$libdir'
+ export_dynamic_flag_spec='$wl-E'
else
- case $host_os in
- openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
- archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
- hardcode_libdir_flag_spec='-R$libdir'
- ;;
- *)
- archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
- hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
- ;;
- esac
+ archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+ hardcode_libdir_flag_spec='$wl-rpath,$libdir'
fi
else
ld_shlibs=no
@@ -10569,33 +10972,53 @@
hardcode_libdir_flag_spec='-L$libdir'
hardcode_minus_L=yes
allow_undefined_flag=unsupported
- archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
- old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+ shrext_cmds=.dll
+ archive_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+ $ECHO EXPORTS >> $output_objdir/$libname.def~
+ emxexp $libobjs | $SED /"_DLL_InitTerm"/d >> $output_objdir/$libname.def~
+ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+ emximp -o $lib $output_objdir/$libname.def'
+ archive_expsym_cmds='$ECHO "LIBRARY ${soname%$shared_ext} INITINSTANCE TERMINSTANCE" > $output_objdir/$libname.def~
+ $ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~
+ $ECHO "DATA MULTIPLE NONSHARED" >> $output_objdir/$libname.def~
+ $ECHO EXPORTS >> $output_objdir/$libname.def~
+ prefix_cmds="$SED"~
+ if test EXPORTS = "`$SED 1q $export_symbols`"; then
+ prefix_cmds="$prefix_cmds -e 1d";
+ fi~
+ prefix_cmds="$prefix_cmds -e \"s/^\(.*\)$/_\1/g\""~
+ cat $export_symbols | $prefix_cmds >> $output_objdir/$libname.def~
+ $CC -Zdll -Zcrtdll -o $output_objdir/$soname $libobjs $deplibs $compiler_flags $output_objdir/$libname.def~
+ emximp -o $lib $output_objdir/$libname.def'
+ old_archive_From_new_cmds='emximp -o $output_objdir/${libname}_dll.a $output_objdir/$libname.def'
+ enable_shared_with_static_runtimes=yes
;;
osf3*)
- if test "$GCC" = yes; then
- allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
- archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ if test yes = "$GCC"; then
+ allow_undefined_flag=' $wl-expect_unresolved $wl\*'
+ archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
else
allow_undefined_flag=' -expect_unresolved \*'
- archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
fi
archive_cmds_need_lc='no'
- hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
hardcode_libdir_separator=:
;;
osf4* | osf5*) # as osf3* with the addition of -msym flag
- if test "$GCC" = yes; then
- allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
- archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
- hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+ if test yes = "$GCC"; then
+ allow_undefined_flag=' $wl-expect_unresolved $wl\*'
+ archive_cmds='$CC -shared$allow_undefined_flag $pic_flag $libobjs $deplibs $compiler_flags $wl-msym $wl-soname $wl$soname `test -n "$verstring" && func_echo_all "$wl-set_version $wl$verstring"` $wl-update_registry $wl$output_objdir/so_locations -o $lib'
+ hardcode_libdir_flag_spec='$wl-rpath $wl$libdir'
else
allow_undefined_flag=' -expect_unresolved \*'
- archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+ archive_cmds='$CC -shared$allow_undefined_flag $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib'
archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
- $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
+ $CC -shared$allow_undefined_flag $wl-input $wl$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry $output_objdir/so_locations -o $lib~$RM $lib.exp'
# Both c and cxx compiler support -rpath directly
hardcode_libdir_flag_spec='-rpath $libdir'
@@ -10606,24 +11029,24 @@
solaris*)
no_undefined_flag=' -z defs'
- if test "$GCC" = yes; then
- wlarc='${wl}'
- archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ if test yes = "$GCC"; then
+ wlarc='$wl'
+ archive_cmds='$CC -shared $pic_flag $wl-z ${wl}text $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags'
archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
- $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+ $CC -shared $pic_flag $wl-z ${wl}text $wl-M $wl$lib.exp $wl-h $wl$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
else
case `$CC -V 2>&1` in
*"Compilers 5.0"*)
wlarc=''
- archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+ archive_cmds='$LD -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $linker_flags'
archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
- $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
+ $LD -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
;;
*)
- wlarc='${wl}'
- archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
+ wlarc='$wl'
+ archive_cmds='$CC -G$allow_undefined_flag -h $soname -o $lib $libobjs $deplibs $compiler_flags'
archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
- $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+ $CC -G$allow_undefined_flag -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
;;
esac
fi
@@ -10633,11 +11056,11 @@
solaris2.[0-5] | solaris2.[0-5].*) ;;
*)
# The compiler driver will combine and reorder linker options,
- # but understands `-z linker_flag'. GCC discards it without `$wl',
+ # but understands '-z linker_flag'. GCC discards it without '$wl',
# but is careful enough not to reorder.
# Supported since Solaris 2.6 (maybe 2.5.1?)
- if test "$GCC" = yes; then
- whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+ if test yes = "$GCC"; then
+ whole_archive_flag_spec='$wl-z ${wl}allextract$convenience $wl-z ${wl}defaultextract'
else
whole_archive_flag_spec='-z allextract$convenience -z defaultextract'
fi
@@ -10647,10 +11070,10 @@
;;
sunos4*)
- if test "x$host_vendor" = xsequent; then
+ if test sequent = "$host_vendor"; then
# Use $CC to link under sequent, because it throws in some extra .o
# files that make .init and .fini sections work.
- archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_cmds='$CC -G $wl-h $soname -o $lib $libobjs $deplibs $compiler_flags'
else
archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
fi
@@ -10699,43 +11122,43 @@
;;
sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
- no_undefined_flag='${wl}-z,text'
+ no_undefined_flag='$wl-z,text'
archive_cmds_need_lc=no
hardcode_shlibpath_var=no
runpath_var='LD_RUN_PATH'
- if test "$GCC" = yes; then
- archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ if test yes = "$GCC"; then
+ archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
else
- archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
fi
;;
sysv5* | sco3.2v5* | sco5v6*)
- # Note: We can NOT use -z defs as we might desire, because we do not
+ # Note: We CANNOT use -z defs as we might desire, because we do not
# link with -lc, and that would cause any symbols used from libc to
# always be unresolved, which means just about no library would
# ever link correctly. If we're not using GNU ld we use -z text
# though, which does catch some bad symbols but isn't as heavy-handed
# as -z defs.
- no_undefined_flag='${wl}-z,text'
- allow_undefined_flag='${wl}-z,nodefs'
+ no_undefined_flag='$wl-z,text'
+ allow_undefined_flag='$wl-z,nodefs'
archive_cmds_need_lc=no
hardcode_shlibpath_var=no
- hardcode_libdir_flag_spec='${wl}-R,$libdir'
+ hardcode_libdir_flag_spec='$wl-R,$libdir'
hardcode_libdir_separator=':'
link_all_deplibs=yes
- export_dynamic_flag_spec='${wl}-Bexport'
+ export_dynamic_flag_spec='$wl-Bexport'
runpath_var='LD_RUN_PATH'
- if test "$GCC" = yes; then
- archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ if test yes = "$GCC"; then
+ archive_cmds='$CC -shared $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='$CC -shared $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
else
- archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
- archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_cmds='$CC -G $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_expsym_cmds='$CC -G $wl-Bexport:$export_symbols $wl-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
fi
;;
@@ -10750,10 +11173,10 @@
;;
esac
- if test x$host_vendor = xsni; then
+ if test sni = "$host_vendor"; then
case $host in
sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
- export_dynamic_flag_spec='${wl}-Blargedynsym'
+ export_dynamic_flag_spec='$wl-Blargedynsym'
;;
esac
fi
@@ -10761,7 +11184,7 @@
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5
$as_echo "$ld_shlibs" >&6; }
-test "$ld_shlibs" = no && can_build_shared=no
+test no = "$ld_shlibs" && can_build_shared=no
with_gnu_ld=$with_gnu_ld
@@ -10787,7 +11210,7 @@
# Assume -lc should be added
archive_cmds_need_lc=yes
- if test "$enable_shared" = yes && test "$GCC" = yes; then
+ if test yes,yes = "$GCC,$enable_shared"; then
case $archive_cmds in
*'~'*)
# FIXME: we may have to deal with multi-command sequences.
@@ -11002,14 +11425,14 @@
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5
$as_echo_n "checking dynamic linker characteristics... " >&6; }
-if test "$GCC" = yes; then
+if test yes = "$GCC"; then
case $host_os in
- darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
- *) lt_awk_arg="/^libraries:/" ;;
+ darwin*) lt_awk_arg='/^libraries:/,/LR/' ;;
+ *) lt_awk_arg='/^libraries:/' ;;
esac
case $host_os in
- mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;;
- *) lt_sed_strip_eq="s,=/,/,g" ;;
+ mingw* | cegcc*) lt_sed_strip_eq='s|=\([A-Za-z]:\)|\1|g' ;;
+ *) lt_sed_strip_eq='s|=/|/|g' ;;
esac
lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
case $lt_search_path_spec in
@@ -11025,21 +11448,28 @@
;;
esac
# Ok, now we have the path, separated by spaces, we can step through it
- # and add multilib dir if necessary.
+ # and add multilib dir if necessary...
lt_tmp_lt_search_path_spec=
- lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
+ lt_multi_os_dir=/`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
+ # ...but if some path component already ends with the multilib dir we assume
+ # that all is fine and trust -print-search-dirs as is (GCC 4.2? or newer).
+ case "$lt_multi_os_dir; $lt_search_path_spec " in
+ "/; "* | "/.; "* | "/./; "* | *"$lt_multi_os_dir "* | *"$lt_multi_os_dir/ "*)
+ lt_multi_os_dir=
+ ;;
+ esac
for lt_sys_path in $lt_search_path_spec; do
- if test -d "$lt_sys_path/$lt_multi_os_dir"; then
- lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
- else
+ if test -d "$lt_sys_path$lt_multi_os_dir"; then
+ lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path$lt_multi_os_dir"
+ elif test -n "$lt_multi_os_dir"; then
test -d "$lt_sys_path" && \
lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
fi
done
lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
-BEGIN {RS=" "; FS="/|\n";} {
- lt_foo="";
- lt_count=0;
+BEGIN {RS = " "; FS = "/|\n";} {
+ lt_foo = "";
+ lt_count = 0;
for (lt_i = NF; lt_i > 0; lt_i--) {
if ($lt_i != "" && $lt_i != ".") {
if ($lt_i == "..") {
@@ -11046,7 +11476,7 @@
lt_count++;
} else {
if (lt_count == 0) {
- lt_foo="/" $lt_i lt_foo;
+ lt_foo = "/" $lt_i lt_foo;
} else {
lt_count--;
}
@@ -11060,7 +11490,7 @@
# for these hosts.
case $host_os in
mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
- $SED 's,/\([A-Za-z]:\),\1,g'` ;;
+ $SED 's|/\([A-Za-z]:\)|\1|g'` ;;
esac
sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
else
@@ -11069,7 +11499,7 @@
library_names_spec=
libname_spec='lib$name'
soname_spec=
-shrext_cmds=".so"
+shrext_cmds=.so
postinstall_cmds=
postuninstall_cmds=
finish_cmds=
@@ -11086,14 +11516,16 @@
# flags to be left without arguments
need_version=unknown
+
+
case $host_os in
aix3*)
version_type=linux # correct to gnu/linux during the next big refactor
- library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
+ library_names_spec='$libname$release$shared_ext$versuffix $libname.a'
shlibpath_var=LIBPATH
# AIX 3 has no versioning support, so we append a major version to the name.
- soname_spec='${libname}${release}${shared_ext}$major'
+ soname_spec='$libname$release$shared_ext$major'
;;
aix[4-9]*)
@@ -11101,21 +11533,21 @@
need_lib_prefix=no
need_version=no
hardcode_into_libs=yes
- if test "$host_cpu" = ia64; then
+ if test ia64 = "$host_cpu"; then
# AIX 5 supports IA64
- library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+ library_names_spec='$libname$release$shared_ext$major $libname$release$shared_ext$versuffix $libname$shared_ext'
shlibpath_var=LD_LIBRARY_PATH
else
# With GCC up to 2.95.x, collect2 would create an import file
# for dependence libraries. The import file would start with
- # the line `#! .'. This would cause the generated library to
- # depend on `.', always an invalid library. This was fixed in
+ # the line '#! .'. This would cause the generated library to
+ # depend on '.', always an invalid library. This was fixed in
# development snapshots of GCC prior to 3.0.
case $host_os in
aix4 | aix4.[01] | aix4.[01].*)
if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
echo ' yes '
- echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
+ echo '#endif'; } | $CC -E - | $GREP yes > /dev/null; then
:
else
can_build_shared=no
@@ -11122,20 +11554,70 @@
fi
;;
esac
- # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+ # Using Import Files as archive members, it is possible to support
+ # filename-based versioning of shared library archives on AIX. While
+ # this would work for both with and without runtime linking, it will
+ # prevent static linking of such archives. So we do filename-based
+ # shared library versioning with .so extension only, which is used
+ # when both runtime linking and shared linking is enabled.
+ # Unfortunately, runtime linking may impact performance, so we do
+ # not want this to be the default eventually. Also, we use the
+ # versioned .so libs for executables only if there is the -brtl
+ # linker flag in LDFLAGS as well, or --with-aix-soname=svr4 only.
+ # To allow for filename-based versioning support, we need to create
+ # libNAME.so.V as an archive file, containing:
+ # *) an Import File, referring to the versioned filename of the
+ # archive as well as the shared archive member, telling the
+ # bitwidth (32 or 64) of that shared object, and providing the
+ # list of exported symbols of that shared object, eventually
+ # decorated with the 'weak' keyword
+ # *) the shared object with the F_LOADONLY flag set, to really avoid
+ # it being seen by the linker.
+ # At run time we better use the real file rather than another symlink,
+ # but for link time we create the symlink libNAME.so -> libNAME.so.V
+
+ case $with_aix_soname,$aix_use_runtimelinking in
+ # AIX (on Power*) has no versioning support, so currently we cannot hardcode correct
# soname into executable. Probably we can add versioning support to
# collect2, so additional links can be useful in future.
- if test "$aix_use_runtimelinking" = yes; then
+ aix,yes) # traditional libtool
+ dynamic_linker='AIX unversionable lib.so'
# If using run time linking (on AIX 4.2 or later) use lib<name>.so
# instead of lib<name>.a to let people know that these are not
# typical AIX shared libraries.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- else
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ ;;
+ aix,no) # traditional AIX only
+ dynamic_linker='AIX lib.a(lib.so.V)'
# We preserve .a as extension for shared libraries through AIX4.2
# and later when we are not doing run time linking.
- library_names_spec='${libname}${release}.a $libname.a'
- soname_spec='${libname}${release}${shared_ext}$major'
- fi
+ library_names_spec='$libname$release.a $libname.a'
+ soname_spec='$libname$release$shared_ext$major'
+ ;;
+ svr4,*) # full svr4 only
+ dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o)"
+ library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
+ # We do not specify a path in Import Files, so LIBPATH fires.
+ shlibpath_overrides_runpath=yes
+ ;;
+ *,yes) # both, prefer svr4
+ dynamic_linker="AIX lib.so.V($shared_archive_member_spec.o), lib.a(lib.so.V)"
+ library_names_spec='$libname$release$shared_ext$major $libname$shared_ext'
+ # unpreferred sharedlib libNAME.a needs extra handling
+ postinstall_cmds='test -n "$linkname" || linkname="$realname"~func_stripname "" ".so" "$linkname"~$install_shared_prog "$dir/$func_stripname_result.$libext" "$destdir/$func_stripname_result.$libext"~test -z "$tstripme" || test -z "$striplib" || $striplib "$destdir/$func_stripname_result.$libext"'
+ postuninstall_cmds='for n in $library_names $old_library; do :; done~func_stripname "" ".so" "$n"~test "$func_stripname_result" = "$n" || func_append rmfiles " $odir/$func_stripname_result.$libext"'
+ # We do not specify a path in Import Files, so LIBPATH fires.
+ shlibpath_overrides_runpath=yes
+ ;;
+ *,no) # both, prefer aix
+ dynamic_linker="AIX lib.a(lib.so.V), lib.so.V($shared_archive_member_spec.o)"
+ library_names_spec='$libname$release.a $libname.a'
+ soname_spec='$libname$release$shared_ext$major'
+ # unpreferred sharedlib libNAME.so.V and symlink libNAME.so need extra handling
+ postinstall_cmds='test -z "$dlname" || $install_shared_prog $dir/$dlname $destdir/$dlname~test -z "$tstripme" || test -z "$striplib" || $striplib $destdir/$dlname~test -n "$linkname" || linkname=$realname~func_stripname "" ".a" "$linkname"~(cd "$destdir" && $LN_S -f $dlname $func_stripname_result.so)'
+ postuninstall_cmds='test -z "$dlname" || func_append rmfiles " $odir/$dlname"~for n in $old_library $library_names; do :; done~func_stripname "" ".a" "$n"~func_append rmfiles " $odir/$func_stripname_result.so"'
+ ;;
+ esac
shlibpath_var=LIBPATH
fi
;;
@@ -11145,18 +11627,18 @@
powerpc)
# Since July 2007 AmigaOS4 officially supports .so libraries.
# When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
;;
m68k)
library_names_spec='$libname.ixlibrary $libname.a'
# Create ${libname}_ixlibrary.a entries in /sys/libs.
- finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+ finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
;;
esac
;;
beos*)
- library_names_spec='${libname}${shared_ext}'
+ library_names_spec='$libname$shared_ext'
dynamic_linker="$host_os ld.so"
shlibpath_var=LIBRARY_PATH
;;
@@ -11164,8 +11646,8 @@
bsdi[45]*)
version_type=linux # correct to gnu/linux during the next big refactor
need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
shlibpath_var=LD_LIBRARY_PATH
sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
@@ -11177,7 +11659,7 @@
cygwin* | mingw* | pw32* | cegcc*)
version_type=windows
- shrext_cmds=".dll"
+ shrext_cmds=.dll
need_version=no
need_lib_prefix=no
@@ -11186,8 +11668,8 @@
# gcc
library_names_spec='$libname.dll.a'
# DLL is installed to $(libdir)/../bin by postinstall_cmds
- postinstall_cmds='base_file=`basename \${file}`~
- dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+ postinstall_cmds='base_file=`basename \$file`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
dldir=$destdir/`dirname \$dlpath`~
test -d \$dldir || mkdir -p \$dldir~
$install_prog $dir/$dlname \$dldir/$dlname~
@@ -11203,17 +11685,17 @@
case $host_os in
cygwin*)
# Cygwin DLLs use 'cyg' prefix rather than 'lib'
- soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ soname_spec='`echo $libname | sed -e 's/^lib/cyg/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"
;;
mingw* | cegcc*)
# MinGW DLLs use traditional 'lib' prefix
- soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
;;
pw32*)
# pw32 DLLs use 'pw' prefix rather than 'lib'
- library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ library_names_spec='`echo $libname | sed -e 's/^lib/pw/'``echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
;;
esac
dynamic_linker='Win32 ld.exe'
@@ -11222,8 +11704,8 @@
*,cl*)
# Native MSVC
libname_spec='$name'
- soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
- library_names_spec='${libname}.dll.lib'
+ soname_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext'
+ library_names_spec='$libname.dll.lib'
case $build_os in
mingw*)
@@ -11250,7 +11732,7 @@
sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
;;
*)
- sys_lib_search_path_spec="$LIB"
+ sys_lib_search_path_spec=$LIB
if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
# It is most probably a Windows format PATH.
sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
@@ -11263,8 +11745,8 @@
esac
# DLL is installed to $(libdir)/../bin by postinstall_cmds
- postinstall_cmds='base_file=`basename \${file}`~
- dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+ postinstall_cmds='base_file=`basename \$file`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; echo \$dlname'\''`~
dldir=$destdir/`dirname \$dlpath`~
test -d \$dldir || mkdir -p \$dldir~
$install_prog $dir/$dlname \$dldir/$dlname'
@@ -11277,7 +11759,7 @@
*)
# Assume MSVC wrapper
- library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
+ library_names_spec='$libname`echo $release | $SED -e 's/[.]/-/g'`$versuffix$shared_ext $libname.lib'
dynamic_linker='Win32 ld.exe'
;;
esac
@@ -11290,8 +11772,8 @@
version_type=darwin
need_lib_prefix=no
need_version=no
- library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
- soname_spec='${libname}${release}${major}$shared_ext'
+ library_names_spec='$libname$release$major$shared_ext $libname$shared_ext'
+ soname_spec='$libname$release$major$shared_ext'
shlibpath_overrides_runpath=yes
shlibpath_var=DYLD_LIBRARY_PATH
shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
@@ -11304,8 +11786,8 @@
version_type=linux # correct to gnu/linux during the next big refactor
need_lib_prefix=no
need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
- soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
shlibpath_var=LD_LIBRARY_PATH
;;
@@ -11323,12 +11805,13 @@
version_type=freebsd-$objformat
case $version_type in
freebsd-elf*)
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
need_version=no
need_lib_prefix=no
;;
freebsd-*)
- library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
need_version=yes
;;
esac
@@ -11358,10 +11841,10 @@
need_lib_prefix=no
need_version=no
dynamic_linker="$host_os runtime_loader"
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
shlibpath_var=LIBRARY_PATH
- shlibpath_overrides_runpath=yes
+ shlibpath_overrides_runpath=no
sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
hardcode_into_libs=yes
;;
@@ -11379,14 +11862,15 @@
dynamic_linker="$host_os dld.so"
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
- if test "X$HPUX_IA64_MODE" = X32; then
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
+ if test 32 = "$HPUX_IA64_MODE"; then
sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+ sys_lib_dlsearch_path_spec=/usr/lib/hpux32
else
sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+ sys_lib_dlsearch_path_spec=/usr/lib/hpux64
fi
- sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
;;
hppa*64*)
shrext_cmds='.sl'
@@ -11394,8 +11878,8 @@
dynamic_linker="$host_os dld.sl"
shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
;;
@@ -11404,8 +11888,8 @@
dynamic_linker="$host_os dld.sl"
shlibpath_var=SHLIB_PATH
shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
;;
esac
# HP-UX runs *really* slowly unless shared libraries are mode 555, ...
@@ -11418,8 +11902,8 @@
version_type=linux # correct to gnu/linux during the next big refactor
need_lib_prefix=no
need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=no
@@ -11430,7 +11914,7 @@
case $host_os in
nonstopux*) version_type=nonstopux ;;
*)
- if test "$lt_cv_prog_gnu_ld" = yes; then
+ if test yes = "$lt_cv_prog_gnu_ld"; then
version_type=linux # correct to gnu/linux during the next big refactor
else
version_type=irix
@@ -11438,8 +11922,8 @@
esac
need_lib_prefix=no
need_version=no
- soname_spec='${libname}${release}${shared_ext}$major'
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+ soname_spec='$libname$release$shared_ext$major'
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$release$shared_ext $libname$shared_ext'
case $host_os in
irix5* | nonstopux*)
libsuff= shlibsuff=
@@ -11458,8 +11942,8 @@
esac
shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
shlibpath_overrides_runpath=no
- sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
- sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+ sys_lib_search_path_spec="/usr/lib$libsuff /lib$libsuff /usr/local/lib$libsuff"
+ sys_lib_dlsearch_path_spec="/usr/lib$libsuff /lib$libsuff"
hardcode_into_libs=yes
;;
@@ -11468,13 +11952,33 @@
dynamic_linker=no
;;
+linux*android*)
+ version_type=none # Android doesn't support versioned libraries.
+ need_lib_prefix=no
+ need_version=no
+ library_names_spec='$libname$release$shared_ext'
+ soname_spec='$libname$release$shared_ext'
+ finish_cmds=
+ shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=yes
+
+ # This implies no fast_install, which is unacceptable.
+ # Some rework will be needed to allow for fast_install
+ # before this can be enabled.
+ hardcode_into_libs=yes
+
+ dynamic_linker='Android linker'
+ # Don't embed -rpath directories since the linker doesn't support them.
+ hardcode_libdir_flag_spec='-L$libdir'
+ ;;
+
# This must be glibc/ELF.
linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
version_type=linux # correct to gnu/linux during the next big refactor
need_lib_prefix=no
need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=no
@@ -11518,7 +12022,12 @@
# before this can be enabled.
hardcode_into_libs=yes
- # Append ld.so.conf contents to the search path
+ # Ideally, we could use ldconfig to report *all* directores which are
+ # searched for libraries, however this is still not possible. Aside from not
+ # being certain /sbin/ldconfig is available, command
+ # 'ldconfig -N -X -v | grep ^/' on 64bit Fedora does not report /usr/lib64,
+ # even though it is searched at run-time. Try to do the best guess by
+ # appending ld.so.conf contents (and includes) to the search path.
if test -f /etc/ld.so.conf; then
lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[ ]*hwcap[ ]/d;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
@@ -11550,12 +12059,12 @@
need_lib_prefix=no
need_version=no
if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
dynamic_linker='NetBSD (a.out) ld.so'
else
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
dynamic_linker='NetBSD ld.elf_so'
fi
shlibpath_var=LD_LIBRARY_PATH
@@ -11565,7 +12074,7 @@
newsos6)
version_type=linux # correct to gnu/linux during the next big refactor
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=yes
;;
@@ -11574,8 +12083,8 @@
version_type=qnx
need_lib_prefix=no
need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=no
hardcode_into_libs=yes
@@ -11582,39 +12091,49 @@
dynamic_linker='ldqnx.so'
;;
-openbsd*)
+openbsd* | bitrig*)
version_type=sunos
- sys_lib_dlsearch_path_spec="/usr/lib"
+ sys_lib_dlsearch_path_spec=/usr/lib
need_lib_prefix=no
- # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
- case $host_os in
- openbsd3.3 | openbsd3.3.*) need_version=yes ;;
- *) need_version=no ;;
- esac
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`"; then
+ need_version=no
+ else
+ need_version=yes
+ fi
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
shlibpath_var=LD_LIBRARY_PATH
- if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
- case $host_os in
- openbsd2.[89] | openbsd2.[89].*)
- shlibpath_overrides_runpath=no
- ;;
- *)
- shlibpath_overrides_runpath=yes
- ;;
- esac
- else
- shlibpath_overrides_runpath=yes
- fi
+ shlibpath_overrides_runpath=yes
;;
os2*)
libname_spec='$name'
- shrext_cmds=".dll"
+ version_type=windows
+ shrext_cmds=.dll
+ need_version=no
need_lib_prefix=no
- library_names_spec='$libname${shared_ext} $libname.a'
+ # OS/2 can only load a DLL with a base name of 8 characters or less.
+ soname_spec='`test -n "$os2dllname" && libname="$os2dllname";
+ v=$($ECHO $release$versuffix | tr -d .-);
+ n=$($ECHO $libname | cut -b -$((8 - ${#v})) | tr . _);
+ $ECHO $n$v`$shared_ext'
+ library_names_spec='${libname}_dll.$libext'
dynamic_linker='OS/2 ld.exe'
- shlibpath_var=LIBPATH
+ shlibpath_var=BEGINLIBPATH
+ sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+ postinstall_cmds='base_file=`basename \$file`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\$base_file'\''i; $ECHO \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname~
+ chmod a+x \$dldir/$dlname~
+ if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+ eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+ fi'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; $ECHO \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $RM \$dlpath'
;;
osf3* | osf4* | osf5*)
@@ -11621,11 +12140,11 @@
version_type=osf
need_lib_prefix=no
need_version=no
- soname_spec='${libname}${release}${shared_ext}$major'
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ soname_spec='$libname$release$shared_ext$major'
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
shlibpath_var=LD_LIBRARY_PATH
sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
- sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+ sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
;;
rdos*)
@@ -11636,8 +12155,8 @@
version_type=linux # correct to gnu/linux during the next big refactor
need_lib_prefix=no
need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=yes
hardcode_into_libs=yes
@@ -11647,11 +12166,11 @@
sunos4*)
version_type=sunos
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$shared_ext$versuffix'
finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=yes
- if test "$with_gnu_ld" = yes; then
+ if test yes = "$with_gnu_ld"; then
need_lib_prefix=no
fi
need_version=yes
@@ -11659,8 +12178,8 @@
sysv4 | sysv4.3*)
version_type=linux # correct to gnu/linux during the next big refactor
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
shlibpath_var=LD_LIBRARY_PATH
case $host_vendor in
sni)
@@ -11681,24 +12200,24 @@
;;
sysv4*MP*)
- if test -d /usr/nec ;then
+ if test -d /usr/nec; then
version_type=linux # correct to gnu/linux during the next big refactor
- library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
- soname_spec='$libname${shared_ext}.$major'
+ library_names_spec='$libname$shared_ext.$versuffix $libname$shared_ext.$major $libname$shared_ext'
+ soname_spec='$libname$shared_ext.$major'
shlibpath_var=LD_LIBRARY_PATH
fi
;;
sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
- version_type=freebsd-elf
+ version_type=sco
need_lib_prefix=no
need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=yes
hardcode_into_libs=yes
- if test "$with_gnu_ld" = yes; then
+ if test yes = "$with_gnu_ld"; then
sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
else
sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
@@ -11716,7 +12235,7 @@
version_type=linux # correct to gnu/linux during the next big refactor
need_lib_prefix=no
need_version=no
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=no
hardcode_into_libs=yes
@@ -11724,8 +12243,8 @@
uts4*)
version_type=linux # correct to gnu/linux during the next big refactor
- library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
- soname_spec='${libname}${release}${shared_ext}$major'
+ library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext'
+ soname_spec='$libname$release$shared_ext$major'
shlibpath_var=LD_LIBRARY_PATH
;;
@@ -11735,22 +12254,29 @@
esac
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5
$as_echo "$dynamic_linker" >&6; }
-test "$dynamic_linker" = no && can_build_shared=no
+test no = "$dynamic_linker" && can_build_shared=no
variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
-if test "$GCC" = yes; then
+if test yes = "$GCC"; then
variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
fi
-if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
- sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+if test set = "${lt_cv_sys_lib_search_path_spec+set}"; then
+ sys_lib_search_path_spec=$lt_cv_sys_lib_search_path_spec
fi
-if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
- sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+
+if test set = "${lt_cv_sys_lib_dlsearch_path_spec+set}"; then
+ sys_lib_dlsearch_path_spec=$lt_cv_sys_lib_dlsearch_path_spec
fi
+# remember unaugmented sys_lib_dlsearch_path content for libtool script decls...
+configure_time_dlsearch_path=$sys_lib_dlsearch_path_spec
+# ... but it needs LT_SYS_LIBRARY_PATH munging for other configure-time code
+func_munge_path_list sys_lib_dlsearch_path_spec "$LT_SYS_LIBRARY_PATH"
+# to be used as default LT_SYS_LIBRARY_PATH value in generated libtool
+configure_time_lt_sys_library_path=$LT_SYS_LIBRARY_PATH
@@ -11840,20 +12366,28 @@
+
+
+
+
+
+
+
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5
$as_echo_n "checking how to hardcode library paths into programs... " >&6; }
hardcode_action=
if test -n "$hardcode_libdir_flag_spec" ||
test -n "$runpath_var" ||
- test "X$hardcode_automatic" = "Xyes" ; then
+ test yes = "$hardcode_automatic"; then
# We can hardcode non-existent directories.
- if test "$hardcode_direct" != no &&
+ if test no != "$hardcode_direct" &&
# If the only mechanism to avoid hardcoding is shlibpath_var, we
# have to relink, otherwise we might link with an installed library
# when we should be linking with a yet-to-be-installed one
- ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no &&
- test "$hardcode_minus_L" != no; then
+ ## test no != "$_LT_TAGVAR(hardcode_shlibpath_var, )" &&
+ test no != "$hardcode_minus_L"; then
# Linking always hardcodes the temporary library directory.
hardcode_action=relink
else
@@ -11868,12 +12402,12 @@
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5
$as_echo "$hardcode_action" >&6; }
-if test "$hardcode_action" = relink ||
- test "$inherit_rpath" = yes; then
+if test relink = "$hardcode_action" ||
+ test yes = "$inherit_rpath"; then
# Fast installation is not supported
enable_fast_install=no
-elif test "$shlibpath_overrides_runpath" = yes ||
- test "$enable_shared" = no; then
+elif test yes = "$shlibpath_overrides_runpath" ||
+ test no = "$enable_shared"; then
# Fast installation is not necessary
enable_fast_install=needless
fi
@@ -11883,7 +12417,7 @@
- if test "x$enable_dlopen" != xyes; then
+ if test yes != "$enable_dlopen"; then
enable_dlopen=unknown
enable_dlopen_self=unknown
enable_dlopen_self_static=unknown
@@ -11893,23 +12427,23 @@
case $host_os in
beos*)
- lt_cv_dlopen="load_add_on"
+ lt_cv_dlopen=load_add_on
lt_cv_dlopen_libs=
lt_cv_dlopen_self=yes
;;
mingw* | pw32* | cegcc*)
- lt_cv_dlopen="LoadLibrary"
+ lt_cv_dlopen=LoadLibrary
lt_cv_dlopen_libs=
;;
cygwin*)
- lt_cv_dlopen="dlopen"
+ lt_cv_dlopen=dlopen
lt_cv_dlopen_libs=
;;
darwin*)
- # if libdl is installed we need to link against it
+ # if libdl is installed we need to link against it
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
$as_echo_n "checking for dlopen in -ldl... " >&6; }
if ${ac_cv_lib_dl_dlopen+:} false; then :
@@ -11947,10 +12481,10 @@
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
- lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+ lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl
else
- lt_cv_dlopen="dyld"
+ lt_cv_dlopen=dyld
lt_cv_dlopen_libs=
lt_cv_dlopen_self=yes
@@ -11958,10 +12492,18 @@
;;
+ tpf*)
+ # Don't try to run any link tests for TPF. We know it's impossible
+ # because TPF is a cross-compiler, and we know how we open DSOs.
+ lt_cv_dlopen=dlopen
+ lt_cv_dlopen_libs=
+ lt_cv_dlopen_self=no
+ ;;
+
*)
ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load"
if test "x$ac_cv_func_shl_load" = xyes; then :
- lt_cv_dlopen="shl_load"
+ lt_cv_dlopen=shl_load
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5
$as_echo_n "checking for shl_load in -ldld... " >&6; }
@@ -12000,11 +12542,11 @@
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5
$as_echo "$ac_cv_lib_dld_shl_load" >&6; }
if test "x$ac_cv_lib_dld_shl_load" = xyes; then :
- lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"
+ lt_cv_dlopen=shl_load lt_cv_dlopen_libs=-ldld
else
ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen"
if test "x$ac_cv_func_dlopen" = xyes; then :
- lt_cv_dlopen="dlopen"
+ lt_cv_dlopen=dlopen
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
$as_echo_n "checking for dlopen in -ldl... " >&6; }
@@ -12043,7 +12585,7 @@
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
- lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+ lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-ldl
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5
$as_echo_n "checking for dlopen in -lsvld... " >&6; }
@@ -12082,7 +12624,7 @@
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5
$as_echo "$ac_cv_lib_svld_dlopen" >&6; }
if test "x$ac_cv_lib_svld_dlopen" = xyes; then :
- lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
+ lt_cv_dlopen=dlopen lt_cv_dlopen_libs=-lsvld
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5
$as_echo_n "checking for dld_link in -ldld... " >&6; }
@@ -12121,7 +12663,7 @@
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5
$as_echo "$ac_cv_lib_dld_dld_link" >&6; }
if test "x$ac_cv_lib_dld_dld_link" = xyes; then :
- lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"
+ lt_cv_dlopen=dld_link lt_cv_dlopen_libs=-ldld
fi
@@ -12142,21 +12684,21 @@
;;
esac
- if test "x$lt_cv_dlopen" != xno; then
+ if test no = "$lt_cv_dlopen"; then
+ enable_dlopen=no
+ else
enable_dlopen=yes
- else
- enable_dlopen=no
fi
case $lt_cv_dlopen in
dlopen)
- save_CPPFLAGS="$CPPFLAGS"
- test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+ save_CPPFLAGS=$CPPFLAGS
+ test yes = "$ac_cv_header_dlfcn_h" && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
- save_LDFLAGS="$LDFLAGS"
+ save_LDFLAGS=$LDFLAGS
wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
- save_LIBS="$LIBS"
+ save_LIBS=$LIBS
LIBS="$lt_cv_dlopen_libs $LIBS"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5
@@ -12164,7 +12706,7 @@
if ${lt_cv_dlopen_self+:} false; then :
$as_echo_n "(cached) " >&6
else
- if test "$cross_compiling" = yes; then :
+ if test yes = "$cross_compiling"; then :
lt_cv_dlopen_self=cross
else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
@@ -12211,9 +12753,9 @@
# endif
#endif
-/* When -fvisbility=hidden is used, assume the code has been annotated
+/* When -fvisibility=hidden is used, assume the code has been annotated
correspondingly for the symbols needed. */
-#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
int fnord () __attribute__((visibility("default")));
#endif
@@ -12243,7 +12785,7 @@
(eval $ac_link) 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then
+ test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then
(./conftest; exit; ) >&5 2>/dev/null
lt_status=$?
case x$lt_status in
@@ -12263,7 +12805,7 @@
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5
$as_echo "$lt_cv_dlopen_self" >&6; }
- if test "x$lt_cv_dlopen_self" = xyes; then
+ if test yes = "$lt_cv_dlopen_self"; then
wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5
$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; }
@@ -12270,7 +12812,7 @@
if ${lt_cv_dlopen_self_static+:} false; then :
$as_echo_n "(cached) " >&6
else
- if test "$cross_compiling" = yes; then :
+ if test yes = "$cross_compiling"; then :
lt_cv_dlopen_self_static=cross
else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
@@ -12317,9 +12859,9 @@
# endif
#endif
-/* When -fvisbility=hidden is used, assume the code has been annotated
+/* When -fvisibility=hidden is used, assume the code has been annotated
correspondingly for the symbols needed. */
-#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+#if defined __GNUC__ && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
int fnord () __attribute__((visibility("default")));
#endif
@@ -12349,7 +12891,7 @@
(eval $ac_link) 2>&5
ac_status=$?
$as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then
+ test $ac_status = 0; } && test -s "conftest$ac_exeext" 2>/dev/null; then
(./conftest; exit; ) >&5 2>/dev/null
lt_status=$?
case x$lt_status in
@@ -12370,9 +12912,9 @@
$as_echo "$lt_cv_dlopen_self_static" >&6; }
fi
- CPPFLAGS="$save_CPPFLAGS"
- LDFLAGS="$save_LDFLAGS"
- LIBS="$save_LIBS"
+ CPPFLAGS=$save_CPPFLAGS
+ LDFLAGS=$save_LDFLAGS
+ LIBS=$save_LIBS
;;
esac
@@ -12416,7 +12958,7 @@
# FIXME - insert some real tests, host_os isn't really good enough
case $host_os in
darwin*)
- if test -n "$STRIP" ; then
+ if test -n "$STRIP"; then
striplib="$STRIP -x"
old_striplib="$STRIP -S"
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
@@ -12444,7 +12986,7 @@
- # Report which library types will actually be built
+ # Report what library types will actually be built
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5
$as_echo_n "checking if libtool supports shared libraries... " >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5
@@ -12452,13 +12994,13 @@
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5
$as_echo_n "checking whether to build shared libraries... " >&6; }
- test "$can_build_shared" = "no" && enable_shared=no
+ test no = "$can_build_shared" && enable_shared=no
# On AIX, shared libraries and static libraries use the same namespace, and
# are all built from PIC.
case $host_os in
aix3*)
- test "$enable_shared" = yes && enable_static=no
+ test yes = "$enable_shared" && enable_static=no
if test -n "$RANLIB"; then
archive_cmds="$archive_cmds~\$RANLIB \$lib"
postinstall_cmds='$RANLIB $lib'
@@ -12466,8 +13008,12 @@
;;
aix[4-9]*)
- if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
- test "$enable_shared" = yes && enable_static=no
+ if test ia64 != "$host_cpu"; then
+ case $enable_shared,$with_aix_soname,$aix_use_runtimelinking in
+ yes,aix,yes) ;; # shared object as lib.so file only
+ yes,svr4,*) ;; # shared object as lib.so archive member only
+ yes,*) enable_static=no ;; # shared object in lib.a archive as well
+ esac
fi
;;
esac
@@ -12477,7 +13023,7 @@
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5
$as_echo_n "checking whether to build static libraries... " >&6; }
# Make sure either enable_shared or enable_static is yes.
- test "$enable_shared" = yes || enable_static=yes
+ test yes = "$enable_shared" || enable_static=yes
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5
$as_echo "$enable_static" >&6; }
@@ -12491,7 +13037,7 @@
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
-CC="$lt_save_CC"
+CC=$lt_save_CC
@@ -12805,7 +13351,7 @@
# Set up defines needed before including any headers
case $host in
- *mingw* | *cygwin* )
+ *mingw* | *cygwin* | *msys* )
$as_echo "#define _WIN32_WINNT 0x0502" >>confdefs.h
@@ -13018,6 +13564,19 @@
fi
+for ac_header in acl/libacl.h attr/xattr.h
+do :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
for ac_header in copyfile.h ctype.h
do :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
@@ -13106,7 +13665,43 @@
done
-for ac_header in locale.h paths.h poll.h pthread.h pwd.h
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether FS_IOC_GETFLAGS is usable" >&5
+$as_echo_n "checking whether FS_IOC_GETFLAGS is usable... " >&6; }
+if ${ac_cv_have_decl_FS_IOC_GETFLAGS+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <sys/ioctl.h>
+#include <linux/fs.h>
+int
+main ()
+{
+int x = FS_IOC_GETFLAGS
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ ac_cv_have_decl_FS_IOC_GETFLAGS=yes
+else
+ ac_cv_have_decl_FS_IOC_GETFLAGS=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_have_decl_FS_IOC_GETFLAGS" >&5
+$as_echo "$ac_cv_have_decl_FS_IOC_GETFLAGS" >&6; }
+
+if test "x$ac_cv_have_decl_FS_IOC_GETFLAGS" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_WORKING_FS_IOC_GETFLAGS 1
+_ACEOF
+
+fi
+
+for ac_header in locale.h membership.h paths.h poll.h pthread.h pwd.h
do :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
@@ -13145,7 +13740,7 @@
done
-for ac_header in sys/cdefs.h sys/extattr.h
+for ac_header in sys/acl.h sys/cdefs.h sys/ea.h sys/extattr.h
do :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
@@ -13171,7 +13766,7 @@
done
-for ac_header in sys/param.h sys/poll.h sys/select.h sys/statfs.h sys/statvfs.h
+for ac_header in sys/param.h sys/poll.h sys/richacl.h
do :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
@@ -13184,7 +13779,7 @@
done
-for ac_header in sys/time.h sys/utime.h sys/utsname.h sys/vfs.h
+for ac_header in sys/select.h sys/statfs.h sys/statvfs.h
do :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
@@ -13197,7 +13792,7 @@
done
-for ac_header in time.h unistd.h utime.h wchar.h wctype.h
+for ac_header in sys/time.h sys/utime.h sys/utsname.h sys/vfs.h sys/xattr.h
do :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
@@ -13210,12 +13805,13 @@
done
-for ac_header in windows.h
+for ac_header in time.h unistd.h utime.h wchar.h wctype.h
do :
- ac_fn_c_check_header_mongrel "$LINENO" "windows.h" "ac_cv_header_windows_h" "$ac_includes_default"
-if test "x$ac_cv_header_windows_h" = xyes; then :
+ as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
cat >>confdefs.h <<_ACEOF
-#define HAVE_WINDOWS_H 1
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF
fi
@@ -13222,12 +13818,12 @@
done
-for ac_header in Bcrypt.h
+for ac_header in windows.h
do :
- ac_fn_c_check_header_mongrel "$LINENO" "Bcrypt.h" "ac_cv_header_Bcrypt_h" "$ac_includes_default"
-if test "x$ac_cv_header_Bcrypt_h" = xyes; then :
+ ac_fn_c_check_header_mongrel "$LINENO" "windows.h" "ac_cv_header_windows_h" "$ac_includes_default"
+if test "x$ac_cv_header_windows_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
-#define HAVE_BCRYPT_H 1
+#define HAVE_WINDOWS_H 1
_ACEOF
fi
@@ -13342,7 +13938,7 @@
done
case "$host_os" in
- *mingw* | *cygwin*)
+ *mingw* | *cygwin* | *msys*)
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BZ2_bzDecompressInit in -lbz2" >&5
$as_echo_n "checking for BZ2_bzDecompressInit in -lbz2... " >&6; }
old_LIBS="$LIBS"
@@ -13420,73 +14016,6 @@
fi
-# Check whether --with-lzmadec was given.
-if test "${with_lzmadec+set}" = set; then :
- withval=$with_lzmadec;
-fi
-
-
-if test "x$with_lzmadec" != "xno"; then
- for ac_header in lzmadec.h
-do :
- ac_fn_c_check_header_mongrel "$LINENO" "lzmadec.h" "ac_cv_header_lzmadec_h" "$ac_includes_default"
-if test "x$ac_cv_header_lzmadec_h" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_LZMADEC_H 1
-_ACEOF
-
-fi
-
-done
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for lzmadec_decode in -llzmadec" >&5
-$as_echo_n "checking for lzmadec_decode in -llzmadec... " >&6; }
-if ${ac_cv_lib_lzmadec_lzmadec_decode+:} false; then :
- $as_echo_n "(cached) " >&6
-else
- ac_check_lib_save_LIBS=$LIBS
-LIBS="-llzmadec $LIBS"
-cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h. */
-
-/* Override any GCC internal prototype to avoid an error.
- Use char because int might match the return type of a GCC
- builtin and then its argument prototype would still apply. */
-#ifdef __cplusplus
-extern "C"
-#endif
-char lzmadec_decode ();
-int
-main ()
-{
-return lzmadec_decode ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_lzmadec_lzmadec_decode=yes
-else
- ac_cv_lib_lzmadec_lzmadec_decode=no
-fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_lzmadec_lzmadec_decode" >&5
-$as_echo "$ac_cv_lib_lzmadec_lzmadec_decode" >&6; }
-if test "x$ac_cv_lib_lzmadec_lzmadec_decode" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBLZMADEC 1
-_ACEOF
-
- LIBS="-llzmadec $LIBS"
-
-fi
-
-fi
-
-
# Check whether --with-iconv was given.
if test "${with_iconv+set}" = set; then :
withval=$with_iconv;
@@ -14733,6 +15262,9 @@
/* end confdefs.h. */
#include <lzma.h>
+ #if LZMA_VERSION < 50020000
+ #error unsupported
+ #endif
int
main ()
{
@@ -14741,12 +15273,13 @@
return 0;
}
_ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
+if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lzma_has_mt=yes
else
ac_cv_lzma_has_mt=no
fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lzma_has_mt" >&5
$as_echo "$ac_cv_lzma_has_mt" >&6; }
@@ -14764,7 +15297,7 @@
fi
-if test "x$with_lzo2" != "xno"; then
+if test "x$with_lzo2" = "xyes"; then
for ac_header in lzo/lzoconf.h lzo/lzo1x.h
do :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
@@ -14826,6 +15359,13 @@
fi
+# Check whether --with-cng was given.
+if test "${with_cng+set}" = set; then :
+ withval=$with_cng;
+fi
+
+
+
# Check whether --with-nettle was given.
if test "${with_nettle+set}" = set; then :
withval=$with_nettle;
@@ -17029,7 +17569,7 @@
if test $ac_cv_func_CreateHardLinkA = yes; then :
fi
-for ac_func in arc4random_buf chflags chown chroot ctime_r dirfd
+for ac_func in arc4random_buf chflags chown chroot ctime_r
do :
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
@@ -17245,6 +17785,39 @@
done
+# DragonFly uses vfsconf, FreeBSD xvfsconf.
+ac_fn_c_check_type "$LINENO" "struct vfsconf" "ac_cv_type_struct_vfsconf" "#if HAVE_SYS_TYPES_H
+ #include <sys/types.h>
+ #endif
+ #include <sys/mount.h>
+
+"
+if test "x$ac_cv_type_struct_vfsconf" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_VFSCONF 1
+_ACEOF
+
+
+fi
+
+
+ac_fn_c_check_type "$LINENO" "struct xvfsconf" "ac_cv_type_struct_xvfsconf" "#if HAVE_SYS_TYPES_H
+ #include <sys/types.h>
+ #endif
+ #include <sys/mount.h>
+
+"
+if test "x$ac_cv_type_struct_xvfsconf" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_XVFSCONF 1
+_ACEOF
+
+
+fi
+
+
# There are several variants of readdir_r around; we only
# accept the POSIX-compliant version.
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -17266,7 +17839,27 @@
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+# dirfd can be either a function or a macro.
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+#include <dirent.h>
+ DIR *dir;
+int
+main ()
+{
+return(dirfd(dir));
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+$as_echo "#define HAVE_DIRFD 1" >>confdefs.h
+
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
# FreeBSD's nl_langinfo supports an option to specify whether the
# current locale uses month/day or day/month ordering. It makes the
# output a little prettier...
@@ -17303,32 +17896,7 @@
if test "x$enable_xattr" != "xno"; then
- for ac_header in attr/xattr.h
-do :
- ac_fn_c_check_header_mongrel "$LINENO" "attr/xattr.h" "ac_cv_header_attr_xattr_h" "$ac_includes_default"
-if test "x$ac_cv_header_attr_xattr_h" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_ATTR_XATTR_H 1
-_ACEOF
-
-fi
-
-done
-
- for ac_header in sys/xattr.h sys/ea.h
-do :
- as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
-ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
-if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
- cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
-_ACEOF
-
-fi
-
-done
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing setxattr" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing setxattr" >&5
$as_echo_n "checking for library containing setxattr... " >&6; }
if ${ac_cv_search_setxattr+:} false; then :
$as_echo_n "(cached) " >&6
@@ -17384,31 +17952,45 @@
fi
- for ac_func in extattr_get_file extattr_list_file
-do :
- as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
- cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
-_ACEOF
+ ac_fn_c_check_decl "$LINENO" "EXTATTR_NAMESPACE_USER" "ac_cv_have_decl_EXTATTR_NAMESPACE_USER" "#include <sys/types.h>
+#include <sys/extattr.h>
+"
+if test "x$ac_cv_have_decl_EXTATTR_NAMESPACE_USER" = xyes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
fi
-done
- for ac_func in extattr_set_fd extattr_set_file
-do :
- as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
-ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
-if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
- cat >>confdefs.h <<_ACEOF
-#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_EXTATTR_NAMESPACE_USER $ac_have_decl
_ACEOF
+ ac_fn_c_check_decl "$LINENO" "XATTR_NOFOLLOW" "ac_cv_have_decl_XATTR_NOFOLLOW" "#include <sys/xattr.h>
+
+"
+if test "x$ac_cv_have_decl_XATTR_NOFOLLOW" = xyes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
fi
-done
- for ac_func in fgetxattr flistxattr fsetxattr getxattr
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_XATTR_NOFOLLOW $ac_have_decl
+_ACEOF
+
+ if test "x$ac_cv_header_sys_xattr_h" = "xyes" \
+ -a "x$ac_cv_have_decl_XATTR_NOFOLLOW" = "xyes"; then
+ # Darwin extended attributes support
+ if ${ac_cv_archive_xattr_darwin+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ for ac_func in fgetxattr \
+ flistxattr \
+ fsetxattr \
+ getxattr \
+ listxattr \
+ setxattr
do :
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
@@ -17416,11 +17998,30 @@
cat >>confdefs.h <<_ACEOF
#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
_ACEOF
-
+ ac_cv_archive_xattr_darwin=yes
+else
+ ac_cv_archive_xattr_darwin=no
fi
done
- for ac_func in lgetxattr listxattr llistxattr lsetxattr
+
+
+fi
+
+ elif test "x$ac_cv_header_sys_extattr_h" = "xyes" \
+ -a "x$ac_cv_have_decl_EXTATTR_NAMESPACE_USER" = "xyes"; then
+ # FreeBSD extended attributes support
+ if ${ac_cv_archive_xattr_freebsd+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ for ac_func in extattr_get_fd \
+ extattr_get_file \
+ extattr_get_link \
+ extattr_list_fd \
+ extattr_list_file \
+ extattr_list_link \
+ extattr_set_fd \
+ extattr_set_link
do :
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
@@ -17428,11 +18029,30 @@
cat >>confdefs.h <<_ACEOF
#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
_ACEOF
-
+ ac_cv_archive_xattr_freebsd=yes
+else
+ ac_cv_archive_xattr_freebsd=no
fi
done
- for ac_func in fgetea flistea fsetea getea
+
+
+fi
+
+ elif test "x$ac_cv_header_sys_xattr_h" = "xyes" \
+ -o "x$ac_cv_header_attr_xattr_h" = "xyes"; then
+ # Linux extended attributes support
+ if ${ac_cv_archive_xattr_linux+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ for ac_func in fgetxattr \
+ flistxattr \
+ fsetxattr \
+ getxattr \
+ lgetxattr \
+ listxattr \
+ llistxattr \
+ lsetxattr
do :
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
@@ -17440,11 +18060,29 @@
cat >>confdefs.h <<_ACEOF
#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
_ACEOF
-
+ ac_cv_archive_xattr_linux=yes
+else
+ ac_cv_archive_xattr_linux=no
fi
done
- for ac_func in lgetea listea llistea lsetea
+
+
+fi
+
+ elif test "x$ac_cv_header_sys_ea_h" = "xyes"; then
+ # AIX extended attributes support
+ if ${ac_cv_archive_xattr_aix+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ for ac_func in fgetea \
+ flistea \
+ fsetea \
+ getea \
+ lgetea \
+ listea \
+ llistea \
+ lsetea
do :
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
@@ -17452,24 +18090,48 @@
cat >>confdefs.h <<_ACEOF
#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
_ACEOF
-
+ ac_cv_archive_xattr_aix=yes
+else
+ ac_cv_archive_xattr_aix=no
fi
done
- ac_fn_c_check_decl "$LINENO" "EXTATTR_NAMESPACE_USER" "ac_cv_have_decl_EXTATTR_NAMESPACE_USER" "#include <sys/types.h>
-#include <sys/extattr.h>
-"
-if test "x$ac_cv_have_decl_EXTATTR_NAMESPACE_USER" = xyes; then :
- ac_have_decl=1
-else
- ac_have_decl=0
+
fi
-cat >>confdefs.h <<_ACEOF
-#define HAVE_DECL_EXTATTR_NAMESPACE_USER $ac_have_decl
-_ACEOF
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for extended attributes support" >&5
+$as_echo_n "checking for extended attributes support... " >&6; }
+ if test "x$ac_cv_archive_xattr_linux" = "xyes"; then
+
+$as_echo "#define ARCHIVE_XATTR_LINUX 1" >>confdefs.h
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: Linux" >&5
+$as_echo "Linux" >&6; }
+ elif test "x$ac_cv_archive_xattr_darwin" = "xyes"; then
+
+$as_echo "#define ARCHIVE_XATTR_DARWIN 1" >>confdefs.h
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: Darwin" >&5
+$as_echo "Darwin" >&6; }
+ elif test "x$ac_cv_archive_xattr_freebsd" = "xyes"; then
+
+$as_echo "#define ARCHIVE_XATTR_FREEBSD 1" >>confdefs.h
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: FreeBSD" >&5
+$as_echo "FreeBSD" >&6; }
+ elif test "x$ac_cv_archive_xattr_aix" = "xyes"; then
+
+$as_echo "#define ARCHIVE_XATTR_AIX 1" >>confdefs.h
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: AIX" >&5
+$as_echo "AIX" >&6; }
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
+$as_echo "none" >&6; }
+ fi
fi
# Check for ACL support
@@ -17486,31 +18148,8 @@
if test "x$enable_acl" != "xno"; then
- for ac_header in acl/libacl.h
-do :
- ac_fn_c_check_header_mongrel "$LINENO" "acl/libacl.h" "ac_cv_header_acl_libacl_h" "$ac_includes_default"
-if test "x$ac_cv_header_acl_libacl_h" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_ACL_LIBACL_H 1
-_ACEOF
-
-fi
-
-done
-
- for ac_header in sys/acl.h
-do :
- ac_fn_c_check_header_mongrel "$LINENO" "sys/acl.h" "ac_cv_header_sys_acl_h" "$ac_includes_default"
-if test "x$ac_cv_header_sys_acl_h" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_SYS_ACL_H 1
-_ACEOF
-
-fi
-
-done
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for acl_get_file in -lacl" >&5
+ # Libacl
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for acl_get_file in -lacl" >&5
$as_echo_n "checking for acl_get_file in -lacl... " >&6; }
if ${ac_cv_lib_acl_acl_get_file+:} false; then :
$as_echo_n "(cached) " >&6
@@ -17555,7 +18194,155 @@
fi
- for ac_func in acl_create_entry acl_init acl_set_fd acl_set_fd_np acl_set_file
+
+ ac_fn_c_check_type "$LINENO" "acl_t" "ac_cv_type_acl_t" "
+ #if HAVE_SYS_TYPES_H
+ #include <sys/types.h>
+ #endif
+ #if HAVE_SYS_ACL_H
+ #include <sys/acl.h>
+ #endif
+
+"
+if test "x$ac_cv_type_acl_t" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_ACL_T 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_type "$LINENO" "acl_entry_t" "ac_cv_type_acl_entry_t" "
+ #if HAVE_SYS_TYPES_H
+ #include <sys/types.h>
+ #endif
+ #if HAVE_SYS_ACL_H
+ #include <sys/acl.h>
+ #endif
+
+"
+if test "x$ac_cv_type_acl_entry_t" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_ACL_ENTRY_T 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_type "$LINENO" "acl_permset_t" "ac_cv_type_acl_permset_t" "
+ #if HAVE_SYS_TYPES_H
+ #include <sys/types.h>
+ #endif
+ #if HAVE_SYS_ACL_H
+ #include <sys/acl.h>
+ #endif
+
+"
+if test "x$ac_cv_type_acl_permset_t" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_ACL_PERMSET_T 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_type "$LINENO" "acl_tag_t" "ac_cv_type_acl_tag_t" "
+ #if HAVE_SYS_TYPES_H
+ #include <sys/types.h>
+ #endif
+ #if HAVE_SYS_ACL_H
+ #include <sys/acl.h>
+ #endif
+
+"
+if test "x$ac_cv_type_acl_tag_t" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_ACL_TAG_T 1
+_ACEOF
+
+
+fi
+
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for richacl_get_file in -lrichacl" >&5
+$as_echo_n "checking for richacl_get_file in -lrichacl... " >&6; }
+if ${ac_cv_lib_richacl_richacl_get_file+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lrichacl $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char richacl_get_file ();
+int
+main ()
+{
+return richacl_get_file ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_richacl_richacl_get_file=yes
+else
+ ac_cv_lib_richacl_richacl_get_file=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_richacl_richacl_get_file" >&5
+$as_echo "$ac_cv_lib_richacl_richacl_get_file" >&6; }
+if test "x$ac_cv_lib_richacl_richacl_get_file" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBRICHACL 1
+_ACEOF
+
+ LIBS="-lrichacl $LIBS"
+
+fi
+
+
+ ac_fn_c_check_type "$LINENO" "struct richace" "ac_cv_type_struct_richace" "
+ #if HAVE_SYS_RICHACL_H
+ #include <sys/richacl.h>
+ #endif
+
+"
+if test "x$ac_cv_type_struct_richace" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_RICHACE 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_type "$LINENO" "struct richacl" "ac_cv_type_struct_richacl" "
+ #if HAVE_SYS_RICHACL_H
+ #include <sys/richacl.h>
+ #endif
+
+"
+if test "x$ac_cv_type_struct_richacl" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_RICHACL 1
+_ACEOF
+
+
+fi
+
+
+ # Solaris and derivates ACLs
+ for ac_func in acl facl
do :
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
@@ -17568,30 +18355,196 @@
done
- ac_fn_c_check_type "$LINENO" "acl_permset_t" "ac_cv_type_acl_permset_t" "#if HAVE_SYS_TYPES_H
- #include <sys/types.h>
- #endif
- #if HAVE_SYS_ACL_H
- #include <sys/acl.h>
- #endif
+ if test "x$ac_cv_lib_richacl_richacl_get_file" = "xyes" \
+ -a "x$ac_cv_type_struct_richace" = "xyes" \
+ -a "x$ac_cv_type_struct_richacl" = "xyes"; then
+ if ${ac_cv_archive_acl_librichacl+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ for ac_func in richacl_alloc \
+ richacl_equiv_mode \
+ richacl_free \
+ richacl_get_fd \
+ richacl_get_file \
+ richacl_set_fd \
+ richacl_set_file
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+ ac_cv_archive_acl_librichacl=yes
+else
+ ac_cv_archive_acl_librichacl=no
+fi
+done
+fi
+
+ fi
+
+ if test "x$ac_cv_func_acl" = "xyes" \
+ -a "x$ac_cv_func_facl" = "xyes"; then
+ ac_fn_c_check_type "$LINENO" "aclent_t" "ac_cv_type_aclent_t" "#include <sys/acl.h>
"
-if test "x$ac_cv_type_acl_permset_t" = xyes; then :
+if test "x$ac_cv_type_aclent_t" = xyes; then :
cat >>confdefs.h <<_ACEOF
-#define HAVE_ACL_PERMSET_T 1
+#define HAVE_ACLENT_T 1
_ACEOF
fi
+ if test "x$ac_cv_type_aclent_t" = "xyes"; then
+ if ${ac_cv_archive_acl_sunos+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_fn_c_check_decl "$LINENO" "GETACL" "ac_cv_have_decl_GETACL" "#include <sys/acl.h>
+"
+if test "x$ac_cv_have_decl_GETACL" = xyes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
- # The "acl_get_perm()" function was omitted from the POSIX draft.
- # (It's a pretty obvious oversight; otherwise, there's no way to
- # test for specific permissions in a permset.) Linux uses the obvious
- # name, FreeBSD adds _np to mark it as "non-Posix extension."
- # Test for both as a double-check that we really have POSIX-style ACL support.
- for ac_func in acl_get_perm_np acl_get_perm acl_get_link acl_get_link_np
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_GETACL $ac_have_decl
+_ACEOF
+if test $ac_have_decl = 1; then :
+ ac_cv_archive_acl_sunos=yes
+else
+ ac_cv_archive_acl_sunos=no
+fi
+ac_fn_c_check_decl "$LINENO" "SETACL" "ac_cv_have_decl_SETACL" "#include <sys/acl.h>
+"
+if test "x$ac_cv_have_decl_SETACL" = xyes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_SETACL $ac_have_decl
+_ACEOF
+if test $ac_have_decl = 1; then :
+ ac_cv_archive_acl_sunos=yes
+else
+ ac_cv_archive_acl_sunos=no
+fi
+ac_fn_c_check_decl "$LINENO" "GETACLCNT" "ac_cv_have_decl_GETACLCNT" "#include <sys/acl.h>
+"
+if test "x$ac_cv_have_decl_GETACLCNT" = xyes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_GETACLCNT $ac_have_decl
+_ACEOF
+if test $ac_have_decl = 1; then :
+ ac_cv_archive_acl_sunos=yes
+else
+ ac_cv_archive_acl_sunos=no
+fi
+
+fi
+
+ ac_fn_c_check_type "$LINENO" "ace_t" "ac_cv_type_ace_t" "#include <sys/acl.h>
+"
+if test "x$ac_cv_type_ace_t" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_ACE_T 1
+_ACEOF
+
+
+fi
+
+ if test "x$ac_cv_type_ace_t" = "xyes"; then
+ if ${ac_cv_archive_acl_sunos_nfs4+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_fn_c_check_decl "$LINENO" "ACE_GETACL" "ac_cv_have_decl_ACE_GETACL" "#include <sys/acl.h>
+"
+if test "x$ac_cv_have_decl_ACE_GETACL" = xyes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_ACE_GETACL $ac_have_decl
+_ACEOF
+if test $ac_have_decl = 1; then :
+ ac_cv_archive_acl_sunos_nfs4=yes
+else
+ ac_cv_archive_acl_sonos_nfs4=no
+fi
+ac_fn_c_check_decl "$LINENO" "ACE_SETACL" "ac_cv_have_decl_ACE_SETACL" "#include <sys/acl.h>
+"
+if test "x$ac_cv_have_decl_ACE_SETACL" = xyes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_ACE_SETACL $ac_have_decl
+_ACEOF
+if test $ac_have_decl = 1; then :
+ ac_cv_archive_acl_sunos_nfs4=yes
+else
+ ac_cv_archive_acl_sonos_nfs4=no
+fi
+ac_fn_c_check_decl "$LINENO" "ACE_GETACLCNT" "ac_cv_have_decl_ACE_GETACLCNT" "#include <sys/acl.h>
+"
+if test "x$ac_cv_have_decl_ACE_GETACLCNT" = xyes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_ACE_GETACLCNT $ac_have_decl
+_ACEOF
+if test $ac_have_decl = 1; then :
+ ac_cv_archive_acl_sunos_nfs4=yes
+else
+ ac_cv_archive_acl_sonos_nfs4=no
+fi
+
+fi
+
+ fi
+ fi
+ elif test "x$ac_cv_type_acl_t" = "xyes" \
+ -a "x$ac_cv_type_acl_entry_t" = "xyes" \
+ -a "x$ac_cv_type_acl_permset_t" = "xyes" \
+ -a "x$ac_cv_type_acl_tag_t" = "xyes"; then
+ # POSIX.1e ACL functions
+ if ${ac_cv_posix_acl_funcs+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ for ac_func in acl_add_perm \
+ acl_clear_perms \
+ acl_create_entry \
+ acl_delete_def_file \
+ acl_free \
+ acl_get_entry \
+ acl_get_fd \
+ acl_get_file \
+ acl_get_permset \
+ acl_get_qualifier \
+ acl_get_tag_type \
+ acl_init \
+ acl_set_fd \
+ acl_set_file \
+ acl_set_qualifier \
+ acl_set_tag_type
do :
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
@@ -17599,23 +18552,274 @@
cat >>confdefs.h <<_ACEOF
#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
_ACEOF
+ ac_cv_posix_acl_funcs=yes
+else
+ ac_cv_posix_acl_funcs=no
+fi
+done
+
fi
+
+
+ for ac_func in acl_get_perm
+do :
+ ac_fn_c_check_func "$LINENO" "acl_get_perm" "ac_cv_func_acl_get_perm"
+if test "x$ac_cv_func_acl_get_perm" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_ACL_GET_PERM 1
+_ACEOF
+
+fi
done
- # MacOS has an acl.h that isn't POSIX. It can be detected by
- # checking for ACL_USER
- ac_fn_c_check_decl "$LINENO" "ACL_USER" "ac_cv_have_decl_ACL_USER" "#include <sys/acl.h>
+ if test "x$ac_cv_posix_acl_funcs" = "xyes" \
+ -a "x$ac_cv_header_acl_libacl_h" = "xyes" \
+ -a "x$ac_cv_lib_acl_acl_get_file" = "xyes" \
+ -a "x$ac_cv_func_acl_get_perm"; then
+ if ${ac_cv_archive_acl_libacl+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_archive_acl_libacl=yes
+fi
+
+
+$as_echo "#define ARCHIVE_ACL_LIBACL 1" >>confdefs.h
+
+ else
+ # FreeBSD/Darwin
+ for ac_func in acl_add_flag_np \
+ acl_clear_flags_np \
+ acl_get_brand_np \
+ acl_get_entry_type_np \
+ acl_get_flag_np \
+ acl_get_flagset_np \
+ acl_get_fd_np \
+ acl_get_link_np \
+ acl_get_perm_np \
+ acl_is_trivial_np \
+ acl_set_entry_type_np \
+ acl_set_fd_np \
+ acl_set_link_np
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+ for ac_func in mbr_uid_to_uuid \
+ mbr_uuid_to_id \
+ mbr_gid_to_uuid
+do :
+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
+if eval test \"x\$"$as_ac_var"\" = x"yes"; then :
+ cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+ ac_fn_c_check_decl "$LINENO" "ACL_TYPE_EXTENDED" "ac_cv_have_decl_ACL_TYPE_EXTENDED" "#include <sys/types.h>
+ #include <sys/acl.h>
"
+if test "x$ac_cv_have_decl_ACL_TYPE_EXTENDED" = xyes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_ACL_TYPE_EXTENDED $ac_have_decl
+_ACEOF
+ac_fn_c_check_decl "$LINENO" "ACL_TYPE_NFS4" "ac_cv_have_decl_ACL_TYPE_NFS4" "#include <sys/types.h>
+ #include <sys/acl.h>
+"
+if test "x$ac_cv_have_decl_ACL_TYPE_NFS4" = xyes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_ACL_TYPE_NFS4 $ac_have_decl
+_ACEOF
+ac_fn_c_check_decl "$LINENO" "ACL_USER" "ac_cv_have_decl_ACL_USER" "#include <sys/types.h>
+ #include <sys/acl.h>
+"
if test "x$ac_cv_have_decl_ACL_USER" = xyes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
-$as_echo "#define HAVE_ACL_USER 1" >>confdefs.h
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_ACL_USER $ac_have_decl
+_ACEOF
+ac_fn_c_check_decl "$LINENO" "ACL_SYNCHRONIZE" "ac_cv_have_decl_ACL_SYNCHRONIZE" "#include <sys/types.h>
+ #include <sys/acl.h>
+"
+if test "x$ac_cv_have_decl_ACL_SYNCHRONIZE" = xyes; then :
+ ac_have_decl=1
+else
+ ac_have_decl=0
+fi
+cat >>confdefs.h <<_ACEOF
+#define HAVE_DECL_ACL_SYNCHRONIZE $ac_have_decl
+_ACEOF
+
+ if test "x$ac_cv_posix_acl_funcs" = "xyes" \
+ -a "x$ac_cv_func_acl_get_fd_np" = "xyes" \
+ -a "x$ac_cv_func_acl_get_perm" != "xyes" \
+ -a "x$ac_cv_func_acl_get_perm_np" = "xyes" \
+ -a "x$ac_cv_func_acl_set_fd_np" = "xyes"; then
+ if test "x$ac_cv_have_decl_ACL_USER" = "xyes"; then
+ if ${ac_cv_archive_acl_freebsd+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_archive_acl_freebsd=yes
fi
+ if test "x$ac_cv_have_decl_ACL_TYPE_NFS4" = "xyes" \
+ -a "x$ac_cv_func_acl_add_flag_np" = "xyes" \
+ -a "x$ac_cv_func_acl_get_brand_np" = "xyes" \
+ -a "x$ac_cv_func_acl_get_entry_type_np" = "xyes" \
+ -a "x$ac_cv_func_acl_get_flagset_np" = "xyes" \
+ -a "x$ac_cv_func_acl_set_entry_type_np" = "xyes"; then
+ if ${ac_cv_archive_acl_freebsd_nfs4+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_archive_acl_freebsd_nfs4=yes
fi
+ fi
+ elif test "x$ac_cv_have_decl_ACL_TYPE_EXTENDED" = "xyes" \
+ -a "x$ac_cv_func_acl_add_flag_np" = "xyes" \
+ -a "x$ac_cv_func_acl_get_flagset_np" = "xyes" \
+ -a "x$ac_cv_func_acl_get_link_np" = "xyes" \
+ -a "x$ac_cv_func_acl_set_link_np" = "xyes" \
+ -a "x$ac_cv_func_mbr_uid_to_uuid" = "xyes" \
+ -a "x$ac_cv_func_mbr_uuid_to_id" = "xyes" \
+ -a "x$ac_cv_func_mbr_gid_to_uuid" = "xyes"; then
+ if ${ac_cv_archive_acl_darwin+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_cv_archive_acl_darwin=yes
+fi
+
+ fi
+ fi
+ fi
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ACL support" >&5
+$as_echo_n "checking for ACL support... " >&6; }
+ if test "x$ac_cv_archive_acl_libacl" = "xyes" \
+ -a "x$ac_cv_archive_acl_librichacl" = "xyes"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: libacl (POSIX.1e) + librichacl (NFSv4)" >&5
+$as_echo "libacl (POSIX.1e) + librichacl (NFSv4)" >&6; }
+
+$as_echo "#define ARCHIVE_ACL_LIBACL 1" >>confdefs.h
+
+
+$as_echo "#define ARCHIVE_ACL_LIBRICHACL 1" >>confdefs.h
+
+ elif test "x$ac_cv_archive_acl_libacl" = "xyes"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: libacl (POSIX.1e)" >&5
+$as_echo "libacl (POSIX.1e)" >&6; }
+
+$as_echo "#define ARCHIVE_ACL_LIBACL 1" >>confdefs.h
+
+ elif test "x$ac_cv_archive_acl_librichacl" = "xyes"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: librichacl (NFSv4)" >&5
+$as_echo "librichacl (NFSv4)" >&6; }
+
+$as_echo "#define ARCHIVE_ACL_LIBRICHACL 1" >>confdefs.h
+
+ elif test "x$ac_cv_archive_acl_darwin" = "xyes"; then
+
+$as_echo "#define ARCHIVE_ACL_DARWIN 1" >>confdefs.h
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: Darwin (limited NFSv4)" >&5
+$as_echo "Darwin (limited NFSv4)" >&6; }
+ elif test "x$ac_cv_archive_acl_sunos" = "xyes"; then
+
+$as_echo "#define ARCHIVE_ACL_SUNOS 1" >>confdefs.h
+
+ if test "x$ac_cv_archive_acl_sunos_nfs4" = "xyes"; then
+
+$as_echo "#define ARCHIVE_ACL_SUNOS_NFS4 1" >>confdefs.h
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: Solaris (POSIX.1e and NFSv4)" >&5
+$as_echo "Solaris (POSIX.1e and NFSv4)" >&6; }
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: Solaris (POSIX.1e)" >&5
+$as_echo "Solaris (POSIX.1e)" >&6; }
+ fi
+ elif test "x$ac_cv_archive_acl_freebsd" = "xyes"; then
+
+$as_echo "#define ARCHIVE_ACL_FREEBSD 1" >>confdefs.h
+
+ if test "x$ac_cv_archive_acl_freebsd_nfs4" = "xyes"; then
+
+$as_echo "#define ARCHIVE_ACL_FREEBSD_NFS4 1" >>confdefs.h
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: FreeBSD (POSIX.1e and NFSv4)" >&5
+$as_echo "FreeBSD (POSIX.1e and NFSv4)" >&6; }
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: FreeBSD (POSIX.1e)" >&5
+$as_echo "FreeBSD (POSIX.1e)" >&6; }
+ fi
+ else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
+$as_echo "none" >&6; }
+ fi
+fi
+
+
+ if test "x$ac_cv_archive_acl_libacl" = "xyes" \
+ -o "x$ac_cv_archive_acl_librichacl" = "xyes"; then
+ INC_LINUX_ACL_TRUE=
+ INC_LINUX_ACL_FALSE='#'
+else
+ INC_LINUX_ACL_TRUE='#'
+ INC_LINUX_ACL_FALSE=
+fi
+
+ if test "x$ac_cv_archive_acl_sunos" = "xyes"; then
+ INC_SUNOS_ACL_TRUE=
+ INC_SUNOS_ACL_FALSE='#'
+else
+ INC_SUNOS_ACL_TRUE='#'
+ INC_SUNOS_ACL_FALSE=
+fi
+
+ if test "x$ac_cv_archive_acl_darwin" = "xyes"; then
+ INC_DARWIN_ACL_TRUE=
+ INC_DARWIN_ACL_FALSE='#'
+else
+ INC_DARWIN_ACL_TRUE='#'
+ INC_DARWIN_ACL_FALSE=
+fi
+
+ if test "x$ac_cv_archive_acl_freebsd" = "xyes"; then
+ INC_FREEBSD_ACL_TRUE=
+ INC_FREEBSD_ACL_FALSE='#'
+else
+ INC_FREEBSD_ACL_TRUE='#'
+ INC_FREEBSD_ACL_FALSE=
+fi
+
+
# Additional requirements
# Check whether --enable-largefile was given.
if test "${enable_largefile+set}" = set; then :
@@ -17823,7 +19027,7 @@
case "$host_os" in
- *mingw* | *cygwin*)
+ *mingw* | *cygwin* | *msys*)
;;
*)
@@ -18611,6 +19815,27 @@
;;
esac
+if test "x$with_cng" != "xno"; then
+ for ac_header in bcrypt.h
+do :
+ ac_fn_c_check_header_compile "$LINENO" "bcrypt.h" "ac_cv_header_bcrypt_h" "#ifdef HAVE_WINDOWS_H
+ # include <windows.h>
+ #endif
+
+"
+if test "x$ac_cv_header_bcrypt_h" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_BCRYPT_H 1
+_ACEOF
+
+ LIBS="$LIBS -lbcrypt"
+
+fi
+
+done
+
+fi
+
if test "x$with_nettle" != "xno"; then
for ac_header in nettle/md5.h nettle/ripemd160.h nettle/sha.h
do :
@@ -18980,7 +20205,7 @@
saved_LIBS=$LIBS
case "$host_os" in
- *mingw* | *cygwin*)
+ *mingw* | *cygwin* | *msys*)
case "$host_cpu" in
x86_64)
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for OPENSSL_config in -leay64" >&5
@@ -19464,8 +20689,53 @@
done
fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_CIPHER_CTX_init in -lcrypto" >&5
+$as_echo_n "checking for EVP_CIPHER_CTX_init in -lcrypto... " >&6; }
+if ${ac_cv_lib_crypto_EVP_CIPHER_CTX_init+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lcrypto $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char EVP_CIPHER_CTX_init ();
+int
+main ()
+{
+return EVP_CIPHER_CTX_init ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_crypto_EVP_CIPHER_CTX_init=yes
+else
+ ac_cv_lib_crypto_EVP_CIPHER_CTX_init=no
fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_CIPHER_CTX_init" >&5
+$as_echo "$ac_cv_lib_crypto_EVP_CIPHER_CTX_init" >&6; }
+if test "x$ac_cv_lib_crypto_EVP_CIPHER_CTX_init" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBCRYPTO 1
+_ACEOF
+ LIBS="-lcrypto $LIBS"
+
+fi
+
+fi
+
# Probe libmd AFTER OpenSSL/libcrypto.
# The two are incompatible and OpenSSL is more complete.
for ac_header in md5.h ripemd.h sha.h sha256.h sha512.h
@@ -19762,7 +21032,7 @@
fi
case "$host_os" in
- *mingw* | *cygwin*)
+ *mingw* | *cygwin* | *msys*)
if test "$found_MD5" != yes; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking support for ARCHIVE_CRYPTO_MD5_WIN" >&5
@@ -20085,6 +21355,10 @@
am__EXEEXT_FALSE=
fi
+if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
+ as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
if test -z "${INC_WINDOWS_FILES_TRUE}" && test -z "${INC_WINDOWS_FILES_FALSE}"; then
as_fn_error $? "conditional \"INC_WINDOWS_FILES\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
@@ -20125,6 +21399,22 @@
as_fn_error $? "conditional \"STATIC_BSDCPIO\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
+if test -z "${INC_LINUX_ACL_TRUE}" && test -z "${INC_LINUX_ACL_FALSE}"; then
+ as_fn_error $? "conditional \"INC_LINUX_ACL\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${INC_SUNOS_ACL_TRUE}" && test -z "${INC_SUNOS_ACL_FALSE}"; then
+ as_fn_error $? "conditional \"INC_SUNOS_ACL\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${INC_DARWIN_ACL_TRUE}" && test -z "${INC_DARWIN_ACL_FALSE}"; then
+ as_fn_error $? "conditional \"INC_DARWIN_ACL\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${INC_FREEBSD_ACL_TRUE}" && test -z "${INC_FREEBSD_ACL_FALSE}"; then
+ as_fn_error $? "conditional \"INC_FREEBSD_ACL\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
: "${CONFIG_STATUS=./config.status}"
ac_write_fail=0
@@ -20522,7 +21812,7 @@
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by libarchive $as_me 3.2.1, which was
+This file was extended by libarchive $as_me 3.3.2, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -20588,7 +21878,7 @@
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-libarchive config.status 3.2.1
+libarchive config.status 3.3.2
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
@@ -20726,6 +22016,7 @@
enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`'
pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`'
enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`'
+shared_archive_member_spec='`$ECHO "$shared_archive_member_spec" | $SED "$delay_single_quote_subst"`'
SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`'
ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`'
PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`'
@@ -20773,10 +22064,13 @@
GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`'
lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`'
lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_import='`$ECHO "$lt_cv_sys_global_symbol_to_import" | $SED "$delay_single_quote_subst"`'
lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`'
lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`'
+lt_cv_nm_interface='`$ECHO "$lt_cv_nm_interface" | $SED "$delay_single_quote_subst"`'
nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`'
lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`'
+lt_cv_truncate_bin='`$ECHO "$lt_cv_truncate_bin" | $SED "$delay_single_quote_subst"`'
objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`'
MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`'
lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`'
@@ -20841,7 +22135,8 @@
finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`'
hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`'
sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`'
-sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`'
+configure_time_dlsearch_path='`$ECHO "$configure_time_dlsearch_path" | $SED "$delay_single_quote_subst"`'
+configure_time_lt_sys_library_path='`$ECHO "$configure_time_lt_sys_library_path" | $SED "$delay_single_quote_subst"`'
hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`'
enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`'
enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`'
@@ -20893,9 +22188,12 @@
compiler \
lt_cv_sys_global_symbol_pipe \
lt_cv_sys_global_symbol_to_cdecl \
+lt_cv_sys_global_symbol_to_import \
lt_cv_sys_global_symbol_to_c_name_address \
lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \
+lt_cv_nm_interface \
nm_file_list_spec \
+lt_cv_truncate_bin \
lt_prog_compiler_no_builtin_flag \
lt_prog_compiler_pic \
lt_prog_compiler_wl \
@@ -20930,7 +22228,7 @@
striplib; do
case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
*[\\\\\\\`\\"\\\$]*)
- eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
+ eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
;;
*)
eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
@@ -20957,10 +22255,11 @@
postuninstall_cmds \
finish_cmds \
sys_lib_search_path_spec \
-sys_lib_dlsearch_path_spec; do
+configure_time_dlsearch_path \
+configure_time_lt_sys_library_path; do
case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
*[\\\\\\\`\\"\\\$]*)
- eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
+ eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" ## exclude from sc_prohibit_nested_quotes
;;
*)
eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
@@ -20969,12 +22268,10 @@
done
ac_aux_dir='$ac_aux_dir'
-xsi_shell='$xsi_shell'
-lt_shell_append='$lt_shell_append'
-# See if we are running on zsh, and set the options which allow our
+# See if we are running on zsh, and set the options that allow our
# commands through without removal of \ escapes INIT.
-if test -n "\${ZSH_VERSION+set}" ; then
+if test -n "\${ZSH_VERSION+set}"; then
setopt NO_GLOB_SUBST
fi
@@ -20981,7 +22278,6 @@
PACKAGE='$PACKAGE'
VERSION='$VERSION'
- TIMESTAMP='$TIMESTAMP'
RM='$RM'
ofile='$ofile'
@@ -21692,56 +22988,53 @@
;;
"libtool":C)
- # See if we are running on zsh, and set the options which allow our
+ # See if we are running on zsh, and set the options that allow our
# commands through without removal of \ escapes.
- if test -n "${ZSH_VERSION+set}" ; then
+ if test -n "${ZSH_VERSION+set}"; then
setopt NO_GLOB_SUBST
fi
- cfgfile="${ofile}T"
+ cfgfile=${ofile}T
trap "$RM \"$cfgfile\"; exit 1" 1 2 15
$RM "$cfgfile"
cat <<_LT_EOF >> "$cfgfile"
#! $SHELL
+# Generated automatically by $as_me ($PACKAGE) $VERSION
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
-# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
-# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
-# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
-# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+# Provide generalized library-building support services.
+# Written by Gordon Matzigkeit, 1996
+
+# Copyright (C) 2014 Free Software Foundation, Inc.
+# This is free software; see the source for copying conditions. There is NO
+# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+
+# GNU Libtool is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of of the License, or
+# (at your option) any later version.
#
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
-# 2006, 2007, 2008, 2009, 2010, 2011 Free Software
-# Foundation, Inc.
-# Written by Gordon Matzigkeit, 1996
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program or library that is built
+# using GNU Libtool, you may include this file under the same
+# distribution terms that you use for the rest of that program.
#
-# This file is part of GNU Libtool.
-#
-# GNU Libtool is free software; you can redistribute it and/or
-# modify it under the terms of the GNU General Public License as
-# published by the Free Software Foundation; either version 2 of
-# the License, or (at your option) any later version.
-#
-# As a special exception to the GNU General Public License,
-# if you distribute this file as part of a program or library that
-# is built using GNU Libtool, you may include this file under the
-# same distribution terms that you use for the rest of that program.
-#
-# GNU Libtool is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# GNU Libtool is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with GNU Libtool; see the file COPYING. If not, a copy
-# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
-# obtained by writing to the Free Software Foundation, Inc.,
-# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
# The names of the tagged configurations supported by this script.
-available_tags=""
+available_tags=''
+# Configured defaults for sys_lib_dlsearch_path munging.
+: \${LT_SYS_LIBRARY_PATH="$configure_time_lt_sys_library_path"}
+
# ### BEGIN LIBTOOL CONFIG
# Assembler program.
@@ -21769,6 +23062,9 @@
# Whether or not to optimize for fast installation.
fast_install=$enable_fast_install
+# Shared archive member basename,for filename based shared library versioning on AIX.
+shared_archive_member_spec=$shared_archive_member_spec
+
# Shell to use when invoking shell scripts.
SHELL=$lt_SHELL
@@ -21880,6 +23176,9 @@
# Transform the output of nm in a proper C declaration.
global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+# Transform the output of nm into a list of symbols to manually relocate.
+global_symbol_to_import=$lt_lt_cv_sys_global_symbol_to_import
+
# Transform the output of nm in a C name address pair.
global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
@@ -21886,12 +23185,18 @@
# Transform the output of nm in a C name address pair when lib prefix is needed.
global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix
+# The name lister interface.
+nm_interface=$lt_lt_cv_nm_interface
+
# Specify filename containing input files for \$NM.
nm_file_list_spec=$lt_nm_file_list_spec
-# The root where to search for dependent libraries,and in which our libraries should be installed.
+# The root where to search for dependent libraries,and where our libraries should be installed.
lt_sysroot=$lt_sysroot
+# Command to truncate a binary pipe.
+lt_truncate_bin=$lt_lt_cv_truncate_bin
+
# The name of the directory that contains temporary libtool files.
objdir=$objdir
@@ -21982,9 +23287,12 @@
# Compile-time system search path for libraries.
sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
-# Run-time system search path for libraries.
-sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+# Detected run-time system search path for libraries.
+sys_lib_dlsearch_path_spec=$lt_configure_time_dlsearch_path
+# Explicit LT_SYS_LIBRARY_PATH set during ./configure time.
+configure_time_lt_sys_library_path=$lt_configure_time_lt_sys_library_path
+
# Whether dlopen is supported.
dlopen_support=$enable_dlopen
@@ -22076,13 +23384,13 @@
# Whether we need a single "-rpath" flag with a separated argument.
hardcode_libdir_separator=$lt_hardcode_libdir_separator
-# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes
# DIR into the resulting binary.
hardcode_direct=$hardcode_direct
-# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# Set to "yes" if using DIR/libNAME\$shared_ext during linking hardcodes
# DIR into the resulting binary and the resulting library dependency is
-# "absolute",i.e impossible to change by setting \${shlibpath_var} if the
+# "absolute",i.e impossible to change by setting \$shlibpath_var if the
# library is relocated.
hardcode_direct_absolute=$hardcode_direct_absolute
@@ -22134,6 +23442,65 @@
_LT_EOF
+ cat <<'_LT_EOF' >> "$cfgfile"
+
+# ### BEGIN FUNCTIONS SHARED WITH CONFIGURE
+
+# func_munge_path_list VARIABLE PATH
+# -----------------------------------
+# VARIABLE is name of variable containing _space_ separated list of
+# directories to be munged by the contents of PATH, which is string
+# having a format:
+# "DIR[:DIR]:"
+# string "DIR[ DIR]" will be prepended to VARIABLE
+# ":DIR[:DIR]"
+# string "DIR[ DIR]" will be appended to VARIABLE
+# "DIRP[:DIRP]::[DIRA:]DIRA"
+# string "DIRP[ DIRP]" will be prepended to VARIABLE and string
+# "DIRA[ DIRA]" will be appended to VARIABLE
+# "DIR[:DIR]"
+# VARIABLE will be replaced by "DIR[ DIR]"
+func_munge_path_list ()
+{
+ case x$2 in
+ x)
+ ;;
+ *:)
+ eval $1=\"`$ECHO $2 | $SED 's/:/ /g'` \$$1\"
+ ;;
+ x:*)
+ eval $1=\"\$$1 `$ECHO $2 | $SED 's/:/ /g'`\"
+ ;;
+ *::*)
+ eval $1=\"\$$1\ `$ECHO $2 | $SED -e 's/.*:://' -e 's/:/ /g'`\"
+ eval $1=\"`$ECHO $2 | $SED -e 's/::.*//' -e 's/:/ /g'`\ \$$1\"
+ ;;
+ *)
+ eval $1=\"`$ECHO $2 | $SED 's/:/ /g'`\"
+ ;;
+ esac
+}
+
+
+# Calculate cc_basename. Skip known compiler wrappers and cross-prefix.
+func_cc_basename ()
+{
+ for cc_temp in $*""; do
+ case $cc_temp in
+ compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+ distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+ \-*) ;;
+ *) break;;
+ esac
+ done
+ func_cc_basename_result=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+}
+
+
+# ### END FUNCTIONS SHARED WITH CONFIGURE
+
+_LT_EOF
+
case $host_os in
aix3*)
cat <<\_LT_EOF >> "$cfgfile"
@@ -22140,7 +23507,7 @@
# AIX sometimes has problems with the GCC collect2 program. For some
# reason, if we set the COLLECT_NAMES environment variable, the problems
# vanish in a puff of smoke.
-if test "X${COLLECT_NAMES+set}" != Xset; then
+if test set != "${COLLECT_NAMES+set}"; then
COLLECT_NAMES=
export COLLECT_NAMES
fi
@@ -22149,7 +23516,7 @@
esac
-ltmain="$ac_aux_dir/ltmain.sh"
+ltmain=$ac_aux_dir/ltmain.sh
# We use sed instead of cat because bash on DJGPP gets confused if
@@ -22159,165 +23526,6 @@
sed '$q' "$ltmain" >> "$cfgfile" \
|| (rm -f "$cfgfile"; exit 1)
- if test x"$xsi_shell" = xyes; then
- sed -e '/^func_dirname ()$/,/^} # func_dirname /c\
-func_dirname ()\
-{\
-\ case ${1} in\
-\ */*) func_dirname_result="${1%/*}${2}" ;;\
-\ * ) func_dirname_result="${3}" ;;\
-\ esac\
-} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \
- && mv -f "$cfgfile.tmp" "$cfgfile" \
- || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
- sed -e '/^func_basename ()$/,/^} # func_basename /c\
-func_basename ()\
-{\
-\ func_basename_result="${1##*/}"\
-} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \
- && mv -f "$cfgfile.tmp" "$cfgfile" \
- || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
- sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\
-func_dirname_and_basename ()\
-{\
-\ case ${1} in\
-\ */*) func_dirname_result="${1%/*}${2}" ;;\
-\ * ) func_dirname_result="${3}" ;;\
-\ esac\
-\ func_basename_result="${1##*/}"\
-} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \
- && mv -f "$cfgfile.tmp" "$cfgfile" \
- || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
- sed -e '/^func_stripname ()$/,/^} # func_stripname /c\
-func_stripname ()\
-{\
-\ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\
-\ # positional parameters, so assign one to ordinary parameter first.\
-\ func_stripname_result=${3}\
-\ func_stripname_result=${func_stripname_result#"${1}"}\
-\ func_stripname_result=${func_stripname_result%"${2}"}\
-} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \
- && mv -f "$cfgfile.tmp" "$cfgfile" \
- || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
- sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\
-func_split_long_opt ()\
-{\
-\ func_split_long_opt_name=${1%%=*}\
-\ func_split_long_opt_arg=${1#*=}\
-} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \
- && mv -f "$cfgfile.tmp" "$cfgfile" \
- || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
- sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\
-func_split_short_opt ()\
-{\
-\ func_split_short_opt_arg=${1#??}\
-\ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\
-} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \
- && mv -f "$cfgfile.tmp" "$cfgfile" \
- || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
- sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\
-func_lo2o ()\
-{\
-\ case ${1} in\
-\ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\
-\ *) func_lo2o_result=${1} ;;\
-\ esac\
-} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \
- && mv -f "$cfgfile.tmp" "$cfgfile" \
- || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
- sed -e '/^func_xform ()$/,/^} # func_xform /c\
-func_xform ()\
-{\
- func_xform_result=${1%.*}.lo\
-} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \
- && mv -f "$cfgfile.tmp" "$cfgfile" \
- || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
- sed -e '/^func_arith ()$/,/^} # func_arith /c\
-func_arith ()\
-{\
- func_arith_result=$(( $* ))\
-} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \
- && mv -f "$cfgfile.tmp" "$cfgfile" \
- || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
- sed -e '/^func_len ()$/,/^} # func_len /c\
-func_len ()\
-{\
- func_len_result=${#1}\
-} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \
- && mv -f "$cfgfile.tmp" "$cfgfile" \
- || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-fi
-
-if test x"$lt_shell_append" = xyes; then
- sed -e '/^func_append ()$/,/^} # func_append /c\
-func_append ()\
-{\
- eval "${1}+=\\${2}"\
-} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \
- && mv -f "$cfgfile.tmp" "$cfgfile" \
- || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
- sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\
-func_append_quoted ()\
-{\
-\ func_quote_for_eval "${2}"\
-\ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\
-} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \
- && mv -f "$cfgfile.tmp" "$cfgfile" \
- || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
-test 0 -eq $? || _lt_function_replace_fail=:
-
-
- # Save a `func_append' function call where possible by direct use of '+='
- sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
- && mv -f "$cfgfile.tmp" "$cfgfile" \
- || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
- test 0 -eq $? || _lt_function_replace_fail=:
-else
- # Save a `func_append' function call even when '+=' is not available
- sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
- && mv -f "$cfgfile.tmp" "$cfgfile" \
- || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
- test 0 -eq $? || _lt_function_replace_fail=:
-fi
-
-if test x"$_lt_function_replace_fail" = x":"; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5
-$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;}
-fi
-
-
mv -f "$cfgfile" "$ofile" ||
(rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
chmod +x "$ofile"
Modified: trunk/contrib/libarchive/configure.ac
===================================================================
--- trunk/contrib/libarchive/configure.ac 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/configure.ac 2018-06-19 20:42:35 UTC (rev 11134)
@@ -4,8 +4,8 @@
dnl In particular, this allows the version macro to be used in AC_INIT
dnl These first two version numbers are updated automatically on each release.
-m4_define([LIBARCHIVE_VERSION_S],[3.2.1])
-m4_define([LIBARCHIVE_VERSION_N],[3002001])
+m4_define([LIBARCHIVE_VERSION_S],[3.3.2])
+m4_define([LIBARCHIVE_VERSION_N],[3003002])
dnl bsdtar and bsdcpio versioning tracks libarchive
m4_define([BSDTAR_VERSION_S],LIBARCHIVE_VERSION_S())
@@ -27,6 +27,7 @@
AC_CONFIG_MACRO_DIR([build/autoconf])
# Must follow AC_CONFIG macros above...
AM_INIT_AUTOMAKE()
+AM_MAINTAINER_MODE([enable])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
# Libtool's "interface version" can be computed from the libarchive version.
@@ -88,7 +89,7 @@
inc_cygwin_files=no
case "$host_os" in
*mingw* ) inc_windows_files=yes ;;
- *cygwin*) inc_cygwin_files=yes ;;
+ *cygwin* | *msys*) inc_cygwin_files=yes ;;
esac
AM_CONDITIONAL([INC_WINDOWS_FILES], [test $inc_windows_files = yes])
AM_CONDITIONAL([INC_CYGWIN_FILES], [test $inc_cygwin_files = yes])
@@ -242,7 +243,7 @@
# Set up defines needed before including any headers
case $host in
- *mingw* | *cygwin* )
+ *mingw* | *cygwin* | *msys* )
AC_DEFINE([_WIN32_WINNT], 0x0502, [Define to '0x0502' for Windows Server 2003 APIs.])
AC_DEFINE([WINVER], 0x0502, [Define to '0x0502' for Windows Server 2003 APIs.])
AC_DEFINE([NTDDI_VERSION], 0x05020000, [Define to '0x05020000' for Windows Server 2003 APIs.])
@@ -252,6 +253,7 @@
# Checks for header files.
AC_HEADER_DIRENT
AC_HEADER_SYS_WAIT
+AC_CHECK_HEADERS([acl/libacl.h attr/xattr.h])
AC_CHECK_HEADERS([copyfile.h ctype.h])
AC_CHECK_HEADERS([errno.h ext2fs/ext2_fs.h fcntl.h grp.h])
@@ -269,16 +271,29 @@
AC_CHECK_HEADERS([inttypes.h io.h langinfo.h limits.h])
AC_CHECK_HEADERS([linux/fiemap.h linux/fs.h linux/magic.h linux/types.h])
-AC_CHECK_HEADERS([locale.h paths.h poll.h pthread.h pwd.h])
+
+AC_CACHE_CHECK([whether FS_IOC_GETFLAGS is usable],
+ [ac_cv_have_decl_FS_IOC_GETFLAGS],
+ [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([@%:@include <sys/ioctl.h>
+@%:@include <linux/fs.h>],
+ [int x = FS_IOC_GETFLAGS])],
+ [AS_VAR_SET([ac_cv_have_decl_FS_IOC_GETFLAGS], [yes])],
+ [AS_VAR_SET([ac_cv_have_decl_FS_IOC_GETFLAGS], [no])])])
+
+AS_VAR_IF([ac_cv_have_decl_FS_IOC_GETFLAGS], [yes],
+ [AC_DEFINE_UNQUOTED([HAVE_WORKING_FS_IOC_GETFLAGS], [1],
+ [Define to 1 if you have a working FS_IOC_GETFLAGS])])
+
+AC_CHECK_HEADERS([locale.h membership.h paths.h poll.h pthread.h pwd.h])
AC_CHECK_HEADERS([readpassphrase.h signal.h spawn.h])
AC_CHECK_HEADERS([stdarg.h stdint.h stdlib.h string.h])
-AC_CHECK_HEADERS([sys/cdefs.h sys/extattr.h])
+AC_CHECK_HEADERS([sys/acl.h sys/cdefs.h sys/ea.h sys/extattr.h])
AC_CHECK_HEADERS([sys/ioctl.h sys/mkdev.h sys/mount.h])
-AC_CHECK_HEADERS([sys/param.h sys/poll.h sys/select.h sys/statfs.h sys/statvfs.h])
-AC_CHECK_HEADERS([sys/time.h sys/utime.h sys/utsname.h sys/vfs.h])
+AC_CHECK_HEADERS([sys/param.h sys/poll.h sys/richacl.h])
+AC_CHECK_HEADERS([sys/select.h sys/statfs.h sys/statvfs.h])
+AC_CHECK_HEADERS([sys/time.h sys/utime.h sys/utsname.h sys/vfs.h sys/xattr.h])
AC_CHECK_HEADERS([time.h unistd.h utime.h wchar.h wctype.h])
AC_CHECK_HEADERS([windows.h])
-AC_CHECK_HEADERS([Bcrypt.h])
# check windows.h first; the other headers require it.
AC_CHECK_HEADERS([wincrypt.h winioctl.h],[],[],
[[#ifdef HAVE_WINDOWS_H
@@ -301,7 +316,7 @@
if test "x$with_bz2lib" != "xno"; then
AC_CHECK_HEADERS([bzlib.h])
case "$host_os" in
- *mingw* | *cygwin*)
+ *mingw* | *cygwin* | *msys*)
dnl AC_CHECK_LIB cannot be used on the Windows port of libbz2, therefore
dnl use AC_LINK_IFELSE.
AC_MSG_CHECKING([for BZ2_bzDecompressInit in -lbz2])
@@ -325,14 +340,6 @@
esac
fi
-AC_ARG_WITH([lzmadec],
- AS_HELP_STRING([--without-lzmadec], [Don't build support for lzma through lzmadec]))
-
-if test "x$with_lzmadec" != "xno"; then
- AC_CHECK_HEADERS([lzmadec.h])
- AC_CHECK_LIB(lzmadec,lzmadec_decode)
-fi
-
AC_ARG_WITH([iconv],
AS_HELP_STRING([--without-iconv], [Don't try to link against iconv]))
@@ -373,8 +380,11 @@
AC_CACHE_CHECK(
[whether we have multithread support in lzma],
ac_cv_lzma_has_mt,
- [AC_COMPILE_IFELSE([
- AC_LANG_PROGRAM([[#include <lzma.h>]],
+ [AC_LINK_IFELSE([
+ AC_LANG_PROGRAM([[#include <lzma.h>]
+ [#if LZMA_VERSION < 50020000]
+ [#error unsupported]
+ [#endif]],
[[lzma_stream_encoder_mt(0, 0);]])],
[ac_cv_lzma_has_mt=yes], [ac_cv_lzma_has_mt=no])])
if test "x$ac_cv_lzma_has_mt" != xno; then
@@ -383,13 +393,16 @@
fi
AC_ARG_WITH([lzo2],
- AS_HELP_STRING([--without-lzo2], [Don't build support for lzop through liblzo2]))
+ AS_HELP_STRING([--with-lzo2], [Build with LZO support from liblzo2]))
-if test "x$with_lzo2" != "xno"; then
+if test "x$with_lzo2" = "xyes"; then
AC_CHECK_HEADERS([lzo/lzoconf.h lzo/lzo1x.h])
AC_CHECK_LIB(lzo2,lzo1x_decompress_safe)
fi
+AC_ARG_WITH([cng],
+ AS_HELP_STRING([--without-cng], [Don't build support of CNG(Crypto Next Generation)]))
+
AC_ARG_WITH([nettle],
AS_HELP_STRING([--without-nettle], [Don't build with crypto support from Nettle]))
AC_ARG_WITH([openssl],
@@ -592,7 +605,7 @@
# To avoid necessity for including windows.h or special forward declaration
# workarounds, we use 'void *' for 'struct SECURITY_ATTRIBUTES *'
AC_CHECK_STDCALL_FUNC([CreateHardLinkA],[const char *, const char *, void *])
-AC_CHECK_FUNCS([arc4random_buf chflags chown chroot ctime_r dirfd])
+AC_CHECK_FUNCS([arc4random_buf chflags chown chroot ctime_r])
AC_CHECK_FUNCS([fchdir fchflags fchmod fchown fcntl fdopendir fork])
AC_CHECK_FUNCS([fstat fstatat fstatfs fstatvfs ftruncate])
AC_CHECK_FUNCS([futimens futimes futimesat])
@@ -612,6 +625,21 @@
# detects cygwin-1.7, as opposed to older versions
AC_CHECK_FUNCS([cygwin_conv_path])
+# DragonFly uses vfsconf, FreeBSD xvfsconf.
+AC_CHECK_TYPES(struct vfsconf,,,
+ [#if HAVE_SYS_TYPES_H
+ #include <sys/types.h>
+ #endif
+ #include <sys/mount.h>
+ ])
+
+AC_CHECK_TYPES(struct xvfsconf,,,
+ [#if HAVE_SYS_TYPES_H
+ #include <sys/types.h>
+ #endif
+ #include <sys/mount.h>
+ ])
+
# There are several variants of readdir_r around; we only
# accept the POSIX-compliant version.
AC_COMPILE_IFELSE(
@@ -620,6 +648,13 @@
return(readdir_r(dir, &e, &r));]])],
[AC_DEFINE(HAVE_READDIR_R,1,[Define to 1 if you have a POSIX compatible readdir_r])]
)
+# dirfd can be either a function or a macro.
+AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[#include <dirent.h>
+ DIR *dir;]],
+ [[return(dirfd(dir));]])],
+ [AC_DEFINE(HAVE_DIRFD,1,[Define to 1 if you have a dirfd function or macro])]
+)
# FreeBSD's nl_langinfo supports an option to specify whether the
# current locale uses month/day or day/month ordering. It makes the
@@ -647,18 +682,108 @@
[Disable Extended Attributes support (default: check)]))
if test "x$enable_xattr" != "xno"; then
- AC_CHECK_HEADERS([attr/xattr.h])
- AC_CHECK_HEADERS([sys/xattr.h sys/ea.h])
- AC_SEARCH_LIBS([setxattr], [attr])
- AC_CHECK_FUNCS([extattr_get_file extattr_list_file])
- AC_CHECK_FUNCS([extattr_set_fd extattr_set_file])
- AC_CHECK_FUNCS([fgetxattr flistxattr fsetxattr getxattr])
- AC_CHECK_FUNCS([lgetxattr listxattr llistxattr lsetxattr])
- AC_CHECK_FUNCS([fgetea flistea fsetea getea])
- AC_CHECK_FUNCS([lgetea listea llistea lsetea])
- AC_CHECK_DECLS([EXTATTR_NAMESPACE_USER], [], [], [#include <sys/types.h>
+ AC_SEARCH_LIBS([setxattr], [attr])
+ AC_CHECK_DECLS([EXTATTR_NAMESPACE_USER], [], [], [#include <sys/types.h>
#include <sys/extattr.h>
])
+ AC_CHECK_DECLS([XATTR_NOFOLLOW], [], [], [#include <sys/xattr.h>
+])
+ if test "x$ac_cv_header_sys_xattr_h" = "xyes" \
+ -a "x$ac_cv_have_decl_XATTR_NOFOLLOW" = "xyes"; then
+ # Darwin extended attributes support
+ AC_CACHE_VAL([ac_cv_archive_xattr_darwin],
+ [AC_CHECK_FUNCS(fgetxattr \
+ flistxattr \
+ fsetxattr \
+ getxattr \
+ listxattr \
+ setxattr,
+ [ac_cv_archive_xattr_darwin=yes],
+ [ac_cv_archive_xattr_darwin=no],
+ [#include <sys/xattr.h>
+])
+ ]
+ )
+ elif test "x$ac_cv_header_sys_extattr_h" = "xyes" \
+ -a "x$ac_cv_have_decl_EXTATTR_NAMESPACE_USER" = "xyes"; then
+ # FreeBSD extended attributes support
+ AC_CACHE_VAL([ac_cv_archive_xattr_freebsd],
+ [AC_CHECK_FUNCS(extattr_get_fd \
+ extattr_get_file \
+ extattr_get_link \
+ extattr_list_fd \
+ extattr_list_file \
+ extattr_list_link \
+ extattr_set_fd \
+ extattr_set_link,
+ [ac_cv_archive_xattr_freebsd=yes],
+ [ac_cv_archive_xattr_freebsd=no],
+ [#include <sys/types.h>
+#include <sys/extattr.h>
+])
+ ]
+ )
+ elif test "x$ac_cv_header_sys_xattr_h" = "xyes" \
+ -o "x$ac_cv_header_attr_xattr_h" = "xyes"; then
+ # Linux extended attributes support
+ AC_CACHE_VAL([ac_cv_archive_xattr_linux],
+ [AC_CHECK_FUNCS(fgetxattr \
+ flistxattr \
+ fsetxattr \
+ getxattr \
+ lgetxattr \
+ listxattr \
+ llistxattr \
+ lsetxattr,
+ [ac_cv_archive_xattr_linux=yes],
+ [ac_cv_archive_xattr_linux=no],
+ [#if HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#if HAVE_SYS_XATTR_H
+#include <sys/xattr.h>
+#endif
+#if HAVE_ATTR_XATTR_H
+#include <attr/xatr.h>
+#endif
+])
+ ]
+ )
+ elif test "x$ac_cv_header_sys_ea_h" = "xyes"; then
+ # AIX extended attributes support
+ AC_CACHE_VAL([ac_cv_archive_xattr_aix],
+ [AC_CHECK_FUNCS(fgetea \
+ flistea \
+ fsetea \
+ getea \
+ lgetea \
+ listea \
+ llistea \
+ lsetea,
+ [ac_cv_archive_xattr_aix=yes],
+ [ac_cv_archive_xattr_aix=no],
+ [#include <sys/ea.h>
+])
+ ]
+ )
+ fi
+
+ AC_MSG_CHECKING([for extended attributes support])
+ if test "x$ac_cv_archive_xattr_linux" = "xyes"; then
+ AC_DEFINE([ARCHIVE_XATTR_LINUX], [1], [Linux xattr support])
+ AC_MSG_RESULT([Linux])
+ elif test "x$ac_cv_archive_xattr_darwin" = "xyes"; then
+ AC_DEFINE([ARCHIVE_XATTR_DARWIN], [1], [Darwin xattr support])
+ AC_MSG_RESULT([Darwin])
+ elif test "x$ac_cv_archive_xattr_freebsd" = "xyes"; then
+ AC_DEFINE([ARCHIVE_XATTR_FREEBSD], [1], [FreeBSD xattr support])
+ AC_MSG_RESULT([FreeBSD])
+ elif test "x$ac_cv_archive_xattr_aix" = "xyes"; then
+ AC_DEFINE([ARCHIVE_XATTR_AIX], [1], [AIX xattr support])
+ AC_MSG_RESULT([AIX])
+ else
+ AC_MSG_RESULT([none])
+ fi
fi
# Check for ACL support
@@ -673,42 +798,212 @@
[Disable ACL support (default: check)]))
if test "x$enable_acl" != "xno"; then
- AC_CHECK_HEADERS([acl/libacl.h])
- AC_CHECK_HEADERS([sys/acl.h])
- AC_CHECK_LIB([acl],[acl_get_file])
- AC_CHECK_FUNCS([acl_create_entry acl_init acl_set_fd acl_set_fd_np acl_set_file])
+ # Libacl
+ AC_CHECK_LIB([acl], [acl_get_file])
- AC_CHECK_TYPES(acl_permset_t,,,
- [#if HAVE_SYS_TYPES_H
- #include <sys/types.h>
- #endif
- #if HAVE_SYS_ACL_H
- #include <sys/acl.h>
- #endif
- ])
+ AC_CHECK_TYPES([acl_t, acl_entry_t, acl_permset_t, acl_tag_t], [], [], [
+ #if HAVE_SYS_TYPES_H
+ #include <sys/types.h>
+ #endif
+ #if HAVE_SYS_ACL_H
+ #include <sys/acl.h>
+ #endif
+ ])
- # The "acl_get_perm()" function was omitted from the POSIX draft.
- # (It's a pretty obvious oversight; otherwise, there's no way to
- # test for specific permissions in a permset.) Linux uses the obvious
- # name, FreeBSD adds _np to mark it as "non-Posix extension."
- # Test for both as a double-check that we really have POSIX-style ACL support.
- AC_CHECK_FUNCS(acl_get_perm_np acl_get_perm acl_get_link acl_get_link_np,,,
- [#if HAVE_SYS_TYPES_H
- #include <sys/types.h>
- #endif
- #if HAVE_SYS_ACL_H
- #include <sys/acl.h>
- #endif
+ AC_CHECK_LIB([richacl], [richacl_get_file])
+
+ AC_CHECK_TYPES([[struct richace], [struct richacl]], [], [], [
+ #if HAVE_SYS_RICHACL_H
+ #include <sys/richacl.h>
+ #endif
+ ])
+
+ # Solaris and derivates ACLs
+ AC_CHECK_FUNCS(acl facl)
+
+ if test "x$ac_cv_lib_richacl_richacl_get_file" = "xyes" \
+ -a "x$ac_cv_type_struct_richace" = "xyes" \
+ -a "x$ac_cv_type_struct_richacl" = "xyes"; then
+ AC_CACHE_VAL([ac_cv_archive_acl_librichacl],
+ [AC_CHECK_FUNCS(richacl_alloc \
+ richacl_equiv_mode \
+ richacl_free \
+ richacl_get_fd \
+ richacl_get_file \
+ richacl_set_fd \
+ richacl_set_file,
+ [ac_cv_archive_acl_librichacl=yes], [ac_cv_archive_acl_librichacl=no], [#include <sys/richacl.h>])])
+ fi
+
+ if test "x$ac_cv_func_acl" = "xyes" \
+ -a "x$ac_cv_func_facl" = "xyes"; then
+ AC_CHECK_TYPES([aclent_t], [], [], [[#include <sys/acl.h>]])
+ if test "x$ac_cv_type_aclent_t" = "xyes"; then
+ AC_CACHE_VAL([ac_cv_archive_acl_sunos],
+ [AC_CHECK_DECLS([GETACL, SETACL, GETACLCNT],
+ [ac_cv_archive_acl_sunos=yes], [ac_cv_archive_acl_sunos=no],
+ [#include <sys/acl.h>])])
+ AC_CHECK_TYPES([ace_t], [], [], [[#include <sys/acl.h>]])
+ if test "x$ac_cv_type_ace_t" = "xyes"; then
+ AC_CACHE_VAL([ac_cv_archive_acl_sunos_nfs4],
+ [AC_CHECK_DECLS([ACE_GETACL, ACE_SETACL, ACE_GETACLCNT],
+ [ac_cv_archive_acl_sunos_nfs4=yes],
+ [ac_cv_archive_acl_sonos_nfs4=no],
+ [#include <sys/acl.h>])])
+ fi
+ fi
+ elif test "x$ac_cv_type_acl_t" = "xyes" \
+ -a "x$ac_cv_type_acl_entry_t" = "xyes" \
+ -a "x$ac_cv_type_acl_permset_t" = "xyes" \
+ -a "x$ac_cv_type_acl_tag_t" = "xyes"; then
+ # POSIX.1e ACL functions
+ AC_CACHE_VAL([ac_cv_posix_acl_funcs],
+ [AC_CHECK_FUNCS(acl_add_perm \
+ acl_clear_perms \
+ acl_create_entry \
+ acl_delete_def_file \
+ acl_free \
+ acl_get_entry \
+ acl_get_fd \
+ acl_get_file \
+ acl_get_permset \
+ acl_get_qualifier \
+ acl_get_tag_type \
+ acl_init \
+ acl_set_fd \
+ acl_set_file \
+ acl_set_qualifier \
+ acl_set_tag_type,
+ [ac_cv_posix_acl_funcs=yes], [ac_cv_posix_acl_funcs=no],
+ [#if HAVE_SYS_TYPES_H
+ #include <sys/types.h>
+ #endif
+ #if HAVE_SYS_ACL_H
+ #include <sys/acl.h>
+ #endif
+ ])
])
- # MacOS has an acl.h that isn't POSIX. It can be detected by
- # checking for ACL_USER
- AC_CHECK_DECL([ACL_USER],
- [AC_DEFINE(HAVE_ACL_USER, 1, [True for systems with POSIX ACL support])],
- [],
- [#include <sys/acl.h>])
+ AC_CHECK_FUNCS(acl_get_perm)
+
+ if test "x$ac_cv_posix_acl_funcs" = "xyes" \
+ -a "x$ac_cv_header_acl_libacl_h" = "xyes" \
+ -a "x$ac_cv_lib_acl_acl_get_file" = "xyes" \
+ -a "x$ac_cv_func_acl_get_perm"; then
+ AC_CACHE_VAL([ac_cv_archive_acl_libacl],
+ [ac_cv_archive_acl_libacl=yes])
+ AC_DEFINE([ARCHIVE_ACL_LIBACL], [1],
+ [POSIX.1e ACL support via libacl])
+ else
+ # FreeBSD/Darwin
+ AC_CHECK_FUNCS(acl_add_flag_np \
+ acl_clear_flags_np \
+ acl_get_brand_np \
+ acl_get_entry_type_np \
+ acl_get_flag_np \
+ acl_get_flagset_np \
+ acl_get_fd_np \
+ acl_get_link_np \
+ acl_get_perm_np \
+ acl_is_trivial_np \
+ acl_set_entry_type_np \
+ acl_set_fd_np \
+ acl_set_link_np,,,
+ [#include <sys/types.h>
+ #include <sys/acl.h>])
+
+ AC_CHECK_FUNCS(mbr_uid_to_uuid \
+ mbr_uuid_to_id \
+ mbr_gid_to_uuid,,,
+ [#include <membership.h>])
+
+ AC_CHECK_DECLS([ACL_TYPE_EXTENDED, ACL_TYPE_NFS4, ACL_USER,
+ ACL_SYNCHRONIZE], [], [],
+ [#include <sys/types.h>
+ #include <sys/acl.h>])
+ if test "x$ac_cv_posix_acl_funcs" = "xyes" \
+ -a "x$ac_cv_func_acl_get_fd_np" = "xyes" \
+ -a "x$ac_cv_func_acl_get_perm" != "xyes" \
+ -a "x$ac_cv_func_acl_get_perm_np" = "xyes" \
+ -a "x$ac_cv_func_acl_set_fd_np" = "xyes"; then
+ if test "x$ac_cv_have_decl_ACL_USER" = "xyes"; then
+ AC_CACHE_VAL([ac_cv_archive_acl_freebsd],
+ [ac_cv_archive_acl_freebsd=yes])
+ if test "x$ac_cv_have_decl_ACL_TYPE_NFS4" = "xyes" \
+ -a "x$ac_cv_func_acl_add_flag_np" = "xyes" \
+ -a "x$ac_cv_func_acl_get_brand_np" = "xyes" \
+ -a "x$ac_cv_func_acl_get_entry_type_np" = "xyes" \
+ -a "x$ac_cv_func_acl_get_flagset_np" = "xyes" \
+ -a "x$ac_cv_func_acl_set_entry_type_np" = "xyes"; then
+ AC_CACHE_VAL([ac_cv_archive_acl_freebsd_nfs4],
+ [ac_cv_archive_acl_freebsd_nfs4=yes])
+ fi
+ elif test "x$ac_cv_have_decl_ACL_TYPE_EXTENDED" = "xyes" \
+ -a "x$ac_cv_func_acl_add_flag_np" = "xyes" \
+ -a "x$ac_cv_func_acl_get_flagset_np" = "xyes" \
+ -a "x$ac_cv_func_acl_get_link_np" = "xyes" \
+ -a "x$ac_cv_func_acl_set_link_np" = "xyes" \
+ -a "x$ac_cv_func_mbr_uid_to_uuid" = "xyes" \
+ -a "x$ac_cv_func_mbr_uuid_to_id" = "xyes" \
+ -a "x$ac_cv_func_mbr_gid_to_uuid" = "xyes"; then
+ AC_CACHE_VAL([ac_cv_archive_acl_darwin],
+ [ac_cv_archive_acl_darwin=yes])
+ fi
+ fi
+ fi
+ fi
+ AC_MSG_CHECKING([for ACL support])
+ if test "x$ac_cv_archive_acl_libacl" = "xyes" \
+ -a "x$ac_cv_archive_acl_librichacl" = "xyes"; then
+ AC_MSG_RESULT([libacl (POSIX.1e) + librichacl (NFSv4)])
+ AC_DEFINE([ARCHIVE_ACL_LIBACL], [1],
+ [Linux POSIX.1e ACL support via libacl])
+ AC_DEFINE([ARCHIVE_ACL_LIBRICHACL], [1],
+ [Linux NFSv4 ACL support via librichacl])
+ elif test "x$ac_cv_archive_acl_libacl" = "xyes"; then
+ AC_MSG_RESULT([libacl (POSIX.1e)])
+ AC_DEFINE([ARCHIVE_ACL_LIBACL], [1],
+ [Linux POSIX.1e ACL support via libacl])
+ elif test "x$ac_cv_archive_acl_librichacl" = "xyes"; then
+ AC_MSG_RESULT([librichacl (NFSv4)])
+ AC_DEFINE([ARCHIVE_ACL_LIBRICHACL], [1],
+ [Linux NFSv4 ACL support via librichacl])
+ elif test "x$ac_cv_archive_acl_darwin" = "xyes"; then
+ AC_DEFINE([ARCHIVE_ACL_DARWIN], [1], [Darwin ACL support])
+ AC_MSG_RESULT([Darwin (limited NFSv4)])
+ elif test "x$ac_cv_archive_acl_sunos" = "xyes"; then
+ AC_DEFINE([ARCHIVE_ACL_SUNOS], [1], [Solaris ACL support])
+ if test "x$ac_cv_archive_acl_sunos_nfs4" = "xyes"; then
+ AC_DEFINE([ARCHIVE_ACL_SUNOS_NFS4], [1],
+ [Solaris NFSv4 ACL support])
+ AC_MSG_RESULT([Solaris (POSIX.1e and NFSv4)])
+ else
+ AC_MSG_RESULT([Solaris (POSIX.1e)])
+ fi
+ elif test "x$ac_cv_archive_acl_freebsd" = "xyes"; then
+ AC_DEFINE([ARCHIVE_ACL_FREEBSD], [1], [FreeBSD ACL support])
+ if test "x$ac_cv_archive_acl_freebsd_nfs4" = "xyes"; then
+ AC_DEFINE([ARCHIVE_ACL_FREEBSD_NFS4], [1],
+ [FreeBSD NFSv4 ACL support])
+ AC_MSG_RESULT([FreeBSD (POSIX.1e and NFSv4)])
+ else
+ AC_MSG_RESULT([FreeBSD (POSIX.1e)])
+ fi
+ else
+ AC_MSG_RESULT([none])
+ fi
fi
+
+AM_CONDITIONAL([INC_LINUX_ACL],
+ [test "x$ac_cv_archive_acl_libacl" = "xyes" \
+ -o "x$ac_cv_archive_acl_librichacl" = "xyes"])
+AM_CONDITIONAL([INC_SUNOS_ACL], [test "x$ac_cv_archive_acl_sunos" = "xyes"])
+AM_CONDITIONAL([INC_DARWIN_ACL],
+ [test "x$ac_cv_archive_acl_darwin" = "xyes"])
+AM_CONDITIONAL([INC_FREEBSD_ACL],
+ [test "x$ac_cv_archive_acl_freebsd" = "xyes"])
+
# Additional requirements
AC_SYS_LARGEFILE
@@ -774,7 +1069,7 @@
])
case "$host_os" in
- *mingw* | *cygwin*)
+ *mingw* | *cygwin* | *msys*)
;;
*)
CRYPTO_CHECK(MD5, LIBC, md5)
@@ -797,6 +1092,16 @@
;;
esac
+if test "x$with_cng" != "xno"; then
+ AC_CHECK_HEADERS([bcrypt.h],[
+ LIBS="$LIBS -lbcrypt"
+ ],[],
+ [[#ifdef HAVE_WINDOWS_H
+ # include <windows.h>
+ #endif
+ ]])
+fi
+
if test "x$with_nettle" != "xno"; then
AC_CHECK_HEADERS([nettle/md5.h nettle/ripemd160.h nettle/sha.h])
AC_CHECK_HEADERS([nettle/pbkdf2.h nettle/aes.h nettle/hmac.h])
@@ -817,7 +1122,7 @@
AC_CHECK_HEADERS([openssl/evp.h])
saved_LIBS=$LIBS
case "$host_os" in
- *mingw* | *cygwin*)
+ *mingw* | *cygwin* | *msys*)
case "$host_cpu" in
x86_64)
AC_CHECK_LIB(eay64,OPENSSL_config)
@@ -845,6 +1150,7 @@
else
AC_CHECK_FUNCS([PKCS5_PBKDF2_HMAC_SHA1])
fi
+ AC_CHECK_LIB(crypto,EVP_CIPHER_CTX_init)
fi
# Probe libmd AFTER OpenSSL/libcrypto.
@@ -862,7 +1168,7 @@
fi
case "$host_os" in
- *mingw* | *cygwin*)
+ *mingw* | *cygwin* | *msys*)
CRYPTO_CHECK_WIN(MD5, CALG_MD5)
CRYPTO_CHECK_WIN(SHA1, CALG_SHA1)
CRYPTO_CHECK_WIN(SHA256, CALG_SHA_256)
Modified: trunk/contrib/libarchive/cpio/cpio.c
===================================================================
--- trunk/contrib/libarchive/cpio/cpio.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/cpio/cpio.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -108,7 +108,7 @@
static int file_to_archive(struct cpio *, const char *);
static void free_cache(struct name_cache *cache);
static void list_item_verbose(struct cpio *, struct archive_entry *);
-static void long_help(void);
+static void long_help(void) __LA_DEAD;
static const char *lookup_gname(struct cpio *, gid_t gid);
static int lookup_gname_helper(struct cpio *,
const char **name, id_t gid);
@@ -115,15 +115,15 @@
static const char *lookup_uname(struct cpio *, uid_t uid);
static int lookup_uname_helper(struct cpio *,
const char **name, id_t uid);
-static void mode_in(struct cpio *);
-static void mode_list(struct cpio *);
+static void mode_in(struct cpio *) __LA_DEAD;
+static void mode_list(struct cpio *) __LA_DEAD;
static void mode_out(struct cpio *);
static void mode_pass(struct cpio *, const char *);
static const char *remove_leading_slash(const char *);
static int restore_time(struct cpio *, struct archive_entry *,
const char *, int fd);
-static void usage(void);
-static void version(void);
+static void usage(void) __LA_DEAD;
+static void version(void) __LA_DEAD;
static const char * passphrase_callback(struct archive *, void *);
static void passphrase_free(char *);
@@ -628,6 +628,7 @@
blocks == 1 ? "block" : "blocks");
}
archive_write_free(cpio->archive);
+ archive_entry_linkresolver_free(cpio->linkresolver);
}
static const char *
@@ -703,6 +704,7 @@
lafe_warnc(0, "%s",
archive_error_string(cpio->archive_read_disk));
if (r <= ARCHIVE_FAILED) {
+ archive_entry_free(entry);
cpio->return_value = 1;
return (r);
}
@@ -1193,12 +1195,15 @@
struct lafe_line_reader *lr;
const char *p;
int r;
+ size_t destdir_len;
/* Ensure target dir has a trailing '/' to simplify path surgery. */
- cpio->destdir = malloc(strlen(destdir) + 8);
- strcpy(cpio->destdir, destdir);
- if (destdir[strlen(destdir) - 1] != '/')
- strcat(cpio->destdir, "/");
+ destdir_len = strlen(destdir);
+ cpio->destdir = malloc(destdir_len + 8);
+ memcpy(cpio->destdir, destdir, destdir_len);
+ if (destdir_len == 0 || destdir[destdir_len - 1] != '/')
+ cpio->destdir[destdir_len++] = '/';
+ cpio->destdir[destdir_len++] = '\0';
cpio->archive = archive_write_disk_new();
if (cpio->archive == NULL)
@@ -1239,6 +1244,7 @@
}
archive_write_free(cpio->archive);
+ free(cpio->pass_destpath);
}
/*
@@ -1324,10 +1330,9 @@
if (*name_cache_variable == NULL) {
- *name_cache_variable = malloc(sizeof(struct name_cache));
+ *name_cache_variable = calloc(1, sizeof(struct name_cache));
if (*name_cache_variable == NULL)
lafe_errc(1, ENOMEM, "No more memory");
- memset(*name_cache_variable, 0, sizeof(struct name_cache));
(*name_cache_variable)->size = name_cache_size;
}
@@ -1344,23 +1349,23 @@
cache->cache[slot].name = NULL;
}
- if (lookup_fn(cpio, &name, id) == 0) {
- if (name == NULL || name[0] == '\0') {
- /* If lookup failed, format it as a number. */
- snprintf(asnum, sizeof(asnum), "%u", (unsigned)id);
- name = asnum;
- }
- cache->cache[slot].name = strdup(name);
- if (cache->cache[slot].name != NULL) {
- cache->cache[slot].id = id;
- return (cache->cache[slot].name);
- }
- /*
- * Conveniently, NULL marks an empty slot, so
- * if the strdup() fails, we've just failed to
- * cache it. No recovery necessary.
- */
+ if (lookup_fn(cpio, &name, id)) {
+ /* If lookup failed, format it as a number. */
+ snprintf(asnum, sizeof(asnum), "%u", (unsigned)id);
+ name = asnum;
}
+
+ cache->cache[slot].name = strdup(name);
+ if (cache->cache[slot].name != NULL) {
+ cache->cache[slot].id = id;
+ return (cache->cache[slot].name);
+ }
+
+ /*
+ * Conveniently, NULL marks an empty slot, so
+ * if the strdup() fails, we've just failed to
+ * cache it. No recovery necessary.
+ */
return (NULL);
}
@@ -1381,15 +1386,14 @@
errno = 0;
pwent = getpwuid((uid_t)id);
if (pwent == NULL) {
- *name = NULL;
- if (errno != 0 && errno != ENOENT)
+ if (errno && errno != ENOENT)
lafe_warnc(errno, "getpwuid(%s) failed",
cpio_i64toa((int64_t)id));
- return (errno);
+ return 1;
}
*name = pwent->pw_name;
- return (0);
+ return 0;
}
static const char *
@@ -1409,15 +1413,14 @@
errno = 0;
grent = getgrgid((gid_t)id);
if (grent == NULL) {
- *name = NULL;
- if (errno != 0)
+ if (errno && errno != ENOENT)
lafe_warnc(errno, "getgrgid(%s) failed",
cpio_i64toa((int64_t)id));
- return (errno);
+ return 1;
}
*name = grent->gr_name;
- return (0);
+ return 0;
}
/*
Modified: trunk/contrib/libarchive/cpio/test/CMakeLists.txt
===================================================================
--- trunk/contrib/libarchive/cpio/test/CMakeLists.txt 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/cpio/test/CMakeLists.txt 2018-06-19 20:42:35 UTC (rev 11134)
@@ -8,7 +8,7 @@
../cmdline.c
../../libarchive_fe/err.c
../../test_utils/test_utils.c
- main.c
+ ../../test_utils/test_main.c
test.h
test_0.c
test_basic.c
@@ -62,6 +62,16 @@
# Register target
#
ADD_EXECUTABLE(bsdcpio_test ${bsdcpio_test_SOURCES})
+ IF(ENABLE_ACL)
+ SET(TEST_ACL_LIBS "")
+ IF(HAVE_LIBACL)
+ LIST(APPEND TEST_ACL_LIBS ${ACL_LIBRARY})
+ ENDIF(HAVE_LIBACL)
+ IF(HAVE_LIBRICHACL)
+ LIST(APPEND TEST_ACL_LIBS ${RICHACL_LIBRARY})
+ ENDIF(HAVE_LIBRICHACL)
+ TARGET_LINK_LIBRARIES(bsdcpio_test ${TEST_ACL_LIBS})
+ ENDIF(ENABLE_ACL)
SET_PROPERTY(TARGET bsdcpio_test PROPERTY COMPILE_DEFINITIONS LIST_H)
#
@@ -87,11 +97,13 @@
INCLUDE(${CMAKE_CURRENT_BINARY_DIR}/list.h)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/test_utils)
+ INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/cpio/test)
# Experimental new test handling
ADD_CUSTOM_TARGET(run_bsdcpio_test
COMMAND bsdcpio_test -p $<TARGET_FILE:bsdcpio>
- -r ${CMAKE_CURRENT_SOURCE_DIR})
+ -r ${CMAKE_CURRENT_SOURCE_DIR}
+ -vv)
ADD_DEPENDENCIES(run_bsdcpio_test bsdcpio)
ADD_DEPENDENCIES(run_all_tests run_bsdcpio_test)
ENDIF(ENABLE_CPIO AND ENABLE_TEST)
Modified: trunk/contrib/libarchive/cpio/test/test.h
===================================================================
--- trunk/contrib/libarchive/cpio/test/test.h 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/cpio/test/test.h 2018-06-19 20:42:35 UTC (rev 11134)
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2006 Tim Kientzle
+ * Copyright (c) 2003-2017 Tim Kientzle
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -22,324 +22,19 @@
* (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: stable/11/contrib/libarchive/cpio/test/test.h 307138 2016-10-12 10:28:22Z mm $
+ * $FreeBSD$
*/
/* Every test program should #include "test.h" as the first thing. */
-/*
- * The goal of this file (and the matching test.c) is to
- * simplify the very repetitive test-*.c test programs.
- */
-#if defined(HAVE_CONFIG_H)
-/* Most POSIX platforms use the 'configure' script to build config.h */
-#include "config.h"
-#elif defined(__FreeBSD__)
-/* Building as part of FreeBSD system requires a pre-built config.h. */
-#include "config_freebsd.h"
-#elif defined(_WIN32) && !defined(__CYGWIN__)
-/* Win32 can't run the 'configure' script. */
-#include "config_windows.h"
-#else
-/* Warn if the library hasn't been (automatically or manually) configured. */
-#error Oops: No config.h and no pre-built configuration in test.h.
-#endif
+#define KNOWNREF "test_option_f.cpio.uu"
+#define ENVBASE "BSDCPIO" /* Prefix for environment variables. */
+#define PROGRAM "bsdcpio" /* Name of program being tested. */
+#define PROGRAM_ALIAS "cpio" /* Generic alias for program */
+#undef LIBRARY /* Not testing a library. */
+#undef EXTRA_DUMP /* How to dump extra data */
+#undef EXTRA_ERRNO /* How to dump errno */
+/* How to generate extra version info. */
+#define EXTRA_VERSION (systemf("%s --version", testprog) ? "" : "")
-#include <sys/types.h> /* Windows requires this before sys/stat.h */
-#include <sys/stat.h>
-
-#if HAVE_DIRENT_H
-#include <dirent.h>
-#endif
-#ifdef HAVE_DIRECT_H
-#include <direct.h>
-#define dirent direct
-#endif
-#include <errno.h>
-#include <fcntl.h>
-#ifdef HAVE_IO_H
-#include <io.h>
-#endif
-#ifdef HAVE_STDINT_H
-#include <stdint.h>
-#endif
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include <time.h>
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-#include <wchar.h>
-#ifdef HAVE_WINDOWS_H
-#include <windows.h>
-#endif
-
-/*
- * System-specific tweaks. We really want to minimize these
- * as much as possible, since they make it harder to understand
- * the mainline code.
- */
-
-/* Windows (including Visual Studio and MinGW but not Cygwin) */
-#if defined(_WIN32) && !defined(__CYGWIN__)
-#if !defined(__BORLANDC__)
-#undef chdir
-#define chdir _chdir
-#define strdup _strdup
-#endif
-#endif
-
-/* Visual Studio */
-#if defined(_MSC_VER) && _MSC_VER < 1900
-#define snprintf sprintf_s
-#endif
-
-#if defined(__BORLANDC__)
-#pragma warn -8068 /* Constant out of range in comparison. */
-#endif
-
-/* Haiku OS and QNX */
-#if defined(__HAIKU__) || defined(__QNXNTO__)
-/* Haiku and QNX have typedefs in stdint.h (needed for int64_t) */
-#include <stdint.h>
-#endif
-
-/* Get a real definition for __FBSDID if we can */
-#if HAVE_SYS_CDEFS_H
-#include <sys/cdefs.h>
-#endif
-
-/* If not, define it so as to avoid dangling semicolons. */
-#ifndef __FBSDID
-#define __FBSDID(a) struct _undefined_hack
-#endif
-
-#ifndef O_BINARY
-#define O_BINARY 0
-#endif
-
-/*
- * Redefine DEFINE_TEST for use in defining the test functions.
- */
-#undef DEFINE_TEST
-#define DEFINE_TEST(name) void name(void); void name(void)
-
-/* An implementation of the standard assert() macro */
-#define assert(e) assertion_assert(__FILE__, __LINE__, (e), #e, NULL)
-/* chdir() and error if it fails */
-#define assertChdir(path) \
- assertion_chdir(__FILE__, __LINE__, path)
-/* Assert two integers are the same. Reports value of each one if not. */
-#define assertEqualInt(v1,v2) \
- assertion_equal_int(__FILE__, __LINE__, (v1), #v1, (v2), #v2, NULL)
-/* Assert two strings are the same. Reports value of each one if not. */
-#define assertEqualString(v1,v2) \
- assertion_equal_string(__FILE__, __LINE__, (v1), #v1, (v2), #v2, NULL, 0)
-#define assertEqualUTF8String(v1,v2) \
- assertion_equal_string(__FILE__, __LINE__, (v1), #v1, (v2), #v2, NULL, 1)
-/* As above, but v1 and v2 are wchar_t * */
-#define assertEqualWString(v1,v2) \
- assertion_equal_wstring(__FILE__, __LINE__, (v1), #v1, (v2), #v2, NULL)
-/* As above, but raw blocks of bytes. */
-#define assertEqualMem(v1, v2, l) \
- assertion_equal_mem(__FILE__, __LINE__, (v1), #v1, (v2), #v2, (l), #l, NULL)
-/* Assert that memory is full of a specified byte */
-#define assertMemoryFilledWith(v1, l, b) \
- assertion_memory_filled_with(__FILE__, __LINE__, (v1), #v1, (l), #l, (b), #b, NULL)
-/* Assert two files are the same. */
-#define assertEqualFile(f1, f2) \
- assertion_equal_file(__FILE__, __LINE__, (f1), (f2))
-/* Assert that a file is empty. */
-#define assertEmptyFile(pathname) \
- assertion_empty_file(__FILE__, __LINE__, (pathname))
-/* Assert that a file is not empty. */
-#define assertNonEmptyFile(pathname) \
- assertion_non_empty_file(__FILE__, __LINE__, (pathname))
-#define assertFileAtime(pathname, sec, nsec) \
- assertion_file_atime(__FILE__, __LINE__, pathname, sec, nsec)
-#define assertFileAtimeRecent(pathname) \
- assertion_file_atime_recent(__FILE__, __LINE__, pathname)
-#define assertFileBirthtime(pathname, sec, nsec) \
- assertion_file_birthtime(__FILE__, __LINE__, pathname, sec, nsec)
-#define assertFileBirthtimeRecent(pathname) \
- assertion_file_birthtime_recent(__FILE__, __LINE__, pathname)
-/* Assert that a file exists; supports printf-style arguments. */
-#define assertFileExists(pathname) \
- assertion_file_exists(__FILE__, __LINE__, pathname)
-/* Assert that a file exists. */
-#define assertFileNotExists(pathname) \
- assertion_file_not_exists(__FILE__, __LINE__, pathname)
-/* Assert that file contents match a string. */
-#define assertFileContents(data, data_size, pathname) \
- assertion_file_contents(__FILE__, __LINE__, data, data_size, pathname)
-#define assertFileMtime(pathname, sec, nsec) \
- assertion_file_mtime(__FILE__, __LINE__, pathname, sec, nsec)
-#define assertFileMtimeRecent(pathname) \
- assertion_file_mtime_recent(__FILE__, __LINE__, pathname)
-#define assertFileNLinks(pathname, nlinks) \
- assertion_file_nlinks(__FILE__, __LINE__, pathname, nlinks)
-#define assertFileSize(pathname, size) \
- assertion_file_size(__FILE__, __LINE__, pathname, size)
-#define assertTextFileContents(text, pathname) \
- assertion_text_file_contents(__FILE__, __LINE__, text, pathname)
-#define assertFileContainsLinesAnyOrder(pathname, lines) \
- assertion_file_contains_lines_any_order(__FILE__, __LINE__, pathname, lines)
-#define assertIsDir(pathname, mode) \
- assertion_is_dir(__FILE__, __LINE__, pathname, mode)
-#define assertIsHardlink(path1, path2) \
- assertion_is_hardlink(__FILE__, __LINE__, path1, path2)
-#define assertIsNotHardlink(path1, path2) \
- assertion_is_not_hardlink(__FILE__, __LINE__, path1, path2)
-#define assertIsReg(pathname, mode) \
- assertion_is_reg(__FILE__, __LINE__, pathname, mode)
-#define assertIsSymlink(pathname, contents) \
- assertion_is_symlink(__FILE__, __LINE__, pathname, contents)
-/* Create a directory, report error if it fails. */
-#define assertMakeDir(dirname, mode) \
- assertion_make_dir(__FILE__, __LINE__, dirname, mode)
-#define assertMakeFile(path, mode, contents) \
- assertion_make_file(__FILE__, __LINE__, path, mode, -1, contents)
-#define assertMakeBinFile(path, mode, csize, contents) \
- assertion_make_file(__FILE__, __LINE__, path, mode, csize, contents)
-#define assertMakeHardlink(newfile, oldfile) \
- assertion_make_hardlink(__FILE__, __LINE__, newfile, oldfile)
-#define assertMakeSymlink(newfile, linkto) \
- assertion_make_symlink(__FILE__, __LINE__, newfile, linkto)
-#define assertNodump(path) \
- assertion_nodump(__FILE__, __LINE__, path)
-#define assertUmask(mask) \
- assertion_umask(__FILE__, __LINE__, mask)
-#define assertUtimes(pathname, atime, atime_nsec, mtime, mtime_nsec) \
- assertion_utimes(__FILE__, __LINE__, pathname, atime, atime_nsec, mtime, mtime_nsec)
-
-/*
- * This would be simple with C99 variadic macros, but I don't want to
- * require that. Instead, I insert a function call before each
- * skipping() call to pass the file and line information down. Crude,
- * but effective.
- */
-#define skipping \
- skipping_setup(__FILE__, __LINE__);test_skipping
-
-/* Function declarations. These are defined in test_utility.c. */
-void failure(const char *fmt, ...);
-int assertion_assert(const char *, int, int, const char *, void *);
-int assertion_chdir(const char *, int, const char *);
-int assertion_empty_file(const char *, int, const char *);
-int assertion_equal_file(const char *, int, const char *, const char *);
-int assertion_equal_int(const char *, int, long long, const char *, long long, const char *, void *);
-int assertion_equal_mem(const char *, int, const void *, const char *, const void *, const char *, size_t, const char *, void *);
-int assertion_memory_filled_with(const char *, int, const void *, const char *, size_t, const char *, char, const char *, void *);
-int assertion_equal_string(const char *, int, const char *v1, const char *, const char *v2, const char *, void *, int);
-int assertion_equal_wstring(const char *, int, const wchar_t *v1, const char *, const wchar_t *v2, const char *, void *);
-int assertion_file_atime(const char *, int, const char *, long, long);
-int assertion_file_atime_recent(const char *, int, const char *);
-int assertion_file_birthtime(const char *, int, const char *, long, long);
-int assertion_file_birthtime_recent(const char *, int, const char *);
-int assertion_file_contains_lines_any_order(const char *, int, const char *, const char **);
-int assertion_file_contents(const char *, int, const void *, int, const char *);
-int assertion_file_exists(const char *, int, const char *);
-int assertion_file_mode(const char *, int, const char *, int);
-int assertion_file_mtime(const char *, int, const char *, long, long);
-int assertion_file_mtime_recent(const char *, int, const char *);
-int assertion_file_nlinks(const char *, int, const char *, int);
-int assertion_file_not_exists(const char *, int, const char *);
-int assertion_file_size(const char *, int, const char *, long);
-int assertion_is_dir(const char *, int, const char *, int);
-int assertion_is_hardlink(const char *, int, const char *, const char *);
-int assertion_is_not_hardlink(const char *, int, const char *, const char *);
-int assertion_is_reg(const char *, int, const char *, int);
-int assertion_is_symlink(const char *, int, const char *, const char *);
-int assertion_make_dir(const char *, int, const char *, int);
-int assertion_make_file(const char *, int, const char *, int, int, const void *);
-int assertion_make_hardlink(const char *, int, const char *newpath, const char *);
-int assertion_make_symlink(const char *, int, const char *newpath, const char *);
-int assertion_nodump(const char *, int, const char *);
-int assertion_non_empty_file(const char *, int, const char *);
-int assertion_text_file_contents(const char *, int, const char *buff, const char *f);
-int assertion_umask(const char *, int, int);
-int assertion_utimes(const char *, int, const char *, long, long, long, long );
-
-void skipping_setup(const char *, int);
-void test_skipping(const char *fmt, ...);
-
-/* Like sprintf, then system() */
-int systemf(const char * fmt, ...);
-
-/* Delay until time() returns a value after this. */
-void sleepUntilAfter(time_t);
-
-/* Return true if this platform can create symlinks. */
-int canSymlink(void);
-
-/* Return true if this platform can run the "bzip2" program. */
-int canBzip2(void);
-
-/* Return true if this platform can run the "grzip" program. */
-int canGrzip(void);
-
-/* Return true if this platform can run the "gzip" program. */
-int canGzip(void);
-
-/* Return true if this platform can run the specified command. */
-int canRunCommand(const char *);
-
-/* Return true if this platform can run the "lrzip" program. */
-int canLrzip(void);
-
-/* Return true if this platform can run the "lz4" program. */
-int canLz4(void);
-
-/* Return true if this platform can run the "lzip" program. */
-int canLzip(void);
-
-/* Return true if this platform can run the "lzma" program. */
-int canLzma(void);
-
-/* Return true if this platform can run the "lzop" program. */
-int canLzop(void);
-
-/* Return true if this platform can run the "xz" program. */
-int canXz(void);
-
-/* Return true if this filesystem can handle nodump flags. */
-int canNodump(void);
-
-/* Return true if the file has large i-node number(>0xffffffff). */
-int is_LargeInode(const char *);
-
-/* Suck file into string allocated via malloc(). Call free() when done. */
-/* Supports printf-style args: slurpfile(NULL, "%s/myfile", refdir); */
-char *slurpfile(size_t *, const char *fmt, ...);
-
-/* Dump block of bytes to a file. */
-void dumpfile(const char *filename, void *, size_t);
-
-/* Extracts named reference file to the current directory. */
-void extract_reference_file(const char *);
-/* Copies named reference file to the current directory. */
-void copy_reference_file(const char *);
-
-/* Extracts a list of files to the current directory.
- * List must be NULL terminated.
- */
-void extract_reference_files(const char **);
-
-/* Path to working directory for current test */
-extern const char *testworkdir;
-
-/*
- * Special interfaces for program test harness.
- */
-
-/* Pathname of exe to be tested. */
-extern const char *testprogfile;
-/* Name of exe to use in printf-formatted command strings. */
-/* On Windows, this includes leading/trailing quotes. */
-extern const char *testprog;
-
-#ifdef USE_DMALLOC
-#include <dmalloc.h>
-#endif
+#include "test_common.h"
Modified: trunk/contrib/libarchive/cpio/test/test_option_J_upper.c
===================================================================
--- trunk/contrib/libarchive/cpio/test/test_option_J_upper.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/cpio/test/test_option_J_upper.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -47,10 +47,13 @@
}
failure("-J option is broken");
assertEqualInt(r, 0);
- return;
+ goto done;
}
+ free(p);
/* Check that the archive file has an xz signature. */
p = slurpfile(&s, "archive.out");
assert(s > 2);
assertEqualMem(p, "\3757zXZ", 5);
+done:
+ free(p);
}
Modified: trunk/contrib/libarchive/cpio/test/test_option_Z_upper.c
===================================================================
--- trunk/contrib/libarchive/cpio/test/test_option_Z_upper.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/cpio/test/test_option_Z_upper.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -43,14 +43,18 @@
if (strstr(p, "compression not available") != NULL) {
skipping("This version of bsdcpio was compiled "
"without compress support");
+ free(p);
return;
}
failure("-Z option is broken");
assertEqualInt(r, 0);
+ free(p);
return;
}
+ free(p);
/* Check that the archive file has a compress signature. */
p = slurpfile(&s, "archive.out");
assert(s > 2);
assertEqualMem(p, "\x1f\x9d", 2);
+ free(p);
}
Modified: trunk/contrib/libarchive/cpio/test/test_option_a.c
===================================================================
--- trunk/contrib/libarchive/cpio/test/test_option_a.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/cpio/test/test_option_a.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -96,7 +96,8 @@
test_create();
/* Sanity check; verify that atimes really do get modified. */
- assert((p = slurpfile(NULL, "f0")) != NULL);
+ p = slurpfile(NULL, "f0");
+ assert(p != NULL);
free(p);
assertEqualInt(0, stat("f0", &st));
if (st.st_atime == files[0].atime_sec) {
Modified: trunk/contrib/libarchive/cpio/test/test_option_b64encode.c
===================================================================
--- trunk/contrib/libarchive/cpio/test/test_option_b64encode.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/cpio/test/test_option_b64encode.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -42,6 +42,7 @@
p = slurpfile(&s, "archive.out");
assert(s > 2);
assertEqualMem(p, "begin-base64 644", 16);
+ free(p);
/* Archive it with uuencode only. */
assertEqualInt(0,
@@ -51,4 +52,5 @@
p = slurpfile(&s, "archive.out");
assert(s > 2);
assertEqualMem(p, "begin-base64 644", 16);
+ free(p);
}
Modified: trunk/contrib/libarchive/cpio/test/test_option_grzip.c
===================================================================
--- trunk/contrib/libarchive/cpio/test/test_option_grzip.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/cpio/test/test_option_grzip.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -44,9 +44,10 @@
systemf("echo f | %s -o --grzip >archive.out 2>archive.err",
testprog));
p = slurpfile(&s, "archive.err");
- p[s] = '\0';
+ free(p);
/* Check that the archive file has an grzip signature. */
p = slurpfile(&s, "archive.out");
assert(s > 2);
assertEqualMem(p, "GRZipII\x00\x02\x04:)", 12);
+ free(p);
}
Modified: trunk/contrib/libarchive/cpio/test/test_option_lrzip.c
===================================================================
--- trunk/contrib/libarchive/cpio/test/test_option_lrzip.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/cpio/test/test_option_lrzip.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -44,9 +44,10 @@
systemf("echo f | %s -o --lrzip >archive.out 2>archive.err",
testprog));
p = slurpfile(&s, "archive.err");
- p[s] = '\0';
+ free(p);
/* Check that the archive file has an lzma signature. */
p = slurpfile(&s, "archive.out");
assert(s > 2);
assertEqualMem(p, "LRZI\x00", 5);
+ free(p);
}
Modified: trunk/contrib/libarchive/cpio/test/test_option_lz4.c
===================================================================
--- trunk/contrib/libarchive/cpio/test/test_option_lz4.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/cpio/test/test_option_lz4.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -43,6 +43,7 @@
if (strstr(p, "compression not available") != NULL) {
skipping("This version of bsdcpio was compiled "
"without lz4 support");
+ free(p);
return;
}
/* POSIX permits different handling of the spawnp
@@ -52,6 +53,7 @@
if (strstr(p, "Can't launch") != NULL && !canLz4()) {
skipping("This version of bsdcpio uses an external lz4 program "
"but no such program is available on this system.");
+ free(p);
return;
}
/* Some systems successfully spawn the new process,
@@ -61,14 +63,26 @@
if (strstr(p, "Can't write") != NULL && !canLz4()) {
skipping("This version of bsdcpio uses an external lz4 program "
"but no such program is available on this system.");
+ free(p);
return;
}
+ /* On some systems the error won't be detected until closing
+ time, by a 127 exit error returned by waitpid. */
+ if (strstr(p, "Error closing") != NULL && !canLz4()) {
+ skipping("This version of bsdcpio uses an external lz4 program "
+ "but no such program is available on this system.");
+ free(p);
+ return;
+ }
failure("--lz4 option is broken: %s", p);
+ free(p);
assertEqualInt(r, 0);
return;
}
+ free(p);
/* Check that the archive file has an lz4 signature. */
p = slurpfile(&s, "archive.out");
assert(s > 2);
assertEqualMem(p, "\x04\x22\x4d\x18", 4);
+ free(p);
}
Modified: trunk/contrib/libarchive/cpio/test/test_option_lzma.c
===================================================================
--- trunk/contrib/libarchive/cpio/test/test_option_lzma.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/cpio/test/test_option_lzma.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -43,14 +43,18 @@
if (strstr(p, "compression not available") != NULL) {
skipping("This version of bsdcpio was compiled "
"without lzma support");
+ free(p);
return;
}
failure("--lzma option is broken");
assertEqualInt(r, 0);
+ free(p);
return;
}
+ free(p);
/* Check that the archive file has an lzma signature. */
p = slurpfile(&s, "archive.out");
assert(s > 2);
assertEqualMem(p, "\x5d\00\00", 3);
+ free(p);
}
Modified: trunk/contrib/libarchive/cpio/test/test_option_lzop.c
===================================================================
--- trunk/contrib/libarchive/cpio/test/test_option_lzop.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/cpio/test/test_option_lzop.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -39,7 +39,7 @@
r = systemf("echo f | %s -o --lzop >archive.out 2>archive.err",
testprog);
p = slurpfile(&s, "archive.err");
- p[s] = '\0';
+ free(p);
if (r != 0) {
if (!canLzop()) {
skipping("lzop is not supported on this platform");
@@ -53,4 +53,5 @@
p = slurpfile(&s, "archive.out");
assert(s > 2);
assertEqualMem(p, "\x89\x4c\x5a\x4f\x00\x0d\x0a\x1a\x0a", 9);
+ free(p);
}
Modified: trunk/contrib/libarchive/cpio/test/test_option_u.c
===================================================================
--- trunk/contrib/libarchive/cpio/test/test_option_u.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/cpio/test/test_option_u.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -49,6 +49,7 @@
p = slurpfile(&s, "copy/f");
assertEqualInt(s, 1);
assertEqualMem(p, "a", 1);
+ free(p);
/* Recreate the file with a single "b" */
assertMakeFile("f", 0644, "b");
@@ -68,6 +69,7 @@
p = slurpfile(&s, "copy/f");
assertEqualInt(s, 1);
assertEqualMem(p, "a", 1);
+ free(p);
/* Copy the file to the "copy" dir with -u (force) */
r = systemf("echo f| %s -pud copy >copy.out 2>copy.err",
@@ -78,4 +80,5 @@
p = slurpfile(&s, "copy/f");
assertEqualInt(s, 1);
assertEqualMem(p, "b", 1);
+ free(p);
}
Modified: trunk/contrib/libarchive/cpio/test/test_option_uuencode.c
===================================================================
--- trunk/contrib/libarchive/cpio/test/test_option_uuencode.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/cpio/test/test_option_uuencode.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -42,6 +42,7 @@
p = slurpfile(&s, "archive.out");
assert(s > 2);
assertEqualMem(p, "begin 644", 9);
+ free(p);
/* Archive it with uuencode only. */
assertEqualInt(0,
@@ -51,4 +52,5 @@
p = slurpfile(&s, "archive.out");
assert(s > 2);
assertEqualMem(p, "begin 644", 9);
+ free(p);
}
Modified: trunk/contrib/libarchive/cpio/test/test_option_version.c
===================================================================
--- trunk/contrib/libarchive/cpio/test/test_option_version.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/cpio/test/test_option_version.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2003-2007 Tim Kientzle
+ * Copyright (c) 2003-2017 Tim Kientzle
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -23,92 +23,8 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: stable/11/contrib/libarchive/cpio/test/test_option_version.c 305188 2016-09-01 07:53:59Z mm $");
-/*
- * Test that --version option works and generates reasonable output.
- */
-
-static void
-verify(const char *p, size_t s)
-{
- const char *q = p;
-
- /* Version message should start with name of program, then space. */
- failure("version message too short:", p);
- if (!assert(s > 6))
- return;
- failure("Version message should begin with 'bsdcpio': %s", p);
- if (!assertEqualMem(q, "bsdcpio ", 8))
- /* If we're not testing bsdcpio, don't keep going. */
- return;
- q += 8; s -= 8;
- /* Version number is a series of digits and periods. */
- while (s > 0 && (*q == '.' || (*q >= '0' && *q <= '9'))) {
- ++q;
- --s;
- }
- /* Version number terminated by space. */
- failure("Version: %s", p);
- assert(s > 1);
- /* Skip a single trailing a,b,c, or d. */
- if (*q == 'a' || *q == 'b' || *q == 'c' || *q == 'd')
- ++q;
- failure("Version: %s", p);
- assert(*q == ' ');
- ++q; --s;
- /* Separator. */
- failure("Version: %s", p);
- assertEqualMem(q, "- ", 2);
- q += 2; s -= 2;
- /* libarchive name and version number */
- assert(s > 11);
- failure("Version: %s", p);
- assertEqualMem(q, "libarchive ", 11);
- q += 11; s -= 11;
- /* Version number is a series of digits and periods. */
- while (s > 0 && (*q == '.' || (*q >= '0' && *q <= '9'))) {
- ++q;
- --s;
- }
- /* Skip a single trailing a,b,c, or d. */
- if (*q == 'a' || *q == 'b' || *q == 'c' || *q == 'd')
- ++q;
- /* Skip arbitrary third-party version numbers. */
- while (s > 0 && (*q == ' ' || *q == '-' || *q == '/' || *q == '.' || isalnum(*q))) {
- ++q;
- --s;
- }
- /* All terminated by end-of-line: \r, \r\n, or \n */
- assert(s >= 1);
- failure("Version: %s", p);
- if (*q == '\x0d') {
- if (q[1] != '\0')
- assertEqualMem(q, "\x0d\x0a", 2);
- } else
- assertEqualMem(q, "\x0a", 1);
-}
-
-
DEFINE_TEST(test_option_version)
{
- int r;
- char *p;
- size_t s;
-
- r = systemf("%s --version >version.stdout 2>version.stderr", testprog);
- if (r != 0)
- r = systemf("%s -W version >version.stdout 2>version.stderr",
- testprog);
- failure("Unable to run either %s --version or %s -W version",
- testprog, testprog);
- if (!assert(r == 0))
- return;
-
- /* --version should generate nothing to stderr. */
- assertEmptyFile("version.stderr");
- /* Verify format of version message. */
- p = slurpfile(&s, "version.stdout");
- verify(p, s);
- free(p);
+ assertVersion(testprog, "bsdcpio");
}
Modified: trunk/contrib/libarchive/cpio/test/test_option_xz.c
===================================================================
--- trunk/contrib/libarchive/cpio/test/test_option_xz.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/cpio/test/test_option_xz.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -44,14 +44,18 @@
if (strstr(p, "compression not available") != NULL) {
skipping("This version of bsdcpio was compiled "
"without xz support");
+ free(p);
return;
}
+ free(p);
failure("--xz option is broken");
assertEqualInt(r, 0);
return;
}
+ free(p);
/* Check that the archive file has an xz signature. */
p = slurpfile(&s, "archive.out");
assert(s > 2);
assertEqualMem(p, "\xFD\x37\x7A\x58\x5A\x00", 6);
+ free(p);
}
Modified: trunk/contrib/libarchive/cpio/test/test_option_y.c
===================================================================
--- trunk/contrib/libarchive/cpio/test/test_option_y.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/cpio/test/test_option_y.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -38,7 +38,7 @@
r = systemf("echo f | %s -oy >archive.out 2>archive.err",
testprog);
p = slurpfile(&s, "archive.err");
- p[s] = '\0';
+ free(p);
if (r != 0) {
if (!canBzip2()) {
skipping("bzip2 is not supported on this platform");
@@ -53,4 +53,5 @@
p = slurpfile(&s, "archive.out");
assert(s > 2);
assertEqualMem(p, "BZh9", 4);
+ free(p);
}
Modified: trunk/contrib/libarchive/cpio/test/test_option_z.c
===================================================================
--- trunk/contrib/libarchive/cpio/test/test_option_z.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/cpio/test/test_option_z.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -38,7 +38,7 @@
r = systemf("echo f | %s -oz >archive.out 2>archive.err",
testprog);
p = slurpfile(&s, "archive.err");
- p[s] = '\0';
+ free(p);
if (r != 0) {
if (!canGzip()) {
skipping("gzip is not supported on this platform");
@@ -52,4 +52,5 @@
p = slurpfile(&s, "archive.out");
assert(s > 4);
assertEqualMem(p, "\x1f\x8b\x08\x00", 4);
+ free(p);
}
Modified: trunk/contrib/libarchive/cpio/test/test_owner_parse.c
===================================================================
--- trunk/contrib/libarchive/cpio/test/test_owner_parse.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/cpio/test/test_owner_parse.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -38,7 +38,7 @@
* its primary group membership depends on how the user set up
* their /etc/passwd. Likely values are 513 (None), 545 (Users),
* or 544 (Administrators). Just check for one of those...
- * TODO: Handle non-English localizations...e.g. French 'Administrateur'
+ * TODO: Handle non-English localizations... e.g. French 'Administrateur'
* Use CreateWellKnownSID() and LookupAccountName()?
*/
#define ROOT "Administrator"
Modified: trunk/contrib/libarchive/doc/html/archive_entry.3.html
===================================================================
--- trunk/contrib/libarchive/doc/html/archive_entry.3.html 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/html/archive_entry.3.html 2018-06-19 20:42:35 UTC (rev 11134)
@@ -1,5 +1,5 @@
<!-- Creator : groff version 1.22.3 -->
-<!-- CreationDate: Sun Jun 19 19:54:05 2016 -->
+<!-- CreationDate: Mon Jul 10 02:32:53 2017 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
@@ -181,7 +181,7 @@
was written by Tim Kientzle <kientzle at acm.org>.</p>
<p style="margin-left:6%; margin-top: 1em">BSD
-Feburary 2, 2012 BSD</p>
+February 2, 2012 BSD</p>
<hr>
</body>
</html>
Modified: trunk/contrib/libarchive/doc/html/archive_entry_acl.3.html
===================================================================
--- trunk/contrib/libarchive/doc/html/archive_entry_acl.3.html 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/html/archive_entry_acl.3.html 2018-06-19 20:42:35 UTC (rev 11134)
@@ -1,5 +1,5 @@
<!-- Creator : groff version 1.22.3 -->
-<!-- CreationDate: Sun Jun 19 19:54:05 2016 -->
+<!-- CreationDate: Mon Jul 10 02:32:54 2017 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
@@ -30,10 +30,14 @@
<b>archive_entry_acl_add_entry_w</b>,
<b>archive_entry_acl_clear</b>,
<b>archive_entry_acl_count</b>,
+<b>archive_entry_acl_from_text</b>,
+<b>archive_entry_acl_from_text_w</b>,
<b>archive_entry_acl_next</b>,
<b>archive_entry_acl_next_w</b>,
<b>archive_entry_acl_reset</b>,
-<b>archive_entry_acl_text_w</b> — functions for
+<b>archive_entry_acl_to_text</b>,
+<b>archive_entry_acl_to_text_w</b>,
+<b>archive_entry_acl_types</b> — functions for
manipulating Access Control Lists in archive entry
descriptions</p>
@@ -77,6 +81,20 @@
<p style="margin-left:6%; margin-top: 1em"><i>int</i></p>
+<p><b>archive_entry_acl_from_text</b>(<i>struct archive_entry *a</i>,
+<i>const char *text</i>,
+<i>int type</i>);</p>
+
+<p style="margin-left:6%; margin-top: 1em"><i>int</i></p>
+
+
+<p><b>archive_entry_acl_from_text_w</b>(<i>struct archive_entry *a</i>,
+<i>const wchar_t *text</i>,
+<i>int type</i>);</p>
+
+<p style="margin-left:6%; margin-top: 1em"><i>int</i></p>
+
+
<p><b>archive_entry_acl_next</b>(<i>struct archive_entry *a</i>,
<i>int type</i>, <i>int *ret_type</i>,
<i>int *ret_permset</i>, <i>int *ret_tag</i>,
@@ -98,86 +116,287 @@
<p style="margin-left:12%;"><b>archive_entry_acl_reset</b>(<i>struct archive_entry *a</i>,
<i>int type</i>);</p>
-<p style="margin-left:6%; margin-top: 1em"><i>const wchar_t
+<p style="margin-left:6%; margin-top: 1em"><i>char
*</i></p>
-<p style="margin-left:12%;"><b>archive_entry_acl_text_w</b>(<i>struct archive_entry *a</i>,
-<i>int flags</i>);</p>
+<p><b>archive_entry_acl_to_text</b>(<i>struct archive_entry *a</i>,
+<i>ssize_t *len_p</i>, <i>int flags</i>);</p>
+<p style="margin-left:6%; margin-top: 1em"><i>wchar_t
+*</i></p>
+
+
+<p><b>archive_entry_acl_to_text_w</b>(<i>struct archive_entry *a</i>,
+<i>ssize_t *len_p</i>, <i>int flags</i>);</p>
+
+<p style="margin-left:6%; margin-top: 1em"><i>int</i></p>
+
+
+<p style="margin-left:12%;"><b>archive_entry_acl_types</b>(<i>struct archive_entry *a</i>);</p>
+
<p style="margin-top: 1em"><b>DESCRIPTION</b></p>
-<p style="margin-left:6%;">An ’’Access Control
-List’’ is a generalisation of the classic Unix
-permission system. The ACL interface of <b>libarchive</b> is
-derived from the POSIX.1e draft, but restricted to simplify
-dealing with practical implementations in various Operating
-Systems and archive formats.</p>
+<p style="margin-left:6%;">The ’’Access Control
+Lists (ACLs)’’ extend the standard Unix perssion
+model. The ACL interface of <b>libarchive</b> supports both
+POSIX.1e and NFSv4 style ACLs. Use of ACLs is restricted by
+various levels of ACL support in operating systems, file
+systems and archive formats.</p>
-<p style="margin-left:6%; margin-top: 1em">An ACL consists
-of a number of independent entries. Each entry specifies the
-permission set as bitmask of basic permissions. Valid
-permissions are:</p>
+<p style="margin-left:6%; margin-top: 1em"><b>POSIX.1e
+Access Control Lists</b> <br>
+A POSIX.1e ACL consists of a number of independent entries.
+Each entry specifies the permission set as bitmask of basic
+permissions. Valid permissions in the <i>permset</i>
+are:</p>
-<p>ARCHIVE_ENTRY_ACL_EXECUTE <br>
-ARCHIVE_ENTRY_ACL_WRITE <br>
-ARCHIVE_ENTRY_ACL_READ</p>
+<p>ARCHIVE_ENTRY_ACL_READ (<b>r</b>) <br>
+ARCHIVE_ENTRY_ACL_WRITE (<b>w</b>) <br>
+ARCHIVE_ENTRY_ACL_EXECUTE (<b>x</b>)</p>
-<p style="margin-left:6%; margin-top: 1em">The permissions
-correspond to the normal Unix permissions.</p>
+<p style="margin-left:6%;">The permissions correspond to
+the normal Unix permissions.</p>
-<p style="margin-left:6%; margin-top: 1em">The tag
+<p style="margin-left:6%; margin-top: 1em">The <i>tag</i>
specifies the principal to which the permission applies.
Valid values are:</p>
<p>ARCHIVE_ENTRY_ACL_USER</p>
-<p style="margin-left:51%; margin-top: 1em">The user
-specified by the name field.</p>
+<p style="margin-left:51%;">The user specified by the name
+field.</p>
<p>ARCHIVE_ENTRY_ACL_USER_OBJ</p>
-<p style="margin-left:51%; margin-top: 1em">The owner of
-the file.</p>
+<p style="margin-left:51%;">The owner of the file.</p>
<p>ARCHIVE_ENTRY_ACL_GROUP</p>
-<p style="margin-left:51%; margin-top: 1em">The group
-specied by the name field.</p>
+<p style="margin-left:51%;">The group specied by the name
+field.</p>
<p>ARCHIVE_ENTRY_ACL_GROUP_OBJ</p>
-<p style="margin-left:51%; margin-top: 1em">The group who
-owns the file.</p>
+<p style="margin-left:51%;">The group who owns the
+file.</p>
<p>ARCHIVE_ENTRY_ACL_MASK</p>
-<p style="margin-left:51%; margin-top: 1em">The maximum
-permissions to be obtained via group permissions.</p>
+<p style="margin-left:51%;">The maximum permissions to be
+obtained via group permissions.</p>
<p>ARCHIVE_ENTRY_ACL_OTHER</p>
-<p style="margin-left:51%; margin-top: 1em">Any principal
-who doesn’t have a user or group entry.</p>
+<p style="margin-left:51%;">Any principal who is not file
+owner or a member of the owning group.</p>
-<p style="margin-left:6%;">The principals
+<p style="margin-left:6%; margin-top: 1em">The principals
ARCHIVE_ENTRY_ACL_USER_OBJ, ARCHIVE_ENTRY_ACL_GROUP_OBJ and
ARCHIVE_ENTRY_ACL_OTHER are equivalent to user, group and
other in the classic Unix permission model and specify
non-extended ACL entries.</p>
-<p style="margin-left:6%; margin-top: 1em">All files have
-an access ACL (ARCHIVE_ENTRY_ACL_TYPE_ACCESS). This
+<p style="margin-left:6%; margin-top: 1em">All files with
+have an access ACL (ARCHIVE_ENTRY_ACL_TYPE_ACCESS). This
specifies the permissions required for access to the file
itself. Directories have an additional ACL
(ARCHIVE_ENTRY_ACL_TYPE_DEFAULT), which controls the initial
access ACL for newly created directory entries.</p>
+<p style="margin-left:6%; margin-top: 1em"><b>NFSv4 Access
+Control Lists</b> <br>
+A NFSv4 ACL consists of multiple individual entries called
+Access Control Entries (ACEs).</p>
-<p style="margin-left:6%; margin-top: 1em"><b>archive_entry_acl_add_entry</b>()
-and <b>archive_entry_acl_add_entry_w</b>() add a single ACL
+<p style="margin-left:6%; margin-top: 1em">There are four
+possible types of a NFSv4 ACE:</p>
+
+<p>ARCHIVE_ENTRY_ACL_TYPE_ALLOW</p>
+
+<p style="margin-left:51%;">Allow principal to perform
+actions requiring given permissions.</p>
+
+<p>ARCHIVE_ENTRY_ACL_TYPE_DENY</p>
+
+<p style="margin-left:51%;">Prevent principal from
+performing actions requiring given permissions.</p>
+
+<p>ARCHIVE_ENTRY_ACL_TYPE_AUDIT</p>
+
+<p style="margin-left:51%;">Log access attempts by
+principal which require given permissions.</p>
+
+<p>ARCHIVE_ENTRY_ACL_TYPE_ALARM</p>
+
+<p style="margin-left:51%;">Trigger a system alarm on
+access attempts by principal which require given
+permissions.</p>
+
+<p style="margin-left:6%; margin-top: 1em">The <i>tag</i>
+specifies the principal to which the permission applies.
+Valid values are:</p>
+
+<p>ARCHIVE_ENTRY_ACL_USER</p>
+
+<p style="margin-left:51%;">The user specified by the name
+field.</p>
+
+<p>ARCHIVE_ENTRY_ACL_USER_OBJ</p>
+
+<p style="margin-left:51%;">The owner of the file.</p>
+
+<p>ARCHIVE_ENTRY_ACL_GROUP</p>
+
+<p style="margin-left:51%;">The group specied by the name
+field.</p>
+
+<p>ARCHIVE_ENTRY_ACL_GROUP_OBJ</p>
+
+<p style="margin-left:51%;">The group who owns the
+file.</p>
+
+<p>ARCHIVE_ENTRY_ACL_EVERYONE</p>
+
+<p style="margin-left:51%;">Any principal who is not file
+owner or a member of the owning group.</p>
+
+<p style="margin-left:6%; margin-top: 1em">Entries with the
+ARCHIVE_ENTRY_ACL_USER or ARCHIVE_ENTRY_ACL_GROUP tag store
+the user and group name in the <i>name</i> string and
+optionally the user or group ID in the <i>qualifier</i>
+integer.</p>
+
+<p style="margin-left:6%; margin-top: 1em">NFSv4 ACE
+permissions and flags are stored in the same <i>permset</i>
+bitfield. Some permissions share the same constant and
+permission character but have different effect on
+directories than on files. The following ACE permissions are
+supported:</p>
+
+<p>ARCHIVE_ENTRY_ACL_READ_DATA (<b>r</b>)</p>
+
+<p style="margin-left:24%;">Read data (file).</p>
+
+<p>ARCHIVE_ENTRY_ACL_LIST_DIRECTORY (<b>r</b>)</p>
+
+<p style="margin-left:24%;">List entries (directory).</p>
+
+<p>ARCHIVE_ENTRY_ACL_WRITE_DATA (<b>w</b>)</p>
+
+<p style="margin-left:24%;">Write data (file).</p>
+
+<p>ARCHIVE_ENTRY_ACL_ADD_FILE (<b>w</b>)</p>
+
+<p style="margin-left:24%;">Create files (directory).</p>
+
+<p>ARCHIVE_ENTRY_ACL_EXECUTE (<b>x</b>)</p>
+
+<p style="margin-left:24%;">Execute file or change into a
+directory.</p>
+
+<p>ARCHIVE_ENTRY_ACL_APPEND_DATA (<b>p</b>)</p>
+
+<p style="margin-left:24%;">Append data (file).</p>
+
+<p>ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY (<b>p</b>)</p>
+
+<p style="margin-left:24%;">Create subdirectories
+(directory).</p>
+
+<p>ARCHIVE_ENTRY_ACL_DELETE_CHILD (<b>D</b>)</p>
+
+<p style="margin-left:24%;">Remove files and subdirectories
+inside a directory.</p>
+
+<p>ARCHIVE_ENTRY_ACL_DELETE (<b>d</b>)</p>
+
+<p style="margin-left:24%;">Remove file or directory.</p>
+
+<p>ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES (<b>a</b>)</p>
+
+<p style="margin-left:24%;">Read file or directory
+attributes.</p>
+
+<p>ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES (<b>A</b>)</p>
+
+<p style="margin-left:24%;">Write file or directory
+attributes.</p>
+
+<p>ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS (<b>R</b>)</p>
+
+<p style="margin-left:24%;">Read named file or directory
+attributes.</p>
+
+<p>ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS (<b>W</b>)</p>
+
+<p style="margin-left:24%;">Write named file or directory
+attributes.</p>
+
+<p>ARCHIVE_ENTRY_ACL_READ_ACL (<b>c</b>)</p>
+
+<p style="margin-left:24%;">Read file or directory ACL.</p>
+
+<p>ARCHIVE_ENTRY_ACL_WRITE_ACL (<b>C</b>)</p>
+
+<p style="margin-left:24%;">Write file or directory
+ACL.</p>
+
+<p>ARCHIVE_ENTRY_ACL_WRITE_OWNER (<b>o</b>)</p>
+
+<p style="margin-left:24%;">Change owner of a file or
+directory.</p>
+
+<p>ARCHIVE_ENTRY_ACL_SYNCHRONIZE (<b>s</b>)</p>
+
+<p style="margin-left:24%;">Use synchronous I/O.</p>
+
+<p style="margin-left:6%; margin-top: 1em">The following
+NFSv4 ACL inheritance flags are supported:</p>
+
+<p>ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT (<b>f</b>)</p>
+
+<p style="margin-left:24%;">Inherit parent directory ACE to
+files.</p>
+
+<p>ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT (<b>d</b>)</p>
+
+<p style="margin-left:24%;">Inherit parent directory ACE to
+subdirectories.</p>
+
+<p>ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY (<b>i</b>)</p>
+
+<p style="margin-left:24%;">Only inherit, do not apply the
+permission on the directory itself.</p>
+
+<p>ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT
+(<b>n</b>)</p>
+
+<p style="margin-left:24%;">Do not propagate inherit flags.
+Only first-level entries inherit ACLs.</p>
+
+<p>ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS (<b>S</b>)</p>
+
+<p style="margin-left:24%;">Trigger alarm or audit on
+successful access.</p>
+
+<p>ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS (<b>F</b>)</p>
+
+<p style="margin-left:24%;">Trigger alarm or audit on
+failed access.</p>
+
+<p>ARCHIVE_ENTRY_ACL_ENTRY_INHERITED (<b>I</b>)</p>
+
+<p style="margin-left:24%;">Mark that ACE was
+inherited.</p>
+
+<p style="margin-left:6%; margin-top: 1em"><b>Functions
+<br>
+archive_entry_acl_add_entry</b>() and
+<b>archive_entry_acl_add_entry_w</b>() add a single ACL
entry. For the access ACL and non-extended principals, the
-classic Unix permissions are updated.</p>
+classic Unix permissions are updated. An archive entry
+cannot contain both POSIX.1e and NFSv4 ACL entries.</p>
<p style="margin-left:6%; margin-top: 1em"><b>archive_entry_acl_clear</b>()
@@ -187,14 +406,47 @@
<p style="margin-left:6%; margin-top: 1em"><b>archive_entry_acl_count</b>()
counts the ACL entries that have the given type mask.
-<i>type</i> can be the bitwise-or of
-ARCHIVE_ENTRY_ACL_TYPE_ACCESS and
-ARCHIVE_ENTRY_ACL_TYPE_DEFAULT. If
-ARCHIVE_ENTRY_ACL_TYPE_ACCESS is included and at least one
-extended ACL entry is found, the three non-extened ACLs are
-added.</p>
+<i>type</i> can be the bitwise-or of</p>
+<p>ARCHIVE_ENTRY_ACL_TYPE_ACCESS <br>
+ARCHIVE_ENTRY_ACL_TYPE_DEFAULT</p>
+<p style="margin-left:6%; margin-top: 1em">for POSIX.1e
+ACLs and</p>
+
+<p>ARCHIVE_ENTRY_ACL_TYPE_ALLOW <br>
+ARCHIVE_ENTRY_ACL_TYPE_DENY <br>
+ARCHIVE_ENTRY_ACL_TYPE_AUDIT <br>
+ARCHIVE_ENTRY_ACL_TYPE_ALARM</p>
+
+<p style="margin-left:6%; margin-top: 1em">for NFSv4 ACLs.
+For POSIX.1e ACLs if ARCHIVE_ENTRY_ACL_TYPE_ACCESS is
+included and at least one extended ACL entry is found, the
+three non-extended ACLs are added.</p>
+
+
+<p style="margin-left:6%; margin-top: 1em"><b>archive_entry_acl_from_text</b>()
+and <b>archive_entry_acl_from_text_w</b>() add new (or merge
+with existing) ACL entries from (wide) text. The argument
+<i>type</i> may take one of the following values:</p>
+
+<p>ARCHIVE_ENTRY_ACL_TYPE_ACCESS <br>
+ARCHIVE_ENTRY_ACL_TYPE_DEFAULT <br>
+ARCHIVE_ENTRY_ACL_TYPE_NFS4</p>
+
+<p style="margin-left:6%; margin-top: 1em">Supports all
+formats that can be created with
+<b>archive_entry_acl_to_text</b>() or respective
+<b>archive_entry_acl_to_text_w</b>(). Existing ACL entries
+are preserved. To get a clean new ACL from text
+<b>archive_entry_acl_clear</b>() must be called first.
+Entries prefixed with ’’default:’’
+are treated as ARCHIVE_ENTRY_ACL_TYPE_DEFAULT unless
+<i>type</i> is ARCHIVE_ENTRY_ACL_TYPE_NFS4. Invalid entries,
+non-parseable ACL entries and entries beginning with the
+’#’ character (comments) are skipped.</p>
+
+
<p style="margin-left:6%; margin-top: 1em"><b>archive_entry_acl_next</b>()
and <b>archive_entry_acl_next_w</b>() return the next entry
of the ACL list. This functions may only be called after
@@ -213,29 +465,91 @@
<b>archive_entry_acl_count</b>().</p>
-<p style="margin-left:6%; margin-top: 1em"><b>archive_entry_acl_text_w</b>()
-converts the ACL entries for the given type mask into a wide
-string. In addition to the normal type flags,
-ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID and
-ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT can be specified to
-further customize the result. The returned long string is
-valid until the next call to
-<b>archive_entry_acl_clear</b>(),
-<b>archive_entry_acl_add_entry</b>(),
-<b>archive_entry_acl_add_entry_w</b>() or
-<b>archive_entry_acl_text_w</b>().</p>
+<p style="margin-left:6%; margin-top: 1em"><b>archive_entry_acl_to_text</b>()
+and <b>archive_entry_acl_to_text_w</b>() convert the ACL
+entries for the given type into a (wide) string of ACL
+entries separated by newline. If the pointer <i>len_p</i> is
+not NULL, then the function shall return the length of the
+string (not including the NULL terminator) in the location
+pointed to by <i>len_p</i>. The <i>flag</i> argument is a
+bitwise-or.</p>
+<p style="margin-left:6%; margin-top: 1em">The following
+flags are effective only on POSIX.1e ACL:</p>
+
+<p>ARCHIVE_ENTRY_ACL_TYPE_ACCESS</p>
+
+<p style="margin-left:24%;">Output access ACLs.</p>
+
+<p>ARCHIVE_ENTRY_ACL_TYPE_DEFAULT</p>
+
+<p style="margin-left:24%;">Output POSIX.1e default
+ACLs.</p>
+
+<p>ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT</p>
+
+<p style="margin-left:24%;">Prefix each default ACL entry
+with the word ’’default:’’.</p>
+
+<p>ARCHIVE_ENTRY_ACL_STYLE_SOLARIS</p>
+
+<p style="margin-left:24%;">The mask and other ACLs don not
+contain a double colon.</p>
+
+<p style="margin-left:6%; margin-top: 1em">The following
+flags are effecive only on NFSv4 ACL:</p>
+
+<p>ARCHIVE_ENTRY_ACL_STYLE_COMPACT</p>
+
+<p style="margin-left:24%;">Do not output minus characters
+for unset permissions and flags in NFSv4 ACL permission and
+flag fields.</p>
+
+<p style="margin-left:6%; margin-top: 1em">The following
+flags are effective on both POSIX.1e and NFSv4 ACL:</p>
+
+<p>ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID</p>
+
+<p style="margin-left:24%;">Add an additional
+colon-separated field containing the user or group id.</p>
+
+<p>ARCHIVE_ENTRY_ACL_STYLE_SEPARATOR_COMMA</p>
+
+<p style="margin-left:24%;">Separate ACL entries with comma
+instead of newline.</p>
+
+<p style="margin-left:6%; margin-top: 1em">If the archive
+entry contains NFSv4 ACLs, all types of NFSv4 ACLs are
+returned. It the entry contains POSIX.1e ACLs and none of
+the flags ARCHIVE_ENTRY_ACL_TYPE_ACCESS or
+ARCHIVE_ENTRY_ACL_TYPE_DEFAULT are specified, both access
+and default entries are returned and default entries are
+prefixed with ’’default:’’.</p>
+
+
+<p style="margin-left:6%; margin-top: 1em"><b>archive_entry_acl_types</b>()
+get ACL entry types contained in an archive entry’s
+ACL. As POSIX.1e and NFSv4 ACL entries cannot be mixed, this
+function is a very efficient way to detect if an ACL already
+contains POSIX.1e or NFSv4 ACL entries.</p>
+
<p style="margin-top: 1em"><b>RETURN VALUES</b></p>
<p style="margin-left:6%;"><b>archive_entry_acl_count</b>()
and <b>archive_entry_acl_reset</b>() returns the number of
-ACL entries that match the given type mask. If the type mask
-includes ARCHIVE_ENTRY_ACL_TYPE_ACCESS and at least one
-extended ACL entry exists, the three classic Unix
-permissions are counted.</p>
+ACL entries that match the given type mask. For POSIX.1e
+ACLS if the type mask includes ARCHIVE_ENTRY_ACL_TYPE_ACCESS
+and at least one extended ACL entry exists, the three
+classic Unix permissions are counted.</p>
+<p style="margin-left:6%; margin-top: 1em"><b>archive_entry_acl_from_text</b>()
+and <b>archive_entry_acl_from_text_w</b>() return ARCHIVE_OK
+if all entries were successfully parsed and ARCHIVE_WARN if
+one or more entries were invalid or non-parseable.</p>
+
+
<p style="margin-left:6%; margin-top: 1em"><b>archive_entry_acl_next</b>()
and <b>archive_entry_acl_next_w</b>() return ARCHIVE_OK on
success, ARCHIVE_EOF if no more ACL entries exist and
@@ -243,29 +557,27 @@
been called first.</p>
-<p style="margin-left:6%; margin-top: 1em"><b>archive_entry_text_w</b>()
-returns a wide string representation of the ACL entrise
-matching the given type mask. The returned long string is
-valid until the next call to
-<b>archive_entry_acl_clear</b>(),
-<b>archive_entry_acl_add_entry</b>(),
-<b>archive_entry_acl_add_entry_w</b>() or
-<b>archive_entry_acl_text_w</b>().</p>
+<p style="margin-left:6%; margin-top: 1em"><b>archive_entry_acl_to_text</b>()
+returns a string representing the ACL entries matching the
+given type and flags on success or NULL on error.</p>
-<p style="margin-top: 1em"><b>SEE ALSO</b></p>
-<p style="margin-left:6%;">archive_entry(3)
-libarchive(3),</p>
+<p style="margin-left:6%; margin-top: 1em"><b>archive_entry_acl_to_text_w</b>()
+returns a wide string representing the ACL entries matching
+the given type and flags on success or NULL on error.</p>
-<p style="margin-top: 1em"><b>BUGS</b></p>
+<p style="margin-left:6%; margin-top: 1em"><b>archive_entry_acl_types</b>()
+returns a bitmask of ACL entry types or 0 if archive entry
+has no ACL entries.</p>
-<p style="margin-left:6%;">ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID
-and ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT are not
-documented.</p>
+<p style="margin-top: 1em"><b>SEE ALSO</b></p>
+<p style="margin-left:6%;">archive_entry(3),
+libarchive(3)</p>
+
<p style="margin-left:6%; margin-top: 1em">BSD
-February 2, 2012 BSD</p>
+February 15, 2017 BSD</p>
<hr>
</body>
</html>
Modified: trunk/contrib/libarchive/doc/html/archive_entry_linkify.3.html
===================================================================
--- trunk/contrib/libarchive/doc/html/archive_entry_linkify.3.html 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/html/archive_entry_linkify.3.html 2018-06-19 20:42:35 UTC (rev 11134)
@@ -1,5 +1,5 @@
<!-- Creator : groff version 1.22.3 -->
-<!-- CreationDate: Sun Jun 19 19:54:06 2016 -->
+<!-- CreationDate: Mon Jul 10 02:32:54 2017 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
Modified: trunk/contrib/libarchive/doc/html/archive_entry_paths.3.html
===================================================================
--- trunk/contrib/libarchive/doc/html/archive_entry_paths.3.html 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/html/archive_entry_paths.3.html 2018-06-19 20:42:35 UTC (rev 11134)
@@ -1,5 +1,5 @@
<!-- Creator : groff version 1.22.3 -->
-<!-- CreationDate: Sun Jun 19 19:54:06 2016 -->
+<!-- CreationDate: Mon Jul 10 02:32:54 2017 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
@@ -30,24 +30,25 @@
<b>archive_entry_set_hardlink</b>,
<b>archive_entry_copy_hardlink</b>,
<b>archive_entry_copy_hardlink_w</b>,
-<b>archve_entry_update_hardlink_utf8</b>,
+<b>archive_entry_update_hardlink_utf8</b>,
<b>archive_entry_set_link</b>,
<b>archive_entry_copy_link</b>,
<b>archive_entry_copy_link_w</b>,
-<b>archve_entry_update_link_utf8</b>,
+<b>archive_entry_update_link_utf8</b>,
<b>archive_entry_pathname</b>,
<b>archive_entry_pathname_w</b>,
<b>archive_entry_set_pathname</b>,
<b>archive_entry_copy_pathname</b>,
<b>archive_entry_copy_pathname_w</b>,
-<b>archve_entry_update_pathname_utf8</b>,
+<b>archive_entry_update_pathname_utf8</b>,
<b>archive_entry_sourcepath</b>,
<b>archive_entry_copy_sourcepath</b>,
-<b>archive_entry_symlink, archive_entry_symlink_w,
-archive_entry_set_symlink</b>,
+<b>archive_entry_symlink</b>,
+<b>archive_entry_symlink_w</b>,
+<b>archive_entry_set_symlink</b>,
<b>archive_entry_copy_symlink</b>,
<b>archive_entry_copy_symlink_w</b>,
-<b>archve_entry_update_symlink_utf8</b> — functions
+<b>archive_entry_update_symlink_utf8</b> — functions
for manipulating path names in archive entry
descriptions</p>
Modified: trunk/contrib/libarchive/doc/html/archive_entry_perms.3.html
===================================================================
--- trunk/contrib/libarchive/doc/html/archive_entry_perms.3.html 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/html/archive_entry_perms.3.html 2018-06-19 20:42:35 UTC (rev 11134)
@@ -1,5 +1,5 @@
<!-- Creator : groff version 1.22.3 -->
-<!-- CreationDate: Sun Jun 19 19:54:06 2016 -->
+<!-- CreationDate: Mon Jul 10 02:32:54 2017 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
@@ -29,8 +29,8 @@
<b>archive_entry_set_gid</b>, <b>archive_entry_uid</b>,
<b>archive_entry_set_uid</b>, <b>archive_entry_perm</b>,
<b>archive_entry_set_perm</b>, <b>archive_entry_strmode</b>,
-<b>archive_entry_uname archive_entry_uname_w
-archive_entry_set_uname</b>,
+<b>archive_entry_uname</b>, <b>archive_entry_uname_w</b>,
+<b>archive_entry_set_uname</b>,
<b>archive_entry_copy_uname</b>,
<b>archive_entry_copy_uname_w</b>,
<b>archive_entry_update_uname_utf8</b>,
Modified: trunk/contrib/libarchive/doc/html/archive_entry_stat.3.html
===================================================================
--- trunk/contrib/libarchive/doc/html/archive_entry_stat.3.html 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/html/archive_entry_stat.3.html 2018-06-19 20:42:35 UTC (rev 11134)
@@ -1,5 +1,5 @@
<!-- Creator : groff version 1.22.3 -->
-<!-- CreationDate: Sun Jun 19 19:54:06 2016 -->
+<!-- CreationDate: Mon Jul 10 02:32:54 2017 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
Modified: trunk/contrib/libarchive/doc/html/archive_entry_time.3.html
===================================================================
--- trunk/contrib/libarchive/doc/html/archive_entry_time.3.html 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/html/archive_entry_time.3.html 2018-06-19 20:42:35 UTC (rev 11134)
@@ -1,5 +1,5 @@
<!-- Creator : groff version 1.22.3 -->
-<!-- CreationDate: Sun Jun 19 19:54:06 2016 -->
+<!-- CreationDate: Mon Jul 10 02:32:54 2017 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
Modified: trunk/contrib/libarchive/doc/html/archive_read.3.html
===================================================================
--- trunk/contrib/libarchive/doc/html/archive_read.3.html 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/html/archive_read.3.html 2018-06-19 20:42:35 UTC (rev 11134)
@@ -1,5 +1,5 @@
<!-- Creator : groff version 1.22.3 -->
-<!-- CreationDate: Sun Jun 19 19:54:06 2016 -->
+<!-- CreationDate: Mon Jul 10 02:32:54 2017 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
Modified: trunk/contrib/libarchive/doc/html/archive_read_add_passphrase.3.html
===================================================================
--- trunk/contrib/libarchive/doc/html/archive_read_add_passphrase.3.html 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/html/archive_read_add_passphrase.3.html 2018-06-19 20:42:35 UTC (rev 11134)
@@ -1,5 +1,5 @@
<!-- Creator : groff version 1.22.3 -->
-<!-- CreationDate: Sun Jun 19 19:54:06 2016 -->
+<!-- CreationDate: Mon Jul 10 02:32:54 2017 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
Modified: trunk/contrib/libarchive/doc/html/archive_read_data.3.html
===================================================================
--- trunk/contrib/libarchive/doc/html/archive_read_data.3.html 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/html/archive_read_data.3.html 2018-06-19 20:42:35 UTC (rev 11134)
@@ -1,5 +1,5 @@
<!-- Creator : groff version 1.22.3 -->
-<!-- CreationDate: Sun Jun 19 19:54:06 2016 -->
+<!-- CreationDate: Mon Jul 10 02:32:54 2017 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
Modified: trunk/contrib/libarchive/doc/html/archive_read_disk.3.html
===================================================================
--- trunk/contrib/libarchive/doc/html/archive_read_disk.3.html 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/html/archive_read_disk.3.html 2018-06-19 20:42:35 UTC (rev 11134)
@@ -1,5 +1,5 @@
<!-- Creator : groff version 1.22.3 -->
-<!-- CreationDate: Sun Jun 19 19:54:06 2016 -->
+<!-- CreationDate: Mon Jul 10 02:32:54 2017 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
@@ -26,6 +26,7 @@
<p style="margin-top: 1em"><b>NAME</b></p>
<p style="margin-left:6%;"><b>archive_read_disk_new</b>,
+<b>archive_read_disk_set_behavior</b>,
<b>archive_read_disk_set_symlink_logical</b>,
<b>archive_read_disk_set_symlink_physical</b>,
<b>archive_read_disk_set_symlink_hybrid</b>,
@@ -34,10 +35,8 @@
<b>archive_read_disk_uname</b>,
<b>archive_read_disk_set_uname_lookup</b>,
<b>archive_read_disk_set_gname_lookup</b>,
-<b>archive_read_disk_set_standard_lookup</b>,
-<b>archive_read_close</b>, <b>archive_read_finish</b>,
-<b>archive_read_free</b> — functions for reading
-objects from disk</p>
+<b>archive_read_disk_set_standard_lookup</b> —
+functions for reading objects from disk</p>
<p style="margin-top: 1em"><b>LIBRARY</b></p>
@@ -58,6 +57,12 @@
<p style="margin-left:6%; margin-top: 1em"><i>int</i></p>
+<p style="margin-left:12%;"><b>archive_read_disk_set_behavior</b>(<i>struct archive *</i>,
+<i>int</i>);</p>
+
+<p style="margin-left:6%; margin-top: 1em"><i>int</i></p>
+
+
<p style="margin-left:12%;"><b>archive_read_disk_set_symlink_logical</b>(<i>struct archive *</i>);</p>
<p style="margin-left:6%; margin-top: 1em"><i>int</i></p>
@@ -70,13 +75,15 @@
<p style="margin-left:12%;"><b>archive_read_disk_set_symlink_hybrid</b>(<i>struct archive *</i>);</p>
-<p style="margin-left:6%; margin-top: 1em"><i>int</i></p>
+<p style="margin-left:6%; margin-top: 1em"><i>const char
+*</i></p>
<p style="margin-left:12%;"><b>archive_read_disk_gname</b>(<i>struct archive *</i>,
<i>gid_t</i>);</p>
-<p style="margin-left:6%; margin-top: 1em"><i>int</i></p>
+<p style="margin-left:6%; margin-top: 1em"><i>const char
+*</i></p>
<p style="margin-left:12%;"><b>archive_read_disk_uname</b>(<i>struct archive *</i>,
@@ -110,21 +117,6 @@
<i>struct archive_entry *</i>, <i>int fd</i>,
<i>const struct stat *</i>);</p>
-<p style="margin-left:6%; margin-top: 1em"><i>int</i></p>
-
-
-<p style="margin-left:12%;"><b>archive_read_close</b>(<i>struct archive *</i>);</p>
-
-<p style="margin-left:6%; margin-top: 1em"><i>int</i></p>
-
-
-<p style="margin-left:12%;"><b>archive_read_finish</b>(<i>struct archive *</i>);</p>
-
-<p style="margin-left:6%; margin-top: 1em"><i>int</i></p>
-
-
-<p style="margin-left:12%;"><b>archive_read_free</b>(<i>struct archive *</i>);</p>
-
<p style="margin-top: 1em"><b>DESCRIPTION</b></p>
<p style="margin-left:6%;">These functions provide an API
@@ -140,6 +132,57 @@
information from disk.</p>
+<p style="margin-top: 1em"><b>archive_read_disk_set_behavior</b>()</p>
+
+<p style="margin-left:17%;">Configures various behavior
+options when reading entries from disk. The flags field
+consists of a bitwise OR of one or more of the following
+values:</p>
+
+<p><b>ARCHIVE_READDISK_HONOR_NODUMP</b></p>
+
+<p style="margin-left:27%;">Skip files and directories with
+the nodump file attribute (file flag) set. By default, the
+nodump file atrribute is ignored.</p>
+
+<p><b>ARCHIVE_READDISK_MAC_COPYFILE</b></p>
+
+<p style="margin-left:27%;">Mac OS X specific. Read
+metadata (ACLs and extended attributes) with copyfile(3). By
+default, metadata is read using copyfile(3).</p>
+
+<p><b>ARCHIVE_READDISK_NO_ACL</b></p>
+
+<p style="margin-left:27%;">Do not read Access Control
+Lists. By default, ACLs are read from disk.</p>
+
+<p><b>ARCHIVE_READDISK_NO_FFLAGS</b></p>
+
+<p style="margin-left:27%;">Do not read file attributes
+(file flags). By default, file attributes are read from
+disk. See chattr(1) (Linux) or chflags(1) (FreeBSD, Mac OS
+X) for more information on file attributes.</p>
+
+<p><b>ARCHIVE_READDISK_NO_TRAVERSE_MOUNTS</b></p>
+
+<p style="margin-left:27%;">Do not traverse mount points.
+By defaut, moint points are traversed.</p>
+
+<p><b>ARCHIVE_READDISK_NO_XATTR</b></p>
+
+<p style="margin-left:27%;">Do not read extended file
+attributes (xattrs). By default, extended file attributes
+are read from disk. See xattr(7) (Linux), xattr(2) (Mac OS
+X), or getextattr(8) (FreeBSD) for more information on
+extended file attributes.</p>
+
+<p><b>ARCHIVE_READDISK_RESTORE_ATIME</b></p>
+
+<p style="margin-left:27%;">Restore access time of
+traversed files. By default, access time of traversed files
+is not restored.</p>
+
+
<p style="margin-top: 1em"><b>archive_read_disk_set_symlink_logical</b>(),
<b>archive_read_disk_set_symlink_physical</b>(),
<b>archive_read_disk_set_symlink_hybrid</b>()</p>
@@ -214,23 +257,6 @@
above. This affects the file ownership fields and ACL values
in the struct archive_entry object.</p>
-<p style="margin-top: 1em"><b>archive_read_close</b>()</p>
-
-<p style="margin-left:17%;">Does nothing for
-archive_read_disk handles.</p>
-
-
-<p style="margin-top: 1em"><b>archive_read_finish</b>()</p>
-
-<p style="margin-left:17%;">This is a deprecated synonym
-for <b>archive_read_free</b>().</p>
-
-<p style="margin-top: 1em"><b>archive_read_free</b>()</p>
-
-<p style="margin-left:17%;">Invokes
-<b>archive_read_close</b>() if it was not invoked manually,
-then releases all resources.</p>
-
<p style="margin-left:6%;">More information about the
<i>struct archive</i> object and the overall design of the
library can be found in the libarchive(3) overview.</p>
@@ -350,7 +376,7 @@
make sense.</p>
<p style="margin-left:6%; margin-top: 1em">BSD
-February 2, 2012 BSD</p>
+April 3, 2017 BSD</p>
<hr>
</body>
</html>
Modified: trunk/contrib/libarchive/doc/html/archive_read_extract.3.html
===================================================================
--- trunk/contrib/libarchive/doc/html/archive_read_extract.3.html 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/html/archive_read_extract.3.html 2018-06-19 20:42:35 UTC (rev 11134)
@@ -1,5 +1,5 @@
<!-- Creator : groff version 1.22.3 -->
-<!-- CreationDate: Sun Jun 19 19:54:06 2016 -->
+<!-- CreationDate: Mon Jul 10 02:32:55 2017 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
Modified: trunk/contrib/libarchive/doc/html/archive_read_filter.3.html
===================================================================
--- trunk/contrib/libarchive/doc/html/archive_read_filter.3.html 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/html/archive_read_filter.3.html 2018-06-19 20:42:35 UTC (rev 11134)
@@ -1,5 +1,5 @@
<!-- Creator : groff version 1.22.3 -->
-<!-- CreationDate: Sun Jun 19 19:54:07 2016 -->
+<!-- CreationDate: Mon Jul 10 02:32:55 2017 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
Modified: trunk/contrib/libarchive/doc/html/archive_read_format.3.html
===================================================================
--- trunk/contrib/libarchive/doc/html/archive_read_format.3.html 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/html/archive_read_format.3.html 2018-06-19 20:42:35 UTC (rev 11134)
@@ -1,5 +1,5 @@
<!-- Creator : groff version 1.22.3 -->
-<!-- CreationDate: Sun Jun 19 19:54:07 2016 -->
+<!-- CreationDate: Mon Jul 10 02:32:55 2017 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
@@ -35,10 +35,10 @@
<b>archive_read_support_format_empty</b>,
<b>archive_read_support_format_iso9660</b>,
<b>archive_read_support_format_lha</b>,
-<b>archive_read_support_format_mtree,
-archive_read_support_format_rar,
-archive_read_support_format_raw,
-archive_read_support_format_tar</b>,
+<b>archive_read_support_format_mtree</b>,
+<b>archive_read_support_format_rar</b>,
+<b>archive_read_support_format_raw</b>,
+<b>archive_read_support_format_tar</b>,
<b>archive_read_support_format_xar</b>,
<b>archive_read_support_format_zip</b> — functions for
reading streaming archives</p>
Modified: trunk/contrib/libarchive/doc/html/archive_read_free.3.html
===================================================================
--- trunk/contrib/libarchive/doc/html/archive_read_free.3.html 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/html/archive_read_free.3.html 2018-06-19 20:42:35 UTC (rev 11134)
@@ -1,5 +1,5 @@
<!-- Creator : groff version 1.22.3 -->
-<!-- CreationDate: Sun Jun 19 19:54:07 2016 -->
+<!-- CreationDate: Mon Jul 10 02:32:55 2017 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
Modified: trunk/contrib/libarchive/doc/html/archive_read_header.3.html
===================================================================
--- trunk/contrib/libarchive/doc/html/archive_read_header.3.html 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/html/archive_read_header.3.html 2018-06-19 20:42:35 UTC (rev 11134)
@@ -1,5 +1,5 @@
<!-- Creator : groff version 1.22.3 -->
-<!-- CreationDate: Sun Jun 19 19:54:07 2016 -->
+<!-- CreationDate: Mon Jul 10 02:32:55 2017 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
Modified: trunk/contrib/libarchive/doc/html/archive_read_new.3.html
===================================================================
--- trunk/contrib/libarchive/doc/html/archive_read_new.3.html 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/html/archive_read_new.3.html 2018-06-19 20:42:35 UTC (rev 11134)
@@ -1,5 +1,5 @@
<!-- Creator : groff version 1.22.3 -->
-<!-- CreationDate: Sun Jun 19 19:54:07 2016 -->
+<!-- CreationDate: Mon Jul 10 02:32:55 2017 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
Modified: trunk/contrib/libarchive/doc/html/archive_read_open.3.html
===================================================================
--- trunk/contrib/libarchive/doc/html/archive_read_open.3.html 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/html/archive_read_open.3.html 2018-06-19 20:42:35 UTC (rev 11134)
@@ -1,5 +1,5 @@
<!-- Creator : groff version 1.22.3 -->
-<!-- CreationDate: Sun Jun 19 19:54:07 2016 -->
+<!-- CreationDate: Mon Jul 10 02:32:55 2017 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
@@ -29,7 +29,7 @@
<b>archive_read_open2</b>, <b>archive_read_open_fd</b>,
<b>archive_read_open_FILE</b>,
<b>archive_read_open_filename</b>,
-<b>archive_read_open_memory</b>, — functions for
+<b>archive_read_open_memory</b> — functions for
reading streaming archives</p>
<p style="margin-top: 1em"><b>LIBRARY</b></p>
@@ -84,7 +84,8 @@
<p style="margin-left:12%;"><b>archive_read_open_memory</b>(<i>struct archive *</i>,
-<i>void *buff</i>, <i>size_t size</i>);</p>
+<i>const void *buff</i>,
+<i>size_t size</i>);</p>
<p style="margin-top: 1em"><b>DESCRIPTION <br>
archive_read_open</b>()</p>
Modified: trunk/contrib/libarchive/doc/html/archive_read_set_options.3.html
===================================================================
--- trunk/contrib/libarchive/doc/html/archive_read_set_options.3.html 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/html/archive_read_set_options.3.html 2018-06-19 20:42:35 UTC (rev 11134)
@@ -1,5 +1,5 @@
<!-- Creator : groff version 1.22.3 -->
-<!-- CreationDate: Sun Jun 19 19:54:07 2016 -->
+<!-- CreationDate: Mon Jul 10 02:32:55 2017 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
Modified: trunk/contrib/libarchive/doc/html/archive_util.3.html
===================================================================
--- trunk/contrib/libarchive/doc/html/archive_util.3.html 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/html/archive_util.3.html 2018-06-19 20:42:35 UTC (rev 11134)
@@ -1,5 +1,5 @@
<!-- Creator : groff version 1.22.3 -->
-<!-- CreationDate: Sun Jun 19 19:54:07 2016 -->
+<!-- CreationDate: Mon Jul 10 02:32:55 2017 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
Modified: trunk/contrib/libarchive/doc/html/archive_write.3.html
===================================================================
--- trunk/contrib/libarchive/doc/html/archive_write.3.html 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/html/archive_write.3.html 2018-06-19 20:42:35 UTC (rev 11134)
@@ -1,5 +1,5 @@
<!-- Creator : groff version 1.22.3 -->
-<!-- CreationDate: Sun Jun 19 19:54:07 2016 -->
+<!-- CreationDate: Mon Jul 10 02:32:56 2017 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
Modified: trunk/contrib/libarchive/doc/html/archive_write_blocksize.3.html
===================================================================
--- trunk/contrib/libarchive/doc/html/archive_write_blocksize.3.html 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/html/archive_write_blocksize.3.html 2018-06-19 20:42:35 UTC (rev 11134)
@@ -1,5 +1,5 @@
<!-- Creator : groff version 1.22.3 -->
-<!-- CreationDate: Sun Jun 19 19:54:07 2016 -->
+<!-- CreationDate: Mon Jul 10 02:32:56 2017 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
Modified: trunk/contrib/libarchive/doc/html/archive_write_data.3.html
===================================================================
--- trunk/contrib/libarchive/doc/html/archive_write_data.3.html 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/html/archive_write_data.3.html 2018-06-19 20:42:35 UTC (rev 11134)
@@ -1,5 +1,5 @@
<!-- Creator : groff version 1.22.3 -->
-<!-- CreationDate: Sun Jun 19 19:54:07 2016 -->
+<!-- CreationDate: Mon Jul 10 02:32:56 2017 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
@@ -25,8 +25,9 @@
<p style="margin-top: 1em"><b>NAME</b></p>
-<p style="margin-left:6%;"><b>archive_write_data</b>
-— functions for creating archives</p>
+<p style="margin-left:6%;"><b>archive_write_data</b>,
+<b>archive_write_data_block</b> — functions for
+creating archives</p>
<p style="margin-top: 1em"><b>LIBRARY</b></p>
@@ -45,11 +46,33 @@
<p style="margin-left:12%;"><b>archive_write_data</b>(<i>struct archive *</i>,
<i>const void *</i>, <i>size_t</i>);</p>
-<p style="margin-top: 1em"><b>DESCRIPTION</b></p>
-<p style="margin-left:6%;">Write data corresponding to the
+<p style="margin-left:6%; margin-top: 1em"><i>la_ssize_t</i></p>
+
+
+<p style="margin-left:12%;"><b>archive_write_data_block</b>(<i>struct archive *</i>,
+<i>const void *</i>, <i>size_t size</i>,
+<i>int64_t offset</i>);</p>
+
+<p style="margin-top: 1em"><b>DESCRIPTION <br>
+archive_write_data</b>()</p>
+
+<p style="margin-left:17%;">Write data corresponding to the
header just written.</p>
+
+<p style="margin-top: 1em"><b>archive_write_data_block</b>()</p>
+
+<p style="margin-left:17%;">Write data corresponding to the
+header just written. This is like
+<b>archive_write_data</b>() except that it performs a seek
+on the file being written to the specified offset before
+writing the data. This is useful when restoring sparse files
+from archive formats that support sparse files. Returns
+number of bytes written or -1 on error. (Note: This is
+currently not supported for archive_write handles, only for
+archive_write_disk handles.</p>
+
<p style="margin-top: 1em"><b>RETURN VALUES</b></p>
<p style="margin-left:6%;">This function returns the number
@@ -78,7 +101,7 @@
cpio(5), mtree(5), tar(5)</p>
<p style="margin-left:6%; margin-top: 1em">BSD
-February 2, 2012 BSD</p>
+February 28, 2017 BSD</p>
<hr>
</body>
</html>
Modified: trunk/contrib/libarchive/doc/html/archive_write_disk.3.html
===================================================================
--- trunk/contrib/libarchive/doc/html/archive_write_disk.3.html 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/html/archive_write_disk.3.html 2018-06-19 20:42:35 UTC (rev 11134)
@@ -1,5 +1,5 @@
<!-- Creator : groff version 1.22.3 -->
-<!-- CreationDate: Sun Jun 19 19:54:08 2016 -->
+<!-- CreationDate: Mon Jul 10 02:32:56 2017 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
@@ -30,13 +30,8 @@
<b>archive_write_disk_set_skip_file</b>,
<b>archive_write_disk_set_group_lookup</b>,
<b>archive_write_disk_set_standard_lookup</b>,
-<b>archive_write_disk_set_user_lookup</b>,
-<b>archive_write_header</b>, <b>archive_write_data</b>,
-<b>archive_write_data_block</b>,
-<b>archive_write_finish_entry</b>,
-<b>archive_write_close</b>, <b>archive_write_finish
-archive_write_free</b> — functions for creating
-objects on disk</p>
+<b>archive_write_disk_set_user_lookup</b> — functions
+for creating objects on disk</p>
<p style="margin-top: 1em"><b>LIBRARY</b></p>
@@ -87,47 +82,6 @@
<i>uid_t (*)(void *, const char *uname, uid_t uid)</i>,
<i>void (*cleanup)(void *)</i>);</p>
-<p style="margin-left:6%; margin-top: 1em"><i>int</i></p>
-
-
-<p style="margin-left:12%;"><b>archive_write_header</b>(<i>struct archive *</i>,
-<i>struct archive_entry *</i>);</p>
-
-
-<p style="margin-left:6%; margin-top: 1em"><i>la_ssize_t</i></p>
-
-
-<p style="margin-left:12%;"><b>archive_write_data</b>(<i>struct archive *</i>,
-<i>const void *</i>, <i>size_t</i>);</p>
-
-
-<p style="margin-left:6%; margin-top: 1em"><i>la_ssize_t</i></p>
-
-
-<p style="margin-left:12%;"><b>archive_write_data_block</b>(<i>struct archive *</i>,
-<i>const void *</i>, <i>size_t size</i>,
-<i>int64_t offset</i>);</p>
-
-<p style="margin-left:6%; margin-top: 1em"><i>int</i></p>
-
-
-<p style="margin-left:12%;"><b>archive_write_finish_entry</b>(<i>struct archive *</i>);</p>
-
-<p style="margin-left:6%; margin-top: 1em"><i>int</i></p>
-
-
-<p style="margin-left:12%;"><b>archive_write_close</b>(<i>struct archive *</i>);</p>
-
-<p style="margin-left:6%; margin-top: 1em"><i>int</i></p>
-
-
-<p style="margin-left:12%;"><b>archive_write_finish</b>(<i>struct archive *</i>);</p>
-
-<p style="margin-left:6%; margin-top: 1em"><i>int</i></p>
-
-
-<p style="margin-left:12%;"><b>archive_write_free</b>(<i>struct archive *</i>);</p>
-
<p style="margin-top: 1em"><b>DESCRIPTION</b></p>
<p style="margin-left:6%;">These functions provide a
@@ -165,6 +119,38 @@
<p style="margin-left:17%;">The options field consists of a
bitwise OR of one or more of the following values:</p>
+<p><b>ARCHIVE_EXTRACT_ACL</b></p>
+
+<p style="margin-left:27%;">Attempt to restore Access
+Control Lists. By default, extended ACLs are ignored.</p>
+
+<p><b>ARCHIVE_EXTRACT_CLEAR_NOCHANGE_FFLAGS</b></p>
+
+<p style="margin-left:27%;">Before removing a file system
+object prior to replacing it, clear platform-specific file
+flags which might prevent its removal.</p>
+
+<p><b>ARCHIVE_EXTRACT_FFLAGS</b></p>
+
+<p style="margin-left:27%;">Attempt to restore file
+attributes (file flags). By default, file attributes are
+ignored. See chattr(1) (Linux) or chflags(1) (FreeBSD, Mac
+OS X) for more information on file attributes.</p>
+
+<p><b>ARCHIVE_EXTRACT_MAC_METADATA</b></p>
+
+<p style="margin-left:27%;">Mac OS X specific. Restore
+metadata using copyfile(3). By default, copyfile(3) metadata
+is ignored.</p>
+
+<p><b>ARCHIVE_EXTRACT_NO_OVERWRITE</b></p>
+
+<p style="margin-left:27%;">Existing files on disk will not
+be overwritten. By default, existing regular files are
+truncated and overwritten; existing directories will have
+their permissions updated; other pre-existing objects are
+unlinked and recreated from scratch.</p>
+
<p><b>ARCHIVE_EXTRACT_OWNER</b></p>
<p style="margin-left:27%;">The user and group IDs should
@@ -184,44 +170,19 @@
those specified in the archive entry. By default, only basic
permissions are restored, and umask is obeyed.</p>
-<p><b>ARCHIVE_EXTRACT_TIME</b></p>
+<p><b>ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS</b></p>
-<p style="margin-left:27%;">The timestamps (mtime, ctime,
-and atime) should be restored. By default, they are ignored.
-Note that restoring of atime is not currently supported.</p>
+<p style="margin-left:27%;">Refuse to extract an absolute
+path. The default is to not refuse such paths.</p>
-<p><b>ARCHIVE_EXTRACT_NO_OVERWRITE</b></p>
+<p><b>ARCHIVE_EXTRACT_SECURE_NODOTDOT</b></p>
-<p style="margin-left:27%;">Existing files on disk will not
-be overwritten. By default, existing regular files are
-truncated and overwritten; existing directories will have
-their permissions updated; other pre-existing objects are
-unlinked and recreated from scratch.</p>
+<p style="margin-left:27%;">Refuse to extract a path that
+contains a <i>..</i> element anywhere within it. The default
+is to not refuse such paths. Note that paths ending in
+<i>..</i> always cause an error, regardless of this
+flag.</p>
-<p><b>ARCHIVE_EXTRACT_UNLINK</b></p>
-
-<p style="margin-left:27%;">Existing files on disk will be
-unlinked before any attempt to create them. In some cases,
-this can prove to be a significant performance improvement.
-By default, existing files are truncated and rewritten, but
-the file is not recreated. In particular, the default
-behavior does not break existing hard links.</p>
-
-<p><b>ARCHIVE_EXTRACT_ACL</b></p>
-
-<p style="margin-left:27%;">Attempt to restore ACLs. By
-default, extended ACLs are ignored.</p>
-
-<p><b>ARCHIVE_EXTRACT_FFLAGS</b></p>
-
-<p style="margin-left:27%;">Attempt to restore extended
-file flags. By default, file flags are ignored.</p>
-
-<p><b>ARCHIVE_EXTRACT_XATTR</b></p>
-
-<p style="margin-left:27%;">Attempt to restore POSIX.1e
-extended attributes. By default, they are ignored.</p>
-
<p><b>ARCHIVE_EXTRACT_SECURE_SYMLINKS</b></p>
<p style="margin-left:27%;">Refuse to extract any object
@@ -229,38 +190,41 @@
This is intended to help guard against a variety of mischief
caused by archives that (deliberately or otherwise) extract
files outside of the current directory. The default is not
-to perform this check. If <b>ARCHIVE_EXTRACT_UNLINK</b> is
+to perform this check. If</p>
+
+<p><b>ARCHIVE_EXTRACT_SPARSE</b></p>
+
+<p style="margin-left:27%;">Scan data for blocks of NUL
+bytes and try to recreate them with holes. This results in
+sparse files, independent of whether the archive format
+supports or uses them. <b>ARCHIVE_EXTRACT_UNLINK</b> is
specified together with this option, the library will remove
any intermediate symlinks it finds and return an error only
if such symlink could not be removed.</p>
-<p><b>ARCHIVE_EXTRACT_SECURE_NODOTDOT</b></p>
+<p><b>ARCHIVE_EXTRACT_TIME</b></p>
-<p style="margin-left:27%;">Refuse to extract a path that
-contains a <i>..</i> element anywhere within it. The default
-is to not refuse such paths. Note that paths ending in
-<i>..</i> always cause an error, regardless of this
-flag.</p>
+<p style="margin-left:27%;">The timestamps (mtime, ctime,
+and atime) should be restored. By default, they are ignored.
+Note that restoring of atime is not currently supported.</p>
-<p><b>ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS</b></p>
+<p><b>ARCHIVE_EXTRACT_UNLINK</b></p>
-<p style="margin-left:27%;">Refuse to extract an absolute
-path. The default is to not refuse such paths.</p>
+<p style="margin-left:27%;">Existing files on disk will be
+unlinked before any attempt to create them. In some cases,
+this can prove to be a significant performance improvement.
+By default, existing files are truncated and rewritten, but
+the file is not recreated. In particular, the default
+behavior does not break existing hard links.</p>
-<p><b>ARCHIVE_EXTRACT_SPARSE</b></p>
+<p><b>ARCHIVE_EXTRACT_XATTR</b></p>
-<p style="margin-left:27%;">Scan data for blocks of NUL
-bytes and try to recreate them with holes. This results in
-sparse files, independent of whether the archive format
-supports or uses them.</p>
+<p style="margin-left:27%;">Attempt to restore extended
+file attributes. By default, they are ignored. See xattr(7)
+(Linux), xattr(2) (Mac OS X), or getextattr(8) (FreeBSD) for
+more information on extended file attributes.</p>
-<p><b>ARCHIVE_EXTRACT_CLEAR_NOCHANGE_FFLAGS</b></p>
-<p style="margin-left:27%;">Before removing a file system
-object prior to replacing it, clear platform-specific file
-flags which might prevent its removal.</p>
-
-
<p style="margin-top: 1em"><b>archive_write_disk_set_group_lookup</b>(),
<b>archive_write_disk_set_user_lookup</b>()</p>
@@ -288,70 +252,6 @@
cache to reduce the number of calls to getpwnam(3) and
getgrnam(3).</p>
-
-<p style="margin-top: 1em"><b>archive_write_header</b>()</p>
-
-<p style="margin-left:17%;">Build and write a header using
-the data in the provided struct archive_entry structure. See
-archive_entry(3) for information on creating and populating
-struct archive_entry objects.</p>
-
-<p style="margin-top: 1em"><b>archive_write_data</b>()</p>
-
-<p style="margin-left:17%;">Write data corresponding to the
-header just written. Returns number of bytes written or -1
-on error.</p>
-
-
-<p style="margin-top: 1em"><b>archive_write_data_block</b>()</p>
-
-<p style="margin-left:17%;">Write data corresponding to the
-header just written. This is like
-<b>archive_write_data</b>() except that it performs a seek
-on the file being written to the specified offset before
-writing the data. This is useful when restoring sparse files
-from archive formats that support sparse files. Returns
-number of bytes written or -1 on error. (Note: This is
-currently not supported for archive_write handles, only for
-archive_write_disk handles.)</p>
-
-
-<p style="margin-top: 1em"><b>archive_write_finish_entry</b>()</p>
-
-<p style="margin-left:17%;">Close out the entry just
-written. Ordinarily, clients never need to call this, as it
-is called automatically by
-<b>archive_write_next_header</b>() and
-<b>archive_write_close</b>() as needed. However, some file
-attributes are written to disk only after the file is
-closed, so this can be necessary if you need to work with
-the file on disk right away.</p>
-
-
-<p style="margin-top: 1em"><b>archive_write_close</b>()</p>
-
-<p style="margin-left:17%;">Set any attributes that could
-not be set during the initial restore. For example,
-directory timestamps are not restored initially because
-restoring a subsequent file would alter that timestamp.
-Similarly, non-writable directories are initially created
-with write permissions (so that their contents can be
-restored). The <b>archive_write_disk_new</b> library
-maintains a list of all such deferred attributes and sets
-them when this function is invoked.</p>
-
-
-<p style="margin-top: 1em"><b>archive_write_finish</b>()</p>
-
-<p style="margin-left:17%;">This is a deprecated synonym
-for <b>archive_write_free</b>().</p>
-
-<p style="margin-top: 1em"><b>archive_write_free</b>()</p>
-
-<p style="margin-left:17%;">Invokes
-<b>archive_write_close</b>() if it was not invoked manually,
-then releases all resources.</p>
-
<p style="margin-left:6%;">More information about the
<i>struct archive</i> object and the overall design of the
library can be found in the libarchive(3) overview. Many of
@@ -463,7 +363,7 @@
objects.</p>
<p style="margin-left:6%; margin-top: 1em">BSD
-February 2, 2012 BSD</p>
+April 3, 2017 BSD</p>
<hr>
</body>
</html>
Modified: trunk/contrib/libarchive/doc/html/archive_write_filter.3.html
===================================================================
--- trunk/contrib/libarchive/doc/html/archive_write_filter.3.html 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/html/archive_write_filter.3.html 2018-06-19 20:42:35 UTC (rev 11134)
@@ -1,5 +1,5 @@
<!-- Creator : groff version 1.22.3 -->
-<!-- CreationDate: Sun Jun 19 19:54:08 2016 -->
+<!-- CreationDate: Mon Jul 10 02:32:56 2017 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
Modified: trunk/contrib/libarchive/doc/html/archive_write_finish_entry.3.html
===================================================================
--- trunk/contrib/libarchive/doc/html/archive_write_finish_entry.3.html 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/html/archive_write_finish_entry.3.html 2018-06-19 20:42:35 UTC (rev 11134)
@@ -1,5 +1,5 @@
<!-- Creator : groff version 1.22.3 -->
-<!-- CreationDate: Sun Jun 19 19:54:08 2016 -->
+<!-- CreationDate: Mon Jul 10 02:32:56 2017 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
@@ -51,7 +51,9 @@
required by some formats. Ordinarily, clients never need to
call this, as it is called automatically by
<b>archive_write_header</b>() and
-<b>archive_write_close</b>() as needed.</p>
+<b>archive_write_close</b>() as needed. For
+archive_write_disk handles, this flushes pending file
+attribute changes like modification time.</p>
<p style="margin-top: 1em"><b>RETURN VALUES</b></p>
@@ -77,7 +79,7 @@
cpio(5), mtree(5), tar(5)</p>
<p style="margin-left:6%; margin-top: 1em">BSD
-February 2, 2012 BSD</p>
+February 28, 2017 BSD</p>
<hr>
</body>
</html>
Modified: trunk/contrib/libarchive/doc/html/archive_write_format.3.html
===================================================================
--- trunk/contrib/libarchive/doc/html/archive_write_format.3.html 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/html/archive_write_format.3.html 2018-06-19 20:42:35 UTC (rev 11134)
@@ -1,5 +1,5 @@
<!-- Creator : groff version 1.22.3 -->
-<!-- CreationDate: Sun Jun 19 19:54:08 2016 -->
+<!-- CreationDate: Mon Jul 10 02:32:56 2017 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
Modified: trunk/contrib/libarchive/doc/html/archive_write_free.3.html
===================================================================
--- trunk/contrib/libarchive/doc/html/archive_write_free.3.html 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/html/archive_write_free.3.html 2018-06-19 20:42:35 UTC (rev 11134)
@@ -1,5 +1,5 @@
<!-- Creator : groff version 1.22.3 -->
-<!-- CreationDate: Sun Jun 19 19:54:08 2016 -->
+<!-- CreationDate: Mon Jul 10 02:32:56 2017 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
Modified: trunk/contrib/libarchive/doc/html/archive_write_header.3.html
===================================================================
--- trunk/contrib/libarchive/doc/html/archive_write_header.3.html 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/html/archive_write_header.3.html 2018-06-19 20:42:35 UTC (rev 11134)
@@ -1,5 +1,5 @@
<!-- Creator : groff version 1.22.3 -->
-<!-- CreationDate: Sun Jun 19 19:54:08 2016 -->
+<!-- CreationDate: Mon Jul 10 02:32:56 2017 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
Modified: trunk/contrib/libarchive/doc/html/archive_write_new.3.html
===================================================================
--- trunk/contrib/libarchive/doc/html/archive_write_new.3.html 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/html/archive_write_new.3.html 2018-06-19 20:42:35 UTC (rev 11134)
@@ -1,5 +1,5 @@
<!-- Creator : groff version 1.22.3 -->
-<!-- CreationDate: Sun Jun 19 19:54:08 2016 -->
+<!-- CreationDate: Mon Jul 10 02:32:56 2017 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
Modified: trunk/contrib/libarchive/doc/html/archive_write_open.3.html
===================================================================
--- trunk/contrib/libarchive/doc/html/archive_write_open.3.html 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/html/archive_write_open.3.html 2018-06-19 20:42:35 UTC (rev 11134)
@@ -1,5 +1,5 @@
<!-- Creator : groff version 1.22.3 -->
-<!-- CreationDate: Sun Jun 19 19:54:08 2016 -->
+<!-- CreationDate: Mon Jul 10 02:32:56 2017 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
@@ -83,7 +83,8 @@
archive, and prepare for writing entries. This is the most
generic form of this function, which accepts pointers to
three callback functions which will be invoked by the
-compression layer to write the constructed archive.</p>
+compression layer to write the constructed archive. This
+does not alter the default archive padding.</p>
<p style="margin-top: 1em"><b>archive_write_open_fd</b>()</p>
@@ -138,12 +139,19 @@
updated after each write to reflect how much of the buffer
is currently in use. You should be careful to ensure that
this variable remains allocated until after the archive is
-closed.</p>
+closed. This function will disable padding unless you have
+specifically set the block size.</p>
<p style="margin-left:6%;">More information about the
<i>struct archive</i> object and the overall design of the
library can be found in the libarchive(3) overview.</p>
+<p style="margin-left:6%; margin-top: 1em">Note that the
+convenience forms above vary in how they block the output.
+See archive_write_blocksize(3) if you need to control the
+block size used for writes or the end-of-file padding
+behavior.</p>
+
<p style="margin-top: 1em"><b>CLIENT CALLBACKS</b></p>
<p style="margin-left:6%;">To use this library, you will
@@ -220,9 +228,10 @@
<p style="margin-top: 1em"><b>SEE ALSO</b></p>
<p style="margin-left:6%;">tar(1), libarchive(3),
-archive_write(3), archive_write_filter(3),
-archive_write_format(3), archive_write_new(3),
-archive_write_set_options(3), cpio(5), mtree(5), tar(5)</p>
+archive_write(3), archive_write_blocksize(3),
+archive_write_filter(3), archive_write_format(3),
+archive_write_new(3), archive_write_set_options(3), cpio(5),
+mtree(5), tar(5)</p>
<p style="margin-left:6%; margin-top: 1em">BSD
February 2, 2012 BSD</p>
Modified: trunk/contrib/libarchive/doc/html/archive_write_set_options.3.html
===================================================================
--- trunk/contrib/libarchive/doc/html/archive_write_set_options.3.html 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/html/archive_write_set_options.3.html 2018-06-19 20:42:35 UTC (rev 11134)
@@ -1,5 +1,5 @@
<!-- Creator : groff version 1.22.3 -->
-<!-- CreationDate: Sun Jun 19 19:54:08 2016 -->
+<!-- CreationDate: Mon Jul 10 02:32:57 2017 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
Modified: trunk/contrib/libarchive/doc/html/archive_write_set_passphrase.3.html
===================================================================
--- trunk/contrib/libarchive/doc/html/archive_write_set_passphrase.3.html 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/html/archive_write_set_passphrase.3.html 2018-06-19 20:42:35 UTC (rev 11134)
@@ -1,5 +1,5 @@
<!-- Creator : groff version 1.22.3 -->
-<!-- CreationDate: Sun Jun 19 19:54:08 2016 -->
+<!-- CreationDate: Mon Jul 10 02:32:57 2017 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
Modified: trunk/contrib/libarchive/doc/html/bsdcpio.1.html
===================================================================
--- trunk/contrib/libarchive/doc/html/bsdcpio.1.html 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/html/bsdcpio.1.html 2018-06-19 20:42:35 UTC (rev 11134)
@@ -1,5 +1,5 @@
<!-- Creator : groff version 1.22.3 -->
-<!-- CreationDate: Sun Jun 19 19:54:10 2016 -->
+<!-- CreationDate: Mon Jul 10 02:32:58 2017 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
@@ -29,12 +29,11 @@
<p style="margin-top: 1em"><b>SYNOPSIS</b></p>
-<p style="margin-left:13%;"><b>cpio −i</b>
-[<i>options</i>] [<i>pattern ...</i>]
-[<i>< archive</i>] <b><br>
-cpio −o</b> [<i>options</i>] <i>< name-list</i>
+<p style="margin-left:13%;"><b>cpio -i</b> [<i>options</i>]
+[<i>pattern ...</i>] [<i>< archive</i>] <b><br>
+cpio -o</b> [<i>options</i>] <i>< name-list</i>
[<i>> archive</i>] <b><br>
-cpio −p</b> [<i>options</i>] <i>dest-dir <
+cpio -p</b> [<i>options</i>] <i>dest-dir <
name-list</i></p>
<p style="margin-top: 1em"><b>DESCRIPTION</b></p>
@@ -48,16 +47,16 @@
to <b>cpio</b> is a mode indicator from the following
list:</p>
-<p><b>−i</b></p>
+<p><b>-i</b></p>
<p style="margin-left:17%; margin-top: 1em">Input. Read an
archive from standard input (unless overridden) and extract
-the contents to disk or (if the <b>−t</b> option is
+the contents to disk or (if the <b>-t</b> option is
specified) list the contents to standard output. If one or
more file patterns are specified, only files matching one of
the patterns will be extracted.</p>
-<p><b>−o</b></p>
+<p><b>-o</b></p>
<p style="margin-left:17%; margin-top: 1em">Output. Read a
list of filenames from standard input and produce a new
@@ -64,7 +63,7 @@
archive on standard output (unless overridden) containing
the specified items.</p>
-<p><b>−p</b></p>
+<p><b>-p</b></p>
<p style="margin-left:17%; margin-top: 1em">Pass-through.
Read a list of filenames from standard input and copy the
@@ -76,64 +75,62 @@
otherwise, options are applicable in all operating
modes.</p>
-<p style="margin-top: 1em"><b>−0</b>,
-<b>−−null</b></p>
+<p style="margin-top: 1em"><b>-0</b>, <b>--null</b></p>
<p style="margin-left:17%;">Read filenames separated by NUL
characters instead of newlines. This is necessary if any of
the filenames being read might contain newlines.</p>
-<p style="margin-top: 1em"><b>−A</b></p>
+<p style="margin-top: 1em"><b>-A</b></p>
<p style="margin-left:17%; margin-top: 1em">(o mode only)
Append to the specified archive. (Not yet implemented.)</p>
-<p style="margin-top: 1em"><b>−a</b></p>
+<p style="margin-top: 1em"><b>-a</b></p>
<p style="margin-left:17%; margin-top: 1em">(o and p modes)
Reset access times on files after they are read.</p>
-<p style="margin-top: 1em"><b>−B</b></p>
+<p style="margin-top: 1em"><b>-B</b></p>
<p style="margin-left:17%; margin-top: 1em">(o mode only)
Block output to records of 5120 bytes.</p>
-<p style="margin-top: 1em"><b>−C</b> <i>size</i></p>
+<p style="margin-top: 1em"><b>-C</b> <i>size</i></p>
<p style="margin-left:17%;">(o mode only) Block output to
records of <i>size</i> bytes.</p>
-<p style="margin-top: 1em"><b>−c</b></p>
+<p style="margin-top: 1em"><b>-c</b></p>
<p style="margin-left:17%; margin-top: 1em">(o mode only)
Use the old POSIX portable character format. Equivalent to
-<b>−−format</b> <i>odc</i>.</p>
+<b>--format</b> <i>odc</i>.</p>
-<p style="margin-top: 1em"><b>−d</b>,
-<b>−−make-directories</b></p>
+<p style="margin-top: 1em"><b>-d</b>,
+<b>--make-directories</b></p>
<p style="margin-left:17%;">(i and p modes) Create
directories as necessary.</p>
-<p style="margin-top: 1em"><b>−E</b> <i>file</i></p>
+<p style="margin-top: 1em"><b>-E</b> <i>file</i></p>
<p style="margin-left:17%;">(i mode only) Read list of file
name patterns from <i>file</i> to list and extract.</p>
-<p style="margin-top: 1em"><b>−F</b> <i>file</i>,
-<b>−−file</b> <i>file</i></p>
+<p style="margin-top: 1em"><b>-F</b> <i>file</i>,
+<b>--file</b> <i>file</i></p>
<p style="margin-left:17%;">Read archive from or write
archive to <i>file</i>.</p>
-<p style="margin-top: 1em"><b>−f</b>
-<i>pattern</i></p>
+<p style="margin-top: 1em"><b>-f</b> <i>pattern</i></p>
<p style="margin-left:17%;">(i mode only) Ignore files that
match <i>pattern</i>.</p>
-<p style="margin-top: 1em"><b>−H</b> <i>format</i>,
-<b>−−format</b> <i>format</i></p>
+<p style="margin-top: 1em"><b>-H</b> <i>format</i>,
+<b>--format</b> <i>format</i></p>
<p style="margin-left:17%;">(o mode only) Produce the
output archive in the specified format. Supported formats
@@ -169,32 +166,28 @@
complete information about the formats currently supported
by the underlying libarchive(3) library.</p>
-<p style="margin-top: 1em"><b>−h</b>,
-<b>−−help</b></p>
+<p style="margin-top: 1em"><b>-h</b>, <b>--help</b></p>
<p style="margin-left:17%;">Print usage information.</p>
-<p style="margin-top: 1em"><b>−I</b> <i>file</i></p>
+<p style="margin-top: 1em"><b>-I</b> <i>file</i></p>
<p style="margin-left:17%;">Read archive from
<i>file</i>.</p>
-<p style="margin-top: 1em"><b>−i</b>,
-<b>−−extract</b></p>
+<p style="margin-top: 1em"><b>-i</b>, <b>--extract</b></p>
<p style="margin-left:17%;">Input mode. See above for
description.</p>
+<p style="margin-top: 1em"><b>--insecure</b></p>
-<p style="margin-top: 1em"><b>−−insecure</b></p>
-
<p style="margin-left:17%;">(i and p mode only) Disable
security checks during extraction or copying. This allows
extraction via symbolic links, absolute paths, and path
names containing ’..’ in the name.</p>
-<p style="margin-top: 1em"><b>−J</b>,
-<b>−−xz</b></p>
+<p style="margin-top: 1em"><b>-J</b>, <b>--xz</b></p>
<p style="margin-left:17%;">(o mode only) Compress the file
with xz-compatible compression before writing it. In input
@@ -201,12 +194,12 @@
mode, this option is ignored; xz compression is recognized
automatically on input.</p>
-<p style="margin-top: 1em"><b>−j</b></p>
+<p style="margin-top: 1em"><b>-j</b></p>
<p style="margin-left:17%; margin-top: 1em">Synonym for
-<b>−y</b>.</p>
+<b>-y</b>.</p>
-<p style="margin-top: 1em"><b>−L</b></p>
+<p style="margin-top: 1em"><b>-L</b></p>
<p style="margin-left:17%; margin-top: 1em">(o and p modes)
All symbolic links will be followed. Normally, symbolic
@@ -214,20 +207,19 @@
option, the target of the link will be archived or copied
instead.</p>
-<p style="margin-top: 1em"><b>−l</b>,
-<b>−−link</b></p>
+<p style="margin-top: 1em"><b>-l</b>, <b>--link</b></p>
<p style="margin-left:17%;">(p mode only) Create links from
the target directory to the original files, instead of
copying.</p>
-<p style="margin-top: 1em"><b>−−lrzip</b></p>
+<p style="margin-top: 1em"><b>--lrzip</b></p>
<p style="margin-left:17%;">(o mode only) Compress the
resulting archive with lrzip(1). In input mode, this option
is ignored.</p>
-<p style="margin-top: 1em"><b>−−lz4</b></p>
+<p style="margin-top: 1em"><b>--lz4</b></p>
<p style="margin-left:17%; margin-top: 1em">(o mode only)
Compress the archive with lz4-compatible compression before
@@ -234,7 +226,7 @@
writing it. In input mode, this option is ignored; lz4
compression is recognized automatically on input.</p>
-<p style="margin-top: 1em"><b>−−lzma</b></p>
+<p style="margin-top: 1em"><b>--lzma</b></p>
<p style="margin-left:17%; margin-top: 1em">(o mode only)
Compress the file with lzma-compatible compression before
@@ -241,13 +233,13 @@
writing it. In input mode, this option is ignored; lzma
compression is recognized automatically on input.</p>
-<p style="margin-top: 1em"><b>−−lzop</b></p>
+<p style="margin-top: 1em"><b>--lzop</b></p>
<p style="margin-left:17%; margin-top: 1em">(o mode only)
Compress the resulting archive with lzop(1). In input mode,
this option is ignored.</p>
-<p style="margin-top: 1em"><b>−−passphrase</b>
+<p style="margin-top: 1em"><b>--passphrase</b>
<i>passphrase</i></p>
<p style="margin-left:17%;">The <i>passphrase</i> is used
@@ -256,62 +248,59 @@
archives. You shouldn’t use this option unless you
realize how insecure use of this option is.</p>
-<p style="margin-top: 1em"><b>−m</b>,
-<b>−−preserve-modification-time</b></p>
+<p style="margin-top: 1em"><b>-m</b>,
+<b>--preserve-modification-time</b></p>
<p style="margin-left:17%;">(i and p modes) Set file
modification time on created files to match those in the
source.</p>
-<p style="margin-top: 1em"><b>−n</b>,
-<b>−−numeric-uid-gid</b></p>
+<p style="margin-top: 1em"><b>-n</b>,
+<b>--numeric-uid-gid</b></p>
-<p style="margin-left:17%;">(i mode, only with
-<b>−t</b>) Display numeric uid and gid. By default,
-<b>cpio</b> displays the user and group names when they are
-provided in the archive, or looks up the user and group
-names in the system password database.</p>
+<p style="margin-left:17%;">(i mode, only with <b>-t</b>)
+Display numeric uid and gid. By default, <b>cpio</b>
+displays the user and group names when they are provided in
+the archive, or looks up the user and group names in the
+system password database.</p>
+<p style="margin-top: 1em"><b>--no-preserve-owner</b></p>
-<p style="margin-top: 1em"><b>−−no-preserve-owner</b></p>
-
<p style="margin-left:17%;">(i mode only) Do not attempt to
restore file ownership. This is the default when run by
non-root users.</p>
-<p style="margin-top: 1em"><b>−O</b> <i>file</i></p>
+<p style="margin-top: 1em"><b>-O</b> <i>file</i></p>
<p style="margin-left:17%;">Write archive to
<i>file</i>.</p>
-<p style="margin-top: 1em"><b>−o</b>,
-<b>−−create</b></p>
+<p style="margin-top: 1em"><b>-o</b>, <b>--create</b></p>
<p style="margin-left:17%;">Output mode. See above for
description.</p>
-<p style="margin-top: 1em"><b>−p</b>,
-<b>−−pass-through</b></p>
+<p style="margin-top: 1em"><b>-p</b>,
+<b>--pass-through</b></p>
<p style="margin-left:17%;">Pass-through mode. See above
for description.</p>
+<p style="margin-top: 1em"><b>--preserve-owner</b></p>
-<p style="margin-top: 1em"><b>−−preserve-owner</b></p>
-
<p style="margin-left:17%;">(i mode only) Restore file
ownership. This is the default when run by the root
user.</p>
-<p style="margin-top: 1em"><b>−−quiet</b></p>
+<p style="margin-top: 1em"><b>--quiet</b></p>
<p style="margin-left:17%;">Suppress unnecessary
messages.</p>
-<p style="margin-top: 1em"><b>−R</b> [ <br>
+<p style="margin-top: 1em"><b>-R</b> [ <br>
user][ <br>
:][ <br>
-group], <b>−−owner</b> [ <br>
+group], <b>--owner</b> [ <br>
user][ <br>
:][ <br>
group]</p>
@@ -318,17 +307,17 @@
<p style="margin-left:17%;">Set the owner and/or group on
files in the output. If group is specified with no user (for
-example, <b>−R</b> <i>:wheel</i>) then the group will
-be set but not the user. If the user is specified with a
-trailing colon and no group (for example, <b>−R</b>
-<i>root:</i>) then the group will be set to the user’s
-default group. If the user is specified with no trailing
-colon, then the user will be set but not the group. In
-<b>−i</b> and <b>−p</b> modes, this option can
-only be used by the super-user. (For compatibility, a period
-can be used in place of the colon.)</p>
+example, <b>-R</b> <i>:wheel</i>) then the group will be set
+but not the user. If the user is specified with a trailing
+colon and no group (for example, <b>-R</b> <i>root:</i>)
+then the group will be set to the user’s default
+group. If the user is specified with no trailing colon, then
+the user will be set but not the group. In <b>-i</b> and
+<b>-p</b> modes, this option can only be used by the
+super-user. (For compatibility, a period can be used in
+place of the colon.)</p>
-<p style="margin-top: 1em"><b>−r</b></p>
+<p style="margin-top: 1em"><b>-r</b></p>
<p style="margin-left:17%; margin-top: 1em">(All modes.)
Rename files interactively. For each file, a prompt is
@@ -338,40 +327,36 @@
period, the file is processed normally. Otherwise, the line
is taken to be the new name of the file.</p>
-<p style="margin-top: 1em"><b>−t</b>,
-<b>−−list</b></p>
+<p style="margin-top: 1em"><b>-t</b>, <b>--list</b></p>
<p style="margin-left:17%;">(i mode only) List the contents
of the archive to stdout; do not restore the contents to
disk.</p>
-<p style="margin-top: 1em"><b>−u</b>,
-<b>−−unconditional</b></p>
+<p style="margin-top: 1em"><b>-u</b>,
+<b>--unconditional</b></p>
<p style="margin-left:17%;">(i and p modes) Unconditionally
overwrite existing files. Ordinarily, an older file will not
overwrite a newer file on disk.</p>
-<p style="margin-top: 1em"><b>−V</b>,
-<b>−−dot</b></p>
+<p style="margin-top: 1em"><b>-V</b>, <b>--dot</b></p>
<p style="margin-left:17%;">Print a dot to stderr for each
-file as it is processed. Superseded by <b>−v</b>.</p>
+file as it is processed. Superseded by <b>-v</b>.</p>
-<p style="margin-top: 1em"><b>−v</b>,
-<b>−−verbose</b></p>
+<p style="margin-top: 1em"><b>-v</b>, <b>--verbose</b></p>
<p style="margin-left:17%;">Print the name of each file to
-stderr as it is processed. With <b>−t</b>, provide a
+stderr as it is processed. With <b>-t</b>, provide a
detailed listing of each file.</p>
+<p style="margin-top: 1em"><b>--version</b></p>
-<p style="margin-top: 1em"><b>−−version</b></p>
-
<p style="margin-left:17%;">Print the program version
information and exit.</p>
-<p style="margin-top: 1em"><b>−y</b></p>
+<p style="margin-top: 1em"><b>-y</b></p>
<p style="margin-left:17%; margin-top: 1em">(o mode only)
Compress the archive with bzip2-compatible compression
@@ -378,7 +363,7 @@
before writing it. In input mode, this option is ignored;
bzip2 compression is recognized automatically on input.</p>
-<p style="margin-top: 1em"><b>−Z</b></p>
+<p style="margin-top: 1em"><b>-Z</b></p>
<p style="margin-left:17%; margin-top: 1em">(o mode only)
Compress the archive with compress-compatible compression
@@ -385,7 +370,7 @@
before writing it. In input mode, this option is ignored;
compression is recognized automatically on input.</p>
-<p style="margin-top: 1em"><b>−z</b></p>
+<p style="margin-top: 1em"><b>-z</b></p>
<p style="margin-left:17%; margin-top: 1em">(o mode only)
Compress the archive with gzip-compatible compression before
@@ -422,7 +407,7 @@
copies all files from <i>src</i> to <i>dest</i>:</p>
<p style="margin-left:14%;"><b>find</b> <i>src</i> |
-<b>cpio −pmud</b> <i>dest</i></p>
+<b>cpio -pmud</b> <i>dest</i></p>
<p style="margin-left:6%; margin-top: 1em">By carefully
selecting options to the find(1) command and combining it
@@ -433,8 +418,8 @@
pattern:</p>
<p style="margin-left:14%;"><b>find</b> <i>src</i>
-<b>−mtime</b> <i>+2</i> | <b>grep foo[bar]</b> |
-<b>cpio −pdmu</b> <i>dest</i></p>
+<b>-mtime</b> <i>+2</i> | <b>grep foo[bar]</b> | <b>cpio
+-pdmu</b> <i>dest</i></p>
<p style="margin-left:6%; margin-top: 1em">This example
copies files from <i>src</i> to <i>dest</i> that are more
@@ -444,8 +429,8 @@
<p>foobar ’’:</p>
<p style="margin-left:14%;"><b>find</b> <i>src</i>
-<b>−mtime</b> <i>+2</i> | <b>xargs grep -l foobar</b>
-| <b>cpio −pdmu</b> <i>dest</i></p>
+<b>-mtime</b> <i>+2</i> | <b>xargs grep -l foobar</b> |
+<b>cpio -pdmu</b> <i>dest</i></p>
<p style="margin-top: 1em"><b>COMPATIBILITY</b></p>
@@ -454,18 +439,16 @@
SUSv2.</p>
<p style="margin-left:6%; margin-top: 1em">The old POSIX.1
-standard specified that only <b>−i</b>,
-<b>−o</b>, and <b>−p</b> were interpreted as
-command-line options. Each took a single argument of a list
-of modifier characters. For example, the standard syntax
-allows <b>−imu</b> but does not support
-<b>−miu</b> or <b>−i −m −u</b>,
-since <i>m</i> and <i>u</i> are only modifiers to
-<b>−i</b>, they are not command-line options in their
-own right. The syntax supported by this implementation is
-backwards-compatible with the standard. For best
-compatibility, scripts should limit themselves to the
-standard syntax.</p>
+standard specified that only <b>-i</b>, <b>-o</b>, and
+<b>-p</b> were interpreted as command-line options. Each
+took a single argument of a list of modifier characters. For
+example, the standard syntax allows <b>-imu</b> but does not
+support <b>-miu</b> or <b>-i -m -u</b>, since <i>m</i> and
+<i>u</i> are only modifiers to <b>-i</b>, they are not
+command-line options in their own right. The syntax
+supported by this implementation is backwards-compatible
+with the standard. For best compatibility, scripts should
+limit themselves to the standard syntax.</p>
<p style="margin-top: 1em"><b>SEE ALSO</b></p>
Modified: trunk/contrib/libarchive/doc/html/bsdtar.1.html
===================================================================
--- trunk/contrib/libarchive/doc/html/bsdtar.1.html 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/html/bsdtar.1.html 2018-06-19 20:42:35 UTC (rev 11134)
@@ -1,5 +1,5 @@
<!-- Creator : groff version 1.22.3 -->
-<!-- CreationDate: Sun Jun 19 19:54:10 2016 -->
+<!-- CreationDate: Mon Jul 10 02:32:58 2017 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
@@ -36,14 +36,14 @@
file</i> 〉 | 〈 <i><br>
pattern</i> 〉 ...]</p>
-<p style="margin-left:12%;"><b>tar</b> {<b>−c</b>}
+<p style="margin-left:12%;"><b>tar</b> {<b>-c</b>}
[<i>options</i>]
[<i>files </i>| <i>directories</i>] <b><br>
-tar</b> {<b>−r </b>| <b>−u</b>}
-<b>−f</b> <i>archive-file</i> [<i>options</i>]
+tar</b> {<b>-r </b>| <b>-u</b>} <b>-f</b>
+<i>archive-file</i> [<i>options</i>]
[<i>files </i>| <i>directories</i>] <b><br>
-tar</b> {<b>−t </b>| <b>−x</b>}
-[<i>options</i>] [<i>patterns</i>]</p>
+tar</b> {<b>-t </b>| <b>-x</b>} [<i>options</i>]
+[<i>patterns</i>]</p>
<p style="margin-top: 1em"><b>DESCRIPTION</b></p>
@@ -63,50 +63,48 @@
synopsis forms show the preferred usage. The first option to
<b>tar</b> is a mode indicator from the following list:</p>
-<p><b>−c</b></p>
+<p><b>-c</b></p>
<p style="margin-left:17%; margin-top: 1em">Create a new
archive containing the specified items. The long option form
-is <b>−−create</b>.</p>
+is <b>--create</b>.</p>
-<p><b>−r</b></p>
+<p><b>-r</b></p>
-<p style="margin-left:17%; margin-top: 1em">Like
-<b>−c</b>, but new entries are appended to the
-archive. Note that this only works on uncompressed archives
-stored in regular files. The <b>−f</b> option is
-required. The long option form is
-<b>−−append</b>.</p>
+<p style="margin-left:17%; margin-top: 1em">Like <b>-c</b>,
+but new entries are appended to the archive. Note that this
+only works on uncompressed archives stored in regular files.
+The <b>-f</b> option is required. The long option form is
+<b>--append</b>.</p>
-<p><b>−t</b></p>
+<p><b>-t</b></p>
<p style="margin-left:17%; margin-top: 1em">List archive
contents to stdout. The long option form is
-<b>−−list</b>.</p>
+<b>--list</b>.</p>
-<p><b>−u</b></p>
+<p><b>-u</b></p>
-<p style="margin-left:17%; margin-top: 1em">Like
-<b>−r</b>, but new entries are added only if they have
-a modification date newer than the corresponding entry in
-the archive. Note that this only works on uncompressed
-archives stored in regular files. The <b>−f</b> option
-is required. The long form is
-<b>−−update</b>.</p>
+<p style="margin-left:17%; margin-top: 1em">Like <b>-r</b>,
+but new entries are added only if they have a modification
+date newer than the corresponding entry in the archive. Note
+that this only works on uncompressed archives stored in
+regular files. The <b>-f</b> option is required. The long
+form is <b>--update</b>.</p>
-<p><b>−x</b></p>
+<p><b>-x</b></p>
<p style="margin-left:17%; margin-top: 1em">Extract to disk
from the archive. If a file with the same name appears more
than once in the archive, each copy will be extracted, with
later copies overwriting (replacing) earlier copies. The
-long option form is <b>−−extract</b>.</p>
+long option form is <b>--extract</b>.</p>
-<p style="margin-left:6%; margin-top: 1em">In
-<b>−c</b>, <b>−r</b>, or <b>−u</b> mode,
-each specified file or directory is added to the archive in
-the order specified on the command line. By default, the
-contents of each directory are also archived.</p>
+<p style="margin-left:6%; margin-top: 1em">In <b>-c</b>,
+<b>-r</b>, or <b>-u</b> mode, each specified file or
+directory is added to the archive in the order specified on
+the command line. By default, the contents of each directory
+are also archived.</p>
<p style="margin-left:6%; margin-top: 1em">In extract or
list mode, the entire command line is read and parsed before
@@ -123,25 +121,25 @@
<p style="margin-top: 1em"><b>@</b><i>archive</i></p>
-<p style="margin-left:17%;">(c and r mode only) The
+<p style="margin-left:17%;">(c and r modes only) The
specified archive is opened and the entries in it will be
appended to the current archive. As a simple example,</p>
-<p style="margin-left:24%;"><b>tar −c −f</b>
-<i>- newfile</i> <b>@</b><i>original.tar</i></p>
+<p style="margin-left:24%;"><b>tar -c -f</b> <i>-
+newfile</i> <b>@</b><i>original.tar</i></p>
<p style="margin-left:17%;">writes a new archive to
standard output containing a file <i>newfile</i> and all of
the entries from <i>original.tar</i>. In contrast,</p>
-<p style="margin-left:24%;"><b>tar −c −f</b>
-<i>- newfile original.tar</i></p>
+<p style="margin-left:24%;"><b>tar -c -f</b> <i>- newfile
+original.tar</i></p>
<p style="margin-left:17%;">creates a new archive with only
two entries. Similarly,</p>
-<p style="margin-left:24%;"><b>tar −czf</b> <i>-</i>
-<b>−−format pax @</b><i>-</i></p>
+<p style="margin-left:24%;"><b>tar -czf</b> <i>-</i>
+<b>--format pax @</b><i>-</i></p>
<p style="margin-left:17%;">reads an archive from standard
input (whose format will be determined automatically) and
@@ -149,20 +147,20 @@
stdout. In this way, <b>tar</b> can be used to convert
archives from one format to another.</p>
-<p style="margin-top: 1em"><b>−a</b>,
-<b>−−auto-compress</b></p>
+<p style="margin-top: 1em"><b>-a</b>,
+<b>--auto-compress</b></p>
<p style="margin-left:17%;">(c mode only) Use the archive
suffix to decide a set of the format and the compressions.
As a simple example,</p>
-<p style="margin-left:24%;"><b>tar −a −cf</b>
+<p style="margin-left:24%;"><b>tar -a -cf</b>
<i>archive.tgz source.c source.h</i></p>
<p style="margin-left:17%;">creates a new archive with
restricted pax format and gzip compression,</p>
-<p style="margin-left:24%;"><b>tar −a −cf</b>
+<p style="margin-left:24%;"><b>tar -a -cf</b>
<i>archive.tar.bz2.uu source.c source.h</i></p>
<p style="margin-left:17%;">creates a new archive with
@@ -169,13 +167,13 @@
restricted pax format and bzip2 compression and uuencode
compression,</p>
-<p style="margin-left:24%;"><b>tar −a −cf</b>
+<p style="margin-left:24%;"><b>tar -a -cf</b>
<i>archive.zip source.c source.h</i></p>
<p style="margin-left:17%;">creates a new archive with zip
format,</p>
-<p style="margin-left:24%;"><b>tar −a −jcf</b>
+<p style="margin-left:24%;"><b>tar -a -jcf</b>
<i>archive.tgz source.c source.h</i></p>
<p style="margin-left:17%;">ignores the
@@ -182,7 +180,7 @@
’’-j’’ option, and creates a new
archive with restricted pax format and gzip compression,</p>
-<p style="margin-left:24%;"><b>tar −a −jcf</b>
+<p style="margin-left:24%;"><b>tar -a -jcf</b>
<i>archive.xxx source.c source.h</i></p>
<p style="margin-left:17%;">if it is unknown suffix or no
@@ -189,15 +187,24 @@
suffix, creates a new archive with restricted pax format and
bzip2 compression.</p>
-<p style="margin-top: 1em"><b>−B</b>,
-<b>−−read-full-blocks</b></p>
+<p style="margin-top: 1em"><b>--acls</b></p>
+<p style="margin-left:17%; margin-top: 1em">(c, r, u, x
+modes only) Archive or extract POSIX.1e or NFSv4 ACLs. This
+is the reverse of <b>--no-acls</b> and the default behavior
+in c, r, and u modes (except on Mac OS X) or if <b>tar</b>
+is run in x mode as root. On Mac OS X this option translates
+extended ACLs to NFSv4 ACLs. To store extended ACLs the
+<b>--mac-metadata</b> option is preferred.</p>
+
+<p style="margin-top: 1em"><b>-B</b>,
+<b>--read-full-blocks</b></p>
+
<p style="margin-left:17%;">Ignored for compatibility with
other tar(1) implementations.</p>
-<p style="margin-top: 1em"><b>−b</b>
-<i>blocksize</i>, <b>−−block-size</b>
-<i>blocksize</i></p>
+<p style="margin-top: 1em"><b>-b</b> <i>blocksize</i>,
+<b>--block-size</b> <i>blocksize</i></p>
<p style="margin-left:17%;">Specify the block size, in
512-byte records, for tape drive I/O. As a rule, this
@@ -205,9 +212,9 @@
drives, and usually not even then as the default block size
of 20 records (10240 bytes) is very common.</p>
-<p style="margin-top: 1em"><b>−C</b>
-<i>directory</i>, <b>−−cd</b> <i>directory</i>,
-<b>−−directory</b> <i>directory</i></p>
+<p style="margin-top: 1em"><b>-C</b> <i>directory</i>,
+<b>--cd</b> <i>directory</i>, <b>--directory</b>
+<i>directory</i></p>
<p style="margin-left:17%;">In c and r mode, this changes
the directory before adding the following files. In x mode,
@@ -214,26 +221,20 @@
change directories after opening the archive but before
extracting entries from the archive.</p>
-<p style="margin-top: 1em"><b>−−chroot</b></p>
+<p style="margin-top: 1em"><b>--chroot</b></p>
<p style="margin-left:17%;">(x mode only) <b>chroot</b>()
-to the current directory after processing any
-<b>−C</b> options and before extracting any files.</p>
+to the current directory after processing any <b>-C</b>
+options and before extracting any files.</p>
-<p style="margin-top: 1em"><b>−−clear-nochange-fflags</b></p>
+<p style="margin-top: 1em"><b>--clear-nochange-fflags</b></p>
<p style="margin-left:17%;">(x mode only) Before removing
file system objects to replace them, clear platform-specific
file flags that might prevent removal.</p>
-
-<p style="margin-top: 1em"><b>−−disable-copyfile</b></p>
-
-<p style="margin-left:17%;">Mac OS X specific. Disable the
-use of copyfile(3).</p>
-
-<p style="margin-top: 1em"><b>−−exclude</b>
+<p style="margin-top: 1em"><b>--exclude</b>
<i>pattern</i></p>
<p style="margin-left:17%;">Do not process files or
@@ -241,7 +242,14 @@
exclusions take precedence over patterns or filenames
specified on the command line.</p>
-<p style="margin-top: 1em"><b>−−format</b>
+<p style="margin-top: 1em"><b>--fflags</b></p>
+
+<p style="margin-left:17%;">(c, r, u, x modes only) Archive
+or extract file flags. This is the reverse of
+<b>--no-fflags</b> and the default behavior in c, r, and u
+modes or if <b>tar</b> is run in x mode as root.</p>
+
+<p style="margin-top: 1em"><b>--format</b>
<i>format</i></p>
<p style="margin-left:17%;">(c, r, u mode only) Use the
@@ -256,8 +264,8 @@
must be compatible with the format of the existing archive
on disk.</p>
-<p style="margin-top: 1em"><b>−f</b> <i>file</i>,
-<b>−−file</b> <i>file</i></p>
+<p style="margin-top: 1em"><b>-f</b> <i>file</i>,
+<b>--file</b> <i>file</i></p>
<p style="margin-left:17%;">Read the archive from or write
the archive to the specified file. The filename can be
@@ -266,84 +274,77 @@
<i>/dev/sa0</i>; on Linux, the default is
<i>/dev/st0</i>.</p>
-<p style="margin-top: 1em"><b>−−gid</b>
-<i>id</i></p>
+<p style="margin-top: 1em"><b>--gid</b> <i>id</i></p>
<p style="margin-left:17%;">Use the provided group id
number. On extract, this overrides the group id in the
archive; the group name in the archive will be ignored. On
create, this overrides the group id read from disk; if
-<b>−−gname</b> is not also specified, the group
-name will be set to match the group id.</p>
+<b>--gname</b> is not also specified, the group name will be
+set to match the group id.</p>
-<p style="margin-top: 1em"><b>−−gname</b>
-<i>name</i></p>
+<p style="margin-top: 1em"><b>--gname</b> <i>name</i></p>
<p style="margin-left:17%;">Use the provided group name. On
extract, this overrides the group name in the archive; if
the provided group name does not exist on the system, the
-group id (from the archive or from the
-<b>−−gid</b> option) will be used instead. On
-create, this sets the group name that will be stored in the
-archive; the name will not be verified against the system
-group database.</p>
+group id (from the archive or from the <b>--gid</b> option)
+will be used instead. On create, this sets the group name
+that will be stored in the archive; the name will not be
+verified against the system group database.</p>
-<p style="margin-top: 1em"><b>−H</b></p>
+<p style="margin-top: 1em"><b>-H</b></p>
-<p style="margin-left:17%; margin-top: 1em">(c and r mode
+<p style="margin-left:17%; margin-top: 1em">(c and r modes
only) Symbolic links named on the command line will be
followed; the target of the link will be archived, not the
link itself.</p>
-<p style="margin-top: 1em"><b>−h</b></p>
+<p style="margin-top: 1em"><b>-h</b></p>
-<p style="margin-left:17%; margin-top: 1em">(c and r mode
-only) Synonym for <b>−L</b>.</p>
+<p style="margin-left:17%; margin-top: 1em">(c and r modes
+only) Synonym for <b>-L</b>.</p>
-<p style="margin-top: 1em"><b>−I</b></p>
+<p style="margin-top: 1em"><b>-I</b></p>
<p style="margin-left:17%; margin-top: 1em">Synonym for
-<b>−T</b>.</p>
+<b>-T</b>.</p>
-<p style="margin-top: 1em"><b>−−help</b></p>
+<p style="margin-top: 1em"><b>--help</b></p>
<p style="margin-left:17%; margin-top: 1em">Show usage.</p>
+<p style="margin-top: 1em"><b>--hfsCompression</b></p>
-<p style="margin-top: 1em"><b>−−hfsCompression</b></p>
+<p style="margin-left:17%;">(x mode only) Mac OS X specific
+(v10.6 or later). Compress extracted regular files with HFS+
+compression.</p>
-<p style="margin-left:17%;">(x mode only) Mac OS X
-specific(v10.6 or later). Compress extracted regular files
-with HFS+ compression.</p>
+<p style="margin-top: 1em"><b>--ignore-zeros</b></p>
+<p style="margin-left:17%;">An alias of <b>--options
+read_concatenated_archives</b> for compatibility with GNU
+tar.</p>
-<p style="margin-top: 1em"><b>−−ignore-zeros</b></p>
-
-<p style="margin-left:17%;">An alias of
-<b>−−options read_concatenated_archives</b> for
-compatibility with GNU tar.</p>
-
-<p style="margin-top: 1em"><b>−−include</b>
+<p style="margin-top: 1em"><b>--include</b>
<i>pattern</i></p>
<p style="margin-left:17%;">Process only files or
directories that match the specified pattern. Note that
-exclusions specified with <b>−−exclude</b> take
-precedence over inclusions. If no inclusions are explicitly
-specified, all entries are processed by default. The
-<b>−−include</b> option is especially useful
-when filtering archives. For example, the command</p>
+exclusions specified with <b>--exclude</b> take precedence
+over inclusions. If no inclusions are explicitly specified,
+all entries are processed by default. The <b>--include</b>
+option is especially useful when filtering archives. For
+example, the command</p>
-<p style="margin-left:24%;"><b>tar −c −f</b>
-<i>new.tar</i> <b>−−include=’*foo*’
-@</b><i>old.tgz</i></p>
+<p style="margin-left:24%;"><b>tar -c -f</b> <i>new.tar</i>
+<b>--include=’*foo*’ @</b><i>old.tgz</i></p>
<p style="margin-left:17%;">creates a new archive
<i>new.tar</i> containing only the entries from
<i>old.tgz</i> containing the string ’foo’.</p>
-<p style="margin-top: 1em"><b>−J</b>,
-<b>−−xz</b></p>
+<p style="margin-top: 1em"><b>-J</b>, <b>--xz</b></p>
<p style="margin-left:17%;">(c mode only) Compress the
resulting archive with xz(1). In extract or list modes, this
@@ -351,9 +352,8 @@
implementations, this implementation recognizes XZ
compression automatically when reading archives.</p>
-<p style="margin-top: 1em"><b>−j</b>,
-<b>−−bzip</b>, <b>−−bzip2</b>,
-<b>−−bunzip2</b></p>
+<p style="margin-top: 1em"><b>-j</b>, <b>--bzip</b>,
+<b>--bzip2</b>, <b>--bunzip2</b></p>
<p style="margin-left:17%;">(c mode only) Compress the
resulting archive with bzip2(1). In extract or list modes,
@@ -361,8 +361,8 @@
implementations, this implementation recognizes bzip2
compression automatically when reading archives.</p>
-<p style="margin-top: 1em"><b>−k</b>,
-<b>−−keep-old-files</b></p>
+<p style="margin-top: 1em"><b>-k</b>,
+<b>--keep-old-files</b></p>
<p style="margin-left:17%;">(x mode only) Do not overwrite
existing files. In particular, if a file appears more than
@@ -369,35 +369,34 @@
once in an archive, later copies will not overwrite earlier
copies.</p>
+<p style="margin-top: 1em"><b>--keep-newer-files</b></p>
-<p style="margin-top: 1em"><b>−−keep-newer-files</b></p>
-
<p style="margin-left:17%;">(x mode only) Do not overwrite
existing files that are newer than the versions appearing in
the archive being extracted.</p>
-<p style="margin-top: 1em"><b>−L</b>,
-<b>−−dereference</b></p>
+<p style="margin-top: 1em"><b>-L</b>,
+<b>--dereference</b></p>
-<p style="margin-left:17%;">(c and r mode only) All
+<p style="margin-left:17%;">(c and r modes only) All
symbolic links will be followed. Normally, symbolic links
are archived as such. With this option, the target of the
link will be archived instead.</p>
-<p style="margin-top: 1em"><b>−l</b>,
-<b>−−check-links</b></p>
+<p style="margin-top: 1em"><b>-l</b>,
+<b>--check-links</b></p>
<p style="margin-left:17%;">(c and r modes only) Issue a
warning message unless all links to each file are
archived.</p>
-<p style="margin-top: 1em"><b>−−lrzip</b></p>
+<p style="margin-top: 1em"><b>--lrzip</b></p>
<p style="margin-left:17%;">(c mode only) Compress the
resulting archive with lrzip(1). In extract or list modes,
this option is ignored.</p>
-<p style="margin-top: 1em"><b>−−lz4</b></p>
+<p style="margin-top: 1em"><b>--lz4</b></p>
<p style="margin-left:17%; margin-top: 1em">(c mode only)
Compress the archive with lz4-compatible compression before
@@ -404,52 +403,58 @@
writing it. In input mode, this option is ignored; lz4
compression is recognized automatically on input.</p>
-<p style="margin-top: 1em"><b>−−lzma</b></p>
+<p style="margin-top: 1em"><b>--lzma</b></p>
<p style="margin-left:17%; margin-top: 1em">(c mode only)
Compress the resulting archive with the original LZMA
algorithm. Use of this option is discouraged and new
-archives should be created with <b>−−xz</b>
-instead. Note that, unlike other <b>tar</b> implementations,
-this implementation recognizes LZMA compression
-automatically when reading archives.</p>
+archives should be created with <b>--xz</b> instead. Note
+that, unlike other <b>tar</b> implementations, this
+implementation recognizes LZMA compression automatically
+when reading archives.</p>
-<p style="margin-top: 1em"><b>−−lzop</b></p>
+<p style="margin-top: 1em"><b>--lzop</b></p>
<p style="margin-left:17%; margin-top: 1em">(c mode only)
Compress the resulting archive with lzop(1). In extract or
list modes, this option is ignored.</p>
-<p style="margin-top: 1em"><b>−m</b>,
-<b>−−modification-time</b></p>
+<p style="margin-top: 1em"><b>-m</b>,
+<b>--modification-time</b></p>
<p style="margin-left:17%;">(x mode only) Do not extract
modification time. By default, the modification time is set
to the time stored in the archive.</p>
-<p style="margin-top: 1em"><b>−n</b>,
-<b>−−norecurse</b>,
-<b>−−no-recursion</b></p>
+<p style="margin-top: 1em"><b>--mac-metadata</b></p>
+<p style="margin-left:17%;">(c, r, u and x mode only) Mac
+OS X specific. Archive or extract extended ACLs and extended
+attributes using copyfile(3) in AppleDouble format. This is
+the reverse of <b>--no-mac-metadata</b>. and the default
+behavior in c, r, and u modes or if <b>tar</b> is run in x
+mode as root.</p>
+
+<p style="margin-top: 1em"><b>-n</b>, <b>--norecurse</b>,
+<b>--no-recursion</b></p>
+
<p style="margin-left:17%;">(c, r, u modes only) Do not
recursively archive the contents of directories.</p>
-<p style="margin-top: 1em"><b>−−newer</b>
-<i>date</i></p>
+<p style="margin-top: 1em"><b>--newer</b> <i>date</i></p>
<p style="margin-left:17%;">(c, r, u modes only) Only
include files and directories newer than the specified date.
This compares ctime entries.</p>
-
-<p style="margin-top: 1em"><b>−−newer-mtime</b>
+<p style="margin-top: 1em"><b>--newer-mtime</b>
<i>date</i></p>
<p style="margin-left:17%;">(c, r, u modes only) Like
-<b>−−newer</b>, except it compares mtime entries
-instead of ctime entries.</p>
+<b>--newer</b>, except it compares mtime entries instead of
+ctime entries.</p>
-<p style="margin-top: 1em"><b>−−newer-than</b>
+<p style="margin-top: 1em"><b>--newer-than</b>
<i>file</i></p>
<p style="margin-left:17%;">(c, r, u modes only) Only
@@ -456,66 +461,95 @@
include files and directories newer than the specified file.
This compares ctime entries.</p>
-
-<p style="margin-top: 1em"><b>−−newer-mtime-than</b>
+<p style="margin-top: 1em"><b>--newer-mtime-than</b>
<i>file</i></p>
<p style="margin-left:17%;">(c, r, u modes only) Like
-<b>−−newer-than</b>, except it compares mtime
-entries instead of ctime entries.</p>
+<b>--newer-than</b>, except it compares mtime entries
+instead of ctime entries.</p>
-<p style="margin-top: 1em"><b>−−nodump</b></p>
+<p style="margin-top: 1em"><b>--nodump</b></p>
<p style="margin-left:17%;">(c and r modes only) Honor the
nodump file flag by skipping this file.</p>
-<p style="margin-top: 1em"><b>−−nopreserveHFSCompression</b></p>
+<p style="margin-top: 1em"><b>--nopreserveHFSCompression</b></p>
-<p style="margin-left:17%;">(x mode only) Mac OS X
-specific(v10.6 or later). Do not compress extracted regular
-files which were compressed with HFS+ compression before
-archived. By default, compress the regular files again with
-HFS+ compression.</p>
+<p style="margin-left:17%;">(x mode only) Mac OS X specific
+(v10.6 or later). Do not compress extracted regular files
+which were compressed with HFS+ compression before archived.
+By default, compress the regular files again with HFS+
+compression.</p>
-<p style="margin-top: 1em"><b>−−null</b></p>
+<p style="margin-top: 1em"><b>--null</b></p>
<p style="margin-left:17%; margin-top: 1em">(use with
-<b>−I</b> or <b>−T</b>) Filenames or patterns
-are separated by null characters, not by newlines. This is
-often used to read filenames output by the
-<b>−print0</b> option to find(1).</p>
+<b>-I</b> or <b>-T</b>) Filenames or patterns are separated
+by null characters, not by newlines. This is often used to
+read filenames output by the <b>-print0</b> option to
+find(1).</p>
+<p style="margin-top: 1em"><b>--no-acls</b></p>
-<p style="margin-top: 1em"><b>−−no-same-owner</b></p>
+<p style="margin-left:17%;">(c, r, u, x modes only) Do not
+archive or extract POSIX.1e or NFSv4 ACLs. This is the
+reverse of <b>--acls</b> and the default behavior if
+<b>tar</b> is run as non-root in x mode (on Mac OS X as any
+user in c, r, u and x modes).</p>
+<p style="margin-top: 1em"><b>--no-fflags</b></p>
+
+<p style="margin-left:17%;">(c, r, u, x modes only) Do not
+archive or extract file flags. This is the reverse of
+<b>--fflags</b> and the default behavior if <b>tar</b> is
+run as non-root in x mode.</p>
+
+<p style="margin-top: 1em"><b>--no-mac-metadata</b></p>
+
+<p style="margin-left:17%;">(x mode only) Mac OS X
+specific. Do not archive or extract ACLs and extended
+attributes using copyfile(3) in AppleDouble format. This is
+the reverse of <b>--mac-metadata</b>. and the default
+behavior if <b>tar</b> is run as non-root in x mode.</p>
+
+<p style="margin-top: 1em"><b>-n</b>, <b>--norecurse</b>,
+<b>--no-recursion</b></p>
+
+<p style="margin-top: 1em"><b>--no-same-owner</b></p>
+
<p style="margin-left:17%;">(x mode only) Do not extract
owner and group IDs. This is the reverse of
-<b>−−same-owner</b> and the default behavior if
-<b>tar</b> is run as non-root.</p>
+<b>--same-owner</b> and the default behavior if <b>tar</b>
+is run as non-root.</p>
-<p style="margin-top: 1em"><b>−−no-same-permissions</b></p>
+<p style="margin-top: 1em"><b>--no-same-permissions</b></p>
<p style="margin-left:17%;">(x mode only) Do not extract
full permissions (SGID, SUID, sticky bit, ACLs, extended
attributes or extended file flags). This is the reverse of
-<b>−p</b> and the default behavior if <b>tar</b> is
-run as non-root.</p>
+<b>-p</b> and the default behavior if <b>tar</b> is run as
+non-root.</p>
+<p style="margin-top: 1em"><b>--no-xattrs</b></p>
-<p style="margin-top: 1em"><b>−−numeric-owner</b></p>
+<p style="margin-left:17%;">(c, r, u, x modes only) Do not
+archive or extract extended attributes. This is the reverse
+of <b>--xattrs</b> and the default behavior if <b>tar</b> is
+run as non-root in x mode.</p>
+<p style="margin-top: 1em"><b>--numeric-owner</b></p>
+
<p style="margin-left:17%;">This is equivalent to
-<b>−−uname</b> ""
-<b>−−gname</b> "". On extract, it
-causes user and group names in the archive to be ignored in
-favor of the numeric user and group ids. On create, it
-causes user and group names to not be stored in the
-archive.</p>
+<b>--uname</b> "" <b>--gname</b> "". On
+extract, it causes user and group names in the archive to be
+ignored in favor of the numeric user and group ids. On
+create, it causes user and group names to not be stored in
+the archive.</p>
-<p style="margin-top: 1em"><b>−O</b>,
-<b>−−to-stdout</b></p>
+<p style="margin-top: 1em"><b>-O</b>,
+<b>--to-stdout</b></p>
<p style="margin-left:17%;">(x, t modes only) In extract
(-x) mode, files will be written to standard out rather than
@@ -522,38 +556,35 @@
being extracted to disk. In list (-t) mode, the file listing
will be written to stderr rather than the usual stdout.</p>
-<p style="margin-top: 1em"><b>−o</b></p>
+<p style="margin-top: 1em"><b>-o</b></p>
<p style="margin-left:17%; margin-top: 1em">(x mode) Use
the user and group of the user running the program rather
than those specified in the archive. Note that this has no
-significance unless <b>−p</b> is specified, and the
-program is being run by the root user. In this case, the
-file modes and flags from the archive will be restored, but
-ACLs or owner information in the archive will be
-discarded.</p>
+significance unless <b>-p</b> is specified, and the program
+is being run by the root user. In this case, the file modes
+and flags from the archive will be restored, but ACLs or
+owner information in the archive will be discarded.</p>
-<p style="margin-top: 1em"><b>−o</b></p>
+<p style="margin-top: 1em"><b>-o</b></p>
<p style="margin-left:17%; margin-top: 1em">(c, r, u mode)
-A synonym for <b>−−format</b> <i>ustar</i></p>
+A synonym for <b>--format</b> <i>ustar</i></p>
-<p style="margin-top: 1em"><b>−−older</b>
-<i>date</i></p>
+<p style="margin-top: 1em"><b>--older</b> <i>date</i></p>
<p style="margin-left:17%;">(c, r, u modes only) Only
include files and directories older than the specified date.
This compares ctime entries.</p>
-
-<p style="margin-top: 1em"><b>−−older-mtime</b>
+<p style="margin-top: 1em"><b>--older-mtime</b>
<i>date</i></p>
<p style="margin-left:17%;">(c, r, u modes only) Like
-<b>−−older</b>, except it compares mtime entries
-instead of ctime entries.</p>
+<b>--older</b>, except it compares mtime entries instead of
+ctime entries.</p>
-<p style="margin-top: 1em"><b>−−older-than</b>
+<p style="margin-top: 1em"><b>--older-than</b>
<i>file</i></p>
<p style="margin-left:17%;">(c, r, u modes only) Only
@@ -560,21 +591,19 @@
include files and directories older than the specified file.
This compares ctime entries.</p>
-
-<p style="margin-top: 1em"><b>−−older-mtime-than</b>
+<p style="margin-top: 1em"><b>--older-mtime-than</b>
<i>file</i></p>
<p style="margin-left:17%;">(c, r, u modes only) Like
-<b>−−older-than</b>, except it compares mtime
-entries instead of ctime entries.</p>
+<b>--older-than</b>, except it compares mtime entries
+instead of ctime entries.</p>
+<p style="margin-top: 1em"><b>--one-file-system</b></p>
-<p style="margin-top: 1em"><b>−−one-file-system</b></p>
-
<p style="margin-left:17%;">(c, r, and u modes) Do not
cross mount points.</p>
-<p style="margin-top: 1em"><b>−−options</b>
+<p style="margin-top: 1em"><b>--options</b>
<i>options</i></p>
<p style="margin-left:17%;">Select optional behaviors for
@@ -736,14 +765,14 @@
archive, which occurs when multiple tar archives have been
concatenated together. Without this option, only the
contents of the first concatenated archive would be read.
-This option is comparable to the <b>−i</b>,
-<b>−−ignore-zeros</b> option of GNU tar.</p>
+This option is comparable to the <b>-i</b>,
+<b>--ignore-zeros</b> option of GNU tar.</p>
<p style="margin-left:17%;">If a provided option is not
supported by any module, that is a fatal error.</p>
-<p style="margin-top: 1em"><b>−P</b>,
-<b>−−absolute-paths</b></p>
+<p style="margin-top: 1em"><b>-P</b>,
+<b>--absolute-paths</b></p>
<p style="margin-left:17%;">Preserve pathnames. By default,
absolute pathnames (those that begin with a / character)
@@ -753,20 +782,20 @@
whose target directory would be altered by a symlink. This
option suppresses these behaviors.</p>
-<p style="margin-top: 1em"><b>−p</b>,
-<b>−−insecure</b>,
-<b>−−preserve-permissions</b></p>
+<p style="margin-top: 1em"><b>-p</b>, <b>--insecure</b>,
+<b>--preserve-permissions</b></p>
<p style="margin-left:17%;">(x mode only) Preserve file
permissions. Attempt to restore the full permissions,
-including owner, file modes, file flags and ACLs, if
-available, for each item extracted from the archive. This is
-the default, if <b>tar</b> is being run by root and can be
-overridden by also specifying
-<b>−−no-same-owner</b> and
-<b>−−no-same-permissions</b>.</p>
+including owner, file modes, ACLs, extended attributes and
+extended file flags, if available, for each item extracted
+from the archive. This is te reverse of
+<b>--no-same-permissions</b> and the default if <b>tar</b>
+is being run by root and can be partially overridden by also
+specifying <b>--no-acls</b>, <b>--no-fflags</b>,
+<b>--no-mac-metadata</b> or <b>--no-xattrs</b>.</p>
-<p style="margin-top: 1em"><b>−−passphrase</b>
+<p style="margin-top: 1em"><b>--passphrase</b>
<i>passphrase</i></p>
<p style="margin-left:17%;">The <i>passphrase</i> is used
@@ -775,13 +804,13 @@
shouldn’t use this option unless you realize how
insecure use of this option is.</p>
-<p style="margin-top: 1em"><b>−−posix</b></p>
+<p style="margin-top: 1em"><b>--posix</b></p>
<p style="margin-left:17%;">(c, r, u mode only) Synonym for
-<b>−−format</b> <i>pax</i></p>
+<b>--format</b> <i>pax</i></p>
-<p style="margin-top: 1em"><b>−q</b>,
-<b>−−fast-read</b></p>
+<p style="margin-top: 1em"><b>-q</b>,
+<b>--fast-read</b></p>
<p style="margin-left:17%;">(x and t mode only) Extract or
list only the first archive entry that matches each pattern
@@ -792,7 +821,7 @@
overwrite earlier entries. This option is provided as a
performance optimization.</p>
-<p style="margin-top: 1em"><b>−S</b></p>
+<p style="margin-top: 1em"><b>-S</b></p>
<p style="margin-left:17%; margin-top: 1em">(x mode only)
Extract files as sparse files. For every block on disk,
@@ -800,8 +829,7 @@
otherwise. This works similar to the conv=sparse option of
dd.</p>
-<p style="margin-top: 1em"><b>−s</b>
-<i>pattern</i></p>
+<p style="margin-top: 1em"><b>-s</b> <i>pattern</i></p>
<p style="margin-left:17%;">Modify file or archive member
names according to <i>pattern</i>. The pattern has the
@@ -827,16 +855,13 @@
names. In particular, it is never necessary to specify h, r,
or s.</p>
+<p style="margin-top: 1em"><b>--same-owner</b></p>
-<p style="margin-top: 1em"><b>−−same-owner</b></p>
-
<p style="margin-left:17%;">(x mode only) Extract owner and
-group IDs. This is the reverse of
-<b>−−no-same-owner</b> and the default behavior
-if <b>tar</b> is run as root.</p>
+group IDs. This is the reverse of <b>--no-same-owner</b> and
+the default behavior if <b>tar</b> is run as root.</p>
-
-<p style="margin-top: 1em"><b>−−strip-components</b>
+<p style="margin-top: 1em"><b>--strip-components</b>
<i>count</i></p>
<p style="margin-left:17%;">Remove the specified number of
@@ -845,8 +870,8 @@
checking inclusion/exclusion patterns but before security
checks.</p>
-<p style="margin-top: 1em"><b>−T</b> <i>filename</i>,
-<b>−−files-from</b> <i>filename</i></p>
+<p style="margin-top: 1em"><b>-T</b> <i>filename</i>,
+<b>--files-from</b> <i>filename</i></p>
<p style="margin-left:17%;">In x or t mode, <b>tar</b> will
read the list of names to be extracted from <i>filename</i>.
@@ -855,20 +880,19 @@
’’-C’’ on a line by itself will
cause the current directory to be changed to the directory
specified on the following line. Names are terminated by
-newlines unless <b>−−null</b> is specified. Note
-that <b>−−null</b> also disables the special
-handling of lines containing ’’-C’’.
-Note: If you are generating lists of files using find(1),
-you probably want to use <b>−n</b> as well.</p>
+newlines unless <b>--null</b> is specified. Note that
+<b>--null</b> also disables the special handling of lines
+containing ’’-C’’. Note: If you are
+generating lists of files using find(1), you probably want
+to use <b>-n</b> as well.</p>
-<p style="margin-top: 1em"><b>−−totals</b></p>
+<p style="margin-top: 1em"><b>--totals</b></p>
-<p style="margin-left:17%;">(c, r, u mode only) After
+<p style="margin-left:17%;">(c, r, u modes only) After
archiving all files, print a summary to stderr.</p>
-<p style="margin-top: 1em"><b>−U</b>,
-<b>−−unlink</b>,
-<b>−−unlink-first</b></p>
+<p style="margin-top: 1em"><b>-U</b>, <b>--unlink</b>,
+<b>--unlink-first</b></p>
<p style="margin-left:17%;">(x mode only) Unlink files
before creating them. This can be a minor performance
@@ -878,28 +902,24 @@
symlinks instead of reporting an error. See the SECURITY
section below for more details.</p>
-<p style="margin-top: 1em"><b>−−uid</b>
-<i>id</i></p>
+<p style="margin-top: 1em"><b>--uid</b> <i>id</i></p>
<p style="margin-left:17%;">Use the provided user id number
and ignore the user name from the archive. On create, if
-<b>−−uname</b> is not also specified, the user
-name will be set to match the user id.</p>
+<b>--uname</b> is not also specified, the user name will be
+set to match the user id.</p>
-<p style="margin-top: 1em"><b>−−uname</b>
-<i>name</i></p>
+<p style="margin-top: 1em"><b>--uname</b> <i>name</i></p>
<p style="margin-left:17%;">Use the provided user name. On
extract, this overrides the user name in the archive; if the
provided user name does not exist on the system, it will be
ignored and the user id (from the archive or from the
-<b>−−uid</b> option) will be used instead. On
-create, this sets the user name that will be stored in the
-archive; the name is not verified against the system user
-database.</p>
+<b>--uid</b> option) will be used instead. On create, this
+sets the user name that will be stored in the archive; the
+name is not verified against the system user database.</p>
-
-<p style="margin-top: 1em"><b>−−use-compress-program</b>
+<p style="margin-top: 1em"><b>--use-compress-program</b>
<i>program</i></p>
<p style="margin-left:17%;">Pipe the input (in x or t mode)
@@ -906,39 +926,42 @@
or the output (in c mode) through <i>program</i> instead of
using the builtin compression support.</p>
-<p style="margin-top: 1em"><b>−v</b>,
-<b>−−verbose</b></p>
+<p style="margin-top: 1em"><b>-v</b>, <b>--verbose</b></p>
<p style="margin-left:17%;">Produce verbose output. In
create and extract modes, <b>tar</b> will list each file
name as it is read from or written to the archive. In list
mode, <b>tar</b> will produce output similar to that of
-ls(1). An additional <b>−v</b> option will also
-provide ls-like details in create and extract mode.</p>
+ls(1). An additional <b>-v</b> option will also provide
+ls-like details in create and extract mode.</p>
+<p style="margin-top: 1em"><b>--version</b></p>
-<p style="margin-top: 1em"><b>−−version</b></p>
-
<p style="margin-left:17%;">Print version of <b>tar</b> and
<b>libarchive</b>, and exit.</p>
-<p style="margin-top: 1em"><b>−w</b>,
-<b>−−confirmation</b>,
-<b>−−interactive</b></p>
+<p style="margin-top: 1em"><b>-w</b>,
+<b>--confirmation</b>, <b>--interactive</b></p>
<p style="margin-left:17%;">Ask for confirmation for every
action.</p>
-<p style="margin-top: 1em"><b>−X</b> <i>filename</i>,
-<b>−−exclude-from</b> <i>filename</i></p>
+<p style="margin-top: 1em"><b>-X</b> <i>filename</i>,
+<b>--exclude-from</b> <i>filename</i></p>
<p style="margin-left:17%;">Read a list of exclusion
-patterns from the specified file. See
-<b>−−exclude</b> for more information about the
-handling of exclusions.</p>
+patterns from the specified file. See <b>--exclude</b> for
+more information about the handling of exclusions.</p>
-<p style="margin-top: 1em"><b>−y</b></p>
+<p style="margin-top: 1em"><b>--xattrs</b></p>
+<p style="margin-left:17%;">(c, r, u, x modes only) Archive
+or extract extended attributes. This is the reverse of
+<b>--no-xattrs</b> and the default behavior in c, r, and u
+modes or if <b>tar</b> is run in x mode as root.</p>
+
+<p style="margin-top: 1em"><b>-y</b></p>
+
<p style="margin-left:17%; margin-top: 1em">(c mode only)
Compress the resulting archive with bzip2(1). In extract or
list modes, this option is ignored. Note that, unlike other
@@ -945,9 +968,8 @@
<b>tar</b> implementations, this implementation recognizes
bzip2 compression automatically when reading archives.</p>
-<p style="margin-top: 1em"><b>−Z</b>,
-<b>−−compress</b>,
-<b>−−uncompress</b></p>
+<p style="margin-top: 1em"><b>-Z</b>, <b>--compress</b>,
+<b>--uncompress</b></p>
<p style="margin-left:17%;">(c mode only) Compress the
resulting archive with compress(1). In extract or list
@@ -956,8 +978,8 @@
compress compression automatically when reading
archives.</p>
-<p style="margin-top: 1em"><b>−z</b>,
-<b>−−gunzip</b>, <b>−−gzip</b></p>
+<p style="margin-top: 1em"><b>-z</b>, <b>--gunzip</b>,
+<b>--gzip</b></p>
<p style="margin-left:17%;">(c mode only) Compress the
resulting archive with gzip(1). In extract or list modes,
@@ -973,14 +995,14 @@
<p style="margin-top: 1em">TAR_READER_OPTIONS</p>
<p style="margin-left:21%;">The default options for format
-readers and compression readers. The
-<b>−−options</b> option overrides this.</p>
+readers and compression readers. The <b>--options</b> option
+overrides this.</p>
<p style="margin-top: 1em">TAR_WRITER_OPTIONS</p>
<p style="margin-left:21%;">The default options for format
-writers and compression writers. The
-<b>−−options</b> option overrides this.</p>
+writers and compression writers. The <b>--options</b> option
+overrides this.</p>
<p style="margin-top: 1em">LANG</p>
@@ -990,9 +1012,9 @@
<p style="margin-top: 1em">TAPE</p>
<p style="margin-left:21%; margin-top: 1em">The default
-device. The <b>−f</b> option overrides this. Please
-see the description of the <b>−f</b> option above for
-more details.</p>
+device. The <b>-f</b> option overrides this. Please see the
+description of the <b>-f</b> option above for more
+details.</p>
<p style="margin-top: 1em">TZ</p>
@@ -1012,38 +1034,38 @@
archive called <i>file.tar.gz</i> that contains two files
<i>source.c</i> and <i>source.h</i>:</p>
-<p style="margin-left:14%;"><b>tar −czf</b>
-<i>file.tar.gz source.c source.h</i></p>
+<p style="margin-left:14%;"><b>tar -czf</b> <i>file.tar.gz
+source.c source.h</i></p>
<p style="margin-left:6%; margin-top: 1em">To view a
detailed table of contents for this archive:</p>
-<p style="margin-left:14%;"><b>tar −tvf</b>
+<p style="margin-left:14%;"><b>tar -tvf</b>
<i>file.tar.gz</i></p>
<p style="margin-left:6%; margin-top: 1em">To extract all
entries from the archive on the default tape drive:</p>
-<p style="margin-left:14%;"><b>tar −x</b></p>
+<p style="margin-left:14%;"><b>tar -x</b></p>
<p style="margin-left:6%; margin-top: 1em">To examine the
contents of an ISO 9660 cdrom image:</p>
-<p style="margin-left:14%;"><b>tar −tf</b>
+<p style="margin-left:14%;"><b>tar -tf</b>
<i>image.iso</i></p>
<p style="margin-left:6%; margin-top: 1em">To move file
hierarchies, invoke <b>tar</b> as</p>
-<p style="margin-left:14%;"><b>tar −cf</b> <i>-</i>
-<b>−C</b> <i>srcdir .</i> | <b>tar −xpf</b>
-<i>-</i> <b>−C</b> <i>destdir</i></p>
+<p style="margin-left:14%;"><b>tar -cf</b> <i>-</i>
+<b>-C</b> <i>srcdir .</i> | <b>tar -xpf</b> <i>-</i>
+<b>-C</b> <i>destdir</i></p>
<p style="margin-left:6%;">or more traditionally</p>
-<p style="margin-left:14%;">cd srcdir ; <b>tar
-−cf</b> <i>- .</i> | (<i>cd destdir ;</i> <b>tar
-−xpf</b> <i>-</i>)</p>
+<p style="margin-left:14%;">cd srcdir ; <b>tar -cf</b>
+<i>- .</i> | (<i>cd destdir ;</i> <b>tar -xpf</b>
+<i>-</i>)</p>
<p style="margin-left:6%; margin-top: 1em">In create mode,
the list of files and directories to be archived can also
@@ -1052,8 +1074,8 @@
<b>@</b><i>archive-file</i>. For example, the command
line</p>
-<p style="margin-left:14%;"><b>tar −c −f</b>
-<i>new.tar foo1</i> <b>@</b><i>old.tgz</i> <b>-C</b><i>/tmp
+<p style="margin-left:14%;"><b>tar -c -f</b> <i>new.tar
+foo1</i> <b>@</b><i>old.tgz</i> <b>-C</b><i>/tmp
foo2</i></p>
<p style="margin-left:6%;">will create a new archive
@@ -1077,9 +1099,8 @@
$ tar -cvf output.tar @input.mtree</p>
<p style="margin-left:6%; margin-top: 1em">The
-<b>−−newer</b> and
-<b>−−newer-mtime</b> switches accept a variety
-of common date and time specifications, including
+<b>--newer</b> and <b>--newer-mtime</b> switches accept a
+variety of common date and time specifications, including
’’12 Mar 2005 7:14:29pm’’,
’’2005-03-12 19:14’’,
’’5 minutes ago’’, and
@@ -1086,22 +1107,21 @@
’’19:14 PST May 1’’.</p>
<p style="margin-left:6%; margin-top: 1em">The
-<b>−−options</b> argument can be used to control
-various details of archive generation or reading. For
-example, you can generate mtree output which only contains
-<b>type</b>, <b>time</b>, and <b>uid</b> keywords:</p>
+<b>--options</b> argument can be used to control various
+details of archive generation or reading. For example, you
+can generate mtree output which only contains <b>type</b>,
+<b>time</b>, and <b>uid</b> keywords:</p>
-<p style="margin-left:14%;"><b>tar −cf</b>
-<i>file.tar</i> <b>−−format=mtree
-−−options=’!all,type,time,uid’</b>
+<p style="margin-left:14%;"><b>tar -cf</b> <i>file.tar</i>
+<b>--format=mtree
+--options=’!all,type,time,uid’</b>
<i>dir</i></p>
<p style="margin-left:6%;">or you can set the compression
level used by gzip or xz compression:</p>
-<p style="margin-left:14%;"><b>tar −czf</b>
-<i>file.tar</i>
-<b>−−options=’compression-level=9’</b>.</p>
+<p style="margin-left:14%;"><b>tar -czf</b> <i>file.tar</i>
+<b>--options=’compression-level=9’</b>.</p>
<p style="margin-left:6%;">For more details, see the
explanation of the <b>archive_read_set_options</b>() and
@@ -1180,28 +1200,27 @@
guard against this, <b>tar</b> checks each extracted path
for symlinks. If the final path element is a symlink, it
will be removed and replaced with the archive entry. If
-<b>−U</b> is specified, any intermediate symlink will
-also be unconditionally removed. If neither <b>−U</b>
-nor <b>−P</b> is specified, <b>tar</b> will refuse to
-extract the entry.</p>
+<b>-U</b> is specified, any intermediate symlink will also
+be unconditionally removed. If neither <b>-U</b> nor
+<b>-P</b> is specified, <b>tar</b> will refuse to extract
+the entry.</p>
<p style="margin-left:6%;">To protect yourself, you should
be wary of any archives that come from untrusted sources.
You should examine the contents of an archive with</p>
-<p style="margin-left:14%;"><b>tar −tf</b>
+<p style="margin-left:14%;"><b>tar -tf</b>
<i>filename</i></p>
<p style="margin-left:6%;">before extraction. You should
-use the <b>−k</b> option to ensure that <b>tar</b>
-will not overwrite any existing files or the <b>−U</b>
-option to remove any pre-existing files. You should
-generally not extract archives while running with super-user
-privileges. Note that the <b>−P</b> option to
-<b>tar</b> disables the security checks above and allows you
-to extract an archive while preserving any absolute
-pathnames, <i>..</i> components, or symlinks to other
-directories.</p>
+use the <b>-k</b> option to ensure that <b>tar</b> will not
+overwrite any existing files or the <b>-U</b> option to
+remove any pre-existing files. You should generally not
+extract archives while running with super-user privileges.
+Note that the <b>-P</b> option to <b>tar</b> disables the
+security checks above and allows you to extract an archive
+while preserving any absolute pathnames, <i>..</i>
+components, or symlinks to other directories.</p>
<p style="margin-top: 1em"><b>SEE ALSO</b></p>
@@ -1246,12 +1265,12 @@
<p style="margin-left:6%;">This program follows ISO/IEC
9945-1:1996 (’’POSIX.1’’) for the
-definition of the <b>−l</b> option. Note that GNU tar
-prior to version 1.15 treated <b>−l</b> as a synonym
-for the <b>−−one-file-system</b> option.</p>
+definition of the <b>-l</b> option. Note that GNU tar prior
+to version 1.15 treated <b>-l</b> as a synonym for the
+<b>--one-file-system</b> option.</p>
-<p style="margin-left:6%; margin-top: 1em">The
-<b>−C</b> <i>dir</i> option may differ from historic
+<p style="margin-left:6%; margin-top: 1em">The <b>-C</b>
+<i>dir</i> option may differ from historic
implementations.</p>
<p style="margin-left:6%; margin-top: 1em">All archive
@@ -1273,13 +1292,13 @@
insignificant differences between the compressed output
generated by</p>
-<p style="margin-left:14%;"><b>tar −czf</b> <i>-
+<p style="margin-left:14%;"><b>tar -czf</b> <i>-
file</i></p>
<p style="margin-left:6%;">and that generated by</p>
-<p style="margin-left:14%;"><b>tar −cf</b> <i>-
-file</i> | <b>gzip</b></p>
+<p style="margin-left:14%;"><b>tar -cf</b> <i>- file</i> |
+<b>gzip</b></p>
<p style="margin-left:6%; margin-top: 1em">The default
should be to read and write archives to the standard I/O
@@ -1297,7 +1316,7 @@
<p style="margin-left:6%; margin-top: 1em">In create mode,
a leading <i>./</i> is always removed. A leading <i>/</i> is
-stripped unless the <b>−P</b> option is specified.</p>
+stripped unless the <b>-P</b> option is specified.</p>
<p style="margin-left:6%; margin-top: 1em">There needs to
be better support for file selection on both create and
@@ -1314,7 +1333,7 @@
hardlink information.)</p>
<p style="margin-left:6%; margin-top: 1em">BSD
-September 16, 2014 BSD</p>
+February 25, 2017 BSD</p>
<hr>
</body>
</html>
Modified: trunk/contrib/libarchive/doc/html/cpio.5.html
===================================================================
--- trunk/contrib/libarchive/doc/html/cpio.5.html 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/html/cpio.5.html 2018-06-19 20:42:35 UTC (rev 11134)
@@ -1,5 +1,5 @@
<!-- Creator : groff version 1.22.3 -->
-<!-- CreationDate: Sun Jun 19 19:54:08 2016 -->
+<!-- CreationDate: Mon Jul 10 02:32:57 2017 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
Modified: trunk/contrib/libarchive/doc/html/libarchive-formats.5.html
===================================================================
--- trunk/contrib/libarchive/doc/html/libarchive-formats.5.html 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/html/libarchive-formats.5.html 2018-06-19 20:42:35 UTC (rev 11134)
@@ -1,5 +1,5 @@
<!-- Creator : groff version 1.22.3 -->
-<!-- CreationDate: Sun Jun 19 19:54:09 2016 -->
+<!-- CreationDate: Mon Jul 10 02:32:57 2017 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
@@ -236,9 +236,7 @@
<p style="margin-top: 1em">Solaris extensions</p>
<p style="margin-left:17%;">Libarchive recognizes ACL and
-extended attribute records written by Solaris tar.
-Currently, libarchive only has support for old-style ACLs;
-the newer NFSv4 ACLs are recognized but discarded.</p>
+extended attribute records written by Solaris tar.</p>
<p style="margin-left:6%; margin-top: 1em">The first tar
program appeared in Seventh Edition Unix in 1979. The first
@@ -500,7 +498,7 @@
tar(5)</p>
<p style="margin-left:6%; margin-top: 1em">BSD
-March 18, 2012 BSD</p>
+December 27, 2016 BSD</p>
<hr>
</body>
</html>
Modified: trunk/contrib/libarchive/doc/html/libarchive.3.html
===================================================================
--- trunk/contrib/libarchive/doc/html/libarchive.3.html 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/html/libarchive.3.html 2018-06-19 20:42:35 UTC (rev 11134)
@@ -1,5 +1,5 @@
<!-- Creator : groff version 1.22.3 -->
-<!-- CreationDate: Sun Jun 19 19:54:09 2016 -->
+<!-- CreationDate: Mon Jul 10 02:32:57 2017 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
Modified: trunk/contrib/libarchive/doc/html/libarchive_changes.3.html
===================================================================
--- trunk/contrib/libarchive/doc/html/libarchive_changes.3.html 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/html/libarchive_changes.3.html 2018-06-19 20:42:35 UTC (rev 11134)
@@ -1,5 +1,5 @@
<!-- Creator : groff version 1.22.3 -->
-<!-- CreationDate: Sun Jun 19 19:54:09 2016 -->
+<!-- CreationDate: Mon Jul 10 02:32:57 2017 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
@@ -25,8 +25,8 @@
<p style="margin-top: 1em"><b>NAME</b></p>
-<p style="margin-left:6%;">— changes in libarchive
-interface</p>
+<p style="margin-left:6%;"><b>libarchive_changes</b>
+— changes in libarchive interface</p>
<p style="margin-top: 1em"><b>CHANGES IN LIBARCHIVE
3</b></p>
Modified: trunk/contrib/libarchive/doc/html/libarchive_internals.3.html
===================================================================
--- trunk/contrib/libarchive/doc/html/libarchive_internals.3.html 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/html/libarchive_internals.3.html 2018-06-19 20:42:35 UTC (rev 11134)
@@ -1,5 +1,5 @@
<!-- Creator : groff version 1.22.3 -->
-<!-- CreationDate: Sun Jun 19 19:54:09 2016 -->
+<!-- CreationDate: Mon Jul 10 02:32:57 2017 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
Modified: trunk/contrib/libarchive/doc/html/mtree.5.html
===================================================================
--- trunk/contrib/libarchive/doc/html/mtree.5.html 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/html/mtree.5.html 2018-06-19 20:42:35 UTC (rev 11134)
@@ -1,5 +1,5 @@
<!-- Creator : groff version 1.22.3 -->
-<!-- CreationDate: Sun Jun 19 19:54:09 2016 -->
+<!-- CreationDate: Mon Jul 10 02:32:57 2017 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
@@ -43,10 +43,10 @@
<p style="margin-left:6%; margin-top: 1em">When encoding
file or pathnames, any backslash character or character
outside of the 95 printable ASCII characters must be encoded
-as a a backslash followed by three octal digits. When
-reading mtree files, any appearance of a backslash followed
-by three octal digits should be converted into the
-corresponding character.</p>
+as a backslash followed by three octal digits. When reading
+mtree files, any appearance of a backslash followed by three
+octal digits should be converted into the corresponding
+character.</p>
<p style="margin-left:6%; margin-top: 1em">Each line is
interpreted independently as one of the following types:</p>
@@ -367,15 +367,15 @@
HISTORY</b></p>
<p style="margin-left:6%;">The <b>mtree</b> utility
-appeared in 4.3BSD−Reno. The MD5 digest capability was
-added in FreeBSD 2.1, in response to the widespread use
-of programs which can spoof cksum(1). The SHA-1 and
-RIPEMD160 digests were added in FreeBSD 4.0, as new
-attacks have demonstrated weaknesses in MD5. The SHA-256
-digest was added in FreeBSD 6.0. Support for file flags
-was added in FreeBSD 4.0, and mostly comes from NetBSD.
-The ’’full’’ entry format was added
-by NetBSD.</p>
+appeared in 4.3BSD-Reno. The MD5 digest capability was added
+in FreeBSD 2.1, in response to the widespread use of
+programs which can spoof cksum(1). The SHA-1 and RIPEMD160
+digests were added in FreeBSD 4.0, as new attacks have
+demonstrated weaknesses in MD5. The SHA-256 digest was added
+in FreeBSD 6.0. Support for file flags was added in
+FreeBSD 4.0, and mostly comes from NetBSD. The
+’’full’’ entry format was added by
+NetBSD.</p>
<p style="margin-left:6%; margin-top: 1em">BSD
September 4, 2013 BSD</p>
Modified: trunk/contrib/libarchive/doc/html/tar.5.html
===================================================================
--- trunk/contrib/libarchive/doc/html/tar.5.html 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/html/tar.5.html 2018-06-19 20:42:35 UTC (rev 11134)
@@ -1,5 +1,5 @@
<!-- Creator : groff version 1.22.3 -->
-<!-- CreationDate: Sun Jun 19 19:54:09 2016 -->
+<!-- CreationDate: Mon Jul 10 02:32:58 2017 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
@@ -692,16 +692,17 @@
by Joerg Schilling’s <b>star</b> implementation.</p>
<p style="margin-top: 1em"><b>SCHILY.acl.access</b>,
-<b>SCHILY.acl.default</b></p>
+<b>SCHILY.acl.default, SCHILY.acl.ace</b></p>
-<p style="margin-left:17%;">Stores the access and default
-ACLs as textual strings in a format that is an extension of
-the format specified by POSIX.1e draft 17. In particular,
-each user or group access specification can include a fourth
-colon-separated field with the numeric UID or GID. This
-allows ACLs to be restored on systems that may not have
-complete user or group information available (such as when
-NIS/YP or LDAP services are temporarily unavailable).</p>
+<p style="margin-left:17%;">Stores the access, default and
+NFSv4 ACLs as textual strings in a format that is an
+extension of the format specified by POSIX.1e draft 17. In
+particular, each user or group access specification can
+include an additional colon-separated field with the numeric
+UID or GID. This allows ACLs to be restored on systems that
+may not have complete user or group information available
+(such as when NIS/YP or LDAP services are temporarily
+unavailable).</p>
<p style="margin-top: 1em"><b>SCHILY.devminor</b>,
<b>SCHILY.devmajor</b></p>
@@ -1283,12 +1284,11 @@
archives</b> <br>
GNU tar 1.14 (XXX check this XXX) and later will write pax
interchange format archives when you specify the
-<b>−-posix</b> flag. This format follows the pax
-interchange format closely, using some <b>SCHILY</b> tags
-and introducing new keywords to store sparse file
-information. There have been three iterations of the sparse
-file support, referred to as
-’’0.0’’,
+<b>--posix</b> flag. This format follows the pax interchange
+format closely, using some <b>SCHILY</b> tags and
+introducing new keywords to store sparse file information.
+There have been three iterations of the sparse file support,
+referred to as ’’0.0’’,
’’0.1’’, and
’’1.0’’.</p>
@@ -1552,7 +1552,7 @@
<kientzle at FreeBSD.org>.</p>
<p style="margin-left:6%; margin-top: 1em">BSD
-December 23, 2011 BSD</p>
+December 27, 2016 BSD</p>
<hr>
</body>
</html>
Modified: trunk/contrib/libarchive/doc/man/archive_entry.3
===================================================================
--- trunk/contrib/libarchive/doc/man/archive_entry.3 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/man/archive_entry.3 2018-06-19 20:42:35 UTC (rev 11134)
@@ -1,4 +1,4 @@
-.TH ARCHIVE_ENTRY 3 "Feburary 2, 2012" ""
+.TH ARCHIVE_ENTRY 3 "February 2, 2012" ""
.SH NAME
.ad l
\fB\%archive_entry_clear\fP,
Modified: trunk/contrib/libarchive/doc/man/archive_entry_acl.3
===================================================================
--- trunk/contrib/libarchive/doc/man/archive_entry_acl.3 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/man/archive_entry_acl.3 2018-06-19 20:42:35 UTC (rev 11134)
@@ -1,4 +1,4 @@
-.TH ARCHIVE_ENTRY_ACL 3 "February 2, 2012" ""
+.TH ARCHIVE_ENTRY_ACL 3 "February 15, 2017" ""
.SH NAME
.ad l
\fB\%archive_entry_acl_add_entry\fP,
@@ -5,10 +5,14 @@
\fB\%archive_entry_acl_add_entry_w\fP,
\fB\%archive_entry_acl_clear\fP,
\fB\%archive_entry_acl_count\fP,
+\fB\%archive_entry_acl_from_text\fP,
+\fB\%archive_entry_acl_from_text_w\fP,
\fB\%archive_entry_acl_next\fP,
\fB\%archive_entry_acl_next_w\fP,
\fB\%archive_entry_acl_reset\fP,
-\fB\%archive_entry_acl_text_w\fP
+\fB\%archive_entry_acl_to_text\fP,
+\fB\%archive_entry_acl_to_text_w\fP,
+\fB\%archive_entry_acl_types\fP
\- functions for manipulating Access Control Lists in archive entry descriptions
.SH LIBRARY
.ad l
@@ -35,6 +39,14 @@
.br
\fIint\fP
.br
+\fB\%archive_entry_acl_from_text\fP(\fI\%struct\ archive_entry\ *a\fP, \fI\%const\ char\ *text\fP, \fI\%int\ type\fP);
+.br
+\fIint\fP
+.br
+\fB\%archive_entry_acl_from_text_w\fP(\fI\%struct\ archive_entry\ *a\fP, \fI\%const\ wchar_t\ *text\fP, \fI\%int\ type\fP);
+.br
+\fIint\fP
+.br
\fB\%archive_entry_acl_next\fP(\fI\%struct\ archive_entry\ *a\fP, \fI\%int\ type\fP, \fI\%int\ *ret_type\fP, \fI\%int\ *ret_permset\fP, \fI\%int\ *ret_tag\fP, \fI\%int\ *ret_qual\fP, \fI\%const\ char\ **ret_name\fP);
.br
\fIint\fP
@@ -45,54 +57,60 @@
.br
\fB\%archive_entry_acl_reset\fP(\fI\%struct\ archive_entry\ *a\fP, \fI\%int\ type\fP);
.br
-\fIconst wchar_t *\fP
+\fIchar *\fP
.br
-\fB\%archive_entry_acl_text_w\fP(\fI\%struct\ archive_entry\ *a\fP, \fI\%int\ flags\fP);
+\fB\%archive_entry_acl_to_text\fP(\fI\%struct\ archive_entry\ *a\fP, \fI\%ssize_t\ *len_p\fP, \fI\%int\ flags\fP);
+.br
+\fIwchar_t *\fP
+.br
+\fB\%archive_entry_acl_to_text_w\fP(\fI\%struct\ archive_entry\ *a\fP, \fI\%ssize_t\ *len_p\fP, \fI\%int\ flags\fP);
+.br
+\fIint\fP
+.br
+\fB\%archive_entry_acl_types\fP(\fI\%struct\ archive_entry\ *a\fP);
.SH DESCRIPTION
.ad l
-An
-``Access Control List''
-is a generalisation of the classic Unix permission system.
+The
+``Access Control Lists (ACLs)''
+extend the standard Unix perssion model.
The ACL interface of
\fB\%libarchive\fP
-is derived from the POSIX.1e draft, but restricted to simplify dealing
-with practical implementations in various Operating Systems and archive formats.
-.PP
-An ACL consists of a number of independent entries.
+supports both POSIX.1e and NFSv4 style ACLs. Use of ACLs is restricted by
+various levels of ACL support in operating systems, file systems and archive
+formats.
+.SS POSIX.1e Access Control Lists
+A POSIX.1e ACL consists of a number of independent entries.
Each entry specifies the permission set as bitmask of basic permissions.
-Valid permissions are:
+Valid permissions in the
+are:
.RS 5
.TP
-.BR ARCHIVE_ENTRY_ACL_EXECUTE
+.BR ARCHIVE_ENTRY_ACL_READ (.B r )
.TP
-.BR ARCHIVE_ENTRY_ACL_WRITE
+.BR ARCHIVE_ENTRY_ACL_WRITE (.B w )
.TP
-.BR ARCHIVE_ENTRY_ACL_READ
+.BR ARCHIVE_ENTRY_ACL_EXECUTE (.B x )
.RE
The permissions correspond to the normal Unix permissions.
.PP
-The tag specifies the principal to which the permission applies.
+The
+specifies the principal to which the permission applies.
Valid values are:
.RS 5
-.TP
-.BR ARCHIVE_ENTRY_ACL_USER
+It .BR ARCHIVE_ENTRY_ACL_USER
The user specified by the name field.
-.TP
-.BR ARCHIVE_ENTRY_ACL_USER_OBJ
+It .BR ARCHIVE_ENTRY_ACL_USER_OBJ
The owner of the file.
-.TP
-.BR ARCHIVE_ENTRY_ACL_GROUP
+It .BR ARCHIVE_ENTRY_ACL_GROUP
The group specied by the name field.
-.TP
-.BR ARCHIVE_ENTRY_ACL_GROUP_OBJ
+It .BR ARCHIVE_ENTRY_ACL_GROUP_OBJ
The group who owns the file.
-.TP
-.BR ARCHIVE_ENTRY_ACL_MASK
+It .BR ARCHIVE_ENTRY_ACL_MASK
The maximum permissions to be obtained via group permissions.
-.TP
-.BR ARCHIVE_ENTRY_ACL_OTHER
-Any principal who doesn't have a user or group entry.
+It .BR ARCHIVE_ENTRY_ACL_OTHER
+Any principal who is not file owner or a member of the owning group.
.RE
+.PP
The principals
.BR ARCHIVE_ENTRY_ACL_USER_OBJ,
.BR ARCHIVE_ENTRY_ACL_GROUP_OBJ
@@ -101,19 +119,143 @@
are equivalent to user, group and other in the classic Unix permission
model and specify non-extended ACL entries.
.PP
-All files have an access ACL
+All files with have an access ACL
(.BR ARCHIVE_ENTRY_ACL_TYPE_ACCESS.)
This specifies the permissions required for access to the file itself.
Directories have an additional ACL
(.BR ARCHIVE_ENTRY_ACL_TYPE_DEFAULT,)
which controls the initial access ACL for newly created directory entries.
+.SS NFSv4 Access Control Lists
+A NFSv4 ACL consists of multiple individual entries called Access Control
+Entries (ACEs).
.PP
+There are four possible types of a NFSv4 ACE:
+.RS 5
+It .BR ARCHIVE_ENTRY_ACL_TYPE_ALLOW
+Allow principal to perform actions requiring given permissions.
+It .BR ARCHIVE_ENTRY_ACL_TYPE_DENY
+Prevent principal from performing actions requiring given permissions.
+It .BR ARCHIVE_ENTRY_ACL_TYPE_AUDIT
+Log access attempts by principal which require given permissions.
+It .BR ARCHIVE_ENTRY_ACL_TYPE_ALARM
+Trigger a system alarm on access attempts by principal which require given
+permissions.
+.RE
+.PP
+The
+specifies the principal to which the permission applies.
+Valid values are:
+.RS 5
+It .BR ARCHIVE_ENTRY_ACL_USER
+The user specified by the name field.
+It .BR ARCHIVE_ENTRY_ACL_USER_OBJ
+The owner of the file.
+It .BR ARCHIVE_ENTRY_ACL_GROUP
+The group specied by the name field.
+It .BR ARCHIVE_ENTRY_ACL_GROUP_OBJ
+The group who owns the file.
+It .BR ARCHIVE_ENTRY_ACL_EVERYONE
+Any principal who is not file owner or a member of the owning group.
+.RE
+.PP
+Entries with the
+.BR ARCHIVE_ENTRY_ACL_USER
+or
+.BR ARCHIVE_ENTRY_ACL_GROUP
+tag store the user and group name in the
+string and optionally the user or group ID in the
+integer.
+.PP
+NFSv4 ACE permissions and flags are stored in the same
+bitfield. Some permissions share the same constant and permission character but
+have different effect on directories than on files. The following ACE
+permissions are supported:
+.RS 5
+.TP
+.BR ARCHIVE_ENTRY_ACL_READ_DATA (.B r )
+Read data (file).
+.TP
+.BR ARCHIVE_ENTRY_ACL_LIST_DIRECTORY (.B r )
+List entries (directory).
+.TP
+ARCHIVE_ENTRY_ACL_WRITE_DATA (.B w )
+Write data (file).
+.TP
+ARCHIVE_ENTRY_ACL_ADD_FILE (.B w )
+Create files (directory).
+.TP
+.BR ARCHIVE_ENTRY_ACL_EXECUTE (.B x )
+Execute file or change into a directory.
+.TP
+.BR ARCHIVE_ENTRY_ACL_APPEND_DATA (.B p )
+Append data (file).
+.TP
+.BR ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY (.B p )
+Create subdirectories (directory).
+.TP
+.BR ARCHIVE_ENTRY_ACL_DELETE_CHILD (.B D )
+Remove files and subdirectories inside a directory.
+.TP
+.BR ARCHIVE_ENTRY_ACL_DELETE (.B d )
+Remove file or directory.
+.TP
+.BR ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES (.B a )
+Read file or directory attributes.
+.TP
+.BR ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES (.B A )
+Write file or directory attributes.
+.TP
+.BR ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS (.B R )
+Read named file or directory attributes.
+.TP
+.BR ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS (.B W )
+Write named file or directory attributes.
+.TP
+.BR ARCHIVE_ENTRY_ACL_READ_ACL (.B c )
+Read file or directory ACL.
+.TP
+.BR ARCHIVE_ENTRY_ACL_WRITE_ACL (.B C )
+Write file or directory ACL.
+.TP
+.BR ARCHIVE_ENTRY_ACL_WRITE_OWNER (.B o )
+Change owner of a file or directory.
+.TP
+.BR ARCHIVE_ENTRY_ACL_SYNCHRONIZE (.B s )
+Use synchronous I/O.
+.RE
+.PP
+The following NFSv4 ACL inheritance flags are supported:
+.RS 5
+.TP
+.BR ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT (.B f )
+Inherit parent directory ACE to files.
+.TP
+.BR ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT (.B d )
+Inherit parent directory ACE to subdirectories.
+.TP
+.BR ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY (.B i )
+Only inherit, do not apply the permission on the directory itself.
+.TP
+.BR ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT (.B n )
+Do not propagate inherit flags. Only first-level entries inherit ACLs.
+.TP
+.BR ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS (.B S )
+Trigger alarm or audit on successful access.
+.TP
+.BR ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS (.B F )
+Trigger alarm or audit on failed access.
+.TP
+.BR ARCHIVE_ENTRY_ACL_ENTRY_INHERITED (.B I )
+Mark that ACE was inherited.
+.RE
+.SS Functions
\fB\%archive_entry_acl_add_entry\fP()
and
\fB\%archive_entry_acl_add_entry_w\fP()
add a single ACL entry.
For the access ACL and non-extended principals, the classic Unix permissions
-are updated.
+are updated. An archive entry cannot contain both POSIX.1e and NFSv4 ACL
+entries.
.PP
\fB\%archive_entry_acl_clear\fP()
removes all ACL entries and resets the enumeration pointer.
@@ -121,14 +263,65 @@
\fB\%archive_entry_acl_count\fP()
counts the ACL entries that have the given type mask.
can be the bitwise-or of
+.RS 5
+.TP
.BR ARCHIVE_ENTRY_ACL_TYPE_ACCESS
-and
-.BR ARCHIVE_ENTRY_ACL_TYPE_DEFAULT.
-If
+.TP
+.BR ARCHIVE_ENTRY_ACL_TYPE_DEFAULT
+.RE
+for POSIX.1e ACLs and
+.RS 5
+.TP
+.BR ARCHIVE_ENTRY_ACL_TYPE_ALLOW
+.TP
+.BR ARCHIVE_ENTRY_ACL_TYPE_DENY
+.TP
+.BR ARCHIVE_ENTRY_ACL_TYPE_AUDIT
+.TP
+.BR ARCHIVE_ENTRY_ACL_TYPE_ALARM
+.RE
+for NFSv4 ACLs. For POSIX.1e ACLs if
.BR ARCHIVE_ENTRY_ACL_TYPE_ACCESS
is included and at least one extended ACL entry is found,
-the three non-extened ACLs are added.
+the three non-extended ACLs are added.
.PP
+\fB\%archive_entry_acl_from_text\fP()
+and
+\fB\%archive_entry_acl_from_text_w\fP()
+add new
+(or merge with existing)
+ACL entries from
+(wide)
+text. The argument
+may take one of the following values:
+.RS 5
+.TP
+.BR ARCHIVE_ENTRY_ACL_TYPE_ACCESS
+.TP
+.BR ARCHIVE_ENTRY_ACL_TYPE_DEFAULT
+.TP
+.BR ARCHIVE_ENTRY_ACL_TYPE_NFS4
+.RE
+Supports all formats that can be created with
+\fB\%archive_entry_acl_to_text\fP()
+or respective
+\fB\%archive_entry_acl_to_text_w\fP().
+Existing ACL entries are preserved. To get a clean new ACL from text
+\fB\%archive_entry_acl_clear\fP()
+must be called first. Entries prefixed with
+``default:''
+are treated as
+.BR ARCHIVE_ENTRY_ACL_TYPE_DEFAULT
+unless
+is
+.BR ARCHIVE_ENTRY_ACL_TYPE_NFS4.
+Invalid entries, non-parseable ACL entries and entries beginning with
+the
+Sq #
+character
+(comments)
+are skipped.
+.PP
\fB\%archive_entry_acl_next\fP()
and
\fB\%archive_entry_acl_next_w\fP()
@@ -150,19 +343,67 @@
Otherwise, the function returns the same value as
\fB\%archive_entry_acl_count\fP().
.PP
-\fB\%archive_entry_acl_text_w\fP()
-converts the ACL entries for the given type mask into a wide string.
-In addition to the normal type flags,
-.BR ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID
+\fB\%archive_entry_acl_to_text\fP()
and
+\fB\%archive_entry_acl_to_text_w\fP()
+convert the ACL entries for the given type into a
+(wide)
+string of ACL entries separated by newline. If the pointer
+is not NULL, then the function shall return the length of the string
+(not including the NULL terminator)
+in the location pointed to by
+.
+The
+argument is a bitwise-or.
+.PP
+The following flags are effective only on POSIX.1e ACL:
+.RS 5
+.TP
+.BR ARCHIVE_ENTRY_ACL_TYPE_ACCESS
+Output access ACLs.
+.TP
+.BR ARCHIVE_ENTRY_ACL_TYPE_DEFAULT
+Output POSIX.1e default ACLs.
+.TP
.BR ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT
-can be specified to further customize the result.
-The returned long string is valid until the next call to
-\fB\%archive_entry_acl_clear\fP(),
-\fB\%archive_entry_acl_add_entry\fP(),
-\fB\%archive_entry_acl_add_entry_w\fP()
+Prefix each default ACL entry with the word
+``default:''.
+.TP
+.BR ARCHIVE_ENTRY_ACL_STYLE_SOLARIS
+The mask and other ACLs don not contain a double colon.
+.RE
+.PP
+The following flags are effecive only on NFSv4 ACL:
+.RS 5
+.TP
+.BR ARCHIVE_ENTRY_ACL_STYLE_COMPACT
+Do not output minus characters for unset permissions and flags in NFSv4 ACL
+permission and flag fields.
+.RE
+.PP
+The following flags are effective on both POSIX.1e and NFSv4 ACL:
+.RS 5
+.TP
+.BR ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID
+Add an additional colon-separated field containing the user or group id.
+.TP
+.BR ARCHIVE_ENTRY_ACL_STYLE_SEPARATOR_COMMA
+Separate ACL entries with comma instead of newline.
+.RE
+.PP
+If the archive entry contains NFSv4 ACLs, all types of NFSv4 ACLs are returned.
+It the entry contains POSIX.1e ACLs and none of the flags
+.BR ARCHIVE_ENTRY_ACL_TYPE_ACCESS
or
-\fB\%archive_entry_acl_text_w\fP().
+.BR ARCHIVE_ENTRY_ACL_TYPE_DEFAULT
+are specified, both access and default entries are returned and default entries
+are prefixed with
+``default:''.
+.PP
+\fB\%archive_entry_acl_types\fP()
+get ACL entry types contained in an archive entry's ACL. As POSIX.1e and NFSv4
+ACL entries cannot be mixed, this function is a very efficient way to detect if
+an ACL already contains POSIX.1e or NFSv4 ACL entries.
.SH RETURN VALUES
.ad l
\fB\%archive_entry_acl_count\fP()
@@ -169,11 +410,20 @@
and
\fB\%archive_entry_acl_reset\fP()
returns the number of ACL entries that match the given type mask.
-If the type mask includes
+For POSIX.1e ACLS if the type mask includes
.BR ARCHIVE_ENTRY_ACL_TYPE_ACCESS
and at least one extended ACL entry exists, the three classic Unix
permissions are counted.
.PP
+\fB\%archive_entry_acl_from_text\fP()
+and
+\fB\%archive_entry_acl_from_text_w\fP()
+return
+.BR ARCHIVE_OK
+if all entries were successfully parsed and
+.BR ARCHIVE_WARN
+if one or more entries were invalid or non-parseable.
+.PP
\fB\%archive_entry_acl_next\fP()
and
\fB\%archive_entry_acl_next_w\fP()
@@ -188,22 +438,17 @@
\fB\%archive_entry_acl_reset\fP()
has not been called first.
.PP
-\fB\%archive_entry_text_w\fP()
-returns a wide string representation of the ACL entrise matching the
-given type mask.
-The returned long string is valid until the next call to
-\fB\%archive_entry_acl_clear\fP(),
-\fB\%archive_entry_acl_add_entry\fP(),
-\fB\%archive_entry_acl_add_entry_w\fP()
-or
-\fB\%archive_entry_acl_text_w\fP().
+\fB\%archive_entry_acl_to_text\fP()
+returns a string representing the ACL entries matching the given type and
+flags on success or NULL on error.
+.PP
+\fB\%archive_entry_acl_to_text_w\fP()
+returns a wide string representing the ACL entries matching the given type
+and flags on success or NULL on error.
+.PP
+\fB\%archive_entry_acl_types\fP()
+returns a bitmask of ACL entry types or 0 if archive entry has no ACL entries.
.SH SEE ALSO
.ad l
-\fBarchive_entry\fP(3)
-\fBlibarchive\fP(3),
-.SH BUGS
-.ad l
-.BR ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID
-and
-.BR ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT
-are not documented.
+\fBarchive_entry\fP(3),
+\fBlibarchive\fP(3)
Modified: trunk/contrib/libarchive/doc/man/archive_entry_paths.3
===================================================================
--- trunk/contrib/libarchive/doc/man/archive_entry_paths.3 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/man/archive_entry_paths.3 2018-06-19 20:42:35 UTC (rev 11134)
@@ -6,25 +6,25 @@
\fB\%archive_entry_set_hardlink\fP,
\fB\%archive_entry_copy_hardlink\fP,
\fB\%archive_entry_copy_hardlink_w\fP,
-\fB\%archve_entry_update_hardlink_utf8\fP,
+\fB\%archive_entry_update_hardlink_utf8\fP,
\fB\%archive_entry_set_link\fP,
\fB\%archive_entry_copy_link\fP,
\fB\%archive_entry_copy_link_w\fP,
-\fB\%archve_entry_update_link_utf8\fP,
+\fB\%archive_entry_update_link_utf8\fP,
\fB\%archive_entry_pathname\fP,
\fB\%archive_entry_pathname_w\fP,
\fB\%archive_entry_set_pathname\fP,
\fB\%archive_entry_copy_pathname\fP,
\fB\%archive_entry_copy_pathname_w\fP,
-\fB\%archve_entry_update_pathname_utf8\fP,
+\fB\%archive_entry_update_pathname_utf8\fP,
\fB\%archive_entry_sourcepath\fP,
\fB\%archive_entry_copy_sourcepath\fP,
-\fB\%archive_entry_symlink,\fP
-\fB\%archive_entry_symlink_w,\fP
+\fB\%archive_entry_symlink\fP,
+\fB\%archive_entry_symlink_w\fP,
\fB\%archive_entry_set_symlink\fP,
\fB\%archive_entry_copy_symlink\fP,
\fB\%archive_entry_copy_symlink_w\fP,
-\fB\%archve_entry_update_symlink_utf8\fP
+\fB\%archive_entry_update_symlink_utf8\fP
\- functions for manipulating path names in archive entry descriptions
.SH LIBRARY
.ad l
Modified: trunk/contrib/libarchive/doc/man/archive_entry_perms.3
===================================================================
--- trunk/contrib/libarchive/doc/man/archive_entry_perms.3 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/man/archive_entry_perms.3 2018-06-19 20:42:35 UTC (rev 11134)
@@ -8,8 +8,8 @@
\fB\%archive_entry_perm\fP,
\fB\%archive_entry_set_perm\fP,
\fB\%archive_entry_strmode\fP,
-\fB\%archive_entry_uname\fP
-\fB\%archive_entry_uname_w\fP
+\fB\%archive_entry_uname\fP,
+\fB\%archive_entry_uname_w\fP,
\fB\%archive_entry_set_uname\fP,
\fB\%archive_entry_copy_uname\fP,
\fB\%archive_entry_copy_uname_w\fP,
Modified: trunk/contrib/libarchive/doc/man/archive_read_disk.3
===================================================================
--- trunk/contrib/libarchive/doc/man/archive_read_disk.3 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/man/archive_read_disk.3 2018-06-19 20:42:35 UTC (rev 11134)
@@ -1,7 +1,8 @@
-.TH ARCHIVE_READ_DISK 3 "February 2, 2012" ""
+.TH ARCHIVE_READ_DISK 3 "April 3, 2017" ""
.SH NAME
.ad l
\fB\%archive_read_disk_new\fP,
+\fB\%archive_read_disk_set_behavior\fP,
\fB\%archive_read_disk_set_symlink_logical\fP,
\fB\%archive_read_disk_set_symlink_physical\fP,
\fB\%archive_read_disk_set_symlink_hybrid\fP,
@@ -10,10 +11,7 @@
\fB\%archive_read_disk_uname\fP,
\fB\%archive_read_disk_set_uname_lookup\fP,
\fB\%archive_read_disk_set_gname_lookup\fP,
-\fB\%archive_read_disk_set_standard_lookup\fP,
-\fB\%archive_read_close\fP,
-\fB\%archive_read_finish\fP,
-\fB\%archive_read_free\fP
+\fB\%archive_read_disk_set_standard_lookup\fP
\- functions for reading objects from disk
.SH LIBRARY
.ad l
@@ -28,6 +26,10 @@
.br
\fIint\fP
.br
+\fB\%archive_read_disk_set_behavior\fP(\fI\%struct\ archive\ *\fP, \fI\%int\fP);
+.br
+\fIint\fP
+.br
\fB\%archive_read_disk_set_symlink_logical\fP(\fI\%struct\ archive\ *\fP);
.br
\fIint\fP
@@ -38,11 +40,11 @@
.br
\fB\%archive_read_disk_set_symlink_hybrid\fP(\fI\%struct\ archive\ *\fP);
.br
-\fIint\fP
+\fIconst char *\fP
.br
\fB\%archive_read_disk_gname\fP(\fI\%struct\ archive\ *\fP, \fI\%gid_t\fP);
.br
-\fIint\fP
+\fIconst char *\fP
.br
\fB\%archive_read_disk_uname\fP(\fI\%struct\ archive\ *\fP, \fI\%uid_t\fP);
.br
@@ -61,18 +63,6 @@
\fIint\fP
.br
\fB\%archive_read_disk_entry_from_file\fP(\fI\%struct\ archive\ *\fP, \fI\%struct\ archive_entry\ *\fP, \fI\%int\ fd\fP, \fI\%const\ struct\ stat\ *\fP);
-.br
-\fIint\fP
-.br
-\fB\%archive_read_close\fP(\fI\%struct\ archive\ *\fP);
-.br
-\fIint\fP
-.br
-\fB\%archive_read_finish\fP(\fI\%struct\ archive\ *\fP);
-.br
-\fIint\fP
-.br
-\fB\%archive_read_free\fP(\fI\%struct\ archive\ *\fP);
.SH DESCRIPTION
.ad l
These functions provide an API for reading information about
@@ -87,6 +77,59 @@
Tn struct archive
object suitable for reading object information from disk.
.TP
+\fB\%archive_read_disk_set_behavior\fP()
+Configures various behavior options when reading entries from disk.
+The flags field consists of a bitwise OR of one or more of the
+following values:
+.RS 5
+.TP
+\fBARCHIVE_READDISK_HONOR_NODUMP\fP
+Skip files and directories with the nodump file attribute (file flag) set.
+By default, the nodump file atrribute is ignored.
+.TP
+\fBARCHIVE_READDISK_MAC_COPYFILE\fP
+Mac OS X specific. Read metadata (ACLs and extended attributes) with
+\fBcopyfile\fP(3).
+By default, metadata is read using
+\fBcopyfile\fP(3).
+.TP
+\fBARCHIVE_READDISK_NO_ACL\fP
+Do not read Access Control Lists.
+By default, ACLs are read from disk.
+.TP
+\fBARCHIVE_READDISK_NO_FFLAGS\fP
+Do not read file attributes (file flags).
+By default, file attributes are read from disk.
+See
+\fBchattr\fP(1)
+(Linux)
+or
+\fBchflags\fP(1)
+(FreeBSD, Mac OS X)
+for more information on file attributes.
+.TP
+\fBARCHIVE_READDISK_NO_TRAVERSE_MOUNTS\fP
+Do not traverse mount points.
+By defaut, moint points are traversed.
+.TP
+\fBARCHIVE_READDISK_NO_XATTR\fP
+Do not read extended file attributes (xattrs).
+By default, extended file attributes are read from disk.
+See
+\fBxattr\fP(7)
+(Linux,)
+\fBxattr\fP(2)
+(Mac OS X,)
+or
+\fBgetextattr\fP(8)
+(FreeBSD)
+for more information on extended file attributes.
+.TP
+\fBARCHIVE_READDISK_RESTORE_ATIME\fP
+Restore access time of traversed files.
+By default, access time of traversed files is not restored.
+.RE
+.TP
\fB\%archive_read_disk_set_symlink_logical\fP(),
\fB\%archive_read_disk_set_symlink_physical\fP(),
\fB\%archive_read_disk_set_symlink_hybrid\fP()
@@ -168,20 +211,6 @@
This affects the file ownership fields and ACL values in the
Tn struct archive_entry
object.
-.TP
-\fB\%archive_read_close\fP()
-Does nothing for
-Tn archive_read_disk
-handles.
-.TP
-\fB\%archive_read_finish\fP()
-This is a deprecated synonym for
-\fB\%archive_read_free\fP().
-.TP
-\fB\%archive_read_free\fP()
-Invokes
-\fB\%archive_read_close\fP()
-if it was not invoked manually, then releases all resources.
.RE
More information about the
\fIstruct\fP archive
Modified: trunk/contrib/libarchive/doc/man/archive_read_format.3
===================================================================
--- trunk/contrib/libarchive/doc/man/archive_read_format.3 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/man/archive_read_format.3 2018-06-19 20:42:35 UTC (rev 11134)
@@ -10,9 +10,9 @@
\fB\%archive_read_support_format_empty\fP,
\fB\%archive_read_support_format_iso9660\fP,
\fB\%archive_read_support_format_lha\fP,
-\fB\%archive_read_support_format_mtree,\fP
-\fB\%archive_read_support_format_rar,\fP
-\fB\%archive_read_support_format_raw,\fP
+\fB\%archive_read_support_format_mtree\fP,
+\fB\%archive_read_support_format_rar\fP,
+\fB\%archive_read_support_format_raw\fP,
\fB\%archive_read_support_format_tar\fP,
\fB\%archive_read_support_format_xar\fP,
\fB\%archive_read_support_format_zip\fP
Modified: trunk/contrib/libarchive/doc/man/archive_read_open.3
===================================================================
--- trunk/contrib/libarchive/doc/man/archive_read_open.3 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/man/archive_read_open.3 2018-06-19 20:42:35 UTC (rev 11134)
@@ -6,7 +6,7 @@
\fB\%archive_read_open_fd\fP,
\fB\%archive_read_open_FILE\fP,
\fB\%archive_read_open_filename\fP,
-\fB\%archive_read_open_memory\fP,
+\fB\%archive_read_open_memory\fP
\- functions for reading streaming archives
.SH LIBRARY
.ad l
@@ -37,7 +37,7 @@
.br
\fIint\fP
.br
-\fB\%archive_read_open_memory\fP(\fI\%struct\ archive\ *\fP, \fI\%void\ *buff\fP, \fI\%size_t\ size\fP);
+\fB\%archive_read_open_memory\fP(\fI\%struct\ archive\ *\fP, \fI\%const\ void\ *buff\fP, \fI\%size_t\ size\fP);
.SH DESCRIPTION
.ad l
.RS 5
Modified: trunk/contrib/libarchive/doc/man/archive_write_data.3
===================================================================
--- trunk/contrib/libarchive/doc/man/archive_write_data.3 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/man/archive_write_data.3 2018-06-19 20:42:35 UTC (rev 11134)
@@ -1,7 +1,8 @@
-.TH ARCHIVE_WRITE_DATA 3 "February 2, 2012" ""
+.TH ARCHIVE_WRITE_DATA 3 "February 28, 2017" ""
.SH NAME
.ad l
-\fB\%archive_write_data\fP
+\fB\%archive_write_data\fP,
+\fB\%archive_write_data_block\fP
\- functions for creating archives
.SH LIBRARY
.ad l
@@ -13,9 +14,32 @@
\fIla_ssize_t\fP
.br
\fB\%archive_write_data\fP(\fI\%struct\ archive\ *\fP, \fI\%const\ void\ *\fP, \fI\%size_t\fP);
+.br
+\fIla_ssize_t\fP
+.br
+\fB\%archive_write_data_block\fP(\fI\%struct\ archive\ *\fP, \fI\%const\ void\ *\fP, \fI\%size_t\ size\fP, \fI\%int64_t\ offset\fP);
.SH DESCRIPTION
.ad l
+.RS 5
+.TP
+\fB\%archive_write_data\fP()
Write data corresponding to the header just written.
+.TP
+\fB\%archive_write_data_block\fP()
+Write data corresponding to the header just written.
+This is like
+\fB\%archive_write_data\fP()
+except that it performs a seek on the file being
+written to the specified offset before writing the data.
+This is useful when restoring sparse files from archive
+formats that support sparse files.
+Returns number of bytes written or -1 on error.
+(Note: This is currently not supported for
+Tn archive_write
+handles, only for
+Tn archive_write_disk
+handles.
+.RE
.SH RETURN VALUES
.ad l
This function returns the number of bytes actually written, or
Modified: trunk/contrib/libarchive/doc/man/archive_write_disk.3
===================================================================
--- trunk/contrib/libarchive/doc/man/archive_write_disk.3 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/man/archive_write_disk.3 2018-06-19 20:42:35 UTC (rev 11134)
@@ -1,4 +1,4 @@
-.TH ARCHIVE_WRITE_DISK 3 "February 2, 2012" ""
+.TH ARCHIVE_WRITE_DISK 3 "April 3, 2017" ""
.SH NAME
.ad l
\fB\%archive_write_disk_new\fP,
@@ -6,14 +6,7 @@
\fB\%archive_write_disk_set_skip_file\fP,
\fB\%archive_write_disk_set_group_lookup\fP,
\fB\%archive_write_disk_set_standard_lookup\fP,
-\fB\%archive_write_disk_set_user_lookup\fP,
-\fB\%archive_write_header\fP,
-\fB\%archive_write_data\fP,
-\fB\%archive_write_data_block\fP,
-\fB\%archive_write_finish_entry\fP,
-\fB\%archive_write_close\fP,
-\fB\%archive_write_finish\fP
-\fB\%archive_write_free\fP
+\fB\%archive_write_disk_set_user_lookup\fP
\- functions for creating objects on disk
.SH LIBRARY
.ad l
@@ -45,34 +38,6 @@
\fIint\fP
.br
\fB\%archive_write_disk_set_user_lookup\fP(\fI\%struct\ archive\ *\fP, \fI\%void\ *\fP, \fI\%uid_t\ (*)(void\ *,\ const\ char\ *uname,\ uid_t\ uid)\fP, \fI\%void\ (*cleanup)(void\ *)\fP);
-.br
-\fIint\fP
-.br
-\fB\%archive_write_header\fP(\fI\%struct\ archive\ *\fP, \fI\%struct\ archive_entry\ *\fP);
-.br
-\fIla_ssize_t\fP
-.br
-\fB\%archive_write_data\fP(\fI\%struct\ archive\ *\fP, \fI\%const\ void\ *\fP, \fI\%size_t\fP);
-.br
-\fIla_ssize_t\fP
-.br
-\fB\%archive_write_data_block\fP(\fI\%struct\ archive\ *\fP, \fI\%const\ void\ *\fP, \fI\%size_t\ size\fP, \fI\%int64_t\ offset\fP);
-.br
-\fIint\fP
-.br
-\fB\%archive_write_finish_entry\fP(\fI\%struct\ archive\ *\fP);
-.br
-\fIint\fP
-.br
-\fB\%archive_write_close\fP(\fI\%struct\ archive\ *\fP);
-.br
-\fIint\fP
-.br
-\fB\%archive_write_finish\fP(\fI\%struct\ archive\ *\fP);
-.br
-\fIint\fP
-.br
-\fB\%archive_write_free\fP(\fI\%struct\ archive\ *\fP);
.SH DESCRIPTION
.ad l
These functions provide a complete API for creating objects on
@@ -113,6 +78,38 @@
following values:
.RS 5
.TP
+\fBARCHIVE_EXTRACT_ACL\fP
+Attempt to restore Access Control Lists.
+By default, extended ACLs are ignored.
+.TP
+\fBARCHIVE_EXTRACT_CLEAR_NOCHANGE_FFLAGS\fP
+Before removing a file system object prior to replacing it, clear
+platform-specific file flags which might prevent its removal.
+.TP
+\fBARCHIVE_EXTRACT_FFLAGS\fP
+Attempt to restore file attributes (file flags).
+By default, file attributes are ignored.
+See
+\fBchattr\fP(1)
+(Linux)
+or
+\fBchflags\fP(1)
+(FreeBSD, Mac OS X)
+for more information on file attributes.
+.TP
+\fBARCHIVE_EXTRACT_MAC_METADATA\fP
+Mac OS X specific. Restore metadata using
+\fBcopyfile\fP(3).
+By default,
+\fBcopyfile\fP(3)
+metadata is ignored.
+.TP
+\fBARCHIVE_EXTRACT_NO_OVERWRITE\fP
+Existing files on disk will not be overwritten.
+By default, existing regular files are truncated and overwritten;
+existing directories will have their permissions updated;
+other pre-existing objects are unlinked and recreated from scratch.
+.TP
\fBARCHIVE_EXTRACT_OWNER\fP
The user and group IDs should be set on the restored file.
By default, the user and group IDs are not restored.
@@ -130,37 +127,19 @@
happen to match those specified in the archive entry.
By default, only basic permissions are restored, and umask is obeyed.
.TP
-\fBARCHIVE_EXTRACT_TIME\fP
-The timestamps (mtime, ctime, and atime) should be restored.
-By default, they are ignored.
-Note that restoring of atime is not currently supported.
+\fBARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS\fP
+Refuse to extract an absolute path.
+The default is to not refuse such paths.
.TP
-\fBARCHIVE_EXTRACT_NO_OVERWRITE\fP
-Existing files on disk will not be overwritten.
-By default, existing regular files are truncated and overwritten;
-existing directories will have their permissions updated;
-other pre-existing objects are unlinked and recreated from scratch.
+\fBARCHIVE_EXTRACT_SECURE_NODOTDOT\fP
+Refuse to extract a path that contains a
+\fI\& ..\fP
+element anywhere within it.
+The default is to not refuse such paths.
+Note that paths ending in
+\fI\& ..\fP
+always cause an error, regardless of this flag.
.TP
-\fBARCHIVE_EXTRACT_UNLINK\fP
-Existing files on disk will be unlinked before any attempt to
-create them.
-In some cases, this can prove to be a significant performance improvement.
-By default, existing files are truncated and rewritten, but
-the file is not recreated.
-In particular, the default behavior does not break existing hard links.
-.TP
-\fBARCHIVE_EXTRACT_ACL\fP
-Attempt to restore ACLs.
-By default, extended ACLs are ignored.
-.TP
-\fBARCHIVE_EXTRACT_FFLAGS\fP
-Attempt to restore extended file flags.
-By default, file flags are ignored.
-.TP
-\fBARCHIVE_EXTRACT_XATTR\fP
-Attempt to restore POSIX.1e extended attributes.
-By default, they are ignored.
-.TP
\fBARCHIVE_EXTRACT_SECURE_SYMLINKS\fP
Refuse to extract any object whose final location would be altered
by a symlink on disk.
@@ -169,32 +148,41 @@
files outside of the current directory.
The default is not to perform this check.
If
+.TP
+\fBARCHIVE_EXTRACT_SPARSE\fP
+Scan data for blocks of NUL bytes and try to recreate them with holes.
+This results in sparse files, independent of whether the archive format
+supports or uses them.
\fBARCHIVE_EXTRACT_UNLINK\fP
is specified together with this option, the library will
remove any intermediate symlinks it finds and return an
error only if such symlink could not be removed.
.TP
-\fBARCHIVE_EXTRACT_SECURE_NODOTDOT\fP
-Refuse to extract a path that contains a
-\fI\& ..\fP
-element anywhere within it.
-The default is to not refuse such paths.
-Note that paths ending in
-\fI\& ..\fP
-always cause an error, regardless of this flag.
+\fBARCHIVE_EXTRACT_TIME\fP
+The timestamps (mtime, ctime, and atime) should be restored.
+By default, they are ignored.
+Note that restoring of atime is not currently supported.
.TP
-\fBARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS\fP
-Refuse to extract an absolute path.
-The default is to not refuse such paths.
+\fBARCHIVE_EXTRACT_UNLINK\fP
+Existing files on disk will be unlinked before any attempt to
+create them.
+In some cases, this can prove to be a significant performance improvement.
+By default, existing files are truncated and rewritten, but
+the file is not recreated.
+In particular, the default behavior does not break existing hard links.
.TP
-\fBARCHIVE_EXTRACT_SPARSE\fP
-Scan data for blocks of NUL bytes and try to recreate them with holes.
-This results in sparse files, independent of whether the archive format
-supports or uses them.
-.TP
-\fBARCHIVE_EXTRACT_CLEAR_NOCHANGE_FFLAGS\fP
-Before removing a file system object prior to replacing it, clear
-platform-specific file flags which might prevent its removal.
+\fBARCHIVE_EXTRACT_XATTR\fP
+Attempt to restore extended file attributes.
+By default, they are ignored.
+See
+\fBxattr\fP(7)
+(Linux,)
+\fBxattr\fP(2)
+(Mac OS X,)
+or
+\fBgetextattr\fP(8)
+(FreeBSD)
+for more information on extended file attributes.
.RE
.TP
\fB\%archive_write_disk_set_group_lookup\fP(),
@@ -231,67 +219,6 @@
\fBgetpwnam\fP(3)
and
\fBgetgrnam\fP(3).
-.TP
-\fB\%archive_write_header\fP()
-Build and write a header using the data in the provided
-Tn struct archive_entry
-structure.
-See
-\fBarchive_entry\fP(3)
-for information on creating and populating
-Tn struct archive_entry
-objects.
-.TP
-\fB\%archive_write_data\fP()
-Write data corresponding to the header just written.
-Returns number of bytes written or -1 on error.
-.TP
-\fB\%archive_write_data_block\fP()
-Write data corresponding to the header just written.
-This is like
-\fB\%archive_write_data\fP()
-except that it performs a seek on the file being
-written to the specified offset before writing the data.
-This is useful when restoring sparse files from archive
-formats that support sparse files.
-Returns number of bytes written or -1 on error.
-(Note: This is currently not supported for
-Tn archive_write
-handles, only for
-Tn archive_write_disk
-handles.)
-.TP
-\fB\%archive_write_finish_entry\fP()
-Close out the entry just written.
-Ordinarily, clients never need to call this, as it
-is called automatically by
-\fB\%archive_write_next_header\fP()
-and
-\fB\%archive_write_close\fP()
-as needed.
-However, some file attributes are written to disk only
-after the file is closed, so this can be necessary
-if you need to work with the file on disk right away.
-.TP
-\fB\%archive_write_close\fP()
-Set any attributes that could not be set during the initial restore.
-For example, directory timestamps are not restored initially because
-restoring a subsequent file would alter that timestamp.
-Similarly, non-writable directories are initially created with
-write permissions (so that their contents can be restored).
-The
-\fB\%archive_write_disk_new\fP
-library maintains a list of all such deferred attributes and
-sets them when this function is invoked.
-.TP
-\fB\%archive_write_finish\fP()
-This is a deprecated synonym for
-\fB\%archive_write_free\fP().
-.TP
-\fB\%archive_write_free\fP()
-Invokes
-\fB\%archive_write_close\fP()
-if it was not invoked manually, then releases all resources.
.RE
More information about the
\fIstruct\fP archive
Modified: trunk/contrib/libarchive/doc/man/archive_write_finish_entry.3
===================================================================
--- trunk/contrib/libarchive/doc/man/archive_write_finish_entry.3 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/man/archive_write_finish_entry.3 2018-06-19 20:42:35 UTC (rev 11134)
@@ -1,4 +1,4 @@
-.TH ARCHIVE_WRITE_FINISH_ENTRY 3 "February 2, 2012" ""
+.TH ARCHIVE_WRITE_FINISH_ENTRY 3 "February 28, 2017" ""
.SH NAME
.ad l
\fB\%archive_write_finish_entry\fP
@@ -23,6 +23,9 @@
and
\fB\%archive_write_close\fP()
as needed.
+For
+Tn archive_write_disk
+handles, this flushes pending file attribute changes like modification time.
.SH RETURN VALUES
.ad l
This function returns
Modified: trunk/contrib/libarchive/doc/man/archive_write_open.3
===================================================================
--- trunk/contrib/libarchive/doc/man/archive_write_open.3 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/man/archive_write_open.3 2018-06-19 20:42:35 UTC (rev 11134)
@@ -42,6 +42,7 @@
This is the most generic form of this function, which accepts
pointers to three callback functions which will be invoked by
the compression layer to write the constructed archive.
+This does not alter the default archive padding.
.TP
\fB\%archive_write_open_fd\fP()
A convenience form of
@@ -104,6 +105,8 @@
You should be careful to ensure that this variable
remains allocated until after the archive is
closed.
+This function will disable padding unless you
+have specifically set the block size.
.RE
More information about the
\fIstruct\fP archive
@@ -110,6 +113,13 @@
object and the overall design of the library can be found in the
\fBlibarchive\fP(3)
overview.
+.PP
+Note that the convenience forms above vary in how
+they block the output.
+See
+\fBarchive_write_blocksize\fP(3)
+if you need to control the block size used for writes
+or the end-of-file padding behavior.
.SH CLIENT CALLBACKS
.ad l
To use this library, you will need to define and register
@@ -202,6 +212,7 @@
\fBtar\fP(1),
\fBlibarchive\fP(3),
\fBarchive_write\fP(3),
+\fBarchive_write_blocksize\fP(3),
\fBarchive_write_filter\fP(3),
\fBarchive_write_format\fP(3),
\fBarchive_write_new\fP(3),
Modified: trunk/contrib/libarchive/doc/man/bsdtar.1
===================================================================
--- trunk/contrib/libarchive/doc/man/bsdtar.1 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/man/bsdtar.1 2018-06-19 20:42:35 UTC (rev 11134)
@@ -1,4 +1,4 @@
-.TH TAR 1 "September 16, 2014" ""
+.TH TAR 1 "February 25, 2017" ""
.SH NAME
.ad l
\fB\%tar\fP
@@ -110,7 +110,7 @@
.RS 5
.TP
\fB@\fP \fIarchive\fP
-(c and r mode only)
+(c and r modes only)
The specified archive is opened and the entries
in it will be appended to the current archive.
As a simple example,
@@ -168,6 +168,17 @@
if it is unknown suffix or no suffix, creates a new archive with
restricted pax format and bzip2 compression.
.TP
+\fB\-Fl\fP acls
+(c, r, u, x modes only)
+Archive or extract POSIX.1e or NFSv4 ACLs. This is the reverse of
+\fB\-Fl\fP no-acls
+and the default behavior in c, r, and u modes (except on Mac OS X) or if
+\fB\%tar\fP
+is run in x mode as root. On Mac OS X this option translates extended ACLs
+to NFSv4 ACLs. To store extended ACLs the
+\fB\-Fl\fP mac-metadata
+option is preferred.
+.TP
\fB\-B\fP, \fB\-Fl\fP read-full-blocks
Ignored for compatibility with other
\fBtar\fP(1)
@@ -197,11 +208,6 @@
Before removing file system objects to replace them, clear platform-specific
file flags that might prevent removal.
.TP
-\fB\-Fl\fP disable-copyfile
-Mac OS X specific.
-Disable the use of
-\fBcopyfile\fP(3).
-.TP
\fB\-Fl\fP exclude \fIpattern\fP
Do not process files or directories that match the
specified pattern.
@@ -208,6 +214,14 @@
Note that exclusions take precedence over patterns or filenames
specified on the command line.
.TP
+\fB\-Fl\fP fflags
+(c, r, u, x modes only)
+Archive or extract file flags. This is the reverse of
+\fB\-Fl\fP no-fflags
+and the default behavior in c, r, and u modes or if
+\fB\%tar\fP
+is run in x mode as root.
+.TP
\fB\-Fl\fP format \fIformat\fP
(c, r, u mode only)
Use the specified format for the created archive.
@@ -260,12 +274,12 @@
the name will not be verified against the system group database.
.TP
\fB\-H\fP
-(c and r mode only)
+(c and r modes only)
Symbolic links named on the command line will be followed; the
target of the link will be archived, not the link itself.
.TP
\fB\-h\fP
-(c and r mode only)
+(c and r modes only)
Synonym for
\fB\-L\fP.
.TP
@@ -278,7 +292,8 @@
.TP
\fB\-Fl\fP hfsCompression
(x mode only)
-Mac OS X specific(v10.6 or later). Compress extracted regular files with HFS+ compression.
+Mac OS X specific (v10.6 or later). Compress extracted regular files with HFS+
+compression.
.TP
\fB\-Fl\fP ignore-zeros
An alias of
@@ -338,7 +353,7 @@
versions appearing in the archive being extracted.
.TP
\fB\-L\fP, \fB\-Fl\fP dereference
-(c and r mode only)
+(c and r modes only)
All symbolic links will be followed.
Normally, symbolic links are archived as such.
With this option, the target of the link will be archived instead.
@@ -380,6 +395,17 @@
Do not extract modification time.
By default, the modification time is set to the time stored in the archive.
.TP
+\fB\-Fl\fP mac-metadata
+(c, r, u and x mode only)
+Mac OS X specific. Archive or extract extended ACLs and extended attributes
+using
+\fBcopyfile\fP(3)
+in AppleDouble format. This is the reverse of
+\fB\-Fl\fP no-mac-metadata.
+and the default behavior in c, r, and u modes or if
+\fB\%tar\fP
+is run in x mode as root.
+.TP
\fB\-n\fP, \fB\-Fl\fP norecurse, \fB\-Fl\fP no-recursion
(c, r, u modes only)
Do not recursively archive the contents of directories.
@@ -412,7 +438,7 @@
.TP
\fB\-Fl\fP nopreserveHFSCompression
(x mode only)
-Mac OS X specific(v10.6 or later). Do not compress extracted regular files
+Mac OS X specific (v10.6 or later). Do not compress extracted regular files
which were compressed with HFS+ compression before archived.
By default, compress the regular files again with HFS+ compression.
.TP
@@ -428,6 +454,34 @@
option to
\fBfind\fP(1).
.TP
+\fB\-Fl\fP no-acls
+(c, r, u, x modes only)
+Do not archive or extract POSIX.1e or NFSv4 ACLs. This is the reverse of
+\fB\-Fl\fP acls
+and the default behavior if
+\fB\%tar\fP
+is run as non-root in x mode (on Mac OS X as any user in c, r, u and x modes).
+.TP
+\fB\-Fl\fP no-fflags
+(c, r, u, x modes only)
+Do not archive or extract file flags. This is the reverse of
+\fB\-Fl\fP fflags
+and the default behavior if
+\fB\%tar\fP
+is run as non-root in x mode.
+.TP
+\fB\-Fl\fP no-mac-metadata
+(x mode only)
+Mac OS X specific. Do not archive or extract ACLs and extended attributes using
+\fBcopyfile\fP(3)
+in AppleDouble format. This is the reverse of
+\fB\-Fl\fP mac-metadata.
+and the default behavior if
+\fB\%tar\fP
+is run as non-root in x mode.
+.TP
+\fB\-n\fP, \fB\-Fl\fP norecurse, \fB\-Fl\fP no-recursion
+.TP
\fB\-Fl\fP no-same-owner
(x mode only)
Do not extract owner and group IDs.
@@ -447,6 +501,14 @@
\fB\%tar\fP
is run as non-root.
.TP
+\fB\-Fl\fP no-xattrs
+(c, r, u, x modes only)
+Do not archive or extract extended attributes. This is the reverse of
+\fB\-Fl\fP xattrs
+and the default behavior if
+\fB\%tar\fP
+is run as non-root in x mode.
+.TP
\fB\-Fl\fP numeric-owner
This is equivalent to
\fB\-Fl\fP uname
@@ -664,14 +726,18 @@
\fB\-p\fP, \fB\-Fl\fP insecure, \fB\-Fl\fP preserve-permissions
(x mode only)
Preserve file permissions.
-Attempt to restore the full permissions, including owner, file modes, file
-flags and ACLs, if available, for each item extracted from the archive.
-This is the default, if
+Attempt to restore the full permissions, including owner, file modes, ACLs,
+extended attributes and extended file flags, if available, for each item
+extracted from the archive. This is te reverse of
+\fB\-Fl\fP no-same-permissions
+and the default if
\fB\%tar\fP
-is being run by root and can be overridden by also specifying
-\fB\-Fl\fP no-same-owner
-and
-\fB\-Fl\fP no-same-permissions.
+is being run by root and can be partially overridden by also specifying
+\fB\-Fl\fP no-acls,
+\fB\-Fl\fP no-fflags,
+\fB\-Fl\fP no-mac-metadata
+or
+\fB\-Fl\fP no-xattrs.
.TP
\fB\-Fl\fP passphrase \fIpassphrase\fP
The
@@ -782,7 +848,7 @@
as well.
.TP
\fB\-Fl\fP totals
-(c, r, u mode only)
+(c, r, u modes only)
After archiving all files, print a summary to stderr.
.TP
\fB\-U\fP, \fB\-Fl\fP unlink, \fB\-Fl\fP unlink-first
@@ -853,6 +919,14 @@
\fB\-Fl\fP exclude
for more information about the handling of exclusions.
.TP
+\fB\-Fl\fP xattrs
+(c, r, u, x modes only)
+Archive or extract extended attributes. This is the reverse of
+\fB\-Fl\fP no-xattrs
+and the default behavior in c, r, and u modes or if
+\fB\%tar\fP
+is run in x mode as root.
+.TP
\fB\-y\fP
(c mode only)
Compress the resulting archive with
Modified: trunk/contrib/libarchive/doc/man/libarchive-formats.5
===================================================================
--- trunk/contrib/libarchive/doc/man/libarchive-formats.5 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/man/libarchive-formats.5 2018-06-19 20:42:35 UTC (rev 11134)
@@ -1,4 +1,4 @@
-.TH LIBARCHIVE-FORMATS 5 "March 18, 2012" ""
+.TH LIBARCHIVE-FORMATS 5 "December 27, 2016" ""
.SH NAME
.ad l
\fB\%libarchive-formats\fP
@@ -172,8 +172,6 @@
Solaris extensions
Libarchive recognizes ACL and extended attribute records written
by Solaris tar.
-Currently, libarchive only has support for old-style ACLs; the
-newer NFSv4 ACLs are recognized but discarded.
.RE
.PP
The first tar program appeared in Seventh Edition Unix in 1979.
Modified: trunk/contrib/libarchive/doc/man/libarchive_changes.3
===================================================================
--- trunk/contrib/libarchive/doc/man/libarchive_changes.3 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/man/libarchive_changes.3 2018-06-19 20:42:35 UTC (rev 11134)
@@ -1,6 +1,7 @@
.TH LIBARCHIVE_CHANGES 3 "December 23, 2011" ""
.SH NAME
.ad l
+\fB\%libarchive_changes\fP
\- changes in libarchive interface
.SH CHANGES IN LIBARCHIVE 3
.ad l
Modified: trunk/contrib/libarchive/doc/man/mtree.5
===================================================================
--- trunk/contrib/libarchive/doc/man/mtree.5 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/man/mtree.5 2018-06-19 20:42:35 UTC (rev 11134)
@@ -18,7 +18,7 @@
.PP
When encoding file or pathnames, any backslash character or
character outside of the 95 printable ASCII characters must be
-encoded as a a backslash followed by three
+encoded as a backslash followed by three
octal digits.
When reading mtree files, any appearance of a backslash
followed by three octal digits should be converted into the
Modified: trunk/contrib/libarchive/doc/man/tar.5
===================================================================
--- trunk/contrib/libarchive/doc/man/tar.5 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/man/tar.5 2018-06-19 20:42:35 UTC (rev 11134)
@@ -1,4 +1,4 @@
-.TH TAR 5 "December 23, 2011" ""
+.TH TAR 5 "December 27, 2016" ""
.SH NAME
.ad l
\fB\%tar\fP
@@ -449,11 +449,11 @@
\fB\%star\fP
implementation.
.TP
-\fBSCHILY.acl.access\fP, \fBSCHILY.acl.default\fP
-Stores the access and default ACLs as textual strings in a format
+\fBSCHILY.acl.access\fP, \fBSCHILY.acl.default,\fP \fBSCHILY.acl.ace\fP
+Stores the access, default and NFSv4 ACLs as textual strings in a format
that is an extension of the format specified by POSIX.1e draft 17.
-In particular, each user or group access specification can include a fourth
-colon-separated field with the numeric UID or GID.
+In particular, each user or group access specification can include
+an additional colon-separated field with the numeric UID or GID.
This allows ACLs to be restored on systems that may not have complete
user or group information available (such as when NIS/YP or LDAP services
are temporarily unavailable).
Modified: trunk/contrib/libarchive/doc/pdf/archive_entry.3.pdf
===================================================================
(Binary files differ)
Index: trunk/contrib/libarchive/doc/pdf/archive_entry.3.pdf
===================================================================
--- trunk/contrib/libarchive/doc/pdf/archive_entry.3.pdf 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/pdf/archive_entry.3.pdf 2018-06-19 20:42:35 UTC (rev 11134)
Property changes on: trunk/contrib/libarchive/doc/pdf/archive_entry.3.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Modified: trunk/contrib/libarchive/doc/pdf/archive_entry_acl.3.pdf
===================================================================
(Binary files differ)
Index: trunk/contrib/libarchive/doc/pdf/archive_entry_acl.3.pdf
===================================================================
--- trunk/contrib/libarchive/doc/pdf/archive_entry_acl.3.pdf 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/pdf/archive_entry_acl.3.pdf 2018-06-19 20:42:35 UTC (rev 11134)
Property changes on: trunk/contrib/libarchive/doc/pdf/archive_entry_acl.3.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Modified: trunk/contrib/libarchive/doc/pdf/archive_entry_linkify.3.pdf
===================================================================
(Binary files differ)
Index: trunk/contrib/libarchive/doc/pdf/archive_entry_linkify.3.pdf
===================================================================
--- trunk/contrib/libarchive/doc/pdf/archive_entry_linkify.3.pdf 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/pdf/archive_entry_linkify.3.pdf 2018-06-19 20:42:35 UTC (rev 11134)
Property changes on: trunk/contrib/libarchive/doc/pdf/archive_entry_linkify.3.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Modified: trunk/contrib/libarchive/doc/pdf/archive_entry_paths.3.pdf
===================================================================
(Binary files differ)
Index: trunk/contrib/libarchive/doc/pdf/archive_entry_paths.3.pdf
===================================================================
--- trunk/contrib/libarchive/doc/pdf/archive_entry_paths.3.pdf 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/pdf/archive_entry_paths.3.pdf 2018-06-19 20:42:35 UTC (rev 11134)
Property changes on: trunk/contrib/libarchive/doc/pdf/archive_entry_paths.3.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Modified: trunk/contrib/libarchive/doc/pdf/archive_entry_perms.3.pdf
===================================================================
(Binary files differ)
Index: trunk/contrib/libarchive/doc/pdf/archive_entry_perms.3.pdf
===================================================================
--- trunk/contrib/libarchive/doc/pdf/archive_entry_perms.3.pdf 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/pdf/archive_entry_perms.3.pdf 2018-06-19 20:42:35 UTC (rev 11134)
Property changes on: trunk/contrib/libarchive/doc/pdf/archive_entry_perms.3.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Modified: trunk/contrib/libarchive/doc/pdf/archive_entry_stat.3.pdf
===================================================================
(Binary files differ)
Index: trunk/contrib/libarchive/doc/pdf/archive_entry_stat.3.pdf
===================================================================
--- trunk/contrib/libarchive/doc/pdf/archive_entry_stat.3.pdf 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/pdf/archive_entry_stat.3.pdf 2018-06-19 20:42:35 UTC (rev 11134)
Property changes on: trunk/contrib/libarchive/doc/pdf/archive_entry_stat.3.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Modified: trunk/contrib/libarchive/doc/pdf/archive_entry_time.3.pdf
===================================================================
(Binary files differ)
Index: trunk/contrib/libarchive/doc/pdf/archive_entry_time.3.pdf
===================================================================
--- trunk/contrib/libarchive/doc/pdf/archive_entry_time.3.pdf 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/pdf/archive_entry_time.3.pdf 2018-06-19 20:42:35 UTC (rev 11134)
Property changes on: trunk/contrib/libarchive/doc/pdf/archive_entry_time.3.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Modified: trunk/contrib/libarchive/doc/pdf/archive_read.3.pdf
===================================================================
(Binary files differ)
Index: trunk/contrib/libarchive/doc/pdf/archive_read.3.pdf
===================================================================
--- trunk/contrib/libarchive/doc/pdf/archive_read.3.pdf 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/pdf/archive_read.3.pdf 2018-06-19 20:42:35 UTC (rev 11134)
Property changes on: trunk/contrib/libarchive/doc/pdf/archive_read.3.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Modified: trunk/contrib/libarchive/doc/pdf/archive_read_disk.3.pdf
===================================================================
(Binary files differ)
Index: trunk/contrib/libarchive/doc/pdf/archive_read_disk.3.pdf
===================================================================
--- trunk/contrib/libarchive/doc/pdf/archive_read_disk.3.pdf 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/pdf/archive_read_disk.3.pdf 2018-06-19 20:42:35 UTC (rev 11134)
Property changes on: trunk/contrib/libarchive/doc/pdf/archive_read_disk.3.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Modified: trunk/contrib/libarchive/doc/pdf/archive_read_set_options.3.pdf
===================================================================
(Binary files differ)
Index: trunk/contrib/libarchive/doc/pdf/archive_read_set_options.3.pdf
===================================================================
--- trunk/contrib/libarchive/doc/pdf/archive_read_set_options.3.pdf 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/pdf/archive_read_set_options.3.pdf 2018-06-19 20:42:35 UTC (rev 11134)
Property changes on: trunk/contrib/libarchive/doc/pdf/archive_read_set_options.3.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Modified: trunk/contrib/libarchive/doc/pdf/archive_util.3.pdf
===================================================================
(Binary files differ)
Index: trunk/contrib/libarchive/doc/pdf/archive_util.3.pdf
===================================================================
--- trunk/contrib/libarchive/doc/pdf/archive_util.3.pdf 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/pdf/archive_util.3.pdf 2018-06-19 20:42:35 UTC (rev 11134)
Property changes on: trunk/contrib/libarchive/doc/pdf/archive_util.3.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Modified: trunk/contrib/libarchive/doc/pdf/archive_write.3.pdf
===================================================================
(Binary files differ)
Index: trunk/contrib/libarchive/doc/pdf/archive_write.3.pdf
===================================================================
--- trunk/contrib/libarchive/doc/pdf/archive_write.3.pdf 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/pdf/archive_write.3.pdf 2018-06-19 20:42:35 UTC (rev 11134)
Property changes on: trunk/contrib/libarchive/doc/pdf/archive_write.3.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Modified: trunk/contrib/libarchive/doc/pdf/archive_write_disk.3.pdf
===================================================================
(Binary files differ)
Index: trunk/contrib/libarchive/doc/pdf/archive_write_disk.3.pdf
===================================================================
--- trunk/contrib/libarchive/doc/pdf/archive_write_disk.3.pdf 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/pdf/archive_write_disk.3.pdf 2018-06-19 20:42:35 UTC (rev 11134)
Property changes on: trunk/contrib/libarchive/doc/pdf/archive_write_disk.3.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Modified: trunk/contrib/libarchive/doc/pdf/archive_write_set_options.3.pdf
===================================================================
(Binary files differ)
Index: trunk/contrib/libarchive/doc/pdf/archive_write_set_options.3.pdf
===================================================================
--- trunk/contrib/libarchive/doc/pdf/archive_write_set_options.3.pdf 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/pdf/archive_write_set_options.3.pdf 2018-06-19 20:42:35 UTC (rev 11134)
Property changes on: trunk/contrib/libarchive/doc/pdf/archive_write_set_options.3.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Modified: trunk/contrib/libarchive/doc/pdf/bsdcpio.1.pdf
===================================================================
(Binary files differ)
Index: trunk/contrib/libarchive/doc/pdf/bsdcpio.1.pdf
===================================================================
--- trunk/contrib/libarchive/doc/pdf/bsdcpio.1.pdf 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/pdf/bsdcpio.1.pdf 2018-06-19 20:42:35 UTC (rev 11134)
Property changes on: trunk/contrib/libarchive/doc/pdf/bsdcpio.1.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Modified: trunk/contrib/libarchive/doc/pdf/bsdtar.1.pdf
===================================================================
(Binary files differ)
Index: trunk/contrib/libarchive/doc/pdf/bsdtar.1.pdf
===================================================================
--- trunk/contrib/libarchive/doc/pdf/bsdtar.1.pdf 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/pdf/bsdtar.1.pdf 2018-06-19 20:42:35 UTC (rev 11134)
Property changes on: trunk/contrib/libarchive/doc/pdf/bsdtar.1.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Modified: trunk/contrib/libarchive/doc/pdf/cpio.5.pdf
===================================================================
(Binary files differ)
Index: trunk/contrib/libarchive/doc/pdf/cpio.5.pdf
===================================================================
--- trunk/contrib/libarchive/doc/pdf/cpio.5.pdf 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/pdf/cpio.5.pdf 2018-06-19 20:42:35 UTC (rev 11134)
Property changes on: trunk/contrib/libarchive/doc/pdf/cpio.5.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Modified: trunk/contrib/libarchive/doc/pdf/libarchive-formats.5.pdf
===================================================================
(Binary files differ)
Index: trunk/contrib/libarchive/doc/pdf/libarchive-formats.5.pdf
===================================================================
--- trunk/contrib/libarchive/doc/pdf/libarchive-formats.5.pdf 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/pdf/libarchive-formats.5.pdf 2018-06-19 20:42:35 UTC (rev 11134)
Property changes on: trunk/contrib/libarchive/doc/pdf/libarchive-formats.5.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Modified: trunk/contrib/libarchive/doc/pdf/libarchive.3.pdf
===================================================================
(Binary files differ)
Index: trunk/contrib/libarchive/doc/pdf/libarchive.3.pdf
===================================================================
--- trunk/contrib/libarchive/doc/pdf/libarchive.3.pdf 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/pdf/libarchive.3.pdf 2018-06-19 20:42:35 UTC (rev 11134)
Property changes on: trunk/contrib/libarchive/doc/pdf/libarchive.3.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Modified: trunk/contrib/libarchive/doc/pdf/libarchive_internals.3.pdf
===================================================================
(Binary files differ)
Index: trunk/contrib/libarchive/doc/pdf/libarchive_internals.3.pdf
===================================================================
--- trunk/contrib/libarchive/doc/pdf/libarchive_internals.3.pdf 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/pdf/libarchive_internals.3.pdf 2018-06-19 20:42:35 UTC (rev 11134)
Property changes on: trunk/contrib/libarchive/doc/pdf/libarchive_internals.3.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Modified: trunk/contrib/libarchive/doc/pdf/mtree.5.pdf
===================================================================
(Binary files differ)
Index: trunk/contrib/libarchive/doc/pdf/mtree.5.pdf
===================================================================
--- trunk/contrib/libarchive/doc/pdf/mtree.5.pdf 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/pdf/mtree.5.pdf 2018-06-19 20:42:35 UTC (rev 11134)
Property changes on: trunk/contrib/libarchive/doc/pdf/mtree.5.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Modified: trunk/contrib/libarchive/doc/pdf/tar.5.pdf
===================================================================
(Binary files differ)
Index: trunk/contrib/libarchive/doc/pdf/tar.5.pdf
===================================================================
--- trunk/contrib/libarchive/doc/pdf/tar.5.pdf 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/pdf/tar.5.pdf 2018-06-19 20:42:35 UTC (rev 11134)
Property changes on: trunk/contrib/libarchive/doc/pdf/tar.5.pdf
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/pdf
\ No newline at end of property
Modified: trunk/contrib/libarchive/doc/text/archive_entry.3.txt
===================================================================
--- trunk/contrib/libarchive/doc/text/archive_entry.3.txt 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/text/archive_entry.3.txt 2018-06-19 20:42:35 UTC (rev 11134)
@@ -89,4 +89,4 @@
AUTHORS
The libarchive library was written by Tim Kientzle <kientzle at acm.org>.
-BSD Feburary 2, 2012 BSD
+BSD February 2, 2012 BSD
Modified: trunk/contrib/libarchive/doc/text/archive_entry_acl.3.txt
===================================================================
--- trunk/contrib/libarchive/doc/text/archive_entry_acl.3.txt 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/text/archive_entry_acl.3.txt 2018-06-19 20:42:35 UTC (rev 11134)
@@ -2,10 +2,12 @@
NAME
archive_entry_acl_add_entry, archive_entry_acl_add_entry_w,
- archive_entry_acl_clear, archive_entry_acl_count, archive_entry_acl_next,
- archive_entry_acl_next_w, archive_entry_acl_reset,
- archive_entry_acl_text_w — functions for manipulating Access Control
- Lists in archive entry descriptions
+ archive_entry_acl_clear, archive_entry_acl_count,
+ archive_entry_acl_from_text, archive_entry_acl_from_text_w,
+ archive_entry_acl_next, archive_entry_acl_next_w,
+ archive_entry_acl_reset, archive_entry_acl_to_text,
+ archive_entry_acl_to_text_w, archive_entry_acl_types — functions for
+ manipulating Access Control Lists in archive entry descriptions
LIBRARY
Streaming Archive Library (libarchive, -larchive)
@@ -28,6 +30,14 @@
archive_entry_acl_count(struct archive_entry *a, int type);
int
+ archive_entry_acl_from_text(struct archive_entry *a, const char *text,
+ int type);
+
+ int
+ archive_entry_acl_from_text_w(struct archive_entry *a,
+ const wchar_t *text, int type);
+
+ int
archive_entry_acl_next(struct archive_entry *a, int type, int *ret_type,
int *ret_permset, int *ret_tag, int *ret_qual,
const char **ret_name);
@@ -40,21 +50,30 @@
int
archive_entry_acl_reset(struct archive_entry *a, int type);
- const wchar_t *
- archive_entry_acl_text_w(struct archive_entry *a, int flags);
+ char *
+ archive_entry_acl_to_text(struct archive_entry *a, ssize_t *len_p,
+ int flags);
+ wchar_t *
+ archive_entry_acl_to_text_w(struct archive_entry *a, ssize_t *len_p,
+ int flags);
+
+ int
+ archive_entry_acl_types(struct archive_entry *a);
+
DESCRIPTION
- An “Access Control List” is a generalisation of the classic Unix permis‐
- sion system. The ACL interface of libarchive is derived from the
- POSIX.1e draft, but restricted to simplify dealing with practical imple‐
- mentations in various Operating Systems and archive formats.
+ The “Access Control Lists (ACLs)” extend the standard Unix perssion
+ model. The ACL interface of libarchive supports both POSIX.1e and NFSv4
+ style ACLs. Use of ACLs is restricted by various levels of ACL support in
+ operating systems, file systems and archive formats.
- An ACL consists of a number of independent entries. Each entry specifies
- the permission set as bitmask of basic permissions. Valid permissions
- are:
- ARCHIVE_ENTRY_ACL_EXECUTE
- ARCHIVE_ENTRY_ACL_WRITE
- ARCHIVE_ENTRY_ACL_READ
+ POSIX.1e Access Control Lists
+ A POSIX.1e ACL consists of a number of independent entries. Each entry
+ specifies the permission set as bitmask of basic permissions. Valid per‐
+ missions in the permset are:
+ ARCHIVE_ENTRY_ACL_READ (r)
+ ARCHIVE_ENTRY_ACL_WRITE (w)
+ ARCHIVE_ENTRY_ACL_EXECUTE (x)
The permissions correspond to the normal Unix permissions.
The tag specifies the principal to which the permission applies. Valid
@@ -65,30 +84,139 @@
ARCHIVE_ENTRY_ACL_GROUP_OBJ The group who owns the file.
ARCHIVE_ENTRY_ACL_MASK The maximum permissions to be obtained
via group permissions.
- ARCHIVE_ENTRY_ACL_OTHER Any principal who doesn't have a user
- or group entry.
+ ARCHIVE_ENTRY_ACL_OTHER Any principal who is not file owner or
+ a member of the owning group.
+
The principals ARCHIVE_ENTRY_ACL_USER_OBJ, ARCHIVE_ENTRY_ACL_GROUP_OBJ
and ARCHIVE_ENTRY_ACL_OTHER are equivalent to user, group and other in
the classic Unix permission model and specify non-extended ACL entries.
- All files have an access ACL (ARCHIVE_ENTRY_ACL_TYPE_ACCESS). This spec‐
- ifies the permissions required for access to the file itself. Directo‐
- ries have an additional ACL (ARCHIVE_ENTRY_ACL_TYPE_DEFAULT), which con‐
- trols the initial access ACL for newly created directory entries.
+ All files with have an access ACL (ARCHIVE_ENTRY_ACL_TYPE_ACCESS). This
+ specifies the permissions required for access to the file itself. Direc‐
+ tories have an additional ACL (ARCHIVE_ENTRY_ACL_TYPE_DEFAULT), which
+ controls the initial access ACL for newly created directory entries.
+ NFSv4 Access Control Lists
+ A NFSv4 ACL consists of multiple individual entries called Access Control
+ Entries (ACEs).
+
+ There are four possible types of a NFSv4 ACE:
+ ARCHIVE_ENTRY_ACL_TYPE_ALLOW Allow principal to perform actions
+ requiring given permissions.
+ ARCHIVE_ENTRY_ACL_TYPE_DENY Prevent principal from performing
+ actions requiring given permissions.
+ ARCHIVE_ENTRY_ACL_TYPE_AUDIT Log access attempts by principal which
+ require given permissions.
+ ARCHIVE_ENTRY_ACL_TYPE_ALARM Trigger a system alarm on access
+ attempts by principal which require
+ given permissions.
+
+ The tag specifies the principal to which the permission applies. Valid
+ values are:
+ ARCHIVE_ENTRY_ACL_USER The user specified by the name field.
+ ARCHIVE_ENTRY_ACL_USER_OBJ The owner of the file.
+ ARCHIVE_ENTRY_ACL_GROUP The group specied by the name field.
+ ARCHIVE_ENTRY_ACL_GROUP_OBJ The group who owns the file.
+ ARCHIVE_ENTRY_ACL_EVERYONE Any principal who is not file owner or
+ a member of the owning group.
+
+ Entries with the ARCHIVE_ENTRY_ACL_USER or ARCHIVE_ENTRY_ACL_GROUP tag
+ store the user and group name in the name string and optionally the user
+ or group ID in the qualifier integer.
+
+ NFSv4 ACE permissions and flags are stored in the same permset bitfield.
+ Some permissions share the same constant and permission character but
+ have different effect on directories than on files. The following ACE
+ permissions are supported:
+ ARCHIVE_ENTRY_ACL_READ_DATA (r)
+ Read data (file).
+ ARCHIVE_ENTRY_ACL_LIST_DIRECTORY (r)
+ List entries (directory).
+ ARCHIVE_ENTRY_ACL_WRITE_DATA (w)
+ Write data (file).
+ ARCHIVE_ENTRY_ACL_ADD_FILE (w)
+ Create files (directory).
+ ARCHIVE_ENTRY_ACL_EXECUTE (x)
+ Execute file or change into a directory.
+ ARCHIVE_ENTRY_ACL_APPEND_DATA (p)
+ Append data (file).
+ ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY (p)
+ Create subdirectories (directory).
+ ARCHIVE_ENTRY_ACL_DELETE_CHILD (D)
+ Remove files and subdirectories inside a directory.
+ ARCHIVE_ENTRY_ACL_DELETE (d)
+ Remove file or directory.
+ ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES (a)
+ Read file or directory attributes.
+ ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES (A)
+ Write file or directory attributes.
+ ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS (R)
+ Read named file or directory attributes.
+ ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS (W)
+ Write named file or directory attributes.
+ ARCHIVE_ENTRY_ACL_READ_ACL (c)
+ Read file or directory ACL.
+ ARCHIVE_ENTRY_ACL_WRITE_ACL (C)
+ Write file or directory ACL.
+ ARCHIVE_ENTRY_ACL_WRITE_OWNER (o)
+ Change owner of a file or directory.
+ ARCHIVE_ENTRY_ACL_SYNCHRONIZE (s)
+ Use synchronous I/O.
+
+ The following NFSv4 ACL inheritance flags are supported:
+ ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT (f)
+ Inherit parent directory ACE to files.
+ ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT (d)
+ Inherit parent directory ACE to subdirectories.
+ ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY (i)
+ Only inherit, do not apply the permission on the directory
+ itself.
+ ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT (n)
+ Do not propagate inherit flags. Only first-level entries
+ inherit ACLs.
+ ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS (S)
+ Trigger alarm or audit on successful access.
+ ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS (F)
+ Trigger alarm or audit on failed access.
+ ARCHIVE_ENTRY_ACL_ENTRY_INHERITED (I)
+ Mark that ACE was inherited.
+
+ Functions
archive_entry_acl_add_entry() and archive_entry_acl_add_entry_w() add a
single ACL entry. For the access ACL and non-extended principals, the
- classic Unix permissions are updated.
+ classic Unix permissions are updated. An archive entry cannot contain
+ both POSIX.1e and NFSv4 ACL entries.
archive_entry_acl_clear() removes all ACL entries and resets the enumera‐
tion pointer.
archive_entry_acl_count() counts the ACL entries that have the given type
- mask. type can be the bitwise-or of ARCHIVE_ENTRY_ACL_TYPE_ACCESS and
- ARCHIVE_ENTRY_ACL_TYPE_DEFAULT. If ARCHIVE_ENTRY_ACL_TYPE_ACCESS is
+ mask. type can be the bitwise-or of
+ ARCHIVE_ENTRY_ACL_TYPE_ACCESS
+ ARCHIVE_ENTRY_ACL_TYPE_DEFAULT
+ for POSIX.1e ACLs and
+ ARCHIVE_ENTRY_ACL_TYPE_ALLOW
+ ARCHIVE_ENTRY_ACL_TYPE_DENY
+ ARCHIVE_ENTRY_ACL_TYPE_AUDIT
+ ARCHIVE_ENTRY_ACL_TYPE_ALARM
+ for NFSv4 ACLs. For POSIX.1e ACLs if ARCHIVE_ENTRY_ACL_TYPE_ACCESS is
included and at least one extended ACL entry is found, the three non-
- extened ACLs are added.
+ extended ACLs are added.
+ archive_entry_acl_from_text() and archive_entry_acl_from_text_w() add new
+ (or merge with existing) ACL entries from (wide) text. The argument type
+ may take one of the following values:
+ ARCHIVE_ENTRY_ACL_TYPE_ACCESS
+ ARCHIVE_ENTRY_ACL_TYPE_DEFAULT
+ ARCHIVE_ENTRY_ACL_TYPE_NFS4
+ Supports all formats that can be created with archive_entry_acl_to_text()
+ or respective archive_entry_acl_to_text_w(). Existing ACL entries are
+ preserved. To get a clean new ACL from text archive_entry_acl_clear()
+ must be called first. Entries prefixed with “default:” are treated as
+ ARCHIVE_ENTRY_ACL_TYPE_DEFAULT unless type is
+ ARCHIVE_ENTRY_ACL_TYPE_NFS4. Invalid entries, non-parseable ACL entries
+ and entries beginning with the ‘#’ character (comments) are skipped.
+
archive_entry_acl_next() and archive_entry_acl_next_w() return the next
entry of the ACL list. This functions may only be called after
archive_entry_acl_reset() has indicated the presence of extended ACL
@@ -101,35 +229,70 @@
using chmod(2). Otherwise, the function returns the same value as
archive_entry_acl_count().
- archive_entry_acl_text_w() converts the ACL entries for the given type
- mask into a wide string. In addition to the normal type flags,
- ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID and ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT
- can be specified to further customize the result. The returned long
- string is valid until the next call to archive_entry_acl_clear(),
- archive_entry_acl_add_entry(), archive_entry_acl_add_entry_w() or
- archive_entry_acl_text_w().
+ archive_entry_acl_to_text() and archive_entry_acl_to_text_w() convert the
+ ACL entries for the given type into a (wide) string of ACL entries sepa‐
+ rated by newline. If the pointer len_p is not NULL, then the function
+ shall return the length of the string (not including the NULL terminator)
+ in the location pointed to by len_p. The flag argument is a bitwise-or.
+ The following flags are effective only on POSIX.1e ACL:
+ ARCHIVE_ENTRY_ACL_TYPE_ACCESS
+ Output access ACLs.
+ ARCHIVE_ENTRY_ACL_TYPE_DEFAULT
+ Output POSIX.1e default ACLs.
+ ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT
+ Prefix each default ACL entry with the word “default:”.
+ ARCHIVE_ENTRY_ACL_STYLE_SOLARIS
+ The mask and other ACLs don not contain a double colon.
+
+ The following flags are effecive only on NFSv4 ACL:
+ ARCHIVE_ENTRY_ACL_STYLE_COMPACT
+ Do not output minus characters for unset permissions and
+ flags in NFSv4 ACL permission and flag fields.
+
+ The following flags are effective on both POSIX.1e and NFSv4 ACL:
+ ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID
+ Add an additional colon-separated field containing the user
+ or group id.
+ ARCHIVE_ENTRY_ACL_STYLE_SEPARATOR_COMMA
+ Separate ACL entries with comma instead of newline.
+
+ If the archive entry contains NFSv4 ACLs, all types of NFSv4 ACLs are
+ returned. It the entry contains POSIX.1e ACLs and none of the flags
+ ARCHIVE_ENTRY_ACL_TYPE_ACCESS or ARCHIVE_ENTRY_ACL_TYPE_DEFAULT are spec‐
+ ified, both access and default entries are returned and default entries
+ are prefixed with “default:”.
+
+ archive_entry_acl_types() get ACL entry types contained in an archive
+ entry's ACL. As POSIX.1e and NFSv4 ACL entries cannot be mixed, this
+ function is a very efficient way to detect if an ACL already contains
+ POSIX.1e or NFSv4 ACL entries.
+
RETURN VALUES
archive_entry_acl_count() and archive_entry_acl_reset() returns the num‐
- ber of ACL entries that match the given type mask. If the type mask
- includes ARCHIVE_ENTRY_ACL_TYPE_ACCESS and at least one extended ACL
- entry exists, the three classic Unix permissions are counted.
+ ber of ACL entries that match the given type mask. For POSIX.1e ACLS if
+ the type mask includes ARCHIVE_ENTRY_ACL_TYPE_ACCESS and at least one
+ extended ACL entry exists, the three classic Unix permissions are
+ counted.
+ archive_entry_acl_from_text() and archive_entry_acl_from_text_w() return
+ ARCHIVE_OK if all entries were successfully parsed and ARCHIVE_WARN if
+ one or more entries were invalid or non-parseable.
+
archive_entry_acl_next() and archive_entry_acl_next_w() return ARCHIVE_OK
on success, ARCHIVE_EOF if no more ACL entries exist and ARCHIVE_WARN if
archive_entry_acl_reset() has not been called first.
- archive_entry_text_w() returns a wide string representation of the ACL
- entrise matching the given type mask. The returned long string is valid
- until the next call to archive_entry_acl_clear(),
- archive_entry_acl_add_entry(), archive_entry_acl_add_entry_w() or
- archive_entry_acl_text_w().
+ archive_entry_acl_to_text() returns a string representing the ACL entries
+ matching the given type and flags on success or NULL on error.
+ archive_entry_acl_to_text_w() returns a wide string representing the ACL
+ entries matching the given type and flags on success or NULL on error.
+
+ archive_entry_acl_types() returns a bitmask of ACL entry types or 0 if
+ archive entry has no ACL entries.
+
SEE ALSO
- archive_entry(3) libarchive(3),
+ archive_entry(3), libarchive(3)
-BUGS
- ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID and ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT
- are not documented.
-
-BSD February 2, 2012 BSD
+BSD February 15, 2017 BSD
Modified: trunk/contrib/libarchive/doc/text/archive_entry_paths.3.txt
===================================================================
--- trunk/contrib/libarchive/doc/text/archive_entry_paths.3.txt 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/text/archive_entry_paths.3.txt 2018-06-19 20:42:35 UTC (rev 11134)
@@ -3,16 +3,16 @@
NAME
archive_entry_hardlink, archive_entry_hardlink_w,
archive_entry_set_hardlink, archive_entry_copy_hardlink,
- archive_entry_copy_hardlink_w, archve_entry_update_hardlink_utf8,
+ archive_entry_copy_hardlink_w, archive_entry_update_hardlink_utf8,
archive_entry_set_link, archive_entry_copy_link,
- archive_entry_copy_link_w, archve_entry_update_link_utf8,
+ archive_entry_copy_link_w, archive_entry_update_link_utf8,
archive_entry_pathname, archive_entry_pathname_w,
archive_entry_set_pathname, archive_entry_copy_pathname,
- archive_entry_copy_pathname_w, archve_entry_update_pathname_utf8,
+ archive_entry_copy_pathname_w, archive_entry_update_pathname_utf8,
archive_entry_sourcepath, archive_entry_copy_sourcepath,
archive_entry_symlink, archive_entry_symlink_w,
archive_entry_set_symlink, archive_entry_copy_symlink,
- archive_entry_copy_symlink_w, archve_entry_update_symlink_utf8 — func‐
+ archive_entry_copy_symlink_w, archive_entry_update_symlink_utf8 — func‐
tions for manipulating path names in archive entry descriptions
LIBRARY
Modified: trunk/contrib/libarchive/doc/text/archive_entry_perms.3.txt
===================================================================
--- trunk/contrib/libarchive/doc/text/archive_entry_perms.3.txt 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/text/archive_entry_perms.3.txt 2018-06-19 20:42:35 UTC (rev 11134)
@@ -3,7 +3,7 @@
NAME
archive_entry_gid, archive_entry_set_gid, archive_entry_uid,
archive_entry_set_uid, archive_entry_perm, archive_entry_set_perm,
- archive_entry_strmode, archive_entry_uname archive_entry_uname_w
+ archive_entry_strmode, archive_entry_uname, archive_entry_uname_w,
archive_entry_set_uname, archive_entry_copy_uname,
archive_entry_copy_uname_w, archive_entry_update_uname_utf8,
archive_entry_gname, archive_entry_gname_w, archive_entry_set_gname,
Modified: trunk/contrib/libarchive/doc/text/archive_read_disk.3.txt
===================================================================
--- trunk/contrib/libarchive/doc/text/archive_read_disk.3.txt 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/text/archive_read_disk.3.txt 2018-06-19 20:42:35 UTC (rev 11134)
@@ -1,13 +1,13 @@
ARCHIVE_READ_DISK(3) BSD Library Functions Manual ARCHIVE_READ_DISK(3)
NAME
- archive_read_disk_new, archive_read_disk_set_symlink_logical,
+ archive_read_disk_new, archive_read_disk_set_behavior,
+ archive_read_disk_set_symlink_logical,
archive_read_disk_set_symlink_physical,
archive_read_disk_set_symlink_hybrid, archive_read_disk_entry_from_file,
archive_read_disk_gname, archive_read_disk_uname,
archive_read_disk_set_uname_lookup, archive_read_disk_set_gname_lookup,
- archive_read_disk_set_standard_lookup, archive_read_close,
- archive_read_finish, archive_read_free — functions for reading objects
+ archive_read_disk_set_standard_lookup — functions for reading objects
from disk
LIBRARY
@@ -20,6 +20,9 @@
archive_read_disk_new(void);
int
+ archive_read_disk_set_behavior(struct archive *, int);
+
+ int
archive_read_disk_set_symlink_logical(struct archive *);
int
@@ -28,10 +31,10 @@
int
archive_read_disk_set_symlink_hybrid(struct archive *);
- int
+ const char *
archive_read_disk_gname(struct archive *, gid_t);
- int
+ const char *
archive_read_disk_uname(struct archive *, uid_t);
int
@@ -49,15 +52,6 @@
archive_read_disk_entry_from_file(struct archive *,
struct archive_entry *, int fd, const struct stat *);
- int
- archive_read_close(struct archive *);
-
- int
- archive_read_finish(struct archive *);
-
- int
- archive_read_free(struct archive *);
-
DESCRIPTION
These functions provide an API for reading information about objects on
disk. In particular, they provide an interface for populating struct
@@ -67,6 +61,39 @@
Allocates and initializes a struct archive object suitable for
reading object information from disk.
+ archive_read_disk_set_behavior()
+ Configures various behavior options when reading entries from
+ disk. The flags field consists of a bitwise OR of one or more of
+ the following values:
+ ARCHIVE_READDISK_HONOR_NODUMP
+ Skip files and directories with the nodump file attribute
+ (file flag) set. By default, the nodump file atrribute
+ is ignored.
+ ARCHIVE_READDISK_MAC_COPYFILE
+ Mac OS X specific. Read metadata (ACLs and extended
+ attributes) with copyfile(3). By default, metadata is
+ read using copyfile(3).
+ ARCHIVE_READDISK_NO_ACL
+ Do not read Access Control Lists. By default, ACLs are
+ read from disk.
+ ARCHIVE_READDISK_NO_FFLAGS
+ Do not read file attributes (file flags). By default,
+ file attributes are read from disk. See chattr(1)
+ (Linux) or chflags(1) (FreeBSD, Mac OS X) for more infor‐
+ mation on file attributes.
+ ARCHIVE_READDISK_NO_TRAVERSE_MOUNTS
+ Do not traverse mount points. By defaut, moint points
+ are traversed.
+ ARCHIVE_READDISK_NO_XATTR
+ Do not read extended file attributes (xattrs). By
+ default, extended file attributes are read from disk.
+ See xattr(7) (Linux), xattr(2) (Mac OS X), or
+ getextattr(8) (FreeBSD) for more information on extended
+ file attributes.
+ ARCHIVE_READDISK_RESTORE_ATIME
+ Restore access time of traversed files. By default,
+ access time of traversed files is not restored.
+
archive_read_disk_set_symlink_logical(),
archive_read_disk_set_symlink_physical(),
archive_read_disk_set_symlink_hybrid()
@@ -118,16 +145,6 @@
group names using the currently registered lookup functions
above. This affects the file ownership fields and ACL values in
the struct archive_entry object.
-
- archive_read_close()
- Does nothing for archive_read_disk handles.
-
- archive_read_finish()
- This is a deprecated synonym for archive_read_free().
-
- archive_read_free()
- Invokes archive_read_close() if it was not invoked manually, then
- releases all resources.
More information about the struct archive object and the overall design
of the library can be found in the libarchive(3) overview.
@@ -213,4 +230,4 @@
such methods are implemented, the “hybrid” symbolic link mode will make
sense.
-BSD February 2, 2012 BSD
+BSD April 3, 2017 BSD
Modified: trunk/contrib/libarchive/doc/text/archive_read_open.3.txt
===================================================================
--- trunk/contrib/libarchive/doc/text/archive_read_open.3.txt 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/text/archive_read_open.3.txt 2018-06-19 20:42:35 UTC (rev 11134)
@@ -3,7 +3,7 @@
NAME
archive_read_open, archive_read_open2, archive_read_open_fd,
archive_read_open_FILE, archive_read_open_filename,
- archive_read_open_memory, — functions for reading streaming archives
+ archive_read_open_memory — functions for reading streaming archives
LIBRARY
Streaming Archive Library (libarchive, -larchive)
@@ -32,7 +32,8 @@
size_t block_size);
int
- archive_read_open_memory(struct archive *, void *buff, size_t size);
+ archive_read_open_memory(struct archive *, const void *buff,
+ size_t size);
DESCRIPTION
archive_read_open()
Modified: trunk/contrib/libarchive/doc/text/archive_write_data.3.txt
===================================================================
--- trunk/contrib/libarchive/doc/text/archive_write_data.3.txt 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/text/archive_write_data.3.txt 2018-06-19 20:42:35 UTC (rev 11134)
@@ -1,7 +1,8 @@
ARCHIVE_WRITE_DATA(3) BSD Library Functions Manual ARCHIVE_WRITE_DATA(3)
NAME
- archive_write_data — functions for creating archives
+ archive_write_data, archive_write_data_block — functions for creating ar‐
+ chives
LIBRARY
Streaming Archive Library (libarchive, -larchive)
@@ -12,9 +13,23 @@
la_ssize_t
archive_write_data(struct archive *, const void *, size_t);
+ la_ssize_t
+ archive_write_data_block(struct archive *, const void *, size_t size,
+ int64_t offset);
+
DESCRIPTION
- Write data corresponding to the header just written.
+ archive_write_data()
+ Write data corresponding to the header just written.
+ archive_write_data_block()
+ Write data corresponding to the header just written. This is
+ like archive_write_data() except that it performs a seek on the
+ file being written to the specified offset before writing the
+ data. This is useful when restoring sparse files from archive
+ formats that support sparse files. Returns number of bytes writ‐
+ ten or -1 on error. (Note: This is currently not supported for
+ archive_write handles, only for archive_write_disk handles.
+
RETURN VALUES
This function returns the number of bytes actually written, or a negative
error code on error.
@@ -34,4 +49,4 @@
tar(1), libarchive(3), archive_write_finish_entry(3),
archive_write_set_options(3), cpio(5), mtree(5), tar(5)
-BSD February 2, 2012 BSD
+BSD February 28, 2017 BSD
Modified: trunk/contrib/libarchive/doc/text/archive_write_disk.3.txt
===================================================================
--- trunk/contrib/libarchive/doc/text/archive_write_disk.3.txt 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/text/archive_write_disk.3.txt 2018-06-19 20:42:35 UTC (rev 11134)
@@ -4,10 +4,8 @@
archive_write_disk_new, archive_write_disk_set_options,
archive_write_disk_set_skip_file, archive_write_disk_set_group_lookup,
archive_write_disk_set_standard_lookup,
- archive_write_disk_set_user_lookup, archive_write_header,
- archive_write_data, archive_write_data_block, archive_write_finish_entry,
- archive_write_close, archive_write_finish archive_write_free — functions
- for creating objects on disk
+ archive_write_disk_set_user_lookup — functions for creating objects on
+ disk
LIBRARY
Streaming Archive Library (libarchive, -larchive)
@@ -37,28 +35,6 @@
uid_t (*)(void *, const char *uname, uid_t uid),
void (*cleanup)(void *));
- int
- archive_write_header(struct archive *, struct archive_entry *);
-
- la_ssize_t
- archive_write_data(struct archive *, const void *, size_t);
-
- la_ssize_t
- archive_write_data_block(struct archive *, const void *, size_t size,
- int64_t offset);
-
- int
- archive_write_finish_entry(struct archive *);
-
- int
- archive_write_close(struct archive *);
-
- int
- archive_write_finish(struct archive *);
-
- int
- archive_write_free(struct archive *);
-
DESCRIPTION
These functions provide a complete API for creating objects on disk from
struct archive_entry descriptions. They are most naturally used when
@@ -83,6 +59,27 @@
archive_write_disk_set_options()
The options field consists of a bitwise OR of one or more of the
following values:
+ ARCHIVE_EXTRACT_ACL
+ Attempt to restore Access Control Lists. By default,
+ extended ACLs are ignored.
+ ARCHIVE_EXTRACT_CLEAR_NOCHANGE_FFLAGS
+ Before removing a file system object prior to replacing
+ it, clear platform-specific file flags which might pre‐
+ vent its removal.
+ ARCHIVE_EXTRACT_FFLAGS
+ Attempt to restore file attributes (file flags). By
+ default, file attributes are ignored. See chattr(1)
+ (Linux) or chflags(1) (FreeBSD, Mac OS X) for more infor‐
+ mation on file attributes.
+ ARCHIVE_EXTRACT_MAC_METADATA
+ Mac OS X specific. Restore metadata using copyfile(3).
+ By default, copyfile(3) metadata is ignored.
+ ARCHIVE_EXTRACT_NO_OVERWRITE
+ Existing files on disk will not be overwritten. By
+ default, existing regular files are truncated and over‐
+ written; existing directories will have their permissions
+ updated; other pre-existing objects are unlinked and
+ recreated from scratch.
ARCHIVE_EXTRACT_OWNER
The user and group IDs should be set on the restored
file. By default, the user and group IDs are not
@@ -98,16 +95,33 @@
on disk happen to match those specified in the archive
entry. By default, only basic permissions are restored,
and umask is obeyed.
+ ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS
+ Refuse to extract an absolute path. The default is to
+ not refuse such paths.
+ ARCHIVE_EXTRACT_SECURE_NODOTDOT
+ Refuse to extract a path that contains a .. element any‐
+ where within it. The default is to not refuse such
+ paths. Note that paths ending in .. always cause an
+ error, regardless of this flag.
+ ARCHIVE_EXTRACT_SECURE_SYMLINKS
+ Refuse to extract any object whose final location would
+ be altered by a symlink on disk. This is intended to
+ help guard against a variety of mischief caused by ar‐
+ chives that (deliberately or otherwise) extract files
+ outside of the current directory. The default is not to
+ perform this check. If
+ ARCHIVE_EXTRACT_SPARSE
+ Scan data for blocks of NUL bytes and try to recreate
+ them with holes. This results in sparse files, indepen‐
+ dent of whether the archive format supports or uses them.
+ ARCHIVE_EXTRACT_UNLINK is specified together with this
+ option, the library will remove any intermediate symlinks
+ it finds and return an error only if such symlink could
+ not be removed.
ARCHIVE_EXTRACT_TIME
The timestamps (mtime, ctime, and atime) should be
restored. By default, they are ignored. Note that
restoring of atime is not currently supported.
- ARCHIVE_EXTRACT_NO_OVERWRITE
- Existing files on disk will not be overwritten. By
- default, existing regular files are truncated and over‐
- written; existing directories will have their permissions
- updated; other pre-existing objects are unlinked and
- recreated from scratch.
ARCHIVE_EXTRACT_UNLINK
Existing files on disk will be unlinked before any
attempt to create them. In some cases, this can prove to
@@ -115,41 +129,11 @@
existing files are truncated and rewritten, but the file
is not recreated. In particular, the default behavior
does not break existing hard links.
- ARCHIVE_EXTRACT_ACL
- Attempt to restore ACLs. By default, extended ACLs are
- ignored.
- ARCHIVE_EXTRACT_FFLAGS
- Attempt to restore extended file flags. By default, file
- flags are ignored.
ARCHIVE_EXTRACT_XATTR
- Attempt to restore POSIX.1e extended attributes. By
- default, they are ignored.
- ARCHIVE_EXTRACT_SECURE_SYMLINKS
- Refuse to extract any object whose final location would
- be altered by a symlink on disk. This is intended to
- help guard against a variety of mischief caused by ar‐
- chives that (deliberately or otherwise) extract files
- outside of the current directory. The default is not to
- perform this check. If ARCHIVE_EXTRACT_UNLINK is speci‐
- fied together with this option, the library will remove
- any intermediate symlinks it finds and return an error
- only if such symlink could not be removed.
- ARCHIVE_EXTRACT_SECURE_NODOTDOT
- Refuse to extract a path that contains a .. element any‐
- where within it. The default is to not refuse such
- paths. Note that paths ending in .. always cause an
- error, regardless of this flag.
- ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS
- Refuse to extract an absolute path. The default is to
- not refuse such paths.
- ARCHIVE_EXTRACT_SPARSE
- Scan data for blocks of NUL bytes and try to recreate
- them with holes. This results in sparse files, indepen‐
- dent of whether the archive format supports or uses them.
- ARCHIVE_EXTRACT_CLEAR_NOCHANGE_FFLAGS
- Before removing a file system object prior to replacing
- it, clear platform-specific file flags which might pre‐
- vent its removal.
+ Attempt to restore extended file attributes. By default,
+ they are ignored. See xattr(7) (Linux), xattr(2) (Mac OS
+ X), or getextattr(8) (FreeBSD) for more information on
+ extended file attributes.
archive_write_disk_set_group_lookup(),
archive_write_disk_set_user_lookup()
@@ -171,48 +155,6 @@
names cannot be looked up. These functions also implement a sim‐
ple memory cache to reduce the number of calls to getpwnam(3) and
getgrnam(3).
-
- archive_write_header()
- Build and write a header using the data in the provided struct
- archive_entry structure. See archive_entry(3) for information on
- creating and populating struct archive_entry objects.
-
- archive_write_data()
- Write data corresponding to the header just written. Returns
- number of bytes written or -1 on error.
-
- archive_write_data_block()
- Write data corresponding to the header just written. This is
- like archive_write_data() except that it performs a seek on the
- file being written to the specified offset before writing the
- data. This is useful when restoring sparse files from archive
- formats that support sparse files. Returns number of bytes writ‐
- ten or -1 on error. (Note: This is currently not supported for
- archive_write handles, only for archive_write_disk handles.)
-
- archive_write_finish_entry()
- Close out the entry just written. Ordinarily, clients never need
- to call this, as it is called automatically by
- archive_write_next_header() and archive_write_close() as needed.
- However, some file attributes are written to disk only after the
- file is closed, so this can be necessary if you need to work with
- the file on disk right away.
-
- archive_write_close()
- Set any attributes that could not be set during the initial
- restore. For example, directory timestamps are not restored ini‐
- tially because restoring a subsequent file would alter that time‐
- stamp. Similarly, non-writable directories are initially created
- with write permissions (so that their contents can be restored).
- The archive_write_disk_new library maintains a list of all such
- deferred attributes and sets them when this function is invoked.
-
- archive_write_finish()
- This is a deprecated synonym for archive_write_free().
-
- archive_write_free()
- Invokes archive_write_close() if it was not invoked manually,
- then releases all resources.
More information about the struct archive object and the overall design
of the library can be found in the libarchive(3) overview. Many of these
functions are also documented under archive_write(3).
@@ -289,4 +231,4 @@
There should be a corresponding archive_read_disk interface that walks a
directory hierarchy and returns archive entry objects.
-BSD February 2, 2012 BSD
+BSD April 3, 2017 BSD
Modified: trunk/contrib/libarchive/doc/text/archive_write_finish_entry.3.txt
===================================================================
--- trunk/contrib/libarchive/doc/text/archive_write_finish_entry.3.txt 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/text/archive_write_finish_entry.3.txt 2018-06-19 20:42:35 UTC (rev 11134)
@@ -16,7 +16,8 @@
Close out the entry just written. In particular, this writes out the
final padding required by some formats. Ordinarily, clients never need
to call this, as it is called automatically by archive_write_header() and
- archive_write_close() as needed.
+ archive_write_close() as needed. For archive_write_disk handles, this
+ flushes pending file attribute changes like modification time.
RETURN VALUES
This function returns ARCHIVE_OK on success, or one of several non-zero
@@ -33,4 +34,4 @@
tar(1), libarchive(3), archive_write_data(3),
archive_write_set_options(3), cpio(5), mtree(5), tar(5)
-BSD February 2, 2012 BSD
+BSD February 28, 2017 BSD
Modified: trunk/contrib/libarchive/doc/text/archive_write_format.3.txt
===================================================================
--- trunk/contrib/libarchive/doc/text/archive_write_format.3.txt 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/text/archive_write_format.3.txt 2018-06-19 20:42:35 UTC (rev 11134)
@@ -98,7 +98,6 @@
The library can write a variety of common archive formats.
-
archive_write_set_format()
Sets the format based on the format code (see archive.h for the
full list of format codes). In particular, this can be used in
Modified: trunk/contrib/libarchive/doc/text/archive_write_open.3.txt
===================================================================
--- trunk/contrib/libarchive/doc/text/archive_write_open.3.txt 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/text/archive_write_open.3.txt 2018-06-19 20:42:35 UTC (rev 11134)
@@ -35,7 +35,7 @@
entries. This is the most generic form of this function, which
accepts pointers to three callback functions which will be
invoked by the compression layer to write the constructed ar‐
- chive.
+ chive. This does not alter the default archive padding.
archive_write_open_fd()
A convenience form of archive_write_open() that accepts a file
@@ -71,10 +71,15 @@
size_t * argument points to a variable that will be updated after
each write to reflect how much of the buffer is currently in use.
You should be careful to ensure that this variable remains allo‐
- cated until after the archive is closed.
+ cated until after the archive is closed. This function will dis‐
+ able padding unless you have specifically set the block size.
More information about the struct archive object and the overall design
of the library can be found in the libarchive(3) overview.
+ Note that the convenience forms above vary in how they block the output.
+ See archive_write_blocksize(3) if you need to control the block size used
+ for writes or the end-of-file padding behavior.
+
CLIENT CALLBACKS
To use this library, you will need to define and register callback func‐
tions that will be invoked to write data to the resulting archive. These
@@ -123,8 +128,8 @@
archive_errno() and archive_error_string() functions.
SEE ALSO
- tar(1), libarchive(3), archive_write(3), archive_write_filter(3),
- archive_write_format(3), archive_write_new(3),
+ tar(1), libarchive(3), archive_write(3), archive_write_blocksize(3),
+ archive_write_filter(3), archive_write_format(3), archive_write_new(3),
archive_write_set_options(3), cpio(5), mtree(5), tar(5)
BSD February 2, 2012 BSD
Modified: trunk/contrib/libarchive/doc/text/bsdtar.1.txt
===================================================================
--- trunk/contrib/libarchive/doc/text/bsdtar.1.txt 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/text/bsdtar.1.txt 2018-06-19 20:42:35 UTC (rev 11134)
@@ -51,7 +51,7 @@
ating modes.
@archive
- (c and r mode only) The specified archive is opened and the
+ (c and r modes only) The specified archive is opened and the
entries in it will be appended to the current archive. As a sim‐
ple example,
tar -c -f - newfile @original.tar
@@ -83,6 +83,13 @@
if it is unknown suffix or no suffix, creates a new archive with
restricted pax format and bzip2 compression.
+ --acls (c, r, u, x modes only) Archive or extract POSIX.1e or NFSv4
+ ACLs. This is the reverse of --no-acls and the default behavior
+ in c, r, and u modes (except on Mac OS X) or if tar is run in x
+ mode as root. On Mac OS X this option translates extended ACLs to
+ NFSv4 ACLs. To store extended ACLs the --mac-metadata option is
+ preferred.
+
-B, --read-full-blocks
Ignored for compatibility with other tar(1) implementations.
@@ -106,14 +113,16 @@
them, clear platform-specific file flags that might prevent
removal.
- --disable-copyfile
- Mac OS X specific. Disable the use of copyfile(3).
-
--exclude pattern
Do not process files or directories that match the specified pat‐
tern. Note that exclusions take precedence over patterns or
filenames specified on the command line.
+ --fflags
+ (c, r, u, x modes only) Archive or extract file flags. This is
+ the reverse of --no-fflags and the default behavior in c, r, and
+ u modes or if tar is run in x mode as root.
+
--format format
(c, r, u mode only) Use the specified format for the created ar‐
chive. Supported formats include “cpio”, “pax”, “shar”, and
@@ -144,11 +153,11 @@
group name that will be stored in the archive; the name will not
be verified against the system group database.
- -H (c and r mode only) Symbolic links named on the command line will
- be followed; the target of the link will be archived, not the
- link itself.
+ -H (c and r modes only) Symbolic links named on the command line
+ will be followed; the target of the link will be archived, not
+ the link itself.
- -h (c and r mode only) Synonym for -L.
+ -h (c and r modes only) Synonym for -L.
-I Synonym for -T.
@@ -155,7 +164,7 @@
--help Show usage.
--hfsCompression
- (x mode only) Mac OS X specific(v10.6 or later). Compress
+ (x mode only) Mac OS X specific (v10.6 or later). Compress
extracted regular files with HFS+ compression.
--ignore-zeros
@@ -195,7 +204,7 @@
the versions appearing in the archive being extracted.
-L, --dereference
- (c and r mode only) All symbolic links will be followed. Nor‐
+ (c and r modes only) All symbolic links will be followed. Nor‐
mally, symbolic links are archived as such. With this option,
the target of the link will be archived instead.
@@ -224,6 +233,13 @@
(x mode only) Do not extract modification time. By default, the
modification time is set to the time stored in the archive.
+ --mac-metadata
+ (c, r, u and x mode only) Mac OS X specific. Archive or extract
+ extended ACLs and extended attributes using copyfile(3) in Apple‐
+ Double format. This is the reverse of --no-mac-metadata. and the
+ default behavior in c, r, and u modes or if tar is run in x mode
+ as root.
+
-n, --norecurse, --no-recursion
(c, r, u modes only) Do not recursively archive the contents of
directories.
@@ -249,7 +265,7 @@
file.
--nopreserveHFSCompression
- (x mode only) Mac OS X specific(v10.6 or later). Do not compress
+ (x mode only) Mac OS X specific (v10.6 or later). Do not compress
extracted regular files which were compressed with HFS+ compres‐
sion before archived. By default, compress the regular files
again with HFS+ compression.
@@ -258,6 +274,25 @@
characters, not by newlines. This is often used to read file‐
names output by the -print0 option to find(1).
+ --no-acls
+ (c, r, u, x modes only) Do not archive or extract POSIX.1e or
+ NFSv4 ACLs. This is the reverse of --acls and the default behav‐
+ ior if tar is run as non-root in x mode (on Mac OS X as any user
+ in c, r, u and x modes).
+
+ --no-fflags
+ (c, r, u, x modes only) Do not archive or extract file flags.
+ This is the reverse of --fflags and the default behavior if tar
+ is run as non-root in x mode.
+
+ --no-mac-metadata
+ (x mode only) Mac OS X specific. Do not archive or extract ACLs
+ and extended attributes using copyfile(3) in AppleDouble format.
+ This is the reverse of --mac-metadata. and the default behavior
+ if tar is run as non-root in x mode.
+
+ -n, --norecurse, --no-recursion
+
--no-same-owner
(x mode only) Do not extract owner and group IDs. This is the
reverse of --same-owner and the default behavior if tar is run as
@@ -269,6 +304,11 @@
the reverse of -p and the default behavior if tar is run as non-
root.
+ --no-xattrs
+ (c, r, u, x modes only) Do not archive or extract extended
+ attributes. This is the reverse of --xattrs and the default
+ behavior if tar is run as non-root in x mode.
+
--numeric-owner
This is equivalent to --uname "" --gname "". On extract, it
causes user and group names in the archive to be ignored in favor
@@ -411,11 +451,12 @@
-p, --insecure, --preserve-permissions
(x mode only) Preserve file permissions. Attempt to restore the
- full permissions, including owner, file modes, file flags and
- ACLs, if available, for each item extracted from the archive.
- This is the default, if tar is being run by root and can be over‐
- ridden by also specifying --no-same-owner and
- --no-same-permissions.
+ full permissions, including owner, file modes, ACLs, extended
+ attributes and extended file flags, if available, for each item
+ extracted from the archive. This is te reverse of
+ --no-same-permissions and the default if tar is being run by root
+ and can be partially overridden by also specifying --no-acls,
+ --no-fflags, --no-mac-metadata or --no-xattrs.
--passphrase passphrase
The passphrase is used to extract or create an encrypted archive.
@@ -483,8 +524,8 @@
-n as well.
--totals
- (c, r, u mode only) After archiving all files, print a summary to
- stderr.
+ (c, r, u modes only) After archiving all files, print a summary
+ to stderr.
-U, --unlink, --unlink-first
(x mode only) Unlink files before creating them. This can be a
@@ -528,6 +569,11 @@
Read a list of exclusion patterns from the specified file. See
--exclude for more information about the handling of exclusions.
+ --xattrs
+ (c, r, u, x modes only) Archive or extract extended attributes.
+ This is the reverse of --no-xattrs and the default behavior in c,
+ r, and u modes or if tar is run in x mode as root.
+
-y (c mode only) Compress the resulting archive with bzip2(1). In
extract or list modes, this option is ignored. Note that, unlike
other tar implementations, this implementation recognizes bzip2
@@ -752,4 +798,4 @@
(This is a consequence of the incompatible ways that different archive
formats store hardlink information.)
-BSD September 16, 2014 BSD
+BSD February 25, 2017 BSD
Modified: trunk/contrib/libarchive/doc/text/libarchive-formats.5.txt
===================================================================
--- trunk/contrib/libarchive/doc/text/libarchive-formats.5.txt 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/text/libarchive-formats.5.txt 2018-06-19 20:42:35 UTC (rev 11134)
@@ -127,8 +127,7 @@
Solaris extensions
Libarchive recognizes ACL and extended attribute records written
- by Solaris tar. Currently, libarchive only has support for old-
- style ACLs; the newer NFSv4 ACLs are recognized but discarded.
+ by Solaris tar.
The first tar program appeared in Seventh Edition Unix in 1979. The
first official standard for the tar file format was the “ustar” (Unix
@@ -330,4 +329,4 @@
ar(1), cpio(1), mkisofs(1), shar(1), tar(1), zip(1), zlib(3), cpio(5),
mtree(5), tar(5)
-BSD March 18, 2012 BSD
+BSD December 27, 2016 BSD
Modified: trunk/contrib/libarchive/doc/text/libarchive_changes.3.txt
===================================================================
--- trunk/contrib/libarchive/doc/text/libarchive_changes.3.txt 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/text/libarchive_changes.3.txt 2018-06-19 20:42:35 UTC (rev 11134)
@@ -1,7 +1,7 @@
LIBARCHIVE_CHANGES(3) BSD Library Functions Manual LIBARCHIVE_CHANGES(3)
NAME
- — changes in libarchive interface
+ libarchive_changes — changes in libarchive interface
CHANGES IN LIBARCHIVE 3
This page describes user-visible changes in libarchive3, and lists public
Modified: trunk/contrib/libarchive/doc/text/mtree.5.txt
===================================================================
--- trunk/contrib/libarchive/doc/text/mtree.5.txt 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/text/mtree.5.txt 2018-06-19 20:42:35 UTC (rev 11134)
@@ -13,7 +13,7 @@
about a single filesystem object. Leading whitespace is always ignored.
When encoding file or pathnames, any backslash character or character
- outside of the 95 printable ASCII characters must be encoded as a a back‐
+ outside of the 95 printable ASCII characters must be encoded as a back‐
slash followed by three octal digits. When reading mtree files, any
appearance of a backslash followed by three octal digits should be con‐
verted into the corresponding character.
Modified: trunk/contrib/libarchive/doc/text/tar.5.txt
===================================================================
--- trunk/contrib/libarchive/doc/text/tar.5.txt 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/text/tar.5.txt 2018-06-19 20:42:35 UTC (rev 11134)
@@ -310,14 +310,14 @@
Vendor-specific attributes used by Joerg Schilling's star imple‐
mentation.
- SCHILY.acl.access, SCHILY.acl.default
- Stores the access and default ACLs as textual strings in a format
- that is an extension of the format specified by POSIX.1e draft
- 17. In particular, each user or group access specification can
- include a fourth colon-separated field with the numeric UID or
- GID. This allows ACLs to be restored on systems that may not
- have complete user or group information available (such as when
- NIS/YP or LDAP services are temporarily unavailable).
+ SCHILY.acl.access, SCHILY.acl.default, SCHILY.acl.ace
+ Stores the access, default and NFSv4 ACLs as textual strings in a
+ format that is an extension of the format specified by POSIX.1e
+ draft 17. In particular, each user or group access specification
+ can include an additional colon-separated field with the numeric
+ UID or GID. This allows ACLs to be restored on systems that may
+ not have complete user or group information available (such as
+ when NIS/YP or LDAP services are temporarily unavailable).
SCHILY.devminor, SCHILY.devmajor
The full minor and major numbers for device nodes.
@@ -671,4 +671,4 @@
This documentation was written as part of the libarchive and bsdtar
project by Tim Kientzle <kientzle at FreeBSD.org>.
-BSD December 23, 2011 BSD
+BSD December 27, 2016 BSD
Modified: trunk/contrib/libarchive/doc/wiki/ManPageArchiveEntryAcl3.wiki
===================================================================
--- trunk/contrib/libarchive/doc/wiki/ManPageArchiveEntryAcl3.wiki 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/wiki/ManPageArchiveEntryAcl3.wiki 2018-06-19 20:42:35 UTC (rev 11134)
@@ -4,10 +4,14 @@
'''archive_entry_acl_add_entry_w''',
'''archive_entry_acl_clear''',
'''archive_entry_acl_count''',
+'''archive_entry_acl_from_text''',
+'''archive_entry_acl_from_text_w''',
'''archive_entry_acl_next''',
'''archive_entry_acl_next_w''',
'''archive_entry_acl_reset''',
-'''archive_entry_acl_text_w'''
+'''archive_entry_acl_to_text''',
+'''archive_entry_acl_to_text_w''',
+'''archive_entry_acl_types'''
- functions for manipulating Access Control Lists in archive entry descriptions
== LIBRARY ==
Streaming Archive Library (libarchive, -larchive)
@@ -32,6 +36,14 @@
<br>
''int''
<br>
+'''archive_entry_acl_from_text'''(''struct archive_entry *a'', ''const char *text'', ''int type'');
+<br>
+''int''
+<br>
+'''archive_entry_acl_from_text_w'''(''struct archive_entry *a'', ''const wchar_t *text'', ''int type'');
+<br>
+''int''
+<br>
'''archive_entry_acl_next'''(''struct archive_entry *a'', ''int type'', ''int *ret_type'', ''int *ret_permset'', ''int *ret_tag'', ''int *ret_qual'', ''const char **ret_name'');
<br>
''int''
@@ -42,34 +54,44 @@
<br>
'''archive_entry_acl_reset'''(''struct archive_entry *a'', ''int type'');
<br>
-''const wchar_t *''
+''char *''
<br>
-'''archive_entry_acl_text_w'''(''struct archive_entry *a'', ''int flags'');
+'''archive_entry_acl_to_text'''(''struct archive_entry *a'', ''ssize_t *len_p'', ''int flags'');
+<br>
+''wchar_t *''
+<br>
+'''archive_entry_acl_to_text_w'''(''struct archive_entry *a'', ''ssize_t *len_p'', ''int flags'');
+<br>
+''int''
+<br>
+'''archive_entry_acl_types'''(''struct archive_entry *a'');
== DESCRIPTION ==
-An
-"Access Control List"
-is a generalisation of the classic Unix permission system.
+The
+"Access Control Lists (ACLs)"
+extend the standard Unix perssion model.
The ACL interface of
'''libarchive'''
-is derived from the POSIX.1e draft, but restricted to simplify dealing
-with practical implementations in various Operating Systems and archive formats.
-
-An ACL consists of a number of independent entries.
+supports both POSIX.1e and NFSv4 style ACLs. Use of ACLs is restricted by
+various levels of ACL support in operating systems, file systems and archive
+formats.
+=== POSIX.1e Access Control Lists===
+A POSIX.1e ACL consists of a number of independent entries.
Each entry specifies the permission set as bitmask of basic permissions.
-Valid permissions are:
+Valid permissions in the
+are:
<dl>
<dt></dt><dd>
-ARCHIVE_ENTRY_ACL_EXECUTE
+ARCHIVE_ENTRY_ACL_READ (.B r )
</dd><dt></dt><dd>
-ARCHIVE_ENTRY_ACL_WRITE
+ARCHIVE_ENTRY_ACL_WRITE (.B w )
</dd><dt></dt><dd>
-ARCHIVE_ENTRY_ACL_READ
+ARCHIVE_ENTRY_ACL_EXECUTE (.B x )
</dd></dl>
The permissions correspond to the normal Unix permissions.
-The tag specifies the principal to which the permission applies.
+The
+specifies the principal to which the permission applies.
Valid values are:
-<dl>
<dt></dt><dd>
ARCHIVE_ENTRY_ACL_USER
The user specified by the name field.
@@ -87,8 +109,9 @@
The maximum permissions to be obtained via group permissions.
</dd><dt></dt><dd>
ARCHIVE_ENTRY_ACL_OTHER
-Any principal who doesn't have a user or group entry.
-</dd></dl>
+Any principal who is not file owner or a member of the owning group.
+</dd>
+
The principals
ARCHIVE_ENTRY_ACL_USER_OBJ,
ARCHIVE_ENTRY_ACL_GROUP_OBJ
@@ -97,7 +120,7 @@
are equivalent to user, group and other in the classic Unix permission
model and specify non-extended ACL entries.
-All files have an access ACL
+All files with have an access ACL
()
ARCHIVE_ENTRY_ACL_TYPE_ACCESS.
This specifies the permissions required for access to the file itself.
@@ -105,13 +128,142 @@
()
ARCHIVE_ENTRY_ACL_TYPE_DEFAULT,
which controls the initial access ACL for newly created directory entries.
+=== NFSv4 Access Control Lists===
+A NFSv4 ACL consists of multiple individual entries called Access Control
+Entries (ACEs).
+There are four possible types of a NFSv4 ACE:
+<dt></dt><dd>
+ARCHIVE_ENTRY_ACL_TYPE_ALLOW
+Allow principal to perform actions requiring given permissions.
+</dd><dt></dt><dd>
+ARCHIVE_ENTRY_ACL_TYPE_DENY
+Prevent principal from performing actions requiring given permissions.
+</dd><dt></dt><dd>
+ARCHIVE_ENTRY_ACL_TYPE_AUDIT
+Log access attempts by principal which require given permissions.
+</dd><dt></dt><dd>
+ARCHIVE_ENTRY_ACL_TYPE_ALARM
+Trigger a system alarm on access attempts by principal which require given
+permissions.
+</dd>
+
+The
+specifies the principal to which the permission applies.
+Valid values are:
+<dt></dt><dd>
+ARCHIVE_ENTRY_ACL_USER
+The user specified by the name field.
+</dd><dt></dt><dd>
+ARCHIVE_ENTRY_ACL_USER_OBJ
+The owner of the file.
+</dd><dt></dt><dd>
+ARCHIVE_ENTRY_ACL_GROUP
+The group specied by the name field.
+</dd><dt></dt><dd>
+ARCHIVE_ENTRY_ACL_GROUP_OBJ
+The group who owns the file.
+</dd><dt></dt><dd>
+ARCHIVE_ENTRY_ACL_EVERYONE
+Any principal who is not file owner or a member of the owning group.
+</dd>
+
+Entries with the
+ARCHIVE_ENTRY_ACL_USER
+or
+ARCHIVE_ENTRY_ACL_GROUP
+tag store the user and group name in the
+string and optionally the user or group ID in the
+integer.
+
+NFSv4 ACE permissions and flags are stored in the same
+bitfield. Some permissions share the same constant and permission character but
+have different effect on directories than on files. The following ACE
+permissions are supported:
+<dl>
+<dt></dt><dd>
+ARCHIVE_ENTRY_ACL_READ_DATA (.B r )
+Read data (file).
+</dd><dt></dt><dd>
+ARCHIVE_ENTRY_ACL_LIST_DIRECTORY (.B r )
+List entries (directory).
+</dd><dt>ARCHIVE_ENTRY_ACL_WRITE_DATA (.B w )</dt><dd>
+Write data (file).
+</dd><dt>ARCHIVE_ENTRY_ACL_ADD_FILE (.B w )</dt><dd>
+Create files (directory).
+</dd><dt></dt><dd>
+ARCHIVE_ENTRY_ACL_EXECUTE (.B x )
+Execute file or change into a directory.
+</dd><dt></dt><dd>
+ARCHIVE_ENTRY_ACL_APPEND_DATA (.B p )
+Append data (file).
+</dd><dt></dt><dd>
+ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY (.B p )
+Create subdirectories (directory).
+</dd><dt></dt><dd>
+ARCHIVE_ENTRY_ACL_DELETE_CHILD (.B D )
+Remove files and subdirectories inside a directory.
+</dd><dt></dt><dd>
+ARCHIVE_ENTRY_ACL_DELETE (.B d )
+Remove file or directory.
+</dd><dt></dt><dd>
+ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES (.B a )
+Read file or directory attributes.
+</dd><dt></dt><dd>
+ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES (.B A )
+Write file or directory attributes.
+</dd><dt></dt><dd>
+ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS (.B R )
+Read named file or directory attributes.
+</dd><dt></dt><dd>
+ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS (.B W )
+Write named file or directory attributes.
+</dd><dt></dt><dd>
+ARCHIVE_ENTRY_ACL_READ_ACL (.B c )
+Read file or directory ACL.
+</dd><dt></dt><dd>
+ARCHIVE_ENTRY_ACL_WRITE_ACL (.B C )
+Write file or directory ACL.
+</dd><dt></dt><dd>
+ARCHIVE_ENTRY_ACL_WRITE_OWNER (.B o )
+Change owner of a file or directory.
+</dd><dt></dt><dd>
+ARCHIVE_ENTRY_ACL_SYNCHRONIZE (.B s )
+Use synchronous I/O.
+</dd></dl>
+
+The following NFSv4 ACL inheritance flags are supported:
+<dl>
+<dt></dt><dd>
+ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT (.B f )
+Inherit parent directory ACE to files.
+</dd><dt></dt><dd>
+ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT (.B d )
+Inherit parent directory ACE to subdirectories.
+</dd><dt></dt><dd>
+ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY (.B i )
+Only inherit, do not apply the permission on the directory itself.
+</dd><dt></dt><dd>
+ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT (.B n )
+Do not propagate inherit flags. Only first-level entries inherit ACLs.
+</dd><dt></dt><dd>
+ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS (.B S )
+Trigger alarm or audit on successful access.
+</dd><dt></dt><dd>
+ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS (.B F )
+Trigger alarm or audit on failed access.
+</dd><dt></dt><dd>
+ARCHIVE_ENTRY_ACL_ENTRY_INHERITED (.B I )
+Mark that ACE was inherited.
+</dd></dl>
+=== Functions===
'''archive_entry_acl_add_entry'''()
and
'''archive_entry_acl_add_entry_w'''()
add a single ACL entry.
For the access ACL and non-extended principals, the classic Unix permissions
-are updated.
+are updated. An archive entry cannot contain both POSIX.1e and NFSv4 ACL
+entries.
'''archive_entry_acl_clear'''()
removes all ACL entries and resets the enumeration pointer.
@@ -119,14 +271,65 @@
'''archive_entry_acl_count'''()
counts the ACL entries that have the given type mask.
can be the bitwise-or of
+<dl>
+<dt></dt><dd>
ARCHIVE_ENTRY_ACL_TYPE_ACCESS
-and
-ARCHIVE_ENTRY_ACL_TYPE_DEFAULT.
-If
+</dd><dt></dt><dd>
+ARCHIVE_ENTRY_ACL_TYPE_DEFAULT
+</dd></dl>
+for POSIX.1e ACLs and
+<dl>
+<dt></dt><dd>
+ARCHIVE_ENTRY_ACL_TYPE_ALLOW
+</dd><dt></dt><dd>
+ARCHIVE_ENTRY_ACL_TYPE_DENY
+</dd><dt></dt><dd>
+ARCHIVE_ENTRY_ACL_TYPE_AUDIT
+</dd><dt></dt><dd>
+ARCHIVE_ENTRY_ACL_TYPE_ALARM
+</dd></dl>
+for NFSv4 ACLs. For POSIX.1e ACLs if
ARCHIVE_ENTRY_ACL_TYPE_ACCESS
is included and at least one extended ACL entry is found,
-the three non-extened ACLs are added.
+the three non-extended ACLs are added.
+'''archive_entry_acl_from_text'''()
+and
+'''archive_entry_acl_from_text_w'''()
+add new
+(or merge with existing)
+ACL entries from
+(wide)
+text. The argument
+may take one of the following values:
+<dl>
+<dt></dt><dd>
+ARCHIVE_ENTRY_ACL_TYPE_ACCESS
+</dd><dt></dt><dd>
+ARCHIVE_ENTRY_ACL_TYPE_DEFAULT
+</dd><dt></dt><dd>
+ARCHIVE_ENTRY_ACL_TYPE_NFS4
+</dd></dl>
+Supports all formats that can be created with
+'''archive_entry_acl_to_text'''()
+or respective
+'''archive_entry_acl_to_text_w'''().
+Existing ACL entries are preserved. To get a clean new ACL from text
+'''archive_entry_acl_clear'''()
+must be called first. Entries prefixed with
+"default:"
+are treated as
+ARCHIVE_ENTRY_ACL_TYPE_DEFAULT
+unless
+is
+ARCHIVE_ENTRY_ACL_TYPE_NFS4.
+Invalid entries, non-parseable ACL entries and entries beginning with
+the
+Sq #
+character
+(comments)
+are skipped.
+
'''archive_entry_acl_next'''()
and
'''archive_entry_acl_next_w'''()
@@ -148,29 +351,86 @@
Otherwise, the function returns the same value as
'''archive_entry_acl_count'''().
-'''archive_entry_acl_text_w'''()
-converts the ACL entries for the given type mask into a wide string.
-In addition to the normal type flags,
-ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID
+'''archive_entry_acl_to_text'''()
and
+'''archive_entry_acl_to_text_w'''()
+convert the ACL entries for the given type into a
+(wide)
+string of ACL entries separated by newline. If the pointer
+is not NULL, then the function shall return the length of the string
+(not including the NULL terminator)
+in the location pointed to by
+.
+The
+argument is a bitwise-or.
+
+The following flags are effective only on POSIX.1e ACL:
+<dl>
+<dt></dt><dd>
+ARCHIVE_ENTRY_ACL_TYPE_ACCESS
+Output access ACLs.
+</dd><dt></dt><dd>
+ARCHIVE_ENTRY_ACL_TYPE_DEFAULT
+Output POSIX.1e default ACLs.
+</dd><dt></dt><dd>
ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT
-can be specified to further customize the result.
-The returned long string is valid until the next call to
-'''archive_entry_acl_clear'''(),
-'''archive_entry_acl_add_entry'''(),
-'''archive_entry_acl_add_entry_w'''()
+Prefix each default ACL entry with the word
+"default:".
+</dd><dt></dt><dd>
+ARCHIVE_ENTRY_ACL_STYLE_SOLARIS
+The mask and other ACLs don not contain a double colon.
+</dd></dl>
+
+The following flags are effecive only on NFSv4 ACL:
+<dl>
+<dt></dt><dd>
+ARCHIVE_ENTRY_ACL_STYLE_COMPACT
+Do not output minus characters for unset permissions and flags in NFSv4 ACL
+permission and flag fields.
+</dd></dl>
+
+The following flags are effective on both POSIX.1e and NFSv4 ACL:
+<dl>
+<dt></dt><dd>
+ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID
+Add an additional colon-separated field containing the user or group id.
+</dd><dt></dt><dd>
+ARCHIVE_ENTRY_ACL_STYLE_SEPARATOR_COMMA
+Separate ACL entries with comma instead of newline.
+</dd></dl>
+
+If the archive entry contains NFSv4 ACLs, all types of NFSv4 ACLs are returned.
+It the entry contains POSIX.1e ACLs and none of the flags
+ARCHIVE_ENTRY_ACL_TYPE_ACCESS
or
-'''archive_entry_acl_text_w'''().
+ARCHIVE_ENTRY_ACL_TYPE_DEFAULT
+are specified, both access and default entries are returned and default entries
+are prefixed with
+"default:".
+
+'''archive_entry_acl_types'''()
+get ACL entry types contained in an archive entry's ACL. As POSIX.1e and NFSv4
+ACL entries cannot be mixed, this function is a very efficient way to detect if
+an ACL already contains POSIX.1e or NFSv4 ACL entries.
== RETURN VALUES ==
'''archive_entry_acl_count'''()
and
'''archive_entry_acl_reset'''()
returns the number of ACL entries that match the given type mask.
-If the type mask includes
+For POSIX.1e ACLS if the type mask includes
ARCHIVE_ENTRY_ACL_TYPE_ACCESS
and at least one extended ACL entry exists, the three classic Unix
permissions are counted.
+'''archive_entry_acl_from_text'''()
+and
+'''archive_entry_acl_from_text_w'''()
+return
+ARCHIVE_OK
+if all entries were successfully parsed and
+ARCHIVE_WARN
+if one or more entries were invalid or non-parseable.
+
'''archive_entry_acl_next'''()
and
'''archive_entry_acl_next_w'''()
@@ -185,20 +445,16 @@
'''archive_entry_acl_reset'''()
has not been called first.
-'''archive_entry_text_w'''()
-returns a wide string representation of the ACL entrise matching the
-given type mask.
-The returned long string is valid until the next call to
-'''archive_entry_acl_clear'''(),
-'''archive_entry_acl_add_entry'''(),
-'''archive_entry_acl_add_entry_w'''()
-or
-'''archive_entry_acl_text_w'''().
+'''archive_entry_acl_to_text'''()
+returns a string representing the ACL entries matching the given type and
+flags on success or NULL on error.
+
+'''archive_entry_acl_to_text_w'''()
+returns a wide string representing the ACL entries matching the given type
+and flags on success or NULL on error.
+
+'''archive_entry_acl_types'''()
+returns a bitmask of ACL entry types or 0 if archive entry has no ACL entries.
== SEE ALSO ==
-[[ManPagerchiventry3]]
-[[ManPageibarchive3]],
-== BUGS ==
-ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID
-and
-ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT
-are not documented.
+[[ManPagerchiventry3]],
+[[ManPageibarchive3]]
Modified: trunk/contrib/libarchive/doc/wiki/ManPageArchiveEntryPaths3.wiki
===================================================================
--- trunk/contrib/libarchive/doc/wiki/ManPageArchiveEntryPaths3.wiki 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/wiki/ManPageArchiveEntryPaths3.wiki 2018-06-19 20:42:35 UTC (rev 11134)
@@ -5,25 +5,25 @@
'''archive_entry_set_hardlink''',
'''archive_entry_copy_hardlink''',
'''archive_entry_copy_hardlink_w''',
-'''archve_entry_update_hardlink_utf8''',
+'''archive_entry_update_hardlink_utf8''',
'''archive_entry_set_link''',
'''archive_entry_copy_link''',
'''archive_entry_copy_link_w''',
-'''archve_entry_update_link_utf8''',
+'''archive_entry_update_link_utf8''',
'''archive_entry_pathname''',
'''archive_entry_pathname_w''',
'''archive_entry_set_pathname''',
'''archive_entry_copy_pathname''',
'''archive_entry_copy_pathname_w''',
-'''archve_entry_update_pathname_utf8''',
+'''archive_entry_update_pathname_utf8''',
'''archive_entry_sourcepath''',
'''archive_entry_copy_sourcepath''',
-'''archive_entry_symlink,'''
-'''archive_entry_symlink_w,'''
+'''archive_entry_symlink''',
+'''archive_entry_symlink_w''',
'''archive_entry_set_symlink''',
'''archive_entry_copy_symlink''',
'''archive_entry_copy_symlink_w''',
-'''archve_entry_update_symlink_utf8'''
+'''archive_entry_update_symlink_utf8'''
- functions for manipulating path names in archive entry descriptions
== LIBRARY ==
Streaming Archive Library (libarchive, -larchive)
Modified: trunk/contrib/libarchive/doc/wiki/ManPageArchiveEntryPerms3.wiki
===================================================================
--- trunk/contrib/libarchive/doc/wiki/ManPageArchiveEntryPerms3.wiki 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/wiki/ManPageArchiveEntryPerms3.wiki 2018-06-19 20:42:35 UTC (rev 11134)
@@ -7,8 +7,8 @@
'''archive_entry_perm''',
'''archive_entry_set_perm''',
'''archive_entry_strmode''',
-'''archive_entry_uname'''
-'''archive_entry_uname_w'''
+'''archive_entry_uname''',
+'''archive_entry_uname_w''',
'''archive_entry_set_uname''',
'''archive_entry_copy_uname''',
'''archive_entry_copy_uname_w''',
Modified: trunk/contrib/libarchive/doc/wiki/ManPageArchiveReadDisk3.wiki
===================================================================
--- trunk/contrib/libarchive/doc/wiki/ManPageArchiveReadDisk3.wiki 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/wiki/ManPageArchiveReadDisk3.wiki 2018-06-19 20:42:35 UTC (rev 11134)
@@ -1,6 +1,7 @@
ARCHIVE_READ_DISK(3) manual page
== NAME ==
'''archive_read_disk_new''',
+'''archive_read_disk_set_behavior''',
'''archive_read_disk_set_symlink_logical''',
'''archive_read_disk_set_symlink_physical''',
'''archive_read_disk_set_symlink_hybrid''',
@@ -9,10 +10,7 @@
'''archive_read_disk_uname''',
'''archive_read_disk_set_uname_lookup''',
'''archive_read_disk_set_gname_lookup''',
-'''archive_read_disk_set_standard_lookup''',
-'''archive_read_close''',
-'''archive_read_finish''',
-'''archive_read_free'''
+'''archive_read_disk_set_standard_lookup'''
- functions for reading objects from disk
== LIBRARY ==
Streaming Archive Library (libarchive, -larchive)
@@ -25,6 +23,10 @@
<br>
''int''
<br>
+'''archive_read_disk_set_behavior'''(''struct archive *'', ''int'');
+<br>
+''int''
+<br>
'''archive_read_disk_set_symlink_logical'''(''struct archive *'');
<br>
''int''
@@ -35,11 +37,11 @@
<br>
'''archive_read_disk_set_symlink_hybrid'''(''struct archive *'');
<br>
-''int''
+''const char *''
<br>
'''archive_read_disk_gname'''(''struct archive *'', ''gid_t'');
<br>
-''int''
+''const char *''
<br>
'''archive_read_disk_uname'''(''struct archive *'', ''uid_t'');
<br>
@@ -58,18 +60,6 @@
''int''
<br>
'''archive_read_disk_entry_from_file'''(''struct archive *'', ''struct archive_entry *'', ''int fd'', ''const struct stat *'');
-<br>
-''int''
-<br>
-'''archive_read_close'''(''struct archive *'');
-<br>
-''int''
-<br>
-'''archive_read_finish'''(''struct archive *'');
-<br>
-''int''
-<br>
-'''archive_read_free'''(''struct archive *'');
== DESCRIPTION ==
These functions provide an API for reading information about
objects on disk.
@@ -81,6 +71,51 @@
Allocates and initializes a
'''struct archive'''
object suitable for reading object information from disk.
+</dd><dt>'''archive_read_disk_set_behavior'''()</dt><dd>
+Configures various behavior options when reading entries from disk.
+The flags field consists of a bitwise OR of one or more of the
+following values:
+<dl>
+<dt>'''ARCHIVE_READDISK_HONOR_NODUMP'''</dt><dd>
+Skip files and directories with the nodump file attribute (file flag) set.
+By default, the nodump file atrribute is ignored.
+</dd><dt>'''ARCHIVE_READDISK_MAC_COPYFILE'''</dt><dd>
+Mac OS X specific. Read metadata (ACLs and extended attributes) with
+[[copyfile(3)|http://www.freebsd.org/cgi/man.cgi?query=copyfile&sektion=3]].
+By default, metadata is read using
+[[copyfile(3)|http://www.freebsd.org/cgi/man.cgi?query=copyfile&sektion=3]].
+</dd><dt>'''ARCHIVE_READDISK_NO_ACL'''</dt><dd>
+Do not read Access Control Lists.
+By default, ACLs are read from disk.
+</dd><dt>'''ARCHIVE_READDISK_NO_FFLAGS'''</dt><dd>
+Do not read file attributes (file flags).
+By default, file attributes are read from disk.
+See
+[[chattr(1)|http://www.freebsd.org/cgi/man.cgi?query=chattr&sektion=1]]
+(Linux)
+or
+[[chflags(1)|http://www.freebsd.org/cgi/man.cgi?query=chflags&sektion=1]]
+(FreeBSD, Mac OS X)
+for more information on file attributes.
+</dd><dt>'''ARCHIVE_READDISK_NO_TRAVERSE_MOUNTS'''</dt><dd>
+Do not traverse mount points.
+By defaut, moint points are traversed.
+</dd><dt>'''ARCHIVE_READDISK_NO_XATTR'''</dt><dd>
+Do not read extended file attributes (xattrs).
+By default, extended file attributes are read from disk.
+See
+[[xattr(7)|http://www.freebsd.org/cgi/man.cgi?query=xattr&sektion=7]]
+(Linux,)
+[[xattr(2)|http://www.freebsd.org/cgi/man.cgi?query=xattr&sektion=2]]
+(Mac OS X,)
+or
+[[getextattr(8)|http://www.freebsd.org/cgi/man.cgi?query=getextattr&sektion=8]]
+(FreeBSD)
+for more information on extended file attributes.
+</dd><dt>'''ARCHIVE_READDISK_RESTORE_ATIME'''</dt><dd>
+Restore access time of traversed files.
+By default, access time of traversed files is not restored.
+</dd></dl>
</dd><dt>
'''archive_read_disk_set_symlink_logical'''(),
'''archive_read_disk_set_symlink_physical'''(),
@@ -164,17 +199,6 @@
This affects the file ownership fields and ACL values in the
'''struct archive_entry'''
object.
-</dd><dt>'''archive_read_close'''()</dt><dd>
-Does nothing for
-'''archive_read_disk'''
-handles.
-</dd><dt>'''archive_read_finish'''()</dt><dd>
-This is a deprecated synonym for
-'''archive_read_free'''().
-</dd><dt>'''archive_read_free'''()</dt><dd>
-Invokes
-'''archive_read_close'''()
-if it was not invoked manually, then releases all resources.
</dd></dl>
More information about the
''struct'' archive
Modified: trunk/contrib/libarchive/doc/wiki/ManPageArchiveReadFormat3.wiki
===================================================================
--- trunk/contrib/libarchive/doc/wiki/ManPageArchiveReadFormat3.wiki 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/wiki/ManPageArchiveReadFormat3.wiki 2018-06-19 20:42:35 UTC (rev 11134)
@@ -9,9 +9,9 @@
'''archive_read_support_format_empty''',
'''archive_read_support_format_iso9660''',
'''archive_read_support_format_lha''',
-'''archive_read_support_format_mtree,'''
-'''archive_read_support_format_rar,'''
-'''archive_read_support_format_raw,'''
+'''archive_read_support_format_mtree''',
+'''archive_read_support_format_rar''',
+'''archive_read_support_format_raw''',
'''archive_read_support_format_tar''',
'''archive_read_support_format_xar''',
'''archive_read_support_format_zip'''
Modified: trunk/contrib/libarchive/doc/wiki/ManPageArchiveReadOpen3.wiki
===================================================================
--- trunk/contrib/libarchive/doc/wiki/ManPageArchiveReadOpen3.wiki 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/wiki/ManPageArchiveReadOpen3.wiki 2018-06-19 20:42:35 UTC (rev 11134)
@@ -5,7 +5,7 @@
'''archive_read_open_fd''',
'''archive_read_open_FILE''',
'''archive_read_open_filename''',
-'''archive_read_open_memory''',
+'''archive_read_open_memory'''
- functions for reading streaming archives
== LIBRARY ==
Streaming Archive Library (libarchive, -larchive)
@@ -34,7 +34,7 @@
<br>
''int''
<br>
-'''archive_read_open_memory'''(''struct archive *'', ''void *buff'', ''size_t size'');
+'''archive_read_open_memory'''(''struct archive *'', ''const void *buff'', ''size_t size'');
== DESCRIPTION ==
<dl>
<dt>'''archive_read_open'''()</dt><dd>
Modified: trunk/contrib/libarchive/doc/wiki/ManPageArchiveWriteData3.wiki
===================================================================
--- trunk/contrib/libarchive/doc/wiki/ManPageArchiveWriteData3.wiki 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/wiki/ManPageArchiveWriteData3.wiki 2018-06-19 20:42:35 UTC (rev 11134)
@@ -1,6 +1,7 @@
ARCHIVE_WRITE_DATA(3) manual page
== NAME ==
-'''archive_write_data'''
+'''archive_write_data''',
+'''archive_write_data_block'''
- functions for creating archives
== LIBRARY ==
Streaming Archive Library (libarchive, -larchive)
@@ -10,8 +11,29 @@
''la_ssize_t''
<br>
'''archive_write_data'''(''struct archive *'', ''const void *'', ''size_t'');
+<br>
+''la_ssize_t''
+<br>
+'''archive_write_data_block'''(''struct archive *'', ''const void *'', ''size_t size'', ''int64_t offset'');
== DESCRIPTION ==
+<dl>
+<dt>'''archive_write_data'''()</dt><dd>
Write data corresponding to the header just written.
+</dd><dt>'''archive_write_data_block'''()</dt><dd>
+Write data corresponding to the header just written.
+This is like
+'''archive_write_data'''()
+except that it performs a seek on the file being
+written to the specified offset before writing the data.
+This is useful when restoring sparse files from archive
+formats that support sparse files.
+Returns number of bytes written or -1 on error.
+(Note: This is currently not supported for
+'''archive_write'''
+handles, only for
+'''archive_write_disk'''
+handles.
+</dd></dl>
== RETURN VALUES ==
This function returns the number of bytes actually written, or
a negative error code on error.
Modified: trunk/contrib/libarchive/doc/wiki/ManPageArchiveWriteDisk3.wiki
===================================================================
--- trunk/contrib/libarchive/doc/wiki/ManPageArchiveWriteDisk3.wiki 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/wiki/ManPageArchiveWriteDisk3.wiki 2018-06-19 20:42:35 UTC (rev 11134)
@@ -5,14 +5,7 @@
'''archive_write_disk_set_skip_file''',
'''archive_write_disk_set_group_lookup''',
'''archive_write_disk_set_standard_lookup''',
-'''archive_write_disk_set_user_lookup''',
-'''archive_write_header''',
-'''archive_write_data''',
-'''archive_write_data_block''',
-'''archive_write_finish_entry''',
-'''archive_write_close''',
-'''archive_write_finish'''
-'''archive_write_free'''
+'''archive_write_disk_set_user_lookup'''
- functions for creating objects on disk
== LIBRARY ==
Streaming Archive Library (libarchive, -larchive)
@@ -42,34 +35,6 @@
''int''
<br>
'''archive_write_disk_set_user_lookup'''(''struct archive *'', ''void *'', ''uid_t (*)(void *, const char *uname, uid_t uid)'', ''void (*cleanup)(void *)'');
-<br>
-''int''
-<br>
-'''archive_write_header'''(''struct archive *'', ''struct archive_entry *'');
-<br>
-''la_ssize_t''
-<br>
-'''archive_write_data'''(''struct archive *'', ''const void *'', ''size_t'');
-<br>
-''la_ssize_t''
-<br>
-'''archive_write_data_block'''(''struct archive *'', ''const void *'', ''size_t size'', ''int64_t offset'');
-<br>
-''int''
-<br>
-'''archive_write_finish_entry'''(''struct archive *'');
-<br>
-''int''
-<br>
-'''archive_write_close'''(''struct archive *'');
-<br>
-''int''
-<br>
-'''archive_write_finish'''(''struct archive *'');
-<br>
-''int''
-<br>
-'''archive_write_free'''(''struct archive *'');
== DESCRIPTION ==
These functions provide a complete API for creating objects on
disk from
@@ -105,7 +70,34 @@
The options field consists of a bitwise OR of one or more of the
following values:
<dl>
-<dt>'''ARCHIVE_EXTRACT_OWNER'''</dt><dd>
+<dt>'''ARCHIVE_EXTRACT_ACL'''</dt><dd>
+Attempt to restore Access Control Lists.
+By default, extended ACLs are ignored.
+</dd><dt>'''ARCHIVE_EXTRACT_CLEAR_NOCHANGE_FFLAGS'''</dt><dd>
+Before removing a file system object prior to replacing it, clear
+platform-specific file flags which might prevent its removal.
+</dd><dt>'''ARCHIVE_EXTRACT_FFLAGS'''</dt><dd>
+Attempt to restore file attributes (file flags).
+By default, file attributes are ignored.
+See
+[[chattr(1)|http://www.freebsd.org/cgi/man.cgi?query=chattr&sektion=1]]
+(Linux)
+or
+[[chflags(1)|http://www.freebsd.org/cgi/man.cgi?query=chflags&sektion=1]]
+(FreeBSD, Mac OS X)
+for more information on file attributes.
+</dd><dt>'''ARCHIVE_EXTRACT_MAC_METADATA'''</dt><dd>
+Mac OS X specific. Restore metadata using
+[[copyfile(3)|http://www.freebsd.org/cgi/man.cgi?query=copyfile&sektion=3]].
+By default,
+[[copyfile(3)|http://www.freebsd.org/cgi/man.cgi?query=copyfile&sektion=3]]
+metadata is ignored.
+</dd><dt>'''ARCHIVE_EXTRACT_NO_OVERWRITE'''</dt><dd>
+Existing files on disk will not be overwritten.
+By default, existing regular files are truncated and overwritten;
+existing directories will have their permissions updated;
+other pre-existing objects are unlinked and recreated from scratch.
+</dd><dt>'''ARCHIVE_EXTRACT_OWNER'''</dt><dd>
The user and group IDs should be set on the restored file.
By default, the user and group IDs are not restored.
</dd><dt>'''ARCHIVE_EXTRACT_PERM'''</dt><dd>
@@ -120,15 +112,37 @@
if the default user and group IDs of newly-created objects on disk
happen to match those specified in the archive entry.
By default, only basic permissions are restored, and umask is obeyed.
+</dd><dt>'''ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS'''</dt><dd>
+Refuse to extract an absolute path.
+The default is to not refuse such paths.
+</dd><dt>'''ARCHIVE_EXTRACT_SECURE_NODOTDOT'''</dt><dd>
+Refuse to extract a path that contains a
+''..''
+element anywhere within it.
+The default is to not refuse such paths.
+Note that paths ending in
+''..''
+always cause an error, regardless of this flag.
+</dd><dt>'''ARCHIVE_EXTRACT_SECURE_SYMLINKS'''</dt><dd>
+Refuse to extract any object whose final location would be altered
+by a symlink on disk.
+This is intended to help guard against a variety of mischief
+caused by archives that (deliberately or otherwise) extract
+files outside of the current directory.
+The default is not to perform this check.
+If
+</dd><dt>'''ARCHIVE_EXTRACT_SPARSE'''</dt><dd>
+Scan data for blocks of NUL bytes and try to recreate them with holes.
+This results in sparse files, independent of whether the archive format
+supports or uses them.
+'''ARCHIVE_EXTRACT_UNLINK'''
+is specified together with this option, the library will
+remove any intermediate symlinks it finds and return an
+error only if such symlink could not be removed.
</dd><dt>'''ARCHIVE_EXTRACT_TIME'''</dt><dd>
The timestamps (mtime, ctime, and atime) should be restored.
By default, they are ignored.
Note that restoring of atime is not currently supported.
-</dd><dt>'''ARCHIVE_EXTRACT_NO_OVERWRITE'''</dt><dd>
-Existing files on disk will not be overwritten.
-By default, existing regular files are truncated and overwritten;
-existing directories will have their permissions updated;
-other pre-existing objects are unlinked and recreated from scratch.
</dd><dt>'''ARCHIVE_EXTRACT_UNLINK'''</dt><dd>
Existing files on disk will be unlinked before any attempt to
create them.
@@ -136,45 +150,18 @@
By default, existing files are truncated and rewritten, but
the file is not recreated.
In particular, the default behavior does not break existing hard links.
-</dd><dt>'''ARCHIVE_EXTRACT_ACL'''</dt><dd>
-Attempt to restore ACLs.
-By default, extended ACLs are ignored.
-</dd><dt>'''ARCHIVE_EXTRACT_FFLAGS'''</dt><dd>
-Attempt to restore extended file flags.
-By default, file flags are ignored.
</dd><dt>'''ARCHIVE_EXTRACT_XATTR'''</dt><dd>
-Attempt to restore POSIX.1e extended attributes.
+Attempt to restore extended file attributes.
By default, they are ignored.
-</dd><dt>'''ARCHIVE_EXTRACT_SECURE_SYMLINKS'''</dt><dd>
-Refuse to extract any object whose final location would be altered
-by a symlink on disk.
-This is intended to help guard against a variety of mischief
-caused by archives that (deliberately or otherwise) extract
-files outside of the current directory.
-The default is not to perform this check.
-If
-'''ARCHIVE_EXTRACT_UNLINK'''
-is specified together with this option, the library will
-remove any intermediate symlinks it finds and return an
-error only if such symlink could not be removed.
-</dd><dt>'''ARCHIVE_EXTRACT_SECURE_NODOTDOT'''</dt><dd>
-Refuse to extract a path that contains a
-''..''
-element anywhere within it.
-The default is to not refuse such paths.
-Note that paths ending in
-''..''
-always cause an error, regardless of this flag.
-</dd><dt>'''ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS'''</dt><dd>
-Refuse to extract an absolute path.
-The default is to not refuse such paths.
-</dd><dt>'''ARCHIVE_EXTRACT_SPARSE'''</dt><dd>
-Scan data for blocks of NUL bytes and try to recreate them with holes.
-This results in sparse files, independent of whether the archive format
-supports or uses them.
-</dd><dt>'''ARCHIVE_EXTRACT_CLEAR_NOCHANGE_FFLAGS'''</dt><dd>
-Before removing a file system object prior to replacing it, clear
-platform-specific file flags which might prevent its removal.
+See
+[[xattr(7)|http://www.freebsd.org/cgi/man.cgi?query=xattr&sektion=7]]
+(Linux,)
+[[xattr(2)|http://www.freebsd.org/cgi/man.cgi?query=xattr&sektion=2]]
+(Mac OS X,)
+or
+[[getextattr(8)|http://www.freebsd.org/cgi/man.cgi?query=getextattr&sektion=8]]
+(FreeBSD)
+for more information on extended file attributes.
</dd></dl>
</dd><dt>
'''archive_write_disk_set_group_lookup'''(),
@@ -211,60 +198,6 @@
[[getpwnam(3)|http://www.freebsd.org/cgi/man.cgi?query=getpwnam&sektion=3]]
and
[[getgrnam(3)|http://www.freebsd.org/cgi/man.cgi?query=getgrnam&sektion=3]].
-</dd><dt>'''archive_write_header'''()</dt><dd>
-Build and write a header using the data in the provided
-'''struct archive_entry'''
-structure.
-See
-[[ManPagerchiventry3]]
-for information on creating and populating
-'''struct archive_entry'''
-objects.
-</dd><dt>'''archive_write_data'''()</dt><dd>
-Write data corresponding to the header just written.
-Returns number of bytes written or -1 on error.
-</dd><dt>'''archive_write_data_block'''()</dt><dd>
-Write data corresponding to the header just written.
-This is like
-'''archive_write_data'''()
-except that it performs a seek on the file being
-written to the specified offset before writing the data.
-This is useful when restoring sparse files from archive
-formats that support sparse files.
-Returns number of bytes written or -1 on error.
-(Note: This is currently not supported for
-'''archive_write'''
-handles, only for
-'''archive_write_disk'''
-handles.)
-</dd><dt>'''archive_write_finish_entry'''()</dt><dd>
-Close out the entry just written.
-Ordinarily, clients never need to call this, as it
-is called automatically by
-'''archive_write_next_header'''()
-and
-'''archive_write_close'''()
-as needed.
-However, some file attributes are written to disk only
-after the file is closed, so this can be necessary
-if you need to work with the file on disk right away.
-</dd><dt>'''archive_write_close'''()</dt><dd>
-Set any attributes that could not be set during the initial restore.
-For example, directory timestamps are not restored initially because
-restoring a subsequent file would alter that timestamp.
-Similarly, non-writable directories are initially created with
-write permissions (so that their contents can be restored).
-The
-'''archive_write_disk_new'''
-library maintains a list of all such deferred attributes and
-sets them when this function is invoked.
-</dd><dt>'''archive_write_finish'''()</dt><dd>
-This is a deprecated synonym for
-'''archive_write_free'''().
-</dd><dt>'''archive_write_free'''()</dt><dd>
-Invokes
-'''archive_write_close'''()
-if it was not invoked manually, then releases all resources.
</dd></dl>
More information about the
''struct'' archive
Modified: trunk/contrib/libarchive/doc/wiki/ManPageArchiveWriteFinishEntry3.wiki
===================================================================
--- trunk/contrib/libarchive/doc/wiki/ManPageArchiveWriteFinishEntry3.wiki 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/wiki/ManPageArchiveWriteFinishEntry3.wiki 2018-06-19 20:42:35 UTC (rev 11134)
@@ -19,6 +19,9 @@
and
'''archive_write_close'''()
as needed.
+For
+'''archive_write_disk'''
+handles, this flushes pending file attribute changes like modification time.
== RETURN VALUES ==
This function returns
'''ARCHIVE_OK'''
Modified: trunk/contrib/libarchive/doc/wiki/ManPageArchiveWriteOpen3.wiki
===================================================================
--- trunk/contrib/libarchive/doc/wiki/ManPageArchiveWriteOpen3.wiki 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/wiki/ManPageArchiveWriteOpen3.wiki 2018-06-19 20:42:35 UTC (rev 11134)
@@ -37,6 +37,7 @@
This is the most generic form of this function, which accepts
pointers to three callback functions which will be invoked by
the compression layer to write the constructed archive.
+This does not alter the default archive padding.
</dd><dt>'''archive_write_open_fd'''()</dt><dd>
A convenience form of
'''archive_write_open'''()
@@ -94,6 +95,8 @@
You should be careful to ensure that this variable
remains allocated until after the archive is
closed.
+This function will disable padding unless you
+have specifically set the block size.
</dd></dl>
More information about the
''struct'' archive
@@ -100,6 +103,13 @@
object and the overall design of the library can be found in the
[[ManPageibarchive3]]
overview.
+
+Note that the convenience forms above vary in how
+they block the output.
+See
+[[ManPagerchiveritelocksize3]]
+if you need to control the block size used for writes
+or the end-of-file padding behavior.
== CLIENT CALLBACKS ==
To use this library, you will need to define and register
callback functions that will be invoked to write data to the
@@ -188,6 +198,7 @@
[[ManPageBsdtar1]],
[[ManPageibarchive3]],
[[ManPagerchiverite3]],
+[[ManPagerchiveritelocksize3]],
[[ManPagerchiveriteilter3]],
[[ManPagerchiveriteormat3]],
[[ManPagerchiveriteew3]],
Modified: trunk/contrib/libarchive/doc/wiki/ManPageBsdtar1.wiki
===================================================================
--- trunk/contrib/libarchive/doc/wiki/ManPageBsdtar1.wiki 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/wiki/ManPageBsdtar1.wiki 2018-06-19 20:42:35 UTC (rev 11134)
@@ -100,7 +100,7 @@
all operating modes.
<dl>
<dt>'''@'''''archive''</dt><dd>
-(c and r mode only)
+(c and r modes only)
The specified archive is opened and the entries
in it will be appended to the current archive.
As a simple example,
@@ -156,6 +156,16 @@
```
if it is unknown suffix or no suffix, creates a new archive with
restricted pax format and bzip2 compression.
+</dd><dt>--acls</dt><dd>
+(c, r, u, x modes only)
+Archive or extract POSIX.1e or NFSv4 ACLs. This is the reverse of
+--no-acls
+and the default behavior in c, r, and u modes (except on Mac OS X) or if
+'''tar'''
+is run in x mode as root. On Mac OS X this option translates extended ACLs
+to NFSv4 ACLs. To store extended ACLs the
+--mac-metadata
+option is preferred.
</dd><dt>-B, --read-full-blocks</dt><dd>
Ignored for compatibility with other
[[ManPageBsdtar1]]
@@ -180,15 +190,18 @@
(x mode only)
Before removing file system objects to replace them, clear platform-specific
file flags that might prevent removal.
-</dd><dt>--disable-copyfile</dt><dd>
-Mac OS X specific.
-Disable the use of
-[[copyfile(3)|http://www.freebsd.org/cgi/man.cgi?query=copyfile&sektion=3]].
</dd><dt>--exclude ''pattern''</dt><dd>
Do not process files or directories that match the
specified pattern.
Note that exclusions take precedence over patterns or filenames
specified on the command line.
+</dd><dt>--fflags</dt><dd>
+(c, r, u, x modes only)
+Archive or extract file flags. This is the reverse of
+--no-fflags
+and the default behavior in c, r, and u modes or if
+'''tar'''
+is run in x mode as root.
</dd><dt>--format ''format''</dt><dd>
(c, r, u mode only)
Use the specified format for the created archive.
@@ -237,11 +250,11 @@
in the archive;
the name will not be verified against the system group database.
</dd><dt>-H</dt><dd>
-(c and r mode only)
+(c and r modes only)
Symbolic links named on the command line will be followed; the
target of the link will be archived, not the link itself.
</dd><dt>-h</dt><dd>
-(c and r mode only)
+(c and r modes only)
Synonym for
-L.
</dd><dt>-I</dt><dd>
@@ -251,7 +264,8 @@
Show usage.
</dd><dt>--hfsCompression</dt><dd>
(x mode only)
-Mac OS X specific(v10.6 or later). Compress extracted regular files with HFS+ compression.
+Mac OS X specific (v10.6 or later). Compress extracted regular files with HFS+
+compression.
</dd><dt>--ignore-zeros</dt><dd>
An alias of
--options '''read_concatenated_archives'''
@@ -304,7 +318,7 @@
Do not overwrite existing files that are newer than the
versions appearing in the archive being extracted.
</dd><dt>-L, --dereference</dt><dd>
-(c and r mode only)
+(c and r modes only)
All symbolic links will be followed.
Normally, symbolic links are archived as such.
With this option, the target of the link will be archived instead.
@@ -339,6 +353,16 @@
(x mode only)
Do not extract modification time.
By default, the modification time is set to the time stored in the archive.
+</dd><dt>--mac-metadata</dt><dd>
+(c, r, u and x mode only)
+Mac OS X specific. Archive or extract extended ACLs and extended attributes
+using
+[[copyfile(3)|http://www.freebsd.org/cgi/man.cgi?query=copyfile&sektion=3]]
+in AppleDouble format. This is the reverse of
+--no-mac-metadata.
+and the default behavior in c, r, and u modes or if
+'''tar'''
+is run in x mode as root.
</dd><dt>-n, --norecurse, --no-recursion</dt><dd>
(c, r, u modes only)
Do not recursively archive the contents of directories.
@@ -365,7 +389,7 @@
Honor the nodump file flag by skipping this file.
</dd><dt>--nopreserveHFSCompression</dt><dd>
(x mode only)
-Mac OS X specific(v10.6 or later). Do not compress extracted regular files
+Mac OS X specific (v10.6 or later). Do not compress extracted regular files
which were compressed with HFS+ compression before archived.
By default, compress the regular files again with HFS+ compression.
</dd><dt>--null</dt><dd>
@@ -379,6 +403,30 @@
-print0
option to
[[find(1)|http://www.freebsd.org/cgi/man.cgi?query=find&sektion=1]].
+</dd><dt>--no-acls</dt><dd>
+(c, r, u, x modes only)
+Do not archive or extract POSIX.1e or NFSv4 ACLs. This is the reverse of
+--acls
+and the default behavior if
+'''tar'''
+is run as non-root in x mode (on Mac OS X as any user in c, r, u and x modes).
+</dd><dt>--no-fflags</dt><dd>
+(c, r, u, x modes only)
+Do not archive or extract file flags. This is the reverse of
+--fflags
+and the default behavior if
+'''tar'''
+is run as non-root in x mode.
+</dd><dt>--no-mac-metadata</dt><dd>
+(x mode only)
+Mac OS X specific. Do not archive or extract ACLs and extended attributes using
+[[copyfile(3)|http://www.freebsd.org/cgi/man.cgi?query=copyfile&sektion=3]]
+in AppleDouble format. This is the reverse of
+--mac-metadata.
+and the default behavior if
+'''tar'''
+is run as non-root in x mode.
+</dd><dt>-n, --norecurse, --no-recursion</dt><dd>
</dd><dt>--no-same-owner</dt><dd>
(x mode only)
Do not extract owner and group IDs.
@@ -396,6 +444,13 @@
and the default behavior if
'''tar'''
is run as non-root.
+</dd><dt>--no-xattrs</dt><dd>
+(c, r, u, x modes only)
+Do not archive or extract extended attributes. This is the reverse of
+--xattrs
+and the default behavior if
+'''tar'''
+is run as non-root in x mode.
</dd><dt>--numeric-owner</dt><dd>
This is equivalent to
--uname
@@ -577,14 +632,18 @@
</dd><dt>-p, --insecure, --preserve-permissions</dt><dd>
(x mode only)
Preserve file permissions.
-Attempt to restore the full permissions, including owner, file modes, file
-flags and ACLs, if available, for each item extracted from the archive.
-This is the default, if
+Attempt to restore the full permissions, including owner, file modes, ACLs,
+extended attributes and extended file flags, if available, for each item
+extracted from the archive. This is te reverse of
+--no-same-permissions
+and the default if
'''tar'''
-is being run by root and can be overridden by also specifying
---no-same-owner
-and
---no-same-permissions.
+is being run by root and can be partially overridden by also specifying
+--no-acls,
+--no-fflags,
+--no-mac-metadata
+or
+--no-xattrs.
</dd><dt>--passphrase ''passphrase''</dt><dd>
The
''passphrase''
@@ -686,7 +745,7 @@
-n
as well.
</dd><dt>--totals</dt><dd>
-(c, r, u mode only)
+(c, r, u modes only)
After archiving all files, print a summary to stderr.
</dd><dt>-U, --unlink, --unlink-first</dt><dd>
(x mode only)
@@ -748,6 +807,13 @@
See
--exclude
for more information about the handling of exclusions.
+</dd><dt>--xattrs</dt><dd>
+(c, r, u, x modes only)
+Archive or extract extended attributes. This is the reverse of
+--no-xattrs
+and the default behavior in c, r, and u modes or if
+'''tar'''
+is run in x mode as root.
</dd><dt>-y</dt><dd>
(c mode only)
Compress the resulting archive with
Modified: trunk/contrib/libarchive/doc/wiki/ManPageLibarchiveChanges3.wiki
===================================================================
--- trunk/contrib/libarchive/doc/wiki/ManPageLibarchiveChanges3.wiki 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/wiki/ManPageLibarchiveChanges3.wiki 2018-06-19 20:42:35 UTC (rev 11134)
@@ -1,5 +1,6 @@
LIBARCHIVE_CHANGES(3) manual page
== NAME ==
+'''libarchive_changes'''
- changes in libarchive interface
== CHANGES IN LIBARCHIVE 3 ==
This page describes user-visible changes in libarchive3, and lists
Modified: trunk/contrib/libarchive/doc/wiki/ManPageLibarchiveFormats5.wiki
===================================================================
--- trunk/contrib/libarchive/doc/wiki/ManPageLibarchiveFormats5.wiki 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/wiki/ManPageLibarchiveFormats5.wiki 2018-06-19 20:42:35 UTC (rev 11134)
@@ -163,8 +163,6 @@
</dd><dt>Solaris extensions</dt><dd>
Libarchive recognizes ACL and extended attribute records written
by Solaris tar.
-Currently, libarchive only has support for old-style ACLs; the
-newer NFSv4 ACLs are recognized but discarded.
</dd></dl>
The first tar program appeared in Seventh Edition Unix in 1979.
Modified: trunk/contrib/libarchive/doc/wiki/ManPageMtree5.wiki
===================================================================
--- trunk/contrib/libarchive/doc/wiki/ManPageMtree5.wiki 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/wiki/ManPageMtree5.wiki 2018-06-19 20:42:35 UTC (rev 11134)
@@ -16,7 +16,7 @@
When encoding file or pathnames, any backslash character or
character outside of the 95 printable ASCII characters must be
-encoded as a a backslash followed by three
+encoded as a backslash followed by three
octal digits.
When reading mtree files, any appearance of a backslash
followed by three octal digits should be converted into the
Modified: trunk/contrib/libarchive/doc/wiki/ManPageTar5.wiki
===================================================================
--- trunk/contrib/libarchive/doc/wiki/ManPageTar5.wiki 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/doc/wiki/ManPageTar5.wiki 2018-06-19 20:42:35 UTC (rev 11134)
@@ -414,11 +414,11 @@
Vendor-specific attributes used by Joerg Schilling's
'''star'''
implementation.
-</dd><dt>'''SCHILY.acl.access''', '''SCHILY.acl.default'''</dt><dd>
-Stores the access and default ACLs as textual strings in a format
+</dd><dt>'''SCHILY.acl.access''', '''SCHILY.acl.default,''' '''SCHILY.acl.ace'''</dt><dd>
+Stores the access, default and NFSv4 ACLs as textual strings in a format
that is an extension of the format specified by POSIX.1e draft 17.
-In particular, each user or group access specification can include a fourth
-colon-separated field with the numeric UID or GID.
+In particular, each user or group access specification can include
+an additional colon-separated field with the numeric UID or GID.
This allows ACLs to be restored on systems that may not have complete
user or group information available (such as when NIS/YP or LDAP services
are temporarily unavailable).
Modified: trunk/contrib/libarchive/examples/minitar/minitar.c
===================================================================
--- trunk/contrib/libarchive/examples/minitar/minitar.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/examples/minitar/minitar.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -222,7 +222,6 @@
create(const char *filename, int compress, const char **argv)
{
struct archive *a;
- struct archive *disk;
struct archive_entry *entry;
ssize_t len;
int fd;
@@ -253,12 +252,11 @@
filename = NULL;
archive_write_open_filename(a, filename);
- disk = archive_read_disk_new();
+ while (*argv != NULL) {
+ struct archive *disk = archive_read_disk_new();
#ifndef NO_LOOKUP
- archive_read_disk_set_standard_lookup(disk);
+ archive_read_disk_set_standard_lookup(disk);
#endif
- while (*argv != NULL) {
- struct archive *disk = archive_read_disk_new();
int r;
r = archive_read_disk_open(disk, *argv);
Modified: trunk/contrib/libarchive/libarchive/CMakeLists.txt
===================================================================
--- trunk/contrib/libarchive/libarchive/CMakeLists.txt 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/CMakeLists.txt 2018-06-19 20:42:35 UTC (rev 11134)
@@ -14,6 +14,7 @@
# Sources and private headers
SET(libarchive_SOURCES
archive_acl.c
+ archive_acl_private.h
archive_check_magic.c
archive_cmdline.c
archive_cmdline_private.h
@@ -38,6 +39,8 @@
archive_hmac.c
archive_hmac_private.h
archive_match.c
+ archive_openssl_evp_private.h
+ archive_openssl_hmac_private.h
archive_options.c
archive_options_private.h
archive_pack_dev.h
@@ -45,6 +48,8 @@
archive_pathmatch.c
archive_pathmatch.h
archive_platform.h
+ archive_platform_acl.h
+ archive_platform_xattr.h
archive_ppmd_private.h
archive_ppmd7.c
archive_ppmd7_private.h
@@ -104,9 +109,9 @@
archive_string_composition.h
archive_string_sprintf.c
archive_util.c
+ archive_version_details.c
archive_virtual.c
archive_write.c
- archive_write_disk_acl.c
archive_write_disk_posix.c
archive_write_disk_private.h
archive_write_disk_set_standard_lookup.c
@@ -166,15 +171,33 @@
archive_entry_time.3
archive_read.3
archive_read_add_passphrase.3
+ archive_read_data.3
archive_read_disk.3
+ archive_read_extract.3
+ archive_read_filter.3
+ archive_read_format.3
+ archive_read_free.3
+ archive_read_header.3
+ archive_read_new.3
+ archive_read_open.3
archive_read_set_options.3
archive_util.3
archive_write.3
+ archive_write_blocksize.3
+ archive_write_data.3
archive_write_disk.3
+ archive_write_filter.3
+ archive_write_finish_entry.3
+ archive_write_format.3
+ archive_write_free.3
+ archive_write_header.3
+ archive_write_new.3
+ archive_write_open.3
archive_write_set_options.3
archive_write_set_passphrase.3
cpio.5
libarchive.3
+ libarchive_changes.3
libarchive_internals.3
libarchive-formats.5
mtree.5
@@ -190,6 +213,16 @@
LIST(APPEND libarchive_SOURCES filter_fork_windows.c)
ENDIF(WIN32 AND NOT CYGWIN)
+IF(ARCHIVE_ACL_DARWIN)
+ LIST(APPEND libarchive_SOURCES archive_disk_acl_darwin.c)
+ELSEIF(ARCHIVE_ACL_FREEBSD)
+ LIST(APPEND libarchive_SOURCES archive_disk_acl_freebsd.c)
+ELSEIF(ARCHIVE_ACL_LIBACL)
+ LIST(APPEND libarchive_SOURCES archive_disk_acl_linux.c)
+ELSEIF(ARCHIVE_ACL_SUNOS)
+ LIST(APPEND libarchive_SOURCES archive_disk_acl_sunos.c)
+ENDIF()
+
# Libarchive is a shared library
ADD_LIBRARY(archive SHARED ${libarchive_SOURCES} ${include_HEADERS})
TARGET_LINK_LIBRARIES(archive ${ADDITIONAL_LIBS})
Modified: trunk/contrib/libarchive/libarchive/archive.h
===================================================================
--- trunk/contrib/libarchive/libarchive/archive.h 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/archive.h 2018-06-19 20:42:35 UTC (rev 11134)
@@ -36,7 +36,7 @@
* assert that ARCHIVE_VERSION_NUMBER >= 2012108.
*/
/* Note: Compiler will complain if this does not match archive_entry.h! */
-#define ARCHIVE_VERSION_NUMBER 3002001
+#define ARCHIVE_VERSION_NUMBER 3003002
#include <sys/stat.h>
#include <stddef.h> /* for wchar_t */
@@ -155,7 +155,7 @@
/*
* Textual name/version of the library, useful for version displays.
*/
-#define ARCHIVE_VERSION_ONLY_STRING "3.2.1"
+#define ARCHIVE_VERSION_ONLY_STRING "3.3.2"
#define ARCHIVE_VERSION_STRING "libarchive " ARCHIVE_VERSION_ONLY_STRING
__LA_DECL const char * archive_version_string(void);
@@ -373,7 +373,7 @@
* 4) Repeatedly call archive_read_next_header to get information about
* successive archive entries. Call archive_read_data to extract
* data for entries of interest.
- * 5) Call archive_read_finish to end processing.
+ * 5) Call archive_read_free to end processing.
*/
__LA_DECL struct archive *archive_read_new(void);
@@ -562,7 +562,7 @@
* we cannot say whether there are encrypted entries, then
* ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW is returned.
* In general, this function will return values below zero when the
- * reader is uncertain or totally uncapable of encryption support.
+ * reader is uncertain or totally incapable of encryption support.
* When this function returns 0 you can be sure that the reader
* supports encryption detection but no encrypted entries have
* been found yet.
@@ -984,12 +984,12 @@
__LA_DECL int archive_read_disk_current_filesystem(struct archive *);
__LA_DECL int archive_read_disk_current_filesystem_is_synthetic(struct archive *);
__LA_DECL int archive_read_disk_current_filesystem_is_remote(struct archive *);
-/* Request that the access time of the entry visited by travesal be restored. */
+/* Request that the access time of the entry visited by traversal be restored. */
__LA_DECL int archive_read_disk_set_atime_restored(struct archive *);
/*
* Set behavior. The "flags" argument selects optional behavior.
*/
-/* Request that the access time of the entry visited by travesal be restored.
+/* Request that the access time of the entry visited by traversal be restored.
* This is the same as archive_read_disk_set_atime_restored. */
#define ARCHIVE_READDISK_RESTORE_ATIME (0x0001)
/* Default: Do not skip an entry which has nodump flags. */
@@ -1001,6 +1001,10 @@
#define ARCHIVE_READDISK_NO_TRAVERSE_MOUNTS (0x0008)
/* Default: Xattrs are read from disk. */
#define ARCHIVE_READDISK_NO_XATTR (0x0010)
+/* Default: ACLs are read from disk. */
+#define ARCHIVE_READDISK_NO_ACL (0x0020)
+/* Default: File flags are read from disk. */
+#define ARCHIVE_READDISK_NO_FFLAGS (0x0040)
__LA_DECL int archive_read_disk_set_behavior(struct archive *,
int flags);
@@ -1124,7 +1128,7 @@
/*
* Flags to tell a matching type of time stamps. These are used for
- * following functinos.
+ * following functions.
*/
/* Time flag: mtime to be tested. */
#define ARCHIVE_MATCH_MTIME (0x0100)
@@ -1144,7 +1148,7 @@
const char *_datestr);
__LA_DECL int archive_match_include_date_w(struct archive *, int _flag,
const wchar_t *_datestr);
-/* Set inclusion time by a particluar file. */
+/* Set inclusion time by a particular file. */
__LA_DECL int archive_match_include_file_time(struct archive *,
int _flag, const char *_pathname);
__LA_DECL int archive_match_include_file_time_w(struct archive *,
Modified: trunk/contrib/libarchive/libarchive/archive_acl.c
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_acl.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/archive_acl.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -1,5 +1,6 @@
/*-
* Copyright (c) 2003-2010 Tim Kientzle
+ * Copyright (c) 2016 Martin Matuska
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -55,25 +56,77 @@
static int archive_acl_add_entry_len_l(struct archive_acl *acl,
int type, int permset, int tag, int id, const char *name,
size_t len, struct archive_string_conv *sc);
+static int archive_acl_text_want_type(struct archive_acl *acl, int flags);
+static ssize_t archive_acl_text_len(struct archive_acl *acl, int want_type,
+ int flags, int wide, struct archive *a,
+ struct archive_string_conv *sc);
static int isint_w(const wchar_t *start, const wchar_t *end, int *result);
static int ismode_w(const wchar_t *start, const wchar_t *end, int *result);
+static int is_nfs4_flags_w(const wchar_t *start, const wchar_t *end,
+ int *result);
+static int is_nfs4_perms_w(const wchar_t *start, const wchar_t *end,
+ int *result);
static void next_field_w(const wchar_t **wp, const wchar_t **start,
const wchar_t **end, wchar_t *sep);
-static int prefix_w(const wchar_t *start, const wchar_t *end,
- const wchar_t *test);
-static void append_entry_w(wchar_t **wp, const wchar_t *prefix, int tag,
- const wchar_t *wname, int perm, int id);
+static void append_entry_w(wchar_t **wp, const wchar_t *prefix, int type,
+ int tag, int flags, const wchar_t *wname, int perm, int id);
static void append_id_w(wchar_t **wp, int id);
static int isint(const char *start, const char *end, int *result);
static int ismode(const char *start, const char *end, int *result);
+static int is_nfs4_flags(const char *start, const char *end,
+ int *result);
+static int is_nfs4_perms(const char *start, const char *end,
+ int *result);
static void next_field(const char **p, const char **start,
const char **end, char *sep);
-static int prefix_c(const char *start, const char *end,
- const char *test);
-static void append_entry(char **p, const char *prefix, int tag,
- const char *name, int perm, int id);
+static void append_entry(char **p, const char *prefix, int type,
+ int tag, int flags, const char *name, int perm, int id);
static void append_id(char **p, int id);
+static const struct {
+ const int perm;
+ const char c;
+ const wchar_t wc;
+} nfsv4_acl_perm_map[] = {
+ { ARCHIVE_ENTRY_ACL_READ_DATA | ARCHIVE_ENTRY_ACL_LIST_DIRECTORY, 'r',
+ L'r' },
+ { ARCHIVE_ENTRY_ACL_WRITE_DATA | ARCHIVE_ENTRY_ACL_ADD_FILE, 'w',
+ L'w' },
+ { ARCHIVE_ENTRY_ACL_EXECUTE, 'x', L'x' },
+ { ARCHIVE_ENTRY_ACL_APPEND_DATA | ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY,
+ 'p', L'p' },
+ { ARCHIVE_ENTRY_ACL_DELETE, 'd', L'd' },
+ { ARCHIVE_ENTRY_ACL_DELETE_CHILD, 'D', L'D' },
+ { ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES, 'a', L'a' },
+ { ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES, 'A', L'A' },
+ { ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS, 'R', L'R' },
+ { ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS, 'W', L'W' },
+ { ARCHIVE_ENTRY_ACL_READ_ACL, 'c', L'c' },
+ { ARCHIVE_ENTRY_ACL_WRITE_ACL, 'C', L'C' },
+ { ARCHIVE_ENTRY_ACL_WRITE_OWNER, 'o', L'o' },
+ { ARCHIVE_ENTRY_ACL_SYNCHRONIZE, 's', L's' }
+};
+
+static const int nfsv4_acl_perm_map_size = (int)(sizeof(nfsv4_acl_perm_map) /
+ sizeof(nfsv4_acl_perm_map[0]));
+
+static const struct {
+ const int perm;
+ const char c;
+ const wchar_t wc;
+} nfsv4_acl_flag_map[] = {
+ { ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT, 'f', L'f' },
+ { ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT, 'd', L'd' },
+ { ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY, 'i', L'i' },
+ { ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT, 'n', L'n' },
+ { ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS, 'S', L'S' },
+ { ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS, 'F', L'F' },
+ { ARCHIVE_ENTRY_ACL_ENTRY_INHERITED, 'I', L'I' }
+};
+
+static const int nfsv4_acl_flag_map_size = (int)(sizeof(nfsv4_acl_flag_map) /
+ sizeof(nfsv4_acl_flag_map[0]));
+
void
archive_acl_clear(struct archive_acl *acl)
{
@@ -94,6 +147,7 @@
acl->acl_text = NULL;
}
acl->acl_p = NULL;
+ acl->acl_types = 0;
acl->acl_state = 0; /* Not counting. */
}
@@ -279,13 +333,22 @@
acl->acl_text = NULL;
}
- /* If there's a matching entry already in the list, overwrite it. */
+ /*
+ * If there's a matching entry already in the list, overwrite it.
+ * NFSv4 entries may be repeated and are not overwritten.
+ *
+ * TODO: compare names of no id is provided (needs more rework)
+ */
ap = acl->acl_head;
aq = NULL;
while (ap != NULL) {
- if (ap->type == type && ap->tag == tag && ap->id == id) {
- ap->permset = permset;
- return (ap);
+ if (((type & ARCHIVE_ENTRY_ACL_TYPE_NFS4) == 0) &&
+ ap->type == type && ap->tag == tag && ap->id == id) {
+ if (id != -1 || (tag != ARCHIVE_ENTRY_ACL_USER &&
+ tag != ARCHIVE_ENTRY_ACL_GROUP)) {
+ ap->permset = permset;
+ return (ap);
+ }
}
aq = ap;
ap = ap->next;
@@ -292,10 +355,9 @@
}
/* Add a new entry to the end of the list. */
- ap = (struct archive_acl_entry *)malloc(sizeof(*ap));
+ ap = (struct archive_acl_entry *)calloc(1, sizeof(*ap));
if (ap == NULL)
return (NULL);
- memset(ap, 0, sizeof(*ap));
if (aq == NULL)
acl->acl_head = ap;
else
@@ -331,6 +393,15 @@
}
/*
+ * Return a bitmask of stored ACL types in an ACL list
+ */
+int
+archive_acl_types(struct archive_acl *acl)
+{
+ return (acl->acl_types);
+}
+
+/*
* Prepare for reading entries from the ACL data. Returns a count
* of entries matching "want_type", or zero if there are no
* non-extended ACL entries of that type.
@@ -366,8 +437,8 @@
* standard permissions and include them in the returned list.
*/
int
-archive_acl_next(struct archive *a, struct archive_acl *acl, int want_type, int *type,
- int *permset, int *tag, int *id, const char **name)
+archive_acl_next(struct archive *a, struct archive_acl *acl, int want_type,
+ int *type, int *permset, int *tag, int *id, const char **name)
{
*name = NULL;
*id = -1;
@@ -432,131 +503,274 @@
}
/*
- * Generate a text version of the ACL. The flags parameter controls
- * the style of the generated ACL.
+ * Determine what type of ACL do we want
*/
-const wchar_t *
-archive_acl_text_w(struct archive *a, struct archive_acl *acl, int flags)
+static int
+archive_acl_text_want_type(struct archive_acl *acl, int flags)
{
- int count;
- size_t length;
- const wchar_t *wname;
- const wchar_t *prefix;
- wchar_t separator;
- struct archive_acl_entry *ap;
- int id, r;
- wchar_t *wp;
+ int want_type;
- if (acl->acl_text_w != NULL) {
- free (acl->acl_text_w);
- acl->acl_text_w = NULL;
+ /* Check if ACL is NFSv4 */
+ if ((acl->acl_types & ARCHIVE_ENTRY_ACL_TYPE_NFS4) != 0) {
+ /* NFSv4 should never mix with POSIX.1e */
+ if ((acl->acl_types & ARCHIVE_ENTRY_ACL_TYPE_POSIX1E) != 0)
+ return (0);
+ else
+ return (ARCHIVE_ENTRY_ACL_TYPE_NFS4);
}
- separator = L',';
+ /* Now deal with POSIX.1e ACLs */
+
+ want_type = 0;
+ if ((flags & ARCHIVE_ENTRY_ACL_TYPE_ACCESS) != 0)
+ want_type |= ARCHIVE_ENTRY_ACL_TYPE_ACCESS;
+ if ((flags & ARCHIVE_ENTRY_ACL_TYPE_DEFAULT) != 0)
+ want_type |= ARCHIVE_ENTRY_ACL_TYPE_DEFAULT;
+
+ /* By default we want both access and default ACLs */
+ if (want_type == 0)
+ return (ARCHIVE_ENTRY_ACL_TYPE_POSIX1E);
+
+ return (want_type);
+}
+
+/*
+ * Calculate ACL text string length
+ */
+static ssize_t
+archive_acl_text_len(struct archive_acl *acl, int want_type, int flags,
+ int wide, struct archive *a, struct archive_string_conv *sc) {
+ struct archive_acl_entry *ap;
+ const char *name;
+ const wchar_t *wname;
+ int count, idlen, tmp, r;
+ ssize_t length;
+ size_t len;
+
count = 0;
length = 0;
- ap = acl->acl_head;
- while (ap != NULL) {
- if ((ap->type & flags) != 0) {
- count++;
- if ((flags & ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT) &&
- (ap->type & ARCHIVE_ENTRY_ACL_TYPE_DEFAULT))
- length += 8; /* "default:" */
- length += 5; /* tag name */
- length += 1; /* colon */
- r = archive_mstring_get_wcs(a, &ap->name, &wname);
- if (r == 0 && wname != NULL)
- length += wcslen(wname);
- else if (r < 0 && errno == ENOMEM)
- return (NULL);
- else
- length += sizeof(uid_t) * 3 + 1;
- length ++; /* colon */
+ for (ap = acl->acl_head; ap != NULL; ap = ap->next) {
+ if ((ap->type & want_type) == 0)
+ continue;
+ /*
+ * Filemode-mapping ACL entries are stored exclusively in
+ * ap->mode so they should not be in the list
+ */
+ if ((ap->type == ARCHIVE_ENTRY_ACL_TYPE_ACCESS)
+ && (ap->tag == ARCHIVE_ENTRY_ACL_USER_OBJ
+ || ap->tag == ARCHIVE_ENTRY_ACL_GROUP_OBJ
+ || ap->tag == ARCHIVE_ENTRY_ACL_OTHER))
+ continue;
+ count++;
+ if ((want_type & ARCHIVE_ENTRY_ACL_TYPE_DEFAULT) != 0
+ && (ap->type & ARCHIVE_ENTRY_ACL_TYPE_DEFAULT) != 0)
+ length += 8; /* "default:" */
+ switch (ap->tag) {
+ case ARCHIVE_ENTRY_ACL_USER_OBJ:
+ if (want_type == ARCHIVE_ENTRY_ACL_TYPE_NFS4) {
+ length += 6; /* "owner@" */
+ break;
+ }
+ /* FALLTHROUGH */
+ case ARCHIVE_ENTRY_ACL_USER:
+ case ARCHIVE_ENTRY_ACL_MASK:
+ length += 4; /* "user", "mask" */
+ break;
+ case ARCHIVE_ENTRY_ACL_GROUP_OBJ:
+ if (want_type == ARCHIVE_ENTRY_ACL_TYPE_NFS4) {
+ length += 6; /* "group@" */
+ break;
+ }
+ /* FALLTHROUGH */
+ case ARCHIVE_ENTRY_ACL_GROUP:
+ case ARCHIVE_ENTRY_ACL_OTHER:
+ length += 5; /* "group", "other" */
+ break;
+ case ARCHIVE_ENTRY_ACL_EVERYONE:
+ length += 9; /* "everyone@" */
+ break;
+ }
+ length += 1; /* colon after tag */
+ if (ap->tag == ARCHIVE_ENTRY_ACL_USER ||
+ ap->tag == ARCHIVE_ENTRY_ACL_GROUP) {
+ if (wide) {
+ r = archive_mstring_get_wcs(a, &ap->name,
+ &wname);
+ if (r == 0 && wname != NULL)
+ length += wcslen(wname);
+ else if (r < 0 && errno == ENOMEM)
+ return (0);
+ else
+ length += sizeof(uid_t) * 3 + 1;
+ } else {
+ r = archive_mstring_get_mbs_l(&ap->name, &name,
+ &len, sc);
+ if (r != 0)
+ return (0);
+ if (len > 0 && name != NULL)
+ length += len;
+ else
+ length += sizeof(uid_t) * 3 + 1;
+ }
+ length += 1; /* colon after user or group name */
+ } else if (want_type != ARCHIVE_ENTRY_ACL_TYPE_NFS4)
+ length += 1; /* 2nd colon empty user,group or other */
+
+ if (((flags & ARCHIVE_ENTRY_ACL_STYLE_SOLARIS) != 0)
+ && ((want_type & ARCHIVE_ENTRY_ACL_TYPE_POSIX1E) != 0)
+ && (ap->tag == ARCHIVE_ENTRY_ACL_OTHER
+ || ap->tag == ARCHIVE_ENTRY_ACL_MASK)) {
+ /* Solaris has no colon after other: and mask: */
+ length = length - 1;
+ }
+
+ if (want_type == ARCHIVE_ENTRY_ACL_TYPE_NFS4) {
+ /* rwxpdDaARWcCos:fdinSFI:deny */
+ length += 27;
+ if ((ap->type & ARCHIVE_ENTRY_ACL_TYPE_DENY) == 0)
+ length += 1; /* allow, alarm, audit */
+ } else
length += 3; /* rwx */
+
+ if ((ap->tag == ARCHIVE_ENTRY_ACL_USER ||
+ ap->tag == ARCHIVE_ENTRY_ACL_GROUP) &&
+ (flags & ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID) != 0) {
length += 1; /* colon */
- length += max(sizeof(uid_t), sizeof(gid_t)) * 3 + 1;
- length ++; /* newline */
+ /* ID digit count */
+ idlen = 1;
+ tmp = ap->id;
+ while (tmp > 9) {
+ tmp = tmp / 10;
+ idlen++;
+ }
+ length += idlen;
}
- ap = ap->next;
+ length ++; /* entry separator */
}
- if (count > 0 && ((flags & ARCHIVE_ENTRY_ACL_TYPE_ACCESS) != 0)) {
- length += 10; /* "user::rwx\n" */
- length += 11; /* "group::rwx\n" */
- length += 11; /* "other::rwx\n" */
- }
+ /* Add filemode-mapping access entries to the length */
+ if ((want_type & ARCHIVE_ENTRY_ACL_TYPE_ACCESS) != 0) {
+ if ((flags & ARCHIVE_ENTRY_ACL_STYLE_SOLARIS) != 0) {
+ /* "user::rwx\ngroup::rwx\nother:rwx\n" */
+ length += 31;
+ } else {
+ /* "user::rwx\ngroup::rwx\nother::rwx\n" */
+ length += 32;
+ }
+ } else if (count == 0)
+ return (0);
- if (count == 0)
+ /* The terminating character is included in count */
+ return (length);
+}
+
+/*
+ * Generate a wide text version of the ACL. The flags parameter controls
+ * the type and style of the generated ACL.
+ */
+wchar_t *
+archive_acl_to_text_w(struct archive_acl *acl, ssize_t *text_len, int flags,
+ struct archive *a)
+{
+ int count;
+ ssize_t length;
+ size_t len;
+ const wchar_t *wname;
+ const wchar_t *prefix;
+ wchar_t separator;
+ struct archive_acl_entry *ap;
+ int id, r, want_type;
+ wchar_t *wp, *ws;
+
+ want_type = archive_acl_text_want_type(acl, flags);
+
+ /* Both NFSv4 and POSIX.1 types found */
+ if (want_type == 0)
return (NULL);
+ if (want_type == ARCHIVE_ENTRY_ACL_TYPE_POSIX1E)
+ flags |= ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT;
+
+ length = archive_acl_text_len(acl, want_type, flags, 1, a, NULL);
+
+ if (length == 0)
+ return (NULL);
+
+ if (flags & ARCHIVE_ENTRY_ACL_STYLE_SEPARATOR_COMMA)
+ separator = L',';
+ else
+ separator = L'\n';
+
/* Now, allocate the string and actually populate it. */
- wp = acl->acl_text_w = (wchar_t *)malloc(length * sizeof(wchar_t));
- if (wp == NULL)
+ wp = ws = (wchar_t *)malloc(length * sizeof(wchar_t));
+ if (wp == NULL) {
+ if (errno == ENOMEM)
+ __archive_errx(1, "No memory");
return (NULL);
+ }
count = 0;
- if ((flags & ARCHIVE_ENTRY_ACL_TYPE_ACCESS) != 0) {
- append_entry_w(&wp, NULL, ARCHIVE_ENTRY_ACL_USER_OBJ, NULL,
+
+ if ((want_type & ARCHIVE_ENTRY_ACL_TYPE_ACCESS) != 0) {
+ append_entry_w(&wp, NULL, ARCHIVE_ENTRY_ACL_TYPE_ACCESS,
+ ARCHIVE_ENTRY_ACL_USER_OBJ, flags, NULL,
acl->mode & 0700, -1);
- *wp++ = ',';
- append_entry_w(&wp, NULL, ARCHIVE_ENTRY_ACL_GROUP_OBJ, NULL,
+ *wp++ = separator;
+ append_entry_w(&wp, NULL, ARCHIVE_ENTRY_ACL_TYPE_ACCESS,
+ ARCHIVE_ENTRY_ACL_GROUP_OBJ, flags, NULL,
acl->mode & 0070, -1);
- *wp++ = ',';
- append_entry_w(&wp, NULL, ARCHIVE_ENTRY_ACL_OTHER, NULL,
+ *wp++ = separator;
+ append_entry_w(&wp, NULL, ARCHIVE_ENTRY_ACL_TYPE_ACCESS,
+ ARCHIVE_ENTRY_ACL_OTHER, flags, NULL,
acl->mode & 0007, -1);
count += 3;
-
- ap = acl->acl_head;
- while (ap != NULL) {
- if ((ap->type & ARCHIVE_ENTRY_ACL_TYPE_ACCESS) != 0) {
- r = archive_mstring_get_wcs(a, &ap->name, &wname);
- if (r == 0) {
- *wp++ = separator;
- if (flags & ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID)
- id = ap->id;
- else
- id = -1;
- append_entry_w(&wp, NULL, ap->tag, wname,
- ap->permset, id);
- count++;
- } else if (r < 0 && errno == ENOMEM)
- return (NULL);
- }
- ap = ap->next;
- }
}
-
- if ((flags & ARCHIVE_ENTRY_ACL_TYPE_DEFAULT) != 0) {
- if (flags & ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT)
+ for (ap = acl->acl_head; ap != NULL; ap = ap->next) {
+ if ((ap->type & want_type) == 0)
+ continue;
+ /*
+ * Filemode-mapping ACL entries are stored exclusively in
+ * ap->mode so they should not be in the list
+ */
+ if ((ap->type == ARCHIVE_ENTRY_ACL_TYPE_ACCESS)
+ && (ap->tag == ARCHIVE_ENTRY_ACL_USER_OBJ
+ || ap->tag == ARCHIVE_ENTRY_ACL_GROUP_OBJ
+ || ap->tag == ARCHIVE_ENTRY_ACL_OTHER))
+ continue;
+ if (ap->type == ARCHIVE_ENTRY_ACL_TYPE_DEFAULT &&
+ (flags & ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT) != 0)
prefix = L"default:";
else
prefix = NULL;
- ap = acl->acl_head;
- count = 0;
- while (ap != NULL) {
- if ((ap->type & ARCHIVE_ENTRY_ACL_TYPE_DEFAULT) != 0) {
- r = archive_mstring_get_wcs(a, &ap->name, &wname);
- if (r == 0) {
- if (count > 0)
- *wp++ = separator;
- if (flags & ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID)
- id = ap->id;
- else
- id = -1;
- append_entry_w(&wp, prefix, ap->tag,
- wname, ap->permset, id);
- count ++;
- } else if (r < 0 && errno == ENOMEM)
- return (NULL);
- }
- ap = ap->next;
- }
+ r = archive_mstring_get_wcs(a, &ap->name, &wname);
+ if (r == 0) {
+ if (count > 0)
+ *wp++ = separator;
+ if (flags & ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID)
+ id = ap->id;
+ else
+ id = -1;
+ append_entry_w(&wp, prefix, ap->type, ap->tag, flags,
+ wname, ap->permset, id);
+ count++;
+ } else if (r < 0 && errno == ENOMEM)
+ return (NULL);
}
- return (acl->acl_text_w);
+ /* Add terminating character */
+ *wp++ = L'\0';
+
+ len = wcslen(ws);
+
+ if ((ssize_t)len > (length - 1))
+ __archive_errx(1, "Buffer overrun");
+
+ if (text_len != NULL)
+ *text_len = len;
+
+ return (ws);
}
-
static void
append_id_w(wchar_t **wp, int id)
{
@@ -568,9 +782,11 @@
}
static void
-append_entry_w(wchar_t **wp, const wchar_t *prefix, int tag,
- const wchar_t *wname, int perm, int id)
+append_entry_w(wchar_t **wp, const wchar_t *prefix, int type,
+ int tag, int flags, const wchar_t *wname, int perm, int id)
{
+ int i;
+
if (prefix != NULL) {
wcscpy(*wp, prefix);
*wp += wcslen(*wp);
@@ -579,6 +795,10 @@
case ARCHIVE_ENTRY_ACL_USER_OBJ:
wname = NULL;
id = -1;
+ if ((type & ARCHIVE_ENTRY_ACL_TYPE_NFS4) != 0) {
+ wcscpy(*wp, L"owner@");
+ break;
+ }
/* FALLTHROUGH */
case ARCHIVE_ENTRY_ACL_USER:
wcscpy(*wp, L"user");
@@ -586,6 +806,10 @@
case ARCHIVE_ENTRY_ACL_GROUP_OBJ:
wname = NULL;
id = -1;
+ if ((type & ARCHIVE_ENTRY_ACL_TYPE_NFS4) != 0) {
+ wcscpy(*wp, L"group@");
+ break;
+ }
/* FALLTHROUGH */
case ARCHIVE_ENTRY_ACL_GROUP:
wcscpy(*wp, L"group");
@@ -600,154 +824,184 @@
wname = NULL;
id = -1;
break;
+ case ARCHIVE_ENTRY_ACL_EVERYONE:
+ wcscpy(*wp, L"everyone@");
+ wname = NULL;
+ id = -1;
+ break;
}
*wp += wcslen(*wp);
*(*wp)++ = L':';
- if (wname != NULL) {
- wcscpy(*wp, wname);
+ if (((type & ARCHIVE_ENTRY_ACL_TYPE_POSIX1E) != 0) ||
+ tag == ARCHIVE_ENTRY_ACL_USER ||
+ tag == ARCHIVE_ENTRY_ACL_GROUP) {
+ if (wname != NULL) {
+ wcscpy(*wp, wname);
+ *wp += wcslen(*wp);
+ } else if (tag == ARCHIVE_ENTRY_ACL_USER
+ || tag == ARCHIVE_ENTRY_ACL_GROUP) {
+ append_id_w(wp, id);
+ if ((type & ARCHIVE_ENTRY_ACL_TYPE_NFS4) == 0)
+ id = -1;
+ }
+ /* Solaris style has no second colon after other and mask */
+ if (((flags & ARCHIVE_ENTRY_ACL_STYLE_SOLARIS) == 0)
+ || (tag != ARCHIVE_ENTRY_ACL_OTHER
+ && tag != ARCHIVE_ENTRY_ACL_MASK))
+ *(*wp)++ = L':';
+ }
+ if ((type & ARCHIVE_ENTRY_ACL_TYPE_POSIX1E) != 0) {
+ /* POSIX.1e ACL perms */
+ *(*wp)++ = (perm & 0444) ? L'r' : L'-';
+ *(*wp)++ = (perm & 0222) ? L'w' : L'-';
+ *(*wp)++ = (perm & 0111) ? L'x' : L'-';
+ } else {
+ /* NFSv4 ACL perms */
+ for (i = 0; i < nfsv4_acl_perm_map_size; i++) {
+ if (perm & nfsv4_acl_perm_map[i].perm)
+ *(*wp)++ = nfsv4_acl_perm_map[i].wc;
+ else if ((flags & ARCHIVE_ENTRY_ACL_STYLE_COMPACT) == 0)
+ *(*wp)++ = L'-';
+ }
+ *(*wp)++ = L':';
+ for (i = 0; i < nfsv4_acl_flag_map_size; i++) {
+ if (perm & nfsv4_acl_flag_map[i].perm)
+ *(*wp)++ = nfsv4_acl_flag_map[i].wc;
+ else if ((flags & ARCHIVE_ENTRY_ACL_STYLE_COMPACT) == 0)
+ *(*wp)++ = L'-';
+ }
+ *(*wp)++ = L':';
+ switch (type) {
+ case ARCHIVE_ENTRY_ACL_TYPE_ALLOW:
+ wcscpy(*wp, L"allow");
+ break;
+ case ARCHIVE_ENTRY_ACL_TYPE_DENY:
+ wcscpy(*wp, L"deny");
+ break;
+ case ARCHIVE_ENTRY_ACL_TYPE_AUDIT:
+ wcscpy(*wp, L"audit");
+ break;
+ case ARCHIVE_ENTRY_ACL_TYPE_ALARM:
+ wcscpy(*wp, L"alarm");
+ break;
+ default:
+ break;
+ }
*wp += wcslen(*wp);
- } else if (tag == ARCHIVE_ENTRY_ACL_USER
- || tag == ARCHIVE_ENTRY_ACL_GROUP) {
- append_id_w(wp, id);
- id = -1;
}
- *(*wp)++ = L':';
- *(*wp)++ = (perm & 0444) ? L'r' : L'-';
- *(*wp)++ = (perm & 0222) ? L'w' : L'-';
- *(*wp)++ = (perm & 0111) ? L'x' : L'-';
if (id != -1) {
*(*wp)++ = L':';
append_id_w(wp, id);
}
- **wp = L'\0';
}
-int
-archive_acl_text_l(struct archive_acl *acl, int flags,
- const char **acl_text, size_t *acl_text_len,
+/*
+ * Generate a text version of the ACL. The flags parameter controls
+ * the type and style of the generated ACL.
+ */
+char *
+archive_acl_to_text_l(struct archive_acl *acl, ssize_t *text_len, int flags,
struct archive_string_conv *sc)
{
int count;
- size_t length;
+ ssize_t length;
+ size_t len;
const char *name;
const char *prefix;
char separator;
struct archive_acl_entry *ap;
- size_t len;
- int id, r;
- char *p;
+ int id, r, want_type;
+ char *p, *s;
- if (acl->acl_text != NULL) {
- free (acl->acl_text);
- acl->acl_text = NULL;
- }
+ want_type = archive_acl_text_want_type(acl, flags);
- *acl_text = NULL;
- if (acl_text_len != NULL)
- *acl_text_len = 0;
- separator = ',';
- count = 0;
- length = 0;
- ap = acl->acl_head;
- while (ap != NULL) {
- if ((ap->type & flags) != 0) {
- count++;
- if ((flags & ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT) &&
- (ap->type & ARCHIVE_ENTRY_ACL_TYPE_DEFAULT))
- length += 8; /* "default:" */
- length += 5; /* tag name */
- length += 1; /* colon */
- r = archive_mstring_get_mbs_l(
- &ap->name, &name, &len, sc);
- if (r != 0)
- return (-1);
- if (len > 0 && name != NULL)
- length += len;
- else
- length += sizeof(uid_t) * 3 + 1;
- length ++; /* colon */
- length += 3; /* rwx */
- length += 1; /* colon */
- length += max(sizeof(uid_t), sizeof(gid_t)) * 3 + 1;
- length ++; /* newline */
- }
- ap = ap->next;
- }
+ /* Both NFSv4 and POSIX.1 types found */
+ if (want_type == 0)
+ return (NULL);
- if (count > 0 && ((flags & ARCHIVE_ENTRY_ACL_TYPE_ACCESS) != 0)) {
- length += 10; /* "user::rwx\n" */
- length += 11; /* "group::rwx\n" */
- length += 11; /* "other::rwx\n" */
- }
+ if (want_type == ARCHIVE_ENTRY_ACL_TYPE_POSIX1E)
+ flags |= ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT;
- if (count == 0)
- return (0);
+ length = archive_acl_text_len(acl, want_type, flags, 0, NULL, sc);
+ if (length == 0)
+ return (NULL);
+
+ if (flags & ARCHIVE_ENTRY_ACL_STYLE_SEPARATOR_COMMA)
+ separator = ',';
+ else
+ separator = '\n';
+
/* Now, allocate the string and actually populate it. */
- p = acl->acl_text = (char *)malloc(length);
- if (p == NULL)
- return (-1);
+ p = s = (char *)malloc(length * sizeof(char));
+ if (p == NULL) {
+ if (errno == ENOMEM)
+ __archive_errx(1, "No memory");
+ return (NULL);
+ }
count = 0;
- if ((flags & ARCHIVE_ENTRY_ACL_TYPE_ACCESS) != 0) {
- append_entry(&p, NULL, ARCHIVE_ENTRY_ACL_USER_OBJ, NULL,
+
+ if ((want_type & ARCHIVE_ENTRY_ACL_TYPE_ACCESS) != 0) {
+ append_entry(&p, NULL, ARCHIVE_ENTRY_ACL_TYPE_ACCESS,
+ ARCHIVE_ENTRY_ACL_USER_OBJ, flags, NULL,
acl->mode & 0700, -1);
- *p++ = ',';
- append_entry(&p, NULL, ARCHIVE_ENTRY_ACL_GROUP_OBJ, NULL,
+ *p++ = separator;
+ append_entry(&p, NULL, ARCHIVE_ENTRY_ACL_TYPE_ACCESS,
+ ARCHIVE_ENTRY_ACL_GROUP_OBJ, flags, NULL,
acl->mode & 0070, -1);
- *p++ = ',';
- append_entry(&p, NULL, ARCHIVE_ENTRY_ACL_OTHER, NULL,
+ *p++ = separator;
+ append_entry(&p, NULL, ARCHIVE_ENTRY_ACL_TYPE_ACCESS,
+ ARCHIVE_ENTRY_ACL_OTHER, flags, NULL,
acl->mode & 0007, -1);
count += 3;
-
- for (ap = acl->acl_head; ap != NULL; ap = ap->next) {
- if ((ap->type & ARCHIVE_ENTRY_ACL_TYPE_ACCESS) == 0)
- continue;
- r = archive_mstring_get_mbs_l(
- &ap->name, &name, &len, sc);
- if (r != 0)
- return (-1);
- *p++ = separator;
- if (name == NULL || (flags & ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID)) {
- id = ap->id;
- } else {
- id = -1;
- }
- append_entry(&p, NULL, ap->tag, name,
- ap->permset, id);
- count++;
- }
}
-
- if ((flags & ARCHIVE_ENTRY_ACL_TYPE_DEFAULT) != 0) {
- if (flags & ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT)
+ for (ap = acl->acl_head; ap != NULL; ap = ap->next) {
+ if ((ap->type & want_type) == 0)
+ continue;
+ /*
+ * Filemode-mapping ACL entries are stored exclusively in
+ * ap->mode so they should not be in the list
+ */
+ if ((ap->type == ARCHIVE_ENTRY_ACL_TYPE_ACCESS)
+ && (ap->tag == ARCHIVE_ENTRY_ACL_USER_OBJ
+ || ap->tag == ARCHIVE_ENTRY_ACL_GROUP_OBJ
+ || ap->tag == ARCHIVE_ENTRY_ACL_OTHER))
+ continue;
+ if (ap->type == ARCHIVE_ENTRY_ACL_TYPE_DEFAULT &&
+ (flags & ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT) != 0)
prefix = "default:";
else
prefix = NULL;
- count = 0;
- for (ap = acl->acl_head; ap != NULL; ap = ap->next) {
- if ((ap->type & ARCHIVE_ENTRY_ACL_TYPE_DEFAULT) == 0)
- continue;
- r = archive_mstring_get_mbs_l(
- &ap->name, &name, &len, sc);
- if (r != 0)
- return (-1);
- if (count > 0)
- *p++ = separator;
- if (flags & ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID)
- id = ap->id;
- else
- id = -1;
- append_entry(&p, prefix, ap->tag,
- name, ap->permset, id);
- count ++;
+ r = archive_mstring_get_mbs_l(
+ &ap->name, &name, &len, sc);
+ if (r != 0)
+ return (NULL);
+ if (count > 0)
+ *p++ = separator;
+ if (name == NULL ||
+ (flags & ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID)) {
+ id = ap->id;
+ } else {
+ id = -1;
}
+ append_entry(&p, prefix, ap->type, ap->tag, flags, name,
+ ap->permset, id);
+ count++;
}
- *acl_text = acl->acl_text;
- if (acl_text_len != NULL)
- *acl_text_len = strlen(acl->acl_text);
- return (0);
+ /* Add terminating character */
+ *p++ = '\0';
+
+ len = strlen(s);
+
+ if ((ssize_t)len > (length - 1))
+ __archive_errx(1, "Buffer overrun");
+
+ if (text_len != NULL)
+ *text_len = len;
+
+ return (s);
}
static void
@@ -761,9 +1015,11 @@
}
static void
-append_entry(char **p, const char *prefix, int tag,
- const char *name, int perm, int id)
+append_entry(char **p, const char *prefix, int type,
+ int tag, int flags, const char *name, int perm, int id)
{
+ int i;
+
if (prefix != NULL) {
strcpy(*p, prefix);
*p += strlen(*p);
@@ -772,6 +1028,10 @@
case ARCHIVE_ENTRY_ACL_USER_OBJ:
name = NULL;
id = -1;
+ if ((type & ARCHIVE_ENTRY_ACL_TYPE_NFS4) != 0) {
+ strcpy(*p, "owner@");
+ break;
+ }
/* FALLTHROUGH */
case ARCHIVE_ENTRY_ACL_USER:
strcpy(*p, "user");
@@ -779,6 +1039,10 @@
case ARCHIVE_ENTRY_ACL_GROUP_OBJ:
name = NULL;
id = -1;
+ if ((type & ARCHIVE_ENTRY_ACL_TYPE_NFS4) != 0) {
+ strcpy(*p, "group@");
+ break;
+ }
/* FALLTHROUGH */
case ARCHIVE_ENTRY_ACL_GROUP:
strcpy(*p, "group");
@@ -793,48 +1057,120 @@
name = NULL;
id = -1;
break;
+ case ARCHIVE_ENTRY_ACL_EVERYONE:
+ strcpy(*p, "everyone@");
+ name = NULL;
+ id = -1;
+ break;
}
*p += strlen(*p);
*(*p)++ = ':';
- if (name != NULL) {
- strcpy(*p, name);
+ if (((type & ARCHIVE_ENTRY_ACL_TYPE_POSIX1E) != 0) ||
+ tag == ARCHIVE_ENTRY_ACL_USER ||
+ tag == ARCHIVE_ENTRY_ACL_GROUP) {
+ if (name != NULL) {
+ strcpy(*p, name);
+ *p += strlen(*p);
+ } else if (tag == ARCHIVE_ENTRY_ACL_USER
+ || tag == ARCHIVE_ENTRY_ACL_GROUP) {
+ append_id(p, id);
+ if ((type & ARCHIVE_ENTRY_ACL_TYPE_NFS4) == 0)
+ id = -1;
+ }
+ /* Solaris style has no second colon after other and mask */
+ if (((flags & ARCHIVE_ENTRY_ACL_STYLE_SOLARIS) == 0)
+ || (tag != ARCHIVE_ENTRY_ACL_OTHER
+ && tag != ARCHIVE_ENTRY_ACL_MASK))
+ *(*p)++ = ':';
+ }
+ if ((type & ARCHIVE_ENTRY_ACL_TYPE_POSIX1E) != 0) {
+ /* POSIX.1e ACL perms */
+ *(*p)++ = (perm & 0444) ? 'r' : '-';
+ *(*p)++ = (perm & 0222) ? 'w' : '-';
+ *(*p)++ = (perm & 0111) ? 'x' : '-';
+ } else {
+ /* NFSv4 ACL perms */
+ for (i = 0; i < nfsv4_acl_perm_map_size; i++) {
+ if (perm & nfsv4_acl_perm_map[i].perm)
+ *(*p)++ = nfsv4_acl_perm_map[i].c;
+ else if ((flags & ARCHIVE_ENTRY_ACL_STYLE_COMPACT) == 0)
+ *(*p)++ = '-';
+ }
+ *(*p)++ = ':';
+ for (i = 0; i < nfsv4_acl_flag_map_size; i++) {
+ if (perm & nfsv4_acl_flag_map[i].perm)
+ *(*p)++ = nfsv4_acl_flag_map[i].c;
+ else if ((flags & ARCHIVE_ENTRY_ACL_STYLE_COMPACT) == 0)
+ *(*p)++ = '-';
+ }
+ *(*p)++ = ':';
+ switch (type) {
+ case ARCHIVE_ENTRY_ACL_TYPE_ALLOW:
+ strcpy(*p, "allow");
+ break;
+ case ARCHIVE_ENTRY_ACL_TYPE_DENY:
+ strcpy(*p, "deny");
+ break;
+ case ARCHIVE_ENTRY_ACL_TYPE_AUDIT:
+ strcpy(*p, "audit");
+ break;
+ case ARCHIVE_ENTRY_ACL_TYPE_ALARM:
+ strcpy(*p, "alarm");
+ break;
+ }
*p += strlen(*p);
- } else if (tag == ARCHIVE_ENTRY_ACL_USER
- || tag == ARCHIVE_ENTRY_ACL_GROUP) {
- append_id(p, id);
- id = -1;
}
- *(*p)++ = ':';
- *(*p)++ = (perm & 0444) ? 'r' : '-';
- *(*p)++ = (perm & 0222) ? 'w' : '-';
- *(*p)++ = (perm & 0111) ? 'x' : '-';
if (id != -1) {
*(*p)++ = ':';
append_id(p, id);
}
- **p = '\0';
}
/*
- * Parse a textual ACL. This automatically recognizes and supports
- * extensions described above. The 'type' argument is used to
- * indicate the type that should be used for any entries not
- * explicitly marked as "default:".
+ * Parse a wide ACL text string.
+ *
+ * The want_type argument may be one of the following:
+ * ARCHIVE_ENTRY_ACL_TYPE_ACCESS - text is a POSIX.1e ACL of type ACCESS
+ * ARCHIVE_ENTRY_ACL_TYPE_DEFAULT - text is a POSIX.1e ACL of type DEFAULT
+ * ARCHIVE_ENTRY_ACL_TYPE_NFS4 - text is as a NFSv4 ACL
+ *
+ * POSIX.1e ACL entries prefixed with "default:" are treated as
+ * ARCHIVE_ENTRY_ACL_TYPE_DEFAULT unless type is ARCHIVE_ENTRY_ACL_TYPE_NFS4
*/
int
-archive_acl_parse_w(struct archive_acl *acl,
- const wchar_t *text, int default_type)
+archive_acl_from_text_w(struct archive_acl *acl, const wchar_t *text,
+ int want_type)
{
struct {
const wchar_t *start;
const wchar_t *end;
- } field[4], name;
+ } field[6], name;
- int fields, n;
- int type, tag, permset, id;
+ const wchar_t *s, *st;
+
+ int numfields, fields, n, r, sol, ret;
+ int type, types, tag, permset, id;
+ size_t len;
wchar_t sep;
- while (text != NULL && *text != L'\0') {
+ ret = ARCHIVE_OK;
+ types = 0;
+
+ switch (want_type) {
+ case ARCHIVE_ENTRY_ACL_TYPE_POSIX1E:
+ want_type = ARCHIVE_ENTRY_ACL_TYPE_ACCESS;
+ case ARCHIVE_ENTRY_ACL_TYPE_ACCESS:
+ case ARCHIVE_ENTRY_ACL_TYPE_DEFAULT:
+ numfields = 5;
+ break;
+ case ARCHIVE_ENTRY_ACL_TYPE_NFS4:
+ numfields = 6;
+ break;
+ default:
+ return (ARCHIVE_FATAL);
+ }
+
+ while (text != NULL && *text != L'\0') {
/*
* Parse the fields out of the next entry,
* advance 'text' to start of next entry.
@@ -843,7 +1179,7 @@
do {
const wchar_t *start, *end;
next_field_w(&text, &start, &end, &sep);
- if (fields < 4) {
+ if (fields < numfields) {
field[fields].start = start;
field[fields].end = end;
}
@@ -851,78 +1187,210 @@
} while (sep == L':');
/* Set remaining fields to blank. */
- for (n = fields; n < 4; ++n)
+ for (n = fields; n < numfields; ++n)
field[n].start = field[n].end = NULL;
- /* Check for a numeric ID in field 1 or 3. */
+ if (field[0].start != NULL && *(field[0].start) == L'#') {
+ /* Comment, skip entry */
+ continue;
+ }
+
+ n = 0;
+ sol = 0;
id = -1;
- isint_w(field[1].start, field[1].end, &id);
- /* Field 3 is optional. */
- if (id == -1 && fields > 3)
- isint_w(field[3].start, field[3].end, &id);
+ permset = 0;
+ name.start = name.end = NULL;
- /*
- * Solaris extension: "defaultuser::rwx" is the
- * default ACL corresponding to "user::rwx", etc.
- */
- 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;
- } else
- type = default_type;
+ if (want_type != ARCHIVE_ENTRY_ACL_TYPE_NFS4) {
+ /* POSIX.1e ACLs */
+ /*
+ * Default keyword "default:user::rwx"
+ * if found, we have one more field
+ *
+ * We also support old Solaris extension:
+ * "defaultuser::rwx" is the default ACL corresponding
+ * to "user::rwx", etc. valid only for first field
+ */
+ s = field[0].start;
+ len = field[0].end - field[0].start;
+ if (*s == L'd' && (len == 1 || (len >= 7
+ && wmemcmp((s + 1), L"efault", 6) == 0))) {
+ type = ARCHIVE_ENTRY_ACL_TYPE_DEFAULT;
+ if (len > 7)
+ field[0].start += 7;
+ else
+ n = 1;
+ } else
+ type = want_type;
- name.start = name.end = NULL;
- if (prefix_w(field[0].start, field[0].end, L"user")) {
- if (!ismode_w(field[2].start, field[2].end, &permset))
- return (ARCHIVE_WARN);
- if (id != -1 || field[1].start < field[1].end) {
- tag = ARCHIVE_ENTRY_ACL_USER;
+ /* Check for a numeric ID in field n+1 or n+3. */
+ isint_w(field[n + 1].start, field[n + 1].end, &id);
+ /* Field n+3 is optional. */
+ if (id == -1 && fields > n+3)
+ isint_w(field[n + 3].start, field[n + 3].end,
+ &id);
+
+ tag = 0;
+ s = field[n].start;
+ st = field[n].start + 1;
+ len = field[n].end - field[n].start;
+
+ switch (*s) {
+ case L'u':
+ if (len == 1 || (len == 4
+ && wmemcmp(st, L"ser", 3) == 0))
+ tag = ARCHIVE_ENTRY_ACL_USER_OBJ;
+ break;
+ case L'g':
+ if (len == 1 || (len == 5
+ && wmemcmp(st, L"roup", 4) == 0))
+ tag = ARCHIVE_ENTRY_ACL_GROUP_OBJ;
+ break;
+ case L'o':
+ if (len == 1 || (len == 5
+ && wmemcmp(st, L"ther", 4) == 0))
+ tag = ARCHIVE_ENTRY_ACL_OTHER;
+ break;
+ case L'm':
+ if (len == 1 || (len == 4
+ && wmemcmp(st, L"ask", 3) == 0))
+ tag = ARCHIVE_ENTRY_ACL_MASK;
+ break;
+ default:
+ break;
+ }
+
+ switch (tag) {
+ case ARCHIVE_ENTRY_ACL_OTHER:
+ case ARCHIVE_ENTRY_ACL_MASK:
+ if (fields == (n + 2)
+ && field[n + 1].start < field[n + 1].end
+ && ismode_w(field[n + 1].start,
+ field[n + 1].end, &permset)) {
+ /* This is Solaris-style "other:rwx" */
+ sol = 1;
+ } else if (fields == (n + 3) &&
+ field[n + 1].start < field[n + 1].end) {
+ /* Invalid mask or other field */
+ ret = ARCHIVE_WARN;
+ continue;
+ }
+ break;
+ case ARCHIVE_ENTRY_ACL_USER_OBJ:
+ case ARCHIVE_ENTRY_ACL_GROUP_OBJ:
+ if (id != -1 ||
+ field[n + 1].start < field[n + 1].end) {
+ name = field[n + 1];
+ if (tag == ARCHIVE_ENTRY_ACL_USER_OBJ)
+ tag = ARCHIVE_ENTRY_ACL_USER;
+ else
+ tag = ARCHIVE_ENTRY_ACL_GROUP;
+ }
+ break;
+ default:
+ /* Invalid tag, skip entry */
+ ret = ARCHIVE_WARN;
+ continue;
+ }
+
+ /*
+ * Without "default:" we expect mode in field 2
+ * Exception: Solaris other and mask fields
+ */
+ if (permset == 0 && !ismode_w(field[n + 2 - sol].start,
+ field[n + 2 - sol].end, &permset)) {
+ /* Invalid mode, skip entry */
+ ret = ARCHIVE_WARN;
+ continue;
+ }
+ } else {
+ /* NFS4 ACLs */
+ s = field[0].start;
+ len = field[0].end - field[0].start;
+ tag = 0;
+
+ switch (len) {
+ case 4:
+ if (wmemcmp(s, L"user", 4) == 0)
+ tag = ARCHIVE_ENTRY_ACL_USER;
+ break;
+ case 5:
+ if (wmemcmp(s, L"group", 5) == 0)
+ tag = ARCHIVE_ENTRY_ACL_GROUP;
+ break;
+ case 6:
+ if (wmemcmp(s, L"owner@", 6) == 0)
+ tag = ARCHIVE_ENTRY_ACL_USER_OBJ;
+ else if (wmemcmp(s, L"group@", len) == 0)
+ tag = ARCHIVE_ENTRY_ACL_GROUP_OBJ;
+ break;
+ case 9:
+ if (wmemcmp(s, L"everyone@", 9) == 0)
+ tag = ARCHIVE_ENTRY_ACL_EVERYONE;
+ default:
+ break;
+ }
+
+ if (tag == 0) {
+ /* Invalid tag, skip entry */
+ ret = ARCHIVE_WARN;
+ continue;
+ } else if (tag == ARCHIVE_ENTRY_ACL_USER ||
+ tag == ARCHIVE_ENTRY_ACL_GROUP) {
+ n = 1;
name = field[1];
+ isint_w(name.start, name.end, &id);
} else
- tag = ARCHIVE_ENTRY_ACL_USER_OBJ;
- } else if (prefix_w(field[0].start, field[0].end, L"group")) {
- if (!ismode_w(field[2].start, field[2].end, &permset))
- return (ARCHIVE_WARN);
- if (id != -1 || field[1].start < field[1].end) {
- tag = ARCHIVE_ENTRY_ACL_GROUP;
- name = field[1];
- } else
- tag = ARCHIVE_ENTRY_ACL_GROUP_OBJ;
- } 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[1].end, &permset)) {
- /* This is Solaris-style "other:rwx" */
- } else if (fields == 3
- && field[1].start == field[1].end
- && field[2].start < field[2].end
- && ismode_w(field[2].start, field[2].end, &permset)) {
- /* This is FreeBSD-style "other::rwx" */
- } else
- return (ARCHIVE_WARN);
- tag = ARCHIVE_ENTRY_ACL_OTHER;
- } else if (prefix_w(field[0].start, field[0].end, L"mask")) {
- if (fields == 2
- && field[1].start < field[1].end
- && ismode_w(field[1].start, field[1].end, &permset)) {
- /* This is Solaris-style "mask:rwx" */
- } else if (fields == 3
- && field[1].start == field[1].end
- && field[2].start < field[2].end
- && ismode_w(field[2].start, field[2].end, &permset)) {
- /* This is FreeBSD-style "mask::rwx" */
- } else
- return (ARCHIVE_WARN);
- tag = ARCHIVE_ENTRY_ACL_MASK;
- } else
- return (ARCHIVE_WARN);
+ n = 0;
+ if (!is_nfs4_perms_w(field[1 + n].start,
+ field[1 + n].end, &permset)) {
+ /* Invalid NFSv4 perms, skip entry */
+ ret = ARCHIVE_WARN;
+ continue;
+ }
+ if (!is_nfs4_flags_w(field[2 + n].start,
+ field[2 + n].end, &permset)) {
+ /* Invalid NFSv4 flags, skip entry */
+ ret = ARCHIVE_WARN;
+ continue;
+ }
+ s = field[3 + n].start;
+ len = field[3 + n].end - field[3 + n].start;
+ type = 0;
+ if (len == 4) {
+ if (wmemcmp(s, L"deny", 4) == 0)
+ type = ARCHIVE_ENTRY_ACL_TYPE_DENY;
+ } else if (len == 5) {
+ if (wmemcmp(s, L"allow", 5) == 0)
+ type = ARCHIVE_ENTRY_ACL_TYPE_ALLOW;
+ else if (wmemcmp(s, L"audit", 5) == 0)
+ type = ARCHIVE_ENTRY_ACL_TYPE_AUDIT;
+ else if (wmemcmp(s, L"alarm", 5) == 0)
+ type = ARCHIVE_ENTRY_ACL_TYPE_ALARM;
+ }
+ if (type == 0) {
+ /* Invalid entry type, skip entry */
+ ret = ARCHIVE_WARN;
+ continue;
+ }
+ isint_w(field[4 + n].start, field[4 + n].end, &id);
+ }
+
/* Add entry to the internal list. */
- archive_acl_add_entry_w_len(acl, type, permset,
+ r = archive_acl_add_entry_w_len(acl, type, permset,
tag, id, name.start, name.end - name.start);
+ if (r < ARCHIVE_WARN)
+ return (r);
+ if (r != ARCHIVE_OK)
+ ret = ARCHIVE_WARN;
+ types |= type;
}
- return (ARCHIVE_OK);
+
+ /* Reset ACL */
+ archive_acl_reset(acl, types);
+
+ return (ret);
}
/*
@@ -968,16 +1436,16 @@
*permset = 0;
while (p < end) {
switch (*p++) {
- case 'r': case 'R':
+ case L'r': case L'R':
*permset |= ARCHIVE_ENTRY_ACL_READ;
break;
- case 'w': case 'W':
+ case L'w': case L'W':
*permset |= ARCHIVE_ENTRY_ACL_WRITE;
break;
- case 'x': case 'X':
+ case L'x': case L'X':
*permset |= ARCHIVE_ENTRY_ACL_EXECUTE;
break;
- case '-':
+ case L'-':
break;
default:
return (0);
@@ -987,6 +1455,112 @@
}
/*
+ * Parse a string as a NFS4 ACL permission field.
+ * Returns true if the string is non-empty and consists only of NFS4 ACL
+ * permission characters, false otherwise
+ */
+static int
+is_nfs4_perms_w(const wchar_t *start, const wchar_t *end, int *permset)
+{
+ const wchar_t *p = start;
+
+ while (p < end) {
+ switch (*p++) {
+ case L'r':
+ *permset |= ARCHIVE_ENTRY_ACL_READ_DATA;
+ break;
+ case L'w':
+ *permset |= ARCHIVE_ENTRY_ACL_WRITE_DATA;
+ break;
+ case L'x':
+ *permset |= ARCHIVE_ENTRY_ACL_EXECUTE;
+ break;
+ case L'p':
+ *permset |= ARCHIVE_ENTRY_ACL_APPEND_DATA;
+ break;
+ case L'D':
+ *permset |= ARCHIVE_ENTRY_ACL_DELETE_CHILD;
+ break;
+ case L'd':
+ *permset |= ARCHIVE_ENTRY_ACL_DELETE;
+ break;
+ case L'a':
+ *permset |= ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES;
+ break;
+ case L'A':
+ *permset |= ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES;
+ break;
+ case L'R':
+ *permset |= ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS;
+ break;
+ case L'W':
+ *permset |= ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS;
+ break;
+ case L'c':
+ *permset |= ARCHIVE_ENTRY_ACL_READ_ACL;
+ break;
+ case L'C':
+ *permset |= ARCHIVE_ENTRY_ACL_WRITE_ACL;
+ break;
+ case L'o':
+ *permset |= ARCHIVE_ENTRY_ACL_WRITE_OWNER;
+ break;
+ case L's':
+ *permset |= ARCHIVE_ENTRY_ACL_SYNCHRONIZE;
+ break;
+ case L'-':
+ break;
+ default:
+ return(0);
+ }
+ }
+ return (1);
+}
+
+/*
+ * Parse a string as a NFS4 ACL flags field.
+ * Returns true if the string is non-empty and consists only of NFS4 ACL
+ * flag characters, false otherwise
+ */
+static int
+is_nfs4_flags_w(const wchar_t *start, const wchar_t *end, int *permset)
+{
+ const wchar_t *p = start;
+
+ while (p < end) {
+ switch(*p++) {
+ case L'f':
+ *permset |= ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT;
+ break;
+ case L'd':
+ *permset |= ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT;
+ break;
+ case L'i':
+ *permset |= ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY;
+ break;
+ case L'n':
+ *permset |=
+ ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT;
+ break;
+ case L'S':
+ *permset |= ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS;
+ break;
+ case L'F':
+ *permset |= ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS;
+ break;
+ case L'I':
+ *permset |= ARCHIVE_ENTRY_ACL_ENTRY_INHERITED;
+ break;
+ case L'-':
+ break;
+ default:
+ return (0);
+ }
+ }
+ return (1);
+}
+
+/*
* Match "[:whitespace:]*(.*)[:whitespace:]*[:,\n]". *wp is updated
* to point to just after the separator. *start points to the first
* character of the matched text and *end just after the last
@@ -1024,46 +1598,48 @@
}
/*
- * Return true if the characters [start...end) are a prefix of 'test'.
- * This makes it easy to handle the obvious abbreviations: 'u' for 'user', etc.
+ * Parse an ACL text string.
+ *
+ * The want_type argument may be one of the following:
+ * ARCHIVE_ENTRY_ACL_TYPE_ACCESS - text is a POSIX.1e ACL of type ACCESS
+ * ARCHIVE_ENTRY_ACL_TYPE_DEFAULT - text is a POSIX.1e ACL of type DEFAULT
+ * ARCHIVE_ENTRY_ACL_TYPE_NFS4 - text is as a NFSv4 ACL
+ *
+ * POSIX.1e ACL entries prefixed with "default:" are treated as
+ * ARCHIVE_ENTRY_ACL_TYPE_DEFAULT unless type is ARCHIVE_ENTRY_ACL_TYPE_NFS4
*/
-static int
-prefix_w(const wchar_t *start, const wchar_t *end, const wchar_t *test)
-{
- if (start == end)
- return (0);
-
- if (*start++ != *test++)
- return (0);
-
- while (start < end && *start++ == *test++)
- ;
-
- if (start < end)
- return (0);
-
- return (1);
-}
-
-/*
- * Parse a textual ACL. This automatically recognizes and supports
- * extensions described above. The 'type' argument is used to
- * indicate the type that should be used for any entries not
- * explicitly marked as "default:".
- */
int
-archive_acl_parse_l(struct archive_acl *acl,
- const char *text, int default_type, struct archive_string_conv *sc)
+archive_acl_from_text_l(struct archive_acl *acl, const char *text,
+ int want_type, struct archive_string_conv *sc)
{
struct {
const char *start;
const char *end;
- } field[4], name;
+ } field[6], name;
- int fields, n, r, ret = ARCHIVE_OK;
- int type, tag, permset, id;
+ const char *s, *st;
+ int numfields, fields, n, r, sol, ret;
+ int type, types, tag, permset, id;
+ size_t len;
char sep;
+ switch (want_type) {
+ case ARCHIVE_ENTRY_ACL_TYPE_POSIX1E:
+ want_type = ARCHIVE_ENTRY_ACL_TYPE_ACCESS;
+ case ARCHIVE_ENTRY_ACL_TYPE_ACCESS:
+ case ARCHIVE_ENTRY_ACL_TYPE_DEFAULT:
+ numfields = 5;
+ break;
+ case ARCHIVE_ENTRY_ACL_TYPE_NFS4:
+ numfields = 6;
+ break;
+ default:
+ return (ARCHIVE_FATAL);
+ }
+
+ ret = ARCHIVE_OK;
+ types = 0;
+
while (text != NULL && *text != '\0') {
/*
* Parse the fields out of the next entry,
@@ -1073,7 +1649,7 @@
do {
const char *start, *end;
next_field(&text, &start, &end, &sep);
- if (fields < 4) {
+ if (fields < numfields) {
field[fields].start = start;
field[fields].end = end;
}
@@ -1081,73 +1657,198 @@
} while (sep == ':');
/* Set remaining fields to blank. */
- for (n = fields; n < 4; ++n)
+ for (n = fields; n < numfields; ++n)
field[n].start = field[n].end = NULL;
- /* Check for a numeric ID in field 1 or 3. */
+ if (field[0].start != NULL && *(field[0].start) == '#') {
+ /* Comment, skip entry */
+ continue;
+ }
+
+ n = 0;
+ sol = 0;
id = -1;
- isint(field[1].start, field[1].end, &id);
- /* Field 3 is optional. */
- if (id == -1 && fields > 3)
- isint(field[3].start, field[3].end, &id);
+ permset = 0;
+ name.start = name.end = NULL;
- /*
- * Solaris extension: "defaultuser::rwx" is the
- * default ACL corresponding to "user::rwx", etc.
- */
- if (field[0].end - field[0].start > 7
- && memcmp(field[0].start, "default", 7) == 0) {
- type = ARCHIVE_ENTRY_ACL_TYPE_DEFAULT;
- field[0].start += 7;
- } else
- type = default_type;
+ if (want_type != ARCHIVE_ENTRY_ACL_TYPE_NFS4) {
+ /* POSIX.1e ACLs */
+ /*
+ * Default keyword "default:user::rwx"
+ * if found, we have one more field
+ *
+ * We also support old Solaris extension:
+ * "defaultuser::rwx" is the default ACL corresponding
+ * to "user::rwx", etc. valid only for first field
+ */
+ s = field[0].start;
+ len = field[0].end - field[0].start;
+ if (*s == 'd' && (len == 1 || (len >= 7
+ && memcmp((s + 1), "efault", 6) == 0))) {
+ type = ARCHIVE_ENTRY_ACL_TYPE_DEFAULT;
+ if (len > 7)
+ field[0].start += 7;
+ else
+ n = 1;
+ } else
+ type = want_type;
- name.start = name.end = NULL;
- if (prefix_c(field[0].start, field[0].end, "user")) {
- if (!ismode(field[2].start, field[2].end, &permset))
- return (ARCHIVE_WARN);
- if (id != -1 || field[1].start < field[1].end) {
- tag = ARCHIVE_ENTRY_ACL_USER;
+ /* Check for a numeric ID in field n+1 or n+3. */
+ isint(field[n + 1].start, field[n + 1].end, &id);
+ /* Field n+3 is optional. */
+ if (id == -1 && fields > (n + 3))
+ isint(field[n + 3].start, field[n + 3].end,
+ &id);
+
+ tag = 0;
+ s = field[n].start;
+ st = field[n].start + 1;
+ len = field[n].end - field[n].start;
+
+ switch (*s) {
+ case 'u':
+ if (len == 1 || (len == 4
+ && memcmp(st, "ser", 3) == 0))
+ tag = ARCHIVE_ENTRY_ACL_USER_OBJ;
+ break;
+ case 'g':
+ if (len == 1 || (len == 5
+ && memcmp(st, "roup", 4) == 0))
+ tag = ARCHIVE_ENTRY_ACL_GROUP_OBJ;
+ break;
+ case 'o':
+ if (len == 1 || (len == 5
+ && memcmp(st, "ther", 4) == 0))
+ tag = ARCHIVE_ENTRY_ACL_OTHER;
+ break;
+ case 'm':
+ if (len == 1 || (len == 4
+ && memcmp(st, "ask", 3) == 0))
+ tag = ARCHIVE_ENTRY_ACL_MASK;
+ break;
+ default:
+ break;
+ }
+
+ switch (tag) {
+ case ARCHIVE_ENTRY_ACL_OTHER:
+ case ARCHIVE_ENTRY_ACL_MASK:
+ if (fields == (n + 2)
+ && field[n + 1].start < field[n + 1].end
+ && ismode(field[n + 1].start,
+ field[n + 1].end, &permset)) {
+ /* This is Solaris-style "other:rwx" */
+ sol = 1;
+ } else if (fields == (n + 3) &&
+ field[n + 1].start < field[n + 1].end) {
+ /* Invalid mask or other field */
+ ret = ARCHIVE_WARN;
+ continue;
+ }
+ break;
+ case ARCHIVE_ENTRY_ACL_USER_OBJ:
+ case ARCHIVE_ENTRY_ACL_GROUP_OBJ:
+ if (id != -1 ||
+ field[n + 1].start < field[n + 1].end) {
+ name = field[n + 1];
+ if (tag == ARCHIVE_ENTRY_ACL_USER_OBJ)
+ tag = ARCHIVE_ENTRY_ACL_USER;
+ else
+ tag = ARCHIVE_ENTRY_ACL_GROUP;
+ }
+ break;
+ default:
+ /* Invalid tag, skip entry */
+ ret = ARCHIVE_WARN;
+ continue;
+ }
+
+ /*
+ * Without "default:" we expect mode in field 3
+ * Exception: Solaris other and mask fields
+ */
+ if (permset == 0 && !ismode(field[n + 2 - sol].start,
+ field[n + 2 - sol].end, &permset)) {
+ /* Invalid mode, skip entry */
+ ret = ARCHIVE_WARN;
+ continue;
+ }
+ } else {
+ /* NFS4 ACLs */
+ s = field[0].start;
+ len = field[0].end - field[0].start;
+ tag = 0;
+
+ switch (len) {
+ case 4:
+ if (memcmp(s, "user", 4) == 0)
+ tag = ARCHIVE_ENTRY_ACL_USER;
+ break;
+ case 5:
+ if (memcmp(s, "group", 5) == 0)
+ tag = ARCHIVE_ENTRY_ACL_GROUP;
+ break;
+ case 6:
+ if (memcmp(s, "owner@", 6) == 0)
+ tag = ARCHIVE_ENTRY_ACL_USER_OBJ;
+ else if (memcmp(s, "group@", 6) == 0)
+ tag = ARCHIVE_ENTRY_ACL_GROUP_OBJ;
+ break;
+ case 9:
+ if (memcmp(s, "everyone@", 9) == 0)
+ tag = ARCHIVE_ENTRY_ACL_EVERYONE;
+ break;
+ default:
+ break;
+ }
+
+ if (tag == 0) {
+ /* Invalid tag, skip entry */
+ ret = ARCHIVE_WARN;
+ continue;
+ } else if (tag == ARCHIVE_ENTRY_ACL_USER ||
+ tag == ARCHIVE_ENTRY_ACL_GROUP) {
+ n = 1;
name = field[1];
+ isint(name.start, name.end, &id);
} else
- tag = ARCHIVE_ENTRY_ACL_USER_OBJ;
- } else if (prefix_c(field[0].start, field[0].end, "group")) {
- if (!ismode(field[2].start, field[2].end, &permset))
- return (ARCHIVE_WARN);
- if (id != -1 || field[1].start < field[1].end) {
- tag = ARCHIVE_ENTRY_ACL_GROUP;
- name = field[1];
- } else
- tag = ARCHIVE_ENTRY_ACL_GROUP_OBJ;
- } else if (prefix_c(field[0].start, field[0].end, "other")) {
- if (fields == 2
- && field[1].start < field[1].end
- && ismode(field[1].start, field[1].end, &permset)) {
- /* This is Solaris-style "other:rwx" */
- } else if (fields == 3
- && field[1].start == field[1].end
- && field[2].start < field[2].end
- && ismode(field[2].start, field[2].end, &permset)) {
- /* This is FreeBSD-style "other::rwx" */
- } else
- return (ARCHIVE_WARN);
- tag = ARCHIVE_ENTRY_ACL_OTHER;
- } else if (prefix_c(field[0].start, field[0].end, "mask")) {
- if (fields == 2
- && field[1].start < field[1].end
- && ismode(field[1].start, field[1].end, &permset)) {
- /* This is Solaris-style "mask:rwx" */
- } else if (fields == 3
- && field[1].start == field[1].end
- && field[2].start < field[2].end
- && ismode(field[2].start, field[2].end, &permset)) {
- /* This is FreeBSD-style "mask::rwx" */
- } else
- return (ARCHIVE_WARN);
- tag = ARCHIVE_ENTRY_ACL_MASK;
- } else
- return (ARCHIVE_WARN);
+ n = 0;
+ if (!is_nfs4_perms(field[1 + n].start,
+ field[1 + n].end, &permset)) {
+ /* Invalid NFSv4 perms, skip entry */
+ ret = ARCHIVE_WARN;
+ continue;
+ }
+ if (!is_nfs4_flags(field[2 + n].start,
+ field[2 + n].end, &permset)) {
+ /* Invalid NFSv4 flags, skip entry */
+ ret = ARCHIVE_WARN;
+ continue;
+ }
+ s = field[3 + n].start;
+ len = field[3 + n].end - field[3 + n].start;
+ type = 0;
+ if (len == 4) {
+ if (memcmp(s, "deny", 4) == 0)
+ type = ARCHIVE_ENTRY_ACL_TYPE_DENY;
+ } else if (len == 5) {
+ if (memcmp(s, "allow", 5) == 0)
+ type = ARCHIVE_ENTRY_ACL_TYPE_ALLOW;
+ else if (memcmp(s, "audit", 5) == 0)
+ type = ARCHIVE_ENTRY_ACL_TYPE_AUDIT;
+ else if (memcmp(s, "alarm", 5) == 0)
+ type = ARCHIVE_ENTRY_ACL_TYPE_ALARM;
+ }
+ if (type == 0) {
+ /* Invalid entry type, skip entry */
+ ret = ARCHIVE_WARN;
+ continue;
+ }
+ isint(field[4 + n].start, field[4 + n].end,
+ &id);
+ }
+
/* Add entry to the internal list. */
r = archive_acl_add_entry_len_l(acl, type, permset,
tag, id, name.start, name.end - name.start, sc);
@@ -1155,7 +1856,12 @@
return (r);
if (r != ARCHIVE_OK)
ret = ARCHIVE_WARN;
+ types |= type;
}
+
+ /* Reset ACL */
+ archive_acl_reset(acl, types);
+
return (ret);
}
@@ -1221,6 +1927,112 @@
}
/*
+ * Parse a string as a NFS4 ACL permission field.
+ * Returns true if the string is non-empty and consists only of NFS4 ACL
+ * permission characters, false otherwise
+ */
+static int
+is_nfs4_perms(const char *start, const char *end, int *permset)
+{
+ const char *p = start;
+
+ while (p < end) {
+ switch (*p++) {
+ case 'r':
+ *permset |= ARCHIVE_ENTRY_ACL_READ_DATA;
+ break;
+ case 'w':
+ *permset |= ARCHIVE_ENTRY_ACL_WRITE_DATA;
+ break;
+ case 'x':
+ *permset |= ARCHIVE_ENTRY_ACL_EXECUTE;
+ break;
+ case 'p':
+ *permset |= ARCHIVE_ENTRY_ACL_APPEND_DATA;
+ break;
+ case 'D':
+ *permset |= ARCHIVE_ENTRY_ACL_DELETE_CHILD;
+ break;
+ case 'd':
+ *permset |= ARCHIVE_ENTRY_ACL_DELETE;
+ break;
+ case 'a':
+ *permset |= ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES;
+ break;
+ case 'A':
+ *permset |= ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES;
+ break;
+ case 'R':
+ *permset |= ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS;
+ break;
+ case 'W':
+ *permset |= ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS;
+ break;
+ case 'c':
+ *permset |= ARCHIVE_ENTRY_ACL_READ_ACL;
+ break;
+ case 'C':
+ *permset |= ARCHIVE_ENTRY_ACL_WRITE_ACL;
+ break;
+ case 'o':
+ *permset |= ARCHIVE_ENTRY_ACL_WRITE_OWNER;
+ break;
+ case 's':
+ *permset |= ARCHIVE_ENTRY_ACL_SYNCHRONIZE;
+ break;
+ case '-':
+ break;
+ default:
+ return(0);
+ }
+ }
+ return (1);
+}
+
+/*
+ * Parse a string as a NFS4 ACL flags field.
+ * Returns true if the string is non-empty and consists only of NFS4 ACL
+ * flag characters, false otherwise
+ */
+static int
+is_nfs4_flags(const char *start, const char *end, int *permset)
+{
+ const char *p = start;
+
+ while (p < end) {
+ switch(*p++) {
+ case 'f':
+ *permset |= ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT;
+ break;
+ case 'd':
+ *permset |= ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT;
+ break;
+ case 'i':
+ *permset |= ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY;
+ break;
+ case 'n':
+ *permset |=
+ ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT;
+ break;
+ case 'S':
+ *permset |= ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS;
+ break;
+ case 'F':
+ *permset |= ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS;
+ break;
+ case 'I':
+ *permset |= ARCHIVE_ENTRY_ACL_ENTRY_INHERITED;
+ break;
+ case '-':
+ break;
+ default:
+ return (0);
+ }
+ }
+ return (1);
+}
+
+/*
* Match "[:whitespace:]*(.*)[:whitespace:]*[:,\n]". *wp is updated
* to point to just after the separator. *start points to the first
* character of the matched text and *end just after the last
@@ -1255,25 +2067,3 @@
if (**p != '\0')
(*p)++;
}
-
-/*
- * Return true if the characters [start...end) are a prefix of 'test'.
- * This makes it easy to handle the obvious abbreviations: 'u' for 'user', etc.
- */
-static int
-prefix_c(const char *start, const char *end, const char *test)
-{
- if (start == end)
- return (0);
-
- if (*start++ != *test++)
- return (0);
-
- while (start < end && *start++ == *test++)
- ;
-
- if (start < end)
- return (0);
-
- return (1);
-}
Modified: trunk/contrib/libarchive/libarchive/archive_acl_private.h
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_acl_private.h 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/archive_acl_private.h 2018-06-19 20:42:35 UTC (rev 11134)
@@ -56,6 +56,7 @@
void archive_acl_clear(struct archive_acl *);
void archive_acl_copy(struct archive_acl *, struct archive_acl *);
int archive_acl_count(struct archive_acl *, int);
+int archive_acl_types(struct archive_acl *);
int archive_acl_reset(struct archive_acl *, int);
int archive_acl_next(struct archive *, struct archive_acl *, int,
int *, int *, int *, int *, const char **);
@@ -66,22 +67,17 @@
int archive_acl_add_entry_len(struct archive_acl *,
int, int, int, int, const char *, size_t);
-const wchar_t *archive_acl_text_w(struct archive *, struct archive_acl *, int);
-int archive_acl_text_l(struct archive_acl *, int, const char **, size_t *,
+wchar_t *archive_acl_to_text_w(struct archive_acl *, ssize_t *, int,
+ struct archive *);
+char *archive_acl_to_text_l(struct archive_acl *, ssize_t *, int,
struct archive_string_conv *);
/*
- * Private ACL parser. This is private because it handles some
- * very weird formats that clients should not be messing with.
- * Clients should only deal with their platform-native formats.
- * Because of the need to support many formats cleanly, new arguments
- * are likely to get added on a regular basis. Clients who try to use
- * this interface are likely to be surprised when it changes.
+ * ACL text parser.
*/
-int archive_acl_parse_w(struct archive_acl *,
- const wchar_t *, int /* type */);
-int archive_acl_parse_l(struct archive_acl *,
- const char *, int /* type */,
- struct archive_string_conv *);
+int archive_acl_from_text_w(struct archive_acl *, const wchar_t * /* wtext */,
+ int /* type */);
+int archive_acl_from_text_l(struct archive_acl *, const char * /* text */,
+ int /* type */, struct archive_string_conv *);
#endif /* ARCHIVE_ENTRY_PRIVATE_H_INCLUDED */
Modified: trunk/contrib/libarchive/libarchive/archive_check_magic.c
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_check_magic.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/archive_check_magic.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -62,7 +62,7 @@
}
}
-static void
+static __LA_DEAD void
diediedie(void)
{
#if defined(_WIN32) && !defined(__CYGWIN__) && defined(_DEBUG)
Modified: trunk/contrib/libarchive/libarchive/archive_cryptor.c
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_cryptor.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/archive_cryptor.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -302,6 +302,8 @@
static int
aes_ctr_init(archive_crypto_ctx *ctx, const uint8_t *key, size_t key_len)
{
+ if ((ctx->ctx = EVP_CIPHER_CTX_new()) == NULL)
+ return -1;
switch (key_len) {
case 16: ctx->type = EVP_aes_128_ecb(); break;
@@ -314,7 +316,7 @@
memcpy(ctx->key, key, key_len);
memset(ctx->nonce, 0, sizeof(ctx->nonce));
ctx->encr_pos = AES_BLOCK_SIZE;
- EVP_CIPHER_CTX_init(&ctx->ctx);
+ EVP_CIPHER_CTX_init(ctx->ctx);
return 0;
}
@@ -324,10 +326,10 @@
int outl = 0;
int r;
- r = EVP_EncryptInit_ex(&ctx->ctx, ctx->type, NULL, ctx->key, NULL);
+ r = EVP_EncryptInit_ex(ctx->ctx, ctx->type, NULL, ctx->key, NULL);
if (r == 0)
return -1;
- r = EVP_EncryptUpdate(&ctx->ctx, ctx->encr_buf, &outl, ctx->nonce,
+ r = EVP_EncryptUpdate(ctx->ctx, ctx->encr_buf, &outl, ctx->nonce,
AES_BLOCK_SIZE);
if (r == 0 || outl != AES_BLOCK_SIZE)
return -1;
@@ -337,7 +339,7 @@
static int
aes_ctr_release(archive_crypto_ctx *ctx)
{
- EVP_CIPHER_CTX_cleanup(&ctx->ctx);
+ EVP_CIPHER_CTX_free(ctx->ctx);
memset(ctx->key, 0, ctx->key_len);
memset(ctx->nonce, 0, sizeof(ctx->nonce));
return 0;
Modified: trunk/contrib/libarchive/libarchive/archive_cryptor_private.h
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_cryptor_private.h 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/archive_cryptor_private.h 2018-06-19 20:42:35 UTC (rev 11134)
@@ -99,12 +99,12 @@
} archive_crypto_ctx;
#elif defined(HAVE_LIBCRYPTO)
-#include <openssl/evp.h>
+#include "archive_openssl_evp_private.h"
#define AES_BLOCK_SIZE 16
#define AES_MAX_KEY_SIZE 32
typedef struct {
- EVP_CIPHER_CTX ctx;
+ EVP_CIPHER_CTX *ctx;
const EVP_CIPHER *type;
uint8_t key[AES_MAX_KEY_SIZE];
unsigned key_len;
Modified: trunk/contrib/libarchive/libarchive/archive_digest.c
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_digest.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/archive_digest.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -207,7 +207,9 @@
static int
__archive_openssl_md5init(archive_md5_ctx *ctx)
{
- EVP_DigestInit(ctx, EVP_md5());
+ if ((*ctx = EVP_MD_CTX_new()) == NULL)
+ return (ARCHIVE_FAILED);
+ EVP_DigestInit(*ctx, EVP_md5());
return (ARCHIVE_OK);
}
@@ -215,7 +217,7 @@
__archive_openssl_md5update(archive_md5_ctx *ctx, const void *indata,
size_t insize)
{
- EVP_DigestUpdate(ctx, indata, insize);
+ EVP_DigestUpdate(*ctx, indata, insize);
return (ARCHIVE_OK);
}
@@ -226,8 +228,11 @@
* this is meant to cope with that. Real fix is probably to fix
* archive_write_set_format_xar.c
*/
- if (ctx->digest)
- EVP_DigestFinal(ctx, md, NULL);
+ if (*ctx) {
+ EVP_DigestFinal(*ctx, md, NULL);
+ EVP_MD_CTX_free(*ctx);
+ *ctx = NULL;
+ }
return (ARCHIVE_OK);
}
@@ -359,7 +364,9 @@
static int
__archive_openssl_ripemd160init(archive_rmd160_ctx *ctx)
{
- EVP_DigestInit(ctx, EVP_ripemd160());
+ if ((*ctx = EVP_MD_CTX_new()) == NULL)
+ return (ARCHIVE_FAILED);
+ EVP_DigestInit(*ctx, EVP_ripemd160());
return (ARCHIVE_OK);
}
@@ -367,7 +374,7 @@
__archive_openssl_ripemd160update(archive_rmd160_ctx *ctx, const void *indata,
size_t insize)
{
- EVP_DigestUpdate(ctx, indata, insize);
+ EVP_DigestUpdate(*ctx, indata, insize);
return (ARCHIVE_OK);
}
@@ -374,7 +381,11 @@
static int
__archive_openssl_ripemd160final(archive_rmd160_ctx *ctx, void *md)
{
- EVP_DigestFinal(ctx, md, NULL);
+ if (*ctx) {
+ EVP_DigestFinal(*ctx, md, NULL);
+ EVP_MD_CTX_free(*ctx);
+ *ctx = NULL;
+ }
return (ARCHIVE_OK);
}
@@ -509,7 +520,9 @@
static int
__archive_openssl_sha1init(archive_sha1_ctx *ctx)
{
- EVP_DigestInit(ctx, EVP_sha1());
+ if ((*ctx = EVP_MD_CTX_new()) == NULL)
+ return (ARCHIVE_FAILED);
+ EVP_DigestInit(*ctx, EVP_sha1());
return (ARCHIVE_OK);
}
@@ -517,7 +530,7 @@
__archive_openssl_sha1update(archive_sha1_ctx *ctx, const void *indata,
size_t insize)
{
- EVP_DigestUpdate(ctx, indata, insize);
+ EVP_DigestUpdate(*ctx, indata, insize);
return (ARCHIVE_OK);
}
@@ -528,8 +541,11 @@
* this is meant to cope with that. Real fix is probably to fix
* archive_write_set_format_xar.c
*/
- if (ctx->digest)
- EVP_DigestFinal(ctx, md, NULL);
+ if (*ctx) {
+ EVP_DigestFinal(*ctx, md, NULL);
+ EVP_MD_CTX_free(*ctx);
+ *ctx = NULL;
+ }
return (ARCHIVE_OK);
}
@@ -733,7 +749,9 @@
static int
__archive_openssl_sha256init(archive_sha256_ctx *ctx)
{
- EVP_DigestInit(ctx, EVP_sha256());
+ if ((*ctx = EVP_MD_CTX_new()) == NULL)
+ return (ARCHIVE_FAILED);
+ EVP_DigestInit(*ctx, EVP_sha256());
return (ARCHIVE_OK);
}
@@ -741,7 +759,7 @@
__archive_openssl_sha256update(archive_sha256_ctx *ctx, const void *indata,
size_t insize)
{
- EVP_DigestUpdate(ctx, indata, insize);
+ EVP_DigestUpdate(*ctx, indata, insize);
return (ARCHIVE_OK);
}
@@ -748,7 +766,11 @@
static int
__archive_openssl_sha256final(archive_sha256_ctx *ctx, void *md)
{
- EVP_DigestFinal(ctx, md, NULL);
+ if (*ctx) {
+ EVP_DigestFinal(*ctx, md, NULL);
+ EVP_MD_CTX_free(*ctx);
+ *ctx = NULL;
+ }
return (ARCHIVE_OK);
}
@@ -928,7 +950,9 @@
static int
__archive_openssl_sha384init(archive_sha384_ctx *ctx)
{
- EVP_DigestInit(ctx, EVP_sha384());
+ if ((*ctx = EVP_MD_CTX_new()) == NULL)
+ return (ARCHIVE_FAILED);
+ EVP_DigestInit(*ctx, EVP_sha384());
return (ARCHIVE_OK);
}
@@ -936,7 +960,7 @@
__archive_openssl_sha384update(archive_sha384_ctx *ctx, const void *indata,
size_t insize)
{
- EVP_DigestUpdate(ctx, indata, insize);
+ EVP_DigestUpdate(*ctx, indata, insize);
return (ARCHIVE_OK);
}
@@ -943,7 +967,11 @@
static int
__archive_openssl_sha384final(archive_sha384_ctx *ctx, void *md)
{
- EVP_DigestFinal(ctx, md, NULL);
+ if (*ctx) {
+ EVP_DigestFinal(*ctx, md, NULL);
+ EVP_MD_CTX_free(*ctx);
+ *ctx = NULL;
+ }
return (ARCHIVE_OK);
}
@@ -1147,7 +1175,9 @@
static int
__archive_openssl_sha512init(archive_sha512_ctx *ctx)
{
- EVP_DigestInit(ctx, EVP_sha512());
+ if ((*ctx = EVP_MD_CTX_new()) == NULL)
+ return (ARCHIVE_FAILED);
+ EVP_DigestInit(*ctx, EVP_sha512());
return (ARCHIVE_OK);
}
@@ -1155,7 +1185,7 @@
__archive_openssl_sha512update(archive_sha512_ctx *ctx, const void *indata,
size_t insize)
{
- EVP_DigestUpdate(ctx, indata, insize);
+ EVP_DigestUpdate(*ctx, indata, insize);
return (ARCHIVE_OK);
}
@@ -1162,7 +1192,11 @@
static int
__archive_openssl_sha512final(archive_sha512_ctx *ctx, void *md)
{
- EVP_DigestFinal(ctx, md, NULL);
+ if (*ctx) {
+ EVP_DigestFinal(*ctx, md, NULL);
+ EVP_MD_CTX_free(*ctx);
+ *ctx = NULL;
+ }
return (ARCHIVE_OK);
}
Modified: trunk/contrib/libarchive/libarchive/archive_digest_private.h
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_digest_private.h 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/archive_digest_private.h 2018-06-19 20:42:35 UTC (rev 11134)
@@ -134,7 +134,7 @@
defined(ARCHIVE_CRYPTO_SHA384_OPENSSL) ||\
defined(ARCHIVE_CRYPTO_SHA512_OPENSSL)
#define ARCHIVE_CRYPTO_OPENSSL 1
-#include <openssl/evp.h>
+#include "archive_openssl_evp_private.h"
#endif
/* Windows crypto headers */
@@ -143,6 +143,7 @@
defined(ARCHIVE_CRYPTO_SHA256_WIN) ||\
defined(ARCHIVE_CRYPTO_SHA384_WIN) ||\
defined(ARCHIVE_CRYPTO_SHA512_WIN)
+#include <windows.h>
#include <wincrypt.h>
typedef struct {
int valid;
@@ -161,7 +162,7 @@
#elif defined(ARCHIVE_CRYPTO_MD5_NETTLE)
typedef struct md5_ctx archive_md5_ctx;
#elif defined(ARCHIVE_CRYPTO_MD5_OPENSSL)
-typedef EVP_MD_CTX archive_md5_ctx;
+typedef EVP_MD_CTX *archive_md5_ctx;
#elif defined(ARCHIVE_CRYPTO_MD5_WIN)
typedef Digest_CTX archive_md5_ctx;
#else
@@ -175,7 +176,7 @@
#elif defined(ARCHIVE_CRYPTO_RMD160_NETTLE)
typedef struct ripemd160_ctx archive_rmd160_ctx;
#elif defined(ARCHIVE_CRYPTO_RMD160_OPENSSL)
-typedef EVP_MD_CTX archive_rmd160_ctx;
+typedef EVP_MD_CTX *archive_rmd160_ctx;
#else
typedef unsigned char archive_rmd160_ctx;
#endif
@@ -189,7 +190,7 @@
#elif defined(ARCHIVE_CRYPTO_SHA1_NETTLE)
typedef struct sha1_ctx archive_sha1_ctx;
#elif defined(ARCHIVE_CRYPTO_SHA1_OPENSSL)
-typedef EVP_MD_CTX archive_sha1_ctx;
+typedef EVP_MD_CTX *archive_sha1_ctx;
#elif defined(ARCHIVE_CRYPTO_SHA1_WIN)
typedef Digest_CTX archive_sha1_ctx;
#else
@@ -209,7 +210,7 @@
#elif defined(ARCHIVE_CRYPTO_SHA256_NETTLE)
typedef struct sha256_ctx archive_sha256_ctx;
#elif defined(ARCHIVE_CRYPTO_SHA256_OPENSSL)
-typedef EVP_MD_CTX archive_sha256_ctx;
+typedef EVP_MD_CTX *archive_sha256_ctx;
#elif defined(ARCHIVE_CRYPTO_SHA256_WIN)
typedef Digest_CTX archive_sha256_ctx;
#else
@@ -227,7 +228,7 @@
#elif defined(ARCHIVE_CRYPTO_SHA384_NETTLE)
typedef struct sha384_ctx archive_sha384_ctx;
#elif defined(ARCHIVE_CRYPTO_SHA384_OPENSSL)
-typedef EVP_MD_CTX archive_sha384_ctx;
+typedef EVP_MD_CTX *archive_sha384_ctx;
#elif defined(ARCHIVE_CRYPTO_SHA384_WIN)
typedef Digest_CTX archive_sha384_ctx;
#else
@@ -247,7 +248,7 @@
#elif defined(ARCHIVE_CRYPTO_SHA512_NETTLE)
typedef struct sha512_ctx archive_sha512_ctx;
#elif defined(ARCHIVE_CRYPTO_SHA512_OPENSSL)
-typedef EVP_MD_CTX archive_sha512_ctx;
+typedef EVP_MD_CTX *archive_sha512_ctx;
#elif defined(ARCHIVE_CRYPTO_SHA512_WIN)
typedef Digest_CTX archive_sha512_ctx;
#else
Copied: trunk/contrib/libarchive/libarchive/archive_disk_acl_darwin.c (from rev 11133, vendor/libarchive/dist/libarchive/archive_disk_acl_darwin.c)
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_disk_acl_darwin.c (rev 0)
+++ trunk/contrib/libarchive/libarchive/archive_disk_acl_darwin.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -0,0 +1,559 @@
+/*-
+ * Copyright (c) 2017 Martin Matuska
+ * 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"
+
+#if ARCHIVE_ACL_DARWIN
+
+#ifdef HAVE_FCNTL_H
+#include <fcntl.h>
+#endif
+#if HAVE_ERRNO_H
+#include <errno.h>
+#endif
+#if HAVE_MEMBERSHIP_H
+#include <membership.h>
+#endif
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_ACL_H
+#define _ACL_PRIVATE /* For debugging */
+#include <sys/acl.h>
+#endif
+
+#include "archive_entry.h"
+#include "archive_private.h"
+#include "archive_read_disk_private.h"
+#include "archive_write_disk_private.h"
+
+typedef struct {
+ const int a_perm; /* Libarchive permission or flag */
+ const int p_perm; /* Platform permission or flag */
+} acl_perm_map_t;
+
+static const acl_perm_map_t acl_nfs4_perm_map[] = {
+ {ARCHIVE_ENTRY_ACL_READ_DATA, ACL_READ_DATA},
+ {ARCHIVE_ENTRY_ACL_LIST_DIRECTORY, ACL_LIST_DIRECTORY},
+ {ARCHIVE_ENTRY_ACL_WRITE_DATA, ACL_WRITE_DATA},
+ {ARCHIVE_ENTRY_ACL_ADD_FILE, ACL_ADD_FILE},
+ {ARCHIVE_ENTRY_ACL_EXECUTE, ACL_EXECUTE},
+ {ARCHIVE_ENTRY_ACL_DELETE, ACL_DELETE},
+ {ARCHIVE_ENTRY_ACL_APPEND_DATA, ACL_APPEND_DATA},
+ {ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY, ACL_ADD_SUBDIRECTORY},
+ {ARCHIVE_ENTRY_ACL_DELETE_CHILD, ACL_DELETE_CHILD},
+ {ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES, ACL_READ_ATTRIBUTES},
+ {ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES, ACL_WRITE_ATTRIBUTES},
+ {ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS, ACL_READ_EXTATTRIBUTES},
+ {ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS, ACL_WRITE_EXTATTRIBUTES},
+ {ARCHIVE_ENTRY_ACL_READ_ACL, ACL_READ_SECURITY},
+ {ARCHIVE_ENTRY_ACL_WRITE_ACL, ACL_WRITE_SECURITY},
+ {ARCHIVE_ENTRY_ACL_WRITE_OWNER, ACL_CHANGE_OWNER},
+#if HAVE_DECL_ACL_SYNCHRONIZE
+ {ARCHIVE_ENTRY_ACL_SYNCHRONIZE, ACL_SYNCHRONIZE}
+#endif
+};
+
+static const int acl_nfs4_perm_map_size =
+ (int)(sizeof(acl_nfs4_perm_map)/sizeof(acl_nfs4_perm_map[0]));
+
+static const acl_perm_map_t acl_nfs4_flag_map[] = {
+ {ARCHIVE_ENTRY_ACL_ENTRY_INHERITED, ACL_ENTRY_INHERITED},
+ {ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT, ACL_ENTRY_FILE_INHERIT},
+ {ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT, ACL_ENTRY_DIRECTORY_INHERIT},
+ {ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT, ACL_ENTRY_LIMIT_INHERIT},
+ {ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY, ACL_ENTRY_ONLY_INHERIT}
+};
+
+static const int acl_nfs4_flag_map_size =
+ (int)(sizeof(acl_nfs4_flag_map)/sizeof(acl_nfs4_flag_map[0]));
+
+static int translate_guid(struct archive *a, acl_entry_t acl_entry,
+ int *ae_id, int *ae_tag, const char **ae_name)
+{
+ void *q;
+ uid_t ugid;
+ int r, idtype;
+
+ q = acl_get_qualifier(acl_entry);
+ if (q == NULL)
+ return (1);
+ r = mbr_uuid_to_id((const unsigned char *)q, &ugid, &idtype);
+ if (r != 0) {
+ acl_free(q);
+ return (1);
+ }
+ if (idtype == ID_TYPE_UID) {
+ *ae_tag = ARCHIVE_ENTRY_ACL_USER;
+ *ae_id = ugid;
+ *ae_name = archive_read_disk_uname(a, *ae_id);
+ } else if (idtype == ID_TYPE_GID) {
+ *ae_tag = ARCHIVE_ENTRY_ACL_GROUP;
+ *ae_id = ugid;
+ *ae_name = archive_read_disk_gname(a, *ae_id);
+ } else
+ r = 1;
+
+ acl_free(q);
+ return (r);
+}
+
+static void
+add_trivial_nfs4_acl(struct archive_entry *entry)
+{
+ mode_t mode;
+ int i;
+ const int rperm = ARCHIVE_ENTRY_ACL_READ_DATA;
+ const int wperm = ARCHIVE_ENTRY_ACL_WRITE_DATA |
+ ARCHIVE_ENTRY_ACL_APPEND_DATA;
+ const int eperm = ARCHIVE_ENTRY_ACL_EXECUTE;
+ const int pubset = ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES |
+ ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS |
+ ARCHIVE_ENTRY_ACL_READ_ACL |
+ ARCHIVE_ENTRY_ACL_SYNCHRONIZE;
+ const int ownset = pubset | ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES |
+ ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS |
+ ARCHIVE_ENTRY_ACL_WRITE_ACL |
+ ARCHIVE_ENTRY_ACL_WRITE_OWNER;
+
+ struct {
+ const int type;
+ const int tag;
+ int permset;
+ } tacl_entry[] = {
+ {ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_USER_OBJ, 0},
+ {ARCHIVE_ENTRY_ACL_TYPE_DENY, ARCHIVE_ENTRY_ACL_USER_OBJ, 0},
+ {ARCHIVE_ENTRY_ACL_TYPE_DENY, ARCHIVE_ENTRY_ACL_GROUP_OBJ, 0},
+ {ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_USER_OBJ, ownset},
+ {ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_GROUP_OBJ, pubset},
+ {ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_EVERYONE, pubset}
+ };
+
+ mode = archive_entry_mode(entry);
+
+ /* Permissions for everyone@ */
+ if (mode & 0004)
+ tacl_entry[5].permset |= rperm;
+ if (mode & 0002)
+ tacl_entry[5].permset |= wperm;
+ if (mode & 0001)
+ tacl_entry[5].permset |= eperm;
+
+ /* Permissions for group@ */
+ if (mode & 0040)
+ tacl_entry[4].permset |= rperm;
+ else if (mode & 0004)
+ tacl_entry[2].permset |= rperm;
+ if (mode & 0020)
+ tacl_entry[4].permset |= wperm;
+ else if (mode & 0002)
+ tacl_entry[2].permset |= wperm;
+ if (mode & 0010)
+ tacl_entry[4].permset |= eperm;
+ else if (mode & 0001)
+ tacl_entry[2].permset |= eperm;
+
+ /* Permissions for owner@ */
+ if (mode & 0400) {
+ tacl_entry[3].permset |= rperm;
+ if (!(mode & 0040) && (mode & 0004))
+ tacl_entry[0].permset |= rperm;
+ } else if ((mode & 0040) || (mode & 0004))
+ tacl_entry[1].permset |= rperm;
+ if (mode & 0200) {
+ tacl_entry[3].permset |= wperm;
+ if (!(mode & 0020) && (mode & 0002))
+ tacl_entry[0].permset |= wperm;
+ } else if ((mode & 0020) || (mode & 0002))
+ tacl_entry[1].permset |= wperm;
+ if (mode & 0100) {
+ tacl_entry[3].permset |= eperm;
+ if (!(mode & 0010) && (mode & 0001))
+ tacl_entry[0].permset |= eperm;
+ } else if ((mode & 0010) || (mode & 0001))
+ tacl_entry[1].permset |= eperm;
+
+ for (i = 0; i < 6; i++) {
+ if (tacl_entry[i].permset != 0) {
+ archive_entry_acl_add_entry(entry,
+ tacl_entry[i].type, tacl_entry[i].permset,
+ tacl_entry[i].tag, -1, NULL);
+ }
+ }
+
+ return;
+}
+
+static int
+translate_acl(struct archive_read_disk *a,
+ struct archive_entry *entry, acl_t acl)
+{
+ acl_tag_t acl_tag;
+ acl_flagset_t acl_flagset;
+ acl_entry_t acl_entry;
+ acl_permset_t acl_permset;
+ int i, entry_acl_type;
+ int r, s, ae_id, ae_tag, ae_perm;
+ const char *ae_name;
+
+ s = acl_get_entry(acl, ACL_FIRST_ENTRY, &acl_entry);
+ if (s == -1) {
+ archive_set_error(&a->archive, errno,
+ "Failed to get first ACL entry");
+ return (ARCHIVE_WARN);
+ }
+
+ while (s == 0) {
+ ae_id = -1;
+ ae_name = NULL;
+ ae_perm = 0;
+
+ if (acl_get_tag_type(acl_entry, &acl_tag) != 0) {
+ archive_set_error(&a->archive, errno,
+ "Failed to get ACL tag type");
+ return (ARCHIVE_WARN);
+ }
+ switch (acl_tag) {
+ case ACL_EXTENDED_ALLOW:
+ entry_acl_type = ARCHIVE_ENTRY_ACL_TYPE_ALLOW;
+ r = translate_guid(&a->archive, acl_entry,
+ &ae_id, &ae_tag, &ae_name);
+ break;
+ case ACL_EXTENDED_DENY:
+ entry_acl_type = ARCHIVE_ENTRY_ACL_TYPE_DENY;
+ r = translate_guid(&a->archive, acl_entry,
+ &ae_id, &ae_tag, &ae_name);
+ break;
+ default:
+ /* Skip types that libarchive can't support. */
+ s = acl_get_entry(acl, ACL_NEXT_ENTRY, &acl_entry);
+ continue;
+ }
+
+ /* Skip if translate_guid() above failed */
+ if (r != 0) {
+ s = acl_get_entry(acl, ACL_NEXT_ENTRY, &acl_entry);
+ continue;
+ }
+
+ /*
+ * Libarchive stores "flag" (NFSv4 inheritance bits)
+ * in the ae_perm bitmap.
+ *
+ * acl_get_flagset_np() fails with non-NFSv4 ACLs
+ */
+ if (acl_get_flagset_np(acl_entry, &acl_flagset) != 0) {
+ archive_set_error(&a->archive, errno,
+ "Failed to get flagset from a NFSv4 ACL entry");
+ return (ARCHIVE_WARN);
+ }
+ for (i = 0; i < acl_nfs4_flag_map_size; ++i) {
+ r = acl_get_flag_np(acl_flagset,
+ acl_nfs4_flag_map[i].p_perm);
+ if (r == -1) {
+ archive_set_error(&a->archive, errno,
+ "Failed to check flag in a NFSv4 "
+ "ACL flagset");
+ return (ARCHIVE_WARN);
+ } else if (r)
+ ae_perm |= acl_nfs4_flag_map[i].a_perm;
+ }
+
+ if (acl_get_permset(acl_entry, &acl_permset) != 0) {
+ archive_set_error(&a->archive, errno,
+ "Failed to get ACL permission set");
+ return (ARCHIVE_WARN);
+ }
+
+ for (i = 0; i < acl_nfs4_perm_map_size; ++i) {
+ /*
+ * acl_get_perm() is spelled differently on different
+ * platforms; see above.
+ */
+ r = acl_get_perm_np(acl_permset,
+ acl_nfs4_perm_map[i].p_perm);
+ if (r == -1) {
+ archive_set_error(&a->archive, errno,
+ "Failed to check permission in an ACL "
+ "permission set");
+ return (ARCHIVE_WARN);
+ } else if (r)
+ ae_perm |= acl_nfs4_perm_map[i].a_perm;
+ }
+
+#if !HAVE_DECL_ACL_SYNCHRONIZE
+ /* On Mac OS X without ACL_SYNCHRONIZE assume it is set */
+ ae_perm |= ARCHIVE_ENTRY_ACL_SYNCHRONIZE;
+#endif
+
+ archive_entry_acl_add_entry(entry, entry_acl_type,
+ ae_perm, ae_tag,
+ ae_id, ae_name);
+
+ s = acl_get_entry(acl, ACL_NEXT_ENTRY, &acl_entry);
+ }
+ return (ARCHIVE_OK);
+}
+
+static int
+set_acl(struct archive *a, int fd, const char *name,
+ struct archive_acl *abstract_acl,
+ int ae_requested_type, const char *tname)
+{
+ acl_t acl;
+ acl_entry_t acl_entry;
+ acl_permset_t acl_permset;
+ acl_flagset_t acl_flagset;
+ int ret;
+ int ae_type, ae_permset, ae_tag, ae_id;
+ uuid_t ae_uuid;
+ uid_t ae_uid;
+ gid_t ae_gid;
+ const char *ae_name;
+ int entries;
+ int i;
+
+ ret = ARCHIVE_OK;
+ entries = archive_acl_reset(abstract_acl, ae_requested_type);
+ if (entries == 0)
+ return (ARCHIVE_OK);
+
+ if (ae_requested_type != ARCHIVE_ENTRY_ACL_TYPE_NFS4) {
+ errno = ENOENT;
+ archive_set_error(a, errno, "Unsupported ACL type");
+ return (ARCHIVE_FAILED);
+ }
+
+ acl = acl_init(entries);
+ if (acl == (acl_t)NULL) {
+ archive_set_error(a, errno,
+ "Failed to initialize ACL working storage");
+ return (ARCHIVE_FAILED);
+ }
+
+ while (archive_acl_next(a, abstract_acl, ae_requested_type, &ae_type,
+ &ae_permset, &ae_tag, &ae_id, &ae_name) == ARCHIVE_OK) {
+ /*
+ * Mac OS doesn't support NFSv4 ACLs for
+ * owner@, group@ and everyone at .
+ * We skip any of these ACLs found.
+ */
+ if (ae_tag == ARCHIVE_ENTRY_ACL_USER_OBJ ||
+ ae_tag == ARCHIVE_ENTRY_ACL_GROUP_OBJ ||
+ ae_tag == ARCHIVE_ENTRY_ACL_EVERYONE)
+ continue;
+
+ if (acl_create_entry(&acl, &acl_entry) != 0) {
+ archive_set_error(a, errno,
+ "Failed to create a new ACL entry");
+ ret = ARCHIVE_FAILED;
+ goto exit_free;
+ }
+
+ switch (ae_type) {
+ case ARCHIVE_ENTRY_ACL_TYPE_ALLOW:
+ acl_set_tag_type(acl_entry, ACL_EXTENDED_ALLOW);
+ break;
+ case ARCHIVE_ENTRY_ACL_TYPE_DENY:
+ acl_set_tag_type(acl_entry, ACL_EXTENDED_DENY);
+ break;
+ default:
+ /* We don't support any other types on MacOS */
+ continue;
+ }
+
+ switch (ae_tag) {
+ case ARCHIVE_ENTRY_ACL_USER:
+ ae_uid = archive_write_disk_uid(a, ae_name, ae_id);
+ if (mbr_uid_to_uuid(ae_uid, ae_uuid) != 0)
+ continue;
+ if (acl_set_qualifier(acl_entry, &ae_uuid) != 0)
+ continue;
+ break;
+ case ARCHIVE_ENTRY_ACL_GROUP:
+ ae_gid = archive_write_disk_gid(a, ae_name, ae_id);
+ if (mbr_gid_to_uuid(ae_gid, ae_uuid) != 0)
+ continue;
+ if (acl_set_qualifier(acl_entry, &ae_uuid) != 0)
+ continue;
+ break;
+ default:
+ archive_set_error(a, ARCHIVE_ERRNO_MISC,
+ "Unsupported ACL tag");
+ ret = ARCHIVE_FAILED;
+ goto exit_free;
+ }
+
+ if (acl_get_permset(acl_entry, &acl_permset) != 0) {
+ archive_set_error(a, errno,
+ "Failed to get ACL permission set");
+ ret = ARCHIVE_FAILED;
+ goto exit_free;
+ }
+ if (acl_clear_perms(acl_permset) != 0) {
+ archive_set_error(a, errno,
+ "Failed to clear ACL permissions");
+ ret = ARCHIVE_FAILED;
+ goto exit_free;
+ }
+
+ for (i = 0; i < acl_nfs4_perm_map_size; ++i) {
+ if (ae_permset & acl_nfs4_perm_map[i].a_perm) {
+ if (acl_add_perm(acl_permset,
+ acl_nfs4_perm_map[i].p_perm) != 0) {
+ archive_set_error(a, errno,
+ "Failed to add ACL permission");
+ ret = ARCHIVE_FAILED;
+ goto exit_free;
+ }
+ }
+ }
+
+ /*
+ * acl_get_flagset_np() fails with non-NFSv4 ACLs
+ */
+ if (acl_get_flagset_np(acl_entry, &acl_flagset) != 0) {
+ archive_set_error(a, errno,
+ "Failed to get flagset from an NFSv4 ACL entry");
+ ret = ARCHIVE_FAILED;
+ goto exit_free;
+ }
+ if (acl_clear_flags_np(acl_flagset) != 0) {
+ archive_set_error(a, errno,
+ "Failed to clear flags from an NFSv4 ACL flagset");
+ ret = ARCHIVE_FAILED;
+ goto exit_free;
+ }
+
+ for (i = 0; i < acl_nfs4_flag_map_size; ++i) {
+ if (ae_permset & acl_nfs4_flag_map[i].a_perm) {
+ if (acl_add_flag_np(acl_flagset,
+ acl_nfs4_flag_map[i].p_perm) != 0) {
+ archive_set_error(a, errno,
+ "Failed to add flag to "
+ "NFSv4 ACL flagset");
+ ret = ARCHIVE_FAILED;
+ goto exit_free;
+ }
+ }
+ }
+ }
+
+ if (fd >= 0) {
+ if (acl_set_fd_np(fd, acl, ACL_TYPE_EXTENDED) == 0)
+ ret = ARCHIVE_OK;
+ else {
+ if (errno == EOPNOTSUPP) {
+ /* Filesystem doesn't support ACLs */
+ ret = ARCHIVE_OK;
+ } else {
+ archive_set_error(a, errno,
+ "Failed to set acl on fd: %s", tname);
+ ret = ARCHIVE_WARN;
+ }
+ }
+ } else if (acl_set_link_np(name, ACL_TYPE_EXTENDED, acl) != 0) {
+ if (errno == EOPNOTSUPP) {
+ /* Filesystem doesn't support ACLs */
+ ret = ARCHIVE_OK;
+ } else {
+ archive_set_error(a, errno, "Failed to set acl: %s",
+ tname);
+ ret = ARCHIVE_WARN;
+ }
+ }
+exit_free:
+ acl_free(acl);
+ return (ret);
+}
+
+int
+archive_read_disk_entry_setup_acls(struct archive_read_disk *a,
+ struct archive_entry *entry, int *fd)
+{
+ const char *accpath;
+ acl_t acl;
+ int r;
+
+ accpath = NULL;
+
+ if (*fd < 0) {
+ accpath = archive_read_disk_entry_setup_path(a, entry, fd);
+ if (accpath == NULL)
+ return (ARCHIVE_WARN);
+ }
+
+ archive_entry_acl_clear(entry);
+
+ acl = NULL;
+
+ if (*fd >= 0)
+ acl = acl_get_fd_np(*fd, ACL_TYPE_EXTENDED);
+ else if (!a->follow_symlinks)
+ acl = acl_get_link_np(accpath, ACL_TYPE_EXTENDED);
+ else
+ acl = acl_get_file(accpath, ACL_TYPE_EXTENDED);
+
+ if (acl != NULL) {
+ r = translate_acl(a, entry, acl);
+ acl_free(acl);
+ acl = NULL;
+
+ if (r != ARCHIVE_OK) {
+ archive_set_error(&a->archive, errno,
+ "Couldn't translate NFSv4 ACLs");
+ }
+
+ /*
+ * Because Mac OS doesn't support owner@, group@ and everyone@
+ * ACLs we need to add NFSv4 ACLs mirroring the file mode to
+ * the archive entry. Otherwise extraction on non-Mac platforms
+ * would lead to an invalid file mode.
+ */
+ if ((archive_entry_acl_types(entry) &
+ ARCHIVE_ENTRY_ACL_TYPE_NFS4) != 0)
+ add_trivial_nfs4_acl(entry);
+
+ return (r);
+ }
+ return (ARCHIVE_OK);
+}
+
+int
+archive_write_disk_set_acls(struct archive *a, int fd, const char *name,
+ struct archive_acl *abstract_acl, __LA_MODE_T mode)
+{
+ int ret = ARCHIVE_OK;
+
+ (void)mode; /* UNUSED */
+
+ if ((archive_acl_types(abstract_acl) &
+ ARCHIVE_ENTRY_ACL_TYPE_NFS4) != 0) {
+ ret = set_acl(a, fd, name, abstract_acl,
+ ARCHIVE_ENTRY_ACL_TYPE_NFS4, "nfs4");
+ }
+ return (ret);
+}
+#endif /* ARCHIVE_ACL_DARWIN */
Copied: trunk/contrib/libarchive/libarchive/archive_disk_acl_freebsd.c (from rev 11133, vendor/libarchive/dist/libarchive/archive_disk_acl_freebsd.c)
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_disk_acl_freebsd.c (rev 0)
+++ trunk/contrib/libarchive/libarchive/archive_disk_acl_freebsd.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -0,0 +1,700 @@
+/*-
+ * Copyright (c) 2003-2009 Tim Kientzle
+ * Copyright (c) 2010-2012 Michihiro NAKAJIMA
+ * Copyright (c) 2017 Martin Matuska
+ * 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"
+
+#if ARCHIVE_ACL_FREEBSD
+
+#ifdef HAVE_ERRNO_H
+#include <errno.h>
+#endif
+#ifdef HAVE_FCNTL_H
+#include <fcntl.h>
+#endif
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_ACL_H
+#define _ACL_PRIVATE /* For debugging */
+#include <sys/acl.h>
+#endif
+
+#include "archive_entry.h"
+#include "archive_private.h"
+#include "archive_read_disk_private.h"
+#include "archive_write_disk_private.h"
+
+typedef struct {
+ const int a_perm; /* Libarchive permission or flag */
+ const int p_perm; /* Platform permission or flag */
+} acl_perm_map_t;
+
+static const acl_perm_map_t acl_posix_perm_map[] = {
+ {ARCHIVE_ENTRY_ACL_EXECUTE, ACL_EXECUTE},
+ {ARCHIVE_ENTRY_ACL_WRITE, ACL_WRITE},
+ {ARCHIVE_ENTRY_ACL_READ, ACL_READ},
+};
+
+static const int acl_posix_perm_map_size =
+ (int)(sizeof(acl_posix_perm_map)/sizeof(acl_posix_perm_map[0]));
+
+#if ARCHIVE_ACL_FREEBSD_NFS4
+static const acl_perm_map_t acl_nfs4_perm_map[] = {
+ {ARCHIVE_ENTRY_ACL_EXECUTE, ACL_EXECUTE},
+ {ARCHIVE_ENTRY_ACL_READ_DATA, ACL_READ_DATA},
+ {ARCHIVE_ENTRY_ACL_LIST_DIRECTORY, ACL_LIST_DIRECTORY},
+ {ARCHIVE_ENTRY_ACL_WRITE_DATA, ACL_WRITE_DATA},
+ {ARCHIVE_ENTRY_ACL_ADD_FILE, ACL_ADD_FILE},
+ {ARCHIVE_ENTRY_ACL_APPEND_DATA, ACL_APPEND_DATA},
+ {ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY, ACL_ADD_SUBDIRECTORY},
+ {ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS, ACL_READ_NAMED_ATTRS},
+ {ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS, ACL_WRITE_NAMED_ATTRS},
+ {ARCHIVE_ENTRY_ACL_DELETE_CHILD, ACL_DELETE_CHILD},
+ {ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES, ACL_READ_ATTRIBUTES},
+ {ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES, ACL_WRITE_ATTRIBUTES},
+ {ARCHIVE_ENTRY_ACL_DELETE, ACL_DELETE},
+ {ARCHIVE_ENTRY_ACL_READ_ACL, ACL_READ_ACL},
+ {ARCHIVE_ENTRY_ACL_WRITE_ACL, ACL_WRITE_ACL},
+ {ARCHIVE_ENTRY_ACL_WRITE_OWNER, ACL_WRITE_OWNER},
+ {ARCHIVE_ENTRY_ACL_SYNCHRONIZE, ACL_SYNCHRONIZE}
+};
+
+static const int acl_nfs4_perm_map_size =
+ (int)(sizeof(acl_nfs4_perm_map)/sizeof(acl_nfs4_perm_map[0]));
+
+static const acl_perm_map_t acl_nfs4_flag_map[] = {
+ {ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT, ACL_ENTRY_FILE_INHERIT},
+ {ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT, ACL_ENTRY_DIRECTORY_INHERIT},
+ {ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT, ACL_ENTRY_NO_PROPAGATE_INHERIT},
+ {ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY, ACL_ENTRY_INHERIT_ONLY},
+ {ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS, ACL_ENTRY_SUCCESSFUL_ACCESS},
+ {ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS, ACL_ENTRY_FAILED_ACCESS},
+ {ARCHIVE_ENTRY_ACL_ENTRY_INHERITED, ACL_ENTRY_INHERITED}
+};
+
+static const int acl_nfs4_flag_map_size =
+ (int)(sizeof(acl_nfs4_flag_map)/sizeof(acl_nfs4_flag_map[0]));
+#endif /* ARCHIVE_ACL_FREEBSD_NFS4 */
+
+static int
+translate_acl(struct archive_read_disk *a,
+ struct archive_entry *entry, acl_t acl, int default_entry_acl_type)
+{
+#if ARCHIVE_ACL_FREEBSD_NFS4
+ int brand;
+ acl_flagset_t acl_flagset;
+ acl_entry_type_t acl_type;
+#endif
+ acl_tag_t acl_tag;
+ acl_entry_t acl_entry;
+ acl_permset_t acl_permset;
+ int i, entry_acl_type, perm_map_size;
+ const acl_perm_map_t *perm_map;
+ int r, s, ae_id, ae_tag, ae_perm;
+ void *q;
+ const char *ae_name;
+
+#if ARCHIVE_ACL_FREEBSD_NFS4
+ // FreeBSD "brands" ACLs as POSIX.1e or NFSv4
+ // Make sure the "brand" on this ACL is consistent
+ // with the default_entry_acl_type bits provided.
+ if (acl_get_brand_np(acl, &brand) != 0) {
+ archive_set_error(&a->archive, errno,
+ "Failed to read ACL brand");
+ return (ARCHIVE_WARN);
+ }
+ switch (brand) {
+ case ACL_BRAND_POSIX:
+ switch (default_entry_acl_type) {
+ case ARCHIVE_ENTRY_ACL_TYPE_ACCESS:
+ case ARCHIVE_ENTRY_ACL_TYPE_DEFAULT:
+ break;
+ default:
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
+ "Invalid ACL entry type for POSIX.1e ACL");
+ return (ARCHIVE_WARN);
+ }
+ break;
+ case ACL_BRAND_NFS4:
+ if (default_entry_acl_type & ~ARCHIVE_ENTRY_ACL_TYPE_NFS4) {
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
+ "Invalid ACL entry type for NFSv4 ACL");
+ return (ARCHIVE_WARN);
+ }
+ break;
+ default:
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
+ "Unknown ACL brand");
+ return (ARCHIVE_WARN);
+ }
+#endif
+
+ s = acl_get_entry(acl, ACL_FIRST_ENTRY, &acl_entry);
+ if (s == -1) {
+ archive_set_error(&a->archive, errno,
+ "Failed to get first ACL entry");
+ return (ARCHIVE_WARN);
+ }
+
+ while (s == 1) {
+ ae_id = -1;
+ ae_name = NULL;
+ ae_perm = 0;
+
+ if (acl_get_tag_type(acl_entry, &acl_tag) != 0) {
+ archive_set_error(&a->archive, errno,
+ "Failed to get ACL tag type");
+ return (ARCHIVE_WARN);
+ }
+ switch (acl_tag) {
+ case ACL_USER:
+ q = acl_get_qualifier(acl_entry);
+ if (q != NULL) {
+ ae_id = (int)*(uid_t *)q;
+ acl_free(q);
+ ae_name = archive_read_disk_uname(&a->archive,
+ ae_id);
+ }
+ ae_tag = ARCHIVE_ENTRY_ACL_USER;
+ break;
+ case ACL_GROUP:
+ q = acl_get_qualifier(acl_entry);
+ if (q != NULL) {
+ ae_id = (int)*(gid_t *)q;
+ acl_free(q);
+ ae_name = archive_read_disk_gname(&a->archive,
+ ae_id);
+ }
+ ae_tag = ARCHIVE_ENTRY_ACL_GROUP;
+ break;
+ case ACL_MASK:
+ ae_tag = ARCHIVE_ENTRY_ACL_MASK;
+ break;
+ case ACL_USER_OBJ:
+ ae_tag = ARCHIVE_ENTRY_ACL_USER_OBJ;
+ break;
+ case ACL_GROUP_OBJ:
+ ae_tag = ARCHIVE_ENTRY_ACL_GROUP_OBJ;
+ break;
+ case ACL_OTHER:
+ ae_tag = ARCHIVE_ENTRY_ACL_OTHER;
+ break;
+#if ARCHIVE_ACL_FREEBSD_NFS4
+ case ACL_EVERYONE:
+ ae_tag = ARCHIVE_ENTRY_ACL_EVERYONE;
+ break;
+#endif
+ default:
+ /* Skip types that libarchive can't support. */
+ s = acl_get_entry(acl, ACL_NEXT_ENTRY, &acl_entry);
+ continue;
+ }
+
+ // XXX acl_type maps to allow/deny/audit/YYYY bits
+ entry_acl_type = default_entry_acl_type;
+
+#if ARCHIVE_ACL_FREEBSD_NFS4
+ if (default_entry_acl_type & ARCHIVE_ENTRY_ACL_TYPE_NFS4) {
+ /*
+ * acl_get_entry_type_np() fails with non-NFSv4 ACLs
+ */
+ if (acl_get_entry_type_np(acl_entry, &acl_type) != 0) {
+ archive_set_error(&a->archive, errno, "Failed "
+ "to get ACL type from a NFSv4 ACL entry");
+ return (ARCHIVE_WARN);
+ }
+ switch (acl_type) {
+ case ACL_ENTRY_TYPE_ALLOW:
+ entry_acl_type = ARCHIVE_ENTRY_ACL_TYPE_ALLOW;
+ break;
+ case ACL_ENTRY_TYPE_DENY:
+ entry_acl_type = ARCHIVE_ENTRY_ACL_TYPE_DENY;
+ break;
+ case ACL_ENTRY_TYPE_AUDIT:
+ entry_acl_type = ARCHIVE_ENTRY_ACL_TYPE_AUDIT;
+ break;
+ case ACL_ENTRY_TYPE_ALARM:
+ entry_acl_type = ARCHIVE_ENTRY_ACL_TYPE_ALARM;
+ break;
+ default:
+ archive_set_error(&a->archive, errno,
+ "Invalid NFSv4 ACL entry type");
+ return (ARCHIVE_WARN);
+ }
+
+ /*
+ * Libarchive stores "flag" (NFSv4 inheritance bits)
+ * in the ae_perm bitmap.
+ *
+ * acl_get_flagset_np() fails with non-NFSv4 ACLs
+ */
+ if (acl_get_flagset_np(acl_entry, &acl_flagset) != 0) {
+ archive_set_error(&a->archive, errno,
+ "Failed to get flagset from a NFSv4 "
+ "ACL entry");
+ return (ARCHIVE_WARN);
+ }
+ for (i = 0; i < acl_nfs4_flag_map_size; ++i) {
+ r = acl_get_flag_np(acl_flagset,
+ acl_nfs4_flag_map[i].p_perm);
+ if (r == -1) {
+ archive_set_error(&a->archive, errno,
+ "Failed to check flag in a NFSv4 "
+ "ACL flagset");
+ return (ARCHIVE_WARN);
+ } else if (r)
+ ae_perm |= acl_nfs4_flag_map[i].a_perm;
+ }
+ }
+#endif
+
+ if (acl_get_permset(acl_entry, &acl_permset) != 0) {
+ archive_set_error(&a->archive, errno,
+ "Failed to get ACL permission set");
+ return (ARCHIVE_WARN);
+ }
+
+#if ARCHIVE_ACL_FREEBSD_NFS4
+ if (default_entry_acl_type & ARCHIVE_ENTRY_ACL_TYPE_NFS4) {
+ perm_map_size = acl_nfs4_perm_map_size;
+ perm_map = acl_nfs4_perm_map;
+ } else {
+#endif
+ perm_map_size = acl_posix_perm_map_size;
+ perm_map = acl_posix_perm_map;
+#if ARCHIVE_ACL_FREEBSD_NFS4
+ }
+#endif
+
+ for (i = 0; i < perm_map_size; ++i) {
+ r = acl_get_perm_np(acl_permset, perm_map[i].p_perm);
+ if (r == -1) {
+ archive_set_error(&a->archive, errno,
+ "Failed to check permission in an ACL "
+ "permission set");
+ return (ARCHIVE_WARN);
+ } else if (r)
+ ae_perm |= perm_map[i].a_perm;
+ }
+
+ archive_entry_acl_add_entry(entry, entry_acl_type,
+ ae_perm, ae_tag,
+ ae_id, ae_name);
+
+ s = acl_get_entry(acl, ACL_NEXT_ENTRY, &acl_entry);
+ if (s == -1) {
+ archive_set_error(&a->archive, errno,
+ "Failed to get next ACL entry");
+ return (ARCHIVE_WARN);
+ }
+ }
+ return (ARCHIVE_OK);
+}
+
+static int
+set_acl(struct archive *a, int fd, const char *name,
+ struct archive_acl *abstract_acl,
+ int ae_requested_type, const char *tname)
+{
+ int acl_type = 0;
+ acl_t acl;
+ acl_entry_t acl_entry;
+ acl_permset_t acl_permset;
+#if ARCHIVE_ACL_FREEBSD_NFS4
+ acl_flagset_t acl_flagset;
+ int r;
+#endif
+ int ret;
+ int ae_type, ae_permset, ae_tag, ae_id;
+ int perm_map_size;
+ const acl_perm_map_t *perm_map;
+ uid_t ae_uid;
+ gid_t ae_gid;
+ const char *ae_name;
+ int entries;
+ int i;
+
+ ret = ARCHIVE_OK;
+ entries = archive_acl_reset(abstract_acl, ae_requested_type);
+ if (entries == 0)
+ return (ARCHIVE_OK);
+
+
+ switch (ae_requested_type) {
+ case ARCHIVE_ENTRY_ACL_TYPE_ACCESS:
+ acl_type = ACL_TYPE_ACCESS;
+ break;
+ case ARCHIVE_ENTRY_ACL_TYPE_DEFAULT:
+ acl_type = ACL_TYPE_DEFAULT;
+ break;
+#if ARCHIVE_ACL_FREEBSD_NFS4
+ case ARCHIVE_ENTRY_ACL_TYPE_NFS4:
+ acl_type = ACL_TYPE_NFS4;
+ break;
+#endif
+ default:
+ errno = ENOENT;
+ archive_set_error(a, errno, "Unsupported ACL type");
+ return (ARCHIVE_FAILED);
+ }
+
+ acl = acl_init(entries);
+ if (acl == (acl_t)NULL) {
+ archive_set_error(a, errno,
+ "Failed to initialize ACL working storage");
+ return (ARCHIVE_FAILED);
+ }
+
+ while (archive_acl_next(a, abstract_acl, ae_requested_type, &ae_type,
+ &ae_permset, &ae_tag, &ae_id, &ae_name) == ARCHIVE_OK) {
+ if (acl_create_entry(&acl, &acl_entry) != 0) {
+ archive_set_error(a, errno,
+ "Failed to create a new ACL entry");
+ ret = ARCHIVE_FAILED;
+ goto exit_free;
+ }
+ switch (ae_tag) {
+ case ARCHIVE_ENTRY_ACL_USER:
+ ae_uid = archive_write_disk_uid(a, ae_name, ae_id);
+ acl_set_tag_type(acl_entry, ACL_USER);
+ acl_set_qualifier(acl_entry, &ae_uid);
+ break;
+ case ARCHIVE_ENTRY_ACL_GROUP:
+ ae_gid = archive_write_disk_gid(a, ae_name, ae_id);
+ acl_set_tag_type(acl_entry, ACL_GROUP);
+ acl_set_qualifier(acl_entry, &ae_gid);
+ break;
+ case ARCHIVE_ENTRY_ACL_USER_OBJ:
+ acl_set_tag_type(acl_entry, ACL_USER_OBJ);
+ break;
+ case ARCHIVE_ENTRY_ACL_GROUP_OBJ:
+ acl_set_tag_type(acl_entry, ACL_GROUP_OBJ);
+ break;
+ case ARCHIVE_ENTRY_ACL_MASK:
+ acl_set_tag_type(acl_entry, ACL_MASK);
+ break;
+ case ARCHIVE_ENTRY_ACL_OTHER:
+ acl_set_tag_type(acl_entry, ACL_OTHER);
+ break;
+#if ARCHIVE_ACL_FREEBSD_NFS4
+ case ARCHIVE_ENTRY_ACL_EVERYONE:
+ acl_set_tag_type(acl_entry, ACL_EVERYONE);
+ break;
+#endif
+ default:
+ archive_set_error(a, ARCHIVE_ERRNO_MISC,
+ "Unsupported ACL tag");
+ ret = ARCHIVE_FAILED;
+ goto exit_free;
+ }
+
+#if ARCHIVE_ACL_FREEBSD_NFS4
+ r = 0;
+ switch (ae_type) {
+ case ARCHIVE_ENTRY_ACL_TYPE_ALLOW:
+ r = acl_set_entry_type_np(acl_entry,
+ ACL_ENTRY_TYPE_ALLOW);
+ break;
+ case ARCHIVE_ENTRY_ACL_TYPE_DENY:
+ r = acl_set_entry_type_np(acl_entry,
+ ACL_ENTRY_TYPE_DENY);
+ break;
+ case ARCHIVE_ENTRY_ACL_TYPE_AUDIT:
+ r = acl_set_entry_type_np(acl_entry,
+ ACL_ENTRY_TYPE_AUDIT);
+ break;
+ case ARCHIVE_ENTRY_ACL_TYPE_ALARM:
+ r = acl_set_entry_type_np(acl_entry,
+ ACL_ENTRY_TYPE_ALARM);
+ break;
+ case ARCHIVE_ENTRY_ACL_TYPE_ACCESS:
+ case ARCHIVE_ENTRY_ACL_TYPE_DEFAULT:
+ // These don't translate directly into the system ACL.
+ break;
+ default:
+ archive_set_error(a, ARCHIVE_ERRNO_MISC,
+ "Unsupported ACL entry type");
+ ret = ARCHIVE_FAILED;
+ goto exit_free;
+ }
+
+ if (r != 0) {
+ archive_set_error(a, errno,
+ "Failed to set ACL entry type");
+ ret = ARCHIVE_FAILED;
+ goto exit_free;
+ }
+#endif
+
+ if (acl_get_permset(acl_entry, &acl_permset) != 0) {
+ archive_set_error(a, errno,
+ "Failed to get ACL permission set");
+ ret = ARCHIVE_FAILED;
+ goto exit_free;
+ }
+ if (acl_clear_perms(acl_permset) != 0) {
+ archive_set_error(a, errno,
+ "Failed to clear ACL permissions");
+ ret = ARCHIVE_FAILED;
+ goto exit_free;
+ }
+#if ARCHIVE_ACL_FREEBSD_NFS4
+ if (ae_requested_type == ARCHIVE_ENTRY_ACL_TYPE_NFS4) {
+ perm_map_size = acl_nfs4_perm_map_size;
+ perm_map = acl_nfs4_perm_map;
+ } else {
+#endif
+ perm_map_size = acl_posix_perm_map_size;
+ perm_map = acl_posix_perm_map;
+#if ARCHIVE_ACL_FREEBSD_NFS4
+ }
+#endif
+
+ for (i = 0; i < perm_map_size; ++i) {
+ if (ae_permset & perm_map[i].a_perm) {
+ if (acl_add_perm(acl_permset,
+ perm_map[i].p_perm) != 0) {
+ archive_set_error(a, errno,
+ "Failed to add ACL permission");
+ ret = ARCHIVE_FAILED;
+ goto exit_free;
+ }
+ }
+ }
+
+#if ARCHIVE_ACL_FREEBSD_NFS4
+ if (ae_requested_type == ARCHIVE_ENTRY_ACL_TYPE_NFS4) {
+ /*
+ * acl_get_flagset_np() fails with non-NFSv4 ACLs
+ */
+ if (acl_get_flagset_np(acl_entry, &acl_flagset) != 0) {
+ archive_set_error(a, errno,
+ "Failed to get flagset from an NFSv4 "
+ "ACL entry");
+ ret = ARCHIVE_FAILED;
+ goto exit_free;
+ }
+ if (acl_clear_flags_np(acl_flagset) != 0) {
+ archive_set_error(a, errno,
+ "Failed to clear flags from an NFSv4 "
+ "ACL flagset");
+ ret = ARCHIVE_FAILED;
+ goto exit_free;
+ }
+ for (i = 0; i < acl_nfs4_flag_map_size; ++i) {
+ if (ae_permset & acl_nfs4_flag_map[i].a_perm) {
+ if (acl_add_flag_np(acl_flagset,
+ acl_nfs4_flag_map[i].p_perm) != 0) {
+ archive_set_error(a, errno,
+ "Failed to add flag to "
+ "NFSv4 ACL flagset");
+ ret = ARCHIVE_FAILED;
+ goto exit_free;
+ }
+ }
+ }
+ }
+#endif
+ }
+
+ /* Try restoring the ACL through 'fd' if we can. */
+ if (fd >= 0) {
+ if (acl_set_fd_np(fd, acl, acl_type) == 0)
+ ret = ARCHIVE_OK;
+ else {
+ if (errno == EOPNOTSUPP) {
+ /* Filesystem doesn't support ACLs */
+ ret = ARCHIVE_OK;
+ } else {
+ archive_set_error(a, errno,
+ "Failed to set acl on fd: %s", tname);
+ ret = ARCHIVE_WARN;
+ }
+ }
+ }
+#if HAVE_ACL_SET_LINK_NP
+ else if (acl_set_link_np(name, acl_type, acl) != 0)
+#else
+ /* FreeBSD older than 8.0 */
+ else if (acl_set_file(name, acl_type, acl) != 0)
+#endif
+ {
+ if (errno == EOPNOTSUPP) {
+ /* Filesystem doesn't support ACLs */
+ ret = ARCHIVE_OK;
+ } else {
+ archive_set_error(a, errno, "Failed to set acl: %s",
+ tname);
+ ret = ARCHIVE_WARN;
+ }
+ }
+exit_free:
+ acl_free(acl);
+ return (ret);
+}
+
+int
+archive_read_disk_entry_setup_acls(struct archive_read_disk *a,
+ struct archive_entry *entry, int *fd)
+{
+ const char *accpath;
+ acl_t acl;
+ int r;
+
+ accpath = NULL;
+
+ if (*fd < 0) {
+ accpath = archive_read_disk_entry_setup_path(a, entry, fd);
+ if (accpath == NULL)
+ return (ARCHIVE_WARN);
+ }
+
+ archive_entry_acl_clear(entry);
+
+ acl = NULL;
+
+#if ARCHIVE_ACL_FREEBSD_NFS4
+ /* Try NFSv4 ACL first. */
+ if (*fd >= 0)
+ acl = acl_get_fd_np(*fd, ACL_TYPE_NFS4);
+ else if (!a->follow_symlinks)
+ acl = acl_get_link_np(accpath, ACL_TYPE_NFS4);
+ else
+ acl = acl_get_file(accpath, ACL_TYPE_NFS4);
+
+ /* Ignore "trivial" ACLs that just mirror the file mode. */
+ if (acl != NULL && acl_is_trivial_np(acl, &r) == 0 && r == 1) {
+ acl_free(acl);
+ acl = NULL;
+ return (ARCHIVE_OK);
+ }
+
+ if (acl != NULL) {
+ r = translate_acl(a, entry, acl, ARCHIVE_ENTRY_ACL_TYPE_NFS4);
+ acl_free(acl);
+ acl = NULL;
+
+ if (r != ARCHIVE_OK) {
+ archive_set_error(&a->archive, errno,
+ "Couldn't translate NFSv4 ACLs");
+ }
+
+ return (r);
+ }
+#endif
+
+ /* Retrieve access ACL from file. */
+ if (*fd >= 0)
+ acl = acl_get_fd_np(*fd, ACL_TYPE_ACCESS);
+#if HAVE_ACL_GET_LINK_NP
+ else if (!a->follow_symlinks)
+ acl = acl_get_link_np(accpath, ACL_TYPE_ACCESS);
+#else
+ else if ((!a->follow_symlinks)
+ && (archive_entry_filetype(entry) == AE_IFLNK))
+ /* We can't get the ACL of a symlink, so we assume it can't
+ have one. */
+ acl = NULL;
+#endif
+ else
+ acl = acl_get_file(accpath, ACL_TYPE_ACCESS);
+
+#if HAVE_ACL_IS_TRIVIAL_NP
+ /* Ignore "trivial" ACLs that just mirror the file mode. */
+ if (acl != NULL && acl_is_trivial_np(acl, &r) == 0 && r == 1) {
+ acl_free(acl);
+ acl = NULL;
+ }
+#endif
+
+ if (acl != NULL) {
+ r = translate_acl(a, entry, acl, ARCHIVE_ENTRY_ACL_TYPE_ACCESS);
+ acl_free(acl);
+ acl = NULL;
+
+ if (r != ARCHIVE_OK) {
+ archive_set_error(&a->archive, errno,
+ "Couldn't translate access ACLs");
+ return (r);
+ }
+ }
+
+ /* Only directories can have default ACLs. */
+ if (S_ISDIR(archive_entry_mode(entry))) {
+ if (*fd >= 0)
+ acl = acl_get_fd_np(*fd, ACL_TYPE_DEFAULT);
+ else
+ acl = acl_get_file(accpath, ACL_TYPE_DEFAULT);
+ if (acl != NULL) {
+ r = translate_acl(a, entry, acl,
+ ARCHIVE_ENTRY_ACL_TYPE_DEFAULT);
+ acl_free(acl);
+ if (r != ARCHIVE_OK) {
+ archive_set_error(&a->archive, errno,
+ "Couldn't translate default ACLs");
+ return (r);
+ }
+ }
+ }
+ return (ARCHIVE_OK);
+}
+
+int
+archive_write_disk_set_acls(struct archive *a, int fd, const char *name,
+ struct archive_acl *abstract_acl, __LA_MODE_T mode)
+{
+ int ret = ARCHIVE_OK;
+
+ (void)mode; /* UNUSED */
+
+ if ((archive_acl_types(abstract_acl)
+ & ARCHIVE_ENTRY_ACL_TYPE_POSIX1E) != 0) {
+ if ((archive_acl_types(abstract_acl)
+ & ARCHIVE_ENTRY_ACL_TYPE_ACCESS) != 0) {
+ ret = set_acl(a, fd, name, abstract_acl,
+ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, "access");
+ if (ret != ARCHIVE_OK)
+ return (ret);
+ }
+ if ((archive_acl_types(abstract_acl)
+ & ARCHIVE_ENTRY_ACL_TYPE_DEFAULT) != 0)
+ ret = set_acl(a, fd, name, abstract_acl,
+ ARCHIVE_ENTRY_ACL_TYPE_DEFAULT, "default");
+
+ /* Simultaneous POSIX.1e and NFSv4 is not supported */
+ return (ret);
+ }
+#if ARCHIVE_ACL_FREEBSD_NFS4
+ else if ((archive_acl_types(abstract_acl) &
+ ARCHIVE_ENTRY_ACL_TYPE_NFS4) != 0) {
+ ret = set_acl(a, fd, name, abstract_acl,
+ ARCHIVE_ENTRY_ACL_TYPE_NFS4, "nfs4");
+ }
+#endif
+ return (ret);
+}
+#endif /* ARCHIVE_ACL_FREEBSD */
Copied: trunk/contrib/libarchive/libarchive/archive_disk_acl_linux.c (from rev 11133, vendor/libarchive/dist/libarchive/archive_disk_acl_linux.c)
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_disk_acl_linux.c (rev 0)
+++ trunk/contrib/libarchive/libarchive/archive_disk_acl_linux.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -0,0 +1,743 @@
+/*-
+ * Copyright (c) 2003-2009 Tim Kientzle
+ * Copyright (c) 2010-2012 Michihiro NAKAJIMA
+ * Copyright (c) 2017 Martin Matuska
+ * 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"
+
+#if ARCHIVE_ACL_LIBACL || ARCHIVE_ACL_LIBRICHACL
+
+#ifdef HAVE_ERRNO_H
+#include <errno.h>
+#endif
+#ifdef HAVE_FCNTL_H
+#include <fcntl.h>
+#endif
+#if HAVE_ACL_LIBACL_H
+#include <acl/libacl.h>
+#endif
+#ifdef HAVE_SYS_ACL_H
+#include <sys/acl.h>
+#endif
+#ifdef HAVE_SYS_RICHACL_H
+#include <sys/richacl.h>
+#endif
+
+#include "archive_entry.h"
+#include "archive_private.h"
+#include "archive_read_disk_private.h"
+#include "archive_write_disk_private.h"
+
+typedef struct {
+ const int a_perm; /* Libarchive permission or flag */
+ const int p_perm; /* Platform permission or flag */
+} acl_perm_map_t;
+
+#if ARCHIVE_ACL_LIBACL
+static const acl_perm_map_t acl_posix_perm_map[] = {
+ {ARCHIVE_ENTRY_ACL_EXECUTE, ACL_EXECUTE},
+ {ARCHIVE_ENTRY_ACL_WRITE, ACL_WRITE},
+ {ARCHIVE_ENTRY_ACL_READ, ACL_READ},
+};
+
+static const int acl_posix_perm_map_size =
+ (int)(sizeof(acl_posix_perm_map)/sizeof(acl_posix_perm_map[0]));
+#endif /* ARCHIVE_ACL_LIBACL */
+
+#if ARCHIVE_ACL_LIBRICHACL
+static const acl_perm_map_t acl_nfs4_perm_map[] = {
+ {ARCHIVE_ENTRY_ACL_EXECUTE, RICHACE_EXECUTE},
+ {ARCHIVE_ENTRY_ACL_READ_DATA, RICHACE_READ_DATA},
+ {ARCHIVE_ENTRY_ACL_LIST_DIRECTORY, RICHACE_LIST_DIRECTORY},
+ {ARCHIVE_ENTRY_ACL_WRITE_DATA, RICHACE_WRITE_DATA},
+ {ARCHIVE_ENTRY_ACL_ADD_FILE, RICHACE_ADD_FILE},
+ {ARCHIVE_ENTRY_ACL_APPEND_DATA, RICHACE_APPEND_DATA},
+ {ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY, RICHACE_ADD_SUBDIRECTORY},
+ {ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS, RICHACE_READ_NAMED_ATTRS},
+ {ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS, RICHACE_WRITE_NAMED_ATTRS},
+ {ARCHIVE_ENTRY_ACL_DELETE_CHILD, RICHACE_DELETE_CHILD},
+ {ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES, RICHACE_READ_ATTRIBUTES},
+ {ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES, RICHACE_WRITE_ATTRIBUTES},
+ {ARCHIVE_ENTRY_ACL_DELETE, RICHACE_DELETE},
+ {ARCHIVE_ENTRY_ACL_READ_ACL, RICHACE_READ_ACL},
+ {ARCHIVE_ENTRY_ACL_WRITE_ACL, RICHACE_WRITE_ACL},
+ {ARCHIVE_ENTRY_ACL_WRITE_OWNER, RICHACE_WRITE_OWNER},
+ {ARCHIVE_ENTRY_ACL_SYNCHRONIZE, RICHACE_SYNCHRONIZE}
+};
+
+static const int acl_nfs4_perm_map_size =
+ (int)(sizeof(acl_nfs4_perm_map)/sizeof(acl_nfs4_perm_map[0]));
+
+static const acl_perm_map_t acl_nfs4_flag_map[] = {
+ {ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT, RICHACE_FILE_INHERIT_ACE},
+ {ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT, RICHACE_DIRECTORY_INHERIT_ACE},
+ {ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT, RICHACE_NO_PROPAGATE_INHERIT_ACE},
+ {ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY, RICHACE_INHERIT_ONLY_ACE},
+ {ARCHIVE_ENTRY_ACL_ENTRY_INHERITED, RICHACE_INHERITED_ACE}
+};
+
+static const int acl_nfs4_flag_map_size =
+ (int)(sizeof(acl_nfs4_flag_map)/sizeof(acl_nfs4_flag_map[0]));
+#endif /* ARCHIVE_ACL_LIBRICHACL */
+
+#if ARCHIVE_ACL_LIBACL
+/*
+ * Translate POSIX.1e ACLs into libarchive internal structure
+ */
+static int
+translate_acl(struct archive_read_disk *a,
+ struct archive_entry *entry, acl_t acl, int default_entry_acl_type)
+{
+ acl_tag_t acl_tag;
+ acl_entry_t acl_entry;
+ acl_permset_t acl_permset;
+ int i, entry_acl_type;
+ int r, s, ae_id, ae_tag, ae_perm;
+ void *q;
+ const char *ae_name;
+
+ s = acl_get_entry(acl, ACL_FIRST_ENTRY, &acl_entry);
+ if (s == -1) {
+ archive_set_error(&a->archive, errno,
+ "Failed to get first ACL entry");
+ return (ARCHIVE_WARN);
+ }
+
+ while (s == 1) {
+ ae_id = -1;
+ ae_name = NULL;
+ ae_perm = 0;
+
+ if (acl_get_tag_type(acl_entry, &acl_tag) != 0) {
+ archive_set_error(&a->archive, errno,
+ "Failed to get ACL tag type");
+ return (ARCHIVE_WARN);
+ }
+ switch (acl_tag) {
+ case ACL_USER:
+ q = acl_get_qualifier(acl_entry);
+ if (q != NULL) {
+ ae_id = (int)*(uid_t *)q;
+ acl_free(q);
+ ae_name = archive_read_disk_uname(&a->archive,
+ ae_id);
+ }
+ ae_tag = ARCHIVE_ENTRY_ACL_USER;
+ break;
+ case ACL_GROUP:
+ q = acl_get_qualifier(acl_entry);
+ if (q != NULL) {
+ ae_id = (int)*(gid_t *)q;
+ acl_free(q);
+ ae_name = archive_read_disk_gname(&a->archive,
+ ae_id);
+ }
+ ae_tag = ARCHIVE_ENTRY_ACL_GROUP;
+ break;
+ case ACL_MASK:
+ ae_tag = ARCHIVE_ENTRY_ACL_MASK;
+ break;
+ case ACL_USER_OBJ:
+ ae_tag = ARCHIVE_ENTRY_ACL_USER_OBJ;
+ break;
+ case ACL_GROUP_OBJ:
+ ae_tag = ARCHIVE_ENTRY_ACL_GROUP_OBJ;
+ break;
+ case ACL_OTHER:
+ ae_tag = ARCHIVE_ENTRY_ACL_OTHER;
+ break;
+ default:
+ /* Skip types that libarchive can't support. */
+ s = acl_get_entry(acl, ACL_NEXT_ENTRY, &acl_entry);
+ continue;
+ }
+
+ // XXX acl_type maps to allow/deny/audit/YYYY bits
+ entry_acl_type = default_entry_acl_type;
+
+ if (acl_get_permset(acl_entry, &acl_permset) != 0) {
+ archive_set_error(&a->archive, errno,
+ "Failed to get ACL permission set");
+ return (ARCHIVE_WARN);
+ }
+
+ for (i = 0; i < acl_posix_perm_map_size; ++i) {
+ r = acl_get_perm(acl_permset,
+ acl_posix_perm_map[i].p_perm);
+ if (r == -1) {
+ archive_set_error(&a->archive, errno,
+ "Failed to check permission in an ACL "
+ "permission set");
+ return (ARCHIVE_WARN);
+ } else if (r)
+ ae_perm |= acl_posix_perm_map[i].a_perm;
+ }
+
+ archive_entry_acl_add_entry(entry, entry_acl_type,
+ ae_perm, ae_tag,
+ ae_id, ae_name);
+
+ s = acl_get_entry(acl, ACL_NEXT_ENTRY, &acl_entry);
+ if (s == -1) {
+ archive_set_error(&a->archive, errno,
+ "Failed to get next ACL entry");
+ return (ARCHIVE_WARN);
+ }
+ }
+ return (ARCHIVE_OK);
+}
+#endif /* ARCHIVE_ACL_LIBACL */
+
+#if ARCHIVE_ACL_LIBRICHACL
+/*
+ * Translate RichACL into libarchive internal ACL
+ */
+static int
+translate_richacl(struct archive_read_disk *a, struct archive_entry *entry,
+ struct richacl *richacl)
+{
+ int ae_id, ae_tag, ae_perm;
+ int entry_acl_type, i;
+ const char *ae_name;
+
+ struct richace *richace;
+
+ richacl_for_each_entry(richace, richacl) {
+ ae_name = NULL;
+ ae_tag = 0;
+ ae_perm = 0;
+ ae_id = -1;
+
+ switch (richace->e_type) {
+ case RICHACE_ACCESS_ALLOWED_ACE_TYPE:
+ entry_acl_type = ARCHIVE_ENTRY_ACL_TYPE_ALLOW;
+ break;
+ case RICHACE_ACCESS_DENIED_ACE_TYPE:
+ entry_acl_type = ARCHIVE_ENTRY_ACL_TYPE_DENY;
+ break;
+ default: /* Unknown entry type, skip */
+ continue;
+ }
+
+ /* Unsupported */
+ if (richace->e_flags & RICHACE_UNMAPPED_WHO)
+ continue;
+
+ if (richace->e_flags & RICHACE_SPECIAL_WHO) {
+ switch (richace->e_id) {
+ case RICHACE_OWNER_SPECIAL_ID:
+ ae_tag = ARCHIVE_ENTRY_ACL_USER_OBJ;
+ break;
+ case RICHACE_GROUP_SPECIAL_ID:
+ ae_tag = ARCHIVE_ENTRY_ACL_GROUP_OBJ;
+ break;
+ case RICHACE_EVERYONE_SPECIAL_ID:
+ ae_tag = ARCHIVE_ENTRY_ACL_EVERYONE;
+ break;
+ default: /* Unknown special ID type */
+ continue;
+ }
+ } else {
+ ae_id = richace->e_id;
+ if (richace->e_flags & RICHACE_IDENTIFIER_GROUP) {
+ ae_tag = ARCHIVE_ENTRY_ACL_GROUP;
+ ae_name = archive_read_disk_gname(&a->archive,
+ (gid_t)(richace->e_id));
+ } else {
+ ae_tag = ARCHIVE_ENTRY_ACL_USER;
+ ae_name = archive_read_disk_uname(&a->archive,
+ (uid_t)(richace->e_id));
+ }
+ }
+ for (i = 0; i < acl_nfs4_flag_map_size; ++i) {
+ if ((richace->e_flags &
+ acl_nfs4_flag_map[i].p_perm) != 0)
+ ae_perm |= acl_nfs4_flag_map[i].a_perm;
+ }
+ for (i = 0; i < acl_nfs4_perm_map_size; ++i) {
+ if ((richace->e_mask &
+ acl_nfs4_perm_map[i].p_perm) != 0)
+ ae_perm |=
+ acl_nfs4_perm_map[i].a_perm;
+ }
+
+ archive_entry_acl_add_entry(entry, entry_acl_type,
+ ae_perm, ae_tag, ae_id, ae_name);
+ }
+ return (ARCHIVE_OK);
+}
+#endif /* ARCHIVE_ACL_LIBRICHACL */
+
+#if ARCHIVE_ACL_LIBRICHACL
+static int
+_richacl_mode_to_mask(short mode)
+{
+ int mask = 0;
+
+ if (mode & S_IROTH)
+ mask |= RICHACE_POSIX_MODE_READ;
+ if (mode & S_IWOTH)
+ mask |= RICHACE_POSIX_MODE_WRITE;
+ if (mode & S_IXOTH)
+ mask |= RICHACE_POSIX_MODE_EXEC;
+
+ return (mask);
+}
+
+static void
+_richacl_mode_to_masks(struct richacl *richacl, __LA_MODE_T mode)
+{
+ richacl->a_owner_mask = _richacl_mode_to_mask((mode & 0700) >> 6);
+ richacl->a_group_mask = _richacl_mode_to_mask((mode & 0070) >> 3);
+ richacl->a_other_mask = _richacl_mode_to_mask(mode & 0007);
+}
+#endif /* ARCHIVE_ACL_LIBRICHACL */
+
+#if ARCHIVE_ACL_LIBRICHACL
+static int
+set_richacl(struct archive *a, int fd, const char *name,
+ struct archive_acl *abstract_acl, __LA_MODE_T mode,
+ int ae_requested_type, const char *tname)
+{
+ int ae_type, ae_permset, ae_tag, ae_id;
+ uid_t ae_uid;
+ gid_t ae_gid;
+ const char *ae_name;
+ int entries;
+ int i;
+ int ret;
+ int e = 0;
+ struct richacl *richacl = NULL;
+ struct richace *richace;
+
+ ret = ARCHIVE_OK;
+ entries = archive_acl_reset(abstract_acl, ae_requested_type);
+ if (entries == 0)
+ return (ARCHIVE_OK);
+
+ if (ae_requested_type != ARCHIVE_ENTRY_ACL_TYPE_NFS4) {
+ errno = ENOENT;
+ archive_set_error(a, errno, "Unsupported ACL type");
+ return (ARCHIVE_FAILED);
+ }
+
+ richacl = richacl_alloc(entries);
+ if (richacl == NULL) {
+ archive_set_error(a, errno,
+ "Failed to initialize RichACL working storage");
+ return (ARCHIVE_FAILED);
+ }
+
+ e = 0;
+
+ while (archive_acl_next(a, abstract_acl, ae_requested_type, &ae_type,
+ &ae_permset, &ae_tag, &ae_id, &ae_name) == ARCHIVE_OK) {
+ richace = &(richacl->a_entries[e]);
+
+ richace->e_flags = 0;
+ richace->e_mask = 0;
+
+ switch (ae_tag) {
+ case ARCHIVE_ENTRY_ACL_USER:
+ ae_uid = archive_write_disk_uid(a, ae_name, ae_id);
+ richace->e_id = ae_uid;
+ break;
+ case ARCHIVE_ENTRY_ACL_GROUP:
+ ae_gid = archive_write_disk_gid(a, ae_name, ae_id);
+ richace->e_id = ae_gid;
+ richace->e_flags |= RICHACE_IDENTIFIER_GROUP;
+ break;
+ case ARCHIVE_ENTRY_ACL_USER_OBJ:
+ richace->e_flags |= RICHACE_SPECIAL_WHO;
+ richace->e_id = RICHACE_OWNER_SPECIAL_ID;
+ break;
+ case ARCHIVE_ENTRY_ACL_GROUP_OBJ:
+ richace->e_flags |= RICHACE_SPECIAL_WHO;
+ richace->e_id = RICHACE_GROUP_SPECIAL_ID;
+ break;
+ case ARCHIVE_ENTRY_ACL_EVERYONE:
+ richace->e_flags |= RICHACE_SPECIAL_WHO;
+ richace->e_id = RICHACE_EVERYONE_SPECIAL_ID;
+ break;
+ default:
+ archive_set_error(a, ARCHIVE_ERRNO_MISC,
+ "Unsupported ACL tag");
+ ret = ARCHIVE_FAILED;
+ goto exit_free;
+ }
+
+ switch (ae_type) {
+ case ARCHIVE_ENTRY_ACL_TYPE_ALLOW:
+ richace->e_type =
+ RICHACE_ACCESS_ALLOWED_ACE_TYPE;
+ break;
+ case ARCHIVE_ENTRY_ACL_TYPE_DENY:
+ richace->e_type =
+ RICHACE_ACCESS_DENIED_ACE_TYPE;
+ break;
+ case ARCHIVE_ENTRY_ACL_TYPE_AUDIT:
+ case ARCHIVE_ENTRY_ACL_TYPE_ALARM:
+ break;
+ default:
+ archive_set_error(a, ARCHIVE_ERRNO_MISC,
+ "Unsupported ACL entry type");
+ ret = ARCHIVE_FAILED;
+ goto exit_free;
+ }
+
+ for (i = 0; i < acl_nfs4_perm_map_size; ++i) {
+ if (ae_permset & acl_nfs4_perm_map[i].a_perm)
+ richace->e_mask |= acl_nfs4_perm_map[i].p_perm;
+ }
+
+ for (i = 0; i < acl_nfs4_flag_map_size; ++i) {
+ if (ae_permset &
+ acl_nfs4_flag_map[i].a_perm)
+ richace->e_flags |= acl_nfs4_flag_map[i].p_perm;
+ }
+ e++;
+ }
+
+ /* Fill RichACL masks */
+ _richacl_mode_to_masks(richacl, mode);
+
+ if (fd >= 0) {
+ if (richacl_set_fd(fd, richacl) == 0)
+ ret = ARCHIVE_OK;
+ else {
+ if (errno == EOPNOTSUPP) {
+ /* Filesystem doesn't support ACLs */
+ ret = ARCHIVE_OK;
+ } else {
+ archive_set_error(a, errno,
+ "Failed to set richacl on fd: %s", tname);
+ ret = ARCHIVE_WARN;
+ }
+ }
+ } else if (richacl_set_file(name, richacl) != 0) {
+ if (errno == EOPNOTSUPP) {
+ /* Filesystem doesn't support ACLs */
+ ret = ARCHIVE_OK;
+ } else {
+ archive_set_error(a, errno, "Failed to set richacl: %s",
+ tname);
+ ret = ARCHIVE_WARN;
+ }
+ }
+exit_free:
+ richacl_free(richacl);
+ return (ret);
+}
+#endif /* ARCHIVE_ACL_RICHACL */
+
+#if ARCHIVE_ACL_LIBACL
+static int
+set_acl(struct archive *a, int fd, const char *name,
+ struct archive_acl *abstract_acl,
+ int ae_requested_type, const char *tname)
+{
+ int acl_type = 0;
+ int ae_type, ae_permset, ae_tag, ae_id;
+ uid_t ae_uid;
+ gid_t ae_gid;
+ const char *ae_name;
+ int entries;
+ int i;
+ int ret;
+ acl_t acl = NULL;
+ acl_entry_t acl_entry;
+ acl_permset_t acl_permset;
+
+ ret = ARCHIVE_OK;
+ entries = archive_acl_reset(abstract_acl, ae_requested_type);
+ if (entries == 0)
+ return (ARCHIVE_OK);
+
+ switch (ae_requested_type) {
+ case ARCHIVE_ENTRY_ACL_TYPE_ACCESS:
+ acl_type = ACL_TYPE_ACCESS;
+ break;
+ case ARCHIVE_ENTRY_ACL_TYPE_DEFAULT:
+ acl_type = ACL_TYPE_DEFAULT;
+ break;
+ default:
+ errno = ENOENT;
+ archive_set_error(a, errno, "Unsupported ACL type");
+ return (ARCHIVE_FAILED);
+ }
+
+ acl = acl_init(entries);
+ if (acl == (acl_t)NULL) {
+ archive_set_error(a, errno,
+ "Failed to initialize ACL working storage");
+ return (ARCHIVE_FAILED);
+ }
+
+ while (archive_acl_next(a, abstract_acl, ae_requested_type, &ae_type,
+ &ae_permset, &ae_tag, &ae_id, &ae_name) == ARCHIVE_OK) {
+
+ if (acl_create_entry(&acl, &acl_entry) != 0) {
+ archive_set_error(a, errno,
+ "Failed to create a new ACL entry");
+ ret = ARCHIVE_FAILED;
+ goto exit_free;
+ }
+
+ switch (ae_tag) {
+ case ARCHIVE_ENTRY_ACL_USER:
+ ae_uid = archive_write_disk_uid(a, ae_name, ae_id);
+ acl_set_tag_type(acl_entry, ACL_USER);
+ acl_set_qualifier(acl_entry, &ae_uid);
+ break;
+ case ARCHIVE_ENTRY_ACL_GROUP:
+ ae_gid = archive_write_disk_gid(a, ae_name, ae_id);
+ acl_set_tag_type(acl_entry, ACL_GROUP);
+ acl_set_qualifier(acl_entry, &ae_gid);
+ break;
+ case ARCHIVE_ENTRY_ACL_USER_OBJ:
+ acl_set_tag_type(acl_entry, ACL_USER_OBJ);
+ break;
+ case ARCHIVE_ENTRY_ACL_GROUP_OBJ:
+ acl_set_tag_type(acl_entry, ACL_GROUP_OBJ);
+ break;
+ case ARCHIVE_ENTRY_ACL_MASK:
+ acl_set_tag_type(acl_entry, ACL_MASK);
+ break;
+ case ARCHIVE_ENTRY_ACL_OTHER:
+ acl_set_tag_type(acl_entry, ACL_OTHER);
+ break;
+ default:
+ archive_set_error(a, ARCHIVE_ERRNO_MISC,
+ "Unsupported ACL tag");
+ ret = ARCHIVE_FAILED;
+ goto exit_free;
+ }
+
+ if (acl_get_permset(acl_entry, &acl_permset) != 0) {
+ archive_set_error(a, errno,
+ "Failed to get ACL permission set");
+ ret = ARCHIVE_FAILED;
+ goto exit_free;
+ }
+ if (acl_clear_perms(acl_permset) != 0) {
+ archive_set_error(a, errno,
+ "Failed to clear ACL permissions");
+ ret = ARCHIVE_FAILED;
+ goto exit_free;
+ }
+
+ for (i = 0; i < acl_posix_perm_map_size; ++i) {
+ if (ae_permset & acl_posix_perm_map[i].a_perm) {
+ if (acl_add_perm(acl_permset,
+ acl_posix_perm_map[i].p_perm) != 0) {
+ archive_set_error(a, errno,
+ "Failed to add ACL permission");
+ ret = ARCHIVE_FAILED;
+ goto exit_free;
+ }
+ }
+ }
+
+ }
+
+ if (fd >= 0 && ae_requested_type == ARCHIVE_ENTRY_ACL_TYPE_ACCESS) {
+ if (acl_set_fd(fd, acl) == 0)
+ ret = ARCHIVE_OK;
+ else {
+ if (errno == EOPNOTSUPP) {
+ /* Filesystem doesn't support ACLs */
+ ret = ARCHIVE_OK;
+ } else {
+ archive_set_error(a, errno,
+ "Failed to set acl on fd: %s", tname);
+ ret = ARCHIVE_WARN;
+ }
+ }
+ } else if (acl_set_file(name, acl_type, acl) != 0) {
+ if (errno == EOPNOTSUPP) {
+ /* Filesystem doesn't support ACLs */
+ ret = ARCHIVE_OK;
+ } else {
+ archive_set_error(a, errno, "Failed to set acl: %s",
+ tname);
+ ret = ARCHIVE_WARN;
+ }
+ }
+exit_free:
+ acl_free(acl);
+ return (ret);
+}
+#endif /* ARCHIVE_ACL_LIBACL */
+
+int
+archive_read_disk_entry_setup_acls(struct archive_read_disk *a,
+ struct archive_entry *entry, int *fd)
+{
+ const char *accpath;
+ int r;
+#if ARCHIVE_ACL_LIBACL
+ acl_t acl;
+#endif
+#if ARCHIVE_ACL_LIBRICHACL
+ struct richacl *richacl;
+ mode_t mode;
+#endif
+
+ accpath = NULL;
+ r = ARCHIVE_OK;
+
+ /* For default ACLs we need reachable accpath */
+ if (*fd < 0 || S_ISDIR(archive_entry_mode(entry))) {
+ accpath = archive_read_disk_entry_setup_path(a, entry, fd);
+ if (accpath == NULL)
+ return (ARCHIVE_WARN);
+ }
+
+ archive_entry_acl_clear(entry);
+
+#if ARCHIVE_ACL_LIBACL
+ acl = NULL;
+#endif
+#if ARCHIVE_ACL_LIBRICHACL
+ richacl = NULL;
+#endif
+
+#if ARCHIVE_ACL_LIBRICHACL
+ /* Try NFSv4 ACL first. */
+ if (*fd >= 0)
+ richacl = richacl_get_fd(*fd);
+ else if ((!a->follow_symlinks)
+ && (archive_entry_filetype(entry) == AE_IFLNK))
+ /* We can't get the ACL of a symlink, so we assume it can't
+ have one */
+ richacl = NULL;
+ else
+ richacl = richacl_get_file(accpath);
+
+ /* Ignore "trivial" ACLs that just mirror the file mode. */
+ if (richacl != NULL) {
+ mode = archive_entry_mode(entry);
+ if (richacl_equiv_mode(richacl, &mode) == 0) {
+ richacl_free(richacl);
+ richacl = NULL;
+ return (ARCHIVE_OK);
+ }
+ }
+
+ if (richacl != NULL) {
+ r = translate_richacl(a, entry, richacl);
+ richacl_free(richacl);
+ richacl = NULL;
+
+ if (r != ARCHIVE_OK) {
+ archive_set_error(&a->archive, errno,
+ "Couldn't translate NFSv4 ACLs");
+ }
+
+ return (r);
+ }
+#endif /* ARCHIVE_ACL_LIBRICHACL */
+
+#if ARCHIVE_ACL_LIBACL
+ /* Retrieve access ACL from file. */
+ if (*fd >= 0)
+ acl = acl_get_fd(*fd);
+ else if ((!a->follow_symlinks)
+ && (archive_entry_filetype(entry) == AE_IFLNK))
+ /* We can't get the ACL of a symlink, so we assume it can't
+ have one. */
+ acl = NULL;
+ else
+ acl = acl_get_file(accpath, ACL_TYPE_ACCESS);
+
+ if (acl != NULL) {
+ r = translate_acl(a, entry, acl, ARCHIVE_ENTRY_ACL_TYPE_ACCESS);
+ acl_free(acl);
+ acl = NULL;
+
+ if (r != ARCHIVE_OK) {
+ archive_set_error(&a->archive, errno,
+ "Couldn't translate access ACLs");
+ return (r);
+ }
+ }
+
+ /* Only directories can have default ACLs. */
+ if (S_ISDIR(archive_entry_mode(entry))) {
+ acl = acl_get_file(accpath, ACL_TYPE_DEFAULT);
+ if (acl != NULL) {
+ r = translate_acl(a, entry, acl,
+ ARCHIVE_ENTRY_ACL_TYPE_DEFAULT);
+ acl_free(acl);
+ if (r != ARCHIVE_OK) {
+ archive_set_error(&a->archive, errno,
+ "Couldn't translate default ACLs");
+ return (r);
+ }
+ }
+ }
+#endif /* ARCHIVE_ACL_LIBACL */
+ return (r);
+}
+
+int
+archive_write_disk_set_acls(struct archive *a, int fd, const char *name,
+ struct archive_acl *abstract_acl, __LA_MODE_T mode)
+{
+ int ret = ARCHIVE_OK;
+
+#if !ARCHIVE_ACL_LIBRICHACL
+ (void)mode; /* UNUSED */
+#endif
+
+#if ARCHIVE_ACL_LIBRICHACL
+ if ((archive_acl_types(abstract_acl)
+ & ARCHIVE_ENTRY_ACL_TYPE_NFS4) != 0) {
+ ret = set_richacl(a, fd, name, abstract_acl, mode,
+ ARCHIVE_ENTRY_ACL_TYPE_NFS4, "nfs4");
+ }
+#if ARCHIVE_ACL_LIBACL
+ else
+#endif
+#endif /* ARCHIVE_ACL_LIBRICHACL */
+#if ARCHIVE_ACL_LIBACL
+ if ((archive_acl_types(abstract_acl)
+ & ARCHIVE_ENTRY_ACL_TYPE_POSIX1E) != 0) {
+ if ((archive_acl_types(abstract_acl)
+ & ARCHIVE_ENTRY_ACL_TYPE_ACCESS) != 0) {
+ ret = set_acl(a, fd, name, abstract_acl,
+ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, "access");
+ if (ret != ARCHIVE_OK)
+ return (ret);
+ }
+ if ((archive_acl_types(abstract_acl)
+ & ARCHIVE_ENTRY_ACL_TYPE_DEFAULT) != 0)
+ ret = set_acl(a, fd, name, abstract_acl,
+ ARCHIVE_ENTRY_ACL_TYPE_DEFAULT, "default");
+ }
+#endif /* ARCHIVE_ACL_LIBACL */
+ return (ret);
+}
+#endif /* ARCHIVE_ACL_LIBACL || ARCHIVE_ACL_LIBRICHACL */
Copied: trunk/contrib/libarchive/libarchive/archive_disk_acl_sunos.c (from rev 11133, vendor/libarchive/dist/libarchive/archive_disk_acl_sunos.c)
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_disk_acl_sunos.c (rev 0)
+++ trunk/contrib/libarchive/libarchive/archive_disk_acl_sunos.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -0,0 +1,821 @@
+/*-
+ * Copyright (c) 2017 Martin Matuska
+ * 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"
+
+#if ARCHIVE_ACL_SUNOS
+
+#ifdef HAVE_ERRNO_H
+#include <errno.h>
+#endif
+#ifdef HAVE_FCNTL_H
+#include <fcntl.h>
+#endif
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_ACL_H
+#define _ACL_PRIVATE /* For debugging */
+#include <sys/acl.h>
+#endif
+
+#include "archive_entry.h"
+#include "archive_private.h"
+#include "archive_read_disk_private.h"
+#include "archive_write_disk_private.h"
+
+typedef struct {
+ const int a_perm; /* Libarchive permission or flag */
+ const int p_perm; /* Platform permission or flag */
+} acl_perm_map_t;
+
+static const acl_perm_map_t acl_posix_perm_map[] = {
+ {ARCHIVE_ENTRY_ACL_EXECUTE, S_IXOTH },
+ {ARCHIVE_ENTRY_ACL_WRITE, S_IWOTH },
+ {ARCHIVE_ENTRY_ACL_READ, S_IROTH }
+};
+
+static const int acl_posix_perm_map_size =
+ (int)(sizeof(acl_posix_perm_map)/sizeof(acl_posix_perm_map[0]));
+
+#if ARCHIVE_ACL_SUNOS_NFS4
+static const acl_perm_map_t acl_nfs4_perm_map[] = {
+ {ARCHIVE_ENTRY_ACL_EXECUTE, ACE_EXECUTE},
+ {ARCHIVE_ENTRY_ACL_READ_DATA, ACE_READ_DATA},
+ {ARCHIVE_ENTRY_ACL_LIST_DIRECTORY, ACE_LIST_DIRECTORY},
+ {ARCHIVE_ENTRY_ACL_WRITE_DATA, ACE_WRITE_DATA},
+ {ARCHIVE_ENTRY_ACL_ADD_FILE, ACE_ADD_FILE},
+ {ARCHIVE_ENTRY_ACL_APPEND_DATA, ACE_APPEND_DATA},
+ {ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY, ACE_ADD_SUBDIRECTORY},
+ {ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS, ACE_READ_NAMED_ATTRS},
+ {ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS, ACE_WRITE_NAMED_ATTRS},
+ {ARCHIVE_ENTRY_ACL_DELETE_CHILD, ACE_DELETE_CHILD},
+ {ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES, ACE_READ_ATTRIBUTES},
+ {ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES, ACE_WRITE_ATTRIBUTES},
+ {ARCHIVE_ENTRY_ACL_DELETE, ACE_DELETE},
+ {ARCHIVE_ENTRY_ACL_READ_ACL, ACE_READ_ACL},
+ {ARCHIVE_ENTRY_ACL_WRITE_ACL, ACE_WRITE_ACL},
+ {ARCHIVE_ENTRY_ACL_WRITE_OWNER, ACE_WRITE_OWNER},
+ {ARCHIVE_ENTRY_ACL_SYNCHRONIZE, ACE_SYNCHRONIZE}
+};
+
+static const int acl_nfs4_perm_map_size =
+ (int)(sizeof(acl_nfs4_perm_map)/sizeof(acl_nfs4_perm_map[0]));
+
+static const acl_perm_map_t acl_nfs4_flag_map[] = {
+ {ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT, ACE_FILE_INHERIT_ACE},
+ {ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT, ACE_DIRECTORY_INHERIT_ACE},
+ {ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT, ACE_NO_PROPAGATE_INHERIT_ACE},
+ {ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY, ACE_INHERIT_ONLY_ACE},
+ {ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS, ACE_SUCCESSFUL_ACCESS_ACE_FLAG},
+ {ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS, ACE_FAILED_ACCESS_ACE_FLAG},
+#ifdef ACE_INHERITED_ACE
+ {ARCHIVE_ENTRY_ACL_ENTRY_INHERITED, ACE_INHERITED_ACE}
+#endif
+};
+
+const int acl_nfs4_flag_map_size =
+ (int)(sizeof(acl_nfs4_flag_map)/sizeof(acl_nfs4_flag_map[0]));
+
+#endif /* ARCHIVE_ACL_SUNOS_NFS4 */
+
+static void *
+sunacl_get(int cmd, int *aclcnt, int fd, const char *path)
+{
+ int cnt, cntcmd;
+ size_t size;
+ void *aclp;
+
+ if (cmd == GETACL) {
+ cntcmd = GETACLCNT;
+ size = sizeof(aclent_t);
+ }
+#if ARCHIVE_ACL_SUNOS_NFS4
+ else if (cmd == ACE_GETACL) {
+ cntcmd = ACE_GETACLCNT;
+ size = sizeof(ace_t);
+ }
+#endif
+ else {
+ errno = EINVAL;
+ *aclcnt = -1;
+ return (NULL);
+ }
+
+ aclp = NULL;
+ cnt = -2;
+
+ while (cnt == -2 || (cnt == -1 && errno == ENOSPC)) {
+ if (path != NULL)
+ cnt = acl(path, cntcmd, 0, NULL);
+ else
+ cnt = facl(fd, cntcmd, 0, NULL);
+
+ if (cnt > 0) {
+ if (aclp == NULL)
+ aclp = malloc(cnt * size);
+ else
+ aclp = realloc(NULL, cnt * size);
+ if (aclp != NULL) {
+ if (path != NULL)
+ cnt = acl(path, cmd, cnt, aclp);
+ else
+ cnt = facl(fd, cmd, cnt, aclp);
+ }
+ } else {
+ if (aclp != NULL) {
+ free(aclp);
+ aclp = NULL;
+ }
+ break;
+ }
+ }
+
+ *aclcnt = cnt;
+ return (aclp);
+}
+
+/*
+ * Check if acl is trivial
+ * This is a FreeBSD acl_is_trivial_np() implementation for Solaris
+ */
+static int
+sun_acl_is_trivial(void *aclp, int aclcnt, mode_t mode, int is_nfs4,
+ int is_dir, int *trivialp)
+{
+#if ARCHIVE_ACL_SUNOS_NFS4
+ int i, p;
+ const uint32_t rperm = ACE_READ_DATA;
+ const uint32_t wperm = ACE_WRITE_DATA | ACE_APPEND_DATA;
+ const uint32_t eperm = ACE_EXECUTE;
+ const uint32_t pubset = ACE_READ_ATTRIBUTES | ACE_READ_NAMED_ATTRS |
+ ACE_READ_ACL | ACE_SYNCHRONIZE;
+ const uint32_t ownset = pubset | ACE_WRITE_ATTRIBUTES |
+ ACE_WRITE_NAMED_ATTRS | ACE_WRITE_ACL | ACE_WRITE_OWNER;
+
+ ace_t *ace;
+ ace_t tace[6];
+#endif
+
+ if (aclp == NULL || trivialp == NULL)
+ return (-1);
+
+ *trivialp = 0;
+
+ /*
+ * POSIX.1e ACLs marked with ACL_IS_TRIVIAL are compatible with
+ * FreeBSD acl_is_trivial_np(). On Solaris they have 4 entries,
+ * including mask.
+ */
+ if (!is_nfs4) {
+ if (aclcnt == 4)
+ *trivialp = 1;
+ return (0);
+ }
+
+#if ARCHIVE_ACL_SUNOS_NFS4
+ /*
+ * Continue with checking NFSv4 ACLs
+ *
+ * Create list of trivial ace's to be compared
+ */
+
+ /* owner@ allow pre */
+ tace[0].a_flags = ACE_OWNER;
+ tace[0].a_type = ACE_ACCESS_ALLOWED_ACE_TYPE;
+ tace[0].a_access_mask = 0;
+
+ /* owner@ deny */
+ tace[1].a_flags = ACE_OWNER;
+ tace[1].a_type = ACE_ACCESS_DENIED_ACE_TYPE;
+ tace[1].a_access_mask = 0;
+
+ /* group@ deny */
+ tace[2].a_flags = ACE_GROUP | ACE_IDENTIFIER_GROUP;
+ tace[2].a_type = ACE_ACCESS_DENIED_ACE_TYPE;
+ tace[2].a_access_mask = 0;
+
+ /* owner@ allow */
+ tace[3].a_flags = ACE_OWNER;
+ tace[3].a_type = ACE_ACCESS_ALLOWED_ACE_TYPE;
+ tace[3].a_access_mask = ownset;
+
+ /* group@ allow */
+ tace[4].a_flags = ACE_GROUP | ACE_IDENTIFIER_GROUP;
+ tace[4].a_type = ACE_ACCESS_ALLOWED_ACE_TYPE;
+ tace[4].a_access_mask = pubset;
+
+ /* everyone@ allow */
+ tace[5].a_flags = ACE_EVERYONE;
+ tace[5].a_type = ACE_ACCESS_ALLOWED_ACE_TYPE;
+ tace[5].a_access_mask = pubset;
+
+ /* Permissions for everyone@ */
+ if (mode & 0004)
+ tace[5].a_access_mask |= rperm;
+ if (mode & 0002)
+ tace[5].a_access_mask |= wperm;
+ if (mode & 0001)
+ tace[5].a_access_mask |= eperm;
+
+ /* Permissions for group@ */
+ if (mode & 0040)
+ tace[4].a_access_mask |= rperm;
+ else if (mode & 0004)
+ tace[2].a_access_mask |= rperm;
+ if (mode & 0020)
+ tace[4].a_access_mask |= wperm;
+ else if (mode & 0002)
+ tace[2].a_access_mask |= wperm;
+ if (mode & 0010)
+ tace[4].a_access_mask |= eperm;
+ else if (mode & 0001)
+ tace[2].a_access_mask |= eperm;
+
+ /* Permissions for owner@ */
+ if (mode & 0400) {
+ tace[3].a_access_mask |= rperm;
+ if (!(mode & 0040) && (mode & 0004))
+ tace[0].a_access_mask |= rperm;
+ } else if ((mode & 0040) || (mode & 0004))
+ tace[1].a_access_mask |= rperm;
+ if (mode & 0200) {
+ tace[3].a_access_mask |= wperm;
+ if (!(mode & 0020) && (mode & 0002))
+ tace[0].a_access_mask |= wperm;
+ } else if ((mode & 0020) || (mode & 0002))
+ tace[1].a_access_mask |= wperm;
+ if (mode & 0100) {
+ tace[3].a_access_mask |= eperm;
+ if (!(mode & 0010) && (mode & 0001))
+ tace[0].a_access_mask |= eperm;
+ } else if ((mode & 0010) || (mode & 0001))
+ tace[1].a_access_mask |= eperm;
+
+ /* Check if the acl count matches */
+ p = 3;
+ for (i = 0; i < 3; i++) {
+ if (tace[i].a_access_mask != 0)
+ p++;
+ }
+ if (aclcnt != p)
+ return (0);
+
+ p = 0;
+ for (i = 0; i < 6; i++) {
+ if (tace[i].a_access_mask != 0) {
+ ace = &((ace_t *)aclp)[p];
+ /*
+ * Illumos added ACE_DELETE_CHILD to write perms for
+ * directories. We have to check against that, too.
+ */
+ if (ace->a_flags != tace[i].a_flags ||
+ ace->a_type != tace[i].a_type ||
+ (ace->a_access_mask != tace[i].a_access_mask &&
+ (!is_dir || (tace[i].a_access_mask & wperm) == 0 ||
+ ace->a_access_mask !=
+ (tace[i].a_access_mask | ACE_DELETE_CHILD))))
+ return (0);
+ p++;
+ }
+ }
+
+ *trivialp = 1;
+#else /* !ARCHIVE_ACL_SUNOS_NFS4 */
+ (void)is_dir; /* UNUSED */
+ (void)aclp; /* UNUSED */
+#endif /* !ARCHIVE_ACL_SUNOS_NFS4 */
+ return (0);
+}
+
+/*
+ * Translate Solaris POSIX.1e and NFSv4 ACLs into libarchive internal ACL
+ */
+static int
+translate_acl(struct archive_read_disk *a,
+ struct archive_entry *entry, void *aclp, int aclcnt,
+ int default_entry_acl_type)
+{
+ int e, i;
+ int ae_id, ae_tag, ae_perm;
+ int entry_acl_type;
+ const char *ae_name;
+ aclent_t *aclent;
+#if ARCHIVE_ACL_SUNOS_NFS4
+ ace_t *ace;
+#endif
+
+ if (aclcnt <= 0)
+ return (ARCHIVE_OK);
+
+ for (e = 0; e < aclcnt; e++) {
+ ae_name = NULL;
+ ae_tag = 0;
+ ae_perm = 0;
+
+#if ARCHIVE_ACL_SUNOS_NFS4
+ if (default_entry_acl_type == ARCHIVE_ENTRY_ACL_TYPE_NFS4) {
+ ace = &((ace_t *)aclp)[e];
+ ae_id = ace->a_who;
+
+ switch(ace->a_type) {
+ case ACE_ACCESS_ALLOWED_ACE_TYPE:
+ entry_acl_type = ARCHIVE_ENTRY_ACL_TYPE_ALLOW;
+ break;
+ case ACE_ACCESS_DENIED_ACE_TYPE:
+ entry_acl_type = ARCHIVE_ENTRY_ACL_TYPE_DENY;
+ break;
+ case ACE_SYSTEM_AUDIT_ACE_TYPE:
+ entry_acl_type = ARCHIVE_ENTRY_ACL_TYPE_ACCESS;
+ break;
+ case ACE_SYSTEM_ALARM_ACE_TYPE:
+ entry_acl_type = ARCHIVE_ENTRY_ACL_TYPE_ALARM;
+ break;
+ default:
+ /* Unknown entry type, skip */
+ continue;
+ }
+
+ if ((ace->a_flags & ACE_OWNER) != 0)
+ ae_tag = ARCHIVE_ENTRY_ACL_USER_OBJ;
+ else if ((ace->a_flags & ACE_GROUP) != 0)
+ ae_tag = ARCHIVE_ENTRY_ACL_GROUP_OBJ;
+ else if ((ace->a_flags & ACE_EVERYONE) != 0)
+ ae_tag = ARCHIVE_ENTRY_ACL_EVERYONE;
+ else if ((ace->a_flags & ACE_IDENTIFIER_GROUP) != 0) {
+ ae_tag = ARCHIVE_ENTRY_ACL_GROUP;
+ ae_name = archive_read_disk_gname(&a->archive,
+ ae_id);
+ } else {
+ ae_tag = ARCHIVE_ENTRY_ACL_USER;
+ ae_name = archive_read_disk_uname(&a->archive,
+ ae_id);
+ }
+
+ for (i = 0; i < acl_nfs4_flag_map_size; ++i) {
+ if ((ace->a_flags &
+ acl_nfs4_flag_map[i].p_perm) != 0)
+ ae_perm |= acl_nfs4_flag_map[i].a_perm;
+ }
+
+ for (i = 0; i < acl_nfs4_perm_map_size; ++i) {
+ if ((ace->a_access_mask &
+ acl_nfs4_perm_map[i].p_perm) != 0)
+ ae_perm |= acl_nfs4_perm_map[i].a_perm;
+ }
+ } else
+#endif /* ARCHIVE_ACL_SUNOS_NFS4 */
+ if (default_entry_acl_type == ARCHIVE_ENTRY_ACL_TYPE_ACCESS) {
+ aclent = &((aclent_t *)aclp)[e];
+ if ((aclent->a_type & ACL_DEFAULT) != 0)
+ entry_acl_type = ARCHIVE_ENTRY_ACL_TYPE_DEFAULT;
+ else
+ entry_acl_type = ARCHIVE_ENTRY_ACL_TYPE_ACCESS;
+ ae_id = aclent->a_id;
+
+ switch(aclent->a_type) {
+ case DEF_USER:
+ case USER:
+ ae_name = archive_read_disk_uname(&a->archive,
+ ae_id);
+ ae_tag = ARCHIVE_ENTRY_ACL_USER;
+ break;
+ case DEF_GROUP:
+ case GROUP:
+ ae_name = archive_read_disk_gname(&a->archive,
+ ae_id);
+ ae_tag = ARCHIVE_ENTRY_ACL_GROUP;
+ break;
+ case DEF_CLASS_OBJ:
+ case CLASS_OBJ:
+ ae_tag = ARCHIVE_ENTRY_ACL_MASK;
+ break;
+ case DEF_USER_OBJ:
+ case USER_OBJ:
+ ae_tag = ARCHIVE_ENTRY_ACL_USER_OBJ;
+ break;
+ case DEF_GROUP_OBJ:
+ case GROUP_OBJ:
+ ae_tag = ARCHIVE_ENTRY_ACL_GROUP_OBJ;
+ break;
+ case DEF_OTHER_OBJ:
+ case OTHER_OBJ:
+ ae_tag = ARCHIVE_ENTRY_ACL_OTHER;
+ break;
+ default:
+ /* Unknown tag type, skip */
+ continue;
+ }
+
+ for (i = 0; i < acl_posix_perm_map_size; ++i) {
+ if ((aclent->a_perm &
+ acl_posix_perm_map[i].p_perm) != 0)
+ ae_perm |= acl_posix_perm_map[i].a_perm;
+ }
+ } else
+ return (ARCHIVE_WARN);
+
+ archive_entry_acl_add_entry(entry, entry_acl_type,
+ ae_perm, ae_tag, ae_id, ae_name);
+ }
+ return (ARCHIVE_OK);
+}
+
+static int
+set_acl(struct archive *a, int fd, const char *name,
+ struct archive_acl *abstract_acl,
+ int ae_requested_type, const char *tname)
+{
+ aclent_t *aclent;
+#if ARCHIVE_ACL_SUNOS_NFS4
+ ace_t *ace;
+#endif
+ int cmd, e, r;
+ void *aclp;
+ int ret;
+ int ae_type, ae_permset, ae_tag, ae_id;
+ int perm_map_size;
+ const acl_perm_map_t *perm_map;
+ uid_t ae_uid;
+ gid_t ae_gid;
+ const char *ae_name;
+ int entries;
+ int i;
+
+ ret = ARCHIVE_OK;
+ entries = archive_acl_reset(abstract_acl, ae_requested_type);
+ if (entries == 0)
+ return (ARCHIVE_OK);
+
+
+ switch (ae_requested_type) {
+ case ARCHIVE_ENTRY_ACL_TYPE_POSIX1E:
+ cmd = SETACL;
+ aclp = malloc(entries * sizeof(aclent_t));
+ break;
+#if ARCHIVE_ACL_SUNOS_NFS4
+ case ARCHIVE_ENTRY_ACL_TYPE_NFS4:
+ cmd = ACE_SETACL;
+ aclp = malloc(entries * sizeof(ace_t));
+
+ break;
+#endif
+ default:
+ errno = ENOENT;
+ archive_set_error(a, errno, "Unsupported ACL type");
+ return (ARCHIVE_FAILED);
+ }
+
+ if (aclp == NULL) {
+ archive_set_error(a, errno,
+ "Can't allocate memory for acl buffer");
+ return (ARCHIVE_FAILED);
+ }
+
+ e = 0;
+
+ while (archive_acl_next(a, abstract_acl, ae_requested_type, &ae_type,
+ &ae_permset, &ae_tag, &ae_id, &ae_name) == ARCHIVE_OK) {
+ aclent = NULL;
+#if ARCHIVE_ACL_SUNOS_NFS4
+ ace = NULL;
+#endif
+ if (cmd == SETACL) {
+ aclent = &((aclent_t *)aclp)[e];
+ aclent->a_id = -1;
+ aclent->a_type = 0;
+ aclent->a_perm = 0;
+ }
+#if ARCHIVE_ACL_SUNOS_NFS4
+ else { /* cmd == ACE_SETACL */
+ ace = &((ace_t *)aclp)[e];
+ ace->a_who = -1;
+ ace->a_access_mask = 0;
+ ace->a_flags = 0;
+ }
+#endif /* ARCHIVE_ACL_SUNOS_NFS4 */
+
+ switch (ae_tag) {
+ case ARCHIVE_ENTRY_ACL_USER:
+ ae_uid = archive_write_disk_uid(a, ae_name, ae_id);
+ if (aclent != NULL) {
+ aclent->a_id = ae_uid;
+ aclent->a_type |= USER;
+ }
+#if ARCHIVE_ACL_SUNOS_NFS4
+ else {
+ ace->a_who = ae_uid;
+ }
+#endif
+ break;
+ case ARCHIVE_ENTRY_ACL_GROUP:
+ ae_gid = archive_write_disk_gid(a, ae_name, ae_id);
+ if (aclent != NULL) {
+ aclent->a_id = ae_gid;
+ aclent->a_type |= GROUP;
+ }
+#if ARCHIVE_ACL_SUNOS_NFS4
+ else {
+ ace->a_who = ae_gid;
+ ace->a_flags |= ACE_IDENTIFIER_GROUP;
+ }
+#endif
+ break;
+ case ARCHIVE_ENTRY_ACL_USER_OBJ:
+ if (aclent != NULL)
+ aclent->a_type |= USER_OBJ;
+#if ARCHIVE_ACL_SUNOS_NFS4
+ else {
+ ace->a_flags |= ACE_OWNER;
+ }
+#endif
+ break;
+ case ARCHIVE_ENTRY_ACL_GROUP_OBJ:
+ if (aclent != NULL)
+ aclent->a_type |= GROUP_OBJ;
+#if ARCHIVE_ACL_SUNOS_NFS4
+ else {
+ ace->a_flags |= ACE_GROUP;
+ ace->a_flags |= ACE_IDENTIFIER_GROUP;
+ }
+#endif
+ break;
+ case ARCHIVE_ENTRY_ACL_MASK:
+ if (aclent != NULL)
+ aclent->a_type |= CLASS_OBJ;
+ break;
+ case ARCHIVE_ENTRY_ACL_OTHER:
+ if (aclent != NULL)
+ aclent->a_type |= OTHER_OBJ;
+ break;
+#if ARCHIVE_ACL_SUNOS_NFS4
+ case ARCHIVE_ENTRY_ACL_EVERYONE:
+ if (ace != NULL)
+ ace->a_flags |= ACE_EVERYONE;
+ break;
+#endif
+ default:
+ archive_set_error(a, ARCHIVE_ERRNO_MISC,
+ "Unsupported ACL tag");
+ ret = ARCHIVE_FAILED;
+ goto exit_free;
+ }
+
+ r = 0;
+ switch (ae_type) {
+#if ARCHIVE_ACL_SUNOS_NFS4
+ case ARCHIVE_ENTRY_ACL_TYPE_ALLOW:
+ if (ace != NULL)
+ ace->a_type = ACE_ACCESS_ALLOWED_ACE_TYPE;
+ else
+ r = -1;
+ break;
+ case ARCHIVE_ENTRY_ACL_TYPE_DENY:
+ if (ace != NULL)
+ ace->a_type = ACE_ACCESS_DENIED_ACE_TYPE;
+ else
+ r = -1;
+ break;
+ case ARCHIVE_ENTRY_ACL_TYPE_AUDIT:
+ if (ace != NULL)
+ ace->a_type = ACE_SYSTEM_AUDIT_ACE_TYPE;
+ else
+ r = -1;
+ break;
+ case ARCHIVE_ENTRY_ACL_TYPE_ALARM:
+ if (ace != NULL)
+ ace->a_type = ACE_SYSTEM_ALARM_ACE_TYPE;
+ else
+ r = -1;
+ break;
+#endif
+ case ARCHIVE_ENTRY_ACL_TYPE_ACCESS:
+ if (aclent == NULL)
+ r = -1;
+ break;
+ case ARCHIVE_ENTRY_ACL_TYPE_DEFAULT:
+ if (aclent != NULL)
+ aclent->a_type |= ACL_DEFAULT;
+ else
+ r = -1;
+ break;
+ default:
+ archive_set_error(a, ARCHIVE_ERRNO_MISC,
+ "Unsupported ACL entry type");
+ ret = ARCHIVE_FAILED;
+ goto exit_free;
+ }
+
+ if (r != 0) {
+ errno = EINVAL;
+ archive_set_error(a, errno,
+ "Failed to set ACL entry type");
+ ret = ARCHIVE_FAILED;
+ goto exit_free;
+ }
+
+#if ARCHIVE_ACL_SUNOS_NFS4
+ if (ae_requested_type == ARCHIVE_ENTRY_ACL_TYPE_NFS4) {
+ perm_map_size = acl_nfs4_perm_map_size;
+ perm_map = acl_nfs4_perm_map;
+ } else {
+#endif
+ perm_map_size = acl_posix_perm_map_size;
+ perm_map = acl_posix_perm_map;
+#if ARCHIVE_ACL_SUNOS_NFS4
+ }
+#endif
+ for (i = 0; i < perm_map_size; ++i) {
+ if (ae_permset & perm_map[i].a_perm) {
+#if ARCHIVE_ACL_SUNOS_NFS4
+ if (ae_requested_type ==
+ ARCHIVE_ENTRY_ACL_TYPE_NFS4)
+ ace->a_access_mask |=
+ perm_map[i].p_perm;
+ else
+#endif
+ aclent->a_perm |= perm_map[i].p_perm;
+ }
+ }
+
+#if ARCHIVE_ACL_SUNOS_NFS4
+ if (ae_requested_type == ARCHIVE_ENTRY_ACL_TYPE_NFS4) {
+ for (i = 0; i < acl_nfs4_flag_map_size; ++i) {
+ if (ae_permset & acl_nfs4_flag_map[i].a_perm) {
+ ace->a_flags |=
+ acl_nfs4_flag_map[i].p_perm;
+ }
+ }
+ }
+#endif
+ e++;
+ }
+
+ /* Try restoring the ACL through 'fd' if we can. */
+ if (fd >= 0) {
+ if (facl(fd, cmd, entries, aclp) == 0)
+ ret = ARCHIVE_OK;
+ else {
+ if (errno == EOPNOTSUPP) {
+ /* Filesystem doesn't support ACLs */
+ ret = ARCHIVE_OK;
+ } else {
+ archive_set_error(a, errno,
+ "Failed to set acl on fd: %s", tname);
+ ret = ARCHIVE_WARN;
+ }
+ }
+ } else if (acl(name, cmd, entries, aclp) != 0) {
+ if (errno == EOPNOTSUPP) {
+ /* Filesystem doesn't support ACLs */
+ ret = ARCHIVE_OK;
+ } else {
+ archive_set_error(a, errno, "Failed to set acl: %s",
+ tname);
+ ret = ARCHIVE_WARN;
+ }
+ }
+exit_free:
+ free(aclp);
+ return (ret);
+}
+
+int
+archive_read_disk_entry_setup_acls(struct archive_read_disk *a,
+ struct archive_entry *entry, int *fd)
+{
+ const char *accpath;
+ void *aclp;
+ int aclcnt;
+ int r;
+
+ accpath = NULL;
+
+ if (*fd < 0) {
+ accpath = archive_read_disk_entry_setup_path(a, entry, fd);
+ if (accpath == NULL)
+ return (ARCHIVE_WARN);
+ }
+
+ archive_entry_acl_clear(entry);
+
+ aclp = NULL;
+
+#if ARCHIVE_ACL_SUNOS_NFS4
+ if (*fd >= 0)
+ aclp = sunacl_get(ACE_GETACL, &aclcnt, *fd, NULL);
+ else if ((!a->follow_symlinks)
+ && (archive_entry_filetype(entry) == AE_IFLNK))
+ /* We can't get the ACL of a symlink, so we assume it can't
+ have one. */
+ aclp = NULL;
+ else
+ aclp = sunacl_get(ACE_GETACL, &aclcnt, 0, accpath);
+
+ if (aclp != NULL && sun_acl_is_trivial(aclp, aclcnt,
+ archive_entry_mode(entry), 1, S_ISDIR(archive_entry_mode(entry)),
+ &r) == 0 && r == 1) {
+ free(aclp);
+ aclp = NULL;
+ return (ARCHIVE_OK);
+ }
+
+ if (aclp != NULL) {
+ r = translate_acl(a, entry, aclp, aclcnt,
+ ARCHIVE_ENTRY_ACL_TYPE_NFS4);
+ free(aclp);
+ aclp = NULL;
+
+ if (r != ARCHIVE_OK) {
+ archive_set_error(&a->archive, errno,
+ "Couldn't translate NFSv4 ACLs");
+ }
+ return (r);
+ }
+#endif /* ARCHIVE_ACL_SUNOS_NFS4 */
+
+ /* Retrieve POSIX.1e ACLs from file. */
+ if (*fd >= 0)
+ aclp = sunacl_get(GETACL, &aclcnt, *fd, NULL);
+ else if ((!a->follow_symlinks)
+ && (archive_entry_filetype(entry) == AE_IFLNK))
+ /* We can't get the ACL of a symlink, so we assume it can't
+ have one. */
+ aclp = NULL;
+ else
+ aclp = sunacl_get(GETACL, &aclcnt, 0, accpath);
+
+ /* Ignore "trivial" ACLs that just mirror the file mode. */
+ if (aclp != NULL && sun_acl_is_trivial(aclp, aclcnt,
+ archive_entry_mode(entry), 0, S_ISDIR(archive_entry_mode(entry)),
+ &r) == 0 && r == 1) {
+ free(aclp);
+ aclp = NULL;
+ }
+
+ if (aclp != NULL)
+ {
+ r = translate_acl(a, entry, aclp, aclcnt,
+ ARCHIVE_ENTRY_ACL_TYPE_ACCESS);
+ free(aclp);
+ aclp = NULL;
+
+ if (r != ARCHIVE_OK) {
+ archive_set_error(&a->archive, errno,
+ "Couldn't translate access ACLs");
+ return (r);
+ }
+ }
+
+ return (ARCHIVE_OK);
+}
+
+int
+archive_write_disk_set_acls(struct archive *a, int fd, const char *name,
+ struct archive_acl *abstract_acl, __LA_MODE_T mode)
+{
+ int ret = ARCHIVE_OK;
+
+ (void)mode; /* UNUSED */
+
+ if ((archive_acl_types(abstract_acl)
+ & ARCHIVE_ENTRY_ACL_TYPE_POSIX1E) != 0) {
+ /* Solaris writes POSIX.1e access and default ACLs together */
+ ret = set_acl(a, fd, name, abstract_acl,
+ ARCHIVE_ENTRY_ACL_TYPE_POSIX1E, "posix1e");
+
+ /* Simultaneous POSIX.1e and NFSv4 is not supported */
+ return (ret);
+ }
+#if ARCHIVE_ACL_SUNOS_NFS4
+ else if ((archive_acl_types(abstract_acl) &
+ ARCHIVE_ENTRY_ACL_TYPE_NFS4) != 0) {
+ ret = set_acl(a, fd, name, abstract_acl,
+ ARCHIVE_ENTRY_ACL_TYPE_NFS4, "nfs4");
+ }
+#endif
+ return (ret);
+}
+#endif /* ARCHIVE_ACL_SUNOS */
Modified: trunk/contrib/libarchive/libarchive/archive_entry.3
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_entry.3 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/archive_entry.3 2018-06-19 20:42:35 UTC (rev 11134)
@@ -25,7 +25,7 @@
.\"
.\" $FreeBSD: stable/11/contrib/libarchive/libarchive/archive_entry.3 299529 2016-05-12 10:16:16Z mm $
.\"
-.Dd Feburary 2, 2012
+.Dd February 2, 2012
.Dt ARCHIVE_ENTRY 3
.Os
.Sh NAME
Modified: trunk/contrib/libarchive/libarchive/archive_entry.c
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_entry.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/archive_entry.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -1,5 +1,6 @@
/*-
* Copyright (c) 2003-2007 Tim Kientzle
+ * Copyright (c) 2016 Martin Matuska
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -248,10 +249,9 @@
{
struct archive_entry *entry;
- entry = (struct archive_entry *)malloc(sizeof(*entry));
+ entry = (struct archive_entry *)calloc(1, sizeof(*entry));
if (entry == NULL)
return (NULL);
- memset(entry, 0, sizeof(*entry));
entry->archive = a;
return (entry);
}
@@ -401,7 +401,7 @@
return (NULL);
}
-int64_t
+la_int64_t
archive_entry_gid(struct archive_entry *entry)
{
return (entry->ae_stat.aest_gid);
@@ -502,7 +502,7 @@
return (archive_mstring_get_mbs_l(&entry->ae_hardlink, p, len, sc));
}
-int64_t
+la_int64_t
archive_entry_ino(struct archive_entry *entry)
{
return (entry->ae_stat.aest_ino);
@@ -514,7 +514,7 @@
return (entry->ae_set & AE_SET_INO);
}
-int64_t
+la_int64_t
archive_entry_ino64(struct archive_entry *entry)
{
return (entry->ae_stat.aest_ino);
@@ -627,7 +627,7 @@
return minor(entry->ae_stat.aest_rdev);
}
-int64_t
+la_int64_t
archive_entry_size(struct archive_entry *entry)
{
return (entry->ae_stat.aest_size);
@@ -715,7 +715,7 @@
return (archive_mstring_get_mbs_l( &entry->ae_symlink, p, len, sc));
}
-int64_t
+la_int64_t
archive_entry_uid(struct archive_entry *entry)
{
return (entry->ae_stat.aest_uid);
@@ -819,7 +819,7 @@
}
void
-archive_entry_set_gid(struct archive_entry *entry, int64_t g)
+archive_entry_set_gid(struct archive_entry *entry, la_int64_t g)
{
entry->stat_valid = 0;
entry->ae_stat.aest_gid = g;
@@ -868,7 +868,7 @@
}
void
-archive_entry_set_ino(struct archive_entry *entry, int64_t ino)
+archive_entry_set_ino(struct archive_entry *entry, la_int64_t ino)
{
entry->stat_valid = 0;
entry->ae_set |= AE_SET_INO;
@@ -876,7 +876,7 @@
}
void
-archive_entry_set_ino64(struct archive_entry *entry, int64_t ino)
+archive_entry_set_ino64(struct archive_entry *entry, la_int64_t ino)
{
entry->stat_valid = 0;
entry->ae_set |= AE_SET_INO;
@@ -1209,7 +1209,7 @@
}
void
-archive_entry_set_size(struct archive_entry *entry, int64_t s)
+archive_entry_set_size(struct archive_entry *entry, la_int64_t s)
{
entry->stat_valid = 0;
entry->ae_stat.aest_size = s;
@@ -1306,7 +1306,7 @@
}
void
-archive_entry_set_uid(struct archive_entry *entry, int64_t u)
+archive_entry_set_uid(struct archive_entry *entry, la_int64_t u)
{
entry->stat_valid = 0;
entry->ae_stat.aest_uid = u;
@@ -1442,6 +1442,15 @@
}
/*
+ * Return a bitmask of ACL types in an archive entry ACL list
+ */
+int
+archive_entry_acl_types(struct archive_entry *entry)
+{
+ return (archive_acl_types(&entry->acl));
+}
+
+/*
* Return a count of entries matching "want_type".
*/
int
@@ -1478,34 +1487,121 @@
}
/*
- * Generate a text version of the ACL. The flags parameter controls
+ * Generate a text version of the ACL. The flags parameter controls
* the style of the generated ACL.
*/
+wchar_t *
+archive_entry_acl_to_text_w(struct archive_entry *entry, ssize_t *len,
+ int flags)
+{
+ return (archive_acl_to_text_w(&entry->acl, len, flags,
+ entry->archive));
+}
+
+char *
+archive_entry_acl_to_text(struct archive_entry *entry, ssize_t *len,
+ int flags)
+{
+ return (archive_acl_to_text_l(&entry->acl, len, flags, NULL));
+}
+
+char *
+_archive_entry_acl_to_text_l(struct archive_entry *entry, ssize_t *len,
+ int flags, struct archive_string_conv *sc)
+{
+ return (archive_acl_to_text_l(&entry->acl, len, flags, sc));
+}
+
+/*
+ * ACL text parser.
+ */
+int
+archive_entry_acl_from_text_w(struct archive_entry *entry,
+ const wchar_t *wtext, int type)
+{
+ return (archive_acl_from_text_w(&entry->acl, wtext, type));
+}
+
+int
+archive_entry_acl_from_text(struct archive_entry *entry,
+ const char *text, int type)
+{
+ return (archive_acl_from_text_l(&entry->acl, text, type, NULL));
+}
+
+int
+_archive_entry_acl_from_text_l(struct archive_entry *entry, const char *text,
+ int type, struct archive_string_conv *sc)
+{
+ return (archive_acl_from_text_l(&entry->acl, text, type, sc));
+}
+
+/* Deprecated */
+static int
+archive_entry_acl_text_compat(int *flags)
+{
+ if ((*flags & ARCHIVE_ENTRY_ACL_TYPE_POSIX1E) == 0)
+ return (1);
+
+ /* ABI compat with old ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID */
+ if ((*flags & OLD_ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID) != 0)
+ *flags |= ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID;
+
+ /* ABI compat with old ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT */
+ if ((*flags & OLD_ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT) != 0)
+ *flags |= ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT;
+
+ *flags |= ARCHIVE_ENTRY_ACL_STYLE_SEPARATOR_COMMA;
+
+ return (0);
+}
+
+/* Deprecated */
const wchar_t *
archive_entry_acl_text_w(struct archive_entry *entry, int flags)
{
- const wchar_t *r;
- r = archive_acl_text_w(entry->archive, &entry->acl, flags);
- if (r == NULL && errno == ENOMEM)
- __archive_errx(1, "No memory");
- return (r);
+ if (entry->acl.acl_text_w != NULL) {
+ free(entry->acl.acl_text_w);
+ entry->acl.acl_text_w = NULL;
+ }
+ if (archive_entry_acl_text_compat(&flags) == 0)
+ entry->acl.acl_text_w = archive_acl_to_text_w(&entry->acl,
+ NULL, flags, entry->archive);
+ return (entry->acl.acl_text_w);
}
+/* Deprecated */
const char *
archive_entry_acl_text(struct archive_entry *entry, int flags)
{
- const char *p;
- if (archive_acl_text_l(&entry->acl, flags, &p, NULL, NULL) != 0
- && errno == ENOMEM)
- __archive_errx(1, "No memory");
- return (p);
+ if (entry->acl.acl_text != NULL) {
+ free(entry->acl.acl_text);
+ entry->acl.acl_text = NULL;
+ }
+ if (archive_entry_acl_text_compat(&flags) == 0)
+ entry->acl.acl_text = archive_acl_to_text_l(&entry->acl, NULL,
+ flags, NULL);
+
+ return (entry->acl.acl_text);
}
+/* Deprecated */
int
_archive_entry_acl_text_l(struct archive_entry *entry, int flags,
const char **acl_text, size_t *len, struct archive_string_conv *sc)
{
- return (archive_acl_text_l(&entry->acl, flags, acl_text, len, sc));
+ if (entry->acl.acl_text != NULL) {
+ free(entry->acl.acl_text);
+ entry->acl.acl_text = NULL;
+ }
+
+ if (archive_entry_acl_text_compat(&flags) == 0)
+ entry->acl.acl_text = archive_acl_to_text_l(&entry->acl,
+ (ssize_t *)len, flags, sc);
+
+ *acl_text = entry->acl.acl_text;
+
+ return (0);
}
/*
@@ -1542,7 +1638,7 @@
* SUCH DAMAGE.
*/
-static struct flag {
+static const struct flag {
const char *name;
const wchar_t *wname;
unsigned long set;
@@ -1553,7 +1649,10 @@
{ "nosappnd", L"nosappnd", SF_APPEND, 0 },
{ "nosappend", L"nosappend", SF_APPEND, 0 },
#endif
-#ifdef EXT2_APPEND_FL /* 'a' */
+#if defined(FS_APPEND_FL) /* 'a' */
+ { "nosappnd", L"nosappnd", FS_APPEND_FL, 0 },
+ { "nosappend", L"nosappend", FS_APPEND_FL, 0 },
+#elif defined(EXT2_APPEND_FL) /* 'a' */
{ "nosappnd", L"nosappnd", EXT2_APPEND_FL, 0 },
{ "nosappend", L"nosappend", EXT2_APPEND_FL, 0 },
#endif
@@ -1566,7 +1665,11 @@
{ "noschange", L"noschange", SF_IMMUTABLE, 0 },
{ "nosimmutable", L"nosimmutable", SF_IMMUTABLE, 0 },
#endif
-#ifdef EXT2_IMMUTABLE_FL /* 'i' */
+#if defined(FS_IMMUTABLE_FL) /* 'i' */
+ { "noschg", L"noschg", FS_IMMUTABLE_FL, 0 },
+ { "noschange", L"noschange", FS_IMMUTABLE_FL, 0 },
+ { "nosimmutable", L"nosimmutable", FS_IMMUTABLE_FL, 0 },
+#elif defined(EXT2_IMMUTABLE_FL) /* 'i' */
{ "noschg", L"noschg", EXT2_IMMUTABLE_FL, 0 },
{ "noschange", L"noschange", EXT2_IMMUTABLE_FL, 0 },
{ "nosimmutable", L"nosimmutable", EXT2_IMMUTABLE_FL, 0 },
@@ -1590,7 +1693,9 @@
#ifdef UF_NODUMP
{ "nodump", L"nodump", 0, UF_NODUMP},
#endif
-#ifdef EXT2_NODUMP_FL /* 'd' */
+#if defined(FS_NODUMP_FL) /* 'd' */
+ { "nodump", L"nodump", 0, FS_NODUMP_FL},
+#elif defined(EXT2_NODUMP_FL) /* 'd' */
{ "nodump", L"nodump", 0, EXT2_NODUMP_FL},
#endif
#ifdef UF_OPAQUE
@@ -1603,65 +1708,127 @@
#ifdef UF_COMPRESSED
{ "nocompressed",L"nocompressed", UF_COMPRESSED, 0 },
#endif
-#ifdef EXT2_UNRM_FL
+#ifdef UF_HIDDEN
+ { "nohidden", L"nohidden", UF_HIDDEN, 0 },
+#endif
+#if defined(FS_UNRM_FL)
+ { "nouunlink", L"nouunlink", FS_UNRM_FL, 0},
+#elif defined(EXT2_UNRM_FL)
{ "nouunlink", L"nouunlink", EXT2_UNRM_FL, 0},
#endif
-#ifdef EXT2_BTREE_FL
+#if defined(FS_BTREE_FL)
+ { "nobtree", L"nobtree", FS_BTREE_FL, 0 },
+#elif defined(EXT2_BTREE_FL)
{ "nobtree", L"nobtree", EXT2_BTREE_FL, 0 },
#endif
-#ifdef EXT2_ECOMPR_FL
+#if defined(FS_ECOMPR_FL)
+ { "nocomperr", L"nocomperr", FS_ECOMPR_FL, 0 },
+#elif defined(EXT2_ECOMPR_FL)
{ "nocomperr", L"nocomperr", EXT2_ECOMPR_FL, 0 },
#endif
-#ifdef EXT2_COMPR_FL /* 'c' */
+#if defined(FS_COMPR_FL) /* 'c' */
+ { "nocompress", L"nocompress", FS_COMPR_FL, 0 },
+#elif defined(EXT2_COMPR_FL) /* 'c' */
{ "nocompress", L"nocompress", EXT2_COMPR_FL, 0 },
#endif
-#ifdef EXT2_NOATIME_FL /* 'A' */
+#if defined(FS_NOATIME_FL) /* 'A' */
+ { "noatime", L"noatime", 0, FS_NOATIME_FL},
+#elif defined(EXT2_NOATIME_FL) /* 'A' */
{ "noatime", L"noatime", 0, EXT2_NOATIME_FL},
#endif
-#ifdef EXT2_DIRTY_FL
+#if defined(FS_DIRTY_FL)
+ { "nocompdirty",L"nocompdirty", FS_DIRTY_FL, 0},
+#elif defined(EXT2_DIRTY_FL)
{ "nocompdirty",L"nocompdirty", EXT2_DIRTY_FL, 0},
#endif
-#ifdef EXT2_COMPRBLK_FL
-#ifdef EXT2_NOCOMPR_FL
+#if defined(FS_COMPRBLK_FL)
+#if defined(FS_NOCOMPR_FL)
+ { "nocomprblk", L"nocomprblk", FS_COMPRBLK_FL, FS_NOCOMPR_FL},
+#else
+ { "nocomprblk", L"nocomprblk", FS_COMPRBLK_FL, 0},
+#endif
+#elif defined(EXT2_COMPRBLK_FL)
+#if defined(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
+#if defined(FS_DIRSYNC_FL)
+ { "nodirsync", L"nodirsync", FS_DIRSYNC_FL, 0},
+#elif defined(EXT2_DIRSYNC_FL)
{ "nodirsync", L"nodirsync", EXT2_DIRSYNC_FL, 0},
#endif
-#ifdef EXT2_INDEX_FL
+#if defined(FS_INDEX_FL)
+ { "nohashidx", L"nohashidx", FS_INDEX_FL, 0},
+#elif defined(EXT2_INDEX_FL)
{ "nohashidx", L"nohashidx", EXT2_INDEX_FL, 0},
#endif
-#ifdef EXT2_IMAGIC_FL
+#if defined(FS_IMAGIC_FL)
+ { "noimagic", L"noimagic", FS_IMAGIC_FL, 0},
+#elif defined(EXT2_IMAGIC_FL)
{ "noimagic", L"noimagic", EXT2_IMAGIC_FL, 0},
#endif
-#ifdef EXT3_JOURNAL_DATA_FL
+#if defined(FS_JOURNAL_DATA_FL)
+ { "nojournal", L"nojournal", FS_JOURNAL_DATA_FL, 0},
+#elif defined(EXT3_JOURNAL_DATA_FL)
{ "nojournal", L"nojournal", EXT3_JOURNAL_DATA_FL, 0},
#endif
-#ifdef EXT2_SECRM_FL
+#if defined(FS_SECRM_FL)
+ { "nosecuredeletion",L"nosecuredeletion",FS_SECRM_FL, 0},
+#elif defined(EXT2_SECRM_FL)
{ "nosecuredeletion",L"nosecuredeletion",EXT2_SECRM_FL, 0},
#endif
-#ifdef EXT2_SYNC_FL
+#if defined(FS_SYNC_FL)
+ { "nosync", L"nosync", FS_SYNC_FL, 0},
+#elif defined(EXT2_SYNC_FL)
{ "nosync", L"nosync", EXT2_SYNC_FL, 0},
#endif
-#ifdef EXT2_NOTAIL_FL
+#if defined(FS_NOTAIL_FL)
+ { "notail", L"notail", 0, FS_NOTAIL_FL},
+#elif defined(EXT2_NOTAIL_FL)
{ "notail", L"notail", 0, EXT2_NOTAIL_FL},
#endif
-#ifdef EXT2_TOPDIR_FL
+#if defined(FS_TOPDIR_FL)
+ { "notopdir", L"notopdir", FS_TOPDIR_FL, 0},
+#elif defined(EXT2_TOPDIR_FL)
{ "notopdir", L"notopdir", EXT2_TOPDIR_FL, 0},
#endif
-#ifdef EXT2_RESERVED_FL
+#ifdef FS_ENCRYPT_FL
+ { "noencrypt", L"noencrypt", FS_ENCRYPT_FL, 0},
+#endif
+#ifdef FS_HUGE_FILE_FL
+ { "nohugefile", L"nohugefile", FS_HUGE_FILE_FL, 0},
+#endif
+#ifdef FS_EXTENT_FL
+ { "noextent", L"noextent", FS_EXTENT_FL, 0},
+#endif
+#ifdef FS_EA_INODE_FL
+ { "noeainode", L"noeainode", FS_EA_INODE_FL, 0},
+#endif
+#ifdef FS_EOFBLOCKS_FL
+ { "noeofblocks",L"noeofblocks", FS_EOFBLOCKS_FL, 0},
+#endif
+#ifdef FS_NOCOW_FL
+ { "nocow", L"nocow", FS_NOCOW_FL, 0},
+#endif
+#ifdef FS_INLINE_DATA_FL
+ { "noinlinedata",L"noinlinedata", FS_INLINE_DATA_FL, 0},
+#endif
+#ifdef FS_PROJINHERIT_FL
+ { "noprojinherit",L"noprojinherit", FS_PROJINHERIT_FL, 0},
+#endif
+#if defined(FS_RESERVED_FL)
+ { "noreserved", L"noreserved", FS_RESERVED_FL, 0},
+#elif defined(EXT2_RESERVED_FL)
{ "noreserved", L"noreserved", EXT2_RESERVED_FL, 0},
#endif
-
{ NULL, NULL, 0, 0 }
};
@@ -1676,7 +1843,7 @@
char *string, *dp;
const char *sp;
unsigned long bits;
- struct flag *flag;
+ const struct flag *flag;
size_t length;
bits = bitset | bitclear;
@@ -1728,7 +1895,7 @@
ae_strtofflags(const char *s, unsigned long *setp, unsigned long *clrp)
{
const char *start, *end;
- struct flag *flag;
+ const struct flag *flag;
unsigned long set, clear;
const char *failed;
@@ -1796,7 +1963,7 @@
ae_wcstofflags(const wchar_t *s, unsigned long *setp, unsigned long *clrp)
{
const wchar_t *start, *end;
- struct flag *flag;
+ const struct flag *flag;
unsigned long set, clear;
const wchar_t *failed;
Modified: trunk/contrib/libarchive/libarchive/archive_entry.h
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_entry.h 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/archive_entry.h 2018-06-19 20:42:35 UTC (rev 11134)
@@ -1,5 +1,6 @@
/*-
* Copyright (c) 2003-2008 Tim Kientzle
+ * Copyright (c) 2016 Martin Matuska
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -29,7 +30,7 @@
#define ARCHIVE_ENTRY_H_INCLUDED
/* Note: Compiler will complain if this does not match archive.h! */
-#define ARCHIVE_VERSION_NUMBER 3002001
+#define ARCHIVE_VERSION_NUMBER 3003002
/*
* Note: archive_entry.h is for use outside of libarchive; the
@@ -65,6 +66,27 @@
# endif
#endif
+/* The la_ssize_t should match the type used in 'struct stat' */
+#if !defined(__LA_SSIZE_T_DEFINED)
+/* Older code relied on the __LA_SSIZE_T macro; after 4.0 we'll switch to the typedef exclusively. */
+# if ARCHIVE_VERSION_NUMBER < 4000000
+#define __LA_SSIZE_T la_ssize_t
+# endif
+#define __LA_SSIZE_T_DEFINED
+# if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__WATCOMC__)
+# if defined(_SSIZE_T_DEFINED) || defined(_SSIZE_T_)
+typedef ssize_t la_ssize_t;
+# elif defined(_WIN64)
+typedef __int64 la_ssize_t;
+# else
+typedef long la_ssize_t;
+# endif
+# else
+# include <unistd.h> /* ssize_t */
+typedef ssize_t la_ssize_t;
+# endif
+#endif
+
/* Get a suitable definition for mode_t */
#if ARCHIVE_VERSION_NUMBER >= 3999000
/* Switch to plain 'int' for libarchive 4.0. It's less broken than 'mode_t' */
@@ -104,6 +126,12 @@
# define __LA_DECL
#endif
+#if defined(__GNUC__) && __GNUC__ >= 3 && __GNUC_MINOR__ >= 1
+# define __LA_DEPRECATED __attribute__((deprecated))
+#else
+# define __LA_DEPRECATED
+#endif
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -420,6 +448,7 @@
/*
* Inheritance values (NFS4 ACLs only); included in permset.
*/
+#define ARCHIVE_ENTRY_ACL_ENTRY_INHERITED 0x01000000
#define ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT 0x02000000
#define ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT 0x04000000
#define ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT 0x08000000
@@ -433,15 +462,16 @@
| ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT \
| ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY \
| ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS \
- | ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS)
+ | ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS \
+ | ARCHIVE_ENTRY_ACL_ENTRY_INHERITED)
/* We need to be able to specify combinations of these. */
-#define ARCHIVE_ENTRY_ACL_TYPE_ACCESS 256 /* POSIX.1e only */
-#define ARCHIVE_ENTRY_ACL_TYPE_DEFAULT 512 /* POSIX.1e only */
-#define ARCHIVE_ENTRY_ACL_TYPE_ALLOW 1024 /* NFS4 only */
-#define ARCHIVE_ENTRY_ACL_TYPE_DENY 2048 /* NFS4 only */
-#define ARCHIVE_ENTRY_ACL_TYPE_AUDIT 4096 /* NFS4 only */
-#define ARCHIVE_ENTRY_ACL_TYPE_ALARM 8192 /* NFS4 only */
+#define ARCHIVE_ENTRY_ACL_TYPE_ACCESS 0x00000100 /* POSIX.1e only */
+#define ARCHIVE_ENTRY_ACL_TYPE_DEFAULT 0x00000200 /* POSIX.1e only */
+#define ARCHIVE_ENTRY_ACL_TYPE_ALLOW 0x00000400 /* NFS4 only */
+#define ARCHIVE_ENTRY_ACL_TYPE_DENY 0x00000800 /* NFS4 only */
+#define ARCHIVE_ENTRY_ACL_TYPE_AUDIT 0x00001000 /* NFS4 only */
+#define ARCHIVE_ENTRY_ACL_TYPE_ALARM 0x00002000 /* NFS4 only */
#define ARCHIVE_ENTRY_ACL_TYPE_POSIX1E (ARCHIVE_ENTRY_ACL_TYPE_ACCESS \
| ARCHIVE_ENTRY_ACL_TYPE_DEFAULT)
#define ARCHIVE_ENTRY_ACL_TYPE_NFS4 (ARCHIVE_ENTRY_ACL_TYPE_ALLOW \
@@ -492,22 +522,52 @@
* Construct a text-format ACL. The flags argument is a bitmask that
* can include any of the following:
*
+ * Flags only for archive entries with POSIX.1e ACL:
* ARCHIVE_ENTRY_ACL_TYPE_ACCESS - Include POSIX.1e "access" entries.
* ARCHIVE_ENTRY_ACL_TYPE_DEFAULT - Include POSIX.1e "default" entries.
- * ARCHIVE_ENTRY_ACL_TYPE_NFS4 - Include NFS4 entries.
+ * ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT - Include "default:" before each
+ * default ACL entry.
+ * ARCHIVE_ENTRY_ACL_STYLE_SOLARIS - Output only one colon after "other" and
+ * "mask" entries.
+ *
+ * Flags only for archive entries with NFSv4 ACL:
+ * ARCHIVE_ENTRY_ACL_STYLE_COMPACT - Do not output the minus character for
+ * unset permissions and flags in NFSv4 ACL permission and flag fields
+ *
+ * Flags for for archive entries with POSIX.1e ACL or NFSv4 ACL:
* ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID - Include extra numeric ID field in
- * each ACL entry. ('star' introduced this for POSIX.1e, this flag
- * also applies to NFS4.)
- * ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT - Include "default:" before each
- * default ACL entry, as used in old Solaris ACLs.
+ * each ACL entry.
+ * ARCHIVE_ENTRY_ACL_STYLE_SEPARATOR_COMMA - Separate entries with comma
+ * instead of newline.
*/
-#define ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID 1024
-#define ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT 2048
+#define ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID 0x00000001
+#define ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT 0x00000002
+#define ARCHIVE_ENTRY_ACL_STYLE_SOLARIS 0x00000004
+#define ARCHIVE_ENTRY_ACL_STYLE_SEPARATOR_COMMA 0x00000008
+#define ARCHIVE_ENTRY_ACL_STYLE_COMPACT 0x00000010
+
+__LA_DECL wchar_t *archive_entry_acl_to_text_w(struct archive_entry *,
+ la_ssize_t * /* len */, int /* flags */);
+__LA_DECL char *archive_entry_acl_to_text(struct archive_entry *,
+ la_ssize_t * /* len */, int /* flags */);
+__LA_DECL int archive_entry_acl_from_text_w(struct archive_entry *,
+ const wchar_t * /* wtext */, int /* type */);
+__LA_DECL int archive_entry_acl_from_text(struct archive_entry *,
+ const char * /* text */, int /* type */);
+
+/* Deprecated constants */
+#define OLD_ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID 1024
+#define OLD_ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT 2048
+
+/* Deprecated functions */
__LA_DECL const wchar_t *archive_entry_acl_text_w(struct archive_entry *,
- int /* flags */);
+ int /* flags */) __LA_DEPRECATED;
__LA_DECL const char *archive_entry_acl_text(struct archive_entry *,
- int /* flags */);
+ int /* flags */) __LA_DEPRECATED;
+/* Return bitmask of ACL types in an archive entry */
+__LA_DECL int archive_entry_acl_types(struct archive_entry *);
+
/* Return a count of entries matching 'want_type' */
__LA_DECL int archive_entry_acl_count(struct archive_entry *, int /* want_type */);
Modified: trunk/contrib/libarchive/libarchive/archive_entry_acl.3
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_entry_acl.3 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/archive_entry_acl.3 2018-06-19 20:42:35 UTC (rev 11134)
@@ -1,4 +1,5 @@
.\" Copyright (c) 2010 Joerg Sonnenberger
+.\" Copyright (c) 2016 Martin Matuska
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
@@ -22,7 +23,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.Dd February 2, 2012
+.Dd February 15, 2017
.Dt ARCHIVE_ENTRY_ACL 3
.Os
.Sh NAME
@@ -30,10 +31,14 @@
.Nm archive_entry_acl_add_entry_w ,
.Nm archive_entry_acl_clear ,
.Nm archive_entry_acl_count ,
+.Nm archive_entry_acl_from_text ,
+.Nm archive_entry_acl_from_text_w ,
.Nm archive_entry_acl_next ,
.Nm archive_entry_acl_next_w ,
.Nm archive_entry_acl_reset ,
-.Nm archive_entry_acl_text_w
+.Nm archive_entry_acl_to_text ,
+.Nm archive_entry_acl_to_text_w ,
+.Nm archive_entry_acl_types
.Nd functions for manipulating Access Control Lists in archive entry descriptions
.Sh LIBRARY
Streaming Archive Library (libarchive, -larchive)
@@ -62,6 +67,18 @@
.Ft int
.Fn archive_entry_acl_count "struct archive_entry *a" "int type"
.Ft int
+.Fo archive_entry_acl_from_text
+.Fa "struct archive_entry *a"
+.Fa "const char *text"
+.Fa "int type"
+.Fc
+.Ft int
+.Fo archive_entry_acl_from_text_w
+.Fa "struct archive_entry *a"
+.Fa "const wchar_t *text"
+.Fa "int type"
+.Fc
+.Ft int
.Fo archive_entry_acl_next
.Fa "struct archive_entry *a"
.Fa "int type"
@@ -83,31 +100,48 @@
.Fc
.Ft int
.Fn archive_entry_acl_reset "struct archive_entry *a" "int type"
-.Ft const wchar_t *
-.Fn archive_entry_acl_text_w "struct archive_entry *a" "int flags"
+.Ft char *
+.Fo archive_entry_acl_to_text
+.Fa "struct archive_entry *a"
+.Fa "ssize_t *len_p"
+.Fa "int flags"
+.Fc
+.Ft wchar_t *
+.Fo archive_entry_acl_to_text_w
+.Fa "struct archive_entry *a"
+.Fa "ssize_t *len_p"
+.Fa "int flags"
+.Fc
+.Ft int
+.Fn archive_entry_acl_types "struct archive_entry *a"
.\" enum?
.Sh DESCRIPTION
-An
-.Dq Access Control List
-is a generalisation of the classic Unix permission system.
+The
+.Dq Access Control Lists (ACLs)
+extend the standard Unix perssion model.
The ACL interface of
.Nm libarchive
-is derived from the POSIX.1e draft, but restricted to simplify dealing
-with practical implementations in various Operating Systems and archive formats.
-.Pp
-An ACL consists of a number of independent entries.
+supports both POSIX.1e and NFSv4 style ACLs. Use of ACLs is restricted by
+various levels of ACL support in operating systems, file systems and archive
+formats.
+.Ss POSIX.1e Access Control Lists
+A POSIX.1e ACL consists of a number of independent entries.
Each entry specifies the permission set as bitmask of basic permissions.
-Valid permissions are:
+Valid permissions in the
+.Fa permset
+are:
.Bl -tag -offset indent -compact -width "ARCHIVE_ENTRY_ACL_EXECUTE"
-.It Dv ARCHIVE_ENTRY_ACL_EXECUTE
-.It Dv ARCHIVE_ENTRY_ACL_WRITE
-.It Dv ARCHIVE_ENTRY_ACL_READ
+.It Dv ARCHIVE_ENTRY_ACL_READ ( Sy r )
+.It Dv ARCHIVE_ENTRY_ACL_WRITE ( Sy w )
+.It Dv ARCHIVE_ENTRY_ACL_EXECUTE ( Sy x )
.El
The permissions correspond to the normal Unix permissions.
.Pp
-The tag specifies the principal to which the permission applies.
+The
+.Fa tag
+specifies the principal to which the permission applies.
Valid values are:
-.Bl -tag -offset indent -compact -width "ARCHIVE_ENTRY_ACL_GROUP_OBJ"
+.Bl -hang -offset indent -compact -width "ARCHIVE_ENTRY_ACL_GROUP_OBJ"
.It Dv ARCHIVE_ENTRY_ACL_USER
The user specified by the name field.
.It Dv ARCHIVE_ENTRY_ACL_USER_OBJ
@@ -119,8 +153,9 @@
.It Dv ARCHIVE_ENTRY_ACL_MASK
The maximum permissions to be obtained via group permissions.
.It Dv ARCHIVE_ENTRY_ACL_OTHER
-Any principal who doesn't have a user or group entry.
+Any principal who is not file owner or a member of the owning group.
.El
+.Pp
The principals
.Dv ARCHIVE_ENTRY_ACL_USER_OBJ ,
.Dv ARCHIVE_ENTRY_ACL_GROUP_OBJ
@@ -129,19 +164,123 @@
are equivalent to user, group and other in the classic Unix permission
model and specify non-extended ACL entries.
.Pp
-All files have an access ACL
+All files with have an access ACL
.Pq Dv ARCHIVE_ENTRY_ACL_TYPE_ACCESS .
This specifies the permissions required for access to the file itself.
Directories have an additional ACL
.Pq Dv ARCHIVE_ENTRY_ACL_TYPE_DEFAULT ,
which controls the initial access ACL for newly created directory entries.
+.Ss NFSv4 Access Control Lists
+A NFSv4 ACL consists of multiple individual entries called Access Control
+Entries (ACEs).
.Pp
+There are four possible types of a NFSv4 ACE:
+.Bl -hang -offset indent -compact -width "ARCHIVE_ENTRY_ACL_TYE_ALLOW"
+.It Dv ARCHIVE_ENTRY_ACL_TYPE_ALLOW
+Allow principal to perform actions requiring given permissions.
+.It Dv ARCHIVE_ENTRY_ACL_TYPE_DENY
+Prevent principal from performing actions requiring given permissions.
+.It Dv ARCHIVE_ENTRY_ACL_TYPE_AUDIT
+Log access attempts by principal which require given permissions.
+.It Dv ARCHIVE_ENTRY_ACL_TYPE_ALARM
+Trigger a system alarm on access attempts by principal which require given
+permissions.
+.El
+.Pp
+The
+.Fa tag
+specifies the principal to which the permission applies.
+Valid values are:
+.Bl -hang -offset indent -compact -width "ARCHIVE_ENTRY_ACL_GROUP_OBJ"
+.It Dv ARCHIVE_ENTRY_ACL_USER
+The user specified by the name field.
+.It Dv ARCHIVE_ENTRY_ACL_USER_OBJ
+The owner of the file.
+.It Dv ARCHIVE_ENTRY_ACL_GROUP
+The group specied by the name field.
+.It Dv ARCHIVE_ENTRY_ACL_GROUP_OBJ
+The group who owns the file.
+.It Dv ARCHIVE_ENTRY_ACL_EVERYONE
+Any principal who is not file owner or a member of the owning group.
+.El
+.Pp
+Entries with the
+.Dv ARCHIVE_ENTRY_ACL_USER
+or
+.Dv ARCHIVE_ENTRY_ACL_GROUP
+tag store the user and group name in the
+.Fa name
+string and optionally the user or group ID in the
+.Fa qualifier
+integer.
+.Pp
+NFSv4 ACE permissions and flags are stored in the same
+.Fa permset
+bitfield. Some permissions share the same constant and permission character but
+have different effect on directories than on files. The following ACE
+permissions are supported:
+.Bl -tag -offset indent -compact -width ARCHIV
+.It Dv ARCHIVE_ENTRY_ACL_READ_DATA ( Sy r )
+Read data (file).
+.It Dv ARCHIVE_ENTRY_ACL_LIST_DIRECTORY ( Sy r )
+List entries (directory).
+.It ARCHIVE_ENTRY_ACL_WRITE_DATA ( Sy w )
+Write data (file).
+.It ARCHIVE_ENTRY_ACL_ADD_FILE ( Sy w )
+Create files (directory).
+.It Dv ARCHIVE_ENTRY_ACL_EXECUTE ( Sy x )
+Execute file or change into a directory.
+.It Dv ARCHIVE_ENTRY_ACL_APPEND_DATA ( Sy p )
+Append data (file).
+.It Dv ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY ( Sy p )
+Create subdirectories (directory).
+.It Dv ARCHIVE_ENTRY_ACL_DELETE_CHILD ( Sy D )
+Remove files and subdirectories inside a directory.
+.It Dv ARCHIVE_ENTRY_ACL_DELETE ( Sy d )
+Remove file or directory.
+.It Dv ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES ( Sy a )
+Read file or directory attributes.
+.It Dv ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES ( Sy A )
+Write file or directory attributes.
+.It Dv ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS ( Sy R )
+Read named file or directory attributes.
+.It Dv ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS ( Sy W )
+Write named file or directory attributes.
+.It Dv ARCHIVE_ENTRY_ACL_READ_ACL ( Sy c )
+Read file or directory ACL.
+.It Dv ARCHIVE_ENTRY_ACL_WRITE_ACL ( Sy C )
+Write file or directory ACL.
+.It Dv ARCHIVE_ENTRY_ACL_WRITE_OWNER ( Sy o )
+Change owner of a file or directory.
+.It Dv ARCHIVE_ENTRY_ACL_SYNCHRONIZE ( Sy s )
+Use synchronous I/O.
+.El
+.Pp
+The following NFSv4 ACL inheritance flags are supported:
+.Bl -tag -offset indent -compact -width ARCHIV
+.It Dv ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT ( Sy f )
+Inherit parent directory ACE to files.
+.It Dv ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT ( Sy d )
+Inherit parent directory ACE to subdirectories.
+.It Dv ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY ( Sy i )
+Only inherit, do not apply the permission on the directory itself.
+.It Dv ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT ( Sy n )
+Do not propagate inherit flags. Only first-level entries inherit ACLs.
+.It Dv ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS ( Sy S )
+Trigger alarm or audit on successful access.
+.It Dv ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS ( Sy F )
+Trigger alarm or audit on failed access.
+.It Dv ARCHIVE_ENTRY_ACL_ENTRY_INHERITED ( Sy I )
+Mark that ACE was inherited.
+.El
+.Ss Functions
.Fn archive_entry_acl_add_entry
and
.Fn archive_entry_acl_add_entry_w
add a single ACL entry.
For the access ACL and non-extended principals, the classic Unix permissions
-are updated.
+are updated. An archive entry cannot contain both POSIX.1e and NFSv4 ACL
+entries.
.Pp
.Fn archive_entry_acl_clear
removes all ACL entries and resets the enumeration pointer.
@@ -150,14 +289,58 @@
counts the ACL entries that have the given type mask.
.Fa type
can be the bitwise-or of
+.Bl -tag -offset indent -compact -width "ARCHIVE_ENTRY_ACL_TYPE_DEFAULT"
+.It Dv ARCHIVE_ENTRY_ACL_TYPE_ACCESS
+.It Dv ARCHIVE_ENTRY_ACL_TYPE_DEFAULT
+.El
+for POSIX.1e ACLs and
+.Bl -tag -offset indent -compact -width "ARCHIVE_ENTRY_ACL_TYPE_ALLOW"
+.It Dv ARCHIVE_ENTRY_ACL_TYPE_ALLOW
+.It Dv ARCHIVE_ENTRY_ACL_TYPE_DENY
+.It Dv ARCHIVE_ENTRY_ACL_TYPE_AUDIT
+.It Dv ARCHIVE_ENTRY_ACL_TYPE_ALARM
+.El
+for NFSv4 ACLs. For POSIX.1e ACLs if
.Dv ARCHIVE_ENTRY_ACL_TYPE_ACCESS
-and
-.Dv ARCHIVE_ENTRY_ACL_TYPE_DEFAULT .
-If
-.Dv ARCHIVE_ENTRY_ACL_TYPE_ACCESS
is included and at least one extended ACL entry is found,
-the three non-extened ACLs are added.
+the three non-extended ACLs are added.
.Pp
+.Fn archive_entry_acl_from_text
+and
+.Fn archive_entry_acl_from_text_w
+add new
+.Pq or merge with existing
+ACL entries from
+.Pq wide
+text. The argument
+.Fa type
+may take one of the following values:
+.Bl -tag -offset indent -compact -width "ARCHIVE_ENTRY_ACL_TYPE_DEFAULT"
+.It Dv ARCHIVE_ENTRY_ACL_TYPE_ACCESS
+.It Dv ARCHIVE_ENTRY_ACL_TYPE_DEFAULT
+.It Dv ARCHIVE_ENTRY_ACL_TYPE_NFS4
+.El
+Supports all formats that can be created with
+.Fn archive_entry_acl_to_text
+or respective
+.Fn archive_entry_acl_to_text_w .
+Existing ACL entries are preserved. To get a clean new ACL from text
+.Fn archive_entry_acl_clear
+must be called first. Entries prefixed with
+.Dq default:
+are treated as
+.Dv ARCHIVE_ENTRY_ACL_TYPE_DEFAULT
+unless
+.Fa type
+is
+.Dv ARCHIVE_ENTRY_ACL_TYPE_NFS4 .
+Invalid entries, non-parseable ACL entries and entries beginning with
+the
+.Sq #
+character
+.Pq comments
+are skipped.
+.Pp
.Fn archive_entry_acl_next
and
.Fn archive_entry_acl_next_w
@@ -179,29 +362,81 @@
Otherwise, the function returns the same value as
.Fn archive_entry_acl_count .
.Pp
-.Fn archive_entry_acl_text_w
-converts the ACL entries for the given type mask into a wide string.
-In addition to the normal type flags,
-.Dv ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID
+.Fn archive_entry_acl_to_text
and
-.Dv ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT
-can be specified to further customize the result.
-The returned long string is valid until the next call to
-.Fn archive_entry_acl_clear ,
-.Fn archive_entry_acl_add_entry ,
-.Fn archive_entry_acl_add_entry_w
+.Fn archive_entry_acl_to_text_w
+convert the ACL entries for the given type into a
+.Pq wide
+string of ACL entries separated by newline. If the pointer
+.Fa len_p
+is not NULL, then the function shall return the length of the string
+.Pq not including the NULL terminator
+in the location pointed to by
+.Fa len_p .
+The
+.Fa flag
+argument is a bitwise-or.
+.Pp
+The following flags are effective only on POSIX.1e ACL:
+.Bl -tag -offset indent -compact -width ARCHIV
+.It Dv ARCHIVE_ENTRY_ACL_TYPE_ACCESS
+Output access ACLs.
+.It Dv ARCHIVE_ENTRY_ACL_TYPE_DEFAULT
+Output POSIX.1e default ACLs.
+.It Dv ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT
+Prefix each default ACL entry with the word
+.Dq default: .
+.It Dv ARCHIVE_ENTRY_ACL_STYLE_SOLARIS
+The mask and other ACLs don not contain a double colon.
+.El
+.Pp
+The following flags are effecive only on NFSv4 ACL:
+.Bl -tag -offset indent -compact -width ARCHIV
+.It Dv ARCHIVE_ENTRY_ACL_STYLE_COMPACT
+Do not output minus characters for unset permissions and flags in NFSv4 ACL
+permission and flag fields.
+.El
+.Pp
+The following flags are effective on both POSIX.1e and NFSv4 ACL:
+.Bl -tag -offset indent -compact -width ARCHIV
+.It Dv ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID
+Add an additional colon-separated field containing the user or group id.
+.It Dv ARCHIVE_ENTRY_ACL_STYLE_SEPARATOR_COMMA
+Separate ACL entries with comma instead of newline.
+.El
+.Pp
+If the archive entry contains NFSv4 ACLs, all types of NFSv4 ACLs are returned.
+It the entry contains POSIX.1e ACLs and none of the flags
+.Dv ARCHIVE_ENTRY_ACL_TYPE_ACCESS
or
-.Fn archive_entry_acl_text_w .
+.Dv ARCHIVE_ENTRY_ACL_TYPE_DEFAULT
+are specified, both access and default entries are returned and default entries
+are prefixed with
+.Dq default: .
+.Pp
+.Fn archive_entry_acl_types
+get ACL entry types contained in an archive entry's ACL. As POSIX.1e and NFSv4
+ACL entries cannot be mixed, this function is a very efficient way to detect if
+an ACL already contains POSIX.1e or NFSv4 ACL entries.
.Sh RETURN VALUES
.Fn archive_entry_acl_count
and
.Fn archive_entry_acl_reset
returns the number of ACL entries that match the given type mask.
-If the type mask includes
+For POSIX.1e ACLS if the type mask includes
.Dv ARCHIVE_ENTRY_ACL_TYPE_ACCESS
and at least one extended ACL entry exists, the three classic Unix
permissions are counted.
.Pp
+.Fn archive_entry_acl_from_text
+and
+.Fn archive_entry_acl_from_text_w
+return
+.Dv ARCHIVE_OK
+if all entries were successfully parsed and
+.Dv ARCHIVE_WARN
+if one or more entries were invalid or non-parseable.
+.Pp
.Fn archive_entry_acl_next
and
.Fn archive_entry_acl_next_w
@@ -216,20 +451,16 @@
.Fn archive_entry_acl_reset
has not been called first.
.Pp
-.Fn archive_entry_text_w
-returns a wide string representation of the ACL entrise matching the
-given type mask.
-The returned long string is valid until the next call to
-.Fn archive_entry_acl_clear ,
-.Fn archive_entry_acl_add_entry ,
-.Fn archive_entry_acl_add_entry_w
-or
-.Fn archive_entry_acl_text_w .
+.Fn archive_entry_acl_to_text
+returns a string representing the ACL entries matching the given type and
+flags on success or NULL on error.
+.Pp
+.Fn archive_entry_acl_to_text_w
+returns a wide string representing the ACL entries matching the given type
+and flags on success or NULL on error.
+.Pp
+.Fn archive_entry_acl_types
+returns a bitmask of ACL entry types or 0 if archive entry has no ACL entries.
.Sh SEE ALSO
-.Xr archive_entry 3
-.Xr libarchive 3 ,
-.Sh BUGS
-.Dv ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID
-and
-.Dv ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT
-are not documented.
+.Xr archive_entry 3 ,
+.Xr libarchive 3
Modified: trunk/contrib/libarchive/libarchive/archive_entry_locale.h
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_entry_locale.h 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/archive_entry_locale.h 2018-06-19 20:42:35 UTC (rev 11134)
@@ -63,9 +63,13 @@
const char **, size_t *, struct archive_string_conv *);
#define archive_entry_acl_text_l _archive_entry_acl_text_l
int _archive_entry_acl_text_l(struct archive_entry *, int,
- const char **, size_t *, struct archive_string_conv *);
-
-
+const char **, size_t *, struct archive_string_conv *) __LA_DEPRECATED;
+#define archive_entry_acl_to_text_l _archive_entry_acl_to_text_l
+char *_archive_entry_acl_to_text_l(struct archive_entry *, ssize_t *, int,
+ struct archive_string_conv *);
+#define archive_entry_acl_from_text_l _archive_entry_acl_from_text_l
+int _archive_entry_acl_from_text_l(struct archive_entry *, const char* text,
+ int type, struct archive_string_conv *);
#define archive_entry_copy_gname_l _archive_entry_copy_gname_l
int _archive_entry_copy_gname_l(struct archive_entry *,
const char *, size_t, struct archive_string_conv *);
Modified: trunk/contrib/libarchive/libarchive/archive_entry_paths.3
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_entry_paths.3 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/archive_entry_paths.3 2018-06-19 20:42:35 UTC (rev 11134)
@@ -31,25 +31,25 @@
.Nm archive_entry_set_hardlink ,
.Nm archive_entry_copy_hardlink ,
.Nm archive_entry_copy_hardlink_w ,
-.Nm archve_entry_update_hardlink_utf8 ,
+.Nm archive_entry_update_hardlink_utf8 ,
.Nm archive_entry_set_link ,
.Nm archive_entry_copy_link ,
.Nm archive_entry_copy_link_w ,
-.Nm archve_entry_update_link_utf8 ,
+.Nm archive_entry_update_link_utf8 ,
.Nm archive_entry_pathname ,
.Nm archive_entry_pathname_w ,
.Nm archive_entry_set_pathname ,
.Nm archive_entry_copy_pathname ,
.Nm archive_entry_copy_pathname_w ,
-.Nm archve_entry_update_pathname_utf8 ,
+.Nm archive_entry_update_pathname_utf8 ,
.Nm archive_entry_sourcepath ,
.Nm archive_entry_copy_sourcepath ,
-.Nm archive_entry_symlink,
-.Nm archive_entry_symlink_w,
+.Nm archive_entry_symlink ,
+.Nm archive_entry_symlink_w ,
.Nm archive_entry_set_symlink ,
.Nm archive_entry_copy_symlink ,
.Nm archive_entry_copy_symlink_w ,
-.Nm archve_entry_update_symlink_utf8
+.Nm archive_entry_update_symlink_utf8
.Nd functions for manipulating path names in archive entry descriptions
.Sh LIBRARY
Streaming Archive Library (libarchive, -larchive)
Modified: trunk/contrib/libarchive/libarchive/archive_entry_perms.3
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_entry_perms.3 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/archive_entry_perms.3 2018-06-19 20:42:35 UTC (rev 11134)
@@ -34,8 +34,8 @@
.Nm archive_entry_perm ,
.Nm archive_entry_set_perm ,
.Nm archive_entry_strmode ,
-.Nm archive_entry_uname
-.Nm archive_entry_uname_w
+.Nm archive_entry_uname ,
+.Nm archive_entry_uname_w ,
.Nm archive_entry_set_uname ,
.Nm archive_entry_copy_uname ,
.Nm archive_entry_copy_uname_w ,
Modified: trunk/contrib/libarchive/libarchive/archive_entry_sparse.c
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_entry_sparse.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/archive_entry_sparse.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -51,7 +51,7 @@
void
archive_entry_sparse_add_entry(struct archive_entry *entry,
- int64_t offset, int64_t length)
+ la_int64_t offset, la_int64_t length)
{
struct ae_sparse *sp;
@@ -135,7 +135,7 @@
int
archive_entry_sparse_next(struct archive_entry * entry,
- int64_t *offset, int64_t *length)
+ la_int64_t *offset, la_int64_t *length)
{
if (entry->sparse_p) {
*offset = entry->sparse_p->offset;
Modified: trunk/contrib/libarchive/libarchive/archive_entry_strmode.c
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_entry_strmode.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/archive_entry_strmode.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -80,7 +80,7 @@
if (mode & 0001) bp[9] = 't';
else bp[9] = 'T';
}
- if (archive_entry_acl_count(entry, ARCHIVE_ENTRY_ACL_TYPE_ACCESS))
+ if (archive_entry_acl_types(entry) != 0)
bp[10] = '+';
return (bp);
Modified: trunk/contrib/libarchive/libarchive/archive_getdate.c
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_getdate.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/archive_getdate.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -691,7 +691,7 @@
time_t Hours, time_t Minutes, time_t Seconds,
time_t Timezone, enum DSTMODE DSTmode)
{
- static int DaysInMonth[12] = {
+ signed char DaysInMonth[12] = {
31, 0, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
};
time_t Julian;
Modified: trunk/contrib/libarchive/libarchive/archive_hmac.c
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_hmac.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/archive_hmac.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -76,6 +76,10 @@
#elif defined(_WIN32) && !defined(__CYGWIN__) && defined(HAVE_BCRYPT_H)
+#ifndef BCRYPT_HASH_REUSABLE_FLAG
+# define BCRYPT_HASH_REUSABLE_FLAG 0x00000020
+#endif
+
static int
__hmac_sha1_init(archive_hmac_sha1_ctx *ctx, const uint8_t *key, size_t key_len)
{
@@ -176,8 +180,10 @@
static int
__hmac_sha1_init(archive_hmac_sha1_ctx *ctx, const uint8_t *key, size_t key_len)
{
- HMAC_CTX_init(ctx);
- HMAC_Init(ctx, key, key_len, EVP_sha1());
+ *ctx = HMAC_CTX_new();
+ if (*ctx == NULL)
+ return -1;
+ HMAC_Init_ex(*ctx, key, key_len, EVP_sha1(), NULL);
return 0;
}
@@ -185,7 +191,7 @@
__hmac_sha1_update(archive_hmac_sha1_ctx *ctx, const uint8_t *data,
size_t data_len)
{
- HMAC_Update(ctx, data, data_len);
+ HMAC_Update(*ctx, data, data_len);
}
static void
@@ -192,7 +198,7 @@
__hmac_sha1_final(archive_hmac_sha1_ctx *ctx, uint8_t *out, size_t *out_len)
{
unsigned int len = (unsigned int)*out_len;
- HMAC_Final(ctx, out, &len);
+ HMAC_Final(*ctx, out, &len);
*out_len = len;
}
@@ -199,8 +205,8 @@
static void
__hmac_sha1_cleanup(archive_hmac_sha1_ctx *ctx)
{
- HMAC_CTX_cleanup(ctx);
- memset(ctx, 0, sizeof(*ctx));
+ HMAC_CTX_free(*ctx);
+ *ctx = NULL;
}
#else
Modified: trunk/contrib/libarchive/libarchive/archive_hmac_private.h
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_hmac_private.h 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/archive_hmac_private.h 2018-06-19 20:42:35 UTC (rev 11134)
@@ -70,9 +70,9 @@
typedef struct hmac_sha1_ctx archive_hmac_sha1_ctx;
#elif defined(HAVE_LIBCRYPTO)
-#include <openssl/hmac.h>
+#include "archive_openssl_hmac_private.h"
-typedef HMAC_CTX archive_hmac_sha1_ctx;
+typedef HMAC_CTX* archive_hmac_sha1_ctx;
#else
Modified: trunk/contrib/libarchive/libarchive/archive_match.c
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_match.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/archive_match.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -471,7 +471,7 @@
}
/*
- * Utilty functions to get statistic information for inclusion patterns.
+ * Utility functions to get statistic information for inclusion patterns.
*/
int
archive_match_path_unmatched_inclusions(struct archive *_a)
@@ -1270,7 +1270,7 @@
#endif /* _WIN32 && !__CYGWIN__ */
/*
- * Call back funtions for archive_rb.
+ * Call back functions for archive_rb.
*/
static int
cmp_node_mbs(const struct archive_rb_node *n1,
@@ -1405,7 +1405,7 @@
&(a->exclusion_tree), pathname);
/*
- * We always overwrite comparison condision.
+ * We always overwrite comparison condition.
* If you do not want to overwrite it, you should not
* call archive_match_exclude_entry(). We cannot know
* what behavior you really expect since overwriting
@@ -1481,7 +1481,7 @@
if (nsec == a->older_ctime_nsec &&
(a->older_ctime_filter & ARCHIVE_MATCH_EQUAL)
== 0)
- return (1); /* Eeual, skip it. */
+ return (1); /* Equal, skip it. */
}
}
if (a->newer_mtime_filter) {
@@ -1513,7 +1513,7 @@
}
}
- /* If there is no excluson list, include the file. */
+ /* If there is no exclusion list, include the file. */
if (a->exclusion_entry_list.count == 0)
return (0);
@@ -1700,7 +1700,7 @@
break;
}
- /* Add oowner id. */
+ /* Add owner id. */
if (i == ids->count)
ids->ids[ids->count++] = id;
else if (ids->ids[i] != id) {
Copied: trunk/contrib/libarchive/libarchive/archive_openssl_evp_private.h (from rev 11133, vendor/libarchive/dist/libarchive/archive_openssl_evp_private.h)
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_openssl_evp_private.h (rev 0)
+++ trunk/contrib/libarchive/libarchive/archive_openssl_evp_private.h 2018-06-19 20:42:35 UTC (rev 11134)
@@ -0,0 +1,48 @@
+/*-
+ * 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.
+ */
+#ifndef ARCHIVE_OPENSSL_EVP_PRIVATE_H_INCLUDED
+#define ARCHIVE_OPENSSL_EVP_PRIVATE_H_INCLUDED
+
+#include <openssl/evp.h>
+#include <openssl/opensslv.h>
+
+#if OPENSSL_VERSION_NUMBER < 0x10100000L
+#include <stdlib.h> /* malloc, free */
+#include <string.h> /* memset */
+static inline EVP_MD_CTX *EVP_MD_CTX_new(void)
+{
+ EVP_MD_CTX *ctx = (EVP_MD_CTX *)calloc(1, sizeof(EVP_MD_CTX));
+ return ctx;
+}
+
+static inline void EVP_MD_CTX_free(EVP_MD_CTX *ctx)
+{
+ EVP_MD_CTX_cleanup(ctx);
+ memset(ctx, 0, sizeof(*ctx));
+ free(ctx);
+}
+#endif
+
+#endif
Copied: trunk/contrib/libarchive/libarchive/archive_openssl_hmac_private.h (from rev 11133, vendor/libarchive/dist/libarchive/archive_openssl_hmac_private.h)
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_openssl_hmac_private.h (rev 0)
+++ trunk/contrib/libarchive/libarchive/archive_openssl_hmac_private.h 2018-06-19 20:42:35 UTC (rev 11134)
@@ -0,0 +1,48 @@
+/*-
+ * 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.
+ */
+#ifndef ARCHIVE_OPENSSL_HMAC_PRIVATE_H_INCLUDED
+#define ARCHIVE_OPENSSL_HMAC_PRIVATE_H_INCLUDED
+
+#include <openssl/hmac.h>
+#include <openssl/opensslv.h>
+
+#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
+#include <stdlib.h> /* malloc, free */
+#include <string.h> /* memset */
+static inline HMAC_CTX *HMAC_CTX_new(void)
+{
+ HMAC_CTX *ctx = (HMAC_CTX *)calloc(1, sizeof(HMAC_CTX));
+ return ctx;
+}
+
+static inline void HMAC_CTX_free(HMAC_CTX *ctx)
+{
+ HMAC_CTX_cleanup(ctx);
+ memset(ctx, 0, sizeof(*ctx));
+ free(ctx);
+}
+#endif
+
+#endif
Modified: trunk/contrib/libarchive/libarchive/archive_options.c
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_options.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/archive_options.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -26,6 +26,10 @@
#include "archive_platform.h"
__FBSDID("$FreeBSD$");
+#ifdef HAVE_ERRNO_H
+#include <errno.h>
+#endif
+
#include "archive_options_private.h"
static const char *
@@ -105,8 +109,11 @@
if (options == NULL || options[0] == '\0')
return ARCHIVE_OK;
- data = (char *)malloc(strlen(options) + 1);
- strcpy(data, options);
+ if ((data = strdup(options)) == NULL) {
+ archive_set_error(a,
+ ENOMEM, "Out of memory adding file to list");
+ return (ARCHIVE_FATAL);
+ }
s = (const char *)data;
do {
Modified: trunk/contrib/libarchive/libarchive/archive_pack_dev.c
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_pack_dev.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/archive_pack_dev.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -280,7 +280,7 @@
/* list of formats and pack functions */
/* this list must be sorted lexically */
-static struct format {
+static const struct format {
const char *name;
pack_t *pack;
} formats[] = {
Modified: trunk/contrib/libarchive/libarchive/archive_platform.h
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_platform.h 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/archive_platform.h 2018-06-19 20:42:35 UTC (rev 11134)
@@ -143,15 +143,6 @@
#endif
/*
- * If this platform has <sys/acl.h>, acl_create(), acl_init(),
- * acl_set_file(), and ACL_USER, we assume it has the rest of the
- * POSIX.1e draft functions used in archive_read_extract.c.
- */
-#if HAVE_SYS_ACL_H && HAVE_ACL_CREATE_ENTRY && HAVE_ACL_INIT && HAVE_ACL_SET_FILE && HAVE_ACL_USER
-#define HAVE_POSIX_ACL 1
-#endif
-
-/*
* If we can't restore metadata using a file descriptor, then
* for compatibility's sake, close files before trying to restore metadata.
*/
Copied: trunk/contrib/libarchive/libarchive/archive_platform_acl.h (from rev 11133, vendor/libarchive/dist/libarchive/archive_platform_acl.h)
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_platform_acl.h (rev 0)
+++ trunk/contrib/libarchive/libarchive/archive_platform_acl.h 2018-06-19 20:42:35 UTC (rev 11134)
@@ -0,0 +1,49 @@
+/*-
+ * Copyright (c) 2017 Martin Matuska
+ * 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$
+ */
+
+/* !!ONLY FOR USE INTERNALLY TO LIBARCHIVE!! */
+
+#ifndef ARCHIVE_PLATFORM_ACL_H_INCLUDED
+#define ARCHIVE_PLATFORM_ACL_H_INCLUDED
+
+/*
+ * Determine what ACL types are supported
+ */
+#if ARCHIVE_ACL_FREEBSD || ARCHIVE_ACL_SUNOS || ARCHIVE_ACL_LIBACL
+#define ARCHIVE_ACL_POSIX1E 1
+#endif
+
+#if ARCHIVE_ACL_FREEBSD_NFS4 || ARCHIVE_ACL_SUNOS_NFS4 || \
+ ARCHIVE_ACL_DARWIN || ARCHIVE_ACL_LIBRICHACL
+#define ARCHIVE_ACL_NFS4 1
+#endif
+
+#if ARCHIVE_ACL_POSIX1E || ARCHIVE_ACL_NFS4
+#define ARCHIVE_ACL_SUPPORT 1
+#endif
+
+#endif /* ARCHIVE_PLATFORM_ACL_H_INCLUDED */
Copied: trunk/contrib/libarchive/libarchive/archive_platform_xattr.h (from rev 11133, vendor/libarchive/dist/libarchive/archive_platform_xattr.h)
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_platform_xattr.h (rev 0)
+++ trunk/contrib/libarchive/libarchive/archive_platform_xattr.h 2018-06-19 20:42:35 UTC (rev 11134)
@@ -0,0 +1,41 @@
+/*-
+ * Copyright (c) 2017 Martin Matuska
+ * 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$
+ */
+
+/* !!ONLY FOR USE INTERNALLY TO LIBARCHIVE!! */
+
+#ifndef ARCHIVE_PLATFORM_XATTR_H_INCLUDED
+#define ARCHIVE_PLATFORM_XATTR_H_INCLUDED
+
+/*
+ * Determine if we support extended attributes
+ */
+#if ARCHIVE_XATTR_LINUX || ARCHIVE_XATTR_DARWIN || ARCHIVE_XATTR_FREEBSD || \
+ ARCHIVE_XATTR_AIX
+#define ARCHIVE_XATTR_SUPPORT 1
+#endif
+
+#endif /* ARCHIVE_PLATFORM_XATTR_H_INCLUDED */
Modified: trunk/contrib/libarchive/libarchive/archive_random.c
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_random.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/archive_random.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -80,7 +80,7 @@
success = CryptAcquireContext(&hProv, NULL, NULL, PROV_RSA_FULL,
CRYPT_VERIFYCONTEXT);
- if (!success && GetLastError() == NTE_BAD_KEYSET) {
+ if (!success && GetLastError() == (DWORD)NTE_BAD_KEYSET) {
success = CryptAcquireContext(&hProv, NULL, NULL,
PROV_RSA_FULL, CRYPT_NEWKEYSET);
}
@@ -221,8 +221,11 @@
/*
* Discard early keystream, as per recommendations in:
* "(Not So) Random Shuffles of RC4" by Ilya Mironov.
+ * As per the Network Operations Division, cryptographic requirements
+ * published on wikileaks on March 2017.
*/
- for (i = 0; i < 1024; i++)
+
+ for (i = 0; i < 3072; i++)
(void)arc4_getbyte();
arc4_count = 1600000;
}
Modified: trunk/contrib/libarchive/libarchive/archive_rb.c
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_rb.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/archive_rb.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -312,7 +312,7 @@
father = RB_FATHER(self);
if (RB_BLACK_P(father)) {
/*
- * If our greatgrandpa is black, we're done.
+ * If our great-grandpa is black, we're done.
*/
return;
}
Modified: trunk/contrib/libarchive/libarchive/archive_read.c
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_read.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/archive_read.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -57,6 +57,7 @@
static int choose_filters(struct archive_read *);
static int choose_format(struct archive_read *);
+static int close_filters(struct archive_read *);
static struct archive_vtable *archive_read_vtable(void);
static int64_t _archive_filter_bytes(struct archive *, int);
static int _archive_filter_code(struct archive *, int);
@@ -528,7 +529,7 @@
{
slot = choose_format(a);
if (slot < 0) {
- __archive_read_close_filters(a);
+ close_filters(a);
a->archive.state = ARCHIVE_STATE_FATAL;
return (ARCHIVE_FATAL);
}
@@ -582,7 +583,6 @@
/* Verify the filter by asking it for some data. */
__archive_read_filter_ahead(a->filter, 1, &avail);
if (avail < 0) {
- __archive_read_close_filters(a);
__archive_read_free_filters(a);
return (ARCHIVE_FATAL);
}
@@ -601,7 +601,6 @@
a->filter = filter;
r = (best_bidder->init)(a->filter);
if (r != ARCHIVE_OK) {
- __archive_read_close_filters(a);
__archive_read_free_filters(a);
return (ARCHIVE_FATAL);
}
@@ -765,7 +764,7 @@
* we cannot say whether there are encrypted entries, then
* ARCHIVE_READ_FORMAT_ENCRYPTION_DONT_KNOW is returned.
* In general, this function will return values below zero when the
- * reader is uncertain or totally uncapable of encryption support.
+ * reader is uncertain or totally incapable of encryption support.
* When this function returns 0 you can be sure that the reader
* supports encryption detection but no encrypted entries have
* been found yet.
@@ -882,7 +881,8 @@
len = a->read_data_remaining;
if (len > s)
len = s;
- memcpy(dest, a->read_data_block, len);
+ if (len)
+ memcpy(dest, a->read_data_block, len);
s -= len;
a->read_data_block += len;
a->read_data_remaining -= len;
@@ -986,8 +986,8 @@
return (a->format->read_data)(a, buff, size, offset);
}
-int
-__archive_read_close_filters(struct archive_read *a)
+static int
+close_filters(struct archive_read *a)
{
struct archive_read_filter *f = a->filter;
int r = ARCHIVE_OK;
@@ -1010,6 +1010,9 @@
void
__archive_read_free_filters(struct archive_read *a)
{
+ /* Make sure filters are closed and their buffers are freed */
+ close_filters(a);
+
while (a->filter != NULL) {
struct archive_read_filter *t = a->filter->upstream;
free(a->filter);
@@ -1052,7 +1055,7 @@
/* TODO: Clean up the formatters. */
/* Release the filter objects. */
- r1 = __archive_read_close_filters(a);
+ r1 = close_filters(a);
if (r1 < r)
r = r1;
Modified: trunk/contrib/libarchive/libarchive/archive_read_append_filter.c
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_read_append_filter.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/archive_read_append_filter.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -133,7 +133,6 @@
a->filter = filter;
r2 = (bidder->init)(a->filter);
if (r2 != ARCHIVE_OK) {
- __archive_read_close_filters(a);
__archive_read_free_filters(a);
return (ARCHIVE_FATAL);
}
@@ -191,7 +190,6 @@
a->filter = filter;
r = (bidder->init)(a->filter);
if (r != ARCHIVE_OK) {
- __archive_read_close_filters(a);
__archive_read_free_filters(a);
return (ARCHIVE_FATAL);
}
Modified: trunk/contrib/libarchive/libarchive/archive_read_disk.3
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_read_disk.3 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/archive_read_disk.3 2018-06-19 20:42:35 UTC (rev 11134)
@@ -24,11 +24,12 @@
.\"
.\" $FreeBSD: stable/11/contrib/libarchive/libarchive/archive_read_disk.3 238856 2012-07-28 06:38:44Z mm $
.\"
-.Dd February 2, 2012
+.Dd April 3, 2017
.Dt ARCHIVE_READ_DISK 3
.Os
.Sh NAME
.Nm archive_read_disk_new ,
+.Nm archive_read_disk_set_behavior ,
.Nm archive_read_disk_set_symlink_logical ,
.Nm archive_read_disk_set_symlink_physical ,
.Nm archive_read_disk_set_symlink_hybrid ,
@@ -37,10 +38,7 @@
.Nm archive_read_disk_uname ,
.Nm archive_read_disk_set_uname_lookup ,
.Nm archive_read_disk_set_gname_lookup ,
-.Nm archive_read_disk_set_standard_lookup ,
-.Nm archive_read_close ,
-.Nm archive_read_finish ,
-.Nm archive_read_free
+.Nm archive_read_disk_set_standard_lookup
.Nd functions for reading objects from disk
.Sh LIBRARY
Streaming Archive Library (libarchive, -larchive)
@@ -49,14 +47,16 @@
.Ft struct archive *
.Fn archive_read_disk_new "void"
.Ft int
+.Fn archive_read_disk_set_behavior "struct archive *" "int"
+.Ft int
.Fn archive_read_disk_set_symlink_logical "struct archive *"
.Ft int
.Fn archive_read_disk_set_symlink_physical "struct archive *"
.Ft int
.Fn archive_read_disk_set_symlink_hybrid "struct archive *"
-.Ft int
+.Ft const char *
.Fn archive_read_disk_gname "struct archive *" "gid_t"
-.Ft int
+.Ft const char *
.Fn archive_read_disk_uname "struct archive *" "uid_t"
.Ft int
.Fo archive_read_disk_set_gname_lookup
@@ -81,12 +81,6 @@
.Fa "int fd"
.Fa "const struct stat *"
.Fc
-.Ft int
-.Fn archive_read_close "struct archive *"
-.Ft int
-.Fn archive_read_finish "struct archive *"
-.Ft int
-.Fn archive_read_free "struct archive *"
.Sh DESCRIPTION
These functions provide an API for reading information about
objects on disk.
@@ -98,6 +92,51 @@
Allocates and initializes a
.Tn struct archive
object suitable for reading object information from disk.
+.It Fn archive_read_disk_set_behavior
+Configures various behavior options when reading entries from disk.
+The flags field consists of a bitwise OR of one or more of the
+following values:
+.Bl -tag -compact -width "indent"
+.It Cm ARCHIVE_READDISK_HONOR_NODUMP
+Skip files and directories with the nodump file attribute (file flag) set.
+By default, the nodump file atrribute is ignored.
+.It Cm ARCHIVE_READDISK_MAC_COPYFILE
+Mac OS X specific. Read metadata (ACLs and extended attributes) with
+.Xr copyfile 3 .
+By default, metadata is read using
+.Xr copyfile 3 .
+.It Cm ARCHIVE_READDISK_NO_ACL
+Do not read Access Control Lists.
+By default, ACLs are read from disk.
+.It Cm ARCHIVE_READDISK_NO_FFLAGS
+Do not read file attributes (file flags).
+By default, file attributes are read from disk.
+See
+.Xr chattr 1
+.Pq Linux
+or
+.Xr chflags 1
+.Pq FreeBSD, Mac OS X
+for more information on file attributes.
+.It Cm ARCHIVE_READDISK_NO_TRAVERSE_MOUNTS
+Do not traverse mount points.
+By defaut, moint points are traversed.
+.It Cm ARCHIVE_READDISK_NO_XATTR
+Do not read extended file attributes (xattrs).
+By default, extended file attributes are read from disk.
+See
+.Xr xattr 7
+.Pq Linux ,
+.Xr xattr 2
+.Pq Mac OS X ,
+or
+.Xr getextattr 8
+.Pq FreeBSD
+for more information on extended file attributes.
+.It Cm ARCHIVE_READDISK_RESTORE_ATIME
+Restore access time of traversed files.
+By default, access time of traversed files is not restored.
+.El
.It Xo
.Fn archive_read_disk_set_symlink_logical ,
.Fn archive_read_disk_set_symlink_physical ,
@@ -181,17 +220,6 @@
This affects the file ownership fields and ACL values in the
.Tn struct archive_entry
object.
-.It Fn archive_read_close
-Does nothing for
-.Tn archive_read_disk
-handles.
-.It Fn archive_read_finish
-This is a deprecated synonym for
-.Fn archive_read_free .
-.It Fn archive_read_free
-Invokes
-.Fn archive_read_close
-if it was not invoked manually, then releases all resources.
.El
More information about the
.Va struct archive
Modified: trunk/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -1,6 +1,7 @@
/*-
* Copyright (c) 2003-2009 Tim Kientzle
* Copyright (c) 2010-2012 Michihiro NAKAJIMA
+ * Copyright (c) 2016 Martin Matuska
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -25,18 +26,14 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: stable/11/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c 306321 2016-09-25 22:02:27Z mm $");
+__FBSDID("$FreeBSD");
/* This is the tree-walking code for POSIX systems. */
#if !defined(_WIN32) || defined(__CYGWIN__)
#ifdef HAVE_SYS_TYPES_H
-/* Mac OSX requires sys/types.h before sys/acl.h. */
#include <sys/types.h>
#endif
-#ifdef HAVE_SYS_ACL_H
-#include <sys/acl.h>
-#endif
#ifdef HAVE_SYS_EXTATTR_H
#include <sys/extattr.h>
#endif
@@ -57,9 +54,6 @@
#ifdef HAVE_SYS_EA_H
#include <sys/ea.h>
#endif
-#ifdef HAVE_ACL_LIBACL_H
-#include <acl/libacl.h>
-#endif
#ifdef HAVE_COPYFILE_H
#include <copyfile.h>
#endif
@@ -107,18 +101,6 @@
#define O_CLOEXEC 0
#endif
-/*
- * Linux and FreeBSD plug this obvious hole in POSIX.1e in
- * different ways.
- */
-#if HAVE_ACL_GET_PERM
-#define ACL_GET_PERM acl_get_perm
-#elif HAVE_ACL_GET_PERM_NP
-#define ACL_GET_PERM acl_get_perm_np
-#endif
-
-static int setup_acls(struct archive_read_disk *,
- struct archive_entry *, int *fd);
static int setup_mac_metadata(struct archive_read_disk *,
struct archive_entry *, int *fd);
static int setup_xattrs(struct archive_read_disk *,
@@ -125,8 +107,51 @@
struct archive_entry *, int *fd);
static int setup_sparse(struct archive_read_disk *,
struct archive_entry *, int *fd);
+#if defined(HAVE_LINUX_FIEMAP_H)
+static int setup_sparse_fiemap(struct archive_read_disk *,
+ struct archive_entry *, int *fd);
+#endif
+#if !ARCHIVE_ACL_SUPPORT
int
+archive_read_disk_entry_setup_acls(struct archive_read_disk *a,
+ struct archive_entry *entry, int *fd)
+{
+ (void)a; /* UNUSED */
+ (void)entry; /* UNUSED */
+ (void)fd; /* UNUSED */
+ return (ARCHIVE_OK);
+}
+#endif
+
+/*
+ * Enter working directory and return working pathname of archive_entry.
+ * If a pointer to an integer is provided and its value is below zero
+ * open a file descriptor on this pahtname.
+ */
+const char *
+archive_read_disk_entry_setup_path(struct archive_read_disk *a,
+ struct archive_entry *entry, int *fd)
+{
+ const char *path;
+
+ path = archive_entry_sourcepath(entry);
+
+ if (path == NULL || (a->tree != NULL &&
+ a->tree_enter_working_dir(a->tree) != 0))
+ path = archive_entry_pathname(entry);
+ if (path == NULL) {
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
+ "Couldn't determine path");
+ } else if (fd != NULL && *fd < 0 && a->tree != NULL &&
+ (a->follow_symlinks || archive_entry_filetype(entry) != AE_IFLNK)) {
+ *fd = a->open_on_current_dir(a->tree, path,
+ O_RDONLY | O_NONBLOCK);
+ }
+ return (path);
+}
+
+int
archive_read_disk_entry_from_file(struct archive *_a,
struct archive_entry *entry,
int fd,
@@ -184,15 +209,17 @@
#ifdef HAVE_STRUCT_STAT_ST_FLAGS
/* On FreeBSD, we get flags for free with the stat. */
/* TODO: Does this belong in copy_stat()? */
- if (st->st_flags != 0)
+ if ((a->flags & ARCHIVE_READDISK_NO_FFLAGS) == 0 && st->st_flags != 0)
archive_entry_set_fflags(entry, st->st_flags, 0);
#endif
-#if defined(EXT2_IOC_GETFLAGS) && defined(HAVE_WORKING_EXT2_IOC_GETFLAGS)
+#if (defined(FS_IOC_GETFLAGS) && defined(HAVE_WORKING_FS_IOC_GETFLAGS)) || \
+ (defined(EXT2_IOC_GETFLAGS) && defined(HAVE_WORKING_EXT2_IOC_GETFLAGS))
/* Linux requires an extra ioctl to pull the flags. Although
* this is an extra step, it has a nice side-effect: We get an
* open file descriptor which we can use in the subsequent lookups. */
- if ((S_ISREG(st->st_mode) || S_ISDIR(st->st_mode))) {
+ if ((a->flags & ARCHIVE_READDISK_NO_FFLAGS) == 0 &&
+ (S_ISREG(st->st_mode) || S_ISDIR(st->st_mode))) {
if (fd < 0) {
if (a->tree != NULL)
fd = a->open_on_current_dir(a->tree, path,
@@ -204,7 +231,13 @@
}
if (fd >= 0) {
int stflags;
- r = ioctl(fd, EXT2_IOC_GETFLAGS, &stflags);
+ r = ioctl(fd,
+#if defined(FS_IOC_GETFLAGS)
+ FS_IOC_GETFLAGS,
+#else
+ EXT2_IOC_GETFLAGS,
+#endif
+ &stflags);
if (r == 0 && stflags != 0)
archive_entry_set_fflags(entry, stflags, 0);
}
@@ -250,13 +283,15 @@
}
#endif /* HAVE_READLINK || HAVE_READLINKAT */
- r = setup_acls(a, entry, &fd);
- if (!a->suppress_xattr) {
+ r = 0;
+ if ((a->flags & ARCHIVE_READDISK_NO_ACL) == 0)
+ r = archive_read_disk_entry_setup_acls(a, entry, &fd);
+ if ((a->flags & ARCHIVE_READDISK_NO_XATTR) == 0) {
r1 = setup_xattrs(a, entry, &fd);
if (r1 < r)
r = r1;
}
- if (a->enable_copyfile) {
+ if (a->flags & ARCHIVE_READDISK_MAC_COPYFILE) {
r1 = setup_mac_metadata(a, entry, &fd);
if (r1 < r)
r = r1;
@@ -299,23 +334,11 @@
struct archive_string tempfile;
(void)fd; /* UNUSED */
- name = archive_entry_sourcepath(entry);
+
+ name = archive_read_disk_entry_setup_path(a, entry, NULL);
if (name == NULL)
- name = archive_entry_pathname(entry);
- if (name == NULL) {
- archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
- "Can't open file to read extended attributes: No name");
return (ARCHIVE_WARN);
- }
- if (a->tree != NULL) {
- if (a->tree_enter_working_dir(a->tree) != 0) {
- archive_set_error(&a->archive, errno,
- "Couldn't change dir");
- return (ARCHIVE_FAILED);
- }
- }
-
/* Short-circuit if there's nothing to do. */
have_attrs = copyfile(name, NULL, 0, copyfile_flags | COPYFILE_CHECK);
if (have_attrs == -1) {
@@ -400,394 +423,10 @@
}
#endif
+#if ARCHIVE_XATTR_LINUX || ARCHIVE_XATTR_DARWIN || ARCHIVE_XATTR_AIX
-#ifdef HAVE_POSIX_ACL
-static int translate_acl(struct archive_read_disk *a,
- struct archive_entry *entry, acl_t acl, int archive_entry_acl_type);
-
-static int
-setup_acls(struct archive_read_disk *a,
- struct archive_entry *entry, int *fd)
-{
- const char *accpath;
- acl_t acl;
- int r;
-
- accpath = archive_entry_sourcepath(entry);
- if (accpath == NULL)
- accpath = archive_entry_pathname(entry);
-
- if (*fd < 0 && a->tree != NULL) {
- if (a->follow_symlinks ||
- archive_entry_filetype(entry) != AE_IFLNK)
- *fd = a->open_on_current_dir(a->tree,
- accpath, O_RDONLY | O_NONBLOCK);
- if (*fd < 0) {
- if (a->tree_enter_working_dir(a->tree) != 0) {
- archive_set_error(&a->archive, errno,
- "Couldn't access %s", accpath);
- return (ARCHIVE_FAILED);
- }
- }
- }
-
- archive_entry_acl_clear(entry);
-
- acl = NULL;
-
-#ifdef ACL_TYPE_NFS4
- /* Try NFS4 ACL first. */
- if (*fd >= 0)
-#if HAVE_ACL_GET_FD_NP
- acl = acl_get_fd_np(*fd, ACL_TYPE_NFS4);
-#else
- acl = acl_get_fd(*fd);
-#endif
-#if HAVE_ACL_GET_LINK_NP
- else if (!a->follow_symlinks)
- acl = acl_get_link_np(accpath, ACL_TYPE_NFS4);
-#else
- else if ((!a->follow_symlinks)
- && (archive_entry_filetype(entry) == AE_IFLNK))
- /* We can't get the ACL of a symlink, so we assume it can't
- have one. */
- acl = NULL;
-#endif
- else
- acl = acl_get_file(accpath, ACL_TYPE_NFS4);
-
-#if HAVE_ACL_IS_TRIVIAL_NP
- if (acl != NULL && acl_is_trivial_np(acl, &r) == 0) {
- /* Ignore "trivial" ACLs that just mirror the file mode. */
- if (r) {
- acl_free(acl);
- acl = NULL;
- /*
- * Simultaneous NFSv4 and POSIX.1e ACLs for the same
- * entry are not allowed, so we should return here
- */
- return (ARCHIVE_OK);
- }
- }
-#endif
- if (acl != NULL) {
- r = translate_acl(a, entry, acl, ARCHIVE_ENTRY_ACL_TYPE_NFS4);
- acl_free(acl);
- if (r != ARCHIVE_OK) {
- archive_set_error(&a->archive, errno,
- "Couldn't translate NFSv4 ACLs: %s", accpath);
- }
- return (r);
- }
-#endif /* ACL_TYPE_NFS4 */
-
- /* Retrieve access ACL from file. */
- if (*fd >= 0)
- acl = acl_get_fd(*fd);
-#if HAVE_ACL_GET_LINK_NP
- else if (!a->follow_symlinks)
- acl = acl_get_link_np(accpath, ACL_TYPE_ACCESS);
-#else
- else if ((!a->follow_symlinks)
- && (archive_entry_filetype(entry) == AE_IFLNK))
- /* We can't get the ACL of a symlink, so we assume it can't
- have one. */
- acl = NULL;
-#endif
- else
- acl = acl_get_file(accpath, ACL_TYPE_ACCESS);
-
-#if HAVE_ACL_IS_TRIVIAL_NP
- /* Ignore "trivial" ACLs that just mirror the file mode. */
- if (acl != NULL && acl_is_trivial_np(acl, &r) == 0) {
- if (r) {
- acl_free(acl);
- acl = NULL;
- }
- }
-#endif
-
- if (acl != NULL) {
- r = translate_acl(a, entry, acl,
- ARCHIVE_ENTRY_ACL_TYPE_ACCESS);
- acl_free(acl);
- acl = NULL;
- if (r != ARCHIVE_OK) {
- archive_set_error(&a->archive, errno,
- "Couldn't translate access ACLs: %s", accpath);
- return (r);
- }
- }
-
- /* Only directories can have default ACLs. */
- if (S_ISDIR(archive_entry_mode(entry))) {
- acl = acl_get_file(accpath, ACL_TYPE_DEFAULT);
- if (acl != NULL) {
- r = translate_acl(a, entry, acl,
- ARCHIVE_ENTRY_ACL_TYPE_DEFAULT);
- acl_free(acl);
- if (r != ARCHIVE_OK) {
- archive_set_error(&a->archive, errno,
- "Couldn't translate default ACLs: %s",
- accpath);
- return (r);
- }
- }
- }
- return (ARCHIVE_OK);
-}
-
/*
- * Translate system ACL into libarchive internal structure.
- */
-
-static struct {
- int archive_perm;
- int platform_perm;
-} acl_perm_map[] = {
- {ARCHIVE_ENTRY_ACL_EXECUTE, ACL_EXECUTE},
- {ARCHIVE_ENTRY_ACL_WRITE, ACL_WRITE},
- {ARCHIVE_ENTRY_ACL_READ, ACL_READ},
-#ifdef ACL_TYPE_NFS4
- {ARCHIVE_ENTRY_ACL_READ_DATA, ACL_READ_DATA},
- {ARCHIVE_ENTRY_ACL_LIST_DIRECTORY, ACL_LIST_DIRECTORY},
- {ARCHIVE_ENTRY_ACL_WRITE_DATA, ACL_WRITE_DATA},
- {ARCHIVE_ENTRY_ACL_ADD_FILE, ACL_ADD_FILE},
- {ARCHIVE_ENTRY_ACL_APPEND_DATA, ACL_APPEND_DATA},
- {ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY, ACL_ADD_SUBDIRECTORY},
- {ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS, ACL_READ_NAMED_ATTRS},
- {ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS, ACL_WRITE_NAMED_ATTRS},
- {ARCHIVE_ENTRY_ACL_DELETE_CHILD, ACL_DELETE_CHILD},
- {ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES, ACL_READ_ATTRIBUTES},
- {ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES, ACL_WRITE_ATTRIBUTES},
- {ARCHIVE_ENTRY_ACL_DELETE, ACL_DELETE},
- {ARCHIVE_ENTRY_ACL_READ_ACL, ACL_READ_ACL},
- {ARCHIVE_ENTRY_ACL_WRITE_ACL, ACL_WRITE_ACL},
- {ARCHIVE_ENTRY_ACL_WRITE_OWNER, ACL_WRITE_OWNER},
- {ARCHIVE_ENTRY_ACL_SYNCHRONIZE, ACL_SYNCHRONIZE}
-#endif
-};
-
-#ifdef ACL_TYPE_NFS4
-static struct {
- int archive_inherit;
- int platform_inherit;
-} acl_inherit_map[] = {
- {ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT, ACL_ENTRY_FILE_INHERIT},
- {ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT, ACL_ENTRY_DIRECTORY_INHERIT},
- {ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT, ACL_ENTRY_NO_PROPAGATE_INHERIT},
- {ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY, ACL_ENTRY_INHERIT_ONLY}
-};
-#endif
-static int
-translate_acl(struct archive_read_disk *a,
- struct archive_entry *entry, acl_t acl, int default_entry_acl_type)
-{
- acl_tag_t acl_tag;
-#ifdef ACL_TYPE_NFS4
- acl_entry_type_t acl_type;
- acl_flagset_t acl_flagset;
- int brand;
-#endif
- acl_entry_t acl_entry;
- acl_permset_t acl_permset;
- int i, entry_acl_type;
- int r, s, ae_id, ae_tag, ae_perm;
- const char *ae_name;
-
-#ifdef ACL_TYPE_NFS4
- // FreeBSD "brands" ACLs as POSIX.1e or NFSv4
- // Make sure the "brand" on this ACL is consistent
- // with the default_entry_acl_type bits provided.
- if (acl_get_brand_np(acl, &brand) != 0) {
- archive_set_error(&a->archive, errno,
- "Failed to read ACL brand");
- return (ARCHIVE_WARN);
- }
- switch (brand) {
- case ACL_BRAND_POSIX:
- switch (default_entry_acl_type) {
- case ARCHIVE_ENTRY_ACL_TYPE_ACCESS:
- case ARCHIVE_ENTRY_ACL_TYPE_DEFAULT:
- break;
- default:
- archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
- "Invalid ACL entry type for POSIX.1e ACL");
- return (ARCHIVE_WARN);
- }
- break;
- case ACL_BRAND_NFS4:
- if (default_entry_acl_type & ~ARCHIVE_ENTRY_ACL_TYPE_NFS4) {
- archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
- "Invalid ACL entry type for NFSv4 ACL");
- return (ARCHIVE_WARN);
- }
- break;
- default:
- archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
- "Unknown ACL brand");
- return (ARCHIVE_WARN);
- break;
- }
-#endif
-
-
- s = acl_get_entry(acl, ACL_FIRST_ENTRY, &acl_entry);
- if (s == -1) {
- archive_set_error(&a->archive, errno,
- "Failed to get first ACL entry");
- return (ARCHIVE_WARN);
- }
- while (s == 1) {
- ae_id = -1;
- ae_name = NULL;
- ae_perm = 0;
-
- if (acl_get_tag_type(acl_entry, &acl_tag) != 0) {
- archive_set_error(&a->archive, errno,
- "Failed to get ACL tag type");
- return (ARCHIVE_WARN);
- }
- switch (acl_tag) {
- case ACL_USER:
- ae_id = (int)*(uid_t *)acl_get_qualifier(acl_entry);
- ae_name = archive_read_disk_uname(&a->archive, ae_id);
- ae_tag = ARCHIVE_ENTRY_ACL_USER;
- break;
- case ACL_GROUP:
- ae_id = (int)*(gid_t *)acl_get_qualifier(acl_entry);
- ae_name = archive_read_disk_gname(&a->archive, ae_id);
- ae_tag = ARCHIVE_ENTRY_ACL_GROUP;
- break;
- case ACL_MASK:
- ae_tag = ARCHIVE_ENTRY_ACL_MASK;
- break;
- case ACL_USER_OBJ:
- ae_tag = ARCHIVE_ENTRY_ACL_USER_OBJ;
- break;
- case ACL_GROUP_OBJ:
- ae_tag = ARCHIVE_ENTRY_ACL_GROUP_OBJ;
- break;
- case ACL_OTHER:
- ae_tag = ARCHIVE_ENTRY_ACL_OTHER;
- break;
-#ifdef ACL_TYPE_NFS4
- case ACL_EVERYONE:
- ae_tag = ARCHIVE_ENTRY_ACL_EVERYONE;
- break;
-#endif
- default:
- /* Skip types that libarchive can't support. */
- s = acl_get_entry(acl, ACL_NEXT_ENTRY, &acl_entry);
- continue;
- }
-
- // XXX acl_type maps to allow/deny/audit/YYYY bits
- entry_acl_type = default_entry_acl_type;
-#ifdef ACL_TYPE_NFS4
- if (default_entry_acl_type & ARCHIVE_ENTRY_ACL_TYPE_NFS4) {
- /*
- * acl_get_entry_type_np() falis with non-NFSv4 ACLs
- */
- if (acl_get_entry_type_np(acl_entry, &acl_type) != 0) {
- archive_set_error(&a->archive, errno, "Failed "
- "to get ACL type from a NFSv4 ACL entry");
- return (ARCHIVE_WARN);
- }
- switch (acl_type) {
- case ACL_ENTRY_TYPE_ALLOW:
- entry_acl_type = ARCHIVE_ENTRY_ACL_TYPE_ALLOW;
- break;
- case ACL_ENTRY_TYPE_DENY:
- entry_acl_type = ARCHIVE_ENTRY_ACL_TYPE_DENY;
- break;
- case ACL_ENTRY_TYPE_AUDIT:
- entry_acl_type = ARCHIVE_ENTRY_ACL_TYPE_AUDIT;
- break;
- case ACL_ENTRY_TYPE_ALARM:
- entry_acl_type = ARCHIVE_ENTRY_ACL_TYPE_ALARM;
- break;
- default:
- archive_set_error(&a->archive, errno,
- "Invalid NFSv4 ACL entry type");
- return (ARCHIVE_WARN);
- }
-
- /*
- * Libarchive stores "flag" (NFSv4 inheritance bits)
- * in the ae_perm bitmap.
- *
- * acl_get_flagset_np() fails with non-NFSv4 ACLs
- */
- if (acl_get_flagset_np(acl_entry, &acl_flagset) != 0) {
- archive_set_error(&a->archive, errno,
- "Failed to get flagset from a NFSv4 ACL entry");
- return (ARCHIVE_WARN);
- }
- for (i = 0; i < (int)(sizeof(acl_inherit_map) / sizeof(acl_inherit_map[0])); ++i) {
- r = acl_get_flag_np(acl_flagset,
- acl_inherit_map[i].platform_inherit);
- if (r == -1) {
- archive_set_error(&a->archive, errno,
- "Failed to check flag in a NFSv4 "
- "ACL flagset");
- return (ARCHIVE_WARN);
- } else if (r)
- ae_perm |= acl_inherit_map[i].archive_inherit;
- }
- }
-#endif
-
- if (acl_get_permset(acl_entry, &acl_permset) != 0) {
- archive_set_error(&a->archive, errno,
- "Failed to get ACL permission set");
- return (ARCHIVE_WARN);
- }
- for (i = 0; i < (int)(sizeof(acl_perm_map) / sizeof(acl_perm_map[0])); ++i) {
- /*
- * acl_get_perm() is spelled differently on different
- * platforms; see above.
- */
- r = ACL_GET_PERM(acl_permset, acl_perm_map[i].platform_perm);
- if (r == -1) {
- archive_set_error(&a->archive, errno,
- "Failed to check permission in an ACL permission set");
- return (ARCHIVE_WARN);
- } else if (r)
- ae_perm |= acl_perm_map[i].archive_perm;
- }
-
- archive_entry_acl_add_entry(entry, entry_acl_type,
- ae_perm, ae_tag,
- ae_id, ae_name);
-
- s = acl_get_entry(acl, ACL_NEXT_ENTRY, &acl_entry);
- if (s == -1) {
- archive_set_error(&a->archive, errno,
- "Failed to get next ACL entry");
- return (ARCHIVE_WARN);
- }
- }
- return (ARCHIVE_OK);
-}
-#else
-static int
-setup_acls(struct archive_read_disk *a,
- struct archive_entry *entry, int *fd)
-{
- (void)a; /* UNUSED */
- (void)entry; /* UNUSED */
- (void)fd; /* UNUSED */
- return (ARCHIVE_OK);
-}
-#endif
-
-#if (HAVE_FGETXATTR && HAVE_FLISTXATTR && HAVE_LISTXATTR && \
- HAVE_LLISTXATTR && HAVE_GETXATTR && HAVE_LGETXATTR) || \
- (HAVE_FGETEA && HAVE_FLISTEA && HAVE_LISTEA)
-
-/*
- * Linux and AIX extended attribute support.
+ * Linux, Darwin and AIX extended attribute support.
*
* TODO: By using a stack-allocated buffer for the first
* call to getxattr(), we might be able to avoid the second
@@ -800,31 +439,37 @@
static int
setup_xattr(struct archive_read_disk *a,
- struct archive_entry *entry, const char *name, int fd)
+ struct archive_entry *entry, const char *name, int fd, const char *accpath)
{
ssize_t size;
void *value = NULL;
- const char *accpath;
- accpath = archive_entry_sourcepath(entry);
- if (accpath == NULL)
- accpath = archive_entry_pathname(entry);
-#if HAVE_FGETXATTR
- if (fd >= 0)
+ if (fd >= 0) {
+#if ARCHIVE_XATTR_LINUX
size = fgetxattr(fd, name, NULL, 0);
- else if (!a->follow_symlinks)
+#elif ARCHIVE_XATTR_DARWIN
+ size = fgetxattr(fd, name, NULL, 0, 0, 0);
+#elif ARCHIVE_XATTR_AIX
+ size = fgetea(fd, name, NULL, 0);
+#endif
+ } else if (!a->follow_symlinks) {
+#if ARCHIVE_XATTR_LINUX
size = lgetxattr(accpath, name, NULL, 0);
- else
+#elif ARCHIVE_XATTR_DARWIN
+ size = getxattr(accpath, name, NULL, 0, 0, XATTR_NOFOLLOW);
+#elif ARCHIVE_XATTR_AIX
+ size = lgetea(accpath, name, NULL, 0);
+#endif
+ } else {
+#if ARCHIVE_XATTR_LINUX
size = getxattr(accpath, name, NULL, 0);
-#elif HAVE_FGETEA
- if (fd >= 0)
- size = fgetea(fd, name, NULL, 0);
- else if (!a->follow_symlinks)
- size = lgetea(accpath, name, NULL, 0);
- else
+#elif ARCHIVE_XATTR_DARWIN
+ size = getxattr(accpath, name, NULL, 0, 0, 0);
+#elif ARCHIVE_XATTR_AIX
size = getea(accpath, name, NULL, 0);
#endif
+ }
if (size == -1) {
archive_set_error(&a->archive, errno,
@@ -837,21 +482,32 @@
return (ARCHIVE_FATAL);
}
-#if HAVE_FGETXATTR
- if (fd >= 0)
+
+ if (fd >= 0) {
+#if ARCHIVE_XATTR_LINUX
size = fgetxattr(fd, name, value, size);
- else if (!a->follow_symlinks)
+#elif ARCHIVE_XATTR_DARWIN
+ size = fgetxattr(fd, name, value, size, 0, 0);
+#elif ARCHIVE_XATTR_AIX
+ size = fgetea(fd, name, value, size);
+#endif
+ } else if (!a->follow_symlinks) {
+#if ARCHIVE_XATTR_LINUX
size = lgetxattr(accpath, name, value, size);
- else
+#elif ARCHIVE_XATTR_DARWIN
+ size = getxattr(accpath, name, value, size, 0, XATTR_NOFOLLOW);
+#elif ARCHIVE_XATTR_AIX
+ size = lgetea(accpath, name, value, size);
+#endif
+ } else {
+#if ARCHIVE_XATTR_LINUX
size = getxattr(accpath, name, value, size);
-#elif HAVE_FGETEA
- if (fd >= 0)
- size = fgetea(fd, name, value, size);
- else if (!a->follow_symlinks)
- size = lgetea(accpath, name, value, size);
- else
+#elif ARCHIVE_XATTR_DARWIN
+ size = getxattr(accpath, name, value, size, 0, 0);
+#elif ARCHIVE_XATTR_AIX
size = getea(accpath, name, value, size);
#endif
+ }
if (size == -1) {
archive_set_error(&a->archive, errno,
@@ -873,39 +529,39 @@
const char *path;
ssize_t list_size;
- path = archive_entry_sourcepath(entry);
- if (path == NULL)
- path = archive_entry_pathname(entry);
+ path = NULL;
- if (*fd < 0 && a->tree != NULL) {
- if (a->follow_symlinks ||
- archive_entry_filetype(entry) != AE_IFLNK)
- *fd = a->open_on_current_dir(a->tree, path,
- O_RDONLY | O_NONBLOCK);
- if (*fd < 0) {
- if (a->tree_enter_working_dir(a->tree) != 0) {
- archive_set_error(&a->archive, errno,
- "Couldn't access %s", path);
- return (ARCHIVE_FAILED);
- }
- }
+ if (*fd < 0) {
+ path = archive_read_disk_entry_setup_path(a, entry, fd);
+ if (path == NULL)
+ return (ARCHIVE_WARN);
}
-#if HAVE_FLISTXATTR
- if (*fd >= 0)
+ if (*fd >= 0) {
+#if ARCHIVE_XATTR_LINUX
list_size = flistxattr(*fd, NULL, 0);
- else if (!a->follow_symlinks)
+#elif ARCHIVE_XATTR_DARWIN
+ list_size = flistxattr(*fd, NULL, 0, 0);
+#elif ARCHIVE_XATTR_AIX
+ list_size = flistea(*fd, NULL, 0);
+#endif
+ } else if (!a->follow_symlinks) {
+#if ARCHIVE_XATTR_LINUX
list_size = llistxattr(path, NULL, 0);
- else
+#elif ARCHIVE_XATTR_DARWIN
+ list_size = listxattr(path, NULL, 0, XATTR_NOFOLLOW);
+#elif ARCHIVE_XATTR_AIX
+ list_size = llistea(path, NULL, 0);
+#endif
+ } else {
+#if ARCHIVE_XATTR_LINUX
list_size = listxattr(path, NULL, 0);
-#elif HAVE_FLISTEA
- if (*fd >= 0)
- list_size = flistea(*fd, NULL, 0);
- else if (!a->follow_symlinks)
- list_size = llistea(path, NULL, 0);
- else
+#elif ARCHIVE_XATTR_DARWIN
+ list_size = listxattr(path, NULL, 0, 0);
+#elif ARCHIVE_XATTR_AIX
list_size = listea(path, NULL, 0);
#endif
+ }
if (list_size == -1) {
if (errno == ENOTSUP || errno == ENOSYS)
@@ -923,21 +579,31 @@
return (ARCHIVE_FATAL);
}
-#if HAVE_FLISTXATTR
- if (*fd >= 0)
+ if (*fd >= 0) {
+#if ARCHIVE_XATTR_LINUX
list_size = flistxattr(*fd, list, list_size);
- else if (!a->follow_symlinks)
+#elif ARCHIVE_XATTR_DARWIN
+ list_size = flistxattr(*fd, list, list_size, 0);
+#elif ARCHIVE_XATTR_AIX
+ list_size = flistea(*fd, list, list_size);
+#endif
+ } else if (!a->follow_symlinks) {
+#if ARCHIVE_XATTR_LINUX
list_size = llistxattr(path, list, list_size);
- else
+#elif ARCHIVE_XATTR_DARWIN
+ list_size = listxattr(path, list, list_size, XATTR_NOFOLLOW);
+#elif ARCHIVE_XATTR_AIX
+ list_size = llistea(path, list, list_size);
+#endif
+ } else {
+#if ARCHIVE_XATTR_LINUX
list_size = listxattr(path, list, list_size);
-#elif HAVE_FLISTEA
- if (*fd >= 0)
- list_size = flistea(*fd, list, list_size);
- else if (!a->follow_symlinks)
- list_size = llistea(path, list, list_size);
- else
+#elif ARCHIVE_XATTR_DARWIN
+ list_size = listxattr(path, list, list_size, 0);
+#elif ARCHIVE_XATTR_AIX
list_size = listea(path, list, list_size);
#endif
+ }
if (list_size == -1) {
archive_set_error(&a->archive, errno,
@@ -947,10 +613,22 @@
}
for (p = list; (p - list) < list_size; p += strlen(p) + 1) {
- if (strncmp(p, "system.", 7) == 0 ||
- strncmp(p, "xfsroot.", 8) == 0)
+#if ARCHIVE_XATTR_LINUX
+ /* Linux: skip POSIX.1e ACL extended attributes */
+ if (strncmp(p, "system.", 7) == 0 &&
+ (strcmp(p + 7, "posix_acl_access") == 0 ||
+ strcmp(p + 7, "posix_acl_default") == 0))
continue;
- setup_xattr(a, entry, p, *fd);
+ if (strncmp(p, "trusted.SGI_", 12) == 0 &&
+ (strcmp(p + 12, "ACL_DEFAULT") == 0 ||
+ strcmp(p + 12, "ACL_FILE") == 0))
+ continue;
+
+ /* Linux: xfsroot namespace is obsolete and unsupported */
+ if (strncmp(p, "xfsroot.", 8) == 0)
+ continue;
+#endif
+ setup_xattr(a, entry, p, *fd, path);
}
free(list);
@@ -957,8 +635,7 @@
return (ARCHIVE_OK);
}
-#elif HAVE_EXTATTR_GET_FILE && HAVE_EXTATTR_LIST_FILE && \
- HAVE_DECL_EXTATTR_NAMESPACE_USER
+#elif ARCHIVE_XATTR_FREEBSD
/*
* FreeBSD extattr interface.
@@ -971,20 +648,17 @@
*/
static int
setup_xattr(struct archive_read_disk *a, struct archive_entry *entry,
- int namespace, const char *name, const char *fullname, int fd);
+ int namespace, const char *name, const char *fullname, int fd,
+ const char *path);
static int
setup_xattr(struct archive_read_disk *a, struct archive_entry *entry,
- int namespace, const char *name, const char *fullname, int fd)
+ int namespace, const char *name, const char *fullname, int fd,
+ const char *accpath)
{
ssize_t size;
void *value = NULL;
- const char *accpath;
- accpath = archive_entry_sourcepath(entry);
- if (accpath == NULL)
- accpath = archive_entry_pathname(entry);
-
if (fd >= 0)
size = extattr_get_fd(fd, namespace, name, NULL, 0);
else if (!a->follow_symlinks)
@@ -1033,22 +707,12 @@
const char *path;
int namespace = EXTATTR_NAMESPACE_USER;
- path = archive_entry_sourcepath(entry);
- if (path == NULL)
- path = archive_entry_pathname(entry);
+ path = NULL;
- if (*fd < 0 && a->tree != NULL) {
- if (a->follow_symlinks ||
- archive_entry_filetype(entry) != AE_IFLNK)
- *fd = a->open_on_current_dir(a->tree, path,
- O_RDONLY | O_NONBLOCK);
- if (*fd < 0) {
- if (a->tree_enter_working_dir(a->tree) != 0) {
- archive_set_error(&a->archive, errno,
- "Couldn't access %s", path);
- return (ARCHIVE_FAILED);
- }
- }
+ if (*fd < 0) {
+ path = archive_read_disk_entry_setup_path(a, entry, fd);
+ if (path == NULL)
+ return (ARCHIVE_WARN);
}
if (*fd >= 0)
@@ -1097,7 +761,7 @@
name = buff + strlen(buff);
memcpy(name, p + 1, len);
name[len] = '\0';
- setup_xattr(a, entry, namespace, name, buff, *fd);
+ setup_xattr(a, entry, namespace, name, buff, *fd, path);
p += 1 + len;
}
@@ -1125,7 +789,7 @@
#if defined(HAVE_LINUX_FIEMAP_H)
/*
- * Linux sparse interface.
+ * Linux FIEMAP sparse interface.
*
* The FIEMAP ioctl returns an "extent" for each physical allocation
* on disk. We need to process those to generate a more compact list
@@ -1140,7 +804,7 @@
*/
static int
-setup_sparse(struct archive_read_disk *a,
+setup_sparse_fiemap(struct archive_read_disk *a,
struct archive_entry *entry, int *fd)
{
char buff[4096];
@@ -1149,6 +813,7 @@
int64_t size;
int count, do_fiemap, iters;
int exit_sts = ARCHIVE_OK;
+ const char *path;
if (archive_entry_filetype(entry) != AE_IFREG
|| archive_entry_size(entry) <= 0
@@ -1156,11 +821,10 @@
return (ARCHIVE_OK);
if (*fd < 0) {
- const char *path;
+ path = archive_read_disk_entry_setup_path(a, entry, NULL);
+ if (path == NULL)
+ return (ARCHIVE_FAILED);
- path = archive_entry_sourcepath(entry);
- if (path == NULL)
- path = archive_entry_pathname(entry);
if (a->tree != NULL)
*fd = a->open_on_current_dir(a->tree, path,
O_RDONLY | O_NONBLOCK | O_CLOEXEC);
@@ -1191,8 +855,8 @@
if (r < 0) {
/* When something error happens, it is better we
* should return ARCHIVE_OK because an earlier
- * version(<2.6.28) cannot perfom FS_IOC_FIEMAP. */
- goto exit_setup_sparse;
+ * version(<2.6.28) cannot perform FS_IOC_FIEMAP. */
+ goto exit_setup_sparse_fiemap;
}
if (fm->fm_mapped_extents == 0) {
if (iters == 0) {
@@ -1227,14 +891,24 @@
} else
break;
}
-exit_setup_sparse:
+exit_setup_sparse_fiemap:
return (exit_sts);
}
-#elif defined(SEEK_HOLE) && defined(SEEK_DATA) && defined(_PC_MIN_HOLE_SIZE)
+#if !defined(SEEK_HOLE) || !defined(SEEK_DATA)
+static int
+setup_sparse(struct archive_read_disk *a,
+ struct archive_entry *entry, int *fd)
+{
+ return setup_sparse_fiemap(a, entry, fd);
+}
+#endif
+#endif /* defined(HAVE_LINUX_FIEMAP_H) */
+#if defined(SEEK_HOLE) && defined(SEEK_DATA)
+
/*
- * FreeBSD and Solaris sparse interface.
+ * SEEK_HOLE sparse interface (FreeBSD, Linux, Solaris)
*/
static int
@@ -1242,10 +916,11 @@
struct archive_entry *entry, int *fd)
{
int64_t size;
- off_t initial_off; /* FreeBSD/Solaris only, so off_t okay here */
- off_t off_s, off_e; /* FreeBSD/Solaris only, so off_t okay here */
+ off_t initial_off;
+ off_t off_s, off_e;
int exit_sts = ARCHIVE_OK;
int check_fully_sparse = 0;
+ const char *path;
if (archive_entry_filetype(entry) != AE_IFREG
|| archive_entry_size(entry) <= 0
@@ -1253,36 +928,26 @@
return (ARCHIVE_OK);
/* Does filesystem support the reporting of hole ? */
- if (*fd < 0 && a->tree != NULL) {
- const char *path;
+ if (*fd < 0)
+ path = archive_read_disk_entry_setup_path(a, entry, fd);
+ else
+ path = NULL;
- path = archive_entry_sourcepath(entry);
- if (path == NULL)
- path = archive_entry_pathname(entry);
- *fd = a->open_on_current_dir(a->tree, path,
- O_RDONLY | O_NONBLOCK);
- if (*fd < 0) {
- archive_set_error(&a->archive, errno,
- "Can't open `%s'", path);
- return (ARCHIVE_FAILED);
- }
- }
-
if (*fd >= 0) {
+#ifdef _PC_MIN_HOLE_SIZE
if (fpathconf(*fd, _PC_MIN_HOLE_SIZE) <= 0)
return (ARCHIVE_OK);
+#endif
initial_off = lseek(*fd, 0, SEEK_CUR);
if (initial_off != 0)
lseek(*fd, 0, SEEK_SET);
} else {
- const char *path;
-
- path = archive_entry_sourcepath(entry);
if (path == NULL)
- path = archive_entry_pathname(entry);
-
+ return (ARCHIVE_FAILED);
+#ifdef _PC_MIN_HOLE_SIZE
if (pathconf(path, _PC_MIN_HOLE_SIZE) <= 0)
return (ARCHIVE_OK);
+#endif
*fd = open(path, O_RDONLY | O_NONBLOCK | O_CLOEXEC);
if (*fd < 0) {
archive_set_error(&a->archive, errno,
@@ -1293,6 +958,19 @@
initial_off = 0;
}
+#ifndef _PC_MIN_HOLE_SIZE
+ /* Check if the underlying filesystem supports seek hole */
+ off_s = lseek(*fd, 0, SEEK_HOLE);
+ if (off_s < 0)
+#if defined(HAVE_LINUX_FIEMAP_H)
+ return setup_sparse_fiemap(a, entry, fd);
+#else
+ goto exit_setup_sparse;
+#endif
+ else if (off_s > 0)
+ lseek(*fd, 0, SEEK_SET);
+#endif
+
off_s = 0;
size = archive_entry_size(entry);
while (off_s < size) {
@@ -1324,7 +1002,7 @@
goto exit_setup_sparse;
}
if (off_s == 0 && off_e == size)
- break;/* This is not spase. */
+ break;/* This is not sparse. */
archive_entry_sparse_add_entry(entry, off_s,
off_e - off_s);
off_s = off_e;
@@ -1342,7 +1020,7 @@
return (exit_sts);
}
-#else
+#elif !defined(HAVE_LINUX_FIEMAP_H)
/*
* Generic (stub) sparse support.
Modified: trunk/contrib/libarchive/libarchive/archive_read_disk_posix.c
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_read_disk_posix.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/archive_read_disk_posix.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -244,7 +244,7 @@
int initial_filesystem_id;
int current_filesystem_id;
int max_filesystem_id;
- int allocated_filesytem;
+ int allocated_filesystem;
int entry_fd;
int entry_eof;
@@ -465,8 +465,7 @@
a->entry = archive_entry_new2(&a->archive);
a->lookup_uname = trivial_lookup_uname;
a->lookup_gname = trivial_lookup_gname;
- a->enable_copyfile = 1;
- a->traverse_mount_points = 1;
+ a->flags = ARCHIVE_READDISK_MAC_COPYFILE;
a->open_on_current_dir = open_on_current_dir;
a->tree_current_dir_fd = tree_current_dir_fd;
a->tree_enter_working_dir = tree_enter_working_dir;
@@ -563,25 +562,19 @@
int
archive_read_disk_set_atime_restored(struct archive *_a)
{
-#ifndef HAVE_UTIMES
- static int warning_done = 0;
-#endif
struct archive_read_disk *a = (struct archive_read_disk *)_a;
archive_check_magic(_a, ARCHIVE_READ_DISK_MAGIC,
ARCHIVE_STATE_ANY, "archive_read_disk_restore_atime");
#ifdef HAVE_UTIMES
- a->restore_time = 1;
+ a->flags |= ARCHIVE_READDISK_RESTORE_ATIME;
if (a->tree != NULL)
a->tree->flags |= needsRestoreTimes;
return (ARCHIVE_OK);
#else
- if (warning_done)
- /* Warning was already emitted; suppress further warnings. */
- return (ARCHIVE_OK);
-
+ /* Display warning and unset flag */
archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
"Cannot restore access time on this system");
- warning_done = 1;
+ a->flags &= ~ARCHIVE_READDISK_RESTORE_ATIME;
return (ARCHIVE_WARN);
#endif
}
@@ -595,29 +588,14 @@
archive_check_magic(_a, ARCHIVE_READ_DISK_MAGIC,
ARCHIVE_STATE_ANY, "archive_read_disk_honor_nodump");
+ a->flags = flags;
+
if (flags & ARCHIVE_READDISK_RESTORE_ATIME)
r = archive_read_disk_set_atime_restored(_a);
else {
- a->restore_time = 0;
if (a->tree != NULL)
a->tree->flags &= ~needsRestoreTimes;
}
- if (flags & ARCHIVE_READDISK_HONOR_NODUMP)
- a->honor_nodump = 1;
- else
- a->honor_nodump = 0;
- if (flags & ARCHIVE_READDISK_MAC_COPYFILE)
- a->enable_copyfile = 1;
- else
- a->enable_copyfile = 0;
- if (flags & ARCHIVE_READDISK_NO_TRAVERSE_MOUNTS)
- a->traverse_mount_points = 0;
- else
- a->traverse_mount_points = 1;
- if (flags & ARCHIVE_READDISK_NO_XATTR)
- a->suppress_xattr = 1;
- else
- a->suppress_xattr = 0;
return (r);
}
@@ -675,7 +653,7 @@
asize = cf->min_xfer_size;
/* Increase a buffer size up to 64K bytes in
- * a proper incremant size. */
+ * a proper increment size. */
while (asize < 1024*64)
asize += incr;
/* Take a margin to adjust to the filesystem
@@ -918,7 +896,7 @@
} while (lst == NULL);
#ifdef __APPLE__
- if (a->enable_copyfile) {
+ if (a->flags & ARCHIVE_READDISK_MAC_COPYFILE) {
/* If we're using copyfile(), ignore "._XXX" files. */
const char *bname = strrchr(tree_current_path(t), '/');
if (bname == NULL)
@@ -989,7 +967,7 @@
}
if (t->initial_filesystem_id == -1)
t->initial_filesystem_id = t->current_filesystem_id;
- if (!a->traverse_mount_points) {
+ if (a->flags & ARCHIVE_READDISK_NO_TRAVERSE_MOUNTS) {
if (t->initial_filesystem_id != t->current_filesystem_id)
descend = 0;
}
@@ -999,12 +977,14 @@
* Honor nodump flag.
* If the file is marked with nodump flag, do not return this entry.
*/
- if (a->honor_nodump) {
+ if (a->flags & ARCHIVE_READDISK_HONOR_NODUMP) {
#if defined(HAVE_STRUCT_STAT_ST_FLAGS) && defined(UF_NODUMP)
if (st->st_flags & UF_NODUMP)
return (ARCHIVE_RETRY);
-#elif defined(EXT2_IOC_GETFLAGS) && defined(EXT2_NODUMP_FL) &&\
- defined(HAVE_WORKING_EXT2_IOC_GETFLAGS)
+#elif (defined(FS_IOC_GETFLAGS) && defined(FS_NODUMP_FL) && \
+ defined(HAVE_WORKING_FS_IOC_GETFLAGS)) || \
+ (defined(EXT2_IOC_GETFLAGS) && defined(EXT2_NODUMP_FL) && \
+ defined(HAVE_WORKING_EXT2_IOC_GETFLAGS))
if (S_ISREG(st->st_mode) || S_ISDIR(st->st_mode)) {
int stflags;
@@ -1013,9 +993,18 @@
O_RDONLY | O_NONBLOCK | O_CLOEXEC);
__archive_ensure_cloexec_flag(t->entry_fd);
if (t->entry_fd >= 0) {
- r = ioctl(t->entry_fd, EXT2_IOC_GETFLAGS,
+ r = ioctl(t->entry_fd,
+#ifdef FS_IOC_GETFLAGS
+ FS_IOC_GETFLAGS,
+#else
+ EXT2_IOC_GETFLAGS,
+#endif
&stflags);
+#ifdef FS_NODUMP_FL
+ if (r == 0 && (stflags & FS_NODUMP_FL) != 0)
+#else
if (r == 0 && (stflags & EXT2_NODUMP_FL) != 0)
+#endif
return (ARCHIVE_RETRY);
}
}
@@ -1026,7 +1015,7 @@
/* Save the times to be restored. This must be in before
* calling archive_read_disk_descend() or any chance of it,
- * especially, invokng a callback. */
+ * especially, invoking a callback. */
t->restore_time.mtime = archive_entry_mtime(entry);
t->restore_time.mtime_nsec = archive_entry_mtime_nsec(entry);
t->restore_time.atime = archive_entry_atime(entry);
@@ -1340,10 +1329,11 @@
struct archive_read_disk *a = (struct archive_read_disk *)_a;
if (a->tree != NULL)
- a->tree = tree_reopen(a->tree, pathname, a->restore_time);
+ a->tree = tree_reopen(a->tree, pathname,
+ a->flags & ARCHIVE_READDISK_RESTORE_ATIME);
else
a->tree = tree_open(pathname, a->symlink_mode,
- a->restore_time);
+ a->flags & ARCHIVE_READDISK_RESTORE_ATIME);
if (a->tree == NULL) {
archive_set_error(&a->archive, ENOMEM,
"Can't allocate tar data");
@@ -1382,7 +1372,7 @@
for (i = 0; i < t->max_filesystem_id; i++) {
if (t->filesystem_table[i].dev == dev) {
- /* There is the filesytem ID we've already generated. */
+ /* There is the filesystem ID we've already generated. */
t->current_filesystem_id = i;
t->current_filesystem = &(t->filesystem_table[i]);
return (ARCHIVE_OK);
@@ -1390,10 +1380,10 @@
}
/*
- * This is the new filesytem which we have to generate a new ID for.
+ * This is the new filesystem which we have to generate a new ID for.
*/
fid = t->max_filesystem_id++;
- if (t->max_filesystem_id > t->allocated_filesytem) {
+ if (t->max_filesystem_id > t->allocated_filesystem) {
size_t s;
void *p;
@@ -1406,7 +1396,7 @@
return (ARCHIVE_FATAL);
}
t->filesystem_table = (struct filesystem *)p;
- t->allocated_filesytem = s;
+ t->allocated_filesystem = s;
}
t->current_filesystem_id = fid;
t->current_filesystem = &(t->filesystem_table[fid]);
@@ -1656,7 +1646,7 @@
archive_set_error(&a->archive, errno, "statvfs failed");
return (ARCHIVE_FAILED);
} else if (xr == 1) {
- /* Usuall come here unless NetBSD supports _PC_REC_XFER_ALIGN
+ /* Usually come here unless NetBSD supports _PC_REC_XFER_ALIGN
* for pathconf() function. */
t->current_filesystem->xfer_align = sfs.f_frsize;
t->current_filesystem->max_xfer_size = -1;
@@ -1944,7 +1934,7 @@
if (nm == -1)
# endif /* _PC_NAME_MAX */
/*
- * Some sysmtes (HP-UX or others?) incorrectly defined
+ * Some systems (HP-UX or others?) incorrectly defined
* NAME_MAX macro to be a smaller value.
*/
# if defined(NAME_MAX) && NAME_MAX >= 255
@@ -2063,8 +2053,7 @@
{
struct tree_entry *te;
- te = malloc(sizeof(*te));
- memset(te, 0, sizeof(*te));
+ te = calloc(1, sizeof(*te));
te->next = t->stack;
te->parent = t->current;
if (te->parent)
@@ -2122,9 +2111,8 @@
{
struct tree *t;
- if ((t = malloc(sizeof(*t))) == NULL)
+ if ((t = calloc(1, sizeof(*t))) == NULL)
return (NULL);
- memset(t, 0, sizeof(*t));
archive_string_init(&t->path);
archive_string_ensure(&t->path, 31);
t->initial_symlink_mode = symlink_mode;
@@ -2134,7 +2122,7 @@
static struct tree *
tree_reopen(struct tree *t, const char *path, int restore_time)
{
- t->flags = (restore_time)?needsRestoreTimes:0;
+ t->flags = (restore_time != 0)?needsRestoreTimes:0;
t->flags |= onInitialDir;
t->visit_type = 0;
t->tree_errno = 0;
Modified: trunk/contrib/libarchive/libarchive/archive_read_disk_private.h
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_read_disk_private.h 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/archive_read_disk_private.h 2018-06-19 20:42:35 UTC (rev 11134)
@@ -33,6 +33,8 @@
#ifndef ARCHIVE_READ_DISK_PRIVATE_H_INCLUDED
#define ARCHIVE_READ_DISK_PRIVATE_H_INCLUDED
+#include "archive_platform_acl.h"
+
struct tree;
struct archive_entry;
@@ -63,16 +65,8 @@
int (*tree_current_dir_fd)(struct tree*);
int (*tree_enter_working_dir)(struct tree*);
- /* Set 1 if users request to restore atime . */
- int restore_time;
- /* Set 1 if users request to honor nodump flag . */
- int honor_nodump;
- /* Set 1 if users request to enable mac copyfile. */
- int enable_copyfile;
- /* Set 1 if users request to traverse mount points. */
- int traverse_mount_points;
- /* Set 1 if users want to suppress xattr information. */
- int suppress_xattr;
+ /* Bitfield with ARCHIVE_READDISK_* tunables */
+ int flags;
const char * (*lookup_gname)(void *private, int64_t gid);
void (*cleanup_gname)(void *private);
@@ -94,4 +88,11 @@
void *excluded_cb_data;
};
+const char *
+archive_read_disk_entry_setup_path(struct archive_read_disk *,
+ struct archive_entry *, int *);
+
+int
+archive_read_disk_entry_setup_acls(struct archive_read_disk *,
+ struct archive_entry *, int *);
#endif
Modified: trunk/contrib/libarchive/libarchive/archive_read_disk_set_standard_lookup.c
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_read_disk_set_standard_lookup.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/archive_read_disk_set_standard_lookup.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -232,6 +232,7 @@
lookup_uname_helper(struct name_cache *cache, id_t id)
{
struct passwd *result;
+ (void)cache; /* UNUSED */
result = getpwuid((uid_t)id);
@@ -298,6 +299,7 @@
lookup_gname_helper(struct name_cache *cache, id_t id)
{
struct group *result;
+ (void)cache; /* UNUSED */
result = getgrgid((gid_t)id);
Modified: trunk/contrib/libarchive/libarchive/archive_read_disk_windows.c
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_read_disk_windows.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/archive_read_disk_windows.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -168,7 +168,7 @@
int initial_filesystem_id;
int current_filesystem_id;
int max_filesystem_id;
- int allocated_filesytem;
+ int allocated_filesystem;
HANDLE entry_fh;
int entry_eof;
@@ -389,10 +389,9 @@
{
struct archive_read_disk *a;
- a = (struct archive_read_disk *)malloc(sizeof(*a));
+ a = (struct archive_read_disk *)calloc(1, sizeof(*a));
if (a == NULL)
return (NULL);
- memset(a, 0, sizeof(*a));
a->archive.magic = ARCHIVE_READ_DISK_MAGIC;
a->archive.state = ARCHIVE_STATE_NEW;
a->archive.vtable = archive_read_disk_vtable();
@@ -399,8 +398,7 @@
a->entry = archive_entry_new2(&a->archive);
a->lookup_uname = trivial_lookup_uname;
a->lookup_gname = trivial_lookup_gname;
- a->enable_copyfile = 1;
- a->traverse_mount_points = 1;
+ a->flags = ARCHIVE_READDISK_MAC_COPYFILE;
return (&a->archive);
}
@@ -496,7 +494,7 @@
struct archive_read_disk *a = (struct archive_read_disk *)_a;
archive_check_magic(_a, ARCHIVE_READ_DISK_MAGIC,
ARCHIVE_STATE_ANY, "archive_read_disk_restore_atime");
- a->restore_time = 1;
+ a->flags |= ARCHIVE_READDISK_RESTORE_ATIME;
if (a->tree != NULL)
a->tree->flags |= needsRestoreTimes;
return (ARCHIVE_OK);
@@ -511,25 +509,14 @@
archive_check_magic(_a, ARCHIVE_READ_DISK_MAGIC,
ARCHIVE_STATE_ANY, "archive_read_disk_honor_nodump");
+ a->flags = flags;
+
if (flags & ARCHIVE_READDISK_RESTORE_ATIME)
r = archive_read_disk_set_atime_restored(_a);
else {
- a->restore_time = 0;
if (a->tree != NULL)
a->tree->flags &= ~needsRestoreTimes;
}
- if (flags & ARCHIVE_READDISK_HONOR_NODUMP)
- a->honor_nodump = 1;
- else
- a->honor_nodump = 0;
- if (flags & ARCHIVE_READDISK_MAC_COPYFILE)
- a->enable_copyfile = 1;
- else
- a->enable_copyfile = 0;
- if (flags & ARCHIVE_READDISK_NO_TRAVERSE_MOUNTS)
- a->traverse_mount_points = 0;
- else
- a->traverse_mount_points = 1;
return (r);
}
@@ -803,7 +790,7 @@
r = archive_match_path_excluded(a->matching, entry);
if (r < 0) {
archive_set_error(&(a->archive), errno,
- "Faild : %s", archive_error_string(a->matching));
+ "Failed : %s", archive_error_string(a->matching));
return (r);
}
if (r) {
@@ -853,7 +840,7 @@
}
if (t->initial_filesystem_id == -1)
t->initial_filesystem_id = t->current_filesystem_id;
- if (!a->traverse_mount_points) {
+ if (a->flags & ARCHIVE_READDISK_NO_TRAVERSE_MOUNTS) {
if (t->initial_filesystem_id != t->current_filesystem_id)
return (ARCHIVE_RETRY);
}
@@ -863,7 +850,7 @@
/* Save the times to be restored. This must be in before
* calling archive_read_disk_descend() or any chance of it,
- * especially, invokng a callback. */
+ * especially, invoking a callback. */
t->restore_time.lastWriteTime = st->ftLastWriteTime;
t->restore_time.lastAccessTime = st->ftLastAccessTime;
t->restore_time.filetype = archive_entry_filetype(entry);
@@ -875,7 +862,7 @@
r = archive_match_time_excluded(a->matching, entry);
if (r < 0) {
archive_set_error(&(a->archive), errno,
- "Faild : %s", archive_error_string(a->matching));
+ "Failed : %s", archive_error_string(a->matching));
return (r);
}
if (r) {
@@ -901,7 +888,7 @@
r = archive_match_owner_excluded(a->matching, entry);
if (r < 0) {
archive_set_error(&(a->archive), errno,
- "Faild : %s", archive_error_string(a->matching));
+ "Failed : %s", archive_error_string(a->matching));
return (r);
}
if (r) {
@@ -1220,9 +1207,11 @@
struct archive_read_disk *a = (struct archive_read_disk *)_a;
if (a->tree != NULL)
- a->tree = tree_reopen(a->tree, pathname, a->restore_time);
+ a->tree = tree_reopen(a->tree, pathname,
+ a->flags & ARCHIVE_READDISK_RESTORE_ATIME);
else
- a->tree = tree_open(pathname, a->symlink_mode, a->restore_time);
+ a->tree = tree_open(pathname, a->symlink_mode,
+ a->flags & ARCHIVE_READDISK_RESTORE_ATIME);
if (a->tree == NULL) {
archive_set_error(&a->archive, ENOMEM,
"Can't allocate directory traversal data");
@@ -1261,7 +1250,7 @@
for (i = 0; i < t->max_filesystem_id; i++) {
if (t->filesystem_table[i].dev == dev) {
- /* There is the filesytem ID we've already generated. */
+ /* There is the filesystem ID we've already generated. */
t->current_filesystem_id = i;
t->current_filesystem = &(t->filesystem_table[i]);
return (ARCHIVE_OK);
@@ -1269,10 +1258,10 @@
}
/*
- * There is a new filesytem, we generate a new ID for.
+ * There is a new filesystem, we generate a new ID for.
*/
fid = t->max_filesystem_id++;
- if (t->max_filesystem_id > t->allocated_filesytem) {
+ if (t->max_filesystem_id > t->allocated_filesystem) {
size_t s;
void *p;
@@ -1285,7 +1274,7 @@
return (ARCHIVE_FATAL);
}
t->filesystem_table = (struct filesystem *)p;
- t->allocated_filesytem = (int)s;
+ t->allocated_filesystem = (int)s;
}
t->current_filesystem_id = fid;
t->current_filesystem = &(t->filesystem_table[fid]);
@@ -1402,7 +1391,7 @@
if (h == INVALID_HANDLE_VALUE && AE_IFLNK == rt->filetype)
return (0);
- /* Close a file descritor.
+ /* Close a file descriptor.
* It will not be used for SetFileTime() because it has been opened
* by a read only mode.
*/
@@ -1437,8 +1426,7 @@
{
struct tree_entry *te;
- te = malloc(sizeof(*te));
- memset(te, 0, sizeof(*te));
+ te = calloc(1, sizeof(*te));
te->next = t->stack;
te->parent = t->current;
if (te->parent)
@@ -1507,8 +1495,7 @@
{
struct tree *t;
- t = malloc(sizeof(*t));
- memset(t, 0, sizeof(*t));
+ t = calloc(1, sizeof(*t));
archive_string_init(&(t->full_path));
archive_string_init(&t->path);
archive_wstring_ensure(&t->path, 15);
@@ -1522,7 +1509,7 @@
struct archive_wstring ws;
wchar_t *pathname, *p, *base;
- t->flags = (restore_time)?needsRestoreTimes:0;
+ t->flags = (restore_time != 0)?needsRestoreTimes:0;
t->visit_type = 0;
t->tree_errno = 0;
t->full_path_dir_length = 0;
Modified: trunk/contrib/libarchive/libarchive/archive_read_extract2.c
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_read_extract2.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/archive_read_extract2.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -52,12 +52,11 @@
__archive_read_get_extract(struct archive_read *a)
{
if (a->extract == NULL) {
- a->extract = (struct archive_read_extract *)malloc(sizeof(*a->extract));
+ a->extract = (struct archive_read_extract *)calloc(1, sizeof(*a->extract));
if (a->extract == NULL) {
archive_set_error(&a->archive, ENOMEM, "Can't extract");
return (NULL);
}
- memset(a->extract, 0, sizeof(*a->extract));
a->cleanup_archive_extract = archive_read_extract_cleanup;
}
return (a->extract);
Modified: trunk/contrib/libarchive/libarchive/archive_read_format.3
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_read_format.3 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/archive_read_format.3 2018-06-19 20:42:35 UTC (rev 11134)
@@ -37,9 +37,9 @@
.Nm archive_read_support_format_empty ,
.Nm archive_read_support_format_iso9660 ,
.Nm archive_read_support_format_lha ,
-.Nm archive_read_support_format_mtree,
-.Nm archive_read_support_format_rar,
-.Nm archive_read_support_format_raw,
+.Nm archive_read_support_format_mtree ,
+.Nm archive_read_support_format_rar ,
+.Nm archive_read_support_format_raw ,
.Nm archive_read_support_format_tar ,
.Nm archive_read_support_format_xar ,
.Nm archive_read_support_format_zip
Modified: trunk/contrib/libarchive/libarchive/archive_read_open.3
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_read_open.3 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/archive_read_open.3 2018-06-19 20:42:35 UTC (rev 11134)
@@ -33,7 +33,7 @@
.Nm archive_read_open_fd ,
.Nm archive_read_open_FILE ,
.Nm archive_read_open_filename ,
-.Nm archive_read_open_memory ,
+.Nm archive_read_open_memory
.Nd functions for reading streaming archives
.Sh LIBRARY
Streaming Archive Library (libarchive, -larchive)
@@ -67,7 +67,7 @@
.Fa "size_t block_size"
.Fc
.Ft int
-.Fn archive_read_open_memory "struct archive *" "void *buff" "size_t size"
+.Fn archive_read_open_memory "struct archive *" "const void *buff" "size_t size"
.Sh DESCRIPTION
.Bl -tag -compact -width indent
.It Fn archive_read_open
Modified: trunk/contrib/libarchive/libarchive/archive_read_open_filename.c
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_read_open_filename.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/archive_read_open_filename.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -222,7 +222,7 @@
void *buffer;
const char *filename = NULL;
const wchar_t *wfilename = NULL;
- int fd;
+ int fd = -1;
int is_disk_like = 0;
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
off_t mediasize = 0; /* FreeBSD-specific, so off_t okay here. */
@@ -277,7 +277,7 @@
#else
archive_set_error(a, ARCHIVE_ERRNO_MISC,
"Unexpedted operation in archive_read_open_filename");
- return (ARCHIVE_FATAL);
+ goto fail;
#endif
}
if (fstat(fd, &st) != 0) {
@@ -287,7 +287,7 @@
else
archive_set_error(a, errno, "Can't stat '%s'",
filename);
- return (ARCHIVE_FATAL);
+ goto fail;
}
/*
@@ -356,11 +356,9 @@
mine->block_size = new_block_size;
}
buffer = malloc(mine->block_size);
- if (mine == NULL || buffer == NULL) {
+ if (buffer == NULL) {
archive_set_error(a, ENOMEM, "No memory");
- free(mine);
- free(buffer);
- return (ARCHIVE_FATAL);
+ goto fail;
}
mine->buffer = buffer;
mine->fd = fd;
@@ -372,6 +370,14 @@
mine->use_lseek = 1;
return (ARCHIVE_OK);
+fail:
+ /*
+ * Don't close file descriptors not opened or ones pointing referring
+ * to `FNT_STDIN`.
+ */
+ if (fd != -1 && fd != 0)
+ close(fd);
+ return (ARCHIVE_FATAL);
}
static ssize_t
Modified: trunk/contrib/libarchive/libarchive/archive_read_open_memory.c
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_read_open_memory.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/archive_read_open_memory.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -70,12 +70,11 @@
{
struct read_memory_data *mine;
- mine = (struct read_memory_data *)malloc(sizeof(*mine));
+ mine = (struct read_memory_data *)calloc(1, sizeof(*mine));
if (mine == NULL) {
archive_set_error(a, ENOMEM, "No memory");
return (ARCHIVE_FATAL);
}
- memset(mine, 0, sizeof(*mine));
mine->start = mine->p = (const unsigned char *)buff;
mine->end = mine->start + size;
mine->read_size = read_size;
Modified: trunk/contrib/libarchive/libarchive/archive_read_private.h
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_read_private.h 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/archive_read_private.h 2018-06-19 20:42:35 UTC (rev 11134)
@@ -252,7 +252,6 @@
int64_t __archive_read_filter_consume(struct archive_read_filter *, int64_t);
int __archive_read_program(struct archive_read_filter *, const char *);
void __archive_read_free_filters(struct archive_read *);
-int __archive_read_close_filters(struct archive_read *);
struct archive_read_extract *__archive_read_get_extract(struct archive_read *);
Modified: trunk/contrib/libarchive/libarchive/archive_read_support_filter_lz4.c
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_read_support_filter_lz4.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/archive_read_support_filter_lz4.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -180,7 +180,7 @@
return (0);
bits_checked += 8;
BD = buffer[5];
- /* A block maximum size shuld be more than 3. */
+ /* A block maximum size should be more than 3. */
if (((BD & 0x70) >> 4) < 4)
return (0);
/* Reserved bits must be "0". */
@@ -417,7 +417,7 @@
/* Reserved bits must be zero. */
if (bd & 0x8f)
goto malformed_error;
- /* Get a maxinum block size. */
+ /* Get a maximum block size. */
switch (read_buf[1] >> 4) {
case 4: /* 64 KB */
state->flags.block_maximum_size = 64 * 1024;
@@ -494,7 +494,7 @@
if (read_buf == NULL)
goto truncated_error;
compressed_size = archive_le32dec(read_buf);
- if ((compressed_size & ~(1 << 31)) > state->flags.block_maximum_size)
+ if ((compressed_size & 0x7fffffff) > state->flags.block_maximum_size)
goto malformed_error;
/* A compressed size == 0 means the end of stream blocks. */
if (compressed_size == 0) {
@@ -504,8 +504,8 @@
checksum_size = state->flags.block_checksum;
/* Check if the block is uncompressed. */
- if (compressed_size & (1 << 31)) {
- compressed_size &= ~(1 << 31);
+ if (compressed_size & 0x80000000U) {
+ compressed_size &= 0x7fffffff;
uncompressed_size = compressed_size;
} else
uncompressed_size = 0;/* Unknown yet. */
@@ -627,7 +627,7 @@
if (state->stage == SELECT_STREAM) {
state->stage = READ_DEFAULT_STREAM;
- /* First, read a desciprtor. */
+ /* First, read a descriptor. */
if((ret = lz4_filter_read_descriptor(self)) != ARCHIVE_OK)
return (ret);
state->stage = READ_DEFAULT_BLOCK;
@@ -706,6 +706,11 @@
/* Make sure we have a whole block. */
read_buf = __archive_read_filter_ahead(self->upstream,
4 + compressed, NULL);
+ if (read_buf == NULL) {
+ archive_set_error(&(self->archive->archive),
+ ARCHIVE_ERRNO_MISC, "truncated lz4 input");
+ return (ARCHIVE_FATAL);
+ }
ret = LZ4_decompress_safe(read_buf + 4, state->out_block,
compressed, (int)state->out_block_size);
if (ret < 0) {
Modified: trunk/contrib/libarchive/libarchive/archive_read_support_filter_lzop.c
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_read_support_filter_lzop.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/archive_read_support_filter_lzop.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -436,7 +436,7 @@
}
/*
- * Drive lzo uncompresison.
+ * Drive lzo uncompression.
*/
out_size = (lzo_uint)state->uncompressed_size;
r = lzo1x_decompress_safe(b, (lzo_uint)state->compressed_size,
Modified: trunk/contrib/libarchive/libarchive/archive_read_support_filter_program.c
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_read_support_filter_program.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/archive_read_support_filter_program.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -430,6 +430,7 @@
&state->child_stdout);
if (child == -1) {
free(state->out_buf);
+ archive_string_free(&state->description);
free(state);
archive_set_error(&self->archive->archive, EINVAL,
"Can't initialize filter; unable to run program \"%s\"",
@@ -441,6 +442,7 @@
if (state->child == NULL) {
child_stop(self, state);
free(state->out_buf);
+ archive_string_free(&state->description);
free(state);
archive_set_error(&self->archive->archive, EINVAL,
"Can't initialize filter; unable to run program \"%s\"",
Modified: trunk/contrib/libarchive/libarchive/archive_read_support_filter_uu.c
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_read_support_filter_uu.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/archive_read_support_filter_uu.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -312,6 +312,7 @@
avail -= len;
if (l == 6) {
+ /* "begin " */
if (!uuchar[*b])
return (0);
/* Get a length of decoded bytes. */
@@ -319,30 +320,14 @@
if (l > 45)
/* Normally, maximum length is 45(character 'M'). */
return (0);
- while (l && len-nl > 0) {
- if (l > 0) {
- if (!uuchar[*b++])
- return (0);
- if (!uuchar[*b++])
- return (0);
- len -= 2;
- --l;
- }
- if (l > 0) {
- if (!uuchar[*b++])
- return (0);
- --len;
- --l;
- }
- if (l > 0) {
- if (!uuchar[*b++])
- return (0);
- --len;
- --l;
- }
+ if (l > len - nl)
+ return (0); /* Line too short. */
+ while (l) {
+ if (!uuchar[*b++])
+ return (0);
+ --len;
+ --l;
}
- if (len-nl < 0)
- return (0);
if (len-nl == 1 &&
(uuchar[*b] || /* Check sum. */
(*b >= 'a' && *b <= 'z'))) {/* Padding data(MINIX). */
@@ -352,8 +337,8 @@
b += nl;
if (avail && uuchar[*b])
return (firstline+30);
- }
- if (l == 13) {
+ } else if (l == 13) {
+ /* "begin-base64 " */
while (len-nl > 0) {
if (!base64[*b++])
return (0);
@@ -510,6 +495,13 @@
}
llen = len;
if ((nl == 0) && (uudecode->state != ST_UUEND)) {
+ if (total == 0 && ravail <= 0) {
+ /* There is nothing more to read, fail */
+ archive_set_error(&self->archive->archive,
+ ARCHIVE_ERRNO_FILE_FORMAT,
+ "Missing format data");
+ return (ARCHIVE_FATAL);
+ }
/*
* Save remaining data which does not contain
* NL('\n','\r').
@@ -566,7 +558,7 @@
"Insufficient compressed data");
return (ARCHIVE_FATAL);
}
- /* Get length of undecoded bytes of curent line. */
+ /* Get length of undecoded bytes of current line. */
l = UUDECODE(*b++);
body--;
if (l > body) {
Modified: trunk/contrib/libarchive/libarchive/archive_read_support_filter_xz.c
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_read_support_filter_xz.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/archive_read_support_filter_xz.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -43,8 +43,6 @@
#endif
#if HAVE_LZMA_H
#include <lzma.h>
-#elif HAVE_LZMADEC_H
-#include <lzmadec.h>
#endif
#include "archive.h"
@@ -82,19 +80,6 @@
static int xz_filter_close(struct archive_read_filter *);
static int xz_lzma_bidder_init(struct archive_read_filter *);
-#elif HAVE_LZMADEC_H && HAVE_LIBLZMADEC
-
-struct private_data {
- lzmadec_stream stream;
- unsigned char *out_block;
- size_t out_block_size;
- int64_t total_out;
- char eof; /* True = found end of compressed data. */
-};
-
-/* Lzma-only filter */
-static ssize_t lzma_filter_read(struct archive_read_filter *, const void **);
-static int lzma_filter_close(struct archive_read_filter *);
#endif
/*
@@ -178,8 +163,6 @@
bidder->free = NULL;
#if HAVE_LZMA_H && HAVE_LIBLZMA
return (ARCHIVE_OK);
-#elif HAVE_LZMADEC_H && HAVE_LIBLZMADEC
- return (ARCHIVE_OK);
#else
archive_set_error(_a, ARCHIVE_ERRNO_MISC,
"Using external lzma program for lzma decompression");
@@ -310,7 +293,7 @@
/* Second through fifth bytes are dictionary size, stored in
* little-endian order. The minimum dictionary size is
* 1 << 12(4KiB) which the lzma of LZMA SDK uses with option
- * -d12 and the maxinam dictionary size is 1 << 27(128MiB)
+ * -d12 and the maximum dictionary size is 1 << 27(128MiB)
* which the one uses with option -d27.
* NOTE: A comment of LZMA SDK source code says this dictionary
* range is from 1 << 12 to 1 << 30. */
@@ -601,9 +584,7 @@
return (ARCHIVE_FATAL);
}
ret = lzma_raw_decoder(&(state->stream), filters);
-#if LZMA_VERSION < 50010000
free(filters[0].options);
-#endif
if (ret != LZMA_OK) {
set_error(self, ret);
return (ARCHIVE_FATAL);
@@ -763,176 +744,7 @@
#else
-#if HAVE_LZMADEC_H && HAVE_LIBLZMADEC
-
/*
- * If we have the older liblzmadec library, then we can handle
- * LZMA streams but not XZ streams.
- */
-
-/*
- * Setup the callbacks.
- */
-static int
-lzma_bidder_init(struct archive_read_filter *self)
-{
- static const size_t out_block_size = 64 * 1024;
- void *out_block;
- struct private_data *state;
- ssize_t ret, avail_in;
-
- self->code = ARCHIVE_FILTER_LZMA;
- self->name = "lzma";
-
- state = (struct private_data *)calloc(sizeof(*state), 1);
- out_block = (unsigned char *)malloc(out_block_size);
- if (state == NULL || out_block == NULL) {
- archive_set_error(&self->archive->archive, ENOMEM,
- "Can't allocate data for lzma decompression");
- free(out_block);
- free(state);
- return (ARCHIVE_FATAL);
- }
-
- self->data = state;
- state->out_block_size = out_block_size;
- state->out_block = out_block;
- self->read = lzma_filter_read;
- self->skip = NULL; /* not supported */
- self->close = lzma_filter_close;
-
- /* Prime the lzma library with 18 bytes of input. */
- state->stream.next_in = (unsigned char *)(uintptr_t)
- __archive_read_filter_ahead(self->upstream, 18, &avail_in);
- if (state->stream.next_in == NULL)
- return (ARCHIVE_FATAL);
- state->stream.avail_in = avail_in;
- state->stream.next_out = state->out_block;
- state->stream.avail_out = state->out_block_size;
-
- /* Initialize compression library. */
- ret = lzmadec_init(&(state->stream));
- __archive_read_filter_consume(self->upstream,
- avail_in - state->stream.avail_in);
- if (ret == LZMADEC_OK)
- return (ARCHIVE_OK);
-
- /* Library setup failed: Clean up. */
- archive_set_error(&self->archive->archive, ARCHIVE_ERRNO_MISC,
- "Internal error initializing lzma library");
-
- /* Override the error message if we know what really went wrong. */
- switch (ret) {
- case LZMADEC_HEADER_ERROR:
- archive_set_error(&self->archive->archive,
- ARCHIVE_ERRNO_MISC,
- "Internal error initializing compression library: "
- "invalid header");
- break;
- case LZMADEC_MEM_ERROR:
- archive_set_error(&self->archive->archive, ENOMEM,
- "Internal error initializing compression library: "
- "out of memory");
- break;
- }
-
- free(state->out_block);
- free(state);
- self->data = NULL;
- return (ARCHIVE_FATAL);
-}
-
-/*
- * Return the next block of decompressed data.
- */
-static ssize_t
-lzma_filter_read(struct archive_read_filter *self, const void **p)
-{
- struct private_data *state;
- size_t decompressed;
- ssize_t avail_in, ret;
-
- state = (struct private_data *)self->data;
-
- /* Empty our output buffer. */
- state->stream.next_out = state->out_block;
- state->stream.avail_out = state->out_block_size;
-
- /* Try to fill the output buffer. */
- while (state->stream.avail_out > 0 && !state->eof) {
- state->stream.next_in = (unsigned char *)(uintptr_t)
- __archive_read_filter_ahead(self->upstream, 1, &avail_in);
- if (state->stream.next_in == NULL && avail_in < 0) {
- archive_set_error(&self->archive->archive,
- ARCHIVE_ERRNO_MISC,
- "truncated lzma input");
- return (ARCHIVE_FATAL);
- }
- state->stream.avail_in = avail_in;
-
- /* Decompress as much as we can in one pass. */
- ret = lzmadec_decode(&(state->stream), avail_in == 0);
- switch (ret) {
- case LZMADEC_STREAM_END: /* Found end of stream. */
- state->eof = 1;
- /* FALL THROUGH */
- case LZMADEC_OK: /* Decompressor made some progress. */
- __archive_read_filter_consume(self->upstream,
- avail_in - state->stream.avail_in);
- break;
- case LZMADEC_BUF_ERROR: /* Insufficient input data? */
- archive_set_error(&self->archive->archive,
- ARCHIVE_ERRNO_MISC,
- "Insufficient compressed data");
- return (ARCHIVE_FATAL);
- default:
- /* Return an error. */
- archive_set_error(&self->archive->archive,
- ARCHIVE_ERRNO_MISC,
- "Lzma decompression failed");
- return (ARCHIVE_FATAL);
- }
- }
-
- decompressed = state->stream.next_out - state->out_block;
- state->total_out += decompressed;
- if (decompressed == 0)
- *p = NULL;
- else
- *p = state->out_block;
- return (decompressed);
-}
-
-/*
- * Clean up the decompressor.
- */
-static int
-lzma_filter_close(struct archive_read_filter *self)
-{
- struct private_data *state;
- int ret;
-
- state = (struct private_data *)self->data;
- ret = ARCHIVE_OK;
- switch (lzmadec_end(&(state->stream))) {
- case LZMADEC_OK:
- break;
- default:
- archive_set_error(&(self->archive->archive),
- ARCHIVE_ERRNO_MISC,
- "Failed to clean up %s compressor",
- self->archive->archive.compression_name);
- ret = ARCHIVE_FATAL;
- }
-
- free(state->out_block);
- free(state);
- return (ret);
-}
-
-#else
-
-/*
*
* If we have no suitable library on this system, we can't actually do
* the decompression. We can, however, still detect compressed
@@ -953,9 +765,6 @@
return (r);
}
-#endif /* HAVE_LZMADEC_H */
-
-
static int
xz_bidder_init(struct archive_read_filter *self)
{
@@ -984,5 +793,4 @@
return (r);
}
-
#endif /* HAVE_LZMA_H */
Modified: trunk/contrib/libarchive/libarchive/archive_read_support_format_7zip.c
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_read_support_format_7zip.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/archive_read_support_format_7zip.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -213,7 +213,7 @@
int header_is_encoded;
uint64_t header_bytes_remaining;
unsigned long header_crc32;
- /* Header offset to check that reading pointes of the file contens
+ /* Header offset to check that reading points of the file contents
* will not exceed the header. */
uint64_t header_offset;
/* Base offset of the archive file for a seek in case reading SFX. */
@@ -263,22 +263,22 @@
/*
* Decompressor controllers.
*/
- /* Decording LZMA1 and LZMA2 data. */
+ /* Decoding LZMA1 and LZMA2 data. */
#ifdef HAVE_LZMA_H
lzma_stream lzstream;
int lzstream_valid;
#endif
- /* Decording bzip2 data. */
+ /* Decoding bzip2 data. */
#if defined(HAVE_BZLIB_H) && defined(BZ_CONFIG_ERROR)
bz_stream bzstream;
int bzstream_valid;
#endif
- /* Decording deflate data. */
+ /* Decoding deflate data. */
#ifdef HAVE_ZLIB_H
z_stream stream;
int stream_valid;
#endif
- /* Decording PPMd data. */
+ /* Decoding PPMd data. */
int ppmd7_stat;
CPpmd7 ppmd7_context;
CPpmd7z_RangeDec range_dec;
@@ -552,7 +552,7 @@
/*
* If bytes_avail > SFX_MIN_ADDR we do not have to call
* __archive_read_seek() at this time since we have
- * alredy had enough data.
+ * already had enough data.
*/
if (bytes_avail > SFX_MIN_ADDR)
__archive_read_consume(a, SFX_MIN_ADDR);
@@ -760,7 +760,7 @@
symsize += size;
}
if (symsize == 0) {
- /* If there is no synname, handle it as a regular
+ /* If there is no symname, handle it as a regular
* file. */
zip_entry->mode &= ~AE_IFMT;
zip_entry->mode |= AE_IFREG;
@@ -1056,10 +1056,7 @@
#endif
{
lzma_options_delta delta_opt;
- lzma_filter filters[LZMA_FILTERS_MAX];
-#if LZMA_VERSION < 50010000
- lzma_filter *ff;
-#endif
+ lzma_filter filters[LZMA_FILTERS_MAX], *ff;
int fi = 0;
if (zip->lzstream_valid) {
@@ -1144,9 +1141,7 @@
else
filters[fi].id = LZMA_FILTER_LZMA1;
filters[fi].options = NULL;
-#if LZMA_VERSION < 50010000
ff = &filters[fi];
-#endif
r = lzma_properties_decode(&filters[fi], NULL,
coder1->properties, (size_t)coder1->propertiesSize);
if (r != LZMA_OK) {
@@ -1158,9 +1153,7 @@
filters[fi].id = LZMA_VLI_UNKNOWN;
filters[fi].options = NULL;
r = lzma_raw_decoder(&(zip->lzstream), filters);
-#if LZMA_VERSION < 50010000
free(ff->options);
-#endif
if (r != LZMA_OK) {
set_error(a, r);
return (ARCHIVE_FAILED);
@@ -3295,7 +3288,7 @@
return (r);
/*
- * Skip the bytes we alrady has skipped in skip_stream().
+ * Skip the bytes we already has skipped in skip_stream().
*/
while (skip_bytes) {
ssize_t skipped;
@@ -3513,7 +3506,7 @@
return (ARCHIVE_FATAL);
}
- /* Allocate memory for the decorded data of a sub
+ /* Allocate memory for the decoded data of a sub
* stream. */
b[i] = malloc((size_t)zip->folder_outbytes_remaining);
if (b[i] == NULL) {
@@ -3598,7 +3591,7 @@
if (zip->folder_index == 0) {
/*
* Optimization for a list mode.
- * Avoid unncecessary decoding operations.
+ * Avoid unnecessary decoding operations.
*/
zip->si.ci.folders[zip->entry->folderIndex].skipped_bytes
+= skip_bytes;
Modified: trunk/contrib/libarchive/libarchive/archive_read_support_format_ar.c
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_read_support_format_ar.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/archive_read_support_format_ar.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -104,13 +104,12 @@
archive_check_magic(_a, ARCHIVE_READ_MAGIC,
ARCHIVE_STATE_NEW, "archive_read_support_format_ar");
- ar = (struct ar *)malloc(sizeof(*ar));
+ ar = (struct ar *)calloc(1, sizeof(*ar));
if (ar == NULL) {
archive_set_error(&a->archive, ENOMEM,
"Can't allocate ar data");
return (ARCHIVE_FATAL);
}
- memset(ar, 0, sizeof(*ar));
ar->strtab = NULL;
r = __archive_read_register_format(a,
@@ -260,7 +259,7 @@
archive_entry_set_filetype(entry, AE_IFREG);
/* Get the size of the filename table. */
number = ar_atol10(h + AR_size_offset, AR_size_size);
- if (number > SIZE_MAX) {
+ if (number > SIZE_MAX || number > 1024 * 1024 * 1024) {
archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
"Filename table too large");
return (ARCHIVE_FATAL);
@@ -316,7 +315,7 @@
* If we can't look up the real name, warn and return
* the entry with the wrong name.
*/
- if (ar->strtab == NULL || number > ar->strtab_size) {
+ if (ar->strtab == NULL || number >= ar->strtab_size) {
archive_set_error(&a->archive, EINVAL,
"Can't find long filename for GNU/SVR4 archive entry");
archive_entry_copy_pathname(entry, filename);
@@ -342,16 +341,19 @@
/* Parse the size of the name, adjust the file size. */
number = ar_atol10(h + AR_name_offset + 3, AR_name_size - 3);
- bsd_name_length = (size_t)number;
- /* Guard against the filename + trailing NUL
- * overflowing a size_t and against the filename size
- * being larger than the entire entry. */
- if (number > (uint64_t)(bsd_name_length + 1)
- || (int64_t)bsd_name_length > ar->entry_bytes_remaining) {
+ /* Sanity check the filename length:
+ * = Must be <= SIZE_MAX - 1
+ * = Must be <= 1MB
+ * = Cannot be bigger than the entire entry
+ */
+ if (number > SIZE_MAX - 1
+ || number > 1024 * 1024
+ || (int64_t)number > ar->entry_bytes_remaining) {
archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
"Bad input file size");
return (ARCHIVE_FATAL);
}
+ bsd_name_length = (size_t)number;
ar->entry_bytes_remaining -= bsd_name_length;
/* Adjust file size reported to client. */
archive_entry_set_size(entry, ar->entry_bytes_remaining);
Modified: trunk/contrib/libarchive/libarchive/archive_read_support_format_cab.c
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_read_support_format_cab.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/archive_read_support_format_cab.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -67,7 +67,7 @@
/* The length how many bytes we can copy decoded code from
* the window. */
int copy_len;
- /* Translation reversal for x86 proccessor CALL byte sequence(E8).
+ /* Translation reversal for x86 processor CALL byte sequence(E8).
* This is used for LZX only. */
uint32_t translation_size;
char translation;
@@ -116,19 +116,11 @@
* coding tree, which is a binary tree. But a use of a large
* index table causes L1 cache read miss many times.
*/
-#define HTBL_BITS 10
int max_bits;
- int shift_bits;
int tbl_bits;
int tree_used;
- int tree_avail;
/* Direct access table. */
uint16_t *tbl;
- /* Binary tree table for extra bits over the direct access. */
- struct htree_t {
- uint16_t left;
- uint16_t right;
- } *tree;
} at, lt, mt, pt;
int loop;
@@ -187,7 +179,7 @@
#define CFDATA_cbData 4
#define CFDATA_cbUncomp 6
-static const char *compression_name[] = {
+static const char * const compression_name[] = {
"NONE",
"MSZIP",
"Quantum",
@@ -352,7 +344,6 @@
static void lzx_huffman_free(struct huffman *);
static int lzx_make_huffman_table(struct huffman *);
static inline int lzx_decode_huffman(struct huffman *, unsigned);
-static int lzx_decode_huffman_tree(struct huffman *, unsigned, int);
int
@@ -645,12 +636,13 @@
cab = (struct cab *)(a->format->data);
if (cab->found_header == 0 &&
p[0] == 'M' && p[1] == 'Z') {
- /* This is an executable? Must be self-extracting... */
+ /* This is an executable? Must be self-extracting... */
err = cab_skip_sfx(a);
if (err < ARCHIVE_WARN)
return (err);
- if ((p = __archive_read_ahead(a, sizeof(*p), NULL)) == NULL)
+ /* Re-read header after processing the SFX. */
+ if ((p = __archive_read_ahead(a, 42, NULL)) == NULL)
return (truncated_error(a));
}
@@ -1494,6 +1486,8 @@
/* Cut out a tow-byte MSZIP signature(0x43, 0x4b). */
if (mszip > 0) {
+ if (bytes_avail <= 0)
+ goto nomszip;
if (bytes_avail <= mszip) {
if (mszip == 2) {
if (cab->stream.next_in[0] != 0x43)
@@ -1554,7 +1548,7 @@
/*
* Note: I suspect there is a bug in makecab.exe because, in rare
* case, compressed bytes are still remaining regardless we have
- * gotten all uncompressed bytes, which size is recoded in CFDATA,
+ * gotten all uncompressed bytes, which size is recorded in CFDATA,
* as much as we need, and we have to use the garbage so as to
* correctly compute the sum of CFDATA accordingly.
*/
@@ -1741,7 +1735,7 @@
}
/*
- * Translation reversal of x86 proccessor CALL byte sequence(E8).
+ * Translation reversal of x86 processor CALL byte sequence(E8).
*/
lzx_translation(&cab->xstrm, cab->uncompressed_buffer,
cfdata->uncompressed_size,
@@ -2270,7 +2264,7 @@
lzx_br_fillup(struct lzx_stream *strm, struct lzx_br *br)
{
/*
- * x86 proccessor family can read misaligned data without an access error.
+ * x86 processor family can read misaligned data without an access error.
*/
int n = CACHE_BITS - br->cache_avail;
@@ -3124,7 +3118,6 @@
static int
lzx_huffman_init(struct huffman *hf, size_t len_size, int tbl_bits)
{
- int bits;
if (hf->bitlen == NULL || hf->len_size != (int)len_size) {
free(hf->bitlen);
@@ -3135,21 +3128,11 @@
} else
memset(hf->bitlen, 0, len_size * sizeof(hf->bitlen[0]));
if (hf->tbl == NULL) {
- if (tbl_bits < HTBL_BITS)
- bits = tbl_bits;
- else
- bits = HTBL_BITS;
- hf->tbl = malloc(((size_t)1 << bits) * sizeof(hf->tbl[0]));
+ hf->tbl = malloc(((size_t)1 << tbl_bits) * sizeof(hf->tbl[0]));
if (hf->tbl == NULL)
return (ARCHIVE_FATAL);
hf->tbl_bits = tbl_bits;
}
- if (hf->tree == NULL && tbl_bits > HTBL_BITS) {
- hf->tree_avail = 1 << (tbl_bits - HTBL_BITS + 4);
- hf->tree = malloc(hf->tree_avail * sizeof(hf->tree[0]));
- if (hf->tree == NULL)
- return (ARCHIVE_FATAL);
- }
return (ARCHIVE_OK);
}
@@ -3158,7 +3141,6 @@
{
free(hf->bitlen);
free(hf->tbl);
- free(hf->tree);
}
/*
@@ -3171,7 +3153,7 @@
const unsigned char *bitlen;
int bitptn[17], weight[17];
int i, maxbits = 0, ptn, tbl_size, w;
- int diffbits, len_avail;
+ int len_avail;
/*
* Initialize bit patterns.
@@ -3202,28 +3184,11 @@
weight[i] >>= ebits;
}
}
- if (maxbits > HTBL_BITS) {
- int htbl_max;
- uint16_t *p;
- diffbits = maxbits - HTBL_BITS;
- for (i = 1; i <= HTBL_BITS; i++) {
- bitptn[i] >>= diffbits;
- weight[i] >>= diffbits;
- }
- htbl_max = bitptn[HTBL_BITS] +
- weight[HTBL_BITS] * hf->freq[HTBL_BITS];
- p = &(hf->tbl[htbl_max]);
- while (p < &hf->tbl[1U<<HTBL_BITS])
- *p++ = 0;
- } else
- diffbits = 0;
- hf->shift_bits = diffbits;
-
/*
* Make the table.
*/
- tbl_size = 1 << HTBL_BITS;
+ tbl_size = 1 << hf->tbl_bits;
tbl = hf->tbl;
bitlen = hf->bitlen;
len_avail = hf->len_size;
@@ -3231,120 +3196,32 @@
for (i = 0; i < len_avail; i++) {
uint16_t *p;
int len, cnt;
- uint16_t bit;
- int extlen;
- struct htree_t *ht;
if (bitlen[i] == 0)
continue;
/* Get a bit pattern */
len = bitlen[i];
+ if (len > tbl_size)
+ return (0);
ptn = bitptn[len];
cnt = weight[len];
- if (len <= HTBL_BITS) {
- /* Calculate next bit pattern */
- if ((bitptn[len] = ptn + cnt) > tbl_size)
- return (0);/* Invalid */
- /* Update the table */
- p = &(tbl[ptn]);
- while (--cnt >= 0)
- p[cnt] = (uint16_t)i;
- continue;
- }
-
- /*
- * A bit length is too big to be housed to a direct table,
- * so we use a tree model for its extra bits.
- */
- bitptn[len] = ptn + cnt;
- bit = 1U << (diffbits -1);
- extlen = len - HTBL_BITS;
-
- p = &(tbl[ptn >> diffbits]);
- if (*p == 0) {
- *p = len_avail + hf->tree_used;
- ht = &(hf->tree[hf->tree_used++]);
- if (hf->tree_used > hf->tree_avail)
- return (0);/* Invalid */
- ht->left = 0;
- ht->right = 0;
- } else {
- if (*p < len_avail ||
- *p >= (len_avail + hf->tree_used))
- return (0);/* Invalid */
- ht = &(hf->tree[*p - len_avail]);
- }
- while (--extlen > 0) {
- if (ptn & bit) {
- if (ht->left < len_avail) {
- ht->left = len_avail + hf->tree_used;
- ht = &(hf->tree[hf->tree_used++]);
- if (hf->tree_used > hf->tree_avail)
- return (0);/* Invalid */
- ht->left = 0;
- ht->right = 0;
- } else {
- ht = &(hf->tree[ht->left - len_avail]);
- }
- } else {
- if (ht->right < len_avail) {
- ht->right = len_avail + hf->tree_used;
- ht = &(hf->tree[hf->tree_used++]);
- if (hf->tree_used > hf->tree_avail)
- return (0);/* Invalid */
- ht->left = 0;
- ht->right = 0;
- } else {
- ht = &(hf->tree[ht->right - len_avail]);
- }
- }
- bit >>= 1;
- }
- if (ptn & bit) {
- if (ht->left != 0)
- return (0);/* Invalid */
- ht->left = (uint16_t)i;
- } else {
- if (ht->right != 0)
- return (0);/* Invalid */
- ht->right = (uint16_t)i;
- }
+ /* Calculate next bit pattern */
+ if ((bitptn[len] = ptn + cnt) > tbl_size)
+ return (0);/* Invalid */
+ /* Update the table */
+ p = &(tbl[ptn]);
+ while (--cnt >= 0)
+ p[cnt] = (uint16_t)i;
}
return (1);
}
-static int
-lzx_decode_huffman_tree(struct huffman *hf, unsigned rbits, int c)
-{
- struct htree_t *ht;
- int extlen;
-
- ht = hf->tree;
- extlen = hf->shift_bits;
- while (c >= hf->len_size) {
- c -= hf->len_size;
- if (extlen-- <= 0 || c >= hf->tree_used)
- return (0);
- if (rbits & (1U << extlen))
- c = ht[c].left;
- else
- c = ht[c].right;
- }
- return (c);
-}
-
static inline int
lzx_decode_huffman(struct huffman *hf, unsigned rbits)
{
int c;
- /*
- * At first search an index table for a bit pattern.
- * If it fails, search a huffman tree for.
- */
- c = hf->tbl[rbits >> hf->shift_bits];
+ c = hf->tbl[rbits];
if (c < hf->len_size)
return (c);
- /* This bit pattern needs to be found out at a huffman tree. */
- return (lzx_decode_huffman_tree(hf, rbits, c));
+ return (0);
}
-
Modified: trunk/contrib/libarchive/libarchive/archive_read_support_format_cpio.c
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_read_support_format_cpio.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/archive_read_support_format_cpio.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -165,7 +165,7 @@
struct links_entry {
struct links_entry *next;
struct links_entry *previous;
- int links;
+ unsigned int links;
dev_t dev;
int64_t ino;
char *name;
@@ -326,7 +326,7 @@
cpio = (struct cpio *)(a->format->data);
if (strcmp(key, "compat-2x") == 0) {
- /* Handle filnames as libarchive 2.x */
+ /* Handle filenames as libarchive 2.x */
cpio->init_default_conversion = (val != NULL)?1:0;
return (ARCHIVE_OK);
} else if (strcmp(key, "hdrcharset") == 0) {
@@ -356,7 +356,7 @@
struct archive_entry *entry)
{
struct cpio *cpio;
- const void *h;
+ const void *h, *hl;
struct archive_string_conv *sconv;
size_t namelength;
size_t name_pad;
@@ -406,11 +406,11 @@
"Rejecting malformed cpio archive: symlink contents exceed 1 megabyte");
return (ARCHIVE_FATAL);
}
- h = __archive_read_ahead(a,
+ hl = __archive_read_ahead(a,
(size_t)cpio->entry_bytes_remaining, NULL);
- if (h == NULL)
+ if (hl == NULL)
return (ARCHIVE_FATAL);
- if (archive_entry_copy_symlink_l(entry, (const char *)h,
+ if (archive_entry_copy_symlink_l(entry, (const char *)hl,
(size_t)cpio->entry_bytes_remaining, sconv) != 0) {
if (errno == ENOMEM) {
archive_set_error(&a->archive, ENOMEM,
@@ -434,7 +434,8 @@
* header. XXX */
/* Compare name to "TRAILER!!!" to test for end-of-archive. */
- if (namelength == 11 && strcmp((const char *)h, "TRAILER!!!") == 0) {
+ if (namelength == 11 && strncmp((const char *)h, "TRAILER!!!",
+ 11) == 0) {
/* TODO: Store file location of start of block. */
archive_clear_error(&a->archive);
return (ARCHIVE_EOF);
@@ -814,8 +815,8 @@
* NOTE: if a filename suffix is ".z", it is the file gziped by afio.
* it would be nice that we can show uncompressed file size and we can
* uncompressed file contents automatically, unfortunately we have nothing
- * to get a uncompressed file size while reading each header. it means
- * we also cannot uncompressed file contens under the our framework.
+ * to get a uncompressed file size while reading each header. It means
+ * we also cannot uncompress file contents under our framework.
*/
static int
header_afiol(struct archive_read *a, struct cpio *cpio,
Modified: trunk/contrib/libarchive/libarchive/archive_read_support_format_iso9660.c
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_read_support_format_iso9660.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/archive_read_support_format_iso9660.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -322,7 +322,7 @@
struct archive_string pathname;
char seenRockridge; /* Set true if RR extensions are used. */
- char seenSUSP; /* Set true if SUSP is beging used. */
+ char seenSUSP; /* Set true if SUSP is being used. */
char seenJoliet;
unsigned char suspOffset;
@@ -374,7 +374,7 @@
size_t utf16be_path_len;
unsigned char *utf16be_previous_path;
size_t utf16be_previous_path_len;
- /* Null buufer used in bidder to improve its performance. */
+ /* Null buffer used in bidder to improve its performance. */
unsigned char null[2048];
};
@@ -1199,7 +1199,7 @@
archive_string_conversion_from_charset(
&(a->archive), "UTF-16BE", 1);
if (iso9660->sconv_utf16be == NULL)
- /* Coundn't allocate memory */
+ /* Couldn't allocate memory */
return (ARCHIVE_FATAL);
}
if (iso9660->utf16be_path == NULL) {
@@ -1864,7 +1864,7 @@
if ((file->utf16be_name = malloc(name_len)) == NULL) {
archive_set_error(&a->archive, ENOMEM,
"No memory for file name");
- return (NULL);
+ goto fail;
}
memcpy(file->utf16be_name, p, name_len);
file->utf16be_bytes = name_len;
@@ -1943,10 +1943,8 @@
file->symlink_continues = 0;
rr_start += iso9660->suspOffset;
r = parse_rockridge(a, file, rr_start, rr_end);
- if (r != ARCHIVE_OK) {
- free(file);
- return (NULL);
- }
+ if (r != ARCHIVE_OK)
+ goto fail;
/*
* A file size of symbolic link files in ISO images
* made by makefs is not zero and its location is
@@ -1990,7 +1988,7 @@
archive_set_error(&a->archive,
ARCHIVE_ERRNO_MISC,
"Invalid Rockridge RE");
- return (NULL);
+ goto fail;
}
/*
* Sanity check: file does not have "CL" extension.
@@ -1999,7 +1997,7 @@
archive_set_error(&a->archive,
ARCHIVE_ERRNO_MISC,
"Invalid Rockridge RE and CL");
- return (NULL);
+ goto fail;
}
/*
* Sanity check: The file type must be a directory.
@@ -2008,7 +2006,7 @@
archive_set_error(&a->archive,
ARCHIVE_ERRNO_MISC,
"Invalid Rockridge RE");
- return (NULL);
+ goto fail;
}
} else if (parent != NULL && parent->rr_moved)
file->rr_moved_has_re_only = 0;
@@ -2022,7 +2020,7 @@
archive_set_error(&a->archive,
ARCHIVE_ERRNO_MISC,
"Invalid Rockridge CL");
- return (NULL);
+ goto fail;
}
/*
* Sanity check: The file type must be a regular file.
@@ -2031,7 +2029,7 @@
archive_set_error(&a->archive,
ARCHIVE_ERRNO_MISC,
"Invalid Rockridge CL");
- return (NULL);
+ goto fail;
}
parent->subdirs++;
/* Overwrite an offset and a number of this "CL" entry
@@ -2049,7 +2047,7 @@
archive_set_error(&a->archive,
ARCHIVE_ERRNO_MISC,
"Invalid Rockridge CL");
- return (NULL);
+ goto fail;
}
}
if (file->cl_offset == file->offset ||
@@ -2057,7 +2055,7 @@
archive_set_error(&a->archive,
ARCHIVE_ERRNO_MISC,
"Invalid Rockridge CL");
- return (NULL);
+ goto fail;
}
}
}
@@ -2088,6 +2086,10 @@
#endif
register_file(iso9660, file);
return (file);
+fail:
+ archive_string_free(&file->name);
+ free(file);
+ return (NULL);
}
static int
@@ -2407,7 +2409,7 @@
return (ARCHIVE_FATAL);
} while (heap->cnt &&
heap->reqs[0].offset == iso9660->current_position);
- /* NOTE: Do not move this consume's code to fron of
+ /* NOTE: Do not move this consume's code to front of
* do-while loop. Registration of nested CE extension
* might cause error because of current position. */
__archive_read_consume(a, step);
@@ -2729,7 +2731,7 @@
if (file == NULL) {
/*
* If directory entries all which are descendant of
- * rr_moved are stil remaning, expose their.
+ * rr_moved are still remaining, expose their.
*/
if (iso9660->re_files.first != NULL &&
iso9660->rr_moved != NULL &&
@@ -2852,7 +2854,7 @@
empty_files.last = &empty_files.first;
/* Collect files which has the same file serial number.
* Peek pending_files so that file which number is different
- * is not put bak. */
+ * is not put back. */
while (iso9660->pending_files.used > 0 &&
(iso9660->pending_files.files[0]->number == -1 ||
iso9660->pending_files.files[0]->number == number)) {
@@ -2860,7 +2862,7 @@
/* This file has the same offset
* but it's wrong offset which empty files
* and symlink files have.
- * NOTE: This wrong offse was recorded by
+ * NOTE: This wrong offset was recorded by
* old mkisofs utility. If ISO images is
* created by latest mkisofs, this does not
* happen.
@@ -3019,8 +3021,9 @@
ENOMEM, "Out of memory");
return (ARCHIVE_FATAL);
}
- memcpy(new_pending_files, heap->files,
- heap->allocated * sizeof(new_pending_files[0]));
+ if (heap->allocated)
+ memcpy(new_pending_files, heap->files,
+ heap->allocated * sizeof(new_pending_files[0]));
if (heap->files != NULL)
free(heap->files);
heap->files = new_pending_files;
Modified: trunk/contrib/libarchive/libarchive/archive_read_support_format_lha.c
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_read_support_format_lha.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/archive_read_support_format_lha.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -924,6 +924,9 @@
/* Get a real compressed file size. */
lha->compsize -= extdsize - 2;
+ if (lha->compsize < 0)
+ goto invalid; /* Invalid compressed file size */
+
if (sum_calculated != headersum) {
archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
"LHa header sum error");
@@ -1711,8 +1714,9 @@
*/
for (;len >= 8; len -= 8) {
/* This if statement expects compiler optimization will
- * remove the stament which will not be executed. */
+ * remove the statement which will not be executed. */
#undef bswap16
+#undef bswap16
#if defined(_MSC_VER) && _MSC_VER >= 1400 /* Visual Studio */
# define bswap16(x) _byteswap_ushort(x)
#elif defined(__GNUC__) && ((__GNUC__ == 4 && __GNUC_MINOR__ >= 8) || __GNUC__ > 4)
@@ -2474,7 +2478,7 @@
free(hf->tree);
}
-static char bitlen_tbl[0x400] = {
+static const char bitlen_tbl[0x400] = {
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
Modified: trunk/contrib/libarchive/libarchive/archive_read_support_format_mtree.c
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_read_support_format_mtree.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/archive_read_support_format_mtree.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -75,6 +75,8 @@
#define MTREE_HAS_OPTIONAL 0x0800
#define MTREE_HAS_NOCHANGE 0x1000 /* FreeBSD specific */
+#define MTREE_HASHTABLE_SIZE 1024
+
struct mtree_option {
struct mtree_option *next;
char *value;
@@ -86,6 +88,8 @@
char *name;
char full;
char used;
+ unsigned int name_hash;
+ struct mtree_entry *hashtable_next;
};
struct mtree {
@@ -98,6 +102,7 @@
const char *archive_format_name;
struct mtree_entry *entries;
struct mtree_entry *this_entry;
+ struct mtree_entry *entry_hashtable[MTREE_HASHTABLE_SIZE];
struct archive_string current_dir;
struct archive_string contents_name;
@@ -110,6 +115,7 @@
static int bid_keycmp(const char *, const char *, ssize_t);
static int cleanup(struct archive_read *);
static int detect_form(struct archive_read *, int *);
+static unsigned int hash(const char *);
static int mtree_bid(struct archive_read *, int);
static int parse_file(struct archive_read *, struct archive_entry *,
struct mtree *, struct mtree_entry *, int *);
@@ -124,9 +130,7 @@
static int skip(struct archive_read *a);
static int read_header(struct archive_read *,
struct archive_entry *);
-static int64_t mtree_atol10(char **);
-static int64_t mtree_atol8(char **);
-static int64_t mtree_atol(char **);
+static int64_t mtree_atol(char **, int base);
/*
* There's no standard for TIME_T_MAX/TIME_T_MIN. So we compute them
@@ -223,13 +227,12 @@
archive_check_magic(_a, ARCHIVE_READ_MAGIC,
ARCHIVE_STATE_NEW, "archive_read_support_format_mtree");
- mtree = (struct mtree *)malloc(sizeof(*mtree));
+ mtree = (struct mtree *)calloc(1, sizeof(*mtree));
if (mtree == NULL) {
archive_set_error(&a->archive, ENOMEM,
"Can't allocate mtree data");
return (ARCHIVE_FATAL);
}
- memset(mtree, 0, sizeof(*mtree));
mtree->fd = -1;
r = __archive_read_register_format(a, mtree, "mtree",
@@ -394,28 +397,28 @@
static int
bid_keyword(const char *p, ssize_t len)
{
- static const char *keys_c[] = {
+ static const char * const keys_c[] = {
"content", "contents", "cksum", NULL
};
- static const char *keys_df[] = {
+ static const char * const keys_df[] = {
"device", "flags", NULL
};
- static const char *keys_g[] = {
+ static const char * const keys_g[] = {
"gid", "gname", NULL
};
- static const char *keys_il[] = {
+ static const char * const keys_il[] = {
"ignore", "inode", "link", NULL
};
- static const char *keys_m[] = {
+ static const char * const keys_m[] = {
"md5", "md5digest", "mode", NULL
};
- static const char *keys_no[] = {
+ static const char * const keys_no[] = {
"nlink", "nochange", "optional", NULL
};
- static const char *keys_r[] = {
+ static const char * const keys_r[] = {
"resdevice", "rmd160", "rmd160digest", NULL
};
- static const char *keys_s[] = {
+ static const char * const keys_s[] = {
"sha1", "sha1digest",
"sha256", "sha256digest",
"sha384", "sha384digest",
@@ -422,13 +425,13 @@
"sha512", "sha512digest",
"size", NULL
};
- static const char *keys_t[] = {
+ static const char * const keys_t[] = {
"tags", "time", "type", NULL
};
- static const char *keys_u[] = {
+ static const char * const keys_u[] = {
"uid", "uname", NULL
};
- const char **keys;
+ const char * const *keys;
int i;
switch (*p) {
@@ -710,13 +713,13 @@
}
} else
break;
- } else if (strncmp(p, "/set", 4) == 0) {
+ } else if (len > 4 && strncmp(p, "/set", 4) == 0) {
if (bid_keyword_list(p+4, len-4, 0, 0) <= 0)
break;
/* This line continues. */
if (p[len-nl-1] == '\\')
multiline = 2;
- } else if (strncmp(p, "/unset", 6) == 0) {
+ } else if (len > 6 && strncmp(p, "/unset", 6) == 0) {
if (bid_keyword_list(p+6, len-6, 1, 0) <= 0)
break;
/* This line continues. */
@@ -862,11 +865,12 @@
struct mtree_option **global, const char *line, ssize_t line_len,
struct mtree_entry **last_entry, int is_form_d)
{
- struct mtree_entry *entry;
+ struct mtree_entry *entry, *ht_iter;
struct mtree_option *iter;
const char *next, *eq, *name, *end;
size_t name_len, len;
int r, i;
+ unsigned int ht_idx;
if ((entry = malloc(sizeof(*entry))) == NULL) {
archive_set_error(&a->archive, errno, "Can't allocate memory");
@@ -877,6 +881,8 @@
entry->name = NULL;
entry->used = 0;
entry->full = 0;
+ entry->name_hash = 0;
+ entry->hashtable_next = NULL;
/* Add this entry to list. */
if (*last_entry == NULL)
@@ -929,7 +935,17 @@
memcpy(entry->name, name, name_len);
entry->name[name_len] = '\0';
parse_escapes(entry->name, entry);
+ entry->name_hash = hash(entry->name);
+ ht_idx = entry->name_hash % MTREE_HASHTABLE_SIZE;
+ if ((ht_iter = mtree->entry_hashtable[ht_idx]) != NULL) {
+ while (ht_iter->hashtable_next)
+ ht_iter = ht_iter->hashtable_next;
+ ht_iter->hashtable_next = entry;
+ } else {
+ mtree->entry_hashtable[ht_idx] = entry;
+ }
+
for (iter = *global; iter != NULL; iter = iter->next) {
r = add_option(a, &entry->options, iter->value,
strlen(iter->value));
@@ -1001,11 +1017,11 @@
if (*p != '/') {
r = process_add_entry(a, mtree, &global, p, len,
&last_entry, is_form_d);
- } else if (strncmp(p, "/set", 4) == 0) {
+ } else if (len > 4 && strncmp(p, "/set", 4) == 0) {
if (p[4] != ' ' && p[4] != '\t')
break;
r = process_global_set(a, &global, p);
- } else if (strncmp(p, "/unset", 6) == 0) {
+ } else if (len > 6 && strncmp(p, "/unset", 6) == 0) {
if (p[6] != ' ' && p[6] != '\t')
break;
r = process_global_unset(a, &global, p);
@@ -1122,9 +1138,10 @@
* with pathname canonicalization, which is a very
* tricky subject.)
*/
- for (mp = mentry->next; mp != NULL; mp = mp->next) {
+ for (mp = mentry->hashtable_next; mp != NULL; mp = mp->hashtable_next) {
if (mp->full && !mp->used
- && strcmp(mentry->name, mp->name) == 0) {
+ && mentry->name_hash == mp->name_hash
+ && strcmp(mentry->name, mp->name) == 0) {
/* Later lines override earlier ones. */
mp->used = 1;
r1 = parse_line(a, entry, mtree, mp,
@@ -1399,7 +1416,7 @@
"Too many arguments");
return ARCHIVE_WARN;
}
- numbers[argc++] = (unsigned long)mtree_atol(&p);
+ numbers[argc++] = (unsigned long)mtree_atol(&p, 0);
}
if (argc < 2) {
archive_set_error(a, ARCHIVE_ERRNO_FILE_FORMAT,
@@ -1414,7 +1431,7 @@
}
} else {
/* file system raw value. */
- result = (dev_t)mtree_atol(&val);
+ result = (dev_t)mtree_atol(&val, 0);
}
*pdev = result;
return ARCHIVE_OK;
@@ -1494,7 +1511,7 @@
case 'g':
if (strcmp(key, "gid") == 0) {
*parsed_kws |= MTREE_HAS_GID;
- archive_entry_set_gid(entry, mtree_atol10(&val));
+ archive_entry_set_gid(entry, mtree_atol(&val, 10));
break;
}
if (strcmp(key, "gname") == 0) {
@@ -1504,7 +1521,7 @@
}
case 'i':
if (strcmp(key, "inode") == 0) {
- archive_entry_set_ino(entry, mtree_atol10(&val));
+ archive_entry_set_ino(entry, mtree_atol(&val, 10));
break;
}
case 'l':
@@ -1516,14 +1533,14 @@
if (strcmp(key, "md5") == 0 || strcmp(key, "md5digest") == 0)
break;
if (strcmp(key, "mode") == 0) {
- if (val[0] >= '0' && val[0] <= '9') {
+ if (val[0] >= '0' && val[0] <= '7') {
*parsed_kws |= MTREE_HAS_PERM;
archive_entry_set_perm(entry,
- (mode_t)mtree_atol8(&val));
+ (mode_t)mtree_atol(&val, 8));
} else {
archive_set_error(&a->archive,
ARCHIVE_ERRNO_FILE_FORMAT,
- "Symbolic mode \"%s\" unsupported", val);
+ "Symbolic or non-octal mode \"%s\" unsupported", val);
return ARCHIVE_WARN;
}
break;
@@ -1532,7 +1549,7 @@
if (strcmp(key, "nlink") == 0) {
*parsed_kws |= MTREE_HAS_NLINK;
archive_entry_set_nlink(entry,
- (unsigned int)mtree_atol10(&val));
+ (unsigned int)mtree_atol(&val, 10));
break;
}
case 'r':
@@ -1563,7 +1580,7 @@
strcmp(key, "sha512digest") == 0)
break;
if (strcmp(key, "size") == 0) {
- archive_entry_set_size(entry, mtree_atol10(&val));
+ archive_entry_set_size(entry, mtree_atol(&val, 10));
break;
}
case 't':
@@ -1582,15 +1599,18 @@
long ns = 0;
*parsed_kws |= MTREE_HAS_MTIME;
- m = mtree_atol10(&val);
+ m = mtree_atol(&val, 10);
/* Replicate an old mtree bug:
* 123456789.1 represents 123456789
* seconds and 1 nanosecond. */
if (*val == '.') {
++val;
- ns = (long)mtree_atol10(&val);
- } else
- ns = 0;
+ ns = (long)mtree_atol(&val, 10);
+ if (ns < 0)
+ ns = 0;
+ else if (ns > 999999999)
+ ns = 999999999;
+ }
if (m > my_time_t_max)
m = my_time_t_max;
else if (m < my_time_t_min)
@@ -1648,7 +1668,7 @@
case 'u':
if (strcmp(key, "uid") == 0) {
*parsed_kws |= MTREE_HAS_UID;
- archive_entry_set_uid(entry, mtree_atol10(&val));
+ archive_entry_set_uid(entry, mtree_atol(&val, 10));
break;
}
if (strcmp(key, "uname") == 0) {
@@ -1803,72 +1823,9 @@
*dest = '\0';
}
-/*
- * Note that this implementation does not (and should not!) obey
- * locale settings; you cannot simply substitute strtol here, since
- * it does obey locale.
- */
-static int64_t
-mtree_atol8(char **p)
-{
- int64_t l, limit, last_digit_limit;
- int digit, base;
-
- base = 8;
- limit = INT64_MAX / base;
- last_digit_limit = INT64_MAX % base;
-
- l = 0;
- digit = **p - '0';
- while (digit >= 0 && digit < base) {
- if (l>limit || (l == limit && digit > last_digit_limit)) {
- l = INT64_MAX; /* Truncate on overflow. */
- break;
- }
- l = (l * base) + digit;
- digit = *++(*p) - '0';
- }
- return (l);
-}
-
-/*
- * Note that this implementation does not (and should not!) obey
- * locale settings; you cannot simply substitute strtol here, since
- * it does obey locale.
- */
-static int64_t
-mtree_atol10(char **p)
-{
- int64_t l, limit, last_digit_limit;
- int base, digit, sign;
-
- base = 10;
-
- if (**p == '-') {
- sign = -1;
- limit = ((uint64_t)(INT64_MAX) + 1) / base;
- last_digit_limit = ((uint64_t)(INT64_MAX) + 1) % base;
- ++(*p);
- } else {
- sign = 1;
- limit = INT64_MAX / base;
- last_digit_limit = INT64_MAX % base;
- }
-
- l = 0;
- digit = **p - '0';
- while (digit >= 0 && digit < base) {
- if (l > limit || (l == limit && digit > last_digit_limit))
- return (sign < 0) ? INT64_MIN : INT64_MAX;
- l = (l * base) + digit;
- digit = *++(*p) - '0';
- }
- return (sign < 0) ? -l : l;
-}
-
/* Parse a hex digit. */
static int
-parsehex(char c)
+parsedigit(char c)
{
if (c >= '0' && c <= '9')
return c - '0';
@@ -1886,47 +1843,52 @@
* it does obey locale.
*/
static int64_t
-mtree_atol16(char **p)
+mtree_atol(char **p, int base)
{
- int64_t l, limit, last_digit_limit;
- int base, digit, sign;
+ int64_t l, limit;
+ int digit, last_digit_limit;
- base = 16;
+ if (base == 0) {
+ if (**p != '0')
+ base = 10;
+ else if ((*p)[1] == 'x' || (*p)[1] == 'X') {
+ *p += 2;
+ base = 16;
+ } else {
+ base = 8;
+ }
+ }
if (**p == '-') {
- sign = -1;
- limit = ((uint64_t)(INT64_MAX) + 1) / base;
- last_digit_limit = ((uint64_t)(INT64_MAX) + 1) % base;
+ limit = INT64_MIN / base;
+ last_digit_limit = INT64_MIN % base;
++(*p);
+
+ l = 0;
+ digit = parsedigit(**p);
+ while (digit >= 0 && digit < base) {
+ if (l < limit || (l == limit && digit > last_digit_limit))
+ return INT64_MIN;
+ l = (l * base) - digit;
+ digit = parsedigit(*++(*p));
+ }
+ return l;
} else {
- sign = 1;
limit = INT64_MAX / base;
last_digit_limit = INT64_MAX % base;
- }
- l = 0;
- digit = parsehex(**p);
- while (digit >= 0 && digit < base) {
- if (l > limit || (l == limit && digit > last_digit_limit))
- return (sign < 0) ? INT64_MIN : INT64_MAX;
- l = (l * base) + digit;
- digit = parsehex(*++(*p));
+ l = 0;
+ digit = parsedigit(**p);
+ while (digit >= 0 && digit < base) {
+ if (l > limit || (l == limit && digit > last_digit_limit))
+ return INT64_MAX;
+ l = (l * base) + digit;
+ digit = parsedigit(*++(*p));
+ }
+ return l;
}
- return (sign < 0) ? -l : l;
}
-static int64_t
-mtree_atol(char **p)
-{
- if (**p != '0')
- return mtree_atol10(p);
- if ((*p)[1] == 'x' || (*p)[1] == 'X') {
- *p += 2;
- return mtree_atol16(p);
- }
- return mtree_atol8(p);
-}
-
/*
* Returns length of line (including trailing newline)
* or negative on error. 'start' argument is updated to
@@ -2000,3 +1962,19 @@
find_off = u - mtree->line.s;
}
}
+
+static unsigned int
+hash(const char *p)
+{
+ /* A 32-bit version of Peter Weinberger's (PJW) hash algorithm,
+ as used by ELF for hashing function names. */
+ unsigned g, h = 0;
+ while (*p != '\0') {
+ h = (h << 4) + *p++;
+ if ((g = h & 0xF0000000) != 0) {
+ h ^= g >> 24;
+ h &= 0x0FFFFFFF;
+ }
+ }
+ return h;
+}
Modified: trunk/contrib/libarchive/libarchive/archive_read_support_format_rar.c
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_read_support_format_rar.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/archive_read_support_format_rar.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -647,13 +647,12 @@
archive_check_magic(_a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_NEW,
"archive_read_support_format_rar");
- rar = (struct rar *)malloc(sizeof(*rar));
+ rar = (struct rar *)calloc(sizeof(*rar), 1);
if (rar == NULL)
{
archive_set_error(&a->archive, ENOMEM, "Can't allocate rar data");
return (ARCHIVE_FATAL);
}
- memset(rar, 0, sizeof(*rar));
/*
* Until enough data has been read, we cannot tell about
@@ -907,7 +906,7 @@
sizeof(rar->reserved2));
}
- /* Main header is password encrytped, so we cannot read any
+ /* Main header is password encrypted, so we cannot read any
file names or any other info about files from the header. */
if (rar->main_flags & MHD_PASSWORD)
{
@@ -1751,7 +1750,7 @@
return (-1);
for (j = 0; j < count; j++)
{
- rem = ((*p) << 16) | (rem >> 8);
+ rem = (((unsigned)(unsigned char)*p) << 16) | (rem >> 8);
p++;
}
tm = localtime(&t);
Modified: trunk/contrib/libarchive/libarchive/archive_read_support_format_tar.c
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_read_support_format_tar.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/archive_read_support_format_tar.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -1,6 +1,7 @@
/*-
* Copyright (c) 2003-2007 Tim Kientzle
* Copyright (c) 2011-2012 Michihiro NAKAJIMA
+ * Copyright (c) 2016 Martin Matuska
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -154,6 +155,7 @@
int compat_2x;
int process_mac_extensions;
int read_concatenated_archives;
+ int realsize_override;
};
static int archive_block_is_null(const char *p);
@@ -203,9 +205,14 @@
struct archive_entry *);
static int checksum(struct archive_read *, const void *);
static int pax_attribute(struct archive_read *, struct tar *,
- struct archive_entry *, const char *key, const char *value);
+ struct archive_entry *, const char *key, const char *value,
+ size_t value_length);
+static int pax_attribute_acl(struct archive_read *, struct tar *,
+ struct archive_entry *, const char *, int);
+static int pax_attribute_xattr(struct archive_entry *, const char *,
+ const char *);
static int pax_header(struct archive_read *, struct tar *,
- struct archive_entry *, char *attr);
+ struct archive_entry *, struct archive_string *);
static void pax_time(const char *, int64_t *sec, long *nanos);
static ssize_t readline(struct archive_read *, struct tar *, const char **,
ssize_t limit, size_t *);
@@ -294,6 +301,57 @@
return (ARCHIVE_OK);
}
+/*
+ * Validate number field
+ *
+ * This has to be pretty lenient in order to accommodate the enormous
+ * variety of tar writers in the world:
+ * = POSIX (IEEE Std 1003.1-1988) ustar requires octal values with leading
+ * zeros and allows fields to be terminated with space or null characters
+ * = Many writers use different termination (in particular, libarchive
+ * omits terminator bytes to squeeze one or two more digits)
+ * = Many writers pad with space and omit leading zeros
+ * = GNU tar and star write base-256 values if numbers are too
+ * big to be represented in octal
+ *
+ * Examples of specific tar headers that we should support:
+ * = Perl Archive::Tar terminates uid, gid, devminor and devmajor with two
+ * null bytes, pads size with spaces and other numeric fields with zeroes
+ * = plexus-archiver prior to 2.6.3 (before switching to commons-compress)
+ * may have uid and gid fields filled with spaces without any octal digits
+ * at all and pads all numeric fields with spaces
+ *
+ * This should tolerate all variants in use. It will reject a field
+ * where the writer just left garbage after a trailing NUL.
+ */
+static int
+validate_number_field(const char* p_field, size_t i_size)
+{
+ unsigned char marker = (unsigned char)p_field[0];
+ if (marker == 128 || marker == 255 || marker == 0) {
+ /* Base-256 marker, there's nothing we can check. */
+ return 1;
+ } else {
+ /* Must be octal */
+ size_t i = 0;
+ /* Skip any leading spaces */
+ while (i < i_size && p_field[i] == ' ') {
+ ++i;
+ }
+ /* Skip octal digits. */
+ while (i < i_size && p_field[i] >= '0' && p_field[i] <= '7') {
+ ++i;
+ }
+ /* Any remaining characters must be space or NUL padding. */
+ while (i < i_size) {
+ if (p_field[i] != ' ' && p_field[i] != 0) {
+ return 0;
+ }
+ ++i;
+ }
+ return 1;
+ }
+}
static int
archive_read_format_tar_bid(struct archive_read *a, int best_bid)
@@ -346,23 +404,19 @@
return (0);
bid += 2; /* 6 bits of variation in an 8-bit field leaves 2 bits. */
- /* Sanity check: Look at first byte of mode field. */
- switch (255 & (unsigned)header->mode[0]) {
- case 0: case 255:
- /* Base-256 value: No further verification possible! */
- break;
- case ' ': /* Not recommended, but not illegal, either. */
- break;
- case '0': case '1': case '2': case '3':
- case '4': case '5': case '6': case '7':
- /* Octal Value. */
- /* TODO: Check format of remainder of this field. */
- break;
- default:
- /* Not a valid mode; bail out here. */
- return (0);
+ /*
+ * Check format of mode/uid/gid/mtime/size/rdevmajor/rdevminor fields.
+ */
+ if (bid > 0 && (
+ validate_number_field(header->mode, sizeof(header->mode)) == 0
+ || validate_number_field(header->uid, sizeof(header->uid)) == 0
+ || validate_number_field(header->gid, sizeof(header->gid)) == 0
+ || validate_number_field(header->mtime, sizeof(header->mtime)) == 0
+ || validate_number_field(header->size, sizeof(header->size)) == 0
+ || validate_number_field(header->rdevmajor, sizeof(header->rdevmajor)) == 0
+ || validate_number_field(header->rdevminor, sizeof(header->rdevminor)) == 0)) {
+ bid = 0;
}
- /* TODO: Sanity test uid/gid/size/mtime/rdevmajor/rdevminor fields. */
return (bid);
}
@@ -376,7 +430,7 @@
tar = (struct tar *)(a->format->data);
if (strcmp(key, "compat-2x") == 0) {
- /* Handle UTF-8 filnames as libarchive 2.x */
+ /* Handle UTF-8 filenames as libarchive 2.x */
tar->compat_2x = (val != NULL && val[0] != 0);
tar->init_default_conversion = tar->compat_2x;
return (ARCHIVE_OK);
@@ -474,6 +528,7 @@
tar->entry_offset = 0;
gnu_clear_sparse_list(tar);
tar->realsize = -1; /* Mark this as "unset" */
+ tar->realsize_override = 0;
/* Setup default string conversion. */
tar->sconv = tar->opt_sconv;
@@ -794,9 +849,9 @@
tar->sparse_gnu_pending = 0;
/* Read initial sparse map. */
bytes_read = gnu_sparse_10_read(a, tar, unconsumed);
- tar->entry_bytes_remaining -= bytes_read;
if (bytes_read < 0)
return ((int)bytes_read);
+ tar->entry_bytes_remaining -= bytes_read;
} else {
archive_set_error(&a->archive,
ARCHIVE_ERRNO_MISC,
@@ -891,7 +946,7 @@
{
const struct archive_entry_header_ustar *header;
size_t size;
- int err;
+ int err, acl_type;
int64_t type;
char *acl, *p;
@@ -936,11 +991,12 @@
switch ((int)type & ~0777777) {
case 01000000:
/* POSIX.1e ACL */
+ acl_type = ARCHIVE_ENTRY_ACL_TYPE_ACCESS;
break;
case 03000000:
- archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
- "Solaris NFSv4 ACLs not supported");
- return (ARCHIVE_WARN);
+ /* NFSv4 ACL */
+ acl_type = ARCHIVE_ENTRY_ACL_TYPE_NFS4;
+ break;
default:
archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
"Malformed Solaris ACL attribute (unsupported type %o)",
@@ -969,8 +1025,8 @@
return (ARCHIVE_FATAL);
}
archive_strncpy(&(tar->localname), acl, p - acl);
- err = archive_acl_parse_l(archive_entry_acl(entry),
- tar->localname.s, ARCHIVE_ENTRY_ACL_TYPE_ACCESS, tar->sconv_acl);
+ err = archive_acl_from_text_l(archive_entry_acl(entry),
+ tar->localname.s, acl_type, tar->sconv_acl);
if (err != ARCHIVE_OK) {
if (errno == ENOMEM) {
archive_set_error(&a->archive, ENOMEM,
@@ -1431,7 +1487,7 @@
* and then skip any fields in the standard header that were
* defined in the pax header.
*/
- err2 = pax_header(a, tar, entry, tar->pax_header.s);
+ err2 = pax_header(a, tar, entry, &tar->pax_header);
err = err_combine(err, err2);
tar->entry_padding = 0x1ff & (-tar->entry_bytes_remaining);
return (err);
@@ -1512,16 +1568,17 @@
*/
static int
pax_header(struct archive_read *a, struct tar *tar,
- struct archive_entry *entry, char *attr)
+ struct archive_entry *entry, struct archive_string *in_as)
{
- size_t attr_length, l, line_length;
+ size_t attr_length, l, line_length, value_length;
char *p;
char *key, *value;
struct archive_string *as;
struct archive_string_conv *sconv;
int err, err2;
+ char *attr = in_as->s;
- attr_length = strlen(attr);
+ attr_length = in_as->length;
tar->pax_hdrcharset_binary = 0;
archive_string_empty(&(tar->entry_gname));
archive_string_empty(&(tar->entry_linkpath));
@@ -1586,11 +1643,13 @@
}
*p = '\0';
- /* Identify null-terminated 'value' portion. */
value = p + 1;
+ /* Some values may be binary data */
+ value_length = attr + line_length - 1 - value;
+
/* Identify this attribute and set it in the entry. */
- err2 = pax_attribute(a, tar, entry, key, value);
+ err2 = pax_attribute(a, tar, entry, key, value, value_length);
if (err2 == ARCHIVE_FATAL)
return (err2);
err = err_combine(err, err2);
@@ -1711,6 +1770,66 @@
return 0;
}
+static int
+pax_attribute_schily_xattr(struct archive_entry *entry,
+ const char *name, const char *value, size_t value_length)
+{
+ if (strlen(name) < 14 || (memcmp(name, "SCHILY.xattr.", 13)) != 0)
+ return 1;
+
+ name += 13;
+
+ archive_entry_xattr_add_entry(entry, name, value, value_length);
+
+ return 0;
+}
+
+static int
+pax_attribute_acl(struct archive_read *a, struct tar *tar,
+ struct archive_entry *entry, const char *value, int type)
+{
+ int r;
+ const char* errstr;
+
+ switch (type) {
+ case ARCHIVE_ENTRY_ACL_TYPE_ACCESS:
+ errstr = "SCHILY.acl.access";
+ break;
+ case ARCHIVE_ENTRY_ACL_TYPE_DEFAULT:
+ errstr = "SCHILY.acl.default";
+ break;
+ case ARCHIVE_ENTRY_ACL_TYPE_NFS4:
+ errstr = "SCHILY.acl.ace";
+ break;
+ default:
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
+ "Unknown ACL type: %d", type);
+ return(ARCHIVE_FATAL);
+ }
+
+ if (tar->sconv_acl == NULL) {
+ tar->sconv_acl =
+ archive_string_conversion_from_charset(
+ &(a->archive), "UTF-8", 1);
+ if (tar->sconv_acl == NULL)
+ return (ARCHIVE_FATAL);
+ }
+
+ r = archive_acl_from_text_l(archive_entry_acl(entry), value, type,
+ tar->sconv_acl);
+ if (r != ARCHIVE_OK) {
+ if (r == ARCHIVE_FATAL) {
+ archive_set_error(&a->archive, ENOMEM,
+ "%s %s", "Can't allocate memory for ",
+ errstr);
+ return (r);
+ }
+ archive_set_error(&a->archive,
+ ARCHIVE_ERRNO_MISC, "%s %s", "Parse error: ", errstr);
+ }
+ return (r);
+}
+
/*
* Parse a single key=value attribute. key/value pointers are
* assumed to point into reasonably long-lived storage.
@@ -1726,7 +1845,7 @@
*/
static int
pax_attribute(struct archive_read *a, struct tar *tar,
- struct archive_entry *entry, const char *key, const char *value)
+ struct archive_entry *entry, const char *key, const char *value, size_t value_length)
{
int64_t s;
long n;
@@ -1779,6 +1898,7 @@
if (strcmp(key, "GNU.sparse.size") == 0) {
tar->realsize = tar_atol10(value, strlen(value));
archive_entry_set_size(entry, tar->realsize);
+ tar->realsize_override = 1;
}
/* GNU "0.1" sparse pax format. */
@@ -1810,6 +1930,7 @@
if (strcmp(key, "GNU.sparse.realsize") == 0) {
tar->realsize = tar_atol10(value, strlen(value));
archive_entry_set_size(entry, tar->realsize);
+ tar->realsize_override = 1;
}
break;
case 'L':
@@ -1829,53 +1950,20 @@
case 'S':
/* We support some keys used by the "star" archiver */
if (strcmp(key, "SCHILY.acl.access") == 0) {
- if (tar->sconv_acl == NULL) {
- tar->sconv_acl =
- archive_string_conversion_from_charset(
- &(a->archive), "UTF-8", 1);
- if (tar->sconv_acl == NULL)
- return (ARCHIVE_FATAL);
- }
-
- r = archive_acl_parse_l(archive_entry_acl(entry),
- value, ARCHIVE_ENTRY_ACL_TYPE_ACCESS,
- tar->sconv_acl);
- if (r != ARCHIVE_OK) {
- err = r;
- if (err == ARCHIVE_FATAL) {
- archive_set_error(&a->archive, ENOMEM,
- "Can't allocate memory for "
- "SCHILY.acl.access");
- return (err);
- }
- archive_set_error(&a->archive,
- ARCHIVE_ERRNO_MISC,
- "Parse error: SCHILY.acl.access");
- }
+ r = pax_attribute_acl(a, tar, entry, value,
+ ARCHIVE_ENTRY_ACL_TYPE_ACCESS);
+ if (r == ARCHIVE_FATAL)
+ return (r);
} else if (strcmp(key, "SCHILY.acl.default") == 0) {
- if (tar->sconv_acl == NULL) {
- tar->sconv_acl =
- archive_string_conversion_from_charset(
- &(a->archive), "UTF-8", 1);
- if (tar->sconv_acl == NULL)
- return (ARCHIVE_FATAL);
- }
-
- r = archive_acl_parse_l(archive_entry_acl(entry),
- value, ARCHIVE_ENTRY_ACL_TYPE_DEFAULT,
- tar->sconv_acl);
- if (r != ARCHIVE_OK) {
- err = r;
- if (err == ARCHIVE_FATAL) {
- archive_set_error(&a->archive, ENOMEM,
- "Can't allocate memory for "
- "SCHILY.acl.default");
- return (err);
- }
- archive_set_error(&a->archive,
- ARCHIVE_ERRNO_MISC,
- "Parse error: SCHILY.acl.default");
- }
+ r = pax_attribute_acl(a, tar, entry, value,
+ ARCHIVE_ENTRY_ACL_TYPE_DEFAULT);
+ if (r == ARCHIVE_FATAL)
+ return (r);
+ } else if (strcmp(key, "SCHILY.acl.ace") == 0) {
+ r = pax_attribute_acl(a, tar, entry, value,
+ ARCHIVE_ENTRY_ACL_TYPE_NFS4);
+ if (r == ARCHIVE_FATAL)
+ return (r);
} else if (strcmp(key, "SCHILY.devmajor") == 0) {
archive_entry_set_rdevmajor(entry,
(dev_t)tar_atol10(value, strlen(value)));
@@ -1895,7 +1983,11 @@
tar_atol10(value, strlen(value)));
} else if (strcmp(key, "SCHILY.realsize") == 0) {
tar->realsize = tar_atol10(value, strlen(value));
+ tar->realsize_override = 1;
archive_entry_set_size(entry, tar->realsize);
+ } else if (strncmp(key, "SCHILY.xattr.", 13) == 0) {
+ pax_attribute_schily_xattr(entry, key, value,
+ value_length);
} else if (strcmp(key, "SUN.holesdata") == 0) {
/* A Solaris extension for sparse. */
r = solaris_sparse_parse(a, tar, entry, value);
@@ -1970,14 +2062,12 @@
tar->entry_bytes_remaining
= tar_atol10(value, strlen(value));
/*
- * But, "size" is not necessarily the size of
- * the file on disk; if this is a sparse file,
- * the disk size may have already been set from
- * GNU.sparse.realsize or GNU.sparse.size or
- * an old GNU header field or SCHILY.realsize
- * or ....
+ * The "size" pax header keyword always overrides the
+ * "size" field in the tar header.
+ * GNU.sparse.realsize, GNU.sparse.size and
+ * SCHILY.realsize override this value.
*/
- if (tar->realsize < 0) {
+ if (!tar->realsize_override) {
archive_entry_set_size(entry,
tar->entry_bytes_remaining);
tar->realsize
@@ -2121,6 +2211,7 @@
tar->realsize
= tar_atol(header->realsize, sizeof(header->realsize));
archive_entry_set_size(entry, tar->realsize);
+ tar->realsize_override = 1;
}
if (header->sparse[0].offset[0] != 0) {
@@ -2142,12 +2233,11 @@
{
struct sparse_block *p;
- p = (struct sparse_block *)malloc(sizeof(*p));
+ p = (struct sparse_block *)calloc(1, sizeof(*p));
if (p == NULL) {
archive_set_error(&a->archive, ENOMEM, "Out of memory");
return (ARCHIVE_FATAL);
}
- memset(p, 0, sizeof(*p));
if (tar->sparse_last != NULL)
tar->sparse_last->next = p;
else
@@ -2403,6 +2493,9 @@
tar_flush_unconsumed(a, unconsumed);
bytes_read = (ssize_t)(tar->entry_bytes_remaining - remaining);
to_skip = 0x1ff & -bytes_read;
+ /* Fail if tar->entry_bytes_remaing would get negative */
+ if (to_skip > remaining)
+ return (ARCHIVE_FATAL);
if (to_skip != __archive_read_consume(a, to_skip))
return (ARCHIVE_FATAL);
return ((ssize_t)(bytes_read + to_skip));
@@ -2498,7 +2591,7 @@
last_digit_limit = INT64_MAX % base;
/* the pointer will not be dereferenced if char_cnt is zero
- * due to the way the && operator is evaulated.
+ * due to the way the && operator is evaluated.
*/
while (char_cnt != 0 && (*p == ' ' || *p == '\t')) {
p++;
Modified: trunk/contrib/libarchive/libarchive/archive_read_support_format_warc.c
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_read_support_format_warc.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/archive_read_support_format_warc.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -88,7 +88,7 @@
WT_RVIS,
/* conversion, unsupported */
WT_CONV,
- /* continutation, unsupported at the moment */
+ /* continuation, unsupported at the moment */
WT_CONT,
/* invalid type */
LAST_WT
@@ -134,8 +134,8 @@
static time_t _warc_rdrtm(const char *buf, size_t bsz);
static time_t _warc_rdmtm(const char *buf, size_t bsz);
static const char *_warc_find_eoh(const char *buf, size_t bsz);
+static const char *_warc_find_eol(const char *buf, size_t bsz);
-
int
archive_read_support_format_warc(struct archive *_a)
{
@@ -146,12 +146,11 @@
archive_check_magic(_a, ARCHIVE_READ_MAGIC,
ARCHIVE_STATE_NEW, "archive_read_support_format_warc");
- if ((w = malloc(sizeof(*w))) == NULL) {
+ if ((w = calloc(1, sizeof(*w))) == NULL) {
archive_set_error(&a->archive, ENOMEM,
"Can't allocate warc data");
return (ARCHIVE_FATAL);
}
- memset(w, 0, sizeof(*w));
r = __archive_read_register_format(
a, w, "warc",
@@ -199,8 +198,8 @@
/* otherwise snarf the record's version number */
ver = _warc_rdver(hdr, nrd);
- if (ver == 0U || ver > 10000U) {
- /* oh oh oh, best not to wager ... */
+ if (ver < 1200U || ver > 10000U) {
+ /* we only support WARC 0.12 to 1.0 */
return -1;
}
@@ -255,16 +254,23 @@
&a->archive, ARCHIVE_ERRNO_MISC,
"Bad record header");
return (ARCHIVE_FATAL);
- } else if ((ver = _warc_rdver(buf, eoh - buf)) > 10000U) {
- /* nawww, I wish they promised backward compatibility
- * anyhoo, in their infinite wisdom the 28500 guys might
- * come up with something we can't possibly handle so
- * best end things here */
+ }
+ ver = _warc_rdver(buf, eoh - buf);
+ /* we currently support WARC 0.12 to 1.0 */
+ if (ver == 0U) {
archive_set_error(
&a->archive, ARCHIVE_ERRNO_MISC,
- "Unsupported record version");
+ "Invalid record version");
return (ARCHIVE_FATAL);
- } else if ((cntlen = _warc_rdlen(buf, eoh - buf)) < 0) {
+ } else if (ver < 1200U || ver > 10000U) {
+ archive_set_error(
+ &a->archive, ARCHIVE_ERRNO_MISC,
+ "Unsupported record version: %u.%u",
+ ver / 10000, (ver % 10000) / 100);
+ return (ARCHIVE_FATAL);
+ }
+ cntlen = _warc_rdlen(buf, eoh - buf);
+ if (cntlen < 0) {
/* nightmare! the specs say content-length is mandatory
* so I don't feel overly bad stopping the reader here */
archive_set_error(
@@ -271,7 +277,9 @@
&a->archive, EINVAL,
"Bad content length");
return (ARCHIVE_FATAL);
- } else if ((rtime = _warc_rdrtm(buf, eoh - buf)) == (time_t)-1) {
+ }
+ rtime = _warc_rdrtm(buf, eoh - buf);
+ if (rtime == (time_t)-1) {
/* record time is mandatory as per WARC/1.0,
* so just barf here, fast and loud */
archive_set_error(
@@ -285,7 +293,7 @@
if (ver != w->pver) {
/* stringify this entry's version */
archive_string_sprintf(&w->sver,
- "WARC/%u.%u", ver / 10000, ver % 10000);
+ "WARC/%u.%u", ver / 10000, (ver % 10000) / 100);
/* remember the version */
w->pver = ver;
}
@@ -535,7 +543,7 @@
/* as a courtesy to our callers, and since this is a non-standard
* routine, we skip leading whitespace */
- while (isspace((unsigned char)*s))
+ while (*s == ' ' || *s == '\t')
++s;
/* read year */
@@ -563,7 +571,7 @@
goto out;
}
- /* massage TM to fulfill some of POSIX' contraints */
+ /* massage TM to fulfill some of POSIX' constraints */
tm.tm_year -= 1900;
tm.tm_mon--;
@@ -578,51 +586,44 @@
}
static unsigned int
-_warc_rdver(const char buf[10], size_t bsz)
+_warc_rdver(const char *buf, size_t bsz)
{
static const char magic[] = "WARC/";
- unsigned int ver;
+ const char *c;
+ unsigned int ver = 0U;
+ unsigned int end = 0U;
- (void)bsz; /* UNUSED */
-
- if (memcmp(buf, magic, sizeof(magic) - 1U) != 0) {
- /* nope */
- return 99999U;
+ if (bsz < 12 || memcmp(buf, magic, sizeof(magic) - 1U) != 0) {
+ /* buffer too small or invalid magic */
+ return ver;
}
/* looks good so far, read the version number for a laugh */
buf += sizeof(magic) - 1U;
- /* most common case gets a quick-check here */
- if (memcmp(buf, "1.0\r\n", 5U) == 0) {
- ver = 10000U;
- } else {
- switch (*buf) {
- case '0':
- case '1':
- case '2':
- case '3':
- case '4':
- case '5':
- case '6':
- case '7':
- case '8':
- if (buf[1U] == '.') {
- char *on;
- /* set up major version */
- ver = (buf[0U] - '0') * 10000U;
- /* minor version, anyone? */
- ver += (strtol(buf + 2U, &on, 10)) * 100U;
- /* don't parse anything else */
- if (on > buf + 2U) {
- break;
- }
- }
- /* FALLTHROUGH */
- case '9':
- default:
- /* just make the version ridiculously high */
- ver = 999999U;
- break;
+ if (isdigit((unsigned char)buf[0U]) && (buf[1U] == '.') &&
+ isdigit((unsigned char)buf[2U])) {
+ /* we support a maximum of 2 digits in the minor version */
+ if (isdigit((unsigned char)buf[3U]))
+ end = 1U;
+ /* set up major version */
+ ver = (buf[0U] - '0') * 10000U;
+ /* set up minor version */
+ if (end == 1U) {
+ ver += (buf[2U] - '0') * 1000U;
+ ver += (buf[3U] - '0') * 100U;
+ } else
+ ver += (buf[2U] - '0') * 100U;
+ /*
+ * WARC below version 0.12 has a space-separated header
+ * WARC 0.12 and above terminates the version with a CRLF
+ */
+ c = buf + 3U + end;
+ if (ver >= 1200U) {
+ if (memcmp(c, "\r\n", 2U) != 0)
+ ver = 0U;
+ } else if (ver < 1200U) {
+ if (*c != ' ' && *c != '\t')
+ ver = 0U;
}
}
return ver;
@@ -632,34 +633,27 @@
_warc_rdtyp(const char *buf, size_t bsz)
{
static const char _key[] = "\r\nWARC-Type:";
- const char *const eob = buf + bsz;
- const char *val;
+ const char *val, *eol;
if ((val = xmemmem(buf, bsz, _key, sizeof(_key) - 1U)) == NULL) {
/* no bother */
return WT_NONE;
}
+ val += sizeof(_key) - 1U;
+ if ((eol = _warc_find_eol(val, buf + bsz - val)) == NULL) {
+ /* no end of line */
+ return WT_NONE;
+ }
+
/* overread whitespace */
- val += sizeof(_key) - 1U;
- while (val < eob && isspace((unsigned char)*val))
+ while (val < eol && (*val == ' ' || *val == '\t'))
++val;
- if (val + 8U > eob) {
- ;
- } else if (memcmp(val, "resource", 8U) == 0) {
- return WT_RSRC;
- } else if (memcmp(val, "warcinfo", 8U) == 0) {
- return WT_INFO;
- } else if (memcmp(val, "metadata", 8U) == 0) {
- return WT_META;
- } else if (memcmp(val, "request", 7U) == 0) {
- return WT_REQ;
- } else if (memcmp(val, "response", 8U) == 0) {
- return WT_RSP;
- } else if (memcmp(val, "conversi", 8U) == 0) {
- return WT_CONV;
- } else if (memcmp(val, "continua", 8U) == 0) {
- return WT_CONT;
+ if (val + 8U == eol) {
+ if (memcmp(val, "resource", 8U) == 0)
+ return WT_RSRC;
+ else if (memcmp(val, "response", 8U) == 0)
+ return WT_RSP;
}
return WT_NONE;
}
@@ -668,10 +662,7 @@
_warc_rduri(const char *buf, size_t bsz)
{
static const char _key[] = "\r\nWARC-Target-URI:";
- const char *const eob = buf + bsz;
- const char *val;
- const char *uri;
- const char *eol;
+ const char *val, *uri, *eol, *p;
warc_string_t res = {0U, NULL};
if ((val = xmemmem(buf, bsz, _key, sizeof(_key) - 1U)) == NULL) {
@@ -680,25 +671,32 @@
}
/* overread whitespace */
val += sizeof(_key) - 1U;
- while (val < eob && isspace((unsigned char)*val))
+ if ((eol = _warc_find_eol(val, buf + bsz - val)) == NULL) {
+ /* no end of line */
+ return res;
+ }
+
+ while (val < eol && (*val == ' ' || *val == '\t'))
++val;
/* overread URL designators */
- if ((uri = xmemmem(val, eob - val, "://", 3U)) == NULL) {
+ if ((uri = xmemmem(val, eol - val, "://", 3U)) == NULL) {
/* not touching that! */
return res;
- } else if ((eol = memchr(uri, '\n', eob - uri)) == NULL) {
- /* no end of line? :O */
- return res;
}
- /* massage uri to point to after :// */
+ /* spaces inside uri are not allowed, CRLF should follow */
+ for (p = val; p < eol; p++) {
+ if (isspace((unsigned char)*p))
+ return res;
+ }
+
+ /* there must be at least space for ftp */
+ if (uri < (val + 3U))
+ return res;
+
+ /* move uri to point to after :// */
uri += 3U;
- /* also massage eol to point to the first whitespace
- * after the last non-whitespace character before
- * the end of the line */
- while (eol > uri && isspace((unsigned char)eol[-1]))
- --eol;
/* now then, inspect the URI */
if (memcmp(val, "file", 4U) == 0) {
@@ -721,7 +719,7 @@
_warc_rdlen(const char *buf, size_t bsz)
{
static const char _key[] = "\r\nContent-Length:";
- const char *val;
+ const char *val, *eol;
char *on = NULL;
long int len;
@@ -729,14 +727,24 @@
/* no bother */
return -1;
}
+ val += sizeof(_key) - 1U;
+ if ((eol = _warc_find_eol(val, buf + bsz - val)) == NULL) {
+ /* no end of line */
+ return -1;
+ }
- /* strtol kindly overreads whitespace for us, so use that */
- val += sizeof(_key) - 1U;
+ /* skip leading whitespace */
+ while (val < eol && (*val == ' ' || *val == '\t'))
+ val++;
+ /* there must be at least one digit */
+ if (!isdigit((unsigned char)*val))
+ return -1;
len = strtol(val, &on, 10);
- if (on == NULL || !isspace((unsigned char)*on)) {
- /* hm, can we trust that number? Best not. */
+ if (on != eol) {
+ /* line must end here */
return -1;
}
+
return (size_t)len;
}
@@ -744,7 +752,7 @@
_warc_rdrtm(const char *buf, size_t bsz)
{
static const char _key[] = "\r\nWARC-Date:";
- const char *val;
+ const char *val, *eol;
char *on = NULL;
time_t res;
@@ -752,13 +760,17 @@
/* no bother */
return (time_t)-1;
}
+ val += sizeof(_key) - 1U;
+ if ((eol = _warc_find_eol(val, buf + bsz - val)) == NULL ) {
+ /* no end of line */
+ return -1;
+ }
/* xstrpisotime() kindly overreads whitespace for us, so use that */
- val += sizeof(_key) - 1U;
res = xstrpisotime(val, &on);
- if (on == NULL || !isspace((unsigned char)*on)) {
- /* hm, can we trust that number? Best not. */
- return (time_t)-1;
+ if (on != eol) {
+ /* line must end here */
+ return -1;
}
return res;
}
@@ -767,7 +779,7 @@
_warc_rdmtm(const char *buf, size_t bsz)
{
static const char _key[] = "\r\nLast-Modified:";
- const char *val;
+ const char *val, *eol;
char *on = NULL;
time_t res;
@@ -775,13 +787,17 @@
/* no bother */
return (time_t)-1;
}
+ val += sizeof(_key) - 1U;
+ if ((eol = _warc_find_eol(val, buf + bsz - val)) == NULL ) {
+ /* no end of line */
+ return -1;
+ }
/* xstrpisotime() kindly overreads whitespace for us, so use that */
- val += sizeof(_key) - 1U;
res = xstrpisotime(val, &on);
- if (on == NULL || !isspace((unsigned char)*on)) {
- /* hm, can we trust that number? Best not. */
- return (time_t)-1;
+ if (on != eol) {
+ /* line must end here */
+ return -1;
}
return res;
}
@@ -798,4 +814,12 @@
return hit;
}
+static const char*
+_warc_find_eol(const char *buf, size_t bsz)
+{
+ static const char _marker[] = "\r\n";
+ const char *hit = xmemmem(buf, bsz, _marker, sizeof(_marker) - 1U);
+
+ return hit;
+}
/* archive_read_support_format_warc.c ends here */
Modified: trunk/contrib/libarchive/libarchive/archive_read_support_format_xar.c
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_read_support_format_xar.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/archive_read_support_format_xar.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -43,8 +43,6 @@
#endif
#if HAVE_LZMA_H
#include <lzma.h>
-#elif HAVE_LZMADEC_H
-#include <lzmadec.h>
#endif
#ifdef HAVE_ZLIB_H
#include <zlib.h>
@@ -334,9 +332,6 @@
#if HAVE_LZMA_H && HAVE_LIBLZMA
lzma_stream lzstream;
int lzstream_valid;
-#elif HAVE_LZMADEC_H && HAVE_LIBLZMADEC
- lzmadec_stream lzstream;
- int lzstream_valid;
#endif
/*
* For Checksum data.
@@ -399,6 +394,7 @@
size_t, const void *, size_t);
static int checksum_final(struct archive_read *, const void *,
size_t, const void *, size_t);
+static void checksum_cleanup(struct archive_read *);
static int decompression_init(struct archive_read *, enum enctype);
static int decompress(struct archive_read *, const void **,
size_t *, const void *, size_t *);
@@ -928,6 +924,7 @@
int r;
xar = (struct xar *)(a->format->data);
+ checksum_cleanup(a);
r = decompression_cleanup(a);
hdlink = xar->hdlink_list;
while (hdlink != NULL) {
@@ -938,6 +935,7 @@
}
for (i = 0; i < xar->file_queue.used; i++)
file_free(xar->file_queue.files[i]);
+ free(xar->file_queue.files);
while (xar->unknowntags != NULL) {
struct unknown_tag *tag;
@@ -1526,34 +1524,6 @@
xar->lzstream.total_in = 0;
xar->lzstream.total_out = 0;
break;
-#elif defined(HAVE_LZMADEC_H) && defined(HAVE_LIBLZMADEC)
- case LZMA:
- if (xar->lzstream_valid)
- lzmadec_end(&(xar->lzstream));
- r = lzmadec_init(&(xar->lzstream));
- if (r != LZMADEC_OK) {
- switch (r) {
- case LZMADEC_HEADER_ERROR:
- archive_set_error(&a->archive,
- ARCHIVE_ERRNO_MISC,
- "Internal error initializing "
- "compression library: "
- "invalid header");
- break;
- case LZMADEC_MEM_ERROR:
- archive_set_error(&a->archive,
- ENOMEM,
- "Internal error initializing "
- "compression library: "
- "out of memory");
- break;
- }
- return (ARCHIVE_FATAL);
- }
- xar->lzstream_valid = 1;
- xar->lzstream.total_in = 0;
- xar->lzstream.total_out = 0;
- break;
#endif
/*
* Unsupported compression.
@@ -1563,9 +1533,7 @@
case BZIP2:
#endif
#if !defined(HAVE_LZMA_H) || !defined(HAVE_LIBLZMA)
-#if !defined(HAVE_LZMADEC_H) || !defined(HAVE_LIBLZMADEC)
case LZMA:
-#endif
case XZ:
#endif
switch (xar->entry_encoding) {
@@ -1685,46 +1653,12 @@
*used = avail_in - xar->lzstream.avail_in;
*outbytes = avail_out - xar->lzstream.avail_out;
break;
-#elif defined(HAVE_LZMADEC_H) && defined(HAVE_LIBLZMADEC)
- case LZMA:
- xar->lzstream.next_in = (unsigned char *)(uintptr_t)b;
- xar->lzstream.avail_in = avail_in;
- xar->lzstream.next_out = (unsigned char *)outbuff;
- xar->lzstream.avail_out = avail_out;
- r = lzmadec_decode(&(xar->lzstream), 0);
- switch (r) {
- case LZMADEC_STREAM_END: /* Found end of stream. */
- switch (lzmadec_end(&(xar->lzstream))) {
- case LZMADEC_OK:
- break;
- default:
- archive_set_error(&(a->archive),
- ARCHIVE_ERRNO_MISC,
- "Failed to clean up lzmadec decompressor");
- return (ARCHIVE_FATAL);
- }
- xar->lzstream_valid = 0;
- /* FALLTHROUGH */
- case LZMADEC_OK: /* Decompressor made some progress. */
- break;
- default:
- archive_set_error(&(a->archive),
- ARCHIVE_ERRNO_MISC,
- "lzmadec decompression failed(%d)",
- r);
- return (ARCHIVE_FATAL);
- }
- *used = avail_in - xar->lzstream.avail_in;
- *outbytes = avail_out - xar->lzstream.avail_out;
- break;
#endif
#if !defined(HAVE_BZLIB_H) || !defined(BZ_CONFIG_ERROR)
case BZIP2:
#endif
#if !defined(HAVE_LZMA_H) || !defined(HAVE_LIBLZMA)
-#if !defined(HAVE_LZMADEC_H) || !defined(HAVE_LIBLZMADEC)
case LZMA:
-#endif
case XZ:
#endif
case NONE:
@@ -1788,6 +1722,16 @@
}
static void
+checksum_cleanup(struct archive_read *a) {
+ struct xar *xar;
+
+ xar = (struct xar *)(a->format->data);
+
+ _checksum_final(&(xar->a_sumwrk), NULL, 0);
+ _checksum_final(&(xar->e_sumwrk), NULL, 0);
+}
+
+static void
xmlattr_cleanup(struct xmlattr_list *list)
{
struct xmlattr *attr, *next;
@@ -3116,7 +3060,7 @@
struct xar *xar;
const void *d;
size_t outbytes;
- size_t used;
+ size_t used = 0;
int r;
a = (struct archive_read *)context;
@@ -3240,6 +3184,9 @@
value = strdup(atts[1]);
if (attr == NULL || name == NULL || value == NULL) {
archive_set_error(&a->archive, ENOMEM, "Out of memory");
+ free(attr);
+ free(name);
+ free(value);
return (ARCHIVE_FATAL);
}
attr->name = name;
Modified: trunk/contrib/libarchive/libarchive/archive_read_support_format_zip.c
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_read_support_format_zip.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/archive_read_support_format_zip.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -199,7 +199,7 @@
struct trad_enc_ctx tctx;
char tctx_valid;
- /* WinZip AES decyption. */
+ /* WinZip AES decryption. */
/* Contexts used for AES decryption. */
archive_crypto_ctx cctx;
char cctx_valid;
@@ -242,7 +242,7 @@
}
static uint8_t
-trad_enc_decypt_byte(struct trad_enc_ctx *ctx)
+trad_enc_decrypt_byte(struct trad_enc_ctx *ctx)
{
unsigned temp = ctx->keys[2] | 2;
return (uint8_t)((temp * (temp ^ 1)) >> 8) & 0xff;
@@ -257,7 +257,7 @@
max = (unsigned)((in_len < out_len)? in_len: out_len);
for (i = 0; i < max; i++) {
- uint8_t t = in[i] ^ trad_enc_decypt_byte(ctx);
+ uint8_t t = in[i] ^ trad_enc_decrypt_byte(ctx);
out[i] = t;
trad_enc_update_keys(ctx, t);
}
@@ -347,7 +347,7 @@
return 0;
}
-static struct {
+static const struct {
int id;
const char * name;
} compression_methods[] = {
@@ -452,26 +452,38 @@
/* Zip64 extended information extra field. */
zip_entry->flags |= LA_USED_ZIP64;
if (zip_entry->uncompressed_size == 0xffffffff) {
- if (datasize < 8)
- break;
- zip_entry->uncompressed_size =
- archive_le64dec(p + offset);
+ uint64_t t = 0;
+ if (datasize < 8
+ || (t = archive_le64dec(p + offset)) > INT64_MAX) {
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
+ "Malformed 64-bit uncompressed size");
+ return ARCHIVE_FAILED;
+ }
+ zip_entry->uncompressed_size = t;
offset += 8;
datasize -= 8;
}
if (zip_entry->compressed_size == 0xffffffff) {
- if (datasize < 8)
- break;
- zip_entry->compressed_size =
- archive_le64dec(p + offset);
+ uint64_t t = 0;
+ if (datasize < 8
+ || (t = archive_le64dec(p + offset)) > INT64_MAX) {
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
+ "Malformed 64-bit compressed size");
+ return ARCHIVE_FAILED;
+ }
+ zip_entry->compressed_size = t;
offset += 8;
datasize -= 8;
}
if (zip_entry->local_header_offset == 0xffffffff) {
- if (datasize < 8)
- break;
- zip_entry->local_header_offset =
- archive_le64dec(p + offset);
+ uint64_t t = 0;
+ if (datasize < 8
+ || (t = archive_le64dec(p + offset)) > INT64_MAX) {
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
+ "Malformed 64-bit local header offset");
+ return ARCHIVE_FAILED;
+ }
+ zip_entry->local_header_offset = t;
offset += 8;
datasize -= 8;
}
@@ -710,7 +722,7 @@
break;
}
case 0x9901:
- /* WinZIp AES extra data field. */
+ /* WinZip AES extra data field. */
if (p[offset + 2] == 'A' && p[offset + 3] == 'E') {
/* Vendor version. */
zip_entry->aes_extra.vendor =
@@ -864,29 +876,33 @@
zip_entry->mode |= AE_IFREG;
}
- if ((zip_entry->mode & AE_IFMT) == 0) {
- /* Especially in streaming mode, we can end up
- here without having seen proper mode information.
- Guess from the filename. */
+ /* If the mode is totally empty, set some sane default. */
+ if (zip_entry->mode == 0) {
+ zip_entry->mode |= 0664;
+ }
+
+ /* Make sure that entries with a trailing '/' are marked as directories
+ * even if the External File Attributes contains bogus values. If this
+ * is not a directory and there is no type, assume regularfile. */
+ if ((zip_entry->mode & AE_IFMT) != AE_IFDIR) {
+ int has_slash;
+
wp = archive_entry_pathname_w(entry);
if (wp != NULL) {
len = wcslen(wp);
- if (len > 0 && wp[len - 1] == L'/')
- zip_entry->mode |= AE_IFDIR;
- else
- zip_entry->mode |= AE_IFREG;
+ has_slash = len > 0 && wp[len - 1] == L'/';
} else {
cp = archive_entry_pathname(entry);
len = (cp != NULL)?strlen(cp):0;
- if (len > 0 && cp[len - 1] == '/')
- zip_entry->mode |= AE_IFDIR;
- else
- zip_entry->mode |= AE_IFREG;
+ has_slash = len > 0 && cp[len - 1] == '/';
}
- if (zip_entry->mode == AE_IFDIR) {
- zip_entry->mode |= 0775;
- } else if (zip_entry->mode == AE_IFREG) {
- zip_entry->mode |= 0664;
+ /* Correct file type as needed. */
+ if (has_slash) {
+ zip_entry->mode &= ~AE_IFMT;
+ zip_entry->mode |= AE_IFDIR;
+ zip_entry->mode |= 0111;
+ } else if ((zip_entry->mode & AE_IFMT) == 0) {
+ zip_entry->mode |= AE_IFREG;
}
}
@@ -901,6 +917,7 @@
archive_wstrcat(&s, wp);
archive_wstrappend_wchar(&s, L'/');
archive_entry_copy_pathname_w(entry, s.s);
+ archive_wstring_free(&s);
}
} else {
cp = archive_entry_pathname(entry);
@@ -911,6 +928,7 @@
archive_strcat(&s, cp);
archive_strappend_char(&s, '/');
archive_entry_set_pathname(entry, s.s);
+ archive_string_free(&s);
}
}
}
@@ -1150,11 +1168,18 @@
|| (zip->hctx_valid
&& zip->entry->aes_extra.vendor == AES_VENDOR_AE_2))) {
if (zip->entry->flags & LA_USED_ZIP64) {
+ uint64_t compressed, uncompressed;
zip->entry->crc32 = archive_le32dec(p + 4);
- zip->entry->compressed_size =
- archive_le64dec(p + 8);
- zip->entry->uncompressed_size =
- archive_le64dec(p + 16);
+ compressed = archive_le64dec(p + 8);
+ uncompressed = archive_le64dec(p + 16);
+ if (compressed > INT64_MAX || uncompressed > INT64_MAX) {
+ archive_set_error(&a->archive,
+ ARCHIVE_ERRNO_FILE_FORMAT,
+ "Overflow of 64-bit file sizes");
+ return ARCHIVE_FAILED;
+ }
+ zip->entry->compressed_size = compressed;
+ zip->entry->uncompressed_size = uncompressed;
zip->unconsumed = 24;
} else {
zip->entry->crc32 = archive_le32dec(p + 4);
@@ -1431,9 +1456,18 @@
zip->unconsumed = 4;
}
if (zip->entry->flags & LA_USED_ZIP64) {
+ uint64_t compressed, uncompressed;
zip->entry->crc32 = archive_le32dec(p);
- zip->entry->compressed_size = archive_le64dec(p + 4);
- zip->entry->uncompressed_size = archive_le64dec(p + 12);
+ compressed = archive_le64dec(p + 4);
+ uncompressed = archive_le64dec(p + 12);
+ if (compressed > INT64_MAX || uncompressed > INT64_MAX) {
+ archive_set_error(&a->archive,
+ ARCHIVE_ERRNO_FILE_FORMAT,
+ "Overflow of 64-bit file sizes");
+ return ARCHIVE_FAILED;
+ }
+ zip->entry->compressed_size = compressed;
+ zip->entry->uncompressed_size = uncompressed;
zip->unconsumed += 20;
} else {
zip->entry->crc32 = archive_le32dec(p);
@@ -1514,7 +1548,7 @@
case 0x6720:/* Blowfish */
case 0x6721:/* Twofish */
case 0x6801:/* RC4 */
- /* Suuported encryption algorithm. */
+ /* Supported encryption algorithm. */
break;
default:
archive_set_error(&a->archive,
@@ -1623,7 +1657,7 @@
__archive_read_consume(a, 4);
/*return (ARCHIVE_OK);
- * This is not fully implemnted yet.*/
+ * This is not fully implemented yet.*/
archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
"Encrypted file is unsupported");
return (ARCHIVE_FAILED);
@@ -1705,7 +1739,7 @@
}
/*
- * Initialize ctx for Traditional PKWARE Decyption.
+ * Initialize ctx for Traditional PKWARE Decryption.
*/
r = trad_enc_init(&zip->tctx, passphrase, strlen(passphrase),
p, ENC_HEADER_SIZE, &crcchk);
@@ -2373,7 +2407,7 @@
* Examine Zip64 EOCD locator: If it's valid, store the information
* from it.
*/
-static void
+static int
read_zip64_eocd(struct archive_read *a, struct zip *zip, const char *p)
{
int64_t eocd64_offset;
@@ -2383,35 +2417,37 @@
/* Central dir must be on first volume. */
if (archive_le32dec(p + 4) != 0)
- return;
+ return 0;
/* Must be only a single volume. */
if (archive_le32dec(p + 16) != 1)
- return;
+ return 0;
/* Find the Zip64 EOCD record. */
eocd64_offset = archive_le64dec(p + 8);
if (__archive_read_seek(a, eocd64_offset, SEEK_SET) < 0)
- return;
+ return 0;
if ((p = __archive_read_ahead(a, 56, NULL)) == NULL)
- return;
+ return 0;
/* Make sure we can read all of it. */
eocd64_size = archive_le64dec(p + 4) + 12;
if (eocd64_size < 56 || eocd64_size > 16384)
- return;
+ return 0;
if ((p = __archive_read_ahead(a, (size_t)eocd64_size, NULL)) == NULL)
- return;
+ return 0;
/* Sanity-check the EOCD64 */
if (archive_le32dec(p + 16) != 0) /* Must be disk #0 */
- return;
+ return 0;
if (archive_le32dec(p + 20) != 0) /* CD must be on disk #0 */
- return;
+ return 0;
/* CD can't be split. */
if (archive_le64dec(p + 24) != archive_le64dec(p + 32))
- return;
+ return 0;
/* Save the central directory offset for later use. */
zip->central_directory_offset = archive_le64dec(p + 48);
+
+ return 32;
}
static int
@@ -2449,15 +2485,14 @@
if (memcmp(p + i, "PK\005\006", 4) == 0) {
int ret = read_eocd(zip, p + i,
current_offset + i);
- if (ret > 0) {
- /* Zip64 EOCD locator precedes
- * regular EOCD if present. */
- if (i >= 20
- && memcmp(p + i - 20, "PK\006\007", 4) == 0) {
- read_zip64_eocd(a, zip, p + i - 20);
- }
- return (ret);
+ /* Zip64 EOCD locator precedes
+ * regular EOCD if present. */
+ if (i >= 20 && memcmp(p + i - 20, "PK\006\007", 4) == 0) {
+ int ret_zip64 = read_zip64_eocd(a, zip, p + i - 20);
+ if (ret_zip64 > ret)
+ ret = ret_zip64;
}
+ return (ret);
}
i -= 4;
break;
Modified: trunk/contrib/libarchive/libarchive/archive_string.c
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_string.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/archive_string.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -202,7 +202,8 @@
{
if (archive_string_ensure(as, as->length + s + 1) == NULL)
return (NULL);
- memmove(as->s + as->length, p, s);
+ if (s)
+ memmove(as->s + as->length, p, s);
as->length += s;
as->s[as->length] = 0;
return (as);
@@ -219,6 +220,12 @@
return (as);
}
+struct archive_string *
+archive_array_append(struct archive_string *as, const char *p, size_t s)
+{
+ return archive_string_append(as, p, s);
+}
+
void
archive_string_concat(struct archive_string *dest, struct archive_string *src)
{
@@ -597,7 +604,7 @@
wcs = dest->s + dest->length;
/*
* We cannot use mbsrtowcs/mbstowcs here because those may convert
- * extra MBS when strlen(p) > len and one wide character consis of
+ * extra MBS when strlen(p) > len and one wide character consists of
* multi bytes.
*/
while (*mbs && mbs_length > 0) {
@@ -1248,7 +1255,7 @@
sc->cd = iconv_open(tc, fc);
if (sc->cd == (iconv_t)-1 && (sc->flag & SCONV_BEST_EFFORT)) {
/*
- * Unfortunaly, all of iconv implements do support
+ * Unfortunately, all of iconv implements do support
* "CP932" character-set, so we should use "SJIS"
* instead if iconv_open failed.
*/
@@ -1261,7 +1268,7 @@
/*
* archive_mstring on Windows directly convert multi-bytes
* into archive_wstring in order not to depend on locale
- * so that you can do a I18N programing. This will be
+ * so that you can do a I18N programming. This will be
* used only in archive_mstring_copy_mbs_len_l so far.
*/
if (flag & SCONV_FROM_CHARSET) {
@@ -1726,7 +1733,7 @@
* in tar or zip files. But mbstowcs/wcstombs(CRT) usually use CP_ACP
* unless you use setlocale(LC_ALL, ".OCP")(specify CP_OEMCP).
* So we should make a string conversion between CP_ACP and CP_OEMCP
- * for compatibillty.
+ * for compatibility.
*/
#if defined(_WIN32) && !defined(__CYGWIN__)
struct archive_string_conv *
@@ -1827,7 +1834,7 @@
* A filename in UTF-8 was made with libarchive 2.x in a wrong
* assumption that wchar_t was Unicode.
* This option enables simulating the assumption in order to read
- * that filname correctly.
+ * that filename correctly.
*/
case SCONV_SET_OPT_UTF8_LIBARCHIVE2X:
#if (defined(_WIN32) && !defined(__CYGWIN__)) \
@@ -1939,12 +1946,19 @@
struct archive_string_conv *sc)
{
const void *s;
- size_t length;
+ size_t length = 0;
int i, r = 0, r2;
+ if (_p != NULL && n > 0) {
+ if (sc != NULL && (sc->flag & SCONV_FROM_UTF16))
+ length = utf16nbytes(_p, n);
+ else
+ length = mbsnbytes(_p, n);
+ }
+
/* We must allocate memory even if there is no data for conversion
* or copy. This simulates archive_string_append behavior. */
- if (_p == NULL || n == 0) {
+ if (length == 0) {
int tn = 1;
if (sc != NULL && (sc->flag & SCONV_TO_UTF16))
tn = 2;
@@ -1960,16 +1974,11 @@
* If sc is NULL, we just make a copy.
*/
if (sc == NULL) {
- length = mbsnbytes(_p, n);
if (archive_string_append(as, _p, length) == NULL)
return (-1);/* No memory */
return (0);
}
- if (sc->flag & SCONV_FROM_UTF16)
- length = utf16nbytes(_p, n);
- else
- length = mbsnbytes(_p, n);
s = _p;
i = 0;
if (sc->nconverter > 1) {
@@ -1992,7 +2001,7 @@
#if HAVE_ICONV
/*
- * Return -1 if conversion failes.
+ * Return -1 if conversion fails.
*/
static int
iconv_strncat_in_locale(struct archive_string *as, const void *_p,
@@ -2094,7 +2103,7 @@
/*
* Translate a string from a some CodePage to an another CodePage by
- * Windows APIs, and copy the result. Return -1 if conversion failes.
+ * Windows APIs, and copy the result. Return -1 if conversion fails.
*/
static int
strncat_in_codepage(struct archive_string *as,
@@ -2218,7 +2227,7 @@
/*
* If a character is ASCII, this just copies it. If not, this
- * assigns '?' charater instead but in UTF-8 locale this assigns
+ * assigns '?' character instead but in UTF-8 locale this assigns
* byte sequence 0xEF 0xBD 0xBD, which are code point U+FFFD,
* a Replacement Character in Unicode.
*/
@@ -2298,7 +2307,7 @@
return (0); /* Standard: return 0 for end-of-string. */
cnt = utf8_count[ch];
- /* Invalide sequence or there are not plenty bytes. */
+ /* Invalid sequence or there are not plenty bytes. */
if ((int)n < cnt) {
cnt = (int)n;
for (i = 1; i < cnt; i++) {
@@ -2379,7 +2388,7 @@
goto invalid_sequence;
}
- /* The code point larger than 0x10FFFF is not leagal
+ /* The code point larger than 0x10FFFF is not legal
* Unicode values. */
if (wc > UNICODE_MAX)
goto invalid_sequence;
@@ -2397,7 +2406,7 @@
int cnt;
cnt = _utf8_to_unicode(pwc, s, n);
- /* Any of Surrogate pair is not leagal Unicode values. */
+ /* Any of Surrogate pair is not legal Unicode values. */
if (cnt == 3 && IS_SURROGATE_PAIR_LA(*pwc))
return (-3);
return (cnt);
@@ -2458,7 +2467,7 @@
/*
* Convert a Unicode code point to a single UTF-8 sequence.
*
- * NOTE:This function does not check if the Unicode is leagal or not.
+ * NOTE:This function does not check if the Unicode is legal or not.
* Please you definitely check it before calling this.
*/
static size_t
@@ -2552,9 +2561,9 @@
/*
* Surrogate pair values(0xd800 through 0xdfff) are only
- * used by UTF-16, so, after above culculation, the code
+ * used by UTF-16, so, after above calculation, the code
* must not be surrogate values, and Unicode has no codes
- * larger than 0x10ffff. Thus, those are not leagal Unicode
+ * larger than 0x10ffff. Thus, those are not legal Unicode
* values.
*/
if (IS_SURROGATE_PAIR_LA(uc) || uc > UNICODE_MAX) {
@@ -2901,7 +2910,7 @@
/*
* Normalize UTF-8/UTF-16BE characters to Form C and copy the result.
*
- * TODO: Convert composition exclusions,which are never converted
+ * TODO: Convert composition exclusions, which are never converted
* from NFC,NFD,NFKC and NFKD, to Form C.
*/
static int
@@ -3435,7 +3444,7 @@
}
/*
- * As libarchie 2.x, translates the UTF-8 characters into
+ * As libarchive 2.x, translates the UTF-8 characters into
* wide-characters in the assumption that WCS is Unicode.
*/
if (n < 0) {
@@ -3474,7 +3483,7 @@
/*
* Convert a UTF-16BE/LE string to current locale and copy the result.
- * Return -1 if conversion failes.
+ * Return -1 if conversion fails.
*/
static int
win_strncat_from_utf16(struct archive_string *as, const void *_p, size_t bytes,
@@ -3598,7 +3607,7 @@
/*
* Convert a current locale string to UTF-16BE/LE and copy the result.
- * Return -1 if conversion failes.
+ * Return -1 if conversion fails.
*/
static int
win_strncat_to_utf16(struct archive_string *as16, const void *_p,
@@ -3703,7 +3712,7 @@
/*
* Convert a UTF-16BE string to current locale and copy the result.
- * Return -1 if conversion failes.
+ * Return -1 if conversion fails.
*/
static int
best_effort_strncat_from_utf16(struct archive_string *as, const void *_p,
@@ -3761,7 +3770,7 @@
/*
* Convert a current locale string to UTF-16BE/LE and copy the result.
- * Return -1 if conversion failes.
+ * Return -1 if conversion fails.
*/
static int
best_effort_strncat_to_utf16(struct archive_string *as16, const void *_p,
@@ -3945,7 +3954,7 @@
#if defined(_WIN32) && !defined(__CYGWIN__)
/*
- * Internationalization programing on Windows must use Wide
+ * Internationalization programming on Windows must use Wide
* characters because Windows platform cannot make locale UTF-8.
*/
if (sc != NULL && (aes->aes_set & AES_SET_WCS) != 0) {
@@ -4077,7 +4086,7 @@
archive_string_empty(&(aes->aes_utf8));
#if defined(_WIN32) && !defined(__CYGWIN__)
/*
- * Internationalization programing on Windows must use Wide
+ * Internationalization programming on Windows must use Wide
* characters because Windows platform cannot make locale UTF-8.
*/
if (sc == NULL) {
Modified: trunk/contrib/libarchive/libarchive/archive_string.h
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_string.h 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/archive_string.h 2018-06-19 20:42:35 UTC (rev 11134)
@@ -81,6 +81,10 @@
struct archive_wstring *
archive_wstrappend_wchar(struct archive_wstring *, wchar_t);
+/* Append a raw array to an archive_string, resizing as necessary */
+struct archive_string *
+archive_array_append(struct archive_string *, const char *, size_t);
+
/* Convert a Unicode string to current locale and append the result. */
/* Returns -1 if conversion fails. */
int
@@ -115,13 +119,13 @@
/* Copy one archive_string to another in locale conversion.
- * Return -1 if conversion failes. */
+ * Return -1 if conversion fails. */
int
archive_strncpy_l(struct archive_string *, const void *, size_t,
struct archive_string_conv *);
/* Copy one archive_string to another in locale conversion.
- * Return -1 if conversion failes. */
+ * Return -1 if conversion fails. */
int
archive_strncat_l(struct archive_string *, const void *, size_t,
struct archive_string_conv *);
Modified: trunk/contrib/libarchive/libarchive/archive_string_composition.h
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_string_composition.h 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/archive_string_composition.h 2018-06-19 20:42:35 UTC (rev 11134)
@@ -1009,7 +1009,7 @@
(((uc) > 0x1D244)?0:\
ccc_val[ccc_val_index[ccc_index[(uc)>>8]][((uc)>>4)&0x0F]][(uc)&0x0F])
-/* The table of the value of Canonical Cimbining Class */
+/* The table of the value of Canonical Combining Class */
static const unsigned char ccc_val[][16] = {
/* idx=0: XXXX0 - XXXXF */
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 },
Modified: trunk/contrib/libarchive/libarchive/archive_string_sprintf.c
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_string_sprintf.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/archive_string_sprintf.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -53,7 +53,7 @@
static void
append_uint(struct archive_string *as, uintmax_t d, unsigned base)
{
- static const char *digits = "0123456789abcdef";
+ static const char digits[] = "0123456789abcdef";
if (d >= base)
append_uint(as, d/base, base);
archive_strappend_char(as, digits[d % base]);
Modified: trunk/contrib/libarchive/libarchive/archive_util.c
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_util.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/archive_util.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -89,88 +89,6 @@
return (ARCHIVE_VERSION_STRING);
}
-const char *
-archive_version_details(void)
-{
- static struct archive_string str;
- static int init = 0;
- const char *zlib = archive_zlib_version();
- const char *liblzma = archive_liblzma_version();
- const char *bzlib = archive_bzlib_version();
- const char *liblz4 = archive_liblz4_version();
-
- if (!init) {
- archive_string_init(&str);
-
- archive_strcat(&str, ARCHIVE_VERSION_STRING);
- if (zlib != NULL) {
- archive_strcat(&str, " zlib/");
- archive_strcat(&str, zlib);
- }
- if (liblzma) {
- archive_strcat(&str, " liblzma/");
- archive_strcat(&str, liblzma);
- }
- if (bzlib) {
- const char *p = bzlib;
- const char *sep = strchr(p, ',');
- if (sep == NULL)
- sep = p + strlen(p);
- archive_strcat(&str, " bz2lib/");
- archive_strncat(&str, p, sep - p);
- }
- if (liblz4) {
- archive_strcat(&str, " liblz4/");
- archive_strcat(&str, liblz4);
- }
- }
- return str.s;
-}
-
-const char *
-archive_zlib_version(void)
-{
-#ifdef HAVE_ZLIB_H
- return ZLIB_VERSION;
-#else
- return NULL;
-#endif
-}
-
-const char *
-archive_liblzma_version(void)
-{
-#ifdef HAVE_LZMA_H
- return LZMA_VERSION_STRING;
-#else
- return NULL;
-#endif
-}
-
-const char *
-archive_bzlib_version(void)
-{
-#ifdef HAVE_BZLIB_H
- return BZ2_bzlibVersion();
-#else
- return NULL;
-#endif
-}
-
-const char *
-archive_liblz4_version(void)
-{
-#if defined(HAVE_LZ4_H) && defined(HAVE_LIBLZ4)
-#define str(s) #s
-#define NUMBER(x) str(x)
- return NUMBER(LZ4_VERSION_MAJOR) "." NUMBER(LZ4_VERSION_MINOR) "." NUMBER(LZ4_VERSION_RELEASE);
-#undef NUMBER
-#undef str
-#else
- return NULL;
-#endif
-}
-
int
archive_errno(struct archive *a)
{
@@ -275,7 +193,7 @@
void
__archive_errx(int retvalue, const char *msg)
{
- static const char *msg1 = "Fatal Internal Error in libarchive: ";
+ static const char msg1[] = "Fatal Internal Error in libarchive: ";
size_t s;
s = write(2, msg1, strlen(msg1));
@@ -303,8 +221,8 @@
int
__archive_mktemp(const char *tmpdir)
{
- static const wchar_t *prefix = L"libarchive_";
- static const wchar_t *suffix = L"XXXXXXXXXX";
+ static const wchar_t prefix[] = L"libarchive_";
+ static const wchar_t suffix[] = L"XXXXXXXXXX";
static const wchar_t num[] = {
L'0', L'1', L'2', L'3', L'4', L'5', L'6', L'7',
L'8', L'9', L'A', L'B', L'C', L'D', L'E', L'F',
Copied: trunk/contrib/libarchive/libarchive/archive_version_details.c (from rev 11133, vendor/libarchive/dist/libarchive/archive_version_details.c)
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_version_details.c (rev 0)
+++ trunk/contrib/libarchive/libarchive/archive_version_details.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -0,0 +1,133 @@
+/*-
+ * Copyright (c) 2009-2012,2014 Michihiro NAKAJIMA
+ * 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: head/lib/libarchive/archive_util.c 201098 2009-12-28 02:58:14Z kientzle $");
+
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+#ifdef HAVE_ZLIB_H
+#include <zlib.h>
+#endif
+#ifdef HAVE_LZMA_H
+#include <lzma.h>
+#endif
+#ifdef HAVE_BZLIB_H
+#include <bzlib.h>
+#endif
+#ifdef HAVE_LZ4_H
+#include <lz4.h>
+#endif
+
+#include "archive.h"
+#include "archive_private.h"
+#include "archive_string.h"
+
+const char *
+archive_version_details(void)
+{
+ static struct archive_string str;
+ static int init = 0;
+ const char *zlib = archive_zlib_version();
+ const char *liblzma = archive_liblzma_version();
+ const char *bzlib = archive_bzlib_version();
+ const char *liblz4 = archive_liblz4_version();
+
+ if (!init) {
+ archive_string_init(&str);
+
+ archive_strcat(&str, ARCHIVE_VERSION_STRING);
+ if (zlib != NULL) {
+ archive_strcat(&str, " zlib/");
+ archive_strcat(&str, zlib);
+ }
+ if (liblzma) {
+ archive_strcat(&str, " liblzma/");
+ archive_strcat(&str, liblzma);
+ }
+ if (bzlib) {
+ const char *p = bzlib;
+ const char *sep = strchr(p, ',');
+ if (sep == NULL)
+ sep = p + strlen(p);
+ archive_strcat(&str, " bz2lib/");
+ archive_strncat(&str, p, sep - p);
+ }
+ if (liblz4) {
+ archive_strcat(&str, " liblz4/");
+ archive_strcat(&str, liblz4);
+ }
+ }
+ return str.s;
+}
+
+const char *
+archive_zlib_version(void)
+{
+#ifdef HAVE_ZLIB_H
+ return ZLIB_VERSION;
+#else
+ return NULL;
+#endif
+}
+
+const char *
+archive_liblzma_version(void)
+{
+#ifdef HAVE_LZMA_H
+ return LZMA_VERSION_STRING;
+#else
+ return NULL;
+#endif
+}
+
+const char *
+archive_bzlib_version(void)
+{
+#ifdef HAVE_BZLIB_H
+ return BZ2_bzlibVersion();
+#else
+ return NULL;
+#endif
+}
+
+const char *
+archive_liblz4_version(void)
+{
+#if defined(HAVE_LZ4_H) && defined(HAVE_LIBLZ4)
+#define str(s) #s
+#define NUMBER(x) str(x)
+ return NUMBER(LZ4_VERSION_MAJOR) "." NUMBER(LZ4_VERSION_MINOR) "." NUMBER(LZ4_VERSION_RELEASE);
+#undef NUMBER
+#undef str
+#else
+ return NULL;
+#endif
+}
Modified: trunk/contrib/libarchive/libarchive/archive_windows.c
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_windows.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/archive_windows.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -766,7 +766,7 @@
has_backslash = 1;
}
/*
- * If there is no backslach chars, return the original.
+ * If there is no backslash chars, return the original.
*/
if (!has_backslash)
return (entry);
@@ -891,7 +891,7 @@
return;
}
- for (i = 0; i < (int)sizeof(doserrors); i++)
+ for (i = 0; i < (int)(sizeof(doserrors)/sizeof(doserrors[0])); i++)
{
if (doserrors[i].winerr == e)
{
Modified: trunk/contrib/libarchive/libarchive/archive_windows.h
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_windows.h 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/archive_windows.h 2018-06-19 20:42:35 UTC (rev 11134)
@@ -218,16 +218,20 @@
#define S_IWUSR _S_IWUSR
#define S_IRUSR _S_IRUSR
#endif
+#ifndef S_IRWXG
#define S_IRWXG _S_IRWXG
#define S_IXGRP _S_IXGRP
#define S_IWGRP _S_IWGRP
+#endif
#ifndef S_IRGRP
#define S_IRGRP _S_IRGRP
#endif
+#ifndef S_IRWXO
#define S_IRWXO _S_IRWXO
#define S_IXOTH _S_IXOTH
#define S_IWOTH _S_IWOTH
#define S_IROTH _S_IROTH
+#endif
#endif
Modified: trunk/contrib/libarchive/libarchive/archive_write.c
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_write.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/archive_write.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -109,10 +109,9 @@
struct archive_write *a;
unsigned char *nulls;
- a = (struct archive_write *)malloc(sizeof(*a));
+ a = (struct archive_write *)calloc(1, sizeof(*a));
if (a == NULL)
return (NULL);
- memset(a, 0, sizeof(*a));
a->archive.magic = ARCHIVE_WRITE_MAGIC;
a->archive.state = ARCHIVE_STATE_NEW;
a->archive.vtable = archive_write_vtable();
@@ -126,12 +125,11 @@
/* Initialize a block of nulls for padding purposes. */
a->null_length = 1024;
- nulls = (unsigned char *)malloc(a->null_length);
+ nulls = (unsigned char *)calloc(1, a->null_length);
if (nulls == NULL) {
free(a);
return (NULL);
}
- memset(nulls, 0, a->null_length);
a->nulls = nulls;
return (&a->archive);
}
@@ -233,7 +231,7 @@
if (length == 0)
return(ARCHIVE_OK);
if (f->write == NULL)
- /* If unset, a fatal error has already ocuured, so this filter
+ /* If unset, a fatal error has already occurred, so this filter
* didn't open. We cannot write anything. */
return(ARCHIVE_FATAL);
r = (f->write)(f, buff, length);
Modified: trunk/contrib/libarchive/libarchive/archive_write_add_filter.c
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_write_add_filter.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/archive_write_add_filter.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -38,7 +38,7 @@
#include "archive_private.h"
/* A table that maps filter codes to functions. */
-static
+static const
struct { int code; int (*setter)(struct archive *); } codes[] =
{
{ ARCHIVE_FILTER_NONE, archive_write_add_filter_none },
Modified: trunk/contrib/libarchive/libarchive/archive_write_add_filter_by_name.c
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_write_add_filter_by_name.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/archive_write_add_filter_by_name.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -42,7 +42,7 @@
#include "archive_private.h"
/* A table that maps names to functions. */
-static
+static const
struct { const char *name; int (*setter)(struct archive *); } names[] =
{
{ "b64encode", archive_write_add_filter_b64encode },
Modified: trunk/contrib/libarchive/libarchive/archive_write_add_filter_lz4.c
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_write_add_filter_lz4.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/archive_write_add_filter_lz4.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -225,7 +225,7 @@
struct private_data *data = (struct private_data *)f->data;
int ret;
size_t required_size;
- static size_t bkmap[] = { 64 * 1024, 256 * 1024, 1 * 1024 * 1024,
+ static size_t const bkmap[] = { 64 * 1024, 256 * 1024, 1 * 1024 * 1024,
4 * 1024 * 1024 };
size_t pre_block_size;
@@ -523,7 +523,7 @@
archive_le32enc(data->out, outsize);
data->out += 4;
} else {
- /* The buffer is not compressed. The commpressed size was
+ /* The buffer is not compressed. The compressed size was
* bigger than its uncompressed size. */
archive_le32enc(data->out, length | 0x80000000);
data->out += 4;
@@ -608,7 +608,7 @@
archive_le32enc(data->out, outsize);
data->out += 4;
} else {
- /* The buffer is not compressed. The commpressed size was
+ /* The buffer is not compressed. The compressed size was
* bigger than its uncompressed size. */
archive_le32enc(data->out, length | 0x80000000);
data->out += 4;
Modified: trunk/contrib/libarchive/libarchive/archive_write_add_filter_program.c
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_write_add_filter_program.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/archive_write_add_filter_program.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -92,7 +92,7 @@
{
struct archive_write_filter *f = __archive_write_allocate_filter(_a);
struct private_data *data;
- static const char *prefix = "Program: ";
+ static const char prefix[] = "Program: ";
archive_check_magic(_a, ARCHIVE_WRITE_MAGIC,
ARCHIVE_STATE_NEW, "archive_write_add_filter_program");
@@ -200,6 +200,7 @@
if (data->child)
CloseHandle(data->child);
#endif
+ free(data->program_name);
free(data->child_buf);
free(data);
}
Modified: trunk/contrib/libarchive/libarchive/archive_write_add_filter_xz.c
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_write_add_filter_xz.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/archive_write_add_filter_xz.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -233,7 +233,7 @@
if (f->code == ARCHIVE_FILTER_XZ) {
#ifdef HAVE_LZMA_STREAM_ENCODER_MT
if (data->threads != 1) {
- bzero(&mt_options, sizeof(mt_options));
+ memset(&mt_options, 0, sizeof(mt_options));
mt_options.threads = data->threads;
mt_options.timeout = 300;
mt_options.filters = data->lzmafilters;
Modified: trunk/contrib/libarchive/libarchive/archive_write_data.3
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_write_data.3 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/archive_write_data.3 2018-06-19 20:42:35 UTC (rev 11134)
@@ -24,11 +24,12 @@
.\"
.\" $FreeBSD$
.\"
-.Dd February 2, 2012
+.Dd February 28, 2017
.Dt ARCHIVE_WRITE_DATA 3
.Os
.Sh NAME
-.Nm archive_write_data
+.Nm archive_write_data ,
+.Nm archive_write_data_block
.Nd functions for creating archives
.Sh LIBRARY
Streaming Archive Library (libarchive, -larchive)
@@ -36,8 +37,27 @@
.In archive.h
.Ft la_ssize_t
.Fn archive_write_data "struct archive *" "const void *" "size_t"
+.Ft la_ssize_t
+.Fn archive_write_data_block "struct archive *" "const void *" "size_t size" "int64_t offset"
.Sh DESCRIPTION
+.Bl -tag -width indent
+.It Fn archive_write_data
Write data corresponding to the header just written.
+.It Fn archive_write_data_block
+Write data corresponding to the header just written.
+This is like
+.Fn archive_write_data
+except that it performs a seek on the file being
+written to the specified offset before writing the data.
+This is useful when restoring sparse files from archive
+formats that support sparse files.
+Returns number of bytes written or -1 on error.
+(Note: This is currently not supported for
+.Tn archive_write
+handles, only for
+.Tn archive_write_disk
+handles.
+.El
.\" .Sh EXAMPLE
.\"
.Sh RETURN VALUES
Modified: trunk/contrib/libarchive/libarchive/archive_write_disk.3
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_write_disk.3 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/archive_write_disk.3 2018-06-19 20:42:35 UTC (rev 11134)
@@ -24,7 +24,7 @@
.\"
.\" $FreeBSD: stable/11/contrib/libarchive/libarchive/archive_write_disk.3 299529 2016-05-12 10:16:16Z mm $
.\"
-.Dd February 2, 2012
+.Dd April 3, 2017
.Dt ARCHIVE_WRITE_DISK 3
.Os
.Sh NAME
@@ -33,14 +33,7 @@
.Nm archive_write_disk_set_skip_file ,
.Nm archive_write_disk_set_group_lookup ,
.Nm archive_write_disk_set_standard_lookup ,
-.Nm archive_write_disk_set_user_lookup ,
-.Nm archive_write_header ,
-.Nm archive_write_data ,
-.Nm archive_write_data_block ,
-.Nm archive_write_finish_entry ,
-.Nm archive_write_close ,
-.Nm archive_write_finish
-.Nm archive_write_free
+.Nm archive_write_disk_set_user_lookup
.Nd functions for creating objects on disk
.Sh LIBRARY
Streaming Archive Library (libarchive, -larchive)
@@ -68,20 +61,6 @@
.Fa "uid_t (*)(void *, const char *uname, uid_t uid)"
.Fa "void (*cleanup)(void *)"
.Fc
-.Ft int
-.Fn archive_write_header "struct archive *" "struct archive_entry *"
-.Ft la_ssize_t
-.Fn archive_write_data "struct archive *" "const void *" "size_t"
-.Ft la_ssize_t
-.Fn archive_write_data_block "struct archive *" "const void *" "size_t size" "int64_t offset"
-.Ft int
-.Fn archive_write_finish_entry "struct archive *"
-.Ft int
-.Fn archive_write_close "struct archive *"
-.Ft int
-.Fn archive_write_finish "struct archive *"
-.Ft int
-.Fn archive_write_free "struct archive *"
.Sh DESCRIPTION
These functions provide a complete API for creating objects on
disk from
@@ -117,6 +96,33 @@
The options field consists of a bitwise OR of one or more of the
following values:
.Bl -tag -compact -width "indent"
+.It Cm ARCHIVE_EXTRACT_ACL
+Attempt to restore Access Control Lists.
+By default, extended ACLs are ignored.
+.It Cm ARCHIVE_EXTRACT_CLEAR_NOCHANGE_FFLAGS
+Before removing a file system object prior to replacing it, clear
+platform-specific file flags which might prevent its removal.
+.It Cm ARCHIVE_EXTRACT_FFLAGS
+Attempt to restore file attributes (file flags).
+By default, file attributes are ignored.
+See
+.Xr chattr 1
+.Pq Linux
+or
+.Xr chflags 1
+.Pq FreeBSD, Mac OS X
+for more information on file attributes.
+.It Cm ARCHIVE_EXTRACT_MAC_METADATA
+Mac OS X specific. Restore metadata using
+.Xr copyfile 3 .
+By default,
+.Xr copyfile 3
+metadata is ignored.
+.It Cm ARCHIVE_EXTRACT_NO_OVERWRITE
+Existing files on disk will not be overwritten.
+By default, existing regular files are truncated and overwritten;
+existing directories will have their permissions updated;
+other pre-existing objects are unlinked and recreated from scratch.
.It Cm ARCHIVE_EXTRACT_OWNER
The user and group IDs should be set on the restored file.
By default, the user and group IDs are not restored.
@@ -132,15 +138,37 @@
if the default user and group IDs of newly-created objects on disk
happen to match those specified in the archive entry.
By default, only basic permissions are restored, and umask is obeyed.
+.It Cm ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS
+Refuse to extract an absolute path.
+The default is to not refuse such paths.
+.It Cm ARCHIVE_EXTRACT_SECURE_NODOTDOT
+Refuse to extract a path that contains a
+.Pa ..
+element anywhere within it.
+The default is to not refuse such paths.
+Note that paths ending in
+.Pa ..
+always cause an error, regardless of this flag.
+.It Cm ARCHIVE_EXTRACT_SECURE_SYMLINKS
+Refuse to extract any object whose final location would be altered
+by a symlink on disk.
+This is intended to help guard against a variety of mischief
+caused by archives that (deliberately or otherwise) extract
+files outside of the current directory.
+The default is not to perform this check.
+If
+.It Cm ARCHIVE_EXTRACT_SPARSE
+Scan data for blocks of NUL bytes and try to recreate them with holes.
+This results in sparse files, independent of whether the archive format
+supports or uses them.
+.Cm ARCHIVE_EXTRACT_UNLINK
+is specified together with this option, the library will
+remove any intermediate symlinks it finds and return an
+error only if such symlink could not be removed.
.It Cm ARCHIVE_EXTRACT_TIME
The timestamps (mtime, ctime, and atime) should be restored.
By default, they are ignored.
Note that restoring of atime is not currently supported.
-.It Cm ARCHIVE_EXTRACT_NO_OVERWRITE
-Existing files on disk will not be overwritten.
-By default, existing regular files are truncated and overwritten;
-existing directories will have their permissions updated;
-other pre-existing objects are unlinked and recreated from scratch.
.It Cm ARCHIVE_EXTRACT_UNLINK
Existing files on disk will be unlinked before any attempt to
create them.
@@ -148,45 +176,18 @@
By default, existing files are truncated and rewritten, but
the file is not recreated.
In particular, the default behavior does not break existing hard links.
-.It Cm ARCHIVE_EXTRACT_ACL
-Attempt to restore ACLs.
-By default, extended ACLs are ignored.
-.It Cm ARCHIVE_EXTRACT_FFLAGS
-Attempt to restore extended file flags.
-By default, file flags are ignored.
.It Cm ARCHIVE_EXTRACT_XATTR
-Attempt to restore POSIX.1e extended attributes.
+Attempt to restore extended file attributes.
By default, they are ignored.
-.It Cm ARCHIVE_EXTRACT_SECURE_SYMLINKS
-Refuse to extract any object whose final location would be altered
-by a symlink on disk.
-This is intended to help guard against a variety of mischief
-caused by archives that (deliberately or otherwise) extract
-files outside of the current directory.
-The default is not to perform this check.
-If
-.Cm ARCHIVE_EXTRACT_UNLINK
-is specified together with this option, the library will
-remove any intermediate symlinks it finds and return an
-error only if such symlink could not be removed.
-.It Cm ARCHIVE_EXTRACT_SECURE_NODOTDOT
-Refuse to extract a path that contains a
-.Pa ..
-element anywhere within it.
-The default is to not refuse such paths.
-Note that paths ending in
-.Pa ..
-always cause an error, regardless of this flag.
-.It Cm ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS
-Refuse to extract an absolute path.
-The default is to not refuse such paths.
-.It Cm ARCHIVE_EXTRACT_SPARSE
-Scan data for blocks of NUL bytes and try to recreate them with holes.
-This results in sparse files, independent of whether the archive format
-supports or uses them.
-.It Cm ARCHIVE_EXTRACT_CLEAR_NOCHANGE_FFLAGS
-Before removing a file system object prior to replacing it, clear
-platform-specific file flags which might prevent its removal.
+See
+.Xr xattr 7
+.Pq Linux ,
+.Xr xattr 2
+.Pq Mac OS X ,
+or
+.Xr getextattr 8
+.Pq FreeBSD
+for more information on extended file attributes.
.El
.It Xo
.Fn archive_write_disk_set_group_lookup ,
@@ -223,60 +224,6 @@
.Xr getpwnam 3
and
.Xr getgrnam 3 .
-.It Fn archive_write_header
-Build and write a header using the data in the provided
-.Tn struct archive_entry
-structure.
-See
-.Xr archive_entry 3
-for information on creating and populating
-.Tn struct archive_entry
-objects.
-.It Fn archive_write_data
-Write data corresponding to the header just written.
-Returns number of bytes written or -1 on error.
-.It Fn archive_write_data_block
-Write data corresponding to the header just written.
-This is like
-.Fn archive_write_data
-except that it performs a seek on the file being
-written to the specified offset before writing the data.
-This is useful when restoring sparse files from archive
-formats that support sparse files.
-Returns number of bytes written or -1 on error.
-(Note: This is currently not supported for
-.Tn archive_write
-handles, only for
-.Tn archive_write_disk
-handles.)
-.It Fn archive_write_finish_entry
-Close out the entry just written.
-Ordinarily, clients never need to call this, as it
-is called automatically by
-.Fn archive_write_next_header
-and
-.Fn archive_write_close
-as needed.
-However, some file attributes are written to disk only
-after the file is closed, so this can be necessary
-if you need to work with the file on disk right away.
-.It Fn archive_write_close
-Set any attributes that could not be set during the initial restore.
-For example, directory timestamps are not restored initially because
-restoring a subsequent file would alter that timestamp.
-Similarly, non-writable directories are initially created with
-write permissions (so that their contents can be restored).
-The
-.Nm
-library maintains a list of all such deferred attributes and
-sets them when this function is invoked.
-.It Fn archive_write_finish
-This is a deprecated synonym for
-.Fn archive_write_free .
-.It Fn archive_write_free
-Invokes
-.Fn archive_write_close
-if it was not invoked manually, then releases all resources.
.El
More information about the
.Va struct archive
Modified: trunk/contrib/libarchive/libarchive/archive_write_disk_posix.c
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_write_disk_posix.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/archive_write_disk_posix.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -39,9 +39,9 @@
#ifdef HAVE_SYS_EXTATTR_H
#include <sys/extattr.h>
#endif
-#if defined(HAVE_SYS_XATTR_H)
+#if HAVE_SYS_XATTR_H
#include <sys/xattr.h>
-#elif defined(HAVE_ATTR_XATTR_H)
+#elif HAVE_ATTR_XATTR_H
#include <attr/xattr.h>
#endif
#ifdef HAVE_SYS_EA_H
@@ -110,6 +110,18 @@
#include <sys/fcntl1.h>
#endif
+/*
+ * Macro to cast st_mtime and time_t to an int64 so that 2 numbers can reliably be compared.
+ *
+ * It assumes that the input is an integer type of no more than 64 bits.
+ * If the number is less than zero, t must be a signed type, so it fits in
+ * int64_t. Otherwise, it's a nonnegative value so we can cast it to uint64_t
+ * without loss. But it could be a large unsigned value, so we have to clip it
+ * to INT64_MAX.*
+ */
+#define to_int64_time(t) \
+ ((t) < 0 ? (int64_t)(t) : (uint64_t)(t) > (uint64_t)INT64_MAX ? INT64_MAX : (int64_t)(t))
+
#if __APPLE__
#include <TargetConditionals.h>
#if TARGET_OS_MAC && !TARGET_OS_EMBEDDED && HAVE_QUARANTINE_H
@@ -308,7 +320,7 @@
#define MAXIMUM_DIR_MODE 0775
/*
- * Maxinum uncompressed size of a decmpfs block.
+ * Maximum uncompressed size of a decmpfs block.
*/
#define MAX_DECMPFS_BLOCK_SIZE (64 * 1024)
/*
@@ -323,7 +335,7 @@
#define RSRC_F_SIZE 50 /* Size of Resource fork footer. */
/* Size to write compressed data to resource fork. */
#define COMPRESSED_W_SIZE (64 * 1024)
-/* decmpfs difinitions. */
+/* decmpfs definitions. */
#define MAX_DECMPFS_XATTR_SIZE 3802
#ifndef DECMPFS_XATTR_NAME
#define DECMPFS_XATTR_NAME "com.apple.decmpfs"
@@ -336,14 +348,19 @@
#define HFS_BLOCKS(s) ((s) >> 12)
-static int check_symlinks_fsobj(char *path, int *error_number, struct archive_string *error_string, int flags);
+static void fsobj_error(int *, struct archive_string *, int, const char *,
+ const char *);
+static int check_symlinks_fsobj(char *, int *, struct archive_string *,
+ int);
static int check_symlinks(struct archive_write_disk *);
static int create_filesystem_object(struct archive_write_disk *);
-static struct fixup_entry *current_fixup(struct archive_write_disk *, const char *pathname);
+static struct fixup_entry *current_fixup(struct archive_write_disk *,
+ const char *pathname);
#if defined(HAVE_FCHDIR) && defined(PATH_MAX)
static void edit_deep_directories(struct archive_write_disk *ad);
#endif
-static int cleanup_pathname_fsobj(char *path, int *error_number, struct archive_string *error_string, int flags);
+static int cleanup_pathname_fsobj(char *, int *, struct archive_string *,
+ int);
static int cleanup_pathname(struct archive_write_disk *);
static int create_dir(struct archive_write_disk *, char *);
static int create_parent_dir(struct archive_write_disk *, char *);
@@ -374,11 +391,14 @@
static int _archive_write_disk_close(struct archive *);
static int _archive_write_disk_free(struct archive *);
-static int _archive_write_disk_header(struct archive *, struct archive_entry *);
+static int _archive_write_disk_header(struct archive *,
+ struct archive_entry *);
static int64_t _archive_write_disk_filter_bytes(struct archive *, int);
static int _archive_write_disk_finish_entry(struct archive *);
-static ssize_t _archive_write_disk_data(struct archive *, const void *, size_t);
-static ssize_t _archive_write_disk_data_block(struct archive *, const void *, size_t, int64_t);
+static ssize_t _archive_write_disk_data(struct archive *, const void *,
+ size_t);
+static ssize_t _archive_write_disk_data_block(struct archive *, const void *,
+ size_t, int64_t);
static int
lazy_stat(struct archive_write_disk *a)
@@ -555,10 +575,55 @@
if (a->flags & ARCHIVE_EXTRACT_TIME)
a->todo |= TODO_TIMES;
if (a->flags & ARCHIVE_EXTRACT_ACL) {
+#if ARCHIVE_ACL_DARWIN
+ /*
+ * On MacOS, platform ACLs get stored in mac_metadata, too.
+ * If we intend to extract mac_metadata and it is present
+ * we skip extracting libarchive NFSv4 ACLs.
+ */
+ size_t metadata_size;
+
+ if ((a->flags & ARCHIVE_EXTRACT_MAC_METADATA) == 0 ||
+ archive_entry_mac_metadata(a->entry,
+ &metadata_size) == NULL || metadata_size == 0)
+#endif
+#if ARCHIVE_ACL_LIBRICHACL
+ /*
+ * RichACLs are stored in an extended attribute.
+ * If we intend to extract extended attributes and have this
+ * attribute we skip extracting libarchive NFSv4 ACLs.
+ */
+ short extract_acls = 1;
+ if (a->flags & ARCHIVE_EXTRACT_XATTR && (
+ archive_entry_acl_types(a->entry) &
+ ARCHIVE_ENTRY_ACL_TYPE_NFS4)) {
+ const char *attr_name;
+ const void *attr_value;
+ size_t attr_size;
+ int i = archive_entry_xattr_reset(a->entry);
+ while (i--) {
+ archive_entry_xattr_next(a->entry, &attr_name,
+ &attr_value, &attr_size);
+ if (attr_name != NULL && attr_value != NULL &&
+ attr_size > 0 && strcmp(attr_name,
+ "trusted.richacl") == 0) {
+ extract_acls = 0;
+ break;
+ }
+ }
+ }
+ if (extract_acls)
+#endif
+#if ARCHIVE_ACL_DARWIN || ARCHIVE_ACL_LIBRICHACL
+ {
+#endif
if (archive_entry_filetype(a->entry) == AE_IFDIR)
a->deferred |= TODO_ACLS;
else
a->todo |= TODO_ACLS;
+#if ARCHIVE_ACL_DARWIN || ARCHIVE_ACL_LIBRICHACL
+ }
+#endif
}
if (a->flags & ARCHIVE_EXTRACT_MAC_METADATA) {
if (archive_entry_filetype(a->entry) == AE_IFDIR)
@@ -599,8 +664,21 @@
}
#endif
- if (a->flags & ARCHIVE_EXTRACT_XATTR)
+ if (a->flags & ARCHIVE_EXTRACT_XATTR) {
+#if ARCHIVE_XATTR_DARWIN
+ /*
+ * On MacOS, extended attributes get stored in mac_metadata,
+ * too. If we intend to extract mac_metadata and it is present
+ * we skip extracting extended attributes.
+ */
+ size_t metadata_size;
+
+ if ((a->flags & ARCHIVE_EXTRACT_MAC_METADATA) == 0 ||
+ archive_entry_mac_metadata(a->entry,
+ &metadata_size) == NULL || metadata_size == 0)
+#endif
a->todo |= TODO_XATTR;
+ }
if (a->flags & ARCHIVE_EXTRACT_FFLAGS)
a->todo |= TODO_FFLAGS;
if (a->flags & ARCHIVE_EXTRACT_SECURE_SYMLINKS) {
@@ -624,9 +702,9 @@
/*
* NOTE: UF_COMPRESSED is ignored even if the filesystem
* supports HFS+ Compression because the file should
- * have at least an extended attriute "com.apple.decmpfs"
+ * have at least an extended attribute "com.apple.decmpfs"
* before the flag is set to indicate that the file have
- * been compressed. If hte filesystem does not support
+ * been compressed. If the filesystem does not support
* HFS+ Compression the system call will fail.
*/
if (a->fd < 0 || fchflags(a->fd, UF_COMPRESSED) != 0)
@@ -649,7 +727,8 @@
if (a->restore_pwd >= 0) {
r = fchdir(a->restore_pwd);
if (r != 0) {
- archive_set_error(&a->archive, errno, "chdir() failure");
+ archive_set_error(&a->archive, errno,
+ "chdir() failure");
ret = ARCHIVE_FATAL;
}
close(a->restore_pwd);
@@ -697,7 +776,8 @@
}
if (archive_entry_birthtime_is_set(entry)) {
fe->birthtime = archive_entry_birthtime(entry);
- fe->birthtime_nanos = archive_entry_birthtime_nsec(entry);
+ fe->birthtime_nanos = archive_entry_birthtime_nsec(
+ entry);
} else {
/* If birthtime is unset, use mtime. */
fe->birthtime = fe->mtime;
@@ -723,7 +803,8 @@
return (ARCHIVE_FATAL);
fe->mac_metadata = malloc(metadata_size);
if (fe->mac_metadata != NULL) {
- memcpy(fe->mac_metadata, metadata, metadata_size);
+ memcpy(fe->mac_metadata, metadata,
+ metadata_size);
fe->mac_metadata_size = metadata_size;
fe->fixup |= TODO_MAC_METADATA;
}
@@ -1236,7 +1317,7 @@
ret = hfs_write_compressed_data(a, bytes_used + rsrc_size);
a->compressed_buffer_remaining = a->compressed_buffer_size;
- /* If the compressed size is not enouph smaller than
+ /* If the compressed size is not enough smaller than
* the uncompressed size. cancel HFS+ compression.
* TODO: study a behavior of ditto utility and improve
* the condition to fall back into no HFS+ compression. */
@@ -1341,7 +1422,7 @@
(uint32_t *)(a->resource_fork + RSRC_H_SIZE);
/* Set the block count to the resource fork. */
archive_le32enc(a->decmpfs_block_info++, block_count);
- /* Get the position where we are goint to set compressed
+ /* Get the position where we are going to set compressed
* data. */
a->compressed_rsrc_position =
RSRC_H_SIZE + 4 + (block_count * 8);
@@ -1414,7 +1495,7 @@
bytes_to_write = size;
/* Seek if necessary to the specified offset. */
if (a->offset < a->fd_offset) {
- /* Can't support backword move. */
+ /* Can't support backward move. */
archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
"Seek failed");
return (ARCHIVE_FATAL);
@@ -1480,7 +1561,8 @@
return (r);
if ((size_t)r < size) {
archive_set_error(&a->archive, 0,
- "Too much data: Truncating file at %ju bytes", (uintmax_t)a->filesize);
+ "Too much data: Truncating file at %ju bytes",
+ (uintmax_t)a->filesize);
return (ARCHIVE_WARN);
}
#if ARCHIVE_VERSION_NUMBER < 3999000
@@ -1678,9 +1760,11 @@
* ACLs that prevent attribute changes (including time).
*/
if (a->todo & TODO_ACLS) {
- int r2 = archive_write_disk_set_acls(&a->archive, a->fd,
- archive_entry_pathname(a->entry),
- archive_entry_acl(a->entry));
+ int r2;
+ r2 = archive_write_disk_set_acls(&a->archive, a->fd,
+ archive_entry_pathname(a->entry),
+ archive_entry_acl(a->entry),
+ archive_entry_mode(a->entry));
if (r2 < ret) ret = r2;
}
@@ -1767,10 +1851,9 @@
{
struct archive_write_disk *a;
- a = (struct archive_write_disk *)malloc(sizeof(*a));
+ a = (struct archive_write_disk *)calloc(1, sizeof(*a));
if (a == NULL)
return (NULL);
- memset(a, 0, sizeof(*a));
a->archive.magic = ARCHIVE_WRITE_DISK_MAGIC;
/* We're ready to write a header immediately. */
a->archive.state = ARCHIVE_STATE_HEADER;
@@ -2005,8 +2088,9 @@
if (en) {
/* Everything failed; give up here. */
- archive_set_error(&a->archive, en, "Can't create '%s'",
- a->name);
+ if ((&a->archive)->error == NULL)
+ archive_set_error(&a->archive, en, "Can't create '%s'",
+ a->name);
return (ARCHIVE_FAILED);
}
@@ -2028,6 +2112,7 @@
int r;
/* these for check_symlinks_fsobj */
char *linkname_copy; /* non-const copy of linkname */
+ struct stat st;
struct archive_string error_string;
int error_number;
@@ -2043,22 +2128,38 @@
if (linkname_copy == NULL) {
return (EPERM);
}
- /* TODO: consider using the cleaned-up path as the link target? */
- r = cleanup_pathname_fsobj(linkname_copy, &error_number, &error_string, a->flags);
+ /*
+ * TODO: consider using the cleaned-up path as the link
+ * target?
+ */
+ r = cleanup_pathname_fsobj(linkname_copy, &error_number,
+ &error_string, a->flags);
if (r != ARCHIVE_OK) {
- archive_set_error(&a->archive, error_number, "%s", error_string.s);
+ archive_set_error(&a->archive, error_number, "%s",
+ error_string.s);
free(linkname_copy);
- /* EPERM is more appropriate than error_number for our callers */
+ archive_string_free(&error_string);
+ /*
+ * EPERM is more appropriate than error_number for our
+ * callers
+ */
return (EPERM);
}
- r = check_symlinks_fsobj(linkname_copy, &error_number, &error_string, a->flags);
+ r = check_symlinks_fsobj(linkname_copy, &error_number,
+ &error_string, a->flags);
if (r != ARCHIVE_OK) {
- archive_set_error(&a->archive, error_number, "%s", error_string.s);
+ archive_set_error(&a->archive, error_number, "%s",
+ error_string.s);
free(linkname_copy);
- /* EPERM is more appropriate than error_number for our callers */
+ archive_string_free(&error_string);
+ /*
+ * EPERM is more appropriate than error_number for our
+ * callers
+ */
return (EPERM);
}
free(linkname_copy);
+ archive_string_free(&error_string);
r = link(linkname, a->name) ? errno : 0;
/*
* New cpio and pax formats allow hardlink entries
@@ -2076,11 +2177,20 @@
a->todo = 0;
a->deferred = 0;
} else if (r == 0 && a->filesize > 0) {
- a->fd = open(a->name,
- O_WRONLY | O_TRUNC | O_BINARY | O_CLOEXEC | O_NOFOLLOW);
- __archive_ensure_cloexec_flag(a->fd);
- if (a->fd < 0)
+#ifdef HAVE_LSTAT
+ r = lstat(a->name, &st);
+#else
+ r = stat(a->name, &st);
+#endif
+ if (r != 0)
r = errno;
+ else if ((st.st_mode & AE_IFMT) == AE_IFREG) {
+ a->fd = open(a->name, O_WRONLY | O_TRUNC |
+ O_BINARY | O_CLOEXEC | O_NOFOLLOW);
+ __archive_ensure_cloexec_flag(a->fd);
+ if (a->fd < 0)
+ r = errno;
+ }
}
return (r);
#endif
@@ -2227,8 +2337,8 @@
if (p->fixup & TODO_MODE_BASE)
chmod(p->name, p->mode);
if (p->fixup & TODO_ACLS)
- archive_write_disk_set_acls(&a->archive,
- -1, p->name, &p->acl);
+ archive_write_disk_set_acls(&a->archive, -1, p->name,
+ &p->acl, p->mode);
if (p->fixup & TODO_FFLAGS)
set_fflags_platform(a, -1, p->name,
p->mode, p->fflags_set, 0);
@@ -2388,6 +2498,17 @@
return (a->current_fixup);
}
+/* Error helper for new *_fsobj functions */
+static void
+fsobj_error(int *a_eno, struct archive_string *a_estr,
+ int err, const char *errstr, const char *path)
+{
+ if (a_eno)
+ *a_eno = err;
+ if (a_estr)
+ archive_string_sprintf(a_estr, "%s%s", errstr, path);
+}
+
/*
* TODO: Someday, integrate this with the deep dir support; they both
* scan the path and both can be optimized by comparing against other
@@ -2400,7 +2521,8 @@
* ARCHIVE_OK if there are none, otherwise puts an error in errmsg.
*/
static int
-check_symlinks_fsobj(char *path, int *error_number, struct archive_string *error_string, int flags)
+check_symlinks_fsobj(char *path, int *a_eno, struct archive_string *a_estr,
+ int flags)
{
#if !defined(HAVE_LSTAT)
/* Platform doesn't have lstat, so we can't look for symlinks. */
@@ -2433,7 +2555,8 @@
* - if it's a directory and it's not the last chunk, cd into it
* As we go:
* head points to the current (relative) path
- * tail points to the temporary \0 terminating the segment we're currently examining
+ * tail points to the temporary \0 terminating the segment we're
+ * currently examining
* c holds what used to be in *tail
* last is 1 if this is the last tail
*/
@@ -2455,7 +2578,9 @@
* Exiting the loop with break is okay; continue is not.
*/
while (!last) {
- /* Skip the separator we just consumed, plus any adjacent ones */
+ /*
+ * Skip the separator we just consumed, plus any adjacent ones
+ */
while (*tail == '/')
++tail;
/* Skip the next path element. */
@@ -2474,19 +2599,20 @@
if (errno == ENOENT) {
break;
} else {
- /* Treat any other error as fatal - best to be paranoid here
- * Note: This effectively disables deep directory
- * support when security checks are enabled.
- * Otherwise, very long pathnames that trigger
- * an error here could evade the sandbox.
- * TODO: We could do better, but it would probably
- * require merging the symlink checks with the
- * deep-directory editing. */
- if (error_number) *error_number = errno;
- if (error_string)
- archive_string_sprintf(error_string,
- "Could not stat %s",
- path);
+ /*
+ * Treat any other error as fatal - best to be
+ * paranoid here.
+ * Note: This effectively disables deep
+ * directory support when security checks are
+ * enabled. Otherwise, very long pathnames that
+ * trigger an error here could evade the
+ * sandbox.
+ * TODO: We could do better, but it would
+ * probably require merging the symlink checks
+ * with the deep-directory editing.
+ */
+ fsobj_error(a_eno, a_estr, errno,
+ "Could not stat ", path);
res = ARCHIVE_FAILED;
break;
}
@@ -2494,11 +2620,8 @@
if (!last) {
if (chdir(head) != 0) {
tail[0] = c;
- if (error_number) *error_number = errno;
- if (error_string)
- archive_string_sprintf(error_string,
- "Could not chdir %s",
- path);
+ fsobj_error(a_eno, a_estr, errno,
+ "Could not chdir ", path);
res = (ARCHIVE_FATAL);
break;
}
@@ -2514,11 +2637,9 @@
*/
if (unlink(head)) {
tail[0] = c;
- if (error_number) *error_number = errno;
- if (error_string)
- archive_string_sprintf(error_string,
- "Could not remove symlink %s",
- path);
+ fsobj_error(a_eno, a_estr, errno,
+ "Could not remove symlink ",
+ path);
res = ARCHIVE_FAILED;
break;
}
@@ -2529,13 +2650,14 @@
* symlink with another symlink.
*/
tail[0] = c;
- /* FIXME: not sure how important this is to restore
+ /*
+ * FIXME: not sure how important this is to
+ * restore
+ */
+ /*
if (!S_ISLNK(path)) {
- if (error_number) *error_number = 0;
- if (error_string)
- archive_string_sprintf(error_string,
- "Removing symlink %s",
- path);
+ fsobj_error(a_eno, a_estr, 0,
+ "Removing symlink ", path);
}
*/
/* Symlink gone. No more problem! */
@@ -2545,22 +2667,60 @@
/* User asked us to remove problems. */
if (unlink(head) != 0) {
tail[0] = c;
- if (error_number) *error_number = 0;
- if (error_string)
- archive_string_sprintf(error_string,
- "Cannot remove intervening symlink %s",
- path);
+ fsobj_error(a_eno, a_estr, 0,
+ "Cannot remove intervening "
+ "symlink ", path);
res = ARCHIVE_FAILED;
break;
}
tail[0] = c;
+ } else if ((flags &
+ ARCHIVE_EXTRACT_SECURE_SYMLINKS) == 0) {
+ /*
+ * We are not the last element and we want to
+ * follow symlinks if they are a directory.
+ *
+ * This is needed to extract hardlinks over
+ * symlinks.
+ */
+ r = stat(head, &st);
+ if (r != 0) {
+ tail[0] = c;
+ if (errno == ENOENT) {
+ break;
+ } else {
+ fsobj_error(a_eno, a_estr,
+ errno,
+ "Could not stat ", path);
+ res = (ARCHIVE_FAILED);
+ break;
+ }
+ } else if (S_ISDIR(st.st_mode)) {
+ if (chdir(head) != 0) {
+ tail[0] = c;
+ fsobj_error(a_eno, a_estr,
+ errno,
+ "Could not chdir ", path);
+ res = (ARCHIVE_FATAL);
+ break;
+ }
+ /*
+ * Our view is now from inside
+ * this dir:
+ */
+ head = tail + 1;
+ } else {
+ tail[0] = c;
+ fsobj_error(a_eno, a_estr, 0,
+ "Cannot extract through "
+ "symlink ", path);
+ res = ARCHIVE_FAILED;
+ break;
+ }
} else {
tail[0] = c;
- if (error_number) *error_number = 0;
- if (error_string)
- archive_string_sprintf(error_string,
- "Cannot extract through symlink %s",
- path);
+ fsobj_error(a_eno, a_estr, 0,
+ "Cannot extract through symlink ", path);
res = ARCHIVE_FAILED;
break;
}
@@ -2577,10 +2737,8 @@
if (restore_pwd >= 0) {
r = fchdir(restore_pwd);
if (r != 0) {
- if(error_number) *error_number = errno;
- if(error_string)
- archive_string_sprintf(error_string,
- "chdir() failure");
+ fsobj_error(a_eno, a_estr, errno,
+ "chdir() failure", "");
}
close(restore_pwd);
restore_pwd = -1;
@@ -2605,9 +2763,11 @@
int error_number;
int rc;
archive_string_init(&error_string);
- rc = check_symlinks_fsobj(a->name, &error_number, &error_string, a->flags);
+ rc = check_symlinks_fsobj(a->name, &error_number, &error_string,
+ a->flags);
if (rc != ARCHIVE_OK) {
- archive_set_error(&a->archive, error_number, "%s", error_string.s);
+ archive_set_error(&a->archive, error_number, "%s",
+ error_string.s);
}
archive_string_free(&error_string);
a->pst = NULL; /* to be safe */
@@ -2625,7 +2785,7 @@
* See also : http://msdn.microsoft.com/en-us/library/aa365247.aspx
*/
static void
-cleanup_pathname_win(struct archive_write_disk *a)
+cleanup_pathname_win(char *path)
{
wchar_t wc;
char *p;
@@ -2636,7 +2796,7 @@
mb = 0;
complete = 1;
utf8 = (strcmp(nl_langinfo(CODESET), "UTF-8") == 0)? 1: 0;
- for (p = a->name; *p != '\0'; p++) {
+ for (p = path; *p != '\0'; p++) {
++alen;
if (*p == '\\') {
/* If previous byte is smaller than 128,
@@ -2661,7 +2821,7 @@
/*
* Convert path separator in wide-character.
*/
- p = a->name;
+ p = path;
while (*p != '\0' && alen) {
l = mbtowc(&wc, p, alen);
if (l == (size_t)-1) {
@@ -2688,7 +2848,8 @@
* is set) if the path is absolute.
*/
static int
-cleanup_pathname_fsobj(char *path, int *error_number, struct archive_string *error_string, int flags)
+cleanup_pathname_fsobj(char *path, int *a_eno, struct archive_string *a_estr,
+ int flags)
{
char *dest, *src;
char separator = '\0';
@@ -2695,23 +2856,19 @@
dest = src = path;
if (*src == '\0') {
- if (error_number) *error_number = ARCHIVE_ERRNO_MISC;
- if (error_string)
- archive_string_sprintf(error_string,
- "Invalid empty pathname");
+ fsobj_error(a_eno, a_estr, ARCHIVE_ERRNO_MISC,
+ "Invalid empty ", "pathname");
return (ARCHIVE_FAILED);
}
#if defined(__CYGWIN__)
- cleanup_pathname_win(a);
+ cleanup_pathname_win(path);
#endif
/* Skip leading '/'. */
if (*src == '/') {
if (flags & ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS) {
- if (error_number) *error_number = ARCHIVE_ERRNO_MISC;
- if (error_string)
- archive_string_sprintf(error_string,
- "Path is absolute");
+ fsobj_error(a_eno, a_estr, ARCHIVE_ERRNO_MISC,
+ "Path is ", "absolute");
return (ARCHIVE_FAILED);
}
@@ -2738,11 +2895,11 @@
} else if (src[1] == '.') {
if (src[2] == '/' || src[2] == '\0') {
/* Conditionally warn about '..' */
- if (flags & ARCHIVE_EXTRACT_SECURE_NODOTDOT) {
- if (error_number) *error_number = ARCHIVE_ERRNO_MISC;
- if (error_string)
- archive_string_sprintf(error_string,
- "Path contains '..'");
+ if (flags
+ & ARCHIVE_EXTRACT_SECURE_NODOTDOT) {
+ fsobj_error(a_eno, a_estr,
+ ARCHIVE_ERRNO_MISC,
+ "Path contains ", "'..'");
return (ARCHIVE_FAILED);
}
}
@@ -2795,9 +2952,11 @@
int error_number;
int rc;
archive_string_init(&error_string);
- rc = cleanup_pathname_fsobj(a->name, &error_number, &error_string, a->flags);
+ rc = cleanup_pathname_fsobj(a->name, &error_number, &error_string,
+ a->flags);
if (rc != ARCHIVE_OK) {
- archive_set_error(&a->archive, error_number, "%s", error_string.s);
+ archive_set_error(&a->archive, error_number, "%s",
+ error_string.s);
}
archive_string_free(&error_string);
return rc;
@@ -2881,7 +3040,8 @@
}
} else if (errno != ENOENT && errno != ENOTDIR) {
/* Stat failed? */
- archive_set_error(&a->archive, errno, "Can't test directory '%s'", path);
+ archive_set_error(&a->archive, errno,
+ "Can't test directory '%s'", path);
return (ARCHIVE_FAILED);
} else if (slash != NULL) {
*slash = '\0';
@@ -3346,12 +3506,19 @@
#ifdef UF_APPEND
critical_flags |= UF_APPEND;
#endif
-#ifdef EXT2_APPEND_FL
+#if defined(FS_APPEND_FL)
+ critical_flags |= FS_APPEND_FL;
+#elif defined(EXT2_APPEND_FL)
critical_flags |= EXT2_APPEND_FL;
#endif
-#ifdef EXT2_IMMUTABLE_FL
+#if defined(FS_IMMUTABLE_FL)
+ critical_flags |= FS_IMMUTABLE_FL;
+#elif defined(EXT2_IMMUTABLE_FL)
critical_flags |= EXT2_IMMUTABLE_FL;
#endif
+#ifdef FS_JOURNAL_DATA_FL
+ critical_flags |= FS_JOURNAL_DATA_FL;
+#endif
if (a->todo & TODO_FFLAGS) {
archive_entry_fflags(a->entry, &set, &clear);
@@ -3406,7 +3573,8 @@
nochange_flags |= EXT2_IMMUTABLE_FL;
#endif
- return (set_fflags_platform(a, a->fd, a->name, mode, 0, nochange_flags));
+ return (set_fflags_platform(a, a->fd, a->name, mode, 0,
+ nochange_flags));
}
@@ -3462,7 +3630,10 @@
return (ARCHIVE_WARN);
}
-#elif defined(EXT2_IOC_GETFLAGS) && defined(EXT2_IOC_SETFLAGS) && defined(HAVE_WORKING_EXT2_IOC_GETFLAGS)
+#elif (defined(FS_IOC_GETFLAGS) && defined(FS_IOC_SETFLAGS) && \
+ defined(HAVE_WORKING_FS_IOC_GETFLAGS)) || \
+ (defined(EXT2_IOC_GETFLAGS) && defined(EXT2_IOC_SETFLAGS) && \
+ defined(HAVE_WORKING_EXT2_IOC_GETFLAGS))
/*
* Linux uses ioctl() to read and write file flags.
*/
@@ -3475,7 +3646,7 @@
int newflags, oldflags;
int sf_mask = 0;
- if (set == 0 && clear == 0)
+ if (set == 0 && clear == 0)
return (ARCHIVE_OK);
/* Only regular files and dirs can have flags. */
if (!S_ISREG(mode) && !S_ISDIR(mode))
@@ -3496,12 +3667,19 @@
* defines. (?) The code below degrades reasonably gracefully
* if sf_mask is incomplete.
*/
-#ifdef EXT2_IMMUTABLE_FL
+#if defined(FS_IMMUTABLE_FL)
+ sf_mask |= FS_IMMUTABLE_FL;
+#elif defined(EXT2_IMMUTABLE_FL)
sf_mask |= EXT2_IMMUTABLE_FL;
#endif
-#ifdef EXT2_APPEND_FL
+#if defined(FS_APPEND_FL)
+ sf_mask |= FS_APPEND_FL;
+#elif defined(EXT2_APPEND_FL)
sf_mask |= EXT2_APPEND_FL;
#endif
+#if defined(FS_JOURNAL_DATA_FL)
+ sf_mask |= FS_JOURNAL_DATA_FL;
+#endif
/*
* XXX As above, this would be way simpler if we didn't have
* to read the current flags from disk. XXX
@@ -3509,12 +3687,24 @@
ret = ARCHIVE_OK;
/* Read the current file flags. */
- if (ioctl(myfd, EXT2_IOC_GETFLAGS, &oldflags) < 0)
+ if (ioctl(myfd,
+#ifdef FS_IOC_GETFLAGS
+ FS_IOC_GETFLAGS,
+#else
+ EXT2_IOC_GETFLAGS,
+#endif
+ &oldflags) < 0)
goto fail;
/* Try setting the flags as given. */
newflags = (oldflags & ~clear) | set;
- if (ioctl(myfd, EXT2_IOC_SETFLAGS, &newflags) >= 0)
+ if (ioctl(myfd,
+#ifdef FS_IOC_SETFLAGS
+ FS_IOC_SETFLAGS,
+#else
+ EXT2_IOC_SETFLAGS,
+#endif
+ &newflags) >= 0)
goto cleanup;
if (errno != EPERM)
goto fail;
@@ -3523,7 +3713,13 @@
newflags &= ~sf_mask;
oldflags &= sf_mask;
newflags |= oldflags;
- if (ioctl(myfd, EXT2_IOC_SETFLAGS, &newflags) >= 0)
+ if (ioctl(myfd,
+#ifdef FS_IOC_SETFLAGS
+ FS_IOC_SETFLAGS,
+#else
+ EXT2_IOC_SETFLAGS,
+#endif
+ &newflags) >= 0)
goto cleanup;
/* We couldn't set the flags, so report the failure. */
@@ -3887,9 +4083,9 @@
}
#endif
-#if HAVE_LSETXATTR || HAVE_LSETEA
+#if ARCHIVE_XATTR_LINUX || ARCHIVE_XATTR_DARWIN || ARCHIVE_XATTR_AIX
/*
- * Restore extended attributes - Linux and AIX implementations:
+ * Restore extended attributes - Linux, Darwin and AIX implementations:
* AIX' ea interface is syntaxwise identical to the Linux xattr interface.
*/
static int
@@ -3896,60 +4092,89 @@
set_xattrs(struct archive_write_disk *a)
{
struct archive_entry *entry = a->entry;
- static int warning_done = 0;
+ struct archive_string errlist;
int ret = ARCHIVE_OK;
int i = archive_entry_xattr_reset(entry);
+ short fail = 0;
+ archive_string_init(&errlist);
+
while (i--) {
const char *name;
const void *value;
size_t size;
+ int e;
+
archive_entry_xattr_next(entry, &name, &value, &size);
- if (name != NULL &&
- strncmp(name, "xfsroot.", 8) != 0 &&
- strncmp(name, "system.", 7) != 0) {
- int e;
-#if HAVE_FSETXATTR
- if (a->fd >= 0)
- e = fsetxattr(a->fd, name, value, size, 0);
- else
-#elif HAVE_FSETEA
- if (a->fd >= 0)
- e = fsetea(a->fd, name, value, size, 0);
- else
+
+ if (name == NULL)
+ continue;
+#if ARCHIVE_XATTR_LINUX
+ /* Linux: quietly skip POSIX.1e ACL extended attributes */
+ if (strncmp(name, "system.", 7) == 0 &&
+ (strcmp(name + 7, "posix_acl_access") == 0 ||
+ strcmp(name + 7, "posix_acl_default") == 0))
+ continue;
+ if (strncmp(name, "trusted.SGI_", 12) == 0 &&
+ (strcmp(name + 12, "ACL_DEFAULT") == 0 ||
+ strcmp(name + 12, "ACL_FILE") == 0))
+ continue;
+
+ /* Linux: xfsroot namespace is obsolete and unsupported */
+ if (strncmp(name, "xfsroot.", 8) == 0) {
+ fail = 1;
+ archive_strcat(&errlist, name);
+ archive_strappend_char(&errlist, ' ');
+ continue;
+ }
#endif
- {
-#if HAVE_LSETXATTR
- e = lsetxattr(archive_entry_pathname(entry),
- name, value, size, 0);
-#elif HAVE_LSETEA
- e = lsetea(archive_entry_pathname(entry),
- name, value, size, 0);
+
+ if (a->fd >= 0) {
+#if ARCHIVE_XATTR_LINUX
+ e = fsetxattr(a->fd, name, value, size, 0);
+#elif ARCHIVE_XATTR_DARWIN
+ e = fsetxattr(a->fd, name, value, size, 0, 0);
+#elif ARCHIVE_XATTR_AIX
+ e = fsetea(a->fd, name, value, size, 0);
#endif
- }
- if (e == -1) {
- if (errno == ENOTSUP || errno == ENOSYS) {
- if (!warning_done) {
- warning_done = 1;
- archive_set_error(&a->archive, errno,
- "Cannot restore extended "
- "attributes on this file "
- "system");
- }
- } else
- archive_set_error(&a->archive, errno,
- "Failed to set extended attribute");
- ret = ARCHIVE_WARN;
- }
} else {
- archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
- "Invalid extended attribute encountered");
+#if ARCHIVE_XATTR_LINUX
+ e = lsetxattr(archive_entry_pathname(entry),
+ name, value, size, 0);
+#elif ARCHIVE_XATTR_DARWIN
+ e = setxattr(archive_entry_pathname(entry),
+ name, value, size, 0, XATTR_NOFOLLOW);
+#elif ARCHIVE_XATTR_AIX
+ e = lsetea(archive_entry_pathname(entry),
+ name, value, size, 0);
+#endif
+ }
+ if (e == -1) {
ret = ARCHIVE_WARN;
+ archive_strcat(&errlist, name);
+ archive_strappend_char(&errlist, ' ');
+ if (errno != ENOTSUP && errno != ENOSYS)
+ fail = 1;
}
}
+
+ if (ret == ARCHIVE_WARN) {
+ if (fail && errlist.length > 0) {
+ errlist.length--;
+ errlist.s[errlist.length] = '\0';
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
+ "Cannot restore extended attributes: %s",
+ errlist.s);
+ } else
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
+ "Cannot restore extended "
+ "attributes on this file system.");
+ }
+
+ archive_string_free(&errlist);
return (ret);
}
-#elif HAVE_EXTATTR_SET_FILE && HAVE_DECL_EXTATTR_NAMESPACE_USER
+#elif ARCHIVE_XATTR_FREEBSD
/*
* Restore extended attributes - FreeBSD implementation
*/
@@ -3957,10 +4182,13 @@
set_xattrs(struct archive_write_disk *a)
{
struct archive_entry *entry = a->entry;
- static int warning_done = 0;
+ struct archive_string errlist;
int ret = ARCHIVE_OK;
int i = archive_entry_xattr_reset(entry);
+ short fail = 0;
+ archive_string_init(&errlist);
+
while (i--) {
const char *name;
const void *value;
@@ -3975,43 +4203,47 @@
name += 5;
namespace = EXTATTR_NAMESPACE_USER;
} else {
- /* Warn about other extended attributes. */
- archive_set_error(&a->archive,
- ARCHIVE_ERRNO_FILE_FORMAT,
- "Can't restore extended attribute ``%s''",
- name);
+ /* Other namespaces are unsupported */
+ archive_strcat(&errlist, name);
+ archive_strappend_char(&errlist, ' ');
+ fail = 1;
ret = ARCHIVE_WARN;
continue;
}
- errno = 0;
-#if HAVE_EXTATTR_SET_FD
- if (a->fd >= 0)
- e = extattr_set_fd(a->fd, namespace, name, value, size);
- else
-#endif
- /* TODO: should we use extattr_set_link() instead? */
- {
- e = extattr_set_file(archive_entry_pathname(entry),
- namespace, name, value, size);
+
+ if (a->fd >= 0) {
+ e = extattr_set_fd(a->fd, namespace, name,
+ value, size);
+ } else {
+ e = extattr_set_link(
+ archive_entry_pathname(entry), namespace,
+ name, value, size);
}
if (e != (ssize_t)size) {
- if (errno == ENOTSUP || errno == ENOSYS) {
- if (!warning_done) {
- warning_done = 1;
- archive_set_error(&a->archive, errno,
- "Cannot restore extended "
- "attributes on this file "
- "system");
- }
- } else {
- archive_set_error(&a->archive, errno,
- "Failed to set extended attribute");
- }
-
+ archive_strcat(&errlist, name);
+ archive_strappend_char(&errlist, ' ');
ret = ARCHIVE_WARN;
+ if (errno != ENOTSUP && errno != ENOSYS)
+ fail = 1;
}
}
}
+
+ if (ret == ARCHIVE_WARN) {
+ if (fail && errlist.length > 0) {
+ errlist.length--;
+ errlist.s[errlist.length] = '\0';
+
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
+ "Cannot restore extended attributes: %s",
+ errlist.s);
+ } else
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
+ "Cannot restore extended "
+ "attributes on this file system.");
+ }
+
+ archive_string_free(&errlist);
return (ret);
}
#else
@@ -4044,10 +4276,10 @@
{
/* First, test the seconds and return if we have a definite answer. */
/* Definitely older. */
- if (st->st_mtime < archive_entry_mtime(entry))
+ if (to_int64_time(st->st_mtime) < to_int64_time(archive_entry_mtime(entry)))
return (1);
/* Definitely younger. */
- if (st->st_mtime > archive_entry_mtime(entry))
+ if (to_int64_time(st->st_mtime) > to_int64_time(archive_entry_mtime(entry)))
return (0);
/* If this platform supports fractional seconds, try those. */
#if HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC
@@ -4077,5 +4309,19 @@
return (0);
}
+#ifndef ARCHIVE_ACL_SUPPORT
+int
+archive_write_disk_set_acls(struct archive *a, int fd, const char *name,
+ struct archive_acl *abstract_acl, __LA_MODE_T mode)
+{
+ (void)a; /* UNUSED */
+ (void)fd; /* UNUSED */
+ (void)name; /* UNUSED */
+ (void)abstract_acl; /* UNUSED */
+ (void)mode; /* UNUSED */
+ return (ARCHIVE_OK);
+}
+#endif
+
#endif /* !_WIN32 || __CYGWIN__ */
Modified: trunk/contrib/libarchive/libarchive/archive_write_disk_private.h
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_write_disk_private.h 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/archive_write_disk_private.h 2018-06-19 20:42:35 UTC (rev 11134)
@@ -33,11 +33,13 @@
#ifndef ARCHIVE_WRITE_DISK_PRIVATE_H_INCLUDED
#define ARCHIVE_WRITE_DISK_PRIVATE_H_INCLUDED
+#include "archive_platform_acl.h"
#include "archive_acl_private.h"
+#include "archive_entry.h"
struct archive_write_disk;
-int
-archive_write_disk_set_acls(struct archive *, int /* fd */, const char * /* pathname */, struct archive_acl *);
+int archive_write_disk_set_acls(struct archive *, int, const char *,
+ struct archive_acl *, __LA_MODE_T);
#endif
Modified: trunk/contrib/libarchive/libarchive/archive_write_disk_set_standard_lookup.c
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_write_disk_set_standard_lookup.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/archive_write_disk_set_standard_lookup.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -84,15 +84,13 @@
int
archive_write_disk_set_standard_lookup(struct archive *a)
{
- struct bucket *ucache = malloc(cache_size * sizeof(struct bucket));
- struct bucket *gcache = malloc(cache_size * sizeof(struct bucket));
+ struct bucket *ucache = calloc(cache_size, sizeof(struct bucket));
+ struct bucket *gcache = calloc(cache_size, sizeof(struct bucket));
if (ucache == NULL || gcache == NULL) {
free(ucache);
free(gcache);
return (ARCHIVE_FATAL);
}
- memset(ucache, 0, cache_size * sizeof(struct bucket));
- memset(gcache, 0, cache_size * sizeof(struct bucket));
archive_write_disk_set_group_lookup(a, gcache, lookup_gid, cleanup);
archive_write_disk_set_user_lookup(a, ucache, lookup_uid, cleanup);
return (ARCHIVE_OK);
Modified: trunk/contrib/libarchive/libarchive/archive_write_disk_windows.c
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_write_disk_windows.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/archive_write_disk_windows.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -192,7 +192,7 @@
/*
* Default mode for dirs created automatically (will be modified by umask).
- * Note that POSIX specifies 0777 for implicity-created dirs, "modified
+ * Note that POSIX specifies 0777 for implicitly-created dirs, "modified
* by the process' file creation mask."
*/
#define DEFAULT_DIR_MODE 0777
@@ -396,7 +396,7 @@
}
/*
- * A full-pathname pointig a network drive
+ * A full-pathname pointing to a network drive
* like "\\<server-name>\<share-name>\file".
*/
if (wnp[0] == L'\\' && wnp[1] == L'\\' && wnp[2] != L'\\') {
@@ -1221,10 +1221,9 @@
{
struct archive_write_disk *a;
- a = (struct archive_write_disk *)malloc(sizeof(*a));
+ a = (struct archive_write_disk *)calloc(1, sizeof(*a));
if (a == NULL)
return (NULL);
- memset(a, 0, sizeof(*a));
a->archive.magic = ARCHIVE_WRITE_DISK_MAGIC;
/* We're ready to write a header immediately. */
a->archive.state = ARCHIVE_STATE_HEADER;
Modified: trunk/contrib/libarchive/libarchive/archive_write_finish_entry.3
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_write_finish_entry.3 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/archive_write_finish_entry.3 2018-06-19 20:42:35 UTC (rev 11134)
@@ -24,7 +24,7 @@
.\"
.\" $FreeBSD$
.\"
-.Dd February 2, 2012
+.Dd February 28, 2017
.Dt ARCHIVE_WRITE_FINISH_ENTRY 3
.Os
.Sh NAME
@@ -45,6 +45,9 @@
and
.Fn archive_write_close
as needed.
+For
+.Tn archive_write_disk
+handles, this flushes pending file attribute changes like modification time.
.\" .Sh EXAMPLE
.Sh RETURN VALUES
This function returns
Modified: trunk/contrib/libarchive/libarchive/archive_write_format.3
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_write_format.3 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/archive_write_format.3 2018-06-19 20:42:35 UTC (rev 11134)
@@ -108,7 +108,6 @@
These functions set the format that will be used for the archive.
.Pp
The library can write a variety of common archive formats.
-
.Bl -tag -width indent
.It Fn archive_write_set_format
Sets the format based on the format code (see
Modified: trunk/contrib/libarchive/libarchive/archive_write_open.3
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_write_open.3 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/archive_write_open.3 2018-06-19 20:42:35 UTC (rev 11134)
@@ -66,6 +66,7 @@
This is the most generic form of this function, which accepts
pointers to three callback functions which will be invoked by
the compression layer to write the constructed archive.
+This does not alter the default archive padding.
.It Fn archive_write_open_fd
A convenience form of
.Fn archive_write_open
@@ -123,6 +124,8 @@
You should be careful to ensure that this variable
remains allocated until after the archive is
closed.
+This function will disable padding unless you
+have specifically set the block size.
.El
More information about the
.Va struct archive
@@ -129,6 +132,13 @@
object and the overall design of the library can be found in the
.Xr libarchive 3
overview.
+.Pp
+Note that the convenience forms above vary in how
+they block the output.
+See
+.Xr archive_write_blocksize 3
+if you need to control the block size used for writes
+or the end-of-file padding behavior.
.\"
.Sh CLIENT CALLBACKS
To use this library, you will need to define and register
@@ -226,6 +236,7 @@
.Xr tar 1 ,
.Xr libarchive 3 ,
.Xr archive_write 3 ,
+.Xr archive_write_blocksize 3 ,
.Xr archive_write_filter 3 ,
.Xr archive_write_format 3 ,
.Xr archive_write_new 3 ,
Modified: trunk/contrib/libarchive/libarchive/archive_write_open_memory.c
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_write_open_memory.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/archive_write_open_memory.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -53,12 +53,11 @@
{
struct write_memory_data *mine;
- mine = (struct write_memory_data *)malloc(sizeof(*mine));
+ mine = (struct write_memory_data *)calloc(1, sizeof(*mine));
if (mine == NULL) {
archive_set_error(a, ENOMEM, "No memory");
return (ARCHIVE_FATAL);
}
- memset(mine, 0, sizeof(*mine));
mine->buff = buff;
mine->size = buffSize;
mine->client_size = used;
Modified: trunk/contrib/libarchive/libarchive/archive_write_set_format.c
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_write_set_format.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/archive_write_set_format.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -38,7 +38,7 @@
#include "archive_private.h"
/* A table that maps format codes to functions. */
-static
+static const
struct { int code; int (*setter)(struct archive *); } codes[] =
{
{ ARCHIVE_FORMAT_7ZIP, archive_write_set_format_7zip },
Modified: trunk/contrib/libarchive/libarchive/archive_write_set_format_7zip.c
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_write_set_format_7zip.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/archive_write_set_format_7zip.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -205,7 +205,7 @@
/*
* The list of the file entries which has its contents is used to
* manage struct file objects.
- * We use 'next' a menber of struct file to chain.
+ * We use 'next' (a member of struct file) to chain.
*/
struct {
struct file *first;
@@ -1358,7 +1358,7 @@
if (r < 0)
return (r);
- /* Write Nume size. */
+ /* Write Name size. */
r = enc_uint64(a, zip->total_bytes_entry_name+1);
if (r < 0)
return (r);
Modified: trunk/contrib/libarchive/libarchive/archive_write_set_format_ar.c
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_write_set_format_ar.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/archive_write_set_format_ar.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -126,12 +126,11 @@
if (a->format_free != NULL)
(a->format_free)(a);
- ar = (struct ar_w *)malloc(sizeof(*ar));
+ ar = (struct ar_w *)calloc(1, sizeof(*ar));
if (ar == NULL) {
archive_set_error(&a->archive, ENOMEM, "Can't allocate ar data");
return (ARCHIVE_FATAL);
}
- memset(ar, 0, sizeof(*ar));
a->format_data = ar;
a->format_name = "ar";
Modified: trunk/contrib/libarchive/libarchive/archive_write_set_format_by_name.c
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_write_set_format_by_name.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/archive_write_set_format_by_name.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -41,7 +41,7 @@
#include "archive_private.h"
/* A table that maps names to functions. */
-static
+static const
struct { const char *name; int (*setter)(struct archive *); } names[] =
{
{ "7zip", archive_write_set_format_7zip },
Modified: trunk/contrib/libarchive/libarchive/archive_write_set_format_cpio.c
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_write_set_format_cpio.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/archive_write_set_format_cpio.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -289,7 +289,7 @@
sconv = get_sconv(a);
#if defined(_WIN32) && !defined(__CYGWIN__)
- /* Make sure the path separators in pahtname, hardlink and symlink
+ /* Make sure the path separators in pathname, hardlink and symlink
* are all slash '/', not the Windows path separator '\'. */
entry_main = __la_win_entry_in_posix_pathseparator(entry);
if (entry_main == NULL) {
Modified: trunk/contrib/libarchive/libarchive/archive_write_set_format_cpio_newc.c
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_write_set_format_cpio_newc.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/archive_write_set_format_cpio_newc.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -116,12 +116,11 @@
if (a->format_free != NULL)
(a->format_free)(a);
- cpio = (struct cpio *)malloc(sizeof(*cpio));
+ cpio = (struct cpio *)calloc(1, sizeof(*cpio));
if (cpio == NULL) {
archive_set_error(&a->archive, ENOMEM, "Can't allocate cpio data");
return (ARCHIVE_FATAL);
}
- memset(cpio, 0, sizeof(*cpio));
a->format_data = cpio;
a->format_name = "cpio";
a->format_options = archive_write_newc_options;
@@ -232,7 +231,7 @@
sconv = get_sconv(a);
#if defined(_WIN32) && !defined(__CYGWIN__)
- /* Make sure the path separators in pahtname, hardlink and symlink
+ /* Make sure the path separators in pathname, hardlink and symlink
* are all slash '/', not the Windows path separator '\'. */
entry_main = __la_win_entry_in_posix_pathseparator(entry);
if (entry_main == NULL) {
Modified: trunk/contrib/libarchive/libarchive/archive_write_set_format_filter_by_ext.c
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_write_set_format_filter_by_ext.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/archive_write_set_format_filter_by_ext.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -42,7 +42,7 @@
#include "archive_private.h"
/* A table that maps names to functions. */
-static
+static const
struct { const char *name; int (*format)(struct archive *); int (*filter)(struct archive *); } names[] =
{
{ ".7z", archive_write_set_format_7zip, archive_write_add_filter_none},
Modified: trunk/contrib/libarchive/libarchive/archive_write_set_format_gnutar.c
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_write_set_format_gnutar.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/archive_write_set_format_gnutar.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -119,9 +119,9 @@
'0','0','0','0','0','0', '0','\0',
/* gid, null termination: 8 bytes */
'0','0','0','0','0','0', '0','\0',
- /* size, space termation: 12 bytes */
+ /* size, space termination: 12 bytes */
'0','0','0','0','0','0','0','0','0','0','0', '\0',
- /* mtime, space termation: 12 bytes */
+ /* mtime, space termination: 12 bytes */
'0','0','0','0','0','0','0','0','0','0','0', '\0',
/* Initial checksum value: 8 spaces */
' ',' ',' ',' ',' ',' ',' ',' ',
@@ -368,7 +368,7 @@
}
#if defined(_WIN32) && !defined(__CYGWIN__)
- /* Make sure the path separators in pahtname, hardlink and symlink
+ /* Make sure the path separators in pathname, hardlink and symlink
* are all slash '/', not the Windows path separator '\'. */
entry_main = __la_win_entry_in_posix_pathseparator(entry);
if (entry_main == NULL) {
@@ -478,15 +478,15 @@
archive_entry_set_pathname(temp, "././@LongLink");
archive_entry_set_size(temp, length);
ret = archive_format_gnutar_header(a, buff, temp, 'K');
+ archive_entry_free(temp);
if (ret < ARCHIVE_WARN)
goto exit_write_header;
ret = __archive_write_output(a, buff, 512);
- if(ret < ARCHIVE_WARN)
+ if (ret < ARCHIVE_WARN)
goto exit_write_header;
- archive_entry_free(temp);
/* Write name and trailing null byte. */
ret = __archive_write_output(a, gnutar->linkname, length);
- if(ret < ARCHIVE_WARN)
+ if (ret < ARCHIVE_WARN)
goto exit_write_header;
/* Pad to 512 bytes */
ret = __archive_write_nulls(a, 0x1ff & (-(ssize_t)length));
@@ -508,12 +508,12 @@
archive_entry_set_pathname(temp, "././@LongLink");
archive_entry_set_size(temp, length);
ret = archive_format_gnutar_header(a, buff, temp, 'L');
+ archive_entry_free(temp);
if (ret < ARCHIVE_WARN)
goto exit_write_header;
ret = __archive_write_output(a, buff, 512);
if(ret < ARCHIVE_WARN)
goto exit_write_header;
- archive_entry_free(temp);
/* Write pathname + trailing null byte. */
ret = __archive_write_output(a, pathname, length);
if(ret < ARCHIVE_WARN)
Modified: trunk/contrib/libarchive/libarchive/archive_write_set_format_iso9660.c
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_write_set_format_iso9660.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/archive_write_set_format_iso9660.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -161,7 +161,7 @@
/* Used for managing struct isofile list. */
struct isofile *allnext;
struct isofile *datanext;
- /* Used for managing a hardlined struct isofile list. */
+ /* Used for managing a hardlinked struct isofile list. */
struct isofile *hlnext;
struct isofile *hardlink_target;
@@ -528,7 +528,7 @@
* - allow more then 8 depths of directory trees;
* - disable a version number to a File Name;
* - disable a forced period to the tail of a File Name;
- * - the maxinum length of files and directories is raised to 193.
+ * - the maximum length of files and directories is raised to 193.
* if rockridge option is disabled, raised to 207.
*/
unsigned int iso_level:3;
@@ -626,7 +626,7 @@
* : NOTE Our rockridge=useful option does not set a zero
* : to uid and gid, you should use application
* : option such as --gid,--gname,--uid and --uname
- * : badtar options instead.
+ * : bsdtar options instead.
* Type : boolean/string
* Default: Enabled as rockridge=useful
* COMPAT : mkisofs -r / -R
@@ -660,7 +660,7 @@
* : for making zisofs.
* : When the file size is less than one Logical Block
* : size, that file will not zisofs'ed since it does
- * : reduece an ISO-image size.
+ * : reduce an ISO-image size.
* :
* : When you specify option 'boot=<boot-image>', that
* : 'boot-image' file won't be converted to zisofs file.
@@ -680,7 +680,7 @@
/* The creation time of ISO image. */
time_t birth_time;
/* A file stream of a temporary file, which file contents
- * save to until ISO iamge can be created. */
+ * save to until ISO image can be created. */
int temp_fd;
struct isofile *cur_file;
@@ -703,7 +703,7 @@
} all_file_list;
/* A list of struct isofile entries which have its
- * contents and are not a directory, a hardlined file
+ * contents and are not a directory, a hardlinked file
* and a symlink file. */
struct {
struct isofile *first;
@@ -1907,9 +1907,9 @@
iso9660->primary.rootent);
if (ret < 0)
return (ret);
- /* Make sure we have UTF-16BE convertors.
- * if there is no file entry, convertors are still
- * uninitilized. */
+ /* Make sure we have UTF-16BE converters.
+ * if there is no file entry, converters are still
+ * uninitialized. */
if (iso9660->sconv_to_utf16be == NULL) {
iso9660->sconv_to_utf16be =
archive_string_conversion_to_charset(
@@ -1995,7 +1995,7 @@
* Write an ISO 9660 image.
*/
- /* Switc to start using wbuff as file buffer. */
+ /* Switch to start using wbuff as file buffer. */
iso9660->wbuff_remaining = wb_buffmax();
iso9660->wbuff_type = WB_TO_STREAM;
iso9660->wbuff_offset = 0;
@@ -2524,7 +2524,8 @@
tzset();
localtime_r(t, tm);
#elif HAVE__LOCALTIME64_S
- _localtime64_s(tm, t);
+ __time64_t tmp_t = (__time64_t) *t; //time_t may be shorter than 64 bits
+ _localtime64_s(tm, &tmp_t);
#else
memcpy(tm, localtime(t), sizeof(*tm));
#endif
@@ -2553,7 +2554,7 @@
static void
set_date_time_null(unsigned char *p)
{
- memset(p, '0', 16);
+ memset(p, (int)'0', 16);
p[16] = 0;
}
@@ -2959,7 +2960,7 @@
gid = archive_entry_gid(file->entry);
if (iso9660->opt.rr == OPT_RR_USEFUL) {
/*
- * This action is simular mkisofs -r option
+ * This action is similar to mkisofs -r option
* but our rockridge=useful option does not
* set a zero to uid and gid.
*/
@@ -3024,8 +3025,8 @@
* +----+----+----+----+----+
* 10 11 12 13 14 15
*
- * - cflg : flag of componet
- * - clen : length of componet
+ * - cflg : flag of component
+ * - clen : length of component
*/
const char *sl;
char sl_last;
@@ -3108,7 +3109,7 @@
/*
* flg len
* +----+----+
- * | 02 | 00 | CURREENT component.
+ * | 02 | 00 | CURRENT component.
* +----+----+ (".")
*/
if (nc != NULL) {
@@ -3947,7 +3948,7 @@
"Abstract File", 0, D_CHAR);
if (r != ARCHIVE_OK)
return (r);
- /* Bibliongraphic File Identifier */
+ /* Bibliographic File Identifier */
r = set_file_identifier(bp, 777, 813, vdc, a, vdd,
&(iso9660->bibliographic_file_identifier),
"Bibliongraphic File", 0, D_CHAR);
@@ -4073,7 +4074,10 @@
memset(info.s, 0, info_size);
opt = 0;
#if defined(HAVE__CTIME64_S)
- _ctime64_s(buf, sizeof(buf), &(iso9660->birth_time));
+ {
+ __time64_t iso9660_birth_time_tmp = (__time64_t) iso9660->birth_time; //time_t may be shorter than 64 bits
+ _ctime64_s(buf, sizeof(buf), &(iso9660_birth_time_tmp));
+ }
#elif defined(HAVE_CTIME_R)
ctime_r(&(iso9660->birth_time), buf);
#else
@@ -4558,7 +4562,7 @@
file->cur_content = &(file->content);
do {
blocks += file->cur_content->blocks;
- /* Next fragument */
+ /* Next fragment */
file->cur_content = file->cur_content->next;
} while (file->cur_content != NULL);
}
@@ -4748,7 +4752,7 @@
}
/*
- * Converte a filename to UTF-16BE.
+ * Convert a filename to UTF-16BE.
*/
if (0 > archive_entry_pathname_l(file->entry, &u16, &u16len,
iso9660->sconv_to_utf16be)) {
@@ -5512,7 +5516,7 @@
file->cur_content->location = location;
location += file->cur_content->blocks;
total_block += file->cur_content->blocks;
- /* Next fragument */
+ /* Next fragment */
file->cur_content = file->cur_content->next;
} while (file->cur_content != NULL);
}
@@ -6135,7 +6139,7 @@
off = ffmax - extlen;
if (off == 0) {
/* A dot('.') character
- * does't place to the first
+ * doesn't place to the first
* byte of identifier. */
off ++;
extlen --;
@@ -6164,7 +6168,7 @@
np->id_len = l = ext_off + np->ext_len;
/* Make an offset of the number which is used to be set
- * hexadecimal number to avoid duplicate identififier. */
+ * hexadecimal number to avoid duplicate identifier. */
if (iso9660->opt.iso_level == 1) {
if (ext_off >= 5)
noff = 5;
@@ -6742,7 +6746,7 @@
int r;
pt = &(iso9660->primary.pathtbl[MAX_DEPTH-1]);
- /* Theare aren't level 8 directories reaching a deepr level. */
+ /* There aren't level 8 directories reaching a deeper level. */
if (pt->cnt == 0)
return (ARCHIVE_OK);
@@ -6813,7 +6817,7 @@
if (cmp != 0)
return (cmp);
- /* Compare indetifier */
+ /* Compare identifier */
s1 = p1->identifier;
s2 = p2->identifier;
l = p1->ext_off;
@@ -6855,7 +6859,7 @@
if (cmp != 0)
return (cmp);
- /* Compare indetifier */
+ /* Compare identifier */
s1 = (const unsigned char *)p1->identifier;
s2 = (const unsigned char *)p2->identifier;
l = p1->ext_off;
@@ -7149,7 +7153,7 @@
iso9660->el_torito.catalog = isoent;
/*
- * Get a boot medai type.
+ * Get a boot media type.
*/
switch (iso9660->opt.boot_type) {
default:
Modified: trunk/contrib/libarchive/libarchive/archive_write_set_format_mtree.c
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_write_set_format_mtree.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/archive_write_set_format_mtree.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -1840,9 +1840,9 @@
len = strlen(p);
/*
- * Add "./" prefiex.
+ * Add "./" prefix.
* NOTE: If the pathname does not have a path separator, we have
- * to add "./" to the head of the pathename because mtree reader
+ * to add "./" to the head of the pathname because mtree reader
* will suppose that it is v1(a.k.a classic) mtree format and
* change the directory unexpectedly and so it will make a wrong
* path.
Modified: trunk/contrib/libarchive/libarchive/archive_write_set_format_pax.c
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_write_set_format_pax.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/archive_write_set_format_pax.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -1,6 +1,7 @@
/*-
* Copyright (c) 2003-2007 Tim Kientzle
* Copyright (c) 2010-2012 Michihiro NAKAJIMA
+ * Copyright (c) 2016 Martin Matuska
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -61,15 +62,24 @@
struct sparse_block *sparse_tail;
struct archive_string_conv *sconv_utf8;
int opt_binary;
+
+ unsigned flags;
+#define WRITE_SCHILY_XATTR (1 << 0)
+#define WRITE_LIBARCHIVE_XATTR (1 << 1)
};
static void add_pax_attr(struct archive_string *, const char *key,
const char *value);
+static void add_pax_attr_binary(struct archive_string *,
+ const char *key,
+ const char *value, size_t value_len);
static void add_pax_attr_int(struct archive_string *,
const char *key, int64_t value);
static void add_pax_attr_time(struct archive_string *,
const char *key, int64_t sec,
unsigned long nanos);
+static int add_pax_acl(struct archive_write *,
+ struct archive_entry *, struct pax *, int);
static ssize_t archive_write_pax_data(struct archive_write *,
const void *, size_t);
static int archive_write_pax_close(struct archive_write *);
@@ -127,13 +137,14 @@
if (a->format_free != NULL)
(a->format_free)(a);
- pax = (struct pax *)malloc(sizeof(*pax));
+ pax = (struct pax *)calloc(1, sizeof(*pax));
if (pax == NULL) {
archive_set_error(&a->archive, ENOMEM,
"Can't allocate pax data");
return (ARCHIVE_FATAL);
}
- memset(pax, 0, sizeof(*pax));
+ pax->flags = WRITE_LIBARCHIVE_XATTR | WRITE_SCHILY_XATTR;
+
a->format_data = pax;
a->format_name = "pax";
a->format_options = archive_write_pax_options;
@@ -273,6 +284,17 @@
static void
add_pax_attr(struct archive_string *as, const char *key, const char *value)
{
+ add_pax_attr_binary(as, key, value, strlen(value));
+}
+
+/*
+ * Add a key/value attribute to the pax header. This function handles
+ * binary values.
+ */
+static void
+add_pax_attr_binary(struct archive_string *as, const char *key,
+ const char *value, size_t value_len)
+{
int digits, i, len, next_ten;
char tmp[1 + 3 * sizeof(int)]; /* < 3 base-10 digits per byte */
@@ -280,7 +302,7 @@
* PAX attributes have the following layout:
* <len> <space> <key> <=> <value> <nl>
*/
- len = 1 + (int)strlen(key) + 1 + (int)strlen(value) + 1;
+ len = 1 + (int)strlen(key) + 1 + (int)value_len + 1;
/*
* The <len> field includes the length of the <len> field, so
@@ -311,21 +333,47 @@
archive_strappend_char(as, ' ');
archive_strcat(as, key);
archive_strappend_char(as, '=');
- archive_strcat(as, value);
+ archive_array_append(as, value, value_len);
archive_strappend_char(as, '\n');
}
+static void
+archive_write_pax_header_xattr(struct pax *pax, const char *encoded_name,
+ const void *value, size_t value_len)
+{
+ struct archive_string s;
+ char *encoded_value;
+
+ if (pax->flags & WRITE_LIBARCHIVE_XATTR) {
+ encoded_value = base64_encode((const char *)value, value_len);
+
+ if (encoded_name != NULL && encoded_value != NULL) {
+ archive_string_init(&s);
+ archive_strcpy(&s, "LIBARCHIVE.xattr.");
+ archive_strcat(&s, encoded_name);
+ add_pax_attr(&(pax->pax_header), s.s, encoded_value);
+ archive_string_free(&s);
+ }
+ free(encoded_value);
+ }
+ if (pax->flags & WRITE_SCHILY_XATTR) {
+ archive_string_init(&s);
+ archive_strcpy(&s, "SCHILY.xattr.");
+ archive_strcat(&s, encoded_name);
+ add_pax_attr_binary(&(pax->pax_header), s.s, value, value_len);
+ archive_string_free(&s);
+ }
+}
+
static int
archive_write_pax_header_xattrs(struct archive_write *a,
struct pax *pax, struct archive_entry *entry)
{
- struct archive_string s;
int i = archive_entry_xattr_reset(entry);
while (i--) {
const char *name;
const void *value;
- char *encoded_value;
char *url_encoded_name = NULL, *encoded_name = NULL;
size_t size;
int r;
@@ -346,16 +394,9 @@
}
}
- encoded_value = base64_encode((const char *)value, size);
+ archive_write_pax_header_xattr(pax, encoded_name,
+ value, size);
- if (encoded_name != NULL && encoded_value != NULL) {
- archive_string_init(&s);
- archive_strcpy(&s, "LIBARCHIVE.xattr.");
- archive_strcat(&s, encoded_name);
- add_pax_attr(&(pax->pax_header), s.s, encoded_value);
- archive_string_free(&s);
- }
- free(encoded_value);
}
return (ARCHIVE_OK);
}
@@ -450,6 +491,45 @@
return (ARCHIVE_OK);
}
+/* Add ACL to pax header */
+static int
+add_pax_acl(struct archive_write *a,
+ struct archive_entry *entry, struct pax *pax, int flags)
+{
+ char *p;
+ const char *attr;
+ int acl_types;
+
+ acl_types = archive_entry_acl_types(entry);
+
+ if ((acl_types & ARCHIVE_ENTRY_ACL_TYPE_NFS4) != 0)
+ attr = "SCHILY.acl.ace";
+ else if ((flags & ARCHIVE_ENTRY_ACL_TYPE_ACCESS) != 0)
+ attr = "SCHILY.acl.access";
+ else if ((flags & ARCHIVE_ENTRY_ACL_TYPE_DEFAULT) != 0)
+ attr = "SCHILY.acl.default";
+ else
+ return (ARCHIVE_FATAL);
+
+ p = archive_entry_acl_to_text_l(entry, NULL, flags, pax->sconv_utf8);
+ if (p == NULL) {
+ if (errno == ENOMEM) {
+ archive_set_error(&a->archive, ENOMEM, "%s %s",
+ "Can't allocate memory for ", attr);
+ return (ARCHIVE_FATAL);
+ }
+ archive_set_error(&a->archive,
+ ARCHIVE_ERRNO_FILE_FORMAT, "%s %s %s",
+ "Can't translate ", attr, " to UTF-8");
+ return(ARCHIVE_WARN);
+ } else if (*p != '\0') {
+ add_pax_attr(&(pax->pax_header),
+ attr, p);
+ free(p);
+ }
+ return(ARCHIVE_OK);
+}
+
/*
* TODO: Consider adding 'comment' and 'charset' fields to
* archive_entry so that clients can specify them. Also, consider
@@ -466,6 +546,7 @@
const char *p;
const char *suffix;
int need_extension, r, ret;
+ int acl_types;
int sparse_count;
uint64_t sparse_total, real_size;
struct pax *pax;
@@ -709,7 +790,7 @@
/* Copy entry so we can modify it as needed. */
#if defined(_WIN32) && !defined(__CYGWIN__)
- /* Make sure the path separators in pahtname, hardlink and symlink
+ /* Make sure the path separators in pathname, hardlink and symlink
* are all slash '/', not the Windows path separator '\'. */
entry_main = __la_win_entry_in_posix_pathseparator(entry_original);
if (entry_main == entry_original)
@@ -1017,16 +1098,6 @@
if (!need_extension && p != NULL && *p != '\0')
need_extension = 1;
- /* If there are non-trivial ACL entries, we need an extension. */
- if (!need_extension && archive_entry_acl_count(entry_original,
- ARCHIVE_ENTRY_ACL_TYPE_ACCESS) > 0)
- need_extension = 1;
-
- /* If there are non-trivial ACL entries, we need an extension. */
- if (!need_extension && archive_entry_acl_count(entry_original,
- ARCHIVE_ENTRY_ACL_TYPE_DEFAULT) > 0)
- need_extension = 1;
-
/* If there are extended attributes, we need an extension */
if (!need_extension && archive_entry_xattr_count(entry_original) > 0)
need_extension = 1;
@@ -1035,6 +1106,12 @@
if (!need_extension && sparse_count > 0)
need_extension = 1;
+ acl_types = archive_entry_acl_types(entry_original);
+
+ /* If there are any ACL entries, we need an extension */
+ if (!need_extension && acl_types != 0)
+ need_extension = 1;
+
/*
* Libarchive used to include these in extended headers for
* restricted pax format, but that confused people who
@@ -1086,44 +1163,30 @@
add_pax_attr(&(pax->pax_header), "SCHILY.fflags", p);
/* I use star-compatible ACL attributes. */
- r = archive_entry_acl_text_l(entry_original,
- ARCHIVE_ENTRY_ACL_TYPE_ACCESS |
- ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID,
- &p, NULL, pax->sconv_utf8);
- if (r != 0) {
- if (errno == ENOMEM) {
- archive_set_error(&a->archive, ENOMEM,
- "Can't allocate memory for "
- "ACL.access");
+ if ((acl_types & ARCHIVE_ENTRY_ACL_TYPE_NFS4) != 0) {
+ ret = add_pax_acl(a, entry_original, pax,
+ ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID |
+ ARCHIVE_ENTRY_ACL_STYLE_SEPARATOR_COMMA |
+ ARCHIVE_ENTRY_ACL_STYLE_COMPACT);
+ if (ret == ARCHIVE_FATAL)
return (ARCHIVE_FATAL);
- }
- archive_set_error(&a->archive,
- ARCHIVE_ERRNO_FILE_FORMAT,
- "Can't translate ACL.access to UTF-8");
- ret = ARCHIVE_WARN;
- } else if (p != NULL && *p != '\0') {
- add_pax_attr(&(pax->pax_header),
- "SCHILY.acl.access", p);
}
- r = archive_entry_acl_text_l(entry_original,
- ARCHIVE_ENTRY_ACL_TYPE_DEFAULT |
- ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID,
- &p, NULL, pax->sconv_utf8);
- if (r != 0) {
- if (errno == ENOMEM) {
- archive_set_error(&a->archive, ENOMEM,
- "Can't allocate memory for "
- "ACL.default");
+ if (acl_types & ARCHIVE_ENTRY_ACL_TYPE_ACCESS) {
+ ret = add_pax_acl(a, entry_original, pax,
+ ARCHIVE_ENTRY_ACL_TYPE_ACCESS |
+ ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID |
+ ARCHIVE_ENTRY_ACL_STYLE_SEPARATOR_COMMA);
+ if (ret == ARCHIVE_FATAL)
return (ARCHIVE_FATAL);
- }
- archive_set_error(&a->archive,
- ARCHIVE_ERRNO_FILE_FORMAT,
- "Can't translate ACL.default to UTF-8");
- ret = ARCHIVE_WARN;
- } else if (p != NULL && *p != '\0') {
- add_pax_attr(&(pax->pax_header),
- "SCHILY.acl.default", p);
}
+ if (acl_types & ARCHIVE_ENTRY_ACL_TYPE_DEFAULT) {
+ ret = add_pax_acl(a, entry_original, pax,
+ ARCHIVE_ENTRY_ACL_TYPE_DEFAULT |
+ ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID |
+ ARCHIVE_ENTRY_ACL_STYLE_SEPARATOR_COMMA);
+ if (ret == ARCHIVE_FATAL)
+ return (ARCHIVE_FATAL);
+ }
/* We use GNU-tar-compatible sparse attributes. */
if (sparse_count > 0) {
@@ -1133,8 +1196,12 @@
"GNU.sparse.major", 1);
add_pax_attr_int(&(pax->pax_header),
"GNU.sparse.minor", 0);
+ /*
+ * Make sure to store the original path, since
+ * truncation to ustar limit happened already.
+ */
add_pax_attr(&(pax->pax_header),
- "GNU.sparse.name", entry_name.s);
+ "GNU.sparse.name", path);
add_pax_attr_int(&(pax->pax_header),
"GNU.sparse.realsize",
archive_entry_size(entry_main));
@@ -1587,6 +1654,8 @@
* GNU PAX Format 1.0 requires the special name, which pattern is:
* <dir>/GNUSparseFile.<pid>/<original file name>
*
+ * Since reproducable archives are more important, use 0 as pid.
+ *
* This function is used for only Sparse file, a file type of which
* is regular file.
*/
@@ -1593,7 +1662,6 @@
static char *
build_gnu_sparse_name(char *dest, const char *src)
{
- char buff[64];
const char *p;
/* Handle the null filename case. */
@@ -1619,15 +1687,9 @@
break;
}
-#if HAVE_GETPID && 0 /* Disable this as pax attribute name. */
- sprintf(buff, "GNUSparseFile.%d", getpid());
-#else
- /* If the platform can't fetch the pid, don't include it. */
- strcpy(buff, "GNUSparseFile");
-#endif
/* General case: build a ustar-compatible name adding
* "/GNUSparseFile/". */
- build_ustar_entry_name(dest, src, p - src, buff);
+ build_ustar_entry_name(dest, src, p - src, "GNUSparseFile.0");
return (dest);
}
Modified: trunk/contrib/libarchive/libarchive/archive_write_set_format_shar.c
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_write_set_format_shar.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/archive_write_set_format_shar.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -113,12 +113,11 @@
if (a->format_free != NULL)
(a->format_free)(a);
- shar = (struct shar *)malloc(sizeof(*shar));
+ shar = (struct shar *)calloc(1, sizeof(*shar));
if (shar == NULL) {
archive_set_error(&a->archive, ENOMEM, "Can't allocate shar data");
return (ARCHIVE_FATAL);
}
- memset(shar, 0, sizeof(*shar));
archive_string_init(&shar->work);
archive_string_init(&shar->quoted_name);
a->format_data = shar;
Modified: trunk/contrib/libarchive/libarchive/archive_write_set_format_ustar.c
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_write_set_format_ustar.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/archive_write_set_format_ustar.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -114,9 +114,9 @@
'0','0','0','0','0','0', ' ','\0',
/* gid, space-null termination: 8 bytes */
'0','0','0','0','0','0', ' ','\0',
- /* size, space termation: 12 bytes */
+ /* size, space termination: 12 bytes */
'0','0','0','0','0','0','0','0','0','0','0', ' ',
- /* mtime, space termation: 12 bytes */
+ /* mtime, space termination: 12 bytes */
'0','0','0','0','0','0','0','0','0','0','0', ' ',
/* Initial checksum value: 8 spaces */
' ',' ',' ',' ',' ',' ',' ',' ',
@@ -184,13 +184,12 @@
return (ARCHIVE_FATAL);
}
- ustar = (struct ustar *)malloc(sizeof(*ustar));
+ ustar = (struct ustar *)calloc(1, sizeof(*ustar));
if (ustar == NULL) {
archive_set_error(&a->archive, ENOMEM,
"Can't allocate ustar data");
return (ARCHIVE_FATAL);
}
- memset(ustar, 0, sizeof(*ustar));
a->format_data = ustar;
a->format_name = "ustar";
a->format_options = archive_write_ustar_options;
@@ -336,7 +335,7 @@
}
#if defined(_WIN32) && !defined(__CYGWIN__)
- /* Make sure the path separators in pahtname, hardlink and symlink
+ /* Make sure the path separators in pathname, hardlink and symlink
* are all slash '/', not the Windows path separator '\'. */
entry_main = __la_win_entry_in_posix_pathseparator(entry);
if (entry_main == NULL) {
Modified: trunk/contrib/libarchive/libarchive/archive_write_set_format_v7tar.c
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_write_set_format_v7tar.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/archive_write_set_format_v7tar.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -98,9 +98,9 @@
'0','0','0','0','0','0', ' ','\0',
/* gid, space-null termination: 8 bytes */
'0','0','0','0','0','0', ' ','\0',
- /* size, space termation: 12 bytes */
+ /* size, space termination: 12 bytes */
'0','0','0','0','0','0','0','0','0','0','0', ' ',
- /* mtime, space termation: 12 bytes */
+ /* mtime, space termination: 12 bytes */
'0','0','0','0','0','0','0','0','0','0','0', ' ',
/* Initial checksum value: 8 spaces */
' ',' ',' ',' ',' ',' ',' ',' ',
@@ -161,13 +161,12 @@
return (ARCHIVE_FATAL);
}
- v7tar = (struct v7tar *)malloc(sizeof(*v7tar));
+ v7tar = (struct v7tar *)calloc(1, sizeof(*v7tar));
if (v7tar == NULL) {
archive_set_error(&a->archive, ENOMEM,
"Can't allocate v7tar data");
return (ARCHIVE_FATAL);
}
- memset(v7tar, 0, sizeof(*v7tar));
a->format_data = v7tar;
a->format_name = "tar (non-POSIX)";
a->format_options = archive_write_v7tar_options;
@@ -314,7 +313,7 @@
}
#if defined(_WIN32) && !defined(__CYGWIN__)
- /* Make sure the path separators in pahtname, hardlink and symlink
+ /* Make sure the path separators in pathname, hardlink and symlink
* are all slash '/', not the Windows path separator '\'. */
entry_main = __la_win_entry_in_posix_pathseparator(entry);
if (entry_main == NULL) {
Modified: trunk/contrib/libarchive/libarchive/archive_write_set_format_warc.c
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_write_set_format_warc.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/archive_write_set_format_warc.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -79,7 +79,7 @@
WT_RVIS,
/* conversion, unsupported */
WT_CONV,
- /* continutation, unsupported at the moment */
+ /* continuation, unsupported at the moment */
WT_CONT,
/* invalid type */
LAST_WT
@@ -354,7 +354,7 @@
_popul_ehdr(struct archive_string *tgt, size_t tsz, warc_essential_hdr_t hdr)
{
static const char _ver[] = "WARC/1.0\r\n";
- static const char *_typ[LAST_WT] = {
+ static const char * const _typ[LAST_WT] = {
NULL, "warcinfo", "metadata", "resource", NULL
};
char std_uuid[48U];
Modified: trunk/contrib/libarchive/libarchive/archive_write_set_format_xar.c
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_write_set_format_xar.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/archive_write_set_format_xar.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -63,7 +63,7 @@
* - When writing an XML element <link type="<file-type>">, <file-type>
* which is a file type a symbolic link is referencing is always marked
* as "broken". Xar utility uses stat(2) to get the file type, but, in
- * libarcive format writer, we should not use it; if it is needed, we
+ * libarchive format writer, we should not use it; if it is needed, we
* should get about it at archive_read_disk.c.
* - It is possible to appear both <flags> and <ext2> elements.
* Xar utility generates <flags> on BSD platform and <ext2> on Linux
@@ -192,7 +192,7 @@
struct file *parent; /* parent directory entry */
/*
* To manage sub directory files.
- * We use 'chnext' a menber of struct file to chain.
+ * We use 'chnext' (a member of struct file) to chain.
*/
struct {
struct file *first;
@@ -258,7 +258,7 @@
/*
* The list of all file entries is used to manage struct file
* objects.
- * We use 'next' a menber of struct file to chain.
+ * We use 'next' (a member of struct file) to chain.
*/
struct {
struct file *first;
@@ -266,7 +266,7 @@
} file_list;
/*
* The list of hard-linked file entries.
- * We use 'hlnext' a menber of struct file to chain.
+ * We use 'hlnext' (a member of struct file) to chain.
*/
struct archive_rb_tree hardlink_rbtree;
};
@@ -1227,7 +1227,7 @@
case AE_IFLNK:
/*
* xar utility has checked a file type, which
- * a symblic-link file has referenced.
+ * a symbolic-link file has referenced.
* For example:
* <link type="directory">../ref/</link>
* The symlink target file is "../ref/" and its
@@ -1237,8 +1237,8 @@
* The symlink target file is "../f" and its
* file type is a regular file.
*
- * But our implemention cannot do it, and then we
- * always record that a attribute "type" is "borken",
+ * But our implementation cannot do it, and then we
+ * always record that a attribute "type" is "broken",
* for example:
* <link type="broken">foo/bar</link>
* It means "foo/bar" is not reachable.
@@ -1544,7 +1544,7 @@
}
/*
- * Start recoding TOC
+ * Start recording TOC
*/
r = xmlTextWriterStartElement(writer, BAD_CAST("xar"));
if (r < 0) {
@@ -1961,6 +1961,7 @@
archive_string_free(&(file->basename));
archive_string_free(&(file->symlink));
archive_string_free(&(file->script));
+ archive_entry_free(file->entry);
free(file);
}
@@ -2484,7 +2485,7 @@
archive_entry_set_nlink(target->entry, hl->nlink);
if (hl->nlink > 1)
/* It means this file is a hardlink
- * targe itself. */
+ * target itself. */
target->hardlink_target = target;
for (nf = target->hlnext;
nf != NULL; nf = nf->hlnext) {
@@ -2913,7 +2914,7 @@
*strm = lzma_init_data;
#ifdef HAVE_LZMA_STREAM_ENCODER_MT
if (threads > 1) {
- bzero(&mt_options, sizeof(mt_options));
+ memset(&mt_options, 0, sizeof(mt_options));
mt_options.threads = threads;
mt_options.timeout = 300;
mt_options.filters = lzmafilters;
Modified: trunk/contrib/libarchive/libarchive/archive_write_set_format_zip.c
===================================================================
--- trunk/contrib/libarchive/libarchive/archive_write_set_format_zip.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/archive_write_set_format_zip.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -592,7 +592,7 @@
#if defined(_WIN32) && !defined(__CYGWIN__)
- /* Make sure the path separators in pahtname, hardlink and symlink
+ /* Make sure the path separators in pathname, hardlink and symlink
* are all slash '/', not the Windows path separator '\'. */
zip->entry = __la_win_entry_in_posix_pathseparator(entry);
if (zip->entry == entry)
@@ -878,7 +878,7 @@
|| zip->entry_encryption == ENCRYPTION_WINZIP_AES256)) {
memcpy(e, "\001\231\007\000\001\000AE", 8);
- /* AES vendoer version AE-2 does not store a CRC.
+ /* AES vendor version AE-2 does not store a CRC.
* WinZip 11 uses AE-1, which does store the CRC,
* but it does not store the CRC when the file size
* is less than 20 bytes. So we simulate what
@@ -1013,7 +1013,7 @@
if (zip->entry_flags & ZIP_ENTRY_FLAG_ENCRYPTED) {
switch (zip->entry_encryption) {
case ENCRYPTION_TRADITIONAL:
- /* Initialize traditoinal PKWARE encryption context. */
+ /* Initialize traditional PKWARE encryption context. */
if (!zip->tctx_valid) {
ret = init_traditional_pkware_encryption(a);
if (ret != ARCHIVE_OK)
@@ -1499,7 +1499,7 @@
}
static uint8_t
-trad_enc_decypt_byte(struct trad_enc_ctx *ctx)
+trad_enc_decrypt_byte(struct trad_enc_ctx *ctx)
{
unsigned temp = ctx->keys[2] | 2;
return (uint8_t)((temp * (temp ^ 1)) >> 8) & 0xff;
@@ -1515,7 +1515,7 @@
for (i = 0; i < max; i++) {
uint8_t t = in[i];
- out[i] = t ^ trad_enc_decypt_byte(ctx);
+ out[i] = t ^ trad_enc_decrypt_byte(ctx);
trad_enc_update_keys(ctx, t);
}
return i;
@@ -1626,7 +1626,7 @@
return (ARCHIVE_FAILED);
}
- /* Set a passowrd verification value after the 'salt'. */
+ /* Set a password verification value after the 'salt'. */
salt[salt_len] = derived_key[key_len * 2];
salt[salt_len + 1] = derived_key[key_len * 2 + 1];
Modified: trunk/contrib/libarchive/libarchive/config_freebsd.h
===================================================================
--- trunk/contrib/libarchive/libarchive/config_freebsd.h 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/config_freebsd.h 2018-06-19 20:42:35 UTC (rev 11134)
@@ -22,139 +22,238 @@
* (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: head/lib/libarchive/config_freebsd.h 201079 2009-12-28 02:01:42Z kientzle $
+ * $FreeBSD$
*/
-/* FreeBSD 5.0 and later have ACL and extattr support. */
+#include <osreldate.h>
+
+/* FreeBSD 5.0 and later has ACL and extattr support. */
#if __FreeBSD__ > 4
-#define HAVE_ACL_CREATE_ENTRY 1
-#define HAVE_ACL_GET_LINK_NP 1
-#define HAVE_ACL_GET_PERM_NP 1
-#define HAVE_ACL_INIT 1
-#define HAVE_ACL_SET_FD 1
-#define HAVE_ACL_SET_FD_NP 1
-#define HAVE_ACL_SET_FILE 1
-#define HAVE_ACL_USER 1
-#define HAVE_EXTATTR_GET_FILE 1
-#define HAVE_EXTATTR_LIST_FILE 1
-#define HAVE_EXTATTR_SET_FD 1
-#define HAVE_EXTATTR_SET_FILE 1
-#define HAVE_SYS_ACL_H 1
-#define HAVE_SYS_EXTATTR_H 1
-#endif
+#define ARCHIVE_ACL_FREEBSD 1
+#define HAVE_ACL_GET_PERM_NP 1
+#define HAVE_ARC4RANDOM_BUF 1
+#define HAVE_EXTATTR_GET_FILE 1
+#define HAVE_EXTATTR_LIST_FILE 1
+#define HAVE_EXTATTR_SET_FD 1
+#define HAVE_EXTATTR_SET_FILE 1
+#define HAVE_STRUCT_XVFSCONF 1
+#define HAVE_SYS_ACL_H 1
+#define HAVE_SYS_EXTATTR_H 1
+#if __FreeBSD__ > 7
+/* FreeBSD 8.0 and later has NFSv4 ACL support */
+#define ARCHIVE_ACL_FREEBSD_NFS4 1
+#define HAVE_ACL_GET_LINK_NP 1
+#define HAVE_ACL_IS_TRIVIAL_NP 1
+#define HAVE_ACL_SET_LINK_NP 1
+#endif /* __FreeBSD__ > 7 */
+#endif /* __FreeBSD__ > 4 */
#ifdef WITH_OPENSSL
-#define HAVE_OPENSSL_MD5_H 1
-#define HAVE_OPENSSL_RIPEMD_H 1
-#define HAVE_OPENSSL_SHA_H 1
-#define HAVE_SHA384 1
-#define HAVE_SHA512 1
+#define HAVE_LIBCRYPTO 1
+#define HAVE_OPENSSL_EVP_H 1
+#define HAVE_OPENSSL_MD5_H 1
+#define HAVE_OPENSSL_RIPEMD_H 1
+#define HAVE_OPENSSL_SHA_H 1
+#define HAVE_OPENSSL_SHA256_INIT 1
+#define HAVE_OPENSSL_SHA384_INIT 1
+#define HAVE_OPENSSL_SHA512_INIT 1
+#define HAVE_PKCS5_PBKDF2_HMAC_SHA1 1
+#define HAVE_SHA256 1
+#define HAVE_SHA384 1
+#define HAVE_SHA512 1
+#else
+#define HAVE_LIBMD 1
+#define HAVE_MD5_H 1
+#define HAVE_MD5INIT 1
+#define HAVE_RIPEMD_H 1
+#define HAVE_SHA_H 1
+#define HAVE_SHA1 1
+#define HAVE_SHA1_INIT 1
+#define HAVE_SHA256 1
+#define HAVE_SHA256_H 1
+#define HAVE_SHA256_INIT 1
+#define HAVE_SHA512 1
+#define HAVE_SHA512_H 1
+#define HAVE_SHA512_INIT 1
#endif
-#define HAVE_BSDXML_H 1
-#define HAVE_BZLIB_H 1
-#define HAVE_CHFLAGS 1
-#define HAVE_CHOWN 1
-#define HAVE_DECL_INT64_MAX 1
-#define HAVE_DECL_INT64_MIN 1
-#define HAVE_DECL_SIZE_MAX 1
-#define HAVE_DECL_SSIZE_MAX 1
-#define HAVE_DECL_STRERROR_R 1
-#define HAVE_DECL_UINT32_MAX 1
-#define HAVE_DECL_UINT64_MAX 1
-#define HAVE_DIRENT_H 1
-#define HAVE_EFTYPE 1
-#define HAVE_EILSEQ 1
-#define HAVE_ERRNO_H 1
-#define HAVE_FCHDIR 1
-#define HAVE_FCHFLAGS 1
-#define HAVE_FCHMOD 1
-#define HAVE_FCHOWN 1
-#define HAVE_FCNTL 1
-#define HAVE_FCNTL_H 1
-#define HAVE_FSEEKO 1
-#define HAVE_FSTAT 1
-#define HAVE_FTRUNCATE 1
-#define HAVE_FUTIMES 1
-#define HAVE_GETEUID 1
-#define HAVE_GETGRGID_R 1
-#define HAVE_GETPID 1
-#define HAVE_GETPWUID_R 1
-#define HAVE_GRP_H 1
-#define HAVE_INTTYPES_H 1
-#define HAVE_LCHFLAGS 1
-#define HAVE_LCHMOD 1
-#define HAVE_LCHOWN 1
-#define HAVE_LIMITS_H 1
-#define HAVE_LINK 1
-#define HAVE_LSTAT 1
-#define HAVE_LUTIMES 1
-#define HAVE_MALLOC 1
-#define HAVE_MD5 1
-#define HAVE_MD5_H 1
-#define HAVE_MEMMOVE 1
-#define HAVE_MKDIR 1
-#define HAVE_MKFIFO 1
-#define HAVE_MKNOD 1
-#define HAVE_PIPE 1
-#define HAVE_POLL 1
-#define HAVE_POLL_H 1
-#define HAVE_PWD_H 1
-#define HAVE_READLINK 1
-#define HAVE_RMD160 1
-#define HAVE_SELECT 1
-#define HAVE_SETENV 1
-#define HAVE_SHA_H 1
-#define HAVE_SHA1 1
-#define HAVE_SHA256 1
-#define HAVE_SHA256_H 1
-#define HAVE_SIGNAL_H 1
-#define HAVE_STDINT_H 1
-#define HAVE_STDLIB_H 1
-#define HAVE_STRCHR 1
-#define HAVE_STRDUP 1
-#define HAVE_STRERROR 1
-#define HAVE_STRERROR_R 1
-#define HAVE_STRINGS_H 1
-#define HAVE_STRING_H 1
-#define HAVE_STRRCHR 1
-#define HAVE_STRUCT_STAT_ST_BLKSIZE 1
-#define HAVE_STRUCT_STAT_ST_BIRTHTIME 1
-#define HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC 1
-#define HAVE_STRUCT_STAT_ST_FLAGS 1
-#define HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC 1
-#define HAVE_STRUCT_TM_TM_GMTOFF 1
-#define HAVE_SYMLINK 1
-#define HAVE_SYS_CDEFS_H 1
-#define HAVE_SYS_IOCTL_H 1
-#define HAVE_SYS_MOUNT_H 1
-#define HAVE_SYS_PARAM_H 1
-#define HAVE_SYS_SELECT_H 1
-#define HAVE_SYS_STAT_H 1
-#define HAVE_SYS_TIME_H 1
-#define HAVE_SYS_TYPES_H 1
-#undef HAVE_SYS_UTIME_H
-#define HAVE_SYS_UTSNAME_H 1
-#define HAVE_SYS_WAIT_H 1
-#define HAVE_TIMEGM 1
-#define HAVE_TZSET 1
-#define HAVE_UNISTD_H 1
-#define HAVE_UNSETENV 1
-#define HAVE_UTIME 1
-#define HAVE_UTIMES 1
-#define HAVE_UTIME_H 1
-#define HAVE_VFORK 1
-#define HAVE_WCHAR_H 1
-#define HAVE_WCSCPY 1
-#define HAVE_WCSLEN 1
-#define HAVE_WCTOMB 1
-#define HAVE_WMEMCMP 1
-#define HAVE_WMEMCPY 1
-#define HAVE_ZLIB_H 1
-#define TIME_WITH_SYS_TIME 1
+#define HAVE_BSDXML_H 1
+#define HAVE_BZLIB_H 1
+#define HAVE_CHFLAGS 1
+#define HAVE_CHOWN 1
+#define HAVE_CHROOT 1
+#define HAVE_CTIME_R 1
+#define HAVE_CTYPE_H 1
+#define HAVE_DECL_EXTATTR_NAMESPACE_USER 1
+#define HAVE_DECL_INT32_MAX 1
+#define HAVE_DECL_INT32_MIN 1
+#define HAVE_DECL_INT64_MAX 1
+#define HAVE_DECL_INT64_MIN 1
+#define HAVE_DECL_INTMAX_MAX 1
+#define HAVE_DECL_INTMAX_MIN 1
+#define HAVE_DECL_SIZE_MAX 1
+#define HAVE_DECL_SSIZE_MAX 1
+#define HAVE_DECL_STRERROR_R 1
+#define HAVE_DECL_UINT32_MAX 1
+#define HAVE_DECL_UINT64_MAX 1
+#define HAVE_DECL_UINTMAX_MAX 1
+#define HAVE_DIRENT_H 1
+#define HAVE_DLFCN_H 1
+#define HAVE_D_MD_ORDER 1
+#define HAVE_EFTYPE 1
+#define HAVE_EILSEQ 1
+#define HAVE_ERRNO_H 1
+#define HAVE_FCHDIR 1
+#define HAVE_FCHFLAGS 1
+#define HAVE_FCHMOD 1
+#define HAVE_FCHOWN 1
+#define HAVE_FCNTL 1
+#define HAVE_FCNTL_H 1
+#define HAVE_FDOPENDIR 1
+#define HAVE_FORK 1
+#define HAVE_FSEEKO 1
+#define HAVE_FSTAT 1
+#define HAVE_FSTATAT 1
+#define HAVE_FSTATFS 1
+#define HAVE_FSTATVFS 1
+#define HAVE_FTRUNCATE 1
+#define HAVE_FUTIMES 1
+#define HAVE_FUTIMESAT 1
+#define HAVE_GETEUID 1
+#define HAVE_GETGRGID_R 1
+#define HAVE_GETGRNAM_R 1
+#define HAVE_GETPID 1
+#define HAVE_GETPWNAM_R 1
+#define HAVE_GETPWUID_R 1
+#define HAVE_GETVFSBYNAME 1
+#define HAVE_GMTIME_R 1
+#define HAVE_GRP_H 1
+#define HAVE_INTMAX_T 1
+#define HAVE_INTTYPES_H 1
+#define HAVE_LANGINFO_H 1
+#define HAVE_LCHFLAGS 1
+#define HAVE_LCHMOD 1
+#define HAVE_LCHOWN 1
+#define HAVE_LIBZ 1
+#define HAVE_LIMITS_H 1
+#define HAVE_LINK 1
+#define HAVE_LOCALE_H 1
+#define HAVE_LOCALTIME_R 1
+#define HAVE_LONG_LONG_INT 1
+#define HAVE_LSTAT 1
+#define HAVE_LUTIMES 1
+#define HAVE_MBRTOWC 1
+#define HAVE_MEMMOVE 1
+#define HAVE_MEMORY_H 1
+#define HAVE_MEMSET 1
+#define HAVE_MKDIR 1
+#define HAVE_MKFIFO 1
+#define HAVE_MKNOD 1
+#define HAVE_MKSTEMP 1
+#define HAVE_NL_LANGINFO 1
+#define HAVE_OPENAT 1
+#define HAVE_PATHS_H 1
+#define HAVE_PIPE 1
+#define HAVE_POLL 1
+#define HAVE_POLL_H 1
+#define HAVE_POSIX_SPAWNP 1
+#define HAVE_PTHREAD_H 1
+#define HAVE_PWD_H 1
+#define HAVE_READDIR_R 1
+#define HAVE_READLINK 1
+#define HAVE_READLINKAT 1
+#define HAVE_READPASSPHRASE 1
+#define HAVE_READPASSPHRASE_H 1
+#define HAVE_REGEX_H 1
+#define HAVE_SELECT 1
+#define HAVE_SETENV 1
+#define HAVE_SETLOCALE 1
+#define HAVE_SIGACTION 1
+#define HAVE_SIGNAL_H 1
+#define HAVE_SPAWN_H 1
+#define HAVE_STATFS 1
+#define HAVE_STATVFS 1
+#define HAVE_STDARG_H 1
+#define HAVE_STDINT_H 1
+#define HAVE_STDLIB_H 1
+#define HAVE_STRCHR 1
+#define HAVE_STRDUP 1
+#define HAVE_STRERROR 1
+#define HAVE_STRERROR_R 1
+#define HAVE_STRFTIME 1
+#define HAVE_STRINGS_H 1
+#define HAVE_STRING_H 1
+#define HAVE_STRRCHR 1
+#define HAVE_STRUCT_STATFS_F_NAMEMAX 1
+#define HAVE_STRUCT_STAT_ST_BIRTHTIME 1
+#define HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC 1
+#define HAVE_STRUCT_STAT_ST_BLKSIZE 1
+#define HAVE_STRUCT_STAT_ST_FLAGS 1
+#define HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC 1
+#define HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC 1
+#define HAVE_STRUCT_TM_TM_GMTOFF 1
+#define HAVE_SYMLINK 1
+#define HAVE_SYS_CDEFS_H 1
+#define HAVE_SYS_IOCTL_H 1
+#define HAVE_SYS_MOUNT_H 1
+#define HAVE_SYS_PARAM_H 1
+#define HAVE_SYS_POLL_H 1
+#define HAVE_SYS_SELECT_H 1
+#define HAVE_SYS_STATVFS_H 1
+#define HAVE_SYS_STAT_H 1
+#define HAVE_SYS_TIME_H 1
+#define HAVE_SYS_TYPES_H 1
+#define HAVE_SYS_UTSNAME_H 1
+#define HAVE_SYS_WAIT_H 1
+#define HAVE_TIMEGM 1
+#define HAVE_TIME_H 1
+#define HAVE_TZSET 1
+#define HAVE_UINTMAX_T 1
+#define HAVE_UNISTD_H 1
+#define HAVE_UNSETENV 1
+#define HAVE_UNSIGNED_LONG_LONG 1
+#define HAVE_UNSIGNED_LONG_LONG_INT 1
+#define HAVE_UTIME 1
+#define HAVE_UTIMES 1
+#define HAVE_UTIME_H 1
+#define HAVE_VFORK 1
+#define HAVE_VPRINTF 1
+#define HAVE_WCHAR_H 1
+#define HAVE_WCHAR_T 1
+#define HAVE_WCRTOMB 1
+#define HAVE_WCSCMP 1
+#define HAVE_WCSCPY 1
+#define HAVE_WCSLEN 1
+#define HAVE_WCTOMB 1
+#define HAVE_WCTYPE_H 1
+#define HAVE_WMEMCMP 1
+#define HAVE_WMEMCPY 1
+#define HAVE_WMEMMOVE 1
+#define HAVE_ZLIB_H 1
+#define TIME_WITH_SYS_TIME 1
+#if __FreeBSD_version >= 1100056
+#define HAVE_FUTIMENS 1
+#define HAVE_UTIMENSAT 1
+#endif
+
/* FreeBSD 4 and earlier lack intmax_t/uintmax_t */
#if __FreeBSD__ < 5
-#define intmax_t int64_t
-#define uintmax_t uint64_t
+#define intmax_t int64_t
+#define uintmax_t uint64_t
#endif
+
+/* FreeBSD defines for archive_hash.h */
+#ifdef WITH_OPENSSL
+#define ARCHIVE_CRYPTO_MD5_OPENSSL 1
+#define ARCHIVE_CRYPTO_RMD160_OPENSSL 1
+#define ARCHIVE_CRYPTO_SHA1_OPENSSL
+#define ARCHIVE_CRYPTO_SHA256_OPENSSL 1
+#define ARCHIVE_CRYPTO_SHA384_OPENSSL 1
+#define ARCHIVE_CRYPTO_SHA512_OPENSSL 1
+#else
+#define ARCHIVE_CRYPTO_MD5_LIBMD 1
+#define ARCHIVE_CRYPTO_SHA1_LIBMD 1
+#define ARCHIVE_CRYPTO_SHA256_LIBMD 1
+#define ARCHIVE_CRYPTO_SHA512_LIBMD 1
+#endif
Modified: trunk/contrib/libarchive/libarchive/libarchive-formats.5
===================================================================
--- trunk/contrib/libarchive/libarchive/libarchive-formats.5 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/libarchive-formats.5 2018-06-19 20:42:35 UTC (rev 11134)
@@ -24,7 +24,7 @@
.\"
.\" $FreeBSD: stable/11/contrib/libarchive/libarchive/libarchive-formats.5 302075 2016-06-22 07:49:59Z mm $
.\"
-.Dd March 18, 2012
+.Dd December 27, 2016
.Dt LIBARCHIVE-FORMATS 5
.Os
.Sh NAME
@@ -191,8 +191,6 @@
.It Solaris extensions
Libarchive recognizes ACL and extended attribute records written
by Solaris tar.
-Currently, libarchive only has support for old-style ACLs; the
-newer NFSv4 ACLs are recognized but discarded.
.El
.Pp
The first tar program appeared in Seventh Edition Unix in 1979.
Modified: trunk/contrib/libarchive/libarchive/libarchive_changes.3
===================================================================
--- trunk/contrib/libarchive/libarchive/libarchive_changes.3 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/libarchive_changes.3 2018-06-19 20:42:35 UTC (rev 11134)
@@ -28,6 +28,7 @@
.Dt LIBARCHIVE_CHANGES 3
.Os
.Sh NAME
+.Nm libarchive_changes
.Nd changes in libarchive interface
.\"
.Sh CHANGES IN LIBARCHIVE 3
Modified: trunk/contrib/libarchive/libarchive/mtree.5
===================================================================
--- trunk/contrib/libarchive/libarchive/mtree.5 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/mtree.5 2018-06-19 20:42:35 UTC (rev 11134)
@@ -48,7 +48,7 @@
.Pp
When encoding file or pathnames, any backslash character or
character outside of the 95 printable ASCII characters must be
-encoded as a a backslash followed by three
+encoded as a backslash followed by three
octal digits.
When reading mtree files, any appearance of a backslash
followed by three octal digits should be converted into the
Modified: trunk/contrib/libarchive/libarchive/tar.5
===================================================================
--- trunk/contrib/libarchive/libarchive/tar.5 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/tar.5 2018-06-19 20:42:35 UTC (rev 11134)
@@ -1,4 +1,5 @@
.\" Copyright (c) 2003-2009 Tim Kientzle
+.\" Copyright (c) 2016 Martin Matuska
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
@@ -24,7 +25,7 @@
.\"
.\" $FreeBSD: stable/11/contrib/libarchive/libarchive/tar.5 299529 2016-05-12 10:16:16Z mm $
.\"
-.Dd December 23, 2011
+.Dd December 27, 2016
.Dt TAR 5
.Os
.Sh NAME
@@ -440,11 +441,11 @@
Vendor-specific attributes used by Joerg Schilling's
.Nm star
implementation.
-.It Cm SCHILY.acl.access , Cm SCHILY.acl.default
-Stores the access and default ACLs as textual strings in a format
+.It Cm SCHILY.acl.access , Cm SCHILY.acl.default, Cm SCHILY.acl.ace
+Stores the access, default and NFSv4 ACLs as textual strings in a format
that is an extension of the format specified by POSIX.1e draft 17.
-In particular, each user or group access specification can include a fourth
-colon-separated field with the numeric UID or GID.
+In particular, each user or group access specification can include
+an additional colon-separated field with the numeric UID or GID.
This allows ACLs to be restored on systems that may not have complete
user or group information available (such as when NIS/YP or LDAP services
are temporarily unavailable).
Modified: trunk/contrib/libarchive/libarchive/test/CMakeLists.txt
===================================================================
--- trunk/contrib/libarchive/libarchive/test/CMakeLists.txt 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/test/CMakeLists.txt 2018-06-19 20:42:35 UTC (rev 11134)
@@ -6,14 +6,15 @@
IF(ENABLE_TEST)
SET(libarchive_test_SOURCES
../../test_utils/test_utils.c
- main.c
+ ../../test_utils/test_main.c
read_open_memory.c
test.h
- test_acl_freebsd_nfs4.c
- test_acl_freebsd_posix1e.c
test_acl_nfs4.c
test_acl_pax.c
+ test_acl_platform_nfs4.c
+ test_acl_platform_posix1e.c
test_acl_posix1e.c
+ test_acl_text.c
test_archive_api_feature.c
test_archive_clear_error.c
test_archive_cmdline.c
@@ -58,8 +59,11 @@
test_compat_lzop.c
test_compat_mac.c
test_compat_pax_libarchive_2x.c
+ test_compat_perl_archive_tar.c
+ test_compat_plexus_archiver_tar.c
test_compat_solaris_pax_sparse.c
test_compat_solaris_tar_acl.c
+ test_compat_star_acl.c
test_compat_tar_hardlink.c
test_compat_uudecode.c
test_compat_uudecode_large.c
@@ -138,6 +142,7 @@
test_read_format_lha_bugfix_0.c
test_read_format_lha_filename.c
test_read_format_mtree.c
+ test_read_format_mtree_crash747.c
test_read_format_pax_bz2.c
test_read_format_rar.c
test_read_format_rar_encryption_data.c
@@ -164,6 +169,8 @@
test_read_format_zip_encryption_header.c
test_read_format_zip_encryption_partially.c
test_read_format_zip_filename.c
+ test_read_format_zip_high_compression.c
+ test_read_format_zip_jar.c
test_read_format_zip_mac_metadata.c
test_read_format_zip_malformed.c
test_read_format_zip_msdos.c
@@ -175,7 +182,9 @@
test_read_format_zip_winzip_aes.c
test_read_format_zip_winzip_aes_large.c
test_read_format_zip_zip64.c
+ test_read_format_zip_with_invalid_traditional_eocd.c
test_read_large.c
+ test_read_pax_schily_xattr.c
test_read_pax_truncated.c
test_read_position.c
test_read_set_format.c
@@ -198,6 +207,9 @@
test_write_disk_no_hfs_compression.c
test_write_disk_perms.c
test_write_disk_secure.c
+ test_write_disk_secure744.c
+ test_write_disk_secure745.c
+ test_write_disk_secure746.c
test_write_disk_sparse.c
test_write_disk_symlink.c
test_write_disk_times.c
@@ -259,6 +271,7 @@
test_write_format_zip_zip64.c
test_write_open_memory.c
test_write_read_format_zip.c
+ test_xattr_platform.c
test_zip_filename_encoding.c
)
@@ -292,10 +305,11 @@
INCLUDE(${CMAKE_CURRENT_BINARY_DIR}/list.h)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/test_utils)
+ INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/libarchive/test)
# Experimental new test handling
ADD_CUSTOM_TARGET(run_libarchive_test
- COMMAND libarchive_test -r ${CMAKE_CURRENT_SOURCE_DIR})
+ COMMAND libarchive_test -r ${CMAKE_CURRENT_SOURCE_DIR} -vv)
ADD_DEPENDENCIES(run_all_tests run_libarchive_test)
ENDIF(ENABLE_TEST)
Modified: trunk/contrib/libarchive/libarchive/test/list.h
===================================================================
--- trunk/contrib/libarchive/libarchive/test/list.h 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/test/list.h 2018-06-19 20:42:35 UTC (rev 11134)
@@ -1,8 +1,12 @@
-DEFINE_TEST(test_acl_freebsd_nfs4)
-DEFINE_TEST(test_acl_freebsd_posix1e)
DEFINE_TEST(test_acl_nfs4)
-DEFINE_TEST(test_acl_pax)
+DEFINE_TEST(test_acl_pax_posix1e)
+DEFINE_TEST(test_acl_pax_nfs4)
+DEFINE_TEST(test_acl_platform_nfs4)
+DEFINE_TEST(test_acl_platform_posix1e_restore)
+DEFINE_TEST(test_acl_platform_posix1e_read)
DEFINE_TEST(test_acl_posix1e)
+DEFINE_TEST(test_acl_from_text)
+DEFINE_TEST(test_acl_to_text)
DEFINE_TEST(test_archive_api_feature)
DEFINE_TEST(test_archive_clear_error)
DEFINE_TEST(test_archive_cmdline)
@@ -112,8 +116,12 @@
DEFINE_TEST(test_compat_lzop)
DEFINE_TEST(test_compat_mac)
DEFINE_TEST(test_compat_pax_libarchive_2x)
+DEFINE_TEST(test_compat_perl_archive_tar)
+DEFINE_TEST(test_compat_plexus_archiver_tar)
DEFINE_TEST(test_compat_solaris_pax_sparse)
DEFINE_TEST(test_compat_solaris_tar_acl)
+DEFINE_TEST(test_compat_star_acl_posix1e)
+DEFINE_TEST(test_compat_star_acl_nfs4)
DEFINE_TEST(test_compat_tar_hardlink)
DEFINE_TEST(test_compat_uudecode)
DEFINE_TEST(test_compat_uudecode_large)
@@ -260,6 +268,7 @@
DEFINE_TEST(test_read_format_mtree_nomagic_v2_form)
DEFINE_TEST(test_read_format_mtree_nomagic_v2_netbsd_form)
DEFINE_TEST(test_read_format_mtree_nonexistent_contents_file)
+DEFINE_TEST(test_read_format_mtree_crash747)
DEFINE_TEST(test_read_format_pax_bz2)
DEFINE_TEST(test_read_format_rar_basic)
DEFINE_TEST(test_read_format_rar_subblock)
@@ -321,6 +330,9 @@
DEFINE_TEST(test_read_format_zip_filename_KOI8R_CP1251)
DEFINE_TEST(test_read_format_zip_filename_UTF8_CP1251)
DEFINE_TEST(test_read_format_zip_filename_KOI8R_UTF8_2)
+DEFINE_TEST(test_read_format_zip_high_compression)
+DEFINE_TEST(test_read_format_zip_high_compression2)
+DEFINE_TEST(test_read_format_zip_jar)
DEFINE_TEST(test_read_format_zip_mac_metadata)
DEFINE_TEST(test_read_format_zip_malformed)
DEFINE_TEST(test_read_format_zip_msdos)
@@ -335,9 +347,11 @@
DEFINE_TEST(test_read_format_zip_winzip_aes256)
DEFINE_TEST(test_read_format_zip_winzip_aes256_stored)
DEFINE_TEST(test_read_format_zip_winzip_aes256_large)
+DEFINE_TEST(test_read_format_zip_with_invalid_traditional_eocd)
DEFINE_TEST(test_read_format_zip_zip64a)
DEFINE_TEST(test_read_format_zip_zip64b)
DEFINE_TEST(test_read_large)
+DEFINE_TEST(test_schily_xattr_pax)
DEFINE_TEST(test_read_pax_truncated)
DEFINE_TEST(test_read_position)
DEFINE_TEST(test_read_set_format)
@@ -379,6 +393,10 @@
DEFINE_TEST(test_write_disk_mac_metadata)
DEFINE_TEST(test_write_disk_no_hfs_compression)
DEFINE_TEST(test_write_disk_perms)
+DEFINE_TEST(test_write_disk_secure744)
+DEFINE_TEST(test_write_disk_secure745)
+DEFINE_TEST(test_write_disk_secure746a)
+DEFINE_TEST(test_write_disk_secure746b)
DEFINE_TEST(test_write_disk_secure)
DEFINE_TEST(test_write_disk_sparse)
DEFINE_TEST(test_write_disk_symlink)
@@ -468,6 +486,7 @@
DEFINE_TEST(test_write_read_format_zip_improved_streaming)
DEFINE_TEST(test_write_read_format_zip64)
DEFINE_TEST(test_write_read_format_zip64_improved_streaming)
+DEFINE_TEST(test_xattr_platform)
DEFINE_TEST(test_zip_filename_encoding_UTF8)
DEFINE_TEST(test_zip_filename_encoding_KOI8R)
DEFINE_TEST(test_zip_filename_encoding_ru_RU_CP1251)
Modified: trunk/contrib/libarchive/libarchive/test/read_open_memory.c
===================================================================
--- trunk/contrib/libarchive/libarchive/test/read_open_memory.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/test/read_open_memory.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -86,22 +86,8 @@
read_open_memory_internal(struct archive *a, const void *buff,
size_t size, size_t read_size, int level)
{
- struct read_memory_data *mine;
+ struct read_memory_data *mine = NULL;
- mine = (struct read_memory_data *)malloc(sizeof(*mine));
- if (mine == NULL) {
- archive_set_error(a, ENOMEM, "No memory");
- return (ARCHIVE_FATAL);
- }
- memset(mine, 0, sizeof(*mine));
- mine->start = mine->p = (const unsigned char *)buff;
- mine->end = mine->start + size;
- mine->read_size = read_size;
- mine->copy_buff_offset = 32;
- mine->copy_buff_size = read_size + mine->copy_buff_offset * 2;
- mine->copy_buff = malloc(mine->copy_buff_size);
- memset(mine->copy_buff, 0xA5, mine->copy_buff_size);
-
switch (level) {
case 3:
archive_read_set_seek_callback(a, memory_read_seek);
@@ -109,6 +95,20 @@
archive_read_set_open_callback(a, memory_read_open);
archive_read_set_skip_callback(a, memory_read_skip);
case 1:
+ mine = malloc(sizeof(*mine));
+ if (mine == NULL) {
+ archive_set_error(a, ENOMEM, "No memory");
+ return (ARCHIVE_FATAL);
+ }
+ memset(mine, 0, sizeof(*mine));
+ mine->start = mine->p = (const unsigned char *)buff;
+ mine->end = mine->start + size;
+ mine->read_size = read_size;
+ mine->copy_buff_offset = 32;
+ mine->copy_buff_size = read_size + mine->copy_buff_offset * 2;
+ mine->copy_buff = malloc(mine->copy_buff_size);
+ memset(mine->copy_buff, 0xA5, mine->copy_buff_size);
+
archive_read_set_read_callback(a, memory_read);
archive_read_set_close_callback(a, memory_read_close);
archive_read_set_callback_data(a, mine);
@@ -213,7 +213,8 @@
{
struct read_memory_data *mine = (struct read_memory_data *)client_data;
(void)a; /* UNUSED */
- free(mine->copy_buff);
+ if (mine != NULL)
+ free(mine->copy_buff);
free(mine);
return (ARCHIVE_OK);
}
Modified: trunk/contrib/libarchive/libarchive/test/test.h
===================================================================
--- trunk/contrib/libarchive/libarchive/test/test.h 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/test/test.h 2018-06-19 20:42:35 UTC (rev 11134)
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2006 Tim Kientzle
+ * Copyright (c) 2003-2017 Tim Kientzle
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -21,338 +21,16 @@
* 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: stable/11/contrib/libarchive/libarchive/test/test.h 305188 2016-09-01 07:53:59Z mm $
*/
/* Every test program should #include "test.h" as the first thing. */
-/*
- * The goal of this file (and the matching test.c) is to
- * simplify the very repetitive test-*.c test programs.
- */
-#if defined(HAVE_CONFIG_H)
-/* Most POSIX platforms use the 'configure' script to build config.h */
-#include "config.h"
-#elif defined(__FreeBSD__)
-/* Building as part of FreeBSD system requires a pre-built config.h. */
-#include "config_freebsd.h"
-#elif defined(_WIN32) && !defined(__CYGWIN__)
-/* Win32 can't run the 'configure' script. */
-#include "config_windows.h"
-#else
-/* Warn if the library hasn't been (automatically or manually) configured. */
-#error Oops: No config.h and no pre-built configuration in test.h.
-#endif
+#define KNOWNREF "test_compat_gtar_1.tar.uu"
+#define ENVBASE "LIBARCHIVE" /* Prefix for environment variables. */
+#undef PROGRAM /* Testing a library, not a program. */
+#define LIBRARY "libarchive"
+#define EXTRA_DUMP(x) archive_error_string((struct archive *)(x))
+#define EXTRA_ERRNO(x) archive_errno((struct archive *)(x))
+#define EXTRA_VERSION archive_version_details()
-#include <sys/types.h> /* Windows requires this before sys/stat.h */
-#include <sys/stat.h>
-
-#if HAVE_DIRENT_H
-#include <dirent.h>
-#endif
-#ifdef HAVE_DIRECT_H
-#include <direct.h>
-#define dirent direct
-#endif
-#include <errno.h>
-#include <fcntl.h>
-#ifdef HAVE_IO_H
-#include <io.h>
-#endif
-#ifdef HAVE_STDINT_H
-#include <stdint.h>
-#endif
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include <time.h>
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-#include <wchar.h>
-#ifdef HAVE_WINDOWS_H
-#include <windows.h>
-#endif
-
-/*
- * System-specific tweaks. We really want to minimize these
- * as much as possible, since they make it harder to understand
- * the mainline code.
- */
-
-/* Windows (including Visual Studio and MinGW but not Cygwin) */
-#if defined(_WIN32) && !defined(__CYGWIN__)
-#if !defined(__BORLANDC__)
-#undef chdir
-#define chdir _chdir
-#define strdup _strdup
-#endif
-#endif
-
-/* Visual Studio */
-#if defined(_MSC_VER) && _MSC_VER < 1900
-#define snprintf sprintf_s
-#endif
-
-#if defined(__BORLANDC__)
-#pragma warn -8068 /* Constant out of range in comparison. */
-#endif
-
-/* Haiku OS and QNX */
-#if defined(__HAIKU__) || defined(__QNXNTO__)
-/* Haiku and QNX have typedefs in stdint.h (needed for int64_t) */
-#include <stdint.h>
-#endif
-
-/* Get a real definition for __FBSDID if we can */
-#if HAVE_SYS_CDEFS_H
-#include <sys/cdefs.h>
-#endif
-
-/* If not, define it so as to avoid dangling semicolons. */
-#ifndef __FBSDID
-#define __FBSDID(a) struct _undefined_hack
-#endif
-
-#ifndef O_BINARY
-#define O_BINARY 0
-#endif
-
-/*
- * Redefine DEFINE_TEST for use in defining the test functions.
- */
-#undef DEFINE_TEST
-#define DEFINE_TEST(name) void name(void); void name(void)
-
-/* An implementation of the standard assert() macro */
-#define assert(e) assertion_assert(__FILE__, __LINE__, (e), #e, NULL)
-/* chdir() and error if it fails */
-#define assertChdir(path) \
- assertion_chdir(__FILE__, __LINE__, path)
-/* Assert two integers are the same. Reports value of each one if not. */
-#define assertEqualInt(v1,v2) \
- assertion_equal_int(__FILE__, __LINE__, (v1), #v1, (v2), #v2, NULL)
-/* Assert two strings are the same. Reports value of each one if not. */
-#define assertEqualString(v1,v2) \
- assertion_equal_string(__FILE__, __LINE__, (v1), #v1, (v2), #v2, NULL, 0)
-#define assertEqualUTF8String(v1,v2) \
- assertion_equal_string(__FILE__, __LINE__, (v1), #v1, (v2), #v2, NULL, 1)
-/* As above, but v1 and v2 are wchar_t * */
-#define assertEqualWString(v1,v2) \
- assertion_equal_wstring(__FILE__, __LINE__, (v1), #v1, (v2), #v2, NULL)
-/* As above, but raw blocks of bytes. */
-#define assertEqualMem(v1, v2, l) \
- assertion_equal_mem(__FILE__, __LINE__, (v1), #v1, (v2), #v2, (l), #l, NULL)
-/* Assert that memory is full of a specified byte */
-#define assertMemoryFilledWith(v1, l, b) \
- assertion_memory_filled_with(__FILE__, __LINE__, (v1), #v1, (l), #l, (b), #b, NULL)
-/* Assert two files are the same. */
-#define assertEqualFile(f1, f2) \
- assertion_equal_file(__FILE__, __LINE__, (f1), (f2))
-/* Assert that a file is empty. */
-#define assertEmptyFile(pathname) \
- assertion_empty_file(__FILE__, __LINE__, (pathname))
-/* Assert that a file is not empty. */
-#define assertNonEmptyFile(pathname) \
- assertion_non_empty_file(__FILE__, __LINE__, (pathname))
-#define assertFileAtime(pathname, sec, nsec) \
- assertion_file_atime(__FILE__, __LINE__, pathname, sec, nsec)
-#define assertFileAtimeRecent(pathname) \
- assertion_file_atime_recent(__FILE__, __LINE__, pathname)
-#define assertFileBirthtime(pathname, sec, nsec) \
- assertion_file_birthtime(__FILE__, __LINE__, pathname, sec, nsec)
-#define assertFileBirthtimeRecent(pathname) \
- assertion_file_birthtime_recent(__FILE__, __LINE__, pathname)
-/* Assert that a file exists; supports printf-style arguments. */
-#define assertFileExists(pathname) \
- assertion_file_exists(__FILE__, __LINE__, pathname)
-/* Assert that a file exists. */
-#define assertFileNotExists(pathname) \
- assertion_file_not_exists(__FILE__, __LINE__, pathname)
-/* Assert that file contents match a string. */
-#define assertFileContents(data, data_size, pathname) \
- assertion_file_contents(__FILE__, __LINE__, data, data_size, pathname)
-#define assertFileMtime(pathname, sec, nsec) \
- assertion_file_mtime(__FILE__, __LINE__, pathname, sec, nsec)
-#define assertFileMtimeRecent(pathname) \
- assertion_file_mtime_recent(__FILE__, __LINE__, pathname)
-#define assertFileNLinks(pathname, nlinks) \
- assertion_file_nlinks(__FILE__, __LINE__, pathname, nlinks)
-#define assertFileSize(pathname, size) \
- assertion_file_size(__FILE__, __LINE__, pathname, size)
-#define assertFileMode(pathname, mode) \
- assertion_file_mode(__FILE__, __LINE__, pathname, mode)
-#define assertTextFileContents(text, pathname) \
- assertion_text_file_contents(__FILE__, __LINE__, text, pathname)
-#define assertFileContainsLinesAnyOrder(pathname, lines) \
- assertion_file_contains_lines_any_order(__FILE__, __LINE__, pathname, lines)
-#define assertIsDir(pathname, mode) \
- assertion_is_dir(__FILE__, __LINE__, pathname, mode)
-#define assertIsHardlink(path1, path2) \
- assertion_is_hardlink(__FILE__, __LINE__, path1, path2)
-#define assertIsNotHardlink(path1, path2) \
- assertion_is_not_hardlink(__FILE__, __LINE__, path1, path2)
-#define assertIsReg(pathname, mode) \
- assertion_is_reg(__FILE__, __LINE__, pathname, mode)
-#define assertIsSymlink(pathname, contents) \
- assertion_is_symlink(__FILE__, __LINE__, pathname, contents)
-/* Create a directory, report error if it fails. */
-#define assertMakeDir(dirname, mode) \
- assertion_make_dir(__FILE__, __LINE__, dirname, mode)
-#define assertMakeFile(path, mode, contents) \
- assertion_make_file(__FILE__, __LINE__, path, mode, -1, contents)
-#define assertMakeBinFile(path, mode, csize, contents) \
- assertion_make_file(__FILE__, __LINE__, path, mode, csize, contents)
-#define assertMakeHardlink(newfile, oldfile) \
- assertion_make_hardlink(__FILE__, __LINE__, newfile, oldfile)
-#define assertMakeSymlink(newfile, linkto) \
- assertion_make_symlink(__FILE__, __LINE__, newfile, linkto)
-#define assertNodump(path) \
- assertion_nodump(__FILE__, __LINE__, path)
-#define assertUmask(mask) \
- assertion_umask(__FILE__, __LINE__, mask)
-#define assertUtimes(pathname, atime, atime_nsec, mtime, mtime_nsec) \
- assertion_utimes(__FILE__, __LINE__, pathname, atime, atime_nsec, mtime, mtime_nsec)
-
-/*
- * This would be simple with C99 variadic macros, but I don't want to
- * require that. Instead, I insert a function call before each
- * skipping() call to pass the file and line information down. Crude,
- * but effective.
- */
-#define skipping \
- skipping_setup(__FILE__, __LINE__);test_skipping
-
-/* Function declarations. These are defined in test_utility.c. */
-void failure(const char *fmt, ...);
-int assertion_assert(const char *, int, int, const char *, void *);
-int assertion_chdir(const char *, int, const char *);
-int assertion_empty_file(const char *, int, const char *);
-int assertion_equal_file(const char *, int, const char *, const char *);
-int assertion_equal_int(const char *, int, long long, const char *, long long, const char *, void *);
-int assertion_equal_mem(const char *, int, const void *, const char *, const void *, const char *, size_t, const char *, void *);
-int assertion_memory_filled_with(const char *, int, const void *, const char *, size_t, const char *, char, const char *, void *);
-int assertion_equal_string(const char *, int, const char *v1, const char *, const char *v2, const char *, void *, int);
-int assertion_equal_wstring(const char *, int, const wchar_t *v1, const char *, const wchar_t *v2, const char *, void *);
-int assertion_file_atime(const char *, int, const char *, long, long);
-int assertion_file_atime_recent(const char *, int, const char *);
-int assertion_file_birthtime(const char *, int, const char *, long, long);
-int assertion_file_birthtime_recent(const char *, int, const char *);
-int assertion_file_contains_lines_any_order(const char *, int, const char *, const char **);
-int assertion_file_contents(const char *, int, const void *, int, const char *);
-int assertion_file_exists(const char *, int, const char *);
-int assertion_file_mtime(const char *, int, const char *, long, long);
-int assertion_file_mtime_recent(const char *, int, const char *);
-int assertion_file_nlinks(const char *, int, const char *, int);
-int assertion_file_not_exists(const char *, int, const char *);
-int assertion_file_size(const char *, int, const char *, long);
-int assertion_file_mode(const char *, int, const char *, int);
-int assertion_is_dir(const char *, int, const char *, int);
-int assertion_is_hardlink(const char *, int, const char *, const char *);
-int assertion_is_not_hardlink(const char *, int, const char *, const char *);
-int assertion_is_reg(const char *, int, const char *, int);
-int assertion_is_symlink(const char *, int, const char *, const char *);
-int assertion_make_dir(const char *, int, const char *, int);
-int assertion_make_file(const char *, int, const char *, int, int, const void *);
-int assertion_make_hardlink(const char *, int, const char *newpath, const char *);
-int assertion_make_symlink(const char *, int, const char *newpath, const char *);
-int assertion_nodump(const char *, int, const char *);
-int assertion_non_empty_file(const char *, int, const char *);
-int assertion_text_file_contents(const char *, int, const char *buff, const char *f);
-int assertion_umask(const char *, int, int);
-int assertion_utimes(const char *, int, const char *, long, long, long, long );
-
-void skipping_setup(const char *, int);
-void test_skipping(const char *fmt, ...);
-
-/* Like sprintf, then system() */
-int systemf(const char * fmt, ...);
-
-/* Delay until time() returns a value after this. */
-void sleepUntilAfter(time_t);
-
-/* Return true if this platform can create symlinks. */
-int canSymlink(void);
-
-/* Return true if this platform can run the "bzip2" program. */
-int canBzip2(void);
-
-/* Return true if this platform can run the "grzip" program. */
-int canGrzip(void);
-
-/* Return true if this platform can run the "gzip" program. */
-int canGzip(void);
-
-/* Return true if this platform can run the specified command. */
-int canRunCommand(const char *);
-
-/* Return true if this platform can run the "lrzip" program. */
-int canLrzip(void);
-
-/* Return true if this platform can run the "lz4" program. */
-int canLz4(void);
-
-/* Return true if this platform can run the "lzip" program. */
-int canLzip(void);
-
-/* Return true if this platform can run the "lzma" program. */
-int canLzma(void);
-
-/* Return true if this platform can run the "lzop" program. */
-int canLzop(void);
-
-/* Return true if this platform can run the "xz" program. */
-int canXz(void);
-
-/* Return true if this filesystem can handle nodump flags. */
-int canNodump(void);
-
-/* Return true if the file has large i-node number(>0xffffffff). */
-int is_LargeInode(const char *);
-
-/* Suck file into string allocated via malloc(). Call free() when done. */
-/* Supports printf-style args: slurpfile(NULL, "%s/myfile", refdir); */
-char *slurpfile(size_t *, const char *fmt, ...);
-
-/* Dump block of bytes to a file. */
-void dumpfile(const char *filename, void *, size_t);
-
-/* Extracts named reference file to the current directory. */
-void extract_reference_file(const char *);
-/* Copies named reference file to the current directory. */
-void copy_reference_file(const char *);
-
-/* Extracts a list of files to the current directory.
- * List must be NULL terminated.
- */
-void extract_reference_files(const char **);
-
-/* Path to working directory for current test */
-extern const char *testworkdir;
-
-/*
- * Special interfaces for libarchive test harness.
- */
-
-#include "archive.h"
-#include "archive_entry.h"
-
-/* Special customized read-from-memory interface. */
-int read_open_memory(struct archive *, const void *, size_t, size_t);
-/* _minimal version exercises a slightly different set of libarchive APIs. */
-int read_open_memory_minimal(struct archive *, const void *, size_t, size_t);
-/* _seek version produces a seekable file. */
-int read_open_memory_seek(struct archive *, const void *, size_t, size_t);
-
-/* Versions of above that accept an archive argument for additional info. */
-#define assertA(e) assertion_assert(__FILE__, __LINE__, (e), #e, (a))
-#define assertEqualIntA(a,v1,v2) \
- assertion_equal_int(__FILE__, __LINE__, (v1), #v1, (v2), #v2, (a))
-#define assertEqualStringA(a,v1,v2) \
- assertion_equal_string(__FILE__, __LINE__, (v1), #v1, (v2), #v2, (a), 0)
-
-#ifdef USE_DMALLOC
-#include <dmalloc.h>
-#endif
+#include "test_common.h"
Modified: trunk/contrib/libarchive/libarchive/test/test_acl_nfs4.c
===================================================================
--- trunk/contrib/libarchive/libarchive/test/test_acl_nfs4.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/test/test_acl_nfs4.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -33,15 +33,7 @@
* filesystems support ACLs or not.
*/
-struct acl_t {
- int type; /* Type of entry: "allow" or "deny" */
- int permset; /* Permissions for this class of users. */
- int tag; /* Owner, User, Owning group, group, everyone, etc. */
- int qual; /* GID or UID of user/group, depending on tag. */
- const char *name; /* Name of user/group, depending on tag. */
-};
-
-static struct acl_t acls1[] = {
+static struct archive_test_acl_t acls1[] = {
{ ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_EXECUTE,
ARCHIVE_ENTRY_ACL_USER_OBJ, -1, "" },
{ ARCHIVE_ENTRY_ACL_TYPE_DENY, ARCHIVE_ENTRY_ACL_READ_DATA,
@@ -52,7 +44,7 @@
ARCHIVE_ENTRY_ACL_EVERYONE, -1, "" },
};
-static struct acl_t acls2[] = {
+static struct archive_test_acl_t acls2[] = {
/* An entry for each type. */
{ ARCHIVE_ENTRY_ACL_TYPE_ALLOW, 0,
ARCHIVE_ENTRY_ACL_USER, 108, "user108" },
@@ -136,7 +128,7 @@
* Entries that should be rejected when we attempt to set them
* on an ACL that already has NFS4 entries.
*/
-static struct acl_t acls_bad[] = {
+static struct archive_test_acl_t acls_bad[] = {
/* POSIX.1e ACL types */
{ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_EXECUTE,
ARCHIVE_ENTRY_ACL_USER, 78, "" },
@@ -156,95 +148,6 @@
ARCHIVE_ENTRY_ACL_EVERYONE, -1, "" },
};
-static void
-set_acls(struct archive_entry *ae, struct acl_t *acls, int n)
-{
- int i;
-
- archive_entry_acl_clear(ae);
- for (i = 0; i < n; i++) {
- failure("type=%d, permset=%d, tag=%d, qual=%d name=%s",
- acls[i].type, acls[i].permset, acls[i].tag,
- acls[i].qual, acls[i].name);
- assertEqualInt(ARCHIVE_OK,
- archive_entry_acl_add_entry(ae,
- acls[i].type, acls[i].permset, acls[i].tag,
- acls[i].qual, acls[i].name));
- }
-}
-
-static int
-acl_match(struct acl_t *acl, int type, int permset, int tag, int qual,
- const char *name)
-{
- if (acl == NULL)
- return (0);
- if (type != acl->type)
- return (0);
- if (permset != acl->permset)
- return (0);
- if (tag != acl->tag)
- return (0);
- if (tag == ARCHIVE_ENTRY_ACL_USER_OBJ)
- return (1);
- if (tag == ARCHIVE_ENTRY_ACL_GROUP_OBJ)
- return (1);
- if (tag == ARCHIVE_ENTRY_ACL_EVERYONE)
- return (1);
- if (qual != acl->qual)
- return (0);
- if (name == NULL) {
- if (acl->name == NULL || acl->name[0] == '\0')
- return (1);
- return (0);
- }
- if (acl->name == NULL) {
- if (name[0] == '\0')
- return (1);
- return (0);
- }
- return (0 == strcmp(name, acl->name));
-}
-
-static void
-compare_acls(struct archive_entry *ae, struct acl_t *acls, int n)
-{
- int *marker = malloc(sizeof(marker[0]) * n);
- int i;
- int r;
- int type, permset, tag, qual;
- int matched;
- const char *name;
-
- for (i = 0; i < n; i++)
- marker[i] = i;
-
- while (0 == (r = archive_entry_acl_next(ae,
- ARCHIVE_ENTRY_ACL_TYPE_NFS4,
- &type, &permset, &tag, &qual, &name))) {
- for (i = 0, matched = 0; i < n && !matched; i++) {
- if (acl_match(&acls[marker[i]], type, permset,
- tag, qual, name)) {
- /* We found a match; remove it. */
- marker[i] = marker[n - 1];
- n--;
- matched = 1;
- }
- }
- failure("Could not find match for ACL "
- "(type=%d,permset=%d,tag=%d,qual=%d,name=``%s'')",
- type, permset, tag, qual, name);
- assertEqualInt(1, matched);
- }
- assertEqualInt(ARCHIVE_EOF, r);
- failure("Could not find match for ACL "
- "(type=%d,permset=%d,tag=%d,qual=%d,name=``%s'')",
- acls[marker[0]].type, acls[marker[0]].permset,
- acls[marker[0]].tag, acls[marker[0]].qual, acls[marker[0]].name);
- assertEqualInt(0, n); /* Number of ACLs not matched should == 0 */
- free(marker);
-}
-
DEFINE_TEST(test_acl_nfs4)
{
struct archive_entry *ae;
@@ -256,22 +159,31 @@
archive_entry_set_mode(ae, S_IFREG | 0777);
/* Store and read back some basic ACL entries. */
- set_acls(ae, acls1, sizeof(acls1)/sizeof(acls1[0]));
+ assertEntrySetAcls(ae, acls1, sizeof(acls1)/sizeof(acls1[0]));
+
+ /* Check that entry contains only NFSv4 types */
+ assert((archive_entry_acl_types(ae) &
+ ARCHIVE_ENTRY_ACL_TYPE_POSIX1E) == 0);
+ assert((archive_entry_acl_types(ae) &
+ ARCHIVE_ENTRY_ACL_TYPE_NFS4) != 0);
+
assertEqualInt(4,
archive_entry_acl_reset(ae, ARCHIVE_ENTRY_ACL_TYPE_NFS4));
- compare_acls(ae, acls1, sizeof(acls1)/sizeof(acls1[0]));
+ assertEntryCompareAcls(ae, acls1, sizeof(acls1)/sizeof(acls1[0]),
+ ARCHIVE_ENTRY_ACL_TYPE_NFS4, 0);
/* A more extensive set of ACLs. */
- set_acls(ae, acls2, sizeof(acls2)/sizeof(acls2[0]));
+ assertEntrySetAcls(ae, acls2, sizeof(acls2)/sizeof(acls2[0]));
assertEqualInt(32,
archive_entry_acl_reset(ae, ARCHIVE_ENTRY_ACL_TYPE_NFS4));
- compare_acls(ae, acls2, sizeof(acls2)/sizeof(acls2[0]));
+ assertEntryCompareAcls(ae, acls2, sizeof(acls2)/sizeof(acls2[0]),
+ ARCHIVE_ENTRY_ACL_TYPE_NFS4, 0);
/*
* Check that clearing ACLs gets rid of them all by repeating
* the first test.
*/
- set_acls(ae, acls1, sizeof(acls1)/sizeof(acls1[0]));
+ assertEntrySetAcls(ae, acls1, sizeof(acls1)/sizeof(acls1[0]));
failure("Basic ACLs shouldn't be stored as extended ACLs");
assertEqualInt(4,
archive_entry_acl_reset(ae, ARCHIVE_ENTRY_ACL_TYPE_NFS4));
@@ -280,9 +192,9 @@
* Different types of malformed ACL entries that should
* fail when added to existing NFS4 ACLs.
*/
- set_acls(ae, acls2, sizeof(acls2)/sizeof(acls2[0]));
+ assertEntrySetAcls(ae, acls2, sizeof(acls2)/sizeof(acls2[0]));
for (i = 0; i < (int)(sizeof(acls_bad)/sizeof(acls_bad[0])); ++i) {
- struct acl_t *p = &acls_bad[i];
+ struct archive_test_acl_t *p = &acls_bad[i];
failure("Malformed ACL test #%d", i);
assertEqualInt(ARCHIVE_FAILED,
archive_entry_acl_add_entry(ae,
Modified: trunk/contrib/libarchive/libarchive/test/test_acl_pax.c
===================================================================
--- trunk/contrib/libarchive/libarchive/test/test_acl_pax.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/test/test_acl_pax.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -1,5 +1,6 @@
/*-
* Copyright (c) 2003-2007 Tim Kientzle
+ * Copyright (c) 2016 Martin Matuska
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -23,11 +24,11 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: stable/11/contrib/libarchive/libarchive/test/test_acl_pax.c 248616 2013-03-22 13:36:03Z mm $");
+__FBSDID("$FreeBSD$");
/*
* Exercise the system-independent portion of the ACL support.
- * Check that pax archive can save and restore ACL data.
+ * Check that pax archive can save and restore POSIX.1e ACL data.
*
* This should work on all systems, regardless of whether local
* filesystems support ACLs or not.
@@ -35,15 +36,7 @@
static unsigned char buff[16384];
-struct acl_t {
- int type; /* Type of ACL: "access" or "default" */
- int permset; /* Permissions for this class of users. */
- int tag; /* Owner, User, Owning group, group, other, etc. */
- int qual; /* GID or UID of user/group, depending on tag. */
- const char *name; /* Name of user/group, depending on tag. */
-};
-
-static struct acl_t acls0[] = {
+static struct archive_test_acl_t acls0[] = {
{ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_EXECUTE,
ARCHIVE_ENTRY_ACL_USER_OBJ, 0, "" },
{ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_READ,
@@ -52,7 +45,7 @@
ARCHIVE_ENTRY_ACL_OTHER, 0, "" },
};
-static struct acl_t acls1[] = {
+static struct archive_test_acl_t acls1[] = {
{ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_EXECUTE,
ARCHIVE_ENTRY_ACL_USER_OBJ, -1, "" },
{ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_READ,
@@ -63,7 +56,7 @@
ARCHIVE_ENTRY_ACL_OTHER, -1, "" },
};
-static struct acl_t acls2[] = {
+static struct archive_test_acl_t acls2[] = {
{ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_EXECUTE | ARCHIVE_ENTRY_ACL_READ,
ARCHIVE_ENTRY_ACL_USER_OBJ, -1, "" },
{ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_READ,
@@ -78,102 +71,150 @@
ARCHIVE_ENTRY_ACL_OTHER, -1, "" },
};
-static void
-set_acls(struct archive_entry *ae, struct acl_t *acls, int n)
-{
- int i;
+static struct archive_test_acl_t acls3[] = {
+ { ARCHIVE_ENTRY_ACL_TYPE_ALLOW,
+ ARCHIVE_ENTRY_ACL_READ_DATA |
+ ARCHIVE_ENTRY_ACL_WRITE_DATA |
+ ARCHIVE_ENTRY_ACL_EXECUTE |
+ ARCHIVE_ENTRY_ACL_APPEND_DATA |
+ ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES |
+ ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES |
+ ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS |
+ ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS |
+ ARCHIVE_ENTRY_ACL_READ_ACL |
+ ARCHIVE_ENTRY_ACL_WRITE_ACL |
+ ARCHIVE_ENTRY_ACL_WRITE_OWNER |
+ ARCHIVE_ENTRY_ACL_SYNCHRONIZE,
+ ARCHIVE_ENTRY_ACL_USER_OBJ, 0, "" },
+ { ARCHIVE_ENTRY_ACL_TYPE_ALLOW,
+ ARCHIVE_ENTRY_ACL_READ_DATA |
+ ARCHIVE_ENTRY_ACL_WRITE_DATA |
+ ARCHIVE_ENTRY_ACL_APPEND_DATA |
+ ARCHIVE_ENTRY_ACL_READ_ACL |
+ ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES |
+ ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS |
+ ARCHIVE_ENTRY_ACL_READ_ACL |
+ ARCHIVE_ENTRY_ACL_SYNCHRONIZE,
+ ARCHIVE_ENTRY_ACL_GROUP_OBJ, 0, "" },
+ { ARCHIVE_ENTRY_ACL_TYPE_ALLOW,
+ ARCHIVE_ENTRY_ACL_READ_DATA |
+ ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES |
+ ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS |
+ ARCHIVE_ENTRY_ACL_READ_ACL |
+ ARCHIVE_ENTRY_ACL_SYNCHRONIZE,
+ ARCHIVE_ENTRY_ACL_EVERYONE, 0, "" },
+};
- archive_entry_acl_clear(ae);
- for (i = 0; i < n; i++) {
- archive_entry_acl_add_entry(ae,
- acls[i].type, acls[i].permset, acls[i].tag, acls[i].qual,
- acls[i].name);
- }
-}
+static struct archive_test_acl_t acls4[] = {
+ { ARCHIVE_ENTRY_ACL_TYPE_ALLOW,
+ ARCHIVE_ENTRY_ACL_READ_DATA |
+ ARCHIVE_ENTRY_ACL_WRITE_DATA |
+ ARCHIVE_ENTRY_ACL_APPEND_DATA |
+ ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES |
+ ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES |
+ ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS |
+ ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS |
+ ARCHIVE_ENTRY_ACL_READ_ACL |
+ ARCHIVE_ENTRY_ACL_WRITE_ACL |
+ ARCHIVE_ENTRY_ACL_WRITE_OWNER |
+ ARCHIVE_ENTRY_ACL_SYNCHRONIZE,
+ ARCHIVE_ENTRY_ACL_USER_OBJ, 0, "" },
+ { ARCHIVE_ENTRY_ACL_TYPE_ALLOW,
+ ARCHIVE_ENTRY_ACL_READ_DATA |
+ ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES |
+ ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS |
+ ARCHIVE_ENTRY_ACL_READ_ACL |
+ ARCHIVE_ENTRY_ACL_SYNCHRONIZE |
+ ARCHIVE_ENTRY_ACL_ENTRY_INHERITED,
+ ARCHIVE_ENTRY_ACL_USER, 77, "user77" },
+ { ARCHIVE_ENTRY_ACL_TYPE_DENY,
+ ARCHIVE_ENTRY_ACL_READ_DATA |
+ ARCHIVE_ENTRY_ACL_WRITE_DATA |
+ ARCHIVE_ENTRY_ACL_EXECUTE,
+ ARCHIVE_ENTRY_ACL_USER, 78, "user78" },
+ { ARCHIVE_ENTRY_ACL_TYPE_ALLOW,
+ ARCHIVE_ENTRY_ACL_READ_DATA |
+ ARCHIVE_ENTRY_ACL_WRITE_DATA |
+ ARCHIVE_ENTRY_ACL_APPEND_DATA |
+ ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES |
+ ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS |
+ ARCHIVE_ENTRY_ACL_READ_ACL |
+ ARCHIVE_ENTRY_ACL_SYNCHRONIZE,
+ ARCHIVE_ENTRY_ACL_GROUP_OBJ, 0, "" },
+ { ARCHIVE_ENTRY_ACL_TYPE_DENY,
+ ARCHIVE_ENTRY_ACL_WRITE_DATA |
+ ARCHIVE_ENTRY_ACL_APPEND_DATA |
+ ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES |
+ ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS |
+ ARCHIVE_ENTRY_ACL_WRITE_ACL |
+ ARCHIVE_ENTRY_ACL_WRITE_OWNER,
+ ARCHIVE_ENTRY_ACL_GROUP, 78, "group78" },
+ { ARCHIVE_ENTRY_ACL_TYPE_ALLOW,
+ ARCHIVE_ENTRY_ACL_READ_DATA |
+ ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES |
+ ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS |
+ ARCHIVE_ENTRY_ACL_READ_ACL |
+ ARCHIVE_ENTRY_ACL_SYNCHRONIZE,
+ ARCHIVE_ENTRY_ACL_EVERYONE, 0, "" },
+};
-static int
-acl_match(struct acl_t *acl, int type, int permset, int tag, int qual, const char *name)
-{
- if (type != acl->type)
- return (0);
- if (permset != acl->permset)
- return (0);
- if (tag != acl->tag)
- return (0);
- if (tag == ARCHIVE_ENTRY_ACL_USER_OBJ)
- return (1);
- if (tag == ARCHIVE_ENTRY_ACL_GROUP_OBJ)
- return (1);
- if (tag == ARCHIVE_ENTRY_ACL_OTHER)
- return (1);
- if (qual != acl->qual)
- return (0);
- if (name == NULL)
- return (acl->name == NULL || acl->name[0] == '\0');
- if (acl->name == NULL)
- return (name == NULL || name[0] == '\0');
- return (0 == strcmp(name, acl->name));
-}
+static struct archive_test_acl_t acls5[] = {
+ { ARCHIVE_ENTRY_ACL_TYPE_ALLOW,
+ ARCHIVE_ENTRY_ACL_READ_DATA |
+ ARCHIVE_ENTRY_ACL_WRITE_DATA |
+ ARCHIVE_ENTRY_ACL_EXECUTE |
+ ARCHIVE_ENTRY_ACL_APPEND_DATA |
+ ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES |
+ ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES |
+ ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS |
+ ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS |
+ ARCHIVE_ENTRY_ACL_READ_ACL |
+ ARCHIVE_ENTRY_ACL_WRITE_ACL |
+ ARCHIVE_ENTRY_ACL_WRITE_OWNER |
+ ARCHIVE_ENTRY_ACL_SYNCHRONIZE,
+ ARCHIVE_ENTRY_ACL_USER_OBJ, 0, "" },
+ { ARCHIVE_ENTRY_ACL_TYPE_ALLOW,
+ ARCHIVE_ENTRY_ACL_READ_DATA |
+ ARCHIVE_ENTRY_ACL_WRITE_DATA |
+ ARCHIVE_ENTRY_ACL_APPEND_DATA |
+ ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES |
+ ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS |
+ ARCHIVE_ENTRY_ACL_READ_ACL |
+ ARCHIVE_ENTRY_ACL_WRITE_OWNER |
+ ARCHIVE_ENTRY_ACL_SYNCHRONIZE,
+ ARCHIVE_ENTRY_ACL_USER, 77, "user77" },
+ { ARCHIVE_ENTRY_ACL_TYPE_AUDIT,
+ ARCHIVE_ENTRY_ACL_WRITE_DATA |
+ ARCHIVE_ENTRY_ACL_APPEND_DATA |
+ ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS,
+ ARCHIVE_ENTRY_ACL_USER, 77, "user77" },
+ { ARCHIVE_ENTRY_ACL_TYPE_ALLOW,
+ ARCHIVE_ENTRY_ACL_READ_DATA |
+ ARCHIVE_ENTRY_ACL_WRITE_DATA |
+ ARCHIVE_ENTRY_ACL_APPEND_DATA |
+ ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES |
+ ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS |
+ ARCHIVE_ENTRY_ACL_READ_ACL |
+ ARCHIVE_ENTRY_ACL_SYNCHRONIZE,
+ ARCHIVE_ENTRY_ACL_GROUP_OBJ, 0, "" },
+ { ARCHIVE_ENTRY_ACL_TYPE_ALARM,
+ ARCHIVE_ENTRY_ACL_READ_DATA |
+ ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES |
+ ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS |
+ ARCHIVE_ENTRY_ACL_READ_ACL |
+ ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS,
+ ARCHIVE_ENTRY_ACL_GROUP, 78, "group78" },
+ { ARCHIVE_ENTRY_ACL_TYPE_ALLOW,
+ ARCHIVE_ENTRY_ACL_READ_DATA |
+ ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES |
+ ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS |
+ ARCHIVE_ENTRY_ACL_READ_ACL |
+ ARCHIVE_ENTRY_ACL_SYNCHRONIZE,
+ ARCHIVE_ENTRY_ACL_EVERYONE, 0, "" },
+};
-static void
-compare_acls(struct archive_entry *ae, struct acl_t *acls, int n, int mode)
+DEFINE_TEST(test_acl_pax_posix1e)
{
- int *marker = malloc(sizeof(marker[0]) * n);
- int i;
- int r;
- int type, permset, tag, qual;
- int matched;
- const char *name;
-
- for (i = 0; i < n; i++)
- marker[i] = i;
-
- while (0 == (r = archive_entry_acl_next(ae,
- ARCHIVE_ENTRY_ACL_TYPE_ACCESS,
- &type, &permset, &tag, &qual, &name))) {
- for (i = 0, matched = 0; i < n && !matched; i++) {
- if (acl_match(&acls[marker[i]], type, permset,
- tag, qual, name)) {
- /* We found a match; remove it. */
- marker[i] = marker[n - 1];
- n--;
- matched = 1;
- }
- }
- if (tag == ARCHIVE_ENTRY_ACL_USER_OBJ) {
- if (!matched) printf("No match for user_obj perm\n");
- failure("USER_OBJ permset (%02o) != user mode (%02o)",
- permset, 07 & (mode >> 6));
- assert((permset << 6) == (mode & 0700));
- } else if (tag == ARCHIVE_ENTRY_ACL_GROUP_OBJ) {
- if (!matched) printf("No match for group_obj perm\n");
- failure("GROUP_OBJ permset %02o != group mode %02o",
- permset, 07 & (mode >> 3));
- assert((permset << 3) == (mode & 0070));
- } else if (tag == ARCHIVE_ENTRY_ACL_OTHER) {
- if (!matched) printf("No match for other perm\n");
- failure("OTHER permset (%02o) != other mode (%02o)",
- permset, mode & 07);
- assert((permset << 0) == (mode & 0007));
- } else {
- failure("Could not find match for ACL "
- "(type=%d,permset=%d,tag=%d,qual=%d,name=``%s'')",
- type, permset, tag, qual, name);
- assert(matched == 1);
- }
- }
- assertEqualInt(ARCHIVE_EOF, r);
- assert((mode_t)(mode & 0777) == (archive_entry_mode(ae) & 0777));
- failure("Could not find match for ACL "
- "(type=%d,permset=%d,tag=%d,qual=%d,name=``%s'')",
- acls[marker[0]].type, acls[marker[0]].permset,
- acls[marker[0]].tag, acls[marker[0]].qual, acls[marker[0]].name);
- assert(n == 0); /* Number of ACLs not matched should == 0 */
- free(marker);
-}
-
-DEFINE_TEST(test_acl_pax)
-{
struct archive *a;
struct archive_entry *ae;
size_t used;
@@ -197,16 +238,15 @@
archive_entry_set_mode(ae, S_IFREG | 0777);
/* Basic owner/owning group should just update mode bits. */
- set_acls(ae, acls0, sizeof(acls0)/sizeof(acls0[0]));
+ assertEntrySetAcls(ae, acls0, sizeof(acls0)/sizeof(acls0[0]));
assertA(0 == archive_write_header(a, ae));
/* With any extended ACL entry, we should read back a full set. */
- set_acls(ae, acls1, sizeof(acls1)/sizeof(acls1[0]));
+ assertEntrySetAcls(ae, acls1, sizeof(acls1)/sizeof(acls1[0]));
assertA(0 == archive_write_header(a, ae));
-
/* A more extensive set of ACLs. */
- set_acls(ae, acls2, sizeof(acls2)/sizeof(acls2[0]));
+ assertEntrySetAcls(ae, acls2, sizeof(acls2)/sizeof(acls2[0]));
assertA(0 == archive_write_header(a, ae));
/*
@@ -213,7 +253,7 @@
* Check that clearing ACLs gets rid of them all by repeating
* the first test.
*/
- set_acls(ae, acls0, sizeof(acls0)/sizeof(acls0[0]));
+ assertEntrySetAcls(ae, acls0, sizeof(acls0)/sizeof(acls0[0]));
assertA(0 == archive_write_header(a, ae));
archive_entry_free(ae);
@@ -227,13 +267,13 @@
fclose(f);
/* Write out the reference data to a file for manual inspection. */
- extract_reference_file("test_acl_pax.tar");
- reference = slurpfile(&reference_size, "test_acl_pax.tar");
+ extract_reference_file("test_acl_pax_posix1e.tar");
+ reference = slurpfile(&reference_size, "test_acl_pax_posix1e.tar");
/* Assert that the generated data matches the built-in reference data.*/
- failure("Generated pax archive does not match reference; compare 'testout' to 'test_acl_pax.tar' reference file.");
+ failure("Generated pax archive does not match reference; compare 'testout' to 'test_acl_pax_posix1e.tar' reference file.");
assertEqualMem(buff, reference, reference_size);
- failure("Generated pax archive does not match reference; compare 'testout' to 'test_acl_pax.tar' reference file.");
+ failure("Generated pax archive does not match reference; compare 'testout' to 'test_acl_pax_posix1e.tar' reference file.");
assertEqualInt((int)used, reference_size);
free(reference);
@@ -255,7 +295,8 @@
assertA(0 == archive_read_next_header(a, &ae));
failure("One extended ACL should flag all ACLs to be returned.");
assert(4 == archive_entry_acl_reset(ae, ARCHIVE_ENTRY_ACL_TYPE_ACCESS));
- compare_acls(ae, acls1, sizeof(acls1)/sizeof(acls1[0]), 0142);
+ assertEntryCompareAcls(ae, acls1, sizeof(acls1)/sizeof(acls1[0]),
+ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, 0142);
failure("Basic ACLs should set mode to 0142, not %04o",
archive_entry_mode(ae)&0777);
assert((archive_entry_mode(ae) & 0777) == 0142);
@@ -262,8 +303,10 @@
/* Third item has pretty extensive ACLs */
assertA(0 == archive_read_next_header(a, &ae));
- assertEqualInt(6, archive_entry_acl_reset(ae, ARCHIVE_ENTRY_ACL_TYPE_ACCESS));
- compare_acls(ae, acls2, sizeof(acls2)/sizeof(acls2[0]), 0543);
+ assertEqualInt(6, archive_entry_acl_reset(ae,
+ ARCHIVE_ENTRY_ACL_TYPE_ACCESS));
+ assertEntryCompareAcls(ae, acls2, sizeof(acls2)/sizeof(acls2[0]),
+ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, 0543);
failure("Basic ACLs should set mode to 0543, not %04o",
archive_entry_mode(ae)&0777);
assert((archive_entry_mode(ae) & 0777) == 0543);
@@ -280,3 +323,93 @@
assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
assertEqualInt(ARCHIVE_OK, archive_read_free(a));
}
+
+DEFINE_TEST(test_acl_pax_nfs4)
+{
+ struct archive *a;
+ struct archive_entry *ae;
+ size_t used;
+ FILE *f;
+ void *reference;
+ size_t reference_size;
+
+ /* Write an archive to memory. */
+ assert(NULL != (a = archive_write_new()));
+ assertA(0 == archive_write_set_format_pax(a));
+ assertA(0 == archive_write_add_filter_none(a));
+ assertA(0 == archive_write_set_bytes_per_block(a, 1));
+ assertA(0 == archive_write_set_bytes_in_last_block(a, 1));
+ assertA(0 == archive_write_open_memory(a, buff, sizeof(buff), &used));
+
+ /* Write a series of files to the archive with different ACL info. */
+
+ /* Create a simple archive_entry. */
+ assert((ae = archive_entry_new()) != NULL);
+ archive_entry_set_pathname(ae, "file");
+ archive_entry_set_mode(ae, S_IFREG | 0777);
+
+ /* NFS4 ACLs mirroring 0754 file mode */
+ assertEntrySetAcls(ae, acls3, sizeof(acls3)/sizeof(acls3[0]));
+ assertA(0 == archive_write_header(a, ae));
+
+ /* A more extensive set of NFS4 ACLs. */
+ assertEntrySetAcls(ae, acls4, sizeof(acls4)/sizeof(acls4[0]));
+ assertA(0 == archive_write_header(a, ae));
+
+ /* Set with special (audit, alarm) NFS4 ACLs. */
+ assertEntrySetAcls(ae, acls5, sizeof(acls5)/sizeof(acls5[0]));
+ assertA(0 == archive_write_header(a, ae));
+
+ archive_entry_free(ae);
+
+ /* Close out the archive. */
+ assertEqualIntA(a, ARCHIVE_OK, archive_write_close(a));
+ assertEqualInt(ARCHIVE_OK, archive_write_free(a));
+
+ /* Write out the data we generated to a file for manual inspection. */
+ assert(NULL != (f = fopen("testout", "wb")));
+ assertEqualInt(used, (size_t)fwrite(buff, 1, (unsigned int)used, f));
+ fclose(f);
+
+ /* Write out the reference data to a file for manual inspection. */
+ extract_reference_file("test_acl_pax_nfs4.tar");
+ reference = slurpfile(&reference_size, "test_acl_pax_nfs4.tar");
+
+ /* Assert that the generated data matches the built-in reference data.*/
+ failure("Generated pax archive does not match reference; compare 'testout' to 'test_acl_pax_nfs4.tar' reference file.");
+ assertEqualMem(buff, reference, reference_size);
+ failure("Generated pax archive does not match reference; compare 'testout' to 'test_acl_pax_nfs4.tar' reference file.");
+ assertEqualInt((int)used, reference_size);
+ free(reference);
+
+ /* Read back each entry and check that the ACL data is right. */
+ assert(NULL != (a = archive_read_new()));
+ assertA(0 == archive_read_support_format_all(a));
+ assertA(0 == archive_read_support_filter_all(a));
+ assertA(0 == archive_read_open_memory(a, buff, used));
+
+ /* First item has NFS4 ACLs mirroring file mode */
+ assertA(0 == archive_read_next_header(a, &ae));
+ assertEqualInt(3, archive_entry_acl_reset(ae,
+ ARCHIVE_ENTRY_ACL_TYPE_ALLOW));
+ assertEntryCompareAcls(ae, acls3, sizeof(acls3)/sizeof(acls3[0]),
+ ARCHIVE_ENTRY_ACL_TYPE_ALLOW, 0);
+
+ /* Second item has has more fine-grained NFS4 ACLs */
+ assertA(0 == archive_read_next_header(a, &ae));
+ assertEqualInt(6, archive_entry_acl_reset(ae,
+ ARCHIVE_ENTRY_ACL_TYPE_NFS4));
+ assertEntryCompareAcls(ae, acls4, sizeof(acls4)/sizeof(acls4[0]),
+ ARCHIVE_ENTRY_ACL_TYPE_NFS4, 0);
+
+ /* Third item has has audit and alarm NFS4 ACLs */
+ assertA(0 == archive_read_next_header(a, &ae));
+ assertEqualInt(6, archive_entry_acl_reset(ae,
+ ARCHIVE_ENTRY_ACL_TYPE_NFS4));
+ assertEntryCompareAcls(ae, acls5, sizeof(acls5)/sizeof(acls5[0]),
+ ARCHIVE_ENTRY_ACL_TYPE_NFS4, 0);
+
+ /* Close the archive. */
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
+ assertEqualInt(ARCHIVE_OK, archive_read_free(a));
+}
Deleted: trunk/contrib/libarchive/libarchive/test/test_acl_pax.tar.uu
===================================================================
--- trunk/contrib/libarchive/libarchive/test/test_acl_pax.tar.uu 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/test/test_acl_pax.tar.uu 2018-06-19 20:42:35 UTC (rev 11134)
@@ -1,117 +0,0 @@
-begin 644 test_acl_pax.tar
-M9FEL90``````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M`````````````#`P,#$T,B``,#`P,#`P(``P,#`P,#`@`#`P,#`P,#`P,#`P
-M(#`P,#`P,#`P,#`P(#`Q,#`P-@`@,```````````````````````````````
-M````````````````````````````````````````````````````````````
-M``````````````````````````````````````````!U<W1A<@`P,```````
-M````````````````````````````````````````````````````````````
-M```````````````````P,#`P,#`@`#`P,#`P,"``````````````````````
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M``````````````````````!087A(96%D97(O9FEL90``````````````````
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````,#`P,30R(``P,#`P,#`@`#`P
-M,#`P,"``,#`P,#`P,#`Q,3`@,#`P,#`P,#`P,#`@,#$Q-S8Q`"!X````````
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M`````'5S=&%R`#`P````````````````````````````````````````````
-M`````````````````````````````````````````#`P,#`P,"``,#`P,#`P
-M(```````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M`````````````````````````````````````````````#<R(%-#2$E,62YA
-M8VPN86-C97-S/75S97(Z.BTM>"QG<F]U<#HZ<BTM+&]T:&5R.CHM=RTL=7-E
-M<CIU<V5R-S<Z<BTM.C<W"@``````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M````````9FEL90``````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M`````````````````````#`P,#$T,B``,#`P,#`P(``P,#`P,#`@`#`P,#`P
-M,#`P,#`P(#`P,#`P,#`P,#`P(#`Q,#`P-@`@,```````````````````````
-M````````````````````````````````````````````````````````````
-M``````````````````````````````````````````````````!U<W1A<@`P
-M,```````````````````````````````````````````````````````````
-M```````````````````````````P,#`P,#`@`#`P,#`P,"``````````````
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M``````````````````````````````!087A(96%D97(O9FEL90``````````
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````,#`P-30S(``P,#`P
-M,#`@`#`P,#`P,"``,#`P,#`P,#`Q-C$@,#`P,#`P,#`P,#`@,#$Q-S<T`"!X
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M`````````````'5S=&%R`#`P````````````````````````````````````
-M`````````````````````````````````````````````````#`P,#`P,"``
-M,#`P,#`P(```````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M`````````````````````````````````````````````````````#$Q,R!3
-M0TA)3%DN86-L+F%C8V5S<SUU<V5R.CIR+7 at L9W)O=7`Z.G(M+2QO=&AE<CHZ
-M+7=X+'5S97(Z=7-E<C<W.G(M+3HW-RQU<V5R.G5S97(W.#HM+2TZ-S at L9W)O
-M=7`Z9W)O=7`W.#IR=W at Z-S@*````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M````````````````9FEL90``````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M`````````````````````````````#`P,#4T,R``,#`P,#`P(``P,#`P,#`@
-M`#`P,#`P,#`P,#`P(#`P,#`P,#`P,#`P(#`Q,#`Q,P`@,```````````````
-M````````````````````````````````````````````````````````````
-M``````````````````````````````````````````````````````````!U
-M<W1A<@`P,```````````````````````````````````````````````````
-M```````````````````````````````````P,#`P,#`@`#`P,#`P,"``````
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M``````````````````````````````````````!F:6QE````````````````
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````,#`P,30R
-M(``P,#`P,#`@`#`P,#`P,"``,#`P,#`P,#`P,#`@,#`P,#`P,#`P,#`@,#$P
-M,#`V`"`P````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M`````````````````````'5S=&%R`#`P````````````````````````````
-M`````````````````````````````````````````````````````````#`P
-M,#`P,"``,#`P,#`P(```````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-C````````````````````````````````````````````````
-`
-end
Copied: trunk/contrib/libarchive/libarchive/test/test_acl_pax_nfs4.tar.uu (from rev 11133, vendor/libarchive/dist/libarchive/test/test_acl_pax_nfs4.tar.uu)
===================================================================
--- trunk/contrib/libarchive/libarchive/test/test_acl_pax_nfs4.tar.uu (rev 0)
+++ trunk/contrib/libarchive/libarchive/test/test_acl_pax_nfs4.tar.uu 2018-06-19 20:42:35 UTC (rev 11134)
@@ -0,0 +1,129 @@
+begin 644 test_acl_pax_nfs4.tar
+M4&%X2&5A9&5R+V9I;&4`````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````#`P,#<W-R``,#`P,#`P(``P,#`P,#`@`#`P,#`P,#`P,3,R
+M(#`P,#`P,#`P,#`P(#`Q,C`P,P`@>```````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````````!U<W1A<@`P,```````
+M````````````````````````````````````````````````````````````
+M```````````````````P,#`P,#`@`#`P,#`P,"``````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M```````````````````````Y,"!30TA)3%DN86-L+F%C93UO=VYE<D`Z<G=X
+M<&%!4E=C0V]S.CIA;&QO=RQG<F]U<$`Z<G=P85)C<SHZ86QL;W<L979E<GEO
+M;F5`.G)A4F-S.CIA;&QO=PH`````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````````&9I;&4`````````
+M````````````````````````````````````````````````````````````
+M```````````````````````````````````````````````````````````P
+M,#`W-S<@`#`P,#`P,"``,#`P,#`P(``P,#`P,#`P,#`P,"`P,#`P,#`P,#`P
+M,"`P,3`P,C0`(#``````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````=7-T87(`,#``````````````````````
+M````````````````````````````````````````````````````````````
+M````,#`P,#`P(``P,#`P,#`@````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````4&%X2&5A9&5R+V9I;&4`````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````#`P,#<W-R``,#`P,#`P(``P,#`P,#`@`#`P,#`P
+M,#`P,C4V(#`P,#`P,#`P,#`P(#`Q,C`Q,@`@>```````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````````````````!U<W1A<@`P
+M,```````````````````````````````````````````````````````````
+M```````````````````````````P,#`P,#`@`#`P,#`P,"``````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M```````````````````````````````Q-S0 at 4T-(24Q9+F%C;"YA8V4];W=N
+M97)`.G)W<&%!4E=C0V]S.CIA;&QO=RQU<V5R.G5S97(W-SIR85)C<SI).F%L
+M;&]W.C<W+'5S97(Z=7-E<C<X.G)W>#HZ9&5N>3HW."QG<F]U<$`Z<G=P85)C
+M<SHZ86QL;W<L9W)O=7`Z9W)O=7`W.#IW<$%70V\Z.F1E;GDZ-S at L979E<GEO
+M;F5`.G)A4F-S.CIA;&QO=PH`````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````````````````&9I;&4`
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M```````P,#`W-S<@`#`P,#`P,"``,#`P,#`P(``P,#`P,#`P,#`P,"`P,#`P
+M,#`P,#`P,"`P,3`P,C0`(#``````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````=7-T87(`,#``````````````
+M````````````````````````````````````````````````````````````
+M````````````,#`P,#`P(``P,#`P,#`@````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````4&%X2&5A9&5R+V9I;&4`````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````#`P,#<W-R``,#`P,#`P(``P,#`P,#`@
+M`#`P,#`P,#`P,C8R(#`P,#`P,#`P,#`P(#`Q,C`P-P`@>```````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````````````````````````!U
+M<W1A<@`P,```````````````````````````````````````````````````
+M```````````````````````````````````P,#`P,#`@`#`P,#`P,"``````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M```````````````````````````````````````Q-S@@4T-(24Q9+F%C;"YA
+M8V4];W=N97)`.G)W>'!A05)78T-O<SHZ86QL;W<L=7-E<CIU<V5R-S<Z<G=P
+M85)C;W,Z.F%L;&]W.C<W+'5S97(Z=7-E<C<W.G=P.E,Z875D:70Z-S<L9W)O
+M=7!`.G)W<&%28W,Z.F%L;&]W+&=R;W5P.F=R;W5P-S at Z<F%28SI&.F%L87)M
+M.C<X+&5V97)Y;VYE0#IR85)C<SHZ86QL;W<*````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`&9I;&4`````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M```````````````P,#`W-S<@`#`P,#`P,"``,#`P,#`P(``P,#`P,#`P,#`P
+M,"`P,#`P,#`P,#`P,"`P,3`P,C0`(#``````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````=7-T87(`,#``````
+M````````````````````````````````````````````````````````````
+M````````````````````,#`P,#`P(``P,#`P,#`@````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+'````````````
+`
+end
Copied: trunk/contrib/libarchive/libarchive/test/test_acl_pax_posix1e.tar.uu (from rev 11133, vendor/libarchive/dist/libarchive/test/test_acl_pax_posix1e.tar.uu)
===================================================================
--- trunk/contrib/libarchive/libarchive/test/test_acl_pax_posix1e.tar.uu (rev 0)
+++ trunk/contrib/libarchive/libarchive/test/test_acl_pax_posix1e.tar.uu 2018-06-19 20:42:35 UTC (rev 11134)
@@ -0,0 +1,117 @@
+begin 644 test_acl_pax_posix1e.tar
+M9FEL90``````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````#`P,#$T,B``,#`P,#`P(``P,#`P,#`@`#`P,#`P,#`P,#`P
+M(#`P,#`P,#`P,#`P(#`Q,#`P-@`@,```````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````````!U<W1A<@`P,```````
+M````````````````````````````````````````````````````````````
+M```````````````````P,#`P,#`@`#`P,#`P,"``````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````!087A(96%D97(O9FEL90``````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````,#`P,30R(``P,#`P,#`@`#`P
+M,#`P,"``,#`P,#`P,#`Q,3`@,#`P,#`P,#`P,#`@,#$Q-S8Q`"!X````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````'5S=&%R`#`P````````````````````````````````````````````
+M`````````````````````````````````````````#`P,#`P,"``,#`P,#`P
+M(```````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````````#<R(%-#2$E,62YA
+M8VPN86-C97-S/75S97(Z.BTM>"QG<F]U<#HZ<BTM+&]T:&5R.CHM=RTL=7-E
+M<CIU<V5R-S<Z<BTM.C<W"@``````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````9FEL90``````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````#`P,#$T,B``,#`P,#`P(``P,#`P,#`@`#`P,#`P
+M,#`P,#`P(#`P,#`P,#`P,#`P(#`Q,#`P-@`@,```````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````````````````!U<W1A<@`P
+M,```````````````````````````````````````````````````````````
+M```````````````````````````P,#`P,#`@`#`P,#`P,"``````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````!087A(96%D97(O9FEL90``````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````,#`P-30S(``P,#`P
+M,#`@`#`P,#`P,"``,#`P,#`P,#`Q-C$@,#`P,#`P,#`P,#`@,#$Q-S<T`"!X
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````'5S=&%R`#`P````````````````````````````````````
+M`````````````````````````````````````````````````#`P,#`P,"``
+M,#`P,#`P(```````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````````````````#$Q,R!3
+M0TA)3%DN86-L+F%C8V5S<SUU<V5R.CIR+7 at L9W)O=7`Z.G(M+2QO=&AE<CHZ
+M+7=X+'5S97(Z=7-E<C<W.G(M+3HW-RQU<V5R.G5S97(W.#HM+2TZ-S at L9W)O
+M=7`Z9W)O=7`W.#IR=W at Z-S@*````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````9FEL90``````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````#`P,#4T,R``,#`P,#`P(``P,#`P,#`@
+M`#`P,#`P,#`P,#`P(#`P,#`P,#`P,#`P(#`Q,#`Q,P`@,```````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````````````````````````!U
+M<W1A<@`P,```````````````````````````````````````````````````
+M```````````````````````````````````P,#`P,#`@`#`P,#`P,"``````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````!F:6QE````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````,#`P,30R
+M(``P,#`P,#`@`#`P,#`P,"``,#`P,#`P,#`P,#`@,#`P,#`P,#`P,#`@,#$P
+M,#`V`"`P````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````'5S=&%R`#`P````````````````````````````
+M`````````````````````````````````````````````````````````#`P
+M,#`P,"``,#`P,#`P(```````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+C````````````````````````````````````````````````
+`
+end
Copied: trunk/contrib/libarchive/libarchive/test/test_acl_platform_nfs4.c (from rev 11133, vendor/libarchive/dist/libarchive/test/test_acl_platform_nfs4.c)
===================================================================
--- trunk/contrib/libarchive/libarchive/test/test_acl_platform_nfs4.c (rev 0)
+++ trunk/contrib/libarchive/libarchive/test/test_acl_platform_nfs4.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -0,0 +1,1058 @@
+/*-
+ * Copyright (c) 2003-2010 Tim Kientzle
+ * Copyright (c) 2017 Martin Matuska
+ * 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 "test.h"
+__FBSDID("$FreeBSD$");
+
+#if ARCHIVE_ACL_NFS4
+#if HAVE_SYS_ACL_H
+#define _ACL_PRIVATE
+#include <sys/acl.h>
+#endif
+#if HAVE_SYS_RICHACL_H
+#include <sys/richacl.h>
+#endif
+#if HAVE_MEMBERSHIP_H
+#include <membership.h>
+#endif
+
+struct myacl_t {
+ int type;
+ int permset;
+ int tag;
+ int qual; /* GID or UID of user/group, depending on tag. */
+ const char *name; /* Name of user/group, depending on tag. */
+};
+
+static struct myacl_t acls_reg[] = {
+#if !ARCHIVE_ACL_DARWIN
+ /* For this test, we need the file owner to be able to read and write the ACL. */
+ { ARCHIVE_ENTRY_ACL_TYPE_ALLOW,
+ ARCHIVE_ENTRY_ACL_READ_DATA | ARCHIVE_ENTRY_ACL_READ_ACL | ARCHIVE_ENTRY_ACL_WRITE_ACL | ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS | ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES,
+ ARCHIVE_ENTRY_ACL_USER_OBJ, -1, ""},
+#endif
+ /* An entry for each type. */
+ { ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_EXECUTE,
+ ARCHIVE_ENTRY_ACL_USER, 108, "user108" },
+ { ARCHIVE_ENTRY_ACL_TYPE_DENY, ARCHIVE_ENTRY_ACL_EXECUTE,
+ ARCHIVE_ENTRY_ACL_USER, 109, "user109" },
+
+ /* An entry for each permission. */
+ { ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_EXECUTE,
+ ARCHIVE_ENTRY_ACL_USER, 112, "user112" },
+ { ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_READ_DATA,
+ ARCHIVE_ENTRY_ACL_USER, 113, "user113" },
+ { ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_WRITE_DATA,
+ ARCHIVE_ENTRY_ACL_USER, 115, "user115" },
+ { ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_APPEND_DATA,
+ ARCHIVE_ENTRY_ACL_USER, 117, "user117" },
+ { ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS,
+ ARCHIVE_ENTRY_ACL_USER, 119, "user119" },
+ { ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS,
+ ARCHIVE_ENTRY_ACL_USER, 120, "user120" },
+ { ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES,
+ ARCHIVE_ENTRY_ACL_USER, 122, "user122" },
+ { ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES,
+ ARCHIVE_ENTRY_ACL_USER, 123, "user123" },
+ { ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_DELETE,
+ ARCHIVE_ENTRY_ACL_USER, 124, "user124" },
+ { ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_READ_ACL,
+ ARCHIVE_ENTRY_ACL_USER, 125, "user125" },
+ { ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_WRITE_ACL,
+ ARCHIVE_ENTRY_ACL_USER, 126, "user126" },
+ { ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_WRITE_OWNER,
+ ARCHIVE_ENTRY_ACL_USER, 127, "user127" },
+ { ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_SYNCHRONIZE,
+ ARCHIVE_ENTRY_ACL_USER, 128, "user128" },
+
+ /* One entry for each qualifier. */
+ { ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_EXECUTE,
+ ARCHIVE_ENTRY_ACL_USER, 135, "user135" },
+// { ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_EXECUTE,
+// ARCHIVE_ENTRY_ACL_USER_OBJ, -1, "" },
+ { ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_EXECUTE,
+ ARCHIVE_ENTRY_ACL_GROUP, 136, "group136" },
+#if !ARCHIVE_ACL_DARWIN
+ { ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_EXECUTE,
+ ARCHIVE_ENTRY_ACL_GROUP_OBJ, -1, "" },
+ { ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_EXECUTE,
+ ARCHIVE_ENTRY_ACL_EVERYONE, -1, "" }
+#else /* MacOS - mode 0654 */
+ { ARCHIVE_ENTRY_ACL_TYPE_DENY, ARCHIVE_ENTRY_ACL_EXECUTE,
+ ARCHIVE_ENTRY_ACL_USER_OBJ, -1, "" },
+ { ARCHIVE_ENTRY_ACL_TYPE_ALLOW,
+ ARCHIVE_ENTRY_ACL_READ_DATA |
+ ARCHIVE_ENTRY_ACL_WRITE_DATA |
+ ARCHIVE_ENTRY_ACL_APPEND_DATA |
+ ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES |
+ ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES |
+ ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS |
+ ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS |
+ ARCHIVE_ENTRY_ACL_READ_ACL |
+ ARCHIVE_ENTRY_ACL_WRITE_ACL |
+ ARCHIVE_ENTRY_ACL_WRITE_OWNER |
+ ARCHIVE_ENTRY_ACL_SYNCHRONIZE,
+ ARCHIVE_ENTRY_ACL_USER_OBJ, -1, "" },
+ { ARCHIVE_ENTRY_ACL_TYPE_ALLOW,
+ ARCHIVE_ENTRY_ACL_READ_DATA |
+ ARCHIVE_ENTRY_ACL_EXECUTE |
+ ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES |
+ ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS |
+ ARCHIVE_ENTRY_ACL_READ_ACL |
+ ARCHIVE_ENTRY_ACL_SYNCHRONIZE,
+ ARCHIVE_ENTRY_ACL_GROUP_OBJ, -1, "" },
+ { ARCHIVE_ENTRY_ACL_TYPE_ALLOW,
+ ARCHIVE_ENTRY_ACL_READ_DATA |
+ ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES |
+ ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS |
+ ARCHIVE_ENTRY_ACL_READ_ACL |
+ ARCHIVE_ENTRY_ACL_SYNCHRONIZE,
+ ARCHIVE_ENTRY_ACL_EVERYONE, -1, "" }
+#endif
+};
+
+static const int acls_reg_cnt = (int)(sizeof(acls_reg)/sizeof(acls_reg[0]));
+
+static struct myacl_t acls_dir[] = {
+ /* For this test, we need to be able to read and write the ACL. */
+#if !ARCHIVE_ACL_DARWIN
+ { ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_READ_DATA | ARCHIVE_ENTRY_ACL_READ_ACL,
+ ARCHIVE_ENTRY_ACL_USER_OBJ, -1, ""},
+#endif
+
+ /* An entry for each type. */
+ { ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_LIST_DIRECTORY,
+ ARCHIVE_ENTRY_ACL_USER, 101, "user101" },
+ { ARCHIVE_ENTRY_ACL_TYPE_DENY, ARCHIVE_ENTRY_ACL_LIST_DIRECTORY,
+ ARCHIVE_ENTRY_ACL_USER, 102, "user102" },
+
+ /* An entry for each permission. */
+ { ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_LIST_DIRECTORY,
+ ARCHIVE_ENTRY_ACL_USER, 201, "user201" },
+ { ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_ADD_FILE,
+ ARCHIVE_ENTRY_ACL_USER, 202, "user202" },
+ { ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY,
+ ARCHIVE_ENTRY_ACL_USER, 203, "user203" },
+ { ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS,
+ ARCHIVE_ENTRY_ACL_USER, 204, "user204" },
+ { ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS,
+ ARCHIVE_ENTRY_ACL_USER, 205, "user205" },
+ { ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_DELETE_CHILD,
+ ARCHIVE_ENTRY_ACL_USER, 206, "user206" },
+ { ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES,
+ ARCHIVE_ENTRY_ACL_USER, 207, "user207" },
+ { ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES,
+ ARCHIVE_ENTRY_ACL_USER, 208, "user208" },
+ { ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_DELETE,
+ ARCHIVE_ENTRY_ACL_USER, 209, "user209" },
+ { ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_READ_ACL,
+ ARCHIVE_ENTRY_ACL_USER, 210, "user210" },
+ { ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_WRITE_ACL,
+ ARCHIVE_ENTRY_ACL_USER, 211, "user211" },
+ { ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_WRITE_OWNER,
+ ARCHIVE_ENTRY_ACL_USER, 212, "user212" },
+ { ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_SYNCHRONIZE,
+ ARCHIVE_ENTRY_ACL_USER, 213, "user213" },
+
+ /* One entry with each inheritance value. */
+ { ARCHIVE_ENTRY_ACL_TYPE_ALLOW,
+ ARCHIVE_ENTRY_ACL_READ_DATA | ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT,
+ ARCHIVE_ENTRY_ACL_USER, 301, "user301" },
+ { ARCHIVE_ENTRY_ACL_TYPE_ALLOW,
+ ARCHIVE_ENTRY_ACL_READ_DATA | ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT,
+ ARCHIVE_ENTRY_ACL_USER, 302, "user302" },
+ { ARCHIVE_ENTRY_ACL_TYPE_ALLOW,
+ ARCHIVE_ENTRY_ACL_READ_DATA |
+ ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT |
+ ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT,
+ ARCHIVE_ENTRY_ACL_USER, 303, "user303" },
+ { ARCHIVE_ENTRY_ACL_TYPE_ALLOW,
+ ARCHIVE_ENTRY_ACL_READ_DATA |
+ ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT |
+ ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY,
+ ARCHIVE_ENTRY_ACL_USER, 304, "user304" },
+#if !defined(ARCHIVE_ACL_SUNOS_NFS4) || defined(ACE_INHERITED_ACE)
+ { ARCHIVE_ENTRY_ACL_TYPE_ALLOW,
+ ARCHIVE_ENTRY_ACL_READ_DATA | ARCHIVE_ENTRY_ACL_ENTRY_INHERITED,
+ ARCHIVE_ENTRY_ACL_USER, 305, "user305" },
+#endif
+
+#if 0
+ /* FreeBSD does not support audit entries. */
+ { ARCHIVE_ENTRY_ACL_TYPE_AUDIT,
+ ARCHIVE_ENTRY_ACL_READ_DATA | ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS,
+ ARCHIVE_ENTRY_ACL_USER, 401, "user401" },
+ { ARCHIVE_ENTRY_ACL_TYPE_AUDIT,
+ ARCHIVE_ENTRY_ACL_READ_DATA | ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS,
+ ARCHIVE_ENTRY_ACL_USER, 402, "user402" },
+#endif
+
+ /* One entry for each qualifier. */
+ { ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_LIST_DIRECTORY,
+ ARCHIVE_ENTRY_ACL_USER, 501, "user501" },
+ { ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_LIST_DIRECTORY,
+ ARCHIVE_ENTRY_ACL_GROUP, 502, "group502" },
+#if !ARCHIVE_ACL_DARWIN
+ { ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_LIST_DIRECTORY,
+ ARCHIVE_ENTRY_ACL_GROUP_OBJ, -1, "" },
+ { ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_LIST_DIRECTORY,
+ ARCHIVE_ENTRY_ACL_EVERYONE, -1, "" }
+#else /* MacOS - mode 0654 */
+ { ARCHIVE_ENTRY_ACL_TYPE_DENY, ARCHIVE_ENTRY_ACL_EXECUTE,
+ ARCHIVE_ENTRY_ACL_USER_OBJ, -1, "" },
+ { ARCHIVE_ENTRY_ACL_TYPE_ALLOW,
+ ARCHIVE_ENTRY_ACL_READ_DATA |
+ ARCHIVE_ENTRY_ACL_WRITE_DATA |
+ ARCHIVE_ENTRY_ACL_APPEND_DATA |
+ ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES |
+ ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES |
+ ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS |
+ ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS |
+ ARCHIVE_ENTRY_ACL_READ_ACL |
+ ARCHIVE_ENTRY_ACL_WRITE_ACL |
+ ARCHIVE_ENTRY_ACL_WRITE_OWNER |
+ ARCHIVE_ENTRY_ACL_SYNCHRONIZE,
+ ARCHIVE_ENTRY_ACL_USER_OBJ, -1, "" },
+ { ARCHIVE_ENTRY_ACL_TYPE_ALLOW,
+ ARCHIVE_ENTRY_ACL_READ_DATA |
+ ARCHIVE_ENTRY_ACL_EXECUTE |
+ ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES |
+ ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS |
+ ARCHIVE_ENTRY_ACL_READ_ACL |
+ ARCHIVE_ENTRY_ACL_SYNCHRONIZE,
+ ARCHIVE_ENTRY_ACL_GROUP_OBJ, -1, "" },
+ { ARCHIVE_ENTRY_ACL_TYPE_ALLOW,
+ ARCHIVE_ENTRY_ACL_READ_DATA |
+ ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES |
+ ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS |
+ ARCHIVE_ENTRY_ACL_READ_ACL |
+ ARCHIVE_ENTRY_ACL_SYNCHRONIZE,
+ ARCHIVE_ENTRY_ACL_EVERYONE, -1, "" }
+#endif
+};
+
+static const int acls_dir_cnt = (int)(sizeof(acls_dir)/sizeof(acls_dir[0]));
+
+static void
+set_acls(struct archive_entry *ae, struct myacl_t *acls, int start, int end)
+{
+ int i;
+
+ archive_entry_acl_clear(ae);
+#if !ARCHIVE_ACL_DARWIN
+ if (start > 0) {
+ assertEqualInt(ARCHIVE_OK,
+ archive_entry_acl_add_entry(ae,
+ acls[0].type, acls[0].permset, acls[0].tag,
+ acls[0].qual, acls[0].name));
+ }
+#endif
+ for (i = start; i < end; i++) {
+ assertEqualInt(ARCHIVE_OK,
+ archive_entry_acl_add_entry(ae,
+ acls[i].type, acls[i].permset, acls[i].tag,
+ acls[i].qual, acls[i].name));
+ }
+}
+
+static int
+#if ARCHIVE_ACL_SUNOS_NFS4
+acl_permset_to_bitmap(uint32_t mask)
+#elif ARCHIVE_ACL_LIBRICHACL
+acl_permset_to_bitmap(unsigned int mask)
+#else
+acl_permset_to_bitmap(acl_permset_t opaque_ps)
+#endif
+{
+ static struct { int portable; int machine; } perms[] = {
+#ifdef ARCHIVE_ACL_SUNOS_NFS4 /* Solaris NFSv4 ACL permissions */
+ {ARCHIVE_ENTRY_ACL_EXECUTE, ACE_EXECUTE},
+ {ARCHIVE_ENTRY_ACL_READ_DATA, ACE_READ_DATA},
+ {ARCHIVE_ENTRY_ACL_LIST_DIRECTORY, ACE_LIST_DIRECTORY},
+ {ARCHIVE_ENTRY_ACL_WRITE_DATA, ACE_WRITE_DATA},
+ {ARCHIVE_ENTRY_ACL_ADD_FILE, ACE_ADD_FILE},
+ {ARCHIVE_ENTRY_ACL_APPEND_DATA, ACE_APPEND_DATA},
+ {ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY, ACE_ADD_SUBDIRECTORY},
+ {ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS, ACE_READ_NAMED_ATTRS},
+ {ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS, ACE_WRITE_NAMED_ATTRS},
+ {ARCHIVE_ENTRY_ACL_DELETE_CHILD, ACE_DELETE_CHILD},
+ {ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES, ACE_READ_ATTRIBUTES},
+ {ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES, ACE_WRITE_ATTRIBUTES},
+ {ARCHIVE_ENTRY_ACL_DELETE, ACE_DELETE},
+ {ARCHIVE_ENTRY_ACL_READ_ACL, ACE_READ_ACL},
+ {ARCHIVE_ENTRY_ACL_WRITE_ACL, ACE_WRITE_ACL},
+ {ARCHIVE_ENTRY_ACL_WRITE_OWNER, ACE_WRITE_OWNER},
+ {ARCHIVE_ENTRY_ACL_SYNCHRONIZE, ACE_SYNCHRONIZE}
+#elif ARCHIVE_ACL_DARWIN /* MacOS NFSv4 ACL permissions */
+ {ARCHIVE_ENTRY_ACL_READ_DATA, ACL_READ_DATA},
+ {ARCHIVE_ENTRY_ACL_LIST_DIRECTORY, ACL_LIST_DIRECTORY},
+ {ARCHIVE_ENTRY_ACL_WRITE_DATA, ACL_WRITE_DATA},
+ {ARCHIVE_ENTRY_ACL_ADD_FILE, ACL_ADD_FILE},
+ {ARCHIVE_ENTRY_ACL_EXECUTE, ACL_EXECUTE},
+ {ARCHIVE_ENTRY_ACL_DELETE, ACL_DELETE},
+ {ARCHIVE_ENTRY_ACL_APPEND_DATA, ACL_APPEND_DATA},
+ {ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY, ACL_ADD_SUBDIRECTORY},
+ {ARCHIVE_ENTRY_ACL_DELETE_CHILD, ACL_DELETE_CHILD},
+ {ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES, ACL_READ_ATTRIBUTES},
+ {ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES, ACL_WRITE_ATTRIBUTES},
+ {ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS, ACL_READ_EXTATTRIBUTES},
+ {ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS, ACL_WRITE_EXTATTRIBUTES},
+ {ARCHIVE_ENTRY_ACL_READ_ACL, ACL_READ_SECURITY},
+ {ARCHIVE_ENTRY_ACL_WRITE_ACL, ACL_WRITE_SECURITY},
+ {ARCHIVE_ENTRY_ACL_WRITE_OWNER, ACL_CHANGE_OWNER},
+#if HAVE_DECL_ACL_SYNCHRONIZE
+ {ARCHIVE_ENTRY_ACL_SYNCHRONIZE, ACL_SYNCHRONIZE}
+#endif
+#elif ARCHIVE_ACL_LIBRICHACL
+ {ARCHIVE_ENTRY_ACL_EXECUTE, RICHACE_EXECUTE},
+ {ARCHIVE_ENTRY_ACL_READ_DATA, RICHACE_READ_DATA},
+ {ARCHIVE_ENTRY_ACL_LIST_DIRECTORY, RICHACE_LIST_DIRECTORY},
+ {ARCHIVE_ENTRY_ACL_WRITE_DATA, RICHACE_WRITE_DATA},
+ {ARCHIVE_ENTRY_ACL_ADD_FILE, RICHACE_ADD_FILE},
+ {ARCHIVE_ENTRY_ACL_APPEND_DATA, RICHACE_APPEND_DATA},
+ {ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY, RICHACE_ADD_SUBDIRECTORY},
+ {ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS, RICHACE_READ_NAMED_ATTRS},
+ {ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS, RICHACE_WRITE_NAMED_ATTRS},
+ {ARCHIVE_ENTRY_ACL_DELETE_CHILD, RICHACE_DELETE_CHILD},
+ {ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES, RICHACE_READ_ATTRIBUTES},
+ {ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES, RICHACE_WRITE_ATTRIBUTES},
+ {ARCHIVE_ENTRY_ACL_DELETE, RICHACE_DELETE},
+ {ARCHIVE_ENTRY_ACL_READ_ACL, RICHACE_READ_ACL},
+ {ARCHIVE_ENTRY_ACL_WRITE_ACL, RICHACE_WRITE_ACL},
+ {ARCHIVE_ENTRY_ACL_WRITE_OWNER, RICHACE_WRITE_OWNER},
+ {ARCHIVE_ENTRY_ACL_SYNCHRONIZE, RICHACE_SYNCHRONIZE}
+#else /* FreeBSD NFSv4 ACL permissions */
+ {ARCHIVE_ENTRY_ACL_EXECUTE, ACL_EXECUTE},
+ {ARCHIVE_ENTRY_ACL_READ_DATA, ACL_READ_DATA},
+ {ARCHIVE_ENTRY_ACL_LIST_DIRECTORY, ACL_LIST_DIRECTORY},
+ {ARCHIVE_ENTRY_ACL_WRITE_DATA, ACL_WRITE_DATA},
+ {ARCHIVE_ENTRY_ACL_ADD_FILE, ACL_ADD_FILE},
+ {ARCHIVE_ENTRY_ACL_APPEND_DATA, ACL_APPEND_DATA},
+ {ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY, ACL_ADD_SUBDIRECTORY},
+ {ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS, ACL_READ_NAMED_ATTRS},
+ {ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS, ACL_WRITE_NAMED_ATTRS},
+ {ARCHIVE_ENTRY_ACL_DELETE_CHILD, ACL_DELETE_CHILD},
+ {ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES, ACL_READ_ATTRIBUTES},
+ {ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES, ACL_WRITE_ATTRIBUTES},
+ {ARCHIVE_ENTRY_ACL_DELETE, ACL_DELETE},
+ {ARCHIVE_ENTRY_ACL_READ_ACL, ACL_READ_ACL},
+ {ARCHIVE_ENTRY_ACL_WRITE_ACL, ACL_WRITE_ACL},
+ {ARCHIVE_ENTRY_ACL_WRITE_OWNER, ACL_WRITE_OWNER},
+ {ARCHIVE_ENTRY_ACL_SYNCHRONIZE, ACL_SYNCHRONIZE}
+#endif
+ };
+ int i, permset = 0;
+
+ for (i = 0; i < (int)(sizeof(perms)/sizeof(perms[0])); ++i)
+#if ARCHIVE_ACL_SUNOS_NFS4 || ARCHIVE_ACL_LIBRICHACL
+ if (mask & perms[i].machine)
+#else
+ if (acl_get_perm_np(opaque_ps, perms[i].machine))
+#endif
+ permset |= perms[i].portable;
+ return permset;
+}
+
+static int
+#if ARCHIVE_ACL_SUNOS_NFS4
+acl_flagset_to_bitmap(uint16_t flags)
+#elif ARCHIVE_ACL_LIBRICHACL
+acl_flagset_to_bitmap(int flags)
+#else
+acl_flagset_to_bitmap(acl_flagset_t opaque_fs)
+#endif
+{
+ static struct { int portable; int machine; } perms[] = {
+#if ARCHIVE_ACL_SUNOS_NFS4 /* Solaris NFSv4 ACL inheritance flags */
+ {ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT, ACE_FILE_INHERIT_ACE},
+ {ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT, ACE_DIRECTORY_INHERIT_ACE},
+ {ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT, ACE_NO_PROPAGATE_INHERIT_ACE},
+ {ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY, ACE_INHERIT_ONLY_ACE},
+ {ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS, ACE_SUCCESSFUL_ACCESS_ACE_FLAG},
+ {ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS, ACE_FAILED_ACCESS_ACE_FLAG},
+#ifdef ACE_INHERITED_ACE
+ {ARCHIVE_ENTRY_ACL_ENTRY_INHERITED, ACE_INHERITED_ACE}
+#endif
+#elif ARCHIVE_ACL_DARWIN /* MacOS NFSv4 ACL inheritance flags */
+ {ARCHIVE_ENTRY_ACL_ENTRY_INHERITED, ACL_ENTRY_INHERITED},
+ {ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT, ACL_ENTRY_FILE_INHERIT},
+ {ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT, ACL_ENTRY_DIRECTORY_INHERIT},
+ {ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT, ACL_ENTRY_LIMIT_INHERIT},
+ {ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY, ACL_ENTRY_ONLY_INHERIT}
+#elif ARCHIVE_ACL_LIBRICHACL
+ {ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT, RICHACE_FILE_INHERIT_ACE},
+ {ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT, RICHACE_DIRECTORY_INHERIT_ACE},
+ {ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT, RICHACE_NO_PROPAGATE_INHERIT_ACE},
+ {ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY, RICHACE_INHERIT_ONLY_ACE},
+ {ARCHIVE_ENTRY_ACL_ENTRY_INHERITED, RICHACE_INHERITED_ACE}
+#else /* FreeBSD NFSv4 ACL inheritance flags */
+ {ARCHIVE_ENTRY_ACL_ENTRY_INHERITED, ACL_ENTRY_INHERITED},
+ {ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT, ACL_ENTRY_FILE_INHERIT},
+ {ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT, ACL_ENTRY_DIRECTORY_INHERIT},
+ {ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT, ACL_ENTRY_NO_PROPAGATE_INHERIT},
+ {ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS, ACL_ENTRY_SUCCESSFUL_ACCESS},
+ {ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS, ACL_ENTRY_FAILED_ACCESS},
+ {ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY, ACL_ENTRY_INHERIT_ONLY}
+#endif
+ };
+ int i, flagset = 0;
+
+ for (i = 0; i < (int)(sizeof(perms)/sizeof(perms[0])); ++i)
+#if ARCHIVE_ACL_SUNOS_NFS4 || ARCHIVE_ACL_LIBRICHACL
+ if (flags & perms[i].machine)
+#else
+ if (acl_get_flag_np(opaque_fs, perms[i].machine))
+#endif
+ flagset |= perms[i].portable;
+ return flagset;
+}
+
+#if ARCHIVE_ACL_SUNOS_NFS4
+static int
+acl_match(ace_t *ace, struct myacl_t *myacl)
+{
+ int perms;
+
+ perms = acl_permset_to_bitmap(ace->a_access_mask) | acl_flagset_to_bitmap(ace->a_flags);
+
+ if (perms != myacl->permset)
+ return (0);
+
+ switch (ace->a_type) {
+ case ACE_ACCESS_ALLOWED_ACE_TYPE:
+ if (myacl->type != ARCHIVE_ENTRY_ACL_TYPE_ALLOW)
+ return (0);
+ break;
+ case ACE_ACCESS_DENIED_ACE_TYPE:
+ if (myacl->type != ARCHIVE_ENTRY_ACL_TYPE_DENY)
+ return (0);
+ break;
+ case ACE_SYSTEM_AUDIT_ACE_TYPE:
+ if (myacl->type != ARCHIVE_ENTRY_ACL_TYPE_AUDIT)
+ return (0);
+ break;
+ case ACE_SYSTEM_ALARM_ACE_TYPE:
+ if (myacl->type != ARCHIVE_ENTRY_ACL_TYPE_ALARM)
+ return (0);
+ break;
+ default:
+ return (0);
+ }
+
+ if (ace->a_flags & ACE_OWNER) {
+ if (myacl->tag != ARCHIVE_ENTRY_ACL_USER_OBJ)
+ return (0);
+ } else if (ace->a_flags & ACE_GROUP) {
+ if (myacl->tag != ARCHIVE_ENTRY_ACL_GROUP_OBJ)
+ return (0);
+ } else if (ace->a_flags & ACE_EVERYONE) {
+ if (myacl->tag != ARCHIVE_ENTRY_ACL_EVERYONE)
+ return (0);
+ } else if (ace->a_flags & ACE_IDENTIFIER_GROUP) {
+ if (myacl->tag != ARCHIVE_ENTRY_ACL_GROUP)
+ return (0);
+ if ((gid_t)myacl->qual != ace->a_who)
+ return (0);
+ } else {
+ if (myacl->tag != ARCHIVE_ENTRY_ACL_USER)
+ return (0);
+ if ((uid_t)myacl->qual != ace->a_who)
+ return (0);
+ }
+ return (1);
+}
+#elif ARCHIVE_ACL_LIBRICHACL
+static int
+acl_match(struct richace *richace, struct myacl_t *myacl)
+{
+ int perms;
+
+ perms = acl_permset_to_bitmap(richace->e_mask) |
+ acl_flagset_to_bitmap(richace->e_flags);
+
+ if (perms != myacl->permset)
+ return (0);
+
+ switch (richace->e_type) {
+ case RICHACE_ACCESS_ALLOWED_ACE_TYPE:
+ if (myacl->type != ARCHIVE_ENTRY_ACL_TYPE_ALLOW)
+ return (0);
+ break;
+ case RICHACE_ACCESS_DENIED_ACE_TYPE:
+ if (myacl->type != ARCHIVE_ENTRY_ACL_TYPE_DENY)
+ return (0);
+ break;
+ default:
+ return (0);
+ }
+
+ if (richace->e_flags & RICHACE_SPECIAL_WHO) {
+ switch (richace->e_id) {
+ case RICHACE_OWNER_SPECIAL_ID:
+ if (myacl->tag != ARCHIVE_ENTRY_ACL_USER_OBJ)
+ return (0);
+ break;
+ case RICHACE_GROUP_SPECIAL_ID:
+ if (myacl->tag != ARCHIVE_ENTRY_ACL_GROUP_OBJ)
+ return (0);
+ break;
+ case RICHACE_EVERYONE_SPECIAL_ID:
+ if (myacl->tag != ARCHIVE_ENTRY_ACL_EVERYONE)
+ return (0);
+ break;
+ default:
+ /* Invalid e_id */
+ return (0);
+ }
+ } else if (richace->e_flags & RICHACE_IDENTIFIER_GROUP) {
+ if (myacl->tag != ARCHIVE_ENTRY_ACL_GROUP)
+ return (0);
+ if ((gid_t)myacl->qual != richace->e_id)
+ return (0);
+ } else {
+ if (myacl->tag != ARCHIVE_ENTRY_ACL_USER)
+ return (0);
+ if ((uid_t)myacl->qual != richace->e_id)
+ return (0);
+ }
+ return (1);
+}
+#elif ARCHIVE_ACL_DARWIN
+static int
+acl_match(acl_entry_t aclent, struct myacl_t *myacl)
+{
+ void *q;
+ uid_t ugid;
+ int r, idtype;
+ acl_tag_t tag_type;
+ acl_permset_t opaque_ps;
+ acl_flagset_t opaque_fs;
+ int perms;
+
+ acl_get_tag_type(aclent, &tag_type);
+
+ /* translate the silly opaque permset to a bitmap */
+ acl_get_permset(aclent, &opaque_ps);
+ acl_get_flagset_np(aclent, &opaque_fs);
+ perms = acl_permset_to_bitmap(opaque_ps) | acl_flagset_to_bitmap(opaque_fs);
+ if (perms != myacl->permset)
+ return (0);
+
+ r = 0;
+ switch (tag_type) {
+ case ACL_EXTENDED_ALLOW:
+ if (myacl->type != ARCHIVE_ENTRY_ACL_TYPE_ALLOW)
+ return (0);
+ break;
+ case ACL_EXTENDED_DENY:
+ if (myacl->type != ARCHIVE_ENTRY_ACL_TYPE_DENY)
+ return (0);
+ break;
+ default:
+ return (0);
+ }
+ q = acl_get_qualifier(aclent);
+ if (q == NULL)
+ return (0);
+ r = mbr_uuid_to_id((const unsigned char *)q, &ugid, &idtype);
+ acl_free(q);
+ if (r != 0)
+ return (0);
+ switch (idtype) {
+ case ID_TYPE_UID:
+ if (myacl->tag != ARCHIVE_ENTRY_ACL_USER)
+ return (0);
+ if ((uid_t)myacl->qual != ugid)
+ return (0);
+ break;
+ case ID_TYPE_GID:
+ if (myacl->tag != ARCHIVE_ENTRY_ACL_GROUP)
+ return (0);
+ if ((gid_t)myacl->qual != ugid)
+ return (0);
+ break;
+ default:
+ return (0);
+ }
+ return (1);
+}
+#else /* ARCHIVE_ACL_FREEBSD_NFS4 */
+static int
+acl_match(acl_entry_t aclent, struct myacl_t *myacl)
+{
+ gid_t g, *gp;
+ uid_t u, *up;
+ acl_entry_type_t entry_type;
+ acl_tag_t tag_type;
+ acl_permset_t opaque_ps;
+ acl_flagset_t opaque_fs;
+ int perms;
+
+ acl_get_tag_type(aclent, &tag_type);
+ acl_get_entry_type_np(aclent, &entry_type);
+
+ /* translate the silly opaque permset to a bitmap */
+ acl_get_permset(aclent, &opaque_ps);
+ acl_get_flagset_np(aclent, &opaque_fs);
+ perms = acl_permset_to_bitmap(opaque_ps) | acl_flagset_to_bitmap(opaque_fs);
+ if (perms != myacl->permset)
+ return (0);
+
+ switch (entry_type) {
+ case ACL_ENTRY_TYPE_ALLOW:
+ if (myacl->type != ARCHIVE_ENTRY_ACL_TYPE_ALLOW)
+ return (0);
+ break;
+ case ACL_ENTRY_TYPE_DENY:
+ if (myacl->type != ARCHIVE_ENTRY_ACL_TYPE_DENY)
+ return (0);
+ break;
+ case ACL_ENTRY_TYPE_AUDIT:
+ if (myacl->type != ARCHIVE_ENTRY_ACL_TYPE_AUDIT)
+ return (0);
+ case ACL_ENTRY_TYPE_ALARM:
+ if (myacl->type != ARCHIVE_ENTRY_ACL_TYPE_ALARM)
+ return (0);
+ default:
+ return (0);
+ }
+
+ switch (tag_type) {
+ case ACL_USER_OBJ:
+ if (myacl->tag != ARCHIVE_ENTRY_ACL_USER_OBJ) return (0);
+ break;
+ case ACL_USER:
+ if (myacl->tag != ARCHIVE_ENTRY_ACL_USER)
+ return (0);
+ up = acl_get_qualifier(aclent);
+ u = *up;
+ acl_free(up);
+ if ((uid_t)myacl->qual != u)
+ return (0);
+ break;
+ case ACL_GROUP_OBJ:
+ if (myacl->tag != ARCHIVE_ENTRY_ACL_GROUP_OBJ) return (0);
+ break;
+ case ACL_GROUP:
+ if (myacl->tag != ARCHIVE_ENTRY_ACL_GROUP)
+ return (0);
+ gp = acl_get_qualifier(aclent);
+ g = *gp;
+ acl_free(gp);
+ if ((gid_t)myacl->qual != g)
+ return (0);
+ break;
+ case ACL_MASK:
+ if (myacl->tag != ARCHIVE_ENTRY_ACL_MASK) return (0);
+ break;
+ case ACL_EVERYONE:
+ if (myacl->tag != ARCHIVE_ENTRY_ACL_EVERYONE) return (0);
+ break;
+ }
+ return (1);
+}
+#endif /* various ARCHIVE_ACL_NFS4 implementations */
+
+static void
+compare_acls(
+#if ARCHIVE_ACL_SUNOS_NFS4
+ void *aclp,
+ int aclcnt,
+#elif ARCHIVE_ACL_LIBRICHACL
+ struct richacl *richacl,
+#else
+ acl_t acl,
+#endif
+ struct myacl_t *myacls, const char *filename, int start, int end)
+{
+ int *marker;
+ int matched;
+ int i, n;
+#if ARCHIVE_ACL_SUNOS_NFS4
+ int e;
+ ace_t *acl_entry;
+#elif ARCHIVE_ACL_LIBRICHACL
+ int e;
+ struct richace *acl_entry;
+ int aclcnt;
+#else
+ int entry_id = ACL_FIRST_ENTRY;
+ acl_entry_t acl_entry;
+#if ARCHIVE_ACL_DARWIN
+ const int acl_get_entry_ret = 0;
+#else
+ const int acl_get_entry_ret = 1;
+#endif
+#endif
+
+#if ARCHIVE_ACL_SUNOS_NFS4
+ if (aclp == NULL)
+ return;
+#elif ARCHIVE_ACL_LIBRICHACL
+ if (richacl == NULL)
+ return;
+ aclcnt = richacl->a_count;
+#else
+ if (acl == NULL)
+ return;
+#endif
+
+ n = end - start;
+ marker = malloc(sizeof(marker[0]) * (n + 1));
+ for (i = 0; i < n; i++)
+ marker[i] = i + start;
+#if !ARCHIVE_ACL_DARWIN
+ /* Always include the first ACE. */
+ if (start > 0) {
+ marker[n] = 0;
+ ++n;
+ }
+#endif
+
+ /*
+ * Iterate over acls in system acl object, try to match each
+ * one with an item in the myacls array.
+ */
+#if ARCHIVE_ACL_SUNOS_NFS4 || ARCHIVE_ACL_LIBRICHACL
+ for (e = 0; e < aclcnt; e++)
+#else
+ while (acl_get_entry_ret == acl_get_entry(acl, entry_id, &acl_entry))
+#endif
+ {
+#if ARCHIVE_ACL_SUNOS_NFS4
+ acl_entry = &((ace_t *)aclp)[e];
+#elif ARCHIVE_ACL_LIBRICHACL
+ acl_entry = &(richacl->a_entries[e]);
+#else
+ /* After the first time... */
+ entry_id = ACL_NEXT_ENTRY;
+#endif
+ /* Search for a matching entry (tag and qualifier) */
+ for (i = 0, matched = 0; i < n && !matched; i++) {
+ if (acl_match(acl_entry, &myacls[marker[i]])) {
+ /* We found a match; remove it. */
+ marker[i] = marker[n - 1];
+ n--;
+ matched = 1;
+ }
+ }
+
+ failure("ACL entry on file %s that shouldn't be there",
+ filename);
+ assert(matched == 1);
+ }
+
+ /* Dump entries in the myacls array that weren't in the system acl. */
+ for (i = 0; i < n; ++i) {
+ failure(" ACL entry %d missing from %s: "
+ "type=%#010x,permset=%#010x,tag=%d,qual=%d,name=``%s''\n",
+ marker[i], filename,
+ myacls[marker[i]].type, myacls[marker[i]].permset,
+ myacls[marker[i]].tag, myacls[marker[i]].qual,
+ myacls[marker[i]].name);
+ assert(0); /* Record this as a failure. */
+ }
+ free(marker);
+}
+
+static void
+compare_entry_acls(struct archive_entry *ae, struct myacl_t *myacls, const char *filename, int start, int end)
+{
+ int *marker;
+ int matched;
+ int i, n;
+ int type, permset, tag, qual;
+ const char *name;
+
+ /* Count ACL entries in myacls array and allocate an indirect array. */
+ n = end - start;
+ marker = malloc(sizeof(marker[0]) * (n + 1));
+ for (i = 0; i < n; i++)
+ marker[i] = i + start;
+ /* Always include the first ACE. */
+ if (start > 0) {
+ marker[n] = 0;
+ ++n;
+ }
+
+ /*
+ * Iterate over acls in entry, try to match each
+ * one with an item in the myacls array.
+ */
+ assertEqualInt(n, archive_entry_acl_reset(ae,
+ ARCHIVE_ENTRY_ACL_TYPE_NFS4));
+ while (ARCHIVE_OK == archive_entry_acl_next(ae,
+ ARCHIVE_ENTRY_ACL_TYPE_NFS4, &type, &permset, &tag, &qual, &name)) {
+
+ /* Search for a matching entry (tag and qualifier) */
+ for (i = 0, matched = 0; i < n && !matched; i++) {
+ if (tag == myacls[marker[i]].tag
+ && qual == myacls[marker[i]].qual
+ && permset == myacls[marker[i]].permset
+ && type == myacls[marker[i]].type) {
+ /* We found a match; remove it. */
+ marker[i] = marker[n - 1];
+ n--;
+ matched = 1;
+ }
+ }
+
+ failure("ACL entry on file that shouldn't be there: "
+ "type=%#010x,permset=%#010x,tag=%d,qual=%d",
+ type,permset,tag,qual);
+ assert(matched == 1);
+ }
+
+ /* Dump entries in the myacls array that weren't in the system acl. */
+ for (i = 0; i < n; ++i) {
+ failure(" ACL entry %d missing from %s: "
+ "type=%#010x,permset=%#010x,tag=%d,qual=%d,name=``%s''\n",
+ marker[i], filename,
+ myacls[marker[i]].type, myacls[marker[i]].permset,
+ myacls[marker[i]].tag, myacls[marker[i]].qual,
+ myacls[marker[i]].name);
+ assert(0); /* Record this as a failure. */
+ }
+ free(marker);
+}
+#endif /* ARCHIVE_ACL_NFS4 */
+
+/*
+ * Verify ACL restore-to-disk. This test is Platform-specific.
+ */
+
+DEFINE_TEST(test_acl_platform_nfs4)
+{
+#if !ARCHIVE_ACL_NFS4
+ skipping("NFS4 ACLs are not supported on this platform");
+#else /* ARCHIVE_ACL_NFS4 */
+ char buff[64];
+ int i;
+ struct stat st;
+ struct archive *a;
+ struct archive_entry *ae;
+#if ARCHIVE_ACL_DARWIN /* On MacOS we skip trivial ACLs in some tests */
+ const int regcnt = acls_reg_cnt - 4;
+ const int dircnt = acls_dir_cnt - 4;
+#else
+ const int regcnt = acls_reg_cnt;
+ const int dircnt = acls_dir_cnt;
+#endif
+#if ARCHIVE_ACL_SUNOS_NFS4
+ void *aclp;
+ int aclcnt;
+#elif ARCHIVE_ACL_LIBRICHACL
+ struct richacl *richacl;
+#else /* !ARCHIVE_ACL_SUNOS_NFS4 */
+ acl_t acl;
+#endif
+
+ assertMakeFile("pretest", 0644, "a");
+
+ if (setTestAcl("pretest") != ARCHIVE_TEST_ACL_TYPE_NFS4) {
+ skipping("NFS4 ACLs are not writable on this filesystem");
+ return;
+ }
+
+ /* Create a write-to-disk object. */
+ assert(NULL != (a = archive_write_disk_new()));
+ archive_write_disk_set_options(a,
+ ARCHIVE_EXTRACT_TIME | ARCHIVE_EXTRACT_PERM | ARCHIVE_EXTRACT_ACL);
+
+ /* Populate an archive entry with some metadata, including ACL info */
+ ae = archive_entry_new();
+ assert(ae != NULL);
+ archive_entry_set_pathname(ae, "testall");
+ archive_entry_set_filetype(ae, AE_IFREG);
+ archive_entry_set_perm(ae, 0654);
+ archive_entry_set_mtime(ae, 123456, 7890);
+ archive_entry_set_size(ae, 0);
+ set_acls(ae, acls_reg, 0, acls_reg_cnt);
+
+ /* Write the entry to disk, including ACLs. */
+ assertEqualIntA(a, ARCHIVE_OK, archive_write_header(a, ae));
+
+ /* Likewise for a dir. */
+ archive_entry_set_pathname(ae, "dirall");
+ archive_entry_set_filetype(ae, AE_IFDIR);
+ archive_entry_set_perm(ae, 0654);
+ archive_entry_set_mtime(ae, 123456, 7890);
+ set_acls(ae, acls_dir, 0, acls_dir_cnt);
+ assertEqualIntA(a, ARCHIVE_OK, archive_write_header(a, ae));
+
+ for (i = 0; i < acls_dir_cnt; ++i) {
+ sprintf(buff, "dir%d", i);
+ archive_entry_set_pathname(ae, buff);
+ archive_entry_set_filetype(ae, AE_IFDIR);
+ archive_entry_set_perm(ae, 0654);
+ archive_entry_set_mtime(ae, 123456 + i, 7891 + i);
+ set_acls(ae, acls_dir, i, i + 1);
+ assertEqualIntA(a, ARCHIVE_OK, archive_write_header(a, ae));
+ }
+
+ archive_entry_free(ae);
+
+ /* Close the archive. */
+ assertEqualIntA(a, ARCHIVE_OK, archive_write_close(a));
+ assertEqualInt(ARCHIVE_OK, archive_write_free(a));
+
+ /* Verify the data on disk. */
+ assertEqualInt(0, stat("testall", &st));
+ assertEqualInt(st.st_mtime, 123456);
+#if ARCHIVE_ACL_SUNOS_NFS4
+ aclp = sunacl_get(ACE_GETACL, &aclcnt, 0, "testall");
+ failure("acl(\"%s\"): errno = %d (%s)", "testall", errno,
+ strerror(errno));
+ assert(aclp != NULL);
+#elif ARCHIVE_ACL_LIBRICHACL
+ richacl = richacl_get_file("testall");
+ failure("richacl_get_file(\"%s\"): errno = %d (%s)", "testall", errno,
+ strerror(errno));
+ assert(richacl != NULL);
+#else
+#if ARCHIVE_ACL_DARWIN
+ acl = acl_get_file("testall", ACL_TYPE_EXTENDED);
+#else
+ acl = acl_get_file("testall", ACL_TYPE_NFS4);
+#endif
+ failure("acl_get_file(\"%s\"): errno = %d (%s)", "testall", errno,
+ strerror(errno));
+ assert(acl != (acl_t)NULL);
+#endif
+#if ARCHIVE_ACL_SUNOS_NFS4
+ compare_acls(aclp, aclcnt, acls_reg, "testall", 0, regcnt);
+ free(aclp);
+ aclp = NULL;
+#elif ARCHIVE_ACL_LIBRICHACL
+ compare_acls(richacl, acls_reg, "testall", 0, regcnt);
+ richacl_free(richacl);
+#else
+ compare_acls(acl, acls_reg, "testall", 0, regcnt);
+ acl_free(acl);
+#endif
+
+
+ /* Verify single-permission dirs on disk. */
+ for (i = 0; i < dircnt; ++i) {
+ sprintf(buff, "dir%d", i);
+ assertEqualInt(0, stat(buff, &st));
+ assertEqualInt(st.st_mtime, 123456 + i);
+#if ARCHIVE_ACL_SUNOS_NFS4
+ aclp = sunacl_get(ACE_GETACL, &aclcnt, 0, buff);
+ failure("acl(\"%s\"): errno = %d (%s)", buff, errno,
+ strerror(errno));
+ assert(aclp != NULL);
+#elif ARCHIVE_ACL_LIBRICHACL
+ richacl = richacl_get_file(buff);
+ /* First and last two dir do not return a richacl */
+ if ((i == 0 || i >= dircnt - 2) && richacl == NULL &&
+ errno == ENODATA)
+ continue;
+ failure("richacl_get_file(\"%s\"): errno = %d (%s)", buff,
+ errno, strerror(errno));
+ assert(richacl != NULL);
+#else
+#if ARCHIVE_ACL_DARWIN
+ acl = acl_get_file(buff, ACL_TYPE_EXTENDED);
+#else
+ acl = acl_get_file(buff, ACL_TYPE_NFS4);
+#endif
+ failure("acl_get_file(\"%s\"): errno = %d (%s)", buff, errno,
+ strerror(errno));
+ assert(acl != (acl_t)NULL);
+#endif
+#if ARCHIVE_ACL_SUNOS_NFS4
+ compare_acls(aclp, aclcnt, acls_dir, buff, i, i + 1);
+ free(aclp);
+ aclp = NULL;
+#elif ARCHIVE_ACL_LIBRICHACL
+ compare_acls(richacl, acls_dir, buff, i, i + 1);
+ richacl_free(richacl);
+#else
+ compare_acls(acl, acls_dir, buff, i, i + 1);
+ acl_free(acl);
+#endif
+ }
+
+ /* Verify "dirall" on disk. */
+ assertEqualInt(0, stat("dirall", &st));
+ assertEqualInt(st.st_mtime, 123456);
+#if ARCHIVE_ACL_SUNOS_NFS4
+ aclp = sunacl_get(ACE_GETACL, &aclcnt, 0, "dirall");
+ failure("acl(\"%s\"): errno = %d (%s)", "dirall", errno,
+ strerror(errno));
+ assert(aclp != NULL);
+#elif ARCHIVE_ACL_LIBRICHACL
+ richacl = richacl_get_file("dirall");
+ failure("richacl_get_file(\"%s\"): errno = %d (%s)", "dirall",
+ errno, strerror(errno));
+ assert(richacl != NULL);
+#else
+#if ARCHIVE_ACL_DARWIN
+ acl = acl_get_file("dirall", ACL_TYPE_EXTENDED);
+#else
+ acl = acl_get_file("dirall", ACL_TYPE_NFS4);
+#endif
+ failure("acl_get_file(\"%s\"): errno = %d (%s)", "dirall", errno,
+ strerror(errno));
+ assert(acl != (acl_t)NULL);
+#endif
+#if ARCHIVE_ACL_SUNOS_NFS4
+ compare_acls(aclp, aclcnt, acls_dir, "dirall", 0, dircnt);
+ free(aclp);
+ aclp = NULL;
+#elif ARCHIVE_ACL_LIBRICHACL
+ compare_acls(richacl, acls_dir, "dirall", 0, dircnt);
+ richacl_free(richacl);
+#else
+ compare_acls(acl, acls_dir, "dirall", 0, dircnt);
+ acl_free(acl);
+#endif
+
+ /* Read and compare ACL via archive_read_disk */
+ a = archive_read_disk_new();
+ assert(a != NULL);
+ ae = archive_entry_new();
+ assert(ae != NULL);
+ archive_entry_set_pathname(ae, "testall");
+ assertEqualInt(ARCHIVE_OK,
+ archive_read_disk_entry_from_file(a, ae, -1, NULL));
+ compare_entry_acls(ae, acls_reg, "testall", 0, acls_reg_cnt);
+ archive_entry_free(ae);
+ assertEqualInt(ARCHIVE_OK, archive_read_free(a));
+
+ /* Read and compare ACL via archive_read_disk */
+ a = archive_read_disk_new();
+ assert(a != NULL);
+ ae = archive_entry_new();
+ assert(ae != NULL);
+ archive_entry_set_pathname(ae, "dirall");
+ assertEqualInt(ARCHIVE_OK,
+ archive_read_disk_entry_from_file(a, ae, -1, NULL));
+ compare_entry_acls(ae, acls_dir, "dirall", 0, acls_dir_cnt);
+ archive_entry_free(ae);
+ assertEqualInt(ARCHIVE_OK, archive_read_free(a));
+#endif /* ARCHIVE_ACL_NFS4 */
+}
Copied: trunk/contrib/libarchive/libarchive/test/test_acl_platform_posix1e.c (from rev 11133, vendor/libarchive/dist/libarchive/test/test_acl_platform_posix1e.c)
===================================================================
--- trunk/contrib/libarchive/libarchive/test/test_acl_platform_posix1e.c (rev 0)
+++ trunk/contrib/libarchive/libarchive/test/test_acl_platform_posix1e.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -0,0 +1,606 @@
+/*-
+ * Copyright (c) 2003-2008 Tim Kientzle
+ * Copyright (c) 2017 Martin Matuska
+ * 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 "test.h"
+__FBSDID("$FreeBSD: head/lib/libarchive/test/test_acl_freebsd.c 189427 2009-03-06 04:21:23Z kientzle $");
+
+#if ARCHIVE_ACL_POSIX1E
+#include <sys/acl.h>
+#if HAVE_ACL_GET_PERM
+#include <acl/libacl.h>
+#define ACL_GET_PERM acl_get_perm
+#elif HAVE_ACL_GET_PERM_NP
+#define ACL_GET_PERM acl_get_perm_np
+#endif
+
+static struct archive_test_acl_t acls2[] = {
+ { ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_EXECUTE | ARCHIVE_ENTRY_ACL_READ,
+ ARCHIVE_ENTRY_ACL_USER_OBJ, -1, "" },
+ { ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_READ,
+ ARCHIVE_ENTRY_ACL_USER, 77, "user77" },
+ { ARCHIVE_ENTRY_ACL_TYPE_ACCESS, 0,
+ ARCHIVE_ENTRY_ACL_USER, 78, "user78" },
+ { ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_READ,
+ ARCHIVE_ENTRY_ACL_GROUP_OBJ, -1, "" },
+ { ARCHIVE_ENTRY_ACL_TYPE_ACCESS, 0007,
+ ARCHIVE_ENTRY_ACL_GROUP, 78, "group78" },
+ { ARCHIVE_ENTRY_ACL_TYPE_ACCESS,
+ ARCHIVE_ENTRY_ACL_WRITE | ARCHIVE_ENTRY_ACL_EXECUTE,
+ ARCHIVE_ENTRY_ACL_OTHER, -1, "" },
+ { ARCHIVE_ENTRY_ACL_TYPE_ACCESS,
+ ARCHIVE_ENTRY_ACL_WRITE | ARCHIVE_ENTRY_ACL_READ | ARCHIVE_ENTRY_ACL_EXECUTE,
+ ARCHIVE_ENTRY_ACL_MASK, -1, "" },
+};
+
+static int
+#if ARCHIVE_ACL_SUNOS
+acl_entry_get_perm(aclent_t *aclent)
+#else
+acl_entry_get_perm(acl_entry_t aclent)
+#endif
+{
+ int permset = 0;
+#if ARCHIVE_ACL_FREEBSD || ARCHIVE_ACL_LIBACL
+ acl_permset_t opaque_ps;
+#endif
+
+#if ARCHIVE_ACL_SUNOS
+ if (aclent->a_perm & 1)
+ permset |= ARCHIVE_ENTRY_ACL_EXECUTE;
+ if (aclent->a_perm & 2)
+ permset |= ARCHIVE_ENTRY_ACL_WRITE;
+ if (aclent->a_perm & 4)
+ permset |= ARCHIVE_ENTRY_ACL_READ;
+#else
+ /* translate the silly opaque permset to a bitmap */
+ acl_get_permset(aclent, &opaque_ps);
+ if (ACL_GET_PERM(opaque_ps, ACL_EXECUTE))
+ permset |= ARCHIVE_ENTRY_ACL_EXECUTE;
+ if (ACL_GET_PERM(opaque_ps, ACL_WRITE))
+ permset |= ARCHIVE_ENTRY_ACL_WRITE;
+ if (ACL_GET_PERM(opaque_ps, ACL_READ))
+ permset |= ARCHIVE_ENTRY_ACL_READ;
+#endif
+ return permset;
+}
+
+#if 0
+static int
+acl_get_specific_entry(acl_t acl, acl_tag_t requested_tag_type, int requested_tag) {
+ int entry_id = ACL_FIRST_ENTRY;
+ acl_entry_t acl_entry;
+ acl_tag_t acl_tag_type;
+
+ while (1 == acl_get_entry(acl, entry_id, &acl_entry)) {
+ /* After the first time... */
+ entry_id = ACL_NEXT_ENTRY;
+
+ /* If this matches, return perm mask */
+ acl_get_tag_type(acl_entry, &acl_tag_type);
+ if (acl_tag_type == requested_tag_type) {
+ switch (acl_tag_type) {
+ case ACL_USER_OBJ:
+ if ((uid_t)requested_tag == *(uid_t *)(acl_get_qualifier(acl_entry))) {
+ return acl_entry_get_perm(acl_entry);
+ }
+ break;
+ case ACL_GROUP_OBJ:
+ if ((gid_t)requested_tag == *(gid_t *)(acl_get_qualifier(acl_entry))) {
+ return acl_entry_get_perm(acl_entry);
+ }
+ break;
+ case ACL_USER:
+ case ACL_GROUP:
+ case ACL_OTHER:
+ return acl_entry_get_perm(acl_entry);
+ default:
+ failure("Unexpected ACL tag type");
+ assert(0);
+ }
+ }
+
+
+ }
+ return -1;
+}
+#endif
+
+#if ARCHIVE_ACL_SUNOS
+static int
+acl_match(aclent_t *aclent, struct archive_test_acl_t *myacl)
+{
+
+ if (myacl->permset != acl_entry_get_perm(aclent))
+ return (0);
+
+ switch (aclent->a_type) {
+ case DEF_USER_OBJ:
+ case USER_OBJ:
+ if (myacl->tag != ARCHIVE_ENTRY_ACL_USER_OBJ) return (0);
+ break;
+ if (myacl->tag != ARCHIVE_ENTRY_ACL_USER)
+ return (0);
+ if ((uid_t)myacl->qual != aclent->a_id)
+ return (0);
+ break;
+ case DEF_GROUP_OBJ:
+ case GROUP_OBJ:
+ if (myacl->tag != ARCHIVE_ENTRY_ACL_GROUP_OBJ) return (0);
+ break;
+ case DEF_GROUP:
+ case GROUP:
+ if (myacl->tag != ARCHIVE_ENTRY_ACL_GROUP)
+ return (0);
+ if ((gid_t)myacl->qual != aclent->a_id)
+ return (0);
+ break;
+ case DEF_CLASS_OBJ:
+ case CLASS_OBJ:
+ if (myacl->tag != ARCHIVE_ENTRY_ACL_MASK) return (0);
+ break;
+ case DEF_OTHER_OBJ:
+ case OTHER_OBJ:
+ if (myacl->tag != ARCHIVE_ENTRY_ACL_OTHER) return (0);
+ break;
+ }
+ return (1);
+}
+
+#else /* ARCHIVE_ACL_FREEBSD || ARCHIVE_ACL_LIBACL */
+static int
+acl_match(acl_entry_t aclent, struct archive_test_acl_t *myacl)
+{
+ gid_t g, *gp;
+ uid_t u, *up;
+ acl_tag_t tag_type;
+
+ if (myacl->permset != acl_entry_get_perm(aclent))
+ return (0);
+
+ acl_get_tag_type(aclent, &tag_type);
+ switch (tag_type) {
+ case ACL_USER_OBJ:
+ if (myacl->tag != ARCHIVE_ENTRY_ACL_USER_OBJ) return (0);
+ break;
+ case ACL_USER:
+ if (myacl->tag != ARCHIVE_ENTRY_ACL_USER)
+ return (0);
+ up = acl_get_qualifier(aclent);
+ u = *up;
+ acl_free(up);
+ if ((uid_t)myacl->qual != u)
+ return (0);
+ break;
+ case ACL_GROUP_OBJ:
+ if (myacl->tag != ARCHIVE_ENTRY_ACL_GROUP_OBJ) return (0);
+ break;
+ case ACL_GROUP:
+ if (myacl->tag != ARCHIVE_ENTRY_ACL_GROUP)
+ return (0);
+ gp = acl_get_qualifier(aclent);
+ g = *gp;
+ acl_free(gp);
+ if ((gid_t)myacl->qual != g)
+ return (0);
+ break;
+ case ACL_MASK:
+ if (myacl->tag != ARCHIVE_ENTRY_ACL_MASK) return (0);
+ break;
+ case ACL_OTHER:
+ if (myacl->tag != ARCHIVE_ENTRY_ACL_OTHER) return (0);
+ break;
+ }
+ return (1);
+}
+#endif
+
+static void
+compare_acls(
+#if ARCHIVE_ACL_SUNOS
+ void *aclp, int aclcnt,
+#else
+ acl_t acl,
+#endif
+ struct archive_test_acl_t *myacls, int n)
+{
+ int *marker;
+ int matched;
+ int i;
+#if ARCHIVE_ACL_SUNOS
+ int e;
+ aclent_t *acl_entry;
+#else
+ int entry_id = ACL_FIRST_ENTRY;
+ acl_entry_t acl_entry;
+#endif
+
+ /* Count ACL entries in myacls array and allocate an indirect array. */
+ marker = malloc(sizeof(marker[0]) * n);
+ if (marker == NULL)
+ return;
+ for (i = 0; i < n; i++)
+ marker[i] = i;
+
+ /*
+ * Iterate over acls in system acl object, try to match each
+ * one with an item in the myacls array.
+ */
+#if ARCHIVE_ACL_SUNOS
+ for(e = 0; e < aclcnt; e++) {
+ acl_entry = &((aclent_t *)aclp)[e];
+#else
+ while (1 == acl_get_entry(acl, entry_id, &acl_entry)) {
+ /* After the first time... */
+ entry_id = ACL_NEXT_ENTRY;
+#endif
+
+ /* Search for a matching entry (tag and qualifier) */
+ for (i = 0, matched = 0; i < n && !matched; i++) {
+ if (acl_match(acl_entry, &myacls[marker[i]])) {
+ /* We found a match; remove it. */
+ marker[i] = marker[n - 1];
+ n--;
+ matched = 1;
+ }
+ }
+
+ /* TODO: Print out more details in this case. */
+ failure("ACL entry on file that shouldn't be there");
+ assert(matched == 1);
+ }
+
+ /* Dump entries in the myacls array that weren't in the system acl. */
+ for (i = 0; i < n; ++i) {
+ failure(" ACL entry missing from file: "
+ "type=%#010x,permset=%#010x,tag=%d,qual=%d,name=``%s''\n",
+ myacls[marker[i]].type, myacls[marker[i]].permset,
+ myacls[marker[i]].tag, myacls[marker[i]].qual,
+ myacls[marker[i]].name);
+ assert(0); /* Record this as a failure. */
+ }
+ free(marker);
+}
+#endif
+
+/*
+ * Verify ACL restore-to-disk. This test is Platform-specific.
+ */
+
+DEFINE_TEST(test_acl_platform_posix1e_restore)
+{
+#if !ARCHIVE_ACL_POSIX1E
+ skipping("POSIX.1e ACLs are not supported on this platform");
+#else /* ARCHIVE_ACL_POSIX1E */
+ struct stat st;
+ struct archive *a;
+ struct archive_entry *ae;
+#if ARCHIVE_ACL_SUNOS
+ void *aclp;
+ int aclcnt;
+#else
+ acl_t acl;
+#endif
+
+ assertMakeFile("pretest", 0644, "a");
+
+ if (setTestAcl("pretest") != ARCHIVE_TEST_ACL_TYPE_POSIX1E) {
+ skipping("POSIX.1e ACLs are not writable on this filesystem");
+ return;
+ }
+
+ /* Create a write-to-disk object. */
+ assert(NULL != (a = archive_write_disk_new()));
+ archive_write_disk_set_options(a,
+ ARCHIVE_EXTRACT_TIME | ARCHIVE_EXTRACT_PERM | ARCHIVE_EXTRACT_ACL);
+
+ /* Populate an archive entry with some metadata, including ACL info */
+ ae = archive_entry_new();
+ assert(ae != NULL);
+ archive_entry_set_pathname(ae, "test0");
+ archive_entry_set_mtime(ae, 123456, 7890);
+ archive_entry_set_size(ae, 0);
+ assertEntrySetAcls(ae, acls2, sizeof(acls2)/sizeof(acls2[0]));
+ assertEqualIntA(a, ARCHIVE_OK, archive_write_header(a, ae));
+ archive_entry_free(ae);
+
+ /* Close the archive. */
+ assertEqualIntA(a, ARCHIVE_OK, archive_write_close(a));
+ assertEqualInt(ARCHIVE_OK, archive_write_free(a));
+
+ /* Verify the data on disk. */
+ assertEqualInt(0, stat("test0", &st));
+ assertEqualInt(st.st_mtime, 123456);
+#if ARCHIVE_ACL_SUNOS
+ aclp = sunacl_get(GETACL, &aclcnt, 0, "test0");
+ failure("acl(): errno = %d (%s)", errno, strerror(errno));
+ assert(aclp != NULL);
+#else
+ acl = acl_get_file("test0", ACL_TYPE_ACCESS);
+ failure("acl_get_file(): errno = %d (%s)", errno, strerror(errno));
+ assert(acl != (acl_t)NULL);
+#endif
+#if ARCHIVE_ACL_SUNOS
+ compare_acls(aclp, aclcnt, acls2, sizeof(acls2)/sizeof(acls2[0]));
+ free(aclp);
+ aclp = NULL;
+#else
+ compare_acls(acl, acls2, sizeof(acls2)/sizeof(acls2[0]));
+ acl_free(acl);
+#endif
+
+#endif /* ARCHIVE_ACL_POSIX1E */
+}
+
+/*
+ * Verify ACL read-from-disk. This test is Platform-specific.
+ */
+DEFINE_TEST(test_acl_platform_posix1e_read)
+{
+#if !ARCHIVE_ACL_POSIX1E
+ skipping("POSIX.1e ACLs are not supported on this platform");
+#else /* ARCHIVE_ACL_POSIX1E */
+ struct archive *a;
+ struct archive_entry *ae;
+ int n, fd, flags, dflags;
+ char *func, *acl_text;
+ const char *acl1_text, *acl2_text, *acl3_text;
+#if ARCHIVE_ACL_SUNOS
+ void *aclp;
+ int aclcnt;
+#else
+ acl_t acl1, acl2, acl3;
+#endif
+
+ /*
+ * Manually construct a directory and two files with
+ * different ACLs. This also serves to verify that ACLs
+ * are supported on the local filesystem.
+ */
+
+ /* Create a test file f1 with acl1 */
+#if ARCHIVE_ACL_SUNOS
+ acl1_text = "user::rwx,"
+ "group::rwx,"
+ "other:rwx,"
+ "user:1:rw-,"
+ "group:15:r-x,"
+ "mask:rwx";
+ aclent_t aclp1[] = {
+ { USER_OBJ, -1, 4 | 2 | 1 },
+ { USER, 1, 4 | 2 },
+ { GROUP_OBJ, -1, 4 | 2 | 1 },
+ { GROUP, 15, 4 | 1 },
+ { CLASS_OBJ, -1, 4 | 2 | 1 },
+ { OTHER_OBJ, -1, 4 | 2 | 1 }
+ };
+#else
+ acl1_text = "user::rwx\n"
+ "group::rwx\n"
+ "other::rwx\n"
+ "user:1:rw-\n"
+ "group:15:r-x\n"
+ "mask::rwx";
+ acl1 = acl_from_text(acl1_text);
+ failure("acl_from_text(): errno = %d (%s)", errno, strerror(errno));
+ assert((void *)acl1 != NULL);
+#endif
+ fd = open("f1", O_WRONLY | O_CREAT | O_EXCL, 0777);
+ failure("Could not create test file?!");
+ if (!assert(fd >= 0)) {
+#if !ARCHIVE_ACL_SUNOS
+ acl_free(acl1);
+#endif
+ return;
+ }
+#if ARCHIVE_ACL_SUNOS
+ /* Check if Solaris filesystem supports POSIX.1e ACLs */
+ aclp = sunacl_get(GETACL, &aclcnt, fd, NULL);
+ if (aclp == 0)
+ close(fd);
+ if (errno == ENOSYS || errno == ENOTSUP) {
+ skipping("POSIX.1e ACLs are not supported on this filesystem");
+ return;
+ }
+ failure("facl(): errno = %d (%s)", errno, strerror(errno));
+ assert(aclp != NULL);
+
+ func = "facl()";
+ n = facl(fd, SETACL, (int)(sizeof(aclp1)/sizeof(aclp1[0])), aclp1);
+#else
+ func = "acl_set_fd()";
+ n = acl_set_fd(fd, acl1);
+#endif
+#if !ARCHIVE_ACL_SUNOS
+ acl_free(acl1);
+#endif
+
+ if (n != 0) {
+#if ARCHIVE_ACL_SUNOS
+ if (errno == ENOSYS || errno == ENOTSUP)
+#else
+ if (errno == EOPNOTSUPP || errno == EINVAL)
+#endif
+ {
+ close(fd);
+ skipping("POSIX.1e ACLs are not supported on this filesystem");
+ return;
+ }
+ }
+ failure("%s: errno = %d (%s)", func, errno, strerror(errno));
+ assertEqualInt(0, n);
+
+ close(fd);
+
+ assertMakeDir("d", 0700);
+
+ /*
+ * Create file d/f1 with acl2
+ *
+ * This differs from acl1 in the u:1: and g:15: permissions.
+ *
+ * This file deliberately has the same name but a different ACL.
+ * Github Issue #777 explains how libarchive's directory traversal
+ * did not always correctly enter directories before attempting
+ * to read ACLs, resulting in reading the ACL from a like-named
+ * file in the wrong directory.
+ */
+#if ARCHIVE_ACL_SUNOS
+ acl2_text = "user::rwx,"
+ "group::rwx,"
+ "other:---,"
+ "user:1:r--,"
+ "group:15:r--,"
+ "mask:rwx";
+ aclent_t aclp2[] = {
+ { USER_OBJ, -1, 4 | 2 | 1 },
+ { USER, 1, 4 },
+ { GROUP_OBJ, -1, 4 | 2 | 1},
+ { GROUP, 15, 4 },
+ { CLASS_OBJ, -1, 4 | 2 | 1},
+ { OTHER_OBJ, -1, 0 }
+ };
+#else
+ acl2_text = "user::rwx\n"
+ "group::rwx\n"
+ "other::---\n"
+ "user:1:r--\n"
+ "group:15:r--\n"
+ "mask::rwx";
+ acl2 = acl_from_text(acl2_text);
+ failure("acl_from_text(): errno = %d (%s)", errno, strerror(errno));
+ assert((void *)acl2 != NULL);
+#endif
+ fd = open("d/f1", O_WRONLY | O_CREAT | O_EXCL, 0777);
+ failure("Could not create test file?!");
+ if (!assert(fd >= 0)) {
+#if !ARCHIVE_ACL_SUNOS
+ acl_free(acl2);
+#endif
+ return;
+ }
+#if ARCHIVE_ACL_SUNOS
+ func = "facl()";
+ n = facl(fd, SETACL, (int)(sizeof(aclp2) / sizeof(aclp2[0])), aclp2);
+#else
+ func = "acl_set_fd()";
+ n = acl_set_fd(fd, acl2);
+ acl_free(acl2);
+#endif
+ if (n != 0)
+ close(fd);
+ failure("%s: errno = %d (%s)", func, errno, strerror(errno));
+ assertEqualInt(0, n);
+ close(fd);
+
+ /* Create nested directory d2 with default ACLs */
+ assertMakeDir("d/d2", 0755);
+
+#if ARCHIVE_ACL_SUNOS
+ acl3_text = "user::rwx,"
+ "group::r-x,"
+ "other:r-x,"
+ "user:2:r--,"
+ "group:16:-w-,"
+ "mask:rwx,"
+ "default:user::rwx,"
+ "default:user:1:r--,"
+ "default:group::r-x,"
+ "default:group:15:r--,"
+ "default:mask:rwx,"
+ "default:other:r-x";
+ aclent_t aclp3[] = {
+ { USER_OBJ, -1, 4 | 2 | 1 },
+ { USER, 2, 4 },
+ { GROUP_OBJ, -1, 4 | 1 },
+ { GROUP, 16, 2 },
+ { CLASS_OBJ, -1, 4 | 2 | 1 },
+ { OTHER_OBJ, -1, 4 | 1 },
+ { USER_OBJ | ACL_DEFAULT, -1, 4 | 2 | 1 },
+ { USER | ACL_DEFAULT, 1, 4 },
+ { GROUP_OBJ | ACL_DEFAULT, -1, 4 | 1 },
+ { GROUP | ACL_DEFAULT, 15, 4 },
+ { CLASS_OBJ | ACL_DEFAULT, -1, 4 | 2 | 1},
+ { OTHER_OBJ | ACL_DEFAULT, -1, 4 | 1 }
+ };
+#else
+ acl3_text = "user::rwx\n"
+ "user:1:r--\n"
+ "group::r-x\n"
+ "group:15:r--\n"
+ "mask::rwx\n"
+ "other::r-x";
+ acl3 = acl_from_text(acl3_text);
+ failure("acl_from_text(): errno = %d (%s)", errno, strerror(errno));
+ assert((void *)acl3 != NULL);
+#endif
+
+#if ARCHIVE_ACL_SUNOS
+ func = "acl()";
+ n = acl("d/d2", SETACL, (int)(sizeof(aclp3) / sizeof(aclp3[0])), aclp3);
+#else
+ func = "acl_set_file()";
+ n = acl_set_file("d/d2", ACL_TYPE_DEFAULT, acl3);
+ acl_free(acl3);
+#endif
+ failure("%s: errno = %d (%s)", func, errno, strerror(errno));
+ assertEqualInt(0, n);
+
+ /* Create a read-from-disk object. */
+ assert(NULL != (a = archive_read_disk_new()));
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_disk_open(a, "."));
+ assert(NULL != (ae = archive_entry_new()));
+
+#if ARCHIVE_ACL_SUNOS
+ flags = ARCHIVE_ENTRY_ACL_TYPE_POSIX1E
+ | ARCHIVE_ENTRY_ACL_STYLE_SEPARATOR_COMMA
+ | ARCHIVE_ENTRY_ACL_STYLE_SOLARIS;
+ dflags = flags;
+#else
+ flags = ARCHIVE_ENTRY_ACL_TYPE_ACCESS;
+ dflags = ARCHIVE_ENTRY_ACL_TYPE_DEFAULT;
+#endif
+
+ /* Walk the dir until we see both of the files */
+ while (ARCHIVE_OK == archive_read_next_header2(a, ae)) {
+ archive_read_disk_descend(a);
+ if (strcmp(archive_entry_pathname(ae), "./f1") == 0) {
+ acl_text = archive_entry_acl_to_text(ae, NULL, flags);
+ assertEqualString(acl_text, acl1_text);
+ free(acl_text);
+ } else if (strcmp(archive_entry_pathname(ae), "./d/f1") == 0) {
+ acl_text = archive_entry_acl_to_text(ae, NULL, flags);
+ assertEqualString(acl_text, acl2_text);
+ free(acl_text);
+ } else if (strcmp(archive_entry_pathname(ae), "./d/d2") == 0) {
+ acl_text = archive_entry_acl_to_text(ae, NULL, dflags);
+ assertEqualString(acl_text, acl3_text);
+ free(acl_text);
+ }
+ }
+
+ archive_entry_free(ae);
+ assertEqualInt(ARCHIVE_OK, archive_free(a));
+#endif /* ARCHIVE_ACL_POSIX1E */
+}
Modified: trunk/contrib/libarchive/libarchive/test/test_acl_posix1e.c
===================================================================
--- trunk/contrib/libarchive/libarchive/test/test_acl_posix1e.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/test/test_acl_posix1e.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -27,21 +27,14 @@
/*
* Exercise the system-independent portion of the ACL support.
- * Check that archive_entry objects can save and restore POSIX.1e-style ACL data.
+ * Check that archive_entry objects can save and restore POSIX.1e-style
+ * ACL data.
*
* This should work on all systems, regardless of whether local
* filesystems support ACLs or not.
*/
-struct acl_t {
- int type; /* Type of ACL: "access" or "default" */
- int permset; /* Permissions for this class of users. */
- int tag; /* Owner, User, Owning group, group, other, etc. */
- int qual; /* GID or UID of user/group, depending on tag. */
- const char *name; /* Name of user/group, depending on tag. */
-};
-
-static struct acl_t acls0[] = {
+static struct archive_test_acl_t acls0[] = {
{ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_EXECUTE,
ARCHIVE_ENTRY_ACL_USER_OBJ, 0, "" },
{ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_READ,
@@ -50,7 +43,7 @@
ARCHIVE_ENTRY_ACL_OTHER, 0, "" },
};
-static struct acl_t acls1[] = {
+static struct archive_test_acl_t acls1[] = {
{ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_EXECUTE,
ARCHIVE_ENTRY_ACL_USER_OBJ, -1, "" },
{ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_READ,
@@ -61,7 +54,7 @@
ARCHIVE_ENTRY_ACL_OTHER, -1, "" },
};
-static struct acl_t acls2[] = {
+static struct archive_test_acl_t acls2[] = {
{ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_EXECUTE | ARCHIVE_ENTRY_ACL_READ,
ARCHIVE_ENTRY_ACL_USER_OBJ, -1, "" },
{ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_READ,
@@ -80,7 +73,7 @@
* NFS4 entry types; attempts to set these on top of POSIX.1e
* attributes should fail.
*/
-static struct acl_t acls_nfs4[] = {
+static struct archive_test_acl_t acls_nfs4[] = {
/* NFS4 types */
{ ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_READ,
ARCHIVE_ENTRY_ACL_USER, 78, "" },
@@ -104,106 +97,6 @@
ARCHIVE_ENTRY_ACL_USER_OBJ, -1, "" },
};
-static void
-set_acls(struct archive_entry *ae, struct acl_t *acls, int n)
-{
- int i;
-
- archive_entry_acl_clear(ae);
- for (i = 0; i < n; i++) {
- archive_entry_acl_add_entry(ae,
- acls[i].type, acls[i].permset, acls[i].tag, acls[i].qual,
- acls[i].name);
- }
-}
-
-static int
-acl_match(struct acl_t *acl, int type, int permset, int tag, int qual, const char *name)
-{
- if (type != acl->type)
- return (0);
- if (permset != acl->permset)
- return (0);
- if (tag != acl->tag)
- return (0);
- if (tag == ARCHIVE_ENTRY_ACL_USER_OBJ)
- return (1);
- if (tag == ARCHIVE_ENTRY_ACL_GROUP_OBJ)
- return (1);
- if (tag == ARCHIVE_ENTRY_ACL_OTHER)
- return (1);
- if (qual != acl->qual)
- return (0);
- if (name == NULL) {
- if (acl->name == NULL || acl->name[0] == '\0')
- return (1);
- return (0);
- }
- if (acl->name == NULL) {
- if (name[0] == '\0')
- return (1);
- return (0);
- }
- return (0 == strcmp(name, acl->name));
-}
-
-static void
-compare_acls(struct archive_entry *ae, struct acl_t *acls, int n, int mode)
-{
- int *marker = malloc(sizeof(marker[0]) * n);
- int i;
- int r;
- int type, permset, tag, qual;
- int matched;
- const char *name;
-
- for (i = 0; i < n; i++)
- marker[i] = i;
-
- while (0 == (r = archive_entry_acl_next(ae,
- ARCHIVE_ENTRY_ACL_TYPE_ACCESS,
- &type, &permset, &tag, &qual, &name))) {
- for (i = 0, matched = 0; i < n && !matched; i++) {
- if (acl_match(&acls[marker[i]], type, permset,
- tag, qual, name)) {
- /* We found a match; remove it. */
- marker[i] = marker[n - 1];
- n--;
- matched = 1;
- }
- }
- if (tag == ARCHIVE_ENTRY_ACL_USER_OBJ) {
- if (!matched) printf("No match for user_obj perm\n");
- failure("USER_OBJ permset (%02o) != user mode (%02o)",
- permset, 07 & (mode >> 6));
- assert((permset << 6) == (mode & 0700));
- } else if (tag == ARCHIVE_ENTRY_ACL_GROUP_OBJ) {
- if (!matched) printf("No match for group_obj perm\n");
- failure("GROUP_OBJ permset %02o != group mode %02o",
- permset, 07 & (mode >> 3));
- assert((permset << 3) == (mode & 0070));
- } else if (tag == ARCHIVE_ENTRY_ACL_OTHER) {
- if (!matched) printf("No match for other perm\n");
- failure("OTHER permset (%02o) != other mode (%02o)",
- permset, mode & 07);
- assert((permset << 0) == (mode & 0007));
- } else {
- failure("Could not find match for ACL "
- "(type=%d,permset=%d,tag=%d,qual=%d,name=``%s'')",
- type, permset, tag, qual, name);
- assert(matched == 1);
- }
- }
- assertEqualInt(ARCHIVE_EOF, r);
- assert((mode_t)(mode & 0777) == (archive_entry_mode(ae) & 0777));
- failure("Could not find match for ACL "
- "(type=%d,permset=%d,tag=%d,qual=%d,name=``%s'')",
- acls[marker[0]].type, acls[marker[0]].permset,
- acls[marker[0]].tag, acls[marker[0]].qual, acls[marker[0]].name);
- assert(n == 0); /* Number of ACLs not matched should == 0 */
- free(marker);
-}
-
DEFINE_TEST(test_acl_posix1e)
{
struct archive_entry *ae;
@@ -223,7 +116,7 @@
* triggering unnecessary extensions. It's better to identify
* trivial ACLs at the point they are being read from disk.
*/
- set_acls(ae, acls0, sizeof(acls0)/sizeof(acls0[0]));
+ assertEntrySetAcls(ae, acls0, sizeof(acls0)/sizeof(acls0[0]));
failure("Basic ACLs shouldn't be stored as extended ACLs");
assert(0 == archive_entry_acl_reset(ae, ARCHIVE_ENTRY_ACL_TYPE_ACCESS));
failure("Basic ACLs should set mode to 0142, not %04o",
@@ -230,12 +123,19 @@
archive_entry_mode(ae)&0777);
assert((archive_entry_mode(ae) & 0777) == 0142);
-
/* With any extended ACL entry, we should read back a full set. */
- set_acls(ae, acls1, sizeof(acls1)/sizeof(acls1[0]));
+ assertEntrySetAcls(ae, acls1, sizeof(acls1)/sizeof(acls1[0]));
failure("One extended ACL should flag all ACLs to be returned.");
+
+ /* Check that entry contains only POSIX.1e types */
+ assert((archive_entry_acl_types(ae) &
+ ARCHIVE_ENTRY_ACL_TYPE_NFS4) == 0);
+ assert((archive_entry_acl_types(ae) &
+ ARCHIVE_ENTRY_ACL_TYPE_POSIX1E) != 0);
+
assert(4 == archive_entry_acl_reset(ae, ARCHIVE_ENTRY_ACL_TYPE_ACCESS));
- compare_acls(ae, acls1, sizeof(acls1)/sizeof(acls1[0]), 0142);
+ assertEntryCompareAcls(ae, acls1, sizeof(acls1)/sizeof(acls1[0]),
+ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, 0142);
failure("Basic ACLs should set mode to 0142, not %04o",
archive_entry_mode(ae)&0777);
assert((archive_entry_mode(ae) & 0777) == 0142);
@@ -242,9 +142,10 @@
/* A more extensive set of ACLs. */
- set_acls(ae, acls2, sizeof(acls2)/sizeof(acls2[0]));
+ assertEntrySetAcls(ae, acls2, sizeof(acls2)/sizeof(acls2[0]));
assertEqualInt(6, archive_entry_acl_reset(ae, ARCHIVE_ENTRY_ACL_TYPE_ACCESS));
- compare_acls(ae, acls2, sizeof(acls2)/sizeof(acls2[0]), 0543);
+ assertEntryCompareAcls(ae, acls2, sizeof(acls2)/sizeof(acls2[0]),
+ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, 0543);
failure("Basic ACLs should set mode to 0543, not %04o",
archive_entry_mode(ae)&0777);
assert((archive_entry_mode(ae) & 0777) == 0543);
@@ -253,7 +154,7 @@
* Check that clearing ACLs gets rid of them all by repeating
* the first test.
*/
- set_acls(ae, acls0, sizeof(acls0)/sizeof(acls0[0]));
+ assertEntrySetAcls(ae, acls0, sizeof(acls0)/sizeof(acls0[0]));
failure("Basic ACLs shouldn't be stored as extended ACLs");
assert(0 == archive_entry_acl_reset(ae, ARCHIVE_ENTRY_ACL_TYPE_ACCESS));
failure("Basic ACLs should set mode to 0142, not %04o",
@@ -264,9 +165,9 @@
* Different types of malformed ACL entries that should
* fail when added to existing POSIX.1e ACLs.
*/
- set_acls(ae, acls2, sizeof(acls2)/sizeof(acls2[0]));
+ assertEntrySetAcls(ae, acls2, sizeof(acls2)/sizeof(acls2[0]));
for (i = 0; i < (int)(sizeof(acls_nfs4)/sizeof(acls_nfs4[0])); ++i) {
- struct acl_t *p = &acls_nfs4[i];
+ struct archive_test_acl_t *p = &acls_nfs4[i];
failure("Malformed ACL test #%d", i);
assertEqualInt(ARCHIVE_FAILED,
archive_entry_acl_add_entry(ae,
Copied: trunk/contrib/libarchive/libarchive/test/test_acl_text.c (from rev 11133, vendor/libarchive/dist/libarchive/test/test_acl_text.c)
===================================================================
--- trunk/contrib/libarchive/libarchive/test/test_acl_text.c (rev 0)
+++ trunk/contrib/libarchive/libarchive/test/test_acl_text.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -0,0 +1,473 @@
+/*-
+ * Copyright (c) 2016 Martin Matuska
+ * 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 "test.h"
+__FBSDID("$FreeBSD$");
+
+/*
+ * Test converting ACLs to text, both wide and non-wide
+ *
+ * This should work on all systems, regardless of whether local
+ * filesystems support ACLs or not.
+ */
+
+static struct archive_test_acl_t acls0[] = {
+ { ARCHIVE_ENTRY_ACL_TYPE_ACCESS,
+ ARCHIVE_ENTRY_ACL_EXECUTE |
+ ARCHIVE_ENTRY_ACL_READ |
+ ARCHIVE_ENTRY_ACL_WRITE,
+ ARCHIVE_ENTRY_ACL_USER_OBJ, -1, "" },
+ { ARCHIVE_ENTRY_ACL_TYPE_ACCESS,
+ ARCHIVE_ENTRY_ACL_EXECUTE |
+ ARCHIVE_ENTRY_ACL_READ,
+ ARCHIVE_ENTRY_ACL_USER, 100, "user100" },
+ { ARCHIVE_ENTRY_ACL_TYPE_ACCESS, 0,
+ ARCHIVE_ENTRY_ACL_USER, 1000, "user1000" },
+ { ARCHIVE_ENTRY_ACL_TYPE_ACCESS,
+ ARCHIVE_ENTRY_ACL_EXECUTE |
+ ARCHIVE_ENTRY_ACL_READ,
+ ARCHIVE_ENTRY_ACL_GROUP_OBJ, -1, "" },
+ { ARCHIVE_ENTRY_ACL_TYPE_ACCESS,
+ ARCHIVE_ENTRY_ACL_EXECUTE |
+ ARCHIVE_ENTRY_ACL_READ |
+ ARCHIVE_ENTRY_ACL_WRITE,
+ ARCHIVE_ENTRY_ACL_GROUP, 78, "group78" },
+ { ARCHIVE_ENTRY_ACL_TYPE_ACCESS,
+ ARCHIVE_ENTRY_ACL_READ |
+ ARCHIVE_ENTRY_ACL_EXECUTE,
+ ARCHIVE_ENTRY_ACL_OTHER, -1, "" },
+ { ARCHIVE_ENTRY_ACL_TYPE_DEFAULT,
+ ARCHIVE_ENTRY_ACL_EXECUTE |
+ ARCHIVE_ENTRY_ACL_READ,
+ ARCHIVE_ENTRY_ACL_USER_OBJ, -1, "" },
+ { ARCHIVE_ENTRY_ACL_TYPE_DEFAULT,
+ ARCHIVE_ENTRY_ACL_EXECUTE |
+ ARCHIVE_ENTRY_ACL_READ,
+ ARCHIVE_ENTRY_ACL_GROUP_OBJ, -1, "" },
+ { ARCHIVE_ENTRY_ACL_TYPE_DEFAULT, 0,
+ ARCHIVE_ENTRY_ACL_OTHER, -1, "" },
+ { ARCHIVE_ENTRY_ACL_TYPE_DEFAULT,
+ ARCHIVE_ENTRY_ACL_EXECUTE |
+ ARCHIVE_ENTRY_ACL_READ,
+ ARCHIVE_ENTRY_ACL_USER, 101, "user101"},
+ { ARCHIVE_ENTRY_ACL_TYPE_DEFAULT,
+ ARCHIVE_ENTRY_ACL_EXECUTE,
+ ARCHIVE_ENTRY_ACL_GROUP, 79, "group79" },
+};
+
+static struct archive_test_acl_t acls1[] = {
+ { ARCHIVE_ENTRY_ACL_TYPE_ALLOW,
+ ARCHIVE_ENTRY_ACL_READ_DATA |
+ ARCHIVE_ENTRY_ACL_WRITE_DATA |
+ ARCHIVE_ENTRY_ACL_APPEND_DATA |
+ ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES |
+ ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS |
+ ARCHIVE_ENTRY_ACL_READ_ACL |
+ ARCHIVE_ENTRY_ACL_WRITE_OWNER,
+ ARCHIVE_ENTRY_ACL_USER, 77, "user77" },
+ { ARCHIVE_ENTRY_ACL_TYPE_DENY,
+ ARCHIVE_ENTRY_ACL_WRITE_DATA |
+ ARCHIVE_ENTRY_ACL_APPEND_DATA |
+ ARCHIVE_ENTRY_ACL_DELETE_CHILD |
+ ARCHIVE_ENTRY_ACL_DELETE |
+ ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT |
+ ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT |
+ ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY |
+ ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT,
+ ARCHIVE_ENTRY_ACL_USER, 101, "user101" },
+ { ARCHIVE_ENTRY_ACL_TYPE_ALLOW,
+ ARCHIVE_ENTRY_ACL_READ_DATA |
+ ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES |
+ ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS |
+ ARCHIVE_ENTRY_ACL_READ_ACL |
+ ARCHIVE_ENTRY_ACL_ENTRY_INHERITED,
+ ARCHIVE_ENTRY_ACL_GROUP, 78, "group78" },
+ { ARCHIVE_ENTRY_ACL_TYPE_ALLOW,
+ ARCHIVE_ENTRY_ACL_READ_DATA |
+ ARCHIVE_ENTRY_ACL_WRITE_DATA |
+ ARCHIVE_ENTRY_ACL_EXECUTE |
+ ARCHIVE_ENTRY_ACL_APPEND_DATA |
+ ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES |
+ ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES |
+ ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS |
+ ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS |
+ ARCHIVE_ENTRY_ACL_READ_ACL |
+ ARCHIVE_ENTRY_ACL_WRITE_ACL |
+ ARCHIVE_ENTRY_ACL_WRITE_OWNER,
+ ARCHIVE_ENTRY_ACL_USER_OBJ, 0, "" },
+ { ARCHIVE_ENTRY_ACL_TYPE_ALLOW,
+ ARCHIVE_ENTRY_ACL_READ_DATA |
+ ARCHIVE_ENTRY_ACL_WRITE_DATA |
+ ARCHIVE_ENTRY_ACL_APPEND_DATA |
+ ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES |
+ ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS |
+ ARCHIVE_ENTRY_ACL_READ_ACL,
+ ARCHIVE_ENTRY_ACL_GROUP_OBJ, 0, "" },
+ { ARCHIVE_ENTRY_ACL_TYPE_ALLOW,
+ ARCHIVE_ENTRY_ACL_READ_DATA |
+ ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES |
+ ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS |
+ ARCHIVE_ENTRY_ACL_READ_ACL |
+ ARCHIVE_ENTRY_ACL_SYNCHRONIZE,
+ ARCHIVE_ENTRY_ACL_EVERYONE, 0, "" },
+};
+
+const char* acltext[] = {
+ "user::rwx\n"
+ "group::r-x\n"
+ "other::r-x\n"
+ "user:user100:r-x\n"
+ "user:user1000:---\n"
+ "group:group78:rwx\n"
+ "default:user::r-x\n"
+ "default:group::r-x\n"
+ "default:other::---\n"
+ "default:user:user101:r-x\n"
+ "default:group:group79:--x",
+
+ "user::rwx\n"
+ "group::r-x\n"
+ "other::r-x\n"
+ "user:user100:r-x:100\n"
+ "user:user1000:---:1000\n"
+ "group:group78:rwx:78\n"
+ "default:user::r-x\n"
+ "default:group::r-x\n"
+ "default:other::---\n"
+ "default:user:user101:r-x:101\n"
+ "default:group:group79:--x:79",
+
+ "u::rwx\n"
+ "g::r-x\n"
+ "o::r-x\n"
+ "u:user100:r-x:100\n"
+ "u:user1000:---:1000\n"
+ "g:group78:rwx:78\n"
+ "d:user::r-x\n"
+ "d:group::r-x\n"
+ "d:other::---\n"
+ "d:user:user101:r-x:101\n"
+ "d:group:group79:--x:79",
+
+ "user::rwx\n"
+ "group::r-x\n"
+ "other::r-x\n"
+ "user:user100:r-x\n"
+ "user:user1000:---\n"
+ "group:group78:rwx",
+
+ "user::rwx,"
+ "group::r-x,"
+ "other::r-x,"
+ "user:user100:r-x,"
+ "user:user1000:---,"
+ "group:group78:rwx",
+
+ "user::rwx\n"
+ "group::r-x\n"
+ "other::r-x\n"
+ "user:user100:r-x:100\n"
+ "user:user1000:---:1000\n"
+ "group:group78:rwx:78",
+
+ "user::r-x\n"
+ "group::r-x\n"
+ "other::---\n"
+ "user:user101:r-x\n"
+ "group:group79:--x",
+
+ "user::r-x\n"
+ "group::r-x\n"
+ "other::---\n"
+ "user:user101:r-x:101\n"
+ "group:group79:--x:79",
+
+ "default:user::r-x\n"
+ "default:group::r-x\n"
+ "default:other::---\n"
+ "default:user:user101:r-x\n"
+ "default:group:group79:--x",
+
+ "user:user77:rw-p--a-R-c-o-:-------:allow\n"
+ "user:user101:-w-pdD--------:fdin---:deny\n"
+ "group:group78:r-----a-R-c---:------I:allow\n"
+ "owner@:rwxp--aARWcCo-:-------:allow\n"
+ "group@:rw-p--a-R-c---:-------:allow\n"
+ "everyone@:r-----a-R-c--s:-------:allow",
+
+ "user:user77:rw-p--a-R-c-o-:-------:allow:77\n"
+ "user:user101:-w-pdD--------:fdin---:deny:101\n"
+ "group:group78:r-----a-R-c---:------I:allow:78\n"
+ "owner@:rwxp--aARWcCo-:-------:allow\n"
+ "group@:rw-p--a-R-c---:-------:allow\n"
+ "everyone@:r-----a-R-c--s:-------:allow",
+
+ "user:user77:rwpaRco::allow:77\n"
+ "user:user101:wpdD:fdin:deny:101\n"
+ "group:group78:raRc:I:allow:78\n"
+ "owner@:rwxpaARWcCo::allow\n"
+ "group@:rwpaRc::allow\n"
+ "everyone@:raRcs::allow"
+};
+
+static wchar_t *
+convert_s_to_ws(const char *s)
+{
+ size_t len;
+ wchar_t *ws = NULL;
+
+ if (s != NULL) {
+ len = strlen(s) + 1;
+ ws = malloc(len * sizeof(wchar_t));
+ assert(mbstowcs(ws, s, len) != (size_t)-1);
+ }
+
+ return (ws);
+}
+
+static void
+compare_acl_text(struct archive_entry *ae, int flags, const char *s)
+{
+ char *text;
+ wchar_t *wtext;
+ wchar_t *ws;
+ ssize_t slen;
+
+ ws = convert_s_to_ws(s);
+
+ text = archive_entry_acl_to_text(ae, &slen, flags);
+ assertEqualString(text, s);
+ if (text != NULL)
+ assertEqualInt(strlen(text), slen);
+ wtext = archive_entry_acl_to_text_w(ae, &slen, flags);
+ assertEqualWString(wtext, ws);
+ if (wtext != NULL) {
+ assertEqualInt(wcslen(wtext), slen);
+ }
+ free(text);
+ free(wtext);
+ free(ws);
+}
+
+DEFINE_TEST(test_acl_from_text)
+{
+ struct archive_entry *ae;
+ wchar_t *ws = NULL;
+
+ /* Create an empty archive_entry. */
+ assert((ae = archive_entry_new()) != NULL);
+
+ /* 1a. Read POSIX.1e access ACLs from text */
+ assertEqualInt(ARCHIVE_OK,
+ archive_entry_acl_from_text(ae, acltext[5],
+ ARCHIVE_ENTRY_ACL_TYPE_ACCESS));
+ assertEntryCompareAcls(ae, acls0, sizeof(acls0)/sizeof(acls0[0]),
+ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, 0755);
+ assertEqualInt(6, archive_entry_acl_reset(ae,
+ ARCHIVE_ENTRY_ACL_TYPE_ACCESS));
+
+ /* 1b. Now read POSIX.1e default ACLs and append them */
+ assertEqualInt(ARCHIVE_OK,
+ archive_entry_acl_from_text(ae, acltext[7],
+ ARCHIVE_ENTRY_ACL_TYPE_DEFAULT));
+ assertEntryCompareAcls(ae, acls0, sizeof(acls0)/sizeof(acls0[0]),
+ ARCHIVE_ENTRY_ACL_TYPE_POSIX1E, 0755);
+ assertEqualInt(11, archive_entry_acl_reset(ae,
+ ARCHIVE_ENTRY_ACL_TYPE_POSIX1E));
+ archive_entry_acl_clear(ae);
+
+ /* 1a and 1b with wide strings */
+ ws = convert_s_to_ws(acltext[5]);
+
+ assertEqualInt(ARCHIVE_OK,
+ archive_entry_acl_from_text_w(ae, ws,
+ ARCHIVE_ENTRY_ACL_TYPE_ACCESS));
+ assertEntryCompareAcls(ae, acls0, sizeof(acls0)/sizeof(acls0[0]),
+ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, 0755);
+ assertEqualInt(6, archive_entry_acl_reset(ae,
+ ARCHIVE_ENTRY_ACL_TYPE_ACCESS));
+
+ free(ws);
+ ws = convert_s_to_ws(acltext[7]);
+
+ assertEqualInt(ARCHIVE_OK,
+ archive_entry_acl_from_text_w(ae, ws,
+ ARCHIVE_ENTRY_ACL_TYPE_DEFAULT));
+ assertEntryCompareAcls(ae, acls0, sizeof(acls0)/sizeof(acls0[0]),
+ ARCHIVE_ENTRY_ACL_TYPE_POSIX1E, 0755);
+ assertEqualInt(11, archive_entry_acl_reset(ae,
+ ARCHIVE_ENTRY_ACL_TYPE_POSIX1E));
+ archive_entry_acl_clear(ae);
+
+ /* 2. Read POSIX.1e default ACLs from text */
+ assertEqualInt(ARCHIVE_OK,
+ archive_entry_acl_from_text(ae, acltext[7],
+ ARCHIVE_ENTRY_ACL_TYPE_DEFAULT));
+ assertEntryCompareAcls(ae, acls0, sizeof(acls0)/sizeof(acls0[0]),
+ ARCHIVE_ENTRY_ACL_TYPE_DEFAULT, 0);
+ assertEqualInt(5, archive_entry_acl_reset(ae,
+ ARCHIVE_ENTRY_ACL_TYPE_DEFAULT));
+ archive_entry_acl_clear(ae);
+
+ /* ws is still acltext[7] */
+ assertEqualInt(ARCHIVE_OK,
+ archive_entry_acl_from_text_w(ae, ws,
+ ARCHIVE_ENTRY_ACL_TYPE_DEFAULT));
+ assertEntryCompareAcls(ae, acls0, sizeof(acls0)/sizeof(acls0[0]),
+ ARCHIVE_ENTRY_ACL_TYPE_DEFAULT, 0);
+ assertEqualInt(5, archive_entry_acl_reset(ae,
+ ARCHIVE_ENTRY_ACL_TYPE_DEFAULT));
+ archive_entry_acl_clear(ae);
+
+ /* 3. Read POSIX.1e access and default ACLs from text */
+ assertEqualInt(ARCHIVE_OK,
+ archive_entry_acl_from_text(ae, acltext[1],
+ ARCHIVE_ENTRY_ACL_TYPE_POSIX1E));
+ assertEntryCompareAcls(ae, acls0, sizeof(acls0)/sizeof(acls0[0]),
+ ARCHIVE_ENTRY_ACL_TYPE_POSIX1E, 0755);
+ assertEqualInt(11, archive_entry_acl_reset(ae,
+ ARCHIVE_ENTRY_ACL_TYPE_POSIX1E));
+ archive_entry_acl_clear(ae);
+
+ free(ws);
+ ws = convert_s_to_ws(acltext[1]);
+ assertEqualInt(ARCHIVE_OK,
+ archive_entry_acl_from_text_w(ae, ws,
+ ARCHIVE_ENTRY_ACL_TYPE_POSIX1E));
+ assertEntryCompareAcls(ae, acls0, sizeof(acls0)/sizeof(acls0[0]),
+ ARCHIVE_ENTRY_ACL_TYPE_POSIX1E, 0755);
+ assertEqualInt(11, archive_entry_acl_reset(ae,
+ ARCHIVE_ENTRY_ACL_TYPE_POSIX1E));
+ archive_entry_acl_clear(ae);
+
+ /* 4. Read POSIX.1e access and default ACLs from text (short form) */
+ assertEqualInt(ARCHIVE_OK,
+ archive_entry_acl_from_text(ae, acltext[2],
+ ARCHIVE_ENTRY_ACL_TYPE_POSIX1E));
+ assertEntryCompareAcls(ae, acls0, sizeof(acls0)/sizeof(acls0[0]),
+ ARCHIVE_ENTRY_ACL_TYPE_POSIX1E, 0755);
+ assertEqualInt(11, archive_entry_acl_reset(ae,
+ ARCHIVE_ENTRY_ACL_TYPE_POSIX1E));
+ archive_entry_acl_clear(ae);
+
+ free(ws);
+ ws = convert_s_to_ws(acltext[2]);
+ assertEqualInt(ARCHIVE_OK,
+ archive_entry_acl_from_text_w(ae, ws,
+ ARCHIVE_ENTRY_ACL_TYPE_POSIX1E));
+ assertEntryCompareAcls(ae, acls0, sizeof(acls0)/sizeof(acls0[0]),
+ ARCHIVE_ENTRY_ACL_TYPE_POSIX1E, 0755);
+ assertEqualInt(11, archive_entry_acl_reset(ae,
+ ARCHIVE_ENTRY_ACL_TYPE_POSIX1E));
+ archive_entry_acl_clear(ae);
+
+ /* 5. Read NFSv4 ACLs from text */
+ assertEqualInt(ARCHIVE_OK,
+ archive_entry_acl_from_text(ae, acltext[10],
+ ARCHIVE_ENTRY_ACL_TYPE_NFS4));
+ assertEntryCompareAcls(ae, acls1, sizeof(acls1)/sizeof(acls1[0]),
+ ARCHIVE_ENTRY_ACL_TYPE_NFS4, 0);
+ assertEqualInt(6, archive_entry_acl_reset(ae,
+ ARCHIVE_ENTRY_ACL_TYPE_NFS4));
+ archive_entry_acl_clear(ae);
+
+ free(ws);
+ ws = convert_s_to_ws(acltext[10]);
+
+ assertEqualInt(ARCHIVE_OK,
+ archive_entry_acl_from_text_w(ae, ws,
+ ARCHIVE_ENTRY_ACL_TYPE_NFS4));
+ assertEntryCompareAcls(ae, acls1, sizeof(acls1)/sizeof(acls1[0]),
+ ARCHIVE_ENTRY_ACL_TYPE_NFS4, 0);
+ assertEqualInt(6, archive_entry_acl_reset(ae,
+ ARCHIVE_ENTRY_ACL_TYPE_NFS4));
+ archive_entry_acl_clear(ae);
+
+ free(ws);
+ archive_entry_free(ae);
+}
+
+DEFINE_TEST(test_acl_to_text)
+{
+ struct archive_entry *ae;
+
+ /* Create an empty archive_entry. */
+ assert((ae = archive_entry_new()) != NULL);
+
+ /* Write POSIX.1e ACLs */
+ assertEntrySetAcls(ae, acls0, sizeof(acls0)/sizeof(acls0[0]));
+
+ /* No flags should give output like getfacl(1) on linux */
+ compare_acl_text(ae, 0, acltext[0]);
+
+ /* This should give the same output as previous test */
+ compare_acl_text(ae, ARCHIVE_ENTRY_ACL_TYPE_ACCESS |
+ ARCHIVE_ENTRY_ACL_TYPE_DEFAULT, acltext[0]);
+
+ /* This should give the same output as previous two tests */
+ compare_acl_text(ae, ARCHIVE_ENTRY_ACL_TYPE_ACCESS |
+ ARCHIVE_ENTRY_ACL_TYPE_DEFAULT |
+ ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT, acltext[0]);
+
+ /* POSIX.1e access and default ACLs with appended ID */
+ compare_acl_text(ae, ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID, acltext[1]);
+
+ /* POSIX.1e access acls only, like getfacl(1) on FreeBSD */
+ compare_acl_text(ae, ARCHIVE_ENTRY_ACL_TYPE_ACCESS, acltext[3]);
+
+ /* POSIX.1e access acls separated with comma */
+ compare_acl_text(ae, ARCHIVE_ENTRY_ACL_TYPE_ACCESS |
+ ARCHIVE_ENTRY_ACL_STYLE_SEPARATOR_COMMA,
+ acltext[4]);
+
+ /* POSIX.1e access acls with appended user or group ID */
+ compare_acl_text(ae, ARCHIVE_ENTRY_ACL_TYPE_ACCESS |
+ ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID, acltext[5]);
+
+ /* POSIX.1e default acls */
+ compare_acl_text(ae, ARCHIVE_ENTRY_ACL_TYPE_DEFAULT, acltext[6]);
+
+ /* POSIX.1e default acls with appended user or group ID */
+ compare_acl_text(ae, ARCHIVE_ENTRY_ACL_TYPE_DEFAULT |
+ ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID, acltext[7]);
+
+ /* POSIX.1e default acls prefixed with default: */
+ compare_acl_text(ae, ARCHIVE_ENTRY_ACL_TYPE_DEFAULT |
+ ARCHIVE_ENTRY_ACL_STYLE_MARK_DEFAULT, acltext[8]);
+
+ /* Write NFSv4 ACLs */
+ assertEntrySetAcls(ae, acls1, sizeof(acls1)/sizeof(acls1[0]));
+
+ /* NFSv4 ACLs like getfacl(1) on FreeBSD */
+ compare_acl_text(ae, 0, acltext[9]);
+
+ /* NFSv4 ACLs like "getfacl -i" on FreeBSD */
+ compare_acl_text(ae, ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID, acltext[10]);
+
+ /* NFSv4 ACLs like "getfacl -i" on FreeBSD with stripped minus chars */
+ compare_acl_text(ae, ARCHIVE_ENTRY_ACL_STYLE_EXTRA_ID |
+ ARCHIVE_ENTRY_ACL_STYLE_COMPACT, acltext[11]);
+
+ archive_entry_free(ae);
+}
Modified: trunk/contrib/libarchive/libarchive/test/test_archive_api_feature.c
===================================================================
--- trunk/contrib/libarchive/libarchive/test/test_archive_api_feature.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/test/test_archive_api_feature.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -42,8 +42,12 @@
if (strlen(buff) < strlen(archive_version_string())) {
p = archive_version_string() + strlen(buff);
failure("Version string is: %s", archive_version_string());
- assert(*p == 'a' || *p == 'b' || *p == 'c' || *p == 'd');
- ++p;
+ if (p[0] == 'd'&& p[1] == 'e' && p[2] == 'v')
+ p += 3;
+ else {
+ assert(*p == 'a' || *p == 'b' || *p == 'c' || *p == 'd');
+ ++p;
+ }
failure("Version string is: %s", archive_version_string());
assert(*p == '\0');
}
Modified: trunk/contrib/libarchive/libarchive/test/test_archive_cmdline.c
===================================================================
--- trunk/contrib/libarchive/libarchive/test/test_archive_cmdline.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/test/test_archive_cmdline.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -66,7 +66,7 @@
assertEqualString("gzip", cl->argv[0]);
assertEqualInt(ARCHIVE_OK, __archive_cmdline_free(cl));
- /* A command line includes space characer. */
+ /* A command line includes space character. */
assert((cl = __archive_cmdline_allocate()) != NULL);
if (cl == NULL)
return;
@@ -78,7 +78,7 @@
assertEqualString("gzip ", cl->argv[0]);
assertEqualInt(ARCHIVE_OK, __archive_cmdline_free(cl));
- /* A command line includes space characer: pattern 2.*/
+ /* A command line includes space character: pattern 2.*/
assert((cl = __archive_cmdline_allocate()) != NULL);
if (cl == NULL)
return;
@@ -90,7 +90,7 @@
assertEqualString("gzip x", cl->argv[0]);
assertEqualInt(ARCHIVE_OK, __archive_cmdline_free(cl));
- /* A command line includes space characer: pattern 3.*/
+ /* A command line includes space character: pattern 3.*/
assert((cl = __archive_cmdline_allocate()) != NULL);
if (cl == NULL)
return;
@@ -103,7 +103,7 @@
assertEqualString("gzip x s ", cl->argv[0]);
assertEqualInt(ARCHIVE_OK, __archive_cmdline_free(cl));
- /* A command line includes space characer: pattern 4.*/
+ /* A command line includes space character: pattern 4.*/
assert((cl = __archive_cmdline_allocate()) != NULL);
if (cl == NULL)
return;
Modified: trunk/contrib/libarchive/libarchive/test/test_archive_read_add_passphrase.c
===================================================================
--- trunk/contrib/libarchive/libarchive/test/test_archive_read_add_passphrase.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/test/test_archive_read_add_passphrase.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -80,7 +80,7 @@
__archive_read_reset_passphrase(ar);
/* Fist call, we should get "pass1" as a passphrase. */
assertEqualString("pass1", __archive_read_next_passphrase(ar));
- /* Second call, we should get NULL which means all the pssphrases
+ /* Second call, we should get NULL which means all the passphrases
* are passed already. */
assertEqualString(NULL, __archive_read_next_passphrase(ar));
@@ -100,7 +100,7 @@
assertEqualString("pass1", __archive_read_next_passphrase(ar));
/* Second call, we should get "pass2" as a passphrase. */
assertEqualString("pass2", __archive_read_next_passphrase(ar));
- /* Third call, we should get NULL which means all the pssphrases
+ /* Third call, we should get NULL which means all the passphrases
* are passed already. */
assertEqualString(NULL, __archive_read_next_passphrase(ar));
@@ -171,7 +171,7 @@
__archive_read_reset_passphrase(ar);
/* Fist call, we should get "passCallBack" as a passphrase. */
assertEqualString("passCallBack", __archive_read_next_passphrase(ar));
- /* Second call, we should get NULL which means all the pssphrases
+ /* Second call, we should get NULL which means all the passphrases
* are passed already. */
assertEqualString(NULL, __archive_read_next_passphrase(ar));
@@ -191,9 +191,9 @@
/* Fist call, we should get "passCallBack" as a passphrase. */
assertEqualString("passCallBack", __archive_read_next_passphrase(ar));
__archive_read_reset_passphrase(ar);
- /* After reset passphrase, we should get "passCallBack"passphrase. */
+ /* After reset passphrase, we should get "passCallBack" passphrase. */
assertEqualString("passCallBack", __archive_read_next_passphrase(ar));
- /* Second call, we should get NULL which means all the pssphrases
+ /* Second call, we should get NULL which means all the passphrases
* are passed already. */
assertEqualString(NULL, __archive_read_next_passphrase(ar));
@@ -218,7 +218,7 @@
assertEqualString("pass2", __archive_read_next_passphrase(ar));
/* Third call, we should get "passCallBack" as a passphrase. */
assertEqualString("passCallBack", __archive_read_next_passphrase(ar));
- /* Fourth call, we should get NULL which means all the pssphrases
+ /* Fourth call, we should get NULL which means all the passphrases
* are passed already. */
assertEqualString(NULL, __archive_read_next_passphrase(ar));
@@ -251,7 +251,7 @@
assertEqualString("pass1", __archive_read_next_passphrase(ar));
/* Third call, we should get "passCallBack" as a passphrase. */
assertEqualString("pass2", __archive_read_next_passphrase(ar));
- /* Fourth call, we should get NULL which means all the pssphrases
+ /* Fourth call, we should get NULL which means all the passphrases
* are passed already. */
assertEqualString(NULL, __archive_read_next_passphrase(ar));
Modified: trunk/contrib/libarchive/libarchive/test/test_archive_read_close_twice_open_filename.c
===================================================================
--- trunk/contrib/libarchive/libarchive/test/test_archive_read_close_twice_open_filename.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/test/test_archive_read_close_twice_open_filename.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -28,10 +28,12 @@
DEFINE_TEST(test_archive_read_close_twice_open_filename)
{
+ const char *filename = "empty.file";
struct archive* a = archive_read_new();
+ assertMakeFile(filename, 0644, "");
assertEqualInt(ARCHIVE_OK, archive_read_support_format_empty(a));
- assertEqualInt(ARCHIVE_OK, archive_read_open_filename(a, 0, 0));
+ assertEqualInt(ARCHIVE_OK, archive_read_open_filename(a, filename, 0));
assertEqualInt(0, archive_errno(a));
assertEqualString(NULL, archive_error_string(a));
Modified: trunk/contrib/libarchive/libarchive/test/test_archive_string.c
===================================================================
--- trunk/contrib/libarchive/libarchive/test/test_archive_string.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/test/test_archive_string.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -67,6 +67,8 @@
assert(&s == archive_string_ensure(&s, EXTENT + 1));
assertNonNULLString(0, 2 * EXTENT, s);
+
+ archive_string_free(&s);
}
static void
@@ -92,6 +94,8 @@
/* non-empty target, non-empty source */
assert(&s == archive_strcat(&s, "baz"));
assertExactString(8, EXTENT, "fubarbaz", s);
+
+ archive_string_free(&s);
}
static void
@@ -109,6 +113,8 @@
/* non-empty target */
archive_strappend_char(&s, 'Y');
assertExactString(2, EXTENT, "XY", s);
+
+ archive_string_free(&s);
}
/* archive_strnXXX() tests focus on length handling.
@@ -134,6 +140,8 @@
/* long read is ok too! */
assert(&s == archive_strncat(&s, "snafu", 8));
assertExactString(13, EXTENT, "snafubarsnafu", s);
+
+ archive_string_free(&s);
}
static void
@@ -155,6 +163,8 @@
/* long read is ok too! */
assert(&s == archive_strncpy(&s, "snafu", 8));
assertExactString(5, EXTENT, "snafu", s);
+
+ archive_string_free(&s);
}
static void
@@ -176,6 +186,8 @@
/* dirty target, empty source */
assert(&s == archive_strcpy(&s, ""));
assertExactString(0, EXTENT, "", s);
+
+ archive_string_free(&s);
}
static void
@@ -222,6 +234,11 @@
archive_string_concat(&t, &s);
assertExactString(5, EXTENT, "snafu", s);
assertExactString(5, EXTENT, "snafu", t);
+
+ archive_string_free(&v);
+ archive_string_free(&u);
+ archive_string_free(&t);
+ archive_string_free(&s);
}
static void
@@ -274,6 +291,11 @@
archive_string_copy(&t, &s);
assertExactString(5, EXTENT, "fubar", s);
assertExactString(5, EXTENT, "fubar", t);
+
+ archive_string_free(&v);
+ archive_string_free(&u);
+ archive_string_free(&t);
+ archive_string_free(&s);
}
static void
@@ -328,6 +350,8 @@
archive_string_empty(&s);
archive_string_sprintf(&s, "%d", 1234567890);
assertExactString(10, 8 * EXTENT, "1234567890", s);
+
+ archive_string_free(&s);
}
DEFINE_TEST(test_archive_string)
Modified: trunk/contrib/libarchive/libarchive/test/test_compat_gtar.c
===================================================================
--- trunk/contrib/libarchive/libarchive/test/test_compat_gtar.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/test/test_compat_gtar.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -106,10 +106,50 @@
assertEqualInt(ARCHIVE_OK, archive_read_free(a));
}
+/*
+ * test_compat_gtar_2.tar exercises reading of UID = 2097152 as base256
+ * and GID = 2097152 as octal without null terminator.
+ */
+static void
+test_compat_gtar_2(void)
+{
+ char name[] = "test_compat_gtar_2.tar";
+ struct archive_entry *ae;
+ struct archive *a;
+ int r;
+ assert((a = archive_read_new()) != NULL);
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_support_filter_all(a));
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a));
+ extract_reference_file(name);
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_open_filename(a, name, 10240));
+
+ /* Read first entry. */
+ assertEqualIntA(a, ARCHIVE_OK, r = archive_read_next_header(a, &ae));
+ if (r != ARCHIVE_OK) {
+ archive_read_free(a);
+ return;
+ }
+
+ /* Check UID and GID */
+ assertEqualInt(2097152, archive_entry_uid(ae));
+ assertEqualInt(2097152, archive_entry_gid(ae));
+
+ /* Verify the end-of-archive. */
+ assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae));
+
+ /* Verify that the format detection worked. */
+ assertEqualInt(archive_filter_code(a, 0), ARCHIVE_FILTER_NONE);
+ assertEqualInt(archive_format(a), ARCHIVE_FORMAT_TAR_GNUTAR);
+
+ assertEqualInt(ARCHIVE_OK, archive_read_close(a));
+ assertEqualInt(ARCHIVE_OK, archive_read_free(a));
+}
+
DEFINE_TEST(test_compat_gtar)
{
test_compat_gtar_1();
+ test_compat_gtar_2();
}
Copied: trunk/contrib/libarchive/libarchive/test/test_compat_gtar_2.tar.uu (from rev 11133, vendor/libarchive/dist/libarchive/test/test_compat_gtar_2.tar.uu)
===================================================================
--- trunk/contrib/libarchive/libarchive/test/test_compat_gtar_2.tar.uu (rev 0)
+++ trunk/contrib/libarchive/libarchive/test/test_compat_gtar_2.tar.uu 2018-06-19 20:42:35 UTC (rev 11134)
@@ -0,0 +1,49 @@
+begin 660 test_compat_gtar_2.tar.uu
+M9FEL95]W:71H7V)I9U]U:61?9VED````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````#`P,#`V-C8`@``````@```Q,#`P,#`P,#`P,#`P,#`P,38W
+M`#$S,#$T-C<R,38W`#`Q,S,U,``@,```````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````````!U<W1A<B`@`'1E<W0`
+M````````````````````````````````````8FEG````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````!4:&ES(&9I;&4@:&%S($=)1#TR,#DW,34R('=H
+M:6-H(&ES(&]N92!O=F5R('1H92!L:6UI="!O9B!T87(@=BXW(&%N9"!'3E4@
+M=&%R('-T;W)E<R!I="!A<R!B87-E(#(U-B!N=6UB97(@*&YO="!O8W1A;"DN
+M"@``````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+7````````````````````````````````
+`
+end
Copied: trunk/contrib/libarchive/libarchive/test/test_compat_perl_archive_tar.c (from rev 11133, vendor/libarchive/dist/libarchive/test/test_compat_perl_archive_tar.c)
===================================================================
--- trunk/contrib/libarchive/libarchive/test/test_compat_perl_archive_tar.c (rev 0)
+++ trunk/contrib/libarchive/libarchive/test/test_compat_perl_archive_tar.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -0,0 +1,66 @@
+/*-
+ * Copyright (c) 2016 Martin Matuska
+ * 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 "test.h"
+__FBSDID("$FreeBSD");
+
+/*
+ * Verify our ability to read sample files created by Perl module Archive::Tar
+ */
+
+DEFINE_TEST(test_compat_perl_archive_tar)
+{
+ char name[] = "test_compat_perl_archive_tar.tar";
+ struct archive_entry *ae;
+ struct archive *a;
+ int r;
+
+ assert((a = archive_read_new()) != NULL);
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_support_filter_all(a));
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a));
+ extract_reference_file(name);
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_open_filename(a, name,
+ 10240));
+
+ /* Read first entry. */
+ assertEqualIntA(a, ARCHIVE_OK, r = archive_read_next_header(a, &ae));
+ if (r != ARCHIVE_OK) {
+ archive_read_free(a);
+ return;
+ }
+ assertEqualString("file1", archive_entry_pathname(ae));
+ assertEqualInt(1480603099, archive_entry_mtime(ae));
+ assertEqualInt(1000, archive_entry_uid(ae));
+ assertEqualString("john", archive_entry_uname(ae));
+ assertEqualInt(1000, archive_entry_gid(ae));
+ assertEqualString("john", archive_entry_gname(ae));
+ assertEqualInt(0100644, archive_entry_mode(ae));
+
+ /* Verify that the format detection worked. */
+ assertEqualInt(archive_filter_code(a, 0), ARCHIVE_FILTER_NONE);
+ assertEqualInt(archive_format(a), ARCHIVE_FORMAT_TAR_USTAR);
+
+ assertEqualInt(ARCHIVE_OK, archive_read_close(a));
+ assertEqualInt(ARCHIVE_OK, archive_read_free(a));
+}
Copied: trunk/contrib/libarchive/libarchive/test/test_compat_perl_archive_tar.tar.uu (from rev 11133, vendor/libarchive/dist/libarchive/test/test_compat_perl_archive_tar.tar.uu)
===================================================================
--- trunk/contrib/libarchive/libarchive/test/test_compat_perl_archive_tar.tar.uu (rev 0)
+++ trunk/contrib/libarchive/libarchive/test/test_compat_perl_archive_tar.tar.uu 2018-06-19 20:42:35 UTC (rev 11134)
@@ -0,0 +1,49 @@
+begin 644 test_compat_perl_archive_tar.tar
+M9FEL93$`````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````#`P,#8T-```,#`Q-S4P```P,#$W-3```"`@("`@("`@("`U
+M`#$S,#(P,#,R-S,S`"`Q,3$R,P`@,```````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````````!U<W1A<@`P,&IO:&X`
+M````````````````````````````````````:F]H;@``````````````````
+M```````````````````P,#`P,#```#`P,#`P,```````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````!A8F-D"@``````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+7````````````````````````````````
+`
+end
Copied: trunk/contrib/libarchive/libarchive/test/test_compat_plexus_archiver_tar.c (from rev 11133, vendor/libarchive/dist/libarchive/test/test_compat_plexus_archiver_tar.c)
===================================================================
--- trunk/contrib/libarchive/libarchive/test/test_compat_plexus_archiver_tar.c (rev 0)
+++ trunk/contrib/libarchive/libarchive/test/test_compat_plexus_archiver_tar.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -0,0 +1,69 @@
+/*-
+ * Copyright (c) 2016 Martin Matuska
+ * 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 "test.h"
+__FBSDID("$FreeBSD");
+
+/*
+ * Verify our ability to read sample files created by plexus-archiver version
+ * 2.6.2 and lower (project switched to Apache Commons Compress with 2.6.3).
+ *
+ * These files may have tar entries with uid and gid header fields filled with
+ * spaces without any octal digit.
+ */
+
+DEFINE_TEST(test_compat_plexus_archiver_tar)
+{
+ char name[] = "test_compat_plexus_archiver_tar.tar";
+ struct archive_entry *ae;
+ struct archive *a;
+ int r;
+
+ assert((a = archive_read_new()) != NULL);
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_support_filter_all(a));
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a));
+ extract_reference_file(name);
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_open_filename(a, name,
+ 10240));
+
+ /* Read first entry. */
+ assertEqualIntA(a, ARCHIVE_OK, r = archive_read_next_header(a, &ae));
+ if (r != ARCHIVE_OK) {
+ archive_read_free(a);
+ return;
+ }
+ assertEqualString("commons-logging-1.2/NOTICE.txt",
+ archive_entry_pathname(ae));
+ assertEqualInt(1404583896, archive_entry_mtime(ae));
+ assertEqualInt(0100664, archive_entry_mode(ae));
+ assertEqualInt(0, archive_entry_uid(ae));
+ assertEqualInt(0, archive_entry_gid(ae));
+
+ /* Verify that the format detection worked. */
+ assertEqualInt(archive_filter_code(a, 0), ARCHIVE_FILTER_NONE);
+ assertEqualInt(archive_format(a), ARCHIVE_FORMAT_TAR_USTAR);
+
+ assertEqualInt(ARCHIVE_OK, archive_read_close(a));
+ assertEqualInt(ARCHIVE_OK, archive_read_free(a));
+}
Copied: trunk/contrib/libarchive/libarchive/test/test_compat_plexus_archiver_tar.tar.uu (from rev 11133, vendor/libarchive/dist/libarchive/test/test_compat_plexus_archiver_tar.tar.uu)
===================================================================
--- trunk/contrib/libarchive/libarchive/test/test_compat_plexus_archiver_tar.tar.uu (rev 0)
+++ trunk/contrib/libarchive/libarchive/test/test_compat_plexus_archiver_tar.tar.uu 2018-06-19 20:42:35 UTC (rev 11134)
@@ -0,0 +1,49 @@
+begin 644 test_compat_plexus_archiver_tar.tar
+M8V]M;6]N<RUL;V=G:6YG+3$N,B].3U1)0T4N='AT````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````#$P,#8V-"``("`@("`@(``@("`@("`@`"`@("`@("`@,C8Q
+M(#$R,S4V,#,W-S,P("`Q-#$U-P`@,```````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````````!U<W1A<@```'1N````
+M````````````````````````````````````=&X`````````````````````
+M```````````````````@("`@(#`@`"`@("`@,"``````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````!!<&%C:&4 at 0V]M;6]N<R!,;V=G:6YG"D-O<'ER
+M:6=H="`R,#`S+3(P,30 at 5&AE($%P86-H92!3;V9T=V%R92!&;W5N9&%T:6]N
+M"@I4:&ES('!R;V1U8W0@:6YC;'5D97,@<V]F='=A<F4 at 9&5V96QO<&5D(&%T
+M"E1H92!!<&%C:&4 at 4V]F='=A<F4 at 1F]U;F1A=&EO;B`H:'1T<#HO+W=W=RYA
+M<&%C:&4N;W)G+RDN"@H`````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+7``````````````````````````````H`
+`
+end
Modified: trunk/contrib/libarchive/libarchive/test/test_compat_solaris_tar_acl.c
===================================================================
--- trunk/contrib/libarchive/libarchive/test/test_compat_solaris_tar_acl.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/test/test_compat_solaris_tar_acl.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -1,5 +1,6 @@
/*-
* Copyright (c) 2003-2009 Tim Kientzle
+ * Copyright (c) 2016 Martin Matuska
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -23,105 +24,243 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: stable/11/contrib/libarchive/libarchive/test/test_compat_solaris_tar_acl.c 232153 2012-02-25 10:58:02Z mm $");
+__FBSDID("$FreeBSD$");
/*
- * Exercise support for reading Solaris-style ACL data
- * from tar archives.
+ * Verify reading entries with POSIX.1e and NFSv4 ACLs from archives created
+ * with Solaris tar.
*
- * This should work on all systems, regardless of whether local
- * filesystems support ACLs or not.
+ * This should work on all systems, regardless of whether local filesystems
+ * support ACLs or not.
*/
+static struct archive_test_acl_t acls0[] = {
+ { ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_WRITE |
+ ARCHIVE_ENTRY_ACL_READ,
+ ARCHIVE_ENTRY_ACL_USER_OBJ, -1, "" },
+ { ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_EXECUTE,
+ ARCHIVE_ENTRY_ACL_USER, 71, "lp" },
+ { ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_READ,
+ ARCHIVE_ENTRY_ACL_USER, 666, "666" },
+ { ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_EXECUTE |
+ ARCHIVE_ENTRY_ACL_WRITE | ARCHIVE_ENTRY_ACL_READ,
+ ARCHIVE_ENTRY_ACL_USER, 1000, "1000" },
+ { ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_READ,
+ ARCHIVE_ENTRY_ACL_GROUP_OBJ, -1, "" },
+ { ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_READ,
+ ARCHIVE_ENTRY_ACL_MASK, -1, ""},
+ { ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_READ,
+ ARCHIVE_ENTRY_ACL_OTHER, -1, "" },
+};
+
+static struct archive_test_acl_t acls1[] = {
+ { ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_EXECUTE |
+ ARCHIVE_ENTRY_ACL_WRITE | ARCHIVE_ENTRY_ACL_READ,
+ ARCHIVE_ENTRY_ACL_USER_OBJ, -1, "" },
+ { ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_EXECUTE |
+ ARCHIVE_ENTRY_ACL_WRITE | ARCHIVE_ENTRY_ACL_READ,
+ ARCHIVE_ENTRY_ACL_USER, 2, "bin" },
+ { ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_EXECUTE |
+ ARCHIVE_ENTRY_ACL_READ,
+ ARCHIVE_ENTRY_ACL_GROUP_OBJ, -1, "" },
+ { ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_EXECUTE |
+ ARCHIVE_ENTRY_ACL_READ,
+ ARCHIVE_ENTRY_ACL_GROUP, 3, "sys" },
+ { ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_EXECUTE |
+ ARCHIVE_ENTRY_ACL_READ,
+ ARCHIVE_ENTRY_ACL_MASK, -1, ""},
+ { ARCHIVE_ENTRY_ACL_TYPE_ACCESS, 0,
+ ARCHIVE_ENTRY_ACL_OTHER, -1, "" },
+};
+
+static struct archive_test_acl_t acls2[] = {
+ { ARCHIVE_ENTRY_ACL_TYPE_DEFAULT, ARCHIVE_ENTRY_ACL_EXECUTE |
+ ARCHIVE_ENTRY_ACL_WRITE | ARCHIVE_ENTRY_ACL_READ,
+ ARCHIVE_ENTRY_ACL_USER_OBJ, -1 ,"" },
+ { ARCHIVE_ENTRY_ACL_TYPE_DEFAULT, ARCHIVE_ENTRY_ACL_EXECUTE |
+ ARCHIVE_ENTRY_ACL_WRITE | ARCHIVE_ENTRY_ACL_READ,
+ ARCHIVE_ENTRY_ACL_USER, 2, "bin" },
+ { ARCHIVE_ENTRY_ACL_TYPE_DEFAULT, ARCHIVE_ENTRY_ACL_EXECUTE |
+ ARCHIVE_ENTRY_ACL_READ,
+ ARCHIVE_ENTRY_ACL_GROUP_OBJ, -1, "" },
+ { ARCHIVE_ENTRY_ACL_TYPE_DEFAULT, ARCHIVE_ENTRY_ACL_EXECUTE |
+ ARCHIVE_ENTRY_ACL_READ,
+ ARCHIVE_ENTRY_ACL_GROUP, 3, "sys" },
+ { ARCHIVE_ENTRY_ACL_TYPE_DEFAULT, ARCHIVE_ENTRY_ACL_EXECUTE |
+ ARCHIVE_ENTRY_ACL_WRITE | ARCHIVE_ENTRY_ACL_READ,
+ ARCHIVE_ENTRY_ACL_MASK, -1, ""},
+ { ARCHIVE_ENTRY_ACL_TYPE_DEFAULT, 0,
+ ARCHIVE_ENTRY_ACL_OTHER, -1, "" },
+};
+
+static struct archive_test_acl_t acls3[] = {
+ { ARCHIVE_ENTRY_ACL_TYPE_DENY,
+ ARCHIVE_ENTRY_ACL_EXECUTE |
+ ARCHIVE_ENTRY_ACL_READ_DATA |
+ ARCHIVE_ENTRY_ACL_WRITE_DATA |
+ ARCHIVE_ENTRY_ACL_APPEND_DATA |
+ ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES |
+ ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES |
+ ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS |
+ ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS |
+ ARCHIVE_ENTRY_ACL_READ_ACL |
+ ARCHIVE_ENTRY_ACL_WRITE_ACL |
+ ARCHIVE_ENTRY_ACL_WRITE_OWNER |
+ ARCHIVE_ENTRY_ACL_SYNCHRONIZE,
+ ARCHIVE_ENTRY_ACL_GROUP, 12, "daemon" },
+ { ARCHIVE_ENTRY_ACL_TYPE_ALLOW,
+ ARCHIVE_ENTRY_ACL_EXECUTE |
+ ARCHIVE_ENTRY_ACL_READ_DATA |
+ ARCHIVE_ENTRY_ACL_WRITE_DATA |
+ ARCHIVE_ENTRY_ACL_APPEND_DATA |
+ ARCHIVE_ENTRY_ACL_SYNCHRONIZE,
+ ARCHIVE_ENTRY_ACL_GROUP, 2, "bin" },
+ { ARCHIVE_ENTRY_ACL_TYPE_ALLOW,
+ ARCHIVE_ENTRY_ACL_READ_DATA |
+ ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES |
+ ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS |
+ ARCHIVE_ENTRY_ACL_READ_ACL |
+ ARCHIVE_ENTRY_ACL_SYNCHRONIZE,
+ ARCHIVE_ENTRY_ACL_USER, 4, "adm" },
+ { ARCHIVE_ENTRY_ACL_TYPE_ALLOW,
+ ARCHIVE_ENTRY_ACL_READ_DATA |
+ ARCHIVE_ENTRY_ACL_WRITE_DATA |
+ ARCHIVE_ENTRY_ACL_APPEND_DATA |
+ ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES |
+ ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES |
+ ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS |
+ ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS |
+ ARCHIVE_ENTRY_ACL_READ_ACL |
+ ARCHIVE_ENTRY_ACL_WRITE_ACL |
+ ARCHIVE_ENTRY_ACL_WRITE_OWNER |
+ ARCHIVE_ENTRY_ACL_SYNCHRONIZE,
+ ARCHIVE_ENTRY_ACL_USER_OBJ, 0, "" },
+ { ARCHIVE_ENTRY_ACL_TYPE_ALLOW,
+ ARCHIVE_ENTRY_ACL_READ_DATA |
+ ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES |
+ ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS |
+ ARCHIVE_ENTRY_ACL_READ_ACL |
+ ARCHIVE_ENTRY_ACL_SYNCHRONIZE,
+ ARCHIVE_ENTRY_ACL_GROUP_OBJ, 0, "" },
+ { ARCHIVE_ENTRY_ACL_TYPE_ALLOW,
+ ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES |
+ ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS |
+ ARCHIVE_ENTRY_ACL_READ_ACL |
+ ARCHIVE_ENTRY_ACL_SYNCHRONIZE,
+ ARCHIVE_ENTRY_ACL_EVERYONE, 0, "" },
+};
+
+static struct archive_test_acl_t acls4[] = {
+ { ARCHIVE_ENTRY_ACL_TYPE_ALLOW,
+ ARCHIVE_ENTRY_ACL_EXECUTE |
+ ARCHIVE_ENTRY_ACL_READ_DATA |
+ ARCHIVE_ENTRY_ACL_WRITE_DATA |
+ ARCHIVE_ENTRY_ACL_APPEND_DATA |
+ ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES |
+ ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES |
+ ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS |
+ ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS |
+ ARCHIVE_ENTRY_ACL_READ_ACL |
+ ARCHIVE_ENTRY_ACL_WRITE_ACL |
+ ARCHIVE_ENTRY_ACL_WRITE_OWNER |
+ ARCHIVE_ENTRY_ACL_SYNCHRONIZE |
+ ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT |
+ ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT |
+ ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY,
+ ARCHIVE_ENTRY_ACL_USER, 1100, "1100" },
+ { ARCHIVE_ENTRY_ACL_TYPE_ALLOW,
+ ARCHIVE_ENTRY_ACL_READ_DATA |
+ ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES |
+ ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS |
+ ARCHIVE_ENTRY_ACL_READ_ACL |
+ ARCHIVE_ENTRY_ACL_SYNCHRONIZE |
+ ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT |
+ ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT,
+ ARCHIVE_ENTRY_ACL_GROUP, 4, "adm" },
+ { ARCHIVE_ENTRY_ACL_TYPE_ALLOW,
+ ARCHIVE_ENTRY_ACL_EXECUTE |
+ ARCHIVE_ENTRY_ACL_READ_DATA |
+ ARCHIVE_ENTRY_ACL_WRITE_DATA |
+ ARCHIVE_ENTRY_ACL_APPEND_DATA |
+ ARCHIVE_ENTRY_ACL_DELETE_CHILD |
+ ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES |
+ ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES |
+ ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS |
+ ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS |
+ ARCHIVE_ENTRY_ACL_READ_ACL |
+ ARCHIVE_ENTRY_ACL_WRITE_ACL |
+ ARCHIVE_ENTRY_ACL_WRITE_OWNER |
+ ARCHIVE_ENTRY_ACL_SYNCHRONIZE,
+ ARCHIVE_ENTRY_ACL_USER_OBJ, 0, "" },
+ { ARCHIVE_ENTRY_ACL_TYPE_ALLOW,
+ ARCHIVE_ENTRY_ACL_EXECUTE |
+ ARCHIVE_ENTRY_ACL_READ_DATA |
+ ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES |
+ ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS |
+ ARCHIVE_ENTRY_ACL_READ_ACL |
+ ARCHIVE_ENTRY_ACL_SYNCHRONIZE,
+ ARCHIVE_ENTRY_ACL_GROUP_OBJ, 0, "" },
+ { ARCHIVE_ENTRY_ACL_TYPE_ALLOW,
+ ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES |
+ ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS |
+ ARCHIVE_ENTRY_ACL_READ_ACL |
+ ARCHIVE_ENTRY_ACL_SYNCHRONIZE,
+ ARCHIVE_ENTRY_ACL_EVERYONE, 0, "" },
+};
+
DEFINE_TEST(test_compat_solaris_tar_acl)
{
+ char name[] = "test_compat_solaris_tar_acl.tar";
struct archive *a;
struct archive_entry *ae;
- const char *reference1 = "test_compat_solaris_tar_acl.tar";
- int type, permset, tag, qual;
- const char *name;
- /* Sample file generated on Solaris 10 */
- extract_reference_file(reference1);
+ /* Read archive file */
assert(NULL != (a = archive_read_new()));
- assertA(0 == archive_read_support_format_all(a));
- assertA(0 == archive_read_support_filter_all(a));
- assertA(0 == archive_read_open_filename(a, reference1, 512));
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_support_filter_all(a));
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a));
+ extract_reference_file(name);
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_open_filename(a, name,
+ 10240));
- /* Archive has 1 entry with some ACLs set on it. */
+ /* First item has access ACLs */
assertA(0 == archive_read_next_header(a, &ae));
+ failure("One extended ACL should flag all ACLs to be returned.");
+ assertEqualInt(7, archive_entry_acl_reset(ae,
+ ARCHIVE_ENTRY_ACL_TYPE_ACCESS));
+ assertEntryCompareAcls(ae, acls0, sizeof(acls0)/sizeof(acls0[0]),
+ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, 0644);
failure("Basic ACLs should set mode to 0644, not %04o",
archive_entry_mode(ae)&0777);
- assertEqualInt((archive_entry_mode(ae) & 0777), 0644);
- assertEqualInt(7, archive_entry_acl_reset(ae,
- ARCHIVE_ENTRY_ACL_TYPE_ACCESS));
- assertEqualInt(ARCHIVE_OK, archive_entry_acl_next(ae,
- ARCHIVE_ENTRY_ACL_TYPE_ACCESS,
- &type, &permset, &tag, &qual, &name));
- assertEqualInt(ARCHIVE_ENTRY_ACL_TYPE_ACCESS, type);
- assertEqualInt(006, permset);
- assertEqualInt(ARCHIVE_ENTRY_ACL_USER_OBJ, tag);
- assertEqualInt(-1, qual);
- assert(name == NULL);
+ assert((archive_entry_mode(ae) & 0777) == 0644);
- assertEqualInt(ARCHIVE_OK, archive_entry_acl_next(ae,
- ARCHIVE_ENTRY_ACL_TYPE_ACCESS,
- &type, &permset, &tag, &qual, &name));
- assertEqualInt(ARCHIVE_ENTRY_ACL_TYPE_ACCESS, type);
- assertEqualInt(004, permset);
- assertEqualInt(ARCHIVE_ENTRY_ACL_GROUP_OBJ, tag);
- assertEqualInt(-1, qual);
- assert(name == NULL);
+ /* Second item has default and access ACLs */
+ assertA(0 == archive_read_next_header(a, &ae));
+ assertEqualInt(6, archive_entry_acl_reset(ae,
+ ARCHIVE_ENTRY_ACL_TYPE_ACCESS));
+ assertEntryCompareAcls(ae, acls1, sizeof(acls1)/sizeof(acls1[0]),
+ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, 0750);
+ failure("Basic ACLs should set mode to 0750, not %04o",
+ archive_entry_mode(ae)&0777);
+ assert((archive_entry_mode(ae) & 0777) == 0750);
+ assertEqualInt(6, archive_entry_acl_reset(ae,
+ ARCHIVE_ENTRY_ACL_TYPE_DEFAULT));
+ assertEntryCompareAcls(ae, acls2, sizeof(acls2)/sizeof(acls2[0]),
+ ARCHIVE_ENTRY_ACL_TYPE_DEFAULT, 0750);
- assertEqualInt(ARCHIVE_OK, archive_entry_acl_next(ae,
- ARCHIVE_ENTRY_ACL_TYPE_ACCESS,
- &type, &permset, &tag, &qual, &name));
- assertEqualInt(ARCHIVE_ENTRY_ACL_TYPE_ACCESS, type);
- assertEqualInt(004, permset);
- assertEqualInt(ARCHIVE_ENTRY_ACL_OTHER, tag);
- assertEqualInt(-1, qual);
- assert(name == NULL);
+ /* Third item has NFS4 ACLs */
+ assertA(0 == archive_read_next_header(a, &ae));
+ assertEqualInt(6, archive_entry_acl_reset(ae,
+ ARCHIVE_ENTRY_ACL_TYPE_NFS4));
+ assertEntryCompareAcls(ae, acls3, sizeof(acls3)/sizeof(acls3[0]),
+ ARCHIVE_ENTRY_ACL_TYPE_NFS4, 0);
- assertEqualInt(ARCHIVE_OK, archive_entry_acl_next(ae,
- ARCHIVE_ENTRY_ACL_TYPE_ACCESS,
- &type, &permset, &tag, &qual, &name));
- assertEqualInt(ARCHIVE_ENTRY_ACL_TYPE_ACCESS, type);
- assertEqualInt(001, permset);
- assertEqualInt(ARCHIVE_ENTRY_ACL_USER, tag);
- assertEqualInt(71, qual);
- assertEqualString(name, "lp");
+ /* Fourth item has NFS4 ACLs and inheritance flags */
+ assertA(0 == archive_read_next_header(a, &ae));
+ assertEqualInt(5, archive_entry_acl_reset(ae,
+ ARCHIVE_ENTRY_ACL_TYPE_NFS4));
+ assertEntryCompareAcls(ae, acls4, sizeof(acls4)/sizeof(acls0[4]),
+ ARCHIVE_ENTRY_ACL_TYPE_NFS4, 0);
- assertEqualInt(ARCHIVE_OK, archive_entry_acl_next(ae,
- ARCHIVE_ENTRY_ACL_TYPE_ACCESS,
- &type, &permset, &tag, &qual, &name));
- assertEqualInt(ARCHIVE_ENTRY_ACL_TYPE_ACCESS, type);
- assertEqualInt(004, permset);
- assertEqualInt(ARCHIVE_ENTRY_ACL_USER, tag);
- assertEqualInt(666, qual);
- assertEqualString(name, "666");
-
- assertEqualInt(ARCHIVE_OK, archive_entry_acl_next(ae,
- ARCHIVE_ENTRY_ACL_TYPE_ACCESS,
- &type, &permset, &tag, &qual, &name));
- assertEqualInt(ARCHIVE_ENTRY_ACL_TYPE_ACCESS, type);
- assertEqualInt(007, permset);
- assertEqualInt(ARCHIVE_ENTRY_ACL_USER, tag);
- assertEqualInt(1000, qual);
- assertEqualString(name, "trasz");
-
- assertEqualInt(ARCHIVE_OK, archive_entry_acl_next(ae,
- ARCHIVE_ENTRY_ACL_TYPE_ACCESS,
- &type, &permset, &tag, &qual, &name));
- assertEqualInt(ARCHIVE_ENTRY_ACL_TYPE_ACCESS, type);
- assertEqualInt(004, permset);
- assertEqualInt(ARCHIVE_ENTRY_ACL_MASK, tag);
- assertEqualInt(-1, qual);
- assertEqualString(name, NULL);
-
- assertEqualInt(ARCHIVE_EOF, archive_entry_acl_next(ae,
- ARCHIVE_ENTRY_ACL_TYPE_ACCESS,
- &type, &permset, &tag, &qual, &name));
-
/* Close the archive. */
assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
assertEqualInt(ARCHIVE_OK, archive_read_free(a));
Modified: trunk/contrib/libarchive/libarchive/test/test_compat_solaris_tar_acl.tar.uu
===================================================================
--- trunk/contrib/libarchive/libarchive/test/test_compat_solaris_tar_acl.tar.uu 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/test/test_compat_solaris_tar_acl.tar.uu 2018-06-19 20:42:35 UTC (rev 11134)
@@ -1,61 +1,163 @@
-$FreeBSD: stable/11/contrib/libarchive/libarchive/test/test_compat_solaris_tar_acl.tar.uu 228763 2011-12-21 11:13:29Z mm $
-begin 644 test_acl_solaris.tar
-M9FEL92UW:71H+7!O<VEX+6%C;',`````````````````````````````````
-M````````````````````````````````````````````````````````````
-M`````````````#`P,#`V-#0`,#`P,3<U,``P,#`P,#`P`#`P,#`P,#`P,30T
-M`#$Q,3<T-C`T,34W`#`P,34Q-S8`00``````````````````````````````
-M````````````````````````````````````````````````````````````
-M``````````````````````````````````````````!U<W1A<@`P,'1R87-Z
-M````````````````````````````````````<F]O=```````````````````
-M```````````````````P,#`P,C$P`#`P,#`P,3``````````````````````
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M```````````````````````Q,#`P,#`W`'5S97(Z.G)W+2QU<V5R.FQP.BTM
-M>#HW,2QU<V5R.C8V-CIR+2TZ-C8V+'5S97(Z=')A<WHZ<G=X.C$P,#`L9W)O
-M=7`Z.G(M+2QM87-K.G(M+2QO=&AE<CIR+2T``````````3````````/-@```
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M````````````````````````````!%&8`````````&L`````,3`P,#`P-P!U
+begin 644 test_compat_solaris_tar_acl.tar
+M9FEL92UW:71H+7!O<VEX+6%C;',
+M
+M # P,# V-#0 ,# P,3<U, P,# P,# P # P,# P,# P,30S
+M #$Q,3<T-C T,34W # P,30Q,C$ 00
+M
+M !U<W1A<@ P,
+M <F]O=
+M P,# P-#$T # P,# P,#,
+M
+M
+M
+M Q,# P,# W '5S97(Z.G)W+2QU<V5R.FQP.BTM
+M>#HW,2QU<V5R.C8V-CIR+2TZ-C8V+'5S97(Z,3 P,#IR=W at Z,3 P,"QG<F]U
+M<#HZ<BTM+&UA<VLZ<BTM+&]T:&5R.G(M+0 # !
+M
+M
+M
+M
+M
+M
+M (Q@@( &L ,3 P,# P-P!U
M<V5R.CIR=RTL=7-E<CIL<#HM+7 at Z-S$L=7-E<CHV-C8Z<BTM.C8V-BQU<V5R
-M.G1R87-Z.G)W>#HQ,#`P+&=R;W5P.CIR+2TL;6%S:SIR+69I;&4M=VET:"UP
-M;W-I>"UA8VQS````````````````````````````````````````````````
-M```````````````````````````````````````````````````````````P
-M,#`P-C0T`#`P,#$W-3``,#`P,#`P,``P,#`P,#`P,#`P,``Q,3$W-#8P-#$U
-M-P`P,#$U,30T`#``````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M````````````````````````````=7-T87(`,#!T<F%S>@``````````````
-M`````````````````````')O;W0`````````````````````````````````
-M````,#`P,#(Q,``P,#`P,#$P````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-M````````````````````````````````````````````````````````````
-H````````````````````````````````````````````````````````
-`
+M.C$P,# Z<G=X.C$P,# L9W)O=7 Z.G(M+2QM87-K.G(M+69I;&4M=VET:"UP
+M;W-I>"UA8VQS
+M P
+M,# P-C0T # P,#$W-3 ,# P,# P, P,# P,# P,# P, Q,3$W-#8P-#$U
+M-P P,#$T,#<P #
+M
+M =7-T87( ,#
+M ')O;W0
+M ,# P,#0Q- P,# P,# S
+M
+M
+M
+M 9&ER+7=I=&@M<&]S:7 at M86-L<R\
+M
+M # P,# W-3 ,# P,3<U, P,# P,# P # P,# P
+M,# P,S P #$S,#,V-3$R,C4T # P,30P,C, 00
+M
+M !U<W1A<@ P
+M, <F]O=
+M P,# P-#$T # P,# P,#,
+M
+M
+M
+M Q,# P,#$T '5S97(Z.G)W>"QU<V5R
+M.F)I;CIR=W at Z,BQG<F]U<#HZ<BUX+&=R;W5P.G-Y<SIR+7 at Z,RQM87-K.G(M
+M>"QO=&AE<CHM+2TL9&5F875L='5S97(Z.G)W>"QD969A=6QT=7-E<CIB:6XZ
+M<G=X.C(L9&5F875L=&=R;W5P.CIR+7 at L9&5F875L=&=R;W5P.G-Y<SIR+7 at Z
+M,RQD969A=6QT;6%S:SIR=W at L9&5F875L=&]T:&5R.BTM+0 @ #C%
+M" @
+M
+M
+M
+M
+M
+M &1I<BUW
+M:71H+7!O<VEX+6%C;',O
+M
+M P,# P-S4P # P,#$W-3 ,# P,# P, P,# P,# P,# P, Q,S S
+M-C4Q,C(U- P,#$T,# T #4
+M
+M =7-T87( ,#
+M ')O;W0
+M ,# P,#0Q- P,# P,# S
+M
+M
+M
+M 9FEL92UW:71H+6YF<W8T+6%C;',
+M
+M # P,# V-# ,# P,3<U, P,# P,# P
+M # P,# P,# P,S8T #$S,#,V-3$S-C0Q # P,30P,34 00
+M
+M !U
+M<W1A<@ P, <F]O=
+M P,# P-#$T # R,# P,#(
+M
+M
+M
+M S,# P,# V &=R;W5P.F1A
+M96UO;CIR=WAP+2UA05)78T-O<SHM+2TM+2TM.F1E;GDZ,3(L9W)O=7 Z8FEN
+M.G)W>' M+2TM+2TM+2US.BTM+2TM+2TZ86QL;W<Z,BQU<V5R.F%D;3IR+2TM
+M+2UA+5(M8RTM<SHM+2TM+2TM.F%L;&]W.C0L;W=N97) .G)W+7 M+6%!4E=C
+M0V]S.BTM+2TM+2TZ86QL;W<L9W)O=7! .G(M+2TM+6$M4BUC+2US.BTM+2TM
+M+2TZ86QL;W<L979E<GEO;F5 .BTM+2TM+6$M4BUC+2US.BTM+2TM+2TZ86QL
+M;W< &@
+M
+M F-8(" #[ #,P,# P,#8
+M9W)O=7 Z9&%E;6]N.G)W>' M+6%!4E=C0V]S.BTM+2TM+2TZ9&5N>3HQ,BQG
+M<F]U<#IB:6XZ<G=X<"TM+2TM+2TM+7,Z+2TM+2TM+3IA;&QO=SHR+'5S97(Z
+M861M.G(M+2TM+6$M4BUC+2US.BTM+2TM+2TZ86QL;W<Z-"QO=VYE<D Z<G<M
+M<&9I;&4M=VET:"UN9G-V-"UA8VQS
+M
+M P,# P-C0P # P,#$W-3 ,# P,# P, P,# P,# P,# P
+M, Q,S S-C4Q,S8T,0 P,#$S-S4W #
+M
+M =7-T87( ,#
+M ')O;W0
+M ,# P,#0Q- P,C P,# R
+M
+M
+M
+M 9&ER+7=I=&@M;F9S=C0M86-L<R\
+M
+M # P,# W-3 ,# P,# P, P
+M,# P,# P # P,# P,# P,S$T #$S,#,V-3$S-S,U # P,30V,C, 00
+M
+M
+M !U<W1A<@ P,')O;W0
+M<F]O= P,# P-#$T # R,# P
+M,#(
+M
+M
+M S,# P,# U '5S
+M97(Z,3$P,#IR=WAP+2UA05)78T-O<SIF9&DM+2TM.F%L;&]W.C$Q,# L9W)O
+M=7 Z861M.G(M+2TM+6$M4BUC+2US.F9D+2TM+2TZ86QL;W<Z-"QO=VYE<D Z
+M<G=X<"U$84%25V-#;W,Z+2TM+2TM+3IA;&QO=RQG<F]U<$ Z<BUX+2TM82U2
+M+6,M+7,Z+2TM+2TM+3IA;&QO=RQE=F5R>6]N94 Z+2TM+2TM82U2+6,M+7,Z
+M+2TM+2TM+3IA;&QO=P 4
+M
+M "HUP@( -, ,S P,# P-0!U<V5R.C$Q,# Z<G=X
+M<"TM84%25V-#;W,Z9F1I+2TM+3IA;&QO=SHQ,3 P+&=R;W5P.F%D;3IR+2TM
+M+2UA+5(M8RTM<SIF9"TM+2TM.F%L;&]W.C0L;W=N97) .G)W>' M1&%!4E=C
+M0V]S.BTM+2TM+2TZ86QL;W<L9W)O=7! .G(M>"TM+6$M4BUC+2US.BTM+2TM
+M+2TZ86QL;W<L979E<GEO;F5 .BTM+2TM+6$M4BUC+2US.BTM+2TM+2TZ86QL
+M;W< &1I<BUW:71H+6YF<W8T+6%C;',O
+M
+M P,# P-S4P # P,# P,# ,# P,# P, P,# P
+M,# P,# P, Q,S S-C4Q,S<S-0 P,#$T-3<W #4
+M
+M =7-T87(
+M,#!R;V]T ')O;W0
+M ,# P,#0Q- P,C P,# R
+M
+M
+M
+M
+M
+M
+M
+M
+M
+M
+M
+M
+M
+M
+M
+M
+M
+M
+M
+M
+M
+M
+M
+M
+M
+M
+-
+
end
Copied: trunk/contrib/libarchive/libarchive/test/test_compat_star_acl.c (from rev 11133, vendor/libarchive/dist/libarchive/test/test_compat_star_acl.c)
===================================================================
--- trunk/contrib/libarchive/libarchive/test/test_compat_star_acl.c (rev 0)
+++ trunk/contrib/libarchive/libarchive/test/test_compat_star_acl.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -0,0 +1,321 @@
+/*-
+ * Copyright (c) 2003-2007 Tim Kientzle
+ * Copyright (c) 2016 Martin Matuska
+ * 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 "test.h"
+__FBSDID("$FreeBSD$");
+
+/*
+ * Verify reading entries with POSIX.1e and NFSv4 ACLs from archives created
+ * by star.
+ *
+ * This should work on all systems, regardless of whether local filesystems
+ * support ACLs or not.
+ */
+
+static struct archive_test_acl_t acls0[] = {
+ { ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_EXECUTE,
+ ARCHIVE_ENTRY_ACL_USER_OBJ, -1, "" },
+ { ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_READ,
+ ARCHIVE_ENTRY_ACL_USER, -1, "user77" },
+ { ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_READ,
+ ARCHIVE_ENTRY_ACL_GROUP_OBJ, -1, "" },
+ { ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_READ,
+ ARCHIVE_ENTRY_ACL_MASK, -1, ""},
+ { ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_WRITE,
+ ARCHIVE_ENTRY_ACL_OTHER, -1, "" },
+};
+
+static struct archive_test_acl_t acls1[] = {
+ { ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_EXECUTE | ARCHIVE_ENTRY_ACL_READ,
+ ARCHIVE_ENTRY_ACL_USER_OBJ, -1, "" },
+ { ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_READ,
+ ARCHIVE_ENTRY_ACL_USER, -1, "user77" },
+ { ARCHIVE_ENTRY_ACL_TYPE_ACCESS, 0,
+ ARCHIVE_ENTRY_ACL_USER, -1, "user78" },
+ { ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_READ,
+ ARCHIVE_ENTRY_ACL_GROUP_OBJ, -1, "" },
+ { ARCHIVE_ENTRY_ACL_TYPE_ACCESS, 0007,
+ ARCHIVE_ENTRY_ACL_GROUP, -1, "group78" },
+ { ARCHIVE_ENTRY_ACL_TYPE_ACCESS, 0007,
+ ARCHIVE_ENTRY_ACL_MASK, -1, ""},
+ { ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_WRITE | ARCHIVE_ENTRY_ACL_EXECUTE,
+ ARCHIVE_ENTRY_ACL_OTHER, -1, "" },
+};
+
+static struct archive_test_acl_t acls2[] = {
+ { ARCHIVE_ENTRY_ACL_TYPE_DEFAULT, ARCHIVE_ENTRY_ACL_EXECUTE,
+ ARCHIVE_ENTRY_ACL_USER_OBJ, -1 ,"" },
+ { ARCHIVE_ENTRY_ACL_TYPE_DEFAULT, ARCHIVE_ENTRY_ACL_READ,
+ ARCHIVE_ENTRY_ACL_USER, -1, "user77" },
+ { ARCHIVE_ENTRY_ACL_TYPE_DEFAULT, ARCHIVE_ENTRY_ACL_READ,
+ ARCHIVE_ENTRY_ACL_GROUP_OBJ, -1, "" },
+ { ARCHIVE_ENTRY_ACL_TYPE_DEFAULT, ARCHIVE_ENTRY_ACL_EXECUTE,
+ ARCHIVE_ENTRY_ACL_GROUP, -1, "group78" },
+ { ARCHIVE_ENTRY_ACL_TYPE_DEFAULT, ARCHIVE_ENTRY_ACL_READ | ARCHIVE_ENTRY_ACL_EXECUTE,
+ ARCHIVE_ENTRY_ACL_MASK, -1, ""},
+ { ARCHIVE_ENTRY_ACL_TYPE_DEFAULT, ARCHIVE_ENTRY_ACL_WRITE,
+ ARCHIVE_ENTRY_ACL_OTHER, -1, "" },
+};
+
+static struct archive_test_acl_t acls3[] = {
+ { ARCHIVE_ENTRY_ACL_TYPE_ALLOW,
+ ARCHIVE_ENTRY_ACL_READ_DATA |
+ ARCHIVE_ENTRY_ACL_WRITE_DATA |
+ ARCHIVE_ENTRY_ACL_EXECUTE |
+ ARCHIVE_ENTRY_ACL_APPEND_DATA |
+ ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES |
+ ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES |
+ ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS |
+ ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS |
+ ARCHIVE_ENTRY_ACL_READ_ACL |
+ ARCHIVE_ENTRY_ACL_WRITE_ACL |
+ ARCHIVE_ENTRY_ACL_WRITE_OWNER |
+ ARCHIVE_ENTRY_ACL_SYNCHRONIZE,
+ ARCHIVE_ENTRY_ACL_USER_OBJ, 0, "" },
+ { ARCHIVE_ENTRY_ACL_TYPE_ALLOW,
+ ARCHIVE_ENTRY_ACL_READ_DATA |
+ ARCHIVE_ENTRY_ACL_WRITE_DATA |
+ ARCHIVE_ENTRY_ACL_APPEND_DATA |
+ ARCHIVE_ENTRY_ACL_READ_ACL |
+ ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES |
+ ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS |
+ ARCHIVE_ENTRY_ACL_READ_ACL |
+ ARCHIVE_ENTRY_ACL_SYNCHRONIZE,
+ ARCHIVE_ENTRY_ACL_GROUP_OBJ, 0, "" },
+ { ARCHIVE_ENTRY_ACL_TYPE_ALLOW,
+ ARCHIVE_ENTRY_ACL_READ_DATA |
+ ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES |
+ ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS |
+ ARCHIVE_ENTRY_ACL_READ_ACL |
+ ARCHIVE_ENTRY_ACL_SYNCHRONIZE,
+ ARCHIVE_ENTRY_ACL_EVERYONE, 0, "" },
+};
+
+static struct archive_test_acl_t acls4[] = {
+ { ARCHIVE_ENTRY_ACL_TYPE_ALLOW,
+ ARCHIVE_ENTRY_ACL_READ_DATA |
+ ARCHIVE_ENTRY_ACL_WRITE_DATA |
+ ARCHIVE_ENTRY_ACL_APPEND_DATA |
+ ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES |
+ ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES |
+ ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS |
+ ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS |
+ ARCHIVE_ENTRY_ACL_READ_ACL |
+ ARCHIVE_ENTRY_ACL_WRITE_ACL |
+ ARCHIVE_ENTRY_ACL_WRITE_OWNER |
+ ARCHIVE_ENTRY_ACL_SYNCHRONIZE,
+ ARCHIVE_ENTRY_ACL_USER_OBJ, 0, "" },
+ { ARCHIVE_ENTRY_ACL_TYPE_ALLOW,
+ ARCHIVE_ENTRY_ACL_READ_DATA |
+ ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES |
+ ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS |
+ ARCHIVE_ENTRY_ACL_READ_ACL |
+ ARCHIVE_ENTRY_ACL_SYNCHRONIZE |
+ ARCHIVE_ENTRY_ACL_ENTRY_INHERITED,
+ ARCHIVE_ENTRY_ACL_USER, 77, "user77" },
+ { ARCHIVE_ENTRY_ACL_TYPE_DENY,
+ ARCHIVE_ENTRY_ACL_READ_DATA |
+ ARCHIVE_ENTRY_ACL_WRITE_DATA |
+ ARCHIVE_ENTRY_ACL_EXECUTE,
+ ARCHIVE_ENTRY_ACL_USER, 78, "user78" },
+ { ARCHIVE_ENTRY_ACL_TYPE_ALLOW,
+ ARCHIVE_ENTRY_ACL_READ_DATA |
+ ARCHIVE_ENTRY_ACL_WRITE_DATA |
+ ARCHIVE_ENTRY_ACL_APPEND_DATA |
+ ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES |
+ ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS |
+ ARCHIVE_ENTRY_ACL_READ_ACL |
+ ARCHIVE_ENTRY_ACL_SYNCHRONIZE,
+ ARCHIVE_ENTRY_ACL_GROUP_OBJ, 0, "" },
+ { ARCHIVE_ENTRY_ACL_TYPE_DENY,
+ ARCHIVE_ENTRY_ACL_WRITE_DATA |
+ ARCHIVE_ENTRY_ACL_APPEND_DATA |
+ ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES |
+ ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS |
+ ARCHIVE_ENTRY_ACL_WRITE_ACL |
+ ARCHIVE_ENTRY_ACL_WRITE_OWNER,
+ ARCHIVE_ENTRY_ACL_GROUP, 78, "group78" },
+ { ARCHIVE_ENTRY_ACL_TYPE_ALLOW,
+ ARCHIVE_ENTRY_ACL_READ_DATA |
+ ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES |
+ ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS |
+ ARCHIVE_ENTRY_ACL_READ_ACL |
+ ARCHIVE_ENTRY_ACL_SYNCHRONIZE,
+ ARCHIVE_ENTRY_ACL_EVERYONE, 0, "" },
+};
+
+static struct archive_test_acl_t acls5[] = {
+ { ARCHIVE_ENTRY_ACL_TYPE_ALLOW,
+ ARCHIVE_ENTRY_ACL_READ_DATA |
+ ARCHIVE_ENTRY_ACL_WRITE_DATA |
+ ARCHIVE_ENTRY_ACL_EXECUTE |
+ ARCHIVE_ENTRY_ACL_APPEND_DATA |
+ ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES |
+ ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES |
+ ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS |
+ ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS |
+ ARCHIVE_ENTRY_ACL_READ_ACL |
+ ARCHIVE_ENTRY_ACL_WRITE_ACL |
+ ARCHIVE_ENTRY_ACL_WRITE_OWNER |
+ ARCHIVE_ENTRY_ACL_SYNCHRONIZE,
+ ARCHIVE_ENTRY_ACL_USER_OBJ, 0, "" },
+ { ARCHIVE_ENTRY_ACL_TYPE_ALLOW,
+ ARCHIVE_ENTRY_ACL_READ_DATA |
+ ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES |
+ ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS |
+ ARCHIVE_ENTRY_ACL_READ_ACL |
+ ARCHIVE_ENTRY_ACL_SYNCHRONIZE |
+ ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT |
+ ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT,
+ ARCHIVE_ENTRY_ACL_USER, 77, "user77" },
+ { ARCHIVE_ENTRY_ACL_TYPE_ALLOW,
+ ARCHIVE_ENTRY_ACL_READ_DATA |
+ ARCHIVE_ENTRY_ACL_WRITE_DATA |
+ ARCHIVE_ENTRY_ACL_EXECUTE |
+ ARCHIVE_ENTRY_ACL_APPEND_DATA |
+ ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES |
+ ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES |
+ ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS |
+ ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS |
+ ARCHIVE_ENTRY_ACL_READ_ACL |
+ ARCHIVE_ENTRY_ACL_SYNCHRONIZE,
+ ARCHIVE_ENTRY_ACL_GROUP_OBJ, 0, "" },
+ { ARCHIVE_ENTRY_ACL_TYPE_DENY,
+ ARCHIVE_ENTRY_ACL_READ_DATA |
+ ARCHIVE_ENTRY_ACL_WRITE_DATA |
+ ARCHIVE_ENTRY_ACL_APPEND_DATA |
+ ARCHIVE_ENTRY_ACL_EXECUTE |
+ ARCHIVE_ENTRY_ACL_DELETE |
+ ARCHIVE_ENTRY_ACL_DELETE_CHILD |
+ ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES |
+ ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES |
+ ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS |
+ ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS |
+ ARCHIVE_ENTRY_ACL_READ_ACL |
+ ARCHIVE_ENTRY_ACL_WRITE_ACL |
+ ARCHIVE_ENTRY_ACL_WRITE_OWNER |
+ ARCHIVE_ENTRY_ACL_SYNCHRONIZE |
+ ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT |
+ ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT,
+ ARCHIVE_ENTRY_ACL_GROUP, 78, "group78" },
+ { ARCHIVE_ENTRY_ACL_TYPE_ALLOW,
+ ARCHIVE_ENTRY_ACL_READ_DATA |
+ ARCHIVE_ENTRY_ACL_EXECUTE |
+ ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES |
+ ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS |
+ ARCHIVE_ENTRY_ACL_READ_ACL |
+ ARCHIVE_ENTRY_ACL_SYNCHRONIZE,
+ ARCHIVE_ENTRY_ACL_EVERYONE, 0, "" },
+};
+
+DEFINE_TEST(test_compat_star_acl_posix1e)
+{
+ char name[] = "test_compat_star_acl_posix1e.tar";
+ struct archive *a;
+ struct archive_entry *ae;
+
+ /* Read archive file */
+ assert(NULL != (a = archive_read_new()));
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_support_filter_all(a));
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a));
+ extract_reference_file(name);
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_open_filename(a, name,
+ 10240));
+
+ /* First item has a few ACLs */
+ assertA(0 == archive_read_next_header(a, &ae));
+ failure("One extended ACL should flag all ACLs to be returned.");
+ assertEqualInt(5, archive_entry_acl_reset(ae,
+ ARCHIVE_ENTRY_ACL_TYPE_ACCESS));
+ assertEntryCompareAcls(ae, acls0, sizeof(acls0)/sizeof(acls0[0]),
+ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, 0142);
+ failure("Basic ACLs should set mode to 0142, not %04o",
+ archive_entry_mode(ae)&0777);
+ assert((archive_entry_mode(ae) & 0777) == 0142);
+
+ /* Second item has pretty extensive ACLs */
+ assertA(0 == archive_read_next_header(a, &ae));
+ assertEqualInt(7, archive_entry_acl_reset(ae,
+ ARCHIVE_ENTRY_ACL_TYPE_ACCESS));
+ assertEntryCompareAcls(ae, acls1, sizeof(acls1)/sizeof(acls1[0]),
+ ARCHIVE_ENTRY_ACL_TYPE_ACCESS, 0543);
+ failure("Basic ACLs should set mode to 0543, not %04o",
+ archive_entry_mode(ae)&0777);
+ assert((archive_entry_mode(ae) & 0777) == 0543);
+
+ /* Third item has default ACLs */
+ assertA(0 == archive_read_next_header(a, &ae));
+ assertEqualInt(6, archive_entry_acl_reset(ae,
+ ARCHIVE_ENTRY_ACL_TYPE_DEFAULT));
+ assertEntryCompareAcls(ae, acls2, sizeof(acls2)/sizeof(acls2[0]),
+ ARCHIVE_ENTRY_ACL_TYPE_DEFAULT, 0142);
+ failure("Basic ACLs should set mode to 0142, not %04o",
+ archive_entry_mode(ae)&0777);
+ assert((archive_entry_mode(ae) & 0777) == 0142);
+
+ /* Close the archive. */
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
+ assertEqualInt(ARCHIVE_OK, archive_read_free(a));
+}
+
+DEFINE_TEST(test_compat_star_acl_nfs4)
+{
+ char name[] = "test_compat_star_acl_nfs4.tar";
+ struct archive *a;
+ struct archive_entry *ae;
+
+ /* Read archive file */
+ assert(NULL != (a = archive_read_new()));
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_support_filter_all(a));
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a));
+ extract_reference_file(name);
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_open_filename(a, name, 10240
+));
+
+ /* First item has NFS4 ACLs mirroring file mode */
+ assertA(0 == archive_read_next_header(a, &ae));
+ assertEqualInt(3, archive_entry_acl_reset(ae,
+ ARCHIVE_ENTRY_ACL_TYPE_ALLOW));
+ assertEntryCompareAcls(ae, acls3, sizeof(acls3)/sizeof(acls3[0]),
+ ARCHIVE_ENTRY_ACL_TYPE_ALLOW, 0);
+
+ /* Second item has has fine-grained NFS4 ACLs */
+ assertA(0 == archive_read_next_header(a, &ae));
+ assertEqualInt(6, archive_entry_acl_reset(ae,
+ ARCHIVE_ENTRY_ACL_TYPE_NFS4));
+ assertEntryCompareAcls(ae, acls4, sizeof(acls4)/sizeof(acls0[4]),
+ ARCHIVE_ENTRY_ACL_TYPE_NFS4, 0);
+
+ /* Third item has file and directory inheritance NFS4 ACLs */
+ assertA(0 == archive_read_next_header(a, &ae));
+ assertEqualInt(5, archive_entry_acl_reset(ae,
+ ARCHIVE_ENTRY_ACL_TYPE_NFS4));
+ assertEntryCompareAcls(ae, acls5, sizeof(acls5)/sizeof(acls5[0]),
+ ARCHIVE_ENTRY_ACL_TYPE_NFS4, 0);
+
+ /* Close the archive. */
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
+ assertEqualInt(ARCHIVE_OK, archive_read_free(a));
+}
Copied: trunk/contrib/libarchive/libarchive/test/test_compat_star_acl_nfs4.tar.uu (from rev 11133, vendor/libarchive/dist/libarchive/test/test_compat_star_acl_nfs4.tar.uu)
===================================================================
--- trunk/contrib/libarchive/libarchive/test/test_compat_star_acl_nfs4.tar.uu (rev 0)
+++ trunk/contrib/libarchive/libarchive/test/test_compat_star_acl_nfs4.tar.uu 2018-06-19 20:42:35 UTC (rev 11134)
@@ -0,0 +1,231 @@
+begin 644 test_compat_star_acl_nfs4.tar
+M+B\N+T!087A(96%D97(`````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````#`P,#`V,#`@,#`P,#`P,"`P,#`P,#`P(#`P,#`P,#`P,C<R
+M(#`P,#`P,#`P,#`P(#`P,38P-S0 at 9P``````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````````!U<W1A<@`P,')O;W0`
+M````````````````````````````````````=VAE96P`````````````````
+M```````````````````P,#`P,#`P(#`P,#`P,#`@````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M```````````````````````````````````P,#`P,#`P,#`P,"`P,#`P,#`P
+M,#`P,"`````````````````U-R!30TA)3%DN<F5L96%S93US=&%R(#$N-2XS
+M("AA;60V-"UU;FMN;W=N+69R965B<V0Q,2XP*0HR-R!30TA)3%DN87)C:'1Y
+M<&4]97AU<W1A<@HT-R!30TA)3%DN=F]L:&1R+F1U;7!D871E/3$T-SDQ-C<W
+M,C<N,38W,C(U,C at Q"C(U(%-#2$E,62YV;VQH9'(N=F]L;F\],0HS,"!30TA)
+M3%DN=F]L:&1R+F)L;V-K<VEZ93TR,`H`````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````````"XO+B]`4&%X2&5A
+M9&5R````````````````````````````````````````````````````````
+M```````````````````````````````````````````````````````````P
+M,#`P-C`P(#`P,#`P,#`@,#`P,#`P,"`P,#`P,#`P,#,S-"`P,#`P,#`P,#`P
+M,"`P,#$V,3$T('@`````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````=7-T87(`,#!R;V]T````````````````
+M`````````````````````'=H965L````````````````````````````````
+M````,#`P,#`P,"`P,#`P,#`P(```````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````,#`P,#`P,#`P,#`@,#`P,#`P,#`P,#`@````````
+M````````,S`@871I;64],30W.3$Q.34U-"XP-#,U-#DP,#`*,S`@8W1I;64]
+M,30W.3$Q.3DQ,BXY,SDQ-C at P,#`*,S`@;71I;64],30W.3$Q.34U-"XP-#,U
+M-#DP,#`*,3,P(%-#2$E,62YA8VPN86-E/6]W;F5R0#IR=WAP+2UA05)78T-O
+M<SHM+2TM+2TM.F%L;&]W+&=R;W5P0#IR=RUP+2UA+5(M8RTM<SHM+2TM+2TM
+M.F%L;&]W+&5V97)Y;VYE0#IR+2TM+2UA+5(M8RTM<SHM+2TM+2TM.F%L;&]W
+M"@``````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````!F:6QE,0``````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````,#`P,#<V-"`P,#`P
+M,#`P(#`P,#`P,#`@,#`P,#`P,#`P,#`@,3,P,3(S,3$S,#(@,#`Q-#8S-B`P
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````'5S=&%R`#`P<F]O=```````````````````````````````
+M``````!W:&5E;````````````````````````````````````#`P,#`P,#`@
+M,#`P,#`P,"``````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````#$S,#$R,S$Q,S`R(#$S,#$R,S$R,#4P(````````````````"XO+B]`
+M4&%X2&5A9&5R````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M```````P,#`P-C`P(#`P,#`P,#`@,#`P,#`P,"`P,#`P,#`P,#4T,"`P,#`P
+M,#`P,#`P,"`P,#$V,3$S('@`````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````=7-T87(`,#!R;V]T````````
+M`````````````````````````````'=H965L````````````````````````
+M````````````,#`P,#`P,"`P,#`P,#`P(```````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````,#`P,#`P,#`P,#`@,#`P,#`P,#`P,#`@
+M````````````````,S`@871I;64],30W.3$Q.34U-2XR-C<P,3 at P,#`*,S`@
+M8W1I;64],30W.3$V,34Y."XY,SDV-#8P,#`*,S`@;71I;64],30W.3$Q.34U
+M-2XR-C<P,3 at P,#`*,C8R(%-#2$E,62YA8VPN86-E/75S97(Z=7-E<C<X.G)W
+M>"TM+2TM+2TM+2TM.BTM+2TM+2TZ9&5N>3HW."QG<F]U<#IG<F]U<#<X.BUW
+M+7`M+2U!+5<M0V\M.BTM+2TM+2TZ9&5N>3HW."QU<V5R.G5S97(W-SIR+2TM
+M+2UA+5(M8RTM<SHM+2TM+2U).F%L;&]W.C<W+&]W;F5R0#IR=RUP+2UA05)7
+M8T-O<SHM+2TM+2TM.F%L;&]W+&=R;W5P0#IR=RUP+2UA+5(M8RTM<SHM+2TM
+M+2TM.F%L;&]W+&5V97)Y;VYE0#IR+2TM+2UA+5(M8RTM<SHM+2TM+2TM.F%L
+M;&]W"@``````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````!F:6QE,@``````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````,#`P,#8V
+M-"`P,#`P,#`P(#`P,#`P,#`@,#`P,#`P,#`P,#`@,3,P,3(S,3$S,#,@,#`Q
+M-#8U-R`P````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````'5S=&%R`#`P<F]O=```````````````````````
+M``````````````!W:&5E;````````````````````````````````````#`P
+M,#`P,#`@,#`P,#`P,"``````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````#$S,#$R,S$Q,S`S(#$S,#$R-#,S,S<V(```````````````
+M`"XO+B]`4&%X2&5A9&5R````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M```````````````P,#`P-C`P(#`P,#`P,#`@,#`P,#`P,"`P,#`P,#`P,#0V
+M-2`P,#`P,#`P,#`P,"`P,#$V,3(Q('@`````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````=7-T87(`,#!R;V]T
+M`````````````````````````````````````'=H965L````````````````
+M````````````````````,#`P,#`P,"`P,#`P,#`P(```````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````,#`P,#`P,#`P,#`@,#`P,#`P
+M,#`P,#`@````````````````,S`@871I;64],30W.3$V-S0Y-2XV.#<X-C8P
+M,#`*,S`@8W1I;64],30W.3$V-S<R,RXT-#`X-C<P,#`*,S`@;71I;64],30W
+M.3$R,#8W."XT-#$U.#`P,#`*,C$Y(%-#2$E,62YA8VPN86-E/6=R;W5P.F=R
+M;W5P-S at Z<G=X<$1D84%25V-#;W,Z9F0M+2TM+3ID96YY.C<X+'5S97(Z=7-E
+M<C<W.G(M+2TM+6$M4BUC+2US.F9D+2TM+2TZ86QL;W<Z-S<L;W=N97)`.G)W
+M>'`M+6%!4E=C0V]S.BTM+2TM+2TZ86QL;W<L9W)O=7!`.G)W>'`M+6%!4E=C
+M+2US.BTM+2TM+2TZ86QL;W<L979E<GEO;F5`.G(M>"TM+6$M4BUC+2US.BTM
+M+2TM+2TZ86QL;W<*````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````````````!D:7(Q+P``````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M,#`P,#<W-2`P,#`P,#`P(#`P,#`P,#`@,#`P,#`P,#`P,#`@,3,P,3(S,3,T
+M-#8@,#`Q-#8S,2`U````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````'5S=&%R`#`P<F]O=```````````````
+M``````````````````````!W:&5E;```````````````````````````````
+M`````#`P,#`P,#`@,#`P,#`P,"``````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````#$S,#$R-#0W,#`W(#$S,#$R-#0W,S4S(```````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+9````````````````````````````````````
+`
+end
Copied: trunk/contrib/libarchive/libarchive/test/test_compat_star_acl_posix1e.tar.uu (from rev 11133, vendor/libarchive/dist/libarchive/test/test_compat_star_acl_posix1e.tar.uu)
===================================================================
--- trunk/contrib/libarchive/libarchive/test/test_compat_star_acl_posix1e.tar.uu (rev 0)
+++ trunk/contrib/libarchive/libarchive/test/test_compat_star_acl_posix1e.tar.uu 2018-06-19 20:42:35 UTC (rev 11134)
@@ -0,0 +1,231 @@
+begin 644 test_compat_star_acl_posix1e.tar
+M+B\N+T!087A(96%D97(`````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````#`P,#`V,#`@,#`P,#`P,"`P,#`P,#`P(#`P,#`P,#`P,C<R
+M(#`P,#`P,#`P,#`P(#`P,38P-S0 at 9P``````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````````!U<W1A<@`P,')O;W0`
+M````````````````````````````````````=VAE96P`````````````````
+M```````````````````P,#`P,#`P(#`P,#`P,#`@````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M```````````````````````````````````P,#`P,#`P,#`P,"`P,#`P,#`P
+M,#`P,"`````````````````U-R!30TA)3%DN<F5L96%S93US=&%R(#$N-2XS
+M("AA;60V-"UU;FMN;W=N+69R965B<V0Q,2XP*0HR-R!30TA)3%DN87)C:'1Y
+M<&4]97AU<W1A<@HT-R!30TA)3%DN=F]L:&1R+F1U;7!D871E/3$T-SDQ,CDY
+M-30N,#4X-S<R-SDS"C(U(%-#2$E,62YV;VQH9'(N=F]L;F\],0HS,"!30TA)
+M3%DN=F]L:&1R+F)L;V-K<VEZ93TR,`H`````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````````"XO+B]`4&%X2&5A
+M9&5R````````````````````````````````````````````````````````
+M```````````````````````````````````````````````````````````P
+M,#`P-C`P(#`P,#`P,#`@,#`P,#`P,"`P,#`P,#`P,#(U,2`P,#`P,#`P,#`P
+M,"`P,#$V,3$R('@`````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````=7-T87(`,#!R;V]T````````````````
+M`````````````````````'=H965L````````````````````````````````
+M````,#`P,#`P,"`P,#`P,#`P(```````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````,#`P,#`P,#`P,#`@,#`P,#`P,#`P,#`@````````
+M````````,S`@871I;64],30W.3$R,34Y-BXT.#4W,30P,#`*,S`@8W1I;64]
+M,30W.3$R.3<V-RXQ,#@Y.#8P,#`*,S`@;71I;64],30W.3$R,34Y-BXT.#4W
+M,30P,#`*-SD at 4T-(24Q9+F%C;"YA8V-E<W,]=7-E<CHZ+2UX+'5S97(Z=7-E
+M<C<W.G(M+2QG<F]U<#HZ<BTM+&UA<VLZ.G(M+2QO=&AE<CHZ+7<M"@``````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````!F:6QE,0``````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````,#`P,#$T,B`P,#`P
+M,#`P(#`P,#`P,#`@,#`P,#`P,#`P,#`@,3,P,3(S,34R-S0@,#`Q-#8W,2`P
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````'5S=&%R`#`P<F]O=```````````````````````````````
+M``````!W:&5E;````````````````````````````````````#`P,#`P,#`@
+M,#`P,#`P,"``````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````#$S,#$R,S$U,C<T(#$S,#$R,S,U,C0W(````````````````"XO+B]`
+M4&%X2&5A9&5R````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M```````P,#`P-C`P(#`P,#`P,#`@,#`P,#`P,"`P,#`P,#`P,#,Q-"`P,#`P
+M,#`P,#`P,"`P,#$V,3$R('@`````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````=7-T87(`,#!R;V]T````````
+M`````````````````````````````'=H965L````````````````````````
+M````````````,#`P,#`P,"`P,#`P,#`P(```````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````,#`P,#`P,#`P,#`@,#`P,#`P,#`P,#`@
+M````````````````,S`@871I;64],30W.3$R,38P,2XP-C`X-C8P,#`*,S`@
+M8W1I;64],30W.3$R.3<V-RXQ,#@Y-S0P,#`*,S`@;71I;64],30W.3$R,38P
+M,2XP-C`X-C8P,#`*,3$T(%-#2$E,62YA8VPN86-C97-S/75S97(Z.G(M>"QU
+M<V5R.G5S97(W-SIR+2TL=7-E<CIU<V5R-S at Z+2TM+&=R;W5P.CIR+2TL9W)O
+M=7`Z9W)O=7`W.#IR=W at L;6%S:SHZ<G=X+&]T:&5R.CHM=W@*````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````!F:6QE,@``````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````,#`P,#4W
+M,R`P,#`P,#`P(#`P,#`P,#`@,#`P,#`P,#`P,#`@,3,P,3(S,34S,#$@,#`Q
+M-#8V,"`P````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````'5S=&%R`#`P<F]O=```````````````````````
+M``````````````!W:&5E;````````````````````````````````````#`P
+M,#`P,#`@,#`P,#`P,"``````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````#$S,#$R,S$U,S`Q(#$S,#$R,S,U,C0W(```````````````
+M`"XO+B]`4&%X2&5A9&5R````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M```````````````P,#`P-C`P(#`P,#`P,#`@,#`P,#`P,"`P,#`P,#`P,#,W
+M,R`P,#`P,#`P,#`P,"`P,#$V,3$W('@`````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````=7-T87(`,#!R;V]T
+M`````````````````````````````````````'=H965L````````````````
+M````````````````````,#`P,#`P,"`P,#`P,#`P(```````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````,#`P,#`P,#`P,#`@,#`P,#`P
+M,#`P,#`@````````````````,S`@871I;64],30W.3$R,3<R-BXX,3<T-3`P
+M,#`*,S`@8W1I;64],30W.3$R,3 at S,2XU.#,U-3(P,#`*,S`@;71I;64],30W
+M.3$R,3<R-BXX,3<T-3`P,#`*-C, at 4T-(24Q9+F%C;"YA8V-E<W,]=7-E<CHZ
+M+2UX+&=R;W5P.CIR+2TL;6%S:SHZ<BTM+&]T:&5R.CHM=RT*.3@@4T-(24Q9
+M+F%C;"YD969A=6QT/75S97(Z.BTM>"QU<V5R.G5S97(W-SIR+2TL9W)O=7`Z
+M.G(M+2QG<F]U<#IG<F]U<#<X.BTM>"QM87-K.CIR+7 at L;W1H97(Z.BUW+0H`
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````````````!D:7(Q+P``````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M,#`P,#$T,B`P,#`P,#`P(#`P,#`P,#`@,#`P,#`P,#`P,#`@,3,P,3(S,34T
+M-S8@,#`Q-#8R-B`U````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````'5S=&%R`#`P<F]O=```````````````
+M``````````````````````!W:&5E;```````````````````````````````
+M`````#`P,#`P,#`@,#`P,#`P,"``````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````#$S,#$R,S$U-#<V(#$S,#$R,S$U-C0W(```````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+9````````````````````````````````````
+`
+end
Modified: trunk/contrib/libarchive/libarchive/test/test_compat_uudecode.c
===================================================================
--- trunk/contrib/libarchive/libarchive/test/test_compat_uudecode.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/test/test_compat_uudecode.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -40,7 +40,7 @@
};
/*
- * Compatibility: uudecode command ignores junk data placed ater the "end"
+ * Compatibility: uudecode command ignores junk data placed after the "end"
* marker.
*/
DEFINE_TEST(test_compat_uudecode)
Modified: trunk/contrib/libarchive/libarchive/test/test_fuzz.c
===================================================================
--- trunk/contrib/libarchive/libarchive/test/test_fuzz.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/test/test_fuzz.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -104,16 +104,20 @@
}
if (!assert(size < buffsize)) {
free(rawimage);
+ rawimage = NULL;
continue;
}
} else {
for (i = 0; filesets[n].names[i] != NULL; ++i)
{
+ char *newraw;
tmp = slurpfile(&size, filesets[n].names[i]);
- char *newraw = (char *)realloc(rawimage, oldsize + size);
+ newraw = realloc(rawimage, oldsize + size);
if (!assert(newraw != NULL))
{
free(rawimage);
+ rawimage = NULL;
+ free(tmp);
continue;
}
rawimage = newraw;
@@ -123,14 +127,21 @@
free(tmp);
}
}
- if (size == 0)
+ if (size == 0) {
+ free(rawimage);
+ rawimage = NULL;
continue;
+ }
image = malloc(size);
assert(image != NULL);
if (image == NULL) {
free(rawimage);
+ rawimage = NULL;
return;
}
+
+ assert(rawimage != NULL);
+
srand((unsigned)time(NULL));
for (i = 0; i < 1000; ++i) {
@@ -162,6 +173,7 @@
Sleep(100);
#endif
}
+ assert(f != NULL);
assertEqualInt((size_t)size, fwrite(image, 1, (size_t)size, f));
fclose(f);
@@ -195,7 +207,7 @@
archive_read_close(a);
}
archive_read_free(a);
-}
+ }
free(image);
free(rawimage);
}
@@ -395,10 +407,12 @@
"test_read_format_tar_empty_filename.tar",
NULL
};
+#if HAVE_LIBLZO2 && HAVE_LZO_LZO1X_H && HAVE_LZO_LZOCONF_H
static const char *fileset9[] = {
"test_compat_lzop_1.tar.lzo",
NULL
};
+#endif
static const struct files filesets[] = {
{0, fileset1}, /* Exercise bzip2 decompressor. */
{1, fileset1},
@@ -409,7 +423,9 @@
{0, fileset6}, /* Exercise xz decompressor. */
{0, fileset7},
{0, fileset8},
+#if HAVE_LIBLZO2 && HAVE_LZO_LZO1X_H && HAVE_LZO_LZOCONF_H
{0, fileset9}, /* Exercise lzo decompressor. */
+#endif
{1, NULL}
};
test_fuzz(filesets);
Modified: trunk/contrib/libarchive/libarchive/test/test_pax_filename_encoding.c
===================================================================
--- trunk/contrib/libarchive/libarchive/test/test_pax_filename_encoding.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/test/test_pax_filename_encoding.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -347,7 +347,7 @@
return;
}
- /* Check if the paltform completely supports the string conversion. */
+ /* Check if the platform completely supports the string conversion. */
a = archive_write_new();
assertEqualInt(ARCHIVE_OK, archive_write_set_format_pax(a));
if (archive_write_set_options(a, "hdrcharset=UTF-8") != ARCHIVE_OK) {
@@ -394,7 +394,7 @@
return;
}
- /* Check if the paltform completely supports the string conversion. */
+ /* Check if the platform completely supports the string conversion. */
a = archive_write_new();
assertEqualInt(ARCHIVE_OK, archive_write_set_format_pax(a));
if (archive_write_set_options(a, "hdrcharset=UTF-8") != ARCHIVE_OK) {
@@ -440,7 +440,7 @@
return;
}
- /* Check if the paltform completely supports the string conversion. */
+ /* Check if the platform completely supports the string conversion. */
a = archive_write_new();
assertEqualInt(ARCHIVE_OK, archive_write_set_format_pax(a));
if (archive_write_set_options(a, "hdrcharset=UTF-8") != ARCHIVE_OK) {
@@ -488,7 +488,7 @@
return;
}
- /* Check if the paltform completely supports the string conversion. */
+ /* Check if the platform completely supports the string conversion. */
a = archive_write_new();
assertEqualInt(ARCHIVE_OK, archive_write_set_format_pax(a));
if (archive_write_set_options(a, "hdrcharset=UTF-8") != ARCHIVE_OK) {
Modified: trunk/contrib/libarchive/libarchive/test/test_read_disk.c
===================================================================
--- trunk/contrib/libarchive/libarchive/test/test_read_disk.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/test/test_read_disk.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -61,6 +61,7 @@
return ("NOTFOO");
}
+#if !defined(__CYGWIN__) && !defined(__HAIKU__)
/* We test GID lookup by looking up the name of group number zero and
* checking it against the following list. If your system uses a
* different conventional name for group number zero, please extend
@@ -71,13 +72,16 @@
"root", /* Linux */
"wheel" /* BSD */
};
+#endif
DEFINE_TEST(test_read_disk)
{
struct archive *a;
int gmagic = 0x13579, umagic = 0x1234;
+#if !defined(__CYGWIN__) && !defined(__HAIKU__)
const char *p;
size_t i;
+#endif
assert((a = archive_read_disk_new()) != NULL);
@@ -115,8 +119,6 @@
/* Some platforms don't have predictable names for
* uid=0, so we skip this part of the test. */
skipping("standard uname/gname lookup");
- i = 0;
- p = zero_groups[0]; /* avoid unused warnings */
#else
/* XXX Someday, we may need to generalize this the
* same way we generalized the group name check below.
Modified: trunk/contrib/libarchive/libarchive/test/test_read_disk_directory_traversals.c
===================================================================
--- trunk/contrib/libarchive/libarchive/test/test_read_disk_directory_traversals.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/test/test_read_disk_directory_traversals.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -33,7 +33,7 @@
#endif
/*
- * Test if the current filesytem is mounted with noatime option.
+ * Test if the current filesystem is mounted with noatime option.
*/
static int
atimeIsUpdated(void)
@@ -500,8 +500,8 @@
/*
* We should be on the initial directory where we performed
- * archive_read_disk_new() after we perfome archive_read_free()
- * even if we broke off the directory traversals.
+ * archive_read_disk_new() after we perform archive_read_free()
+ * even if we broke off the directory traversals.
*/
/* Save current working directory. */
@@ -1228,11 +1228,11 @@
assertEqualInt(ARCHIVE_OK, archive_read_close(a));
/*
- * Test4: Traversals with archive_read_disk_set_atime_restored() and
- * archive_read_disk_honor_nodump().
+ * Test4: Traversals with ARCHIVE_READDISK_RESTORE_ATIME and
+ * ARCHIVE_READDISK_HONOR_NODUMP
*/
- assertNodump("at/f1");
- assertNodump("at/f2");
+ assertSetNodump("at/f1");
+ assertSetNodump("at/f2");
assertUtimes("at/f1", 886600, 0, 886600, 0);
assertUtimes("at/f2", 886611, 0, 886611, 0);
assertUtimes("at/fe", 886611, 0, 886611, 0);
@@ -1320,13 +1320,16 @@
assertUtimes("cb", 886622, 0, 886622, 0);
assert((ae = archive_entry_new()) != NULL);
- if (assert((a = archive_read_disk_new()) != NULL)) {
+ assert((a = archive_read_disk_new()) != NULL);
+ if (a == NULL) {
archive_entry_free(ae);
return;
}
- if (assert((m = archive_match_new()) != NULL)) {
+ assert((m = archive_match_new()) != NULL);
+ if (m == NULL) {
archive_entry_free(ae);
archive_read_free(a);
+ archive_match_free(m);
return;
}
@@ -1376,6 +1379,10 @@
/* Close the disk object. */
assertEqualInt(ARCHIVE_OK, archive_read_close(a));
+ /* Reset name filter */
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_read_disk_set_matching(a, NULL, NULL, NULL));
+
/*
* Test2: Traversals with a metadata filter.
*/
@@ -1393,7 +1400,7 @@
while (file_count--) {
archive_entry_clear(ae);
assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header2(a, ae));
- failure("File 'cb/f1' should be exclueded");
+ failure("File 'cb/f1' should be excluded");
assert(strcmp(archive_entry_pathname(ae), "cb/f1") != 0);
if (strcmp(archive_entry_pathname(ae), "cb") == 0) {
assertEqualInt(archive_entry_filetype(ae), AE_IFDIR);
@@ -1443,7 +1450,7 @@
assertMakeFile("nd/f1", 0644, "0123456789");
assertMakeFile("nd/f2", 0644, "hello world");
assertMakeFile("nd/fe", 0644, NULL);
- assertNodump("nd/f2");
+ assertSetNodump("nd/f2");
assertUtimes("nd/f1", 886600, 0, 886600, 0);
assertUtimes("nd/f2", 886611, 0, 886611, 0);
assertUtimes("nd/fe", 886611, 0, 886611, 0);
@@ -1453,7 +1460,7 @@
assert((a = archive_read_disk_new()) != NULL);
/*
- * Test1: Traversals without archive_read_disk_honor_nodump().
+ * Test1: Traversals without ARCHIVE_READDISK_HONOR_NODUMP
*/
failure("Directory traversals should work as well");
assertEqualIntA(a, ARCHIVE_OK, archive_read_disk_open(a, "nd"));
@@ -1506,7 +1513,7 @@
assertEqualInt(ARCHIVE_OK, archive_read_close(a));
/*
- * Test2: Traversals with archive_read_disk_honor_nodump().
+ * Test2: Traversals with ARCHIVE_READDISK_HONOR_NODUMP
*/
assertUtimes("nd/f1", 886600, 0, 886600, 0);
assertUtimes("nd/f2", 886611, 0, 886611, 0);
@@ -1564,11 +1571,11 @@
{
/* Basic test. */
test_basic();
- /* Test hybird mode; follow symlink initially, then not. */
+ /* Test hybrid mode; follow symlink initially, then not. */
test_symlink_hybrid();
- /* Test logcal mode; follow all symlinks. */
+ /* Test logical mode; follow all symlinks. */
test_symlink_logical();
- /* Test logcal mode; prevent loop in symlinks. */
+ /* Test logical mode; prevent loop in symlinks. */
test_symlink_logical_loop();
/* Test to restore atime. */
test_restore_atime();
Modified: trunk/contrib/libarchive/libarchive/test/test_read_filter_lzop.c
===================================================================
--- trunk/contrib/libarchive/libarchive/test/test_read_filter_lzop.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/test/test_read_filter_lzop.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -39,13 +39,16 @@
assert((a = archive_read_new()) != NULL);
r = archive_read_support_filter_lzop(a);
if (r != ARCHIVE_OK) {
- if (r == ARCHIVE_WARN && !canLzop()) {
+ if (!canLzop()) {
assertEqualInt(ARCHIVE_OK, archive_read_free(a));
skipping("lzop compression is not supported "
"on this platform");
- } else
+ return;
+ } else if (r != ARCHIVE_WARN) {
assertEqualIntA(a, ARCHIVE_OK, r);
- return;
+ assertEqualInt(ARCHIVE_OK, archive_read_free(a));
+ return;
+ }
}
assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a));
assertEqualIntA(a, ARCHIVE_OK,
Modified: trunk/contrib/libarchive/libarchive/test/test_read_filter_lzop_multiple_parts.c
===================================================================
--- trunk/contrib/libarchive/libarchive/test/test_read_filter_lzop_multiple_parts.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/test/test_read_filter_lzop_multiple_parts.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -36,12 +36,16 @@
assert((a = archive_read_new()) != NULL);
r = archive_read_support_filter_lzop(a);
if (r != ARCHIVE_OK) {
- if (r == ARCHIVE_WARN && !canLzop()) {
- assertEqualInt(ARCHIVE_OK, archive_read_free(a));
+ if (!canLzop()) {
skipping("lzop compression is not supported "
"on this platform");
+ } else if (r == ARCHIVE_WARN) {
+ skipping("lzop multiple parts decoding is not "
+ "supported via external program");
+
} else
assertEqualIntA(a, ARCHIVE_OK, r);
+ assertEqualInt(ARCHIVE_OK, archive_read_free(a));
return;
}
assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a));
Modified: trunk/contrib/libarchive/libarchive/test/test_read_format_7zip.c
===================================================================
--- trunk/contrib/libarchive/libarchive/test/test_read_format_7zip.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/test/test_read_format_7zip.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -688,7 +688,7 @@
assertEqualInt(32, archive_read_data(a, buff, sizeof(buff)));
assertEqualMem(buff, "hellohellohello\nhellohellohello\n", 32);
- /* Verify symbolic-linke symlinkfile. */
+ /* Verify symbolic-link symlinkfile. */
assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
assertEqualInt((AE_IFLNK | 0755), archive_entry_mode(ae));
assertEqualString("symlinkfile", archive_entry_pathname(ae));
Modified: trunk/contrib/libarchive/libarchive/test/test_read_format_cpio_afio.c
===================================================================
--- trunk/contrib/libarchive/libarchive/test/test_read_format_cpio_afio.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/test/test_read_format_cpio_afio.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -27,7 +27,7 @@
__FBSDID("$FreeBSD$");
/*
-ecute the following to rebuild the data for this program:
+execute the following to rebuild the data for this program:
tail -n +33 test_read_format_cpio_afio.c | /bin/sh
# How to make a sample data.
Modified: trunk/contrib/libarchive/libarchive/test/test_read_format_isorr_bz2.c
===================================================================
--- trunk/contrib/libarchive/libarchive/test/test_read_format_isorr_bz2.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/test/test_read_format_isorr_bz2.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -26,7 +26,7 @@
__FBSDID("$FreeBSD: stable/11/contrib/libarchive/libarchive/test/test_read_format_isorr_bz2.c 299529 2016-05-12 10:16:16Z mm $");
/*
-PLEASE use old cdrtools; mkisofs verion is 2.01.
+PLEASE use old cdrtools; mkisofs version is 2.01.
This version mkisofs made wrong "SL" System Use Entry of RRIP.
Execute the following command to rebuild the data for this program:
Modified: trunk/contrib/libarchive/libarchive/test/test_read_format_mtree.c
===================================================================
--- trunk/contrib/libarchive/libarchive/test/test_read_format_mtree.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/test/test_read_format_mtree.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -183,7 +183,7 @@
min_time = archive_entry_mtime(ae);
assert(min_time <= 0);
/* Simply asserting min_time - 1 > 0 breaks with some compiler optimizations. */
- t = min_time - 1;
+ t = (time_t)((uintmax_t)min_time - 1);
assert(t > 0);
assertEqualInt(archive_entry_is_encrypted(ae), 0);
assertEqualIntA(a, archive_read_has_encrypted_entries(a), ARCHIVE_READ_FORMAT_ENCRYPTION_UNSUPPORTED);
Copied: trunk/contrib/libarchive/libarchive/test/test_read_format_raw.bufr.uu (from rev 11133, vendor/libarchive/dist/libarchive/test/test_read_format_raw.bufr.uu)
===================================================================
--- trunk/contrib/libarchive/libarchive/test/test_read_format_raw.bufr.uu (rev 0)
+++ trunk/contrib/libarchive/libarchive/test/test_read_format_raw.bufr.uu 2018-06-19 20:42:35 UTC (rev 11134)
@@ -0,0 +1,95 @@
+begin 660 test_read_format_raw.bufr.uu
+M,#`P-S0T.3 at P,`$-#0HP,#`-#0I)15%8,#$@155-4"`P-S`U,#`-#0I"5492
+M`2+?!```%@``_@`````#_]T0``?@"P<$.P````D``'C`Z`@!(K0``,``_@!N
+M@#T!^`"P!P"!`````"JJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJJ@#=]]]]]
+M]]]]]]]]]]@`````````````````````````````````````````````````
+M````````````````````````````````````````````````````````0AS@
+M/.`\X#S@//M\^WS[?/M]%ET6719=%ETQ/3$],3TQ(```````````&V`;8!M@
+M&V`V0#9`-D`V0%&`48!1@%&`;&!L8&Q@;&"'0(=`AT"'0*(@HB"B(*(@O8"]
+M at +V`O8#80-A`V$#80/.@\Z#SH/.A#H$. at 0Z!#H$I82EA*6$I843!1,%$P43!
+M7X%?@5^!7X%Z87IA>F%Z897!E<&5P97!L*&PH;"AL*',`<P!S`',`>;AYN'F
+MX>;B`B("(@(B`B(<@AR"'((<@C?B-^(WXC?B4L)2PE+"4L)N(FXB;B)N(HCB
+MB.*(XHCBH\*CPJ/"H\BZQK3$>Z`M3P```96P=EB)(F#:0C*.B=E8YJH8[61W
+MV+Z)DM;2)*Q8Z4V[T6O1*GO&@Y3UWQHV$QNX==:0U"G4XC at H"!]-(J(@'D/?
+M@(SYTVUR+"E#9NEU?4F/)3&DAC2 at Z%6S^G>N30VJGI%L62FLU1@^LI27SAJ\
+MAE7)"Z[IC/VMTH6><,,*6=1B_>=>!,RS3:UOL>+6(/[321O:>SY39A-MM<W-
+MRC7A%J!DXUZ=ZKM_#FX=3KN![XZY_(<B@/0)X">;Q$AVID_52A79OI7GLR$&
+MSF*I)!#&@`%Q#EY!`,.RR%*'&\:EF1QI5(J]<GHB=*+)O?D-%S2?J38<U/^7
+MI50TKK;FT6L)]PU4'>X(-6,[J'"6>D\2[%OX:S*/?P46S?=U=PV5MOW^%-?Q
+M"-,Z'1F[U]*D5IJX<+]WA,(L9NKCB>[D-C</1[P"M>3H[!`U7VI[+9C9M9:A
+M3'3YOJJE-5E\Z$7102[J,RG1VXIIC',\]YQ3C.:890?))T[97M[+-*8XQY&W
+MIH_F5(+RXB"?$"!HHBA%2^8,)-!3&H29["AH7VT*^HIG\Y^_U;GAW,\!)WGV
+M&],S7-,TY;['3(@ZG`VXB\VVM&^?"X!RVCO\T02FIP`U;[V.JPQGC64RBRT4
+MUY0&N\%%_CDP*E%B_.L)Q%IB\M:L5+[&I0_%2T.JE&DSJ\F.HTZ_HGFV49Y:
+MC`"$AQ,D=<3^/R?B54&T*A&33@,V;Q7#IJ$==HB_(T7H(#)O*9>_":$02^K"
+MF*F5#21OUT-KRQ]\L0"FP^9B'>[1/3**.N@"OB````7M\#3O$=.;64K*60;(
+M,]2>I1YH\R)I$TL26+"'A#Q(8D+O!W@^'?#M86L+?5OJO77KL:6-2E)2DKC5
+MQHT4:*6!+"=3.IGX3\1=8NN9D,R$7"+A.DG2+C%R#<!N`6L+:'X#[@```P(8
+M$("2!*@$P!P@<00%]"]C?QP`O07D3V)[D:B-)G(SF7E+R'[S]YV$[`EN2W(W
+MT;RO%7BIA4P,>&/"^9?*X#<"-<&M[Y5\L[_=_1,(F$):$K+4EJR-I&M(FD3/
+MDGR64K*=:6M(.$Q](FI95+*I%-(>I9E++I$-(4I9U+,I"](+I:=+1I!](`I;
+M-+6I`E'RI;]+;H^U'CI==+FH]%'1I?=+TH[%&WIAU,$HX%&8IEE,?HTE%NIK
+MU-)HO]$GIU=.(HHE"HJ(-/[H<4]LJX=3^H!L:<OTUC(F6Q$]"Z@``+20XM$K
+M at BJ'9XU0%(0H!&Q8SQ%68J2&B`RN%=`K5&8(R0%C`L,&3PQU%F0LJ&/XQ?%H
+M at L^&,XQ-%J`M-&*@P]%K`M6&(8PO%KHM;&&@PA%KXM?&$XP5%L`MAP'%K
+MHM?&!HOX%JXM:%_ZZ1+!N"P``"Q/"4#>'H>H[!FC6*`3 at CA)3!E[+&6LWYN#
+M1&I/L>\[9XD4HC0 at A=+*4T at I(4.H%."=E9*L4XJ);BUECK,8*O]>"]F6LH8R
+MQYJK4&@M&;ZWAM+;G2N@<BY9YSR7<N^?N_)\3Z(1P=@;!**$2H<P^C_'F,\;
+M98RLDQ)Z=$XIFS3I'1V at U#*R5>J)4JUMI[%61P#?J[-X,QY<QKCS;6TM1ZJ+
+MDLN!+X(#0Q=<XET[S6S-$:XWYE3"V/L^7NMM=;"5EJP5^MI4:BE+JQ4`FA.B
+MC$OI)2FFM(**T:I,1*A!#*+T%GV/^A0^)W3RGZ.R<4YIX3 at FM-L<DU1ES/FR
+M,F8`Q!FR^%I+B80LI4BM%M*<3LH95B;DD)83\CY#"*$H(,/(?9#QV#8'"/4:
+M`O!C#:%F)X5(OA)A]$2)\-X60S!]".#`'X5P,@``D"L`'``00,(%#!Q`D4+&
+M#1P\@1)$RA4L7,&31LX=/'T"%$C2)4R=0I5*UBU<O8,63-HU;-W#ET[>/7S^
+M!!A0XD6-'D294N9-G3Z%&E3J5:U>Q9M6[EV]?P8<6/)ES9]&G5KV;=V_AQY<
+M^G7MW`%/B`"Y@?X"'Q```0!\T``'S@$_P``3_0(0T``R`!`,@&0````$#__X
+M'_^!__@?@?_X'_^!^!__@?_X'X'_^!__@?@?_X'_^!^!__@?_X'X'_^!__@?
+M@?_X'_^!^!__@?_X'X'_^!__@?@``"!__@?_^```@#YH``9`!R@\C(R&ZKFQ
+ML]VG'6NK;7Y'YR_*2;6$.#`H3IT%@:D4DL9DAIUJ.-A"5-S[1?*=.G\Y*:'1
+M1KZ6E`1&3E36NH7)B!2(Z,%9;J:8I;R%A;D%KE3`J3R4O.]L0J^):=TM0O*.
+M\2.HMA=FQ.2(#*``+0#__RQ`^FC6'9C\M-VY1W%.XY7!&\H5`"+,W&V_=W\^
+M_77O*T?R-^O4X)'`Z3U.Z1X5.M50:RX+XQ#';7;^I6W+O"/4^>9R1RG!Z1^:
+M:>8FK#]*MUP\U+YH#IT%O_MOI9`M^L8R)"\'@`\Q$O@``4=AV`+M`SU9^H'X
+M9ZFNQQ-0CUX*.""6+X'2R]-H;+96%JR-5HW)NY[/(B9T/2$Z,30K8-_0/9C+
+M-7:)?(99;O+XYLW$/Y(?+U8G^=LTGNZ:2Z'"G8R['JXC>ZW8VK#*5P[&]Y!7
+M(4XT+*1XM?)29BO)=9)?%%8T1___PX77'!5!9,V\L_>>[=7X1I8K?."<=)*)
+MMQ(<RB6+J'/OH at ZI$`#TX%O*9FC1LS,%,@#!0[U#R:'KM0F_`TXX.C1`_/45
+MA0='R^X(K^\7,5=:.TERK*^!L*XX2*>C#^/3<6OKMFJRXPC!'E*=:HK)C##&
+MELG0LWAM[26Z-W?2[5N;S8%P`?Z1<Q;10VP4D3*Z-[3)&1(3'%^=4M($4>IE
+M3*?-I+]6DJZ___G?+6HC]^T+#5G,/$>(M"IY_F>+.3THA1TWV#8R2 at W:,SB%
+M;4+BDGXR0^$/44-L<J)[45H`4RU3P``J'<.:G.V5)K41PHVTR(]BHA3->-'"
+M),O9S0>/PWNA#L#-&!*T9TSX?AZEJ&$LLL@]$`#L,&2TZA;RY*]+\74Q1=#P
+ME9*X;4Y9E##F*M+0M5N0U#)+.2>*)+#6#3IAVY5R<69<QH at S'2]=>:&V"?__
+M]XEC]%^&4693BM$.(L;Y'RKS/)&2$@A$K(7BL)4:TA=:_V'/=C at T9I[K7UP?
+M>S`:!<Q)6OL?@_%ZL&T/K(DS&AL<=G/N\<D0=L88A")5`>,T9`N`;I41,6P[
+MJG&?KE50XF!\1TYPJE_`5R<0X#12A0_M]+_HOO(>:]EYCGFVN0=:U]ES/FDP
+M4?@WZ+:X5(JC6VN%)2A&IG\->?E(Q'R.%.+<"\``@Q2/__^`RJ5L!E6DGZ?Z
+M at J6*'B7N.GG>N`X):Y*6+>5DU'8EN%A,]=6C7U>%38)2D),4T4Z+ at U4]2HB"
+MI0`=!:($>Q@'\(1+`8$Q.`0!`7!4`!T%4(`N((JRA(0MD&/4=$I.X[3K1A+4
+M82-/$Y3=)%L5-2U;6A9UD7-H&07U at E365H$TBJ$G\B*0)9C-_:NI^@Z6R&YK
+M6P/=-.QC3'___7922)<0Y5,>Q2VKBW36LFTSS.VZSGO.^+T/I`KYOX_<)1G`
+MT+QG#T+P-'#QR7+D7O^^\7R6F#1QY*D)R8]L)M\>,%$Z>B]$$7Z,(\1*>+JN
+MJ.+`V"_,"X\60HGD=Q'`[R0?$D8Q4^S_PW`CJ/2_+S.*WSNNFR#1N4S*YK<P
+M#,)RI"J*\@B%H:AYA'X?YFCP3IADD!XB"&`#___N`EF-52JAH,EFLAC+9"LU
+M:+M<L55ADW,%:JA3,99A1D--IOUFRII-4`"5^IY7OER15_K\MF,:FH^N8_%U
+M`D!.&!-E4C)&2K4H-&30:00F$OB*T%P,QYP-=--DM)?,YE*)PM9J-=LNUTM=
+M[.QOOTJH5Y#J.0.&2%JOU[J]QN5TN)Q.1M.-M-5WOY___[$3I-;)9YD\IEM-
+M=+C;+_1:'3JI,8+%J%#W[!9#$'@_(H_H]')NY6>KVVW5BL'"S3RI&ZR$\M4*
+MK5<+$V&@H80`)A,%0F?C4/BJ at TJBT&G5HSD(MV>MU6GUHM%4DU0JE,L6(N%8
+MRF<T%^X7$V&ZTG`_VG,8[$YI*9;'8K)Z1-XS+:'1IK(IK,I"___^F)"0$%HK
+M`0#!@(!(;&@#`X+``,#`P!P+#!1!@=)Z$%PJ&1#.!?%(7'B`$9#(`:&:$0I:
+M<C[7J`>2+:D3:CV7C+:$#@+#4#EC;)0*`1B+,!&*Q_'Q,*A4%@M%0C%0G%HV
+M%XQ&`Q$@I&`J$8F%HP$@D%@^(`V%(\(@X%1#)))(!')H^)Q8(8_&9'?__^OD
+MT:L1&`T*B4ZF25ZK^1PJ,1N0-%`MJ&-U<-A[K at GM1Y.!7)=@L)!E4EL,L&UC
+MK at LF$\`4$!88`05#@`#\9"DF#<2B\D%46!$:&0Z'0WG=:IDUL`WIA3JIA*E;
+MK]C,=,-)F,QH-1Q.!F-MW.-O)!2M%!/1_/N!.2!O9I0>1Q!^QB2R2.PZ,1>%
+M/___UB$XV>8$F+"4I'EB-+R$A(2)%E%8@*SPP'C^7(@P%)T,E&4^)A at QA3P8
+M*.C%&E7*!<GIE87E>7V988%Y94SQ-8E,I*28F*P89+09/)!4H`!P*%0 at 2-0T
+M3#@H9$!08'0X/$X=S.8\K&!D<2B<P9#TK+#]*02XY;&E69H```#PZ`X)#J4:
+M90J.C$ZELM3I2AU<K7JU:HPJ6+EBA at R3%$"]6I:,FKU6I=+5S!FO7*V3E0M=
+MO%S9^^9NWKIVQ8LG3%4Q8*ES%>M7,#Z-,L4HU"E. at 1IU`8:5`(3YQ$-/FPYP
+MZ;,)41Y.R4(U;___X8 at 5#U%6!PL`"0DF1 at D/$0\+)FP[#B`]*!,I at Q\+#`<G
+M"!5+=7`,5$0)"EM/-XV3CGF'6'V>>GIK<G-_ at 6Q-:HAO13L_/4`D($LE0"LI
+!20``
+`
+end
Modified: trunk/contrib/libarchive/libarchive/test/test_read_format_raw.c
===================================================================
--- trunk/contrib/libarchive/libarchive/test/test_read_format_raw.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/test/test_read_format_raw.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -35,6 +35,7 @@
struct archive *a;
const char *reffile1 = "test_read_format_raw.data";
const char *reffile2 = "test_read_format_raw.data.Z";
+ const char *reffile3 = "test_read_format_raw.bufr";
/* First, try pulling data out of an uninterpretable file. */
extract_reference_file(reffile1);
@@ -90,4 +91,30 @@
assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae));
assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
assertEqualInt(ARCHIVE_OK, archive_read_free(a));
+
+
+ /* Third, try with file which fooled us in past - appeared to be tar. */
+ extract_reference_file(reffile3);
+ assert((a = archive_read_new()) != NULL);
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_support_filter_all(a));
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_raw(a));
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a));
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_read_open_filename(a, reffile3, 1));
+
+ /* First (and only!) Entry */
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
+ assertEqualString("data", archive_entry_pathname(ae));
+ assertEqualInt(archive_entry_is_encrypted(ae), 0);
+ assertEqualIntA(a, archive_read_has_encrypted_entries(a), ARCHIVE_READ_FORMAT_ENCRYPTION_UNSUPPORTED);
+ /* Most fields should be unset (unknown) */
+ assert(!archive_entry_size_is_set(ae));
+ assert(!archive_entry_atime_is_set(ae));
+ assert(!archive_entry_ctime_is_set(ae));
+ assert(!archive_entry_mtime_is_set(ae));
+
+ /* Test EOF */
+ assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae));
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
+ assertEqualInt(ARCHIVE_OK, archive_read_free(a));
}
Modified: trunk/contrib/libarchive/libarchive/test/test_read_format_zip.c
===================================================================
--- trunk/contrib/libarchive/libarchive/test/test_read_format_zip.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/test/test_read_format_zip.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -126,6 +126,7 @@
assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a));
assertEqualIntA(a, ARCHIVE_OK, read_open_memory(a, p, s, 31));
verify_basic(a, 0);
+ free(p);
}
/*
@@ -195,6 +196,7 @@
assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a));
assertEqualIntA(a, ARCHIVE_OK, read_open_memory(a, p, s, 108));
verify_info_zip_ux(a, 0);
+ free(p);
}
/*
@@ -258,6 +260,7 @@
assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a));
assertEqualIntA(a, ARCHIVE_OK, read_open_memory(a, p, s, 108));
verify_extract_length_at_end(a, 0);
+ free(p);
}
static void
@@ -294,6 +297,8 @@
assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae));
assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
assertEqualIntA(a, ARCHIVE_OK, archive_read_free(a));
+
+ free(p);
}
DEFINE_TEST(test_read_format_zip)
Modified: trunk/contrib/libarchive/libarchive/test/test_read_format_zip_comment_stored.c
===================================================================
--- trunk/contrib/libarchive/libarchive/test/test_read_format_zip_comment_stored.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/test/test_read_format_zip_comment_stored.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -63,6 +63,8 @@
assertEqualInt(archive_entry_is_encrypted(ae), 0);
assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
assertEqualIntA(a, ARCHIVE_OK, archive_read_free(a));
+
+ free(p);
}
DEFINE_TEST(test_read_format_zip_comment_stored)
Modified: trunk/contrib/libarchive/libarchive/test/test_read_format_zip_filename.c
===================================================================
--- trunk/contrib/libarchive/libarchive/test/test_read_format_zip_filename.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/test/test_read_format_zip_filename.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -1116,7 +1116,7 @@
* - the filename of second file is stored in UTF-8.
*
* Whenever hdrcharset option is specified, we will correctly read the
- * filename of sencod file, which is stored in UTF-8.
+ * filename of second file, which is stored in UTF-8.
*/
DEFINE_TEST(test_read_format_zip_filename_KOI8R_UTF8_2)
Copied: trunk/contrib/libarchive/libarchive/test/test_read_format_zip_jar.c (from rev 11133, vendor/libarchive/dist/libarchive/test/test_read_format_zip_jar.c)
===================================================================
--- trunk/contrib/libarchive/libarchive/test/test_read_format_zip_jar.c (rev 0)
+++ trunk/contrib/libarchive/libarchive/test/test_read_format_zip_jar.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -0,0 +1,59 @@
+/*-
+ * Copyright (c) 2016 Peter Wu
+ * 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 "test.h"
+__FBSDID("$FreeBSD$");
+
+/*
+ * Issue 822: jar files have an empty External File Attributes field which
+ * is misinterpreted as regular file type due to OS MS-DOS.
+ */
+
+DEFINE_TEST(test_read_format_zip_jar)
+{
+ const char *refname = "test_read_format_zip_jar.jar";
+ char *p;
+ size_t s;
+ struct archive *a;
+ struct archive_entry *ae;
+ char data[16];
+
+ extract_reference_file(refname);
+ p = slurpfile(&s, refname);
+
+ assert((a = archive_read_new()) != NULL);
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_zip_seekable(a));
+ assertEqualIntA(a, ARCHIVE_OK, read_open_memory_seek(a, p, s, 1));
+
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
+ assertEqualString("somedir/", archive_entry_pathname(ae));
+ assertEqualInt(AE_IFDIR | 0775, archive_entry_mode(ae));
+ assertEqualInt(0, archive_entry_size(ae));
+ assertEqualIntA(a, 0, archive_read_data(a, data, 16));
+
+ assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae));
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_free(a));
+ free(p);
+}
Copied: trunk/contrib/libarchive/libarchive/test/test_read_format_zip_jar.jar.uu (from rev 11133, vendor/libarchive/dist/libarchive/test/test_read_format_zip_jar.jar.uu)
===================================================================
--- trunk/contrib/libarchive/libarchive/test/test_read_format_zip_jar.jar.uu (rev 0)
+++ trunk/contrib/libarchive/libarchive/test/test_read_format_zip_jar.jar.uu 2018-06-19 20:42:35 UTC (rev 11134)
@@ -0,0 +1,6 @@
+begin 640 test_read_format_zip_jar.jar
+M4$L#! H @ $AQETD ( 0 <V]M961I<B_^R@ 4$L!
+M @H "@ " 2'&720 @ ! '-O
+@;65D:7(O_LH %!+!08 0 ! #H J
+
+end
Modified: trunk/contrib/libarchive/libarchive/test/test_read_format_zip_mac_metadata.c
===================================================================
--- trunk/contrib/libarchive/libarchive/test/test_read_format_zip_mac_metadata.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/test/test_read_format_zip_mac_metadata.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -112,4 +112,6 @@
assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae));
assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
assertEqualIntA(a, ARCHIVE_OK, archive_read_free(a));
+
+ free(p);
}
Modified: trunk/contrib/libarchive/libarchive/test/test_read_format_zip_malformed.c
===================================================================
--- trunk/contrib/libarchive/libarchive/test/test_read_format_zip_malformed.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/test/test_read_format_zip_malformed.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -53,6 +53,7 @@
assertEqualIntA(a, ARCHIVE_OK, read_open_memory(a, p, s, 31));
assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
assertEqualIntA(a, ARCHIVE_OK, archive_read_free(a));
+ free(p);
}
DEFINE_TEST(test_read_format_zip_malformed)
Modified: trunk/contrib/libarchive/libarchive/test/test_read_format_zip_nested.c
===================================================================
--- trunk/contrib/libarchive/libarchive/test/test_read_format_zip_nested.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/test/test_read_format_zip_nested.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -65,6 +65,8 @@
assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
assertEqualIntA(a, ARCHIVE_OK, archive_read_free(a));
+ free(p);
+
/* Inspect inner Zip. */
assert((a = archive_read_new()) != NULL);
assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_zip(a));
Modified: trunk/contrib/libarchive/libarchive/test/test_read_format_zip_padded.c
===================================================================
--- trunk/contrib/libarchive/libarchive/test/test_read_format_zip_padded.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/test/test_read_format_zip_padded.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -53,6 +53,8 @@
assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae));
assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
assertEqualIntA(a, ARCHIVE_OK, archive_read_free(a));
+
+ free(p);
}
/*
Modified: trunk/contrib/libarchive/libarchive/test/test_read_format_zip_sfx.c
===================================================================
--- trunk/contrib/libarchive/libarchive/test/test_read_format_zip_sfx.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/test/test_read_format_zip_sfx.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -60,4 +60,6 @@
assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae));
assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
assertEqualIntA(a, ARCHIVE_OK, archive_read_free(a));
+
+ free(p);
}
Modified: trunk/contrib/libarchive/libarchive/test/test_read_format_zip_traditional_encryption_data.c
===================================================================
--- trunk/contrib/libarchive/libarchive/test/test_read_format_zip_traditional_encryption_data.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/test/test_read_format_zip_traditional_encryption_data.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -28,7 +28,7 @@
DEFINE_TEST(test_read_format_zip_traditional_encryption_data)
{
- /* This file is password protected (Traditional PKWARE Enctypted).
+ /* This file is password protected (Traditional PKWARE Encrypted).
The headers are NOT encrypted. Password is "12345678". */
const char *refname =
"test_read_format_zip_traditional_encryption_data.zip";
@@ -36,7 +36,7 @@
struct archive *a;
char buff[512];
- /* Check if running system has cryptographic functionarity. */
+ /* Check if running system has cryptographic functionality. */
assert((a = archive_write_new()) != NULL);
assertEqualIntA(a, ARCHIVE_OK, archive_write_set_format_zip(a));
assertEqualIntA(a, ARCHIVE_OK, archive_write_add_filter_none(a));
Modified: trunk/contrib/libarchive/libarchive/test/test_read_format_zip_winzip_aes.c
===================================================================
--- trunk/contrib/libarchive/libarchive/test/test_read_format_zip_winzip_aes.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/test/test_read_format_zip_winzip_aes.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -33,7 +33,7 @@
struct archive *a;
char buff[512];
- /* Check if running system has cryptographic functionarity. */
+ /* Check if running system has cryptographic functionality. */
assert((a = archive_write_new()) != NULL);
assertEqualIntA(a, ARCHIVE_OK, archive_write_set_format_zip(a));
assertEqualIntA(a, ARCHIVE_OK, archive_write_add_filter_none(a));
Modified: trunk/contrib/libarchive/libarchive/test/test_read_format_zip_winzip_aes_large.c
===================================================================
--- trunk/contrib/libarchive/libarchive/test/test_read_format_zip_winzip_aes_large.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/test/test_read_format_zip_winzip_aes_large.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -34,7 +34,7 @@
char buff[512];
- /* Check if running system has cryptographic functionarity. */
+ /* Check if running system has cryptographic functionality. */
assert((a = archive_write_new()) != NULL);
assertEqualIntA(a, ARCHIVE_OK, archive_write_set_format_zip(a));
assertEqualIntA(a, ARCHIVE_OK, archive_write_add_filter_none(a));
Copied: trunk/contrib/libarchive/libarchive/test/test_read_format_zip_with_invalid_traditional_eocd.c (from rev 11133, vendor/libarchive/dist/libarchive/test/test_read_format_zip_with_invalid_traditional_eocd.c)
===================================================================
--- trunk/contrib/libarchive/libarchive/test/test_read_format_zip_with_invalid_traditional_eocd.c (rev 0)
+++ trunk/contrib/libarchive/libarchive/test/test_read_format_zip_with_invalid_traditional_eocd.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -0,0 +1,60 @@
+/*-
+ * Copyright (c) 2017 Phillip Berndt
+ * 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 "test.h"
+__FBSDID("$FreeBSD$");
+
+/*
+ * Issue 869: zip files without a valid EOCD header aren't loaded even if they
+ * have a valid ZIP64 version of said header.
+ */
+
+DEFINE_TEST(test_read_format_zip_with_invalid_traditional_eocd)
+{
+ const char *refname = "test_read_format_zip_with_invalid_traditional_eocd.zip";
+ char *p;
+ size_t s;
+ struct archive *a;
+ struct archive_entry *ae;
+
+ extract_reference_file(refname);
+ p = slurpfile(&s, refname);
+
+ assert((a = archive_read_new()) != NULL);
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_zip_seekable(a));
+ assertEqualIntA(a, ARCHIVE_OK, read_open_memory_seek(a, p, s, 1));
+
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
+ assertEqualString("test1.txt", archive_entry_pathname(ae));
+ assertEqualInt(0, archive_entry_size(ae));
+
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
+ assertEqualString("test2.txt", archive_entry_pathname(ae));
+ assertEqualInt(0, archive_entry_size(ae));
+
+ assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae));
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_free(a));
+ free(p);
+}
Copied: trunk/contrib/libarchive/libarchive/test/test_read_format_zip_with_invalid_traditional_eocd.zip.uu (from rev 11133, vendor/libarchive/dist/libarchive/test/test_read_format_zip_with_invalid_traditional_eocd.zip.uu)
===================================================================
--- trunk/contrib/libarchive/libarchive/test/test_read_format_zip_with_invalid_traditional_eocd.zip.uu (rev 0)
+++ trunk/contrib/libarchive/libarchive/test/test_read_format_zip_with_invalid_traditional_eocd.zip.uu 2018-06-19 20:42:35 UTC (rev 11134)
@@ -0,0 +1,14 @@
+begin 644 test_read_format_zip_without_eocd.zip
+M4$L#!"T`"````-IT at DH`````__________\)`"``=&5S=#$N='AT`0`<````
+M````````````````````````````````````````````````````````````
+M`%!+`P0M``@```#:=()*`````/__________"0`@`'1E<W0R+G1X=`$`'```
+M````````````````````6P``````````````````````````````````````
+M``!02P$"+0,M``@```#:=()*`````/__________"0`@````__\`````I('_
+M____=&5S=#$N='AT`0`<``````````````````````````````````````!0
+M2P$"+0,M``@```#:=()*`````/__________"0`@````__\`````I('_____
+M=&5S=#(N='AT`0`<``````````````````````!;``````````````!02P8&
+M+``````````M`RT````````````"``````````(`````````K@````````"V
+M`````````%!+!@<`````9`$````````!````4$L%!O__________________
+$__\`````
+`
+end
Copied: trunk/contrib/libarchive/libarchive/test/test_read_pax_schily_xattr.c (from rev 11133, vendor/libarchive/dist/libarchive/test/test_read_pax_schily_xattr.c)
===================================================================
--- trunk/contrib/libarchive/libarchive/test/test_read_pax_schily_xattr.c (rev 0)
+++ trunk/contrib/libarchive/libarchive/test/test_read_pax_schily_xattr.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -0,0 +1,70 @@
+/*-
+ * Copyright (c) 2016 IBM Corporation
+ * 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.
+ *
+ * This test case's code has been derived from test_entry.c
+ */
+#include "test.h"
+
+DEFINE_TEST(test_schily_xattr_pax)
+{
+ struct archive *a;
+ struct archive_entry *ae;
+ const char *refname = "test_read_pax_schily_xattr.tar";
+ const char *xname; /* For xattr tests. */
+ const void *xval; /* For xattr tests. */
+ size_t xsize; /* For xattr tests. */
+ const char *string, *array;
+
+ assert((a = archive_read_new()) != NULL);
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_support_filter_all(a));
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a));
+
+ extract_reference_file(refname);
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_read_open_filename(a, refname, 10240));
+
+ assertEqualInt(ARCHIVE_OK, archive_read_next_header(a, &ae));
+ assertEqualInt(2, archive_entry_xattr_count(ae));
+ assertEqualInt(2, archive_entry_xattr_reset(ae));
+
+ assertEqualInt(0, archive_entry_xattr_next(ae, &xname, &xval, &xsize));
+ assertEqualString(xname, "security.selinux");
+ string = "system_u:object_r:unlabeled_t:s0";
+ assertEqualString(xval, string);
+ /* the xattr's value also contains the terminating \0 */
+ assertEqualInt((int)xsize, strlen(string) + 1);
+
+ assertEqualInt(0, archive_entry_xattr_next(ae, &xname, &xval, &xsize));
+ assertEqualString(xname, "security.ima");
+ assertEqualInt((int)xsize, 265);
+ /* we only compare the first 12 bytes */
+ array = "\x03\x02\x04\xb0\xe9\xd6\x79\x01\x00\x2b\xad\x1e";
+ assertEqualMem(xval, array, 12);
+
+ /* Close the archive. */
+ assertEqualInt(ARCHIVE_OK, archive_read_close(a));
+ assertEqualInt(ARCHIVE_OK, archive_read_free(a));
+}
Copied: trunk/contrib/libarchive/libarchive/test/test_read_pax_schily_xattr.tar.uu (from rev 11133, vendor/libarchive/dist/libarchive/test/test_read_pax_schily_xattr.tar.uu)
===================================================================
--- trunk/contrib/libarchive/libarchive/test/test_read_pax_schily_xattr.tar.uu (rev 0)
+++ trunk/contrib/libarchive/libarchive/test/test_read_pax_schily_xattr.tar.uu 2018-06-19 20:42:35 UTC (rev 11134)
@@ -0,0 +1,231 @@
+begin 644 test_schily_xattr_pax.tar
+M+B]087A(96%D97)S+C$U,C4O8V]N9F9I;&5S````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````#`P,#`V-#0`,#`P,#`P,``P,#`P,#`P`#`P,#`P,#`P-C0W
+M`#$R-S$R,C$P-3`V`#`Q,C4V-@`@>```````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````````!U<W1A<@`P,```````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M```````````````````````S,"!A=&EM93TQ-#8R,S`Y,S8Y+C<Q-#DW-3DP
+M.0HS,"!C=&EM93TQ-#8R,S`Y,S8Y+C<W.#DW-C(Q,PHR.38 at 4T-(24Q9+GAA
+M='1R+G-E8W5R:71Y+FEM83T#`@2PZ=9Y`0`KK1Z%635)4!FT,I"<49LTXR`'
+M at 42;2R:POQ9`JQA=+16.AY^<_[XK597$><QT!GLCT8_IF@@:/Z<?]<HQ0T7I
+MO&87D9-4,L'!GUG'K%=]KEPC<<)&@`J)'T89MBPB7],R(#&7"#>W6X5O?Y6:
+M9^':P2MZR[4)$@W<NV(VUT&(R0R-_S>?)B6GX0U@<,0M%6YNMO%OG+IS%/.<
+M,"A(N&S.F9]=!*5=\).X."2$GUGJ,0C:@+G#$M_E8UQP,LU-G(8IKW^K^<8*
+M*3_.N0'%8.^$8S$`D9XOF+DK<<)U34U'_"O5/2<N#T*!'!4Z73X-X4W!/LCF
+M/,721A`CQF:PGDD/"C8W(%-#2$E,62YX871T<BYS96-U<FET>2YS96QI;G5X
+M/7-Y<W1E;5]U.F]B:F5C=%]R.G5N;&%B96QE9%]T.G,P``H`````````````
+M````````````````````````````````````````````````````````````
+M`````````````````````````````````````````````"XO8V]N9F9I;&5S
+M````````````````````````````````````````````````````````````
+M```````````````````````````````````````````````````````````P
+M,#`P-C0T`#`P,#`P,#``,#`P,#`P,``P,#`P,#`P,#`T,0`Q,C<Q,C(Q,#4P
+M-@`P,3,P-S,`(#``````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````=7-T87(`,#!R;V]T````````````````
+M`````````````````````')O;W0`````````````````````````````````
+M````,#`P,#`P,``P,#`P,#`P````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````+V5T8R]D969A=6QT+VEM82UP;VQI8WDN:6YA8W1I=F4*````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+9````````````````````````````````````
+`
+end
Modified: trunk/contrib/libarchive/libarchive/test/test_read_set_format.c
===================================================================
--- trunk/contrib/libarchive/libarchive/test/test_read_set_format.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/test/test_read_set_format.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -133,11 +133,12 @@
assert((a = archive_read_new()) != NULL);
assertA(0 == archive_read_set_format(a, ARCHIVE_FORMAT_TAR));
r = archive_read_append_filter(a, ARCHIVE_FILTER_GZIP);
- if (r == ARCHIVE_WARN && !canGzip()) {
- skipping("gzip reading not fully supported on this platform");
+ if (r != ARCHIVE_OK && archive_zlib_version() == NULL && !canGzip()) {
+ skipping("gzip tests require zlib or working gzip command");
assertEqualInt(ARCHIVE_OK, archive_read_free(a));
return;
}
+ assertEqualIntA(a, ARCHIVE_OK, r);
assertEqualInt(ARCHIVE_OK,
archive_read_open_memory(a, archive, sizeof(archive)));
assertEqualInt(ARCHIVE_OK, archive_read_next_header(a, &ae));
@@ -200,6 +201,11 @@
{
struct archive_entry *ae;
struct archive *a;
+#if !defined(_WIN32) || defined(__CYGWIN__)
+ FILE * fp;
+ int fd;
+ fpos_t pos;
+#endif
/*
* If we have "bunzip2 -q", try using that.
@@ -208,6 +214,15 @@
skipping("Can't run bunzip2 program on this platform");
return;
}
+
+#if !defined(_WIN32) || defined(__CYGWIN__)
+ /* bunzip2 will write to stderr, redirect it to a file */
+ fflush(stderr);
+ fgetpos(stderr, &pos);
+ assert((fd = dup(fileno(stderr))) != -1);
+ fp = freopen("stderr1", "w", stderr);
+#endif
+
assert((a = archive_read_new()) != NULL);
assertA(0 == archive_read_set_format(a, ARCHIVE_FORMAT_TAR));
assertEqualIntA(a, ARCHIVE_OK,
@@ -217,4 +232,16 @@
assertA(archive_read_next_header(a, &ae) < (ARCHIVE_WARN));
assertEqualIntA(a, ARCHIVE_WARN, archive_read_close(a));
assertEqualInt(ARCHIVE_OK, archive_read_free(a));
+
+#if !defined(_WIN32) || defined(__CYGWIN__)
+ /* restore stderr and verify results */
+ if (fp != NULL) {
+ fflush(stderr);
+ dup2(fd, fileno(stderr));
+ clearerr(stderr);
+ (void)fsetpos(stderr, &pos);
+ }
+ close(fd);
+ assertTextFileContents("bunzip2: (stdin) is not a bzip2 file.\n", "stderr1");
+#endif
}
Modified: trunk/contrib/libarchive/libarchive/test/test_sparse_basic.c
===================================================================
--- trunk/contrib/libarchive/libarchive/test/test_sparse_basic.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/test/test_sparse_basic.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -57,7 +57,7 @@
/*
* NOTE: On FreeBSD and Solaris, this test needs ZFS.
- * You may should perfom this test as
+ * You may perform this test as
* 'TMPDIR=<a directory on the ZFS> libarchive_test'.
*/
@@ -146,28 +146,14 @@
#else
-#if defined(_PC_MIN_HOLE_SIZE)
-
+#if defined(HAVE_LINUX_FIEMAP_H)
/*
- * FreeBSD and Solaris can detect 'hole' of a sparse file
- * through lseek(HOLE) on ZFS. (UFS does not support yet)
- */
-
-static int
-is_sparse_supported(const char *path)
-{
- return (pathconf(path, _PC_MIN_HOLE_SIZE) > 0);
-}
-
-#elif defined(__linux__)&& defined(HAVE_LINUX_FIEMAP_H)
-
-/*
* FIEMAP, which can detect 'hole' of a sparse file, has
* been supported from 2.6.28
*/
static int
-is_sparse_supported(const char *path)
+is_sparse_supported_fiemap(const char *path)
{
const struct sparse sparse_file[] = {
/* This hole size is too small to create a sparse
@@ -198,9 +184,60 @@
return (r >= 0);
}
-#else
+#if !defined(SEEK_HOLE) || !defined(SEEK_DATA)
+static int
+is_sparse_supported(const char *path)
+{
+ return is_sparse_supported_fiemap(path);
+}
+#endif
+#endif
+#if defined(_PC_MIN_HOLE_SIZE)
+
/*
+ * FreeBSD and Solaris can detect 'hole' of a sparse file
+ * through lseek(HOLE) on ZFS. (UFS does not support yet)
+ */
+
+static int
+is_sparse_supported(const char *path)
+{
+ return (pathconf(path, _PC_MIN_HOLE_SIZE) > 0);
+}
+
+#elif defined(SEEK_HOLE) && defined(SEEK_DATA)
+
+static int
+is_sparse_supported(const char *path)
+{
+ const struct sparse sparse_file[] = {
+ /* This hole size is too small to create a sparse
+ * files for almost filesystem. */
+ { HOLE, 1024 }, { DATA, 10240 },
+ { END, 0 }
+ };
+ int fd, r;
+ const char *testfile = "can_sparse";
+
+ (void)path; /* UNUSED */
+ create_sparse_file(testfile, sparse_file);
+ fd = open(testfile, O_RDWR);
+ if (fd < 0)
+ return (0);
+ r = lseek(fd, 0, SEEK_HOLE);
+ close(fd);
+ unlink(testfile);
+#if defined(HAVE_LINUX_FIEMAP_H)
+ if (r < 0)
+ return (is_sparse_supported_fiemap(path));
+#endif
+ return (r >= 0);
+}
+
+#elif !defined(HAVE_LINUX_FIEMAP_H)
+
+/*
* Other system may do not have the API such as lseek(HOLE),
* which detect 'hole' of a sparse file.
*/
Modified: trunk/contrib/libarchive/libarchive/test/test_write_disk_appledouble.c
===================================================================
--- trunk/contrib/libarchive/libarchive/test/test_write_disk_appledouble.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/test/test_write_disk_appledouble.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -144,7 +144,7 @@
assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
assertEqualString("./file3", archive_entry_pathname(ae));
assertEqualIntA(a, ARCHIVE_OK, archive_read_extract2(a, ae, ad));
- /* Extract ._file3 which will be merged into file3 as medtadata. */
+ /* Extract ._file3 which will be merged into file3 as metadata. */
assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
assertEqualString("./._file3", archive_entry_pathname(ae));
assertEqualIntA(a, ARCHIVE_OK, archive_read_extract2(a, ae, ad));
@@ -203,7 +203,7 @@
assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
assertEqualString("./file3", archive_entry_pathname(ae));
assertEqualIntA(a, ARCHIVE_OK, archive_read_extract2(a, ae, ad));
- /* Extract ._file3 which will be merged into file3 as medtadata. */
+ /* Extract ._file3 which will be merged into file3 as metadata. */
assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
assertEqualString("./._file3", archive_entry_pathname(ae));
assertEqualIntA(a, ARCHIVE_OK, archive_read_extract2(a, ae, ad));
Modified: trunk/contrib/libarchive/libarchive/test/test_write_filter_lz4.c
===================================================================
--- trunk/contrib/libarchive/libarchive/test/test_write_filter_lz4.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/test/test_write_filter_lz4.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -56,6 +56,7 @@
} else {
assertEqualInt(ARCHIVE_OK, r);
}
+ assertEqualInt(ARCHIVE_OK, archive_write_free(a));
buffsize = 2000000;
assert(NULL != (buff = (char *)malloc(buffsize)));
@@ -299,6 +300,7 @@
} else {
assertEqualInt(ARCHIVE_OK, r);
}
+ assertEqualInt(ARCHIVE_OK, archive_write_free(a));
buffsize = 2000000;
assert(NULL != (buff = (char *)malloc(buffsize)));
Modified: trunk/contrib/libarchive/libarchive/test/test_write_filter_lzop.c
===================================================================
--- trunk/contrib/libarchive/libarchive/test/test_write_filter_lzop.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/test/test_write_filter_lzop.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -43,12 +43,12 @@
assert((a = archive_write_new()) != NULL);
r = archive_write_add_filter_lzop(a);
+ assertEqualInt(ARCHIVE_OK, archive_write_free(a));
if (r != ARCHIVE_OK) {
if (canLzop() && r == ARCHIVE_WARN)
use_prog = 1;
else {
skipping("lzop writing not supported on this platform");
- assertEqualInt(ARCHIVE_OK, archive_write_free(a));
return;
}
}
@@ -92,7 +92,7 @@
assert((a = archive_read_new()) != NULL);
assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a));
r = archive_read_support_filter_lzop(a);
- if (r == ARCHIVE_WARN) {
+ if (r == ARCHIVE_WARN && !use_prog) {
skipping("Can't verify lzop writing by reading back;"
" lzop reading not fully supported on this platform");
} else {
@@ -212,7 +212,7 @@
assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a));
assertEqualIntA(a, ARCHIVE_OK, archive_read_support_filter_all(a));
r = archive_read_support_filter_lzop(a);
- if (r == ARCHIVE_WARN) {
+ if (r == ARCHIVE_WARN && !use_prog) {
skipping("lzop reading not fully supported on this platform");
} else {
assertEqualIntA(a, ARCHIVE_OK,
Modified: trunk/contrib/libarchive/libarchive/test/test_write_format_iso9660.c
===================================================================
--- trunk/contrib/libarchive/libarchive/test/test_write_format_iso9660.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/test/test_write_format_iso9660.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -117,8 +117,8 @@
*/
dirname[0] = '\0';
strcpy(dir, "/dir0");
- for (i = 0; i < 10; i++) {
- dir[4] = '0' + i;
+ for (i = 0; i < 13; i++) {
+ dir[4] = "0123456789ABCDEF"[i];
if (i == 0)
strcat(dirname, dir+1);
else
@@ -134,6 +134,19 @@
archive_entry_free(ae);
}
+ strcat(dirname, "/file");
+ assert((ae = archive_entry_new()) != NULL);
+ archive_entry_set_atime(ae, 2, 20);
+ archive_entry_set_birthtime(ae, 3, 30);
+ archive_entry_set_ctime(ae, 4, 40);
+ archive_entry_set_mtime(ae, 5, 50);
+ archive_entry_copy_pathname(ae, dirname);
+ archive_entry_set_mode(ae, S_IFREG | 0755);
+ archive_entry_set_size(ae, 8);
+ assertEqualIntA(a, ARCHIVE_OK, archive_write_header(a, ae));
+ archive_entry_free(ae);
+ assertEqualIntA(a, 8, archive_write_data(a, "12345678", 9));
+
/*
* "dir0/dir1/file1" has 8 bytes of data.
*/
@@ -333,6 +346,45 @@
assertEqualInt(2048, archive_entry_size(ae));
/*
+ * Read "dir0/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/dir9/dirA"
+ */
+ assertEqualIntA(a, 0, archive_read_next_header(a, &ae));
+ assertEqualInt(2, archive_entry_atime(ae));
+ assertEqualInt(3, archive_entry_birthtime(ae));
+ assertEqualInt(4, archive_entry_ctime(ae));
+ assertEqualInt(5, archive_entry_mtime(ae));
+ assertEqualString("dir0/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/dir9/dirA",
+ archive_entry_pathname(ae));
+ assert((S_IFDIR | 0555) == archive_entry_mode(ae));
+ assertEqualInt(2048, archive_entry_size(ae));
+
+ /*
+ * Read "dir0/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/dir9/dirA/dirB"
+ */
+ assertEqualIntA(a, 0, archive_read_next_header(a, &ae));
+ assertEqualInt(2, archive_entry_atime(ae));
+ assertEqualInt(3, archive_entry_birthtime(ae));
+ assertEqualInt(4, archive_entry_ctime(ae));
+ assertEqualInt(5, archive_entry_mtime(ae));
+ assertEqualString("dir0/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/dir9/dirA/dirB",
+ archive_entry_pathname(ae));
+ assert((S_IFDIR | 0555) == archive_entry_mode(ae));
+ assertEqualInt(2048, archive_entry_size(ae));
+
+ /*
+ * Read "dir0/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/dir9/dirA/dirB/dirC"
+ */
+ assertEqualIntA(a, 0, archive_read_next_header(a, &ae));
+ assertEqualInt(2, archive_entry_atime(ae));
+ assertEqualInt(3, archive_entry_birthtime(ae));
+ assertEqualInt(4, archive_entry_ctime(ae));
+ assertEqualInt(5, archive_entry_mtime(ae));
+ assertEqualString("dir0/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/dir9/dirA/dirB/dirC",
+ archive_entry_pathname(ae));
+ assert((S_IFDIR | 0555) == archive_entry_mode(ae));
+ assertEqualInt(2048, archive_entry_size(ae));
+
+ /*
* Read "hardlnk"
*/
assertEqualIntA(a, 0, archive_read_next_header(a, &ae));
@@ -386,6 +438,21 @@
assertEqualMem(buff2, "12345678", 8);
/*
+ * Read "dir0/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/dir9/dirA/dirB/dirC/file"
+ */
+ assertEqualIntA(a, 0, archive_read_next_header(a, &ae));
+ assertEqualInt(2, archive_entry_atime(ae));
+ assertEqualInt(3, archive_entry_birthtime(ae));
+ assertEqualInt(4, archive_entry_ctime(ae));
+ assertEqualInt(5, archive_entry_mtime(ae));
+ assertEqualString("dir0/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/dir9/dirA/dirB/dirC/file", archive_entry_pathname(ae));
+ assert((AE_IFREG | 0555) == archive_entry_mode(ae));
+ assertEqualInt(1, archive_entry_nlink(ae));
+ assertEqualInt(8, archive_entry_size(ae));
+ assertEqualIntA(a, 8, archive_read_data(a, buff2, 10));
+ assertEqualMem(buff2, "12345678", 8);
+
+ /*
* Read "dir0/dir1/file1"
*/
assertEqualIntA(a, 0, archive_read_next_header(a, &ae));
@@ -580,29 +647,65 @@
assertEqualInt(2048, archive_entry_size(ae));
/*
- * Read "hardlnk"
+ * Read "dir0/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/dir9/dirA"
*/
assertEqualIntA(a, 0, archive_read_next_header(a, &ae));
assertEqualInt(5, archive_entry_atime(ae));
assertEqualInt(5, archive_entry_ctime(ae));
assertEqualInt(5, archive_entry_mtime(ae));
- assertEqualString("hardlnk", archive_entry_pathname(ae));
+ assertEqualString("dir0/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/dir9/dirA",
+ archive_entry_pathname(ae));
+ assert((S_IFDIR | 0700) == archive_entry_mode(ae));
+ assertEqualInt(2048, archive_entry_size(ae));
+
+ /*
+ * Read "dir0/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/dir9/dirA/dirB"
+ */
+ assertEqualIntA(a, 0, archive_read_next_header(a, &ae));
+ assertEqualInt(5, archive_entry_atime(ae));
+ assertEqualInt(5, archive_entry_ctime(ae));
+ assertEqualInt(5, archive_entry_mtime(ae));
+ assertEqualString("dir0/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/dir9/dirA/dirB",
+ archive_entry_pathname(ae));
+ assert((S_IFDIR | 0700) == archive_entry_mode(ae));
+ assertEqualInt(2048, archive_entry_size(ae));
+
+ /*
+ * Read "dir0/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/dir9/dirA/dirB/dirC"
+ */
+ assertEqualIntA(a, 0, archive_read_next_header(a, &ae));
+ assertEqualInt(5, archive_entry_atime(ae));
+ assertEqualInt(5, archive_entry_ctime(ae));
+ assertEqualInt(5, archive_entry_mtime(ae));
+ assertEqualString("dir0/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/dir9/dirA/dirB/dirC",
+ archive_entry_pathname(ae));
+ assert((S_IFDIR | 0700) == archive_entry_mode(ae));
+ assertEqualInt(2048, archive_entry_size(ae));
+
+ /*
+ * Read "file"
+ */
+ assertEqualIntA(a, 0, archive_read_next_header(a, &ae));
+ assertEqualInt(5, archive_entry_atime(ae));
+ assertEqualInt(5, archive_entry_ctime(ae));
+ assertEqualInt(5, archive_entry_mtime(ae));
+ assertEqualString("file", archive_entry_pathname(ae));
assert((AE_IFREG | 0400) == archive_entry_mode(ae));
- assertEqualInt(2, archive_entry_nlink(ae));
assertEqualInt(8, archive_entry_size(ae));
assertEqualIntA(a, 8, archive_read_data(a, buff2, 10));
assertEqualMem(buff2, "12345678", 8);
/*
- * Read "file"
+ * Read "hardlnk"
*/
assertEqualIntA(a, 0, archive_read_next_header(a, &ae));
assertEqualInt(5, archive_entry_atime(ae));
assertEqualInt(5, archive_entry_ctime(ae));
assertEqualInt(5, archive_entry_mtime(ae));
- assertEqualString("file", archive_entry_pathname(ae));
- assertEqualString("hardlnk", archive_entry_hardlink(ae));
+ assertEqualString("hardlnk", archive_entry_pathname(ae));
+ assertEqualString("file", archive_entry_hardlink(ae));
assert((AE_IFREG | 0400) == archive_entry_mode(ae));
+ assertEqualInt(2, archive_entry_nlink(ae));
assertEqualInt(0, archive_entry_size(ae));
assertEqualIntA(a, 0, archive_read_data(a, buff2, 10));
@@ -616,7 +719,7 @@
assertEqualInt(5, archive_entry_ctime(ae));
assert(archive_entry_mtime_is_set(ae));
assertEqualInt(5, archive_entry_mtime(ae));
- /* Trim lngname to 64 characters. */
+ /* Trim longname to 64 characters. */
longname[64] = '\0';
assertEqualString(longname, archive_entry_pathname(ae));
assert((AE_IFREG | 0400) == archive_entry_mode(ae));
@@ -625,6 +728,22 @@
assertEqualMem(buff2, "12345678", 8);
/*
+ * Read "dir0/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/dir9/dirA/dirB/dirC/file"
+ */
+ assertEqualIntA(a, 0, archive_read_next_header(a, &ae));
+ assertEqualInt(5, archive_entry_atime(ae));
+ assertEqualInt(5, archive_entry_ctime(ae));
+ assertEqualInt(5, archive_entry_mtime(ae));
+ assertEqualString(
+ "dir0/dir1/dir2/dir3/dir4/dir5/dir6/dir7/dir8/dir9/dirA/dirB/dirC/file",
+ archive_entry_pathname(ae));
+ assert((AE_IFREG | 0400) == archive_entry_mode(ae));
+ assertEqualInt(1, archive_entry_nlink(ae));
+ assertEqualInt(8, archive_entry_size(ae));
+ assertEqualIntA(a, 8, archive_read_data(a, buff2, 10));
+ assertEqualMem(buff2, "12345678", 8);
+
+ /*
* Read "dir0/dir1/file1"
*/
assertEqualIntA(a, 0, archive_read_next_header(a, &ae));
@@ -746,6 +865,42 @@
assertEqualInt(2048, archive_entry_size(ae));
/*
+ * Read "rr_moved/dir7/dir8/dir9/dira"
+ */
+ assertEqualIntA(a, 0, archive_read_next_header(a, &ae));
+ assertEqualInt(5, archive_entry_atime(ae));
+ assertEqualInt(5, archive_entry_ctime(ae));
+ assertEqualInt(5, archive_entry_mtime(ae));
+ assertEqualString("RR_MOVED/DIR7/DIR8/DIR9/DIRA",
+ archive_entry_pathname(ae));
+ assert((S_IFDIR | 0700) == archive_entry_mode(ae));
+ assertEqualInt(2048, archive_entry_size(ae));
+
+ /*
+ * Read "rr_moved/dir7/dir8/dir9/dira/dirB"
+ */
+ assertEqualIntA(a, 0, archive_read_next_header(a, &ae));
+ assertEqualInt(5, archive_entry_atime(ae));
+ assertEqualInt(5, archive_entry_ctime(ae));
+ assertEqualInt(5, archive_entry_mtime(ae));
+ assertEqualString("RR_MOVED/DIR7/DIR8/DIR9/DIRA/DIRB",
+ archive_entry_pathname(ae));
+ assert((S_IFDIR | 0700) == archive_entry_mode(ae));
+ assertEqualInt(2048, archive_entry_size(ae));
+
+ /*
+ * Read "rr_moved/dir7/dir8/dir9/dirA/dirB/dirC"
+ */
+ assertEqualIntA(a, 0, archive_read_next_header(a, &ae));
+ assertEqualInt(5, archive_entry_atime(ae));
+ assertEqualInt(5, archive_entry_ctime(ae));
+ assertEqualInt(5, archive_entry_mtime(ae));
+ assertEqualString("RR_MOVED/DIR7/DIR8/DIR9/DIRA/DIRB/DIRC",
+ archive_entry_pathname(ae));
+ assert((S_IFDIR | 0700) == archive_entry_mode(ae));
+ assertEqualInt(2048, archive_entry_size(ae));
+
+ /*
* Read "dir0"
*/
assertEqualIntA(a, 0, archive_read_next_header(a, &ae));
@@ -827,33 +982,35 @@
assertEqualInt(2048, archive_entry_size(ae));
/*
- * Read "file"
+ * Read "hardlink"
*/
assertEqualIntA(a, 0, archive_read_next_header(a, &ae));
assertEqualInt(5, archive_entry_atime(ae));
- assertEqualInt(0, archive_entry_birthtime(ae));
assertEqualInt(5, archive_entry_ctime(ae));
assertEqualInt(5, archive_entry_mtime(ae));
- assertEqualString("FILE", archive_entry_pathname(ae));
+ assertEqualString("HARDLNK", archive_entry_pathname(ae));
+ assertEqualString(NULL, archive_entry_hardlink(ae));
assert((AE_IFREG | 0400) == archive_entry_mode(ae));
- assertEqualInt(2, archive_entry_nlink(ae));
assertEqualInt(8, archive_entry_size(ae));
assertEqualIntA(a, 8, archive_read_data(a, buff2, 10));
assertEqualMem(buff2, "12345678", 8);
/*
- * Read "hardlink"
+ * Read "file"
*/
assertEqualIntA(a, 0, archive_read_next_header(a, &ae));
assertEqualInt(5, archive_entry_atime(ae));
+ assertEqualInt(0, archive_entry_birthtime(ae));
assertEqualInt(5, archive_entry_ctime(ae));
assertEqualInt(5, archive_entry_mtime(ae));
- assertEqualString("HARDLNK", archive_entry_pathname(ae));
- assertEqualString("FILE", archive_entry_hardlink(ae));
+ assertEqualString("FILE", archive_entry_pathname(ae));
+ assertEqualString("HARDLNK", archive_entry_hardlink(ae));
assert((AE_IFREG | 0400) == archive_entry_mode(ae));
+ assertEqualInt(2, archive_entry_nlink(ae));
assertEqualInt(0, archive_entry_size(ae));
assertEqualIntA(a, 0, archive_read_data(a, buff2, 10));
+
/*
* Read longname
*/
@@ -871,6 +1028,22 @@
assertEqualMem(buff2, "12345678", 8);
/*
+ * Read "rr_moved/dir7/dir8/dir9/dirA/dirB/dirC/file"
+ */
+ assertEqualIntA(a, 0, archive_read_next_header(a, &ae));
+ assertEqualInt(5, archive_entry_atime(ae));
+ assertEqualInt(5, archive_entry_ctime(ae));
+ assertEqualInt(5, archive_entry_mtime(ae));
+ assertEqualString(
+ "RR_MOVED/DIR7/DIR8/DIR9/DIRA/DIRB/DIRC/FILE",
+ archive_entry_pathname(ae));
+ assert((AE_IFREG | 0400) == archive_entry_mode(ae));
+ assertEqualInt(1, archive_entry_nlink(ae));
+ assertEqualInt(8, archive_entry_size(ae));
+ assertEqualIntA(a, 8, archive_read_data(a, buff2, 10));
+ assertEqualMem(buff2, "12345678", 8);
+
+ /*
* Read "dir0/dir1/file1"
*/
assertEqualIntA(a, 0, archive_read_next_header(a, &ae));
Modified: trunk/contrib/libarchive/libarchive/test/test_write_format_iso9660_zisofs.c
===================================================================
--- trunk/contrib/libarchive/libarchive/test/test_write_format_iso9660_zisofs.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/test/test_write_format_iso9660_zisofs.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -25,7 +25,7 @@
#include "test.h"
/*
- * Check that a "zisofs" ISO 9660 imaeg is correctly created.
+ * Check that a "zisofs" ISO 9660 image is correctly created.
*/
static const unsigned char primary_id[] = {
Modified: trunk/contrib/libarchive/libarchive/test/test_write_format_pax.c
===================================================================
--- trunk/contrib/libarchive/libarchive/test/test_write_format_pax.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/test/test_write_format_pax.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -80,6 +80,9 @@
/*
* "file3" is sparse file and has hole size of which is
* 1024000 bytes, and has 8 bytes data after the hole.
+ *
+ * Pad the filename to make it larger than the ustar limit.
+ * It should still read back correctly.
*/
assert((ae = archive_entry_new()) != NULL);
archive_entry_set_atime(ae, 2, 20);
@@ -86,7 +89,10 @@
archive_entry_set_birthtime(ae, 3, 30);
archive_entry_set_ctime(ae, 4, 40);
archive_entry_set_mtime(ae, 5, 50);
- archive_entry_copy_pathname(ae, "file3");
+ archive_entry_copy_pathname(ae, "file3"
+ "_123456789_123456789_123456789_123456789_123456789"
+ "_123456789_123456789_123456789_123456789_123456789"
+ "_123456789_123456789_123456789_123456789_123456789");
archive_entry_set_mode(ae, S_IFREG | 0755);
archive_entry_set_size(ae, 1024008);
archive_entry_sparse_add_entry(ae, 1024000, 8);
@@ -171,7 +177,11 @@
assertEqualInt(40, archive_entry_ctime_nsec(ae));
assertEqualInt(5, archive_entry_mtime(ae));
assertEqualInt(50, archive_entry_mtime_nsec(ae));
- assertEqualString("file3", archive_entry_pathname(ae));
+ assertEqualString("file3"
+ "_123456789_123456789_123456789_123456789_123456789"
+ "_123456789_123456789_123456789_123456789_123456789"
+ "_123456789_123456789_123456789_123456789_123456789",
+ archive_entry_pathname(ae));
assert((S_IFREG | 0755) == archive_entry_mode(ae));
assertEqualInt(1024008, archive_entry_size(ae));
assertEqualInt(1, archive_entry_sparse_reset(ae));
Modified: trunk/contrib/libarchive/libarchive/test/test_write_format_xar_empty.c
===================================================================
--- trunk/contrib/libarchive/libarchive/test/test_write_format_xar_empty.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/test/test_write_format_xar_empty.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -115,6 +115,6 @@
assertEqualIntA(a, ARCHIVE_OK, archive_write_close(a));
assertEqualInt(ARCHIVE_OK, archive_write_free(a));
- /* Verify the correct format for an empy Xar archive. */
+ /* Verify the correct format for an empty Xar archive. */
assertEqualInt(used, 0);
}
Modified: trunk/contrib/libarchive/libarchive/test/test_write_format_zip_compression_store.c
===================================================================
--- trunk/contrib/libarchive/libarchive/test/test_write_format_zip_compression_store.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/test/test_write_format_zip_compression_store.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -108,9 +108,20 @@
}
/* Quick and dirty: Read 2-byte and 4-byte integers from Zip file. */
-static int i2(const char *p) { return ((p[0] & 0xff) | ((p[1] & 0xff) << 8)); }
-static int i4(const char *p) { return (i2(p) | (i2(p + 2) << 16)); }
+static unsigned int
+i2(const void *p_)
+{
+ const unsigned char *p = p_;
+ return (p[0] | (p[1] << 8));
+}
+static unsigned int
+i4(const void *p_)
+{
+ const unsigned char *p = p_;
+ return (i2(p) | (i2(p + 2) << 16));
+}
+
static void verify_uncompressed_contents(const char *buff, size_t used)
{
const char *buffend;
Modified: trunk/contrib/libarchive/libarchive/test/test_write_format_zip_empty.c
===================================================================
--- trunk/contrib/libarchive/libarchive/test/test_write_format_zip_empty.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/test/test_write_format_zip_empty.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -49,7 +49,7 @@
assertEqualIntA(a, ARCHIVE_OK, archive_write_close(a));
assertEqualInt(ARCHIVE_OK, archive_write_free(a));
- /* Verify the correct format for an empy Zip archive. */
+ /* Verify the correct format for an empty Zip archive. */
assertEqualInt(used, 22);
assertEqualMem(buff,
"PK\005\006\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0",
Modified: trunk/contrib/libarchive/libarchive/test/test_write_format_zip_empty_zip64.c
===================================================================
--- trunk/contrib/libarchive/libarchive/test/test_write_format_zip_empty_zip64.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/test/test_write_format_zip_empty_zip64.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -51,7 +51,7 @@
assertEqualIntA(a, ARCHIVE_OK, archive_write_close(a));
assertEqualInt(ARCHIVE_OK, archive_write_free(a));
- /* Verify the correct format for an empy Zip archive with Zip64 extensions forced. */
+ /* Verify the correct format for an empty Zip archive with Zip64 extensions forced. */
assertEqualInt(used, 98);
assertEqualMem(buff,
"PK\006\006" /* Zip64 end-of-central-directory record */
Modified: trunk/contrib/libarchive/libarchive/test/test_write_format_zip_large.c
===================================================================
--- trunk/contrib/libarchive/libarchive/test/test_write_format_zip_large.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/test/test_write_format_zip_large.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -67,21 +67,19 @@
static ssize_t memory_read(struct archive *, void *, const void **buff);
static ssize_t memory_write(struct archive *, void *, const void *, size_t);
-static int16_t le16(const void *_p) {
+static uint16_t le16(const void *_p) {
const uint8_t *p = _p;
- return (0xff & (int16_t)p[0]) | ((0xff & (int16_t)p[1]) << 8);
+ return p[0] | (p[1] << 8);
}
-static int32_t le32(const void *_p) {
+static uint32_t le32(const void *_p) {
const uint8_t *p = _p;
- int32_t v = 0xffff & (int32_t)le16(_p);
- return v + ((0xffff & (int32_t)le16(p + 2)) << 16);
+ return le16(p) | ((uint32_t)le16(p + 2) << 16);
}
-static int64_t le64(const void *_p) {
+static uint64_t le64(const void *_p) {
const uint8_t *p = _p;
- int64_t v = 0xffffffff & (int64_t)le32(_p);
- return v + ((0xffffffff & (int64_t)le32(p + 4)) << 32);
+ return le32(p) | ((uint64_t)le32(p + 4) << 32);
}
static ssize_t
@@ -470,5 +468,6 @@
assertEqualMem(cd_start, "PK\001\002", 4);
fileblocks_free(fileblocks);
+ free(buff);
free(nulldata);
}
Modified: trunk/contrib/libarchive/libarchive/test/test_write_format_zip_zip64.c
===================================================================
--- trunk/contrib/libarchive/libarchive/test/test_write_format_zip_zip64.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/test/test_write_format_zip_zip64.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -49,6 +49,8 @@
archive_entry_set_size(ae, size);
assertEqualInt(expected, archive_write_header(a, ae));
+ archive_entry_free(ae);
+
/* Don't actually write 4GB! ;-) */
assertEqualIntA(a, ARCHIVE_OK, archive_write_free(a));
}
Copied: trunk/contrib/libarchive/libarchive/test/test_xattr_platform.c (from rev 11133, vendor/libarchive/dist/libarchive/test/test_xattr_platform.c)
===================================================================
--- trunk/contrib/libarchive/libarchive/test/test_xattr_platform.c (rev 0)
+++ trunk/contrib/libarchive/libarchive/test/test_xattr_platform.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -0,0 +1,104 @@
+/*-
+ * Copyright (c) 2003-2010 Tim Kientzle
+ * Copyright (c) 2017 Martin Matuska
+ * 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 "test.h"
+__FBSDID("$FreeBSD$");
+
+DEFINE_TEST(test_xattr_platform)
+{
+#if !ARCHIVE_XATTR_SUPPORT
+ skipping("Extended attributes are not supported on this platform");
+#else /* ARCHIVE_XATTR_SUPPORT */
+ struct archive *a;
+ struct archive_entry *ae;
+ const char *name;
+ const void *value;
+ void *rvalue;
+ size_t size, insize;
+ int e, r;
+ const char *attrname = "user.libarchive.test";
+ const char *readval = "readval";
+ const char *writeval = "writeval";
+
+ assertMakeFile("readtest", 0644, "a");
+
+ if (!setXattr("readtest", attrname, readval, strlen(readval) + 1)) {
+ skipping("Extended attributes are not supported on this "
+ "filesystem");
+ return;
+ }
+
+ /* Read test */
+ assert(NULL != (a = archive_read_disk_new()));
+ ae = archive_entry_new();
+ assert(ae != NULL);
+ archive_entry_set_pathname(ae, "readtest");
+ assertEqualInt(ARCHIVE_OK,
+ archive_read_disk_entry_from_file(a, ae, -1, NULL));
+ e = archive_entry_xattr_reset(ae);
+ assert(e > 0);
+
+ r = 0;
+ while (archive_entry_xattr_next(ae, &name, &value,
+ &size) == ARCHIVE_OK) {
+ if (name != NULL && value != NULL && size > 0 &&
+ strcmp(name, attrname) == 0) {
+ failure("Attribute value does not match");
+ assertEqualString((const char *)value, readval);
+ r = 1;
+ break;
+ }
+ }
+ failure("Attribute not found: %s", attrname);
+ assertEqualInt(r, 1);
+
+ archive_entry_free(ae);
+ assertEqualInt(ARCHIVE_OK, archive_read_free(a));
+
+ assert(NULL != (a = archive_write_disk_new()));
+ archive_write_disk_set_options(a, ARCHIVE_EXTRACT_TIME |
+ ARCHIVE_EXTRACT_PERM | ARCHIVE_EXTRACT_XATTR);
+
+ /* Write test */
+ ae = archive_entry_new();
+ assert(ae != NULL);
+ archive_entry_set_pathname(ae, "writetest");
+ archive_entry_set_filetype(ae, AE_IFREG);
+ archive_entry_set_perm(ae, 0654);
+ archive_entry_set_mtime(ae, 123456, 7890);
+ archive_entry_set_size(ae, 0);
+ archive_entry_xattr_add_entry(ae, attrname, writeval,
+ strlen(writeval) + 1);
+ assertEqualIntA(a, ARCHIVE_OK, archive_write_header(a, ae));
+ archive_entry_free(ae);
+ assertEqualIntA(a, ARCHIVE_OK, archive_write_close(a));
+ assertEqualInt(ARCHIVE_OK, archive_write_free(a));
+
+ rvalue = getXattr("writetest", attrname, &insize);
+ if (assertEqualInt(insize, strlen(writeval) + 1) != 0)
+ assertEqualMem(rvalue, writeval, insize);
+ free(rvalue);
+#endif
+}
Modified: trunk/contrib/libarchive/libarchive/xxhash.c
===================================================================
--- trunk/contrib/libarchive/libarchive/xxhash.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/libarchive/xxhash.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -29,10 +29,11 @@
You can contact the author at :
- xxHash source repository : http://code.google.com/p/xxhash/
*/
+#include "archive_platform.h"
+
#include <stdlib.h>
#include <string.h>
-#include "archive_platform.h"
#include "archive_xxhash.h"
#ifdef HAVE_LIBLZ4
@@ -60,7 +61,7 @@
** By default, xxHash library provides endian-independent Hash values, based on little-endian convention.
** Results are therefore identical for little-endian and big-endian CPU.
** This comes at a performance cost for big-endian CPU, since some swapping is required to emulate little-endian format.
-** Should endian-independance be of no importance for your application, you may set the #define below to 1.
+** Should endian-independence be of no importance for your application, you may set the #define below to 1.
** It will improve speed for Big-endian CPU.
** This option has no impact on Little_Endian CPU.
*/
@@ -140,14 +141,20 @@
# pragma pack(pop)
#endif
-#define A32(x) (((const U32_S *)(x))->v)
-
/****************************************
** Compiler-specific Functions and Macros
*****************************************/
-#define GCC_VERSION (__GNUC__ * 100 + __GNUC_MINOR__)
+#define GCC_VERSION ((__GNUC__-0) * 100 + (__GNUC_MINOR__ - 0))
+#if GCC_VERSION >= 409
+__attribute__((__no_sanitize_undefined__))
+#endif
+static inline U32 A32(const void * x)
+{
+ return (((const U32_S *)(x))->v);
+}
+
/* Note : although _rotl exists for minGW (GCC under windows), performance seems poor */
#if defined(_MSC_VER)
# define XXH_rotl32(x,r) _rotl(x,r)
Modified: trunk/contrib/libarchive/tar/bsdtar.1
===================================================================
--- trunk/contrib/libarchive/tar/bsdtar.1 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/tar/bsdtar.1 2018-06-19 20:42:35 UTC (rev 11134)
@@ -1,4 +1,5 @@
.\" Copyright (c) 2003-2007 Tim Kientzle
+.\" Copyright (c) 2017 Martin Matuska
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
@@ -24,7 +25,7 @@
.\"
.\" $FreeBSD: stable/11/contrib/libarchive/tar/bsdtar.1 299529 2016-05-12 10:16:16Z mm $
.\"
-.Dd September 16, 2014
+.Dd February 25, 2017
.Dt TAR 1
.Os
.Sh NAME
@@ -124,7 +125,7 @@
all operating modes.
.Bl -tag -width indent
.It Cm @ Ns Pa archive
-(c and r mode only)
+(c and r modes only)
The specified archive is opened and the entries
in it will be appended to the current archive.
As a simple example,
@@ -164,6 +165,16 @@
.Dl Nm Fl a Fl jcf Pa archive.xxx source.c source.h
if it is unknown suffix or no suffix, creates a new archive with
restricted pax format and bzip2 compression.
+.It Fl Fl acls
+(c, r, u, x modes only)
+Archive or extract POSIX.1e or NFSv4 ACLs. This is the reverse of
+.Fl Fl no-acls
+and the default behavior in c, r, and u modes (except on Mac OS X) or if
+.Nm
+is run in x mode as root. On Mac OS X this option translates extended ACLs
+to NFSv4 ACLs. To store extended ACLs the
+.Fl Fl mac-metadata
+option is preferred.
.It Fl B , Fl Fl read-full-blocks
Ignored for compatibility with other
.Xr tar 1
@@ -188,15 +199,18 @@
(x mode only)
Before removing file system objects to replace them, clear platform-specific
file flags that might prevent removal.
-.It Fl Fl disable-copyfile
-Mac OS X specific.
-Disable the use of
-.Xr copyfile 3 .
.It Fl Fl exclude Ar pattern
Do not process files or directories that match the
specified pattern.
Note that exclusions take precedence over patterns or filenames
specified on the command line.
+.It Fl Fl fflags
+(c, r, u, x modes only)
+Archive or extract file flags. This is the reverse of
+.Fl Fl no-fflags
+and the default behavior in c, r, and u modes or if
+.Nm
+is run in x mode as root.
.It Fl Fl format Ar format
(c, r, u mode only)
Use the specified format for the created archive.
@@ -245,11 +259,11 @@
in the archive;
the name will not be verified against the system group database.
.It Fl H
-(c and r mode only)
+(c and r modes only)
Symbolic links named on the command line will be followed; the
target of the link will be archived, not the link itself.
.It Fl h
-(c and r mode only)
+(c and r modes only)
Synonym for
.Fl L .
.It Fl I
@@ -259,7 +273,8 @@
Show usage.
.It Fl Fl hfsCompression
(x mode only)
-Mac OS X specific(v10.6 or later). Compress extracted regular files with HFS+ compression.
+Mac OS X specific (v10.6 or later). Compress extracted regular files with HFS+
+compression.
.It Fl Fl ignore-zeros
An alias of
.Fl Fl options Cm read_concatenated_archives
@@ -310,7 +325,7 @@
Do not overwrite existing files that are newer than the
versions appearing in the archive being extracted.
.It Fl L , Fl Fl dereference
-(c and r mode only)
+(c and r modes only)
All symbolic links will be followed.
Normally, symbolic links are archived as such.
With this option, the target of the link will be archived instead.
@@ -345,6 +360,16 @@
(x mode only)
Do not extract modification time.
By default, the modification time is set to the time stored in the archive.
+.It Fl Fl mac-metadata
+(c, r, u and x mode only)
+Mac OS X specific. Archive or extract extended ACLs and extended attributes
+using
+.Xr copyfile 3
+in AppleDouble format. This is the reverse of
+.Fl Fl no-mac-metadata .
+and the default behavior in c, r, and u modes or if
+.Nm
+is run in x mode as root.
.It Fl n , Fl Fl norecurse , Fl Fl no-recursion
(c, r, u modes only)
Do not recursively archive the contents of directories.
@@ -371,7 +396,7 @@
Honor the nodump file flag by skipping this file.
.It Fl Fl nopreserveHFSCompression
(x mode only)
-Mac OS X specific(v10.6 or later). Do not compress extracted regular files
+Mac OS X specific (v10.6 or later). Do not compress extracted regular files
which were compressed with HFS+ compression before archived.
By default, compress the regular files again with HFS+ compression.
.It Fl Fl null
@@ -385,6 +410,30 @@
.Fl print0
option to
.Xr find 1 .
+.It Fl Fl no-acls
+(c, r, u, x modes only)
+Do not archive or extract POSIX.1e or NFSv4 ACLs. This is the reverse of
+.Fl Fl acls
+and the default behavior if
+.Nm
+is run as non-root in x mode (on Mac OS X as any user in c, r, u and x modes).
+.It Fl Fl no-fflags
+(c, r, u, x modes only)
+Do not archive or extract file flags. This is the reverse of
+.Fl Fl fflags
+and the default behavior if
+.Nm
+is run as non-root in x mode.
+.It Fl Fl no-mac-metadata
+(x mode only)
+Mac OS X specific. Do not archive or extract ACLs and extended attributes using
+.Xr copyfile 3
+in AppleDouble format. This is the reverse of
+.Fl Fl mac-metadata .
+and the default behavior if
+.Nm
+is run as non-root in x mode.
+.It Fl n , Fl Fl norecurse , Fl Fl no-recursion
.It Fl Fl no-same-owner
(x mode only)
Do not extract owner and group IDs.
@@ -402,6 +451,13 @@
and the default behavior if
.Nm
is run as non-root.
+.It Fl Fl no-xattrs
+(c, r, u, x modes only)
+Do not archive or extract extended attributes. This is the reverse of
+.Fl Fl xattrs
+and the default behavior if
+.Nm
+is run as non-root in x mode.
.It Fl Fl numeric-owner
This is equivalent to
.Fl Fl uname
@@ -583,14 +639,18 @@
.It Fl p , Fl Fl insecure , Fl Fl preserve-permissions
(x mode only)
Preserve file permissions.
-Attempt to restore the full permissions, including owner, file modes, file
-flags and ACLs, if available, for each item extracted from the archive.
-This is the default, if
+Attempt to restore the full permissions, including owner, file modes, ACLs,
+extended attributes and extended file flags, if available, for each item
+extracted from the archive. This is te reverse of
+.Fl Fl no-same-permissions
+and the default if
.Nm
-is being run by root and can be overridden by also specifying
-.Fl Fl no-same-owner
-and
-.Fl Fl no-same-permissions .
+is being run by root and can be partially overridden by also specifying
+.Fl Fl no-acls ,
+.Fl Fl no-fflags ,
+.Fl Fl no-mac-metadata
+or
+.Fl Fl no-xattrs .
.It Fl Fl passphrase Ar passphrase
The
.Pa passphrase
@@ -692,7 +752,7 @@
.Fl n
as well.
.It Fl Fl totals
-(c, r, u mode only)
+(c, r, u modes only)
After archiving all files, print a summary to stderr.
.It Fl U , Fl Fl unlink , Fl Fl unlink-first
(x mode only)
@@ -754,6 +814,13 @@
See
.Fl Fl exclude
for more information about the handling of exclusions.
+.It Fl Fl xattrs
+(c, r, u, x modes only)
+Archive or extract extended attributes. This is the reverse of
+.Fl Fl no-xattrs
+and the default behavior in c, r, and u modes or if
+.Nm
+is run in x mode as root.
.It Fl y
(c mode only)
Compress the resulting archive with
Modified: trunk/contrib/libarchive/tar/bsdtar.c
===================================================================
--- trunk/contrib/libarchive/tar/bsdtar.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/tar/bsdtar.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -118,11 +118,11 @@
}
#endif
-static void long_help(void);
+static void long_help(void) __LA_DEAD;
static void only_mode(struct bsdtar *, const char *opt,
const char *valid);
static void set_mode(struct bsdtar *, char opt);
-static void version(void);
+static void version(void) __LA_DEAD;
/* A basic set of security flags to request from libarchive. */
#define SECURITY \
@@ -137,7 +137,6 @@
char compression, compression2;
const char *compression_name, *compression2_name;
const char *compress_program;
- char option_a, option_o;
char possible_help_request;
char buff[16];
@@ -150,7 +149,7 @@
bsdtar->fd = -1; /* Mark as "unused" */
bsdtar->gid = -1;
bsdtar->uid = -1;
- option_a = option_o = 0;
+ bsdtar->flags = 0;
compression = compression2 = '\0';
compression_name = compression2_name = NULL;
compress_program = NULL;
@@ -233,6 +232,14 @@
if (getenv(COPYFILE_DISABLE_VAR))
bsdtar->readdisk_flags &= ~ARCHIVE_READDISK_MAC_COPYFILE;
#endif
+#if defined(__APPLE__)
+ /*
+ * On Mac OS ACLs are archived with copyfile() (--mac-metadata)
+ * Translation to NFSv4 ACLs has to be requested explicitly with --acls
+ */
+ bsdtar->readdisk_flags |= ARCHIVE_READDISK_NO_ACL;
+#endif
+
bsdtar->matching = archive_match_new();
if (bsdtar->matching == NULL)
lafe_errc(1, errno, "Out of memory");
@@ -252,8 +259,13 @@
while ((opt = bsdtar_getopt(bsdtar)) != -1) {
switch (opt) {
case 'a': /* GNU tar */
- option_a = 1; /* Record it and resolve it later. */
+ bsdtar->flags |= OPTFLAG_AUTO_COMPRESS;
break;
+ case OPTION_ACLS: /* GNU tar */
+ bsdtar->extract_flags |= ARCHIVE_EXTRACT_ACL;
+ bsdtar->readdisk_flags &= ~ARCHIVE_READDISK_NO_ACL;
+ bsdtar->flags |= OPTFLAG_ACLS;
+ break;
case 'B': /* GNU tar */
/* libarchive doesn't need this; just ignore it. */
break;
@@ -285,18 +297,15 @@
set_mode(bsdtar, opt);
break;
case OPTION_CHECK_LINKS: /* GNU tar */
- bsdtar->option_warn_links = 1;
+ bsdtar->flags |= OPTFLAG_WARN_LINKS;
break;
case OPTION_CHROOT: /* NetBSD */
- bsdtar->option_chroot = 1;
+ bsdtar->flags |= OPTFLAG_CHROOT;
break;
case OPTION_CLEAR_NOCHANGE_FFLAGS:
bsdtar->extract_flags |=
ARCHIVE_EXTRACT_CLEAR_NOCHANGE_FFLAGS;
break;
- case OPTION_DISABLE_COPYFILE: /* Mac OS X */
- bsdtar->readdisk_flags &= ~ARCHIVE_READDISK_MAC_COPYFILE;
- break;
case OPTION_EXCLUDE: /* GNU tar */
if (archive_match_exclude_pattern(
bsdtar->matching, bsdtar->argument) != ARCHIVE_OK)
@@ -303,6 +312,11 @@
lafe_errc(1, 0,
"Couldn't exclude %s\n", bsdtar->argument);
break;
+ case OPTION_FFLAGS:
+ bsdtar->extract_flags |= ARCHIVE_EXTRACT_FFLAGS;
+ bsdtar->readdisk_flags &= ~ARCHIVE_READDISK_NO_FFLAGS;
+ bsdtar->flags |= OPTFLAG_FFLAGS;
+ break;
case OPTION_FORMAT: /* GNU tar, others */
cset_set_format(bsdtar->cset, bsdtar->argument);
break;
@@ -344,7 +358,7 @@
ARCHIVE_EXTRACT_HFS_COMPRESSION_FORCED;
break;
case OPTION_IGNORE_ZEROS:
- bsdtar->option_ignore_zeros = 1;
+ bsdtar->flags |= OPTFLAG_IGNORE_ZEROS;
break;
case 'I': /* GNU tar */
/*
@@ -398,7 +412,7 @@
break;
case 'l': /* SUSv2 and GNU tar beginning with 1.16 */
/* GNU tar 1.13 used -l for --one-file-system */
- bsdtar->option_warn_links = 1;
+ bsdtar->flags |= OPTFLAG_WARN_LINKS;
break;
case OPTION_LRZIP:
case OPTION_LZ4:
@@ -421,8 +435,13 @@
case 'm': /* SUSv2 */
bsdtar->extract_flags &= ~ARCHIVE_EXTRACT_TIME;
break;
+ case OPTION_MAC_METADATA: /* Mac OS X */
+ bsdtar->readdisk_flags |= ARCHIVE_READDISK_MAC_COPYFILE;
+ bsdtar->extract_flags |= ARCHIVE_EXTRACT_MAC_METADATA;
+ bsdtar->flags |= OPTFLAG_MAC_METADATA;
+ break;
case 'n': /* GNU tar */
- bsdtar->option_no_subdirs = 1;
+ bsdtar->flags |= OPTFLAG_NO_SUBDIRS;
break;
/*
* Selecting files by time:
@@ -466,6 +485,21 @@
bsdtar->extract_flags |=
ARCHIVE_EXTRACT_NO_HFS_COMPRESSION;
break;
+ case OPTION_NO_ACLS: /* GNU tar */
+ bsdtar->extract_flags &= ~ARCHIVE_EXTRACT_ACL;
+ bsdtar->readdisk_flags |= ARCHIVE_READDISK_NO_ACL;
+ bsdtar->flags |= OPTFLAG_NO_ACLS;
+ break;
+ case OPTION_NO_FFLAGS:
+ bsdtar->extract_flags &= ~ARCHIVE_EXTRACT_FFLAGS;
+ bsdtar->readdisk_flags |= ARCHIVE_READDISK_NO_FFLAGS;
+ bsdtar->flags |= OPTFLAG_NO_FFLAGS;
+ break;
+ case OPTION_NO_MAC_METADATA: /* Mac OS X */
+ bsdtar->readdisk_flags &= ~ARCHIVE_READDISK_MAC_COPYFILE;
+ bsdtar->extract_flags &= ~ARCHIVE_EXTRACT_MAC_METADATA;
+ bsdtar->flags |= OPTFLAG_NO_MAC_METADATA;
+ break;
case OPTION_NO_SAME_OWNER: /* GNU tar */
bsdtar->extract_flags &= ~ARCHIVE_EXTRACT_OWNER;
break;
@@ -476,23 +510,24 @@
bsdtar->extract_flags &= ~ARCHIVE_EXTRACT_FFLAGS;
bsdtar->extract_flags &= ~ARCHIVE_EXTRACT_MAC_METADATA;
break;
- case OPTION_NO_XATTR: /* Issue #131 */
+ case OPTION_NO_XATTRS: /* GNU tar */
bsdtar->extract_flags &= ~ARCHIVE_EXTRACT_XATTR;
bsdtar->readdisk_flags |= ARCHIVE_READDISK_NO_XATTR;
+ bsdtar->flags |= OPTFLAG_NO_XATTRS;
break;
case OPTION_NULL: /* GNU tar */
- bsdtar->option_null++;
+ bsdtar->flags |= OPTFLAG_NULL;
break;
case OPTION_NUMERIC_OWNER: /* GNU tar */
bsdtar->uname = "";
bsdtar->gname = "";
- bsdtar->option_numeric_owner++;
+ bsdtar->flags |= OPTFLAG_NUMERIC_OWNER;
break;
case 'O': /* GNU tar */
- bsdtar->option_stdout = 1;
+ bsdtar->flags |= OPTFLAG_STDOUT;
break;
case 'o': /* SUSv2 and GNU conflict here, but not fatally */
- option_o = 1; /* Record it and resolve it later. */
+ bsdtar->flags |= OPTFLAG_O;
break;
/*
* Selecting files by time:
@@ -548,7 +583,7 @@
#endif
case 'P': /* GNU tar */
bsdtar->extract_flags &= ~SECURITY;
- bsdtar->option_absolute_paths = 1;
+ bsdtar->flags |= OPTFLAG_ABSOLUTE_PATHS;
break;
case 'p': /* GNU tar, star */
bsdtar->extract_flags |= ARCHIVE_EXTRACT_PERM;
@@ -564,7 +599,7 @@
cset_set_format(bsdtar->cset, "pax");
break;
case 'q': /* FreeBSD GNU tar --fast-read, NetBSD -q */
- bsdtar->option_fast_read = 1;
+ bsdtar->flags |= OPTFLAG_FAST_READ;
break;
case 'r': /* SUSv2 */
set_mode(bsdtar, opt);
@@ -601,11 +636,11 @@
bsdtar->verbose++;
break;
case OPTION_TOTALS: /* GNU tar */
- bsdtar->option_totals++;
+ bsdtar->flags |= OPTFLAG_TOTALS;
break;
case 'U': /* GNU tar */
bsdtar->extract_flags |= ARCHIVE_EXTRACT_UNLINK;
- bsdtar->option_unlink_first = 1;
+ bsdtar->flags |= OPTFLAG_UNLINK_FIRST;
break;
case 'u': /* SUSv2 */
set_mode(bsdtar, opt);
@@ -643,7 +678,7 @@
break;
#endif
case 'w': /* SUSv2 */
- bsdtar->option_interactive = 1;
+ bsdtar->flags |= OPTFLAG_INTERACTIVE;
break;
case 'X': /* GNU tar */
if (archive_match_exclude_pattern_from_file(
@@ -655,6 +690,11 @@
case 'x': /* SUSv2 */
set_mode(bsdtar, opt);
break;
+ case OPTION_XATTRS: /* GNU tar */
+ bsdtar->extract_flags |= ARCHIVE_EXTRACT_XATTR;
+ bsdtar->readdisk_flags &= ~ARCHIVE_READDISK_NO_XATTR;
+ bsdtar->flags |= OPTFLAG_XATTRS;
+ break;
case 'y': /* FreeBSD version of GNU tar */
if (compression != '\0')
lafe_errc(1, 0,
@@ -703,11 +743,11 @@
"Must specify one of -c, -r, -t, -u, -x");
/* Check boolean options only permitted in certain modes. */
- if (option_a)
+ if (bsdtar->flags & OPTFLAG_AUTO_COMPRESS)
only_mode(bsdtar, "-a", "c");
if (bsdtar->readdisk_flags & ARCHIVE_READDISK_NO_TRAVERSE_MOUNTS)
only_mode(bsdtar, "--one-file-system", "cru");
- if (bsdtar->option_fast_read)
+ if (bsdtar->flags & OPTFLAG_FAST_READ)
only_mode(bsdtar, "--fast-read", "xt");
if (bsdtar->extract_flags & ARCHIVE_EXTRACT_HFS_COMPRESSION_FORCED)
only_mode(bsdtar, "--hfsCompression", "x");
@@ -715,9 +755,23 @@
only_mode(bsdtar, "--nopreserveHFSCompression", "x");
if (bsdtar->readdisk_flags & ARCHIVE_READDISK_HONOR_NODUMP)
only_mode(bsdtar, "--nodump", "cru");
- if (bsdtar->readdisk_flags & ARCHIVE_READDISK_NO_XATTR)
- only_mode(bsdtar, "--no-xattr", "crux");
- if (option_o > 0) {
+ if (bsdtar->flags & OPTFLAG_ACLS)
+ only_mode(bsdtar, "--acls", "crux");
+ if (bsdtar->flags & OPTFLAG_NO_ACLS)
+ only_mode(bsdtar, "--no-acls", "crux");
+ if (bsdtar->flags & OPTFLAG_XATTRS)
+ only_mode(bsdtar, "--xattrs", "crux");
+ if (bsdtar->flags & OPTFLAG_NO_XATTRS)
+ only_mode(bsdtar, "--no-xattrs", "crux");
+ if (bsdtar->flags & OPTFLAG_FFLAGS)
+ only_mode(bsdtar, "--fflags", "crux");
+ if (bsdtar->flags & OPTFLAG_NO_FFLAGS)
+ only_mode(bsdtar, "--no-fflags", "crux");
+ if (bsdtar->flags & OPTFLAG_MAC_METADATA)
+ only_mode(bsdtar, "--mac-metadata", "crux");
+ if (bsdtar->flags & OPTFLAG_NO_MAC_METADATA)
+ only_mode(bsdtar, "--no-mac-metadata", "crux");
+ if (bsdtar->flags & OPTFLAG_O) {
switch (bsdtar->mode) {
case 'c':
/*
@@ -730,7 +784,7 @@
break;
case 'x':
/* POSIX-compatible behavior. */
- bsdtar->option_no_owner = 1;
+ bsdtar->flags |= OPTFLAG_NO_OWNER;
bsdtar->extract_flags &= ~ARCHIVE_EXTRACT_OWNER;
break;
default:
@@ -738,16 +792,17 @@
break;
}
}
- if (bsdtar->option_no_subdirs)
+ if (bsdtar->flags & OPTFLAG_NO_SUBDIRS)
only_mode(bsdtar, "-n", "cru");
- if (bsdtar->option_stdout)
+ if (bsdtar->flags & OPTFLAG_STDOUT)
only_mode(bsdtar, "-O", "xt");
- if (bsdtar->option_unlink_first)
+ if (bsdtar->flags & OPTFLAG_UNLINK_FIRST)
only_mode(bsdtar, "-U", "x");
- if (bsdtar->option_warn_links)
+ if (bsdtar->flags & OPTFLAG_WARN_LINKS)
only_mode(bsdtar, "--check-links", "cr");
- if (option_a && cset_auto_compress(bsdtar->cset, bsdtar->filename)) {
+ if ((bsdtar->flags & OPTFLAG_AUTO_COMPRESS) &&
+ cset_auto_compress(bsdtar->cset, bsdtar->filename)) {
/* Ignore specified compressions if auto-compress works. */
compression = '\0';
compression2 = '\0';
Modified: trunk/contrib/libarchive/tar/bsdtar.h
===================================================================
--- trunk/contrib/libarchive/tar/bsdtar.h 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/tar/bsdtar.h 2018-06-19 20:42:35 UTC (rev 11134)
@@ -50,6 +50,7 @@
int bytes_per_block; /* -b block_size */
int bytes_in_last_block; /* See -b handling. */
int verbose; /* -v */
+ unsigned int flags; /* Bitfield of boolean options */
int extract_flags; /* Flags for extract operation */
int readdisk_flags; /* Flags for read disk operation */
int strip_components; /* Remove this many leading dirs */
@@ -60,20 +61,7 @@
const char *passphrase; /* --passphrase */
char mode; /* Program mode: 'c', 't', 'r', 'u', 'x' */
char symlink_mode; /* H or L, per BSD conventions */
- char option_absolute_paths; /* -P */
- char option_chroot; /* --chroot */
- char option_fast_read; /* --fast-read */
const char *option_options; /* --options */
- char option_ignore_zeros; /* --ignore-zeros */
- char option_interactive; /* -w */
- char option_no_owner; /* -o */
- char option_no_subdirs; /* -n */
- char option_numeric_owner; /* --numeric-owner */
- char option_null; /* --null */
- char option_stdout; /* -O */
- char option_totals; /* --totals */
- char option_unlink_first; /* -U */
- char option_warn_links; /* --check-links */
char day_first; /* show day before month in -tv output */
struct creation_set *cset;
@@ -114,14 +102,40 @@
char *ppbuff; /* for util.c */
};
+/* Options for flags bitfield */
+#define OPTFLAG_AUTO_COMPRESS (0x00000001) /* -a */
+#define OPTFLAG_ABSOLUTE_PATHS (0x00000002) /* -P */
+#define OPTFLAG_CHROOT (0x00000004) /* --chroot */
+#define OPTFLAG_FAST_READ (0x00000008) /* --fast-read */
+#define OPTFLAG_IGNORE_ZEROS (0x00000010) /* --ignore-zeros */
+#define OPTFLAG_INTERACTIVE (0x00000020) /* -w */
+#define OPTFLAG_NO_OWNER (0x00000040) /* -o */
+#define OPTFLAG_NO_SUBDIRS (0x00000080) /* -n */
+#define OPTFLAG_NULL (0x00000100) /* --null */
+#define OPTFLAG_NUMERIC_OWNER (0x00000200) /* --numeric-owner */
+#define OPTFLAG_O (0x00000400) /* -o */
+#define OPTFLAG_STDOUT (0x00000800) /* -O */
+#define OPTFLAG_TOTALS (0x00001000) /* --totals */
+#define OPTFLAG_UNLINK_FIRST (0x00002000) /* -U */
+#define OPTFLAG_WARN_LINKS (0x00004000) /* --check-links */
+#define OPTFLAG_NO_XATTRS (0x00008000) /* --no-xattrs */
+#define OPTFLAG_XATTRS (0x00010000) /* --xattrs */
+#define OPTFLAG_NO_ACLS (0x00020000) /* --no-acls */
+#define OPTFLAG_ACLS (0x00040000) /* --acls */
+#define OPTFLAG_NO_FFLAGS (0x00080000) /* --no-fflags */
+#define OPTFLAG_FFLAGS (0x00100000) /* --fflags */
+#define OPTFLAG_NO_MAC_METADATA (0x00200000) /* --no-mac-metadata */
+#define OPTFLAG_MAC_METADATA (0x00400000) /* --mac-metadata */
+
/* Fake short equivalents for long options that otherwise lack them. */
enum {
- OPTION_B64ENCODE = 1,
+ OPTION_ACLS = 1,
+ OPTION_B64ENCODE,
OPTION_CHECK_LINKS,
OPTION_CHROOT,
OPTION_CLEAR_NOCHANGE_FFLAGS,
- OPTION_DISABLE_COPYFILE,
OPTION_EXCLUDE,
+ OPTION_FFLAGS,
OPTION_FORMAT,
OPTION_GID,
OPTION_GNAME,
@@ -136,6 +150,7 @@
OPTION_LZIP,
OPTION_LZMA,
OPTION_LZOP,
+ OPTION_MAC_METADATA,
OPTION_NEWER_CTIME,
OPTION_NEWER_CTIME_THAN,
OPTION_NEWER_MTIME,
@@ -142,9 +157,12 @@
OPTION_NEWER_MTIME_THAN,
OPTION_NODUMP,
OPTION_NOPRESERVE_HFS_COMPRESSION,
+ OPTION_NO_ACLS,
+ OPTION_NO_FFLAGS,
+ OPTION_NO_MAC_METADATA,
OPTION_NO_SAME_OWNER,
OPTION_NO_SAME_PERMISSIONS,
- OPTION_NO_XATTR,
+ OPTION_NO_XATTRS,
OPTION_NULL,
OPTION_NUMERIC_OWNER,
OPTION_OLDER_CTIME,
@@ -162,7 +180,8 @@
OPTION_UNAME,
OPTION_USE_COMPRESS_PROGRAM,
OPTION_UUENCODE,
- OPTION_VERSION
+ OPTION_VERSION,
+ OPTION_XATTRS
};
int bsdtar_getopt(struct bsdtar *);
@@ -170,7 +189,7 @@
int edit_pathname(struct bsdtar *, struct archive_entry *);
int need_report(void);
int pathcmp(const char *a, const char *b);
-void safe_fprintf(FILE *, const char *fmt, ...);
+void safe_fprintf(FILE *, const char *fmt, ...) __LA_PRINTF(2, 3);
void set_chdir(struct bsdtar *, const char *newdir);
const char *tar_i64toa(int64_t);
void tar_mode_c(struct bsdtar *bsdtar);
@@ -178,8 +197,8 @@
void tar_mode_t(struct bsdtar *bsdtar);
void tar_mode_u(struct bsdtar *bsdtar);
void tar_mode_x(struct bsdtar *bsdtar);
-void usage(void);
-int yes(const char *fmt, ...);
+void usage(void) __LA_DEAD;
+int yes(const char *fmt, ...) __LA_PRINTF(1, 2);
#if defined(HAVE_REGEX_H) || defined(HAVE_PCREPOSIX_H)
void add_substitution(struct bsdtar *, const char *);
Modified: trunk/contrib/libarchive/tar/cmdline.c
===================================================================
--- trunk/contrib/libarchive/tar/cmdline.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/tar/cmdline.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -65,6 +65,7 @@
} tar_longopts[] = {
{ "absolute-paths", 0, 'P' },
{ "append", 0, 'r' },
+ { "acls", 0, OPTION_ACLS },
{ "auto-compress", 0, 'a' },
{ "b64encode", 0, OPTION_B64ENCODE },
{ "block-size", 1, 'b' },
@@ -81,11 +82,12 @@
{ "create", 0, 'c' },
{ "dereference", 0, 'L' },
{ "directory", 1, 'C' },
- { "disable-copyfile", 0, OPTION_DISABLE_COPYFILE },
+ { "disable-copyfile", 0, OPTION_NO_MAC_METADATA },
{ "exclude", 1, OPTION_EXCLUDE },
{ "exclude-from", 1, 'X' },
{ "extract", 0, 'x' },
{ "fast-read", 0, 'q' },
+ { "fflags", 0, OPTION_FFLAGS },
{ "file", 1, 'f' },
{ "files-from", 1, 'T' },
{ "format", 1, OPTION_FORMAT },
@@ -108,6 +110,7 @@
{ "lzip", 0, OPTION_LZIP },
{ "lzma", 0, OPTION_LZMA },
{ "lzop", 0, OPTION_LZOP },
+ { "mac-metadata", 0, OPTION_MAC_METADATA },
{ "modification-time", 0, 'm' },
{ "newer", 1, OPTION_NEWER_CTIME },
{ "newer-ctime", 1, OPTION_NEWER_CTIME },
@@ -115,10 +118,14 @@
{ "newer-mtime", 1, OPTION_NEWER_MTIME },
{ "newer-mtime-than", 1, OPTION_NEWER_MTIME_THAN },
{ "newer-than", 1, OPTION_NEWER_CTIME_THAN },
+ { "no-acls", 0, OPTION_NO_ACLS },
+ { "no-fflags", 0, OPTION_NO_FFLAGS },
+ { "no-mac-metadata", 0, OPTION_NO_MAC_METADATA },
{ "no-recursion", 0, 'n' },
{ "no-same-owner", 0, OPTION_NO_SAME_OWNER },
{ "no-same-permissions", 0, OPTION_NO_SAME_PERMISSIONS },
- { "no-xattr", 0, OPTION_NO_XATTR },
+ { "no-xattr", 0, OPTION_NO_XATTRS },
+ { "no-xattrs", 0, OPTION_NO_XATTRS },
{ "nodump", 0, OPTION_NODUMP },
{ "nopreserveHFSCompression",0, OPTION_NOPRESERVE_HFS_COMPRESSION },
{ "norecurse", 0, 'n' },
@@ -151,6 +158,7 @@
{ "uuencode", 0, OPTION_UUENCODE },
{ "verbose", 0, 'v' },
{ "version", 0, OPTION_VERSION },
+ { "xattrs", 0, OPTION_XATTRS },
{ "xz", 0, 'J' },
{ NULL, 0, 0 }
};
Modified: trunk/contrib/libarchive/tar/creation_set.c
===================================================================
--- trunk/contrib/libarchive/tar/creation_set.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/tar/creation_set.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -295,7 +295,7 @@
struct filter_set *v;
int i, r;
- /* Release previos filters. */
+ /* Release previous filters. */
_cleanup_filters(old_filters, old_filter_count);
v = malloc(sizeof(*v) * cset->filter_count);
@@ -308,7 +308,7 @@
cset->filters = v;
return (1);
} else {
- /* Put previos filters back. */
+ /* Put previous filters back. */
cset->filters = old_filters;
cset->filter_count = old_filter_count;
return (0);
Modified: trunk/contrib/libarchive/tar/read.c
===================================================================
--- trunk/contrib/libarchive/tar/read.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/tar/read.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -105,7 +105,7 @@
writer = archive_write_disk_new();
if (writer == NULL)
lafe_errc(1, ENOMEM, "Cannot allocate disk writer object");
- if (!bsdtar->option_numeric_owner)
+ if ((bsdtar->flags & OPTFLAG_NUMERIC_OWNER) == 0)
archive_write_disk_set_standard_lookup(writer);
archive_write_disk_set_options(writer, bsdtar->extract_flags);
@@ -177,7 +177,7 @@
if (bsdtar->names_from_file != NULL)
if (archive_match_include_pattern_from_file(
bsdtar->matching, bsdtar->names_from_file,
- bsdtar->option_null) != ARCHIVE_OK)
+ (bsdtar->flags & OPTFLAG_NULL)) != ARCHIVE_OK)
lafe_errc(1, 0, "Error inclusion pattern: %s",
archive_error_string(bsdtar->matching));
@@ -188,18 +188,17 @@
reader_options = getenv(ENV_READER_OPTIONS);
if (reader_options != NULL) {
+ size_t module_len = sizeof(IGNORE_WRONG_MODULE_NAME) - 1;
+ size_t opt_len = strlen(reader_options) + 1;
char *p;
/* Set default read options. */
- p = (char *)malloc(sizeof(IGNORE_WRONG_MODULE_NAME)
- + strlen(reader_options) + 1);
- if (p == NULL)
+ if ((p = malloc(module_len + opt_len)) == NULL)
lafe_errc(1, errno, "Out of memory");
/* Prepend magic code to ignore options for
* a format or modules which are not added to
* the archive read object. */
- strncpy(p, IGNORE_WRONG_MODULE_NAME,
- sizeof(IGNORE_WRONG_MODULE_NAME) -1);
- strcpy(p + sizeof(IGNORE_WRONG_MODULE_NAME) -1, reader_options);
+ memcpy(p, IGNORE_WRONG_MODULE_NAME, module_len);
+ memcpy(p + module_len, reader_options, opt_len);
r = archive_read_set_options(a, p);
free(p);
if (r == ARCHIVE_FATAL)
@@ -209,7 +208,7 @@
}
if (ARCHIVE_OK != archive_read_set_options(a, bsdtar->option_options))
lafe_errc(1, 0, "%s", archive_error_string(a));
- if (bsdtar->option_ignore_zeros)
+ if (bsdtar->flags & OPTFLAG_IGNORE_ZEROS)
if (archive_read_set_options(a,
"read_concatenated_archives") != ARCHIVE_OK)
lafe_errc(1, 0, "%s", archive_error_string(a));
@@ -235,7 +234,7 @@
&progress_data);
}
- if (mode == 'x' && bsdtar->option_chroot) {
+ if (mode == 'x' && (bsdtar->flags & OPTFLAG_CHROOT)) {
#if HAVE_CHROOT
if (chroot(".") != 0)
lafe_errc(1, errno, "Can't chroot to \".\"");
@@ -246,7 +245,7 @@
}
#if defined(_WIN32) && !defined(__CYGWIN__)
- if (mode == 'x' && bsdtar->option_stdout) {
+ if (mode == 'x' && (bsdtar->flags & OPTFLAG_STDOUT)) {
_setmode(1, _O_BINARY);
}
#endif
@@ -254,7 +253,7 @@
for (;;) {
/* Support --fast-read option */
const char *p;
- if (bsdtar->option_fast_read &&
+ if ((bsdtar->flags & OPTFLAG_FAST_READ) &&
archive_match_path_unmatched_inclusions(bsdtar->matching) == 0)
break;
@@ -308,7 +307,8 @@
if (mode == 't') {
/* Perversely, gtar uses -O to mean "send to stderr"
* when used with -t. */
- out = bsdtar->option_stdout ? stderr : stdout;
+ out = (bsdtar->flags & OPTFLAG_STDOUT) ?
+ stderr : stdout;
/*
* TODO: Provide some reasonable way to
@@ -346,7 +346,7 @@
if (edit_pathname(bsdtar, entry))
continue; /* Excluded by a rewrite failure. */
- if (bsdtar->option_interactive &&
+ if ((bsdtar->flags & OPTFLAG_INTERACTIVE) &&
!yes("extract '%s'", archive_entry_pathname(entry)))
continue;
@@ -365,7 +365,7 @@
/* TODO siginfo_printinfo(bsdtar, 0); */
- if (bsdtar->option_stdout)
+ if (bsdtar->flags & OPTFLAG_STDOUT)
r = archive_read_data_into_fd(a, 1);
else
r = archive_read_extract2(a, entry, writer);
Modified: trunk/contrib/libarchive/tar/test/CMakeLists.txt
===================================================================
--- trunk/contrib/libarchive/tar/test/CMakeLists.txt 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/tar/test/CMakeLists.txt 2018-06-19 20:42:35 UTC (rev 11134)
@@ -6,7 +6,7 @@
IF(ENABLE_TAR AND ENABLE_TEST)
SET(bsdtar_test_SOURCES
../../test_utils/test_utils.c
- main.c
+ ../../test_utils/test_main.c
test.h
test_0.c
test_basic.c
@@ -34,9 +34,11 @@
test_option_U_upper.c
test_option_X_upper.c
test_option_a.c
+ test_option_acls.c
test_option_b.c
test_option_b64encode.c
test_option_exclude.c
+ test_option_fflags.c
test_option_gid_gname.c
test_option_grzip.c
test_option_j.c
@@ -56,6 +58,7 @@
test_option_s.c
test_option_uid_uname.c
test_option_uuencode.c
+ test_option_xattrs.c
test_option_xz.c
test_option_z.c
test_patterns.c
@@ -71,6 +74,16 @@
# Register target
#
ADD_EXECUTABLE(bsdtar_test ${bsdtar_test_SOURCES})
+ IF(ENABLE_ACL)
+ SET(TEST_ACL_LIBS "")
+ IF(HAVE_LIBACL)
+ LIST(APPEND TEST_ACL_LIBS ${ACL_LIBRARY})
+ ENDIF(HAVE_LIBACL)
+ IF(HAVE_LIBRICHACL)
+ LIST(APPEND TEST_ACL_LIBS ${RICHACL_LIBRARY})
+ ENDIF(HAVE_LIBRICHACL)
+ TARGET_LINK_LIBRARIES(bsdtar_test ${TEST_ACL_LIBS})
+ ENDIF(ENABLE_ACL)
SET_PROPERTY(TARGET bsdtar_test PROPERTY COMPILE_DEFINITIONS LIST_H)
#
@@ -96,11 +109,13 @@
INCLUDE(${CMAKE_CURRENT_BINARY_DIR}/list.h)
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR})
INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/test_utils)
+ INCLUDE_DIRECTORIES(${PROJECT_SOURCE_DIR}/tar/test)
# Experimental new test handling
ADD_CUSTOM_TARGET(run_bsdtar_test
COMMAND bsdtar_test -p $<TARGET_FILE:bsdtar>
- -r ${CMAKE_CURRENT_SOURCE_DIR})
+ -r ${CMAKE_CURRENT_SOURCE_DIR}
+ -vv)
ADD_DEPENDENCIES(run_bsdtar_test bsdtar)
ADD_DEPENDENCIES(run_all_tests run_bsdtar_test)
Modified: trunk/contrib/libarchive/tar/test/list.h
===================================================================
--- trunk/contrib/libarchive/tar/test/list.h 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/tar/test/list.h 2018-06-19 20:42:35 UTC (rev 11134)
@@ -17,10 +17,12 @@
DEFINE_TEST(test_leading_slash)
DEFINE_TEST(test_missing_file)
DEFINE_TEST(test_option_a)
+DEFINE_TEST(test_option_acls)
DEFINE_TEST(test_option_b64encode)
DEFINE_TEST(test_option_b)
DEFINE_TEST(test_option_C_upper)
DEFINE_TEST(test_option_exclude)
+DEFINE_TEST(test_option_fflags)
DEFINE_TEST(test_option_gid_gname)
DEFINE_TEST(test_option_grzip)
DEFINE_TEST(test_option_H_upper)
@@ -45,6 +47,7 @@
DEFINE_TEST(test_option_uid_uname)
DEFINE_TEST(test_option_uuencode)
DEFINE_TEST(test_option_U_upper)
+DEFINE_TEST(test_option_xattrs)
DEFINE_TEST(test_option_X_upper)
DEFINE_TEST(test_option_xz)
DEFINE_TEST(test_option_z)
Modified: trunk/contrib/libarchive/tar/test/test.h
===================================================================
--- trunk/contrib/libarchive/tar/test/test.h 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/tar/test/test.h 2018-06-19 20:42:35 UTC (rev 11134)
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003-2006 Tim Kientzle
+ * Copyright (c) 2003-2017 Tim Kientzle
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -22,327 +22,19 @@
* (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: stable/11/contrib/libarchive/tar/test/test.h 307138 2016-10-12 10:28:22Z mm $
+ * $FreeBSD$
*/
/* Every test program should #include "test.h" as the first thing. */
-/*
- * The goal of this file (and the matching test.c) is to
- * simplify the very repetitive test-*.c test programs.
- */
-#if defined(HAVE_CONFIG_H)
-/* Most POSIX platforms use the 'configure' script to build config.h */
-#include "config.h"
-#elif defined(__FreeBSD__)
-/* Building as part of FreeBSD system requires a pre-built config.h. */
-#include "config_freebsd.h"
-#elif defined(_WIN32) && !defined(__CYGWIN__)
-/* Win32 can't run the 'configure' script. */
-#include "config_windows.h"
-#else
-/* Warn if the library hasn't been (automatically or manually) configured. */
-#error Oops: No config.h and no pre-built configuration in test.h.
-#endif
+#define KNOWNREF "test_patterns_2.tar.uu"
+#define ENVBASE "BSDTAR" /* Prefix for environment variables. */
+#define PROGRAM "bsdtar" /* Name of program being tested. */
+#define PROGRAM_ALIAS "tar" /* Generic alias for program */
+#undef LIBRARY /* Not testing a library. */
+#undef EXTRA_DUMP /* How to dump extra data */
+#undef EXTRA_ERRNO /* How to dump errno */
+/* How to generate extra version info. */
+#define EXTRA_VERSION (systemf("%s --version", testprog) ? "" : "")
-#include <sys/types.h> /* Windows requires this before sys/stat.h */
-#include <sys/stat.h>
-
-#if HAVE_DIRENT_H
-#include <dirent.h>
-#endif
-#ifdef HAVE_DIRECT_H
-#include <direct.h>
-#define dirent direct
-#endif
-#include <errno.h>
-#include <fcntl.h>
-#ifdef HAVE_IO_H
-#include <io.h>
-#endif
-#ifdef HAVE_STDINT_H
-#include <stdint.h>
-#endif
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <ctype.h>
-#include <time.h>
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-#include <wchar.h>
-#ifdef HAVE_WINDOWS_H
-#include <windows.h>
-#endif
-
-/*
- * System-specific tweaks. We really want to minimize these
- * as much as possible, since they make it harder to understand
- * the mainline code.
- */
-
-/* Windows (including Visual Studio and MinGW but not Cygwin) */
-#if defined(_WIN32) && !defined(__CYGWIN__)
-#if !defined(__BORLANDC__)
-#undef chdir
-#define chdir _chdir
-#define strdup _strdup
-#endif
-#endif
-
-/* Visual Studio */
-#if defined(_MSC_VER) && _MSC_VER < 1900
-#define snprintf sprintf_s
-#endif
-
-#if defined(__BORLANDC__)
-#pragma warn -8068 /* Constant out of range in comparison. */
-#endif
-
-/* Haiku OS and QNX */
-#if defined(__HAIKU__) || defined(__QNXNTO__)
-/* Haiku and QNX have typedefs in stdint.h (needed for int64_t) */
-#include <stdint.h>
-#endif
-
-/* Get a real definition for __FBSDID if we can */
-#if HAVE_SYS_CDEFS_H
-#include <sys/cdefs.h>
-#endif
-
-/* If not, define it so as to avoid dangling semicolons. */
-#ifndef __FBSDID
-#define __FBSDID(a) struct _undefined_hack
-#endif
-
-#ifndef O_BINARY
-#define O_BINARY 0
-#endif
-
-/*
- * Redefine DEFINE_TEST for use in defining the test functions.
- */
-#undef DEFINE_TEST
-#define DEFINE_TEST(name) void name(void); void name(void)
-
-/* An implementation of the standard assert() macro */
-#define assert(e) assertion_assert(__FILE__, __LINE__, (e), #e, NULL)
-/* chdir() and error if it fails */
-#define assertChdir(path) \
- assertion_chdir(__FILE__, __LINE__, path)
-/* Assert two integers are the same. Reports value of each one if not. */
-#define assertEqualInt(v1,v2) \
- assertion_equal_int(__FILE__, __LINE__, (v1), #v1, (v2), #v2, NULL)
-/* Assert two strings are the same. Reports value of each one if not. */
-#define assertEqualString(v1,v2) \
- assertion_equal_string(__FILE__, __LINE__, (v1), #v1, (v2), #v2, NULL, 0)
-#define assertEqualUTF8String(v1,v2) \
- assertion_equal_string(__FILE__, __LINE__, (v1), #v1, (v2), #v2, NULL, 1)
-/* As above, but v1 and v2 are wchar_t * */
-#define assertEqualWString(v1,v2) \
- assertion_equal_wstring(__FILE__, __LINE__, (v1), #v1, (v2), #v2, NULL)
-/* As above, but raw blocks of bytes. */
-#define assertEqualMem(v1, v2, l) \
- assertion_equal_mem(__FILE__, __LINE__, (v1), #v1, (v2), #v2, (l), #l, NULL)
-/* Assert that memory is full of a specified byte */
-#define assertMemoryFilledWith(v1, l, b) \
- assertion_memory_filled_with(__FILE__, __LINE__, (v1), #v1, (l), #l, (b), #b, NULL)
-/* Assert two files are the same. */
-#define assertEqualFile(f1, f2) \
- assertion_equal_file(__FILE__, __LINE__, (f1), (f2))
-/* Assert that a file is empty. */
-#define assertEmptyFile(pathname) \
- assertion_empty_file(__FILE__, __LINE__, (pathname))
-/* Assert that a file is not empty. */
-#define assertNonEmptyFile(pathname) \
- assertion_non_empty_file(__FILE__, __LINE__, (pathname))
-#define assertFileAtime(pathname, sec, nsec) \
- assertion_file_atime(__FILE__, __LINE__, pathname, sec, nsec)
-#define assertFileAtimeRecent(pathname) \
- assertion_file_atime_recent(__FILE__, __LINE__, pathname)
-#define assertFileBirthtime(pathname, sec, nsec) \
- assertion_file_birthtime(__FILE__, __LINE__, pathname, sec, nsec)
-#define assertFileBirthtimeRecent(pathname) \
- assertion_file_birthtime_recent(__FILE__, __LINE__, pathname)
-/* Assert that a file exists; supports printf-style arguments. */
-#define assertFileExists(pathname) \
- assertion_file_exists(__FILE__, __LINE__, pathname)
-/* Assert that a file exists. */
-#define assertFileNotExists(pathname) \
- assertion_file_not_exists(__FILE__, __LINE__, pathname)
-/* Assert that file contents match a string. */
-#define assertFileContents(data, data_size, pathname) \
- assertion_file_contents(__FILE__, __LINE__, data, data_size, pathname)
-#define assertFileMtime(pathname, sec, nsec) \
- assertion_file_mtime(__FILE__, __LINE__, pathname, sec, nsec)
-#define assertFileMtimeRecent(pathname) \
- assertion_file_mtime_recent(__FILE__, __LINE__, pathname)
-#define assertFileNLinks(pathname, nlinks) \
- assertion_file_nlinks(__FILE__, __LINE__, pathname, nlinks)
-#define assertFileSize(pathname, size) \
- assertion_file_size(__FILE__, __LINE__, pathname, size)
-#define assertTextFileContents(text, pathname) \
- assertion_text_file_contents(__FILE__, __LINE__, text, pathname)
-#define assertFileContainsLinesAnyOrder(pathname, lines) \
- assertion_file_contains_lines_any_order(__FILE__, __LINE__, pathname, lines)
-#define assertIsDir(pathname, mode) \
- assertion_is_dir(__FILE__, __LINE__, pathname, mode)
-#define assertIsHardlink(path1, path2) \
- assertion_is_hardlink(__FILE__, __LINE__, path1, path2)
-#define assertIsNotHardlink(path1, path2) \
- assertion_is_not_hardlink(__FILE__, __LINE__, path1, path2)
-#define assertIsReg(pathname, mode) \
- assertion_is_reg(__FILE__, __LINE__, pathname, mode)
-#define assertIsSymlink(pathname, contents) \
- assertion_is_symlink(__FILE__, __LINE__, pathname, contents)
-/* Create a directory, report error if it fails. */
-#define assertMakeDir(dirname, mode) \
- assertion_make_dir(__FILE__, __LINE__, dirname, mode)
-#define assertMakeFile(path, mode, contents) \
- assertion_make_file(__FILE__, __LINE__, path, mode, -1, contents)
-#define assertMakeBinFile(path, mode, csize, contents) \
- assertion_make_file(__FILE__, __LINE__, path, mode, csize, contents)
-#define assertMakeHardlink(newfile, oldfile) \
- assertion_make_hardlink(__FILE__, __LINE__, newfile, oldfile)
-#define assertMakeSymlink(newfile, linkto) \
- assertion_make_symlink(__FILE__, __LINE__, newfile, linkto)
-#define assertNodump(path) \
- assertion_nodump(__FILE__, __LINE__, path)
-#define assertUmask(mask) \
- assertion_umask(__FILE__, __LINE__, mask)
-#define assertUtimes(pathname, atime, atime_nsec, mtime, mtime_nsec) \
- assertion_utimes(__FILE__, __LINE__, pathname, atime, atime_nsec, mtime, mtime_nsec)
-
-/*
- * This would be simple with C99 variadic macros, but I don't want to
- * require that. Instead, I insert a function call before each
- * skipping() call to pass the file and line information down. Crude,
- * but effective.
- */
-#define skipping \
- skipping_setup(__FILE__, __LINE__);test_skipping
-
-/* Function declarations. These are defined in test_utility.c. */
-void failure(const char *fmt, ...);
-int assertion_assert(const char *, int, int, const char *, void *);
-int assertion_chdir(const char *, int, const char *);
-int assertion_empty_file(const char *, int, const char *);
-int assertion_equal_file(const char *, int, const char *, const char *);
-int assertion_equal_int(const char *, int, long long, const char *, long long, const char *, void *);
-int assertion_equal_mem(const char *, int, const void *, const char *, const void *, const char *, size_t, const char *, void *);
-int assertion_memory_filled_with(const char *, int, const void *, const char *, size_t, const char *, char, const char *, void *);
-int assertion_equal_string(const char *, int, const char *v1, const char *, const char *v2, const char *, void *, int);
-int assertion_equal_wstring(const char *, int, const wchar_t *v1, const char *, const wchar_t *v2, const char *, void *);
-int assertion_file_atime(const char *, int, const char *, long, long);
-int assertion_file_atime_recent(const char *, int, const char *);
-int assertion_file_birthtime(const char *, int, const char *, long, long);
-int assertion_file_birthtime_recent(const char *, int, const char *);
-int assertion_file_contains_lines_any_order(const char *, int, const char *, const char **);
-int assertion_file_contents(const char *, int, const void *, int, const char *);
-int assertion_file_exists(const char *, int, const char *);
-int assertion_file_mode(const char *, int, const char *, int);
-int assertion_file_mtime(const char *, int, const char *, long, long);
-int assertion_file_mtime_recent(const char *, int, const char *);
-int assertion_file_nlinks(const char *, int, const char *, int);
-int assertion_file_not_exists(const char *, int, const char *);
-int assertion_file_size(const char *, int, const char *, long);
-int assertion_is_dir(const char *, int, const char *, int);
-int assertion_is_hardlink(const char *, int, const char *, const char *);
-int assertion_is_not_hardlink(const char *, int, const char *, const char *);
-int assertion_is_reg(const char *, int, const char *, int);
-int assertion_is_symlink(const char *, int, const char *, const char *);
-int assertion_make_dir(const char *, int, const char *, int);
-int assertion_make_file(const char *, int, const char *, int, int, const void *);
-int assertion_make_hardlink(const char *, int, const char *newpath, const char *);
-int assertion_make_symlink(const char *, int, const char *newpath, const char *);
-int assertion_nodump(const char *, int, const char *);
-int assertion_non_empty_file(const char *, int, const char *);
-int assertion_text_file_contents(const char *, int, const char *buff, const char *f);
-int assertion_umask(const char *, int, int);
-int assertion_utimes(const char *, int, const char *, long, long, long, long );
-
-void skipping_setup(const char *, int);
-void test_skipping(const char *fmt, ...);
-
-/* Like sprintf, then system() */
-int systemf(const char * fmt, ...);
-
-/* Delay until time() returns a value after this. */
-void sleepUntilAfter(time_t);
-
-/* Return true if this platform can create symlinks. */
-int canSymlink(void);
-
-/* Return true if this platform can run the "bzip2" program. */
-int canBzip2(void);
-
-/* Return true if this platform can run the "grzip" program. */
-int canGrzip(void);
-
-/* Return true if this platform can run the "gzip" program. */
-int canGzip(void);
-
-/* Return true if this platform can run the specified command. */
-int canRunCommand(const char *);
-
-/* Return true if this platform can run the "lrzip" program. */
-int canLrzip(void);
-
-/* Return true if this platform can run the "lz4" program. */
-int canLz4(void);
-
-/* Return true if this platform can run the "lzip" program. */
-int canLzip(void);
-
-/* Return true if this platform can run the "lzma" program. */
-int canLzma(void);
-
-/* Return true if this platform can run the "lzop" program. */
-int canLzop(void);
-
-/* Return true if this platform can run the "xz" program. */
-int canXz(void);
-
-/* Return true if this filesystem can handle nodump flags. */
-int canNodump(void);
-
-/* Return true if the file has large i-node number(>0xffffffff). */
-int is_LargeInode(const char *);
-
-/* Suck file into string allocated via malloc(). Call free() when done. */
-/* Supports printf-style args: slurpfile(NULL, "%s/myfile", refdir); */
-char *slurpfile(size_t *, const char *fmt, ...);
-
-/* Dump block of bytes to a file. */
-void dumpfile(const char *filename, void *, size_t);
-
-/* Extracts named reference file to the current directory. */
-void extract_reference_file(const char *);
-/* Copies named reference file to the current directory. */
-void copy_reference_file(const char *);
-
-/* Extracts a list of files to the current directory.
- * List must be NULL terminated.
- */
-void extract_reference_files(const char **);
-
-/* Subtract umask from mode */
-mode_t umasked(mode_t expected_mode);
-
-/* Path to working directory for current test */
-extern const char *testworkdir;
-
-/*
- * Special interfaces for program test harness.
- */
-
-/* Pathname of exe to be tested. */
-extern const char *testprogfile;
-/* Name of exe to use in printf-formatted command strings. */
-/* On Windows, this includes leading/trailing quotes. */
-extern const char *testprog;
-
-#ifdef USE_DMALLOC
-#include <dmalloc.h>
-#endif
+#include "test_common.h"
Modified: trunk/contrib/libarchive/tar/test/test_copy.c
===================================================================
--- trunk/contrib/libarchive/tar/test/test_copy.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/tar/test/test_copy.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -285,7 +285,7 @@
/* NOTE: for proper operation on cygwin-1.5 and windows, the
* length of the name of the directory below, "plain", must be
- * less than or equal to the lengthe of the name of the original
+ * less than or equal to the length of the name of the original
* directory, "original" This restriction derives from the
* extremely limited pathname lengths on those platforms.
*/
@@ -327,7 +327,7 @@
/* NOTE: for proper operation on cygwin-1.5 and windows, the
* length of the name of the directory below, "ustar", must be
- * less than or equal to the lengthe of the name of the original
+ * less than or equal to the length of the name of the original
* directory, "original" This restriction derives from the
* extremely limited pathname lengths on those platforms.
*/
Modified: trunk/contrib/libarchive/tar/test/test_leading_slash.c
===================================================================
--- trunk/contrib/libarchive/tar/test/test_leading_slash.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/tar/test/test_leading_slash.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -44,6 +44,7 @@
if (assertFileExists("test.err")) {
errfile = slurpfile(&errfile_size, "test.err");
assert(strstr(errfile, expected_errmsg) != NULL);
+ free(errfile);
}
}
Modified: trunk/contrib/libarchive/tar/test/test_missing_file.c
===================================================================
--- trunk/contrib/libarchive/tar/test/test_missing_file.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/tar/test/test_missing_file.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -27,11 +27,15 @@
DEFINE_TEST(test_missing_file)
{
+ const char * invalid_stderr[] = { "INTERNAL ERROR", NULL };
assertMakeFile("file1", 0644, "file1");
assertMakeFile("file2", 0644, "file2");
assert(0 == systemf("%s -cf archive.tar file1 file2 2>stderr1", testprog));
assertEmptyFile("stderr1");
assert(0 != systemf("%s -cf archive.tar file1 file2 file3 2>stderr2", testprog));
+ assertFileContainsNoInvalidStrings("stderr2", invalid_stderr);
assert(0 != systemf("%s -cf archive.tar 2>stderr3", testprog));
- assert(0 != systemf("%s -cf archive.tar file3 2>stderr4", testprog));
+ assertFileContainsNoInvalidStrings("stderr3", invalid_stderr);
+ assert(0 != systemf("%s -cf archive.tar file3 file4 2>stderr4", testprog));
+ assertFileContainsNoInvalidStrings("stderr4", invalid_stderr);
}
Modified: trunk/contrib/libarchive/tar/test/test_option_a.c
===================================================================
--- trunk/contrib/libarchive/tar/test/test_option_a.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/tar/test/test_option_a.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -43,6 +43,7 @@
assert(s > 2);
failure("The archive should be compressed");
assertEqualMem(p, "\x1f\x9d", 2);
+ free(p);
/* Test2: archive it with .taZ suffix. */
assertEqualInt(0,
@@ -53,6 +54,7 @@
assert(s > 2);
failure("The archive should be compressed");
assertEqualMem(p, "\x1f\x9d", 2);
+ free(p);
/* Test3: archive it with .tar.Z.uu suffix. */
assertEqualInt(0,
@@ -63,6 +65,7 @@
assert(s > 12);
failure("The archive should be uuencoded");
assertEqualMem(p, "begin 644 -\n", 12);
+ free(p);
/* Test4: archive it with .zip suffix. */
assertEqualInt(0,
@@ -73,6 +76,7 @@
assert(s > 4);
failure("The archive should be zipped");
assertEqualMem(p, "\x50\x4b\x03\x04", 4);
+ free(p);
/* Test5: archive it with .tar.Z suffix and --uuencode option. */
assertEqualInt(0,
@@ -84,6 +88,7 @@
assert(s > 2);
failure("The archive should be compressed, ignoring --uuencode option");
assertEqualMem(p, "\x1f\x9d", 2);
+ free(p);
/* Test6: archive it with .xxx suffix(unknown suffix) and
* --uuencode option. */
@@ -96,6 +101,7 @@
assert(s > 12);
failure("The archive should be uuencoded");
assertEqualMem(p, "begin 644 -\n", 12);
+ free(p);
/* Test7: archive it with .tar.Z suffix using a long-name option. */
assertEqualInt(0,
@@ -107,4 +113,5 @@
assert(s > 2);
failure("The archive should be compressed");
assertEqualMem(p, "\x1f\x9d", 2);
+ free(p);
}
Copied: trunk/contrib/libarchive/tar/test/test_option_acls.c (from rev 11133, vendor/libarchive/dist/tar/test/test_option_acls.c)
===================================================================
--- trunk/contrib/libarchive/tar/test/test_option_acls.c (rev 0)
+++ trunk/contrib/libarchive/tar/test/test_option_acls.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -0,0 +1,510 @@
+/*-
+ * Copyright (c) 2017 Martin Matuska
+ * 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 "test.h"
+__FBSDID("$FreeBSD$");
+
+#if ARCHIVE_ACL_FREEBSD || ARCHIVE_ACL_DARWIN || ARCHIVE_ACL_LIBACL
+static const acl_perm_t acl_perms[] = {
+#if ARCHIVE_ACL_DARWIN
+ ACL_READ_DATA,
+ ACL_LIST_DIRECTORY,
+ ACL_WRITE_DATA,
+ ACL_ADD_FILE,
+ ACL_EXECUTE,
+ ACL_SEARCH,
+ ACL_DELETE,
+ ACL_APPEND_DATA,
+ ACL_ADD_SUBDIRECTORY,
+ ACL_DELETE_CHILD,
+ ACL_READ_ATTRIBUTES,
+ ACL_WRITE_ATTRIBUTES,
+ ACL_READ_EXTATTRIBUTES,
+ ACL_WRITE_EXTATTRIBUTES,
+ ACL_READ_SECURITY,
+ ACL_WRITE_SECURITY,
+ ACL_CHANGE_OWNER,
+ ACL_SYNCHRONIZE
+#else /* !ARCHIVE_ACL_DARWIN */
+ ACL_EXECUTE,
+ ACL_WRITE,
+ ACL_READ,
+#if ARCHIVE_ACL_FREEBSD_NFS4
+ ACL_READ_DATA,
+ ACL_LIST_DIRECTORY,
+ ACL_WRITE_DATA,
+ ACL_ADD_FILE,
+ ACL_APPEND_DATA,
+ ACL_ADD_SUBDIRECTORY,
+ ACL_READ_NAMED_ATTRS,
+ ACL_WRITE_NAMED_ATTRS,
+ ACL_DELETE_CHILD,
+ ACL_READ_ATTRIBUTES,
+ ACL_WRITE_ATTRIBUTES,
+ ACL_DELETE,
+ ACL_READ_ACL,
+ ACL_WRITE_ACL,
+ ACL_WRITE_OWNER,
+ ACL_SYNCHRONIZE
+#endif /* ARCHIVE_ACL_FREEBSD_NFS4 */
+#endif /* !ARCHIVE_ACL_DARWIN */
+};
+#if ARCHIVE_ACL_DARWIN || ARCHIVE_ACL_FREEBSD_NFS4
+static const acl_flag_t acl_flags[] = {
+#if ARCHIVE_ACL_DARWIN
+ ACL_ENTRY_INHERITED,
+ ACL_ENTRY_FILE_INHERIT,
+ ACL_ENTRY_DIRECTORY_INHERIT,
+ ACL_ENTRY_LIMIT_INHERIT,
+ ACL_ENTRY_ONLY_INHERIT
+#else /* ARCHIVE_ACL_FREEBSD_NFS4 */
+ ACL_ENTRY_FILE_INHERIT,
+ ACL_ENTRY_DIRECTORY_INHERIT,
+ ACL_ENTRY_NO_PROPAGATE_INHERIT,
+ ACL_ENTRY_INHERIT_ONLY,
+ ACL_ENTRY_SUCCESSFUL_ACCESS,
+ ACL_ENTRY_FAILED_ACCESS,
+ ACL_ENTRY_INHERITED
+#endif /* ARCHIVE_ACL_FREEBSD_NFS4 */
+};
+#endif /* ARCHIVE_ACL_DARWIN || ARCHIVE_ACL_FREEBSD_NFS4 */
+
+/*
+ * Compare two ACL entries on FreeBSD or on Mac OS X
+ */
+static int
+compare_acl_entry(acl_entry_t ae_a, acl_entry_t ae_b, int is_nfs4)
+{
+ acl_tag_t tag_a, tag_b;
+ acl_permset_t permset_a, permset_b;
+ int perm_a, perm_b, perm_start, perm_end;
+ void *qual_a, *qual_b;
+#if ARCHIVE_ACL_FREEBSD_NFS4
+ acl_entry_type_t type_a, type_b;
+#endif
+#if ARCHIVE_ACL_FREEBSD_NFS4 || ARCHIVE_ACL_DARWIN
+ acl_flagset_t flagset_a, flagset_b;
+ int flag_a, flag_b;
+#endif
+ int i, r;
+
+
+ /* Compare ACL tag */
+ r = acl_get_tag_type(ae_a, &tag_a);
+ failure("acl_get_tag_type() error: %s", strerror(errno));
+ if (assertEqualInt(r, 0) == 0)
+ return (-1);
+ r = acl_get_tag_type(ae_b, &tag_b);
+ failure("acl_get_tag_type() error: %s", strerror(errno));
+ if (assertEqualInt(r, 0) == 0)
+ return (-1);
+ if (tag_a != tag_b)
+ return (0);
+
+ /* Compare ACL qualifier */
+#if ARCHIVE_ACL_DARWIN
+ if (tag_a == ACL_EXTENDED_ALLOW || tag_b == ACL_EXTENDED_DENY)
+#else
+ if (tag_a == ACL_USER || tag_a == ACL_GROUP)
+#endif
+ {
+ qual_a = acl_get_qualifier(ae_a);
+ failure("acl_get_qualifier() error: %s", strerror(errno));
+ if (assert(qual_a != NULL) == 0)
+ return (-1);
+ qual_b = acl_get_qualifier(ae_b);
+ failure("acl_get_qualifier() error: %s", strerror(errno));
+ if (assert(qual_b != NULL) == 0) {
+ acl_free(qual_a);
+ return (-1);
+ }
+#if ARCHIVE_ACL_DARWIN
+ if (memcmp(((guid_t *)qual_a)->g_guid,
+ ((guid_t *)qual_b)->g_guid, KAUTH_GUID_SIZE) != 0)
+#else
+ if ((tag_a == ACL_USER &&
+ (*(uid_t *)qual_a != *(uid_t *)qual_b)) ||
+ (tag_a == ACL_GROUP &&
+ (*(gid_t *)qual_a != *(gid_t *)qual_b)))
+#endif
+ {
+ acl_free(qual_a);
+ acl_free(qual_b);
+ return (0);
+ }
+ acl_free(qual_a);
+ acl_free(qual_b);
+ }
+
+#if ARCHIVE_ACL_FREEBSD_NFS4
+ if (is_nfs4) {
+ /* Compare NFS4 ACL type */
+ r = acl_get_entry_type_np(ae_a, &type_a);
+ failure("acl_get_entry_type_np() error: %s", strerror(errno));
+ if (assertEqualInt(r, 0) == 0)
+ return (-1);
+ r = acl_get_entry_type_np(ae_b, &type_b);
+ failure("acl_get_entry_type_np() error: %s", strerror(errno));
+ if (assertEqualInt(r, 0) == 0)
+ return (-1);
+ if (type_a != type_b)
+ return (0);
+ }
+#endif
+
+ /* Compare ACL perms */
+ r = acl_get_permset(ae_a, &permset_a);
+ failure("acl_get_permset() error: %s", strerror(errno));
+ if (assertEqualInt(r, 0) == 0)
+ return (-1);
+ r = acl_get_permset(ae_b, &permset_b);
+ failure("acl_get_permset() error: %s", strerror(errno));
+ if (assertEqualInt(r, 0) == 0)
+ return (-1);
+
+ perm_start = 0;
+ perm_end = (int)(sizeof(acl_perms) / sizeof(acl_perms[0]));
+#if ARCHIVE_ACL_FREEBSD_NFS4
+ if (is_nfs4)
+ perm_start = 3;
+ else
+ perm_end = 3;
+#endif
+ /* Cycle through all perms and compare their value */
+ for (i = perm_start; i < perm_end; i++) {
+#if ARCHIVE_ACL_LIBACL
+ perm_a = acl_get_perm(permset_a, acl_perms[i]);
+ perm_b = acl_get_perm(permset_b, acl_perms[i]);
+#else
+ perm_a = acl_get_perm_np(permset_a, acl_perms[i]);
+ perm_b = acl_get_perm_np(permset_b, acl_perms[i]);
+#endif
+ if (perm_a == -1 || perm_b == -1)
+ return (-1);
+ if (perm_a != perm_b)
+ return (0);
+ }
+
+#if ARCHIVE_ACL_FREEBSD_NFS4 || ARCHIVE_ACL_DARWIN
+ if (is_nfs4) {
+ r = acl_get_flagset_np(ae_a, &flagset_a);
+ failure("acl_get_flagset_np() error: %s", strerror(errno));
+ if (assertEqualInt(r, 0) == 0)
+ return (-1);
+ r = acl_get_flagset_np(ae_b, &flagset_b);
+ failure("acl_get_flagset_np() error: %s", strerror(errno));
+ if (assertEqualInt(r, 0) == 0)
+ return (-1);
+ /* Cycle through all flags and compare their status */
+ for (i = 0; i < (int)(sizeof(acl_flags) / sizeof(acl_flags[0]));
+ i++) {
+ flag_a = acl_get_flag_np(flagset_a, acl_flags[i]);
+ flag_b = acl_get_flag_np(flagset_b, acl_flags[i]);
+ if (flag_a == -1 || flag_b == -1)
+ return (-1);
+ if (flag_a != flag_b)
+ return (0);
+ }
+ }
+#else /* ARCHIVE_ACL_FREEBSD_NFS4 || ARCHIVE_ACL_DARWIN */
+ (void)is_nfs4; /* UNUSED */
+#endif
+ return (1);
+}
+#endif /* ARCHIVE_ACL_FREEBSD || ARCHIVE_ACL_DARWIN || ARCHIVE_ACL_LIBACL */
+
+#if ARCHIVE_ACL_SUPPORT
+/*
+ * Clear default ACLs or inheritance flags
+ */
+static void
+clear_inheritance_flags(const char *path, int type)
+{
+ switch (type) {
+ case ARCHIVE_TEST_ACL_TYPE_POSIX1E:
+#if ARCHIVE_ACL_POSIX1E
+#if !ARCHIVE_ACL_SUNOS
+ acl_delete_def_file(path);
+#else
+ /* Solaris */
+ setTestAcl(path);
+#endif
+#endif /* ARCHIVE_ACL_POSIX1E */
+ break;
+ case ARCHIVE_TEST_ACL_TYPE_NFS4:
+#if ARCHIVE_ACL_NFS4
+ setTestAcl(path);
+#endif
+ break;
+ default:
+ (void)path; /* UNUSED */
+ break;
+ }
+}
+
+static int
+compare_acls(const char *path_a, const char *path_b)
+{
+ int ret = 1;
+ int is_nfs4 = 0;
+#if ARCHIVE_ACL_SUNOS
+ void *acl_a, *acl_b;
+ int aclcnt_a, aclcnt_b;
+ aclent_t *aclent_a, *aclent_b;
+ ace_t *ace_a, *ace_b;
+ int e;
+#elif ARCHIVE_ACL_DARWIN || ARCHIVE_ACL_FREEBSD || ARCHIVE_ACL_LIBACL
+ acl_t acl_a, acl_b;
+ acl_entry_t aclent_a, aclent_b;
+ int a, b, r;
+#endif
+#if ARCHIVE_ACL_LIBRICHACL
+ struct richacl *richacl_a, *richacl_b;
+
+ richacl_a = NULL;
+ richacl_b = NULL;
+#endif
+
+#if ARCHIVE_ACL_DARWIN || ARCHIVE_ACL_FREEBSD || ARCHIVE_ACL_LIBACL || \
+ ARCHIVE_ACL_SUNOS
+ acl_a = NULL;
+ acl_b = NULL;
+#endif
+#if ARCHIVE_ACL_SUNOS
+ acl_a = sunacl_get(GETACL, &aclcnt_a, 0, path_a);
+ if (acl_a == NULL) {
+#if ARCHIVE_ACL_SUNOS_NFS4
+ is_nfs4 = 1;
+ acl_a = sunacl_get(ACE_GETACL, &aclcnt_a, 0, path_a);
+#endif
+ failure("acl_get() error: %s", strerror(errno));
+ if (assert(acl_a != NULL) == 0)
+ return (-1);
+#if ARCHIVE_ACL_SUNOS_NFS4
+ acl_b = sunacl_get(ACE_GETACL, &aclcnt_b, 0, path_b);
+#endif
+ } else
+ acl_b = sunacl_get(GETACL, &aclcnt_b, 0, path_b);
+ if (acl_b == NULL && (errno == ENOSYS || errno == ENOTSUP)) {
+ free(acl_a);
+ return (0);
+ }
+ failure("acl_get() error: %s", strerror(errno));
+ if (assert(acl_b != NULL) == 0) {
+ free(acl_a);
+ return (-1);
+ }
+
+ if (aclcnt_a != aclcnt_b) {
+ ret = 0;
+ goto exit_free;
+ }
+
+ for (e = 0; e < aclcnt_a; e++) {
+ if (!is_nfs4) {
+ aclent_a = &((aclent_t *)acl_a)[e];
+ aclent_b = &((aclent_t *)acl_b)[e];
+ if (aclent_a->a_type != aclent_b->a_type ||
+ aclent_a->a_id != aclent_b->a_id ||
+ aclent_a->a_perm != aclent_b->a_perm) {
+ ret = 0;
+ goto exit_free;
+ }
+ }
+#if ARCHIVE_ACL_SUNOS_NFS4
+ else {
+ ace_a = &((ace_t *)acl_a)[e];
+ ace_b = &((ace_t *)acl_b)[e];
+ if (ace_a->a_who != ace_b->a_who ||
+ ace_a->a_access_mask != ace_b->a_access_mask ||
+ ace_a->a_flags != ace_b->a_flags ||
+ ace_a->a_type != ace_b->a_type) {
+ ret = 0;
+ goto exit_free;
+ }
+ }
+#endif
+ }
+#else /* !ARCHIVE_ACL_SUNOS */
+#if ARCHIVE_ACL_LIBRICHACL
+ richacl_a = richacl_get_file(path_a);
+#if !ARCHIVE_ACL_LIBACL
+ if (richacl_a == NULL &&
+ (errno == ENODATA || errno == ENOTSUP || errno == ENOSYS))
+ return (0);
+ failure("richacl_get_file() error: %s (%s)", path_a, strerror(errno));
+ if (assert(richacl_a != NULL) == 0)
+ return (-1);
+#endif
+ if (richacl_a != NULL) {
+ richacl_b = richacl_get_file(path_b);
+ if (richacl_b == NULL &&
+ (errno == ENODATA || errno == ENOTSUP || errno == ENOSYS)) {
+ richacl_free(richacl_a);
+ return (0);
+ }
+ failure("richacl_get_file() error: %s (%s)", path_b,
+ strerror(errno));
+ if (assert(richacl_b != NULL) == 0) {
+ richacl_free(richacl_a);
+ return (-1);
+ }
+ if (richacl_compare(richacl_a, richacl_b) == 0)
+ ret = 0;
+ richacl_free(richacl_a);
+ richacl_free(richacl_b);
+ return (ret);
+ }
+#endif /* ARCHIVE_ACL_LIBRICHACL */
+#if ARCHIVE_ACL_DARWIN || ARCHIVE_ACL_FREEBSD || ARCHIVE_ACL_LIBACL
+#if ARCHIVE_ACL_DARWIN
+ is_nfs4 = 1;
+ acl_a = acl_get_file(path_a, ACL_TYPE_EXTENDED);
+#elif ARCHIVE_ACL_FREEBSD_NFS4
+ acl_a = acl_get_file(path_a, ACL_TYPE_NFS4);
+ if (acl_a != NULL)
+ is_nfs4 = 1;
+#endif
+ if (acl_a == NULL)
+ acl_a = acl_get_file(path_a, ACL_TYPE_ACCESS);
+ failure("acl_get_file() error: %s (%s)", path_a, strerror(errno));
+ if (assert(acl_a != NULL) == 0)
+ return (-1);
+#if ARCHIVE_ACL_DARWIN
+ acl_b = acl_get_file(path_b, ACL_TYPE_EXTENDED);
+#elif ARCHIVE_ACL_FREEBSD_NFS4
+ acl_b = acl_get_file(path_b, ACL_TYPE_NFS4);
+#endif
+#if !ARCHIVE_ACL_DARWIN
+ if (acl_b == NULL) {
+#if ARCHIVE_ACL_FREEBSD_NFS4
+ if (is_nfs4) {
+ acl_free(acl_a);
+ return (0);
+ }
+#endif
+ acl_b = acl_get_file(path_b, ACL_TYPE_ACCESS);
+ }
+ failure("acl_get_file() error: %s (%s)", path_b, strerror(errno));
+ if (assert(acl_b != NULL) == 0) {
+ acl_free(acl_a);
+ return (-1);
+ }
+#endif
+ a = acl_get_entry(acl_a, ACL_FIRST_ENTRY, &aclent_a);
+ if (a == -1) {
+ ret = 0;
+ goto exit_free;
+ }
+ b = acl_get_entry(acl_b, ACL_FIRST_ENTRY, &aclent_b);
+ if (b == -1) {
+ ret = 0;
+ goto exit_free;
+ }
+#if ARCHIVE_ACL_DARWIN
+ while (a == 0 && b == 0)
+#else /* FreeBSD, Linux */
+ while (a == 1 && b == 1)
+#endif
+ {
+ r = compare_acl_entry(aclent_a, aclent_b, is_nfs4);
+ if (r != 1) {
+ ret = r;
+ goto exit_free;
+ }
+ a = acl_get_entry(acl_a, ACL_NEXT_ENTRY, &aclent_a);
+ b = acl_get_entry(acl_b, ACL_NEXT_ENTRY, &aclent_b);
+ }
+ /* Entry count must match */
+ if (a != b)
+ ret = 0;
+#endif /* ARCHIVE_ACL_DARWIN || ARCHIVE_ACL_FREEBSD || ARCHIVE_ACL_LIBACL */
+#endif /* !ARCHIVE_ACL_SUNOS */
+exit_free:
+#if ARCHIVE_ACL_SUNOS
+ free(acl_a);
+ free(acl_b);
+#else
+ acl_free(acl_a);
+ acl_free(acl_b);
+#endif
+ return (ret);
+}
+#endif /* ARCHIVE_ACL_SUPPORT */
+
+DEFINE_TEST(test_option_acls)
+{
+#if !ARCHIVE_ACL_SUPPORT
+ skipping("ACLs are not supported on this platform");
+#else /* ARCHIVE_ACL_SUPPORT */
+ int acltype, r;
+
+ assertMakeFile("f", 0644, "a");
+ acltype = setTestAcl("f");
+ if (acltype == 0) {
+ skipping("Can't write ACLs on the filesystem");
+ return;
+ }
+
+ /* Archive it with acls */
+ r = systemf("%s -c --no-mac-metadata --acls -f acls.tar f >acls.out 2>acls.err", testprog);
+ assertEqualInt(r, 0);
+
+ /* Archive it without acls */
+ r = systemf("%s -c --no-mac-metadata --no-acls -f noacls.tar f >noacls.out 2>noacls.err", testprog);
+ assertEqualInt(r, 0);
+
+ /* Extract acls with acls */
+ assertMakeDir("acls_acls", 0755);
+ clear_inheritance_flags("acls_acls", acltype);
+ r = systemf("%s -x -C acls_acls --no-same-permissions --acls -f acls.tar >acls_acls.out 2>acls_acls.err", testprog);
+ assertEqualInt(r, 0);
+ r = compare_acls("f", "acls_acls/f");
+ assertEqualInt(r, 1);
+
+ /* Extractl acls without acls */
+ assertMakeDir("acls_noacls", 0755);
+ clear_inheritance_flags("acls_noacls", acltype);
+ r = systemf("%s -x -C acls_noacls -p --no-acls -f acls.tar >acls_noacls.out 2>acls_noacls.err", testprog);
+ assertEqualInt(r, 0);
+ r = compare_acls("f", "acls_noacls/f");
+ assertEqualInt(r, 0);
+
+ /* Extract noacls with acls flag */
+ assertMakeDir("noacls_acls", 0755);
+ clear_inheritance_flags("noacls_acls", acltype);
+ r = systemf("%s -x -C noacls_acls --no-same-permissions --acls -f noacls.tar >noacls_acls.out 2>noacls_acls.err", testprog);
+ assertEqualInt(r, 0);
+ r = compare_acls("f", "noacls_acls/f");
+ assertEqualInt(r, 0);
+
+ /* Extract noacls with noacls */
+ assertMakeDir("noacls_noacls", 0755);
+ clear_inheritance_flags("noacls_noacls", acltype);
+ r = systemf("%s -x -C noacls_noacls -p --no-acls -f noacls.tar >noacls_noacls.out 2>noacls_noacls.err", testprog);
+ assertEqualInt(r, 0);
+ r = compare_acls("f", "noacls_noacls/f");
+ assertEqualInt(r, 0);
+#endif /* ARCHIVE_ACL_SUPPORT */
+}
Modified: trunk/contrib/libarchive/tar/test/test_option_b.c
===================================================================
--- trunk/contrib/libarchive/tar/test/test_option_b.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/tar/test/test_option_b.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -33,7 +33,7 @@
assertMakeFile("file1", 0644, "file1");
if (systemf("cat file1 > test_cat.out 2> test_cat.err") != 0) {
- skipping("Platform doesn't have cat");
+ skipping("This test requires a `cat` program");
return;
}
testprog_ustar = malloc(strlen(testprog) + sizeof(USTAR_OPT) + 1);
@@ -78,4 +78,6 @@
* Note: It's not possible to verify at this level that blocks
* are getting written with the
*/
+
+ free(testprog_ustar);
}
Modified: trunk/contrib/libarchive/tar/test/test_option_b64encode.c
===================================================================
--- trunk/contrib/libarchive/tar/test/test_option_b64encode.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/tar/test/test_option_b64encode.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -42,6 +42,7 @@
p = slurpfile(&s, "archive.out");
assert(s > 2);
assertEqualMem(p, "begin-base64 644", 16);
+ free(p);
/* Archive it with uuencode only. */
assertEqualInt(0,
@@ -51,4 +52,5 @@
p = slurpfile(&s, "archive.out");
assert(s > 2);
assertEqualMem(p, "begin-base64 644", 16);
+ free(p);
}
Copied: trunk/contrib/libarchive/tar/test/test_option_fflags.c (from rev 11133, vendor/libarchive/dist/tar/test/test_option_fflags.c)
===================================================================
--- trunk/contrib/libarchive/tar/test/test_option_fflags.c (rev 0)
+++ trunk/contrib/libarchive/tar/test/test_option_fflags.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -0,0 +1,106 @@
+/*-
+ * Copyright (c) 2017 Martin Matuska
+ * 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 "test.h"
+__FBSDID("$FreeBSD$");
+
+static void
+clear_fflags(const char *pathname)
+{
+#if defined(HAVE_STRUCT_STAT_ST_FLAGS)
+ chflags(pathname, 0);
+#elif (defined(FS_IOC_GETFLAGS) && defined(HAVE_WORKING_FS_IOC_GETFLAGS)) || \
+ (defined(EXT2_IOC_GETFLAGS) && defined(HAVE_WORKING_EXT2_IOC_GETFLAGS))
+ int fd;
+
+ fd = open(pathname, O_RDONLY | O_NONBLOCK);
+ if (fd < 0)
+ return;
+ ioctl(fd,
+#ifdef FS_IOC_GETFLAGS
+ FS_IOC_GETFLAGS,
+#else
+ EXT2_IOC_GETFLAGS,
+#endif
+ 0);
+#else
+ (void)pathname; /* UNUSED */
+#endif
+ return;
+}
+
+DEFINE_TEST(test_option_fflags)
+{
+ int r;
+
+ if (!canNodump()) {
+ skipping("Can't test nodump flag on this filesystem");
+ return;
+ }
+
+ /* Create a file. */
+ assertMakeFile("f", 0644, "a");
+
+ /* Set nodump flag on the file */
+ assertSetNodump("f");
+
+ /* FreeBSD ZFS workaround: ZFS sets uarch on all touched files and dirs */
+ chmod("f", 0644);
+
+ /* Archive it with fflags */
+ r = systemf("%s -c --fflags -f fflags.tar f >fflags.out 2>fflags.err", testprog);
+ assertEqualInt(r, 0);
+
+ /* Archive it without fflags */
+ r = systemf("%s -c --no-fflags -f nofflags.tar f >nofflags.out 2>nofflags.err", testprog);
+ assertEqualInt(r, 0);
+
+ /* Extract fflags with fflags */
+ assertMakeDir("fflags_fflags", 0755);
+ clear_fflags("fflags_fflags");
+ r = systemf("%s -x -C fflags_fflags --no-same-permissions --fflags -f fflags.tar >fflags_fflags.out 2>fflags_fflags.err", testprog);
+ assertEqualInt(r, 0);
+ assertEqualFflags("f", "fflags_fflags/f");
+
+ /* Extract fflags without fflags */
+ assertMakeDir("fflags_nofflags", 0755);
+ clear_fflags("fflags_nofflags");
+ r = systemf("%s -x -C fflags_nofflags -p --no-fflags -f fflags.tar >fflags_nofflags.out 2>fflags_nofflags.err", testprog);
+ assertEqualInt(r, 0);
+ assertUnequalFflags("f", "fflags_nofflags/f");
+
+ /* Extract nofflags with fflags */
+ assertMakeDir("nofflags_fflags", 0755);
+ clear_fflags("nofflags_fflags");
+ r = systemf("%s -x -C nofflags_fflags --no-same-permissions --fflags -f nofflags.tar >nofflags_fflags.out 2>nofflags_fflags.err", testprog);
+ assertEqualInt(r, 0);
+ assertUnequalFflags("f", "nofflags_fflags/f");
+
+ /* Extract nofflags with nofflags */
+ assertMakeDir("nofflags_nofflags", 0755);
+ clear_fflags("nofflags_nofflags");
+ r = systemf("%s -x -C nofflags_nofflags -p --no-fflags -f nofflags.tar >nofflags_nofflags.out 2>nofflags_nofflags.err", testprog);
+ assertEqualInt(r, 0);
+ assertUnequalFflags("f", "nofflags_nofflags/f");
+}
Modified: trunk/contrib/libarchive/tar/test/test_option_gid_gname.c
===================================================================
--- trunk/contrib/libarchive/tar/test/test_option_gid_gname.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/tar/test/test_option_gid_gname.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -53,6 +53,7 @@
/* Should force gid and gname fields in ustar header. */
assertEqualMem(data + 116, "000021 \0", 8);
assertEqualMem(data + 297, "foofoofoo\0", 10);
+ free(data);
/* Again with just --gname */
failure("Error invoking %s c", testprog);
@@ -65,6 +66,8 @@
/* Gid should be unchanged from original reference. */
assertEqualMem(data + 116, reference + 116, 8);
assertEqualMem(data + 297, "foofoofoo\0", 10);
+ free(data);
+ free(reference);
/* Again with --gid and force gname to empty. */
failure("Error invoking %s c", testprog);
@@ -77,6 +80,7 @@
assertEqualMem(data + 116, "000021 \0", 8);
/* Gname field in ustar header should be empty. */
assertEqualMem(data + 297, "\0", 1);
+ free(data);
/* TODO: It would be nice to verify that --gid= by itself
* will look up the associated gname and use that, but
Modified: trunk/contrib/libarchive/tar/test/test_option_grzip.c
===================================================================
--- trunk/contrib/libarchive/tar/test/test_option_grzip.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/tar/test/test_option_grzip.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -45,8 +45,11 @@
testprog));
p = slurpfile(&s, "archive.err");
p[s] = '\0';
+ free(p);
+
/* Check that the archive file has an grzip signature. */
p = slurpfile(&s, "archive.out");
assert(s > 2);
assertEqualMem(p, "GRZipII\x00\x02\x04:)", 12);
+ free(p);
}
Modified: trunk/contrib/libarchive/tar/test/test_option_j.c
===================================================================
--- trunk/contrib/libarchive/tar/test/test_option_j.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/tar/test/test_option_j.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -42,15 +42,18 @@
if (r != 0) {
if (!canBzip2()) {
skipping("bzip2 is not supported on this platform");
- return;
+ goto done;
}
failure("-j option is broken");
assertEqualInt(r, 0);
- return;
+ goto done;
}
+ free(p);
assertEmptyFile("archive.err");
/* Check that the archive file has a bzip2 signature. */
p = slurpfile(&s, "archive.out");
assert(s > 2);
assertEqualMem(p, "BZh9", 4);
+done:
+ free(p);
}
Modified: trunk/contrib/libarchive/tar/test/test_option_lrzip.c
===================================================================
--- trunk/contrib/libarchive/tar/test/test_option_lrzip.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/tar/test/test_option_lrzip.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -45,8 +45,10 @@
testprog));
p = slurpfile(&s, "archive.err");
p[s] = '\0';
+ free(p);
/* Check that the archive file has an lzma signature. */
p = slurpfile(&s, "archive.out");
assert(s > 2);
assertEqualMem(p, "LRZI\x00", 5);
+ free(p);
}
Modified: trunk/contrib/libarchive/tar/test/test_option_lz4.c
===================================================================
--- trunk/contrib/libarchive/tar/test/test_option_lz4.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/tar/test/test_option_lz4.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -43,7 +43,7 @@
if (strstr(p, "Unsupported compression") != NULL) {
skipping("This version of bsdtar was compiled "
"without lz4 support");
- return;
+ goto done;
}
/* POSIX permits different handling of the spawnp
* system call used to launch the subsidiary
@@ -52,7 +52,7 @@
if (strstr(p, "Can't launch") != NULL && !canLz4()) {
skipping("This version of bsdtar uses an external lz4 program "
"but no such program is available on this system.");
- return;
+ goto done;
}
/* Some systems successfully spawn the new process,
* but fail to exec a program within that process.
@@ -61,14 +61,25 @@
if (strstr(p, "Can't write") != NULL && !canLz4()) {
skipping("This version of bsdtar uses an external lz4 program "
"but no such program is available on this system.");
+ goto done;
+ }
+ /* On some systems the error won't be detected until closing
+ time, by a 127 exit error returned by waitpid. */
+ if (strstr(p, "Error closing") != NULL && !canLz4()) {
+ skipping("This version of bsdcpio uses an external lz4 program "
+ "but no such program is available on this system.");
return;
}
failure("--lz4 option is broken: %s", p);
assertEqualInt(r, 0);
- return;
+ goto done;
}
+ free(p);
/* Check that the archive file has an lz4 signature. */
p = slurpfile(&s, "archive.out");
assert(s > 2);
assertEqualMem(p, "\x04\x22\x4d\x18", 4);
+
+done:
+ free(p);
}
Modified: trunk/contrib/libarchive/tar/test/test_option_lzma.c
===================================================================
--- trunk/contrib/libarchive/tar/test/test_option_lzma.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/tar/test/test_option_lzma.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -48,10 +48,13 @@
}
failure("--lzma option is broken");
assertEqualInt(r, 0);
- return;
+ goto done;
}
+ free(p);
/* Check that the archive file has an lzma signature. */
p = slurpfile(&s, "archive.out");
assert(s > 2);
assertEqualMem(p, "\x5d\00\00", 3);
+done:
+ free(p);
}
Modified: trunk/contrib/libarchive/tar/test/test_option_lzop.c
===================================================================
--- trunk/contrib/libarchive/tar/test/test_option_lzop.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/tar/test/test_option_lzop.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -42,14 +42,17 @@
if (r != 0) {
if (!canLzop()) {
skipping("lzop is not supported on this platform");
- return;
+ goto done;
}
failure("--lzop option is broken");
assertEqualInt(r, 0);
- return;
+ goto done;
}
+ free(p);
/* Check that the archive file has an lzma signature. */
p = slurpfile(&s, "archive.out");
assert(s > 2);
assertEqualMem(p, "\x89\x4c\x5a\x4f\x00\x0d\x0a\x1a\x0a", 9);
+done:
+ free(p);
}
Modified: trunk/contrib/libarchive/tar/test/test_option_nodump.c
===================================================================
--- trunk/contrib/libarchive/tar/test/test_option_nodump.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/tar/test/test_option_nodump.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -36,7 +36,7 @@
assertMakeFile("file1", 0644, "file1");
assertMakeFile("file2", 0644, "file2");
assertMakeFile("file3", 0644, "file3");
- assertNodump("file2");
+ assertSetNodump("file2");
/* Test 1: Without --nodump */
assertEqualInt(0, systemf("%s -cf test1.tar file1 file2 file3",
Modified: trunk/contrib/libarchive/tar/test/test_option_r.c
===================================================================
--- trunk/contrib/libarchive/tar/test/test_option_r.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/tar/test/test_option_r.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -36,6 +36,10 @@
size_t s, buff_size_rounded;
int r, i;
+ buff = NULL;
+ p0 = NULL;
+ p1 = NULL;
+
/* Create an archive with one file. */
assertMakeFile("f1", 0644, "abc");
r = systemf("%s cf archive.tar --format=ustar f1 >step1.out 2>step1.err", testprog);
@@ -47,11 +51,9 @@
/* Do some basic validation of the constructed archive. */
p0 = slurpfile(&s, "archive.tar");
if (!assert(p0 != NULL))
- return;
- if (!assert(s >= 2048)) {
- free(p0);
- return;
- }
+ goto done;
+ if (!assert(s >= 2048))
+ goto done;
assertEqualMem(p0 + 0, "f1", 3);
assertEqualMem(p0 + 512, "abc", 3);
assertEqualMem(p0 + 1024, "\0\0\0\0\0\0\0\0", 8);
@@ -60,10 +62,8 @@
/* Edit that file with a lot more data and update the archive with a new copy. */
buff = malloc(buff_size);
assert(buff != NULL);
- if (buff == NULL) {
- free(p0);
- return;
- }
+ if (buff == NULL)
+ goto done;
for (i = 0; i < (int)buff_size; ++i)
buff[i] = "abcdefghijklmnopqrstuvwxyz"[rand() % 26];
@@ -77,10 +77,8 @@
/* The constructed archive should just have the new entry appended. */
p1 = slurpfile(&s, "archive.tar");
- if (!assert(p1 != NULL)) {
- free(p0);
- return;
- }
+ if (!assert(p1 != NULL))
+ goto done;
buff_size_rounded = ((buff_size + 511) / 512) * 512;
assert(s >= 2560 + buff_size_rounded);
/* Verify first entry is unchanged. */
@@ -105,10 +103,8 @@
/* Validate the constructed archive. */
p1 = slurpfile(&s, "archive.tar");
- if (!assert(p1 != NULL)) {
- free(p0);
- return;
- }
+ if (!assert(p1 != NULL))
+ goto done;
assert(s >= 3584 + buff_size_rounded);
/* Verify first two entries are unchanged. */
assertEqualMem(p0, p1, 1536 + buff_size_rounded);
@@ -118,7 +114,6 @@
/* Verify end-of-archive marker. */
assertEqualMem(p1 + 2560 + buff_size_rounded, "\0\0\0\0\0\0\0\0", 8);
assertEqualMem(p1 + 3072 + buff_size_rounded, "\0\0\0\0\0\0\0\0", 8);
- free(p0);
free(p1);
/* Unpack everything */
@@ -132,4 +127,7 @@
/* Verify that the second copy of f1 overwrote the first. */
assertFileContents(buff, (int)strlen(buff), "f1");
+done:
+ free(buff);
+ free(p0);
}
Modified: trunk/contrib/libarchive/tar/test/test_option_uid_uname.c
===================================================================
--- trunk/contrib/libarchive/tar/test/test_option_uid_uname.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/tar/test/test_option_uid_uname.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -45,26 +45,28 @@
/* Again with both --uid and --uname */
failure("Error invoking %s c", testprog);
assertEqualInt(0,
- systemf("%s cf archive2 --uid=17 --uname=foofoofoo --format=ustar file >stdout2.txt 2>stderr2.txt",
+ systemf("%s cf archive2 --uid=65123 --uname=foofoofoo --format=ustar file >stdout2.txt 2>stderr2.txt",
testprog));
assertEmptyFile("stdout2.txt");
assertEmptyFile("stderr2.txt");
data = slurpfile(&s, "archive2");
/* Should force uid and uname fields in ustar header. */
- assertEqualMem(data + 108, "000021 \0", 8);
+ assertEqualMem(data + 108, "177143 \0", 8);
assertEqualMem(data + 265, "foofoofoo\0", 10);
+ free(data);
/* Again with just --uid */
failure("Error invoking %s c", testprog);
assertEqualInt(0,
- systemf("%s cf archive3 --uid=17 --format=ustar file >stdout3.txt 2>stderr3.txt",
+ systemf("%s cf archive3 --uid=65123 --format=ustar file >stdout3.txt 2>stderr3.txt",
testprog));
assertEmptyFile("stdout3.txt");
assertEmptyFile("stderr3.txt");
data = slurpfile(&s, "archive3");
- assertEqualMem(data + 108, "000021 \0", 8);
+ assertEqualMem(data + 108, "177143 \0", 8);
/* Uname field in ustar header should be empty. */
assertEqualMem(data + 265, "\0", 1);
+ free(data);
/* Again with just --uname */
failure("Error invoking %s c", testprog);
@@ -77,4 +79,7 @@
/* Uid should be unchanged from original reference. */
assertEqualMem(data + 108, reference + 108, 8);
assertEqualMem(data + 265, "foofoofoo\0", 10);
+ free(data);
+
+ free(reference);
}
Modified: trunk/contrib/libarchive/tar/test/test_option_uuencode.c
===================================================================
--- trunk/contrib/libarchive/tar/test/test_option_uuencode.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/tar/test/test_option_uuencode.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -42,6 +42,7 @@
p = slurpfile(&s, "archive.out");
assert(s > 2);
assertEqualMem(p, "begin 644", 9);
+ free(p);
/* Archive it with uuencode only. */
assertEqualInt(0,
@@ -51,4 +52,5 @@
p = slurpfile(&s, "archive.out");
assert(s > 2);
assertEqualMem(p, "begin 644", 9);
+ free(p);
}
Copied: trunk/contrib/libarchive/tar/test/test_option_xattrs.c (from rev 11133, vendor/libarchive/dist/tar/test/test_option_xattrs.c)
===================================================================
--- trunk/contrib/libarchive/tar/test/test_option_xattrs.c (rev 0)
+++ trunk/contrib/libarchive/tar/test/test_option_xattrs.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -0,0 +1,88 @@
+/*-
+ * Copyright (c) 2017 Martin Matuska
+ * 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 "test.h"
+__FBSDID("$FreeBSD$");
+
+DEFINE_TEST(test_option_xattrs)
+{
+#if !ARCHIVE_XATTR_SUPPORT
+ skipping("Extended atributes are not supported on this platform");
+#else /* ARCHIVE_XATTR_SUPPORT */
+
+ const char *testattr = "user.libarchive.test";
+ const char *testval = "testval";
+ void *readval;
+ size_t size;
+ int r;
+
+ /* Create a file. */
+ assertMakeFile("f", 0644, "a");
+
+ if (!setXattr("f", "user.libarchive.test", testval,
+ strlen(testval) + 1)) {
+ skipping("Can't set user extended attributes on this "
+ "filesystem");
+ return;
+ }
+
+ /* Archive with xattrs */
+ r = systemf("%s -c --no-mac-metadata --xattrs -f xattrs.tar f >xattrs.out 2>xattrs.err", testprog);
+ assertEqualInt(r, 0);
+
+ /* Archive without xattrs */
+ r = systemf("%s -c --no-mac-metadata --no-xattrs -f noxattrs.tar f >noxattrs.out 2>noxattrs.err", testprog);
+ assertEqualInt(r, 0);
+
+ /* Extract xattrs with xattrs */
+ assertMakeDir("xattrs_xattrs", 0755);
+ r = systemf("%s -x -C xattrs_xattrs --no-same-permissions --xattrs -f xattrs.tar >xattrs_xattrs.out 2>xattrs_xattrs.err", testprog);
+ assertEqualInt(r, 0);
+ readval = getXattr("xattrs_xattrs/f", testattr, &size);
+ if(assertEqualInt(size, strlen(testval) + 1) != 0)
+ assertEqualMem(readval, testval, size);
+ free(readval);
+
+ /* Extract xattrs without xattrs */
+ assertMakeDir("xattrs_noxattrs", 0755);
+ r = systemf("%s -x -C xattrs_noxattrs -p --no-xattrs -f xattrs.tar >xattrs_noxattrs.out 2>xattrs_noxattrs.err", testprog);
+ assertEqualInt(r, 0);
+ readval = getXattr("xattrs_noxattrs/f", testattr, &size);
+ assert(readval == NULL);
+
+ /* Extract noxattrs with xattrs */
+ assertMakeDir("noxattrs_xattrs", 0755);
+ r = systemf("%s -x -C noxattrs_xattrs --no-same-permissions --xattrs -f noxattrs.tar >noxattrs_xattrs.out 2>noxattrs_xattrs.err", testprog);
+ assertEqualInt(r, 0);
+ readval = getXattr("noxattrs_xattrs/f", testattr, &size);
+ assert(readval == NULL);
+
+ /* Extract noxattrs with noxattrs */
+ assertMakeDir("noxattrs_noxattrs", 0755);
+ r = systemf("%s -x -C noxattrs_noxattrs -p --no-xattrs -f noxattrs.tar >noxattrs_noxattrs.out 2>noxattrs_noxattrs.err", testprog);
+ assertEqualInt(r, 0);
+ readval = getXattr("noxattrs_noxattrs/f", testattr, &size);
+ assert(readval == NULL);
+#endif /* ARCHIVE_XATTR_SUPPORT */
+}
Modified: trunk/contrib/libarchive/tar/test/test_option_xz.c
===================================================================
--- trunk/contrib/libarchive/tar/test/test_option_xz.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/tar/test/test_option_xz.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -44,14 +44,17 @@
if (strstr(p, "Unsupported compression") != NULL) {
skipping("This version of bsdtar was compiled "
"without xz support");
- return;
+ goto done;
}
failure("--xz option is broken");
assertEqualInt(r, 0);
- return;
+ goto done;
}
+ free(p);
/* Check that the archive file has an xz signature. */
p = slurpfile(&s, "archive.out");
assert(s > 2);
assertEqualMem(p, "\xFD\x37\x7A\x58\x5A\x00", 6);
+done:
+ free(p);
}
Modified: trunk/contrib/libarchive/tar/test/test_option_z.c
===================================================================
--- trunk/contrib/libarchive/tar/test/test_option_z.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/tar/test/test_option_z.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -42,14 +42,17 @@
if (r != 0) {
if (!canGzip()) {
skipping("gzip is not supported on this platform");
- return;
+ goto done;
}
failure("-z option is broken");
assertEqualInt(r, 0);
- return;
+ goto done;
}
+ free(p);
/* Check that the archive file has a gzip signature. */
p = slurpfile(&s, "archive.out");
assert(s > 4);
assertEqualMem(p, "\x1f\x8b\x08\x00", 4);
+done:
+ free(p);
}
Modified: trunk/contrib/libarchive/tar/test/test_stdio.c
===================================================================
--- trunk/contrib/libarchive/tar/test/test_stdio.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/tar/test/test_stdio.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -116,6 +116,7 @@
assertEqualInt((int)s, 3);
assertEqualMem(p, "abc", 3);
/* TODO: Verify xvf.err */
+ free(p);
/* 'xvf -' should generate list on stderr, empty stdout. */
r = systemf("%s xvf - < archive >xvf-.out 2>xvf-.err", testprog);
Modified: trunk/contrib/libarchive/tar/test/test_symlink_dir.c
===================================================================
--- trunk/contrib/libarchive/tar/test/test_symlink_dir.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/tar/test/test_symlink_dir.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -47,11 +47,18 @@
assertMakeDir("source/dir3", 0755);
assertMakeDir("source/dir3/d3", 0755);
assertMakeFile("source/dir3/f3", 0755, "abcde");
+ assertMakeDir("source/dir4", 0755);
+ assertMakeFile("source/dir4/file3", 0755, "abcdef");
+ assertMakeHardlink("source/dir4/file4", "source/dir4/file3");
assertEqualInt(0,
systemf("%s -cf test.tar -C source dir dir2 dir3 file file2",
testprog));
+ /* Second archive with hardlinks */
+ assertEqualInt(0,
+ systemf("%s -cf test2.tar -C source dir4", testprog));
+
/*
* Extract with -x and without -P.
*/
@@ -63,7 +70,7 @@
/* "dir2" is a symlink to a non-existing "real_dir2" */
assertMakeSymlink("dest1/dir2", "real_dir2");
} else {
- skipping("some symlink checks");
+ skipping("Symlinks are not supported on this platform");
}
/* "dir3" is a symlink to an existing "non_dir3" */
assertMakeFile("dest1/non_dir3", 0755, "abcdef");
@@ -118,9 +125,15 @@
assertMakeSymlink("dest2/file2", "real_file2");
assertEqualInt(0, systemf("%s -xPf test.tar -C dest2", testprog));
- /* dest2/dir symlink should be followed */
+ /* "dir4" is a symlink to existing "real_dir" */
+ if (canSymlink())
+ assertMakeSymlink("dest2/dir4", "real_dir");
+ assertEqualInt(0, systemf("%s -xPf test2.tar -C dest2", testprog));
+
+ /* dest2/dir and dest2/dir4 symlinks should be followed */
if (canSymlink()) {
assertIsSymlink("dest2/dir", "real_dir");
+ assertIsSymlink("dest2/dir4", "real_dir");
assertIsDir("dest2/real_dir", -1);
}
@@ -141,4 +154,7 @@
/* dest2/file2 symlink should be removed */
failure("Symlink to non-existing file should be removed");
assertIsReg("dest2/file2", -1);
+
+ /* dest2/dir4/file3 and dest2/dir4/file4 should be hard links */
+ assertIsHardlink("dest2/dir4/file3", "dest2/dir4/file4");
}
Modified: trunk/contrib/libarchive/tar/test/test_version.c
===================================================================
--- trunk/contrib/libarchive/tar/test/test_version.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/tar/test/test_version.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -1,5 +1,5 @@
/*-
- * Copyright (c) 2003-2007 Tim Kientzle
+ * Copyright (c) 2003-2017 Tim Kientzle
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: stable/11/contrib/libarchive/tar/test/test_version.c 305188 2016-09-01 07:53:59Z mm $");
/*
* Test that --version option works and generates reasonable output.
@@ -31,72 +30,5 @@
DEFINE_TEST(test_version)
{
- int r;
- char *p, *q;
- size_t s;
-
-
- r = systemf("%s --version >version.stdout 2>version.stderr", testprog);
- if (r != 0)
- r = systemf("%s -W version >version.stdout 2>version.stderr",
- testprog);
- failure("Unable to run either %s --version or %s -W version",
- testprog, testprog);
- if (!assert(r == 0))
- return;
-
- /* --version should generate nothing to stdout. */
- assertEmptyFile("version.stderr");
- /* Verify format of version message. */
- q = p = slurpfile(&s, "version.stdout");
- /* Version message should start with name of program, then space. */
- assert(s > 6);
- failure("Version must start with 'bsdtar': ``%s''", p);
- if (!assertEqualMem(q, "bsdtar ", 7))
- return;
- q += 7; s -= 7;
- /* Version number is a series of digits and periods. */
- while (s > 0 && (*q == '.' || (*q >= '0' && *q <= '9'))) {
- ++q;
- --s;
- }
- /* Version number terminated by space. */
- failure("No space after bsdtar version: ``%s''", p);
- assert(s > 1);
- /* Skip a single trailing a,b,c, or d. */
- if (*q == 'a' || *q == 'b' || *q == 'c' || *q == 'd')
- ++q;
- failure("No space after bsdtar version: ``%s''", p);
- assert(*q == ' ');
- ++q; --s;
- /* Separator. */
- failure("No `-' between bsdtar and libarchive versions: ``%s''", p);
- assertEqualMem(q, "- ", 2);
- q += 2; s -= 2;
- /* libarchive name and version number */
- failure("Not long enough for libarchive version: ``%s''", p);
- assert(s > 11);
- failure("Libarchive version must start with `libarchive': ``%s''", p);
- assertEqualMem(q, "libarchive ", 11);
- q += 11; s -= 11;
- /* Version number is a series of digits and periods. */
- while (s > 0 && (*q == '.' || (*q >= '0' && *q <= '9'))) {
- ++q;
- --s;
- }
- /* Skip a single trailing a,b,c, or d. */
- if (*q == 'a' || *q == 'b' || *q == 'c' || *q == 'd')
- ++q;
- /* Skip arbitrary third-party version numbers. */
- while (s > 0 && (*q == ' ' || *q == '-' || *q == '/' || *q == '.' || isalnum(*q))) {
- ++q;
- --s;
- }
- /* All terminated by end-of-line. */
- assert(s >= 1);
- /* Skip an optional CR character (e.g., Windows) */
- failure("Version output must end with \\n or \\r\\n");
- if (*q == '\r') { ++q; --s; }
- assertEqualMem(q, "\n", 1);
- free(p);
+ assertVersion(testprog, "bsdtar");
}
Modified: trunk/contrib/libarchive/tar/test/test_windows.c
===================================================================
--- trunk/contrib/libarchive/tar/test/test_windows.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/tar/test/test_windows.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -133,7 +133,7 @@
char *fp1, *fp2;
/*
- * Preparre tests.
+ * Prepare tests.
* Create directories and files.
*/
assertMakeDir("tmp", 0775);
Modified: trunk/contrib/libarchive/tar/util.c
===================================================================
--- trunk/contrib/libarchive/tar/util.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/tar/util.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -140,6 +140,7 @@
} else {
/* Leave fmtbuff pointing to the truncated
* string in fmtbuff_stack. */
+ fmtbuff = fmtbuff_stack;
length = sizeof(fmtbuff_stack) - 1;
break;
}
@@ -533,7 +534,7 @@
}
}
- if (!bsdtar->option_absolute_paths) {
+ if ((bsdtar->flags & OPTFLAG_ABSOLUTE_PATHS) == 0) {
/* By default, don't write or restore absolute pathnames. */
name = strip_absolute_path(bsdtar, name);
if (*name == '\0')
Modified: trunk/contrib/libarchive/tar/write.c
===================================================================
--- trunk/contrib/libarchive/tar/write.c 2018-06-19 20:38:39 UTC (rev 11133)
+++ trunk/contrib/libarchive/tar/write.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -145,18 +145,17 @@
writer_options = getenv(ENV_WRITER_OPTIONS);
if (writer_options != NULL) {
+ size_t module_len = sizeof(IGNORE_WRONG_MODULE_NAME) - 1;
+ size_t opt_len = strlen(writer_options) + 1;
char *p;
/* Set default write options. */
- p = malloc(sizeof(IGNORE_WRONG_MODULE_NAME)
- + strlen(writer_options) + 1);
- if (p == NULL)
+ if ((p = malloc(module_len + opt_len)) == NULL)
lafe_errc(1, errno, "Out of memory");
/* Prepend magic code to ignore options for
* a format or filters which are not added to
* the archive write object. */
- strncpy(p, IGNORE_WRONG_MODULE_NAME,
- sizeof(IGNORE_WRONG_MODULE_NAME) -1);
- strcpy(p + sizeof(IGNORE_WRONG_MODULE_NAME) -1, writer_options);
+ memcpy(p, IGNORE_WRONG_MODULE_NAME, module_len);
+ memcpy(p, writer_options, opt_len);
r = archive_write_set_options(a, p);
free(p);
if (r < ARCHIVE_WARN)
@@ -178,18 +177,18 @@
reader_options = getenv(ENV_READER_OPTIONS);
if (reader_options != NULL) {
+ size_t module_len = sizeof(IGNORE_WRONG_MODULE_NAME) - 1;
+ size_t opt_len = strlen(reader_options) + 1;
char *p;
/* Set default write options. */
- p = malloc(sizeof(IGNORE_WRONG_MODULE_NAME)
- + strlen(reader_options) + 1);
+ if ((p = malloc(module_len + opt_len)) == NULL)
if (p == NULL)
lafe_errc(1, errno, "Out of memory");
/* Prepend magic code to ignore options for
* a format or filters which are not added to
* the archive write object. */
- strncpy(p, IGNORE_WRONG_MODULE_NAME,
- sizeof(IGNORE_WRONG_MODULE_NAME) -1);
- strcpy(p + sizeof(IGNORE_WRONG_MODULE_NAME) -1, reader_options);
+ memcpy(p, IGNORE_WRONG_MODULE_NAME, module_len);
+ memcpy(p, reader_options, opt_len);
r = archive_read_set_options(a, p);
free(p);
if (r < ARCHIVE_WARN)
@@ -527,7 +526,7 @@
struct archive *disk = bsdtar->diskreader;
/*
- * This tricky code here is to correctly read the cotents
+ * This tricky code here is to correctly read the contents
* of the entry because the disk reader bsdtar->diskreader
* is pointing at does not have any information about the
* entry by this time and using archive_read_data_block()
@@ -584,7 +583,7 @@
archive_read_free(bsdtar->diskreader);
bsdtar->diskreader = NULL;
- if (bsdtar->option_totals) {
+ if (bsdtar->flags & OPTFLAG_TOTALS) {
fprintf(stderr, "Total bytes written: %s\n",
tar_i64toa(archive_filter_bytes(a, -1)));
}
@@ -607,7 +606,8 @@
bsdtar->next_line_is_dir = 0;
- lr = lafe_line_reader(bsdtar->names_from_file, bsdtar->option_null);
+ lr = lafe_line_reader(bsdtar->names_from_file,
+ (bsdtar->flags & OPTFLAG_NULL));
while ((line = lafe_line_reader_next(lr)) != NULL) {
if (bsdtar->next_line_is_dir) {
if (*line != '\0')
@@ -618,7 +618,8 @@
bsdtar->return_value = 1;
}
bsdtar->next_line_is_dir = 0;
- } else if (!bsdtar->option_null && strcmp(line, "-C") == 0)
+ } else if (((bsdtar->flags & OPTFLAG_NULL) == 0) &&
+ strcmp(line, "-C") == 0)
bsdtar->next_line_is_dir = 1;
else {
if (*line != '/')
@@ -691,7 +692,7 @@
while (ARCHIVE_OK == (e = archive_read_next_header(ina, &in_entry))) {
if (archive_match_excluded(bsdtar->matching, in_entry))
continue;
- if (bsdtar->option_interactive &&
+ if ((bsdtar->flags & OPTFLAG_INTERACTIVE) &&
!yes("copy '%s'", archive_entry_pathname(in_entry)))
continue;
if (bsdtar->verbose > 1) {
@@ -810,11 +811,11 @@
{
struct bsdtar *bsdtar = (struct bsdtar *)_data;
- if (bsdtar->option_no_subdirs)
+ if (bsdtar->flags & OPTFLAG_NO_SUBDIRS)
return;
if (!archive_read_disk_can_descend(a))
return;
- if (bsdtar->option_interactive &&
+ if ((bsdtar->flags & OPTFLAG_INTERACTIVE) &&
!yes("add '%s'", archive_entry_pathname(entry)))
return;
archive_read_disk_descend(a);
@@ -845,12 +846,13 @@
* check would veto this file, we shouldn't bother
* the user with it.
*/
- if (bsdtar->option_interactive &&
+ if ((bsdtar->flags & OPTFLAG_INTERACTIVE) &&
!yes("add '%s'", archive_entry_pathname(entry)))
return (0);
/* Note: if user vetoes, we won't descend. */
- if (!bsdtar->option_no_subdirs && archive_read_disk_can_descend(a))
+ if (((bsdtar->flags & OPTFLAG_NO_SUBDIRS) == 0) &&
+ archive_read_disk_can_descend(a))
archive_read_disk_descend(a);
return (1);
@@ -1011,7 +1013,7 @@
uncomp = archive_filter_bytes(a, 0);
fprintf(stderr, "In: %d files, %s bytes;",
archive_file_count(a), tar_i64toa(uncomp));
- if (comp > uncomp)
+ if (comp >= uncomp)
compression = 0;
else
compression = (int)((uncomp - comp) * 100 / uncomp);
Copied: trunk/contrib/libarchive/test_utils/test_common.h (from rev 11133, vendor/libarchive/dist/test_utils/test_common.h)
===================================================================
--- trunk/contrib/libarchive/test_utils/test_common.h (rev 0)
+++ trunk/contrib/libarchive/test_utils/test_common.h 2018-06-19 20:42:35 UTC (rev 11134)
@@ -0,0 +1,445 @@
+/*
+ * Copyright (c) 2003-2017 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.
+ *
+ * $FreeBSD$
+ */
+
+#ifndef TEST_COMMON_H
+#define TEST_COMMON_H
+
+/*
+ * The goal of this file (and the matching test.c) is to
+ * simplify the very repetitive test-*.c test programs.
+ */
+#if defined(HAVE_CONFIG_H)
+/* Most POSIX platforms use the 'configure' script to build config.h */
+#include "config.h"
+#elif defined(__FreeBSD__)
+/* Building as part of FreeBSD system requires a pre-built config.h. */
+#include "config_freebsd.h"
+#elif defined(_WIN32) && !defined(__CYGWIN__)
+/* Win32 can't run the 'configure' script. */
+#include "config_windows.h"
+#else
+/* Warn if the library hasn't been (automatically or manually) configured. */
+#error Oops: No config.h and no pre-built configuration in test.h.
+#endif
+
+#include <sys/types.h> /* Windows requires this before sys/stat.h */
+#include <sys/stat.h>
+
+#if HAVE_DIRENT_H
+#include <dirent.h>
+#endif
+#ifdef HAVE_DIRECT_H
+#include <direct.h>
+#define dirent direct
+#endif
+#include <errno.h>
+#include <fcntl.h>
+#ifdef HAVE_IO_H
+#include <io.h>
+#endif
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <ctype.h>
+#include <time.h>
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#include <wchar.h>
+#ifdef HAVE_ACL_LIBACL_H
+#include <acl/libacl.h>
+#endif
+#ifdef HAVE_SYS_ACL_H
+#include <sys/acl.h>
+#endif
+#ifdef HAVE_SYS_RICHACL_H
+#include <sys/richacl.h>
+#endif
+#ifdef HAVE_WINDOWS_H
+#include <windows.h>
+#endif
+
+/*
+ * System-specific tweaks. We really want to minimize these
+ * as much as possible, since they make it harder to understand
+ * the mainline code.
+ */
+
+/* Windows (including Visual Studio and MinGW but not Cygwin) */
+#if defined(_WIN32) && !defined(__CYGWIN__)
+#if !defined(__BORLANDC__)
+#undef chdir
+#define chdir _chdir
+#define strdup _strdup
+#endif
+#endif
+
+/* Visual Studio */
+#if defined(_MSC_VER) && _MSC_VER < 1900
+#define snprintf sprintf_s
+#endif
+
+#if defined(__BORLANDC__)
+#pragma warn -8068 /* Constant out of range in comparison. */
+#endif
+
+/* Haiku OS and QNX */
+#if defined(__HAIKU__) || defined(__QNXNTO__)
+/* Haiku and QNX have typedefs in stdint.h (needed for int64_t) */
+#include <stdint.h>
+#endif
+
+/* Get a real definition for __FBSDID if we can */
+#if HAVE_SYS_CDEFS_H
+#include <sys/cdefs.h>
+#endif
+
+/* If not, define it so as to avoid dangling semicolons. */
+#ifndef __FBSDID
+#define __FBSDID(a) struct _undefined_hack
+#endif
+
+#ifndef O_BINARY
+#define O_BINARY 0
+#endif
+
+#include "archive_platform_acl.h"
+#define ARCHIVE_TEST_ACL_TYPE_POSIX1E 1
+#define ARCHIVE_TEST_ACL_TYPE_NFS4 2
+
+#include "archive_platform_xattr.h"
+
+/*
+ * Redefine DEFINE_TEST for use in defining the test functions.
+ */
+#undef DEFINE_TEST
+#define DEFINE_TEST(name) void name(void); void name(void)
+
+/* An implementation of the standard assert() macro */
+#define assert(e) assertion_assert(__FILE__, __LINE__, (e), #e, NULL)
+/* chdir() and error if it fails */
+#define assertChdir(path) \
+ assertion_chdir(__FILE__, __LINE__, path)
+/* Assert two files have the same file flags */
+#define assertEqualFflags(patha, pathb) \
+ assertion_compare_fflags(__FILE__, __LINE__, patha, pathb, 0)
+/* Assert two integers are the same. Reports value of each one if not. */
+#define assertEqualInt(v1,v2) \
+ assertion_equal_int(__FILE__, __LINE__, (v1), #v1, (v2), #v2, NULL)
+/* Assert two strings are the same. Reports value of each one if not. */
+#define assertEqualString(v1,v2) \
+ assertion_equal_string(__FILE__, __LINE__, (v1), #v1, (v2), #v2, NULL, 0)
+#define assertEqualUTF8String(v1,v2) \
+ assertion_equal_string(__FILE__, __LINE__, (v1), #v1, (v2), #v2, NULL, 1)
+/* As above, but v1 and v2 are wchar_t * */
+#define assertEqualWString(v1,v2) \
+ assertion_equal_wstring(__FILE__, __LINE__, (v1), #v1, (v2), #v2, NULL)
+/* As above, but raw blocks of bytes. */
+#define assertEqualMem(v1, v2, l) \
+ assertion_equal_mem(__FILE__, __LINE__, (v1), #v1, (v2), #v2, (l), #l, NULL)
+/* Assert that memory is full of a specified byte */
+#define assertMemoryFilledWith(v1, l, b) \
+ assertion_memory_filled_with(__FILE__, __LINE__, (v1), #v1, (l), #l, (b), #b, NULL)
+/* Assert two files are the same. */
+#define assertEqualFile(f1, f2) \
+ assertion_equal_file(__FILE__, __LINE__, (f1), (f2))
+/* Assert that a file is empty. */
+#define assertEmptyFile(pathname) \
+ assertion_empty_file(__FILE__, __LINE__, (pathname))
+/* Assert that a file is not empty. */
+#define assertNonEmptyFile(pathname) \
+ assertion_non_empty_file(__FILE__, __LINE__, (pathname))
+#define assertFileAtime(pathname, sec, nsec) \
+ assertion_file_atime(__FILE__, __LINE__, pathname, sec, nsec)
+#define assertFileAtimeRecent(pathname) \
+ assertion_file_atime_recent(__FILE__, __LINE__, pathname)
+#define assertFileBirthtime(pathname, sec, nsec) \
+ assertion_file_birthtime(__FILE__, __LINE__, pathname, sec, nsec)
+#define assertFileBirthtimeRecent(pathname) \
+ assertion_file_birthtime_recent(__FILE__, __LINE__, pathname)
+/* Assert that a file exists; supports printf-style arguments. */
+#define assertFileExists(pathname) \
+ assertion_file_exists(__FILE__, __LINE__, pathname)
+/* Assert that a file exists. */
+#define assertFileNotExists(pathname) \
+ assertion_file_not_exists(__FILE__, __LINE__, pathname)
+/* Assert that file contents match a string. */
+#define assertFileContents(data, data_size, pathname) \
+ assertion_file_contents(__FILE__, __LINE__, data, data_size, pathname)
+/* Verify that a file does not contain invalid strings */
+#define assertFileContainsNoInvalidStrings(pathname, strings) \
+ assertion_file_contains_no_invalid_strings(__FILE__, __LINE__, pathname, strings)
+#define assertFileMtime(pathname, sec, nsec) \
+ assertion_file_mtime(__FILE__, __LINE__, pathname, sec, nsec)
+#define assertFileMtimeRecent(pathname) \
+ assertion_file_mtime_recent(__FILE__, __LINE__, pathname)
+#define assertFileNLinks(pathname, nlinks) \
+ assertion_file_nlinks(__FILE__, __LINE__, pathname, nlinks)
+#define assertFileSize(pathname, size) \
+ assertion_file_size(__FILE__, __LINE__, pathname, size)
+#define assertFileMode(pathname, mode) \
+ assertion_file_mode(__FILE__, __LINE__, pathname, mode)
+#define assertTextFileContents(text, pathname) \
+ assertion_text_file_contents(__FILE__, __LINE__, text, pathname)
+#define assertFileContainsLinesAnyOrder(pathname, lines) \
+ assertion_file_contains_lines_any_order(__FILE__, __LINE__, pathname, lines)
+#define assertIsDir(pathname, mode) \
+ assertion_is_dir(__FILE__, __LINE__, pathname, mode)
+#define assertIsHardlink(path1, path2) \
+ assertion_is_hardlink(__FILE__, __LINE__, path1, path2)
+#define assertIsNotHardlink(path1, path2) \
+ assertion_is_not_hardlink(__FILE__, __LINE__, path1, path2)
+#define assertIsReg(pathname, mode) \
+ assertion_is_reg(__FILE__, __LINE__, pathname, mode)
+#define assertIsSymlink(pathname, contents) \
+ assertion_is_symlink(__FILE__, __LINE__, pathname, contents)
+/* Create a directory, report error if it fails. */
+#define assertMakeDir(dirname, mode) \
+ assertion_make_dir(__FILE__, __LINE__, dirname, mode)
+#define assertMakeFile(path, mode, contents) \
+ assertion_make_file(__FILE__, __LINE__, path, mode, -1, contents)
+#define assertMakeBinFile(path, mode, csize, contents) \
+ assertion_make_file(__FILE__, __LINE__, path, mode, csize, contents)
+#define assertMakeHardlink(newfile, oldfile) \
+ assertion_make_hardlink(__FILE__, __LINE__, newfile, oldfile)
+#define assertMakeSymlink(newfile, linkto) \
+ assertion_make_symlink(__FILE__, __LINE__, newfile, linkto)
+#define assertSetNodump(path) \
+ assertion_set_nodump(__FILE__, __LINE__, path)
+#define assertUmask(mask) \
+ assertion_umask(__FILE__, __LINE__, mask)
+/* Assert that two files have unequal file flags */
+#define assertUnequalFflags(patha, pathb) \
+ assertion_compare_fflags(__FILE__, __LINE__, patha, pathb, 1)
+#define assertUtimes(pathname, atime, atime_nsec, mtime, mtime_nsec) \
+ assertion_utimes(__FILE__, __LINE__, pathname, atime, atime_nsec, mtime, mtime_nsec)
+#ifndef PROGRAM
+#define assertEntrySetAcls(entry, acls, count) \
+ assertion_entry_set_acls(__FILE__, __LINE__, entry, acls, count)
+#define assertEntryCompareAcls(entry, acls, count, type, mode) \
+ assertion_entry_compare_acls(__FILE__, __LINE__, entry, acls, count, type, mode)
+#endif
+
+/*
+ * This would be simple with C99 variadic macros, but I don't want to
+ * require that. Instead, I insert a function call before each
+ * skipping() call to pass the file and line information down. Crude,
+ * but effective.
+ */
+#define skipping \
+ skipping_setup(__FILE__, __LINE__);test_skipping
+
+/* Function declarations. These are defined in test_utility.c. */
+void failure(const char *fmt, ...);
+int assertion_assert(const char *, int, int, const char *, void *);
+int assertion_chdir(const char *, int, const char *);
+int assertion_compare_fflags(const char *, int, const char *, const char *,
+ int);
+int assertion_empty_file(const char *, int, const char *);
+int assertion_equal_file(const char *, int, const char *, const char *);
+int assertion_equal_int(const char *, int, long long, const char *, long long, const char *, void *);
+int assertion_equal_mem(const char *, int, const void *, const char *, const void *, const char *, size_t, const char *, void *);
+int assertion_memory_filled_with(const char *, int, const void *, const char *, size_t, const char *, char, const char *, void *);
+int assertion_equal_string(const char *, int, const char *v1, const char *, const char *v2, const char *, void *, int);
+int assertion_equal_wstring(const char *, int, const wchar_t *v1, const char *, const wchar_t *v2, const char *, void *);
+int assertion_file_atime(const char *, int, const char *, long, long);
+int assertion_file_atime_recent(const char *, int, const char *);
+int assertion_file_birthtime(const char *, int, const char *, long, long);
+int assertion_file_birthtime_recent(const char *, int, const char *);
+int assertion_file_contains_lines_any_order(const char *, int, const char *, const char **);
+int assertion_file_contains_no_invalid_strings(const char *, int, const char *, const char **);
+int assertion_file_contents(const char *, int, const void *, int, const char *);
+int assertion_file_exists(const char *, int, const char *);
+int assertion_file_mode(const char *, int, const char *, int);
+int assertion_file_mtime(const char *, int, const char *, long, long);
+int assertion_file_mtime_recent(const char *, int, const char *);
+int assertion_file_nlinks(const char *, int, const char *, int);
+int assertion_file_not_exists(const char *, int, const char *);
+int assertion_file_size(const char *, int, const char *, long);
+int assertion_is_dir(const char *, int, const char *, int);
+int assertion_is_hardlink(const char *, int, const char *, const char *);
+int assertion_is_not_hardlink(const char *, int, const char *, const char *);
+int assertion_is_reg(const char *, int, const char *, int);
+int assertion_is_symlink(const char *, int, const char *, const char *);
+int assertion_make_dir(const char *, int, const char *, int);
+int assertion_make_file(const char *, int, const char *, int, int, const void *);
+int assertion_make_hardlink(const char *, int, const char *newpath, const char *);
+int assertion_make_symlink(const char *, int, const char *newpath, const char *);
+int assertion_non_empty_file(const char *, int, const char *);
+int assertion_set_nodump(const char *, int, const char *);
+int assertion_text_file_contents(const char *, int, const char *buff, const char *f);
+int assertion_umask(const char *, int, int);
+int assertion_utimes(const char *, int, const char *, long, long, long, long );
+int assertion_version(const char*, int, const char *, const char *);
+
+void skipping_setup(const char *, int);
+void test_skipping(const char *fmt, ...);
+
+/* Like sprintf, then system() */
+int systemf(const char * fmt, ...);
+
+/* Delay until time() returns a value after this. */
+void sleepUntilAfter(time_t);
+
+/* Return true if this platform can create symlinks. */
+int canSymlink(void);
+
+/* Return true if this platform can run the "bzip2" program. */
+int canBzip2(void);
+
+/* Return true if this platform can run the "grzip" program. */
+int canGrzip(void);
+
+/* Return true if this platform can run the "gzip" program. */
+int canGzip(void);
+
+/* Return true if this platform can run the specified command. */
+int canRunCommand(const char *);
+
+/* Return true if this platform can run the "lrzip" program. */
+int canLrzip(void);
+
+/* Return true if this platform can run the "lz4" program. */
+int canLz4(void);
+
+/* Return true if this platform can run the "lzip" program. */
+int canLzip(void);
+
+/* Return true if this platform can run the "lzma" program. */
+int canLzma(void);
+
+/* Return true if this platform can run the "lzop" program. */
+int canLzop(void);
+
+/* Return true if this platform can run the "xz" program. */
+int canXz(void);
+
+/* Return true if this filesystem can handle nodump flags. */
+int canNodump(void);
+
+/* Set test ACLs */
+int setTestAcl(const char *path);
+
+/* Get extended attribute */
+void *getXattr(const char *, const char *, size_t *);
+
+/* Set extended attribute */
+int setXattr(const char *, const char *, const void *, size_t);
+
+/* Return true if the file has large i-node number(>0xffffffff). */
+int is_LargeInode(const char *);
+
+#if ARCHIVE_ACL_SUNOS
+/* Fetch ACLs on Solaris using acl() or facl() */
+void *sunacl_get(int cmd, int *aclcnt, int fd, const char *path);
+#endif
+
+/* Suck file into string allocated via malloc(). Call free() when done. */
+/* Supports printf-style args: slurpfile(NULL, "%s/myfile", refdir); */
+char *slurpfile(size_t *, const char *fmt, ...);
+
+/* Dump block of bytes to a file. */
+void dumpfile(const char *filename, void *, size_t);
+
+/* Extracts named reference file to the current directory. */
+void extract_reference_file(const char *);
+/* Copies named reference file to the current directory. */
+void copy_reference_file(const char *);
+
+/* Extracts a list of files to the current directory.
+ * List must be NULL terminated.
+ */
+void extract_reference_files(const char **);
+
+/* Subtract umask from mode */
+mode_t umasked(mode_t expected_mode);
+
+/* Path to working directory for current test */
+extern const char *testworkdir;
+
+#ifndef PROGRAM
+/*
+ * Special interfaces for libarchive test harness.
+ */
+
+#include "archive.h"
+#include "archive_entry.h"
+
+/* ACL structure */
+struct archive_test_acl_t {
+ int type; /* Type of ACL */
+ int permset; /* Permissions for this class of users. */
+ int tag; /* Owner, User, Owning group, group, other, etc. */
+ int qual; /* GID or UID of user/group, depending on tag. */
+ const char *name; /* Name of user/group, depending on tag. */
+};
+
+/* Set ACLs */
+int assertion_entry_set_acls(const char *, int, struct archive_entry *,
+ struct archive_test_acl_t *, int);
+
+/* Compare ACLs */
+int assertion_entry_compare_acls(const char *, int, struct archive_entry *,
+ struct archive_test_acl_t *, int, int, int);
+
+/* Special customized read-from-memory interface. */
+int read_open_memory(struct archive *, const void *, size_t, size_t);
+/* _minimal version exercises a slightly different set of libarchive APIs. */
+int read_open_memory_minimal(struct archive *, const void *, size_t, size_t);
+/* _seek version produces a seekable file. */
+int read_open_memory_seek(struct archive *, const void *, size_t, size_t);
+
+/* Versions of above that accept an archive argument for additional info. */
+#define assertA(e) assertion_assert(__FILE__, __LINE__, (e), #e, (a))
+#define assertEqualIntA(a,v1,v2) \
+ assertion_equal_int(__FILE__, __LINE__, (v1), #v1, (v2), #v2, (a))
+#define assertEqualStringA(a,v1,v2) \
+ assertion_equal_string(__FILE__, __LINE__, (v1), #v1, (v2), #v2, (a), 0)
+
+#else /* defined(PROGRAM) */
+/*
+ * Special interfaces for program test harness.
+ */
+
+/* Pathname of exe to be tested. */
+extern const char *testprogfile;
+/* Name of exe to use in printf-formatted command strings. */
+/* On Windows, this includes leading/trailing quotes. */
+extern const char *testprog;
+
+void assertVersion(const char *prog, const char *base);
+
+#endif /* defined(PROGRAM) */
+
+#ifdef USE_DMALLOC
+#include <dmalloc.h>
+#endif
+
+#endif /* TEST_COMMON_H */
Copied: trunk/contrib/libarchive/test_utils/test_main.c (from rev 11133, vendor/libarchive/dist/test_utils/test_main.c)
===================================================================
--- trunk/contrib/libarchive/test_utils/test_main.c (rev 0)
+++ trunk/contrib/libarchive/test_utils/test_main.c 2018-06-19 20:42:35 UTC (rev 11134)
@@ -0,0 +1,3834 @@
+/*
+ * Copyright (c) 2003-2009 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 "test.h"
+#include "test_utils.h"
+#ifdef HAVE_SYS_IOCTL_H
+#include <sys/ioctl.h>
+#endif
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#include <errno.h>
+#ifdef HAVE_ICONV_H
+#include <iconv.h>
+#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> /* Linux file flags, broken on Cygwin */
+#endif
+#ifdef HAVE_LINUX_FS_H
+#include <linux/fs.h>
+#endif
+#include <limits.h>
+#include <locale.h>
+#ifdef HAVE_SIGNAL_H
+#include <signal.h>
+#endif
+#include <stdarg.h>
+#include <time.h>
+
+#ifdef HAVE_SIGNAL_H
+#endif
+#ifdef HAVE_ACL_LIBACL_H
+#include <acl/libacl.h>
+#endif
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_ACL_H
+#include <sys/acl.h>
+#endif
+#ifdef HAVE_SYS_EA_H
+#include <sys/ea.h>
+#endif
+#ifdef HAVE_SYS_EXTATTR_H
+#include <sys/extattr.h>
+#endif
+#if HAVE_SYS_XATTR_H
+#include <sys/xattr.h>
+#elif HAVE_ATTR_XATTR_H
+#include <attr/xattr.h>
+#endif
+#ifdef HAVE_SYS_RICHACL_H
+#include <sys/richacl.h>
+#endif
+#if HAVE_MEMBERSHIP_H
+#include <membership.h>
+#endif
+
+/*
+ *
+ * Windows support routines
+ *
+ * Note: Configuration is a tricky issue. Using HAVE_* feature macros
+ * in the test harness is dangerous because they cover up
+ * configuration errors. The classic example of this is omitting a
+ * configure check. If libarchive and libarchive_test both look for
+ * the same feature macro, such errors are hard to detect. Platform
+ * macros (e.g., _WIN32 or __GNUC__) are a little better, but can
+ * easily lead to very messy code. It's best to limit yourself
+ * to only the most generic programming techniques in the test harness
+ * and thus avoid conditionals altogether. Where that's not possible,
+ * try to minimize conditionals by grouping platform-specific tests in
+ * one place (e.g., test_acl_freebsd) or by adding new assert()
+ * functions (e.g., assertMakeHardlink()) to cover up platform
+ * differences. Platform-specific coding in libarchive_test is often
+ * a symptom that some capability is missing from libarchive itself.
+ */
+#if defined(_WIN32) && !defined(__CYGWIN__)
+#include <io.h>
+#include <direct.h>
+#include <windows.h>
+#ifndef F_OK
+#define F_OK (0)
+#endif
+#ifndef S_ISDIR
+#define S_ISDIR(m) ((m) & _S_IFDIR)
+#endif
+#ifndef S_ISREG
+#define S_ISREG(m) ((m) & _S_IFREG)
+#endif
+#if !defined(__BORLANDC__)
+#define access _access
+#undef chdir
+#define chdir _chdir
+#endif
+#ifndef fileno
+#define fileno _fileno
+#endif
+/*#define fstat _fstat64*/
+#if !defined(__BORLANDC__)
+#define getcwd _getcwd
+#endif
+#define lstat stat
+/*#define lstat _stat64*/
+/*#define stat _stat64*/
+#define rmdir _rmdir
+#if !defined(__BORLANDC__)
+#define strdup _strdup
+#define umask _umask
+#endif
+#define int64_t __int64
+#endif
+
+#if defined(HAVE__CrtSetReportMode)
+# include <crtdbg.h>
+#endif
+
+mode_t umasked(mode_t expected_mode)
+{
+ mode_t mode = umask(0);
+ umask(mode);
+ return expected_mode & ~mode;
+}
+
+/* Path to working directory for current test */
+const char *testworkdir;
+#ifdef PROGRAM
+/* Pathname of exe to be tested. */
+const char *testprogfile;
+/* Name of exe to use in printf-formatted command strings. */
+/* On Windows, this includes leading/trailing quotes. */
+const char *testprog;
+#endif
+
+#if defined(_WIN32) && !defined(__CYGWIN__)
+static void *GetFunctionKernel32(const char *);
+static int my_CreateSymbolicLinkA(const char *, const char *, int);
+static int my_CreateHardLinkA(const char *, const char *);
+static int my_GetFileInformationByName(const char *,
+ BY_HANDLE_FILE_INFORMATION *);
+
+static void *
+GetFunctionKernel32(const char *name)
+{
+ static HINSTANCE lib;
+ static int set;
+ if (!set) {
+ set = 1;
+ lib = LoadLibrary("kernel32.dll");
+ }
+ if (lib == NULL) {
+ fprintf(stderr, "Can't load kernel32.dll?!\n");
+ exit(1);
+ }
+ return (void *)GetProcAddress(lib, name);
+}
+
+static int
+my_CreateSymbolicLinkA(const char *linkname, const char *target, int flags)
+{
+ static BOOLEAN (WINAPI *f)(LPCSTR, LPCSTR, DWORD);
+ static int set;
+ if (!set) {
+ set = 1;
+ f = GetFunctionKernel32("CreateSymbolicLinkA");
+ }
+ return f == NULL ? 0 : (*f)(linkname, target, flags);
+}
+
+static int
+my_CreateHardLinkA(const char *linkname, const char *target)
+{
+ static BOOLEAN (WINAPI *f)(LPCSTR, LPCSTR, LPSECURITY_ATTRIBUTES);
+ static int set;
+ if (!set) {
+ set = 1;
+ f = GetFunctionKernel32("CreateHardLinkA");
+ }
+ return f == NULL ? 0 : (*f)(linkname, target, NULL);
+}
+
+static int
+my_GetFileInformationByName(const char *path, BY_HANDLE_FILE_INFORMATION *bhfi)
+{
+ HANDLE h;
+ int r;
+
+ memset(bhfi, 0, sizeof(*bhfi));
+ h = CreateFile(path, FILE_READ_ATTRIBUTES, 0, NULL,
+ OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL);
+ if (h == INVALID_HANDLE_VALUE)
+ return (0);
+ r = GetFileInformationByHandle(h, bhfi);
+ CloseHandle(h);
+ return (r);
+}
+#endif
+
+#if defined(HAVE__CrtSetReportMode) && !defined(__WATCOMC__)
+static void
+invalid_parameter_handler(const wchar_t * expression,
+ const wchar_t * function, const wchar_t * file,
+ unsigned int line, uintptr_t pReserved)
+{
+ /* nop */
+ // Silence unused-parameter compiler warnings.
+ (void)expression;
+ (void)function;
+ (void)file;
+ (void)line;
+ (void)pReserved;
+}
+#endif
+
+/*
+ *
+ * OPTIONS FLAGS
+ *
+ */
+
+/* Enable core dump on failure. */
+static int dump_on_failure = 0;
+/* Default is to remove temp dirs and log data for successful tests. */
+static int keep_temp_files = 0;
+/* Default is to run the specified tests once and report errors. */
+static int until_failure = 0;
+/* Default is to just report pass/fail for each test. */
+static int verbosity = 0;
+#define VERBOSITY_SUMMARY_ONLY -1 /* -q */
+#define VERBOSITY_PASSFAIL 0 /* Default */
+#define VERBOSITY_LIGHT_REPORT 1 /* -v */
+#define VERBOSITY_FULL 2 /* -vv */
+/* A few places generate even more output for verbosity > VERBOSITY_FULL,
+ * mostly for debugging the test harness itself. */
+/* Cumulative count of assertion failures. */
+static int failures = 0;
+/* Cumulative count of reported skips. */
+static int skips = 0;
+/* Cumulative count of assertions checked. */
+static int assertions = 0;
+
+/* Directory where uuencoded reference files can be found. */
+static const char *refdir;
+
+/*
+ * Report log information selectively to console and/or disk log.
+ */
+static int log_console = 0;
+static FILE *logfile;
+static void
+vlogprintf(const char *fmt, va_list ap)
+{
+#ifdef va_copy
+ va_list lfap;
+ va_copy(lfap, ap);
+#endif
+ if (log_console)
+ vfprintf(stdout, fmt, ap);
+ if (logfile != NULL)
+#ifdef va_copy
+ vfprintf(logfile, fmt, lfap);
+ va_end(lfap);
+#else
+ vfprintf(logfile, fmt, ap);
+#endif
+}
+
+static void
+logprintf(const char *fmt, ...)
+{
+ va_list ap;
+ va_start(ap, fmt);
+ vlogprintf(fmt, ap);
+ va_end(ap);
+}
+
+/* Set up a message to display only if next assertion fails. */
+static char msgbuff[4096];
+static const char *msg, *nextmsg;
+void
+failure(const char *fmt, ...)
+{
+ va_list ap;
+ if (fmt == NULL) {
+ nextmsg = NULL;
+ } else {
+ va_start(ap, fmt);
+ vsprintf(msgbuff, fmt, ap);
+ va_end(ap);
+ nextmsg = msgbuff;
+ }
+}
+
+/*
+ * Copy arguments into file-local variables.
+ * This was added to permit vararg assert() functions without needing
+ * variadic wrapper macros. Turns out that the vararg capability is almost
+ * never used, so almost all of the vararg assertions can be simplified
+ * by removing the vararg capability and reworking the wrapper macro to
+ * pass __FILE__, __LINE__ directly into the function instead of using
+ * this hook. I suspect this machinery is used so rarely that we
+ * would be better off just removing it entirely. That would simplify
+ * the code here noticeably.
+ */
+static const char *skipping_filename;
+static int skipping_line;
+void skipping_setup(const char *filename, int line)
+{
+ skipping_filename = filename;
+ skipping_line = line;
+}
+
+/* Called at the beginning of each assert() function. */
+static void
+assertion_count(const char *file, int line)
+{
+ (void)file; /* UNUSED */
+ (void)line; /* UNUSED */
+ ++assertions;
+ /* Proper handling of "failure()" message. */
+ msg = nextmsg;
+ nextmsg = NULL;
+ /* Uncomment to print file:line after every assertion.
+ * Verbose, but occasionally useful in tracking down crashes. */
+ /* printf("Checked %s:%d\n", file, line); */
+}
+
+/*
+ * For each test source file, we remember how many times each
+ * assertion was reported. Cleared before each new test,
+ * used by test_summarize().
+ */
+static struct line {
+ int count;
+ int skip;
+} failed_lines[10000];
+const char *failed_filename;
+
+/* Count this failure, setup up log destination and handle initial report. */
+static void
+failure_start(const char *filename, int line, const char *fmt, ...)
+{
+ va_list ap;
+
+ /* Record another failure for this line. */
+ ++failures;
+ failed_filename = filename;
+ failed_lines[line].count++;
+
+ /* Determine whether to log header to console. */
+ switch (verbosity) {
+ case VERBOSITY_LIGHT_REPORT:
+ log_console = (failed_lines[line].count < 2);
+ break;
+ default:
+ log_console = (verbosity >= VERBOSITY_FULL);
+ }
+
+ /* Log file:line header for this failure */
+ va_start(ap, fmt);
+#if _MSC_VER
+ logprintf("%s(%d): ", filename, line);
+#else
+ logprintf("%s:%d: ", filename, line);
+#endif
+ vlogprintf(fmt, ap);
+ va_end(ap);
+ logprintf("\n");
+
+ if (msg != NULL && msg[0] != '\0') {
+ logprintf(" Description: %s\n", msg);
+ msg = NULL;
+ }
+
+ /* Determine whether to log details to console. */
+ if (verbosity == VERBOSITY_LIGHT_REPORT)
+ log_console = 0;
+}
+
+/* Complete reporting of failed tests. */
+/*
+ * The 'extra' hook here is used by libarchive to include libarchive
+ * error messages with assertion failures. It could also be used
+ * to add strerror() output, for example. Just define the EXTRA_DUMP()
+ * macro appropriately.
+ */
+static void
+failure_finish(void *extra)
+{
+ (void)extra; /* UNUSED (maybe) */
+#ifdef EXTRA_DUMP
+ if (extra != NULL) {
+ logprintf(" errno: %d\n", EXTRA_ERRNO(extra));
+ logprintf(" detail: %s\n", EXTRA_DUMP(extra));
+ }
+#endif
+
+ if (dump_on_failure) {
+ fprintf(stderr,
+ " *** forcing core dump so failure can be debugged ***\n");
+ abort();
+ }
+}
+
+/* Inform user that we're skipping some checks. */
+void
+test_skipping(const char *fmt, ...)
+{
+ char buff[1024];
+ va_list ap;
+
+ va_start(ap, fmt);
+ vsprintf(buff, fmt, ap);
+ va_end(ap);
+ /* Use failure() message if set. */
+ msg = nextmsg;
+ nextmsg = NULL;
+ /* failure_start() isn't quite right, but is awfully convenient. */
+ failure_start(skipping_filename, skipping_line, "SKIPPING: %s", buff);
+ --failures; /* Undo failures++ in failure_start() */
+ /* Don't failure_finish() here. */
+ /* Mark as skip, so doesn't count as failed test. */
+ failed_lines[skipping_line].skip = 1;
+ ++skips;
+}
+
+/*
+ *
+ * ASSERTIONS
+ *
+ */
+
+/* Generic assert() just displays the failed condition. */
+int
+assertion_assert(const char *file, int line, int value,
+ const char *condition, void *extra)
+{
+ assertion_count(file, line);
+ if (!value) {
+ failure_start(file, line, "Assertion failed: %s", condition);
+ failure_finish(extra);
+ }
+ return (value);
+}
+
+/* chdir() and report any errors */
+int
+assertion_chdir(const char *file, int line, const char *pathname)
+{
+ assertion_count(file, line);
+ if (chdir(pathname) == 0)
+ return (1);
+ failure_start(file, line, "chdir(\"%s\")", pathname);
+ failure_finish(NULL);
+ return (0);
+
+}
+
+/* Verify two integers are equal. */
+int
+assertion_equal_int(const char *file, int line,
+ long long v1, const char *e1, long long v2, const char *e2, void *extra)
+{
+ assertion_count(file, line);
+ if (v1 == v2)
+ return (1);
+ failure_start(file, line, "%s != %s", e1, e2);
+ logprintf(" %s=%lld (0x%llx, 0%llo)\n", e1, v1, v1, v1);
+ logprintf(" %s=%lld (0x%llx, 0%llo)\n", e2, v2, v2, v2);
+ failure_finish(extra);
+ return (0);
+}
+
+/*
+ * Utility to convert a single UTF-8 sequence.
+ */
+static int
+_utf8_to_unicode(uint32_t *pwc, const char *s, size_t n)
+{
+ static const char utf8_count[256] = {
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 00 - 0F */
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 10 - 1F */
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 20 - 2F */
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 30 - 3F */
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 40 - 4F */
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 50 - 5F */
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 60 - 6F */
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,/* 70 - 7F */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,/* 80 - 8F */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,/* 90 - 9F */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,/* A0 - AF */
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,/* B0 - BF */
+ 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,/* C0 - CF */
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,/* D0 - DF */
+ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,/* E0 - EF */
+ 4, 4, 4, 4, 4, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 /* F0 - FF */
+ };
+ int ch;
+ int cnt;
+ uint32_t wc;
+
+ *pwc = 0;
+
+ /* Sanity check. */
+ if (n == 0)
+ return (0);
+ /*
+ * Decode 1-4 bytes depending on the value of the first byte.
+ */
+ ch = (unsigned char)*s;
+ if (ch == 0)
+ return (0); /* Standard: return 0 for end-of-string. */
+ cnt = utf8_count[ch];
+
+ /* Invalid sequence or there are not plenty bytes. */
+ if (n < (size_t)cnt)
+ return (-1);
+
+ /* Make a Unicode code point from a single UTF-8 sequence. */
+ switch (cnt) {
+ case 1: /* 1 byte sequence. */
+ *pwc = ch & 0x7f;
+ return (cnt);
+ case 2: /* 2 bytes sequence. */
+ if ((s[1] & 0xc0) != 0x80) return (-1);
+ *pwc = ((ch & 0x1f) << 6) | (s[1] & 0x3f);
+ return (cnt);
+ case 3: /* 3 bytes sequence. */
+ if ((s[1] & 0xc0) != 0x80) return (-1);
+ if ((s[2] & 0xc0) != 0x80) return (-1);
+ wc = ((ch & 0x0f) << 12)
+ | ((s[1] & 0x3f) << 6)
+ | (s[2] & 0x3f);
+ if (wc < 0x800)
+ return (-1);/* Overlong sequence. */
+ break;
+ case 4: /* 4 bytes sequence. */
+ if (n < 4)
+ return (-1);
+ if ((s[1] & 0xc0) != 0x80) return (-1);
+ if ((s[2] & 0xc0) != 0x80) return (-1);
+ if ((s[3] & 0xc0) != 0x80) return (-1);
+ wc = ((ch & 0x07) << 18)
+ | ((s[1] & 0x3f) << 12)
+ | ((s[2] & 0x3f) << 6)
+ | (s[3] & 0x3f);
+ if (wc < 0x10000)
+ return (-1);/* Overlong sequence. */
+ break;
+ default:
+ return (-1);
+ }
+
+ /* The code point larger than 0x10FFFF is not legal
+ * Unicode values. */
+ if (wc > 0x10FFFF)
+ return (-1);
+ /* Correctly gets a Unicode, returns used bytes. */
+ *pwc = wc;
+ return (cnt);
+}
+
+static void strdump(const char *e, const char *p, int ewidth, int utf8)
+{
+ const char *q = p;
+
+ logprintf(" %*s = ", ewidth, e);
+ if (p == NULL) {
+ logprintf("NULL\n");
+ return;
+ }
+ logprintf("\"");
+ while (*p != '\0') {
+ unsigned int c = 0xff & *p++;
+ switch (c) {
+ case '\a': logprintf("\\a"); break;
+ case '\b': logprintf("\\b"); break;
+ case '\n': logprintf("\\n"); break;
+ case '\r': logprintf("\\r"); break;
+ default:
+ if (c >= 32 && c < 127)
+ logprintf("%c", c);
+ else
+ logprintf("\\x%02X", c);
+ }
+ }
+ logprintf("\"");
+ logprintf(" (length %d)", q == NULL ? -1 : (int)strlen(q));
+
+ /*
+ * If the current string is UTF-8, dump its code points.
+ */
+ if (utf8) {
+ size_t len;
+ uint32_t uc;
+ int n;
+ int cnt = 0;
+
+ p = q;
+ len = strlen(p);
+ logprintf(" [");
+ while ((n = _utf8_to_unicode(&uc, p, len)) > 0) {
+ if (p != q)
+ logprintf(" ");
+ logprintf("%04X", uc);
+ p += n;
+ len -= n;
+ cnt++;
+ }
+ logprintf("]");
+ logprintf(" (count %d", cnt);
+ if (n < 0) {
+ logprintf(",unknown %d bytes", len);
+ }
+ logprintf(")");
+
+ }
+ logprintf("\n");
+}
+
+/* Verify two strings are equal, dump them if not. */
+int
+assertion_equal_string(const char *file, int line,
+ const char *v1, const char *e1,
+ const char *v2, const char *e2,
+ void *extra, int utf8)
+{
+ int l1, l2;
+
+ assertion_count(file, line);
+ if (v1 == v2 || (v1 != NULL && v2 != NULL && strcmp(v1, v2) == 0))
+ return (1);
+ failure_start(file, line, "%s != %s", e1, e2);
+ l1 = (int)strlen(e1);
+ l2 = (int)strlen(e2);
+ if (l1 < l2)
+ l1 = l2;
+ strdump(e1, v1, l1, utf8);
+ strdump(e2, v2, l1, utf8);
+ failure_finish(extra);
+ return (0);
+}
+
+static void
+wcsdump(const char *e, const wchar_t *w)
+{
+ logprintf(" %s = ", e);
+ if (w == NULL) {
+ logprintf("(null)");
+ return;
+ }
+ logprintf("\"");
+ while (*w != L'\0') {
+ unsigned int c = *w++;
+ if (c >= 32 && c < 127)
+ logprintf("%c", c);
+ else if (c < 256)
+ logprintf("\\x%02X", c);
+ else if (c < 0x10000)
+ logprintf("\\u%04X", c);
+ else
+ logprintf("\\U%08X", c);
+ }
+ logprintf("\"\n");
+}
+
+#ifndef HAVE_WCSCMP
+static int
+wcscmp(const wchar_t *s1, const wchar_t *s2)
+{
+
+ while (*s1 == *s2++) {
+ if (*s1++ == L'\0')
+ return 0;
+ }
+ if (*s1 > *--s2)
+ return 1;
+ else
+ return -1;
+}
+#endif
+
+/* Verify that two wide strings are equal, dump them if not. */
+int
+assertion_equal_wstring(const char *file, int line,
+ const wchar_t *v1, const char *e1,
+ const wchar_t *v2, const char *e2,
+ void *extra)
+{
+ assertion_count(file, line);
+ if (v1 == v2)
+ return (1);
+ if (v1 != NULL && v2 != NULL && wcscmp(v1, v2) == 0)
+ return (1);
+ failure_start(file, line, "%s != %s", e1, e2);
+ wcsdump(e1, v1);
+ wcsdump(e2, v2);
+ failure_finish(extra);
+ return (0);
+}
+
+/*
+ * Pretty standard hexdump routine. As a bonus, if ref != NULL, then
+ * any bytes in p that differ from ref will be highlighted with '_'
+ * before and after the hex value.
+ */
+static void
+hexdump(const char *p, const char *ref, size_t l, size_t offset)
+{
+ size_t i, j;
+ char sep;
+
+ if (p == NULL) {
+ logprintf("(null)\n");
+ return;
+ }
+ for(i=0; i < l; i+=16) {
+ logprintf("%04x", (unsigned)(i + offset));
+ sep = ' ';
+ for (j = 0; j < 16 && i + j < l; j++) {
+ if (ref != NULL && p[i + j] != ref[i + j])
+ sep = '_';
+ logprintf("%c%02x", sep, 0xff & (int)p[i+j]);
+ if (ref != NULL && p[i + j] == ref[i + j])
+ sep = ' ';
+ }
+ for (; j < 16; j++) {
+ logprintf("%c ", sep);
+ sep = ' ';
+ }
+ logprintf("%c", sep);
+ for (j=0; j < 16 && i + j < l; j++) {
+ int c = p[i + j];
+ if (c >= ' ' && c <= 126)
+ logprintf("%c", c);
+ else
+ logprintf(".");
+ }
+ logprintf("\n");
+ }
+}
+
+/* Verify that two blocks of memory are the same, display the first
+ * block of differences if they're not. */
+int
+assertion_equal_mem(const char *file, int line,
+ const void *_v1, const char *e1,
+ const void *_v2, const char *e2,
+ size_t l, const char *ld, void *extra)
+{
+ const char *v1 = (const char *)_v1;
+ const char *v2 = (const char *)_v2;
+ size_t offset;
+
+ assertion_count(file, line);
+ if (v1 == v2 || (v1 != NULL && v2 != NULL && memcmp(v1, v2, l) == 0))
+ return (1);
+ if (v1 == NULL || v2 == NULL)
+ return (0);
+
+ failure_start(file, line, "%s != %s", e1, e2);
+ logprintf(" size %s = %d\n", ld, (int)l);
+ /* Dump 48 bytes (3 lines) so that the first difference is
+ * in the second line. */
+ offset = 0;
+ while (l > 64 && memcmp(v1, v2, 32) == 0) {
+ /* Two lines agree, so step forward one line. */
+ v1 += 16;
+ v2 += 16;
+ l -= 16;
+ offset += 16;
+ }
+ logprintf(" Dump of %s\n", e1);
+ hexdump(v1, v2, l < 128 ? l : 128, offset);
+ logprintf(" Dump of %s\n", e2);
+ hexdump(v2, v1, l < 128 ? l : 128, offset);
+ logprintf("\n");
+ failure_finish(extra);
+ return (0);
+}
+
+/* Verify that a block of memory is filled with the specified byte. */
+int
+assertion_memory_filled_with(const char *file, int line,
+ const void *_v1, const char *vd,
+ size_t l, const char *ld,
+ char b, const char *bd, void *extra)
+{
+ const char *v1 = (const char *)_v1;
+ size_t c = 0;
+ size_t i;
+ (void)ld; /* UNUSED */
+
+ assertion_count(file, line);
+
+ for (i = 0; i < l; ++i) {
+ if (v1[i] == b) {
+ ++c;
+ }
+ }
+ if (c == l)
+ return (1);
+
+ failure_start(file, line, "%s (size %d) not filled with %s", vd, (int)l, bd);
+ logprintf(" Only %d bytes were correct\n", (int)c);
+ failure_finish(extra);
+ return (0);
+}
+
+/* Verify that the named file exists and is empty. */
+int
+assertion_empty_file(const char *filename, int line, const char *f1)
+{
+ char buff[1024];
+ struct stat st;
+ ssize_t s;
+ FILE *f;
+
+ assertion_count(filename, line);
+
+ if (stat(f1, &st) != 0) {
+ failure_start(filename, line, "Stat failed: %s", f1);
+ failure_finish(NULL);
+ return (0);
+ }
+ if (st.st_size == 0)
+ return (1);
+
+ failure_start(filename, line, "File should be empty: %s", f1);
+ logprintf(" File size: %d\n", (int)st.st_size);
+ logprintf(" Contents:\n");
+ f = fopen(f1, "rb");
+ if (f == NULL) {
+ logprintf(" Unable to open %s\n", f1);
+ } else {
+ s = ((off_t)sizeof(buff) < st.st_size) ?
+ (ssize_t)sizeof(buff) : (ssize_t)st.st_size;
+ s = fread(buff, 1, s, f);
+ hexdump(buff, NULL, s, 0);
+ fclose(f);
+ }
+ failure_finish(NULL);
+ return (0);
+}
+
+/* Verify that the named file exists and is not empty. */
+int
+assertion_non_empty_file(const char *filename, int line, const char *f1)
+{
+ struct stat st;
+
+ assertion_count(filename, line);
+
+ if (stat(f1, &st) != 0) {
+ failure_start(filename, line, "Stat failed: %s", f1);
+ failure_finish(NULL);
+ return (0);
+ }
+ if (st.st_size == 0) {
+ failure_start(filename, line, "File empty: %s", f1);
+ failure_finish(NULL);
+ return (0);
+ }
+ return (1);
+}
+
+/* Verify that two files have the same contents. */
+/* TODO: hexdump the first bytes that actually differ. */
+int
+assertion_equal_file(const char *filename, int line, const char *fn1, const char *fn2)
+{
+ char buff1[1024];
+ char buff2[1024];
+ FILE *f1, *f2;
+ int n1, n2;
+
+ assertion_count(filename, line);
+
+ f1 = fopen(fn1, "rb");
+ f2 = fopen(fn2, "rb");
+ if (f1 == NULL || f2 == NULL) {
+ if (f1) fclose(f1);
+ if (f2) fclose(f2);
+ return (0);
+ }
+ for (;;) {
+ n1 = (int)fread(buff1, 1, sizeof(buff1), f1);
+ n2 = (int)fread(buff2, 1, sizeof(buff2), f2);
+ if (n1 != n2)
+ break;
+ if (n1 == 0 && n2 == 0) {
+ fclose(f1);
+ fclose(f2);
+ return (1);
+ }
+ if (memcmp(buff1, buff2, n1) != 0)
+ break;
+ }
+ fclose(f1);
+ fclose(f2);
+ failure_start(filename, line, "Files not identical");
+ logprintf(" file1=\"%s\"\n", fn1);
+ logprintf(" file2=\"%s\"\n", fn2);
+ failure_finish(NULL);
+ return (0);
+}
+
+/* Verify that the named file does exist. */
+int
+assertion_file_exists(const char *filename, int line, const char *f)
+{
+ assertion_count(filename, line);
+
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ if (!_access(f, 0))
+ return (1);
+#else
+ if (!access(f, F_OK))
+ return (1);
+#endif
+ failure_start(filename, line, "File should exist: %s", f);
+ failure_finish(NULL);
+ return (0);
+}
+
+/* Verify that the named file doesn't exist. */
+int
+assertion_file_not_exists(const char *filename, int line, const char *f)
+{
+ assertion_count(filename, line);
+
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ if (_access(f, 0))
+ return (1);
+#else
+ if (access(f, F_OK))
+ return (1);
+#endif
+ failure_start(filename, line, "File should not exist: %s", f);
+ failure_finish(NULL);
+ return (0);
+}
+
+/* Compare the contents of a file to a block of memory. */
+int
+assertion_file_contents(const char *filename, int line, const void *buff, int s, const char *fn)
+{
+ char *contents;
+ FILE *f;
+ int n;
+
+ assertion_count(filename, line);
+
+ f = fopen(fn, "rb");
+ if (f == NULL) {
+ failure_start(filename, line,
+ "File should exist: %s", fn);
+ failure_finish(NULL);
+ return (0);
+ }
+ contents = malloc(s * 2);
+ n = (int)fread(contents, 1, s * 2, f);
+ fclose(f);
+ if (n == s && memcmp(buff, contents, s) == 0) {
+ free(contents);
+ return (1);
+ }
+ failure_start(filename, line, "File contents don't match");
+ logprintf(" file=\"%s\"\n", fn);
+ if (n > 0)
+ hexdump(contents, buff, n > 512 ? 512 : n, 0);
+ else {
+ logprintf(" File empty, contents should be:\n");
+ hexdump(buff, NULL, s > 512 ? 512 : s, 0);
+ }
+ failure_finish(NULL);
+ free(contents);
+ return (0);
+}
+
+/* Check the contents of a text file, being tolerant of line endings. */
+int
+assertion_text_file_contents(const char *filename, int line, const char *buff, const char *fn)
+{
+ char *contents;
+ const char *btxt, *ftxt;
+ FILE *f;
+ int n, s;
+
+ assertion_count(filename, line);
+ f = fopen(fn, "r");
+ if (f == NULL) {
+ failure_start(filename, line,
+ "File doesn't exist: %s", fn);
+ failure_finish(NULL);
+ return (0);
+ }
+ s = (int)strlen(buff);
+ contents = malloc(s * 2 + 128);
+ n = (int)fread(contents, 1, s * 2 + 128 - 1, f);
+ if (n >= 0)
+ contents[n] = '\0';
+ fclose(f);
+ /* Compare texts. */
+ btxt = buff;
+ ftxt = (const char *)contents;
+ while (*btxt != '\0' && *ftxt != '\0') {
+ if (*btxt == *ftxt) {
+ ++btxt;
+ ++ftxt;
+ continue;
+ }
+ if (btxt[0] == '\n' && ftxt[0] == '\r' && ftxt[1] == '\n') {
+ /* Pass over different new line characters. */
+ ++btxt;
+ ftxt += 2;
+ continue;
+ }
+ break;
+ }
+ if (*btxt == '\0' && *ftxt == '\0') {
+ free(contents);
+ return (1);
+ }
+ failure_start(filename, line, "Contents don't match");
+ logprintf(" file=\"%s\"\n", fn);
+ if (n > 0) {
+ hexdump(contents, buff, n, 0);
+ logprintf(" expected\n", fn);
+ hexdump(buff, contents, s, 0);
+ } else {
+ logprintf(" File empty, contents should be:\n");
+ hexdump(buff, NULL, s, 0);
+ }
+ failure_finish(NULL);
+ free(contents);
+ return (0);
+}
+
+/* Verify that a text file contains the specified lines, regardless of order */
+/* This could be more efficient if we sorted both sets of lines, etc, but
+ * since this is used only for testing and only ever deals with a dozen or so
+ * lines at a time, this relatively crude approach is just fine. */
+int
+assertion_file_contains_lines_any_order(const char *file, int line,
+ const char *pathname, const char *lines[])
+{
+ char *buff;
+ size_t buff_size;
+ size_t expected_count, actual_count, i, j;
+ char **expected = NULL;
+ char *p, **actual = NULL;
+ char c;
+ int expected_failure = 0, actual_failure = 0;
+
+ assertion_count(file, line);
+
+ buff = slurpfile(&buff_size, "%s", pathname);
+ if (buff == NULL) {
+ failure_start(pathname, line, "Can't read file: %s", pathname);
+ failure_finish(NULL);
+ return (0);
+ }
+
+ /* Make a copy of the provided lines and count up the expected
+ * file size. */
+ for (i = 0; lines[i] != NULL; ++i) {
+ }
+ expected_count = i;
+ if (expected_count) {
+ expected = malloc(sizeof(char *) * expected_count);
+ if (expected == NULL) {
+ failure_start(pathname, line, "Can't allocate memory");
+ failure_finish(NULL);
+ free(expected);
+ free(buff);
+ return (0);
+ }
+ for (i = 0; lines[i] != NULL; ++i) {
+ expected[i] = strdup(lines[i]);
+ }
+ }
+
+ /* Break the file into lines */
+ actual_count = 0;
+ for (c = '\0', p = buff; p < buff + buff_size; ++p) {
+ if (*p == '\x0d' || *p == '\x0a')
+ *p = '\0';
+ if (c == '\0' && *p != '\0')
+ ++actual_count;
+ c = *p;
+ }
+ if (actual_count) {
+ actual = calloc(sizeof(char *), actual_count);
+ if (actual == NULL) {
+ failure_start(pathname, line, "Can't allocate memory");
+ failure_finish(NULL);
+ free(expected);
+ free(buff);
+ return (0);
+ }
+ for (j = 0, p = buff; p < buff + buff_size;
+ p += 1 + strlen(p)) {
+ if (*p != '\0') {
+ actual[j] = p;
+ ++j;
+ }
+ }
+ }
+
+ /* Erase matching lines from both lists */
+ for (i = 0; i < expected_count; ++i) {
+ if (expected[i] == NULL)
+ continue;
+ for (j = 0; j < actual_count; ++j) {
+ if (actual[j] == NULL)
+ continue;
+ if (strcmp(expected[i], actual[j]) == 0) {
+ free(expected[i]);
+ expected[i] = NULL;
+ actual[j] = NULL;
+ break;
+ }
+ }
+ }
+
+ /* If there's anything left, it's a failure */
+ for (i = 0; i < expected_count; ++i) {
+ if (expected[i] != NULL)
+ ++expected_failure;
+ }
+ for (j = 0; j < actual_count; ++j) {
+ if (actual[j] != NULL)
+ ++actual_failure;
+ }
+ if (expected_failure == 0 && actual_failure == 0) {
+ free(buff);
+ free(expected);
+ free(actual);
+ return (1);
+ }
+ failure_start(file, line, "File doesn't match: %s", pathname);
+ for (i = 0; i < expected_count; ++i) {
+ if (expected[i] != NULL) {
+ logprintf(" Expected but not present: %s\n", expected[i]);
+ free(expected[i]);
+ }
+ }
+ for (j = 0; j < actual_count; ++j) {
+ if (actual[j] != NULL)
+ logprintf(" Present but not expected: %s\n", actual[j]);
+ }
+ failure_finish(NULL);
+ free(buff);
+ free(expected);
+ free(actual);
+ return (0);
+}
+
+/* Verify that a text file does not contains the specified strings */
+int
+assertion_file_contains_no_invalid_strings(const char *file, int line,
+ const char *pathname, const char *strings[])
+{
+ char *buff;
+ int i;
+
+ buff = slurpfile(NULL, "%s", pathname);
+ if (buff == NULL) {
+ failure_start(file, line, "Can't read file: %s", pathname);
+ failure_finish(NULL);
+ return (0);
+ }
+
+ for (i = 0; strings[i] != NULL; ++i) {
+ if (strstr(buff, strings[i]) != NULL) {
+ failure_start(file, line, "Invalid string in %s: %s", pathname,
+ strings[i]);
+ failure_finish(NULL);
+ free(buff);
+ return(0);
+ }
+ }
+
+ free(buff);
+ return (0);
+}
+
+/* Test that two paths point to the same file. */
+/* As a side-effect, asserts that both files exist. */
+static int
+is_hardlink(const char *file, int line,
+ const char *path1, const char *path2)
+{
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ BY_HANDLE_FILE_INFORMATION bhfi1, bhfi2;
+ int r;
+
+ assertion_count(file, line);
+ r = my_GetFileInformationByName(path1, &bhfi1);
+ if (r == 0) {
+ failure_start(file, line, "File %s can't be inspected?", path1);
+ failure_finish(NULL);
+ return (0);
+ }
+ r = my_GetFileInformationByName(path2, &bhfi2);
+ if (r == 0) {
+ failure_start(file, line, "File %s can't be inspected?", path2);
+ failure_finish(NULL);
+ return (0);
+ }
+ return (bhfi1.dwVolumeSerialNumber == bhfi2.dwVolumeSerialNumber
+ && bhfi1.nFileIndexHigh == bhfi2.nFileIndexHigh
+ && bhfi1.nFileIndexLow == bhfi2.nFileIndexLow);
+#else
+ struct stat st1, st2;
+ int r;
+
+ assertion_count(file, line);
+ r = lstat(path1, &st1);
+ if (r != 0) {
+ failure_start(file, line, "File should exist: %s", path1);
+ failure_finish(NULL);
+ return (0);
+ }
+ r = lstat(path2, &st2);
+ if (r != 0) {
+ failure_start(file, line, "File should exist: %s", path2);
+ failure_finish(NULL);
+ return (0);
+ }
+ return (st1.st_ino == st2.st_ino && st1.st_dev == st2.st_dev);
+#endif
+}
+
+int
+assertion_is_hardlink(const char *file, int line,
+ const char *path1, const char *path2)
+{
+ if (is_hardlink(file, line, path1, path2))
+ return (1);
+ failure_start(file, line,
+ "Files %s and %s are not hardlinked", path1, path2);
+ failure_finish(NULL);
+ return (0);
+}
+
+int
+assertion_is_not_hardlink(const char *file, int line,
+ const char *path1, const char *path2)
+{
+ if (!is_hardlink(file, line, path1, path2))
+ return (1);
+ failure_start(file, line,
+ "Files %s and %s should not be hardlinked", path1, path2);
+ failure_finish(NULL);
+ return (0);
+}
+
+/* Verify a/b/mtime of 'pathname'. */
+/* If 'recent', verify that it's within last 10 seconds. */
+static int
+assertion_file_time(const char *file, int line,
+ const char *pathname, long t, long nsec, char type, int recent)
+{
+ long long filet, filet_nsec;
+ int r;
+
+#if defined(_WIN32) && !defined(__CYGWIN__)
+#define EPOC_TIME (116444736000000000ULL)
+ FILETIME fxtime, fbirthtime, fatime, fmtime;
+ ULARGE_INTEGER wintm;
+ HANDLE h;
+ fxtime.dwLowDateTime = 0;
+ fxtime.dwHighDateTime = 0;
+
+ assertion_count(file, line);
+ /* Note: FILE_FLAG_BACKUP_SEMANTICS applies to open
+ * a directory file. If not, CreateFile() will fail when
+ * the pathname is a directory. */
+ h = CreateFile(pathname, FILE_READ_ATTRIBUTES, 0, NULL,
+ OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL);
+ if (h == INVALID_HANDLE_VALUE) {
+ failure_start(file, line, "Can't access %s\n", pathname);
+ failure_finish(NULL);
+ return (0);
+ }
+ r = GetFileTime(h, &fbirthtime, &fatime, &fmtime);
+ switch (type) {
+ case 'a': fxtime = fatime; break;
+ case 'b': fxtime = fbirthtime; break;
+ case 'm': fxtime = fmtime; break;
+ }
+ CloseHandle(h);
+ if (r == 0) {
+ failure_start(file, line, "Can't GetFileTime %s\n", pathname);
+ failure_finish(NULL);
+ return (0);
+ }
+ wintm.LowPart = fxtime.dwLowDateTime;
+ wintm.HighPart = fxtime.dwHighDateTime;
+ filet = (wintm.QuadPart - EPOC_TIME) / 10000000;
+ filet_nsec = ((wintm.QuadPart - EPOC_TIME) % 10000000) * 100;
+ nsec = (nsec / 100) * 100; /* Round the request */
+#else
+ struct stat st;
+
+ assertion_count(file, line);
+ r = lstat(pathname, &st);
+ if (r != 0) {
+ failure_start(file, line, "Can't stat %s\n", pathname);
+ failure_finish(NULL);
+ return (0);
+ }
+ switch (type) {
+ case 'a': filet = st.st_atime; break;
+ case 'm': filet = st.st_mtime; break;
+ case 'b': filet = 0; break;
+ default: fprintf(stderr, "INTERNAL: Bad type %c for file time", type);
+ exit(1);
+ }
+#if defined(__FreeBSD__)
+ switch (type) {
+ case 'a': filet_nsec = st.st_atimespec.tv_nsec; break;
+ case 'b': filet = st.st_birthtime;
+ /* FreeBSD filesystems that don't support birthtime
+ * (e.g., UFS1) always return -1 here. */
+ if (filet == -1) {
+ return (1);
+ }
+ filet_nsec = st.st_birthtimespec.tv_nsec; break;
+ case 'm': filet_nsec = st.st_mtimespec.tv_nsec; break;
+ default: fprintf(stderr, "INTERNAL: Bad type %c for file time", type);
+ exit(1);
+ }
+ /* FreeBSD generally only stores to microsecond res, so round. */
+ filet_nsec = (filet_nsec / 1000) * 1000;
+ nsec = (nsec / 1000) * 1000;
+#else
+ filet_nsec = nsec = 0; /* Generic POSIX only has whole seconds. */
+ if (type == 'b') return (1); /* Generic POSIX doesn't have birthtime */
+#if defined(__HAIKU__)
+ if (type == 'a') return (1); /* Haiku doesn't have atime. */
+#endif
+#endif
+#endif
+ if (recent) {
+ /* Check that requested time is up-to-date. */
+ time_t now = time(NULL);
+ if (filet < now - 10 || filet > now + 1) {
+ failure_start(file, line,
+ "File %s has %ctime %lld, %lld seconds ago\n",
+ pathname, type, filet, now - filet);
+ failure_finish(NULL);
+ return (0);
+ }
+ } else if (filet != t || filet_nsec != nsec) {
+ failure_start(file, line,
+ "File %s has %ctime %lld.%09lld, expected %lld.%09lld",
+ pathname, type, filet, filet_nsec, t, nsec);
+ failure_finish(NULL);
+ return (0);
+ }
+ return (1);
+}
+
+/* Verify atime of 'pathname'. */
+int
+assertion_file_atime(const char *file, int line,
+ const char *pathname, long t, long nsec)
+{
+ return assertion_file_time(file, line, pathname, t, nsec, 'a', 0);
+}
+
+/* Verify atime of 'pathname' is up-to-date. */
+int
+assertion_file_atime_recent(const char *file, int line, const char *pathname)
+{
+ return assertion_file_time(file, line, pathname, 0, 0, 'a', 1);
+}
+
+/* Verify birthtime of 'pathname'. */
+int
+assertion_file_birthtime(const char *file, int line,
+ const char *pathname, long t, long nsec)
+{
+ return assertion_file_time(file, line, pathname, t, nsec, 'b', 0);
+}
+
+/* Verify birthtime of 'pathname' is up-to-date. */
+int
+assertion_file_birthtime_recent(const char *file, int line,
+ const char *pathname)
+{
+ return assertion_file_time(file, line, pathname, 0, 0, 'b', 1);
+}
+
+/* Verify mode of 'pathname'. */
+int
+assertion_file_mode(const char *file, int line, const char *pathname, int expected_mode)
+{
+ int mode;
+ int r;
+
+ assertion_count(file, line);
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ failure_start(file, line, "assertFileMode not yet implemented for Windows");
+ (void)mode; /* UNUSED */
+ (void)r; /* UNUSED */
+ (void)pathname; /* UNUSED */
+ (void)expected_mode; /* UNUSED */
+#else
+ {
+ struct stat st;
+ r = lstat(pathname, &st);
+ mode = (int)(st.st_mode & 0777);
+ }
+ if (r == 0 && mode == expected_mode)
+ return (1);
+ failure_start(file, line, "File %s has mode %o, expected %o",
+ pathname, mode, expected_mode);
+#endif
+ failure_finish(NULL);
+ return (0);
+}
+
+/* Verify mtime of 'pathname'. */
+int
+assertion_file_mtime(const char *file, int line,
+ const char *pathname, long t, long nsec)
+{
+ return assertion_file_time(file, line, pathname, t, nsec, 'm', 0);
+}
+
+/* Verify mtime of 'pathname' is up-to-date. */
+int
+assertion_file_mtime_recent(const char *file, int line, const char *pathname)
+{
+ return assertion_file_time(file, line, pathname, 0, 0, 'm', 1);
+}
+
+/* Verify number of links to 'pathname'. */
+int
+assertion_file_nlinks(const char *file, int line,
+ const char *pathname, int nlinks)
+{
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ BY_HANDLE_FILE_INFORMATION bhfi;
+ int r;
+
+ assertion_count(file, line);
+ r = my_GetFileInformationByName(pathname, &bhfi);
+ if (r != 0 && bhfi.nNumberOfLinks == (DWORD)nlinks)
+ return (1);
+ failure_start(file, line, "File %s has %d links, expected %d",
+ pathname, bhfi.nNumberOfLinks, nlinks);
+ failure_finish(NULL);
+ return (0);
+#else
+ struct stat st;
+ int r;
+
+ assertion_count(file, line);
+ r = lstat(pathname, &st);
+ if (r == 0 && (int)st.st_nlink == nlinks)
+ return (1);
+ failure_start(file, line, "File %s has %d links, expected %d",
+ pathname, st.st_nlink, nlinks);
+ failure_finish(NULL);
+ return (0);
+#endif
+}
+
+/* Verify size of 'pathname'. */
+int
+assertion_file_size(const char *file, int line, const char *pathname, long size)
+{
+ int64_t filesize;
+ int r;
+
+ assertion_count(file, line);
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ {
+ BY_HANDLE_FILE_INFORMATION bhfi;
+ r = !my_GetFileInformationByName(pathname, &bhfi);
+ filesize = ((int64_t)bhfi.nFileSizeHigh << 32) + bhfi.nFileSizeLow;
+ }
+#else
+ {
+ struct stat st;
+ r = lstat(pathname, &st);
+ filesize = st.st_size;
+ }
+#endif
+ if (r == 0 && filesize == size)
+ return (1);
+ failure_start(file, line, "File %s has size %ld, expected %ld",
+ pathname, (long)filesize, (long)size);
+ failure_finish(NULL);
+ return (0);
+}
+
+/* Assert that 'pathname' is a dir. If mode >= 0, verify that too. */
+int
+assertion_is_dir(const char *file, int line, const char *pathname, int mode)
+{
+ struct stat st;
+ int r;
+
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ (void)mode; /* UNUSED */
+#endif
+ assertion_count(file, line);
+ r = lstat(pathname, &st);
+ if (r != 0) {
+ failure_start(file, line, "Dir should exist: %s", pathname);
+ failure_finish(NULL);
+ return (0);
+ }
+ if (!S_ISDIR(st.st_mode)) {
+ failure_start(file, line, "%s is not a dir", pathname);
+ failure_finish(NULL);
+ return (0);
+ }
+#if !defined(_WIN32) || defined(__CYGWIN__)
+ /* Windows doesn't handle permissions the same way as POSIX,
+ * so just ignore the mode tests. */
+ /* TODO: Can we do better here? */
+ if (mode >= 0 && (mode_t)mode != (st.st_mode & 07777)) {
+ failure_start(file, line, "Dir %s has wrong mode", pathname);
+ logprintf(" Expected: 0%3o\n", mode);
+ logprintf(" Found: 0%3o\n", st.st_mode & 07777);
+ failure_finish(NULL);
+ return (0);
+ }
+#endif
+ return (1);
+}
+
+/* Verify that 'pathname' is a regular file. If 'mode' is >= 0,
+ * verify that too. */
+int
+assertion_is_reg(const char *file, int line, const char *pathname, int mode)
+{
+ struct stat st;
+ int r;
+
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ (void)mode; /* UNUSED */
+#endif
+ assertion_count(file, line);
+ r = lstat(pathname, &st);
+ if (r != 0 || !S_ISREG(st.st_mode)) {
+ failure_start(file, line, "File should exist: %s", pathname);
+ failure_finish(NULL);
+ return (0);
+ }
+#if !defined(_WIN32) || defined(__CYGWIN__)
+ /* Windows doesn't handle permissions the same way as POSIX,
+ * so just ignore the mode tests. */
+ /* TODO: Can we do better here? */
+ if (mode >= 0 && (mode_t)mode != (st.st_mode & 07777)) {
+ failure_start(file, line, "File %s has wrong mode", pathname);
+ logprintf(" Expected: 0%3o\n", mode);
+ logprintf(" Found: 0%3o\n", st.st_mode & 07777);
+ failure_finish(NULL);
+ return (0);
+ }
+#endif
+ return (1);
+}
+
+/* Check whether 'pathname' is a symbolic link. If 'contents' is
+ * non-NULL, verify that the symlink has those contents. */
+static int
+is_symlink(const char *file, int line,
+ const char *pathname, const char *contents)
+{
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ (void)pathname; /* UNUSED */
+ (void)contents; /* UNUSED */
+ assertion_count(file, line);
+ /* Windows sort-of has real symlinks, but they're only usable
+ * by privileged users and are crippled even then, so there's
+ * really not much point in bothering with this. */
+ return (0);
+#else
+ char buff[300];
+ struct stat st;
+ ssize_t linklen;
+ int r;
+
+ assertion_count(file, line);
+ r = lstat(pathname, &st);
+ if (r != 0) {
+ failure_start(file, line,
+ "Symlink should exist: %s", pathname);
+ failure_finish(NULL);
+ return (0);
+ }
+ if (!S_ISLNK(st.st_mode))
+ return (0);
+ if (contents == NULL)
+ return (1);
+ linklen = readlink(pathname, buff, sizeof(buff));
+ if (linklen < 0) {
+ failure_start(file, line, "Can't read symlink %s", pathname);
+ failure_finish(NULL);
+ return (0);
+ }
+ buff[linklen] = '\0';
+ if (strcmp(buff, contents) != 0)
+ return (0);
+ return (1);
+#endif
+}
+
+/* Assert that path is a symlink that (optionally) contains contents. */
+int
+assertion_is_symlink(const char *file, int line,
+ const char *path, const char *contents)
+{
+ if (is_symlink(file, line, path, contents))
+ return (1);
+ if (contents)
+ failure_start(file, line, "File %s is not a symlink to %s",
+ path, contents);
+ else
+ failure_start(file, line, "File %s is not a symlink", path);
+ failure_finish(NULL);
+ return (0);
+}
+
+
+/* Create a directory and report any errors. */
+int
+assertion_make_dir(const char *file, int line, const char *dirname, int mode)
+{
+ assertion_count(file, line);
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ (void)mode; /* UNUSED */
+ if (0 == _mkdir(dirname))
+ return (1);
+#else
+ if (0 == mkdir(dirname, mode)) {
+ if (0 == chmod(dirname, mode)) {
+ assertion_file_mode(file, line, dirname, mode);
+ return (1);
+ }
+ }
+#endif
+ failure_start(file, line, "Could not create directory %s", dirname);
+ failure_finish(NULL);
+ return(0);
+}
+
+/* Create a file with the specified contents and report any failures. */
+int
+assertion_make_file(const char *file, int line,
+ const char *path, int mode, int csize, const void *contents)
+{
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ /* TODO: Rework this to set file mode as well. */
+ FILE *f;
+ (void)mode; /* UNUSED */
+ assertion_count(file, line);
+ f = fopen(path, "wb");
+ if (f == NULL) {
+ failure_start(file, line, "Could not create file %s", path);
+ failure_finish(NULL);
+ return (0);
+ }
+ if (contents != NULL) {
+ size_t wsize;
+
+ if (csize < 0)
+ wsize = strlen(contents);
+ else
+ wsize = (size_t)csize;
+ if (wsize != fwrite(contents, 1, wsize, f)) {
+ fclose(f);
+ failure_start(file, line,
+ "Could not write file %s", path);
+ failure_finish(NULL);
+ return (0);
+ }
+ }
+ fclose(f);
+ return (1);
+#else
+ int fd;
+ assertion_count(file, line);
+ fd = open(path, O_CREAT | O_WRONLY, mode >= 0 ? mode : 0644);
+ if (fd < 0) {
+ failure_start(file, line, "Could not create %s", path);
+ failure_finish(NULL);
+ return (0);
+ }
+ if (0 != chmod(path, mode)) {
+ failure_start(file, line, "Could not chmod %s", path);
+ failure_finish(NULL);
+ close(fd);
+ return (0);
+ }
+ if (contents != NULL) {
+ ssize_t wsize;
+
+ if (csize < 0)
+ wsize = (ssize_t)strlen(contents);
+ else
+ wsize = (ssize_t)csize;
+ if (wsize != write(fd, contents, wsize)) {
+ close(fd);
+ failure_start(file, line,
+ "Could not write to %s", path);
+ failure_finish(NULL);
+ close(fd);
+ return (0);
+ }
+ }
+ close(fd);
+ assertion_file_mode(file, line, path, mode);
+ return (1);
+#endif
+}
+
+/* Create a hardlink and report any failures. */
+int
+assertion_make_hardlink(const char *file, int line,
+ const char *newpath, const char *linkto)
+{
+ int succeeded;
+
+ assertion_count(file, line);
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ succeeded = my_CreateHardLinkA(newpath, linkto);
+#elif HAVE_LINK
+ succeeded = !link(linkto, newpath);
+#else
+ succeeded = 0;
+#endif
+ if (succeeded)
+ return (1);
+ failure_start(file, line, "Could not create hardlink");
+ logprintf(" New link: %s\n", newpath);
+ logprintf(" Old name: %s\n", linkto);
+ failure_finish(NULL);
+ return(0);
+}
+
+/* Create a symlink and report any failures. */
+int
+assertion_make_symlink(const char *file, int line,
+ const char *newpath, const char *linkto)
+{
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ int targetIsDir = 0; /* TODO: Fix this */
+ assertion_count(file, line);
+ if (my_CreateSymbolicLinkA(newpath, linkto, targetIsDir))
+ return (1);
+#elif HAVE_SYMLINK
+ assertion_count(file, line);
+ if (0 == symlink(linkto, newpath))
+ return (1);
+#endif
+ failure_start(file, line, "Could not create symlink");
+ logprintf(" New link: %s\n", newpath);
+ logprintf(" Old name: %s\n", linkto);
+ failure_finish(NULL);
+ return(0);
+}
+
+/* Set umask, report failures. */
+int
+assertion_umask(const char *file, int line, int mask)
+{
+ assertion_count(file, line);
+ (void)file; /* UNUSED */
+ (void)line; /* UNUSED */
+ umask(mask);
+ return (1);
+}
+
+/* Set times, report failures. */
+int
+assertion_utimes(const char *file, int line,
+ const char *pathname, long at, long at_nsec, long mt, long mt_nsec)
+{
+ int r;
+
+#if defined(_WIN32) && !defined(__CYGWIN__)
+#define WINTIME(sec, nsec) ((Int32x32To64(sec, 10000000) + EPOC_TIME)\
+ + (((nsec)/1000)*10))
+ HANDLE h;
+ ULARGE_INTEGER wintm;
+ FILETIME fatime, fmtime;
+ FILETIME *pat, *pmt;
+
+ assertion_count(file, line);
+ h = CreateFileA(pathname,GENERIC_READ | GENERIC_WRITE,
+ FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING,
+ FILE_FLAG_BACKUP_SEMANTICS, NULL);
+ if (h == INVALID_HANDLE_VALUE) {
+ failure_start(file, line, "Can't access %s\n", pathname);
+ failure_finish(NULL);
+ return (0);
+ }
+
+ if (at > 0 || at_nsec > 0) {
+ wintm.QuadPart = WINTIME(at, at_nsec);
+ fatime.dwLowDateTime = wintm.LowPart;
+ fatime.dwHighDateTime = wintm.HighPart;
+ pat = &fatime;
+ } else
+ pat = NULL;
+ if (mt > 0 || mt_nsec > 0) {
+ wintm.QuadPart = WINTIME(mt, mt_nsec);
+ fmtime.dwLowDateTime = wintm.LowPart;
+ fmtime.dwHighDateTime = wintm.HighPart;
+ pmt = &fmtime;
+ } else
+ pmt = NULL;
+ if (pat != NULL || pmt != NULL)
+ r = SetFileTime(h, NULL, pat, pmt);
+ else
+ r = 1;
+ CloseHandle(h);
+ if (r == 0) {
+ failure_start(file, line, "Can't SetFileTime %s\n", pathname);
+ failure_finish(NULL);
+ return (0);
+ }
+ return (1);
+#else /* defined(_WIN32) && !defined(__CYGWIN__) */
+ struct stat st;
+ struct timeval times[2];
+
+#if !defined(__FreeBSD__)
+ mt_nsec = at_nsec = 0; /* Generic POSIX only has whole seconds. */
+#endif
+ if (mt == 0 && mt_nsec == 0 && at == 0 && at_nsec == 0)
+ return (1);
+
+ r = lstat(pathname, &st);
+ if (r < 0) {
+ failure_start(file, line, "Can't stat %s\n", pathname);
+ failure_finish(NULL);
+ return (0);
+ }
+
+ if (mt == 0 && mt_nsec == 0) {
+ mt = st.st_mtime;
+#if defined(__FreeBSD__)
+ mt_nsec = st.st_mtimespec.tv_nsec;
+ /* FreeBSD generally only stores to microsecond res, so round. */
+ mt_nsec = (mt_nsec / 1000) * 1000;
+#endif
+ }
+ if (at == 0 && at_nsec == 0) {
+ at = st.st_atime;
+#if defined(__FreeBSD__)
+ at_nsec = st.st_atimespec.tv_nsec;
+ /* FreeBSD generally only stores to microsecond res, so round. */
+ at_nsec = (at_nsec / 1000) * 1000;
+#endif
+ }
+
+ times[1].tv_sec = mt;
+ times[1].tv_usec = mt_nsec / 1000;
+
+ times[0].tv_sec = at;
+ times[0].tv_usec = at_nsec / 1000;
+
+#ifdef HAVE_LUTIMES
+ r = lutimes(pathname, times);
+#else
+ r = utimes(pathname, times);
+#endif
+ if (r < 0) {
+ failure_start(file, line, "Can't utimes %s\n", pathname);
+ failure_finish(NULL);
+ return (0);
+ }
+ return (1);
+#endif /* defined(_WIN32) && !defined(__CYGWIN__) */
+}
+
+/* Compare file flags */
+int
+assertion_compare_fflags(const char *file, int line, const char *patha,
+ const char *pathb, int nomatch)
+{
+#if defined(HAVE_STRUCT_STAT_ST_FLAGS) && defined(UF_NODUMP)
+ struct stat sa, sb;
+
+ assertion_count(file, line);
+
+ if (stat(patha, &sa) < 0)
+ return (0);
+ if (stat(pathb, &sb) < 0)
+ return (0);
+ if (!nomatch && sa.st_flags != sb.st_flags) {
+ failure_start(file, line, "File flags should be identical: "
+ "%s=%#010x %s=%#010x", patha, sa.st_flags, pathb,
+ sb.st_flags);
+ failure_finish(NULL);
+ return (0);
+ }
+ if (nomatch && sa.st_flags == sb.st_flags) {
+ failure_start(file, line, "File flags should be different: "
+ "%s=%#010x %s=%#010x", patha, sa.st_flags, pathb,
+ sb.st_flags);
+ failure_finish(NULL);
+ return (0);
+ }
+#elif (defined(FS_IOC_GETFLAGS) && defined(HAVE_WORKING_FS_IOC_GETFLAGS) && \
+ defined(FS_NODUMP_FL)) || \
+ (defined(EXT2_IOC_GETFLAGS) && defined(HAVE_WORKING_EXT2_IOC_GETFLAGS) \
+ && defined(EXT2_NODUMP_FL))
+ int fd, r, flagsa, flagsb;
+
+ assertion_count(file, line);
+ fd = open(patha, O_RDONLY | O_NONBLOCK);
+ if (fd < 0) {
+ failure_start(file, line, "Can't open %s\n", patha);
+ failure_finish(NULL);
+ return (0);
+ }
+ r = ioctl(fd,
+#ifdef FS_IOC_GETFLAGS
+ FS_IOC_GETFLAGS,
+#else
+ EXT2_IOC_GETFLAGS,
+#endif
+ &flagsa);
+ close(fd);
+ if (r < 0) {
+ failure_start(file, line, "Can't get flags %s\n", patha);
+ failure_finish(NULL);
+ return (0);
+ }
+ fd = open(pathb, O_RDONLY | O_NONBLOCK);
+ if (fd < 0) {
+ failure_start(file, line, "Can't open %s\n", pathb);
+ failure_finish(NULL);
+ return (0);
+ }
+ r = ioctl(fd,
+#ifdef FS_IOC_GETFLAGS
+ FS_IOC_GETFLAGS,
+#else
+ EXT2_IOC_GETFLAGS,
+#endif
+ &flagsb);
+ close(fd);
+ if (r < 0) {
+ failure_start(file, line, "Can't get flags %s\n", pathb);
+ failure_finish(NULL);
+ return (0);
+ }
+ if (!nomatch && flagsa != flagsb) {
+ failure_start(file, line, "File flags should be identical: "
+ "%s=%#010x %s=%#010x", patha, flagsa, pathb, flagsb);
+ failure_finish(NULL);
+ return (0);
+ }
+ if (nomatch && flagsa == flagsb) {
+ failure_start(file, line, "File flags should be different: "
+ "%s=%#010x %s=%#010x", patha, flagsa, pathb, flagsb);
+ failure_finish(NULL);
+ return (0);
+ }
+#else
+ (void)patha; /* UNUSED */
+ (void)pathb; /* UNUSED */
+ (void)nomatch; /* UNUSED */
+ assertion_count(file, line);
+#endif
+ return (1);
+}
+
+/* Set nodump, report failures. */
+int
+assertion_set_nodump(const char *file, int line, const char *pathname)
+{
+#if defined(HAVE_STRUCT_STAT_ST_FLAGS) && defined(UF_NODUMP)
+ int r;
+
+ assertion_count(file, line);
+ r = chflags(pathname, UF_NODUMP);
+ if (r < 0) {
+ failure_start(file, line, "Can't set nodump %s\n", pathname);
+ failure_finish(NULL);
+ return (0);
+ }
+#elif (defined(FS_IOC_GETFLAGS) && defined(HAVE_WORKING_FS_IOC_GETFLAGS) && \
+ defined(FS_NODUMP_FL)) || \
+ (defined(EXT2_IOC_GETFLAGS) && defined(HAVE_WORKING_EXT2_IOC_GETFLAGS) \
+ && defined(EXT2_NODUMP_FL))
+ int fd, r, flags;
+
+ assertion_count(file, line);
+ fd = open(pathname, O_RDONLY | O_NONBLOCK);
+ if (fd < 0) {
+ failure_start(file, line, "Can't open %s\n", pathname);
+ failure_finish(NULL);
+ return (0);
+ }
+ r = ioctl(fd,
+#ifdef FS_IOC_GETFLAGS
+ FS_IOC_GETFLAGS,
+#else
+ EXT2_IOC_GETFLAGS,
+#endif
+ &flags);
+ if (r < 0) {
+ failure_start(file, line, "Can't get flags %s\n", pathname);
+ failure_finish(NULL);
+ return (0);
+ }
+#ifdef FS_NODUMP_FL
+ flags |= FS_NODUMP_FL;
+#else
+ flags |= EXT2_NODUMP_FL;
+#endif
+
+ r = ioctl(fd,
+#ifdef FS_IOC_SETFLAGS
+ FS_IOC_SETFLAGS,
+#else
+ EXT2_IOC_SETFLAGS,
+#endif
+ &flags);
+ if (r < 0) {
+ failure_start(file, line, "Can't set nodump %s\n", pathname);
+ failure_finish(NULL);
+ return (0);
+ }
+ close(fd);
+#else
+ (void)pathname; /* UNUSED */
+ assertion_count(file, line);
+#endif
+ return (1);
+}
+
+#ifdef PROGRAM
+static void assert_version_id(char **qq, size_t *ss)
+{
+ char *q = *qq;
+ size_t s = *ss;
+
+ /* Version number is a series of digits and periods. */
+ while (s > 0 && (*q == '.' || (*q >= '0' && *q <= '9'))) {
+ ++q;
+ --s;
+ }
+
+ if (q[0] == 'd' && q[1] == 'e' && q[2] == 'v') {
+ q += 3;
+ s -= 3;
+ }
+
+ /* Skip a single trailing a,b,c, or d. */
+ if (*q == 'a' || *q == 'b' || *q == 'c' || *q == 'd')
+ ++q;
+
+ /* Version number terminated by space. */
+ failure("No space after version: ``%s''", q);
+ assert(s > 1);
+ failure("No space after version: ``%s''", q);
+ assert(*q == ' ');
+
+ ++q; --s;
+
+ *qq = q;
+ *ss = s;
+}
+
+
+/*
+ * Check program version
+ */
+void assertVersion(const char *prog, const char *base)
+{
+ int r;
+ char *p, *q;
+ size_t s;
+ unsigned int prog_len = strlen(base);
+
+ r = systemf("%s --version >version.stdout 2>version.stderr", prog);
+ if (r != 0)
+ r = systemf("%s -W version >version.stdout 2>version.stderr",
+ prog);
+
+ failure("Unable to run either %s --version or %s -W version",
+ prog, prog);
+ if (!assert(r == 0))
+ return;
+
+ /* --version should generate nothing to stdout. */
+ assertEmptyFile("version.stderr");
+
+ /* Verify format of version message. */
+ q = p = slurpfile(&s, "version.stdout");
+
+ /* Version message should start with name of program, then space. */
+ assert(s > prog_len + 1);
+
+ failure("Version must start with '%s': ``%s''", base, p);
+ if (!assertEqualMem(q, base, prog_len)) {
+ free(p);
+ return;
+ }
+
+ q += prog_len; s -= prog_len;
+
+ assert(*q == ' ');
+ q++; s--;
+
+ assert_version_id(&q, &s);
+
+ /* Separator. */
+ failure("No `-' between program name and versions: ``%s''", p);
+ assertEqualMem(q, "- ", 2);
+ q += 2; s -= 2;
+
+ failure("Not long enough for libarchive version: ``%s''", p);
+ assert(s > 11);
+
+ failure("Libarchive version must start with `libarchive': ``%s''", p);
+ assertEqualMem(q, "libarchive ", 11);
+
+ q += 11; s -= 11;
+
+ assert_version_id(&q, &s);
+
+ /* Skip arbitrary third-party version numbers. */
+ while (s > 0 && (*q == ' ' || *q == '-' || *q == '/' || *q == '.' ||
+ isalnum(*q))) {
+ ++q;
+ --s;
+ }
+
+ /* All terminated by end-of-line. */
+ assert(s >= 1);
+
+ /* Skip an optional CR character (e.g., Windows) */
+ failure("Version output must end with \\n or \\r\\n");
+
+ if (*q == '\r') { ++q; --s; }
+ assertEqualMem(q, "\n", 1);
+
+ free(p);
+}
+#endif /* PROGRAM */
+
+/*
+ *
+ * UTILITIES for use by tests.
+ *
+ */
+
+/*
+ * Check whether platform supports symlinks. This is intended
+ * for tests to use in deciding whether to bother testing symlink
+ * support; if the platform doesn't support symlinks, there's no point
+ * in checking whether the program being tested can create them.
+ *
+ * Note that the first time this test is called, we actually go out to
+ * disk to create and verify a symlink. This is necessary because
+ * symlink support is actually a property of a particular filesystem
+ * and can thus vary between directories on a single system. After
+ * the first call, this returns the cached result from memory, so it's
+ * safe to call it as often as you wish.
+ */
+int
+canSymlink(void)
+{
+ /* Remember the test result */
+ static int value = 0, tested = 0;
+ if (tested)
+ return (value);
+
+ ++tested;
+ assertion_make_file(__FILE__, __LINE__, "canSymlink.0", 0644, 1, "a");
+ /* Note: Cygwin has its own symlink() emulation that does not
+ * use the Win32 CreateSymbolicLink() function. */
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ value = my_CreateSymbolicLinkA("canSymlink.1", "canSymlink.0", 0)
+ && is_symlink(__FILE__, __LINE__, "canSymlink.1", "canSymlink.0");
+#elif HAVE_SYMLINK
+ value = (0 == symlink("canSymlink.0", "canSymlink.1"))
+ && is_symlink(__FILE__, __LINE__, "canSymlink.1","canSymlink.0");
+#endif
+ return (value);
+}
+
+/* Platform-dependent options for hiding the output of a subcommand. */
+#if defined(_WIN32) && !defined(__CYGWIN__)
+static const char *redirectArgs = ">NUL 2>NUL"; /* Win32 cmd.exe */
+#else
+static const char *redirectArgs = ">/dev/null 2>/dev/null"; /* POSIX 'sh' */
+#endif
+/*
+ * Can this platform run the bzip2 program?
+ */
+int
+canBzip2(void)
+{
+ static int tested = 0, value = 0;
+ if (!tested) {
+ tested = 1;
+ if (systemf("bzip2 -d -V %s", redirectArgs) == 0)
+ value = 1;
+ }
+ return (value);
+}
+
+/*
+ * Can this platform run the grzip program?
+ */
+int
+canGrzip(void)
+{
+ static int tested = 0, value = 0;
+ if (!tested) {
+ tested = 1;
+ if (systemf("grzip -V %s", redirectArgs) == 0)
+ value = 1;
+ }
+ return (value);
+}
+
+/*
+ * Can this platform run the gzip program?
+ */
+int
+canGzip(void)
+{
+ static int tested = 0, value = 0;
+ if (!tested) {
+ tested = 1;
+ if (systemf("gzip -V %s", redirectArgs) == 0)
+ value = 1;
+ }
+ return (value);
+}
+
+/*
+ * Can this platform run the lrzip program?
+ */
+int
+canRunCommand(const char *cmd)
+{
+ static int tested = 0, value = 0;
+ if (!tested) {
+ tested = 1;
+ if (systemf("%s %s", cmd, redirectArgs) == 0)
+ value = 1;
+ }
+ return (value);
+}
+
+int
+canLrzip(void)
+{
+ static int tested = 0, value = 0;
+ if (!tested) {
+ tested = 1;
+ if (systemf("lrzip -V %s", redirectArgs) == 0)
+ value = 1;
+ }
+ return (value);
+}
+
+/*
+ * Can this platform run the lz4 program?
+ */
+int
+canLz4(void)
+{
+ static int tested = 0, value = 0;
+ if (!tested) {
+ tested = 1;
+ if (systemf("lz4 -V %s", redirectArgs) == 0)
+ value = 1;
+ }
+ return (value);
+}
+
+/*
+ * Can this platform run the lzip program?
+ */
+int
+canLzip(void)
+{
+ static int tested = 0, value = 0;
+ if (!tested) {
+ tested = 1;
+ if (systemf("lzip -V %s", redirectArgs) == 0)
+ value = 1;
+ }
+ return (value);
+}
+
+/*
+ * Can this platform run the lzma program?
+ */
+int
+canLzma(void)
+{
+ static int tested = 0, value = 0;
+ if (!tested) {
+ tested = 1;
+ if (systemf("lzma -V %s", redirectArgs) == 0)
+ value = 1;
+ }
+ return (value);
+}
+
+/*
+ * Can this platform run the lzop program?
+ */
+int
+canLzop(void)
+{
+ static int tested = 0, value = 0;
+ if (!tested) {
+ tested = 1;
+ if (systemf("lzop -V %s", redirectArgs) == 0)
+ value = 1;
+ }
+ return (value);
+}
+
+/*
+ * Can this platform run the xz program?
+ */
+int
+canXz(void)
+{
+ static int tested = 0, value = 0;
+ if (!tested) {
+ tested = 1;
+ if (systemf("xz -V %s", redirectArgs) == 0)
+ value = 1;
+ }
+ return (value);
+}
+
+/*
+ * Can this filesystem handle nodump flags.
+ */
+int
+canNodump(void)
+{
+#if defined(HAVE_STRUCT_STAT_ST_FLAGS) && defined(UF_NODUMP)
+ const char *path = "cannodumptest";
+ struct stat sb;
+
+ assertion_make_file(__FILE__, __LINE__, path, 0644, 0, NULL);
+ if (chflags(path, UF_NODUMP) < 0)
+ return (0);
+ if (stat(path, &sb) < 0)
+ return (0);
+ if (sb.st_flags & UF_NODUMP)
+ return (1);
+#elif (defined(FS_IOC_GETFLAGS) && defined(HAVE_WORKING_FS_IOC_GETFLAGS) \
+ && defined(FS_NODUMP_FL)) || \
+ (defined(EXT2_IOC_GETFLAGS) && defined(HAVE_WORKING_EXT2_IOC_GETFLAGS) \
+ && defined(EXT2_NODUMP_FL))
+ const char *path = "cannodumptest";
+ int fd, r, flags;
+
+ assertion_make_file(__FILE__, __LINE__, path, 0644, 0, NULL);
+ fd = open(path, O_RDONLY | O_NONBLOCK);
+ if (fd < 0)
+ return (0);
+ r = ioctl(fd,
+#ifdef FS_IOC_GETFLAGS
+ FS_IOC_GETFLAGS,
+#else
+ EXT2_IOC_GETFLAGS,
+#endif
+ &flags);
+ if (r < 0)
+ return (0);
+#ifdef FS_NODUMP_FL
+ flags |= FS_NODUMP_FL;
+#else
+ flags |= EXT2_NODUMP_FL;
+#endif
+ r = ioctl(fd,
+#ifdef FS_IOC_SETFLAGS
+ FS_IOC_SETFLAGS,
+#else
+ EXT2_IOC_SETFLAGS,
+#endif
+ &flags);
+ if (r < 0)
+ return (0);
+ close(fd);
+ fd = open(path, O_RDONLY | O_NONBLOCK);
+ if (fd < 0)
+ return (0);
+ r = ioctl(fd,
+#ifdef FS_IOC_GETFLAGS
+ FS_IOC_GETFLAGS,
+#else
+ EXT2_IOC_GETFLAGS,
+#endif
+ &flags);
+ if (r < 0)
+ return (0);
+ close(fd);
+#ifdef FS_NODUMP_FL
+ if (flags & FS_NODUMP_FL)
+#else
+ if (flags & EXT2_NODUMP_FL)
+#endif
+ return (1);
+#endif
+ return (0);
+}
+
+/* Get extended attribute value from a path */
+void *
+getXattr(const char *path, const char *name, size_t *sizep)
+{
+ void *value = NULL;
+#if ARCHIVE_XATTR_SUPPORT
+ ssize_t size;
+#if ARCHIVE_XATTR_LINUX
+ size = lgetxattr(path, name, NULL, 0);
+#elif ARCHIVE_XATTR_DARWIN
+ size = getxattr(path, name, NULL, 0, 0, XATTR_NOFOLLOW);
+#elif ARCHIVE_XATTR_AIX
+ size = lgetea(path, name, NULL, 0);
+#elif ARCHIVE_XATTR_FREEBSD
+ size = extattr_get_link(path, EXTATTR_NAMESPACE_USER, name + 5,
+ NULL, 0);
+#endif
+
+ if (size >= 0) {
+ value = malloc(size);
+#if ARCHIVE_XATTR_LINUX
+ size = lgetxattr(path, name, value, size);
+#elif ARCHIVE_XATTR_DARWIN
+ size = getxattr(path, name, value, size, 0, XATTR_NOFOLLOW);
+#elif ARCHIVE_XATTR_AIX
+ size = lgetea(path, name, value, size);
+#elif ARCHIVE_XATTR_FREEBSD
+ size = extattr_get_link(path, EXTATTR_NAMESPACE_USER, name + 5,
+ value, size);
+#endif
+ if (size < 0) {
+ free(value);
+ value = NULL;
+ }
+ }
+ if (size < 0)
+ *sizep = 0;
+ else
+ *sizep = (size_t)size;
+#else /* !ARCHIVE_XATTR_SUPPORT */
+ (void)path; /* UNUSED */
+ (void)name; /* UNUSED */
+ *sizep = 0;
+#endif /* !ARCHIVE_XATTR_SUPPORT */
+ return (value);
+}
+
+/*
+ * Set extended attribute on a path
+ * Returns 0 on error, 1 on success
+ */
+int
+setXattr(const char *path, const char *name, const void *value, size_t size)
+{
+#if ARCHIVE_XATTR_SUPPORT
+#if ARCHIVE_XATTR_LINUX
+ if (lsetxattr(path, name, value, size, 0) == 0)
+#elif ARCHIVE_XATTR_DARWIN
+ if (setxattr(path, name, value, size, 0, XATTR_NOFOLLOW) == 0)
+#elif ARCHIVE_XATTR_AIX
+ if (lsetea(path, name, value, size, 0) == 0)
+#elif ARCHIVE_XATTR_FREEBSD
+ if (extattr_set_link(path, EXTATTR_NAMESPACE_USER, name + 5, value,
+ size) > -1)
+#else
+ if (0)
+#endif
+ return (1);
+#else /* !ARCHIVE_XATTR_SUPPORT */
+ (void)path; /* UNUSED */
+ (void)name; /* UNUSED */
+ (void)value; /* UNUSED */
+ (void)size; /* UNUSED */
+#endif /* !ARCHIVE_XATTR_SUPPORT */
+ return (0);
+}
+
+#if ARCHIVE_ACL_SUNOS
+/* Fetch ACLs on Solaris using acl() or facl() */
+void *
+sunacl_get(int cmd, int *aclcnt, int fd, const char *path)
+{
+ int cnt, cntcmd;
+ size_t size;
+ void *aclp;
+
+ if (cmd == GETACL) {
+ cntcmd = GETACLCNT;
+ size = sizeof(aclent_t);
+ }
+#if ARCHIVE_ACL_SUNOS_NFS4
+ else if (cmd == ACE_GETACL) {
+ cntcmd = ACE_GETACLCNT;
+ size = sizeof(ace_t);
+ }
+#endif
+ else {
+ errno = EINVAL;
+ *aclcnt = -1;
+ return (NULL);
+ }
+
+ aclp = NULL;
+ cnt = -2;
+ while (cnt == -2 || (cnt == -1 && errno == ENOSPC)) {
+ if (path != NULL)
+ cnt = acl(path, cntcmd, 0, NULL);
+ else
+ cnt = facl(fd, cntcmd, 0, NULL);
+
+ if (cnt > 0) {
+ if (aclp == NULL)
+ aclp = malloc(cnt * size);
+ else
+ aclp = realloc(NULL, cnt * size);
+ if (aclp != NULL) {
+ if (path != NULL)
+ cnt = acl(path, cmd, cnt, aclp);
+ else
+ cnt = facl(fd, cmd, cnt, aclp);
+ }
+ } else {
+ if (aclp != NULL) {
+ free(aclp);
+ aclp = NULL;
+ }
+ break;
+ }
+ }
+
+ *aclcnt = cnt;
+ return (aclp);
+}
+#endif /* ARCHIVE_ACL_SUNOS */
+
+/*
+ * Set test ACLs on a path
+ * Return values:
+ * 0: error setting ACLs
+ * ARCHIVE_TEST_ACL_TYPE_POSIX1E: POSIX.1E ACLs have been set
+ * ARCHIVE_TEST_ACL_TYPE_NFS4: NFSv4 or extended ACLs have been set
+ */
+int
+setTestAcl(const char *path)
+{
+#if ARCHIVE_ACL_SUPPORT
+ int r = 1;
+#if ARCHIVE_ACL_LIBACL || ARCHIVE_ACL_FREEBSD || ARCHIVE_ACL_DARWIN
+ acl_t acl;
+#endif
+#if ARCHIVE_ACL_LIBRICHACL
+ struct richacl *richacl;
+#endif
+#if ARCHIVE_ACL_LIBACL || ARCHIVE_ACL_FREEBSD
+ const char *acltext_posix1e = "user:1:rw-,"
+ "group:15:r-x,"
+ "user::rwx,"
+ "group::rwx,"
+ "other::r-x,"
+ "mask::rwx";
+#elif ARCHIVE_ACL_SUNOS /* Solaris POSIX.1e */
+ aclent_t aclp_posix1e[] = {
+ { USER_OBJ, -1, 4 | 2 | 1 },
+ { USER, 1, 4 | 2 },
+ { GROUP_OBJ, -1, 4 | 2 | 1 },
+ { GROUP, 15, 4 | 1 },
+ { CLASS_OBJ, -1, 4 | 2 | 1 },
+ { OTHER_OBJ, -1, 4 | 2 | 1 }
+ };
+#endif
+#if ARCHIVE_ACL_FREEBSD /* FreeBSD NFS4 */
+ const char *acltext_nfs4 = "user:1:rwpaRcs::allow:1,"
+ "group:15:rxaRcs::allow:15,"
+ "owner@:rwpxaARWcCos::allow,"
+ "group@:rwpxaRcs::allow,"
+ "everyone@:rxaRcs::allow";
+#elif ARCHIVE_ACL_LIBRICHACL
+ const char *acltext_nfs4 = "owner:rwpxaARWcCoS::mask,"
+ "group:rwpxaRcS::mask,"
+ "other:rxaRcS::mask,"
+ "user:1:rwpaRcS::allow,"
+ "group:15:rxaRcS::allow,"
+ "owner@:rwpxaARWcCoS::allow,"
+ "group@:rwpxaRcS::allow,"
+ "everyone@:rxaRcS::allow";
+#elif ARCHIVE_ACL_SUNOS_NFS4 /* Solaris NFS4 */
+ ace_t aclp_nfs4[] = {
+ { 1, ACE_READ_DATA | ACE_WRITE_DATA | ACE_APPEND_DATA |
+ ACE_READ_ATTRIBUTES | ACE_READ_NAMED_ATTRS | ACE_READ_ACL |
+ ACE_SYNCHRONIZE, 0, ACE_ACCESS_ALLOWED_ACE_TYPE },
+ { 15, ACE_READ_DATA | ACE_EXECUTE | ACE_READ_ATTRIBUTES |
+ ACE_READ_NAMED_ATTRS | ACE_READ_ACL | ACE_SYNCHRONIZE,
+ ACE_IDENTIFIER_GROUP, ACE_ACCESS_ALLOWED_ACE_TYPE },
+ { -1, ACE_READ_DATA | ACE_WRITE_DATA | ACE_APPEND_DATA |
+ ACE_EXECUTE | ACE_READ_ATTRIBUTES | ACE_WRITE_ATTRIBUTES |
+ ACE_READ_NAMED_ATTRS | ACE_WRITE_NAMED_ATTRS |
+ ACE_READ_ACL | ACE_WRITE_ACL | ACE_WRITE_OWNER | ACE_SYNCHRONIZE,
+ ACE_OWNER, ACE_ACCESS_ALLOWED_ACE_TYPE },
+ { -1, ACE_READ_DATA | ACE_WRITE_DATA | ACE_APPEND_DATA |
+ ACE_EXECUTE | ACE_READ_ATTRIBUTES | ACE_READ_NAMED_ATTRS |
+ ACE_READ_ACL | ACE_SYNCHRONIZE, ACE_GROUP | ACE_IDENTIFIER_GROUP,
+ ACE_ACCESS_ALLOWED_ACE_TYPE },
+ { -1, ACE_READ_DATA | ACE_EXECUTE | ACE_READ_ATTRIBUTES |
+ ACE_READ_NAMED_ATTRS | ACE_READ_ACL | ACE_SYNCHRONIZE,
+ ACE_EVERYONE, ACE_ACCESS_ALLOWED_ACE_TYPE }
+ };
+#elif ARCHIVE_ACL_DARWIN /* Mac OS X */
+ acl_entry_t aclent;
+ acl_permset_t permset;
+ const uid_t uid = 1;
+ uuid_t uuid;
+ int i;
+ const acl_perm_t acl_perms[] = {
+ ACL_READ_DATA,
+ ACL_WRITE_DATA,
+ ACL_APPEND_DATA,
+ ACL_EXECUTE,
+ ACL_READ_ATTRIBUTES,
+ ACL_READ_EXTATTRIBUTES,
+ ACL_READ_SECURITY,
+#if HAVE_DECL_ACL_SYNCHRONIZE
+ ACL_SYNCHRONIZE
+#endif
+ };
+#endif /* ARCHIVE_ACL_DARWIN */
+
+#if ARCHIVE_ACL_FREEBSD
+ acl = acl_from_text(acltext_nfs4);
+ failure("acl_from_text() error: %s", strerror(errno));
+ if (assert(acl != NULL) == 0)
+ return (0);
+#elif ARCHIVE_ACL_LIBRICHACL
+ richacl = richacl_from_text(acltext_nfs4, NULL, NULL);
+ failure("richacl_from_text() error: %s", strerror(errno));
+ if (assert(richacl != NULL) == 0)
+ return (0);
+#elif ARCHIVE_ACL_DARWIN
+ acl = acl_init(1);
+ failure("acl_init() error: %s", strerror(errno));
+ if (assert(acl != NULL) == 0)
+ return (0);
+ r = acl_create_entry(&acl, &aclent);
+ failure("acl_create_entry() error: %s", strerror(errno));
+ if (assertEqualInt(r, 0) == 0)
+ goto testacl_free;
+ r = acl_set_tag_type(aclent, ACL_EXTENDED_ALLOW);
+ failure("acl_set_tag_type() error: %s", strerror(errno));
+ if (assertEqualInt(r, 0) == 0)
+ goto testacl_free;
+ r = acl_get_permset(aclent, &permset);
+ failure("acl_get_permset() error: %s", strerror(errno));
+ if (assertEqualInt(r, 0) == 0)
+ goto testacl_free;
+ for (i = 0; i < (int)(sizeof(acl_perms) / sizeof(acl_perms[0])); i++) {
+ r = acl_add_perm(permset, acl_perms[i]);
+ failure("acl_add_perm() error: %s", strerror(errno));
+ if (assertEqualInt(r, 0) == 0)
+ goto testacl_free;
+ }
+ r = acl_set_permset(aclent, permset);
+ failure("acl_set_permset() error: %s", strerror(errno));
+ if (assertEqualInt(r, 0) == 0)
+ goto testacl_free;
+ r = mbr_uid_to_uuid(uid, uuid);
+ failure("mbr_uid_to_uuid() error: %s", strerror(errno));
+ if (assertEqualInt(r, 0) == 0)
+ goto testacl_free;
+ r = acl_set_qualifier(aclent, uuid);
+ failure("acl_set_qualifier() error: %s", strerror(errno));
+ if (assertEqualInt(r, 0) == 0)
+ goto testacl_free;
+#endif /* ARCHIVE_ACL_DARWIN */
+
+#if ARCHIVE_ACL_NFS4
+#if ARCHIVE_ACL_FREEBSD
+ r = acl_set_file(path, ACL_TYPE_NFS4, acl);
+ acl_free(acl);
+#elif ARCHIVE_ACL_LIBRICHACL
+ r = richacl_set_file(path, richacl);
+ richacl_free(richacl);
+#elif ARCHIVE_ACL_SUNOS_NFS4
+ r = acl(path, ACE_SETACL,
+ (int)(sizeof(aclp_nfs4)/sizeof(aclp_nfs4[0])), aclp_nfs4);
+#elif ARCHIVE_ACL_DARWIN
+ r = acl_set_file(path, ACL_TYPE_EXTENDED, acl);
+ acl_free(acl);
+#endif
+ if (r == 0)
+ return (ARCHIVE_TEST_ACL_TYPE_NFS4);
+#endif /* ARCHIVE_ACL_NFS4 */
+
+#if ARCHIVE_ACL_POSIX1E
+#if ARCHIVE_ACL_FREEBSD || ARCHIVE_ACL_LIBACL
+ acl = acl_from_text(acltext_posix1e);
+ failure("acl_from_text() error: %s", strerror(errno));
+ if (assert(acl != NULL) == 0)
+ return (0);
+
+ r = acl_set_file(path, ACL_TYPE_ACCESS, acl);
+ acl_free(acl);
+#elif ARCHIVE_ACL_SUNOS
+ r = acl(path, SETACL,
+ (int)(sizeof(aclp_posix1e)/sizeof(aclp_posix1e[0])), aclp_posix1e);
+#endif
+ if (r == 0)
+ return (ARCHIVE_TEST_ACL_TYPE_POSIX1E);
+ else
+ return (0);
+#endif /* ARCHIVE_ACL_POSIX1E */
+#if ARCHIVE_ACL_DARWIN
+testacl_free:
+ acl_free(acl);
+#endif
+#endif /* ARCHIVE_ACL_SUPPORT */
+ (void)path; /* UNUSED */
+ return (0);
+}
+
+/*
+ * Sleep as needed; useful for verifying disk timestamp changes by
+ * ensuring that the wall-clock time has actually changed before we
+ * go back to re-read something from disk.
+ */
+void
+sleepUntilAfter(time_t t)
+{
+ while (t >= time(NULL))
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ Sleep(500);
+#else
+ sleep(1);
+#endif
+}
+
+/*
+ * Call standard system() call, but build up the command line using
+ * sprintf() conventions.
+ */
+int
+systemf(const char *fmt, ...)
+{
+ char buff[8192];
+ va_list ap;
+ int r;
+
+ va_start(ap, fmt);
+ vsprintf(buff, fmt, ap);
+ if (verbosity > VERBOSITY_FULL)
+ logprintf("Cmd: %s\n", buff);
+ r = system(buff);
+ va_end(ap);
+ return (r);
+}
+
+/*
+ * Slurp a file into memory for ease of comparison and testing.
+ * Returns size of file in 'sizep' if non-NULL, null-terminates
+ * data in memory for ease of use.
+ */
+char *
+slurpfile(size_t * sizep, const char *fmt, ...)
+{
+ char filename[8192];
+ struct stat st;
+ va_list ap;
+ char *p;
+ ssize_t bytes_read;
+ FILE *f;
+ int r;
+
+ va_start(ap, fmt);
+ vsprintf(filename, fmt, ap);
+ va_end(ap);
+
+ f = fopen(filename, "rb");
+ if (f == NULL) {
+ /* Note: No error; non-existent file is okay here. */
+ return (NULL);
+ }
+ r = fstat(fileno(f), &st);
+ if (r != 0) {
+ logprintf("Can't stat file %s\n", filename);
+ fclose(f);
+ return (NULL);
+ }
+ p = malloc((size_t)st.st_size + 1);
+ if (p == NULL) {
+ logprintf("Can't allocate %ld bytes of memory to read file %s\n",
+ (long int)st.st_size, filename);
+ fclose(f);
+ return (NULL);
+ }
+ bytes_read = fread(p, 1, (size_t)st.st_size, f);
+ if (bytes_read < st.st_size) {
+ logprintf("Can't read file %s\n", filename);
+ fclose(f);
+ free(p);
+ return (NULL);
+ }
+ p[st.st_size] = '\0';
+ if (sizep != NULL)
+ *sizep = (size_t)st.st_size;
+ fclose(f);
+ return (p);
+}
+
+/*
+ * Slurp a file into memory for ease of comparison and testing.
+ * Returns size of file in 'sizep' if non-NULL, null-terminates
+ * data in memory for ease of use.
+ */
+void
+dumpfile(const char *filename, void *data, size_t len)
+{
+ ssize_t bytes_written;
+ FILE *f;
+
+ f = fopen(filename, "wb");
+ if (f == NULL) {
+ logprintf("Can't open file %s for writing\n", filename);
+ return;
+ }
+ bytes_written = fwrite(data, 1, len, f);
+ if (bytes_written < (ssize_t)len)
+ logprintf("Can't write file %s\n", filename);
+ fclose(f);
+}
+
+/* Read a uuencoded file from the reference directory, decode, and
+ * write the result into the current directory. */
+#define VALID_UUDECODE(c) (c >= 32 && c <= 96)
+#define UUDECODE(c) (((c) - 0x20) & 0x3f)
+void
+extract_reference_file(const char *name)
+{
+ char buff[1024];
+ FILE *in, *out;
+
+ sprintf(buff, "%s/%s.uu", refdir, name);
+ in = fopen(buff, "r");
+ failure("Couldn't open reference file %s", buff);
+ assert(in != NULL);
+ if (in == NULL)
+ return;
+ /* Read up to and including the 'begin' line. */
+ for (;;) {
+ if (fgets(buff, sizeof(buff), in) == NULL) {
+ /* TODO: This is a failure. */
+ return;
+ }
+ if (memcmp(buff, "begin ", 6) == 0)
+ break;
+ }
+ /* Now, decode the rest and write it. */
+ out = fopen(name, "wb");
+ while (fgets(buff, sizeof(buff), in) != NULL) {
+ char *p = buff;
+ int bytes;
+
+ if (memcmp(buff, "end", 3) == 0)
+ break;
+
+ bytes = UUDECODE(*p++);
+ while (bytes > 0) {
+ int n = 0;
+ /* Write out 1-3 bytes from that. */
+ if (bytes > 0) {
+ assert(VALID_UUDECODE(p[0]));
+ assert(VALID_UUDECODE(p[1]));
+ n = UUDECODE(*p++) << 18;
+ n |= UUDECODE(*p++) << 12;
+ fputc(n >> 16, out);
+ --bytes;
+ }
+ if (bytes > 0) {
+ assert(VALID_UUDECODE(p[0]));
+ n |= UUDECODE(*p++) << 6;
+ fputc((n >> 8) & 0xFF, out);
+ --bytes;
+ }
+ if (bytes > 0) {
+ assert(VALID_UUDECODE(p[0]));
+ n |= UUDECODE(*p++);
+ fputc(n & 0xFF, out);
+ --bytes;
+ }
+ }
+ }
+ fclose(out);
+ fclose(in);
+}
+
+void
+copy_reference_file(const char *name)
+{
+ char buff[1024];
+ FILE *in, *out;
+ size_t rbytes;
+
+ sprintf(buff, "%s/%s", refdir, name);
+ in = fopen(buff, "rb");
+ failure("Couldn't open reference file %s", buff);
+ assert(in != NULL);
+ if (in == NULL)
+ return;
+ /* Now, decode the rest and write it. */
+ /* Not a lot of error checking here; the input better be right. */
+ out = fopen(name, "wb");
+ while ((rbytes = fread(buff, 1, sizeof(buff), in)) > 0) {
+ if (fwrite(buff, 1, rbytes, out) != rbytes) {
+ logprintf("Error: fwrite\n");
+ break;
+ }
+ }
+ fclose(out);
+ fclose(in);
+}
+
+int
+is_LargeInode(const char *file)
+{
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ BY_HANDLE_FILE_INFORMATION bhfi;
+ int r;
+
+ r = my_GetFileInformationByName(file, &bhfi);
+ if (r != 0)
+ return (0);
+ return (bhfi.nFileIndexHigh & 0x0000FFFFUL);
+#else
+ struct stat st;
+ int64_t ino;
+
+ if (stat(file, &st) < 0)
+ return (0);
+ ino = (int64_t)st.st_ino;
+ return (ino > 0xffffffff);
+#endif
+}
+
+void
+extract_reference_files(const char **names)
+{
+ while (names && *names)
+ extract_reference_file(*names++);
+}
+
+#ifndef PROGRAM
+/* Set ACLs */
+int
+assertion_entry_set_acls(const char *file, int line, struct archive_entry *ae,
+ struct archive_test_acl_t *acls, int n)
+{
+ int i, r, ret;
+
+ assertion_count(file, line);
+
+ ret = 0;
+ archive_entry_acl_clear(ae);
+ for (i = 0; i < n; i++) {
+ r = archive_entry_acl_add_entry(ae,
+ acls[i].type, acls[i].permset, acls[i].tag,
+ acls[i].qual, acls[i].name);
+ if (r != 0) {
+ ret = 1;
+ failure_start(file, line, "type=%#010x, ",
+ "permset=%#010x, tag=%d, qual=%d name=%s",
+ acls[i].type, acls[i].permset, acls[i].tag,
+ acls[i].qual, acls[i].name);
+ failure_finish(NULL);
+ }
+ }
+
+ return (ret);
+}
+
+static int
+archive_test_acl_match(struct archive_test_acl_t *acl, int type, int permset,
+ int tag, int qual, const char *name)
+{
+ if (type != acl->type)
+ return (0);
+ if (permset != acl->permset)
+ return (0);
+ if (tag != acl->tag)
+ return (0);
+ if (tag == ARCHIVE_ENTRY_ACL_USER_OBJ)
+ return (1);
+ if (tag == ARCHIVE_ENTRY_ACL_GROUP_OBJ)
+ return (1);
+ if (tag == ARCHIVE_ENTRY_ACL_EVERYONE)
+ return (1);
+ if (tag == ARCHIVE_ENTRY_ACL_OTHER)
+ return (1);
+ if (qual != acl->qual)
+ return (0);
+ if (name == NULL) {
+ if (acl->name == NULL || acl->name[0] == '\0')
+ return (1);
+ return (0);
+ }
+ if (acl->name == NULL) {
+ if (name[0] == '\0')
+ return (1);
+ return (0);
+ }
+ return (0 == strcmp(name, acl->name));
+}
+
+/* Compare ACLs */
+int
+assertion_entry_compare_acls(const char *file, int line,
+ struct archive_entry *ae, struct archive_test_acl_t *acls, int cnt,
+ int want_type, int mode)
+{
+ int *marker;
+ int i, r, n, ret;
+ int type, permset, tag, qual;
+ int matched;
+ const char *name;
+
+ assertion_count(file, line);
+
+ ret = 0;
+ n = 0;
+ marker = malloc(sizeof(marker[0]) * cnt);
+
+ for (i = 0; i < cnt; i++) {
+ if ((acls[i].type & want_type) != 0) {
+ marker[n] = i;
+ n++;
+ }
+ }
+
+ if (n == 0) {
+ failure_start(file, line, "No ACL's to compare, type mask: %d",
+ want_type);
+ return (1);
+ }
+
+ while (0 == (r = archive_entry_acl_next(ae, want_type,
+ &type, &permset, &tag, &qual, &name))) {
+ for (i = 0, matched = 0; i < n && !matched; i++) {
+ if (archive_test_acl_match(&acls[marker[i]], type,
+ permset, tag, qual, name)) {
+ /* We found a match; remove it. */
+ marker[i] = marker[n - 1];
+ n--;
+ matched = 1;
+ }
+ }
+ if (type == ARCHIVE_ENTRY_ACL_TYPE_ACCESS
+ && tag == ARCHIVE_ENTRY_ACL_USER_OBJ) {
+ if (!matched) {
+ failure_start(file, line, "No match for "
+ "user_obj perm");
+ failure_finish(NULL);
+ ret = 1;
+ }
+ if ((permset << 6) != (mode & 0700)) {
+ failure_start(file, line, "USER_OBJ permset "
+ "(%02o) != user mode (%02o)", permset,
+ 07 & (mode >> 6));
+ failure_finish(NULL);
+ ret = 1;
+ }
+ } else if (type == ARCHIVE_ENTRY_ACL_TYPE_ACCESS
+ && tag == ARCHIVE_ENTRY_ACL_GROUP_OBJ) {
+ if (!matched) {
+ failure_start(file, line, "No match for "
+ "group_obj perm");
+ failure_finish(NULL);
+ ret = 1;
+ }
+ if ((permset << 3) != (mode & 0070)) {
+ failure_start(file, line, "GROUP_OBJ permset "
+ "(%02o) != group mode (%02o)", permset,
+ 07 & (mode >> 3));
+ failure_finish(NULL);
+ ret = 1;
+ }
+ } else if (type == ARCHIVE_ENTRY_ACL_TYPE_ACCESS
+ && tag == ARCHIVE_ENTRY_ACL_OTHER) {
+ if (!matched) {
+ failure_start(file, line, "No match for "
+ "other perm");
+ failure_finish(NULL);
+ ret = 1;
+ }
+ if ((permset << 0) != (mode & 0007)) {
+ failure_start(file, line, "OTHER permset "
+ "(%02o) != other mode (%02o)", permset,
+ mode & 07);
+ failure_finish(NULL);
+ ret = 1;
+ }
+ } else if (matched != 1) {
+ failure_start(file, line, "Could not find match for "
+ "ACL (type=%#010x,permset=%#010x,tag=%d,qual=%d,"
+ "name=``%s'')", type, permset, tag, qual, name);
+ failure_finish(NULL);
+ ret = 1;
+ }
+ }
+ if (r != ARCHIVE_EOF) {
+ failure_start(file, line, "Should not exit before EOF");
+ failure_finish(NULL);
+ ret = 1;
+ }
+ if ((want_type & ARCHIVE_ENTRY_ACL_TYPE_ACCESS) != 0 &&
+ (mode_t)(mode & 0777) != (archive_entry_mode(ae) & 0777)) {
+ failure_start(file, line, "Mode (%02o) and entry mode (%02o) "
+ "mismatch", mode, archive_entry_mode(ae));
+ failure_finish(NULL);
+ ret = 1;
+ }
+ if (n != 0) {
+ failure_start(file, line, "Could not find match for ACL "
+ "(type=%#010x,permset=%#010x,tag=%d,qual=%d,name=``%s'')",
+ acls[marker[0]].type, acls[marker[0]].permset,
+ acls[marker[0]].tag, acls[marker[0]].qual,
+ acls[marker[0]].name);
+ failure_finish(NULL);
+ ret = 1;
+ /* Number of ACLs not matched should == 0 */
+ }
+ free(marker);
+ return (ret);
+}
+#endif /* !defined(PROGRAM) */
+
+/*
+ *
+ * TEST management
+ *
+ */
+
+/*
+ * "list.h" is simply created by "grep DEFINE_TEST test_*.c"; it has
+ * a line like
+ * DEFINE_TEST(test_function)
+ * for each test.
+ */
+
+/* Use "list.h" to declare all of the test functions. */
+#undef DEFINE_TEST
+#define DEFINE_TEST(name) void name(void);
+#include "list.h"
+
+/* Use "list.h" to create a list of all tests (functions and names). */
+#undef DEFINE_TEST
+#define DEFINE_TEST(n) { n, #n, 0 },
+struct test_list_t tests[] = {
+ #include "list.h"
+};
+
+/*
+ * Summarize repeated failures in the just-completed test.
+ */
+static void
+test_summarize(int failed, int skips_num)
+{
+ unsigned int i;
+
+ switch (verbosity) {
+ case VERBOSITY_SUMMARY_ONLY:
+ printf(failed ? "E" : ".");
+ fflush(stdout);
+ break;
+ case VERBOSITY_PASSFAIL:
+ printf(failed ? "FAIL\n" : skips_num ? "ok (S)\n" : "ok\n");
+ break;
+ }
+
+ log_console = (verbosity == VERBOSITY_LIGHT_REPORT);
+
+ for (i = 0; i < sizeof(failed_lines)/sizeof(failed_lines[0]); i++) {
+ if (failed_lines[i].count > 1 && !failed_lines[i].skip)
+ logprintf("%s:%d: Summary: Failed %d times\n",
+ failed_filename, i, failed_lines[i].count);
+ }
+ /* Clear the failure history for the next file. */
+ failed_filename = NULL;
+ memset(failed_lines, 0, sizeof(failed_lines));
+}
+
+/*
+ * Actually run a single test, with appropriate setup and cleanup.
+ */
+static int
+test_run(int i, const char *tmpdir)
+{
+ char workdir[1024];
+ char logfilename[64];
+ int failures_before = failures;
+ int skips_before = skips;
+ int oldumask;
+
+ switch (verbosity) {
+ case VERBOSITY_SUMMARY_ONLY: /* No per-test reports at all */
+ break;
+ case VERBOSITY_PASSFAIL: /* rest of line will include ok/FAIL marker */
+ printf("%3d: %-64s", i, tests[i].name);
+ fflush(stdout);
+ break;
+ default: /* Title of test, details will follow */
+ printf("%3d: %s\n", i, tests[i].name);
+ }
+
+ /* Chdir to the top-level work directory. */
+ if (!assertChdir(tmpdir)) {
+ fprintf(stderr,
+ "ERROR: Can't chdir to top work dir %s\n", tmpdir);
+ exit(1);
+ }
+ /* Create a log file for this test. */
+ sprintf(logfilename, "%s.log", tests[i].name);
+ logfile = fopen(logfilename, "w");
+ fprintf(logfile, "%s\n\n", tests[i].name);
+ /* Chdir() to a work dir for this specific test. */
+ snprintf(workdir, sizeof(workdir), "%s/%s", tmpdir, tests[i].name);
+ testworkdir = workdir;
+ if (!assertMakeDir(testworkdir, 0755)
+ || !assertChdir(testworkdir)) {
+ fprintf(stderr,
+ "ERROR: Can't chdir to work dir %s\n", testworkdir);
+ exit(1);
+ }
+ /* Explicitly reset the locale before each test. */
+ setlocale(LC_ALL, "C");
+ /* Record the umask before we run the test. */
+ umask(oldumask = umask(0));
+ /*
+ * Run the actual test.
+ */
+ (*tests[i].func)();
+ /*
+ * Clean up and report afterwards.
+ */
+ testworkdir = NULL;
+ /* Restore umask */
+ umask(oldumask);
+ /* Reset locale. */
+ setlocale(LC_ALL, "C");
+ /* Reset directory. */
+ if (!assertChdir(tmpdir)) {
+ fprintf(stderr, "ERROR: Couldn't chdir to temp dir %s\n",
+ tmpdir);
+ exit(1);
+ }
+ /* Report per-test summaries. */
+ tests[i].failures = failures - failures_before;
+ test_summarize(tests[i].failures, skips - skips_before);
+ /* Close the per-test log file. */
+ fclose(logfile);
+ logfile = NULL;
+ /* If there were no failures, we can remove the work dir and logfile. */
+ if (tests[i].failures == 0) {
+ if (!keep_temp_files && assertChdir(tmpdir)) {
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ /* Make sure not to leave empty directories.
+ * Sometimes a processing of closing files used by tests
+ * is not done, then rmdir will be failed and it will
+ * leave a empty test directory. So we should wait a few
+ * seconds and retry rmdir. */
+ int r, t;
+ for (t = 0; t < 10; t++) {
+ if (t > 0)
+ Sleep(1000);
+ r = systemf("rmdir /S /Q %s", tests[i].name);
+ if (r == 0)
+ break;
+ }
+ systemf("del %s", logfilename);
+#else
+ systemf("rm -rf %s", tests[i].name);
+ systemf("rm %s", logfilename);
+#endif
+ }
+ }
+ /* Return appropriate status. */
+ return (tests[i].failures);
+}
+
+/*
+ *
+ *
+ * MAIN and support routines.
+ *
+ *
+ */
+
+static void
+usage(const char *program)
+{
+ static const int limit = sizeof(tests) / sizeof(tests[0]);
+ int i;
+
+ printf("Usage: %s [options] <test> <test> ...\n", program);
+ printf("Default is to run all tests.\n");
+ printf("Otherwise, specify the numbers of the tests you wish to run.\n");
+ printf("Options:\n");
+ printf(" -d Dump core after any failure, for debugging.\n");
+ printf(" -k Keep all temp files.\n");
+ printf(" Default: temp files for successful tests deleted.\n");
+#ifdef PROGRAM
+ printf(" -p <path> Path to executable to be tested.\n");
+ printf(" Default: path taken from " ENVBASE " environment variable.\n");
+#endif
+ printf(" -q Quiet.\n");
+ printf(" -r <dir> Path to dir containing reference files.\n");
+ printf(" Default: Current directory.\n");
+ printf(" -u Keep running specifies tests until one fails.\n");
+ printf(" -v Verbose.\n");
+ printf("Available tests:\n");
+ for (i = 0; i < limit; i++)
+ printf(" %d: %s\n", i, tests[i].name);
+ exit(1);
+}
+
+static char *
+get_refdir(const char *d)
+{
+ size_t tried_size, buff_size;
+ char *buff, *tried, *pwd = NULL, *p = NULL;
+
+#ifdef PATH_MAX
+ buff_size = PATH_MAX;
+#else
+ buff_size = 8192;
+#endif
+ buff = calloc(buff_size, 1);
+ if (buff == NULL) {
+ fprintf(stderr, "Unable to allocate memory\n");
+ exit(1);
+ }
+
+ /* Allocate a buffer to hold the various directories we checked. */
+ tried_size = buff_size * 2;
+ tried = calloc(tried_size, 1);
+ if (tried == NULL) {
+ fprintf(stderr, "Unable to allocate memory\n");
+ exit(1);
+ }
+
+ /* If a dir was specified, try that */
+ if (d != NULL) {
+ pwd = NULL;
+ snprintf(buff, buff_size, "%s", d);
+ p = slurpfile(NULL, "%s/%s", buff, KNOWNREF);
+ if (p != NULL) goto success;
+ strncat(tried, buff, tried_size - strlen(tried) - 1);
+ strncat(tried, "\n", tried_size - strlen(tried) - 1);
+ goto failure;
+ }
+
+ /* Get the current dir. */
+#ifdef PATH_MAX
+ pwd = getcwd(NULL, PATH_MAX);/* Solaris getcwd needs the size. */
+#else
+ pwd = getcwd(NULL, 0);
+#endif
+ while (pwd[strlen(pwd) - 1] == '\n')
+ pwd[strlen(pwd) - 1] = '\0';
+
+ /* Look for a known file. */
+ snprintf(buff, buff_size, "%s", pwd);
+ p = slurpfile(NULL, "%s/%s", buff, KNOWNREF);
+ if (p != NULL) goto success;
+ strncat(tried, buff, tried_size - strlen(tried) - 1);
+ strncat(tried, "\n", tried_size - strlen(tried) - 1);
+
+ snprintf(buff, buff_size, "%s/test", pwd);
+ p = slurpfile(NULL, "%s/%s", buff, KNOWNREF);
+ if (p != NULL) goto success;
+ strncat(tried, buff, tried_size - strlen(tried) - 1);
+ strncat(tried, "\n", tried_size - strlen(tried) - 1);
+
+#if defined(LIBRARY)
+ snprintf(buff, buff_size, "%s/%s/test", pwd, LIBRARY);
+#else
+ snprintf(buff, buff_size, "%s/%s/test", pwd, PROGRAM);
+#endif
+ p = slurpfile(NULL, "%s/%s", buff, KNOWNREF);
+ if (p != NULL) goto success;
+ strncat(tried, buff, tried_size - strlen(tried) - 1);
+ strncat(tried, "\n", tried_size - strlen(tried) - 1);
+
+#if defined(PROGRAM_ALIAS)
+ snprintf(buff, buff_size, "%s/%s/test", pwd, PROGRAM_ALIAS);
+ p = slurpfile(NULL, "%s/%s", buff, KNOWNREF);
+ if (p != NULL) goto success;
+ strncat(tried, buff, tried_size - strlen(tried) - 1);
+ strncat(tried, "\n", tried_size - strlen(tried) - 1);
+#endif
+
+ if (memcmp(pwd, "/usr/obj", 8) == 0) {
+ snprintf(buff, buff_size, "%s", pwd + 8);
+ p = slurpfile(NULL, "%s/%s", buff, KNOWNREF);
+ if (p != NULL) goto success;
+ strncat(tried, buff, tried_size - strlen(tried) - 1);
+ strncat(tried, "\n", tried_size - strlen(tried) - 1);
+
+ snprintf(buff, buff_size, "%s/test", pwd + 8);
+ p = slurpfile(NULL, "%s/%s", buff, KNOWNREF);
+ if (p != NULL) goto success;
+ strncat(tried, buff, tried_size - strlen(tried) - 1);
+ strncat(tried, "\n", tried_size - strlen(tried) - 1);
+ }
+
+failure:
+ printf("Unable to locate known reference file %s\n", KNOWNREF);
+ printf(" Checked following directories:\n%s\n", tried);
+ printf("Use -r option to specify full path to reference directory\n");
+#if defined(_WIN32) && !defined(__CYGWIN__) && defined(_DEBUG)
+ DebugBreak();
+#endif
+ exit(1);
+
+success:
+ free(p);
+ free(pwd);
+ free(tried);
+
+ /* Copy result into a fresh buffer to reduce memory usage. */
+ p = strdup(buff);
+ free(buff);
+ return p;
+}
+
+int
+main(int argc, char **argv)
+{
+ static const int limit = sizeof(tests) / sizeof(tests[0]);
+ int test_set[sizeof(tests) / sizeof(tests[0])];
+ int i = 0, j = 0, tests_run = 0, tests_failed = 0, option;
+ time_t now;
+ char *refdir_alloc = NULL;
+ const char *progname;
+ char **saved_argv;
+ const char *tmp, *option_arg, *p;
+ char tmpdir[256], *pwd, *testprogdir, *tmp2 = NULL, *vlevel = NULL;
+ char tmpdir_timestamp[256];
+
+ (void)argc; /* UNUSED */
+
+ /* Get the current dir. */
+#ifdef PATH_MAX
+ pwd = getcwd(NULL, PATH_MAX);/* Solaris getcwd needs the size. */
+#else
+ pwd = getcwd(NULL, 0);
+#endif
+ while (pwd[strlen(pwd) - 1] == '\n')
+ pwd[strlen(pwd) - 1] = '\0';
+
+#if defined(HAVE__CrtSetReportMode) && !defined(__WATCOMC__)
+ /* To stop to run the default invalid parameter handler. */
+ _set_invalid_parameter_handler(invalid_parameter_handler);
+ /* Disable annoying assertion message box. */
+ _CrtSetReportMode(_CRT_ASSERT, 0);
+#endif
+
+ /*
+ * Name of this program, used to build root of our temp directory
+ * tree.
+ */
+ progname = p = argv[0];
+ if ((testprogdir = (char *)malloc(strlen(progname) + 1)) == NULL)
+ {
+ fprintf(stderr, "ERROR: Out of memory.");
+ exit(1);
+ }
+ strcpy(testprogdir, progname);
+ while (*p != '\0') {
+ /* Support \ or / dir separators for Windows compat. */
+ if (*p == '/' || *p == '\\')
+ {
+ progname = p + 1;
+ i = j;
+ }
+ ++p;
+ j++;
+ }
+ testprogdir[i] = '\0';
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ if (testprogdir[0] != '/' && testprogdir[0] != '\\' &&
+ !(((testprogdir[0] >= 'a' && testprogdir[0] <= 'z') ||
+ (testprogdir[0] >= 'A' && testprogdir[0] <= 'Z')) &&
+ testprogdir[1] == ':' &&
+ (testprogdir[2] == '/' || testprogdir[2] == '\\')))
+#else
+ if (testprogdir[0] != '/')
+#endif
+ {
+ /* Fixup path for relative directories. */
+ if ((testprogdir = (char *)realloc(testprogdir,
+ strlen(pwd) + 1 + strlen(testprogdir) + 1)) == NULL)
+ {
+ fprintf(stderr, "ERROR: Out of memory.");
+ exit(1);
+ }
+ memmove(testprogdir + strlen(pwd) + 1, testprogdir,
+ strlen(testprogdir) + 1);
+ memcpy(testprogdir, pwd, strlen(pwd));
+ testprogdir[strlen(pwd)] = '/';
+ }
+
+#ifdef PROGRAM
+ /* Get the target program from environment, if available. */
+ testprogfile = getenv(ENVBASE);
+#endif
+
+ if (getenv("TMPDIR") != NULL)
+ tmp = getenv("TMPDIR");
+ else if (getenv("TMP") != NULL)
+ tmp = getenv("TMP");
+ else if (getenv("TEMP") != NULL)
+ tmp = getenv("TEMP");
+ else if (getenv("TEMPDIR") != NULL)
+ tmp = getenv("TEMPDIR");
+ else
+ tmp = "/tmp";
+
+ /* Allow -d to be controlled through the environment. */
+ if (getenv(ENVBASE "_DEBUG") != NULL)
+ dump_on_failure = 1;
+
+ /* Allow -v to be controlled through the environment. */
+ if (getenv("_VERBOSITY_LEVEL") != NULL)
+ {
+ vlevel = getenv("_VERBOSITY_LEVEL");
+ verbosity = atoi(vlevel);
+ if (verbosity < VERBOSITY_SUMMARY_ONLY || verbosity > VERBOSITY_FULL)
+ {
+ /* Unsupported verbosity levels are silently ignored */
+ vlevel = NULL;
+ verbosity = VERBOSITY_PASSFAIL;
+ }
+ }
+
+ /* Get the directory holding test files from environment. */
+ refdir = getenv(ENVBASE "_TEST_FILES");
+
+ /*
+ * Parse options, without using getopt(), which isn't available
+ * on all platforms.
+ */
+ ++argv; /* Skip program name */
+ while (*argv != NULL) {
+ if (**argv != '-')
+ break;
+ p = *argv++;
+ ++p; /* Skip '-' */
+ while (*p != '\0') {
+ option = *p++;
+ option_arg = NULL;
+ /* If 'opt' takes an argument, parse that. */
+ if (option == 'p' || option == 'r') {
+ if (*p != '\0')
+ option_arg = p;
+ else if (*argv == NULL) {
+ fprintf(stderr,
+ "Option -%c requires argument.\n",
+ option);
+ usage(progname);
+ } else
+ option_arg = *argv++;
+ p = ""; /* End of this option word. */
+ }
+
+ /* Now, handle the option. */
+ switch (option) {
+ case 'd':
+ dump_on_failure = 1;
+ break;
+ case 'k':
+ keep_temp_files = 1;
+ break;
+ case 'p':
+#ifdef PROGRAM
+ testprogfile = option_arg;
+#else
+ fprintf(stderr, "-p option not permitted\n");
+ usage(progname);
+#endif
+ break;
+ case 'q':
+ if (!vlevel)
+ verbosity--;
+ break;
+ case 'r':
+ refdir = option_arg;
+ break;
+ case 'u':
+ until_failure++;
+ break;
+ case 'v':
+ if (!vlevel)
+ verbosity++;
+ break;
+ default:
+ fprintf(stderr, "Unrecognized option '%c'\n",
+ option);
+ usage(progname);
+ }
+ }
+ }
+
+ /*
+ * Sanity-check that our options make sense.
+ */
+#ifdef PROGRAM
+ if (testprogfile == NULL)
+ {
+ if ((tmp2 = (char *)malloc(strlen(testprogdir) + 1 +
+ strlen(PROGRAM) + 1)) == NULL)
+ {
+ fprintf(stderr, "ERROR: Out of memory.");
+ exit(1);
+ }
+ strcpy(tmp2, testprogdir);
+ strcat(tmp2, "/");
+ strcat(tmp2, PROGRAM);
+ testprogfile = tmp2;
+ }
+
+ {
+ char *testprg;
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ /* Command.com sometimes rejects '/' separators. */
+ testprg = strdup(testprogfile);
+ for (i = 0; testprg[i] != '\0'; i++) {
+ if (testprg[i] == '/')
+ testprg[i] = '\\';
+ }
+ testprogfile = testprg;
+#endif
+ /* Quote the name that gets put into shell command lines. */
+ testprg = malloc(strlen(testprogfile) + 3);
+ strcpy(testprg, "\"");
+ strcat(testprg, testprogfile);
+ strcat(testprg, "\"");
+ testprog = testprg;
+ }
+#endif
+
+#if !defined(_WIN32) && defined(SIGPIPE)
+ { /* Ignore SIGPIPE signals */
+ struct sigaction sa;
+ sa.sa_handler = SIG_IGN;
+ sigemptyset(&sa.sa_mask);
+ sa.sa_flags = 0;
+ sigaction(SIGPIPE, &sa, NULL);
+ }
+#endif
+
+ /*
+ * Create a temp directory for the following tests.
+ * Include the time the tests started as part of the name,
+ * to make it easier to track the results of multiple tests.
+ */
+ now = time(NULL);
+ for (i = 0; ; i++) {
+ strftime(tmpdir_timestamp, sizeof(tmpdir_timestamp),
+ "%Y-%m-%dT%H.%M.%S",
+ localtime(&now));
+ sprintf(tmpdir, "%s/%s.%s-%03d", tmp, progname,
+ tmpdir_timestamp, i);
+ if (assertMakeDir(tmpdir,0755))
+ break;
+ if (i >= 999) {
+ fprintf(stderr,
+ "ERROR: Unable to create temp directory %s\n",
+ tmpdir);
+ exit(1);
+ }
+ }
+
+ /*
+ * If the user didn't specify a directory for locating
+ * reference files, try to find the reference files in
+ * the "usual places."
+ */
+ refdir = refdir_alloc = get_refdir(refdir);
+
+ /*
+ * Banner with basic information.
+ */
+ printf("\n");
+ printf("If tests fail or crash, details will be in:\n");
+ printf(" %s\n", tmpdir);
+ printf("\n");
+ if (verbosity > VERBOSITY_SUMMARY_ONLY) {
+ printf("Reference files will be read from: %s\n", refdir);
+#ifdef PROGRAM
+ printf("Running tests on: %s\n", testprog);
+#endif
+ printf("Exercising: ");
+ fflush(stdout);
+ printf("%s\n", EXTRA_VERSION);
+ } else {
+ printf("Running ");
+ fflush(stdout);
+ }
+
+ /*
+ * Run some or all of the individual tests.
+ */
+ saved_argv = argv;
+ do {
+ argv = saved_argv;
+ do {
+ int test_num;
+
+ test_num = get_test_set(test_set, limit, *argv, tests);
+ if (test_num < 0) {
+ printf("*** INVALID Test %s\n", *argv);
+ free(refdir_alloc);
+ free(testprogdir);
+ usage(progname);
+ return (1);
+ }
+ for (i = 0; i < test_num; i++) {
+ tests_run++;
+ if (test_run(test_set[i], tmpdir)) {
+ tests_failed++;
+ if (until_failure)
+ goto finish;
+ }
+ }
+ if (*argv != NULL)
+ argv++;
+ } while (*argv != NULL);
+ } while (until_failure);
+
+finish:
+ /* Must be freed after all tests run */
+ free(tmp2);
+ free(testprogdir);
+ free(pwd);
+
+ /*
+ * Report summary statistics.
+ */
+ if (verbosity > VERBOSITY_SUMMARY_ONLY) {
+ printf("\n");
+ printf("Totals:\n");
+ printf(" Tests run: %8d\n", tests_run);
+ printf(" Tests failed: %8d\n", tests_failed);
+ printf(" Assertions checked:%8d\n", assertions);
+ printf(" Assertions failed: %8d\n", failures);
+ printf(" Skips reported: %8d\n", skips);
+ }
+ if (failures) {
+ printf("\n");
+ printf("Failing tests:\n");
+ for (i = 0; i < limit; ++i) {
+ if (tests[i].failures)
+ printf(" %d: %s (%d failures)\n", i,
+ tests[i].name, tests[i].failures);
+ }
+ printf("\n");
+ printf("Details for failing tests: %s\n", tmpdir);
+ printf("\n");
+ } else {
+ if (verbosity == VERBOSITY_SUMMARY_ONLY)
+ printf("\n");
+ printf("%d tests passed, no failures\n", tests_run);
+ }
+
+ free(refdir_alloc);
+
+ /* If the final tmpdir is empty, we can remove it. */
+ /* This should be the usual case when all tests succeed. */
+ assertChdir("..");
+ rmdir(tmpdir);
+
+ return (tests_failed ? 1 : 0);
+}
More information about the Midnightbsd-cvs
mailing list