aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.cirrus.yml12
-rw-r--r--.github/dependabot.yml15
-rw-r--r--.github/workflows/ci.yml45
-rw-r--r--.github/workflows/cifuzz.yml6
-rw-r--r--.github/workflows/codeql.yml43
-rw-r--r--.github/workflows/scorecard.yml65
-rw-r--r--.gitignore5
-rw-r--r--CMakeLists.txt177
-rw-r--r--Makefile.am159
-rw-r--r--NEWS14
-rw-r--r--README.md21
-rw-r--r--SECURITY.md19
-rwxr-xr-xbuild/ci/build.sh3
-rwxr-xr-xbuild/ci/github_actions/ci.cmd41
-rw-r--r--build/cmake/FindLIBGCC.cmake (renamed from build/cmake/FindLibGCC.cmake)0
-rw-r--r--build/cmake/FindMbedTLS.cmake2
-rw-r--r--build/cmake/FindPCRE2POSIX.cmake34
-rw-r--r--build/cmake/config.h.in133
-rw-r--r--build/pkgconfig/libarchive.pc.in1
-rwxr-xr-xbuild/utils/gen_archive_string_composition_h.sh3
-rw-r--r--build/version2
-rw-r--r--cat/bsdcat.12
-rw-r--r--cat/bsdcat.c36
-rw-r--r--cat/bsdcat.h7
-rw-r--r--cat/bsdcat_platform.h24
-rw-r--r--cat/cmdline.c13
-rw-r--r--cat/test/test.h2
-rw-r--r--configure.ac208
-rw-r--r--contrib/android/config/android.h2
-rw-r--r--contrib/android/config/linux_host.h2
-rw-r--r--contrib/android/config/windows_host.h25
-rw-r--r--contrib/archivetest.c19
-rw-r--r--contrib/shar/Makefile2
-rw-r--r--contrib/shar/shar.11
-rw-r--r--contrib/shar/shar.c5
-rw-r--r--contrib/shar/tree.c1
-rw-r--r--contrib/shar/tree.h2
-rw-r--r--contrib/shar/tree_config.h10
-rw-r--r--contrib/untar.c65
-rw-r--r--cpio/bsdcpio.12
-rw-r--r--cpio/cmdline.c1
-rw-r--r--cpio/config_freebsd.h2
-rw-r--r--cpio/cpio.c43
-rw-r--r--cpio/cpio.h2
-rw-r--r--cpio/cpio_platform.h18
-rw-r--r--cpio/cpio_windows.c21
-rw-r--r--cpio/cpio_windows.h2
-rw-r--r--cpio/test/test.h2
-rw-r--r--cpio/test/test_0.c1
-rw-r--r--cpio/test/test_basic.c1
-rw-r--r--cpio/test/test_cmdline.c1
-rw-r--r--cpio/test/test_extract_cpio_Z.c1
-rw-r--r--cpio/test/test_extract_cpio_bz2.c1
-rw-r--r--cpio/test/test_extract_cpio_grz.c1
-rw-r--r--cpio/test/test_extract_cpio_gz.c1
-rw-r--r--cpio/test/test_extract_cpio_lrz.c1
-rw-r--r--cpio/test/test_extract_cpio_lz.c1
-rw-r--r--cpio/test/test_extract_cpio_lz4.c1
-rw-r--r--cpio/test/test_extract_cpio_lzma.c1
-rw-r--r--cpio/test/test_extract_cpio_lzo.c1
-rw-r--r--cpio/test/test_extract_cpio_xz.c1
-rw-r--r--cpio/test/test_extract_cpio_zstd.c1
-rw-r--r--cpio/test/test_format_newc.c1
-rw-r--r--cpio/test/test_gcpio_compat.c1
-rw-r--r--cpio/test/test_gcpio_compat_ref.bin.uu1
-rw-r--r--cpio/test/test_gcpio_compat_ref.crc.uu1
-rw-r--r--cpio/test/test_gcpio_compat_ref.newc.uu1
-rw-r--r--cpio/test/test_gcpio_compat_ref.ustar.uu1
-rw-r--r--cpio/test/test_missing_file.c1
-rw-r--r--cpio/test/test_option_0.c1
-rw-r--r--cpio/test/test_option_B_upper.c2
-rw-r--r--cpio/test/test_option_C_upper.c2
-rw-r--r--cpio/test/test_option_J_upper.c2
-rw-r--r--cpio/test/test_option_L_upper.c1
-rw-r--r--cpio/test/test_option_Z_upper.c1
-rw-r--r--cpio/test/test_option_a.c1
-rw-r--r--cpio/test/test_option_b64encode.c1
-rw-r--r--cpio/test/test_option_c.c7
-rw-r--r--cpio/test/test_option_d.c2
-rw-r--r--cpio/test/test_option_f.c1
-rw-r--r--cpio/test/test_option_f.cpio.uu1
-rw-r--r--cpio/test/test_option_grzip.c1
-rw-r--r--cpio/test/test_option_help.c1
-rw-r--r--cpio/test/test_option_l.c1
-rw-r--r--cpio/test/test_option_lrzip.c1
-rw-r--r--cpio/test/test_option_lz4.c1
-rw-r--r--cpio/test/test_option_lzma.c1
-rw-r--r--cpio/test/test_option_lzop.c1
-rw-r--r--cpio/test/test_option_m.c2
-rw-r--r--cpio/test/test_option_m.cpio.uu1
-rw-r--r--cpio/test/test_option_passphrase.c1
-rw-r--r--cpio/test/test_option_t.c16
-rw-r--r--cpio/test/test_option_t.cpio.uu1
-rw-r--r--cpio/test/test_option_t.stdout.uu1
-rw-r--r--cpio/test/test_option_tv.stdout.uu1
-rw-r--r--cpio/test/test_option_u.c1
-rw-r--r--cpio/test/test_option_uuencode.c1
-rw-r--r--cpio/test/test_option_xz.c1
-rw-r--r--cpio/test/test_option_y.c1
-rw-r--r--cpio/test/test_option_z.c1
-rw-r--r--cpio/test/test_option_zstd.c1
-rw-r--r--cpio/test/test_owner_parse.c1
-rw-r--r--cpio/test/test_passthrough_dotdot.c1
-rw-r--r--cpio/test/test_passthrough_reverse.c1
-rw-r--r--libarchive/CMakeLists.txt28
-rw-r--r--libarchive/archive.h12
-rw-r--r--libarchive/archive_acl.c1
-rw-r--r--libarchive/archive_acl_private.h2
-rw-r--r--libarchive/archive_check_magic.c20
-rw-r--r--libarchive/archive_cmdline.c2
-rw-r--r--libarchive/archive_cmdline_private.h2
-rw-r--r--libarchive/archive_crc32.h2
-rw-r--r--libarchive/archive_cryptor.c4
-rw-r--r--libarchive/archive_digest.c94
-rw-r--r--libarchive/archive_digest_private.h10
-rw-r--r--libarchive/archive_endian.h2
-rw-r--r--libarchive/archive_entry.32
-rw-r--r--libarchive/archive_entry.c44
-rw-r--r--libarchive/archive_entry.h10
-rw-r--r--libarchive/archive_entry_copy_bhfi.c1
-rw-r--r--libarchive/archive_entry_copy_stat.c1
-rw-r--r--libarchive/archive_entry_link_resolver.c1
-rw-r--r--libarchive/archive_entry_locale.h2
-rw-r--r--libarchive/archive_entry_private.h6
-rw-r--r--libarchive/archive_entry_sparse.c1
-rw-r--r--libarchive/archive_entry_stat.c1
-rw-r--r--libarchive/archive_entry_strmode.c1
-rw-r--r--libarchive/archive_entry_time.32
-rw-r--r--libarchive/archive_entry_xattr.c1
-rw-r--r--libarchive/archive_getdate.c123
-rw-r--r--libarchive/archive_getdate.h2
-rw-r--r--libarchive/archive_hmac.c34
-rw-r--r--libarchive/archive_hmac_private.h9
-rw-r--r--libarchive/archive_match.c1
-rw-r--r--libarchive/archive_openssl_evp_private.h3
-rw-r--r--libarchive/archive_options.c1
-rw-r--r--libarchive/archive_options_private.h2
-rw-r--r--libarchive/archive_pack_dev.c7
-rw-r--r--libarchive/archive_pathmatch.c1
-rw-r--r--libarchive/archive_pathmatch.h2
-rw-r--r--libarchive/archive_platform.h18
-rw-r--r--libarchive/archive_platform_acl.h2
-rw-r--r--libarchive/archive_platform_xattr.h2
-rw-r--r--libarchive/archive_private.h12
-rw-r--r--libarchive/archive_random.c36
-rw-r--r--libarchive/archive_read.32
-rw-r--r--libarchive/archive_read.c1
-rw-r--r--libarchive/archive_read_add_passphrase.32
-rw-r--r--libarchive/archive_read_add_passphrase.c1
-rw-r--r--libarchive/archive_read_append_filter.c1
-rw-r--r--libarchive/archive_read_data.32
-rw-r--r--libarchive/archive_read_data_into_fd.c8
-rw-r--r--libarchive/archive_read_disk.32
-rw-r--r--libarchive/archive_read_disk_entry_from_file.c1
-rw-r--r--libarchive/archive_read_disk_posix.c36
-rw-r--r--libarchive/archive_read_disk_private.h2
-rw-r--r--libarchive/archive_read_disk_set_standard_lookup.c1
-rw-r--r--libarchive/archive_read_disk_windows.c92
-rw-r--r--libarchive/archive_read_extract.32
-rw-r--r--libarchive/archive_read_extract.c1
-rw-r--r--libarchive/archive_read_extract2.c1
-rw-r--r--libarchive/archive_read_filter.32
-rw-r--r--libarchive/archive_read_format.32
-rw-r--r--libarchive/archive_read_free.32
-rw-r--r--libarchive/archive_read_header.32
-rw-r--r--libarchive/archive_read_new.32
-rw-r--r--libarchive/archive_read_open.32
-rw-r--r--libarchive/archive_read_open_fd.c1
-rw-r--r--libarchive/archive_read_open_file.c5
-rw-r--r--libarchive/archive_read_open_filename.c112
-rw-r--r--libarchive/archive_read_open_memory.c1
-rw-r--r--libarchive/archive_read_private.h2
-rw-r--r--libarchive/archive_read_set_format.c1
-rw-r--r--libarchive/archive_read_set_options.323
-rw-r--r--libarchive/archive_read_set_options.c1
-rw-r--r--libarchive/archive_read_support_filter_all.c1
-rw-r--r--libarchive/archive_read_support_filter_by_code.c1
-rw-r--r--libarchive/archive_read_support_filter_bzip2.c8
-rw-r--r--libarchive/archive_read_support_filter_compress.c3
-rw-r--r--libarchive/archive_read_support_filter_grzip.c3
-rw-r--r--libarchive/archive_read_support_filter_gzip.c5
-rw-r--r--libarchive/archive_read_support_filter_lrzip.c3
-rw-r--r--libarchive/archive_read_support_filter_lz4.c12
-rw-r--r--libarchive/archive_read_support_filter_lzop.c6
-rw-r--r--libarchive/archive_read_support_filter_none.c1
-rw-r--r--libarchive/archive_read_support_filter_program.c1
-rw-r--r--libarchive/archive_read_support_filter_rpm.c2
-rw-r--r--libarchive/archive_read_support_filter_uu.c53
-rw-r--r--libarchive/archive_read_support_filter_xz.c22
-rw-r--r--libarchive/archive_read_support_filter_zstd.c18
-rw-r--r--libarchive/archive_read_support_format_7zip.c289
-rw-r--r--libarchive/archive_read_support_format_all.c1
-rw-r--r--libarchive/archive_read_support_format_ar.c1
-rw-r--r--libarchive/archive_read_support_format_by_code.c1
-rw-r--r--libarchive/archive_read_support_format_cab.c14
-rw-r--r--libarchive/archive_read_support_format_cpio.c7
-rw-r--r--libarchive/archive_read_support_format_empty.c1
-rw-r--r--libarchive/archive_read_support_format_iso9660.c20
-rw-r--r--libarchive/archive_read_support_format_lha.c29
-rw-r--r--libarchive/archive_read_support_format_mtree.c33
-rw-r--r--libarchive/archive_read_support_format_rar.c33
-rw-r--r--libarchive/archive_read_support_format_rar5.c23
-rw-r--r--libarchive/archive_read_support_format_raw.c1
-rw-r--r--libarchive/archive_read_support_format_tar.c21
-rw-r--r--libarchive/archive_read_support_format_warc.c7
-rw-r--r--libarchive/archive_read_support_format_xar.c13
-rw-r--r--libarchive/archive_read_support_format_zip.c505
-rw-r--r--libarchive/archive_string.c26
-rw-r--r--libarchive/archive_string.h3
-rw-r--r--libarchive/archive_string_composition.h2
-rw-r--r--libarchive/archive_string_sprintf.c1
-rw-r--r--libarchive/archive_util.32
-rw-r--r--libarchive/archive_util.c58
-rw-r--r--libarchive/archive_version_details.c1
-rw-r--r--libarchive/archive_virtual.c1
-rw-r--r--libarchive/archive_windows.c37
-rw-r--r--libarchive/archive_windows.h2
-rw-r--r--libarchive/archive_write.32
-rw-r--r--libarchive/archive_write.c42
-rw-r--r--libarchive/archive_write_add_filter.c1
-rw-r--r--libarchive/archive_write_add_filter_b64encode.c2
-rw-r--r--libarchive/archive_write_add_filter_by_name.c1
-rw-r--r--libarchive/archive_write_add_filter_bzip2.c8
-rw-r--r--libarchive/archive_write_add_filter_compress.c4
-rw-r--r--libarchive/archive_write_add_filter_grzip.c2
-rw-r--r--libarchive/archive_write_add_filter_gzip.c2
-rw-r--r--libarchive/archive_write_add_filter_lrzip.c2
-rw-r--r--libarchive/archive_write_add_filter_lz4.c10
-rw-r--r--libarchive/archive_write_add_filter_lzop.c1
-rw-r--r--libarchive/archive_write_add_filter_none.c1
-rw-r--r--libarchive/archive_write_add_filter_program.c1
-rw-r--r--libarchive/archive_write_add_filter_uuencode.c2
-rw-r--r--libarchive/archive_write_add_filter_xz.c2
-rw-r--r--libarchive/archive_write_add_filter_zstd.c342
-rw-r--r--libarchive/archive_write_blocksize.32
-rw-r--r--libarchive/archive_write_data.32
-rw-r--r--libarchive/archive_write_disk.32
-rw-r--r--libarchive/archive_write_disk_posix.c77
-rw-r--r--libarchive/archive_write_disk_private.h2
-rw-r--r--libarchive/archive_write_disk_set_standard_lookup.c1
-rw-r--r--libarchive/archive_write_disk_windows.c88
-rw-r--r--libarchive/archive_write_filter.32
-rw-r--r--libarchive/archive_write_finish_entry.32
-rw-r--r--libarchive/archive_write_format.32
-rw-r--r--libarchive/archive_write_free.32
-rw-r--r--libarchive/archive_write_header.32
-rw-r--r--libarchive/archive_write_new.32
-rw-r--r--libarchive/archive_write_open.33
-rw-r--r--libarchive/archive_write_open_fd.c1
-rw-r--r--libarchive/archive_write_open_file.c1
-rw-r--r--libarchive/archive_write_open_filename.c1
-rw-r--r--libarchive/archive_write_open_memory.c1
-rw-r--r--libarchive/archive_write_private.h3
-rw-r--r--libarchive/archive_write_set_format.c1
-rw-r--r--libarchive/archive_write_set_format_7zip.c44
-rw-r--r--libarchive/archive_write_set_format_ar.c1
-rw-r--r--libarchive/archive_write_set_format_by_name.c1
-rw-r--r--libarchive/archive_write_set_format_cpio_binary.c1
-rw-r--r--libarchive/archive_write_set_format_cpio_newc.c1
-rw-r--r--libarchive/archive_write_set_format_cpio_odc.c1
-rw-r--r--libarchive/archive_write_set_format_filter_by_ext.c1
-rw-r--r--libarchive/archive_write_set_format_gnutar.c2
-rw-r--r--libarchive/archive_write_set_format_iso9660.c32
-rw-r--r--libarchive/archive_write_set_format_mtree.c1
-rw-r--r--libarchive/archive_write_set_format_pax.c65
-rw-r--r--libarchive/archive_write_set_format_private.h2
-rw-r--r--libarchive/archive_write_set_format_shar.c1
-rw-r--r--libarchive/archive_write_set_format_ustar.c2
-rw-r--r--libarchive/archive_write_set_format_v7tar.c2
-rw-r--r--libarchive/archive_write_set_format_warc.c26
-rw-r--r--libarchive/archive_write_set_format_xar.c15
-rw-r--r--libarchive/archive_write_set_format_zip.c208
-rw-r--r--libarchive/archive_write_set_options.320
-rw-r--r--libarchive/archive_write_set_options.c1
-rw-r--r--libarchive/archive_write_set_passphrase.32
-rw-r--r--libarchive/archive_write_set_passphrase.c1
-rw-r--r--libarchive/config_freebsd.h9
-rw-r--r--libarchive/cpio.52
-rw-r--r--libarchive/filter_fork.h2
-rw-r--r--libarchive/filter_fork_posix.c4
-rw-r--r--libarchive/filter_fork_windows.c9
-rw-r--r--libarchive/libarchive-formats.52
-rw-r--r--libarchive/libarchive.32
-rw-r--r--libarchive/libarchive_changes.32
-rw-r--r--libarchive/libarchive_internals.32
-rw-r--r--libarchive/mtree.51
-rw-r--r--libarchive/tar.52
-rw-r--r--libarchive/test/CMakeLists.txt4
-rw-r--r--libarchive/test/README2
-rw-r--r--libarchive/test/read_open_memory.c1
-rw-r--r--libarchive/test/test_acl_nfs4.c1
-rw-r--r--libarchive/test/test_acl_pax.c1
-rw-r--r--libarchive/test/test_acl_platform_nfs4.c5
-rw-r--r--libarchive/test/test_acl_platform_posix1e.c1
-rw-r--r--libarchive/test/test_acl_posix1e.c1
-rw-r--r--libarchive/test/test_acl_text.c1
-rw-r--r--libarchive/test/test_archive_api_feature.c3
-rw-r--r--libarchive/test/test_archive_clear_error.c1
-rw-r--r--libarchive/test/test_archive_cmdline.c1
-rw-r--r--libarchive/test/test_archive_getdate.c1
-rw-r--r--libarchive/test/test_archive_match_owner.c1
-rw-r--r--libarchive/test/test_archive_match_path.c1
-rw-r--r--libarchive/test/test_archive_match_time.c31
-rw-r--r--libarchive/test/test_archive_pathmatch.c1
-rw-r--r--libarchive/test/test_archive_read_add_passphrase.c1
-rw-r--r--libarchive/test/test_archive_read_close_twice.c2
-rw-r--r--libarchive/test/test_archive_read_close_twice_open_fd.c1
-rw-r--r--libarchive/test/test_archive_read_close_twice_open_filename.c1
-rw-r--r--libarchive/test/test_archive_read_multiple_data_objects.c5
-rw-r--r--libarchive/test/test_archive_read_next_header_empty.c1
-rw-r--r--libarchive/test/test_archive_read_next_header_raw.c1
-rw-r--r--libarchive/test/test_archive_read_open2.c1
-rw-r--r--libarchive/test/test_archive_read_set_filter_option.c1
-rw-r--r--libarchive/test/test_archive_read_set_format_option.c1
-rw-r--r--libarchive/test/test_archive_read_set_option.c1
-rw-r--r--libarchive/test/test_archive_read_set_options.c1
-rw-r--r--libarchive/test/test_archive_read_support.c1
-rw-r--r--libarchive/test/test_archive_set_error.c1
-rw-r--r--libarchive/test/test_archive_string.c3
-rw-r--r--libarchive/test/test_archive_string_conversion.c5
-rw-r--r--libarchive/test/test_archive_string_conversion.txt.Z.uu1
-rw-r--r--libarchive/test/test_archive_write_add_filter_by_name.c4
-rw-r--r--libarchive/test/test_archive_write_set_filter_option.c1
-rw-r--r--libarchive/test/test_archive_write_set_format_by_name.c2
-rw-r--r--libarchive/test/test_archive_write_set_format_filter_by_ext.c2
-rw-r--r--libarchive/test/test_archive_write_set_format_option.c1
-rw-r--r--libarchive/test/test_archive_write_set_option.c1
-rw-r--r--libarchive/test/test_archive_write_set_options.c1
-rw-r--r--libarchive/test/test_archive_write_set_passphrase.c1
-rw-r--r--libarchive/test/test_bad_fd.c1
-rw-r--r--libarchive/test/test_compat_bzip2.c1
-rw-r--r--libarchive/test/test_compat_bzip2_1.tbz.uu2
-rw-r--r--libarchive/test/test_compat_bzip2_2.tbz.uu2
-rw-r--r--libarchive/test/test_compat_cpio.c1
-rw-r--r--libarchive/test/test_compat_cpio_1.cpio.uu2
-rw-r--r--libarchive/test/test_compat_gtar.c1
-rw-r--r--libarchive/test/test_compat_gtar_1.tar.uu1
-rw-r--r--libarchive/test/test_compat_gtar_2.tar.uu2
-rw-r--r--libarchive/test/test_compat_gzip.c1
-rw-r--r--libarchive/test/test_compat_gzip_1.tgz.uu2
-rw-r--r--libarchive/test/test_compat_gzip_2.tgz.uu2
-rw-r--r--libarchive/test/test_compat_lz4.c1
-rw-r--r--libarchive/test/test_compat_lzip.c85
-rw-r--r--libarchive/test/test_compat_lzip_3.lz.uu1461
-rw-r--r--libarchive/test/test_compat_lzip_4.tlz.uu1474
-rw-r--r--libarchive/test/test_compat_lzma.c1
-rw-r--r--libarchive/test/test_compat_lzma_1.tlz.uu2
-rw-r--r--libarchive/test/test_compat_lzma_2.tlz.uu2
-rw-r--r--libarchive/test/test_compat_lzma_3.tlz.uu2
-rw-r--r--libarchive/test/test_compat_lzop.c1
-rw-r--r--libarchive/test/test_compat_mac.c1
-rw-r--r--libarchive/test/test_compat_perl_archive_tar.c1
-rw-r--r--libarchive/test/test_compat_plexus_archiver_tar.c1
-rw-r--r--libarchive/test/test_compat_solaris_pax_sparse.c2
-rw-r--r--libarchive/test/test_compat_solaris_tar_acl.c1
-rw-r--r--libarchive/test/test_compat_star_acl.c1
-rw-r--r--libarchive/test/test_compat_tar_directory.c1
-rw-r--r--libarchive/test/test_compat_tar_directory_1.tar.uu1
-rw-r--r--libarchive/test/test_compat_tar_hardlink.c1
-rw-r--r--libarchive/test/test_compat_tar_hardlink_1.tar.uu1
-rw-r--r--libarchive/test/test_compat_uudecode.c1
-rw-r--r--libarchive/test/test_compat_uudecode_large.c1
-rw-r--r--libarchive/test/test_compat_xz.c1
-rw-r--r--libarchive/test/test_compat_xz_1.txz.uu3
-rw-r--r--libarchive/test/test_compat_zip.c1
-rw-r--r--libarchive/test/test_compat_zip_1.zip.uu1
-rw-r--r--libarchive/test/test_compat_zip_8.zip.uu12
-rw-r--r--libarchive/test/test_compat_zstd.c2
-rw-r--r--libarchive/test/test_empty_write.c1
-rw-r--r--libarchive/test/test_entry.c1
-rw-r--r--libarchive/test/test_entry_strmode.c1
-rw-r--r--libarchive/test/test_extattr_freebsd.c1
-rw-r--r--libarchive/test/test_filter_count.c1
-rw-r--r--libarchive/test/test_fuzz.c6
-rw-r--r--libarchive/test/test_fuzz_1.iso.Z.uu2
-rw-r--r--libarchive/test/test_gnutar_filename_encoding.c2
-rw-r--r--libarchive/test/test_link_resolver.c1
-rw-r--r--libarchive/test/test_open_failure.c1
-rw-r--r--libarchive/test/test_open_fd.c1
-rw-r--r--libarchive/test/test_open_file.c1
-rw-r--r--libarchive/test/test_open_filename.c1
-rw-r--r--libarchive/test/test_pax_filename_encoding.c1
-rw-r--r--libarchive/test/test_pax_filename_encoding.tar.uu1
-rw-r--r--libarchive/test/test_pax_xattr_header.c1
-rw-r--r--libarchive/test/test_rar_multivolume_single_file.part1.rar.uu2
-rw-r--r--libarchive/test/test_rar_multivolume_single_file.part2.rar.uu2
-rw-r--r--libarchive/test/test_rar_multivolume_single_file.part3.rar.uu2
-rw-r--r--libarchive/test/test_rar_multivolume_uncompressed_files.part01.rar.uu2
-rw-r--r--libarchive/test/test_rar_multivolume_uncompressed_files.part02.rar.uu2
-rw-r--r--libarchive/test/test_rar_multivolume_uncompressed_files.part03.rar.uu2
-rw-r--r--libarchive/test/test_rar_multivolume_uncompressed_files.part04.rar.uu2
-rw-r--r--libarchive/test/test_rar_multivolume_uncompressed_files.part05.rar.uu2
-rw-r--r--libarchive/test/test_rar_multivolume_uncompressed_files.part06.rar.uu2
-rw-r--r--libarchive/test/test_rar_multivolume_uncompressed_files.part07.rar.uu2
-rw-r--r--libarchive/test/test_rar_multivolume_uncompressed_files.part08.rar.uu2
-rw-r--r--libarchive/test/test_rar_multivolume_uncompressed_files.part09.rar.uu2
-rw-r--r--libarchive/test/test_rar_multivolume_uncompressed_files.part10.rar.uu2
-rw-r--r--libarchive/test/test_read_data_large.c1
-rw-r--r--libarchive/test/test_read_disk.c1
-rw-r--r--libarchive/test/test_read_disk_directory_traversals.c10
-rw-r--r--libarchive/test/test_read_disk_entry_from_file.c1
-rw-r--r--libarchive/test/test_read_extract.c1
-rw-r--r--libarchive/test/test_read_file_nonexistent.c1
-rw-r--r--libarchive/test/test_read_filter_lrzip.tar.lrz.uu2
-rw-r--r--libarchive/test/test_read_filter_program.c1
-rw-r--r--libarchive/test/test_read_filter_program_signature.c1
-rw-r--r--libarchive/test/test_read_filter_uudecode.c1
-rw-r--r--libarchive/test/test_read_filter_uudecode_base64_raw.uu11
-rw-r--r--libarchive/test/test_read_filter_uudecode_raw.c67
-rw-r--r--libarchive/test/test_read_filter_uudecode_raw.uu14
-rw-r--r--libarchive/test/test_read_format_7zip.c427
-rw-r--r--libarchive/test/test_read_format_7zip_copy.7z.uu2
-rw-r--r--libarchive/test/test_read_format_7zip_deflate_arm64.7z.uu64
-rw-r--r--libarchive/test/test_read_format_7zip_encryption_data.c1
-rw-r--r--libarchive/test/test_read_format_7zip_encryption_header.c2
-rw-r--r--libarchive/test/test_read_format_7zip_encryption_partially.c1
-rw-r--r--libarchive/test/test_read_format_7zip_lzma2_arm.7z.uu50
-rw-r--r--libarchive/test/test_read_format_7zip_lzma2_arm64.7z.uu54
-rw-r--r--libarchive/test/test_read_format_7zip_malformed.c1
-rw-r--r--libarchive/test/test_read_format_7zip_packinfo_digests.c5
-rw-r--r--libarchive/test/test_read_format_7zip_solid_zstd.7z.uu9
-rw-r--r--libarchive/test/test_read_format_7zip_win_attrib.7z.uu10
-rw-r--r--libarchive/test/test_read_format_7zip_zstd.7z.uu12
-rw-r--r--libarchive/test/test_read_format_7zip_zstd_arm.7z.uu61
-rw-r--r--libarchive/test/test_read_format_7zip_zstd_bcj.7z.uu56
-rw-r--r--libarchive/test/test_read_format_7zip_zstd_nobcj.7z.uu56
-rw-r--r--libarchive/test/test_read_format_ar.ar.uu2
-rw-r--r--libarchive/test/test_read_format_ar.c2
-rw-r--r--libarchive/test/test_read_format_cab.c1
-rw-r--r--libarchive/test/test_read_format_cab_filename.c1
-rw-r--r--libarchive/test/test_read_format_cab_filename_cp932.cab.uu2
-rw-r--r--libarchive/test/test_read_format_cpio_afio.c1
-rw-r--r--libarchive/test/test_read_format_cpio_bin.c1
-rw-r--r--libarchive/test/test_read_format_cpio_bin_Z.c1
-rw-r--r--libarchive/test/test_read_format_cpio_bin_be.c1
-rw-r--r--libarchive/test/test_read_format_cpio_bin_be.cpio.uu1
-rw-r--r--libarchive/test/test_read_format_cpio_bin_bz2.c1
-rw-r--r--libarchive/test/test_read_format_cpio_bin_gz.c1
-rw-r--r--libarchive/test/test_read_format_cpio_bin_le.c1
-rw-r--r--libarchive/test/test_read_format_cpio_bin_lzip.c1
-rw-r--r--libarchive/test/test_read_format_cpio_bin_lzma.c1
-rw-r--r--libarchive/test/test_read_format_cpio_bin_xz.c1
-rw-r--r--libarchive/test/test_read_format_cpio_filename.c13
-rw-r--r--libarchive/test/test_read_format_cpio_filename_cp866.cpio.uu2
-rw-r--r--libarchive/test/test_read_format_cpio_filename_eucjp.cpio.uu2
-rw-r--r--libarchive/test/test_read_format_cpio_filename_koi8r.cpio.uu2
-rw-r--r--libarchive/test/test_read_format_cpio_filename_utf8_jp.cpio.uu2
-rw-r--r--libarchive/test/test_read_format_cpio_filename_utf8_ru.cpio.uu2
-rw-r--r--libarchive/test/test_read_format_cpio_odc.c1
-rw-r--r--libarchive/test/test_read_format_cpio_svr4_gzip.c1
-rw-r--r--libarchive/test/test_read_format_cpio_svr4c_Z.c1
-rw-r--r--libarchive/test/test_read_format_empty.c1
-rw-r--r--libarchive/test/test_read_format_gtar_filename.c1
-rw-r--r--libarchive/test/test_read_format_gtar_filename_cp866.tar.Z.uu2
-rw-r--r--libarchive/test/test_read_format_gtar_filename_eucjp.tar.Z.uu2
-rw-r--r--libarchive/test/test_read_format_gtar_filename_koi8r.tar.Z.uu2
-rw-r--r--libarchive/test/test_read_format_gtar_gz.c1
-rw-r--r--libarchive/test/test_read_format_gtar_lzma.c1
-rw-r--r--libarchive/test/test_read_format_gtar_sparse.c2
-rw-r--r--libarchive/test/test_read_format_gtar_sparse_1_13.tar.uu1
-rw-r--r--libarchive/test/test_read_format_gtar_sparse_1_17.tar.uu1
-rw-r--r--libarchive/test/test_read_format_gtar_sparse_1_17_posix00.tar.uu1
-rw-r--r--libarchive/test/test_read_format_gtar_sparse_1_17_posix01.tar.uu1
-rw-r--r--libarchive/test/test_read_format_gtar_sparse_1_17_posix10.tar.uu1
-rw-r--r--libarchive/test/test_read_format_gtar_sparse_1_17_posix10_modified.tar.uu1
-rw-r--r--libarchive/test/test_read_format_gtar_sparse_skip_entry.c1
-rw-r--r--libarchive/test/test_read_format_gtar_sparse_skip_entry.tar.Z.uu2
-rw-r--r--libarchive/test/test_read_format_iso.iso.Z.uu2
-rw-r--r--libarchive/test/test_read_format_iso_Z.c1
-rw-r--r--libarchive/test/test_read_format_iso_joliet.iso.Z.uu2
-rw-r--r--libarchive/test/test_read_format_iso_joliet_long.iso.Z.uu2
-rw-r--r--libarchive/test/test_read_format_iso_joliet_rockridge.iso.Z.uu2
-rw-r--r--libarchive/test/test_read_format_iso_multi_extent.c1
-rw-r--r--libarchive/test/test_read_format_iso_multi_extent.iso.Z.uu2
-rw-r--r--libarchive/test/test_read_format_iso_rockridge.iso.Z.uu2
-rw-r--r--libarchive/test/test_read_format_iso_rockridge_ce.iso.Z.uu2
-rw-r--r--libarchive/test/test_read_format_iso_rockridge_new.iso.Z.uu2
-rw-r--r--libarchive/test/test_read_format_iso_rockridge_rr_moved.iso.Z.uu2
-rw-r--r--libarchive/test/test_read_format_iso_xorriso.c2
-rw-r--r--libarchive/test/test_read_format_iso_zisofs.iso.Z.uu2
-rw-r--r--libarchive/test/test_read_format_isojoliet_bz2.c1
-rw-r--r--libarchive/test/test_read_format_isojoliet_long.c7
-rw-r--r--libarchive/test/test_read_format_isojoliet_rr.c1
-rw-r--r--libarchive/test/test_read_format_isojoliet_versioned.c1
-rw-r--r--libarchive/test/test_read_format_isorr_bz2.c1
-rw-r--r--libarchive/test/test_read_format_isorr_ce.c1
-rw-r--r--libarchive/test/test_read_format_isorr_new_bz2.c2
-rw-r--r--libarchive/test/test_read_format_isorr_rr_moved.c1
-rw-r--r--libarchive/test/test_read_format_isozisofs_bz2.c1
-rw-r--r--libarchive/test/test_read_format_lha.c1
-rw-r--r--libarchive/test/test_read_format_lha_bugfix_0.c1
-rw-r--r--libarchive/test/test_read_format_lha_filename.c1
-rw-r--r--libarchive/test/test_read_format_lha_filename_cp932.lzh.uu2
-rw-r--r--libarchive/test/test_read_format_lha_filename_utf16.c1
-rw-r--r--libarchive/test/test_read_format_lha_filename_utf16.lzh.uu38
-rw-r--r--libarchive/test/test_read_format_mtree.c31
-rw-r--r--libarchive/test/test_read_format_pax_bz2.c1
-rw-r--r--libarchive/test/test_read_format_rar.c85
-rw-r--r--libarchive/test/test_read_format_rar.rar.uu2
-rw-r--r--libarchive/test/test_read_format_rar5.c75
-rw-r--r--libarchive/test/test_read_format_rar5_bad_window_sz_in_mltarc_file.rar.uu2
-rw-r--r--libarchive/test/test_read_format_rar5_compressed.rar.uu2
-rw-r--r--libarchive/test/test_read_format_rar5_different_winsize_on_merge.rar.uu2
-rw-r--r--libarchive/test/test_read_format_rar5_multiarchive.part01.rar.uu2
-rw-r--r--libarchive/test/test_read_format_rar5_multiarchive.part02.rar.uu2
-rw-r--r--libarchive/test/test_read_format_rar5_multiarchive.part03.rar.uu2
-rw-r--r--libarchive/test/test_read_format_rar5_multiarchive.part04.rar.uu2
-rw-r--r--libarchive/test/test_read_format_rar5_multiarchive.part05.rar.uu2
-rw-r--r--libarchive/test/test_read_format_rar5_multiarchive.part06.rar.uu2
-rw-r--r--libarchive/test/test_read_format_rar5_multiarchive.part07.rar.uu2
-rw-r--r--libarchive/test/test_read_format_rar5_multiarchive.part08.rar.uu2
-rw-r--r--libarchive/test/test_read_format_rar5_multiple_files.rar.uu2
-rw-r--r--libarchive/test/test_read_format_rar5_multiple_files_solid.rar.uu2
-rw-r--r--libarchive/test/test_read_format_rar5_sfx.exe.uu2
-rw-r--r--libarchive/test/test_read_format_rar5_stored.rar.uu2
-rw-r--r--libarchive/test/test_read_format_rar5_unicode.rar.uu9
-rw-r--r--libarchive/test/test_read_format_rar_binary_data.rar.uu2
-rw-r--r--libarchive/test/test_read_format_rar_compress_best.rar.uu2
-rw-r--r--libarchive/test/test_read_format_rar_compress_normal.rar.uu2
-rw-r--r--libarchive/test/test_read_format_rar_encryption_data.c1
-rw-r--r--libarchive/test/test_read_format_rar_encryption_header.c1
-rw-r--r--libarchive/test/test_read_format_rar_encryption_partially.c1
-rw-r--r--libarchive/test/test_read_format_rar_filter.c1
-rw-r--r--libarchive/test/test_read_format_rar_invalid1.c1
-rw-r--r--libarchive/test/test_read_format_rar_multi_lzss_blocks.rar.uu2
-rw-r--r--libarchive/test/test_read_format_rar_multivolume.part0001.rar.uu2
-rw-r--r--libarchive/test/test_read_format_rar_multivolume.part0002.rar.uu2
-rw-r--r--libarchive/test/test_read_format_rar_multivolume.part0003.rar.uu2
-rw-r--r--libarchive/test/test_read_format_rar_multivolume.part0004.rar.uu2
-rw-r--r--libarchive/test/test_read_format_rar_noeof.rar.uu2
-rw-r--r--libarchive/test/test_read_format_rar_ppmd_lzss_conversion.rar.uu2
-rw-r--r--libarchive/test/test_read_format_rar_sfx.exe.uu2
-rw-r--r--libarchive/test/test_read_format_rar_subblock.rar.uu2
-rw-r--r--libarchive/test/test_read_format_rar_windows.rar.uu2
-rw-r--r--libarchive/test/test_read_format_raw.bufr.uu2
-rw-r--r--libarchive/test/test_read_format_raw.c1
-rw-r--r--libarchive/test/test_read_format_raw.data.Z.uu1
-rw-r--r--libarchive/test/test_read_format_raw.data.uu1
-rw-r--r--libarchive/test/test_read_format_tar.c1
-rw-r--r--libarchive/test/test_read_format_tar_concatenated.c1
-rw-r--r--libarchive/test/test_read_format_tar_empty_filename.c1
-rw-r--r--libarchive/test/test_read_format_tar_empty_filename.tar.uu3
-rw-r--r--libarchive/test/test_read_format_tar_empty_pax.c1
-rw-r--r--libarchive/test/test_read_format_tar_empty_pax.tar.Z.uu2
-rw-r--r--libarchive/test/test_read_format_tar_empty_with_gnulabel.c1
-rw-r--r--libarchive/test/test_read_format_tar_filename.c1
-rw-r--r--libarchive/test/test_read_format_tar_invalid_pax_size.c52
-rw-r--r--libarchive/test/test_read_format_tar_invalid_pax_size.tar.uu38
-rw-r--r--libarchive/test/test_read_format_tbz.c1
-rw-r--r--libarchive/test/test_read_format_tgz.c1
-rw-r--r--libarchive/test/test_read_format_tlz.c1
-rw-r--r--libarchive/test/test_read_format_txz.c1
-rw-r--r--libarchive/test/test_read_format_tz.c1
-rw-r--r--libarchive/test/test_read_format_ustar_filename.c1
-rw-r--r--libarchive/test/test_read_format_warc.c2
-rw-r--r--libarchive/test/test_read_format_xar.c1
-rw-r--r--libarchive/test/test_read_format_zip.c8
-rw-r--r--libarchive/test/test_read_format_zip_7075_utf8_paths.c1
-rw-r--r--libarchive/test/test_read_format_zip_bzip2.zipx.uu2
-rw-r--r--libarchive/test/test_read_format_zip_comment_stored.c1
-rw-r--r--libarchive/test/test_read_format_zip_encryption_data.c1
-rw-r--r--libarchive/test/test_read_format_zip_encryption_header.c1
-rw-r--r--libarchive/test/test_read_format_zip_encryption_partially.c1
-rw-r--r--libarchive/test/test_read_format_zip_filename.c7
-rw-r--r--libarchive/test/test_read_format_zip_filename_cp866.zip.uu2
-rw-r--r--libarchive/test/test_read_format_zip_filename_cp932.zip.uu2
-rw-r--r--libarchive/test/test_read_format_zip_filename_koi8r.zip.uu2
-rw-r--r--libarchive/test/test_read_format_zip_filename_utf8_jp.zip.uu2
-rw-r--r--libarchive/test/test_read_format_zip_filename_utf8_ru.zip.uu2
-rw-r--r--libarchive/test/test_read_format_zip_filename_utf8_ru2.zip.uu2
-rw-r--r--libarchive/test/test_read_format_zip_high_compression.c2
-rw-r--r--libarchive/test/test_read_format_zip_jar.c1
-rw-r--r--libarchive/test/test_read_format_zip_lzma.zipx.uu2
-rw-r--r--libarchive/test/test_read_format_zip_mac_metadata.c1
-rw-r--r--libarchive/test/test_read_format_zip_malformed.c1
-rw-r--r--libarchive/test/test_read_format_zip_nested.c3
-rw-r--r--libarchive/test/test_read_format_zip_nofiletype.c1
-rw-r--r--libarchive/test/test_read_format_zip_padded.c1
-rw-r--r--libarchive/test/test_read_format_zip_ppmd8.zipx.uu2
-rw-r--r--libarchive/test/test_read_format_zip_sfx.c1
-rw-r--r--libarchive/test/test_read_format_zip_traditional_encryption_data.c1
-rw-r--r--libarchive/test/test_read_format_zip_winzip_aes.c1
-rw-r--r--libarchive/test/test_read_format_zip_winzip_aes128.zip.uu2
-rw-r--r--libarchive/test/test_read_format_zip_winzip_aes256.zip.uu2
-rw-r--r--libarchive/test/test_read_format_zip_winzip_aes256_stored.zip.uu2
-rw-r--r--libarchive/test/test_read_format_zip_winzip_aes_large.c1
-rw-r--r--libarchive/test/test_read_format_zip_with_invalid_traditional_eocd.c2
-rw-r--r--libarchive/test/test_read_format_zip_with_invalid_traditional_eocd.zip.uu2
-rw-r--r--libarchive/test/test_read_format_zip_zip64.c1
-rw-r--r--libarchive/test/test_read_large.c1
-rw-r--r--libarchive/test/test_read_large_splitted_rar_aa.uu2
-rw-r--r--libarchive/test/test_read_large_splitted_rar_ab.uu2
-rw-r--r--libarchive/test/test_read_large_splitted_rar_ac.uu2
-rw-r--r--libarchive/test/test_read_large_splitted_rar_ad.uu2
-rw-r--r--libarchive/test/test_read_large_splitted_rar_ae.uu2
-rw-r--r--libarchive/test/test_read_pax_truncated.c1
-rw-r--r--libarchive/test/test_read_pax_xattr_schily.tar.uu2
-rw-r--r--libarchive/test/test_read_position.c1
-rw-r--r--libarchive/test/test_read_splitted_rar_aa.uu2
-rw-r--r--libarchive/test/test_read_splitted_rar_ab.uu2
-rw-r--r--libarchive/test/test_read_splitted_rar_ac.uu2
-rw-r--r--libarchive/test/test_read_splitted_rar_ad.uu2
-rw-r--r--libarchive/test/test_read_truncated.c1
-rw-r--r--libarchive/test/test_read_truncated_filter.c5
-rw-r--r--libarchive/test/test_short_writes.c2
-rw-r--r--libarchive/test/test_sparse_basic.c7
-rw-r--r--libarchive/test/test_splitted_rar_seek_support_aa.uu2
-rw-r--r--libarchive/test/test_splitted_rar_seek_support_ab.uu2
-rw-r--r--libarchive/test/test_splitted_rar_seek_support_ac.uu2
-rw-r--r--libarchive/test/test_tar_filenames.c1
-rw-r--r--libarchive/test/test_tar_large.c5
-rw-r--r--libarchive/test/test_ustar_filename_encoding.c1
-rw-r--r--libarchive/test/test_ustar_filenames.c1
-rw-r--r--libarchive/test/test_write_disk.c1
-rw-r--r--libarchive/test/test_write_disk_appledouble.c1
-rw-r--r--libarchive/test/test_write_disk_failures.c1
-rw-r--r--libarchive/test/test_write_disk_hardlink.c1
-rw-r--r--libarchive/test/test_write_disk_hfs_compression.c1
-rw-r--r--libarchive/test/test_write_disk_lookup.c1
-rw-r--r--libarchive/test/test_write_disk_mac_metadata.c1
-rw-r--r--libarchive/test/test_write_disk_no_hfs_compression.c1
-rw-r--r--libarchive/test/test_write_disk_perms.c1
-rw-r--r--libarchive/test/test_write_disk_secure.c1
-rw-r--r--libarchive/test/test_write_disk_secure744.c3
-rw-r--r--libarchive/test/test_write_disk_secure745.c1
-rw-r--r--libarchive/test/test_write_disk_secure746.c1
-rw-r--r--libarchive/test/test_write_disk_sparse.c1
-rw-r--r--libarchive/test/test_write_disk_symlink.c1
-rw-r--r--libarchive/test/test_write_disk_times.c1
-rw-r--r--libarchive/test/test_write_filter_b64encode.c9
-rw-r--r--libarchive/test/test_write_filter_bzip2.c13
-rw-r--r--libarchive/test/test_write_filter_compress.c5
-rw-r--r--libarchive/test/test_write_filter_gzip.c13
-rw-r--r--libarchive/test/test_write_filter_gzip_timestamp.c1
-rw-r--r--libarchive/test/test_write_filter_lrzip.c4
-rw-r--r--libarchive/test/test_write_filter_lz4.c21
-rw-r--r--libarchive/test/test_write_filter_lzip.c13
-rw-r--r--libarchive/test/test_write_filter_lzma.c13
-rw-r--r--libarchive/test/test_write_filter_lzop.c16
-rw-r--r--libarchive/test/test_write_filter_program.c1
-rw-r--r--libarchive/test/test_write_filter_uuencode.c9
-rw-r--r--libarchive/test/test_write_filter_xz.c13
-rw-r--r--libarchive/test/test_write_filter_zstd.c120
-rw-r--r--libarchive/test/test_write_format_7zip.c1
-rw-r--r--libarchive/test/test_write_format_7zip_empty.c1
-rw-r--r--libarchive/test/test_write_format_7zip_large.c1
-rw-r--r--libarchive/test/test_write_format_ar.c1
-rw-r--r--libarchive/test/test_write_format_cpio.c1
-rw-r--r--libarchive/test/test_write_format_cpio_empty.c1
-rw-r--r--libarchive/test/test_write_format_cpio_newc.c2
-rw-r--r--libarchive/test/test_write_format_cpio_odc.c2
-rw-r--r--libarchive/test/test_write_format_gnutar.c1
-rw-r--r--libarchive/test/test_write_format_gnutar_filenames.c1
-rw-r--r--libarchive/test/test_write_format_iso9660.c21
-rw-r--r--libarchive/test/test_write_format_mtree.c1
-rw-r--r--libarchive/test/test_write_format_mtree_absolute_path.c1
-rw-r--r--libarchive/test/test_write_format_mtree_classic.c1
-rw-r--r--libarchive/test/test_write_format_mtree_classic_indent.c1
-rw-r--r--libarchive/test/test_write_format_mtree_fflags.c2
-rw-r--r--libarchive/test/test_write_format_mtree_no_separator.c2
-rw-r--r--libarchive/test/test_write_format_mtree_quoted_filename.c1
-rw-r--r--libarchive/test/test_write_format_pax.c1
-rw-r--r--libarchive/test/test_write_format_shar_empty.c1
-rw-r--r--libarchive/test/test_write_format_tar.c1
-rw-r--r--libarchive/test/test_write_format_tar_empty.c1
-rw-r--r--libarchive/test/test_write_format_tar_sparse.c1
-rw-r--r--libarchive/test/test_write_format_tar_ustar.c1
-rw-r--r--libarchive/test/test_write_format_tar_v7tar.c1
-rw-r--r--libarchive/test/test_write_format_warc.c1
-rw-r--r--libarchive/test/test_write_format_warc_empty.c1
-rw-r--r--libarchive/test/test_write_format_xar.c1
-rw-r--r--libarchive/test/test_write_format_xar_empty.c1
-rw-r--r--libarchive/test/test_write_format_zip.c50
-rw-r--r--libarchive/test/test_write_format_zip64_stream.c276
-rw-r--r--libarchive/test/test_write_format_zip_compression_store.c80
-rw-r--r--libarchive/test/test_write_format_zip_empty.c1
-rw-r--r--libarchive/test/test_write_format_zip_empty_zip64.c1
-rw-r--r--libarchive/test/test_write_format_zip_entry_size_unset.c13
-rw-r--r--libarchive/test/test_write_format_zip_file.c55
-rw-r--r--libarchive/test/test_write_format_zip_file_zip64.c59
-rw-r--r--libarchive/test/test_write_format_zip_large.c35
-rw-r--r--libarchive/test/test_write_format_zip_stream.c247
-rw-r--r--libarchive/test/test_write_format_zip_zip64.c1
-rw-r--r--libarchive/test/test_write_open_memory.c1
-rw-r--r--libarchive/test/test_write_read_format_zip.c56
-rw-r--r--libarchive/test/test_xattr_platform.c1
-rw-r--r--libarchive/test/test_zip_filename_encoding.c4
-rw-r--r--libarchive/xxhash.c4
-rw-r--r--libarchive_fe/err.c2
-rw-r--r--libarchive_fe/err.h11
-rw-r--r--libarchive_fe/lafe_platform.h12
-rw-r--r--libarchive_fe/line_reader.c2
-rw-r--r--libarchive_fe/passphrase.c10
-rw-r--r--tar/bsdtar.184
-rw-r--r--tar/bsdtar.c82
-rw-r--r--tar/bsdtar.h8
-rw-r--r--tar/bsdtar_platform.h24
-rw-r--r--tar/bsdtar_windows.c2
-rw-r--r--tar/bsdtar_windows.h2
-rw-r--r--tar/cmdline.c3
-rw-r--r--tar/config_freebsd.h2
-rw-r--r--tar/creation_set.c1
-rw-r--r--tar/read.c6
-rw-r--r--tar/subst.c29
-rw-r--r--tar/test/CMakeLists.txt2
-rw-r--r--tar/test/test.h2
-rw-r--r--tar/test/test_0.c1
-rw-r--r--tar/test/test_basic.c1
-rw-r--r--tar/test/test_copy.c21
-rw-r--r--tar/test/test_empty_mtree.c1
-rw-r--r--tar/test/test_extract_tar_Z.c1
-rw-r--r--tar/test/test_extract_tar_bz2.c1
-rw-r--r--tar/test/test_extract_tar_grz.c1
-rw-r--r--tar/test/test_extract_tar_gz.c1
-rw-r--r--tar/test/test_extract_tar_lrz.c1
-rw-r--r--tar/test/test_extract_tar_lz.c1
-rw-r--r--tar/test/test_extract_tar_lz4.c1
-rw-r--r--tar/test/test_extract_tar_lzma.c1
-rw-r--r--tar/test/test_extract_tar_lzo.c1
-rw-r--r--tar/test/test_extract_tar_xz.c1
-rw-r--r--tar/test/test_extract_tar_zstd.c1
-rw-r--r--tar/test/test_format_newc.c1
-rw-r--r--tar/test/test_help.c1
-rw-r--r--tar/test/test_leading_slash.c1
-rw-r--r--tar/test/test_missing_file.c1
-rw-r--r--tar/test/test_option_C_mtree.c1
-rw-r--r--tar/test/test_option_C_upper.c1
-rw-r--r--tar/test/test_option_H_upper.c1
-rw-r--r--tar/test/test_option_L_upper.c1
-rw-r--r--tar/test/test_option_O_upper.c1
-rw-r--r--tar/test/test_option_T_upper.c1
-rw-r--r--tar/test/test_option_U_upper.c1
-rw-r--r--tar/test/test_option_X_upper.c1
-rw-r--r--tar/test/test_option_a.c1
-rw-r--r--tar/test/test_option_acls.c1
-rw-r--r--tar/test/test_option_b.c9
-rw-r--r--tar/test/test_option_b64encode.c1
-rw-r--r--tar/test/test_option_exclude.c1
-rw-r--r--tar/test/test_option_exclude_vcs.c2
-rw-r--r--tar/test/test_option_fflags.c1
-rw-r--r--tar/test/test_option_gid_gname.c1
-rw-r--r--tar/test/test_option_group.c84
-rw-r--r--tar/test/test_option_grzip.c1
-rw-r--r--tar/test/test_option_ignore_zeros.c1
-rw-r--r--tar/test/test_option_j.c1
-rw-r--r--tar/test/test_option_k.c1
-rw-r--r--tar/test/test_option_keep_newer_files.c1
-rw-r--r--tar/test/test_option_lrzip.c1
-rw-r--r--tar/test/test_option_lz4.c1
-rw-r--r--tar/test/test_option_lzma.c2
-rw-r--r--tar/test/test_option_lzop.c1
-rw-r--r--tar/test/test_option_n.c1
-rw-r--r--tar/test/test_option_newer_than.c1
-rw-r--r--tar/test/test_option_nodump.c1
-rw-r--r--tar/test/test_option_older_than.c1
-rw-r--r--tar/test/test_option_owner.c84
-rw-r--r--tar/test/test_option_passphrase.c1
-rw-r--r--tar/test/test_option_q.c1
-rw-r--r--tar/test/test_option_r.c1
-rw-r--r--tar/test/test_option_s.c12
-rw-r--r--tar/test/test_option_safe_writes.c1
-rw-r--r--tar/test/test_option_uid_uname.c1
-rw-r--r--tar/test/test_option_uuencode.c1
-rw-r--r--tar/test/test_option_xattrs.c1
-rw-r--r--tar/test/test_option_xz.c1
-rw-r--r--tar/test/test_option_z.c1
-rw-r--r--tar/test/test_option_zstd.c1
-rw-r--r--tar/test/test_patterns.c1
-rw-r--r--tar/test/test_print_longpath.c1
-rw-r--r--tar/test/test_stdio.c1
-rw-r--r--tar/test/test_strip_components.c1
-rw-r--r--tar/test/test_symlink_dir.c1
-rw-r--r--tar/util.c41
-rw-r--r--tar/write.c3
-rw-r--r--test_utils/test_common.h15
-rw-r--r--test_utils/test_main.c106
-rw-r--r--unzip/CMakeLists.txt41
-rw-r--r--unzip/bsdunzip.1218
-rw-r--r--unzip/bsdunzip.c1290
-rw-r--r--unzip/bsdunzip.h60
-rw-r--r--unzip/bsdunzip_platform.h65
-rw-r--r--unzip/cmdline.c247
-rw-r--r--unzip/la_getline.c99
-rw-r--r--unzip/la_queue.h840
-rw-r--r--unzip/test/CMakeLists.txt83
-rw-r--r--unzip/test/test.h38
-rw-r--r--unzip/test/test_0.c58
-rw-r--r--unzip/test/test_C.c41
-rw-r--r--unzip/test/test_I.c41
-rw-r--r--unzip/test/test_I.zip.uu8
-rw-r--r--unzip/test/test_L.c44
-rw-r--r--unzip/test/test_P_encryption.c41
-rw-r--r--unzip/test/test_Z1.c40
-rw-r--r--unzip/test/test_basic.c44
-rw-r--r--unzip/test/test_basic.zip.uu25
-rw-r--r--unzip/test/test_d.c62
-rw-r--r--unzip/test/test_doubledash.c44
-rw-r--r--unzip/test/test_encrypted.zip.uu13
-rw-r--r--unzip/test/test_glob.c44
-rw-r--r--unzip/test/test_j.c44
-rw-r--r--unzip/test/test_n.c48
-rw-r--r--unzip/test/test_not_exist.c36
-rw-r--r--unzip/test/test_o.c47
-rw-r--r--unzip/test/test_p.c39
-rw-r--r--unzip/test/test_q.c44
-rw-r--r--unzip/test/test_singlefile.c41
-rw-r--r--unzip/test/test_singlefile.zip.uu8
-rw-r--r--unzip/test/test_t.c39
-rw-r--r--unzip/test/test_t_bad.c39
-rw-r--r--unzip/test/test_t_bad.zip.uu25
-rw-r--r--unzip/test/test_version.c34
-rw-r--r--unzip/test/test_x.c80
812 files changed, 12946 insertions, 2367 deletions
diff --git a/.cirrus.yml b/.cirrus.yml
index f882d1451911..9b1c5a72c2cf 100644
--- a/.cirrus.yml
+++ b/.cirrus.yml
@@ -10,23 +10,21 @@ FreeBSD_task:
BS: cmake
matrix:
freebsd_instance:
- image_family: freebsd-13-0
+ image_family: freebsd-14-0
freebsd_instance:
- image_family: freebsd-12-2
- freebsd_instance:
- image_family: freebsd-11-4
+ image_family: freebsd-13-2
prepare_script:
- ./build/ci/cirrus_ci/ci.sh prepare
configure_script:
- env CFLAGS=-I/usr/local/include LDFLAGS=-L/usr/local/lib ./build/ci/build.sh -a autogen
- env CFLAGS=-I/usr/local/include LDFLAGS=-L/usr/local/lib ./build/ci/build.sh -a configure
build_script:
- - ./build/ci/build.sh -a build
+ - env MAKE_ARGS="-j 2" ./build/ci/build.sh -a build
test_script:
- - env SKIP_TEST_RESTORE_ATIME=1 ./build/ci/build.sh -a test
+ - env SKIP_TEST_RESTORE_ATIME=1 MAKE_ARGS="-j 2" ./build/ci/build.sh -a test
- ./build/ci/cirrus_ci/ci.sh test
install_script:
- - ./build/ci/build.sh -a install
+ - env MAKE_ARGS="-j 2" ./build/ci/build.sh -a install
Windows_Cygwin_task:
windows_container:
diff --git a/.github/dependabot.yml b/.github/dependabot.yml
new file mode 100644
index 000000000000..e4b8a2f5e440
--- /dev/null
+++ b/.github/dependabot.yml
@@ -0,0 +1,15 @@
+# To get started with Dependabot version updates, you'll need to specify which
+# package ecosystems to update and where the package manifests are located.
+# Please see the documentation for all configuration options:
+# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
+
+version: 2
+updates:
+ - package-ecosystem: "github-actions"
+ directory: "/"
+ schedule:
+ interval: "weekly"
+ groups:
+ all-actions:
+ patterns:
+ - "*"
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index 0b1565ae1881..3ecc4434cd11 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -2,14 +2,17 @@ name: CI
on: [push, pull_request]
+permissions:
+ contents: read
+
jobs:
MacOS:
- runs-on: macos-latest
+ runs-on: macos-13
strategy:
matrix:
bs: [autotools, cmake]
steps:
- - uses: actions/checkout@master
+ - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
- name: Install dependencies
run: ./build/ci/github_actions/macos.sh prepare
- name: Autogen
@@ -24,32 +27,39 @@ jobs:
run: ./build/ci/build.sh -a build
env:
BS: ${{ matrix.bs }}
+ MAKE_ARGS: -j
- name: Test
run: ./build/ci/build.sh -a test
env:
BS: ${{ matrix.bs }}
SKIP_OPEN_FD_ERR_TEST: 1
+ IGNORE_TRAVERSALS_TEST4: 1
+ MAKE_ARGS: -j
+ CTEST_OUTPUT_ON_FAILURE: ON
- name: Install
run: ./build/ci/build.sh -a install
env:
BS: ${{ matrix.bs }}
+ MAKE_ARGS: -j
- name: Artifact
run: ./build/ci/build.sh -a artifact
env:
BS: ${{ matrix.bs }}
- - uses: actions/upload-artifact@v1
+ - uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
with:
name: libarchive-macos-${{ matrix.bs }}-${{ github.sha }}
path: libarchive.tar.xz
Ubuntu:
- runs-on: ubuntu-20.04
+ runs-on: ubuntu-22.04
strategy:
matrix:
bs: [autotools, cmake]
crypto: [mbedtls, nettle, openssl]
steps:
- - uses: actions/checkout@master
+ - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
+ - name: Update apt cache
+ run: sudo apt-get update
- name: Install dependencies
run: sudo apt-get install -y autoconf automake build-essential cmake git libssl-dev nettle-dev libmbedtls-dev libacl1-dev libbz2-dev liblzma-dev liblz4-dev libzstd-dev lzop pkg-config zlib1g-dev
- name: Autogen
@@ -65,11 +75,14 @@ jobs:
run: ./build/ci/build.sh -a build
env:
BS: ${{ matrix.bs }}
+ MAKE_ARGS: -j
- name: Test
run: ./build/ci/build.sh -a test
env:
BS: ${{ matrix.bs }}
SKIP_OPEN_FD_ERR_TEST: 1
+ MAKE_ARGS: -j
+ CTEST_OUTPUT_ON_FAILURE: ON
- name: Install
run: ./build/ci/build.sh -a install
env:
@@ -78,14 +91,16 @@ jobs:
run: ./build/ci/build.sh -a artifact
env:
BS: ${{ matrix.bs }}
- - uses: actions/upload-artifact@v1
+ - uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
with:
name: libarchive-ubuntu-${{ matrix.bs }}-${{ matrix.crypto }}-${{ github.sha }}
path: libarchive.tar.xz
Ubuntu-distcheck:
- runs-on: ubuntu-20.04
+ runs-on: ubuntu-22.04
steps:
- - uses: actions/checkout@master
+ - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
+ - name: Update package definitions
+ run: sudo apt-get update
- name: Install dependencies
run: sudo apt-get install -y autoconf automake bsdmainutils build-essential cmake ghostscript git groff libssl-dev libacl1-dev libbz2-dev liblzma-dev liblz4-dev libzstd-dev lzop pkg-config zip zlib1g-dev
- name: Autogen
@@ -98,7 +113,7 @@ jobs:
SKIP_OPEN_FD_ERR_TEST: 1
- name: Dist-Artifact
run: ./build/ci/build.sh -a dist-artifact
- - uses: actions/upload-artifact@v1
+ - uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
with:
name: libarchive-${{ github.sha }}
path: libarchive-dist.tar
@@ -106,11 +121,16 @@ jobs:
Windows:
runs-on: windows-2022
strategy:
+ fail-fast: false
matrix:
be: [mingw-gcc, msvc]
steps:
- - uses: actions/checkout@master
- - name: Install dependencies
+ - uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
+ - name: Install mingw
+ if: ${{ matrix.be=='mingw-gcc' }}
+ run: choco install mingw
+ shell: cmd
+ - name: Install library dependencies
run: ./build/ci/github_actions/ci.cmd deplibs
shell: cmd
env:
@@ -130,6 +150,7 @@ jobs:
shell: cmd
env:
BE: ${{ matrix.be }}
+ CTEST_OUTPUT_ON_FAILURE: ON
- name: Install
run: ./build/ci/github_actions/ci.cmd install
shell: cmd
@@ -140,7 +161,7 @@ jobs:
shell: cmd
env:
BE: ${{ matrix.be }}
- - uses: actions/upload-artifact@v1
+ - uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
with:
name: libarchive-windows-${{ matrix.be }}-${{ github.sha }}
path: libarchive.zip
diff --git a/.github/workflows/cifuzz.yml b/.github/workflows/cifuzz.yml
index e5c60e4b0de2..9dd1dc3ec1a0 100644
--- a/.github/workflows/cifuzz.yml
+++ b/.github/workflows/cifuzz.yml
@@ -1,5 +1,9 @@
name: CIFuzz
on: [pull_request]
+
+permissions:
+ contents: read
+
jobs:
Fuzzing:
runs-on: ubuntu-latest
@@ -17,7 +21,7 @@ jobs:
fuzz-seconds: 600
dry-run: false
- name: Upload Crash
- uses: actions/upload-artifact@v1
+ uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
if: failure() && steps.build.outcome == 'success'
with:
name: artifacts
diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml
new file mode 100644
index 000000000000..b9e4dcc48e5a
--- /dev/null
+++ b/.github/workflows/codeql.yml
@@ -0,0 +1,43 @@
+name: "CodeQL"
+
+permissions:
+ contents: read
+
+on:
+ push:
+ branches: [ "master", "3.5" ]
+ pull_request:
+ branches: [ "master" ]
+ schedule:
+ - cron: "49 4 * * 2"
+
+jobs:
+ analyze:
+ name: Analyze
+ runs-on: ubuntu-latest
+ permissions:
+ actions: read
+ security-events: write
+
+ strategy:
+ fail-fast: false
+ matrix:
+ language: [ cpp ]
+
+ steps:
+ - name: Checkout
+ uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
+
+ - name: Initialize CodeQL
+ uses: github/codeql-action/init@05963f47d870e2cb19a537396c1f668a348c7d8f # v3.24.8
+ with:
+ languages: ${{ matrix.language }}
+ queries: +security-and-quality
+
+ - name: Autobuild
+ uses: github/codeql-action/autobuild@05963f47d870e2cb19a537396c1f668a348c7d8f # v3.24.8
+
+ - name: Perform CodeQL Analysis
+ uses: github/codeql-action/analyze@05963f47d870e2cb19a537396c1f668a348c7d8f # v3.24.8
+ with:
+ category: "/language:${{ matrix.language }}"
diff --git a/.github/workflows/scorecard.yml b/.github/workflows/scorecard.yml
new file mode 100644
index 000000000000..b6c4f17a9b31
--- /dev/null
+++ b/.github/workflows/scorecard.yml
@@ -0,0 +1,65 @@
+# This workflow uses actions that are not certified by GitHub. They are provided
+# by a third-party and are governed by separate terms of service, privacy
+# policy, and support documentation.
+
+name: Scorecard supply-chain security
+on:
+ # For Branch-Protection check. Only the default branch is supported. See
+ # https://github.com/ossf/scorecard/blob/main/docs/checks.md#branch-protection
+ branch_protection_rule:
+ # To guarantee Maintained check is occasionally updated. See
+ # https://github.com/ossf/scorecard/blob/main/docs/checks.md#maintained
+ schedule:
+ - cron: '42 8 * * 0'
+ push:
+ branches: [ "master" ]
+
+# Declare default permissions as read only.
+permissions: read-all
+
+jobs:
+ analysis:
+ name: Scorecard analysis
+ runs-on: ubuntu-latest
+ permissions:
+ # Needed to upload the results to code-scanning dashboard.
+ security-events: write
+ # Needed to publish results and get a badge (see publish_results below).
+ id-token: write
+
+ steps:
+ - name: "Checkout code"
+ uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
+ with:
+ persist-credentials: false
+
+ - name: "Run analysis"
+ uses: ossf/scorecard-action@0864cf19026789058feabb7e87baa5f140aac736 # v2.3.1
+ with:
+ results_file: results.sarif
+ results_format: sarif
+ # (Optional) "write" PAT token. Uncomment the `repo_token` line below if:
+ # you want to enable the Branch-Protection check on a *public* repository
+ # To create the PAT, follow the steps in
+ # https://github.com/ossf/scorecard-action#authentication-with-fine-grained-pat-optional
+ # repo_token: ${{ secrets.SCORECARD_TOKEN }}
+
+ # - Publish results to OpenSSF REST API for easy access by consumers
+ # - Allows the repository to include the Scorecard badge.
+ # - See https://github.com/ossf/scorecard-action#publishing-results.
+ publish_results: true
+
+ # Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
+ # format to the repository Actions tab.
+ - name: "Upload artifact"
+ uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
+ with:
+ name: SARIF file
+ path: results.sarif
+ retention-days: 5
+
+ # Upload the results to GitHub's code scanning dashboard.
+ - name: "Upload to code-scanning"
+ uses: github/codeql-action/upload-sarif@05963f47d870e2cb19a537396c1f668a348c7d8f # v3.24.8
+ with:
+ sarif_file: results.sarif
diff --git a/.gitignore b/.gitignore
index 6b4d2dc76455..8dc637ee132d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -16,6 +16,7 @@ autom4te.cache/
bsdcat
bsdcpio
bsdtar
+bsdunzip
build/autoconf/compile
build/autoconf/config.guess
build/autoconf/config.sub
@@ -41,10 +42,12 @@ libarchive/test/list.h
libtool
stamp-h1
tar/test/list.h
+unzip/test/list.h
CMakeCache.txt
CMakeFiles/
DartConfiguration.tcl
cmake.tmp/
+.vscode/
doc/html/*.html
doc/man/*.1
@@ -72,3 +75,5 @@ test-suite.log
.sw?
.*.sw?
+
+*.pdb
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1e1ff575fd36..c0fbd70b38e8 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -6,6 +6,9 @@ endif()
if(POLICY CMP0074)
cmake_policy(SET CMP0074 NEW) #3.12.0 `find_package()`` uses ``<PackageName>_ROOT`` variables.
endif()
+if(POLICY CMP0075)
+ cmake_policy(SET CMP0075 NEW) #3.12.0 `check_include_file()`` and friends use ``CMAKE_REQUIRED_LIBRARIES``.
+endif()
#
PROJECT(libarchive C)
#
@@ -20,8 +23,9 @@ endif()
# Release : Release build
# RelWithDebInfo : Release build with Debug Info
# MinSizeRel : Release Min Size build
+# None : No build type
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".
@@ -31,12 +35,12 @@ IF("${cached_type}" STREQUAL "UNINITIALIZED")
ENDIF("${cached_type}" STREQUAL "UNINITIALIZED")
# Check the Build Type.
IF(NOT "${CMAKE_BUILD_TYPE}"
- MATCHES "^(Debug|Release|RelWithDebInfo|MinSizeRel)\$")
+ MATCHES "^(Debug|Release|RelWithDebInfo|MinSizeRel|None)\$")
MESSAGE(FATAL_ERROR
"Unknown keyword for CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}\n"
- "Acceptable keywords: Debug,Release,RelWithDebInfo,MinSizeRel")
+ "Acceptable keywords: Debug,Release,RelWithDebInfo,MinSizeRel,None")
ENDIF(NOT "${CMAKE_BUILD_TYPE}"
- MATCHES "^(Debug|Release|RelWithDebInfo|MinSizeRel)\$")
+ MATCHES "^(Debug|Release|RelWithDebInfo|MinSizeRel|None)\$")
# On MacOS, prefer MacPorts libraries to system libraries.
# I haven't come up with a compelling argument for this to be conditional.
@@ -65,6 +69,7 @@ SET(VERSION "${_major}.${_trimmed_minor}.${_trimmed_revision}
SET(BSDCPIO_VERSION_STRING "${VERSION}")
SET(BSDTAR_VERSION_STRING "${VERSION}")
SET(BSDCAT_VERSION_STRING "${VERSION}")
+SET(BSDUNZIP_VERSION_STRING "${VERSION}")
SET(LIBARCHIVE_VERSION_NUMBER "${_version_number}")
SET(LIBARCHIVE_VERSION_STRING "${VERSION}")
@@ -123,8 +128,6 @@ IF (CMAKE_C_COMPILER_ID MATCHES "^GNU$" OR
# either of the following two, yet neither is supported as of 3.0.2
# - check_linker_flag - does not exist
# - try_compile - does not support linker flags
- #
- # The CI fails with this on MacOS
IF(NOT CMAKE_SYSTEM_NAME MATCHES "Darwin")
# Place the functions and data into separate sections, allowing the linker
# to garbage collect the unused ones.
@@ -134,6 +137,9 @@ IF (CMAKE_C_COMPILER_ID MATCHES "^GNU$" OR
# Printing the discarded section is "too much", so enable on demand.
#SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -Wl,--print-gc-sections")
#SET(CMAKE_SHARED_LINKER_FLAGS_DEBUG "${CMAKE_SHARED_LINKER_FLAGS_DEBUG} -Wl,--print-gc-sections")
+ ELSE()
+ SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-dead_strip")
+ SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-dead_strip")
ENDIF(NOT CMAKE_SYSTEM_NAME MATCHES "Darwin")
ENDIF (CMAKE_C_COMPILER_ID MATCHES "^GNU$" OR
CMAKE_C_COMPILER_ID MATCHES "^Clang$")
@@ -199,6 +205,8 @@ ENDIF (MSVC)
# Enable CTest/CDash support
include(CTest)
+option(BUILD_SHARED_LIBS "Build shared libraries" ON)
+
OPTION(ENABLE_MBEDTLS "Enable use of mbed TLS" OFF)
OPTION(ENABLE_NETTLE "Enable use of Nettle" OFF)
OPTION(ENABLE_OPENSSL "Enable use of OpenSSL" ON)
@@ -213,7 +221,8 @@ 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)
+OPTION(ENABLE_PCRE2POSIX "Enable the use of the system PCRE2POSIX 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)
@@ -223,6 +232,13 @@ OPTION(ENABLE_CPIO "Enable cpio building" ON)
OPTION(ENABLE_CPIO_SHARED "Enable dynamic build of cpio" FALSE)
OPTION(ENABLE_CAT "Enable cat building" ON)
OPTION(ENABLE_CAT_SHARED "Enable dynamic build of cat" FALSE)
+IF(WIN32 AND NOT CYGWIN)
+ SET(ENABLE_UNZIP FALSE)
+ SET(ENABLE_UNZIP_SHARED FALSE)
+ELSE()
+ OPTION(ENABLE_UNZIP "Enable unzip building" ON)
+ OPTION(ENABLE_UNZIP_SHARED "Enable dynamic build of unzip" FALSE)
+ENDIF()
OPTION(ENABLE_XATTR "Enable extended attribute support" ON)
OPTION(ENABLE_ACL "Enable ACL support" ON)
OPTION(ENABLE_ICONV "Enable iconv support" ON)
@@ -232,7 +248,7 @@ OPTION(ENABLE_INSTALL "Enable installing of libraries" ON)
SET(POSIX_REGEX_LIB "AUTO" CACHE STRING "Choose what library should provide POSIX regular expression support")
SET(ENABLE_SAFESEH "AUTO" CACHE STRING "Enable use of /SAFESEH linker flag (MSVC only)")
-SET(WINDOWS_VERSION "WIN7" CACHE STRING "Set Windows version to use (Windows only)")
+SET(WINDOWS_VERSION "WIN10" CACHE STRING "Set Windows version to use (Windows only)")
IF(ENABLE_COVERAGE)
include(LibarchiveCodeCoverage)
@@ -243,7 +259,11 @@ IF(ENABLE_TEST)
ENDIF(ENABLE_TEST)
IF(WIN32)
- IF(WINDOWS_VERSION STREQUAL "WIN8")
+ IF(WINDOWS_VERSION STREQUAL "WIN10")
+ SET(NTDDI_VERSION 0x0A000000)
+ SET(_WIN32_WINNT 0x0A00)
+ SET(WINVER 0x0A00)
+ ELSEIF(WINDOWS_VERSION STREQUAL "WIN8")
SET(NTDDI_VERSION 0x06020000)
SET(_WIN32_WINNT 0x0602)
SET(WINVER 0x0602)
@@ -267,12 +287,12 @@ IF(WIN32)
SET(NTDDI_VERSION 0x05010000)
SET(_WIN32_WINNT 0x0501)
SET(WINVER 0x0501)
- ELSE(WINDOWS_VERSION STREQUAL "WIN8")
+ ELSE(WINDOWS_VERSION STREQUAL "WIN10")
# Default to Windows Server 2003 API if we don't recognize the specifier
SET(NTDDI_VERSION 0x05020000)
SET(_WIN32_WINNT 0x0502)
SET(WINVER 0x0502)
- ENDIF(WINDOWS_VERSION STREQUAL "WIN8")
+ ENDIF(WINDOWS_VERSION STREQUAL "WIN10")
ENDIF(WIN32)
IF(MSVC)
@@ -295,6 +315,7 @@ ENDIF()
IF(MINGW)
ADD_DEFINITIONS(-D__USE_MINGW_ANSI_STDIO)
+ ADD_DEFINITIONS(-D__MINGW_USE_VC2005_COMPAT)
ENDIF()
#
@@ -365,7 +386,11 @@ MACRO (TRY_MACRO_FOR_LIBRARY INCLUDES LIBRARIES
IF("${TRY_TYPE}" MATCHES "COMPILES")
CHECK_C_SOURCE_COMPILES("${SAMPLE_SOURCE}" ${VAR})
ELSEIF("${TRY_TYPE}" MATCHES "RUNS")
- CHECK_C_SOURCE_RUNS("${SAMPLE_SOURCE}" ${VAR})
+ IF(CMAKE_CROSSCOMPILING)
+ MESSAGE(WARNING "Cannot test run \"${VAR}\" when cross-compiling")
+ ELSE(CMAKE_CROSSCOMPILING)
+ CHECK_C_SOURCE_RUNS("${SAMPLE_SOURCE}" ${VAR})
+ ENDIF(CMAKE_CROSSCOMPILING)
ELSE("${TRY_TYPE}" MATCHES "COMPILES")
MESSAGE(FATAL_ERROR "UNKNOWN KEYWORD \"${TRY_TYPE}\" FOR TRY_TYPE")
ENDIF("${TRY_TYPE}" MATCHES "COMPILES")
@@ -503,12 +528,16 @@ IF(LIBLZMA_FOUND)
COMPILES
"#include <lzma.h>\nint main() {return (int)lzma_version_number(); }"
"WITHOUT_LZMA_API_STATIC;LZMA_API_STATIC")
+ CHECK_C_SOURCE_COMPILES(
+ "#include <lzma.h>\n#if LZMA_VERSION < 50020000\n#error unsupported\n#endif\nint main(void){int ignored __attribute__((unused)); ignored = lzma_stream_encoder_mt(0, 0); return 0;}"
+ HAVE_LZMA_STREAM_ENCODER_MT)
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)
CMAKE_POP_CHECK_STATE()
ELSE(LIBLZMA_FOUND)
# LZMA not found and will not be used.
+ SET(HAVE_LZMA_STREAM_ENCODER_MT 0)
ENDIF(LIBLZMA_FOUND)
MARK_AS_ADVANCED(CLEAR LIBLZMA_INCLUDE_DIR)
MARK_AS_ADVANCED(CLEAR LIBLZMA_LIBRARY)
@@ -562,6 +591,7 @@ IF(LIBB2_FOUND)
SET(HAVE_BLAKE2_H 1)
SET(ARCHIVE_BLAKE2 FALSE)
LIST(APPEND ADDITIONAL_LIBS ${LIBB2_LIBRARY})
+ INCLUDE_DIRECTORIES(${LIBB2_INCLUDE_DIR})
CMAKE_PUSH_CHECK_STATE()
SET(CMAKE_REQUIRED_LIBRARIES ${LIBB2_LIBRARY})
SET(CMAKE_REQUIRED_INCLUDES ${LIBB2_INCLUDE_DIR})
@@ -610,8 +640,13 @@ IF(ENABLE_ZSTD)
SET(ZSTD_FIND_QUIETLY TRUE)
ENDIF (ZSTD_INCLUDE_DIR)
- FIND_PATH(ZSTD_INCLUDE_DIR zstd.h)
- FIND_LIBRARY(ZSTD_LIBRARY NAMES zstd libzstd)
+ IF(UNIX)
+ FIND_PACKAGE(PkgConfig QUIET)
+ PKG_SEARCH_MODULE(PC_ZSTD libzstd)
+ ENDIF()
+
+ FIND_PATH(ZSTD_INCLUDE_DIR zstd.h HINTS ${PC_ZSTD_INCLUDEDIR} ${PC_ZSTD_INCLUDE_DIRS})
+ FIND_LIBRARY(ZSTD_LIBRARY NAMES zstd libzstd HINTS ${PC_ZSTD_LIBDIR} ${PC_ZSTD_LIBRARY_DIRS})
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(ZSTD DEFAULT_MSG ZSTD_LIBRARY ZSTD_INCLUDE_DIR)
ELSE(ENABLE_ZSTD)
@@ -625,7 +660,7 @@ IF(ZSTD_FOUND)
SET(CMAKE_REQUIRED_LIBRARIES ${ZSTD_LIBRARY})
SET(CMAKE_REQUIRED_INCLUDES ${ZSTD_INCLUDE_DIR})
CHECK_FUNCTION_EXISTS(ZSTD_decompressStream HAVE_LIBZSTD)
- CHECK_FUNCTION_EXISTS(ZSTD_compressStream HAVE_LIBZSTD_COMPRESSOR)
+ CHECK_FUNCTION_EXISTS(ZSTD_compressStream HAVE_ZSTD_compressStream)
#
# TODO: test for static library.
#
@@ -666,6 +701,7 @@ CHECK_C_SOURCE_COMPILES("#include <sys/ioctl.h>
int main(void) { return EXT2_IOC_GETFLAGS; }" HAVE_WORKING_EXT2_IOC_GETFLAGS)
LA_CHECK_INCLUDE_FILE("fcntl.h" HAVE_FCNTL_H)
+LA_CHECK_INCLUDE_FILE("fnmatch.h" HAVE_FNMATCH_H)
LA_CHECK_INCLUDE_FILE("grp.h" HAVE_GRP_H)
LA_CHECK_INCLUDE_FILE("inttypes.h" HAVE_INTTYPES_H)
LA_CHECK_INCLUDE_FILE("io.h" HAVE_IO_H)
@@ -705,6 +741,7 @@ 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/queue.h" HAVE_SYS_QUEUE_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)
@@ -724,9 +761,9 @@ LA_CHECK_INCLUDE_FILE("wchar.h" HAVE_WCHAR_H)
LA_CHECK_INCLUDE_FILE("wctype.h" HAVE_WCTYPE_H)
LA_CHECK_INCLUDE_FILE("windows.h" HAVE_WINDOWS_H)
IF(ENABLE_CNG)
- LA_CHECK_INCLUDE_FILE("Bcrypt.h" HAVE_BCRYPT_H)
+ LA_CHECK_INCLUDE_FILE("bcrypt.h" HAVE_BCRYPT_H)
IF(HAVE_BCRYPT_H)
- LIST(APPEND ADDITIONAL_LIBS "Bcrypt")
+ LIST(APPEND ADDITIONAL_LIBS "bcrypt")
ENDIF(HAVE_BCRYPT_H)
ELSE(ENABLE_CNG)
UNSET(HAVE_BCRYPT_H CACHE)
@@ -803,6 +840,10 @@ IF(ENABLE_OPENSSL AND NOT CMAKE_SYSTEM_NAME MATCHES "Darwin")
SET(HAVE_LIBCRYPTO 1)
INCLUDE_DIRECTORIES(${OPENSSL_INCLUDE_DIR})
LIST(APPEND ADDITIONAL_LIBS ${OPENSSL_CRYPTO_LIBRARY})
+ SET(CMAKE_REQUIRED_LIBRARIES ${OPENSSL_CRYPTO_LIBRARY})
+ SET(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR})
+ LA_CHECK_INCLUDE_FILE("openssl/evp.h" HAVE_OPENSSL_EVP_H)
+ CHECK_FUNCTION_EXISTS(PKCS5_PBKDF2_HMAC_SHA1 HAVE_PKCS5_PBKDF2_HMAC_SHA1)
ENDIF(OPENSSL_FOUND)
ELSE()
SET(OPENSSL_FOUND FALSE) # Override cached value
@@ -1152,7 +1193,7 @@ ENDIF(ENABLE_ICONV)
#
# Find Libxml2
#
-IF(ENABLE_LIBXML2)
+IF(ENABLE_LIBXML2 AND HAVE_ICONV)
FIND_PACKAGE(LibXml2)
ELSE()
SET(LIBXML2_FOUND FALSE)
@@ -1255,9 +1296,10 @@ IF(NOT FOUND_POSIX_REGEX_LIB AND POSIX_REGEX_LIB MATCHES "^(AUTO|LIBPCREPOSIX)$"
#
# If requested, try finding library for PCREPOSIX
#
- IF(ENABLE_LibGCC)
- FIND_PACKAGE(LibGCC)
+ IF(ENABLE_LIBGCC)
+ FIND_PACKAGE(LIBGCC)
ELSE()
+ MESSAGE(FATAL_ERROR "libgcc not found.")
SET(LIBGCC_FOUND FALSE) # Override cached value
ENDIF()
IF(ENABLE_PCREPOSIX)
@@ -1312,6 +1354,68 @@ IF(NOT FOUND_POSIX_REGEX_LIB AND POSIX_REGEX_LIB MATCHES "^(AUTO|LIBPCREPOSIX)$"
MARK_AS_ADVANCED(CLEAR LIBGCC_LIBRARIES)
ENDIF(NOT FOUND_POSIX_REGEX_LIB AND POSIX_REGEX_LIB MATCHES "^(AUTO|LIBPCREPOSIX)$")
+IF(NOT FOUND_POSIX_REGEX_LIB AND POSIX_REGEX_LIB MATCHES "^(AUTO|LIBPCRE2POSIX)$")
+ #
+ # If requested, try finding library for PCRE2POSIX
+ #
+ IF(ENABLE_LIBGCC)
+ FIND_PACKAGE(LIBGCC)
+ ELSE()
+ MESSAGE(FATAL_ERROR "libgcc not found.")
+ SET(LIBGCC_FOUND FALSE) # Override cached value
+ ENDIF()
+ IF(ENABLE_PCRE2POSIX)
+ FIND_PACKAGE(PCRE2POSIX)
+ ELSE()
+ SET(PCRE2POSIX_FOUND FALSE) # Override cached value
+ ENDIF()
+ IF(PCRE2POSIX_FOUND)
+ INCLUDE_DIRECTORIES(${PCRE2_INCLUDE_DIR})
+ LIST(APPEND ADDITIONAL_LIBS ${PCRE2POSIX_LIBRARIES})
+ # Test if a macro is needed for the library.
+ TRY_MACRO_FOR_LIBRARY(
+ "${PCRE2_INCLUDE_DIR}" "${PCRE2POSIX_LIBRARIES}"
+ COMPILES
+ "#include <pcre2posix.h>\nint main() {regex_t r;return pcre2_regcomp(&r, \"\", 0);}"
+ "WITHOUT_PCRE2_STATIC;PCRE2_STATIC")
+ IF(NOT WITHOUT_PCRE2_STATIC AND PCRE2_STATIC)
+ ADD_DEFINITIONS(-DPCRE2_STATIC)
+ ELSEIF(NOT WITHOUT_PCRE2_STATIC AND NOT PCRE2_STATIC AND PCRE2_FOUND)
+ # Determine if pcre2 static libraries are to be used.
+ LIST(APPEND ADDITIONAL_LIBS ${PCRE2_LIBRARIES})
+ SET(TMP_LIBRARIES ${PCRE2POSIX_LIBRARIES} ${PCRE2_LIBRARIES})
+ MESSAGE(STATUS "trying again with -lpcre2-8 included")
+ TRY_MACRO_FOR_LIBRARY(
+ "${PCRE2_INCLUDE_DIR}" "${TMP_LIBRARIES}"
+ COMPILES
+ "#include <pcre2posix.h>\nint main() {regex_t r;return pcre2_regcomp(&r, \"\", 0);}"
+ "WITHOUT_PCRE2_STATIC;PCRE2_STATIC")
+ IF(NOT WITHOUT_PCRE2_STATIC AND PCRE2_STATIC)
+ ADD_DEFINITIONS(-DPCRE2_STATIC)
+ ELSEIF(NOT WITHOUT_PCRE2_STATIC AND NOT PCRE2_STATIC AND MSVC AND LIBGCC_FOUND)
+ # When doing a Visual Studio build using pcre2 static libraries
+ # built using the mingw toolchain, -lgcc is needed to resolve
+ # ___chkstk_ms.
+ MESSAGE(STATUS "Visual Studio build detected, trying again with -lgcc included")
+ LIST(APPEND ADDITIONAL_LIBS ${LIBGCC_LIBRARIES})
+ SET(TMP_LIBRARIES ${PCRE2POSIX_LIBRARIES} ${PCRE2_LIBRARIES} ${LIBGCC_LIBRARIES})
+ TRY_MACRO_FOR_LIBRARY(
+ "${PCRE2_INCLUDE_DIR}" "${TMP_LIBRARIES}"
+ COMPILES
+ "#include <pcre2posix.h>\nint main() {regex_t r;return pcre2_regcomp(&r, \"\", 0);}"
+ "WITHOUT_PCRE2_STATIC;PCRE2_STATIC")
+ IF(NOT WITHOUT_PCRE2_STATIC AND PCRE2_STATIC)
+ ADD_DEFINITIONS(-DPCRE2_STATIC)
+ ENDIF(NOT WITHOUT_PCRE2_STATIC AND PCRE2_STATIC)
+ ENDIF(NOT WITHOUT_PCRE2_STATIC AND PCRE2_STATIC)
+ ENDIF(NOT WITHOUT_PCRE2_STATIC AND PCRE2_STATIC)
+ ENDIF(PCRE2POSIX_FOUND)
+ MARK_AS_ADVANCED(CLEAR PCRE2_INCLUDE_DIR)
+ MARK_AS_ADVANCED(CLEAR PCRE2POSIX_LIBRARIES)
+ MARK_AS_ADVANCED(CLEAR PCRE2_LIBRARIES)
+ MARK_AS_ADVANCED(CLEAR LIBGCC_LIBRARIES)
+ENDIF(NOT FOUND_POSIX_REGEX_LIB AND POSIX_REGEX_LIB MATCHES "^(AUTO|LIBPCRE2POSIX)$")
+
#
# Check functions
#
@@ -1338,6 +1442,7 @@ CHECK_FUNCTION_EXISTS_GLIBC(fchmod HAVE_FCHMOD)
CHECK_FUNCTION_EXISTS_GLIBC(fchown HAVE_FCHOWN)
CHECK_FUNCTION_EXISTS_GLIBC(fcntl HAVE_FCNTL)
CHECK_FUNCTION_EXISTS_GLIBC(fdopendir HAVE_FDOPENDIR)
+CHECK_FUNCTION_EXISTS_GLIBC(fnmatch HAVE_FNMATCH)
CHECK_FUNCTION_EXISTS_GLIBC(fork HAVE_FORK)
CHECK_FUNCTION_EXISTS_GLIBC(fstat HAVE_FSTAT)
CHECK_FUNCTION_EXISTS_GLIBC(fstatat HAVE_FSTATAT)
@@ -1350,6 +1455,7 @@ CHECK_FUNCTION_EXISTS_GLIBC(futimesat HAVE_FUTIMESAT)
CHECK_FUNCTION_EXISTS_GLIBC(geteuid HAVE_GETEUID)
CHECK_FUNCTION_EXISTS_GLIBC(getgrgid_r HAVE_GETGRGID_R)
CHECK_FUNCTION_EXISTS_GLIBC(getgrnam_r HAVE_GETGRNAM_R)
+CHECK_FUNCTION_EXISTS_GLIBC(getline HAVE_GETLINE)
CHECK_FUNCTION_EXISTS_GLIBC(getpwnam_r HAVE_GETPWNAM_R)
CHECK_FUNCTION_EXISTS_GLIBC(getpwuid_r HAVE_GETPWUID_R)
CHECK_FUNCTION_EXISTS_GLIBC(getpid HAVE_GETPID)
@@ -1402,12 +1508,12 @@ CHECK_FUNCTION_EXISTS_GLIBC(wcscmp HAVE_WCSCMP)
CHECK_FUNCTION_EXISTS_GLIBC(wcscpy HAVE_WCSCPY)
CHECK_FUNCTION_EXISTS_GLIBC(wcslen HAVE_WCSLEN)
CHECK_FUNCTION_EXISTS_GLIBC(wctomb HAVE_WCTOMB)
-CHECK_FUNCTION_EXISTS_GLIBC(_ctime64_s HAVE__CTIME64_S)
CHECK_FUNCTION_EXISTS_GLIBC(_fseeki64 HAVE__FSEEKI64)
CHECK_FUNCTION_EXISTS_GLIBC(_get_timezone HAVE__GET_TIMEZONE)
-CHECK_FUNCTION_EXISTS_GLIBC(_gmtime64_s HAVE__GMTIME64_S)
-CHECK_FUNCTION_EXISTS_GLIBC(_localtime64_s HAVE__LOCALTIME64_S)
-CHECK_FUNCTION_EXISTS_GLIBC(_mkgmtime64 HAVE__MKGMTIME64)
+CHECK_SYMBOL_EXISTS(ctime_s "time.h" HAVE_CTIME_S)
+CHECK_SYMBOL_EXISTS(gmtime_s "time.h" HAVE_GMTIME_S)
+CHECK_SYMBOL_EXISTS(localtime_s "time.h" HAVE_LOCALTIME_S)
+CHECK_SYMBOL_EXISTS(_mkgmtime "time.h" HAVE__MKGMTIME)
SET(CMAKE_REQUIRED_LIBRARIES "")
CHECK_FUNCTION_EXISTS(cygwin_conv_path HAVE_CYGWIN_CONV_PATH)
@@ -1450,7 +1556,6 @@ CHECK_C_SOURCE_COMPILES(
"#include <fcntl.h>\n#include <unistd.h>\nint main() {char buf[10]; return readlinkat(AT_FDCWD, \"\", buf, 0);}"
HAVE_READLINKAT)
-
# To verify major(), we need to both include the header
# of interest and verify that the result can be linked.
# CHECK_FUNCTION_EXISTS doesn't accept a header argument,
@@ -1462,14 +1567,6 @@ CHECK_C_SOURCE_COMPILES(
"#include <sys/sysmacros.h>\nint main() { return major(256); }"
MAJOR_IN_SYSMACROS)
-IF(ENABLE_LZMA)
-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)
-ELSE()
- SET(HAVE_LZMA_STREAM_ENCODER_MT 0)
-ENDIF(ENABLE_LZMA)
-
IF(HAVE_STRERROR_R)
SET(HAVE_DECL_STRERROR_R 1)
ENDIF(HAVE_STRERROR_R)
@@ -1549,7 +1646,7 @@ ENDIF()
#
#
CHECK_STRUCT_HAS_MEMBER("struct tm" tm_sec
- "sys/types.h;sys/time.h;time.h" TIME_WITH_SYS_TIME)
+ "sys/types.h;sys/time.h;time.h" HAVE_SYS_TIME_H)
#
# Check for integer types
@@ -2024,6 +2121,17 @@ CHECK_CRYPTO("MD5;RMD160;SHA1;SHA256;SHA512" LIBMD)
CHECK_CRYPTO_WIN("MD5;SHA1;SHA256;SHA384;SHA512")
+# Check visibility annotations
+SET(OLD_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}")
+SET(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -fvisibility=hidden -Werror")
+CHECK_C_SOURCE_COMPILES("void __attribute__((visibility(\"default\"))) foo(void);
+int main() { return 0; }" HAVE_VISIBILITY_ATTR)
+IF (HAVE_VISIBILITY_ATTR)
+ SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden")
+ ADD_DEFINITIONS(-D__LIBARCHIVE_ENABLE_VISIBILITY)
+ENDIF(HAVE_VISIBILITY_ATTR)
+SET(CMAKE_REQUIRED_FLAGS "${OLD_CMAKE_REQUIRED_FLAGS}")
+
# Generate "config.h" from "build/cmake/config.h.in"
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/build/cmake/config.h.in
${CMAKE_CURRENT_BINARY_DIR}/config.h)
@@ -2071,3 +2179,4 @@ add_subdirectory(libarchive)
add_subdirectory(cat)
add_subdirectory(tar)
add_subdirectory(cpio)
+add_subdirectory(unzip)
diff --git a/Makefile.am b/Makefile.am
index 743aaa0db05c..286f08694c43 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -8,17 +8,17 @@ ACLOCAL_AMFLAGS = -I build/autoconf
#
lib_LTLIBRARIES= libarchive.la
noinst_LTLIBRARIES= libarchive_fe.la
-bin_PROGRAMS= $(bsdtar_programs) $(bsdcpio_programs) $(bsdcat_programs)
-man_MANS= $(libarchive_man_MANS) $(bsdtar_man_MANS) $(bsdcpio_man_MANS) $(bsdcat_man_MANS)
-BUILT_SOURCES= libarchive/test/list.h tar/test/list.h cpio/test/list.h cat/test/list.h
+bin_PROGRAMS= $(bsdtar_programs) $(bsdcpio_programs) $(bsdcat_programs) $(bsdunzip_programs)
+man_MANS= $(libarchive_man_MANS) $(bsdtar_man_MANS) $(bsdcpio_man_MANS) $(bsdcat_man_MANS) $(bsdunzip_man_MANS)
+BUILT_SOURCES= libarchive/test/list.h tar/test/list.h cpio/test/list.h cat/test/list.h unzip/test/list.h
#
# What to test: We always test libarchive, test bsdtar and bsdcpio only
# if we built them.
#
-check_PROGRAMS= libarchive_test $(bsdtar_test_programs) $(bsdcpio_test_programs) $(bsdcat_test_programs)
-TESTS= libarchive_test $(bsdtar_test_programs) $(bsdcpio_test_programs) $(bsdcat_test_programs)
-TESTS_ENVIRONMENT= $(libarchive_TESTS_ENVIRONMENT) $(bsdtar_TESTS_ENVIRONMENT) $(bsdcpio_TESTS_ENVIRONMENT) $(bsdcat_TESTS_ENVIRONMENT)
+check_PROGRAMS= libarchive_test $(bsdtar_test_programs) $(bsdcpio_test_programs) $(bsdcat_test_programs) $(bsdunzip_test_programs)
+TESTS= libarchive_test $(bsdtar_test_programs) $(bsdcpio_test_programs) $(bsdcat_test_programs) $(bsdunzip_test_programs)
+TESTS_ENVIRONMENT= $(libarchive_TESTS_ENVIRONMENT) $(bsdtar_TESTS_ENVIRONMENT) $(bsdcpio_TESTS_ENVIRONMENT) $(bsdcat_TESTS_ENVIRONMENT) $(bsdunzip_TESTS_ENVIRONMENT)
# Always build and test both bsdtar and bsdcpio as part of 'distcheck'
DISTCHECK_CONFIGURE_FLAGS = --enable-bsdtar --enable-bsdcpio
# The next line is commented out by default in shipping libarchive releases.
@@ -49,7 +49,9 @@ EXTRA_DIST= \
$(bsdcpio_EXTRA_DIST) \
$(bsdcpio_test_EXTRA_DIST) \
$(bsdcat_EXTRA_DIST) \
- $(bsdcat_test_EXTRA_DIST)
+ $(bsdcat_test_EXTRA_DIST) \
+ $(bsdunzip_EXTRA_DIST) \
+ $(bsdunzip_test_EXTRA_DIST)
# a) Clean out some unneeded files and directories
# b) Collect all documentation and format it for distribution.
@@ -69,7 +71,8 @@ DISTCLEANFILES= \
libarchive/test/list.h \
tar/test/list.h \
cpio/test/list.h \
- cat/test/list.h
+ cat/test/list.h \
+ unzip/test/list.h
distclean-local:
-rm -rf .ref
@@ -82,7 +85,9 @@ distclean-local:
-[ -f cpio/Makefile ] && cd cpio && make clean
-[ -f cpio/test/Makefile ] && cd cpio/test && make clean
-[ -f cat/Makefile ] && cd cat && make clean
- -[ -f cpio/test/Makefile ] && cd cat/test && make clean
+ -[ -f cat/test/Makefile ] && cd cat/test && make clean
+ -[ -f unzip/Makefile ] && cd unzip && make clean
+ -[ -f unzip/test/Makefile ] && cd unzip/test && make clean
#
# Libarchive headers, source, etc.
@@ -284,7 +289,7 @@ 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) $(GC_SECTIONS)
+libarchive_la_LDFLAGS= -no-undefined -version-info $(ARCHIVE_LIBTOOL_VERSION) $(DEAD_CODE_REMOVAL)
libarchive_la_LIBADD= $(LTLIBICONV)
# Manpages to install
@@ -449,6 +454,7 @@ libarchive_test_SOURCES= \
libarchive/test/test_read_filter_program.c \
libarchive/test/test_read_filter_program_signature.c \
libarchive/test/test_read_filter_uudecode.c \
+ libarchive/test/test_read_filter_uudecode_raw.c \
libarchive/test/test_read_format_7zip.c \
libarchive/test/test_read_format_7zip_encryption_data.c \
libarchive/test/test_read_format_7zip_encryption_partially.c \
@@ -513,6 +519,7 @@ libarchive_test_SOURCES= \
libarchive/test/test_read_format_tar_empty_filename.c \
libarchive/test/test_read_format_tar_empty_with_gnulabel.c \
libarchive/test/test_read_format_tar_filename.c \
+ libarchive/test/test_read_format_tar_invalid_pax_size.c \
libarchive/test/test_read_format_tbz.c \
libarchive/test/test_read_format_tgz.c \
libarchive/test/test_read_format_tlz.c \
@@ -626,13 +633,15 @@ libarchive_test_SOURCES= \
libarchive/test/test_write_format_xar.c \
libarchive/test/test_write_format_xar_empty.c \
libarchive/test/test_write_format_zip.c \
+ libarchive/test/test_write_format_zip64_stream.c \
libarchive/test/test_write_format_zip_compression_store.c \
- libarchive/test/test_write_format_zip_entry_size_unset.c \
libarchive/test/test_write_format_zip_empty.c \
libarchive/test/test_write_format_zip_empty_zip64.c \
+ libarchive/test/test_write_format_zip_entry_size_unset.c \
libarchive/test/test_write_format_zip_file.c \
libarchive/test/test_write_format_zip_file_zip64.c \
libarchive/test/test_write_format_zip_large.c \
+ libarchive/test/test_write_format_zip_stream.c \
libarchive/test/test_write_format_zip_zip64.c \
libarchive/test/test_write_open_memory.c \
libarchive/test/test_write_read_format_zip.c \
@@ -683,6 +692,8 @@ libarchive_test_EXTRA_DIST=\
libarchive/test/test_compat_lz4_B7BD.tar.lz4.uu \
libarchive/test/test_compat_lzip_1.tlz.uu \
libarchive/test/test_compat_lzip_2.tlz.uu \
+ libarchive/test/test_compat_lzip_3.lz.uu \
+ libarchive/test/test_compat_lzip_4.tlz.uu \
libarchive/test/test_compat_lzma_1.tlz.uu \
libarchive/test/test_compat_lzma_2.tlz.uu \
libarchive/test/test_compat_lzma_3.tlz.uu \
@@ -742,6 +753,8 @@ libarchive_test_EXTRA_DIST=\
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_filter_uudecode_raw.uu \
+ libarchive/test/test_read_filter_uudecode_base64_raw.uu \
libarchive/test/test_read_format_mtree_crash747.mtree.bz2.uu \
libarchive/test/test_read_format_mtree_noprint.mtree.uu \
libarchive/test/test_read_format_7zip_bcj2_bzip2.7z.uu \
@@ -762,6 +775,7 @@ libarchive_test_EXTRA_DIST=\
libarchive/test/test_read_format_7zip_copy.7z.uu \
libarchive/test/test_read_format_7zip_copy_2.7z.uu \
libarchive/test/test_read_format_7zip_deflate.7z.uu \
+ libarchive/test/test_read_format_7zip_deflate_arm64.7z.uu \
libarchive/test/test_read_format_7zip_delta_lzma1.7z.uu \
libarchive/test/test_read_format_7zip_delta4_lzma1.7z.uu \
libarchive/test/test_read_format_7zip_delta_lzma2.7z.uu \
@@ -775,11 +789,19 @@ libarchive_test_EXTRA_DIST=\
libarchive/test/test_read_format_7zip_lzma1_2.7z.uu \
libarchive/test/test_read_format_7zip_lzma1_lzma2.7z.uu \
libarchive/test/test_read_format_7zip_lzma2.7z.uu \
+ libarchive/test/test_read_format_7zip_lzma2_arm64.7z.uu \
+ libarchive/test/test_read_format_7zip_lzma2_arm.7z.uu \
libarchive/test/test_read_format_7zip_malformed.7z.uu \
libarchive/test/test_read_format_7zip_malformed2.7z.uu \
libarchive/test/test_read_format_7zip_packinfo_digests.7z.uu \
libarchive/test/test_read_format_7zip_ppmd.7z.uu \
+ libarchive/test/test_read_format_7zip_solid_zstd.7z.uu \
libarchive/test/test_read_format_7zip_symbolic_name.7z.uu \
+ libarchive/test/test_read_format_7zip_win_attrib.7z.uu \
+ libarchive/test/test_read_format_7zip_zstd_arm.7z.uu \
+ libarchive/test/test_read_format_7zip_zstd_bcj.7z.uu \
+ libarchive/test/test_read_format_7zip_zstd_nobcj.7z.uu \
+ libarchive/test/test_read_format_7zip_zstd.7z.uu \
libarchive/test/test_read_format_ar.ar.uu \
libarchive/test/test_read_format_cab_1.cab.uu \
libarchive/test/test_read_format_cab_2.cab.uu \
@@ -905,6 +927,7 @@ libarchive_test_EXTRA_DIST=\
libarchive/test/test_read_format_tar_empty_with_gnulabel.tar.uu \
libarchive/test/test_read_format_tar_empty_pax.tar.Z.uu \
libarchive/test/test_read_format_tar_filename_koi8r.tar.Z.uu \
+ libarchive/test/test_read_format_tar_invalid_pax_size.tar.uu \
libarchive/test/test_read_format_ustar_filename_cp866.tar.Z.uu \
libarchive/test/test_read_format_ustar_filename_eucjp.tar.Z.uu \
libarchive/test/test_read_format_ustar_filename_koi8r.tar.Z.uu \
@@ -1031,7 +1054,7 @@ endif
bsdtar_LDADD= libarchive.la libarchive_fe.la $(LTLIBICONV)
bsdtar_CPPFLAGS= -I$(top_srcdir)/libarchive -I$(top_srcdir)/libarchive_fe $(bsdtar_ccstatic) $(PLATFORMCPPFLAGS)
-bsdtar_LDFLAGS= $(bsdtar_ldstatic) $(GC_SECTIONS)
+bsdtar_LDFLAGS= $(bsdtar_ldstatic) $(DEAD_CODE_REMOVAL)
bsdtar_EXTRA_DIST= \
tar/bsdtar.1 \
@@ -1091,6 +1114,7 @@ bsdtar_test_SOURCES= \
tar/test/test_option_exclude_vcs.c \
tar/test/test_option_fflags.c \
tar/test/test_option_gid_gname.c \
+ tar/test/test_option_group.c \
tar/test/test_option_grzip.c \
tar/test/test_option_ignore_zeros.c \
tar/test/test_option_j.c \
@@ -1104,6 +1128,7 @@ bsdtar_test_SOURCES= \
tar/test/test_option_newer_than.c \
tar/test/test_option_nodump.c \
tar/test/test_option_older_than.c \
+ tar/test/test_option_owner.c \
tar/test/test_option_passphrase.c \
tar/test/test_option_q.c \
tar/test/test_option_r.c \
@@ -1197,7 +1222,7 @@ endif
bsdcpio_LDADD= libarchive_fe.la libarchive.la $(LTLIBICONV)
bsdcpio_CPPFLAGS= -I$(top_srcdir)/libarchive -I$(top_srcdir)/libarchive_fe $(bsdcpio_ccstatic) $(PLATFORMCPPFLAGS)
-bsdcpio_LDFLAGS= $(bsdcpio_ldstatic) $(GC_SECTIONS)
+bsdcpio_LDFLAGS= $(bsdcpio_ldstatic) $(DEAD_CODE_REMOVAL)
bsdcpio_EXTRA_DIST= \
cpio/bsdcpio.1 \
@@ -1351,7 +1376,7 @@ endif
bsdcat_LDADD= libarchive_fe.la libarchive.la $(LTLIBICONV)
bsdcat_CPPFLAGS= -I$(top_srcdir)/libarchive -I$(top_srcdir)/libarchive_fe $(bsdcat_ccstatic) $(PLATFORMCPPFLAGS)
-bsdcat_LDFLAGS= $(bsdcat_ldstatic) $(GC_SECTIONS)
+bsdcat_LDFLAGS= $(bsdcat_ldstatic) $(DEAD_CODE_REMOVAL)
bsdcat_EXTRA_DIST= \
cat/bsdcat.1 \
@@ -1402,6 +1427,7 @@ bsdcat_test_CPPFLAGS= \
bsdcat_test_LDADD=libarchive_fe.la
cat/test/list.h: Makefile
+ $(MKDIR_P) cat/test
cat $(top_srcdir)/cat/test/test_*.c | grep '^DEFINE_TEST' > cat/test/list.h
if BUILD_BSDCAT
@@ -1426,3 +1452,108 @@ bsdcat_test_EXTRA_DIST= \
cat/test/test_expand.plain.uu \
cat/test/test_expand.xz.uu \
cat/test/CMakeLists.txt
+
+#
+#
+# bsdunzip source, docs, etc.
+#
+#
+
+bsdunzip_SOURCES= \
+ unzip/bsdunzip.c \
+ unzip/bsdunzip.h \
+ unzip/bsdunzip_platform.h \
+ unzip/cmdline.c \
+ unzip/la_getline.c \
+ unzip/la_queue.h
+
+if INC_WINDOWS_FILES
+bsdunzip_SOURCES+=
+endif
+
+bsdunzip_DEPENDENCIES = libarchive.la libarchive_fe.la
+
+
+if STATIC_BSDUNZIP
+bsdunzip_ldstatic= -static
+bsdunzip_ccstatic= -DLIBARCHIVE_STATIC
+else
+bsdunzip_ldstatic=
+bsdunzip_ccstatic=
+endif
+
+bsdunzip_LDADD= libarchive_fe.la libarchive.la $(LTLIBICONV)
+bsdunzip_CPPFLAGS= -I$(top_srcdir)/libarchive -I$(top_srcdir)/libarchive_fe $(bsdunzip_ccstatic) $(PLATFORMCPPFLAGS)
+bsdunzip_LDFLAGS= $(bsdunzip_ldstatic) $(DEAD_CODE_REMOVAL)
+
+bsdunzip_EXTRA_DIST= \
+ unzip/bsdunzip.1 \
+ unzip/CMakeLists.txt
+
+
+if BUILD_BSDUNZIP
+# Manpages to install
+bsdunzip_man_MANS= unzip/bsdunzip.1
+bsdunzip_programs= bsdunzip
+else
+bsdunzip_man_MANS=
+bsdunzip_programs=
+endif
+
+#
+# bsdunzip_test
+#
+
+bsdunzip_test_SOURCES= \
+ $(test_utils_SOURCES) \
+ unzip/test/test.h \
+ unzip/test/test_0.c \
+ unzip/test/test_basic.c \
+ unzip/test/test_doubledash.c \
+ unzip/test/test_glob.c \
+ unzip/test/test_not_exist.c \
+ unzip/test/test_singlefile.c \
+ unzip/test/test_C.c \
+ unzip/test/test_p.c \
+ unzip/test/test_d.c \
+ unzip/test/test_j.c \
+ unzip/test/test_L.c \
+ unzip/test/test_n.c \
+ unzip/test/test_o.c \
+ unzip/test/test_q.c \
+ unzip/test/test_t.c \
+ unzip/test/test_t_bad.c \
+ unzip/test/test_version.c \
+ unzip/test/test_x.c \
+ unzip/test/test_Z1.c \
+ unzip/test/test_P_encryption.c \
+ unzip/test/test_I.c
+
+bsdunzip_test_CPPFLAGS= \
+ -I$(top_srcdir)/libarchive -I$(top_srcdir)/libarchive_fe \
+ -I$(top_srcdir)/test_utils \
+ -I$(top_srcdir)/unzip -I$(top_srcdir)/unzip/test \
+ -I$(top_builddir)/unzip/test \
+ $(PLATFORMCPPFLAGS)
+bsdunzip_test_LDADD=libarchive_fe.la
+
+unzip/test/list.h: Makefile
+ $(MKDIR_P) unzip/test
+ cat $(top_srcdir)/unzip/test/test_*.c | grep '^DEFINE_TEST' > unzip/test/list.h
+
+if BUILD_BSDUNZIP
+bsdunzip_test_programs= bsdunzip_test
+bsdunzip_TESTS_ENVIRONMENT= BSDUNZIP=`cd $(top_builddir);/bin/pwd`/bsdunzip$(EXEEXT) BSDUNZIP_TEST_FILES=`cd $(top_srcdir);/bin/pwd`/unzip/test
+else
+bsdunzip_test_programs=
+bsdunzip_TESTS_ENVIRONMENT=
+endif
+
+bsdunzip_test_EXTRA_DIST= \
+ unzip/test/list.h \
+ unzip/test/test_basic.zip.uu \
+ unzip/test/test_encrypted.zip.uu \
+ unzip/test/test_singlefile.zip.uu \
+ unzip/test/test_t_bad.zip.uu \
+ unzip/test/test_I.zip.uu \
+ unzip/test/CMakeLists.txt
diff --git a/NEWS b/NEWS
index 0ccdb5d61b04..f4395fd1c979 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,17 @@
+Apr 08, 2024: libarchive 3.7.3 released
+
+Sep 12, 2023: libarchive 3.7.2 released
+
+Jul 29, 2023: libarchive 3.7.1 released
+
+Jul 18, 2023: libarchive 3.7.0 released
+
+Jul 14, 2023: bsdunzip port from FreeBSD
+
+Dec 07, 2022: libarchive 3.6.2 released
+
+Apr 08, 2022: libarchive 3.6.1 released
+
Feb 09, 2022: libarchive 3.6.0 released
Feb 08, 2022: libarchive 3.5.3 released
diff --git a/README.md b/README.md
index d5ef70c2191d..727ed49856b6 100644
--- a/README.md
+++ b/README.md
@@ -7,7 +7,7 @@ command-line tools that use the libarchive library.
## Questions? Issues?
-* http://www.libarchive.org is the home for ongoing
+* https://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
@@ -23,6 +23,7 @@ This distribution bundle includes the following major components:
* **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
+* **unzip**: the 'bsdunzip' program is a simple replacement tool for Info-ZIP's unzip
* **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.
@@ -37,6 +38,7 @@ The top-level directory contains the following information files:
* **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
@@ -71,6 +73,7 @@ know about any errors or omissions you find.
## Supported Formats
Currently, the library automatically detects and reads the following formats:
+
* Old V7 tar archives
* POSIX ustar
* GNU tar format (including GNU long filenames, long link names, and sparse files)
@@ -85,13 +88,14 @@ Currently, the library automatically detects and reads the following formats:
* ZIPX archives (with support for bzip2, ppmd8, lzma and xz compressed entries)
* GNU and BSD 'ar' archives
* 'mtree' format
- * 7-Zip archives
+ * 7-Zip archives (including archives that use zstandard compression)
* Microsoft CAB format
* LHA and LZH archives
* RAR and RAR 5.0 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
@@ -103,6 +107,7 @@ The library also detects and handles any of the following before evaluating the
* zstandard 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
@@ -122,6 +127,7 @@ The library can create archives in any of the following formats:
* XAR archives
When creating archives, the result can be filtered with any of the following:
+
* uuencode
* gzip compression
* bzip2 compression
@@ -187,6 +193,17 @@ questions we are asked about libarchive:
functions. On those platforms, libarchive will use the non-thread-safe
functions. Patches to improve this are of great interest to us.
+* The function `archive_write_disk_header()` is _not_ thread safe on
+ POSIX machines and could lead to security issue resulting in world
+ writeable directories. Thus it must be mutexed by the calling code.
+ This is due to calling `umask(oldumask = umask(0))`, which sets the
+ umask for the whole process to 0 for a short time frame.
+ In case other thread calls the same function in parallel, it might
+ get interrupted by it and cause the executable to use umask=0 for the
+ remaining execution.
+ This will then lead to implicitely created directories to have 777
+ permissions without sticky bit.
+
* 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
diff --git a/SECURITY.md b/SECURITY.md
new file mode 100644
index 000000000000..6ca188b603fe
--- /dev/null
+++ b/SECURITY.md
@@ -0,0 +1,19 @@
+# Security Policy
+
+If you have discovered a security vulnerability in this project, please report it
+privately. **Do not disclose it as a public issue.** This gives us time to work with you
+to fix the issue before public exposure, reducing the chance that the exploit will be
+used before a patch is released.
+
+You may submit the report in the following ways:
+
+- send an email to security@libarchive.de; and/or
+- send us a [private vulnerability report](https://github.com/libarchive/libarchive/security/advisories/new)
+
+Please provide the following information in your report:
+
+- A description of the vulnerability and its impact
+- How to reproduce the issue
+
+This project is maintained by volunteers on a reasonable-effort basis. As such, we ask
+that you give me 90 days to work on a fix before public exposure.
diff --git a/build/ci/build.sh b/build/ci/build.sh
index 79f26d758f35..0cc131cfd8cb 100755
--- a/build/ci/build.sh
+++ b/build/ci/build.sh
@@ -97,9 +97,6 @@ if [ -n "${DEBUG}" ]; then
else
export CFLAGS="-g -fsanitize=address"
fi
- if [ "${BS}" = "cmake" ]; then
- CMAKE_ARGS="${CMAKE_ARGS} -DCMAKE_C_CFLAGS=-g -fsanitize=address"
- fi
fi
if [ -z "${ACTIONS}" ]; then
ACTIONS="autogen configure build test install"
diff --git a/build/ci/github_actions/ci.cmd b/build/ci/github_actions/ci.cmd
index 7adb98f913a5..990475d1b8f0 100755
--- a/build/ci/github_actions/ci.cmd
+++ b/build/ci/github_actions/ci.cmd
@@ -1,7 +1,7 @@
@ECHO OFF
-SET ZLIB_VERSION=1.2.11
-SET BZIP2_VERSION=b7a672291188a6469f71dd13ad14f2f9a7344fc8
-SET XZ_VERSION=5.2.5
+SET ZLIB_VERSION=1.3
+SET BZIP2_VERSION=1ea1ac188ad4b9cb662e3f8314673c63df95a589
+SET XZ_VERSION=5.4.4
IF NOT "%BE%"=="mingw-gcc" (
IF NOT "%BE%"=="msvc" (
ECHO Environment variable BE must be mingw-gcc or msvc
@@ -9,9 +9,18 @@ IF NOT "%BE%"=="mingw-gcc" (
)
)
+REM v1.5.6 has a bug with the CMake files & MSVC
+REM https://github.com/facebook/zstd/issues/3999
+REM Fall back to 1.5.5 for MSVC until fixed
+IF "%BE%"=="msvc" (
+ SET ZSTD_VERSION=1.5.5
+) ELSE (
+ SET ZSTD_VERSION=1.5.6
+)
+
SET ORIGPATH=%PATH%
IF "%BE%"=="mingw-gcc" (
- SET MINGWPATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\cmake\bin;C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw64\bin
+ SET MINGWPATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\cmake\bin;C:\ProgramData\mingw64\mingw64\bin
)
IF "%1"=="deplibs" (
@@ -43,6 +52,14 @@ IF "%1"=="deplibs" (
echo Unpacking xz-%XZ_VERSION%.zip
C:\windows\system32\tar.exe -x -f xz-%XZ_VERSION%.zip || EXIT /b 1
)
+ IF NOT EXIST zstd-%ZSTD_VERSION%.zip (
+ echo Downloading https://github.com/facebook/zstd/archive/refs/tags/v%ZSTD_VERSION%.zip
+ curl -L -o zstd-%ZSTD_VERSION%.zip https://github.com/facebook/zstd/archive/refs/tags/v%ZSTD_VERSION%.zip || EXIT /b 1
+ )
+ IF NOT EXIST zstd-%ZSTD_VERSION% (
+ echo Unpacking zstd-%ZSTD_VERSION%.zip
+ C:\windows\system32\tar.exe -x -f zstd-%ZSTD_VERSION%.zip || EXIT /b 1
+ )
CD zlib-%ZLIB_VERSION%
IF "%BE%"=="mingw-gcc" (
SET PATH=%MINGWPATH%
@@ -82,16 +99,28 @@ IF "%1"=="deplibs" (
cmake --build . --target ALL_BUILD --config Release || EXIT /b 1
cmake --build . --target INSTALL --config Release || EXIT /b 1
)
+ CD ..
+ CD zstd-%ZSTD_VERSION%\build\cmake
+ IF "%BE%"=="mingw-gcc" (
+ SET PATH=%MINGWPATH%
+ cmake -G "MinGW Makefiles" -D CMAKE_BUILD_TYPE="Release" . || EXIT /b 1
+ mingw32-make || EXIT /b 1
+ mingw32-make install || EXIT /b 1
+ ) ELSE IF "%BE%"=="msvc" (
+ cmake -G "Visual Studio 17 2022" -D CMAKE_BUILD_TYPE="Release" . || EXIT /b 1
+ cmake --build . --target ALL_BUILD --config Release || EXIT /b 1
+ cmake --build . --target INSTALL --config Release || EXIT /b 1
+ )
) ELSE IF "%1%"=="configure" (
IF "%BE%"=="mingw-gcc" (
SET PATH=%MINGWPATH%
MKDIR build_ci\cmake
CD build_ci\cmake
- cmake -G "MinGW Makefiles" -D ZLIB_LIBRARY="C:/Program Files (x86)/zlib/lib/libzlibstatic.a" -D ZLIB_INCLUDE_DIR="C:/Program Files (x86)/zlib/include" -D BZIP2_LIBRARIES="C:/Program Files (x86)/bzip2/lib/libbz2.a" -D BZIP2_INCLUDE_DIR="C:/Program Files (x86)/bzip2/include" -D LIBLZMA_LIBRARY="C:/Program Files (x86)/xz/lib/liblzma.a" -D LIBLZMA_INCLUDE_DIR="C:/Program Files (x86)/xz/include" ..\.. || EXIT /b 1
+ cmake -G "MinGW Makefiles" -D ZLIB_LIBRARY="C:/Program Files (x86)/zlib/lib/libzlibstatic.a" -D ZLIB_INCLUDE_DIR="C:/Program Files (x86)/zlib/include" -D BZIP2_LIBRARIES="C:/Program Files (x86)/bzip2/lib/libbz2_static.a" -D BZIP2_INCLUDE_DIR="C:/Program Files (x86)/bzip2/include" -D LIBLZMA_LIBRARY="C:/Program Files (x86)/xz/lib/liblzma.a" -D LIBLZMA_INCLUDE_DIR="C:/Program Files (x86)/xz/include" -D ZSTD_LIBRARY="C:/Program Files (x86)/zstd/lib/libzstd.a" -D ZSTD_INCLUDE_DIR="C:/Program Files (x86)/zstd/include" ..\.. || EXIT /b 1
) ELSE IF "%BE%"=="msvc" (
MKDIR build_ci\cmake
CD build_ci\cmake
- cmake -G "Visual Studio 17 2022" -D CMAKE_BUILD_TYPE="Release" -D ZLIB_LIBRARY="C:/Program Files (x86)/zlib/lib/zlibstatic.lib" -D ZLIB_INCLUDE_DIR="C:/Program Files (x86)/zlib/include" -D BZIP2_LIBRARIES="C:/Program Files (x86)/bzip2/lib/bz2.lib" -D BZIP2_INCLUDE_DIR="C:/Program Files (x86)/bzip2/include" -D LIBLZMA_LIBRARY="C:/Program Files (x86)/xz/lib/liblzma.lib" -D LIBLZMA_INCLUDE_DIR="C:/Program Files (x86)/xz/include" ..\.. || EXIT /b 1
+ cmake -G "Visual Studio 17 2022" -D CMAKE_BUILD_TYPE="Release" -D ZLIB_LIBRARY="C:/Program Files (x86)/zlib/lib/zlibstatic.lib" -D ZLIB_INCLUDE_DIR="C:/Program Files (x86)/zlib/include" -D BZIP2_LIBRARIES="C:/Program Files (x86)/bzip2/lib/bz2_static.lib" -D BZIP2_INCLUDE_DIR="C:/Program Files (x86)/bzip2/include" -D LIBLZMA_LIBRARY="C:/Program Files (x86)/xz/lib/liblzma.lib" -D LIBLZMA_INCLUDE_DIR="C:/Program Files (x86)/xz/include" -D ZSTD_LIBRARY="C:/Program Files (x86)/zstd/lib/zstd_static.lib" -D ZSTD_INCLUDE_DIR="C:/Program Files (x86)/zstd/include" ..\.. || EXIT /b 1
)
) ELSE IF "%1%"=="build" (
IF "%BE%"=="mingw-gcc" (
diff --git a/build/cmake/FindLibGCC.cmake b/build/cmake/FindLIBGCC.cmake
index 5883ff802642..5883ff802642 100644
--- a/build/cmake/FindLibGCC.cmake
+++ b/build/cmake/FindLIBGCC.cmake
diff --git a/build/cmake/FindMbedTLS.cmake b/build/cmake/FindMbedTLS.cmake
index a91639589218..aa40485c3ecd 100644
--- a/build/cmake/FindMbedTLS.cmake
+++ b/build/cmake/FindMbedTLS.cmake
@@ -7,7 +7,7 @@ find_library(MBEDCRYPTO_LIBRARY mbedcrypto)
set(MBEDTLS_LIBRARIES "${MBEDTLS_LIBRARY}" "${MBEDX509_LIBRARY}" "${MBEDCRYPTO_LIBRARY}")
include(FindPackageHandleStandardArgs)
-find_package_handle_standard_args(MBEDTLS DEFAULT_MSG
+find_package_handle_standard_args(MbedTLS DEFAULT_MSG
MBEDTLS_INCLUDE_DIRS MBEDTLS_LIBRARY MBEDX509_LIBRARY MBEDCRYPTO_LIBRARY)
mark_as_advanced(MBEDTLS_INCLUDE_DIRS MBEDTLS_LIBRARY MBEDX509_LIBRARY MBEDCRYPTO_LIBRARY)
diff --git a/build/cmake/FindPCRE2POSIX.cmake b/build/cmake/FindPCRE2POSIX.cmake
new file mode 100644
index 000000000000..4104f3791aa8
--- /dev/null
+++ b/build/cmake/FindPCRE2POSIX.cmake
@@ -0,0 +1,34 @@
+# - Find pcre2posix
+# Find the native PCRE2-8 and PCRE2-POSIX include and libraries
+#
+# PCRE2_INCLUDE_DIR - where to find pcre2posix.h, etc.
+# PCRE2POSIX_LIBRARIES - List of libraries when using libpcre2-posix.
+# PCRE2_LIBRARIES - List of libraries when using libpcre2-8.
+# PCRE2POSIX_FOUND - True if libpcre2-posix found.
+# PCRE2_FOUND - True if libpcre2-8 found.
+
+IF (PCRE2_INCLUDE_DIR)
+ # Already in cache, be silent
+ SET(PCRE2_FIND_QUIETLY TRUE)
+ENDIF (PCRE2_INCLUDE_DIR)
+
+FIND_PATH(PCRE2_INCLUDE_DIR pcre2posix.h)
+FIND_LIBRARY(PCRE2POSIX_LIBRARY NAMES pcre2-posix libpcre2-posix pcre2-posix-static)
+FIND_LIBRARY(PCRE2_LIBRARY NAMES pcre2-8 libpcre2-8 pcre2-8-static)
+
+# handle the QUIETLY and REQUIRED arguments and set PCRE2POSIX_FOUND to TRUE if
+# all listed variables are TRUE
+INCLUDE(FindPackageHandleStandardArgs)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(PCRE2POSIX DEFAULT_MSG PCRE2POSIX_LIBRARY PCRE2_INCLUDE_DIR)
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(PCRE2 DEFAULT_MSG PCRE2_LIBRARY)
+
+IF(PCRE2POSIX_FOUND)
+ SET(PCRE2POSIX_LIBRARIES ${PCRE2POSIX_LIBRARY})
+ SET(HAVE_LIBPCRE2POSIX 1)
+ SET(HAVE_PCRE2POSIX_H 1)
+ENDIF(PCRE2POSIX_FOUND)
+
+IF(PCRE2_FOUND)
+ SET(PCRE2_LIBRARIES ${PCRE2_LIBRARY})
+ SET(HAVE_LIBPCRE2 1)
+ENDIF(PCRE2_FOUND)
diff --git a/build/cmake/config.h.in b/build/cmake/config.h.in
index b7f8db7a2e2d..045a6b41657e 100644
--- a/build/cmake/config.h.in
+++ b/build/cmake/config.h.in
@@ -164,7 +164,7 @@ typedef unsigned char uint8_t;
#define HAVE_UINT8_T
#endif
-#if !defined(HAVE_UINT16_T)
+#if !defined(HAVE_UINT8_T)
#error No 8-bit unsigned integer type was found.
#endif
@@ -207,6 +207,9 @@ typedef uint64_t uintmax_t;
/* MD5 via ARCHIVE_CRYPTO_MD5_LIBSYSTEM supported. */
#cmakedefine ARCHIVE_CRYPTO_MD5_LIBSYSTEM 1
+/* MD5 via ARCHIVE_CRYPTO_MD5_MBEDTLS supported. */
+#cmakedefine ARCHIVE_CRYPTO_MD5_MBEDTLS 1
+
/* MD5 via ARCHIVE_CRYPTO_MD5_NETTLE supported. */
#cmakedefine ARCHIVE_CRYPTO_MD5_NETTLE 1
@@ -222,6 +225,9 @@ typedef uint64_t uintmax_t;
/* RMD160 via ARCHIVE_CRYPTO_RMD160_NETTLE supported. */
#cmakedefine ARCHIVE_CRYPTO_RMD160_NETTLE 1
+/* RMD160 via ARCHIVE_CRYPTO_RMD160_MBEDTLS supported. */
+#cmakedefine ARCHIVE_CRYPTO_RMD160_MBEDTLS 1
+
/* RMD160 via ARCHIVE_CRYPTO_RMD160_OPENSSL supported. */
#cmakedefine ARCHIVE_CRYPTO_RMD160_OPENSSL 1
@@ -231,6 +237,9 @@ typedef uint64_t uintmax_t;
/* SHA1 via ARCHIVE_CRYPTO_SHA1_LIBSYSTEM supported. */
#cmakedefine ARCHIVE_CRYPTO_SHA1_LIBSYSTEM 1
+/* SHA1 via ARCHIVE_CRYPTO_SHA1_MBEDTLS supported. */
+#cmakedefine ARCHIVE_CRYPTO_SHA1_MBEDTLS 1
+
/* SHA1 via ARCHIVE_CRYPTO_SHA1_NETTLE supported. */
#cmakedefine ARCHIVE_CRYPTO_SHA1_NETTLE 1
@@ -252,6 +261,9 @@ typedef uint64_t uintmax_t;
/* SHA256 via ARCHIVE_CRYPTO_SHA256_LIBSYSTEM supported. */
#cmakedefine ARCHIVE_CRYPTO_SHA256_LIBSYSTEM 1
+/* SHA256 via ARCHIVE_CRYPTO_SHA256_MBEDTLS supported. */
+#cmakedefine ARCHIVE_CRYPTO_SHA256_MBEDTLS 1
+
/* SHA256 via ARCHIVE_CRYPTO_SHA256_NETTLE supported. */
#cmakedefine ARCHIVE_CRYPTO_SHA256_NETTLE 1
@@ -273,6 +285,9 @@ typedef uint64_t uintmax_t;
/* SHA384 via ARCHIVE_CRYPTO_SHA384_LIBSYSTEM supported. */
#cmakedefine ARCHIVE_CRYPTO_SHA384_LIBSYSTEM 1
+/* SHA384 via ARCHIVE_CRYPTO_SHA384_MBEDTLS supported. */
+#cmakedefine ARCHIVE_CRYPTO_SHA384_MBEDTLS 1
+
/* SHA384 via ARCHIVE_CRYPTO_SHA384_NETTLE supported. */
#cmakedefine ARCHIVE_CRYPTO_SHA384_NETTLE 1
@@ -294,6 +309,9 @@ typedef uint64_t uintmax_t;
/* SHA512 via ARCHIVE_CRYPTO_SHA512_LIBSYSTEM supported. */
#cmakedefine ARCHIVE_CRYPTO_SHA512_LIBSYSTEM 1
+/* SHA512 via ARCHIVE_CRYPTO_SHA512_MBEDTLS supported. */
+#cmakedefine ARCHIVE_CRYPTO_SHA512_MBEDTLS 1
+
/* SHA512 via ARCHIVE_CRYPTO_SHA512_NETTLE supported. */
#cmakedefine ARCHIVE_CRYPTO_SHA512_NETTLE 1
@@ -316,13 +334,16 @@ typedef uint64_t uintmax_t;
#cmakedefine ARCHIVE_XATTR_LINUX 1
/* Version number of bsdcpio */
-#cmakedefine BSDCPIO_VERSION_STRING "${BSDCPIO_VERSION_STRING}"
+#cmakedefine BSDCPIO_VERSION_STRING "@BSDCPIO_VERSION_STRING@"
/* Version number of bsdtar */
-#cmakedefine BSDTAR_VERSION_STRING "${BSDTAR_VERSION_STRING}"
+#cmakedefine BSDTAR_VERSION_STRING "@BSDTAR_VERSION_STRING@"
/* Version number of bsdcat */
-#cmakedefine BSDCAT_VERSION_STRING "${BSDCAT_VERSION_STRING}"
+#cmakedefine BSDCAT_VERSION_STRING "@BSDCAT_VERSION_STRING@"
+
+/* Version number of bsdunzip */
+#cmakedefine BSDUNZIP_VERSION_STRING "@BSDUNZIP_VERSION_STRING@"
/* Define to 1 if you have the `acl_create_entry' function. */
#cmakedefine HAVE_ACL_CREATE_ENTRY 1
@@ -366,7 +387,7 @@ typedef uint64_t uintmax_t;
/* Define to 1 if you have the <attr/xattr.h> header file. */
#cmakedefine HAVE_ATTR_XATTR_H 1
-/* Define to 1 if you have the <Bcrypt.h> header file. */
+/* Define to 1 if you have the <bcrypt.h> header file. */
#cmakedefine HAVE_BCRYPT_H 1
/* Define to 1 if you have the <bsdxml.h> header file. */
@@ -570,6 +591,12 @@ typedef uint64_t uintmax_t;
/* Define to 1 if you have the `flistxattr' function. */
#cmakedefine HAVE_FLISTXATTR 1
+/* Define to 1 if you have the `fnmatch' function. */
+#cmakedefine HAVE_FNMATCH 1
+
+/* Define to 1 if you have the <fnmatch.h> header file. */
+#cmakedefine HAVE_FNMATCH_H 1
+
/* Define to 1 if you have the `fork' function. */
#cmakedefine HAVE_FORK 1
@@ -618,6 +645,9 @@ typedef uint64_t uintmax_t;
/* Define to 1 if you have the `getgrnam_r' function. */
#cmakedefine HAVE_GETGRNAM_R 1
+/* Define to 1 if you have the `getline' function. */
+#cmakedefine HAVE_GETLINE 1
+
/* Define to 1 if you have the `getpid' function. */
#cmakedefine HAVE_GETPID 1
@@ -723,6 +753,12 @@ typedef uint64_t uintmax_t;
/* Define to 1 if you have the `pcreposix' library (-lpcreposix). */
#cmakedefine HAVE_LIBPCREPOSIX 1
+/* Define to 1 if you have the `pcre2-8' library (-lpcre2-8). */
+#cmakedefine HAVE_LIBPCRE2 1
+
+/* Define to 1 if you have the `pcreposix' library (-lpcre2posix). */
+#cmakedefine HAVE_LIBPCRE2POSIX 1
+
/* Define to 1 if you have the `xml2' library (-lxml2). */
#cmakedefine HAVE_LIBXML2 1
@@ -738,9 +774,8 @@ typedef uint64_t uintmax_t;
/* Define to 1 if you have the `zstd' library (-lzstd). */
#cmakedefine HAVE_LIBZSTD 1
-/* Define to 1 if you have the `zstd' library (-lzstd) with compression
- support. */
-#cmakedefine HAVE_LIBZSTD_COMPRESSOR 1
+/* Define to 1 if you have the ZSTD_compressStream function. */
+#cmakedefine HAVE_ZSTD_compressStream 1
/* Define to 1 if you have the <limits.h> header file. */
#cmakedefine HAVE_LIMITS_H 1
@@ -827,6 +862,15 @@ typedef uint64_t uintmax_t;
/* Define to 1 if you have the <lzo/lzoconf.h> header file. */
#cmakedefine HAVE_LZO_LZOCONF_H 1
+/* Define to 1 if you have the <mbedtls/aes.h> header file. */
+#cmakedefine HAVE_MBEDTLS_AES_H 1
+
+/* Define to 1 if you have the <mbedtls/md.h> header file. */
+#cmakedefine HAVE_MBEDTLS_MD_H 1
+
+/* Define to 1 if you have the <mbedtls/pkcs5.h> header file. */
+#cmakedefine HAVE_MBEDTLS_PKCS5_H 1
+
/* Define to 1 if you have the `mbrtowc' function. */
#cmakedefine HAVE_MBRTOWC 1
@@ -878,12 +922,18 @@ typedef uint64_t uintmax_t;
/* Define to 1 if you have the `openat' function. */
#cmakedefine HAVE_OPENAT 1
+/* Define to 1 if you have the <openssl/evp.h> header file. */
+#cmakedefine HAVE_OPENSSL_EVP_H 1
+
/* Define to 1 if you have the <paths.h> header file. */
#cmakedefine HAVE_PATHS_H 1
/* Define to 1 if you have the <pcreposix.h> header file. */
#cmakedefine HAVE_PCREPOSIX_H 1
+/* Define to 1 if you have the <pcre2posix.h> header file. */
+#cmakedefine HAVE_PCRE2POSIX_H 1
+
/* Define to 1 if you have the `pipe' function. */
#cmakedefine HAVE_PIPE 1
@@ -990,6 +1040,12 @@ typedef uint64_t uintmax_t;
/* Define to 1 if you have the `strrchr' function. */
#cmakedefine HAVE_STRRCHR 1
+/* Define to 1 if the system has the type `struct statfs'. */
+#cmakedefine HAVE_STRUCT_STATFS 1
+
+/* Define to 1 if `f_iosize' is a member of `struct statfs'. */
+#cmakedefine HAVE_STRUCT_STATFS_F_IOSIZE 1
+
/* Define to 1 if `f_namemax' is a member of `struct statfs'. */
#cmakedefine HAVE_STRUCT_STATFS_F_NAMEMAX 1
@@ -1073,6 +1129,9 @@ typedef uint64_t uintmax_t;
/* 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/queue.h> header file. */
+#cmakedefine HAVE_SYS_QUEUE_H 1
+
/* Define to 1 if you have the <sys/richacl.h> header file. */
#cmakedefine HAVE_SYS_RICHACL_H 1
@@ -1212,8 +1271,8 @@ typedef uint64_t uintmax_t;
/* Define to 1 if you have the <zstd.h> header file. */
#cmakedefine HAVE_ZSTD_H 1
-/* Define to 1 if you have the `_ctime64_s' function. */
-#cmakedefine HAVE__CTIME64_S 1
+/* Define to 1 if you have the `ctime_s' function. */
+#cmakedefine HAVE_CTIME_S 1
/* Define to 1 if you have the `_fseeki64' function. */
#cmakedefine HAVE__FSEEKI64 1
@@ -1221,23 +1280,23 @@ typedef uint64_t uintmax_t;
/* Define to 1 if you have the `_get_timezone' function. */
#cmakedefine HAVE__GET_TIMEZONE 1
-/* Define to 1 if you have the `_gmtime64_s' function. */
-#cmakedefine HAVE__GMTIME64_S 1
+/* Define to 1 if you have the `gmtime_s' function. */
+#cmakedefine HAVE_GMTIME_S 1
-/* Define to 1 if you have the `_localtime64_s' function. */
-#cmakedefine HAVE__LOCALTIME64_S 1
+/* Define to 1 if you have the `localtime_s' function. */
+#cmakedefine HAVE_LOCALTIME_S 1
-/* Define to 1 if you have the `_mkgmtime64' function. */
-#cmakedefine HAVE__MKGMTIME64 1
+/* Define to 1 if you have the `_mkgmtime' function. */
+#cmakedefine HAVE__MKGMTIME 1
/* Define as const if the declaration of iconv() needs const. */
-#define ICONV_CONST ${ICONV_CONST}
+#define ICONV_CONST @ICONV_CONST@
/* Version number of libarchive as a single integer */
-#cmakedefine LIBARCHIVE_VERSION_NUMBER "${LIBARCHIVE_VERSION_NUMBER}"
+#cmakedefine LIBARCHIVE_VERSION_NUMBER "@LIBARCHIVE_VERSION_NUMBER@"
/* Version number of libarchive */
-#cmakedefine LIBARCHIVE_VERSION_STRING "${LIBARCHIVE_VERSION_STRING}"
+#cmakedefine LIBARCHIVE_VERSION_STRING "@LIBARCHIVE_VERSION_STRING@"
/* Define to 1 if `lstat' dereferences a symlink specified with a trailing
slash. */
@@ -1255,7 +1314,7 @@ typedef uint64_t uintmax_t;
#cmakedefine NO_MINUS_C_MINUS_O 1
/* The size of `wchar_t', as computed by sizeof. */
-#cmakedefine SIZEOF_WCHAR_T ${SIZEOF_WCHAR_T}
+#cmakedefine SIZEOF_WCHAR_T @SIZEOF_WCHAR_T@
/* Define to 1 if strerror_r returns char *. */
#cmakedefine STRERROR_R_CHAR_P 1
@@ -1291,59 +1350,59 @@ typedef uint64_t uintmax_t;
#endif /* SAFE_TO_DEFINE_EXTENSIONS */
/* Version number of package */
-#cmakedefine VERSION "${VERSION}"
+#cmakedefine VERSION "@VERSION@"
/* Number of bits in a file offset, on hosts where this is settable. */
-#cmakedefine _FILE_OFFSET_BITS ${_FILE_OFFSET_BITS}
+#cmakedefine _FILE_OFFSET_BITS @_FILE_OFFSET_BITS@
/* Define to 1 to make fseeko visible on some hosts (e.g. glibc 2.2). */
#cmakedefine _LARGEFILE_SOURCE 1
/* Define for large files, on AIX-style hosts. */
-#cmakedefine _LARGE_FILES ${_LARGE_FILES}
+#cmakedefine _LARGE_FILES @_LARGE_FILES@
/* Define to control Windows SDK version */
#ifndef NTDDI_VERSION
-#cmakedefine NTDDI_VERSION ${NTDDI_VERSION}
+#cmakedefine NTDDI_VERSION @NTDDI_VERSION@
#endif // NTDDI_VERSION
#ifndef _WIN32_WINNT
-#cmakedefine _WIN32_WINNT ${_WIN32_WINNT}
+#cmakedefine _WIN32_WINNT @_WIN32_WINNT@
#endif // _WIN32_WINNT
#ifndef WINVER
-#cmakedefine WINVER ${WINVER}
+#cmakedefine WINVER @WINVER@
#endif // WINVER
/* Define to empty if `const' does not conform to ANSI C. */
-#cmakedefine const ${const}
+#cmakedefine const @const@
/* Define to `int' if <sys/types.h> doesn't define. */
-#cmakedefine gid_t ${gid_t}
+#cmakedefine gid_t @gid_t@
/* Define to `unsigned long' if <sys/types.h> does not define. */
-#cmakedefine id_t ${id_t}
+#cmakedefine id_t @id_t@
/* Define to `int' if <sys/types.h> does not define. */
-#cmakedefine mode_t ${mode_t}
+#cmakedefine mode_t @mode_t@
/* Define to `long long' if <sys/types.h> does not define. */
-#cmakedefine off_t ${off_t}
+#cmakedefine off_t @off_t@
/* Define to `int' if <sys/types.h> doesn't define. */
-#cmakedefine pid_t ${pid_t}
+#cmakedefine pid_t @pid_t@
/* Define to `unsigned int' if <sys/types.h> does not define. */
-#cmakedefine size_t ${size_t}
+#cmakedefine size_t @size_t@
/* Define to `int' if <sys/types.h> does not define. */
-#cmakedefine ssize_t ${ssize_t}
+#cmakedefine ssize_t @ssize_t@
/* Define to `int' if <sys/types.h> doesn't define. */
-#cmakedefine uid_t ${uid_t}
+#cmakedefine uid_t @uid_t@
/* Define to `int' if <sys/types.h> does not define. */
-#cmakedefine intptr_t ${intptr_t}
+#cmakedefine intptr_t @intptr_t@
/* Define to `unsigned int' if <sys/types.h> does not define. */
-#cmakedefine uintptr_t ${uintptr_t}
+#cmakedefine uintptr_t @uintptr_t@
diff --git a/build/pkgconfig/libarchive.pc.in b/build/pkgconfig/libarchive.pc.in
index 4b631e635ccf..1f51e77f1679 100644
--- a/build/pkgconfig/libarchive.pc.in
+++ b/build/pkgconfig/libarchive.pc.in
@@ -10,3 +10,4 @@ Cflags: -I${includedir}
Cflags.private: -DLIBARCHIVE_STATIC
Libs: -L${libdir} -larchive
Libs.private: @LIBS@
+Requires.private: @LIBSREQUIRED@
diff --git a/build/utils/gen_archive_string_composition_h.sh b/build/utils/gen_archive_string_composition_h.sh
index 558e9c0c7cb5..93012fe68ff9 100755
--- a/build/utils/gen_archive_string_composition_h.sh
+++ b/build/utils/gen_archive_string_composition_h.sh
@@ -39,9 +39,6 @@ cat > ${outfile} <<CR_END
* 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\$
- *
*/
/*
diff --git a/build/version b/build/version
index 49c9756b959e..fcdfc39dcee6 100644
--- a/build/version
+++ b/build/version
@@ -1 +1 @@
-3006001dev
+3007003
diff --git a/cat/bsdcat.1 b/cat/bsdcat.1
index 036623e4e4d6..9fa66d60e1e6 100644
--- a/cat/bsdcat.1
+++ b/cat/bsdcat.1
@@ -22,8 +22,6 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $FreeBSD$
-.\"
.Dd March 1, 2014
.Dt BSDCAT 1
.Os
diff --git a/cat/bsdcat.c b/cat/bsdcat.c
index bdb9c40b9150..19d3de65cea4 100644
--- a/cat/bsdcat.c
+++ b/cat/bsdcat.c
@@ -24,7 +24,6 @@
*/
#include "bsdcat_platform.h"
-__FBSDID("$FreeBSD$");
#include <stdio.h>
#ifdef HAVE_STDLIB_H
@@ -37,6 +36,9 @@ __FBSDID("$FreeBSD$");
#include <string.h>
#endif
+#include <archive.h>
+#include <archive_entry.h>
+
#include "bsdcat.h"
#include "err.h"
@@ -48,7 +50,7 @@ static const char *bsdcat_current_path;
static int exit_status = 0;
-void
+static __LA_NORETURN void
usage(FILE *stream, int eval)
{
const char *p;
@@ -58,7 +60,7 @@ usage(FILE *stream, int eval)
exit(eval);
}
-static void
+static __LA_NORETURN void
version(void)
{
printf("bsdcat %s - %s \n",
@@ -67,7 +69,15 @@ version(void)
exit(0);
}
-void
+static void
+bsdcat_print_error(void)
+{
+ lafe_warnc(0, "%s: %s",
+ bsdcat_current_path, archive_error_string(a));
+ exit_status = 1;
+}
+
+static void
bsdcat_next(void)
{
if (a != NULL) {
@@ -82,15 +92,7 @@ bsdcat_next(void)
archive_read_support_format_raw(a);
}
-void
-bsdcat_print_error(void)
-{
- lafe_warnc(0, "%s: %s",
- bsdcat_current_path, archive_error_string(a));
- exit_status = 1;
-}
-
-void
+static void
bsdcat_read_to_stdout(const char* filename)
{
int r;
@@ -130,12 +132,16 @@ main(int argc, char **argv)
switch (c) {
case 'h':
usage(stdout, 0);
- break;
+ /* NOTREACHED */
+ /* Fallthrough */
case OPTION_VERSION:
version();
- break;
+ /* NOTREACHED */
+ /* Fallthrough */
default:
usage(stderr, 1);
+ /* Fallthrough */
+ /* NOTREACHED */
}
}
diff --git a/cat/bsdcat.h b/cat/bsdcat.h
index 6467d6e3d310..504757a44040 100644
--- a/cat/bsdcat.h
+++ b/cat/bsdcat.h
@@ -34,9 +34,6 @@
#include "config.h"
#endif
-#include <archive.h>
-#include <archive_entry.h>
-
struct bsdcat {
/* Option parser state */
int getopt_state;
@@ -53,9 +50,5 @@ enum {
};
int bsdcat_getopt(struct bsdcat *);
-void usage(FILE *stream, int eval);
-void bsdcat_next(void);
-void bsdcat_print_error(void);
-void bsdcat_read_to_stdout(const char* filename);
#endif
diff --git a/cat/bsdcat_platform.h b/cat/bsdcat_platform.h
index 10b711322c37..78a6113e6f01 100644
--- a/cat/bsdcat_platform.h
+++ b/cat/bsdcat_platform.h
@@ -21,8 +21,6 @@
* 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: src/usr.bin/tar/bsdtar_platform.h,v 1.26 2008/12/06 07:37:14 kientzle Exp $
*/
/*
@@ -42,16 +40,6 @@
#include "config.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
-
#ifdef HAVE_LIBARCHIVE
/* If we're using the platform libarchive, include system headers. */
#include <archive.h>
@@ -64,12 +52,14 @@
/* How to mark functions that don't return. */
/* This facilitates use of some newer static code analysis tools. */
-#undef __LA_DEAD
+#undef __LA_NORETURN
#if defined(__GNUC__) && (__GNUC__ > 2 || \
- (__GNUC__ == 2 && __GNUC_MINOR__ >= 5))
-#define __LA_DEAD __attribute__((__noreturn__))
-#else
-#define __LA_DEAD
+ (__GNUC__ == 2 && __GNUC_MINOR__ >= 5))
+#define __LA_NORETURN __attribute__((__noreturn__))
+#elif defined(_MSC_VER)
+#define __LA_NORETURN __declspec(noreturn)
+#else
+#define __LA_NORETURN
#endif
#endif /* !BSDCAT_PLATFORM_H_INCLUDED */
diff --git a/cat/cmdline.c b/cat/cmdline.c
index cae19beb7d4c..ea1e0eed6d0a 100644
--- a/cat/cmdline.c
+++ b/cat/cmdline.c
@@ -24,11 +24,10 @@
*/
/*
- * Command line parser for tar.
+ * Command line parser for bsdcat.
*/
#include "bsdcat_platform.h"
-__FBSDID("$FreeBSD$");
#ifdef HAVE_ERRNO_H
#include <errno.h>
@@ -44,12 +43,12 @@ __FBSDID("$FreeBSD$");
#include "err.h"
/*
- * Short options for tar. Please keep this sorted.
+ * Short options for bsdcat. Please keep this sorted.
*/
static const char *short_options = "h";
/*
- * Long options for tar. Please keep this list sorted.
+ * Long options for bsdcat. Please keep this list sorted.
*
* The symbolic names for options that lack a short equivalent are
* defined in bsdcat.h. Also note that so far I've found no need
@@ -61,7 +60,7 @@ static const struct bsdcat_option {
const char *name;
int required; /* 1 if this option requires an argument. */
int equivalent; /* Equivalent short option. */
-} tar_longopts[] = {
+} bsdcat_longopts[] = {
{ "help", 0, 'h' },
{ "version", 0, OPTION_VERSION },
{ NULL, 0, 0 }
@@ -90,7 +89,7 @@ static const struct bsdcat_option {
* -W long options: There's an obscure GNU convention (only rarely
* supported even there) that allows "-W option=argument" as an
* alternative way to support long options. This was supported in
- * early bsdcat as a way to access long options on platforms that did
+ * early bsdtar as a way to access long options on platforms that did
* not support getopt_long() and is preserved here for backwards
* compatibility. (Of course, if I'd started with a custom
* command-line parser from the beginning, I would have had normal
@@ -223,7 +222,7 @@ bsdcat_getopt(struct bsdcat *bsdcat)
}
/* Search the table for an unambiguous match. */
- for (popt = tar_longopts; popt->name != NULL; popt++) {
+ for (popt = bsdcat_longopts; popt->name != NULL; popt++) {
/* Short-circuit if first chars don't match. */
if (popt->name[0] != bsdcat->getopt_word[0])
continue;
diff --git a/cat/test/test.h b/cat/test/test.h
index 350bcad63464..ec83d476b6b8 100644
--- a/cat/test/test.h
+++ b/cat/test/test.h
@@ -21,8 +21,6 @@
* 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$
*/
/* Every test program should #include "test.h" as the first thing. */
diff --git a/configure.ac b/configure.ac
index 2c9e1f957e11..503bb75ac9f8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4,15 +4,16 @@ dnl First, define all of the version numbers up front.
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.6.1dev])
-m4_define([LIBARCHIVE_VERSION_N],[3006001])
+m4_define([LIBARCHIVE_VERSION_S],[3.7.3])
+m4_define([LIBARCHIVE_VERSION_N],[3007003])
dnl bsdtar and bsdcpio versioning tracks libarchive
m4_define([BSDTAR_VERSION_S],LIBARCHIVE_VERSION_S())
m4_define([BSDCPIO_VERSION_S],LIBARCHIVE_VERSION_S())
m4_define([BSDCAT_VERSION_S],LIBARCHIVE_VERSION_S())
+m4_define([BSDUNZIP_VERSION_S],LIBARCHIVE_VERSION_S())
-AC_PREREQ([2.69])
+AC_PREREQ([2.71])
#
# Now starts the "real" configure script.
@@ -59,6 +60,8 @@ AC_DEFINE([BSDTAR_VERSION_STRING],"BSDTAR_VERSION_S()",
[Version number of bsdtar])
AC_DEFINE([BSDCAT_VERSION_STRING],"BSDTAR_VERSION_S()",
[Version number of bsdcat])
+AC_DEFINE([BSDUNZIP_VERSION_STRING],"BSDUNZIP_VERSION_S()",
+ [Version number of bsdunzip])
# 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
@@ -66,6 +69,7 @@ AC_DEFINE([BSDCAT_VERSION_STRING],"BSDTAR_VERSION_S()",
BSDCPIO_VERSION_STRING=BSDCPIO_VERSION_S()
BSDTAR_VERSION_STRING=BSDTAR_VERSION_S()
BSDCAT_VERSION_STRING=BSDCAT_VERSION_S()
+BSDUNZIP_VERSION_STRING=BSDUNZIP_VERSION_S()
LIBARCHIVE_VERSION_STRING=LIBARCHIVE_VERSION_S()
LIBARCHIVE_VERSION_NUMBER=LIBARCHIVE_VERSION_N()
@@ -76,6 +80,7 @@ AC_SUBST(ARCHIVE_LIBTOOL_VERSION)
AC_SUBST(BSDCPIO_VERSION_STRING)
AC_SUBST(BSDTAR_VERSION_STRING)
AC_SUBST(BSDCAT_VERSION_STRING)
+AC_SUBST(BSDUNZIP_VERSION_STRING)
AC_SUBST(LIBARCHIVE_VERSION_STRING)
AC_SUBST(LIBARCHIVE_VERSION_NUMBER)
@@ -99,13 +104,12 @@ AM_CONDITIONAL([INC_CYGWIN_FILES], [test $inc_cygwin_files = yes])
dnl Defines that are required for specific platforms (e.g. -D_POSIX_SOURCE, etc)
PLATFORMCPPFLAGS=
case "$host_os" in
- *mingw* ) PLATFORMCPPFLAGS=-D__USE_MINGW_ANSI_STDIO ;;
+ *mingw* ) PLATFORMCPPFLAGS=-D__USE_MINGW_ANSI_STDIO -D__MINGW_USE_VC2005_COMPAT ;;
esac
AC_SUBST(PLATFORMCPPFLAGS)
# Checks for programs.
AC_PROG_CC
-AC_PROG_CC_C99
AM_PROG_CC_C_O
AC_PROG_CPP
AC_USE_SYSTEM_EXTENSIONS
@@ -268,12 +272,64 @@ case $host in
;;
esac
+#
+# Options for building bsdunzip.
+#
+# Default is to build bsdunzip, but allow people to override that.
+# Bsdunzip has not yet been ported for Windows
+#
+case "$host_os" in
+ *mingw* | *msys*)
+ enable_bsdunzip=no
+ ;;
+ *)
+ AC_ARG_ENABLE([bsdunzip],
+ [AS_HELP_STRING([--enable-bsdunzip], [enable build of bsdunzip (default)])
+ AS_HELP_STRING([--enable-bsdunzip=static], [force static build of bsdunzip])
+ AS_HELP_STRING([--enable-bsdunzip=shared], [force dynamic build of bsdunzip])
+ AS_HELP_STRING([--disable-bsdunzip], [disable build of bsdunzip])],
+ [], [enable_bsdunzip=yes])
+ ;;
+esac
+
+case "$enable_bsdunzip" in
+yes)
+ if test "$enable_static" = "no"; then
+ static_bsdunzip=no
+ else
+ static_bsdunzip=yes
+ fi
+ build_bsdunzip=yes
+ ;;
+dynamic|shared)
+ if test "$enable_shared" = "no"; then
+ AC_MSG_FAILURE([Shared linking of bsdunzip requires shared libarchive])
+ fi
+ build_bsdunzip=yes
+ static_bsdunzip=no
+ ;;
+static)
+ build_bsdunzip=yes
+ static_bsdunzip=yes
+ ;;
+no)
+ build_bsdunzip=no
+ static_bsdunzip=no
+ ;;
+*)
+ AC_MSG_FAILURE([Unsupported value for --enable-bsdunzip])
+ ;;
+esac
+
+AM_CONDITIONAL([BUILD_BSDUNZIP], [ test "$build_bsdunzip" = yes ])
+AM_CONDITIONAL([STATIC_BSDUNZIP], [ test "$static_bsdunzip" = yes ])
+
# 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])
+AC_CHECK_HEADERS([errno.h ext2fs/ext2_fs.h fcntl.h fnmatch.h grp.h])
AC_CACHE_CHECK([whether EXT2_IOC_GETFLAGS is usable],
[ac_cv_have_decl_EXT2_IOC_GETFLAGS],
@@ -306,7 +362,7 @@ 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/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/ioctl.h sys/mkdev.h sys/mount.h sys/queue.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 sys/sysmacros.h])
AC_CHECK_HEADERS([sys/time.h sys/utime.h sys/utsname.h sys/vfs.h sys/xattr.h])
@@ -378,6 +434,9 @@ if test "x$with_iconv" != "xno"; then
AC_CHECK_HEADERS([localcharset.h])
am_save_LIBS="$LIBS"
LIBS="${LIBS} ${LIBICONV}"
+ if test -n "$LIBICONV"; then
+ LIBSREQUIRED="$LIBSREQUIRED${LIBSREQUIRED:+ }iconv"
+ fi
AC_CHECK_FUNCS([locale_charset])
LIBS="${am_save_LIBS}"
if test "x$ac_cv_func_locale_charset" != "xyes"; then
@@ -402,7 +461,7 @@ if test "x$with_zstd" != "xno"; then
AC_CHECK_HEADERS([zstd.h])
AC_CHECK_LIB(zstd,ZSTD_decompressStream)
AC_CHECK_LIB(zstd,ZSTD_compressStream,
- AC_DEFINE([HAVE_LIBZSTD_COMPRESSOR], [1], [Define to 1 if you have the `zstd' library (-lzstd) with compression support.]))
+ AC_DEFINE([HAVE_ZSTD_compressStream], [1], [Define to 1 if you have the `zstd' library (-lzstd) with compression support.]))
fi
AC_ARG_WITH([lzma],
@@ -423,11 +482,24 @@ if test "x$with_lzma" != "xno"; then
[#if LZMA_VERSION < 50020000]
[#error unsupported]
[#endif]],
- [[lzma_stream_encoder_mt(0, 0);]])],
+ [[int ignored __attribute__((unused)); ignored = 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
AC_DEFINE([HAVE_LZMA_STREAM_ENCODER_MT], [1], [Define to 1 if you have the `lzma_stream_encoder_mt' function.])
fi
+
+ AC_CACHE_CHECK(
+ [whether we have ARM64 filter support in lzma],
+ ac_cv_lzma_has_arm64,
+ [AC_LINK_IFELSE([
+ AC_LANG_PROGRAM([[#include <lzma.h>]
+ [#ifndef LZMA_FILTER_ARM64]
+ [#error unsupported]
+ [#endif]])],
+ [ac_cv_lzma_has_arm64=yes], [ac_cv_lzma_has_arm64=no])])
+ if test "x$ac_cv_lzma_has_arm64" != xno; then
+ AC_DEFINE([HAVE_LZMA_FILTER_ARM64], [1], [Define to 1 if you have the `LZMA_FILTER_ARM64' macro.])
+ fi
fi
AC_ARG_WITH([lzo2],
@@ -480,6 +552,7 @@ AC_ARG_ENABLE([posix-regex-lib],
AS_HELP_STRING([--enable-posix-regex-lib=libc], [use libc POSIX regular expression support])
AS_HELP_STRING([--enable-posix-regex-lib=libregex], [use libregex POSIX regular expression support])
AS_HELP_STRING([--enable-posix-regex-lib=libpcreposix], [use libpcreposix POSIX regular expression support])
+ AS_HELP_STRING([--enable-posix-regex-lib=libpcre2posix], [use libpcre2-posix POSIX regular expression support])
AS_HELP_STRING([--disable-posix-regex-lib], [don't enable POSIX regular expression support])],
[], [enable_posix_regex_lib=auto])
@@ -531,6 +604,39 @@ if test -z $posix_regex_lib_found && (test "$enable_posix_regex_lib" = "auto" ||
posix_regex_lib_found=1
fi
fi
+if test -z $posix_regex_lib_found && (test "$enable_posix_regex_lib" = "auto" || test "$enable_posix_regex_lib" = "libpcre2posix"); then
+ AC_CHECK_HEADERS([pcre2posix.h])
+ AC_CHECK_LIB(pcre2-posix,regcomp)
+ if test "x$ac_cv_lib_pcre2posix_regcomp" != xyes; then
+ AC_MSG_NOTICE(trying libpcre2posix check again with libpcre2-8)
+ unset ac_cv_lib_pcre2posix_regcomp
+ AC_CHECK_LIB(pcre2,pcre2_regexec)
+ AC_CHECK_LIB(pcre2-posix,pcre2_regcomp)
+ if test "x$ac_cv_lib_pcre2_pcre_exec" = xyes && test "x$ac_cv_lib_pcre2posix_regcomp" = xyes; then
+ AC_MSG_CHECKING(if PCRE2_STATIC needs to be defined)
+ AC_LINK_IFELSE(
+ [AC_LANG_SOURCE(#include <pcre2posix.h>
+ int main() { return pcre2_regcomp(NULL, NULL, 0); })],
+ [without_pcre2_static=yes],
+ [without_pcre2_static=no])
+ AC_LINK_IFELSE(
+ [AC_LANG_SOURCE(#define PCRE2_STATIC
+ #include <pcre2posix.h>
+ int main() { return pcre2_regcomp(NULL, NULL, 0); })],
+ [with_pcre2_static=yes],
+ [with_pcre2_static=no])
+ if test "x$without_pcre2_static" != xyes && test "x$with_pcre2_static" = xyes; then
+ AC_MSG_RESULT(yes)
+ AC_DEFINE([PCRE2_STATIC], [1], [Define to 1 if PCRE2_STATIC needs to be defined.])
+ elif test "x$without_pcre2_static" = xyes || test "x$with_pcre2_static" = xyes; then
+ AC_MSG_RESULT(no)
+ fi
+ posix_regex_lib_found=1
+ fi
+ else
+ posix_regex_lib_found=1
+ fi
+fi
# TODO: Give the user the option of using a pre-existing system
# libarchive. This will define HAVE_LIBARCHIVE which will cause
@@ -542,21 +648,35 @@ fi
# Checks for supported compiler flags
AX_APPEND_COMPILE_FLAGS([-Wall -Wformat -Wformat-security])
-# Place the functions and data into separate sections, allowing the linker
-# to garbage collect the unused ones.
+# Place the functions and data into separate sections, allowing GNU style
+# linkers to garbage collect the unused ones.
save_LDFLAGS=$LDFLAGS
LDFLAGS="$LDFLAGS -Wl,--gc-sections"
AC_MSG_CHECKING([whether ld supports --gc-sections])
AC_LINK_IFELSE(
[AC_LANG_SOURCE([static char UnusedFunc() { return 5; } int main() { return 0;}])],
[AC_MSG_RESULT([yes])
- GC_SECTIONS="-Wl,--gc-sections";
+ DEAD_CODE_REMOVAL="-Wl,--gc-sections";
AX_APPEND_COMPILE_FLAGS([-ffunction-sections -fdata-sections])],
[AC_MSG_RESULT([no])
- GC_SECTIONS="";])
+ DEAD_CODE_REMOVAL="";])
LDFLAGS=$save_LDFLAGS
-AC_SUBST(GC_SECTIONS)
+if test "$DEAD_CODE_REMOVAL" == ""; then
+ # Macos linkers have a -dead_strip flag, which is similar to --gc-sections.
+ save_LDFLAGS=$LDFLAGS
+ LDFLAGS="$LDFLAGS -Wl,-dead_strip"
+ AC_MSG_CHECKING([whether ld supports -dead_strip])
+ AC_LINK_IFELSE(
+ [AC_LANG_SOURCE([static char UnusedFunc() { return 5; } int main() { return 0;}])],
+ [AC_MSG_RESULT([yes])
+ DEAD_CODE_REMOVAL="-Wl,-dead_strip";],
+ [AC_MSG_RESULT([no])
+ DEAD_CODE_REMOVAL="";])
+ LDFLAGS=$save_LDFLAGS
+fi
+
+AC_SUBST(DEAD_CODE_REMOVAL)
# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
@@ -654,7 +774,7 @@ AC_CHECK_TYPE([wchar_t],
AX_COMPILE_CHECK_SIZEOF(int)
AX_COMPILE_CHECK_SIZEOF(long)
-AC_HEADER_TIME
+AC_CHECK_HEADERS_ONCE([sys/time.h])
# Checks for library functions.
AC_PROG_GCC_TRADITIONAL
@@ -672,10 +792,10 @@ AC_FUNC_VPRINTF
# 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])
-AC_CHECK_FUNCS([fchdir fchflags fchmod fchown fcntl fdopendir fork])
+AC_CHECK_FUNCS([fchdir fchflags fchmod fchown fcntl fdopendir fnmatch fork])
AC_CHECK_FUNCS([fstat fstatat fstatfs fstatvfs ftruncate])
AC_CHECK_FUNCS([futimens futimes futimesat])
-AC_CHECK_FUNCS([geteuid getpid getgrgid_r getgrnam_r])
+AC_CHECK_FUNCS([geteuid getline getpid getgrgid_r getgrnam_r])
AC_CHECK_FUNCS([getpwnam_r getpwuid_r getvfsbyname gmtime_r])
AC_CHECK_FUNCS([lchflags lchmod lchown link linkat localtime_r lstat lutimes])
AC_CHECK_FUNCS([mbrtowc memmove memset])
@@ -686,8 +806,24 @@ AC_CHECK_FUNCS([select setenv setlocale sigaction statfs statvfs])
AC_CHECK_FUNCS([strchr strdup strerror strncpy_s strnlen strrchr symlink])
AC_CHECK_FUNCS([timegm tzset unlinkat unsetenv utime utimensat utimes vfork])
AC_CHECK_FUNCS([wcrtomb wcscmp wcscpy wcslen wctomb wmemcmp wmemcpy wmemmove])
-AC_CHECK_FUNCS([_ctime64_s _fseeki64])
-AC_CHECK_FUNCS([_get_timezone _gmtime64_s _localtime64_s _mkgmtime64])
+AC_CHECK_FUNCS([_fseeki64 _get_timezone])
+AC_CHECK_DECL([cmtime_s],
+ [AC_DEFINE(HAVE_CMTIME_S, 1, [cmtime_s function])],
+ [],
+ [#include <time.h>])
+AC_CHECK_DECL([gmtime_s],
+ [AC_DEFINE(HAVE_GMTIME_S, 1, [gmtime_s function])],
+ [],
+ [#include <time.h>])
+AC_CHECK_TYPE([localtime_s],
+ [AC_DEFINE(HAVE_LOCALTIME_S, 1, [localtime_s function])],
+ [],
+ [#include <time.h>])
+AC_CHECK_DECL([_mkgmtime],
+ [AC_DEFINE(HAVE__MKGMTIME, 1, [_mkgmtime function])],
+ [],
+ [#include <time.h>])
+
# detects cygwin-1.7, as opposed to older versions
AC_CHECK_FUNCS([cygwin_conv_path])
@@ -1209,24 +1345,8 @@ fi
if test "x$with_openssl" != "xno"; then
AC_CHECK_HEADERS([openssl/evp.h])
saved_LIBS=$LIBS
- case "$host_os" in
- *mingw* | *cygwin* | *msys*)
- case "$host_cpu" in
- x86_64)
- AC_CHECK_LIB(eay64,OPENSSL_config)
- if test "x$ac_cv_lib_eay64_main" != "xyes"; then
- AC_CHECK_LIB(eay32,OPENSSL_config)
- fi
- ;;
- *)
- AC_CHECK_LIB(eay32,OPENSSL_config)
- ;;
- esac
- ;;
- *)
- AC_CHECK_LIB(crypto,OPENSSL_config)
- ;;
- esac
+ LIBSREQUIRED="$LIBSREQUIRED${LIBSREQUIRED:+ }libcrypto"
+ AC_CHECK_LIB(crypto,OPENSSL_config)
CRYPTO_CHECK(MD5, OPENSSL, md5)
CRYPTO_CHECK(RMD160, OPENSSL, rmd160)
CRYPTO_CHECK(SHA1, OPENSSL, sha1)
@@ -1236,6 +1356,8 @@ if test "x$with_openssl" != "xno"; then
AC_CHECK_FUNCS([PKCS5_PBKDF2_HMAC_SHA1])
fi
+AC_SUBST(LIBSREQUIRED)
+
# Probe libmd AFTER OpenSSL/libcrypto.
# The two are incompatible and OpenSSL is more complete.
AC_CHECK_HEADERS([md5.h ripemd.h sha.h sha256.h sha512.h])
@@ -1260,6 +1382,18 @@ case "$host_os" in
;;
esac
+dnl Visibility annotations...
+saved_CFLAGS="$CFLAGS"
+CFLAGS="$CFLAGS -fvisibility=hidden -Werror"
+AC_MSG_CHECKING(whether compiler supports visibility annotations)
+AC_LINK_IFELSE([AC_LANG_PROGRAM([
+ int foo( void ) __attribute__((visibility("default")));
+ ])],
+ [CFLAGS="$saved_CFLAGS -fvisibility=hidden -D__LIBARCHIVE_ENABLE_VISIBILITY";
+ AC_MSG_RESULT(yes)],
+ [CFLAGS="$saved_CFLAGS"
+ AC_MSG_RESULT(no)])
+
# Ensure test directories are present if building out-of-tree
AC_CONFIG_COMMANDS([mkdirs],
[mkdir -p libarchive/test tar/test cat/test cpio/test])
diff --git a/contrib/android/config/android.h b/contrib/android/config/android.h
index 8e18312449ed..0ccb20c4e8c4 100644
--- a/contrib/android/config/android.h
+++ b/contrib/android/config/android.h
@@ -180,5 +180,5 @@
#define SIZEOF_WCHAR_T 4
#define STDC_HEADERS 1
#define STRERROR_R_CHAR_P 1
-#define TIME_WITH_SYS_TIME 1
+#define HAVE_SYS_TIME_H 1
#endif
diff --git a/contrib/android/config/linux_host.h b/contrib/android/config/linux_host.h
index 709b657c9da7..371c6cc480ad 100644
--- a/contrib/android/config/linux_host.h
+++ b/contrib/android/config/linux_host.h
@@ -183,7 +183,7 @@
#define SIZEOF_WCHAR_T 4
#define STDC_HEADERS 1
#define STRERROR_R_CHAR_P 1
-#define TIME_WITH_SYS_TIME 1
+#define HAVE_SYS_TIME_H 1
#define _GNU_SOURCE 1
#endif
diff --git a/contrib/android/config/windows_host.h b/contrib/android/config/windows_host.h
index 2d899d1e75c6..5210a4db5c7f 100644
--- a/contrib/android/config/windows_host.h
+++ b/contrib/android/config/windows_host.h
@@ -160,7 +160,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. */
#define HAVE_BCRYPT_H
/* Define to 1 if you have the <bzlib.h> header file. */
@@ -442,6 +442,12 @@
/* Define to 1 if you have the `pcreposix' library (-lpcreposix). */
/* #undef HAVE_LIBPCREPOSIX */
+/* Define to 1 if you have the `pcre2-8' library (-lpcre2-8). */
+/* #undef HAVE_LIBPCRE2 */
+
+/* Define to 1 if you have the `pcre2-posix' library (-lpcre2-posix). */
+/* #undef HAVE_LIBPCRE2POSIX */
+
/* Define to 1 if you have the `regex' library (-lregex). */
/* #undef HAVE_LIBREGEX */
@@ -593,6 +599,9 @@
/* Define to 1 if you have the <pcreposix.h> header file. */
/* #undef HAVE_PCREPOSIX_H */
+/* Define to 1 if you have the <pcre2posix.h> header file. */
+/* #undef HAVE_PCRE2POSIX_H */
+
/* Define to 1 if you have the `pipe' function. */
/* #undef HAVE_PIPE */
@@ -905,8 +914,8 @@
/* Define to 1 if you have the <zlib.h> header file. */
/* #undef HAVE_ZLIB_H */
-/* Define to 1 if you have the `_ctime64_s' function. */
-#define HAVE__CTIME64_S 1
+/* Define to 1 if you have the `ctime_s' function. */
+#define HAVE_CTIME_S 1
/* Define to 1 if you have the `_fseeki64' function. */
#define HAVE__FSEEKI64 1
@@ -914,11 +923,11 @@
/* Define to 1 if you have the `_get_timezone' function. */
/* #undef HAVE__GET_TIMEZONE */
-/* Define to 1 if you have the `_localtime64_s' function. */
-#define HAVE__LOCALTIME64_S 1
+/* Define to 1 if you have the `localtime_s' function. */
+#define HAVE_LOCALTIME_S 1
-/* Define to 1 if you have the `_mkgmtime64' function. */
-/* #define HAVE__MKGMTIME64 1 */
+/* Define to 1 if you have the `_mkgmtime' function. */
+/* #define HAVE__MKGMTIME 1 */
/* Define as const if the declaration of iconv() needs const. */
/* #undef ICONV_CONST */
@@ -952,7 +961,7 @@
/* #undef STRERROR_R_CHAR_P */
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
-#define TIME_WITH_SYS_TIME 1
+#define HAVE_SYS_TIME_H 1
diff --git a/contrib/archivetest.c b/contrib/archivetest.c
index e4a25e3c911d..794221fbb524 100644
--- a/contrib/archivetest.c
+++ b/contrib/archivetest.c
@@ -83,6 +83,7 @@ static void printhelp()
" -f filename Filename to verify\n"
" -h Show this help\n"
" -q Quiet mode\n"
+ " -r Enforce raw archive format\n"
" -s Verify only headers (skip data)\n\n"
"If no filename is specified, data is read from standard input.\n"
"\n%s\n", archive_version_details());
@@ -110,15 +111,17 @@ int main(int argc, char *argv[])
const char *p;
char buffer[4096];
int c;
- int v, skip_data;
+ int v, skip_data, raw;
int r = ARCHIVE_OK;
int format_printed;
+ mode_t mode;
filename = NULL;
skip_data = 0;
+ raw = 0;
v = 1;
- while ((c = getopt (argc, argv, "f:hqs")) != -1) {
+ while ((c = getopt (argc, argv, "f:hrqs")) != -1) {
switch (c) {
case 'f':
filename = optarg;
@@ -129,6 +132,9 @@ int main(int argc, char *argv[])
case 'q':
v = 0;
break;
+ case 'r':
+ raw = 1;
+ break;
case 's':
skip_data = 1;
break;
@@ -153,7 +159,10 @@ int main(int argc, char *argv[])
a = archive_read_new();
archive_read_support_filter_all(a);
- archive_read_support_format_all(a);
+ if (raw)
+ archive_read_support_format_raw(a);
+ else
+ archive_read_support_format_all(a);
v_print(v, "Data source: ");
@@ -191,16 +200,18 @@ int main(int argc, char *argv[])
if (r == ARCHIVE_EOF)
break;
p = archive_entry_pathname(entry);
+ mode = archive_entry_mode(entry);
v_print(v, "Entry %d: %s, pathname", c, errnostr(r));
if (p == NULL || p[0] == '\0')
v_print(v, " unreadable");
else
v_print(v, ": %s", p);
+ v_print(v, ", mode: %o", mode);
v_print(v, ", data: ");
if (skip_data) {
v_print(v, "skipping");
} else {
- while ((r = archive_read_data(a, buffer, 4096) > 0))
+ while ((r = archive_read_data(a, buffer, 4096)) > 0)
;
if (r == ARCHIVE_FATAL) {
v_print(v, "ERROR\nError string: %s\n",
diff --git a/contrib/shar/Makefile b/contrib/shar/Makefile
index 3bd94d4192cb..2e344fe0dc86 100644
--- a/contrib/shar/Makefile
+++ b/contrib/shar/Makefile
@@ -1,5 +1,3 @@
-# $FreeBSD$
-
PROG= shar
SRCS= shar.c tree.c
diff --git a/contrib/shar/shar.1 b/contrib/shar/shar.1
index 31561978f05c..a50efead99c8 100644
--- a/contrib/shar/shar.1
+++ b/contrib/shar/shar.1
@@ -30,7 +30,6 @@
.\" SUCH DAMAGE.
.\"
.\" @(#)shar.1 8.1 (Berkeley) 6/6/93
-.\" $FreeBSD$
.\"
.Dd April 17, 2008
.Dt SHAR 1
diff --git a/contrib/shar/shar.c b/contrib/shar/shar.c
index 63161fc9ea94..1648ab0d2d05 100644
--- a/contrib/shar/shar.c
+++ b/contrib/shar/shar.c
@@ -24,11 +24,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <sys/cdefs.h>
-#ifdef __FBSDID
-__FBSDID("$FreeBSD$");
-#endif
-
#include <sys/stat.h>
#include <sys/types.h>
diff --git a/contrib/shar/tree.c b/contrib/shar/tree.c
index a80d8366bdeb..666224c331d2 100644
--- a/contrib/shar/tree.c
+++ b/contrib/shar/tree.c
@@ -43,7 +43,6 @@
* regular dir or via fchdir(2) for a symlink).
*/
#include "tree_config.h"
-__FBSDID("$FreeBSD$");
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
diff --git a/contrib/shar/tree.h b/contrib/shar/tree.h
index ff38f5346c1c..82e974507b4b 100644
--- a/contrib/shar/tree.h
+++ b/contrib/shar/tree.h
@@ -21,8 +21,6 @@
* 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$
*/
/*-
diff --git a/contrib/shar/tree_config.h b/contrib/shar/tree_config.h
index 8dfd90baf685..6af27dcfbf64 100644
--- a/contrib/shar/tree_config.h
+++ b/contrib/shar/tree_config.h
@@ -21,8 +21,6 @@
* 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 TREE_CONFIG_H_INCLUDED
#define TREE_CONFIG_H_INCLUDED
@@ -57,14 +55,6 @@
#error Oops: No config.h and no built-in configuration in bsdtar_platform.h.
#endif /* !HAVE_CONFIG_H */
-/* No non-FreeBSD platform will have __FBSDID, so just define it here. */
-#ifdef __FreeBSD__
-#include <sys/cdefs.h> /* For __FBSDID */
-#else
-/* Just leaving this macro replacement empty leads to a dangling semicolon. */
-#define __FBSDID(a) struct _undefined_hack
-#endif
-
#ifdef HAVE_LIBARCHIVE
/* If we're using the platform libarchive, include system headers. */
#include <archive.h>
diff --git a/contrib/untar.c b/contrib/untar.c
index 2550e510a5a1..6d5e88e2f097 100644
--- a/contrib/untar.c
+++ b/contrib/untar.c
@@ -40,11 +40,25 @@
#include <windows.h>
#endif
-/* Parse an octal number, ignoring leading and trailing nonsense. */
+#define BLOCKSIZE 512
+
+/* System call to create a directory. */
static int
+system_mkdir(char *pathname, int mode)
+{
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ (void)mode; /* UNUSED */
+ return _mkdir(pathname);
+#else
+ return mkdir(pathname, mode);
+#endif
+}
+
+/* Parse an octal number, ignoring leading and trailing nonsense. */
+static unsigned long
parseoct(const char *p, size_t n)
{
- int i = 0;
+ unsigned long i = 0;
while ((*p < '0' || *p > '7') && n > 0) {
++p;
@@ -64,7 +78,7 @@ static int
is_end_of_archive(const char *p)
{
int n;
- for (n = 511; n >= 0; --n)
+ for (n = 0; n < BLOCKSIZE; ++n)
if (p[n] != '\0')
return (0);
return (1);
@@ -82,12 +96,7 @@ create_dir(char *pathname, int mode)
pathname[strlen(pathname) - 1] = '\0';
/* Try creating the directory. */
-#if defined(_WIN32) && !defined(__CYGWIN__)
- r = _mkdir(pathname);
-#else
- r = mkdir(pathname, mode);
-#endif
-
+ r = system_mkdir(pathname, mode);
if (r != 0) {
/* On failure, try creating parent directory. */
p = strrchr(pathname, '/');
@@ -95,11 +104,7 @@ create_dir(char *pathname, int mode)
*p = '\0';
create_dir(pathname, 0755);
*p = '/';
-#if defined(_WIN32) && !defined(__CYGWIN__)
- r = _mkdir(pathname);
-#else
- r = mkdir(pathname, mode);
-#endif
+ r = system_mkdir(pathname, mode);
}
}
if (r != 0)
@@ -130,7 +135,7 @@ static int
verify_checksum(const char *p)
{
int n, u = 0;
- for (n = 0; n < 512; ++n) {
+ for (n = 0; n < BLOCKSIZE; ++n) {
if (n < 148 || n > 155)
/* Standard tar checksum adds unsigned bytes. */
u += ((unsigned char *)p)[n];
@@ -138,25 +143,25 @@ verify_checksum(const char *p)
u += 0x20;
}
- return (u == parseoct(p + 148, 8));
+ return (u == (int)parseoct(p + 148, 8));
}
/* Extract a tar archive. */
static void
untar(FILE *a, const char *path)
{
- char buff[512];
+ char buff[BLOCKSIZE];
FILE *f = NULL;
size_t bytes_read;
- int filesize;
+ unsigned long filesize;
printf("Extracting from %s\n", path);
for (;;) {
- bytes_read = fread(buff, 1, 512, a);
- if (bytes_read < 512) {
+ bytes_read = fread(buff, 1, BLOCKSIZE, a);
+ if (bytes_read < BLOCKSIZE) {
fprintf(stderr,
- "Short read on %s: expected 512, got %d\n",
- path, (int)bytes_read);
+ "Short read on %s: expected %d, got %d\n",
+ path, BLOCKSIZE, (int)bytes_read);
return;
}
if (is_end_of_archive(buff)) {
@@ -183,7 +188,7 @@ untar(FILE *a, const char *path)
break;
case '5':
printf(" Extracting dir %s\n", buff);
- create_dir(buff, parseoct(buff + 100, 8));
+ create_dir(buff, (int)parseoct(buff + 100, 8));
filesize = 0;
break;
case '6':
@@ -191,19 +196,19 @@ untar(FILE *a, const char *path)
break;
default:
printf(" Extracting file %s\n", buff);
- f = create_file(buff, parseoct(buff + 100, 8));
+ f = create_file(buff, (int)parseoct(buff + 100, 8));
break;
}
while (filesize > 0) {
- bytes_read = fread(buff, 1, 512, a);
- if (bytes_read < 512) {
+ bytes_read = fread(buff, 1, BLOCKSIZE, a);
+ if (bytes_read < BLOCKSIZE) {
fprintf(stderr,
- "Short read on %s: Expected 512, got %d\n",
- path, (int)bytes_read);
+ "Short read on %s: Expected %d, got %d\n",
+ path, BLOCKSIZE, (int)bytes_read);
return;
}
- if (filesize < 512)
- bytes_read = filesize;
+ if (filesize < BLOCKSIZE)
+ bytes_read = (size_t)filesize;
if (f != NULL) {
if (fwrite(buff, 1, bytes_read, f)
!= bytes_read)
diff --git a/cpio/bsdcpio.1 b/cpio/bsdcpio.1
index 01b508e122f8..c52764a8c4f7 100644
--- a/cpio/bsdcpio.1
+++ b/cpio/bsdcpio.1
@@ -22,8 +22,6 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $FreeBSD$
-.\"
.Dd September 16, 2014
.Dt CPIO 1
.Os
diff --git a/cpio/cmdline.c b/cpio/cmdline.c
index 2683524e4ed0..312d762c8f46 100644
--- a/cpio/cmdline.c
+++ b/cpio/cmdline.c
@@ -26,7 +26,6 @@
#include "cpio_platform.h"
-__FBSDID("$FreeBSD: src/usr.bin/cpio/cmdline.c,v 1.5 2008/12/06 07:30:40 kientzle Exp $");
#ifdef HAVE_ERRNO_H
#include <errno.h>
diff --git a/cpio/config_freebsd.h b/cpio/config_freebsd.h
index 00c4c737f737..1cba09653cb5 100644
--- a/cpio/config_freebsd.h
+++ b/cpio/config_freebsd.h
@@ -21,8 +21,6 @@
* 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: src/usr.bin/cpio/config_freebsd.h,v 1.3 2008/12/06 07:30:40 kientzle Exp $
*/
/* A hand-tooled configuration for FreeBSD. */
diff --git a/cpio/cpio.c b/cpio/cpio.c
index 68a6301a8789..c9af535f6d0a 100644
--- a/cpio/cpio.c
+++ b/cpio/cpio.c
@@ -26,7 +26,6 @@
#include "cpio_platform.h"
-__FBSDID("$FreeBSD: src/usr.bin/cpio/cpio.c,v 1.15 2008/12/06 07:30:40 kientzle Exp $");
#include <sys/types.h>
#include <archive.h>
@@ -108,22 +107,22 @@ static int entry_to_archive(struct cpio *, struct archive_entry *);
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) __LA_DEAD;
+static __LA_NORETURN void long_help(void);
static const char *lookup_gname(struct cpio *, gid_t gid);
static int lookup_gname_helper(struct cpio *,
const char **name, id_t gid);
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 *) __LA_DEAD;
-static void mode_list(struct cpio *) __LA_DEAD;
+static __LA_NORETURN void mode_in(struct cpio *);
+static __LA_NORETURN void mode_list(struct cpio *);
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) __LA_DEAD;
-static void version(void) __LA_DEAD;
+static __LA_NORETURN void usage(void);
+static __LA_NORETURN void version(void);
static const char * passphrase_callback(struct archive *, void *);
static void passphrase_free(char *);
@@ -251,7 +250,7 @@ main(int argc, char *argv[])
break;
case 'h':
long_help();
- break;
+ /* NOTREACHED */
case 'I': /* NetBSD/OpenBSD */
cpio->filename = cpio->argument;
break;
@@ -358,7 +357,7 @@ main(int argc, char *argv[])
break;
case OPTION_VERSION: /* GNU convention */
version();
- break;
+ /* NOTREACHED */
#if 0
/*
* cpio_getopt() handles -W specially, so it's not
@@ -427,7 +426,7 @@ main(int argc, char *argv[])
mode_list(cpio);
else
mode_in(cpio);
- break;
+ /* NOTREACHED */
case 'p':
if (*cpio->argv == NULL || **cpio->argv == '\0')
lafe_errc(1, 0,
@@ -442,6 +441,8 @@ main(int argc, char *argv[])
archive_match_free(cpio->matching);
free_cache(cpio->gname_cache);
free_cache(cpio->uname_cache);
+ archive_read_close(cpio->archive_read_disk);
+ archive_read_free(cpio->archive_read_disk);
free(cpio->destdir);
passphrase_free(cpio->ppbuff);
return (cpio->return_value);
@@ -1144,20 +1145,16 @@ list_item_verbose(struct cpio *cpio, struct archive_entry *entry)
{
char size[32];
char date[32];
- char uids[16], gids[16];
+ char uids[22], gids[22];
const char *uname, *gname;
FILE *out = stdout;
const char *fmt;
time_t mtime;
static time_t now;
struct tm *ltime;
-#if defined(HAVE_LOCALTIME_R) || defined(HAVE__LOCALTIME64_S)
+#if defined(HAVE_LOCALTIME_R) || defined(HAVE_LOCALTIME_S)
struct tm tmbuf;
#endif
-#if defined(HAVE__LOCALTIME64_S)
- errno_t terr;
- __time64_t tmptime;
-#endif
if (!now)
time(&now);
@@ -1205,19 +1202,17 @@ list_item_verbose(struct cpio *cpio, struct archive_entry *entry)
else
fmt = cpio->day_first ? "%e %b %H:%M" : "%b %e %H:%M";
#endif
-#if defined(HAVE_LOCALTIME_R)
+#if defined(HAVE_LOCALTIME_S)
+ ltime = localtime_s(&tmbuf, &mtime) ? NULL : &tmbuf;
+#elif defined(HAVE_LOCALTIME_R)
ltime = localtime_r(&mtime, &tmbuf);
-#elif defined(HAVE__LOCALTIME64_S)
- tmptime = mtime;
- terr = _localtime64_s(&tmbuf, &tmptime);
- if (terr)
- ltime = NULL;
- else
- ltime = &tmbuf;
#else
ltime = localtime(&mtime);
#endif
- strftime(date, sizeof(date), fmt, ltime);
+ if (ltime != NULL)
+ strftime(date, sizeof(date), fmt, ltime);
+ else
+ strcpy(date, "invalid mtime");
fprintf(out, "%s%3d %-8s %-8s %8s %12s %s",
archive_entry_strmode(entry),
diff --git a/cpio/cpio.h b/cpio/cpio.h
index a71b6649d35f..3e97c0900b73 100644
--- a/cpio/cpio.h
+++ b/cpio/cpio.h
@@ -21,8 +21,6 @@
* 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: src/usr.bin/cpio/cpio.h,v 1.7 2008/12/06 07:30:40 kientzle Exp $
*/
#ifndef CPIO_H_INCLUDED
diff --git a/cpio/cpio_platform.h b/cpio/cpio_platform.h
index 58d2edbcd7a4..263404b40dab 100644
--- a/cpio/cpio_platform.h
+++ b/cpio/cpio_platform.h
@@ -21,8 +21,6 @@
* 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: src/usr.bin/cpio/cpio_platform.h,v 1.2 2008/12/06 07:15:42 kientzle Exp $
*/
/*
@@ -46,16 +44,6 @@
#include "cpio_windows.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
-
#ifdef HAVE_LIBARCHIVE
/* If we're using the platform libarchive, include system headers. */
#include <archive.h>
@@ -69,9 +57,11 @@
/* How to mark functions that don't return. */
#if defined(__GNUC__) && (__GNUC__ > 2 || \
(__GNUC__ == 2 && __GNUC_MINOR__ >= 5))
-#define __LA_DEAD __attribute__((__noreturn__))
+#define __LA_NORETURN __attribute__((__noreturn__))
+#elif defined(_MSC_VER)
+#define __LA_NORETURN __declspec(noreturn)
#else
-#define __LA_DEAD
+#define __LA_NORETURN
#endif
#endif /* !CPIO_PLATFORM_H_INCLUDED */
diff --git a/cpio/cpio_windows.c b/cpio/cpio_windows.c
index 63f6df0397d2..c888a3897d56 100644
--- a/cpio/cpio_windows.c
+++ b/cpio/cpio_windows.c
@@ -21,8 +21,6 @@
* 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$
*/
#if defined(_WIN32) && !defined(__CYGWIN__)
@@ -156,7 +154,11 @@ cpio_CreateFile(const char *path, DWORD dwDesiredAccess, DWORD dwShareMode,
{
wchar_t *wpath;
HANDLE handle;
+# if _WIN32_WINNT >= 0x0602 /* _WIN32_WINNT_WIN8 */
+ CREATEFILE2_EXTENDED_PARAMETERS createExParams;
+#endif
+#if !defined(WINAPI_FAMILY_PARTITION) || WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP)
handle = CreateFileA(path, dwDesiredAccess, dwShareMode,
lpSecurityAttributes, dwCreationDisposition, dwFlagsAndAttributes,
hTemplateFile);
@@ -164,12 +166,25 @@ cpio_CreateFile(const char *path, DWORD dwDesiredAccess, DWORD dwShareMode,
return (handle);
if (GetLastError() != ERROR_PATH_NOT_FOUND)
return (handle);
+#endif
wpath = permissive_name(path);
if (wpath == NULL)
- return (handle);
+ return INVALID_HANDLE_VALUE;
+# if _WIN32_WINNT >= 0x0602 /* _WIN32_WINNT_WIN8 */
+ ZeroMemory(&createExParams, sizeof(createExParams));
+ createExParams.dwSize = sizeof(createExParams);
+ createExParams.dwFileAttributes = dwFlagsAndAttributes & 0xFFFF;
+ createExParams.dwFileFlags = dwFlagsAndAttributes & 0xFFF00000;
+ createExParams.dwSecurityQosFlags = dwFlagsAndAttributes & 0x000F0000;
+ createExParams.lpSecurityAttributes = lpSecurityAttributes;
+ createExParams.hTemplateFile = hTemplateFile;
+ handle = CreateFile2(wpath, dwDesiredAccess, dwShareMode,
+ dwCreationDisposition, &createExParams);
+#else
handle = CreateFileW(wpath, dwDesiredAccess, dwShareMode,
lpSecurityAttributes, dwCreationDisposition, dwFlagsAndAttributes,
hTemplateFile);
+#endif
free(wpath);
return (handle);
}
diff --git a/cpio/cpio_windows.h b/cpio/cpio_windows.h
index 970a63df663d..6b88c389ab40 100644
--- a/cpio/cpio_windows.h
+++ b/cpio/cpio_windows.h
@@ -21,8 +21,6 @@
* 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 CPIO_WINDOWS_H
#define CPIO_WINDOWS_H 1
diff --git a/cpio/test/test.h b/cpio/test/test.h
index 1dadf68890bf..f8f3a4038b57 100644
--- a/cpio/test/test.h
+++ b/cpio/test/test.h
@@ -21,8 +21,6 @@
* 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$
*/
/* Every test program should #include "test.h" as the first thing. */
diff --git a/cpio/test/test_0.c b/cpio/test/test_0.c
index fa52def7eaf3..c09df5e137c4 100644
--- a/cpio/test/test_0.c
+++ b/cpio/test/test_0.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
/*
* This first test does basic sanity checks on the environment. For
diff --git a/cpio/test/test_basic.c b/cpio/test/test_basic.c
index 3d7d86a0ee78..993d555b831c 100644
--- a/cpio/test/test_basic.c
+++ b/cpio/test/test_basic.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: src/usr.bin/cpio/test/test_basic.c,v 1.4 2008/08/25 06:39:29 kientzle Exp $");
static void
verify_files(const char *msg)
diff --git a/cpio/test/test_cmdline.c b/cpio/test/test_cmdline.c
index 2dd7d651dc57..f4e05ee58599 100644
--- a/cpio/test/test_cmdline.c
+++ b/cpio/test/test_cmdline.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
/*
* Test the command-line parsing.
diff --git a/cpio/test/test_extract_cpio_Z.c b/cpio/test/test_extract_cpio_Z.c
index f908fc5b84f5..257d70d04211 100644
--- a/cpio/test/test_extract_cpio_Z.c
+++ b/cpio/test/test_extract_cpio_Z.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
DEFINE_TEST(test_extract_cpio_Z)
{
diff --git a/cpio/test/test_extract_cpio_bz2.c b/cpio/test/test_extract_cpio_bz2.c
index 9525e63ae906..08fe1fe53468 100644
--- a/cpio/test/test_extract_cpio_bz2.c
+++ b/cpio/test/test_extract_cpio_bz2.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
DEFINE_TEST(test_extract_cpio_bz2)
{
diff --git a/cpio/test/test_extract_cpio_grz.c b/cpio/test/test_extract_cpio_grz.c
index f1a080597e34..969b30e44de5 100644
--- a/cpio/test/test_extract_cpio_grz.c
+++ b/cpio/test/test_extract_cpio_grz.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
DEFINE_TEST(test_extract_cpio_grz)
{
diff --git a/cpio/test/test_extract_cpio_gz.c b/cpio/test/test_extract_cpio_gz.c
index 19cee510c857..16296146f87e 100644
--- a/cpio/test/test_extract_cpio_gz.c
+++ b/cpio/test/test_extract_cpio_gz.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
DEFINE_TEST(test_extract_cpio_gz)
{
diff --git a/cpio/test/test_extract_cpio_lrz.c b/cpio/test/test_extract_cpio_lrz.c
index 67667585e431..7ef213f74aac 100644
--- a/cpio/test/test_extract_cpio_lrz.c
+++ b/cpio/test/test_extract_cpio_lrz.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
DEFINE_TEST(test_extract_cpio_lrz)
{
diff --git a/cpio/test/test_extract_cpio_lz.c b/cpio/test/test_extract_cpio_lz.c
index 4454e7b191e9..bfdf87869b37 100644
--- a/cpio/test/test_extract_cpio_lz.c
+++ b/cpio/test/test_extract_cpio_lz.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
DEFINE_TEST(test_extract_cpio_lz)
{
diff --git a/cpio/test/test_extract_cpio_lz4.c b/cpio/test/test_extract_cpio_lz4.c
index c16247be2bef..f8cf5f8fab0d 100644
--- a/cpio/test/test_extract_cpio_lz4.c
+++ b/cpio/test/test_extract_cpio_lz4.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
DEFINE_TEST(test_extract_cpio_lz4)
{
diff --git a/cpio/test/test_extract_cpio_lzma.c b/cpio/test/test_extract_cpio_lzma.c
index ae630d6119d8..81fc3c236ab5 100644
--- a/cpio/test/test_extract_cpio_lzma.c
+++ b/cpio/test/test_extract_cpio_lzma.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
DEFINE_TEST(test_extract_cpio_lzma)
{
diff --git a/cpio/test/test_extract_cpio_lzo.c b/cpio/test/test_extract_cpio_lzo.c
index 99476af95318..d54d4f712374 100644
--- a/cpio/test/test_extract_cpio_lzo.c
+++ b/cpio/test/test_extract_cpio_lzo.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
DEFINE_TEST(test_extract_cpio_lzo)
{
diff --git a/cpio/test/test_extract_cpio_xz.c b/cpio/test/test_extract_cpio_xz.c
index 60f1b5a9de84..faeea202e050 100644
--- a/cpio/test/test_extract_cpio_xz.c
+++ b/cpio/test/test_extract_cpio_xz.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
DEFINE_TEST(test_extract_cpio_xz)
{
diff --git a/cpio/test/test_extract_cpio_zstd.c b/cpio/test/test_extract_cpio_zstd.c
index 289f33d0583c..31421c3b60d7 100644
--- a/cpio/test/test_extract_cpio_zstd.c
+++ b/cpio/test/test_extract_cpio_zstd.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
DEFINE_TEST(test_extract_cpio_zstd)
{
diff --git a/cpio/test/test_format_newc.c b/cpio/test/test_format_newc.c
index 6e3b9e359bbd..ee0087d4ca94 100644
--- a/cpio/test/test_format_newc.c
+++ b/cpio/test/test_format_newc.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: src/usr.bin/cpio/test/test_format_newc.c,v 1.2 2008/08/22 02:09:10 kientzle Exp $");
/* Number of bytes needed to pad 'n' to multiple of 'block', assuming
* that 'block' is a power of two. This trick can be more easily
diff --git a/cpio/test/test_gcpio_compat.c b/cpio/test/test_gcpio_compat.c
index 9bb988990e4c..82c71ec3cd21 100644
--- a/cpio/test/test_gcpio_compat.c
+++ b/cpio/test/test_gcpio_compat.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: src/usr.bin/cpio/test/test_gcpio_compat.c,v 1.2 2008/08/22 02:27:06 kientzle Exp $");
static void
unpack_test(const char *from, const char *options, const char *se)
diff --git a/cpio/test/test_gcpio_compat_ref.bin.uu b/cpio/test/test_gcpio_compat_ref.bin.uu
index 745d8ab7851a..f2ffad975644 100644
--- a/cpio/test/test_gcpio_compat_ref.bin.uu
+++ b/cpio/test/test_gcpio_compat_ref.bin.uu
@@ -1,4 +1,3 @@
-$FreeBSD$
begin 644 test_gcpio_compat_ref.bin
MQW%9`*IWI('H`^@#`@````U'=YD%````"@!F:6QE```Q,C,T-38W.#D*QW%9
M`*IWI('H`^@#`@````U'=YD)````"@!L:6YK9FEL90``,3(S-#4V-S@Y"L=Q
diff --git a/cpio/test/test_gcpio_compat_ref.crc.uu b/cpio/test/test_gcpio_compat_ref.crc.uu
index df8dde05bd82..56ba62c9ed1f 100644
--- a/cpio/test/test_gcpio_compat_ref.crc.uu
+++ b/cpio/test/test_gcpio_compat_ref.crc.uu
@@ -1,4 +1,3 @@
-$FreeBSD$
begin 644 test_gcpio_compat_ref.crc
M,#<P-S`R,#`S,S<W86$P,#`P.#%A-#`P,#`P,V4X,#`P,#`S93@P,#`P,#`P
M,C0W,&0Y.3<W,#`P,#`P,#`P,#`P,#`P,#`P,#`P,#4Y,#`P,#`P,#`P,#`P
diff --git a/cpio/test/test_gcpio_compat_ref.newc.uu b/cpio/test/test_gcpio_compat_ref.newc.uu
index 1e29ba907bb4..449c083c311c 100644
--- a/cpio/test/test_gcpio_compat_ref.newc.uu
+++ b/cpio/test/test_gcpio_compat_ref.newc.uu
@@ -1,4 +1,3 @@
-$FreeBSD$
begin 644 test_gcpio_compat_ref.newc
M,#<P-S`Q,#`S,S<W86$P,#`P.#%A-#`P,#`P,V4X,#`P,#`S93@P,#`P,#`P
M,C0W,&0Y.3<W,#`P,#`P,#`P,#`P,#`P,#`P,#`P,#4Y,#`P,#`P,#`P,#`P
diff --git a/cpio/test/test_gcpio_compat_ref.ustar.uu b/cpio/test/test_gcpio_compat_ref.ustar.uu
index 77989f4aed06..2f6a44057eac 100644
--- a/cpio/test/test_gcpio_compat_ref.ustar.uu
+++ b/cpio/test/test_gcpio_compat_ref.ustar.uu
@@ -1,4 +1,3 @@
-$FreeBSD$
begin 644 test_gcpio_compat_ref.ustar
M9FEL90``````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
diff --git a/cpio/test/test_missing_file.c b/cpio/test/test_missing_file.c
index a908f5301bc6..784d53cfe141 100644
--- a/cpio/test/test_missing_file.c
+++ b/cpio/test/test_missing_file.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
DEFINE_TEST(test_missing_file)
{
diff --git a/cpio/test/test_option_0.c b/cpio/test/test_option_0.c
index bc4aecd2afc2..fbe6f7ac4a85 100644
--- a/cpio/test/test_option_0.c
+++ b/cpio/test/test_option_0.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
DEFINE_TEST(test_option_0)
{
diff --git a/cpio/test/test_option_B_upper.c b/cpio/test/test_option_B_upper.c
index b040354b6053..79dc91efb5ba 100644
--- a/cpio/test/test_option_B_upper.c
+++ b/cpio/test/test_option_B_upper.c
@@ -23,8 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
-
DEFINE_TEST(test_option_B_upper)
{
diff --git a/cpio/test/test_option_C_upper.c b/cpio/test/test_option_C_upper.c
index c8e63fd34fb5..f9fd7e159339 100644
--- a/cpio/test/test_option_C_upper.c
+++ b/cpio/test/test_option_C_upper.c
@@ -23,8 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
-
DEFINE_TEST(test_option_C_upper)
{
diff --git a/cpio/test/test_option_J_upper.c b/cpio/test/test_option_J_upper.c
index 1d7d05131b3d..f76d3b236913 100644
--- a/cpio/test/test_option_J_upper.c
+++ b/cpio/test/test_option_J_upper.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
DEFINE_TEST(test_option_J_upper)
{
@@ -43,6 +42,7 @@ DEFINE_TEST(test_option_J_upper)
if (strstr(p, "compression not available") != NULL) {
skipping("This version of bsdcpio was compiled "
"without xz support");
+ free(p);
return;
}
failure("-J option is broken");
diff --git a/cpio/test/test_option_L_upper.c b/cpio/test/test_option_L_upper.c
index cab41b61d749..b6fb713f110f 100644
--- a/cpio/test/test_option_L_upper.c
+++ b/cpio/test/test_option_L_upper.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: src/usr.bin/cpio/test/test_option_L.c,v 1.2 2008/08/24 06:21:00 kientzle Exp $");
/* This is a little pointless, as Windows doesn't support symlinks
* (except for the seriously crippled CreateSymbolicLink API) so these
diff --git a/cpio/test/test_option_Z_upper.c b/cpio/test/test_option_Z_upper.c
index ff388427e372..aa408e4e548c 100644
--- a/cpio/test/test_option_Z_upper.c
+++ b/cpio/test/test_option_Z_upper.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
DEFINE_TEST(test_option_Z_upper)
{
diff --git a/cpio/test/test_option_a.c b/cpio/test/test_option_a.c
index e96bdf3cab5b..885eb12c80f5 100644
--- a/cpio/test/test_option_a.c
+++ b/cpio/test/test_option_a.c
@@ -28,7 +28,6 @@
#elif defined(HAVE_SYS_UTIME_H)
#include <sys/utime.h>
#endif
-__FBSDID("$FreeBSD: src/usr.bin/cpio/test/test_option_a.c,v 1.3 2008/08/24 06:21:00 kientzle Exp $");
static struct {
const char *name;
diff --git a/cpio/test/test_option_b64encode.c b/cpio/test/test_option_b64encode.c
index 7c15a8230606..501976c202a1 100644
--- a/cpio/test/test_option_b64encode.c
+++ b/cpio/test/test_option_b64encode.c
@@ -24,7 +24,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
DEFINE_TEST(test_option_b64encode)
{
diff --git a/cpio/test/test_option_c.c b/cpio/test/test_option_c.c
index 013caed56030..0b6bed2fac93 100644
--- a/cpio/test/test_option_c.c
+++ b/cpio/test/test_option_c.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
static int
is_octal(const char *p, size_t l)
@@ -37,10 +36,10 @@ is_octal(const char *p, size_t l)
return (1);
}
-static int
+static long long int
from_octal(const char *p, size_t l)
{
- int r = 0;
+ long long int r = 0;
while (l > 0) {
r *= 8;
@@ -161,7 +160,7 @@ DEFINE_TEST(test_option_c)
assertEqualInt(from_octal(e + 24, 6), uid); /* uid */
assertEqualInt(gid, from_octal(e + 30, 6)); /* gid */
assertEqualMem(e + 36, "000001", 6); /* nlink */
- failure("file entries should have rdev == 0 (dev was 0%o)",
+ failure("file entries should have rdev == 0 (dev was 0%llo)",
from_octal(e + 6, 6));
assertEqualMem(e + 42, "000000", 6); /* rdev */
t = from_octal(e + 48, 11); /* mtime */
diff --git a/cpio/test/test_option_d.c b/cpio/test/test_option_d.c
index 9ff14539698f..b96430e4f37a 100644
--- a/cpio/test/test_option_d.c
+++ b/cpio/test/test_option_d.c
@@ -23,8 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
-
DEFINE_TEST(test_option_d)
{
diff --git a/cpio/test/test_option_f.c b/cpio/test/test_option_f.c
index 784e0858431b..72383884ac1e 100644
--- a/cpio/test/test_option_f.c
+++ b/cpio/test/test_option_f.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
/*
* Unpack the archive in a new dir.
diff --git a/cpio/test/test_option_f.cpio.uu b/cpio/test/test_option_f.cpio.uu
index 42c63c39685e..60b74173f413 100644
--- a/cpio/test/test_option_f.cpio.uu
+++ b/cpio/test/test_option_f.cpio.uu
@@ -1,4 +1,3 @@
-$FreeBSD$
begin 644 test_option_f.cpio
M,#<P-S`W,#`P,3,Q-C(Q-38Q,3`P-C0T,#`Q-S4P,#`Q-S4P,#`P,#`Q,#`P
M,#`P,3`W,S4Q,3(U,C8P,#`P,#4P,#`P,#`P,#`P,&$Q,C,`,#<P-S`W,#`P
diff --git a/cpio/test/test_option_grzip.c b/cpio/test/test_option_grzip.c
index 7e7dd2c8e6f3..cd898cd9228f 100644
--- a/cpio/test/test_option_grzip.c
+++ b/cpio/test/test_option_grzip.c
@@ -24,7 +24,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
DEFINE_TEST(test_option_grzip)
{
diff --git a/cpio/test/test_option_help.c b/cpio/test/test_option_help.c
index 56234306f539..cf69c76496d5 100644
--- a/cpio/test/test_option_help.c
+++ b/cpio/test/test_option_help.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
/*
* Test that "--help", "-h", and "-W help" options all work and
diff --git a/cpio/test/test_option_l.c b/cpio/test/test_option_l.c
index 5c76e688e6e9..3f4390a6ff22 100644
--- a/cpio/test/test_option_l.c
+++ b/cpio/test/test_option_l.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
DEFINE_TEST(test_option_l)
{
diff --git a/cpio/test/test_option_lrzip.c b/cpio/test/test_option_lrzip.c
index 8d9c0d576cc3..4c46f1c65bba 100644
--- a/cpio/test/test_option_lrzip.c
+++ b/cpio/test/test_option_lrzip.c
@@ -24,7 +24,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
DEFINE_TEST(test_option_lrzip)
{
diff --git a/cpio/test/test_option_lz4.c b/cpio/test/test_option_lz4.c
index ebd376736f42..4c5186d55ccc 100644
--- a/cpio/test/test_option_lz4.c
+++ b/cpio/test/test_option_lz4.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
DEFINE_TEST(test_option_lz4)
{
diff --git a/cpio/test/test_option_lzma.c b/cpio/test/test_option_lzma.c
index b7cad3d1e99a..3c2648b827cd 100644
--- a/cpio/test/test_option_lzma.c
+++ b/cpio/test/test_option_lzma.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
DEFINE_TEST(test_option_lzma)
{
diff --git a/cpio/test/test_option_lzop.c b/cpio/test/test_option_lzop.c
index aa40ef5b6392..b787b720a878 100644
--- a/cpio/test/test_option_lzop.c
+++ b/cpio/test/test_option_lzop.c
@@ -24,7 +24,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
DEFINE_TEST(test_option_lzop)
{
diff --git a/cpio/test/test_option_m.c b/cpio/test/test_option_m.c
index de880b2883e1..f2f297e10572 100644
--- a/cpio/test/test_option_m.c
+++ b/cpio/test/test_option_m.c
@@ -23,8 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
-
DEFINE_TEST(test_option_m)
{
diff --git a/cpio/test/test_option_m.cpio.uu b/cpio/test/test_option_m.cpio.uu
index 3d2002355e55..0c36ac4fdfd5 100644
--- a/cpio/test/test_option_m.cpio.uu
+++ b/cpio/test/test_option_m.cpio.uu
@@ -1,4 +1,3 @@
-$FreeBSD$
begin 644 test_option_m.cpio
M,#<P-S`W,#`P,3,Q-#4P,#8T,3`P-C0T,#`Q-S4P,#`Q-S4P,#`P,#`Q,#`P
M,#`P,#`P,#`P,#`P,#$P,#`P,#4P,#`P,#`P,#`P,&9I;&4`,#<P-S`W,#`P
diff --git a/cpio/test/test_option_passphrase.c b/cpio/test/test_option_passphrase.c
index ae77a23fcb74..d409b30c81cf 100644
--- a/cpio/test/test_option_passphrase.c
+++ b/cpio/test/test_option_passphrase.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
DEFINE_TEST(test_option_passphrase)
{
diff --git a/cpio/test/test_option_t.c b/cpio/test/test_option_t.c
index eaa73fa3a016..953e4a80651e 100644
--- a/cpio/test/test_option_t.c
+++ b/cpio/test/test_option_t.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
#ifdef HAVE_LOCALE_H
#include <locale.h>
@@ -36,6 +35,10 @@ DEFINE_TEST(test_option_t)
time_t mtime;
char date[32];
char date2[32];
+ struct tm *tmptr;
+#if defined(HAVE_LOCALTIME_R) || defined(HAVE_LOCALTIME_S)
+ struct tm tmbuf;
+#endif
/* List reference archive, make sure the TOC is correct. */
extract_reference_file("test_option_t.cpio");
@@ -87,11 +90,18 @@ DEFINE_TEST(test_option_t)
#ifdef HAVE_LOCALE_H
setlocale(LC_ALL, "");
#endif
+#if defined(HAVE_LOCALTIME_S)
+ tmptr = localtime_s(&tmbuf, &mtime) ? NULL : &tmbuf;
+#elif defined(HAVE_LOCALTIME_R)
+ tmptr = localtime_r(&mtime, &tmbuf);
+#else
+ tmptr = localtime(&mtime);
+#endif
#if defined(_WIN32) && !defined(__CYGWIN__)
- strftime(date2, sizeof(date2)-1, "%b %d %Y", localtime(&mtime));
+ strftime(date2, sizeof(date2)-1, "%b %d %Y", tmptr);
_snprintf(date, sizeof(date)-1, "%12.12s file", date2);
#else
- strftime(date2, sizeof(date2)-1, "%b %e %Y", localtime(&mtime));
+ strftime(date2, sizeof(date2)-1, "%b %e %Y", tmptr);
snprintf(date, sizeof(date)-1, "%12.12s file", date2);
#endif
assertEqualMem(p + 42, date, strlen(date));
diff --git a/cpio/test/test_option_t.cpio.uu b/cpio/test/test_option_t.cpio.uu
index 055fe747d06f..d0bf60bf7d9d 100644
--- a/cpio/test/test_option_t.cpio.uu
+++ b/cpio/test/test_option_t.cpio.uu
@@ -1,4 +1,3 @@
-$FreeBSD$
begin 644 test_option_t.cpio
M,#<P-S`W,#`P,3,Q-#4P,#8T,3`P-C0T,#`Q-S4P,#`Q-S4P,#`P,#`Q,#`P
M,#`P,#`P,#`P,#`P,#$P,#`P,#4P,#`P,#`P,#`P,&9I;&4`,#<P-S`W,#`P
diff --git a/cpio/test/test_option_t.stdout.uu b/cpio/test/test_option_t.stdout.uu
index 2457706eceed..c5144bb68029 100644
--- a/cpio/test/test_option_t.stdout.uu
+++ b/cpio/test/test_option_t.stdout.uu
@@ -1,4 +1,3 @@
-$FreeBSD$
begin 644 test_option_t.stdout
%9FEL90H`
`
diff --git a/cpio/test/test_option_tv.stdout.uu b/cpio/test/test_option_tv.stdout.uu
index e28888ac4747..ad9481360f35 100644
--- a/cpio/test/test_option_tv.stdout.uu
+++ b/cpio/test/test_option_tv.stdout.uu
@@ -1,4 +1,3 @@
-$FreeBSD: src/usr.bin/cpio/test/test_option_tv.stdout.uu,v 1.2 2008/11/29 20:22:02 kientzle Exp $
begin 644 test_option_tv.stdout
M+7)W+7(M+7(M+2`@(#$@=&EM("`@("`@=&EM("`@("`@("`@("`@(#`@1&5C
/(#,Q("`Q.38Y(&9I;&4*
diff --git a/cpio/test/test_option_u.c b/cpio/test/test_option_u.c
index cc790b1c0af2..fe5b863af0e2 100644
--- a/cpio/test/test_option_u.c
+++ b/cpio/test/test_option_u.c
@@ -28,7 +28,6 @@
#elif defined(HAVE_SYS_UTIME_H)
#include <sys/utime.h>
#endif
-__FBSDID("$FreeBSD$");
DEFINE_TEST(test_option_u)
{
diff --git a/cpio/test/test_option_uuencode.c b/cpio/test/test_option_uuencode.c
index a42a0e03096f..28662ddfb659 100644
--- a/cpio/test/test_option_uuencode.c
+++ b/cpio/test/test_option_uuencode.c
@@ -24,7 +24,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
DEFINE_TEST(test_option_uuencode)
{
diff --git a/cpio/test/test_option_xz.c b/cpio/test/test_option_xz.c
index f0d3b33d45b8..9116ecace3a7 100644
--- a/cpio/test/test_option_xz.c
+++ b/cpio/test/test_option_xz.c
@@ -24,7 +24,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
DEFINE_TEST(test_option_xz)
{
diff --git a/cpio/test/test_option_y.c b/cpio/test/test_option_y.c
index 989b5f1aaf6e..a78dff8cf4ea 100644
--- a/cpio/test/test_option_y.c
+++ b/cpio/test/test_option_y.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: src/usr.bin/cpio/test/test_option_y.c,v 1.2 2008/08/24 06:21:00 kientzle Exp $");
DEFINE_TEST(test_option_y)
{
diff --git a/cpio/test/test_option_z.c b/cpio/test/test_option_z.c
index 803232d045c2..9a1500d77f32 100644
--- a/cpio/test/test_option_z.c
+++ b/cpio/test/test_option_z.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
DEFINE_TEST(test_option_z)
{
diff --git a/cpio/test/test_option_zstd.c b/cpio/test/test_option_zstd.c
index 29b8c78b94aa..10c3ed9784e8 100644
--- a/cpio/test/test_option_zstd.c
+++ b/cpio/test/test_option_zstd.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
DEFINE_TEST(test_option_zstd)
{
diff --git a/cpio/test/test_owner_parse.c b/cpio/test/test_owner_parse.c
index bef02da7badf..fc6f18943f5d 100644
--- a/cpio/test/test_owner_parse.c
+++ b/cpio/test/test_owner_parse.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
#include "../cpio.h"
#include "err.h"
diff --git a/cpio/test/test_passthrough_dotdot.c b/cpio/test/test_passthrough_dotdot.c
index bb04341a4c79..831c1f81c1cb 100644
--- a/cpio/test/test_passthrough_dotdot.c
+++ b/cpio/test/test_passthrough_dotdot.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: src/usr.bin/cpio/test/test_passthrough_dotdot.c,v 1.4 2008/08/24 06:21:00 kientzle Exp $");
/*
* Verify that "cpio -p .." works.
diff --git a/cpio/test/test_passthrough_reverse.c b/cpio/test/test_passthrough_reverse.c
index 674e52bc0a18..7ae0e6602a34 100644
--- a/cpio/test/test_passthrough_reverse.c
+++ b/cpio/test/test_passthrough_reverse.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: src/usr.bin/cpio/test/test_passthrough_reverse.c,v 1.2 2008/08/24 06:21:00 kientzle Exp $");
/*
* As reported by Bernd Walter: Some people are in the habit of
diff --git a/libarchive/CMakeLists.txt b/libarchive/CMakeLists.txt
index e1d76a5198d3..b79091cac582 100644
--- a/libarchive/CMakeLists.txt
+++ b/libarchive/CMakeLists.txt
@@ -5,6 +5,10 @@
#
############################################
+if (ANDROID)
+ include_directories(${PROJECT_SOURCE_DIR}/contrib/android/include)
+endif()
+
# Public headers
SET(include_HEADERS
archive.h
@@ -78,6 +82,7 @@ SET(libarchive_SOURCES
archive_read_set_format.c
archive_read_set_options.c
archive_read_support_filter_all.c
+ archive_read_support_filter_by_code.c
archive_read_support_filter_bzip2.c
archive_read_support_filter_compress.c
archive_read_support_filter_gzip.c
@@ -238,24 +243,33 @@ ELSEIF(ARCHIVE_ACL_SUNOS)
ENDIF()
# Libarchive is a shared library
-ADD_LIBRARY(archive SHARED ${libarchive_SOURCES} ${include_HEADERS})
-TARGET_INCLUDE_DIRECTORIES(archive PUBLIC .)
-TARGET_LINK_LIBRARIES(archive ${ADDITIONAL_LIBS})
-SET_TARGET_PROPERTIES(archive PROPERTIES SOVERSION ${SOVERSION})
+IF(BUILD_SHARED_LIBS)
+ ADD_LIBRARY(archive SHARED ${libarchive_SOURCES} ${include_HEADERS})
+ TARGET_INCLUDE_DIRECTORIES(archive PUBLIC .)
+ TARGET_LINK_LIBRARIES(archive ${ADDITIONAL_LIBS})
+ SET_TARGET_PROPERTIES(archive PROPERTIES SOVERSION ${SOVERSION})
+ENDIF(BUILD_SHARED_LIBS)
# archive_static is a static library
ADD_LIBRARY(archive_static STATIC ${libarchive_SOURCES} ${include_HEADERS})
+TARGET_INCLUDE_DIRECTORIES(archive_static PUBLIC .)
TARGET_LINK_LIBRARIES(archive_static ${ADDITIONAL_LIBS})
SET_TARGET_PROPERTIES(archive_static PROPERTIES COMPILE_DEFINITIONS
LIBARCHIVE_STATIC)
# On Posix systems, libarchive.so and libarchive.a can co-exist.
-IF(NOT WIN32 OR CYGWIN)
+IF(NOT WIN32 OR CYGWIN OR NOT BUILD_SHARED_LIBS)
SET_TARGET_PROPERTIES(archive_static PROPERTIES OUTPUT_NAME archive)
-ENDIF(NOT WIN32 OR CYGWIN)
+ENDIF(NOT WIN32 OR CYGWIN OR NOT BUILD_SHARED_LIBS)
IF(ENABLE_INSTALL)
# How to install the libraries
- INSTALL(TARGETS archive archive_static
+ IF(BUILD_SHARED_LIBS)
+ INSTALL(TARGETS archive
+ RUNTIME DESTINATION bin
+ LIBRARY DESTINATION lib
+ ARCHIVE DESTINATION lib)
+ ENDIF(BUILD_SHARED_LIBS)
+ INSTALL(TARGETS archive_static
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
ARCHIVE DESTINATION lib)
diff --git a/libarchive/archive.h b/libarchive/archive.h
index 930ad5767968..2e3a9f31cd33 100644
--- a/libarchive/archive.h
+++ b/libarchive/archive.h
@@ -21,8 +21,6 @@
* 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: src/lib/libarchive/archive.h.in,v 1.50 2008/05/26 17:00:22 kientzle Exp $
*/
#ifndef ARCHIVE_H_INCLUDED
@@ -36,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 3006001
+#define ARCHIVE_VERSION_NUMBER 3007003
#include <sys/stat.h>
#include <stddef.h> /* for wchar_t */
@@ -120,6 +118,8 @@ typedef ssize_t la_ssize_t;
# define __LA_DECL __declspec(dllimport)
# endif
# endif
+#elif defined __LIBARCHIVE_ENABLE_VISIBILITY
+# define __LA_DECL __attribute__((visibility("default")))
#else
/* Static libraries or non-Windows needs no special declaration. */
# define __LA_DECL
@@ -155,7 +155,7 @@ __LA_DECL int archive_version_number(void);
/*
* Textual name/version of the library, useful for version displays.
*/
-#define ARCHIVE_VERSION_ONLY_STRING "3.6.1dev"
+#define ARCHIVE_VERSION_ONLY_STRING "3.7.3"
#define ARCHIVE_VERSION_STRING "libarchive " ARCHIVE_VERSION_ONLY_STRING
__LA_DECL const char * archive_version_string(void);
@@ -533,6 +533,10 @@ __LA_DECL int archive_read_open_filenames(struct archive *,
const char **_filenames, size_t _block_size);
__LA_DECL int archive_read_open_filename_w(struct archive *,
const wchar_t *_filename, size_t _block_size);
+#if defined(_WIN32) && !defined(__CYGWIN__)
+__LA_DECL int archive_read_open_filenames_w(struct archive *,
+ const wchar_t **_filenames, size_t _block_size);
+#endif
/* archive_read_open_file() is a deprecated synonym for ..._open_filename(). */
__LA_DECL int archive_read_open_file(struct archive *,
const char *_filename, size_t _block_size) __LA_DEPRECATED;
diff --git a/libarchive/archive_acl.c b/libarchive/archive_acl.c
index ead7e36e49ec..254324c71309 100644
--- a/libarchive/archive_acl.c
+++ b/libarchive/archive_acl.c
@@ -25,7 +25,6 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD$");
#ifdef HAVE_ERRNO_H
#include <errno.h>
diff --git a/libarchive/archive_acl_private.h b/libarchive/archive_acl_private.h
index af108162c664..750b4dd7d898 100644
--- a/libarchive/archive_acl_private.h
+++ b/libarchive/archive_acl_private.h
@@ -21,8 +21,6 @@
* 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 ARCHIVE_ACL_PRIVATE_H_INCLUDED
diff --git a/libarchive/archive_check_magic.c b/libarchive/archive_check_magic.c
index 1f40072f81d8..d12f0c496e27 100644
--- a/libarchive/archive_check_magic.c
+++ b/libarchive/archive_check_magic.c
@@ -24,7 +24,6 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/archive_check_magic.c 201089 2009-12-28 02:20:23Z kientzle $");
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
@@ -62,7 +61,7 @@ errmsg(const char *m)
}
}
-static __LA_DEAD void
+static __LA_NORETURN void
diediedie(void)
{
#if defined(_WIN32) && !defined(__CYGWIN__) && defined(_DEBUG)
@@ -99,13 +98,12 @@ archive_handle_type_name(unsigned m)
}
}
-
-static char *
+static void
write_all_states(char *buff, unsigned int states)
{
unsigned int lowbit;
- buff[0] = '\0';
+ *buff = '\0';
/* A trick for computing the lowest set bit. */
while ((lowbit = states & (1 + ~states)) != 0) {
@@ -114,7 +112,6 @@ write_all_states(char *buff, unsigned int states)
if (states != 0)
strcat(buff, "/");
}
- return buff;
}
/*
@@ -160,16 +157,19 @@ __archive_check_magic(struct archive *a, unsigned int magic,
if ((a->state & state) == 0) {
/* If we're already FATAL, don't overwrite the error. */
- if (a->state != ARCHIVE_STATE_FATAL)
+ if (a->state != ARCHIVE_STATE_FATAL) {
+ write_all_states(states1, a->state);
+ write_all_states(states2, state);
archive_set_error(a, -1,
"INTERNAL ERROR: Function '%s' invoked with"
" archive structure in state '%s',"
" should be in state '%s'",
function,
- write_all_states(states1, a->state),
- write_all_states(states2, state));
+ states1,
+ states2);
+ }
a->state = ARCHIVE_STATE_FATAL;
return (ARCHIVE_FATAL);
}
- return ARCHIVE_OK;
+ return (ARCHIVE_OK);
}
diff --git a/libarchive/archive_cmdline.c b/libarchive/archive_cmdline.c
index 5c519cd17f1b..2e5428cae516 100644
--- a/libarchive/archive_cmdline.c
+++ b/libarchive/archive_cmdline.c
@@ -25,8 +25,6 @@
#include "archive_platform.h"
-__FBSDID("$FreeBSD$");
-
#ifdef HAVE_STRING_H
# include <string.h>
#endif
diff --git a/libarchive/archive_cmdline_private.h b/libarchive/archive_cmdline_private.h
index 57a19494fd7a..7495dfed55dd 100644
--- a/libarchive/archive_cmdline_private.h
+++ b/libarchive/archive_cmdline_private.h
@@ -21,8 +21,6 @@
* 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 ARCHIVE_CMDLINE_PRIVATE_H
diff --git a/libarchive/archive_crc32.h b/libarchive/archive_crc32.h
index 4f1aed305930..98a4e2cf8f7f 100644
--- a/libarchive/archive_crc32.h
+++ b/libarchive/archive_crc32.h
@@ -21,8 +21,6 @@
* 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: head/lib/libarchive/archive_crc32.h 201102 2009-12-28 03:11:36Z kientzle $
*/
#ifndef ARCHIVE_CRC32_H
diff --git a/libarchive/archive_cryptor.c b/libarchive/archive_cryptor.c
index 112baf161348..437dba06be62 100644
--- a/libarchive/archive_cryptor.c
+++ b/libarchive/archive_cryptor.c
@@ -424,8 +424,8 @@ static int
aes_ctr_release(archive_crypto_ctx *ctx)
{
EVP_CIPHER_CTX_free(ctx->ctx);
- memset(ctx->key, 0, ctx->key_len);
- memset(ctx->nonce, 0, sizeof(ctx->nonce));
+ OPENSSL_cleanse(ctx->key, ctx->key_len);
+ OPENSSL_cleanse(ctx->nonce, sizeof(ctx->nonce));
return 0;
}
diff --git a/libarchive/archive_digest.c b/libarchive/archive_digest.c
index 410df01563df..3776831b21c9 100644
--- a/libarchive/archive_digest.c
+++ b/libarchive/archive_digest.c
@@ -36,6 +36,11 @@
#error Cannot use both OpenSSL and libmd.
#endif
+/* Common in other bcrypt implementations, but missing from VS2008. */
+#ifndef BCRYPT_SUCCESS
+#define BCRYPT_SUCCESS(r) ((NTSTATUS)(r) == STATUS_SUCCESS)
+#endif
+
/*
* Message digest functions for Windows platform.
*/
@@ -48,17 +53,37 @@
/*
* Initialize a Message digest.
*/
+#if defined(HAVE_BCRYPT_H) && _WIN32_WINNT >= _WIN32_WINNT_VISTA
+static int
+win_crypto_init(Digest_CTX *ctx, const WCHAR *algo)
+{
+ NTSTATUS status;
+ ctx->valid = 0;
+
+ status = BCryptOpenAlgorithmProvider(&ctx->hAlg, algo, NULL, 0);
+ if (!BCRYPT_SUCCESS(status))
+ return (ARCHIVE_FAILED);
+ status = BCryptCreateHash(ctx->hAlg, &ctx->hHash, NULL, 0, NULL, 0, 0);
+ if (!BCRYPT_SUCCESS(status)) {
+ BCryptCloseAlgorithmProvider(ctx->hAlg, 0);
+ return (ARCHIVE_FAILED);
+ }
+
+ ctx->valid = 1;
+ return (ARCHIVE_OK);
+}
+#else
static int
-win_crypto_init(Digest_CTX *ctx, ALG_ID algId)
+win_crypto_init(Digest_CTX *ctx, DWORD prov, ALG_ID algId)
{
ctx->valid = 0;
if (!CryptAcquireContext(&ctx->cryptProv, NULL, NULL,
- PROV_RSA_FULL, CRYPT_VERIFYCONTEXT)) {
+ prov, CRYPT_VERIFYCONTEXT)) {
if (GetLastError() != (DWORD)NTE_BAD_KEYSET)
return (ARCHIVE_FAILED);
if (!CryptAcquireContext(&ctx->cryptProv, NULL, NULL,
- PROV_RSA_FULL, CRYPT_NEWKEYSET))
+ prov, CRYPT_NEWKEYSET))
return (ARCHIVE_FAILED);
}
@@ -70,6 +95,7 @@ win_crypto_init(Digest_CTX *ctx, ALG_ID algId)
ctx->valid = 1;
return (ARCHIVE_OK);
}
+#endif
/*
* Update a Message digest.
@@ -81,23 +107,37 @@ win_crypto_Update(Digest_CTX *ctx, const unsigned char *buf, size_t len)
if (!ctx->valid)
return (ARCHIVE_FAILED);
+#if defined(HAVE_BCRYPT_H) && _WIN32_WINNT >= _WIN32_WINNT_VISTA
+ BCryptHashData(ctx->hHash,
+ (PUCHAR)(uintptr_t)buf,
+ (ULONG)len, 0);
+#else
CryptHashData(ctx->hash,
(unsigned char *)(uintptr_t)buf,
(DWORD)len, 0);
+#endif
return (ARCHIVE_OK);
}
static int
win_crypto_Final(unsigned char *buf, size_t bufsize, Digest_CTX *ctx)
{
+#if !(defined(HAVE_BCRYPT_H) && _WIN32_WINNT >= _WIN32_WINNT_VISTA)
DWORD siglen = (DWORD)bufsize;
+#endif
if (!ctx->valid)
return (ARCHIVE_FAILED);
+#if defined(HAVE_BCRYPT_H) && _WIN32_WINNT >= _WIN32_WINNT_VISTA
+ BCryptFinishHash(ctx->hHash, buf, (ULONG)bufsize, 0);
+ BCryptDestroyHash(ctx->hHash);
+ BCryptCloseAlgorithmProvider(ctx->hAlg, 0);
+#else
CryptGetHashParam(ctx->hash, HP_HASHVAL, buf, &siglen, 0);
CryptDestroyHash(ctx->hash);
CryptReleaseContext(ctx->cryptProv, 0);
+#endif
ctx->valid = 0;
return (ARCHIVE_OK);
}
@@ -243,7 +283,8 @@ __archive_md5init(archive_md5_ctx *ctx)
{
if ((*ctx = EVP_MD_CTX_new()) == NULL)
return (ARCHIVE_FAILED);
- EVP_DigestInit(*ctx, EVP_md5());
+ if (!EVP_DigestInit(*ctx, EVP_md5()))
+ return (ARCHIVE_FAILED);
return (ARCHIVE_OK);
}
@@ -275,7 +316,11 @@ __archive_md5final(archive_md5_ctx *ctx, void *md)
static int
__archive_md5init(archive_md5_ctx *ctx)
{
- return (win_crypto_init(ctx, CALG_MD5));
+#if defined(HAVE_BCRYPT_H) && _WIN32_WINNT >= _WIN32_WINNT_VISTA
+ return (win_crypto_init(ctx, BCRYPT_MD5_ALGORITHM));
+#else
+ return (win_crypto_init(ctx, PROV_RSA_FULL, CALG_MD5));
+#endif
}
static int
@@ -434,7 +479,8 @@ __archive_ripemd160init(archive_rmd160_ctx *ctx)
{
if ((*ctx = EVP_MD_CTX_new()) == NULL)
return (ARCHIVE_FAILED);
- EVP_DigestInit(*ctx, EVP_ripemd160());
+ if (!EVP_DigestInit(*ctx, EVP_ripemd160()))
+ return (ARCHIVE_FAILED);
return (ARCHIVE_OK);
}
@@ -624,7 +670,8 @@ __archive_sha1init(archive_sha1_ctx *ctx)
{
if ((*ctx = EVP_MD_CTX_new()) == NULL)
return (ARCHIVE_FAILED);
- EVP_DigestInit(*ctx, EVP_sha1());
+ if (!EVP_DigestInit(*ctx, EVP_sha1()))
+ return (ARCHIVE_FAILED);
return (ARCHIVE_OK);
}
@@ -656,7 +703,11 @@ __archive_sha1final(archive_sha1_ctx *ctx, void *md)
static int
__archive_sha1init(archive_sha1_ctx *ctx)
{
- return (win_crypto_init(ctx, CALG_SHA1));
+#if defined(HAVE_BCRYPT_H) && _WIN32_WINNT >= _WIN32_WINNT_VISTA
+ return (win_crypto_init(ctx, BCRYPT_SHA1_ALGORITHM));
+#else
+ return (win_crypto_init(ctx, PROV_RSA_FULL, CALG_SHA1));
+#endif
}
static int
@@ -887,7 +938,8 @@ __archive_sha256init(archive_sha256_ctx *ctx)
{
if ((*ctx = EVP_MD_CTX_new()) == NULL)
return (ARCHIVE_FAILED);
- EVP_DigestInit(*ctx, EVP_sha256());
+ if (!EVP_DigestInit(*ctx, EVP_sha256()))
+ return (ARCHIVE_FAILED);
return (ARCHIVE_OK);
}
@@ -915,7 +967,11 @@ __archive_sha256final(archive_sha256_ctx *ctx, void *md)
static int
__archive_sha256init(archive_sha256_ctx *ctx)
{
- return (win_crypto_init(ctx, CALG_SHA_256));
+#if defined(HAVE_BCRYPT_H) && _WIN32_WINNT >= _WIN32_WINNT_VISTA
+ return (win_crypto_init(ctx, BCRYPT_SHA256_ALGORITHM));
+#else
+ return (win_crypto_init(ctx, PROV_RSA_AES, CALG_SHA_256));
+#endif
}
static int
@@ -1122,7 +1178,8 @@ __archive_sha384init(archive_sha384_ctx *ctx)
{
if ((*ctx = EVP_MD_CTX_new()) == NULL)
return (ARCHIVE_FAILED);
- EVP_DigestInit(*ctx, EVP_sha384());
+ if (!EVP_DigestInit(*ctx, EVP_sha384()))
+ return (ARCHIVE_FAILED);
return (ARCHIVE_OK);
}
@@ -1150,7 +1207,11 @@ __archive_sha384final(archive_sha384_ctx *ctx, void *md)
static int
__archive_sha384init(archive_sha384_ctx *ctx)
{
- return (win_crypto_init(ctx, CALG_SHA_384));
+#if defined(HAVE_BCRYPT_H) && _WIN32_WINNT >= _WIN32_WINNT_VISTA
+ return (win_crypto_init(ctx, BCRYPT_SHA384_ALGORITHM));
+#else
+ return (win_crypto_init(ctx, PROV_RSA_AES, CALG_SHA_384));
+#endif
}
static int
@@ -1381,7 +1442,8 @@ __archive_sha512init(archive_sha512_ctx *ctx)
{
if ((*ctx = EVP_MD_CTX_new()) == NULL)
return (ARCHIVE_FAILED);
- EVP_DigestInit(*ctx, EVP_sha512());
+ if (!EVP_DigestInit(*ctx, EVP_sha512()))
+ return (ARCHIVE_FAILED);
return (ARCHIVE_OK);
}
@@ -1409,7 +1471,11 @@ __archive_sha512final(archive_sha512_ctx *ctx, void *md)
static int
__archive_sha512init(archive_sha512_ctx *ctx)
{
- return (win_crypto_init(ctx, CALG_SHA_512));
+#if defined(HAVE_BCRYPT_H) && _WIN32_WINNT >= _WIN32_WINNT_VISTA
+ return (win_crypto_init(ctx, BCRYPT_SHA512_ALGORITHM));
+#else
+ return (win_crypto_init(ctx, PROV_RSA_AES, CALG_SHA_512));
+#endif
}
static int
diff --git a/libarchive/archive_digest_private.h b/libarchive/archive_digest_private.h
index 9b3bd6621bf3..339b4edca48d 100644
--- a/libarchive/archive_digest_private.h
+++ b/libarchive/archive_digest_private.h
@@ -164,6 +164,15 @@
defined(ARCHIVE_CRYPTO_SHA256_WIN) ||\
defined(ARCHIVE_CRYPTO_SHA384_WIN) ||\
defined(ARCHIVE_CRYPTO_SHA512_WIN)
+#if defined(HAVE_BCRYPT_H) && _WIN32_WINNT >= _WIN32_WINNT_VISTA
+/* don't use bcrypt when XP needs to be supported */
+#include <bcrypt.h>
+typedef struct {
+ int valid;
+ BCRYPT_ALG_HANDLE hAlg;
+ BCRYPT_HASH_HANDLE hHash;
+} Digest_CTX;
+#else
#include <windows.h>
#include <wincrypt.h>
typedef struct {
@@ -172,6 +181,7 @@ typedef struct {
HCRYPTHASH hash;
} Digest_CTX;
#endif
+#endif
/* typedefs */
#if defined(ARCHIVE_CRYPTO_MD5_LIBC)
diff --git a/libarchive/archive_endian.h b/libarchive/archive_endian.h
index e6d3f2ce5e70..83b2efa531ef 100644
--- a/libarchive/archive_endian.h
+++ b/libarchive/archive_endian.h
@@ -23,8 +23,6 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $FreeBSD: head/lib/libarchive/archive_endian.h 201085 2009-12-28 02:17:15Z kientzle $
- *
* Borrowed from FreeBSD's <sys/endian.h>
*/
diff --git a/libarchive/archive_entry.3 b/libarchive/archive_entry.3
index 2f62a4be233e..0fc0f8cc2fe6 100644
--- a/libarchive/archive_entry.3
+++ b/libarchive/archive_entry.3
@@ -23,8 +23,6 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $FreeBSD$
-.\"
.Dd February 2, 2012
.Dt ARCHIVE_ENTRY 3
.Os
diff --git a/libarchive/archive_entry.c b/libarchive/archive_entry.c
index ca7a4bdb50e7..9463233e6a42 100644
--- a/libarchive/archive_entry.c
+++ b/libarchive/archive_entry.c
@@ -25,7 +25,6 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/archive_entry.c 201096 2009-12-28 02:41:27Z kientzle $");
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
@@ -372,6 +371,12 @@ archive_entry_filetype(struct archive_entry *entry)
return (AE_IFMT & entry->acl.mode);
}
+int
+archive_entry_filetype_is_set(struct archive_entry *entry)
+{
+ return (entry->ae_set & AE_SET_FILETYPE);
+}
+
void
archive_entry_fflags(struct archive_entry *entry,
unsigned long *set, unsigned long *clear)
@@ -425,6 +430,12 @@ archive_entry_gid(struct archive_entry *entry)
return (entry->ae_stat.aest_gid);
}
+int
+archive_entry_gid_is_set(struct archive_entry *entry)
+{
+ return (entry->ae_set & AE_SET_GID);
+}
+
const char *
archive_entry_gname(struct archive_entry *entry)
{
@@ -568,6 +579,13 @@ archive_entry_nlink(struct archive_entry *entry)
return (entry->ae_stat.aest_nlink);
}
+/* Instead, our caller could have chosen a specific encoding
+ * (archive_mstring_get_mbs, archive_mstring_get_utf8,
+ * archive_mstring_get_wcs). So we should try multiple
+ * encodings. Try mbs first because of history, even though
+ * utf8 might be better for pathname portability.
+ * Also omit wcs because of type mismatch (char * versus wchar *)
+ */
const char *
archive_entry_pathname(struct archive_entry *entry)
{
@@ -575,6 +593,13 @@ archive_entry_pathname(struct archive_entry *entry)
if (archive_mstring_get_mbs(
entry->archive, &entry->ae_pathname, &p) == 0)
return (p);
+#if HAVE_EILSEQ /*{*/
+ if (errno == EILSEQ) {
+ if (archive_mstring_get_utf8(
+ entry->archive, &entry->ae_pathname, &p) == 0)
+ return (p);
+ }
+#endif /*}*/
if (errno == ENOMEM)
__archive_errx(1, "No memory");
return (NULL);
@@ -617,6 +642,12 @@ archive_entry_perm(struct archive_entry *entry)
return (~AE_IFMT & entry->acl.mode);
}
+int
+archive_entry_perm_is_set(struct archive_entry *entry)
+{
+ return (entry->ae_set & AE_SET_PERM);
+}
+
dev_t
archive_entry_rdev(struct archive_entry *entry)
{
@@ -745,6 +776,12 @@ archive_entry_uid(struct archive_entry *entry)
return (entry->ae_stat.aest_uid);
}
+int
+archive_entry_uid_is_set(struct archive_entry *entry)
+{
+ return (entry->ae_set & AE_SET_UID);
+}
+
const char *
archive_entry_uname(struct archive_entry *entry)
{
@@ -813,6 +850,7 @@ archive_entry_set_filetype(struct archive_entry *entry, unsigned int type)
entry->stat_valid = 0;
entry->acl.mode &= ~AE_IFMT;
entry->acl.mode |= AE_IFMT & type;
+ entry->ae_set |= AE_SET_FILETYPE;
}
void
@@ -847,6 +885,7 @@ archive_entry_set_gid(struct archive_entry *entry, la_int64_t g)
{
entry->stat_valid = 0;
entry->ae_stat.aest_gid = g;
+ entry->ae_set |= AE_SET_GID;
}
void
@@ -1131,6 +1170,7 @@ archive_entry_set_mode(struct archive_entry *entry, mode_t m)
{
entry->stat_valid = 0;
entry->acl.mode = m;
+ entry->ae_set |= AE_SET_PERM | AE_SET_FILETYPE;
}
void
@@ -1206,6 +1246,7 @@ archive_entry_set_perm(struct archive_entry *entry, mode_t p)
entry->stat_valid = 0;
entry->acl.mode &= AE_IFMT;
entry->acl.mode |= ~AE_IFMT & p;
+ entry->ae_set |= AE_SET_PERM;
}
void
@@ -1340,6 +1381,7 @@ archive_entry_set_uid(struct archive_entry *entry, la_int64_t u)
{
entry->stat_valid = 0;
entry->ae_stat.aest_uid = u;
+ entry->ae_set |= AE_SET_UID;
}
void
diff --git a/libarchive/archive_entry.h b/libarchive/archive_entry.h
index d5cb30de7585..df9cb765f7e8 100644
--- a/libarchive/archive_entry.h
+++ b/libarchive/archive_entry.h
@@ -22,15 +22,13 @@
* 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: head/lib/libarchive/archive_entry.h 201096 2009-12-28 02:41:27Z kientzle $
*/
#ifndef ARCHIVE_ENTRY_H_INCLUDED
#define ARCHIVE_ENTRY_H_INCLUDED
/* Note: Compiler will complain if this does not match archive.h! */
-#define ARCHIVE_VERSION_NUMBER 3006001
+#define ARCHIVE_VERSION_NUMBER 3007003
/*
* Note: archive_entry.h is for use outside of libarchive; the
@@ -122,6 +120,8 @@ typedef ssize_t la_ssize_t;
# define __LA_DECL __declspec(dllimport)
# endif
# endif
+#elif defined __LIBARCHIVE_ENABLE_VISIBILITY
+# define __LA_DECL __attribute__((visibility("default")))
#else
/* Static libraries on all platforms and shared libraries on non-Windows. */
# define __LA_DECL
@@ -249,11 +249,13 @@ __LA_DECL int archive_entry_dev_is_set(struct archive_entry *);
__LA_DECL dev_t archive_entry_devmajor(struct archive_entry *);
__LA_DECL dev_t archive_entry_devminor(struct archive_entry *);
__LA_DECL __LA_MODE_T archive_entry_filetype(struct archive_entry *);
+__LA_DECL int archive_entry_filetype_is_set(struct archive_entry *);
__LA_DECL void archive_entry_fflags(struct archive_entry *,
unsigned long * /* set */,
unsigned long * /* clear */);
__LA_DECL const char *archive_entry_fflags_text(struct archive_entry *);
__LA_DECL la_int64_t archive_entry_gid(struct archive_entry *);
+__LA_DECL int archive_entry_gid_is_set(struct archive_entry *);
__LA_DECL const char *archive_entry_gname(struct archive_entry *);
__LA_DECL const char *archive_entry_gname_utf8(struct archive_entry *);
__LA_DECL const wchar_t *archive_entry_gname_w(struct archive_entry *);
@@ -272,6 +274,7 @@ __LA_DECL const char *archive_entry_pathname(struct archive_entry *);
__LA_DECL const char *archive_entry_pathname_utf8(struct archive_entry *);
__LA_DECL const wchar_t *archive_entry_pathname_w(struct archive_entry *);
__LA_DECL __LA_MODE_T archive_entry_perm(struct archive_entry *);
+__LA_DECL int archive_entry_perm_is_set(struct archive_entry *);
__LA_DECL dev_t archive_entry_rdev(struct archive_entry *);
__LA_DECL dev_t archive_entry_rdevmajor(struct archive_entry *);
__LA_DECL dev_t archive_entry_rdevminor(struct archive_entry *);
@@ -285,6 +288,7 @@ __LA_DECL const char *archive_entry_symlink_utf8(struct archive_entry *);
__LA_DECL int archive_entry_symlink_type(struct archive_entry *);
__LA_DECL const wchar_t *archive_entry_symlink_w(struct archive_entry *);
__LA_DECL la_int64_t archive_entry_uid(struct archive_entry *);
+__LA_DECL int archive_entry_uid_is_set(struct archive_entry *);
__LA_DECL const char *archive_entry_uname(struct archive_entry *);
__LA_DECL const char *archive_entry_uname_utf8(struct archive_entry *);
__LA_DECL const wchar_t *archive_entry_uname_w(struct archive_entry *);
diff --git a/libarchive/archive_entry_copy_bhfi.c b/libarchive/archive_entry_copy_bhfi.c
index 77bf38e450f2..d5317a5eab5b 100644
--- a/libarchive/archive_entry_copy_bhfi.c
+++ b/libarchive/archive_entry_copy_bhfi.c
@@ -24,7 +24,6 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD$");
#include "archive_private.h"
#include "archive_entry.h"
diff --git a/libarchive/archive_entry_copy_stat.c b/libarchive/archive_entry_copy_stat.c
index ac83868e8f8a..f9c2e8469b1e 100644
--- a/libarchive/archive_entry_copy_stat.c
+++ b/libarchive/archive_entry_copy_stat.c
@@ -24,7 +24,6 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/archive_entry_copy_stat.c 189466 2009-03-07 00:52:02Z kientzle $");
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
diff --git a/libarchive/archive_entry_link_resolver.c b/libarchive/archive_entry_link_resolver.c
index c7d59497a7cf..6c6173430250 100644
--- a/libarchive/archive_entry_link_resolver.c
+++ b/libarchive/archive_entry_link_resolver.c
@@ -24,7 +24,6 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/archive_entry_link_resolver.c 201100 2009-12-28 03:05:31Z kientzle $");
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
diff --git a/libarchive/archive_entry_locale.h b/libarchive/archive_entry_locale.h
index 803c0368bb69..1b90c57eabf2 100644
--- a/libarchive/archive_entry_locale.h
+++ b/libarchive/archive_entry_locale.h
@@ -21,8 +21,6 @@
* 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 ARCHIVE_ENTRY_LOCALE_H_INCLUDED
diff --git a/libarchive/archive_entry_private.h b/libarchive/archive_entry_private.h
index cf4deb24ec83..3423966c60f3 100644
--- a/libarchive/archive_entry_private.h
+++ b/libarchive/archive_entry_private.h
@@ -21,8 +21,6 @@
* 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: head/lib/libarchive/archive_entry_private.h 201096 2009-12-28 02:41:27Z kientzle $
*/
#ifndef ARCHIVE_ENTRY_PRIVATE_H_INCLUDED
@@ -147,6 +145,10 @@ struct archive_entry {
#define AE_SET_SIZE 64
#define AE_SET_INO 128
#define AE_SET_DEV 256
+#define AE_SET_PERM 512
+#define AE_SET_FILETYPE 1024
+#define AE_SET_UID 2048
+#define AE_SET_GID 4096
/*
* Use aes here so that we get transparent mbs<->wcs conversions.
diff --git a/libarchive/archive_entry_sparse.c b/libarchive/archive_entry_sparse.c
index 74917b37b804..b81684d18730 100644
--- a/libarchive/archive_entry_sparse.c
+++ b/libarchive/archive_entry_sparse.c
@@ -25,7 +25,6 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD$");
#include "archive.h"
#include "archive_entry.h"
diff --git a/libarchive/archive_entry_stat.c b/libarchive/archive_entry_stat.c
index 71a407b1f8b3..c4906838ed0f 100644
--- a/libarchive/archive_entry_stat.c
+++ b/libarchive/archive_entry_stat.c
@@ -24,7 +24,6 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/archive_entry_stat.c 201100 2009-12-28 03:05:31Z kientzle $");
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
diff --git a/libarchive/archive_entry_strmode.c b/libarchive/archive_entry_strmode.c
index af2517a32199..5faa2faeefa0 100644
--- a/libarchive/archive_entry_strmode.c
+++ b/libarchive/archive_entry_strmode.c
@@ -24,7 +24,6 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/archive_entry_strmode.c,v 1.4 2008/06/15 05:14:01 kientzle Exp $");
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
diff --git a/libarchive/archive_entry_time.3 b/libarchive/archive_entry_time.3
index d0563eaef43a..0f1dbb025127 100644
--- a/libarchive/archive_entry_time.3
+++ b/libarchive/archive_entry_time.3
@@ -23,8 +23,6 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $FreeBSD$
-.\"
.Dd February 2, 2012
.Dt ARCHIVE_ENTRY_TIME 3
.Os
diff --git a/libarchive/archive_entry_xattr.c b/libarchive/archive_entry_xattr.c
index 5fe726b99d0c..14848a5ab2c4 100644
--- a/libarchive/archive_entry_xattr.c
+++ b/libarchive/archive_entry_xattr.c
@@ -24,7 +24,6 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/archive_entry_xattr.c 201096 2009-12-28 02:41:27Z kientzle $");
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
diff --git a/libarchive/archive_getdate.c b/libarchive/archive_getdate.c
index 39e224cb9010..69eebb0a079f 100644
--- a/libarchive/archive_getdate.c
+++ b/libarchive/archive_getdate.c
@@ -28,10 +28,6 @@
*/
#include "archive_platform.h"
-#ifdef __FreeBSD__
-#include <sys/cdefs.h>
-__FBSDID("$FreeBSD$");
-#endif
#include <ctype.h>
#include <stdio.h>
@@ -698,13 +694,9 @@ Convert(time_t Month, time_t Day, time_t Year,
time_t Julian;
int i;
struct tm *ltime;
-#if defined(HAVE_LOCALTIME_R) || defined(HAVE__LOCALTIME64_S)
+#if defined(HAVE_LOCALTIME_R) || defined(HAVE_LOCALTIME_S)
struct tm tmbuf;
#endif
-#if defined(HAVE__LOCALTIME64_S)
- errno_t terr;
- __time64_t tmptime;
-#endif
if (Year < 69)
Year += 2000;
@@ -731,15 +723,10 @@ Convert(time_t Month, time_t Day, time_t Year,
Julian *= DAY;
Julian += Timezone;
Julian += Hours * HOUR + Minutes * MINUTE + Seconds;
-#if defined(HAVE_LOCALTIME_R)
+#if defined(HAVE_LOCALTIME_S)
+ ltime = localtime_s(&tmbuf, &Julian) ? NULL : &tmbuf;
+#elif defined(HAVE_LOCALTIME_R)
ltime = localtime_r(&Julian, &tmbuf);
-#elif defined(HAVE__LOCALTIME64_S)
- tmptime = Julian;
- terr = _localtime64_s(&tmbuf, &tmptime);
- if (terr)
- ltime = NULL;
- else
- ltime = &tmbuf;
#else
ltime = localtime(&Julian);
#endif
@@ -755,36 +742,21 @@ DSTcorrect(time_t Start, time_t Future)
time_t StartDay;
time_t FutureDay;
struct tm *ltime;
-#if defined(HAVE_LOCALTIME_R) || defined(HAVE__LOCALTIME64_S)
+#if defined(HAVE_LOCALTIME_R) || defined(HAVE_LOCALTIME_S)
struct tm tmbuf;
#endif
-#if defined(HAVE__LOCALTIME64_S)
- errno_t terr;
- __time64_t tmptime;
-#endif
-
-#if defined(HAVE_LOCALTIME_R)
+#if defined(HAVE_LOCALTIME_S)
+ ltime = localtime_s(&tmbuf, &Start) ? NULL : &tmbuf;
+#elif defined(HAVE_LOCALTIME_R)
ltime = localtime_r(&Start, &tmbuf);
-#elif defined(HAVE__LOCALTIME64_S)
- tmptime = Start;
- terr = _localtime64_s(&tmbuf, &tmptime);
- if (terr)
- ltime = NULL;
- else
- ltime = &tmbuf;
#else
ltime = localtime(&Start);
#endif
StartDay = (ltime->tm_hour + 1) % 24;
-#if defined(HAVE_LOCALTIME_R)
+#if defined(HAVE_LOCALTIME_S)
+ ltime = localtime_s(&tmbuf, &Future) ? NULL : &tmbuf;
+#elif defined(HAVE_LOCALTIME_R)
ltime = localtime_r(&Future, &tmbuf);
-#elif defined(HAVE__LOCALTIME64_S)
- tmptime = Future;
- terr = _localtime64_s(&tmbuf, &tmptime);
- if (terr)
- ltime = NULL;
- else
- ltime = &tmbuf;
#else
ltime = localtime(&Future);
#endif
@@ -799,24 +771,15 @@ RelativeDate(time_t Start, time_t zone, int dstmode,
{
struct tm *tm;
time_t t, now;
-#if defined(HAVE_GMTIME_R) || defined(HAVE__GMTIME64_S)
+#if defined(HAVE_GMTIME_R) || defined(HAVE_GMTIME_S)
struct tm tmbuf;
#endif
-#if defined(HAVE__GMTIME64_S)
- errno_t terr;
- __time64_t tmptime;
-#endif
t = Start - zone;
-#if defined(HAVE_GMTIME_R)
+#if defined(HAVE_GMTIME_S)
+ tm = gmtime_s(&tmbuf, &t) ? NULL : &tmbuf;
+#elif defined(HAVE_GMTIME_R)
tm = gmtime_r(&t, &tmbuf);
-#elif defined(HAVE__GMTIME64_S)
- tmptime = t;
- terr = _gmtime64_s(&tmbuf, &tmptime);
- if (terr)
- tm = NULL;
- else
- tm = &tmbuf;
#else
tm = gmtime(&t);
#endif
@@ -835,25 +798,16 @@ RelativeMonth(time_t Start, time_t Timezone, time_t RelMonth)
struct tm *tm;
time_t Month;
time_t Year;
-#if defined(HAVE_LOCALTIME_R) || defined(HAVE__LOCALTIME64_S)
+#if defined(HAVE_LOCALTIME_R) || defined(HAVE_LOCALTIME_S)
struct tm tmbuf;
#endif
-#if defined(HAVE__LOCALTIME64_S)
- errno_t terr;
- __time64_t tmptime;
-#endif
if (RelMonth == 0)
return 0;
-#if defined(HAVE_LOCALTIME_R)
+#if defined(HAVE_LOCALTIME_S)
+ tm = localtime_s(&tmbuf, &Start) ? NULL : &tmbuf;
+#elif defined(HAVE_LOCALTIME_R)
tm = localtime_r(&Start, &tmbuf);
-#elif defined(HAVE__LOCALTIME64_S)
- tmptime = Start;
- terr = _localtime64_s(&tmbuf, &tmptime);
- if (terr)
- tm = NULL;
- else
- tm = &tmbuf;
#else
tm = localtime(&Start);
#endif
@@ -993,10 +947,6 @@ __archive_get_date(time_t now, const char *p)
time_t Start;
time_t tod;
long tzone;
-#if defined(HAVE__LOCALTIME64_S) || defined(HAVE__GMTIME64_S)
- errno_t terr;
- __time64_t tmptime;
-#endif
/* Clear out the parsed token array. */
memset(tokens, 0, sizeof(tokens));
@@ -1005,36 +955,26 @@ __archive_get_date(time_t now, const char *p)
gds = &_gds;
/* Look up the current time. */
-#if defined(HAVE_LOCALTIME_R)
+#if defined(HAVE_LOCALTIME_S)
+ tm = localtime_s(&local, &now) ? NULL : &local;
+#elif defined(HAVE_LOCALTIME_R)
tm = localtime_r(&now, &local);
-#elif defined(HAVE__LOCALTIME64_S)
- tmptime = now;
- terr = _localtime64_s(&local, &tmptime);
- if (terr)
- tm = NULL;
- else
- tm = &local;
#else
memset(&local, 0, sizeof(local));
tm = localtime(&now);
#endif
if (tm == NULL)
return -1;
-#if !defined(HAVE_LOCALTIME_R) && !defined(HAVE__LOCALTIME64_S)
+#if !defined(HAVE_LOCALTIME_R) && !defined(HAVE_LOCALTIME_S)
local = *tm;
#endif
/* Look up UTC if we can and use that to determine the current
* timezone offset. */
-#if defined(HAVE_GMTIME_R)
+#if defined(HAVE_GMTIME_S)
+ gmt_ptr = gmtime_s(&gmt, &now) ? NULL : &gmt;
+#elif defined(HAVE_GMTIME_R)
gmt_ptr = gmtime_r(&now, &gmt);
-#elif defined(HAVE__GMTIME64_S)
- tmptime = now;
- terr = _gmtime64_s(&gmt, &tmptime);
- if (terr)
- gmt_ptr = NULL;
- else
- gmt_ptr = &gmt;
#else
memset(&gmt, 0, sizeof(gmt));
gmt_ptr = gmtime(&now);
@@ -1076,15 +1016,10 @@ __archive_get_date(time_t now, const char *p)
* time components instead of the local timezone. */
if (gds->HaveZone && gmt_ptr != NULL) {
now -= gds->Timezone;
-#if defined(HAVE_GMTIME_R)
+#if defined(HAVE_GMTIME_S)
+ gmt_ptr = gmtime_s(&gmt, &now) ? NULL : &gmt;
+#elif defined(HAVE_GMTIME_R)
gmt_ptr = gmtime_r(&now, &gmt);
-#elif defined(HAVE__GMTIME64_S)
- tmptime = now;
- terr = _gmtime64_s(&gmt, &tmptime);
- if (terr)
- gmt_ptr = NULL;
- else
- gmt_ptr = &gmt;
#else
gmt_ptr = gmtime(&now);
#endif
diff --git a/libarchive/archive_getdate.h b/libarchive/archive_getdate.h
index 900a8f692e98..cfd49ddf7ebb 100644
--- a/libarchive/archive_getdate.h
+++ b/libarchive/archive_getdate.h
@@ -21,8 +21,6 @@
* 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 ARCHIVE_GETDATE_H_INCLUDED
diff --git a/libarchive/archive_hmac.c b/libarchive/archive_hmac.c
index 2a9d04c8d8f1..edb3bf5abd42 100644
--- a/libarchive/archive_hmac.c
+++ b/libarchive/archive_hmac.c
@@ -230,10 +230,28 @@ __hmac_sha1_cleanup(archive_hmac_sha1_ctx *ctx)
static int
__hmac_sha1_init(archive_hmac_sha1_ctx *ctx, const uint8_t *key, size_t key_len)
{
+#if OPENSSL_VERSION_NUMBER >= 0x30000000L
+ EVP_MAC *mac;
+
+ char sha1[] = "SHA1";
+ OSSL_PARAM params[] = {
+ OSSL_PARAM_utf8_string("digest", sha1, sizeof(sha1) - 1),
+ OSSL_PARAM_END
+ };
+
+ mac = EVP_MAC_fetch(NULL, "HMAC", NULL);
+ *ctx = EVP_MAC_CTX_new(mac);
+ EVP_MAC_free(mac);
+ if (*ctx == NULL)
+ return -1;
+
+ EVP_MAC_init(*ctx, key, key_len, params);
+#else
*ctx = HMAC_CTX_new();
if (*ctx == NULL)
return -1;
HMAC_Init_ex(*ctx, key, key_len, EVP_sha1(), NULL);
+#endif
return 0;
}
@@ -241,22 +259,38 @@ static void
__hmac_sha1_update(archive_hmac_sha1_ctx *ctx, const uint8_t *data,
size_t data_len)
{
+#if OPENSSL_VERSION_NUMBER >= 0x30000000L
+ EVP_MAC_update(*ctx, data, data_len);
+#else
HMAC_Update(*ctx, data, data_len);
+#endif
}
static void
__hmac_sha1_final(archive_hmac_sha1_ctx *ctx, uint8_t *out, size_t *out_len)
{
+#if OPENSSL_VERSION_NUMBER >= 0x30000000L
+ size_t len = *out_len;
+#else
unsigned int len = (unsigned int)*out_len;
+#endif
+#if OPENSSL_VERSION_NUMBER >= 0x30000000L
+ EVP_MAC_final(*ctx, out, &len, *out_len);
+#else
HMAC_Final(*ctx, out, &len);
+#endif
*out_len = len;
}
static void
__hmac_sha1_cleanup(archive_hmac_sha1_ctx *ctx)
{
+#if OPENSSL_VERSION_NUMBER >= 0x30000000L
+ EVP_MAC_CTX_free(*ctx);
+#else
HMAC_CTX_free(*ctx);
+#endif
*ctx = NULL;
}
diff --git a/libarchive/archive_hmac_private.h b/libarchive/archive_hmac_private.h
index 13a67d4955a5..d0fda7f9667a 100644
--- a/libarchive/archive_hmac_private.h
+++ b/libarchive/archive_hmac_private.h
@@ -74,9 +74,18 @@ typedef mbedtls_md_context_t archive_hmac_sha1_ctx;
typedef struct hmac_sha1_ctx archive_hmac_sha1_ctx;
#elif defined(HAVE_LIBCRYPTO)
+#include <openssl/opensslv.h>
+#include <openssl/hmac.h>
+#if OPENSSL_VERSION_NUMBER >= 0x30000000L
+#include <openssl/params.h>
+
+typedef EVP_MAC_CTX *archive_hmac_sha1_ctx;
+
+#else
#include "archive_openssl_hmac_private.h"
typedef HMAC_CTX* archive_hmac_sha1_ctx;
+#endif
#else
diff --git a/libarchive/archive_match.c b/libarchive/archive_match.c
index 04747b1f6663..fc8a4ce8127b 100644
--- a/libarchive/archive_match.c
+++ b/libarchive/archive_match.c
@@ -25,7 +25,6 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD$");
#ifdef HAVE_ERRNO_H
#include <errno.h>
diff --git a/libarchive/archive_openssl_evp_private.h b/libarchive/archive_openssl_evp_private.h
index ebb06702d0c5..8ac4772808e6 100644
--- a/libarchive/archive_openssl_evp_private.h
+++ b/libarchive/archive_openssl_evp_private.h
@@ -33,7 +33,8 @@
#include <openssl/evp.h>
#include <openssl/opensslv.h>
-#if OPENSSL_VERSION_NUMBER < 0x10100000L
+#if OPENSSL_VERSION_NUMBER < 0x10100000L || \
+ (defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x2070000fL)
#include <stdlib.h> /* malloc, free */
#include <string.h> /* memset */
static inline EVP_MD_CTX *EVP_MD_CTX_new(void)
diff --git a/libarchive/archive_options.c b/libarchive/archive_options.c
index 6496025a5f6b..92647c9b41c1 100644
--- a/libarchive/archive_options.c
+++ b/libarchive/archive_options.c
@@ -24,7 +24,6 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD$");
#ifdef HAVE_ERRNO_H
#include <errno.h>
diff --git a/libarchive/archive_options_private.h b/libarchive/archive_options_private.h
index 9a7f8080d2f6..3e49222dabdf 100644
--- a/libarchive/archive_options_private.h
+++ b/libarchive/archive_options_private.h
@@ -27,8 +27,6 @@
#define ARCHIVE_OPTIONS_PRIVATE_H_INCLUDED
#include "archive_platform.h"
-__FBSDID("$FreeBSD$");
-
#include "archive_private.h"
typedef int (*option_handler)(struct archive *a,
diff --git a/libarchive/archive_pack_dev.c b/libarchive/archive_pack_dev.c
index d95444d979f2..3c6209b98405 100644
--- a/libarchive/archive_pack_dev.c
+++ b/libarchive/archive_pack_dev.c
@@ -33,13 +33,6 @@
#include "archive_platform.h"
-#if HAVE_SYS_CDEFS_H
-#include <sys/cdefs.h>
-#endif
-#if !defined(lint)
-__RCSID("$NetBSD$");
-#endif /* not lint */
-
#ifdef HAVE_LIMITS_H
#include <limits.h>
#endif
diff --git a/libarchive/archive_pathmatch.c b/libarchive/archive_pathmatch.c
index 0867a268eefe..19e0889ffe55 100644
--- a/libarchive/archive_pathmatch.c
+++ b/libarchive/archive_pathmatch.c
@@ -25,7 +25,6 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD$");
#ifdef HAVE_STRING_H
#include <string.h>
diff --git a/libarchive/archive_pathmatch.h b/libarchive/archive_pathmatch.h
index 9995142921e5..3f406ff7435f 100644
--- a/libarchive/archive_pathmatch.h
+++ b/libarchive/archive_pathmatch.h
@@ -22,8 +22,6 @@
* 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 ARCHIVE_PATHMATCH_H
diff --git a/libarchive/archive_platform.h b/libarchive/archive_platform.h
index 3426975de349..24e8b50323d0 100644
--- a/libarchive/archive_platform.h
+++ b/libarchive/archive_platform.h
@@ -21,8 +21,6 @@
* 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: head/lib/libarchive/archive_platform.h 201090 2009-12-28 02:22:04Z kientzle $
*/
/* !!ONLY FOR USE INTERNALLY TO LIBARCHIVE!! */
@@ -87,19 +85,6 @@
* headers as required.
*/
-/* Get a real definition for __FBSDID or __RCSID if we can */
-#if HAVE_SYS_CDEFS_H
-#include <sys/cdefs.h>
-#endif
-
-/* If not, define them so as to avoid dangling semicolons. */
-#ifndef __FBSDID
-#define __FBSDID(a) struct _undefined_hack
-#endif
-#ifndef __RCSID
-#define __RCSID(a) struct _undefined_hack
-#endif
-
/* Try to get standard C99-style integer type definitions. */
#if HAVE_INTTYPES_H
#include <inttypes.h>
@@ -195,8 +180,9 @@
/*
* glibc 2.24 deprecates readdir_r
+ * bionic c deprecates readdir_r too
*/
-#if defined(HAVE_READDIR_R) && (!defined(__GLIBC__) || !defined(__GLIBC_MINOR__) || __GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 24))
+#if defined(HAVE_READDIR_R) && (!defined(__GLIBC__) || !defined(__GLIBC_MINOR__) || __GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 24)) && (!defined(__ANDROID__))
#define USE_READDIR_R 1
#else
#undef USE_READDIR_R
diff --git a/libarchive/archive_platform_acl.h b/libarchive/archive_platform_acl.h
index 264e6de375a1..48556f87feed 100644
--- a/libarchive/archive_platform_acl.h
+++ b/libarchive/archive_platform_acl.h
@@ -21,8 +21,6 @@
* 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!! */
diff --git a/libarchive/archive_platform_xattr.h b/libarchive/archive_platform_xattr.h
index ad4b90ab7b2a..2ae222f61ef8 100644
--- a/libarchive/archive_platform_xattr.h
+++ b/libarchive/archive_platform_xattr.h
@@ -21,8 +21,6 @@
* 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!! */
diff --git a/libarchive/archive_private.h b/libarchive/archive_private.h
index b2a2cda250eb..0f05169b7d25 100644
--- a/libarchive/archive_private.h
+++ b/libarchive/archive_private.h
@@ -21,8 +21,6 @@
* 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: head/lib/libarchive/archive_private.h 201098 2009-12-28 02:58:14Z kientzle $
*/
#ifndef ARCHIVE_PRIVATE_H_INCLUDED
@@ -40,10 +38,12 @@
#include "archive_string.h"
#if defined(__GNUC__) && (__GNUC__ > 2 || \
- (__GNUC__ == 2 && __GNUC_MINOR__ >= 5))
-#define __LA_DEAD __attribute__((__noreturn__))
+ (__GNUC__ == 2 && __GNUC_MINOR__ >= 5))
+#define __LA_NORETURN __attribute__((__noreturn__))
+#elif defined(_MSC_VER)
+#define __LA_NORETURN __declspec(noreturn)
#else
-#define __LA_DEAD
+#define __LA_NORETURN
#endif
#if defined(__GNUC__) && (__GNUC__ > 2 || \
@@ -153,7 +153,7 @@ int __archive_check_magic(struct archive *, unsigned int magic,
return ARCHIVE_FATAL; \
} while (0)
-void __archive_errx(int retvalue, const char *msg) __LA_DEAD;
+__LA_NORETURN void __archive_errx(int retvalue, const char *msg);
void __archive_ensure_cloexec_flag(int fd);
int __archive_mktemp(const char *tmpdir);
diff --git a/libarchive/archive_random.c b/libarchive/archive_random.c
index 9d1aa493f0c8..8c48d2d3b5a9 100644
--- a/libarchive/archive_random.c
+++ b/libarchive/archive_random.c
@@ -24,7 +24,6 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD$");
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
@@ -51,16 +50,27 @@ __FBSDID("$FreeBSD$");
#include <pthread.h>
#endif
-static void arc4random_buf(void *, size_t);
+static void la_arc4random_buf(void *, size_t);
#endif /* HAVE_ARC4RANDOM_BUF */
#include "archive.h"
#include "archive_random_private.h"
-#if defined(HAVE_WINCRYPT_H) && !defined(__CYGWIN__)
+#if defined(_WIN32) && !defined(__CYGWIN__)
+#if defined(HAVE_BCRYPT_H) && _WIN32_WINNT >= _WIN32_WINNT_VISTA
+/* don't use bcrypt when XP needs to be supported */
+#include <bcrypt.h>
+
+/* Common in other bcrypt implementations, but missing from VS2008. */
+#ifndef BCRYPT_SUCCESS
+#define BCRYPT_SUCCESS(r) ((NTSTATUS)(r) == STATUS_SUCCESS)
+#endif
+
+#elif defined(HAVE_WINCRYPT_H)
#include <wincrypt.h>
#endif
+#endif
#ifndef O_CLOEXEC
#define O_CLOEXEC 0
@@ -75,6 +85,20 @@ int
archive_random(void *buf, size_t nbytes)
{
#if defined(_WIN32) && !defined(__CYGWIN__)
+# if defined(HAVE_BCRYPT_H) && _WIN32_WINNT >= _WIN32_WINNT_VISTA
+ NTSTATUS status;
+ BCRYPT_ALG_HANDLE hAlg;
+
+ status = BCryptOpenAlgorithmProvider(&hAlg, BCRYPT_RNG_ALGORITHM, NULL, 0);
+ if (!BCRYPT_SUCCESS(status))
+ return ARCHIVE_FAILED;
+ status = BCryptGenRandom(hAlg, buf, (ULONG)nbytes, 0);
+ BCryptCloseAlgorithmProvider(hAlg, 0);
+ if (!BCRYPT_SUCCESS(status))
+ return ARCHIVE_FAILED;
+
+ return ARCHIVE_OK;
+# else
HCRYPTPROV hProv;
BOOL success;
@@ -92,6 +116,10 @@ archive_random(void *buf, size_t nbytes)
}
/* TODO: Does this case really happen? */
return ARCHIVE_FAILED;
+# endif
+#elif !defined(HAVE_ARC4RANDOM_BUF) && (!defined(_WIN32) || defined(__CYGWIN__))
+ la_arc4random_buf(buf, nbytes);
+ return ARCHIVE_OK;
#else
arc4random_buf(buf, nbytes);
return ARCHIVE_OK;
@@ -256,7 +284,7 @@ arc4_getbyte(void)
}
static void
-arc4random_buf(void *_buf, size_t n)
+la_arc4random_buf(void *_buf, size_t n)
{
uint8_t *buf = (uint8_t *)_buf;
_ARC4_LOCK();
diff --git a/libarchive/archive_read.3 b/libarchive/archive_read.3
index cbedd0a19129..c81c98be2759 100644
--- a/libarchive/archive_read.3
+++ b/libarchive/archive_read.3
@@ -22,8 +22,6 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $FreeBSD$
-.\"
.Dd February 2, 2012
.Dt ARCHIVE_READ 3
.Os
diff --git a/libarchive/archive_read.c b/libarchive/archive_read.c
index 45a38aed02b6..d71fc2b7cc04 100644
--- a/libarchive/archive_read.c
+++ b/libarchive/archive_read.c
@@ -32,7 +32,6 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/archive_read.c 201157 2009-12-29 05:30:23Z kientzle $");
#ifdef HAVE_ERRNO_H
#include <errno.h>
diff --git a/libarchive/archive_read_add_passphrase.3 b/libarchive/archive_read_add_passphrase.3
index ca60d4fc62f7..c35cfeb34cd5 100644
--- a/libarchive/archive_read_add_passphrase.3
+++ b/libarchive/archive_read_add_passphrase.3
@@ -22,8 +22,6 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $FreeBSD$
-.\"
.Dd September 14, 2014
.Dt ARCHIVE_READ_ADD_PASSPHRASE 3
.Os
diff --git a/libarchive/archive_read_add_passphrase.c b/libarchive/archive_read_add_passphrase.c
index f0b1ab93300f..c67d1df3d1b8 100644
--- a/libarchive/archive_read_add_passphrase.c
+++ b/libarchive/archive_read_add_passphrase.c
@@ -24,7 +24,6 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD$");
#ifdef HAVE_ERRNO_H
#include <errno.h>
diff --git a/libarchive/archive_read_append_filter.c b/libarchive/archive_read_append_filter.c
index 25dc4b2a2b7f..74eead83e0e7 100644
--- a/libarchive/archive_read_append_filter.c
+++ b/libarchive/archive_read_append_filter.c
@@ -24,7 +24,6 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD$");
#ifdef HAVE_ERRNO_H
#include <errno.h>
diff --git a/libarchive/archive_read_data.3 b/libarchive/archive_read_data.3
index 78c0c9000419..694f29264ec1 100644
--- a/libarchive/archive_read_data.3
+++ b/libarchive/archive_read_data.3
@@ -22,8 +22,6 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $FreeBSD$
-.\"
.Dd February 2, 2012
.Dt ARCHIVE_READ_DATA 3
.Os
diff --git a/libarchive/archive_read_data_into_fd.c b/libarchive/archive_read_data_into_fd.c
index b4398f1ecce8..8fd5e12442bc 100644
--- a/libarchive/archive_read_data_into_fd.c
+++ b/libarchive/archive_read_data_into_fd.c
@@ -24,7 +24,6 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_data_into_fd.c,v 1.16 2008/05/23 05:01:29 cperciva Exp $");
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
@@ -95,8 +94,13 @@ archive_read_data_into_fd(struct archive *a, int fd)
"archive_read_data_into_fd");
can_lseek = (fstat(fd, &st) == 0) && S_ISREG(st.st_mode);
- if (!can_lseek)
+ if (!can_lseek) {
nulls = calloc(1, nulls_size);
+ if (!nulls) {
+ r = ARCHIVE_FATAL;
+ goto cleanup;
+ }
+ }
while ((r = archive_read_data_block(a, &buff, &size, &target_offset)) ==
ARCHIVE_OK) {
diff --git a/libarchive/archive_read_disk.3 b/libarchive/archive_read_disk.3
index 8b568d7b0568..7cde3c232713 100644
--- a/libarchive/archive_read_disk.3
+++ b/libarchive/archive_read_disk.3
@@ -22,8 +22,6 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $FreeBSD$
-.\"
.Dd April 3, 2017
.Dt ARCHIVE_READ_DISK 3
.Os
diff --git a/libarchive/archive_read_disk_entry_from_file.c b/libarchive/archive_read_disk_entry_from_file.c
index ab0270bc2850..d89f435554f6 100644
--- a/libarchive/archive_read_disk_entry_from_file.c
+++ b/libarchive/archive_read_disk_entry_from_file.c
@@ -26,7 +26,6 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD");
/* This is the tree-walking code for POSIX systems. */
#if !defined(_WIN32) || defined(__CYGWIN__)
diff --git a/libarchive/archive_read_disk_posix.c b/libarchive/archive_read_disk_posix.c
index 2b39e672b49c..76a4fa44de72 100644
--- a/libarchive/archive_read_disk_posix.c
+++ b/libarchive/archive_read_disk_posix.c
@@ -29,14 +29,10 @@
#if !defined(_WIN32) || defined(__CYGWIN__)
#include "archive_platform.h"
-__FBSDID("$FreeBSD$");
#ifdef HAVE_SYS_PARAM_H
#include <sys/param.h>
#endif
-#ifdef HAVE_SYS_MOUNT_H
-#include <sys/mount.h>
-#endif
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
@@ -54,6 +50,8 @@ __FBSDID("$FreeBSD$");
#endif
#ifdef HAVE_LINUX_FS_H
#include <linux/fs.h>
+#elif HAVE_SYS_MOUNT_H
+#include <sys/mount.h>
#endif
/*
* Some Linux distributions have both linux/ext2_fs.h and ext2fs/ext2_fs.h.
@@ -1671,6 +1669,11 @@ setup_current_filesystem(struct archive_read_disk *a)
else
t->current_filesystem->name_max = nm;
#endif
+ if (t->current_filesystem->name_max == 0) {
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
+ "Cannot determine name_max");
+ return (ARCHIVE_FAILED);
+ }
#endif /* USE_READDIR_R */
return (ARCHIVE_OK);
}
@@ -1861,8 +1864,17 @@ setup_current_filesystem(struct archive_read_disk *a)
#if defined(USE_READDIR_R)
/* Set maximum filename length. */
+#if defined(HAVE_STATVFS)
+ t->current_filesystem->name_max = svfs.f_namemax;
+#else
t->current_filesystem->name_max = sfs.f_namelen;
#endif
+ if (t->current_filesystem->name_max == 0) {
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
+ "Cannot determine name_max");
+ return (ARCHIVE_FAILED);
+ }
+#endif
return (ARCHIVE_OK);
}
@@ -1943,6 +1955,11 @@ setup_current_filesystem(struct archive_read_disk *a)
#if defined(USE_READDIR_R)
/* Set maximum filename length. */
t->current_filesystem->name_max = svfs.f_namemax;
+ if (t->current_filesystem->name_max == 0) {
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
+ "Cannot determine name_max");
+ return (ARCHIVE_FAILED);
+ }
#endif
return (ARCHIVE_OK);
}
@@ -1997,6 +2014,11 @@ setup_current_filesystem(struct archive_read_disk *a)
else
t->current_filesystem->name_max = nm;
# endif /* _PC_NAME_MAX */
+ if (t->current_filesystem->name_max == 0) {
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
+ "Cannot determine name_max");
+ return (ARCHIVE_FAILED);
+ }
#endif /* USE_READDIR_R */
return (ARCHIVE_OK);
}
@@ -2103,6 +2125,8 @@ tree_push(struct tree *t, const char *path, int filesystem_id,
struct tree_entry *te;
te = calloc(1, sizeof(*te));
+ if (te == NULL)
+ __archive_errx(1, "Out of memory");
te->next = t->stack;
te->parent = t->current;
if (te->parent)
@@ -2542,7 +2566,11 @@ tree_current_lstat(struct tree *t)
#else
if (tree_enter_working_dir(t) != 0)
return NULL;
+#ifdef HAVE_LSTAT
if (lstat(tree_current_access_path(t), &t->lst) != 0)
+#else
+ if (la_stat(tree_current_access_path(t), &t->lst) != 0)
+#endif
#endif
return NULL;
t->flags |= hasLstat;
diff --git a/libarchive/archive_read_disk_private.h b/libarchive/archive_read_disk_private.h
index bc8abc15d15c..cf8da99a029b 100644
--- a/libarchive/archive_read_disk_private.h
+++ b/libarchive/archive_read_disk_private.h
@@ -22,8 +22,6 @@
* 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: head/lib/libarchive/archive_read_disk_private.h 201105 2009-12-28 03:20:54Z kientzle $
*/
#ifndef ARCHIVE_READ_DISK_PRIVATE_H_INCLUDED
diff --git a/libarchive/archive_read_disk_set_standard_lookup.c b/libarchive/archive_read_disk_set_standard_lookup.c
index c7fd2471ecbe..3512d343f65b 100644
--- a/libarchive/archive_read_disk_set_standard_lookup.c
+++ b/libarchive/archive_read_disk_set_standard_lookup.c
@@ -24,7 +24,6 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/archive_read_disk_set_standard_lookup.c 201109 2009-12-28 03:30:31Z kientzle $");
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
diff --git a/libarchive/archive_read_disk_windows.c b/libarchive/archive_read_disk_windows.c
index ea32e2aac0ac..6b551f4bb0a7 100644
--- a/libarchive/archive_read_disk_windows.c
+++ b/libarchive/archive_read_disk_windows.c
@@ -25,7 +25,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD$");
#if defined(_WIN32) && !defined(__CYGWIN__)
@@ -418,8 +417,19 @@ la_linkname_from_pathw(const wchar_t *path, wchar_t **outbuf, int *linktype)
FILE_FLAG_OPEN_REPARSE_POINT;
int ret;
- h = CreateFileW(path, 0, FILE_SHARE_READ, NULL, OPEN_EXISTING, flag,
- NULL);
+# if _WIN32_WINNT >= 0x0602 /* _WIN32_WINNT_WIN8 */
+ CREATEFILE2_EXTENDED_PARAMETERS createExParams;
+ ZeroMemory(&createExParams, sizeof(createExParams));
+ createExParams.dwSize = sizeof(createExParams);
+ createExParams.dwFileFlags = flag;
+ h = CreateFile2(path, 0,
+ FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
+ OPEN_EXISTING, &createExParams);
+#else
+ h = CreateFileW(path, 0,
+ FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, NULL,
+ OPEN_EXISTING, flag, NULL);
+#endif
if (h == INVALID_HANDLE_VALUE) {
la_dosmaperr(GetLastError());
return (-1);
@@ -1066,14 +1076,29 @@ next_entry(struct archive_read_disk *a, struct tree *t,
if (archive_entry_filetype(entry) == AE_IFREG &&
archive_entry_size(entry) > 0) {
DWORD flags = FILE_FLAG_BACKUP_SEMANTICS;
+#if _WIN32_WINNT >= 0x0602 /* _WIN32_WINNT_WIN8 */
+ CREATEFILE2_EXTENDED_PARAMETERS createExParams;
+#endif
if (t->async_io)
flags |= FILE_FLAG_OVERLAPPED;
if (t->direct_io)
flags |= FILE_FLAG_NO_BUFFERING;
else
flags |= FILE_FLAG_SEQUENTIAL_SCAN;
+#if _WIN32_WINNT >= 0x0602 /* _WIN32_WINNT_WIN8 */
+ ZeroMemory(&createExParams, sizeof(createExParams));
+ createExParams.dwSize = sizeof(createExParams);
+ createExParams.dwFileFlags = flags;
+ t->entry_fh = CreateFile2(tree_current_access_path(t),
+ GENERIC_READ,
+ FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
+ OPEN_EXISTING, &createExParams);
+#else
t->entry_fh = CreateFileW(tree_current_access_path(t),
- GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, flags, NULL);
+ GENERIC_READ,
+ FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
+ NULL, OPEN_EXISTING, flags, NULL);
+#endif
if (t->entry_fh == INVALID_HANDLE_VALUE) {
la_dosmaperr(GetLastError());
archive_set_error(&a->archive, errno,
@@ -1544,6 +1569,9 @@ close_and_restore_time(HANDLE h, struct tree *t, struct restore_time *rt)
{
HANDLE handle;
int r = 0;
+#if _WIN32_WINNT >= 0x0602 /* _WIN32_WINNT_WIN8 */
+ CREATEFILE2_EXTENDED_PARAMETERS createExParams;
+#endif
if (h == INVALID_HANDLE_VALUE && AE_IFLNK == rt->filetype)
return (0);
@@ -1557,8 +1585,16 @@ close_and_restore_time(HANDLE h, struct tree *t, struct restore_time *rt)
if ((t->flags & needsRestoreTimes) == 0)
return (r);
+#if _WIN32_WINNT >= 0x0602 /* _WIN32_WINNT_WIN8 */
+ ZeroMemory(&createExParams, sizeof(createExParams));
+ createExParams.dwSize = sizeof(createExParams);
+ createExParams.dwFileFlags = FILE_FLAG_BACKUP_SEMANTICS;
+ handle = CreateFile2(rt->full_path, FILE_WRITE_ATTRIBUTES,
+ 0, OPEN_EXISTING, &createExParams);
+#else
handle = CreateFileW(rt->full_path, FILE_WRITE_ATTRIBUTES,
0, NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL);
+#endif
if (handle == INVALID_HANDLE_VALUE) {
errno = EINVAL;
return (-1);
@@ -2043,11 +2079,24 @@ tree_current_file_information(struct tree *t, BY_HANDLE_FILE_INFORMATION *st,
HANDLE h;
int r;
DWORD flag = FILE_FLAG_BACKUP_SEMANTICS;
-
+# if _WIN32_WINNT >= 0x0602 /* _WIN32_WINNT_WIN8 */
+ CREATEFILE2_EXTENDED_PARAMETERS createExParams;
+#endif
+
if (sim_lstat && tree_current_is_physical_link(t))
flag |= FILE_FLAG_OPEN_REPARSE_POINT;
- h = CreateFileW(tree_current_access_path(t), 0, FILE_SHARE_READ, NULL,
+# if _WIN32_WINNT >= 0x0602 /* _WIN32_WINNT_WIN8 */
+ ZeroMemory(&createExParams, sizeof(createExParams));
+ createExParams.dwSize = sizeof(createExParams);
+ createExParams.dwFileFlags = flag;
+ h = CreateFile2(tree_current_access_path(t), 0,
+ FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
+ OPEN_EXISTING, &createExParams);
+#else
+ h = CreateFileW(tree_current_access_path(t), 0,
+ FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, NULL,
OPEN_EXISTING, flag, NULL);
+#endif
if (h == INVALID_HANDLE_VALUE) {
la_dosmaperr(GetLastError());
t->tree_errno = errno;
@@ -2253,7 +2302,10 @@ archive_read_disk_entry_from_file(struct archive *_a,
} else {
WIN32_FIND_DATAW findData;
DWORD flag, desiredAccess;
-
+# if _WIN32_WINNT >= 0x0602 /* _WIN32_WINNT_WIN8 */
+ CREATEFILE2_EXTENDED_PARAMETERS createExParams;
+#endif
+
h = FindFirstFileW(path, &findData);
if (h == INVALID_HANDLE_VALUE) {
la_dosmaperr(GetLastError());
@@ -2275,8 +2327,18 @@ archive_read_disk_entry_from_file(struct archive *_a,
} else
desiredAccess = GENERIC_READ;
- h = CreateFileW(path, desiredAccess, FILE_SHARE_READ, NULL,
+# if _WIN32_WINNT >= 0x0602 /* _WIN32_WINNT_WIN8 */
+ ZeroMemory(&createExParams, sizeof(createExParams));
+ createExParams.dwSize = sizeof(createExParams);
+ createExParams.dwFileFlags = flag;
+ h = CreateFile2(path, desiredAccess,
+ FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
+ OPEN_EXISTING, &createExParams);
+#else
+ h = CreateFileW(path, desiredAccess,
+ FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, NULL,
OPEN_EXISTING, flag, NULL);
+#endif
if (h == INVALID_HANDLE_VALUE) {
la_dosmaperr(GetLastError());
archive_set_error(&a->archive, errno,
@@ -2337,8 +2399,19 @@ archive_read_disk_entry_from_file(struct archive *_a,
if (fd >= 0) {
h = (HANDLE)_get_osfhandle(fd);
} else {
- h = CreateFileW(path, GENERIC_READ, FILE_SHARE_READ, NULL,
+# if _WIN32_WINNT >= 0x0602 /* _WIN32_WINNT_WIN8 */
+ CREATEFILE2_EXTENDED_PARAMETERS createExParams;
+ ZeroMemory(&createExParams, sizeof(createExParams));
+ createExParams.dwSize = sizeof(createExParams);
+ createExParams.dwFileFlags = FILE_FLAG_BACKUP_SEMANTICS;
+ h = CreateFile2(path, GENERIC_READ,
+ FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE,
+ OPEN_EXISTING, &createExParams);
+#else
+ h = CreateFileW(path, GENERIC_READ,
+ FILE_SHARE_READ | FILE_SHARE_WRITE | FILE_SHARE_DELETE, NULL,
OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL);
+#endif
if (h == INVALID_HANDLE_VALUE) {
la_dosmaperr(GetLastError());
archive_set_error(&a->archive, errno,
@@ -2365,6 +2438,7 @@ archive_read_disk_entry_from_file(struct archive *_a,
return (ARCHIVE_OK);
}
+ r = ARCHIVE_OK;
if ((a->flags & ARCHIVE_READDISK_NO_SPARSE) == 0) {
r = setup_sparse_from_disk(a, entry, h);
if (fd < 0)
diff --git a/libarchive/archive_read_extract.3 b/libarchive/archive_read_extract.3
index 858f39742553..f3feb5ad551b 100644
--- a/libarchive/archive_read_extract.3
+++ b/libarchive/archive_read_extract.3
@@ -22,8 +22,6 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $FreeBSD$
-.\"
.Dd February 2, 2012
.Dt ARCHIVE_READ_EXTRACT 3
.Os
diff --git a/libarchive/archive_read_extract.c b/libarchive/archive_read_extract.c
index b7973fa8e006..d2159c64cd83 100644
--- a/libarchive/archive_read_extract.c
+++ b/libarchive/archive_read_extract.c
@@ -24,7 +24,6 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_extract.c,v 1.61 2008/05/26 17:00:22 kientzle Exp $");
#ifdef HAVE_ERRNO_H
#include <errno.h>
diff --git a/libarchive/archive_read_extract2.c b/libarchive/archive_read_extract2.c
index 4febd8ce056f..e11cac1590e9 100644
--- a/libarchive/archive_read_extract2.c
+++ b/libarchive/archive_read_extract2.c
@@ -24,7 +24,6 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_extract.c,v 1.61 2008/05/26 17:00:22 kientzle Exp $");
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
diff --git a/libarchive/archive_read_filter.3 b/libarchive/archive_read_filter.3
index 4f5c3518a6ca..72ff240fd393 100644
--- a/libarchive/archive_read_filter.3
+++ b/libarchive/archive_read_filter.3
@@ -22,8 +22,6 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $FreeBSD$
-.\"
.Dd June 9, 2020
.Dt ARCHIVE_READ_FILTER 3
.Os
diff --git a/libarchive/archive_read_format.3 b/libarchive/archive_read_format.3
index f3804ce3796a..990293c83131 100644
--- a/libarchive/archive_read_format.3
+++ b/libarchive/archive_read_format.3
@@ -22,8 +22,6 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $FreeBSD$
-.\"
.Dd February 2, 2012
.Dt ARCHIVE_READ_FORMAT 3
.Os
diff --git a/libarchive/archive_read_free.3 b/libarchive/archive_read_free.3
index 8371c3a0c60c..7dc121fcaea3 100644
--- a/libarchive/archive_read_free.3
+++ b/libarchive/archive_read_free.3
@@ -22,8 +22,6 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $FreeBSD$
-.\"
.Dd February 2, 2012
.Dt ARCHIVE_READ_FREE 3
.Os
diff --git a/libarchive/archive_read_header.3 b/libarchive/archive_read_header.3
index 1e97f3a27507..024dc41da831 100644
--- a/libarchive/archive_read_header.3
+++ b/libarchive/archive_read_header.3
@@ -22,8 +22,6 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $FreeBSD$
-.\"
.Dd February 2, 2012
.Dt ARCHIVE_READ_HEADER 3
.Os
diff --git a/libarchive/archive_read_new.3 b/libarchive/archive_read_new.3
index 8bb6b848b06a..c2b5cddef098 100644
--- a/libarchive/archive_read_new.3
+++ b/libarchive/archive_read_new.3
@@ -22,8 +22,6 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $FreeBSD$
-.\"
.Dd February 2, 2012
.Dt ARCHIVE_READ_NEW 3
.Os
diff --git a/libarchive/archive_read_open.3 b/libarchive/archive_read_open.3
index f67677823bd0..081b7114bea6 100644
--- a/libarchive/archive_read_open.3
+++ b/libarchive/archive_read_open.3
@@ -22,8 +22,6 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $FreeBSD$
-.\"
.Dd February 2, 2012
.Dt ARCHIVE_READ_OPEN 3
.Os
diff --git a/libarchive/archive_read_open_fd.c b/libarchive/archive_read_open_fd.c
index f59cd07fe6c0..3ee2423d300e 100644
--- a/libarchive/archive_read_open_fd.c
+++ b/libarchive/archive_read_open_fd.c
@@ -24,7 +24,6 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/archive_read_open_fd.c 201103 2009-12-28 03:13:49Z kientzle $");
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
diff --git a/libarchive/archive_read_open_file.c b/libarchive/archive_read_open_file.c
index 101dae6cd9e3..dcf1d4698569 100644
--- a/libarchive/archive_read_open_file.c
+++ b/libarchive/archive_read_open_file.c
@@ -24,7 +24,6 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/archive_read_open_file.c 201093 2009-12-28 02:28:44Z kientzle $");
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
@@ -154,10 +153,10 @@ file_skip(struct archive *a, void *client_data, int64_t request)
#ifdef __ANDROID__
/* fileno() isn't safe on all platforms ... see above. */
if (lseek(fileno(mine->f), skip, SEEK_CUR) < 0)
-#elif HAVE_FSEEKO
- if (fseeko(mine->f, skip, SEEK_CUR) != 0)
#elif HAVE__FSEEKI64
if (_fseeki64(mine->f, skip, SEEK_CUR) != 0)
+#elif HAVE_FSEEKO
+ if (fseeko(mine->f, skip, SEEK_CUR) != 0)
#else
if (fseek(mine->f, skip, SEEK_CUR) != 0)
#endif
diff --git a/libarchive/archive_read_open_filename.c b/libarchive/archive_read_open_filename.c
index 561289b694be..dd2e16022844 100644
--- a/libarchive/archive_read_open_filename.c
+++ b/libarchive/archive_read_open_filename.c
@@ -24,7 +24,6 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/archive_read_open_filename.c 201093 2009-12-28 02:28:44Z kientzle $");
#ifdef HAVE_SYS_IOCTL_H
#include <sys/ioctl.h>
@@ -155,55 +154,73 @@ no_memory:
return (ARCHIVE_FATAL);
}
+/*
+ * This function is an implementation detail of archive_read_open_filename_w,
+ * which is exposed as a separate API on Windows.
+ */
+#if !defined(_WIN32) || defined(__CYGWIN__)
+static
+#endif
int
-archive_read_open_filename_w(struct archive *a, const wchar_t *wfilename,
+archive_read_open_filenames_w(struct archive *a, const wchar_t **wfilenames,
size_t block_size)
{
- struct read_file_data *mine = (struct read_file_data *)calloc(1,
- sizeof(*mine) + wcslen(wfilename) * sizeof(wchar_t));
- if (!mine)
+ struct read_file_data *mine;
+ const wchar_t *wfilename = NULL;
+ if (wfilenames)
+ wfilename = *(wfilenames++);
+
+ archive_clear_error(a);
+ do
{
- archive_set_error(a, ENOMEM, "No memory");
- return (ARCHIVE_FATAL);
- }
- mine->fd = -1;
- mine->block_size = block_size;
+ if (wfilename == NULL)
+ wfilename = L"";
+ mine = (struct read_file_data *)calloc(1,
+ sizeof(*mine) + wcslen(wfilename) * sizeof(wchar_t));
+ if (mine == NULL)
+ goto no_memory;
+ mine->block_size = block_size;
+ mine->fd = -1;
- if (wfilename == NULL || wfilename[0] == L'\0') {
- mine->filename_type = FNT_STDIN;
- } else {
+ if (wfilename == NULL || wfilename[0] == L'\0') {
+ mine->filename_type = FNT_STDIN;
+ } else {
#if defined(_WIN32) && !defined(__CYGWIN__)
- mine->filename_type = FNT_WCS;
- wcscpy(mine->filename.w, wfilename);
+ mine->filename_type = FNT_WCS;
+ wcscpy(mine->filename.w, wfilename);
#else
- /*
- * POSIX system does not support a wchar_t interface for
- * open() system call, so we have to translate a wchar_t
- * filename to multi-byte one and use it.
- */
- struct archive_string fn;
-
- archive_string_init(&fn);
- if (archive_string_append_from_wcs(&fn, wfilename,
- wcslen(wfilename)) != 0) {
- if (errno == ENOMEM)
- archive_set_error(a, errno,
- "Can't allocate memory");
- else
- archive_set_error(a, EINVAL,
- "Failed to convert a wide-character"
- " filename to a multi-byte filename");
+ /*
+ * POSIX system does not support a wchar_t interface for
+ * open() system call, so we have to translate a wchar_t
+ * filename to multi-byte one and use it.
+ */
+ struct archive_string fn;
+
+ archive_string_init(&fn);
+ if (archive_string_append_from_wcs(&fn, wfilename,
+ wcslen(wfilename)) != 0) {
+ if (errno == ENOMEM)
+ archive_set_error(a, errno,
+ "Can't allocate memory");
+ else
+ archive_set_error(a, EINVAL,
+ "Failed to convert a wide-character"
+ " filename to a multi-byte filename");
+ archive_string_free(&fn);
+ free(mine);
+ return (ARCHIVE_FATAL);
+ }
+ mine->filename_type = FNT_MBS;
+ strcpy(mine->filename.m, fn.s);
archive_string_free(&fn);
- free(mine);
- return (ARCHIVE_FATAL);
- }
- mine->filename_type = FNT_MBS;
- strcpy(mine->filename.m, fn.s);
- archive_string_free(&fn);
#endif
- }
- if (archive_read_append_callback_data(a, mine) != (ARCHIVE_OK))
- return (ARCHIVE_FATAL);
+ }
+ if (archive_read_append_callback_data(a, mine) != (ARCHIVE_OK))
+ return (ARCHIVE_FATAL);
+ if (wfilenames == NULL)
+ break;
+ wfilename = *(wfilenames++);
+ } while (wfilename != NULL && wfilename[0] != '\0');
archive_read_set_open_callback(a, file_open);
archive_read_set_read_callback(a, file_read);
archive_read_set_skip_callback(a, file_skip);
@@ -212,6 +229,19 @@ archive_read_open_filename_w(struct archive *a, const wchar_t *wfilename,
archive_read_set_seek_callback(a, file_seek);
return (archive_read_open1(a));
+no_memory:
+ archive_set_error(a, ENOMEM, "No memory");
+ return (ARCHIVE_FATAL);
+}
+
+int
+archive_read_open_filename_w(struct archive *a, const wchar_t *wfilename,
+ size_t block_size)
+{
+ const wchar_t *wfilenames[2];
+ wfilenames[0] = wfilename;
+ wfilenames[1] = NULL;
+ return archive_read_open_filenames_w(a, wfilenames, block_size);
}
static int
diff --git a/libarchive/archive_read_open_memory.c b/libarchive/archive_read_open_memory.c
index 311be47046a2..a057ce643890 100644
--- a/libarchive/archive_read_open_memory.c
+++ b/libarchive/archive_read_open_memory.c
@@ -24,7 +24,6 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/archive_read_open_memory.c,v 1.6 2007/07/06 15:51:59 kientzle Exp $");
#include <errno.h>
#include <stdlib.h>
diff --git a/libarchive/archive_read_private.h b/libarchive/archive_read_private.h
index 383405d52908..0c374f487eba 100644
--- a/libarchive/archive_read_private.h
+++ b/libarchive/archive_read_private.h
@@ -21,8 +21,6 @@
* 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: head/lib/libarchive/archive_read_private.h 201088 2009-12-28 02:18:55Z kientzle $
*/
#ifndef ARCHIVE_READ_PRIVATE_H_INCLUDED
diff --git a/libarchive/archive_read_set_format.c b/libarchive/archive_read_set_format.c
index 796dcdcced11..c74361b20c13 100644
--- a/libarchive/archive_read_set_format.c
+++ b/libarchive/archive_read_set_format.c
@@ -24,7 +24,6 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD$");
#ifdef HAVE_ERRNO_H
#include <errno.h>
diff --git a/libarchive/archive_read_set_options.3 b/libarchive/archive_read_set_options.3
index b2db4cbcb893..ef18dfaa271a 100644
--- a/libarchive/archive_read_set_options.3
+++ b/libarchive/archive_read_set_options.3
@@ -22,8 +22,6 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $FreeBSD$
-.\"
.Dd January 31, 2020
.Dt ARCHIVE_READ_OPTIONS 3
.Os
@@ -255,6 +253,27 @@ have been concatenated together.
Without this option, only the contents of
the first concatenated archive would be read.
.El
+.It Format zip
+.Bl -tag -compact -width indent
+.It Cm compat-2x
+Libarchive 2.x incorrectly encoded Unicode filenames on
+some platforms.
+This option mimics the libarchive 2.x filename handling
+so that such archives can be read correctly.
+.It Cm hdrcharset
+The value is used as a character set name that will be
+used when translating file names.
+.It Cm ignorecrc32
+Skip the CRC32 check.
+Mostly used for testing.
+.It Cm mac-ext
+Support Mac OS metadata extension that records data in special
+files beginning with a period and underscore.
+Defaults to enabled on Mac OS, disabled on other platforms.
+Use
+.Cm !mac-ext
+to disable.
+.El
.El
.\"
.Sh ERRORS
diff --git a/libarchive/archive_read_set_options.c b/libarchive/archive_read_set_options.c
index 2bd9b811eaf4..c0a4b420734e 100644
--- a/libarchive/archive_read_set_options.c
+++ b/libarchive/archive_read_set_options.c
@@ -24,7 +24,6 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD$");
#include "archive_read_private.h"
#include "archive_options_private.h"
diff --git a/libarchive/archive_read_support_filter_all.c b/libarchive/archive_read_support_filter_all.c
index edb508c1dfd8..cb46d120d102 100644
--- a/libarchive/archive_read_support_filter_all.c
+++ b/libarchive/archive_read_support_filter_all.c
@@ -24,7 +24,6 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD$");
#include "archive.h"
#include "archive_private.h"
diff --git a/libarchive/archive_read_support_filter_by_code.c b/libarchive/archive_read_support_filter_by_code.c
index 94c4af695f4d..ce50d8cdf884 100644
--- a/libarchive/archive_read_support_filter_by_code.c
+++ b/libarchive/archive_read_support_filter_by_code.c
@@ -24,7 +24,6 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD$");
#include "archive.h"
#include "archive_private.h"
diff --git a/libarchive/archive_read_support_filter_bzip2.c b/libarchive/archive_read_support_filter_bzip2.c
index 793d605c8725..0392d450a203 100644
--- a/libarchive/archive_read_support_filter_bzip2.c
+++ b/libarchive/archive_read_support_filter_bzip2.c
@@ -25,8 +25,6 @@
#include "archive_platform.h"
-__FBSDID("$FreeBSD$");
-
#ifdef HAVE_ERRNO_H
#include <errno.h>
#endif
@@ -192,7 +190,7 @@ bzip2_reader_init(struct archive_read_filter *self)
self->code = ARCHIVE_FILTER_BZIP2;
self->name = "bzip2";
- state = (struct private_data *)calloc(sizeof(*state), 1);
+ state = (struct private_data *)calloc(1, sizeof(*state));
out_block = (unsigned char *)malloc(out_block_size);
if (state == NULL || out_block == NULL) {
archive_set_error(&self->archive->archive, ENOMEM,
@@ -230,7 +228,7 @@ bzip2_filter_read(struct archive_read_filter *self, const void **p)
/* Empty our output buffer. */
state->stream.next_out = state->out_block;
- state->stream.avail_out = state->out_block_size;
+ state->stream.avail_out = (uint32_t)state->out_block_size;
/* Try to fill the output buffer. */
for (;;) {
@@ -288,7 +286,7 @@ bzip2_filter_read(struct archive_read_filter *self, const void **p)
return (ARCHIVE_FATAL);
}
state->stream.next_in = (char *)(uintptr_t)read_buf;
- state->stream.avail_in = ret;
+ state->stream.avail_in = (uint32_t)ret;
/* There is no more data, return whatever we have. */
if (ret == 0) {
state->eof = 1;
diff --git a/libarchive/archive_read_support_filter_compress.c b/libarchive/archive_read_support_filter_compress.c
index 05b80a576ac1..29ae72abef71 100644
--- a/libarchive/archive_read_support_filter_compress.c
+++ b/libarchive/archive_read_support_filter_compress.c
@@ -64,7 +64,6 @@
#include "archive_platform.h"
-__FBSDID("$FreeBSD$");
#ifdef HAVE_ERRNO_H
#include <errno.h>
@@ -218,7 +217,7 @@ compress_bidder_init(struct archive_read_filter *self)
self->code = ARCHIVE_FILTER_COMPRESS;
self->name = "compress (.Z)";
- state = (struct private_data *)calloc(sizeof(*state), 1);
+ state = (struct private_data *)calloc(1, sizeof(*state));
out_block = malloc(out_block_size);
if (state == NULL || out_block == NULL) {
free(out_block);
diff --git a/libarchive/archive_read_support_filter_grzip.c b/libarchive/archive_read_support_filter_grzip.c
index d4d1737cd97e..15b6757cb90c 100644
--- a/libarchive/archive_read_support_filter_grzip.c
+++ b/libarchive/archive_read_support_filter_grzip.c
@@ -25,9 +25,6 @@
#include "archive_platform.h"
-__FBSDID("$FreeBSD$");
-
-
#ifdef HAVE_ERRNO_H
#include <errno.h>
#endif
diff --git a/libarchive/archive_read_support_filter_gzip.c b/libarchive/archive_read_support_filter_gzip.c
index 4135a6361802..152ea9bdbd7c 100644
--- a/libarchive/archive_read_support_filter_gzip.c
+++ b/libarchive/archive_read_support_filter_gzip.c
@@ -25,9 +25,6 @@
#include "archive_platform.h"
-__FBSDID("$FreeBSD$");
-
-
#ifdef HAVE_ERRNO_H
#include <errno.h>
#endif
@@ -310,7 +307,7 @@ gzip_bidder_init(struct archive_read_filter *self)
self->code = ARCHIVE_FILTER_GZIP;
self->name = "gzip";
- state = (struct private_data *)calloc(sizeof(*state), 1);
+ state = (struct private_data *)calloc(1, sizeof(*state));
out_block = (unsigned char *)malloc(out_block_size);
if (state == NULL || out_block == NULL) {
free(out_block);
diff --git a/libarchive/archive_read_support_filter_lrzip.c b/libarchive/archive_read_support_filter_lrzip.c
index a2389894f1d8..a562d538ed81 100644
--- a/libarchive/archive_read_support_filter_lrzip.c
+++ b/libarchive/archive_read_support_filter_lrzip.c
@@ -25,9 +25,6 @@
#include "archive_platform.h"
-__FBSDID("$FreeBSD$");
-
-
#ifdef HAVE_ERRNO_H
#include <errno.h>
#endif
diff --git a/libarchive/archive_read_support_filter_lz4.c b/libarchive/archive_read_support_filter_lz4.c
index ae0b08003f80..bccf4fb8f82d 100644
--- a/libarchive/archive_read_support_filter_lz4.c
+++ b/libarchive/archive_read_support_filter_lz4.c
@@ -25,8 +25,6 @@
#include "archive_platform.h"
-__FBSDID("$FreeBSD$");
-
#ifdef HAVE_ERRNO_H
#include <errno.h>
#endif
@@ -225,7 +223,7 @@ lz4_reader_init(struct archive_read_filter *self)
self->code = ARCHIVE_FILTER_LZ4;
self->name = "lz4";
- state = (struct private_data *)calloc(sizeof(*state), 1);
+ state = (struct private_data *)calloc(1, sizeof(*state));
if (state == NULL) {
archive_set_error(&self->archive->archive, ENOMEM,
"Can't allocate data for lz4 decompression");
@@ -449,8 +447,10 @@ lz4_filter_read_descriptor(struct archive_read_filter *self)
chsum = __archive_xxhash.XXH32(read_buf, (int)descriptor_bytes -1, 0);
chsum = (chsum >> 8) & 0xff;
chsum_verifier = read_buf[descriptor_bytes-1] & 0xff;
+#ifndef DONT_FAIL_ON_CRC_ERROR
if (chsum != chsum_verifier)
goto malformed_error;
+#endif
__archive_read_filter_consume(self->upstream, descriptor_bytes);
@@ -520,8 +520,10 @@ lz4_filter_read_data_block(struct archive_read_filter *self, const void **p)
read_buf + 4, (int)compressed_size, 0);
unsigned int chsum_block =
archive_le32dec(read_buf + 4 + compressed_size);
+#ifndef DONT_FAIL_ON_CRC_ERROR
if (chsum != chsum_block)
goto malformed_error;
+#endif
}
@@ -580,7 +582,7 @@ lz4_filter_read_data_block(struct archive_read_filter *self, const void **p)
state->out_block + prefix64k, (int)compressed_size,
state->flags.block_maximum_size,
state->out_block,
- prefix64k);
+ (int)prefix64k);
#else
uncompressed_size = LZ4_decompress_safe_withPrefix64k(
read_buf + 4,
@@ -652,10 +654,12 @@ lz4_filter_read_default_stream(struct archive_read_filter *self, const void **p)
state->xxh32_state);
state->xxh32_state = NULL;
if (checksum != checksum_stream) {
+#ifndef DONT_FAIL_ON_CRC_ERROR
archive_set_error(&self->archive->archive,
ARCHIVE_ERRNO_MISC,
"lz4 stream checksum error");
return (ARCHIVE_FATAL);
+#endif
}
} else if (ret > 0)
__archive_xxhash.XXH32_update(state->xxh32_state,
diff --git a/libarchive/archive_read_support_filter_lzop.c b/libarchive/archive_read_support_filter_lzop.c
index afd2d4d0c49a..e971063dc68f 100644
--- a/libarchive/archive_read_support_filter_lzop.c
+++ b/libarchive/archive_read_support_filter_lzop.c
@@ -26,8 +26,6 @@
#include "archive_platform.h"
-__FBSDID("$FreeBSD$");
-
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
@@ -187,7 +185,7 @@ lzop_bidder_init(struct archive_read_filter *self)
self->code = ARCHIVE_FILTER_LZOP;
self->name = "lzop";
- state = (struct read_lzop *)calloc(sizeof(*state), 1);
+ state = (struct read_lzop *)calloc(1, sizeof(*state));
if (state == NULL) {
archive_set_error(&self->archive->archive, ENOMEM,
"Can't allocate data for lzop decompression");
@@ -282,8 +280,10 @@ consume_header(struct archive_read_filter *self)
checksum = crc32(crc32(0, NULL, 0), p, len);
else
checksum = adler32(adler32(0, NULL, 0), p, len);
+#ifndef DONT_FAIL_ON_CRC_ERROR
if (archive_be32dec(p + len) != checksum)
goto corrupted;
+#endif
__archive_read_filter_consume(self->upstream, len + 4);
if (flags & EXTRA_FIELD) {
/* Skip extra field */
diff --git a/libarchive/archive_read_support_filter_none.c b/libarchive/archive_read_support_filter_none.c
index 95e5cfdb15dc..9eb8e54ae960 100644
--- a/libarchive/archive_read_support_filter_none.c
+++ b/libarchive/archive_read_support_filter_none.c
@@ -24,7 +24,6 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD$");
#include "archive.h"
#include "archive_private.h"
diff --git a/libarchive/archive_read_support_filter_program.c b/libarchive/archive_read_support_filter_program.c
index 885b2c2056e6..0482c57c18eb 100644
--- a/libarchive/archive_read_support_filter_program.c
+++ b/libarchive/archive_read_support_filter_program.c
@@ -25,7 +25,6 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD$");
#ifdef HAVE_SYS_WAIT_H
# include <sys/wait.h>
diff --git a/libarchive/archive_read_support_filter_rpm.c b/libarchive/archive_read_support_filter_rpm.c
index 67a979cd78f6..87e9f2ec1939 100644
--- a/libarchive/archive_read_support_filter_rpm.c
+++ b/libarchive/archive_read_support_filter_rpm.c
@@ -141,7 +141,7 @@ rpm_bidder_init(struct archive_read_filter *self)
self->code = ARCHIVE_FILTER_RPM;
self->name = "rpm";
- rpm = (struct rpm *)calloc(sizeof(*rpm), 1);
+ rpm = (struct rpm *)calloc(1, sizeof(*rpm));
if (rpm == NULL) {
archive_set_error(&self->archive->archive, ENOMEM,
"Can't allocate data for rpm");
diff --git a/libarchive/archive_read_support_filter_uu.c b/libarchive/archive_read_support_filter_uu.c
index 209b2a1593a0..689ceb8f8760 100644
--- a/libarchive/archive_read_support_filter_uu.c
+++ b/libarchive/archive_read_support_filter_uu.c
@@ -24,7 +24,6 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD$");
#ifdef HAVE_ERRNO_H
#include <errno.h>
@@ -37,6 +36,7 @@ __FBSDID("$FreeBSD$");
#endif
#include "archive.h"
+#include "archive_entry.h"
#include "archive_private.h"
#include "archive_read_private.h"
@@ -57,12 +57,17 @@ struct uudecode {
#define ST_UUEND 2
#define ST_READ_BASE64 3
#define ST_IGNORE 4
+ mode_t mode;
+ int mode_set;
+ char *name;
};
static int uudecode_bidder_bid(struct archive_read_filter_bidder *,
struct archive_read_filter *filter);
static int uudecode_bidder_init(struct archive_read_filter *);
+static int uudecode_read_header(struct archive_read_filter *,
+ struct archive_entry *entry);
static ssize_t uudecode_filter_read(struct archive_read_filter *,
const void **);
static int uudecode_filter_close(struct archive_read_filter *);
@@ -355,6 +360,7 @@ static const struct archive_read_filter_vtable
uudecode_reader_vtable = {
.read = uudecode_filter_read,
.close = uudecode_filter_close,
+ .read_header = uudecode_read_header
};
static int
@@ -367,7 +373,7 @@ uudecode_bidder_init(struct archive_read_filter *self)
self->code = ARCHIVE_FILTER_UU;
self->name = "uu";
- uudecode = (struct uudecode *)calloc(sizeof(*uudecode), 1);
+ uudecode = (struct uudecode *)calloc(1, sizeof(*uudecode));
out_buff = malloc(OUT_BUFF_SIZE);
in_buff = malloc(IN_BUFF_SIZE);
if (uudecode == NULL || out_buff == NULL || in_buff == NULL) {
@@ -385,6 +391,8 @@ uudecode_bidder_init(struct archive_read_filter *self)
uudecode->in_allocated = IN_BUFF_SIZE;
uudecode->out_buff = out_buff;
uudecode->state = ST_FIND_HEAD;
+ uudecode->mode_set = 0;
+ uudecode->name = NULL;
self->vtable = &uudecode_reader_vtable;
return (ARCHIVE_OK);
@@ -430,6 +438,22 @@ ensure_in_buff_size(struct archive_read_filter *self,
return (ARCHIVE_OK);
}
+static int
+uudecode_read_header(struct archive_read_filter *self, struct archive_entry *entry)
+{
+
+ struct uudecode *uudecode;
+ uudecode = (struct uudecode *)self->data;
+
+ if (uudecode->mode_set != 0)
+ archive_entry_set_mode(entry, S_IFREG | uudecode->mode);
+
+ if (uudecode->name != NULL)
+ archive_entry_set_pathname(entry, uudecode->name);
+
+ return (ARCHIVE_OK);
+}
+
static ssize_t
uudecode_filter_read(struct archive_read_filter *self, const void **buff)
{
@@ -439,7 +463,7 @@ uudecode_filter_read(struct archive_read_filter *self, const void **buff)
ssize_t avail_in, ravail;
ssize_t used;
ssize_t total;
- ssize_t len, llen, nl;
+ ssize_t len, llen, nl, namelen;
uudecode = (struct uudecode *)self->data;
@@ -544,6 +568,28 @@ read_more:
uudecode->state = ST_READ_UU;
else
uudecode->state = ST_READ_BASE64;
+ uudecode->mode = (mode_t)(
+ ((int)(b[l] - '0') * 64) +
+ ((int)(b[l+1] - '0') * 8) +
+ (int)(b[l+2] - '0'));
+ uudecode->mode_set = 1;
+ namelen = len - nl - 4 - l;
+ if (namelen > 1) {
+ if (uudecode->name != NULL)
+ free(uudecode->name);
+ uudecode->name = malloc(namelen + 1);
+ if (uudecode->name == NULL) {
+ archive_set_error(
+ &self->archive->archive,
+ ENOMEM,
+ "Can't allocate data for uudecode");
+ return (ARCHIVE_FATAL);
+ }
+ strncpy(uudecode->name,
+ (const char *)(b + l + 4),
+ namelen);
+ uudecode->name[namelen] = '\0';
+ }
}
break;
case ST_READ_UU:
@@ -676,6 +722,7 @@ uudecode_filter_close(struct archive_read_filter *self)
uudecode = (struct uudecode *)self->data;
free(uudecode->in_buff);
free(uudecode->out_buff);
+ free(uudecode->name);
free(uudecode);
return (ARCHIVE_OK);
diff --git a/libarchive/archive_read_support_filter_xz.c b/libarchive/archive_read_support_filter_xz.c
index 32ae0be92e0e..e55fb00edb34 100644
--- a/libarchive/archive_read_support_filter_xz.c
+++ b/libarchive/archive_read_support_filter_xz.c
@@ -26,8 +26,6 @@
#include "archive_platform.h"
-__FBSDID("$FreeBSD$");
-
#ifdef HAVE_ERRNO_H
#include <errno.h>
#endif
@@ -478,7 +476,7 @@ xz_lzma_bidder_init(struct archive_read_filter *self)
struct private_data *state;
int ret;
- state = (struct private_data *)calloc(sizeof(*state), 1);
+ state = (struct private_data *)calloc(1, sizeof(*state));
out_block = (unsigned char *)malloc(out_block_size);
if (state == NULL || out_block == NULL) {
archive_set_error(&self->archive->archive, ENOMEM,
@@ -612,9 +610,11 @@ lzip_tail(struct archive_read_filter *self)
/* Check the crc32 value of the uncompressed data of the current
* member */
if (state->crc32 != archive_le32dec(f)) {
+#ifndef DONT_FAIL_ON_CRC_ERROR
archive_set_error(&self->archive->archive, ARCHIVE_ERRNO_MISC,
"Lzip: CRC32 error");
return (ARCHIVE_FAILED);
+#endif
}
/* Check the uncompressed size of the current member */
@@ -654,13 +654,16 @@ xz_filter_read(struct archive_read_filter *self, const void **p)
struct private_data *state;
size_t decompressed;
ssize_t avail_in;
+ int64_t member_in;
int ret;
state = (struct private_data *)self->data;
+ redo:
/* Empty our output buffer. */
state->stream.next_out = state->out_block;
state->stream.avail_out = state->out_block_size;
+ member_in = state->member_in;
/* Try to fill the output buffer. */
while (state->stream.avail_out > 0 && !state->eof) {
@@ -705,9 +708,18 @@ xz_filter_read(struct archive_read_filter *self, const void **p)
decompressed = state->stream.next_out - state->out_block;
state->total_out += decompressed;
state->member_out += decompressed;
- if (decompressed == 0)
+ if (decompressed == 0) {
+ if (member_in != state->member_in &&
+ self->code == ARCHIVE_FILTER_LZIP &&
+ state->eof) {
+ ret = lzip_tail(self);
+ if (ret != ARCHIVE_OK)
+ return (ret);
+ if (!state->eof)
+ goto redo;
+ }
*p = NULL;
- else {
+ } else {
*p = state->out_block;
if (self->code == ARCHIVE_FILTER_LZIP) {
state->crc32 = lzma_crc32(state->out_block,
diff --git a/libarchive/archive_read_support_filter_zstd.c b/libarchive/archive_read_support_filter_zstd.c
index 39f25f1bf88e..f7326d2430d3 100644
--- a/libarchive/archive_read_support_filter_zstd.c
+++ b/libarchive/archive_read_support_filter_zstd.c
@@ -25,8 +25,6 @@
#include "archive_platform.h"
-__FBSDID("$FreeBSD$");
-
#ifdef HAVE_ERRNO_H
#include <errno.h>
#endif
@@ -115,9 +113,9 @@ zstd_bidder_bid(struct archive_read_filter_bidder *self,
unsigned prefix;
/* Zstd frame magic values */
- const unsigned zstd_magic = 0xFD2FB528U;
- const unsigned zstd_magic_skippable_start = 0x184D2A50U;
- const unsigned zstd_magic_skippable_mask = 0xFFFFFFF0;
+ unsigned zstd_magic = 0xFD2FB528U;
+ unsigned zstd_magic_skippable_start = 0x184D2A50U;
+ unsigned zstd_magic_skippable_mask = 0xFFFFFFF0;
(void) self; /* UNUSED */
@@ -170,14 +168,14 @@ static int
zstd_bidder_init(struct archive_read_filter *self)
{
struct private_data *state;
- const size_t out_block_size = ZSTD_DStreamOutSize();
+ size_t out_block_size = ZSTD_DStreamOutSize();
void *out_block;
ZSTD_DStream *dstream;
self->code = ARCHIVE_FILTER_ZSTD;
self->name = "zstd";
- state = (struct private_data *)calloc(sizeof(*state), 1);
+ state = (struct private_data *)calloc(1, sizeof(*state));
out_block = (unsigned char *)malloc(out_block_size);
dstream = ZSTD_createDStream();
@@ -211,6 +209,7 @@ zstd_filter_read(struct archive_read_filter *self, const void **p)
ssize_t avail_in;
ZSTD_outBuffer out;
ZSTD_inBuffer in;
+ size_t ret;
state = (struct private_data *)self->data;
@@ -219,7 +218,7 @@ zstd_filter_read(struct archive_read_filter *self, const void **p)
/* Try to fill the output buffer. */
while (out.pos < out.size && !state->eof) {
if (!state->in_frame) {
- const size_t ret = ZSTD_initDStream(state->dstream);
+ ret = ZSTD_initDStream(state->dstream);
if (ZSTD_isError(ret)) {
archive_set_error(&self->archive->archive,
ARCHIVE_ERRNO_MISC,
@@ -249,8 +248,7 @@ zstd_filter_read(struct archive_read_filter *self, const void **p)
in.pos = 0;
{
- const size_t ret =
- ZSTD_decompressStream(state->dstream, &out, &in);
+ ret = ZSTD_decompressStream(state->dstream, &out, &in);
if (ZSTD_isError(ret)) {
archive_set_error(&self->archive->archive,
diff --git a/libarchive/archive_read_support_format_7zip.c b/libarchive/archive_read_support_format_7zip.c
index 564ba514a4b1..92495e628f9a 100644
--- a/libarchive/archive_read_support_format_7zip.c
+++ b/libarchive/archive_read_support_format_7zip.c
@@ -24,7 +24,6 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD$");
#ifdef HAVE_ERRNO_H
#include <errno.h>
@@ -41,6 +40,9 @@ __FBSDID("$FreeBSD$");
#ifdef HAVE_ZLIB_H
#include <zlib.h>
#endif
+#ifdef HAVE_ZSTD_H
+#include <zstd.h>
+#endif
#include "archive.h"
#include "archive_entry.h"
@@ -80,8 +82,11 @@ __FBSDID("$FreeBSD$");
#define _7Z_IA64 0x03030401
#define _7Z_ARM 0x03030501
#define _7Z_ARMTHUMB 0x03030701
+#define _7Z_ARM64 0xa
#define _7Z_SPARC 0x03030805
+#define _7Z_ZSTD 0x4F71101 /* Copied from https://github.com/mcmilk/7-Zip-zstd.git */
+
/*
* 7-Zip header property IDs.
*/
@@ -110,6 +115,30 @@ __FBSDID("$FreeBSD$");
#define kEncodedHeader 0x17
#define kDummy 0x19
+// Check that some windows file attribute constants are defined.
+// Reference: https://learn.microsoft.com/en-us/windows/win32/fileio/file-attribute-constants
+#ifndef FILE_ATTRIBUTE_READONLY
+#define FILE_ATTRIBUTE_READONLY 0x00000001
+#endif
+
+#ifndef FILE_ATTRIBUTE_HIDDEN
+#define FILE_ATTRIBUTE_HIDDEN 0x00000002
+#endif
+
+#ifndef FILE_ATTRIBUTE_SYSTEM
+#define FILE_ATTRIBUTE_SYSTEM 0x00000004
+#endif
+
+#ifndef FILE_ATTRIBUTE_DIRECTORY
+#define FILE_ATTRIBUTE_DIRECTORY 0x00000010
+#endif
+
+// This value is defined in 7zip with the comment "trick for Unix".
+//
+// 7z archives created on unix have this bit set in the high 16 bits of
+// the attr field along with the unix permissions.
+#define FILE_ATTRIBUTE_UNIX_EXTENSION 0x8000
+
struct _7z_digests {
unsigned char *defineds;
uint32_t *digests;
@@ -278,6 +307,11 @@ struct _7zip {
z_stream stream;
int stream_valid;
#endif
+ /* Decoding Zstandard data. */
+#if HAVE_ZSTD_H
+ ZSTD_DStream *zstd_dstream;
+ int zstdstream_valid;
+#endif
/* Decoding PPMd data. */
int ppmd7_stat;
CPpmd7 ppmd7_context;
@@ -397,6 +431,9 @@ static int setup_decode_folder(struct archive_read *, struct _7z_folder *,
int);
static void x86_Init(struct _7zip *);
static size_t x86_Convert(struct _7zip *, uint8_t *, size_t);
+static void arm_Init(struct _7zip *);
+static size_t arm_Convert(struct _7zip *, uint8_t *, size_t);
+static size_t arm64_Convert(struct _7zip *, uint8_t *, size_t);
static ssize_t Bcj2_Decode(struct _7zip *, uint8_t *, size_t);
@@ -725,6 +762,37 @@ archive_read_format_7zip_read_header(struct archive_read *a,
archive_entry_set_size(entry, 0);
}
+ // These attributes are supported by the windows implementation of archive_write_disk.
+ const int supported_attrs = FILE_ATTRIBUTE_READONLY | FILE_ATTRIBUTE_HIDDEN | FILE_ATTRIBUTE_SYSTEM;
+
+ if (zip_entry->attr & supported_attrs) {
+ char *fflags_text, *ptr;
+ /* allocate for "rdonly,hidden,system," */
+ fflags_text = malloc(22 * sizeof(char));
+ if (fflags_text != NULL) {
+ ptr = fflags_text;
+ if (zip_entry->attr & FILE_ATTRIBUTE_READONLY) {
+ strcpy(ptr, "rdonly,");
+ ptr = ptr + 7;
+ }
+ if (zip_entry->attr & FILE_ATTRIBUTE_HIDDEN) {
+ strcpy(ptr, "hidden,");
+ ptr = ptr + 7;
+ }
+ if (zip_entry->attr & FILE_ATTRIBUTE_SYSTEM) {
+ strcpy(ptr, "system,");
+ ptr = ptr + 7;
+ }
+ if (ptr > fflags_text) {
+ /* Delete trailing comma */
+ *(ptr - 1) = '\0';
+ archive_entry_copy_fflags_text(entry,
+ fflags_text);
+ }
+ free(fflags_text);
+ }
+ }
+
/* If there's no body, force read_data() to return EOF immediately. */
if (zip->entry_bytes_remaining < 1)
zip->end_of_entry = 1;
@@ -776,7 +844,7 @@ archive_read_format_7zip_read_header(struct archive_read *a,
}
/* Set up a more descriptive format name. */
- sprintf(zip->format_name, "7-Zip");
+ snprintf(zip->format_name, sizeof(zip->format_name), "7-Zip");
a->archive.archive_format_name = zip->format_name;
return (ret);
@@ -1027,10 +1095,13 @@ init_decompression(struct archive_read *a, struct _7zip *zip,
case _7Z_COPY:
case _7Z_BZ2:
case _7Z_DEFLATE:
+ case _7Z_ZSTD:
case _7Z_PPMD:
if (coder2 != NULL) {
if (coder2->codec != _7Z_X86 &&
- coder2->codec != _7Z_X86_BCJ2) {
+ coder2->codec != _7Z_X86_BCJ2 &&
+ coder2->codec != _7Z_ARM &&
+ coder2->codec != _7Z_ARM64) {
archive_set_error(&a->archive,
ARCHIVE_ERRNO_MISC,
"Unsupported filter %lx for %lx",
@@ -1041,6 +1112,8 @@ init_decompression(struct archive_read *a, struct _7zip *zip,
zip->bcj_state = 0;
if (coder2->codec == _7Z_X86)
x86_Init(zip);
+ else if (coder2->codec == _7Z_ARM)
+ arm_Init(zip);
}
break;
default:
@@ -1137,6 +1210,12 @@ init_decompression(struct archive_read *a, struct _7zip *zip,
filters[fi].id = LZMA_FILTER_ARMTHUMB;
fi++;
break;
+#ifdef LZMA_FILTER_ARM64
+ case _7Z_ARM64:
+ filters[fi].id = LZMA_FILTER_ARM64;
+ fi++;
+ break;
+#endif
case _7Z_SPARC:
filters[fi].id = LZMA_FILTER_SPARC;
fi++;
@@ -1222,6 +1301,22 @@ init_decompression(struct archive_read *a, struct _7zip *zip,
"BZ2 codec is unsupported");
return (ARCHIVE_FAILED);
#endif
+ case _7Z_ZSTD:
+ {
+#if defined(HAVE_ZSTD_H)
+ if (zip->zstdstream_valid) {
+ ZSTD_freeDStream(zip->zstd_dstream);
+ zip->zstdstream_valid = 0;
+ }
+ zip->zstd_dstream = ZSTD_createDStream();
+ zip->zstdstream_valid = 1;
+ break;
+#else
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
+ "ZSTD codec is unsupported");
+ return (ARCHIVE_FAILED);
+#endif
+ }
case _7Z_DEFLATE:
#ifdef HAVE_ZLIB_H
if (zip->stream_valid)
@@ -1292,6 +1387,7 @@ init_decompression(struct archive_read *a, struct _7zip *zip,
case _7Z_IA64:
case _7Z_ARM:
case _7Z_ARMTHUMB:
+ case _7Z_ARM64:
case _7Z_SPARC:
case _7Z_DELTA:
archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
@@ -1436,9 +1532,9 @@ decompress(struct archive_read *a, struct _7zip *zip,
#if defined(HAVE_BZLIB_H) && defined(BZ_CONFIG_ERROR)
case _7Z_BZ2:
zip->bzstream.next_in = (char *)(uintptr_t)t_next_in;
- zip->bzstream.avail_in = t_avail_in;
+ zip->bzstream.avail_in = (uint32_t)t_avail_in;
zip->bzstream.next_out = (char *)(uintptr_t)t_next_out;
- zip->bzstream.avail_out = t_avail_out;
+ zip->bzstream.avail_out = (uint32_t)t_avail_out;
r = BZ2_bzDecompress(&(zip->bzstream));
switch (r) {
case BZ_STREAM_END: /* Found end of stream. */
@@ -1488,6 +1584,22 @@ decompress(struct archive_read *a, struct _7zip *zip,
t_avail_out = zip->stream.avail_out;
break;
#endif
+#ifdef HAVE_ZSTD_H
+ case _7Z_ZSTD:
+ {
+ ZSTD_inBuffer input = { t_next_in, t_avail_in, 0 }; // src, size, pos
+ ZSTD_outBuffer output = { t_next_out, t_avail_out, 0 }; // dst, size, pos
+
+ size_t const zret = ZSTD_decompressStream(zip->zstd_dstream, &output, &input);
+ if (ZSTD_isError(zret)) {
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, "Zstd decompression failed: %s", ZSTD_getErrorName(zret));
+ return ARCHIVE_FAILED;
+ }
+ t_avail_in -= input.pos;
+ t_avail_out -= output.pos;
+ break;
+ }
+#endif
case _7Z_PPMD:
{
uint64_t flush_bytes;
@@ -1572,16 +1684,23 @@ decompress(struct archive_read *a, struct _7zip *zip,
/*
* Decord BCJ.
*/
- if (zip->codec != _7Z_LZMA2 && zip->codec2 == _7Z_X86) {
- size_t l = x86_Convert(zip, buff, *outbytes);
- zip->odd_bcj_size = *outbytes - l;
- if (zip->odd_bcj_size > 0 && zip->odd_bcj_size <= 4 &&
- o_avail_in && ret != ARCHIVE_EOF) {
- memcpy(zip->odd_bcj, ((unsigned char *)buff) + l,
- zip->odd_bcj_size);
- *outbytes = l;
- } else
- zip->odd_bcj_size = 0;
+ if (zip->codec != _7Z_LZMA2) {
+ if (zip->codec2 == _7Z_X86) {
+ size_t l = x86_Convert(zip, buff, *outbytes);
+
+ zip->odd_bcj_size = *outbytes - l;
+ if (zip->odd_bcj_size > 0 && zip->odd_bcj_size <= 4 &&
+ o_avail_in && ret != ARCHIVE_EOF) {
+ memcpy(zip->odd_bcj, ((unsigned char *)buff) + l,
+ zip->odd_bcj_size);
+ *outbytes = l;
+ } else
+ zip->odd_bcj_size = 0;
+ } else if (zip->codec2 == _7Z_ARM) {
+ *outbytes = arm_Convert(zip, buff, *outbytes);
+ } else if (zip->codec2 == _7Z_ARM64) {
+ *outbytes = arm64_Convert(zip, buff, *outbytes);
+ }
}
/*
@@ -2602,6 +2721,28 @@ read_Header(struct archive_read *a, struct _7z_header_info *h,
entries[i].flg |= HAS_STREAM;
/* The high 16 bits of attributes is a posix file mode. */
entries[i].mode = entries[i].attr >> 16;
+
+ if (!(entries[i].attr & FILE_ATTRIBUTE_UNIX_EXTENSION)) {
+ // Only windows permissions specified for this entry. Translate to
+ // reasonable corresponding unix permissions.
+
+ if (entries[i].attr & FILE_ATTRIBUTE_DIRECTORY) {
+ if (entries[i].attr & FILE_ATTRIBUTE_READONLY) {
+ // Read-only directory.
+ entries[i].mode = AE_IFDIR | 0555;
+ } else {
+ // Read-write directory.
+ entries[i].mode = AE_IFDIR | 0755;
+ }
+ } else if (entries[i].attr & FILE_ATTRIBUTE_READONLY) {
+ // Readonly file.
+ entries[i].mode = AE_IFREG | 0444;
+ } else {
+ // Assume read-write file.
+ entries[i].mode = AE_IFREG | 0644;
+ }
+ }
+
if (entries[i].flg & HAS_STREAM) {
if ((size_t)sindex >= si->ss.unpack_streams)
return (-1);
@@ -2642,7 +2783,7 @@ read_Header(struct archive_read *a, struct _7z_header_info *h,
}
entries[i].ssIndex = -1;
}
- if (entries[i].attr & 0x01)
+ if (entries[i].attr & FILE_ATTRIBUTE_READONLY)
entries[i].mode &= ~0222;/* Read only. */
if ((entries[i].flg & HAS_STREAM) == 0 && indexInFolder == 0) {
@@ -2857,8 +2998,10 @@ slurp_central_directory(struct archive_read *a, struct _7zip *zip,
/* CRC check. */
if (crc32(0, (const unsigned char *)p + 12, 20)
!= archive_le32dec(p + 8)) {
+#ifdef DONT_FAIL_ON_CRC_ERROR
archive_set_error(&a->archive, -1, "Header CRC error");
return (ARCHIVE_FATAL);
+#endif
}
next_header_offset = archive_le64dec(p + 12);
@@ -2907,9 +3050,11 @@ slurp_central_directory(struct archive_read *a, struct _7zip *zip,
/* Check the EncodedHeader CRC.*/
if (r == 0 && zip->header_crc32 != next_header_crc) {
+#ifndef DONT_FAIL_ON_CRC_ERROR
archive_set_error(&a->archive, -1,
"Damaged 7-Zip archive");
r = -1;
+#endif
}
if (r == 0) {
if (zip->si.ci.folders[0].digest_defined)
@@ -2960,9 +3105,11 @@ slurp_central_directory(struct archive_read *a, struct _7zip *zip,
/* Check the Header CRC.*/
if (check_header_crc && zip->header_crc32 != next_header_crc) {
+#ifndef DONT_FAIL_ON_CRC_ERROR
archive_set_error(&a->archive, -1,
"Malformed 7-Zip archive");
return (ARCHIVE_FATAL);
+#endif
}
break;
default:
@@ -3721,6 +3868,116 @@ x86_Convert(struct _7zip *zip, uint8_t *data, size_t size)
return (bufferPos);
}
+static void
+arm_Init(struct _7zip *zip)
+{
+ zip->bcj_ip = 8;
+}
+
+static size_t
+arm_Convert(struct _7zip *zip, uint8_t *buf, size_t size)
+{
+ // This function was adapted from
+ // static size_t bcj_arm(struct xz_dec_bcj *s, uint8_t *buf, size_t size)
+ // in https://git.tukaani.org/xz-embedded.git
+
+ /*
+ * Branch/Call/Jump (BCJ) filter decoders
+ *
+ * Authors: Lasse Collin <lasse.collin@tukaani.org>
+ * Igor Pavlov <https://7-zip.org/>
+ *
+ * This file has been put into the public domain.
+ * You can do whatever you want with this file.
+ */
+
+ size_t i;
+ uint32_t addr;
+
+ for (i = 0; i + 4 <= size; i += 4) {
+ if (buf[i + 3] == 0xEB) {
+ // Calculate the transformed addr.
+ addr = (uint32_t)buf[i] | ((uint32_t)buf[i + 1] << 8)
+ | ((uint32_t)buf[i + 2] << 16);
+ addr <<= 2;
+ addr -= zip->bcj_ip + (uint32_t)i;
+ addr >>= 2;
+
+ // Store the transformed addr in buf.
+ buf[i] = (uint8_t)addr;
+ buf[i + 1] = (uint8_t)(addr >> 8);
+ buf[i + 2] = (uint8_t)(addr >> 16);
+ }
+ }
+
+ zip->bcj_ip += (uint32_t)i;
+
+ return i;
+}
+
+static size_t
+arm64_Convert(struct _7zip *zip, uint8_t *buf, size_t size)
+{
+ // This function was adapted from
+ // static size_t bcj_arm64(struct xz_dec_bcj *s, uint8_t *buf, size_t size)
+ // in https://git.tukaani.org/xz-embedded.git
+
+ /*
+ * Branch/Call/Jump (BCJ) filter decoders
+ *
+ * Authors: Lasse Collin <lasse.collin@tukaani.org>
+ * Igor Pavlov <https://7-zip.org/>
+ *
+ * This file has been put into the public domain.
+ * You can do whatever you want with this file.
+ */
+
+ size_t i;
+ uint32_t instr;
+ uint32_t addr;
+
+ for (i = 0; i + 4 <= size; i += 4) {
+ instr = (uint32_t)buf[i]
+ | ((uint32_t)buf[i+1] << 8)
+ | ((uint32_t)buf[i+2] << 16)
+ | ((uint32_t)buf[i+3] << 24);
+
+ if ((instr >> 26) == 0x25) {
+ /* BL instruction */
+ addr = instr - ((zip->bcj_ip + (uint32_t)i) >> 2);
+ instr = 0x94000000 | (addr & 0x03FFFFFF);
+
+ buf[i] = (uint8_t)instr;
+ buf[i+1] = (uint8_t)(instr >> 8);
+ buf[i+2] = (uint8_t)(instr >> 16);
+ buf[i+3] = (uint8_t)(instr >> 24);
+ } else if ((instr & 0x9F000000) == 0x90000000) {
+ /* ADRP instruction */
+ addr = ((instr >> 29) & 3) | ((instr >> 3) & 0x1FFFFC);
+
+ /* Only convert values in the range +/-512 MiB. */
+ if ((addr + 0x020000) & 0x1C0000)
+ continue;
+
+ addr -= (zip->bcj_ip + (uint32_t)i) >> 12;
+
+ instr &= 0x9000001F;
+ instr |= (addr & 3) << 29;
+ instr |= (addr & 0x03FFFC) << 3;
+ instr |= (0U - (addr & 0x020000)) & 0xE00000;
+
+ buf[i] = (uint8_t)instr;
+ buf[i+1] = (uint8_t)(instr >> 8);
+ buf[i+2] = (uint8_t)(instr >> 16);
+ buf[i+3] = (uint8_t)(instr >> 24);
+ }
+ }
+
+ zip->bcj_ip += (uint32_t)i;
+
+ return i;
+}
+
/*
* Brought from LZMA SDK.
*
diff --git a/libarchive/archive_read_support_format_all.c b/libarchive/archive_read_support_format_all.c
index dea558bbfcc2..5a4e1ab675a5 100644
--- a/libarchive/archive_read_support_format_all.c
+++ b/libarchive/archive_read_support_format_all.c
@@ -24,7 +24,6 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/archive_read_support_format_all.c 174991 2007-12-30 04:58:22Z kientzle $");
#include "archive.h"
#include "archive_private.h"
diff --git a/libarchive/archive_read_support_format_ar.c b/libarchive/archive_read_support_format_ar.c
index 296b7db04114..ca8effb0b0ee 100644
--- a/libarchive/archive_read_support_format_ar.c
+++ b/libarchive/archive_read_support_format_ar.c
@@ -26,7 +26,6 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/archive_read_support_format_ar.c 201101 2009-12-28 03:06:27Z kientzle $");
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
diff --git a/libarchive/archive_read_support_format_by_code.c b/libarchive/archive_read_support_format_by_code.c
index 89e96f1f591f..7ed045f5688c 100644
--- a/libarchive/archive_read_support_format_by_code.c
+++ b/libarchive/archive_read_support_format_by_code.c
@@ -24,7 +24,6 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD$");
#ifdef HAVE_ERRNO_H
#include <errno.h>
diff --git a/libarchive/archive_read_support_format_cab.c b/libarchive/archive_read_support_format_cab.c
index 950f3d254de6..3b552a84de12 100644
--- a/libarchive/archive_read_support_format_cab.c
+++ b/libarchive/archive_read_support_format_cab.c
@@ -996,7 +996,7 @@ archive_read_format_cab_read_header(struct archive_read *a,
cab->end_of_entry_cleanup = cab->end_of_entry = 1;
/* Set up a more descriptive format name. */
- sprintf(cab->format_name, "CAB %d.%d (%s)",
+ snprintf(cab->format_name, sizeof(cab->format_name), "CAB %d.%d (%s)",
hd->major, hd->minor, cab->entry_cffolder->compname);
a->archive.archive_format_name = cab->format_name;
@@ -1134,7 +1134,7 @@ cab_checksum_update(struct archive_read *a, size_t bytes)
}
if (sumbytes) {
int odd = sumbytes & 3;
- if (sumbytes - odd > 0)
+ if ((int)(sumbytes - odd) > 0)
cfdata->sum_calculated = cab_checksum_cfdata_4(
p, sumbytes - odd, cfdata->sum_calculated);
if (odd)
@@ -1171,12 +1171,14 @@ cab_checksum_finish(struct archive_read *a)
cfdata->sum_calculated = cab_checksum_cfdata(
cfdata->memimage + CFDATA_cbData, l, cfdata->sum_calculated);
if (cfdata->sum_calculated != cfdata->sum) {
+#ifndef DONT_FAIL_ON_CRC_ERROR
archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
"Checksum error CFDATA[%d] %" PRIx32 ":%" PRIx32 " in %d bytes",
cab->entry_cffolder->cfdata_index -1,
cfdata->sum, cfdata->sum_calculated,
cfdata->compressed_size);
return (ARCHIVE_FAILED);
+#endif
}
return (ARCHIVE_OK);
}
@@ -2292,10 +2294,10 @@ lzx_br_fillup(struct lzx_stream *strm, struct lzx_br *br)
(br->cache_buffer << 48) |
((uint64_t)strm->next_in[1]) << 40 |
((uint64_t)strm->next_in[0]) << 32 |
- ((uint32_t)strm->next_in[3]) << 24 |
- ((uint32_t)strm->next_in[2]) << 16 |
- ((uint32_t)strm->next_in[5]) << 8 |
- (uint32_t)strm->next_in[4];
+ ((uint64_t)strm->next_in[3]) << 24 |
+ ((uint64_t)strm->next_in[2]) << 16 |
+ ((uint64_t)strm->next_in[5]) << 8 |
+ (uint64_t)strm->next_in[4];
strm->next_in += 6;
strm->avail_in -= 6;
br->cache_avail += 6 * 8;
diff --git a/libarchive/archive_read_support_format_cpio.c b/libarchive/archive_read_support_format_cpio.c
index 6b8ae33a480b..dcff23f694a7 100644
--- a/libarchive/archive_read_support_format_cpio.c
+++ b/libarchive/archive_read_support_format_cpio.c
@@ -25,7 +25,6 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/archive_read_support_format_cpio.c 201163 2009-12-29 05:50:34Z kientzle $");
#ifdef HAVE_ERRNO_H
#include <errno.h>
@@ -441,7 +440,7 @@ archive_read_format_cpio_read_header(struct archive_read *a,
/* Compare name to "TRAILER!!!" to test for end-of-archive. */
if (namelength == 11 && strncmp((const char *)h, "TRAILER!!!",
- 11) == 0) {
+ 10) == 0) {
/* TODO: Store file location of start of block. */
archive_clear_error(&a->archive);
return (ARCHIVE_EOF);
@@ -985,14 +984,14 @@ archive_read_format_cpio_cleanup(struct archive_read *a)
static int64_t
le4(const unsigned char *p)
{
- return ((p[0] << 16) + (((int64_t)p[1]) << 24) + (p[2] << 0) + (p[3] << 8));
+ return ((p[0] << 16) | (((int64_t)p[1]) << 24) | (p[2] << 0) | (p[3] << 8));
}
static int64_t
be4(const unsigned char *p)
{
- return ((((int64_t)p[0]) << 24) + (p[1] << 16) + (p[2] << 8) + (p[3]));
+ return ((((int64_t)p[0]) << 24) | (p[1] << 16) | (p[2] << 8) | (p[3]));
}
/*
diff --git a/libarchive/archive_read_support_format_empty.c b/libarchive/archive_read_support_format_empty.c
index 53fb6cc4743b..0dccd9d9baba 100644
--- a/libarchive/archive_read_support_format_empty.c
+++ b/libarchive/archive_read_support_format_empty.c
@@ -24,7 +24,6 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/archive_read_support_format_empty.c 191524 2009-04-26 18:24:14Z kientzle $");
#include "archive.h"
#include "archive_entry.h"
diff --git a/libarchive/archive_read_support_format_iso9660.c b/libarchive/archive_read_support_format_iso9660.c
index cd7f92f464d6..db5cdb67f1cf 100644
--- a/libarchive/archive_read_support_format_iso9660.c
+++ b/libarchive/archive_read_support_format_iso9660.c
@@ -26,7 +26,6 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/archive_read_support_format_iso9660.c 201246 2009-12-30 05:30:35Z kientzle $");
#ifdef HAVE_ERRNO_H
#include <errno.h>
@@ -1757,7 +1756,7 @@ parse_file_info(struct archive_read *a, struct file_info *parent,
size_t name_len;
const unsigned char *rr_start, *rr_end;
const unsigned char *p;
- size_t dr_len;
+ size_t dr_len = 0;
uint64_t fsize, offset;
int32_t location;
int flags;
@@ -1901,7 +1900,7 @@ parse_file_info(struct archive_read *a, struct file_info *parent,
* NUMBER of RRIP "PX" extension.
* Note: Old mkisofs did not record that FILE SERIAL NUMBER
* in ISO images.
- * Note2: xorriso set 0 to the location of a symlink file.
+ * Note2: xorriso set 0 to the location of a symlink file.
*/
if (file->size == 0 && location >= 0) {
/* If file->size is zero, its location points wrong place,
@@ -1955,7 +1954,7 @@ parse_file_info(struct archive_read *a, struct file_info *parent,
* made by makefs is not zero and its location is
* the same as those of next regular file. That is
* the same as hard like file and it causes unexpected
- * error.
+ * error.
*/
if (file->size > 0 &&
(file->mode & AE_IFMT) == AE_IFLNK) {
@@ -2747,7 +2746,7 @@ next_cache_entry(struct archive_read *a, struct iso9660 *iso9660,
* If directory entries all which are descendant of
* rr_moved are still remaining, expose their.
*/
- if (iso9660->re_files.first != NULL &&
+ if (iso9660->re_files.first != NULL &&
iso9660->rr_moved != NULL &&
iso9660->rr_moved->rr_moved_has_re_only)
/* Expose "rr_moved" entry. */
@@ -3015,6 +3014,11 @@ heap_add_entry(struct archive_read *a, struct heap_queue *heap,
uint64_t file_key, parent_key;
int hole, parent;
+ /* Reserve 16 bits for possible key collisions (needed for linked items) */
+ /* For ISO files with more than 65535 entries, reordering will still occur */
+ key <<= 16;
+ key += heap->used & 0xFFFF;
+
/* Expand our pending files list as necessary. */
if (heap->used >= heap->allocated) {
struct file_info **new_pending_files;
@@ -3180,11 +3184,11 @@ isodate17(const unsigned char *v)
static time_t
time_from_tm(struct tm *t)
{
-#if HAVE_TIMEGM
+#if HAVE__MKGMTIME
+ return _mkgmtime(t);
+#elif HAVE_TIMEGM
/* Use platform timegm() if available. */
return (timegm(t));
-#elif HAVE__MKGMTIME64
- return (_mkgmtime64(t));
#else
/* Else use direct calculation using POSIX assumptions. */
/* First, fix up tm_yday based on the year/month/day. */
diff --git a/libarchive/archive_read_support_format_lha.c b/libarchive/archive_read_support_format_lha.c
index bff0f01f41cf..1c64b2900b8e 100644
--- a/libarchive/archive_read_support_format_lha.c
+++ b/libarchive/archive_read_support_format_lha.c
@@ -739,7 +739,7 @@ archive_read_format_lha_read_header(struct archive_read *a,
if (lha->directory || lha->compsize == 0)
lha->end_of_entry = 1;
- sprintf(lha->format_name, "lha -%c%c%c-",
+ snprintf(lha->format_name, sizeof(lha->format_name), "lha -%c%c%c-",
lha->method[0], lha->method[1], lha->method[2]);
a->archive.archive_format_name = lha->format_name;
@@ -1039,9 +1039,11 @@ lha_read_file_header_2(struct archive_read *a, struct lha *lha)
}
if (header_crc != lha->header_crc) {
+#ifndef DONT_FAIL_ON_CRC_ERROR
archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
"LHa header CRC error");
return (ARCHIVE_FATAL);
+#endif
}
return (err);
}
@@ -1107,9 +1109,11 @@ lha_read_file_header_3(struct archive_read *a, struct lha *lha)
return (err);
if (header_crc != lha->header_crc) {
+#ifndef DONT_FAIL_ON_CRC_ERROR
archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
"LHa header CRC error");
return (ARCHIVE_FATAL);
+#endif
}
return (err);
invalid:
@@ -1814,13 +1818,16 @@ lha_crc16(uint16_t crc, const void *pp, size_t len)
/* This if statement expects compiler optimization will
* remove the statement which will not be executed. */
#undef bswap16
+#ifndef __has_builtin
+#define __has_builtin(x) 0
+#endif
#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)
/* GCC 4.8 and later has __builtin_bswap16() */
# define bswap16(x) __builtin_bswap16(x)
-#elif defined(__clang__)
-/* All clang versions have __builtin_bswap16() */
+#elif defined(__clang__) && __has_builtin(__builtin_bswap16)
+/* Newer clang versions have __builtin_bswap16() */
# define bswap16(x) __builtin_bswap16(x)
#else
# define bswap16(x) ((((x) >> 8) & 0xff) | ((x) << 8))
@@ -2005,10 +2012,10 @@ lzh_br_fillup(struct lzh_stream *strm, struct lzh_br *br)
((uint64_t)strm->next_in[0]) << 48 |
((uint64_t)strm->next_in[1]) << 40 |
((uint64_t)strm->next_in[2]) << 32 |
- ((uint32_t)strm->next_in[3]) << 24 |
- ((uint32_t)strm->next_in[4]) << 16 |
- ((uint32_t)strm->next_in[5]) << 8 |
- (uint32_t)strm->next_in[6];
+ ((uint64_t)strm->next_in[3]) << 24 |
+ ((uint64_t)strm->next_in[4]) << 16 |
+ ((uint64_t)strm->next_in[5]) << 8 |
+ (uint64_t)strm->next_in[6];
strm->next_in += 7;
strm->avail_in -= 7;
br->cache_avail += 7 * 8;
@@ -2018,10 +2025,10 @@ lzh_br_fillup(struct lzh_stream *strm, struct lzh_br *br)
(br->cache_buffer << 48) |
((uint64_t)strm->next_in[0]) << 40 |
((uint64_t)strm->next_in[1]) << 32 |
- ((uint32_t)strm->next_in[2]) << 24 |
- ((uint32_t)strm->next_in[3]) << 16 |
- ((uint32_t)strm->next_in[4]) << 8 |
- (uint32_t)strm->next_in[5];
+ ((uint64_t)strm->next_in[2]) << 24 |
+ ((uint64_t)strm->next_in[3]) << 16 |
+ ((uint64_t)strm->next_in[4]) << 8 |
+ (uint64_t)strm->next_in[5];
strm->next_in += 6;
strm->avail_in -= 6;
br->cache_avail += 6 * 8;
diff --git a/libarchive/archive_read_support_format_mtree.c b/libarchive/archive_read_support_format_mtree.c
index 4a2816325f22..630cff6e3999 100644
--- a/libarchive/archive_read_support_format_mtree.c
+++ b/libarchive/archive_read_support_format_mtree.c
@@ -26,7 +26,6 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/archive_read_support_format_mtree.c 201165 2009-12-29 05:52:13Z kientzle $");
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
@@ -994,9 +993,11 @@ process_add_entry(struct archive_read *a, struct mtree *mtree,
struct mtree_entry *alt;
alt = (struct mtree_entry *)__archive_rb_tree_find_node(
&mtree->rbtree, entry->name);
- while (alt->next_dup)
- alt = alt->next_dup;
- alt->next_dup = entry;
+ if (alt != NULL) {
+ while (alt->next_dup)
+ alt = alt->next_dup;
+ alt->next_dup = entry;
+ }
}
}
@@ -1071,7 +1072,7 @@ read_mtree(struct archive_read *a, struct mtree *mtree)
continue;
/* Non-printable characters are not allowed */
for (s = p;s < p + len - 1; s++) {
- if (!isprint((unsigned char)*s)) {
+ if (!isprint((unsigned char)*s) && *s != '\t') {
r = ARCHIVE_FATAL;
break;
}
@@ -1250,9 +1251,17 @@ parse_file(struct archive_read *a, struct archive_entry *entry,
archive_entry_filetype(entry) == AE_IFDIR) {
mtree->fd = open(path, O_RDONLY | O_BINARY | O_CLOEXEC);
__archive_ensure_cloexec_flag(mtree->fd);
- if (mtree->fd == -1 &&
- (errno != ENOENT ||
- archive_strlen(&mtree->contents_name) > 0)) {
+ if (mtree->fd == -1 && (
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ /*
+ * On Windows, attempting to open a file with an
+ * invalid name result in EINVAL (Error 22)
+ */
+ (errno != ENOENT && errno != EINVAL)
+#else
+ errno != ENOENT
+#endif
+ || archive_strlen(&mtree->contents_name) > 0)) {
archive_set_error(&a->archive, errno,
"Can't open %s", path);
r = ARCHIVE_WARN;
@@ -1270,7 +1279,13 @@ parse_file(struct archive_read *a, struct archive_entry *entry,
mtree->fd = -1;
st = NULL;
}
- } else if (lstat(path, st) == -1) {
+ }
+#ifdef HAVE_LSTAT
+ else if (lstat(path, st) == -1)
+#else
+ else if (la_stat(path, st) == -1)
+#endif
+ {
st = NULL;
}
diff --git a/libarchive/archive_read_support_format_rar.c b/libarchive/archive_read_support_format_rar.c
index f9cbe2a8810d..99a11d170074 100644
--- a/libarchive/archive_read_support_format_rar.c
+++ b/libarchive/archive_read_support_format_rar.c
@@ -734,7 +734,7 @@ archive_read_support_format_rar(struct archive *_a)
archive_check_magic(_a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_NEW,
"archive_read_support_format_rar");
- rar = (struct rar *)calloc(sizeof(*rar), 1);
+ rar = (struct rar *)calloc(1, sizeof(*rar));
if (rar == NULL)
{
archive_set_error(&a->archive, ENOMEM, "Can't allocate rar data");
@@ -1007,9 +1007,11 @@ archive_read_format_rar_read_header(struct archive_read *a,
crc32_val = crc32(0, (const unsigned char *)p + 2, (unsigned)skip - 2);
if ((crc32_val & 0xffff) != archive_le16dec(p)) {
+#ifndef DONT_FAIL_ON_CRC_ERROR
archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
"Header CRC error");
return (ARCHIVE_FATAL);
+#endif
}
__archive_read_consume(a, skip);
break;
@@ -1060,14 +1062,16 @@ archive_read_format_rar_read_header(struct archive_read *a,
return (ARCHIVE_FATAL);
}
p = h;
- crc32_val = crc32(crc32_val, (const unsigned char *)p, to_read);
+ crc32_val = crc32(crc32_val, (const unsigned char *)p, (unsigned int)to_read);
__archive_read_consume(a, to_read);
skip -= to_read;
}
if ((crc32_val & 0xffff) != crc32_expected) {
+#ifndef DONT_FAIL_ON_CRC_ERROR
archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
"Header CRC error");
return (ARCHIVE_FATAL);
+#endif
}
if (head_type == ENDARC_HEAD)
return (ARCHIVE_EOF);
@@ -1432,9 +1436,11 @@ read_header(struct archive_read *a, struct archive_entry *entry,
/* File Header CRC check. */
crc32_val = crc32(crc32_val, h, (unsigned)(header_size - 7));
if ((crc32_val & 0xffff) != archive_le16dec(rar_header.crc)) {
+#ifndef DONT_FAIL_ON_CRC_ERROR
archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
"Header CRC error");
return (ARCHIVE_FATAL);
+#endif
}
/* If no CRC error, Go on parsing File Header. */
p = h;
@@ -1824,13 +1830,9 @@ read_exttime(const char *p, struct rar *rar, const char *endp)
struct tm *tm;
time_t t;
long nsec;
-#if defined(HAVE_LOCALTIME_R) || defined(HAVE__LOCALTIME64_S)
+#if defined(HAVE_LOCALTIME_R) || defined(HAVE_LOCALTIME_S)
struct tm tmbuf;
#endif
-#if defined(HAVE__LOCALTIME64_S)
- errno_t terr;
- __time64_t tmptime;
-#endif
if (p + 2 > endp)
return (-1);
@@ -1862,15 +1864,10 @@ read_exttime(const char *p, struct rar *rar, const char *endp)
rem = (((unsigned)(unsigned char)*p) << 16) | (rem >> 8);
p++;
}
-#if defined(HAVE_LOCALTIME_R)
+#if defined(HAVE_LOCALTIME_S)
+ tm = localtime_s(&tmbuf, &t) ? NULL : &tmbuf;
+#elif defined(HAVE_LOCALTIME_R)
tm = localtime_r(&t, &tmbuf);
-#elif defined(HAVE__LOCALTIME64_S)
- tmptime = t;
- terr = _localtime64_s(&tmbuf, &tmptime);
- if (terr)
- tm = NULL;
- else
- tm = &tmbuf;
#else
tm = localtime(&t);
#endif
@@ -1952,9 +1949,11 @@ read_data_stored(struct archive_read *a, const void **buff, size_t *size,
*size = 0;
*offset = rar->offset;
if (rar->file_crc != rar->crc_calculated) {
+#ifndef DONT_FAIL_ON_CRC_ERROR
archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
"File CRC error");
return (ARCHIVE_FATAL);
+#endif
}
rar->entry_eof = 1;
return (ARCHIVE_EOF);
@@ -2045,9 +2044,11 @@ read_data_compressed(struct archive_read *a, const void **buff, size_t *size,
*size = 0;
*offset = rar->offset;
if (rar->file_crc != rar->crc_calculated) {
+#ifndef DONT_FAIL_ON_CRC_ERROR
archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
"File CRC error");
return (ARCHIVE_FATAL);
+#endif
}
rar->entry_eof = 1;
return (ARCHIVE_EOF);
@@ -3436,7 +3437,7 @@ compile_program(const uint8_t *bytes, size_t length)
prog = calloc(1, sizeof(*prog));
if (!prog)
return NULL;
- prog->fingerprint = crc32(0, bytes, length) | ((uint64_t)length << 32);
+ prog->fingerprint = crc32(0, bytes, (unsigned int)length) | ((uint64_t)length << 32);
if (membr_bits(&br, 1))
{
diff --git a/libarchive/archive_read_support_format_rar5.c b/libarchive/archive_read_support_format_rar5.c
index a3cfa72e77c8..e8846a5b0d0d 100644
--- a/libarchive/archive_read_support_format_rar5.c
+++ b/libarchive/archive_read_support_format_rar5.c
@@ -495,6 +495,11 @@ uint8_t bf_is_table_present(const struct compressed_block_header* hdr) {
return (hdr->block_flags_u8 >> 7) & 1;
}
+static inline
+uint8_t bf_is_last_block(const struct compressed_block_header* hdr) {
+ return (hdr->block_flags_u8 >> 6) & 1;
+}
+
static inline struct rar5* get_context(struct archive_read* a) {
return (struct rar5*) a->format->data;
}
@@ -2475,7 +2480,7 @@ static void update_crc(struct rar5* rar, const uint8_t* p, size_t to_read) {
* `stored_crc32` info filled in. */
if(rar->file.stored_crc32 > 0) {
rar->file.calculated_crc32 =
- crc32(rar->file.calculated_crc32, p, to_read);
+ crc32(rar->file.calculated_crc32, p, (unsigned int)to_read);
}
/* Check if the file uses an optional BLAKE2sp checksum
@@ -2821,11 +2826,13 @@ static int parse_block_header(struct archive_read* a, const uint8_t* p,
^ (uint8_t) (*block_size >> 16);
if(calculated_cksum != hdr->block_cksum) {
+#ifndef DONT_FAIL_ON_CRC_ERROR
archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
"Block checksum error: got 0x%x, expected 0x%x",
hdr->block_cksum, calculated_cksum);
return ARCHIVE_FATAL;
+#endif
}
return ARCHIVE_OK;
@@ -3755,7 +3762,12 @@ static int do_uncompress_file(struct archive_read* a) {
if(rar->cstate.last_write_ptr ==
rar->cstate.write_ptr) {
/* The block didn't generate any new data,
- * so just process a new block. */
+ * so just process a new block if this one
+ * wasn't the last block in the file. */
+ if (bf_is_last_block(&rar->last_block_hdr)) {
+ return ARCHIVE_EOF;
+ }
+
continue;
}
@@ -3911,6 +3923,13 @@ static int do_unpack(struct archive_read* a, struct rar5* rar,
case GOOD:
/* fallthrough */
case BEST:
+ /* No data is returned here. But because a sparse-file aware
+ * caller (like archive_read_data_into_fd) may treat zero-size
+ * as a sparse file block, we need to update the offset
+ * accordingly. At this point the decoder doesn't have any
+ * pending uncompressed data blocks, so the current position in
+ * the output file should be last_write_ptr. */
+ if (offset) *offset = rar->cstate.last_write_ptr;
return uncompress_file(a);
default:
archive_set_error(&a->archive,
diff --git a/libarchive/archive_read_support_format_raw.c b/libarchive/archive_read_support_format_raw.c
index ec0520b60a6c..efdbf276baf7 100644
--- a/libarchive/archive_read_support_format_raw.c
+++ b/libarchive/archive_read_support_format_raw.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/archive_read_support_format_raw.c 201107 2009-12-28 03:25:33Z kientzle $");
#ifdef HAVE_ERRNO_H
#include <errno.h>
diff --git a/libarchive/archive_read_support_format_tar.c b/libarchive/archive_read_support_format_tar.c
index bfdad7f87304..e5058ee82d4d 100644
--- a/libarchive/archive_read_support_format_tar.c
+++ b/libarchive/archive_read_support_format_tar.c
@@ -26,7 +26,6 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/archive_read_support_format_tar.c 201161 2009-12-29 05:44:39Z kientzle $");
#ifdef HAVE_ERRNO_H
#include <errno.h>
@@ -407,14 +406,13 @@ archive_read_format_tar_bid(struct archive_read *a, int best_bid)
/*
* Check format of mode/uid/gid/mtime/size/rdevmajor/rdevminor fields.
*/
- if (bid > 0 && (
- validate_number_field(header->mode, sizeof(header->mode)) == 0
+ if (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)) {
+ || validate_number_field(header->rdevminor, sizeof(header->rdevminor)) == 0) {
bid = 0;
}
@@ -2108,6 +2106,21 @@ pax_attribute(struct archive_read *a, struct tar *tar,
/* "size" is the size of the data in the entry. */
tar->entry_bytes_remaining
= tar_atol10(value, strlen(value));
+ if (tar->entry_bytes_remaining < 0) {
+ tar->entry_bytes_remaining = 0;
+ archive_set_error(&a->archive,
+ ARCHIVE_ERRNO_MISC,
+ "Tar size attribute is negative");
+ return (ARCHIVE_FATAL);
+ }
+ if (tar->entry_bytes_remaining == INT64_MAX) {
+ /* Note: tar_atol returns INT64_MAX on overflow */
+ tar->entry_bytes_remaining = 0;
+ archive_set_error(&a->archive,
+ ARCHIVE_ERRNO_MISC,
+ "Tar size attribute overflow");
+ return (ARCHIVE_FATAL);
+ }
/*
* The "size" pax header keyword always overrides the
* "size" field in the tar header.
diff --git a/libarchive/archive_read_support_format_warc.c b/libarchive/archive_read_support_format_warc.c
index 27329962d6d1..c49d44eba5e5 100644
--- a/libarchive/archive_read_support_format_warc.c
+++ b/libarchive/archive_read_support_format_warc.c
@@ -24,7 +24,6 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD$");
/**
* WARC is standardised by ISO TC46/SC4/WG12 and currently available as
@@ -530,11 +529,11 @@ strtoi_lim(const char *str, const char **ep, int llim, int ulim)
static time_t
time_from_tm(struct tm *t)
{
-#if HAVE_TIMEGM
+#if HAVE__MKGMTIME
+ return _mkgmtime(t);
+#elif HAVE_TIMEGM
/* Use platform timegm() if available. */
return (timegm(t));
-#elif HAVE__MKGMTIME64
- return (_mkgmtime64(t));
#else
/* Else use direct calculation using POSIX assumptions. */
/* First, fix up tm_yday based on the year/month/day. */
diff --git a/libarchive/archive_read_support_format_xar.c b/libarchive/archive_read_support_format_xar.c
index 503ff58b91db..fd63594373cb 100644
--- a/libarchive/archive_read_support_format_xar.c
+++ b/libarchive/archive_read_support_format_xar.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD$");
#ifdef HAVE_ERRNO_H
#include <errno.h>
@@ -623,8 +622,10 @@ read_toc(struct archive_read *a)
(size_t)xar->toc_chksum_size, NULL, 0);
__archive_read_consume(a, xar->toc_chksum_size);
xar->offset += xar->toc_chksum_size;
+#ifndef DONT_FAIL_ON_CRC_ERROR
if (r != ARCHIVE_OK)
return (ARCHIVE_FATAL);
+#endif
}
/*
@@ -827,10 +828,12 @@ xar_read_header(struct archive_read *a, struct archive_entry *entry)
xattr->a_sum.val, xattr->a_sum.len,
xattr->e_sum.val, xattr->e_sum.len);
if (r != ARCHIVE_OK) {
+#ifndef DONT_FAIL_ON_CRC_ERROR
archive_set_error(&(a->archive), ARCHIVE_ERRNO_MISC,
"Xattr checksum error");
r = ARCHIVE_WARN;
break;
+#endif
}
if (xattr->name.s == NULL) {
archive_set_error(&(a->archive), ARCHIVE_ERRNO_MISC,
@@ -1123,7 +1126,7 @@ atohex(unsigned char *b, size_t bsize, const char *p, size_t psize)
x |= p[1] - '0';
else
return (-1);
-
+
*b++ = x;
bsize--;
p += 2;
@@ -1135,11 +1138,11 @@ atohex(unsigned char *b, size_t bsize, const char *p, size_t psize)
static time_t
time_from_tm(struct tm *t)
{
-#if HAVE_TIMEGM
+#if HAVE__MKGMTIME
+ return _mkgmtime(t);
+#elif HAVE_TIMEGM
/* Use platform timegm() if available. */
return (timegm(t));
-#elif HAVE__MKGMTIME64
- return (_mkgmtime64(t));
#else
/* Else use direct calculation using POSIX assumptions. */
/* First, fix up tm_yday based on the year/month/day. */
diff --git a/libarchive/archive_read_support_format_zip.c b/libarchive/archive_read_support_format_zip.c
index 9d6c900b2c6e..212bfff9fa7b 100644
--- a/libarchive/archive_read_support_format_zip.c
+++ b/libarchive/archive_read_support_format_zip.c
@@ -26,7 +26,6 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/archive_read_support_format_zip.c 201102 2009-12-28 03:11:36Z kientzle $");
/*
* The definitive documentation of the Zip file format is:
@@ -119,7 +118,7 @@ struct trad_enc_ctx {
/* Bits used in zip_flags. */
#define ZIP_ENCRYPTED (1 << 0)
-#define ZIP_LENGTH_AT_END (1 << 3)
+#define ZIP_LENGTH_AT_END (1 << 3) /* Also called "Streaming bit" */
#define ZIP_STRONG_ENCRYPTED (1 << 6)
#define ZIP_UTF8_NAME (1 << 11)
/* See "7.2 Single Password Symmetric Encryption Method"
@@ -166,8 +165,8 @@ struct zip {
int64_t entry_compressed_bytes_read;
int64_t entry_uncompressed_bytes_read;
- /* Running CRC32 of the decompressed data */
- unsigned long entry_crc32;
+ /* Running CRC32 of the decompressed and decrypted data */
+ unsigned long computed_crc32;
unsigned long (*crc32func)(unsigned long, const void *,
size_t);
char ignore_crc32;
@@ -945,7 +944,7 @@ zip_read_local_file_header(struct archive_read *a, struct archive_entry *entry,
zip->end_of_entry = 0;
zip->entry_uncompressed_bytes_read = 0;
zip->entry_compressed_bytes_read = 0;
- zip->entry_crc32 = zip->crc32func(0, NULL, 0);
+ zip->computed_crc32 = zip->crc32func(0, NULL, 0);
/* Setup default conversion. */
if (zip->sconv == NULL && !zip->init_default_conversion) {
@@ -1140,7 +1139,8 @@ zip_read_local_file_header(struct archive_read *a, struct archive_entry *entry,
"Inconsistent CRC32 values");
ret = ARCHIVE_WARN;
}
- if (zip_entry->compressed_size == 0) {
+ if (zip_entry->compressed_size == 0
+ || zip_entry->compressed_size == 0xffffffff) {
zip_entry->compressed_size
= zip_entry_central_dir.compressed_size;
} else if (zip_entry->compressed_size
@@ -1284,7 +1284,8 @@ zip_read_local_file_header(struct archive_read *a, struct archive_entry *entry,
return ARCHIVE_FATAL;
}
} else if (0 == (zip_entry->zip_flags & ZIP_LENGTH_AT_END)
- || zip_entry->uncompressed_size > 0) {
+ || (zip_entry->uncompressed_size > 0
+ && zip_entry->uncompressed_size != 0xffffffff)) {
/* Set the size only if it's meaningful. */
archive_entry_set_size(entry, zip_entry->uncompressed_size);
}
@@ -1343,25 +1344,267 @@ check_authentication_code(struct archive_read *a, const void *_p)
}
/*
- * Read "uncompressed" data. There are three cases:
- * 1) We know the size of the data. This is always true for the
- * seeking reader (we've examined the Central Directory already).
- * 2) ZIP_LENGTH_AT_END was set, but only the CRC was deferred.
- * Info-ZIP seems to do this; we know the size but have to grab
- * the CRC from the data descriptor afterwards.
- * 3) We're streaming and ZIP_LENGTH_AT_END was specified and
- * we have no size information. In this case, we can do pretty
- * well by watching for the data descriptor record. The data
- * descriptor is 16 bytes and includes a computed CRC that should
- * provide a strong check.
+ * The Zip end-of-file marker is inherently ambiguous. The specification
+ * in APPNOTE.TXT allows any of four possible formats, and there is no
+ * guaranteed-correct way for a reader to know a priori which one the writer
+ * will have used. The four formats are:
+ * 1. 32-bit format with an initial PK78 marker
+ * 2. 32-bit format without that marker
+ * 3. 64-bit format with the marker
+ * 4. 64-bit format without the marker
*
- * TODO: Technically, the PK\007\010 signature is optional.
- * In the original spec, the data descriptor contained CRC
- * and size fields but had no leading signature. In practice,
- * newer writers seem to provide the signature pretty consistently.
+ * Mark Adler's `sunzip` streaming unzip program solved this ambiguity
+ * by just looking at every possible combination and accepting the
+ * longest one that matches the expected values. His approach always
+ * consumes the longest possible matching EOF marker, based on an
+ * analysis of all the possible failures and how the values could
+ * overlap.
*
- * For uncompressed data, the PK\007\010 marker seems essential
- * to be sure we've actually seen the end of the entry.
+ * For example, suppose both of the first two formats listed
+ * above match. In that case, we know the next four
+ * 32-bit words match this pattern:
+ * ```
+ * [PK\07\08] [CRC32] [compressed size] [uncompressed size]
+ * ```
+ * but we know they must also match this pattern:
+ * ```
+ * [CRC32] [compressed size] [uncompressed size] [other PK marker]
+ * ```
+ *
+ * Since the first word here matches both the PK78 signature in the
+ * first form and the CRC32 in the second, we know those two values
+ * are equal, the CRC32 must be exactly 0x08074b50. Similarly, the
+ * compressed and uncompressed size must also be exactly this value.
+ * So we know these four words are all 0x08074b50. If we were to
+ * accept the shorter pattern, it would be immediately followed by
+ * another PK78 marker, which is not possible in a well-formed ZIP
+ * archive unless there is garbage between entries. This implies we
+ * should not accept the shorter form in such a case; we should accept
+ * the longer form.
+ *
+ * If the second and third possibilities above both match, we
+ * have a slightly different situation. The following words
+ * must match both the 32-bit format
+ * ```
+ * [CRC32] [compressed size] [uncompressed size] [other PK marker]
+ * ```
+ * and the 64-bit format
+ * ```
+ * [CRC32] [compressed low] [compressed high] [uncompressed low] [uncompressed high] [other PK marker]
+ * ```
+ * Since the 32-bit and 64-bit compressed sizes both match, the
+ * actualy size must fit in 32 bits, which implies the high-order
+ * word of the compressed size is zero. So we know the uncompressed
+ * low word is zero, which again implies that if we accept the shorter
+ * format, there will not be a valid PK marker following it.
+ *
+ * Similar considerations rule out the shorter form in every other
+ * possibly-ambiguous pair. So if two of the four possible formats
+ * match, we should accept the longer option.
+ *
+ * If none of the four formats matches, we know the archive must be
+ * corrupted in some fashion. In particular, it's possible that the
+ * length-at-end bit was incorrect and we should not really be looking
+ * for an EOF marker at all. To allow for this possibility, we
+ * evaluate the following words to collect data for a later error
+ * report but do not consume any bytes. We instead rely on the later
+ * search for a new PK marker to re-sync to the next well-formed
+ * entry.
+ */
+static void
+consume_end_of_file_marker(struct archive_read *a, struct zip *zip)
+{
+ const char *marker;
+ const char *p;
+ uint64_t compressed32, uncompressed32;
+ uint64_t compressed64, uncompressed64;
+ uint64_t compressed_actual, uncompressed_actual;
+ uint32_t crc32_actual;
+ const uint32_t PK78 = 0x08074B50ULL;
+ uint8_t crc32_ignored, crc32_may_be_zero;
+
+ /* If there shouldn't be a marker, don't consume it. */
+ if ((zip->entry->zip_flags & ZIP_LENGTH_AT_END) == 0) {
+ return;
+ }
+
+ /* The longest Zip end-of-file record is 24 bytes. Since an
+ * end-of-file record can never appear at the end of the
+ * archive, we know 24 bytes will be available unless
+ * the archive is severely truncated. */
+ if (NULL == (marker = __archive_read_ahead(a, 24, NULL))) {
+ return;
+ }
+ p = marker;
+
+ /* The end-of-file record comprises:
+ * = Optional PK\007\010 marker
+ * = 4-byte CRC32
+ * = Compressed size
+ * = Uncompressed size
+ *
+ * The last two fields are either both 32 bits or both 64
+ * bits. We check all possible layouts and accept any one
+ * that gives us a complete match, else we make a best-effort
+ * attempt to parse out the pieces.
+ */
+
+ /* CRC32 checking can be tricky:
+ * * Test suites sometimes ignore the CRC32
+ * * AES AE-2 always writes zero for the CRC32
+ * * AES AE-1 sometimes writes zero for the CRC32
+ */
+ crc32_ignored = zip->ignore_crc32;
+ crc32_may_be_zero = 0;
+ crc32_actual = zip->computed_crc32;
+ if (zip->hctx_valid) {
+ switch (zip->entry->aes_extra.vendor) {
+ case AES_VENDOR_AE_2:
+ crc32_actual = 0;
+ break;
+ case AES_VENDOR_AE_1:
+ default:
+ crc32_may_be_zero = 1;
+ break;
+ }
+ }
+
+ /* Values computed from the actual data in the archive. */
+ compressed_actual = (uint64_t)zip->entry_compressed_bytes_read;
+ uncompressed_actual = (uint64_t)zip->entry_uncompressed_bytes_read;
+
+
+ /* Longest: PK78 marker, all 64-bit fields (24 bytes total) */
+ if (archive_le32dec(p) == PK78
+ && ((archive_le32dec(p + 4) == crc32_actual)
+ || (crc32_may_be_zero && (archive_le32dec(p + 4) == 0))
+ || crc32_ignored)
+ && (archive_le64dec(p + 8) == compressed_actual)
+ && (archive_le64dec(p + 16) == uncompressed_actual)) {
+ if (!crc32_ignored) {
+ zip->entry->crc32 = crc32_actual;
+ }
+ zip->entry->compressed_size = compressed_actual;
+ zip->entry->uncompressed_size = uncompressed_actual;
+ zip->unconsumed += 24;
+ return;
+ }
+
+ /* No PK78 marker, 64-bit fields (20 bytes total) */
+ if (((archive_le32dec(p) == crc32_actual)
+ || (crc32_may_be_zero && (archive_le32dec(p + 4) == 0))
+ || crc32_ignored)
+ && (archive_le64dec(p + 4) == compressed_actual)
+ && (archive_le64dec(p + 12) == uncompressed_actual)) {
+ if (!crc32_ignored) {
+ zip->entry->crc32 = crc32_actual;
+ }
+ zip->entry->compressed_size = compressed_actual;
+ zip->entry->uncompressed_size = uncompressed_actual;
+ zip->unconsumed += 20;
+ return;
+ }
+
+ /* PK78 marker and 32-bit fields (16 bytes total) */
+ if (archive_le32dec(p) == PK78
+ && ((archive_le32dec(p + 4) == crc32_actual)
+ || (crc32_may_be_zero && (archive_le32dec(p + 4) == 0))
+ || crc32_ignored)
+ && (archive_le32dec(p + 8) == compressed_actual)
+ && (archive_le32dec(p + 12) == uncompressed_actual)) {
+ if (!crc32_ignored) {
+ zip->entry->crc32 = crc32_actual;
+ }
+ zip->entry->compressed_size = compressed_actual;
+ zip->entry->uncompressed_size = uncompressed_actual;
+ zip->unconsumed += 16;
+ return;
+ }
+
+ /* Shortest: No PK78 marker, all 32-bit fields (12 bytes total) */
+ if (((archive_le32dec(p) == crc32_actual)
+ || (crc32_may_be_zero && (archive_le32dec(p + 4) == 0))
+ || crc32_ignored)
+ && (archive_le32dec(p + 4) == compressed_actual)
+ && (archive_le32dec(p + 8) == uncompressed_actual)) {
+ if (!crc32_ignored) {
+ zip->entry->crc32 = crc32_actual;
+ }
+ zip->entry->compressed_size = compressed_actual;
+ zip->entry->uncompressed_size = uncompressed_actual;
+ zip->unconsumed += 12;
+ return;
+ }
+
+ /* If none of the above patterns gives us a full exact match,
+ * then there's something definitely amiss. The fallback code
+ * below will parse out some plausible values for error
+ * reporting purposes. Note that this won't actually
+ * consume anything:
+ *
+ * = If there really is a marker here, the logic to resync to
+ * the next entry will suffice to skip it.
+ *
+ * = There might not really be a marker: Corruption or bugs
+ * may have set the length-at-end bit without a marker ever
+ * having actually been written. In this case, we
+ * explicitly should not consume any bytes, since that would
+ * prevent us from correctly reading the next entry.
+ */
+ if (archive_le32dec(p) == PK78) {
+ p += 4; /* Ignore PK78 if it appears to be present */
+ }
+ zip->entry->crc32 = archive_le32dec(p); /* Parse CRC32 */
+ p += 4;
+
+ /* Consider both 32- and 64-bit interpretations */
+ compressed32 = archive_le32dec(p);
+ uncompressed32 = archive_le32dec(p + 4);
+ compressed64 = archive_le64dec(p);
+ uncompressed64 = archive_le64dec(p + 8);
+
+ /* The earlier patterns may have failed because of CRC32
+ * mismatch, so it's still possible that both sizes match.
+ * Try to match as many as we can...
+ */
+ if (compressed32 == compressed_actual
+ && uncompressed32 == uncompressed_actual) {
+ /* Both 32-bit fields match */
+ zip->entry->compressed_size = compressed32;
+ zip->entry->uncompressed_size = uncompressed32;
+ } else if (compressed64 == compressed_actual
+ || uncompressed64 == uncompressed_actual) {
+ /* One or both 64-bit fields match */
+ zip->entry->compressed_size = compressed64;
+ zip->entry->uncompressed_size = uncompressed64;
+ } else {
+ /* Zero or one 32-bit fields match */
+ zip->entry->compressed_size = compressed32;
+ zip->entry->uncompressed_size = uncompressed32;
+ }
+}
+
+/*
+ * Read "uncompressed" data.
+ *
+ * This is straightforward if we know the size of the data. This is
+ * always true for the seeking reader (we've examined the Central
+ * Directory already), and will often be true for the streaming reader
+ * (the writer was writing uncompressed so probably knows the size).
+ *
+ * If we don't know the size, then life is more interesting. Note
+ * that a careful reading of the Zip specification says that a writer
+ * must use ZIP_LENGTH_AT_END if it cannot write the CRC into the
+ * local header. And if it uses ZIP_LENGTH_AT_END, then it is
+ * prohibited from storing the sizes in the local header. This
+ * prevents fully-compliant streaming writers from providing any size
+ * clues to a streaming reader. In this case, we have to scan the
+ * data as we read to try to locate the end-of-file marker.
+ *
+ * We assume here that the end-of-file marker always has the
+ * PK\007\010 signature. Although it's technically optional, newer
+ * writers seem to provide it pretty consistently, and it's not clear
+ * how to efficiently recognize an end-of-file marker that lacks it.
*
* Returns ARCHIVE_OK if successful, ARCHIVE_FATAL otherwise, sets
* zip->end_of_entry if it consumes all of the data.
@@ -1373,18 +1616,18 @@ zip_read_data_none(struct archive_read *a, const void **_buff,
struct zip *zip;
const char *buff;
ssize_t bytes_avail;
+ ssize_t trailing_extra;
int r;
(void)offset; /* UNUSED */
zip = (struct zip *)(a->format->data);
+ trailing_extra = zip->hctx_valid ? AUTH_CODE_SIZE : 0;
if (zip->entry->zip_flags & ZIP_LENGTH_AT_END) {
const char *p;
- ssize_t grabbing_bytes = 24;
+ ssize_t grabbing_bytes = 24 + trailing_extra;
- if (zip->hctx_valid)
- grabbing_bytes += AUTH_CODE_SIZE;
/* Grab at least 24 bytes. */
buff = __archive_read_ahead(a, grabbing_bytes, &bytes_avail);
if (bytes_avail < grabbing_bytes) {
@@ -1399,44 +1642,19 @@ zip_read_data_none(struct archive_read *a, const void **_buff,
}
/* Check for a complete PK\007\010 signature, followed
* by the correct 4-byte CRC. */
- p = buff;
- if (zip->hctx_valid)
- p += AUTH_CODE_SIZE;
+ p = buff + trailing_extra;
if (p[0] == 'P' && p[1] == 'K'
&& p[2] == '\007' && p[3] == '\010'
- && (archive_le32dec(p + 4) == zip->entry_crc32
+ && (archive_le32dec(p + 4) == zip->computed_crc32
|| zip->ignore_crc32
|| (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);
- 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);
- zip->entry->compressed_size =
- archive_le32dec(p + 8);
- zip->entry->uncompressed_size =
- archive_le32dec(p + 12);
- zip->unconsumed = 16;
- }
+ zip->end_of_entry = 1;
if (zip->hctx_valid) {
r = check_authentication_code(a, buff);
if (r != ARCHIVE_OK)
return (r);
}
- zip->end_of_entry = 1;
return (ARCHIVE_OK);
}
/* If not at EOF, ensure we consume at least one byte. */
@@ -1452,11 +1670,10 @@ zip_read_data_none(struct archive_read *a, const void **_buff,
else if (p[3] == '\007') { p += 1; }
else if (p[3] == '\010' && p[2] == '\007'
&& p[1] == 'K' && p[0] == 'P') {
- if (zip->hctx_valid)
- p -= AUTH_CODE_SIZE;
break;
} else { p += 4; }
}
+ p -= trailing_extra;
bytes_avail = p - buff;
} else {
if (zip->entry_bytes_remaining == 0) {
@@ -1499,59 +1716,15 @@ zip_read_data_none(struct archive_read *a, const void **_buff,
bytes_avail = dec_size;
buff = (const char *)zip->decrypted_buffer;
}
- *size = bytes_avail;
zip->entry_bytes_remaining -= bytes_avail;
zip->entry_uncompressed_bytes_read += bytes_avail;
zip->entry_compressed_bytes_read += bytes_avail;
zip->unconsumed += bytes_avail;
+ *size = bytes_avail;
*_buff = buff;
return (ARCHIVE_OK);
}
-static int
-consume_optional_marker(struct archive_read *a, struct zip *zip)
-{
- if (zip->end_of_entry && (zip->entry->zip_flags & ZIP_LENGTH_AT_END)) {
- const char *p;
-
- if (NULL == (p = __archive_read_ahead(a, 24, NULL))) {
- archive_set_error(&a->archive,
- ARCHIVE_ERRNO_FILE_FORMAT,
- "Truncated ZIP end-of-file record");
- return (ARCHIVE_FATAL);
- }
- /* Consume the optional PK\007\010 marker. */
- if (p[0] == 'P' && p[1] == 'K' &&
- p[2] == '\007' && p[3] == '\010') {
- p += 4;
- zip->unconsumed = 4;
- }
- if (zip->entry->flags & LA_USED_ZIP64) {
- uint64_t compressed, uncompressed;
- zip->entry->crc32 = archive_le32dec(p);
- 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);
- zip->entry->compressed_size = archive_le32dec(p + 4);
- zip->entry->uncompressed_size = archive_le32dec(p + 8);
- zip->unconsumed += 12;
- }
- }
-
- return (ARCHIVE_OK);
-}
-
#if HAVE_LZMA_H && HAVE_LIBLZMA
static int
zipx_xz_init(struct archive_read *a, struct zip *zip)
@@ -1803,10 +1976,6 @@ zip_read_data_zipx_xz(struct archive_read *a, const void **buff,
*size = zip->zipx_lzma_stream.total_out;
*buff = zip->uncompressed_buffer;
- ret = consume_optional_marker(a, zip);
- if (ret != ARCHIVE_OK)
- return (ret);
-
return (ARCHIVE_OK);
}
@@ -1871,8 +2040,6 @@ zip_read_data_zipx_lzma_alone(struct archive_read *a, const void **buff,
/* This case is optional in lzma alone format. It can happen,
* but most of the files don't have it. (GitHub #1257) */
case LZMA_STREAM_END:
- lzma_end(&zip->zipx_lzma_stream);
- zip->zipx_lzma_valid = 0;
if((int64_t) zip->zipx_lzma_stream.total_in !=
zip->entry_bytes_remaining)
{
@@ -1906,21 +2073,18 @@ zip_read_data_zipx_lzma_alone(struct archive_read *a, const void **buff,
zip->end_of_entry = 1;
}
- /* Return values. */
- *size = zip->zipx_lzma_stream.total_out;
- *buff = zip->uncompressed_buffer;
-
- /* Behave the same way as during deflate decompression. */
- ret = consume_optional_marker(a, zip);
- if (ret != ARCHIVE_OK)
- return (ret);
-
/* Free lzma decoder handle because we'll no longer need it. */
+ /* This cannot be folded into LZMA_STREAM_END handling above
+ * because the stream end marker is not required in this format. */
if(zip->end_of_entry) {
lzma_end(&zip->zipx_lzma_stream);
zip->zipx_lzma_valid = 0;
}
+ /* Return values. */
+ *size = zip->zipx_lzma_stream.total_out;
+ *buff = zip->uncompressed_buffer;
+
/* If we're here, then we're good! */
return (ARCHIVE_OK);
}
@@ -2078,10 +2242,6 @@ zip_read_data_zipx_ppmd(struct archive_read *a, const void **buff,
++consumed_bytes;
} while(consumed_bytes < zip->uncompressed_buffer_size);
- /* Update pointers for libarchive. */
- *buff = zip->uncompressed_buffer;
- *size = consumed_bytes;
-
/* Update pointers so we can continue decompression in another call. */
zip->entry_bytes_remaining -= zip->zipx_ppmd_read_compressed;
zip->entry_compressed_bytes_read += zip->zipx_ppmd_read_compressed;
@@ -2093,10 +2253,9 @@ zip_read_data_zipx_ppmd(struct archive_read *a, const void **buff,
zip->ppmd8_valid = 0;
}
- /* Seek for optional marker, same way as in each zip entry. */
- ret = consume_optional_marker(a, zip);
- if (ret != ARCHIVE_OK)
- return ret;
+ /* Update pointers for libarchive. */
+ *buff = zip->uncompressed_buffer;
+ *size = consumed_bytes;
return ARCHIVE_OK;
}
@@ -2186,11 +2345,11 @@ zip_read_data_zipx_bzip2(struct archive_read *a, const void **buff,
/* Setup buffer boundaries. */
zip->bzstream.next_in = (char*)(uintptr_t) compressed_buff;
- zip->bzstream.avail_in = in_bytes;
+ zip->bzstream.avail_in = (uint32_t)in_bytes;
zip->bzstream.total_in_hi32 = 0;
zip->bzstream.total_in_lo32 = 0;
zip->bzstream.next_out = (char*) zip->uncompressed_buffer;
- zip->bzstream.avail_out = zip->uncompressed_buffer_size;
+ zip->bzstream.avail_out = (uint32_t)zip->uncompressed_buffer_size;
zip->bzstream.total_out_hi32 = 0;
zip->bzstream.total_out_lo32 = 0;
@@ -2227,7 +2386,7 @@ zip_read_data_zipx_bzip2(struct archive_read *a, const void **buff,
to_consume = zip->bzstream.total_in_lo32;
__archive_read_consume(a, to_consume);
- total_out = ((uint64_t) zip->bzstream.total_out_hi32 << 32) +
+ total_out = ((uint64_t) zip->bzstream.total_out_hi32 << 32) |
zip->bzstream.total_out_lo32;
zip->entry_bytes_remaining -= to_consume;
@@ -2238,11 +2397,6 @@ zip_read_data_zipx_bzip2(struct archive_read *a, const void **buff,
*size = total_out;
*buff = zip->uncompressed_buffer;
- /* Seek for optional marker, like in other entries. */
- r = consume_optional_marker(a, zip);
- if(r != ARCHIVE_OK)
- return r;
-
return ARCHIVE_OK;
}
@@ -2373,11 +2527,6 @@ zip_read_data_zipx_zstd(struct archive_read *a, const void **buff,
*size = total_out;
*buff = zip->uncompressed_buffer;
- /* Seek for optional marker, like in other entries. */
- r = consume_optional_marker(a, zip);
- if(r != ARCHIVE_OK)
- return r;
-
return ARCHIVE_OK;
}
#endif
@@ -2413,7 +2562,7 @@ zip_read_data_deflate(struct archive_read *a, const void **buff,
size_t *size, int64_t *offset)
{
struct zip *zip;
- ssize_t bytes_avail;
+ ssize_t bytes_avail, to_consume = 0;
const void *compressed_buff, *sp;
int r;
@@ -2534,34 +2683,33 @@ zip_read_data_deflate(struct archive_read *a, const void **buff,
}
/* Consume as much as the compressor actually used. */
- bytes_avail = zip->stream.total_in;
+ to_consume = zip->stream.total_in;
+ __archive_read_consume(a, to_consume);
+ zip->entry_bytes_remaining -= to_consume;
+ zip->entry_compressed_bytes_read += to_consume;
+ zip->entry_uncompressed_bytes_read += zip->stream.total_out;
+
if (zip->tctx_valid || zip->cctx_valid) {
- zip->decrypted_bytes_remaining -= bytes_avail;
+ zip->decrypted_bytes_remaining -= to_consume;
if (zip->decrypted_bytes_remaining == 0)
zip->decrypted_ptr = zip->decrypted_buffer;
else
- zip->decrypted_ptr += bytes_avail;
+ zip->decrypted_ptr += to_consume;
}
- /* Calculate compressed data as much as we used.*/
if (zip->hctx_valid)
- archive_hmac_sha1_update(&zip->hctx, sp, bytes_avail);
- __archive_read_consume(a, bytes_avail);
- zip->entry_bytes_remaining -= bytes_avail;
- zip->entry_compressed_bytes_read += bytes_avail;
-
- *size = zip->stream.total_out;
- zip->entry_uncompressed_bytes_read += zip->stream.total_out;
- *buff = zip->uncompressed_buffer;
+ archive_hmac_sha1_update(&zip->hctx, sp, to_consume);
- if (zip->end_of_entry && zip->hctx_valid) {
- r = check_authentication_code(a, NULL);
- if (r != ARCHIVE_OK)
- return (r);
+ if (zip->end_of_entry) {
+ if (zip->hctx_valid) {
+ r = check_authentication_code(a, NULL);
+ if (r != ARCHIVE_OK) {
+ return (r);
+ }
+ }
}
- r = consume_optional_marker(a, zip);
- if (r != ARCHIVE_OK)
- return (r);
+ *size = zip->stream.total_out;
+ *buff = zip->uncompressed_buffer;
return (ARCHIVE_OK);
}
@@ -3029,13 +3177,27 @@ archive_read_format_zip_read_data(struct archive_read *a,
}
if (r != ARCHIVE_OK)
return (r);
- /* Update checksum */
- if (*size)
- zip->entry_crc32 = zip->crc32func(zip->entry_crc32, *buff,
- (unsigned)*size);
- /* If we hit the end, swallow any end-of-data marker. */
+ if (*size > 0) {
+ zip->computed_crc32 = zip->crc32func(zip->computed_crc32, *buff,
+ (unsigned)*size);
+ }
+ /* If we hit the end, swallow any end-of-data marker and
+ * verify the final check values. */
if (zip->end_of_entry) {
- /* Check file size, CRC against these values. */
+ consume_end_of_file_marker(a, zip);
+
+ /* Check computed CRC against header */
+ if ((!zip->hctx_valid ||
+ zip->entry->aes_extra.vendor != AES_VENDOR_AE_2) &&
+ zip->entry->crc32 != zip->computed_crc32
+ && !zip->ignore_crc32) {
+ archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
+ "ZIP bad CRC: 0x%lx should be 0x%lx",
+ (unsigned long)zip->computed_crc32,
+ (unsigned long)zip->entry->crc32);
+ return (ARCHIVE_FAILED);
+ }
+ /* Check file size against header. */
if (zip->entry->compressed_size !=
zip->entry_compressed_bytes_read) {
archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
@@ -3043,7 +3205,7 @@ archive_read_format_zip_read_data(struct archive_read *a,
"(read %jd, expected %jd)",
(intmax_t)zip->entry_compressed_bytes_read,
(intmax_t)zip->entry->compressed_size);
- return (ARCHIVE_WARN);
+ return (ARCHIVE_FAILED);
}
/* Size field only stores the lower 32 bits of the actual
* size. */
@@ -3054,18 +3216,7 @@ archive_read_format_zip_read_data(struct archive_read *a,
"(read %jd, expected %jd)\n",
(intmax_t)zip->entry_uncompressed_bytes_read,
(intmax_t)zip->entry->uncompressed_size);
- return (ARCHIVE_WARN);
- }
- /* Check computed CRC against header */
- if ((!zip->hctx_valid ||
- zip->entry->aes_extra.vendor != AES_VENDOR_AE_2) &&
- zip->entry->crc32 != zip->entry_crc32
- && !zip->ignore_crc32) {
- archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
- "ZIP bad CRC: 0x%lx should be 0x%lx",
- (unsigned long)zip->entry_crc32,
- (unsigned long)zip->entry->crc32);
- return (ARCHIVE_WARN);
+ return (ARCHIVE_FAILED);
}
}
diff --git a/libarchive/archive_string.c b/libarchive/archive_string.c
index d7f2c46b28fe..f39677ad7a26 100644
--- a/libarchive/archive_string.c
+++ b/libarchive/archive_string.c
@@ -25,7 +25,6 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/archive_string.c 201095 2009-12-28 02:33:22Z kientzle $");
/*
* Basic resizable string support, to simplify manipulating arbitrary-sized
@@ -553,6 +552,8 @@ archive_wstring_append_from_mbs_in_codepage(struct archive_wstring *dest,
} else
mbflag = MB_PRECOMPOSED;
+ mbflag |= MB_ERR_INVALID_CHARS;
+
buffsize = dest->length + length + 1;
do {
/* Allocate memory for WCS. */
@@ -1324,6 +1325,10 @@ free_sconv_object(struct archive_string_conv *sc)
}
#if defined(_WIN32) && !defined(__CYGWIN__)
+# if defined(WINAPI_FAMILY_PARTITION) && !WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
+# define GetOEMCP() CP_OEMCP
+# endif
+
static unsigned
my_atoi(const char *p)
{
@@ -1523,7 +1528,7 @@ get_current_codepage(void)
p = strrchr(locale, '.');
if (p == NULL)
return (GetACP());
- if (strcmp(p+1, "utf8") == 0)
+ if ((strcmp(p+1, "utf8") == 0) || (strcmp(p+1, "UTF-8") == 0))
return CP_UTF8;
cp = my_atoi(p+1);
if ((int)cp <= 0)
@@ -3988,10 +3993,10 @@ int
archive_mstring_get_mbs_l(struct archive *a, struct archive_mstring *aes,
const char **p, size_t *length, struct archive_string_conv *sc)
{
- int r, ret = 0;
-
- (void)r; /* UNUSED */
+ int ret = 0;
#if defined(_WIN32) && !defined(__CYGWIN__)
+ int r;
+
/*
* Internationalization programming on Windows must use Wide
* characters because Windows platform cannot make locale UTF-8.
@@ -4223,6 +4228,17 @@ archive_mstring_update_utf8(struct archive *a, struct archive_mstring *aes,
if (sc == NULL)
return (-1);/* Couldn't allocate memory for sc. */
r = archive_strcpy_l(&(aes->aes_mbs), utf8, sc);
+
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ /* On failure, make an effort to convert UTF8 to WCS as the active code page
+ * may not be able to represent all characters in the string */
+ if (r != 0) {
+ if (archive_wstring_append_from_mbs_in_codepage(&(aes->aes_wcs),
+ aes->aes_utf8.s, aes->aes_utf8.length, sc) == 0)
+ aes->aes_set = AES_SET_UTF8 | AES_SET_WCS;
+ }
+#endif
+
if (a == NULL)
free_sconv_object(sc);
if (r != 0)
diff --git a/libarchive/archive_string.h b/libarchive/archive_string.h
index 49d7d3064a3d..e8987867d3ce 100644
--- a/libarchive/archive_string.h
+++ b/libarchive/archive_string.h
@@ -21,9 +21,6 @@
* 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: head/lib/libarchive/archive_string.h 201092 2009-12-28 02:26:06Z kientzle $
- *
*/
#ifndef ARCHIVE_STRING_H_INCLUDED
diff --git a/libarchive/archive_string_composition.h b/libarchive/archive_string_composition.h
index d0ac340961a0..e917036f1167 100644
--- a/libarchive/archive_string_composition.h
+++ b/libarchive/archive_string_composition.h
@@ -22,8 +22,6 @@
* (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$
- *
*/
/*
diff --git a/libarchive/archive_string_sprintf.c b/libarchive/archive_string_sprintf.c
index 969a5603a49e..c785e12bdf6d 100644
--- a/libarchive/archive_string_sprintf.c
+++ b/libarchive/archive_string_sprintf.c
@@ -24,7 +24,6 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/archive_string_sprintf.c 189435 2009-03-06 05:14:55Z kientzle $");
/*
* The use of printf()-family functions can be troublesome
diff --git a/libarchive/archive_util.3 b/libarchive/archive_util.3
index d5d4e7dfd7d5..3aa508f25aa2 100644
--- a/libarchive/archive_util.3
+++ b/libarchive/archive_util.3
@@ -22,8 +22,6 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $FreeBSD$
-.\"
.Dd February 2, 2012
.Dt ARCHIVE_UTIL 3
.Os
diff --git a/libarchive/archive_util.c b/libarchive/archive_util.c
index b1582edbe308..32d4bd40988c 100644
--- a/libarchive/archive_util.c
+++ b/libarchive/archive_util.c
@@ -25,7 +25,6 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/archive_util.c 201098 2009-12-28 02:58:14Z kientzle $");
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
@@ -42,9 +41,20 @@ __FBSDID("$FreeBSD: head/lib/libarchive/archive_util.c 201098 2009-12-28 02:58:1
#ifdef HAVE_STRING_H
#include <string.h>
#endif
-#if defined(HAVE_WINCRYPT_H) && !defined(__CYGWIN__)
+#if defined(_WIN32) && !defined(__CYGWIN__)
+#if defined(HAVE_BCRYPT_H) && _WIN32_WINNT >= _WIN32_WINNT_VISTA
+/* don't use bcrypt when XP needs to be supported */
+#include <bcrypt.h>
+
+/* Common in other bcrypt implementations, but missing from VS2008. */
+#ifndef BCRYPT_SUCCESS
+#define BCRYPT_SUCCESS(r) ((NTSTATUS)(r) == STATUS_SUCCESS)
+#endif
+
+#elif defined(HAVE_WINCRYPT_H)
#include <wincrypt.h>
#endif
+#endif
#ifdef HAVE_ZLIB_H
#include <zlib.h>
#endif
@@ -233,14 +243,16 @@ __archive_mktempx(const char *tmpdir, wchar_t *template)
L'm', L'n', L'o', L'p', L'q', L'r', L's', L't',
L'u', L'v', L'w', L'x', L'y', L'z'
};
- HCRYPTPROV hProv;
struct archive_wstring temp_name;
wchar_t *ws;
DWORD attr;
wchar_t *xp, *ep;
int fd;
-
- hProv = (HCRYPTPROV)NULL;
+#if defined(HAVE_BCRYPT_H) && _WIN32_WINNT >= _WIN32_WINNT_VISTA
+ BCRYPT_ALG_HANDLE hAlg = NULL;
+#else
+ HCRYPTPROV hProv = (HCRYPTPROV)NULL;
+#endif
fd = -1;
ws = NULL;
@@ -314,23 +326,42 @@ __archive_mktempx(const char *tmpdir, wchar_t *template)
abort();
}
+#if defined(HAVE_BCRYPT_H) && _WIN32_WINNT >= _WIN32_WINNT_VISTA
+ if (!BCRYPT_SUCCESS(BCryptOpenAlgorithmProvider(&hAlg, BCRYPT_RNG_ALGORITHM,
+ NULL, 0))) {
+ la_dosmaperr(GetLastError());
+ goto exit_tmpfile;
+ }
+#else
if (!CryptAcquireContext(&hProv, NULL, NULL, PROV_RSA_FULL,
CRYPT_VERIFYCONTEXT)) {
la_dosmaperr(GetLastError());
goto exit_tmpfile;
}
+#endif
for (;;) {
wchar_t *p;
HANDLE h;
+# if _WIN32_WINNT >= 0x0602 /* _WIN32_WINNT_WIN8 */
+ CREATEFILE2_EXTENDED_PARAMETERS createExParams;
+#endif
/* Generate a random file name through CryptGenRandom(). */
p = xp;
+#if defined(HAVE_BCRYPT_H) && _WIN32_WINNT >= _WIN32_WINNT_VISTA
+ if (!BCRYPT_SUCCESS(BCryptGenRandom(hAlg, (PUCHAR)p,
+ (DWORD)(ep - p)*sizeof(wchar_t), 0))) {
+ la_dosmaperr(GetLastError());
+ goto exit_tmpfile;
+ }
+#else
if (!CryptGenRandom(hProv, (DWORD)(ep - p)*sizeof(wchar_t),
(BYTE*)p)) {
la_dosmaperr(GetLastError());
goto exit_tmpfile;
}
+#endif
for (; p < ep; p++)
*p = num[((DWORD)*p) % (sizeof(num)/sizeof(num[0]))];
@@ -347,6 +378,17 @@ __archive_mktempx(const char *tmpdir, wchar_t *template)
/* mkstemp */
attr = FILE_ATTRIBUTE_NORMAL;
}
+# if _WIN32_WINNT >= 0x0602 /* _WIN32_WINNT_WIN8 */
+ ZeroMemory(&createExParams, sizeof(createExParams));
+ createExParams.dwSize = sizeof(createExParams);
+ createExParams.dwFileAttributes = attr & 0xFFFF;
+ createExParams.dwFileFlags = attr & 0xFFF00000;
+ h = CreateFile2(ws,
+ GENERIC_READ | GENERIC_WRITE | DELETE,
+ 0,/* Not share */
+ CREATE_NEW,
+ &createExParams);
+#else
h = CreateFileW(ws,
GENERIC_READ | GENERIC_WRITE | DELETE,
0,/* Not share */
@@ -354,6 +396,7 @@ __archive_mktempx(const char *tmpdir, wchar_t *template)
CREATE_NEW,/* Create a new file only */
attr,
NULL);
+#endif
if (h == INVALID_HANDLE_VALUE) {
/* The same file already exists. retry with
* a new filename. */
@@ -372,8 +415,13 @@ __archive_mktempx(const char *tmpdir, wchar_t *template)
break;/* success! */
}
exit_tmpfile:
+#if defined(HAVE_BCRYPT_H) && _WIN32_WINNT >= _WIN32_WINNT_VISTA
+ if (hAlg != NULL)
+ BCryptCloseAlgorithmProvider(hAlg, 0);
+#else
if (hProv != (HCRYPTPROV)NULL)
CryptReleaseContext(hProv, 0);
+#endif
free(ws);
if (template == temp_name.s)
archive_wstring_free(&temp_name);
diff --git a/libarchive/archive_version_details.c b/libarchive/archive_version_details.c
index bfb20eab2027..29be24f3222e 100644
--- a/libarchive/archive_version_details.c
+++ b/libarchive/archive_version_details.c
@@ -25,7 +25,6 @@
*/
#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>
diff --git a/libarchive/archive_virtual.c b/libarchive/archive_virtual.c
index f509ee5c672d..97e0b8a0d7b7 100644
--- a/libarchive/archive_virtual.c
+++ b/libarchive/archive_virtual.c
@@ -24,7 +24,6 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/archive_virtual.c 201098 2009-12-28 02:58:14Z kientzle $");
#include "archive.h"
#include "archive_entry.h"
diff --git a/libarchive/archive_windows.c b/libarchive/archive_windows.c
index 624e270095d6..bb540da011f7 100644
--- a/libarchive/archive_windows.c
+++ b/libarchive/archive_windows.c
@@ -22,8 +22,6 @@
* 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$
*/
/*
@@ -234,7 +232,11 @@ la_CreateFile(const char *path, DWORD dwDesiredAccess, DWORD dwShareMode,
{
wchar_t *wpath;
HANDLE handle;
+# if _WIN32_WINNT >= 0x0602 /* _WIN32_WINNT_WIN8 */
+ CREATEFILE2_EXTENDED_PARAMETERS createExParams;
+#endif
+#if !defined(WINAPI_FAMILY_PARTITION) || WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP)
handle = CreateFileA(path, dwDesiredAccess, dwShareMode,
lpSecurityAttributes, dwCreationDisposition, dwFlagsAndAttributes,
hTemplateFile);
@@ -242,12 +244,25 @@ la_CreateFile(const char *path, DWORD dwDesiredAccess, DWORD dwShareMode,
return (handle);
if (GetLastError() != ERROR_PATH_NOT_FOUND)
return (handle);
+#endif
wpath = __la_win_permissive_name(path);
if (wpath == NULL)
- return (handle);
+ return INVALID_HANDLE_VALUE;
+# if _WIN32_WINNT >= 0x0602 /* _WIN32_WINNT_WIN8 */
+ ZeroMemory(&createExParams, sizeof(createExParams));
+ createExParams.dwSize = sizeof(createExParams);
+ createExParams.dwFileAttributes = dwFlagsAndAttributes & 0xFFFF;
+ createExParams.dwFileFlags = dwFlagsAndAttributes & 0xFFF00000;
+ createExParams.dwSecurityQosFlags = dwFlagsAndAttributes & 0x000F00000;
+ createExParams.lpSecurityAttributes = lpSecurityAttributes;
+ createExParams.hTemplateFile = hTemplateFile;
+ handle = CreateFile2(wpath, dwDesiredAccess, dwShareMode,
+ dwCreationDisposition, &createExParams);
+#else /* !WINAPI_PARTITION_DESKTOP */
handle = CreateFileW(wpath, dwDesiredAccess, dwShareMode,
lpSecurityAttributes, dwCreationDisposition, dwFlagsAndAttributes,
hTemplateFile);
+#endif /* !WINAPI_PARTITION_DESKTOP */
free(wpath);
return (handle);
}
@@ -305,7 +320,10 @@ __la_open(const char *path, int flags, ...)
* "Permission denied" error.
*/
attr = GetFileAttributesA(path);
- if (attr == (DWORD)-1 && GetLastError() == ERROR_PATH_NOT_FOUND) {
+#if !defined(WINAPI_FAMILY_PARTITION) || WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP)
+ if (attr == (DWORD)-1 && GetLastError() == ERROR_PATH_NOT_FOUND)
+#endif
+ {
ws = __la_win_permissive_name(path);
if (ws == NULL) {
errno = EINVAL;
@@ -320,7 +338,7 @@ __la_open(const char *path, int flags, ...)
}
if (attr & FILE_ATTRIBUTE_DIRECTORY) {
HANDLE handle;
-
+#if !defined(WINAPI_FAMILY_PARTITION) || WINAPI_FAMILY_PARTITION (WINAPI_PARTITION_DESKTOP)
if (ws != NULL)
handle = CreateFileW(ws, 0, 0, NULL,
OPEN_EXISTING,
@@ -333,6 +351,15 @@ __la_open(const char *path, int flags, ...)
FILE_FLAG_BACKUP_SEMANTICS |
FILE_ATTRIBUTE_READONLY,
NULL);
+#else /* !WINAPI_PARTITION_DESKTOP */
+ CREATEFILE2_EXTENDED_PARAMETERS createExParams;
+ ZeroMemory(&createExParams, sizeof(createExParams));
+ createExParams.dwSize = sizeof(createExParams);
+ createExParams.dwFileAttributes = FILE_ATTRIBUTE_READONLY;
+ createExParams.dwFileFlags = FILE_FLAG_BACKUP_SEMANTICS;
+ handle = CreateFile2(ws, 0, 0,
+ OPEN_EXISTING, &createExParams);
+#endif /* !WINAPI_PARTITION_DESKTOP */
free(ws);
if (handle == INVALID_HANDLE_VALUE) {
la_dosmaperr(GetLastError());
diff --git a/libarchive/archive_windows.h b/libarchive/archive_windows.h
index 47b7cb8e379f..6b7006a00a1e 100644
--- a/libarchive/archive_windows.h
+++ b/libarchive/archive_windows.h
@@ -23,8 +23,6 @@
* 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$
*/
/*
diff --git a/libarchive/archive_write.3 b/libarchive/archive_write.3
index e7f7f1384ee8..227e4e028449 100644
--- a/libarchive/archive_write.3
+++ b/libarchive/archive_write.3
@@ -22,8 +22,6 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $FreeBSD$
-.\"
.Dd February 2, 2012
.Dt ARCHIVE_WRITE 3
.Os
diff --git a/libarchive/archive_write.c b/libarchive/archive_write.c
index 66592e8268ab..b70bc785c738 100644
--- a/libarchive/archive_write.c
+++ b/libarchive/archive_write.c
@@ -24,7 +24,6 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/archive_write.c 201099 2009-12-28 03:03:00Z kientzle $");
/*
* This file contains the "essential" portions of the write API, that
@@ -115,7 +114,7 @@ archive_write_new(void)
/* Initialize a block of nulls for padding purposes. */
a->null_length = 1024;
- nulls = (unsigned char *)calloc(1, a->null_length);
+ nulls = (unsigned char *)calloc(a->null_length, sizeof(unsigned char));
if (nulls == NULL) {
free(a);
return (NULL);
@@ -201,6 +200,10 @@ __archive_write_allocate_filter(struct archive *_a)
struct archive_write_filter *f;
f = calloc(1, sizeof(*f));
+
+ if (f == NULL)
+ return (NULL);
+
f->archive = _a;
f->state = ARCHIVE_WRITE_FILTER_STATE_NEW;
if (a->filter_first == NULL)
@@ -306,6 +309,25 @@ __archive_write_output(struct archive_write *a, const void *buff, size_t length)
return (__archive_write_filter(a->filter_first, buff, length));
}
+static int
+__archive_write_filters_flush(struct archive_write *a)
+{
+ struct archive_write_filter *f;
+ int ret, ret1;
+
+ ret = ARCHIVE_OK;
+ for (f = a->filter_first; f != NULL; f = f->next_filter) {
+ if (f->flush != NULL && f->bytes_written > 0) {
+ ret1 = (f->flush)(f);
+ if (ret1 < ret)
+ ret = ret1;
+ if (ret1 < ARCHIVE_WARN)
+ f->state = ARCHIVE_WRITE_FILTER_STATE_FATAL;
+ }
+ }
+ return (ret);
+}
+
int
__archive_write_nulls(struct archive_write *a, size_t length)
{
@@ -548,6 +570,10 @@ archive_write_open2(struct archive *_a, void *client_data,
a->client_data = client_data;
client_filter = __archive_write_allocate_filter(_a);
+
+ if (client_filter == NULL)
+ return (ARCHIVE_FATAL);
+
client_filter->open = archive_write_client_open;
client_filter->write = archive_write_client_write;
client_filter->close = archive_write_client_close;
@@ -732,6 +758,18 @@ _archive_write_header(struct archive *_a, struct archive_entry *entry)
return (ARCHIVE_FAILED);
}
+ /* Flush filters at boundary. */
+ r2 = __archive_write_filters_flush(a);
+ if (r2 == ARCHIVE_FAILED) {
+ return (ARCHIVE_FAILED);
+ }
+ if (r2 == ARCHIVE_FATAL) {
+ a->archive.state = ARCHIVE_STATE_FATAL;
+ return (ARCHIVE_FATAL);
+ }
+ if (r2 < ret)
+ ret = r2;
+
/* Format and write header. */
r2 = ((a->format_write_header)(a, entry));
if (r2 == ARCHIVE_FAILED) {
diff --git a/libarchive/archive_write_add_filter.c b/libarchive/archive_write_add_filter.c
index 203f4142b5c9..aa962515a044 100644
--- a/libarchive/archive_write_add_filter.c
+++ b/libarchive/archive_write_add_filter.c
@@ -24,7 +24,6 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD$");
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
diff --git a/libarchive/archive_write_add_filter_b64encode.c b/libarchive/archive_write_add_filter_b64encode.c
index 87fdb73ecb09..084d195402bc 100644
--- a/libarchive/archive_write_add_filter_b64encode.c
+++ b/libarchive/archive_write_add_filter_b64encode.c
@@ -25,8 +25,6 @@
#include "archive_platform.h"
-__FBSDID("$FreeBSD$");
-
#ifdef HAVE_ERRNO_H
#include <errno.h>
#endif
diff --git a/libarchive/archive_write_add_filter_by_name.c b/libarchive/archive_write_add_filter_by_name.c
index ffa633c96371..fc62458c56ee 100644
--- a/libarchive/archive_write_add_filter_by_name.c
+++ b/libarchive/archive_write_add_filter_by_name.c
@@ -25,7 +25,6 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD$");
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
diff --git a/libarchive/archive_write_add_filter_bzip2.c b/libarchive/archive_write_add_filter_bzip2.c
index 7001e9c6b309..561e11b5d70a 100644
--- a/libarchive/archive_write_add_filter_bzip2.c
+++ b/libarchive/archive_write_add_filter_bzip2.c
@@ -26,8 +26,6 @@
#include "archive_platform.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/archive_write_set_compression_bzip2.c 201091 2009-12-28 02:22:41Z kientzle $");
-
#ifdef HAVE_ERRNO_H
#include <errno.h>
#endif
@@ -190,7 +188,7 @@ archive_compressor_bzip2_open(struct archive_write_filter *f)
memset(&data->stream, 0, sizeof(data->stream));
data->stream.next_out = data->compressed;
- data->stream.avail_out = data->compressed_buffer_size;
+ data->stream.avail_out = (uint32_t)data->compressed_buffer_size;
f->write = archive_compressor_bzip2_write;
/* Initialize compression library */
@@ -244,7 +242,7 @@ archive_compressor_bzip2_write(struct archive_write_filter *f,
/* Compress input data to output buffer */
SET_NEXT_IN(data, buff);
- data->stream.avail_in = length;
+ data->stream.avail_in = (uint32_t)length;
if (drive_compressor(f, data, 0))
return (ARCHIVE_FATAL);
return (ARCHIVE_OK);
@@ -313,7 +311,7 @@ drive_compressor(struct archive_write_filter *f,
return (ARCHIVE_FATAL);
}
data->stream.next_out = data->compressed;
- data->stream.avail_out = data->compressed_buffer_size;
+ data->stream.avail_out = (uint32_t)data->compressed_buffer_size;
}
/* If there's nothing to do, we're done. */
diff --git a/libarchive/archive_write_add_filter_compress.c b/libarchive/archive_write_add_filter_compress.c
index d404fae7dba4..78afebda3e35 100644
--- a/libarchive/archive_write_add_filter_compress.c
+++ b/libarchive/archive_write_add_filter_compress.c
@@ -58,8 +58,6 @@
#include "archive_platform.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/archive_write_set_compression_compress.c 201111 2009-12-28 03:33:05Z kientzle $");
-
#ifdef HAVE_ERRNO_H
#include <errno.h>
#endif
@@ -352,7 +350,7 @@ archive_compressor_compress_write(struct archive_write_filter *f,
while (length--) {
c = *bp++;
state->in_count++;
- state->cur_fcode = (c << 16) + state->cur_code;
+ state->cur_fcode = (c << 16) | state->cur_code;
i = ((c << HSHIFT) ^ state->cur_code); /* Xor hashing. */
if (state->hashtab[i] == state->cur_fcode) {
diff --git a/libarchive/archive_write_add_filter_grzip.c b/libarchive/archive_write_add_filter_grzip.c
index 371102d74c05..f8bb886061e5 100644
--- a/libarchive/archive_write_add_filter_grzip.c
+++ b/libarchive/archive_write_add_filter_grzip.c
@@ -25,8 +25,6 @@
#include "archive_platform.h"
-__FBSDID("$FreeBSD$");
-
#ifdef HAVE_ERRNO_H
#include <errno.h>
#endif
diff --git a/libarchive/archive_write_add_filter_gzip.c b/libarchive/archive_write_add_filter_gzip.c
index 8670d5ca7403..a7fabbfa6bd5 100644
--- a/libarchive/archive_write_add_filter_gzip.c
+++ b/libarchive/archive_write_add_filter_gzip.c
@@ -25,8 +25,6 @@
#include "archive_platform.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/archive_write_set_compression_gzip.c 201081 2009-12-28 02:04:42Z kientzle $");
-
#ifdef HAVE_ERRNO_H
#include <errno.h>
#endif
diff --git a/libarchive/archive_write_add_filter_lrzip.c b/libarchive/archive_write_add_filter_lrzip.c
index e215f8903259..fe974c93d5d0 100644
--- a/libarchive/archive_write_add_filter_lrzip.c
+++ b/libarchive/archive_write_add_filter_lrzip.c
@@ -25,8 +25,6 @@
#include "archive_platform.h"
-__FBSDID("$FreeBSD$");
-
#ifdef HAVE_ERRNO_H
#include <errno.h>
#endif
diff --git a/libarchive/archive_write_add_filter_lz4.c b/libarchive/archive_write_add_filter_lz4.c
index cf19fadd5633..24061a169521 100644
--- a/libarchive/archive_write_add_filter_lz4.c
+++ b/libarchive/archive_write_add_filter_lz4.c
@@ -25,8 +25,6 @@
#include "archive_platform.h"
-__FBSDID("$FreeBSD$");
-
#ifdef HAVE_ERRNO_H
#include <errno.h>
#endif
@@ -518,10 +516,10 @@ drive_compressor_independence(struct archive_write_filter *f, const char *p,
} else {
/* The buffer is not compressed. The compressed size was
* bigger than its uncompressed size. */
- archive_le32enc(data->out, length | 0x80000000);
+ archive_le32enc(data->out, (uint32_t)(length | 0x80000000));
data->out += 4;
memcpy(data->out, p, length);
- outsize = length;
+ outsize = (uint32_t)length;
}
data->out += outsize;
if (data->block_checksum) {
@@ -603,10 +601,10 @@ drive_compressor_dependence(struct archive_write_filter *f, const char *p,
} else {
/* The buffer is not compressed. The compressed size was
* bigger than its uncompressed size. */
- archive_le32enc(data->out, length | 0x80000000);
+ archive_le32enc(data->out, (uint32_t)(length | 0x80000000));
data->out += 4;
memcpy(data->out, p, length);
- outsize = length;
+ outsize = (uint32_t)length;
}
data->out += outsize;
if (data->block_checksum) {
diff --git a/libarchive/archive_write_add_filter_lzop.c b/libarchive/archive_write_add_filter_lzop.c
index 3bd9062e4d32..8580e58844af 100644
--- a/libarchive/archive_write_add_filter_lzop.c
+++ b/libarchive/archive_write_add_filter_lzop.c
@@ -25,7 +25,6 @@
#include "archive_platform.h"
-__FBSDID("$FreeBSD$");
//#undef HAVE_LZO_LZOCONF_H
//#undef HAVE_LZO_LZO1X_H
diff --git a/libarchive/archive_write_add_filter_none.c b/libarchive/archive_write_add_filter_none.c
index 3c06c642e735..b7aa6d4bcd3c 100644
--- a/libarchive/archive_write_add_filter_none.c
+++ b/libarchive/archive_write_add_filter_none.c
@@ -24,7 +24,6 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/archive_write_set_compression_none.c 201080 2009-12-28 02:03:54Z kientzle $");
#include "archive.h"
diff --git a/libarchive/archive_write_add_filter_program.c b/libarchive/archive_write_add_filter_program.c
index c096e7227ba4..c661cc7f412f 100644
--- a/libarchive/archive_write_add_filter_program.c
+++ b/libarchive/archive_write_add_filter_program.c
@@ -25,7 +25,6 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/archive_write_set_compression_program.c 201104 2009-12-28 03:14:30Z kientzle $");
#ifdef HAVE_SYS_WAIT_H
# include <sys/wait.h>
diff --git a/libarchive/archive_write_add_filter_uuencode.c b/libarchive/archive_write_add_filter_uuencode.c
index 1ad458921928..42dec8def1f1 100644
--- a/libarchive/archive_write_add_filter_uuencode.c
+++ b/libarchive/archive_write_add_filter_uuencode.c
@@ -25,8 +25,6 @@
#include "archive_platform.h"
-__FBSDID("$FreeBSD$");
-
#ifdef HAVE_ERRNO_H
#include <errno.h>
#endif
diff --git a/libarchive/archive_write_add_filter_xz.c b/libarchive/archive_write_add_filter_xz.c
index 04bee90efa46..18da08274d92 100644
--- a/libarchive/archive_write_add_filter_xz.c
+++ b/libarchive/archive_write_add_filter_xz.c
@@ -26,8 +26,6 @@
#include "archive_platform.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/archive_write_set_compression_xz.c 201108 2009-12-28 03:28:21Z kientzle $");
-
#ifdef HAVE_ERRNO_H
#include <errno.h>
#endif
diff --git a/libarchive/archive_write_add_filter_zstd.c b/libarchive/archive_write_add_filter_zstd.c
index e85b7669c50d..94249accd08b 100644
--- a/libarchive/archive_write_add_filter_zstd.c
+++ b/libarchive/archive_write_add_filter_zstd.c
@@ -1,5 +1,6 @@
/*-
* Copyright (c) 2017 Sean Purcell
+ * Copyright (c) 2023-2024 Klara, Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -25,12 +26,12 @@
#include "archive_platform.h"
-__FBSDID("$FreeBSD$");
-
-
#ifdef HAVE_ERRNO_H
#include <errno.h>
#endif
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif
@@ -50,10 +51,24 @@ __FBSDID("$FreeBSD$");
struct private_data {
int compression_level;
- int threads;
-#if HAVE_ZSTD_H && HAVE_LIBZSTD_COMPRESSOR
+ int threads;
+ int long_distance;
+#if HAVE_ZSTD_H && HAVE_ZSTD_compressStream
+ enum {
+ running,
+ finishing,
+ resetting,
+ } state;
+ int frame_per_file;
+ size_t min_frame_in;
+ size_t max_frame_in;
+ size_t min_frame_out;
+ size_t max_frame_out;
+ size_t cur_frame;
+ size_t cur_frame_in;
+ size_t cur_frame_out;
+ size_t total_in;
ZSTD_CStream *cstream;
- int64_t total_in;
ZSTD_outBuffer out;
#else
struct archive_write_program_data *pdata;
@@ -67,17 +82,21 @@ struct private_data {
#define CLEVEL_STD_MAX 19 /* without using --ultra */
#define CLEVEL_MAX 22
+#define LONG_STD 27
+
#define MINVER_NEGCLEVEL 10304
#define MINVER_MINCLEVEL 10306
+#define MINVER_LONG 10302
static int archive_compressor_zstd_options(struct archive_write_filter *,
const char *, const char *);
static int archive_compressor_zstd_open(struct archive_write_filter *);
static int archive_compressor_zstd_write(struct archive_write_filter *,
const void *, size_t);
+static int archive_compressor_zstd_flush(struct archive_write_filter *);
static int archive_compressor_zstd_close(struct archive_write_filter *);
static int archive_compressor_zstd_free(struct archive_write_filter *);
-#if HAVE_ZSTD_H && HAVE_LIBZSTD_COMPRESSOR
+#if HAVE_ZSTD_H && HAVE_ZSTD_compressStream
static int drive_compressor(struct archive_write_filter *,
struct private_data *, int, const void *, size_t);
#endif
@@ -103,13 +122,22 @@ archive_write_add_filter_zstd(struct archive *_a)
f->data = data;
f->open = &archive_compressor_zstd_open;
f->options = &archive_compressor_zstd_options;
+ f->flush = &archive_compressor_zstd_flush;
f->close = &archive_compressor_zstd_close;
f->free = &archive_compressor_zstd_free;
f->code = ARCHIVE_FILTER_ZSTD;
f->name = "zstd";
data->compression_level = CLEVEL_DEFAULT;
data->threads = 0;
-#if HAVE_ZSTD_H && HAVE_LIBZSTD_COMPRESSOR
+ data->long_distance = 0;
+#if HAVE_ZSTD_H && HAVE_ZSTD_compressStream
+ data->frame_per_file = 0;
+ data->min_frame_in = 0;
+ data->max_frame_in = SIZE_MAX;
+ data->min_frame_out = 0;
+ data->max_frame_out = SIZE_MAX;
+ data->cur_frame_in = 0;
+ data->cur_frame_out = 0;
data->cstream = ZSTD_createCStream();
if (data->cstream == NULL) {
free(data);
@@ -136,7 +164,7 @@ static int
archive_compressor_zstd_free(struct archive_write_filter *f)
{
struct private_data *data = (struct private_data *)f->data;
-#if HAVE_ZSTD_H && HAVE_LIBZSTD_COMPRESSOR
+#if HAVE_ZSTD_H && HAVE_ZSTD_compressStream
ZSTD_freeCStream(data->cstream);
free(data->out.dst);
#else
@@ -147,29 +175,54 @@ archive_compressor_zstd_free(struct archive_write_filter *f)
return (ARCHIVE_OK);
}
-static int string_is_numeric (const char* value)
+static int
+string_to_number(const char *string, intmax_t *numberp)
{
- size_t len = strlen(value);
- size_t i;
-
- if (len == 0) {
- return (ARCHIVE_WARN);
- }
- else if (len == 1 && !(value[0] >= '0' && value[0] <= '9')) {
- return (ARCHIVE_WARN);
- }
- else if (!(value[0] >= '0' && value[0] <= '9') &&
- value[0] != '-' && value[0] != '+') {
- return (ARCHIVE_WARN);
- }
-
- for (i = 1; i < len; i++) {
- if (!(value[i] >= '0' && value[i] <= '9')) {
- return (ARCHIVE_WARN);
- }
- }
-
- return (ARCHIVE_OK);
+ char *end;
+
+ if (string == NULL || *string == '\0')
+ return (ARCHIVE_WARN);
+ *numberp = strtoimax(string, &end, 10);
+ if (end == string || *end != '\0' || errno == EOVERFLOW) {
+ *numberp = 0;
+ return (ARCHIVE_WARN);
+ }
+ return (ARCHIVE_OK);
+}
+
+static int
+string_to_size(const char *string, size_t *numberp)
+{
+ uintmax_t number;
+ char *end;
+ unsigned int shift = 0;
+
+ if (string == NULL || *string == '\0' || *string == '-')
+ return (ARCHIVE_WARN);
+ number = strtoumax(string, &end, 10);
+ if (end > string) {
+ if (*end == 'K' || *end == 'k') {
+ shift = 10;
+ end++;
+ } else if (*end == 'M' || *end == 'm') {
+ shift = 20;
+ end++;
+ } else if (*end == 'G' || *end == 'g') {
+ shift = 30;
+ end++;
+ }
+ if (*end == 'B' || *end == 'b') {
+ end++;
+ }
+ }
+ if (end == string || *end != '\0' || errno == EOVERFLOW) {
+ return (ARCHIVE_WARN);
+ }
+ if (number > (uintmax_t)SIZE_MAX >> shift) {
+ return (ARCHIVE_WARN);
+ }
+ *numberp = (size_t)(number << shift);
+ return (ARCHIVE_OK);
}
/*
@@ -182,14 +235,14 @@ archive_compressor_zstd_options(struct archive_write_filter *f, const char *key,
struct private_data *data = (struct private_data *)f->data;
if (strcmp(key, "compression-level") == 0) {
- int level = atoi(value);
+ intmax_t level;
+ if (string_to_number(value, &level) != ARCHIVE_OK) {
+ return (ARCHIVE_WARN);
+ }
/* If we don't have the library, hard-code the max level */
int minimum = CLEVEL_MIN;
int maximum = CLEVEL_MAX;
- if (string_is_numeric(value) != ARCHIVE_OK) {
- return (ARCHIVE_WARN);
- }
-#if HAVE_ZSTD_H && HAVE_LIBZSTD_COMPRESSOR
+#if HAVE_ZSTD_H && HAVE_ZSTD_compressStream
maximum = ZSTD_maxCLevel();
#if ZSTD_VERSION_NUMBER >= MINVER_MINCLEVEL
if (ZSTD_versionNumber() >= MINVER_MINCLEVEL) {
@@ -204,21 +257,69 @@ archive_compressor_zstd_options(struct archive_write_filter *f, const char *key,
if (level < minimum || level > maximum) {
return (ARCHIVE_WARN);
}
- data->compression_level = level;
+ data->compression_level = (int)level;
return (ARCHIVE_OK);
} else if (strcmp(key, "threads") == 0) {
- int threads = atoi(value);
- if (string_is_numeric(value) != ARCHIVE_OK) {
+ intmax_t threads;
+ if (string_to_number(value, &threads) != ARCHIVE_OK) {
return (ARCHIVE_WARN);
}
-
- int minimum = 0;
-
- if (threads < minimum) {
+ if (threads < 0) {
return (ARCHIVE_WARN);
}
-
- data->threads = threads;
+ data->threads = (int)threads;
+ return (ARCHIVE_OK);
+#if HAVE_ZSTD_H && HAVE_ZSTD_compressStream
+ } else if (strcmp(key, "frame-per-file") == 0) {
+ data->frame_per_file = 1;
+ return (ARCHIVE_OK);
+ } else if (strcmp(key, "min-frame-in") == 0) {
+ if (string_to_size(value, &data->min_frame_in) != ARCHIVE_OK) {
+ return (ARCHIVE_WARN);
+ }
+ return (ARCHIVE_OK);
+ } else if (strcmp(key, "min-frame-out") == 0 ||
+ strcmp(key, "min-frame-size") == 0) {
+ if (string_to_size(value, &data->min_frame_out) != ARCHIVE_OK) {
+ return (ARCHIVE_WARN);
+ }
+ return (ARCHIVE_OK);
+ } else if (strcmp(key, "max-frame-in") == 0 ||
+ strcmp(key, "max-frame-size") == 0) {
+ if (string_to_size(value, &data->max_frame_in) != ARCHIVE_OK ||
+ data->max_frame_in < 1024) {
+ return (ARCHIVE_WARN);
+ }
+ return (ARCHIVE_OK);
+ } else if (strcmp(key, "max-frame-out") == 0) {
+ if (string_to_size(value, &data->max_frame_out) != ARCHIVE_OK ||
+ data->max_frame_out < 1024) {
+ return (ARCHIVE_WARN);
+ }
+ return (ARCHIVE_OK);
+#endif
+ }
+ else if (strcmp(key, "long") == 0) {
+ intmax_t long_distance;
+ if (string_to_number(value, &long_distance) != ARCHIVE_OK) {
+ return (ARCHIVE_WARN);
+ }
+#if HAVE_ZSTD_H && HAVE_ZSTD_compressStream && ZSTD_VERSION_NUMBER >= MINVER_LONG
+ ZSTD_bounds bounds = ZSTD_cParam_getBounds(ZSTD_c_windowLog);
+ if (ZSTD_isError(bounds.error)) {
+ int max_distance = ((int)(sizeof(size_t) == 4 ? 30 : 31));
+ if (((int)long_distance) < 10 || (int)long_distance > max_distance)
+ return (ARCHIVE_WARN);
+ } else {
+ if ((int)long_distance < bounds.lowerBound || (int)long_distance > bounds.upperBound)
+ return (ARCHIVE_WARN);
+ }
+#else
+ int max_distance = ((int)(sizeof(size_t) == 4 ? 30 : 31));
+ if (((int)long_distance) < 10 || (int)long_distance > max_distance)
+ return (ARCHIVE_WARN);
+#endif
+ data->long_distance = (int)long_distance;
return (ARCHIVE_OK);
}
@@ -228,7 +329,7 @@ archive_compressor_zstd_options(struct archive_write_filter *f, const char *key,
return (ARCHIVE_WARN);
}
-#if HAVE_ZSTD_H && HAVE_LIBZSTD_COMPRESSOR
+#if HAVE_ZSTD_H && HAVE_ZSTD_compressStream
/*
* Setup callback.
*/
@@ -270,6 +371,10 @@ archive_compressor_zstd_open(struct archive_write_filter *f)
ZSTD_CCtx_setParameter(data->cstream, ZSTD_c_nbWorkers, data->threads);
+#if ZSTD_VERSION_NUMBER >= MINVER_LONG
+ ZSTD_CCtx_setParameter(data->cstream, ZSTD_c_windowLog, data->long_distance);
+#endif
+
return (ARCHIVE_OK);
}
@@ -281,15 +386,25 @@ archive_compressor_zstd_write(struct archive_write_filter *f, const void *buff,
size_t length)
{
struct private_data *data = (struct private_data *)f->data;
- int ret;
- /* Update statistics */
- data->total_in += length;
+ return (drive_compressor(f, data, 0, buff, length));
+}
- if ((ret = drive_compressor(f, data, 0, buff, length)) != ARCHIVE_OK)
- return (ret);
+/*
+ * Flush the compressed stream.
+ */
+static int
+archive_compressor_zstd_flush(struct archive_write_filter *f)
+{
+ struct private_data *data = (struct private_data *)f->data;
- return (ARCHIVE_OK);
+ if (data->frame_per_file && data->state == running) {
+ if (data->cur_frame_in > data->min_frame_in &&
+ data->cur_frame_out > data->min_frame_out) {
+ data->state = finishing;
+ }
+ }
+ return (drive_compressor(f, data, 1, NULL, 0));
}
/*
@@ -300,60 +415,77 @@ archive_compressor_zstd_close(struct archive_write_filter *f)
{
struct private_data *data = (struct private_data *)f->data;
- /* Finish zstd frame */
- return drive_compressor(f, data, 1, NULL, 0);
+ if (data->state == running)
+ data->state = finishing;
+ return (drive_compressor(f, data, 1, NULL, 0));
}
/*
* Utility function to push input data through compressor,
* writing full output blocks as necessary.
- *
- * Note that this handles both the regular write case (finishing ==
- * false) and the end-of-archive case (finishing == true).
*/
static int
drive_compressor(struct archive_write_filter *f,
- struct private_data *data, int finishing, const void *src, size_t length)
+ struct private_data *data, int flush, const void *src, size_t length)
{
- ZSTD_inBuffer in = (ZSTD_inBuffer) { src, length, 0 };
+ ZSTD_inBuffer in = { .src = src, .size = length, .pos = 0 };
+ size_t ipos, opos, zstdret = 0;
+ int ret;
for (;;) {
- if (data->out.pos == data->out.size) {
- const int ret = __archive_write_filter(f->next_filter,
- data->out.dst, data->out.size);
- if (ret != ARCHIVE_OK)
- return (ARCHIVE_FATAL);
- data->out.pos = 0;
+ ipos = in.pos;
+ opos = data->out.pos;
+ switch (data->state) {
+ case running:
+ if (in.pos == in.size)
+ return (ARCHIVE_OK);
+ zstdret = ZSTD_compressStream(data->cstream,
+ &data->out, &in);
+ if (ZSTD_isError(zstdret))
+ goto zstd_fatal;
+ break;
+ case finishing:
+ zstdret = ZSTD_endStream(data->cstream, &data->out);
+ if (ZSTD_isError(zstdret))
+ goto zstd_fatal;
+ if (zstdret == 0)
+ data->state = resetting;
+ break;
+ case resetting:
+ ZSTD_CCtx_reset(data->cstream, ZSTD_reset_session_only);
+ data->cur_frame++;
+ data->cur_frame_in = 0;
+ data->cur_frame_out = 0;
+ data->state = running;
+ break;
}
-
- /* If there's nothing to do, we're done. */
- if (!finishing && in.pos == in.size)
- return (ARCHIVE_OK);
-
- {
- const size_t zstdret = !finishing ?
- ZSTD_compressStream(data->cstream, &data->out, &in)
- : ZSTD_endStream(data->cstream, &data->out);
-
- if (ZSTD_isError(zstdret)) {
- archive_set_error(f->archive,
- ARCHIVE_ERRNO_MISC,
- "Zstd compression failed: %s",
- ZSTD_getErrorName(zstdret));
- return (ARCHIVE_FATAL);
- }
-
- /* If we're finishing, 0 means nothing left to flush */
- if (finishing && zstdret == 0) {
- const int ret = __archive_write_filter(f->next_filter,
- data->out.dst, data->out.pos);
- return (ret);
+ data->total_in += in.pos - ipos;
+ data->cur_frame_in += in.pos - ipos;
+ data->cur_frame_out += data->out.pos - opos;
+ if (data->state == running) {
+ if (data->cur_frame_in >= data->max_frame_in ||
+ data->cur_frame_out >= data->max_frame_out) {
+ data->state = finishing;
}
}
+ if (data->out.pos == data->out.size ||
+ (flush && data->out.pos > 0)) {
+ ret = __archive_write_filter(f->next_filter,
+ data->out.dst, data->out.pos);
+ if (ret != ARCHIVE_OK)
+ goto fatal;
+ data->out.pos = 0;
+ }
}
+zstd_fatal:
+ archive_set_error(f->archive, ARCHIVE_ERRNO_MISC,
+ "Zstd compression failed: %s",
+ ZSTD_getErrorName(zstdret));
+fatal:
+ return (ARCHIVE_FATAL);
}
-#else /* HAVE_ZSTD_H && HAVE_LIBZSTD_COMPRESSOR */
+#else /* HAVE_ZSTD_H && HAVE_ZSTD_compressStream */
static int
archive_compressor_zstd_open(struct archive_write_filter *f)
@@ -367,17 +499,9 @@ archive_compressor_zstd_open(struct archive_write_filter *f)
archive_strcpy(&as, "zstd --no-check");
if (data->compression_level < CLEVEL_STD_MIN) {
- struct archive_string as2;
- archive_string_init(&as2);
- archive_string_sprintf(&as2, " --fast=%d", -data->compression_level);
- archive_string_concat(&as, &as2);
- archive_string_free(&as2);
+ archive_string_sprintf(&as, " --fast=%d", -data->compression_level);
} else {
- struct archive_string as2;
- archive_string_init(&as2);
- archive_string_sprintf(&as2, " -%d", data->compression_level);
- archive_string_concat(&as, &as2);
- archive_string_free(&as2);
+ archive_string_sprintf(&as, " -%d", data->compression_level);
}
if (data->compression_level > CLEVEL_STD_MAX) {
@@ -385,11 +509,11 @@ archive_compressor_zstd_open(struct archive_write_filter *f)
}
if (data->threads != 0) {
- struct archive_string as2;
- archive_string_init(&as2);
- archive_string_sprintf(&as2, " --threads=%d", data->threads);
- archive_string_concat(&as, &as2);
- archive_string_free(&as2);
+ archive_string_sprintf(&as, " --threads=%d", data->threads);
+ }
+
+ if (data->long_distance != 0) {
+ archive_string_sprintf(&as, " --long=%d", data->long_distance);
}
f->write = archive_compressor_zstd_write;
@@ -408,6 +532,14 @@ archive_compressor_zstd_write(struct archive_write_filter *f, const void *buff,
}
static int
+archive_compressor_zstd_flush(struct archive_write_filter *f)
+{
+ (void)f; /* UNUSED */
+
+ return (ARCHIVE_OK);
+}
+
+static int
archive_compressor_zstd_close(struct archive_write_filter *f)
{
struct private_data *data = (struct private_data *)f->data;
@@ -415,4 +547,4 @@ archive_compressor_zstd_close(struct archive_write_filter *f)
return __archive_write_program_close(f, data->pdata);
}
-#endif /* HAVE_ZSTD_H && HAVE_LIBZSTD_COMPRESSOR */
+#endif /* HAVE_ZSTD_H && HAVE_ZSTD_compressStream */
diff --git a/libarchive/archive_write_blocksize.3 b/libarchive/archive_write_blocksize.3
index 4973f9990566..3508851cefab 100644
--- a/libarchive/archive_write_blocksize.3
+++ b/libarchive/archive_write_blocksize.3
@@ -22,8 +22,6 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $FreeBSD$
-.\"
.Dd February 2, 2012
.Dt ARCHIVE_WRITE_BLOCKSIZE 3
.Os
diff --git a/libarchive/archive_write_data.3 b/libarchive/archive_write_data.3
index bc208b45d53a..9f239f7c9ece 100644
--- a/libarchive/archive_write_data.3
+++ b/libarchive/archive_write_data.3
@@ -22,8 +22,6 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $FreeBSD$
-.\"
.Dd February 28, 2017
.Dt ARCHIVE_WRITE_DATA 3
.Os
diff --git a/libarchive/archive_write_disk.3 b/libarchive/archive_write_disk.3
index 97f3fcde9f88..b046168c338c 100644
--- a/libarchive/archive_write_disk.3
+++ b/libarchive/archive_write_disk.3
@@ -22,8 +22,6 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $FreeBSD$
-.\"
.Dd January 19, 2020
.Dt ARCHIVE_WRITE_DISK 3
.Os
diff --git a/libarchive/archive_write_disk_posix.c b/libarchive/archive_write_disk_posix.c
index dd7eb9a5e840..58265ee0dc11 100644
--- a/libarchive/archive_write_disk_posix.c
+++ b/libarchive/archive_write_disk_posix.c
@@ -26,7 +26,6 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD$");
#if !defined(_WIN32) || defined(__CYGWIN__)
@@ -397,6 +396,7 @@ static int set_times_from_entry(struct archive_write_disk *);
static struct fixup_entry *sort_dir_list(struct fixup_entry *p);
static ssize_t write_data_block(struct archive_write_disk *,
const char *, size_t);
+static void close_file_descriptor(struct archive_write_disk *);
static int _archive_write_disk_close(struct archive *);
static int _archive_write_disk_free(struct archive *);
@@ -514,7 +514,12 @@ lazy_stat(struct archive_write_disk *a)
* XXX At this point, symlinks should not be hit, otherwise
* XXX a race occurred. Do we want to check explicitly for that?
*/
- if (lstat(a->name, &a->st) == 0) {
+#ifdef HAVE_LSTAT
+ if (lstat(a->name, &a->st) == 0)
+#else
+ if (la_stat(a->name, &a->st) == 0)
+#endif
+ {
a->pst = &a->st;
return (ARCHIVE_OK);
}
@@ -1605,12 +1610,12 @@ hfs_write_data_block(struct archive_write_disk *a, const char *buff,
"Seek failed");
return (ARCHIVE_FATAL);
} else if (a->offset > a->fd_offset) {
- int64_t skip = a->offset - a->fd_offset;
+ uint64_t skip = a->offset - a->fd_offset;
char nullblock[1024];
memset(nullblock, 0, sizeof(nullblock));
while (skip > 0) {
- if (skip > (int64_t)sizeof(nullblock))
+ if (skip > sizeof(nullblock))
bytes_written = hfs_write_decmpfs_block(
a, nullblock, sizeof(nullblock));
else
@@ -1725,8 +1730,10 @@ _archive_write_disk_finish_entry(struct archive *_a)
else
r = hfs_write_data_block(
a, null_d, a->file_remaining_bytes);
- if (r < 0)
+ if (r < 0) {
+ close_file_descriptor(a);
return ((int)r);
+ }
}
#endif
} else {
@@ -1735,6 +1742,7 @@ _archive_write_disk_finish_entry(struct archive *_a)
a->filesize == 0) {
archive_set_error(&a->archive, errno,
"File size could not be restored");
+ close_file_descriptor(a);
return (ARCHIVE_FAILED);
}
#endif
@@ -1744,8 +1752,10 @@ _archive_write_disk_finish_entry(struct archive *_a)
* to see what happened.
*/
a->pst = NULL;
- if ((ret = lazy_stat(a)) != ARCHIVE_OK)
- return (ret);
+ if ((ret = lazy_stat(a)) != ARCHIVE_OK) {
+ close_file_descriptor(a);
+ return (ret);
+ }
/* We can use lseek()/write() to extend the file if
* ftruncate didn't work or isn't available. */
if (a->st.st_size < a->filesize) {
@@ -1753,11 +1763,13 @@ _archive_write_disk_finish_entry(struct archive *_a)
if (lseek(a->fd, a->filesize - 1, SEEK_SET) < 0) {
archive_set_error(&a->archive, errno,
"Seek failed");
+ close_file_descriptor(a);
return (ARCHIVE_FATAL);
}
if (write(a->fd, &nul, 1) < 0) {
archive_set_error(&a->archive, errno,
"Write to restore size failed");
+ close_file_descriptor(a);
return (ARCHIVE_FATAL);
}
a->pst = NULL;
@@ -1996,6 +2008,8 @@ archive_write_disk_new(void)
free(a);
return (NULL);
}
+ a->path_safe.s[0] = 0;
+
#ifdef HAVE_ZLIB_H
a->decmpfs_compression_level = 5;
#endif
@@ -2152,7 +2166,11 @@ restore_entry(struct archive_write_disk *a)
* then don't follow it.
*/
if (r != 0 || !S_ISDIR(a->mode))
+#ifdef HAVE_LSTAT
r = lstat(a->name, &a->st);
+#else
+ r = la_stat(a->name, &a->st);
+#endif
if (r != 0) {
archive_set_error(&a->archive, errno,
"Can't stat existing object");
@@ -2548,7 +2566,12 @@ _archive_write_disk_close(struct archive *_a)
goto skip_fixup_entry;
} else
#endif
- if (lstat(p->name, &st) != 0 ||
+ if (
+#ifdef HAVE_LSTAT
+ lstat(p->name, &st) != 0 ||
+#else
+ la_stat(p->name, &st) != 0 ||
+#endif
la_verify_filetype(st.st_mode,
p->filetype) == 0) {
goto skip_fixup_entry;
@@ -2563,7 +2586,12 @@ _archive_write_disk_close(struct archive *_a)
goto skip_fixup_entry;
} else
#endif
- if (lstat(p->name, &st) != 0 ||
+ if (
+#ifdef HAVE_LSTAT
+ lstat(p->name, &st) != 0 ||
+#else
+ la_stat(p->name, &st) != 0 ||
+#endif
la_verify_filetype(st.st_mode,
p->filetype) == 0) {
goto skip_fixup_entry;
@@ -2783,8 +2811,8 @@ check_symlinks_fsobj(char *path, int *a_eno, struct archive_string *a_estr,
!(defined(HAVE_OPENAT) && defined(HAVE_FSTATAT) && defined(HAVE_UNLINKAT))
/* Platform doesn't have lstat, so we can't look for symlinks. */
(void)path; /* UNUSED */
- (void)error_number; /* UNUSED */
- (void)error_string; /* UNUSED */
+ (void)a_eno; /* UNUSED */
+ (void)a_estr; /* UNUSED */
(void)flags; /* UNUSED */
(void)checking_linkname; /* UNUSED */
return (ARCHIVE_OK);
@@ -2793,7 +2821,7 @@ check_symlinks_fsobj(char *path, int *a_eno, struct archive_string *a_estr,
char *tail;
char *head;
int last;
- char c;
+ char c = '\0';
int r;
struct stat st;
int chdir_fd;
@@ -2857,8 +2885,10 @@ check_symlinks_fsobj(char *path, int *a_eno, struct archive_string *a_estr,
/* Check that we haven't hit a symlink. */
#if defined(HAVE_OPENAT) && defined(HAVE_FSTATAT) && defined(HAVE_UNLINKAT)
r = fstatat(chdir_fd, head, &st, AT_SYMLINK_NOFOLLOW);
-#else
+#elif defined(HAVE_LSTAT)
r = lstat(head, &st);
+#else
+ r = la_stat(head, &st);
#endif
if (r != 0) {
tail[0] = c;
@@ -3556,7 +3586,9 @@ set_time(int fd, int mode, const char *name,
(void)fd; /* UNUSED */
(void)mode; /* UNUSED */
(void)name; /* UNUSED */
+ (void)atime; /* UNUSED */
(void)atime_nsec; /* UNUSED */
+ (void)mtime; /* UNUSED */
(void)mtime_nsec; /* UNUSED */
return (ARCHIVE_WARN);
#endif
@@ -4389,7 +4421,12 @@ fixup_appledouble(struct archive_write_disk *a, const char *pathname)
*/
archive_strncpy(&datafork, pathname, p - pathname);
archive_strcat(&datafork, p + 2);
- if (lstat(datafork.s, &st) == -1 ||
+ if (
+#ifdef HAVE_LSTAT
+ lstat(datafork.s, &st) == -1 ||
+#else
+ la_stat(datafork.s, &st) == -1 ||
+#endif
(st.st_mode & AE_IFMT) != AE_IFREG)
goto skip_appledouble;
@@ -4705,5 +4742,17 @@ archive_write_disk_set_acls(struct archive *a, int fd, const char *name,
}
#endif
+/*
+ * Close the file descriptor if one is open.
+ */
+static void close_file_descriptor(struct archive_write_disk* a)
+{
+ if (a->fd >= 0) {
+ close(a->fd);
+ a->fd = -1;
+ }
+}
+
+
#endif /* !_WIN32 || __CYGWIN__ */
diff --git a/libarchive/archive_write_disk_private.h b/libarchive/archive_write_disk_private.h
index 557d7e2bf34f..3efe2bad336a 100644
--- a/libarchive/archive_write_disk_private.h
+++ b/libarchive/archive_write_disk_private.h
@@ -22,8 +22,6 @@
* 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: head/lib/libarchive/archive_write_disk_private.h 201086 2009-12-28 02:17:53Z kientzle $
*/
#ifndef ARCHIVE_WRITE_DISK_PRIVATE_H_INCLUDED
diff --git a/libarchive/archive_write_disk_set_standard_lookup.c b/libarchive/archive_write_disk_set_standard_lookup.c
index 5fccdb9dc658..964169898e45 100644
--- a/libarchive/archive_write_disk_set_standard_lookup.c
+++ b/libarchive/archive_write_disk_set_standard_lookup.c
@@ -24,7 +24,6 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/archive_write_disk_set_standard_lookup.c 201083 2009-12-28 02:09:57Z kientzle $");
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
diff --git a/libarchive/archive_write_disk_windows.c b/libarchive/archive_write_disk_windows.c
index 1b12a299ca23..774151ae22b9 100644
--- a/libarchive/archive_write_disk_windows.c
+++ b/libarchive/archive_write_disk_windows.c
@@ -26,7 +26,6 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD$");
#if defined(_WIN32) && !defined(__CYGWIN__)
@@ -254,9 +253,9 @@ static ssize_t _archive_write_disk_data_block(struct archive *, const void *,
* which is high-16-bits of nFileIndexHigh. */
#define bhfi_ino(bhfi) \
((((int64_t)((bhfi)->nFileIndexHigh & 0x0000FFFFUL)) << 32) \
- + (bhfi)->nFileIndexLow)
+ | (bhfi)->nFileIndexLow)
#define bhfi_size(bhfi) \
- ((((int64_t)(bhfi)->nFileSizeHigh) << 32) + (bhfi)->nFileSizeLow)
+ ((((int64_t)(bhfi)->nFileSizeHigh) << 32) | (bhfi)->nFileSizeLow)
static int
file_information(struct archive_write_disk *a, wchar_t *path,
@@ -266,6 +265,9 @@ file_information(struct archive_write_disk *a, wchar_t *path,
int r;
DWORD flag = FILE_FLAG_BACKUP_SEMANTICS;
WIN32_FIND_DATAW findData;
+# if _WIN32_WINNT >= 0x0602 /* _WIN32_WINNT_WIN8 */
+ CREATEFILE2_EXTENDED_PARAMETERS createExParams;
+#endif
if (sim_lstat || mode != NULL) {
h = FindFirstFileW(path, &findData);
@@ -290,14 +292,27 @@ file_information(struct archive_write_disk *a, wchar_t *path,
(findData.dwReserved0 == IO_REPARSE_TAG_SYMLINK)))
flag |= FILE_FLAG_OPEN_REPARSE_POINT;
+# if _WIN32_WINNT >= 0x0602 /* _WIN32_WINNT_WIN8 */
+ ZeroMemory(&createExParams, sizeof(createExParams));
+ createExParams.dwSize = sizeof(createExParams);
+ createExParams.dwFileFlags = flag;
+ h = CreateFile2(a->name, 0, 0,
+ OPEN_EXISTING, &createExParams);
+#else
h = CreateFileW(a->name, 0, 0, NULL,
OPEN_EXISTING, flag, NULL);
+#endif
if (h == INVALID_HANDLE_VALUE &&
GetLastError() == ERROR_INVALID_NAME) {
wchar_t *full;
full = __la_win_permissive_name_w(path);
+# if _WIN32_WINNT >= 0x0602 /* _WIN32_WINNT_WIN8 */
+ h = CreateFile2(full, 0, 0,
+ OPEN_EXISTING, &createExParams);
+#else
h = CreateFileW(full, 0, 0, NULL,
OPEN_EXISTING, flag, NULL);
+#endif
free(full);
}
if (h == INVALID_HANDLE_VALUE) {
@@ -559,6 +574,7 @@ la_mktemp(struct archive_write_disk *a)
return (fd);
}
+#if _WIN32_WINNT < _WIN32_WINNT_VISTA
static void *
la_GetFunctionKernel32(const char *name)
{
@@ -574,18 +590,24 @@ la_GetFunctionKernel32(const char *name)
}
return (void *)GetProcAddress(lib, name);
}
+#endif
static int
la_CreateHardLinkW(wchar_t *linkname, wchar_t *target)
{
- static BOOLEAN (WINAPI *f)(LPWSTR, LPWSTR, LPSECURITY_ATTRIBUTES);
- static int set;
+ static BOOL (WINAPI *f)(LPCWSTR, LPCWSTR, LPSECURITY_ATTRIBUTES);
BOOL ret;
+#if _WIN32_WINNT < _WIN32_WINNT_XP
+ static int set;
+/* CreateHardLinkW is available since XP and always loaded */
if (!set) {
set = 1;
f = la_GetFunctionKernel32("CreateHardLinkW");
}
+#else
+ f = CreateHardLinkW;
+#endif
if (!f) {
errno = ENOTSUP;
return (0);
@@ -624,7 +646,6 @@ static int
la_CreateSymbolicLinkW(const wchar_t *linkname, const wchar_t *target,
int linktype) {
static BOOLEAN (WINAPI *f)(LPCWSTR, LPCWSTR, DWORD);
- static int set;
wchar_t *ttarget, *p;
size_t len;
DWORD attrs = 0;
@@ -632,10 +653,20 @@ la_CreateSymbolicLinkW(const wchar_t *linkname, const wchar_t *target,
DWORD newflags = 0;
BOOL ret = 0;
+#if _WIN32_WINNT < _WIN32_WINNT_VISTA
+/* CreateSymbolicLinkW is available since Vista and always loaded */
+ static int set;
if (!set) {
set = 1;
f = la_GetFunctionKernel32("CreateSymbolicLinkW");
}
+#else
+# if !defined(WINAPI_FAMILY_PARTITION) || WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
+ f = CreateSymbolicLinkW;
+# else
+ f = NULL;
+# endif
+#endif
if (!f)
return (0);
@@ -1185,6 +1216,8 @@ _archive_write_disk_finish_entry(struct archive *_a)
if (la_ftruncate(a->fh, a->filesize) == -1) {
archive_set_error(&a->archive, errno,
"File size could not be restored");
+ CloseHandle(a->fh);
+ a->fh = INVALID_HANDLE_VALUE;
return (ARCHIVE_FAILED);
}
}
@@ -1370,6 +1403,7 @@ archive_write_disk_new(void)
free(a);
return (NULL);
}
+ a->path_safe.s[0] = 0;
return (&a->archive);
}
@@ -1655,6 +1689,9 @@ create_filesystem_object(struct archive_write_disk *a)
mode_t final_mode, mode;
int r;
DWORD attrs = 0;
+# if _WIN32_WINNT >= 0x0602 /* _WIN32_WINNT_WIN8 */
+ CREATEFILE2_EXTENDED_PARAMETERS createExParams;
+#endif
/* We identify hard/symlinks according to the link names. */
/* Since link(2) and symlink(2) don't handle modes, we're done here. */
@@ -1718,8 +1755,16 @@ create_filesystem_object(struct archive_write_disk *a)
a->todo = 0;
a->deferred = 0;
} else if (r == 0 && a->filesize > 0) {
+# if _WIN32_WINNT >= 0x0602 /* _WIN32_WINNT_WIN8 */
+ ZeroMemory(&createExParams, sizeof(createExParams));
+ createExParams.dwSize = sizeof(createExParams);
+ createExParams.dwFileAttributes = FILE_ATTRIBUTE_NORMAL;
+ a->fh = CreateFile2(namefull, GENERIC_WRITE, 0,
+ TRUNCATE_EXISTING, &createExParams);
+#else
a->fh = CreateFileW(namefull, GENERIC_WRITE, 0, NULL,
TRUNCATE_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
+#endif
if (a->fh == INVALID_HANDLE_VALUE) {
la_dosmaperr(GetLastError());
r = errno;
@@ -1782,14 +1827,27 @@ create_filesystem_object(struct archive_write_disk *a)
a->tmpname = NULL;
fullname = a->name;
/* O_WRONLY | O_CREAT | O_EXCL */
+# if _WIN32_WINNT >= 0x0602 /* _WIN32_WINNT_WIN8 */
+ ZeroMemory(&createExParams, sizeof(createExParams));
+ createExParams.dwSize = sizeof(createExParams);
+ createExParams.dwFileAttributes = FILE_ATTRIBUTE_NORMAL;
+ a->fh = CreateFile2(fullname, GENERIC_WRITE, 0,
+ CREATE_NEW, &createExParams);
+#else
a->fh = CreateFileW(fullname, GENERIC_WRITE, 0, NULL,
CREATE_NEW, FILE_ATTRIBUTE_NORMAL, NULL);
+#endif
if (a->fh == INVALID_HANDLE_VALUE &&
GetLastError() == ERROR_INVALID_NAME &&
fullname == a->name) {
fullname = __la_win_permissive_name_w(a->name);
+# if _WIN32_WINNT >= 0x0602 /* _WIN32_WINNT_WIN8 */
+ a->fh = CreateFile2(fullname, GENERIC_WRITE, 0,
+ CREATE_NEW, &createExParams);
+#else
a->fh = CreateFileW(fullname, GENERIC_WRITE, 0, NULL,
CREATE_NEW, FILE_ATTRIBUTE_NORMAL, NULL);
+#endif
}
if (a->fh == INVALID_HANDLE_VALUE) {
if (GetLastError() == ERROR_ACCESS_DENIED) {
@@ -2154,6 +2212,8 @@ check_symlinks(struct archive_write_disk *a)
return (ARCHIVE_FAILED);
}
}
+ if (!c)
+ break;
pn[0] = c;
pn++;
}
@@ -2258,6 +2318,9 @@ cleanup_pathname(struct archive_write_disk *a, wchar_t *name)
return (ARCHIVE_FAILED);
} else
p += 4;
+ /* Network drive path like "\\<server-name>\<share-name>\file" */
+ } else if (p[0] == L'\\' && p[1] == L'\\') {
+ p += 2;
}
/* Skip leading drive letter from archives created
@@ -2531,7 +2594,7 @@ set_times(struct archive_write_disk *a,
{
#define EPOC_TIME ARCHIVE_LITERAL_ULL(116444736000000000)
#define WINTIME(sec, nsec) ((Int32x32To64(sec, 10000000) + EPOC_TIME)\
- + (((nsec)/1000)*10))
+ + ((nsec)/100))
HANDLE hw = 0;
ULARGE_INTEGER wintm;
@@ -2545,14 +2608,25 @@ set_times(struct archive_write_disk *a,
hw = NULL;
} else {
wchar_t *ws;
+# if _WIN32_WINNT >= 0x0602 /* _WIN32_WINNT_WIN8 */
+ CREATEFILE2_EXTENDED_PARAMETERS createExParams;
+#endif
if (S_ISLNK(mode))
return (ARCHIVE_OK);
ws = __la_win_permissive_name_w(name);
if (ws == NULL)
goto settimes_failed;
+# if _WIN32_WINNT >= 0x0602 /* _WIN32_WINNT_WIN8 */
+ ZeroMemory(&createExParams, sizeof(createExParams));
+ createExParams.dwSize = sizeof(createExParams);
+ createExParams.dwFileFlags = FILE_FLAG_BACKUP_SEMANTICS;
+ hw = CreateFile2(ws, FILE_WRITE_ATTRIBUTES, 0,
+ OPEN_EXISTING, &createExParams);
+#else
hw = CreateFileW(ws, FILE_WRITE_ATTRIBUTES,
0, NULL, OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL);
+#endif
free(ws);
if (hw == INVALID_HANDLE_VALUE)
goto settimes_failed;
diff --git a/libarchive/archive_write_filter.3 b/libarchive/archive_write_filter.3
index c83eb77b6a5e..b39cabe04782 100644
--- a/libarchive/archive_write_filter.3
+++ b/libarchive/archive_write_filter.3
@@ -22,8 +22,6 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $FreeBSD$
-.\"
.Dd August 14, 2014
.Dt ARCHIVE_WRITE_FILTER 3
.Os
diff --git a/libarchive/archive_write_finish_entry.3 b/libarchive/archive_write_finish_entry.3
index 5797e16a6dbc..574d6008581e 100644
--- a/libarchive/archive_write_finish_entry.3
+++ b/libarchive/archive_write_finish_entry.3
@@ -22,8 +22,6 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $FreeBSD$
-.\"
.Dd February 28, 2017
.Dt ARCHIVE_WRITE_FINISH_ENTRY 3
.Os
diff --git a/libarchive/archive_write_format.3 b/libarchive/archive_write_format.3
index 653089f7795d..9e331368aeef 100644
--- a/libarchive/archive_write_format.3
+++ b/libarchive/archive_write_format.3
@@ -22,8 +22,6 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $FreeBSD$
-.\"
.Dd February 14, 2013
.Dt ARCHIVE_WRITE_FORMAT 3
.Os
diff --git a/libarchive/archive_write_free.3 b/libarchive/archive_write_free.3
index 5210e2a633de..f6b84eae918f 100644
--- a/libarchive/archive_write_free.3
+++ b/libarchive/archive_write_free.3
@@ -22,8 +22,6 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $FreeBSD$
-.\"
.Dd February 2, 2012
.Dt ARCHIVE_WRITE_FREE 3
.Os
diff --git a/libarchive/archive_write_header.3 b/libarchive/archive_write_header.3
index 2217b1871bba..9c6ecec4e097 100644
--- a/libarchive/archive_write_header.3
+++ b/libarchive/archive_write_header.3
@@ -22,8 +22,6 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $FreeBSD$
-.\"
.Dd February 2, 2012
.Dt ARCHIVE_WRITE_HEADER 3
.Os
diff --git a/libarchive/archive_write_new.3 b/libarchive/archive_write_new.3
index 788cbb855985..15a7c40703bf 100644
--- a/libarchive/archive_write_new.3
+++ b/libarchive/archive_write_new.3
@@ -22,8 +22,6 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $FreeBSD$
-.\"
.Dd February 2, 2012
.Dt ARCHIVE_WRITE_NEW 3
.Os
diff --git a/libarchive/archive_write_open.3 b/libarchive/archive_write_open.3
index 29bffe49eb97..b12d097028c0 100644
--- a/libarchive/archive_write_open.3
+++ b/libarchive/archive_write_open.3
@@ -22,8 +22,6 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $FreeBSD$
-.\"
.Dd November 12, 2020
.Dt ARCHIVE_WRITE_OPEN 3
.Os
@@ -218,6 +216,7 @@ On failure, the callback should invoke
.Fn archive_set_error
to register an error code and message and
return
+.Cm ARCHIVE_FATAL .
.Bl -item -offset indent
.It
.Ft typedef int
diff --git a/libarchive/archive_write_open_fd.c b/libarchive/archive_write_open_fd.c
index b8d491faa273..a58ae047967b 100644
--- a/libarchive/archive_write_open_fd.c
+++ b/libarchive/archive_write_open_fd.c
@@ -24,7 +24,6 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/archive_write_open_fd.c 201093 2009-12-28 02:28:44Z kientzle $");
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
diff --git a/libarchive/archive_write_open_file.c b/libarchive/archive_write_open_file.c
index bf5b55a672e9..d787da3af388 100644
--- a/libarchive/archive_write_open_file.c
+++ b/libarchive/archive_write_open_file.c
@@ -24,7 +24,6 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/archive_write_open_file.c,v 1.19 2007/01/09 08:05:56 kientzle Exp $");
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
diff --git a/libarchive/archive_write_open_filename.c b/libarchive/archive_write_open_filename.c
index 9ceefb19bc9d..7dc73d55f43e 100644
--- a/libarchive/archive_write_open_filename.c
+++ b/libarchive/archive_write_open_filename.c
@@ -24,7 +24,6 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/archive_write_open_filename.c 191165 2009-04-17 00:39:35Z kientzle $");
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
diff --git a/libarchive/archive_write_open_memory.c b/libarchive/archive_write_open_memory.c
index a8a0b817fc25..609cc47d964a 100644
--- a/libarchive/archive_write_open_memory.c
+++ b/libarchive/archive_write_open_memory.c
@@ -24,7 +24,6 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/archive_write_open_memory.c,v 1.3 2007/01/09 08:05:56 kientzle Exp $");
#include <errno.h>
#include <stdlib.h>
diff --git a/libarchive/archive_write_private.h b/libarchive/archive_write_private.h
index 155fdd734887..abd5a8ddcd85 100644
--- a/libarchive/archive_write_private.h
+++ b/libarchive/archive_write_private.h
@@ -21,8 +21,6 @@
* 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: head/lib/libarchive/archive_write_private.h 201155 2009-12-29 05:20:12Z kientzle $
*/
#ifndef ARCHIVE_WRITE_PRIVATE_H_INCLUDED
@@ -53,6 +51,7 @@ struct archive_write_filter {
const char *key, const char *value);
int (*open)(struct archive_write_filter *);
int (*write)(struct archive_write_filter *, const void *, size_t);
+ int (*flush)(struct archive_write_filter *);
int (*close)(struct archive_write_filter *);
int (*free)(struct archive_write_filter *);
void *data;
diff --git a/libarchive/archive_write_set_format.c b/libarchive/archive_write_set_format.c
index 1f65fa4a77eb..f636cff74714 100644
--- a/libarchive/archive_write_set_format.c
+++ b/libarchive/archive_write_set_format.c
@@ -24,7 +24,6 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/archive_write_set_format.c 201168 2009-12-29 06:15:32Z kientzle $");
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
diff --git a/libarchive/archive_write_set_format_7zip.c b/libarchive/archive_write_set_format_7zip.c
index d5ca9a665654..c0ea9d6b1548 100644
--- a/libarchive/archive_write_set_format_7zip.c
+++ b/libarchive/archive_write_set_format_7zip.c
@@ -24,7 +24,6 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD$");
#ifdef HAVE_ERRNO_H
#include <errno.h>
@@ -91,6 +90,26 @@ __FBSDID("$FreeBSD$");
#define kAttributes 0x15
#define kEncodedHeader 0x17
+// Check that some windows file attribute constants are defined.
+// Reference: https://learn.microsoft.com/en-us/windows/win32/fileio/file-attribute-constants
+#ifndef FILE_ATTRIBUTE_READONLY
+#define FILE_ATTRIBUTE_READONLY 0x00000001
+#endif
+
+#ifndef FILE_ATTRIBUTE_DIRECTORY
+#define FILE_ATTRIBUTE_DIRECTORY 0x00000010
+#endif
+
+#ifndef FILE_ATTRIBUTE_ARCHIVE
+#define FILE_ATTRIBUTE_ARCHIVE 0x00000020
+#endif
+
+// This value is defined in 7zip with the comment "trick for Unix".
+//
+// 7z archives created on unix have this bit set in the high 16 bits of
+// the attr field along with the unix permissions.
+#define FILE_ATTRIBUTE_UNIX_EXTENSION 0x8000
+
enum la_zaction {
ARCHIVE_Z_FINISH,
ARCHIVE_Z_RUN
@@ -165,7 +184,7 @@ struct file {
mode_t mode;
uint32_t crc32;
- signed int dir:1;
+ unsigned dir:1;
};
struct _7zip {
@@ -1424,14 +1443,19 @@ make_header(struct archive_write *a, uint64_t offset, uint64_t pack_size,
* High 16bits is unix mode.
* Low 16bits is Windows attributes.
*/
- uint32_t encattr, attr;
+ uint32_t encattr, attr = 0;
+
if (file->dir)
- attr = 0x8010;
+ attr |= FILE_ATTRIBUTE_DIRECTORY;
else
- attr = 0x8020;
+ attr |= FILE_ATTRIBUTE_ARCHIVE;
+
if ((file->mode & 0222) == 0)
- attr |= 1;/* Read Only. */
+ attr |= FILE_ATTRIBUTE_READONLY;
+
+ attr |= FILE_ATTRIBUTE_UNIX_EXTENSION;
attr |= ((uint32_t)file->mode) << 16;
+
archive_le32enc(&encattr, attr);
r = (int)compress_out(a, &encattr, 4, ARCHIVE_Z_RUN);
if (r < 0)
@@ -1809,11 +1833,11 @@ compression_init_encoder_bzip2(struct archive *a,
* of ugly hackery to convert a const * pointer to
* a non-const pointer. */
strm->next_in = (char *)(uintptr_t)(const void *)lastrm->next_in;
- strm->avail_in = lastrm->avail_in;
+ strm->avail_in = (uint32_t)lastrm->avail_in;
strm->total_in_lo32 = (uint32_t)(lastrm->total_in & 0xffffffff);
strm->total_in_hi32 = (uint32_t)(lastrm->total_in >> 32);
strm->next_out = (char *)lastrm->next_out;
- strm->avail_out = lastrm->avail_out;
+ strm->avail_out = (uint32_t)lastrm->avail_out;
strm->total_out_lo32 = (uint32_t)(lastrm->total_out & 0xffffffff);
strm->total_out_hi32 = (uint32_t)(lastrm->total_out >> 32);
if (BZ2_bzCompressInit(strm, level, 0, 30) != BZ_OK) {
@@ -1842,11 +1866,11 @@ compression_code_bzip2(struct archive *a,
* of ugly hackery to convert a const * pointer to
* a non-const pointer. */
strm->next_in = (char *)(uintptr_t)(const void *)lastrm->next_in;
- strm->avail_in = lastrm->avail_in;
+ strm->avail_in = (uint32_t)lastrm->avail_in;
strm->total_in_lo32 = (uint32_t)(lastrm->total_in & 0xffffffff);
strm->total_in_hi32 = (uint32_t)(lastrm->total_in >> 32);
strm->next_out = (char *)lastrm->next_out;
- strm->avail_out = lastrm->avail_out;
+ strm->avail_out = (uint32_t)lastrm->avail_out;
strm->total_out_lo32 = (uint32_t)(lastrm->total_out & 0xffffffff);
strm->total_out_hi32 = (uint32_t)(lastrm->total_out >> 32);
r = BZ2_bzCompress(strm,
diff --git a/libarchive/archive_write_set_format_ar.c b/libarchive/archive_write_set_format_ar.c
index fc0de1e9f6f0..38689d89be0e 100644
--- a/libarchive/archive_write_set_format_ar.c
+++ b/libarchive/archive_write_set_format_ar.c
@@ -26,7 +26,6 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/archive_write_set_format_ar.c 201108 2009-12-28 03:28:21Z kientzle $");
#ifdef HAVE_ERRNO_H
#include <errno.h>
diff --git a/libarchive/archive_write_set_format_by_name.c b/libarchive/archive_write_set_format_by_name.c
index bfb4b3545f2c..09519b123894 100644
--- a/libarchive/archive_write_set_format_by_name.c
+++ b/libarchive/archive_write_set_format_by_name.c
@@ -24,7 +24,6 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/archive_write_set_format_by_name.c 201168 2009-12-29 06:15:32Z kientzle $");
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
diff --git a/libarchive/archive_write_set_format_cpio_binary.c b/libarchive/archive_write_set_format_cpio_binary.c
index d6ce35a7bc1f..7a010ee00f22 100644
--- a/libarchive/archive_write_set_format_cpio_binary.c
+++ b/libarchive/archive_write_set_format_cpio_binary.c
@@ -25,7 +25,6 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/archive_write_set_format_cpio.c 201170 2009-12-29 06:34:23Z kientzle $");
#ifdef HAVE_ERRNO_H
#include <errno.h>
diff --git a/libarchive/archive_write_set_format_cpio_newc.c b/libarchive/archive_write_set_format_cpio_newc.c
index f0f39809dad4..006736a1fa22 100644
--- a/libarchive/archive_write_set_format_cpio_newc.c
+++ b/libarchive/archive_write_set_format_cpio_newc.c
@@ -26,7 +26,6 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/archive_write_set_format_cpio_newc.c 201160 2009-12-29 05:41:57Z kientzle $");
#ifdef HAVE_ERRNO_H
#include <errno.h>
diff --git a/libarchive/archive_write_set_format_cpio_odc.c b/libarchive/archive_write_set_format_cpio_odc.c
index 091925a2f9f2..426f779a2b0b 100644
--- a/libarchive/archive_write_set_format_cpio_odc.c
+++ b/libarchive/archive_write_set_format_cpio_odc.c
@@ -25,7 +25,6 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/archive_write_set_format_cpio.c 201170 2009-12-29 06:34:23Z kientzle $");
#ifdef HAVE_ERRNO_H
#include <errno.h>
diff --git a/libarchive/archive_write_set_format_filter_by_ext.c b/libarchive/archive_write_set_format_filter_by_ext.c
index 9fe21e4542a0..1bb33b04bf91 100644
--- a/libarchive/archive_write_set_format_filter_by_ext.c
+++ b/libarchive/archive_write_set_format_filter_by_ext.c
@@ -25,7 +25,6 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/archive_write_set_format_by_name.c 201168 2009-12-29 06:15:32Z kientzle $");
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
diff --git a/libarchive/archive_write_set_format_gnutar.c b/libarchive/archive_write_set_format_gnutar.c
index ec29c5c418e4..92b06c5f5fb4 100644
--- a/libarchive/archive_write_set_format_gnutar.c
+++ b/libarchive/archive_write_set_format_gnutar.c
@@ -27,8 +27,6 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/archive_write_set_format_gnu_tar.c 191579 2009-04-27 18:35:03Z gastal $");
-
#ifdef HAVE_ERRNO_H
#include <errno.h>
diff --git a/libarchive/archive_write_set_format_iso9660.c b/libarchive/archive_write_set_format_iso9660.c
index 58b7216a8071..2a3ae07fa2b2 100644
--- a/libarchive/archive_write_set_format_iso9660.c
+++ b/libarchive/archive_write_set_format_iso9660.c
@@ -289,12 +289,12 @@ struct isoent {
struct extr_rec *current;
} extr_rec_list;
- signed int virtual:1;
+ unsigned int virtual:1;
/* If set to one, this file type is a directory.
* A convenience flag to be used as
* "archive_entry_filetype(isoent->file->entry) == AE_IFDIR".
*/
- signed int dir:1;
+ unsigned int dir:1;
};
struct hardlink {
@@ -652,7 +652,7 @@ struct iso_option {
#define VOLUME_IDENTIFIER_SIZE 32
/*
- * Usage : !zisofs [DEFAULT]
+ * Usage : !zisofs [DEFAULT]
* : Disable to generate RRIP 'ZF' extension.
* : zisofs
* : Make files zisofs file and generate RRIP 'ZF'
@@ -689,7 +689,7 @@ struct iso9660 {
uint64_t bytes_remaining;
int need_multi_extent;
- /* Temporary string buffer for Joliet extension. */
+ /* Temporary string buffer for Joliet extension. */
struct archive_string utf16be;
struct archive_string mbs;
@@ -755,9 +755,9 @@ struct iso9660 {
/* Used for making zisofs. */
struct {
- signed int detect_magic:1;
- signed int making:1;
- signed int allzero:1;
+ unsigned int detect_magic:1;
+ unsigned int making:1;
+ unsigned int allzero:1;
unsigned char magic_buffer[64];
int magic_cnt;
@@ -2521,12 +2521,11 @@ get_gmoffset(struct tm *tm)
static void
get_tmfromtime(struct tm *tm, time_t *t)
{
-#if HAVE_LOCALTIME_R
+#if HAVE_LOCALTIME_S
+ localtime_s(tm, t);
+#elif HAVE_LOCALTIME_R
tzset();
localtime_r(t, tm);
-#elif HAVE__LOCALTIME64_S
- __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
@@ -4074,11 +4073,8 @@ write_information_block(struct archive_write *a)
}
memset(info.s, 0, info_size);
opt = 0;
-#if defined(HAVE__CTIME64_S)
- {
- __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));
- }
+#if defined(HAVE_CTIME_S)
+ ctime_s(buf, sizeof(buf), &(iso9660->birth_time));
#elif defined(HAVE_CTIME_R)
ctime_r(&(iso9660->birth_time), buf);
#else
@@ -7802,8 +7798,8 @@ struct zisofs_extract {
uint64_t pz_uncompressed_size;
size_t uncompressed_buffer_size;
- signed int initialized:1;
- signed int header_passed:1;
+ unsigned int initialized:1;
+ unsigned int header_passed:1;
uint32_t pz_offset;
unsigned char *block_pointers;
diff --git a/libarchive/archive_write_set_format_mtree.c b/libarchive/archive_write_set_format_mtree.c
index 619b7714eeba..6db9d27848af 100644
--- a/libarchive/archive_write_set_format_mtree.c
+++ b/libarchive/archive_write_set_format_mtree.c
@@ -25,7 +25,6 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/archive_write_set_format_mtree.c 201171 2009-12-29 06:39:07Z kientzle $");
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
diff --git a/libarchive/archive_write_set_format_pax.c b/libarchive/archive_write_set_format_pax.c
index 52911491f65f..e93333074a6a 100644
--- a/libarchive/archive_write_set_format_pax.c
+++ b/libarchive/archive_write_set_format_pax.c
@@ -26,7 +26,6 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/archive_write_set_format_pax.c 201162 2009-12-29 05:47:46Z kientzle $");
#ifdef HAVE_ERRNO_H
#include <errno.h>
@@ -100,6 +99,7 @@ static int has_non_ASCII(const char *);
static void sparse_list_clear(struct pax *);
static int sparse_list_add(struct pax *, int64_t, int64_t);
static char *url_encode(const char *in);
+static time_t get_ustar_max_mtime(void);
/*
* Set output format to 'restricted pax' format.
@@ -367,10 +367,12 @@ archive_write_pax_header_xattr(struct pax *pax, const char *encoded_name,
struct archive_string s;
char *encoded_value;
+ if (encoded_name == NULL)
+ return;
+
if (pax->flags & WRITE_LIBARCHIVE_XATTR) {
encoded_value = base64_encode((const char *)value, value_len);
-
- if (encoded_name != NULL && encoded_value != NULL) {
+ if (encoded_value != NULL) {
archive_string_init(&s);
archive_strcpy(&s, "LIBARCHIVE.xattr.");
archive_strcat(&s, encoded_name);
@@ -403,17 +405,22 @@ archive_write_pax_header_xattrs(struct archive_write *a,
archive_entry_xattr_next(entry, &name, &value, &size);
url_encoded_name = url_encode(name);
- if (url_encoded_name != NULL) {
+ if (url_encoded_name == NULL)
+ goto malloc_error;
+ else {
/* Convert narrow-character to UTF-8. */
r = archive_strcpy_l(&(pax->l_url_encoded_name),
url_encoded_name, pax->sconv_utf8);
free(url_encoded_name); /* Done with this. */
if (r == 0)
encoded_name = pax->l_url_encoded_name.s;
- else if (errno == ENOMEM) {
- archive_set_error(&a->archive, ENOMEM,
- "Can't allocate memory for Linkname");
- return (ARCHIVE_FATAL);
+ else if (r == -1)
+ goto malloc_error;
+ else {
+ archive_set_error(&a->archive,
+ ARCHIVE_ERRNO_MISC,
+ "Error encoding pax extended attribute");
+ return (ARCHIVE_FAILED);
}
}
@@ -422,6 +429,9 @@ archive_write_pax_header_xattrs(struct archive_write *a,
}
return (ARCHIVE_OK);
+malloc_error:
+ archive_set_error(&a->archive, ENOMEM, "Can't allocate memory");
+ return (ARCHIVE_FATAL);
}
static int
@@ -595,6 +605,8 @@ archive_write_pax_header(struct archive_write *a,
need_extension = 0;
pax = (struct pax *)a->format_data;
+ const time_t ustar_max_mtime = get_ustar_max_mtime();
+
/* Sanity check. */
if (archive_entry_pathname(entry_original) == NULL) {
archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
@@ -1116,16 +1128,13 @@ archive_write_pax_header(struct archive_write *a,
}
/*
- * Technically, the mtime field in the ustar header can
- * support 33 bits, but many platforms use signed 32-bit time
- * values. The cutoff of 0x7fffffff here is a compromise.
* Yes, this check is duplicated just below; this helps to
* avoid writing an mtime attribute just to handle a
* high-resolution timestamp in "restricted pax" mode.
*/
if (!need_extension &&
((archive_entry_mtime(entry_main) < 0)
- || (archive_entry_mtime(entry_main) >= 0x7fffffff)))
+ || (archive_entry_mtime(entry_main) >= ustar_max_mtime)))
need_extension = 1;
/* I use a star-compatible file flag attribute. */
@@ -1190,7 +1199,7 @@ archive_write_pax_header(struct archive_write *a,
if (a->archive.archive_format != ARCHIVE_FORMAT_TAR_PAX_RESTRICTED ||
need_extension) {
if (archive_entry_mtime(entry_main) < 0 ||
- archive_entry_mtime(entry_main) >= 0x7fffffff ||
+ archive_entry_mtime(entry_main) >= ustar_max_mtime ||
archive_entry_mtime_nsec(entry_main) != 0)
add_pax_attr_time(&(pax->pax_header), "mtime",
archive_entry_mtime(entry_main),
@@ -1428,7 +1437,7 @@ archive_write_pax_header(struct archive_write *a,
/* Copy mtime, but clip to ustar limits. */
s = archive_entry_mtime(entry_main);
if (s < 0) { s = 0; }
- if (s >= 0x7fffffff) { s = 0x7fffffff; }
+ if (s > ustar_max_mtime) { s = ustar_max_mtime; }
archive_entry_set_mtime(pax_attr_entry, s, 0);
/* Standard ustar doesn't support atime. */
@@ -1717,7 +1726,7 @@ build_pax_attribute_name(char *dest, const char *src)
* to having clients override it.
*/
#if HAVE_GETPID && 0 /* Disable this for now; see above comment. */
- sprintf(buff, "PaxHeader.%d", getpid());
+ snprintf(buff, sizeof(buff), "PaxHeader.%d", getpid());
#else
/* If the platform can't fetch the pid, don't include it. */
strcpy(buff, "PaxHeader");
@@ -1904,14 +1913,19 @@ url_encode(const char *in)
{
const char *s;
char *d;
- int out_len = 0;
+ size_t out_len = 0;
char *out;
for (s = in; *s != '\0'; s++) {
- if (*s < 33 || *s > 126 || *s == '%' || *s == '=')
+ if (*s < 33 || *s > 126 || *s == '%' || *s == '=') {
+ if (SIZE_MAX - out_len < 4)
+ return (NULL);
out_len += 3;
- else
+ } else {
+ if (SIZE_MAX - out_len < 2)
+ return (NULL);
out_len++;
+ }
}
out = (char *)malloc(out_len + 1);
@@ -2046,3 +2060,18 @@ sparse_list_add(struct pax *pax, int64_t offset, int64_t length)
return (_sparse_list_add_block(pax, offset, length, 0));
}
+static time_t
+get_ustar_max_mtime(void)
+{
+ /*
+ * Technically, the mtime field in the ustar header can
+ * support 33 bits. We are using all of them to keep
+ * tar/test/test_option_C_mtree.c simple and passing after 2038.
+ * For platforms that use signed 32-bit time values we
+ * use the 32-bit maximum.
+ */
+ if (sizeof(time_t) > sizeof(int32_t))
+ return (time_t)0x1ffffffff;
+ else
+ return (time_t)0x7fffffff;
+}
diff --git a/libarchive/archive_write_set_format_private.h b/libarchive/archive_write_set_format_private.h
index e20022755f8b..ef9dee9d808c 100644
--- a/libarchive/archive_write_set_format_private.h
+++ b/libarchive/archive_write_set_format_private.h
@@ -21,8 +21,6 @@
* 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 ARCHIVE_WRITE_SET_FORMAT_PRIVATE_H_INCLUDED
diff --git a/libarchive/archive_write_set_format_shar.c b/libarchive/archive_write_set_format_shar.c
index 9e4931c95c1f..52ea6adc2264 100644
--- a/libarchive/archive_write_set_format_shar.c
+++ b/libarchive/archive_write_set_format_shar.c
@@ -25,7 +25,6 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/archive_write_set_format_shar.c 189438 2009-03-06 05:58:56Z kientzle $");
#ifdef HAVE_ERRNO_H
#include <errno.h>
diff --git a/libarchive/archive_write_set_format_ustar.c b/libarchive/archive_write_set_format_ustar.c
index d1a06bc4f7ec..673487b27fe3 100644
--- a/libarchive/archive_write_set_format_ustar.c
+++ b/libarchive/archive_write_set_format_ustar.c
@@ -25,8 +25,6 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/archive_write_set_format_ustar.c 191579 2009-04-27 18:35:03Z kientzle $");
-
#ifdef HAVE_ERRNO_H
#include <errno.h>
diff --git a/libarchive/archive_write_set_format_v7tar.c b/libarchive/archive_write_set_format_v7tar.c
index 599407144121..e3724a096da7 100644
--- a/libarchive/archive_write_set_format_v7tar.c
+++ b/libarchive/archive_write_set_format_v7tar.c
@@ -25,8 +25,6 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD$");
-
#ifdef HAVE_ERRNO_H
#include <errno.h>
diff --git a/libarchive/archive_write_set_format_warc.c b/libarchive/archive_write_set_format_warc.c
index 46b05734121c..3d22e1f4ba57 100644
--- a/libarchive/archive_write_set_format_warc.c
+++ b/libarchive/archive_write_set_format_warc.c
@@ -26,7 +26,6 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD$");
#ifdef HAVE_ERRNO_H
#include <errno.h>
@@ -329,30 +328,21 @@ xstrftime(struct archive_string *as, const char *fmt, time_t t)
{
/** like strftime(3) but for time_t objects */
struct tm *rt;
-#if defined(HAVE_GMTIME_R) || defined(HAVE__GMTIME64_S)
+#if defined(HAVE_GMTIME_R) || defined(HAVE_GMTIME_S)
struct tm timeHere;
#endif
-#if defined(HAVE__GMTIME64_S)
- errno_t terr;
- __time64_t tmptime;
-#endif
char strtime[100];
size_t len;
-#ifdef HAVE_GMTIME_R
- if ((rt = gmtime_r(&t, &timeHere)) == NULL)
- return;
-#elif defined(HAVE__GMTIME64_S)
- tmptime = t;
- terr = _gmtime64_s(&timeHere, &tmptime);
- if (terr)
- rt = NULL;
- else
- rt = &timeHere;
+#if defined(HAVE_GMTIME_S)
+ rt = gmtime_s(&timeHere, &t) ? NULL : &timeHere;
+#elif defined(HAVE_GMTIME_R)
+ rt = gmtime_r(&t, &timeHere);
#else
- if ((rt = gmtime(&t)) == NULL)
- return;
+ rt = gmtime(&t);
#endif
+ if (!rt)
+ return;
/* leave the hard yacker to our role model strftime() */
len = strftime(strtime, sizeof(strtime)-1, fmt, rt);
archive_strncat(as, strtime, len);
diff --git a/libarchive/archive_write_set_format_xar.c b/libarchive/archive_write_set_format_xar.c
index d885f5c256d3..2cf655da186a 100644
--- a/libarchive/archive_write_set_format_xar.c
+++ b/libarchive/archive_write_set_format_xar.c
@@ -24,7 +24,6 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD$");
#ifdef HAVE_ERRNO_H
#include <errno.h>
@@ -212,8 +211,8 @@ struct file {
struct heap_data data;
struct archive_string script;
- signed int virtual:1;
- signed int dir:1;
+ unsigned int virtual:1;
+ unsigned int dir:1;
};
struct hardlink {
@@ -906,15 +905,11 @@ xmlwrite_time(struct archive_write *a, xmlTextWriterPtr writer,
{
char timestr[100];
struct tm tm;
-#if defined(HAVE__GMTIME64_S)
- __time64_t tmptime;
-#endif
-#if defined(HAVE_GMTIME_R)
+#if defined(HAVE_GMTIME_S)
+ gmtime_s(&tm, &t);
+#elif defined(HAVE_GMTIME_R)
gmtime_r(&t, &tm);
-#elif defined(HAVE__GMTIME64_S)
- tmptime = t;
- _gmtime64_s(&tm, &tmptime);
#else
memcpy(&tm, gmtime(&t), sizeof(tm));
#endif
diff --git a/libarchive/archive_write_set_format_zip.c b/libarchive/archive_write_set_format_zip.c
index 8c14a7027eba..e37e7b5edda1 100644
--- a/libarchive/archive_write_set_format_zip.c
+++ b/libarchive/archive_write_set_format_zip.c
@@ -30,7 +30,6 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/archive_write_set_format_zip.c 201168 2009-12-29 06:15:32Z kientzle $");
#ifdef HAVE_ERRNO_H
#include <errno.h>
@@ -132,7 +131,6 @@ struct zip {
enum compression entry_compression;
enum encryption entry_encryption;
int entry_flags;
- int entry_uses_zip64;
int experiments;
struct trad_enc_ctx tctx;
char tctx_valid;
@@ -523,6 +521,7 @@ archive_write_zip_header(struct archive_write *a, struct archive_entry *entry)
int ret, ret2 = ARCHIVE_OK;
mode_t type;
int version_needed = 10;
+#define MIN_VERSION_NEEDED(x) do { if (version_needed < x) { version_needed = x; } } while (0)
/* Ignore types of entries that we don't support. */
type = archive_entry_filetype(entry);
@@ -557,12 +556,12 @@ archive_write_zip_header(struct archive_write *a, struct archive_entry *entry)
/* Reset information from last entry. */
zip->entry_offset = zip->written_bytes;
zip->entry_uncompressed_limit = INT64_MAX;
+ /* Zero size values implies that we're using a trailing data descriptor */
zip->entry_compressed_size = 0;
zip->entry_uncompressed_size = 0;
zip->entry_compressed_written = 0;
zip->entry_uncompressed_written = 0;
zip->entry_flags = 0;
- zip->entry_uses_zip64 = 0;
zip->entry_crc32 = zip->crc32func(0, NULL, 0);
zip->entry_encryption = 0;
archive_entry_free(zip->entry);
@@ -672,11 +671,11 @@ archive_write_zip_header(struct archive_write *a, struct archive_entry *entry)
zip->entry_crc32 = zip->crc32func(zip->entry_crc32,
(const unsigned char *)slink, slink_size);
zip->entry_compression = COMPRESSION_STORE;
- version_needed = 20;
+ MIN_VERSION_NEEDED(20);
} else if (type != AE_IFREG) {
zip->entry_compression = COMPRESSION_STORE;
zip->entry_uncompressed_limit = 0;
- version_needed = 20;
+ MIN_VERSION_NEEDED(20);
} else if (archive_entry_size_is_set(zip->entry)) {
int64_t size = archive_entry_size(zip->entry);
int64_t additional_size = 0;
@@ -689,27 +688,27 @@ archive_write_zip_header(struct archive_write *a, struct archive_entry *entry)
if (zip->entry_compression == COMPRESSION_STORE) {
zip->entry_compressed_size = size;
zip->entry_uncompressed_size = size;
- version_needed = 10;
+ MIN_VERSION_NEEDED(10);
} else {
zip->entry_uncompressed_size = size;
- version_needed = 20;
+ MIN_VERSION_NEEDED(20);
}
if (zip->entry_flags & ZIP_ENTRY_FLAG_ENCRYPTED) {
switch (zip->entry_encryption) {
case ENCRYPTION_TRADITIONAL:
additional_size = TRAD_HEADER_SIZE;
- version_needed = 20;
+ MIN_VERSION_NEEDED(20);
break;
case ENCRYPTION_WINZIP_AES128:
additional_size = WINZIP_AES128_HEADER_SIZE
+ AUTH_CODE_SIZE;
- version_needed = 20;
+ MIN_VERSION_NEEDED(20);
break;
case ENCRYPTION_WINZIP_AES256:
additional_size = WINZIP_AES256_HEADER_SIZE
+ AUTH_CODE_SIZE;
- version_needed = 20;
+ MIN_VERSION_NEEDED(20);
break;
case ENCRYPTION_NONE:
default:
@@ -733,8 +732,7 @@ archive_write_zip_header(struct archive_write *a, struct archive_entry *entry)
|| (zip->entry_uncompressed_size + additional_size > ZIP_4GB_MAX)
|| (zip->entry_uncompressed_size > ZIP_4GB_MAX_UNCOMPRESSED
&& zip->entry_compression != COMPRESSION_STORE)) {
- zip->entry_uses_zip64 = 1;
- version_needed = 45;
+ MIN_VERSION_NEEDED(45);
}
/* We may know the size, but never the CRC. */
@@ -742,7 +740,6 @@ archive_write_zip_header(struct archive_write *a, struct archive_entry *entry)
} else {
/* We don't know the size. Use the default
* compression unless specified otherwise.
- * We enable Zip64 extensions unless we're told not to.
*/
zip->entry_compression = zip->requested_compression;
@@ -752,12 +749,12 @@ archive_write_zip_header(struct archive_write *a, struct archive_entry *entry)
zip->entry_flags |= ZIP_ENTRY_FLAG_LENGTH_AT_END;
if ((zip->flags & ZIP_FLAG_AVOID_ZIP64) == 0) {
- zip->entry_uses_zip64 = 1;
- version_needed = 45;
+ /* We might use zip64 extensions, so require 4.5 */
+ MIN_VERSION_NEEDED(45);
} else if (zip->entry_compression == COMPRESSION_STORE) {
- version_needed = 10;
+ MIN_VERSION_NEEDED(10);
} else {
- version_needed = 20;
+ MIN_VERSION_NEEDED(20);
}
if (zip->entry_flags & ZIP_ENTRY_FLAG_ENCRYPTED) {
@@ -765,8 +762,7 @@ archive_write_zip_header(struct archive_write *a, struct archive_entry *entry)
case ENCRYPTION_TRADITIONAL:
case ENCRYPTION_WINZIP_AES128:
case ENCRYPTION_WINZIP_AES256:
- if (version_needed < 20)
- version_needed = 20;
+ MIN_VERSION_NEEDED(20);
break;
case ENCRYPTION_NONE:
default:
@@ -787,16 +783,8 @@ archive_write_zip_header(struct archive_write *a, struct archive_entry *entry)
archive_le16enc(local_header + 8, zip->entry_compression);
archive_le32enc(local_header + 10,
dos_time(archive_entry_mtime(zip->entry)));
- archive_le32enc(local_header + 14, zip->entry_crc32);
- if (zip->entry_uses_zip64) {
- /* Zip64 data in the local header "must" include both
- * compressed and uncompressed sizes AND those fields
- * are included only if these are 0xffffffff;
- * THEREFORE these must be set this way, even if we
- * know one of them is smaller. */
- archive_le32enc(local_header + 18, ZIP_4GB_MAX);
- archive_le32enc(local_header + 22, ZIP_4GB_MAX);
- } else {
+ if ((zip->entry_flags & ZIP_ENTRY_FLAG_LENGTH_AT_END) == 0) {
+ archive_le32enc(local_header + 14, zip->entry_crc32);
archive_le32enc(local_header + 18, (uint32_t)zip->entry_compressed_size);
archive_le32enc(local_header + 22, (uint32_t)zip->entry_uncompressed_size);
}
@@ -842,42 +830,19 @@ archive_write_zip_header(struct archive_write *a, struct archive_entry *entry)
* the local file header and the central directory.
* We format them once and then duplicate them. */
- /* UT timestamp, length depends on what timestamps are set. */
- memcpy(e, "UT", 2);
- archive_le16enc(e + 2,
- 1
- + (archive_entry_mtime_is_set(entry) ? 4 : 0)
- + (archive_entry_atime_is_set(entry) ? 4 : 0)
- + (archive_entry_ctime_is_set(entry) ? 4 : 0));
- e += 4;
- *e++ =
- (archive_entry_mtime_is_set(entry) ? 1 : 0)
- | (archive_entry_atime_is_set(entry) ? 2 : 0)
- | (archive_entry_ctime_is_set(entry) ? 4 : 0);
- if (archive_entry_mtime_is_set(entry)) {
- archive_le32enc(e, (uint32_t)archive_entry_mtime(entry));
- e += 4;
- }
- if (archive_entry_atime_is_set(entry)) {
- archive_le32enc(e, (uint32_t)archive_entry_atime(entry));
+ /* ux Unix extra data, length 11, version 1 */
+ if (archive_entry_uid_is_set(entry) || archive_entry_gid_is_set(entry)) {
+ /* TODO: If uid < 64k, use 2 bytes, ditto for gid. */
+ memcpy(e, "ux\013\000\001", 5);
+ e += 5;
+ *e++ = 4; /* Length of following UID */
+ archive_le32enc(e, (uint32_t)archive_entry_uid(entry));
e += 4;
- }
- if (archive_entry_ctime_is_set(entry)) {
- archive_le32enc(e, (uint32_t)archive_entry_ctime(entry));
+ *e++ = 4; /* Length of following GID */
+ archive_le32enc(e, (uint32_t)archive_entry_gid(entry));
e += 4;
}
- /* ux Unix extra data, length 11, version 1 */
- /* TODO: If uid < 64k, use 2 bytes, ditto for gid. */
- memcpy(e, "ux\013\000\001", 5);
- e += 5;
- *e++ = 4; /* Length of following UID */
- archive_le32enc(e, (uint32_t)archive_entry_uid(entry));
- e += 4;
- *e++ = 4; /* Length of following GID */
- archive_le32enc(e, (uint32_t)archive_entry_gid(entry));
- e += 4;
-
/* AES extra data field: WinZIP AES information, ID=0x9901 */
if ((zip->entry_flags & ZIP_ENTRY_FLAG_ENCRYPTED)
&& (zip->entry_encryption == ENCRYPTION_WINZIP_AES128
@@ -904,7 +869,7 @@ archive_write_zip_header(struct archive_write *a, struct archive_entry *entry)
e += 2;
}
- /* Copy UT ,ux, and AES-extra into central directory as well. */
+ /* Copy ux, AES-extra into central directory as well. */
zip->file_header_extra_offset = zip->central_directory_bytes;
cd_extra = cd_alloc(zip, e - local_extra);
memcpy(cd_extra, local_extra, e - local_extra);
@@ -916,17 +881,50 @@ archive_write_zip_header(struct archive_write *a, struct archive_entry *entry)
* archive_write_zip_finish_entry() below.
*/
- /* "[Zip64 entry] in the local header MUST include BOTH
- * original [uncompressed] and compressed size fields." */
- if (zip->entry_uses_zip64) {
- unsigned char *zip64_start = e;
- memcpy(e, "\001\000\020\000", 4);
+ /* UT timestamp: length depends on what timestamps are set.
+ * This header appears in the Central Directory also, but
+ * according to Info-Zip specification, the CD form
+ * only holds mtime, so we format it separately. */
+ if (archive_entry_mtime_is_set(entry)
+ || archive_entry_atime_is_set(entry)
+ || archive_entry_ctime_is_set(entry)) {
+ unsigned char *ut = e;
+ memcpy(e, "UT\000\000", 4);
+ e += 4;
+ *e++ = (archive_entry_mtime_is_set(entry) ? 1 : 0)
+ | (archive_entry_atime_is_set(entry) ? 2 : 0)
+ | (archive_entry_ctime_is_set(entry) ? 4 : 0);
+ if (archive_entry_mtime_is_set(entry)) {
+ archive_le32enc(e, (uint32_t)archive_entry_mtime(entry));
+ e += 4;
+ }
+ if (archive_entry_atime_is_set(entry)) {
+ archive_le32enc(e, (uint32_t)archive_entry_atime(entry));
+ e += 4;
+ }
+ if (archive_entry_ctime_is_set(entry)) {
+ archive_le32enc(e, (uint32_t)archive_entry_ctime(entry));
+ e += 4;
+ }
+ archive_le16enc(ut + 2, e - ut - 4);
+ }
+
+ /*
+ * Note about Zip64 Extended Information Extra Field:
+ * Because libarchive always writes in a streaming
+ * fashion, we never know the CRC when we're writing
+ * the local header. So we have to use length-at-end, which
+ * prevents us from putting size information into a Zip64
+ * extra field. However, apparently some readers find it
+ * a helpful clue to have an empty such field so they
+ * can expect a 64-bit length-at-end marker.
+ */
+ if (archive_entry_size_is_set(zip->entry)
+ && (zip->entry_uncompressed_size > ZIP_4GB_MAX
+ || zip->entry_compressed_size > ZIP_4GB_MAX)) {
+ /* Header ID 0x0001, size 0 */
+ memcpy(e, "\001\000\000\000", 4);
e += 4;
- archive_le64enc(e, zip->entry_uncompressed_size);
- e += 8;
- archive_le64enc(e, zip->entry_compressed_size);
- e += 8;
- archive_le16enc(zip64_start + 2, (uint16_t)(e - (zip64_start + 4)));
}
if (zip->flags & ZIP_FLAG_EXPERIMENT_xl) {
@@ -1205,7 +1203,9 @@ archive_write_zip_finish_entry(struct archive_write *a)
archive_le32enc(d + 4, 0);/* no CRC.*/
else
archive_le32enc(d + 4, zip->entry_crc32);
- if (zip->entry_uses_zip64) {
+ if (zip->entry_compressed_written > ZIP_4GB_MAX
+ || zip->entry_uncompressed_written > ZIP_4GB_MAX
+ || zip->flags & ZIP_FLAG_FORCE_ZIP64) {
archive_le64enc(d + 8,
(uint64_t)zip->entry_compressed_written);
archive_le64enc(d + 16,
@@ -1224,23 +1224,60 @@ archive_write_zip_finish_entry(struct archive_write *a)
return (ARCHIVE_FATAL);
}
- /* Append Zip64 extra data to central directory information. */
- if (zip->entry_compressed_written > ZIP_4GB_MAX
- || zip->entry_uncompressed_written > ZIP_4GB_MAX
+ /* UT timestamp: Info-Zip specifies that _only_ the mtime should
+ * be recorded here; ctime and atime are also included in the
+ * local file descriptor. */
+ if (archive_entry_mtime_is_set(zip->entry)) {
+ unsigned char ut[9];
+ unsigned char *u = ut, *ud;
+ memcpy(u, "UT\005\000\001", 5);
+ u += 5;
+ archive_le32enc(u, (uint32_t)archive_entry_mtime(zip->entry));
+ u += 4;
+ ud = cd_alloc(zip, u - ut);
+ if (ud == NULL) {
+ archive_set_error(&a->archive, ENOMEM,
+ "Can't allocate zip data");
+ return (ARCHIVE_FATAL);
+ }
+ memcpy(ud, ut, u - ut);
+ }
+
+ /* Fill in size information in the central directory entry. */
+ /* Fix up central directory file header. */
+ if (zip->cctx_valid && zip->aes_vendor == AES_VENDOR_AE_2)
+ archive_le32enc(zip->file_header + 16, 0);/* no CRC.*/
+ else
+ archive_le32enc(zip->file_header + 16, zip->entry_crc32);
+ /* Truncate to 32 bits; we'll fix up below. */
+ archive_le32enc(zip->file_header + 20, (uint32_t)zip->entry_compressed_written);
+ archive_le32enc(zip->file_header + 24, (uint32_t)zip->entry_uncompressed_written);
+ archive_le16enc(zip->file_header + 30,
+ (uint16_t)(zip->central_directory_bytes - zip->file_header_extra_offset));
+ archive_le32enc(zip->file_header + 42, (uint32_t)zip->entry_offset);
+
+ /* If any of the values immediately above are too large, we'll
+ * need to put the corresponding value in a Zip64 extra field
+ * and set the central directory value to 0xffffffff as a flag. */
+ if (zip->entry_compressed_written >= ZIP_4GB_MAX
+ || zip->entry_uncompressed_written >= ZIP_4GB_MAX
|| zip->entry_offset > ZIP_4GB_MAX) {
unsigned char zip64[32];
unsigned char *z = zip64, *zd;
memcpy(z, "\001\000\000\000", 4);
z += 4;
if (zip->entry_uncompressed_written >= ZIP_4GB_MAX) {
+ archive_le32enc(zip->file_header + 24, ZIP_4GB_MAX);
archive_le64enc(z, zip->entry_uncompressed_written);
z += 8;
}
if (zip->entry_compressed_written >= ZIP_4GB_MAX) {
+ archive_le32enc(zip->file_header + 20, ZIP_4GB_MAX);
archive_le64enc(z, zip->entry_compressed_written);
z += 8;
}
if (zip->entry_offset >= ZIP_4GB_MAX) {
+ archive_le32enc(zip->file_header + 42, ZIP_4GB_MAX);
archive_le64enc(z, zip->entry_offset);
z += 8;
}
@@ -1382,25 +1419,14 @@ dos_time(const time_t unix_time)
{
struct tm *t;
unsigned int dt;
-#if defined(HAVE_LOCALTIME_R) || defined(HAVE__LOCALTIME64_S)
+#if defined(HAVE_LOCALTIME_R) || defined(HAVE_LOCALTIME_S)
struct tm tmbuf;
#endif
-#if defined(HAVE__LOCALTIME64_S)
- errno_t terr;
- __time64_t tmptime;
-#endif
- /* This will not preserve time when creating/extracting the archive
- * on two systems with different time zones. */
-#if defined(HAVE_LOCALTIME_R)
+#if defined(HAVE_LOCALTIME_S)
+ t = localtime_s(&tmbuf, &unix_time) ? NULL : &tmbuf;
+#elif defined(HAVE_LOCALTIME_R)
t = localtime_r(&unix_time, &tmbuf);
-#elif defined(HAVE__LOCALTIME64_S)
- tmptime = unix_time;
- terr = _localtime64_s(&tmbuf, &tmptime);
- if (terr)
- t = NULL;
- else
- t = &tmbuf;
#else
t = localtime(&unix_time);
#endif
diff --git a/libarchive/archive_write_set_options.3 b/libarchive/archive_write_set_options.3
index dd573588d573..454c79671b93 100644
--- a/libarchive/archive_write_set_options.3
+++ b/libarchive/archive_write_set_options.3
@@ -22,8 +22,6 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $FreeBSD$
-.\"
.Dd January 31, 2020
.Dt ARCHIVE_WRITE_OPTIONS 3
.Os
@@ -257,12 +255,22 @@ If supported, the default value is read from
The value is interpreted as a decimal integer specifying the
compression level. Supported values depend on the library version,
common values are from 1 to 22.
+.It Cm long
+Enables long distance matching. The value is interpreted as a
+decimal integer specifying log2 window size in bytes. Values from
+10 to 30 for 32 bit, or 31 for 64 bit, are supported.
+.It Cm threads
+The value is interpreted as a decimal integer specifying the
+number of threads for multi-threaded zstd compression.
+If set to 0, zstd will attempt to detect and use the number
+of physical CPU cores.
.El
.It Format 7zip
.Bl -tag -compact -width indent
.It Cm compression
The value is one of
.Dq store ,
+.Dq copy ,
.Dq deflate ,
.Dq bzip2 ,
.Dq lzma1 ,
@@ -270,12 +278,18 @@ The value is one of
or
.Dq ppmd
to indicate how the following entries should be compressed.
+The values
+.Dq store
+and
+.Dq copy
+are synonyms.
Note that this setting is ignored for directories, symbolic links,
and other special entries.
.It Cm compression-level
The value is interpreted as a decimal integer specifying the
compression level.
-Values between 0 and 9 are supported.
+Values between 0 and 9 are supported, with the exception of bzip2
+which only supports values between 1 and 9.
The interpretation of the compression level depends on the chosen
compression method.
.El
diff --git a/libarchive/archive_write_set_options.c b/libarchive/archive_write_set_options.c
index 962309ada5ce..be2a6063188b 100644
--- a/libarchive/archive_write_set_options.c
+++ b/libarchive/archive_write_set_options.c
@@ -24,7 +24,6 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD$");
#include "archive_write_private.h"
#include "archive_options_private.h"
diff --git a/libarchive/archive_write_set_passphrase.3 b/libarchive/archive_write_set_passphrase.3
index 2db77034c76e..629e059b2372 100644
--- a/libarchive/archive_write_set_passphrase.3
+++ b/libarchive/archive_write_set_passphrase.3
@@ -22,8 +22,6 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $FreeBSD$
-.\"
.Dd September 21, 2014
.Dt ARCHIVE_WRITE_SET_PASSPHRASE 3
.Os
diff --git a/libarchive/archive_write_set_passphrase.c b/libarchive/archive_write_set_passphrase.c
index 710ecba52c3d..977fc4a9ee6b 100644
--- a/libarchive/archive_write_set_passphrase.c
+++ b/libarchive/archive_write_set_passphrase.c
@@ -24,7 +24,6 @@
*/
#include "archive_platform.h"
-__FBSDID("$FreeBSD$");
#ifdef HAVE_ERRNO_H
#include <errno.h>
diff --git a/libarchive/config_freebsd.h b/libarchive/config_freebsd.h
index 758621c4b68f..d0f3e2300c9d 100644
--- a/libarchive/config_freebsd.h
+++ b/libarchive/config_freebsd.h
@@ -21,8 +21,6 @@
* 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$
*/
#define __LIBARCHIVE_CONFIG_H_INCLUDED 1
@@ -111,6 +109,8 @@
#define HAVE_FCNTL 1
#define HAVE_FCNTL_H 1
#define HAVE_FDOPENDIR 1
+#define HAVE_FNMATCH 1
+#define HAVE_FNMATCH_H 1
#define HAVE_FORK 1
#define HAVE_FSEEKO 1
#define HAVE_FSTAT 1
@@ -123,6 +123,8 @@
#define HAVE_GETEUID 1
#define HAVE_GETGRGID_R 1
#define HAVE_GETGRNAM_R 1
+#define HAVE_GETLINE 1
+#define HAVE_GETOPT_OPTRESET 1
#define HAVE_GETPID 1
#define HAVE_GETPWNAM_R 1
#define HAVE_GETPWUID_R 1
@@ -201,6 +203,7 @@
#define HAVE_SYS_MOUNT_H 1
#define HAVE_SYS_PARAM_H 1
#define HAVE_SYS_POLL_H 1
+#define HAVE_SYS_QUEUE_H 1
#define HAVE_SYS_SELECT_H 1
#define HAVE_SYS_STATVFS_H 1
#define HAVE_SYS_STAT_H 1
@@ -234,7 +237,7 @@
#define HAVE_WMEMCPY 1
#define HAVE_WMEMMOVE 1
#define HAVE_ZLIB_H 1
-#define TIME_WITH_SYS_TIME 1
+#define HAVE_SYS_TIME_H 1
#if __FreeBSD_version >= 800505
#define HAVE_LIBLZMA 1
diff --git a/libarchive/cpio.5 b/libarchive/cpio.5
index c71018b1996e..21c30d78d3c5 100644
--- a/libarchive/cpio.5
+++ b/libarchive/cpio.5
@@ -22,8 +22,6 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $FreeBSD$
-.\"
.Dd December 23, 2011
.Dt CPIO 5
.Os
diff --git a/libarchive/filter_fork.h b/libarchive/filter_fork.h
index 2bf290c4d9e4..aeab70ae634a 100644
--- a/libarchive/filter_fork.h
+++ b/libarchive/filter_fork.h
@@ -21,8 +21,6 @@
* 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: head/lib/libarchive/filter_fork.h 201087 2009-12-28 02:18:26Z kientzle $
*/
#ifndef FILTER_FORK_H
diff --git a/libarchive/filter_fork_posix.c b/libarchive/filter_fork_posix.c
index ac255c4f8b20..c895c08e59b3 100644
--- a/libarchive/filter_fork_posix.c
+++ b/libarchive/filter_fork_posix.c
@@ -30,8 +30,6 @@
#if defined(HAVE_PIPE) && defined(HAVE_FCNTL) && \
(defined(HAVE_FORK) || defined(HAVE_VFORK) || defined(HAVE_POSIX_SPAWNP))
-__FBSDID("$FreeBSD: head/lib/libarchive/filter_fork.c 182958 2008-09-12 05:33:00Z kientzle $");
-
#if defined(HAVE_SYS_TYPES_H)
# include <sys/types.h>
#endif
@@ -76,7 +74,7 @@ int
__archive_create_child(const char *cmd, int *child_stdin, int *child_stdout,
pid_t *out_child)
{
- pid_t child;
+ pid_t child = -1;
int stdin_pipe[2], stdout_pipe[2], tmp;
#if HAVE_POSIX_SPAWNP
posix_spawn_file_actions_t actions;
diff --git a/libarchive/filter_fork_windows.c b/libarchive/filter_fork_windows.c
index 0b963975b90d..9e49c5655f1d 100644
--- a/libarchive/filter_fork_windows.c
+++ b/libarchive/filter_fork_windows.c
@@ -31,6 +31,7 @@
#include "filter_fork.h"
+#if !defined(WINAPI_FAMILY_PARTITION) || WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)
/* There are some editions of Windows ("nano server," for example) that
* do not host user32.dll. If we want to keep running on those editions,
* we need to delay-load WaitForInputIdle. */
@@ -224,6 +225,14 @@ fail:
__archive_cmdline_free(acmd);
return ARCHIVE_FAILED;
}
+#else /* !WINAPI_PARTITION_DESKTOP */
+int
+__archive_create_child(const char *cmd, int *child_stdin, int *child_stdout, HANDLE *out_child)
+{
+ (void)cmd; (void)child_stdin; (void) child_stdout; (void) out_child;
+ return ARCHIVE_FAILED;
+}
+#endif /* !WINAPI_PARTITION_DESKTOP */
void
__archive_check_child(int in, int out)
diff --git a/libarchive/libarchive-formats.5 b/libarchive/libarchive-formats.5
index 5a118ff5d240..fab2f8660270 100644
--- a/libarchive/libarchive-formats.5
+++ b/libarchive/libarchive-formats.5
@@ -22,8 +22,6 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $FreeBSD$
-.\"
.Dd December 27, 2016
.Dt LIBARCHIVE-FORMATS 5
.Os
diff --git a/libarchive/libarchive.3 b/libarchive/libarchive.3
index 649056242285..c67172bf654f 100644
--- a/libarchive/libarchive.3
+++ b/libarchive/libarchive.3
@@ -22,8 +22,6 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $FreeBSD$
-.\"
.Dd March 18, 2012
.Dt LIBARCHIVE 3
.Os
diff --git a/libarchive/libarchive_changes.3 b/libarchive/libarchive_changes.3
index 6bf8db038c73..fd0e721053ca 100644
--- a/libarchive/libarchive_changes.3
+++ b/libarchive/libarchive_changes.3
@@ -22,8 +22,6 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $FreeBSD$
-.\"
.Dd December 23, 2011
.Dt LIBARCHIVE_CHANGES 3
.Os
diff --git a/libarchive/libarchive_internals.3 b/libarchive/libarchive_internals.3
index d672f3e8a64d..d4696f648292 100644
--- a/libarchive/libarchive_internals.3
+++ b/libarchive/libarchive_internals.3
@@ -22,8 +22,6 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $FreeBSD$
-.\"
.Dd January 26, 2011
.Dt LIBARCHIVE_INTERNALS 3
.Os
diff --git a/libarchive/mtree.5 b/libarchive/mtree.5
index 8147796f3100..5ea53613166f 100644
--- a/libarchive/mtree.5
+++ b/libarchive/mtree.5
@@ -26,7 +26,6 @@
.\" SUCH DAMAGE.
.\"
.\" From: @(#)mtree.8 8.2 (Berkeley) 12/11/93
-.\" $FreeBSD$
.\"
.Dd September 4, 2013
.Dt MTREE 5
diff --git a/libarchive/tar.5 b/libarchive/tar.5
index 34ad4f79315e..725a7d68374a 100644
--- a/libarchive/tar.5
+++ b/libarchive/tar.5
@@ -23,8 +23,6 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $FreeBSD$
-.\"
.Dd December 27, 2016
.Dt TAR 5
.Os
diff --git a/libarchive/test/CMakeLists.txt b/libarchive/test/CMakeLists.txt
index 23bcc5bbd173..8209c25a5f8d 100644
--- a/libarchive/test/CMakeLists.txt
+++ b/libarchive/test/CMakeLists.txt
@@ -98,6 +98,7 @@ IF(ENABLE_TEST)
test_read_filter_program.c
test_read_filter_program_signature.c
test_read_filter_uudecode.c
+ test_read_filter_uudecode_raw.c
test_read_format_7zip.c
test_read_format_7zip_encryption_data.c
test_read_format_7zip_encryption_header.c
@@ -162,6 +163,7 @@ IF(ENABLE_TEST)
test_read_format_tar_empty_with_gnulabel.c
test_read_format_tar_empty_pax.c
test_read_format_tar_filename.c
+ test_read_format_tar_invalid_pax_size.c
test_read_format_tbz.c
test_read_format_tgz.c
test_read_format_tlz.c
@@ -275,6 +277,7 @@ IF(ENABLE_TEST)
test_write_format_xar.c
test_write_format_xar_empty.c
test_write_format_zip.c
+ test_write_format_zip64_stream.c
test_write_format_zip_compression_store.c
test_write_format_zip_empty.c
test_write_format_zip_empty_zip64.c
@@ -282,6 +285,7 @@ IF(ENABLE_TEST)
test_write_format_zip_file.c
test_write_format_zip_file_zip64.c
test_write_format_zip_large.c
+ test_write_format_zip_stream.c
test_write_format_zip_zip64.c
test_write_open_memory.c
test_write_read_format_zip.c
diff --git a/libarchive/test/README b/libarchive/test/README
index 1b70c7adba73..facf62030c9c 100644
--- a/libarchive/test/README
+++ b/libarchive/test/README
@@ -1,5 +1,3 @@
-$FreeBSD: src/lib/libarchive/test/README,v 1.3 2008/01/01 22:28:04 kientzle Exp $
-
This is the test harness for libarchive.
It compiles into a single program "libarchive_test" that is intended
diff --git a/libarchive/test/read_open_memory.c b/libarchive/test/read_open_memory.c
index daa3c3a1f02a..6d2468cd10a6 100644
--- a/libarchive/test/read_open_memory.c
+++ b/libarchive/test/read_open_memory.c
@@ -24,7 +24,6 @@
*/
#include "test.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/test/read_open_memory.c 191183 2009-04-17 01:06:31Z kientzle $");
#include <errno.h>
#include <stdlib.h>
diff --git a/libarchive/test/test_acl_nfs4.c b/libarchive/test/test_acl_nfs4.c
index fdc0191516e1..98d39689df69 100644
--- a/libarchive/test/test_acl_nfs4.c
+++ b/libarchive/test/test_acl_nfs4.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
/*
* Exercise the system-independent portion of the ACL support.
diff --git a/libarchive/test/test_acl_pax.c b/libarchive/test/test_acl_pax.c
index 8566f55a51a4..659073170fad 100644
--- a/libarchive/test/test_acl_pax.c
+++ b/libarchive/test/test_acl_pax.c
@@ -24,7 +24,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
/*
* Exercise the system-independent portion of the ACL support.
diff --git a/libarchive/test/test_acl_platform_nfs4.c b/libarchive/test/test_acl_platform_nfs4.c
index ae4bb5a10125..18f047b149e6 100644
--- a/libarchive/test/test_acl_platform_nfs4.c
+++ b/libarchive/test/test_acl_platform_nfs4.c
@@ -24,7 +24,6 @@
* 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
@@ -907,7 +906,7 @@ DEFINE_TEST(test_acl_platform_nfs4)
assertEqualIntA(a, ARCHIVE_OK, archive_write_header(a, ae));
for (i = 0; i < acls_dir_cnt; ++i) {
- sprintf(buff, "dir%d", i);
+ snprintf(buff, sizeof(buff), "dir%d", i);
archive_entry_set_pathname(ae, buff);
archive_entry_set_filetype(ae, AE_IFDIR);
archive_entry_set_perm(ae, 0654);
@@ -960,7 +959,7 @@ DEFINE_TEST(test_acl_platform_nfs4)
/* Verify single-permission dirs on disk. */
for (i = 0; i < dircnt; ++i) {
- sprintf(buff, "dir%d", i);
+ snprintf(buff, sizeof(buff), "dir%d", i);
assertEqualInt(0, stat(buff, &st));
assertEqualInt(st.st_mtime, 123456 + i);
#if ARCHIVE_ACL_SUNOS_NFS4
diff --git a/libarchive/test/test_acl_platform_posix1e.c b/libarchive/test/test_acl_platform_posix1e.c
index c34f7c2e299d..f23eec0d336a 100644
--- a/libarchive/test/test_acl_platform_posix1e.c
+++ b/libarchive/test/test_acl_platform_posix1e.c
@@ -24,7 +24,6 @@
* 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>
diff --git a/libarchive/test/test_acl_posix1e.c b/libarchive/test/test_acl_posix1e.c
index fa2628dbe794..3f9c9850f495 100644
--- a/libarchive/test/test_acl_posix1e.c
+++ b/libarchive/test/test_acl_posix1e.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/test/test_acl_basic.c,v 1.6 2008/10/19 00:13:57 kientzle Exp $");
/*
* Exercise the system-independent portion of the ACL support.
diff --git a/libarchive/test/test_acl_text.c b/libarchive/test/test_acl_text.c
index 80728932cb54..f0931adc8adc 100644
--- a/libarchive/test/test_acl_text.c
+++ b/libarchive/test/test_acl_text.c
@@ -23,7 +23,6 @@
* 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
diff --git a/libarchive/test/test_archive_api_feature.c b/libarchive/test/test_archive_api_feature.c
index 60773ad04e54..597d0ed40245 100644
--- a/libarchive/test/test_archive_api_feature.c
+++ b/libarchive/test/test_archive_api_feature.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/test/test_archive_api_feature.c,v 1.5 2008/05/26 17:00:24 kientzle Exp $");
DEFINE_TEST(test_archive_api_feature)
{
@@ -32,7 +31,7 @@ DEFINE_TEST(test_archive_api_feature)
/* This is the (hopefully) final versioning API. */
assertEqualInt(ARCHIVE_VERSION_NUMBER, archive_version_number());
- sprintf(buff, "libarchive %d.%d.%d",
+ snprintf(buff, sizeof(buff), "libarchive %d.%d.%d",
archive_version_number() / 1000000,
(archive_version_number() / 1000) % 1000,
archive_version_number() % 1000);
diff --git a/libarchive/test/test_archive_clear_error.c b/libarchive/test/test_archive_clear_error.c
index 66dbe93ec9e8..8b7609e07f2b 100644
--- a/libarchive/test/test_archive_clear_error.c
+++ b/libarchive/test/test_archive_clear_error.c
@@ -24,7 +24,6 @@
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
DEFINE_TEST(test_archive_clear_error)
{
diff --git a/libarchive/test/test_archive_cmdline.c b/libarchive/test/test_archive_cmdline.c
index a8236105af0b..e72acb4e9d37 100644
--- a/libarchive/test/test_archive_cmdline.c
+++ b/libarchive/test/test_archive_cmdline.c
@@ -24,7 +24,6 @@
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
#define __LIBARCHIVE_TEST
#include "archive_cmdline_private.h"
diff --git a/libarchive/test/test_archive_getdate.c b/libarchive/test/test_archive_getdate.c
index 9e91b83ba81d..e5b8bf7fa8f8 100644
--- a/libarchive/test/test_archive_getdate.c
+++ b/libarchive/test/test_archive_getdate.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
#include <time.h>
diff --git a/libarchive/test/test_archive_match_owner.c b/libarchive/test/test_archive_match_owner.c
index 6bf9c6f08cfd..dc31c525941c 100644
--- a/libarchive/test/test_archive_match_owner.c
+++ b/libarchive/test/test_archive_match_owner.c
@@ -24,7 +24,6 @@
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
static void
test_uid(void)
diff --git a/libarchive/test/test_archive_match_path.c b/libarchive/test/test_archive_match_path.c
index 5e9b9a8cbf63..ce48263f7614 100644
--- a/libarchive/test/test_archive_match_path.c
+++ b/libarchive/test/test_archive_match_path.c
@@ -24,7 +24,6 @@
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
static void
test_exclusion_mbs(void)
diff --git a/libarchive/test/test_archive_match_time.c b/libarchive/test/test_archive_match_time.c
index c6864b3265e4..25a0623a7e5a 100644
--- a/libarchive/test/test_archive_match_time.c
+++ b/libarchive/test/test_archive_match_time.c
@@ -24,7 +24,6 @@
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
#define __LIBARCHIVE_BUILD 1
#include "archive_getdate.h"
@@ -321,6 +320,11 @@ test_newer_ctime_than_file_mbs(void)
struct archive_entry *ae;
struct archive *m;
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ skipping("Can't set ctime on Windows");
+ return;
+#endif
+
if (!assert((m = archive_match_new()) != NULL))
return;
if (!assert((ae = archive_entry_new()) != NULL)) {
@@ -435,6 +439,11 @@ test_newer_ctime_than_file_wcs(void)
struct archive_entry *ae;
struct archive *m;
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ skipping("Can't set ctime on Windows");
+ return;
+#endif
+
if (!assert((m = archive_match_new()) != NULL))
return;
if (!assert((ae = archive_entry_new()) != NULL)) {
@@ -782,6 +791,11 @@ test_older_ctime_than_file_mbs(void)
struct archive_entry *ae;
struct archive *m;
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ skipping("Can't set ctime on Windows");
+ return;
+#endif
+
if (!assert((m = archive_match_new()) != NULL))
return;
if (!assert((ae = archive_entry_new()) != NULL)) {
@@ -897,6 +911,11 @@ test_older_ctime_than_file_wcs(void)
struct archive_entry *ae;
struct archive *m;
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ skipping("Can't set ctime on Windows");
+ return;
+#endif
+
if (!assert((m = archive_match_new()) != NULL))
return;
if (!assert((ae = archive_entry_new()) != NULL)) {
@@ -1073,6 +1092,11 @@ test_ctime_between_files_mbs(void)
struct archive_entry *ae;
struct archive *m;
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ skipping("Can't set ctime on Windows");
+ return;
+#endif
+
if (!assert((m = archive_match_new()) != NULL))
return;
if (!assert((ae = archive_entry_new()) != NULL)) {
@@ -1132,6 +1156,11 @@ test_ctime_between_files_wcs(void)
struct archive_entry *ae;
struct archive *m;
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ skipping("Can't set ctime on Windows");
+ return;
+#endif
+
if (!assert((m = archive_match_new()) != NULL))
return;
if (!assert((ae = archive_entry_new()) != NULL)) {
diff --git a/libarchive/test/test_archive_pathmatch.c b/libarchive/test/test_archive_pathmatch.c
index 0116df0288d2..3696d38fcf19 100644
--- a/libarchive/test/test_archive_pathmatch.c
+++ b/libarchive/test/test_archive_pathmatch.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
#define __LIBARCHIVE_TEST
#include "archive_pathmatch.h"
diff --git a/libarchive/test/test_archive_read_add_passphrase.c b/libarchive/test/test_archive_read_add_passphrase.c
index 0ce5a76aedbc..c9b051101433 100644
--- a/libarchive/test/test_archive_read_add_passphrase.c
+++ b/libarchive/test/test_archive_read_add_passphrase.c
@@ -25,7 +25,6 @@
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
struct archive_read;
extern void __archive_read_reset_passphrase(struct archive_read *);
diff --git a/libarchive/test/test_archive_read_close_twice.c b/libarchive/test/test_archive_read_close_twice.c
index 16cc805fe027..2f5ee77f117e 100644
--- a/libarchive/test/test_archive_read_close_twice.c
+++ b/libarchive/test/test_archive_read_close_twice.c
@@ -24,8 +24,6 @@
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
-
DEFINE_TEST(test_archive_read_close_twice)
{
diff --git a/libarchive/test/test_archive_read_close_twice_open_fd.c b/libarchive/test/test_archive_read_close_twice_open_fd.c
index 3aba31791357..62a6a90df1fa 100644
--- a/libarchive/test/test_archive_read_close_twice_open_fd.c
+++ b/libarchive/test/test_archive_read_close_twice_open_fd.c
@@ -24,7 +24,6 @@
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
DEFINE_TEST(test_archive_read_close_twice_open_fd)
{
diff --git a/libarchive/test/test_archive_read_close_twice_open_filename.c b/libarchive/test/test_archive_read_close_twice_open_filename.c
index 9a194fdc4a8b..4824319b42bf 100644
--- a/libarchive/test/test_archive_read_close_twice_open_filename.c
+++ b/libarchive/test/test_archive_read_close_twice_open_filename.c
@@ -24,7 +24,6 @@
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
DEFINE_TEST(test_archive_read_close_twice_open_filename)
{
diff --git a/libarchive/test/test_archive_read_multiple_data_objects.c b/libarchive/test/test_archive_read_multiple_data_objects.c
index 9962cf7fdf33..f5adb5b7b567 100644
--- a/libarchive/test/test_archive_read_multiple_data_objects.c
+++ b/libarchive/test/test_archive_read_multiple_data_objects.c
@@ -25,7 +25,6 @@
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
#if defined(_WIN32) && !defined(__CYGWIN__)
#define open _open
@@ -185,7 +184,7 @@ file_open(struct archive *a, void *data)
mydata->fd = open(mydata->filename, O_RDONLY | O_BINARY);
if (mydata->fd >= 0)
{
- if ((mydata->buffer = (void*)calloc(1, BLOCK_SIZE)) == NULL)
+ if ((mydata->buffer = (void*)calloc(BLOCK_SIZE, 1)) == NULL)
return (ARCHIVE_FAILED);
}
}
@@ -287,7 +286,7 @@ test_customized_multiple_data_objects(void)
return;
}
assert((mydata->filename =
- (char *)calloc(1, strlen(filename) + 1)) != NULL);
+ (char *)calloc(strlen(filename) + 1, sizeof(char))) != NULL);
if (mydata->filename == NULL) {
free(mydata);
assertEqualInt(ARCHIVE_OK, archive_read_free(a));
diff --git a/libarchive/test/test_archive_read_next_header_empty.c b/libarchive/test/test_archive_read_next_header_empty.c
index f43cbd934288..ee00291b51cd 100644
--- a/libarchive/test/test_archive_read_next_header_empty.c
+++ b/libarchive/test/test_archive_read_next_header_empty.c
@@ -24,7 +24,6 @@
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
static void
test_empty_file1(void)
diff --git a/libarchive/test/test_archive_read_next_header_raw.c b/libarchive/test/test_archive_read_next_header_raw.c
index 1c8af20f8c3e..c3fbb8c21ac4 100644
--- a/libarchive/test/test_archive_read_next_header_raw.c
+++ b/libarchive/test/test_archive_read_next_header_raw.c
@@ -24,7 +24,6 @@
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
#define DATA "random garbage for testing purposes"
diff --git a/libarchive/test/test_archive_read_open2.c b/libarchive/test/test_archive_read_open2.c
index 0a801ac5d26d..6ba27cc4a134 100644
--- a/libarchive/test/test_archive_read_open2.c
+++ b/libarchive/test/test_archive_read_open2.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
static int
open_cb(struct archive *a, void *client)
diff --git a/libarchive/test/test_archive_read_set_filter_option.c b/libarchive/test/test_archive_read_set_filter_option.c
index 31d575fc737e..68494abbc1e9 100644
--- a/libarchive/test/test_archive_read_set_filter_option.c
+++ b/libarchive/test/test_archive_read_set_filter_option.c
@@ -24,7 +24,6 @@
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
#define should(__a, __code, __m, __o, __v) \
assertEqualInt(__code, archive_read_set_filter_option(__a, __m, __o, __v))
diff --git a/libarchive/test/test_archive_read_set_format_option.c b/libarchive/test/test_archive_read_set_format_option.c
index 2d7acf3a0aa4..e32d8112445c 100644
--- a/libarchive/test/test_archive_read_set_format_option.c
+++ b/libarchive/test/test_archive_read_set_format_option.c
@@ -24,7 +24,6 @@
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
#define should(__a, __code, __m, __o, __v) \
assertEqualInt(__code, archive_read_set_format_option(__a, __m, __o, __v))
diff --git a/libarchive/test/test_archive_read_set_option.c b/libarchive/test/test_archive_read_set_option.c
index 0b816b7cd838..195c1eaa3e13 100644
--- a/libarchive/test/test_archive_read_set_option.c
+++ b/libarchive/test/test_archive_read_set_option.c
@@ -24,7 +24,6 @@
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
#define should(__a, __code, __m, __o, __v) \
assertEqualInt(__code, archive_read_set_option(__a, __m, __o, __v))
diff --git a/libarchive/test/test_archive_read_set_options.c b/libarchive/test/test_archive_read_set_options.c
index a8c68d7dd4cf..2f1f344eaad3 100644
--- a/libarchive/test/test_archive_read_set_options.c
+++ b/libarchive/test/test_archive_read_set_options.c
@@ -24,7 +24,6 @@
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
#define should(__a, __code, __opts) \
assertEqualInt(__code, archive_read_set_options(__a, __opts))
diff --git a/libarchive/test/test_archive_read_support.c b/libarchive/test/test_archive_read_support.c
index c6eb9346c627..b0c928023e8c 100644
--- a/libarchive/test/test_archive_read_support.c
+++ b/libarchive/test/test_archive_read_support.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
/*
* Verify that the various archive_read_support_* functions
diff --git a/libarchive/test/test_archive_set_error.c b/libarchive/test/test_archive_set_error.c
index b83c08c884e9..402d5522a661 100644
--- a/libarchive/test/test_archive_set_error.c
+++ b/libarchive/test/test_archive_set_error.c
@@ -24,7 +24,6 @@
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
static void
test(struct archive *a, int code, const char *msg)
diff --git a/libarchive/test/test_archive_string.c b/libarchive/test/test_archive_string.c
index 7fa743ba9ed2..f8f1e337bf73 100644
--- a/libarchive/test/test_archive_string.c
+++ b/libarchive/test/test_archive_string.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
#define __LIBARCHIVE_TEST
#include "archive_string.h"
@@ -406,7 +405,7 @@ DEFINE_TEST(test_archive_string_sort)
srand((unsigned int)time(NULL));
size = sizeof(strings) / sizeof(char *);
- assert((test_strings = (char **)calloc(1, sizeof(strings))) != NULL);
+ assert((test_strings = (char **)calloc(size, sizeof(char *))) != NULL);
for (i = 0; i < (size - 1); i++)
assert((test_strings[i] = strdup(strings[i])) != NULL);
diff --git a/libarchive/test/test_archive_string_conversion.c b/libarchive/test/test_archive_string_conversion.c
index fb5359b6f349..d8c75888a4b3 100644
--- a/libarchive/test/test_archive_string_conversion.c
+++ b/libarchive/test/test_archive_string_conversion.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
#include <locale.h>
@@ -42,8 +41,7 @@ if [ ! -f ${if} ]; then
exit 0
fi
of=test_archive_string_conversion.txt.Z
-echo "\$FreeBSD\$" > ${of}.uu
-awk -F ';' '$0 ~/^[0-9A-F]+/ {printf "%s;%s\n", $2, $3}' ${if} | compress | uuencode ${of} >> ${of}.uu
+awk -F ';' '$0 ~/^[0-9A-F]+/ {printf "%s;%s\n", $2, $3}' ${if} | compress | uuencode ${of} > ${of}.uu
exit 1
*/
@@ -847,6 +845,7 @@ test_archive_string_set_get(void)
assertEqualInt(0, archive_mstring_update_utf8(a, &mstr, "EEEEE---H"));
check_string(a, &mstr, sc, "EEEEE---H", L"EEEEE---H");
+ archive_mstring_clean(&mstr);
assertEqualInt(ARCHIVE_OK, archive_read_free(a));
}
diff --git a/libarchive/test/test_archive_string_conversion.txt.Z.uu b/libarchive/test/test_archive_string_conversion.txt.Z.uu
index 33c2e03bf7a2..a36323393720 100644
--- a/libarchive/test/test_archive_string_conversion.txt.Z.uu
+++ b/libarchive/test/test_archive_string_conversion.txt.Z.uu
@@ -1,4 +1,3 @@
-$FreeBSD$
begin 644 test_archive_string_conversion.txt.Z
M'YV0,8K`"+(#!@P:-$#`F`'CAH*`,(84/)APH8P9#P4.4<CPQD2$'"]R;)@Q
MXDB/!D%:G'&RY,:%#3]6G"$2ID.(+SO*#,G29LD@'&,(V;E0:$N<08>FG&ET
diff --git a/libarchive/test/test_archive_write_add_filter_by_name.c b/libarchive/test/test_archive_write_add_filter_by_name.c
index 49f91ac554dc..c80e161c3b58 100644
--- a/libarchive/test/test_archive_write_add_filter_by_name.c
+++ b/libarchive/test/test_archive_write_add_filter_by_name.c
@@ -23,9 +23,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-
#include "test.h"
-__FBSDID("$FreeBSD$");
static void
test_filter_by_name(const char *filter_name, int filter_code,
@@ -38,7 +36,7 @@ test_filter_by_name(const char *filter_name, int filter_code,
char *buff;
int r;
- assert((buff = calloc(1, buffsize)) != NULL);
+ assert((buff = calloc(buffsize, sizeof(char))) != NULL);
if (buff == NULL)
return;
diff --git a/libarchive/test/test_archive_write_set_filter_option.c b/libarchive/test/test_archive_write_set_filter_option.c
index ab8e67773b50..6b90a831b469 100644
--- a/libarchive/test/test_archive_write_set_filter_option.c
+++ b/libarchive/test/test_archive_write_set_filter_option.c
@@ -24,7 +24,6 @@
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
#define should(__a, __code, __m, __o, __v) \
assertEqualInt(__code, archive_write_set_filter_option(__a, __m, __o, __v))
diff --git a/libarchive/test/test_archive_write_set_format_by_name.c b/libarchive/test/test_archive_write_set_format_by_name.c
index ef1327431b37..07942f6bffc8 100644
--- a/libarchive/test/test_archive_write_set_format_by_name.c
+++ b/libarchive/test/test_archive_write_set_format_by_name.c
@@ -23,9 +23,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-
#include "test.h"
-__FBSDID("$FreeBSD$");
static void
test_format_by_name(const char *format_name, const char *compression_type,
diff --git a/libarchive/test/test_archive_write_set_format_filter_by_ext.c b/libarchive/test/test_archive_write_set_format_filter_by_ext.c
index 22345038609a..fe6c350e48e7 100644
--- a/libarchive/test/test_archive_write_set_format_filter_by_ext.c
+++ b/libarchive/test/test_archive_write_set_format_filter_by_ext.c
@@ -24,9 +24,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-
#include "test.h"
-__FBSDID("$FreeBSD$");
static void
test_format_filter_by_ext(const char *output_file,
diff --git a/libarchive/test/test_archive_write_set_format_option.c b/libarchive/test/test_archive_write_set_format_option.c
index d964df44d7fa..38f83aba2ede 100644
--- a/libarchive/test/test_archive_write_set_format_option.c
+++ b/libarchive/test/test_archive_write_set_format_option.c
@@ -24,7 +24,6 @@
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
#define should(__a, __code, __m, __o, __v) \
assertEqualInt(__code, archive_write_set_format_option(__a, __m, __o, __v))
diff --git a/libarchive/test/test_archive_write_set_option.c b/libarchive/test/test_archive_write_set_option.c
index 27782342f330..aa44edad653d 100644
--- a/libarchive/test/test_archive_write_set_option.c
+++ b/libarchive/test/test_archive_write_set_option.c
@@ -24,7 +24,6 @@
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
#define should(__a, __code, __m, __o, __v) \
assertEqualInt(__code, archive_write_set_option(__a, __m, __o, __v))
diff --git a/libarchive/test/test_archive_write_set_options.c b/libarchive/test/test_archive_write_set_options.c
index db7e50e7f0f8..6a0198de35e1 100644
--- a/libarchive/test/test_archive_write_set_options.c
+++ b/libarchive/test/test_archive_write_set_options.c
@@ -24,7 +24,6 @@
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
#define should(__a, __code, __opts) \
assertEqualInt(__code, archive_write_set_options(__a, __opts))
diff --git a/libarchive/test/test_archive_write_set_passphrase.c b/libarchive/test/test_archive_write_set_passphrase.c
index 4bfcbb2c2dab..6e7e66531427 100644
--- a/libarchive/test/test_archive_write_set_passphrase.c
+++ b/libarchive/test/test_archive_write_set_passphrase.c
@@ -25,7 +25,6 @@
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
struct archive_write;
extern const char * __archive_write_get_passphrase(struct archive_write *);
diff --git a/libarchive/test/test_bad_fd.c b/libarchive/test/test_bad_fd.c
index f8144a3c39a4..11697da49d71 100644
--- a/libarchive/test/test_bad_fd.c
+++ b/libarchive/test/test_bad_fd.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/test/test_bad_fd.c,v 1.2 2008/09/01 05:38:33 kientzle Exp $");
/* Verify that attempting to open an invalid fd returns correct error. */
DEFINE_TEST(test_bad_fd)
diff --git a/libarchive/test/test_compat_bzip2.c b/libarchive/test/test_compat_bzip2.c
index 7df086ff382d..e126e6f7d329 100644
--- a/libarchive/test/test_compat_bzip2.c
+++ b/libarchive/test/test_compat_bzip2.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/test/test_compat_bzip2.c 201247 2009-12-30 05:59:21Z kientzle $");
/*
* Verify our ability to read sample files compatibly with bunzip2.
diff --git a/libarchive/test/test_compat_bzip2_1.tbz.uu b/libarchive/test/test_compat_bzip2_1.tbz.uu
index 989af82b2e56..8de9101478a9 100644
--- a/libarchive/test/test_compat_bzip2_1.tbz.uu
+++ b/libarchive/test/test_compat_bzip2_1.tbz.uu
@@ -1,5 +1,3 @@
-$FreeBSD: head/lib/libarchive/test/test_compat_bzip2_1.tbz.uu 185683 2008-12-06 07:08:08Z kientzle $
-
begin 644 test_compat_bzip2_1.tbz
M0EIH.3%!62936;12^)(``#-;D=$00`!_@``!8RT>$`0`$```""``5#5/*'J>
MD#(&30_5!H4_5-ZH`T``327U4@&L('"(9-%8<7&$I,`:7FXH<P(<:8)$*)(U
diff --git a/libarchive/test/test_compat_bzip2_2.tbz.uu b/libarchive/test/test_compat_bzip2_2.tbz.uu
index 9ba63e8772bd..cd0dc6b93d3e 100644
--- a/libarchive/test/test_compat_bzip2_2.tbz.uu
+++ b/libarchive/test/test_compat_bzip2_2.tbz.uu
@@ -1,5 +1,3 @@
-$FreeBSD: head/lib/libarchive/test/test_compat_bzip2_2.tbz.uu 185683 2008-12-06 07:08:08Z kientzle $
-
begin 644 test_compat_bzip2_2.tbz
M0EIH.3%!629361HI1P<``4#;D-$00`#_@``)9RT>$`0``!@P`/@#&$Q,F`F`
M`,83$R8"8``1133"1/2-J-#$/U3@;XVF9V'`Y3882XA$*KO6\WTL`]QU&J"8
diff --git a/libarchive/test/test_compat_cpio.c b/libarchive/test/test_compat_cpio.c
index 0c8b04232521..12512881112b 100644
--- a/libarchive/test/test_compat_cpio.c
+++ b/libarchive/test/test_compat_cpio.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/test/test_compat_cpio.c 201247 2009-12-30 05:59:21Z kientzle $");
/*
* Verify our ability to read various sample files.
diff --git a/libarchive/test/test_compat_cpio_1.cpio.uu b/libarchive/test/test_compat_cpio_1.cpio.uu
index 967a344b409e..5cfc0d29f2f5 100644
--- a/libarchive/test/test_compat_cpio_1.cpio.uu
+++ b/libarchive/test/test_compat_cpio_1.cpio.uu
@@ -1,5 +1,3 @@
-$FreeBSD: head/lib/libarchive/test/test_compat_cpio_1.cpio.uu 201247 2009-12-30 05:59:21Z kientzle $
-
begin 644 test_compat_cpio_1.cpio
M,#<P-S`Q,#`U-CEE8F4P,#`P.#%A-#`P,#`P,V4X,#`P,#`S93@P,#`P,#`P
M,31B,61E-#<T,#`P,#`P,#0P,#`P,#`P,#`P,#`P,#4T,#`P,#`P,#`P,#`P
diff --git a/libarchive/test/test_compat_gtar.c b/libarchive/test/test_compat_gtar.c
index 70669244efb9..ba42e726cf78 100644
--- a/libarchive/test/test_compat_gtar.c
+++ b/libarchive/test/test_compat_gtar.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/test/test_compat_gtar.c 189308 2009-03-03 17:02:51Z kientzle $");
/*
* Verify our ability to read sample files created by GNU tar.
diff --git a/libarchive/test/test_compat_gtar_1.tar.uu b/libarchive/test/test_compat_gtar_1.tar.uu
index da54476e8812..fbcd1aa3af2a 100644
--- a/libarchive/test/test_compat_gtar_1.tar.uu
+++ b/libarchive/test/test_compat_gtar_1.tar.uu
@@ -1,4 +1,3 @@
-$FreeBSD: head/lib/libarchive/test/test_compat_gtar_1.tar.uu 189308 2009-03-03 17:02:51Z kientzle $
begin 644 test_compat_gtar_1.tar
M+B\N+T!,;VYG3&EN:P``````````````````````````````````````````
M````````````````````````````````````````````````````````````
diff --git a/libarchive/test/test_compat_gtar_2.tar.uu b/libarchive/test/test_compat_gtar_2.tar.uu
index 7843a2cbaeb6..63303056f47f 100644
--- a/libarchive/test/test_compat_gtar_2.tar.uu
+++ b/libarchive/test/test_compat_gtar_2.tar.uu
@@ -1,4 +1,4 @@
-begin 660 test_compat_gtar_2.tar.uu
+begin 660 test_compat_gtar_2.tar
M9FEL95]W:71H7V)I9U]U:61?9VED````````````````````````````````
M````````````````````````````````````````````````````````````
M`````````````#`P,#`V-C8`@``````@```Q,#`P,#`P,#`P,#`P,#`P,38W
diff --git a/libarchive/test/test_compat_gzip.c b/libarchive/test/test_compat_gzip.c
index befb825c8ce6..20fce7af432d 100644
--- a/libarchive/test/test_compat_gzip.c
+++ b/libarchive/test/test_compat_gzip.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/test/test_compat_gzip.c 191183 2009-04-17 01:06:31Z kientzle $");
/*
* Verify our ability to read sample files compatibly with gunzip.
diff --git a/libarchive/test/test_compat_gzip_1.tgz.uu b/libarchive/test/test_compat_gzip_1.tgz.uu
index db23f03747e1..c4793a634c00 100644
--- a/libarchive/test/test_compat_gzip_1.tgz.uu
+++ b/libarchive/test/test_compat_gzip_1.tgz.uu
@@ -1,5 +1,3 @@
-$FreeBSD: head/lib/libarchive/test/test_compat_gzip_1.tgz.uu 185683 2008-12-06 07:08:08Z kientzle $
-
begin 644 test_compat_gzip_1.tgz
M'XL(")B^(DD``W1E<W0M<W!L:70N=&%R86$`2S-DH#DP,#`P,S%1`-*&YJ:&
MR#0,&"L8`H&!J;&9F:&A@H&AH9&),8."`>V=QL!06ER26`1T2G9F:EY)54XJ
diff --git a/libarchive/test/test_compat_gzip_2.tgz.uu b/libarchive/test/test_compat_gzip_2.tgz.uu
index 683b2a1f255b..92c0940b93f1 100644
--- a/libarchive/test/test_compat_gzip_2.tgz.uu
+++ b/libarchive/test/test_compat_gzip_2.tgz.uu
@@ -1,5 +1,3 @@
-$FreeBSD: head/lib/libarchive/test/test_compat_gzip_2.tgz.uu 185683 2008-12-06 07:08:08Z kientzle $
-
begin 644 test_compat_gzip_2.tgz
M'XL(`&76(DD``^W800["(!"%8=:>@ALXPP`]CXF=Q&A<:-UX>EN)C5M,AL;P
MO@V[0A=_.E39F2.B'*.?5QX2?Z\?XGE&27)F]L0<HCA/]D=S[G&?#K?Y*.?3
diff --git a/libarchive/test/test_compat_lz4.c b/libarchive/test/test_compat_lz4.c
index eb763c1a7021..9e309a9fbd20 100644
--- a/libarchive/test/test_compat_lz4.c
+++ b/libarchive/test/test_compat_lz4.c
@@ -24,7 +24,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
/*
* Verify our ability to read sample files compatibly with 'lz4 -d'.
diff --git a/libarchive/test/test_compat_lzip.c b/libarchive/test/test_compat_lzip.c
index 8f4e06d3af77..d3b8b118322b 100644
--- a/libarchive/test/test_compat_lzip.c
+++ b/libarchive/test/test_compat_lzip.c
@@ -24,7 +24,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
/*
Execute the following to rebuild the data for this program:
@@ -130,6 +129,85 @@ compat_lzip(const char *name)
}
+static void
+compat_lzip_3(const char *name)
+{
+ struct archive_entry *ae;
+ struct archive *a;
+ int r;
+ const int data_size = 65537;
+ static uint8_t buff[65537];
+
+ assert((a = archive_read_new()) != NULL);
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_support_filter_all(a));
+ r = archive_read_support_filter_lzip(a);
+ if (r == ARCHIVE_WARN) {
+ skipping("lzip reading not fully supported on this platform");
+ assertEqualInt(ARCHIVE_OK, archive_read_free(a));
+ return;
+ }
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_raw(a));
+ extract_reference_file(name);
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_read_open_filename(a, name, 64 * 1024));
+
+ /* Read an entry. */
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
+ assertEqualString("data", archive_entry_pathname(ae));
+ /* Verify that whole data could be read. */
+ assertEqualInt(data_size, archive_read_data(a, buff, data_size));
+
+ /* 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_LZIP);
+ assertEqualString(archive_filter_name(a, 0), "lzip");
+ assertEqualInt(archive_format(a), ARCHIVE_FORMAT_RAW);
+
+ assertEqualInt(ARCHIVE_OK, archive_read_close(a));
+ assertEqualInt(ARCHIVE_OK, archive_read_free(a));
+}
+
+
+static void
+compat_lzip_4(const char *name)
+{
+ 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));
+ r = archive_read_support_filter_lzip(a);
+ if (r == ARCHIVE_WARN) {
+ skipping("lzip reading not fully supported on this platform");
+ assertEqualInt(ARCHIVE_OK, archive_read_free(a));
+ return;
+ }
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a));
+ extract_reference_file(name);
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_read_open_filename(a, name, 64 * 1024));
+
+ /* Read an entry. */
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
+ assertEqualString("test.bin", archive_entry_pathname(ae));
+
+ /* Verify the end-of-archive. */
+ archive_set_error(a, ARCHIVE_OK, NULL);
+ assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae));
+
+ /* Verify that the format detection worked. */
+ assertEqualInt(archive_filter_code(a, 0), ARCHIVE_FILTER_LZIP);
+ assertEqualString(archive_filter_name(a, 0), "lzip");
+ assertEqualInt(archive_format(a), ARCHIVE_FORMAT_TAR_USTAR);
+
+ assertEqualInt(ARCHIVE_OK, archive_read_close(a));
+ assertEqualInt(ARCHIVE_OK, archive_read_free(a));
+}
+
+
DEFINE_TEST(test_compat_lzip)
{
/* This sample has been 'split', each piece compressed separately,
@@ -138,4 +216,9 @@ DEFINE_TEST(test_compat_lzip)
/* This sample has been compressed as a single stream, but then
* some unrelated garbage text has been appended to the end. */
compat_lzip("test_compat_lzip_2.tlz");
+
+ /* These samples have been compressed as multi stream and an eof
+ * of a member is at a read buffer boundary. */
+ compat_lzip_3("test_compat_lzip_3.lz");
+ compat_lzip_4("test_compat_lzip_4.tlz");
}
diff --git a/libarchive/test/test_compat_lzip_3.lz.uu b/libarchive/test/test_compat_lzip_3.lz.uu
new file mode 100644
index 000000000000..d72f533f8e5a
--- /dev/null
+++ b/libarchive/test/test_compat_lzip_3.lz.uu
@@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"DC``O-1XII(M,8:!)XY?7SI<B6<`GAL-5X4+VX&?GO94R&W-IPLM!
+ME!=X*CZ.L=(\5&E.7+OOG57EHNV!P1AT9TR=81B^>Y6).2P`C[8#Q9':4_UB
+MR>V")LVF3]B!XB[M8-J??_M?_'RS8"V/E%D```$``````!H``0``````3%I)
+B4`$,`![!^____^````"<HVJ*`0`````````E````````````
+`
+end
diff --git a/libarchive/test/test_compat_lzip_4.tlz.uu b/libarchive/test/test_compat_lzip_4.tlz.uu
new file mode 100644
index 000000000000..6a230c5e1322
--- /dev/null
+++ b/libarchive/test/test_compat_lzip_4.tlz.uu
@@ -0,0 +1,1474 @@
+begin 644 test_compat_lzip_4.tlz
+M3%I)4`$0`#H92LX=B#^/,V.RMB3H=-9J&)_2[OLAN752"JXEYZ_G)C;@/J7Z
+M@BB-Y9[^'[ALT^7`3(7N!KF!'#6PF`@=V`V">L0?;=OX-*CDH_90X##_1@T<
+M];==,RL,I\/9VH>/%)Z>_:ZS4SDB_6N)LMB#H"1=E*W^T'6/5=R+'3I9%JVP
+M`/W$QUD9J$$<D^\G\FI85#'0'QG6H_;I?0RGJ?1'Q9)8\&>":?1U-V.M]A"_
+MBJ=<*?B6VMA:Z/VM>WIK%(^--,QH\+P8\D!P->[9_W>%O/:-86#R\]Y!4RLQ
+MQ:@7GT?14O-\49UMC=1EZ"CX373-#>9C*_W)Y3XF]5/\;`03YR709\T\<$C=
+M(?O>E(E"T>Q:)(RKN_@J/C=:(AW)*=!U:>YTSXBEQ#B96G\^/Q0RNB9^"I:*
+M3!'JB$H!,ADB5\UJ%$'<\0Z=U<R9MRS'<Y]"(KL/<N^'UIGXVOIY^:;<?6NR
+MSU4S#M,.,0!T\F,7TOQW[XMF1*^_6G[A-H.:H`E[YR/EXLG80ZZ0D/BFC=W<
+M:^C'KBK-=[K6XXCMW0JB_R4:?,M%R>AU?O=0%.'=]/9"/K4)WL?`H$MGKH0T
+M8RL1;!17_8`->99"#@L=?7>G!N=GWDQ*MJ&23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LAY*3--[:1V-1JW6D$FQ+L>
+MX23XQ9TS)M)Q2KL&(NP15;E^Y^GOYH#R&`+'\-16VD8%$;^?7*\U,#O)-^X!
+M:K\,_#9G>M!CT$%PUE5HPCTC:<9_E!_%@,J>%T;8_`5:]U`]58>6>;.A%N-]
+M52?*B11FEJ;*^3RWD+6R_,#95S,V>ON/___,%P``X)_<F@`8````````40(`
+%````````
+`
+end
diff --git a/libarchive/test/test_compat_lzma.c b/libarchive/test/test_compat_lzma.c
index 7e6e3a89f9c1..b9cad55514a1 100644
--- a/libarchive/test/test_compat_lzma.c
+++ b/libarchive/test/test_compat_lzma.c
@@ -24,7 +24,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/test/test_compat_lzma.c 201247 2009-12-30 05:59:21Z kientzle $");
/*
Execute the following to rebuild the data for this program:
diff --git a/libarchive/test/test_compat_lzma_1.tlz.uu b/libarchive/test/test_compat_lzma_1.tlz.uu
index 57fa501f00df..ceee3b979069 100644
--- a/libarchive/test/test_compat_lzma_1.tlz.uu
+++ b/libarchive/test/test_compat_lzma_1.tlz.uu
@@ -1,5 +1,3 @@
-$FreeBSD: head/lib/libarchive/test/test_compat_lzma_1.tlz.uu 201247 2009-12-30 05:59:21Z kientzle $
-
begin 644 test_compat_lzma_1.tlz
M70``@`#__________P`S##P;IXPT!HUK`DO\DC[V2OB%Z^'=ZT59ANYMTD(/
M^W;\8!%O7<+P&=#(9W<_!$Z.7/Y<&\(8+E0^,_-\Z"D^P'N0J^4-UH"WMJ<&
diff --git a/libarchive/test/test_compat_lzma_2.tlz.uu b/libarchive/test/test_compat_lzma_2.tlz.uu
index ff91d2a608fe..b57d990fe333 100644
--- a/libarchive/test/test_compat_lzma_2.tlz.uu
+++ b/libarchive/test/test_compat_lzma_2.tlz.uu
@@ -1,5 +1,3 @@
-$FreeBSD: head/lib/libarchive/test/test_compat_lzma_2.tlz.uu 201247 2009-12-30 05:59:21Z kientzle $
-
begin 644 test_compat_lzma_2.tlz
M7@``@`#__________P`S##P;IXPT!HUK`DO\DC[V2OB%Z^'<FN`(!=!,)@8W
M9R(6\QIOTA6SGM20X;2'6#3B&HC%2XOX2?D['5WD"`>`W2"/3R1F1:P:&Q9A
diff --git a/libarchive/test/test_compat_lzma_3.tlz.uu b/libarchive/test/test_compat_lzma_3.tlz.uu
index bee82897beb1..1976f364d211 100644
--- a/libarchive/test/test_compat_lzma_3.tlz.uu
+++ b/libarchive/test/test_compat_lzma_3.tlz.uu
@@ -1,5 +1,3 @@
-$FreeBSD: head/lib/libarchive/test/test_compat_lzma_3.tlz.uu 201247 2009-12-30 05:59:21Z kientzle $
-
begin 644 test_compat_lzma_3.tlz
M70`0````'``````````S##P;IXPT!HUK`DO\DC[V2OB%Z^'=ZT59ANYMTD(1
M$Y^=;\4%U_CXKQ*F$OFZKEQUG)1U8="](V<2K"U1\Z6%H(UNQ[Y3.=D'>_G-
diff --git a/libarchive/test/test_compat_lzop.c b/libarchive/test/test_compat_lzop.c
index cd43afcf3e99..2da4e8eb6dc2 100644
--- a/libarchive/test/test_compat_lzop.c
+++ b/libarchive/test/test_compat_lzop.c
@@ -24,7 +24,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
/*
* Verify our ability to read sample files compatibly with lzop.
diff --git a/libarchive/test/test_compat_mac.c b/libarchive/test/test_compat_mac.c
index 5caa17f83e63..976f04a473f6 100644
--- a/libarchive/test/test_compat_mac.c
+++ b/libarchive/test/test_compat_mac.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
/* The sample has some files in a directory with a very long name. */
#define TESTPATH "abcdefghijklmnopqrstuvwxyz/" \
diff --git a/libarchive/test/test_compat_perl_archive_tar.c b/libarchive/test/test_compat_perl_archive_tar.c
index 165a519a3432..94abe3f056a3 100644
--- a/libarchive/test/test_compat_perl_archive_tar.c
+++ b/libarchive/test/test_compat_perl_archive_tar.c
@@ -23,7 +23,6 @@
* 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
diff --git a/libarchive/test/test_compat_plexus_archiver_tar.c b/libarchive/test/test_compat_plexus_archiver_tar.c
index 0f8bedc2df5f..419e84b1c4c9 100644
--- a/libarchive/test/test_compat_plexus_archiver_tar.c
+++ b/libarchive/test/test_compat_plexus_archiver_tar.c
@@ -23,7 +23,6 @@
* 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
diff --git a/libarchive/test/test_compat_solaris_pax_sparse.c b/libarchive/test/test_compat_solaris_pax_sparse.c
index 0ab333bb180b..c25c4eb8f51e 100644
--- a/libarchive/test/test_compat_solaris_pax_sparse.c
+++ b/libarchive/test/test_compat_solaris_pax_sparse.c
@@ -23,8 +23,6 @@
* 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 Solaris pax for
* a sparse file.
diff --git a/libarchive/test/test_compat_solaris_tar_acl.c b/libarchive/test/test_compat_solaris_tar_acl.c
index 815977290670..df7435c7cbec 100644
--- a/libarchive/test/test_compat_solaris_tar_acl.c
+++ b/libarchive/test/test_compat_solaris_tar_acl.c
@@ -24,7 +24,6 @@
* 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
diff --git a/libarchive/test/test_compat_star_acl.c b/libarchive/test/test_compat_star_acl.c
index 824710194c18..749f5ce34294 100644
--- a/libarchive/test/test_compat_star_acl.c
+++ b/libarchive/test/test_compat_star_acl.c
@@ -24,7 +24,6 @@
* 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
diff --git a/libarchive/test/test_compat_tar_directory.c b/libarchive/test/test_compat_tar_directory.c
index 5750db3628e3..3d086f1da7bc 100644
--- a/libarchive/test/test_compat_tar_directory.c
+++ b/libarchive/test/test_compat_tar_directory.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
/*
* Background: Original tar file format did not use its linkflag to
diff --git a/libarchive/test/test_compat_tar_directory_1.tar.uu b/libarchive/test/test_compat_tar_directory_1.tar.uu
index 3e1ead9b5172..513d55ffcb78 100644
--- a/libarchive/test/test_compat_tar_directory_1.tar.uu
+++ b/libarchive/test/test_compat_tar_directory_1.tar.uu
@@ -1,4 +1,3 @@
-$FreeBSD$
begin 644 test_compat_tar_directory_1.tar
M9&ER96-T;W)Y,2\`````````````````````````````````````````````
M````````````````````````````````````````````````````````````
diff --git a/libarchive/test/test_compat_tar_hardlink.c b/libarchive/test/test_compat_tar_hardlink.c
index 73a4d54f97fa..b8517440aea5 100644
--- a/libarchive/test/test_compat_tar_hardlink.c
+++ b/libarchive/test/test_compat_tar_hardlink.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/test/test_compat_tar_hardlink.c,v 1.3 2008/08/11 01:19:36 kientzle Exp $");
/*
* Background: There are two written standards for the tar file format.
diff --git a/libarchive/test/test_compat_tar_hardlink_1.tar.uu b/libarchive/test/test_compat_tar_hardlink_1.tar.uu
index 95dba54c256e..eeb31786da7e 100644
--- a/libarchive/test/test_compat_tar_hardlink_1.tar.uu
+++ b/libarchive/test/test_compat_tar_hardlink_1.tar.uu
@@ -1,4 +1,3 @@
-$FreeBSD: src/lib/libarchive/test/test_compat_tar_hardlink_1.tar.uu,v 1.1 2008/01/31 07:47:38 kientzle Exp $
begin 644 test_compat_tar_hardlink_1.tar
M>&UC9"TS+C,N,B]D;V-S7V0O4D5!1$UF````````````````````````````
M````````````````````````````````````````````````````````````
diff --git a/libarchive/test/test_compat_uudecode.c b/libarchive/test/test_compat_uudecode.c
index cfb17c85788d..d6936d9dcd5d 100644
--- a/libarchive/test/test_compat_uudecode.c
+++ b/libarchive/test/test_compat_uudecode.c
@@ -24,7 +24,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
static char archive_data[] = {
"begin 644 test_read_uu.Z\n"
diff --git a/libarchive/test/test_compat_uudecode_large.c b/libarchive/test/test_compat_uudecode_large.c
index a2ffd22663a5..c4ab0ec3fd0d 100644
--- a/libarchive/test/test_compat_uudecode_large.c
+++ b/libarchive/test/test_compat_uudecode_large.c
@@ -24,7 +24,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
DEFINE_TEST(test_compat_uudecode_large)
{
diff --git a/libarchive/test/test_compat_xz.c b/libarchive/test/test_compat_xz.c
index 572729c48542..f904583782d2 100644
--- a/libarchive/test/test_compat_xz.c
+++ b/libarchive/test/test_compat_xz.c
@@ -24,7 +24,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/test/test_compat_xz.c 191183 2009-04-17 01:06:31Z kientzle $");
/*
* Verify our ability to read sample files compatibly with unxz.
diff --git a/libarchive/test/test_compat_xz_1.txz.uu b/libarchive/test/test_compat_xz_1.txz.uu
index 9d4b8e8ee6d6..af47f4eee314 100644
--- a/libarchive/test/test_compat_xz_1.txz.uu
+++ b/libarchive/test/test_compat_xz_1.txz.uu
@@ -1,5 +1,4 @@
-$FreeBSD: head/lib/libarchive/test/test_compat_xz_1.txz.uu 191183 2009-04-17 01:06:31Z kientzle $
-begin 644 test_compat_gzip_1.txz
+begin 644 test_compat_xz_1.txz
M_3=Z6%H```3FUK1&`@`A`18```!T+^6CX`^?`(-=`#,,/!NGC#0&C6L"2_R2
M/O9*^(7KX=WM^(=KA(RH"\09$$)!Q_+JUHQ*`]R;ITL_F3/I6:^Q0550A&)B
MHS@=K]7@K1-9FOIP#PU!I<PUHW+W#<F(6FSL/<?5:4*>?E5&IHH&Q=N>_C&G
diff --git a/libarchive/test/test_compat_zip.c b/libarchive/test/test_compat_zip.c
index 813ea5dc6701..e2d41cc9b439 100644
--- a/libarchive/test/test_compat_zip.c
+++ b/libarchive/test/test_compat_zip.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/test/test_compat_zip.c 196962 2009-09-08 05:02:41Z kientzle $");
/* Copy this function for each test file and adjust it accordingly. */
DEFINE_TEST(test_compat_zip_1)
diff --git a/libarchive/test/test_compat_zip_1.zip.uu b/libarchive/test/test_compat_zip_1.zip.uu
index 29cdf96b029b..e13a6cac29d9 100644
--- a/libarchive/test/test_compat_zip_1.zip.uu
+++ b/libarchive/test/test_compat_zip_1.zip.uu
@@ -1,4 +1,3 @@
-$FreeBSD: src/lib/libarchive/test/test_compat_zip_1.zip.uu,v 1.2 2008/06/30 15:49:12 des Exp $
begin 644 test_compat_zip_1.zip
M4$L#!!0`"``(``B$@S<````````````````4````345402U)3D8O34%.249%
M4U0N34;S3<S+3$LM+M$-2RTJSLS/LU(PU#/@Y7+,0Q)Q+$A,SDA5`(H!)<U!
diff --git a/libarchive/test/test_compat_zip_8.zip.uu b/libarchive/test/test_compat_zip_8.zip.uu
index 316b6f62d4bb..2ab6cf70c670 100644
--- a/libarchive/test/test_compat_zip_8.zip.uu
+++ b/libarchive/test/test_compat_zip_8.zip.uu
@@ -1,6 +1,6 @@
-begin 666 test_compat_zip_8.zip
-M4$L#!!0````(`%A\;TOY6""D$`````X````(````87)C7'1E<W3[_Z^$(96A
-MF*&$@9>!BP$`4$L!`A0`%`````@`6'QO2_E8(*00````#@````@`````````
-H`````````````&%R8UQT97-T4$L%!@`````!``$`-@```#8`````````
-`
-end
+begin 666 test_compat_zip_8.zip
+M4$L#!!0````(`%A\;TOY6""D$`````X````(````87)C7'1E<W3[_Z^$(96A
+MF*&$@9>!BP$`4$L!`A0`%`````@`6'QO2_E8(*00````#@````@`````````
+H`````````````&%R8UQT97-T4$L%!@`````!``$`-@```#8`````````
+`
+end
diff --git a/libarchive/test/test_compat_zstd.c b/libarchive/test/test_compat_zstd.c
index 134775816a94..34b8edeb924d 100644
--- a/libarchive/test/test_compat_zstd.c
+++ b/libarchive/test/test_compat_zstd.c
@@ -23,8 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
-
/*
* Verify our ability to read sample files compatibly with 'zstd -d'.
*
diff --git a/libarchive/test/test_empty_write.c b/libarchive/test/test_empty_write.c
index a983df503993..b5572f73d77a 100644
--- a/libarchive/test/test_empty_write.c
+++ b/libarchive/test/test_empty_write.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/test/test_empty_write.c 189308 2009-03-03 17:02:51Z kientzle $");
DEFINE_TEST(test_empty_write)
{
diff --git a/libarchive/test/test_entry.c b/libarchive/test/test_entry.c
index f20576490a5f..228fdd8bcc56 100644
--- a/libarchive/test/test_entry.c
+++ b/libarchive/test/test_entry.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/test/test_entry.c 201247 2009-12-30 05:59:21Z kientzle $");
#include <locale.h>
diff --git a/libarchive/test/test_entry_strmode.c b/libarchive/test/test_entry_strmode.c
index ba183db025af..abeed4c483b2 100644
--- a/libarchive/test/test_entry_strmode.c
+++ b/libarchive/test/test_entry_strmode.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/test/test_entry_strmode.c 201247 2009-12-30 05:59:21Z kientzle $");
DEFINE_TEST(test_entry_strmode)
{
diff --git a/libarchive/test/test_extattr_freebsd.c b/libarchive/test/test_extattr_freebsd.c
index 7cb30b56067a..9d9a26e9d9f9 100644
--- a/libarchive/test/test_extattr_freebsd.c
+++ b/libarchive/test/test_extattr_freebsd.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/test/test_extattr_freebsd.c 201247 2009-12-30 05:59:21Z kientzle $");
#if defined(__FreeBSD__) && __FreeBSD__ > 4
#include <sys/extattr.h>
diff --git a/libarchive/test/test_filter_count.c b/libarchive/test/test_filter_count.c
index 4885ab89a52e..8b28795ee0d5 100644
--- a/libarchive/test/test_filter_count.c
+++ b/libarchive/test/test_filter_count.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/test/test_read_file_nonexistent.c 189473 2009-03-07 02:09:21Z kientzle $");
static void read_test(const char *name);
static void write_test(void);
diff --git a/libarchive/test/test_fuzz.c b/libarchive/test/test_fuzz.c
index 3fbe64410bc4..dcb4f73ca372 100644
--- a/libarchive/test/test_fuzz.c
+++ b/libarchive/test/test_fuzz.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/test/test_fuzz.c 201247 2009-12-30 05:59:21Z kientzle $");
/*
* This was inspired by an ISO fuzz tester written by Michal Zalewski
@@ -124,10 +123,9 @@ test_fuzz(const struct files *filesets)
newraw = realloc(rawimage, oldsize + size);
if (!assert(newraw != NULL))
{
- free(rawimage);
- rawimage = NULL;
free(tmp);
- continue;
+ size = 0;
+ break;
}
rawimage = newraw;
memcpy(rawimage + oldsize, tmp, size);
diff --git a/libarchive/test/test_fuzz_1.iso.Z.uu b/libarchive/test/test_fuzz_1.iso.Z.uu
index 07a3e934da43..0eb3f7deb4ce 100644
--- a/libarchive/test/test_fuzz_1.iso.Z.uu
+++ b/libarchive/test/test_fuzz_1.iso.Z.uu
@@ -1,5 +1,3 @@
-$FreeBSD: head/lib/libarchive/test/test_fuzz_1.iso.Z.uu 201247 2009-12-30 05:59:21Z kientzle $
-
begin 644 test_fuzz_1.iso.Z
M'YV0``(*'$BPH,&#"!,J7,BPH<.'$"-*G$BQHL6+&#-JW,BQH\>/($.*'$FR
MI,F3*%.J7,FRI<N7,&/*G$FSILV;.'/JW,FSI\^?0(,*'4JTJ-&C2),J7<JT
diff --git a/libarchive/test/test_gnutar_filename_encoding.c b/libarchive/test/test_gnutar_filename_encoding.c
index 3ec4f61290f8..f473ddfb4fe9 100644
--- a/libarchive/test/test_gnutar_filename_encoding.c
+++ b/libarchive/test/test_gnutar_filename_encoding.c
@@ -23,8 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
-
#include <locale.h>
DEFINE_TEST(test_gnutar_filename_encoding_UTF8_CP866)
diff --git a/libarchive/test/test_link_resolver.c b/libarchive/test/test_link_resolver.c
index 8332c4f985bd..5bea9a463b30 100644
--- a/libarchive/test/test_link_resolver.c
+++ b/libarchive/test/test_link_resolver.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/test/test_link_resolver.c,v 1.2 2008/06/15 04:31:43 kientzle Exp $");
static void test_linkify_tar(void)
{
diff --git a/libarchive/test/test_open_failure.c b/libarchive/test/test_open_failure.c
index 5316a872b6a8..a8eedadc95fe 100644
--- a/libarchive/test/test_open_failure.c
+++ b/libarchive/test/test_open_failure.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
#define MAGIC 123456789
struct my_data {
diff --git a/libarchive/test/test_open_fd.c b/libarchive/test/test_open_fd.c
index 7da8b5ebcb56..bd73fb36197f 100644
--- a/libarchive/test/test_open_fd.c
+++ b/libarchive/test/test_open_fd.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/test/test_open_fd.c 201247 2009-12-30 05:59:21Z kientzle $");
#if defined(_WIN32) && !defined(__CYGWIN__)
#define open _open
diff --git a/libarchive/test/test_open_file.c b/libarchive/test/test_open_file.c
index bee4b3b4835b..f4ca82bb01a0 100644
--- a/libarchive/test/test_open_file.c
+++ b/libarchive/test/test_open_file.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/test/test_open_file.c 201247 2009-12-30 05:59:21Z kientzle $");
DEFINE_TEST(test_open_file)
{
diff --git a/libarchive/test/test_open_filename.c b/libarchive/test/test_open_filename.c
index 91afce244ae4..09a83690be0d 100644
--- a/libarchive/test/test_open_filename.c
+++ b/libarchive/test/test_open_filename.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/test/test_open_filename.c 191183 2009-04-17 01:06:31Z kientzle $");
static void
test_open_filename_mbs(void)
diff --git a/libarchive/test/test_pax_filename_encoding.c b/libarchive/test/test_pax_filename_encoding.c
index 2fb7f452d54f..737641c5abca 100644
--- a/libarchive/test/test_pax_filename_encoding.c
+++ b/libarchive/test/test_pax_filename_encoding.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/test/test_pax_filename_encoding.c 201247 2009-12-30 05:59:21Z kientzle $");
#include <locale.h>
diff --git a/libarchive/test/test_pax_filename_encoding.tar.uu b/libarchive/test/test_pax_filename_encoding.tar.uu
index 47db18915698..1c221fd6be20 100644
--- a/libarchive/test/test_pax_filename_encoding.tar.uu
+++ b/libarchive/test/test_pax_filename_encoding.tar.uu
@@ -1,4 +1,3 @@
-$FreeBSD: head/lib/libarchive/test/test_pax_filename_encoding.tar.uu 191183 2009-04-17 01:06:31Z kientzle $
begin 644 test_pax_filename_encoding.tar
M4&%X2&5A9&5R+V%B8\R,;6YO6'AY>@``````````````````````````````
M````````````````````````````````````````````````````````````
diff --git a/libarchive/test/test_pax_xattr_header.c b/libarchive/test/test_pax_xattr_header.c
index d0394aa09eda..8af81079ea7e 100644
--- a/libarchive/test/test_pax_xattr_header.c
+++ b/libarchive/test/test_pax_xattr_header.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
static struct archive_entry*
create_archive_entry(void) {
diff --git a/libarchive/test/test_rar_multivolume_single_file.part1.rar.uu b/libarchive/test/test_rar_multivolume_single_file.part1.rar.uu
index 22b5c8dfa3e8..b2afdf152a48 100644
--- a/libarchive/test/test_rar_multivolume_single_file.part1.rar.uu
+++ b/libarchive/test/test_rar_multivolume_single_file.part1.rar.uu
@@ -1,4 +1,4 @@
-begin 644 -
+begin 644 test_rar_multivolume_single_file.part1.rar
M4F%R(1H'`%IN<Q$!#0````````"(KG0BD$,`[1H``(].```#D,J\!?-C(4`4
M,!D`I($``$QI8F%R8VAI=F5!9&1I;F=497-T+FAT;6S`S/-C(4#T8R%`/"%$
M3T-465!%($A434P@4%5"3$E#("(M+R]7,T,O+T141"!(5$U,(#0N,"!4<F%N
diff --git a/libarchive/test/test_rar_multivolume_single_file.part2.rar.uu b/libarchive/test/test_rar_multivolume_single_file.part2.rar.uu
index e00e06cb278e..615698bdefb3 100644
--- a/libarchive/test/test_rar_multivolume_single_file.part2.rar.uu
+++ b/libarchive/test/test_rar_multivolume_single_file.part2.rar.uu
@@ -1,4 +1,4 @@
-begin 644 -
+begin 644 test_rar_multivolume_single_file.part2.rar
M4F%R(1H'`!EZ<Q$`#0````````#7@W0CD$,`[1H``(].```#.)1.%?-C(4`4
M,!D`I($``$QI8F%R8VAI=F5!9&1I;F=497-T+FAT;6S`S/-C(4#T8R%`*0IG
M96YE<F%T92!D971A:6QE9"!L;V<@;65S<V%G97,@;VX@9F%I;'5R92X@26X@
diff --git a/libarchive/test/test_rar_multivolume_single_file.part3.rar.uu b/libarchive/test/test_rar_multivolume_single_file.part3.rar.uu
index 06e72a790dab..63c984782e1d 100644
--- a/libarchive/test/test_rar_multivolume_single_file.part3.rar.uu
+++ b/libarchive/test/test_rar_multivolume_single_file.part3.rar.uu
@@ -1,4 +1,4 @@
-begin 644 -
+begin 644 test_rar_multivolume_single_file.part3.rar
M4F%R(1H'`!EZ<Q$`#0`````````?;70AD$,`M1@``(].```#8Z8%7O-C(4`4
M,!D`I($``$QI8F%R8VAI=F5!9&1I;F=497-T+FAT;6S`S/-C(4#T8R%`=7-U
M86QL>2!R=6X*"6%L;"!O9B!T:&4@=&5S=',N(`H)/"]0/@H)/$Q)/CQ0(%-4
diff --git a/libarchive/test/test_rar_multivolume_uncompressed_files.part01.rar.uu b/libarchive/test/test_rar_multivolume_uncompressed_files.part01.rar.uu
index 876b7e9acbd1..b583f86f869e 100644
--- a/libarchive/test/test_rar_multivolume_uncompressed_files.part01.rar.uu
+++ b/libarchive/test/test_rar_multivolume_uncompressed_files.part01.rar.uu
@@ -1,4 +1,4 @@
-begin 644 -
+begin 644 test_rar_multivolume_uncompressed_files.part01.rar
M4F%R(1H'`%IN<Q$!#0````````"G@W0BD$P`C#,``(].```#]EC4PKM,-4$4
M,"(`I($``'1E<W1D:7)<3&EB87)C:&EV94%D9&EN9U1E<W0R+FAT;6R`S#)?
M.T)17SM"/"%$3T-465!%($A434P@4%5"3$E#("(M+R]7,T,O+T141"!(5$U,
diff --git a/libarchive/test/test_rar_multivolume_uncompressed_files.part02.rar.uu b/libarchive/test/test_rar_multivolume_uncompressed_files.part02.rar.uu
index 97e826ee7a64..fdf944443a07 100644
--- a/libarchive/test/test_rar_multivolume_uncompressed_files.part02.rar.uu
+++ b/libarchive/test/test_rar_multivolume_uncompressed_files.part02.rar.uu
@@ -1,4 +1,4 @@
-begin 644 -
+begin 644 test_rar_multivolume_uncompressed_files.part02.rar
M4F%R(1H'`!EZ<Q$`#0````````#G!'0AD$P``QL``(].```#8Z8%7KM,-4$4
M,"(`I($``'1E<W1D:7)<3&EB87)C:&EV94%D9&EN9U1E<W0R+FAT;6R`S#)?
M.T)17SM"(&%S<V5R=$5Q=6%L365M('1O('1E<W0@97%U86QI='D@:6YS=&5A
diff --git a/libarchive/test/test_rar_multivolume_uncompressed_files.part03.rar.uu b/libarchive/test/test_rar_multivolume_uncompressed_files.part03.rar.uu
index 027f050889fd..caf9e7569bd6 100644
--- a/libarchive/test/test_rar_multivolume_uncompressed_files.part03.rar.uu
+++ b/libarchive/test/test_rar_multivolume_uncompressed_files.part03.rar.uu
@@ -1,4 +1,4 @@
-begin 644 -
+begin 644 test_rar_multivolume_uncompressed_files.part03.rar
M4F%R(1H'`!EZ<Q$`#0````````"P,W0CD%<`@3,``(].```#*23KD;M,-4$4
M,"T`I($``'1E<W1D:7)<=&5S='-U8F1I<EQ,:6)A<F-H:79E061D:6YG5&5S
M=#(N:'1M;,#,,U\[0F-?.T)I;VYS+B!)9B!T:&4@87-S97)T:6]N(&9A:6QS
diff --git a/libarchive/test/test_rar_multivolume_uncompressed_files.part04.rar.uu b/libarchive/test/test_rar_multivolume_uncompressed_files.part04.rar.uu
index be9a921bc33c..1e645fe35aa2 100644
--- a/libarchive/test/test_rar_multivolume_uncompressed_files.part04.rar.uu
+++ b/libarchive/test/test_rar_multivolume_uncompressed_files.part04.rar.uu
@@ -1,4 +1,4 @@
-begin 644 -
+begin 644 test_rar_multivolume_uncompressed_files.part04.rar
M4F%R(1H'`!EZ<Q$`#0````````!K>G0AD%<`W`(``(].```#8Z8%7KM,-4$4
M,"T`I($``'1E<W1D:7)<=&5S='-U8F1I<EQ,:6)A<F-H:79E061D:6YG5&5S
M=#(N:'1M;,#,,U\[0F-?.T)B>0IT:&4@87)C:&EV92!W<FET97(@:7,@=&AE
diff --git a/libarchive/test/test_rar_multivolume_uncompressed_files.part05.rar.uu b/libarchive/test/test_rar_multivolume_uncompressed_files.part05.rar.uu
index 0891b2285b0c..eb271f063a64 100644
--- a/libarchive/test/test_rar_multivolume_uncompressed_files.part05.rar.uu
+++ b/libarchive/test/test_rar_multivolume_uncompressed_files.part05.rar.uu
@@ -1,4 +1,4 @@
-begin 644 -
+begin 644 test_rar_multivolume_uncompressed_files.part05.rar
M4F%R(1H'`!EZ<Q$`#0````````!U''0AD$0`+AX``(].```#8Z8%7KM,-4$4
M,!H`I($``$QI8F%R8VAI=F5!9&1I;F=497-T,BYH=&ULP,P)7SM",E\[0F9E
M<F5N8V5?9FEL92@F<75O=#MT97-T7V9O;RYT87(F<75O=#LI.SPO4%)%/CQ0
diff --git a/libarchive/test/test_rar_multivolume_uncompressed_files.part06.rar.uu b/libarchive/test/test_rar_multivolume_uncompressed_files.part06.rar.uu
index 6511cb68c6af..c63065865a0e 100644
--- a/libarchive/test/test_rar_multivolume_uncompressed_files.part06.rar.uu
+++ b/libarchive/test/test_rar_multivolume_uncompressed_files.part06.rar.uu
@@ -1,4 +1,4 @@
-begin 644 -
+begin 644 test_rar_multivolume_uncompressed_files.part06.rar
M4F%R(1H'`!EZ<Q$`#0`````````*JW0CD$L`C3,``(].```#8\SY_?-C(4`4
M,"$`I($``'1E<W1D:7)<3&EB87)C:&EV94%D9&EN9U1E<W0N:'1M;(#,,E\[
M0DU?.T(N+B!S971U<"!O;6ET=&5D("XN+B`J+PHF;F)S<#L@)FYB<W`[(&%S
diff --git a/libarchive/test/test_rar_multivolume_uncompressed_files.part07.rar.uu b/libarchive/test/test_rar_multivolume_uncompressed_files.part07.rar.uu
index fa3206266ce4..c7dab1b886e9 100644
--- a/libarchive/test/test_rar_multivolume_uncompressed_files.part07.rar.uu
+++ b/libarchive/test/test_rar_multivolume_uncompressed_files.part07.rar.uu
@@ -1,4 +1,4 @@
-begin 644 -
+begin 644 test_rar_multivolume_uncompressed_files.part07.rar
M4F%R(1H'`!EZ<Q$`#0````````!*\70AD$L`YP4``(].```#8Z8%7O-C(4`4
M,"$`I($``'1E<W1D:7)<3&EB87)C:&EV94%D9&EN9U1E<W0N:'1M;(#,,E\[
M0DU?.T)I=&@@82!D;WIE;B!E;G1R:65S(&1O=VX@=&\*:G5S="!A(&9E=R!K
diff --git a/libarchive/test/test_rar_multivolume_uncompressed_files.part08.rar.uu b/libarchive/test/test_rar_multivolume_uncompressed_files.part08.rar.uu
index e8e0ffe8c57e..9e53660ed0c5 100644
--- a/libarchive/test/test_rar_multivolume_uncompressed_files.part08.rar.uu
+++ b/libarchive/test/test_rar_multivolume_uncompressed_files.part08.rar.uu
@@ -1,4 +1,4 @@
-begin 644 -
+begin 644 test_rar_multivolume_uncompressed_files.part08.rar
M4F%R(1H'`!EZ<Q$`#0````````#I1G0AD%8`/R$``(].```#8Z8%7O-C(4`4
M,"P`I($``'1E<W1D:7)<=&5S='-U8F1I<EQ,:6)A<F-H:79E061D:6YG5&5S
M="YH=&ULP,PS7SM"6U\[0D-O;G1E;G1S/"]45#XL"@D\5%0@0TQ!4U,](G=E
diff --git a/libarchive/test/test_rar_multivolume_uncompressed_files.part09.rar.uu b/libarchive/test/test_rar_multivolume_uncompressed_files.part09.rar.uu
index bdcdc999c4d6..c2d890401e69 100644
--- a/libarchive/test/test_rar_multivolume_uncompressed_files.part09.rar.uu
+++ b/libarchive/test/test_rar_multivolume_uncompressed_files.part09.rar.uu
@@ -1,4 +1,4 @@
-begin 644 -
+begin 644 test_rar_multivolume_uncompressed_files.part09.rar
M4F%R(1H'`!EZ<Q$`#0````````"N!'0CD$,`E3,``(].```#97_()_-C(4`4
M,!D`I($``$QI8F%R8VAI=F5!9&1I;F=497-T+FAT;6S`S`E?.T(R7SM"4STB
M=V5S=&5R;B(^/$$@3D%-13TB0F%S:6-?=&5S=%]T97)M:6YO;&]G>2(^/"]!
diff --git a/libarchive/test/test_rar_multivolume_uncompressed_files.part10.rar.uu b/libarchive/test/test_rar_multivolume_uncompressed_files.part10.rar.uu
index aef15d214a21..66c22262e189 100644
--- a/libarchive/test/test_rar_multivolume_uncompressed_files.part10.rar.uu
+++ b/libarchive/test/test_rar_multivolume_uncompressed_files.part10.rar.uu
@@ -1,4 +1,4 @@
-begin 644 -
+begin 644 test_rar_multivolume_uncompressed_files.part10.rar
M4F%R(1H'`!EZ<Q$`#0`````````5)G0AD$,`^@@``(].```#8Z8%7O-C(4`4
M,!D`I($``$QI8F%R8VAI=F5!9&1I;F=497-T+FAT;6S`S`E?.T(R7SM"97AE
M<F-I<V4@8F]U;F1A<GD@8V%S97,@=VET:"!V97)Y"FQA<F=E(&5N=')I97,L
diff --git a/libarchive/test/test_read_data_large.c b/libarchive/test/test_read_data_large.c
index a86bcc08ff6b..59cbfd496ca9 100644
--- a/libarchive/test/test_read_data_large.c
+++ b/libarchive/test/test_read_data_large.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/test/test_read_data_large.c 201247 2009-12-30 05:59:21Z kientzle $");
/*
* Test read/write of a 10M block of data in a single operation.
diff --git a/libarchive/test/test_read_disk.c b/libarchive/test/test_read_disk.c
index 43d7d86bab24..24349574a7a2 100644
--- a/libarchive/test/test_read_disk.c
+++ b/libarchive/test/test_read_disk.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/test/test_read_disk.c 201247 2009-12-30 05:59:21Z kientzle $");
static void
gname_cleanup(void *d)
diff --git a/libarchive/test/test_read_disk_directory_traversals.c b/libarchive/test/test_read_disk_directory_traversals.c
index bca3ce518e21..009c9a8db1e1 100644
--- a/libarchive/test/test_read_disk_directory_traversals.c
+++ b/libarchive/test/test_read_disk_directory_traversals.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
#include <limits.h>
#if defined(_WIN32) && !defined(__CYGWIN__)
@@ -1608,6 +1607,12 @@ test_parent(void)
int file_count;
int match_count;
int r;
+#if defined(O_PATH) || defined(O_SEARCH) || \
+ (defined(__FreeBSD__) && defined(O_EXEC))
+ const char *ignore_traversals_test4;
+
+ ignore_traversals_test4 = getenv("IGNORE_TRAVERSALS_TEST4");
+#endif
assertMakeDir("lock", 0311);
assertMakeDir("lock/dir1", 0755);
@@ -1784,7 +1789,8 @@ test_parent(void)
if (r == ARCHIVE_FAILED) {
#if defined(O_PATH) || defined(O_SEARCH) || \
(defined(__FreeBSD__) && defined(O_EXEC))
- assertEqualIntA(a, ARCHIVE_OK, r);
+ if (ignore_traversals_test4 == NULL)
+ assertEqualIntA(a, ARCHIVE_OK, r);
#endif
/* Close the disk object. */
archive_read_close(a);
diff --git a/libarchive/test/test_read_disk_entry_from_file.c b/libarchive/test/test_read_disk_entry_from_file.c
index 7a41034ac37e..386c3c48ebf4 100644
--- a/libarchive/test/test_read_disk_entry_from_file.c
+++ b/libarchive/test/test_read_disk_entry_from_file.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/test/test_read_disk_entry_from_file.c 201247 2009-12-30 05:59:21Z kientzle $");
static const char *
gname_lookup(void *d, int64_t g)
diff --git a/libarchive/test/test_read_extract.c b/libarchive/test/test_read_extract.c
index da0f2265a02b..32c1b6b18142 100644
--- a/libarchive/test/test_read_extract.c
+++ b/libarchive/test/test_read_extract.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/test/test_read_extract.c 201247 2009-12-30 05:59:21Z kientzle $");
#define BUFF_SIZE 1000000
#define FILE_BUFF_SIZE 100000
diff --git a/libarchive/test/test_read_file_nonexistent.c b/libarchive/test/test_read_file_nonexistent.c
index acb72a1e32cc..4a6d5d266227 100644
--- a/libarchive/test/test_read_file_nonexistent.c
+++ b/libarchive/test/test_read_file_nonexistent.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/test/test_read_file_nonexistent.c 189473 2009-03-07 02:09:21Z kientzle $");
DEFINE_TEST(test_read_file_nonexistent)
{
diff --git a/libarchive/test/test_read_filter_lrzip.tar.lrz.uu b/libarchive/test/test_read_filter_lrzip.tar.lrz.uu
index d9bbd6116e0a..2272c2778e82 100644
--- a/libarchive/test/test_read_filter_lrzip.tar.lrz.uu
+++ b/libarchive/test/test_read_filter_lrzip.tar.lrz.uu
@@ -1,4 +1,4 @@
-begin 644 test_read_filter_lrzip.tar.lrz.uu
+begin 644 test_read_filter_lrzip.tar.lrz
M3%):20`&`"@``````````%T````!`0```@$`*`,`````#@`#`````&4`!E``
MAP``````*(%=%O"2=0L1MCAA@GB4H1+_)V=!8=DS/0JC4Z+Q&5I0A'\SJ-#.
M$U<4K-:^%:G^C3$B/80>END]NJE=5AP+]64N7$3):G02EKP>+AD`!IH`HQ(`
diff --git a/libarchive/test/test_read_filter_program.c b/libarchive/test/test_read_filter_program.c
index a27589a146c9..18b42121cc22 100644
--- a/libarchive/test/test_read_filter_program.c
+++ b/libarchive/test/test_read_filter_program.c
@@ -24,7 +24,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/test/test_read_compress_program.c 201247 2009-12-30 05:59:21Z kientzle $");
static unsigned char archive[] = {
31,139,8,0,222,'C','p','C',0,3,211,'c',160,'=','0','0','0','0','7','5','U',
diff --git a/libarchive/test/test_read_filter_program_signature.c b/libarchive/test/test_read_filter_program_signature.c
index 110addb87fe9..46909f97ab9e 100644
--- a/libarchive/test/test_read_filter_program_signature.c
+++ b/libarchive/test/test_read_filter_program_signature.c
@@ -24,7 +24,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
static unsigned char archive[] = {
31,139,8,0,222,'C','p','C',0,3,211,'c',160,'=','0','0','0','0','7','5','U',
diff --git a/libarchive/test/test_read_filter_uudecode.c b/libarchive/test/test_read_filter_uudecode.c
index ac2eff59f794..1bc9385c3f6a 100644
--- a/libarchive/test/test_read_filter_uudecode.c
+++ b/libarchive/test/test_read_filter_uudecode.c
@@ -24,7 +24,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/test/test_read_uu.c 201248 2009-12-30 06:12:03Z kientzle $");
static const char archive[] = {
"begin 644 test_read_uu.Z\n"
diff --git a/libarchive/test/test_read_filter_uudecode_base64_raw.uu b/libarchive/test/test_read_filter_uudecode_base64_raw.uu
new file mode 100644
index 000000000000..b4ddfb0a22e8
--- /dev/null
+++ b/libarchive/test/test_read_filter_uudecode_base64_raw.uu
@@ -0,0 +1,11 @@
+begin-base64 600 LICENSE2.txt
+VEhFIFNPRlRXQVJFIElTIFBST1ZJREVEIOKAnEFTIElT4oCdLCBXSVRIT1VUIFdBUlJBTlRZIE9G
+IEFOWSBLSU5ELCBFWFBSRVNTIE9SIElNUExJRUQsIElOQ0xVRElORyBCVVQgTk9UIExJTUlURUQg
+VE8gVEhFIFdBUlJBTlRJRVMgT0YgTUVSQ0hBTlRBQklMSVRZLCBGSVRORVNTIEZPUiBBIFBBUlRJ
+Q1VMQVIgUFVSUE9TRSBBTkQgTk9OSU5GUklOR0VNRU5ULiBJTiBOTyBFVkVOVCBTSEFMTCBUSEUg
+QVVUSE9SUyBPUiBDT1BZUklHSFQgSE9MREVSUyBCRSBMSUFCTEUgRk9SIEFOWSBDTEFJTSwgREFN
+QUdFUyBPUiBPVEhFUiBMSUFCSUxJVFksIFdIRVRIRVIgSU4gQU4gQUNUSU9OIE9GIENPTlRSQUNU
+LCBUT1JUIE9SIE9USEVSV0lTRSwgQVJJU0lORyBGUk9NLCBPVVQgT0YgT1IgSU4gQ09OTkVDVElP
+TiBXSVRIIFRIRSBTT0ZUV0FSRSBPUiBUSEUgVVNFIE9SIE9USEVSIERFQUxJTkdTIElOIFRIRSBT
+T0ZUV0FSRS4K
+====
diff --git a/libarchive/test/test_read_filter_uudecode_raw.c b/libarchive/test/test_read_filter_uudecode_raw.c
new file mode 100644
index 000000000000..6f02dc5de147
--- /dev/null
+++ b/libarchive/test/test_read_filter_uudecode_raw.c
@@ -0,0 +1,67 @@
+/*-
+ * Copyright (c) 2023 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"
+
+DEFINE_TEST(test_read_filter_uudecode_raw)
+{
+ struct archive_entry *ae;
+ struct archive *a;
+
+ const char *name = "test_read_filter_uudecode_raw.uu";
+
+ 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));
+ copy_reference_file(name);
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_open_filename(a, name, 670));
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
+ assertEqualString("LICENSE.txt", archive_entry_pathname(ae));
+ assertEqualInt((AE_IFREG | 0755), archive_entry_mode(ae));
+ assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae));
+
+ assertEqualInt(ARCHIVE_OK, archive_read_close(a));
+ assertEqualInt(ARCHIVE_OK, archive_read_free(a));
+}
+
+DEFINE_TEST(test_read_filter_uudecode_base64_raw)
+{
+ struct archive_entry *ae;
+ struct archive *a;
+
+ const char *name = "test_read_filter_uudecode_base64_raw.uu";
+
+ 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));
+ copy_reference_file(name);
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_open_filename(a, name, 670));
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
+ assertEqualString("LICENSE2.txt", archive_entry_pathname(ae));
+ assertEqualInt((AE_IFREG | 0600), archive_entry_mode(ae));
+ assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae));
+
+ assertEqualInt(ARCHIVE_OK, archive_read_close(a));
+ assertEqualInt(ARCHIVE_OK, archive_read_free(a));
+}
diff --git a/libarchive/test/test_read_filter_uudecode_raw.uu b/libarchive/test/test_read_filter_uudecode_raw.uu
new file mode 100644
index 000000000000..8a5f8b5a607d
--- /dev/null
+++ b/libarchive/test/test_read_filter_uudecode_raw.uu
@@ -0,0 +1,14 @@
+begin 755 LICENSE.txt
+M5$A%(%-/1E1705)%($E3(%!23U9)1$5$(.*`G$%3($E3XH"=+"!7251(3U54
+M(%=!4E)!3E19($]&($%.62!+24Y$+"!%6%!215-3($]2($E-4$Q)140L($E.
+M0TQ51$E.1R!"550@3D]4($Q)34E4140@5$\@5$A%(%=!4E)!3E1)15,@3T8@
+M34520TA!3E1!0DE,2519+"!&251.15-3($9/4B!!(%!!4E1)0U5,05(@4%52
+M4$]312!!3D0@3D].24Y&4DE.1T5-14Y4+B!)3B!.3R!%5D5.5"!32$%,3"!4
+M2$4@05542$]24R!/4B!#3U!94DE'2%0@2$],1$524R!"12!,24%"3$4@1D]2
+M($%.62!#3$%)32P@1$%-04=%4R!/4B!/5$A%4B!,24%"24Q)5%DL(%=(151(
+M15(@24X@04X@04-424].($]&($-/3E1204-4+"!43U)4($]2($]42$525TE3
+M12P@05))4TE.1R!&4D]-+"!/550@3T8@3U(@24X@0T].3D5#5$E/3B!7251(
+M(%1(12!33T945T%212!/4B!42$4@55-%($]2($]42$52($1%04Q)3D=3($E.
+/(%1(12!33T945T%212X*
+`
+end
diff --git a/libarchive/test/test_read_format_7zip.c b/libarchive/test/test_read_format_7zip.c
index 3c72595aeef7..9f76705deaf2 100644
--- a/libarchive/test/test_read_format_7zip.c
+++ b/libarchive/test/test_read_format_7zip.c
@@ -23,13 +23,15 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD");
#if defined(_WIN32) && !defined(__CYGWIN__)
#define close _close
#define open _open
#endif
+#define __LIBARCHIVE_BUILD
+#include <archive_crc32.h>
+
/*
* Extract a non-encoded file.
* The header of the 7z archive files is not encoded.
@@ -58,7 +60,7 @@ test_copy(int use_open_fd)
/* Verify regular file1. */
assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
- assertEqualInt((AE_IFREG | 0666), archive_entry_mode(ae));
+ assertEqualInt((AE_IFREG | 0644), archive_entry_mode(ae));
assertEqualString("file1", archive_entry_pathname(ae));
assertEqualInt(86401, archive_entry_mtime(ae));
assertEqualInt(60, archive_entry_size(ae));
@@ -284,6 +286,141 @@ test_extract_all_files(const char *refname)
}
/*
+ * Extract multi files.
+ * Like test_extract_all_files, but with zstandard compression.
+ */
+static void
+test_extract_all_files_zstd(const char *refname)
+{
+ struct archive_entry *ae;
+ struct archive *a;
+ char buff[128];
+
+ extract_reference_file(refname);
+ 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));
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_read_open_filename(a, refname, 10240));
+
+ /* Verify directory dir1. Note that this comes before the dir1/file1 entry in recent versions of 7-Zip. */
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
+ assertEqualInt((AE_IFDIR | 0755), archive_entry_mode(ae));
+ assertEqualString("dir1/", archive_entry_pathname(ae));
+ assertEqualInt(2764801, archive_entry_mtime(ae));
+ assertEqualInt(archive_entry_is_encrypted(ae), 0);
+ assertEqualIntA(a, archive_read_has_encrypted_entries(a), 0);
+
+ /* Verify regular file1. */
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
+ assertEqualInt((AE_IFREG | 0644), archive_entry_mode(ae));
+ assertEqualString("dir1/file1", archive_entry_pathname(ae));
+ assertEqualInt(86401, archive_entry_mtime(ae));
+ assertEqualInt(13, archive_entry_size(ae));
+ assertEqualInt(archive_entry_is_encrypted(ae), 0);
+ assertEqualIntA(a, archive_read_has_encrypted_entries(a), 0);
+ assertEqualInt(13, archive_read_data(a, buff, sizeof(buff)));
+ assertEqualMem(buff, "aaaaaaaaaaaa\n", 13);
+
+ /* Verify regular file2. */
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
+ assertEqualInt((AE_IFREG | 0644), archive_entry_mode(ae));
+ assertEqualString("file2", archive_entry_pathname(ae));
+ assertEqualInt(86401, archive_entry_mtime(ae));
+ assertEqualInt(26, archive_entry_size(ae));
+ assertEqualInt(archive_entry_is_encrypted(ae), 0);
+ assertEqualIntA(a, archive_read_has_encrypted_entries(a), 0);
+ assertEqualInt(26, archive_read_data(a, buff, sizeof(buff)));
+ assertEqualMem(buff, "aaaaaaaaaaaa\nbbbbbbbbbbbb\n", 26);
+
+ /* Verify regular file3. */
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
+ assertEqualInt((AE_IFREG | 0644), archive_entry_mode(ae));
+ assertEqualString("file3", archive_entry_pathname(ae));
+ assertEqualInt(86401, archive_entry_mtime(ae));
+ assertEqualInt(39, archive_entry_size(ae));
+ assertEqualInt(archive_entry_is_encrypted(ae), 0);
+ assertEqualIntA(a, archive_read_has_encrypted_entries(a), 0);
+ assertEqualInt(39, archive_read_data(a, buff, sizeof(buff)));
+ assertEqualMem(buff, "aaaaaaaaaaaa\nbbbbbbbbbbbb\ncccccccccccc\n", 39);
+
+ /* Verify regular file4. */
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
+ assertEqualInt((AE_IFREG | 0644), archive_entry_mode(ae));
+ assertEqualString("file4", archive_entry_pathname(ae));
+ assertEqualInt(86401, archive_entry_mtime(ae));
+ assertEqualInt(52, archive_entry_size(ae));
+ assertEqualInt(archive_entry_is_encrypted(ae), 0);
+ assertEqualIntA(a, archive_read_has_encrypted_entries(a), 0);
+ assertEqualInt(52, archive_read_data(a, buff, sizeof(buff)));
+ assertEqualMem(buff,
+ "aaaaaaaaaaaa\nbbbbbbbbbbbb\ncccccccccccc\ndddddddddddd\n", 52);
+
+ assertEqualInt(5, archive_file_count(a));
+
+ /* End of archive. */
+ assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae));
+
+ /* Verify archive format. */
+ assertEqualIntA(a, ARCHIVE_FILTER_NONE, archive_filter_code(a, 0));
+ assertEqualIntA(a, ARCHIVE_FORMAT_7ZIP, archive_format(a));
+
+ /* Close the archive. */
+ assertEqualInt(ARCHIVE_OK, archive_read_close(a));
+ assertEqualInt(ARCHIVE_OK, archive_read_free(a));
+}
+
+/*
+ * Extract file from an archives using ZSTD compression with and without BCJ.
+ */
+static void
+test_extract_file_zstd_bcj_nobjc(const char *refname)
+{
+ struct archive_entry *ae;
+ struct archive *a;
+ char buff[4096];
+ uint32_t computed_crc = 0;
+ uint32_t expected_crc = 0xbd66eebc;
+
+ extract_reference_file(refname);
+ 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));
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_read_open_filename(a, refname, 10240));
+
+ /* Verify regular file: hw. */
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
+ assertEqualInt((AE_IFREG | 0775), archive_entry_mode(ae));
+ assertEqualString("hw", archive_entry_pathname(ae));
+ assertEqualInt(1685913368, archive_entry_mtime(ae));
+ assertEqualInt(15952, archive_entry_size(ae));
+ assertEqualInt(archive_entry_is_encrypted(ae), 0);
+ assertEqualIntA(a, archive_read_has_encrypted_entries(a), 0);
+
+ for (;;) {
+ la_ssize_t bytes_read = archive_read_data(a, buff, sizeof(buff));
+ assert(bytes_read >= 0);
+ if (bytes_read == 0) break;
+ computed_crc = crc32(computed_crc, buff, bytes_read);
+ }
+ assertEqualInt(computed_crc, expected_crc);
+
+ assertEqualInt(1, archive_file_count(a));
+
+ /* End of archive. */
+ assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae));
+
+ /* Verify archive format. */
+ assertEqualIntA(a, ARCHIVE_FILTER_NONE, archive_filter_code(a, 0));
+ assertEqualIntA(a, ARCHIVE_FORMAT_7ZIP, archive_format(a));
+
+ /* Close the archive. */
+ assertEqualInt(ARCHIVE_OK, archive_read_close(a));
+ assertEqualInt(ARCHIVE_OK, archive_read_free(a));
+}
+
+/*
* Extract last file.
* The header of the 7z archive files is encoded with LZMA.
*/
@@ -627,7 +764,7 @@ test_ppmd(void)
/* Verify regular file1. */
assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
- assertEqualInt((AE_IFREG | 0666), archive_entry_mode(ae));
+ assertEqualInt((AE_IFREG | 0644), archive_entry_mode(ae));
assertEqualString("ppmd_test.txt", archive_entry_pathname(ae));
assertEqualInt(1322464589, archive_entry_mtime(ae));
assertEqualInt(102400, archive_entry_size(ae));
@@ -782,6 +919,74 @@ DEFINE_TEST(test_read_format_7zip_deflate)
assertEqualInt(ARCHIVE_OK, archive_read_free(a));
}
+DEFINE_TEST(test_read_format_7zip_zstd)
+{
+ struct archive *a;
+
+ assert((a = archive_read_new()) != NULL);
+
+ /* Extracting with libzstd */
+ if (ARCHIVE_OK != archive_read_support_filter_zstd(a)) {
+ skipping(
+ "7zip:zstd decoding is not supported on this platform");
+ } else {
+ test_extract_all_files_zstd("test_read_format_7zip_zstd.7z");
+ }
+
+ assertEqualInt(ARCHIVE_OK, archive_read_free(a));
+}
+
+DEFINE_TEST(test_read_format_7zip_zstd_solid)
+{
+ struct archive *a;
+
+ assert((a = archive_read_new()) != NULL);
+
+ /* Extracting with libzstd */
+ if (ARCHIVE_OK != archive_read_support_filter_zstd(a)) {
+ skipping(
+ "7zip:zstd decoding is not supported on this platform");
+ } else {
+ test_extract_all_files_zstd("test_read_format_7zip_solid_zstd.7z");
+ }
+
+ assertEqualInt(ARCHIVE_OK, archive_read_free(a));
+}
+
+DEFINE_TEST(test_read_format_7zip_zstd_bcj)
+{
+ struct archive *a;
+
+ assert((a = archive_read_new()) != NULL);
+
+ /* Extracting with libzstd */
+ if (ARCHIVE_OK != archive_read_support_filter_zstd(a)) {
+ skipping(
+ "7zip:zstd decoding is not supported on this platform");
+ } else {
+ test_extract_file_zstd_bcj_nobjc("test_read_format_7zip_zstd_bcj.7z");
+ }
+
+ assertEqualInt(ARCHIVE_OK, archive_read_free(a));
+}
+
+DEFINE_TEST(test_read_format_7zip_zstd_nobcj)
+{
+ struct archive *a;
+
+ assert((a = archive_read_new()) != NULL);
+
+ /* Extracting with libzstd */
+ if (ARCHIVE_OK != archive_read_support_filter_zstd(a)) {
+ skipping(
+ "7zip:zstd decoding is not supported on this platform");
+ } else {
+ test_extract_file_zstd_bcj_nobjc("test_read_format_7zip_zstd_nobcj.7z");
+ }
+
+ assertEqualInt(ARCHIVE_OK, archive_read_free(a));
+}
+
DEFINE_TEST(test_read_format_7zip_empty)
{
test_empty_archive();
@@ -832,7 +1037,223 @@ DEFINE_TEST(test_read_format_7zip_lzma2)
assertEqualInt(ARCHIVE_OK, archive_read_free(a));
}
+static void
+test_arm_filter(const char *refname)
+{
+ struct archive *a;
+ struct archive_entry *ae;
+ char buff[7804];
+ uint32_t computed_crc = 0;
+ uint32_t expected_crc = 0x355ec4e1;
+
+ assert((a = archive_read_new()) != NULL);
+
+ extract_reference_file(refname);
+
+ 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));
+
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_read_open_filename(a, refname, 10240));
+
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
+ assertEqualInt((AE_IFREG | 0755), archive_entry_mode(ae));
+ assertEqualString("hw-gnueabihf", archive_entry_pathname(ae));
+ assertEqualInt(sizeof(buff), archive_entry_size(ae));
+ assertEqualInt(sizeof(buff), archive_read_data(a, buff, sizeof(buff)));
+ computed_crc = crc32(computed_crc, buff, sizeof(buff));
+ assertEqualInt(computed_crc, expected_crc);
+
+ assertEqualInt(1, archive_file_count(a));
+
+ assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae));
+
+ assertEqualInt(ARCHIVE_OK, archive_read_close(a));
+ assertEqualInt(ARCHIVE_OK, archive_read_free(a));
+}
+
+DEFINE_TEST(test_read_format_7zip_zstd_arm)
+{
+ struct archive *a;
+
+ assert((a = archive_read_new()) != NULL);
+
+ if (ARCHIVE_OK != archive_read_support_filter_zstd(a)) {
+ skipping(
+ "7zip:zstd decoding is not supported on this platform");
+ } else {
+ test_arm_filter("test_read_format_7zip_zstd_arm.7z");
+ }
+
+ assertEqualInt(ARCHIVE_OK, archive_read_free(a));
+}
+
+DEFINE_TEST(test_read_format_7zip_lzma2_arm)
+{
+ struct archive *a;
+
+ assert((a = archive_read_new()) != NULL);
+
+ if (ARCHIVE_OK != archive_read_support_filter_lzma(a)) {
+ skipping(
+ "7zip:lzma decoding is not supported on this platform");
+ } else {
+ test_arm_filter("test_read_format_7zip_lzma2_arm.7z");
+ }
+
+ assertEqualInt(ARCHIVE_OK, archive_read_free(a));
+}
+
DEFINE_TEST(test_read_format_7zip_ppmd)
{
test_ppmd();
}
+
+static void
+test_arm64_filter(const char *refname)
+{
+ struct archive *a;
+ struct archive_entry *ae;
+ char buff[70368];
+ uint32_t computed_crc = 0;
+ uint32_t expected_crc = 0xde97d594;
+
+ assert((a = archive_read_new()) != NULL);
+
+ extract_reference_file(refname);
+
+ 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));
+
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_read_open_filename(a, refname, 10240));
+
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
+ assertEqualInt((AE_IFREG | 0775), archive_entry_mode(ae));
+ assertEqualString("hw-arm64", archive_entry_pathname(ae));
+ assertEqualInt(sizeof(buff), archive_entry_size(ae));
+ assertEqualInt(sizeof(buff), archive_read_data(a, buff, sizeof(buff)));
+ computed_crc = crc32(computed_crc, buff, sizeof(buff));
+ assertEqualInt(computed_crc, expected_crc);
+
+ assertEqualInt(1, archive_file_count(a));
+
+ assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae));
+
+ assertEqualInt(ARCHIVE_OK, archive_read_close(a));
+ assertEqualInt(ARCHIVE_OK, archive_read_free(a));
+}
+
+DEFINE_TEST(test_read_format_7zip_lzma2_arm64)
+{
+#ifdef HAVE_LZMA_FILTER_ARM64
+ struct archive *a;
+
+ assert((a = archive_read_new()) != NULL);
+
+ if (ARCHIVE_OK != archive_read_support_filter_lzma(a)) {
+ skipping(
+ "7zip:lzma decoding is not supported on this platform");
+ } else {
+ test_arm64_filter("test_read_format_7zip_lzma2_arm64.7z");
+ }
+
+ assertEqualInt(ARCHIVE_OK, archive_read_free(a));
+#else
+ skipping("This version of liblzma does not support LZMA_FILTER_ARM64");
+#endif
+}
+
+DEFINE_TEST(test_read_format_7zip_deflate_arm64)
+{
+ struct archive *a;
+
+ assert((a = archive_read_new()) != NULL);
+
+ if (ARCHIVE_OK != archive_read_support_filter_gzip(a)) {
+ skipping(
+ "7zip:deflate decoding is not supported on this platform");
+ } else {
+ test_arm64_filter("test_read_format_7zip_deflate_arm64.7z");
+ }
+
+ assertEqualInt(ARCHIVE_OK, archive_read_free(a));
+}
+
+DEFINE_TEST(test_read_format_7zip_win_attrib)
+{
+ struct archive *a;
+
+ assert((a = archive_read_new()) != NULL);
+
+ if (ARCHIVE_OK != archive_read_support_filter_lzma(a)) {
+ skipping(
+ "7zip:lzma decoding is not supported on this platform");
+ assertEqualInt(ARCHIVE_OK, archive_read_free(a));
+ return;
+ }
+
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a));
+
+ // This archive has four files and four directories:
+ // * hidden directory
+ // * readonly directory
+ // * regular directory
+ // * system directory
+ // * regular "archive" file
+ // * hidden file
+ // * readonly file
+ // * system file
+ const char *refname = "test_read_format_7zip_win_attrib.7z";
+ extract_reference_file(refname);
+
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_read_open_filename(a, refname, 10240));
+
+ struct archive_entry *ae;
+
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
+ assertEqualString("hidden_dir/", archive_entry_pathname(ae));
+ assertEqualInt((AE_IFDIR | 0755), archive_entry_mode(ae));
+ assertEqualString("hidden", archive_entry_fflags_text(ae));
+
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
+ assertEqualString("readonly_dir/", archive_entry_pathname(ae));
+ assertEqualInt((AE_IFDIR | 0555), archive_entry_mode(ae));
+ assertEqualString("rdonly", archive_entry_fflags_text(ae));
+
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
+ assertEqualString("regular_dir/", archive_entry_pathname(ae));
+ assertEqualInt((AE_IFDIR | 0755), archive_entry_mode(ae));
+ assertEqualString(NULL, archive_entry_fflags_text(ae));
+
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
+ assertEqualString("system_dir/", archive_entry_pathname(ae));
+ assertEqualInt((AE_IFDIR | 0755), archive_entry_mode(ae));
+ assertEqualString("system", archive_entry_fflags_text(ae));
+
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
+ assertEqualString("archive_file.txt", archive_entry_pathname(ae));
+ assertEqualInt((AE_IFREG | 0644), archive_entry_mode(ae));
+ assertEqualString(NULL, archive_entry_fflags_text(ae));
+
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
+ assertEqualString("hidden_file.txt", archive_entry_pathname(ae));
+ assertEqualInt((AE_IFREG | 0644), archive_entry_mode(ae));
+ assertEqualString("hidden", archive_entry_fflags_text(ae));
+
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
+ assertEqualString("readonly_file.txt", archive_entry_pathname(ae));
+ assertEqualInt((AE_IFREG | 0444), archive_entry_mode(ae));
+ assertEqualString("rdonly", archive_entry_fflags_text(ae));
+
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
+ assertEqualString("system_file.txt", archive_entry_pathname(ae));
+ assertEqualInt((AE_IFREG | 0644), archive_entry_mode(ae));
+ assertEqualString("system", archive_entry_fflags_text(ae));
+
+
+ assertEqualInt(ARCHIVE_OK, archive_read_free(a));
+}
diff --git a/libarchive/test/test_read_format_7zip_copy.7z.uu b/libarchive/test/test_read_format_7zip_copy.7z.uu
index 2429834c26dc..92e7c5867ab2 100644
--- a/libarchive/test/test_read_format_7zip_copy.7z.uu
+++ b/libarchive/test/test_read_format_7zip_copy.7z.uu
@@ -1,4 +1,4 @@
-begin 644 test_read_format_7zip_none.7z
+begin 644 test_read_format_7zip_copy.7z
M-WJ\KR<<``-!QGV(/`````````!"`````````(/;BV,@("`@("`@("`@("`@
M("`@("`@("`@("`@(&9I;&4@,2!C;VYT96YT<PIH96QL;PIH96QL;PIH96QL
M;PH!!`8``0D\``<+`0`!`0`,/``("@&J'=X/```%`1$-`&8`:0!L`&4`,0``
diff --git a/libarchive/test/test_read_format_7zip_deflate_arm64.7z.uu b/libarchive/test/test_read_format_7zip_deflate_arm64.7z.uu
new file mode 100644
index 000000000000..2199d921b549
--- /dev/null
+++ b/libarchive/test/test_read_format_7zip_deflate_arm64.7z.uu
@@ -0,0 +1,64 @@
+begin 664 test_read_format_7zip_deflate_arm64.7z
+M-WJ\KR<<``2V^52G)0H```````!:`````````.HY+B_LU5^(3%$<P/%SYPY+
+M_N1?*/]F5R'Y3_['&'^&0FB]T9BU@ZFQH]F1#65X4C:9"`](HI`'#PHO_N5!
+M>2.2T-J0XF&*!R-C_.Z=<^_<NSLKWK^?]MS?GM\]OW//W'ONS*&5:U<%#$,Y
+M3'5;6;UP[TH_K/,=_:RLDYNO^LIQM!JEK&%!=USW^,/PQS[.=73=_(`<ND>9
+MV1\-3^RE>M;>QXU.A7.TUWJB)`<[&KZ8T]<]&O#7!73=1:O.CH8O%NQ0C<YE
+M@[HUVO-UCRN4/P9UW/`QVVS]?[E.#C7B8J5CE[J-4M=;_;M!.FZRKO>7^[)'
+MUEN-U><P/95LFIYJGII*MNQMFQJ/9[;OFCMG6FMZVLS*FH;I9QQ=OUE]G#AY
+MPO$S5]KO[MV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*W-6Y=*K'#VJ,KX3%H7>)#\-=9?9A6:42&+GNC0>\44<_^.\=8NXV&T
+M[K],'7[]4UKXOQE;M_P)P_O_!0$$!@`!"8HE``<+`0`"`P0!"`$*`0`,P>`2
+MP>`2``@*`935E]X```4!&0(``!$3`&@`=P`M`&$`<@!M`#8`-````!D`%`H!
+3`#)5M-E?M]D!%08!`""`_8$`````
+`
+end
diff --git a/libarchive/test/test_read_format_7zip_encryption_data.c b/libarchive/test/test_read_format_7zip_encryption_data.c
index adedbc5311c6..653044a46317 100644
--- a/libarchive/test/test_read_format_7zip_encryption_data.c
+++ b/libarchive/test/test_read_format_7zip_encryption_data.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD");
DEFINE_TEST(test_read_format_7zip_encryption_data)
{
diff --git a/libarchive/test/test_read_format_7zip_encryption_header.c b/libarchive/test/test_read_format_7zip_encryption_header.c
index 7d2a4a8d7de4..d0c48044ea5e 100644
--- a/libarchive/test/test_read_format_7zip_encryption_header.c
+++ b/libarchive/test/test_read_format_7zip_encryption_header.c
@@ -23,8 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD");
-
DEFINE_TEST(test_read_format_7zip_encryption_header)
{
diff --git a/libarchive/test/test_read_format_7zip_encryption_partially.c b/libarchive/test/test_read_format_7zip_encryption_partially.c
index 68290aa64fd9..51a6c06116d7 100644
--- a/libarchive/test/test_read_format_7zip_encryption_partially.c
+++ b/libarchive/test/test_read_format_7zip_encryption_partially.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD");
DEFINE_TEST(test_read_format_7zip_encryption_partially)
{
diff --git a/libarchive/test/test_read_format_7zip_lzma2_arm.7z.uu b/libarchive/test/test_read_format_7zip_lzma2_arm.7z.uu
new file mode 100644
index 000000000000..5a6ade031f22
--- /dev/null
+++ b/libarchive/test/test_read_format_7zip_lzma2_arm.7z.uu
@@ -0,0 +1,50 @@
+begin 664 test_read_format_7zip_lzma2_arm.7z
+M-WJ\KR<<``3J_$W1N`<```````!B`````````.JU,0K@'GL'L%T`/Y%%A&@[
+MWMZF$<*4U"093^%DJ=J._J..`X9!2RX<PW^KV'J:BRK]Q@`9?>NX6*J`]\W5
+MV'E1<]9A1&J5D`#J!0K[IET\(=96D87RO?!\YQ>LH!0''871$*/B-@-70EJ0
+M`;\!OE9CF-^[@!DI0LA7Z5P`#.!8`&65OAKG.CZ"F_H1?0DF"U1TA(*8<K$Y
+M"`*`&0@9W/J=9Q65I#T7A=LV)A'W8Q6[]T`[8.HQ,<*'Y=%CCL4UL$N;V&GM
+MI7RJ;]"A19(O_OR+.K]#3$*$G*^<SN`@%$X^!18W$Y+"$FIZ9)G"S=N3P=MY
+M@23KT_,1!2PF)J^TCK3^5BSV3W)6C:UM*;1D!?PAH?98?NIW3O*]ML<LU?8(
+ME0(M;`*!0>JEQ>/>U8FBB]^E)QG>MQ_<EC_YO:6#IW1:YGQZ'#(?[%-S&E3`
+M>LLWD%-YVI_%$>)09X;WO&$[MP(</^*QI;<0E?AA^"+H/%V:Z`]$HE('A,*@
+M,>[#E"AI4U,3VSH@/S*]#&EGP37GQ_#W*+P:2"&0(O=$S'+O'75NH+-'ZI&2
+M9W^I\?.Y`$T4YPC[ETIN9KTL\>"^-]*+([,!RK2%12BUU!TRF!5:8B?]<3K'
+M1/*E5"22231Q(@S6P/`GO*EAHOGEC)B5=%X;>B*\-D*4#KGX(2,,P4)Q\PQ<
+M?L=SG>R/AC>SH1S1_FUK7"#5\]0&QR9`];@`YS*UH9Q@P^S977+E@_P<I6:%
+MV\9WL&_6E6J$T"1^]-_8C1\,X@29SIR(EJ\O:44&+X/%<$?10J8IR(&%AF].
+M;`+F2G45L/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_read_format_7zip_lzma2_arm64.7z.uu b/libarchive/test/test_read_format_7zip_lzma2_arm64.7z.uu
new file mode 100644
index 000000000000..34025b8431ad
--- /dev/null
+++ b/libarchive/test/test_read_format_7zip_lzma2_arm64.7z.uu
@@ -0,0 +1,54 @@
+begin 664 test_read_format_7zip_lzma2_arm64.7z
+M-WJ\KR<<``0W'TW><P@```````!:`````````&'_J;[A$M\(:UT`/Y%%A&@]
+MB:;:BN&&(J+"URDYX#ZEJ=1:R[LP;*R_8L2:_5F_1<^DV<8-2,=3[&X?U.=W
+M*%Q!?DN>B^),$C`%""HM.8#>=`<R:?!<.$B$K6X!RY4*=X/2*.1;F86;KQ[4
+MW?4E#8Q06ZC4C+\8[JXT3(^1NKD"QCKT^=KB=;)Q=SIF6<^4QB+`Z)=$I>#!
+MHGG`);CBW],\(2H/P+,[60V#BSUD@SPX?+]7UE`-G%X8-3UI(38JH=H'>(C4
+M.BHYW!+WO_VP/@H5V?EN8ESQEC<5V/WV[($3WNDOW%0OV?,5D(VX$W,9F]X6
+M$@+,!DJ9MCLG?+981]+>4RH&\+O6N:Z[J\UUAP1\;YX=FQG04]%"*WE/:)&N
+M7]/;*`CB"$1/1LN;6/@^--#D_P_@^=I7&LU`$C*&]O)XY16O/YBAT\L2Q!M6
+MZ,^,_"DV_%G"4[;]`8E`Y>_4'B-G'SBG0\P#T504(#V)73,/E2#B3I7=S".'
+MT?4S]U]05SC_GJUAE*!NK%8\&=\',!%JIL5J>;6'O[D[_5JVE7>4<QH4'CLU
+M68W>\(D]JBL8$[^!T?<88]&GF&D!J76?C\!TV:R8*BQ,2%*"NX6^-J!7;)H[
+M,VL2_VSHEIU&_VR#)=O81/7B?&1://2C9_O[-3*X(-,H(QI$N8$/CSMR0_PU
+MF+&[-\:YPQ-V_/\D'K<+P1?:NF3DC@(W0X+$X,HG8*-0_+3@`07IT`9`RZO>
+M=4MI;EB=PHN\-U*#KN5B^JX'^8EFYG-3'H?CITKDVRN+'.(ABHXGW.51@<$J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`B,Y-/&7\3]CZ/'(
+M0@61%II0K.Q,&R`2$K'#I8'B(J0'\20($ONEJ2AXW;-'V3AP;9ME^L7JBW46
+M!+9%;M7.G(>CLF;A8*'@X"+832%9%WXO^K*>?/(]*..3\@`!!`8``0F(<P`'
+M"P$``B$A`0D!"@$`#,'@$L'@$@`("@&4U9?>```%`1D"```1$P!H`'<`+0!A
+C`'(`;0`V`#0````9`!0*`0`R5;397[?9`14&`0`@@/V!````
+`
+end
diff --git a/libarchive/test/test_read_format_7zip_malformed.c b/libarchive/test/test_read_format_7zip_malformed.c
index 4ca6f0913e35..f2120879fa8c 100644
--- a/libarchive/test/test_read_format_7zip_malformed.c
+++ b/libarchive/test/test_read_format_7zip_malformed.c
@@ -24,7 +24,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
static void
test_malformed1(void)
diff --git a/libarchive/test/test_read_format_7zip_packinfo_digests.c b/libarchive/test/test_read_format_7zip_packinfo_digests.c
index 7f105d1f2806..e46a17b3b1da 100644
--- a/libarchive/test/test_read_format_7zip_packinfo_digests.c
+++ b/libarchive/test/test_read_format_7zip_packinfo_digests.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD");
/* Read archive with digests in PackInfo */
DEFINE_TEST(test_read_format_7zip_packinfo_digests)
@@ -49,7 +48,7 @@ DEFINE_TEST(test_read_format_7zip_packinfo_digests)
/* Verify regular file1. */
assertEqualIntA(a, ARCHIVE_OK,
archive_read_next_header(a, &ae));
- assertEqualInt((AE_IFREG | 0666), archive_entry_mode(ae));
+ assertEqualInt((AE_IFREG | 0644), archive_entry_mode(ae));
assertEqualString("a.txt", archive_entry_pathname(ae));
assertEqualInt(1576808819, archive_entry_mtime(ae));
assertEqualInt(4, archive_entry_size(ae));
@@ -61,7 +60,7 @@ DEFINE_TEST(test_read_format_7zip_packinfo_digests)
/* Verify regular file2. */
assertEqualIntA(a, ARCHIVE_OK,
archive_read_next_header(a, &ae));
- assertEqualInt((AE_IFREG | 0666), archive_entry_mode(ae));
+ assertEqualInt((AE_IFREG | 0644), archive_entry_mode(ae));
assertEqualString("b.txt", archive_entry_pathname(ae));
assertEqualInt(1576808819, archive_entry_mtime(ae));
assertEqualInt(4, archive_entry_size(ae));
diff --git a/libarchive/test/test_read_format_7zip_solid_zstd.7z.uu b/libarchive/test/test_read_format_7zip_solid_zstd.7z.uu
new file mode 100644
index 000000000000..3bffb98f07ea
--- /dev/null
+++ b/libarchive/test/test_read_format_7zip_solid_zstd.7z.uu
@@ -0,0 +1,9 @@
+begin 664 test_read_format_7zip_solid_zstd.7z
+M-WJ\KR<<``1&(FS)O@`````````B`````````$V+D*,HM2_]`$@!``!0*DT8
+M!````"$````HM2_]((+%```P80IB8V0*!X"P/JZA4J4;TS.X,9C'`#4``($S
+M!ZX/T5NC)*"0H'?;G=XO-Y<-`+"F*K87M`OOZ1+1#31#M/`2YN,FY:(1).I)
+M(B(+;9$W4?0*8=3V5N;BSZ)(0UGD/'LOSN"0&#DNX!A2*5\#&8IP$1G=7-]@
+MP\EE$]Z;/%6NU^\_,X:MD?57P#S>.+BINH?CHRX,::[Q5P*!X\DH````%P8V
+?`0F`B``'"P$``2,#`0$%70`0```,@-H*`9/CZP``````
+`
+end
diff --git a/libarchive/test/test_read_format_7zip_win_attrib.7z.uu b/libarchive/test/test_read_format_7zip_win_attrib.7z.uu
new file mode 100644
index 000000000000..dc7495bcbf37
--- /dev/null
+++ b/libarchive/test/test_read_format_7zip_win_attrib.7z.uu
@@ -0,0 +1,10 @@
+begin 644 test_read_format_7zip_win_attrib.7z
+M-WJ\KR<<``0:MZ25^0`````````B`````````,/QN>$!`!IA<F-H:79E:&ED
+M9&5N<F5A9&]N;'ES>7-T96T```"!,P>N#\_\\&P/Z^J<OS8]_GH-_C9=&O:;
+MN?AF5PM%@/8R"MH"PK!D-+92R@HB57B\_G7B9D`HLH<G4Z@!).&WAAA(R4U?
+M%0%=EB_VM=2[WZJHK$/PHCG(E(Y#O[W'JQD2%>%U\S6&7C"[<$<2GL2\B,**
+MW`0[F2;R)EO2:N)4RB6G.3+R6%97BQ]K"X),-'`E&./R#`2A\R&D1#U8FUC&
+MANR65$7S:?$CR7DS8<)L'MR%.5Y)T-;62DU\S8W?$4=U2972R-0]5J81R3E/
+M\K&`%O\H:/`E4``7!A\!"8#:``<+`0`!(P,!`05=`!````R!C@H!`M-R5@``
+`
+end
diff --git a/libarchive/test/test_read_format_7zip_zstd.7z.uu b/libarchive/test/test_read_format_7zip_zstd.7z.uu
new file mode 100644
index 000000000000..acd49c421a6f
--- /dev/null
+++ b/libarchive/test/test_read_format_7zip_zstd.7z.uu
@@ -0,0 +1,12 @@
+begin 664 test_read_format_7zip_zstd.7z
+M-WJ\KR<<``2QPP_C,`$````````C``````````+H!E<HM2_]`$@!``!0*DT8
+M!````!$````HM2_](`U%```080H!``80`BBU+_T`2`$``%`J31@$````%```
+M`"BU+_T@&ET``"!A"F(*`@#`H`'8*+4O_0!(`0``4"I-&`0````6````*+4O
+M_2`G;0``,&$*8@IC"@,4``@8V2BU+_T`2`$``%`J31@$````&0```"BU+_T@
+M-(4``$!A"F(*8PID"@04``@8(QL``($S!ZYMP-,)%[KY0NUS!EQ9<T<AN:R"
+M7Z^`KZ24FV4LJ?"A)\MX&!"$=31!F6U\W/D!@*G'-=Z@#"&#>8R#*L]U;J=*
+M@K`Q6]^1F4MZF33TE2LJK8X@%5MY%P.#1*EM98=_,9"?K'$*_A0YVC)]1ML=
+MK-5-,X82B;/_L`I&FQ!5HP#H````%P:`J`$)@(@`!PL!``$C`P$!!5T`$```
++#(#Z"@%\$`,4````
+`
+end
diff --git a/libarchive/test/test_read_format_7zip_zstd_arm.7z.uu b/libarchive/test/test_read_format_7zip_zstd_arm.7z.uu
new file mode 100644
index 000000000000..770e99b3c10d
--- /dev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]/J)UG5TW%7:20ZKXIC[MVDJ)')G',2BOU+XJ+MC.)<
+M.2`Z'M=W?='`QE[.OF=_/FV="Y,I[]N:M1/U6>W;\;-N"M*]+K<S"VM!.5`7
+M8H9W)EDHM[D#]C..3VI`)!.?FH80X:%M%"!>&L1B*%65/ZC8$_36I;+/=_@$
+M3FB?WK+IOVATX0C;5Y*=[>\S4F1(V)J!O?<A_6Y4"P(JCG3]$BG<;7:X.L8-
+M.5R.-,-0NA&D)4Y:]3E;M@@=Y>?36$$TKF(S2@FLJ\FLP*@EGBB:2%'/9-Z8
+M8Q,_6=Z>;B0PSV4-O0H-CLX!^O0EGI6A1BSB-+@-^M_[_W@_H7<<>.R8P"(#
+M;W9GXI=Q",^;'>9$=#]CA-$DQL\_IE\_^00T'^]Z\9A<H(3D5@4!!`8``0F)
+MA``'"P$``B0$]Q$!!0$%`P``!`,#!0$!``R>?)Y\``@*`>'$7C4```4!&0H`
+M````````````$1L`:`!W`"T`9P!N`'4`90!A`&(`:0!H`&8````9`!0*`0``
+166S@9)S9`14&`0`@@.V!````
+`
+end
diff --git a/libarchive/test/test_read_format_7zip_zstd_bcj.7z.uu b/libarchive/test/test_read_format_7zip_zstd_bcj.7z.uu
new file mode 100644
index 000000000000..2a75db8972cf
--- /dev/null
+++ b/libarchive/test/test_read_format_7zip_zstd_bcj.7z.uu
@@ -0,0 +1,56 @@
+begin 664 test_read_format_7zip_zstd_bcj.7z
+M-WJ\KR<<``0N5BP@P@@```````!B`````````(*-K]$HM2_]`$@!``!0*DT8
+M!````*T(```HM2_]8%`]'44`ZE%D$DIPW'$.RP,C]5>);DM31:I?D,QMZ#'[
+MX]O[KCOFX)J*\$44=%&TV"+)8#QPV28QFR]0!V-3JH9UII:164M``!FT!`!L
+MXELXL[8O4Q,!'@$2`5/J6F?&6/][6'!>ZPF&:U6C8%?F9DH.#=>\Y71GN:,M
+M^ZA,>'Z0J2/,U:!!Y(?S^B3?P==^[[?]YK&,Q.+\7;C(4KFQ#"L]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;^"AA"&\S5O?^]2G
+M5:<U6.,RP%;%Y"R;NE!;^QBLHNWDHT[PY!X'$RQ]3:HQ#!%;Y"&8XYZ)DEAN
+MOEQW1C&Y+8?>0N[G64]G+ZWR@D&V)Q@^LXPO*B9G9F,9'#!BQ>,6;6FU$N?3
+M`.Q/U+S_$G<B>PHT*;\)<@Y@CF:$OL@/;(&MBC.]2FU)]]1H%"W*G?%/.,%R
+M%[H<>8MCK*V1.J%.C=7'N/;E*:U^2SX@)@'SYZ\;36III>#+-E0=MARSYX'R
+M\WH,G%TT4TXJ7V:1?#Q/HER'4TFC.'Y%Y0D*MH2(6\B5YU*21O#?4OS=K,#>
+MM?@F6*^:37;#*>NV\;VYS9R567I^EN(RXY3MF[\:?IS1%VRW7Z[:^VI<W^EW
+M+C1I4NN.\7L'K_%;28(A;"6.*=[#.\.NM%)`@9'*7@+F3A[K)9_8.LC%A)"A
+M'*)/SZS!C8<S>'LY=_ZBTR<)4IT7]IYY]1OK&'@.&E"VR@9%YH&S'Q,#9CF]
+MG8&_K//(.AY#/&&R\L5Y9G9*M">BYP#J+4'9&3=D:QBW=45`IG&!W"1D^=K7
+M3-\)$&`N%0_$JV$!\![TG-`=:",BG5.9A)"?V=NSXPVO21_O-QG<+$FCO"K<
+M+7,ER$BPT:CS!0`Z0BV^S#)QZ3PK0-/_L#+OU^QUO<'=-9BN6Y:-5!LY:B;N
+MZREX8;-G[,XTOK;@Y$4Z[)9[!"MHPI^1M7KK1KL45B0C''SO8H,4XUG<1RU\
+MG/6=<8^3]'MPL\V\;ITR,#$MU@E[S7%[`00&``$)B,(`!PL!``(D!/<1`04!
+M!0,```0#`P$#`0`,OE"^4``("@&\[F:]```%`1D*`````````````!$'`&@`
+@=P```!D$`````!0*`0``'';'*9?9`14&`0`@@/V!````
+`
+end
diff --git a/libarchive/test/test_read_format_7zip_zstd_nobcj.7z.uu b/libarchive/test/test_read_format_7zip_zstd_nobcj.7z.uu
new file mode 100644
index 000000000000..c6fed0bebb84
--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:J[TX$J21
+MW@+<%;CB-NJY,<;P!8#[&A:9S.V+U9\ADL)_&*EW<Y[@TX1U%2S7:L_"MRW9
+MRNK#WA2O/$HMMGEX90/<HA4YI%X[XGOT7\\[]6#K&X[C%K/Q-/QT<4.*><[O
+ML2P=S_X<N'7,5CS>O.NY4@\-FS$OP8EX>6=[`00&``$)B,4`!PL!``$D!/<1
+M`04!!0,```R^4``("@&\[F:]```%`1D#````$0<`:`!W````&00`````%`H!
+3```<=L<IE]D!%08!`""`_8$`````
+`
+end
diff --git a/libarchive/test/test_read_format_ar.ar.uu b/libarchive/test/test_read_format_ar.ar.uu
index ae61e59fc7af..1e644cc8ab07 100644
--- a/libarchive/test/test_read_format_ar.ar.uu
+++ b/libarchive/test/test_read_format_ar.ar.uu
@@ -1,5 +1,3 @@
-$FreeBSD: head/lib/libarchive/test/test_read_format_ar.ar.uu 201247 2009-12-30 05:59:21Z kientzle $
-
begin 755 test_read_format_ar.ar
M(3QA<F-H/@HO+R`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
M("`@("`@("`@("`T,"`@("`@("`@8`IY>7ET='1S<W-A86%F9F8N;R\*:&AH
diff --git a/libarchive/test/test_read_format_ar.c b/libarchive/test/test_read_format_ar.c
index 1cc3cc047225..6e279ec134d9 100644
--- a/libarchive/test/test_read_format_ar.c
+++ b/libarchive/test/test_read_format_ar.c
@@ -26,8 +26,6 @@
*/
#include "test.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/test/test_read_format_ar.c 201247 2009-12-30 05:59:21Z kientzle $");
-
DEFINE_TEST(test_read_format_ar)
{
diff --git a/libarchive/test/test_read_format_cab.c b/libarchive/test/test_read_format_cab.c
index 8f6adae66a4a..f5ce21cbf19b 100644
--- a/libarchive/test/test_read_format_cab.c
+++ b/libarchive/test/test_read_format_cab.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD");
/*
Execute the following command to rebuild the data for this program:
diff --git a/libarchive/test/test_read_format_cab_filename.c b/libarchive/test/test_read_format_cab_filename.c
index 2f46a7e6ed05..efab3ccd69f1 100644
--- a/libarchive/test/test_read_format_cab_filename.c
+++ b/libarchive/test/test_read_format_cab_filename.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD");
#include <locale.h>
diff --git a/libarchive/test/test_read_format_cab_filename_cp932.cab.uu b/libarchive/test/test_read_format_cab_filename_cp932.cab.uu
index 0d51f10c418a..9d59000c73ed 100644
--- a/libarchive/test/test_read_format_cab_filename_cp932.cab.uu
+++ b/libarchive/test/test_read_format_cab_filename_cp932.cab.uu
@@ -1,4 +1,4 @@
-begin 644 test_read_format_cab_cp932.cab
+begin 644 test_read_format_cab_filename_cp932.cab
M35-#1@````"4`````````"P``````````P$!``(````(_@``;@````$``Q(%
M````````````=#ZO5"``E5R"OH+F7(J_CIHN='AT``4````%``````!T/KM4
M(`"57(*^@N9<B.J7EY5<+G1X=``I]2&+'@`*`%N`@(T`,*```0````$````!
diff --git a/libarchive/test/test_read_format_cpio_afio.c b/libarchive/test/test_read_format_cpio_afio.c
index 95d3171e72cc..0eff8cfee856 100644
--- a/libarchive/test/test_read_format_cpio_afio.c
+++ b/libarchive/test/test_read_format_cpio_afio.c
@@ -24,7 +24,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
/*
execute the following to rebuild the data for this program:
diff --git a/libarchive/test/test_read_format_cpio_bin.c b/libarchive/test/test_read_format_cpio_bin.c
index 7b0fad268c0b..f5be2e65cdc1 100644
--- a/libarchive/test/test_read_format_cpio_bin.c
+++ b/libarchive/test/test_read_format_cpio_bin.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/test/test_read_format_cpio_bin.c,v 1.2 2008/09/01 05:38:33 kientzle Exp $");
static unsigned char archive[] = {
199,'q',21,4,177,'y',237,'A',232,3,232,3,2,0,0,0,'p','C',244,'M',2,0,0,0,
diff --git a/libarchive/test/test_read_format_cpio_bin_Z.c b/libarchive/test/test_read_format_cpio_bin_Z.c
index 6afe691138fb..aea5bcb4b5bc 100644
--- a/libarchive/test/test_read_format_cpio_bin_Z.c
+++ b/libarchive/test/test_read_format_cpio_bin_Z.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/test/test_read_format_cpio_bin_Z.c 189464 2009-03-07 00:25:33Z kientzle $");
static unsigned char archive[] = {
31,157,144,199,226,'T',' ',16,'+','O',187,' ',232,6,'$',20,0,160,'!',156,
diff --git a/libarchive/test/test_read_format_cpio_bin_be.c b/libarchive/test/test_read_format_cpio_bin_be.c
index 164396dab23f..66e4a9ca9afd 100644
--- a/libarchive/test/test_read_format_cpio_bin_be.c
+++ b/libarchive/test/test_read_format_cpio_bin_be.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/test/test_read_format_cpio_bin_be.c 191592 2009-04-27 19:30:09Z kientzle $");
DEFINE_TEST(test_read_format_cpio_bin_be)
{
diff --git a/libarchive/test/test_read_format_cpio_bin_be.cpio.uu b/libarchive/test/test_read_format_cpio_bin_be.cpio.uu
index f29b07138802..91d1b4c70075 100644
--- a/libarchive/test/test_read_format_cpio_bin_be.cpio.uu
+++ b/libarchive/test/test_read_format_cpio_bin_be.cpio.uu
@@ -1,4 +1,3 @@
-$FreeBSD: head/lib/libarchive/test/test_read_format_cpio_bin_be.cpio.uu 191592 2009-04-27 19:30:09Z kientzle $
begin 644 test_read_format_cpio_bin_be.cpio
M<<<`"#P\@:0#Z`````$``$GS"&\`%0````5F:6QE,3$Q,3(R,C(S,S,S-#0T
M-```86)C9&4`<<<```````````````$`````````"P````!44D%)3$52(2$A
diff --git a/libarchive/test/test_read_format_cpio_bin_bz2.c b/libarchive/test/test_read_format_cpio_bin_bz2.c
index 7497bc41a988..b1a994bc5359 100644
--- a/libarchive/test/test_read_format_cpio_bin_bz2.c
+++ b/libarchive/test/test_read_format_cpio_bin_bz2.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/test/test_read_format_cpio_bin_bz2.c 201247 2009-12-30 05:59:21Z kientzle $");
static unsigned char archive[] = {
'B','Z','h','9','1','A','Y','&','S','Y',134,'J',208,'4',0,0,30,246,141,253,
diff --git a/libarchive/test/test_read_format_cpio_bin_gz.c b/libarchive/test/test_read_format_cpio_bin_gz.c
index 3cc8f15eaee5..47545f913248 100644
--- a/libarchive/test/test_read_format_cpio_bin_gz.c
+++ b/libarchive/test/test_read_format_cpio_bin_gz.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/test/test_read_format_cpio_bin_gz.c 191183 2009-04-17 01:06:31Z kientzle $");
static unsigned char archive[] = {
31,139,8,0,244,'M','p','C',0,3,';','^','(',202,178,177,242,173,227,11,230,
diff --git a/libarchive/test/test_read_format_cpio_bin_le.c b/libarchive/test/test_read_format_cpio_bin_le.c
index 2d0484c5232f..0cb6cc845554 100644
--- a/libarchive/test/test_read_format_cpio_bin_le.c
+++ b/libarchive/test/test_read_format_cpio_bin_le.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
DEFINE_TEST(test_read_format_cpio_bin_le)
{
diff --git a/libarchive/test/test_read_format_cpio_bin_lzip.c b/libarchive/test/test_read_format_cpio_bin_lzip.c
index d9acf095ed77..72791aa60a69 100644
--- a/libarchive/test/test_read_format_cpio_bin_lzip.c
+++ b/libarchive/test/test_read_format_cpio_bin_lzip.c
@@ -24,7 +24,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
static unsigned char archive[] = {
76, 90, 73, 80, 1, 12, 0, 99,156, 62,160, 67,124,230, 93,220,
diff --git a/libarchive/test/test_read_format_cpio_bin_lzma.c b/libarchive/test/test_read_format_cpio_bin_lzma.c
index 9a8a23ceb77c..a629cb547e88 100644
--- a/libarchive/test/test_read_format_cpio_bin_lzma.c
+++ b/libarchive/test/test_read_format_cpio_bin_lzma.c
@@ -24,7 +24,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/test/test_read_format_cpio_bin_lzma.c 201247 2009-12-30 05:59:21Z kientzle $");
static unsigned char archive[] = {
93, 0, 0,128, 0,255,255,255,255,255,255,255,255, 0, 99,156,
diff --git a/libarchive/test/test_read_format_cpio_bin_xz.c b/libarchive/test/test_read_format_cpio_bin_xz.c
index b19c4fae606a..ff57982af436 100644
--- a/libarchive/test/test_read_format_cpio_bin_xz.c
+++ b/libarchive/test/test_read_format_cpio_bin_xz.c
@@ -24,7 +24,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/test/test_read_format_cpio_bin_xz.c 191183 2009-04-17 01:06:31Z kientzle $");
static unsigned char archive[] = {
0xfd, 0x37, 0x7a, 0x58, 0x5a, 0x00, 0x00, 0x04,
diff --git a/libarchive/test/test_read_format_cpio_filename.c b/libarchive/test/test_read_format_cpio_filename.c
index cf4f5ac266b3..c5aa9a7f52a0 100644
--- a/libarchive/test/test_read_format_cpio_filename.c
+++ b/libarchive/test/test_read_format_cpio_filename.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD");
#include <locale.h>
@@ -137,6 +136,11 @@ cleanup:
DEFINE_TEST(test_read_format_cpio_filename_UTF8_UTF8_jp)
{
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ /* Since we explicitly DON'T set hdrcharset=UTF-8 below */
+ skipping("Windows defaults to OEMCP, not UTF-8");
+ return;
+#else
const char *refname = "test_read_format_cpio_filename_utf8_jp.cpio";
struct archive *a;
struct archive_entry *ae;
@@ -180,6 +184,7 @@ DEFINE_TEST(test_read_format_cpio_filename_UTF8_UTF8_jp)
/* Close the archive. */
assertEqualInt(ARCHIVE_OK, archive_read_close(a));
assertEqualInt(ARCHIVE_OK, archive_read_free(a));
+#endif
}
DEFINE_TEST(test_read_format_cpio_filename_CP866_KOI8R)
@@ -500,6 +505,11 @@ cleanup:
DEFINE_TEST(test_read_format_cpio_filename_UTF8_UTF8_ru)
{
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ /* Since we explicitly DON'T set hdrcharset=UTF-8 below */
+ skipping("Windows defaults to OEMCP, not UTF-8");
+ return;
+#else
const char *refname = "test_read_format_cpio_filename_utf8_ru.cpio";
struct archive *a;
struct archive_entry *ae;
@@ -542,6 +552,7 @@ DEFINE_TEST(test_read_format_cpio_filename_UTF8_UTF8_ru)
/* Close the archive. */
assertEqualInt(ARCHIVE_OK, archive_read_close(a));
assertEqualInt(ARCHIVE_OK, archive_read_free(a));
+#endif
}
DEFINE_TEST(test_read_format_cpio_filename_eucJP_CP932)
diff --git a/libarchive/test/test_read_format_cpio_filename_cp866.cpio.uu b/libarchive/test/test_read_format_cpio_filename_cp866.cpio.uu
index 5f0658504039..b1ac82f545b3 100644
--- a/libarchive/test/test_read_format_cpio_filename_cp866.cpio.uu
+++ b/libarchive/test/test_read_format_cpio_filename_cp866.cpio.uu
@@ -1,4 +1,4 @@
-begin 644 test_read_format_cpio_cp866.cpio
+begin 644 test_read_format_cpio_filename_cp866.cpio
M,#<P-S`W,#`P,3,W,#`P,#`Q,3`P-S4U,#`Q-S4Q,#`Q-S4Q,#`P,#`Q,#`P
M,#`P,3$U-#<S,C$U,#$P,#`P,#<P,#`P,#`P,#`P-H^0B(*%D@#P\NGWY?0P
M-S`W,#<P,#`Q,S<P,#`P,#(Q,#`W-34P,#$W-3$P,#$W-3$P,#`P,#$P,#`P
diff --git a/libarchive/test/test_read_format_cpio_filename_eucjp.cpio.uu b/libarchive/test/test_read_format_cpio_filename_eucjp.cpio.uu
index 9aa7666bc4a8..b900adb0561c 100644
--- a/libarchive/test/test_read_format_cpio_filename_eucjp.cpio.uu
+++ b/libarchive/test/test_read_format_cpio_filename_eucjp.cpio.uu
@@ -1,4 +1,4 @@
-begin 644 test_read_format_cpio_eucjp.cpio
+begin 644 test_read_format_cpio_filename_eucjp.cpio
M,#<P-S`W,#`P,3,W,#`P,#`Q,3`P-C0T,#`Q-S4Q,#`Q-S4Q,#`P,#`Q,#`P
M,#`P,3$U-3$U,C(U,C`P,#`P,3$P,#`P,#`P,#`Q,+3!N_HN='AT`(J_CIJ"
MJ8+(,#<P-S`W,#`P,3,W,#`P,#`R,3`P-C0T,#`Q-S4Q,#`Q-S4Q,#`P,#`Q
diff --git a/libarchive/test/test_read_format_cpio_filename_koi8r.cpio.uu b/libarchive/test/test_read_format_cpio_filename_koi8r.cpio.uu
index dcdfd0ed63d8..76f58acace73 100644
--- a/libarchive/test/test_read_format_cpio_filename_koi8r.cpio.uu
+++ b/libarchive/test/test_read_format_cpio_filename_koi8r.cpio.uu
@@ -1,4 +1,4 @@
-begin 644 test_read_format_cpio_koi8r.cpio
+begin 644 test_read_format_cpio_filename_koi8r.cpio
M,#<P-S`W,#`P,3,W,#`P,#`Q,3`P-S4U,#`Q-S4Q,#`Q-S4Q,#`P,#`Q,#`P
M,#`P,3$U-#<S,C`P,S8P,#`P,#<P,#`P,#`P,#`P-O#RZ??E]`#P\NGWY?0P
M-S`W,#<P,#`Q,S<P,#`P,#(Q,#`W-34P,#$W-3$P,#$W-3$P,#`P,#$P,#`P
diff --git a/libarchive/test/test_read_format_cpio_filename_utf8_jp.cpio.uu b/libarchive/test/test_read_format_cpio_filename_utf8_jp.cpio.uu
index 8f9a6f652c28..45c3c4791ffa 100644
--- a/libarchive/test/test_read_format_cpio_filename_utf8_jp.cpio.uu
+++ b/libarchive/test/test_read_format_cpio_filename_utf8_jp.cpio.uu
@@ -1,4 +1,4 @@
-begin 644 test_read_format_cpio_utf8_jp.cpio
+begin 644 test_read_format_cpio_filename_utf8_jp.cpio
M,#<P-S`W,#`P,3,W,#`P,#`Q,3`P-C0T,#`Q-S4Q,#`Q-S4Q,#`P,#`Q,#`P
M,#`P,3$U-3$U,C(S-C8P,#`P,3,P,#`P,#`P,#`Q,.:\HN6MERYT>'0`BK^.
MFH*I@L@P-S`W,#<P,#`Q,S<P,#`P,#(Q,#`V-#0P,#$W-3$P,#$W-3$P,#`P
diff --git a/libarchive/test/test_read_format_cpio_filename_utf8_ru.cpio.uu b/libarchive/test/test_read_format_cpio_filename_utf8_ru.cpio.uu
index 9ed52f87c44c..849b9fe332cf 100644
--- a/libarchive/test/test_read_format_cpio_filename_utf8_ru.cpio.uu
+++ b/libarchive/test/test_read_format_cpio_filename_utf8_ru.cpio.uu
@@ -1,4 +1,4 @@
-begin 644 test_read_format_cpio_utf8_ru.cpio
+begin 644 test_read_format_cpio_filename_utf8_ru.cpio
M,#<P-S`W,#`P,3,W,#`P,#`Q,3`P-S4U,#`Q-S4Q,#`Q-S4Q,#`P,#`Q,#`P
M,#`P,3$U,C$U,38U,38P,#`P,34P,#`P,#`P,#`P-M"?T*#0F-"2T)70H@#P
M\NGWY?0P-S`W,#<P,#`Q,S<P,#`P,#(Q,#`W-34P,#$W-3$P,#$W-3$P,#`P
diff --git a/libarchive/test/test_read_format_cpio_odc.c b/libarchive/test/test_read_format_cpio_odc.c
index f433a4c916cd..00b7c1c0698b 100644
--- a/libarchive/test/test_read_format_cpio_odc.c
+++ b/libarchive/test/test_read_format_cpio_odc.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/test/test_read_format_cpio_odc.c,v 1.3 2008/09/01 05:38:33 kientzle Exp $");
static unsigned char archive[] = {
'0','7','0','7','0','7','0','0','2','0','2','5','0','7','4','6','6','1','0',
diff --git a/libarchive/test/test_read_format_cpio_svr4_gzip.c b/libarchive/test/test_read_format_cpio_svr4_gzip.c
index cb813d24f5d4..ae201de00f68 100644
--- a/libarchive/test/test_read_format_cpio_svr4_gzip.c
+++ b/libarchive/test/test_read_format_cpio_svr4_gzip.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/test/test_read_format_cpio_svr4_gzip.c 191183 2009-04-17 01:06:31Z kientzle $");
static unsigned char archive[] = {
31,139,8,0,236,'c',217,'D',0,3,'3','0','7','0','7','0','4','0','0',181,'0',
diff --git a/libarchive/test/test_read_format_cpio_svr4c_Z.c b/libarchive/test/test_read_format_cpio_svr4c_Z.c
index 29aa2c6341e6..b4d9a8470851 100644
--- a/libarchive/test/test_read_format_cpio_svr4c_Z.c
+++ b/libarchive/test/test_read_format_cpio_svr4c_Z.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/test/test_read_format_cpio_svr4c_Z.c 189381 2009-03-05 00:31:48Z kientzle $");
static unsigned char archive[] = {
31,157,144,'0','n',4,132,'!',3,6,140,26,'8','n',228,16,19,195,160,'A',26,
diff --git a/libarchive/test/test_read_format_empty.c b/libarchive/test/test_read_format_empty.c
index 2556503acdf5..fc8d8cc54ebf 100644
--- a/libarchive/test/test_read_format_empty.c
+++ b/libarchive/test/test_read_format_empty.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/test/test_read_format_empty.c 189308 2009-03-03 17:02:51Z kientzle $");
static unsigned char archive[] = { 0 };
diff --git a/libarchive/test/test_read_format_gtar_filename.c b/libarchive/test/test_read_format_gtar_filename.c
index f81796b786da..cf9c30991b28 100644
--- a/libarchive/test/test_read_format_gtar_filename.c
+++ b/libarchive/test/test_read_format_gtar_filename.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD");
#include <locale.h>
diff --git a/libarchive/test/test_read_format_gtar_filename_cp866.tar.Z.uu b/libarchive/test/test_read_format_gtar_filename_cp866.tar.Z.uu
index a6fd80c24695..b06fb11d5528 100644
--- a/libarchive/test/test_read_format_gtar_filename_cp866.tar.Z.uu
+++ b/libarchive/test/test_read_format_gtar_filename_cp866.tar.Z.uu
@@ -1,4 +1,4 @@
-begin 644 test_read_format_gtar_cp866.tar.Z
+begin 644 test_read_format_gtar_filename_cp866.tar.Z
M'YV0CR`A$E1($H"#"!,J7,BPH<.'$"-*1`BC(HP;-6H`L!@#8XR-%3O6^&BQ
MI$4;`&+$J$'CQ@P9*V&0C`'#Q@T9`$#`F,BSI\^?0`'4F4,GC!P0(`",J5,F
MJ,.E39U*G4JUJM6K6'G"DY?N7CEZ6<.*'4NVK-FS:-.J7<NVK<-7X%")*B7.
diff --git a/libarchive/test/test_read_format_gtar_filename_eucjp.tar.Z.uu b/libarchive/test/test_read_format_gtar_filename_eucjp.tar.Z.uu
index 87fa582f6809..97d87728f9fb 100644
--- a/libarchive/test/test_read_format_gtar_filename_eucjp.tar.Z.uu
+++ b/libarchive/test/test_read_format_gtar_filename_eucjp.tar.Z.uu
@@ -1,4 +1,4 @@
-begin 644 test_read_format_gtar_eucjp.tar.Z
+begin 644 test_read_format_gtar_filename_eucjp.tar.Z
M'YV0M(+MTN>"#AXZ`!(J7,BPH<.'$"-*G$@1`(R+,&S0H&'Q8HP;-6)TA/$Q
MY$B,&&/``!`C1HV0-63(B+F29`P:)D&LK,BSI\^?0.O,H1-&#@@0`,;4*0,T
MHE*F3:-*G4JUJM6K4Q7]<J1)4"I!R+"*'4NVK-FS:-.J7<NVK=NHR7H5//BV
diff --git a/libarchive/test/test_read_format_gtar_filename_koi8r.tar.Z.uu b/libarchive/test/test_read_format_gtar_filename_koi8r.tar.Z.uu
index bf4ce01708cc..a198830ae1c9 100644
--- a/libarchive/test/test_read_format_gtar_filename_koi8r.tar.Z.uu
+++ b/libarchive/test/test_read_format_gtar_filename_koi8r.tar.Z.uu
@@ -1,4 +1,4 @@
-begin 644 test_read_format_gtar_koi8r.tar.Z
+begin 644 test_read_format_gtar_filename_koi8r.tar.Z
M'YV0T*0ENU:,&H"#"!,J7,BPH<.'$"-*1`BC(HP;-6H`L!@#8XR-%3O6^&BQ
MI$4;`&+$J$'CQ@P9%6>@A*&RAHP;`$#`F,BSI\^?0`'4F4,GC!P0(`",J5,F
MJ,.E39U*G4JUJM6K6'G"DY?N7CEZ6<.*'4NVK-FS:-.J7<NVK<.M7;^ZG<NP
diff --git a/libarchive/test/test_read_format_gtar_gz.c b/libarchive/test/test_read_format_gtar_gz.c
index 2541f9926216..bc712b9e6e44 100644
--- a/libarchive/test/test_read_format_gtar_gz.c
+++ b/libarchive/test/test_read_format_gtar_gz.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/test/test_read_format_gtar_gz.c 191183 2009-04-17 01:06:31Z kientzle $");
static unsigned char archive[] = {
31,139,8,0,'+','e',217,'D',0,3,211,211,'g',160,'9','0',0,2,'s','S','S',16,
diff --git a/libarchive/test/test_read_format_gtar_lzma.c b/libarchive/test/test_read_format_gtar_lzma.c
index 280a089fd391..1aa0212da0e3 100644
--- a/libarchive/test/test_read_format_gtar_lzma.c
+++ b/libarchive/test/test_read_format_gtar_lzma.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/test/test_read_format_gtar_lzma.c 191183 2009-04-17 01:06:31Z kientzle $");
static unsigned char archive[] = {
0x5d, 0x0, 0x0, 0x80, 0x0, 0x0, 0x28, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0,
diff --git a/libarchive/test/test_read_format_gtar_sparse.c b/libarchive/test/test_read_format_gtar_sparse.c
index 6d15a4745f9c..6a2e3650c5a8 100644
--- a/libarchive/test/test_read_format_gtar_sparse.c
+++ b/libarchive/test/test_read_format_gtar_sparse.c
@@ -23,8 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/test/test_read_format_gtar_sparse.c 189308 2009-03-03 17:02:51Z kientzle $");
-
struct contents {
int64_t o;
diff --git a/libarchive/test/test_read_format_gtar_sparse_1_13.tar.uu b/libarchive/test/test_read_format_gtar_sparse_1_13.tar.uu
index 86a59ffa47ab..5ab5190362a2 100644
--- a/libarchive/test/test_read_format_gtar_sparse_1_13.tar.uu
+++ b/libarchive/test/test_read_format_gtar_sparse_1_13.tar.uu
@@ -1,4 +1,3 @@
-$FreeBSD: head/lib/libarchive/test/test_read_format_gtar_sparse_1_13.tar.uu 191183 2009-04-17 01:06:31Z kientzle $
begin 644 test_read_format_gtar_sparse_1_13.tar
M<W!A<G-E````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
diff --git a/libarchive/test/test_read_format_gtar_sparse_1_17.tar.uu b/libarchive/test/test_read_format_gtar_sparse_1_17.tar.uu
index c801db840736..815ec6d64a07 100644
--- a/libarchive/test/test_read_format_gtar_sparse_1_17.tar.uu
+++ b/libarchive/test/test_read_format_gtar_sparse_1_17.tar.uu
@@ -1,4 +1,3 @@
-$FreeBSD: head/lib/libarchive/test/test_read_format_gtar_sparse_1_17.tar.uu 189308 2009-03-03 17:02:51Z kientzle $
begin 644 test_read_format_gtar_sparse_1_17.tar
M<W!A<G-E````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
diff --git a/libarchive/test/test_read_format_gtar_sparse_1_17_posix00.tar.uu b/libarchive/test/test_read_format_gtar_sparse_1_17_posix00.tar.uu
index 6001635f6adc..d19a85810a87 100644
--- a/libarchive/test/test_read_format_gtar_sparse_1_17_posix00.tar.uu
+++ b/libarchive/test/test_read_format_gtar_sparse_1_17_posix00.tar.uu
@@ -1,4 +1,3 @@
-$FreeBSD: head/lib/libarchive/test/test_read_format_gtar_sparse_1_17_posix00.tar.uu 189308 2009-03-03 17:02:51Z kientzle $
begin 644 test_read_format_gtar_sparse_1_17_posix00.tar
M+B]087A(96%D97)S+C,X-C4Y+W-P87)S90``````````````````````````
M````````````````````````````````````````````````````````````
diff --git a/libarchive/test/test_read_format_gtar_sparse_1_17_posix01.tar.uu b/libarchive/test/test_read_format_gtar_sparse_1_17_posix01.tar.uu
index 6a2ad83c4d34..fac4feeb8f32 100644
--- a/libarchive/test/test_read_format_gtar_sparse_1_17_posix01.tar.uu
+++ b/libarchive/test/test_read_format_gtar_sparse_1_17_posix01.tar.uu
@@ -1,4 +1,3 @@
-$FreeBSD: head/lib/libarchive/test/test_read_format_gtar_sparse_1_17_posix01.tar.uu 189308 2009-03-03 17:02:51Z kientzle $
begin 644 test_read_format_gtar_sparse_1_17_posix01.tar
M+B]087A(96%D97)S+C,X-C8Q+W-P87)S90``````````````````````````
M````````````````````````````````````````````````````````````
diff --git a/libarchive/test/test_read_format_gtar_sparse_1_17_posix10.tar.uu b/libarchive/test/test_read_format_gtar_sparse_1_17_posix10.tar.uu
index 80e802a46b3a..7ddd3fd15c2c 100644
--- a/libarchive/test/test_read_format_gtar_sparse_1_17_posix10.tar.uu
+++ b/libarchive/test/test_read_format_gtar_sparse_1_17_posix10.tar.uu
@@ -1,4 +1,3 @@
-$FreeBSD: head/lib/libarchive/test/test_read_format_gtar_sparse_1_17_posix10.tar.uu 189308 2009-03-03 17:02:51Z kientzle $
begin 644 test_read_format_gtar_sparse_1_17_posix10.tar
M+B]087A(96%D97)S+C,X-C8S+W-P87)S90``````````````````````````
M````````````````````````````````````````````````````````````
diff --git a/libarchive/test/test_read_format_gtar_sparse_1_17_posix10_modified.tar.uu b/libarchive/test/test_read_format_gtar_sparse_1_17_posix10_modified.tar.uu
index a9120a21af29..cf8fd77cc0ca 100644
--- a/libarchive/test/test_read_format_gtar_sparse_1_17_posix10_modified.tar.uu
+++ b/libarchive/test/test_read_format_gtar_sparse_1_17_posix10_modified.tar.uu
@@ -1,4 +1,3 @@
-$FreeBSD: src/lib/libarchive/test/test_read_format_gtar_sparse_1_17_posix10_modified.tar.uu,v 1.2 2008/07/03 03:26:30 peter Exp $
begin 644 test_read_format_gtar_sparse_1_17_posix10_modified.tar
M+B]087A(96%D97)S+C,X-C8S+W-P87)S90``````````````````````````
M````````````````````````````````````````````````````````````
diff --git a/libarchive/test/test_read_format_gtar_sparse_skip_entry.c b/libarchive/test/test_read_format_gtar_sparse_skip_entry.c
index 1caed21bcaca..6b1d6556aa64 100644
--- a/libarchive/test/test_read_format_gtar_sparse_skip_entry.c
+++ b/libarchive/test/test_read_format_gtar_sparse_skip_entry.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD");
#if defined(__BORLANDC__) || (defined(_MSC_VER) && _MSC_VER <= 1300)
# define LITERAL_LL(x) x##i64
diff --git a/libarchive/test/test_read_format_gtar_sparse_skip_entry.tar.Z.uu b/libarchive/test/test_read_format_gtar_sparse_skip_entry.tar.Z.uu
index dc0daae9e1e2..634ac0673db7 100644
--- a/libarchive/test/test_read_format_gtar_sparse_skip_entry.tar.Z.uu
+++ b/libarchive/test/test_read_format_gtar_sparse_skip_entry.tar.Z.uu
@@ -1,4 +1,4 @@
-begin 644 -
+begin 644 test_read_format_gtar_sparse_skip_entry.tar.Z
M'YV04,+@05(F#)DR<EZ$`<"PH<.'$"-*G$BQHL6*,#+:L$$#!(",,6[4@.$1
MI$B2'S.JS#A#A@P0,63,L`$C!HP9-VB\K"FCAHT8`$#@N4BTJ-&C2"/6F4,G
MC)R48^J424HQZE2J$E=F+*G5(]:O8,.*'3M6!LDY:?24Z6'S!DX:,7#(H$%#
diff --git a/libarchive/test/test_read_format_iso.iso.Z.uu b/libarchive/test/test_read_format_iso.iso.Z.uu
index 989c11251bae..033e33976930 100644
--- a/libarchive/test/test_read_format_iso.iso.Z.uu
+++ b/libarchive/test/test_read_format_iso.iso.Z.uu
@@ -1,5 +1,3 @@
-$FreeBSD: head/lib/libarchive/test/test_read_format_iso.iso.Z.uu 201247 2009-12-30 05:59:21Z kientzle $
-
begin 644 test_read_format_iso.iso.Z
M'YV0``(*'$BPH,&#"!,J7,BPH<.'$"-*G$BQHL6+&#-JW,BQH\>/($.*'$FR
MI,F3*%.J7,FRI<N7,&/*G$FSILV;.'/JW,FSI\^?0(,*'4JTJ-&C2),J7<JT
diff --git a/libarchive/test/test_read_format_iso_Z.c b/libarchive/test/test_read_format_iso_Z.c
index 6492706c3df6..09b0acb804ea 100644
--- a/libarchive/test/test_read_format_iso_Z.c
+++ b/libarchive/test/test_read_format_iso_Z.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/test/test_read_format_iso_gz.c 201247 2009-12-30 05:59:21Z kientzle $");
static void
test1(void)
diff --git a/libarchive/test/test_read_format_iso_joliet.iso.Z.uu b/libarchive/test/test_read_format_iso_joliet.iso.Z.uu
index 4642fece1b71..1854fc26ee84 100644
--- a/libarchive/test/test_read_format_iso_joliet.iso.Z.uu
+++ b/libarchive/test/test_read_format_iso_joliet.iso.Z.uu
@@ -1,5 +1,3 @@
-$FreeBSD: head/lib/libarchive/test/test_read_format_iso_joliet.iso.Z.uu 201247 2009-12-30 05:59:21Z kientzle $
-
begin 644 test_read_format_iso_joliet.iso.Z
M'YV0``(*'$BPH,&#"!,J7,BPH<.'$"-*G$BQHL6+&#-JW,BQH\>/($.*'$FR
MI,F3*%.J7,FRI<N7,&/*G$FSILV;.'/JW,FSI\^?0(,*'4JTJ-&C2),J7<JT
diff --git a/libarchive/test/test_read_format_iso_joliet_long.iso.Z.uu b/libarchive/test/test_read_format_iso_joliet_long.iso.Z.uu
index 030dd3cb2683..9dc675b5fe6a 100644
--- a/libarchive/test/test_read_format_iso_joliet_long.iso.Z.uu
+++ b/libarchive/test/test_read_format_iso_joliet_long.iso.Z.uu
@@ -1,5 +1,3 @@
-$FreeBSD: head/lib/libarchive/test/test_read_format_iso_joliet_long.iso.Z.uu 201247 2009-12-30 05:59:21Z kientzle $
-
begin 644 test_read_format_iso_joliet_long.iso.Z
M'YV0``(*'$BPH,&#"!,J7,BPH<.'$"-*G$BQHL6+&#-JW,BQH\>/($.*'$FR
MI,F3*%.J7,FRI<N7,&/*G$FSILV;.'/JW,FSI\^?0(,*'4JTJ-&C2),J7<JT
diff --git a/libarchive/test/test_read_format_iso_joliet_rockridge.iso.Z.uu b/libarchive/test/test_read_format_iso_joliet_rockridge.iso.Z.uu
index 9f1dd09c70fa..ac2fea4ab675 100644
--- a/libarchive/test/test_read_format_iso_joliet_rockridge.iso.Z.uu
+++ b/libarchive/test/test_read_format_iso_joliet_rockridge.iso.Z.uu
@@ -1,5 +1,3 @@
-$FreeBSD: head/lib/libarchive/test/test_read_format_iso_joliet_rockridge.iso.Z.uu 201247 2009-12-30 05:59:21Z kientzle $
-
begin 644 test_read_format_iso_joliet_rockridge.iso.Z
M'YV0``(*'$BPH,&#"!,J7,BPH<.'$"-*G$BQHL6+&#-JW,BQH\>/($.*'$FR
MI,F3*%.J7,FRI<N7,&/*G$FSILV;.'/JW,FSI\^?0(,*'4JTJ-&C2),J7<JT
diff --git a/libarchive/test/test_read_format_iso_multi_extent.c b/libarchive/test/test_read_format_iso_multi_extent.c
index dafbfd38d681..de9a40114c14 100644
--- a/libarchive/test/test_read_format_iso_multi_extent.c
+++ b/libarchive/test/test_read_format_iso_multi_extent.c
@@ -24,7 +24,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/test/test_read_format_iso_multi_extent.c 201247 2009-12-30 05:59:21Z kientzle $");
DEFINE_TEST(test_read_format_iso_multi_extent)
{
diff --git a/libarchive/test/test_read_format_iso_multi_extent.iso.Z.uu b/libarchive/test/test_read_format_iso_multi_extent.iso.Z.uu
index 79100f077c99..922b5e036872 100644
--- a/libarchive/test/test_read_format_iso_multi_extent.iso.Z.uu
+++ b/libarchive/test/test_read_format_iso_multi_extent.iso.Z.uu
@@ -1,5 +1,3 @@
-$FreeBSD: head/lib/libarchive/test/test_read_format_iso_multi_extent.iso.Z.uu 201247 2009-12-30 05:59:21Z kientzle $
-
begin 644 test_read_format_iso_multi_extent.iso.Z
M'YV0``(*'$BPH,&#"!,J7,BPH<.'$"-*G$BQHL6+&#-JW,BQH\>/($.*'$FR
MI,F3*%.J7,FRI<N7,&/*G$FSILV;.'/JW,FSI\^?0(,*'4JTJ-&C2),J7<JT
diff --git a/libarchive/test/test_read_format_iso_rockridge.iso.Z.uu b/libarchive/test/test_read_format_iso_rockridge.iso.Z.uu
index 5f06cb3ab447..716036180cd0 100644
--- a/libarchive/test/test_read_format_iso_rockridge.iso.Z.uu
+++ b/libarchive/test/test_read_format_iso_rockridge.iso.Z.uu
@@ -1,5 +1,3 @@
-$FreeBSD: head/lib/libarchive/test/test_read_format_iso_rockridge.iso.Z.uu 201247 2009-12-30 05:59:21Z kientzle $
-
begin 644 test_read_format_iso_rockridge.iso.Z
M'YV0``(*'$BPH,&#"!,J7,BPH<.'$"-*G$BQHL6+&#-JW,BQH\>/($.*'$FR
MI,F3*%.J7,FRI<N7,&/*G$FSILV;.'/JW,FSI\^?0(,*'4JTJ-&C2),J7<JT
diff --git a/libarchive/test/test_read_format_iso_rockridge_ce.iso.Z.uu b/libarchive/test/test_read_format_iso_rockridge_ce.iso.Z.uu
index 00848957056a..cd817abce1f4 100644
--- a/libarchive/test/test_read_format_iso_rockridge_ce.iso.Z.uu
+++ b/libarchive/test/test_read_format_iso_rockridge_ce.iso.Z.uu
@@ -1,5 +1,3 @@
-$FreeBSD: head/lib/libarchive/test/test_read_format_iso_rockridge_ce.iso.Z.uu 201247 2009-12-30 05:59:21Z kientzle $
-
begin 644 test_read_format_iso_rockridge_ce.iso.Z
M'YV0``(*'$BPH,&#"!,J7,BPH<.'$"-*G$BQHL6+&#-JW,BQH\>/($.*'$FR
MI,F3*%.J7,FRI<N7,&/*G$FSILV;.'/JW,FSI\^?0(,*'4JTJ-&C2),J7<JT
diff --git a/libarchive/test/test_read_format_iso_rockridge_new.iso.Z.uu b/libarchive/test/test_read_format_iso_rockridge_new.iso.Z.uu
index 3ef253b5b1cd..8ccfe59a73bd 100644
--- a/libarchive/test/test_read_format_iso_rockridge_new.iso.Z.uu
+++ b/libarchive/test/test_read_format_iso_rockridge_new.iso.Z.uu
@@ -1,5 +1,3 @@
-$FreeBSD: head/lib/libarchive/test/test_read_format_iso_rockridge_new.iso.Z.uu 201247 2009-12-30 05:59:21Z kientzle $
-
begin 644 test_read_format_iso_rockridge_new.iso.Z
M'YV0``(*'$BPH,&#"!,J7,BPH<.'$"-*G$BQHL6+&#-JW,BQH\>/($.*'$FR
MI,F3*%.J7,FRI<N7,&/*G$FSILV;.'/JW,FSI\^?0(,*'4JTJ-&C2),J7<JT
diff --git a/libarchive/test/test_read_format_iso_rockridge_rr_moved.iso.Z.uu b/libarchive/test/test_read_format_iso_rockridge_rr_moved.iso.Z.uu
index 8ec91cc2d909..f710d2586c93 100644
--- a/libarchive/test/test_read_format_iso_rockridge_rr_moved.iso.Z.uu
+++ b/libarchive/test/test_read_format_iso_rockridge_rr_moved.iso.Z.uu
@@ -1,5 +1,3 @@
-$FreeBSD: head/lib/libarchive/test/test_read_format_iso_rockridge_rr_moved.iso.Z.uu 201247 2009-12-30 05:59:21Z kientzle $
-
begin 644 test_read_format_iso_rockridge_rr_moved.iso.Z
M'YV0``(*'$BPH,&#"!,J7,BPH<.'$"-*G$BQHL6+&#-JW,BQH\>/($.*'$FR
MI,F3*%.J7,FRI<N7,&/*G$FSILV;.'/JW,FSI\^?0(,*'4JTJ-&C2),J7<JT
diff --git a/libarchive/test/test_read_format_iso_xorriso.c b/libarchive/test/test_read_format_iso_xorriso.c
index ce71a560a01c..ca8a027b5ad2 100644
--- a/libarchive/test/test_read_format_iso_xorriso.c
+++ b/libarchive/test/test_read_format_iso_xorriso.c
@@ -23,8 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
-
/*
Execute the following command to rebuild the data for this program:
diff --git a/libarchive/test/test_read_format_iso_zisofs.iso.Z.uu b/libarchive/test/test_read_format_iso_zisofs.iso.Z.uu
index ef54ca6c7701..53e75cabae1a 100644
--- a/libarchive/test/test_read_format_iso_zisofs.iso.Z.uu
+++ b/libarchive/test/test_read_format_iso_zisofs.iso.Z.uu
@@ -1,5 +1,3 @@
-$FreeBSD: head/lib/libarchive/test/test_read_format_iso_zisofs.iso.Z.uu 201247 2009-12-30 05:59:21Z kientzle $
-
begin 644 test_read_format_iso_zisofs.iso.Z
M'YV0``(*'$BPH,&#"!,J7,BPH<.'$"-*G$BQHL6+&#-JW,BQH\>/($.*'$FR
MI,F3*%.J7,FRI<N7,&/*G$FSILV;.'/JW,FSI\^?0(,*'4JTJ-&C2),J7<JT
diff --git a/libarchive/test/test_read_format_isojoliet_bz2.c b/libarchive/test/test_read_format_isojoliet_bz2.c
index eb33c0b4f829..68a9486e7aac 100644
--- a/libarchive/test/test_read_format_isojoliet_bz2.c
+++ b/libarchive/test/test_read_format_isojoliet_bz2.c
@@ -27,7 +27,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/test/test_read_format_isojoliet_bz2.c 201247 2009-12-30 05:59:21Z kientzle $");
/*
Execute the following to rebuild the data for this program:
diff --git a/libarchive/test/test_read_format_isojoliet_long.c b/libarchive/test/test_read_format_isojoliet_long.c
index 4283c399fbb4..fa089c1de1c9 100644
--- a/libarchive/test/test_read_format_isojoliet_long.c
+++ b/libarchive/test/test_read_format_isojoliet_long.c
@@ -24,7 +24,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/test/test_read_format_isojoliet_long.c 201247 2009-12-30 05:59:21Z kientzle $");
/*
Execute the following to rebuild the data for this program:
@@ -115,7 +114,7 @@ DEFINE_TEST(test_read_format_isojoliet_long)
pathname[102] = '3';
pathname[103] = '\0';
assertEqualInt(0, archive_read_next_header(a, &ae));
- assertEqualString("hardlink", archive_entry_pathname(ae));
+ assertEqualString(pathname, archive_entry_pathname(ae));
assertEqualInt(AE_IFREG, archive_entry_filetype(ae));
assert(archive_entry_hardlink(ae) == NULL);
assertEqualInt(6, archive_entry_size(ae));
@@ -129,9 +128,9 @@ DEFINE_TEST(test_read_format_isojoliet_long)
/* Second name for the same regular file (this happens to be
* returned second, so does get marked as a hardlink). */
assertEqualInt(0, archive_read_next_header(a, &ae));
- assertEqualString(pathname, archive_entry_pathname(ae));
+ assertEqualString("hardlink", archive_entry_pathname(ae));
assertEqualInt(AE_IFREG, archive_entry_filetype(ae));
- assertEqualString("hardlink", archive_entry_hardlink(ae));
+ assertEqualString(pathname, archive_entry_hardlink(ae));
assert(!archive_entry_size_is_set(ae));
assertEqualInt(archive_entry_is_encrypted(ae), 0);
assertEqualIntA(a, archive_read_has_encrypted_entries(a), ARCHIVE_READ_FORMAT_ENCRYPTION_UNSUPPORTED);
diff --git a/libarchive/test/test_read_format_isojoliet_rr.c b/libarchive/test/test_read_format_isojoliet_rr.c
index 3c19516d614d..844f41367128 100644
--- a/libarchive/test/test_read_format_isojoliet_rr.c
+++ b/libarchive/test/test_read_format_isojoliet_rr.c
@@ -27,7 +27,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/test/test_read_format_isojoliet_rr.c 201247 2009-12-30 05:59:21Z kientzle $");
/*
Execute the following to rebuild the data for this program:
diff --git a/libarchive/test/test_read_format_isojoliet_versioned.c b/libarchive/test/test_read_format_isojoliet_versioned.c
index 011b5e296b94..b8a03362274f 100644
--- a/libarchive/test/test_read_format_isojoliet_versioned.c
+++ b/libarchive/test/test_read_format_isojoliet_versioned.c
@@ -27,7 +27,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/test/test_read_format_isojoliet_bz2.c 201247 2009-12-30 05:59:21Z kientzle $");
/*
* The data for this testcase was provided by Mike Qin <mikeandmore@gmail.com>
diff --git a/libarchive/test/test_read_format_isorr_bz2.c b/libarchive/test/test_read_format_isorr_bz2.c
index fb4f4a853ab5..c1accea78792 100644
--- a/libarchive/test/test_read_format_isorr_bz2.c
+++ b/libarchive/test/test_read_format_isorr_bz2.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/test/test_read_format_isorr_bz2.c 201247 2009-12-30 05:59:21Z kientzle $");
/*
PLEASE use old cdrtools; mkisofs version is 2.01.
diff --git a/libarchive/test/test_read_format_isorr_ce.c b/libarchive/test/test_read_format_isorr_ce.c
index 1e57acb7668b..6b983e8ff4ab 100644
--- a/libarchive/test/test_read_format_isorr_ce.c
+++ b/libarchive/test/test_read_format_isorr_ce.c
@@ -24,7 +24,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/test/test_read_format_isorr_ce.c 201247 2009-12-30 05:59:21Z kientzle $");
/*
Execute the following command to rebuild the data for this program:
diff --git a/libarchive/test/test_read_format_isorr_new_bz2.c b/libarchive/test/test_read_format_isorr_new_bz2.c
index 4c1b5692e9ef..787c1e6301be 100644
--- a/libarchive/test/test_read_format_isorr_new_bz2.c
+++ b/libarchive/test/test_read_format_isorr_new_bz2.c
@@ -23,8 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/test/test_read_format_isorr_new_bz2.c 201247 2009-12-30 05:59:21Z kientzle $");
-
/*
PLEASE use latest cdrtools at least mkisofs version is 2.01.01a63 or later.
diff --git a/libarchive/test/test_read_format_isorr_rr_moved.c b/libarchive/test/test_read_format_isorr_rr_moved.c
index 693caef621f2..a27230033672 100644
--- a/libarchive/test/test_read_format_isorr_rr_moved.c
+++ b/libarchive/test/test_read_format_isorr_rr_moved.c
@@ -24,7 +24,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/test/test_read_format_isorr_rr_moved.c 201247 2009-12-30 05:59:21Z kientzle $");
/*
Execute the following command to rebuild the data for this program:
diff --git a/libarchive/test/test_read_format_isozisofs_bz2.c b/libarchive/test/test_read_format_isozisofs_bz2.c
index adf9624274e0..3f059fde08b5 100644
--- a/libarchive/test/test_read_format_isozisofs_bz2.c
+++ b/libarchive/test/test_read_format_isozisofs_bz2.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/test/test_read_format_isozisofs_bz2.c 201247 2009-12-30 05:59:21Z kientzle $");
/*
Execute the following command to rebuild the data for this program:
diff --git a/libarchive/test/test_read_format_lha.c b/libarchive/test/test_read_format_lha.c
index 6a53976c2a75..93e79183e5c3 100644
--- a/libarchive/test/test_read_format_lha.c
+++ b/libarchive/test/test_read_format_lha.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD");
/*
Execute the following command to rebuild the data for this program:
diff --git a/libarchive/test/test_read_format_lha_bugfix_0.c b/libarchive/test/test_read_format_lha_bugfix_0.c
index 2b4160b3220e..bbdcb81569b6 100644
--- a/libarchive/test/test_read_format_lha_bugfix_0.c
+++ b/libarchive/test/test_read_format_lha_bugfix_0.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD");
DEFINE_TEST(test_read_format_lha_bugfix_0)
{
diff --git a/libarchive/test/test_read_format_lha_filename.c b/libarchive/test/test_read_format_lha_filename.c
index 126a8704ce4a..d726f6245d7d 100644
--- a/libarchive/test/test_read_format_lha_filename.c
+++ b/libarchive/test/test_read_format_lha_filename.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD");
#include <locale.h>
diff --git a/libarchive/test/test_read_format_lha_filename_cp932.lzh.uu b/libarchive/test/test_read_format_lha_filename_cp932.lzh.uu
index 15170146083e..a579fb1aaa61 100644
--- a/libarchive/test/test_read_format_lha_filename_cp932.lzh.uu
+++ b/libarchive/test/test_read_format_lha_filename_cp932.lzh.uu
@@ -1,4 +1,4 @@
-begin 644 test_read_format_lha_cp932.lzh
+begin 644 test_read_format_lha_filename_cp932.lzh
M30`M;&@P+0@````(````*:2#32`"&4A-!P!&I`,```L``8J_CIHN='AT&P!!
M-'"`))KERP%TJNDQFN7+`72JZ3&:Y<L!!@``T2,'``"*OXZ:@JF"R$L`+6QH
M,"T$````!````#RD@TT@`NA;30<`1J0#```)``&57"YT>'0;`$&:91,VFN7+
diff --git a/libarchive/test/test_read_format_lha_filename_utf16.c b/libarchive/test/test_read_format_lha_filename_utf16.c
index 7ab13e43bdd3..d0710799bba4 100644
--- a/libarchive/test/test_read_format_lha_filename_utf16.c
+++ b/libarchive/test/test_read_format_lha_filename_utf16.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD");
#include <locale.h>
diff --git a/libarchive/test/test_read_format_lha_filename_utf16.lzh.uu b/libarchive/test/test_read_format_lha_filename_utf16.lzh.uu
index ca5da7a64e59..0eeea817b462 100644
--- a/libarchive/test/test_read_format_lha_filename_utf16.lzh.uu
+++ b/libarchive/test/test_read_format_lha_filename_utf16.lzh.uu
@@ -1,19 +1,19 @@
-begin 644 test_read_format_lha_filename_utf16.lzh
-M@0`M;&@P+0P````,````L/5872`"IW%-!P!&I`,```T``5]?7U]?7RYT>'0*
-M``)?7U]?7U__%P!$Y`#V`/P`Q`#6`-P`+@!T`'@`=``1`$7<`-8`Q`#\`/8`
-MY`#__QL`078S<F.15=4!]0V8@I%5U0'U#9B"D575`08```\:!P``PZ3#ML.\
-MPX3#EL.<90`M;&AD+0``````````PX"D72`"``!-!P!&I`,```,``0H``E]?
-M7U]?7_\%`$`0`!$`1=P`U@#$`/P`]@#D`/__&P!!FDHB>9B"U0$H^DQ_F(+5
-M`2CZ3'^8@M4!!@``GW<'``!J`"UL:#`M&0```!D```!V)L1=(`*CNTT'`$:D
-M`P``#0`!@V6#6(-G+G1X=`H``E]?7U]?7_\1`$7<`-8`Q`#\`/8`Y`#__QL`
-M00IF#4J@E-4!L"5C?'65U0&P)6-\=975`08``$%^!P``5&5S="!I;B!*87!A
-M;F5S92!+871A:V%N87L`+6QH,"T,````#````+#U6%T@`J=Q30<`1J0#```-
-M``%?7U]?7U\N='AT"@`"@V6#6(-G_Q<`1.0`]@#\`,0`U@#<`"X`=`!X`'0`
-M"P!%QC"Y,,@P__\;`$'D5O!-H)35`?4-F(*15=4!Y%;P3:"4U0$&``"A+0<`
-M`,.DP[;#O,.$PY;#G%0`+6QH9"T``````````-3`PET@`@``30<`1J0#```#
-M``$*``*#98-8@V?_!0!`$``;`$%%!\Y.H)35`3/_]%&@E-4!,__T4:"4U0$&
-M``!>;@<``&8`+6QH,"T,````#````+#U6%T@`J=Q30<`1J0#```-``%?7U]?
-M7U\N='AT%P!$Y`#V`/P`Q`#6`-P`+@!T`'@`=``;`$'D5O!-H)35`?4-F(*1
-@5=4!Y%;P3:"4U0$&``"M>`<``,.DP[;#O,.$PY;#G`#D
-`
-end
+begin 644 test_read_format_lha_filename_utf16.lzh
+M@0`M;&@P+0P````,````L/5872`"IW%-!P!&I`,```T``5]?7U]?7RYT>'0*
+M``)?7U]?7U__%P!$Y`#V`/P`Q`#6`-P`+@!T`'@`=``1`$7<`-8`Q`#\`/8`
+MY`#__QL`078S<F.15=4!]0V8@I%5U0'U#9B"D575`08```\:!P``PZ3#ML.\
+MPX3#EL.<90`M;&AD+0``````````PX"D72`"``!-!P!&I`,```,``0H``E]?
+M7U]?7_\%`$`0`!$`1=P`U@#$`/P`]@#D`/__&P!!FDHB>9B"U0$H^DQ_F(+5
+M`2CZ3'^8@M4!!@``GW<'``!J`"UL:#`M&0```!D```!V)L1=(`*CNTT'`$:D
+M`P``#0`!@V6#6(-G+G1X=`H``E]?7U]?7_\1`$7<`-8`Q`#\`/8`Y`#__QL`
+M00IF#4J@E-4!L"5C?'65U0&P)6-\=975`08``$%^!P``5&5S="!I;B!*87!A
+M;F5S92!+871A:V%N87L`+6QH,"T,````#````+#U6%T@`J=Q30<`1J0#```-
+M``%?7U]?7U\N='AT"@`"@V6#6(-G_Q<`1.0`]@#\`,0`U@#<`"X`=`!X`'0`
+M"P!%QC"Y,,@P__\;`$'D5O!-H)35`?4-F(*15=4!Y%;P3:"4U0$&``"A+0<`
+M`,.DP[;#O,.$PY;#G%0`+6QH9"T``````````-3`PET@`@``30<`1J0#```#
+M``$*``*#98-8@V?_!0!`$``;`$%%!\Y.H)35`3/_]%&@E-4!,__T4:"4U0$&
+M``!>;@<``&8`+6QH,"T,````#````+#U6%T@`J=Q30<`1J0#```-``%?7U]?
+M7U\N='AT%P!$Y`#V`/P`Q`#6`-P`+@!T`'@`=``;`$'D5O!-H)35`?4-F(*1
+@5=4!Y%;P3:"4U0$&``"M>`<``,.DP[;#O,.$PY;#G`#D
+`
+end
diff --git a/libarchive/test/test_read_format_mtree.c b/libarchive/test/test_read_format_mtree.c
index 41d325788923..70730839386d 100644
--- a/libarchive/test/test_read_format_mtree.c
+++ b/libarchive/test/test_read_format_mtree.c
@@ -24,7 +24,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/test/test_read_format_mtree.c 201247 2009-12-30 05:59:21Z kientzle $");
static void
test_read_format_mtree1(void)
@@ -789,6 +788,7 @@ DEFINE_TEST(test_read_format_mtree_nonexistent_contents_file)
assertEqualInt(ARCHIVE_OK, archive_read_close(a));
assertEqualInt(ARCHIVE_OK, archive_read_free(a));
}
+
/*
* Check mtree file with non-printable ascii characters
*/
@@ -814,3 +814,32 @@ DEFINE_TEST(test_read_format_mtree_noprint)
assertEqualInt(ARCHIVE_OK, archive_read_close(a));
assertEqualInt(ARCHIVE_OK, archive_read_free(a));
}
+
+/*
+ * Check mtree file with tab characters, which are supported but not printable
+ */
+DEFINE_TEST(test_read_format_mtree_tab)
+{
+ static char archive[] =
+ "#mtree\n"
+ "\ta\ttype=file\n";
+ struct archive_entry *ae;
+ struct archive *a;
+
+ 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));
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_read_open_memory(a, archive, sizeof(archive)));
+
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
+ assertEqualString(archive_entry_pathname(ae), "a");
+ assertEqualInt(archive_entry_filetype(ae), AE_IFREG);
+
+ assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae));
+ assertEqualInt(1, archive_file_count(a));
+ assertEqualInt(ARCHIVE_OK, archive_read_close(a));
+ assertEqualInt(ARCHIVE_OK, archive_read_free(a));
+}
diff --git a/libarchive/test/test_read_format_pax_bz2.c b/libarchive/test/test_read_format_pax_bz2.c
index 8c5d28ec05d6..4f11137b9c6f 100644
--- a/libarchive/test/test_read_format_pax_bz2.c
+++ b/libarchive/test/test_read_format_pax_bz2.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/test/test_read_format_pax_bz2.c 201247 2009-12-30 05:59:21Z kientzle $");
static unsigned char archive[] = {
'B','Z','h','9','1','A','Y','&','S','Y',152,180,30,185,0,0,140,127,176,212,
diff --git a/libarchive/test/test_read_format_rar.c b/libarchive/test/test_read_format_rar.c
index 1425eb9a4570..dce567af48a9 100644
--- a/libarchive/test/test_read_format_rar.c
+++ b/libarchive/test/test_read_format_rar.c
@@ -214,6 +214,14 @@ DEFINE_TEST(test_read_format_rar_unicode_UTF8)
assert((a = archive_read_new()) != NULL);
assertA(0 == archive_read_support_filter_all(a));
assertA(0 == archive_read_support_format_all(a));
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ /* Windows will use OEMCP as default, but the file is UTF-8. */
+ if (ARCHIVE_OK != archive_read_set_options(a, "rar:hdrcharset=UTF-8")) {
+ skipping("This system cannot read input as UTF-8.");
+ assertEqualInt(ARCHIVE_OK, archive_read_free(a));
+ return;
+ }
+#endif
assertA(0 == archive_read_open_filename(a, reffile, 10240));
/* First header. */
@@ -879,16 +887,9 @@ DEFINE_TEST(test_read_format_rar_windows)
assertEqualInt(ARCHIVE_OK, archive_read_free(a));
}
-DEFINE_TEST(test_read_format_rar_multivolume)
+static void
+test_read_format_rar_multivolume_test_body_helper(struct archive *a)
{
- const char *reffiles[] =
- {
- "test_read_format_rar_multivolume.part0001.rar",
- "test_read_format_rar_multivolume.part0002.rar",
- "test_read_format_rar_multivolume.part0003.rar",
- "test_read_format_rar_multivolume.part0004.rar",
- NULL
- };
int file1_size = 241647978, offset = 0;
char buff[64];
const char file1_test_txt[] = "gin-bottom: 0in\"><BR>\n</P>\n</BODY>\n"
@@ -903,13 +904,6 @@ DEFINE_TEST(test_read_format_rar_multivolume)
int file3_size = sizeof(file3_buff);
const char file3_test_txt[] = "test text document\r\n";
struct archive_entry *ae;
- struct archive *a;
-
- extract_reference_files(reffiles);
- assert((a = archive_read_new()) != NULL);
- assertA(0 == archive_read_support_filter_all(a));
- assertA(0 == archive_read_support_format_all(a));
- assertA(0 == archive_read_open_filenames(a, reffiles, 10240));
/* First header. */
assertA(0 == archive_read_next_header(a, &ae));
@@ -1016,6 +1010,65 @@ DEFINE_TEST(test_read_format_rar_multivolume)
assertEqualInt(ARCHIVE_OK, archive_read_free(a));
}
+DEFINE_TEST(test_read_format_rar_multivolume)
+{
+ const char *reffiles[] =
+ {
+ "test_read_format_rar_multivolume.part0001.rar",
+ "test_read_format_rar_multivolume.part0002.rar",
+ "test_read_format_rar_multivolume.part0003.rar",
+ "test_read_format_rar_multivolume.part0004.rar",
+ NULL
+ };
+
+ struct archive *a;
+
+ extract_reference_files(reffiles);
+ assert((a = archive_read_new()) != NULL);
+ assertA(0 == archive_read_support_filter_all(a));
+ assertA(0 == archive_read_support_format_all(a));
+ assertA(0 == archive_read_open_filenames(a, reffiles, 10240));
+
+ test_read_format_rar_multivolume_test_body_helper(a);
+}
+
+/* As above, but using read_open_filenames_w */
+DEFINE_TEST(test_read_format_rar_multivolume_w)
+{
+#if defined(_WIN32) && !defined(__CYGWIN__)
+ const char *reffiles[] =
+ {
+ "test_read_format_rar_multivolume.part0001.rar",
+ "test_read_format_rar_multivolume.part0002.rar",
+ "test_read_format_rar_multivolume.part0003.rar",
+ "test_read_format_rar_multivolume.part0004.rar",
+ NULL
+ };
+
+ const wchar_t *wreffiles[] =
+ {
+ L"test_read_format_rar_multivolume.part0001.rar",
+ L"test_read_format_rar_multivolume.part0002.rar",
+ L"test_read_format_rar_multivolume.part0003.rar",
+ L"test_read_format_rar_multivolume.part0004.rar",
+ NULL
+ };
+
+ struct archive *a;
+
+ extract_reference_files(reffiles);
+ assert((a = archive_read_new()) != NULL);
+ assertA(0 == archive_read_support_filter_all(a));
+ assertA(0 == archive_read_support_format_all(a));
+ assertA(0 == archive_read_open_filenames_w(a, wreffiles, 10240));
+
+ test_read_format_rar_multivolume_test_body_helper(a);
+#else
+ skipping("archive_read_open_filenames_w is not available on this platform");
+ return;
+#endif
+}
+
DEFINE_TEST(test_read_format_rar_multivolume_skip)
{
const char *reffiles[] =
diff --git a/libarchive/test/test_read_format_rar.rar.uu b/libarchive/test/test_read_format_rar.rar.uu
index 75f93b4c281a..f197a2983302 100644
--- a/libarchive/test/test_read_format_rar.rar.uu
+++ b/libarchive/test/test_read_format_rar.rar.uu
@@ -1,4 +1,4 @@
-begin 644 -
+begin 644 test_read_format_rar.rar
M4F%R(1H'`,^0<P``#0````````"$4G0@D#(`%````!0````#0J+(OK=VVCX4
M,`@`I($``'1E<W0N='AT@`BW=MH^MW;:/G1E<W0@=&5X="!D;V-U;65N=`T*
MG2]T()`R``@````(`````WM$R;;13-@^%#`(`/^A``!T97-T;&EN:\`(T4S8
diff --git a/libarchive/test/test_read_format_rar5.c b/libarchive/test/test_read_format_rar5.c
index acc90510946b..705913b04cc2 100644
--- a/libarchive/test/test_read_format_rar5.c
+++ b/libarchive/test/test_read_format_rar5.c
@@ -168,7 +168,7 @@ DEFINE_TEST(test_read_format_rar5_compressed)
assertEqualInt(DATA_SIZE, archive_entry_size(ae));
assertA(DATA_SIZE == archive_read_data(a, buff, DATA_SIZE));
assertA(ARCHIVE_EOF == archive_read_next_header(a, &ae));
- verify_data(buff, 0, DATA_SIZE);
+ assertA(1 == verify_data(buff, 0, DATA_SIZE));
EPILOGUE();
}
@@ -187,25 +187,25 @@ DEFINE_TEST(test_read_format_rar5_multiple_files)
assertEqualString("test1.bin", archive_entry_pathname(ae));
assertEqualInt(DATA_SIZE, archive_entry_size(ae));
assertA(DATA_SIZE == archive_read_data(a, buff, DATA_SIZE));
- assertA(verify_data(buff, 1, DATA_SIZE));
+ assertA(1 == verify_data(buff, 1, DATA_SIZE));
assertA(0 == archive_read_next_header(a, &ae));
assertEqualString("test2.bin", archive_entry_pathname(ae));
assertEqualInt(DATA_SIZE, archive_entry_size(ae));
assertA(DATA_SIZE == archive_read_data(a, buff, DATA_SIZE));
- assertA(verify_data(buff, 2, DATA_SIZE));
+ assertA(1 == verify_data(buff, 2, DATA_SIZE));
assertA(0 == archive_read_next_header(a, &ae));
assertEqualString("test3.bin", archive_entry_pathname(ae));
assertEqualInt(DATA_SIZE, archive_entry_size(ae));
assertA(DATA_SIZE == archive_read_data(a, buff, DATA_SIZE));
- assertA(verify_data(buff, 3, DATA_SIZE));
+ assertA(1 == verify_data(buff, 3, DATA_SIZE));
assertA(0 == archive_read_next_header(a, &ae));
assertEqualString("test4.bin", archive_entry_pathname(ae));
assertEqualInt(DATA_SIZE, archive_entry_size(ae));
assertA(DATA_SIZE == archive_read_data(a, buff, DATA_SIZE));
- assertA(verify_data(buff, 4, DATA_SIZE));
+ assertA(1 == verify_data(buff, 4, DATA_SIZE));
/* There should be no more files in this archive. */
@@ -230,25 +230,25 @@ DEFINE_TEST(test_read_format_rar5_multiple_files_solid)
assertEqualString("test1.bin", archive_entry_pathname(ae));
assertEqualInt(DATA_SIZE, archive_entry_size(ae));
assertA(DATA_SIZE == archive_read_data(a, buff, DATA_SIZE));
- assertA(verify_data(buff, 1, DATA_SIZE));
+ assertA(1 == verify_data(buff, 1, DATA_SIZE));
assertA(0 == archive_read_next_header(a, &ae));
assertEqualString("test2.bin", archive_entry_pathname(ae));
assertEqualInt(DATA_SIZE, archive_entry_size(ae));
assertA(DATA_SIZE == archive_read_data(a, buff, DATA_SIZE));
- assertA(verify_data(buff, 2, DATA_SIZE));
+ assertA(1 == verify_data(buff, 2, DATA_SIZE));
assertA(0 == archive_read_next_header(a, &ae));
assertEqualString("test3.bin", archive_entry_pathname(ae));
assertEqualInt(DATA_SIZE, archive_entry_size(ae));
assertA(DATA_SIZE == archive_read_data(a, buff, DATA_SIZE));
- assertA(verify_data(buff, 3, DATA_SIZE));
+ assertA(1 == verify_data(buff, 3, DATA_SIZE));
assertA(0 == archive_read_next_header(a, &ae));
assertEqualString("test4.bin", archive_entry_pathname(ae));
assertEqualInt(DATA_SIZE, archive_entry_size(ae));
assertA(DATA_SIZE == archive_read_data(a, buff, DATA_SIZE));
- assertA(verify_data(buff, 4, DATA_SIZE));
+ assertA(1 == verify_data(buff, 4, DATA_SIZE));
assertA(ARCHIVE_EOF == archive_read_next_header(a, &ae));
EPILOGUE();
@@ -806,6 +806,36 @@ DEFINE_TEST(test_read_format_rar5_extract_win32)
EPILOGUE();
}
+DEFINE_TEST(test_read_format_rar5_unicode)
+{
+#if !defined(WIN32) || defined(__CYGWIN__)
+ skipping("Skipping test on non-Windows");
+ return;
+#else
+ /* Corresponds to the names:
+ * 👋🌎.txt
+ * 𝒮𝓎𝓂𝒷𝑜𝓁𝒾𝒸 𝐿𝒾𝓃𝓀.txt
+ * Ⓗⓐⓡⓓ Ⓛⓘⓝⓚ.txt */
+ const wchar_t* emoji_name = L"\U0001f44b\U0001f30e.txt";
+ const wchar_t* italic_name = L"\U0001d4ae\U0001d4ce\U0001d4c2\U0001d4b7\U0001d45c\U0001d4c1\U0001d4be\U0001d4b8 \U0001d43f\U0001d4be\U0001d4c3\U0001d4c0.txt";
+ const wchar_t* circle_name = L"\u24bd\u24d0\u24e1\u24d3 \u24c1\u24d8\u24dd\u24da.txt";
+
+ PROLOGUE("test_read_format_rar5_unicode.rar");
+ assertA(0 == archive_read_next_header(a, &ae));
+ assertEqualWString(emoji_name, archive_entry_pathname_w(ae));
+ assertEqualInt(archive_entry_mode(ae), AE_IFREG | 0644);
+ assertA(0 == archive_read_next_header(a, &ae));
+ assertEqualWString(circle_name, archive_entry_pathname_w(ae));
+ assertEqualInt(archive_entry_mode(ae), AE_IFREG | 0644);
+ assertEqualWString(emoji_name, archive_entry_hardlink_w(ae));
+ assertA(0 == archive_read_next_header(a, &ae));
+ assertEqualWString(italic_name, archive_entry_pathname_w(ae));
+ assertEqualInt(archive_entry_mode(ae), AE_IFLNK | 0644);
+ assertEqualWString(emoji_name, archive_entry_symlink_w(ae));
+ EPILOGUE();
+#endif
+}
+
DEFINE_TEST(test_read_format_rar5_block_by_block)
{
/* This test uses strange buffer sizes intentionally. */
@@ -1310,6 +1340,8 @@ DEFINE_TEST(test_read_format_rar5_sfx)
assertA(size == archive_read_data(a, buff, size));
assertEqualMem(buff, test_txt, size);
+
+ EPILOGUE();
}
DEFINE_TEST(test_read_format_rar5_decode_number_out_of_bounds_read)
@@ -1346,4 +1378,27 @@ DEFINE_TEST(test_read_format_rar5_bad_window_size_in_multiarchive_file)
while(0 < archive_read_data(a, buf, sizeof(buf))) {}
EPILOGUE();
-} \ No newline at end of file
+}
+
+DEFINE_TEST(test_read_format_rar5_read_data_block_uninitialized_offset)
+{
+ const void *buf;
+ size_t size;
+ la_int64_t offset;
+
+ PROLOGUE("test_read_format_rar5_compressed.rar");
+ assertA(0 == archive_read_next_header(a, &ae));
+
+ /* A real code may pass a pointer to an uninitialized variable as an offset
+ * output argument. Here we want to check this situation. But because
+ * relying on a value of an uninitialized variable in a test is not a good
+ * idea, let's pretend that 0xdeadbeef is a random value of the
+ * uninitialized variable. */
+ offset = 0xdeadbeef;
+ assertEqualInt(ARCHIVE_OK, archive_read_data_block(a, &buf, &size, &offset));
+ /* The test archive doesn't contain a sparse file. And because of that, here
+ * we assume that the first returned offset should be 0. */
+ assertEqualInt(0, offset);
+
+ EPILOGUE();
+}
diff --git a/libarchive/test/test_read_format_rar5_bad_window_sz_in_mltarc_file.rar.uu b/libarchive/test/test_read_format_rar5_bad_window_sz_in_mltarc_file.rar.uu
index 7684bc199bf9..4decccb38574 100644
--- a/libarchive/test/test_read_format_rar5_bad_window_sz_in_mltarc_file.rar.uu
+++ b/libarchive/test/test_read_format_rar5_bad_window_sz_in_mltarc_file.rar.uu
@@ -1,4 +1,4 @@
-begin 644 test_read_format_rar5_bad_window_size_in_multiarchive_file.rar
+begin 644 test_read_format_rar5_bad_window_sz_in_mltarc_file.rar
M4F%R(1H'`0`]/-[E`@$`_R`@1#[Z5P("`PL`("`@@"(`"?\@("#___\@("`@
M("`@("`@("`@4X`J]`,"YR(#$($@("`@``$@("`@@<L0("`@("`@("`@("`@
M("`@(""LCTJA`P$%`B`@`2!3@"KT`P+G(@,@("`@_P,!!B`@(/___R`@(('+
diff --git a/libarchive/test/test_read_format_rar5_compressed.rar.uu b/libarchive/test/test_read_format_rar5_compressed.rar.uu
index f9f811c6dc0d..dbd42f09cbb6 100644
--- a/libarchive/test/test_read_format_rar5_compressed.rar.uu
+++ b/libarchive/test/test_read_format_rar5_compressed.rar.uu
@@ -1,4 +1,4 @@
-begin 644 rar5_compressed.rar
+begin 644 test_read_format_rar5_compressed.rar
M4F%R(1H'`0#SX8+K"P$%!P`&`0&`@(``B<9?VB8"`POI`@2P":2#`LUPRGR`
M!0$(=&5S="YB:6X*`Q.+5ZQ;^!BM'LKT90$G96!4'U5V7;^4DG')SV6660QP
MV663&,62$X9"223AD)"2220DXY))(0A))"$)))"22$(2$LVU;WM],PZ`?1T#
diff --git a/libarchive/test/test_read_format_rar5_different_winsize_on_merge.rar.uu b/libarchive/test/test_read_format_rar5_different_winsize_on_merge.rar.uu
index 85391fa4e1f6..9a3423e37afa 100644
--- a/libarchive/test/test_read_format_rar5_different_winsize_on_merge.rar.uu
+++ b/libarchive/test/test_read_format_rar5_different_winsize_on_merge.rar.uu
@@ -1,4 +1,4 @@
-begin 644 test_read_format_rar5_different_winsize_on_merge.rar.uu
+begin 644 test_read_format_rar5_different_winsize_on_merge.rar
M4F%R(1H'`0"-[P+2``+''QP,!`H``"0`N)$#`0(H$"<"``X`/3Q/`0"V````
MQ@$````V`/^%02`H^B7&,NX``"F&AK%M-50O<WY2!P$`C>\"T@`"_[6U,1"U
MM;6UM[BU45)A<K6UM;6UM+6U```\______?______________P`&80"-[P+2
diff --git a/libarchive/test/test_read_format_rar5_multiarchive.part01.rar.uu b/libarchive/test/test_read_format_rar5_multiarchive.part01.rar.uu
index a83c78ca22cd..9006181efaee 100644
--- a/libarchive/test/test_read_format_rar5_multiarchive.part01.rar.uu
+++ b/libarchive/test/test_read_format_rar5_multiarchive.part01.rar.uu
@@ -1,4 +1,4 @@
-begin 644 rar5_multiarchive.part01.rar
+begin 644 test_read_format_rar5_multiarchive.part01.rar
M4F%R(1H'`0!5`$'/#`$%"`$'`0'O]H"``.>[Y2I7`A,+@O8`!.#I".V#`FI)
M!96`%0$W:&]M92]A;G1E:R]T96UP+V)U:6QD+W5N<F%R-2]L:6)A<F-H:79E
M+V)I;B]B<V1C871?=&5S=`H#$Z@$JUL/WSH`BQ&75V"(540R)79@1V>KN2Y+
diff --git a/libarchive/test/test_read_format_rar5_multiarchive.part02.rar.uu b/libarchive/test/test_read_format_rar5_multiarchive.part02.rar.uu
index fce29824622d..d766ccee9d87 100644
--- a/libarchive/test/test_read_format_rar5_multiarchive.part02.rar.uu
+++ b/libarchive/test/test_read_format_rar5_multiarchive.part02.rar.uu
@@ -1,4 +1,4 @@
-begin 644 rar5_multiarchive.part02.rar
+begin 644 test_read_format_rar5_multiarchive.part02.rar
M4F%R(1H'`0"ZHBK1#0$%"`,!!P$![_:`@`!@&RUZ5P(;"X'V``3@Z0CM@P)=
M-\$R@!4!-VAO;64O86YT96LO=&5M<"]B=6EL9"]U;G)A<C4O;&EB87)C:&EV
M92]B:6XO8G-D8V%T7W1E<W0*`Q.H!*M;#]\Z`,C&\^P15*#4'A\D!$R&)9;I
diff --git a/libarchive/test/test_read_format_rar5_multiarchive.part03.rar.uu b/libarchive/test/test_read_format_rar5_multiarchive.part03.rar.uu
index c600f025395e..b2bd1a72bafa 100644
--- a/libarchive/test/test_read_format_rar5_multiarchive.part03.rar.uu
+++ b/libarchive/test/test_read_format_rar5_multiarchive.part03.rar.uu
@@ -1,4 +1,4 @@
-begin 644 rar5_multiarchive.part03.rar
+begin 644 test_read_format_rar5_multiarchive.part03.rar
M4F%R(1H'`0`S!&6T#0$%"`,"!P$!@_:`@`#;[#5T5P(+"_W#``3@Z0CM@P)S
M="<U@!4!-VAO;64O86YT96LO=&5M<"]B=6EL9"]U;G)A<C4O;&EB87)C:&EV
M92]B:6XO8G-D8V%T7W1E<W0*`Q.H!*M;#]\Z`+YO1=#5A^0(J_-LW+!*WYK9
diff --git a/libarchive/test/test_read_format_rar5_multiarchive.part04.rar.uu b/libarchive/test/test_read_format_rar5_multiarchive.part04.rar.uu
index 3b47dd07c873..afd18ab0a896 100644
--- a/libarchive/test/test_read_format_rar5_multiarchive.part04.rar.uu
+++ b/libarchive/test/test_read_format_rar5_multiarchive.part04.rar.uu
@@ -1,4 +1,4 @@
-begin 644 rar5_multiarchive.part04.rar
+begin 644 test_read_format_rar5_multiarchive.part04.rar
M4F%R(1H'`0`\BMS_#0$%"`,#!P$![_:`@``H3"7!5P(;"X'V``3HJ!;M@P)=
M?Y*E@!4!-VAO;64O86YT96LO=&5M<"]B=6EL9"]U;G)A<C4O;&EB87)C:&EV
M92]B:6XO8G-D=&%R7W1E<W0*`Q.J!*M;T74"-U,K[HY2T0OI6D^@"4>G(I3D
diff --git a/libarchive/test/test_read_format_rar5_multiarchive.part05.rar.uu b/libarchive/test/test_read_format_rar5_multiarchive.part05.rar.uu
index 4dc97d65ea1e..a9f1981e4845 100644
--- a/libarchive/test/test_read_format_rar5_multiarchive.part05.rar.uu
+++ b/libarchive/test/test_read_format_rar5_multiarchive.part05.rar.uu
@@ -1,4 +1,4 @@
-begin 644 rar5_multiarchive.part05.rar
+begin 644 test_read_format_rar5_multiarchive.part05.rar
M4F%R(1H'`0#UY[V;#0$%"`,$!P$![_:`@`"(]4(L5P(;"X'V``3HJ!;M@P+]
MF?Z`@!4!-VAO;64O86YT96LO=&5M<"]B=6EL9"]U;G)A<C4O;&EB87)C:&EV
M92]B:6XO8G-D=&%R7W1E<W0*`Q.J!*M;T74"-[]V(;"@ZL+ZZ0DS>@98+@$>
diff --git a/libarchive/test/test_read_format_rar5_multiarchive.part06.rar.uu b/libarchive/test/test_read_format_rar5_multiarchive.part06.rar.uu
index 1e2ad0cf9833..1ba155dbf4c8 100644
--- a/libarchive/test/test_read_format_rar5_multiarchive.part06.rar.uu
+++ b/libarchive/test/test_read_format_rar5_multiarchive.part06.rar.uu
@@ -1,4 +1,4 @@
-begin 644 rar5_multiarchive.part06.rar
+begin 644 test_read_format_rar5_multiarchive.part06.rar
M4F%R(1H'`0"V\\:,#0$%"`,%!P$![_:`@``2\>%K5P(;"X'V``3HJ!;M@P(]
M(D2J@!4!-VAO;64O86YT96LO=&5M<"]B=6EL9"]U;G)A<C4O;&EB87)C:&EV
M92]B:6XO8G-D=&%R7W1E<W0*`Q.J!*M;T74"-\2/YDWQ,%)DI56J+M4UB8>R
diff --git a/libarchive/test/test_read_format_rar5_multiarchive.part07.rar.uu b/libarchive/test/test_read_format_rar5_multiarchive.part07.rar.uu
index de1044e30589..23ba290ad4ed 100644
--- a/libarchive/test/test_read_format_rar5_multiarchive.part07.rar.uu
+++ b/libarchive/test/test_read_format_rar5_multiarchive.part07.rar.uu
@@ -1,4 +1,4 @@
-begin 644 rar5_multiarchive.part07.rar
+begin 644 test_read_format_rar5_multiarchive.part07.rar
M4F%R(1H'`0!SSTNU#0$%"`,&!P$![_:`@`#=K"Q/5P(;"X'V``3HJ!;M@P*V
M0J=E@!4!-VAO;64O86YT96LO=&5M<"]B=6EL9"]U;G)A<C4O;&EB87)C:&EV
M92]B:6XO8G-D=&%R7W1E<W0*`Q.J!*M;T74"-YY^$-E'40]L2'?%!?HA6*"R
diff --git a/libarchive/test/test_read_format_rar5_multiarchive.part08.rar.uu b/libarchive/test/test_read_format_rar5_multiarchive.part08.rar.uu
index eae45fc7a2fb..459beb48d241 100644
--- a/libarchive/test/test_read_format_rar5_multiarchive.part08.rar.uu
+++ b/libarchive/test/test_read_format_rar5_multiarchive.part08.rar.uu
@@ -1,4 +1,4 @@
-begin 644 rar5_multiarchive.part08.rar
+begin 644 test_read_format_rar5_multiarchive.part08.rar
M4F%R(1H'`0#"(ZNP#0$%"`,'!P$!\,:`@`#/Q#!K5P(+"X+&``3HJ!;M@P+X
M99;E@!4!-VAO;64O86YT96LO=&5M<"]B=6EL9"]U;G)A<C4O;&EB87)C:&EV
M92]B:6XO8G-D=&%R7W1E<W0*`Q.J!*M;T74"-P'V.L#Y#UMO#KJ6K6EJUOF6
diff --git a/libarchive/test/test_read_format_rar5_multiple_files.rar.uu b/libarchive/test/test_read_format_rar5_multiple_files.rar.uu
index 3fa8930c9d33..26ededc9b454 100644
--- a/libarchive/test/test_read_format_rar5_multiple_files.rar.uu
+++ b/libarchive/test/test_read_format_rar5_multiple_files.rar.uu
@@ -1,4 +1,4 @@
-begin 644 rar5_multiple_files.rar
+begin 644 test_read_format_rar5_multiple_files.rar
M4F%R(1H'`0#SX8+K"P$%!P`&`0&`@(```Q:>PB<"`POD`@2`(*2#`L:R$WZ`
M!0$)=&5S=#$N8FEN"@,39U^L6QI:GA#*\6`!$&149R]7!6]2222222222222
M2222222222222222222222222222222222222222222222223]_>QS,[=]KH
diff --git a/libarchive/test/test_read_format_rar5_multiple_files_solid.rar.uu b/libarchive/test/test_read_format_rar5_multiple_files_solid.rar.uu
index 4a8acb08c45a..8ba78774dc48 100644
--- a/libarchive/test/test_read_format_rar5_multiple_files_solid.rar.uu
+++ b/libarchive/test/test_read_format_rar5_multiple_files_solid.rar.uu
@@ -1,4 +1,4 @@
-begin 644 rar5_multiple_files_solid.rar
+begin 644 test_read_format_rar5_multiple_files_solid.rar
M4F%R(1H'`0`)[\AO"P$%!P0&`0&`@(``&8R4_R<"`POY`@2`(*2#`L:R$WZ`
M'0$)=&5S=#$N8FEN"@,39U^L6QI:GA#)YW4!&&5492;T@%?U\^?/DDDDDDDD
MDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDO\\YG#6M
diff --git a/libarchive/test/test_read_format_rar5_sfx.exe.uu b/libarchive/test/test_read_format_rar5_sfx.exe.uu
index fdf83af1a238..7df65a110384 100644
--- a/libarchive/test/test_read_format_rar5_sfx.exe.uu
+++ b/libarchive/test/test_read_format_rar5_sfx.exe.uu
@@ -1,4 +1,4 @@
-begin 644 -
+begin 644 test_read_format_rar5_sfx.exe
M35J0``,````$````__\``+@`````````0```````````````````````````
M````````````````````$`$```X?N@X`M`G-(;@!3,TA5&AI<R!P<F]G<F%M
M(&-A;FYO="!B92!R=6X@:6X@1$]3(&UO9&4N#0T*)`````````!B8/>3)@&9
diff --git a/libarchive/test/test_read_format_rar5_stored.rar.uu b/libarchive/test/test_read_format_rar5_stored.rar.uu
index 405b8795a162..afd565ff97d4 100644
--- a/libarchive/test/test_read_format_rar5_stored.rar.uu
+++ b/libarchive/test/test_read_format_rar5_stored.rar.uu
@@ -1,4 +1,4 @@
-begin 644 rar5_stored.rar
+begin 644 test_read_format_rar5_stored.rar
M4F%R(1H'`0`SDK7E"@$%!@`%`0&`@``X,`9C+`(#"YT`!)T`I(,"M$.@E8``
M`0YH96QL;W=O<FQD+G1X=`H#$WX.JUM6Z0X::&5L;&\@;&EB87)C:&EV92!T
397-T('-U:71E(0H==U91`P4$````
diff --git a/libarchive/test/test_read_format_rar5_unicode.rar.uu b/libarchive/test/test_read_format_rar5_unicode.rar.uu
new file mode 100644
index 000000000000..e011ab64e689
--- /dev/null
+++ b/libarchive/test/test_read_format_rar5_unicode.rar.uu
@@ -0,0 +1,9 @@
+begin 0744 test_read_format_rar5_unicode.rar
+M4F%R(1H'`0#SX8+K"P$%!P`&`0&`@(``//TR$"@"`PN-``2-`"#FQN;K@```
+M#/"?D8OPGXR.+G1X=`H#`D:)>%;RZ]D!2&5L;&\L('=O<FQD(2/9BPA(`@,<
+M``0-(`````"````=XI*]XI.0XI.AXI.3(.*3@>*3F.*3G>*3FBYT>'0*`P)&
+MB7A6\NO9`1`%!``,\)^1B_"?C(XN='ATD-'.1V$"`QP`!`"@"`````"````U
+M\)V2KO"=DX[PG9."\)V2M_"=D9SPG9.!\)V2OO"=DK@@\)V0O_"=DK[PG9.#
+L\)V3@"YT>'0*`P(>7'J>!.S9`1`%`@`,\)^1B_"?C(XN='AT'7=640,%!```
+`
+end
diff --git a/libarchive/test/test_read_format_rar_binary_data.rar.uu b/libarchive/test/test_read_format_rar_binary_data.rar.uu
index 4d1cbd36d633..712dd0e67879 100644
--- a/libarchive/test/test_read_format_rar_binary_data.rar.uu
+++ b/libarchive/test/test_read_format_rar_binary_data.rar.uu
@@ -1,4 +1,4 @@
-begin 644 -
+begin 644 test_read_format_rar_binary_data.rar
M4F%R(1H'`,^0<P``#0````````!W#G2@D#D`E`H0````$``#OES$M0V6!S\=
M-0\`I($``')A;F1O;5]D871A+F)I;H#,#98'/Q*6!S\1#\T0T54`#0Z16Z5B
MZ6W>FQ_"3YH!RD,Z.<P&4ZSGQ+1(6^9/\HXB^LD*'EY-":6Y)MO'@@4>_X"C
diff --git a/libarchive/test/test_read_format_rar_compress_best.rar.uu b/libarchive/test/test_read_format_rar_compress_best.rar.uu
index 22fde0f8b673..d31adcc92b00 100644
--- a/libarchive/test/test_read_format_rar_compress_best.rar.uu
+++ b/libarchive/test/test_read_format_rar_compress_best.rar.uu
@@ -1,4 +1,4 @@
-begin 644 -
+begin 644 test_read_format_rar_compress_best.rar
M4F%R(1H'`,^0<P``#0````````"/6W0@D$,`\A8``(].```#8Z8%7C:SVCX=
M-1D`I($``$QI8F%R8VAI=F5!9&1I;F=497-T+FAT;6R`S#:SVC[E:?8^IQ@[
MY,&O-%WTZIVL0'K=[L^M$"SZ*I?&B@$S2EO?UM\%P_[#*[0L[1)9)\]U]*;T
diff --git a/libarchive/test/test_read_format_rar_compress_normal.rar.uu b/libarchive/test/test_read_format_rar_compress_normal.rar.uu
index afc6cc08db11..2cce0e14c239 100644
--- a/libarchive/test/test_read_format_rar_compress_normal.rar.uu
+++ b/libarchive/test/test_read_format_rar_compress_normal.rar.uu
@@ -1,4 +1,4 @@
-begin 644 -
+begin 644 test_read_format_rar_compress_normal.rar
M4F%R(1H'`,^0<P``#0````````!.!G0@D$,`LQL``(].```#8Z8%7C:SVCX=
M,QD`I($``$QI8F%R8VAI=F5!9&1I;F=497-T+FAT;6R`S#:SVCZ4:NT^#!U1
M#,S1%\6=F]T/PH[-`V-[U)/P29F;F3P#KD;FQC9X>MJ;G<[Z6"DBFSK*16$E
diff --git a/libarchive/test/test_read_format_rar_encryption_data.c b/libarchive/test/test_read_format_rar_encryption_data.c
index d0c06fb21499..540546a8dd8a 100644
--- a/libarchive/test/test_read_format_rar_encryption_data.c
+++ b/libarchive/test/test_read_format_rar_encryption_data.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
DEFINE_TEST(test_read_format_rar_encryption_data)
{
diff --git a/libarchive/test/test_read_format_rar_encryption_header.c b/libarchive/test/test_read_format_rar_encryption_header.c
index 81965eb6787f..e54db5152383 100644
--- a/libarchive/test/test_read_format_rar_encryption_header.c
+++ b/libarchive/test/test_read_format_rar_encryption_header.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
DEFINE_TEST(test_read_format_rar_encryption_header)
{
diff --git a/libarchive/test/test_read_format_rar_encryption_partially.c b/libarchive/test/test_read_format_rar_encryption_partially.c
index 81256a96a019..e68e78831b37 100644
--- a/libarchive/test/test_read_format_rar_encryption_partially.c
+++ b/libarchive/test/test_read_format_rar_encryption_partially.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
DEFINE_TEST(test_read_format_rar_encryption_partially)
{
diff --git a/libarchive/test/test_read_format_rar_filter.c b/libarchive/test/test_read_format_rar_filter.c
index 46c574743646..43619253e4ac 100644
--- a/libarchive/test/test_read_format_rar_filter.c
+++ b/libarchive/test/test_read_format_rar_filter.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
DEFINE_TEST(test_read_format_rar_filter)
{
diff --git a/libarchive/test/test_read_format_rar_invalid1.c b/libarchive/test/test_read_format_rar_invalid1.c
index 61dea1648f48..cac58688ce21 100644
--- a/libarchive/test/test_read_format_rar_invalid1.c
+++ b/libarchive/test/test_read_format_rar_invalid1.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
DEFINE_TEST(test_read_format_rar_invalid1)
{
diff --git a/libarchive/test/test_read_format_rar_multi_lzss_blocks.rar.uu b/libarchive/test/test_read_format_rar_multi_lzss_blocks.rar.uu
index dd6ab50f97cd..e717b00fd8ec 100644
--- a/libarchive/test/test_read_format_rar_multi_lzss_blocks.rar.uu
+++ b/libarchive/test/test_read_format_rar_multi_lzss_blocks.rar.uu
@@ -1,4 +1,4 @@
-begin 644 -
+begin 644 test_read_format_rar_multi_lzss_blocks.rar
M4F%R(1H'`,^0<P``#0````````"5L73`D$0`(TT``"<M,P$#<!6B:RZ@[CX=
M,QH`I($``&UU;'1I7VQZ<W-?8FQO8VMS7W1E<W0N='ATP,PNH.X^+:#N/@W!
ME1$,S1$`%=F]SKX56/`,:6:25T-W=Y;Z1J;2>M#'TZD7E[>^E"B3)2K$2:-U
diff --git a/libarchive/test/test_read_format_rar_multivolume.part0001.rar.uu b/libarchive/test/test_read_format_rar_multivolume.part0001.rar.uu
index 7378a9b558e8..bbe4be4c9070 100644
--- a/libarchive/test/test_read_format_rar_multivolume.part0001.rar.uu
+++ b/libarchive/test/test_read_format_rar_multivolume.part0001.rar.uu
@@ -1,4 +1,4 @@
-begin 644 -
+begin 644 test_read_format_rar_multivolume.part0001.rar
M4F%R(1H'`%IN<Q$!#0`````````SE'3"D$<`\>D``&I!9PX#@*>#,/AM$C\=
M-1T`I($``'!P;61?;'IS<U]C;VYV97)S:6]N7W1E<W0N='ATP,SX;1(_P&X2
M/Z<8.^3!KS1=].J=K$!ZW>[/K1`L^BJ7QHH!,TI;W];?!</^PRNT+.T262?/
diff --git a/libarchive/test/test_read_format_rar_multivolume.part0002.rar.uu b/libarchive/test/test_read_format_rar_multivolume.part0002.rar.uu
index 696ff565bdfd..a61a2fbc7312 100644
--- a/libarchive/test/test_read_format_rar_multivolume.part0002.rar.uu
+++ b/libarchive/test/test_read_format_rar_multivolume.part0002.rar.uu
@@ -1,4 +1,4 @@
-begin 644 -
+begin 644 test_read_format_rar_multivolume.part0002.rar
M4F%R(1H'`!EZ<Q$`#0````````#NWW3#D$<`\>D``&I!9PX#%Y:4IOAM$C\=
M-1T`I($``'!P;61?;'IS<U]C;VYV97)S:6]N7W1E<W0N='ATP,SX;1(_P&X2
M/___________________________________________________________
diff --git a/libarchive/test/test_read_format_rar_multivolume.part0003.rar.uu b/libarchive/test/test_read_format_rar_multivolume.part0003.rar.uu
index 91b7f28c5968..ef70b9eba606 100644
--- a/libarchive/test/test_read_format_rar_multivolume.part0003.rar.uu
+++ b/libarchive/test/test_read_format_rar_multivolume.part0003.rar.uu
@@ -1,4 +1,4 @@
-begin 644 -
+begin 644 test_read_format_rar_multivolume.part0003.rar
M4F%R(1H'`!EZ<Q$`#0````````#U+'3!D$<`^-T``&I!9PX#=T0K]_AM$C\=
M-1T`I($``'!P;61?;'IS<U]C;VYV97)S:6]N7W1E<W0N='ATP,SX;1(_P&X2
M/QOK1E#^H^/%2CSU*]SFZB-O0P7.9&(^"2;U+Z.1_C%^3WOV,>5:-FN$2BNW
diff --git a/libarchive/test/test_read_format_rar_multivolume.part0004.rar.uu b/libarchive/test/test_read_format_rar_multivolume.part0004.rar.uu
index 0bfad779e1bd..20931f62c585 100644
--- a/libarchive/test/test_read_format_rar_multivolume.part0004.rar.uu
+++ b/libarchive/test/test_read_format_rar_multivolume.part0004.rar.uu
@@ -1,4 +1,4 @@
-begin 644 -
+begin 644 test_read_format_rar_multivolume.part0004.rar
M4F%R(1H'`!EZ<Q$`#0````````!AIG3!D$,`/`L``(].```#8Z8%7L"!$C\=
M-1D`I($``$QI8F%R8VAI=F5!9&1I;F=497-T+FAT;6S`S,"!$C_!@1(_'H$B
MVRP\K;>5J2C]?9NI\:;KW2+#TR@_Y5=4S)O&)O_B>J0/A0T-,@"ER';1YX:$
diff --git a/libarchive/test/test_read_format_rar_noeof.rar.uu b/libarchive/test/test_read_format_rar_noeof.rar.uu
index 7cf88e7c6248..fd2d0d3a12bb 100644
--- a/libarchive/test/test_read_format_rar_noeof.rar.uu
+++ b/libarchive/test/test_read_format_rar_noeof.rar.uu
@@ -1,4 +1,4 @@
-begin 644 -
+begin 644 test_read_format_rar_noeof.rar
M4F%R(1H'`,^0<P``#0````````"$4G0@D#(`%````!0````#0J+(OK=VVCX4
M,`@`I($``'1E<W0N='AT@`BW=MH^MW;:/G1E<W0@=&5X="!D;V-U;65N=`T*
`
diff --git a/libarchive/test/test_read_format_rar_ppmd_lzss_conversion.rar.uu b/libarchive/test/test_read_format_rar_ppmd_lzss_conversion.rar.uu
index a41b007a0d23..472654259bb2 100644
--- a/libarchive/test/test_read_format_rar_ppmd_lzss_conversion.rar.uu
+++ b/libarchive/test/test_read_format_rar_ppmd_lzss_conversion.rar.uu
@@ -1,4 +1,4 @@
-begin 644 -
+begin 644 test_read_format_rar_ppmd_lzss_conversion.rar
M4F%R(1H'`,^0<P``#0````````!R,W3`D$<`VK$"`&I!9PX#=T0K]VL`!S\=
M-1T`I($``'!P;61?;'IS<U]C;VYV97)S:6]N7W1E<W0N='ATP,B$``<_&[\&
M/Z<8.^3!KS1=].J=K$!ZW>[/K1`L^BJ7QHH!,TI;W];?!</^PRNT+.T262?/
diff --git a/libarchive/test/test_read_format_rar_sfx.exe.uu b/libarchive/test/test_read_format_rar_sfx.exe.uu
index ea084ecacb76..275d0749687a 100644
--- a/libarchive/test/test_read_format_rar_sfx.exe.uu
+++ b/libarchive/test/test_read_format_rar_sfx.exe.uu
@@ -1,4 +1,4 @@
-begin 644 -
+begin 644 test_read_format_rar_sfx.exe
M35J0``,````$````__\``+@`````````0```````````````````````````
M````````````````````Z`````X?N@X`M`G-(;@!3,TA5&AI<R!P<F]G<F%M
M(&-A;FYO="!B92!R=6X@:6X@1$]3(&UO9&4N#0T*)`````````#3[14&EXQ[
diff --git a/libarchive/test/test_read_format_rar_subblock.rar.uu b/libarchive/test/test_read_format_rar_subblock.rar.uu
index 5c55ca11dd2a..8bd8e6038a8f 100644
--- a/libarchive/test/test_read_format_rar_subblock.rar.uu
+++ b/libarchive/test/test_read_format_rar_subblock.rar.uu
@@ -1,4 +1,4 @@
-begin 644 -
+begin 644 test_read_format_rar_subblock.rar
M4F%R(1H'`,^0<P``#0`````````##'H`@",`(@```!T````#&WQ`G@`````=
M,P,``````$--5`@!"+Z0\5[-83@7PT#<+OM\M_$>H5JAD)Q_9XLAN3)VO("$
M4G0@D#(`%````!0````#0J+(OK=VVCX4,`@`I($``'1E<W0N='AT@`BW=MH^
diff --git a/libarchive/test/test_read_format_rar_windows.rar.uu b/libarchive/test/test_read_format_rar_windows.rar.uu
index 05fa8db85846..daaa32b25ef1 100644
--- a/libarchive/test/test_read_format_rar_windows.rar.uu
+++ b/libarchive/test/test_read_format_rar_windows.rar.uu
@@ -1,4 +1,4 @@
-begin 644 -
+begin 644 test_read_format_rar_windows.rar
M4F%R(1H'`,^0<P``#0````````"6GW0@D$,`$````!`````"\1+6EVQA$C\4
M,!``(````'1E<W1D:7)<=&5S="YT>'3POU/A"W5A$C_#FG]U81(_PYI_=&5S
M="!T97AT(&9I;&4-"D."=""0.P`0````$`````+Q$M:7;&$2/Q0P"``@````
diff --git a/libarchive/test/test_read_format_raw.bufr.uu b/libarchive/test/test_read_format_raw.bufr.uu
index 2f4cef74619f..896e09c8fd6b 100644
--- a/libarchive/test/test_read_format_raw.bufr.uu
+++ b/libarchive/test/test_read_format_raw.bufr.uu
@@ -1,4 +1,4 @@
-begin 660 test_read_format_raw.bufr.uu
+begin 660 test_read_format_raw.bufr
M,#`P-S0T.3@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@#=]]]]]
diff --git a/libarchive/test/test_read_format_raw.c b/libarchive/test/test_read_format_raw.c
index 457db009727b..a0f68e5b880f 100644
--- a/libarchive/test/test_read_format_raw.c
+++ b/libarchive/test/test_read_format_raw.c
@@ -26,7 +26,6 @@
*/
#include "test.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/test/test_read_format_raw.c 191594 2009-04-27 20:09:05Z kientzle $");
DEFINE_TEST(test_read_format_raw)
{
diff --git a/libarchive/test/test_read_format_raw.data.Z.uu b/libarchive/test/test_read_format_raw.data.Z.uu
index eff01d3799e9..3fe4deaba09d 100644
--- a/libarchive/test/test_read_format_raw.data.Z.uu
+++ b/libarchive/test/test_read_format_raw.data.Z.uu
@@ -1,4 +1,3 @@
-$FreeBSD: head/lib/libarchive/test/test_read_format_raw.data.Z.uu 191594 2009-04-27 20:09:05Z kientzle $
begin 644 test_read_format_raw.data.Z
('YV09MZ\40``
`
diff --git a/libarchive/test/test_read_format_raw.data.uu b/libarchive/test/test_read_format_raw.data.uu
index e88da003fb42..7c68a2caa117 100644
--- a/libarchive/test/test_read_format_raw.data.uu
+++ b/libarchive/test/test_read_format_raw.data.uu
@@ -1,4 +1,3 @@
-$FreeBSD: head/lib/libarchive/test/test_read_format_raw.data.uu 191594 2009-04-27 20:09:05Z kientzle $
begin 644 test_read_format_raw.data
$9F]O"@``
`
diff --git a/libarchive/test/test_read_format_tar.c b/libarchive/test/test_read_format_tar.c
index 7c7cadd0a38b..2b7cd8dedcca 100644
--- a/libarchive/test/test_read_format_tar.c
+++ b/libarchive/test/test_read_format_tar.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/test/test_read_format_tar.c 201247 2009-12-30 05:59:21Z kientzle $");
/*
* Each of these archives is a short archive with a single entry. The
diff --git a/libarchive/test/test_read_format_tar_concatenated.c b/libarchive/test/test_read_format_tar_concatenated.c
index d1f67e20f7df..f6ed03a4404b 100644
--- a/libarchive/test/test_read_format_tar_concatenated.c
+++ b/libarchive/test/test_read_format_tar_concatenated.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD");
/*
* The sample tar file is the result of concatenating two tar files,
diff --git a/libarchive/test/test_read_format_tar_empty_filename.c b/libarchive/test/test_read_format_tar_empty_filename.c
index b1a1a4e1c821..310d260bb4d6 100644
--- a/libarchive/test/test_read_format_tar_empty_filename.c
+++ b/libarchive/test/test_read_format_tar_empty_filename.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/test/test_read_format_tar_empty_filename.c,v 1.2 2008/09/01 05:38:33 kientzle Exp $");
/*
* Tar entries with empty filenames are unusual, but shouldn't crash us.
diff --git a/libarchive/test/test_read_format_tar_empty_filename.tar.uu b/libarchive/test/test_read_format_tar_empty_filename.tar.uu
index f8a4f4f2f1b0..6cd9629278ae 100644
--- a/libarchive/test/test_read_format_tar_empty_filename.tar.uu
+++ b/libarchive/test/test_read_format_tar_empty_filename.tar.uu
@@ -1,5 +1,4 @@
-$FreeBSD: src/lib/libarchive/test/test_read_format_tar_empty_filename.tar.uu,v 1.2 2008/07/03 03:26:30 peter Exp $
-begin 644 test_compat_tar_1.tar
+begin 644 test_read_format_tar_empty_filename.tar
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M`````````````#`P,#<W-2``,#`Q-S4P(``P,#`P,#`@`#`P,#`P,#`P,#`P
diff --git a/libarchive/test/test_read_format_tar_empty_pax.c b/libarchive/test/test_read_format_tar_empty_pax.c
index 5416021947e0..3de9c6719c63 100644
--- a/libarchive/test/test_read_format_tar_empty_pax.c
+++ b/libarchive/test/test_read_format_tar_empty_pax.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
/*
* A "usual" empty tar archive contains only zero bytes
diff --git a/libarchive/test/test_read_format_tar_empty_pax.tar.Z.uu b/libarchive/test/test_read_format_tar_empty_pax.tar.Z.uu
index 2557b3f9f02a..0b2d53b69f77 100644
--- a/libarchive/test/test_read_format_tar_empty_pax.tar.Z.uu
+++ b/libarchive/test/test_read_format_tar_empty_pax.tar.Z.uu
@@ -1,4 +1,4 @@
-begin 644 test_read_format_tar_empty.tar.Z
+begin 644 test_read_format_tar_empty_pax.tar.Z
M'YV0<,+@^7*&S1LQ8=A\05,F#)DR<@!(G$BQHL6+&#-JW,BQ(HR/,&R(!`"R
M),F2'T^B_&B#!H`8,F+,B$%C1@V9,D[2K`&C!H`S'8,*'4JTZ,4Z<^B$B?A1
MSILW=(QF=`I5*L:5,%2:M,JUJ]>O8,'6D`%BS)LV;<JXH=.#3)BW-W#D,!-F
diff --git a/libarchive/test/test_read_format_tar_empty_with_gnulabel.c b/libarchive/test/test_read_format_tar_empty_with_gnulabel.c
index 83f20bb97115..3ff5b318d51a 100644
--- a/libarchive/test/test_read_format_tar_empty_with_gnulabel.c
+++ b/libarchive/test/test_read_format_tar_empty_with_gnulabel.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
/*
* Tar archives with with just a GNU label (or ending with one) should
diff --git a/libarchive/test/test_read_format_tar_filename.c b/libarchive/test/test_read_format_tar_filename.c
index 9ee8e813f737..5da94967ddf8 100644
--- a/libarchive/test/test_read_format_tar_filename.c
+++ b/libarchive/test/test_read_format_tar_filename.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD");
#include <locale.h>
diff --git a/libarchive/test/test_read_format_tar_invalid_pax_size.c b/libarchive/test/test_read_format_tar_invalid_pax_size.c
new file mode 100644
index 000000000000..64b5a7cc4b8d
--- /dev/null
+++ b/libarchive/test/test_read_format_tar_invalid_pax_size.c
@@ -0,0 +1,52 @@
+/*-
+ * Copyright (c) 2020 Ben Wagner
+ * 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"
+
+/*
+ * The pax size attribute can be used to override the size.
+ * It should be validated the same way the normal size is validated.
+ * The test data is fuzzer output from
+ * https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=48467 .
+ */
+DEFINE_TEST(test_read_format_tar_invalid_pax_size)
+{
+ /*
+ * An archive that contains a PAX 'size' record with a large negative value.
+ */
+ struct archive_entry *ae;
+ struct archive *a;
+ const char *refname = "test_read_format_tar_invalid_pax_size.tar";
+
+ extract_reference_file(refname);
+ assert((a = archive_read_new()) != NULL);
+ assertEqualInt(ARCHIVE_OK, archive_read_support_filter_all(a));
+ assertEqualInt(ARCHIVE_OK, archive_read_support_format_all(a));
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_open_filename(a, refname, 10240));
+ /* This assert will pass a normal debug build without the pax size check. */
+ /* Run this test with `-fsanitize=undefined` to verify. */
+ assertEqualIntA(a, ARCHIVE_FATAL, archive_read_next_header(a, &ae));
+ assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a));
+ assertEqualInt(ARCHIVE_OK, archive_read_free(a));
+}
diff --git a/libarchive/test/test_read_format_tar_invalid_pax_size.tar.uu b/libarchive/test/test_read_format_tar_invalid_pax_size.tar.uu
new file mode 100644
index 000000000000..3fa9a2e0ef62
--- /dev/null
+++ b/libarchive/test/test_read_format_tar_invalid_pax_size.tar.uu
@@ -0,0 +1,38 @@
+begin 644 test_read_format_tar_invalid_pax_size.tar
+M+B]087A(96%D97)S+C$T-#8S+V%A80``````````````````````````````
+M````````````````````````````````````````````````````````````
+M`````````````#`P,#`V-#0`,#`P,#`P,``P,#`P,#`P`#`P,#`P,#`P,S$R
+M`#$R-3,Q,30U,S<Q`"`Q,30R,"`@>```````````````````````````````
+M````````````````````````````````````````````````````````````
+M``````````````````````````````````````````!U='-A<@`P,```````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M```````````````````````S,"`@("`@(#T@("`@("`@("`@("`@("`@("`@
+M(`HS,"`@("`@(#T@("`@("`@("`@("`@("`@("`@(`HS,"`@("`@("`]("`@
+M("`@("`@("`@("`@("`@(`HS,"!S:7IE/2TQ.3<V.30Q,3$Q,S8U.3<R-S0S
+M-@H@("`@("`@("`@_R`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
+M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
+M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
+M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
+M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
+M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
+M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@____("`@("`@("`@
+M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@
+M("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@("`@(&%A80``````````
+M````````````````````````````````````````````````````````````
+M```````````````````````````````````````````````````````````P
+M,#,P.#$V`#`S-S0U,S0`,#`Q,38Q,``P,#`P,#`P,#`P-P`Q,C4S,3$T-3,W
+M,``@,3(P-S$@(#$`````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````=7-T87(`,#!D=GEU:V]V````````````````````````````````96YG
+M`````````````````````````/\!````````````````,#`Q`#`P,#`P,#`P
+M,#`P````````````````````````````````````````````````````]P``
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+M````````````````````````````````````````````````````````````
+&````````
+`
+end
diff --git a/libarchive/test/test_read_format_tbz.c b/libarchive/test/test_read_format_tbz.c
index 331955fd9c39..7323e13c98d0 100644
--- a/libarchive/test/test_read_format_tbz.c
+++ b/libarchive/test/test_read_format_tbz.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/test/test_read_format_tbz.c 201247 2009-12-30 05:59:21Z kientzle $");
static unsigned char archive[] = {
'B','Z','h','9','1','A','Y','&','S','Y',237,7,140,'W',0,0,27,251,144,208,
diff --git a/libarchive/test/test_read_format_tgz.c b/libarchive/test/test_read_format_tgz.c
index 9fba89657e92..5bb5e02be4f4 100644
--- a/libarchive/test/test_read_format_tgz.c
+++ b/libarchive/test/test_read_format_tgz.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/test/test_read_format_tgz.c 191183 2009-04-17 01:06:31Z kientzle $");
static unsigned char archive[] = {
31,139,8,0,222,'C','p','C',0,3,211,'c',160,'=','0','0','0','0','7','5','U',
diff --git a/libarchive/test/test_read_format_tlz.c b/libarchive/test/test_read_format_tlz.c
index 7c7a1431903c..5633baa4c6e8 100644
--- a/libarchive/test/test_read_format_tlz.c
+++ b/libarchive/test/test_read_format_tlz.c
@@ -24,7 +24,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/test/test_read_format_tlz.c 201247 2009-12-30 05:59:21Z kientzle $");
static unsigned char archive[] = {
93, 0, 0,128, 0,255,255,255,255,255,255,255,255, 0, 23, 0,
diff --git a/libarchive/test/test_read_format_txz.c b/libarchive/test/test_read_format_txz.c
index c082d7e5e7be..e17b054a6213 100644
--- a/libarchive/test/test_read_format_txz.c
+++ b/libarchive/test/test_read_format_txz.c
@@ -24,7 +24,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/test/test_read_format_txz.c 191183 2009-04-17 01:06:31Z kientzle $");
static unsigned char archive[] = {
253, 55,122, 88, 90, 0, 0, 4,230,214,180, 70, 2, 0, 33, 1,
diff --git a/libarchive/test/test_read_format_tz.c b/libarchive/test/test_read_format_tz.c
index 4ba7bcb3f9c6..4dfc916a3608 100644
--- a/libarchive/test/test_read_format_tz.c
+++ b/libarchive/test/test_read_format_tz.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/test/test_read_format_tz.c 189381 2009-03-05 00:31:48Z kientzle $");
static unsigned char archive[] = {
31,157,144,'.',0,8,28,'H',176,160,193,131,8,19,'*','\\',200,176,'!','B',24,
diff --git a/libarchive/test/test_read_format_ustar_filename.c b/libarchive/test/test_read_format_ustar_filename.c
index 5c2717cdf2c0..0c7e8a3c8070 100644
--- a/libarchive/test/test_read_format_ustar_filename.c
+++ b/libarchive/test/test_read_format_ustar_filename.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD");
#include <locale.h>
diff --git a/libarchive/test/test_read_format_warc.c b/libarchive/test/test_read_format_warc.c
index 658ab8a6e72b..91e6dc67e133 100644
--- a/libarchive/test/test_read_format_warc.c
+++ b/libarchive/test/test_read_format_warc.c
@@ -25,8 +25,6 @@
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
-
DEFINE_TEST(test_read_format_warc)
{
diff --git a/libarchive/test/test_read_format_xar.c b/libarchive/test/test_read_format_xar.c
index 1c8524520b39..daff2921690a 100644
--- a/libarchive/test/test_read_format_xar.c
+++ b/libarchive/test/test_read_format_xar.c
@@ -24,7 +24,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
#define UID 1001
#define UNAME "cue"
diff --git a/libarchive/test/test_read_format_zip.c b/libarchive/test/test_read_format_zip.c
index 642a5e222ebe..9e820f509c19 100644
--- a/libarchive/test/test_read_format_zip.c
+++ b/libarchive/test/test_read_format_zip.c
@@ -24,7 +24,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/test/test_read_format_zip.c 189482 2009-03-07 03:30:35Z kientzle $");
#define __LIBARCHIVE_BUILD
#include <archive_crc32.h>
@@ -157,7 +156,7 @@ verify_basic(struct archive *a, int seek_checks)
if (archive_zlib_version() != NULL) {
failure("file2 has a bad CRC, so read should fail and not change buff");
memset(buff, 'a', 19);
- assertEqualInt(ARCHIVE_WARN, archive_read_data(a, buff, 19));
+ assertEqualInt(ARCHIVE_FAILED, archive_read_data(a, buff, 19));
assertEqualMem(buff, "aaaaaaaaaaaaaaaaaaa", 19);
} else {
assertEqualInt(ARCHIVE_FAILED, archive_read_data(a, buff, 19));
@@ -746,6 +745,7 @@ DEFINE_TEST(test_read_format_zip_zstd_one_file)
if (ARCHIVE_OK != archive_read_support_filter_zstd(a)) {
skipping("zstd is not fully supported on this platform");
archive_read_close(a);
+ archive_read_free(a);
return;
}
extract_reference_file(refname);
@@ -771,6 +771,7 @@ DEFINE_TEST(test_read_format_zip_zstd_one_file_blockread)
if (ARCHIVE_OK != archive_read_support_filter_zstd(a)) {
skipping("zstd is not fully supported on this platform");
archive_read_close(a);
+ archive_read_free(a);
return;
}
extract_reference_file(refname);
@@ -796,6 +797,7 @@ DEFINE_TEST(test_read_format_zip_zstd_multi)
if (ARCHIVE_OK != archive_read_support_filter_zstd(a)) {
skipping("zstd is not fully supported on this platform");
archive_read_close(a);
+ archive_read_free(a);
return;
}
extract_reference_file(refname);
@@ -833,6 +835,7 @@ DEFINE_TEST(test_read_format_zip_zstd_multi_blockread)
if (ARCHIVE_OK != archive_read_support_filter_zstd(a)) {
skipping("zstd is not fully supported on this platform");
archive_read_close(a);
+ archive_read_free(a);
return;
}
extract_reference_file(refname);
@@ -1017,6 +1020,7 @@ DEFINE_TEST(test_read_format_zip_lzma_alone_leak)
if(ARCHIVE_OK != archive_read_support_filter_lzma(a)) {
skipping("lzma reading is not fully supported on this platform");
archive_read_close(a);
+ archive_read_free(a);
return;
}
diff --git a/libarchive/test/test_read_format_zip_7075_utf8_paths.c b/libarchive/test/test_read_format_zip_7075_utf8_paths.c
index a0a510c8f29b..fefcc82881f8 100644
--- a/libarchive/test/test_read_format_zip_7075_utf8_paths.c
+++ b/libarchive/test/test_read_format_zip_7075_utf8_paths.c
@@ -25,7 +25,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
#include <locale.h>
diff --git a/libarchive/test/test_read_format_zip_bzip2.zipx.uu b/libarchive/test/test_read_format_zip_bzip2.zipx.uu
index 6d9884aeddf5..4c9aeb77a941 100644
--- a/libarchive/test/test_read_format_zip_bzip2.zipx.uu
+++ b/libarchive/test/test_read_format_zip_bzip2.zipx.uu
@@ -1,4 +1,4 @@
-begin 644 bzip2.zipx
+begin 644 test_read_format_zip_bzip2.zipx
M4$L#!"X#```,`#TQD4VJ.XZZ-`(``)`#```%````=FEM<F-"6F@Y,4%9)E-9
MYPC!D@``3%^``!!TY^!2(B.7`+__W^%``C$[0!AJ>E,ID:&U-'E`T&C1IIIZ
M@8&J>$9":`IZ@``'J:/2&#```````!@`2FB$T:31D9"F@8FC0`\H^:+Y;81F
diff --git a/libarchive/test/test_read_format_zip_comment_stored.c b/libarchive/test/test_read_format_zip_comment_stored.c
index 95df0107fecb..39f83a821006 100644
--- a/libarchive/test/test_read_format_zip_comment_stored.c
+++ b/libarchive/test/test_read_format_zip_comment_stored.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
/*
* Read a zip file that has a zip comment in the end of the central
diff --git a/libarchive/test/test_read_format_zip_encryption_data.c b/libarchive/test/test_read_format_zip_encryption_data.c
index b56d78e9074f..4a6502b9bf2d 100644
--- a/libarchive/test/test_read_format_zip_encryption_data.c
+++ b/libarchive/test/test_read_format_zip_encryption_data.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
DEFINE_TEST(test_read_format_zip_encryption_data)
{
diff --git a/libarchive/test/test_read_format_zip_encryption_header.c b/libarchive/test/test_read_format_zip_encryption_header.c
index f40e1f5cb8da..fb19c1421946 100644
--- a/libarchive/test/test_read_format_zip_encryption_header.c
+++ b/libarchive/test/test_read_format_zip_encryption_header.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
DEFINE_TEST(test_read_format_zip_encryption_header)
{
diff --git a/libarchive/test/test_read_format_zip_encryption_partially.c b/libarchive/test/test_read_format_zip_encryption_partially.c
index 77af235d58b7..cd5d2103ea6a 100644
--- a/libarchive/test/test_read_format_zip_encryption_partially.c
+++ b/libarchive/test/test_read_format_zip_encryption_partially.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
DEFINE_TEST(test_read_format_zip_encryption_partially)
{
diff --git a/libarchive/test/test_read_format_zip_filename.c b/libarchive/test/test_read_format_zip_filename.c
index 4dd2e8ad6e8f..b673344738be 100644
--- a/libarchive/test/test_read_format_zip_filename.c
+++ b/libarchive/test/test_read_format_zip_filename.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD");
#include <locale.h>
@@ -1179,6 +1178,11 @@ next_test:
assertEqualInt(ARCHIVE_OK, archive_read_free(a));
/*
+ * By default, Windows will create an sconv_default object, which will
+ * interpret filenames as OEMCP
+ */
+#if !defined(_WIN32) || defined(__CYGWIN__)
+ /*
* Read filename in en_US.UTF-8 without "hdrcharset=KOI8-R" option.
* The filename we can properly read is only second file.
*/
@@ -1221,4 +1225,5 @@ next_test:
/* Close the archive. */
assertEqualInt(ARCHIVE_OK, archive_read_close(a));
assertEqualInt(ARCHIVE_OK, archive_read_free(a));
+#endif
}
diff --git a/libarchive/test/test_read_format_zip_filename_cp866.zip.uu b/libarchive/test/test_read_format_zip_filename_cp866.zip.uu
index 52c6770609e1..7ef721490c4a 100644
--- a/libarchive/test/test_read_format_zip_filename_cp866.zip.uu
+++ b/libarchive/test/test_read_format_zip_filename_cp866.zip.uu
@@ -1,4 +1,4 @@
-begin 644 test_read_format_zip_cp866.zip
+begin 644 test_read_format_zip_filename_cp866.zip
M4$L#!`H``````%VEAS[,X8$4!@````8````&`!P`CY"(@H62550)``-!HYU-
M0:.=375X"P`!!.D#```$Z0,``/#RZ??E]%!+`P0*``````!=I8<^S.&!%`8`
M```&````!@`<`*_@J**EXE54"0`#0:.=34&CG4UU>`L``03I`P``!.D#``#P
diff --git a/libarchive/test/test_read_format_zip_filename_cp932.zip.uu b/libarchive/test/test_read_format_zip_filename_cp932.zip.uu
index 90c22f2d5c45..ec0f9c091b06 100644
--- a/libarchive/test/test_read_format_zip_filename_cp932.zip.uu
+++ b/libarchive/test/test_read_format_zip_filename_cp932.zip.uu
@@ -1,4 +1,4 @@
-begin 644 test_read_format_zip_cp932.zip
+begin 644 test_read_format_zip_filename_cp932.zip
M4$L#!`H``````/94=#Z"B='W!0````4````1````E5R"OH+F+XCJEY>57"YT
M>'1(96QL;U!+`P0*``````"W5'0^W)UO0@4````%````#P```)5<@KZ"YB^*
MOXZ:+G1X=&MA;FII4$L!`A0+"@``````]E1T/H*)T?<%````!0```!$`````
diff --git a/libarchive/test/test_read_format_zip_filename_koi8r.zip.uu b/libarchive/test/test_read_format_zip_filename_koi8r.zip.uu
index 05c669560270..242c902f0b64 100644
--- a/libarchive/test/test_read_format_zip_filename_koi8r.zip.uu
+++ b/libarchive/test/test_read_format_zip_filename_koi8r.zip.uu
@@ -1,4 +1,4 @@
-begin 644 test_read_format_zip_koi8r.zip
+begin 644 test_read_format_zip_filename_koi8r.zip
M4$L#!`H``````+&CAS[,X8$4!@````8````&`!P`T-+)U\74550)``,>H)U-
M'J"=375X"P`!!.D#```$Z0,``/#RZ??E]%!+`P0*``````"QHX<^S.&!%`8`
M```&````!@`<`/#RZ??E]%54"0`#'J"=31Z@G4UU>`L``03I`P``!.D#``#P
diff --git a/libarchive/test/test_read_format_zip_filename_utf8_jp.zip.uu b/libarchive/test/test_read_format_zip_filename_utf8_jp.zip.uu
index 00c2af33723a..3c9f4b9ea934 100644
--- a/libarchive/test/test_read_format_zip_filename_utf8_jp.zip.uu
+++ b/libarchive/test/test_read_format_zip_filename_utf8_jp.zip.uu
@@ -1,4 +1,4 @@
-begin 644 test_read_format_zip_utf8.zip
+begin 644 test_read_format_zip_filename_utf8_jp.zip
M4$L#!`H```@``,E4=#X````````````````*`!P`Z*&HXX&@XX*(+U54"0`#
MBEJ%3;[UBDUU>`L``03M`P``!`$"``!02P,$"@``"```]51T/H*)T?<%````
M!0```!<`'`#HH:CC@:#C@H@OY+B`Z*:GZ*&H+G1X=%54"0`#WEJ%31KLBDUU
diff --git a/libarchive/test/test_read_format_zip_filename_utf8_ru.zip.uu b/libarchive/test/test_read_format_zip_filename_utf8_ru.zip.uu
index 9241776d7fdf..bd71cc2a497b 100644
--- a/libarchive/test/test_read_format_zip_filename_utf8_ru.zip.uu
+++ b/libarchive/test/test_read_format_zip_filename_utf8_ru.zip.uu
@@ -1,4 +1,4 @@
-begin 644 test_read_format_zip_utf8_ru.zip
+begin 644 test_read_format_zip_filename_utf8_ru.zip
M4$L#!`H```@``,NC/S[,X8$4!@````8````,`!P`T)_0H-"8T)+0E="B550)
M``-.G49-'J"=375X"P`!!.D#```$Z0,``/#RZ??E]%!+`P0*```(``!KI3\^
MS.&!%`8````&````#``<`-"_T8#0N-"RT+71@E54"0`#6J!&31Z@G4UU>`L`
diff --git a/libarchive/test/test_read_format_zip_filename_utf8_ru2.zip.uu b/libarchive/test/test_read_format_zip_filename_utf8_ru2.zip.uu
index 651f8b1f8b10..65a34ed59147 100644
--- a/libarchive/test/test_read_format_zip_filename_utf8_ru2.zip.uu
+++ b/libarchive/test/test_read_format_zip_filename_utf8_ru2.zip.uu
@@ -1,4 +1,4 @@
-begin 644 test_read_format_zip_utf8_ru2.zip
+begin 644 test_read_format_zip_filename_utf8_ru2.zip
M4$L#!`H``````.:PCC[,X8$4!@````8````&`!P`\/+I]^7T550)``.`\:9-
MI6>G375X"P`!!.D#```$Z0,``/#RZ??E]%!+`P0*```(``!KI3\^S.&!%`8`
M```&````#``<`-"_T8#0N-"RT+71@E54"0`#6J!&357SIDUU>`L``03I`P``
diff --git a/libarchive/test/test_read_format_zip_high_compression.c b/libarchive/test/test_read_format_zip_high_compression.c
index 16cfbb182893..d28897027747 100644
--- a/libarchive/test/test_read_format_zip_high_compression.c
+++ b/libarchive/test/test_read_format_zip_high_compression.c
@@ -23,11 +23,9 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD");
#include <locale.h>
-
/*
* Github Issue 748 reported problems with end-of-entry handling
* with highly-compressible data. This resulted in the end of the
diff --git a/libarchive/test/test_read_format_zip_jar.c b/libarchive/test/test_read_format_zip_jar.c
index 912e67137704..75ea3eb9b868 100644
--- a/libarchive/test/test_read_format_zip_jar.c
+++ b/libarchive/test/test_read_format_zip_jar.c
@@ -23,7 +23,6 @@
* 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
diff --git a/libarchive/test/test_read_format_zip_lzma.zipx.uu b/libarchive/test/test_read_format_zip_lzma.zipx.uu
index 24fdc8e7c288..d0aad44a17d1 100644
--- a/libarchive/test/test_read_format_zip_lzma.zipx.uu
+++ b/libarchive/test/test_read_format_zip_lzma.zipx.uu
@@ -1,4 +1,4 @@
-begin 644 lzma.zipx
+begin 644 test_read_format_zip_lzma.zipx
M4$L#!#\#```.`#TQD4VJ.XZZ.0(``)`#```%````=FEM<F,0`@4`70`0````
M$0@$J,)\D;(#4L%<^$P5TO^CM0KI0HWG08B&_].4<,CJ")TW/L>)82Q1PWAL
M+U`,N0L_$]^&650C/X$D6#4QFD$\A/"_![4!O/5O/!KH`WCQ*4?T2*]4P#/D
diff --git a/libarchive/test/test_read_format_zip_mac_metadata.c b/libarchive/test/test_read_format_zip_mac_metadata.c
index 3f2813cc9894..9f7c35e1df85 100644
--- a/libarchive/test/test_read_format_zip_mac_metadata.c
+++ b/libarchive/test/test_read_format_zip_mac_metadata.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
/*
* Read a zip file that has a zip comment in the end of the central
diff --git a/libarchive/test/test_read_format_zip_malformed.c b/libarchive/test/test_read_format_zip_malformed.c
index f1160648e759..7e46abd8a4c1 100644
--- a/libarchive/test/test_read_format_zip_malformed.c
+++ b/libarchive/test/test_read_format_zip_malformed.c
@@ -24,7 +24,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
static void
test_malformed1(void)
diff --git a/libarchive/test/test_read_format_zip_nested.c b/libarchive/test/test_read_format_zip_nested.c
index 4418fc4f2502..95945638b074 100644
--- a/libarchive/test/test_read_format_zip_nested.c
+++ b/libarchive/test/test_read_format_zip_nested.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
DEFINE_TEST(test_read_format_zip_nested)
{
@@ -50,7 +49,7 @@ DEFINE_TEST(test_read_format_zip_nested)
/* Save contents of inner Zip. */
innerLength = (size_t)archive_entry_size(ae);
- inner = calloc(innerLength, 1);
+ inner = calloc(innerLength, sizeof(char));
assertEqualInt(innerLength, archive_read_data(a, inner, innerLength));
assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae));
diff --git a/libarchive/test/test_read_format_zip_nofiletype.c b/libarchive/test/test_read_format_zip_nofiletype.c
index b3260fa7563b..d2798b283185 100644
--- a/libarchive/test/test_read_format_zip_nofiletype.c
+++ b/libarchive/test/test_read_format_zip_nofiletype.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
/*
* Issue 332: Some epub files (which are really Zip archives) have
diff --git a/libarchive/test/test_read_format_zip_padded.c b/libarchive/test/test_read_format_zip_padded.c
index d8c694bae5e2..dcbf3406e867 100644
--- a/libarchive/test/test_read_format_zip_padded.c
+++ b/libarchive/test/test_read_format_zip_padded.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
static void
verify_padded_archive(const char *refname)
diff --git a/libarchive/test/test_read_format_zip_ppmd8.zipx.uu b/libarchive/test/test_read_format_zip_ppmd8.zipx.uu
index 4440e95b3158..cdbf0f44899d 100644
--- a/libarchive/test/test_read_format_zip_ppmd8.zipx.uu
+++ b/libarchive/test/test_read_format_zip_ppmd8.zipx.uu
@@ -1,4 +1,4 @@
-begin 644 ppmd8.zipx
+begin 644 test_read_format_zip_ppmd8.zipx
M4$L#!#\#``!B`#TQD4VJ.XZZV`$``)`#```%````=FEM<F,'`"']JO"&\1[R
M;;G)@`(8>EJ>3<8@F_*<(\B>K]4_(WC8#)`_QSG+`7`B&_11VIJ)@#(<W.9L
M>K)_I8R^=`VUO2_S,1C=1CAU>-*`]CC+&6Q;EE'#CG-W=^[,F,+UR-TE(9,G
diff --git a/libarchive/test/test_read_format_zip_sfx.c b/libarchive/test/test_read_format_zip_sfx.c
index a33c1b808c56..dad0a270d7bc 100644
--- a/libarchive/test/test_read_format_zip_sfx.c
+++ b/libarchive/test/test_read_format_zip_sfx.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
/*
* Read a zip file that is a SFX.
diff --git a/libarchive/test/test_read_format_zip_traditional_encryption_data.c b/libarchive/test/test_read_format_zip_traditional_encryption_data.c
index 20e55bbc6948..8f0cfe6dc896 100644
--- a/libarchive/test/test_read_format_zip_traditional_encryption_data.c
+++ b/libarchive/test/test_read_format_zip_traditional_encryption_data.c
@@ -24,7 +24,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
DEFINE_TEST(test_read_format_zip_traditional_encryption_data)
{
diff --git a/libarchive/test/test_read_format_zip_winzip_aes.c b/libarchive/test/test_read_format_zip_winzip_aes.c
index 3f543927a41e..7c5d5ea61f77 100644
--- a/libarchive/test/test_read_format_zip_winzip_aes.c
+++ b/libarchive/test/test_read_format_zip_winzip_aes.c
@@ -24,7 +24,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
static void
test_winzip_aes(const char *refname, int need_libz)
diff --git a/libarchive/test/test_read_format_zip_winzip_aes128.zip.uu b/libarchive/test/test_read_format_zip_winzip_aes128.zip.uu
index d0f03a3112e1..d3a69d8d41d4 100644
--- a/libarchive/test/test_read_format_zip_winzip_aes128.zip.uu
+++ b/libarchive/test/test_read_format_zip_winzip_aes128.zip.uu
@@ -1,4 +1,4 @@
-begin 644 test_read_format_zip_winzip_aes128_encryption_data.zip
+begin 644 test_read_format_zip_winzip_aes128.zip
M4$L#!#,#`0!C`(RP#D4`````@0H``*(:```&``L`4D5!1$U%`9D'``(`044!
M"``>H87EHY!N6J#=V\<,#M>^H2IQID3@A--GSL+F%'R^%OKB.K(74CJ!,(%"
ML\O.^D'TO'!T<+"]"28FXP@QKAY]R+02!E!XE_6A-W&<$&SJ5W]K'SJ4>'C<
diff --git a/libarchive/test/test_read_format_zip_winzip_aes256.zip.uu b/libarchive/test/test_read_format_zip_winzip_aes256.zip.uu
index a45c8fbe664f..ae51e66538d1 100644
--- a/libarchive/test/test_read_format_zip_winzip_aes256.zip.uu
+++ b/libarchive/test/test_read_format_zip_winzip_aes256.zip.uu
@@ -1,4 +1,4 @@
-begin 644 test_read_format_zip_winzip_aes256_encryption_data.zip
+begin 644 test_read_format_zip_winzip_aes256.zip
M4$L#!#,#`0!C`(RP#D4`````B0H``*(:```&``L`4D5!1$U%`9D'``(`044#
M"`#8+Z><':+DENQS9*!7Y*&!7BQK,UN]RF*'<':@;]N)O5>]A5>0<AYWX=%S
MGUTK5M-^&`+%Q<#PC+45O;+Q/4[_J7)A7*2<^!W;)^E_W%,]]7-&6R8]ZL.F
diff --git a/libarchive/test/test_read_format_zip_winzip_aes256_stored.zip.uu b/libarchive/test/test_read_format_zip_winzip_aes256_stored.zip.uu
index c49673aab2e7..e8300fa903a8 100644
--- a/libarchive/test/test_read_format_zip_winzip_aes256_stored.zip.uu
+++ b/libarchive/test/test_read_format_zip_winzip_aes256_stored.zip.uu
@@ -1,4 +1,4 @@
-begin 644 test_read_format_zip_winzip_aes256_encryption_stored_data.zip
+begin 644 test_read_format_zip_winzip_aes256_stored.zip
M4$L#!#,#`0!C`(RP#D4`````OAH``*(:```&``L`4D5!1$U%`9D'``(`044#
M``#5>!R(9&J6OW+%/X2D%.HLH/4@[H=,;4@&P$:E>NK#GQM>2SUV&GDS9/G@
M#J5^X(O<TC2DQW<QV`U6]!AA].1DL/:C!^1V=PJ`#_Z7`]_@C+O\SN38$]ZL
diff --git a/libarchive/test/test_read_format_zip_winzip_aes_large.c b/libarchive/test/test_read_format_zip_winzip_aes_large.c
index f05e2183a21b..4b6202bde164 100644
--- a/libarchive/test/test_read_format_zip_winzip_aes_large.c
+++ b/libarchive/test/test_read_format_zip_winzip_aes_large.c
@@ -24,7 +24,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
DEFINE_TEST(test_read_format_zip_winzip_aes256_large)
{
diff --git a/libarchive/test/test_read_format_zip_with_invalid_traditional_eocd.c b/libarchive/test/test_read_format_zip_with_invalid_traditional_eocd.c
index aca8bed60948..e9549fef8e7d 100644
--- a/libarchive/test/test_read_format_zip_with_invalid_traditional_eocd.c
+++ b/libarchive/test/test_read_format_zip_with_invalid_traditional_eocd.c
@@ -23,8 +23,6 @@
* 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.
diff --git a/libarchive/test/test_read_format_zip_with_invalid_traditional_eocd.zip.uu b/libarchive/test/test_read_format_zip_with_invalid_traditional_eocd.zip.uu
index 63744f145ea2..7301c155e404 100644
--- a/libarchive/test/test_read_format_zip_with_invalid_traditional_eocd.zip.uu
+++ b/libarchive/test/test_read_format_zip_with_invalid_traditional_eocd.zip.uu
@@ -1,4 +1,4 @@
-begin 644 test_read_format_zip_without_eocd.zip
+begin 644 test_read_format_zip_with_invalid_traditional_eocd.zip
M4$L#!"T`"````-IT@DH`````__________\)`"``=&5S=#$N='AT`0`<````
M````````````````````````````````````````````````````````````
M`%!+`P0M``@```#:=()*`````/__________"0`@`'1E<W0R+G1X=`$`'```
diff --git a/libarchive/test/test_read_format_zip_zip64.c b/libarchive/test/test_read_format_zip_zip64.c
index bd2324e549b3..51968b71addb 100644
--- a/libarchive/test/test_read_format_zip_zip64.c
+++ b/libarchive/test/test_read_format_zip_zip64.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
/*
* Sample file was created with:
diff --git a/libarchive/test/test_read_large.c b/libarchive/test/test_read_large.c
index 8dbf48d848c0..46dee4e33d6c 100644
--- a/libarchive/test/test_read_large.c
+++ b/libarchive/test/test_read_large.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/test/test_read_large.c 201247 2009-12-30 05:59:21Z kientzle $");
static unsigned char testdata[10 * 1024 * 1024];
static unsigned char testdatacopy[10 * 1024 * 1024];
diff --git a/libarchive/test/test_read_large_splitted_rar_aa.uu b/libarchive/test/test_read_large_splitted_rar_aa.uu
index a6c3b3cffebf..299b00b6814a 100644
--- a/libarchive/test/test_read_large_splitted_rar_aa.uu
+++ b/libarchive/test/test_read_large_splitted_rar_aa.uu
@@ -1,4 +1,4 @@
-begin 644 -
+begin 644 test_read_large_splitted_rar_aa
M4F%R(1H'`,^0<P``#0````````!R,W3`D$<`VK$"`&I!9PX#=T0K]VL`!S\=
M-1T`I($``'!P;61?;'IS<U]C;VYV97)S:6]N7W1E<W0N='ATP,B$``<_&[\&
M/Z<8.^3!KS1=].J=K$!ZW>[/K1`L^BJ7QHH!,TI;W];?!</^PRNT+.T262?/
diff --git a/libarchive/test/test_read_large_splitted_rar_ab.uu b/libarchive/test/test_read_large_splitted_rar_ab.uu
index 43869789a075..39ce2315c44f 100644
--- a/libarchive/test/test_read_large_splitted_rar_ab.uu
+++ b/libarchive/test/test_read_large_splitted_rar_ab.uu
@@ -1,4 +1,4 @@
-begin 644 -
+begin 644 test_read_large_splitted_rar_ab
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
M````````````````````````````````````````````````````````````
diff --git a/libarchive/test/test_read_large_splitted_rar_ac.uu b/libarchive/test/test_read_large_splitted_rar_ac.uu
index 0ceeae1b7fc4..7941aaaca7ad 100644
--- a/libarchive/test/test_read_large_splitted_rar_ac.uu
+++ b/libarchive/test/test_read_large_splitted_rar_ac.uu
@@ -1,4 +1,4 @@
-begin 644 -
+begin 644 test_read_large_splitted_rar_ac
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
diff --git a/libarchive/test/test_read_large_splitted_rar_ad.uu b/libarchive/test/test_read_large_splitted_rar_ad.uu
index f736f13c7cb1..9b633d19a931 100644
--- a/libarchive/test/test_read_large_splitted_rar_ad.uu
+++ b/libarchive/test/test_read_large_splitted_rar_ad.uu
@@ -1,4 +1,4 @@
-begin 644 -
+begin 644 test_read_large_splitted_rar_ad
M>WI\4,Y&PE_B_KBY3_KR8A*=V5Y9^":+9OY.2W-%I:#J"YC[#9]&6)@HH1ZH
MV*<8TFQK2]$<A645.":BA=R^<=NOJ(%,H)2+!9H%.!"J[E>+2^(@3/9+1"6W
M2O)L"JZC)MCDJG+%_;+=UEV.2(I,V[T@E<XQKA"\G.*'GD,QF_.C^"NU*.#4
diff --git a/libarchive/test/test_read_large_splitted_rar_ae.uu b/libarchive/test/test_read_large_splitted_rar_ae.uu
index 9f463a4ae384..fada05733f7c 100644
--- a/libarchive/test/test_read_large_splitted_rar_ae.uu
+++ b/libarchive/test/test_read_large_splitted_rar_ae.uu
@@ -1,4 +1,4 @@
-begin 644 -
+begin 644 test_read_large_splitted_rar_ae
M____________________________________________________________
M____________________________________________________________
M____________________________________________________________
diff --git a/libarchive/test/test_read_pax_truncated.c b/libarchive/test/test_read_pax_truncated.c
index 6a0bb9bafe71..a92ac3855c8d 100644
--- a/libarchive/test/test_read_pax_truncated.c
+++ b/libarchive/test/test_read_pax_truncated.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/test/test_read_pax_truncated.c 189483 2009-03-07 03:34:34Z kientzle $");
DEFINE_TEST(test_read_pax_truncated)
{
diff --git a/libarchive/test/test_read_pax_xattr_schily.tar.uu b/libarchive/test/test_read_pax_xattr_schily.tar.uu
index 33a3ed4ea036..83a3cdbc52b9 100644
--- a/libarchive/test/test_read_pax_xattr_schily.tar.uu
+++ b/libarchive/test/test_read_pax_xattr_schily.tar.uu
@@ -1,4 +1,4 @@
-begin 644 test_read_pax_xattr_schily.tar.uu
+begin 644 test_read_pax_xattr_schily.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
diff --git a/libarchive/test/test_read_position.c b/libarchive/test/test_read_position.c
index f245563f4c2a..e404c066e516 100644
--- a/libarchive/test/test_read_position.c
+++ b/libarchive/test/test_read_position.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/test/test_read_position.c 189389 2009-03-05 02:19:42Z kientzle $");
static unsigned char nulls[1000];
static unsigned char tmp[1000];
diff --git a/libarchive/test/test_read_splitted_rar_aa.uu b/libarchive/test/test_read_splitted_rar_aa.uu
index 9a510cb4c94a..a15d31454d26 100644
--- a/libarchive/test/test_read_splitted_rar_aa.uu
+++ b/libarchive/test/test_read_splitted_rar_aa.uu
@@ -1,4 +1,4 @@
-begin 644 -
+begin 644 test_read_splitted_rar_aa
M4F%R(1H'`,^0<P``#0````````"$4G0@D#(`%````!0````#0J+(OK=VVCX4
M,`@`I($``'1E<W0N='AT@`BW=MH^MW;:/G1E<W0@=&5X="!D;V-U;65N=`T*
*G2]T()`R``@`````
diff --git a/libarchive/test/test_read_splitted_rar_ab.uu b/libarchive/test/test_read_splitted_rar_ab.uu
index f34f25cc0b1f..0855fc3e7a9e 100644
--- a/libarchive/test/test_read_splitted_rar_ab.uu
+++ b/libarchive/test/test_read_splitted_rar_ab.uu
@@ -1,4 +1,4 @@
-begin 644 -
+begin 644 test_read_splitted_rar_ab
M``@````#>T3)MM%,V#X4,`@`_Z$``'1E<W1L:6YKP`C13-@^4%_:/G1E<W0N
M='ATS>!T()`Z`!0````4`````T*BR+YC=]H^%#`0`*2!``!T97-T9&ER7'1E
*<W0N='ATP,QC=P``
diff --git a/libarchive/test/test_read_splitted_rar_ac.uu b/libarchive/test/test_read_splitted_rar_ac.uu
index e131343bb9fe..5ec194b0a62d 100644
--- a/libarchive/test/test_read_splitted_rar_ac.uu
+++ b/libarchive/test/test_read_splitted_rar_ac.uu
@@ -1,4 +1,4 @@
-begin 644 -
+begin 644 test_read_splitted_rar_ac
MVCYC=]H^=&5S="!T97AT(&1O8W5M96YT#0JAR'3@D#$````````````#````
M`&-WVCX4,`<`[4$``'1E<W1D:7+`S&-WVCYD=]H^YN=TX)`V````````````
*`P````"=J]4^%```
diff --git a/libarchive/test/test_read_splitted_rar_ad.uu b/libarchive/test/test_read_splitted_rar_ad.uu
index f4d36093e04c..7d29b7d63bc9 100644
--- a/libarchive/test/test_read_splitted_rar_ad.uu
+++ b/libarchive/test/test_read_splitted_rar_ad.uu
@@ -1,4 +1,4 @@
-begin 644 -
+begin 644 test_read_splitted_rar_ad
D,`P`[4$``'1E<W1E;7!T>61I<H#,G:O5/L5=VC[$/7L`0`<`
`
end
diff --git a/libarchive/test/test_read_truncated.c b/libarchive/test/test_read_truncated.c
index 1e760d7f64da..c28a9ee30e00 100644
--- a/libarchive/test/test_read_truncated.c
+++ b/libarchive/test/test_read_truncated.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/test/test_read_truncated.c,v 1.4 2008/09/01 05:38:33 kientzle Exp $");
static char buff[1000000];
static char buff2[100000];
diff --git a/libarchive/test/test_read_truncated_filter.c b/libarchive/test/test_read_truncated_filter.c
index 532e3eeec6f7..9c5348d935d2 100644
--- a/libarchive/test/test_read_truncated_filter.c
+++ b/libarchive/test/test_read_truncated_filter.c
@@ -25,7 +25,6 @@
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
/*
* Check that we generate an error message when reading a truncated
@@ -81,7 +80,7 @@ test_truncation(const char *compression,
archive_entry_set_filetype(ae, AE_IFREG);
archive_entry_set_size(ae, datasize);
for (i = 0; i < 100; i++) {
- sprintf(path, "%s%d", compression, i);
+ snprintf(path, sizeof(path), "%s%d", compression, i);
archive_entry_copy_pathname(ae, path);
failure("%s", path);
if (!assertEqualIntA(a, ARCHIVE_OK,
@@ -123,7 +122,7 @@ test_truncation(const char *compression,
assert(NULL != archive_error_string(a));
break;
}
- sprintf(path, "%s%d", compression, i);
+ snprintf(path, sizeof(path), "%s%d", compression, i);
assertEqualString(path, archive_entry_pathname(ae));
if (datasize != (size_t)archive_read_data(a, data, datasize)) {
failure("Should have non-NULL error message for %s",
diff --git a/libarchive/test/test_short_writes.c b/libarchive/test/test_short_writes.c
index afa0206f07cd..8221cece1721 100644
--- a/libarchive/test/test_short_writes.c
+++ b/libarchive/test/test_short_writes.c
@@ -171,6 +171,8 @@ checker_free(struct checker *checker)
{
free(checker->shortbuf);
free(checker->fullbuf);
+ archive_read_free(checker->short_archive);
+ archive_read_free(checker->full_archive);
free(checker);
}
diff --git a/libarchive/test/test_sparse_basic.c b/libarchive/test/test_sparse_basic.c
index 133a85398547..0350df1e9f27 100644
--- a/libarchive/test/test_sparse_basic.c
+++ b/libarchive/test/test_sparse_basic.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
#ifdef HAVE_SYS_IOCTL_H
#include <sys/ioctl.h>
@@ -121,7 +120,7 @@ create_sparse_file(const char *path, const struct sparse *s)
memset(buff, ' ', sizeof(buff));
handle = CreateFileA(path, GENERIC_WRITE, 0,
- NULL, CREATE_NEW, FILE_ATTRIBUTE_NORMAL,
+ NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL,
NULL);
assert(handle != INVALID_HANDLE_VALUE);
assert(DeviceIoControl(handle, FSCTL_SET_SPARSE, NULL, 0,
@@ -253,8 +252,10 @@ is_sparse_supported(const char *path)
#if defined(HAVE_LINUX_FIEMAP_H)
if (r < 0)
return (is_sparse_supported_fiemap(path));
-#endif
+ return (1);
+#else
return (r >= 0);
+#endif
}
#elif !defined(HAVE_LINUX_FIEMAP_H)
diff --git a/libarchive/test/test_splitted_rar_seek_support_aa.uu b/libarchive/test/test_splitted_rar_seek_support_aa.uu
index 0344d2ce30ef..af2fcae348e8 100644
--- a/libarchive/test/test_splitted_rar_seek_support_aa.uu
+++ b/libarchive/test/test_splitted_rar_seek_support_aa.uu
@@ -1,4 +1,4 @@
-begin 644 -
+begin 644 test_splitted_rar_seek_support_aa
M4F%R(1H'`,^0<P``#0````````"X!'0@D$,`CTX``(].```#8Z8%7F!.(4`4
M,!D`I($``$QI8F%R8VAI=F5!9&1I;F=497-T+FAT;6S`S&!.(4!B3B%`/"%$
M3T-465!%($A434P@4%5"3$E#("(M+R]7,T,O+T141"!(5$U,(#0N,"!4<F%N
diff --git a/libarchive/test/test_splitted_rar_seek_support_ab.uu b/libarchive/test/test_splitted_rar_seek_support_ab.uu
index 5f41f5fdac44..5652c6ac5ebf 100644
--- a/libarchive/test/test_splitted_rar_seek_support_ab.uu
+++ b/libarchive/test/test_splitted_rar_seek_support_ab.uu
@@ -1,4 +1,4 @@
-begin 644 -
+begin 644 test_splitted_rar_seek_support_ab
M;&]G(&UE<W-A9V5S(&]N(&9A:6QU<F4N($EN('!A<G1I8W5L87(L('1H97D@
M<')I;G0*=&AE('9A;'5E(&]F(&)O=&@@87)G=6UE;G1S.R!T:&ES(&=R96%T
M;'D@<VEM<&QI9FEE<R!D:6%G;F]S:6YG"F9A:6QU<F5S+B`*/"]0/@H\2#$@
diff --git a/libarchive/test/test_splitted_rar_seek_support_ac.uu b/libarchive/test/test_splitted_rar_seek_support_ac.uu
index ee9f78c48967..3b45bdb4f8f3 100644
--- a/libarchive/test/test_splitted_rar_seek_support_ac.uu
+++ b/libarchive/test/test_splitted_rar_seek_support_ac.uu
@@ -1,4 +1,4 @@
-begin 644 -
+begin 644 test_splitted_rar_seek_support_ac
M<F]M(&-O;F9I9RYH+B`H268@=&AE('1E<W1S('5S92!T:&4@<V%M92`\5%0@
M0TQ!4U,](G=E<W1E<FXB/DA!5D5?/"]45#X*"6UA8W)O<R!A<R!T:&4@8V]D
M92!B96EN9R!T97-T960@=&AE;B!C;VYF:6=U<F%T:6]N('!R;V)L96US('=I
diff --git a/libarchive/test/test_tar_filenames.c b/libarchive/test/test_tar_filenames.c
index 84e955cc4b08..a8c9a3dc790d 100644
--- a/libarchive/test/test_tar_filenames.c
+++ b/libarchive/test/test_tar_filenames.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/test/test_tar_filenames.c,v 1.10 2008/09/01 05:38:33 kientzle Exp $");
/*
* Exercise various lengths of filenames in tar archives,
diff --git a/libarchive/test/test_tar_large.c b/libarchive/test/test_tar_large.c
index 626f9f0878bc..7ff3fee17717 100644
--- a/libarchive/test/test_tar_large.c
+++ b/libarchive/test/test_tar_large.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/test/test_tar_large.c 201247 2009-12-30 05:59:21Z kientzle $");
#include <errno.h>
#include <stdlib.h>
@@ -224,7 +223,7 @@ DEFINE_TEST(test_tar_large)
*/
for (i = 0; tests[i] != 0; i++) {
assert((ae = archive_entry_new()) != NULL);
- sprintf(namebuff, "file_%d", i);
+ snprintf(namebuff, sizeof(namebuff), "file_%d", i);
archive_entry_copy_pathname(ae, namebuff);
archive_entry_set_mode(ae, S_IFREG | 0755);
filesize = tests[i];
@@ -271,7 +270,7 @@ DEFINE_TEST(test_tar_large)
*/
for (i = 0; tests[i] > 0; i++) {
assertEqualIntA(a, 0, archive_read_next_header(a, &ae));
- sprintf(namebuff, "file_%d", i);
+ snprintf(namebuff, sizeof(namebuff), "file_%d", i);
assertEqualString(namebuff, archive_entry_pathname(ae));
assert(tests[i] == archive_entry_size(ae));
}
diff --git a/libarchive/test/test_ustar_filename_encoding.c b/libarchive/test/test_ustar_filename_encoding.c
index 5e4fba716c13..cc62453f1c1b 100644
--- a/libarchive/test/test_ustar_filename_encoding.c
+++ b/libarchive/test/test_ustar_filename_encoding.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
#include <locale.h>
diff --git a/libarchive/test/test_ustar_filenames.c b/libarchive/test/test_ustar_filenames.c
index 1a4b4e1452c2..896b5cc9f1a1 100644
--- a/libarchive/test/test_ustar_filenames.c
+++ b/libarchive/test/test_ustar_filenames.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/test/test_ustar_filenames.c 189308 2009-03-03 17:02:51Z kientzle $");
/*
* Exercise various lengths of filenames in ustar archives.
diff --git a/libarchive/test/test_write_disk.c b/libarchive/test/test_write_disk.c
index e38dbc78ff4e..fa0743f949f6 100644
--- a/libarchive/test/test_write_disk.c
+++ b/libarchive/test/test_write_disk.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/test/test_write_disk.c 201247 2009-12-30 05:59:21Z kientzle $");
#define UMASK 022
/*
diff --git a/libarchive/test/test_write_disk_appledouble.c b/libarchive/test/test_write_disk_appledouble.c
index d82d698ebda7..3265a94d2fed 100644
--- a/libarchive/test/test_write_disk_appledouble.c
+++ b/libarchive/test/test_write_disk_appledouble.c
@@ -24,7 +24,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
#ifdef HAVE_SYS_ACL_H
#include <sys/acl.h>
diff --git a/libarchive/test/test_write_disk_failures.c b/libarchive/test/test_write_disk_failures.c
index c563ce1d3212..ff688b993d5f 100644
--- a/libarchive/test/test_write_disk_failures.c
+++ b/libarchive/test/test_write_disk_failures.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/test/test_write_disk_failures.c 201247 2009-12-30 05:59:21Z kientzle $");
DEFINE_TEST(test_write_disk_failures)
{
diff --git a/libarchive/test/test_write_disk_hardlink.c b/libarchive/test/test_write_disk_hardlink.c
index 184f77a00f0d..215633ab40bf 100644
--- a/libarchive/test/test_write_disk_hardlink.c
+++ b/libarchive/test/test_write_disk_hardlink.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/test/test_write_disk_hardlink.c 201247 2009-12-30 05:59:21Z kientzle $");
#if defined(_WIN32) && !defined(__CYGWIN__)
/* Execution bits, Group members bits and others bits do not work. */
diff --git a/libarchive/test/test_write_disk_hfs_compression.c b/libarchive/test/test_write_disk_hfs_compression.c
index 8a2e7df3b9b2..026e41533628 100644
--- a/libarchive/test/test_write_disk_hfs_compression.c
+++ b/libarchive/test/test_write_disk_hfs_compression.c
@@ -24,7 +24,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
#ifdef HAVE_SYS_XATTR_H
#include <sys/xattr.h>
diff --git a/libarchive/test/test_write_disk_lookup.c b/libarchive/test/test_write_disk_lookup.c
index cabdae8ddc43..52b9a7457017 100644
--- a/libarchive/test/test_write_disk_lookup.c
+++ b/libarchive/test/test_write_disk_lookup.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
static void
group_cleanup(void *d)
diff --git a/libarchive/test/test_write_disk_mac_metadata.c b/libarchive/test/test_write_disk_mac_metadata.c
index be13d96afddf..f9cfd9b3fd7c 100644
--- a/libarchive/test/test_write_disk_mac_metadata.c
+++ b/libarchive/test/test_write_disk_mac_metadata.c
@@ -24,7 +24,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
#ifdef HAVE_SYS_ACL_H
#include <sys/acl.h>
diff --git a/libarchive/test/test_write_disk_no_hfs_compression.c b/libarchive/test/test_write_disk_no_hfs_compression.c
index 0af44d246a11..58ad187574c1 100644
--- a/libarchive/test/test_write_disk_no_hfs_compression.c
+++ b/libarchive/test/test_write_disk_no_hfs_compression.c
@@ -24,7 +24,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
#ifdef HAVE_SYS_XATTR_H
#include <sys/xattr.h>
diff --git a/libarchive/test/test_write_disk_perms.c b/libarchive/test/test_write_disk_perms.c
index 81f8b1209ce1..4df9f70bd998 100644
--- a/libarchive/test/test_write_disk_perms.c
+++ b/libarchive/test/test_write_disk_perms.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/test/test_write_disk_perms.c 201247 2009-12-30 05:59:21Z kientzle $");
#if !defined(_WIN32) || defined(__CYGWIN__)
diff --git a/libarchive/test/test_write_disk_secure.c b/libarchive/test/test_write_disk_secure.c
index 44b9ea0d5b21..ddaf95d7497c 100644
--- a/libarchive/test/test_write_disk_secure.c
+++ b/libarchive/test/test_write_disk_secure.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/test/test_write_disk_secure.c 201247 2009-12-30 05:59:21Z kientzle $");
#define UMASK 022
diff --git a/libarchive/test/test_write_disk_secure744.c b/libarchive/test/test_write_disk_secure744.c
index 08c725e12b80..35824658ce65 100644
--- a/libarchive/test/test_write_disk_secure744.c
+++ b/libarchive/test/test_write_disk_secure744.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
#define UMASK 022
@@ -75,7 +74,7 @@ DEFINE_TEST(test_write_disk_secure744)
archive_entry_free(ae);
*p++ = '/';
- sprintf(p, "target%d", n);
+ snprintf(p, buff_size - (p - buff), "target%d", n);
/* Try to create a file through the symlink, should fail. */
assert((ae = archive_entry_new()) != NULL);
diff --git a/libarchive/test/test_write_disk_secure745.c b/libarchive/test/test_write_disk_secure745.c
index 870b06475cef..7b908ccc8905 100644
--- a/libarchive/test/test_write_disk_secure745.c
+++ b/libarchive/test/test_write_disk_secure745.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
#define UMASK 022
diff --git a/libarchive/test/test_write_disk_secure746.c b/libarchive/test/test_write_disk_secure746.c
index 99cb882c059a..3f0588914707 100644
--- a/libarchive/test/test_write_disk_secure746.c
+++ b/libarchive/test/test_write_disk_secure746.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
#define UMASK 022
diff --git a/libarchive/test/test_write_disk_sparse.c b/libarchive/test/test_write_disk_sparse.c
index 36ecf322087d..36fd6944584d 100644
--- a/libarchive/test/test_write_disk_sparse.c
+++ b/libarchive/test/test_write_disk_sparse.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/test/test_write_disk_sparse.c 201247 2009-12-30 05:59:21Z kientzle $");
/*
* Write a file using archive_write_data call, read the file
diff --git a/libarchive/test/test_write_disk_symlink.c b/libarchive/test/test_write_disk_symlink.c
index aeadfee8a4e9..65194d94c081 100644
--- a/libarchive/test/test_write_disk_symlink.c
+++ b/libarchive/test/test_write_disk_symlink.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/test/test_write_disk_symlink.c 201247 2009-12-30 05:59:21Z kientzle $");
/*
* Exercise symlink recreation.
diff --git a/libarchive/test/test_write_disk_times.c b/libarchive/test/test_write_disk_times.c
index 568d04c0017d..265da4c2b875 100644
--- a/libarchive/test/test_write_disk_times.c
+++ b/libarchive/test/test_write_disk_times.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/test/test_write_disk_times.c 201247 2009-12-30 05:59:21Z kientzle $");
/*
* Exercise time restores in archive_write_disk(), including
diff --git a/libarchive/test/test_write_filter_b64encode.c b/libarchive/test/test_write_filter_b64encode.c
index 665087b97885..e33ff8a9817c 100644
--- a/libarchive/test/test_write_filter_b64encode.c
+++ b/libarchive/test/test_write_filter_b64encode.c
@@ -25,7 +25,6 @@
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
/*
* A basic exercise of b64encode reading and writing.
@@ -64,7 +63,7 @@ DEFINE_TEST(test_write_filter_b64encode)
assert((ae = archive_entry_new()) != NULL);
archive_entry_set_filetype(ae, AE_IFREG);
archive_entry_set_size(ae, datasize);
- sprintf(path, "file%03d", i);
+ snprintf(path, sizeof(path), "file%03d", i);
archive_entry_copy_pathname(ae, path);
assertEqualIntA(a, ARCHIVE_OK, archive_write_header(a, ae));
assertA(datasize
@@ -79,7 +78,7 @@ DEFINE_TEST(test_write_filter_b64encode)
assertEqualIntA(a, ARCHIVE_OK, archive_read_support_filter_all(a));
assertEqualIntA(a, ARCHIVE_OK, archive_read_open_memory(a, buff, used1));
for (i = 0; i < 99; i++) {
- sprintf(path, "file%03d", i);
+ snprintf(path, sizeof(path), "file%03d", i);
if (!assertEqualIntA(a, 0, archive_read_next_header(a, &ae)))
break;
assertEqualString(path, archive_entry_pathname(ae));
@@ -111,7 +110,7 @@ DEFINE_TEST(test_write_filter_b64encode)
assertEqualIntA(a, ARCHIVE_OK,
archive_write_open_memory(a, buff, buffsize, &used2));
for (i = 0; i < 99; i++) {
- sprintf(path, "file%03d", i);
+ snprintf(path, sizeof(path), "file%03d", i);
assert((ae = archive_entry_new()) != NULL);
archive_entry_copy_pathname(ae, path);
archive_entry_set_size(ae, datasize);
@@ -128,7 +127,7 @@ DEFINE_TEST(test_write_filter_b64encode)
assertEqualIntA(a, ARCHIVE_OK, archive_read_support_filter_all(a));
assertEqualIntA(a, ARCHIVE_OK, archive_read_open_memory(a, buff, used2));
for (i = 0; i < 99; i++) {
- sprintf(path, "file%03d", i);
+ snprintf(path, sizeof(path), "file%03d", i);
if (!assertEqualInt(0, archive_read_next_header(a, &ae)))
break;
assertEqualString(path, archive_entry_pathname(ae));
diff --git a/libarchive/test/test_write_filter_bzip2.c b/libarchive/test/test_write_filter_bzip2.c
index 4f32d28cbed4..f48bcc213231 100644
--- a/libarchive/test/test_write_filter_bzip2.c
+++ b/libarchive/test/test_write_filter_bzip2.c
@@ -25,7 +25,6 @@
*/
#include "test.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/test/test_write_compress_bzip2.c 191183 2009-04-17 01:06:31Z kientzle $");
/*
* A basic exercise of bzip2 reading and writing.
@@ -83,7 +82,7 @@ DEFINE_TEST(test_write_filter_bzip2)
archive_entry_set_filetype(ae, AE_IFREG);
archive_entry_set_size(ae, datasize);
for (i = 0; i < 999; i++) {
- sprintf(path, "file%03d", i);
+ snprintf(path, sizeof(path), "file%03d", i);
archive_entry_copy_pathname(ae, path);
assertEqualIntA(a, ARCHIVE_OK, archive_write_header(a, ae));
assertA(datasize
@@ -99,7 +98,7 @@ DEFINE_TEST(test_write_filter_bzip2)
assertEqualIntA(a, ARCHIVE_OK,
archive_read_open_memory(a, buff, used1));
for (i = 0; i < 999; i++) {
- sprintf(path, "file%03d", i);
+ snprintf(path, sizeof(path), "file%03d", i);
if (!assertEqualInt(0, archive_read_next_header(a, &ae)))
break;
assertEqualString(path, archive_entry_pathname(ae));
@@ -133,7 +132,7 @@ DEFINE_TEST(test_write_filter_bzip2)
assertEqualIntA(a, ARCHIVE_OK,
archive_write_open_memory(a, buff, buffsize, &used2));
for (i = 0; i < 999; i++) {
- sprintf(path, "file%03d", i);
+ snprintf(path, sizeof(path), "file%03d", i);
assert((ae = archive_entry_new()) != NULL);
archive_entry_copy_pathname(ae, path);
archive_entry_set_size(ae, datasize);
@@ -160,7 +159,7 @@ DEFINE_TEST(test_write_filter_bzip2)
assertEqualIntA(a, ARCHIVE_OK,
archive_read_open_memory(a, buff, used2));
for (i = 0; i < 999; i++) {
- sprintf(path, "file%03d", i);
+ snprintf(path, sizeof(path), "file%03d", i);
if (!assertEqualInt(0, archive_read_next_header(a, &ae)))
break;
assertEqualString(path, archive_entry_pathname(ae));
@@ -187,7 +186,7 @@ DEFINE_TEST(test_write_filter_bzip2)
assertEqualIntA(a, ARCHIVE_OK,
archive_write_open_memory(a, buff, buffsize, &used2));
for (i = 0; i < 999; i++) {
- sprintf(path, "file%03d", i);
+ snprintf(path, sizeof(path), "file%03d", i);
assert((ae = archive_entry_new()) != NULL);
archive_entry_copy_pathname(ae, path);
archive_entry_set_size(ae, datasize);
@@ -212,7 +211,7 @@ DEFINE_TEST(test_write_filter_bzip2)
assertEqualIntA(a, ARCHIVE_OK,
archive_read_open_memory(a, buff, used2));
for (i = 0; i < 999; i++) {
- sprintf(path, "file%03d", i);
+ snprintf(path, sizeof(path), "file%03d", i);
if (!assertEqualInt(0, archive_read_next_header(a, &ae)))
break;
assertEqualString(path, archive_entry_pathname(ae));
diff --git a/libarchive/test/test_write_filter_compress.c b/libarchive/test/test_write_filter_compress.c
index 1b8910e51adb..f7b9565b7db2 100644
--- a/libarchive/test/test_write_filter_compress.c
+++ b/libarchive/test/test_write_filter_compress.c
@@ -25,7 +25,6 @@
*/
#include "test.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/test/test_write_compress.c 189308 2009-03-03 17:02:51Z kientzle $");
/*
* A basic exercise of compress reading and writing.
@@ -59,7 +58,7 @@ DEFINE_TEST(test_write_filter_compress)
archive_write_open_memory(a, buff, buffsize, &used));
for (i = 0; i < 100; i++) {
- sprintf(path, "file%03d", i);
+ snprintf(path, sizeof(path), "file%03d", i);
assert((ae = archive_entry_new()) != NULL);
archive_entry_copy_pathname(ae, path);
archive_entry_set_size(ae, datasize);
@@ -83,7 +82,7 @@ DEFINE_TEST(test_write_filter_compress)
for (i = 0; i < 100; i++) {
- sprintf(path, "file%03d", i);
+ snprintf(path, sizeof(path), "file%03d", i);
if (!assertEqualInt(0, archive_read_next_header(a, &ae)))
break;
assertEqualString(path, archive_entry_pathname(ae));
diff --git a/libarchive/test/test_write_filter_gzip.c b/libarchive/test/test_write_filter_gzip.c
index 935fb51f5140..ae81a4fc59d6 100644
--- a/libarchive/test/test_write_filter_gzip.c
+++ b/libarchive/test/test_write_filter_gzip.c
@@ -25,7 +25,6 @@
*/
#include "test.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/test/test_write_compress_gzip.c 191183 2009-04-17 01:06:31Z kientzle $");
/*
* A basic exercise of gzip reading and writing.
@@ -85,7 +84,7 @@ DEFINE_TEST(test_write_filter_gzip)
archive_entry_set_filetype(ae, AE_IFREG);
archive_entry_set_size(ae, datasize);
for (i = 0; i < 100; i++) {
- sprintf(path, "file%03d", i);
+ snprintf(path, sizeof(path), "file%03d", i);
archive_entry_copy_pathname(ae, path);
assertEqualIntA(a, ARCHIVE_OK, archive_write_header(a, ae));
assertA(datasize
@@ -113,7 +112,7 @@ DEFINE_TEST(test_write_filter_gzip)
assertEqualIntA(a, ARCHIVE_OK,
archive_read_open_memory(a, buff, used1));
for (i = 0; i < 100; i++) {
- sprintf(path, "file%03d", i);
+ snprintf(path, sizeof(path), "file%03d", i);
if (!assertEqualInt(ARCHIVE_OK,
archive_read_next_header(a, &ae)))
break;
@@ -148,7 +147,7 @@ DEFINE_TEST(test_write_filter_gzip)
archive_write_set_options(a, "gzip:compression-level=9"));
assertEqualIntA(a, ARCHIVE_OK, archive_write_open_memory(a, buff, buffsize, &used2));
for (i = 0; i < 100; i++) {
- sprintf(path, "file%03d", i);
+ snprintf(path, sizeof(path), "file%03d", i);
assert((ae = archive_entry_new()) != NULL);
archive_entry_copy_pathname(ae, path);
archive_entry_set_size(ae, datasize);
@@ -187,7 +186,7 @@ DEFINE_TEST(test_write_filter_gzip)
assertEqualIntA(a, ARCHIVE_OK,
archive_read_open_memory(a, buff, used2));
for (i = 0; i < 100; i++) {
- sprintf(path, "file%03d", i);
+ snprintf(path, sizeof(path), "file%03d", i);
if (!assertEqualInt(ARCHIVE_OK,
archive_read_next_header(a, &ae)))
break;
@@ -212,7 +211,7 @@ DEFINE_TEST(test_write_filter_gzip)
assertEqualIntA(a, ARCHIVE_OK,
archive_write_open_memory(a, buff, buffsize, &used2));
for (i = 0; i < 100; i++) {
- sprintf(path, "file%03d", i);
+ snprintf(path, sizeof(path), "file%03d", i);
assert((ae = archive_entry_new()) != NULL);
archive_entry_copy_pathname(ae, path);
archive_entry_set_size(ae, datasize);
@@ -249,7 +248,7 @@ DEFINE_TEST(test_write_filter_gzip)
assertEqualIntA(a, ARCHIVE_OK,
archive_read_open_memory(a, buff, used2));
for (i = 0; i < 100; i++) {
- sprintf(path, "file%03d", i);
+ snprintf(path, sizeof(path), "file%03d", i);
if (!assertEqualInt(ARCHIVE_OK,
archive_read_next_header(a, &ae)))
break;
diff --git a/libarchive/test/test_write_filter_gzip_timestamp.c b/libarchive/test/test_write_filter_gzip_timestamp.c
index 23b11dba79a6..ee29f034231c 100644
--- a/libarchive/test/test_write_filter_gzip_timestamp.c
+++ b/libarchive/test/test_write_filter_gzip_timestamp.c
@@ -26,7 +26,6 @@
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
DEFINE_TEST(test_write_filter_gzip_timestamp)
{
diff --git a/libarchive/test/test_write_filter_lrzip.c b/libarchive/test/test_write_filter_lrzip.c
index f28c8358363d..2efc2ec284a4 100644
--- a/libarchive/test/test_write_filter_lrzip.c
+++ b/libarchive/test/test_write_filter_lrzip.c
@@ -68,7 +68,7 @@ DEFINE_TEST(test_write_filter_lrzip)
archive_entry_set_filetype(ae, AE_IFREG);
archive_entry_set_size(ae, datasize);
for (i = 0; i < 100; i++) {
- sprintf(path, "file%03d", i);
+ snprintf(path, sizeof(path), "file%03d", i);
archive_entry_copy_pathname(ae, path);
assertEqualIntA(a, ARCHIVE_OK, archive_write_header(a, ae));
assertA(datasize
@@ -84,7 +84,7 @@ DEFINE_TEST(test_write_filter_lrzip)
assertEqualIntA(a, ARCHIVE_OK,
archive_read_open_memory(a, buff, used1));
for (i = 0; i < 100; i++) {
- sprintf(path, "file%03d", i);
+ snprintf(path, sizeof(path), "file%03d", i);
if (!assertEqualInt(ARCHIVE_OK,
archive_read_next_header(a, &ae)))
break;
diff --git a/libarchive/test/test_write_filter_lz4.c b/libarchive/test/test_write_filter_lz4.c
index 4f2135a31507..97a80321dede 100644
--- a/libarchive/test/test_write_filter_lz4.c
+++ b/libarchive/test/test_write_filter_lz4.c
@@ -25,7 +25,6 @@
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
/*
* A basic exercise of lz4 reading and writing.
@@ -62,7 +61,7 @@ DEFINE_TEST(test_write_filter_lz4)
assert(NULL != (buff = (char *)malloc(buffsize)));
datasize = 10000;
- assert(NULL != (data = (char *)calloc(1, datasize)));
+ assert(NULL != (data = (char *)calloc(datasize, 1)));
filecount = 10;
/*
@@ -84,7 +83,7 @@ DEFINE_TEST(test_write_filter_lz4)
archive_entry_set_filetype(ae, AE_IFREG);
archive_entry_set_size(ae, datasize);
for (i = 0; i < filecount; i++) {
- sprintf(path, "file%03d", i);
+ snprintf(path, sizeof(path), "file%03d", i);
archive_entry_copy_pathname(ae, path);
assertEqualIntA(a, ARCHIVE_OK, archive_write_header(a, ae));
assertA(datasize
@@ -107,7 +106,7 @@ DEFINE_TEST(test_write_filter_lz4)
assertEqualIntA(a, ARCHIVE_OK,
archive_read_open_memory(a, buff, used1));
for (i = 0; i < filecount; i++) {
- sprintf(path, "file%03d", i);
+ snprintf(path, sizeof(path), "file%03d", i);
if (!assertEqualInt(ARCHIVE_OK,
archive_read_next_header(a, &ae)))
break;
@@ -142,7 +141,7 @@ DEFINE_TEST(test_write_filter_lz4)
assertEqualIntA(a, ARCHIVE_OK,
archive_write_open_memory(a, buff, buffsize, &used2));
for (i = 0; i < filecount; i++) {
- sprintf(path, "file%03d", i);
+ snprintf(path, sizeof(path), "file%03d", i);
assert((ae = archive_entry_new()) != NULL);
archive_entry_copy_pathname(ae, path);
archive_entry_set_size(ae, datasize);
@@ -170,7 +169,7 @@ DEFINE_TEST(test_write_filter_lz4)
assertEqualIntA(a, ARCHIVE_OK,
archive_read_open_memory(a, buff, used2));
for (i = 0; i < filecount; i++) {
- sprintf(path, "file%03d", i);
+ snprintf(path, sizeof(path), "file%03d", i);
if (!assertEqualInt(ARCHIVE_OK,
archive_read_next_header(a, &ae)))
break;
@@ -195,7 +194,7 @@ DEFINE_TEST(test_write_filter_lz4)
assertEqualIntA(a, ARCHIVE_OK,
archive_write_open_memory(a, buff, buffsize, &used2));
for (i = 0; i < filecount; i++) {
- sprintf(path, "file%03d", i);
+ snprintf(path, sizeof(path), "file%03d", i);
assert((ae = archive_entry_new()) != NULL);
archive_entry_copy_pathname(ae, path);
archive_entry_set_size(ae, datasize);
@@ -225,7 +224,7 @@ DEFINE_TEST(test_write_filter_lz4)
assertEqualIntA(a, ARCHIVE_OK,
archive_read_open_memory(a, buff, used2));
for (i = 0; i < filecount; i++) {
- sprintf(path, "file%03d", i);
+ snprintf(path, sizeof(path), "file%03d", i);
if (!assertEqualInt(ARCHIVE_OK,
archive_read_next_header(a, &ae)))
break;
@@ -306,7 +305,7 @@ test_options(const char *options)
assert(NULL != (buff = (char *)malloc(buffsize)));
datasize = 10000;
- assert(NULL != (data = (char *)calloc(1, datasize)));
+ assert(NULL != (data = (char *)calloc(datasize, 1)));
filecount = 10;
/*
@@ -330,7 +329,7 @@ test_options(const char *options)
archive_entry_set_filetype(ae, AE_IFREG);
archive_entry_set_size(ae, datasize);
for (i = 0; i < filecount; i++) {
- sprintf(path, "file%03d", i);
+ snprintf(path, sizeof(path), "file%03d", i);
archive_entry_copy_pathname(ae, path);
assertEqualIntA(a, ARCHIVE_OK, archive_write_header(a, ae));
assertA(datasize
@@ -350,7 +349,7 @@ test_options(const char *options)
assertEqualIntA(a, ARCHIVE_OK,
archive_read_open_memory(a, buff, used1));
for (i = 0; i < filecount; i++) {
- sprintf(path, "file%03d", i);
+ snprintf(path, sizeof(path), "file%03d", i);
if (!assertEqualInt(ARCHIVE_OK,
archive_read_next_header(a, &ae)))
break;
diff --git a/libarchive/test/test_write_filter_lzip.c b/libarchive/test/test_write_filter_lzip.c
index 145a3084d3de..8d6544668980 100644
--- a/libarchive/test/test_write_filter_lzip.c
+++ b/libarchive/test/test_write_filter_lzip.c
@@ -26,7 +26,6 @@
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
/*
* A basic exercise of lzip reading and writing.
@@ -81,7 +80,7 @@ DEFINE_TEST(test_write_filter_lzip)
archive_entry_set_filetype(ae, AE_IFREG);
archive_entry_set_size(ae, datasize);
for (i = 0; i < 100; i++) {
- sprintf(path, "file%03d", i);
+ snprintf(path, sizeof(path), "file%03d", i);
archive_entry_copy_pathname(ae, path);
assertEqualIntA(a, ARCHIVE_OK, archive_write_header(a, ae));
assertA(datasize
@@ -103,7 +102,7 @@ DEFINE_TEST(test_write_filter_lzip)
assertEqualIntA(a, ARCHIVE_OK,
archive_read_open_memory(a, buff, used1));
for (i = 0; i < 100; i++) {
- sprintf(path, "file%03d", i);
+ snprintf(path, sizeof(path), "file%03d", i);
if (!assertEqualInt(ARCHIVE_OK,
archive_read_next_header(a, &ae)))
break;
@@ -133,7 +132,7 @@ DEFINE_TEST(test_write_filter_lzip)
archive_write_set_filter_option(a, NULL, "compression-level", "9"));
assertEqualIntA(a, ARCHIVE_OK, archive_write_open_memory(a, buff, buffsize, &used2));
for (i = 0; i < 100; i++) {
- sprintf(path, "file%03d", i);
+ snprintf(path, sizeof(path), "file%03d", i);
assert((ae = archive_entry_new()) != NULL);
archive_entry_copy_pathname(ae, path);
archive_entry_set_size(ae, datasize);
@@ -157,7 +156,7 @@ DEFINE_TEST(test_write_filter_lzip)
assertEqualIntA(a, ARCHIVE_OK,
archive_read_open_memory(a, buff, used2));
for (i = 0; i < 100; i++) {
- sprintf(path, "file%03d", i);
+ snprintf(path, sizeof(path), "file%03d", i);
failure("Trying to read %s", path);
if (!assertEqualIntA(a, ARCHIVE_OK,
archive_read_next_header(a, &ae)))
@@ -181,7 +180,7 @@ DEFINE_TEST(test_write_filter_lzip)
archive_write_set_filter_option(a, NULL, "compression-level", "0"));
assertEqualIntA(a, ARCHIVE_OK, archive_write_open_memory(a, buff, buffsize, &used2));
for (i = 0; i < 100; i++) {
- sprintf(path, "file%03d", i);
+ snprintf(path, sizeof(path), "file%03d", i);
assert((ae = archive_entry_new()) != NULL);
archive_entry_copy_pathname(ae, path);
archive_entry_set_size(ae, datasize);
@@ -210,7 +209,7 @@ DEFINE_TEST(test_write_filter_lzip)
assertEqualIntA(a, ARCHIVE_OK,
archive_read_open_memory(a, buff, used2));
for (i = 0; i < 100; i++) {
- sprintf(path, "file%03d", i);
+ snprintf(path, sizeof(path), "file%03d", i);
if (!assertEqualInt(ARCHIVE_OK,
archive_read_next_header(a, &ae)))
break;
diff --git a/libarchive/test/test_write_filter_lzma.c b/libarchive/test/test_write_filter_lzma.c
index 68e489832504..d7c0c5b21b6b 100644
--- a/libarchive/test/test_write_filter_lzma.c
+++ b/libarchive/test/test_write_filter_lzma.c
@@ -25,7 +25,6 @@
*/
#include "test.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/test/test_write_compress_lzma.c 191183 2009-04-17 01:06:31Z kientzle $");
/*
* A basic exercise of lzma reading and writing.
@@ -80,7 +79,7 @@ DEFINE_TEST(test_write_filter_lzma)
archive_entry_set_filetype(ae, AE_IFREG);
archive_entry_set_size(ae, datasize);
for (i = 0; i < 100; i++) {
- sprintf(path, "file%03d", i);
+ snprintf(path, sizeof(path), "file%03d", i);
archive_entry_copy_pathname(ae, path);
assertEqualIntA(a, ARCHIVE_OK, archive_write_header(a, ae));
assertA(datasize
@@ -102,7 +101,7 @@ DEFINE_TEST(test_write_filter_lzma)
assertEqualIntA(a, ARCHIVE_OK,
archive_read_open_memory(a, buff, used1));
for (i = 0; i < 100; i++) {
- sprintf(path, "file%03d", i);
+ snprintf(path, sizeof(path), "file%03d", i);
if (!assertEqualInt(ARCHIVE_OK,
archive_read_next_header(a, &ae)))
break;
@@ -132,7 +131,7 @@ DEFINE_TEST(test_write_filter_lzma)
archive_write_set_filter_option(a, NULL, "compression-level", "9"));
assertEqualIntA(a, ARCHIVE_OK, archive_write_open_memory(a, buff, buffsize, &used2));
for (i = 0; i < 100; i++) {
- sprintf(path, "file%03d", i);
+ snprintf(path, sizeof(path), "file%03d", i);
assert((ae = archive_entry_new()) != NULL);
archive_entry_copy_pathname(ae, path);
archive_entry_set_size(ae, datasize);
@@ -156,7 +155,7 @@ DEFINE_TEST(test_write_filter_lzma)
assertEqualIntA(a, ARCHIVE_OK,
archive_read_open_memory(a, buff, used2));
for (i = 0; i < 100; i++) {
- sprintf(path, "file%03d", i);
+ snprintf(path, sizeof(path), "file%03d", i);
failure("Trying to read %s", path);
if (!assertEqualIntA(a, ARCHIVE_OK,
archive_read_next_header(a, &ae)))
@@ -180,7 +179,7 @@ DEFINE_TEST(test_write_filter_lzma)
archive_write_set_filter_option(a, NULL, "compression-level", "0"));
assertEqualIntA(a, ARCHIVE_OK, archive_write_open_memory(a, buff, buffsize, &used2));
for (i = 0; i < 100; i++) {
- sprintf(path, "file%03d", i);
+ snprintf(path, sizeof(path), "file%03d", i);
assert((ae = archive_entry_new()) != NULL);
archive_entry_copy_pathname(ae, path);
archive_entry_set_size(ae, datasize);
@@ -214,7 +213,7 @@ DEFINE_TEST(test_write_filter_lzma)
assertEqualIntA(a, ARCHIVE_OK,
archive_read_open_memory(a, buff, used2));
for (i = 0; i < 100; i++) {
- sprintf(path, "file%03d", i);
+ snprintf(path, sizeof(path), "file%03d", i);
if (!assertEqualInt(ARCHIVE_OK,
archive_read_next_header(a, &ae)))
break;
diff --git a/libarchive/test/test_write_filter_lzop.c b/libarchive/test/test_write_filter_lzop.c
index 92db7bf3dc43..87843f49bd3b 100644
--- a/libarchive/test/test_write_filter_lzop.c
+++ b/libarchive/test/test_write_filter_lzop.c
@@ -25,8 +25,6 @@
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
-
/*
* A basic exercise of lzop reading and writing.
*/
@@ -57,7 +55,7 @@ DEFINE_TEST(test_write_filter_lzop)
assert(NULL != (buff = (char *)malloc(buffsize)));
datasize = 10000;
- assert(NULL != (data = (char *)calloc(1, datasize)));
+ assert(NULL != (data = (char *)calloc(datasize, 1)));
filecount = 10;
/*
@@ -79,7 +77,7 @@ DEFINE_TEST(test_write_filter_lzop)
archive_entry_set_filetype(ae, AE_IFREG);
archive_entry_set_size(ae, datasize);
for (i = 0; i < filecount; i++) {
- sprintf(path, "file%03d", i);
+ snprintf(path, sizeof(path), "file%03d", i);
archive_entry_copy_pathname(ae, path);
assertEqualIntA(a, ARCHIVE_OK, archive_write_header(a, ae));
assertA(datasize
@@ -99,7 +97,7 @@ DEFINE_TEST(test_write_filter_lzop)
assertEqualIntA(a, ARCHIVE_OK,
archive_read_open_memory(a, buff, used1));
for (i = 0; i < filecount; i++) {
- sprintf(path, "file%03d", i);
+ snprintf(path, sizeof(path), "file%03d", i);
if (!assertEqualInt(ARCHIVE_OK,
archive_read_next_header(a, &ae)))
break;
@@ -135,7 +133,7 @@ DEFINE_TEST(test_write_filter_lzop)
assertEqualIntA(a, ARCHIVE_OK,
archive_write_open_memory(a, buff, buffsize, &used2));
for (i = 0; i < filecount; i++) {
- sprintf(path, "file%03d", i);
+ snprintf(path, sizeof(path), "file%03d", i);
assert((ae = archive_entry_new()) != NULL);
archive_entry_copy_pathname(ae, path);
archive_entry_set_size(ae, datasize);
@@ -163,7 +161,7 @@ DEFINE_TEST(test_write_filter_lzop)
assertEqualIntA(a, ARCHIVE_OK,
archive_read_open_memory(a, buff, used2));
for (i = 0; i < filecount; i++) {
- sprintf(path, "file%03d", i);
+ snprintf(path, sizeof(path), "file%03d", i);
if (!assertEqualInt(ARCHIVE_OK,
archive_read_next_header(a, &ae)))
break;
@@ -188,7 +186,7 @@ DEFINE_TEST(test_write_filter_lzop)
assertEqualIntA(a, ARCHIVE_OK,
archive_write_open_memory(a, buff, buffsize, &used2));
for (i = 0; i < filecount; i++) {
- sprintf(path, "file%03d", i);
+ snprintf(path, sizeof(path), "file%03d", i);
assert((ae = archive_entry_new()) != NULL);
archive_entry_copy_pathname(ae, path);
archive_entry_set_size(ae, datasize);
@@ -218,7 +216,7 @@ DEFINE_TEST(test_write_filter_lzop)
assertEqualIntA(a, ARCHIVE_OK,
archive_read_open_memory(a, buff, used2));
for (i = 0; i < filecount; i++) {
- sprintf(path, "file%03d", i);
+ snprintf(path, sizeof(path), "file%03d", i);
if (!assertEqualInt(ARCHIVE_OK,
archive_read_next_header(a, &ae)))
break;
diff --git a/libarchive/test/test_write_filter_program.c b/libarchive/test/test_write_filter_program.c
index 9fe264c018dc..a1f93ab79f5a 100644
--- a/libarchive/test/test_write_filter_program.c
+++ b/libarchive/test/test_write_filter_program.c
@@ -24,7 +24,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/test/test_write_compress_program.c 201247 2009-12-30 05:59:21Z kientzle $");
static char buff[1000000];
static char buff2[64];
diff --git a/libarchive/test/test_write_filter_uuencode.c b/libarchive/test/test_write_filter_uuencode.c
index 57a4b49bd2a6..7eda278b35cd 100644
--- a/libarchive/test/test_write_filter_uuencode.c
+++ b/libarchive/test/test_write_filter_uuencode.c
@@ -25,7 +25,6 @@
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
/*
* A basic exercise of uuencode reading and writing.
@@ -64,7 +63,7 @@ DEFINE_TEST(test_write_filter_uuencode)
assert((ae = archive_entry_new()) != NULL);
archive_entry_set_filetype(ae, AE_IFREG);
archive_entry_set_size(ae, datasize);
- sprintf(path, "file%03d", i);
+ snprintf(path, sizeof(path), "file%03d", i);
archive_entry_copy_pathname(ae, path);
assertEqualIntA(a, ARCHIVE_OK, archive_write_header(a, ae));
assertA(datasize
@@ -79,7 +78,7 @@ DEFINE_TEST(test_write_filter_uuencode)
assertEqualIntA(a, ARCHIVE_OK, archive_read_support_filter_all(a));
assertEqualIntA(a, ARCHIVE_OK, archive_read_open_memory(a, buff, used1));
for (i = 0; i < 99; i++) {
- sprintf(path, "file%03d", i);
+ snprintf(path, sizeof(path), "file%03d", i);
if (!assertEqualIntA(a, 0, archive_read_next_header(a, &ae)))
break;
assertEqualString(path, archive_entry_pathname(ae));
@@ -111,7 +110,7 @@ DEFINE_TEST(test_write_filter_uuencode)
assertEqualIntA(a, ARCHIVE_OK,
archive_write_open_memory(a, buff, buffsize, &used2));
for (i = 0; i < 99; i++) {
- sprintf(path, "file%03d", i);
+ snprintf(path, sizeof(path), "file%03d", i);
assert((ae = archive_entry_new()) != NULL);
archive_entry_copy_pathname(ae, path);
archive_entry_set_size(ae, datasize);
@@ -128,7 +127,7 @@ DEFINE_TEST(test_write_filter_uuencode)
assertEqualIntA(a, ARCHIVE_OK, archive_read_support_filter_all(a));
assertEqualIntA(a, ARCHIVE_OK, archive_read_open_memory(a, buff, used2));
for (i = 0; i < 99; i++) {
- sprintf(path, "file%03d", i);
+ snprintf(path, sizeof(path), "file%03d", i);
if (!assertEqualInt(0, archive_read_next_header(a, &ae)))
break;
assertEqualString(path, archive_entry_pathname(ae));
diff --git a/libarchive/test/test_write_filter_xz.c b/libarchive/test/test_write_filter_xz.c
index bf1265c65b6f..db4e5dafa274 100644
--- a/libarchive/test/test_write_filter_xz.c
+++ b/libarchive/test/test_write_filter_xz.c
@@ -25,7 +25,6 @@
*/
#include "test.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/test/test_write_compress_xz.c 191183 2009-04-17 01:06:31Z kientzle $");
/*
* A basic exercise of xz reading and writing.
@@ -80,7 +79,7 @@ DEFINE_TEST(test_write_filter_xz)
archive_entry_set_filetype(ae, AE_IFREG);
archive_entry_set_size(ae, datasize);
for (i = 0; i < 100; i++) {
- sprintf(path, "file%03d", i);
+ snprintf(path, sizeof(path), "file%03d", i);
archive_entry_copy_pathname(ae, path);
assertEqualIntA(a, ARCHIVE_OK, archive_write_header(a, ae));
assertA(datasize
@@ -102,7 +101,7 @@ DEFINE_TEST(test_write_filter_xz)
assertEqualIntA(a, ARCHIVE_OK,
archive_read_open_memory(a, buff, used1));
for (i = 0; i < 100; i++) {
- sprintf(path, "file%03d", i);
+ snprintf(path, sizeof(path), "file%03d", i);
if (!assertEqualInt(ARCHIVE_OK,
archive_read_next_header(a, &ae)))
break;
@@ -132,7 +131,7 @@ DEFINE_TEST(test_write_filter_xz)
archive_write_set_filter_option(a, NULL, "compression-level", "9"));
assertEqualIntA(a, ARCHIVE_OK, archive_write_open_memory(a, buff, buffsize, &used2));
for (i = 0; i < 100; i++) {
- sprintf(path, "file%03d", i);
+ snprintf(path, sizeof(path), "file%03d", i);
assert((ae = archive_entry_new()) != NULL);
archive_entry_copy_pathname(ae, path);
archive_entry_set_size(ae, datasize);
@@ -163,7 +162,7 @@ DEFINE_TEST(test_write_filter_xz)
assertEqualIntA(a, ARCHIVE_OK,
archive_read_open_memory(a, buff, used2));
for (i = 0; i < 100; i++) {
- sprintf(path, "file%03d", i);
+ snprintf(path, sizeof(path), "file%03d", i);
failure("Trying to read %s", path);
if (!assertEqualIntA(a, ARCHIVE_OK,
archive_read_next_header(a, &ae)))
@@ -187,7 +186,7 @@ DEFINE_TEST(test_write_filter_xz)
archive_write_set_filter_option(a, NULL, "compression-level", "0"));
assertEqualIntA(a, ARCHIVE_OK, archive_write_open_memory(a, buff, buffsize, &used2));
for (i = 0; i < 100; i++) {
- sprintf(path, "file%03d", i);
+ snprintf(path, sizeof(path), "file%03d", i);
assert((ae = archive_entry_new()) != NULL);
archive_entry_copy_pathname(ae, path);
archive_entry_set_size(ae, datasize);
@@ -220,7 +219,7 @@ DEFINE_TEST(test_write_filter_xz)
assertEqualIntA(a, ARCHIVE_OK,
archive_read_open_memory(a, buff, used2));
for (i = 0; i < 100; i++) {
- sprintf(path, "file%03d", i);
+ snprintf(path, sizeof(path), "file%03d", i);
if (!assertEqualInt(ARCHIVE_OK,
archive_read_next_header(a, &ae)))
break;
diff --git a/libarchive/test/test_write_filter_zstd.c b/libarchive/test/test_write_filter_zstd.c
index 6601e6aaf898..da711f9e4bf9 100644
--- a/libarchive/test/test_write_filter_zstd.c
+++ b/libarchive/test/test_write_filter_zstd.c
@@ -25,7 +25,6 @@
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
DEFINE_TEST(test_write_filter_zstd)
{
@@ -74,7 +73,7 @@ DEFINE_TEST(test_write_filter_zstd)
archive_entry_set_filetype(ae, AE_IFREG);
archive_entry_set_size(ae, datasize);
for (i = 0; i < 100; i++) {
- sprintf(path, "file%03d", i);
+ snprintf(path, sizeof(path), "file%03d", i);
archive_entry_copy_pathname(ae, path);
assertEqualIntA(a, ARCHIVE_OK, archive_write_header(a, ae));
assertA(datasize
@@ -96,7 +95,7 @@ DEFINE_TEST(test_write_filter_zstd)
assertEqualIntA(a, ARCHIVE_OK,
archive_read_open_memory(a, buff, used1));
for (i = 0; i < 100; i++) {
- sprintf(path, "file%03d", i);
+ snprintf(path, sizeof(path), "file%03d", i);
if (!assertEqualInt(ARCHIVE_OK,
archive_read_next_header(a, &ae)))
break;
@@ -133,9 +132,116 @@ DEFINE_TEST(test_write_filter_zstd)
archive_write_set_filter_option(a, NULL, "threads", "-1")); /* negative */
assertEqualIntA(a, ARCHIVE_OK,
archive_write_set_filter_option(a, NULL, "threads", "4"));
+#if HAVE_ZSTD_H && HAVE_ZSTD_compressStream
+ /* frame-per-file: boolean */
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_write_set_filter_option(a, NULL, "frame-per-file", ""));
+ /* min-frame-in: >= 0 */
+ assertEqualIntA(a, ARCHIVE_FAILED,
+ archive_write_set_filter_option(a, NULL, "min-frame-out", ""));
+ assertEqualIntA(a, ARCHIVE_FAILED,
+ archive_write_set_filter_option(a, NULL, "min-frame-out", "-1"));
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_write_set_filter_option(a, NULL, "min-frame-out", "0"));
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_write_set_filter_option(a, NULL, "min-frame-out", "1048576"));
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_write_set_filter_option(a, NULL, "min-frame-out", "1k"));
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_write_set_filter_option(a, NULL, "min-frame-out", "1kB"));
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_write_set_filter_option(a, NULL, "min-frame-out", "1M"));
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_write_set_filter_option(a, NULL, "min-frame-out", "1MB"));
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_write_set_filter_option(a, NULL, "min-frame-out", "1G"));
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_write_set_filter_option(a, NULL, "min-frame-out", "1GB"));
+ /* min-frame-out: >= 0 */
+ assertEqualIntA(a, ARCHIVE_FAILED,
+ archive_write_set_filter_option(a, NULL, "min-frame-in", ""));
+ assertEqualIntA(a, ARCHIVE_FAILED,
+ archive_write_set_filter_option(a, NULL, "min-frame-in", "-1"));
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_write_set_filter_option(a, NULL, "min-frame-in", "0"));
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_write_set_filter_option(a, NULL, "min-frame-in", "1048576"));
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_write_set_filter_option(a, NULL, "min-frame-in", "1k"));
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_write_set_filter_option(a, NULL, "min-frame-in", "1kB"));
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_write_set_filter_option(a, NULL, "min-frame-in", "1M"));
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_write_set_filter_option(a, NULL, "min-frame-in", "1MB"));
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_write_set_filter_option(a, NULL, "min-frame-in", "1G"));
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_write_set_filter_option(a, NULL, "min-frame-in", "1GB"));
+ /* max-frame-in: >= 1024 */
+ assertEqualIntA(a, ARCHIVE_FAILED,
+ archive_write_set_filter_option(a, NULL, "max-frame-in", ""));
+ assertEqualIntA(a, ARCHIVE_FAILED,
+ archive_write_set_filter_option(a, NULL, "max-frame-in", "-1"));
+ assertEqualIntA(a, ARCHIVE_FAILED,
+ archive_write_set_filter_option(a, NULL, "max-frame-in", "0"));
+ assertEqualIntA(a, ARCHIVE_FAILED,
+ archive_write_set_filter_option(a, NULL, "max-frame-in", "1023"));
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_write_set_filter_option(a, NULL, "max-frame-in", "1024"));
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_write_set_filter_option(a, NULL, "max-frame-in", "1048576"));
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_write_set_filter_option(a, NULL, "max-frame-in", "1k"));
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_write_set_filter_option(a, NULL, "max-frame-in", "1kB"));
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_write_set_filter_option(a, NULL, "max-frame-in", "1M"));
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_write_set_filter_option(a, NULL, "max-frame-in", "1MB"));
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_write_set_filter_option(a, NULL, "max-frame-in", "1G"));
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_write_set_filter_option(a, NULL, "max-frame-in", "1GB"));
+ /* max-frame-out: >= 1024 */
+ assertEqualIntA(a, ARCHIVE_FAILED,
+ archive_write_set_filter_option(a, NULL, "max-frame-out", ""));
+ assertEqualIntA(a, ARCHIVE_FAILED,
+ archive_write_set_filter_option(a, NULL, "max-frame-out", "-1"));
+ assertEqualIntA(a, ARCHIVE_FAILED,
+ archive_write_set_filter_option(a, NULL, "max-frame-out", "0"));
+ assertEqualIntA(a, ARCHIVE_FAILED,
+ archive_write_set_filter_option(a, NULL, "max-frame-out", "1023"));
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_write_set_filter_option(a, NULL, "max-frame-out", "1024"));
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_write_set_filter_option(a, NULL, "max-frame-out", "1048576"));
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_write_set_filter_option(a, NULL, "max-frame-out", "1k"));
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_write_set_filter_option(a, NULL, "max-frame-out", "1kB"));
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_write_set_filter_option(a, NULL, "max-frame-out", "1M"));
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_write_set_filter_option(a, NULL, "max-frame-out", "1MB"));
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_write_set_filter_option(a, NULL, "max-frame-out", "1G"));
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_write_set_filter_option(a, NULL, "max-frame-out", "1GB"));
+#endif
+#if ZSTD_VERSION_NUMBER >= MINVER_LONG
+ if ((int)(sizeof(size_t) == 4))
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_write_set_filter_option(a, NULL, "long", "26"));
+ else
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_write_set_filter_option(a, NULL, "long", "27"));
+ assertEqualIntA(a, ARCHIVE_FAILED,
+ archive_write_set_filter_option(a, NULL, "long", "-1")); /* negative */
+#endif
assertEqualIntA(a, ARCHIVE_OK, archive_write_open_memory(a, buff, buffsize, &used2));
for (i = 0; i < 100; i++) {
- sprintf(path, "file%03d", i);
+ snprintf(path, sizeof(path), "file%03d", i);
assert((ae = archive_entry_new()) != NULL);
archive_entry_copy_pathname(ae, path);
archive_entry_set_size(ae, datasize);
@@ -158,7 +264,7 @@ DEFINE_TEST(test_write_filter_zstd)
assertEqualIntA(a, ARCHIVE_OK,
archive_read_open_memory(a, buff, used2));
for (i = 0; i < 100; i++) {
- sprintf(path, "file%03d", i);
+ snprintf(path, sizeof(path), "file%03d", i);
failure("Trying to read %s", path);
if (!assertEqualIntA(a, ARCHIVE_OK,
archive_read_next_header(a, &ae)))
@@ -185,7 +291,7 @@ DEFINE_TEST(test_write_filter_zstd)
archive_entry_set_filetype(ae, AE_IFREG);
archive_entry_set_size(ae, datasize);
for (i = 0; i < 100; i++) {
- sprintf(path, "file%03d", i);
+ snprintf(path, sizeof(path), "file%03d", i);
archive_entry_copy_pathname(ae, path);
assertEqualIntA(a, ARCHIVE_OK, archive_write_header(a, ae));
assertA(datasize == (size_t)archive_write_data(a, data, datasize));
@@ -205,7 +311,7 @@ DEFINE_TEST(test_write_filter_zstd)
assertEqualIntA(a, ARCHIVE_OK,
archive_read_open_memory(a, buff, used3));
for (i = 0; i < 100; i++) {
- sprintf(path, "file%03d", i);
+ snprintf(path, sizeof(path), "file%03d", i);
failure("Trying to read %s", path);
if (!assertEqualIntA(a, ARCHIVE_OK,
archive_read_next_header(a, &ae)))
diff --git a/libarchive/test/test_write_format_7zip.c b/libarchive/test/test_write_format_7zip.c
index c8fdcd02cc84..d91e88d8f40f 100644
--- a/libarchive/test/test_write_format_7zip.c
+++ b/libarchive/test/test_write_format_7zip.c
@@ -25,7 +25,6 @@
#include "test.h"
-__FBSDID("$FreeBSD$");
static void
test_basic(const char *compression_type)
diff --git a/libarchive/test/test_write_format_7zip_empty.c b/libarchive/test/test_write_format_7zip_empty.c
index 9a503e9d6bac..817009f4355b 100644
--- a/libarchive/test/test_write_format_7zip_empty.c
+++ b/libarchive/test/test_write_format_7zip_empty.c
@@ -25,7 +25,6 @@
#include "test.h"
-__FBSDID("$FreeBSD$");
/*
* Test writing an empty archive.
diff --git a/libarchive/test/test_write_format_7zip_large.c b/libarchive/test/test_write_format_7zip_large.c
index b7a90d187bae..ac2fa08b4125 100644
--- a/libarchive/test/test_write_format_7zip_large.c
+++ b/libarchive/test/test_write_format_7zip_large.c
@@ -25,7 +25,6 @@
#include "test.h"
-__FBSDID("$FreeBSD$");
#define LARGE_SIZE (1*1024*1024)
static void
diff --git a/libarchive/test/test_write_format_ar.c b/libarchive/test/test_write_format_ar.c
index 058d3b17875c..9c6cd5ecdb05 100644
--- a/libarchive/test/test_write_format_ar.c
+++ b/libarchive/test/test_write_format_ar.c
@@ -26,7 +26,6 @@
*/
#include "test.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/test/test_write_format_ar.c 189308 2009-03-03 17:02:51Z kientzle $");
static char buff[4096];
static char buff2[64];
diff --git a/libarchive/test/test_write_format_cpio.c b/libarchive/test/test_write_format_cpio.c
index d5df8a8ce108..827cad3590c4 100644
--- a/libarchive/test/test_write_format_cpio.c
+++ b/libarchive/test/test_write_format_cpio.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/test/test_write_format_cpio.c 185672 2008-12-06 06:02:26Z kientzle $");
static void
test_format(int (*set_format)(struct archive *))
diff --git a/libarchive/test/test_write_format_cpio_empty.c b/libarchive/test/test_write_format_cpio_empty.c
index 3ca5c395e33c..22682235fca3 100644
--- a/libarchive/test/test_write_format_cpio_empty.c
+++ b/libarchive/test/test_write_format_cpio_empty.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/test/test_write_format_cpio_empty.c 201247 2009-12-30 05:59:21Z kientzle $");
/*
* Check that an "empty" cpio archive is correctly created.
diff --git a/libarchive/test/test_write_format_cpio_newc.c b/libarchive/test/test_write_format_cpio_newc.c
index 48b0b2646472..786b5d739b4d 100644
--- a/libarchive/test/test_write_format_cpio_newc.c
+++ b/libarchive/test/test_write_format_cpio_newc.c
@@ -23,8 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/test/test_write_format_cpio_newc.c 201247 2009-12-30 05:59:21Z kientzle $");
-
static int
is_hex(const char *p, size_t l)
diff --git a/libarchive/test/test_write_format_cpio_odc.c b/libarchive/test/test_write_format_cpio_odc.c
index aefb42ea872f..c763fcd2520c 100644
--- a/libarchive/test/test_write_format_cpio_odc.c
+++ b/libarchive/test/test_write_format_cpio_odc.c
@@ -23,8 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/test/test_write_format_cpio_odc.c 201247 2009-12-30 05:59:21Z kientzle $");
-
static int
is_octal(const char *p, size_t l)
diff --git a/libarchive/test/test_write_format_gnutar.c b/libarchive/test/test_write_format_gnutar.c
index 2a4c383e7aff..d72d076d115c 100644
--- a/libarchive/test/test_write_format_gnutar.c
+++ b/libarchive/test/test_write_format_gnutar.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
static char buff2[64];
diff --git a/libarchive/test/test_write_format_gnutar_filenames.c b/libarchive/test/test_write_format_gnutar_filenames.c
index 655e998ed827..aae5a2a6f787 100644
--- a/libarchive/test/test_write_format_gnutar_filenames.c
+++ b/libarchive/test/test_write_format_gnutar_filenames.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
/*
* Inspired by Github issue #682, which reported that gnutar filenames
diff --git a/libarchive/test/test_write_format_iso9660.c b/libarchive/test/test_write_format_iso9660.c
index e4e98bb95c29..7b455794c5de 100644
--- a/libarchive/test/test_write_format_iso9660.c
+++ b/libarchive/test/test_write_format_iso9660.c
@@ -24,7 +24,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
static char buff2[64];
DEFINE_TEST(test_write_format_iso9660)
@@ -385,14 +384,14 @@ DEFINE_TEST(test_write_format_iso9660)
assertEqualInt(2048, archive_entry_size(ae));
/*
- * Read "hardlnk"
+ * Read "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("hardlnk", archive_entry_pathname(ae));
+ assertEqualString("file", archive_entry_pathname(ae));
assert((AE_IFREG | 0555) == archive_entry_mode(ae));
assertEqualInt(2, archive_entry_nlink(ae));
assertEqualInt(8, archive_entry_size(ae));
@@ -400,15 +399,15 @@ DEFINE_TEST(test_write_format_iso9660)
assertEqualMem(buff2, "12345678", 8);
/*
- * Read "file"
+ * Read "hardlnk"
*/
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("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 | 0555) == archive_entry_mode(ae));
assertEqualInt(2, archive_entry_nlink(ae));
assertEqualInt(0, archive_entry_size(ae));
@@ -982,13 +981,13 @@ DEFINE_TEST(test_write_format_iso9660)
assertEqualInt(2048, archive_entry_size(ae));
/*
- * Read "hardlink"
+ * 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("HARDLNK", archive_entry_pathname(ae));
+ assertEqualString("FILE", archive_entry_pathname(ae));
assertEqualString(NULL, archive_entry_hardlink(ae));
assert((AE_IFREG | 0400) == archive_entry_mode(ae));
assertEqualInt(8, archive_entry_size(ae));
@@ -996,15 +995,15 @@ DEFINE_TEST(test_write_format_iso9660)
assertEqualMem(buff2, "12345678", 8);
/*
- * Read "file"
+ * Read "hardlnk"
*/
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_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));
diff --git a/libarchive/test/test_write_format_mtree.c b/libarchive/test/test_write_format_mtree.c
index 5109e0920b4d..ed065f9c1340 100644
--- a/libarchive/test/test_write_format_mtree.c
+++ b/libarchive/test/test_write_format_mtree.c
@@ -25,7 +25,6 @@
*/
#include "test.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/test/test_write_format_mtree.c 191183 2009-04-17 01:06:31Z kientzle $");
static char buff[4096];
static struct {
diff --git a/libarchive/test/test_write_format_mtree_absolute_path.c b/libarchive/test/test_write_format_mtree_absolute_path.c
index e3972f1f1135..0ad73792add1 100644
--- a/libarchive/test/test_write_format_mtree_absolute_path.c
+++ b/libarchive/test/test_write_format_mtree_absolute_path.c
@@ -25,7 +25,6 @@
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
static char buff[4096];
diff --git a/libarchive/test/test_write_format_mtree_classic.c b/libarchive/test/test_write_format_mtree_classic.c
index 9a75fdd71f52..f155df591895 100644
--- a/libarchive/test/test_write_format_mtree_classic.c
+++ b/libarchive/test/test_write_format_mtree_classic.c
@@ -25,7 +25,6 @@
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
static char buff[4096];
static struct {
diff --git a/libarchive/test/test_write_format_mtree_classic_indent.c b/libarchive/test/test_write_format_mtree_classic_indent.c
index 6d1c54911558..187cc2be0e4b 100644
--- a/libarchive/test/test_write_format_mtree_classic_indent.c
+++ b/libarchive/test/test_write_format_mtree_classic_indent.c
@@ -25,7 +25,6 @@
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
static char buff[4096];
static struct {
diff --git a/libarchive/test/test_write_format_mtree_fflags.c b/libarchive/test/test_write_format_mtree_fflags.c
index 820d86f70b3d..42a1d6522d7f 100644
--- a/libarchive/test/test_write_format_mtree_fflags.c
+++ b/libarchive/test/test_write_format_mtree_fflags.c
@@ -25,7 +25,7 @@
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
+
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
diff --git a/libarchive/test/test_write_format_mtree_no_separator.c b/libarchive/test/test_write_format_mtree_no_separator.c
index faf42dd5245b..c7b64c1ba6a7 100644
--- a/libarchive/test/test_write_format_mtree_no_separator.c
+++ b/libarchive/test/test_write_format_mtree_no_separator.c
@@ -25,7 +25,7 @@
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
+
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
diff --git a/libarchive/test/test_write_format_mtree_quoted_filename.c b/libarchive/test/test_write_format_mtree_quoted_filename.c
index 63e927a81ffe..aca904c83f56 100644
--- a/libarchive/test/test_write_format_mtree_quoted_filename.c
+++ b/libarchive/test/test_write_format_mtree_quoted_filename.c
@@ -25,7 +25,6 @@
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
static char buff[4096];
diff --git a/libarchive/test/test_write_format_pax.c b/libarchive/test/test_write_format_pax.c
index 4538aac8241d..625a3742c044 100644
--- a/libarchive/test/test_write_format_pax.c
+++ b/libarchive/test/test_write_format_pax.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
static char buff2[64];
diff --git a/libarchive/test/test_write_format_shar_empty.c b/libarchive/test/test_write_format_shar_empty.c
index 13794b02bb06..b4dbce957523 100644
--- a/libarchive/test/test_write_format_shar_empty.c
+++ b/libarchive/test/test_write_format_shar_empty.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: src/lib/libarchive/test/test_write_format_shar_empty.c,v 1.3 2008/09/01 05:38:33 kientzle Exp $");
/*
* Check that an "empty" shar archive is correctly created as an empty file.
diff --git a/libarchive/test/test_write_format_tar.c b/libarchive/test/test_write_format_tar.c
index a5ccdc0115bf..631bfa4ed639 100644
--- a/libarchive/test/test_write_format_tar.c
+++ b/libarchive/test/test_write_format_tar.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/test/test_write_format_tar.c 189308 2009-03-03 17:02:51Z kientzle $");
static char buff[1000000];
static char buff2[64];
diff --git a/libarchive/test/test_write_format_tar_empty.c b/libarchive/test/test_write_format_tar_empty.c
index 7ccd435f1233..29912f3b2821 100644
--- a/libarchive/test/test_write_format_tar_empty.c
+++ b/libarchive/test/test_write_format_tar_empty.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/test/test_write_format_tar_empty.c 189308 2009-03-03 17:02:51Z kientzle $");
/*
* Check that an "empty" tar archive is correctly created.
diff --git a/libarchive/test/test_write_format_tar_sparse.c b/libarchive/test/test_write_format_tar_sparse.c
index 54ac00988e3d..1568b0eadc29 100644
--- a/libarchive/test/test_write_format_tar_sparse.c
+++ b/libarchive/test/test_write_format_tar_sparse.c
@@ -24,7 +24,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
static char buff[1000000];
diff --git a/libarchive/test/test_write_format_tar_ustar.c b/libarchive/test/test_write_format_tar_ustar.c
index 7bc38f7b57fd..d86749fd41b0 100644
--- a/libarchive/test/test_write_format_tar_ustar.c
+++ b/libarchive/test/test_write_format_tar_ustar.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/test/test_write_format_tar_ustar.c 201247 2009-12-30 05:59:21Z kientzle $");
static int
is_null(const char *p, size_t l)
diff --git a/libarchive/test/test_write_format_tar_v7tar.c b/libarchive/test/test_write_format_tar_v7tar.c
index 16909956878b..5fa5f4e21f29 100644
--- a/libarchive/test/test_write_format_tar_v7tar.c
+++ b/libarchive/test/test_write_format_tar_v7tar.c
@@ -24,7 +24,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
static int
is_null(const char *p, size_t l)
diff --git a/libarchive/test/test_write_format_warc.c b/libarchive/test/test_write_format_warc.c
index 3a4c2da1edf1..bb9f2388095b 100644
--- a/libarchive/test/test_write_format_warc.c
+++ b/libarchive/test/test_write_format_warc.c
@@ -24,7 +24,6 @@
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
static void test_read(struct archive *a, char *buff, size_t used, char *filedata)
{
diff --git a/libarchive/test/test_write_format_warc_empty.c b/libarchive/test/test_write_format_warc_empty.c
index 0bd31bd7f8cb..d66e85d33e68 100644
--- a/libarchive/test/test_write_format_warc_empty.c
+++ b/libarchive/test/test_write_format_warc_empty.c
@@ -24,7 +24,6 @@
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
DEFINE_TEST(test_write_format_warc_empty)
{
diff --git a/libarchive/test/test_write_format_xar.c b/libarchive/test/test_write_format_xar.c
index 02fd2c0e35a7..f1f3032912a7 100644
--- a/libarchive/test/test_write_format_xar.c
+++ b/libarchive/test/test_write_format_xar.c
@@ -24,7 +24,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
static void
test_xar(const char *option)
diff --git a/libarchive/test/test_write_format_xar_empty.c b/libarchive/test/test_write_format_xar_empty.c
index 97c080887e40..b3ba6994e9c9 100644
--- a/libarchive/test/test_write_format_xar_empty.c
+++ b/libarchive/test/test_write_format_xar_empty.c
@@ -29,7 +29,6 @@
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
DEFINE_TEST(test_write_format_xar_empty)
{
diff --git a/libarchive/test/test_write_format_zip.c b/libarchive/test/test_write_format_zip.c
index a7ca434f8ea9..54240eeb7afe 100644
--- a/libarchive/test/test_write_format_zip.c
+++ b/libarchive/test/test_write_format_zip.c
@@ -30,7 +30,6 @@
*/
#include "test.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/test/test_write_format_zip.c 201247 2009-12-30 05:59:21Z kientzle $");
/*
* This test doesn't actually check that the zip writer is
@@ -290,9 +289,11 @@ verify_contents(struct archive *a, int seeking, int content)
assertEqualString("file", archive_entry_pathname(ae));
if (seeking) {
assertEqualInt(AE_IFREG | 0755, archive_entry_mode(ae));
+ assert(archive_entry_size_is_set(ae));
+ assertEqualInt(8, archive_entry_size(ae));
+ } else {
+ assertEqualInt(0, archive_entry_size_is_set(ae));
}
- assert(archive_entry_size_is_set(ae));
- assertEqualInt(8, archive_entry_size(ae));
if (content) {
assertEqualIntA(a, 8,
archive_read_data(a, filedata, sizeof(filedata)));
@@ -308,9 +309,11 @@ verify_contents(struct archive *a, int seeking, int content)
assertEqualString("file2", archive_entry_pathname(ae));
if (seeking) {
assertEqualInt(AE_IFREG | 0755, archive_entry_mode(ae));
+ assertEqualInt(4, archive_entry_size(ae));
+ assert(archive_entry_size_is_set(ae));
+ } else {
+ assertEqualInt(0, archive_entry_size_is_set(ae));
}
- assertEqualInt(4, archive_entry_size(ae));
- assert(archive_entry_size_is_set(ae));
if (content) {
assertEqualIntA(a, 4,
archive_read_data(a, filedata, sizeof(filedata)));
@@ -374,10 +377,13 @@ verify_contents(struct archive *a, int seeking, int content)
assertEqualInt(0, archive_entry_atime(ae));
assertEqualInt(0, archive_entry_ctime(ae));
assertEqualString("file_deflate", archive_entry_pathname(ae));
- if (seeking)
+ if (seeking) {
assertEqualInt(AE_IFREG | 0755, archive_entry_mode(ae));
- assertEqualInt(8, archive_entry_size(ae));
- assert(archive_entry_size_is_set(ae));
+ assertEqualInt(8, archive_entry_size(ae));
+ assert(archive_entry_size_is_set(ae));
+ } else {
+ assertEqualInt(0, archive_entry_size_is_set(ae));
+ }
if (content) {
assertEqualIntA(a, 8,
archive_read_data(a, filedata, sizeof(filedata)));
@@ -392,10 +398,13 @@ verify_contents(struct archive *a, int seeking, int content)
assertEqualInt(0, archive_entry_atime(ae));
assertEqualInt(0, archive_entry_ctime(ae));
assertEqualString("file2_deflate", archive_entry_pathname(ae));
- if (seeking)
+ if (seeking) {
assertEqualInt(AE_IFREG | 0755, archive_entry_mode(ae));
- assertEqualInt(4, archive_entry_size(ae));
- assert(archive_entry_size_is_set(ae));
+ assertEqualInt(4, archive_entry_size(ae));
+ assert(archive_entry_size_is_set(ae));
+ } else {
+ assertEqualInt(0, archive_entry_size_is_set(ae));
+ }
if (content) {
assertEqualIntA(a, 4,
archive_read_data(a, filedata, sizeof(filedata)));
@@ -410,6 +419,7 @@ verify_contents(struct archive *a, int seeking, int content)
assertEqualInt(0, archive_entry_ctime(ae));
assertEqualString("file3_deflate", archive_entry_pathname(ae));
if (seeking) {
+ assert(archive_entry_size_is_set(ae));
assertEqualInt(5, archive_entry_size(ae));
assertEqualInt(AE_IFREG | 0621, archive_entry_mode(ae));
} else {
@@ -460,10 +470,13 @@ verify_contents(struct archive *a, int seeking, int content)
assertEqualInt(0, archive_entry_atime(ae));
assertEqualInt(0, archive_entry_ctime(ae));
assertEqualString("file_stored", archive_entry_pathname(ae));
- if (seeking)
+ if (seeking) {
assertEqualInt(AE_IFREG | 0755, archive_entry_mode(ae));
- assert(archive_entry_size_is_set(ae));
- assertEqualInt(8, archive_entry_size(ae));
+ assert(archive_entry_size_is_set(ae));
+ assertEqualInt(8, archive_entry_size(ae));
+ } else {
+ assertEqualInt(0, archive_entry_size_is_set(ae));
+ }
if (content) {
assertEqualIntA(a, 8,
archive_read_data(a, filedata, sizeof(filedata)));
@@ -478,10 +491,13 @@ verify_contents(struct archive *a, int seeking, int content)
assertEqualInt(0, archive_entry_atime(ae));
assertEqualInt(0, archive_entry_ctime(ae));
assertEqualString("file2_stored", archive_entry_pathname(ae));
- if (seeking)
+ if (seeking) {
assertEqualInt(AE_IFREG | 0755, archive_entry_mode(ae));
- assertEqualInt(4, archive_entry_size(ae));
- assert(archive_entry_size_is_set(ae));
+ assertEqualInt(4, archive_entry_size(ae));
+ assert(archive_entry_size_is_set(ae));
+ } else {
+ assertEqualInt(0, archive_entry_size_is_set(ae));
+ }
if (content) {
assertEqualIntA(a, 4,
archive_read_data(a, filedata, sizeof(filedata)));
diff --git a/libarchive/test/test_write_format_zip64_stream.c b/libarchive/test/test_write_format_zip64_stream.c
new file mode 100644
index 000000000000..bed97894e8da
--- /dev/null
+++ b/libarchive/test/test_write_format_zip64_stream.c
@@ -0,0 +1,276 @@
+/*-
+ * Copyright (c) 2003-2023 Tim Kientzle
+ * Copyright (c) 2008 Anselm Strauss
+ * 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"
+
+/*
+ * Detailed byte-for-byte verification of the format of a zip archive
+ * written in streaming mode with Zip64 extensions enabled.
+ */
+
+static unsigned long
+bitcrc32(unsigned long c, void *_p, size_t s)
+{
+ /* This is a drop-in replacement for crc32() from zlib.
+ * Libarchive should be able to correctly generate
+ * uncompressed zip archives (including correct CRCs) even
+ * when zlib is unavailable, and this function helps us verify
+ * that. Yes, this is very, very slow and unsuitable for
+ * production use, but it's correct, compact, and works well
+ * enough for this particular usage. Libarchive internally
+ * uses a much more efficient implementation. */
+ const unsigned char *p = _p;
+ int bitctr;
+
+ if (p == NULL)
+ return (0);
+
+ for (; s > 0; --s) {
+ c ^= *p++;
+ for (bitctr = 8; bitctr > 0; --bitctr) {
+ if (c & 1) c = (c >> 1);
+ else c = (c >> 1) ^ 0xedb88320;
+ c ^= 0x80000000;
+ }
+ }
+ return (c);
+}
+
+/* Quick and dirty: Read 2-byte and 4-byte integers from Zip file. */
+static unsigned i2(const unsigned char *p) { return ((p[0] & 0xff) | ((p[1] & 0xff) << 8)); }
+static unsigned i4(const unsigned char *p) { return (i2(p) | (i2(p + 2) << 16)); }
+/* We're only working with small values here; ignore the 4 high bytes. */
+static unsigned i8(const unsigned char *p) { return (i4(p)); }
+
+DEFINE_TEST(test_write_format_zip64_stream)
+{
+ struct archive *a;
+ struct archive_entry *ae;
+ size_t used, buffsize = 1000000;
+ unsigned long crc;
+ unsigned long compressed_size = 0;
+ int file_perm = 00644;
+ int zip_version = 45;
+ int zip_compression = 8;
+ short file_uid = 10, file_gid = 20;
+ unsigned char *buff, *buffend, *p;
+ unsigned char *central_header, *local_header, *eocd, *eocd_record;
+ unsigned char *extension_start, *extension_end;
+ unsigned char *data_start, *data_end;
+ char file_data[] = {'1', '2', '3', '4', '5', '6', '7', '8'};
+ const char *file_name = "file";
+
+#ifndef HAVE_ZLIB_H
+ zip_compression = 0;
+#endif
+
+ buff = malloc(buffsize);
+
+ /* Create a new archive in memory. */
+ assert((a = archive_write_new()) != NULL);
+ assertEqualIntA(a, ARCHIVE_OK, archive_write_set_format_zip(a));
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_write_set_options(a, "zip:zip64"));
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_write_set_options(a, "zip:experimental"));
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_write_open_memory(a, buff, buffsize, &used));
+
+ assert((ae = archive_entry_new()) != NULL);
+ archive_entry_copy_pathname(ae, file_name);
+ archive_entry_set_mode(ae, AE_IFREG | file_perm);
+ archive_entry_set_uid(ae, file_uid);
+ archive_entry_set_gid(ae, file_gid);
+ archive_entry_set_mtime(ae, 0, 0);
+ assertEqualInt(0, archive_write_header(a, ae));
+ archive_entry_free(ae);
+ assertEqualInt(8, archive_write_data(a, file_data, sizeof(file_data)));
+ assertEqualIntA(a, ARCHIVE_OK, archive_write_close(a));
+ assertEqualInt(ARCHIVE_OK, archive_write_free(a));
+ buffend = buff + used;
+ dumpfile("constructed.zip", buff, used);
+
+ /* Verify "End of Central Directory" record. */
+ /* Get address of end-of-central-directory record. */
+ eocd_record = p = buffend - 22; /* Assumes there is no zip comment field. */
+ failure("End-of-central-directory begins with PK\\005\\006 signature");
+ assertEqualMem(p, "PK\005\006", 4);
+ failure("This must be disk 0");
+ assertEqualInt(i2(p + 4), 0);
+ failure("Central dir must start on disk 0");
+ assertEqualInt(i2(p + 6), 0);
+ failure("All central dir entries are on this disk");
+ assertEqualInt(i2(p + 8), i2(p + 10));
+ eocd = buff + i4(p + 12) + i4(p + 16);
+ failure("no zip comment");
+ assertEqualInt(i2(p + 20), 0);
+
+ /* Get address of first entry in central directory. */
+ central_header = p = buff + i4(buffend - 6);
+ failure("Central file record at offset %d should begin with"
+ " PK\\001\\002 signature",
+ i4(buffend - 10));
+
+ /* Verify file entry in central directory. */
+ assertEqualMem(p, "PK\001\002", 4); /* Signature */
+ assertEqualInt(i2(p + 4), 3 * 256 + zip_version); /* Version made by */
+ assertEqualInt(i2(p + 6), zip_version); /* Version needed to extract */
+ assertEqualInt(i2(p + 8), 8); /* Flags */
+ assertEqualInt(i2(p + 10), zip_compression); /* Compression method */
+ assertEqualInt(i2(p + 12), 0); /* File time */
+ assertEqualInt(i2(p + 14), 33); /* File date */
+ crc = bitcrc32(0, file_data, sizeof(file_data));
+ assertEqualInt(i4(p + 16), crc); /* CRC-32 */
+ compressed_size = i4(p + 20); /* Compressed size */
+ assertEqualInt(i4(p + 24), sizeof(file_data)); /* Uncompressed size */
+ assertEqualInt(i2(p + 28), strlen(file_name)); /* Pathname length */
+ /* assertEqualInt(i2(p + 30), 28); */ /* Extra field length: See below */
+ assertEqualInt(i2(p + 32), 0); /* File comment length */
+ assertEqualInt(i2(p + 34), 0); /* Disk number start */
+ assertEqualInt(i2(p + 36), 0); /* Internal file attrs */
+ assertEqualInt(i4(p + 38) >> 16 & 01777, file_perm); /* External file attrs */
+ assertEqualInt(i4(p + 42), 0); /* Offset of local header */
+ assertEqualMem(p + 46, file_name, strlen(file_name)); /* Pathname */
+ p = extension_start = central_header + 46 + strlen(file_name);
+ extension_end = extension_start + i2(central_header + 30);
+
+ assertEqualInt(i2(p), 0x7875); /* 'ux' extension header */
+ assertEqualInt(i2(p + 2), 11); /* 'ux' size */
+ /* TODO: verify 'ux' contents */
+ p += 4 + i2(p + 2);
+
+ assertEqualInt(i2(p), 0x5455); /* 'UT' extension header */
+ assertEqualInt(i2(p + 2), 5); /* 'UT' size */
+ assertEqualInt(p[4], 1); /* 'UT' flags */
+ assertEqualInt(i4(p + 5), 0); /* 'UT' mtime */
+ p += 4 + i2(p + 2);
+
+ /* Note: We don't expect to see zip64 extension in the central
+ * directory, since the writer knows the actual full size by
+ * the time it is ready to write the central directory and has
+ * no reason to insert it then. Info-Zip seems to do the same
+ * thing. */
+
+ /* Just in case: Report any extra extensions. */
+ while (p < extension_end) {
+ failure("Unexpected extension 0x%04X", i2(p));
+ assert(0);
+ p += 4 + i2(p + 2);
+ }
+
+ /* Should have run exactly to end of extra data. */
+ assertEqualAddress(p, extension_end);
+
+ assertEqualAddress(p, eocd);
+
+ /* After Central dir, we find Zip64 eocd and Zip64 eocd locator. */
+ assertEqualMem(p, "PK\006\006", 4); /* Zip64 eocd */
+ assertEqualInt(i8(p + 4), 44); /* We're using v1 Zip64 eocd */
+ assertEqualInt(i2(p + 12), 45); /* Written by Version 4.5 */
+ assertEqualInt(i2(p + 14), 45); /* Needs version 4.5 to extract */
+ assertEqualInt(i4(p + 16), 0); /* This is disk #0 */
+ assertEqualInt(i4(p + 20), 0); /* Dir starts on disk #0 */
+ assertEqualInt(i8(p + 24), 1); /* 1 entry on this disk */
+ assertEqualInt(i8(p + 32), 1); /* 1 entry total */
+ assertEqualInt(i8(p + 40), eocd - central_header); /* size of cd */
+ assertEqualInt(i8(p + 48), central_header - buff); /* start of cd */
+ p += 12 + i8(p + 4);
+
+ assertEqualMem(p, "PK\006\007", 4); /* Zip64 eocd locator */
+ assertEqualInt(i4(p + 4), 0); /* Zip64 eocd is on disk #0 */
+ assertEqualInt(i8(p + 8), eocd - buff); /* Offset of Zip64 eocd */
+ assertEqualInt(i4(p + 16), 1); /* 1 disk */
+ p += 20;
+
+ /* Regular EOCD immediately follows Zip64 records. */
+ assertEqualAddress(p, eocd_record);
+
+ /* Verify local header of file entry. */
+ p = local_header = buff;
+ assertEqualMem(p, "PK\003\004", 4); /* Signature */
+ assertEqualInt(i2(p + 4), zip_version); /* Version needed to extract */
+ assertEqualInt(i2(p + 6), 8); /* Flags: bit 3 = length-at-end */
+ assertEqualInt(i2(p + 8), zip_compression); /* Compression method */
+ assertEqualInt(i2(p + 10), 0); /* File time */
+ assertEqualInt(i2(p + 12), 33); /* File date */
+ assertEqualInt(i4(p + 14), 0); /* CRC-32 */
+ assertEqualInt(i4(p + 18), 0); /* Compressed size must be zero for length-at-end */
+ assertEqualInt(i4(p + 22), 0); /* Uncompressed size must be zero for length-at-end */
+ assertEqualInt(i2(p + 26), strlen(file_name)); /* Pathname length */
+ assertEqualInt(i2(p + 28), 37); /* Extra field length */
+ assertEqualMem(p + 30, file_name, strlen(file_name)); /* Pathname */
+ p = extension_start = local_header + 30 + strlen(file_name);
+ extension_end = extension_start + i2(local_header + 28);
+
+ assertEqualInt(i2(p), 0x7875); /* 'ux' extension header */
+ assertEqualInt(i2(p + 2), 11); /* 'ux' size */
+ assertEqualInt(p[4], 1); /* 'ux' version */
+ assertEqualInt(p[5], 4); /* 'ux' uid size */
+ assertEqualInt(i4(p + 6), file_uid); /* 'Ux' UID */
+ assertEqualInt(p[10], 4); /* 'ux' gid size */
+ assertEqualInt(i4(p + 11), file_gid); /* 'Ux' GID */
+ p += 4 + i2(p + 2);
+
+ assertEqualInt(i2(p), 0x5455); /* 'UT' extension header */
+ assertEqualInt(i2(p + 2), 5); /* 'UT' size */
+ assertEqualInt(p[4], 1); /* 'UT' flags */
+ assertEqualInt(i4(p + 5), 0); /* 'UT' mtime */
+ p += 4 + i2(p + 2);
+
+ assertEqualInt(i2(p), 0x6c78); /* 'xl' experimental extension header */
+ assertEqualInt(i2(p + 2), 9); /* size */
+ assertEqualInt(p[4], 7); /* bitmap of included fields */
+ assertEqualInt(i2(p + 5) >> 8, 3); /* system & version made by */
+ assertEqualInt(i2(p + 7), 0); /* internal file attributes */
+ assertEqualInt(i4(p + 9) >> 16 & 01777, file_perm); /* external file attributes */
+ p += 4 + i2(p + 2);
+
+ /* Just in case: Report any extra extensions. */
+ while (p < extension_end) {
+ failure("Unexpected extension 0x%04X", i2(p));
+ assert(0);
+ p += 4 + i2(p + 2);
+ }
+
+ /* Should have run exactly to end of extra data. */
+ assertEqualAddress(p, extension_end);
+ data_start = p;
+
+ /* Data descriptor should follow compressed data. */
+ while (p < central_header && memcmp(p, "PK\007\010", 4) != 0)
+ ++p;
+ data_end = p;
+ assertEqualInt(data_end - data_start, compressed_size);
+ assertEqualMem(p, "PK\007\010", 4);
+ assertEqualInt(i4(p + 4), crc); /* CRC-32 */
+ assertEqualInt(i8(p + 8), compressed_size); /* compressed size */
+ assertEqualInt(i8(p + 16), sizeof(file_data)); /* uncompressed size */
+
+ /* Central directory should immediately follow the only entry. */
+ assertEqualAddress(p + 24, central_header);
+
+ free(buff);
+}
diff --git a/libarchive/test/test_write_format_zip_compression_store.c b/libarchive/test/test_write_format_zip_compression_store.c
index c969a41d4d41..fc764ac7af83 100644
--- a/libarchive/test/test_write_format_zip_compression_store.c
+++ b/libarchive/test/test_write_format_zip_compression_store.c
@@ -28,7 +28,6 @@
*/
#include "test.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/test/test_write_format_zip_no_compression.c 201247 2009-12-30 05:59:21Z kientzle $");
/* File data */
static const char file_name[] = "file";
@@ -128,12 +127,22 @@ static void verify_uncompressed_contents(const char *buff, size_t used)
/* Misc variables */
unsigned long crc;
- struct tm *tm = localtime(&now);
-
+ struct tm *tm;
+#if defined(HAVE_LOCALTIME_R) || defined(HAVE_LOCALTIME_S)
+ struct tm tmbuf;
+#endif
/* p is the pointer to walk over the central directory,
* q walks over the local headers, the data and the data descriptors. */
const char *p, *q, *local_header, *extra_start;
+#if defined(HAVE_LOCALTIME_S)
+ tm = localtime_s(&tmbuf, &now) ? NULL : &tmbuf;
+#elif defined(HAVE_LOCALTIME_R)
+ tm = localtime_r(&now, &tmbuf);
+#else
+ tm = localtime(&now);
+#endif
+
/* Remember the end of the archive in memory. */
buffend = buff + used;
@@ -174,7 +183,7 @@ static void verify_uncompressed_contents(const char *buff, size_t used)
assertEqualInt(i4(p + 20), sizeof(file_data1) + sizeof(file_data2)); /* Compressed size */
assertEqualInt(i4(p + 24), sizeof(file_data1) + sizeof(file_data2)); /* Uncompressed size */
assertEqualInt(i2(p + 28), strlen(file_name)); /* Pathname length */
- assertEqualInt(i2(p + 30), 28); /* Extra field length */
+ assertEqualInt(i2(p + 30), 24); /* Extra field length */
assertEqualInt(i2(p + 32), 0); /* File comment length */
assertEqualInt(i2(p + 34), 0); /* Disk number start */
assertEqualInt(i2(p + 36), 0); /* Internal file attrs */
@@ -182,38 +191,33 @@ static void verify_uncompressed_contents(const char *buff, size_t used)
assertEqualInt(i4(p + 42), 0); /* Offset of local header */
assertEqualMem(p + 46, file_name, strlen(file_name)); /* Pathname */
p = p + 46 + strlen(file_name);
- assertEqualInt(i2(p), 0x5455); /* 'UT' extension header */
- assertEqualInt(i2(p + 2), 9); /* 'UT' size */
- assertEqualInt(p[4], 3); /* 'UT' flags */
- assertEqualInt(i4(p + 5), now); /* 'UT' mtime */
- assertEqualInt(i4(p + 9), now + 3); /* 'UT' atime */
- p = p + 4 + i2(p + 2);
+
assertEqualInt(i2(p), 0x7875); /* 'ux' extension header */
assertEqualInt(i2(p + 2), 11); /* 'ux' size */
/* TODO */
p = p + 4 + i2(p + 2);
+ assertEqualInt(i2(p), 0x5455); /* 'UT' extension header */
+ assertEqualInt(i2(p + 2), 5); /* 'UT' size */
+ assertEqualInt(p[4], 1); /* 'UT' flags */
+ assertEqualInt(i4(p + 5), now); /* 'UT' mtime */
+ p = p + 4 + i2(p + 2);
+
/* Verify local header of file entry. */
local_header = q = buff;
assertEqualMem(q, "PK\003\004", 4); /* Signature */
assertEqualInt(i2(q + 4), 10); /* Version needed to extract */
- assertEqualInt(i2(q + 6), 8); /* Flags */
+ assertEqualInt(i2(q + 6), 8); /* Flags: bit 3 = length-at-end. Required because CRC32 is unknown */
assertEqualInt(i2(q + 8), 0); /* Compression method */
assertEqualInt(i2(q + 10), (tm->tm_hour * 2048) + (tm->tm_min * 32) + (tm->tm_sec / 2)); /* File time */
assertEqualInt(i2(q + 12), ((tm->tm_year - 80) * 512) + ((tm->tm_mon + 1) * 32) + tm->tm_mday); /* File date */
assertEqualInt(i4(q + 14), 0); /* CRC-32 */
- assertEqualInt(i4(q + 18), sizeof(file_data1) + sizeof(file_data2)); /* Compressed size */
- assertEqualInt(i4(q + 22), sizeof(file_data1) + sizeof(file_data2)); /* Uncompressed size */
+ assertEqualInt(i4(q + 18), 0); /* Compressed size, must be zero because of length-at-end */
+ assertEqualInt(i4(q + 22), 0); /* Uncompressed size, must be zero because of length-at-end */
assertEqualInt(i2(q + 26), strlen(file_name)); /* Pathname length */
assertEqualInt(i2(q + 28), 41); /* Extra field length */
assertEqualMem(q + 30, file_name, strlen(file_name)); /* Pathname */
extra_start = q = q + 30 + strlen(file_name);
- assertEqualInt(i2(q), 0x5455); /* 'UT' extension header */
- assertEqualInt(i2(q + 2), 9); /* 'UT' size */
- assertEqualInt(q[4], 3); /* 'UT' flags */
- assertEqualInt(i4(q + 5), now); /* 'UT' mtime */
- assertEqualInt(i4(q + 9), now + 3); /* 'UT' atime */
- q = q + 4 + i2(q + 2);
assertEqualInt(i2(q), 0x7875); /* 'ux' extension header */
assertEqualInt(i2(q + 2), 11); /* 'ux' size */
@@ -224,6 +228,13 @@ static void verify_uncompressed_contents(const char *buff, size_t used)
assertEqualInt(i4(q + 11), file_gid); /* 'Ux' GID */
q = q + 4 + i2(q + 2);
+ assertEqualInt(i2(q), 0x5455); /* 'UT' extension header */
+ assertEqualInt(i2(q + 2), 9); /* 'UT' size */
+ assertEqualInt(q[4], 3); /* 'UT' flags */
+ assertEqualInt(i4(q + 5), now); /* 'UT' mtime */
+ assertEqualInt(i4(q + 9), now + 3); /* 'UT' atime */
+ q = q + 4 + i2(q + 2);
+
assertEqualInt(i2(q), 0x6c78); /* 'xl' experimental extension header */
assertEqualInt(i2(q + 2), 9); /* size */
assertEqualInt(q[4], 7); /* Bitmap of fields included. */
@@ -260,7 +271,7 @@ static void verify_uncompressed_contents(const char *buff, size_t used)
assertEqualInt(i4(p + 20), 0); /* Compressed size */
assertEqualInt(i4(p + 24), 0); /* Uncompressed size */
assertEqualInt(i2(p + 28), strlen(folder_name)); /* Pathname length */
- assertEqualInt(i2(p + 30), 28); /* Extra field length */
+ assertEqualInt(i2(p + 30), 24); /* Extra field length */
assertEqualInt(i2(p + 32), 0); /* File comment length */
assertEqualInt(i2(p + 34), 0); /* Disk number start */
assertEqualInt(i2(p + 36), 0); /* Internal file attrs */
@@ -268,12 +279,7 @@ static void verify_uncompressed_contents(const char *buff, size_t used)
assertEqualInt(i4(p + 42), q - buff); /* Offset of local header */
assertEqualMem(p + 46, folder_name, strlen(folder_name)); /* Pathname */
p = p + 46 + strlen(folder_name);
- assertEqualInt(i2(p), 0x5455); /* 'UT' extension header */
- assertEqualInt(i2(p + 2), 9); /* 'UT' size */
- assertEqualInt(p[4], 5); /* 'UT' flags */
- assertEqualInt(i4(p + 5), now); /* 'UT' mtime */
- assertEqualInt(i4(p + 9), now + 5); /* 'UT' atime */
- p = p + 4 + i2(p + 2);
+
assertEqualInt(i2(p), 0x7875); /* 'ux' extension header */
assertEqualInt(i2(p + 2), 11); /* 'ux' size */
assertEqualInt(p[4], 1); /* 'ux' version */
@@ -281,7 +287,13 @@ static void verify_uncompressed_contents(const char *buff, size_t used)
assertEqualInt(i4(p + 6), folder_uid); /* 'ux' UID */
assertEqualInt(p[10], 4); /* 'ux' gid size */
assertEqualInt(i4(p + 11), folder_gid); /* 'ux' GID */
- /*p = p + 4 + i2(p + 2);*/
+ p = p + 4 + i2(p + 2);
+
+ assertEqualInt(i2(p), 0x5455); /* 'UT' extension header */
+ assertEqualInt(i2(p + 2), 5); /* 'UT' size */
+ assertEqualInt(p[4], 1); /* 'UT' flags */
+ assertEqualInt(i4(p + 5), now); /* 'UT' mtime */
+ p = p + 4 + i2(p + 2);
/* Verify local header of folder entry. */
local_header = q;
@@ -298,12 +310,7 @@ static void verify_uncompressed_contents(const char *buff, size_t used)
assertEqualInt(i2(q + 28), 41); /* Extra field length */
assertEqualMem(q + 30, folder_name, strlen(folder_name)); /* Pathname */
extra_start = q = q + 30 + strlen(folder_name);
- assertEqualInt(i2(q), 0x5455); /* 'UT' extension header */
- assertEqualInt(i2(q + 2), 9); /* 'UT' size */
- assertEqualInt(q[4], 5); /* 'UT' flags */
- assertEqualInt(i4(q + 5), now); /* 'UT' mtime */
- assertEqualInt(i4(q + 9), now + 5); /* 'UT' atime */
- q = q + 4 + i2(q + 2);
+
assertEqualInt(i2(q), 0x7875); /* 'ux' extension header */
assertEqualInt(i2(q + 2), 11); /* 'ux' size */
assertEqualInt(q[4], 1); /* 'ux' version */
@@ -313,6 +320,13 @@ static void verify_uncompressed_contents(const char *buff, size_t used)
assertEqualInt(i4(q + 11), folder_gid); /* 'ux' GID */
q = q + 4 + i2(q + 2);
+ assertEqualInt(i2(q), 0x5455); /* 'UT' extension header */
+ assertEqualInt(i2(q + 2), 9); /* 'UT' size */
+ assertEqualInt(q[4], 5); /* 'UT' flags */
+ assertEqualInt(i4(q + 5), now); /* 'UT' mtime */
+ assertEqualInt(i4(q + 9), now + 5); /* 'UT' atime */
+ q = q + 4 + i2(q + 2);
+
assertEqualInt(i2(q), 0x6c78); /* 'xl' experimental extension header */
assertEqualInt(i2(q + 2), 9); /* size */
assertEqualInt(q[4], 7); /* bitmap of fields */
diff --git a/libarchive/test/test_write_format_zip_empty.c b/libarchive/test/test_write_format_zip_empty.c
index 73a55731261e..410304d44120 100644
--- a/libarchive/test/test_write_format_zip_empty.c
+++ b/libarchive/test/test_write_format_zip_empty.c
@@ -28,7 +28,6 @@
*/
#include "test.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/test/test_write_format_zip_empty.c 201247 2009-12-30 05:59:21Z kientzle $");
DEFINE_TEST(test_write_format_zip_empty)
{
diff --git a/libarchive/test/test_write_format_zip_empty_zip64.c b/libarchive/test/test_write_format_zip_empty_zip64.c
index 8f9975b2102c..f56bf578e4cc 100644
--- a/libarchive/test/test_write_format_zip_empty_zip64.c
+++ b/libarchive/test/test_write_format_zip_empty_zip64.c
@@ -28,7 +28,6 @@
*/
#include "test.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/test/test_write_format_zip_empty.c 201247 2009-12-30 05:59:21Z kientzle $");
DEFINE_TEST(test_write_format_zip_empty_zip64)
{
diff --git a/libarchive/test/test_write_format_zip_entry_size_unset.c b/libarchive/test/test_write_format_zip_entry_size_unset.c
index 13b5f1b2db1a..10c191f7ce7d 100644
--- a/libarchive/test/test_write_format_zip_entry_size_unset.c
+++ b/libarchive/test/test_write_format_zip_entry_size_unset.c
@@ -25,7 +25,6 @@
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
/* File data */
static const char file_name[] = "file";
@@ -152,7 +151,7 @@ static void verify_contents(const char *zip_buff, size_t size)
/* Check file name length */
assertEqualInt(i2(central_directory + 28), strlen(file_name));
/* Check extra field length */
- assertEqualInt(i2(central_directory + 30), 20);
+ assertEqualInt(i2(central_directory + 30), 15);
/* Check file comment length */
assertEqualInt(i2(central_directory + 32), 0);
/* Check disk number where file starts */
@@ -188,7 +187,7 @@ static void verify_contents(const char *zip_buff, size_t size)
/* Check pathname length */
assertEqualInt(i2(local_file_header + 26), strlen(file_name));
/* Check extra field length */
- assertEqualInt(i2(local_file_header + 28), 20);
+ assertEqualInt(i2(local_file_header + 28), 15);
/* Check path name match */
assertEqualMem(local_file_header + 30, file_name, strlen(file_name));
@@ -210,7 +209,7 @@ static void verify_contents(const char *zip_buff, size_t size)
assertEqualInt(i4(data_descriptor + 12), sizeof(file_data1) + sizeof(file_data2));
/* Get folder entry in central directory */
- const char *central_directory_folder_entry = central_directory + 46 + 20 + strlen(file_name);
+ const char *central_directory_folder_entry = central_directory + 46 + i2(local_file_header + 28) + strlen(file_name);
/* Get start of folder entry */
const char *local_folder_header = data_descriptor + 16;
@@ -234,7 +233,7 @@ static void verify_contents(const char *zip_buff, size_t size)
/* Check path name length */
assertEqualInt(i2(central_directory_folder_entry + 28), strlen(folder_name));
/* Check extra field length */
- assertEqualInt(i2(central_directory_folder_entry + 30), 20);
+ assertEqualInt(i2(central_directory_folder_entry + 30), 15);
/* Check file comment length */
assertEqualInt(i2(central_directory_folder_entry + 32), 0);
/* Check disk number start */
@@ -265,11 +264,11 @@ static void verify_contents(const char *zip_buff, size_t size)
/* Check path name length */
assertEqualInt(i2(local_folder_header + 26), strlen(folder_name));
/* Check extra field length */
- assertEqualInt(i2(local_folder_header + 28), 20);
+ assertEqualInt(i2(local_folder_header + 28), 15);
/* Check path name */
assertEqualMem(local_folder_header + 30, folder_name, strlen(folder_name));
- const char *post_local_folder = local_folder_header + 30 + strlen(folder_name) + 20;
+ const char *post_local_folder = local_folder_header + 30 + i2(local_folder_header + 28) + strlen(folder_name);
assertEqualMem(post_local_folder, central_directory, 4);
}
diff --git a/libarchive/test/test_write_format_zip_file.c b/libarchive/test/test_write_format_zip_file.c
index 2868123b08b9..d4f1b9b22054 100644
--- a/libarchive/test/test_write_format_zip_file.c
+++ b/libarchive/test/test_write_format_zip_file.c
@@ -29,7 +29,6 @@
*/
#include "test.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/test/test_write_format_zip.c 201247 2009-12-30 05:59:21Z kientzle $");
/*
* Detailed byte-for-byte verification of the format of a zip archive
@@ -73,7 +72,10 @@ DEFINE_TEST(test_write_format_zip_file)
struct archive *a;
struct archive_entry *ae;
time_t t = 1234567890;
- struct tm *tm = localtime(&t);
+ struct tm *tm;
+#if defined(HAVE_LOCALTIME_R) || defined(HAVE_LOCALTIME_S)
+ struct tm tmbuf;
+#endif
size_t used, buffsize = 1000000;
unsigned long crc;
int file_perm = 00644;
@@ -91,6 +93,13 @@ DEFINE_TEST(test_write_format_zip_file)
zip_compression = 0;
#endif
+#if defined(HAVE_LOCALTIME_S)
+ tm = localtime_s(&tmbuf, &t) ? NULL : &tmbuf;
+#elif defined(HAVE_LOCALTIME_R)
+ tm = localtime_r(&t, &tmbuf);
+#else
+ tm = localtime(&t);
+#endif
buff = malloc(buffsize);
/* Create a new archive in memory. */
@@ -160,17 +169,17 @@ DEFINE_TEST(test_write_format_zip_file)
p = extension_start = central_header + 46 + strlen(file_name);
extension_end = extension_start + i2(central_header + 30);
+ assertEqualInt(i2(p), 0x7875); /* 'ux' extension header */
+ assertEqualInt(i2(p + 2), 11); /* 'ux' size */
+ /* TODO: verify 'ux' contents */
+ p += 4 + i2(p + 2);
+
assertEqualInt(i2(p), 0x5455); /* 'UT' extension header */
assertEqualInt(i2(p + 2), 5); /* 'UT' size */
assertEqualInt(p[4], 1); /* 'UT' flags */
assertEqualInt(i4(p + 5), t); /* 'UT' mtime */
p += 4 + i2(p + 2);
- assertEqualInt(i2(p), 0x7875); /* 'ux' extension header */
- assertEqualInt(i2(p + 2), 11); /* 'ux' size */
- /* TODO: verify 'ux' contents */
- p += 4 + i2(p + 2);
-
/* Just in case: Report any extra extensions. */
while (p < extension_end) {
failure("Unexpected extension 0x%04X", i2(p));
@@ -179,36 +188,30 @@ DEFINE_TEST(test_write_format_zip_file)
}
/* Should have run exactly to end of extra data. */
- assert(p == extension_end);
+ assertEqualAddress(p, extension_end);
- assert(p == eocd);
+ assertEqualAddress(p, eocd);
/* Regular EOCD immediately follows central directory. */
- assert(p == eocd_record);
+ assertEqualAddress(p, eocd_record);
/* Verify local header of file entry. */
p = local_header = buff;
assertEqualMem(p, "PK\003\004", 4); /* Signature */
assertEqualInt(i2(p + 4), zip_version); /* Version needed to extract */
- assertEqualInt(i2(p + 6), 8); /* Flags */
+ assertEqualInt(i2(p + 6), 8); /* Flags: bit 3 = length-at-end */
assertEqualInt(i2(p + 8), zip_compression); /* Compression method */
assertEqualInt(i2(p + 10), (tm->tm_hour * 2048) + (tm->tm_min * 32) + (tm->tm_sec / 2)); /* File time */
assertEqualInt(i2(p + 12), ((tm->tm_year - 80) * 512) + ((tm->tm_mon + 1) * 32) + tm->tm_mday); /* File date */
- assertEqualInt(i4(p + 14), 0); /* CRC-32 */
- /* assertEqualInt(i4(p + 18), sizeof(file_data)); */ /* Compressed size */
- /* assertEqualInt(i4(p + 22), sizeof(file_data)); */ /* Uncompressed size not stored because we're using length-at-end. */
+ assertEqualInt(i4(p + 14), 0); /* CRC-32 stored as zero because we're using length-at-end */
+ assertEqualInt(i4(p + 18), 0); /* Compressed size stored as zero because we're using length-at-end. */
+ assertEqualInt(i4(p + 22), 0); /* Uncompressed size stored as zero because we're using length-at-end. */
assertEqualInt(i2(p + 26), strlen(file_name)); /* Pathname length */
assertEqualInt(i2(p + 28), 37); /* Extra field length */
assertEqualMem(p + 30, file_name, strlen(file_name)); /* Pathname */
p = extension_start = local_header + 30 + strlen(file_name);
extension_end = extension_start + i2(local_header + 28);
- assertEqualInt(i2(p), 0x5455); /* 'UT' extension header */
- assertEqualInt(i2(p + 2), 5); /* size */
- assertEqualInt(p[4], 1); /* 'UT' flags */
- assertEqualInt(i4(p + 5), t); /* 'UT' mtime */
- p += 4 + i2(p + 2);
-
assertEqualInt(i2(p), 0x7875); /* 'ux' extension header */
assertEqualInt(i2(p + 2), 11); /* size */
assertEqualInt(p[4], 1); /* 'ux' version */
@@ -218,6 +221,12 @@ DEFINE_TEST(test_write_format_zip_file)
assertEqualInt(i4(p + 11), file_gid); /* 'Ux' GID */
p += 4 + i2(p + 2);
+ assertEqualInt(i2(p), 0x5455); /* 'UT' extension header */
+ assertEqualInt(i2(p + 2), 5); /* size */
+ assertEqualInt(p[4], 1); /* 'UT' flags */
+ assertEqualInt(i4(p + 5), t); /* 'UT' mtime */
+ p += 4 + i2(p + 2);
+
assertEqualInt(i2(p), 0x6c78); /* 'xl' experimental extension block */
assertEqualInt(i2(p + 2), 9); /* size */
assertEqualInt(p[4], 7); /* bitmap of fields in this block */
@@ -234,18 +243,18 @@ DEFINE_TEST(test_write_format_zip_file)
}
/* Should have run exactly to end of extra data. */
- assert(p == extension_end);
+ assertEqualAddress(p, extension_end);
/* Data descriptor should follow compressed data. */
while (p < central_header && memcmp(p, "PK\007\010", 4) != 0)
++p;
assertEqualMem(p, "PK\007\010", 4);
assertEqualInt(i4(p + 4), crc); /* CRC-32 */
- /* assertEqualInt(i4(p + 8), ???); */ /* compressed size */
+ assertEqualInt(i4(p + 8), p - extension_end); /* compressed size */
assertEqualInt(i4(p + 12), sizeof(file_data)); /* uncompressed size */
/* Central directory should immediately follow the only entry. */
- assert(p + 16 == central_header);
+ assertEqualAddress(p + 16, central_header);
free(buff);
}
diff --git a/libarchive/test/test_write_format_zip_file_zip64.c b/libarchive/test/test_write_format_zip_file_zip64.c
index 71da98668d8d..f06f2aad3c95 100644
--- a/libarchive/test/test_write_format_zip_file_zip64.c
+++ b/libarchive/test/test_write_format_zip_file_zip64.c
@@ -29,7 +29,6 @@
*/
#include "test.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/test/test_write_format_zip.c 201247 2009-12-30 05:59:21Z kientzle $");
/*
* Detailed byte-for-byte verification of the format of a zip archive
@@ -75,7 +74,10 @@ DEFINE_TEST(test_write_format_zip_file_zip64)
struct archive *a;
struct archive_entry *ae;
time_t t = 1234567890;
- struct tm *tm = localtime(&t);
+ struct tm *tm;
+#if defined(HAVE_LOCALTIME_R) || defined(HAVE_LOCALTIME_S)
+ struct tm tmbuf;
+#endif
size_t used, buffsize = 1000000;
unsigned long crc;
int file_perm = 00644;
@@ -92,6 +94,13 @@ DEFINE_TEST(test_write_format_zip_file_zip64)
zip_compression = 0;
#endif
+#if defined(HAVE_LOCALTIME_S)
+ tm = localtime_s(&tmbuf, &t) ? NULL : &tmbuf;
+#elif defined(HAVE_LOCALTIME_R)
+ tm = localtime_r(&t, &tmbuf);
+#else
+ tm = localtime(&t);
+#endif
buff = malloc(buffsize);
/* Create a new archive in memory. */
@@ -163,17 +172,17 @@ DEFINE_TEST(test_write_format_zip_file_zip64)
p = extension_start = central_header + 46 + strlen(file_name);
extension_end = extension_start + i2(central_header + 30);
+ assertEqualInt(i2(p), 0x7875); /* 'ux' extension header */
+ assertEqualInt(i2(p + 2), 11); /* 'ux' size */
+ /* TODO: verify 'ux' contents */
+ p += 4 + i2(p + 2);
+
assertEqualInt(i2(p), 0x5455); /* 'UT' extension header */
assertEqualInt(i2(p + 2), 5); /* 'UT' size */
assertEqualInt(p[4], 1); /* 'UT' flags */
assertEqualInt(i4(p + 5), t); /* 'UT' mtime */
p += 4 + i2(p + 2);
- assertEqualInt(i2(p), 0x7875); /* 'ux' extension header */
- assertEqualInt(i2(p + 2), 11); /* 'ux' size */
- /* TODO: verify 'ux' contents */
- p += 4 + i2(p + 2);
-
/* Note: We don't expect to see zip64 extension in the central
* directory, since the writer knows the actual full size by
* the time it is ready to write the central directory and has
@@ -188,9 +197,9 @@ DEFINE_TEST(test_write_format_zip_file_zip64)
}
/* Should have run exactly to end of extra data. */
- assert(p == extension_end);
+ assertEqualAddress(p, extension_end);
- assert(p == eocd);
+ assertEqualAddress(p, eocd);
/* After Central dir, we find Zip64 eocd and Zip64 eocd locator. */
assertEqualMem(p, "PK\006\006", 4); /* Zip64 eocd */
@@ -212,31 +221,25 @@ DEFINE_TEST(test_write_format_zip_file_zip64)
p += 20;
/* Regular EOCD immediately follows Zip64 records. */
- assert(p == eocd_record);
+ assertEqualAddress(p, eocd_record);
/* Verify local header of file entry. */
p = local_header = buff;
assertEqualMem(p, "PK\003\004", 4); /* Signature */
assertEqualInt(i2(p + 4), zip_version); /* Version needed to extract */
- assertEqualInt(i2(p + 6), 8); /* Flags */
+ assertEqualInt(i2(p + 6), 8); /* Flags: bit 3 = length-at-end */
assertEqualInt(i2(p + 8), zip_compression); /* Compression method */
assertEqualInt(i2(p + 10), (tm->tm_hour * 2048) + (tm->tm_min * 32) + (tm->tm_sec / 2)); /* File time */
assertEqualInt(i2(p + 12), ((tm->tm_year - 80) * 512) + ((tm->tm_mon + 1) * 32) + tm->tm_mday); /* File date */
- assertEqualInt(i4(p + 14), 0); /* CRC-32 */
- /* assertEqualInt(i4(p + 18), sizeof(file_data)); */ /* Compressed size */
- /* assertEqualInt(i4(p + 22), sizeof(file_data)); */ /* Uncompressed size not stored because we're using length-at-end. */
+ assertEqualInt(i4(p + 14), 0); /* CRC-32 must be 0 because of length-at-end */
+ assertEqualInt(i4(p + 18), 0); /* Compressed size must be 0 because of length-at-end */
+ assertEqualInt(i4(p + 22), 0); /* Uncompressed size must be 0 because of length-at-end. */
assertEqualInt(i2(p + 26), strlen(file_name)); /* Pathname length */
- assertEqualInt(i2(p + 28), 57); /* Extra field length */
+ assertEqualInt(i2(p + 28), 37); /* Extra field length */
assertEqualMem(p + 30, file_name, strlen(file_name)); /* Pathname */
p = extension_start = local_header + 30 + strlen(file_name);
extension_end = extension_start + i2(local_header + 28);
- assertEqualInt(i2(p), 0x5455); /* 'UT' extension header */
- assertEqualInt(i2(p + 2), 5); /* 'UT' size */
- assertEqualInt(p[4], 1); /* 'UT' flags */
- assertEqualInt(i4(p + 5), t); /* 'UT' mtime */
- p += 4 + i2(p + 2);
-
assertEqualInt(i2(p), 0x7875); /* 'ux' extension header */
assertEqualInt(i2(p + 2), 11); /* 'ux' size */
assertEqualInt(p[4], 1); /* 'ux' version */
@@ -246,10 +249,10 @@ DEFINE_TEST(test_write_format_zip_file_zip64)
assertEqualInt(i4(p + 11), file_gid); /* 'Ux' GID */
p += 4 + i2(p + 2);
- assertEqualInt(i2(p), 0x0001); /* Zip64 extension header */
- assertEqualInt(i2(p + 2), 16); /* size */
- assertEqualInt(i8(p + 4), 8); /* uncompressed file size */
- /* compressed file size we can't verify here */
+ assertEqualInt(i2(p), 0x5455); /* 'UT' extension header */
+ assertEqualInt(i2(p + 2), 5); /* 'UT' size */
+ assertEqualInt(p[4], 1); /* 'UT' flags */
+ assertEqualInt(i4(p + 5), t); /* 'UT' mtime */
p += 4 + i2(p + 2);
assertEqualInt(i2(p), 0x6c78); /* 'xl' experimental extension header */
@@ -268,18 +271,18 @@ DEFINE_TEST(test_write_format_zip_file_zip64)
}
/* Should have run exactly to end of extra data. */
- assert(p == extension_end);
+ assertEqualAddress(p, extension_end);
/* Data descriptor should follow compressed data. */
while (p < central_header && memcmp(p, "PK\007\010", 4) != 0)
++p;
assertEqualMem(p, "PK\007\010", 4);
assertEqualInt(i4(p + 4), crc); /* CRC-32 */
- /* assertEqualInt(i8(p + 8), ???); */ /* compressed size */
+ assertEqualInt(i8(p + 8), p - extension_end); /* compressed size */
assertEqualInt(i8(p + 16), sizeof(file_data)); /* uncompressed size */
/* Central directory should immediately follow the only entry. */
- assert(p + 24 == central_header);
+ assertEqualAddress(p + 24, central_header);
free(buff);
}
diff --git a/libarchive/test/test_write_format_zip_large.c b/libarchive/test/test_write_format_zip_large.c
index 2f98c6d4db8a..90bd16aaa581 100644
--- a/libarchive/test/test_write_format_zip_large.c
+++ b/libarchive/test/test_write_format_zip_large.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
#include <errno.h>
#include <stdlib.h>
@@ -273,22 +272,21 @@ static int64_t test_sizes[] = {
2 * GB - 1, 2 * GB, 2 * GB + 1,
/* Test for 32-bit unsigned overflow. */
4 * GB - 1, 4 * GB, 4 * GB + 1,
- /* And beyond ... because we can. */
- 16 * GB - 1, 16 * GB, 16 * GB + 1,
- 64 * GB - 1, 64 * GB, 64 * GB + 1,
- 256 * GB - 1, 256 * GB, 256 * GB + 1,
- 1 * TB,
+ /* And one larger sample */
+ 5 * GB,
0
};
static void
-verify_large_zip(struct archive *a, struct fileblocks *fileblocks)
+verify_large_zip(struct archive *a, struct fileblocks *fileblocks, int seeking)
{
char namebuff[64];
struct archive_entry *ae;
int i;
+ (void)seeking; /* UNUSED */
+
assertEqualIntA(a, ARCHIVE_OK,
archive_read_set_options(a, "zip:ignorecrc32"));
assertEqualIntA(a, ARCHIVE_OK,
@@ -309,9 +307,15 @@ verify_large_zip(struct archive *a, struct fileblocks *fileblocks)
for (i = 0; test_sizes[i] > 0; i++) {
assertEqualIntA(a, ARCHIVE_OK,
archive_read_next_header(a, &ae));
- sprintf(namebuff, "file_%d", i);
+ snprintf(namebuff, sizeof(namebuff), "file_%d", i);
assertEqualString(namebuff, archive_entry_pathname(ae));
- assertEqualInt(test_sizes[i], archive_entry_size(ae));
+ if (seeking) {
+ assert(archive_entry_size_is_set(ae));
+ assertEqualInt(test_sizes[i], archive_entry_size(ae));
+ } else {
+ assertEqualInt(0, archive_entry_size_is_set(ae));
+ }
+ /* TODO: Read to end of data, verify length */
}
assertEqualIntA(a, 0, archive_read_next_header(a, &ae));
assertEqualString("lastfile", archive_entry_pathname(ae));
@@ -345,6 +349,7 @@ DEFINE_TEST(test_write_format_zip_large)
*/
a = archive_write_new();
archive_write_set_format_zip(a);
+ /* TODO: Repeat this entire test suite with default compression */
assertEqualIntA(a, ARCHIVE_OK,
archive_write_set_options(a, "zip:compression=store"));
assertEqualIntA(a, ARCHIVE_OK,
@@ -359,7 +364,7 @@ DEFINE_TEST(test_write_format_zip_large)
*/
for (i = 0; test_sizes[i] != 0; i++) {
assert((ae = archive_entry_new()) != NULL);
- sprintf(namebuff, "file_%d", i);
+ snprintf(namebuff, sizeof(namebuff), "file_%d", i);
archive_entry_copy_pathname(ae, namebuff);
archive_entry_set_mode(ae, S_IFREG | 0755);
filesize = test_sizes[i];
@@ -398,7 +403,7 @@ DEFINE_TEST(test_write_format_zip_large)
a = archive_read_new();
assertEqualIntA(a, ARCHIVE_OK,
archive_read_support_format_zip_seekable(a));
- verify_large_zip(a, fileblocks);
+ verify_large_zip(a, fileblocks, 1);
assertEqualInt(ARCHIVE_OK, archive_read_free(a));
/*
@@ -407,7 +412,7 @@ DEFINE_TEST(test_write_format_zip_large)
a = archive_read_new();
assertEqualIntA(a, ARCHIVE_OK,
archive_read_support_format_zip_streamable(a));
- verify_large_zip(a, fileblocks);
+ verify_large_zip(a, fileblocks, 0);
assertEqualInt(ARCHIVE_OK, archive_read_free(a));
/*
@@ -430,7 +435,7 @@ DEFINE_TEST(test_write_format_zip_large)
/* Verify regular end-of-central-directory record */
eocd = p - 22;
assertEqualMem(eocd, "PK\005\006\0\0\0\0", 8);
- assertEqualMem(eocd + 8, "\021\0\021\0", 4); /* 17 entries total */
+ assertEqualMem(eocd + 8, "\010\0\010\0", 4); /* 8 entries total */
cd_size = le32(eocd + 12);
/* Start of CD offset should be 0xffffffff */
assertEqualMem(eocd + 16, "\xff\xff\xff\xff", 4);
@@ -450,8 +455,8 @@ DEFINE_TEST(test_write_format_zip_large)
assertEqualMem(zip64_eocd + 14, "\055\0", 2); // Requires version: 45
assertEqualMem(zip64_eocd + 16, "\0\0\0\0", 4); // This disk
assertEqualMem(zip64_eocd + 20, "\0\0\0\0", 4); // Total disks
- assertEqualInt(17, le64(zip64_eocd + 24)); // Entries on this disk
- assertEqualInt(17, le64(zip64_eocd + 32)); // Total entries
+ assertEqualInt(8, le64(zip64_eocd + 24)); // Entries on this disk
+ assertEqualInt(8, le64(zip64_eocd + 32)); // Total entries
cd_size = le64(zip64_eocd + 40);
cd_start = p - (fileblocks->filesize - le64(zip64_eocd + 48));
diff --git a/libarchive/test/test_write_format_zip_stream.c b/libarchive/test/test_write_format_zip_stream.c
new file mode 100644
index 000000000000..aff6a31ae171
--- /dev/null
+++ b/libarchive/test/test_write_format_zip_stream.c
@@ -0,0 +1,247 @@
+/*-
+ * Copyright (c) 2003-2023 Tim Kientzle
+ * Copyright (c) 2008 Anselm Strauss
+ * 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"
+
+/*
+ * Detailed byte-for-byte verification of the format of a zip archive
+ * written in streaming mode WITHOUT Zip64 extensions enabled.
+ */
+
+static unsigned long
+bitcrc32(unsigned long c, void *_p, size_t s)
+{
+ /* This is a drop-in replacement for crc32() from zlib.
+ * Libarchive should be able to correctly generate
+ * uncompressed zip archives (including correct CRCs) even
+ * when zlib is unavailable, and this function helps us verify
+ * that. Yes, this is very, very slow and unsuitable for
+ * production use, but it's correct, compact, and works well
+ * enough for this particular usage. Libarchive internally
+ * uses a much more efficient implementation. */
+ const unsigned char *p = _p;
+ int bitctr;
+
+ if (p == NULL)
+ return (0);
+
+ for (; s > 0; --s) {
+ c ^= *p++;
+ for (bitctr = 8; bitctr > 0; --bitctr) {
+ if (c & 1) c = (c >> 1);
+ else c = (c >> 1) ^ 0xedb88320;
+ c ^= 0x80000000;
+ }
+ }
+ return (c);
+}
+
+/* Quick and dirty: Read 2-byte and 4-byte integers from Zip file. */
+static unsigned i2(const unsigned char *p) { return ((p[0] & 0xff) | ((p[1] & 0xff) << 8)); }
+static unsigned i4(const unsigned char *p) { return (i2(p) | (i2(p + 2) << 16)); }
+
+DEFINE_TEST(test_write_format_zip_stream)
+{
+ struct archive *a;
+ struct archive_entry *ae;
+ size_t used, buffsize = 1000000;
+ unsigned long crc;
+ unsigned long compressed_size = 0;
+ int file_perm = 00644;
+ int zip_version = 20;
+ int zip_compression = 8;
+ short file_uid = 10, file_gid = 20;
+ unsigned char *buff, *buffend, *p;
+ unsigned char *central_header, *local_header, *eocd, *eocd_record;
+ unsigned char *extension_start, *extension_end;
+ unsigned char *data_start, *data_end;
+ char file_data[] = {'1', '2', '3', '4', '5', '6', '7', '8'};
+ const char *file_name = "file";
+
+#ifndef HAVE_ZLIB_H
+ zip_compression = 0;
+#endif
+
+ buff = malloc(buffsize);
+
+ /* Create a new archive in memory. */
+ assert((a = archive_write_new()) != NULL);
+ assertEqualIntA(a, ARCHIVE_OK, archive_write_set_format_zip(a));
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_write_set_options(a, "zip:!zip64"));
+ assertEqualIntA(a, ARCHIVE_OK,
+ archive_write_open_memory(a, buff, buffsize, &used));
+
+ assert((ae = archive_entry_new()) != NULL);
+ archive_entry_copy_pathname(ae, file_name);
+ archive_entry_set_mode(ae, AE_IFREG | file_perm);
+ archive_entry_set_uid(ae, file_uid);
+ archive_entry_set_gid(ae, file_gid);
+ archive_entry_set_mtime(ae, 0, 0);
+ assertEqualInt(0, archive_write_header(a, ae));
+ archive_entry_free(ae);
+ assertEqualInt(8, archive_write_data(a, file_data, sizeof(file_data)));
+ assertEqualIntA(a, ARCHIVE_OK, archive_write_close(a));
+ assertEqualInt(ARCHIVE_OK, archive_write_free(a));
+ buffend = buff + used;
+ dumpfile("constructed.zip", buff, used);
+
+ /* Verify "End of Central Directory" record. */
+ /* Get address of end-of-central-directory record. */
+ eocd_record = p = buffend - 22; /* Assumes there is no zip comment field. */
+ failure("End-of-central-directory begins with PK\\005\\006 signature");
+ assertEqualMem(p, "PK\005\006", 4);
+ failure("This must be disk 0");
+ assertEqualInt(i2(p + 4), 0);
+ failure("Central dir must start on disk 0");
+ assertEqualInt(i2(p + 6), 0);
+ failure("All central dir entries are on this disk");
+ assertEqualInt(i2(p + 8), i2(p + 10));
+ eocd = buff + i4(p + 12) + i4(p + 16);
+ failure("no zip comment");
+ assertEqualInt(i2(p + 20), 0);
+
+ /* Get address of first entry in central directory. */
+ central_header = p = buff + i4(buffend - 6);
+ failure("Central file record at offset %d should begin with"
+ " PK\\001\\002 signature",
+ i4(buffend - 10));
+
+ /* Verify file entry in central directory. */
+ assertEqualMem(p, "PK\001\002", 4); /* Signature */
+ assertEqualInt(i2(p + 4), 3 * 256 + zip_version); /* Version made by */
+ assertEqualInt(i2(p + 6), zip_version); /* Version needed to extract */
+ assertEqualInt(i2(p + 8), 8); /* Flags */
+ assertEqualInt(i2(p + 10), zip_compression); /* Compression method */
+ assertEqualInt(i2(p + 12), 0); /* File time */
+ assertEqualInt(i2(p + 14), 33); /* File date */
+ crc = bitcrc32(0, file_data, sizeof(file_data));
+ assertEqualInt(i4(p + 16), crc); /* CRC-32 */
+ compressed_size = i4(p + 20); /* Compressed size */
+ assertEqualInt(i4(p + 24), sizeof(file_data)); /* Uncompressed size */
+ assertEqualInt(i2(p + 28), strlen(file_name)); /* Pathname length */
+ /* assertEqualInt(i2(p + 30), 28); */ /* Extra field length: See below */
+ assertEqualInt(i2(p + 32), 0); /* File comment length */
+ assertEqualInt(i2(p + 34), 0); /* Disk number start */
+ assertEqualInt(i2(p + 36), 0); /* Internal file attrs */
+ assertEqualInt(i4(p + 38) >> 16 & 01777, file_perm); /* External file attrs */
+ assertEqualInt(i4(p + 42), 0); /* Offset of local header */
+ assertEqualMem(p + 46, file_name, strlen(file_name)); /* Pathname */
+ p = extension_start = central_header + 46 + strlen(file_name);
+ extension_end = extension_start + i2(central_header + 30);
+
+ assertEqualInt(i2(p), 0x7875); /* 'ux' extension header */
+ assertEqualInt(i2(p + 2), 11); /* 'ux' size */
+ assertEqualInt(p[4], 1); /* 'ux' version */
+ assertEqualInt(p[5], 4); /* 'ux' uid size */
+ assertEqualInt(i4(p + 6), file_uid); /* 'Ux' UID */
+ assertEqualInt(p[10], 4); /* 'ux' gid size */
+ assertEqualInt(i4(p + 11), file_gid); /* 'Ux' GID */
+ p += 4 + i2(p + 2);
+
+ assertEqualInt(i2(p), 0x5455); /* 'UT' extension header */
+ assertEqualInt(i2(p + 2), 5); /* 'UT' size */
+ assertEqualInt(p[4], 1); /* 'UT' flags */
+ assertEqualInt(i4(p + 5), 0); /* 'UT' mtime */
+ p += 4 + i2(p + 2);
+
+ /* Note: We don't expect to see zip64 extension in the central
+ * directory, since the writer knows the actual full size by
+ * the time it is ready to write the central directory and has
+ * no reason to insert it then. Info-Zip seems to do the same
+ * thing. */
+
+ /* Just in case: Report any extra extensions. */
+ while (p < extension_end) {
+ failure("Unexpected extension 0x%04X", i2(p));
+ assert(0);
+ p += 4 + i2(p + 2);
+ }
+
+ /* Should have run exactly to end of extra data. */
+ assert(p == extension_end);
+
+ assert(p == eocd);
+ assert(p == eocd_record);
+
+ /* Verify local header of file entry. */
+ p = local_header = buff;
+ assertEqualMem(p, "PK\003\004", 4); /* Signature */
+ assertEqualInt(i2(p + 4), zip_version); /* Version needed to extract */
+ assertEqualInt(i2(p + 6), 8); /* Flags */
+ assertEqualInt(i2(p + 8), zip_compression); /* Compression method */
+ assertEqualInt(i2(p + 10), 0); /* File time */
+ assertEqualInt(i2(p + 12), 33); /* File date */
+ assertEqualInt(i4(p + 14), 0); /* CRC-32 */
+ assertEqualInt(i4(p + 18), 0); /* Compressed size */
+ assertEqualInt(i4(p + 22), 0); /* Uncompressed size */
+ assertEqualInt(i2(p + 26), strlen(file_name)); /* Pathname length */
+ assertEqualInt(i2(p + 28), 24); /* Extra field length */
+ assertEqualMem(p + 30, file_name, strlen(file_name)); /* Pathname */
+ p = extension_start = local_header + 30 + strlen(file_name);
+ extension_end = extension_start + i2(local_header + 28);
+
+ assertEqualInt(i2(p), 0x7875); /* 'ux' extension header */
+ assertEqualInt(i2(p + 2), 11); /* 'ux' size */
+ assertEqualInt(p[4], 1); /* 'ux' version */
+ assertEqualInt(p[5], 4); /* 'ux' uid size */
+ assertEqualInt(i4(p + 6), file_uid); /* 'Ux' UID */
+ assertEqualInt(p[10], 4); /* 'ux' gid size */
+ assertEqualInt(i4(p + 11), file_gid); /* 'Ux' GID */
+ p += 4 + i2(p + 2);
+
+ assertEqualInt(i2(p), 0x5455); /* 'UT' extension header */
+ assertEqualInt(i2(p + 2), 5); /* 'UT' size */
+ assertEqualInt(p[4], 1); /* 'UT' flags */
+ assertEqualInt(i4(p + 5), 0); /* 'UT' mtime */
+ p += 4 + i2(p + 2);
+
+ /* Just in case: Report any extra extensions. */
+ while (p < extension_end) {
+ failure("Unexpected extension 0x%04X", i2(p));
+ assert(0);
+ p += 4 + i2(p + 2);
+ }
+
+ /* Should have run exactly to end of extra data. */
+ assert(p == extension_end);
+ data_start = p;
+
+ /* Data descriptor should follow compressed data. */
+ while (p < central_header && memcmp(p, "PK\007\010", 4) != 0)
+ ++p;
+ data_end = p;
+ assertEqualInt(data_end - data_start, compressed_size);
+ assertEqualMem(p, "PK\007\010", 4);
+ assertEqualInt(i4(p + 4), crc); /* CRC-32 */
+ assertEqualInt(i4(p + 8), compressed_size); /* compressed size */
+ assertEqualInt(i4(p + 12), sizeof(file_data)); /* uncompressed size */
+
+ /* Central directory should immediately follow the data descriptor. */
+ assert(p + 16 == central_header);
+
+ free(buff);
+}
diff --git a/libarchive/test/test_write_format_zip_zip64.c b/libarchive/test/test_write_format_zip_zip64.c
index c5f00a2e5d8d..259cdc47d3ae 100644
--- a/libarchive/test/test_write_format_zip_zip64.c
+++ b/libarchive/test/test_write_format_zip_zip64.c
@@ -24,7 +24,6 @@
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
static void
verify_zip_filesize(uint64_t size, int expected)
diff --git a/libarchive/test/test_write_open_memory.c b/libarchive/test/test_write_open_memory.c
index 3dbed113e799..2ebe01e413e6 100644
--- a/libarchive/test/test_write_open_memory.c
+++ b/libarchive/test/test_write_open_memory.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/test/test_write_open_memory.c 189308 2009-03-03 17:02:51Z kientzle $");
/* Try to force archive_write_open_memory.c to write past the end of an array. */
static unsigned char buff[16384];
diff --git a/libarchive/test/test_write_read_format_zip.c b/libarchive/test/test_write_read_format_zip.c
index 4f39489b5b53..828b092c7b3f 100644
--- a/libarchive/test/test_write_read_format_zip.c
+++ b/libarchive/test/test_write_read_format_zip.c
@@ -29,7 +29,6 @@
*/
#include "test.h"
-__FBSDID("$FreeBSD: head/lib/libarchive/test/test_write_format_zip.c 201247 2009-12-30 05:59:21Z kientzle $");
/*
* These tests verify that our reader can read files
@@ -288,8 +287,12 @@ verify_contents(struct archive *a, int seeking, int improved_streaming)
if (seeking || improved_streaming) {
assertEqualInt(AE_IFREG | 0755, archive_entry_mode(ae));
}
- assertEqualInt(8, archive_entry_size(ae));
- assert(archive_entry_size_is_set(ae));
+ if (seeking) {
+ assertEqualInt(8, archive_entry_size(ae));
+ assert(archive_entry_size_is_set(ae));
+ } else {
+ assertEqualInt(0, archive_entry_size_is_set(ae));
+ }
assertEqualIntA(a, 8,
archive_read_data(a, filedata, sizeof(filedata)));
assertEqualMem(filedata, "12345678", 8);
@@ -305,8 +308,12 @@ verify_contents(struct archive *a, int seeking, int improved_streaming)
if (seeking || improved_streaming) {
assertEqualInt(AE_IFREG | 0755, archive_entry_mode(ae));
}
- assertEqualInt(4, archive_entry_size(ae));
- assert(archive_entry_size_is_set(ae));
+ if (seeking) {
+ assertEqualInt(4, archive_entry_size(ae));
+ assert(archive_entry_size_is_set(ae));
+ } else {
+ assertEqualInt(0, archive_entry_size_is_set(ae));
+ }
assertEqualIntA(a, 4,
archive_read_data(a, filedata, sizeof(filedata)));
assertEqualMem(filedata, "1234", 4);
@@ -323,6 +330,7 @@ verify_contents(struct archive *a, int seeking, int improved_streaming)
}
if (seeking) {
assertEqualInt(5, archive_entry_size(ae));
+ assert(archive_entry_size_is_set(ae));
} else {
assertEqualInt(0, archive_entry_size_is_set(ae));
}
@@ -356,8 +364,9 @@ verify_contents(struct archive *a, int seeking, int improved_streaming)
assertEqualInt(0, archive_entry_atime(ae));
assertEqualInt(0, archive_entry_ctime(ae));
assertEqualString("dir/", archive_entry_pathname(ae));
- if (seeking || improved_streaming)
+ if (seeking || improved_streaming) {
assertEqualInt(AE_IFDIR | 0755, archive_entry_mode(ae));
+ }
assertEqualInt(0, archive_entry_size(ae));
assert(archive_entry_size_is_set(ae));
assertEqualIntA(a, 0, archive_read_data(a, filedata, 10));
@@ -378,8 +387,12 @@ verify_contents(struct archive *a, int seeking, int improved_streaming)
if (seeking || improved_streaming) {
assertEqualInt(AE_IFREG | 0755, archive_entry_mode(ae));
}
- assertEqualInt(8, archive_entry_size(ae));
- assert(archive_entry_size_is_set(ae));
+ if (seeking) {
+ assertEqualInt(8, archive_entry_size(ae));
+ assert(archive_entry_size_is_set(ae));
+ } else {
+ assertEqualInt(0, archive_entry_size_is_set(ae));
+ }
assertEqualIntA(a, 8,
archive_read_data(a, filedata, sizeof(filedata)));
assertEqualMem(filedata, "12345678", 8);
@@ -395,8 +408,12 @@ verify_contents(struct archive *a, int seeking, int improved_streaming)
if (seeking || improved_streaming) {
assertEqualInt(AE_IFREG | 0755, archive_entry_mode(ae));
}
- assertEqualInt(4, archive_entry_size(ae));
- assert(archive_entry_size_is_set(ae));
+ if (seeking) {
+ assertEqualInt(4, archive_entry_size(ae));
+ assert(archive_entry_size_is_set(ae));
+ } else {
+ assertEqualInt(0, archive_entry_size_is_set(ae));
+ }
assertEqualIntA(a, 4,
archive_read_data(a, filedata, sizeof(filedata)));
assertEqualMem(filedata, "1234", 4);
@@ -413,6 +430,7 @@ verify_contents(struct archive *a, int seeking, int improved_streaming)
}
if (seeking) {
assertEqualInt(5, archive_entry_size(ae));
+ assert(archive_entry_size_is_set(ae));
} else {
assertEqualInt(0, archive_entry_size_is_set(ae));
}
@@ -468,9 +486,12 @@ verify_contents(struct archive *a, int seeking, int improved_streaming)
if (seeking || improved_streaming) {
assertEqualInt(AE_IFREG | 0755, archive_entry_mode(ae));
}
- assert(archive_entry_size_is_set(ae));
- assert(archive_entry_size_is_set(ae));
- assertEqualInt(8, archive_entry_size(ae));
+ if (seeking) {
+ assert(archive_entry_size_is_set(ae));
+ assertEqualInt(8, archive_entry_size(ae));
+ } else {
+ assertEqualInt(0, archive_entry_size_is_set(ae));
+ }
assertEqualIntA(a, 8,
archive_read_data(a, filedata, sizeof(filedata)));
assertEqualMem(filedata, "12345678", 8);
@@ -486,8 +507,12 @@ verify_contents(struct archive *a, int seeking, int improved_streaming)
if (seeking || improved_streaming) {
assertEqualInt(AE_IFREG | 0755, archive_entry_mode(ae));
}
- assertEqualInt(4, archive_entry_size(ae));
- assert(archive_entry_size_is_set(ae));
+ if (seeking) {
+ assertEqualInt(4, archive_entry_size(ae));
+ assert(archive_entry_size_is_set(ae));
+ } else {
+ assertEqualInt(0, archive_entry_size_is_set(ae));
+ }
assertEqualIntA(a, 4,
archive_read_data(a, filedata, sizeof(filedata)));
assertEqualMem(filedata, "ACEG", 4);
@@ -503,6 +528,7 @@ verify_contents(struct archive *a, int seeking, int improved_streaming)
assertEqualInt(AE_IFREG | 0621, archive_entry_mode(ae));
if (seeking) {
assertEqualInt(5, archive_entry_size(ae));
+ assert(archive_entry_size_is_set(ae));
} else {
assertEqualInt(0, archive_entry_size_is_set(ae));
}
diff --git a/libarchive/test/test_xattr_platform.c b/libarchive/test/test_xattr_platform.c
index df3f81a5b3fd..3f16cac34154 100644
--- a/libarchive/test/test_xattr_platform.c
+++ b/libarchive/test/test_xattr_platform.c
@@ -24,7 +24,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
DEFINE_TEST(test_xattr_platform)
{
diff --git a/libarchive/test/test_zip_filename_encoding.c b/libarchive/test/test_zip_filename_encoding.c
index 54cd00630b8e..448fb9b1d4ef 100644
--- a/libarchive/test/test_zip_filename_encoding.c
+++ b/libarchive/test/test_zip_filename_encoding.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
#include <locale.h>
@@ -71,7 +70,9 @@ DEFINE_TEST(test_zip_filename_encoding_UTF8)
/*
* Verify that UTF-8 filenames are correctly stored without
* hdrcharset=UTF-8 option.
+ * Skip on Windows where we default to OEMCP
*/
+#if !defined(_WIN32) || defined(__CYGWIN__)
a = archive_write_new();
assertEqualInt(ARCHIVE_OK, archive_write_set_format_zip(a));
assertEqualInt(ARCHIVE_OK,
@@ -90,6 +91,7 @@ DEFINE_TEST(test_zip_filename_encoding_UTF8)
* which indicates the filename charset is UTF-8. */
assertEqualInt(0x08, buff[7]);
assertEqualMem(buff + 30, "\xD0\xBF\xD1\x80\xD0\xB8", 6);
+#endif
/*
* Verify that A bit 11 of general purpose flag is not set
diff --git a/libarchive/xxhash.c b/libarchive/xxhash.c
index f96e9d93493e..beacd2391221 100644
--- a/libarchive/xxhash.c
+++ b/libarchive/xxhash.c
@@ -149,6 +149,10 @@ typedef struct _U32_S { U32 v; } _PACKED U32_S;
#if GCC_VERSION >= 409
__attribute__((__no_sanitize_undefined__))
+#else
+# if defined(__clang__)
+__attribute__((no_sanitize("undefined")))
+# endif
#endif
#if defined(_MSC_VER)
static __inline U32 A32(const void * x)
diff --git a/libarchive_fe/err.c b/libarchive_fe/err.c
index 8c860350bc3e..f6dcf44af347 100644
--- a/libarchive_fe/err.c
+++ b/libarchive_fe/err.c
@@ -25,8 +25,6 @@
*/
#include "lafe_platform.h"
-__FBSDID("$FreeBSD$");
-
#ifdef HAVE_STDARG_H
#include <stdarg.h>
#endif
diff --git a/libarchive_fe/err.h b/libarchive_fe/err.h
index c663103b0b44..bd9281539693 100644
--- a/libarchive_fe/err.h
+++ b/libarchive_fe/err.h
@@ -27,10 +27,12 @@
#define LAFE_ERR_H
#if defined(__GNUC__) && (__GNUC__ > 2 || \
- (__GNUC__ == 2 && __GNUC_MINOR__ >= 5))
-#define __LA_DEAD __attribute__((__noreturn__))
+ (__GNUC__ == 2 && __GNUC_MINOR__ >= 5))
+#define __LA_NORETURN __attribute__((__noreturn__))
+#elif defined(_MSC_VER)
+#define __LA_NORETURN __declspec(noreturn)
#else
-#define __LA_DEAD
+#define __LA_NORETURN
#endif
#if defined(__GNUC__) && (__GNUC__ > 2 || \
@@ -46,8 +48,7 @@
#endif
void lafe_warnc(int code, const char *fmt, ...) __LA_PRINTFLIKE(2, 3);
-void lafe_errc(int eval, int code, const char *fmt, ...) __LA_DEAD
- __LA_PRINTFLIKE(3, 4);
+__LA_NORETURN void lafe_errc(int eval, int code, const char *fmt, ...) __LA_PRINTFLIKE(3, 4);
const char * lafe_getprogname(void);
void lafe_setprogname(const char *name, const char *defaultname);
diff --git a/libarchive_fe/lafe_platform.h b/libarchive_fe/lafe_platform.h
index 557124b9f841..6de8f898a22f 100644
--- a/libarchive_fe/lafe_platform.h
+++ b/libarchive_fe/lafe_platform.h
@@ -21,8 +21,6 @@
* 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: src/usr.bin/cpio/cpio_platform.h,v 1.2 2008/12/06 07:15:42 kientzle Exp $
*/
/*
@@ -42,14 +40,4 @@
#include "config.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
-
#endif
diff --git a/libarchive_fe/line_reader.c b/libarchive_fe/line_reader.c
index c7c4694eeb82..7f0429ece3cf 100644
--- a/libarchive_fe/line_reader.c
+++ b/libarchive_fe/line_reader.c
@@ -26,8 +26,6 @@
*/
#include "lafe_platform.h"
-__FBSDID("$FreeBSD$");
-
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
diff --git a/libarchive_fe/passphrase.c b/libarchive_fe/passphrase.c
index edf72d147182..9d95d527067b 100644
--- a/libarchive_fe/passphrase.c
+++ b/libarchive_fe/passphrase.c
@@ -50,8 +50,6 @@
#include "lafe_platform.h"
-__FBSDID("$FreeBSD$");
-
#include <errno.h>
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
@@ -171,8 +169,10 @@ readpassphrase(const char *prompt, char *buf, size_t bufsiz, int flags)
int input, output, save_errno, i, need_restart;
char ch, *p, *end;
struct termios term, oterm;
+#ifdef HAVE_SIGACTION
struct sigaction sa, savealrm, saveint, savehup, savequit, saveterm;
struct sigaction savetstp, savettin, savettou, savepipe;
+#endif
/* I suppose we could alloc on demand in this case (XXX). */
if (bufsiz == 0) {
@@ -221,6 +221,7 @@ restart:
oterm.c_lflag |= ECHO;
}
+#ifdef HAVE_SIGACTION
/*
* Catch signals that would otherwise cause the user to end
* up with echo turned off in the shell. Don't worry about
@@ -239,6 +240,7 @@ restart:
(void)sigaction(SIGTSTP, &sa, &savetstp);
(void)sigaction(SIGTTIN, &sa, &savettin);
(void)sigaction(SIGTTOU, &sa, &savettou);
+#endif
if (!(flags & RPP_STDIN)) {
int r = write(output, prompt, strlen(prompt));
@@ -276,6 +278,7 @@ restart:
continue;
signo[SIGTTOU] = sigttou;
}
+#ifdef HAVE_SIGACTION
(void)sigaction(SIGALRM, &savealrm, NULL);
(void)sigaction(SIGHUP, &savehup, NULL);
(void)sigaction(SIGINT, &saveint, NULL);
@@ -285,6 +288,7 @@ restart:
(void)sigaction(SIGTSTP, &savetstp, NULL);
(void)sigaction(SIGTTIN, &savettin, NULL);
(void)sigaction(SIGTTOU, &savettou, NULL);
+#endif
if (input != STDIN_FILENO)
(void)close(input);
@@ -325,7 +329,7 @@ lafe_readpassphrase(const char *prompt, char *buf, size_t bufsiz)
break;
default:
lafe_errc(1, errno, "Couldn't read passphrase");
- break;
+ /* NOTREACHED */
}
}
return (p);
diff --git a/tar/bsdtar.1 b/tar/bsdtar.1
index 63774216bd86..e570d2a48a01 100644
--- a/tar/bsdtar.1
+++ b/tar/bsdtar.1
@@ -23,9 +23,7 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $FreeBSD$
-.\"
-.Dd January 31, 2020
+.Dd March 1, 2024
.Dt TAR 1
.Os
.Sh NAME
@@ -274,6 +272,15 @@ 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.
+.It Fl Fl group Ar name Ns Op : Ns Ar gid
+Use the provided group, if
+.Ar gid
+is not provided,
+.Ar name
+can be either a group name or numeric id.
+See the
+.Fl Fl gname
+option for details.
.It Fl H
(c and r modes only)
Symbolic links named on the command line will be followed; the
@@ -403,6 +410,8 @@ This is the reverse of
and the default behavior in c, r, and u modes or if
.Nm
is run in x mode as root.
+Currently supported only for pax formats
+(including "pax restricted", the default tar format for bsdtar.)
.It Fl n , Fl Fl norecurse , Fl Fl no-recursion
Do not operate recursively on the content of directories.
.It Fl Fl newer Ar date
@@ -643,6 +652,59 @@ Specify the number of worker threads to use.
Setting threads to a special value 0 makes
.Xr zstd 1
use as many threads as there are CPU cores on the system.
+.It Cm zstd:frame-per-file
+Start a new compression frame at the beginning of each file in the
+archive.
+.It Cm zstd:min-frame-in Ns = Ns Ar N
+In combination with
+.Cm zstd:frame-per-file ,
+do not start a new compression frame unless the uncompressed size of
+the current frame is at least
+.Ar N
+bytes.
+The number may be followed by
+.Li k / Li kB ,
+.Li M / Li MB ,
+or
+.Li G / Li GB
+to indicate kilobytes, megabytes or gigabytes respectively.
+.It Cm zstd:min-frame-out Ns = Ns Ar N , Cm zstd:min-frame-size Ns = Ns Ar N
+In combination with
+.Cm zstd:frame-per-file ,
+do not start a new compression frame unless the compressed size of the
+current frame is at least
+.Ar N
+bytes.
+The number may be followed by
+.Li k / Li kB ,
+.Li M / Li MB ,
+or
+.Li G / Li GB
+to indicate kilobytes, megabytes or gigabytes respectively.
+.It Cm zstd:max-frame-in Ns = Ns Ar N , Cm zstd:max-frame-size Ns = Ns Ar N
+Start a new compression frame as soon as possible after the
+uncompressed size of the current frame exceeds
+.Ar N
+bytes.
+The number may be followed by
+.Li k / Li kB ,
+.Li M / Li MB ,
+or
+.Li G / Li GB
+to indicate kilobytes, megabytes or gigabytes respectively.
+Values less than 1,024 will be rejected.
+.It Cm zstd:max-frame-out Ns = Ns Ar N
+Start a new compression frame as soon as possible after the compressed
+size of the current frame exceeds
+.Ar N
+bytes.
+The number may be followed by
+.Li k / Li kB ,
+.Li M / Li MB ,
+or
+.Li G / Li GB
+to indicate kilobytes, megabytes or gigabytes respectively.
+Values less than 1,024 will be rejected.
.It Cm lzop:compression-level
A decimal integer from 1 to 9 specifying the lzop compression level.
.It Cm xz:compression-level
@@ -761,7 +823,7 @@ This works similar to the conv=sparse option of dd.
Modify file or archive member names according to
.Pa pattern .
The pattern has the format
-.Ar /old/new/ Ns Op ghHprRsS
+.Ar /old/new/ Ns Op bghHprRsS
where
.Ar old
is a basic regular expression,
@@ -783,6 +845,9 @@ of symbolic links.
The optional trailing p specifies that after a successful substitution
the original path name and the new path name should be printed to
standard error.
+The optional trailing b specifies that the substitution should be
+matched from the beginning of the string rather than from right after the
+position at which the previous matching substitution ended.
Optional trailing H, R, or S characters suppress substitutions
for hardlink targets, regular filenames, or symlink targets,
respectively.
@@ -888,6 +953,15 @@ the name is not verified against the system user database.
Pipe the input (in x or t mode) or the output (in c mode) through
.Pa program
instead of using the builtin compression support.
+.It Fl Fl owner Ar name Ns Op : Ns Ar uid
+Use the provided user, if
+.Ar uid
+is not provided,
+.Ar name
+can be either an username or numeric id.
+See the
+.Fl Fl uname
+option for details.
.It Fl v , Fl Fl verbose
Produce verbose output.
In create and extract modes,
@@ -953,7 +1027,7 @@ archives.
.Sh ENVIRONMENT
The following environment variables affect the execution of
.Nm :
-.Bl -tag -width ".Ev BLOCKSIZE"
+.Bl -tag -width indent
.It Ev TAR_READER_OPTIONS
The default options for format readers and compression readers.
The
diff --git a/tar/bsdtar.c b/tar/bsdtar.c
index 75249d1052c3..b070e0faeb66 100644
--- a/tar/bsdtar.c
+++ b/tar/bsdtar.c
@@ -24,7 +24,6 @@
*/
#include "bsdtar_platform.h"
-__FBSDID("$FreeBSD: src/usr.bin/tar/bsdtar.c,v 1.93 2008/11/08 04:43:24 kientzle Exp $");
#ifdef HAVE_SYS_PARAM_H
#include <sys/param.h>
@@ -114,11 +113,11 @@ need_report(void)
}
#endif
-static void long_help(void) __LA_DEAD;
+static __LA_NORETURN void long_help(void);
static void only_mode(struct bsdtar *, const char *opt,
const char *valid);
static void set_mode(struct bsdtar *, char opt);
-static void version(void) __LA_DEAD;
+static __LA_NORETURN void version(void);
/* A basic set of security flags to request from libarchive. */
#define SECURITY \
@@ -155,7 +154,7 @@ main(int argc, char **argv)
char compression, compression2;
const char *compression_name, *compression2_name;
const char *compress_program;
- char *tptr;
+ char *tptr, *uptr;
char possible_help_request;
char buff[16];
@@ -382,6 +381,36 @@ main(int argc, char **argv)
case OPTION_GNAME: /* cpio */
bsdtar->gname = bsdtar->argument;
break;
+ case OPTION_GROUP: /* GNU tar */
+ errno = 0;
+ tptr = NULL;
+
+ uptr = strchr(bsdtar->argument, ':');
+ if(uptr != NULL) {
+ if(uptr[1] == 0) {
+ lafe_errc(1, 0, "Invalid argument to --group (missing id after :)");
+ }
+ uptr[0] = 0;
+ uptr++;
+ t = (int)strtol(uptr, &tptr, 10);
+ if (errno || t < 0 || *uptr == '\0' ||
+ tptr == NULL || *tptr != '\0') {
+ lafe_errc(1, 0, "Invalid argument to --group (%s is not a number)", uptr);
+ } else {
+ bsdtar->gid = t;
+ }
+ bsdtar->gname = bsdtar->argument;
+ } else {
+ t = (int)strtol(bsdtar->argument, &tptr, 10);
+ if (errno || t < 0 || *(bsdtar->argument) == '\0' ||
+ tptr == NULL || *tptr != '\0') {
+ bsdtar->gname = bsdtar->argument;
+ } else {
+ bsdtar->gid = t;
+ bsdtar->gname = "";
+ }
+ }
+ break;
case OPTION_GRZIP:
if (compression != '\0')
lafe_errc(1, 0,
@@ -400,8 +429,7 @@ main(int argc, char **argv)
break;
case OPTION_HELP: /* GNU tar, others */
long_help();
- exit(0);
- break;
+ /* NOTREACHED*/
case OPTION_HFS_COMPRESSION: /* Mac OS X v10.6 or later */
bsdtar->extract_flags |=
ARCHIVE_EXTRACT_HFS_COMPRESSION_FORCED;
@@ -626,8 +654,43 @@ main(int argc, char **argv)
ARCHIVE_READDISK_NO_TRAVERSE_MOUNTS;
break;
case OPTION_OPTIONS:
+ if (bsdtar->option_options != NULL) {
+ lafe_warnc(0,
+ "Ignoring previous option '%s', separate multiple options with commas",
+ bsdtar->option_options);
+ }
bsdtar->option_options = bsdtar->argument;
break;
+ case OPTION_OWNER: /* GNU tar */
+ errno = 0;
+ tptr = NULL;
+
+ uptr = strchr(bsdtar->argument, ':');
+ if(uptr != NULL) {
+ if(uptr[1] == 0) {
+ lafe_errc(1, 0, "Invalid argument to --owner (missing id after :)");
+ }
+ uptr[0] = 0;
+ uptr++;
+ t = (int)strtol(uptr, &tptr, 10);
+ if (errno || t < 0 || *uptr == '\0' ||
+ tptr == NULL || *tptr != '\0') {
+ lafe_errc(1, 0, "Invalid argument to --owner (%s is not a number)", uptr);
+ } else {
+ bsdtar->uid = t;
+ }
+ bsdtar->uname = bsdtar->argument;
+ } else {
+ t = (int)strtol(bsdtar->argument, &tptr, 10);
+ if (errno || t < 0 || *(bsdtar->argument) == '\0' ||
+ tptr == NULL || *tptr != '\0') {
+ bsdtar->uname = bsdtar->argument;
+ } else {
+ bsdtar->uid = t;
+ bsdtar->uname = "";
+ }
+ }
+ break;
#if 0
/*
* The common BSD -P option is not necessary, since
@@ -670,7 +733,7 @@ main(int argc, char **argv)
bsdtar->extract_flags |= ARCHIVE_EXTRACT_SPARSE;
break;
case 's': /* NetBSD pax-as-tar */
-#if defined(HAVE_REGEX_H) || defined(HAVE_PCREPOSIX_H)
+#if defined(HAVE_REGEX_H) || defined(HAVE_PCREPOSIX_H) || defined(HAVE_PCRE2POSIX_H)
add_substitution(bsdtar, bsdtar->argument);
#else
lafe_warnc(0,
@@ -738,7 +801,7 @@ main(int argc, char **argv)
break;
case OPTION_VERSION: /* GNU convention */
version();
- break;
+ /* NOTREACHED */
#if 0
/*
* The -W longopt feature is handled inside of
@@ -804,7 +867,6 @@ main(int argc, char **argv)
/* If no "real" mode was specified, treat -h as --help. */
if ((bsdtar->mode == '\0') && possible_help_request) {
long_help();
- exit(0);
}
/* Otherwise, a mode is required. */
@@ -950,7 +1012,7 @@ main(int argc, char **argv)
}
archive_match_free(bsdtar->matching);
-#if defined(HAVE_REGEX_H) || defined(HAVE_PCREPOSIX_H)
+#if defined(HAVE_REGEX_H) || defined(HAVE_PCREPOSIX_H) || defined(HAVE_PCRE2POSIX_H)
cleanup_substitution(bsdtar);
#endif
cset_free(bsdtar->cset);
diff --git a/tar/bsdtar.h b/tar/bsdtar.h
index 8f9f79ab176e..22056c7920c4 100644
--- a/tar/bsdtar.h
+++ b/tar/bsdtar.h
@@ -21,8 +21,6 @@
* 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: src/usr.bin/tar/bsdtar.h,v 1.37 2008/12/06 07:37:14 kientzle Exp $
*/
#ifndef BSDTAR_H_INCLUDED
@@ -145,6 +143,7 @@ enum {
OPTION_FORMAT,
OPTION_GID,
OPTION_GNAME,
+ OPTION_GROUP,
OPTION_GRZIP,
OPTION_HELP,
OPTION_HFS_COMPRESSION,
@@ -179,6 +178,7 @@ enum {
OPTION_OLDER_MTIME_THAN,
OPTION_ONE_FILE_SYSTEM,
OPTION_OPTIONS,
+ OPTION_OWNER,
OPTION_PASSPHRASE,
OPTION_POSIX,
OPTION_READ_SPARSE,
@@ -208,10 +208,10 @@ void tar_mode_r(struct bsdtar *bsdtar);
void tar_mode_t(struct bsdtar *bsdtar);
void tar_mode_u(struct bsdtar *bsdtar);
void tar_mode_x(struct bsdtar *bsdtar);
-void usage(void) __LA_DEAD;
+__LA_NORETURN void usage(void);
int yes(const char *fmt, ...) __LA_PRINTF(1, 2);
-#if defined(HAVE_REGEX_H) || defined(HAVE_PCREPOSIX_H)
+#if defined(HAVE_REGEX_H) || defined(HAVE_PCREPOSIX_H) || defined(HAVE_PCRE2POSIX_H)
void add_substitution(struct bsdtar *, const char *);
int apply_substitution(struct bsdtar *, const char *, char **, int, int);
void cleanup_substitution(struct bsdtar *);
diff --git a/tar/bsdtar_platform.h b/tar/bsdtar_platform.h
index e73f9828b3b0..a4f37d95e9b3 100644
--- a/tar/bsdtar_platform.h
+++ b/tar/bsdtar_platform.h
@@ -21,8 +21,6 @@
* 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: src/usr.bin/tar/bsdtar_platform.h,v 1.26 2008/12/06 07:37:14 kientzle Exp $
*/
/*
@@ -46,16 +44,6 @@
#include "bsdtar_windows.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
-
#ifdef HAVE_LIBARCHIVE
/* If we're using the platform libarchive, include system headers. */
#include <archive.h>
@@ -121,12 +109,14 @@
/* How to mark functions that don't return. */
/* This facilitates use of some newer static code analysis tools. */
-#undef __LA_DEAD
+#undef __LA_NORETURN
#if defined(__GNUC__) && (__GNUC__ > 2 || \
- (__GNUC__ == 2 && __GNUC_MINOR__ >= 5))
-#define __LA_DEAD __attribute__((__noreturn__))
-#else
-#define __LA_DEAD
+ (__GNUC__ == 2 && __GNUC_MINOR__ >= 5))
+#define __LA_NORETURN __attribute__((__noreturn__))
+#elif defined(_MSC_VER)
+#define __LA_NORETURN __declspec(noreturn)
+#else
+#define __LA_NORETURN
#endif
#endif /* !BSDTAR_PLATFORM_H_INCLUDED */
diff --git a/tar/bsdtar_windows.c b/tar/bsdtar_windows.c
index 41ce6eb78c8b..b40fea776d2e 100644
--- a/tar/bsdtar_windows.c
+++ b/tar/bsdtar_windows.c
@@ -21,8 +21,6 @@
* 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$
*/
#if defined(_WIN32) && !defined(__CYGWIN__)
diff --git a/tar/bsdtar_windows.h b/tar/bsdtar_windows.h
index 308ad1107bef..7ca649c2587e 100644
--- a/tar/bsdtar_windows.h
+++ b/tar/bsdtar_windows.h
@@ -21,8 +21,6 @@
* 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 BSDTAR_WINDOWS_H
diff --git a/tar/cmdline.c b/tar/cmdline.c
index d49e5b0d16e7..72292e8f27f3 100644
--- a/tar/cmdline.c
+++ b/tar/cmdline.c
@@ -28,7 +28,6 @@
*/
#include "bsdtar_platform.h"
-__FBSDID("$FreeBSD$");
#ifdef HAVE_ERRNO_H
#include <errno.h>
@@ -94,6 +93,7 @@ static const struct bsdtar_option {
{ "format", 1, OPTION_FORMAT },
{ "gid", 1, OPTION_GID },
{ "gname", 1, OPTION_GNAME },
+ { "group", 1, OPTION_GROUP },
{ "grzip", 0, OPTION_GRZIP },
{ "gunzip", 0, 'z' },
{ "gzip", 0, 'z' },
@@ -142,6 +142,7 @@ static const struct bsdtar_option {
{ "older-than", 1, OPTION_OLDER_CTIME_THAN },
{ "one-file-system", 0, OPTION_ONE_FILE_SYSTEM },
{ "options", 1, OPTION_OPTIONS },
+ { "owner", 1, OPTION_OWNER },
{ "passphrase", 1, OPTION_PASSPHRASE },
{ "posix", 0, OPTION_POSIX },
{ "preserve-permissions", 0, 'p' },
diff --git a/tar/config_freebsd.h b/tar/config_freebsd.h
index 37aa9dcae172..761f71cfbeca 100644
--- a/tar/config_freebsd.h
+++ b/tar/config_freebsd.h
@@ -21,8 +21,6 @@
* 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: src/usr.bin/tar/config_freebsd.h,v 1.8 2008/11/29 20:06:53 kientzle Exp $
*/
/* A default configuration for FreeBSD, used if there is no config.h. */
diff --git a/tar/creation_set.c b/tar/creation_set.c
index cfc5a642aed3..5cd1232b764c 100644
--- a/tar/creation_set.c
+++ b/tar/creation_set.c
@@ -24,7 +24,6 @@
*/
#include "bsdtar_platform.h"
-__FBSDID("$FreeBSD$");
#ifdef HAVE_STDLIB_H
#include <stdlib.h>
diff --git a/tar/read.c b/tar/read.c
index b9599661967c..a7f14a07bb35 100644
--- a/tar/read.c
+++ b/tar/read.c
@@ -24,7 +24,6 @@
*/
#include "bsdtar_platform.h"
-__FBSDID("$FreeBSD: src/usr.bin/tar/read.c,v 1.40 2008/08/21 06:41:14 kientzle Exp $");
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
@@ -372,8 +371,9 @@ read_archive(struct bsdtar *bsdtar, char mode, struct archive *writer)
if (r != ARCHIVE_OK) {
if (!bsdtar->verbose)
safe_fprintf(stderr, "%s", archive_entry_pathname(entry));
- fprintf(stderr, ": %s: ", archive_error_string(a));
- fprintf(stderr, "%s", strerror(errno));
+ safe_fprintf(stderr, ": %s: %s",
+ archive_error_string(a),
+ strerror(archive_errno(a)));
if (!bsdtar->verbose)
fprintf(stderr, "\n");
bsdtar->return_value = 1;
diff --git a/tar/subst.c b/tar/subst.c
index 39c54acfd14f..9747abb906c4 100644
--- a/tar/subst.c
+++ b/tar/subst.c
@@ -24,14 +24,15 @@
*/
#include "bsdtar_platform.h"
-__FBSDID("$FreeBSD: src/usr.bin/tar/subst.c,v 1.4 2008/06/15 10:08:16 kientzle Exp $");
-#if defined(HAVE_REGEX_H) || defined(HAVE_PCREPOSIX_H)
+#if defined(HAVE_REGEX_H) || defined(HAVE_PCREPOSIX_H) || defined(HAVE_PCRE2POSIX_H)
#include "bsdtar.h"
#include <errno.h>
-#ifdef HAVE_PCREPOSIX_H
+#if defined(HAVE_PCREPOSIX_H)
#include <pcreposix.h>
+#elif defined(HAVE_PCRE2POSIX_H)
+#include <pcre2posix.h>
#else
#include <regex.h>
#endif
@@ -48,7 +49,7 @@ struct subst_rule {
struct subst_rule *next;
regex_t re;
char *result;
- unsigned int global:1, print:1, regular:1, symlink:1, hardlink:1;
+ unsigned int global:1, print:1, regular:1, symlink:1, hardlink:1, from_begin:1;
};
struct substitution {
@@ -128,9 +129,14 @@ add_substitution(struct bsdtar *bsdtar, const char *rule_text)
rule->regular = 1; /* Rewrite regular filenames. */
rule->symlink = 1; /* Rewrite symlink targets. */
rule->hardlink = 1; /* Rewrite hardlink targets. */
+ rule->from_begin = 0; /* Don't match from start. */
while (*++end_pattern) {
switch (*end_pattern) {
+ case 'b':
+ case 'B':
+ rule->from_begin = 1;
+ break;
case 'g':
case 'G':
rule->global = 1;
@@ -159,6 +165,7 @@ add_substitution(struct bsdtar *bsdtar, const char *rule_text)
break;
default:
lafe_errc(1, 0, "Invalid replacement flag %c", *end_pattern);
+ /* NOTREACHED */
}
}
}
@@ -212,6 +219,7 @@ apply_substitution(struct bsdtar *bsdtar, const char *name, char **result,
{
const char *path = name;
regmatch_t matches[10];
+ char* buffer = NULL;
size_t i, j;
struct subst_rule *rule;
struct substitution *subst;
@@ -237,6 +245,13 @@ apply_substitution(struct bsdtar *bsdtar, const char *name, char **result,
continue;
}
+ if (rule->from_begin && *result) {
+ realloc_strcat(result, name);
+ realloc_strcat(&buffer, *result);
+ name = buffer;
+ (*result)[0] = 0;
+ }
+
while (1) {
if (regexec(&rule->re, name, 10, matches, 0))
break;
@@ -276,6 +291,7 @@ apply_substitution(struct bsdtar *bsdtar, const char *name, char **result,
case '9':
realloc_strncat(result, rule->result + j, i - j - 1);
if ((size_t)(c - '0') > (size_t)(rule->re.re_nsub)) {
+ free(buffer);
free(*result);
*result = NULL;
return -1;
@@ -302,6 +318,8 @@ apply_substitution(struct bsdtar *bsdtar, const char *name, char **result,
if (got_match)
realloc_strcat(result, name);
+ free(buffer);
+
if (print_match)
fprintf(stderr, "%s >> %s\n", path, *result);
@@ -320,8 +338,9 @@ cleanup_substitution(struct bsdtar *bsdtar)
while ((rule = subst->first_rule) != NULL) {
subst->first_rule = rule->next;
free(rule->result);
+ regfree(&rule->re);
free(rule);
}
free(subst);
}
-#endif /* defined(HAVE_REGEX_H) || defined(HAVE_PCREPOSIX_H) */
+#endif /* defined(HAVE_REGEX_H) || defined(HAVE_PCREPOSIX_H) || defined(HAVE_PCRE2POSIX_H) */
diff --git a/tar/test/CMakeLists.txt b/tar/test/CMakeLists.txt
index 3b6675393d18..7808a8d1f2ba 100644
--- a/tar/test/CMakeLists.txt
+++ b/tar/test/CMakeLists.txt
@@ -43,6 +43,7 @@ IF(ENABLE_TAR AND ENABLE_TEST)
test_option_exclude_vcs.c
test_option_fflags.c
test_option_gid_gname.c
+ test_option_group.c
test_option_grzip.c
test_option_ignore_zeros.c
test_option_j.c
@@ -56,6 +57,7 @@ IF(ENABLE_TAR AND ENABLE_TEST)
test_option_newer_than.c
test_option_nodump.c
test_option_older_than.c
+ test_option_owner.c
test_option_passphrase.c
test_option_q.c
test_option_r.c
diff --git a/tar/test/test.h b/tar/test/test.h
index 1e1bee80709c..549357b4e0fd 100644
--- a/tar/test/test.h
+++ b/tar/test/test.h
@@ -21,8 +21,6 @@
* 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$
*/
/* Every test program should #include "test.h" as the first thing. */
diff --git a/tar/test/test_0.c b/tar/test/test_0.c
index b73c7a3f4fab..7a3c2e46858f 100644
--- a/tar/test/test_0.c
+++ b/tar/test/test_0.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: src/usr.bin/tar/test/test_0.c,v 1.2 2008/05/26 17:10:10 kientzle Exp $");
/*
* This first test does basic sanity checks on the environment. For
diff --git a/tar/test/test_basic.c b/tar/test/test_basic.c
index b1c49834a45f..a59236c92b55 100644
--- a/tar/test/test_basic.c
+++ b/tar/test/test_basic.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: src/usr.bin/tar/test/test_basic.c,v 1.2 2008/05/26 17:10:10 kientzle Exp $");
static const char *
make_files(void)
diff --git a/tar/test/test_copy.c b/tar/test/test_copy.c
index d618e45ca36b..fd47a6d877e6 100644
--- a/tar/test/test_copy.c
+++ b/tar/test/test_copy.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: src/usr.bin/tar/test/test_copy.c,v 1.3 2008/08/15 06:12:02 kientzle Exp $");
#if defined(__CYGWIN__)
# include <limits.h>
@@ -160,21 +159,21 @@ create_tree(void)
failure("Internal sanity check failed: i = %d", i);
assert(filenames[i] != NULL);
- sprintf(buff, "f/%s", filenames[i]);
+ snprintf(buff, sizeof(buff), "f/%s", filenames[i]);
assertMakeFile(buff, 0777, buff);
/* Create a link named "l/abcdef..." to the above. */
- sprintf(buff2, "l/%s", filenames[i]);
+ snprintf(buff2, sizeof(buff2), "l/%s", filenames[i]);
assertMakeHardlink(buff2, buff);
/* Create a link named "m/abcdef..." to the above. */
- sprintf(buff2, "m/%s", filenames[i]);
+ snprintf(buff2, sizeof(buff2), "m/%s", filenames[i]);
assertMakeHardlink(buff2, buff);
if (canSymlink()) {
/* Create a symlink named "s/abcdef..." to the above. */
- sprintf(buff, "s/%s", filenames[i]);
- sprintf(buff2, "../f/%s", filenames[i]);
+ snprintf(buff, sizeof(buff), "s/%s", filenames[i]);
+ snprintf(buff2, sizeof(buff2), "../f/%s", filenames[i]);
failure("buff=\"%s\" buff2=\"%s\"", buff, buff2);
assertMakeSymlink(buff, buff2, 0);
}
@@ -202,13 +201,13 @@ verify_tree(size_t limit)
/* Generate the names we know should be there and verify them. */
for (i = 1; i < LOOP_MAX; i++) {
/* Verify a file named "f/abcdef..." */
- sprintf(name1, "f/%s", filenames[i]);
+ snprintf(name1, sizeof(name1), "f/%s", filenames[i]);
if (i <= limit) {
assertFileExists(name1);
assertFileContents(name1, (int)strlen(name1), name1);
}
- sprintf(name2, "l/%s", filenames[i]);
+ snprintf(name2, sizeof(name2), "l/%s", filenames[i]);
if (i + 2 <= limit) {
/* Verify hardlink "l/abcdef..." */
assertIsHardlink(name1, name2);
@@ -219,14 +218,14 @@ verify_tree(size_t limit)
if (canSymlink()) {
/* Verify symlink "s/abcdef..." */
- sprintf(name1, "s/%s", filenames[i]);
- sprintf(name2, "../f/%s", filenames[i]);
+ snprintf(name1, sizeof(name1), "s/%s", filenames[i]);
+ snprintf(name2, sizeof(name2), "../f/%s", filenames[i]);
if (strlen(name2) <= limit)
assertIsSymlink(name1, name2, 0);
}
/* Verify dir "d/abcdef...". */
- sprintf(name1, "d/%s", filenames[i]);
+ snprintf(name1, sizeof(name1), "d/%s", filenames[i]);
if (i + 1 <= limit) { /* +1 for trailing slash */
if (assertIsDir(name1, -1)) {
/* TODO: opendir/readdir this
diff --git a/tar/test/test_empty_mtree.c b/tar/test/test_empty_mtree.c
index 6f8a5e91aa1a..11cdfb56690a 100644
--- a/tar/test/test_empty_mtree.c
+++ b/tar/test/test_empty_mtree.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
/*
* Regression test: We used to get a bogus error message when we
diff --git a/tar/test/test_extract_tar_Z.c b/tar/test/test_extract_tar_Z.c
index 7c994b472a79..b03aca6d1da5 100644
--- a/tar/test/test_extract_tar_Z.c
+++ b/tar/test/test_extract_tar_Z.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
DEFINE_TEST(test_extract_tar_Z)
{
diff --git a/tar/test/test_extract_tar_bz2.c b/tar/test/test_extract_tar_bz2.c
index b734dd28ba74..02b3ee326d5b 100644
--- a/tar/test/test_extract_tar_bz2.c
+++ b/tar/test/test_extract_tar_bz2.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
DEFINE_TEST(test_extract_tar_bz2)
{
diff --git a/tar/test/test_extract_tar_grz.c b/tar/test/test_extract_tar_grz.c
index 9c0615e981f2..f0adf994dec6 100644
--- a/tar/test/test_extract_tar_grz.c
+++ b/tar/test/test_extract_tar_grz.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
DEFINE_TEST(test_extract_tar_grz)
{
diff --git a/tar/test/test_extract_tar_gz.c b/tar/test/test_extract_tar_gz.c
index 2fdb4ba7cdff..b17d66f01529 100644
--- a/tar/test/test_extract_tar_gz.c
+++ b/tar/test/test_extract_tar_gz.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
DEFINE_TEST(test_extract_tar_gz)
{
diff --git a/tar/test/test_extract_tar_lrz.c b/tar/test/test_extract_tar_lrz.c
index 56a0fb88231e..d6049809bb22 100644
--- a/tar/test/test_extract_tar_lrz.c
+++ b/tar/test/test_extract_tar_lrz.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
DEFINE_TEST(test_extract_tar_lrz)
{
diff --git a/tar/test/test_extract_tar_lz.c b/tar/test/test_extract_tar_lz.c
index 5ec7e9a48f2f..3889138928d1 100644
--- a/tar/test/test_extract_tar_lz.c
+++ b/tar/test/test_extract_tar_lz.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
DEFINE_TEST(test_extract_tar_lz)
{
diff --git a/tar/test/test_extract_tar_lz4.c b/tar/test/test_extract_tar_lz4.c
index 150d57d71551..f0e03ed3206e 100644
--- a/tar/test/test_extract_tar_lz4.c
+++ b/tar/test/test_extract_tar_lz4.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
DEFINE_TEST(test_extract_tar_lz4)
{
diff --git a/tar/test/test_extract_tar_lzma.c b/tar/test/test_extract_tar_lzma.c
index 2fa2af049446..fd9f547fb524 100644
--- a/tar/test/test_extract_tar_lzma.c
+++ b/tar/test/test_extract_tar_lzma.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
DEFINE_TEST(test_extract_tar_lzma)
{
diff --git a/tar/test/test_extract_tar_lzo.c b/tar/test/test_extract_tar_lzo.c
index 17b4295edf63..9c05e15a6b04 100644
--- a/tar/test/test_extract_tar_lzo.c
+++ b/tar/test/test_extract_tar_lzo.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
DEFINE_TEST(test_extract_tar_lzo)
{
diff --git a/tar/test/test_extract_tar_xz.c b/tar/test/test_extract_tar_xz.c
index 860bab75acf7..8684072d76f5 100644
--- a/tar/test/test_extract_tar_xz.c
+++ b/tar/test/test_extract_tar_xz.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
DEFINE_TEST(test_extract_tar_xz)
{
diff --git a/tar/test/test_extract_tar_zstd.c b/tar/test/test_extract_tar_zstd.c
index d67170ce3433..1eced8817387 100644
--- a/tar/test/test_extract_tar_zstd.c
+++ b/tar/test/test_extract_tar_zstd.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
DEFINE_TEST(test_extract_tar_zstd)
{
diff --git a/tar/test/test_format_newc.c b/tar/test/test_format_newc.c
index 808fa4b49180..5357cc7cdae4 100644
--- a/tar/test/test_format_newc.c
+++ b/tar/test/test_format_newc.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
DEFINE_TEST(test_format_newc)
{
diff --git a/tar/test/test_help.c b/tar/test/test_help.c
index 3bb517d00cde..fd97a217b789 100644
--- a/tar/test/test_help.c
+++ b/tar/test/test_help.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: src/usr.bin/tar/test/test_help.c,v 1.2 2008/05/26 17:10:10 kientzle Exp $");
/*
* Test that "--help", "-h", and "-W help" options all work and
diff --git a/tar/test/test_leading_slash.c b/tar/test/test_leading_slash.c
index 572c45e3cbb7..ca64ad154055 100644
--- a/tar/test/test_leading_slash.c
+++ b/tar/test/test_leading_slash.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
DEFINE_TEST(test_leading_slash)
{
diff --git a/tar/test/test_missing_file.c b/tar/test/test_missing_file.c
index 808e384e10b0..1cc40f3745e8 100644
--- a/tar/test/test_missing_file.c
+++ b/tar/test/test_missing_file.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
DEFINE_TEST(test_missing_file)
{
diff --git a/tar/test/test_option_C_mtree.c b/tar/test/test_option_C_mtree.c
index ccadc389974c..25679644af61 100644
--- a/tar/test/test_option_C_mtree.c
+++ b/tar/test/test_option_C_mtree.c
@@ -26,7 +26,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
DEFINE_TEST(test_option_C_mtree)
{
diff --git a/tar/test/test_option_C_upper.c b/tar/test/test_option_C_upper.c
index 538890f58178..cadc924e1d47 100644
--- a/tar/test/test_option_C_upper.c
+++ b/tar/test/test_option_C_upper.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
DEFINE_TEST(test_option_C_upper)
{
diff --git a/tar/test/test_option_H_upper.c b/tar/test/test_option_H_upper.c
index 2c2ad33ce75b..097a9729d26f 100644
--- a/tar/test/test_option_H_upper.c
+++ b/tar/test/test_option_H_upper.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
DEFINE_TEST(test_option_H_upper)
{
diff --git a/tar/test/test_option_L_upper.c b/tar/test/test_option_L_upper.c
index 5697b0f293c2..fd1ed0a52c76 100644
--- a/tar/test/test_option_L_upper.c
+++ b/tar/test/test_option_L_upper.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
DEFINE_TEST(test_option_L_upper)
{
diff --git a/tar/test/test_option_O_upper.c b/tar/test/test_option_O_upper.c
index b9c8c0cad109..a5540dbe8417 100644
--- a/tar/test/test_option_O_upper.c
+++ b/tar/test/test_option_O_upper.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
static const char *test4out[] = {"file1", "file2", NULL};
static const char *test5err[] = {"file1", "file2", NULL};
diff --git a/tar/test/test_option_T_upper.c b/tar/test/test_option_T_upper.c
index f2b65d7bdc23..c64767fcfb84 100644
--- a/tar/test/test_option_T_upper.c
+++ b/tar/test/test_option_T_upper.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: src/usr.bin/tar/test/test_option_T.c,v 1.3 2008/08/15 06:12:02 kientzle Exp $");
static int
tryMakeFile(const char *fn)
diff --git a/tar/test/test_option_U_upper.c b/tar/test/test_option_U_upper.c
index d864e13c4f6b..4518a5f9fd8e 100644
--- a/tar/test/test_option_U_upper.c
+++ b/tar/test/test_option_U_upper.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
DEFINE_TEST(test_option_U_upper)
{
diff --git a/tar/test/test_option_X_upper.c b/tar/test/test_option_X_upper.c
index 4916af2970e8..b5ea98b9a0d7 100644
--- a/tar/test/test_option_X_upper.c
+++ b/tar/test/test_option_X_upper.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
DEFINE_TEST(test_option_X_upper)
{
diff --git a/tar/test/test_option_a.c b/tar/test/test_option_a.c
index d9eed8777ff2..52797411c751 100644
--- a/tar/test/test_option_a.c
+++ b/tar/test/test_option_a.c
@@ -24,7 +24,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
DEFINE_TEST(test_option_a)
{
diff --git a/tar/test/test_option_acls.c b/tar/test/test_option_acls.c
index f7451c8eb36b..333ac2e4fb47 100644
--- a/tar/test/test_option_acls.c
+++ b/tar/test/test_option_acls.c
@@ -23,7 +23,6 @@
* 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[] = {
diff --git a/tar/test/test_option_b.c b/tar/test/test_option_b.c
index 0eee80d86f49..d7e0f399c297 100644
--- a/tar/test/test_option_b.c
+++ b/tar/test/test_option_b.c
@@ -23,22 +23,23 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
#define USTAR_OPT " --format=ustar"
DEFINE_TEST(test_option_b)
{
char *testprog_ustar;
+ size_t testprog_ustar_len;
assertMakeFile("file1", 0644, "file1");
if (systemf("cat file1 > test_cat.out 2> test_cat.err") != 0) {
skipping("This test requires a `cat` program");
return;
}
- testprog_ustar = malloc(strlen(testprog) + sizeof(USTAR_OPT) + 1);
- strcpy(testprog_ustar, testprog);
- strcat(testprog_ustar, USTAR_OPT);
+ testprog_ustar_len = strlen(testprog) + sizeof(USTAR_OPT) + 1;
+ testprog_ustar = malloc(testprog_ustar_len);
+ strncpy(testprog_ustar, testprog, testprog_ustar_len);
+ strncat(testprog_ustar, USTAR_OPT, testprog_ustar_len);
/*
* Bsdtar does not pad if the output is going directly to a disk file.
diff --git a/tar/test/test_option_b64encode.c b/tar/test/test_option_b64encode.c
index 1d0420430e09..b9a2b809ea4a 100644
--- a/tar/test/test_option_b64encode.c
+++ b/tar/test/test_option_b64encode.c
@@ -24,7 +24,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
DEFINE_TEST(test_option_b64encode)
{
diff --git a/tar/test/test_option_exclude.c b/tar/test/test_option_exclude.c
index 1345f70aa160..b21ec624aec2 100644
--- a/tar/test/test_option_exclude.c
+++ b/tar/test/test_option_exclude.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
DEFINE_TEST(test_option_exclude)
{
diff --git a/tar/test/test_option_exclude_vcs.c b/tar/test/test_option_exclude_vcs.c
index 202151139996..ec4dc5594f5c 100644
--- a/tar/test/test_option_exclude_vcs.c
+++ b/tar/test/test_option_exclude_vcs.c
@@ -23,10 +23,10 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
DEFINE_TEST(test_option_exclude_vcs)
{
+ assertUmask(0);
assertMakeDir("in", 0755);
assertChdir("in");
assertMakeFile("file", 0644, "");
diff --git a/tar/test/test_option_fflags.c b/tar/test/test_option_fflags.c
index f223feb19069..045c780edefc 100644
--- a/tar/test/test_option_fflags.c
+++ b/tar/test/test_option_fflags.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
#if defined(_WIN32) && !defined(__CYGWIN__) && !defined(__BORLANDC__)
#define chmod _chmod
diff --git a/tar/test/test_option_gid_gname.c b/tar/test/test_option_gid_gname.c
index 4e5f51c8f486..a4cff1ab2f64 100644
--- a/tar/test/test_option_gid_gname.c
+++ b/tar/test/test_option_gid_gname.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
DEFINE_TEST(test_option_gid_gname)
{
diff --git a/tar/test/test_option_group.c b/tar/test/test_option_group.c
new file mode 100644
index 000000000000..d429ddab9f9f
--- /dev/null
+++ b/tar/test/test_option_group.c
@@ -0,0 +1,84 @@
+/*-
+ * Copyright (c) 2003-2010 Tim Kientzle
+ * Copyright (c) 2024 Haelwenn (lanodan) Monnier
+ * 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"
+
+DEFINE_TEST(test_option_group)
+{
+ char *reference, *data;
+ size_t s;
+
+ assertUmask(0);
+ assertMakeFile("file", 0644, "1234567890");
+
+ /* Create archive with no special options. */
+ failure("Error invoking %s c", testprog);
+ assertEqualInt(0,
+ systemf("%s cf archive1 --format=ustar file >stdout1.txt 2>stderr1.txt",
+ testprog));
+ assertEmptyFile("stdout1.txt");
+ assertEmptyFile("stderr1.txt");
+ reference = slurpfile(&s, "archive1");
+
+ /* Create archive with --group (numeric) */
+ failure("Error invoking %s c", testprog);
+ assertEqualInt(0,
+ systemf("%s cf archive2 --group=17 --format=ustar file >stdout2.txt 2>stderr2.txt",
+ testprog));
+ assertEmptyFile("stdout2.txt");
+ assertEmptyFile("stderr2.txt");
+ data = slurpfile(&s, "archive2");
+ assertEqualMem(data + 116, "000021 \0", 8);
+ /* Gname field in ustar header should be empty. */
+ assertEqualMem(data + 297, "\0", 1);
+ free(data);
+
+ /* Again with --group (name) */
+ failure("Error invoking %s c", testprog);
+ assertEqualInt(0,
+ systemf("%s cf archive3 --group=foofoofoo --format=ustar file >stdout3.txt 2>stderr3.txt",
+ testprog));
+ assertEmptyFile("stdout3.txt");
+ assertEmptyFile("stderr3.txt");
+ data = slurpfile(&s, "archive3");
+ /* Gid should be unchanged from original reference. */
+ assertEqualMem(data + 116, reference + 116, 8);
+ assertEqualMem(data + 297, "foofoofoo\0", 10);
+ free(data);
+
+ /* Again with --group (name:id) */
+ failure("Error invoking %s c", testprog);
+ assertEqualInt(0,
+ systemf("%s cf archive4 --group=foofoofoo:17 --format=ustar file >stdout4.txt 2>stderr4.txt",
+ testprog));
+ assertEmptyFile("stdout4.txt");
+ assertEmptyFile("stderr4.txt");
+ data = slurpfile(&s, "archive4");
+ assertEqualMem(data + 116, "000021 \0", 8);
+ assertEqualMem(data + 297, "foofoofoo\0", 10);
+ free(data);
+
+ free(reference);
+}
diff --git a/tar/test/test_option_grzip.c b/tar/test/test_option_grzip.c
index fbff252421d1..d898e4408151 100644
--- a/tar/test/test_option_grzip.c
+++ b/tar/test/test_option_grzip.c
@@ -24,7 +24,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
DEFINE_TEST(test_option_grzip)
{
diff --git a/tar/test/test_option_ignore_zeros.c b/tar/test/test_option_ignore_zeros.c
index 26c9320e3008..985ad3082fce 100644
--- a/tar/test/test_option_ignore_zeros.c
+++ b/tar/test/test_option_ignore_zeros.c
@@ -24,7 +24,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
static int
make_files(void)
diff --git a/tar/test/test_option_j.c b/tar/test/test_option_j.c
index 838234a2aeb5..cf4d91d0afac 100644
--- a/tar/test/test_option_j.c
+++ b/tar/test/test_option_j.c
@@ -24,7 +24,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
DEFINE_TEST(test_option_j)
{
diff --git a/tar/test/test_option_k.c b/tar/test/test_option_k.c
index e57cc274cfc4..873a1209b0a9 100644
--- a/tar/test/test_option_k.c
+++ b/tar/test/test_option_k.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
DEFINE_TEST(test_option_k)
{
diff --git a/tar/test/test_option_keep_newer_files.c b/tar/test/test_option_keep_newer_files.c
index 089898cc27e0..2572a98c5812 100644
--- a/tar/test/test_option_keep_newer_files.c
+++ b/tar/test/test_option_keep_newer_files.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
DEFINE_TEST(test_option_keep_newer_files)
{
diff --git a/tar/test/test_option_lrzip.c b/tar/test/test_option_lrzip.c
index 11e9827e0405..8bf4633f643e 100644
--- a/tar/test/test_option_lrzip.c
+++ b/tar/test/test_option_lrzip.c
@@ -24,7 +24,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
DEFINE_TEST(test_option_lrzip)
{
diff --git a/tar/test/test_option_lz4.c b/tar/test/test_option_lz4.c
index 70fdaac3600f..1b766d04969f 100644
--- a/tar/test/test_option_lz4.c
+++ b/tar/test/test_option_lz4.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
DEFINE_TEST(test_option_lz4)
{
diff --git a/tar/test/test_option_lzma.c b/tar/test/test_option_lzma.c
index a618ff8a3403..1d8697b53ee8 100644
--- a/tar/test/test_option_lzma.c
+++ b/tar/test/test_option_lzma.c
@@ -24,7 +24,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
DEFINE_TEST(test_option_lzma)
{
@@ -44,6 +43,7 @@ DEFINE_TEST(test_option_lzma)
if (strstr(p, "Unsupported compression") != NULL) {
skipping("This version of bsdtar was compiled "
"without lzma support");
+ free(p);
return;
}
failure("--lzma option is broken");
diff --git a/tar/test/test_option_lzop.c b/tar/test/test_option_lzop.c
index 20ef06c5c8a0..d96a14f08fea 100644
--- a/tar/test/test_option_lzop.c
+++ b/tar/test/test_option_lzop.c
@@ -24,7 +24,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
DEFINE_TEST(test_option_lzop)
{
diff --git a/tar/test/test_option_n.c b/tar/test/test_option_n.c
index f36658ef1656..a6bda0599e16 100644
--- a/tar/test/test_option_n.c
+++ b/tar/test/test_option_n.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
#ifdef HAVE_SYS_WAIT_H
#include <sys/wait.h>
diff --git a/tar/test/test_option_newer_than.c b/tar/test/test_option_newer_than.c
index 2a5fe04e6968..a250a4c8d8c6 100644
--- a/tar/test/test_option_newer_than.c
+++ b/tar/test/test_option_newer_than.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
DEFINE_TEST(test_option_newer_than)
{
diff --git a/tar/test/test_option_nodump.c b/tar/test/test_option_nodump.c
index 815b08ed9251..6a5b66e3215a 100644
--- a/tar/test/test_option_nodump.c
+++ b/tar/test/test_option_nodump.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
DEFINE_TEST(test_option_nodump)
{
diff --git a/tar/test/test_option_older_than.c b/tar/test/test_option_older_than.c
index 4bdd2edfe0bd..d57c4d414b8f 100644
--- a/tar/test/test_option_older_than.c
+++ b/tar/test/test_option_older_than.c
@@ -24,7 +24,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
DEFINE_TEST(test_option_older_than)
{
diff --git a/tar/test/test_option_owner.c b/tar/test/test_option_owner.c
new file mode 100644
index 000000000000..04c86cc0e8d4
--- /dev/null
+++ b/tar/test/test_option_owner.c
@@ -0,0 +1,84 @@
+/*-
+ * Copyright (c) 2003-2010 Tim Kientzle
+ * Copyright (c) 2024 Haelwenn (lanodan) Monnier
+ * 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"
+
+DEFINE_TEST(test_option_owner)
+{
+ char *reference, *data;
+ size_t s;
+
+ assertUmask(0);
+ assertMakeFile("file", 0644, "1234567890");
+
+ /* Create archive with no special options. */
+ failure("Error invoking %s c", testprog);
+ assertEqualInt(0,
+ systemf("%s cf archive1 --format=ustar file >stdout1.txt 2>stderr1.txt",
+ testprog));
+ assertEmptyFile("stdout1.txt");
+ assertEmptyFile("stderr1.txt");
+ reference = slurpfile(&s, "archive1");
+
+ /* Create archive with --owner (numeric) */
+ failure("Error invoking %s c", testprog);
+ assertEqualInt(0,
+ systemf("%s cf archive2 --owner=65123 --format=ustar file >stdout2.txt 2>stderr2.txt",
+ testprog));
+ assertEmptyFile("stdout2.txt");
+ assertEmptyFile("stderr2.txt");
+ data = slurpfile(&s, "archive2");
+ assertEqualMem(data + 108, "177143 \0", 8);
+ /* Uname field in ustar header should be empty. */
+ assertEqualMem(data + 265, "\0", 1);
+ free(data);
+
+ /* Again with just --owner (name) */
+ failure("Error invoking %s c", testprog);
+ assertEqualInt(0,
+ systemf("%s cf archive3 --owner=foofoofoo --format=ustar file >stdout3.txt 2>stderr3.txt",
+ testprog));
+ assertEmptyFile("stdout3.txt");
+ assertEmptyFile("stderr3.txt");
+ data = slurpfile(&s, "archive3");
+ /* Uid should be unchanged from original reference. */
+ assertEqualMem(data + 108, reference + 108, 8);
+ assertEqualMem(data + 265, "foofoofoo\0", 10);
+ free(data);
+
+ /* Again with just --owner (name:id) */
+ failure("Error invoking %s c", testprog);
+ assertEqualInt(0,
+ systemf("%s cf archive4 --owner=foofoofoo:65123 --format=ustar file >stdout4.txt 2>stderr4.txt",
+ testprog));
+ assertEmptyFile("stdout4.txt");
+ assertEmptyFile("stderr4.txt");
+ data = slurpfile(&s, "archive4");
+ assertEqualMem(data + 108, "177143 \0", 8);
+ assertEqualMem(data + 265, "foofoofoo\0", 10);
+ free(data);
+
+ free(reference);
+}
diff --git a/tar/test/test_option_passphrase.c b/tar/test/test_option_passphrase.c
index 337292c95bfc..74f3d3d5d031 100644
--- a/tar/test/test_option_passphrase.c
+++ b/tar/test/test_option_passphrase.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
DEFINE_TEST(test_option_passphrase)
{
diff --git a/tar/test/test_option_q.c b/tar/test/test_option_q.c
index 287e67afa518..fd4b55e545ae 100644
--- a/tar/test/test_option_q.c
+++ b/tar/test/test_option_q.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: src/usr.bin/tar/test/test_option_q.c,v 1.3 2008/08/22 01:35:08 kientzle Exp $");
DEFINE_TEST(test_option_q)
{
diff --git a/tar/test/test_option_r.c b/tar/test/test_option_r.c
index 287e80939adf..655b973ad1e2 100644
--- a/tar/test/test_option_r.c
+++ b/tar/test/test_option_r.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
/*
* Also see test_option_q for additional validation of -r support.
diff --git a/tar/test/test_option_s.c b/tar/test/test_option_s.c
index fa799a295d01..564793b97d5e 100644
--- a/tar/test/test_option_s.c
+++ b/tar/test/test_option_s.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: src/usr.bin/tar/test/test_option_T.c,v 1.3 2008/08/15 06:12:02 kientzle Exp $");
DEFINE_TEST(test_option_s)
{
@@ -89,6 +88,17 @@ DEFINE_TEST(test_option_s)
assertFileContents("bar", 3, "test4/in/d1/baz");
/*
+ * Test 4b: Multiple substitutions behavior with option b).
+ */
+ assertMakeDir("test4b", 0755);
+ systemf("%s -cf test4b.tar in/d1/foo in/d1/bar",
+ testprog);
+ systemf("%s -xf test4b.tar -s /oo/ar/ -s }ar}az}b -C test4b",
+ testprog);
+ assertFileContents("foo", 3, "test4b/in/d1/faz");
+ assertFileContents("bar", 3, "test4b/in/d1/baz");
+
+ /*
* Test 5: Name-switching substitutions when extracting archive.
*/
assertMakeDir("test5", 0755);
diff --git a/tar/test/test_option_safe_writes.c b/tar/test/test_option_safe_writes.c
index 7b42e8f62253..d1e36cfd4736 100644
--- a/tar/test/test_option_safe_writes.c
+++ b/tar/test/test_option_safe_writes.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
DEFINE_TEST(test_option_safe_writes)
{
diff --git a/tar/test/test_option_uid_uname.c b/tar/test/test_option_uid_uname.c
index 80c061961488..261e3b86565b 100644
--- a/tar/test/test_option_uid_uname.c
+++ b/tar/test/test_option_uid_uname.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
DEFINE_TEST(test_option_uid_uname)
{
diff --git a/tar/test/test_option_uuencode.c b/tar/test/test_option_uuencode.c
index a28a8e3407a3..4bb6e0898c2b 100644
--- a/tar/test/test_option_uuencode.c
+++ b/tar/test/test_option_uuencode.c
@@ -24,7 +24,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
DEFINE_TEST(test_option_uuencode)
{
diff --git a/tar/test/test_option_xattrs.c b/tar/test/test_option_xattrs.c
index 79dfff528303..eef6c779bb52 100644
--- a/tar/test/test_option_xattrs.c
+++ b/tar/test/test_option_xattrs.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
DEFINE_TEST(test_option_xattrs)
{
diff --git a/tar/test/test_option_xz.c b/tar/test/test_option_xz.c
index 91da0730ac94..45163e735f19 100644
--- a/tar/test/test_option_xz.c
+++ b/tar/test/test_option_xz.c
@@ -24,7 +24,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
DEFINE_TEST(test_option_xz)
{
diff --git a/tar/test/test_option_z.c b/tar/test/test_option_z.c
index 59744999fc5c..8e10e37ba22e 100644
--- a/tar/test/test_option_z.c
+++ b/tar/test/test_option_z.c
@@ -24,7 +24,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
DEFINE_TEST(test_option_z)
{
diff --git a/tar/test/test_option_zstd.c b/tar/test/test_option_zstd.c
index 73965e33f3af..f9983670249c 100644
--- a/tar/test/test_option_zstd.c
+++ b/tar/test/test_option_zstd.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
DEFINE_TEST(test_option_zstd)
{
diff --git a/tar/test/test_patterns.c b/tar/test/test_patterns.c
index e1449008b6e1..64f8fffe90f9 100644
--- a/tar/test/test_patterns.c
+++ b/tar/test/test_patterns.c
@@ -24,7 +24,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: src/usr.bin/tar/test/test_patterns.c,v 1.6 2008/08/21 22:28:00 kientzle Exp $");
DEFINE_TEST(test_patterns)
{
diff --git a/tar/test/test_print_longpath.c b/tar/test/test_print_longpath.c
index 4bac1679cc97..a21651fa15eb 100644
--- a/tar/test/test_print_longpath.c
+++ b/tar/test/test_print_longpath.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD$");
DEFINE_TEST(test_print_longpath)
{
diff --git a/tar/test/test_stdio.c b/tar/test/test_stdio.c
index d6650a5eb20a..d046727a2dd3 100644
--- a/tar/test/test_stdio.c
+++ b/tar/test/test_stdio.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: src/usr.bin/tar/test/test_stdio.c,v 1.2 2008/05/26 17:10:10 kientzle Exp $");
DEFINE_TEST(test_stdio)
{
diff --git a/tar/test/test_strip_components.c b/tar/test/test_strip_components.c
index 090fb0dbf913..9bf79ab7cf20 100644
--- a/tar/test/test_strip_components.c
+++ b/tar/test/test_strip_components.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: src/usr.bin/tar/test/test_strip_components.c,v 1.2 2008/11/10 05:24:13 kientzle Exp $");
DEFINE_TEST(test_strip_components)
{
diff --git a/tar/test/test_symlink_dir.c b/tar/test/test_symlink_dir.c
index 5836647c1a23..4c5666204388 100644
--- a/tar/test/test_symlink_dir.c
+++ b/tar/test/test_symlink_dir.c
@@ -23,7 +23,6 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "test.h"
-__FBSDID("$FreeBSD: src/usr.bin/tar/test/test_symlink_dir.c,v 1.1 2008/09/14 02:16:04 kientzle Exp $");
/*
* tar -x -P should follow existing symlinks for dirs, but not other
diff --git a/tar/util.c b/tar/util.c
index 8ebec64c48d9..37c3a23231bd 100644
--- a/tar/util.c
+++ b/tar/util.c
@@ -24,7 +24,6 @@
*/
#include "bsdtar_platform.h"
-__FBSDID("$FreeBSD: src/usr.bin/tar/util.c,v 1.23 2008/12/15 06:00:25 kientzle Exp $");
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
@@ -63,7 +62,7 @@ __FBSDID("$FreeBSD: src/usr.bin/tar/util.c,v 1.23 2008/12/15 06:00:25 kientzle E
#include "err.h"
#include "passphrase.h"
-static size_t bsdtar_expand_char(char *, size_t, char);
+static size_t bsdtar_expand_char(char *, size_t, size_t, char);
static const char *strip_components(const char *path, int elements);
#if defined(_WIN32) && !defined(__CYGWIN__)
@@ -173,12 +172,12 @@ safe_fprintf(FILE *f, const char *fmt, ...)
/* Not printable, format the bytes. */
while (n-- > 0)
i += (unsigned)bsdtar_expand_char(
- outbuff, i, *p++);
+ outbuff, sizeof(outbuff), i, *p++);
}
} else {
/* After any conversion failure, don't bother
* trying to convert the rest. */
- i += (unsigned)bsdtar_expand_char(outbuff, i, *p++);
+ i += (unsigned)bsdtar_expand_char(outbuff, sizeof(outbuff), i, *p++);
try_wc = 0;
}
@@ -200,7 +199,7 @@ safe_fprintf(FILE *f, const char *fmt, ...)
* Render an arbitrary sequence of bytes into printable ASCII characters.
*/
static size_t
-bsdtar_expand_char(char *buff, size_t offset, char c)
+bsdtar_expand_char(char *buff, size_t buffsize, size_t offset, char c)
{
size_t i = offset;
@@ -221,7 +220,7 @@ bsdtar_expand_char(char *buff, size_t offset, char c)
case '\v': buff[i++] = 'v'; break;
case '\\': buff[i++] = '\\'; break;
default:
- sprintf(buff + i, "%03o", 0xFF & (int)c);
+ snprintf(buff + i, buffsize - i, "%03o", 0xFF & (int)c);
i += 3;
}
}
@@ -309,11 +308,12 @@ set_chdir(struct bsdtar *bsdtar, const char *newdir)
/* The -C /foo -C bar case; concatenate */
char *old_pending = bsdtar->pending_chdir;
size_t old_len = strlen(old_pending);
- bsdtar->pending_chdir = malloc(old_len + strlen(newdir) + 2);
+ size_t new_len = old_len + strlen(newdir) + 2;
+ bsdtar->pending_chdir = malloc(new_len);
if (old_pending[old_len - 1] == '/')
old_pending[old_len - 1] = '\0';
if (bsdtar->pending_chdir != NULL)
- sprintf(bsdtar->pending_chdir, "%s/%s",
+ snprintf(bsdtar->pending_chdir, new_len, "%s/%s",
old_pending, newdir);
free(old_pending);
}
@@ -470,7 +470,7 @@ edit_pathname(struct bsdtar *bsdtar, struct archive_entry *entry)
const char *original_name = name;
const char *hardlinkname = archive_entry_hardlink(entry);
const char *original_hardlinkname = hardlinkname;
-#if defined(HAVE_REGEX_H) || defined(HAVE_PCREPOSIX_H)
+#if defined(HAVE_REGEX_H) || defined(HAVE_PCREPOSIX_H) || defined(HAVE_PCRE2POSIX_H)
char *subst_name;
int r;
@@ -667,13 +667,9 @@ list_item_verbose(struct bsdtar *bsdtar, FILE *out, struct archive_entry *entry)
time_t tim;
static time_t now;
struct tm *ltime;
-#if defined(HAVE_LOCALTIME_R) || defined(HAVE__LOCALTIME64_S)
+#if defined(HAVE_LOCALTIME_R) || defined(HAVE_LOCALTIME_S)
struct tm tmbuf;
#endif
-#if defined(HAVE__LOCALTIME64_S)
- errno_t terr;
- __time64_t tmptime;
-#endif
/*
* We avoid collecting the entire list in memory at once by
@@ -695,7 +691,7 @@ list_item_verbose(struct bsdtar *bsdtar, FILE *out, struct archive_entry *entry)
/* Use uname if it's present, else uid. */
p = archive_entry_uname(entry);
if ((p == NULL) || (*p == '\0')) {
- sprintf(tmp, "%lu ",
+ snprintf(tmp, sizeof(tmp), "%lu ",
(unsigned long)archive_entry_uid(entry));
p = tmp;
}
@@ -710,7 +706,7 @@ list_item_verbose(struct bsdtar *bsdtar, FILE *out, struct archive_entry *entry)
fprintf(out, "%s", p);
w = strlen(p);
} else {
- sprintf(tmp, "%lu",
+ snprintf(tmp, sizeof(tmp), "%lu",
(unsigned long)archive_entry_gid(entry));
w = strlen(tmp);
fprintf(out, "%s", tmp);
@@ -723,7 +719,7 @@ list_item_verbose(struct bsdtar *bsdtar, FILE *out, struct archive_entry *entry)
*/
if (archive_entry_filetype(entry) == AE_IFCHR
|| archive_entry_filetype(entry) == AE_IFBLK) {
- sprintf(tmp, "%lu,%lu",
+ snprintf(tmp, sizeof(tmp), "%lu,%lu",
(unsigned long)archive_entry_rdevmajor(entry),
(unsigned long)archive_entry_rdevminor(entry));
} else {
@@ -745,15 +741,10 @@ list_item_verbose(struct bsdtar *bsdtar, FILE *out, struct archive_entry *entry)
fmt = bsdtar->day_first ? DAY_FMT " %b %Y" : "%b " DAY_FMT " %Y";
else
fmt = bsdtar->day_first ? DAY_FMT " %b %H:%M" : "%b " DAY_FMT " %H:%M";
-#if defined(HAVE_LOCALTIME_R)
+#if defined(HAVE_LOCALTIME_S)
+ ltime = localtime_s(&tmbuf, &tim) ? NULL : &tmbuf;
+#elif defined(HAVE_LOCALTIME_R)
ltime = localtime_r(&tim, &tmbuf);
-#elif defined(HAVE__LOCALTIME64_S)
- tmptime = tim;
- terr = _localtime64_s(&tmbuf, &tmptime);
- if (terr)
- ltime = NULL;
- else
- ltime = &tmbuf;
#else
ltime = localtime(&tim);
#endif
diff --git a/tar/write.c b/tar/write.c
index f2fb1c356c13..5c7b13ae682f 100644
--- a/tar/write.c
+++ b/tar/write.c
@@ -25,7 +25,6 @@
*/
#include "bsdtar_platform.h"
-__FBSDID("$FreeBSD: src/usr.bin/tar/write.c,v 1.79 2008/11/27 05:49:52 kientzle Exp $");
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
@@ -694,6 +693,8 @@ append_archive(struct bsdtar *bsdtar, struct archive *a, struct archive *ina)
while (ARCHIVE_OK == (e = archive_read_next_header(ina, &in_entry))) {
if (archive_match_excluded(bsdtar->matching, in_entry))
continue;
+ if(edit_pathname(bsdtar, in_entry))
+ continue;
if ((bsdtar->flags & OPTFLAG_INTERACTIVE) &&
!yes("copy '%s'", archive_entry_pathname(in_entry)))
continue;
diff --git a/test_utils/test_common.h b/test_utils/test_common.h
index 6250235c6ca9..8e1ec82436f8 100644
--- a/test_utils/test_common.h
+++ b/test_utils/test_common.h
@@ -21,8 +21,6 @@
* 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
@@ -134,16 +132,6 @@
#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
@@ -178,6 +166,8 @@
/* 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)
+#define assertEqualAddress(v1,v2) \
+ assertion_equal_address(__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)
@@ -291,6 +281,7 @@ int assertion_compare_fflags(const char *, int, const char *, 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_address(const char *, int, const void *, const char *, const void *, 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);
diff --git a/test_utils/test_main.c b/test_utils/test_main.c
index 116da2315439..6617732a335b 100644
--- a/test_utils/test_main.c
+++ b/test_utils/test_main.c
@@ -327,7 +327,7 @@ my_GetFileInformationByName(const char *path, BY_HANDLE_FILE_INFORMATION *bhfi)
int r;
memset(bhfi, 0, sizeof(*bhfi));
- h = CreateFile(path, FILE_READ_ATTRIBUTES, 0, NULL,
+ h = CreateFileA(path, FILE_READ_ATTRIBUTES, 0, NULL,
OPEN_EXISTING, FILE_FLAG_BACKUP_SEMANTICS, NULL);
if (h == INVALID_HANDLE_VALUE)
return (0);
@@ -426,7 +426,7 @@ failure(const char *fmt, ...)
nextmsg = NULL;
} else {
va_start(ap, fmt);
- vsprintf(msgbuff, fmt, ap);
+ vsnprintf(msgbuff, sizeof(msgbuff), fmt, ap);
va_end(ap);
nextmsg = msgbuff;
}
@@ -551,7 +551,7 @@ test_skipping(const char *fmt, ...)
va_list ap;
va_start(ap, fmt);
- vsprintf(buff, fmt, ap);
+ vsnprintf(buff, sizeof(buff), fmt, ap);
va_end(ap);
/* Use failure() message if set. */
msg = nextmsg;
@@ -625,6 +625,21 @@ assertion_equal_int(const char *file, int line,
return (0);
}
+/* Verify two pointers are equal. */
+int
+assertion_equal_address(const char *file, int line,
+ const void *v1, const char *e1, const void *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=0x%llx\n", e1, (unsigned long long)(uintptr_t)v1);
+ logprintf(" %s=0x%llx\n", e2, (unsigned long long)(uintptr_t)v2);
+ failure_finish(extra);
+ return (0);
+}
+
/*
* Utility to convert a single UTF-8 sequence.
*/
@@ -1245,7 +1260,7 @@ assertion_file_contains_lines_any_order(const char *file, int line,
c = *p;
}
if (actual_count) {
- actual = calloc(sizeof(char *), actual_count);
+ actual = calloc(actual_count, sizeof(char *));
if (actual == NULL) {
failure_start(pathname, line, "Can't allocate memory");
failure_finish(NULL);
@@ -1432,7 +1447,7 @@ assertion_file_time(const char *file, int 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,
+ h = CreateFileA(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);
@@ -1970,7 +1985,12 @@ assertion_make_file(const char *file, int line,
failure_finish(NULL);
return (0);
}
- if (0 != chmod(path, mode)) {
+#ifdef HAVE_FCHMOD
+ if (0 != fchmod(fd, mode))
+#else
+ if (0 != chmod(path, mode))
+#endif
+ {
failure_start(file, line, "Could not chmod %s", path);
failure_finish(NULL);
close(fd);
@@ -2340,7 +2360,7 @@ static void assert_version_id(char **qq, size_t *ss)
q += 3;
s -= 3;
}
-
+
/* Skip a single trailing a,b,c, or d. */
if (*q == 'a' || *q == 'b' || *q == 'c' || *q == 'd')
++q;
@@ -2386,7 +2406,7 @@ void assertVersion(const char *prog, const char *base)
/* 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);
@@ -2724,7 +2744,7 @@ canNodump(void)
/* 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;
@@ -3065,7 +3085,7 @@ systemf(const char *fmt, ...)
int r;
va_start(ap, fmt);
- vsprintf(buff, fmt, ap);
+ vsnprintf(buff, sizeof(buff), fmt, ap);
if (verbosity > VERBOSITY_FULL)
logprintf("Cmd: %s\n", buff);
r = system(buff);
@@ -3090,7 +3110,7 @@ slurpfile(size_t * sizep, const char *fmt, ...)
int r;
va_start(ap, fmt);
- vsprintf(filename, fmt, ap);
+ vsnprintf(filename, sizeof(filename), fmt, ap);
va_end(ap);
f = fopen(filename, "rb");
@@ -3157,7 +3177,7 @@ extract_reference_file(const char *name)
char buff[1024];
FILE *in, *out;
- sprintf(buff, "%s/%s.uu", refdir, name);
+ snprintf(buff, sizeof(buff), "%s/%s.uu", refdir, name);
in = fopen(buff, "r");
failure("Couldn't open reference file %s", buff);
assert(in != NULL);
@@ -3185,14 +3205,12 @@ extract_reference_file(const char *name)
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;
- }
+ 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;
@@ -3218,7 +3236,7 @@ copy_reference_file(const char *name)
FILE *in, *out;
size_t rbytes;
- sprintf(buff, "%s/%s", refdir, name);
+ snprintf(buff, sizeof(buff), "%s/%s", refdir, name);
in = fopen(buff, "rb");
failure("Couldn't open reference file %s", buff);
assert(in != NULL);
@@ -3545,7 +3563,7 @@ test_run(int i, const char *tmpdir)
exit(1);
}
/* Create a log file for this test. */
- sprintf(logfilename, "%s.log", tests[i].name);
+ snprintf(logfilename, sizeof(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. */
@@ -3859,7 +3877,15 @@ 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;
+ int testprogdir_len;
+#ifdef PROGRAM
+ int tmp2_len;
+#endif
time_t now;
+ struct tm *tmptr;
+#if defined(HAVE_LOCALTIME_R) || defined(HAVE_LOCALTIME_S)
+ struct tm tmbuf;
+#endif
char *refdir_alloc = NULL;
const char *progname;
char **saved_argv;
@@ -3895,12 +3921,13 @@ main(int argc, char **argv)
* tree.
*/
progname = p = argv[0];
- if ((testprogdir = (char *)malloc(strlen(progname) + 1)) == NULL)
+ testprogdir_len = strlen(progname) + 1;
+ if ((testprogdir = (char *)malloc(testprogdir_len)) == NULL)
{
fprintf(stderr, "ERROR: Out of memory.");
exit(1);
}
- strcpy(testprogdir, progname);
+ strncpy(testprogdir, progname, testprogdir_len);
while (*p != '\0') {
/* Support \ or / dir separators for Windows compat. */
if (*p == '/' || *p == '\\')
@@ -4042,20 +4069,21 @@ main(int argc, char **argv)
#ifdef PROGRAM
if (testprogfile == NULL)
{
- if ((tmp2 = (char *)malloc(strlen(testprogdir) + 1 +
- strlen(PROGRAM) + 1)) == NULL)
+ tmp2_len = strlen(testprogdir) + 1 + strlen(PROGRAM) + 1;
+ if ((tmp2 = (char *)malloc(tmp2_len)) == NULL)
{
fprintf(stderr, "ERROR: Out of memory.");
exit(1);
}
- strcpy(tmp2, testprogdir);
- strcat(tmp2, "/");
- strcat(tmp2, PROGRAM);
+ strncpy(tmp2, testprogdir, tmp2_len);
+ strncat(tmp2, "/", tmp2_len);
+ strncat(tmp2, PROGRAM, tmp2_len);
testprogfile = tmp2;
}
{
char *testprg;
+ int testprg_len;
#if defined(_WIN32) && !defined(__CYGWIN__)
/* Command.com sometimes rejects '/' separators. */
testprg = strdup(testprogfile);
@@ -4066,10 +4094,11 @@ main(int argc, char **argv)
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, "\"");
+ testprg_len = strlen(testprogfile) + 3;
+ testprg = malloc(testprg_len);
+ strncpy(testprg, "\"", testprg_len);
+ strncat(testprg, testprogfile, testprg_len);
+ strncat(testprg, "\"", testprg_len);
testprog = testprg;
}
#endif
@@ -4091,9 +4120,15 @@ main(int argc, char **argv)
*/
now = time(NULL);
for (i = 0; ; i++) {
+#if defined(HAVE_LOCALTIME_S)
+ tmptr = localtime_s(&tmbuf, &now) ? NULL : &tmbuf;
+#elif defined(HAVE_LOCALTIME_R)
+ tmptr = localtime_r(&now, &tmbuf);
+#else
+ tmptr = localtime(&now);
+#endif
strftime(tmpdir_timestamp, sizeof(tmpdir_timestamp),
- "%Y-%m-%dT%H.%M.%S",
- localtime(&now));
+ "%Y-%m-%dT%H.%M.%S", tmptr);
if ((strlen(tmp) + 1 + strlen(progname) + 1 +
strlen(tmpdir_timestamp) + 1 + 3) >
(sizeof(tmpdir) / sizeof(char))) {
@@ -4155,7 +4190,6 @@ main(int argc, char **argv)
free(refdir_alloc);
free(testprogdir);
usage(progname);
- return (1);
}
for (i = 0; i < test_num; i++) {
tests_run++;
diff --git a/unzip/CMakeLists.txt b/unzip/CMakeLists.txt
new file mode 100644
index 000000000000..150eb2c6b05d
--- /dev/null
+++ b/unzip/CMakeLists.txt
@@ -0,0 +1,41 @@
+############################################
+#
+# How to build bsdunzip
+#
+############################################
+IF(ENABLE_UNZIP)
+
+ SET(bsdunzip_SOURCES
+ bsdunzip.c
+ bsdunzip.h
+ bsdunzip_platform.h
+ cmdline.c
+ la_getline.c
+ la_queue.h
+ ../libarchive_fe/err.c
+ ../libarchive_fe/err.h
+ ../libarchive_fe/lafe_platform.h
+ ../libarchive_fe/passphrase.c
+ ../libarchive_fe/passphrase.h
+ )
+ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../libarchive_fe)
+
+ # bsdunzip documentation
+ SET(bsdunzip_MANS bsdunzip.1)
+
+ # How to build bsdunzip
+ ADD_EXECUTABLE(bsdunzip ${bsdunzip_SOURCES})
+ IF(ENABLE_UNZIP_SHARED)
+ TARGET_LINK_LIBRARIES(bsdunzip archive ${ADDITIONAL_LIBS})
+ ELSE(ENABLE_UNZIP_SHARED)
+ TARGET_LINK_LIBRARIES(bsdunzip archive_static ${ADDITIONAL_LIBS})
+ SET_TARGET_PROPERTIES(bsdunzip PROPERTIES COMPILE_DEFINITIONS
+ LIBARCHIVE_STATIC)
+ ENDIF(ENABLE_UNZIP_SHARED)
+
+ # Installation rules
+ INSTALL(TARGETS bsdunzip RUNTIME DESTINATION bin)
+ INSTALL_MAN(${bsdunzip_MANS})
+ENDIF(ENABLE_UNZIP)
+
+add_subdirectory(test)
diff --git a/unzip/bsdunzip.1 b/unzip/bsdunzip.1
new file mode 100644
index 000000000000..a67ca2327066
--- /dev/null
+++ b/unzip/bsdunzip.1
@@ -0,0 +1,218 @@
+.\"-
+.\" Copyright (c) 2007-2008 Dag-Erling Smørgrav
+.\" 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 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.
+.\"
+.Dd June 27, 2023
+.Dt BSDUNZIP 1
+.Os
+.Sh NAME
+.Nm bsdunzip
+.Nd extract files from a ZIP archive
+.Sh SYNOPSIS
+.Nm
+.Op Fl aCcfjLlnopqtuvy
+.Op { Fl O | Fl I No } Ar encoding
+.Op Fl d Ar dir
+.Op Fl x Ar pattern
+.Op Fl P Ar password
+.Ar zipfile
+.Op Ar member ...
+.Sh DESCRIPTION
+.\" ...
+The following options are available:
+.Bl -tag -width Fl
+.It Fl a
+When extracting a text file, convert DOS-style line endings to
+Unix-style line endings.
+.It Fl C
+Match file names case-insensitively.
+.It Fl c
+Extract to stdout/screen.
+When extracting files from the zipfile, they are written to stdout.
+This is similar to
+.Fl p ,
+but does not suppress normal output.
+.It Fl d Ar dir
+Extract files into the specified directory rather than the current
+directory.
+.It Fl f
+Update existing.
+Extract only files from the zipfile if a file with the same name
+already exists on disk and is older than the former.
+Otherwise, the file is silently skipped.
+.It Fl I Ar encoding
+.It Fl O Ar encoding
+Convert filenames from the specified encoding.
+.It Fl j
+Ignore directories stored in the zipfile; instead, extract all files
+directly into the extraction directory.
+.It Fl L
+Convert the names of the extracted files and directories to lowercase.
+.It Fl l
+List, rather than extract, the contents of the zipfile.
+.It Fl n
+No overwrite.
+When extracting a file from the zipfile, if a file with the same name
+already exists on disk, the file is silently skipped.
+.It Fl o
+Overwrite.
+When extracting a file from the zipfile, if a file with the same name
+already exists on disk, the existing file is replaced with the file
+from the zipfile.
+.It Fl p
+Extract to stdout.
+When extracting files from the zipfile, they are written to stdout.
+The normal output is suppressed as if
+.Fl q
+was specified.
+.It Fl P Ar password
+Extract encrypted files using a password.
+Putting a password on the command line using this option can be
+insecure.
+.It Fl q
+Quiet: print less information while extracting.
+.It Fl t
+Test: do not extract anything, but verify the checksum of every file
+in the archive.
+.It Fl u
+Update.
+When extracting a file from the zipfile, if a file with the same name
+already exists on disk, the existing file is replaced with the file
+from the zipfile if and only if the latter is newer than the former.
+Otherwise, the file is silently skipped.
+.It Fl v
+List verbosely, rather than extract, the contents of the zipfile.
+This differs from
+.Fl l
+by using the long listing.
+Note that most of the data is currently fake and does not reflect the
+content of the archive.
+.It Fl x Ar pattern
+Exclude files matching the pattern
+.Ar pattern .
+.It Fl y
+Print four digit years in listings instead of two.
+.It Fl Z Ar mode
+Emulate
+.Xr zipinfo 1L
+mode.
+Enabling
+.Xr zipinfo 1L
+mode changes the way in which additional arguments are parsed.
+Currently only
+.Xr zipinfo 1L
+mode 1 is supported, which lists the file names one per line.
+.It Ar [member ...]
+Optional list of members to extract from the zipfile.
+Can include patterns, e.g.,
+.Ar 'memberdir/*'
+will extract all files and dirs below memberdir.
+.El
+.Pp
+Note that only one of
+.Fl n ,
+.Fl o ,
+and
+.Fl u
+may be specified.
+If specified filename is
+.Qq - ,
+then data is read from
+.Va stdin .
+.Sh ENVIRONMENT
+If the
+.Ev UNZIP_DEBUG
+environment variable is defined, the
+.Fl q
+command-line option has no effect, and additional debugging
+information will be printed to
+.Va stderr .
+.Sh COMPATIBILITY
+The
+.Nm
+utility aims to be sufficiently compatible with other implementations
+to serve as a drop-in replacement in the context of the
+.Xr ports 7
+system.
+No attempt has been made to replicate functionality which is not
+required for that purpose.
+.Pp
+For compatibility reasons, command-line options will be recognized if
+they are listed not only before but also after the name of the
+zipfile.
+.Pp
+Normally, the
+.Fl a
+option should only affect files which are marked as text files in the
+zipfile's central directory.
+Since the
+.Xr archive 3
+library does not provide access to that information, it is not available
+to the
+.Nm
+utility.
+Instead, the
+.Nm
+utility will assume that a file is a text file if no non-ASCII
+characters are present within the first block of data decompressed for
+that file.
+If non-ASCII characters appear in subsequent blocks of data, a warning
+will be issued.
+.Pp
+The
+.Nm
+utility is only able to process ZIP archives handled by
+.Xr libarchive 3 .
+Depending on the installed version of
+.Xr libarchive 3 ,
+this may or may not include self-extracting or ZIPX archives.
+.Sh SEE ALSO
+.Xr libarchive 3
+.Sh HISTORY
+The
+.Nm
+utility appeared in
+.Fx 8.0 .
+.Sh AUTHORS
+The
+.Nm
+utility and this manual page were written by
+.An Dag-Erling Sm\(/orgrav Aq Mt des@FreeBSD.org .
+It uses the
+.Xr archive 3
+library developed by
+.An Tim Kientzle Aq Mt kientzle@FreeBSD.org .
+.Sh CAVEATS
+The
+.Nm
+utility performs two scans of the command-line for arguments before
+and after the archive name, so as to maintain compatibility with
+Info-ZIP unzip.
+As a result, the POSIX
+.Ql --
+double-dash string used to separate options from arguments will need to
+be repeated.
+For example, to extract a "-a.jpg" from "-b.zip" with overwrite, one
+would need to invoke
+.Dl bsdunzip -o -- -a.jpg -- -b.zip
diff --git a/unzip/bsdunzip.c b/unzip/bsdunzip.c
new file mode 100644
index 000000000000..af3fb14c3636
--- /dev/null
+++ b/unzip/bsdunzip.c
@@ -0,0 +1,1290 @@
+/*-
+ * SPDX-License-Identifier: BSD-2-Clause
+ *
+ * Copyright (c) 2009, 2010 Joerg Sonnenberger <joerg@NetBSD.org>
+ * Copyright (c) 2007-2008 Dag-Erling Smørgrav
+ * 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
+ * in this position and unchanged.
+ * 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 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.
+ *
+ * This file would be much shorter if we didn't care about command-line
+ * compatibility with Info-ZIP's UnZip, which requires us to duplicate
+ * parts of libarchive in order to gain more detailed control of its
+ * behaviour for the purpose of implementing the -n, -o, -L and -a
+ * options.
+ */
+
+#include "bsdunzip_platform.h"
+
+#ifdef HAVE_SYS_QUEUE_H
+#include <sys/queue.h>
+#else
+#include "la_queue.h"
+#endif
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+
+#ifdef HAVE_CTYPE_H
+#include <ctype.h>
+#endif
+#ifdef HAVE_ERRNO_H
+#include <errno.h>
+#endif
+#ifdef HAVE_FCNTL_H
+#include <fcntl.h>
+#endif
+#ifdef HAVE_FNMATCH_H
+#include <fnmatch.h>
+#endif
+#ifdef HAVE_LOCALE_H
+#include <locale.h>
+#endif
+#ifdef HAVE_STDARG_H
+#include <stdarg.h>
+#endif
+#include <stdio.h>
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#if ((!defined(HAVE_UTIMENSAT) && defined(HAVE_LUTIMES)) || \
+ (!defined(HAVE_FUTIMENS) && defined(HAVE_FUTIMES)))
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+#endif
+#ifdef HAVE_GETOPT_OPTRESET
+#include <getopt.h>
+#endif
+
+#include "bsdunzip.h"
+#include "passphrase.h"
+#include "err.h"
+
+/* command-line options */
+static int a_opt; /* convert EOL */
+static int C_opt; /* match case-insensitively */
+static int c_opt; /* extract to stdout */
+static const char *d_arg; /* directory */
+static int f_opt; /* update existing files only */
+static const char *O_arg; /* encoding */
+static int j_opt; /* junk directories */
+static int L_opt; /* lowercase names */
+static int n_opt; /* never overwrite */
+static int o_opt; /* always overwrite */
+static int p_opt; /* extract to stdout, quiet */
+static const char *P_arg; /* passphrase */
+static int q_opt; /* quiet */
+static int t_opt; /* test */
+static int u_opt; /* update */
+static int v_opt; /* verbose/list */
+static const char *y_str = ""; /* 4 digit year */
+static int Z1_opt; /* zipinfo mode list files only */
+static int version_opt; /* version string */
+
+/* debug flag */
+static int unzip_debug;
+
+/* zipinfo mode */
+static int zipinfo_mode;
+
+/* running on tty? */
+static int tty;
+
+/* processing exclude list */
+static int unzip_exclude_mode = 0;
+
+int bsdunzip_optind;
+
+/* convenience macro */
+/* XXX should differentiate between ARCHIVE_{WARN,FAIL,RETRY} */
+#define ac(call) \
+ do { \
+ int acret = (call); \
+ if (acret != ARCHIVE_OK) \
+ errorx("%s", archive_error_string(a)); \
+ } while (0)
+
+/*
+ * Indicates that last info() did not end with EOL. This helps error() et
+ * al. avoid printing an error message on the same line as an incomplete
+ * informational message.
+ */
+static int noeol;
+
+/* for an interactive passphrase input */
+static char *passphrase_buf;
+
+/* fatal error message + errno */
+static void
+error(const char *fmt, ...)
+{
+ va_list ap;
+
+ if (noeol)
+ fprintf(stdout, "\n");
+ fflush(stdout);
+ fprintf(stderr, "unzip: ");
+ va_start(ap, fmt);
+ vfprintf(stderr, fmt, ap);
+ va_end(ap);
+ fprintf(stderr, ": %s\n", strerror(errno));
+ exit(EXIT_FAILURE);
+}
+
+/* fatal error message, no errno */
+static void
+errorx(const char *fmt, ...)
+{
+ va_list ap;
+
+ if (noeol)
+ fprintf(stdout, "\n");
+ fflush(stdout);
+ fprintf(stderr, "unzip: ");
+ va_start(ap, fmt);
+ vfprintf(stderr, fmt, ap);
+ va_end(ap);
+ fprintf(stderr, "\n");
+ exit(EXIT_FAILURE);
+}
+
+/* non-fatal error message + errno */
+static void
+warning(const char *fmt, ...)
+{
+ va_list ap;
+
+ if (noeol)
+ fprintf(stdout, "\n");
+ fflush(stdout);
+ fprintf(stderr, "unzip: ");
+ va_start(ap, fmt);
+ vfprintf(stderr, fmt, ap);
+ va_end(ap);
+ fprintf(stderr, ": %s\n", strerror(errno));
+}
+
+/* non-fatal error message, no errno */
+static void
+warningx(const char *fmt, ...)
+{
+ va_list ap;
+
+ if (noeol)
+ fprintf(stdout, "\n");
+ fflush(stdout);
+ fprintf(stderr, "unzip: ");
+ va_start(ap, fmt);
+ vfprintf(stderr, fmt, ap);
+ va_end(ap);
+ fprintf(stderr, "\n");
+}
+
+/* informational message (if not -q) */
+static void
+info(const char *fmt, ...)
+{
+ va_list ap;
+
+ if (q_opt && !unzip_debug)
+ return;
+ va_start(ap, fmt);
+ vfprintf(stdout, fmt, ap);
+ va_end(ap);
+ fflush(stdout);
+
+ if (*fmt == '\0')
+ noeol = 1;
+ else
+ noeol = fmt[strlen(fmt) - 1] != '\n';
+}
+
+/* debug message (if unzip_debug) */
+static void
+debug(const char *fmt, ...)
+{
+ va_list ap;
+
+ if (!unzip_debug)
+ return;
+ va_start(ap, fmt);
+ vfprintf(stderr, fmt, ap);
+ va_end(ap);
+ fflush(stderr);
+
+ if (*fmt == '\0')
+ noeol = 1;
+ else
+ noeol = fmt[strlen(fmt) - 1] != '\n';
+}
+
+/* duplicate a path name, possibly converting to lower case */
+static char *
+pathdup(const char *path)
+{
+ char *str;
+ size_t i, len;
+
+ if (path == NULL || path[0] == '\0')
+ return (NULL);
+
+ len = strlen(path);
+ while (len && path[len - 1] == '/')
+ len--;
+ if ((str = malloc(len + 1)) == NULL) {
+ errno = ENOMEM;
+ error("malloc()");
+ }
+ if (L_opt) {
+ for (i = 0; i < len; ++i)
+ str[i] = tolower((unsigned char)path[i]);
+ } else {
+ memcpy(str, path, len);
+ }
+ str[len] = '\0';
+
+ return (str);
+}
+
+/* concatenate two path names */
+static char *
+pathcat(const char *prefix, const char *path)
+{
+ char *str;
+ size_t prelen, len;
+
+ prelen = prefix ? strlen(prefix) + 1 : 0;
+ len = strlen(path) + 1;
+ if ((str = malloc(prelen + len)) == NULL) {
+ errno = ENOMEM;
+ error("malloc()");
+ }
+ if (prefix) {
+ memcpy(str, prefix, prelen); /* includes zero */
+ str[prelen - 1] = '/'; /* splat zero */
+ }
+ memcpy(str + prelen, path, len); /* includes zero */
+
+ return (str);
+}
+
+/*
+ * Pattern lists for include / exclude processing
+ */
+struct pattern {
+ STAILQ_ENTRY(pattern) link;
+ char pattern[];
+};
+
+STAILQ_HEAD(pattern_list, pattern);
+static struct pattern_list include = STAILQ_HEAD_INITIALIZER(include);
+static struct pattern_list exclude = STAILQ_HEAD_INITIALIZER(exclude);
+
+/*
+ * Add an entry to a pattern list
+ */
+static void
+add_pattern(struct pattern_list *list, const char *pattern)
+{
+ struct pattern *entry;
+ size_t len;
+
+ debug("adding pattern '%s'\n", pattern);
+ len = strlen(pattern);
+ if ((entry = malloc(sizeof *entry + len + 1)) == NULL) {
+ errno = ENOMEM;
+ error("malloc()");
+ }
+ memcpy(entry->pattern, pattern, len + 1);
+ STAILQ_INSERT_TAIL(list, entry, link);
+}
+
+/*
+ * Match a string against a list of patterns
+ */
+static int
+match_pattern(struct pattern_list *list, const char *str)
+{
+ struct pattern *entry;
+
+ STAILQ_FOREACH(entry, list, link) {
+#ifdef HAVE_FNMATCH
+ if (fnmatch(entry->pattern, str, C_opt ? FNM_CASEFOLD : 0) == 0)
+ return (1);
+#else
+#error "Unsupported platform: fnmatch() is required"
+#endif
+ }
+ return (0);
+}
+
+/*
+ * Verify that a given pathname is in the include list and not in the
+ * exclude list.
+ */
+static int
+accept_pathname(const char *pathname)
+{
+
+ if (!STAILQ_EMPTY(&include) && !match_pattern(&include, pathname))
+ return (0);
+ if (!STAILQ_EMPTY(&exclude) && match_pattern(&exclude, pathname))
+ return (0);
+ return (1);
+}
+
+/*
+ * Create the specified directory with the specified mode, taking certain
+ * precautions on they way.
+ */
+static void
+make_dir(const char *path, int mode)
+{
+ struct stat sb;
+
+ if (lstat(path, &sb) == 0) {
+ if (S_ISDIR(sb.st_mode))
+ return;
+ /*
+ * Normally, we should either ask the user about removing
+ * the non-directory of the same name as a directory we
+ * wish to create, or respect the -n or -o command-line
+ * options. However, this may lead to a later failure or
+ * even compromise (if this non-directory happens to be a
+ * symlink to somewhere unsafe), so we don't.
+ */
+
+ /*
+ * Don't check unlink() result; failure will cause mkdir()
+ * to fail later, which we will catch.
+ */
+ (void)unlink(path);
+ }
+ if (mkdir(path, mode) != 0 && errno != EEXIST)
+ error("mkdir('%s')", path);
+}
+
+/*
+ * Ensure that all directories leading up to (but not including) the
+ * specified path exist.
+ *
+ * XXX inefficient + modifies the file in-place
+ */
+static void
+make_parent(char *path)
+{
+ struct stat sb;
+ char *sep;
+
+ sep = strrchr(path, '/');
+ if (sep == NULL || sep == path)
+ return;
+ *sep = '\0';
+ if (lstat(path, &sb) == 0) {
+ if (S_ISDIR(sb.st_mode)) {
+ *sep = '/';
+ return;
+ }
+ unlink(path);
+ }
+ make_parent(path);
+ mkdir(path, 0755);
+ *sep = '/';
+
+#if 0
+ for (sep = path; (sep = strchr(sep, '/')) != NULL; sep++) {
+ /* root in case of absolute d_arg */
+ if (sep == path)
+ continue;
+ *sep = '\0';
+ make_dir(path, 0755);
+ *sep = '/';
+ }
+#endif
+}
+
+/*
+ * Extract a directory.
+ */
+static void
+extract_dir(struct archive *a, struct archive_entry *e, const char *path)
+{
+ int mode;
+
+ /*
+ * Dropbox likes to create '/' directory entries, just ignore
+ * such junk.
+ */
+ if (*path == '\0')
+ return;
+
+ mode = archive_entry_mode(e) & 0777;
+ if (mode == 0)
+ mode = 0755;
+
+ /*
+ * Some zipfiles contain directories with weird permissions such
+ * as 0644 or 0444. This can cause strange issues such as being
+ * unable to extract files into the directory we just created, or
+ * the user being unable to remove the directory later without
+ * first manually changing its permissions. Therefore, we whack
+ * the permissions into shape, assuming that the user wants full
+ * access and that anyone who gets read access also gets execute
+ * access.
+ */
+ mode |= 0700;
+ if (mode & 0040)
+ mode |= 0010;
+ if (mode & 0004)
+ mode |= 0001;
+
+ info(" creating: %s/\n", path);
+ make_dir(path, mode);
+ ac(archive_read_data_skip(a));
+}
+
+static unsigned char buffer[8192];
+static char spinner[] = { '|', '/', '-', '\\' };
+
+static int
+handle_existing_file(char **path)
+{
+ size_t alen;
+ ssize_t len;
+ char buf[4];
+
+ for (;;) {
+ fprintf(stderr,
+ "replace %s? [y]es, [n]o, [A]ll, [N]one, [r]ename: ",
+ *path);
+ if (fgets(buf, sizeof(buf), stdin) == NULL) {
+ clearerr(stdin);
+ printf("NULL\n(EOF or read error, "
+ "treating as \"[N]one\"...)\n");
+ n_opt = 1;
+ return -1;
+ }
+ switch (*buf) {
+ case 'A':
+ o_opt = 1;
+ /* FALLTHROUGH */
+ case 'y':
+ case 'Y':
+ (void)unlink(*path);
+ return 1;
+ case 'N':
+ n_opt = 1;
+ /* FALLTHROUGH */
+ case 'n':
+ return -1;
+ case 'r':
+ case 'R':
+ printf("New name: ");
+ fflush(stdout);
+ free(*path);
+ *path = NULL;
+ alen = 0;
+ len = getline(path, &alen, stdin);
+ if ((*path)[len - 1] == '\n')
+ (*path)[len - 1] = '\0';
+ return 0;
+ default:
+ break;
+ }
+ }
+}
+
+/*
+ * Detect binary files by a combination of character white list and
+ * black list. NUL bytes and other control codes without use in text files
+ * result directly in switching the file to binary mode. Otherwise, at least
+ * one white-listed byte has to be found.
+ *
+ * Black-listed: 0..6, 14..25, 28..31
+ * 0xf3ffc07f = 11110011111111111100000001111111b
+ * White-listed: 9..10, 13, >= 32
+ * 0x00002600 = 00000000000000000010011000000000b
+ *
+ * See the proginfo/txtvsbin.txt in the zip sources for a detailed discussion.
+ */
+#define BYTE_IS_BINARY(x) ((x) < 32 && (0xf3ffc07fU & (1U << (x))))
+#define BYTE_IS_TEXT(x) ((x) >= 32 || (0x00002600U & (1U << (x))))
+
+static int
+check_binary(const unsigned char *buf, size_t len)
+{
+ int rv;
+ for (rv = 1; len--; ++buf) {
+ if (BYTE_IS_BINARY(*buf))
+ return 1;
+ if (BYTE_IS_TEXT(*buf))
+ rv = 0;
+ }
+
+ return rv;
+}
+
+/*
+ * Extract to a file descriptor
+ */
+static int
+extract2fd(struct archive *a, char *pathname, int fd)
+{
+ int cr, text, warn;
+ ssize_t len;
+ unsigned char *p, *q, *end;
+
+ text = a_opt;
+ warn = 0;
+ cr = 0;
+
+ /* loop over file contents and write to fd */
+ for (int n = 0; ; n++) {
+ if (fd != STDOUT_FILENO)
+ if (tty && (n % 4) == 0)
+ info(" %c\b\b", spinner[(n / 4) % sizeof spinner]);
+
+ len = archive_read_data(a, buffer, sizeof buffer);
+
+ if (len < 0)
+ ac(len);
+
+ /* left over CR from previous buffer */
+ if (a_opt && cr) {
+ if (len == 0 || buffer[0] != '\n')
+ if (write(fd, "\r", 1) != 1)
+ error("write('%s')", pathname);
+ cr = 0;
+ }
+
+ /* EOF */
+ if (len == 0)
+ break;
+ end = buffer + len;
+
+ /*
+ * Detect whether this is a text file. The correct way to
+ * do this is to check the least significant bit of the
+ * "internal file attributes" field of the corresponding
+ * file header in the central directory, but libarchive
+ * does not provide access to this field, so we have to
+ * guess by looking for non-ASCII characters in the
+ * buffer. Hopefully we won't guess wrong. If we do
+ * guess wrong, we print a warning message later.
+ */
+ if (a_opt && n == 0) {
+ if (check_binary(buffer, len))
+ text = 0;
+ }
+
+ /* simple case */
+ if (!a_opt || !text) {
+ if (write(fd, buffer, len) != len)
+ error("write('%s')", pathname);
+ continue;
+ }
+
+ /* hard case: convert \r\n to \n (sigh...) */
+ for (p = buffer; p < end; p = q + 1) {
+ for (q = p; q < end; q++) {
+ if (!warn && BYTE_IS_BINARY(*q)) {
+ warningx("%s may be corrupted due"
+ " to weak text file detection"
+ " heuristic", pathname);
+ warn = 1;
+ }
+ if (q[0] != '\r')
+ continue;
+ if (&q[1] == end) {
+ cr = 1;
+ break;
+ }
+ if (q[1] == '\n')
+ break;
+ }
+ if (write(fd, p, q - p) != q - p)
+ error("write('%s')", pathname);
+ }
+ }
+
+ return text;
+}
+
+/*
+ * Extract a regular file.
+ */
+static void
+extract_file(struct archive *a, struct archive_entry *e, char **path)
+{
+ int mode;
+ struct timespec mtime;
+ struct stat sb;
+ int fd, check, text;
+ const char *linkname;
+#if defined(HAVE_UTIMENSAT) || defined(HAVE_FUTIMENS)
+ struct timespec ts[2];
+#endif
+#if ((!defined(HAVE_UTIMENSAT) && defined(HAVE_LUTIMES)) || \
+ (!defined(HAVE_FUTIMENS) && defined(HAVE_FUTIMES)))
+ struct timeval times[2];
+#endif
+
+ mode = archive_entry_mode(e) & 0777;
+ if (mode == 0)
+ mode = 0644;
+ mtime.tv_sec = archive_entry_mtime(e);
+ mtime.tv_nsec = archive_entry_mtime_nsec(e);
+
+ /* look for existing file of same name */
+recheck:
+ if (lstat(*path, &sb) == 0) {
+ if (u_opt || f_opt) {
+ /* check if up-to-date */
+ if (S_ISREG(sb.st_mode) && (
+#if HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC
+ sb.st_mtimespec.tv_sec > mtime.tv_sec ||
+ (sb.st_mtimespec.tv_sec == mtime.tv_sec &&
+ sb.st_mtimespec.tv_nsec >= mtime.tv_nsec)
+#elif HAVE_STRUCT_STAT_ST_MTIM_TV_NSEC
+ sb.st_mtim.tv_sec > mtime.tv_sec ||
+ (sb.st_mtim.tv_sec == mtime.tv_sec &&
+ sb.st_mtim.tv_nsec >= mtime.tv_nsec)
+#elif HAVE_STRUCT_STAT_ST_MTIME_N
+ sb.st_mtime > mtime.tv_sec ||
+ (sb.st_mtime == mtime.tv_sec &&
+ sb.st_mtime_n => mtime.tv_nsec)
+#elif HAVE_STRUCT_STAT_ST_MTIME_USEC
+ sb.st_mtime > mtime.tv_sec ||
+ (sb.st_mtime == mtime.tv_sec &&
+ sb.st_mtime_usec => mtime.tv_nsec / 1000)
+#else
+ sb.st_mtime > mtime.tv_sec
+#endif
+ ))
+ return;
+ (void)unlink(*path);
+ } else if (o_opt) {
+ /* overwrite */
+ (void)unlink(*path);
+ } else if (n_opt) {
+ /* do not overwrite */
+ return;
+ } else {
+ check = handle_existing_file(path);
+ if (check == 0)
+ goto recheck;
+ if (check == -1)
+ return; /* do not overwrite */
+ }
+ } else {
+ if (f_opt)
+ return;
+ }
+
+#if defined(HAVE_UTIMENSAT) || defined(HAVE_FUTIMENS)
+ ts[0].tv_sec = 0;
+ ts[0].tv_nsec = UTIME_NOW;
+ ts[1] = mtime;
+#endif
+#if ((!defined(HAVE_UTIMENSAT) && defined(HAVE_LUTIMES)) || \
+ (!defined(HAVE_FUTIMENS) && defined(HAVE_FUTIMES)))
+ times[0].tv_sec = 0;
+ times[0].tv_usec = -1;
+ times[1].tv_sec = mtime.tv_sec;
+ times[1].tv_usec = mtime.tv_nsec / 1000;
+#endif
+
+ /* process symlinks */
+ linkname = archive_entry_symlink(e);
+ if (linkname != NULL) {
+ if (symlink(linkname, *path) != 0)
+ error("symlink('%s')", *path);
+ info(" extracting: %s -> %s\n", *path, linkname);
+#ifdef HAVE_LCHMOD
+ if (lchmod(*path, mode) != 0)
+ warning("Cannot set mode for '%s'", *path);
+#endif
+ /* set access and modification time */
+#if defined(HAVE_UTIMENSAT)
+ if (utimensat(AT_FDCWD, *path, ts, AT_SYMLINK_NOFOLLOW) != 0)
+ warning("utimensat('%s')", *path);
+#elif defined(HAVE_LUTIMES)
+ gettimeofday(&times[0], NULL);
+ if (lutimes(*path, times) != 0)
+ warning("lutimes('%s')", *path);
+#endif
+ return;
+ }
+
+ if ((fd = open(*path, O_RDWR|O_CREAT|O_TRUNC, mode)) < 0)
+ error("open('%s')", *path);
+
+ info(" extracting: %s", *path);
+
+ text = extract2fd(a, *path, fd);
+
+ if (tty)
+ info(" \b\b");
+ if (text)
+ info(" (text)");
+ info("\n");
+
+ /* set access and modification time */
+#if defined(HAVE_FUTIMENS)
+ if (futimens(fd, ts) != 0)
+ error("futimens('%s')", *path);
+#elif defined(HAVE_FUTIMES)
+ gettimeofday(&times[0], NULL);
+ if (futimes(fd, times) != 0)
+ error("futimes('%s')", *path);
+#endif
+ if (close(fd) != 0)
+ error("close('%s')", *path);
+}
+
+/*
+ * Extract a zipfile entry: first perform some sanity checks to ensure
+ * that it is either a directory or a regular file and that the path is
+ * not absolute and does not try to break out of the current directory;
+ * then call either extract_dir() or extract_file() as appropriate.
+ *
+ * This is complicated a bit by the various ways in which we need to
+ * manipulate the path name. Case conversion (if requested by the -L
+ * option) happens first, but the include / exclude patterns are applied
+ * to the full converted path name, before the directory part of the path
+ * is removed in accordance with the -j option. Sanity checks are
+ * intentionally done earlier than they need to be, so the user will get a
+ * warning about insecure paths even for files or directories which
+ * wouldn't be extracted anyway.
+ */
+static void
+extract(struct archive *a, struct archive_entry *e)
+{
+ char *pathname, *realpathname;
+ mode_t filetype;
+ char *p, *q;
+
+ if ((pathname = pathdup(archive_entry_pathname(e))) == NULL) {
+ warningx("skipping empty or unreadable filename entry");
+ ac(archive_read_data_skip(a));
+ return;
+ }
+ filetype = archive_entry_filetype(e);
+
+ /* sanity checks */
+ if (pathname[0] == '/' ||
+ strncmp(pathname, "../", 3) == 0 ||
+ strstr(pathname, "/../") != NULL) {
+ warningx("skipping insecure entry '%s'", pathname);
+ ac(archive_read_data_skip(a));
+ free(pathname);
+ return;
+ }
+
+ /* I don't think this can happen in a zipfile.. */
+ if (!S_ISDIR(filetype) && !S_ISREG(filetype) && !S_ISLNK(filetype)) {
+ warningx("skipping non-regular entry '%s'", pathname);
+ ac(archive_read_data_skip(a));
+ free(pathname);
+ return;
+ }
+
+ /* skip directories in -j case */
+ if (S_ISDIR(filetype) && j_opt) {
+ ac(archive_read_data_skip(a));
+ free(pathname);
+ return;
+ }
+
+ /* apply include / exclude patterns */
+ if (!accept_pathname(pathname)) {
+ ac(archive_read_data_skip(a));
+ free(pathname);
+ return;
+ }
+
+ /* apply -j and -d */
+ if (j_opt) {
+ for (p = q = pathname; *p; ++p)
+ if (*p == '/')
+ q = p + 1;
+ realpathname = pathcat(d_arg, q);
+ } else {
+ realpathname = pathcat(d_arg, pathname);
+ }
+
+ /* ensure that parent directory exists */
+ make_parent(realpathname);
+
+ if (S_ISDIR(filetype))
+ extract_dir(a, e, realpathname);
+ else
+ extract_file(a, e, &realpathname);
+
+ free(realpathname);
+ free(pathname);
+}
+
+static void
+extract_stdout(struct archive *a, struct archive_entry *e)
+{
+ char *pathname;
+ mode_t filetype;
+
+ if ((pathname = pathdup(archive_entry_pathname(e))) == NULL) {
+ warningx("skipping empty or unreadable filename entry");
+ ac(archive_read_data_skip(a));
+ return;
+ }
+ filetype = archive_entry_filetype(e);
+
+ /* I don't think this can happen in a zipfile.. */
+ if (!S_ISDIR(filetype) && !S_ISREG(filetype) && !S_ISLNK(filetype)) {
+ warningx("skipping non-regular entry '%s'", pathname);
+ ac(archive_read_data_skip(a));
+ free(pathname);
+ return;
+ }
+
+ /* skip directories in -j case */
+ if (S_ISDIR(filetype)) {
+ ac(archive_read_data_skip(a));
+ free(pathname);
+ return;
+ }
+
+ /* apply include / exclude patterns */
+ if (!accept_pathname(pathname)) {
+ ac(archive_read_data_skip(a));
+ free(pathname);
+ return;
+ }
+
+ if (c_opt)
+ info("x %s\n", pathname);
+
+ (void)extract2fd(a, pathname, STDOUT_FILENO);
+
+ free(pathname);
+}
+
+/*
+ * Print the name of an entry to stdout.
+ */
+static void
+list(struct archive *a, struct archive_entry *e)
+{
+ char buf[20];
+ time_t mtime;
+ struct tm *tm;
+
+ mtime = archive_entry_mtime(e);
+ tm = localtime(&mtime);
+ if (*y_str)
+ strftime(buf, sizeof(buf), "%m-%d-%G %R", tm);
+ else
+ strftime(buf, sizeof(buf), "%m-%d-%g %R", tm);
+
+ if (!zipinfo_mode) {
+ if (v_opt == 1) {
+ printf(" %8ju %s %s\n",
+ (uintmax_t)archive_entry_size(e),
+ buf, archive_entry_pathname(e));
+ } else if (v_opt == 2) {
+ printf("%8ju Stored %7ju 0%% %s %08x %s\n",
+ (uintmax_t)archive_entry_size(e),
+ (uintmax_t)archive_entry_size(e),
+ buf,
+ 0U,
+ archive_entry_pathname(e));
+ }
+ } else {
+ if (Z1_opt)
+ printf("%s\n",archive_entry_pathname(e));
+ }
+ ac(archive_read_data_skip(a));
+}
+
+/*
+ * Extract to memory to check CRC
+ */
+static int
+test(struct archive *a, struct archive_entry *e)
+{
+ ssize_t len;
+ int error_count;
+
+ error_count = 0;
+ if (S_ISDIR(archive_entry_filetype(e)))
+ return 0;
+
+ info(" testing: %s\t", archive_entry_pathname(e));
+ while ((len = archive_read_data(a, buffer, sizeof buffer)) > 0)
+ /* nothing */;
+ if (len < 0) {
+ info(" %s\n", archive_error_string(a));
+ ++error_count;
+ } else {
+ info(" OK\n");
+ }
+
+ /* shouldn't be necessary, but it doesn't hurt */
+ ac(archive_read_data_skip(a));
+
+ return error_count;
+}
+
+/*
+ * Callback function for reading passphrase.
+ * Originally from cpio.c and passphrase.c, libarchive.
+ */
+#define PPBUFF_SIZE 1024
+static const char *
+passphrase_callback(struct archive *a, void *_client_data)
+{
+ char *p;
+
+ (void)a; /* UNUSED */
+ (void)_client_data; /* UNUSED */
+
+ if (passphrase_buf == NULL) {
+ passphrase_buf = malloc(PPBUFF_SIZE);
+ if (passphrase_buf == NULL) {
+ errno = ENOMEM;
+ error("malloc()");
+ }
+ }
+
+ p = lafe_readpassphrase("\nEnter password: ", passphrase_buf,
+ PPBUFF_SIZE);
+
+ if (p == NULL && errno != EINTR)
+ error("Error reading password");
+
+ return p;
+}
+
+/*
+ * Main loop: open the zipfile, iterate over its contents and decide what
+ * to do with each entry.
+ */
+static void
+unzip(const char *fn)
+{
+ struct archive *a;
+ struct archive_entry *e;
+ int ret;
+ uintmax_t total_size, file_count, error_count;
+
+ if ((a = archive_read_new()) == NULL)
+ error("archive_read_new failed");
+
+ ac(archive_read_support_format_zip(a));
+
+ if (O_arg)
+ ac(archive_read_set_format_option(a, "zip", "hdrcharset", O_arg));
+
+ if (P_arg)
+ archive_read_add_passphrase(a, P_arg);
+ else
+ archive_read_set_passphrase_callback(a, NULL,
+ &passphrase_callback);
+
+ ac(archive_read_open_filename(a, fn, 8192));
+
+ if (!zipinfo_mode) {
+ if (!p_opt && !q_opt)
+ printf("Archive: %s\n", fn);
+ if (v_opt == 1) {
+ printf(" Length %sDate Time Name\n", y_str);
+ printf(" -------- %s---- ---- ----\n", y_str);
+ } else if (v_opt == 2) {
+ printf(" Length Method Size Ratio %sDate Time CRC-32 Name\n", y_str);
+ printf("-------- ------ ------- ----- %s---- ---- ------ ----\n", y_str);
+ }
+ }
+
+ total_size = 0;
+ file_count = 0;
+ error_count = 0;
+ for (;;) {
+ ret = archive_read_next_header(a, &e);
+ if (ret == ARCHIVE_EOF)
+ break;
+ ac(ret);
+ if (!zipinfo_mode) {
+ if (t_opt)
+ error_count += test(a, e);
+ else if (v_opt)
+ list(a, e);
+ else if (p_opt || c_opt)
+ extract_stdout(a, e);
+ else
+ extract(a, e);
+ } else {
+ if (Z1_opt)
+ list(a, e);
+ }
+
+ total_size += archive_entry_size(e);
+ ++file_count;
+ }
+
+ if (zipinfo_mode) {
+ if (v_opt == 1) {
+ printf(" -------- %s-------\n", y_str);
+ printf(" %8ju %s%ju file%s\n",
+ total_size, y_str, file_count, file_count != 1 ? "s" : "");
+ } else if (v_opt == 2) {
+ printf("-------- ------- --- %s-------\n", y_str);
+ printf("%8ju %7ju 0%% %s%ju file%s\n",
+ total_size, total_size, y_str, file_count,
+ file_count != 1 ? "s" : "");
+ }
+ }
+
+ ac(archive_read_free(a));
+
+ if (passphrase_buf != NULL) {
+ memset(passphrase_buf, 0, PPBUFF_SIZE);
+ free(passphrase_buf);
+ }
+
+ if (t_opt) {
+ if (error_count > 0) {
+ errorx("%ju checksum error(s) found.", error_count);
+ }
+ else {
+ printf("No errors detected in compressed data of %s.\n",
+ fn);
+ }
+ }
+}
+
+static void
+usage(void)
+{
+
+ fprintf(stderr,
+"Usage: unzip [-aCcfjLlnopqtuvyZ1] [{-O|-I} encoding] [-d dir] [-x pattern] [-P password] zipfile\n"
+" [member ...]\n");
+ exit(EXIT_FAILURE);
+}
+
+static void
+version(void)
+{
+ printf("bsdunzip %s - %s \n",
+ BSDUNZIP_VERSION_STRING,
+ archive_version_details());
+ exit(0);
+}
+
+static int
+getopts(int argc, char *argv[])
+{
+ struct bsdunzip *bsdunzip, bsdunzip_storage;
+ int opt;
+ bsdunzip_optind = 1;
+
+ bsdunzip = &bsdunzip_storage;
+ memset(bsdunzip, 0, sizeof(*bsdunzip));
+
+ bsdunzip->argv = argv;
+ bsdunzip->argc = argc;
+
+ while ((opt = bsdunzip_getopt(bsdunzip)) != -1) {
+ unzip_exclude_mode = 0;
+ switch (opt) {
+ case 'a':
+ a_opt = 1;
+ break;
+ case 'C':
+ C_opt = 1;
+ break;
+ case 'c':
+ c_opt = 1;
+ break;
+ case 'd':
+ d_arg = bsdunzip->argument;
+ break;
+ case 'f':
+ f_opt = 1;
+ break;
+ case 'I':
+ case 'O':
+ O_arg = bsdunzip->argument;
+ break;
+ case 'j':
+ j_opt = 1;
+ break;
+ case 'L':
+ L_opt = 1;
+ break;
+ case 'l':
+ if (v_opt == 0)
+ v_opt = 1;
+ break;
+ case 'n':
+ n_opt = 1;
+ break;
+ case 'o':
+ o_opt = 1;
+ q_opt = 1;
+ break;
+ case 'p':
+ p_opt = 1;
+ break;
+ case 'P':
+ P_arg = bsdunzip->argument;
+ break;
+ case 'q':
+ q_opt = 1;
+ break;
+ case 't':
+ t_opt = 1;
+ break;
+ case 'u':
+ u_opt = 1;
+ break;
+ case 'v':
+ v_opt = 2;
+ break;
+ case 'x':
+ add_pattern(&exclude, bsdunzip->argument);
+ unzip_exclude_mode = 1;
+ break;
+ case 'y':
+ y_str = " ";
+ break;
+ case 'Z':
+ zipinfo_mode = 1;
+ if (bsdunzip->argument != NULL &&
+ strcmp(bsdunzip->argument, "1") == 0) {
+ Z1_opt = 1;
+ }
+ break;
+ case OPTION_VERSION:
+ version_opt = 1;
+ break;
+ case OPTION_NONE:
+ break;
+ default:
+ usage();
+ }
+ if (opt == OPTION_NONE)
+ break;
+ }
+ return (bsdunzip_optind);
+}
+
+int
+main(int argc, char *argv[])
+{
+ const char *zipfile;
+ int nopts;
+
+ lafe_setprogname(*argv, "bsdunzip");
+
+#if HAVE_SETLOCALE
+ if (setlocale(LC_ALL, "") == NULL)
+ lafe_warnc(0, "Failed to set default locale");
+#endif
+
+ if (isatty(STDOUT_FILENO))
+ tty = 1;
+
+ if (getenv("UNZIP_DEBUG") != NULL)
+ unzip_debug = 1;
+ for (int i = 0; i < argc; ++i)
+ debug("%s%c", argv[i], (i < argc - 1) ? ' ' : '\n');
+
+#ifdef __GLIBC__
+ /* Prevent GNU getopt(3) from rearranging options. */
+ setenv("POSIXLY_CORRECT", "", 1);
+#endif
+ /*
+ * Info-ZIP's unzip(1) expects certain options to come before the
+ * zipfile name, and others to come after - though it does not
+ * enforce this. For simplicity, we accept *all* options both
+ * before and after the zipfile name.
+ */
+ nopts = getopts(argc, argv);
+
+ if (version_opt == 1)
+ version();
+
+ /*
+ * When more of the zipinfo mode options are implemented, this
+ * will need to change.
+ */
+ if (zipinfo_mode && !Z1_opt) {
+ printf("Zipinfo mode needs additional options\n");
+ exit(EXIT_FAILURE);
+ }
+
+ if (argc <= nopts)
+ usage();
+ zipfile = argv[nopts++];
+
+ if (strcmp(zipfile, "-") == 0)
+ zipfile = NULL; /* STDIN */
+
+ unzip_exclude_mode = 0;
+
+ while (nopts < argc && *argv[nopts] != '-')
+ add_pattern(&include, argv[nopts++]);
+
+ nopts--; /* fake argv[0] */
+ nopts += getopts(argc - nopts, argv + nopts);
+
+ /*
+ * For compatibility with Info-ZIP's unzip(1) we need to treat
+ * non-option arguments following an -x after the zipfile as
+ * exclude list members.
+ */
+ if (unzip_exclude_mode) {
+ while (nopts < argc && *argv[nopts] != '-')
+ add_pattern(&exclude, argv[nopts++]);
+ nopts--; /* fake argv[0] */
+ nopts += getopts(argc - nopts, argv + nopts);
+ }
+
+ /* There may be residual arguments if we encountered -- */
+ while (nopts < argc)
+ add_pattern(&include, argv[nopts++]);
+
+ if (n_opt + o_opt + u_opt > 1)
+ errorx("-n, -o and -u are contradictory");
+
+ unzip(zipfile);
+
+ exit(EXIT_SUCCESS);
+}
diff --git a/unzip/bsdunzip.h b/unzip/bsdunzip.h
new file mode 100644
index 000000000000..ab81e3930ec2
--- /dev/null
+++ b/unzip/bsdunzip.h
@@ -0,0 +1,60 @@
+/*-
+ * Copyright (c) 2023, 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.
+ */
+
+#ifndef BSDUNZIP_H_INCLUDED
+#define BSDUNZIP_H_INCLUDED
+
+#if defined(PLATFORM_CONFIG_H)
+/* Use hand-built config.h in environments that need it. */
+#include PLATFORM_CONFIG_H
+#else
+/* Not having a config.h of some sort is a serious problem. */
+#include "config.h"
+#endif
+
+#include <archive.h>
+#include <archive_entry.h>
+
+struct bsdunzip {
+ /* Option parser state */
+ int getopt_state;
+ char *getopt_word;
+
+ /* Miscellaneous state information */
+ int argc;
+ char **argv;
+ const char *argument;
+};
+
+enum {
+ OPTION_NONE,
+ OPTION_VERSION
+};
+
+int bsdunzip_getopt(struct bsdunzip *);
+
+extern int bsdunzip_optind;
+
+#endif
diff --git a/unzip/bsdunzip_platform.h b/unzip/bsdunzip_platform.h
new file mode 100644
index 000000000000..d4fcbb1aeab4
--- /dev/null
+++ b/unzip/bsdunzip_platform.h
@@ -0,0 +1,65 @@
+/*-
+ * 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 header is the first thing included in any of the bsdtar
+ * source files. As far as possible, platform-specific issues should
+ * be dealt with here and not within individual source files.
+ */
+
+#ifndef BSDUNZIP_PLATFORM_H_INCLUDED
+#define BSDUNZIP_PLATFORM_H_INCLUDED
+
+#if defined(PLATFORM_CONFIG_H)
+/* Use hand-built config.h in environments that need it. */
+#include PLATFORM_CONFIG_H
+#else
+/* Not having a config.h of some sort is a serious problem. */
+#include "config.h"
+#endif
+
+#ifdef HAVE_LIBARCHIVE
+/* If we're using the platform libarchive, include system headers. */
+#include <archive.h>
+#include <archive_entry.h>
+#else
+/* Otherwise, include user headers. */
+#include "archive.h"
+#include "archive_entry.h"
+#endif
+
+/* How to mark functions that don't return. */
+/* This facilitates use of some newer static code analysis tools. */
+#undef __LA_NORETURN
+#if defined(__GNUC__) && (__GNUC__ > 2 || \
+ (__GNUC__ == 2 && __GNUC_MINOR__ >= 5))
+#define __LA_NORETURN __attribute__((__noreturn__))
+#elif defined(_MSC_VER)
+#define __LA_NORETURN __declspec(noreturn)
+#else
+#define __LA_NORETURN
+#endif
+
+#endif /* !BSDUNZIP_PLATFORM_H_INCLUDED */
diff --git a/unzip/cmdline.c b/unzip/cmdline.c
new file mode 100644
index 000000000000..ab1aeb31fe18
--- /dev/null
+++ b/unzip/cmdline.c
@@ -0,0 +1,247 @@
+/*-
+ * 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.
+ */
+
+/*
+ * Command line parser for bsdunzip.
+ */
+
+#include "bsdunzip_platform.h"
+#ifdef HAVE_ERRNO_H
+#include <errno.h>
+#endif
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+
+#include "bsdunzip.h"
+#include "err.h"
+
+/*
+ * Short options for bsdunzip. Please keep this sorted.
+ */
+static const char *short_options
+ = "aCcd:fI:jLlnO:opP:qtuvx:yZ:";
+
+/*
+ * Long options for bsdunzip. Please keep this list sorted.
+ *
+ * The symbolic names for options that lack a short equivalent are
+ * defined in bsdunzip.h. Also note that so far I've found no need
+ * to support optional arguments to long options. That would be
+ * a small change to the code below.
+ */
+
+static const struct bsdunzip_option {
+ const char *name;
+ int required; /* 1 if this option requires an argument. */
+ int equivalent; /* Equivalent short option. */
+} bsdunzip_longopts[] = {
+ { "version", 0, OPTION_VERSION },
+ { NULL, 0, 0 }
+};
+
+/*
+ * This getopt implementation has two key features that common
+ * getopt_long() implementations lack. Apart from those, it's a
+ * straightforward option parser, considerably simplified by not
+ * needing to support the wealth of exotic getopt_long() features. It
+ * has, of course, been shamelessly tailored for bsdunzip. (If you're
+ * looking for a generic getopt_long() implementation for your
+ * project, I recommend Gregory Pietsch's public domain getopt_long()
+ * implementation.) The two additional features are:
+ */
+
+int
+bsdunzip_getopt(struct bsdunzip *bsdunzip)
+{
+ enum { state_start = 0, state_next_word, state_short, state_long };
+
+ const struct bsdunzip_option *popt, *match = NULL, *match2 = NULL;
+ const char *p, *long_prefix = "--";
+ size_t optlength;
+ int opt = OPTION_NONE;
+ int required = 0;
+
+ bsdunzip->argument = NULL;
+
+ /* First time through, initialize everything. */
+ if (bsdunzip->getopt_state == state_start) {
+ /* Skip program name. */
+ ++bsdunzip->argv;
+ --bsdunzip->argc;
+ if (*bsdunzip->argv == NULL)
+ return (-1);
+ bsdunzip->getopt_state = state_next_word;
+ }
+
+ /*
+ * We're ready to look at the next word in argv.
+ */
+ if (bsdunzip->getopt_state == state_next_word) {
+ /* No more arguments, so no more options. */
+ if (bsdunzip->argv[0] == NULL)
+ return (-1);
+ /* Doesn't start with '-', so no more options. */
+ if (bsdunzip->argv[0][0] != '-')
+ return (-1);
+ /* "--" marks end of options; consume it and return. */
+ if (strcmp(bsdunzip->argv[0], "--") == 0) {
+ ++bsdunzip->argv;
+ --bsdunzip->argc;
+ bsdunzip_optind++;
+ return (-1);
+ }
+ /* Get next word for parsing. */
+ bsdunzip->getopt_word = *bsdunzip->argv++;
+ --bsdunzip->argc;
+ bsdunzip_optind++;
+ if (bsdunzip->getopt_word[1] == '-') {
+ /* Set up long option parser. */
+ bsdunzip->getopt_state = state_long;
+ bsdunzip->getopt_word += 2; /* Skip leading '--' */
+ } else {
+ /* Set up short option parser. */
+ bsdunzip->getopt_state = state_short;
+ ++bsdunzip->getopt_word; /* Skip leading '-' */
+ }
+ }
+
+ /*
+ * We're parsing a group of POSIX-style single-character options.
+ */
+ if (bsdunzip->getopt_state == state_short) {
+ /* Peel next option off of a group of short options. */
+ opt = *bsdunzip->getopt_word++;
+ if (opt == '\0') {
+ /* End of this group; recurse to get next option. */
+ bsdunzip->getopt_state = state_next_word;
+ return bsdunzip_getopt(bsdunzip);
+ }
+
+ /* Does this option take an argument? */
+ p = strchr(short_options, opt);
+ if (p == NULL)
+ return ('?');
+ if (p[1] == ':')
+ required = 1;
+
+ /* If it takes an argument, parse that. */
+ if (required) {
+ /* If arg is run-in, bsdunzip->getopt_word already points to it. */
+ if (bsdunzip->getopt_word[0] == '\0') {
+ /* Otherwise, pick up the next word. */
+ bsdunzip->getopt_word = *bsdunzip->argv;
+ if (bsdunzip->getopt_word == NULL) {
+ lafe_warnc(0,
+ "Option -%c requires an argument",
+ opt);
+ return ('?');
+ }
+ ++bsdunzip->argv;
+ --bsdunzip->argc;
+ bsdunzip_optind++;
+ }
+ bsdunzip->getopt_state = state_next_word;
+ bsdunzip->argument = bsdunzip->getopt_word;
+ }
+ }
+
+ /* We're reading a long option */
+ if (bsdunzip->getopt_state == state_long) {
+ /* After this long option, we'll be starting a new word. */
+ bsdunzip->getopt_state = state_next_word;
+
+ /* Option name ends at '=' if there is one. */
+ p = strchr(bsdunzip->getopt_word, '=');
+ if (p != NULL) {
+ optlength = (size_t)(p - bsdunzip->getopt_word);
+ bsdunzip->argument = (char *)(uintptr_t)(p + 1);
+ } else {
+ optlength = strlen(bsdunzip->getopt_word);
+ }
+
+ /* Search the table for an unambiguous match. */
+ for (popt = bsdunzip_longopts; popt->name != NULL; popt++) {
+ /* Short-circuit if first chars don't match. */
+ if (popt->name[0] != bsdunzip->getopt_word[0])
+ continue;
+ /* If option is a prefix of name in table, record it.*/
+ if (strncmp(bsdunzip->getopt_word, popt->name, optlength) == 0) {
+ match2 = match; /* Record up to two matches. */
+ match = popt;
+ /* If it's an exact match, we're done. */
+ if (strlen(popt->name) == optlength) {
+ match2 = NULL; /* Forget the others. */
+ break;
+ }
+ }
+ }
+
+ /* Fail if there wasn't a unique match. */
+ if (match == NULL) {
+ lafe_warnc(0,
+ "Option %s%s is not supported",
+ long_prefix, bsdunzip->getopt_word);
+ return ('?');
+ }
+ if (match2 != NULL) {
+ lafe_warnc(0,
+ "Ambiguous option %s%s (matches --%s and --%s)",
+ long_prefix, bsdunzip->getopt_word, match->name, match2->name);
+ return ('?');
+ }
+
+ /* We've found a unique match; does it need an argument? */
+ if (match->required) {
+ /* Argument required: get next word if necessary. */
+ if (bsdunzip->argument == NULL) {
+ bsdunzip->argument = *bsdunzip->argv;
+ if (bsdunzip->argument == NULL) {
+ lafe_warnc(0,
+ "Option %s%s requires an argument",
+ long_prefix, match->name);
+ return ('?');
+ }
+ ++bsdunzip->argv;
+ --bsdunzip->argc;
+ bsdunzip_optind++;
+ }
+ } else {
+ /* Argument forbidden: fail if there is one. */
+ if (bsdunzip->argument != NULL) {
+ lafe_warnc(0,
+ "Option %s%s does not allow an argument",
+ long_prefix, match->name);
+ return ('?');
+ }
+ }
+ return (match->equivalent);
+ }
+
+ return (opt);
+}
diff --git a/unzip/la_getline.c b/unzip/la_getline.c
new file mode 100644
index 000000000000..79a6bc010214
--- /dev/null
+++ b/unzip/la_getline.c
@@ -0,0 +1,99 @@
+/* $NetBSD: getline.c,v 1.2 2014/09/16 17:23:50 christos Exp $ */
+
+/*-
+ * Copyright (c) 2011 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Christos Zoulas.
+ *
+ * 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 NETBSD FOUNDATION, INC. 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 FOUNDATION 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.
+ */
+
+#include "bsdunzip_platform.h"
+#ifndef HAVE_GETLINE
+
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+#ifdef HAVE_STDIO_H
+#include <stdio.h>
+#endif
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+#ifdef HAVE_ERRNO_H
+#include <errno.h>
+#endif
+#ifdef HAVE_STRING_H
+#include <string.h>
+#endif
+
+static ssize_t
+la_getdelim(char **buf, size_t *bufsiz, int delimiter, FILE *fp)
+{
+ char *ptr, *eptr;
+
+
+ if (*buf == NULL || *bufsiz == 0) {
+ *bufsiz = BUFSIZ;
+ if ((*buf = malloc(*bufsiz)) == NULL)
+ return -1;
+ }
+
+ for (ptr = *buf, eptr = *buf + *bufsiz;;) {
+ int c = fgetc(fp);
+ if (c == -1) {
+ if (feof(fp)) {
+ ssize_t diff = (ssize_t)(ptr - *buf);
+ if (diff != 0) {
+ *ptr = '\0';
+ return diff;
+ }
+ }
+ return -1;
+ }
+ *ptr++ = c;
+ if (c == delimiter) {
+ *ptr = '\0';
+ return ptr - *buf;
+ }
+ if (ptr + 2 >= eptr) {
+ char *nbuf;
+ size_t nbufsiz = *bufsiz * 2;
+ ssize_t d = ptr - *buf;
+ if ((nbuf = realloc(*buf, nbufsiz)) == NULL)
+ return -1;
+ *buf = nbuf;
+ *bufsiz = nbufsiz;
+ eptr = nbuf + nbufsiz;
+ ptr = nbuf + d;
+ }
+ }
+}
+
+ssize_t
+getline(char **buf, size_t *bufsiz, FILE *fp)
+{
+ return la_getdelim(buf, bufsiz, '\n', fp);
+}
+#endif
diff --git a/unzip/la_queue.h b/unzip/la_queue.h
new file mode 100644
index 000000000000..917526531b2a
--- /dev/null
+++ b/unzip/la_queue.h
@@ -0,0 +1,840 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ *
+ * Copyright (c) 1991, 1993
+ * The Regents of the University of California. All rights reserved.
+ */
+
+#ifndef _SYS_QUEUE_H_
+#define _SYS_QUEUE_H_
+
+/*
+ * This file defines four types of data structures: singly-linked lists,
+ * singly-linked tail queues, lists and tail queues.
+ *
+ * A singly-linked list is headed by a single forward pointer. The elements
+ * are singly linked for minimum space and pointer manipulation overhead at
+ * the expense of O(n) removal for arbitrary elements. New elements can be
+ * added to the list after an existing element or at the head of the list.
+ * Elements being removed from the head of the list should use the explicit
+ * macro for this purpose for optimum efficiency. A singly-linked list may
+ * only be traversed in the forward direction. Singly-linked lists are ideal
+ * for applications with large datasets and few or no removals or for
+ * implementing a LIFO queue.
+ *
+ * A singly-linked tail queue is headed by a pair of pointers, one to the
+ * head of the list and the other to the tail of the list. The elements are
+ * singly linked for minimum space and pointer manipulation overhead at the
+ * expense of O(n) removal for arbitrary elements. New elements can be added
+ * to the list after an existing element, at the head of the list, or at the
+ * end of the list. Elements being removed from the head of the tail queue
+ * should use the explicit macro for this purpose for optimum efficiency.
+ * A singly-linked tail queue may only be traversed in the forward direction.
+ * Singly-linked tail queues are ideal for applications with large datasets
+ * and few or no removals or for implementing a FIFO queue.
+ *
+ * A list is headed by a single forward pointer (or an array of forward
+ * pointers for a hash table header). The elements are doubly linked
+ * so that an arbitrary element can be removed without a need to
+ * traverse the list. New elements can be added to the list before
+ * or after an existing element or at the head of the list. A list
+ * may be traversed in either direction.
+ *
+ * A tail queue is headed by a pair of pointers, one to the head of the
+ * list and the other to the tail of the list. The elements are doubly
+ * linked so that an arbitrary element can be removed without a need to
+ * traverse the list. New elements can be added to the list before or
+ * after an existing element, at the head of the list, or at the end of
+ * the list. A tail queue may be traversed in either direction.
+ *
+ * For details on the use of these macros, see the queue(3) manual page.
+ *
+ * Below is a summary of implemented functions where:
+ * + means the macro is available
+ * - means the macro is not available
+ * s means the macro is available but is slow (runs in O(n) time)
+ *
+ * SLIST LIST STAILQ TAILQ
+ * _HEAD + + + +
+ * _CLASS_HEAD + + + +
+ * _HEAD_INITIALIZER + + + +
+ * _ENTRY + + + +
+ * _CLASS_ENTRY + + + +
+ * _INIT + + + +
+ * _EMPTY + + + +
+ * _FIRST + + + +
+ * _NEXT + + + +
+ * _PREV - + - +
+ * _LAST - - + +
+ * _LAST_FAST - - - +
+ * _FOREACH + + + +
+ * _FOREACH_FROM + + + +
+ * _FOREACH_SAFE + + + +
+ * _FOREACH_FROM_SAFE + + + +
+ * _FOREACH_REVERSE - - - +
+ * _FOREACH_REVERSE_FROM - - - +
+ * _FOREACH_REVERSE_SAFE - - - +
+ * _FOREACH_REVERSE_FROM_SAFE - - - +
+ * _INSERT_HEAD + + + +
+ * _INSERT_BEFORE - + - +
+ * _INSERT_AFTER + + + +
+ * _INSERT_TAIL - - + +
+ * _CONCAT s s + +
+ * _REMOVE_AFTER + - + -
+ * _REMOVE_HEAD + - + -
+ * _REMOVE s + s +
+ * _SWAP + + + +
+ */
+#ifdef QUEUE_MACRO_DEBUG
+#warn Use QUEUE_MACRO_DEBUG_TRACE and/or QUEUE_MACRO_DEBUG_TRASH
+#define QUEUE_MACRO_DEBUG_TRACE
+#define QUEUE_MACRO_DEBUG_TRASH
+#endif
+
+#ifdef QUEUE_MACRO_DEBUG_TRACE
+/* Store the last 2 places the queue element or head was altered */
+struct qm_trace {
+ unsigned long lastline;
+ unsigned long prevline;
+ const char *lastfile;
+ const char *prevfile;
+};
+
+#define TRACEBUF struct qm_trace trace;
+#define TRACEBUF_INITIALIZER { __LINE__, 0, __FILE__, NULL } ,
+
+#define QMD_TRACE_HEAD(head) do { \
+ (head)->trace.prevline = (head)->trace.lastline; \
+ (head)->trace.prevfile = (head)->trace.lastfile; \
+ (head)->trace.lastline = __LINE__; \
+ (head)->trace.lastfile = __FILE__; \
+} while (0)
+
+#define QMD_TRACE_ELEM(elem) do { \
+ (elem)->trace.prevline = (elem)->trace.lastline; \
+ (elem)->trace.prevfile = (elem)->trace.lastfile; \
+ (elem)->trace.lastline = __LINE__; \
+ (elem)->trace.lastfile = __FILE__; \
+} while (0)
+
+#else /* !QUEUE_MACRO_DEBUG_TRACE */
+#define QMD_TRACE_ELEM(elem)
+#define QMD_TRACE_HEAD(head)
+#define TRACEBUF
+#define TRACEBUF_INITIALIZER
+#endif /* QUEUE_MACRO_DEBUG_TRACE */
+
+#ifdef QUEUE_MACRO_DEBUG_TRASH
+#define QMD_SAVELINK(name, link) void **name = (void *)&(link)
+#define TRASHIT(x) do {(x) = (void *)-1;} while (0)
+#define QMD_IS_TRASHED(x) ((x) == (void *)(intptr_t)-1)
+#else /* !QUEUE_MACRO_DEBUG_TRASH */
+#define QMD_SAVELINK(name, link)
+#define TRASHIT(x)
+#define QMD_IS_TRASHED(x) 0
+#endif /* QUEUE_MACRO_DEBUG_TRASH */
+
+#ifdef __cplusplus
+/*
+ * In C++ there can be structure lists and class lists:
+ */
+#define QUEUE_TYPEOF(type) type
+#else
+#define QUEUE_TYPEOF(type) struct type
+#endif
+
+/*
+ * Singly-linked List declarations.
+ */
+#define SLIST_HEAD(name, type) \
+struct name { \
+ struct type *slh_first; /* first element */ \
+}
+
+#define SLIST_CLASS_HEAD(name, type) \
+struct name { \
+ class type *slh_first; /* first element */ \
+}
+
+#define SLIST_HEAD_INITIALIZER(head) \
+ { NULL }
+
+#define SLIST_ENTRY(type) \
+struct { \
+ struct type *sle_next; /* next element */ \
+}
+
+#define SLIST_CLASS_ENTRY(type) \
+struct { \
+ class type *sle_next; /* next element */ \
+}
+
+/*
+ * Singly-linked List functions.
+ */
+#if (defined(_KERNEL) && defined(INVARIANTS))
+#define QMD_SLIST_CHECK_PREVPTR(prevp, elm) do { \
+ if (*(prevp) != (elm)) \
+ panic("Bad prevptr *(%p) == %p != %p", \
+ (prevp), *(prevp), (elm)); \
+} while (0)
+#else
+#define QMD_SLIST_CHECK_PREVPTR(prevp, elm)
+#endif
+
+#define SLIST_CONCAT(head1, head2, type, field) do { \
+ QUEUE_TYPEOF(type) *curelm = SLIST_FIRST(head1); \
+ if (curelm == NULL) { \
+ if ((SLIST_FIRST(head1) = SLIST_FIRST(head2)) != NULL) \
+ SLIST_INIT(head2); \
+ } else if (SLIST_FIRST(head2) != NULL) { \
+ while (SLIST_NEXT(curelm, field) != NULL) \
+ curelm = SLIST_NEXT(curelm, field); \
+ SLIST_NEXT(curelm, field) = SLIST_FIRST(head2); \
+ SLIST_INIT(head2); \
+ } \
+} while (0)
+
+#define SLIST_EMPTY(head) ((head)->slh_first == NULL)
+
+#define SLIST_FIRST(head) ((head)->slh_first)
+
+#define SLIST_FOREACH(var, head, field) \
+ for ((var) = SLIST_FIRST((head)); \
+ (var); \
+ (var) = SLIST_NEXT((var), field))
+
+#define SLIST_FOREACH_FROM(var, head, field) \
+ for ((var) = ((var) ? (var) : SLIST_FIRST((head))); \
+ (var); \
+ (var) = SLIST_NEXT((var), field))
+
+#define SLIST_FOREACH_SAFE(var, head, field, tvar) \
+ for ((var) = SLIST_FIRST((head)); \
+ (var) && ((tvar) = SLIST_NEXT((var), field), 1); \
+ (var) = (tvar))
+
+#define SLIST_FOREACH_FROM_SAFE(var, head, field, tvar) \
+ for ((var) = ((var) ? (var) : SLIST_FIRST((head))); \
+ (var) && ((tvar) = SLIST_NEXT((var), field), 1); \
+ (var) = (tvar))
+
+#define SLIST_FOREACH_PREVPTR(var, varp, head, field) \
+ for ((varp) = &SLIST_FIRST((head)); \
+ ((var) = *(varp)) != NULL; \
+ (varp) = &SLIST_NEXT((var), field))
+
+#define SLIST_INIT(head) do { \
+ SLIST_FIRST((head)) = NULL; \
+} while (0)
+
+#define SLIST_INSERT_AFTER(slistelm, elm, field) do { \
+ SLIST_NEXT((elm), field) = SLIST_NEXT((slistelm), field); \
+ SLIST_NEXT((slistelm), field) = (elm); \
+} while (0)
+
+#define SLIST_INSERT_HEAD(head, elm, field) do { \
+ SLIST_NEXT((elm), field) = SLIST_FIRST((head)); \
+ SLIST_FIRST((head)) = (elm); \
+} while (0)
+
+#define SLIST_NEXT(elm, field) ((elm)->field.sle_next)
+
+#define SLIST_REMOVE(head, elm, type, field) do { \
+ QMD_SAVELINK(oldnext, (elm)->field.sle_next); \
+ if (SLIST_FIRST((head)) == (elm)) { \
+ SLIST_REMOVE_HEAD((head), field); \
+ } \
+ else { \
+ QUEUE_TYPEOF(type) *curelm = SLIST_FIRST(head); \
+ while (SLIST_NEXT(curelm, field) != (elm)) \
+ curelm = SLIST_NEXT(curelm, field); \
+ SLIST_REMOVE_AFTER(curelm, field); \
+ } \
+ TRASHIT(*oldnext); \
+} while (0)
+
+#define SLIST_REMOVE_AFTER(elm, field) do { \
+ SLIST_NEXT(elm, field) = \
+ SLIST_NEXT(SLIST_NEXT(elm, field), field); \
+} while (0)
+
+#define SLIST_REMOVE_HEAD(head, field) do { \
+ SLIST_FIRST((head)) = SLIST_NEXT(SLIST_FIRST((head)), field); \
+} while (0)
+
+#define SLIST_REMOVE_PREVPTR(prevp, elm, field) do { \
+ QMD_SLIST_CHECK_PREVPTR(prevp, elm); \
+ *(prevp) = SLIST_NEXT(elm, field); \
+ TRASHIT((elm)->field.sle_next); \
+} while (0)
+
+#define SLIST_SWAP(head1, head2, type) do { \
+ QUEUE_TYPEOF(type) *swap_first = SLIST_FIRST(head1); \
+ SLIST_FIRST(head1) = SLIST_FIRST(head2); \
+ SLIST_FIRST(head2) = swap_first; \
+} while (0)
+
+/*
+ * Singly-linked Tail queue declarations.
+ */
+#define STAILQ_HEAD(name, type) \
+struct name { \
+ struct type *stqh_first;/* first element */ \
+ struct type **stqh_last;/* addr of last next element */ \
+}
+
+#define STAILQ_CLASS_HEAD(name, type) \
+struct name { \
+ class type *stqh_first; /* first element */ \
+ class type **stqh_last; /* addr of last next element */ \
+}
+
+#define STAILQ_HEAD_INITIALIZER(head) \
+ { NULL, &(head).stqh_first }
+
+#define STAILQ_ENTRY(type) \
+struct { \
+ struct type *stqe_next; /* next element */ \
+}
+
+#define STAILQ_CLASS_ENTRY(type) \
+struct { \
+ class type *stqe_next; /* next element */ \
+}
+
+/*
+ * Singly-linked Tail queue functions.
+ */
+#define STAILQ_CONCAT(head1, head2) do { \
+ if (!STAILQ_EMPTY((head2))) { \
+ *(head1)->stqh_last = (head2)->stqh_first; \
+ (head1)->stqh_last = (head2)->stqh_last; \
+ STAILQ_INIT((head2)); \
+ } \
+} while (0)
+
+#define STAILQ_EMPTY(head) ((head)->stqh_first == NULL)
+
+#define STAILQ_FIRST(head) ((head)->stqh_first)
+
+#define STAILQ_FOREACH(var, head, field) \
+ for((var) = STAILQ_FIRST((head)); \
+ (var); \
+ (var) = STAILQ_NEXT((var), field))
+
+#define STAILQ_FOREACH_FROM(var, head, field) \
+ for ((var) = ((var) ? (var) : STAILQ_FIRST((head))); \
+ (var); \
+ (var) = STAILQ_NEXT((var), field))
+
+#define STAILQ_FOREACH_SAFE(var, head, field, tvar) \
+ for ((var) = STAILQ_FIRST((head)); \
+ (var) && ((tvar) = STAILQ_NEXT((var), field), 1); \
+ (var) = (tvar))
+
+#define STAILQ_FOREACH_FROM_SAFE(var, head, field, tvar) \
+ for ((var) = ((var) ? (var) : STAILQ_FIRST((head))); \
+ (var) && ((tvar) = STAILQ_NEXT((var), field), 1); \
+ (var) = (tvar))
+
+#define STAILQ_INIT(head) do { \
+ STAILQ_FIRST((head)) = NULL; \
+ (head)->stqh_last = &STAILQ_FIRST((head)); \
+} while (0)
+
+#define STAILQ_INSERT_AFTER(head, tqelm, elm, field) do { \
+ if ((STAILQ_NEXT((elm), field) = STAILQ_NEXT((tqelm), field)) == NULL)\
+ (head)->stqh_last = &STAILQ_NEXT((elm), field); \
+ STAILQ_NEXT((tqelm), field) = (elm); \
+} while (0)
+
+#define STAILQ_INSERT_HEAD(head, elm, field) do { \
+ if ((STAILQ_NEXT((elm), field) = STAILQ_FIRST((head))) == NULL) \
+ (head)->stqh_last = &STAILQ_NEXT((elm), field); \
+ STAILQ_FIRST((head)) = (elm); \
+} while (0)
+
+#define STAILQ_INSERT_TAIL(head, elm, field) do { \
+ STAILQ_NEXT((elm), field) = NULL; \
+ *(head)->stqh_last = (elm); \
+ (head)->stqh_last = &STAILQ_NEXT((elm), field); \
+} while (0)
+
+#define STAILQ_LAST(head, type, field) \
+ (STAILQ_EMPTY((head)) ? NULL : \
+ __containerof((head)->stqh_last, \
+ QUEUE_TYPEOF(type), field.stqe_next))
+
+#define STAILQ_NEXT(elm, field) ((elm)->field.stqe_next)
+
+#define STAILQ_REMOVE(head, elm, type, field) do { \
+ QMD_SAVELINK(oldnext, (elm)->field.stqe_next); \
+ if (STAILQ_FIRST((head)) == (elm)) { \
+ STAILQ_REMOVE_HEAD((head), field); \
+ } \
+ else { \
+ QUEUE_TYPEOF(type) *curelm = STAILQ_FIRST(head); \
+ while (STAILQ_NEXT(curelm, field) != (elm)) \
+ curelm = STAILQ_NEXT(curelm, field); \
+ STAILQ_REMOVE_AFTER(head, curelm, field); \
+ } \
+ TRASHIT(*oldnext); \
+} while (0)
+
+#define STAILQ_REMOVE_AFTER(head, elm, field) do { \
+ if ((STAILQ_NEXT(elm, field) = \
+ STAILQ_NEXT(STAILQ_NEXT(elm, field), field)) == NULL) \
+ (head)->stqh_last = &STAILQ_NEXT((elm), field); \
+} while (0)
+
+#define STAILQ_REMOVE_HEAD(head, field) do { \
+ if ((STAILQ_FIRST((head)) = \
+ STAILQ_NEXT(STAILQ_FIRST((head)), field)) == NULL) \
+ (head)->stqh_last = &STAILQ_FIRST((head)); \
+} while (0)
+
+#define STAILQ_SWAP(head1, head2, type) do { \
+ QUEUE_TYPEOF(type) *swap_first = STAILQ_FIRST(head1); \
+ QUEUE_TYPEOF(type) **swap_last = (head1)->stqh_last; \
+ STAILQ_FIRST(head1) = STAILQ_FIRST(head2); \
+ (head1)->stqh_last = (head2)->stqh_last; \
+ STAILQ_FIRST(head2) = swap_first; \
+ (head2)->stqh_last = swap_last; \
+ if (STAILQ_EMPTY(head1)) \
+ (head1)->stqh_last = &STAILQ_FIRST(head1); \
+ if (STAILQ_EMPTY(head2)) \
+ (head2)->stqh_last = &STAILQ_FIRST(head2); \
+} while (0)
+
+
+/*
+ * List declarations.
+ */
+#define LIST_HEAD(name, type) \
+struct name { \
+ struct type *lh_first; /* first element */ \
+}
+
+#define LIST_CLASS_HEAD(name, type) \
+struct name { \
+ class type *lh_first; /* first element */ \
+}
+
+#define LIST_HEAD_INITIALIZER(head) \
+ { NULL }
+
+#define LIST_ENTRY(type) \
+struct { \
+ struct type *le_next; /* next element */ \
+ struct type **le_prev; /* address of previous next element */ \
+}
+
+#define LIST_CLASS_ENTRY(type) \
+struct { \
+ class type *le_next; /* next element */ \
+ class type **le_prev; /* address of previous next element */ \
+}
+
+/*
+ * List functions.
+ */
+
+#if (defined(_KERNEL) && defined(INVARIANTS))
+/*
+ * QMD_LIST_CHECK_HEAD(LIST_HEAD *head, LIST_ENTRY NAME)
+ *
+ * If the list is non-empty, validates that the first element of the list
+ * points back at 'head.'
+ */
+#define QMD_LIST_CHECK_HEAD(head, field) do { \
+ if (LIST_FIRST((head)) != NULL && \
+ LIST_FIRST((head))->field.le_prev != \
+ &LIST_FIRST((head))) \
+ panic("Bad list head %p first->prev != head", (head)); \
+} while (0)
+
+/*
+ * QMD_LIST_CHECK_NEXT(TYPE *elm, LIST_ENTRY NAME)
+ *
+ * If an element follows 'elm' in the list, validates that the next element
+ * points back at 'elm.'
+ */
+#define QMD_LIST_CHECK_NEXT(elm, field) do { \
+ if (LIST_NEXT((elm), field) != NULL && \
+ LIST_NEXT((elm), field)->field.le_prev != \
+ &((elm)->field.le_next)) \
+ panic("Bad link elm %p next->prev != elm", (elm)); \
+} while (0)
+
+/*
+ * QMD_LIST_CHECK_PREV(TYPE *elm, LIST_ENTRY NAME)
+ *
+ * Validates that the previous element (or head of the list) points to 'elm.'
+ */
+#define QMD_LIST_CHECK_PREV(elm, field) do { \
+ if (*(elm)->field.le_prev != (elm)) \
+ panic("Bad link elm %p prev->next != elm", (elm)); \
+} while (0)
+#else
+#define QMD_LIST_CHECK_HEAD(head, field)
+#define QMD_LIST_CHECK_NEXT(elm, field)
+#define QMD_LIST_CHECK_PREV(elm, field)
+#endif /* (_KERNEL && INVARIANTS) */
+
+#define LIST_CONCAT(head1, head2, type, field) do { \
+ QUEUE_TYPEOF(type) *curelm = LIST_FIRST(head1); \
+ if (curelm == NULL) { \
+ if ((LIST_FIRST(head1) = LIST_FIRST(head2)) != NULL) { \
+ LIST_FIRST(head2)->field.le_prev = \
+ &LIST_FIRST((head1)); \
+ LIST_INIT(head2); \
+ } \
+ } else if (LIST_FIRST(head2) != NULL) { \
+ while (LIST_NEXT(curelm, field) != NULL) \
+ curelm = LIST_NEXT(curelm, field); \
+ LIST_NEXT(curelm, field) = LIST_FIRST(head2); \
+ LIST_FIRST(head2)->field.le_prev = &LIST_NEXT(curelm, field); \
+ LIST_INIT(head2); \
+ } \
+} while (0)
+
+#define LIST_EMPTY(head) ((head)->lh_first == NULL)
+
+#define LIST_FIRST(head) ((head)->lh_first)
+
+#define LIST_FOREACH(var, head, field) \
+ for ((var) = LIST_FIRST((head)); \
+ (var); \
+ (var) = LIST_NEXT((var), field))
+
+#define LIST_FOREACH_FROM(var, head, field) \
+ for ((var) = ((var) ? (var) : LIST_FIRST((head))); \
+ (var); \
+ (var) = LIST_NEXT((var), field))
+
+#define LIST_FOREACH_SAFE(var, head, field, tvar) \
+ for ((var) = LIST_FIRST((head)); \
+ (var) && ((tvar) = LIST_NEXT((var), field), 1); \
+ (var) = (tvar))
+
+#define LIST_FOREACH_FROM_SAFE(var, head, field, tvar) \
+ for ((var) = ((var) ? (var) : LIST_FIRST((head))); \
+ (var) && ((tvar) = LIST_NEXT((var), field), 1); \
+ (var) = (tvar))
+
+#define LIST_INIT(head) do { \
+ LIST_FIRST((head)) = NULL; \
+} while (0)
+
+#define LIST_INSERT_AFTER(listelm, elm, field) do { \
+ QMD_LIST_CHECK_NEXT(listelm, field); \
+ if ((LIST_NEXT((elm), field) = LIST_NEXT((listelm), field)) != NULL)\
+ LIST_NEXT((listelm), field)->field.le_prev = \
+ &LIST_NEXT((elm), field); \
+ LIST_NEXT((listelm), field) = (elm); \
+ (elm)->field.le_prev = &LIST_NEXT((listelm), field); \
+} while (0)
+
+#define LIST_INSERT_BEFORE(listelm, elm, field) do { \
+ QMD_LIST_CHECK_PREV(listelm, field); \
+ (elm)->field.le_prev = (listelm)->field.le_prev; \
+ LIST_NEXT((elm), field) = (listelm); \
+ *(listelm)->field.le_prev = (elm); \
+ (listelm)->field.le_prev = &LIST_NEXT((elm), field); \
+} while (0)
+
+#define LIST_INSERT_HEAD(head, elm, field) do { \
+ QMD_LIST_CHECK_HEAD((head), field); \
+ if ((LIST_NEXT((elm), field) = LIST_FIRST((head))) != NULL) \
+ LIST_FIRST((head))->field.le_prev = &LIST_NEXT((elm), field);\
+ LIST_FIRST((head)) = (elm); \
+ (elm)->field.le_prev = &LIST_FIRST((head)); \
+} while (0)
+
+#define LIST_NEXT(elm, field) ((elm)->field.le_next)
+
+#define LIST_PREV(elm, head, type, field) \
+ ((elm)->field.le_prev == &LIST_FIRST((head)) ? NULL : \
+ __containerof((elm)->field.le_prev, \
+ QUEUE_TYPEOF(type), field.le_next))
+
+#define LIST_REMOVE(elm, field) do { \
+ QMD_SAVELINK(oldnext, (elm)->field.le_next); \
+ QMD_SAVELINK(oldprev, (elm)->field.le_prev); \
+ QMD_LIST_CHECK_NEXT(elm, field); \
+ QMD_LIST_CHECK_PREV(elm, field); \
+ if (LIST_NEXT((elm), field) != NULL) \
+ LIST_NEXT((elm), field)->field.le_prev = \
+ (elm)->field.le_prev; \
+ *(elm)->field.le_prev = LIST_NEXT((elm), field); \
+ TRASHIT(*oldnext); \
+ TRASHIT(*oldprev); \
+} while (0)
+
+#define LIST_SWAP(head1, head2, type, field) do { \
+ QUEUE_TYPEOF(type) *swap_tmp = LIST_FIRST(head1); \
+ LIST_FIRST((head1)) = LIST_FIRST((head2)); \
+ LIST_FIRST((head2)) = swap_tmp; \
+ if ((swap_tmp = LIST_FIRST((head1))) != NULL) \
+ swap_tmp->field.le_prev = &LIST_FIRST((head1)); \
+ if ((swap_tmp = LIST_FIRST((head2))) != NULL) \
+ swap_tmp->field.le_prev = &LIST_FIRST((head2)); \
+} while (0)
+
+/*
+ * Tail queue declarations.
+ */
+#define TAILQ_HEAD(name, type) \
+struct name { \
+ struct type *tqh_first; /* first element */ \
+ struct type **tqh_last; /* addr of last next element */ \
+ TRACEBUF \
+}
+
+#define TAILQ_CLASS_HEAD(name, type) \
+struct name { \
+ class type *tqh_first; /* first element */ \
+ class type **tqh_last; /* addr of last next element */ \
+ TRACEBUF \
+}
+
+#define TAILQ_HEAD_INITIALIZER(head) \
+ { NULL, &(head).tqh_first, TRACEBUF_INITIALIZER }
+
+#define TAILQ_ENTRY(type) \
+struct { \
+ struct type *tqe_next; /* next element */ \
+ struct type **tqe_prev; /* address of previous next element */ \
+ TRACEBUF \
+}
+
+#define TAILQ_CLASS_ENTRY(type) \
+struct { \
+ class type *tqe_next; /* next element */ \
+ class type **tqe_prev; /* address of previous next element */ \
+ TRACEBUF \
+}
+
+/*
+ * Tail queue functions.
+ */
+#if (defined(_KERNEL) && defined(INVARIANTS))
+/*
+ * QMD_TAILQ_CHECK_HEAD(TAILQ_HEAD *head, TAILQ_ENTRY NAME)
+ *
+ * If the tailq is non-empty, validates that the first element of the tailq
+ * points back at 'head.'
+ */
+#define QMD_TAILQ_CHECK_HEAD(head, field) do { \
+ if (!TAILQ_EMPTY(head) && \
+ TAILQ_FIRST((head))->field.tqe_prev != \
+ &TAILQ_FIRST((head))) \
+ panic("Bad tailq head %p first->prev != head", (head)); \
+} while (0)
+
+/*
+ * QMD_TAILQ_CHECK_TAIL(TAILQ_HEAD *head, TAILQ_ENTRY NAME)
+ *
+ * Validates that the tail of the tailq is a pointer to pointer to NULL.
+ */
+#define QMD_TAILQ_CHECK_TAIL(head, field) do { \
+ if (*(head)->tqh_last != NULL) \
+ panic("Bad tailq NEXT(%p->tqh_last) != NULL", (head)); \
+} while (0)
+
+/*
+ * QMD_TAILQ_CHECK_NEXT(TYPE *elm, TAILQ_ENTRY NAME)
+ *
+ * If an element follows 'elm' in the tailq, validates that the next element
+ * points back at 'elm.'
+ */
+#define QMD_TAILQ_CHECK_NEXT(elm, field) do { \
+ if (TAILQ_NEXT((elm), field) != NULL && \
+ TAILQ_NEXT((elm), field)->field.tqe_prev != \
+ &((elm)->field.tqe_next)) \
+ panic("Bad link elm %p next->prev != elm", (elm)); \
+} while (0)
+
+/*
+ * QMD_TAILQ_CHECK_PREV(TYPE *elm, TAILQ_ENTRY NAME)
+ *
+ * Validates that the previous element (or head of the tailq) points to 'elm.'
+ */
+#define QMD_TAILQ_CHECK_PREV(elm, field) do { \
+ if (*(elm)->field.tqe_prev != (elm)) \
+ panic("Bad link elm %p prev->next != elm", (elm)); \
+} while (0)
+#else
+#define QMD_TAILQ_CHECK_HEAD(head, field)
+#define QMD_TAILQ_CHECK_TAIL(head, headname)
+#define QMD_TAILQ_CHECK_NEXT(elm, field)
+#define QMD_TAILQ_CHECK_PREV(elm, field)
+#endif /* (_KERNEL && INVARIANTS) */
+
+#define TAILQ_CONCAT(head1, head2, field) do { \
+ if (!TAILQ_EMPTY(head2)) { \
+ *(head1)->tqh_last = (head2)->tqh_first; \
+ (head2)->tqh_first->field.tqe_prev = (head1)->tqh_last; \
+ (head1)->tqh_last = (head2)->tqh_last; \
+ TAILQ_INIT((head2)); \
+ QMD_TRACE_HEAD(head1); \
+ QMD_TRACE_HEAD(head2); \
+ } \
+} while (0)
+
+#define TAILQ_EMPTY(head) ((head)->tqh_first == NULL)
+
+#define TAILQ_FIRST(head) ((head)->tqh_first)
+
+#define TAILQ_FOREACH(var, head, field) \
+ for ((var) = TAILQ_FIRST((head)); \
+ (var); \
+ (var) = TAILQ_NEXT((var), field))
+
+#define TAILQ_FOREACH_FROM(var, head, field) \
+ for ((var) = ((var) ? (var) : TAILQ_FIRST((head))); \
+ (var); \
+ (var) = TAILQ_NEXT((var), field))
+
+#define TAILQ_FOREACH_SAFE(var, head, field, tvar) \
+ for ((var) = TAILQ_FIRST((head)); \
+ (var) && ((tvar) = TAILQ_NEXT((var), field), 1); \
+ (var) = (tvar))
+
+#define TAILQ_FOREACH_FROM_SAFE(var, head, field, tvar) \
+ for ((var) = ((var) ? (var) : TAILQ_FIRST((head))); \
+ (var) && ((tvar) = TAILQ_NEXT((var), field), 1); \
+ (var) = (tvar))
+
+#define TAILQ_FOREACH_REVERSE(var, head, headname, field) \
+ for ((var) = TAILQ_LAST((head), headname); \
+ (var); \
+ (var) = TAILQ_PREV((var), headname, field))
+
+#define TAILQ_FOREACH_REVERSE_FROM(var, head, headname, field) \
+ for ((var) = ((var) ? (var) : TAILQ_LAST((head), headname)); \
+ (var); \
+ (var) = TAILQ_PREV((var), headname, field))
+
+#define TAILQ_FOREACH_REVERSE_SAFE(var, head, headname, field, tvar) \
+ for ((var) = TAILQ_LAST((head), headname); \
+ (var) && ((tvar) = TAILQ_PREV((var), headname, field), 1); \
+ (var) = (tvar))
+
+#define TAILQ_FOREACH_REVERSE_FROM_SAFE(var, head, headname, field, tvar) \
+ for ((var) = ((var) ? (var) : TAILQ_LAST((head), headname)); \
+ (var) && ((tvar) = TAILQ_PREV((var), headname, field), 1); \
+ (var) = (tvar))
+
+#define TAILQ_INIT(head) do { \
+ TAILQ_FIRST((head)) = NULL; \
+ (head)->tqh_last = &TAILQ_FIRST((head)); \
+ QMD_TRACE_HEAD(head); \
+} while (0)
+
+#define TAILQ_INSERT_AFTER(head, listelm, elm, field) do { \
+ QMD_TAILQ_CHECK_NEXT(listelm, field); \
+ if ((TAILQ_NEXT((elm), field) = TAILQ_NEXT((listelm), field)) != NULL)\
+ TAILQ_NEXT((elm), field)->field.tqe_prev = \
+ &TAILQ_NEXT((elm), field); \
+ else { \
+ (head)->tqh_last = &TAILQ_NEXT((elm), field); \
+ QMD_TRACE_HEAD(head); \
+ } \
+ TAILQ_NEXT((listelm), field) = (elm); \
+ (elm)->field.tqe_prev = &TAILQ_NEXT((listelm), field); \
+ QMD_TRACE_ELEM(&(elm)->field); \
+ QMD_TRACE_ELEM(&(listelm)->field); \
+} while (0)
+
+#define TAILQ_INSERT_BEFORE(listelm, elm, field) do { \
+ QMD_TAILQ_CHECK_PREV(listelm, field); \
+ (elm)->field.tqe_prev = (listelm)->field.tqe_prev; \
+ TAILQ_NEXT((elm), field) = (listelm); \
+ *(listelm)->field.tqe_prev = (elm); \
+ (listelm)->field.tqe_prev = &TAILQ_NEXT((elm), field); \
+ QMD_TRACE_ELEM(&(elm)->field); \
+ QMD_TRACE_ELEM(&(listelm)->field); \
+} while (0)
+
+#define TAILQ_INSERT_HEAD(head, elm, field) do { \
+ QMD_TAILQ_CHECK_HEAD(head, field); \
+ if ((TAILQ_NEXT((elm), field) = TAILQ_FIRST((head))) != NULL) \
+ TAILQ_FIRST((head))->field.tqe_prev = \
+ &TAILQ_NEXT((elm), field); \
+ else \
+ (head)->tqh_last = &TAILQ_NEXT((elm), field); \
+ TAILQ_FIRST((head)) = (elm); \
+ (elm)->field.tqe_prev = &TAILQ_FIRST((head)); \
+ QMD_TRACE_HEAD(head); \
+ QMD_TRACE_ELEM(&(elm)->field); \
+} while (0)
+
+#define TAILQ_INSERT_TAIL(head, elm, field) do { \
+ QMD_TAILQ_CHECK_TAIL(head, field); \
+ TAILQ_NEXT((elm), field) = NULL; \
+ (elm)->field.tqe_prev = (head)->tqh_last; \
+ *(head)->tqh_last = (elm); \
+ (head)->tqh_last = &TAILQ_NEXT((elm), field); \
+ QMD_TRACE_HEAD(head); \
+ QMD_TRACE_ELEM(&(elm)->field); \
+} while (0)
+
+#define TAILQ_LAST(head, headname) \
+ (*(((struct headname *)((head)->tqh_last))->tqh_last))
+
+/*
+ * The FAST function is fast in that it causes no data access other
+ * then the access to the head. The standard LAST function above
+ * will cause a data access of both the element you want and
+ * the previous element. FAST is very useful for instances when
+ * you may want to prefetch the last data element.
+ */
+#define TAILQ_LAST_FAST(head, type, field) \
+ (TAILQ_EMPTY(head) ? NULL : __containerof((head)->tqh_last, QUEUE_TYPEOF(type), field.tqe_next))
+
+#define TAILQ_NEXT(elm, field) ((elm)->field.tqe_next)
+
+#define TAILQ_PREV(elm, headname, field) \
+ (*(((struct headname *)((elm)->field.tqe_prev))->tqh_last))
+
+#define TAILQ_PREV_FAST(elm, head, type, field) \
+ ((elm)->field.tqe_prev == &(head)->tqh_first ? NULL : \
+ __containerof((elm)->field.tqe_prev, QUEUE_TYPEOF(type), field.tqe_next))
+
+#define TAILQ_REMOVE(head, elm, field) do { \
+ QMD_SAVELINK(oldnext, (elm)->field.tqe_next); \
+ QMD_SAVELINK(oldprev, (elm)->field.tqe_prev); \
+ QMD_TAILQ_CHECK_NEXT(elm, field); \
+ QMD_TAILQ_CHECK_PREV(elm, field); \
+ if ((TAILQ_NEXT((elm), field)) != NULL) \
+ TAILQ_NEXT((elm), field)->field.tqe_prev = \
+ (elm)->field.tqe_prev; \
+ else { \
+ (head)->tqh_last = (elm)->field.tqe_prev; \
+ QMD_TRACE_HEAD(head); \
+ } \
+ *(elm)->field.tqe_prev = TAILQ_NEXT((elm), field); \
+ TRASHIT(*oldnext); \
+ TRASHIT(*oldprev); \
+ QMD_TRACE_ELEM(&(elm)->field); \
+} while (0)
+
+#define TAILQ_SWAP(head1, head2, type, field) do { \
+ QUEUE_TYPEOF(type) *swap_first = (head1)->tqh_first; \
+ QUEUE_TYPEOF(type) **swap_last = (head1)->tqh_last; \
+ (head1)->tqh_first = (head2)->tqh_first; \
+ (head1)->tqh_last = (head2)->tqh_last; \
+ (head2)->tqh_first = swap_first; \
+ (head2)->tqh_last = swap_last; \
+ if ((swap_first = (head1)->tqh_first) != NULL) \
+ swap_first->field.tqe_prev = &(head1)->tqh_first; \
+ else \
+ (head1)->tqh_last = &(head1)->tqh_first; \
+ if ((swap_first = (head2)->tqh_first) != NULL) \
+ swap_first->field.tqe_prev = &(head2)->tqh_first; \
+ else \
+ (head2)->tqh_last = &(head2)->tqh_first; \
+} while (0)
+
+#endif /* !_SYS_QUEUE_H_ */
diff --git a/unzip/test/CMakeLists.txt b/unzip/test/CMakeLists.txt
new file mode 100644
index 000000000000..f269c25f85e6
--- /dev/null
+++ b/unzip/test/CMakeLists.txt
@@ -0,0 +1,83 @@
+############################################
+#
+# How to build bsdunzip_test
+#
+############################################
+IF(ENABLE_UNZIP AND ENABLE_TEST)
+ SET(bsdunzip_test_SOURCES
+ ../../libarchive_fe/err.c
+ ../../test_utils/test_utils.c
+ ../../test_utils/test_main.c
+ test.h
+ test_0.c
+ test_basic.c
+ test_doubledash.c
+ test_glob.c
+ test_singlefile.c
+ test_C.c
+ test_p.c
+ test_d.c
+ test_j.c
+ test_L.c
+ test_n.c
+ test_o.c
+ test_q.c
+ test_t.c
+ test_t_bad.c
+ test_version.c
+ test_x.c
+ test_Z1.c
+ test_P_encryption.c
+ test_I.c
+ )
+
+ #
+ # Register target
+ #
+ ADD_EXECUTABLE(bsdunzip_test ${bsdunzip_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(bsdunzip_test ${TEST_ACL_LIBS})
+ ENDIF(ENABLE_ACL)
+ SET_PROPERTY(TARGET bsdunzip_test PROPERTY COMPILE_DEFINITIONS LIST_H)
+
+ #
+ # Generate list.h by grepping DEFINE_TEST() lines out of the C sources.
+ #
+ GENERATE_LIST_H(${CMAKE_CURRENT_BINARY_DIR}/list.h
+ ${CMAKE_CURRENT_LIST_FILE} ${bsdunzip_test_SOURCES})
+ SET_PROPERTY(DIRECTORY APPEND PROPERTY INCLUDE_DIRECTORIES
+ ${CMAKE_CURRENT_BINARY_DIR})
+
+ # list.h has a line DEFINE_TEST(testname) for every
+ # test. We can use that to define the tests for cmake by
+ # defining a DEFINE_TEST macro and reading list.h in.
+ MACRO (DEFINE_TEST _testname)
+ ADD_TEST(
+ NAME bsdunzip_${_testname}
+ COMMAND bsdunzip_test -vv
+ -p $<TARGET_FILE:bsdunzip>
+ -r ${CMAKE_CURRENT_SOURCE_DIR}
+ ${_testname})
+ ENDMACRO (DEFINE_TEST _testname)
+
+ 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}/unzip/test)
+
+ # Experimental new test handling
+ ADD_CUSTOM_TARGET(run_bsdunzip_test
+ COMMAND bsdunzip_test -p $<TARGET_FILE:bsdunzip>
+ -r ${CMAKE_CURRENT_SOURCE_DIR}
+ -vv)
+ ADD_DEPENDENCIES(run_bsdunzip_test bsdunzip)
+ ADD_DEPENDENCIES(run_all_tests run_bsdunzip_test)
+ENDIF(ENABLE_UNZIP AND ENABLE_TEST)
+
diff --git a/unzip/test/test.h b/unzip/test/test.h
new file mode 100644
index 000000000000..822c3f08133f
--- /dev/null
+++ b/unzip/test/test.h
@@ -0,0 +1,38 @@
+/*
+ * 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.
+ */
+
+/* Every test program should #include "test.h" as the first thing. */
+
+#define KNOWNREF "test_basic.zip.uu"
+#define ENVBASE "BSDUNZIP" /* Prefix for environment variables. */
+#define PROGRAM "bsdunzip" /* Name of program being tested. */
+#define PROGRAM_ALIAS "unzip" /* 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 "test_common.h"
diff --git a/unzip/test/test_0.c b/unzip/test/test_0.c
new file mode 100644
index 000000000000..41279d388b1f
--- /dev/null
+++ b/unzip/test/test_0.c
@@ -0,0 +1,58 @@
+/*-
+ * 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"
+
+/*
+ * This first test does basic sanity checks on the environment. For
+ * most of these, we just exit on failure.
+ */
+#if !defined(_WIN32) || defined(__CYGWIN__)
+#define DEV_NULL "/dev/null"
+#else
+#define DEV_NULL "NUL"
+#endif
+
+DEFINE_TEST(test_0)
+{
+ struct stat st;
+
+ failure("File %s does not exist?!", testprog);
+ if (!assertEqualInt(0, stat(testprogfile, &st))) {
+ fprintf(stderr,
+ "\nFile %s does not exist; aborting test.\n\n",
+ testprog);
+ exit(1);
+ }
+
+ failure("%s is not executable?!", testprog);
+ if (!assert((st.st_mode & 0111) != 0)) {
+ fprintf(stderr,
+ "\nFile %s not executable; aborting test.\n\n",
+ testprog);
+ exit(1);
+ }
+
+ /* TODO: Ensure that our reference files are available. */
+}
diff --git a/unzip/test/test_C.c b/unzip/test/test_C.c
new file mode 100644
index 000000000000..fc11b970c2f3
--- /dev/null
+++ b/unzip/test/test_C.c
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2023 Adrian Vovk
+ * 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
+ * in this position and unchanged.
+ * 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"
+
+/* Test C arg - match case-insensitive */
+DEFINE_TEST(test_C)
+{
+ const char *reffile = "test_basic.zip";
+ int r;
+
+ extract_reference_file(reffile);
+ r = systemf("%s -C %s test_basic/caps >test.out 2>test.err", testprog, reffile);
+ assertEqualInt(0, r);
+ assertNonEmptyFile("test.out");
+ assertEmptyFile("test.err");
+
+ assertTextFileContents("contents CAPS\n", "test_basic/CAPS");
+}
diff --git a/unzip/test/test_I.c b/unzip/test/test_I.c
new file mode 100644
index 000000000000..a6bad85a011f
--- /dev/null
+++ b/unzip/test/test_I.c
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2023 Aaron Lindros
+ * 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
+ * in this position and unchanged.
+ * 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"
+
+/* Test I arg - file name encoding */
+DEFINE_TEST(test_I)
+{
+ const char *reffile = "test_I.zip";
+ int r;
+
+ extract_reference_file(reffile);
+ r = systemf("%s -I UTF-8 %s >test.out 2>test.err", testprog, reffile);
+ assertEqualInt(0, r);
+ assertNonEmptyFile("test.out");
+ assertEmptyFile("test.err");
+
+ assertTextFileContents("Hello, World!\n", "Γειά σου Κόσμε.txt");
+}
diff --git a/unzip/test/test_I.zip.uu b/unzip/test/test_I.zip.uu
new file mode 100644
index 000000000000..8a1e7afa5b92
--- /dev/null
+++ b/unzip/test/test_I.zip.uu
@@ -0,0 +1,8 @@
+begin 644 test_I.zip
+M4$L#!`H```@``&@)AU>$GNBT#@````X````>`!P`SI/.M<ZYSJP@SX/.O\^%
+M(,Z:SXS/@\Z\SK4N='AT550)``,#8G%E"6)Q975X"P`!!.@#```$Z`,``$AE
+M;&QO+"!7;W)L9"$*4$L!`AX#"@``"```:`F'5X2>Z+0.````#@```!X`&```
+M`````````*2!`````,Z3SK7.N<ZL(,^#SK_/A2#.FL^,SX/.O,ZU+G1X=%54
+L!0`#`V)Q975X"P`!!.@#```$Z`,``%!+!08``````0`!`&0```!F````````
+`
+end
diff --git a/unzip/test/test_L.c b/unzip/test/test_L.c
new file mode 100644
index 000000000000..4815cb2b139d
--- /dev/null
+++ b/unzip/test/test_L.c
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2023 Adrian Vovk
+ * 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
+ * in this position and unchanged.
+ * 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"
+
+/* Test L arg - make names lowercase */
+DEFINE_TEST(test_L)
+{
+ const char *reffile = "test_basic.zip";
+ int r;
+
+ extract_reference_file(reffile);
+ r = systemf("%s -L %s >test.out 2>test.err", testprog, reffile);
+ assertEqualInt(0, r);
+ assertNonEmptyFile("test.out");
+ assertEmptyFile("test.err");
+
+ assertTextFileContents("contents a\n", "test_basic/a");
+ assertTextFileContents("contents b\n", "test_basic/b");
+ assertTextFileContents("contents c\n", "test_basic/c");
+ assertTextFileContents("contents CAPS\n", "test_basic/caps");
+}
diff --git a/unzip/test/test_P_encryption.c b/unzip/test/test_P_encryption.c
new file mode 100644
index 000000000000..beabbaa646ee
--- /dev/null
+++ b/unzip/test/test_P_encryption.c
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2023 Adrian Vovk
+ * 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
+ * in this position and unchanged.
+ * 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"
+
+/* Test P arg - password protected */
+DEFINE_TEST(test_P)
+{
+ const char *reffile = "test_encrypted.zip";
+ int r;
+
+ extract_reference_file(reffile);
+ r = systemf("%s -P password %s >test.out 2>test.err", testprog, reffile);
+ assertEqualInt(0, r);
+ assertNonEmptyFile("test.out");
+ assertEmptyFile("test.err");
+
+ assertTextFileContents("plaintext\n", "encrypted/file.txt");
+}
diff --git a/unzip/test/test_Z1.c b/unzip/test/test_Z1.c
new file mode 100644
index 000000000000..58dc750030dd
--- /dev/null
+++ b/unzip/test/test_Z1.c
@@ -0,0 +1,40 @@
+/*
+ * Copyright (c) 2023 Adrian Vovk
+ * 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
+ * in this position and unchanged.
+ * 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"
+
+/* Test -Z1 arg - List filenames */
+DEFINE_TEST(test_Z1)
+{
+ const char *reffile = "test_basic.zip";
+ int r;
+
+ extract_reference_file(reffile);
+ r = systemf("%s -Z1 %s >test.out 2>test.err", testprog, reffile);
+ assertEqualInt(0, r);
+ assertNonEmptyFile("test.out");
+ assertTextFileContents("test_basic/\ntest_basic/a\ntest_basic/b\ntest_basic/c\ntest_basic/CAPS\n", "test.out");
+ assertEmptyFile("test.err");
+}
diff --git a/unzip/test/test_basic.c b/unzip/test/test_basic.c
new file mode 100644
index 000000000000..e997755e7e57
--- /dev/null
+++ b/unzip/test/test_basic.c
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2023 Adrian Vovk
+ * 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
+ * in this position and unchanged.
+ * 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"
+
+/* This test just does a basic zip decompression */
+DEFINE_TEST(test_basic)
+{
+ const char *reffile = "test_basic.zip";
+ int r;
+
+ extract_reference_file(reffile);
+ r = systemf("%s %s >test.out 2>test.err", testprog, reffile);
+ assertEqualInt(0, r);
+ assertNonEmptyFile("test.out");
+ assertEmptyFile("test.err");
+
+ assertTextFileContents("contents a\n", "test_basic/a");
+ assertTextFileContents("contents b\n", "test_basic/b");
+ assertTextFileContents("contents c\n", "test_basic/c");
+ assertTextFileContents("contents CAPS\n", "test_basic/CAPS");
+}
diff --git a/unzip/test/test_basic.zip.uu b/unzip/test/test_basic.zip.uu
new file mode 100644
index 000000000000..b55aca950327
--- /dev/null
+++ b/unzip/test/test_basic.zip.uu
@@ -0,0 +1,25 @@
+begin 644 test_basic.zip
+M4$L#!!0``````,J0MU8````````````````+`"``=&5S=%]B87-I8R]55`T`
+M!]PX;63U.6UDW#AM9'5X"P`!!.@#```$Z`,``%!+`P04``@`"``)C;=6````
+M```````+````#``@`'1E<W1?8F%S:6,O8554#0`'PS)M9/HY;603.&UD=7@+
+M``$$Z`,```3H`P``2\[/*TG-*RE62.0"`%!+!PAY:C`$#0````L```!02P,$
+M%``(``@`#HVW5@``````````"P````P`(`!T97-T7V)A<VEC+V)55`T`!\TR
+M;63Z.6UD.SAM9'5X"P`!!.@#```$Z`,``$O.SRM)S2LI5DCB`@!02P<(NCD=
+M+PT````+````4$L#!!0`"``(`%*-MU8```````````L````,`"``=&5S=%]B
+M87-I8R]C550-``=,,VUDTSAM9,\X;61U>`L``03H`P``!.@#``!+SL\K2<TK
+M*59(Y@(`4$L'"/L(!C8-````"P```%!+`P04``@`"`#*D+=6```````````.
+M````#P`@`'1E<W1?8F%S:6,O0T%04U54#0`'W#AM9/HY;63<.&UD=7@+``$$
+MZ`,```3H`P``2\[/*TG-*RE6<'8,".8"`%!+!P@I4T'W$`````X```!02P$"
+M%`,4``````#*D+=6````````````````"P`@````````````[4$`````=&5S
+M=%]B87-I8R]55`T`!]PX;63U.6UDW#AM9'5X"P`!!.@#```$Z`,``%!+`0(4
+M`Q0`"``(``F-MU9Y:C`$#0````L````,`"````````````"D@4D```!T97-T
+M7V)A<VEC+V%55`T`!\,R;63Z.6UD$SAM9'5X"P`!!.@#```$Z`,``%!+`0(4
+M`Q0`"``(``Z-MU:Z.1TO#0````L````,`"````````````"D@;````!T97-T
+M7V)A<VEC+V)55`T`!\TR;63Z.6UD.SAM9'5X"P`!!.@#```$Z`,``%!+`0(4
+M`Q0`"``(`%*-MU;["`8V#0````L````,`"````````````"D@1<!``!T97-T
+M7V)A<VEC+V-55`T`!TPS;633.&UDSSAM9'5X"P`!!.@#```$Z`,``%!+`0(4
+M`Q0`"``(`,J0MU8I4T'W$`````X````/`"````````````"D@7X!``!T97-T
+M7V)A<VEC+T-!4%-55`T`!]PX;63Z.6UDW#AM9'5X"P`!!.@#```$Z`,``%!+
+4!08`````!0`%`,0!``#K`0``````
+`
+end
diff --git a/unzip/test/test_d.c b/unzip/test/test_d.c
new file mode 100644
index 000000000000..01ab9b8caaa3
--- /dev/null
+++ b/unzip/test/test_d.c
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2023 Adrian Vovk
+ * 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
+ * in this position and unchanged.
+ * 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"
+
+/* Test d arg - extract to target dir - before zipfile argument */
+DEFINE_TEST(test_d_before_zipfile)
+{
+ const char *reffile = "test_basic.zip";
+ int r;
+
+ extract_reference_file(reffile);
+ r = systemf("%s -d foobar %s >test.out 2>test.err", testprog, reffile);
+ assertEqualInt(0, r);
+ assertNonEmptyFile("test.out");
+ assertEmptyFile("test.err");
+
+ assertTextFileContents("contents a\n", "foobar/test_basic/a");
+ assertTextFileContents("contents b\n", "foobar/test_basic/b");
+ assertTextFileContents("contents c\n", "foobar/test_basic/c");
+ assertTextFileContents("contents CAPS\n", "foobar/test_basic/CAPS");
+}
+
+/* Test d arg - extract to target dir - after zipfile argument */
+DEFINE_TEST(test_d_after_zipfile)
+{
+ const char *reffile = "test_basic.zip";
+ int r;
+
+ extract_reference_file(reffile);
+ r = systemf("%s %s -d foobar >test.out 2>test.err", testprog, reffile);
+ assertEqualInt(0, r);
+ assertNonEmptyFile("test.out");
+ assertEmptyFile("test.err");
+
+ assertTextFileContents("contents a\n", "foobar/test_basic/a");
+ assertTextFileContents("contents b\n", "foobar/test_basic/b");
+ assertTextFileContents("contents c\n", "foobar/test_basic/c");
+ assertTextFileContents("contents CAPS\n", "foobar/test_basic/CAPS");
+}
diff --git a/unzip/test/test_doubledash.c b/unzip/test/test_doubledash.c
new file mode 100644
index 000000000000..eb7d34e4f6cc
--- /dev/null
+++ b/unzip/test/test_doubledash.c
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2023 Adrian Vovk
+ * 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
+ * in this position and unchanged.
+ * 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"
+
+/* Test double dash arg - swallow "--" and use next argument as file name */
+DEFINE_TEST(test_doubledash)
+{
+ const char *reffile = "test_basic.zip";
+ int r;
+
+ extract_reference_file(reffile);
+ r = systemf("%s -- %s >test.out 2>test.err", testprog, reffile);
+ assertEqualInt(0, r);
+ assertNonEmptyFile("test.out");
+ assertEmptyFile("test.err");
+
+ assertTextFileContents("contents a\n", "test_basic/a");
+ assertTextFileContents("contents b\n", "test_basic/b");
+ assertTextFileContents("contents c\n", "test_basic/c");
+ assertTextFileContents("contents CAPS\n", "test_basic/CAPS");
+}
diff --git a/unzip/test/test_encrypted.zip.uu b/unzip/test/test_encrypted.zip.uu
new file mode 100644
index 000000000000..6aabeb9f5786
--- /dev/null
+++ b/unzip/test/test_encrypted.zip.uu
@@ -0,0 +1,13 @@
+begin 644 test_encrypted.zip
+M4$L#!!0``````'*1MU8````````````````*`"``96YC<GEP=&5D+U54#0`'
+M&#IM9!LZ;608.FUD=7@+``$$Z`,```3H`P``4$L#!!0`"0!C`'*1MU8`````
+M``````H````2`"L`96YC<GEP=&5D+V9I;&4N='AT550-``<8.FUD&#IM9!@Z
+M;61U>`L``03H`P``!.@#```!F0<``@!!10,(`*_-)-RYPDYFJ$Q9+L<I#-><
+M'#C?XVBR9/=H?7U\LC!A^8<6[&CO#PM02P<(`````"@````*````4$L!`A0#
+M%```````<I&W5@````````````````H`(````````````.U!`````&5N8W)Y
+M<'1E9"]55`T`!Q@Z;60;.FUD&#IM9'5X"P`!!.@#```$Z`,``%!+`0(4`Q0`
+M"0!C`'*1MU8`````*`````H````2`"L```````````"D@4@```!E;F-R>7!T
+M960O9FEL92YT>'155`T`!Q@Z;608.FUD&#IM9'5X"P`!!.@#```$Z`,```&9
+?!P`"`$%%`P@`4$L%!@`````"``(`PP```-L`````````
+`
+end
diff --git a/unzip/test/test_glob.c b/unzip/test/test_glob.c
new file mode 100644
index 000000000000..b334ce4bd37d
--- /dev/null
+++ b/unzip/test/test_glob.c
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2023 Adrian Vovk
+ * 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
+ * in this position and unchanged.
+ * 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"
+
+/* Test that the glob works */
+DEFINE_TEST(test_glob)
+{
+ const char *reffile = "test_basic.zip";
+ int r;
+
+ extract_reference_file(reffile);
+ r = systemf("%s %s test_*/[ab] >test.out 2>test.err", testprog, reffile);
+ assertEqualInt(0, r);
+ assertNonEmptyFile("test.out");
+ assertEmptyFile("test.err");
+
+ assertTextFileContents("contents a\n", "test_basic/a");
+ assertTextFileContents("contents b\n", "test_basic/b");
+ assertFileNotExists("test_basic/c");
+ assertFileNotExists("test_basic/CAPS");
+}
diff --git a/unzip/test/test_j.c b/unzip/test/test_j.c
new file mode 100644
index 000000000000..a449e02644b5
--- /dev/null
+++ b/unzip/test/test_j.c
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2023 Adrian Vovk
+ * 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
+ * in this position and unchanged.
+ * 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"
+
+/* Test j arg - don't make directories */
+DEFINE_TEST(test_j)
+{
+ const char *reffile = "test_basic.zip";
+ int r;
+
+ extract_reference_file(reffile);
+ r = systemf("%s -j %s >test.out 2>test.err", testprog, reffile);
+ assertEqualInt(0, r);
+ assertNonEmptyFile("test.out");
+ assertEmptyFile("test.err");
+
+ assertTextFileContents("contents a\n", "a");
+ assertTextFileContents("contents b\n", "b");
+ assertTextFileContents("contents c\n", "c");
+ assertTextFileContents("contents CAPS\n", "CAPS");
+}
diff --git a/unzip/test/test_n.c b/unzip/test/test_n.c
new file mode 100644
index 000000000000..4e893f04b7ae
--- /dev/null
+++ b/unzip/test/test_n.c
@@ -0,0 +1,48 @@
+/*
+ * Copyright (c) 2023 Adrian Vovk
+ * 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
+ * in this position and unchanged.
+ * 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"
+
+/* Test n arg - don't overrite existing files */
+DEFINE_TEST(test_n)
+{
+ const char *reffile = "test_basic.zip";
+ int r;
+
+ assertMakeDir("test_basic", 0755);
+ assertMakeFile("test_basic/a", 0644, "orig a\n");
+ assertMakeFile("test_basic/b", 0644, "orig b\n");
+
+ extract_reference_file(reffile);
+ r = systemf("%s -n %s >test.out 2>test.err", testprog, reffile);
+ assertEqualInt(0, r);
+ assertNonEmptyFile("test.out");
+ assertEmptyFile("test.err");
+
+ assertTextFileContents("orig a\n", "test_basic/a");
+ assertTextFileContents("orig b\n", "test_basic/b");
+ assertTextFileContents("contents c\n", "test_basic/c");
+ assertTextFileContents("contents CAPS\n", "test_basic/CAPS");
+}
diff --git a/unzip/test/test_not_exist.c b/unzip/test/test_not_exist.c
new file mode 100644
index 000000000000..aa660dc646e5
--- /dev/null
+++ b/unzip/test/test_not_exist.c
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2023 Adrian Vovk
+ * 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
+ * in this position and unchanged.
+ * 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"
+
+/* Test non existant file */
+DEFINE_TEST(test_not_exist)
+{
+ int r;
+ r = systemf("%s nonexist.zip >test.out 2>test.err", testprog);
+ assert(r != 0);
+ assertEmptyFile("test.out");
+ assertNonEmptyFile("test.err");
+}
diff --git a/unzip/test/test_o.c b/unzip/test/test_o.c
new file mode 100644
index 000000000000..af0c4128686f
--- /dev/null
+++ b/unzip/test/test_o.c
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2023 Adrian Vovk
+ * 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
+ * in this position and unchanged.
+ * 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"
+
+/* Test o arg - overrite existing files */
+DEFINE_TEST(test_o)
+{
+ const char *reffile = "test_basic.zip";
+ int r;
+
+ assertMakeDir("test_basic", 0755);
+ assertMakeFile("test_basic/a", 0644, "orig a\n");
+ assertMakeFile("test_basic/b", 0644, "orig b\n");
+
+ extract_reference_file(reffile);
+ r = systemf("%s -o %s >test.out 2>test.err", testprog, reffile);
+ assertEqualInt(0, r);
+ assertEmptyFile("test.err");
+
+ assertTextFileContents("contents a\n", "test_basic/a");
+ assertTextFileContents("contents b\n", "test_basic/b");
+ assertTextFileContents("contents c\n", "test_basic/c");
+ assertTextFileContents("contents CAPS\n", "test_basic/CAPS");
+}
diff --git a/unzip/test/test_p.c b/unzip/test/test_p.c
new file mode 100644
index 000000000000..f34a5eae8e13
--- /dev/null
+++ b/unzip/test/test_p.c
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2023 Adrian Vovk
+ * 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
+ * in this position and unchanged.
+ * 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"
+
+/* Test p arg - Print to stdout */
+DEFINE_TEST(test_p)
+{
+ const char *reffile = "test_basic.zip";
+ int r;
+
+ extract_reference_file(reffile);
+ r = systemf("%s -p %s >test.out 2>test.err", testprog, reffile);
+ assertEqualInt(0, r);
+ assertTextFileContents("contents a\ncontents b\ncontents c\ncontents CAPS\n", "test.out");
+ assertEmptyFile("test.err");
+}
diff --git a/unzip/test/test_q.c b/unzip/test/test_q.c
new file mode 100644
index 000000000000..9a532c888366
--- /dev/null
+++ b/unzip/test/test_q.c
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2023 Adrian Vovk
+ * 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
+ * in this position and unchanged.
+ * 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"
+
+/* Test q arg - Quiet */
+DEFINE_TEST(test_q)
+{
+ const char *reffile = "test_basic.zip";
+ int r;
+
+ extract_reference_file(reffile);
+ r = systemf("%s -q %s >test.out 2>test.err", testprog, reffile);
+ assertEqualInt(0, r);
+ assertEmptyFile("test.out");
+ assertEmptyFile("test.err");
+
+ assertTextFileContents("contents a\n", "test_basic/a");
+ assertTextFileContents("contents b\n", "test_basic/b");
+ assertTextFileContents("contents c\n", "test_basic/c");
+ assertTextFileContents("contents CAPS\n", "test_basic/CAPS");
+}
diff --git a/unzip/test/test_singlefile.c b/unzip/test/test_singlefile.c
new file mode 100644
index 000000000000..70c376eb3932
--- /dev/null
+++ b/unzip/test/test_singlefile.c
@@ -0,0 +1,41 @@
+/*
+ * Copyright (c) 2023 Adrian Vovk
+ * 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
+ * in this position and unchanged.
+ * 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"
+
+/* Ensure single-file zips work */
+DEFINE_TEST(test_singlefile)
+{
+ const char *reffile = "test_singlefile.zip";
+ int r;
+
+ extract_reference_file(reffile);
+ r = systemf("%s %s >test.out 2>test.err", testprog, reffile);
+ assertEqualInt(0, r);
+ assertNonEmptyFile("test.out");
+ assertEmptyFile("test.err");
+
+ assertTextFileContents("hello\n", "file.txt");
+}
diff --git a/unzip/test/test_singlefile.zip.uu b/unzip/test/test_singlefile.zip.uu
new file mode 100644
index 000000000000..589e08f12396
--- /dev/null
+++ b/unzip/test/test_singlefile.zip.uu
@@ -0,0 +1,8 @@
+begin 644 test_singlefile.zip
+M4$L#!!0`"``(`&"6MU8```````````8````(`"``9FEL92YT>'155`T`!U1#
+M;6140VUD5$-M9'5X"P`!!.@#```$Z`,``,M(S<G)YP(`4$L'""`P.C8(````
+M!@```%!+`0(4`Q0`"``(`&"6MU8@,#HV"`````8````(`"````````````"D
+M@0````!F:6QE+G1X=%54#0`'5$-M9%1#;6140VUD=7@+``$$Z`,```3H`P``
+64$L%!@`````!``$`5@```%X`````````
+`
+end
diff --git a/unzip/test/test_t.c b/unzip/test/test_t.c
new file mode 100644
index 000000000000..40d8d39e54d5
--- /dev/null
+++ b/unzip/test/test_t.c
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2023 Adrian Vovk
+ * 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
+ * in this position and unchanged.
+ * 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"
+
+/* Test t arg - Test zip contents */
+DEFINE_TEST(test_t)
+{
+ const char *reffile = "test_basic.zip";
+ int r;
+
+ extract_reference_file(reffile);
+ r = systemf("%s -t %s >test.out 2>test.err", testprog, reffile);
+ assertEqualInt(0, r);
+ assertNonEmptyFile("test.out");
+ assertEmptyFile("test.err");
+}
diff --git a/unzip/test/test_t_bad.c b/unzip/test/test_t_bad.c
new file mode 100644
index 000000000000..f9afbb40dae2
--- /dev/null
+++ b/unzip/test/test_t_bad.c
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2023 Adrian Vovk
+ * 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
+ * in this position and unchanged.
+ * 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"
+
+/* Test t arg - Test zip contents, but fail! */
+DEFINE_TEST(test_t_bad)
+{
+ const char *reffile = "test_t_bad.zip";
+ int r;
+
+ extract_reference_file(reffile);
+ r = systemf("%s -t %s >test.out 2>test.err", testprog, reffile);
+ assert(r != 0);
+ assertNonEmptyFile("test.out");
+ assertNonEmptyFile("test.err");
+}
diff --git a/unzip/test/test_t_bad.zip.uu b/unzip/test/test_t_bad.zip.uu
new file mode 100644
index 000000000000..ae6ad07925e6
--- /dev/null
+++ b/unzip/test/test_t_bad.zip.uu
@@ -0,0 +1,25 @@
+begin 644 test_t_bad.zip
+M4$L#!!0``````,J0MU8````````````````+`"``=&5S=%]B87-I8R]55`T`
+M!]PX;63U.6UDW#AM9'5X"P`!!.@#```$Z`,``%!+`P04``@`"``)C;=6````
+M```````+````#``@`'1E<W1?8F%S:6,O85546``'PS)M9/HY;603.&UD=7@+
+M``$$Z`,```3H`P``2\[/*TG-*RE62.0"`%!+!PAY:C`$#0````L```!02P,$
+M%&$(``@`#HVW5@``````````"P````P`(`!T97-T7V)A<VEC+V)55`T`!\TR
+M;63Z.6UD.SAM9'5X"P`!!.@#```$Z`,``$O.SRM)S2LI5DCB`@!02P<(NCD=
+M+PT````+````4$L#!!0`"``(`%*-MU8```````````L````,`"``=&5S=%]B
+M87-I8R]C550-``=,,VUDTSAM9,\X;61U>`L``03H`P``!.@#``!+SL\K2<TK
+M*59(Y@(`4$L'"/L(!C8-````"P```%!+`P04``@`"`#*D+=6```````````.
+M````#P`@`'1E<W1?8F%S:6,O0T%04U54#0`'W#AM9/HY;63<.&UD=7@+``$$
+MZ`,```3H`P``2\[/*TG-*RE6<'8,".8"`%!+!P@I4T'W$`````X```!02P$"
+M%`,4``````#*D+=6````````````````"P`@````````````[4(`````=&5S
+M=%]B87-I8R]55`T`!]PX;63U.6UDW#AM9'5X"P`!!.@#```$Z`,``%!+`0(4
+M`Q0`"``(``F-MU9Y:C`$#0````L````,`"````````````"D@4D```!T97-T
+M7V)A<VEC+V%55`T`!\,R;63Z.6UD$SAM9'5X"P`!!.@#```$Z`,``%!+`0(4
+M`Q0`"``(``Z-MU:Z.1TO#0````L````,`"````````````"D@;````!T97-T
+M7V)A<VEC+V)55`T`!\TR;63Z.6UD.SAM9'5X"P`!!.@#```$Z`,``%!+`0(4
+M`Q0`"``(`%*-MU;["`8V#0````L````,`"````````````"D@1<!``!T97-T
+M7V)A<VEC+V-55`T`!TPS;633.&UDSSAM9'5X"P`!!.@#```$Z`,``%!+`0(4
+M`Q0`"``(`,J0MU8I4T'W$`````X````/`"````````````"D@7X!``!T97-T
+M7V)A<VEC+T-!4%-55`T`!]PX;63Z.6UDW#AM9'5X"P`!!.@#```$Z`,``%!+
+5!08`````!0`%`,0!``#K`0`````*
+`
+end
diff --git a/unzip/test/test_version.c b/unzip/test/test_version.c
new file mode 100644
index 000000000000..efa797982d57
--- /dev/null
+++ b/unzip/test/test_version.c
@@ -0,0 +1,34 @@
+/*-
+ * 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.
+ */
+#include "test.h"
+
+/*
+ * Test that --version option works and generates reasonable output.
+ */
+
+DEFINE_TEST(test_version)
+{
+ assertVersion(testprog, "bsdunzip");
+}
diff --git a/unzip/test/test_x.c b/unzip/test/test_x.c
new file mode 100644
index 000000000000..d55376849ce9
--- /dev/null
+++ b/unzip/test/test_x.c
@@ -0,0 +1,80 @@
+/*
+ * Copyright (c) 2023 Adrian Vovk
+ * 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
+ * in this position and unchanged.
+ * 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"
+
+/* Test x arg with single exclude path */
+DEFINE_TEST(test_x_single)
+{
+ const char *reffile = "test_basic.zip";
+ int r;
+
+ extract_reference_file(reffile);
+ r = systemf("%s %s -x test_basic/c >test.out 2>test.err", testprog, reffile);
+ assertEqualInt(0, r);
+ assertNonEmptyFile("test.out");
+ assertEmptyFile("test.err");
+
+ assertTextFileContents("contents a\n", "test_basic/a");
+ assertTextFileContents("contents b\n", "test_basic/b");
+ assertFileNotExists("test_basic/c");
+ assertTextFileContents("contents CAPS\n", "test_basic/CAPS");
+}
+
+/* Test x arg with multiple exclude paths */
+DEFINE_TEST(test_x_multiple)
+{
+ const char *reffile = "test_basic.zip";
+ int r;
+
+ extract_reference_file(reffile);
+ r = systemf("%s %s -x test_basic/c test_basic/b >test.out 2>test.err", testprog, reffile);
+ assertEqualInt(0, r);
+ assertNonEmptyFile("test.out");
+ assertEmptyFile("test.err");
+
+ assertTextFileContents("contents a\n", "test_basic/a");
+ assertFileNotExists("test_basic/b");
+ assertFileNotExists("test_basic/c");
+ assertTextFileContents("contents CAPS\n", "test_basic/CAPS");
+}
+
+/* Test x arg with multiple exclude paths and a d arg afterwards */
+DEFINE_TEST(test_x_multiple_with_d)
+{
+ const char *reffile = "test_basic.zip";
+ int r;
+
+ extract_reference_file(reffile);
+ r = systemf("%s %s -x test_basic/c test_basic/b -d foobar >test.out 2>test.err", testprog, reffile);
+ assertEqualInt(0, r);
+ assertNonEmptyFile("test.out");
+ assertEmptyFile("test.err");
+
+ assertTextFileContents("contents a\n", "foobar/test_basic/a");
+ assertFileNotExists("foobar/test_basic/b");
+ assertFileNotExists("foobar/test_basic/c");
+ assertTextFileContents("contents CAPS\n", "foobar/test_basic/CAPS");
+}