git: 6c7993ffba96 - stable/13 - libarchive: merge from vendor branch

From: Martin Matuska <mm_at_FreeBSD.org>
Date: Sun, 27 Oct 2024 10:51:51 UTC
The branch stable/13 has been updated by mm:

URL: https://cgit.FreeBSD.org/src/commit/?id=6c7993ffba96f56e5416a2726e5f2de209fecec7

commit 6c7993ffba96f56e5416a2726e5f2de209fecec7
Author:     Martin Matuska <mm@FreeBSD.org>
AuthorDate: 2024-10-20 08:22:09 +0000
Commit:     Martin Matuska <mm@FreeBSD.org>
CommitDate: 2024-10-27 09:43:05 +0000

    libarchive: merge from vendor branch
    
    Libarchive 3.7.7
    
    Security fixes:
     #2158 rpm: calculate huge header sizes correctly
     #2160 util: fix out of boundary access in mktemp functions
     #2168 uu: stop processing if lines are too long
     #2174 lzop: prevent integer overflow
     #2172 rar4: protect copy_from_lzss_window_to_unp() (CVE-2024-20696)
     #2175 unzip: unify EOF handling
     #2179 rar4: fix out of boundary access with large files
     #2203 rar4: fix OOB access with unicode filenames
     #2210 rar4: add boundary checks to rgb filter
     #2248 rar4: fix OOB in delta filter
     #2249 rar4: fix OOB in audio filter
     #2256 fix multiple vulnerabilities identified by SAST
     #2258 cpio: ignore out-of-range gid/uid/size/ino and harden AFIO parsing
     #2265 rar5: clear 'data ready' cache on window buffer reallocs
     #2269 rar4: fix CVE-2024-26256 (CVE-2024-26256)
     #2330 iso: be more cautious about parsing ISO-9660 timestamps
     #2343 tar: clean up linkpath between entries
     #2364 tar: don't crash on truncated tar archives
     #2366 gzip: prevent a hang when processing a malformed gzip inside a gzip
     #2377 tar: fix two leaks in tar header parsing
    
    Important bugfixes:
     #2096 rar5: report encrypted entries
     #2150 xar: fix another infinite loop and expat error handling
     #2173 shar: check strdup return value
     #2161 lha: fix integer truncation on 32-bit systems
     #2338 tar: fix memory leaks when processing symlinks or parsing pax headers
     #2245 7zip: fix issue when skipping first file in 7zip archive that
           is a multiple of 65536 bytes
     #2252 7-zip: read/write symlink paths as UTF-8
     #2259 rar5: don't try to read rediculously long names
     #2290 ar: fix archive entries having no type
     #2360 tar: fix truncation of entry pathnames in specific archives
    
    CVE:            CVE-2024-20696, CVE-2024-26256
    
    (cherry picked from commit bd66c1b43e33540205dbc1187c2f2a15c58b57ba)
