003 File Manager
Current Path:
/usr/src/contrib/libarchive/libarchive/test
usr
/
src
/
contrib
/
libarchive
/
libarchive
/
test
/
📁
..
📄
README
(2.49 KB)
📄
main.c
(77.6 KB)
📄
read_open_memory.c
(6.3 KB)
📄
test.h
(1.9 KB)
📄
test_acl_nfs4.c
(8.49 KB)
📄
test_acl_pax.c
(15.87 KB)
📄
test_acl_pax_nfs4.tar.uu
(7.62 KB)
📄
test_acl_pax_posix1e.tar.uu
(6.93 KB)
📄
test_acl_platform_nfs4.c
(34.03 KB)
📄
test_acl_platform_posix1e.c
(16.11 KB)
📄
test_acl_posix1e.c
(7.13 KB)
📄
test_acl_text.c
(14.72 KB)
📄
test_archive_api_feature.c
(2.22 KB)
📄
test_archive_clear_error.c
(1.69 KB)
📄
test_archive_cmdline.c
(5.35 KB)
📄
test_archive_digest.c
(5.36 KB)
📄
test_archive_getdate.c
(3.82 KB)
📄
test_archive_match_owner.c
(9.59 KB)
📄
test_archive_match_path.c
(14.43 KB)
📄
test_archive_match_time.c
(42.76 KB)
📄
test_archive_pathmatch.c
(14.17 KB)
📄
test_archive_read_add_passphrase.c
(9.14 KB)
📄
test_archive_read_close_twice.c
(1.71 KB)
📄
test_archive_read_close_twice_open_fd.c
(1.97 KB)
📄
test_archive_read_close_twice_open_filename.c
(2.06 KB)
📄
test_archive_read_multiple_data_objects.c
(11.93 KB)
📄
test_archive_read_next_header_empty.c
(3.91 KB)
📄
test_archive_read_next_header_raw.c
(2.31 KB)
📄
test_archive_read_open2.c
(3.44 KB)
📄
test_archive_read_set_filter_option.c
(1.96 KB)
📄
test_archive_read_set_format_option.c
(2.46 KB)
📄
test_archive_read_set_option.c
(2.5 KB)
📄
test_archive_read_set_options.c
(4 KB)
📄
test_archive_read_support.c
(5.12 KB)
📄
test_archive_set_error.c
(1.84 KB)
📄
test_archive_string.c
(10.79 KB)
📄
test_archive_string_conversion.c
(25.02 KB)
📄
test_archive_string_conversion.txt.Z.uu
(157.5 KB)
📄
test_archive_write_add_filter_by_name.c
(6.45 KB)
📄
test_archive_write_set_filter_option.c
(1.96 KB)
📄
test_archive_write_set_format_by_name.c
(8.61 KB)
📄
test_archive_write_set_format_filter_by_ext.c
(7.16 KB)
📄
test_archive_write_set_format_option.c
(2.47 KB)
📄
test_archive_write_set_option.c
(2.5 KB)
📄
test_archive_write_set_options.c
(4 KB)
📄
test_archive_write_set_passphrase.c
(3.1 KB)
📄
test_bad_fd.c
(1.71 KB)
📄
test_compat_bzip2.c
(3.21 KB)
📄
test_compat_bzip2_1.tbz.uu
(1.18 KB)
📄
test_compat_bzip2_2.tbz.uu
(395 B)
📄
test_compat_cpio.c
(4.15 KB)
📄
test_compat_cpio_1.cpio.uu
(879 B)
📄
test_compat_gtar.c
(5.45 KB)
📄
test_compat_gtar_1.tar.uu
(13.83 KB)
📄
test_compat_gtar_2.tar.uu
(2.8 KB)
📄
test_compat_gzip.c
(3.5 KB)
📄
test_compat_gzip_1.tgz.uu
(1.16 KB)
📄
test_compat_gzip_2.tgz.uu
(406 B)
📄
test_compat_lz4.c
(4.75 KB)
📄
test_compat_lz4_1.tar.lz4.uu
(572 B)
📄
test_compat_lz4_2.tar.lz4.uu
(642 B)
📄
test_compat_lz4_3.tar.lz4.uu
(406 B)
📄
test_compat_lz4_B4.tar.lz4.uu
(407.84 KB)
📄
test_compat_lz4_B4BD.tar.lz4.uu
(407.84 KB)
📄
test_compat_lz4_B4BDBX.tar.lz4.uu
(408.19 KB)
📄
test_compat_lz4_B5.tar.lz4.uu
(139.72 KB)
📄
test_compat_lz4_B5BD.tar.lz4.uu
(139.72 KB)
📄
test_compat_lz4_B6.tar.lz4.uu
(72.29 KB)
📄
test_compat_lz4_B6BD.tar.lz4.uu
(72.29 KB)
📄
test_compat_lz4_B7.tar.lz4.uu
(55.43 KB)
📄
test_compat_lz4_B7BD.tar.lz4.uu
(55.43 KB)
📄
test_compat_lzip.c
(4.62 KB)
📄
test_compat_lzip_1.tlz.uu
(437 B)
📄
test_compat_lzip_2.tlz.uu
(359 B)
📄
test_compat_lzma.c
(5.09 KB)
📄
test_compat_lzma_1.tlz.uu
(352 B)
📄
test_compat_lzma_2.tlz.uu
(274 B)
📄
test_compat_lzma_3.tlz.uu
(274 B)
📄
test_compat_lzop.c
(5.09 KB)
📄
test_compat_lzop_1.tar.lzo.uu
(1.67 KB)
📄
test_compat_lzop_2.tar.lzo.uu
(2.17 KB)
📄
test_compat_lzop_3.tar.lzo.uu
(1.74 KB)
📄
test_compat_mac-1.tar.Z.uu
(2.11 KB)
📄
test_compat_mac-2.tar.Z.uu
(988 B)
📄
test_compat_mac.c
(8.21 KB)
📄
test_compat_perl_archive_tar.c
(2.63 KB)
📄
test_compat_perl_archive_tar.tar.uu
(2.81 KB)
📄
test_compat_plexus_archiver_tar.c
(2.75 KB)
📄
test_compat_plexus_archiver_tar.tar.uu
(2.81 KB)
📄
test_compat_solaris_pax_sparse.c
(6.76 KB)
📄
test_compat_solaris_pax_sparse_1.pax.Z.uu
(3.07 KB)
📄
test_compat_solaris_pax_sparse_2.pax.Z.uu
(3.07 KB)
📄
test_compat_solaris_tar_acl.c
(10.4 KB)
📄
test_compat_solaris_tar_acl.tar.uu
(9.7 KB)
📄
test_compat_star_acl.c
(12.21 KB)
📄
test_compat_star_acl_nfs4.tar.uu
(13.83 KB)
📄
test_compat_star_acl_posix1e.tar.uu
(13.83 KB)
📄
test_compat_tar_hardlink.c
(4.22 KB)
📄
test_compat_tar_hardlink_1.tar.uu
(2.12 KB)
📄
test_compat_uudecode.c
(2.72 KB)
📄
test_compat_uudecode_large.c
(2.47 KB)
📄
test_compat_uudecode_large.tar.Z.uu
(65.67 KB)
📄
test_compat_xz.c
(3.04 KB)
📄
test_compat_xz_1.txz.uu
(559 B)
📄
test_compat_zip.c
(17.39 KB)
📄
test_compat_zip_1.zip.uu
(726 B)
📄
test_compat_zip_2.zip.uu
(324 B)
📄
test_compat_zip_3.zip.uu
(952 B)
📄
test_compat_zip_4.zip.uu
(1.31 KB)
📄
test_compat_zip_5.zip.uu
(14.47 KB)
📄
test_compat_zip_6.zip.uu
(472 B)
📄
test_compat_zip_7.xps.uu
(21.46 KB)
📄
test_compat_zip_8.zip.uu
(226 B)
📄
test_compat_zstd.c
(3.17 KB)
📄
test_compat_zstd_1.tar.zst.uu
(553 B)
📄
test_compat_zstd_2.tar.zst.uu
(297 B)
📄
test_empty_write.c
(4.38 KB)
📄
test_entry.c
(37.69 KB)
📄
test_entry_strmode.c
(2.89 KB)
📄
test_extattr_freebsd.c
(5.21 KB)
📄
test_filter_count.c
(2.64 KB)
📄
test_fuzz.c
(15.12 KB)
📄
test_fuzz.cab.uu
(2.81 KB)
📄
test_fuzz.lzh.uu
(9 KB)
📄
test_fuzz_1.iso.Z.uu
(29.68 KB)
📄
test_gnutar_filename_encoding.c
(12.14 KB)
📄
test_link_resolver.c
(7.24 KB)
📄
test_open_failure.c
(7.24 KB)
📄
test_open_fd.c
(4.76 KB)
📄
test_open_file.c
(3.95 KB)
📄
test_open_filename.c
(7.26 KB)
📄
test_pax_filename_encoding.c
(20.46 KB)
📄
test_pax_filename_encoding.tar.uu
(6.95 KB)
📄
test_pax_xattr_header.c
(4.99 KB)
📄
test_pax_xattr_header_all.tar.uu
(4.18 KB)
📄
test_pax_xattr_header_libarchive.tar.uu
(4.19 KB)
📄
test_pax_xattr_header_schily.tar.uu
(4.18 KB)
📄
test_rar_multivolume_multiple_files.part1.rar.uu
(9.71 KB)
📄
test_rar_multivolume_multiple_files.part2.rar.uu
(9.71 KB)
📄
test_rar_multivolume_multiple_files.part3.rar.uu
(9.71 KB)
📄
test_rar_multivolume_multiple_files.part4.rar.uu
(9.71 KB)
📄
test_rar_multivolume_multiple_files.part5.rar.uu
(9.71 KB)
📄
test_rar_multivolume_multiple_files.part6.rar.uu
(6.92 KB)
📄
test_rar_multivolume_single_file.part1.rar.uu
(9.44 KB)
📄
test_rar_multivolume_single_file.part2.rar.uu
(9.44 KB)
📄
test_rar_multivolume_single_file.part3.rar.uu
(8.67 KB)
📄
test_rar_multivolume_uncompressed_files.part01.rar.uu
(17.93 KB)
📄
test_rar_multivolume_uncompressed_files.part02.rar.uu
(17.93 KB)
📄
test_rar_multivolume_uncompressed_files.part03.rar.uu
(17.93 KB)
📄
test_rar_multivolume_uncompressed_files.part04.rar.uu
(17.93 KB)
📄
test_rar_multivolume_uncompressed_files.part05.rar.uu
(17.93 KB)
📄
test_rar_multivolume_uncompressed_files.part06.rar.uu
(17.93 KB)
📄
test_rar_multivolume_uncompressed_files.part07.rar.uu
(17.93 KB)
📄
test_rar_multivolume_uncompressed_files.part08.rar.uu
(17.93 KB)
📄
test_rar_multivolume_uncompressed_files.part09.rar.uu
(17.93 KB)
📄
test_rar_multivolume_uncompressed_files.part10.rar.uu
(4.33 KB)
📄
test_read_data_large.c
(4.34 KB)
📄
test_read_disk.c
(5.66 KB)
📄
test_read_disk_directory_traversals.c
(64.08 KB)
📄
test_read_disk_entry_from_file.c
(2.75 KB)
📄
test_read_extract.c
(6.43 KB)
📄
test_read_file_nonexistent.c
(1.6 KB)
📄
test_read_filter_compress.c
(3.08 KB)
📄
test_read_filter_grzip.c
(2.69 KB)
📄
test_read_filter_grzip.tar.grz.uu
(317 B)
📄
test_read_filter_lrzip.c
(2.69 KB)
📄
test_read_filter_lrzip.tar.lrz.uu
(472 B)
📄
test_read_filter_lzop.c
(3 KB)
📄
test_read_filter_lzop.tar.lzo.uu
(510 B)
📄
test_read_filter_lzop_multiple_parts.c
(3.13 KB)
📄
test_read_filter_lzop_multiple_parts.tar.lzo.uu
(5.24 KB)
📄
test_read_filter_program.c
(3.35 KB)
📄
test_read_filter_program_signature.c
(3.93 KB)
📄
test_read_filter_uudecode.c
(6.24 KB)
📄
test_read_format_7zip.c
(29.56 KB)
📄
test_read_format_7zip_bcj2_bzip2.7z.uu
(19.17 KB)
📄
test_read_format_7zip_bcj2_copy_1.7z.uu
(37.04 KB)
📄
test_read_format_7zip_bcj2_copy_2.7z.uu
(37.06 KB)
📄
test_read_format_7zip_bcj2_copy_lzma.7z.uu
(34.24 KB)
📄
test_read_format_7zip_bcj2_deflate.7z.uu
(18.77 KB)
📄
test_read_format_7zip_bcj2_lzma1_1.7z.uu
(17.19 KB)
📄
test_read_format_7zip_bcj2_lzma1_2.7z.uu
(14.38 KB)
📄
test_read_format_7zip_bcj2_lzma2_1.7z.uu
(17.19 KB)
📄
test_read_format_7zip_bcj2_lzma2_2.7z.uu
(14.39 KB)
📄
test_read_format_7zip_bcj_bzip2.7z.uu
(16.84 KB)
📄
test_read_format_7zip_bcj_copy.7z.uu
(36.97 KB)
📄
test_read_format_7zip_bcj_deflate.7z.uu
(16.47 KB)
📄
test_read_format_7zip_bcj_lzma1.7z.uu
(14.68 KB)
📄
test_read_format_7zip_bcj_lzma2.7z.uu
(14.68 KB)
📄
test_read_format_7zip_bzip2.7z.uu
(2.09 KB)
📄
test_read_format_7zip_copy.7z.uu
(266 B)
📄
test_read_format_7zip_copy_2.7z.uu
(488 B)
📄
test_read_format_7zip_deflate.7z.uu
(2 KB)
📄
test_read_format_7zip_delta4_lzma1.7z.uu
(24.46 KB)
📄
test_read_format_7zip_delta4_lzma2.7z.uu
(24.47 KB)
📄
test_read_format_7zip_delta_lzma1.7z.uu
(16.81 KB)
📄
test_read_format_7zip_delta_lzma2.7z.uu
(16.82 KB)
📄
test_read_format_7zip_empty_archive.7z.uu
(101 B)
📄
test_read_format_7zip_empty_file.7z.uu
(160 B)
📄
test_read_format_7zip_encryption.7z.uu
(256 B)
📄
test_read_format_7zip_encryption_data.c
(3.01 KB)
📄
test_read_format_7zip_encryption_header.7z.uu
(333 B)
📄
test_read_format_7zip_encryption_header.c
(3.06 KB)
📄
test_read_format_7zip_encryption_partially.7z.uu
(368 B)
📄
test_read_format_7zip_encryption_partially.c
(3.67 KB)
📄
test_read_format_7zip_lzma1.7z.uu
(2.05 KB)
📄
test_read_format_7zip_lzma1_2.7z.uu
(355 B)
📄
test_read_format_7zip_lzma1_lzma2.7z.uu
(447 B)
📄
test_read_format_7zip_lzma2.7z.uu
(2.06 KB)
📄
test_read_format_7zip_malformed.7z.uu
(127 B)
📄
test_read_format_7zip_malformed.c
(2.58 KB)
📄
test_read_format_7zip_malformed2.7z.uu
(128 B)
📄
test_read_format_7zip_packinfo_digests.7z.uu
(266 B)
📄
test_read_format_7zip_packinfo_digests.c
(3.5 KB)
📄
test_read_format_7zip_ppmd.7z.uu
(14.05 KB)
📄
test_read_format_7zip_symbolic_name.7z.uu
(317 B)
📄
test_read_format_ar.ar.uu
(480 B)
📄
test_read_format_ar.c
(3.92 KB)
📄
test_read_format_cab.c
(12.99 KB)
📄
test_read_format_cab_1.cab.uu
(411 B)
📄
test_read_format_cab_2.cab.uu
(383 B)
📄
test_read_format_cab_3.cab.uu
(445 B)
📄
test_read_format_cab_filename.c
(6.16 KB)
📄
test_read_format_cab_filename_cp932.cab.uu
(255 B)
📄
test_read_format_cpio_afio.c
(4.97 KB)
📄
test_read_format_cpio_bin.c
(3.25 KB)
📄
test_read_format_cpio_bin_Z.c
(2.74 KB)
📄
test_read_format_cpio_bin_be.c
(2.61 KB)
📄
test_read_format_cpio_bin_be.cpio.uu
(276 B)
📄
test_read_format_cpio_bin_bz2.c
(2.6 KB)
📄
test_read_format_cpio_bin_gz.c
(2.69 KB)
📄
test_read_format_cpio_bin_le.c
(2.61 KB)
📄
test_read_format_cpio_bin_le.cpio.uu
(266 B)
📄
test_read_format_cpio_bin_lzip.c
(2.76 KB)
📄
test_read_format_cpio_bin_lzma.c
(2.71 KB)
📄
test_read_format_cpio_bin_xz.c
(3.12 KB)
📄
test_read_format_cpio_filename.c
(28.75 KB)
📄
test_read_format_cpio_filename_cp866.cpio.uu
(757 B)
📄
test_read_format_cpio_filename_eucjp.cpio.uu
(757 B)
📄
test_read_format_cpio_filename_koi8r.cpio.uu
(757 B)
📄
test_read_format_cpio_filename_utf8_jp.cpio.uu
(759 B)
📄
test_read_format_cpio_filename_utf8_ru.cpio.uu
(759 B)
📄
test_read_format_cpio_odc.c
(3.44 KB)
📄
test_read_format_cpio_svr4_bzip2_rpm.c
(4.62 KB)
📄
test_read_format_cpio_svr4_bzip2_rpm.rpm.uu
(2.71 KB)
📄
test_read_format_cpio_svr4_gzip.c
(2.74 KB)
📄
test_read_format_cpio_svr4_gzip_rpm.c
(4.62 KB)
📄
test_read_format_cpio_svr4_gzip_rpm.rpm.uu
(2.63 KB)
📄
test_read_format_cpio_svr4c_Z.c
(2.84 KB)
📄
test_read_format_empty.c
(2.08 KB)
📄
test_read_format_gtar_filename.c
(16.85 KB)
📄
test_read_format_gtar_filename_cp866.tar.Z.uu
(448 B)
📄
test_read_format_gtar_filename_eucjp.tar.Z.uu
(448 B)
📄
test_read_format_gtar_filename_koi8r.tar.Z.uu
(440 B)
📄
test_read_format_gtar_gz.c
(2.75 KB)
📄
test_read_format_gtar_lzma.c
(3.17 KB)
📄
test_read_format_gtar_sparse.c
(8.39 KB)
📄
test_read_format_gtar_sparse_1_13.tar.uu
(82.73 KB)
📄
test_read_format_gtar_sparse_1_17.tar.uu
(82.73 KB)
📄
test_read_format_gtar_sparse_1_17_posix00.tar.uu
(96.52 KB)
📄
test_read_format_gtar_sparse_1_17_posix01.tar.uu
(82.74 KB)
📄
test_read_format_gtar_sparse_1_17_posix10.tar.uu
(82.74 KB)
📄
test_read_format_gtar_sparse_1_17_posix10_modified.tar.uu
(82.75 KB)
📄
test_read_format_gtar_sparse_skip_entry.c
(5.13 KB)
📄
test_read_format_gtar_sparse_skip_entry.tar.Z.uu
(750 B)
📄
test_read_format_iso.iso.Z.uu
(1.32 KB)
📄
test_read_format_iso_2.iso.Z.uu
(1.98 KB)
📄
test_read_format_iso_Z.c
(3.85 KB)
📄
test_read_format_iso_joliet.iso.Z.uu
(3.71 KB)
📄
test_read_format_iso_joliet_by_nero.iso.Z.uu
(3.74 KB)
📄
test_read_format_iso_joliet_long.iso.Z.uu
(4.03 KB)
📄
test_read_format_iso_joliet_rockridge.iso.Z.uu
(3.84 KB)
📄
test_read_format_iso_multi_extent.c
(3.85 KB)
📄
test_read_format_iso_multi_extent.iso.Z.uu
(3.78 KB)
📄
test_read_format_iso_rockridge.iso.Z.uu
(12.23 KB)
📄
test_read_format_iso_rockridge_ce.iso.Z.uu
(3.53 KB)
📄
test_read_format_iso_rockridge_new.iso.Z.uu
(12.35 KB)
📄
test_read_format_iso_rockridge_rr_moved.iso.Z.uu
(18.13 KB)
📄
test_read_format_iso_xorriso.c
(8.47 KB)
📄
test_read_format_iso_xorriso.iso.Z.uu
(3.53 KB)
📄
test_read_format_iso_zisofs.iso.Z.uu
(3.56 KB)
📄
test_read_format_isojoliet_bz2.c
(5.82 KB)
📄
test_read_format_isojoliet_long.c
(5.69 KB)
📄
test_read_format_isojoliet_rr.c
(7.16 KB)
📄
test_read_format_isojoliet_versioned.c
(3.66 KB)
📄
test_read_format_isorr_bz2.c
(8.89 KB)
📄
test_read_format_isorr_ce.c
(8.11 KB)
📄
test_read_format_isorr_new_bz2.c
(8.92 KB)
📄
test_read_format_isorr_rr_moved.c
(11.53 KB)
📄
test_read_format_isozisofs_bz2.c
(7.96 KB)
📄
test_read_format_lha.c
(10.27 KB)
📄
test_read_format_lha_bugfix_0.c
(2.99 KB)
📄
test_read_format_lha_bugfix_0.lzh.uu
(998 B)
📄
test_read_format_lha_filename.c
(7.76 KB)
📄
test_read_format_lha_filename_cp932.lzh.uu
(275 B)
📄
test_read_format_lha_filename_utf16.c
(5.55 KB)
📄
test_read_format_lha_filename_utf16.lzh.uu
(1.03 KB)
📄
test_read_format_lha_header0.lzh.uu
(529 B)
📄
test_read_format_lha_header1.lzh.uu
(629 B)
📄
test_read_format_lha_header2.lzh.uu
(629 B)
📄
test_read_format_lha_header3.lzh.uu
(807 B)
📄
test_read_format_lha_lh0.lzh.uu
(645 B)
📄
test_read_format_lha_lh6.lzh.uu
(629 B)
📄
test_read_format_lha_lh7.lzh.uu
(629 B)
📄
test_read_format_lha_withjunk.lzh.uu
(650 B)
📄
test_read_format_mtree.c
(34.82 KB)
📄
test_read_format_mtree.mtree.uu
(2.29 KB)
📄
test_read_format_mtree_crash747.c
(1.95 KB)
📄
test_read_format_mtree_crash747.mtree.bz2.uu
(212 B)
📄
test_read_format_mtree_nomagic.mtree.uu
(505 B)
📄
test_read_format_mtree_nomagic2.mtree.uu
(432 B)
📄
test_read_format_mtree_nomagic3.mtree.uu
(432 B)
📄
test_read_format_mtree_noprint.mtree.uu
(115 B)
📄
test_read_format_pax_bz2.c
(3.19 KB)
📄
test_read_format_rar.c
(156.59 KB)
📄
test_read_format_rar.rar.uu
(482 B)
📄
test_read_format_rar5.c
(44.49 KB)
📄
test_read_format_rar5_arm.rar.uu
(55.32 KB)
📄
test_read_format_rar5_arm_filter_on_window_boundary.rar.uu
(408 B)
📄
test_read_format_rar5_blake2.rar.uu
(935 B)
📄
test_read_format_rar5_block_size_is_too_small.rar.uu
(372 B)
📄
test_read_format_rar5_compressed.rar.uu
(640 B)
📄
test_read_format_rar5_different_solid_window_size.rar.uu
(4.28 KB)
📄
test_read_format_rar5_different_window_size.rar.uu
(40.73 KB)
📄
test_read_format_rar5_different_winsize_on_merge.rar.uu
(822 B)
📄
test_read_format_rar5_distance_overflow.rar.uu
(392 B)
📄
test_read_format_rar5_extra_field_version.rar.uu
(452 B)
📄
test_read_format_rar5_fileattr.rar.uu
(635 B)
📄
test_read_format_rar5_hardlink.rar.uu
(221 B)
📄
test_read_format_rar5_invalid_dict_reference.rar.uu
(417 B)
📄
test_read_format_rar5_leftshift1.rar.uu
(393 B)
📄
test_read_format_rar5_leftshift2.rar.uu
(203 B)
📄
test_read_format_rar5_multiarchive.part01.rar.uu
(20.71 KB)
📄
test_read_format_rar5_multiarchive.part02.rar.uu
(20.71 KB)
📄
test_read_format_rar5_multiarchive.part03.rar.uu
(20.71 KB)
📄
test_read_format_rar5_multiarchive.part04.rar.uu
(20.71 KB)
📄
test_read_format_rar5_multiarchive.part05.rar.uu
(20.71 KB)
📄
test_read_format_rar5_multiarchive.part06.rar.uu
(20.71 KB)
📄
test_read_format_rar5_multiarchive.part07.rar.uu
(20.71 KB)
📄
test_read_format_rar5_multiarchive.part08.rar.uu
(12.44 KB)
📄
test_read_format_rar5_multiarchive_solid.part01.rar.uu
(17.98 KB)
📄
test_read_format_rar5_multiarchive_solid.part02.rar.uu
(17.98 KB)
📄
test_read_format_rar5_multiarchive_solid.part03.rar.uu
(17.98 KB)
📄
test_read_format_rar5_multiarchive_solid.part04.rar.uu
(4.48 KB)
📄
test_read_format_rar5_multiple_files.rar.uu
(2.27 KB)
📄
test_read_format_rar5_multiple_files_solid.rar.uu
(982 B)
📄
test_read_format_rar5_nonempty_dir_stream.rar.uu
(402 B)
📄
test_read_format_rar5_owner.rar.uu
(322 B)
📄
test_read_format_rar5_readtables_overflow.rar.uu
(786 B)
📄
test_read_format_rar5_solid.rar.uu
(1.46 KB)
📄
test_read_format_rar5_stored.rar.uu
(186 B)
📄
test_read_format_rar5_stored_manyfiles.rar.uu
(3.54 KB)
📄
test_read_format_rar5_symlink.rar.uu
(316 B)
📄
test_read_format_rar5_truncated_huff.rar.uu
(281 B)
📄
test_read_format_rar5_win32.rar.uu
(4.04 KB)
📄
test_read_format_rar_binary_data.rar.uu
(1.42 MB)
📄
test_read_format_rar_compress_best.rar.uu
(16.41 KB)
📄
test_read_format_rar_compress_normal.rar.uu
(19.69 KB)
📄
test_read_format_rar_encryption_data.c
(3.46 KB)
📄
test_read_format_rar_encryption_data.rar.uu
(315 B)
📄
test_read_format_rar_encryption_header.c
(3.06 KB)
📄
test_read_format_rar_encryption_header.rar.uu
(365 B)
📄
test_read_format_rar_encryption_partially.c
(3.53 KB)
📄
test_read_format_rar_encryption_partially.rar.uu
(302 B)
📄
test_read_format_rar_invalid1.c
(2.03 KB)
📄
test_read_format_rar_invalid1.rar.uu
(138 B)
📄
test_read_format_rar_multi_lzss_blocks.rar.uu
(26.71 KB)
📄
test_read_format_rar_multivolume.part0001.rar.uu
(80.75 KB)
📄
test_read_format_rar_multivolume.part0002.rar.uu
(80.75 KB)
📄
test_read_format_rar_multivolume.part0003.rar.uu
(80.75 KB)
📄
test_read_format_rar_multivolume.part0004.rar.uu
(12.4 KB)
📄
test_read_format_rar_noeof.rar.uu
(142 B)
📄
test_read_format_rar_ppmd_lzss_conversion.rar.uu
(237.77 KB)
📄
test_read_format_rar_ppmd_use_after_free.rar.uu
(479 B)
📄
test_read_format_rar_ppmd_use_after_free2.rar.uu
(460 B)
📄
test_read_format_rar_sfx.exe.uu
(133.92 KB)
📄
test_read_format_rar_subblock.rar.uu
(250 B)
📄
test_read_format_rar_unicode.rar.uu
(967 B)
📄
test_read_format_rar_windows.rar.uu
(1.12 KB)
📄
test_read_format_raw.bufr.uu
(5.56 KB)
📄
test_read_format_raw.c
(6.44 KB)
📄
test_read_format_raw.data.Z.uu
(68 B)
📄
test_read_format_raw.data.gz.uu
(107 B)
📄
test_read_format_raw.data.uu
(62 B)
📄
test_read_format_tar.c
(24.86 KB)
📄
test_read_format_tar_concatenated.c
(3.46 KB)
📄
test_read_format_tar_concatenated.tar.uu
(4.19 KB)
📄
test_read_format_tar_empty_filename.c
(2.81 KB)
📄
test_read_format_tar_empty_filename.tar.uu
(2.12 KB)
📄
test_read_format_tar_empty_pax.c
(2.61 KB)
📄
test_read_format_tar_empty_pax.tar.Z.uu
(467 B)
📄
test_read_format_tar_empty_with_gnulabel.c
(2.26 KB)
📄
test_read_format_tar_empty_with_gnulabel.tar.uu
(13.84 KB)
📄
test_read_format_tar_filename.c
(14.37 KB)
📄
test_read_format_tar_filename_koi8r.tar.Z.uu
(692 B)
📄
test_read_format_tbz.c
(2.69 KB)
📄
test_read_format_tgz.c
(2.72 KB)
📄
test_read_format_tlz.c
(2.82 KB)
📄
test_read_format_txz.c
(3.01 KB)
📄
test_read_format_tz.c
(2.84 KB)
📄
test_read_format_ustar_filename.c
(19.57 KB)
📄
test_read_format_ustar_filename_cp866.tar.Z.uu
(370 B)
📄
test_read_format_ustar_filename_eucjp.tar.Z.uu
(376 B)
📄
test_read_format_ustar_filename_koi8r.tar.Z.uu
(362 B)
📄
test_read_format_warc.c
(3.64 KB)
📄
test_read_format_warc.warc.uu
(1.24 KB)
📄
test_read_format_xar.c
(44.73 KB)
📄
test_read_format_zip.c
(36.61 KB)
📄
test_read_format_zip.zip.uu
(647 B)
📄
test_read_format_zip_7075_utf8_paths.c
(3.75 KB)
📄
test_read_format_zip_7075_utf8_paths.zip.uu
(1.08 KB)
📄
test_read_format_zip_7z_lzma.zip.uu
(2.55 KB)
📄
test_read_format_zip_bz2_hang.zip.uu
(138 B)
📄
test_read_format_zip_bzip2.zipx.uu
(1003 B)
📄
test_read_format_zip_bzip2_multi.zipx.uu
(5.68 KB)
📄
test_read_format_zip_comment_stored.c
(2.93 KB)
📄
test_read_format_zip_comment_stored_1.zip.uu
(560 B)
📄
test_read_format_zip_comment_stored_2.zip.uu
(33.02 KB)
📄
test_read_format_zip_encryption_data.c
(3.48 KB)
📄
test_read_format_zip_encryption_data.zip.uu
(1.39 KB)
📄
test_read_format_zip_encryption_header.c
(3.06 KB)
📄
test_read_format_zip_encryption_header.zip.uu
(1.81 KB)
📄
test_read_format_zip_encryption_partially.c
(3.53 KB)
📄
test_read_format_zip_encryption_partially.zip.uu
(964 B)
📄
test_read_format_zip_extra_padding.c
(3.74 KB)
📄
test_read_format_zip_extra_padding.zip.uu
(271 B)
📄
test_read_format_zip_filename.c
(42.68 KB)
📄
test_read_format_zip_filename_cp866.zip.uu
(481 B)
📄
test_read_format_zip_filename_cp932.zip.uu
(391 B)
📄
test_read_format_zip_filename_koi8r.zip.uu
(481 B)
📄
test_read_format_zip_filename_utf8_jp.zip.uu
(766 B)
📄
test_read_format_zip_filename_utf8_ru.zip.uu
(517 B)
📄
test_read_format_zip_filename_utf8_ru2.zip.uu
(502 B)
📄
test_read_format_zip_high_compression.c
(4.93 KB)
📄
test_read_format_zip_high_compression.zip.uu
(932 B)
📄
test_read_format_zip_jar.c
(2.36 KB)
📄
test_read_format_zip_jar.jar.uu
(215 B)
📄
test_read_format_zip_length_at_end.zip.uu
(321 B)
📄
test_read_format_zip_lzma.zipx.uu
(1010 B)
📄
test_read_format_zip_lzma_alone_leak.zipx.uu
(178 B)
📄
test_read_format_zip_lzma_multi.zipx.uu
(5.58 KB)
📄
test_read_format_zip_lzma_stream_end.zipx.uu
(1002 B)
📄
test_read_format_zip_mac_metadata.c
(4.85 KB)
📄
test_read_format_zip_mac_metadata.zip.uu
(902 B)
📄
test_read_format_zip_malformed.c
(2.49 KB)
📄
test_read_format_zip_malformed1.zip.uu
(140 B)
📄
test_read_format_zip_msdos.c
(4.87 KB)
📄
test_read_format_zip_msdos.zip.uu
(1.2 KB)
📄
test_read_format_zip_nested.c
(3.61 KB)
📄
test_read_format_zip_nested.zip.uu
(842 B)
📄
test_read_format_zip_nofiletype.c
(2.68 KB)
📄
test_read_format_zip_nofiletype.zip.uu
(330 B)
📄
test_read_format_zip_padded.c
(3.22 KB)
📄
test_read_format_zip_padded1.zip.uu
(599 B)
📄
test_read_format_zip_padded2.zip.uu
(741 B)
📄
test_read_format_zip_padded3.zip.uu
(861 B)
📄
test_read_format_zip_ppmd8.zipx.uu
(879 B)
📄
test_read_format_zip_ppmd8_crash_1.zipx.uu
(118 B)
📄
test_read_format_zip_ppmd8_crash_2.zipx.uu
(118 B)
📄
test_read_format_zip_ppmd8_multi.zipx.uu
(4.9 KB)
📄
test_read_format_zip_sfx.c
(2.66 KB)
📄
test_read_format_zip_sfx.uu
(1.91 KB)
📄
test_read_format_zip_symlink.zip.uu
(475 B)
📄
test_read_format_zip_traditional_encryption_data.c
(6.72 KB)
📄
test_read_format_zip_traditional_encryption_data.zip.uu
(615 B)
📄
test_read_format_zip_ux.zip.uu
(280 B)
📄
test_read_format_zip_winzip_aes.c
(5.69 KB)
📄
test_read_format_zip_winzip_aes128.zip.uu
(3.87 KB)
📄
test_read_format_zip_winzip_aes256.zip.uu
(3.88 KB)
📄
test_read_format_zip_winzip_aes256_large.zip.uu
(132.06 KB)
📄
test_read_format_zip_winzip_aes256_stored.zip.uu
(9.47 KB)
📄
test_read_format_zip_winzip_aes_large.c
(8.91 KB)
📄
test_read_format_zip_with_invalid_traditional_eocd.c
(2.45 KB)
📄
test_read_format_zip_with_invalid_traditional_eocd.zip.uu
(684 B)
📄
test_read_format_zip_xz_multi.zipx.uu
(7.42 KB)
📄
test_read_format_zip_zip64.c
(4.37 KB)
📄
test_read_format_zip_zip64a.zip.uu
(260 B)
📄
test_read_format_zip_zip64b.zip.uu
(248 B)
📄
test_read_large.c
(3.67 KB)
📄
test_read_large_splitted_rar_aa.uu
(53.84 KB)
📄
test_read_large_splitted_rar_ab.uu
(53.84 KB)
📄
test_read_large_splitted_rar_ac.uu
(53.84 KB)
📄
test_read_large_splitted_rar_ad.uu
(53.84 KB)
📄
test_read_large_splitted_rar_ae.uu
(22.49 KB)
📄
test_read_pax_truncated.c
(10.35 KB)
📄
test_read_pax_xattr_rht_security_selinux.c
(2.56 KB)
📄
test_read_pax_xattr_rht_security_selinux.tar.uu
(13.84 KB)
📄
test_read_pax_xattr_schily.c
(2.88 KB)
📄
test_read_pax_xattr_schily.tar.uu
(13.83 KB)
📄
test_read_position.c
(4.14 KB)
📄
test_read_set_format.c
(8.39 KB)
📄
test_read_splitted_rar_aa.uu
(160 B)
📄
test_read_splitted_rar_ab.uu
(160 B)
📄
test_read_splitted_rar_ac.uu
(160 B)
📄
test_read_splitted_rar_ad.uu
(68 B)
📄
test_read_too_many_filters.c
(2.08 KB)
📄
test_read_too_many_filters.gz.uu
(573 B)
📄
test_read_truncated.c
(5.13 KB)
📄
test_read_truncated_filter.c
(5.18 KB)
📄
test_sparse_basic.c
(17.67 KB)
📄
test_splitted_rar_seek_support_aa.uu
(9.44 KB)
📄
test_splitted_rar_seek_support_ab.uu
(9.44 KB)
📄
test_splitted_rar_seek_support_ac.uu
(8.37 KB)
📄
test_tar_filenames.c
(5.05 KB)
📄
test_tar_large.c
(8.08 KB)
📄
test_ustar_filename_encoding.c
(12.12 KB)
📄
test_ustar_filenames.c
(5.71 KB)
📄
test_warn_missing_hardlink_target.c
(1.85 KB)
📄
test_write_disk.c
(12.62 KB)
📄
test_write_disk_appledouble.c
(7.95 KB)
📄
test_write_disk_appledouble.cpio.gz.uu
(558 B)
📄
test_write_disk_failures.c
(2.48 KB)
📄
test_write_disk_hardlink.c
(7.45 KB)
📄
test_write_disk_hfs_compression.c
(9.93 KB)
📄
test_write_disk_hfs_compression.tgz.uu
(108.83 KB)
📄
test_write_disk_lookup.c
(4.94 KB)
📄
test_write_disk_mac_metadata.c
(7.03 KB)
📄
test_write_disk_mac_metadata.tar.gz.uu
(678 B)
📄
test_write_disk_no_hfs_compression.c
(8.01 KB)
📄
test_write_disk_no_hfs_compression.tgz.uu
(106.69 KB)
📄
test_write_disk_perms.c
(17.58 KB)
📄
test_write_disk_secure.c
(11.75 KB)
📄
test_write_disk_secure744.c
(3.09 KB)
📄
test_write_disk_secure745.c
(2.9 KB)
📄
test_write_disk_secure746.c
(4.61 KB)
📄
test_write_disk_sparse.c
(8.72 KB)
📄
test_write_disk_symlink.c
(9.42 KB)
📄
test_write_disk_times.c
(5.86 KB)
📄
test_write_filter_b64encode.c
(6.75 KB)
📄
test_write_filter_bzip2.c
(9.76 KB)
📄
test_write_filter_compress.c
(3.36 KB)
📄
test_write_filter_gzip.c
(10.73 KB)
📄
test_write_filter_gzip_timestamp.c
(4.34 KB)
📄
test_write_filter_lrzip.c
(4.75 KB)
📄
test_write_filter_lz4.c
(13.55 KB)
📄
test_write_filter_lzip.c
(9.29 KB)
📄
test_write_filter_lzma.c
(9.52 KB)
📄
test_write_filter_lzop.c
(9.75 KB)
📄
test_write_filter_program.c
(4.72 KB)
📄
test_write_filter_uuencode.c
(6.74 KB)
📄
test_write_filter_xz.c
(9.72 KB)
📄
test_write_filter_zstd.c
(9.67 KB)
📄
test_write_format_7zip.c
(19.63 KB)
📄
test_write_format_7zip_empty.c
(9.93 KB)
📄
test_write_format_7zip_large.c
(5.74 KB)
📄
test_write_format_ar.c
(7.65 KB)
📄
test_write_format_cpio.c
(8.99 KB)
📄
test_write_format_cpio_empty.c
(2.68 KB)
📄
test_write_format_cpio_newc.c
(7.94 KB)
📄
test_write_format_cpio_odc.c
(9.1 KB)
📄
test_write_format_gnutar.c
(10.03 KB)
📄
test_write_format_gnutar_filenames.c
(5.32 KB)
📄
test_write_format_iso9660.c
(40.42 KB)
📄
test_write_format_iso9660_boot.c
(9.73 KB)
📄
test_write_format_iso9660_empty.c
(7.22 KB)
📄
test_write_format_iso9660_filename.c
(12.4 KB)
📄
test_write_format_iso9660_zisofs.c
(28.81 KB)
📄
test_write_format_mtree.c
(9.68 KB)
📄
test_write_format_mtree_absolute_path.c
(3.81 KB)
📄
test_write_format_mtree_classic.c
(6.5 KB)
📄
test_write_format_mtree_classic_indent.c
(6.71 KB)
📄
test_write_format_mtree_fflags.c
(4.13 KB)
📄
test_write_format_mtree_no_separator.c
(3.95 KB)
📄
test_write_format_mtree_quoted_filename.c
(3.3 KB)
📄
test_write_format_pax.c
(9.52 KB)
📄
test_write_format_raw.c
(4.7 KB)
📄
test_write_format_raw_b64.c
(2.9 KB)
📄
test_write_format_shar_empty.c
(2.21 KB)
📄
test_write_format_tar.c
(4.44 KB)
📄
test_write_format_tar_empty.c
(2.82 KB)
📄
test_write_format_tar_sparse.c
(10.68 KB)
📄
test_write_format_tar_ustar.c
(13.19 KB)
📄
test_write_format_tar_v7tar.c
(9.15 KB)
📄
test_write_format_warc.c
(5.56 KB)
📄
test_write_format_warc_empty.c
(4.64 KB)
📄
test_write_format_xar.c
(10.92 KB)
📄
test_write_format_xar_empty.c
(4.58 KB)
📄
test_write_format_zip.c
(32.25 KB)
📄
test_write_format_zip_compression_store.c
(16.05 KB)
📄
test_write_format_zip_empty.c
(3.37 KB)
📄
test_write_format_zip_empty_zip64.c
(4.62 KB)
📄
test_write_format_zip_file.c
(9.87 KB)
📄
test_write_format_zip_file_zip64.c
(11.52 KB)
📄
test_write_format_zip_large.c
(13.63 KB)
📄
test_write_format_zip_zip64.c
(2.62 KB)
📄
test_write_open_memory.c
(3.21 KB)
📄
test_write_read_format_zip.c
(26.34 KB)
📄
test_xattr_platform.c
(3.57 KB)
📄
test_zip_filename_encoding.c
(17.47 KB)
Editing: test_read_format_xar.c
/*- * Copyright (c) 2003-2007 Tim Kientzle * Copyright (c) 2009 Michihiro NAKAJIMA * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * 1. Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "test.h" __FBSDID("$FreeBSD$"); #define UID 1001 #define UNAME "cue" #define GID 1001 #define GNAME "cue" /* Verify that a file records with hardlink. #How to make echo "hellohellohello" > f1 chown $UNAME:$GNAME f1 chmod 0644 f1 ln f1 hardlink chown $UNAME:$GNAME hardlink chmod 0644 hardlink env TZ=utc touch -afm -t 197001020000.01 f1 hardlink xar -cf archive1.xar f1 hardlink od -t x1 archive1.xar | sed -E -e 's/^0[0-9]+//;s/^ //;s/( )([0-9a-f]{2})/0x\2,/g;$ D' > archive1.xar.txt */ static unsigned char archive1[] = { 0x78,0x61,0x72,0x21,0x00,0x1c,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xc6, 0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x70,0x00,0x00,0x00,0x01,0x78,0xda,0xc4,0x54, 0xc9,0x6e,0xdb,0x30,0x14,0xbc,0xe7,0x2b,0x08,0xdd,0x55,0xae,0xb6,0x45,0x83,0x56, 0xd0,0x4b,0xd1,0x7b,0xd3,0x4b,0x6f,0x34,0x17,0x89,0x88,0x36,0x48,0x54,0xe0,0xe4, 0xeb,0x4b,0x52,0x52,0x0c,0xa7,0x71,0x6f,0x45,0x01,0x01,0x1a,0x0e,0x87,0xa3,0xa7, 0xf7,0x06,0x14,0x8f,0x97,0xb6,0x01,0x2f,0x66,0x9c,0x5c,0xdf,0x9d,0x32,0xfc,0x05, 0x65,0xc0,0x74,0xaa,0xd7,0xae,0xab,0x4e,0xd9,0xcf,0xa7,0x6f,0x79,0x91,0x3d,0x96, 0x0f,0xe2,0x22,0xc7,0xf2,0x01,0x08,0xdf,0xab,0xf0,0x02,0x42,0x8d,0x46,0xfa,0x70, 0x22,0xf7,0xae,0x35,0x25,0x41,0x88,0xe7,0x98,0xe4,0x88,0x3c,0x61,0x7a,0xa4,0xe8, 0x48,0xb9,0x80,0xb7,0x92,0x74,0xa8,0x36,0xea,0x79,0x9a,0x5b,0x30,0xf9,0xd7,0xc6, 0x9c,0xb2,0xa9,0x96,0x38,0x8b,0x3b,0x40,0xf4,0xd6,0x4e,0xc6,0x97,0x48,0xc0,0x15, 0x25,0x76,0x72,0x6f,0xd1,0x5c,0xc0,0x04,0xa2,0x05,0xdc,0x3c,0xd2,0xca,0xba,0xc6, 0x00,0xa7,0x4f,0x19,0x59,0x6d,0xd4,0x9d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d,0x8a,0xa2,0x40,0x86,0xed,0xc8,0x7e,0xc7,0xac,0x41, 0x8a,0x87,0x1c,0xff,0xe9,0xb4,0x34,0x0f,0xbe,0x77,0xef,0x9f,0xc4,0xee,0x73,0xd9, 0x7f,0x8c,0x5d,0x3f,0xba,0xca,0x75,0xb2,0xf9,0x4b,0xfa,0x2c,0xfe,0x24,0x77,0x41, 0x15,0x2f,0x0d,0x01,0xd3,0x15,0xf2,0x1b,0x00,0x00,0xff,0xff,0x03,0x00,0x88,0x32, 0x49,0x7b,0x67,0xbf,0xc6,0x01,0x29,0xf2,0x1c,0x40,0x05,0x3c,0x49,0x25,0x9f,0xab, 0x7c,0x8e,0xc5,0xa5,0x79,0xe0,0x78,0xda,0xca,0x48,0xcd,0xc9,0xc9,0xcf,0x80,0x13, 0x5c,0x00,0x00,0x00,0x00,0xff,0xff,0x03,0x00,0x37,0xf7,0x06,0x47 }; static void verify0(struct archive *a, struct archive_entry *ae) { const void *p; size_t size; int64_t offset; assert(archive_entry_filetype(ae) == AE_IFREG); assertEqualInt(archive_entry_mode(ae) & 0777, 0644); assertEqualInt(archive_entry_uid(ae), UID); assertEqualInt(archive_entry_gid(ae), GID); assertEqualString(archive_entry_uname(ae), UNAME); assertEqualString(archive_entry_gname(ae), GNAME); assertEqualString(archive_entry_pathname(ae), "f1"); assert(archive_entry_hardlink(ae) == NULL); assert(archive_entry_symlink(ae) == NULL); assertEqualInt(archive_entry_mtime(ae), 86401); assertEqualInt(archive_entry_size(ae), 16); assertEqualInt(archive_read_data_block(a, &p, &size, &offset), 0); assertEqualInt((int)size, 16); assertEqualInt((int)offset, 0); assertEqualMem(p, "hellohellohello\n", 16); } static void verify1(struct archive *a, struct archive_entry *ae) { (void)a; /* UNUSED */ /* A hardlink is not a symlink. */ assert(archive_entry_filetype(ae) != AE_IFLNK); /* Nor is it a directory. */ assert(archive_entry_filetype(ae) != AE_IFDIR); assertEqualInt(archive_entry_mode(ae) & 0777, 0644); assertEqualInt(archive_entry_uid(ae), UID); assertEqualInt(archive_entry_gid(ae), GID); assertEqualString(archive_entry_uname(ae), UNAME); assertEqualString(archive_entry_gname(ae), GNAME); assertEqualString(archive_entry_pathname(ae), "hardlink"); assertEqualString(archive_entry_hardlink(ae), "f1"); assert(archive_entry_symlink(ae) == NULL); assertEqualInt(archive_entry_mtime(ae), 86401); assertEqualInt(archive_entry_nlink(ae), 2); } /* Verify that symlinks are read correctly. #How to make echo "hellohellohello" > f1 chown $UNAME:$GNAME f1 chmod 0644 f1 ln -s f1 symlink chown $UNAME:$GNAME symlink chmod 0644 symlink env TZ=utc touch -afm -t 197001020000.01 f1 symlink xar -cf archive2.xar f1 symlink od -t x1 archive2.xar | sed -E -e 's/^0[0-9]+//;s/^ //;s/( )([0-9a-f]{2})/0x\2,/g;$ D' > archive2.xar.txt */ static unsigned char archive2[] = { 0x78,0x61,0x72,0x21,0x00,0x1c,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xe8, 0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x84,0x00,0x00,0x00,0x01,0x78,0xda,0xb4,0x54, 0xcb,0x6e,0xa3,0x30,0x14,0xdd,0xf7,0x2b,0x90,0xf7,0x8c,0x1f,0x40,0x82,0x23,0xe3, 0xaa,0x9b,0x6a,0xf6,0xd3,0xd9,0xcc,0xce,0xf1,0x83,0x58,0xe5,0x25,0x70,0xaa,0xa4, 0x5f,0x3f,0xb6,0x09,0x4d,0xd3,0x30,0xdd,0x8d,0x84,0xc4,0xf5,0xf1,0xb9,0xc7,0x97, 0x7b,0x0f,0x66,0x8f,0xa7,0xb6,0x49,0xde,0xf4,0x38,0xd9,0xbe,0xab,0x00,0xfe,0x81, 0x40,0xa2,0x3b,0xd9,0x2b,0xdb,0xd5,0x15,0xf8,0xfd,0xf2,0x9c,0x96,0xe0,0x91,0x3f, 0xb0,0x93,0x18,0xf9,0x43,0xc2,0x5c,0x2f,0xfd,0x2b,0x61,0x72,0xd4,0xc2,0xf9,0x8c,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xf0,0x42, 0x15,0xa3,0x3c,0xd8,0x37,0xad,0xd2,0xaf,0x3e,0xf9,0xf5,0xf3,0xc9,0x57,0x67,0xca, 0x2c,0x53,0xc4,0x28,0x89,0x69,0x96,0xd3,0x4c,0xec,0xf3,0x92,0x0a,0x25,0x48,0x66, 0x4a,0xb3,0xa5,0xd8,0x6c,0x88,0x91,0xd9,0x86,0x96,0x7e,0x36,0x5f,0x85,0x96,0x5a, 0x4e,0x6e,0x14,0xd2,0xfd,0xf3,0x84,0x42,0x6d,0xf3,0xbd,0xdc,0xcb,0x2d,0x55,0x99, 0xa1,0x7b,0x93,0x0b,0xe3,0xb5,0xf3,0xb2,0x2c,0x91,0xce,0x0b,0xb2,0x29,0x72,0xa3, 0x91,0xa4,0x94,0xc1,0x7b,0xa5,0xb9,0x79,0xf0,0xa3,0x7b,0x2b,0x56,0x9c,0xff,0x0c, 0xb2,0x66,0x45,0x4c,0xb7,0x28,0x45,0x38,0xd0,0x90,0x37,0x98,0x7f,0xf0,0x9a,0x15, 0xd7,0x69,0xff,0xdd,0x8a,0x9b,0x3c,0xff,0x6c,0xc5,0xe0,0xae,0x24,0x18,0xaa,0x02, 0xfd,0x68,0x6b,0xdb,0x89,0x06,0xf0,0x83,0x18,0xd5,0xaa,0xf9,0x82,0x4f,0xef,0x7c, 0xe7,0x59,0xe1,0x22,0x61,0x30,0x5e,0x2b,0x7f,0x01,0x00,0x00,0xff,0xff,0x03,0x00, 0x2b,0xab,0x4f,0xf9,0xbb,0xf7,0x90,0xb5,0x34,0x8f,0x7c,0xae,0x72,0xa0,0x80,0xd2, 0x69,0xc7,0xa2,0xe7,0x44,0x53,0xeb,0x75,0x78,0xda,0xca,0x48,0xcd,0xc9,0xc9,0xcf, 0x80,0x13,0x5c,0x00,0x00,0x00,0x00,0xff,0xff,0x03,0x00,0x37,0xf7,0x06,0x47 }; static void verify2(struct archive *a, struct archive_entry *ae) { (void)a; /* UNUSED */ assertEqualInt(archive_entry_filetype(ae), AE_IFLNK); assertEqualInt(archive_entry_mode(ae) & 0777, 0755); assertEqualInt(archive_entry_uid(ae), UID); assertEqualInt(archive_entry_gid(ae), GID); assertEqualString(archive_entry_uname(ae), UNAME); assertEqualString(archive_entry_gname(ae), GNAME); assertEqualString(archive_entry_pathname(ae), "symlink"); assertEqualString(archive_entry_symlink(ae), "f1"); assert(archive_entry_hardlink(ae) == NULL); } /* Character device node. #How to make mknod devchar c 0 30 chown $UNAME:$GNAME devchar chmod 0644 devchar env TZ=utc touch -afm -t 197001020000.01 devchar xar -cf archive3.xar devchar od -t x1 archive3.xar | sed -E -e 's/^0[0-9]+//;s/^ //;s/( )([0-9a-f]{2})/0x\2,/g;$ D' > archive3.xar.txt */ static unsigned char archive3[] = { 0x78,0x61,0x72,0x21,0x00,0x1c,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x38, 0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x3b,0x00,0x00,0x00,0x01,0x78,0xda,0x7c,0x92, 0x4d,0x6e,0xc3,0x20,0x10,0x85,0xf7,0x39,0x05,0xf2,0xde,0x05,0x9c,0x9f,0x36,0xd6, 0x84,0xec,0x7a,0x82,0x74,0xd3,0x1d,0xc2,0x93,0x98,0xd4,0x36,0x11,0xe0,0x28,0xe9, 0xe9,0x0b,0xe3,0xa4,0x69,0xa5,0xaa,0x92,0x25,0x1e,0x8f,0xef,0x8d,0x86,0xc1,0xb0, 0xbd,0xf4,0x1d,0x3b,0xa3,0x0f,0xd6,0x0d,0x9b,0x42,0x3e,0x89,0x82,0xe1,0x60,0x5c, 0x63,0x87,0xc3,0xa6,0x78,0xdb,0xbd,0x96,0x2f,0xc5,0x56,0xcd,0xe0,0xa2,0xbd,0x9a, 0x31,0x88,0xce,0xa4,0x85,0x81,0xf1,0xa8,0x63,0x4a,0x94,0xd1,0xf6,0xa8,0x2a,0x21, 0xd6,0xa5,0xac,0x4a,0x51,0xed,0xa4,0xa8,0xab,0x79,0x2d,0x57,0xc0,0x7f,0x23,0x14, 0x6a,0xd1,0x7c,0x84,0xb1,0x67,0x21,0x5e,0x3b,0xdc,0x14,0xa1,0xd5,0xb2,0xc8,0x27, 0x0c,0xdc,0x7e,0x1f,0x30,0x2a,0x01,0xfc,0xa6,0xc8,0x0d,0xf6,0x33,0x17,0x07,0x4e, 0x22,0x97,0xe0,0xf7,0x1a,0xb4,0xdb,0xdb,0x0e,0x99,0x6d,0x52,0xdb,0xb7,0x32,0xe6, 0xaf,0x76,0xaa,0x7a,0xb9,0x7c,0x4f,0xc9,0x7b,0x1f,0x0c,0x7a,0x92,0x72,0xfd,0x2c, 0x4a,0x21,0x33,0x26,0x44,0x9d,0x3f,0x99,0xb0,0xfe,0x81,0xe9,0x7f,0x30,0xfd,0xc0, 0x0e,0xde,0x8d,0x27,0x65,0x46,0x04,0x3e,0xc9,0xc9,0xb5,0x8d,0x92,0x42,0xc8,0x64, 0x26,0x45,0xd6,0x18,0xd0,0x4f,0x1c,0xa9,0xc9,0xfb,0xc6,0xc6,0x3b,0xd6,0xbb,0x06, 0x95,0x58,0x2d,0x16,0xa9,0x99,0x2c,0xc9,0x6c,0xf0,0x6c,0xcd,0xa4,0x13,0x61,0x07, 0xe7,0xd5,0x3c,0x0d,0x66,0x52,0x37,0x57,0x1f,0x93,0xce,0x26,0x09,0x8a,0xf1,0x1f, 0x39,0x88,0xd7,0x13,0x2a,0xd3,0x6a,0xaf,0x4d,0x44,0xcf,0xc2,0x09,0x8d,0xd5,0x1d, 0x70,0xf2,0x89,0x18,0x74,0xba,0x54,0x8a,0x64,0x08,0x38,0xed,0x68,0xea,0x79,0xd0, 0xf9,0xf9,0x39,0xbd,0x3f,0x70,0xfa,0x1b,0xbe,0x00,0x00,0x00,0xff,0xff,0x03,0x00, 0xab,0x43,0xa3,0xac,0x76,0x40,0x1e,0x8b,0x95,0x0d,0x28,0x79,0x79,0x43,0x49,0x4e, 0x16,0xa1,0x56,0x99,0x1f,0x83,0x77,0x41 }; static void verify3(struct archive *a, struct archive_entry *ae) { (void)a; /* UNUSED */ assertEqualInt(archive_entry_filetype(ae), AE_IFCHR); assertEqualInt(archive_entry_mode(ae) & 0777, 0644); assertEqualInt(archive_entry_uid(ae), UID); assertEqualInt(archive_entry_gid(ae), GID); assertEqualString(archive_entry_uname(ae), UNAME); assertEqualString(archive_entry_gname(ae), GNAME); assertEqualString(archive_entry_pathname(ae), "devchar"); assert(archive_entry_symlink(ae) == NULL); assert(archive_entry_hardlink(ae) == NULL); assertEqualInt(archive_entry_mtime(ae), 86401); } /* Block device node. #How to make mknod devblock b 0 30 chown $UNAME:$GNAME devblock chmod 0644 devblock env TZ=utc touch -afm -t 197001020000.01 devblock xar -cf archive4.xar devblock od -t x1 archive4.xar | sed -E -e 's/^0[0-9]+//;s/^ //;s/( )([0-9a-f]{2})/0x\2,/g;$ D' > archive4.xar.txt */ static unsigned char archive4[] = { 0x78,0x61,0x72,0x21,0x00,0x1c,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x34, 0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x38,0x00,0x00,0x00,0x01,0x78,0xda,0x7c,0x92, 0xc1,0x6e,0xc2,0x30,0x0c,0x86,0xef,0x3c,0x45,0xd4,0x7b,0x17,0x07,0xd0,0x0a,0x95, 0x09,0xb7,0x3d,0x01,0xbb,0xec,0x96,0xa5,0x06,0x32,0xda,0xa6,0x6a,0x5a,0x04,0x7b, 0xfa,0x25,0x2e,0x8c,0x4d,0x9a,0x26,0x55,0xea,0x97,0x3f,0x9f,0x2d,0x37,0x29,0x6e, 0x2f,0x4d,0x2d,0xce,0xd4,0x07,0xe7,0xdb,0x4d,0xa6,0x9e,0x20,0x13,0xd4,0x5a,0x5f, 0xb9,0xf6,0xb0,0xc9,0x5e,0x77,0x2f,0xf9,0x2a,0xdb,0xea,0x19,0x5e,0x4c,0xaf,0x67, 0x02,0x07,0x6f,0xe3,0x4b,0xa0,0xed,0xc9,0x0c,0xb1,0x22,0x1f,0x5c,0x43,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,0xa4,0xb9,0xef,0xfc, 0x7a,0x5d,0x21,0xde }; static void verify4(struct archive *a, struct archive_entry *ae) { (void)a; /* UNUSED */ assertEqualInt(archive_entry_filetype(ae), AE_IFBLK); assertEqualInt(archive_entry_mode(ae) & 0777, 0644); assertEqualInt(archive_entry_uid(ae), UID); assertEqualInt(archive_entry_gid(ae), GID); assertEqualString(archive_entry_uname(ae), UNAME); assertEqualString(archive_entry_gname(ae), GNAME); assertEqualString(archive_entry_pathname(ae), "devblock"); assert(archive_entry_symlink(ae) == NULL); assert(archive_entry_hardlink(ae) == NULL); assertEqualInt(archive_entry_mtime(ae), 86401); } /* Directory. #How to make mkdir dir1 chown $UNAME:$GNAME dir1 chmod 0755 dir1 env TZ=utc touch -afm -t 197001020000.01 dir1 xar -cf archive5.xar dir1 od -t x1 archive5.xar | sed -E -e 's/^0[0-9]+//;s/^ //;s/( )([0-9a-f]{2})/0x\2,/g;$ D' > archive5.xar.txt */ static unsigned char archive5[] = { 0x78,0x61,0x72,0x21,0x00,0x1c,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x16, 0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xec,0x00,0x00,0x00,0x01,0x78,0xda,0x74,0x91, 0xc1,0x6e,0xc2,0x30,0x0c,0x86,0xef,0x3c,0x45,0xd4,0x7b,0x17,0xa7,0x83,0x31,0xaa, 0x34,0xdc,0xf6,0x04,0xec,0xb2,0x5b,0x95,0x1a,0x88,0x68,0x1a,0x94,0xa4,0x13,0xdd, 0xd3,0x2f,0x71,0xe9,0xd0,0xa4,0x4d,0xaa,0xd4,0x3f,0xbf,0x3f,0xff,0xb2,0x6c,0xb9, 0xbf,0xd9,0x9e,0x7d,0xa2,0x0f,0xc6,0x0d,0x4d,0x21,0x9e,0xa0,0x60,0x38,0x68,0xd7, 0x99,0xe1,0xd4,0x14,0xef,0x87,0xb7,0xf2,0xb5,0xd8,0xab,0x95,0xbc,0xb5,0x5e,0xad, 0x98,0x8c,0x4e,0xa7,0x1f,0x93,0xda,0x63,0x1b,0x53,0x47,0x19,0x8d,0x45,0x55,0x01, 0xec,0x4a,0x51,0x95,0x50,0x1d,0x04,0xd4,0x6b,0x51,0xaf,0x37,0x92,0xff,0x46,0xa8, 0xe9,0x8c,0xfa,0x12,0x46,0xcb,0x42,0x9c,0x7a,0x6c,0x8a,0x70,0x6e,0x45,0x91,0x2b, 0x4c,0xba,0xe3,0x31,0x60,0x54,0x20,0xf9,0x5d,0x91,0x1b,0xcc,0x57,0x0e,0x97,0x9c, 0x44,0x8e,0xe0,0x4b,0x06,0xbd,0x8e,0xa6,0x47,0x66,0xba,0x34,0xf6,0x3d,0x46,0xff, 0x3d,0xce,0x33,0x7c,0xa4,0xce,0x65,0x0e,0x26,0x2d,0x49,0xb1,0xdb,0x42,0x09,0x22, 0x63,0x00,0x75,0xfe,0x44,0xc2,0xec,0x03,0x6b,0xff,0x49,0x7b,0x49,0x58,0xfb,0xc0, 0x4e,0xde,0x8d,0x57,0xa5,0x47,0x94,0x7c,0x96,0xb3,0x6b,0x3a,0x25,0x00,0x44,0x32, 0x93,0x22,0x6b,0x0c,0xe8,0x67,0x8e,0xd4,0xec,0xfd,0x60,0xe3,0x82,0x59,0xd7,0xa1, 0x82,0xed,0x26,0xed,0x90,0x24,0x99,0x71,0xba,0xa2,0xea,0x8c,0x47,0x1d,0x9d,0x9f, 0x24,0xa7,0x37,0x55,0x86,0xd6,0x52,0x25,0x45,0x90,0xa4,0x35,0xe5,0xcd,0xe4,0x7b, 0x71,0x3a,0x98,0xe4,0x74,0xbe,0x6f,0x00,0x00,0x00,0xff,0xff,0x03,0x00,0x23,0x7a, 0x8c,0x2f,0x78,0xe9,0x69,0x28,0x93,0x14,0x72,0x68,0x8d,0xeb,0x42,0x7b,0xf6,0x0f, 0x70,0x64,0xa3,0xff,0xb9,0x35 }; static void verify5(struct archive *a, struct archive_entry *ae) { (void)a; /* UNUSED */ assertEqualInt(archive_entry_filetype(ae), AE_IFDIR); assertEqualInt(archive_entry_mtime(ae), 86401); assertEqualInt(archive_entry_mode(ae) & 0777, 0755); assertEqualInt(archive_entry_uid(ae), UID); assertEqualInt(archive_entry_gid(ae), GID); assertEqualString(archive_entry_uname(ae), UNAME); assertEqualString(archive_entry_gname(ae), GNAME); } /* fifo #How to make mkfifo -m 0755 fifo chown $UNAME:$GNAME fifo env TZ=utc touch -afm -t 197001020000.01 fifo xar -cf archive6.xar fifo od -t x1 archive6.xar | sed -E -e 's/^0[0-9]+//;s/^ //;s/( )([0-9a-f]{2})/0x\2,/g;$ D' > archive6.xar.txt */ static unsigned char archive6[] = { 0x78,0x61,0x72,0x21,0x00,0x1c,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x0e, 0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xe7,0x00,0x00,0x00,0x01,0x78,0xda,0x7c,0x91, 0xc1,0x6e,0xc3,0x20,0x0c,0x86,0xef,0x7d,0x0a,0xc4,0x3d,0xc3,0x64,0xab,0xda,0x46, 0x94,0xde,0xf6,0x04,0xdd,0x65,0x37,0x44,0x9c,0x16,0x2d,0x84,0x2a,0x90,0xa9,0xdd, 0xd3,0x0f,0x9c,0x66,0xd5,0xa4,0x69,0x12,0x52,0xbe,0xfc,0x7c,0xb6,0x2c,0xac,0x0e, 0x57,0xdf,0xb3,0x4f,0x1c,0xa3,0x0b,0xc3,0x9e,0xcb,0x27,0xe0,0x0c,0x07,0x1b,0x5a, 0x37,0x9c,0xf6,0xfc,0xed,0xf8,0x5a,0x6d,0xf9,0x41,0xaf,0xd4,0xd5,0x8c,0x7a,0xc5, 0x54,0x0a,0x36,0x7f,0x98,0xb2,0x23,0x9a,0x94,0x2b,0xaa,0xe4,0x3c,0xea,0x1a,0x60, 0x57,0xc9,0xba,0x82,0xfa,0x28,0x65,0xf3,0x02,0x4d,0xbd,0x55,0xe2,0xb7,0x42,0x45, 0x67,0xb4,0x1f,0x71,0xf2,0x2c,0xa6,0x5b,0x8f,0x7b,0x1e,0xcf,0x46,0xf2,0x72,0xc3, 0x54,0xe8,0xba,0x88,0x49,0x83,0x12,0x77,0xa2,0x34,0xba,0xaf,0xd2,0x5c,0x09,0x82, 0xd2,0x42,0x2c,0x3d,0xe8,0xaf,0x73,0x3d,0x32,0xd7,0xe6,0xb1,0xef,0x6d,0xec,0xdf, 0xe3,0xc8,0xe7,0xf7,0x5c,0xb9,0xcc,0xc1,0x94,0x27,0x94,0xbb,0x0d,0x54,0x20,0x8b, 0x06,0xd0,0x94,0x23,0xb3,0xe6,0x1f,0x9a,0xf9,0x47,0x33,0x0f,0xed,0x34,0x86,0xe9, 0xa2,0xed,0x84,0x4a,0xcc,0x38,0xa7,0xae,0xd5,0x12,0x40,0xe6,0x30,0x13,0x45,0x53, 0xc4,0x71,0xf6,0x88,0xe6,0xec,0x47,0x9b,0x16,0xcd,0x87,0x16,0x35,0x6c,0xd6,0xeb, 0x3c,0x4c,0x41,0x0a,0xd3,0xed,0x82,0xba,0x73,0x5d,0x50,0x82,0x90,0xc2,0xc1,0xf8, 0x25,0x24,0xa4,0x17,0x2a,0x8f,0x52,0x56,0x25,0x68,0x57,0x4a,0xd0,0xe6,0xbe,0x01, 0x00,0x00,0xff,0xff,0x03,0x00,0x44,0x19,0x8a,0x2a,0x82,0xbc,0x8c,0xae,0x97,0xa7, 0x7d,0x65,0xa5,0x82,0xdb,0xaa,0xc2,0xcb,0xbe,0xf0,0x1f,0xd1,0xf9,0x56 }; static void verify6(struct archive *a, struct archive_entry *ae) { (void)a; /* UNUSED */ assertEqualInt(archive_entry_filetype(ae), AE_IFIFO); assertEqualInt(archive_entry_mode(ae) & 0777, 0755); assertEqualInt(archive_entry_uid(ae), UID); assertEqualInt(archive_entry_gid(ae), GID); assertEqualString(archive_entry_uname(ae), UNAME); assertEqualString(archive_entry_gname(ae), GNAME); assertEqualString(archive_entry_pathname(ae), "fifo"); assert(archive_entry_symlink(ae) == NULL); assert(archive_entry_hardlink(ae) == NULL); assertEqualInt(archive_entry_mtime(ae), 86401); } /* Verify that a file records with directory name. #How to make mkdir dir1 echo "hellohellohello" > dir1/f1 chown $UNAME:$GNAME dir1/f1 chmod 0644 dir1/f1 env TZ=utc touch -afm -t 197001020000.01 dir1/f1 xar -cf archive7.xar dir1/f1 od -t x1 archive7.xar | sed -E -e 's/^0[0-9]+//;s/^ //;s/( )([0-9a-f]{2})/0x\2,/g;$ D' > archive7.xar.txt */ static unsigned char archive7[] = { 0x78,0x61,0x72,0x21,0x00,0x1c,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xbb, 0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x8a,0x00,0x00,0x00,0x01,0x78,0xda,0x7c,0x53, 0xc9,0x6e,0xdb,0x30,0x14,0xbc,0xe7,0x2b,0x04,0xdd,0x55,0x2e,0xa2,0x16,0x1a,0xb4, 0x82,0x5e,0x8a,0xdc,0x93,0x5e,0x7a,0xa3,0xb9,0xd8,0x44,0xb5,0x41,0xa2,0x02,0x3b, 0x5f,0x5f,0x92,0xa2,0x1c,0xbb,0x59,0x00,0x01,0x1a,0x3e,0xce,0x1b,0x0d,0x9f,0x86, 0xec,0xf1,0xdc,0xb5,0xc9,0xab,0x9a,0x66,0x33,0xf4,0xfb,0x14,0xfd,0x80,0x69,0xa2, 0x7a,0x31,0x48,0xd3,0x1f,0xf7,0xe9,0xef,0x97,0x5f,0x59,0x9d,0x3e,0x36,0x0f,0xec, 0xcc,0xa7,0xe6,0x21,0x61,0x76,0x10,0xee,0x95,0x30,0x31,0x29,0x6e,0x5d,0x47,0x66, 0x4d,0xa7,0x1a,0x0c,0x21,0xcd,0x10,0xce,0x20,0x7e,0x41,0x68,0x57,0xe0,0x5d,0x51, 0x31,0x70,0x4f,0x09,0x4d,0x27,0x25,0xfe,0xce,0x4b,0x97,0xcc,0xf6,0xd2,0xaa,0x7d, 0x3a,0x9f,0x38,0x4a,0xfd,0x4e,0xc2,0x06,0xad,0x67,0x65,0x1b,0xc8,0x40,0x44,0xa1, 0x3a,0x9b,0x37,0x2f,0xce,0x40,0x00,0x5e,0x02,0x6c,0x1a,0x61,0xa5,0x4d,0xab,0x12, 0x23,0x9d,0xed,0x28,0x63,0x2f,0xa3,0x6a,0xa4,0x99,0x94,0xb0,0xc3,0x74,0x61,0x20, 0xac,0xc3,0x4e,0xcf,0xbb,0xb0,0x83,0x18,0x08,0x30,0x14,0xaf,0xfd,0x78,0xed,0x4f, 0x98,0xe4,0x96,0xaf,0x30,0x61,0xad,0xea,0x8f,0xf6,0xd4,0xe0,0x9c,0x81,0x08,0xe3, 0x46,0xb4,0x88,0xef,0xdd,0x6e,0x7e,0x51,0xf9,0xee,0xd7,0x17,0xb7,0x69,0x6e,0xa7, 0xe6,0xe3,0xd8,0x1a,0x11,0x46,0x03,0xce,0xd9,0xf1,0xcd,0x8c,0x29,0xd8,0xb8,0x7c, 0x12,0x27,0xf3,0xaa,0x64,0xf6,0xff,0xa8,0x9e,0x9f,0x7e,0xba,0x33,0xea,0x3a,0xcf, 0x25,0xd6,0x52,0x20,0x9a,0x13,0x9a,0xf3,0x03,0xa9,0x29,0x97,0x1c,0xe7,0xba,0xd6, 0x15,0x45,0xba,0xc4,0x5a,0xe4,0x25,0xad,0x19,0xf8,0x20,0x74,0x75,0x73,0xb6,0x13, 0x17,0xf6,0xcb,0x4f,0x14,0xb2,0x22,0x07,0x71,0x10,0x15,0x95,0xb9,0xa6,0x07,0x4d, 0xb8,0x76,0xe2,0xa4,0xae,0x6b,0xa8,0x48,0x81,0xcb,0x82,0x68,0x05,0x05,0xa5,0x0c, 0x7c,0x54,0x8a,0x33,0x04,0xef,0x43,0x64,0xe2,0xf3,0x7c,0x90,0xfa,0x8f,0xfb,0x95, 0x5b,0x30,0x1c,0xaf,0x0b,0x18,0xd1,0x0a,0x66,0x10,0x79,0x1e,0x84,0x3b,0xff,0x20, 0xc7,0xeb,0x6e,0x78,0xfc,0x1b,0x1e,0xbf,0xe1,0x1d,0xa7,0x61,0x19,0x1b,0xb1,0x28, 0x06,0x56,0x18,0xcb,0x46,0x36,0x08,0x42,0x17,0x02,0x8f,0xd6,0xda,0x32,0xab,0x69, 0x65,0x06,0x14,0x8b,0x57,0xe2,0x72,0x25,0x76,0x83,0x54,0x0d,0x2c,0x09,0x71,0x96, 0x3c,0x5c,0xab,0x21,0x62,0x3e,0x48,0x37,0x69,0x8b,0x71,0xd3,0x77,0x61,0x03,0x9e, 0xb4,0x86,0x38,0x22,0xd7,0xe1,0xaf,0x13,0x03,0xe1,0x72,0xfd,0x03,0x00,0x00,0xff, 0xff,0x03,0x00,0x8d,0xb1,0x06,0x76,0xa6,0x7a,0xc3,0xbb,0x13,0x3d,0x45,0xe2,0x2b, 0x3b,0xd0,0x88,0xc7,0x58,0x7b,0xbd,0x30,0x9d,0x01,0x44,0x78,0xda,0xca,0x48,0xcd, 0xc9,0xc9,0xcf,0x80,0x13,0x5c,0x00,0x00,0x00,0x00,0xff,0xff,0x03,0x00,0x37,0xf7, 0x06,0x47 }; static void verify7(struct archive *a, struct archive_entry *ae) { (void)a; /* UNUSED */ assert(archive_entry_filetype(ae) == AE_IFREG); assertEqualInt(archive_entry_mode(ae) & 0777, 0644); assertEqualInt(archive_entry_uid(ae), UID); assertEqualInt(archive_entry_gid(ae), GID); assertEqualString(archive_entry_uname(ae), UNAME); assertEqualString(archive_entry_gname(ae), GNAME); assertEqualString(archive_entry_pathname(ae), "dir1/f1"); assert(archive_entry_hardlink(ae) == NULL); assert(archive_entry_symlink(ae) == NULL); assertEqualInt(archive_entry_mtime(ae), 86401); } /* Verify that a file records with bzip2 compression #How to make echo "hellohellohello" > f1 chown $UNAME:$GNAME f1 chmod 0644 f1 env TZ=utc touch -afm -t 197001020000.01 f1 xar --compression bzip2 -cf archive8.xar f1 od -t x1 archive8.xar | sed -E -e 's/^0[0-9]+//;s/^ //;s/( )([0-9a-f]{2})/0x\2,/g;$ D' > archive8.xar.txt */ static unsigned char archive8[] = { 0x78,0x61,0x72,0x21,0x00,0x1c,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xb1, 0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x42,0x00,0x00,0x00,0x01,0x78,0xda,0x7c,0x53, 0xcb,0x6e,0xdc,0x20,0x14,0xdd,0xe7,0x2b,0x90,0xf7,0x0e,0x60,0xe3,0x07,0x23,0x86, 0xa8,0x9b,0xa8,0xfb,0x4e,0x37,0xdd,0x61,0x1e,0x63,0x14,0xbf,0x64,0xe3,0x68,0x92, 0xaf,0x2f,0x60,0x3b,0xa3,0x34,0x6d,0x25,0x4b,0x3e,0x1c,0x0e,0xe7,0x5e,0xee,0xe5, 0xb2,0xa7,0x5b,0xdf,0x81,0x57,0x3d,0x2f,0x76,0x1c,0xce,0x09,0x7e,0x44,0x09,0xd0, 0x83,0x1c,0x95,0x1d,0xae,0xe7,0xe4,0xe7,0xe5,0x39,0xad,0x93,0x27,0xfe,0xc0,0x6e, 0x62,0xe6,0x0f,0x80,0xb9,0x51,0xfa,0x1f,0x60,0x72,0xd6,0xc2,0xf9,0x13,0xa9,0xb3, 0xbd,0xe6,0x19,0x42,0x34,0xc5,0x59,0x8a,0xc8,0x05,0xd1,0x13,0xc6,0x27,0x9c,0x33, 0xf8,0x59,0x12,0x0f,0xb5,0x5a,0xbe,0x2c,0x6b,0x0f,0x16,0xf7,0xd6,0xe9,0x73,0xb2, 0xb4,0x02,0x27,0x61,0x07,0xb0,0xd1,0x98,0x45,0x3b,0x8e,0x18,0xdc,0x51,0x64,0x17, 0xfb,0x1e,0xcc,0x19,0x8c,0x20,0x58,0xc0,0xc3,0x23,0xae,0x8c,0xed,0x34,0xb0,0xca, 0xa7,0xbd,0xdb,0x28,0xe1,0x44,0x44,0x80,0x75,0x7a,0xb8,0xba,0x96,0x13,0xc2,0xe0, 0x0e,0x37,0x7e,0xf7,0xcf,0x3e,0x87,0xda,0x63,0xe1,0xf2,0x1e,0xcb,0x73,0x47,0x21, 0x8e,0x84,0xc5,0x34,0x75,0x56,0xc6,0x5b,0xc1,0x5b,0xda,0xbc,0xdb,0x29,0x4b,0xe0, 0xae,0x15,0xb3,0x6c,0xed,0xab,0x56,0xe9,0x9f,0xb7,0xfc,0xf1,0xfd,0x9b,0x4f,0xcf, 0xe4,0xa4,0x28,0x4a,0x94,0xcb,0x3a,0xcf,0x9b,0x26,0x93,0xaa,0x92,0xba,0x29,0xa8, 0x2a,0x89,0x29,0xa8,0x50,0x22,0x97,0x45,0xa1,0x71,0xe5,0xeb,0xf6,0xc5,0xe8,0x48, 0xe6,0xe6,0x66,0x21,0xdd,0x3f,0x23,0x14,0xaa,0x22,0x8d,0x6c,0x64,0x45,0x55,0x6e, 0x68,0x63,0x88,0x30,0xa6,0x36,0xa4,0xae,0x6b,0xa4,0x49,0x91,0x95,0x05,0x31,0x1a, 0x49,0x4a,0x19,0xfc,0xea,0xb4,0x55,0x0f,0x7e,0x94,0x8f,0xc9,0xbf,0xf7,0x15,0xd5, 0xbf,0x7c,0x0b,0x8e,0x86,0x02,0xd6,0x47,0x88,0x69,0x85,0x52,0x84,0x53,0x94,0x5d, 0x10,0x3a,0x85,0x0f,0x7b,0x59,0x7f,0x97,0x89,0xff,0xc8,0xc4,0x5d,0x76,0x9d,0xc7, 0x75,0xe2,0x72,0xd5,0x0c,0x6e,0x70,0x63,0xad,0xe2,0x18,0x21,0xec,0x49,0x8f,0x22, 0xb5,0x2e,0x7a,0xde,0x74,0x11,0x6d,0xdc,0x87,0x6c,0x3d,0x64,0xfd,0xa8,0x34,0x47, 0x65,0x78,0x02,0x11,0x46,0xd2,0xbd,0x4d,0x1a,0x74,0x76,0x78,0x39,0x27,0xe3,0x6c, 0xaf,0x76,0x10,0x5d,0xc2,0x5b,0x31,0xab,0xc0,0x31,0x18,0xb6,0x37,0xe1,0x20,0x7c, 0x5e,0xc6,0xfb,0x45,0x10,0x1f,0x5f,0x78,0x6f,0x61,0x0a,0x60,0x1c,0x03,0x06,0xe3, 0x50,0xfc,0x06,0x00,0x00,0xff,0xff,0x03,0x00,0x19,0xcf,0xf5,0xc0,0xf9,0x65,0xe8, 0x78,0xc3,0xfa,0x5f,0x0a,0xf6,0x09,0x17,0xd8,0xb0,0x54,0xb9,0x02,0x8d,0x91,0x31, 0x9c,0x42,0x5a,0x68,0x39,0x31,0x41,0x59,0x26,0x53,0x59,0xc1,0x52,0x36,0xf7,0x00, 0x00,0x03,0x41,0x00,0x00,0x10,0x02,0x44,0xa0,0x00,0x21,0xb4,0x01,0x9a,0x0d,0x46, 0xa5,0x32,0x38,0xbb,0x92,0x29,0xc2,0x84,0x86,0x0a,0x91,0xb7,0xb8 }; /* Verify that a file records with no compression #How to make echo "hellohellohello" > f1 chown $UNAME:$GNAME f1 chmod 0644 f1 env TZ=utc touch -afm -t 197001020000.01 f1 xar --compression none -cf archive9.xar f1 od -t x1 archive9.xar | sed -E -e 's/^0[0-9]+//;s/^ //;s/( )([0-9a-f]{2})/0x\2,/g;$ D' > archive9.xar.txt */ static unsigned char archive9[] = { 0x78,0x61,0x72,0x21,0x00,0x1c,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x98, 0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x47,0x00,0x00,0x00,0x01,0x78,0xda,0xa4,0x53, 0x4d,0x6f,0xe3,0x20,0x14,0xbc,0xf7,0x57,0x20,0xee,0x5e,0xc0,0x25,0x89,0x1d,0x11, 0xaa,0x5e,0xaa,0xbd,0x6f,0xf6,0xb2,0x37,0x02,0x8f,0x18,0xc5,0x1f,0x11,0xc6,0x55, 0xba,0xbf,0x7e,0x01,0xdb,0xad,0xba,0x55,0x7b,0xa9,0x64,0xc9,0xe3,0x61,0xde,0x78, 0x78,0xf0,0xc4,0xc3,0xad,0x6b,0xd1,0x33,0xf8,0xd1,0x0d,0xfd,0x01,0xb3,0x1f,0x14, 0x23,0xe8,0xf5,0x60,0x5c,0x7f,0x3e,0xe0,0xdf,0xc7,0xa7,0xa2,0xc2,0x0f,0xf2,0x4e, 0xdc,0x94,0x97,0x77,0x48,0x84,0x41,0xc7,0x17,0x12,0xda,0x83,0x0a,0xb1,0xa2,0x08, 0xae,0x03,0x59,0x52,0x5a,0x17,0xac,0x2c,0x28,0x3f,0xd2,0x7a,0xcf,0xaa,0x3d,0xaf, 0x05,0x79,0x2f,0xc9,0x45,0x0d,0xe8,0xcb,0x38,0x75,0x68,0x0c,0x2f,0x2d,0x1c,0xf0, 0xd8,0x28,0x86,0xd3,0x0a,0x12,0x83,0xb5,0x23,0x04,0x49,0x05,0x59,0x50,0x66,0x47, 0xf7,0x37,0x99,0x0b,0x92,0x41,0xb2,0x20,0xab,0x47,0xfe,0xb2,0xae,0x05,0xe4,0x4c, 0x8c,0xbd,0xd8,0x18,0x15,0x54,0x46,0x48,0xb4,0xd0,0x9f,0x43,0x23,0xd9,0x56,0x90, 0x05,0xce,0xfc,0xba,0xb9,0x35,0x84,0xba,0x5e,0x5b,0xa7,0x73,0x52,0x32,0xe8,0x00, 0xa1,0x18,0x43,0x4c,0xde,0x61,0xb2,0x14,0x2c,0x81,0xca,0xf7,0xd9,0x96,0x70,0xc9, 0x7e,0x0d,0x17,0x39,0xe5,0x75,0xe3,0x9e,0xc1,0x14,0xff,0x6f,0xf5,0xd7,0xcf,0xc7, 0x98,0x71,0x63,0x76,0xfc,0xa4,0x4f,0x7a,0x57,0x9b,0x7b,0x5b,0x9f,0x2c,0x57,0xd6, 0x56,0x96,0x57,0x55,0x45,0x81,0x6f,0xca,0xed,0x86,0x5b,0xa0,0xba,0x8e,0xcd,0xfb, 0x60,0xb4,0xa6,0xbf,0x05,0xaf,0x62,0xca,0xef,0xff,0xe1,0xa3,0xd3,0xdc,0x42,0xf2, 0xda,0x43,0xa1,0x3f,0x39,0xdc,0xed,0x9f,0x78,0x0e,0xeb,0xa9,0x22,0xd1,0x65,0xc8, 0xea,0x1d,0x2d,0x28,0x2b,0x68,0x79,0xa4,0x74,0x9f,0x1e,0x16,0x65,0xdd,0x9b,0x4c, 0x7d,0x21,0x53,0x6f,0xb2,0xb3,0x1f,0xa6,0xab,0xd4,0x13,0x08,0x32,0xc3,0x99,0x75, 0x46,0x32,0x4a,0x59,0x24,0x23,0xca,0xd4,0x34,0x82,0x9f,0x75,0x19,0xcd,0xdc,0xab, 0x6c,0x5a,0x65,0xdd,0x60,0x40,0xd2,0x2d,0xe7,0x31,0x4c,0x82,0x99,0x0c,0x2f,0x57, 0x40,0xad,0xeb,0x2f,0x07,0x3c,0x78,0x77,0x76,0xbd,0x6a,0xb1,0x6c,0x94,0x37,0x89, 0x13,0x24,0x2d,0xcf,0xc2,0x5e,0xc5,0x5c,0x36,0xfa,0x65,0x90,0x6f,0x60,0xba,0x74, 0x69,0x14,0x48,0x9e,0x05,0x41,0xf2,0x64,0xfc,0x03,0x00,0x00,0xff,0xff,0x03,0x00, 0xee,0x8e,0xf8,0x75,0xa1,0xaf,0x74,0x71,0x3f,0x40,0x08,0xab,0x13,0x7d,0xc0,0x82, 0x3a,0x56,0xeb,0x4e,0x35,0xf1,0x35,0xb7,0x68,0x65,0x6c,0x6c,0x6f,0x68,0x65,0x6c, 0x6c,0x6f,0x68,0x65,0x6c,0x6c,0x6f,0x0a }; /* Verify that a file records with md5 hashing algorithm #How to make echo "hellohellohello" > f1 chown $UNAME:$GNAME f1 chmod 0644 f1 env TZ=utc touch -afm -t 197001020000.01 f1 xar --toc-cksum md5 -cf archive10.xar f1 od -t x1 archive10.xar | sed -E -e 's/^0[0-9]+//;s/^ //;s/( )([0-9a-f]{2})/0x\2,/g;$ D' > archive10.xar.txt */ static unsigned char archive10[] = { 0x78,0x61,0x72,0x21,0x00,0x1c,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xaf, 0x00,0x00,0x00,0x00,0x00,0x00,0x03,0x40,0x00,0x00,0x00,0x02,0x78,0xda,0x7c,0x53, 0x4d,0x6f,0xdc,0x20,0x10,0xbd,0xe7,0x57,0x20,0xee,0x0e,0x60,0xb3,0xb6,0x59,0xb1, 0x44,0xbd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d8,0xda, 0x56,0x8c,0xd8,0x32,0xb7,0xaa,0x28,0x59,0xac,0xda,0x07,0xa3,0x3d,0x97,0x5b,0xf0, 0x52,0x85,0x2f,0x23,0x1c,0x74,0x45,0x2f,0xea,0xa2,0x2a,0xa6,0x0b,0xcb,0x2e,0x96, 0x4a,0x1b,0xbd,0x69,0x5d,0xd7,0xd8,0xd0,0x43,0x5e,0x1e,0xa8,0x35,0x58,0x31,0xc6, 0xd1,0x47,0xa7,0xb5,0x78,0xe8,0xad,0x7a,0x5c,0x7d,0xd1,0xd5,0xea,0x57,0xec,0xc0, 0xde,0x4e,0xc0,0xbb,0x04,0x09,0xab,0x70,0x86,0x49,0x86,0xf3,0x33,0xc6,0xc7,0xe5, 0x23,0x51,0xd6,0xbd,0xcb,0xe4,0x7f,0x64,0xf2,0x5d,0xd6,0xf8,0x61,0x1e,0x85,0x9a, 0x0d,0x47,0x2b,0x5c,0x59,0xa7,0x05,0xc1,0x98,0x44,0x32,0xa2,0x44,0xcd,0x93,0xf1, 0xab,0x2e,0xa1,0x95,0x7b,0x93,0xcd,0xbb,0xac,0x1b,0xb4,0x11,0xb8,0xa4,0x34,0x26, 0xb3,0xc0,0x44,0x86,0x97,0xd1,0x80,0xd6,0xf5,0x4f,0x27,0x38,0x78,0xd7,0xb8,0x5e, 0xb6,0x50,0x5c,0xa5,0xd7,0x0b,0xc7,0xd1,0xb2,0xbd,0x0a,0x7b,0x19,0xf3,0xb2,0xd1, 0x2f,0x81,0xf4,0xf6,0x96,0xe7,0xb6,0xcc,0x00,0x4a,0x43,0xc0,0x51,0x1a,0x89,0xdf, 0x00,0x00,0x00,0xff,0xff,0x03,0x00,0x27,0xf8,0xf5,0x28,0x87,0x01,0xb1,0xb7,0x18, 0xe8,0x34,0x20,0x06,0x5c,0x66,0x9a,0x43,0x26,0xe7,0x94,0x78,0xda,0xca,0x48,0xcd, 0xc9,0xc9,0xcf,0x80,0x13,0x5c,0x00,0x00,0x00,0x00,0xff,0xff,0x03,0x00,0x37,0xf7, 0x06,0x47 }; /* Verify that a file records with no hashing algorithm #How to make echo "hellohellohello" > f1 chown $UNAME:$GNAME f1 chmod 0644 f1 env TZ=utc touch -afm -t 197001020000.01 f1 xar --toc-cksum none -cf archive11.xar f1 od -t x1 archive11.xar | sed -E -e 's/^0[0-9]+//;s/^ //;s/( )([0-9a-f]{2})/0x\2,/g;$ D' > archive11.xar.txt */ static unsigned char archive11[] = { 0x78,0x61,0x72,0x21,0x00,0x1c,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x98, 0x00,0x00,0x00,0x00,0x00,0x00,0x02,0xef,0x00,0x00,0x00,0x00,0x78,0xda,0x7c,0x52, 0xcb,0x6e,0xeb,0x20,0x14,0xdc,0xf7,0x2b,0x10,0x7b,0x17,0xb0,0x89,0x63,0x22,0x42, 0x75,0x37,0x55,0xf7,0xcd,0xdd,0x74,0x47,0x78,0x38,0xa8,0x7e,0xc9,0xc6,0x55,0xda, 0xaf,0xbf,0x3c,0xe2,0x56,0x55,0xd5,0x2b,0x21,0x79,0x3c,0xcc,0x39,0x67,0x74,0x18, 0xfe,0x70,0xed,0x3b,0xf0,0x66,0xe6,0xc5,0x8d,0xc3,0x11,0x92,0x7b,0x0c,0x81,0x19, 0xd4,0xa8,0xdd,0xd0,0x1e,0xe1,0xdf,0xd3,0x63,0xd1,0xc0,0x07,0x71,0xc7,0xaf,0x72, 0x16,0x77,0x80,0xfb,0x51,0x85,0x0f,0xe0,0x6a,0x36,0xd2,0x87,0x8a,0xc2,0xbb,0xde, 0x88,0x12,0x63,0x56,0x90,0xb2,0xc0,0xf4,0x44,0xf0,0x81,0x54,0x07,0x5a,0x73,0xf4, 0x5d,0x12,0x8b,0xac,0xeb,0x0c,0x70,0x3a,0x4c,0x81,0xf1,0x1f,0x70,0x2d,0xbd,0x4c, 0x08,0xf0,0xce,0x0c,0xad,0xbf,0x88,0xb2,0xe2,0xe8,0x06,0x33,0x3f,0x5a,0xbb,0x18, 0x2f,0x30,0x47,0x37,0x94,0xe9,0xc5,0x7d,0x18,0x41,0xc2,0x94,0x04,0x32,0xb7,0xd9, 0x06,0x8b,0x7f,0xef,0xcc,0x11,0xca,0x69,0xea,0x9c,0x4a,0x1e,0xd0,0xb5,0x68,0x3f, 0xdc,0x04,0xd1,0x4d,0x2a,0x67,0x75,0x71,0x6f,0x46,0x17,0xea,0x62,0xd4,0xeb,0xb2, 0xf6,0x5b,0xcd,0xf3,0xd3,0x9f,0x60,0xce,0x36,0x55,0xa5,0x4b,0xab,0x15,0x61,0x15, 0x65,0x95,0x3c,0xd3,0x86,0x49,0x2d,0xcb,0xca,0x36,0x76,0xcf,0x88,0xad,0x4b,0xab, 0xaa,0x9a,0x35,0x1c,0xfd,0x68,0xb4,0x79,0xb9,0xfa,0x59,0x2a,0xff,0xeb,0x84,0x9d, 0xde,0xd3,0xb3,0x3a,0xab,0x3d,0xd3,0x95,0x65,0x67,0x4b,0xa5,0x0d,0xbd,0x69,0xd3, 0x34,0xd8,0xd0,0x5d,0x59,0xef,0xa8,0x35,0x58,0x31,0xc6,0xd1,0xcf,0x4e,0x79,0x77, 0xe8,0x73,0x79,0x5c,0xfd,0xf2,0x08,0xe4,0x25,0xbc,0xc2,0xb6,0x7d,0xc0,0xfb,0x04, 0x09,0xdb,0xe3,0x02,0x93,0x02,0x97,0x27,0x8c,0x0f,0xf1,0x44,0x59,0xff,0x25,0x93, 0xff,0x91,0xc9,0x2f,0x59,0x3b,0x8f,0xeb,0x24,0xd4,0x6a,0x38,0xca,0x30,0xb3,0x4e, 0x0b,0x82,0x31,0x09,0x64,0x40,0x89,0x5a,0x17,0x33,0x67,0x5d,0x42,0x99,0xfb,0x94, 0xad,0x9b,0xac,0x1f,0xb5,0x11,0xb8,0xa6,0x34,0x98,0x89,0x30,0x91,0xfe,0x7d,0x32, 0xa0,0x73,0xc3,0xeb,0x11,0x8e,0xb3,0x6b,0xdd,0x20,0x3b,0x28,0x2e,0x72,0xd6,0x91, 0xe3,0x28,0x5e,0x67,0xe1,0x20,0x83,0x2f,0x1b,0xfa,0x25,0x10,0xc3,0x86,0x62,0xda, 0x62,0x64,0x51,0xca,0x2c,0x47,0x29,0xc1,0xff,0x00,0x00,0x00,0xff,0xff,0x03,0x00, 0xf1,0x18,0xdc,0x71,0x78,0xda,0xca,0x48,0xcd,0xc9,0xc9,0xcf,0x80,0x13,0x5c,0x00, 0x00,0x00,0x00,0xff,0xff,0x03,0x00,0x37,0xf7,0x06,0x47 }; /* Verify that a file which is missing timestamp information has the corresponding timestamps unset. #How to make e.g. struct archive *a = archive_write_new(); archive_write_set_format_xar(a); archive_write_add_filter_none(a); size_t used, buffsize = 1500; char *buff = (char*) malloc(buffsize); archive_write_open_memory(a, buff, buffsize, &used); struct archive_entry *ae = archive_entry_new(); archive_entry_copy_pathname(ae, "file"); archive_entry_set_size(ae, 8); archive_write_header(a, ae); archive_entry_free(ae); archive_write_data(a, "12345678", 9); archive_write_free(a); std::cout << std::string(buff, used); free(buff); $./a.out > f12.xar Verify toc has no mtime/atime sections $ xar --dump-toc=- -f f12.xar Dump contents $ ./a.out | od -t x1 | sed -E -e 's/^0[0-9]+//;s/^ //;s/( )([0-9a-f]{2})/0x\2,/g;$ D' */ static unsigned char archive12[] = { 0x78,0x61,0x72,0x21,0x00,0x1c,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xd1, 0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x56,0x00,0x00,0x00,0x01,0x78,0x9c,0x55,0x90, 0x41,0x8e,0xc2,0x30,0x0c,0x45,0xf7,0x9c,0x22,0xca,0xbe,0x38,0x2d,0x2c,0x10,0x72, 0xdb,0xdd,0x9c,0x00,0x0e,0x50,0xb5,0x6e,0x89,0x68,0x12,0xd4,0x84,0x11,0x70,0x7a, 0x62,0x17,0x46,0x9a,0x28,0x92,0xbf,0x5f,0xec,0xef,0xc8,0xd8,0x3e,0xdc,0xac,0x7e, 0x69,0x89,0x36,0xf8,0x5a,0x97,0x5b,0xa3,0x15,0xf9,0x3e,0x0c,0xd6,0x4f,0xb5,0x3e, 0x9f,0x7e,0x8a,0x83,0x6e,0x9b,0x0d,0x3e,0xba,0xa5,0xd9,0x28,0x4c,0xa1,0xcf,0x41, 0x61,0xbf,0x50,0x97,0x72,0x47,0x91,0xac,0xa3,0xa6,0x32,0xe5,0xa1,0x28,0x4d,0x61, 0xaa,0x53,0x65,0x8e,0xf9,0xee,0x77,0x08,0xff,0x4b,0xa4,0xe9,0x42,0xfd,0x35,0xde, 0x9d,0x8a,0xe9,0x39,0x53,0xad,0xe3,0xa5,0x2b,0x35,0xbf,0x28,0x0c,0xe3,0x18,0x29, 0x35,0x06,0xe1,0xa3,0x84,0x46,0xfb,0x62,0x73,0x04,0x11,0x6c,0x01,0x5f,0x0f,0xc9, 0x46,0x3b,0x93,0xb2,0x43,0xfe,0xf6,0xc7,0xc6,0x77,0x79,0x14,0x53,0x04,0x91,0x02, 0xd3,0xf3,0xf6,0x85,0x22,0x05,0x5a,0x1f,0x06,0xe2,0x79,0xab,0x10,0xe6,0x04,0xe5, 0x83,0xe0,0xfe,0xe0,0xdd,0x0e,0x5c,0xc6,0x41,0xf2,0x69,0xcd,0xa7,0x35,0x47,0x60, 0x63,0xde,0x0c,0xc8,0x6a,0x10,0x64,0x51,0x6f,0x2a,0x6b,0x63,0x9a,0x01,0x79,0x57, 0x93,0xd4,0x55,0xd4,0x06,0x1c,0x76,0x99,0x10,0x31,0x87,0x52,0x2b,0x16,0xff,0x5b, 0x36,0x78,0x9c,0x55,0x90,0x41,0x8e,0xc2,0x30,0x0c,0x45,0xf7,0x9c,0x22,0xca,0xbe, 0x38,0x2d,0x2c,0x10,0x72 }; static void verify12(struct archive *a, struct archive_entry *ae) { (void)a; /* UNUSED */ assertEqualInt(archive_entry_mtime_is_set(ae), 0); assertEqualInt(archive_entry_atime_is_set(ae), 0); assertEqualInt(archive_entry_mtime(ae), 0); assertEqualInt(archive_entry_atime(ae), 0); } /* #How to make echo "onetwothree" > f1 echo "fourfivesize" > f2 xar -cf archive13.xar f1 f2 od -t x1 archive13.xar | sed -E -e 's/^0[0-9]+//' | sed -E -e 's/^ //' | sed -E -e 's/( )([0-9a-f]{2})/0x\2,/g;$ D' */ static unsigned char archive13[] = { 0x78,0x61,0x72,0x21,0x00,0x1c,0x00,0x01,0x00,0x00,0x00,0x00,0x00,0x00,0x02,0x31, 0x00,0x00,0x00,0x00,0x00,0x00,0x06,0xaa,0x00,0x00,0x00,0x01,0x78,0xda,0xcc,0x95, 0xcb,0x8e,0x9b,0x30,0x14,0x86,0xf7,0x79,0x0a,0xc4,0x9e,0xe2,0x0b,0xbe,0x10,0x39, 0xcc,0xae,0x4f,0x30,0xdd,0x74,0x67,0xec,0x43,0x82,0x86,0x4b,0x04,0x24,0xcd,0xcc, 0xd3,0xd7,0x36,0x30,0x69,0x34,0xd3,0x51,0xda,0x4a,0xa3,0x8a,0x05,0xbf,0x8f,0x7f, 0x9f,0xe3,0x63,0x3e,0x64,0xf5,0x70,0x69,0x9b,0xe8,0x0c,0xc3,0x58,0xf7,0xdd,0x2e, 0xc6,0x5f,0x50,0x1c,0x41,0x67,0x7a,0x5b,0x77,0xfb,0x5d,0xfc,0xed,0xf1,0x6b,0x22, 0xe3,0x87,0x62,0xa3,0x2e,0x7a,0x28,0x36,0x91,0x9a,0x7a,0xe3,0x5e,0x91,0x32,0x03, 0xe8,0xc9,0xad,0x48,0xa6,0xba,0x85,0x82,0x20,0x2c,0x13,0x44,0x12,0xc2,0x1f,0x71, 0xbe,0xc5,0x68,0x4b,0xf3,0xef,0x2a,0xbd,0xf5,0x84,0x55,0x07,0x30,0x4f,0xe3,0xa9, 0x8d,0xc6,0xe9,0xb9,0x81,0x5d,0x3c,0x1e,0x34,0x8e,0xfd,0x4c,0xa4,0xfa,0xaa,0x1a, 0x61,0x2a,0x90,0x4a,0x17,0x15,0xa2,0x63,0xfd,0xe2,0xb3,0xab,0x34,0x08,0x9f,0x22, 0x5d,0x73,0x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,0xcb,0x2c,0x4b,0x2d, 0xce,0xac,0xe0,0x02,0x00,0x20,0xfa,0x04,0xc5 }; enum enc { GZIP, BZIP2 }; static void verify(unsigned char *d, size_t s, void (*f1)(struct archive *, struct archive_entry *), void (*f2)(struct archive *, struct archive_entry *), enum enc etype) { struct archive_entry *ae; struct archive *a; unsigned char *buff; int r; assert((a = archive_read_new()) != NULL); switch (etype) { case BZIP2: /* This is only check whether bzip is supported or not. * This filter won't be used this test. */ if (ARCHIVE_OK != archive_read_support_filter_bzip2(a)) { skipping("Unsupported bzip2"); assertEqualInt(ARCHIVE_OK, archive_read_free(a)); return; } break; case GZIP: /* This gzip must be needed. archive_read_support_format_xar() * will return a warning if gzip is unsupported. */ break; } assertA(0 == archive_read_support_filter_all(a)); r = archive_read_support_format_xar(a); if (r == ARCHIVE_WARN) { skipping("xar reading not fully supported on this platform"); assertEqualInt(ARCHIVE_OK, archive_read_free(a)); return; } assert((buff = malloc(100000)) != NULL); if (buff == NULL) return; memcpy(buff, d, s); memset(buff + s, 0, 2048); assertA(0 == archive_read_support_format_all(a)); assertA(0 == archive_read_open_memory(a, buff, s + 1024)); assertA(0 == archive_read_next_header(a, &ae)); assertEqualInt(archive_filter_code(a, 0), ARCHIVE_FILTER_NONE); assertEqualInt(archive_format(a), ARCHIVE_FORMAT_XAR); assertEqualInt(archive_entry_is_encrypted(ae), 0); assertEqualIntA(a, archive_read_has_encrypted_entries(a), ARCHIVE_READ_FORMAT_ENCRYPTION_UNSUPPORTED); /* Verify the only entry. */ f1(a, ae); if (f2) { assertA(0 == archive_read_next_header(a, &ae)); assertEqualInt(archive_filter_code(a, 0), ARCHIVE_FILTER_NONE); assertEqualInt(archive_format(a), ARCHIVE_FORMAT_XAR); /* Verify the only entry. */ f2(a, ae); assertEqualInt(2, archive_file_count(a)); } else { assertEqualInt(1, archive_file_count(a)); } /* End of archive. */ assertEqualInt(ARCHIVE_EOF, archive_read_next_header(a, &ae)); assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a)); assertEqualInt(ARCHIVE_OK, archive_read_free(a)); free(buff); } static void verifyB(unsigned char *d, size_t s) { struct archive* a; struct archive_entry *entry = NULL; size_t buf_size; unsigned char *buf; assert((a = archive_read_new()) != NULL); if(ARCHIVE_OK != archive_read_support_filter_gzip(a)) { skipping("Unsupported gzip"); assertEqualInt(ARCHIVE_OK, archive_read_free(a)); return; } if(ARCHIVE_OK != archive_read_support_filter_bzip2(a)) { skipping("Unsupported bzip2"); assertEqualInt(ARCHIVE_OK, archive_read_free(a)); return; } if(ARCHIVE_OK != archive_read_support_format_xar(a)) { skipping("Unsupported xar"); assertEqualInt(ARCHIVE_OK, archive_read_free(a)); return; } assertA(0 == archive_read_open_memory(a, d, s)); // f1, content "onetwothree\n", size 12 bytes assertA(0 == archive_read_next_header(a, &entry)); buf_size = (size_t) archive_entry_size(entry); assertA(buf_size == 12); buf = (unsigned char*) malloc(buf_size); assertA(NULL != buf); assertA(buf_size == (size_t) archive_read_data(a, buf, buf_size)); free(buf); // f2, content "fourfivesix\n", size 12 bytes assertA(0 == archive_read_next_header(a, &entry)); buf_size = (size_t) archive_entry_size(entry); assertA(buf_size == 12); buf = (unsigned char*) malloc(buf_size); assertA(NULL != buf); assertA(buf_size == (size_t) archive_read_data(a, buf, buf_size)); free(buf); assertEqualInt(ARCHIVE_OK, archive_read_free(a)); } DEFINE_TEST(test_read_format_xar) { verify(archive1, sizeof(archive1), verify0, verify1, GZIP); verify(archive2, sizeof(archive2), verify0, verify2, GZIP); verify(archive3, sizeof(archive3), verify3, NULL, GZIP); verify(archive4, sizeof(archive4), verify4, NULL, GZIP); verify(archive5, sizeof(archive5), verify5, NULL, GZIP); verify(archive6, sizeof(archive6), verify6, NULL, GZIP); verify(archive7, sizeof(archive7), verify7, NULL, GZIP); verify(archive8, sizeof(archive8), verify0, NULL, BZIP2); verify(archive9, sizeof(archive9), verify0, NULL, GZIP); verify(archive10, sizeof(archive10), verify0, NULL, GZIP); verify(archive11, sizeof(archive11), verify0, NULL, GZIP); verify(archive12, sizeof(archive12), verify12, NULL, GZIP); verifyB(archive13, sizeof(archive13)); }
Upload File
Create Folder