git: e8a8ef37eca0 - stable/15 - libarchive: merge from vendor branch
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 29 Oct 2026 10:16:01 UTC
The branch stable/15 has been updated by mm:
URL: https://cgit.FreeBSD.org/src/commit/?id=e8a8ef37eca034732ef1b21a1153689d37e40f16
commit e8a8ef37eca034732ef1b21a1153689d37e40f16
Author: Martin Matuska <mm@FreeBSD.org>
AuthorDate: 2026-10-26 21:47:32 +0000
Commit: Martin Matuska <mm@FreeBSD.org>
CommitDate: 2026-10-29 09:23:55 +0000
libarchive: merge from vendor branch
libarchive 3.8.10
ChangeLog:
https://github.com/libarchive/libarchive/compare/v3.8.9...v3.8.10
Obtained from: libarchive
Vendor commit: 0c48412be2d94afe1859a807ea7896a18d8900bd
(cherry picked from commit 61c70dc16a79efcb9db732d37706cd311f555d9a)
---
contrib/libarchive/NEWS | 2 +
contrib/libarchive/build/autoconf/visibility.m4 | 84 ++
contrib/libarchive/cpio/bsdcpio.1 | 25 +-
contrib/libarchive/cpio/cpio.c | 80 +-
contrib/libarchive/cpio/cpio.h | 1 -
contrib/libarchive/cpio/test/test_basic.c | 74 +-
contrib/libarchive/cpio/test/test_cmdline.c | 10 +-
contrib/libarchive/cpio/test/test_format_newc.c | 40 +-
contrib/libarchive/cpio/test/test_option_l.c | 7 +
contrib/libarchive/libarchive/archive.h | 10 +-
contrib/libarchive/libarchive/archive_blake2.h | 13 +
.../libarchive/libarchive/archive_check_magic.c | 1 +
contrib/libarchive/libarchive/archive_crc32.c | 192 +++
contrib/libarchive/libarchive/archive_cryptor.c | 17 +-
.../libarchive/archive_cryptor_private.h | 12 +-
contrib/libarchive/libarchive/archive_digest.c | 64 +-
.../libarchive/libarchive/archive_digest_private.h | 16 +-
contrib/libarchive/libarchive/archive_entry.3 | 2 +-
contrib/libarchive/libarchive/archive_entry.c | 37 +-
contrib/libarchive/libarchive/archive_entry.h | 2 +-
contrib/libarchive/libarchive/archive_entry_acl.3 | 20 +-
.../libarchive/libarchive/archive_entry_linkify.3 | 8 +-
.../libarchive/libarchive/archive_entry_locale.h | 58 +-
.../libarchive/libarchive/archive_entry_perms.3 | 2 +-
contrib/libarchive/libarchive/archive_entry_stat.3 | 14 +-
contrib/libarchive/libarchive/archive_hmac.c | 16 +-
.../libarchive/libarchive/archive_hmac_private.h | 12 +-
contrib/libarchive/libarchive/archive_match.c | 5 +-
contrib/libarchive/libarchive/archive_pack_dev.c | 5 +-
contrib/libarchive/libarchive/archive_pack_dev.h | 3 +-
contrib/libarchive/libarchive/archive_private.h | 18 +-
contrib/libarchive/libarchive/archive_random.c | 8 +-
contrib/libarchive/libarchive/archive_rb.c | 10 +-
contrib/libarchive/libarchive/archive_read.3 | 2 +-
contrib/libarchive/libarchive/archive_read.c | 493 +++---
.../libarchive/archive_read_add_passphrase.3 | 4 +-
.../libarchive/archive_read_append_filter.c | 73 +-
contrib/libarchive/libarchive/archive_read_data.3 | 15 +
.../libarchive/archive_read_data_into_fd.c | 2 +-
contrib/libarchive/libarchive/archive_read_disk.3 | 28 +-
.../libarchive/archive_read_disk_posix.c | 15 +-
.../archive_read_disk_set_standard_lookup.c | 6 +-
contrib/libarchive/libarchive/archive_read_free.3 | 2 +-
contrib/libarchive/libarchive/archive_read_open.3 | 4 +-
.../libarchive/libarchive/archive_read_open_fd.c | 5 +-
.../libarchive/libarchive/archive_read_open_file.c | 5 +-
.../libarchive/archive_read_open_memory.c | 22 +-
.../libarchive/libarchive/archive_read_private.h | 7 -
.../libarchive/archive_read_set_options.3 | 2 +-
.../libarchive/archive_read_support_filter_bzip2.c | 2 +-
.../archive_read_support_filter_compress.c | 2 +-
.../libarchive/archive_read_support_filter_grzip.c | 2 +-
.../libarchive/archive_read_support_filter_gzip.c | 10 +-
.../libarchive/archive_read_support_filter_lrzip.c | 8 +-
.../libarchive/archive_read_support_filter_lz4.c | 12 +-
.../libarchive/archive_read_support_filter_lzop.c | 8 +-
.../archive_read_support_filter_program.c | 36 +-
.../libarchive/archive_read_support_filter_rpm.c | 2 +-
.../libarchive/archive_read_support_filter_uu.c | 502 +++----
.../libarchive/archive_read_support_filter_xz.c | 6 +-
.../libarchive/archive_read_support_filter_zstd.c | 16 +-
.../libarchive/archive_read_support_format_7zip.c | 690 +++++++--
.../libarchive/archive_read_support_format_ar.c | 88 +-
.../libarchive/archive_read_support_format_cab.c | 99 +-
.../libarchive/archive_read_support_format_cpio.c | 23 +-
.../libarchive/archive_read_support_format_empty.c | 7 +-
.../archive_read_support_format_iso9660.c | 85 +-
.../libarchive/archive_read_support_format_lha.c | 131 +-
.../libarchive/archive_read_support_format_mtree.c | 50 +-
.../libarchive/archive_read_support_format_rar.c | 109 +-
.../libarchive/archive_read_support_format_rar5.c | 489 ++++--
.../libarchive/archive_read_support_format_raw.c | 13 +-
.../libarchive/archive_read_support_format_tar.c | 174 ++-
.../libarchive/archive_read_support_format_warc.c | 151 +-
.../libarchive/archive_read_support_format_xar.c | 78 +-
.../libarchive/archive_read_support_format_zip.c | 286 +++-
contrib/libarchive/libarchive/archive_string.c | 63 +-
.../libarchive/libarchive/archive_string_sprintf.c | 19 +-
contrib/libarchive/libarchive/archive_time.c | 20 +-
.../libarchive/libarchive/archive_time_private.h | 10 +-
contrib/libarchive/libarchive/archive_umask.c | 101 ++
.../libarchive/libarchive/archive_umask_private.h | 49 +
contrib/libarchive/libarchive/archive_util.c | 24 +-
.../libarchive/archive_version_details.c | 26 +-
contrib/libarchive/libarchive/archive_write.3 | 4 +-
contrib/libarchive/libarchive/archive_write.c | 23 +-
.../libarchive/archive_write_add_filter_compress.c | 18 +-
.../libarchive/archive_write_add_filter_gzip.c | 8 +-
.../libarchive/archive_write_add_filter_lz4.c | 14 +-
.../libarchive/archive_write_add_filter_program.c | 58 +
.../libarchive/archive_write_add_filter_zstd.c | 2 -
contrib/libarchive/libarchive/archive_write_data.3 | 2 +-
contrib/libarchive/libarchive/archive_write_disk.3 | 4 +-
.../libarchive/archive_write_disk_posix.c | 22 +-
.../archive_write_disk_set_standard_lookup.c | 4 +
contrib/libarchive/libarchive/archive_write_open.3 | 2 +-
.../libarchive/libarchive/archive_write_open_fd.c | 4 +
.../libarchive/archive_write_open_file.c | 4 +
.../libarchive/archive_write_open_filename.c | 3 +
.../libarchive/archive_write_open_memory.c | 4 +
.../libarchive/archive_write_set_format_7zip.c | 18 +-
.../archive_write_set_format_cpio_binary.c | 24 +-
.../archive_write_set_format_cpio_newc.c | 122 +-
.../libarchive/archive_write_set_format_cpio_odc.c | 24 +-
.../archive_write_set_format_filter_by_ext.c | 31 +-
.../libarchive/archive_write_set_format_gnutar.c | 24 +-
.../libarchive/archive_write_set_format_iso9660.c | 94 +-
.../libarchive/archive_write_set_format_mtree.c | 17 +-
.../libarchive/archive_write_set_format_private.h | 5 +
.../libarchive/archive_write_set_format_shar.c | 8 +-
.../libarchive/archive_write_set_format_ustar.c | 24 +-
.../libarchive/archive_write_set_format_v7tar.c | 24 +-
.../libarchive/archive_write_set_format_xar.c | 39 +-
.../libarchive/archive_write_set_format_zip.c | 32 +-
.../libarchive/archive_write_set_options.3 | 10 +-
.../libarchive/libarchive/archive_xml_private.h | 83 +
contrib/libarchive/libarchive/cpio.5 | 2 +-
contrib/libarchive/libarchive/filter_fork_posix.c | 42 +-
contrib/libarchive/libarchive/libarchive-formats.5 | 2 +-
contrib/libarchive/libarchive/libarchive.3 | 2 +-
.../libarchive/libarchive/libarchive_internals.3 | 2 +-
contrib/libarchive/libarchive/tar.5 | 2 +-
.../libarchive/libarchive/test/read_open_memory.c | 18 +-
.../libarchive/test/test_archive_crc32.c | 49 +
.../libarchive/test/test_archive_ntfs_time.c | 87 ++
.../libarchive/libarchive/test/test_archive_read.c | 365 +++++
.../test/test_archive_read_append_filter.c | 54 +
.../test/test_archive_read_open_filenames.c | 89 ++
..._archive_read_open_filenames_split_uaf_1.tar.uu | 9 +
..._archive_read_open_filenames_split_uaf_2.tar.uu | 26 +
.../libarchive/test/test_archive_read_support.c | 42 +
.../libarchive/test/test_archive_string.c | 16 +
.../test/test_archive_string_conversion.c | 32 +-
.../test_archive_write_set_format_filter_by_ext.c | 9 +-
.../test_compat_lz4_skippable_frames_B4.tar.lz4.uu | 10 +
.../libarchive/test/test_compat_uudecode.c | 33 +-
.../libarchive/libarchive/test/test_compat_zstd.c | 4 +
.../libarchive/test/test_compat_zstd_3.tar.zst.uu | 22 +
.../test/test_create_child_environment.c | 108 ++
contrib/libarchive/libarchive/test/test_entry.c | 9 +-
.../test/test_gnutar_filename_encoding.c | 69 +-
.../libarchive/test/test_pax_filename_encoding.c | 24 +-
.../test/test_read_data_block_offset_at_eof.c | 135 ++
.../test_read_data_into_fd_no_offset_reported.c | 92 ++
.../libarchive/test/test_read_filter_uudecode.c | 31 +
.../test/test_read_filter_uudecode_newlines.c | 76 +
.../test/test_read_filter_uudecode_raw.c | 107 +-
.../test/test_read_filter_uudecode_raw.uu | 14 +
.../libarchive/test/test_read_format_7zip.c | 524 ++++++-
...test_read_format_7zip_deflate_arm64_large.7z.uu | 1580 ++++++++++++++++++++
.../test_read_format_7zip_deflate_arm_arm64.7z.uu | 124 ++
.../test_read_format_7zip_deflate_armthumb.7z.uu | 46 +
.../test/test_read_format_7zip_deflate_delta.7z.uu | 61 +
.../test/test_read_format_7zip_deflate_ia64.7z.uu | 69 +
.../test/test_read_format_7zip_deflate_riscv.7z.uu | 62 +
.../test/test_read_format_7zip_lzma1_arm.7z.uu | 61 +
.../test/test_read_format_7zip_lzma1_arm64.7z.uu | 65 +
.../test_read_format_7zip_lzma1_armthumb.7z.uu | 45 +
.../test/test_read_format_7zip_lzma1_ia64.7z.uu | 66 +
.../test/test_read_format_7zip_lzma1_powerpc.7z.uu | 58 +
.../test/test_read_format_7zip_lzma1_riscv.7z.uu | 59 +
.../test/test_read_format_7zip_lzma1_sparc.7z.uu | 62 +
.../test_read_format_7zip_null_client_next.7z.uu | 19 +
.../test/test_read_format_7zip_ppmd_arm64.7z.uu | 62 +
.../test/test_read_format_7zip_ppmd_bcj.7z.uu | 47 +
.../test_read_format_7zip_ppmd_small_block.7z.uu | 103 ++
.../libarchive/test/test_read_format_ar.c | 12 +-
.../libarchive/test/test_read_format_cab.c | 10 +-
.../test/test_read_format_cab_filename.c | 4 +-
.../test_read_format_cab_lzx_invalid_history.c | 45 +
...test_read_format_cab_lzx_invalid_history.cab.uu | 6 +
...test_read_format_cab_lzx_literal_control.cab.uu | 6 +
.../libarchive/test/test_read_format_cab_lzx_oob.c | 2 +-
.../libarchive/test/test_read_format_cab_multi.c | 2 +-
.../test_read_format_cab_skip_across_folders.c | 92 ++
...test_read_format_cab_skip_across_folders.cab.uu | 6 +
.../test/test_read_format_cab_skip_malformed.c | 2 +-
.../test/test_read_format_cpio_filename.c | 80 +-
.../test/test_read_format_gtar_filename.c | 46 +-
.../test_read_format_gtar_sparse_exceeds_length.c | 48 +
...read_format_gtar_sparse_exceeds_length.tar.Z.uu | 9 +
.../test_read_format_iso_rockridge_ce_overflow.c | 83 +
..._read_format_iso_rockridge_ce_overflow.iso.Z.uu | 15 +
...ead_format_iso_rockridge_cl_re_control.iso.Z.uu | 18 +
.../test_read_format_iso_rockridge_cl_re_cycle.c | 101 ++
..._read_format_iso_rockridge_cl_re_cycle.iso.Z.uu | 22 +
.../test/test_read_format_lha_amiga_script.c | 70 +
.../test/test_read_format_lha_amiga_script.lha.uu | 20 +
.../test/test_read_format_lha_filename.c | 4 +-
.../test/test_read_format_lha_filename_utf16.c | 2 +-
.../libarchive/test/test_read_format_mtree_size.c | 79 +
.../libarchive/test/test_read_format_rar.c | 9 +-
.../libarchive/test/test_read_format_rar5.c | 134 ++
...ad_format_rar5_extra_data_size_toolong.rar.Z.uu | 18 +
.../test_read_format_rar5_extra_field_underflow.c | 47 +
...t_read_format_rar5_extra_field_underflow.rar.uu | 5 +
...test_read_format_rar5_group_name_toolong.rar.uu | 5 +
.../test_read_format_rar5_header_size_wraparound.c | 63 +
...test_read_format_rar5_owner_name_toolong.rar.uu | 5 +
.../test/test_read_format_rar5_redir_overflow.c | 50 +
.../test_read_format_rar5_redir_overflow.rar.uu | 6 +
...test_read_format_rar5_redir_varint_2byte.rar.uu | 8 +
.../test/test_read_format_rar5_truncated_htime.c | 61 +
.../test/test_read_format_rar5_varint_near_eof.c | 68 +
.../test/test_read_format_rar5_zip_in_rar.rar.uu | 11 +
.../test_read_format_rar_filter_incomplete_block.c | 50 +
..._read_format_rar_filter_incomplete_block.rar.uu | 8 +
.../test/test_read_format_tar_filename.c | 16 +-
.../test/test_read_format_tar_pax_global_header.c | 82 +
.../test_read_format_tar_pax_global_header.tar.uu | 72 +
...d_format_tar_pax_global_header_ignorable.tar.uu | 72 +
.../test/test_read_format_ustar_filename.c | 46 +-
.../libarchive/test/test_read_format_warc.c | 58 +
.../test/test_read_format_warc_uri_nul.warc.uu | 6 +
.../libarchive/test/test_read_format_xar.c | 97 ++
.../test/test_read_format_xar_empty_xattr.xar.uu | 9 +
...read_format_xar_toc_premature_stream_end.xar.uu | 7 +
...mat_xar_toc_premature_stream_end_control.xar.uu | 4 +
.../test/test_read_format_zip_7075_utf8_paths.c | 2 +-
.../test_read_format_zip_ambiguous_timestamps.c | 321 ++++
.../test_read_format_zip_dos_mtime_precedence.c | 365 +++++
.../libarchive/test/test_read_format_zip_empty.c | 56 +
.../test/test_read_format_zip_filename.c | 84 +-
.../test_read_format_zip_lzma_alone_large_size.c | 56 +
...st_read_format_zip_lzma_alone_large_size.zip.uu | 45 +
.../test_read_format_zip_negative_timestamps.c | 156 ++
.../test/test_read_format_zip_ntfs_precedence.c | 365 +++++
.../test/test_read_format_zip_ntfs_timestamp.c | 136 ++
.../test/test_read_format_zip_unset_times.c | 362 +++++
.../test/test_read_format_zip_winzip_aes_large.c | 5 +-
.../test/test_read_format_zip_zipx_encrypted.c | 14 +
.../libarchive/test/test_read_set_format.c | 50 +-
.../libarchive/test/test_read_truncated_filter.c | 90 ++
.../libarchive/test/test_ustar_filename_encoding.c | 33 +-
.../libarchive/test/test_write_disk_appledouble.c | 55 +-
.../test/test_write_disk_secure_physicaldrive.c | 94 ++
.../libarchive/test/test_write_filter_compress.c | 80 +
.../libarchive/test/test_write_filter_lz4.c | 54 +
.../libarchive/test/test_write_format_ar.c | 5 -
.../libarchive/test/test_write_format_cpio_newc.c | 63 +
.../test/test_write_format_iso9660_bugs.c | 59 +
.../test_write_format_iso9660_rr_moved_notdir.c | 133 ++
.../libarchive/test/test_write_format_mtree.c | 31 +
.../test/test_write_format_mtree_preset_digests.c | 17 +-
.../libarchive/test/test_write_format_pax.c | 14 +
.../libarchive/test/test_write_format_pax_align.c | 26 +-
.../libarchive/test/test_write_format_raw.c | 4 +-
.../libarchive/test/test_write_format_shar_empty.c | 37 +
.../libarchive/test/test_write_format_xar.c | 2 +-
.../libarchive/test/test_zip_filename_encoding.c | 20 +-
.../libarchive/libarchive_fe/lafe_explicit_bzero.c | 52 +
.../libarchive/libarchive_fe/lafe_explicit_bzero.h | 36 +
contrib/libarchive/libarchive_fe/lafe_setmode.c | 464 ++++++
contrib/libarchive/libarchive_fe/lafe_setmode.h | 41 +
contrib/libarchive/tar/bsdtar.1 | 60 +-
contrib/libarchive/tar/bsdtar.c | 10 +
contrib/libarchive/tar/bsdtar.h | 10 +-
contrib/libarchive/tar/cmdline.c | 1 +
contrib/libarchive/tar/read.c | 30 +-
contrib/libarchive/tar/subst.c | 46 +-
contrib/libarchive/tar/test/test_basic.c | 3 +-
contrib/libarchive/tar/test/test_copy.c | 6 +-
.../tar/test/test_edit_pathname_hardlink.c | 46 +
.../tar/test/test_edit_pathname_hardlink.tar.Z.uu | 8 +
contrib/libarchive/tar/test/test_option_P_upper.c | 21 +-
contrib/libarchive/tar/test/test_option_T_upper.c | 16 +-
contrib/libarchive/tar/test/test_option_b.c | 2 +-
.../libarchive/tar/test/test_option_gid_gname.c | 33 +-
contrib/libarchive/tar/test/test_option_group.c | 18 +-
.../libarchive/tar/test/test_option_ignore_zeros.c | 38 +-
contrib/libarchive/tar/test/test_option_mode.c | 120 ++
contrib/libarchive/tar/test/test_option_owner.c | 18 +-
.../libarchive/tar/test/test_option_passphrase.c | 19 +
contrib/libarchive/tar/test/test_option_r.c | 36 +-
contrib/libarchive/tar/test/test_option_s.c | 12 +
.../libarchive/tar/test/test_option_uid_uname.c | 31 +-
contrib/libarchive/tar/util.c | 123 +-
contrib/libarchive/tar/write.c | 124 +-
contrib/libarchive/test_utils/test_common.h | 9 +-
contrib/libarchive/test_utils/test_main.c | 45 +-
contrib/libarchive/unzip/bsdunzip.1 | 4 +-
contrib/libarchive/unzip/bsdunzip.c | 125 +-
contrib/libarchive/unzip/test/test_I.c | 10 +-
contrib/libarchive/unzip/test/test_Z1.c | 14 +
contrib/libarchive/unzip/test/test_windows_paths.c | 38 +
.../unzip/test/test_windows_paths.zip.uu | 16 +
lib/libarchive/Makefile | 2 +
lib/libarchive/tests/Makefile | 91 +-
usr.bin/tar/Makefile | 1 +
usr.bin/tar/tests/Makefile | 3 +
290 files changed, 14052 insertions(+), 2759 deletions(-)
diff --git a/contrib/libarchive/NEWS b/contrib/libarchive/NEWS
index a46b69aaf3e9..e0dc5f5c110a 100644
--- a/contrib/libarchive/NEWS
+++ b/contrib/libarchive/NEWS
@@ -1,3 +1,5 @@
+Oct 14, 2026: libarchive 3.8.10 released
+
Jul 28, 2026: libarchive 3.8.9 released
Jun 23, 2026: libarchive 3.8.8 released
diff --git a/contrib/libarchive/build/autoconf/visibility.m4 b/contrib/libarchive/build/autoconf/visibility.m4
new file mode 100644
index 000000000000..55ceb67219be
--- /dev/null
+++ b/contrib/libarchive/build/autoconf/visibility.m4
@@ -0,0 +1,84 @@
+# visibility.m4
+# serial 9
+dnl Copyright (C) 2005, 2008, 2010-2026 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+dnl This file is offered as-is, without any warranty.
+
+dnl From Bruno Haible.
+
+dnl Tests whether the compiler supports the command-line option
+dnl -fvisibility=hidden and the function and variable attributes
+dnl __attribute__((__visibility__("hidden"))) and
+dnl __attribute__((__visibility__("default"))).
+dnl Does *not* test for __visibility__("protected") - which has tricky
+dnl semantics (see the 'vismain' test in glibc) and does not exist e.g. on
+dnl Mac OS X.
+dnl Does *not* test for __visibility__("internal") - which has processor
+dnl dependent semantics.
+dnl Does *not* test for #pragma GCC visibility push(hidden) - which is
+dnl "really only recommended for legacy code".
+dnl Set the variable CFLAG_VISIBILITY.
+dnl Defines and sets the variable HAVE_VISIBILITY.
+
+AC_DEFUN([gl_VISIBILITY],
+[
+ AC_REQUIRE([AC_PROG_CC])
+ CFLAG_VISIBILITY=
+ HAVE_VISIBILITY=0
+ if test -n "$GCC"; then
+ dnl First, check whether -Werror can be added to the command line, or
+ dnl whether it leads to an error because of some other option that the
+ dnl user has put into $CC $CFLAGS $CPPFLAGS.
+ AC_CACHE_CHECK([whether the -Werror option is usable],
+ [gl_cv_cc_vis_werror],
+ [gl_saved_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -Werror"
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[]], [[]])],
+ [gl_cv_cc_vis_werror=yes],
+ [gl_cv_cc_vis_werror=no])
+ CFLAGS="$gl_saved_CFLAGS"
+ ])
+ dnl Now check whether visibility declarations are supported.
+ AC_CACHE_CHECK([for simple visibility declarations],
+ [gl_cv_cc_visibility],
+ [gl_saved_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -fvisibility=hidden"
+ dnl We use the option -Werror and a function dummyfunc, because on some
+ dnl platforms (Cygwin 1.7) the use of -fvisibility triggers a warning
+ dnl "visibility attribute not supported in this configuration; ignored"
+ dnl at the first function definition in every compilation unit, and we
+ dnl don't want to use the option in this case.
+ if test $gl_cv_cc_vis_werror = yes; then
+ CFLAGS="$CFLAGS -Werror"
+ fi
+ AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[extern __attribute__((__visibility__("hidden"))) int hiddenvar;
+ extern __attribute__((__visibility__("default"))) int exportedvar;
+ extern __attribute__((__visibility__("hidden"))) int hiddenfunc (void);
+ extern __attribute__((__visibility__("default"))) int exportedfunc (void);
+ void dummyfunc (void);
+ int hiddenvar;
+ int exportedvar;
+ int hiddenfunc (void) { return 51; }
+ int exportedfunc (void) { return 1225736919; }
+ void dummyfunc (void) {}
+ ]],
+ [[]])],
+ [gl_cv_cc_visibility=yes],
+ [gl_cv_cc_visibility=no])
+ CFLAGS="$gl_saved_CFLAGS"
+ ])
+ if test $gl_cv_cc_visibility = yes; then
+ CFLAG_VISIBILITY="-fvisibility=hidden"
+ HAVE_VISIBILITY=1
+ fi
+ fi
+ AC_SUBST([CFLAG_VISIBILITY])
+ AC_SUBST([HAVE_VISIBILITY])
+ AC_DEFINE_UNQUOTED([HAVE_VISIBILITY], [$HAVE_VISIBILITY],
+ [Define to 1 or 0, depending whether the compiler supports simple visibility declarations.])
+])
diff --git a/contrib/libarchive/cpio/bsdcpio.1 b/contrib/libarchive/cpio/bsdcpio.1
index 9dc7d660b448..e4e663f1a55e 100644
--- a/contrib/libarchive/cpio/bsdcpio.1
+++ b/contrib/libarchive/cpio/bsdcpio.1
@@ -79,6 +79,14 @@ Reset access times on files after they are read.
.It Fl B
(o mode only)
Block output to records of 5120 bytes.
+.It Fl Fl b64encode
+(o mode only)
+Encode the archive with base64, after any compression.
+In input mode, this option is ignored; base64-encoded archives are
+recognized automatically on input.
+If both this option and
+.Fl Fl uuencode
+are given, the last one specified is used.
.It Fl C Ar size
(o mode only)
Block output to records of
@@ -154,7 +162,7 @@ automatically on input.
.It Fl j
Synonym for
.Fl y .
-.It Fl L
+.It Fl L , Fl Fl dereference
(o and p modes)
All symbolic links will be followed.
Normally, symbolic links are archived and copied as symbolic links.
@@ -163,6 +171,11 @@ With this option, the target of the link will be archived or copied instead.
(p mode only)
Create links from the target directory to the original files,
instead of copying.
+.It Fl Fl grzip
+(o mode only)
+Compress the resulting archive with
+.Xr grzip 1 .
+In input mode, this option is ignored.
.It Fl Fl lrzip
(o mode only)
Compress the resulting archive with
@@ -265,6 +278,16 @@ do not restore the contents to disk.
(i and p modes)
Unconditionally overwrite existing files.
Ordinarily, an older file will not overwrite a newer file on disk.
+.It Fl Fl uuencode
+(o mode only)
+Encode the archive with
+.Xr uuencode 1 ,
+after any compression.
+In input mode, this option is ignored; uuencoded archives are
+recognized automatically on input.
+If both this option and
+.Fl Fl b64encode
+are given, the last one specified is used.
.It Fl V , Fl Fl dot
Print a dot to stderr for each file as it is processed.
Superseded by
diff --git a/contrib/libarchive/cpio/cpio.c b/contrib/libarchive/cpio/cpio.c
index ebdace394cea..9ba153d82770 100644
--- a/contrib/libarchive/cpio/cpio.c
+++ b/contrib/libarchive/cpio/cpio.c
@@ -66,6 +66,7 @@
#include "cpio.h"
#include "lafe_err.h"
+#include "lafe_explicit_bzero.h"
#include "line_reader.h"
#include "passphrase.h"
@@ -77,8 +78,6 @@
#endif
struct name_cache {
- int probes;
- int hits;
size_t size;
struct {
id_t id;
@@ -87,7 +86,6 @@ struct name_cache {
};
static int extract_data(struct archive *, struct archive *);
-const char * cpio_i64toa(int64_t);
static void cpio_rename(struct archive_entry *);
static int entry_to_archive(struct cpio *, struct archive_entry *);
static int file_to_archive(struct cpio *, const char *);
@@ -409,6 +407,10 @@ main(int argc, char *argv[])
else
cpio->format = "cpio";
}
+ if (cpio->argc > 0)
+ lafe_errc(1, 0,
+ "Too many arguments for -o mode (got %d, expected 0)",
+ cpio->argc);
mode_out(cpio);
break;
case 'i':
@@ -429,6 +431,10 @@ main(int argc, char *argv[])
if (*cpio->argv == NULL || **cpio->argv == '\0')
lafe_errc(1, 0,
"-p mode requires a target directory");
+ if (cpio->argc > 1)
+ lafe_errc(1, 0,
+ "Too many arguments for -p mode (got %d, expected 1)",
+ cpio->argc);
mode_pass(cpio, *cpio->argv);
break;
default:
@@ -728,12 +734,16 @@ file_to_archive(struct cpio *cpio, const char *srcpath)
return (r);
}
- if (cpio->uid_override >= 0)
+ if (cpio->uid_override >= 0) {
archive_entry_set_uid(entry, cpio->uid_override);
+ archive_entry_set_uname(entry, NULL);
+ }
if (cpio->uname_override != NULL)
archive_entry_set_uname(entry, cpio->uname_override);
- if (cpio->gid_override >= 0)
+ if (cpio->gid_override >= 0) {
archive_entry_set_gid(entry, cpio->gid_override);
+ archive_entry_set_gname(entry, NULL);
+ }
if (cpio->gname_override != NULL)
archive_entry_set_gname(entry, cpio->gname_override);
@@ -842,7 +852,11 @@ entry_to_archive(struct cpio *cpio, struct archive_entry *entry)
lafe_warnc(0, "Copying file instead");
} else
#endif
- return (0);
+ {
+ if (r != ARCHIVE_OK)
+ cpio->return_value = 1;
+ return (0);
+ }
}
/*
@@ -1160,6 +1174,7 @@ list_item_verbose(struct cpio *cpio, struct archive_entry *entry)
const char *uname, *gname;
FILE *out = stdout;
const char *fmt;
+ double age;
time_t mtime;
static time_t now;
struct tm *ltime;
@@ -1172,9 +1187,11 @@ list_item_verbose(struct cpio *cpio, struct archive_entry *entry)
if (cpio->option_numeric_uid_gid) {
/* Format numeric uid/gid for display. */
- strcpy(uids, cpio_i64toa(archive_entry_uid(entry)));
+ snprintf(uids, sizeof(uids), "%lld",
+ (long long)archive_entry_uid(entry));
uname = uids;
- strcpy(gids, cpio_i64toa(archive_entry_gid(entry)));
+ snprintf(gids, sizeof(gids), "%lld",
+ (long long)archive_entry_gid(entry));
gname = gids;
} else {
/* Use uname if it's present, else lookup name from uid. */
@@ -1194,21 +1211,21 @@ list_item_verbose(struct cpio *cpio, struct archive_entry *entry)
(unsigned long)archive_entry_rdevmajor(entry),
(unsigned long)archive_entry_rdevminor(entry));
} else {
- strcpy(size, cpio_i64toa(archive_entry_size(entry)));
+ snprintf(size, sizeof(size), "%lld",
+ (long long)archive_entry_size(entry));
}
/* Format the time using 'ls -l' conventions. */
mtime = archive_entry_mtime(entry);
+ age = difftime(mtime, now);
#if defined(_WIN32) && !defined(__CYGWIN__)
/* Windows' strftime function does not support %e format. */
- if (mtime - now > 365*86400/2
- || mtime - now < -365*86400/2)
+ if (age > 365.0 * 86400 / 2 || age < -365.0 * 86400 / 2)
fmt = cpio->day_first ? "%d %b %Y" : "%b %d %Y";
else
fmt = cpio->day_first ? "%d %b %H:%M" : "%b %d %H:%M";
#else
- if (mtime - now > 365*86400/2
- || mtime - now < -365*86400/2)
+ if (age > 365.0 * 86400 / 2 || age < -365.0 * 86400 / 2)
fmt = cpio->day_first ? "%e %b %Y" : "%b %e %Y";
else
fmt = cpio->day_first ? "%e %b %H:%M" : "%b %e %H:%M";
@@ -1392,12 +1409,10 @@ lookup_name(struct cpio *cpio, struct name_cache **name_cache_variable,
}
cache = *name_cache_variable;
- cache->probes++;
slot = id % cache->size;
if (cache->cache[slot].name != NULL) {
if (cache->cache[slot].id == id) {
- cache->hits++;
return (cache->cache[slot].name);
}
free(cache->cache[slot].name);
@@ -1442,8 +1457,8 @@ lookup_uname_helper(struct cpio *cpio, const char **name, id_t id)
pwent = getpwuid((uid_t)id);
if (pwent == NULL) {
if (errno && errno != ENOENT)
- lafe_warnc(errno, "getpwuid(%s) failed",
- cpio_i64toa((int64_t)id));
+ lafe_warnc(errno, "getpwuid(%lld) failed",
+ (long long)id);
return 1;
}
@@ -1469,8 +1484,8 @@ lookup_gname_helper(struct cpio *cpio, const char **name, id_t id)
grent = getgrgid((gid_t)id);
if (grent == NULL) {
if (errno && errno != ENOENT)
- lafe_warnc(errno, "getgrgid(%s) failed",
- cpio_i64toa((int64_t)id));
+ lafe_warnc(errno, "getgrgid(%lld) failed",
+ (long long)id);
return 1;
}
@@ -1478,31 +1493,6 @@ lookup_gname_helper(struct cpio *cpio, const char **name, id_t id)
return 0;
}
-/*
- * It would be nice to just use printf() for formatting large numbers,
- * but the compatibility problems are a big headache. Hence the
- * following simple utility function.
- */
-const char *
-cpio_i64toa(int64_t n0)
-{
- /* 2^64 =~ 1.8 * 10^19, so 20 decimal digits suffice.
- * We also need 1 byte for '-' and 1 for '\0'.
- */
- static char buff[22];
- int64_t n = n0 < 0 ? -n0 : n0;
- char *p = buff + sizeof(buff);
-
- *--p = '\0';
- do {
- *--p = '0' + (int)(n % 10);
- n /= 10;
- } while (n > 0);
- if (n0 < 0)
- *--p = '-';
- return p;
-}
-
#define PPBUFF_SIZE 1024
static const char *
passphrase_callback(struct archive *a, void *_client_data)
@@ -1523,7 +1513,7 @@ static void
passphrase_free(char *ppbuff)
{
if (ppbuff != NULL) {
- memset(ppbuff, 0, PPBUFF_SIZE);
+ explicit_bzero(ppbuff, PPBUFF_SIZE);
free(ppbuff);
}
}
diff --git a/contrib/libarchive/cpio/cpio.h b/contrib/libarchive/cpio/cpio.h
index 2621a4c3dda3..8607f1d119b8 100644
--- a/contrib/libarchive/cpio/cpio.h
+++ b/contrib/libarchive/cpio/cpio.h
@@ -34,7 +34,6 @@ struct cpio {
int dot; /* -V */
int quiet; /* --quiet */
int extract_flags; /* Flags for extract operation */
- const char *compress_program;
int option_append; /* -A, only relevant for -o */
int option_atime_restore; /* -a */
int option_follow_links; /* -L */
diff --git a/contrib/libarchive/cpio/test/test_basic.c b/contrib/libarchive/cpio/test/test_basic.c
index 8b8e8bb0f0ec..96f6f99d521a 100644
--- a/contrib/libarchive/cpio/test/test_basic.c
+++ b/contrib/libarchive/cpio/test/test_basic.c
@@ -45,7 +45,7 @@ static void
basic_cpio(const char *target,
const char *pack_options,
const char *unpack_options,
- const char *se, const char *se2)
+ const char *se)
{
int r;
@@ -74,7 +74,7 @@ basic_cpio(const char *target,
/* Verify stderr. */
failure("Error invoking %s -i %s in dir %s", testprog, unpack_options, target);
- assertTextFileContents(se2, "unpack.err");
+ assertTextFileContents(se, "unpack.err");
verify_files(pack_options);
@@ -112,7 +112,6 @@ DEFINE_TEST(test_basic)
{
FILE *filelist;
const char *msg;
- char result[1024];
assertUmask(0);
@@ -120,85 +119,28 @@ DEFINE_TEST(test_basic)
* Create an assortment of files on disk.
*/
filelist = fopen("filelist", "w");
- memset(result, 0, sizeof(result));
/* File with 10 bytes content. */
assertMakeFile("file", 0644, "1234567890");
fprintf(filelist, "file\n");
- if (is_LargeInode("file")) {
- strncat(result,
- "bsdcpio: file: large inode number truncated: ",
- sizeof(result) - strlen(result) -1);
- strncat(result,
- strerror(ERANGE),
- sizeof(result) - strlen(result) -1);
- strncat(result,
- "\n",
- sizeof(result) - strlen(result) -1);
- }
/* hardlink to above file. */
assertMakeHardlink("linkfile", "file");
fprintf(filelist, "linkfile\n");
- if (is_LargeInode("linkfile")) {
- strncat(result,
- "bsdcpio: linkfile: large inode number truncated: ",
- sizeof(result) - strlen(result) -1);
- strncat(result,
- strerror(ERANGE),
- sizeof(result) - strlen(result) -1);
- strncat(result,
- "\n",
- sizeof(result) - strlen(result) -1);
- }
/* Symlink to above file. */
if (canSymlink()) {
assertMakeSymlink("symlink", "file", 0);
fprintf(filelist, "symlink\n");
- if (is_LargeInode("symlink")) {
- strncat(result,
- "bsdcpio: symlink: large inode number truncated: ",
- sizeof(result) - strlen(result) -1);
- strncat(result,
- strerror(ERANGE),
- sizeof(result) - strlen(result) -1);
- strncat(result,
- "\n",
- sizeof(result) - strlen(result) -1);
- }
}
/* Another file with different permissions. */
assertMakeFile("file2", 0777, "1234567890");
fprintf(filelist, "file2\n");
- if (is_LargeInode("file2")) {
- strncat(result,
- "bsdcpio: file2: large inode number truncated: ",
- sizeof(result) - strlen(result) -1);
- strncat(result,
- strerror(ERANGE),
- sizeof(result) - strlen(result) -1);
- strncat(result,
- "\n",
- sizeof(result) - strlen(result) -1);
- }
/* Directory. */
assertMakeDir("dir", 0775);
fprintf(filelist, "dir\n");
- if (is_LargeInode("dir")) {
- strncat(result,
- "bsdcpio: dir: large inode number truncated: ",
- sizeof(result) - strlen(result) -1);
- strncat(result,
- strerror(ERANGE),
- sizeof(result) - strlen(result) -1);
- strncat(result,
- "\n",
- sizeof(result) - strlen(result) -1);
- }
- strncat(result, "2 blocks\n", sizeof(result) - strlen(result) -1);
/* All done. */
fclose(filelist);
@@ -207,14 +149,14 @@ DEFINE_TEST(test_basic)
/* Archive/dearchive with a variety of options. */
msg = canSymlink() ? "2 blocks\n" : "1 block\n";
- basic_cpio("copy", "", "", msg, msg);
- basic_cpio("copy_odc", "--format=odc", "", msg, msg);
- basic_cpio("copy_newc", "-H newc", "", result, "2 blocks\n");
- basic_cpio("copy_cpio", "-H odc", "", msg, msg);
+ basic_cpio("copy", "", "", msg);
+ basic_cpio("copy_odc", "--format=odc", "", msg);
+ basic_cpio("copy_newc", "-H newc", "", "2 blocks\n");
+ basic_cpio("copy_cpio", "-H odc", "", msg);
msg = "1 block\n";
- basic_cpio("copy_bin", "-H bin", "", msg, msg);
+ basic_cpio("copy_bin", "-H bin", "", msg);
msg = canSymlink() ? "9 blocks\n" : "8 blocks\n";
- basic_cpio("copy_ustar", "-H ustar", "", msg, msg);
+ basic_cpio("copy_ustar", "-H ustar", "", msg);
/* Copy in one step using -p */
passthrough("passthrough");
diff --git a/contrib/libarchive/cpio/test/test_cmdline.c b/contrib/libarchive/cpio/test/test_cmdline.c
index e4397b14e7f6..7e29be69564d 100644
--- a/contrib/libarchive/cpio/test/test_cmdline.c
+++ b/contrib/libarchive/cpio/test/test_cmdline.c
@@ -82,7 +82,15 @@ DEFINE_TEST(test_cmdline)
assert(0 != systemf("%s -p -o <empty >16.out 2>16.err", testprog));
assertEmptyFile("16.out");
- failure("-p with empty input should fail");
+ failure("-p with missing directory should fail");
assert(0 != systemf("%s -p <empty >17.out 2>17.err", testprog));
assertEmptyFile("17.out");
+
+ failure("-p with more than one argument should fail");
+ assert(0 != systemf("%s -p out abc <empty >18.out 2>18.err", testprog));
+ assertEmptyFile("18.out");
+
+ failure("-o with arguments should fail");
+ assert(0 != systemf("%s -o abc <empty >19.out 2>19.err", testprog));
+ assertEmptyFile("19.out");
}
diff --git a/contrib/libarchive/cpio/test/test_format_newc.c b/contrib/libarchive/cpio/test/test_format_newc.c
index 7363fc148f16..54e04225eef5 100644
--- a/contrib/libarchive/cpio/test/test_format_newc.c
+++ b/contrib/libarchive/cpio/test/test_format_newc.c
@@ -113,42 +113,6 @@ DEFINE_TEST(test_format_newc)
/* Setup result message. */
memset(result, 0, sizeof(result));
- if (is_LargeInode("file1")) {
- strncat(result,
- "bsdcpio: file1: large inode number truncated: ",
- sizeof(result) - strlen(result) -1);
- strncat(result, strerror(ERANGE),
- sizeof(result) - strlen(result) -1);
- strncat(result, "\n",
- sizeof(result) - strlen(result) -1);
- }
- if (canSymlink() && is_LargeInode("symlink")) {
- strncat(result,
- "bsdcpio: symlink: large inode number truncated: ",
- sizeof(result) - strlen(result) -1);
- strncat(result, strerror(ERANGE),
- sizeof(result) - strlen(result) -1);
- strncat(result, "\n",
- sizeof(result) - strlen(result) -1);
- }
- if (is_LargeInode("dir")) {
- strncat(result,
- "bsdcpio: dir: large inode number truncated: ",
- sizeof(result) - strlen(result) -1);
- strncat(result, strerror(ERANGE),
- sizeof(result) - strlen(result) -1);
- strncat(result, "\n",
- sizeof(result) - strlen(result) -1);
- }
- if (is_LargeInode("hardlink")) {
- strncat(result,
- "bsdcpio: hardlink: large inode number truncated: ",
- sizeof(result) - strlen(result) -1);
- strncat(result, strerror(ERANGE),
- sizeof(result) - strlen(result) -1);
- strncat(result, "\n",
- sizeof(result) - strlen(result) -1);
- }
/* Record some facts about what we just created: */
now = time(NULL); /* They were all created w/in last two seconds. */
@@ -225,7 +189,7 @@ DEFINE_TEST(test_format_newc)
/* "symlink" pointing to "file1" */
assert(is_hex(e, 110));
assertEqualMem(e + 0, "070701", 6); /* Magic */
- assert(is_hex(e + 6, 8)); /* ino */
+ assert(ino != from_hex(e + 6, 8)); /* ino */
#if defined(_WIN32) && !defined(__CYGWIN__)
/* Mode: Group members bits and others bits do not work. */
assertEqualInt(0xa180, from_hex(e + 14, 8) & 0xffc0);
@@ -258,7 +222,7 @@ DEFINE_TEST(test_format_newc)
/* "dir" */
assert(is_hex(e, 110));
assertEqualMem(e + 0, "070701", 6); /* Magic */
- assert(is_hex(e + 6, 8)); /* ino */
+ assert(ino != from_hex(e + 6, 8)); /* ino */
#if defined(_WIN32) && !defined(__CYGWIN__)
/* Group members bits and others bits do not work. */
assertEqualInt(0x41c0, from_hex(e + 14, 8) & 0xffc0); /* Mode */
diff --git a/contrib/libarchive/cpio/test/test_option_l.c b/contrib/libarchive/cpio/test/test_option_l.c
index bbd54c7bc972..e49fc7ca6fe4 100644
--- a/contrib/libarchive/cpio/test/test_option_l.c
+++ b/contrib/libarchive/cpio/test/test_option_l.c
@@ -28,4 +28,11 @@ DEFINE_TEST(test_option_l)
/* Check that this is a link and not a copy. */
assertIsHardlink("f", "link/f");
+
+ /* A failed hard link must make pass mode fail. */
+ r = systemf("echo f | %s -pl missing/parent >invalid.out 2>invalid.err",
+ testprog);
+ assert(r != 0);
+ assertFileNotExists("missing/parent/f");
+ assertNonEmptyFile("invalid.err");
}
diff --git a/contrib/libarchive/libarchive/archive.h b/contrib/libarchive/libarchive/archive.h
index a7de6f6dd85b..19b316a40b73 100644
--- a/contrib/libarchive/libarchive/archive.h
+++ b/contrib/libarchive/libarchive/archive.h
@@ -34,7 +34,7 @@
* assert that ARCHIVE_VERSION_NUMBER >= 2012108.
*/
/* Note: Compiler will complain if this does not match archive_entry.h! */
-#define ARCHIVE_VERSION_NUMBER 3008009
+#define ARCHIVE_VERSION_NUMBER 3008010
#include <sys/stat.h>
#include <stddef.h> /* for wchar_t */
@@ -177,7 +177,7 @@ __LA_DECL int archive_version_number(void);
/*
* Textual name/version of the library, useful for version displays.
*/
-#define ARCHIVE_VERSION_ONLY_STRING "3.8.9"
+#define ARCHIVE_VERSION_ONLY_STRING "3.8.10"
#define ARCHIVE_VERSION_STRING "libarchive " ARCHIVE_VERSION_ONLY_STRING
__LA_DECL const char * archive_version_string(void);
@@ -204,6 +204,7 @@ __LA_DECL const char * archive_liblzo2_version(void);
__LA_DECL const char * archive_libexpat_version(void);
__LA_DECL const char * archive_libbsdxml_version(void);
__LA_DECL const char * archive_libxml2_version(void);
+__LA_DECL const char * archive_xmllite_version(void);
__LA_DECL const char * archive_mbedtls_version(void);
__LA_DECL const char * archive_nettle_version(void);
__LA_DECL const char * archive_openssl_version(void);
@@ -273,7 +274,8 @@ typedef la_int64_t archive_skip_callback(struct archive *,
/* Seeks to specified location in the file and returns the position.
* Whence values are SEEK_SET, SEEK_CUR, SEEK_END from stdio.h.
- * Return ARCHIVE_FATAL if the seek fails for any reason.
+ * Return ARCHIVE_FAILED if the seek failed in a way that keeps its
+ * current read position, ARCHIVE_FATAL for any other error reason.
*/
typedef la_int64_t archive_seek_callback(struct archive *,
void *_client_data, la_int64_t offset, int whence);
@@ -647,7 +649,7 @@ __LA_DECL la_int64_t archive_seek_data(struct archive *, la_int64_t, int);
* A zero-copy version of archive_read_data that also exposes the file offset
* of each returned block. Note that the client has no way to specify
* the desired size of the block. The API does guarantee that offsets will
- * be strictly increasing and that returned blocks will not overlap.
+ * be increasing and that returned blocks will not overlap.
*/
__LA_DECL int archive_read_data_block(struct archive *a,
const void **buff, size_t *size, la_int64_t *offset);
diff --git a/contrib/libarchive/libarchive/archive_blake2.h b/contrib/libarchive/libarchive/archive_blake2.h
index 8f6b5e9221f4..b8cf2e8e7153 100644
--- a/contrib/libarchive/libarchive/archive_blake2.h
+++ b/contrib/libarchive/libarchive/archive_blake2.h
@@ -19,6 +19,19 @@
#include <stddef.h>
#include <stdint.h>
*** 25199 LINES SKIPPED ***