---
 contrib/libarchive/NEWS                            |    6 +
 contrib/libarchive/cat/bsdcat.1                    |   26 +-
 contrib/libarchive/cat/bsdcat.c                    |   22 +-
 contrib/libarchive/cat/bsdcat.h                    |   22 +-
 contrib/libarchive/cat/bsdcat_platform.h           |   24 +-
 contrib/libarchive/cat/cmdline.c                   |   22 +-
 contrib/libarchive/cat/test/test.h                 |   22 +-
 contrib/libarchive/cat/test/test_0.c               |   22 +-
 contrib/libarchive/cat/test/test_empty_gz.c        |   22 +-
 contrib/libarchive/cat/test/test_empty_lz4.c       |   22 +-
 contrib/libarchive/cat/test/test_empty_xz.c        |   22 +-
 contrib/libarchive/cat/test/test_empty_zstd.c      |   22 +-
 contrib/libarchive/cat/test/test_error.c           |   22 +-
 contrib/libarchive/cat/test/test_error_mixed.c     |   22 +-
 contrib/libarchive/cat/test/test_expand_Z.c        |   22 +-
 contrib/libarchive/cat/test/test_expand_bz2.c      |   22 +-
 contrib/libarchive/cat/test/test_expand_gz.c       |   22 +-
 contrib/libarchive/cat/test/test_expand_lz4.c      |   22 +-
 contrib/libarchive/cat/test/test_expand_mixed.c    |   22 +-
 contrib/libarchive/cat/test/test_expand_plain.c    |   22 +-
 contrib/libarchive/cat/test/test_expand_xz.c       |   22 +-
 contrib/libarchive/cat/test/test_expand_zstd.c     |   22 +-
 contrib/libarchive/cat/test/test_help.c            |   22 +-
 contrib/libarchive/cat/test/test_stdin.c           |   22 +-
 contrib/libarchive/cat/test/test_version.c         |   22 +-
 contrib/libarchive/cpio/bsdcpio.1                  |   24 +-
 contrib/libarchive/cpio/cmdline.c                  |   76 +-
 contrib/libarchive/cpio/cpio.c                     |   70 +-
 contrib/libarchive/cpio/cpio.h                     |   30 +-
 contrib/libarchive/cpio/cpio_platform.h            |   22 +-
 contrib/libarchive/cpio/test/test.h                |   22 +-
 contrib/libarchive/cpio/test/test_0.c              |   22 +-
 contrib/libarchive/cpio/test/test_basic.c          |   22 +-
 contrib/libarchive/cpio/test/test_cmdline.c        |   22 +-
 contrib/libarchive/cpio/test/test_extract_cpio_Z.c |   22 +-
 .../cpio/test/test_extract_cpio_absolute_paths.c   |   53 +
 .../libarchive/cpio/test/test_extract_cpio_bz2.c   |   22 +-
 .../libarchive/cpio/test/test_extract_cpio_grz.c   |   22 +-
 .../libarchive/cpio/test/test_extract_cpio_gz.c    |   22 +-
 .../libarchive/cpio/test/test_extract_cpio_lrz.c   |   22 +-
 .../libarchive/cpio/test/test_extract_cpio_lz.c    |   22 +-
 .../libarchive/cpio/test/test_extract_cpio_lz4.c   |   22 +-
 .../libarchive/cpio/test/test_extract_cpio_lzma.c  |   22 +-
 .../libarchive/cpio/test/test_extract_cpio_lzo.c   |   22 +-
 .../libarchive/cpio/test/test_extract_cpio_xz.c    |   22 +-
 .../libarchive/cpio/test/test_extract_cpio_zstd.c  |   22 +-
 contrib/libarchive/cpio/test/test_format_newc.c    |   28 +-
 contrib/libarchive/cpio/test/test_gcpio_compat.c   |   22 +-
 contrib/libarchive/cpio/test/test_missing_file.c   |   22 +-
 contrib/libarchive/cpio/test/test_option_0.c       |   22 +-
 contrib/libarchive/cpio/test/test_option_B_upper.c |   22 +-
 contrib/libarchive/cpio/test/test_option_C_upper.c |   22 +-
 contrib/libarchive/cpio/test/test_option_J_upper.c |   22 +-
 contrib/libarchive/cpio/test/test_option_L_upper.c |   22 +-
 contrib/libarchive/cpio/test/test_option_Z_upper.c |   22 +-
 contrib/libarchive/cpio/test/test_option_a.c       |   22 +-
 .../libarchive/cpio/test/test_option_b64encode.c   |   22 +-
 contrib/libarchive/cpio/test/test_option_c.c       |   30 +-
 contrib/libarchive/cpio/test/test_option_d.c       |   24 +-
 contrib/libarchive/cpio/test/test_option_f.c       |   22 +-
 contrib/libarchive/cpio/test/test_option_grzip.c   |   22 +-
 contrib/libarchive/cpio/test/test_option_help.c    |   22 +-
 contrib/libarchive/cpio/test/test_option_l.c       |   22 +-
 contrib/libarchive/cpio/test/test_option_lrzip.c   |   22 +-
 contrib/libarchive/cpio/test/test_option_lz4.c     |   22 +-
 contrib/libarchive/cpio/test/test_option_lzma.c    |   22 +-
 contrib/libarchive/cpio/test/test_option_lzop.c    |   22 +-
 contrib/libarchive/cpio/test/test_option_m.c       |   22 +-
 .../libarchive/cpio/test/test_option_passphrase.c  |   22 +-
 contrib/libarchive/cpio/test/test_option_t.c       |   29 +-
 contrib/libarchive/cpio/test/test_option_u.c       |   22 +-
 .../libarchive/cpio/test/test_option_uuencode.c    |   22 +-
 contrib/libarchive/cpio/test/test_option_version.c |   22 +-
 contrib/libarchive/cpio/test/test_option_xz.c      |   22 +-
 contrib/libarchive/cpio/test/test_option_y.c       |   22 +-
 contrib/libarchive/cpio/test/test_option_z.c       |   22 +-
 contrib/libarchive/cpio/test/test_option_zstd.c    |   22 +-
 contrib/libarchive/cpio/test/test_owner_parse.c    |  112 +-
 .../libarchive/cpio/test/test_passthrough_dotdot.c |   22 +-
 .../cpio/test/test_passthrough_reverse.c           |   22 +-
 contrib/libarchive/libarchive/archive.h            |    4 +-
 contrib/libarchive/libarchive/archive_acl.c        |   71 +-
 .../libarchive/libarchive/archive_acl_private.h    |    2 +
 contrib/libarchive/libarchive/archive_crc32.h      |    5 +
 contrib/libarchive/libarchive/archive_cryptor.c    |    4 +-
 .../libarchive/archive_cryptor_private.h           |    2 +-
 contrib/libarchive/libarchive/archive_entry.c      |  300 ++-
 contrib/libarchive/libarchive/archive_entry.h      |    8 +-
 .../libarchive/archive_entry_link_resolver.c       |   15 +
 .../libarchive/libarchive/archive_entry_perms.3    |    1 +
 .../libarchive/libarchive/archive_entry_private.h  |    4 +-
 .../libarchive/libarchive/archive_entry_sparse.c   |    2 +-
 .../libarchive/libarchive/archive_entry_xattr.c    |    2 +-
 contrib/libarchive/libarchive/archive_hmac.c       |    2 +-
 .../libarchive/libarchive/archive_hmac_private.h   |    2 +-
 contrib/libarchive/libarchive/archive_match.c      |    2 +-
 .../libarchive/archive_openssl_evp_private.h       |    2 +-
 .../libarchive/archive_openssl_hmac_private.h      |    2 +-
 contrib/libarchive/libarchive/archive_ppmd7.c      |    2 +-
 contrib/libarchive/libarchive/archive_ppmd8.c      |    7 +-
 contrib/libarchive/libarchive/archive_private.h    |    6 +-
 contrib/libarchive/libarchive/archive_read.c       |    8 +-
 .../libarchive/archive_read_append_filter.c        |    8 +-
 .../libarchive/archive_read_disk_entry_from_file.c |    1 +
 .../libarchive/archive_read_disk_posix.c           |    2 +-
 .../libarchive/libarchive/archive_read_extract2.c  |    2 +-
 .../libarchive/libarchive/archive_read_open_fd.c   |    2 +-
 .../libarchive/libarchive/archive_read_open_file.c |    2 +-
 .../libarchive/archive_read_open_filename.c        |    4 +-
 .../libarchive/archive_read_open_memory.c          |    2 +-
 .../libarchive/archive_read_support_filter_bzip2.c |    4 +-
 .../archive_read_support_filter_compress.c         |    2 +-
 .../libarchive/archive_read_support_filter_gzip.c  |   18 +-
 .../libarchive/archive_read_support_filter_lz4.c   |    6 +-
 .../libarchive/archive_read_support_filter_lzop.c  |    5 +-
 .../archive_read_support_filter_program.c          |    6 +-
 .../libarchive/archive_read_support_filter_rpm.c   |   45 +-
 .../libarchive/archive_read_support_filter_uu.c    |   16 +-
 .../libarchive/archive_read_support_filter_xz.c    |    4 +-
 .../libarchive/archive_read_support_filter_zstd.c  |    4 +-
 .../libarchive/archive_read_support_format_7zip.c  |   93 +-
 .../libarchive/archive_read_support_format_ar.c    |   10 +-
 .../libarchive/archive_read_support_format_cab.c   |   12 +-
 .../libarchive/archive_read_support_format_cpio.c  |   32 +-
 .../archive_read_support_format_iso9660.c          |  305 ++-
 .../libarchive/archive_read_support_format_lha.c   |   11 +-
 .../libarchive/archive_read_support_format_mtree.c |    2 +-
 .../libarchive/archive_read_support_format_rar.c   |  128 +-
 .../libarchive/archive_read_support_format_rar5.c  |  171 +-
 .../libarchive/archive_read_support_format_raw.c   |    2 +-
 .../libarchive/archive_read_support_format_tar.c   | 2221 +++++++++++++-------
 .../libarchive/archive_read_support_format_xar.c   |   32 +-
 .../libarchive/archive_read_support_format_zip.c   |   45 +-
 contrib/libarchive/libarchive/archive_string.c     |   86 +-
 contrib/libarchive/libarchive/archive_util.c       |   16 +-
 contrib/libarchive/libarchive/archive_write.c      |   19 +-
 .../archive_write_add_filter_b64encode.c           |    6 +-
 .../libarchive/archive_write_add_filter_bzip2.c    |    5 +-
 .../libarchive/archive_write_add_filter_compress.c |    4 +-
 .../libarchive/archive_write_add_filter_gzip.c     |    3 +-
 .../libarchive/archive_write_add_filter_uuencode.c |    2 +-
 .../libarchive/archive_write_add_filter_xz.c       |    5 +-
 .../libarchive/archive_write_add_filter_zstd.c     |    3 +-
 .../libarchive/archive_write_disk_posix.c          |   16 +-
 .../libarchive/libarchive/archive_write_open_fd.c  |    2 +-
 .../libarchive/archive_write_open_file.c           |    2 +-
 .../libarchive/archive_write_open_filename.c       |    2 +-
 .../libarchive/archive_write_open_memory.c         |    2 +-
 .../libarchive/archive_write_set_format_7zip.c     |   16 +-
 .../libarchive/archive_write_set_format_ar.c       |    6 +-
 .../archive_write_set_format_cpio_binary.c         |    5 +-
 .../archive_write_set_format_cpio_newc.c           |    2 +-
 .../libarchive/archive_write_set_format_cpio_odc.c |    5 +-
 .../libarchive/archive_write_set_format_gnutar.c   |    6 +-
 .../libarchive/archive_write_set_format_iso9660.c  |    2 +-
 .../libarchive/archive_write_set_format_pax.c      |   24 +-
 .../libarchive/archive_write_set_format_raw.c      |    2 +-
 .../libarchive/archive_write_set_format_shar.c     |   10 +-
 .../libarchive/archive_write_set_format_ustar.c    |    8 +-
 .../libarchive/archive_write_set_format_v7tar.c    |    4 +-
 .../libarchive/archive_write_set_format_xar.c      |   26 +-
 .../libarchive/archive_write_set_format_zip.c      |   10 +-
 .../libarchive/test/test_7zip_filename_encoding.c  |  100 +
 contrib/libarchive/libarchive/test/test_ar_mode.c  |   40 +
 .../libarchive/test/test_archive_match_time.c      |   60 +-
 .../libarchive/libarchive/test/test_archive_read.c |   63 +
 .../test/test_archive_read_multiple_data_objects.c |   23 +-
 .../libarchive/test/test_archive_string.c          |    2 +-
 .../test/test_archive_string_conversion.c          |  135 ++
 .../test/test_archive_write_add_filter_by_name.c   |    2 +-
 .../libarchive/libarchive/test/test_compat_lzip.c  |    2 +-
 .../test/test_compat_solaris_pax_sparse.c          |    2 +-
 contrib/libarchive/libarchive/test/test_entry.c    |   14 +-
 .../test/test_gnutar_filename_encoding.c           |  102 +
 .../libarchive/test/test_link_resolver.c           |   45 +
 .../libarchive/test/test_pax_filename_encoding.c   |  152 ++
 .../test/test_read_filter_gzip_recursive.c         |   50 +
 .../test/test_read_filter_gzip_recursive.gz.uu     |   19 +
 .../libarchive/test/test_read_format_7zip.c        |   44 +
 .../test_read_format_7zip_extract_second.7z.uu     |   11 +
 .../libarchive/test/test_read_format_cpio_afio.c   |   30 +-
 .../libarchive/test/test_read_format_huge_rpm.c    |   50 +
 .../test/test_read_format_huge_rpm.rpm.uu          |  244 +++
 .../test/test_read_format_iso_3.iso.Z.uu           |   40 +
 .../libarchive/test/test_read_format_iso_Z.c       |  122 +-
 .../libarchive/test/test_read_format_mtree.c       |    2 +-
 .../test/test_read_format_rar4_encrypted.rar.uu    |   10 +
 ...est_read_format_rar4_encrypted_filenames.rar.uu |   14 +
 .../test_read_format_rar4_solid_encrypted.rar.uu   |   11 +
 ...ad_format_rar4_solid_encrypted_filenames.rar.uu |   13 +
 .../libarchive/test/test_read_format_rar5.c        |   39 +-
 ...read_format_rar5_data_ready_pointer_leak.rar.uu |   28 +
 .../test/test_read_format_rar5_encrypted.rar.uu    |   12 +
 ...est_read_format_rar5_encrypted_filenames.rar.uu |   19 +
 .../test_read_format_rar5_solid_encrypted.rar.uu   |   14 +
 ...ad_format_rar5_solid_encrypted_filenames.rar.uu |   18 +
 .../test/test_read_format_rar_encryption.c         |  176 ++
 .../libarchive/test/test_read_format_tar.c         |    2 +-
 .../test/test_read_format_tar_pax_large_attr.c     |   65 +
 .../test_read_format_tar_pax_large_attr.tar.Z.uu   |  149 ++
 .../libarchive/test/test_read_format_xar.c         |   37 +-
 ..._read_format_xar_duplicate_filename_node.xar.uu |   14 +
 .../libarchive/test/test_read_format_zip_nested.c  |    2 +-
 ...t_read_format_zip_traditional_encryption_data.c |    2 +-
 .../test/test_read_format_zip_winzip_aes.c         |    2 +-
 .../test/test_read_format_zip_winzip_aes_large.c   |    2 +-
 .../libarchive/test/test_read_truncated_filter.c   |    4 +-
 .../libarchive/libarchive/test/test_sparse_basic.c |   17 +-
 .../libarchive/libarchive/test/test_tar_large.c    |    2 +-
 .../libarchive/test/test_ustar_filename_encoding.c |  102 +
 .../test/test_write_disk_secure_noabsolutepaths.c  |   88 +
 .../libarchive/test/test_write_filter_b64encode.c  |    4 +-
 .../libarchive/test/test_write_filter_bzip2.c      |    4 +-
 .../libarchive/test/test_write_filter_compress.c   |    4 +-
 .../libarchive/test/test_write_filter_gzip.c       |    4 +-
 .../test/test_write_filter_gzip_timestamp.c        |    4 +-
 .../libarchive/test/test_write_filter_lrzip.c      |    4 +-
 .../libarchive/test/test_write_filter_lz4.c        |    8 +-
 .../libarchive/test/test_write_filter_lzip.c       |    4 +-
 .../libarchive/test/test_write_filter_lzma.c       |    4 +-
 .../libarchive/test/test_write_filter_lzop.c       |    4 +-
 .../libarchive/test/test_write_filter_uuencode.c   |    4 +-
 .../libarchive/test/test_write_filter_xz.c         |    4 +-
 .../libarchive/test/test_write_filter_zstd.c       |   12 +-
 .../test/test_write_format_iso9660_filename.c      |    2 +-
 .../libarchive/test/test_write_format_zip.c        |    6 +-
 .../test/test_write_format_zip_entry_size_unset.c  |    2 +-
 .../libarchive/test/test_write_format_zip_large.c  |    2 +-
 .../libarchive/test/test_write_format_zip_stream.c |    5 +
 .../test/test_write_format_zip_windows_path.c      |  100 +
 .../libarchive/test/test_zip_filename_encoding.c   |   95 +
 contrib/libarchive/tar/bsdtar.1                    |   24 +-
 contrib/libarchive/tar/bsdtar.c                    |   25 +-
 contrib/libarchive/tar/bsdtar.h                    |   22 +-
 contrib/libarchive/tar/bsdtar_platform.h           |   24 +-
 contrib/libarchive/tar/cmdline.c                   |   22 +-
 contrib/libarchive/tar/creation_set.c              |   24 +-
 contrib/libarchive/tar/read.c                      |   22 +-
 contrib/libarchive/tar/subst.c                     |   22 +-
 contrib/libarchive/tar/test/test.h                 |   22 +-
 contrib/libarchive/tar/test/test_0.c               |   22 +-
 contrib/libarchive/tar/test/test_basic.c           |   22 +-
 contrib/libarchive/tar/test/test_copy.c            |   58 +-
 contrib/libarchive/tar/test/test_empty_mtree.c     |   22 +-
 contrib/libarchive/tar/test/test_extract_tar_Z.c   |   22 +-
 contrib/libarchive/tar/test/test_extract_tar_bz2.c |   22 +-
 contrib/libarchive/tar/test/test_extract_tar_grz.c |   22 +-
 contrib/libarchive/tar/test/test_extract_tar_gz.c  |   22 +-
 contrib/libarchive/tar/test/test_extract_tar_lrz.c |   22 +-
 contrib/libarchive/tar/test/test_extract_tar_lz.c  |   22 +-
 contrib/libarchive/tar/test/test_extract_tar_lz4.c |   22 +-
 .../libarchive/tar/test/test_extract_tar_lzma.c    |   22 +-
 contrib/libarchive/tar/test/test_extract_tar_lzo.c |   22 +-
 contrib/libarchive/tar/test/test_extract_tar_xz.c  |   22 +-
 .../libarchive/tar/test/test_extract_tar_zstd.c    |   22 +-
 contrib/libarchive/tar/test/test_format_newc.c     |   22 +-
 contrib/libarchive/tar/test/test_help.c            |   22 +-
 contrib/libarchive/tar/test/test_leading_slash.c   |   22 +-
 contrib/libarchive/tar/test/test_missing_file.c    |   22 +-
 contrib/libarchive/tar/test/test_option_C_mtree.c  |   30 +-
 contrib/libarchive/tar/test/test_option_C_upper.c  |   22 +-
 contrib/libarchive/tar/test/test_option_H_upper.c  |   40 +-
 contrib/libarchive/tar/test/test_option_L_upper.c  |   40 +-
 contrib/libarchive/tar/test/test_option_O_upper.c  |   22 +-
 contrib/libarchive/tar/test/test_option_P.c        |   82 +
 contrib/libarchive/tar/test/test_option_T_upper.c  |   22 +-
 contrib/libarchive/tar/test/test_option_U_upper.c  |   22 +-
 contrib/libarchive/tar/test/test_option_X_upper.c  |   22 +-
 contrib/libarchive/tar/test/test_option_a.c        |   22 +-
 contrib/libarchive/tar/test/test_option_acls.c     |   22 +-
 contrib/libarchive/tar/test/test_option_b.c        |   22 +-
 .../libarchive/tar/test/test_option_b64encode.c    |   22 +-
 contrib/libarchive/tar/test/test_option_exclude.c  |   22 +-
 .../libarchive/tar/test/test_option_exclude_vcs.c  |   24 +-
 contrib/libarchive/tar/test/test_option_fflags.c   |   24 +-
 .../libarchive/tar/test/test_option_gid_gname.c    |   22 +-
 contrib/libarchive/tar/test/test_option_group.c    |   22 +-
 contrib/libarchive/tar/test/test_option_grzip.c    |   22 +-
 .../libarchive/tar/test/test_option_ignore_zeros.c |   31 +-
 contrib/libarchive/tar/test/test_option_j.c        |   22 +-
 contrib/libarchive/tar/test/test_option_k.c        |   22 +-
 .../tar/test/test_option_keep_newer_files.c        |   22 +-
 contrib/libarchive/tar/test/test_option_lrzip.c    |   22 +-
 contrib/libarchive/tar/test/test_option_lz4.c      |   22 +-
 contrib/libarchive/tar/test/test_option_lzma.c     |   22 +-
 contrib/libarchive/tar/test/test_option_lzop.c     |   22 +-
 contrib/libarchive/tar/test/test_option_n.c        |   22 +-
 .../libarchive/tar/test/test_option_newer_than.c   |   22 +-
 contrib/libarchive/tar/test/test_option_nodump.c   |   22 +-
 .../libarchive/tar/test/test_option_older_than.c   |   22 +-
 contrib/libarchive/tar/test/test_option_owner.c    |   22 +-
 .../libarchive/tar/test/test_option_passphrase.c   |   22 +-
 contrib/libarchive/tar/test/test_option_q.c        |   22 +-
 contrib/libarchive/tar/test/test_option_r.c        |   22 +-
 contrib/libarchive/tar/test/test_option_s.c        |   22 +-
 .../libarchive/tar/test/test_option_safe_writes.c  |   22 +-
 .../libarchive/tar/test/test_option_uid_uname.c    |   22 +-
 contrib/libarchive/tar/test/test_option_uuencode.c |   22 +-
 contrib/libarchive/tar/test/test_option_xattrs.c   |   24 +-
 contrib/libarchive/tar/test/test_option_xz.c       |   22 +-
 contrib/libarchive/tar/test/test_option_z.c        |   22 +-
 contrib/libarchive/tar/test/test_option_zstd.c     |   22 +-
 contrib/libarchive/tar/test/test_patterns.c        |   22 +-
 contrib/libarchive/tar/test/test_print_longpath.c  |   22 +-
 contrib/libarchive/tar/test/test_stdio.c           |   22 +-
 .../libarchive/tar/test/test_strip_components.c    |   22 +-
 contrib/libarchive/tar/test/test_symlink_dir.c     |   22 +-
 contrib/libarchive/tar/test/test_version.c         |   22 +-
 contrib/libarchive/tar/util.c                      |   42 +-
 contrib/libarchive/tar/write.c                     |   35 +-
 contrib/libarchive/test_utils/test_common.h        |    5 +-
 contrib/libarchive/test_utils/test_main.c          |  101 +-
 contrib/libarchive/unzip/bsdunzip.1                |   25 +-
 contrib/libarchive/unzip/bsdunzip.c                |   49 +-
 contrib/libarchive/unzip/bsdunzip.h                |   22 +-
 contrib/libarchive/unzip/bsdunzip_platform.h       |   24 +-
 contrib/libarchive/unzip/cmdline.c                 |   22 +-
 contrib/libarchive/unzip/la_getline.c              |   26 +-
 contrib/libarchive/unzip/test/test.h               |   22 +-
 contrib/libarchive/unzip/test/test_0.c             |   22 +-
 contrib/libarchive/unzip/test/test_C.c             |   23 +-
 contrib/libarchive/unzip/test/test_I.c             |   40 +-
 contrib/libarchive/unzip/test/test_L.c             |   23 +-
 contrib/libarchive/unzip/test/test_P_encryption.c  |   25 +-
 contrib/libarchive/unzip/test/test_Z1.c            |   23 +-
 contrib/libarchive/unzip/test/test_basic.c         |   23 +-
 contrib/libarchive/unzip/test/test_d.c             |   23 +-
 contrib/libarchive/unzip/test/test_doubledash.c    |   23 +-
 contrib/libarchive/unzip/test/test_glob.c          |   23 +-
 contrib/libarchive/unzip/test/test_j.c             |   23 +-
 contrib/libarchive/unzip/test/test_n.c             |   25 +-
 contrib/libarchive/unzip/test/test_not_exist.c     |   25 +-
 contrib/libarchive/unzip/test/test_o.c             |   25 +-
 contrib/libarchive/unzip/test/test_p.c             |   23 +-
 contrib/libarchive/unzip/test/test_q.c             |   23 +-
 contrib/libarchive/unzip/test/test_singlefile.c    |   23 +-
 contrib/libarchive/unzip/test/test_t.c             |   23 +-
 contrib/libarchive/unzip/test/test_t_bad.c         |   23 +-
 contrib/libarchive/unzip/test/test_version.c       |   22 +-
 contrib/libarchive/unzip/test/test_x.c             |   23 +-
 lib/libarchive/tests/Makefile                      |   24 +
 usr.bin/cpio/tests/Makefile                        |    1 +
 usr.bin/tar/tests/Makefile                         |    1 +
 343 files changed, 5857 insertions(+), 5333 deletions(-)

diff --git a/contrib/libarchive/NEWS b/contrib/libarchive/NEWS
index ebdbb2a978ec..6af50e4e4033 100644
--- a/contrib/libarchive/NEWS
+++ b/contrib/libarchive/NEWS
@@ -1,3 +1,9 @@
+Oct 13, 2024: libarchive 3.7.7 released
+
+Sep 23, 2024: libarchive 3.7.6 released
+
+Sep 13, 2024: libarchive 3.7.5 released
+
 Apr 26, 2024: libarchive 3.7.4 released
 
 Apr 08, 2024: libarchive 3.7.3 released
diff --git a/contrib/libarchive/cat/bsdcat.1 b/contrib/libarchive/cat/bsdcat.1
index 9fa66d60e1e6..b34a0c1c988d 100644
--- a/contrib/libarchive/cat/bsdcat.1
+++ b/contrib/libarchive/cat/bsdcat.1
@@ -1,26 +1,8 @@
-.\" Copyright (c) 2011-2014, Mike Kazantsev
-.\" 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.
+.\" SPDX-License-Identifier: BSD-2-Clause
 .\"
-.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``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 OR CONTRIBUTORS 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.
+.\" Copyright (c) 2011-2014, Mike Kazantsev
+.\" All rights reserved.
 .\"
 .Dd March 1, 2014
 .Dt BSDCAT 1
@@ -39,7 +21,7 @@ expands files to standard output.
 .Nm
 typically takes a filename as an argument or reads standard input when used in a
 pipe.
-In both cases decompressed data it written to standard output.
+In both cases decompressed data is written to standard output.
 .Sh EXAMPLES
 To decompress a file:
 .Pp
diff --git a/contrib/libarchive/cat/bsdcat.c b/contrib/libarchive/cat/bsdcat.c
index 19d3de65cea4..731621fa9b75 100644
--- a/contrib/libarchive/cat/bsdcat.c
+++ b/contrib/libarchive/cat/bsdcat.c
@@ -1,26 +1,8 @@
 /*-
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
  * Copyright (c) 2011-2014, Mike Kazantsev
  * 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 "bsdcat_platform.h"
diff --git a/contrib/libarchive/cat/bsdcat.h b/contrib/libarchive/cat/bsdcat.h
index 504757a44040..6726f78e8453 100644
--- a/contrib/libarchive/cat/bsdcat.h
+++ b/contrib/libarchive/cat/bsdcat.h
@@ -1,26 +1,8 @@
 /*-
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
  * Copyright (c) 2014, Mike Kazantsev
  * 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 BSDCAT_H_INCLUDED
diff --git a/contrib/libarchive/cat/bsdcat_platform.h b/contrib/libarchive/cat/bsdcat_platform.h
index 78a6113e6f01..940214f2ecd6 100644
--- a/contrib/libarchive/cat/bsdcat_platform.h
+++ b/contrib/libarchive/cat/bsdcat_platform.h
@@ -1,26 +1,8 @@
 /*-
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
  * 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.
  */
 
 /*
@@ -58,7 +40,7 @@
 #define __LA_NORETURN       __attribute__((__noreturn__))
 #elif defined(_MSC_VER)
 #define __LA_NORETURN __declspec(noreturn)
-#else 
+#else
 #define __LA_NORETURN
 #endif
 
diff --git a/contrib/libarchive/cat/cmdline.c b/contrib/libarchive/cat/cmdline.c
index 851b63de06e5..8ecd74aa95e4 100644
--- a/contrib/libarchive/cat/cmdline.c
+++ b/contrib/libarchive/cat/cmdline.c
@@ -1,26 +1,8 @@
 /*-
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
  * Copyright (c) 2003-2008 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.
  */
 
 /*
diff --git a/contrib/libarchive/cat/test/test.h b/contrib/libarchive/cat/test/test.h
index ec83d476b6b8..b852437ca430 100644
--- a/contrib/libarchive/cat/test/test.h
+++ b/contrib/libarchive/cat/test/test.h
@@ -1,26 +1,8 @@
 /*
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
  * Copyright (c) 2003-2006 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.
  */
 
 /* Every test program should #include "test.h" as the first thing. */
diff --git a/contrib/libarchive/cat/test/test_0.c b/contrib/libarchive/cat/test/test_0.c
index c806c24356c0..07f5fc60cf35 100644
--- a/contrib/libarchive/cat/test/test_0.c
+++ b/contrib/libarchive/cat/test/test_0.c
@@ -1,26 +1,8 @@
 /*-
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
  * 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 "test.h"
 
diff --git a/contrib/libarchive/cat/test/test_empty_gz.c b/contrib/libarchive/cat/test/test_empty_gz.c
index 6181f93b4d28..0ca835627bf5 100644
--- a/contrib/libarchive/cat/test/test_empty_gz.c
+++ b/contrib/libarchive/cat/test/test_empty_gz.c
@@ -1,26 +1,8 @@
 /*-
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
  * Copyright (c) 2014 Sebastian Freundt
  * 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"
 
diff --git a/contrib/libarchive/cat/test/test_empty_lz4.c b/contrib/libarchive/cat/test/test_empty_lz4.c
index 9d98e9cfd390..ed4f2894fb4f 100644
--- a/contrib/libarchive/cat/test/test_empty_lz4.c
+++ b/contrib/libarchive/cat/test/test_empty_lz4.c
@@ -1,26 +1,8 @@
 /*-
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
  * Copyright (c) 2014 Sebastian Freundt
  * 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"
 
diff --git a/contrib/libarchive/cat/test/test_empty_xz.c b/contrib/libarchive/cat/test/test_empty_xz.c
index 368ffb574e50..591ab2410ce4 100644
--- a/contrib/libarchive/cat/test/test_empty_xz.c
+++ b/contrib/libarchive/cat/test/test_empty_xz.c
@@ -1,26 +1,8 @@
 /*-
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
  * Copyright (c) 2014 Sebastian Freundt
  * 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"
 
diff --git a/contrib/libarchive/cat/test/test_empty_zstd.c b/contrib/libarchive/cat/test/test_empty_zstd.c
index c2d5ea106fa1..b0f25bf1cacd 100644
--- a/contrib/libarchive/cat/test/test_empty_zstd.c
+++ b/contrib/libarchive/cat/test/test_empty_zstd.c
@@ -1,26 +1,8 @@
 /*-
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
  * Copyright (c) 2017 Sean Purcell
  * 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"
 
diff --git a/contrib/libarchive/cat/test/test_error.c b/contrib/libarchive/cat/test/test_error.c
index 918af01be2dc..3e1a74a38820 100644
--- a/contrib/libarchive/cat/test/test_error.c
+++ b/contrib/libarchive/cat/test/test_error.c
@@ -1,26 +1,8 @@
 /*-
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
  * Copyright (c) 2014 Mike Kazantsev
  * 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"
 
diff --git a/contrib/libarchive/cat/test/test_error_mixed.c b/contrib/libarchive/cat/test/test_error_mixed.c
index 7d94fce467aa..01cb9f0520dd 100644
--- a/contrib/libarchive/cat/test/test_error_mixed.c
+++ b/contrib/libarchive/cat/test/test_error_mixed.c
@@ -1,26 +1,8 @@
 /*-
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
  * Copyright (c) 2014 Mike Kazantsev
  * 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"
 
diff --git a/contrib/libarchive/cat/test/test_expand_Z.c b/contrib/libarchive/cat/test/test_expand_Z.c
index d48d4972ebee..f34f38ce0385 100644
--- a/contrib/libarchive/cat/test/test_expand_Z.c
+++ b/contrib/libarchive/cat/test/test_expand_Z.c
@@ -1,26 +1,8 @@
 /*-
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
  * Copyright (c) 2014 Mike Kazantsev
  * 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"
 
diff --git a/contrib/libarchive/cat/test/test_expand_bz2.c b/contrib/libarchive/cat/test/test_expand_bz2.c
index 82f074b341c8..8f3bb3f24a46 100644
--- a/contrib/libarchive/cat/test/test_expand_bz2.c
+++ b/contrib/libarchive/cat/test/test_expand_bz2.c
@@ -1,27 +1,9 @@
 /*-
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
  * Copyright (c) 2014 Mike Kazantsev
  * Copyright (c) 2012 Michihiro NAKAJIMA
  * 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"
 
diff --git a/contrib/libarchive/cat/test/test_expand_gz.c b/contrib/libarchive/cat/test/test_expand_gz.c
index 18b715c66ebb..1f6f1cfddbac 100644
--- a/contrib/libarchive/cat/test/test_expand_gz.c
+++ b/contrib/libarchive/cat/test/test_expand_gz.c
@@ -1,27 +1,9 @@
 /*-
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
  * Copyright (c) 2014 Mike Kazantsev
  * Copyright (c) 2012 Michihiro NAKAJIMA
  * 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"
 
diff --git a/contrib/libarchive/cat/test/test_expand_lz4.c b/contrib/libarchive/cat/test/test_expand_lz4.c
index 1b1d2106459d..efc2baad59ed 100644
--- a/contrib/libarchive/cat/test/test_expand_lz4.c
+++ b/contrib/libarchive/cat/test/test_expand_lz4.c
@@ -1,27 +1,9 @@
 /*-
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
  * Copyright (c) 2014 Mike Kazantsev
  * Copyright (c) 2012, 2014 Michihiro NAKAJIMA
  * 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,
*** 18475 LINES SKIPPED ***