From 366f42737cba40ceb2e83af8d17c61c0242703c5 Mon Sep 17 00:00:00 2001 From: mm Date: Thu, 21 Mar 2013 18:59:02 +0000 Subject: [PATCH] Update libarchive's vendor dist to version 3.1.2 from release branch. Git branch: release Git commit: 19f23e191f9d3e1dd2a518735046100419965804 Obtained from: https://github.com/libarchive/libarchive.git --- CMakeLists.txt | 317 +- Makefile.am | 215 +- NEWS | 27 + README | 2 +- build/README.txt | 35 + build/autogen.sh | 5 + build/bump-version.sh | 2 +- build/cmake/FindLibGCC.cmake | 22 + build/cmake/FindNettle.cmake | 23 + build/cmake/FindPCREPOSIX.cmake | 34 + .../LibarchiveCheckCSourceCompiles.cmake | 106 + build/cmake/LibarchiveCheckCSourceRuns.cmake | 102 + build/cmake/config.h.in | 42 + build/makerelease.sh | 1 + build/version | 2 +- configure.ac | 264 +- cpio/bsdcpio.1 | 12 +- cpio/cmdline.c | 5 + cpio/cpio.c | 79 +- cpio/cpio.h | 8 +- cpio/test/CMakeLists.txt | 18 + cpio/test/main.c | 245 +- cpio/test/test.h | 22 +- cpio/test/test_basic.c | 12 +- cpio/test/test_extract.cpio.Z.uu | 7 + cpio/test/test_extract.cpio.bz2.uu | 7 + cpio/test/test_extract.cpio.grz.uu | 7 + cpio/test/test_extract.cpio.gz.uu | 7 + cpio/test/test_extract.cpio.lrz.uu | 8 + cpio/test/test_extract.cpio.lz.uu | 6 + cpio/test/test_extract.cpio.lzma.uu | 6 + cpio/test/test_extract.cpio.lzo.uu | 9 + cpio/test/test_extract.cpio.xz.uu | 7 + cpio/test/test_extract_cpio_Z.c | 42 + cpio/test/test_extract_cpio_bz2.c | 48 + cpio/test/test_extract_cpio_grz.c | 48 + cpio/test/test_extract_cpio_gz.c | 48 + cpio/test/test_extract_cpio_lrz.c | 48 + cpio/test/test_extract_cpio_lz.c | 48 + cpio/test/test_extract_cpio_lzma.c | 48 + cpio/test/test_extract_cpio_lzo.c | 48 + cpio/test/test_extract_cpio_xz.c | 48 + cpio/test/test_format_newc.c | 4 +- cpio/test/test_option_b64encode.c | 54 + cpio/test/test_option_grzip.c | 52 + cpio/test/test_option_lrzip.c | 52 + cpio/test/test_option_lzop.c | 56 + cpio/test/test_option_uuencode.c | 54 + cpio/test/test_option_xz.c | 57 + cpio/test/test_option_y.c | 5 +- cpio/test/test_option_z.c | 5 +- doc/update.sh | 2 + examples/minitar/minitar.c | 12 +- examples/untar.c | 4 +- libarchive/CMakeLists.txt | 18 +- libarchive/archive.h | 161 +- libarchive/archive_cmdline.c | 227 ++ libarchive/archive_cmdline_private.h | 47 + libarchive/archive_crypto.c | 8 +- libarchive/archive_entry.c | 3 + libarchive/archive_entry.h | 2 +- libarchive/archive_entry_link_resolver.c | 3 + libarchive/archive_match.c | 11 +- libarchive/archive_options.c | 15 +- libarchive/archive_ppmd7.c | 2 +- libarchive/archive_private.h | 1 + libarchive/archive_rb.c | 8 + libarchive/archive_read.c | 411 ++- libarchive/archive_read_append_filter.c | 198 ++ .../archive_read_disk_entry_from_file.c | 297 +- libarchive/archive_read_disk_posix.c | 96 +- libarchive/archive_read_disk_windows.c | 22 +- libarchive/archive_read_extract.c | 2 +- libarchive/archive_read_open_fd.c | 3 +- libarchive/archive_read_open_file.c | 4 +- libarchive/archive_read_open_filename.c | 163 +- libarchive/archive_read_private.h | 40 +- libarchive/archive_read_set_format.c | 105 + libarchive/archive_read_support_filter_all.c | 8 +- .../archive_read_support_filter_bzip2.c | 9 +- .../archive_read_support_filter_compress.c | 3 +- .../archive_read_support_filter_grzip.c | 121 + libarchive/archive_read_support_filter_gzip.c | 21 +- .../archive_read_support_filter_lrzip.c | 132 + libarchive/archive_read_support_filter_lzop.c | 486 +++ .../archive_read_support_filter_program.c | 188 +- libarchive/archive_read_support_filter_rpm.c | 3 +- libarchive/archive_read_support_filter_uu.c | 28 +- libarchive/archive_read_support_filter_xz.c | 33 +- libarchive/archive_read_support_format_7zip.c | 66 +- libarchive/archive_read_support_format_ar.c | 1 + libarchive/archive_read_support_format_cab.c | 55 +- libarchive/archive_read_support_format_cpio.c | 1 + .../archive_read_support_format_empty.c | 1 + .../archive_read_support_format_iso9660.c | 418 ++- libarchive/archive_read_support_format_lha.c | 17 +- .../archive_read_support_format_mtree.c | 214 +- libarchive/archive_read_support_format_rar.c | 358 ++- libarchive/archive_read_support_format_raw.c | 3 +- libarchive/archive_read_support_format_tar.c | 96 +- libarchive/archive_read_support_format_xar.c | 1 + libarchive/archive_read_support_format_zip.c | 525 +++- libarchive/archive_string.c | 76 +- libarchive/archive_util.c | 45 +- libarchive/archive_virtual.c | 7 + libarchive/archive_windows.c | 39 +- libarchive/archive_windows.h | 14 +- libarchive/archive_write.c | 6 + libarchive/archive_write_add_filter.c | 8 +- .../archive_write_add_filter_b64encode.c | 314 ++ libarchive/archive_write_add_filter_by_name.c | 75 + libarchive/archive_write_add_filter_bzip2.c | 159 +- .../archive_write_add_filter_compress.c | 4 +- libarchive/archive_write_add_filter_grzip.c | 135 + libarchive/archive_write_add_filter_gzip.c | 188 +- libarchive/archive_write_add_filter_lrzip.c | 192 ++ libarchive/archive_write_add_filter_lzop.c | 486 +++ libarchive/archive_write_add_filter_program.c | 243 +- .../archive_write_add_filter_uuencode.c | 305 ++ libarchive/archive_write_add_filter_xz.c | 18 +- libarchive/archive_write_disk_acl.c | 249 ++ libarchive/archive_write_disk_posix.c | 1256 +++++++- libarchive/archive_write_disk_private.h | 5 + libarchive/archive_write_disk_windows.c | 2 +- libarchive/archive_write_free.3 | 13 + libarchive/archive_write_open_filename.c | 7 +- libarchive/archive_write_private.h | 9 + libarchive/archive_write_set_format_7zip.c | 74 +- libarchive/archive_write_set_format_ar.c | 2 +- libarchive/archive_write_set_format_by_name.c | 4 + libarchive/archive_write_set_format_iso9660.c | 118 +- libarchive/archive_write_set_format_mtree.c | 1562 ++++++--- libarchive/archive_write_set_format_pax.c | 10 +- libarchive/archive_write_set_format_v7tar.c | 661 ++++ libarchive/archive_write_set_format_xar.c | 12 +- libarchive/archive_write_set_format_zip.c | 68 +- libarchive/archive_write_set_options.c | 2 +- libarchive/filter_fork.h | 2 +- libarchive/filter_fork_posix.c | 238 ++ libarchive/filter_fork_windows.c | 139 +- libarchive/libarchive-formats.5 | 2 +- libarchive/test/CMakeLists.txt | 57 +- libarchive/test/main.c | 266 +- libarchive/test/test.h | 30 +- libarchive/test/test_acl_freebsd_nfs4.c | 547 ++++ libarchive/test/test_acl_freebsd_posix1e.c | 265 ++ libarchive/test/test_acl_nfs4.c | 7 +- libarchive/test/test_acl_pax.c | 2 +- libarchive/test/test_acl_posix1e.c | 2 + libarchive/test/test_archive_clear_error.c | 2 +- libarchive/test/test_archive_cmdline.c | 141 + .../test/test_archive_read_close_twice.c | 2 +- .../test_archive_read_close_twice_open_fd.c | 2 +- ...t_archive_read_close_twice_open_filename.c | 2 +- .../test_archive_read_multiple_data_objects.c | 372 +++ .../test_archive_read_set_filter_option.c | 2 +- .../test_archive_read_set_format_option.c | 2 +- .../test/test_archive_read_set_option.c | 2 +- .../test/test_archive_read_set_options.c | 2 +- libarchive/test/test_archive_set_error.c | 2 +- .../test_archive_write_add_filter_by_name.c | 194 ++ .../test_archive_write_set_filter_option.c | 4 +- .../test_archive_write_set_format_by_name.c | 285 ++ .../test_archive_write_set_format_option.c | 2 +- .../test/test_archive_write_set_option.c | 4 +- .../test/test_archive_write_set_options.c | 4 +- libarchive/test/test_compat_bzip2.c | 8 +- libarchive/test/test_compat_cpio.c | 2 +- libarchive/test/test_compat_gtar.c | 2 +- libarchive/test/test_compat_gzip.c | 4 +- libarchive/test/test_compat_lzip.c | 4 +- libarchive/test/test_compat_lzma.c | 4 +- libarchive/test/test_compat_lzop.c | 131 + libarchive/test/test_compat_lzop_1.tar.lzo.uu | 30 + libarchive/test/test_compat_lzop_2.tar.lzo.uu | 39 + libarchive/test/test_compat_lzop_3.tar.lzo.uu | 32 + libarchive/test/test_compat_mac.c | 4 +- libarchive/test/test_compat_tar_hardlink.c | 2 +- libarchive/test/test_compat_uudecode.c | 63 + libarchive/test/test_compat_xz.c | 4 +- libarchive/test/test_compat_zip.c | 2 +- libarchive/test/test_empty_write.c | 20 +- libarchive/test/test_entry.c | 22 + libarchive/test/test_filter_count.c | 9 +- libarchive/test/test_fuzz.c | 329 +- libarchive/test/test_open_failure.c | 16 +- libarchive/test/test_open_fd.c | 5 +- libarchive/test/test_open_file.c | 2 +- libarchive/test/test_open_filename.c | 4 +- libarchive/test/test_pax_filename_encoding.c | 4 +- ...ar_multivolume_multiple_files.part1.rar.uu | 163 + ...ar_multivolume_multiple_files.part2.rar.uu | 163 + ...ar_multivolume_multiple_files.part3.rar.uu | 163 + ...ar_multivolume_multiple_files.part4.rar.uu | 163 + ...ar_multivolume_multiple_files.part5.rar.uu | 163 + ...ar_multivolume_multiple_files.part6.rar.uu | 117 + ...t_rar_multivolume_single_file.part1.rar.uu | 159 + ...t_rar_multivolume_single_file.part2.rar.uu | 159 + ...t_rar_multivolume_single_file.part3.rar.uu | 146 + ...ltivolume_uncompressed_files.part01.rar.uu | 299 ++ ...ltivolume_uncompressed_files.part02.rar.uu | 299 ++ ...ltivolume_uncompressed_files.part03.rar.uu | 299 ++ ...ltivolume_uncompressed_files.part04.rar.uu | 299 ++ ...ltivolume_uncompressed_files.part05.rar.uu | 299 ++ ...ltivolume_uncompressed_files.part06.rar.uu | 299 ++ ...ltivolume_uncompressed_files.part07.rar.uu | 299 ++ ...ltivolume_uncompressed_files.part08.rar.uu | 299 ++ ...ltivolume_uncompressed_files.part09.rar.uu | 299 ++ ...ltivolume_uncompressed_files.part10.rar.uu | 75 + libarchive/test/test_read_data_large.c | 2 +- libarchive/test/test_read_disk.c | 3 +- libarchive/test/test_read_extract.c | 2 +- libarchive/test/test_read_filter_grzip.c | 67 + .../test/test_read_filter_grzip.tar.grz.uu | 8 + libarchive/test/test_read_filter_lrzip.c | 67 + .../test/test_read_filter_lrzip.tar.lrz.uu | 10 + libarchive/test/test_read_filter_lzop.c | 74 + .../test/test_read_filter_lzop.tar.lzo.uu | 11 + .../test_read_filter_lzop_multiple_parts.c | 72 + ...read_filter_lzop_multiple_parts.tar.lzo.uu | 89 + libarchive/test/test_read_filter_program.c | 83 + .../test/test_read_filter_program_signature.c | 103 + libarchive/test/test_read_filter_uudecode.c | 178 ++ libarchive/test/test_read_format_7zip.c | 111 +- libarchive/test/test_read_format_ar.c | 2 +- libarchive/test/test_read_format_cab.c | 11 +- .../test/test_read_format_cab_filename.c | 4 +- libarchive/test/test_read_format_cpio_afio.c | 7 +- libarchive/test/test_read_format_cpio_bin.c | 2 +- libarchive/test/test_read_format_cpio_bin_Z.c | 8 +- .../test/test_read_format_cpio_bin_be.c | 2 +- .../test/test_read_format_cpio_bin_bz2.c | 2 +- .../test/test_read_format_cpio_bin_gz.c | 4 +- .../test/test_read_format_cpio_bin_lzip.c | 2 +- .../test/test_read_format_cpio_bin_lzma.c | 2 +- .../test/test_read_format_cpio_bin_xz.c | 2 +- .../test/test_read_format_cpio_filename.c | 32 +- libarchive/test/test_read_format_cpio_odc.c | 2 +- .../test_read_format_cpio_svr4_bzip2_rpm.c | 4 +- .../test/test_read_format_cpio_svr4_gzip.c | 4 +- .../test_read_format_cpio_svr4_gzip_rpm.c | 4 +- .../test/test_read_format_cpio_svr4c_Z.c | 6 +- libarchive/test/test_read_format_empty.c | 2 +- libarchive/test/test_read_format_gtar_gz.c | 4 +- libarchive/test/test_read_format_gtar_lzma.c | 2 +- libarchive/test/test_read_format_iso_Z.c | 8 +- .../test/test_read_format_iso_multi_extent.c | 2 +- .../test/test_read_format_iso_xorriso.c | 2 +- .../test/test_read_format_isojoliet_bz2.c | 2 +- .../test/test_read_format_isojoliet_long.c | 2 +- .../test/test_read_format_isojoliet_rr.c | 2 +- .../test_read_format_isojoliet_versioned.c | 2 +- libarchive/test/test_read_format_isorr_bz2.c | 2 +- libarchive/test/test_read_format_isorr_ce.c | 2 +- .../test/test_read_format_isorr_new_bz2.c | 2 +- .../test/test_read_format_isorr_rr_moved.c | 2 +- .../test/test_read_format_isozisofs_bz2.c | 2 +- libarchive/test/test_read_format_lha.c | 2 +- .../test/test_read_format_lha_filename.c | 6 +- libarchive/test/test_read_format_mtree.c | 301 +- .../test_read_format_mtree_nomagic2.mtree.uu | 10 + .../test_read_format_mtree_nomagic3.mtree.uu | 10 + libarchive/test/test_read_format_pax_bz2.c | 2 +- libarchive/test/test_read_format_rar.c | 2796 ++++++++++++++++- ...ead_format_rar_multivolume.part0001.rar.uu | 1337 ++++++++ ...ead_format_rar_multivolume.part0002.rar.uu | 1337 ++++++++ ...ead_format_rar_multivolume.part0003.rar.uu | 1337 ++++++++ ...ead_format_rar_multivolume.part0004.rar.uu | 208 ++ libarchive/test/test_read_format_tar.c | 22 +- .../test_read_format_tar_empty_filename.c | 2 +- libarchive/test/test_read_format_tbz.c | 2 +- libarchive/test/test_read_format_tgz.c | 4 +- libarchive/test/test_read_format_tlz.c | 2 +- libarchive/test/test_read_format_txz.c | 2 +- libarchive/test/test_read_format_tz.c | 6 +- libarchive/test/test_read_format_xar.c | 4 +- libarchive/test/test_read_format_zip.c | 4 +- .../test_read_format_zip_comment_stored.c | 66 + ...st_read_format_zip_comment_stored_1.zip.uu | 12 + ...st_read_format_zip_comment_stored_2.zip.uu | 548 ++++ .../test/test_read_format_zip_filename.c | 38 +- .../test/test_read_format_zip_mac_metadata.c | 118 + .../test_read_format_zip_mac_metadata.zip.uu | 17 + libarchive/test/test_read_format_zip_sfx.c | 59 + libarchive/test/test_read_format_zip_sfx.uu | 34 + .../test/test_read_large_splitted_rar_aa.uu | 892 ++++++ .../test/test_read_large_splitted_rar_ab.uu | 892 ++++++ .../test/test_read_large_splitted_rar_ac.uu | 892 ++++++ .../test/test_read_large_splitted_rar_ad.uu | 892 ++++++ .../test/test_read_large_splitted_rar_ae.uu | 375 +++ libarchive/test/test_read_pax_truncated.c | 2 +- libarchive/test/test_read_set_format.c | 220 ++ libarchive/test/test_read_splitted_rar_aa.uu | 6 + libarchive/test/test_read_splitted_rar_ab.uu | 6 + libarchive/test/test_read_splitted_rar_ac.uu | 6 + libarchive/test/test_read_splitted_rar_ad.uu | 4 + libarchive/test/test_read_truncated.c | 2 +- libarchive/test/test_read_truncated_filter.c | 75 +- libarchive/test/test_sparse_basic.c | 6 +- .../test/test_splitted_rar_seek_support_aa.uu | 159 + .../test/test_splitted_rar_seek_support_ab.uu | 159 + .../test/test_splitted_rar_seek_support_ac.uu | 141 + libarchive/test/test_tar_filenames.c | 2 +- libarchive/test/test_ustar_filenames.c | 2 +- libarchive/test/test_write_disk_appledouble.c | 212 ++ .../test_write_disk_appledouble.cpio.gz.uu | 12 + .../test/test_write_disk_hfs_compression.c | 278 ++ .../test_write_disk_hfs_compression.tgz.uu | 1800 +++++++++++ .../test/test_write_disk_mac_metadata.c | 194 ++ .../test_write_disk_mac_metadata.tar.gz.uu | 14 + .../test/test_write_disk_no_hfs_compression.c | 231 ++ .../test_write_disk_no_hfs_compression.tgz.uu | 1765 +++++++++++ libarchive/test/test_write_disk_sparse.c | 14 +- libarchive/test/test_write_filter_b64encode.c | 173 + libarchive/test/test_write_filter_bzip2.c | 276 ++ libarchive/test/test_write_filter_compress.c | 97 + libarchive/test/test_write_filter_gzip.c | 272 ++ .../test/test_write_filter_gzip_timestamp.c | 118 + libarchive/test/test_write_filter_lrzip.c | 131 + libarchive/test/test_write_filter_lzip.c | 255 ++ libarchive/test/test_write_filter_lzma.c | 259 ++ libarchive/test/test_write_filter_lzop.c | 267 ++ libarchive/test/test_write_filter_program.c | 124 + libarchive/test/test_write_filter_uuencode.c | 173 + libarchive/test/test_write_filter_xz.c | 265 ++ libarchive/test/test_write_format_7zip.c | 326 +- .../test/test_write_format_7zip_empty.c | 299 ++ .../test/test_write_format_7zip_large.c | 174 + libarchive/test/test_write_format_ar.c | 6 +- libarchive/test/test_write_format_cpio.c | 4 +- .../test/test_write_format_cpio_empty.c | 2 +- libarchive/test/test_write_format_cpio_newc.c | 2 +- libarchive/test/test_write_format_cpio_odc.c | 2 +- libarchive/test/test_write_format_gnutar.c | 2 +- libarchive/test/test_write_format_iso9660.c | 2 +- .../test/test_write_format_iso9660_boot.c | 2 +- .../test/test_write_format_iso9660_empty.c | 4 +- .../test/test_write_format_iso9660_filename.c | 8 +- .../test/test_write_format_iso9660_zisofs.c | 15 +- libarchive/test/test_write_format_mtree.c | 2 +- .../test_write_format_mtree_absolute_path.c | 99 + .../test/test_write_format_mtree_classic.c | 194 ++ .../test_write_format_mtree_classic_indent.c | 196 ++ .../test/test_write_format_mtree_fflags.c | 1 + .../test_write_format_mtree_no_separator.c | 103 + .../test_write_format_mtree_quoted_filename.c | 86 + libarchive/test/test_write_format_pax.c | 2 +- .../test/test_write_format_shar_empty.c | 2 +- libarchive/test/test_write_format_tar.c | 2 +- libarchive/test/test_write_format_tar_empty.c | 4 +- .../test/test_write_format_tar_sparse.c | 6 +- libarchive/test/test_write_format_tar_ustar.c | 2 +- libarchive/test/test_write_format_tar_v7tar.c | 259 ++ libarchive/test/test_write_format_xar.c | 2 +- libarchive/test/test_write_format_xar_empty.c | 2 +- libarchive/test/test_write_format_zip.c | 2 +- libarchive/test/test_write_format_zip_empty.c | 2 +- .../test_write_format_zip_no_compression.c | 2 +- libarchive/test/test_write_open_memory.c | 6 +- .../test_write_zip_set_compression_store.c | 308 ++ tar/CMakeLists.txt | 1 + tar/bsdtar.1 | 91 +- tar/bsdtar.c | 191 +- tar/bsdtar.h | 36 +- tar/cmdline.c | 16 +- tar/creation_set.c | 314 ++ tar/read.c | 36 +- tar/subst.c | 8 +- tar/test/CMakeLists.txt | 23 + tar/test/main.c | 246 +- tar/test/test.h | 22 +- tar/test/test_basic.c | 6 + tar/test/test_copy.c | 7 +- tar/test/test_extract.tar.Z.uu | 9 + tar/test/test_extract.tar.bz2.uu | 7 + tar/test/test_extract.tar.grz.uu | 7 + tar/test/test_extract.tar.gz.uu | 7 + tar/test/test_extract.tar.lrz.uu | 9 + tar/test/test_extract.tar.lz.uu | 7 + tar/test/test_extract.tar.lzma.uu | 7 + tar/test/test_extract.tar.lzo.uu | 9 + tar/test/test_extract.tar.xz.uu | 8 + tar/test/test_extract_tar_Z.c | 42 + tar/test/test_extract_tar_bz2.c | 48 + tar/test/test_extract_tar_grz.c | 48 + tar/test/test_extract_tar_gz.c | 48 + tar/test/test_extract_tar_lrz.c | 48 + tar/test/test_extract_tar_lz.c | 48 + tar/test/test_extract_tar_lzma.c | 48 + tar/test/test_extract_tar_lzo.c | 48 + tar/test/test_extract_tar_xz.c | 48 + tar/test/test_option_a.c | 110 + tar/test/test_option_b64encode.c | 54 + tar/test/test_option_grzip.c | 52 + tar/test/test_option_j.c | 56 + tar/test/test_option_lrzip.c | 52 + tar/test/test_option_lzma.c | 57 + tar/test/test_option_lzop.c | 55 + tar/test/test_option_newer_than.c | 7 +- tar/test/test_option_older_than.c | 85 + tar/test/test_option_r.c | 7 +- tar/test/test_option_uuencode.c | 54 + tar/test/test_option_xz.c | 57 + tar/test/test_option_z.c | 55 + tar/test/test_stdio.c | 2 +- tar/test/test_windows.c | 19 +- tar/util.c | 24 +- tar/write.c | 152 +- test_utils/test_utils.c | 124 + test_utils/test_utils.h | 39 + 410 files changed, 43427 insertions(+), 3159 deletions(-) create mode 100644 build/README.txt create mode 100644 build/cmake/FindLibGCC.cmake create mode 100644 build/cmake/FindNettle.cmake create mode 100644 build/cmake/FindPCREPOSIX.cmake create mode 100644 build/cmake/LibarchiveCheckCSourceCompiles.cmake create mode 100644 build/cmake/LibarchiveCheckCSourceRuns.cmake create mode 100644 cpio/test/test_extract.cpio.Z.uu create mode 100644 cpio/test/test_extract.cpio.bz2.uu create mode 100644 cpio/test/test_extract.cpio.grz.uu create mode 100644 cpio/test/test_extract.cpio.gz.uu create mode 100644 cpio/test/test_extract.cpio.lrz.uu create mode 100644 cpio/test/test_extract.cpio.lz.uu create mode 100644 cpio/test/test_extract.cpio.lzma.uu create mode 100644 cpio/test/test_extract.cpio.lzo.uu create mode 100644 cpio/test/test_extract.cpio.xz.uu create mode 100644 cpio/test/test_extract_cpio_Z.c create mode 100644 cpio/test/test_extract_cpio_bz2.c create mode 100644 cpio/test/test_extract_cpio_grz.c create mode 100644 cpio/test/test_extract_cpio_gz.c create mode 100644 cpio/test/test_extract_cpio_lrz.c create mode 100644 cpio/test/test_extract_cpio_lz.c create mode 100644 cpio/test/test_extract_cpio_lzma.c create mode 100644 cpio/test/test_extract_cpio_lzo.c create mode 100644 cpio/test/test_extract_cpio_xz.c create mode 100644 cpio/test/test_option_b64encode.c create mode 100644 cpio/test/test_option_grzip.c create mode 100644 cpio/test/test_option_lrzip.c create mode 100644 cpio/test/test_option_lzop.c create mode 100644 cpio/test/test_option_uuencode.c create mode 100644 cpio/test/test_option_xz.c create mode 100644 libarchive/archive_cmdline.c create mode 100644 libarchive/archive_cmdline_private.h create mode 100644 libarchive/archive_read_append_filter.c create mode 100644 libarchive/archive_read_set_format.c create mode 100644 libarchive/archive_read_support_filter_grzip.c create mode 100644 libarchive/archive_read_support_filter_lrzip.c create mode 100644 libarchive/archive_read_support_filter_lzop.c create mode 100644 libarchive/archive_write_add_filter_b64encode.c create mode 100644 libarchive/archive_write_add_filter_by_name.c create mode 100644 libarchive/archive_write_add_filter_grzip.c create mode 100644 libarchive/archive_write_add_filter_lrzip.c create mode 100644 libarchive/archive_write_add_filter_lzop.c create mode 100644 libarchive/archive_write_add_filter_uuencode.c create mode 100644 libarchive/archive_write_disk_acl.c create mode 100644 libarchive/archive_write_set_format_v7tar.c create mode 100644 libarchive/filter_fork_posix.c create mode 100644 libarchive/test/test_acl_freebsd_nfs4.c create mode 100644 libarchive/test/test_acl_freebsd_posix1e.c create mode 100644 libarchive/test/test_archive_cmdline.c create mode 100644 libarchive/test/test_archive_read_multiple_data_objects.c create mode 100644 libarchive/test/test_archive_write_add_filter_by_name.c create mode 100644 libarchive/test/test_archive_write_set_format_by_name.c create mode 100644 libarchive/test/test_compat_lzop.c create mode 100644 libarchive/test/test_compat_lzop_1.tar.lzo.uu create mode 100644 libarchive/test/test_compat_lzop_2.tar.lzo.uu create mode 100644 libarchive/test/test_compat_lzop_3.tar.lzo.uu create mode 100644 libarchive/test/test_compat_uudecode.c create mode 100644 libarchive/test/test_rar_multivolume_multiple_files.part1.rar.uu create mode 100644 libarchive/test/test_rar_multivolume_multiple_files.part2.rar.uu create mode 100644 libarchive/test/test_rar_multivolume_multiple_files.part3.rar.uu create mode 100644 libarchive/test/test_rar_multivolume_multiple_files.part4.rar.uu create mode 100644 libarchive/test/test_rar_multivolume_multiple_files.part5.rar.uu create mode 100644 libarchive/test/test_rar_multivolume_multiple_files.part6.rar.uu create mode 100644 libarchive/test/test_rar_multivolume_single_file.part1.rar.uu create mode 100644 libarchive/test/test_rar_multivolume_single_file.part2.rar.uu create mode 100644 libarchive/test/test_rar_multivolume_single_file.part3.rar.uu create mode 100644 libarchive/test/test_rar_multivolume_uncompressed_files.part01.rar.uu create mode 100644 libarchive/test/test_rar_multivolume_uncompressed_files.part02.rar.uu create mode 100644 libarchive/test/test_rar_multivolume_uncompressed_files.part03.rar.uu create mode 100644 libarchive/test/test_rar_multivolume_uncompressed_files.part04.rar.uu create mode 100644 libarchive/test/test_rar_multivolume_uncompressed_files.part05.rar.uu create mode 100644 libarchive/test/test_rar_multivolume_uncompressed_files.part06.rar.uu create mode 100644 libarchive/test/test_rar_multivolume_uncompressed_files.part07.rar.uu create mode 100644 libarchive/test/test_rar_multivolume_uncompressed_files.part08.rar.uu create mode 100644 libarchive/test/test_rar_multivolume_uncompressed_files.part09.rar.uu create mode 100644 libarchive/test/test_rar_multivolume_uncompressed_files.part10.rar.uu create mode 100644 libarchive/test/test_read_filter_grzip.c create mode 100644 libarchive/test/test_read_filter_grzip.tar.grz.uu create mode 100644 libarchive/test/test_read_filter_lrzip.c create mode 100644 libarchive/test/test_read_filter_lrzip.tar.lrz.uu create mode 100644 libarchive/test/test_read_filter_lzop.c create mode 100644 libarchive/test/test_read_filter_lzop.tar.lzo.uu create mode 100644 libarchive/test/test_read_filter_lzop_multiple_parts.c create mode 100644 libarchive/test/test_read_filter_lzop_multiple_parts.tar.lzo.uu create mode 100644 libarchive/test/test_read_filter_program.c create mode 100644 libarchive/test/test_read_filter_program_signature.c create mode 100644 libarchive/test/test_read_filter_uudecode.c create mode 100644 libarchive/test/test_read_format_mtree_nomagic2.mtree.uu create mode 100644 libarchive/test/test_read_format_mtree_nomagic3.mtree.uu create mode 100644 libarchive/test/test_read_format_rar_multivolume.part0001.rar.uu create mode 100644 libarchive/test/test_read_format_rar_multivolume.part0002.rar.uu create mode 100644 libarchive/test/test_read_format_rar_multivolume.part0003.rar.uu create mode 100644 libarchive/test/test_read_format_rar_multivolume.part0004.rar.uu create mode 100644 libarchive/test/test_read_format_zip_comment_stored.c create mode 100644 libarchive/test/test_read_format_zip_comment_stored_1.zip.uu create mode 100644 libarchive/test/test_read_format_zip_comment_stored_2.zip.uu create mode 100644 libarchive/test/test_read_format_zip_mac_metadata.c create mode 100644 libarchive/test/test_read_format_zip_mac_metadata.zip.uu create mode 100644 libarchive/test/test_read_format_zip_sfx.c create mode 100644 libarchive/test/test_read_format_zip_sfx.uu create mode 100644 libarchive/test/test_read_large_splitted_rar_aa.uu create mode 100644 libarchive/test/test_read_large_splitted_rar_ab.uu create mode 100644 libarchive/test/test_read_large_splitted_rar_ac.uu create mode 100644 libarchive/test/test_read_large_splitted_rar_ad.uu create mode 100644 libarchive/test/test_read_large_splitted_rar_ae.uu create mode 100644 libarchive/test/test_read_set_format.c create mode 100644 libarchive/test/test_read_splitted_rar_aa.uu create mode 100644 libarchive/test/test_read_splitted_rar_ab.uu create mode 100644 libarchive/test/test_read_splitted_rar_ac.uu create mode 100644 libarchive/test/test_read_splitted_rar_ad.uu create mode 100644 libarchive/test/test_splitted_rar_seek_support_aa.uu create mode 100644 libarchive/test/test_splitted_rar_seek_support_ab.uu create mode 100644 libarchive/test/test_splitted_rar_seek_support_ac.uu create mode 100644 libarchive/test/test_write_disk_appledouble.c create mode 100644 libarchive/test/test_write_disk_appledouble.cpio.gz.uu create mode 100644 libarchive/test/test_write_disk_hfs_compression.c create mode 100644 libarchive/test/test_write_disk_hfs_compression.tgz.uu create mode 100644 libarchive/test/test_write_disk_mac_metadata.c create mode 100644 libarchive/test/test_write_disk_mac_metadata.tar.gz.uu create mode 100644 libarchive/test/test_write_disk_no_hfs_compression.c create mode 100644 libarchive/test/test_write_disk_no_hfs_compression.tgz.uu create mode 100644 libarchive/test/test_write_filter_b64encode.c create mode 100644 libarchive/test/test_write_filter_bzip2.c create mode 100644 libarchive/test/test_write_filter_compress.c create mode 100644 libarchive/test/test_write_filter_gzip.c create mode 100644 libarchive/test/test_write_filter_gzip_timestamp.c create mode 100644 libarchive/test/test_write_filter_lrzip.c create mode 100644 libarchive/test/test_write_filter_lzip.c create mode 100644 libarchive/test/test_write_filter_lzma.c create mode 100644 libarchive/test/test_write_filter_lzop.c create mode 100644 libarchive/test/test_write_filter_program.c create mode 100644 libarchive/test/test_write_filter_uuencode.c create mode 100644 libarchive/test/test_write_filter_xz.c create mode 100644 libarchive/test/test_write_format_7zip_empty.c create mode 100644 libarchive/test/test_write_format_7zip_large.c create mode 100644 libarchive/test/test_write_format_mtree_absolute_path.c create mode 100644 libarchive/test/test_write_format_mtree_classic.c create mode 100644 libarchive/test/test_write_format_mtree_classic_indent.c create mode 100644 libarchive/test/test_write_format_mtree_no_separator.c create mode 100644 libarchive/test/test_write_format_mtree_quoted_filename.c create mode 100644 libarchive/test/test_write_format_tar_v7tar.c create mode 100644 libarchive/test/test_write_zip_set_compression_store.c create mode 100644 tar/creation_set.c create mode 100644 tar/test/test_extract.tar.Z.uu create mode 100644 tar/test/test_extract.tar.bz2.uu create mode 100644 tar/test/test_extract.tar.grz.uu create mode 100644 tar/test/test_extract.tar.gz.uu create mode 100644 tar/test/test_extract.tar.lrz.uu create mode 100644 tar/test/test_extract.tar.lz.uu create mode 100644 tar/test/test_extract.tar.lzma.uu create mode 100644 tar/test/test_extract.tar.lzo.uu create mode 100644 tar/test/test_extract.tar.xz.uu create mode 100644 tar/test/test_extract_tar_Z.c create mode 100644 tar/test/test_extract_tar_bz2.c create mode 100644 tar/test/test_extract_tar_grz.c create mode 100644 tar/test/test_extract_tar_gz.c create mode 100644 tar/test/test_extract_tar_lrz.c create mode 100644 tar/test/test_extract_tar_lz.c create mode 100644 tar/test/test_extract_tar_lzma.c create mode 100644 tar/test/test_extract_tar_lzo.c create mode 100644 tar/test/test_extract_tar_xz.c create mode 100644 tar/test/test_option_a.c create mode 100644 tar/test/test_option_b64encode.c create mode 100644 tar/test/test_option_grzip.c create mode 100644 tar/test/test_option_j.c create mode 100644 tar/test/test_option_lrzip.c create mode 100644 tar/test/test_option_lzma.c create mode 100644 tar/test/test_option_lzop.c create mode 100644 tar/test/test_option_older_than.c create mode 100644 tar/test/test_option_uuencode.c create mode 100644 tar/test/test_option_xz.c create mode 100644 tar/test/test_option_z.c create mode 100644 test_utils/test_utils.c create mode 100644 test_utils/test_utils.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 5cc5d605c05c..2cdb9fb48585 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -63,8 +63,8 @@ SET(LIBARCHIVE_VERSION_STRING "${VERSION}") # libarchive 2.8 == interface version 10 = 2 + 8 # libarchive 2.9 == interface version 11 = 2 + 9 # libarchive 3.0 == interface version 12 -# libarchive 3.x == interface version 12 + x -math(EXPR INTERFACE_VERSION "12 + ${_minor}") +# libarchive 3.1 == interface version 13 +math(EXPR INTERFACE_VERSION "13 + ${_minor}") # Set SOVERSION == Interface version # ?? Should there be more here ?? @@ -151,27 +151,55 @@ OPTION(ENABLE_XATTR "Enable extended attribute support" ON) OPTION(ENABLE_ACL "Enable ACL support" ON) OPTION(ENABLE_ICONV "Enable iconv support" ON) OPTION(ENABLE_TEST "Enable unit and regression tests" 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 "" CACHE STRING "Set Windows version to use (Windows only)") IF(ENABLE_TEST) ENABLE_TESTING() ENDIF(ENABLE_TEST) IF(WIN32) - IF(MSVC60) - SET(WINVER 0x0400) - ELSE() + IF(WINDOWS_VERSION STREQUAL "WIN8") + SET(WINVER 0x0602) + ELSEIF(WINDOWS_VERSION STREQUAL "WIN7") + SET(WINVER 0x0601) + ELSEIF(WINDOWS_VERSION STREQUAL "WS08") + SET(WINVER 0x0600) + ELSEIF(WINDOWS_VERSION STREQUAL "VISTA") + SET(WINVER 0x0600) + ELSEIF(WINDOWS_VERSION STREQUAL "WS03") + SET(WINVER 0x0502) + ELSEIF(WINDOWS_VERSION STREQUAL "WINXP") + SET(WINVER 0x0501) + ELSE(WINDOWS_VERSION STREQUAL "WIN8") + # The default is to use Windows 2000 API. SET(WINVER 0x0500) - ENDIF() + ENDIF(WINDOWS_VERSION STREQUAL "WIN8") SET(_WIN32_WINNT ${WINVER}) ENDIF(WIN32) +IF(MSVC) + IF(ENABLE_SAFESEH STREQUAL "YES") + SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SAFESEH") + SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /SAFESEH") + SET(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /SAFESEH") + SET(CMAKE_REQUIRED_LINKER_FLAGS "/SAFESEH") + ELSEIF(ENABLE_SAFESEH STREQUAL "NO") + SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /SAFESEH:NO") + SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /SAFESEH:NO") + SET(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /SAFESEH:NO") + SET(CMAKE_REQUIRED_LINKER_FLAGS "/SAFESEH:NO") + ENDIF(ENABLE_SAFESEH STREQUAL "YES") +ENDIF(MSVC) + IF("${CMAKE_C_PLATFORM_ID}" MATCHES "^(HP-UX)$") ADD_DEFINITIONS(-D_XOPEN_SOURCE=500) # Ask wchar.h for mbstate_t ENDIF() # -INCLUDE(CheckCSourceCompiles) -INCLUDE(CheckCSourceRuns) +INCLUDE(LibarchiveCheckCSourceCompiles) +INCLUDE(LibarchiveCheckCSourceRuns) INCLUDE(CheckFileOffsetBits) INCLUDE(CheckFuncs) INCLUDE(CheckHeaderDirent) @@ -235,9 +263,9 @@ MACRO (TRY_MACRO_FOR_LIBRARY INCLUDES LIBRARIES ENDIF(NOT "${PREV_VAR_WITH_LIB}" STREQUAL "${LIBRARIES}") # Check if the library can be used with the macro. IF("${TRY_TYPE}" MATCHES "COMPILES") - CHECK_C_SOURCE_COMPILES("${SAMPLE_SOURCE}" ${VAR}) + LIBARCHIVE_CHECK_C_SOURCE_COMPILES("${SAMPLE_SOURCE}" ${VAR}) ELSEIF("${TRY_TYPE}" MATCHES "RUNS") - CHECK_C_SOURCE_RUNS("${SAMPLE_SOURCE}" ${VAR}) + LIBARCHIVE_CHECK_C_SOURCE_RUNS("${SAMPLE_SOURCE}" ${VAR}) ELSE("${TRY_TYPE}" MATCHES "COMPILES") MESSAGE(FATAL_ERROR "UNKNOWN KEYWORD \"${TRY_TYPE}\" FOR TRY_TYPE") ENDIF("${TRY_TYPE}" MATCHES "COMPILES") @@ -366,6 +394,30 @@ ELSEIF(LZMADEC_FOUND) INCLUDE_DIRECTORIES(${LZMADEC_INCLUDE_DIR}) LIST(APPEND ADDITIONAL_LIBS ${LZMADEC_LIBRARIES}) ENDIF(LZMA_FOUND) +# +# Find LZO2 +# +IF (LZO2_INCLUDE_DIR) + # Already in cache, be silent + SET(LZO2_FIND_QUIETLY TRUE) +ENDIF (LZO2_INCLUDE_DIR) + +FIND_PATH(LZO2_INCLUDE_DIR lzo/lzoconf.h) +FIND_LIBRARY(LZO2_LIBRARY NAMES lzo2 liblzo2) +INCLUDE(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(LZO2 DEFAULT_MSG LZO2_LIBRARY LZO2_INCLUDE_DIR) +IF(LZO2_FOUND) + SET(HAVE_LIBLZO2 1) + SET(HAVE_LZO_LZOCONF_H 1) + SET(HAVE_LZO_LZO1X_H 1) + INCLUDE_DIRECTORIES(${LZO2_INCLUDE_DIR}) + LIST(APPEND ADDITIONAL_LIBS ${LZO2_LIBRARY}) + # + # TODO: test for static library. + # +ENDIF(LZO2_FOUND) +MARK_AS_ADVANCED(CLEAR LZO2_INCLUDE_DIR) +MARK_AS_ADVANCED(CLEAR LZO2_LIBRARY) # # Check headers @@ -392,7 +444,7 @@ LA_CHECK_INCLUDE_FILE("dlfcn.h" HAVE_DLFCN_H) LA_CHECK_INCLUDE_FILE("errno.h" HAVE_ERRNO_H) LA_CHECK_INCLUDE_FILE("ext2fs/ext2_fs.h" HAVE_EXT2FS_EXT2_FS_H) -CHECK_C_SOURCE_COMPILES("#include +LIBARCHIVE_CHECK_C_SOURCE_COMPILES("#include #include int main(void) { return EXT2_IOC_GETFLAGS; }" HAVE_WORKING_EXT2_IOC_GETFLAGS) @@ -414,6 +466,7 @@ LA_CHECK_INCLUDE_FILE("process.h" HAVE_PROCESS_H) LA_CHECK_INCLUDE_FILE("pwd.h" HAVE_PWD_H) LA_CHECK_INCLUDE_FILE("regex.h" HAVE_REGEX_H) LA_CHECK_INCLUDE_FILE("signal.h" HAVE_SIGNAL_H) +LA_CHECK_INCLUDE_FILE("spawn.h" HAVE_SPAWN_H) LA_CHECK_INCLUDE_FILE("stdarg.h" HAVE_STDARG_H) LA_CHECK_INCLUDE_FILE("stdint.h" HAVE_STDINT_H) LA_CHECK_INCLUDE_FILE("stdlib.h" HAVE_STDLIB_H) @@ -454,7 +507,7 @@ FOREACH (it ${_HEADER}) SET(_INCLUDE_FILES "${_INCLUDE_FILES}#include <${it}>\n") ENDFOREACH (it) -CHECK_C_SOURCE_COMPILES( +LIBARCHIVE_CHECK_C_SOURCE_COMPILES( "#define __EXTENSIONS__ 1 ${_INCLUDE_FILES} int main() { return 0;}" @@ -464,16 +517,17 @@ CHECK_C_SOURCE_COMPILES( # Find Nettle # IF(ENABLE_NETTLE) - CHECK_LIBRARY_EXISTS(nettle "nettle_sha1_digest" "" NETTLE_FOUND) + FIND_PACKAGE(Nettle) IF(NETTLE_FOUND) - CMAKE_PUSH_CHECK_STATE() # Save the state of the variables - SET(CMAKE_REQUIRED_LIBRARIES "nettle") - FIND_LIBRARY(NETTLE_LIBRARY NAMES nettle) - LIST(APPEND ADDITIONAL_LIBS ${NETTLE_LIBRARY}) - CMAKE_POP_CHECK_STATE() # Restore the state of the variables - ELSE(NETTLE_FOUND) - SET(ENABLE_NETTLE OFF) + SET(HAVE_LIBNETTLE 1) + SET(HAVE_NETTLE_MD5_H 1) + SET(HAVE_NETTLE_RIPEMD160_H 1) + SET(HAVE_NETTLE_SHA_H 1) + INCLUDE_DIRECTORIES(${NETTLE_INCLUDE_DIR}) + LIST(APPEND ADDITIONAL_LIBS ${NETTLE_LIBRARIES}) ENDIF(NETTLE_FOUND) + MARK_AS_ADVANCED(CLEAR NETTLE_INCLUDE_DIR) + MARK_AS_ADVANCED(CLEAR NETTLE_LIBRARIES) ENDIF(ENABLE_NETTLE) # @@ -487,14 +541,16 @@ ELSE() ENDIF() # FreeBSD libmd -CHECK_LIBRARY_EXISTS(md "MD5Init" "" LIBMD_FOUND) -IF(LIBMD_FOUND) - CMAKE_PUSH_CHECK_STATE() # Save the state of the variables - SET(CMAKE_REQUIRED_LIBRARIES "md") - FIND_LIBRARY(LIBMD_LIBRARY NAMES md) - LIST(APPEND ADDITIONAL_LIBS ${LIBMD_LIBRARY}) - CMAKE_POP_CHECK_STATE() # Restore the state of the variables -ENDIF(LIBMD_FOUND) +IF(NOT OPENSSL_FOUND) + CHECK_LIBRARY_EXISTS(md "MD5Init" "" LIBMD_FOUND) + IF(LIBMD_FOUND) + CMAKE_PUSH_CHECK_STATE() # Save the state of the variables + SET(CMAKE_REQUIRED_LIBRARIES "md") + FIND_LIBRARY(LIBMD_LIBRARY NAMES md) + LIST(APPEND ADDITIONAL_LIBS ${LIBMD_LIBRARY}) + CMAKE_POP_CHECK_STATE() # Restore the state of the variables + ENDIF(LIBMD_FOUND) +ENDIF(NOT OPENSSL_FOUND) # # How to prove that CRYPTO functions, which have several names on various @@ -502,13 +558,8 @@ ENDIF(LIBMD_FOUND) # required libraries. # MACRO(CHECK_CRYPTO ALGORITHMS IMPLEMENTATION) - IF(HAVE_SYS_TYPES_H) - SET(CRYPTO_HEADER_CONFIG "#define HAVE_SYS_TYPES_H 1\n") - ELSE(HAVE_SYS_TYPES_H) - SET(CRYPTO_HEADER_CONFIG "") - ENDIF(HAVE_SYS_TYPES_H) - FOREACH(ALGORITHM ${ALGORITHMS}) + IF(NOT ARCHIVE_CRYPTO_${ALGORITHM}) STRING(TOLOWER "${ALGORITHM}" lower_algorithm) STRING(TOUPPER "${ALGORITHM}" algorithm) IF ("${IMPLEMENTATION}" MATCHES "^OPENSSL$" AND NOT OPENSSL_FOUND) @@ -521,7 +572,7 @@ MACRO(CHECK_CRYPTO ALGORITHMS IMPLEMENTATION) # Probe the local implementation for whether this # crypto implementation is available on this platform. SET(TRY_CRYPTO_REQUIRED_INCLUDES - "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_CURRENT_SOURCE_DIR}/libarchive;${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp") + "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_BINARY_DIR};${CMAKE_CURRENT_SOURCE_DIR}/libarchive;${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp") SET(TRY_CRYPTO_REQUIRED_LIBS) IF ("${IMPLEMENTATION}" MATCHES "^OPENSSL$" AND OPENSSL_FOUND) SET(TRY_CRYPTO_REQUIRED_INCLUDES @@ -529,6 +580,8 @@ MACRO(CHECK_CRYPTO ALGORITHMS IMPLEMENTATION) SET(TRY_CRYPTO_REQUIRED_LIBS "-DLINK_LIBRARIES:STRING=${OPENSSL_LIBRARIES}") ELSEIF("${IMPLEMENTATION}" MATCHES "^NETTLE$" AND NETTLE_FOUND) + SET(TRY_CRYPTO_REQUIRED_INCLUDES + "${TRY_CRYPTO_REQUIRED_INCLUDES};${NETTLE_INCLUDE_DIR}") SET(TRY_CRYPTO_REQUIRED_LIBS "-DLINK_LIBRARIES:STRING=${NETTLE_LIBRARY}") ELSEIF("${IMPLEMENTATION}" MATCHES "^LIBMD$" AND LIBMD_FOUND) @@ -536,10 +589,15 @@ MACRO(CHECK_CRYPTO ALGORITHMS IMPLEMENTATION) "-DLINK_LIBRARIES:STRING=${LIBMD_LIBRARY}") ENDIF("${IMPLEMENTATION}" MATCHES "^OPENSSL$" AND OPENSSL_FOUND) + CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/build/cmake/config.h.in + ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/confdefs.h) + FILE(READ "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/confdefs.h" + CONFDEFS_H) FILE(READ "${CMAKE_CURRENT_SOURCE_DIR}/libarchive/archive_crypto.c" ARCHIVE_CRYPTO_C) - SET(SOURCE " + SET(SOURCE "${CONFDEFS_H} + #define ARCHIVE_${algorithm}_COMPILE_TEST #define ARCHIVE_CRYPTO_${algorithm}_${IMPLEMENTATION} #define PLATFORM_CONFIG_H \"check_crypto_md.h\" @@ -561,10 +619,16 @@ main(int argc, char **argv) FILE(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/check_crypto_md.c" "${SOURCE}") MESSAGE(STATUS "Checking support for ARCHIVE_CRYPTO_${ALGORITHM}_${IMPLEMENTATION}") + IF(CMAKE_REQUIRED_LINKER_FLAGS) + SET(CHECK_CRYPTO_ADD_LINKER_FLAGS + "-DCMAKE_EXE_LINKER_FLAGS:STRING=${CMAKE_REQUIRED_LINKER_FLAGS} -DCMAKE_SHARED_LINKER_FLAGS:STRING=${CMAKE_REQUIRED_LINKER_FLAGS} -DCMAKE_MODULE_LINKER_FLAGS:STRING=${CMAKE_REQUIRED_LINKER_FLAGS}") + ELSE(CMAKE_REQUIRED_LINKER_FLAGS) + SET(CHECK_CRYPTO_ADD_LINKER_FLAGS) + ENDIF(CMAKE_REQUIRED_LINKER_FLAGS) TRY_COMPILE(ARCHIVE_CRYPTO_${ALGORITHM}_${IMPLEMENTATION} ${CMAKE_BINARY_DIR} ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/check_crypto_md.c - CMAKE_FLAGS + CMAKE_FLAGS ${CHECK_CRYPTO_ADD_LINKER_FLAGS} "${TRY_CRYPTO_REQUIRED_LIBS}" "${TRY_CRYPTO_REQUIRED_INCLUDES}" OUTPUT_VARIABLE OUTPUT) @@ -572,6 +636,7 @@ main(int argc, char **argv) # Inform user whether or not we found it; if not, log why we didn't. IF (ARCHIVE_CRYPTO_${ALGORITHM}_${IMPLEMENTATION}) MESSAGE(STATUS "Checking support for ARCHIVE_CRYPTO_${ALGORITHM}_${IMPLEMENTATION} -- found") + SET(ARCHIVE_CRYPTO_${ALGORITHM} 1) ELSE (ARCHIVE_CRYPTO_${ALGORITHM}_${IMPLEMENTATION}) MESSAGE(STATUS "Checking support for ARCHIVE_CRYPTO_${ALGORITHM}_${IMPLEMENTATION} -- not found") FILE(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log @@ -590,6 +655,7 @@ main(int argc, char **argv) LIST(REMOVE_DUPLICATES ADDITIONAL_LIBS) ENDIF ("${IMPLEMENTATION}" MATCHES "^OPENSSL$" AND OPENSSL_FOUND) ENDIF (ARCHIVE_CRYPTO_${ALGORITHM}_${IMPLEMENTATION}) + ENDIF(NOT ARCHIVE_CRYPTO_${ALGORITHM}) ENDFOREACH(ALGORITHM ${ALGORITHMS}) ENDMACRO(CHECK_CRYPTO ALGORITHMS IMPLEMENTATION) @@ -605,6 +671,7 @@ ENDMACRO(CHECK_CRYPTO ALGORITHMS IMPLEMENTATION) MACRO(CHECK_CRYPTO_WIN CRYPTO_LIST) IF(WIN32 AND NOT CYGWIN) FOREACH(CRYPTO ${CRYPTO_LIST}) + IF(NOT ARCHIVE_CRYPTO_${CRYPTO}) IF(NOT DEFINED ARCHIVE_CRYPTO_${CRYPTO}_WIN) STRING(TOUPPER "${CRYPTO}" crypto) SET(ALGID "") @@ -624,9 +691,14 @@ MACRO(CHECK_CRYPTO_WIN CRYPTO_LIST) SET(ALGID "CALG_SHA_512") ENDIF ("${CRYPTO}" MATCHES "^SHA512$") - SET(SOURCE "#define ${crypto}_COMPILE_TEST -#define _WIN32_WINNT ${_WIN32_WINNT} -#define WINVER ${WINVER} + CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/build/cmake/config.h.in + ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/confdefs.h) + FILE(READ "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/confdefs.h" + CONFDEFS_H) + + SET(SOURCE "${CONFDEFS_H} + +#define ${crypto}_COMPILE_TEST #include #include @@ -641,15 +713,22 @@ main(int argc, char **argv) FILE(WRITE "${SOURCE_FILE}" "${SOURCE}") MESSAGE(STATUS "Checking support for ARCHIVE_CRYPTO_${CRYPTO}_WIN") + IF(CMAKE_REQUIRED_LINKER_FLAGS) + SET(CHECK_CRYPTO_WIN_ADD_LINKER_FLAGS + "-DCMAKE_EXE_LINKER_FLAGS:STRING=${CMAKE_REQUIRED_LINKER_FLAGS} -DCMAKE_SHARED_LINKER_FLAGS:STRING=${CMAKE_REQUIRED_LINKER_FLAGS} -DCMAKE_MODULE_LINKER_FLAGS:STRING=${CMAKE_REQUIRED_LINKER_FLAGS}") + ELSE(CMAKE_REQUIRED_LINKER_FLAGS) + SET(CHECK_CRYPTO_WIN_ADD_LINKER_FLAGS) + ENDIF(CMAKE_REQUIRED_LINKER_FLAGS) TRY_COMPILE(ARCHIVE_CRYPTO_${CRYPTO}_WIN ${CMAKE_BINARY_DIR} ${SOURCE_FILE} - CMAKE_FLAGS "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_CURRENT_SOURCE_DIR}/libarchive" + CMAKE_FLAGS "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_BINARY_DIR};${CMAKE_CURRENT_SOURCE_DIR}/libarchive" ${CHECK_CRYPTO_WIN_ADD_LINKER_FLAGS} OUTPUT_VARIABLE OUTPUT) IF (ARCHIVE_CRYPTO_${CRYPTO}_WIN) MESSAGE(STATUS "Checking support for ARCHIVE_CRYPTO_${CRYPTO}_WIN -- found") + SET(ARCHIVE_CRYPTO_${CRYPTO} 1) ELSE (ARCHIVE_CRYPTO_${CRYPTO}_WIN) MESSAGE(STATUS "Checking support for ARCHIVE_CRYPTO_${CRYPTO}_WIN -- not found") @@ -661,6 +740,7 @@ main(int argc, char **argv) ENDIF (ARCHIVE_CRYPTO_${CRYPTO}_WIN) ENDIF(NOT DEFINED ARCHIVE_CRYPTO_${CRYPTO}_WIN) + ENDIF(NOT ARCHIVE_CRYPTO_${CRYPTO}) ENDFOREACH(CRYPTO) ENDIF(WIN32 AND NOT CYGWIN) ENDMACRO(CHECK_CRYPTO_WIN CRYPTO_LIST) @@ -688,7 +768,7 @@ MACRO(CHECK_ICONV LIB TRY_ICONV_CONST) SET(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} /WX") ENDIF (MSVC) # - CHECK_C_SOURCE_COMPILES( + LIBARCHIVE_CHECK_C_SOURCE_COMPILES( "#include #include int main() { @@ -841,49 +921,112 @@ ELSE(LIBXML2_FOUND) ENDIF(LIBXML2_FOUND) MARK_AS_ADVANCED(CLEAR LIBXML2_INCLUDE_DIR) MARK_AS_ADVANCED(CLEAR LIBXML2_LIBRARIES) + # -# Find Libregex +# POSIX Regular Expression support # -FIND_PATH(REGEX_INCLUDE_DIR regex.h) -IF(REGEX_INCLUDE_DIR) - CHECK_FUNCTION_EXISTS_GLIBC(regcomp HAVE_REGCOMP_LIBC) +IF(POSIX_REGEX_LIB MATCHES "^(AUTO|LIBC|LIBREGEX)$") # - # If libc does not provide regex, find libregex. + # If PCREPOSIX is not found or not requested, try using regex + # from libc or libregex # - IF(NOT HAVE_REGCOMP_LIBC) - CMAKE_PUSH_CHECK_STATE() # Save the state of the variables - FIND_LIBRARY(REGEX_LIBRARY regex) - IF(REGEX_LIBRARY) - SET(CMAKE_REQUIRED_LIBRARIES ${REGEX_LIBRARY}) - CHECK_FUNCTION_EXISTS_GLIBC(regcomp HAVE_REGCOMP_LIBREGEX) - IF(HAVE_REGCOMP_LIBREGEX) - LIST(APPEND ADDITIONAL_LIBS ${REGEX_LIBRARY}) - # - # If regex.h is not found, retry looking for regex.h at - # REGEX_INCLUDE_DIR - # - IF(NOT HAVE_REGEX_H) - UNSET(HAVE_REGEX_H CACHE) - INCLUDE_DIRECTORIES(${REGEX_INCLUDE_DIR}) - SET(CMAKE_REQUIRED_INCLUDES ${REGEX_INCLUDE_DIR}) - LA_CHECK_INCLUDE_FILE("regex.h" HAVE_REGEX_H) - ENDIF(NOT HAVE_REGEX_H) - # Test if a macro is needed for the library. - TRY_MACRO_FOR_LIBRARY( - "${REGEX_INCLUDE_DIR}" "${REGEX_LIBRARY}" - COMPILES - "#include \n#include \nint main() {regex_t r;return regcomp(&r, \"\", 0);}" - "USE_REGEX_DLL;USE_REGEX_STATIC") - IF(USE_REGEX_DLL) - ADD_DEFINITIONS(-DUSE_REGEX_DLL) - ELSEIF(USE_REGEX_STATIC) - ADD_DEFINITIONS(-DUSE_REGEX_STATIC) - ENDIF(USE_REGEX_DLL) - ENDIF(HAVE_REGCOMP_LIBREGEX) - ENDIF(REGEX_LIBRARY) - CMAKE_POP_CHECK_STATE() # Restore the state of the variables - ENDIF(NOT HAVE_REGCOMP_LIBC) -ENDIF(REGEX_INCLUDE_DIR) + FIND_PATH(REGEX_INCLUDE_DIR regex.h) + IF(REGEX_INCLUDE_DIR) + CHECK_FUNCTION_EXISTS_GLIBC(regcomp HAVE_REGCOMP_LIBC) + # + # If libc does not provide regex, find libregex. + # + IF(NOT HAVE_REGCOMP_LIBC) + CMAKE_PUSH_CHECK_STATE() # Save the state of the variables + FIND_LIBRARY(REGEX_LIBRARY regex) + IF(REGEX_LIBRARY) + SET(CMAKE_REQUIRED_LIBRARIES ${REGEX_LIBRARY}) + CHECK_FUNCTION_EXISTS_GLIBC(regcomp HAVE_REGCOMP_LIBREGEX) + IF(HAVE_REGCOMP_LIBREGEX) + LIST(APPEND ADDITIONAL_LIBS ${REGEX_LIBRARY}) + # + # If regex.h is not found, retry looking for regex.h at + # REGEX_INCLUDE_DIR + # + IF(NOT HAVE_REGEX_H) + UNSET(HAVE_REGEX_H CACHE) + INCLUDE_DIRECTORIES(${REGEX_INCLUDE_DIR}) + SET(CMAKE_REQUIRED_INCLUDES ${REGEX_INCLUDE_DIR}) + LA_CHECK_INCLUDE_FILE("regex.h" HAVE_REGEX_H) + ENDIF(NOT HAVE_REGEX_H) + # Test if a macro is needed for the library. + TRY_MACRO_FOR_LIBRARY( + "${REGEX_INCLUDE_DIR}" "${REGEX_LIBRARY}" + COMPILES + "#include \n#include \nint main() {regex_t r;return regcomp(&r, \"\", 0);}" + "USE_REGEX_DLL;USE_REGEX_STATIC") + IF(USE_REGEX_DLL) + ADD_DEFINITIONS(-DUSE_REGEX_DLL) + ELSEIF(USE_REGEX_STATIC) + ADD_DEFINITIONS(-DUSE_REGEX_STATIC) + ENDIF(USE_REGEX_DLL) + ENDIF(HAVE_REGCOMP_LIBREGEX) + ENDIF(REGEX_LIBRARY) + CMAKE_POP_CHECK_STATE() # Restore the state of the variables + ENDIF(NOT HAVE_REGCOMP_LIBC) + ENDIF(REGEX_INCLUDE_DIR) + IF(HAVE_REGCOMP_LIBC OR HAVE_REGCOMP_LIBREGEX) + SET(FOUND_POSIX_REGEX_LIB 1) + ENDIF(HAVE_REGCOMP_LIBC OR HAVE_REGCOMP_LIBREGEX) +ENDIF(POSIX_REGEX_LIB MATCHES "^(AUTO|LIBC|LIBREGEX)$") + +IF(NOT FOUND_POSIX_REGEX_LIB AND POSIX_REGEX_LIB MATCHES "^(AUTO|LIBPCREPOSIX)$") + # + # If requested, try finding library for PCREPOSIX + # + FIND_PACKAGE(LibGCC) + FIND_PACKAGE(PCREPOSIX) + IF(PCREPOSIX_FOUND) + INCLUDE_DIRECTORIES(${PCRE_INCLUDE_DIR}) + LIST(APPEND ADDITIONAL_LIBS ${PCREPOSIX_LIBRARIES}) + # Test if a macro is needed for the library. + TRY_MACRO_FOR_LIBRARY( + "${PCRE_INCLUDE_DIR}" "${PCREPOSIX_LIBRARIES}" + COMPILES + "#include \nint main() {regex_t r;return regcomp(&r, \"\", 0);}" + "WITHOUT_PCRE_STATIC;PCRE_STATIC") + IF(NOT WITHOUT_PCRE_STATIC AND PCRE_STATIC) + ADD_DEFINITIONS(-DPCRE_STATIC) + ELSEIF(NOT WITHOUT_PCRE_STATIC AND NOT PCRE_STATIC AND PCRE_FOUND) + # Determine if pcre static libraries are to be used. + LIST(APPEND ADDITIONAL_LIBS ${PCRE_LIBRARIES}) + SET(TMP_LIBRARIES ${PCREPOSIX_LIBRARIES} ${PCRE_LIBRARIES}) + MESSAGE(STATUS "trying again with -lpcre included") + TRY_MACRO_FOR_LIBRARY( + "${PCRE_INCLUDE_DIR}" "${TMP_LIBRARIES}" + COMPILES + "#include \nint main() {regex_t r;return regcomp(&r, \"\", 0);}" + "WITHOUT_PCRE_STATIC;PCRE_STATIC") + IF(NOT WITHOUT_PCRE_STATIC AND PCRE_STATIC) + ADD_DEFINITIONS(-DPCRE_STATIC) + ELSEIF(NOT WITHOUT_PCRE_STATIC AND NOT PCRE_STATIC AND MSVC AND LIBGCC_FOUND) + # When doing a Visual Studio build using pcre 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 ${PCREPOSIX_LIBRARIES} ${PCRE_LIBRARIES} ${LIBGCC_LIBRARIES}) + TRY_MACRO_FOR_LIBRARY( + "${PCRE_INCLUDE_DIR}" "${TMP_LIBRARIES}" + COMPILES + "#include \nint main() {regex_t r;return regcomp(&r, \"\", 0);}" + "WITHOUT_PCRE_STATIC;PCRE_STATIC") + IF(NOT WITHOUT_PCRE_STATIC AND PCRE_STATIC) + ADD_DEFINITIONS(-DPCRE_STATIC) + ENDIF(NOT WITHOUT_PCRE_STATIC AND PCRE_STATIC) + ENDIF(NOT WITHOUT_PCRE_STATIC AND PCRE_STATIC) + ENDIF(NOT WITHOUT_PCRE_STATIC AND PCRE_STATIC) + ENDIF(PCREPOSIX_FOUND) + MARK_AS_ADVANCED(CLEAR PCRE_INCLUDE_DIR) + MARK_AS_ADVANCED(CLEAR PCREPOSIX_LIBRARIES) + MARK_AS_ADVANCED(CLEAR PCRE_LIBRARIES) + MARK_AS_ADVANCED(CLEAR LIBGCC_LIBRARIES) +ENDIF(NOT FOUND_POSIX_REGEX_LIB AND POSIX_REGEX_LIB MATCHES "^(AUTO|LIBPCREPOSIX)$") # # Check functions @@ -902,6 +1045,7 @@ CHECK_FUNCTION_EXISTS_GLIBC(chflags HAVE_CHFLAGS) CHECK_FUNCTION_EXISTS_GLIBC(chown HAVE_CHOWN) CHECK_FUNCTION_EXISTS_GLIBC(chroot HAVE_CHROOT) CHECK_FUNCTION_EXISTS_GLIBC(ctime_r HAVE_CTIME_R) +CHECK_FUNCTION_EXISTS_GLIBC(dirfd HAVE_DIRFD) CHECK_FUNCTION_EXISTS_GLIBC(fchdir HAVE_FCHDIR) CHECK_FUNCTION_EXISTS_GLIBC(fchflags HAVE_FCHFLAGS) CHECK_FUNCTION_EXISTS_GLIBC(fchmod HAVE_FCHMOD) @@ -942,6 +1086,7 @@ CHECK_FUNCTION_EXISTS_GLIBC(nl_langinfo HAVE_NL_LANGINFO) CHECK_FUNCTION_EXISTS_GLIBC(openat HAVE_OPENAT) CHECK_FUNCTION_EXISTS_GLIBC(pipe HAVE_PIPE) CHECK_FUNCTION_EXISTS_GLIBC(poll HAVE_POLL) +CHECK_FUNCTION_EXISTS_GLIBC(posix_spawnp HAVE_POSIX_SPAWNP) CHECK_FUNCTION_EXISTS_GLIBC(readlink HAVE_READLINK) CHECK_FUNCTION_EXISTS_GLIBC(select HAVE_SELECT) CHECK_FUNCTION_EXISTS_GLIBC(setenv HAVE_SETENV) @@ -986,14 +1131,14 @@ CMAKE_POP_CHECK_STATE() # Restore the state of the variables # Make sure we have the POSIX version of readdir_r, not the # older 2-argument version. -CHECK_C_SOURCE_COMPILES( +LIBARCHIVE_CHECK_C_SOURCE_COMPILES( "#include \nint main() {DIR *d = opendir(\".\"); struct dirent e,*r; return readdir_r(d,&e,&r);}" HAVE_READDIR_R) # Only detect readlinkat() if we also have AT_FDCWD in unistd.h. # NOTE: linux requires fcntl.h for AT_FDCWD. -CHECK_C_SOURCE_COMPILES( +LIBARCHIVE_CHECK_C_SOURCE_COMPILES( "#include \n#include \nint main() {char buf[10]; return readlinkat(AT_FDCWD, \"\", buf, 0);}" HAVE_READLINKAT) @@ -1002,10 +1147,10 @@ CHECK_C_SOURCE_COMPILES( # of interest and verify that the result can be linked. # CHECK_FUNCTION_EXISTS doesn't accept a header argument, # CHECK_SYMBOL_EXISTS doesn't test linkage. -CHECK_C_SOURCE_COMPILES( +LIBARCHIVE_CHECK_C_SOURCE_COMPILES( "#include \nint main() { return major(256); }" MAJOR_IN_MKDEV) -CHECK_C_SOURCE_COMPILES( +LIBARCHIVE_CHECK_C_SOURCE_COMPILES( "#include \nint main() { return major(256); }" MAJOR_IN_SYSMACROS) @@ -1301,6 +1446,8 @@ IF(ENABLE_ACL) CHECK_FUNCTION_EXISTS(acl_get_perm_np HAVE_ACL_GET_PERM_NP) CHECK_FUNCTION_EXISTS(acl_get_link HAVE_ACL_GET_LINK) CHECK_FUNCTION_EXISTS(acl_get_link_np HAVE_ACL_GET_LINK_NP) + CHECK_FUNCTION_EXISTS(acl_is_trivial_np HAVE_ACL_IS_TRIVIAL_NP) + CHECK_FUNCTION_EXISTS(acl_set_link_np HAVE_ACL_SET_LINK_NP) # MacOS has an acl.h that isn't POSIX. It can be detected by # checking for ACL_USER diff --git a/Makefile.am b/Makefile.am index 6ac9a4e44dae..3fa2d22b6de6 100644 --- a/Makefile.am +++ b/Makefile.am @@ -90,6 +90,8 @@ libarchive_la_SOURCES= \ libarchive/archive_acl.c \ libarchive/archive_acl_private.h \ libarchive/archive_check_magic.c \ + libarchive/archive_cmdline.c \ + libarchive/archive_cmdline_private.h \ libarchive/archive_crc32.h \ libarchive/archive_crypto.c \ libarchive/archive_crypto_private.h \ @@ -118,6 +120,7 @@ libarchive_la_SOURCES= \ libarchive/archive_rb.c \ libarchive/archive_rb.h \ libarchive/archive_read.c \ + libarchive/archive_read_append_filter.c \ libarchive/archive_read_data_into_fd.c \ libarchive/archive_read_disk_entry_from_file.c \ libarchive/archive_read_disk_posix.c \ @@ -129,11 +132,15 @@ libarchive_la_SOURCES= \ libarchive/archive_read_open_filename.c \ libarchive/archive_read_open_memory.c \ libarchive/archive_read_private.h \ + libarchive/archive_read_set_format.c \ libarchive/archive_read_set_options.c \ libarchive/archive_read_support_filter_all.c \ libarchive/archive_read_support_filter_bzip2.c \ libarchive/archive_read_support_filter_compress.c \ + libarchive/archive_read_support_filter_grzip.c \ libarchive/archive_read_support_filter_gzip.c \ + libarchive/archive_read_support_filter_lrzip.c \ + libarchive/archive_read_support_filter_lzop.c \ libarchive/archive_read_support_filter_none.c \ libarchive/archive_read_support_filter_program.c \ libarchive/archive_read_support_filter_rpm.c \ @@ -161,6 +168,7 @@ libarchive_la_SOURCES= \ libarchive/archive_util.c \ libarchive/archive_virtual.c \ libarchive/archive_write.c \ + libarchive/archive_write_disk_acl.c \ libarchive/archive_write_disk_posix.c \ libarchive/archive_write_disk_private.h \ libarchive/archive_write_disk_set_standard_lookup.c \ @@ -170,11 +178,17 @@ libarchive_la_SOURCES= \ libarchive/archive_write_open_memory.c \ libarchive/archive_write_private.h \ libarchive/archive_write_add_filter.c \ - libarchive/archive_write_add_filter_bzip2.c \ - libarchive/archive_write_add_filter_compress.c \ + libarchive/archive_write_add_filter_b64encode.c \ + libarchive/archive_write_add_filter_by_name.c \ + libarchive/archive_write_add_filter_bzip2.c \ + libarchive/archive_write_add_filter_compress.c \ + libarchive/archive_write_add_filter_grzip.c \ libarchive/archive_write_add_filter_gzip.c \ + libarchive/archive_write_add_filter_lrzip.c \ + libarchive/archive_write_add_filter_lzop.c \ libarchive/archive_write_add_filter_none.c \ - libarchive/archive_write_add_filter_program.c \ + libarchive/archive_write_add_filter_program.c \ + libarchive/archive_write_add_filter_uuencode.c \ libarchive/archive_write_add_filter_xz.c \ libarchive/archive_write_set_format.c \ libarchive/archive_write_set_format_7zip.c \ @@ -187,12 +201,13 @@ libarchive_la_SOURCES= \ libarchive/archive_write_set_format_pax.c \ libarchive/archive_write_set_format_shar.c \ libarchive/archive_write_set_format_ustar.c \ + libarchive/archive_write_set_format_v7tar.c \ libarchive/archive_write_set_format_gnutar.c \ libarchive/archive_write_set_format_xar.c \ libarchive/archive_write_set_format_zip.c \ libarchive/archive_write_set_options.c \ libarchive/config_freebsd.h \ - libarchive/filter_fork.c \ + libarchive/filter_fork_posix.c \ libarchive/filter_fork.h if INC_WINDOWS_FILES @@ -220,14 +235,32 @@ libarchive_man_MANS= \ libarchive/archive_entry_stat.3 \ libarchive/archive_entry_time.3 \ libarchive/archive_read.3 \ + libarchive/archive_read_data.3 \ libarchive/archive_read_disk.3 \ + libarchive/archive_read_extract.3 \ + libarchive/archive_read_filter.3 \ + libarchive/archive_read_format.3 \ + libarchive/archive_read_free.3 \ + libarchive/archive_read_header.3 \ + libarchive/archive_read_new.3 \ + libarchive/archive_read_open.3 \ libarchive/archive_read_set_options.3 \ libarchive/archive_util.3 \ libarchive/archive_write.3 \ + libarchive/archive_write_blocksize.3 \ + libarchive/archive_write_data.3 \ libarchive/archive_write_disk.3 \ + libarchive/archive_write_filter.3 \ + libarchive/archive_write_finish_entry.3 \ + libarchive/archive_write_format.3 \ + libarchive/archive_write_free.3 \ + libarchive/archive_write_header.3 \ + libarchive/archive_write_new.3 \ + libarchive/archive_write_open.3 \ libarchive/archive_write_set_options.3 \ libarchive/cpio.5 \ libarchive/libarchive.3 \ + libarchive/libarchive_changes.3 \ libarchive/libarchive_internals.3 \ libarchive/libarchive-formats.5 \ libarchive/mtree.5 \ @@ -245,6 +278,11 @@ libarchive_EXTRA_DIST= \ pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = build/pkgconfig/libarchive.pc +# Sources needed by all test programs +test_utils_SOURCES= \ + test_utils/test_utils.c \ + test_utils/test_utils.h + # # # libarchive_test program @@ -252,15 +290,18 @@ pkgconfig_DATA = build/pkgconfig/libarchive.pc # libarchive_test_SOURCES= \ $(libarchive_la_SOURCES) \ + $(test_utils_SOURCES) \ libarchive/test/main.c \ libarchive/test/read_open_memory.c \ libarchive/test/test.h \ - libarchive/test/test_acl_freebsd.c \ + libarchive/test/test_acl_freebsd_posix1e.c \ + libarchive/test/test_acl_freebsd_nfs4.c \ libarchive/test/test_acl_nfs4.c \ libarchive/test/test_acl_pax.c \ libarchive/test/test_acl_posix1e.c \ libarchive/test/test_archive_api_feature.c \ libarchive/test/test_archive_clear_error.c \ + libarchive/test/test_archive_cmdline.c \ libarchive/test/test_archive_crypto.c \ libarchive/test/test_archive_getdate.c \ libarchive/test/test_archive_match_owner.c \ @@ -270,6 +311,7 @@ libarchive_test_SOURCES= \ libarchive/test/test_archive_read_close_twice.c \ libarchive/test/test_archive_read_close_twice_open_fd.c \ libarchive/test/test_archive_read_close_twice_open_filename.c \ + libarchive/test/test_archive_read_multiple_data_objects.c \ libarchive/test/test_archive_read_next_header_empty.c \ libarchive/test/test_archive_read_next_header_raw.c \ libarchive/test/test_archive_read_open2.c \ @@ -281,7 +323,9 @@ libarchive_test_SOURCES= \ libarchive/test/test_archive_set_error.c \ libarchive/test/test_archive_string.c \ libarchive/test/test_archive_string_conversion.c \ + libarchive/test/test_archive_write_add_filter_by_name.c \ libarchive/test/test_archive_write_set_filter_option.c \ + libarchive/test/test_archive_write_set_format_by_name.c \ libarchive/test/test_archive_write_set_format_option.c \ libarchive/test/test_archive_write_set_option.c \ libarchive/test/test_archive_write_set_options.c \ @@ -292,11 +336,13 @@ libarchive_test_SOURCES= \ libarchive/test/test_compat_gzip.c \ libarchive/test/test_compat_lzip.c \ libarchive/test/test_compat_lzma.c \ + libarchive/test/test_compat_lzop.c \ libarchive/test/test_compat_mac.c \ libarchive/test/test_compat_pax_libarchive_2x.c \ libarchive/test/test_compat_solaris_tar_acl.c \ libarchive/test/test_compat_solaris_pax_sparse.c \ libarchive/test/test_compat_tar_hardlink.c \ + libarchive/test/test_compat_uudecode.c \ libarchive/test/test_compat_xz.c \ libarchive/test/test_compat_zip.c \ libarchive/test/test_empty_write.c \ @@ -312,13 +358,19 @@ libarchive_test_SOURCES= \ libarchive/test/test_open_file.c \ libarchive/test/test_open_filename.c \ libarchive/test/test_pax_filename_encoding.c \ - libarchive/test/test_read_compress_program.c \ libarchive/test/test_read_data_large.c \ libarchive/test/test_read_disk.c \ libarchive/test/test_read_disk_directory_traversals.c \ libarchive/test/test_read_disk_entry_from_file.c \ libarchive/test/test_read_extract.c \ libarchive/test/test_read_file_nonexistent.c \ + libarchive/test/test_read_filter_grzip.c \ + libarchive/test/test_read_filter_lrzip.c \ + libarchive/test/test_read_filter_lzop.c \ + libarchive/test/test_read_filter_lzop_multiple_parts.c \ + 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_format_7zip.c \ libarchive/test/test_read_format_ar.c \ libarchive/test/test_read_format_cab.c \ @@ -372,35 +424,49 @@ libarchive_test_SOURCES= \ libarchive/test/test_read_format_ustar_filename.c \ libarchive/test/test_read_format_xar.c \ libarchive/test/test_read_format_zip.c \ + libarchive/test/test_read_format_zip_comment_stored.c \ libarchive/test/test_read_format_zip_filename.c \ + libarchive/test/test_read_format_zip_mac_metadata.c \ + libarchive/test/test_read_format_zip_sfx.c \ libarchive/test/test_read_large.c \ libarchive/test/test_read_pax_truncated.c \ libarchive/test/test_read_position.c \ + libarchive/test/test_read_set_format.c \ libarchive/test/test_read_truncated.c \ libarchive/test/test_read_truncated_filter.c \ - libarchive/test/test_read_uu.c \ libarchive/test/test_sparse_basic.c \ libarchive/test/test_tar_filenames.c \ libarchive/test/test_tar_large.c \ libarchive/test/test_ustar_filenames.c \ libarchive/test/test_ustar_filename_encoding.c \ - libarchive/test/test_write_compress.c \ - libarchive/test/test_write_compress_bzip2.c \ - libarchive/test/test_write_compress_gzip.c \ - libarchive/test/test_write_compress_lzip.c \ - libarchive/test/test_write_compress_lzma.c \ - libarchive/test/test_write_compress_program.c \ - libarchive/test/test_write_compress_xz.c \ libarchive/test/test_write_disk.c \ + libarchive/test/test_write_disk_appledouble.c \ libarchive/test/test_write_disk_failures.c \ libarchive/test/test_write_disk_hardlink.c \ + libarchive/test/test_write_disk_hfs_compression.c \ libarchive/test/test_write_disk_lookup.c \ + libarchive/test/test_write_disk_mac_metadata.c \ + libarchive/test/test_write_disk_no_hfs_compression.c \ libarchive/test/test_write_disk_perms.c \ libarchive/test/test_write_disk_secure.c \ libarchive/test/test_write_disk_sparse.c \ libarchive/test/test_write_disk_symlink.c \ libarchive/test/test_write_disk_times.c \ + libarchive/test/test_write_filter_b64encode.c \ + libarchive/test/test_write_filter_bzip2.c \ + libarchive/test/test_write_filter_compress.c \ + libarchive/test/test_write_filter_gzip.c \ + libarchive/test/test_write_filter_gzip_timestamp.c \ + libarchive/test/test_write_filter_lrzip.c \ + libarchive/test/test_write_filter_lzip.c \ + libarchive/test/test_write_filter_lzma.c \ + libarchive/test/test_write_filter_lzop.c \ + libarchive/test/test_write_filter_program.c \ + libarchive/test/test_write_filter_uuencode.c \ + libarchive/test/test_write_filter_xz.c \ libarchive/test/test_write_format_7zip.c \ + libarchive/test/test_write_format_7zip_empty.c \ + libarchive/test/test_write_format_7zip_large.c \ libarchive/test/test_write_format_ar.c \ libarchive/test/test_write_format_cpio.c \ libarchive/test/test_write_format_cpio_empty.c \ @@ -413,22 +479,29 @@ libarchive_test_SOURCES= \ libarchive/test/test_write_format_iso9660_filename.c \ libarchive/test/test_write_format_iso9660_zisofs.c \ libarchive/test/test_write_format_mtree.c \ + libarchive/test/test_write_format_mtree_absolute_path.c \ + libarchive/test/test_write_format_mtree_classic.c \ + libarchive/test/test_write_format_mtree_classic_indent.c\ libarchive/test/test_write_format_mtree_fflags.c \ + libarchive/test/test_write_format_mtree_no_separator.c \ + libarchive/test/test_write_format_mtree_quoted_filename.c\ libarchive/test/test_write_format_pax.c \ libarchive/test/test_write_format_shar_empty.c \ libarchive/test/test_write_format_tar.c \ libarchive/test/test_write_format_tar_empty.c \ libarchive/test/test_write_format_tar_sparse.c \ libarchive/test/test_write_format_tar_ustar.c \ + libarchive/test/test_write_format_tar_v7tar.c \ 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_zip_empty.c \ libarchive/test/test_write_format_zip_no_compression.c \ libarchive/test/test_write_open_memory.c \ + libarchive/test/test_write_zip_set_compression_store.c \ libarchive/test/test_zip_filename_encoding.c -libarchive_test_CPPFLAGS= -I$(top_srcdir)/libarchive -I$(top_builddir)/libarchive/test -DLIBARCHIVE_STATIC $(PLATFORMCPPFLAGS) +libarchive_test_CPPFLAGS= -I$(top_srcdir)/libarchive -I$(top_srcdir)/test_utils -I$(top_builddir)/libarchive/test -DLIBARCHIVE_STATIC $(PLATFORMCPPFLAGS) libarchive_test_LDADD= $(LTLIBICONV) # The "list.h" file just lists all of the tests defined in all of the sources. @@ -437,7 +510,7 @@ libarchive_test_LDADD= $(LTLIBICONV) libarchive/test/list.h: Makefile cat $(top_srcdir)/libarchive/test/test_*.c | grep DEFINE_TEST > libarchive/test/list.h -libarchive_TESTS_ENVIRONMENT= LIBARCHIVE_TEST_FILES=`cd $(top_srcdir);/bin/pwd`/libarchive/test +libarchive_TESTS_ENVIRONMENT= LIBARCHIVE_TEST_FILES=`cd $(top_srcdir);/bin/pwd`/libarchive/test LRZIP=NOCONFIG libarchive_test_EXTRA_DIST=\ libarchive/test/list.h \ @@ -454,6 +527,9 @@ libarchive_test_EXTRA_DIST=\ libarchive/test/test_compat_lzma_1.tlz.uu \ libarchive/test/test_compat_lzma_2.tlz.uu \ libarchive/test/test_compat_lzma_3.tlz.uu \ + libarchive/test/test_compat_lzop_1.tar.lzo.uu \ + libarchive/test/test_compat_lzop_2.tar.lzo.uu \ + libarchive/test/test_compat_lzop_3.tar.lzo.uu \ libarchive/test/test_compat_mac-1.tar.Z.uu \ libarchive/test/test_compat_mac-2.tar.Z.uu \ libarchive/test/test_compat_pax_libarchive_2x.tar.Z.uu \ @@ -473,6 +549,29 @@ libarchive_test_EXTRA_DIST=\ libarchive/test/test_fuzz.cab.uu \ libarchive/test/test_fuzz.lzh.uu \ libarchive/test/test_pax_filename_encoding.tar.uu \ + libarchive/test/test_rar_multivolume_multiple_files.part1.rar.uu \ + libarchive/test/test_rar_multivolume_multiple_files.part2.rar.uu \ + libarchive/test/test_rar_multivolume_multiple_files.part3.rar.uu \ + libarchive/test/test_rar_multivolume_multiple_files.part4.rar.uu \ + libarchive/test/test_rar_multivolume_multiple_files.part5.rar.uu \ + libarchive/test/test_rar_multivolume_multiple_files.part6.rar.uu \ + libarchive/test/test_rar_multivolume_single_file.part1.rar.uu \ + libarchive/test/test_rar_multivolume_single_file.part2.rar.uu \ + libarchive/test/test_rar_multivolume_single_file.part3.rar.uu \ + libarchive/test/test_rar_multivolume_uncompressed_files.part01.rar.uu \ + libarchive/test/test_rar_multivolume_uncompressed_files.part02.rar.uu \ + libarchive/test/test_rar_multivolume_uncompressed_files.part03.rar.uu \ + libarchive/test/test_rar_multivolume_uncompressed_files.part04.rar.uu \ + libarchive/test/test_rar_multivolume_uncompressed_files.part05.rar.uu \ + libarchive/test/test_rar_multivolume_uncompressed_files.part06.rar.uu \ + libarchive/test/test_rar_multivolume_uncompressed_files.part07.rar.uu \ + libarchive/test/test_rar_multivolume_uncompressed_files.part08.rar.uu \ + libarchive/test/test_rar_multivolume_uncompressed_files.part09.rar.uu \ + libarchive/test/test_rar_multivolume_uncompressed_files.part10.rar.uu \ + libarchive/test/test_read_filter_grzip.tar.grz.uu \ + libarchive/test/test_read_filter_lrzip.tar.lrz.uu \ + libarchive/test/test_read_filter_lzop.tar.lzo.uu \ + libarchive/test/test_read_filter_lzop_multiple_parts.tar.lzo.uu \ libarchive/test/test_read_format_7zip_bcj_bzip2.7z.uu \ libarchive/test/test_read_format_7zip_bcj_copy.7z.uu \ libarchive/test/test_read_format_7zip_bcj_deflate.7z.uu \ @@ -547,11 +646,17 @@ libarchive_test_EXTRA_DIST=\ libarchive/test/test_read_format_lha_withjunk.lzh.uu \ libarchive/test/test_read_format_mtree.mtree.uu \ libarchive/test/test_read_format_mtree_nomagic.mtree.uu \ + libarchive/test/test_read_format_mtree_nomagic2.mtree.uu \ + libarchive/test/test_read_format_mtree_nomagic3.mtree.uu \ libarchive/test/test_read_format_rar.rar.uu \ libarchive/test/test_read_format_rar_binary_data.rar.uu \ libarchive/test/test_read_format_rar_compress_best.rar.uu \ libarchive/test/test_read_format_rar_compress_normal.rar.uu \ libarchive/test/test_read_format_rar_multi_lzss_blocks.rar.uu \ + libarchive/test/test_read_format_rar_multivolume.part0001.rar.uu\ + libarchive/test/test_read_format_rar_multivolume.part0002.rar.uu\ + libarchive/test/test_read_format_rar_multivolume.part0003.rar.uu\ + libarchive/test/test_read_format_rar_multivolume.part0004.rar.uu\ libarchive/test/test_read_format_rar_noeof.rar.uu \ libarchive/test/test_read_format_rar_ppmd_lzss_conversion.rar.uu\ libarchive/test/test_read_format_rar_sfx.exe.uu \ @@ -566,6 +671,8 @@ libarchive_test_EXTRA_DIST=\ libarchive/test/test_read_format_ustar_filename_eucjp.tar.Z.uu \ libarchive/test/test_read_format_ustar_filename_koi8r.tar.Z.uu \ libarchive/test/test_read_format_zip.zip.uu \ + libarchive/test/test_read_format_zip_comment_stored_1.zip.uu \ + libarchive/test/test_read_format_zip_comment_stored_2.zip.uu \ libarchive/test/test_read_format_zip_filename_cp866.zip.uu \ libarchive/test/test_read_format_zip_filename_cp932.zip.uu \ libarchive/test/test_read_format_zip_filename_koi8r.zip.uu \ @@ -573,8 +680,26 @@ libarchive_test_EXTRA_DIST=\ libarchive/test/test_read_format_zip_filename_utf8_ru2.zip.uu \ libarchive/test/test_read_format_zip_filename_utf8_ru.zip.uu \ libarchive/test/test_read_format_zip_length_at_end.zip.uu \ + libarchive/test/test_read_format_zip_mac_metadata.zip.uu \ + libarchive/test/test_read_format_zip_sfx.uu \ libarchive/test/test_read_format_zip_symlink.zip.uu \ libarchive/test/test_read_format_zip_ux.zip.uu \ + libarchive/test/test_read_large_splitted_rar_aa.uu \ + libarchive/test/test_read_large_splitted_rar_ab.uu \ + libarchive/test/test_read_large_splitted_rar_ac.uu \ + libarchive/test/test_read_large_splitted_rar_ad.uu \ + libarchive/test/test_read_large_splitted_rar_ae.uu \ + libarchive/test/test_read_splitted_rar_aa.uu \ + libarchive/test/test_read_splitted_rar_ab.uu \ + libarchive/test/test_read_splitted_rar_ac.uu \ + libarchive/test/test_read_splitted_rar_ad.uu \ + libarchive/test/test_splitted_rar_seek_support_aa.uu \ + libarchive/test/test_splitted_rar_seek_support_ab.uu \ + libarchive/test/test_splitted_rar_seek_support_ac.uu \ + libarchive/test/test_write_disk_appledouble.cpio.gz.uu \ + libarchive/test/test_write_disk_hfs_compression.tgz.uu \ + libarchive/test/test_write_disk_mac_metadata.tar.gz.uu \ + libarchive/test/test_write_disk_no_hfs_compression.tgz.uu \ libarchive/test/CMakeLists.txt \ libarchive/test/README @@ -600,6 +725,7 @@ bsdtar_SOURCES= \ tar/bsdtar.h \ tar/bsdtar_platform.h \ tar/cmdline.c \ + tar/creation_set.c \ tar/read.c \ tar/subst.c \ tar/util.c \ @@ -646,12 +772,22 @@ endif # bsdtar_test_SOURCES= \ + $(test_utils_SOURCES) \ tar/test/main.c \ tar/test/test.h \ tar/test/test_0.c \ tar/test/test_basic.c \ tar/test/test_copy.c \ tar/test/test_empty_mtree.c \ + tar/test/test_extract_tar_Z.c \ + tar/test/test_extract_tar_bz2.c \ + tar/test/test_extract_tar_grz.c \ + tar/test/test_extract_tar_gz.c \ + tar/test/test_extract_tar_lrz.c \ + tar/test/test_extract_tar_lz.c \ + tar/test/test_extract_tar_lzma.c \ + tar/test/test_extract_tar_lzo.c \ + tar/test/test_extract_tar_xz.c \ tar/test/test_format_newc.c \ tar/test/test_help.c \ tar/test/test_option_C_upper.c \ @@ -661,18 +797,29 @@ bsdtar_test_SOURCES= \ tar/test/test_option_T_upper.c \ tar/test/test_option_U_upper.c \ tar/test/test_option_X_upper.c \ + tar/test/test_option_a.c \ tar/test/test_option_b.c \ + tar/test/test_option_b64encode.c \ tar/test/test_option_exclude.c \ tar/test/test_option_gid_gname.c \ + tar/test/test_option_grzip.c \ + tar/test/test_option_j.c \ tar/test/test_option_k.c \ tar/test/test_option_keep_newer_files.c \ + tar/test/test_option_lrzip.c \ + tar/test/test_option_lzma.c \ + tar/test/test_option_lzop.c \ tar/test/test_option_n.c \ tar/test/test_option_newer_than.c \ tar/test/test_option_nodump.c \ + tar/test/test_option_older_than.c \ tar/test/test_option_q.c \ tar/test/test_option_r.c \ tar/test/test_option_s.c \ tar/test/test_option_uid_uname.c \ + tar/test/test_option_uuencode.c \ + tar/test/test_option_xz.c \ + tar/test/test_option_z.c \ tar/test/test_patterns.c \ tar/test/test_print_longpath.c \ tar/test/test_stdio.c \ @@ -683,6 +830,7 @@ bsdtar_test_SOURCES= \ bsdtar_test_CPPFLAGS=\ -I$(top_srcdir)/libarchive -I$(top_srcdir)/libarchive_fe \ + -I$(top_srcdir)/test_utils \ -I$(top_srcdir)/tar -I$(top_builddir)/tar/test \ $(PLATFORMCPPFLAGS) @@ -699,6 +847,15 @@ endif bsdtar_test_EXTRA_DIST= \ tar/test/list.h \ + tar/test/test_extract.tar.Z.uu \ + tar/test/test_extract.tar.bz2.uu \ + tar/test/test_extract.tar.grz.uu \ + tar/test/test_extract.tar.gz.uu \ + tar/test/test_extract.tar.lrz.uu \ + tar/test/test_extract.tar.lz.uu \ + tar/test/test_extract.tar.lzma.uu \ + tar/test/test_extract.tar.lzo.uu \ + tar/test/test_extract.tar.xz.uu \ tar/test/test_option_keep_newer_files.tar.Z.uu \ tar/test/test_option_s.tar.Z.uu \ tar/test/test_patterns_2.tar.uu \ @@ -763,12 +920,22 @@ endif # bsdcpio_test_SOURCES= \ + $(test_utils_SOURCES) \ cpio/cmdline.c \ cpio/test/main.c \ cpio/test/test.h \ cpio/test/test_0.c \ cpio/test/test_basic.c \ cpio/test/test_cmdline.c \ + cpio/test/test_extract_cpio_Z.c \ + cpio/test/test_extract_cpio_bz2.c \ + cpio/test/test_extract_cpio_grz.c \ + cpio/test/test_extract_cpio_gz.c \ + cpio/test/test_extract_cpio_lrz.c \ + cpio/test/test_extract_cpio_lz.c \ + cpio/test/test_extract_cpio_lzma.c \ + cpio/test/test_extract_cpio_lzo.c \ + cpio/test/test_extract_cpio_xz.c \ cpio/test/test_format_newc.c \ cpio/test/test_gcpio_compat.c \ cpio/test/test_option_0.c \ @@ -778,16 +945,22 @@ bsdcpio_test_SOURCES= \ cpio/test/test_option_L_upper.c \ cpio/test/test_option_Z_upper.c \ cpio/test/test_option_a.c \ + cpio/test/test_option_b64encode.c \ cpio/test/test_option_c.c \ cpio/test/test_option_d.c \ cpio/test/test_option_f.c \ + cpio/test/test_option_grzip.c \ cpio/test/test_option_help.c \ cpio/test/test_option_l.c \ + cpio/test/test_option_lrzip.c \ cpio/test/test_option_lzma.c \ + cpio/test/test_option_lzop.c \ cpio/test/test_option_m.c \ cpio/test/test_option_t.c \ cpio/test/test_option_u.c \ + cpio/test/test_option_uuencode.c \ cpio/test/test_option_version.c \ + cpio/test/test_option_xz.c \ cpio/test/test_option_y.c \ cpio/test/test_option_z.c \ cpio/test/test_owner_parse.c \ @@ -796,6 +969,7 @@ bsdcpio_test_SOURCES= \ bsdcpio_test_CPPFLAGS= \ -I$(top_srcdir)/libarchive -I$(top_srcdir)/libarchive_fe \ + -I$(top_srcdir)/test_utils \ -I$(top_srcdir)/cpio -I$(top_builddir)/cpio/test \ $(PLATFORMCPPFLAGS) bsdcpio_test_LDADD=libarchive_fe.la @@ -813,6 +987,15 @@ endif bsdcpio_test_EXTRA_DIST= \ cpio/test/list.h \ + cpio/test/test_extract.cpio.Z.uu \ + cpio/test/test_extract.cpio.bz2.uu \ + cpio/test/test_extract.cpio.grz.uu \ + cpio/test/test_extract.cpio.gz.uu \ + cpio/test/test_extract.cpio.lrz.uu \ + cpio/test/test_extract.cpio.lz.uu \ + cpio/test/test_extract.cpio.lzma.uu \ + cpio/test/test_extract.cpio.lzo.uu \ + cpio/test/test_extract.cpio.xz.uu \ cpio/test/test_gcpio_compat_ref.bin.uu \ cpio/test/test_gcpio_compat_ref.crc.uu \ cpio/test/test_gcpio_compat_ref.newc.uu \ diff --git a/NEWS b/NEWS index 5c280685f68f..107d4da0f11e 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,30 @@ +Feb 09, 2013: libarchive 3.1.2 released + +Jan 28, 2013: libarchive's new website moved to http://www.libarchive.org. + +Jan 13, 2013: libarchive 3.1.1 released + +Jan 13, 2013: libarchive 3.1.0 released + +Dec 07, 2012: Implement functions to manually set the format and filters used. + +Nov 11, 2012: Add support for __MACOSX directory in Zip archives, which resource + forks are stored in. + +Oct 20, 2012: Add support for writing v7 tar format. + +Oct 09, 2012: Add support for grzip compression. + +Oct 07, 2012: Introduce b64encode filter. +Oct 07, 2012: Introduce uuencode filter. + +Oct 06, 2012: Add support for lzop. + +Sep 27, 2012: Implement function used to seek within data blocks. + (Currently only supported for uncompressed RAR archives). + +Apr 22, 2012: Add basic archive read and write filter support for lrzip. + Mar 27, 2012: libarchive 3.0.4 released Feb 05, 2012: libarchive development now hosted at GitHub. diff --git a/README b/README index 4ffc3b75364f..1c974fde2202 100644 --- a/README +++ b/README @@ -1,7 +1,7 @@ README for libarchive bundle. Questions? Issues? - * http://libarchive.github.com/ is the home for ongoing + * http://www.libarchive.org is the home for ongoing libarchive development, including documentation, and links to the libarchive mailing lists. * To report an issue, use the issue tracker at diff --git a/build/README.txt b/build/README.txt new file mode 100644 index 000000000000..ce8e1a32a577 --- /dev/null +++ b/build/README.txt @@ -0,0 +1,35 @@ +Notes on making a new release of libarchive +=========================================== + +The following serves as a guide for libarchive developers on the general +process to be followed when making a new release of libarchive. + +* Update build/version with the version number of the release to be made. +* If the library's ABI has changed, the library's soname major version *MUST* + be updated. Update configure.ac and CMakeLists.txt appropriately. + - For configure.ac, the variable ARCHIVE_INTERFACE needs to be updated. + - For CMakeLists.txt, the variable INTERFACE_VERSION needs to be updated. +* Update the entries in the NEWS file accordingly. +* Run `build/makerelease.sh` from the top source directory. Running this script + will do the following. + - Removes all Makefile.am development build specific CFLAGS from + Makefile.am. + - Update configure scripts and header files with the appropriate version + number from build/version. + - Rebuild the documentation directory. + - Runs a full cmake build and test. + - Runs a full autotools build and test. + - Builds the .tar.gz and .zip distribution files. +* Commit all changed files into git. + - This should be build/version, NEWS, and the files edited by running + build/makerelease.sh. +* Tag the release appropriately. The tag should also have an appropriate + message. + - The git command is as follows: + $ git tag -m "Libarchive " v + Replace with the version to be released. +* Copy all the generated wiki files and commit them into the libarchive.wiki + repository. Overwrite any preexisting files with the same name (these files + are always autogenerated from the libarchive release after every release). +* Update the libarchive.org website accordingly. +* Make an announcement to the libarchive-announce mailing list. diff --git a/build/autogen.sh b/build/autogen.sh index d82a401f920c..e73162465d2a 100755 --- a/build/autogen.sh +++ b/build/autogen.sh @@ -48,6 +48,11 @@ perl -p -i -e "s/^(#define\tARCHIVE_VERSION_STRING).*/\$1 \"libarchive $VS\"/" l perl -p -i -e 's/(m4_define\(\[LIBARCHIVE_VERSION_S\]),.*\)/$1,['"$VS"'])/' configure.ac perl -p -i -e 's/(m4_define\(\[LIBARCHIVE_VERSION_N\]),.*\)/$1,['"$VN"'])/' configure.ac +# Remove developer CFLAGS if a release build is being made +if [ -n "${MAKE_LIBARCHIVE_RELEASE}" ]; then + perl -p -i -e "s/^(DEV_CFLAGS.*)/# \$1/" Makefile.am +fi + set -xe aclocal -I build/autoconf diff --git a/build/bump-version.sh b/build/bump-version.sh index 0304cf3fb329..eec42354fd47 100644 --- a/build/bump-version.sh +++ b/build/bump-version.sh @@ -31,6 +31,6 @@ echo $ANNOUNCE # Add a version notice to NEWS mv NEWS NEWS.bak chmod +w NEWS.bak -echo > NEWS echo $ANNOUNCE >> NEWS +echo >> NEWS cat NEWS.bak >> NEWS diff --git a/build/cmake/FindLibGCC.cmake b/build/cmake/FindLibGCC.cmake new file mode 100644 index 000000000000..5883ff802642 --- /dev/null +++ b/build/cmake/FindLibGCC.cmake @@ -0,0 +1,22 @@ +# - Find libgcc +# Find the libgcc library. +# +# LIBGCC_LIBRARIES - List of libraries when using libgcc +# LIBGCC_FOUND - True if libgcc found. + +IF (LIBGCC_LIBRARY) + # Already in cache, be silent + SET(LIBGCC_FIND_QUIETLY TRUE) +ENDIF (LIBGCC_LIBRARY) + +FIND_LIBRARY(LIBGCC_LIBRARY NAMES gcc libgcc) + +# handle the QUIETLY and REQUIRED arguments and set LIBGCC_FOUND to TRUE if +# all listed variables are TRUE +INCLUDE(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBGCC DEFAULT_MSG LIBGCC_LIBRARY) + +IF(LIBGCC_FOUND) + SET(LIBGCC_LIBRARIES ${LIBGCC_LIBRARY}) + SET(HAVE_LIBGCC 1) +ENDIF(LIBGCC_FOUND) diff --git a/build/cmake/FindNettle.cmake b/build/cmake/FindNettle.cmake new file mode 100644 index 000000000000..54ec9f5d39b5 --- /dev/null +++ b/build/cmake/FindNettle.cmake @@ -0,0 +1,23 @@ +# - Find Nettle +# Find the Nettle include directory and library +# +# NETTLE_INCLUDE_DIR - where to find , etc. +# NETTLE_LIBRARIES - List of libraries when using libnettle. +# NETTLE_FOUND - True if libnettle found. + +IF (NETTLE_INCLUDE_DIR) + # Already in cache, be silent + SET(NETTLE_FIND_QUIETLY TRUE) +ENDIF (NETTLE_INCLUDE_DIR) + +FIND_PATH(NETTLE_INCLUDE_DIR nettle/md5.h nettle/ripemd160.h nettle/sha.h) +FIND_LIBRARY(NETTLE_LIBRARY NAMES nettle libnettle) + +# handle the QUIETLY and REQUIRED arguments and set NETTLE_FOUND to TRUE if +# all listed variables are TRUE +INCLUDE(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(NETTLE DEFAULT_MSG NETTLE_LIBRARY NETTLE_INCLUDE_DIR) + +IF(NETTLE_FOUND) + SET(NETTLE_LIBRARIES ${NETTLE_LIBRARY}) +ENDIF(NETTLE_FOUND) diff --git a/build/cmake/FindPCREPOSIX.cmake b/build/cmake/FindPCREPOSIX.cmake new file mode 100644 index 000000000000..56cc17eacb47 --- /dev/null +++ b/build/cmake/FindPCREPOSIX.cmake @@ -0,0 +1,34 @@ +# - Find pcreposix +# Find the native PCRE and PCREPOSIX include and libraries +# +# PCRE_INCLUDE_DIR - where to find pcreposix.h, etc. +# PCREPOSIX_LIBRARIES - List of libraries when using libpcreposix. +# PCRE_LIBRARIES - List of libraries when using libpcre. +# PCREPOSIX_FOUND - True if libpcreposix found. +# PCRE_FOUND - True if libpcre found. + +IF (PCRE_INCLUDE_DIR) + # Already in cache, be silent + SET(PCRE_FIND_QUIETLY TRUE) +ENDIF (PCRE_INCLUDE_DIR) + +FIND_PATH(PCRE_INCLUDE_DIR pcreposix.h) +FIND_LIBRARY(PCREPOSIX_LIBRARY NAMES pcreposix libpcreposix) +FIND_LIBRARY(PCRE_LIBRARY NAMES pcre libpcre) + +# handle the QUIETLY and REQUIRED arguments and set PCREPOSIX_FOUND to TRUE if +# all listed variables are TRUE +INCLUDE(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(PCREPOSIX DEFAULT_MSG PCREPOSIX_LIBRARY PCRE_INCLUDE_DIR) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(PCRE DEFAULT_MSG PCRE_LIBRARY) + +IF(PCREPOSIX_FOUND) + SET(PCREPOSIX_LIBRARIES ${PCREPOSIX_LIBRARY}) + SET(HAVE_LIBPCREPOSIX 1) + SET(HAVE_PCREPOSIX_H 1) +ENDIF(PCREPOSIX_FOUND) + +IF(PCRE_FOUND) + SET(PCRE_LIBRARIES ${PCRE_LIBRARY}) + SET(HAVE_LIBPCRE 1) +ENDIF(PCRE_FOUND) diff --git a/build/cmake/LibarchiveCheckCSourceCompiles.cmake b/build/cmake/LibarchiveCheckCSourceCompiles.cmake new file mode 100644 index 000000000000..6b6f59334da4 --- /dev/null +++ b/build/cmake/LibarchiveCheckCSourceCompiles.cmake @@ -0,0 +1,106 @@ +# - Check if given C source compiles and links into an executable +# CHECK_C_SOURCE_COMPILES( [FAIL_REGEX ]) +# - source code to try to compile, must define 'main' +# - variable to store whether the source code compiled +# - fail if test output matches this regex +# The following variables may be set before calling this macro to +# modify the way the check is run: +# +# CMAKE_REQUIRED_FLAGS = string of compile command line flags +# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar) +# CMAKE_REQUIRED_INCLUDES = list of include directories +# CMAKE_REQUIRED_LIBRARIES = list of libraries to link + +#============================================================================= +# Copyright 2005-2009 Kitware, Inc. +# +# Distributed under the OSI-approved BSD License (the "License"); +# see accompanying file Copyright.txt for details. +# +# This software is distributed WITHOUT ANY WARRANTY; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the License for more information. +#============================================================================= +# (To distribute this file outside of CMake, substitute the full +# License text for the above reference.) + +# +# Extra arguments added by libarchive +# CMAKE_REQUIRED_LINKER_FLAGS = string of linker command line flags +# + +include(CMakeExpandImportedTargets) + + +macro(LIBARCHIVE_CHECK_C_SOURCE_COMPILES SOURCE VAR) + if("${VAR}" MATCHES "^${VAR}$") + set(_FAIL_REGEX) + set(_key) + foreach(arg ${ARGN}) + if("${arg}" MATCHES "^(FAIL_REGEX)$") + set(_key "${arg}") + elseif(_key) + list(APPEND _${_key} "${arg}") + else() + message(FATAL_ERROR "Unknown argument:\n ${arg}\n") + endif() + endforeach() + set(MACRO_CHECK_FUNCTION_DEFINITIONS + "-D${VAR} ${CMAKE_REQUIRED_FLAGS}") + if(CMAKE_REQUIRED_LIBRARIES) + # this one translates potentially used imported library targets to their files on disk + CMAKE_EXPAND_IMPORTED_TARGETS(_ADJUSTED_CMAKE_REQUIRED_LIBRARIES LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}") + set(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES + "-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}") + else() + set(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES) + endif() + if(CMAKE_REQUIRED_INCLUDES) + set(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES + "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}") + else() + set(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES) + endif() + if(CMAKE_REQUIRED_LINKER_FLAGS) + set(CHECK_C_SOURCE_COMPILES_ADD_LINKER_FLAGS + "-DCMAKE_EXE_LINKER_FLAGS:STRING=${CMAKE_REQUIRED_LINKER_FLAGS} -DCMAKE_SHARED_LINKER_FLAGS:STRING=${CMAKE_REQUIRED_LINKER_FLAGS} -DCMAKE_MODULE_LINKER_FLAGS:STRING=${CMAKE_REQUIRED_LINKER_FLAGS}") + else() + set(CHECK_C_SOURCE_COMPILES_ADD_LINKER_FLAGS) + endif() + file(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c" + "${SOURCE}\n") + + message(STATUS "Performing Test ${VAR}") + try_compile(${VAR} + ${CMAKE_BINARY_DIR} + ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c + COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} + CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS} ${CHECK_C_SOURCE_COMPILES_ADD_LINKER_FLAGS} + "${CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES}" + "${CHECK_C_SOURCE_COMPILES_ADD_INCLUDES}" + OUTPUT_VARIABLE OUTPUT) + + foreach(_regex ${_FAIL_REGEX}) + if("${OUTPUT}" MATCHES "${_regex}") + set(${VAR} 0) + endif() + endforeach() + + if(${VAR}) + set(${VAR} 1 CACHE INTERNAL "Test ${VAR}") + message(STATUS "Performing Test ${VAR} - Success") + file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + "Performing C SOURCE FILE Test ${VAR} succeded with the following output:\n" + "${OUTPUT}\n" + "Source file was:\n${SOURCE}\n") + else() + message(STATUS "Performing Test ${VAR} - Failed") + set(${VAR} "" CACHE INTERNAL "Test ${VAR}") + file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log + "Performing C SOURCE FILE Test ${VAR} failed with the following output:\n" + "${OUTPUT}\n" + "Source file was:\n${SOURCE}\n") + endif() + endif() +endmacro() + diff --git a/build/cmake/LibarchiveCheckCSourceRuns.cmake b/build/cmake/LibarchiveCheckCSourceRuns.cmake new file mode 100644 index 000000000000..498f52265aca --- /dev/null +++ b/build/cmake/LibarchiveCheckCSourceRuns.cmake @@ -0,0 +1,102 @@ +# - Check if the given C source code compiles and runs. +# CHECK_C_SOURCE_RUNS( ) +# - source code to try to compile +# - variable to store the result +# (1 for success, empty for failure) +# The following variables may be set before calling this macro to +# modify the way the check is run: +# +# CMAKE_REQUIRED_FLAGS = string of compile command line flags +# CMAKE_REQUIRED_DEFINITIONS = list of macros to define (-DFOO=bar) +# CMAKE_REQUIRED_INCLUDES = list of include directories +# CMAKE_REQUIRED_LIBRARIES = list of libraries to link + +#============================================================================= +# Copyright 2006-2009 Kitware, Inc. +# +# Distributed under the OSI-approved BSD License (the "License"); +# see accompanying file Copyright.txt for details. +# +# This software is distributed WITHOUT ANY WARRANTY; without even the +# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. +# See the License for more information. +#============================================================================= +# (To distribute this file outside of CMake, substitute the full +# License text for the above reference.) + +# +# Extra arguments added by libarchive +# CMAKE_REQUIRED_LINKER_FLAGS = string of linker command line flags +# + +include(CMakeExpandImportedTargets) + + +macro(LIBARCHIVE_CHECK_C_SOURCE_RUNS SOURCE VAR) + if("${VAR}" MATCHES "^${VAR}$") + set(MACRO_CHECK_FUNCTION_DEFINITIONS + "-D${VAR} ${CMAKE_REQUIRED_FLAGS}") + if(CMAKE_REQUIRED_LIBRARIES) + # this one translates potentially used imported library targets to their files on disk + CMAKE_EXPAND_IMPORTED_TARGETS(_ADJUSTED_CMAKE_REQUIRED_LIBRARIES LIBRARIES ${CMAKE_REQUIRED_LIBRARIES} CONFIGURATION "${CMAKE_TRY_COMPILE_CONFIGURATION}") + set(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES + "-DLINK_LIBRARIES:STRING=${_ADJUSTED_CMAKE_REQUIRED_LIBRARIES}") + else() + set(CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES) + endif() + if(CMAKE_REQUIRED_INCLUDES) + set(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES + "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_REQUIRED_INCLUDES}") + else() + set(CHECK_C_SOURCE_COMPILES_ADD_INCLUDES) + endif() + if(CMAKE_REQUIRED_LINKER_FLAGS) + set(CHECK_C_SOURCE_COMPILES_ADD_LINKER_FLAGS + "-DCMAKE_EXE_LINKER_FLAGS:STRING=${CMAKE_REQUIRED_LINKER_FLAGS} -DCMAKE_SHARED_LINKER_FLAGS:STRING=${CMAKE_REQUIRED_LINKER_FLAGS} -DCMAKE_MODULE_LINKER_FLAGS:STRING=${CMAKE_REQUIRED_LINKER_FLAGS}") + else() + set(CHECK_C_SOURCE_COMPILES_ADD_LINKER_FLAGS) + endif() + file(WRITE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c" + "${SOURCE}\n") + + message(STATUS "Performing Test ${VAR}") + try_run(${VAR}_EXITCODE ${VAR}_COMPILED + ${CMAKE_BINARY_DIR} + ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/src.c + COMPILE_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS} + CMAKE_FLAGS -DCOMPILE_DEFINITIONS:STRING=${MACRO_CHECK_FUNCTION_DEFINITIONS} ${CHECK_C_SOURCE_COMPILES_ADD_LINKER_FLAGS} + -DCMAKE_SKIP_RPATH:BOOL=${CMAKE_SKIP_RPATH} + "${CHECK_C_SOURCE_COMPILES_ADD_LIBRARIES}" + "${CHECK_C_SOURCE_COMPILES_ADD_INCLUDES}" + COMPILE_OUTPUT_VARIABLE OUTPUT) + # if it did not compile make the return value fail code of 1 + if(NOT ${VAR}_COMPILED) + set(${VAR}_EXITCODE 1) + endif() + # if the return value was 0 then it worked + if("${${VAR}_EXITCODE}" EQUAL 0) + set(${VAR} 1 CACHE INTERNAL "Test ${VAR}") + message(STATUS "Performing Test ${VAR} - Success") + file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + "Performing C SOURCE FILE Test ${VAR} succeded with the following output:\n" + "${OUTPUT}\n" + "Return value: ${${VAR}}\n" + "Source file was:\n${SOURCE}\n") + else() + if(CMAKE_CROSSCOMPILING AND "${${VAR}_EXITCODE}" MATCHES "FAILED_TO_RUN") + set(${VAR} "${${VAR}_EXITCODE}") + else() + set(${VAR} "" CACHE INTERNAL "Test ${VAR}") + endif() + + message(STATUS "Performing Test ${VAR} - Failed") + file(APPEND ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log + "Performing C SOURCE FILE Test ${VAR} failed with the following output:\n" + "${OUTPUT}\n" + "Return value: ${${VAR}_EXITCODE}\n" + "Source file was:\n${SOURCE}\n") + + endif() + endif() +endmacro() + diff --git a/build/cmake/config.h.in b/build/cmake/config.h.in index b56d2535b6d7..c04314ee5e32 100644 --- a/build/cmake/config.h.in +++ b/build/cmake/config.h.in @@ -390,6 +390,9 @@ typedef uint64_t uintmax_t; */ #cmakedefine HAVE_DIRENT_H 1 +/* Define to 1 if you have the `dirfd' function. */ +#cmakedefine HAVE_DIRFD 1 + /* Define to 1 if you have the header file. */ #cmakedefine HAVE_DLFCN_H 1 @@ -576,12 +579,27 @@ typedef uint64_t uintmax_t; /* Define to 1 if you have the `expat' library (-lexpat). */ #cmakedefine HAVE_LIBEXPAT 1 +/* Define to 1 if you have the `gcc' library (-lgcc). */ +#cmakedefine HAVE_LIBGCC 1 + /* Define to 1 if you have the `lzma' library (-llzma). */ #cmakedefine HAVE_LIBLZMA 1 /* Define to 1 if you have the `lzmadec' library (-llzmadec). */ #cmakedefine HAVE_LIBLZMADEC 1 +/* Define to 1 if you have the `lzo2' library (-llzo2). */ +#cmakedefine HAVE_LIBLZO2 1 + +/* Define to 1 if you have the `nettle' library (-lnettle). */ +#cmakedefine HAVE_LIBNETTLE 1 + +/* Define to 1 if you have the `pcre' library (-lpcre). */ +#cmakedefine HAVE_LIBPCRE 1 + +/* Define to 1 if you have the `pcreposix' library (-lpcreposix). */ +#cmakedefine HAVE_LIBPCREPOSIX 1 + /* Define to 1 if you have the `xml2' library (-lxml2). */ #cmakedefine HAVE_LIBXML2 1 @@ -661,6 +679,12 @@ typedef uint64_t uintmax_t; /* Define to 1 if you have the header file. */ #cmakedefine HAVE_LZMA_H 1 +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_LZO_LZO1X_H 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_LZO_LZOCONF_H 1 + /* Define to 1 if you have the `mbrtowc' function. */ #cmakedefine HAVE_MBRTOWC 1 @@ -685,6 +709,15 @@ typedef uint64_t uintmax_t; /* Define to 1 if you have the header file, and it defines `DIR'. */ #cmakedefine HAVE_NDIR_H 1 +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_NETTLE_MD5_H 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_NETTLE_RIPEMD160_H 1 + +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_NETTLE_SHA_H 1 + /* Define to 1 if you have the `nl_langinfo' function. */ #cmakedefine HAVE_NL_LANGINFO 1 @@ -694,6 +727,9 @@ typedef uint64_t uintmax_t; /* Define to 1 if you have the header file. */ #cmakedefine HAVE_PATHS_H 1 +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_PCREPOSIX_H 1 + /* Define to 1 if you have the `pipe' function. */ #cmakedefine HAVE_PIPE 1 @@ -703,6 +739,9 @@ typedef uint64_t uintmax_t; /* Define to 1 if you have the header file. */ #cmakedefine HAVE_POLL_H 1 +/* Define to 1 if you have the `posix_spawnp' function. */ +#cmakedefine HAVE_POSIX_SPAWNP 1 + /* Define to 1 if you have the header file. */ #cmakedefine HAVE_PROCESS_H 1 @@ -736,6 +775,9 @@ typedef uint64_t uintmax_t; /* Define to 1 if you have the header file. */ #cmakedefine HAVE_SIGNAL_H 1 +/* Define to 1 if you have the header file. */ +#cmakedefine HAVE_SPAWN_H 1 + /* Define to 1 if you have the `statfs' function. */ #cmakedefine HAVE_STATFS 1 diff --git a/build/makerelease.sh b/build/makerelease.sh index a8aa23b026c0..f2869dfca5ed 100755 --- a/build/makerelease.sh +++ b/build/makerelease.sh @@ -46,6 +46,7 @@ rm -rf _cmtest # # Construct and verify the autoconf build system # +export MAKE_LIBARCHIVE_RELEASE="1" /bin/sh build/autogen.sh # Get the newest config.guess/config.sub from savannah.gnu.org diff --git a/build/version b/build/version index f0f9f2611ac4..937b126a2ede 100644 --- a/build/version +++ b/build/version @@ -1 +1 @@ -3000004 +3001002 diff --git a/configure.ac b/configure.ac index 4993c2595a39..73944d3e0754 100644 --- a/configure.ac +++ b/configure.ac @@ -4,8 +4,8 @@ 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.0.4]) -m4_define([LIBARCHIVE_VERSION_N],[3000004]) +m4_define([LIBARCHIVE_VERSION_S],[3.1.2]) +m4_define([LIBARCHIVE_VERSION_N],[3001002]) dnl bsdtar and bsdcpio versioning tracks libarchive m4_define([BSDTAR_VERSION_S],LIBARCHIVE_VERSION_S()) @@ -26,6 +26,7 @@ AC_CONFIG_AUX_DIR([build/autoconf]) AC_CONFIG_MACRO_DIR([build/autoconf]) # Must follow AC_CONFIG macros above... AM_INIT_AUTOMAKE() +m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) # Libtool's "interface version" can be computed from the libarchive version. @@ -36,8 +37,8 @@ ARCHIVE_MINOR=$(( (LIBARCHIVE_VERSION_N() / 1000) % 1000 )) # Libarchive 2.8 == libtool interface 10 = 2 + 8 # Libarchive 2.9 == libtool interface 11 = 2 + 8 # Libarchive 3.0 == libtool interface 12 -# Libarchive 3.x == libtool interface 12 + x -ARCHIVE_INTERFACE=`echo $((12 + ${ARCHIVE_MINOR}))` +# Libarchive 3.1 == libtool interface 13 +ARCHIVE_INTERFACE=`echo $((13 + ${ARCHIVE_MINOR}))` # Libarchive revision is bumped on any source change === libtool revision ARCHIVE_REVISION=$(( LIBARCHIVE_VERSION_N() % 1000 )) # Libarchive minor is bumped on any interface addition === libtool age @@ -217,10 +218,10 @@ AS_VAR_IF([ac_cv_have_decl_EXT2_IOC_GETFLAGS], [yes], AC_CHECK_HEADERS([inttypes.h io.h langinfo.h limits.h]) AC_CHECK_HEADERS([linux/fiemap.h linux/fs.h linux/magic.h linux/types.h]) -AC_CHECK_HEADERS([locale.h paths.h poll.h pwd.h regex.h signal.h stdarg.h]) -AC_CHECK_HEADERS([stdint.h stdlib.h string.h]) -AC_CHECK_HEADERS([sys/acl.h sys/cdefs.h sys/extattr.h sys/ioctl.h]) -AC_CHECK_HEADERS([sys/mkdev.h sys/mount.h]) +AC_CHECK_HEADERS([locale.h paths.h poll.h pwd.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/extattr.h]) +AC_CHECK_HEADERS([sys/ioctl.h sys/mkdev.h sys/mount.h]) AC_CHECK_HEADERS([sys/param.h sys/poll.h sys/select.h sys/statfs.h sys/statvfs.h]) AC_CHECK_HEADERS([sys/time.h sys/utime.h sys/utsname.h sys/vfs.h]) AC_CHECK_HEADERS([time.h unistd.h utime.h wchar.h wctype.h]) @@ -246,7 +247,29 @@ AC_ARG_WITH([bz2lib], if test "x$with_bz2lib" != "xno"; then AC_CHECK_HEADERS([bzlib.h]) - AC_CHECK_LIB(bz2,BZ2_bzDecompressInit) + case "$host_os" in + *mingw* | *cygwin*) + dnl AC_CHECK_LIB cannot be used on the Windows port of libbz2, therefore + dnl use AC_LINK_IFELSE. + AC_MSG_CHECKING([for BZ2_bzDecompressInit in -lbz2]) + old_LIBS="$LIBS" + LIBS="-lbz2 $LIBS" + AC_LINK_IFELSE( + [AC_LANG_SOURCE(#include + int main() { return BZ2_bzDecompressInit(NULL, 0, 0); })], + [ac_cv_lib_bz2_BZ2_bzDecompressInit=yes], + [ac_cv_lib_bz2_BZ2_bzDecompressInit=no]) + LIBS="$old_LIBS" + AC_MSG_RESULT($ac_cv_lib_bz2_BZ2_bzDecompressInit) + if test "x$ac_cv_lib_bz2_BZ2_bzDecompressInit" = xyes; then + AC_DEFINE([HAVE_LIBBZ2], [1], [Define to 1 if you have the `bz2' library (-lbz2).]) + LIBS="-lbz2 $LIBS" + fi + ;; + *) + AC_CHECK_LIB(bz2,BZ2_bzDecompressInit) + ;; + esac fi AC_ARG_WITH([lzmadec], @@ -284,6 +307,14 @@ if test "x$with_lzma" != "xno"; then AC_CHECK_LIB(lzma,lzma_stream_decoder) fi +AC_ARG_WITH([lzo2], + AS_HELP_STRING([--without-lzo2], [Don't build support for lzop through liblzo2])) + +if test "x$with_lzo2" != "xno"; then + AC_CHECK_HEADERS([lzo/lzoconf.h lzo/lzo1x.h]) + AC_CHECK_LIB(lzo2,lzo1x_decompress_safe) +fi + AC_ARG_WITH([nettle], AS_HELP_STRING([--without-nettle], [Don't build with crypto support from Nettle])) AC_ARG_WITH([openssl], @@ -315,12 +346,61 @@ if test "x$ac_cv_header_libxml_xmlreader_h" != "xyes"; then fi fi -AC_ARG_WITH([libregex], - AS_HELP_STRING([--without-libregex], [Don't build support for regex through libregex])) +AC_ARG_ENABLE([posix-regex-lib], + [AS_HELP_STRING([--enable-posix-regex-lib], + [choose what library to use for POSIX regular expression support (default: auto)]) + 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([--disable-posix-regex-lib], [don't enable POSIX regular expression support])], + [], [enable_posix_regex_lib=auto]) -if test "x$with_libregex" != "xno"; then +posix_regex_lib_found= +if test "$enable_posix_regex_lib" = "auto" || test "$enable_posix_regex_lib" = "libc" || test "$enable_posix_regex_lib" = "libregex"; then + AC_CHECK_HEADERS([regex.h]) if test "x$ac_cv_header_regex_h" != "xno"; then - AC_CHECK_FUNC(regcomp, , [AC_CHECK_LIB(regex,regcomp)]) + AC_CHECK_FUNC(regcomp) + if test "x$ac_cv_func_regcomp" = xyes; then + posix_regex_lib_found=1 + else + AC_CHECK_LIB(regex,regcomp) + if test "x$ac_cv_lib_regex_regcomp" = xyes; then + posix_regex_lib_found=1 + fi + fi + fi +fi +if test -z $posix_regex_lib_found && (test "$enable_posix_regex_lib" = "auto" || test "$enable_posix_regex_lib" = "libpcreposix"); then + AC_CHECK_HEADERS([pcreposix.h]) + AC_CHECK_LIB(pcreposix,regcomp) + if test "x$ac_cv_lib_pcreposix_regcomp" != xyes; then + AC_MSG_NOTICE(trying libpcreposix check again with libpcre) + unset ac_cv_lib_pcreposix_regcomp + AC_CHECK_LIB(pcre,pcre_exec) + AC_CHECK_LIB(pcreposix,regcomp) + if test "x$ac_cv_lib_pcre_pcre_exec" = xyes && test "x$ac_cv_lib_pcreposix_regcomp" = xyes; then + AC_MSG_CHECKING(if PCRE_STATIC needs to be defined) + AC_LINK_IFELSE( + [AC_LANG_SOURCE(#include + int main() { return regcomp(NULL, NULL, 0); })], + [without_pcre_static=yes], + [without_pcre_static=no]) + AC_LINK_IFELSE( + [AC_LANG_SOURCE(#define PCRE_STATIC + #include + int main() { return regcomp(NULL, NULL, 0); })], + [with_pcre_static=yes], + [with_pcre_static=no]) + if test "x$without_pcre_static" != xyes && test "x$with_pcre_static" = xyes; then + AC_MSG_RESULT(yes) + AC_DEFINE([PCRE_STATIC], [1], [Define to 1 if PCRE_STATIC needs to be defined.]) + elif test "x$without_pcre_static" = xyes || test "x$with_pcre_static" = xyes; then + AC_MSG_RESULT(no) + fi + posix_regex_lib_found=1 + fi + else + posix_regex_lib_found=1 fi fi @@ -432,7 +512,7 @@ AC_FUNC_VPRINTF # To avoid necessity for including windows.h or special forward declaration # workarounds, we use 'void *' for 'struct SECURITY_ATTRIBUTES *' AC_CHECK_STDCALL_FUNC([CreateHardLinkA],[const char *, const char *, void *]) -AC_CHECK_FUNCS([chflags chown chroot ctime_r]) +AC_CHECK_FUNCS([chflags chown chroot ctime_r dirfd]) AC_CHECK_FUNCS([fchdir fchflags fchmod fchown fcntl fdopendir fork]) AC_CHECK_FUNCS([fstat fstatat fstatfs fstatvfs ftruncate]) AC_CHECK_FUNCS([futimens futimes futimesat]) @@ -441,7 +521,7 @@ AC_CHECK_FUNCS([getpwnam_r getpwuid_r getvfsbyname gmtime_r]) AC_CHECK_FUNCS([lchflags lchmod lchown link localtime_r lstat lutimes]) AC_CHECK_FUNCS([mbrtowc memmove memset]) AC_CHECK_FUNCS([mkdir mkfifo mknod mkstemp]) -AC_CHECK_FUNCS([nl_langinfo openat pipe poll readlink readlinkat]) +AC_CHECK_FUNCS([nl_langinfo openat pipe poll posix_spawnp readlink readlinkat]) AC_CHECK_FUNCS([select setenv setlocale sigaction statfs statvfs]) AC_CHECK_FUNCS([strchr strdup strerror strncpy_s strrchr symlink timegm]) AC_CHECK_FUNCS([tzset unsetenv utime utimensat utimes vfork]) @@ -553,10 +633,8 @@ AC_SYS_LARGEFILE dnl NOTE: Crypto checks must run last. AC_DEFUN([CRYPTO_CHECK], [ if test "$found_$1" != yes; then - saved_LIBS="$LIBS" saved_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS -I. -I$srcdir -I$srcdir/libarchive" - LIBS="$LIBS $mdLIBS $4" touch "check_crypto_md.h" AC_MSG_CHECKING([support for ARCHIVE_CRYPTO_$1_$2]) AC_LINK_IFELSE([AC_LANG_SOURCE([ @@ -578,63 +656,133 @@ main(int argc, char **argv) ])], [ AC_MSG_RESULT([yes]) found_$1=yes - if [[ -n "$4" ]]; then - # The .$4 avoids -e, which doesn't work on Solaris 10 - # The _$mdLIBS allows .$4 to match at beginning of string - test -n "$(echo _$mdLIBS | $GREP .$4)" || mdLIBS="$mdLIBS $4" - fi + found_$2=yes AC_DEFINE(ARCHIVE_CRYPTO_$1_$2, 1, [ $1 via ARCHIVE_CRYPTO_$1_$2 supported.]) ], [ AC_MSG_RESULT([no])]) - LIBS="$saved_LIBS" CPPFLAGS="$saved_CPPFLAGS" rm "check_crypto_md.h" fi ]) -CRYPTO_CHECK(MD5, LIBC, md5) -CRYPTO_CHECK(MD5, LIBSYSTEM, md5) -CRYPTO_CHECK(RMD160, LIBC, rmd160) -CRYPTO_CHECK(SHA1, LIBC, sha1) -CRYPTO_CHECK(SHA1, LIBSYSTEM, sha1) -CRYPTO_CHECK(SHA256, LIBC, sha256) -CRYPTO_CHECK(SHA256, LIBC2, sha256) -CRYPTO_CHECK(SHA256, LIBC3, sha256) -CRYPTO_CHECK(SHA256, LIBSYSTEM, sha256) -CRYPTO_CHECK(SHA384, LIBC, sha384) -CRYPTO_CHECK(SHA384, LIBC2, sha384) -CRYPTO_CHECK(SHA384, LIBC3, sha384) -CRYPTO_CHECK(SHA384, LIBSYSTEM, sha384) -CRYPTO_CHECK(SHA512, LIBC, sha512) -CRYPTO_CHECK(SHA512, LIBC2, sha512) -CRYPTO_CHECK(SHA512, LIBC3, sha512) -CRYPTO_CHECK(SHA512, LIBSYSTEM, sha512) +AC_DEFUN([CRYPTO_CHECK_WIN], [ + if test "$found_$1" != yes; then + AC_MSG_CHECKING([support for ARCHIVE_CRYPTO_$1_WIN]) + AC_LINK_IFELSE([AC_LANG_SOURCE([ +#define ARCHIVE_$1_COMPILE_TEST +#include +#include + +int +main(int argc, char **argv) +{ + (void)argc; + (void)argv; + + return ($2); +} +])], + [ AC_MSG_RESULT([yes]) + found_$1=yes + found_WIN=yes + AC_DEFINE(ARCHIVE_CRYPTO_$1_WIN, 1, [ $1 via ARCHIVE_CRYPTO_$1_WIN supported.]) + ], + [ AC_MSG_RESULT([no])]) + fi +]) + +case "$host_os" in + *mingw* | *cygwin*) + ;; + *) + CRYPTO_CHECK(MD5, LIBC, md5) + CRYPTO_CHECK(MD5, LIBSYSTEM, md5) + CRYPTO_CHECK(RMD160, LIBC, rmd160) + CRYPTO_CHECK(SHA1, LIBC, sha1) + CRYPTO_CHECK(SHA1, LIBSYSTEM, sha1) + CRYPTO_CHECK(SHA256, LIBC, sha256) + CRYPTO_CHECK(SHA256, LIBC2, sha256) + CRYPTO_CHECK(SHA256, LIBC3, sha256) + CRYPTO_CHECK(SHA256, LIBSYSTEM, sha256) + CRYPTO_CHECK(SHA384, LIBC, sha384) + CRYPTO_CHECK(SHA384, LIBC2, sha384) + CRYPTO_CHECK(SHA384, LIBC3, sha384) + CRYPTO_CHECK(SHA384, LIBSYSTEM, sha384) + CRYPTO_CHECK(SHA512, LIBC, sha512) + CRYPTO_CHECK(SHA512, LIBC2, sha512) + CRYPTO_CHECK(SHA512, LIBC3, sha512) + CRYPTO_CHECK(SHA512, LIBSYSTEM, sha512) + ;; +esac if test "x$with_nettle" != "xno"; then - CRYPTO_CHECK(MD5, NETTLE, md5, -lnettle) - CRYPTO_CHECK(RMD160, NETTLE, rmd160, -lnettle) - CRYPTO_CHECK(SHA1, NETTLE, sha1, -lnettle) - CRYPTO_CHECK(SHA256, NETTLE, sha256, -lnettle) - CRYPTO_CHECK(SHA384, NETTLE, sha384, -lnettle) - CRYPTO_CHECK(SHA512, NETTLE, sha512, -lnettle) + AC_CHECK_HEADERS([nettle/md5.h nettle/ripemd160.h nettle/sha.h]) + saved_LIBS=$LIBS + AC_CHECK_LIB(nettle,main) + CRYPTO_CHECK(MD5, NETTLE, md5) + CRYPTO_CHECK(RMD160, NETTLE, rmd160) + CRYPTO_CHECK(SHA1, NETTLE, sha1) + CRYPTO_CHECK(SHA256, NETTLE, sha256) + CRYPTO_CHECK(SHA384, NETTLE, sha384) + CRYPTO_CHECK(SHA512, NETTLE, sha512) + if test "x$found_NETTLE" != "xyes"; then + LIBS=$saved_LIBS + fi fi if test "x$with_openssl" != "xno"; then - CRYPTO_CHECK(MD5, OPENSSL, md5, -lcrypto) - CRYPTO_CHECK(RMD160, OPENSSL, rmd160, -lcrypto) - CRYPTO_CHECK(SHA1, OPENSSL, sha1, -lcrypto) - CRYPTO_CHECK(SHA256, OPENSSL, sha256, -lcrypto) - CRYPTO_CHECK(SHA384, OPENSSL, sha384, -lcrypto) - CRYPTO_CHECK(SHA512, OPENSSL, sha512, -lcrypto) + AC_CHECK_HEADERS([openssl/evp.h]) + saved_LIBS=$LIBS + case "$host_os" in + *mingw* | *cygwin*) + case "$host_cpu" in + x86_64) + AC_CHECK_LIB(eay64,main) + if test "x$ac_cv_lib_eay64_main" != "xyes"; then + AC_CHECK_LIB(eay32,main) + fi + ;; + *) + AC_CHECK_LIB(eay32,main) + ;; + esac + ;; + *) + AC_CHECK_LIB(crypto,main) + ;; + esac + CRYPTO_CHECK(MD5, OPENSSL, md5) + CRYPTO_CHECK(RMD160, OPENSSL, rmd160) + CRYPTO_CHECK(SHA1, OPENSSL, sha1) + CRYPTO_CHECK(SHA256, OPENSSL, sha256) + CRYPTO_CHECK(SHA384, OPENSSL, sha384) + CRYPTO_CHECK(SHA512, OPENSSL, sha512) + if test "x$found_OPENSSL" != "xyes"; then + LIBS=$saved_LIBS + fi fi # Probe libmd AFTER OpenSSL/libcrypto. # The two are incompatible and OpenSSL is more complete. -CRYPTO_CHECK(MD5, LIBMD, md5, -lmd) -CRYPTO_CHECK(RMD160, LIBMD, rmd160, -lmd) -CRYPTO_CHECK(SHA1, LIBMD, sha1, -lmd) -CRYPTO_CHECK(SHA256, LIBMD, sha256, -lmd) -CRYPTO_CHECK(SHA512, LIBMD, sha512, -lmd) +AC_CHECK_HEADERS([md5.h ripemd.h sha.h sha256.h sha512.h]) +saved_LIBS=$LIBS +AC_CHECK_LIB(md,main) +CRYPTO_CHECK(MD5, LIBMD, md5) +CRYPTO_CHECK(RMD160, LIBMD, rmd160) +CRYPTO_CHECK(SHA1, LIBMD, sha1) +CRYPTO_CHECK(SHA256, LIBMD, sha256) +CRYPTO_CHECK(SHA512, LIBMD, sha512) +if test "x$found_LIBMD" != "xyes"; then + LIBS=$saved_LIBS +fi -LIBS="$LIBS $mdLIBS" +case "$host_os" in + *mingw* | *cygwin*) + CRYPTO_CHECK_WIN(MD5, CALG_MD5) + CRYPTO_CHECK_WIN(SHA1, CALG_SHA1) + CRYPTO_CHECK_WIN(SHA256, CALG_SHA_256) + CRYPTO_CHECK_WIN(SHA384, CALG_SHA_384) + CRYPTO_CHECK_WIN(SHA512, CALG_SHA_512) + ;; +esac AC_OUTPUT diff --git a/cpio/bsdcpio.1 b/cpio/bsdcpio.1 index 5611b20e9aea..b3d0d40a21ad 100644 --- a/cpio/bsdcpio.1 +++ b/cpio/bsdcpio.1 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 24, 2011 +.Dd October 7, 2012 .Dt CPIO 1 .Os .Sh NAME @@ -176,11 +176,21 @@ With this option, the target of the link will be archived or copied instead. (p mode only) Create links from the target directory to the original files, instead of copying. +.It Fl Fl lrzip +(o mode only) +Compress the resulting archive with +.Xr lrzip 1 . +In input mode, this option is ignored. .It Fl Fl lzma (o mode only) Compress the file with lzma-compatible compression before writing it. In input mode, this option is ignored; lzma compression is recognized automatically on input. +.It Fl Fl lzop +(o mode only) +Compress the resulting archive with +.Xr lzop 1 . +In input mode, this option is ignored. .It Fl m , Fl Fl preserve-modification-time (i and p modes) Set file modification time on created files to match diff --git a/cpio/cmdline.c b/cpio/cmdline.c index 438c27cf6a77..0121fd13937f 100644 --- a/cpio/cmdline.c +++ b/cpio/cmdline.c @@ -61,16 +61,20 @@ static const struct option { int required; /* 1 if this option requires an argument */ int equivalent; /* Equivalent short option. */ } cpio_longopts[] = { + { "b64encode", 0, OPTION_B64ENCODE }, { "create", 0, 'o' }, { "dot", 0, 'V' }, { "extract", 0, 'i' }, { "file", 1, 'F' }, { "format", 1, 'H' }, + { "grzip", 0, OPTION_GRZIP }, { "help", 0, 'h' }, { "insecure", 0, OPTION_INSECURE }, { "link", 0, 'l' }, { "list", 0, 't' }, + { "lrzip", 0, OPTION_LRZIP }, { "lzma", 0, OPTION_LZMA }, + { "lzop", 0, OPTION_LZOP }, { "make-directories", 0, 'd' }, { "no-preserve-owner", 0, OPTION_NO_PRESERVE_OWNER }, { "null", 0, '0' }, @@ -81,6 +85,7 @@ static const struct option { { "preserve-owner", 0, OPTION_PRESERVE_OWNER }, { "quiet", 0, OPTION_QUIET }, { "unconditional", 0, 'u' }, + { "uuencode", 0, OPTION_UUENCODE }, { "verbose", 0, 'v' }, { "version", 0, OPTION_VERSION }, { "xz", 0, 'J' }, diff --git a/cpio/cpio.c b/cpio/cpio.c index 7095b6207e4f..6f57d95d616e 100644 --- a/cpio/cpio.c +++ b/cpio/cpio.c @@ -207,6 +207,9 @@ main(int argc, char *argv[]) case 'B': /* POSIX 1997 */ cpio->bytes_per_block = 5120; break; + case OPTION_B64ENCODE: + cpio->add_filter = opt; + break; case 'C': /* NetBSD/OpenBSD */ cpio->bytes_per_block = atoi(cpio->argument); if (cpio->bytes_per_block <= 0) @@ -234,6 +237,9 @@ main(int argc, char *argv[]) lafe_errc(1, 0, "Error : %s", archive_error_string(cpio->matching)); break; + case OPTION_GRZIP: + cpio->compress = opt; + break; case 'H': /* GNU cpio (also --format) */ cpio->format = cpio->argument; break; @@ -265,7 +271,9 @@ main(int argc, char *argv[]) case 'l': /* POSIX 1997 */ cpio->option_link = 1; break; + case OPTION_LRZIP: case OPTION_LZMA: /* GNU tar, others */ + case OPTION_LZOP: /* GNU tar, others */ cpio->compress = opt; break; case 'm': /* POSIX 1997 */ @@ -326,6 +334,9 @@ main(int argc, char *argv[]) cpio->extract_flags &= ~ARCHIVE_EXTRACT_NO_OVERWRITE_NEWER; break; + case OPTION_UUENCODE: + cpio->add_filter = opt; + break; case 'v': /* POSIX 1997 */ cpio->verbose++; break; @@ -417,6 +428,7 @@ main(int argc, char *argv[]) archive_match_free(cpio->matching); free_cache(cpio->gname_cache); free_cache(cpio->uname_cache); + free(cpio->destdir); return (cpio->return_value); } @@ -516,27 +528,49 @@ mode_out(struct cpio *cpio) if (cpio->archive == NULL) lafe_errc(1, 0, "Failed to allocate archive object"); switch (cpio->compress) { + case OPTION_GRZIP: + r = archive_write_add_filter_grzip(cpio->archive); + break; case 'J': - r = archive_write_set_compression_xz(cpio->archive); + r = archive_write_add_filter_xz(cpio->archive); + break; + case OPTION_LRZIP: + r = archive_write_add_filter_lrzip(cpio->archive); break; case OPTION_LZMA: - r = archive_write_set_compression_lzma(cpio->archive); + r = archive_write_add_filter_lzma(cpio->archive); + break; + case OPTION_LZOP: + r = archive_write_add_filter_lzop(cpio->archive); break; case 'j': case 'y': - r = archive_write_set_compression_bzip2(cpio->archive); + r = archive_write_add_filter_bzip2(cpio->archive); break; case 'z': - r = archive_write_set_compression_gzip(cpio->archive); + r = archive_write_add_filter_gzip(cpio->archive); break; case 'Z': - r = archive_write_set_compression_compress(cpio->archive); + r = archive_write_add_filter_compress(cpio->archive); break; default: - r = archive_write_set_compression_none(cpio->archive); + r = archive_write_add_filter_none(cpio->archive); break; } if (r < ARCHIVE_WARN) lafe_errc(1, 0, "Requested compression not available"); + switch (cpio->add_filter) { + case 0: + r = ARCHIVE_OK; + break; + case OPTION_B64ENCODE: + r = archive_write_add_filter_b64encode(cpio->archive); + break; + case OPTION_UUENCODE: + r = archive_write_add_filter_uuencode(cpio->archive); + break; + } + if (r < ARCHIVE_WARN) + lafe_errc(1, 0, "Requested filter not available"); r = archive_write_set_format_by_name(cpio->archive, cpio->format); if (r != ARCHIVE_OK) lafe_errc(1, 0, "%s", archive_error_string(cpio->archive)); @@ -548,7 +582,7 @@ mode_out(struct cpio *cpio) /* * The main loop: Copy each file into the output archive. */ - r = archive_write_open_file(cpio->archive, cpio->filename); + r = archive_write_open_filename(cpio->archive, cpio->filename); if (r != ARCHIVE_OK) lafe_errc(1, 0, "%s", archive_error_string(cpio->archive)); lr = lafe_line_reader("-", cpio->option_null); @@ -577,7 +611,7 @@ mode_out(struct cpio *cpio) if (!cpio->quiet) { int64_t blocks = - (archive_position_uncompressed(cpio->archive) + 511) + (archive_filter_bytes(cpio->archive, 0) + 511) / 512; fprintf(stderr, "%lu %s\n", (unsigned long)blocks, blocks == 1 ? "block" : "blocks"); @@ -806,18 +840,21 @@ entry_to_archive(struct cpio *cpio, struct archive_entry *entry) exit(1); if (r >= ARCHIVE_WARN && archive_entry_size(entry) > 0 && fd >= 0) { - bytes_read = read(fd, cpio->buff, cpio->buff_size); + bytes_read = read(fd, cpio->buff, (unsigned)cpio->buff_size); while (bytes_read > 0) { - r = archive_write_data(cpio->archive, + ssize_t bytes_write; + bytes_write = archive_write_data(cpio->archive, cpio->buff, bytes_read); - if (r < 0) + if (bytes_write < 0) lafe_errc(1, archive_errno(cpio->archive), "%s", archive_error_string(cpio->archive)); - if (r < bytes_read) { + if (bytes_write < bytes_read) { lafe_warnc(0, - "Truncated write; file may have grown while being archived."); + "Truncated write; file may have " + "grown while being archived."); } - bytes_read = read(fd, cpio->buff, cpio->buff_size); + bytes_read = read(fd, cpio->buff, + (unsigned)cpio->buff_size); } } @@ -908,7 +945,8 @@ mode_in(struct cpio *cpio) archive_read_support_filter_all(a); archive_read_support_format_all(a); - if (archive_read_open_file(a, cpio->filename, cpio->bytes_per_block)) + if (archive_read_open_filename(a, cpio->filename, + cpio->bytes_per_block)) lafe_errc(1, archive_errno(a), "%s", archive_error_string(a)); for (;;) { @@ -957,7 +995,7 @@ mode_in(struct cpio *cpio) if (r != ARCHIVE_OK) lafe_errc(1, 0, "%s", archive_error_string(ext)); if (!cpio->quiet) { - int64_t blocks = (archive_position_uncompressed(a) + 511) + int64_t blocks = (archive_filter_bytes(a, 0) + 511) / 512; fprintf(stderr, "%lu %s\n", (unsigned long)blocks, blocks == 1 ? "block" : "blocks"); @@ -988,7 +1026,7 @@ extract_data(struct archive *ar, struct archive *aw) "%s", archive_error_string(ar)); exit(1); } - r = archive_write_data_block(aw, block, size, offset); + r = (int)archive_write_data_block(aw, block, size, offset); if (r != ARCHIVE_OK) { lafe_warnc(archive_errno(aw), "%s", archive_error_string(aw)); @@ -1010,7 +1048,8 @@ mode_list(struct cpio *cpio) archive_read_support_filter_all(a); archive_read_support_format_all(a); - if (archive_read_open_file(a, cpio->filename, cpio->bytes_per_block)) + if (archive_read_open_filename(a, cpio->filename, + cpio->bytes_per_block)) lafe_errc(1, archive_errno(a), "%s", archive_error_string(a)); for (;;) { @@ -1032,7 +1071,7 @@ mode_list(struct cpio *cpio) if (r != ARCHIVE_OK) lafe_errc(1, 0, "%s", archive_error_string(a)); if (!cpio->quiet) { - int64_t blocks = (archive_position_uncompressed(a) + 511) + int64_t blocks = (archive_filter_bytes(a, 0) + 511) / 512; fprintf(stderr, "%lu %s\n", (unsigned long)blocks, blocks == 1 ? "block" : "blocks"); @@ -1167,7 +1206,7 @@ mode_pass(struct cpio *cpio, const char *destdir) if (!cpio->quiet) { int64_t blocks = - (archive_position_uncompressed(cpio->archive) + 511) + (archive_filter_bytes(cpio->archive, 0) + 511) / 512; fprintf(stderr, "%lu %s\n", (unsigned long)blocks, blocks == 1 ? "block" : "blocks"); diff --git a/cpio/cpio.h b/cpio/cpio.h index 7e276bdbaf79..3e951ce7403e 100644 --- a/cpio/cpio.h +++ b/cpio/cpio.h @@ -44,6 +44,7 @@ struct cpio { const char *argument; /* Options */ + int add_filter; /* --uuencode */ const char *filename; int mode; /* -i -o -p */ int compress; /* -j, -y, or -z */ @@ -96,11 +97,16 @@ const char *owner_parse(const char *, int *, int *); /* Fake short equivalents for long options that otherwise lack them. */ enum { - OPTION_INSECURE = 1, + OPTION_B64ENCODE = 1, + OPTION_GRZIP, + OPTION_INSECURE, + OPTION_LRZIP, OPTION_LZMA, + OPTION_LZOP, OPTION_NO_PRESERVE_OWNER, OPTION_PRESERVE_OWNER, OPTION_QUIET, + OPTION_UUENCODE, OPTION_VERSION }; diff --git a/cpio/test/CMakeLists.txt b/cpio/test/CMakeLists.txt index a06ae0496ec4..09ca2c7d96b3 100644 --- a/cpio/test/CMakeLists.txt +++ b/cpio/test/CMakeLists.txt @@ -7,11 +7,21 @@ IF(ENABLE_CPIO AND ENABLE_TEST) SET(bsdcpio_test_SOURCES ../cmdline.c ../../libarchive_fe/err.c + ../../test_utils/test_utils.c main.c test.h test_0.c test_basic.c test_cmdline.c + test_extract_cpio_Z + test_extract_cpio_bz2 + test_extract_cpio_grz + test_extract_cpio_gz + test_extract_cpio_lrz + test_extract_cpio_lz + test_extract_cpio_lzma + test_extract_cpio_lzo + test_extract_cpio_xz test_format_newc.c test_gcpio_compat.c test_option_0.c @@ -21,16 +31,22 @@ IF(ENABLE_CPIO AND ENABLE_TEST) test_option_L_upper.c test_option_Z_upper.c test_option_a.c + test_option_b64encode.c test_option_c.c test_option_d.c test_option_f.c + test_option_grzip.c test_option_help.c test_option_l.c + test_option_lrzip.c test_option_lzma.c + test_option_lzop.c test_option_m.c test_option_t.c test_option_u.c + test_option_uuencode.c test_option_version.c + test_option_xz.c test_option_y.c test_option_z.c test_owner_parse.c @@ -65,6 +81,8 @@ IF(ENABLE_CPIO AND ENABLE_TEST) ENDMACRO (DEFINE_TEST _testname) INCLUDE(${CMAKE_CURRENT_BINARY_DIR}/list.h) + INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) + INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/test_utils) # Experimental new test handling ADD_CUSTOM_TARGET(run_bsdcpio_test diff --git a/cpio/test/main.c b/cpio/test/main.c index e190123d5c83..d4c6e5c3388c 100644 --- a/cpio/test/main.c +++ b/cpio/test/main.c @@ -24,6 +24,7 @@ */ #include "test.h" +#include "test_utils.h" #ifdef HAVE_SYS_IOCTL_H #include #endif @@ -91,6 +92,7 @@ __FBSDID("$FreeBSD: src/usr.bin/cpio/test/main.c,v 1.3 2008/08/24 04:58:22 kient */ #if defined(_WIN32) && !defined(__CYGWIN__) #include +#include #include #ifndef F_OK #define F_OK (0) @@ -389,7 +391,6 @@ failure_finish(void *extra) fprintf(stderr, " *** forcing core dump so failure can be debugged ***\n"); abort(); - exit(1); } } @@ -622,8 +623,8 @@ assertion_equal_string(const char *file, int line, if (v1 == v2 || (v1 != NULL && v2 != NULL && strcmp(v1, v2) == 0)) return (1); failure_start(file, line, "%s != %s", e1, e2); - l1 = strlen(e1); - l2 = strlen(e2); + l1 = (int)strlen(e1); + l2 = (int)strlen(e2); if (l1 < l2) l1 = l2; strdump(e1, v1, l1, utf8); @@ -746,6 +747,8 @@ assertion_equal_mem(const char *file, int line, assertion_count(file, line); if (v1 == v2 || (v1 != NULL && v2 != NULL && memcmp(v1, v2, l) == 0)) return (1); + if (v1 == NULL || v2 == NULL) + return (0); failure_start(file, line, "%s != %s", e1, e2); logprintf(" size %s = %d\n", ld, (int)l); @@ -839,9 +842,14 @@ assertion_equal_file(const char *filename, int line, const char *fn1, const char f1 = fopen(fn1, "rb"); f2 = fopen(fn2, "rb"); + if (f1 == NULL || f2 == NULL) { + if (f1) fclose(f1); + if (f2) fclose(f2); + return (0); + } for (;;) { - n1 = fread(buff1, 1, sizeof(buff1), f1); - n2 = fread(buff2, 1, sizeof(buff2), f2); + n1 = (int)fread(buff1, 1, sizeof(buff1), f1); + n2 = (int)fread(buff2, 1, sizeof(buff2), f2); if (n1 != n2) break; if (n1 == 0 && n2 == 0) { @@ -915,7 +923,7 @@ assertion_file_contents(const char *filename, int line, const void *buff, int s, return (0); } contents = malloc(s * 2); - n = fread(contents, 1, s * 2, f); + n = (int)fread(contents, 1, s * 2, f); fclose(f); if (n == s && memcmp(buff, contents, s) == 0) { free(contents); @@ -951,9 +959,9 @@ assertion_text_file_contents(const char *filename, int line, const char *buff, c failure_finish(NULL); return (0); } - s = strlen(buff); + s = (int)strlen(buff); contents = malloc(s * 2 + 128); - n = fread(contents, 1, s * 2 + 128 - 1, f); + n = (int)fread(contents, 1, s * 2 + 128 - 1, f); if (n >= 0) contents[n] = '\0'; fclose(f); @@ -1004,8 +1012,8 @@ assertion_file_contains_lines_any_order(const char *file, int line, char *buff; size_t buff_size; size_t expected_count, actual_count, i, j; - char **expected; - char *p, **actual; + char **expected = NULL; + char *p, **actual = NULL; char c; int expected_failure = 0, actual_failure = 0; @@ -1018,14 +1026,21 @@ assertion_file_contains_lines_any_order(const char *file, int line, return (0); } - /* Make a copy of the provided lines and count up the expected file size. */ - expected_count = 0; + /* Make a copy of the provided lines and count up the expected + * file size. */ for (i = 0; lines[i] != NULL; ++i) { } expected_count = i; - expected = malloc(sizeof(char *) * expected_count); - for (i = 0; lines[i] != NULL; ++i) { - expected[i] = strdup(lines[i]); + if (expected_count) { + expected = malloc(sizeof(char *) * expected_count); + if (expected == NULL) { + failure_start(pathname, line, "Can't allocate memory"); + failure_finish(NULL); + return (0); + } + for (i = 0; lines[i] != NULL; ++i) { + expected[i] = strdup(lines[i]); + } } /* Break the file into lines */ @@ -1037,11 +1052,19 @@ assertion_file_contains_lines_any_order(const char *file, int line, ++actual_count; c = *p; } - actual = malloc(sizeof(char *) * actual_count); - for (j = 0, p = buff; p < buff + buff_size; p += 1 + strlen(p)) { - if (*p != '\0') { - actual[j] = p; - ++j; + if (actual_count) { + actual = calloc(sizeof(char *), actual_count); + if (actual == NULL) { + failure_start(pathname, line, "Can't allocate memory"); + failure_finish(NULL); + free(expected); + return (0); + } + for (j = 0, p = buff; p < buff + buff_size; p += 1 + strlen(p)) { + if (*p != '\0') { + actual[j] = p; + ++j; + } } } @@ -1176,11 +1199,11 @@ assertion_file_time(const char *file, int line, #if defined(_WIN32) && !defined(__CYGWIN__) #define EPOC_TIME (116444736000000000ULL) - FILETIME ftime, fbirthtime, fatime, fmtime; + FILETIME fxtime, fbirthtime, fatime, fmtime; ULARGE_INTEGER wintm; HANDLE h; - ftime.dwLowDateTime = 0; - ftime.dwHighDateTime = 0; + fxtime.dwLowDateTime = 0; + fxtime.dwHighDateTime = 0; assertion_count(file, line); /* Note: FILE_FLAG_BACKUP_SEMANTICS applies to open @@ -1195,9 +1218,9 @@ assertion_file_time(const char *file, int line, } r = GetFileTime(h, &fbirthtime, &fatime, &fmtime); switch (type) { - case 'a': ftime = fatime; break; - case 'b': ftime = fbirthtime; break; - case 'm': ftime = fmtime; break; + case 'a': fxtime = fatime; break; + case 'b': fxtime = fbirthtime; break; + case 'm': fxtime = fmtime; break; } CloseHandle(h); if (r == 0) { @@ -1205,8 +1228,8 @@ assertion_file_time(const char *file, int line, failure_finish(NULL); return (0); } - wintm.LowPart = ftime.dwLowDateTime; - wintm.HighPart = ftime.dwHighDateTime; + wintm.LowPart = fxtime.dwLowDateTime; + wintm.HighPart = fxtime.dwHighDateTime; filet = (wintm.QuadPart - EPOC_TIME) / 10000000; filet_nsec = ((wintm.QuadPart - EPOC_TIME) % 10000000) * 100; nsec = (nsec / 100) * 100; /* Round the request */ @@ -1834,15 +1857,45 @@ canSymlink(void) return (value); } -/* - * Can this platform run the gzip program? - */ /* Platform-dependent options for hiding the output of a subcommand. */ #if defined(_WIN32) && !defined(__CYGWIN__) static const char *redirectArgs = ">NUL 2>NUL"; /* Win32 cmd.exe */ #else static const char *redirectArgs = ">/dev/null 2>/dev/null"; /* POSIX 'sh' */ #endif +/* + * Can this platform run the bzip2 program? + */ +int +canBzip2(void) +{ + static int tested = 0, value = 0; + if (!tested) { + tested = 1; + if (systemf("bzip2 -d -V %s", redirectArgs) == 0) + value = 1; + } + return (value); +} + +/* + * Can this platform run the grzip program? + */ +int +canGrzip(void) +{ + static int tested = 0, value = 0; + if (!tested) { + tested = 1; + if (systemf("grzip -V %s", redirectArgs) == 0) + value = 1; + } + return (value); +} + +/* + * Can this platform run the gzip program? + */ int canGzip(void) { @@ -1856,15 +1909,75 @@ canGzip(void) } /* - * Can this platform run the gunzip program? + * Can this platform run the lrzip program? */ int -canGunzip(void) +canLrzip(void) { static int tested = 0, value = 0; if (!tested) { tested = 1; - if (systemf("gunzip -V %s", redirectArgs) == 0) + if (systemf("lrzip -V %s", redirectArgs) == 0) + value = 1; + } + return (value); +} + +/* + * Can this platform run the lzip program? + */ +int +canLzip(void) +{ + static int tested = 0, value = 0; + if (!tested) { + tested = 1; + if (systemf("lzip -V %s", redirectArgs) == 0) + value = 1; + } + return (value); +} + +/* + * Can this platform run the lzma program? + */ +int +canLzma(void) +{ + static int tested = 0, value = 0; + if (!tested) { + tested = 1; + if (systemf("lzma -V %s", redirectArgs) == 0) + value = 1; + } + return (value); +} + +/* + * Can this platform run the lzop program? + */ +int +canLzop(void) +{ + static int tested = 0, value = 0; + if (!tested) { + tested = 1; + if (systemf("lzop -V %s", redirectArgs) == 0) + value = 1; + } + return (value); +} + +/* + * Can this platform run the xz program? + */ +int +canXz(void) +{ + static int tested = 0, value = 0; + if (!tested) { + tested = 1; + if (systemf("xz -V %s", redirectArgs) == 0) value = 1; } return (value); @@ -2124,7 +2237,7 @@ is_LargeInode(const char *file) /* Use "list.h" to create a list of all tests (functions and names). */ #undef DEFINE_TEST #define DEFINE_TEST(n) { n, #n, 0 }, -struct { void (*func)(void); const char *name; int failures; } tests[] = { +struct test_list_t tests[] = { #include "list.h" }; @@ -2377,65 +2490,6 @@ get_refdir(const char *d) return strdup(buff); } -static int -get_test_set(int *test_set, int limit, const char *test) -{ - int start, end; - int idx = 0; - - if (test == NULL) { - /* Default: Run all tests. */ - for (;idx < limit; idx++) - test_set[idx] = idx; - return (limit); - } - if (*test >= '0' && *test <= '9') { - const char *vp = test; - start = 0; - while (*vp >= '0' && *vp <= '9') { - start *= 10; - start += *vp - '0'; - ++vp; - } - if (*vp == '\0') { - end = start; - } else if (*vp == '-') { - ++vp; - if (*vp == '\0') { - end = limit - 1; - } else { - end = 0; - while (*vp >= '0' && *vp <= '9') { - end *= 10; - end += *vp - '0'; - ++vp; - } - } - } else - return (-1); - if (start < 0 || end >= limit || start > end) - return (-1); - while (start <= end) - test_set[idx++] = start++; - } else { - size_t len = strlen(test); - for (start = 0; start < limit; ++start) { - const char *name = tests[start].name; - const char *p; - - while ((p = strchr(name, test[0])) != NULL) { - if (strncmp(p, test, len) == 0) { - test_set[idx++] = start; - break; - } else - name = p + 1; - } - - } - } - return ((idx == 0)?-1:idx); -} - int main(int argc, char **argv) { @@ -2720,10 +2774,11 @@ main(int argc, char **argv) do { int test_num; - test_num = get_test_set(test_set, limit, *argv); + test_num = get_test_set(test_set, limit, *argv, tests); if (test_num < 0) { printf("*** INVALID Test %s\n", *argv); free(refdir_alloc); + free(testprogdir); usage(progname); return (1); } diff --git a/cpio/test/test.h b/cpio/test/test.h index d57a861dcb0b..666bba0e8b30 100644 --- a/cpio/test/test.h +++ b/cpio/test/test.h @@ -266,11 +266,29 @@ void sleepUntilAfter(time_t); /* Return true if this platform can create symlinks. */ int canSymlink(void); +/* Return true if this platform can run the "bzip2" program. */ +int canBzip2(void); + +/* Return true if this platform can run the "grzip" program. */ +int canGrzip(void); + /* Return true if this platform can run the "gzip" program. */ int canGzip(void); -/* Return true if this platform can run the "gunzip" program. */ -int canGunzip(void); +/* Return true if this platform can run the "lrzip" program. */ +int canLrzip(void); + +/* Return true if this platform can run the "lzip" program. */ +int canLzip(void); + +/* Return true if this platform can run the "lzma" program. */ +int canLzma(void); + +/* Return true if this platform can run the "lzop" program. */ +int canLzop(void); + +/* Return true if this platform can run the "xz" program. */ +int canXz(void); /* Return true if this filesystem can handle nodump flags. */ int canNodump(void); diff --git a/cpio/test/test_basic.c b/cpio/test/test_basic.c index c40813e9a26f..7213062e8d20 100644 --- a/cpio/test/test_basic.c +++ b/cpio/test/test_basic.c @@ -148,7 +148,7 @@ DEFINE_TEST(test_basic) strncat(result, "bsdcpio: file: large inode number truncated: " "Numerical result out of range\n", - sizeof(result) - strlen(result)); + sizeof(result) - strlen(result) -1); /* hardlink to above file. */ assertMakeHardlink("linkfile", "file"); @@ -157,7 +157,7 @@ DEFINE_TEST(test_basic) strncat(result, "bsdcpio: linkfile: large inode number truncated: " "Numerical result out of range\n", - sizeof(result) - strlen(result)); + sizeof(result) - strlen(result) -1); /* Symlink to above file. */ if (canSymlink()) { @@ -167,7 +167,7 @@ DEFINE_TEST(test_basic) strncat(result, "bsdcpio: symlink: large inode number truncated: " "Numerical result out of range\n", - sizeof(result) - strlen(result)); + sizeof(result) - strlen(result) -1); } /* Another file with different permissions. */ @@ -177,7 +177,7 @@ DEFINE_TEST(test_basic) strncat(result, "bsdcpio: file2: large inode number truncated: " "Numerical result out of range\n", - sizeof(result) - strlen(result)); + sizeof(result) - strlen(result) -1); /* Directory. */ assertMakeDir("dir", 0775); @@ -186,8 +186,8 @@ DEFINE_TEST(test_basic) strncat(result, "bsdcpio: dir: large inode number truncated: " "Numerical result out of range\n", - sizeof(result) - strlen(result)); - strncat(result, "2 blocks\n", sizeof(result) - strlen(result)); + sizeof(result) - strlen(result) -1); + strncat(result, "2 blocks\n", sizeof(result) - strlen(result) -1); /* All done. */ fclose(filelist); diff --git a/cpio/test/test_extract.cpio.Z.uu b/cpio/test/test_extract.cpio.Z.uu new file mode 100644 index 000000000000..e520a341628f --- /dev/null +++ b/cpio/test/test_extract.cpio.Z.uu @@ -0,0 +1,7 @@ +begin 664 test_extract.cpio.Z +M'YV0,&X$'`B#!@P8,0XJC)$0A@T;!A'>J+%PHL*%%P_&D`%CAHP;!F7,B*C0 +M1L:+(LVD85,F!H`Q;]S0*2-S#H@W9D"H9!G#A8*!`@46U)A11L.'$6-8U+CT +M8D.G'#V"A"&#!L6+)D\>3+FRC(R7,6?6O)ESIU>?0`EJ7/'D!4# +` +end diff --git a/cpio/test/test_extract.cpio.bz2.uu b/cpio/test/test_extract.cpio.bz2.uu new file mode 100644 index 000000000000..228a95775b88 --- /dev/null +++ b/cpio/test/test_extract.cpio.bz2.uu @@ -0,0 +1,7 @@ +begin 664 test_extract.cpio.bz2 +M0EIH.3%!629365?=.4@``#G_@G*0(`#@`7^`(B04``LEC```!"``E`E(>I,H +M::'J&@_4C3:@E$AD#0&@&@%"E;V/1!XIP>#C9T[41`4PQ1A`@S*4F&BD@B0T +MBA$$-:\/@BQGNKU1G@%#`G+N0R%$JTHG(XBRB%1$V8F4#F_IWT=S4+ERVL(? +40V!'@1L4+AO_B[DBG"A(*^Z0,#J&)3G"\^YE?X_' +M_K._F':0[`DL%IQ=<,Z-JH>V$S,?.[`&42C7]J^XQ@9OY!Z$!$^JLQPKZU[: +/!M,+.$MY:Y(HS<<]U`&` +` +end diff --git a/cpio/test/test_extract.cpio.gz.uu b/cpio/test/test_extract.cpio.gz.uu new file mode 100644 index 000000000000..7ddccad64e5c --- /dev/null +++ b/cpio/test/test_extract.cpio.gz.uu @@ -0,0 +1,7 @@ +begin 664 test_extract.cpio.gz +M'XL("`5X2FE=2K)"? +MI@`6T>,R0+?$B$A+3$RQ6F*$88D1PA*"P!"[J#$2)R3(T=/'-4A149%AF`,` +(305ZBP`"```` +` +end diff --git a/cpio/test/test_extract.cpio.lrz.uu b/cpio/test/test_extract.cpio.lrz.uu new file mode 100644 index 000000000000..563f7971040c --- /dev/null +++ b/cpio/test/test_extract.cpio.lrz.uu @@ -0,0 +1,8 @@ +begin 664 test_extract.cpio.lrz +M3%):20`&``(``````````%T````!`0```@$`$`,`````#@`#`````"\``QH` +M&@````!W``$G`&4``#,``2(``0``#0$````U<-`Y!F$`MP$````8#=\$8#<1 +MR/BL39$D4M>["H7&@4%L/4*_(*VGB*YU>?RX.9]HL86'.A)H@Y;Z\^$?M^8_ +M!/-;62G.*7*A&A!_ENZ8$7]O-M7_.FTRC%BCGC95:6'9ZH3)QSCR4RX42P!` +/-E>/7"L[:OY"/A924S4$ +` +end diff --git a/cpio/test/test_extract.cpio.lz.uu b/cpio/test/test_extract.cpio.lz.uu new file mode 100644 index 000000000000..67e41e92f16c --- /dev/null +++ b/cpio/test/test_extract.cpio.lz.uu @@ -0,0 +1,6 @@ +begin 664 test_extract.cpio.lz +M3%I)4`$,`!@-WP1@-Q'(^*Q-D212U[L*A<:!06P]0K\@K:>(KG5Y_+@YGVBQ +MA8;_>8N3MLP="$0SJ#QKYB?@8 +G]@'$$7\&W^T*+9?6B=?__M$G@$T%>HL``@```````($````````` +` +end diff --git a/cpio/test/test_extract.cpio.lzma.uu b/cpio/test/test_extract.cpio.lzma.uu new file mode 100644 index 000000000000..449403e9293b --- /dev/null +++ b/cpio/test/test_extract.cpio.lzma.uu @@ -0,0 +1,6 @@ +begin 664 test_extract.cpio.lzma +M70``@`#__________P`8#=\$8#<1R/BL39$D4M>["H7&@4%L/4*_(*VGB*YU +M>?RX.9]HL86'.A)H@Y;Z\^$?M^8_!/-;62G.*7*A&A!_HGF_WF+D[;.+!OW3 +:T_2I)V(;K[FNL#'W%T+L;ATS`A*3__[1Z``` +` +end diff --git a/cpio/test/test_extract.cpio.lzo.uu b/cpio/test/test_extract.cpio.lzo.uu new file mode 100644 index 000000000000..8ce87c798ce2 --- /dev/null +++ b/cpio/test/test_extract.cpio.lzo.uu @@ -0,0 +1,9 @@ +begin 664 test_extract.cpio.lzo +MB4Q:3P`-"AH*$#`@8`E``04#```!``"!M%!R>-T`````$71E`$#-S4P,#`QE`!@`7`#"C`P,3(P,S(W-#`R,S2!`C:4`'````(R,V9I;&4Q +M`&-O;G1E;G1S(&]F((8"+@HOD0$R(`:1`31J$#`P+I$!,B^1`3(HD`%L$3L, +M`+P<+HH`,3,I1``(5%)!24Q%4B$A(0`@JP````$````````````````````` +*````$0`````````` +` +end diff --git a/cpio/test/test_extract.cpio.xz.uu b/cpio/test/test_extract.cpio.xz.uu new file mode 100644 index 000000000000..5c593cfebca2 --- /dev/null +++ b/cpio/test/test_extract.cpio.xz.uu @@ -0,0 +1,7 @@ +begin 664 test_extract.cpio.xz +M_3=Z6%H```3FUK1&`@`A`18```!T+^6CX`'_`&%=`!@-WP1@-Q'(^*Q-D212 +MU[L*A<:!06P]0K\@K:>(KG5Y_+@YGVBQA8;_>8N3MLXL&_=/3]*DG8ANON:ZP,?<70NQN'3"CP@``````J9FA +=#1$]4L<``7V`!`````?M;4JQQ&?[`@`````$65H` +` +end diff --git a/cpio/test/test_extract_cpio_Z.c b/cpio/test/test_extract_cpio_Z.c new file mode 100644 index 000000000000..f908fc5b84f5 --- /dev/null +++ b/cpio/test/test_extract_cpio_Z.c @@ -0,0 +1,42 @@ +/*- + * Copyright (c) 2012 Michihiro NAKAJIMA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#include "test.h" +__FBSDID("$FreeBSD$"); + +DEFINE_TEST(test_extract_cpio_Z) +{ + const char *reffile = "test_extract.cpio.Z"; + + extract_reference_file(reffile); + assertEqualInt(0, systemf("%s -i < %s >test.out 2>test.err", + testprog, reffile)); + + assertFileExists("file1"); + assertTextFileContents("contents of file1.\n", "file1"); + assertFileExists("file2"); + assertTextFileContents("contents of file2.\n", "file2"); + assertEmptyFile("test.out"); + assertTextFileContents("1 block\n", "test.err"); +} diff --git a/cpio/test/test_extract_cpio_bz2.c b/cpio/test/test_extract_cpio_bz2.c new file mode 100644 index 000000000000..9525e63ae906 --- /dev/null +++ b/cpio/test/test_extract_cpio_bz2.c @@ -0,0 +1,48 @@ +/*- + * Copyright (c) 2012 Michihiro NAKAJIMA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#include "test.h" +__FBSDID("$FreeBSD$"); + +DEFINE_TEST(test_extract_cpio_bz2) +{ + const char *reffile = "test_extract.cpio.bz2"; + int f; + + extract_reference_file(reffile); + f = systemf("%s -it < %s >test.out 2>test.err", testprog, reffile); + if (f == 0 || canBzip2()) { + assertEqualInt(0, systemf("%s -i < %s >test.out 2>test.err", + testprog, reffile)); + + assertFileExists("file1"); + assertTextFileContents("contents of file1.\n", "file1"); + assertFileExists("file2"); + assertTextFileContents("contents of file2.\n", "file2"); + assertEmptyFile("test.out"); + assertTextFileContents("1 block\n", "test.err"); + } else { + skipping("It seems bzip2 is not supported on this platform"); + } +} diff --git a/cpio/test/test_extract_cpio_grz.c b/cpio/test/test_extract_cpio_grz.c new file mode 100644 index 000000000000..f1a080597e34 --- /dev/null +++ b/cpio/test/test_extract_cpio_grz.c @@ -0,0 +1,48 @@ +/*- + * Copyright (c) 2012 Michihiro NAKAJIMA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#include "test.h" +__FBSDID("$FreeBSD$"); + +DEFINE_TEST(test_extract_cpio_grz) +{ + const char *reffile = "test_extract.cpio.grz"; + int f; + + extract_reference_file(reffile); + f = systemf("%s -it < %s >test.out 2>test.err", testprog, reffile); + if (f == 0 || canGrzip()) { + assertEqualInt(0, systemf("%s -i < %s >test.out 2>test.err", + testprog, reffile)); + + assertFileExists("file1"); + assertTextFileContents("contents of file1.\n", "file1"); + assertFileExists("file2"); + assertTextFileContents("contents of file2.\n", "file2"); + assertEmptyFile("test.out"); + assertTextFileContents("1 block\n", "test.err"); + } else { + skipping("It seems grzip is not supported on this platform"); + } +} diff --git a/cpio/test/test_extract_cpio_gz.c b/cpio/test/test_extract_cpio_gz.c new file mode 100644 index 000000000000..19cee510c857 --- /dev/null +++ b/cpio/test/test_extract_cpio_gz.c @@ -0,0 +1,48 @@ +/*- + * Copyright (c) 2012 Michihiro NAKAJIMA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#include "test.h" +__FBSDID("$FreeBSD$"); + +DEFINE_TEST(test_extract_cpio_gz) +{ + const char *reffile = "test_extract.cpio.gz"; + int f; + + extract_reference_file(reffile); + f = systemf("%s -it < %s >test.out 2>test.err", testprog, reffile); + if (f == 0 || canGzip()) { + assertEqualInt(0, systemf("%s -i < %s >test.out 2>test.err", + testprog, reffile)); + + assertFileExists("file1"); + assertTextFileContents("contents of file1.\n", "file1"); + assertFileExists("file2"); + assertTextFileContents("contents of file2.\n", "file2"); + assertEmptyFile("test.out"); + assertTextFileContents("1 block\n", "test.err"); + } else { + skipping("It seems gzip is not supported on this platform"); + } +} diff --git a/cpio/test/test_extract_cpio_lrz.c b/cpio/test/test_extract_cpio_lrz.c new file mode 100644 index 000000000000..67667585e431 --- /dev/null +++ b/cpio/test/test_extract_cpio_lrz.c @@ -0,0 +1,48 @@ +/*- + * Copyright (c) 2012 Michihiro NAKAJIMA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#include "test.h" +__FBSDID("$FreeBSD$"); + +DEFINE_TEST(test_extract_cpio_lrz) +{ + const char *reffile = "test_extract.cpio.lrz"; + int f; + + extract_reference_file(reffile); + f = systemf("%s -it < %s >test.out 2>test.err", testprog, reffile); + if (f == 0 || canLrzip()) { + assertEqualInt(0, systemf("%s -i < %s >test.out 2>test.err", + testprog, reffile)); + + assertFileExists("file1"); + assertTextFileContents("contents of file1.\n", "file1"); + assertFileExists("file2"); + assertTextFileContents("contents of file2.\n", "file2"); + assertEmptyFile("test.out"); + assertTextFileContents("1 block\n", "test.err"); + } else { + skipping("It seems lrzip is not supported on this platform"); + } +} diff --git a/cpio/test/test_extract_cpio_lz.c b/cpio/test/test_extract_cpio_lz.c new file mode 100644 index 000000000000..4454e7b191e9 --- /dev/null +++ b/cpio/test/test_extract_cpio_lz.c @@ -0,0 +1,48 @@ +/*- + * Copyright (c) 2012 Michihiro NAKAJIMA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#include "test.h" +__FBSDID("$FreeBSD$"); + +DEFINE_TEST(test_extract_cpio_lz) +{ + const char *reffile = "test_extract.cpio.lz"; + int f; + + extract_reference_file(reffile); + f = systemf("%s -it < %s >test.out 2>test.err", testprog, reffile); + if (f == 0 || canLzip()) { + assertEqualInt(0, systemf("%s -i < %s >test.out 2>test.err", + testprog, reffile)); + + assertFileExists("file1"); + assertTextFileContents("contents of file1.\n", "file1"); + assertFileExists("file2"); + assertTextFileContents("contents of file2.\n", "file2"); + assertEmptyFile("test.out"); + assertTextFileContents("1 block\n", "test.err"); + } else { + skipping("It seems lzip is not supported on this platform"); + } +} diff --git a/cpio/test/test_extract_cpio_lzma.c b/cpio/test/test_extract_cpio_lzma.c new file mode 100644 index 000000000000..ae630d6119d8 --- /dev/null +++ b/cpio/test/test_extract_cpio_lzma.c @@ -0,0 +1,48 @@ +/*- + * Copyright (c) 2012 Michihiro NAKAJIMA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#include "test.h" +__FBSDID("$FreeBSD$"); + +DEFINE_TEST(test_extract_cpio_lzma) +{ + const char *reffile = "test_extract.cpio.lzma"; + int f; + + extract_reference_file(reffile); + f = systemf("%s -it < %s >test.out 2>test.err", testprog, reffile); + if (f == 0 || canLzma()) { + assertEqualInt(0, systemf("%s -i < %s >test.out 2>test.err", + testprog, reffile)); + + assertFileExists("file1"); + assertTextFileContents("contents of file1.\n", "file1"); + assertFileExists("file2"); + assertTextFileContents("contents of file2.\n", "file2"); + assertEmptyFile("test.out"); + assertTextFileContents("1 block\n", "test.err"); + } else { + skipping("It seems lzma is not supported on this platform"); + } +} diff --git a/cpio/test/test_extract_cpio_lzo.c b/cpio/test/test_extract_cpio_lzo.c new file mode 100644 index 000000000000..f351ba7a79aa --- /dev/null +++ b/cpio/test/test_extract_cpio_lzo.c @@ -0,0 +1,48 @@ +/*- + * Copyright (c) 2012 Michihiro NAKAJIMA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#include "test.h" +__FBSDID("$FreeBSD$"); + +DEFINE_TEST(test_extract_cpio_lzo) +{ + const char *reffile = "test_extract.cpio.lrz"; + int f; + + extract_reference_file(reffile); + f = systemf("%s -it < %s >test.out 2>test.err", testprog, reffile); + if (f == 0 || canLzop()) { + assertEqualInt(0, systemf("%s -i < %s >test.out 2>test.err", + testprog, reffile)); + + assertFileExists("file1"); + assertTextFileContents("contents of file1.\n", "file1"); + assertFileExists("file2"); + assertTextFileContents("contents of file2.\n", "file2"); + assertEmptyFile("test.out"); + assertTextFileContents("1 block\n", "test.err"); + } else { + skipping("It seems lzop is not supported on this platform"); + } +} diff --git a/cpio/test/test_extract_cpio_xz.c b/cpio/test/test_extract_cpio_xz.c new file mode 100644 index 000000000000..60f1b5a9de84 --- /dev/null +++ b/cpio/test/test_extract_cpio_xz.c @@ -0,0 +1,48 @@ +/*- + * Copyright (c) 2012 Michihiro NAKAJIMA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#include "test.h" +__FBSDID("$FreeBSD$"); + +DEFINE_TEST(test_extract_cpio_xz) +{ + const char *reffile = "test_extract.cpio.xz"; + int f; + + extract_reference_file(reffile); + f = systemf("%s -it < %s >test.out 2>test.err", testprog, reffile); + if (f == 0 || canXz()) { + assertEqualInt(0, systemf("%s -i < %s >test.out 2>test.err", + testprog, reffile)); + + assertFileExists("file1"); + assertTextFileContents("contents of file1.\n", "file1"); + assertFileExists("file2"); + assertTextFileContents("contents of file2.\n", "file2"); + assertEmptyFile("test.out"); + assertTextFileContents("1 block\n", "test.err"); + } else { + skipping("It seems xz is not supported on this platform"); + } +} diff --git a/cpio/test/test_format_newc.c b/cpio/test/test_format_newc.c index ced62a639e7a..d2daa46ab71c 100644 --- a/cpio/test/test_format_newc.c +++ b/cpio/test/test_format_newc.c @@ -157,9 +157,9 @@ DEFINE_TEST(test_format_newc) /* Verify that nothing went to stderr. */ if (canSymlink()) { - strncat(result, "2 blocks\n", sizeof(result) - strlen(result)); + strncat(result, "2 blocks\n", sizeof(result) - strlen(result) -1); } else { - strncat(result, "1 block\n", sizeof(result) - strlen(result)); + strncat(result, "1 block\n", sizeof(result) - strlen(result) -1); } assertTextFileContents(result, "newc.err"); diff --git a/cpio/test/test_option_b64encode.c b/cpio/test/test_option_b64encode.c new file mode 100644 index 000000000000..8f6b4157c01c --- /dev/null +++ b/cpio/test/test_option_b64encode.c @@ -0,0 +1,54 @@ +/*- + * Copyright (c) 2003-2007 Tim Kientzle + * Copyright (c) 2012 Michihiro NAKAJIMA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#include "test.h" +__FBSDID("$FreeBSD$"); + +DEFINE_TEST(test_option_b64encode) +{ + char *p; + size_t s; + + /* Create a file. */ + assertMakeFile("f", 0644, "a"); + + /* Archive it with compress compression and uuencode. */ + assertEqualInt(0, + systemf("echo f | %s -o -Z --b64encode >archive.out 2>archive.err", + testprog)); + /* Check that the archive file has an uuencode signature. */ + p = slurpfile(&s, "archive.out"); + assert(s > 2); + assertEqualMem(p, "begin-base64 644", 16); + + /* Archive it with uuencode only. */ + assertEqualInt(0, + systemf("echo f | %s -o --b64encode >archive.out 2>archive.err", + testprog)); + /* Check that the archive file has an uuencode signature. */ + p = slurpfile(&s, "archive.out"); + assert(s > 2); + assertEqualMem(p, "begin-base64 644", 16); +} diff --git a/cpio/test/test_option_grzip.c b/cpio/test/test_option_grzip.c new file mode 100644 index 000000000000..dfce2e064e07 --- /dev/null +++ b/cpio/test/test_option_grzip.c @@ -0,0 +1,52 @@ +/*- + * Copyright (c) 2003-2007 Tim Kientzle + * Copyright (c) 2012 Michihiro NAKAJIMA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#include "test.h" +__FBSDID("$FreeBSD$"); + +DEFINE_TEST(test_option_grzip) +{ + char *p; + size_t s; + + if (!canGrzip()) { + skipping("grzip is not supported on this platform"); + return; + } + + /* Create a file. */ + assertMakeFile("f", 0644, "a"); + + /* Archive it with grzip compression. */ + assertEqualInt(0, + systemf("echo f | %s -o --grzip >archive.out 2>archive.err", + testprog)); + p = slurpfile(&s, "archive.err"); + p[s] = '\0'; + /* Check that the archive file has an grzip signature. */ + p = slurpfile(&s, "archive.out"); + assert(s > 2); + assertEqualMem(p, "GRZipII\x00\x02\x04:)", 12); +} diff --git a/cpio/test/test_option_lrzip.c b/cpio/test/test_option_lrzip.c new file mode 100644 index 000000000000..a84f75157a4c --- /dev/null +++ b/cpio/test/test_option_lrzip.c @@ -0,0 +1,52 @@ +/*- + * Copyright (c) 2003-2007 Tim Kientzle + * Copyright (c) 2012 Michihiro NAKAJIMA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#include "test.h" +__FBSDID("$FreeBSD$"); + +DEFINE_TEST(test_option_lrzip) +{ + char *p; + size_t s; + + if (!canLrzip()) { + skipping("lrzip is not supported on this platform"); + return; + } + + /* Create a file. */ + assertMakeFile("f", 0644, "a"); + + /* Archive it with lrzip compression. */ + assertEqualInt(0, + systemf("echo f | %s -o --lrzip >archive.out 2>archive.err", + testprog)); + p = slurpfile(&s, "archive.err"); + p[s] = '\0'; + /* Check that the archive file has an lzma signature. */ + p = slurpfile(&s, "archive.out"); + assert(s > 2); + assertEqualMem(p, "LRZI\x00", 5); +} diff --git a/cpio/test/test_option_lzop.c b/cpio/test/test_option_lzop.c new file mode 100644 index 000000000000..9f1666e9c5b9 --- /dev/null +++ b/cpio/test/test_option_lzop.c @@ -0,0 +1,56 @@ +/*- + * Copyright (c) 2003-2007 Tim Kientzle + * Copyright (c) 2012 Michihiro NAKAJIMA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#include "test.h" +__FBSDID("$FreeBSD$"); + +DEFINE_TEST(test_option_lzop) +{ + char *p; + int r; + size_t s; + + /* Create a file. */ + assertMakeFile("f", 0644, "a"); + + /* Archive it with lzop compression. */ + r = systemf("echo f | %s -o --lzop >archive.out 2>archive.err", + testprog); + p = slurpfile(&s, "archive.err"); + p[s] = '\0'; + if (r != 0) { + if (!canLzop()) { + skipping("lzop is not supported on this platform"); + return; + } + failure("--lzop option is broken"); + assertEqualInt(r, 0); + return; + } + /* Check that the archive file has an lzma signature. */ + p = slurpfile(&s, "archive.out"); + assert(s > 2); + assertEqualMem(p, "\x89\x4c\x5a\x4f\x00\x0d\x0a\x1a\x0a", 9); +} diff --git a/cpio/test/test_option_uuencode.c b/cpio/test/test_option_uuencode.c new file mode 100644 index 000000000000..ecf354f8f391 --- /dev/null +++ b/cpio/test/test_option_uuencode.c @@ -0,0 +1,54 @@ +/*- + * Copyright (c) 2003-2007 Tim Kientzle + * Copyright (c) 2012 Michihiro NAKAJIMA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#include "test.h" +__FBSDID("$FreeBSD$"); + +DEFINE_TEST(test_option_uuencode) +{ + char *p; + size_t s; + + /* Create a file. */ + assertMakeFile("f", 0644, "a"); + + /* Archive it with compress compression and uuencode. */ + assertEqualInt(0, + systemf("echo f | %s -o -Z --uuencode >archive.out 2>archive.err", + testprog)); + /* Check that the archive file has an uuencode signature. */ + p = slurpfile(&s, "archive.out"); + assert(s > 2); + assertEqualMem(p, "begin 644", 9); + + /* Archive it with uuencode only. */ + assertEqualInt(0, + systemf("echo f | %s -o --uuencode >archive.out 2>archive.err", + testprog)); + /* Check that the archive file has an uuencode signature. */ + p = slurpfile(&s, "archive.out"); + assert(s > 2); + assertEqualMem(p, "begin 644", 9); +} diff --git a/cpio/test/test_option_xz.c b/cpio/test/test_option_xz.c new file mode 100644 index 000000000000..02b5dfaad4a1 --- /dev/null +++ b/cpio/test/test_option_xz.c @@ -0,0 +1,57 @@ +/*- + * Copyright (c) 2003-2007 Tim Kientzle + * Copyright (c) 2012 Michihiro NAKAJIMA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#include "test.h" +__FBSDID("$FreeBSD$"); + +DEFINE_TEST(test_option_xz) +{ + char *p; + int r; + size_t s; + + /* Create a file. */ + assertMakeFile("f", 0644, "a"); + + /* Archive it with xz compression. */ + r = systemf("echo f | %s -o --xz >archive.out 2>archive.err", + testprog); + p = slurpfile(&s, "archive.err"); + p[s] = '\0'; + if (r != 0) { + if (strstr(p, "compression not available") != NULL) { + skipping("This version of bsdcpio was compiled " + "without xz support"); + return; + } + failure("--xz option is broken"); + assertEqualInt(r, 0); + return; + } + /* Check that the archive file has an xz signature. */ + p = slurpfile(&s, "archive.out"); + assert(s > 2); + assertEqualMem(p, "\xFD\x37\x7A\x58\x5A\x00", 6); +} diff --git a/cpio/test/test_option_y.c b/cpio/test/test_option_y.c index 58734966ce6a..54f270b81e0f 100644 --- a/cpio/test/test_option_y.c +++ b/cpio/test/test_option_y.c @@ -40,9 +40,8 @@ DEFINE_TEST(test_option_y) p = slurpfile(&s, "archive.err"); p[s] = '\0'; if (r != 0) { - if (strstr(p, "compression not available") != NULL) { - skipping("This version of bsdcpio was compiled " - "without bzip2 support"); + if (!canBzip2()) { + skipping("bzip2 is not supported on this platform"); return; } failure("-y option is broken"); diff --git a/cpio/test/test_option_z.c b/cpio/test/test_option_z.c index 91d37ac1983a..0b68a42babbf 100644 --- a/cpio/test/test_option_z.c +++ b/cpio/test/test_option_z.c @@ -40,9 +40,8 @@ DEFINE_TEST(test_option_z) p = slurpfile(&s, "archive.err"); p[s] = '\0'; if (r != 0) { - if (strstr(p, "compression not available") != NULL) { - skipping("This version of bsdcpio was compiled " - "without gzip support"); + if (!canGzip()) { + skipping("gzip is not supported on this platform"); return; } failure("-z option is broken"); diff --git a/doc/update.sh b/doc/update.sh index 1994eb3a76f7..1038da133f77 100644 --- a/doc/update.sh +++ b/doc/update.sh @@ -1,5 +1,7 @@ #!/bin/sh +set -e + # # Simple script to repopulate the 'doc' tree from # the mdoc man pages stored in each project. diff --git a/examples/minitar/minitar.c b/examples/minitar/minitar.c index 2d6d4208a22a..0ff6263ebf84 100644 --- a/examples/minitar/minitar.c +++ b/examples/minitar/minitar.c @@ -231,27 +231,27 @@ create(const char *filename, int compress, const char **argv) switch (compress) { #ifndef NO_BZIP2_CREATE case 'j': case 'y': - archive_write_set_compression_bzip2(a); + archive_write_add_filter_bzip2(a); break; #endif #ifndef NO_COMPRESS_CREATE case 'Z': - archive_write_set_compression_compress(a); + archive_write_add_filter_compress(a); break; #endif #ifndef NO_GZIP_CREATE case 'z': - archive_write_set_compression_gzip(a); + archive_write_add_filter_gzip(a); break; #endif default: - archive_write_set_compression_none(a); + archive_write_add_filter_none(a); break; } archive_write_set_format_ustar(a); if (strcmp(filename, "-") == 0) filename = NULL; - archive_write_open_file(a, filename); + archive_write_open_filename(a, filename); disk = archive_read_disk_new(); #ifndef NO_LOOKUP @@ -361,7 +361,7 @@ extract(const char *filename, int do_extract, int flags) #endif if (filename != NULL && strcmp(filename, "-") == 0) filename = NULL; - if ((r = archive_read_open_file(a, filename, 10240))) { + if ((r = archive_read_open_filename(a, filename, 10240))) { errmsg(archive_error_string(a)); errmsg("\n"); exit(r); diff --git a/examples/untar.c b/examples/untar.c index c027f7735b87..b22d8361a012 100644 --- a/examples/untar.c +++ b/examples/untar.c @@ -158,8 +158,8 @@ extract(const char *filename, int do_extract, int flags) */ if (filename != NULL && strcmp(filename, "-") == 0) filename = NULL; - if ((r = archive_read_open_file(a, filename, 10240))) - fail("archive_read_open_file()", + if ((r = archive_read_open_filename(a, filename, 10240))) + fail("archive_read_open_filename()", archive_error_string(a), r); for (;;) { r = archive_read_next_header(a, &entry); diff --git a/libarchive/CMakeLists.txt b/libarchive/CMakeLists.txt index 73d9baf01e87..ecb0409bd9d8 100644 --- a/libarchive/CMakeLists.txt +++ b/libarchive/CMakeLists.txt @@ -15,6 +15,9 @@ SET(include_HEADERS SET(libarchive_SOURCES archive_acl.c archive_check_magic.c + archive_cmdline.c + archive_cmdline_private.h + archive_crc32.h archive_crypto.c archive_crypto_private.h archive_endian.h @@ -42,6 +45,7 @@ SET(libarchive_SOURCES archive_rb.c archive_rb.h archive_read.c + archive_read_append_filter.c archive_read_data_into_fd.c archive_read_disk_entry_from_file.c archive_read_disk_posix.c @@ -53,11 +57,15 @@ SET(libarchive_SOURCES archive_read_open_filename.c archive_read_open_memory.c archive_read_private.h + archive_read_set_format.c archive_read_set_options.c archive_read_support_filter_all.c archive_read_support_filter_bzip2.c archive_read_support_filter_compress.c archive_read_support_filter_gzip.c + archive_read_support_filter_grzip.c + archive_read_support_filter_lrzip.c + archive_read_support_filter_lzop.c archive_read_support_filter_none.c archive_read_support_filter_program.c archive_read_support_filter_rpm.c @@ -85,6 +93,7 @@ SET(libarchive_SOURCES archive_util.c archive_virtual.c archive_write.c + archive_write_disk_acl.c archive_write_disk_posix.c archive_write_disk_private.h archive_write_disk_set_standard_lookup.c @@ -94,11 +103,17 @@ SET(libarchive_SOURCES archive_write_open_filename.c archive_write_open_memory.c archive_write_add_filter.c + archive_write_add_filter_b64encode.c + archive_write_add_filter_by_name.c archive_write_add_filter_bzip2.c archive_write_add_filter_compress.c + archive_write_add_filter_grzip.c archive_write_add_filter_gzip.c + archive_write_add_filter_lrzip.c + archive_write_add_filter_lzop.c archive_write_add_filter_none.c archive_write_add_filter_program.c + archive_write_add_filter_uuencode.c archive_write_add_filter_xz.c archive_write_set_format.c archive_write_set_format_7zip.c @@ -112,10 +127,11 @@ SET(libarchive_SOURCES archive_write_set_format_pax.c archive_write_set_format_shar.c archive_write_set_format_ustar.c + archive_write_set_format_v7tar.c archive_write_set_format_xar.c archive_write_set_format_zip.c archive_write_set_options.c - filter_fork.c + filter_fork_posix.c filter_fork.h ) diff --git a/libarchive/archive.h b/libarchive/archive.h index d5316ca93065..f56bc38e5b43 100644 --- a/libarchive/archive.h +++ b/libarchive/archive.h @@ -97,6 +97,12 @@ #define __LA_PRINTF(fmtarg, firstvararg) /* nothing */ #endif +#if defined(__GNUC__) && __GNUC__ >= 3 && __GNUC_MINOR__ >= 1 +# define __LA_DEPRECATED __attribute__((deprecated)) +#else +# define __LA_DEPRECATED +#endif + #ifdef __cplusplus extern "C" { #endif @@ -118,13 +124,13 @@ extern "C" { * assert that ARCHIVE_VERSION_NUMBER >= 2012108. */ /* Note: Compiler will complain if this does not match archive_entry.h! */ -#define ARCHIVE_VERSION_NUMBER 3000004 +#define ARCHIVE_VERSION_NUMBER 3001002 __LA_DECL int archive_version_number(void); /* * Textual name/version of the library, useful for version displays. */ -#define ARCHIVE_VERSION_STRING "libarchive 3.0.4" +#define ARCHIVE_VERSION_STRING "libarchive 3.1.2" __LA_DECL const char * archive_version_string(void); /* Declare our basic types. */ @@ -194,6 +200,13 @@ typedef int archive_open_callback(struct archive *, void *_client_data); typedef int archive_close_callback(struct archive *, void *_client_data); +/* Switches from one client data object to the next/prev client data object. + * This is useful for reading from different data blocks such as a set of files + * that make up one large file. + */ +typedef int archive_switch_callback(struct archive *, void *_client_data1, + void *_client_data2); + /* * Codes to identify various stream filters. */ @@ -207,6 +220,9 @@ typedef int archive_close_callback(struct archive *, void *_client_data); #define ARCHIVE_FILTER_UU 7 #define ARCHIVE_FILTER_RPM 8 #define ARCHIVE_FILTER_LZIP 9 +#define ARCHIVE_FILTER_LRZIP 10 +#define ARCHIVE_FILTER_LZOP 11 +#define ARCHIVE_FILTER_GRZIP 12 #if ARCHIVE_VERSION_NUMBER < 4000000 #define ARCHIVE_COMPRESSION_NONE ARCHIVE_FILTER_NONE @@ -219,6 +235,7 @@ typedef int archive_close_callback(struct archive *, void *_client_data); #define ARCHIVE_COMPRESSION_UU ARCHIVE_FILTER_UU #define ARCHIVE_COMPRESSION_RPM ARCHIVE_FILTER_RPM #define ARCHIVE_COMPRESSION_LZIP ARCHIVE_FILTER_LZIP +#define ARCHIVE_COMPRESSION_LRZIP ARCHIVE_FILTER_LRZIP #endif /* @@ -291,37 +308,49 @@ __LA_DECL struct archive *archive_read_new(void); */ #if ARCHIVE_VERSION_NUMBER < 4000000 -__LA_DECL int archive_read_support_compression_all(struct archive *); -__LA_DECL int archive_read_support_compression_bzip2(struct archive *); -__LA_DECL int archive_read_support_compression_compress(struct archive *); -__LA_DECL int archive_read_support_compression_gzip(struct archive *); -__LA_DECL int archive_read_support_compression_lzip(struct archive *); -__LA_DECL int archive_read_support_compression_lzma(struct archive *); -__LA_DECL int archive_read_support_compression_none(struct archive *); +__LA_DECL int archive_read_support_compression_all(struct archive *) + __LA_DEPRECATED; +__LA_DECL int archive_read_support_compression_bzip2(struct archive *) + __LA_DEPRECATED; +__LA_DECL int archive_read_support_compression_compress(struct archive *) + __LA_DEPRECATED; +__LA_DECL int archive_read_support_compression_gzip(struct archive *) + __LA_DEPRECATED; +__LA_DECL int archive_read_support_compression_lzip(struct archive *) + __LA_DEPRECATED; +__LA_DECL int archive_read_support_compression_lzma(struct archive *) + __LA_DEPRECATED; +__LA_DECL int archive_read_support_compression_none(struct archive *) + __LA_DEPRECATED; __LA_DECL int archive_read_support_compression_program(struct archive *, - const char *command); + const char *command) __LA_DEPRECATED; __LA_DECL int archive_read_support_compression_program_signature (struct archive *, const char *, - const void * /* match */, size_t); + const void * /* match */, size_t) __LA_DEPRECATED; -__LA_DECL int archive_read_support_compression_rpm(struct archive *); -__LA_DECL int archive_read_support_compression_uu(struct archive *); -__LA_DECL int archive_read_support_compression_xz(struct archive *); +__LA_DECL int archive_read_support_compression_rpm(struct archive *) + __LA_DEPRECATED; +__LA_DECL int archive_read_support_compression_uu(struct archive *) + __LA_DEPRECATED; +__LA_DECL int archive_read_support_compression_xz(struct archive *) + __LA_DEPRECATED; #endif __LA_DECL int archive_read_support_filter_all(struct archive *); __LA_DECL int archive_read_support_filter_bzip2(struct archive *); __LA_DECL int archive_read_support_filter_compress(struct archive *); __LA_DECL int archive_read_support_filter_gzip(struct archive *); +__LA_DECL int archive_read_support_filter_grzip(struct archive *); +__LA_DECL int archive_read_support_filter_lrzip(struct archive *); __LA_DECL int archive_read_support_filter_lzip(struct archive *); __LA_DECL int archive_read_support_filter_lzma(struct archive *); +__LA_DECL int archive_read_support_filter_lzop(struct archive *); __LA_DECL int archive_read_support_filter_none(struct archive *); __LA_DECL int archive_read_support_filter_program(struct archive *, const char *command); __LA_DECL int archive_read_support_filter_program_signature - (struct archive *, const char *, + (struct archive *, const char * /* cmd */, const void * /* match */, size_t); - __LA_DECL int archive_read_support_filter_rpm(struct archive *); __LA_DECL int archive_read_support_filter_uu(struct archive *); __LA_DECL int archive_read_support_filter_xz(struct archive *); @@ -343,6 +372,17 @@ __LA_DECL int archive_read_support_format_tar(struct archive *); __LA_DECL int archive_read_support_format_xar(struct archive *); __LA_DECL int archive_read_support_format_zip(struct archive *); +/* Functions to manually set the format and filters to be used. This is + * useful to bypass the bidding process when the format and filters to use + * is known in advance. + */ +__LA_DECL int archive_read_set_format(struct archive *, int); +__LA_DECL int archive_read_append_filter(struct archive *, int); +__LA_DECL int archive_read_append_filter_program(struct archive *, + const char *); +__LA_DECL int archive_read_append_filter_program_signature + (struct archive *, const char *, const void * /* match */, size_t); + /* Set various callbacks. */ __LA_DECL int archive_read_set_open_callback(struct archive *, archive_open_callback *); @@ -354,8 +394,23 @@ __LA_DECL int archive_read_set_skip_callback(struct archive *, archive_skip_callback *); __LA_DECL int archive_read_set_close_callback(struct archive *, archive_close_callback *); -/* The callback data is provided to all of the callbacks above. */ +/* Callback used to switch between one data object to the next */ +__LA_DECL int archive_read_set_switch_callback(struct archive *, + archive_switch_callback *); + +/* This sets the first data object. */ __LA_DECL int archive_read_set_callback_data(struct archive *, void *); +/* This sets data object at specified index */ +__LA_DECL int archive_read_set_callback_data2(struct archive *, void *, + unsigned int); +/* This adds a data object at the specified index. */ +__LA_DECL int archive_read_add_callback_data(struct archive *, void *, + unsigned int); +/* This appends a data object to the end of list */ +__LA_DECL int archive_read_append_callback_data(struct archive *, void *); +/* This prepends a data object to the beginning of list */ +__LA_DECL int archive_read_prepend_callback_data(struct archive *, void *); + /* Opening freezes the callbacks. */ __LA_DECL int archive_read_open1(struct archive *); @@ -375,11 +430,15 @@ __LA_DECL int archive_read_open2(struct archive *, void *_client_data, /* Use this if you know the filename. Note: NULL indicates stdin. */ __LA_DECL int archive_read_open_filename(struct archive *, const char *_filename, size_t _block_size); +/* Use this for reading multivolume files by filenames. + * NOTE: Must be NULL terminated. Sorting is NOT done. */ +__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); /* 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); + const char *_filename, size_t _block_size) __LA_DEPRECATED; /* Read an archive that's stored in memory. */ __LA_DECL int archive_read_open_memory(struct archive *, void * buff, size_t size); @@ -411,6 +470,9 @@ __LA_DECL __LA_INT64_T archive_read_header_position(struct archive *); __LA_DECL __LA_SSIZE_T archive_read_data(struct archive *, void *, size_t); +/* Seek within the body of an entry. Similar to lseek(2). */ +__LA_DECL __LA_INT64_T archive_seek_data(struct archive *, __LA_INT64_T, int); + /* * A zero-copy version of archive_read_data that also exposes the file offset * of each returned block. Note that the client has no way to specify @@ -494,6 +556,12 @@ __LA_DECL int archive_read_set_options(struct archive *_a, /* Default: Do not restore Mac extended metadata. */ /* This has no effect except on Mac OS. */ #define ARCHIVE_EXTRACT_MAC_METADATA (0x2000) +/* Default: Use HFS+ compression if it was compressed. */ +/* This has no effect except on Mac OS v10.6 or later. */ +#define ARCHIVE_EXTRACT_NO_HFS_COMPRESSION (0x4000) +/* Default: Do not use HFS+ compression if it was not compressed. */ +/* This has no effect except on Mac OS v10.6 or later. */ +#define ARCHIVE_EXTRACT_HFS_COMPRESSION_FORCED (0x8000) __LA_DECL int archive_read_extract(struct archive *, struct archive_entry *, int flags); @@ -514,7 +582,7 @@ __LA_DECL int archive_read_close(struct archive *); __LA_DECL int archive_read_free(struct archive *); #if ARCHIVE_VERSION_NUMBER < 4000000 /* Synonym for archive_read_free() for backwards compatibility. */ -__LA_DECL int archive_read_finish(struct archive *); +__LA_DECL int archive_read_finish(struct archive *) __LA_DEPRECATED; #endif /*- @@ -547,27 +615,41 @@ __LA_DECL int archive_write_set_skip_file(struct archive *, __LA_INT64_T, __LA_INT64_T); #if ARCHIVE_VERSION_NUMBER < 4000000 -__LA_DECL int archive_write_set_compression_bzip2(struct archive *); -__LA_DECL int archive_write_set_compression_compress(struct archive *); -__LA_DECL int archive_write_set_compression_gzip(struct archive *); -__LA_DECL int archive_write_set_compression_lzip(struct archive *); -__LA_DECL int archive_write_set_compression_lzma(struct archive *); -__LA_DECL int archive_write_set_compression_none(struct archive *); +__LA_DECL int archive_write_set_compression_bzip2(struct archive *) + __LA_DEPRECATED; +__LA_DECL int archive_write_set_compression_compress(struct archive *) + __LA_DEPRECATED; +__LA_DECL int archive_write_set_compression_gzip(struct archive *) + __LA_DEPRECATED; +__LA_DECL int archive_write_set_compression_lzip(struct archive *) + __LA_DEPRECATED; +__LA_DECL int archive_write_set_compression_lzma(struct archive *) + __LA_DEPRECATED; +__LA_DECL int archive_write_set_compression_none(struct archive *) + __LA_DEPRECATED; __LA_DECL int archive_write_set_compression_program(struct archive *, - const char *cmd); -__LA_DECL int archive_write_set_compression_xz(struct archive *); + const char *cmd) __LA_DEPRECATED; +__LA_DECL int archive_write_set_compression_xz(struct archive *) + __LA_DEPRECATED; #endif /* A convenience function to set the filter based on the code. */ __LA_DECL int archive_write_add_filter(struct archive *, int filter_code); +__LA_DECL int archive_write_add_filter_by_name(struct archive *, + const char *name); +__LA_DECL int archive_write_add_filter_b64encode(struct archive *); __LA_DECL int archive_write_add_filter_bzip2(struct archive *); __LA_DECL int archive_write_add_filter_compress(struct archive *); +__LA_DECL int archive_write_add_filter_grzip(struct archive *); __LA_DECL int archive_write_add_filter_gzip(struct archive *); +__LA_DECL int archive_write_add_filter_lrzip(struct archive *); __LA_DECL int archive_write_add_filter_lzip(struct archive *); __LA_DECL int archive_write_add_filter_lzma(struct archive *); +__LA_DECL int archive_write_add_filter_lzop(struct archive *); __LA_DECL int archive_write_add_filter_none(struct archive *); __LA_DECL int archive_write_add_filter_program(struct archive *, const char *cmd); +__LA_DECL int archive_write_add_filter_uuencode(struct archive *); __LA_DECL int archive_write_add_filter_xz(struct archive *); @@ -584,14 +666,18 @@ __LA_DECL int archive_write_set_format_cpio_newc(struct archive *); __LA_DECL int archive_write_set_format_gnutar(struct archive *); __LA_DECL int archive_write_set_format_iso9660(struct archive *); __LA_DECL int archive_write_set_format_mtree(struct archive *); +__LA_DECL int archive_write_set_format_mtree_classic(struct archive *); /* TODO: int archive_write_set_format_old_tar(struct archive *); */ __LA_DECL int archive_write_set_format_pax(struct archive *); __LA_DECL int archive_write_set_format_pax_restricted(struct archive *); __LA_DECL int archive_write_set_format_shar(struct archive *); __LA_DECL int archive_write_set_format_shar_dump(struct archive *); __LA_DECL int archive_write_set_format_ustar(struct archive *); +__LA_DECL int archive_write_set_format_v7tar(struct archive *); __LA_DECL int archive_write_set_format_xar(struct archive *); __LA_DECL int archive_write_set_format_zip(struct archive *); +__LA_DECL int archive_write_zip_set_compression_deflate(struct archive *); +__LA_DECL int archive_write_zip_set_compression_store(struct archive *); __LA_DECL int archive_write_open(struct archive *, void *, archive_open_callback *, archive_write_callback *, archive_close_callback *); @@ -600,7 +686,8 @@ __LA_DECL int archive_write_open_filename(struct archive *, const char *_file); __LA_DECL int archive_write_open_filename_w(struct archive *, const wchar_t *_file); /* A deprecated synonym for archive_write_open_filename() */ -__LA_DECL int archive_write_open_file(struct archive *, const char *_file); +__LA_DECL int archive_write_open_file(struct archive *, const char *_file) + __LA_DEPRECATED; __LA_DECL int archive_write_open_FILE(struct archive *, FILE *); /* _buffSize is the size of the buffer, _used refers to a variable that * will be updated after each write into the buffer. */ @@ -622,12 +709,16 @@ __LA_DECL __LA_SSIZE_T archive_write_data_block(struct archive *, __LA_DECL int archive_write_finish_entry(struct archive *); __LA_DECL int archive_write_close(struct archive *); +/* Marks the archive as FATAL so that a subsequent free() operation + * won't try to close() cleanly. Provides a fast abort capability + * when the client discovers that things have gone wrong. */ +__LA_DECL int archive_write_fail(struct archive *); /* This can fail if the archive wasn't already closed, in which case * archive_write_free() will implicitly call archive_write_close(). */ __LA_DECL int archive_write_free(struct archive *); #if ARCHIVE_VERSION_NUMBER < 4000000 /* Synonym for archive_write_free() for backwards compatibility. */ -__LA_DECL int archive_write_finish(struct archive *); +__LA_DECL int archive_write_finish(struct archive *) __LA_DEPRECATED; #endif /* @@ -806,13 +897,17 @@ __LA_DECL const char * archive_filter_name(struct archive *, int); /* These don't properly handle multiple filters, so are deprecated and * will eventually be removed. */ /* As of libarchive 3.0, this is an alias for archive_filter_bytes(a, -1); */ -__LA_DECL __LA_INT64_T archive_position_compressed(struct archive *); +__LA_DECL __LA_INT64_T archive_position_compressed(struct archive *) + __LA_DEPRECATED; /* As of libarchive 3.0, this is an alias for archive_filter_bytes(a, 0); */ -__LA_DECL __LA_INT64_T archive_position_uncompressed(struct archive *); +__LA_DECL __LA_INT64_T archive_position_uncompressed(struct archive *) + __LA_DEPRECATED; /* As of libarchive 3.0, this is an alias for archive_filter_name(a, 0); */ -__LA_DECL const char *archive_compression_name(struct archive *); +__LA_DECL const char *archive_compression_name(struct archive *) + __LA_DEPRECATED; /* As of libarchive 3.0, this is an alias for archive_filter_code(a, 0); */ -__LA_DECL int archive_compression(struct archive *); +__LA_DECL int archive_compression(struct archive *) + __LA_DEPRECATED; #endif __LA_DECL int archive_errno(struct archive *); diff --git a/libarchive/archive_cmdline.c b/libarchive/archive_cmdline.c new file mode 100644 index 000000000000..7d3bac53bb5c --- /dev/null +++ b/libarchive/archive_cmdline.c @@ -0,0 +1,227 @@ +/*- + * Copyright (c) 2012 Michihiro NAKAJIMA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "archive_platform.h" + +__FBSDID("$FreeBSD$"); + +#ifdef HAVE_STRING_H +# include +#endif +#ifdef HAVE_STDLIB_H +# include +#endif + +#include "archive.h" +#include "archive_cmdline_private.h" +#include "archive_string.h" + +static int cmdline_set_path(struct archive_cmdline *, const char *); +static int cmdline_add_arg(struct archive_cmdline *, const char *); + +static ssize_t +extract_quotation(struct archive_string *as, const char *p) +{ + const char *s; + + for (s = p + 1; *s;) { + if (*s == '\\') { + if (s[1] != '\0') { + archive_strappend_char(as, s[1]); + s += 2; + } else + s++; + } else if (*s == '"') + break; + else { + archive_strappend_char(as, s[0]); + s++; + } + } + if (*s != '"') + return (ARCHIVE_FAILED);/* Invalid sequence. */ + return ((ssize_t)(s + 1 - p)); +} + +static ssize_t +get_argument(struct archive_string *as, const char *p) +{ + const char *s = p; + + archive_string_empty(as); + + /* Skip beginning space characters. */ + while (*s != '\0' && *s == ' ') + s++; + /* Copy non-space characters. */ + while (*s != '\0' && *s != ' ') { + if (*s == '\\') { + if (s[1] != '\0') { + archive_strappend_char(as, s[1]); + s += 2; + } else { + s++;/* Ignore this character.*/ + break; + } + } else if (*s == '"') { + ssize_t q = extract_quotation(as, s); + if (q < 0) + return (ARCHIVE_FAILED);/* Invalid sequence. */ + s += q; + } else { + archive_strappend_char(as, s[0]); + s++; + } + } + return ((ssize_t)(s - p)); +} + +/* + * Set up command line arguments. + * Returns ARChIVE_OK if everything okey. + * Returns ARChIVE_FAILED if there is a lack of the `"' terminator or an + * empty command line. + * Returns ARChIVE_FATAL if no memory. + */ +int +__archive_cmdline_parse(struct archive_cmdline *data, const char *cmd) +{ + struct archive_string as; + const char *p; + ssize_t al; + int r; + + archive_string_init(&as); + + /* Get first argument as a command path. */ + al = get_argument(&as, cmd); + if (al < 0) { + r = ARCHIVE_FAILED;/* Invalid sequence. */ + goto exit_function; + } + if (archive_strlen(&as) == 0) { + r = ARCHIVE_FAILED;/* An empty command path. */ + goto exit_function; + } + r = cmdline_set_path(data, as.s); + if (r != ARCHIVE_OK) + goto exit_function; + p = strrchr(as.s, '/'); + if (p == NULL) + p = as.s; + else + p++; + r = cmdline_add_arg(data, p); + if (r != ARCHIVE_OK) + goto exit_function; + cmd += al; + + for (;;) { + al = get_argument(&as, cmd); + if (al < 0) { + r = ARCHIVE_FAILED;/* Invalid sequence. */ + goto exit_function; + } + if (al == 0) + break; + cmd += al; + if (archive_strlen(&as) == 0 && *cmd == '\0') + break; + r = cmdline_add_arg(data, as.s); + if (r != ARCHIVE_OK) + goto exit_function; + } + r = ARCHIVE_OK; +exit_function: + archive_string_free(&as); + return (r); +} + +/* + * Set the program path. + */ +static int +cmdline_set_path(struct archive_cmdline *data, const char *path) +{ + char *newptr; + + newptr = realloc(data->path, strlen(path) + 1); + if (newptr == NULL) + return (ARCHIVE_FATAL); + data->path = newptr; + strcpy(data->path, path); + return (ARCHIVE_OK); +} + +/* + * Add a argument for the program. + */ +static int +cmdline_add_arg(struct archive_cmdline *data, const char *arg) +{ + char **newargv; + + if (data->path == NULL) + return (ARCHIVE_FAILED); + + newargv = realloc(data->argv, (data->argc + 2) * sizeof(char *)); + if (newargv == NULL) + return (ARCHIVE_FATAL); + data->argv = newargv; + data->argv[data->argc] = strdup(arg); + if (data->argv[data->argc] == NULL) + return (ARCHIVE_FATAL); + /* Set the terminator of argv. */ + data->argv[++data->argc] = NULL; + return (ARCHIVE_OK); +} + +struct archive_cmdline * +__archive_cmdline_allocate(void) +{ + return (struct archive_cmdline *) + calloc(1, sizeof(struct archive_cmdline)); +} + +/* + * Release the resources. + */ +int +__archive_cmdline_free(struct archive_cmdline *data) +{ + + if (data) { + free(data->path); + if (data->argv != NULL) { + int i; + for (i = 0; data->argv[i] != NULL; i++) + free(data->argv[i]); + free(data->argv); + } + free(data); + } + return (ARCHIVE_OK); +} + diff --git a/libarchive/archive_cmdline_private.h b/libarchive/archive_cmdline_private.h new file mode 100644 index 000000000000..4e409e814817 --- /dev/null +++ b/libarchive/archive_cmdline_private.h @@ -0,0 +1,47 @@ +/*- + * Copyright (c) 2012 Michihiro NAKAJIMA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + * $FreeBSD$ + */ + +#ifndef __LIBARCHIVE_BUILD +#ifndef __LIBARCHIVE_TEST +#error This header is only to be used internally to libarchive. +#endif +#endif + +#ifndef ARCHIVE_CMDLINE_PRIVATE_H +#define ARCHIVE_CMDLINE_PRIVATE_H + +struct archive_cmdline { + char *path; + char **argv; + int argc; +}; + +struct archive_cmdline *__archive_cmdline_allocate(void); +int __archive_cmdline_parse(struct archive_cmdline *, const char *); +int __archive_cmdline_free(struct archive_cmdline *); + +#endif diff --git a/libarchive/archive_crypto.c b/libarchive/archive_crypto.c index 2caf57169296..85aba3ae27cd 100644 --- a/libarchive/archive_crypto.c +++ b/libarchive/archive_crypto.c @@ -90,7 +90,7 @@ win_crypto_Update(Digest_CTX *ctx, const unsigned char *buf, size_t len) static int win_crypto_Final(unsigned char *buf, size_t bufsize, Digest_CTX *ctx) { - DWORD siglen = bufsize; + DWORD siglen = (DWORD)bufsize; if (!ctx->valid) return (ARCHIVE_FAILED); @@ -1222,8 +1222,10 @@ __archive_stub_sha512final(archive_sha512_ctx *ctx, void *md) * 2. libc2 * 3. libc3 * 4. libSystem - * 5. OpenSSL - * 6. Windows API + * 5. Nettle + * 6. OpenSSL + * 7. libmd + * 8. Windows API */ const struct archive_crypto __archive_crypto = { diff --git a/libarchive/archive_entry.c b/libarchive/archive_entry.c index b531c77d2126..386e51d473e8 100644 --- a/libarchive/archive_entry.c +++ b/libarchive/archive_entry.c @@ -1449,6 +1449,9 @@ static struct flag { { "nouunlnk", L"nouunlnk", UF_NOUNLINK, 0 }, { "nouunlink", L"nouunlink", UF_NOUNLINK, 0 }, #endif +#ifdef UF_COMPRESSED + { "nocompressed",L"nocompressed", UF_COMPRESSED, 0 }, +#endif #ifdef EXT2_UNRM_FL { "nouunlink", L"nouunlink", EXT2_UNRM_FL, 0}, #endif diff --git a/libarchive/archive_entry.h b/libarchive/archive_entry.h index 5fd7cab0dc3f..a9050652e6a4 100644 --- a/libarchive/archive_entry.h +++ b/libarchive/archive_entry.h @@ -29,7 +29,7 @@ #define ARCHIVE_ENTRY_H_INCLUDED /* Note: Compiler will complain if this does not match archive.h! */ -#define ARCHIVE_VERSION_NUMBER 3000004 +#define ARCHIVE_VERSION_NUMBER 3001002 /* * Note: archive_entry.h is for use outside of libarchive; the diff --git a/libarchive/archive_entry_link_resolver.c b/libarchive/archive_entry_link_resolver.c index 07f0d362e48c..c7d59497a7cf 100644 --- a/libarchive/archive_entry_link_resolver.c +++ b/libarchive/archive_entry_link_resolver.c @@ -244,6 +244,9 @@ archive_entry_linkify(struct archive_entry_linkresolver *res, * for future use. */ le = insert_entry(res, *e); + if (le == NULL) + /* XXX We should return an error code XXX */ + return; le->entry = *e; *e = NULL; } diff --git a/libarchive/archive_match.c b/libarchive/archive_match.c index 6b533e6ba94d..6b6be9cb20b5 100644 --- a/libarchive/archive_match.c +++ b/libarchive/archive_match.c @@ -1376,6 +1376,7 @@ add_entry(struct archive_match *a, int flag, archive_mstring_copy_wcs(&(f->pathname), pathname); a->exclusion_tree.rbt_ops = &rb_ops_wcs; #else + (void)rb_ops_wcs; pathname = archive_entry_pathname(entry); if (pathname == NULL) { free(f); @@ -1515,6 +1516,7 @@ time_excluded(struct archive_match *a, struct archive_entry *entry) pathname = archive_entry_pathname_w(entry); a->exclusion_tree.rbt_ops = &rb_ops_wcs; #else + (void)rb_ops_wcs; pathname = archive_entry_pathname(entry); a->exclusion_tree.rbt_ops = &rb_ops_mbs; #endif @@ -1675,13 +1677,16 @@ add_owner_id(struct archive_match *a, struct id_array *ids, int64_t id) unsigned i; if (ids->count + 1 >= ids->size) { + void *p; + if (ids->size == 0) ids->size = 8; else ids->size *= 2; - ids->ids = realloc(ids->ids, sizeof(*ids->ids) * ids->size); - if (ids->ids == NULL) + p = realloc(ids->ids, sizeof(*ids->ids) * ids->size); + if (p == NULL) return (error_nomem(a)); + ids->ids = (int64_t *)p; } /* Find an insert point. */ @@ -1709,7 +1714,7 @@ match_owner_id(struct id_array *ids, int64_t id) unsigned b, m, t; t = 0; - b = ids->count; + b = (unsigned)ids->count; while (t < b) { m = (t + b)>>1; if (ids->ids[m] == id) diff --git a/libarchive/archive_options.c b/libarchive/archive_options.c index 08a348fb3034..8af623931f01 100644 --- a/libarchive/archive_options.c +++ b/libarchive/archive_options.c @@ -87,6 +87,8 @@ _archive_set_either_option(struct archive *a, const char *m, const char *o, cons if (r2 == ARCHIVE_FATAL) return (ARCHIVE_FATAL); + if (r2 == ARCHIVE_WARN - 1) + return r1; return r1 > r2 ? r1 : r2; } @@ -94,7 +96,7 @@ int _archive_set_options(struct archive *a, const char *options, int magic, const char *fn, option_handler use_option) { - int allok = 1, anyok = 0, r; + int allok = 1, anyok = 0, ignore_mod_err = 0, r; char *data; const char *s, *mod, *opt, *val; @@ -111,6 +113,15 @@ _archive_set_options(struct archive *a, const char *options, mod = opt = val = NULL; parse_option(&s, &mod, &opt, &val); + if (mod == NULL && opt != NULL && + strcmp("__ignore_wrong_module_name__", opt) == 0) { + /* Ignore module name error */ + if (val != NULL) { + ignore_mod_err = 1; + anyok = 1; + } + continue; + } r = use_option(a, mod, opt, val); if (r == ARCHIVE_FATAL) { @@ -122,6 +133,8 @@ _archive_set_options(struct archive *a, const char *options, return (ARCHIVE_FAILED); } if (r == ARCHIVE_WARN - 1) { + if (ignore_mod_err) + continue; /* The module name is wrong. */ archive_set_error(a, ARCHIVE_ERRNO_MISC, "Unknown module name: `%s'", mod); diff --git a/libarchive/archive_ppmd7.c b/libarchive/archive_ppmd7.c index 13a258188a61..fe0b0318cc05 100644 --- a/libarchive/archive_ppmd7.c +++ b/libarchive/archive_ppmd7.c @@ -990,7 +990,7 @@ static void RangeEnc_ShiftLow(CPpmd7z_RangeEnc *p) p->Cache = (Byte)((UInt32)p->Low >> 24); } p->CacheSize++; - p->Low = (UInt32)p->Low << 8; + p->Low = ((UInt32)p->Low << 8) & 0xFFFFFFFF; } static void RangeEnc_Encode(CPpmd7z_RangeEnc *p, UInt32 start, UInt32 size, UInt32 total) diff --git a/libarchive/archive_private.h b/libarchive/archive_private.h index 470f50051e70..30d472fcda0f 100644 --- a/libarchive/archive_private.h +++ b/libarchive/archive_private.h @@ -134,6 +134,7 @@ int __archive_check_magic(struct archive *, unsigned int magic, void __archive_errx(int retvalue, const char *msg) __LA_DEAD; +void __archive_ensure_cloexec_flag(int fd); int __archive_mktemp(const char *tmpdir); int __archive_clean(struct archive *); diff --git a/libarchive/archive_rb.c b/libarchive/archive_rb.c index 70bf7e6d3379..5b5da2034497 100644 --- a/libarchive/archive_rb.c +++ b/libarchive/archive_rb.c @@ -237,6 +237,8 @@ __archive_rb_tree_reparent_nodes( struct archive_rb_node * const new_father = old_child; struct archive_rb_node * const new_child = old_father; + if (new_father == NULL) + return; /* * Exchange descendant linkages. */ @@ -552,6 +554,8 @@ __archive_rb_tree_removal_rebalance(struct archive_rb_tree *rbt, unsigned int other = which ^ RB_DIR_OTHER; struct archive_rb_node *brother = parent->rb_nodes[other]; + if (brother == NULL) + return;/* The tree may be broken. */ /* * For cases 1, 2a, and 2b, our brother's children must * be black and our father must be black @@ -573,6 +577,8 @@ __archive_rb_tree_removal_rebalance(struct archive_rb_tree *rbt, */ __archive_rb_tree_reparent_nodes(parent, other); brother = parent->rb_nodes[other]; + if (brother == NULL) + return;/* The tree may be broken. */ } else { /* * Both our parent and brother are black. @@ -656,6 +662,8 @@ __archive_rb_tree_removal_rebalance(struct archive_rb_tree *rbt, * If we had two red nephews, then after the swap, * our former father would have a red grandson. */ + if (brother->rb_nodes[other] == NULL) + return;/* The tree may be broken. */ RB_MARK_BLACK(brother->rb_nodes[other]); __archive_rb_tree_reparent_nodes(parent, other); break; /* We're done! */ diff --git a/libarchive/archive_read.c b/libarchive/archive_read.c index e99906f825ae..048c316c52d4 100644 --- a/libarchive/archive_read.c +++ b/libarchive/archive_read.c @@ -57,8 +57,6 @@ __FBSDID("$FreeBSD: head/lib/libarchive/archive_read.c 201157 2009-12-29 05:30:2 static int choose_filters(struct archive_read *); static int choose_format(struct archive_read *); -static void free_filters(struct archive_read *); -static int close_filters(struct archive_read *); static struct archive_vtable *archive_read_vtable(void); static int64_t _archive_filter_bytes(struct archive *, int); static int _archive_filter_code(struct archive *, int); @@ -194,8 +192,8 @@ client_skip_proxy(struct archive_read_filter *self, int64_t request) int64_t get, ask = request; if (ask > skip_limit) ask = skip_limit; - get = (self->archive->client.skipper)(&self->archive->archive, - self->data, ask); + get = (self->archive->client.skipper) + (&self->archive->archive, self->data, ask); if (get == 0) return (total); request -= get; @@ -215,8 +213,8 @@ client_skip_proxy(struct archive_read_filter *self, int64_t request) * only do this for skips of over 64k. */ int64_t before = self->position; - int64_t after = (self->archive->client.seeker)(&self->archive->archive, - self->data, request, SEEK_CUR); + int64_t after = (self->archive->client.seeker) + (&self->archive->archive, self->data, request, SEEK_CUR); if (after != before + request) return ARCHIVE_FATAL; return after - before; @@ -241,14 +239,64 @@ client_seek_proxy(struct archive_read_filter *self, int64_t offset, int whence) static int client_close_proxy(struct archive_read_filter *self) { - int r = ARCHIVE_OK; + int r = ARCHIVE_OK, r2; + unsigned int i; - if (self->archive->client.closer != NULL) - r = (self->archive->client.closer)((struct archive *)self->archive, - self->data); + if (self->archive->client.closer == NULL) + return (r); + for (i = 0; i < self->archive->client.nodes; i++) + { + r2 = (self->archive->client.closer) + ((struct archive *)self->archive, + self->archive->client.dataset[i].data); + if (r > r2) + r = r2; + } return (r); } +static int +client_open_proxy(struct archive_read_filter *self) +{ + int r = ARCHIVE_OK; + if (self->archive->client.opener != NULL) + r = (self->archive->client.opener)( + (struct archive *)self->archive, self->data); + return (r); +} + +static int +client_switch_proxy(struct archive_read_filter *self, unsigned int iindex) +{ + int r1 = ARCHIVE_OK, r2 = ARCHIVE_OK; + void *data2 = NULL; + + /* Don't do anything if already in the specified data node */ + if (self->archive->client.cursor == iindex) + return (ARCHIVE_OK); + + self->archive->client.cursor = iindex; + data2 = self->archive->client.dataset[self->archive->client.cursor].data; + if (self->archive->client.switcher != NULL) + { + r1 = r2 = (self->archive->client.switcher) + ((struct archive *)self->archive, self->data, data2); + self->data = data2; + } + else + { + /* Attempt to call close and open instead */ + if (self->archive->client.closer != NULL) + r1 = (self->archive->client.closer) + ((struct archive *)self->archive, self->data); + self->data = data2; + if (self->archive->client.opener != NULL) + r2 = (self->archive->client.opener) + ((struct archive *)self->archive, self->data); + } + return (r1 < r2) ? r1 : r2; +} + int archive_read_set_open_callback(struct archive *_a, archive_open_callback *client_opener) @@ -305,21 +353,109 @@ archive_read_set_close_callback(struct archive *_a, } int -archive_read_set_callback_data(struct archive *_a, void *client_data) +archive_read_set_switch_callback(struct archive *_a, + archive_switch_callback *client_switcher) { struct archive_read *a = (struct archive_read *)_a; archive_check_magic(_a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_NEW, - "archive_read_set_callback_data"); - a->client.data = client_data; + "archive_read_set_switch_callback"); + a->client.switcher = client_switcher; return ARCHIVE_OK; } +int +archive_read_set_callback_data(struct archive *_a, void *client_data) +{ + return archive_read_set_callback_data2(_a, client_data, 0); +} + +int +archive_read_set_callback_data2(struct archive *_a, void *client_data, + unsigned int iindex) +{ + struct archive_read *a = (struct archive_read *)_a; + archive_check_magic(_a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_NEW, + "archive_read_set_callback_data2"); + + if (a->client.nodes == 0) + { + a->client.dataset = (struct archive_read_data_node *) + calloc(1, sizeof(*a->client.dataset)); + if (a->client.dataset == NULL) + { + archive_set_error(&a->archive, ENOMEM, + "No memory."); + return ARCHIVE_FATAL; + } + a->client.nodes = 1; + } + + if (iindex > a->client.nodes - 1) + { + archive_set_error(&a->archive, EINVAL, + "Invalid index specified."); + return ARCHIVE_FATAL; + } + a->client.dataset[iindex].data = client_data; + a->client.dataset[iindex].begin_position = -1; + a->client.dataset[iindex].total_size = -1; + return ARCHIVE_OK; +} + +int +archive_read_add_callback_data(struct archive *_a, void *client_data, + unsigned int iindex) +{ + struct archive_read *a = (struct archive_read *)_a; + void *p; + unsigned int i; + + archive_check_magic(_a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_NEW, + "archive_read_add_callback_data"); + if (iindex > a->client.nodes) { + archive_set_error(&a->archive, EINVAL, + "Invalid index specified."); + return ARCHIVE_FATAL; + } + p = realloc(a->client.dataset, sizeof(*a->client.dataset) + * (++(a->client.nodes))); + if (p == NULL) { + archive_set_error(&a->archive, ENOMEM, + "No memory."); + return ARCHIVE_FATAL; + } + a->client.dataset = (struct archive_read_data_node *)p; + for (i = a->client.nodes - 1; i > iindex && i > 0; i--) { + a->client.dataset[i].data = a->client.dataset[i-1].data; + a->client.dataset[i].begin_position = -1; + a->client.dataset[i].total_size = -1; + } + a->client.dataset[iindex].data = client_data; + a->client.dataset[iindex].begin_position = -1; + a->client.dataset[iindex].total_size = -1; + return ARCHIVE_OK; +} + +int +archive_read_append_callback_data(struct archive *_a, void *client_data) +{ + struct archive_read *a = (struct archive_read *)_a; + return archive_read_add_callback_data(_a, client_data, a->client.nodes); +} + +int +archive_read_prepend_callback_data(struct archive *_a, void *client_data) +{ + return archive_read_add_callback_data(_a, client_data, 0); +} + int archive_read_open1(struct archive *_a) { struct archive_read *a = (struct archive_read *)_a; - struct archive_read_filter *filter; + struct archive_read_filter *filter, *tmp; int slot, e; + unsigned int i; archive_check_magic(_a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_NEW, "archive_read_open"); @@ -334,11 +470,14 @@ archive_read_open1(struct archive *_a) /* Open data source. */ if (a->client.opener != NULL) { - e =(a->client.opener)(&a->archive, a->client.data); + e = (a->client.opener)(&a->archive, a->client.dataset[0].data); if (e != 0) { /* If the open failed, call the closer to clean up. */ - if (a->client.closer) - (a->client.closer)(&a->archive, a->client.data); + if (a->client.closer) { + for (i = 0; i < a->client.nodes; i++) + (a->client.closer)(&a->archive, + a->client.dataset[i].data); + } return (e); } } @@ -349,31 +488,51 @@ archive_read_open1(struct archive *_a) filter->bidder = NULL; filter->upstream = NULL; filter->archive = a; - filter->data = a->client.data; + filter->data = a->client.dataset[0].data; + filter->open = client_open_proxy; filter->read = client_read_proxy; filter->skip = client_skip_proxy; filter->seek = client_seek_proxy; filter->close = client_close_proxy; + filter->sswitch = client_switch_proxy; filter->name = "none"; - filter->code = ARCHIVE_COMPRESSION_NONE; - a->filter = filter; + filter->code = ARCHIVE_FILTER_NONE; - /* Build out the input pipeline. */ - e = choose_filters(a); - if (e < ARCHIVE_WARN) { - a->archive.state = ARCHIVE_STATE_FATAL; - return (ARCHIVE_FATAL); + a->client.dataset[0].begin_position = 0; + if (!a->filter || !a->bypass_filter_bidding) + { + a->filter = filter; + /* Build out the input pipeline. */ + e = choose_filters(a); + if (e < ARCHIVE_WARN) { + a->archive.state = ARCHIVE_STATE_FATAL; + return (ARCHIVE_FATAL); + } + } + else + { + /* Need to add "NONE" type filter at the end of the filter chain */ + tmp = a->filter; + while (tmp->upstream) + tmp = tmp->upstream; + tmp->upstream = filter; } - slot = choose_format(a); - if (slot < 0) { - close_filters(a); - a->archive.state = ARCHIVE_STATE_FATAL; - return (ARCHIVE_FATAL); + if (!a->format) + { + slot = choose_format(a); + if (slot < 0) { + __archive_read_close_filters(a); + a->archive.state = ARCHIVE_STATE_FATAL; + return (ARCHIVE_FATAL); + } + a->format = &(a->formats[slot]); } - a->format = &(a->formats[slot]); a->archive.state = ARCHIVE_STATE_HEADER; + + /* Ensure libarchive starts from the first node in a multivolume set */ + client_switch_proxy(a->filter, 0); return (e); } @@ -413,8 +572,8 @@ choose_filters(struct archive_read *a) /* Verify the filter by asking it for some data. */ __archive_read_filter_ahead(a->filter, 1, &avail); if (avail < 0) { - close_filters(a); - free_filters(a); + __archive_read_close_filters(a); + __archive_read_free_filters(a); return (ARCHIVE_FATAL); } a->archive.compression_name = a->filter->name; @@ -432,8 +591,8 @@ choose_filters(struct archive_read *a) a->filter = filter; r = (best_bidder->init)(a->filter); if (r != ARCHIVE_OK) { - close_filters(a); - free_filters(a); + __archive_read_close_filters(a); + __archive_read_free_filters(a); return (ARCHIVE_FATAL); } } @@ -501,6 +660,9 @@ _archive_read_next_header2(struct archive *_a, struct archive_entry *entry) a->read_data_output_offset = 0; a->read_data_remaining = 0; + a->read_data_is_posix_read = 0; + a->read_data_requested = 0; + a->data_start_node = a->client.cursor; /* EOF always wins; otherwise return the worst error. */ return (r2 < r1 || r2 == ARCHIVE_EOF) ? r2 : r1; } @@ -611,6 +773,8 @@ archive_read_data(struct archive *_a, void *buff, size_t s) while (s > 0) { if (a->read_data_remaining == 0) { read_buf = a->read_data_block; + a->read_data_is_posix_read = 1; + a->read_data_requested = s; r = _archive_read_data_block(&a->archive, &read_buf, &a->read_data_remaining, &a->read_data_offset); a->read_data_block = read_buf; @@ -664,6 +828,8 @@ archive_read_data(struct archive *_a, void *buff, size_t s) bytes_read += len; } } + a->read_data_is_posix_read = 0; + a->read_data_requested = 0; return (bytes_read); } @@ -698,6 +864,23 @@ archive_read_data_skip(struct archive *_a) return (r); } +int64_t +archive_seek_data(struct archive *_a, int64_t offset, int whence) +{ + struct archive_read *a = (struct archive_read *)_a; + archive_check_magic(_a, ARCHIVE_READ_MAGIC, ARCHIVE_STATE_DATA, + "archive_seek_data_block"); + + if (a->format->seek_data == NULL) { + archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER, + "Internal error: " + "No format_seek_data_block function registered"); + return (ARCHIVE_FATAL); + } + + return (a->format->seek_data)(a, offset, whence); +} + /* * Read the next block of entry data from the archive. * This is a zero-copy interface; the client receives a pointer, @@ -724,8 +907,8 @@ _archive_read_data_block(struct archive *_a, return (a->format->read_data)(a, buff, size, offset); } -static int -close_filters(struct archive_read *a) +int +__archive_read_close_filters(struct archive_read *a) { struct archive_read_filter *f = a->filter; int r = ARCHIVE_OK; @@ -745,8 +928,8 @@ close_filters(struct archive_read *a) return r; } -static void -free_filters(struct archive_read *a) +void +__archive_read_free_filters(struct archive_read *a) { while (a->filter != NULL) { struct archive_read_filter *t = a->filter->upstream; @@ -790,7 +973,7 @@ _archive_read_close(struct archive *_a) /* TODO: Clean up the formatters. */ /* Release the filter objects. */ - r1 = close_filters(a); + r1 = __archive_read_close_filters(a); if (r1 < r) r = r1; @@ -829,7 +1012,7 @@ _archive_read_free(struct archive *_a) } /* Free the filters */ - free_filters(a); + __archive_read_free_filters(a); /* Release the bidder objects. */ n = sizeof(a->bidders)/sizeof(a->bidders[0]); @@ -846,6 +1029,7 @@ _archive_read_free(struct archive *_a) archive_entry_free(a->entry); a->archive.magic = 0; __archive_clean(&a->archive); + free(a->client.dataset); free(a); return (r); } @@ -855,7 +1039,8 @@ get_filter(struct archive *_a, int n) { struct archive_read *a = (struct archive_read *)_a; struct archive_read_filter *f = a->filter; - /* We use n == -1 for 'the last filter', which is always the client proxy. */ + /* We use n == -1 for 'the last filter', which is always the + * client proxy. */ if (n == -1 && f != NULL) { struct archive_read_filter *last = f; f = f->upstream; @@ -908,6 +1093,7 @@ __archive_read_register_format(struct archive_read *a, int (*read_header)(struct archive_read *, struct archive_entry *), int (*read_data)(struct archive_read *, const void **, size_t *, int64_t *), int (*read_data_skip)(struct archive_read *), + int64_t (*seek_data)(struct archive_read *, int64_t, int), int (*cleanup)(struct archive_read *)) { int i, number_slots; @@ -927,6 +1113,7 @@ __archive_read_register_format(struct archive_read *a, a->formats[i].read_header = read_header; a->formats[i].read_data = read_data; a->formats[i].read_data_skip = read_data_skip; + a->formats[i].seek_data = seek_data; a->formats[i].cleanup = cleanup; a->formats[i].data = format_data; a->formats[i].name = name; @@ -1073,7 +1260,8 @@ __archive_read_filter_ahead(struct archive_read_filter *filter, if (filter->next > filter->buffer && filter->next + min > filter->buffer + filter->buffer_size) { if (filter->avail > 0) - memmove(filter->buffer, filter->next, filter->avail); + memmove(filter->buffer, filter->next, + filter->avail); filter->next = filter->buffer; } @@ -1088,15 +1276,26 @@ __archive_read_filter_ahead(struct archive_read_filter *filter, &filter->client_buff); if (bytes_read < 0) { /* Read error. */ filter->client_total = filter->client_avail = 0; - filter->client_next = filter->client_buff = NULL; + filter->client_next = + filter->client_buff = NULL; filter->fatal = 1; if (avail != NULL) *avail = ARCHIVE_FATAL; return (NULL); } - if (bytes_read == 0) { /* Premature end-of-file. */ + if (bytes_read == 0) { + /* Check for another client object first */ + if (filter->archive->client.cursor != + filter->archive->client.nodes - 1) { + if (client_switch_proxy(filter, + filter->archive->client.cursor + 1) + == ARCHIVE_OK) + continue; + } + /* Premature end-of-file. */ filter->client_total = filter->client_avail = 0; - filter->client_next = filter->client_buff = NULL; + filter->client_next = + filter->client_buff = NULL; filter->end_of_file = 1; /* Return whatever we do have. */ if (avail != NULL) @@ -1106,9 +1305,7 @@ __archive_read_filter_ahead(struct archive_read_filter *filter, filter->client_total = bytes_read; filter->client_avail = filter->client_total; filter->client_next = filter->client_buff; - } - else - { + } else { /* * We can't satisfy the request from the copy * buffer or the existing client data, so we @@ -1129,9 +1326,10 @@ __archive_read_filter_ahead(struct archive_read_filter *filter, t *= 2; if (t <= s) { /* Integer overflow! */ archive_set_error( - &filter->archive->archive, - ENOMEM, - "Unable to allocate copy buffer"); + &filter->archive->archive, + ENOMEM, + "Unable to allocate copy" + " buffer"); filter->fatal = 1; if (avail != NULL) *avail = ARCHIVE_FATAL; @@ -1170,8 +1368,8 @@ __archive_read_filter_ahead(struct archive_read_filter *filter, if (tocopy > filter->client_avail) tocopy = filter->client_avail; - memcpy(filter->next + filter->avail, filter->client_next, - tocopy); + memcpy(filter->next + filter->avail, + filter->client_next, tocopy); /* Remove this data from client buffer. */ filter->client_next += tocopy; filter->client_avail -= tocopy; @@ -1274,6 +1472,13 @@ advance_file_pointer(struct archive_read_filter *filter, int64_t request) } if (bytes_read == 0) { + if (filter->archive->client.cursor != + filter->archive->client.nodes - 1) { + if (client_switch_proxy(filter, + filter->archive->client.cursor + 1) + == ARCHIVE_OK) + continue; + } filter->client_buff = NULL; filter->end_of_file = 1; return (total_bytes_skipped); @@ -1305,15 +1510,109 @@ __archive_read_seek(struct archive_read *a, int64_t offset, int whence) } int64_t -__archive_read_filter_seek(struct archive_read_filter *filter, int64_t offset, int whence) +__archive_read_filter_seek(struct archive_read_filter *filter, int64_t offset, + int whence) { + struct archive_read_client *client; int64_t r; + unsigned int cursor; if (filter->closed || filter->fatal) return (ARCHIVE_FATAL); if (filter->seek == NULL) return (ARCHIVE_FAILED); - r = filter->seek(filter, offset, whence); + + client = &(filter->archive->client); + switch (whence) { + case SEEK_CUR: + /* Adjust the offset and use SEEK_SET instead */ + offset += filter->position; + case SEEK_SET: + cursor = 0; + while (1) + { + if (client->dataset[cursor].begin_position < 0 || + client->dataset[cursor].total_size < 0 || + client->dataset[cursor].begin_position + + client->dataset[cursor].total_size - 1 > offset || + cursor + 1 >= client->nodes) + break; + r = client->dataset[cursor].begin_position + + client->dataset[cursor].total_size; + client->dataset[++cursor].begin_position = r; + } + while (1) { + r = client_switch_proxy(filter, cursor); + if (r != ARCHIVE_OK) + return r; + if ((r = client_seek_proxy(filter, 0, SEEK_END)) < 0) + return r; + client->dataset[cursor].total_size = r; + if (client->dataset[cursor].begin_position + + client->dataset[cursor].total_size - 1 > offset || + cursor + 1 >= client->nodes) + break; + r = client->dataset[cursor].begin_position + + client->dataset[cursor].total_size; + client->dataset[++cursor].begin_position = r; + } + offset -= client->dataset[cursor].begin_position; + if (offset < 0) + offset = 0; + else if (offset > client->dataset[cursor].total_size - 1) + offset = client->dataset[cursor].total_size - 1; + if ((r = client_seek_proxy(filter, offset, SEEK_SET)) < 0) + return r; + break; + + case SEEK_END: + cursor = 0; + while (1) { + if (client->dataset[cursor].begin_position < 0 || + client->dataset[cursor].total_size < 0 || + cursor + 1 >= client->nodes) + break; + r = client->dataset[cursor].begin_position + + client->dataset[cursor].total_size; + client->dataset[++cursor].begin_position = r; + } + while (1) { + r = client_switch_proxy(filter, cursor); + if (r != ARCHIVE_OK) + return r; + if ((r = client_seek_proxy(filter, 0, SEEK_END)) < 0) + return r; + client->dataset[cursor].total_size = r; + r = client->dataset[cursor].begin_position + + client->dataset[cursor].total_size; + if (cursor + 1 >= client->nodes) + break; + client->dataset[++cursor].begin_position = r; + } + while (1) { + if (r + offset >= + client->dataset[cursor].begin_position) + break; + offset += client->dataset[cursor].total_size; + if (cursor == 0) + break; + cursor--; + r = client->dataset[cursor].begin_position + + client->dataset[cursor].total_size; + } + offset = (r + offset) - client->dataset[cursor].begin_position; + if ((r = client_switch_proxy(filter, cursor)) != ARCHIVE_OK) + return r; + r = client_seek_proxy(filter, offset, SEEK_SET); + if (r < ARCHIVE_OK) + return r; + break; + + default: + return (ARCHIVE_FATAL); + } + r += client->dataset[cursor].begin_position; + if (r >= 0) { /* * Ouch. Clearing the buffer like this hurts, especially diff --git a/libarchive/archive_read_append_filter.c b/libarchive/archive_read_append_filter.c new file mode 100644 index 000000000000..017d7c68a4b3 --- /dev/null +++ b/libarchive/archive_read_append_filter.c @@ -0,0 +1,198 @@ +/*- + * Copyright (c) 2003-2012 Tim Kientzle + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "archive_platform.h" +__FBSDID("$FreeBSD$"); + +#ifdef HAVE_ERRNO_H +#include +#endif + +#include "archive.h" +#include "archive_private.h" +#include "archive_read_private.h" + +int +archive_read_append_filter(struct archive *_a, int code) +{ + int r1, r2, number_bidders, i; + char str[20]; + struct archive_read_filter_bidder *bidder; + struct archive_read_filter *filter; + struct archive_read *a = (struct archive_read *)_a; + + r1 = r2 = (ARCHIVE_OK); + switch (code) + { + case ARCHIVE_FILTER_NONE: + /* No filter to add, so do nothing. + * NOTE: An initial "NONE" type filter is always set at the end of the + * filter chain. + */ + r1 = (ARCHIVE_OK); + break; + case ARCHIVE_FILTER_GZIP: + strcpy(str, "gzip"); + r1 = archive_read_support_filter_gzip(_a); + break; + case ARCHIVE_FILTER_BZIP2: + strcpy(str, "bzip2"); + r1 = archive_read_support_filter_bzip2(_a); + break; + case ARCHIVE_FILTER_COMPRESS: + strcpy(str, "compress (.Z)"); + r1 = archive_read_support_filter_compress(_a); + break; + case ARCHIVE_FILTER_PROGRAM: + archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER, + "Cannot append program filter using archive_read_append_filter"); + return (ARCHIVE_FATAL); + case ARCHIVE_FILTER_LZMA: + strcpy(str, "lzma"); + r1 = archive_read_support_filter_lzma(_a); + break; + case ARCHIVE_FILTER_XZ: + strcpy(str, "xz"); + r1 = archive_read_support_filter_xz(_a); + break; + case ARCHIVE_FILTER_UU: + strcpy(str, "uu"); + r1 = archive_read_support_filter_uu(_a); + break; + case ARCHIVE_FILTER_RPM: + strcpy(str, "rpm"); + r1 = archive_read_support_filter_rpm(_a); + break; + case ARCHIVE_FILTER_LZIP: + strcpy(str, "lzip"); + r1 = archive_read_support_filter_lzip(_a); + break; + case ARCHIVE_FILTER_LRZIP: + strcpy(str, "lrzip"); + r1 = archive_read_support_filter_lrzip(_a); + break; + default: + archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER, + "Invalid filter code specified"); + return (ARCHIVE_FATAL); + } + + if (code != ARCHIVE_FILTER_NONE) + { + number_bidders = sizeof(a->bidders) / sizeof(a->bidders[0]); + + bidder = a->bidders; + for (i = 0; i < number_bidders; i++, bidder++) + { + if (!bidder->name || !strcmp(bidder->name, str)) + break; + } + if (!bidder->name || strcmp(bidder->name, str)) + { + archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER, + "Internal error: Unable to append filter"); + return (ARCHIVE_FATAL); + } + + filter + = (struct archive_read_filter *)calloc(1, sizeof(*filter)); + if (filter == NULL) + { + archive_set_error(&a->archive, ENOMEM, "Out of memory"); + return (ARCHIVE_FATAL); + } + filter->bidder = bidder; + filter->archive = a; + filter->upstream = a->filter; + a->filter = filter; + r2 = (bidder->init)(a->filter); + if (r2 != ARCHIVE_OK) { + __archive_read_close_filters(a); + __archive_read_free_filters(a); + return (ARCHIVE_FATAL); + } + } + + a->bypass_filter_bidding = 1; + return (r1 < r2) ? r1 : r2; +} + +int +archive_read_append_filter_program(struct archive *_a, const char *cmd) +{ + return (archive_read_append_filter_program_signature(_a, cmd, NULL, 0)); +} + +int +archive_read_append_filter_program_signature(struct archive *_a, + const char *cmd, const void *signature, size_t signature_len) +{ + int r, number_bidders, i; + struct archive_read_filter_bidder *bidder; + struct archive_read_filter *filter; + struct archive_read *a = (struct archive_read *)_a; + + if (archive_read_support_filter_program_signature(_a, cmd, signature, + signature_len) != (ARCHIVE_OK)) + return (ARCHIVE_FATAL); + + number_bidders = sizeof(a->bidders) / sizeof(a->bidders[0]); + + bidder = a->bidders; + for (i = 0; i < number_bidders; i++, bidder++) + { + /* Program bidder name set to filter name after initialization */ + if (bidder->data && !bidder->name) + break; + } + if (!bidder->data) + { + archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER, + "Internal error: Unable to append program filter"); + return (ARCHIVE_FATAL); + } + + filter + = (struct archive_read_filter *)calloc(1, sizeof(*filter)); + if (filter == NULL) + { + archive_set_error(&a->archive, ENOMEM, "Out of memory"); + return (ARCHIVE_FATAL); + } + filter->bidder = bidder; + filter->archive = a; + filter->upstream = a->filter; + a->filter = filter; + r = (bidder->init)(a->filter); + if (r != ARCHIVE_OK) { + __archive_read_close_filters(a); + __archive_read_free_filters(a); + return (ARCHIVE_FATAL); + } + bidder->name = a->filter->name; + + a->bypass_filter_bidding = 1; + return r; +} diff --git a/libarchive/archive_read_disk_entry_from_file.c b/libarchive/archive_read_disk_entry_from_file.c index a43c0adf9c2a..e984aaadbeab 100644 --- a/libarchive/archive_read_disk_entry_from_file.c +++ b/libarchive/archive_read_disk_entry_from_file.c @@ -49,8 +49,10 @@ __FBSDID("$FreeBSD: head/lib/libarchive/archive_read_disk_entry_from_file.c 2010 #ifdef HAVE_SYS_STAT_H #include #endif -#ifdef HAVE_SYS_XATTR_H +#if defined(HAVE_SYS_XATTR_H) #include +#elif defined(HAVE_ATTR_XATTR_H) +#include #endif #ifdef HAVE_SYS_EA_H #include @@ -58,9 +60,6 @@ __FBSDID("$FreeBSD: head/lib/libarchive/archive_read_disk_entry_from_file.c 2010 #ifdef HAVE_ACL_LIBACL_H #include #endif -#ifdef HAVE_ATTR_XATTR_H -#include -#endif #ifdef HAVE_COPYFILE_H #include #endif @@ -104,6 +103,10 @@ __FBSDID("$FreeBSD: head/lib/libarchive/archive_read_disk_entry_from_file.c 2010 #include "archive_private.h" #include "archive_read_disk_private.h" +#ifndef O_CLOEXEC +#define O_CLOEXEC 0 +#endif + /* * Linux and FreeBSD plug this obvious hole in POSIX.1e in * different ways. @@ -114,7 +117,7 @@ __FBSDID("$FreeBSD: head/lib/libarchive/archive_read_disk_entry_from_file.c 2010 #define ACL_GET_PERM acl_get_perm_np #endif -static int setup_acls_posix1e(struct archive_read_disk *, +static int setup_acls(struct archive_read_disk *, struct archive_entry *, int *fd); static int setup_mac_metadata(struct archive_read_disk *, struct archive_entry *, int *fd); @@ -168,15 +171,16 @@ archive_read_disk_entry_from_file(struct archive *_a, st = &s; } archive_entry_copy_stat(entry, st); - /* Lookup uname/gname */ - name = archive_read_disk_uname(_a, archive_entry_uid(entry)); - if (name != NULL) - archive_entry_copy_uname(entry, name); - name = archive_read_disk_gname(_a, archive_entry_gid(entry)); - if (name != NULL) - archive_entry_copy_gname(entry, name); } + /* Lookup uname/gname */ + name = archive_read_disk_uname(_a, archive_entry_uid(entry)); + if (name != NULL) + archive_entry_copy_uname(entry, name); + name = archive_read_disk_gname(_a, archive_entry_gid(entry)); + if (name != NULL) + archive_entry_copy_gname(entry, name); + #ifdef HAVE_STRUCT_STAT_ST_FLAGS /* On FreeBSD, we get flags for free with the stat. */ /* TODO: Does this belong in copy_stat()? */ @@ -192,12 +196,14 @@ archive_read_disk_entry_from_file(struct archive *_a, if (fd < 0) { if (a->tree != NULL) fd = a->open_on_current_dir(a->tree, path, - O_RDONLY | O_NONBLOCK); + O_RDONLY | O_NONBLOCK | O_CLOEXEC); else - fd = open(path, O_RDONLY | O_NONBLOCK); + fd = open(path, O_RDONLY | O_NONBLOCK | + O_CLOEXEC); + __archive_ensure_cloexec_flag(fd); } if (fd >= 0) { - unsigned long stflags; + int stflags; r = ioctl(fd, EXT2_IOC_GETFLAGS, &stflags); if (r == 0 && stflags != 0) archive_entry_set_fflags(entry, stflags, 0); @@ -244,7 +250,7 @@ archive_read_disk_entry_from_file(struct archive *_a, } #endif /* HAVE_READLINK || HAVE_READLINKAT */ - r = setup_acls_posix1e(a, entry, &fd); + r = setup_acls(a, entry, &fd); r1 = setup_xattrs(a, entry, &fd); if (r1 < r) r = r1; @@ -285,9 +291,10 @@ setup_mac_metadata(struct archive_read_disk *a, int copyfile_flags = COPYFILE_NOFOLLOW | COPYFILE_ACL | COPYFILE_XATTR; struct stat copyfile_stat; int ret = ARCHIVE_OK; - void *buff; + void *buff = NULL; int have_attrs; - const char *name, *tempdir, *tempfile = NULL; + const char *name, *tempdir; + struct archive_string tempfile; (void)fd; /* UNUSED */ name = archive_entry_sourcepath(entry); @@ -322,25 +329,28 @@ setup_mac_metadata(struct archive_read_disk *a, tempdir = getenv("TMPDIR"); if (tempdir == NULL) tempdir = _PATH_TMP; - tempfile = tempnam(tempdir, "tar.md."); + archive_string_init(&tempfile); + archive_strcpy(&tempfile, tempdir); + archive_strcat(&tempfile, "tar.md.XXXXXX"); + tempfd = mkstemp(tempfile.s); + if (tempfd < 0) { + archive_set_error(&a->archive, errno, + "Could not open extended attribute file"); + ret = ARCHIVE_WARN; + goto cleanup; + } + __archive_ensure_cloexec_flag(tempfd); /* XXX I wish copyfile() could pack directly to a memory * buffer; that would avoid the temp file here. For that * matter, it would be nice if fcopyfile() actually worked, * that would reduce the many open/close races here. */ - if (copyfile(name, tempfile, 0, copyfile_flags | COPYFILE_PACK)) { + if (copyfile(name, tempfile.s, 0, copyfile_flags | COPYFILE_PACK)) { archive_set_error(&a->archive, errno, "Could not pack extended attributes"); ret = ARCHIVE_WARN; goto cleanup; } - tempfd = open(tempfile, O_RDONLY); - if (tempfd < 0) { - archive_set_error(&a->archive, errno, - "Could not open extended attribute file"); - ret = ARCHIVE_WARN; - goto cleanup; - } if (fstat(tempfd, ©file_stat)) { archive_set_error(&a->archive, errno, "Could not check size of extended attributes"); @@ -363,10 +373,12 @@ setup_mac_metadata(struct archive_read_disk *a, archive_entry_copy_mac_metadata(entry, buff, copyfile_stat.st_size); cleanup: - if (tempfd >= 0) + if (tempfd >= 0) { close(tempfd); - if (tempfile != NULL) - unlink(tempfile); + unlink(tempfile.s); + } + archive_string_free(&tempfile); + free(buff); return (ret); } @@ -387,16 +399,19 @@ setup_mac_metadata(struct archive_read_disk *a, #endif -#ifdef HAVE_POSIX_ACL -static void setup_acl_posix1e(struct archive_read_disk *a, +#if defined(HAVE_POSIX_ACL) && defined(ACL_TYPE_NFS4) +static int translate_acl(struct archive_read_disk *a, struct archive_entry *entry, acl_t acl, int archive_entry_acl_type); static int -setup_acls_posix1e(struct archive_read_disk *a, +setup_acls(struct archive_read_disk *a, struct archive_entry *entry, int *fd) { const char *accpath; acl_t acl; +#if HAVE_ACL_IS_TRIVIAL_NP + int r; +#endif accpath = archive_entry_sourcepath(entry); if (accpath == NULL) @@ -404,15 +419,33 @@ setup_acls_posix1e(struct archive_read_disk *a, archive_entry_acl_clear(entry); - if (*fd < 0 && a->tree != NULL && - (a->follow_symlinks || archive_entry_filetype(entry) != AE_IFLNK)){ - *fd = a->open_on_current_dir(a->tree, accpath, - O_RDONLY | O_NONBLOCK); - if (*fd < 0) { - archive_set_error(&a->archive, errno, - "Couldn't access %s", accpath); - return (ARCHIVE_FAILED); - } + /* Try NFS4 ACL first. */ + if (*fd >= 0) + acl = acl_get_fd(*fd); +#if HAVE_ACL_GET_LINK_NP + else if (!a->follow_symlinks) + acl = acl_get_link_np(accpath, ACL_TYPE_NFS4); +#else + else if ((!a->follow_symlinks) + && (archive_entry_filetype(entry) == AE_IFLNK)) + /* We can't get the ACL of a symlink, so we assume it can't + have one. */ + acl = NULL; +#endif + else + acl = acl_get_file(accpath, ACL_TYPE_NFS4); +#if HAVE_ACL_IS_TRIVIAL_NP + /* Ignore "trivial" ACLs that just mirror the file mode. */ + acl_is_trivial_np(acl, &r); + if (r) { + acl_free(acl); + acl = NULL; + } +#endif + if (acl != NULL) { + translate_acl(a, entry, acl, ARCHIVE_ENTRY_ACL_TYPE_NFS4); + acl_free(acl); + return (ARCHIVE_OK); } /* Retrieve access ACL from file. */ @@ -431,7 +464,7 @@ setup_acls_posix1e(struct archive_read_disk *a, else acl = acl_get_file(accpath, ACL_TYPE_ACCESS); if (acl != NULL) { - setup_acl_posix1e(a, entry, acl, + translate_acl(a, entry, acl, ARCHIVE_ENTRY_ACL_TYPE_ACCESS); acl_free(acl); } @@ -440,7 +473,7 @@ setup_acls_posix1e(struct archive_read_disk *a, if (S_ISDIR(archive_entry_mode(entry))) { acl = acl_get_file(accpath, ACL_TYPE_DEFAULT); if (acl != NULL) { - setup_acl_posix1e(a, entry, acl, + translate_acl(a, entry, acl, ARCHIVE_ENTRY_ACL_TYPE_DEFAULT); acl_free(acl); } @@ -449,68 +482,180 @@ setup_acls_posix1e(struct archive_read_disk *a, } /* - * Translate POSIX.1e ACL into libarchive internal structure. + * Translate system ACL into libarchive internal structure. */ -static void -setup_acl_posix1e(struct archive_read_disk *a, - struct archive_entry *entry, acl_t acl, int archive_entry_acl_type) + +static struct { + int archive_perm; + int platform_perm; +} acl_perm_map[] = { + {ARCHIVE_ENTRY_ACL_EXECUTE, ACL_EXECUTE}, + {ARCHIVE_ENTRY_ACL_WRITE, ACL_WRITE}, + {ARCHIVE_ENTRY_ACL_READ, ACL_READ}, + {ARCHIVE_ENTRY_ACL_READ_DATA, ACL_READ_DATA}, + {ARCHIVE_ENTRY_ACL_LIST_DIRECTORY, ACL_LIST_DIRECTORY}, + {ARCHIVE_ENTRY_ACL_WRITE_DATA, ACL_WRITE_DATA}, + {ARCHIVE_ENTRY_ACL_ADD_FILE, ACL_ADD_FILE}, + {ARCHIVE_ENTRY_ACL_APPEND_DATA, ACL_APPEND_DATA}, + {ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY, ACL_ADD_SUBDIRECTORY}, + {ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS, ACL_READ_NAMED_ATTRS}, + {ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS, ACL_WRITE_NAMED_ATTRS}, + {ARCHIVE_ENTRY_ACL_DELETE_CHILD, ACL_DELETE_CHILD}, + {ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES, ACL_READ_ATTRIBUTES}, + {ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES, ACL_WRITE_ATTRIBUTES}, + {ARCHIVE_ENTRY_ACL_DELETE, ACL_DELETE}, + {ARCHIVE_ENTRY_ACL_READ_ACL, ACL_READ_ACL}, + {ARCHIVE_ENTRY_ACL_WRITE_ACL, ACL_WRITE_ACL}, + {ARCHIVE_ENTRY_ACL_WRITE_OWNER, ACL_WRITE_OWNER}, + {ARCHIVE_ENTRY_ACL_SYNCHRONIZE, ACL_SYNCHRONIZE} +}; + +static struct { + int archive_inherit; + int platform_inherit; +} acl_inherit_map[] = { + {ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT, ACL_ENTRY_FILE_INHERIT}, + {ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT, ACL_ENTRY_DIRECTORY_INHERIT}, + {ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT, ACL_ENTRY_NO_PROPAGATE_INHERIT}, + {ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY, ACL_ENTRY_INHERIT_ONLY} +}; + +static int +translate_acl(struct archive_read_disk *a, + struct archive_entry *entry, acl_t acl, int default_entry_acl_type) { acl_tag_t acl_tag; + acl_entry_type_t acl_type; + acl_flagset_t acl_flagset; acl_entry_t acl_entry; acl_permset_t acl_permset; + int brand, i, r, entry_acl_type; int s, ae_id, ae_tag, ae_perm; const char *ae_name; + + // FreeBSD "brands" ACLs as POSIX.1e or NFSv4 + // Make sure the "brand" on this ACL is consistent + // with the default_entry_acl_type bits provided. + acl_get_brand_np(acl, &brand); + switch (brand) { + case ACL_BRAND_POSIX: + switch (default_entry_acl_type) { + case ARCHIVE_ENTRY_ACL_TYPE_ACCESS: + case ARCHIVE_ENTRY_ACL_TYPE_DEFAULT: + break; + default: + // XXX set warning message? + return ARCHIVE_FAILED; + } + break; + case ACL_BRAND_NFS4: + if (default_entry_acl_type & ~ARCHIVE_ENTRY_ACL_TYPE_NFS4) { + // XXX set warning message? + return ARCHIVE_FAILED; + } + break; + default: + // XXX set warning message? + return ARCHIVE_FAILED; + break; + } + + s = acl_get_entry(acl, ACL_FIRST_ENTRY, &acl_entry); while (s == 1) { ae_id = -1; ae_name = NULL; + ae_perm = 0; acl_get_tag_type(acl_entry, &acl_tag); - if (acl_tag == ACL_USER) { + switch (acl_tag) { + case ACL_USER: ae_id = (int)*(uid_t *)acl_get_qualifier(acl_entry); ae_name = archive_read_disk_uname(&a->archive, ae_id); ae_tag = ARCHIVE_ENTRY_ACL_USER; - } else if (acl_tag == ACL_GROUP) { + break; + case ACL_GROUP: ae_id = (int)*(gid_t *)acl_get_qualifier(acl_entry); ae_name = archive_read_disk_gname(&a->archive, ae_id); ae_tag = ARCHIVE_ENTRY_ACL_GROUP; - } else if (acl_tag == ACL_MASK) { + break; + case ACL_MASK: ae_tag = ARCHIVE_ENTRY_ACL_MASK; - } else if (acl_tag == ACL_USER_OBJ) { + break; + case ACL_USER_OBJ: ae_tag = ARCHIVE_ENTRY_ACL_USER_OBJ; - } else if (acl_tag == ACL_GROUP_OBJ) { + break; + case ACL_GROUP_OBJ: ae_tag = ARCHIVE_ENTRY_ACL_GROUP_OBJ; - } else if (acl_tag == ACL_OTHER) { + break; + case ACL_OTHER: ae_tag = ARCHIVE_ENTRY_ACL_OTHER; - } else { + break; + case ACL_EVERYONE: + ae_tag = ARCHIVE_ENTRY_ACL_EVERYONE; + break; + default: /* Skip types that libarchive can't support. */ + s = acl_get_entry(acl, ACL_NEXT_ENTRY, &acl_entry); continue; } - acl_get_permset(acl_entry, &acl_permset); - ae_perm = 0; - /* - * acl_get_perm() is spelled differently on different - * platforms; see above. - */ - if (ACL_GET_PERM(acl_permset, ACL_EXECUTE)) - ae_perm |= ARCHIVE_ENTRY_ACL_EXECUTE; - if (ACL_GET_PERM(acl_permset, ACL_READ)) - ae_perm |= ARCHIVE_ENTRY_ACL_READ; - if (ACL_GET_PERM(acl_permset, ACL_WRITE)) - ae_perm |= ARCHIVE_ENTRY_ACL_WRITE; + // XXX acl type maps to allow/deny/audit/YYYY bits + // XXX acl_get_entry_type_np on FreeBSD returns EINVAL for + // non-NFSv4 ACLs + entry_acl_type = default_entry_acl_type; + r = acl_get_entry_type_np(acl_entry, &acl_type); + if (r == 0) { + switch (acl_type) { + case ACL_ENTRY_TYPE_ALLOW: + entry_acl_type = ARCHIVE_ENTRY_ACL_TYPE_ALLOW; + break; + case ACL_ENTRY_TYPE_DENY: + entry_acl_type = ARCHIVE_ENTRY_ACL_TYPE_DENY; + break; + case ACL_ENTRY_TYPE_AUDIT: + entry_acl_type = ARCHIVE_ENTRY_ACL_TYPE_AUDIT; + break; + case ACL_ENTRY_TYPE_ALARM: + entry_acl_type = ARCHIVE_ENTRY_ACL_TYPE_ALARM; + break; + } + } - archive_entry_acl_add_entry(entry, - archive_entry_acl_type, ae_perm, ae_tag, - ae_id, ae_name); + /* + * Libarchive stores "flag" (NFSv4 inheritance bits) + * in the ae_perm bitmap. + */ + acl_get_flagset_np(acl_entry, &acl_flagset); + for (i = 0; i < (int)(sizeof(acl_inherit_map) / sizeof(acl_inherit_map[0])); ++i) { + if (acl_get_flag_np(acl_flagset, + acl_inherit_map[i].platform_inherit)) + ae_perm |= acl_inherit_map[i].archive_inherit; + + } + + acl_get_permset(acl_entry, &acl_permset); + for (i = 0; i < (int)(sizeof(acl_perm_map) / sizeof(acl_perm_map[0])); ++i) { + /* + * acl_get_perm() is spelled differently on different + * platforms; see above. + */ + if (ACL_GET_PERM(acl_permset, acl_perm_map[i].platform_perm)) + ae_perm |= acl_perm_map[i].archive_perm; + } + + archive_entry_acl_add_entry(entry, entry_acl_type, + ae_perm, ae_tag, + ae_id, ae_name); s = acl_get_entry(acl, ACL_NEXT_ENTRY, &acl_entry); } + return (ARCHIVE_OK); } #else static int -setup_acls_posix1e(struct archive_read_disk *a, +setup_acls(struct archive_read_disk *a, struct archive_entry *entry, int *fd) { (void)a; /* UNUSED */ @@ -901,16 +1046,19 @@ setup_sparse(struct archive_read_disk *a, path = archive_entry_pathname(entry); if (a->tree != NULL) *fd = a->open_on_current_dir(a->tree, path, - O_RDONLY | O_NONBLOCK); + O_RDONLY | O_NONBLOCK | O_CLOEXEC); else - *fd = open(path, O_RDONLY | O_NONBLOCK); + *fd = open(path, O_RDONLY | O_NONBLOCK | O_CLOEXEC); if (*fd < 0) { archive_set_error(&a->archive, errno, "Can't open `%s'", path); return (ARCHIVE_FAILED); } + __archive_ensure_cloexec_flag(*fd); } + /* Initialize buffer to avoid the error valgrind complains about. */ + memset(buff, 0, sizeof(buff)); count = (sizeof(buff) - sizeof(*fm))/sizeof(*fe); fm = (struct fiemap *)buff; fm->fm_start = 0; @@ -1012,12 +1160,13 @@ setup_sparse(struct archive_read_disk *a, if (pathconf(path, _PC_MIN_HOLE_SIZE) <= 0) return (ARCHIVE_OK); - *fd = open(path, O_RDONLY | O_NONBLOCK); + *fd = open(path, O_RDONLY | O_NONBLOCK | O_CLOEXEC); if (*fd < 0) { archive_set_error(&a->archive, errno, "Can't open `%s'", path); return (ARCHIVE_FAILED); } + __archive_ensure_cloexec_flag(*fd); initial_off = 0; } diff --git a/libarchive/archive_read_disk_posix.c b/libarchive/archive_read_disk_posix.c index 698600e9b151..a13dbbf812cf 100644 --- a/libarchive/archive_read_disk_posix.c +++ b/libarchive/archive_read_disk_posix.c @@ -105,6 +105,9 @@ __FBSDID("$FreeBSD$"); #ifndef O_BINARY #define O_BINARY 0 #endif +#ifndef O_CLOEXEC +#define O_CLOEXEC 0 +#endif /*- * This is a new directory-walking system that addresses a number @@ -361,6 +364,7 @@ static int setup_sparse(struct archive_read_disk *, struct archive_entry *); static int close_and_restore_time(int fd, struct tree *, struct restore_time *); static int open_on_current_dir(struct tree *, const char *, int); +static int tree_dup(int); static struct archive_vtable * @@ -717,7 +721,7 @@ _archive_read_data_block(struct archive *_a, const void **buff, * Open the current file. */ if (t->entry_fd < 0) { - int flags = O_RDONLY | O_BINARY; + int flags = O_RDONLY | O_BINARY | O_CLOEXEC; /* * Eliminate or reduce cache effects if we can. @@ -740,6 +744,7 @@ _archive_read_data_block(struct archive *_a, const void **buff, #endif t->entry_fd = open_on_current_dir(t, tree_current_access_path(t), flags); + __archive_ensure_cloexec_flag(t->entry_fd); #if defined(O_NOATIME) /* * When we did open the file with O_NOATIME flag, @@ -984,10 +989,12 @@ next_entry(struct archive_read_disk *a, struct tree *t, #elif defined(EXT2_IOC_GETFLAGS) && defined(EXT2_NODUMP_FL) &&\ defined(HAVE_WORKING_EXT2_IOC_GETFLAGS) if (S_ISREG(st->st_mode) || S_ISDIR(st->st_mode)) { - unsigned long stflags; + int stflags; t->entry_fd = open_on_current_dir(t, - tree_current_access_path(t), O_RDONLY | O_NONBLOCK); + tree_current_access_path(t), + O_RDONLY | O_NONBLOCK | O_CLOEXEC); + __archive_ensure_cloexec_flag(t->entry_fd); if (t->entry_fd >= 0) { r = ioctl(t->entry_fd, EXT2_IOC_GETFLAGS, &stflags); @@ -1359,15 +1366,17 @@ update_current_filesystem(struct archive_read_disk *a, int64_t dev) fid = t->max_filesystem_id++; if (t->max_filesystem_id > t->allocated_filesytem) { size_t s; + void *p; s = t->max_filesystem_id * 2; - t->filesystem_table = realloc(t->filesystem_table, - s * sizeof(*t->filesystem_table)); - if (t->filesystem_table == NULL) { + p = realloc(t->filesystem_table, + s * sizeof(*t->filesystem_table)); + if (p == NULL) { archive_set_error(&a->archive, ENOMEM, "Can't allocate tar data"); return (ARCHIVE_FATAL); } + t->filesystem_table = (struct filesystem *)p; t->allocated_filesytem = s; } t->current_filesystem_id = fid; @@ -1482,7 +1491,8 @@ setup_current_filesystem(struct archive_read_disk *a) * where current is. */ int fd = openat(tree_current_dir_fd(t), - tree_current_access_path(t), O_RDONLY); + tree_current_access_path(t), O_RDONLY | O_CLOEXEC); + __archive_ensure_cloexec_flag(fd); if (fd < 0) { archive_set_error(&a->archive, errno, "openat failed"); @@ -1660,7 +1670,8 @@ setup_current_filesystem(struct archive_read_disk *a) * where current is. */ int fd = openat(tree_current_dir_fd(t), - tree_current_access_path(t), O_RDONLY); + tree_current_access_path(t), O_RDONLY | O_CLOEXEC); + __archive_ensure_cloexec_flag(fd); if (fd < 0) { archive_set_error(&a->archive, errno, "openat failed"); @@ -1768,7 +1779,8 @@ setup_current_filesystem(struct archive_read_disk *a) * where current is. */ int fd = openat(tree_current_dir_fd(t), - tree_current_access_path(t), O_RDONLY); + tree_current_access_path(t), O_RDONLY | O_CLOEXEC); + __archive_ensure_cloexec_flag(fd); if (fd < 0) { archive_set_error(&a->archive, errno, "openat failed"); @@ -1889,7 +1901,8 @@ static int close_and_restore_time(int fd, struct tree *t, struct restore_time *rt) { #ifndef HAVE_UTIMES - (void)a; /* UNUSED */ + (void)t; /* UNUSED */ + (void)rt; /* UNUSED */ return (close(fd)); #else #if defined(HAVE_FUTIMENS) && !defined(__CYGWIN__) @@ -1952,6 +1965,28 @@ open_on_current_dir(struct tree *t, const char *path, int flags) #endif } +static int +tree_dup(int fd) +{ + int new_fd; +#ifdef F_DUPFD_CLOEXEC + static volatile int can_dupfd_cloexec = 1; + + if (can_dupfd_cloexec) { + new_fd = fcntl(fd, F_DUPFD_CLOEXEC); + if (new_fd != -1) + return (new_fd); + /* Linux 2.6.18 - 2.6.23 declare F_DUPFD_CLOEXEC, + * but it cannot be used. So we have to try dup(). */ + /* We won't try F_DUPFD_CLOEXEC. */ + can_dupfd_cloexec = 0; + } +#endif /* F_DUPFD_CLOEXEC */ + new_fd = dup(fd); + __archive_ensure_cloexec_flag(new_fd); + return (new_fd); +} + /* * Add a directory path to the current stack. */ @@ -2052,8 +2087,9 @@ tree_reopen(struct tree *t, const char *path, int restore_time) tree_push(t, path, 0, 0, 0, NULL); t->stack->flags = needsFirstVisit; t->maxOpenCount = t->openCount = 1; - t->initial_dir_fd = open(".", O_RDONLY); - t->working_dir_fd = dup(t->initial_dir_fd); + t->initial_dir_fd = open(".", O_RDONLY | O_CLOEXEC); + __archive_ensure_cloexec_flag(t->initial_dir_fd); + t->working_dir_fd = tree_dup(t->initial_dir_fd); return (t); } @@ -2063,11 +2099,12 @@ tree_descent(struct tree *t) int flag, new_fd, r = 0; t->dirname_length = archive_strlen(&t->path); - flag = O_RDONLY; + flag = O_RDONLY | O_CLOEXEC; #if defined(O_DIRECTORY) flag |= O_DIRECTORY; #endif new_fd = open_on_current_dir(t, t->stack->name.s, flag); + __archive_ensure_cloexec_flag(new_fd); if (new_fd < 0) { t->tree_errno = errno; r = TREE_ERROR_DIR; @@ -2101,8 +2138,10 @@ tree_ascend(struct tree *t) prev_dir_fd = t->working_dir_fd; if (te->flags & isDirLink) new_fd = te->symlink_parent_fd; - else - new_fd = open_on_current_dir(t, "..", O_RDONLY); + else { + new_fd = open_on_current_dir(t, "..", O_RDONLY | O_CLOEXEC); + __archive_ensure_cloexec_flag(new_fd); + } if (new_fd < 0) { t->tree_errno = errno; r = TREE_ERROR_FATAL; @@ -2265,11 +2304,16 @@ tree_dir_next_posix(struct tree *t) #endif #if defined(HAVE_FDOPENDIR) - if ((t->d = fdopendir(dup(t->working_dir_fd))) == NULL) { -#else - if (tree_enter_working_dir(t) != 0 || - (t->d = opendir(".")) == NULL) { + t->d = fdopendir(tree_dup(t->working_dir_fd)); +#else /* HAVE_FDOPENDIR */ + if (tree_enter_working_dir(t) == 0) { + t->d = opendir("."); +#if HAVE_DIRFD || defined(dirfd) + __archive_ensure_cloexec_flag(dirfd(t->d)); #endif + } +#endif /* HAVE_FDOPENDIR */ + if (t->d == NULL) { r = tree_ascend(t); /* Undo "chdir" */ tree_pop(t); t->tree_errno = errno; @@ -2296,11 +2340,21 @@ tree_dir_next_posix(struct tree *t) #endif /* HAVE_READDIR_R */ } for (;;) { + errno = 0; #if defined(HAVE_READDIR_R) r = readdir_r(t->d, t->dirent, &t->de); +#ifdef _AIX + /* Note: According to the man page, return value 9 indicates + * that the readdir_r was not successful and the error code + * is set to the global errno variable. And then if the end + * of directory entries was reached, the return value is 9 + * and the third parameter is set to NULL and errno is + * unchanged. */ + if (r == 9) + r = errno; +#endif /* _AIX */ if (r != 0 || t->de == NULL) { #else - errno = 0; t->de = readdir(t->d); if (t->de == NULL) { r = errno; @@ -2391,7 +2445,7 @@ tree_current_is_dir(struct tree *t) return 1; /* Not a dir; might be a link to a dir. */ /* If it's not a link, then it's not a link to a dir. */ - if (!S_ISLNK(tree_current_lstat(t)->st_mode)) + if (!S_ISLNK(st->st_mode)) return 0; /* * It's a link, but we don't know what it's a link to, diff --git a/libarchive/archive_read_disk_windows.c b/libarchive/archive_read_disk_windows.c index 6b6108ab1b0c..9c5420d80e77 100644 --- a/libarchive/archive_read_disk_windows.c +++ b/libarchive/archive_read_disk_windows.c @@ -597,7 +597,7 @@ start_next_async_read(struct archive_read_disk *a, struct tree *t) } else ResetEvent(olp->ol.hEvent); - buffbytes = olp->buff_size; + buffbytes = (DWORD)olp->buff_size; if (buffbytes > t->current_sparse->length) buffbytes = (DWORD)t->current_sparse->length; @@ -669,7 +669,7 @@ _archive_read_data_block(struct archive *_a, const void **buff, struct tree *t = a->tree; struct la_overlapped *olp; DWORD bytes_transferred; - int r; + int r = ARCHIVE_FATAL; archive_check_magic(_a, ARCHIVE_READ_DISK_MAGIC, ARCHIVE_STATE_DATA, "archive_read_data_block"); @@ -698,7 +698,7 @@ _archive_read_data_block(struct archive *_a, const void **buff, olp = &(t->ol[t->ol_idx_done]); t->ol_idx_done = (t->ol_idx_done + 1) % MAX_OVERLAPPED; if (olp->bytes_transferred) - bytes_transferred = olp->bytes_transferred; + bytes_transferred = (DWORD)olp->bytes_transferred; else if (!GetOverlappedResult(t->entry_fh, &(olp->ol), &bytes_transferred, TRUE)) { la_dosmaperr(GetLastError()); @@ -1208,7 +1208,7 @@ _archive_read_disk_open_w(struct archive *_a, const wchar_t *pathname) a->tree = tree_open(pathname, a->symlink_mode, a->restore_time); if (a->tree == NULL) { archive_set_error(&a->archive, ENOMEM, - "Can't allocate direcotry traversal data"); + "Can't allocate directory traversal data"); a->archive.state = ARCHIVE_STATE_FATAL; return (ARCHIVE_FATAL); } @@ -1257,16 +1257,18 @@ update_current_filesystem(struct archive_read_disk *a, int64_t dev) fid = t->max_filesystem_id++; if (t->max_filesystem_id > t->allocated_filesytem) { size_t s; + void *p; s = t->max_filesystem_id * 2; - t->filesystem_table = realloc(t->filesystem_table, - s * sizeof(*t->filesystem_table)); - if (t->filesystem_table == NULL) { + p = realloc(t->filesystem_table, + s * sizeof(*t->filesystem_table)); + if (p == NULL) { archive_set_error(&a->archive, ENOMEM, "Can't allocate tar data"); return (ARCHIVE_FATAL); } - t->allocated_filesytem = s; + t->filesystem_table = (struct filesystem *)p; + t->allocated_filesytem = (int)s; } t->current_filesystem_id = fid; t->current_filesystem = &(t->filesystem_table[fid]); @@ -2040,7 +2042,7 @@ tree_free(struct tree *t) free(t->filesystem_table); for (i = 0; i < MAX_OVERLAPPED; i++) { if (t->ol[i].buff) - VirtualFree(t->ol[i].buff, t->ol[i].buff_size, MEM_DECOMMIT); + VirtualFree(t->ol[i].buff, 0, MEM_RELEASE); CloseHandle(t->ol[i].ol.hEvent); } free(t); @@ -2234,7 +2236,7 @@ setup_sparse_from_disk(struct archive_read_disk *a, ret = DeviceIoControl(handle, FSCTL_QUERY_ALLOCATED_RANGES, &range, sizeof(range), outranges, - outranges_size, &retbytes, NULL); + (DWORD)outranges_size, &retbytes, NULL); if (ret == 0 && GetLastError() == ERROR_MORE_DATA) { free(outranges); outranges_size *= 2; diff --git a/libarchive/archive_read_extract.c b/libarchive/archive_read_extract.c index aad8ac5168df..795f2abea847 100644 --- a/libarchive/archive_read_extract.c +++ b/libarchive/archive_read_extract.c @@ -154,7 +154,7 @@ copy_data(struct archive *ar, struct archive *aw) return (ARCHIVE_OK); if (r != ARCHIVE_OK) return (r); - r = archive_write_data_block(aw, buff, size, offset); + r = (int)archive_write_data_block(aw, buff, size, offset); if (r < ARCHIVE_WARN) r = ARCHIVE_WARN; if (r != ARCHIVE_OK) { diff --git a/libarchive/archive_read_open_fd.c b/libarchive/archive_read_open_fd.c index 7972841976b6..e0f95bf41b65 100644 --- a/libarchive/archive_read_open_fd.c +++ b/libarchive/archive_read_open_fd.c @@ -119,7 +119,8 @@ file_read(struct archive *a, void *client_data, const void **buff) if (bytes_read < 0) { if (errno == EINTR) continue; - archive_set_error(a, errno, "Error reading fd %d", mine->fd); + archive_set_error(a, errno, "Error reading fd %d", + mine->fd); } return (bytes_read); } diff --git a/libarchive/archive_read_open_file.c b/libarchive/archive_read_open_file.c index b1aac0a7cbf0..3a33c258ee70 100644 --- a/libarchive/archive_read_open_file.c +++ b/libarchive/archive_read_open_file.c @@ -108,11 +108,11 @@ static ssize_t file_read(struct archive *a, void *client_data, const void **buff) { struct read_FILE_data *mine = (struct read_FILE_data *)client_data; - ssize_t bytes_read; + size_t bytes_read; *buff = mine->buffer; bytes_read = fread(mine->buffer, 1, mine->block_size, mine->f); - if (bytes_read < 0) { + if (bytes_read < mine->block_size && ferror(mine->f)) { archive_set_error(a, errno, "Error reading file"); } return (bytes_read); diff --git a/libarchive/archive_read_open_filename.c b/libarchive/archive_read_open_filename.c index 69c44ea7e676..fefcd904d2c4 100644 --- a/libarchive/archive_read_open_filename.c +++ b/libarchive/archive_read_open_filename.c @@ -60,11 +60,15 @@ __FBSDID("$FreeBSD: head/lib/libarchive/archive_read_open_filename.c 201093 2009 #endif #include "archive.h" +#include "archive_private.h" #include "archive_string.h" #ifndef O_BINARY #define O_BINARY 0 #endif +#ifndef O_CLOEXEC +#define O_CLOEXEC 0 +#endif struct read_file_data { int fd; @@ -79,9 +83,10 @@ struct read_file_data { } filename; /* Must be last! */ }; +static int file_open(struct archive *, void *); static int file_close(struct archive *, void *); -static int file_open_filename(struct archive *, enum fnt_e, const void *, - size_t); +static int file_close2(struct archive *, void *); +static int file_switch(struct archive *, void *, void *); static ssize_t file_read(struct archive *, void *, const void **buff); static int64_t file_seek(struct archive *, void *, int64_t request, int); static int64_t file_skip(struct archive *, void *, int64_t request); @@ -98,26 +103,76 @@ int archive_read_open_filename(struct archive *a, const char *filename, size_t block_size) { - enum fnt_e filename_type; + const char *filenames[2] = { filename, NULL }; + return archive_read_open_filenames(a, filenames, block_size); +} - if (filename == NULL || filename[0] == '\0') { - filename_type = FNT_STDIN; - } else - filename_type = FNT_MBS; - return (file_open_filename(a, filename_type, filename, block_size)); +int +archive_read_open_filenames(struct archive *a, const char **filenames, + size_t block_size) +{ + struct read_file_data *mine; + const char *filename = NULL; + if (filenames) + filename = *(filenames++); + + archive_clear_error(a); + do + { + if (filename == NULL) + filename = ""; + mine = (struct read_file_data *)calloc(1, + sizeof(*mine) + strlen(filename)); + if (mine == NULL) + goto no_memory; + strcpy(mine->filename.m, filename); + mine->block_size = block_size; + mine->fd = -1; + mine->buffer = NULL; + mine->st_mode = mine->use_lseek = 0; + if (filename == NULL || filename[0] == '\0') { + mine->filename_type = FNT_STDIN; + } else + mine->filename_type = FNT_MBS; + if (archive_read_append_callback_data(a, mine) != (ARCHIVE_OK)) + return (ARCHIVE_FATAL); + if (filenames == NULL) + break; + filename = *(filenames++); + } while (filename != NULL && filename[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); + archive_read_set_close_callback(a, file_close); + archive_read_set_switch_callback(a, file_switch); + 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) { - enum fnt_e filename_type; + struct read_file_data *mine = (struct read_file_data *)calloc(1, + sizeof(*mine) + wcslen(wfilename) * sizeof(wchar_t)); + if (!mine) + { + archive_set_error(a, ENOMEM, "No memory"); + return (ARCHIVE_FATAL); + } + mine->fd = -1; + mine->block_size = block_size; if (wfilename == NULL || wfilename[0] == L'\0') { - filename_type = FNT_STDIN; + mine->filename_type = FNT_STDIN; } else { #if defined(_WIN32) && !defined(__CYGWIN__) - filename_type = FNT_WCS; + mine->filename_type = FNT_WCS; + wcscpy(mine->filename.w, wfilename); #else /* * POSIX system does not support a wchar_t interface for @@ -125,7 +180,6 @@ archive_read_open_filename_w(struct archive *a, const wchar_t *wfilename, * filename to multi-byte one and use it. */ struct archive_string fn; - int r; archive_string_init(&fn); if (archive_string_append_from_wcs(&fn, wfilename, @@ -138,22 +192,31 @@ archive_read_open_filename_w(struct archive *a, const wchar_t *wfilename, "Failed to convert a wide-character" " filename to a multi-byte filename"); archive_string_free(&fn); + free(mine); return (ARCHIVE_FATAL); } - r = file_open_filename(a, FNT_MBS, fn.s, block_size); + mine->filename_type = FNT_MBS; + strcpy(mine->filename.m, fn.s); archive_string_free(&fn); - return (r); #endif } - return (file_open_filename(a, filename_type, wfilename, block_size)); + if (archive_read_append_callback_data(a, mine) != (ARCHIVE_OK)) + return (ARCHIVE_FATAL); + archive_read_set_open_callback(a, file_open); + archive_read_set_read_callback(a, file_read); + archive_read_set_skip_callback(a, file_skip); + archive_read_set_close_callback(a, file_close); + archive_read_set_switch_callback(a, file_switch); + archive_read_set_seek_callback(a, file_seek); + + return (archive_read_open1(a)); } static int -file_open_filename(struct archive *a, enum fnt_e filename_type, - const void *_filename, size_t block_size) +file_open(struct archive *a, void *client_data) { struct stat st; - struct read_file_data *mine; + struct read_file_data *mine = (struct read_file_data *)client_data; void *buffer; const char *filename = NULL; const wchar_t *wfilename = NULL; @@ -168,7 +231,7 @@ file_open_filename(struct archive *a, enum fnt_e filename_type, #endif archive_clear_error(a); - if (filename_type == FNT_STDIN) { + if (mine->filename_type == FNT_STDIN) { /* We used to delegate stdin support by * directly calling archive_read_open_fd(a,0,block_size) * here, but that doesn't (and shouldn't) handle the @@ -183,9 +246,10 @@ file_open_filename(struct archive *a, enum fnt_e filename_type, setmode(0, O_BINARY); #endif filename = ""; - } else if (filename_type == FNT_MBS) { - filename = (const char *)_filename; - fd = open(filename, O_RDONLY | O_BINARY); + } else if (mine->filename_type == FNT_MBS) { + filename = mine->filename.m; + fd = open(filename, O_RDONLY | O_BINARY | O_CLOEXEC); + __archive_ensure_cloexec_flag(fd); if (fd < 0) { archive_set_error(a, errno, "Failed to open '%s'", filename); @@ -193,7 +257,7 @@ file_open_filename(struct archive *a, enum fnt_e filename_type, } } else { #if defined(_WIN32) && !defined(__CYGWIN__) - wfilename = (const wchar_t *)_filename; + wfilename = mine->filename.w; fd = _wopen(wfilename, O_RDONLY | O_BINARY); if (fd < 0 && errno == ENOENT) { wchar_t *fullpath; @@ -215,7 +279,7 @@ file_open_filename(struct archive *a, enum fnt_e filename_type, #endif } if (fstat(fd, &st) != 0) { - if (filename_type == FNT_WCS) + if (mine->filename_type == FNT_WCS) archive_set_error(a, errno, "Can't stat '%S'", wfilename); else @@ -280,50 +344,32 @@ file_open_filename(struct archive *a, enum fnt_e filename_type, #endif /* TODO: Add an "is_tape_like" variable and appropriate tests. */ - if (filename_type == FNT_WCS) - mine = (struct read_file_data *)calloc(1, - sizeof(*mine) + wcslen(wfilename) * sizeof(wchar_t)); - else - mine = (struct read_file_data *)calloc(1, - sizeof(*mine) + strlen(filename)); /* Disk-like devices prefer power-of-two block sizes. */ /* Use provided block_size as a guide so users have some control. */ if (is_disk_like) { size_t new_block_size = 64 * 1024; - while (new_block_size < block_size + while (new_block_size < mine->block_size && new_block_size < 64 * 1024 * 1024) new_block_size *= 2; - block_size = new_block_size; + mine->block_size = new_block_size; } - buffer = malloc(block_size); + buffer = malloc(mine->block_size); if (mine == NULL || buffer == NULL) { archive_set_error(a, ENOMEM, "No memory"); free(mine); free(buffer); return (ARCHIVE_FATAL); } - if (filename_type == FNT_WCS) - wcscpy(mine->filename.w, wfilename); - else - strcpy(mine->filename.m, filename); - mine->filename_type = filename_type; - mine->block_size = block_size; mine->buffer = buffer; mine->fd = fd; /* Remember mode so close can decide whether to flush. */ mine->st_mode = st.st_mode; /* Disk-like inputs can use lseek(). */ - if (is_disk_like) { - archive_read_set_seek_callback(a, file_seek); + if (is_disk_like) mine->use_lseek = 1; - } - archive_read_set_read_callback(a, file_read); - archive_read_set_skip_callback(a, file_skip); - archive_read_set_close_callback(a, file_close); - archive_read_set_callback_data(a, mine); - return (archive_read_open1(a)); + return (ARCHIVE_OK); } static ssize_t @@ -401,9 +447,7 @@ file_skip_lseek(struct archive *a, void *client_data, int64_t request) /* TODO: Deal with case where off_t isn't 64 bits. * This shouldn't be a problem on Linux or other POSIX * systems, since the configuration logic for libarchive - * tries to obtain a 64-bit off_t. It's still an issue - * on Windows, though, so it might suffice to just use - * _lseeki64() on Windows. + * tries to obtain a 64-bit off_t. */ if ((old_offset = lseek(mine->fd, 0, SEEK_CUR)) >= 0 && (new_offset = lseek(mine->fd, request, SEEK_CUR)) >= 0) @@ -475,7 +519,7 @@ file_seek(struct archive *a, void *client_data, int64_t request, int whence) } static int -file_close(struct archive *a, void *client_data) +file_close2(struct archive *a, void *client_data) { struct read_file_data *mine = (struct read_file_data *)client_data; @@ -508,6 +552,23 @@ file_close(struct archive *a, void *client_data) close(mine->fd); } free(mine->buffer); + mine->buffer = NULL; + mine->fd = -1; + return (ARCHIVE_OK); +} + +static int +file_close(struct archive *a, void *client_data) +{ + struct read_file_data *mine = (struct read_file_data *)client_data; + file_close2(a, client_data); free(mine); return (ARCHIVE_OK); } + +static int +file_switch(struct archive *a, void *client_data1, void *client_data2) +{ + file_close2(a, client_data1); + return file_open(a, client_data2); +} diff --git a/libarchive/archive_read_private.h b/libarchive/archive_read_private.h index 445c557f39c2..8a6c859a8a14 100644 --- a/libarchive/archive_read_private.h +++ b/libarchive/archive_read_private.h @@ -58,6 +58,8 @@ struct archive_read_filter; struct archive_read_filter_bidder { /* Configuration data for the bidder. */ void *data; + /* Name of the filter */ + const char *name; /* Taste the upstream filter to see if we handle this. */ int (*bid)(struct archive_read_filter_bidder *, struct archive_read_filter *); @@ -82,6 +84,8 @@ struct archive_read_filter { struct archive_read_filter_bidder *bidder; /* My bidder. */ struct archive_read_filter *upstream; /* Who I read from. */ struct archive_read *archive; /* Associated archive. */ + /* Open a block for reading */ + int (*open)(struct archive_read_filter *self); /* Return next block. */ ssize_t (*read)(struct archive_read_filter *, const void **); /* Skip forward this many bytes. */ @@ -90,6 +94,8 @@ struct archive_read_filter { int64_t (*seek)(struct archive_read_filter *self, int64_t offset, int whence); /* Close (just this filter) and free(self). */ int (*close)(struct archive_read_filter *self); + /* Function that handles switching from reading one block to the next/prev */ + int (*sswitch)(struct archive_read_filter *self, unsigned int iindex); /* My private data. */ void *data; @@ -118,13 +124,22 @@ struct archive_read_filter { * transformation filters. This will probably break the API/ABI and * so should be deferred at least until libarchive 3.0. */ +struct archive_read_data_node { + int64_t begin_position; + int64_t total_size; + void *data; +}; struct archive_read_client { archive_open_callback *opener; archive_read_callback *reader; archive_skip_callback *skipper; archive_seek_callback *seeker; archive_close_callback *closer; - void *data; + archive_switch_callback *switcher; + unsigned int nodes; + unsigned int cursor; + int64_t position; + struct archive_read_data_node *dataset; }; struct archive_read { @@ -146,18 +161,33 @@ struct archive_read { int64_t read_data_output_offset; size_t read_data_remaining; - /* Callbacks to open/read/write/close client archive stream. */ + /* + * Used by formats/filters to determine the amount of data + * requested from a call to archive_read_data(). This is only + * useful when the format/filter has seek support. + */ + char read_data_is_posix_read; + size_t read_data_requested; + + /* Callbacks to open/read/write/close client archive streams. */ struct archive_read_client client; /* Registered filter bidders. */ - struct archive_read_filter_bidder bidders[9]; + struct archive_read_filter_bidder bidders[14]; /* Last filter in chain */ struct archive_read_filter *filter; + /* Whether to bypass filter bidding process */ + int bypass_filter_bidding; + /* File offset of beginning of most recently-read header. */ int64_t header_position; + /* Nodes and offsets of compressed data block */ + unsigned int data_start_node; + unsigned int data_end_node; + /* * Format detection is mostly the same as compression * detection, with one significant difference: The bidders @@ -175,6 +205,7 @@ struct archive_read { int (*read_header)(struct archive_read *, struct archive_entry *); int (*read_data)(struct archive_read *, const void **, size_t *, int64_t *); int (*read_data_skip)(struct archive_read *); + int64_t (*seek_data)(struct archive_read *, int64_t, int); int (*cleanup)(struct archive_read *); } formats[16]; struct archive_format_descriptor *format; /* Active format. */ @@ -194,6 +225,7 @@ int __archive_read_register_format(struct archive_read *a, int (*read_header)(struct archive_read *, struct archive_entry *), int (*read_data)(struct archive_read *, const void **, size_t *, int64_t *), int (*read_data_skip)(struct archive_read *), + int64_t (*seek_data)(struct archive_read *, int64_t, int), int (*cleanup)(struct archive_read *)); int __archive_read_get_bidder(struct archive_read *a, @@ -207,4 +239,6 @@ int64_t __archive_read_filter_seek(struct archive_read_filter *, int64_t, int); int64_t __archive_read_consume(struct archive_read *, int64_t); int64_t __archive_read_filter_consume(struct archive_read_filter *, int64_t); int __archive_read_program(struct archive_read_filter *, const char *); +void __archive_read_free_filters(struct archive_read *); +int __archive_read_close_filters(struct archive_read *); #endif diff --git a/libarchive/archive_read_set_format.c b/libarchive/archive_read_set_format.c new file mode 100644 index 000000000000..190f4369d248 --- /dev/null +++ b/libarchive/archive_read_set_format.c @@ -0,0 +1,105 @@ +/*- + * Copyright (c) 2003-2012 Tim Kientzle + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "archive_platform.h" +__FBSDID("$FreeBSD$"); + +#ifdef HAVE_ERRNO_H +#include +#endif + +#include "archive.h" +#include "archive_private.h" +#include "archive_read_private.h" + +int +archive_read_set_format(struct archive *_a, int code) +{ + int r1, r2, slots, i; + char str[10]; + struct archive_read *a = (struct archive_read *)_a; + + if ((r1 = archive_read_support_format_by_code(_a, code)) < (ARCHIVE_OK)) + return r1; + + r1 = r2 = (ARCHIVE_OK); + if (a->format) + r2 = (ARCHIVE_WARN); + switch (code & ARCHIVE_FORMAT_BASE_MASK) + { + case ARCHIVE_FORMAT_7ZIP: + strcpy(str, "7zip"); + break; + case ARCHIVE_FORMAT_AR: + strcpy(str, "ar"); + break; + case ARCHIVE_FORMAT_CAB: + strcpy(str, "cab"); + break; + case ARCHIVE_FORMAT_CPIO: + strcpy(str, "cpio"); + break; + case ARCHIVE_FORMAT_ISO9660: + strcpy(str, "iso9660"); + break; + case ARCHIVE_FORMAT_LHA: + strcpy(str, "lha"); + break; + case ARCHIVE_FORMAT_MTREE: + strcpy(str, "mtree"); + break; + case ARCHIVE_FORMAT_RAR: + strcpy(str, "rar"); + break; + case ARCHIVE_FORMAT_TAR: + strcpy(str, "tar"); + break; + case ARCHIVE_FORMAT_XAR: + strcpy(str, "xar"); + break; + case ARCHIVE_FORMAT_ZIP: + strcpy(str, "zip"); + break; + default: + archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER, + "Invalid format code specified"); + return (ARCHIVE_FATAL); + } + + slots = sizeof(a->formats) / sizeof(a->formats[0]); + a->format = &(a->formats[0]); + for (i = 0; i < slots; i++, a->format++) { + if (!a->format->name || !strcmp(a->format->name, str)) + break; + } + if (!a->format->name || strcmp(a->format->name, str)) + { + archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER, + "Internal error: Unable to set format"); + r1 = (ARCHIVE_FATAL); + } + + return (r1 < r2) ? r1 : r2; +} diff --git a/libarchive/archive_read_support_filter_all.c b/libarchive/archive_read_support_filter_all.c index 733d86298434..b778cfb79215 100644 --- a/libarchive/archive_read_support_filter_all.c +++ b/libarchive/archive_read_support_filter_all.c @@ -48,7 +48,7 @@ archive_read_support_filter_all(struct archive *a) archive_read_support_filter_bzip2(a); /* The decompress code doesn't use an outside library. */ archive_read_support_filter_compress(a); - /* Gzip decompress falls back to "gunzip" command-line. */ + /* Gzip decompress falls back to "gzip -d" command-line. */ archive_read_support_filter_gzip(a); /* Lzip falls back to "unlzip" command-line program. */ archive_read_support_filter_lzip(a); @@ -63,6 +63,12 @@ archive_read_support_filter_all(struct archive *a) archive_read_support_filter_uu(a); /* The decode code doesn't use an outside library. */ archive_read_support_filter_rpm(a); + /* The decode code always uses "lrzip -q -d" command-line. */ + archive_read_support_filter_lrzip(a); + /* Lzop decompress falls back to "lzop -d" command-line. */ + archive_read_support_filter_lzop(a); + /* The decode code always uses "grzip -d" command-line. */ + archive_read_support_filter_grzip(a); /* Note: We always return ARCHIVE_OK here, even if some of the * above return ARCHIVE_WARN. The intent here is to enable diff --git a/libarchive/archive_read_support_filter_bzip2.c b/libarchive/archive_read_support_filter_bzip2.c index 8d5bd1c4aca6..3885a7cf6153 100644 --- a/libarchive/archive_read_support_filter_bzip2.c +++ b/libarchive/archive_read_support_filter_bzip2.c @@ -94,6 +94,7 @@ archive_read_support_filter_bzip2(struct archive *_a) return (ARCHIVE_FATAL); reader->data = NULL; + reader->name = "bzip2"; reader->bid = bzip2_reader_bid; reader->init = bzip2_reader_init; reader->options = NULL; @@ -102,7 +103,7 @@ archive_read_support_filter_bzip2(struct archive *_a) return (ARCHIVE_OK); #else archive_set_error(_a, ARCHIVE_ERRNO_MISC, - "Using external bunzip2 program"); + "Using external bzip2 program"); return (ARCHIVE_WARN); #endif } @@ -170,11 +171,11 @@ bzip2_reader_init(struct archive_read_filter *self) { int r; - r = __archive_read_program(self, "bunzip2"); + r = __archive_read_program(self, "bzip2 -d"); /* Note: We set the format here even if __archive_read_program() * above fails. We do, after all, know what the format is * even if we weren't able to read it. */ - self->code = ARCHIVE_COMPRESSION_BZIP2; + self->code = ARCHIVE_FILTER_BZIP2; self->name = "bzip2"; return (r); } @@ -192,7 +193,7 @@ bzip2_reader_init(struct archive_read_filter *self) void *out_block; struct private_data *state; - self->code = ARCHIVE_COMPRESSION_BZIP2; + self->code = ARCHIVE_FILTER_BZIP2; self->name = "bzip2"; state = (struct private_data *)calloc(sizeof(*state), 1); diff --git a/libarchive/archive_read_support_filter_compress.c b/libarchive/archive_read_support_filter_compress.c index 1b8530004fbb..3f5d1f37eab3 100644 --- a/libarchive/archive_read_support_filter_compress.c +++ b/libarchive/archive_read_support_filter_compress.c @@ -163,6 +163,7 @@ archive_read_support_filter_compress(struct archive *_a) return (ARCHIVE_FATAL); bidder->data = NULL; + bidder->name = "compress (.Z)"; bidder->bid = compress_bidder_bid; bidder->init = compress_bidder_init; bidder->options = NULL; @@ -212,7 +213,7 @@ compress_bidder_init(struct archive_read_filter *self) void *out_block; int code; - self->code = ARCHIVE_COMPRESSION_COMPRESS; + self->code = ARCHIVE_FILTER_COMPRESS; self->name = "compress (.Z)"; state = (struct private_data *)calloc(sizeof(*state), 1); diff --git a/libarchive/archive_read_support_filter_grzip.c b/libarchive/archive_read_support_filter_grzip.c new file mode 100644 index 000000000000..84c86aeb4386 --- /dev/null +++ b/libarchive/archive_read_support_filter_grzip.c @@ -0,0 +1,121 @@ +/*- + * Copyright (c) 2012 Michihiro NAKAJIMA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "archive_platform.h" + +__FBSDID("$FreeBSD$"); + + +#ifdef HAVE_ERRNO_H +#include +#endif +#ifdef HAVE_STDLIB_H +#include +#endif +#ifdef HAVE_STRING_H +#include +#endif +#ifdef HAVE_UNISTD_H +#include +#endif + +#include "archive.h" +#include "archive_private.h" +#include "archive_read_private.h" + +static const unsigned char grzip_magic[] = { + 0x47, 0x52, 0x5a, 0x69, 0x70, 0x49, 0x49, 0x00, + 0x02, 0x04, 0x3a, 0x29 }; + +static int grzip_bidder_bid(struct archive_read_filter_bidder *, + struct archive_read_filter *); +static int grzip_bidder_init(struct archive_read_filter *); + + +static int +grzip_reader_free(struct archive_read_filter_bidder *self) +{ + (void)self; /* UNUSED */ + return (ARCHIVE_OK); +} + +int +archive_read_support_filter_grzip(struct archive *_a) +{ + struct archive_read *a = (struct archive_read *)_a; + struct archive_read_filter_bidder *reader; + + archive_check_magic(_a, ARCHIVE_READ_MAGIC, + ARCHIVE_STATE_NEW, "archive_read_support_filter_grzip"); + + if (__archive_read_get_bidder(a, &reader) != ARCHIVE_OK) + return (ARCHIVE_FATAL); + + reader->data = NULL; + reader->bid = grzip_bidder_bid; + reader->init = grzip_bidder_init; + reader->options = NULL; + reader->free = grzip_reader_free; + /* This filter always uses an external program. */ + archive_set_error(_a, ARCHIVE_ERRNO_MISC, + "Using external grzip program for grzip decompression"); + return (ARCHIVE_WARN); +} + +/* + * Bidder just verifies the header and returns the number of verified bits. + */ +static int +grzip_bidder_bid(struct archive_read_filter_bidder *self, + struct archive_read_filter *filter) +{ + const unsigned char *p; + ssize_t avail; + + (void)self; /* UNUSED */ + + p = __archive_read_filter_ahead(filter, sizeof(grzip_magic), &avail); + if (p == NULL || avail == 0) + return (0); + + if (memcmp(p, grzip_magic, sizeof(grzip_magic))) + return (0); + + return (sizeof(grzip_magic) * 8); +} + +static int +grzip_bidder_init(struct archive_read_filter *self) +{ + int r; + + r = __archive_read_program(self, "grzip -d"); + /* Note: We set the format here even if __archive_read_program() + * above fails. We do, after all, know what the format is + * even if we weren't able to read it. */ + self->code = ARCHIVE_FILTER_GRZIP; + self->name = "grzip"; + return (r); +} diff --git a/libarchive/archive_read_support_filter_gzip.c b/libarchive/archive_read_support_filter_gzip.c index f6d5595f0b6b..fa8c675de124 100644 --- a/libarchive/archive_read_support_filter_gzip.c +++ b/libarchive/archive_read_support_filter_gzip.c @@ -72,7 +72,7 @@ static int gzip_filter_close(struct archive_read_filter *); * * TODO: If zlib is unavailable, gzip_bidder_init() should * use the compress_program framework to try to fire up an external - * gunzip program. + * gzip program. */ static int gzip_bidder_bid(struct archive_read_filter_bidder *, struct archive_read_filter *); @@ -100,6 +100,7 @@ archive_read_support_filter_gzip(struct archive *_a) return (ARCHIVE_FATAL); bidder->data = NULL; + bidder->name = "gzip"; bidder->bid = gzip_bidder_bid; bidder->init = gzip_bidder_init; bidder->options = NULL; @@ -109,7 +110,7 @@ archive_read_support_filter_gzip(struct archive *_a) return (ARCHIVE_OK); #else archive_set_error(_a, ARCHIVE_ERRNO_MISC, - "Using external gunzip program"); + "Using external gzip program"); return (ARCHIVE_WARN); #endif } @@ -121,7 +122,7 @@ archive_read_support_filter_gzip(struct archive *_a) * number of bytes in header. If pbits is non-NULL, it receives a * count of bits verified, suitable for use by bidder. */ -static int +static ssize_t peek_at_header(struct archive_read_filter *filter, int *pbits) { const unsigned char *p; @@ -223,7 +224,7 @@ gzip_bidder_bid(struct archive_read_filter_bidder *self, /* * If we don't have the library on this system, we can't do the - * decompression directly. We can, however, try to run gunzip + * decompression directly. We can, however, try to run "gzip -d" * in case that's available. */ static int @@ -231,11 +232,11 @@ gzip_bidder_init(struct archive_read_filter *self) { int r; - r = __archive_read_program(self, "gunzip"); + r = __archive_read_program(self, "gzip -d"); /* Note: We set the format here even if __archive_read_program() * above fails. We do, after all, know what the format is * even if we weren't able to read it. */ - self->code = ARCHIVE_COMPRESSION_GZIP; + self->code = ARCHIVE_FILTER_GZIP; self->name = "gzip"; return (r); } @@ -252,7 +253,7 @@ gzip_bidder_init(struct archive_read_filter *self) static const size_t out_block_size = 64 * 1024; void *out_block; - self->code = ARCHIVE_COMPRESSION_GZIP; + self->code = ARCHIVE_FILTER_GZIP; self->name = "gzip"; state = (struct private_data *)calloc(sizeof(*state), 1); @@ -299,7 +300,7 @@ consume_header(struct archive_read_filter *self) /* Initialize compression library. */ state->stream.next_in = (unsigned char *)(uintptr_t) __archive_read_filter_ahead(self->upstream, 1, &avail); - state->stream.avail_in = avail; + state->stream.avail_in = (uInt)avail; ret = inflateInit2(&(state->stream), -15 /* Don't check for zlib header */); @@ -380,7 +381,7 @@ gzip_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 = (uInt)state->out_block_size; /* Try to fill the output buffer. */ while (state->stream.avail_out > 0 && !state->eof) { @@ -407,7 +408,7 @@ gzip_filter_read(struct archive_read_filter *self, const void **p) "truncated gzip input"); return (ARCHIVE_FATAL); } - state->stream.avail_in = avail_in; + state->stream.avail_in = (uInt)avail_in; /* Decompress and consume some of that data. */ ret = inflate(&(state->stream), 0); diff --git a/libarchive/archive_read_support_filter_lrzip.c b/libarchive/archive_read_support_filter_lrzip.c new file mode 100644 index 000000000000..c82a8e2f13ea --- /dev/null +++ b/libarchive/archive_read_support_filter_lrzip.c @@ -0,0 +1,132 @@ +/*- + * Copyright (c) 2003-2007 Tim Kientzle + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "archive_platform.h" + +__FBSDID("$FreeBSD$"); + + +#ifdef HAVE_ERRNO_H +#include +#endif +#ifdef HAVE_STDLIB_H +#include +#endif +#ifdef HAVE_STRING_H +#include +#endif +#ifdef HAVE_UNISTD_H +#include +#endif + +#include "archive.h" +#include "archive_private.h" +#include "archive_read_private.h" + +#define LRZIP_HEADER_MAGIC "LRZI" +#define LRZIP_HEADER_MAGIC_LEN 4 + +static int lrzip_bidder_bid(struct archive_read_filter_bidder *, + struct archive_read_filter *); +static int lrzip_bidder_init(struct archive_read_filter *); + + +static int +lrzip_reader_free(struct archive_read_filter_bidder *self) +{ + (void)self; /* UNUSED */ + return (ARCHIVE_OK); +} + +int +archive_read_support_filter_lrzip(struct archive *_a) +{ + struct archive_read *a = (struct archive_read *)_a; + struct archive_read_filter_bidder *reader; + + archive_check_magic(_a, ARCHIVE_READ_MAGIC, + ARCHIVE_STATE_NEW, "archive_read_support_filter_lrzip"); + + if (__archive_read_get_bidder(a, &reader) != ARCHIVE_OK) + return (ARCHIVE_FATAL); + + reader->data = NULL; + reader->name = "lrzip"; + reader->bid = lrzip_bidder_bid; + reader->init = lrzip_bidder_init; + reader->options = NULL; + reader->free = lrzip_reader_free; + /* This filter always uses an external program. */ + archive_set_error(_a, ARCHIVE_ERRNO_MISC, + "Using external lrzip program for lrzip decompression"); + return (ARCHIVE_WARN); +} + +/* + * Bidder just verifies the header and returns the number of verified bits. + */ +static int +lrzip_bidder_bid(struct archive_read_filter_bidder *self, + struct archive_read_filter *filter) +{ + const unsigned char *p; + ssize_t avail, len; + int i; + + (void)self; /* UNUSED */ + /* Start by looking at the first six bytes of the header, which + * is all fixed layout. */ + len = 6; + p = __archive_read_filter_ahead(filter, len, &avail); + if (p == NULL || avail == 0) + return (0); + + if (memcmp(p, LRZIP_HEADER_MAGIC, LRZIP_HEADER_MAGIC_LEN)) + return (0); + + /* current major version is always 0, verify this */ + if (p[LRZIP_HEADER_MAGIC_LEN]) + return 0; + /* support only v0.6+ lrzip for sanity */ + i = p[LRZIP_HEADER_MAGIC_LEN + 1]; + if ((i < 6) || (i > 10)) + return 0; + + return (int)len; +} + +static int +lrzip_bidder_init(struct archive_read_filter *self) +{ + int r; + + r = __archive_read_program(self, "lrzip -d -q"); + /* Note: We set the format here even if __archive_read_program() + * above fails. We do, after all, know what the format is + * even if we weren't able to read it. */ + self->code = ARCHIVE_FILTER_LRZIP; + self->name = "lrzip"; + return (r); +} diff --git a/libarchive/archive_read_support_filter_lzop.c b/libarchive/archive_read_support_filter_lzop.c new file mode 100644 index 000000000000..713af31e99f0 --- /dev/null +++ b/libarchive/archive_read_support_filter_lzop.c @@ -0,0 +1,486 @@ +/*- + * Copyright (c) 2003-2007 Tim Kientzle + * Copyright (c) 2012 Michihiro NAKAJIMA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "archive_platform.h" + +__FBSDID("$FreeBSD$"); + +#ifdef HAVE_UNISTD_H +#include +#endif +#ifdef HAVE_ERRNO_H +#include +#endif +#ifdef HAVE_STDLIB_H +#include +#endif +#ifdef HAVE_STRING_H +#include +#endif +#ifdef HAVE_UNISTD_H +#include +#endif +#ifdef HAVE_LZO_LZOCONF_H +#include +#endif +#ifdef HAVE_LZO_LZO1X_H +#include +#endif +#ifdef HAVE_ZLIB_H +#include /* for crc32 and adler32 */ +#endif + +#include "archive.h" +#if !defined(HAVE_ZLIB_H) &&\ + defined(HAVE_LZO_LZOCONF_H) && defined(HAVE_LZO_LZO1X_H) +#include "archive_crc32.h" +#endif +#include "archive_endian.h" +#include "archive_private.h" +#include "archive_read_private.h" + +#ifndef HAVE_ZLIB_H +#define adler32 lzo_adler32 +#endif + +#define LZOP_HEADER_MAGIC "\x89\x4c\x5a\x4f\x00\x0d\x0a\x1a\x0a" +#define LZOP_HEADER_MAGIC_LEN 9 + +#if defined(HAVE_LZO_LZOCONF_H) && defined(HAVE_LZO_LZO1X_H) +struct read_lzop { + unsigned char *out_block; + size_t out_block_size; + int64_t total_out; + int flags; + uint32_t compressed_cksum; + uint32_t uncompressed_cksum; + size_t compressed_size; + size_t uncompressed_size; + size_t unconsumed_bytes; + char in_stream; + char eof; /* True = found end of compressed data. */ +}; + +#define FILTER 0x0800 +#define CRC32_HEADER 0x1000 +#define EXTRA_FIELD 0x0040 +#define ADLER32_UNCOMPRESSED 0x0001 +#define ADLER32_COMPRESSED 0x0002 +#define CRC32_UNCOMPRESSED 0x0100 +#define CRC32_COMPRESSED 0x0200 +#define MAX_BLOCK_SIZE (64 * 1024 * 1024) + +static ssize_t lzop_filter_read(struct archive_read_filter *, const void **); +static int lzop_filter_close(struct archive_read_filter *); +#endif + +static int lzop_bidder_bid(struct archive_read_filter_bidder *, + struct archive_read_filter *); +static int lzop_bidder_init(struct archive_read_filter *); + +int +archive_read_support_filter_lzop(struct archive *_a) +{ + struct archive_read *a = (struct archive_read *)_a; + struct archive_read_filter_bidder *reader; + + archive_check_magic(_a, ARCHIVE_READ_MAGIC, + ARCHIVE_STATE_NEW, "archive_read_support_filter_lzop"); + + if (__archive_read_get_bidder(a, &reader) != ARCHIVE_OK) + return (ARCHIVE_FATAL); + + reader->data = NULL; + reader->bid = lzop_bidder_bid; + reader->init = lzop_bidder_init; + reader->options = NULL; + reader->free = NULL; + /* Signal the extent of lzop support with the return value here. */ +#if defined(HAVE_LZO_LZOCONF_H) && defined(HAVE_LZO_LZO1X_H) + return (ARCHIVE_OK); +#else + /* Return ARCHIVE_WARN since this always uses an external program. */ + archive_set_error(_a, ARCHIVE_ERRNO_MISC, + "Using external lzop program for lzop decompression"); + return (ARCHIVE_WARN); +#endif +} + +/* + * Bidder just verifies the header and returns the number of verified bits. + */ +static int +lzop_bidder_bid(struct archive_read_filter_bidder *self, + struct archive_read_filter *filter) +{ + const unsigned char *p; + ssize_t avail; + + (void)self; /* UNUSED */ + + p = __archive_read_filter_ahead(filter, LZOP_HEADER_MAGIC_LEN, &avail); + if (p == NULL || avail == 0) + return (0); + + if (memcmp(p, LZOP_HEADER_MAGIC, LZOP_HEADER_MAGIC_LEN)) + return (0); + + return (LZOP_HEADER_MAGIC_LEN * 8); +} + +#if !defined(HAVE_LZO_LZOCONF_H) || !defined(HAVE_LZO_LZO1X_H) +/* + * If we don't have the library on this system, we can't do the + * decompression directly. We can, however, try to run "lzop -d" + * in case that's available. + */ +static int +lzop_bidder_init(struct archive_read_filter *self) +{ + int r; + + r = __archive_read_program(self, "lzop -d"); + /* Note: We set the format here even if __archive_read_program() + * above fails. We do, after all, know what the format is + * even if we weren't able to read it. */ + self->code = ARCHIVE_FILTER_LZOP; + self->name = "lzop"; + return (r); +} +#else +/* + * Initialize the filter object. + */ +static int +lzop_bidder_init(struct archive_read_filter *self) +{ + struct read_lzop *state; + + self->code = ARCHIVE_FILTER_LZOP; + self->name = "lzop"; + + state = (struct read_lzop *)calloc(sizeof(*state), 1); + if (state == NULL) { + archive_set_error(&self->archive->archive, ENOMEM, + "Can't allocate data for lzop decompression"); + return (ARCHIVE_FATAL); + } + + self->data = state; + self->read = lzop_filter_read; + self->skip = NULL; /* not supported */ + self->close = lzop_filter_close; + + return (ARCHIVE_OK); +} + +static int +consume_header(struct archive_read_filter *self) +{ + struct read_lzop *state = (struct read_lzop *)self->data; + const unsigned char *p, *_p; + unsigned checksum, flags, len, method, version; + + /* + * Check LZOP magic code. + */ + p = __archive_read_filter_ahead(self->upstream, + LZOP_HEADER_MAGIC_LEN, NULL); + if (p == NULL) + return (ARCHIVE_EOF); + + if (memcmp(p, LZOP_HEADER_MAGIC, LZOP_HEADER_MAGIC_LEN)) + return (ARCHIVE_EOF); + __archive_read_filter_consume(self->upstream, + LZOP_HEADER_MAGIC_LEN); + + p = __archive_read_filter_ahead(self->upstream, 29, NULL); + if (p == NULL) + goto truncated; + _p = p; + version = archive_be16dec(p); + p += 4;/* version(2 bytes) + library version(2 bytes) */ + + if (version >= 0x940) { + unsigned reqversion = archive_be16dec(p); p += 2; + if (reqversion < 0x900) { + archive_set_error(&self->archive->archive, + ARCHIVE_ERRNO_MISC, "Invalid required version"); + return (ARCHIVE_FAILED); + } + } + + method = *p++; + if (method < 1 || method > 3) { + archive_set_error(&self->archive->archive, ARCHIVE_ERRNO_MISC, + "Unsupported method"); + return (ARCHIVE_FAILED); + } + + if (version >= 0x940) { + unsigned level = *p++; + if (method == 1 && level == 0) level = 3; + if (method == 2 && level == 0) level = 1; + if (method == 3 && level == 0) level = 9; + if (level < 1 && level > 9) { + archive_set_error(&self->archive->archive, + ARCHIVE_ERRNO_MISC, "Invalid level"); + return (ARCHIVE_FAILED); + } + } + + flags = archive_be32dec(p); p += 4; + + if (flags & FILTER) + p += 4; /* Skip filter */ + p += 4; /* Skip mode */ + if (version >= 0x940) + p += 8; /* Skip mtime */ + else + p += 4; /* Skip mtime */ + len = *p++; /* Read filename length */ + len += p - _p; + /* Make sure we have all bytes we need to calculate checksum. */ + p = __archive_read_filter_ahead(self->upstream, len + 4, NULL); + if (p == NULL) + goto truncated; + if (flags & CRC32_HEADER) + checksum = crc32(crc32(0, NULL, 0), p, len); + else + checksum = adler32(adler32(0, NULL, 0), p, len); + if (archive_be32dec(p + len) != checksum) + goto corrupted; + __archive_read_filter_consume(self->upstream, len + 4); + if (flags & EXTRA_FIELD) { + /* Skip extra field */ + p = __archive_read_filter_ahead(self->upstream, 4, NULL); + if (p == NULL) + goto truncated; + len = archive_be32dec(p); + __archive_read_filter_consume(self->upstream, len + 4 + 4); + } + state->flags = flags; + state->in_stream = 1; + return (ARCHIVE_OK); +truncated: + archive_set_error(&self->archive->archive, + ARCHIVE_ERRNO_FILE_FORMAT, "Truncated lzop data"); + return (ARCHIVE_FAILED); +corrupted: + archive_set_error(&self->archive->archive, + ARCHIVE_ERRNO_FILE_FORMAT, "Corrupted lzop header"); + return (ARCHIVE_FAILED); +} + +static int +consume_block_info(struct archive_read_filter *self) +{ + struct read_lzop *state = (struct read_lzop *)self->data; + const unsigned char *p; + unsigned flags = state->flags; + + p = __archive_read_filter_ahead(self->upstream, 4, NULL); + if (p == NULL) + goto truncated; + state->uncompressed_size = archive_be32dec(p); + __archive_read_filter_consume(self->upstream, 4); + if (state->uncompressed_size == 0) + return (ARCHIVE_EOF); + if (state->uncompressed_size > MAX_BLOCK_SIZE) + goto corrupted; + + p = __archive_read_filter_ahead(self->upstream, 4, NULL); + if (p == NULL) + goto truncated; + state->compressed_size = archive_be32dec(p); + __archive_read_filter_consume(self->upstream, 4); + if (state->compressed_size > state->uncompressed_size) + goto corrupted; + + if (flags & (CRC32_UNCOMPRESSED | ADLER32_UNCOMPRESSED)) { + p = __archive_read_filter_ahead(self->upstream, 4, NULL); + if (p == NULL) + goto truncated; + state->compressed_cksum = state->uncompressed_cksum = + archive_be32dec(p); + __archive_read_filter_consume(self->upstream, 4); + } + if ((flags & (CRC32_COMPRESSED | ADLER32_COMPRESSED)) && + state->compressed_size < state->uncompressed_size) { + p = __archive_read_filter_ahead(self->upstream, 4, NULL); + if (p == NULL) + goto truncated; + state->compressed_cksum = archive_be32dec(p); + __archive_read_filter_consume(self->upstream, 4); + } + return (ARCHIVE_OK); +truncated: + archive_set_error(&self->archive->archive, + ARCHIVE_ERRNO_FILE_FORMAT, "Truncated lzop data"); + return (ARCHIVE_FAILED); +corrupted: + archive_set_error(&self->archive->archive, + ARCHIVE_ERRNO_FILE_FORMAT, "Corrupted lzop header"); + return (ARCHIVE_FAILED); +} + +static ssize_t +lzop_filter_read(struct archive_read_filter *self, const void **p) +{ + struct read_lzop *state = (struct read_lzop *)self->data; + const void *b; + lzo_uint out_size; + uint32_t cksum; + int ret, r; + + if (state->unconsumed_bytes) { + __archive_read_filter_consume(self->upstream, + state->unconsumed_bytes); + state->unconsumed_bytes = 0; + } + if (state->eof) + return (0); + + for (;;) { + if (!state->in_stream) { + ret = consume_header(self); + if (ret < ARCHIVE_OK) + return (ret); + if (ret == ARCHIVE_EOF) { + state->eof = 1; + return (0); + } + } + ret = consume_block_info(self); + if (ret < ARCHIVE_OK) + return (ret); + if (ret == ARCHIVE_EOF) + state->in_stream = 0; + else + break; + } + + if (state->out_block == NULL || + state->out_block_size < state->uncompressed_size) { + void *new_block; + + new_block = realloc(state->out_block, state->uncompressed_size); + if (new_block == NULL) { + archive_set_error(&self->archive->archive, ENOMEM, + "Can't allocate data for lzop decompression"); + return (ARCHIVE_FATAL); + } + state->out_block = new_block; + state->out_block_size = state->uncompressed_size; + } + + b = __archive_read_filter_ahead(self->upstream, + state->compressed_size, NULL); + if (b == NULL) { + archive_set_error(&self->archive->archive, + ARCHIVE_ERRNO_FILE_FORMAT, "Truncated lzop data"); + return (ARCHIVE_FATAL); + } + if (state->flags & CRC32_COMPRESSED) + cksum = crc32(crc32(0, NULL, 0), b, state->compressed_size); + else if (state->flags & ADLER32_COMPRESSED) + cksum = adler32(adler32(0, NULL, 0), b, state->compressed_size); + else + cksum = state->compressed_cksum; + if (cksum != state->compressed_cksum) { + archive_set_error(&self->archive->archive, + ARCHIVE_ERRNO_MISC, "Corrupted data"); + return (ARCHIVE_FATAL); + } + + /* + * If the both uncompressed size and compressed size are the same, + * we do not decompress this block. + */ + if (state->uncompressed_size == state->compressed_size) { + *p = b; + state->total_out += state->compressed_size; + state->unconsumed_bytes = state->compressed_size; + return ((ssize_t)state->uncompressed_size); + } + + /* + * Drive lzo uncompresison. + */ + out_size = (lzo_uint)state->uncompressed_size; + r = lzo1x_decompress_safe(b, (lzo_uint)state->compressed_size, + state->out_block, &out_size, NULL); + switch (r) { + case LZO_E_OK: + if (out_size == state->uncompressed_size) + break; + archive_set_error(&self->archive->archive, + ARCHIVE_ERRNO_MISC, "Corrupted data"); + return (ARCHIVE_FATAL); + case LZO_E_OUT_OF_MEMORY: + archive_set_error(&self->archive->archive, ENOMEM, + "lzop decompression failed: out of memory"); + return (ARCHIVE_FATAL); + default: + archive_set_error(&self->archive->archive, ARCHIVE_ERRNO_MISC, + "lzop decompression failed: %d", r); + return (ARCHIVE_FATAL); + } + + if (state->flags & CRC32_UNCOMPRESSED) + cksum = crc32(crc32(0, NULL, 0), state->out_block, + state->uncompressed_size); + else if (state->flags & ADLER32_UNCOMPRESSED) + cksum = adler32(adler32(0, NULL, 0), state->out_block, + state->uncompressed_size); + else + cksum = state->uncompressed_cksum; + if (cksum != state->uncompressed_cksum) { + archive_set_error(&self->archive->archive, + ARCHIVE_ERRNO_MISC, "Corrupted data"); + return (ARCHIVE_FATAL); + } + + __archive_read_filter_consume(self->upstream, state->compressed_size); + *p = state->out_block; + state->total_out += out_size; + return ((ssize_t)out_size); +} + +/* + * Clean up the decompressor. + */ +static int +lzop_filter_close(struct archive_read_filter *self) +{ + struct read_lzop *state = (struct read_lzop *)self->data; + + free(state->out_block); + free(state); + return (ARCHIVE_OK); +} + +#endif diff --git a/libarchive/archive_read_support_filter_program.c b/libarchive/archive_read_support_filter_program.c index b05eb03424d7..66dc2f424f85 100644 --- a/libarchive/archive_read_support_filter_program.c +++ b/libarchive/archive_read_support_filter_program.c @@ -1,5 +1,6 @@ /*- * Copyright (c) 2007 Joerg Sonnenberger + * Copyright (c) 2012 Michihiro NAKAJIMA * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -53,7 +54,9 @@ __FBSDID("$FreeBSD$"); #include "archive.h" #include "archive_private.h" +#include "archive_string.h" #include "archive_read_private.h" +#include "filter_fork.h" #if ARCHIVE_VERSION_NUMBER < 4000000 @@ -79,50 +82,13 @@ archive_read_support_filter_program(struct archive *a, const char *cmd) return (archive_read_support_filter_program_signature(a, cmd, NULL, 0)); } - -/* This capability is only available on POSIX systems. */ -#if (!defined(HAVE_PIPE) || !defined(HAVE_FCNTL) || \ - !(defined(HAVE_FORK) || defined(HAVE_VFORK))) && (!defined(_WIN32) || defined(__CYGWIN__)) - -/* - * On non-Posix systems, allow the program to build, but choke if - * this function is actually invoked. - */ -int -archive_read_support_filter_program_signature(struct archive *_a, - const char *cmd, const void *signature, size_t signature_len) -{ - (void)_a; /* UNUSED */ - (void)cmd; /* UNUSED */ - (void)signature; /* UNUSED */ - (void)signature_len; /* UNUSED */ - - archive_set_error(_a, -1, - "External compression programs not supported on this platform"); - return (ARCHIVE_FATAL); -} - -int -__archive_read_program(struct archive_read_filter *self, const char *cmd) -{ - (void)self; /* UNUSED */ - (void)cmd; /* UNUSED */ - - archive_set_error(&self->archive->archive, -1, - "External compression programs not supported on this platform"); - return (ARCHIVE_FATAL); -} - -#else - -#include "filter_fork.h" - /* * The bidder object stores the command and the signature to watch for. * The 'inhibit' entry here is used to ensure that unchecked filters never * bid twice in the same pipeline. */ struct program_bidder { + char *description; char *cmd; void *signature; size_t signature_len; @@ -138,8 +104,12 @@ static int program_bidder_free(struct archive_read_filter_bidder *); * The actual filter needs to track input and output data. */ struct program_filter { - char *description; + struct archive_string description; +#if defined(_WIN32) && !defined(__CYGWIN__) + HANDLE child; +#else pid_t child; +#endif int exit_status; int waitpid_return; int child_stdin, child_stdout; @@ -151,6 +121,29 @@ struct program_filter { static ssize_t program_filter_read(struct archive_read_filter *, const void **); static int program_filter_close(struct archive_read_filter *); +static void free_state(struct program_bidder *); + +static int +set_bidder_signature(struct archive_read_filter_bidder *bidder, + struct program_bidder *state, const void *signature, size_t signature_len) +{ + + if (signature != NULL && signature_len > 0) { + state->signature_len = signature_len; + state->signature = malloc(signature_len); + memcpy(state->signature, signature, signature_len); + } + + /* + * Fill in the bidder object. + */ + bidder->data = state; + bidder->bid = program_bidder_bid; + bidder->init = program_bidder_init; + bidder->options = NULL; + bidder->free = program_bidder_free; + return (ARCHIVE_OK); +} int archive_read_support_filter_program_signature(struct archive *_a, @@ -169,37 +162,40 @@ archive_read_support_filter_program_signature(struct archive *_a, /* * Allocate our private state. */ - state = (struct program_bidder *)calloc(sizeof (*state), 1); + state = (struct program_bidder *)calloc(1, sizeof (*state)); if (state == NULL) - return (ARCHIVE_FATAL); + goto memerr; state->cmd = strdup(cmd); - if (signature != NULL && signature_len > 0) { - state->signature_len = signature_len; - state->signature = malloc(signature_len); - memcpy(state->signature, signature, signature_len); - } + if (state->cmd == NULL) + goto memerr; - /* - * Fill in the bidder object. - */ - bidder->data = state; - bidder->bid = program_bidder_bid; - bidder->init = program_bidder_init; - bidder->options = NULL; - bidder->free = program_bidder_free; - return (ARCHIVE_OK); + return set_bidder_signature(bidder, state, signature, signature_len); +memerr: + free_state(state); + archive_set_error(_a, ENOMEM, "Can't allocate memory"); + return (ARCHIVE_FATAL); } static int program_bidder_free(struct archive_read_filter_bidder *self) { struct program_bidder *state = (struct program_bidder *)self->data; - free(state->cmd); - free(state->signature); - free(self->data); + + free_state(state); return (ARCHIVE_OK); } +static void +free_state(struct program_bidder *state) +{ + + if (state) { + free(state->cmd); + free(state->signature); + free(state); + } +} + /* * If we do have a signature, bid only if that matches. * @@ -258,6 +254,9 @@ child_stop(struct archive_read_filter *self, struct program_filter *state) state->waitpid_return = waitpid(state->child, &state->exit_status, 0); } while (state->waitpid_return == -1 && errno == EINTR); +#if defined(_WIN32) && !defined(__CYGWIN__) + CloseHandle(state->child); +#endif state->child = 0; } @@ -310,11 +309,35 @@ child_read(struct archive_read_filter *self, char *buf, size_t buf_len) struct program_filter *state = self->data; ssize_t ret, requested, avail; const char *p; +#if defined(_WIN32) && !defined(__CYGWIN__) + HANDLE handle = (HANDLE)_get_osfhandle(state->child_stdout); +#endif requested = buf_len > SSIZE_MAX ? SSIZE_MAX : buf_len; for (;;) { do { +#if defined(_WIN32) && !defined(__CYGWIN__) + /* Avoid infinity wait. + * Note: If there is no data in the pipe, ReadFile() + * called in read() never returns and so we won't + * write remaining encoded data to the pipe. + * Note: This way may cause performance problem. + * we are looking forward to great code to resolve + * this. */ + DWORD pipe_avail = -1; + int cnt = 2; + + while (PeekNamedPipe(handle, NULL, 0, NULL, + &pipe_avail, NULL) != 0 && pipe_avail == 0 && + cnt--) + Sleep(5); + if (pipe_avail == 0) { + ret = -1; + errno = EAGAIN; + break; + } +#endif ret = read(state->child_stdout, buf, requested); } while (ret == -1 && errno == EINTR); @@ -376,38 +399,57 @@ __archive_read_program(struct archive_read_filter *self, const char *cmd) struct program_filter *state; static const size_t out_buf_len = 65536; char *out_buf; - char *description; const char *prefix = "Program: "; + pid_t child; + size_t l; + l = strlen(prefix) + strlen(cmd) + 1; state = (struct program_filter *)calloc(1, sizeof(*state)); out_buf = (char *)malloc(out_buf_len); - description = (char *)malloc(strlen(prefix) + strlen(cmd) + 1); - if (state == NULL || out_buf == NULL || description == NULL) { + if (state == NULL || out_buf == NULL || + archive_string_ensure(&state->description, l) == NULL) { archive_set_error(&self->archive->archive, ENOMEM, "Can't allocate input data"); - free(state); + if (state != NULL) { + archive_string_free(&state->description); + free(state); + } free(out_buf); - free(description); return (ARCHIVE_FATAL); } + archive_strcpy(&state->description, prefix); + archive_strcat(&state->description, cmd); - self->code = ARCHIVE_COMPRESSION_PROGRAM; - state->description = description; - strcpy(state->description, prefix); - strcat(state->description, cmd); - self->name = state->description; + self->code = ARCHIVE_FILTER_PROGRAM; + self->name = state->description.s; state->out_buf = out_buf; state->out_buf_len = out_buf_len; - if ((state->child = __archive_create_child(cmd, - &state->child_stdin, &state->child_stdout)) == -1) { + child = __archive_create_child(cmd, &state->child_stdin, + &state->child_stdout); + if (child == -1) { free(state->out_buf); free(state); archive_set_error(&self->archive->archive, EINVAL, - "Can't initialize filter; unable to run program \"%s\"", cmd); + "Can't initialize filter; unable to run program \"%s\"", + cmd); return (ARCHIVE_FATAL); } +#if defined(_WIN32) && !defined(__CYGWIN__) + state->child = OpenProcess(PROCESS_QUERY_INFORMATION, FALSE, child); + if (state->child == NULL) { + child_stop(self, state); + free(state->out_buf); + free(state); + archive_set_error(&self->archive->archive, EINVAL, + "Can't initialize filter; unable to run program \"%s\"", + cmd); + return (ARCHIVE_FATAL); + } +#else + state->child = child; +#endif self->data = state; self->read = program_filter_read; @@ -467,10 +509,8 @@ program_filter_close(struct archive_read_filter *self) /* Release our private data. */ free(state->out_buf); - free(state->description); + archive_string_free(&state->description); free(state); return (e); } - -#endif /* !defined(HAVE_PIPE) || !defined(HAVE_VFORK) || !defined(HAVE_FCNTL) */ diff --git a/libarchive/archive_read_support_filter_rpm.c b/libarchive/archive_read_support_filter_rpm.c index 1b3e124204f1..e7e58e51f3b0 100644 --- a/libarchive/archive_read_support_filter_rpm.c +++ b/libarchive/archive_read_support_filter_rpm.c @@ -85,6 +85,7 @@ archive_read_support_filter_rpm(struct archive *_a) return (ARCHIVE_FATAL); bidder->data = NULL; + bidder->name = "rpm"; bidder->bid = rpm_bidder_bid; bidder->init = rpm_bidder_init; bidder->options = NULL; @@ -137,7 +138,7 @@ rpm_bidder_init(struct archive_read_filter *self) { struct rpm *rpm; - self->code = ARCHIVE_COMPRESSION_RPM; + self->code = ARCHIVE_FILTER_RPM; self->name = "rpm"; self->read = rpm_filter_read; self->skip = NULL; /* not supported */ diff --git a/libarchive/archive_read_support_filter_uu.c b/libarchive/archive_read_support_filter_uu.c index a75ef756081b..471771b6f469 100644 --- a/libarchive/archive_read_support_filter_uu.c +++ b/libarchive/archive_read_support_filter_uu.c @@ -56,6 +56,7 @@ struct uudecode { #define ST_READ_UU 1 #define ST_UUEND 2 #define ST_READ_BASE64 3 +#define ST_IGNORE 4 }; static int uudecode_bidder_bid(struct archive_read_filter_bidder *, @@ -88,6 +89,7 @@ archive_read_support_filter_uu(struct archive *_a) return (ARCHIVE_FATAL); bidder->data = NULL; + bidder->name = "uu"; bidder->bid = uudecode_bidder_bid; bidder->init = uudecode_bidder_init; bidder->options = NULL; @@ -377,7 +379,7 @@ uudecode_bidder_init(struct archive_read_filter *self) void *out_buff; void *in_buff; - self->code = ARCHIVE_COMPRESSION_UU; + self->code = ARCHIVE_FILTER_UU; self->name = "uu"; self->read = uudecode_filter_read; self->skip = NULL; /* not supported */ @@ -470,6 +472,10 @@ uudecode_filter_read(struct archive_read_filter *self, const void **buff) total = 0; out = uudecode->out_buff; ravail = avail_in; + if (uudecode->state == ST_IGNORE) { + used = avail_in; + goto finish; + } if (uudecode->in_cnt) { /* * If there is remaining data which is saved by @@ -485,12 +491,18 @@ uudecode_filter_read(struct archive_read_filter *self, const void **buff) uudecode->in_cnt = 0; } for (;used < avail_in; d += llen, used += llen) { - int l, body; + int64_t l, body; b = d; len = get_line(b, avail_in - used, &nl); if (len < 0) { /* Non-ascii character is found. */ + if (uudecode->state == ST_FIND_HEAD && + (uudecode->total > 0 || total > 0)) { + uudecode->state = ST_IGNORE; + used = avail_in; + goto finish; + } archive_set_error(&self->archive->archive, ARCHIVE_ERRNO_MISC, "Insufficient compressed data"); @@ -507,7 +519,7 @@ uudecode_filter_read(struct archive_read_filter *self, const void **buff) return (ARCHIVE_FATAL); if (uudecode->in_buff != b) memmove(uudecode->in_buff, b, len); - uudecode->in_cnt = len; + uudecode->in_cnt = (int)len; if (total == 0) { /* Do not return 0; it means end-of-file. * We should try to read bytes more. */ @@ -545,7 +557,7 @@ uudecode_filter_read(struct archive_read_filter *self, const void **buff) break; case ST_READ_UU: if (total + len * 2 > OUT_BUFF_SIZE) - break; + goto finish; body = len - nl; if (!uuchar[*b] || body <= 0) { archive_set_error(&self->archive->archive, @@ -611,7 +623,7 @@ uudecode_filter_read(struct archive_read_filter *self, const void **buff) break; case ST_READ_BASE64: if (total + len * 2 > OUT_BUFF_SIZE) - break; + goto finish; l = len - nl; if (l >= 3 && b[0] == '=' && b[1] == '=' && b[2] == '=') { @@ -657,8 +669,10 @@ uudecode_filter_read(struct archive_read_filter *self, const void **buff) break; } } - - __archive_read_filter_consume(self->upstream, ravail); +finish: + if (ravail < avail_in) + used -= avail_in - ravail; + __archive_read_filter_consume(self->upstream, used); *buff = uudecode->out_buff; uudecode->total += total; diff --git a/libarchive/archive_read_support_filter_xz.c b/libarchive/archive_read_support_filter_xz.c index cf762a46d984..15824b1d0974 100644 --- a/libarchive/archive_read_support_filter_xz.c +++ b/libarchive/archive_read_support_filter_xz.c @@ -136,6 +136,7 @@ archive_read_support_filter_xz(struct archive *_a) return (ARCHIVE_FATAL); bidder->data = NULL; + bidder->name = "xz"; bidder->bid = xz_bidder_bid; bidder->init = xz_bidder_init; bidder->options = NULL; @@ -144,7 +145,7 @@ archive_read_support_filter_xz(struct archive *_a) return (ARCHIVE_OK); #else archive_set_error(_a, ARCHIVE_ERRNO_MISC, - "Using external unxz program for xz decompression"); + "Using external xz program for xz decompression"); return (ARCHIVE_WARN); #endif } @@ -170,6 +171,7 @@ archive_read_support_filter_lzma(struct archive *_a) return (ARCHIVE_FATAL); bidder->data = NULL; + bidder->name = "lzma"; bidder->bid = lzma_bidder_bid; bidder->init = lzma_bidder_init; bidder->options = NULL; @@ -180,7 +182,7 @@ archive_read_support_filter_lzma(struct archive *_a) return (ARCHIVE_OK); #else archive_set_error(_a, ARCHIVE_ERRNO_MISC, - "Using external unlzma program for lzma decompression"); + "Using external lzma program for lzma decompression"); return (ARCHIVE_WARN); #endif } @@ -207,6 +209,7 @@ archive_read_support_filter_lzip(struct archive *_a) return (ARCHIVE_FATAL); bidder->data = NULL; + bidder->name = "lzip"; bidder->bid = lzip_bidder_bid; bidder->init = lzip_bidder_init; bidder->options = NULL; @@ -415,7 +418,7 @@ lzip_bidder_bid(struct archive_read_filter_bidder *self, static int xz_bidder_init(struct archive_read_filter *self) { - self->code = ARCHIVE_COMPRESSION_XZ; + self->code = ARCHIVE_FILTER_XZ; self->name = "xz"; return (xz_lzma_bidder_init(self)); } @@ -423,7 +426,7 @@ xz_bidder_init(struct archive_read_filter *self) static int lzma_bidder_init(struct archive_read_filter *self) { - self->code = ARCHIVE_COMPRESSION_LZMA; + self->code = ARCHIVE_FILTER_LZMA; self->name = "lzma"; return (xz_lzma_bidder_init(self)); } @@ -431,7 +434,7 @@ lzma_bidder_init(struct archive_read_filter *self) static int lzip_bidder_init(struct archive_read_filter *self) { - self->code = ARCHIVE_COMPRESSION_LZIP; + self->code = ARCHIVE_FILTER_LZIP; self->name = "lzip"; return (xz_lzma_bidder_init(self)); } @@ -518,7 +521,7 @@ xz_lzma_bidder_init(struct archive_read_filter *self) state->stream.avail_out = state->out_block_size; state->crc32 = 0; - if (self->code == ARCHIVE_COMPRESSION_LZIP) { + if (self->code == ARCHIVE_FILTER_LZIP) { /* * We have to read a lzip header and use it to initialize * compression library, thus we cannot initialize the @@ -530,7 +533,7 @@ xz_lzma_bidder_init(struct archive_read_filter *self) state->in_stream = 1; /* Initialize compression library. */ - if (self->code == ARCHIVE_COMPRESSION_XZ) + if (self->code == ARCHIVE_FILTER_XZ) ret = lzma_stream_decoder(&(state->stream), LZMA_MEMLIMIT,/* memlimit */ LZMA_CONCATENATED); @@ -730,7 +733,7 @@ xz_filter_read(struct archive_read_filter *self, const void **p) *p = NULL; else { *p = state->out_block; - if (self->code == ARCHIVE_COMPRESSION_LZIP) { + if (self->code == ARCHIVE_FILTER_LZIP) { state->crc32 = lzma_crc32(state->out_block, decompressed, state->crc32); if (state->eof) { @@ -778,7 +781,7 @@ lzma_bidder_init(struct archive_read_filter *self) struct private_data *state; ssize_t ret, avail_in; - self->code = ARCHIVE_COMPRESSION_LZMA; + self->code = ARCHIVE_FILTER_LZMA; self->name = "lzma"; state = (struct private_data *)calloc(sizeof(*state), 1); @@ -941,11 +944,11 @@ lzma_bidder_init(struct archive_read_filter *self) { int r; - r = __archive_read_program(self, "unlzma"); + r = __archive_read_program(self, "lzma -d -qq"); /* Note: We set the format here even if __archive_read_program() * above fails. We do, after all, know what the format is * even if we weren't able to read it. */ - self->code = ARCHIVE_COMPRESSION_LZMA; + self->code = ARCHIVE_FILTER_LZMA; self->name = "lzma"; return (r); } @@ -958,11 +961,11 @@ xz_bidder_init(struct archive_read_filter *self) { int r; - r = __archive_read_program(self, "unxz"); + r = __archive_read_program(self, "xz -d -qq"); /* Note: We set the format here even if __archive_read_program() * above fails. We do, after all, know what the format is * even if we weren't able to read it. */ - self->code = ARCHIVE_COMPRESSION_XZ; + self->code = ARCHIVE_FILTER_XZ; self->name = "xz"; return (r); } @@ -972,11 +975,11 @@ lzip_bidder_init(struct archive_read_filter *self) { int r; - r = __archive_read_program(self, "unlzip"); + r = __archive_read_program(self, "lzip -d -q"); /* Note: We set the format here even if __archive_read_program() * above fails. We do, after all, know what the format is * even if we weren't able to read it. */ - self->code = ARCHIVE_COMPRESSION_LZIP; + self->code = ARCHIVE_FILTER_LZIP; self->name = "lzip"; return (r); } diff --git a/libarchive/archive_read_support_format_7zip.c b/libarchive/archive_read_support_format_7zip.c index 39a46ed579b9..194b8d51c96a 100644 --- a/libarchive/archive_read_support_format_7zip.c +++ b/libarchive/archive_read_support_format_7zip.c @@ -409,6 +409,7 @@ archive_read_support_format_7zip(struct archive *_a) archive_read_format_7zip_read_header, archive_read_format_7zip_read_data, archive_read_format_7zip_read_data_skip, + NULL, archive_read_format_7zip_cleanup); if (r != ARCHIVE_OK) @@ -684,8 +685,8 @@ archive_read_format_7zip_read_header(struct archive_read *a, symname[symsize] = '\0'; archive_entry_copy_symlink(entry, (const char *)symname); - free(symname); } + free(symname); archive_entry_set_size(entry, 0); } @@ -709,16 +710,15 @@ archive_read_format_7zip_read_data(struct archive_read *a, if (zip->pack_stream_bytes_unconsumed) read_consume(a); + *offset = zip->entry_offset; + *size = 0; + *buff = NULL; /* * If we hit end-of-entry last time, clean up and return * ARCHIVE_EOF this time. */ - if (zip->end_of_entry) { - *offset = zip->entry_offset; - *size = 0; - *buff = NULL; + if (zip->end_of_entry) return (ARCHIVE_EOF); - } bytes = read_stream(a, buff, (size_t)zip->entry_bytes_remaining, 0); @@ -736,7 +736,8 @@ archive_read_format_7zip_read_data(struct archive_read *a, /* Update checksum */ if ((zip->entry->flg & CRC32_IS_SET) && bytes) - zip->entry_crc32 = crc32(zip->entry_crc32, *buff, bytes); + zip->entry_crc32 = crc32(zip->entry_crc32, *buff, + (unsigned)bytes); /* If we hit the end, swallow any end-of-data marker. */ if (zip->end_of_entry) { @@ -1363,9 +1364,9 @@ decompress(struct archive_read *a, struct _7zip *zip, #ifdef HAVE_ZLIB_H case _7Z_DEFLATE: zip->stream.next_in = (Bytef *)(uintptr_t)t_next_in; - zip->stream.avail_in = t_avail_in; + zip->stream.avail_in = (uInt)t_avail_in; zip->stream.next_out = t_next_out; - zip->stream.avail_out = t_avail_out; + zip->stream.avail_out = (uInt)t_avail_out; r = inflate(&(zip->stream), 0); switch (r) { case Z_STREAM_END: /* Found end of stream. */ @@ -1607,9 +1608,10 @@ read_Digests(struct archive_read *a, struct _7z_digests *d, size_t num) const unsigned char *p; unsigned i; + if (num == 0) + return (-1); memset(d, 0, sizeof(*d)); - d->defineds = malloc(num); if (d->defineds == NULL) return (-1); @@ -2687,7 +2689,7 @@ header_bytes(struct archive_read *a, size_t rbytes) } /* Update checksum */ - zip->header_crc32 = crc32(zip->header_crc32, p, rbytes); + zip->header_crc32 = crc32(zip->header_crc32, p, (unsigned)rbytes); return (p); } @@ -2966,16 +2968,19 @@ extract_pack_stream(struct archive_read *a, size_t minimum) * Expand the uncompressed buffer up to * the minimum size. */ - zip->uncompressed_buffer_size = minimum + 1023; - zip->uncompressed_buffer_size &= ~0x3ff; - zip->uncompressed_buffer = - realloc(zip->uncompressed_buffer, - zip->uncompressed_buffer_size); - if (zip->uncompressed_buffer == NULL) { + void *p; + size_t new_size; + + new_size = minimum + 1023; + new_size &= ~0x3ff; + p = realloc(zip->uncompressed_buffer, new_size); + if (p == NULL) { archive_set_error(&a->archive, ENOMEM, "No memory for 7-Zip decompression"); return (ARCHIVE_FATAL); } + zip->uncompressed_buffer = (unsigned char *)p; + zip->uncompressed_buffer_size = new_size; } /* * Move unconsumed bytes to the head. @@ -3095,7 +3100,7 @@ read_stream(struct archive_read *a, const void **buff, size_t size, { struct _7zip *zip = (struct _7zip *)a->format->data; uint64_t skip_bytes = 0; - int r; + ssize_t r; if (zip->uncompressed_buffer_bytes_remaining == 0) { if (zip->pack_stream_inbytes_remaining > 0) { @@ -3346,8 +3351,10 @@ setup_decode_folder(struct archive_read *a, struct _7z_folder *folder, for (i = 0; i < 3; i++) { const struct _7z_coder *coder = scoder[i]; - if ((r = seek_pack(a)) < 0) + if ((r = seek_pack(a)) < 0) { + free(b[0]); free(b[1]); free(b[2]); return (r); + } if (sunpack[i] == (uint64_t)-1) zip->folder_outbytes_remaining = @@ -3356,13 +3363,16 @@ setup_decode_folder(struct archive_read *a, struct _7z_folder *folder, zip->folder_outbytes_remaining = sunpack[i]; r = init_decompression(a, zip, coder, NULL); - if (r != ARCHIVE_OK) + if (r != ARCHIVE_OK) { + free(b[0]); free(b[1]); free(b[2]); return (ARCHIVE_FATAL); + } /* Allocate memory for the decorded data of a sub * stream. */ b[i] = malloc((size_t)zip->folder_outbytes_remaining); if (b[i] == NULL) { + free(b[0]); free(b[1]); free(b[2]); archive_set_error(&a->archive, ENOMEM, "No memory for 7-Zip decompression"); return (ARCHIVE_FATAL); @@ -3370,14 +3380,18 @@ setup_decode_folder(struct archive_read *a, struct _7z_folder *folder, /* Extract a sub stream. */ while (zip->pack_stream_inbytes_remaining > 0) { - r = extract_pack_stream(a, 0); - if (r < 0) + r = (int)extract_pack_stream(a, 0); + if (r < 0) { + free(b[0]); free(b[1]); free(b[2]); return (r); + } bytes = get_uncompressed_data(a, &buff, zip->uncompressed_buffer_bytes_remaining, 0); - if (bytes < 0) + if (bytes < 0) { + free(b[0]); free(b[1]); free(b[2]); return ((int)bytes); + } memcpy(b[i]+s[i], buff, bytes); s[i] += bytes; if (zip->pack_stream_bytes_unconsumed) @@ -3557,7 +3571,7 @@ x86_Convert(struct _7zip *zip, uint8_t *data, size_t size) } zip->bcj_prevPosT = prevPosT; zip->bcj_prevMask = prevMask; - zip->bcj_ip += bufferPos; + zip->bcj_ip += (uint32_t)bufferPos; return (bufferPos); } @@ -3701,7 +3715,7 @@ Bcj2_Decode(struct _7zip *zip, uint8_t *outBuf, size_t outSize) ((uint32_t)v[1] << 16) | ((uint32_t)v[2] << 8) | ((uint32_t)v[3])) - - ((uint32_t)zip->bcj2_outPos + outPos + 4); + ((uint32_t)zip->bcj2_outPos + (uint32_t)outPos + 4); out[0] = (uint8_t)dest; out[1] = (uint8_t)(dest >> 8); out[2] = (uint8_t)(dest >> 16); @@ -3716,7 +3730,7 @@ Bcj2_Decode(struct _7zip *zip, uint8_t *outBuf, size_t outSize) */ zip->odd_bcj_size = 4 -i; for (; i < 4; i++) { - j = i - 4 + zip->odd_bcj_size; + j = i - 4 + (unsigned)zip->odd_bcj_size; zip->odd_bcj[j] = out[i]; } break; diff --git a/libarchive/archive_read_support_format_ar.c b/libarchive/archive_read_support_format_ar.c index 9feb547dbbea..40be18c0cce2 100644 --- a/libarchive/archive_read_support_format_ar.c +++ b/libarchive/archive_read_support_format_ar.c @@ -121,6 +121,7 @@ archive_read_support_format_ar(struct archive *_a) archive_read_format_ar_read_header, archive_read_format_ar_read_data, archive_read_format_ar_skip, + NULL, archive_read_format_ar_cleanup); if (r != ARCHIVE_OK) { diff --git a/libarchive/archive_read_support_format_cab.c b/libarchive/archive_read_support_format_cab.c index aa0152a17140..3c9f94ca6ba3 100644 --- a/libarchive/archive_read_support_format_cab.c +++ b/libarchive/archive_read_support_format_cab.c @@ -382,6 +382,7 @@ archive_read_support_format_cab(struct archive *_a) archive_read_format_cab_read_header, archive_read_format_cab_read_data, archive_read_format_cab_read_data_skip, + NULL, archive_read_format_cab_cleanup); if (r != ARCHIVE_OK) @@ -539,7 +540,7 @@ truncated_error(struct archive_read *a) return (ARCHIVE_FATAL); } -static int +static ssize_t cab_strnlen(const unsigned char *p, size_t maxlen) { size_t i; @@ -550,7 +551,7 @@ cab_strnlen(const unsigned char *p, size_t maxlen) } if (i > maxlen) return (-1);/* invalid */ - return (i); + return ((ssize_t)i); } /* Read bytes as much as remaining. */ @@ -626,8 +627,9 @@ cab_read_header(struct archive_read *a) struct cab *cab; struct cfheader *hd; size_t bytes, used; + ssize_t len; int64_t skip; - int err, i, len; + int err, i; int cur_folder, prev_folder; uint32_t offset32; @@ -1066,13 +1068,13 @@ static uint32_t cab_checksum_cfdata_4(const void *p, size_t bytes, uint32_t seed) { const unsigned char *b; - int u32num; + unsigned u32num; uint32_t sum; - u32num = bytes / 4; + u32num = (unsigned)bytes / 4; sum = seed; b = p; - while (--u32num >= 0) { + for (;u32num > 0; --u32num) { sum ^= archive_le32dec(b); b += 4; } @@ -1485,7 +1487,7 @@ cab_read_ahead_cfdata_deflate(struct archive_read *a, ssize_t *avail) * cast to remove 'const'. */ cab->stream.next_in = (Bytef *)(uintptr_t)d; - cab->stream.avail_in = bytes_avail; + cab->stream.avail_in = (uInt)bytes_avail; cab->stream.total_in = 0; /* Cut out a tow-byte MSZIP signature(0x43, 0x4b). */ @@ -1506,7 +1508,7 @@ cab_read_ahead_cfdata_deflate(struct archive_read *a, ssize_t *avail) *avail = ARCHIVE_FATAL; return (NULL); } - mszip -= bytes_avail; + mszip -= (int)bytes_avail; continue; } if (mszip == 1 && cab->stream.next_in[0] != 0x4b) @@ -1935,7 +1937,7 @@ cab_read_data(struct archive_read *a, const void **buff, ARCHIVE_ERRNO_FILE_FORMAT, "Invalid CFDATA"); return (ARCHIVE_FATAL); } else - return (bytes_avail); + return ((int)bytes_avail); } if (bytes_avail > cab->entry_bytes_remaining) bytes_avail = (ssize_t)cab->entry_bytes_remaining; @@ -2001,7 +2003,8 @@ archive_read_format_cab_read_data_skip(struct archive_read *a) /* If the compression type is none(uncompressed), we've already * consumed data as much as the current entry size. */ - if (cab->entry_cffolder->comptype == COMPTYPE_NONE) + if (cab->entry_cffolder->comptype == COMPTYPE_NONE && + cab->entry_cfdata != NULL) cab->entry_cfdata->unconsumed = 0; /* This entry is finished and done. */ @@ -2198,7 +2201,7 @@ lzx_translation(struct lzx_stream *strm, void *p, size_t size, uint32_t offset) size_t i = b - (unsigned char *)p; int32_t cp, displacement, value; - cp = offset + i; + cp = (int32_t)(offset + (uint32_t)i); value = archive_le32dec(&b[1]); if (value >= -cp && value < (int32_t)ds->translation_size) { if (value >= 0) @@ -2584,7 +2587,7 @@ lzx_read_blocks(struct lzx_stream *strm, int last) goto failed; return (ARCHIVE_OK); } - l = ds->block_bytes_avail; + l = (int)ds->block_bytes_avail; if (l > ds->w_size - ds->w_pos) l = ds->w_size - ds->w_pos; if (l > strm->avail_out) @@ -2746,8 +2749,8 @@ lzx_decode_blocks(struct lzx_stream *strm, int last) struct lzx_br bre = ds->br; struct huffman *at = &(ds->at), *lt = &(ds->lt), *mt = &(ds->mt); const struct lzx_pos_tbl *pos_tbl = ds->pos_tbl; - unsigned char *outp = strm->next_out; - unsigned char *endp = outp + strm->avail_out; + unsigned char *noutp = strm->next_out; + unsigned char *endp = noutp + strm->avail_out; unsigned char *w_buff = ds->w_buff; unsigned char *at_bitlen = at->bitlen; unsigned char *lt_bitlen = lt->bitlen; @@ -2781,10 +2784,10 @@ lzx_decode_blocks(struct lzx_stream *strm, int last) ds->position_slot = position_slot; ds->r0 = r0; ds->r1 = r1; ds->r2 = r2; ds->w_pos = w_pos; - strm->avail_out = endp - outp; + strm->avail_out = endp - noutp; return (ARCHIVE_EOF); } - if (outp >= endp) + if (noutp >= endp) /* Output buffer is empty. */ goto next_data; @@ -2818,7 +2821,7 @@ lzx_decode_blocks(struct lzx_stream *strm, int last) w_buff[w_pos] = c; w_pos = (w_pos + 1) & w_mask; /* Store the decoded code to output buffer. */ - *outp++ = c; + *noutp++ = c; block_bytes_avail--; } /* @@ -2963,22 +2966,22 @@ lzx_decode_blocks(struct lzx_stream *strm, int last) if (l > w_size - w_pos) l = w_size - w_pos; } - if (outp + l >= endp) - l = endp - outp; + if (noutp + l >= endp) + l = (int)(endp - noutp); s = w_buff + copy_pos; if (l >= 8 && ((copy_pos + l < w_pos) || (w_pos + l < copy_pos))) { memcpy(w_buff + w_pos, s, l); - memcpy(outp, s, l); + memcpy(noutp, s, l); } else { unsigned char *d; int li; d = w_buff + w_pos; for (li = 0; li < l; li++) - outp[li] = d[li] = s[li]; + noutp[li] = d[li] = s[li]; } - outp += l; + noutp += l; copy_pos = (copy_pos + l) & w_mask; w_pos = (w_pos + l) & w_mask; block_bytes_avail -= l; @@ -2986,7 +2989,7 @@ lzx_decode_blocks(struct lzx_stream *strm, int last) /* A copy of current pattern ended. */ break; copy_len -= l; - if (outp >= endp) { + if (noutp >= endp) { /* Output buffer is empty. */ state = ST_COPY; goto next_data; @@ -3009,7 +3012,7 @@ lzx_decode_blocks(struct lzx_stream *strm, int last) ds->r0 = r0; ds->r1 = r1; ds->r2 = r2; ds->state = state; ds->w_pos = w_pos; - strm->avail_out = endp - outp; + strm->avail_out = endp - noutp; return (ARCHIVE_OK); } @@ -3126,7 +3129,7 @@ lzx_huffman_init(struct huffman *hf, size_t len_size, int tbl_bits) hf->bitlen = calloc(len_size, sizeof(hf->bitlen[0])); if (hf->bitlen == NULL) return (ARCHIVE_FATAL); - hf->len_size = len_size; + hf->len_size = (int)len_size; } else memset(hf->bitlen, 0, len_size * sizeof(hf->bitlen[0])); if (hf->tbl == NULL) { @@ -3134,7 +3137,7 @@ lzx_huffman_init(struct huffman *hf, size_t len_size, int tbl_bits) bits = tbl_bits; else bits = HTBL_BITS; - hf->tbl = malloc((1 << bits) * sizeof(hf->tbl[0])); + hf->tbl = malloc(((size_t)1 << bits) * sizeof(hf->tbl[0])); if (hf->tbl == NULL) return (ARCHIVE_FATAL); hf->tbl_bits = tbl_bits; diff --git a/libarchive/archive_read_support_format_cpio.c b/libarchive/archive_read_support_format_cpio.c index ff29e1ffd973..819f4a4f531e 100644 --- a/libarchive/archive_read_support_format_cpio.c +++ b/libarchive/archive_read_support_format_cpio.c @@ -242,6 +242,7 @@ archive_read_support_format_cpio(struct archive *_a) archive_read_format_cpio_read_header, archive_read_format_cpio_read_data, archive_read_format_cpio_skip, + NULL, archive_read_format_cpio_cleanup); if (r != ARCHIVE_OK) diff --git a/libarchive/archive_read_support_format_empty.c b/libarchive/archive_read_support_format_empty.c index 3dc2196cb99e..366073820975 100644 --- a/libarchive/archive_read_support_format_empty.c +++ b/libarchive/archive_read_support_format_empty.c @@ -53,6 +53,7 @@ archive_read_support_format_empty(struct archive *_a) archive_read_format_empty_read_header, archive_read_format_empty_read_data, NULL, + NULL, NULL); return (r); diff --git a/libarchive/archive_read_support_format_iso9660.c b/libarchive/archive_read_support_format_iso9660.c index d38c7cfe7e42..914bc71dfed5 100644 --- a/libarchive/archive_read_support_format_iso9660.c +++ b/libarchive/archive_read_support_format_iso9660.c @@ -1,7 +1,7 @@ /*- * Copyright (c) 2003-2007 Tim Kientzle * Copyright (c) 2009 Andreas Henriksson - * Copyright (c) 2009-2011 Michihiro NAKAJIMA + * Copyright (c) 2009-2012 Michihiro NAKAJIMA * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -374,6 +374,8 @@ struct iso9660 { size_t utf16be_path_len; unsigned char *utf16be_previous_path; size_t utf16be_previous_path_len; + /* Null buufer used in bidder to improve its performance. */ + unsigned char null[2048]; }; static int archive_read_format_iso9660_bid(struct archive_read *, int); @@ -475,6 +477,7 @@ archive_read_support_format_iso9660(struct archive *_a) archive_read_format_iso9660_read_header, archive_read_format_iso9660_read_data, archive_read_format_iso9660_read_data_skip, + NULL, archive_read_format_iso9660_cleanup); if (r != ARCHIVE_OK) { @@ -587,6 +590,23 @@ archive_read_format_iso9660_options(struct archive_read *a, return (ARCHIVE_WARN); } +static int +isNull(struct iso9660 *iso9660, const unsigned char *h, unsigned offset, +unsigned bytes) +{ + + while (bytes >= sizeof(iso9660->null)) { + if (!memcmp(iso9660->null, h + offset, sizeof(iso9660->null))) + return (0); + offset += sizeof(iso9660->null); + bytes -= sizeof(iso9660->null); + } + if (bytes) + return memcmp(iso9660->null, h + offset, bytes) == 0; + else + return (1); +} + static int isBootRecord(struct iso9660 *iso9660, const unsigned char *h) { @@ -632,8 +652,6 @@ isVolumePartition(struct iso9660 *iso9660, const unsigned char *h) static int isVDSetTerminator(struct iso9660 *iso9660, const unsigned char *h) { - int i; - (void)iso9660; /* UNUSED */ /* Type of the Volume Descriptor Set Terminator must be 255. */ @@ -645,9 +663,8 @@ isVDSetTerminator(struct iso9660 *iso9660, const unsigned char *h) return (0); /* Reserved field must be 0. */ - for (i = 7; i < 2048; ++i) - if (h[i] != 0) - return (0); + if (!isNull(iso9660, h, 7, 2048-7)) + return (0); return (1); } @@ -708,7 +725,6 @@ isSVD(struct iso9660 *iso9660, const unsigned char *h) ssize_t logical_block_size; int32_t volume_block; int32_t location; - int i; (void)iso9660; /* UNUSED */ @@ -717,15 +733,12 @@ isSVD(struct iso9660 *iso9660, const unsigned char *h) return (0); /* Reserved field must be 0. */ - for (i = 0; i < SVD_reserved1_size; ++i) - if (h[SVD_reserved1_offset + i] != 0) - return (0); - for (i = 0; i < SVD_reserved2_size; ++i) - if (h[SVD_reserved2_offset + i] != 0) - return (0); - for (i = 0; i < SVD_reserved3_size; ++i) - if (h[SVD_reserved3_offset + i] != 0) - return (0); + if (!isNull(iso9660, h, SVD_reserved1_offset, SVD_reserved1_size)) + return (0); + if (!isNull(iso9660, h, SVD_reserved2_offset, SVD_reserved2_size)) + return (0); + if (!isNull(iso9660, h, SVD_reserved3_offset, SVD_reserved3_size)) + return (0); /* File structure version must be 1 for ISO9660/ECMA119. */ if (h[SVD_file_structure_version_offset] != 1) @@ -771,7 +784,6 @@ isEVD(struct iso9660 *iso9660, const unsigned char *h) ssize_t logical_block_size; int32_t volume_block; int32_t location; - int i; (void)iso9660; /* UNUSED */ @@ -788,14 +800,12 @@ isEVD(struct iso9660 *iso9660, const unsigned char *h) return (0); /* Reserved field must be 0. */ - for (i = 0; i < PVD_reserved2_size; ++i) - if (h[PVD_reserved2_offset + i] != 0) - return (0); + if (!isNull(iso9660, h, PVD_reserved2_offset, PVD_reserved2_size)) + return (0); /* Reserved field must be 0. */ - for (i = 0; i < PVD_reserved3_size; ++i) - if (h[PVD_reserved3_offset + i] != 0) - return (0); + if (!isNull(iso9660, h, PVD_reserved3_offset, PVD_reserved3_size)) + return (0); /* Logical block size must be > 0. */ /* I've looked at Ecma 119 and can't find any stronger @@ -830,14 +840,12 @@ isEVD(struct iso9660 *iso9660, const unsigned char *h) return (0); /* Reserved field must be 0. */ - for (i = 0; i < PVD_reserved4_size; ++i) - if (h[PVD_reserved4_offset + i] != 0) - return (0); + if (!isNull(iso9660, h, PVD_reserved4_offset, PVD_reserved4_size)) + return (0); /* Reserved field must be 0. */ - for (i = 0; i < PVD_reserved5_size; ++i) - if (h[PVD_reserved5_offset + i] != 0) - return (0); + if (!isNull(iso9660, h, PVD_reserved5_offset, PVD_reserved5_size)) + return (0); /* Read Root Directory Record in Volume Descriptor. */ p = h + PVD_root_directory_record_offset; @@ -869,14 +877,12 @@ isPVD(struct iso9660 *iso9660, const unsigned char *h) return (0); /* Reserved field must be 0. */ - for (i = 0; i < PVD_reserved2_size; ++i) - if (h[PVD_reserved2_offset + i] != 0) - return (0); + if (!isNull(iso9660, h, PVD_reserved2_offset, PVD_reserved2_size)) + return (0); /* Reserved field must be 0. */ - for (i = 0; i < PVD_reserved3_size; ++i) - if (h[PVD_reserved3_offset + i] != 0) - return (0); + if (!isNull(iso9660, h, PVD_reserved3_offset, PVD_reserved3_size)) + return (0); /* Logical block size must be > 0. */ /* I've looked at Ecma 119 and can't find any stronger @@ -919,9 +925,8 @@ isPVD(struct iso9660 *iso9660, const unsigned char *h) return (0); /* Reserved field must be 0. */ - for (i = 0; i < PVD_reserved5_size; ++i) - if (h[PVD_reserved5_offset + i] != 0) - return (0); + if (!isNull(iso9660, h, PVD_reserved5_offset, PVD_reserved5_size)) + return (0); /* XXX TODO: Check other values for sanity; reject more * malformed PVDs. XXX */ @@ -934,8 +939,10 @@ isPVD(struct iso9660 *iso9660, const unsigned char *h) if (!iso9660->primary.location) { iso9660->logical_block_size = logical_block_size; iso9660->volume_block = volume_block; - iso9660->volume_size = logical_block_size * (uint64_t)volume_block; - iso9660->primary.location = archive_le32dec(p + DR_extent_offset); + iso9660->volume_size = + logical_block_size * (uint64_t)volume_block; + iso9660->primary.location = + archive_le32dec(p + DR_extent_offset); iso9660->primary.size = archive_le32dec(p + DR_size_offset); } @@ -951,6 +958,12 @@ read_children(struct archive_read *a, struct file_info *parent) size_t step, skip_size; iso9660 = (struct iso9660 *)(a->format->data); + /* flush any remaining bytes from the last round to ensure + * we're positioned */ + if (iso9660->entry_bytes_unconsumed) { + __archive_read_consume(a, iso9660->entry_bytes_unconsumed); + iso9660->entry_bytes_unconsumed = 0; + } if (iso9660->current_position > parent->offset) { archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, "Ignoring out-of-order directory (%s) %jd > %jd", @@ -1059,6 +1072,94 @@ read_children(struct archive_read *a, struct file_info *parent) return (ARCHIVE_OK); } +static int +choose_volume(struct archive_read *a, struct iso9660 *iso9660) +{ + struct file_info *file; + int64_t skipsize; + struct vd *vd; + const void *block; + char seenJoliet; + + vd = &(iso9660->primary); + if (!iso9660->opt_support_joliet) + iso9660->seenJoliet = 0; + if (iso9660->seenJoliet && + vd->location > iso9660->joliet.location) + /* This condition is unlikely; by way of caution. */ + vd = &(iso9660->joliet); + + skipsize = LOGICAL_BLOCK_SIZE * vd->location; + skipsize = __archive_read_consume(a, skipsize); + if (skipsize < 0) + return ((int)skipsize); + iso9660->current_position = skipsize; + + block = __archive_read_ahead(a, vd->size, NULL); + if (block == NULL) { + archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, + "Failed to read full block when scanning " + "ISO9660 directory list"); + return (ARCHIVE_FATAL); + } + + /* + * While reading Root Directory, flag seenJoliet must be zero to + * avoid converting special name 0x00(Current Directory) and + * next byte to UCS2. + */ + seenJoliet = iso9660->seenJoliet;/* Save flag. */ + iso9660->seenJoliet = 0; + file = parse_file_info(a, NULL, block); + if (file == NULL) + return (ARCHIVE_FATAL); + iso9660->seenJoliet = seenJoliet; + + /* + * If the iso image has both RockRidge and Joliet, we preferentially + * use RockRidge Extensions rather than Joliet ones. + */ + if (vd == &(iso9660->primary) && iso9660->seenRockridge + && iso9660->seenJoliet) + iso9660->seenJoliet = 0; + + if (vd == &(iso9660->primary) && !iso9660->seenRockridge + && iso9660->seenJoliet) { + /* Switch reading data from primary to joliet. */ + vd = &(iso9660->joliet); + skipsize = LOGICAL_BLOCK_SIZE * vd->location; + skipsize -= iso9660->current_position; + skipsize = __archive_read_consume(a, skipsize); + if (skipsize < 0) + return ((int)skipsize); + iso9660->current_position += skipsize; + + block = __archive_read_ahead(a, vd->size, NULL); + if (block == NULL) { + archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, + "Failed to read full block when scanning " + "ISO9660 directory list"); + return (ARCHIVE_FATAL); + } + iso9660->seenJoliet = 0; + file = parse_file_info(a, NULL, block); + if (file == NULL) + return (ARCHIVE_FATAL); + iso9660->seenJoliet = seenJoliet; + } + + /* Store the root directory in the pending list. */ + if (add_entry(a, iso9660, file) != ARCHIVE_OK) + return (ARCHIVE_FATAL); + if (iso9660->seenRockridge) { + a->archive.archive_format = ARCHIVE_FORMAT_ISO9660_ROCKRIDGE; + a->archive.archive_format_name = + "ISO9660 with Rockridge extensions"; + } + + return (ARCHIVE_OK); +} + static int archive_read_format_iso9660_read_header(struct archive_read *a, struct archive_entry *entry) @@ -1075,86 +1176,9 @@ archive_read_format_iso9660_read_header(struct archive_read *a, } if (iso9660->current_position == 0) { - int64_t skipsize; - struct vd *vd; - const void *block; - char seenJoliet; - - vd = &(iso9660->primary); - if (!iso9660->opt_support_joliet) - iso9660->seenJoliet = 0; - if (iso9660->seenJoliet && - vd->location > iso9660->joliet.location) - /* This condition is unlikely; by way of caution. */ - vd = &(iso9660->joliet); - - skipsize = LOGICAL_BLOCK_SIZE * vd->location; - skipsize = __archive_read_consume(a, skipsize); - if (skipsize < 0) - return ((int)skipsize); - iso9660->current_position = skipsize; - - block = __archive_read_ahead(a, vd->size, NULL); - if (block == NULL) { - archive_set_error(&a->archive, - ARCHIVE_ERRNO_MISC, - "Failed to read full block when scanning " - "ISO9660 directory list"); - return (ARCHIVE_FATAL); - } - - /* - * While reading Root Directory, flag seenJoliet - * must be zero to avoid converting special name - * 0x00(Current Directory) and next byte to UCS2. - */ - seenJoliet = iso9660->seenJoliet;/* Save flag. */ - iso9660->seenJoliet = 0; - file = parse_file_info(a, NULL, block); - if (file == NULL) - return (ARCHIVE_FATAL); - iso9660->seenJoliet = seenJoliet; - if (vd == &(iso9660->primary) && iso9660->seenRockridge - && iso9660->seenJoliet) - /* - * If iso image has RockRidge and Joliet, - * we use RockRidge Extensions. - */ - iso9660->seenJoliet = 0; - if (vd == &(iso9660->primary) && !iso9660->seenRockridge - && iso9660->seenJoliet) { - /* Switch reading data from primary to joliet. */ - vd = &(iso9660->joliet); - skipsize = LOGICAL_BLOCK_SIZE * vd->location; - skipsize -= iso9660->current_position; - skipsize = __archive_read_consume(a, skipsize); - if (skipsize < 0) - return ((int)skipsize); - iso9660->current_position += skipsize; - - block = __archive_read_ahead(a, vd->size, NULL); - if (block == NULL) { - archive_set_error(&a->archive, - ARCHIVE_ERRNO_MISC, - "Failed to read full block when scanning " - "ISO9660 directory list"); - return (ARCHIVE_FATAL); - } - iso9660->seenJoliet = 0; - file = parse_file_info(a, NULL, block); - if (file == NULL) - return (ARCHIVE_FATAL); - iso9660->seenJoliet = seenJoliet; - } - /* Store the root directory in the pending list. */ - if (add_entry(a, iso9660, file) != ARCHIVE_OK) - return (ARCHIVE_FATAL); - if (iso9660->seenRockridge) { - a->archive.archive_format = - ARCHIVE_FORMAT_ISO9660_ROCKRIDGE; - a->archive.archive_format_name = - "ISO9660 with Rockridge extensions"; - } + r = choose_volume(a, iso9660); + if (r != ARCHIVE_OK) + return (r); } file = NULL;/* Eliminate a warning. */ @@ -1227,14 +1251,14 @@ archive_read_format_iso9660_read_header(struct archive_read *a, } iso9660->entry_bytes_remaining = file->size; - iso9660->entry_sparse_offset = 0; /* Offset for sparse-file-aware clients. */ + /* Offset for sparse-file-aware clients. */ + iso9660->entry_sparse_offset = 0; if (file->offset + file->size > iso9660->volume_size) { archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, "File is beyond end-of-media: %s", archive_entry_pathname(entry)); iso9660->entry_bytes_remaining = 0; - iso9660->entry_sparse_offset = 0; return (ARCHIVE_WARN); } @@ -1286,36 +1310,33 @@ archive_read_format_iso9660_read_header(struct archive_read *a, iso9660->previous_pathname.s); archive_entry_unset_size(entry); iso9660->entry_bytes_remaining = 0; - iso9660->entry_sparse_offset = 0; return (rd_r); } - /* Except for the hardlink case above, if the offset of the - * next entry is before our current position, we can't seek - * backwards to extract it, so issue a warning. Note that - * this can only happen if this entry was added to the heap - * after we passed this offset, that is, only if the directory - * mentioning this entry is later than the body of the entry. - * Such layouts are very unusual; most ISO9660 writers lay out - * and record all directory information first, then store - * all file bodies. */ - /* TODO: Someday, libarchive's I/O core will support optional - * seeking. When that day comes, this code should attempt to - * seek and only return the error if the seek fails. That - * will give us support for whacky ISO images that require - * seeking while retaining the ability to read almost all ISO - * images in a streaming fashion. */ if ((file->mode & AE_IFMT) != AE_IFDIR && file->offset < iso9660->current_position) { - archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, - "Ignoring out-of-order file @%jx (%s) %jd < %jd", - (intmax_t)file->number, - iso9660->pathname.s, - (intmax_t)file->offset, - (intmax_t)iso9660->current_position); - iso9660->entry_bytes_remaining = 0; - iso9660->entry_sparse_offset = 0; - return (ARCHIVE_WARN); + int64_t r64; + + r64 = __archive_read_seek(a, file->offset, SEEK_SET); + if (r64 != (int64_t)file->offset) { + /* We can't seek backwards to extract it, so issue + * a warning. Note that this can only happen if + * this entry was added to the heap after we passed + * this offset, that is, only if the directory + * mentioning this entry is later than the body of + * the entry. Such layouts are very unusual; most + * ISO9660 writers lay out and record all directory + * information first, then store all file bodies. */ + archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, + "Ignoring out-of-order file @%jx (%s) %jd < %jd", + (intmax_t)file->number, + iso9660->pathname.s, + (intmax_t)file->offset, + (intmax_t)iso9660->current_position); + iso9660->entry_bytes_remaining = 0; + return (ARCHIVE_WARN); + } + iso9660->current_position = (uint64_t)r64; } /* Initialize zisofs variables. */ @@ -1356,7 +1377,6 @@ archive_read_format_iso9660_read_header(struct archive_read *a, archive_entry_set_nlink(entry, 2 + file->subdirs); /* Directory data has been read completely. */ iso9660->entry_bytes_remaining = 0; - iso9660->entry_sparse_offset = 0; } if (rd_r != ARCHIVE_OK) @@ -1426,7 +1446,7 @@ zisofs_read_data(struct archive_read *a, zisofs->block_pointers_size = xsize; /* Allocate uncompressed data buffer. */ - xsize = 1UL << zisofs->pz_log2_bs; + xsize = (size_t)1UL << zisofs->pz_log2_bs; if (zisofs->uncompressed_buffer_size < xsize) { if (zisofs->uncompressed_buffer != NULL) free(zisofs->uncompressed_buffer); @@ -1563,9 +1583,10 @@ zisofs_read_data(struct archive_read *a, if (avail > zisofs->block_avail) zisofs->stream.avail_in = zisofs->block_avail; else - zisofs->stream.avail_in = avail; + zisofs->stream.avail_in = (uInt)avail; zisofs->stream.next_out = zisofs->uncompressed_buffer; - zisofs->stream.avail_out = zisofs->uncompressed_buffer_size; + zisofs->stream.avail_out = + (uInt)zisofs->uncompressed_buffer_size; r = inflate(&zisofs->stream, 0); switch (r) { @@ -1580,7 +1601,7 @@ zisofs_read_data(struct archive_read *a, uncompressed_size = zisofs->uncompressed_buffer_size - zisofs->stream.avail_out; avail -= zisofs->stream.next_in - p; - zisofs->block_avail -= zisofs->stream.next_in - p; + zisofs->block_avail -= (uint32_t)(zisofs->stream.next_in - p); } next_data: bytes_read -= avail; @@ -1590,7 +1611,7 @@ zisofs_read_data(struct archive_read *a, iso9660->entry_sparse_offset += uncompressed_size; iso9660->entry_bytes_remaining -= bytes_read; iso9660->current_position += bytes_read; - zisofs->pz_offset += bytes_read; + zisofs->pz_offset += (uint32_t)bytes_read; iso9660->entry_bytes_unconsumed += bytes_read; return (ARCHIVE_OK); @@ -1873,9 +1894,7 @@ parse_file_info(struct archive_read *a, struct file_info *parent, if (iso9660->opt_support_rockridge) { if (parent == NULL && rr_end - rr_start >= 7) { p = rr_start; - if (p[0] == 'S' && p[1] == 'P' - && p[2] == 7 && p[3] == 1 - && p[4] == 0xBE && p[5] == 0xEF) { + if (memcmp(p, "SP\x07\x01\xbe\xef", 6) == 0) { /* * SP extension stores the suspOffset * (Number of bytes to skip between @@ -1935,6 +1954,7 @@ parse_file_info(struct archive_read *a, struct file_info *parent, if (iso9660->seenRockridge) { if (parent != NULL && parent->parent == NULL && (flags & 0x02) && iso9660->rr_moved == NULL && + file->name.s && (strcmp(file->name.s, "rr_moved") == 0 || strcmp(file->name.s, ".rr_moved") == 0)) { iso9660->rr_moved = file; @@ -2067,14 +2087,9 @@ parse_rockridge(struct archive_read *a, struct file_info *file, int data_length = p[2] - 4; int version = p[3]; - /* - * Yes, each 'if' here does test p[0] again. - * Otherwise, the fall-through handling to catch - * unsupported extensions doesn't work. - */ switch(p[0]) { case 'C': - if (p[0] == 'C' && p[1] == 'E') { + if (p[1] == 'E') { if (version == 1 && data_length == 24) { /* * CE extension comprises: @@ -2092,53 +2107,42 @@ parse_rockridge(struct archive_read *a, struct file_info *file, != ARCHIVE_OK) return (ARCHIVE_FATAL); } - break; } - if (p[0] == 'C' && p[1] == 'L') { + else if (p[1] == 'L') { if (version == 1 && data_length == 8) { file->cl_offset = (uint64_t) iso9660->logical_block_size * (uint64_t)archive_le32dec(data); iso9660->seenRockridge = 1; } - break; } - /* FALLTHROUGH */ + break; case 'N': - if (p[0] == 'N' && p[1] == 'M') { + if (p[1] == 'M') { if (version == 1) { parse_rockridge_NM1(file, data, data_length); iso9660->seenRockridge = 1; } - break; } - /* FALLTHROUGH */ + break; case 'P': - if (p[0] == 'P' && p[1] == 'D') { - /* - * PD extension is padding; - * contents are always ignored. - */ - break; - } - if (p[0] == 'P' && p[1] == 'L') { - /* - * PL extension won't appear; - * contents are always ignored. - */ - break; - } - if (p[0] == 'P' && p[1] == 'N') { + /* + * PD extension is padding; + * contents are always ignored. + * + * PL extension won't appear; + * contents are always ignored. + */ + if (p[1] == 'N') { if (version == 1 && data_length == 16) { file->rdev = toi(data,4); file->rdev <<= 32; file->rdev |= toi(data + 8, 4); iso9660->seenRockridge = 1; } - break; } - if (p[0] == 'P' && p[1] == 'X') { + else if (p[1] == 'X') { /* * PX extension comprises: * 8 bytes for mode, @@ -2165,35 +2169,31 @@ parse_rockridge(struct archive_read *a, struct file_info *file, = toi(data + 32, 4); iso9660->seenRockridge = 1; } - break; } - /* FALLTHROUGH */ + break; case 'R': - if (p[0] == 'R' && p[1] == 'E' && version == 1) { + if (p[1] == 'E' && version == 1) { file->re = 1; iso9660->seenRockridge = 1; - break; } - if (p[0] == 'R' && p[1] == 'R' && version == 1) { + else if (p[1] == 'R' && version == 1) { /* * RR extension comprises: * one byte flag value * This extension is obsolete, * so contents are always ignored. */ - break; } - /* FALLTHROUGH */ + break; case 'S': - if (p[0] == 'S' && p[1] == 'L') { + if (p[1] == 'L') { if (version == 1) { parse_rockridge_SL1(file, data, data_length); iso9660->seenRockridge = 1; } - break; } - if (p[0] == 'S' && p[1] == 'T' + else if (p[1] == 'T' && data_length == 0 && version == 1) { /* * ST extension marks end of this @@ -2208,32 +2208,27 @@ parse_rockridge(struct archive_read *a, struct file_info *file, iso9660->seenRockridge = 0; return (ARCHIVE_OK); } + break; case 'T': - if (p[0] == 'T' && p[1] == 'F') { + if (p[1] == 'F') { if (version == 1) { parse_rockridge_TF1(file, data, data_length); iso9660->seenRockridge = 1; } - break; } - /* FALLTHROUGH */ + break; case 'Z': - if (p[0] == 'Z' && p[1] == 'F') { + if (p[1] == 'F') { if (version == 1) parse_rockridge_ZF1(file, data, data_length); - break; } - /* FALLTHROUGH */ + break; default: - /* The FALLTHROUGHs above leave us here for - * any unsupported extension. */ break; } - - p += p[2]; } return (ARCHIVE_OK); @@ -2893,8 +2888,9 @@ next_cache_entry(struct archive_read *a, struct iso9660 *iso9660, fatal_rr: archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, - "Failed to connect 'CL' pointer to 'RE' rr_moved pointer of" - "Rockridge extensions"); + "Failed to connect 'CL' pointer to 'RE' rr_moved pointer of " + "Rockridge extensions: current position = %jd, CL offset = %jd", + (intmax_t)iso9660->current_position, (intmax_t)file->cl_offset); return (ARCHIVE_FATAL); } @@ -3226,10 +3222,12 @@ dump_isodirrec(FILE *out, const unsigned char *isodirrec) fprintf(out, " ilv %d,", toi(isodirrec + DR_interleave_offset, DR_interleave_size)); fprintf(out, " seq %d,", - toi(isodirrec + DR_volume_sequence_number_offset, DR_volume_sequence_number_size)); + toi(isodirrec + DR_volume_sequence_number_offset, + DR_volume_sequence_number_size)); fprintf(out, " nl %d:", toi(isodirrec + DR_name_len_offset, DR_name_len_size)); fprintf(out, " `%.*s'", - toi(isodirrec + DR_name_len_offset, DR_name_len_size), isodirrec + DR_name_offset); + toi(isodirrec + DR_name_len_offset, DR_name_len_size), + isodirrec + DR_name_offset); } #endif diff --git a/libarchive/archive_read_support_format_lha.c b/libarchive/archive_read_support_format_lha.c index a92b072ab60e..f702949fb8c1 100644 --- a/libarchive/archive_read_support_format_lha.c +++ b/libarchive/archive_read_support_format_lha.c @@ -272,7 +272,7 @@ static int lha_skip_sfx(struct archive_read *); static time_t lha_dos_time(const unsigned char *); static time_t lha_win_time(uint64_t, long *); static unsigned char lha_calcsum(unsigned char, const void *, - int, int); + int, size_t); static int lha_parse_linkname(struct archive_string *, struct archive_string *); static int lha_read_data_none(struct archive_read *, const void **, @@ -319,6 +319,7 @@ archive_read_support_format_lha(struct archive *_a) archive_read_format_lha_read_header, archive_read_format_lha_read_data, archive_read_format_lha_read_data_skip, + NULL, archive_read_format_lha_cleanup); if (r != ARCHIVE_OK) @@ -1634,7 +1635,7 @@ lha_parse_linkname(struct archive_string *linkname, struct archive_string *pathname) { char * linkptr; - int symlen; + size_t symlen; linkptr = strchr(pathname->s, '|'); if (linkptr != NULL) { @@ -1689,12 +1690,12 @@ lha_win_time(uint64_t wintime, long *ns) } static unsigned char -lha_calcsum(unsigned char sum, const void *pp, int offset, int size) +lha_calcsum(unsigned char sum, const void *pp, int offset, size_t size) { unsigned char const *p = (unsigned char const *)pp; p += offset; - while (--size >= 0) + for (;size > 0; --size) sum += *p++; return (sum); } @@ -2019,7 +2020,7 @@ lzh_copy_from_window(struct lzh_stream *strm, struct lzh_dec *ds) copy_bytes = (size_t)strm->avail_out; memcpy(strm->next_out, ds->w_buff + ds->copy_pos, copy_bytes); - ds->copy_pos += copy_bytes; + ds->copy_pos += (int)copy_bytes; } else { if (ds->w_remaining <= strm->avail_out) copy_bytes = ds->w_remaining; @@ -2027,7 +2028,7 @@ lzh_copy_from_window(struct lzh_stream *strm, struct lzh_dec *ds) copy_bytes = (size_t)strm->avail_out; memcpy(strm->next_out, ds->w_buff + ds->w_size - ds->w_remaining, copy_bytes); - ds->w_remaining -= copy_bytes; + ds->w_remaining -= (int)copy_bytes; } strm->next_out += copy_bytes; strm->avail_out -= copy_bytes; @@ -2481,7 +2482,7 @@ lzh_huffman_init(struct huffman *hf, size_t len_size, int tbl_bits) bits = tbl_bits; else bits = HTBL_BITS; - hf->tbl = malloc((1 << bits) * sizeof(hf->tbl[0])); + hf->tbl = malloc(((size_t)1 << bits) * sizeof(hf->tbl[0])); if (hf->tbl == NULL) return (ARCHIVE_FATAL); } @@ -2491,7 +2492,7 @@ lzh_huffman_init(struct huffman *hf, size_t len_size, int tbl_bits) if (hf->tree == NULL) return (ARCHIVE_FATAL); } - hf->len_size = len_size; + hf->len_size = (int)len_size; hf->tbl_bits = tbl_bits; return (ARCHIVE_OK); } diff --git a/libarchive/archive_read_support_format_mtree.c b/libarchive/archive_read_support_format_mtree.c index 6fb57629197f..c4e7021a869b 100644 --- a/libarchive/archive_read_support_format_mtree.c +++ b/libarchive/archive_read_support_format_mtree.c @@ -1,7 +1,7 @@ /*- * Copyright (c) 2003-2007 Tim Kientzle * Copyright (c) 2008 Joerg Sonnenberger - * Copyright (c) 2011 Michihiro NAKAJIMA + * Copyright (c) 2011-2012 Michihiro NAKAJIMA * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -55,6 +55,9 @@ __FBSDID("$FreeBSD: head/lib/libarchive/archive_read_support_format_mtree.c 2011 #ifndef O_BINARY #define O_BINARY 0 #endif +#ifndef O_CLOEXEC +#define O_CLOEXEC 0 +#endif #define MTREE_HAS_DEVICE 0x0001 #define MTREE_HAS_FFLAGS 0x0002 @@ -69,6 +72,7 @@ __FBSDID("$FreeBSD: head/lib/libarchive/archive_read_support_format_mtree.c 2011 #define MTREE_HAS_UNAME 0x0400 #define MTREE_HAS_OPTIONAL 0x0800 +#define MTREE_HAS_NOCHANGE 0x1000 /* FreeBSD specific */ struct mtree_option { struct mtree_option *next; @@ -103,6 +107,7 @@ struct mtree { static int bid_keycmp(const char *, const char *, ssize_t); static int cleanup(struct archive_read *); +static int detect_form(struct archive_read *, int *); static int mtree_bid(struct archive_read *, int); static int parse_file(struct archive_read *, struct archive_entry *, struct mtree *, struct mtree_entry *, int *); @@ -200,7 +205,7 @@ archive_read_support_format_mtree(struct archive *_a) mtree->fd = -1; r = __archive_read_register_format(a, mtree, "mtree", - mtree_bid, NULL, read_header, read_data, skip, cleanup); + mtree_bid, NULL, read_header, read_data, skip, NULL, cleanup); if (r != ARCHIVE_OK) free(mtree); @@ -349,7 +354,7 @@ bid_keycmp(const char *p, const char *key, ssize_t len) * Returns the length of a detected keyword. * Returns 0 if any keywords were not found. */ -static ssize_t +static int bid_keyword(const char *p, ssize_t len) { static const char *keys_c[] = { @@ -368,7 +373,7 @@ bid_keyword(const char *p, ssize_t len) "md5", "md5digest", "mode", NULL }; static const char *keys_no[] = { - "nlink", "optional", NULL + "nlink", "nochange", "optional", NULL }; static const char *keys_r[] = { "rmd160", "rmd160digest", NULL @@ -419,7 +424,7 @@ bid_keyword(const char *p, ssize_t len) * When "unset" is specified, expects a set of "keyword". */ static int -bid_keyword_list(const char *p, ssize_t len, int unset) +bid_keyword_list(const char *p, ssize_t len, int unset, int last_is_path) { int l; int keycnt = 0; @@ -437,8 +442,10 @@ bid_keyword_list(const char *p, ssize_t len, int unset) break; if (p[0] == '\\' && (p[1] == '\n' || p[1] == '\r')) break; - if (!blank) /* No blank character. */ + if (!blank && !last_is_path) /* No blank character. */ return (-1); + if (last_is_path && len == 0) + return (keycnt); if (unset) { l = bid_keycmp(p, "all", len); @@ -473,7 +480,7 @@ bid_keyword_list(const char *p, ssize_t len, int unset) } static int -bid_entry(const char *p, ssize_t len) +bid_entry(const char *p, ssize_t len, ssize_t nl, int *last_is_path) { int f = 0; static const unsigned char safe_char[256] = { @@ -500,22 +507,60 @@ bid_entry(const char *p, ssize_t len) 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* E0 - EF */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* F0 - FF */ }; + ssize_t ll = len; + const char *pp = p; + *last_is_path = 0; /* * Skip the path-name which is quoted. */ - while (len > 0 && *p != ' ' && *p != '\t') { - if (!safe_char[*(const unsigned char *)p]) - return (-1); - ++p; - --len; + while (ll > 0 && *pp != ' ' &&*pp != '\t' && *pp != '\r' && + *pp != '\n') { + if (!safe_char[*(const unsigned char *)pp]) { + f = 0; + break; + } + ++pp; + --ll; ++f; } - /* If a path-name was not found, returns error. */ - if (f == 0) - return (-1); + /* If a path-name was not found at the first, try to check + * a mtree format ``NetBSD's mtree -D'' creates, which + * places the path-name at the last. */ + if (f == 0) { + const char *pb = p + len - nl; + int name_len = 0; + int slash; - return (bid_keyword_list(p, len, 0)); + /* Do not accept multi lines for form D. */ + if (pb-2 >= p && + pb[-1] == '\\' && (pb[-2] == ' ' || pb[-2] == '\t')) + return (-1); + if (pb-1 >= p && pb[-1] == '\\') + return (-1); + + slash = 0; + while (p <= --pb && *pb != ' ' && *pb != '\t') { + if (!safe_char[*(const unsigned char *)pb]) + return (-1); + name_len++; + /* The pathname should have a slash in this + * format. */ + if (*pb == '/') + slash = 1; + } + if (name_len == 0 || slash == 0) + return (-1); + /* If '/' is placed at the first in this field, this is not + * a valid filename. */ + if (pb[1] == '/') + return (-1); + ll = len - nl - name_len; + pp = p; + *last_is_path = 1; + } + + return (bid_keyword_list(pp, ll, 0, *last_is_path)); } #define MAX_BID_ENTRY 3 @@ -525,14 +570,11 @@ mtree_bid(struct archive_read *a, int best_bid) { const char *signature = "#mtree"; const char *p; - ssize_t avail, ravail; - ssize_t len, nl; - int detected_bytes = 0, entry_cnt = 0, multiline = 0; (void)best_bid; /* UNUSED */ /* Now let's look at the actual header and see if it matches. */ - p = __archive_read_ahead(a, strlen(signature), &avail); + p = __archive_read_ahead(a, strlen(signature), NULL); if (p == NULL) return (-1); @@ -542,6 +584,24 @@ mtree_bid(struct archive_read *a, int best_bid) /* * There is not a mtree signature. Let's try to detect mtree format. */ + return (detect_form(a, NULL)); +} + +static int +detect_form(struct archive_read *a, int *is_form_d) +{ + const char *p; + ssize_t avail, ravail; + ssize_t detected_bytes = 0, len, nl; + int entry_cnt = 0, multiline = 0; + int form_D = 0;/* The archive is generated by `NetBSD mtree -D' + * (In this source we call it `form D') . */ + + if (is_form_d != NULL) + *is_form_d = 0; + p = __archive_read_ahead(a, 1, &avail); + if (p == NULL) + return (-1); ravail = avail; for (;;) { len = next_line(a, &p, &avail, &ravail, &nl); @@ -566,7 +626,7 @@ mtree_bid(struct archive_read *a, int best_bid) } else { /* A continuance line; the terminal * character of previous line was '\' character. */ - if (bid_keyword_list(p, len, 0) <= 0) + if (bid_keyword_list(p, len, 0, 0) <= 0) break; if (multiline == 1) detected_bytes += len; @@ -581,9 +641,25 @@ mtree_bid(struct archive_read *a, int best_bid) continue; } if (p[0] != '/') { - if (bid_entry(p, len) >= 0) { + int last_is_path, keywords; + + keywords = bid_entry(p, len, nl, &last_is_path); + if (keywords >= 0) { detected_bytes += len; - if (p[len-nl-1] == '\\') + if (form_D == 0) { + if (last_is_path) + form_D = 1; + else if (keywords > 0) + /* This line is not `form D'. */ + form_D = -1; + } else if (form_D == 1) { + if (!last_is_path && keywords > 0) + /* This this is not `form D' + * and We cannot accept mixed + * format. */ + break; + } + if (!last_is_path && p[len-nl-1] == '\\') /* This line continues. */ multiline = 1; else { @@ -596,13 +672,13 @@ mtree_bid(struct archive_read *a, int best_bid) } else break; } else if (strncmp(p, "/set", 4) == 0) { - if (bid_keyword_list(p+4, len-4, 0) <= 0) + if (bid_keyword_list(p+4, len-4, 0, 0) <= 0) break; /* This line continues. */ if (p[len-nl-1] == '\\') multiline = 2; } else if (strncmp(p, "/unset", 6) == 0) { - if (bid_keyword_list(p+6, len-6, 1) <= 0) + if (bid_keyword_list(p+6, len-6, 1, 0) <= 0) break; /* This line continues. */ if (p[len-nl-1] == '\\') @@ -614,8 +690,13 @@ mtree_bid(struct archive_read *a, int best_bid) p += len; avail -= len; } - if (entry_cnt >= MAX_BID_ENTRY || (entry_cnt > 0 && len == 0)) + if (entry_cnt >= MAX_BID_ENTRY || (entry_cnt > 0 && len == 0)) { + if (is_form_d != NULL) { + if (form_D == 1) + *is_form_d = 1; + } return (32); + } return (0); } @@ -739,12 +820,12 @@ process_global_unset(struct archive_read *a, static int process_add_entry(struct archive_read *a, struct mtree *mtree, - struct mtree_option **global, const char *line, - struct mtree_entry **last_entry) + struct mtree_option **global, const char *line, ssize_t line_len, + struct mtree_entry **last_entry, int is_form_d) { struct mtree_entry *entry; struct mtree_option *iter; - const char *next, *eq; + const char *next, *eq, *name, *end; size_t len; int r; @@ -765,17 +846,46 @@ process_add_entry(struct archive_read *a, struct mtree *mtree, (*last_entry)->next = entry; *last_entry = entry; - len = strcspn(line, " \t\r\n"); + if (is_form_d) { + /* + * This form places the file name as last parameter. + */ + name = line + line_len -1; + while (line_len > 0) { + if (*name != '\r' && *name != '\n' && + *name != '\t' && *name != ' ') + break; + name--; + line_len--; + } + len = 0; + while (line_len > 0) { + if (*name == '\r' || *name == '\n' || + *name == '\t' || *name == ' ') { + name++; + break; + } + name--; + line_len--; + len++; + } + end = name; + } else { + len = strcspn(line, " \t\r\n"); + name = line; + line += len; + end = line + line_len; + } + if ((entry->name = malloc(len + 1)) == NULL) { archive_set_error(&a->archive, errno, "Can't allocate memory"); return (ARCHIVE_FATAL); } - memcpy(entry->name, line, len); + memcpy(entry->name, name, len); entry->name[len] = '\0'; parse_escapes(entry->name, entry); - line += len; for (iter = *global; iter != NULL; iter = iter->next) { r = add_option(a, &entry->options, iter->value, strlen(iter->value)); @@ -787,6 +897,8 @@ process_add_entry(struct archive_read *a, struct mtree *mtree, next = line + strspn(line, " \t\r\n"); if (*next == '\0') return (ARCHIVE_OK); + if (next >= end) + return (ARCHIVE_OK); line = next; next = line + strcspn(line, " \t\r\n"); eq = strchr(line, '='); @@ -811,7 +923,7 @@ read_mtree(struct archive_read *a, struct mtree *mtree) char *p; struct mtree_option *global; struct mtree_entry *last_entry; - int r; + int r, is_form_d; mtree->archive_format = ARCHIVE_FORMAT_MTREE; mtree->archive_format_name = "mtree"; @@ -819,6 +931,8 @@ read_mtree(struct archive_read *a, struct mtree *mtree) global = NULL; last_entry = NULL; + (void)detect_form(a, &is_form_d); + for (counter = 1; ; ++counter) { len = readline(a, mtree, &p, 65536); if (len == 0) { @@ -828,7 +942,7 @@ read_mtree(struct archive_read *a, struct mtree *mtree) } if (len < 0) { free_options(global); - return (len); + return ((int)len); } /* Leading whitespace is never significant, ignore it. */ while (*p == ' ' || *p == '\t') { @@ -841,8 +955,8 @@ read_mtree(struct archive_read *a, struct mtree *mtree) if (*p == '\r' || *p == '\n' || *p == '\0') continue; if (*p != '/') { - r = process_add_entry(a, mtree, &global, p, - &last_entry); + r = process_add_entry(a, mtree, &global, p, len, + &last_entry, is_form_d); } else if (strncmp(p, "/set", 4) == 0) { if (p[4] != ' ' && p[4] != '\t') break; @@ -1008,7 +1122,8 @@ parse_file(struct archive_read *a, struct archive_entry *entry, if (archive_entry_filetype(entry) == AE_IFREG || archive_entry_filetype(entry) == AE_IFDIR) { - mtree->fd = open(path, O_RDONLY | O_BINARY); + 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)) { @@ -1091,15 +1206,19 @@ parse_file(struct archive_read *a, struct archive_entry *entry, * if it wasn't already parsed from the specification. */ if (st != NULL) { - if ((parsed_kws & MTREE_HAS_DEVICE) == 0 && + if (((parsed_kws & MTREE_HAS_DEVICE) == 0 || + (parsed_kws & MTREE_HAS_NOCHANGE) != 0) && (archive_entry_filetype(entry) == AE_IFCHR || archive_entry_filetype(entry) == AE_IFBLK)) archive_entry_set_rdev(entry, st->st_rdev); - if ((parsed_kws & (MTREE_HAS_GID | MTREE_HAS_GNAME)) == 0) + if ((parsed_kws & (MTREE_HAS_GID | MTREE_HAS_GNAME)) == 0 || + (parsed_kws & MTREE_HAS_NOCHANGE) != 0) archive_entry_set_gid(entry, st->st_gid); - if ((parsed_kws & (MTREE_HAS_UID | MTREE_HAS_UNAME)) == 0) + if ((parsed_kws & (MTREE_HAS_UID | MTREE_HAS_UNAME)) == 0 || + (parsed_kws & MTREE_HAS_NOCHANGE) != 0) archive_entry_set_uid(entry, st->st_uid); - if ((parsed_kws & MTREE_HAS_MTIME) == 0) { + if ((parsed_kws & MTREE_HAS_MTIME) == 0 || + (parsed_kws & MTREE_HAS_NOCHANGE) != 0) { #if HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC archive_entry_set_mtime(entry, st->st_mtime, st->st_mtimespec.tv_nsec); @@ -1119,11 +1238,14 @@ parse_file(struct archive_read *a, struct archive_entry *entry, archive_entry_set_mtime(entry, st->st_mtime, 0); #endif } - if ((parsed_kws & MTREE_HAS_NLINK) == 0) + if ((parsed_kws & MTREE_HAS_NLINK) == 0 || + (parsed_kws & MTREE_HAS_NOCHANGE) != 0) archive_entry_set_nlink(entry, st->st_nlink); - if ((parsed_kws & MTREE_HAS_PERM) == 0) + if ((parsed_kws & MTREE_HAS_PERM) == 0 || + (parsed_kws & MTREE_HAS_NOCHANGE) != 0) archive_entry_set_perm(entry, st->st_mode); - if ((parsed_kws & MTREE_HAS_SIZE) == 0) + if ((parsed_kws & MTREE_HAS_SIZE) == 0 || + (parsed_kws & MTREE_HAS_NOCHANGE) != 0) archive_entry_set_size(entry, st->st_size); archive_entry_set_ino(entry, st->st_ino); archive_entry_set_dev(entry, st->st_dev); @@ -1213,6 +1335,10 @@ parse_keyword(struct archive_read *a, struct mtree *mtree, if (*key == '\0') return (ARCHIVE_OK); + if (strcmp(key, "nochange") == 0) { + *parsed_kws |= MTREE_HAS_NOCHANGE; + return (ARCHIVE_OK); + } if (strcmp(key, "optional") == 0) { *parsed_kws |= MTREE_HAS_OPTIONAL; return (ARCHIVE_OK); diff --git a/libarchive/archive_read_support_format_rar.c b/libarchive/archive_read_support_format_rar.c index 1e5c5fa72b30..99c57a0fc0eb 100644 --- a/libarchive/archive_read_support_format_rar.c +++ b/libarchive/archive_read_support_format_rar.c @@ -199,6 +199,13 @@ struct lzss int64_t position; }; +struct data_block_offsets +{ + int64_t header_size; + int64_t start_offset; + int64_t end_offset; +}; + struct rar { /* Entries from main RAR header */ @@ -217,6 +224,7 @@ struct rar long mnsec; mode_t mode; char *filename; + char *filename_save; size_t filename_allocated; /* File header optional entries */ @@ -234,6 +242,7 @@ struct rar int64_t bytes_uncopied; int64_t offset; int64_t offset_outgoing; + int64_t offset_seek; char valid; unsigned int unp_offset; unsigned int unp_buffer_size; @@ -243,6 +252,10 @@ struct rar char entry_eof; unsigned long crc_calculated; int found_first_header; + char has_endarc_header; + struct data_block_offsets *dbo; + unsigned int cursor; + unsigned int nodes; /* LZSS members */ struct huffman_code maincode; @@ -301,6 +314,8 @@ static int archive_read_format_rar_read_header(struct archive_read *, static int archive_read_format_rar_read_data(struct archive_read *, const void **, size_t *, int64_t *); static int archive_read_format_rar_read_data_skip(struct archive_read *a); +static int64_t archive_read_format_rar_seek_data(struct archive_read *, int64_t, + int); static int archive_read_format_rar_cleanup(struct archive_read *); /* Support functions */ @@ -328,6 +343,7 @@ static int make_table_recurse(struct archive_read *, struct huffman_code *, int, static int64_t expand(struct archive_read *, int64_t); static int copy_from_lzss_window(struct archive_read *, const void **, int64_t, int); +static const void *rar_read_ahead(struct archive_read *, size_t, ssize_t *); /* * Bit stream reader. @@ -449,11 +465,9 @@ rar_br_fillup(struct archive_read *a, struct rar_br *br) __archive_read_consume(a, rar->bytes_unconsumed); rar->bytes_unconsumed = 0; } - br->next_in = __archive_read_ahead(a, 1, &(br->avail_in)); + br->next_in = rar_read_ahead(a, 1, &(br->avail_in)); if (br->next_in == NULL) return (0); - if (br->avail_in > rar->bytes_remaining) - br->avail_in = (ssize_t)rar->bytes_remaining; if (br->avail_in == 0) return (0); } @@ -473,15 +487,13 @@ rar_br_preparation(struct archive_read *a, struct rar_br *br) struct rar *rar = (struct rar *)(a->format->data); if (rar->bytes_remaining > 0) { - br->next_in = __archive_read_ahead(a, 1, &(br->avail_in)); + br->next_in = rar_read_ahead(a, 1, &(br->avail_in)); if (br->next_in == NULL) { archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT, "Truncated RAR file data"); return (ARCHIVE_FATAL); } - if (br->avail_in > rar->bytes_remaining) - br->avail_in = (ssize_t)rar->bytes_remaining; if (br->cache_avail == 0) (void)rar_br_fillup(a, br); } @@ -642,6 +654,7 @@ archive_read_support_format_rar(struct archive *_a) archive_read_format_rar_read_header, archive_read_format_rar_read_data, archive_read_format_rar_read_data_skip, + archive_read_format_rar_seek_data, archive_read_format_rar_cleanup); if (r != ARCHIVE_OK) @@ -844,13 +857,6 @@ archive_read_format_rar_read_header(struct archive_read *a, sizeof(rar->reserved2)); } - if (rar->main_flags & MHD_VOLUME || - rar->main_flags & MHD_FIRSTVOLUME) - { - archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT, - "RAR volume support unavailable."); - return (ARCHIVE_FATAL); - } if (rar->main_flags & MHD_PASSWORD) { archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT, @@ -858,7 +864,7 @@ archive_read_format_rar_read_header(struct archive_read *a, return (ARCHIVE_FATAL); } - crc32_val = crc32(0, (const unsigned char *)p + 2, skip - 2); + crc32_val = crc32(0, (const unsigned char *)p + 2, (unsigned)skip - 2); if ((crc32_val & 0xffff) != archive_le16dec(p)) { archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT, "Header CRC error"); @@ -875,6 +881,7 @@ archive_read_format_rar_read_header(struct archive_read *a, case SUB_HEAD: case PROTECT_HEAD: case SIGN_HEAD: + case ENDARC_HEAD: flags = archive_le16dec(p + 3); skip = archive_le16dec(p + 5); if (skip < 7) { @@ -900,13 +907,15 @@ archive_read_format_rar_read_header(struct archive_read *a, p = h; } - crc32_val = crc32(0, (const unsigned char *)p + 2, skip - 2); + crc32_val = crc32(0, (const unsigned char *)p + 2, (unsigned)skip - 2); if ((crc32_val & 0xffff) != archive_le16dec(p)) { archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT, "Header CRC error"); return (ARCHIVE_FATAL); } __archive_read_consume(a, skip); + if (head_type == ENDARC_HEAD) + return (ARCHIVE_EOF); break; case NEWSUB_HEAD: @@ -914,9 +923,6 @@ archive_read_format_rar_read_header(struct archive_read *a, return ret; break; - case ENDARC_HEAD: - return (ARCHIVE_EOF); - default: archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT, "Bad RAR file"); @@ -938,10 +944,12 @@ archive_read_format_rar_read_data(struct archive_read *a, const void **buff, rar->bytes_unconsumed = 0; } - if (rar->entry_eof) { + if (rar->entry_eof || rar->offset_seek >= rar->unp_size) { *buff = NULL; *size = 0; *offset = rar->offset; + if (*offset < rar->unp_size) + *offset = rar->unp_size; return (ARCHIVE_EOF); } @@ -975,6 +983,7 @@ archive_read_format_rar_read_data_skip(struct archive_read *a) { struct rar *rar; int64_t bytes_skipped; + int ret; rar = (struct rar *)(a->format->data); @@ -989,9 +998,179 @@ archive_read_format_rar_read_data_skip(struct archive_read *a) if (bytes_skipped < 0) return (ARCHIVE_FATAL); } + + /* Compressed data to skip must be read from each header in a multivolume + * archive. + */ + if (rar->main_flags & MHD_VOLUME && rar->file_flags & FHD_SPLIT_AFTER) + { + ret = archive_read_format_rar_read_header(a, a->entry); + if (ret == (ARCHIVE_EOF)) + ret = archive_read_format_rar_read_header(a, a->entry); + if (ret != (ARCHIVE_OK)) + return ret; + return archive_read_format_rar_read_data_skip(a); + } + return (ARCHIVE_OK); } +static int64_t +archive_read_format_rar_seek_data(struct archive_read *a, int64_t offset, + int whence) +{ + int64_t client_offset, ret; + unsigned int i; + struct rar *rar = (struct rar *)(a->format->data); + + if (rar->compression_method == COMPRESS_METHOD_STORE) + { + /* Modify the offset for use with SEEK_SET */ + switch (whence) + { + case SEEK_CUR: + client_offset = rar->offset_seek; + break; + case SEEK_END: + client_offset = rar->unp_size; + break; + case SEEK_SET: + default: + client_offset = 0; + } + client_offset += offset; + if (client_offset < 0) + { + /* Can't seek past beginning of data block */ + return -1; + } + else if (client_offset > rar->unp_size) + { + /* + * Set the returned offset but only seek to the end of + * the data block. + */ + rar->offset_seek = client_offset; + client_offset = rar->unp_size; + } + + client_offset += rar->dbo[0].start_offset; + i = 0; + while (i < rar->cursor) + { + i++; + client_offset += rar->dbo[i].start_offset - rar->dbo[i-1].end_offset; + } + if (rar->main_flags & MHD_VOLUME) + { + /* Find the appropriate offset among the multivolume archive */ + while (1) + { + if (client_offset < rar->dbo[rar->cursor].start_offset && + rar->file_flags & FHD_SPLIT_BEFORE) + { + /* Search backwards for the correct data block */ + if (rar->cursor == 0) + { + archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, + "Attempt to seek past beginning of RAR data block"); + return (ARCHIVE_FAILED); + } + rar->cursor--; + client_offset -= rar->dbo[rar->cursor+1].start_offset - + rar->dbo[rar->cursor].end_offset; + if (client_offset < rar->dbo[rar->cursor].start_offset) + continue; + ret = __archive_read_seek(a, rar->dbo[rar->cursor].start_offset - + rar->dbo[rar->cursor].header_size, SEEK_SET); + if (ret < (ARCHIVE_OK)) + return ret; + ret = archive_read_format_rar_read_header(a, a->entry); + if (ret != (ARCHIVE_OK)) + { + archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, + "Error during seek of RAR file"); + return (ARCHIVE_FAILED); + } + rar->cursor--; + break; + } + else if (client_offset > rar->dbo[rar->cursor].end_offset && + rar->file_flags & FHD_SPLIT_AFTER) + { + /* Search forward for the correct data block */ + rar->cursor++; + if (rar->cursor < rar->nodes && + client_offset > rar->dbo[rar->cursor].end_offset) + { + client_offset += rar->dbo[rar->cursor].start_offset - + rar->dbo[rar->cursor-1].end_offset; + continue; + } + rar->cursor--; + ret = __archive_read_seek(a, rar->dbo[rar->cursor].end_offset, + SEEK_SET); + if (ret < (ARCHIVE_OK)) + return ret; + ret = archive_read_format_rar_read_header(a, a->entry); + if (ret == (ARCHIVE_EOF)) + { + rar->has_endarc_header = 1; + ret = archive_read_format_rar_read_header(a, a->entry); + } + if (ret != (ARCHIVE_OK)) + { + archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, + "Error during seek of RAR file"); + return (ARCHIVE_FAILED); + } + client_offset += rar->dbo[rar->cursor].start_offset - + rar->dbo[rar->cursor-1].end_offset; + continue; + } + break; + } + } + + ret = __archive_read_seek(a, client_offset, SEEK_SET); + if (ret < (ARCHIVE_OK)) + return ret; + rar->bytes_remaining = rar->dbo[rar->cursor].end_offset - ret; + i = rar->cursor; + while (i > 0) + { + i--; + ret -= rar->dbo[i+1].start_offset - rar->dbo[i].end_offset; + } + ret -= rar->dbo[0].start_offset; + + /* Always restart reading the file after a seek */ + a->read_data_block = NULL; + a->read_data_offset = 0; + a->read_data_output_offset = 0; + a->read_data_remaining = 0; + rar->bytes_unconsumed = 0; + rar->offset = 0; + + /* + * If a seek past the end of file was requested, return the requested + * offset. + */ + if (ret == rar->unp_size && rar->offset_seek > rar->unp_size) + return rar->offset_seek; + + /* Return the new offset */ + rar->offset_seek = ret; + return rar->offset_seek; + } + else + { + archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, + "Seeking of compressed RAR files is unsupported"); + } + return (ARCHIVE_FAILED); +} + static int archive_read_format_rar_cleanup(struct archive_read *a) { @@ -1000,6 +1179,8 @@ archive_read_format_rar_cleanup(struct archive_read *a) rar = (struct rar *)(a->format->data); free_codes(a); free(rar->filename); + free(rar->filename_save); + free(rar->dbo); free(rar->unp_buffer); free(rar->lzss.window); __archive_ppmd7_functions.Ppmd7_Free(&rar->ppmd7_context, &g_szalloc); @@ -1138,6 +1319,8 @@ read_header(struct archive_read *a, struct archive_entry *entry, return (ARCHIVE_FATAL); } + rar->bytes_remaining = rar->packed_size; + /* TODO: RARv3 subblocks contain comments. For now the complete block is * consumed at the end. */ @@ -1177,13 +1360,13 @@ read_header(struct archive_read *a, struct archive_entry *entry, { if (filename_size != strlen(filename)) { - unsigned char highbyte, flagbits, flagbyte, offset; - unsigned fn_end; + unsigned char highbyte, flagbits, flagbyte; + unsigned fn_end, offset; end = filename_size; fn_end = filename_size * 2; filename_size = 0; - offset = strlen(filename) + 1; + offset = (unsigned)strlen(filename) + 1; highbyte = *(p + offset++); flagbits = 0; flagbyte = 0; @@ -1284,6 +1467,51 @@ read_header(struct archive_read *a, struct archive_entry *entry, p += filename_size; } + /* Split file in multivolume RAR. No more need to process header. */ + if (rar->filename_save && + !memcmp(rar->filename, rar->filename_save, filename_size + 1)) + { + __archive_read_consume(a, header_size - 7); + rar->cursor++; + if (rar->cursor >= rar->nodes) + { + rar->nodes++; + if ((rar->dbo = + realloc(rar->dbo, sizeof(*rar->dbo) * rar->nodes)) == NULL) + { + archive_set_error(&a->archive, ENOMEM, "Couldn't allocate memory."); + return (ARCHIVE_FATAL); + } + rar->dbo[rar->cursor].header_size = header_size; + rar->dbo[rar->cursor].start_offset = -1; + rar->dbo[rar->cursor].end_offset = -1; + } + if (rar->dbo[rar->cursor].start_offset < 0) + { + rar->dbo[rar->cursor].start_offset = a->filter->position; + rar->dbo[rar->cursor].end_offset = rar->dbo[rar->cursor].start_offset + + rar->packed_size; + } + return ret; + } + + rar->filename_save = (char*)realloc(rar->filename_save, + filename_size + 1); + memcpy(rar->filename_save, rar->filename, filename_size + 1); + + /* Set info for seeking */ + free(rar->dbo); + if ((rar->dbo = calloc(1, sizeof(*rar->dbo))) == NULL) + { + archive_set_error(&a->archive, ENOMEM, "Couldn't allocate memory."); + return (ARCHIVE_FATAL); + } + rar->dbo[0].header_size = header_size; + rar->dbo[0].start_offset = -1; + rar->dbo[0].end_offset = -1; + rar->cursor = 0; + rar->nodes = 1; + if (rar->file_flags & FHD_SALT) { if (p + 8 > endp) { @@ -1304,6 +1532,8 @@ read_header(struct archive_read *a, struct archive_entry *entry, } __archive_read_consume(a, header_size - 7); + rar->dbo[0].start_offset = a->filter->position; + rar->dbo[0].end_offset = rar->dbo[0].start_offset + rar->packed_size; switch(file_header.host_os) { @@ -1330,9 +1560,9 @@ read_header(struct archive_read *a, struct archive_entry *entry, return (ARCHIVE_FATAL); } - rar->bytes_remaining = rar->packed_size; rar->bytes_uncopied = rar->bytes_unconsumed = 0; rar->lzss.position = rar->offset = 0; + rar->offset_seek = 0; rar->dictionary_size = 0; rar->offset_outgoing = 0; rar->br.cache_avail = 0; @@ -1488,7 +1718,7 @@ read_symlink_stored(struct archive_read *a, struct archive_entry *entry, int ret = (ARCHIVE_OK); rar = (struct rar *)(a->format->data); - if ((h = __archive_read_ahead(a, (size_t)rar->packed_size, NULL)) == NULL) + if ((h = rar_read_ahead(a, (size_t)rar->packed_size, NULL)) == NULL) return (ARCHIVE_FATAL); p = h; @@ -1518,7 +1748,8 @@ read_data_stored(struct archive_read *a, const void **buff, size_t *size, ssize_t bytes_avail; rar = (struct rar *)(a->format->data); - if (rar->bytes_remaining == 0) + if (rar->bytes_remaining == 0 && + !(rar->main_flags & MHD_VOLUME && rar->file_flags & FHD_SPLIT_AFTER)) { *buff = NULL; *size = 0; @@ -1532,23 +1763,23 @@ read_data_stored(struct archive_read *a, const void **buff, size_t *size, return (ARCHIVE_EOF); } - *buff = __archive_read_ahead(a, 1, &bytes_avail); + *buff = rar_read_ahead(a, 1, &bytes_avail); if (bytes_avail <= 0) { archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT, "Truncated RAR file data"); return (ARCHIVE_FATAL); } - if (bytes_avail > rar->bytes_remaining) - bytes_avail = (ssize_t)rar->bytes_remaining; *size = bytes_avail; *offset = rar->offset; rar->offset += bytes_avail; + rar->offset_seek += bytes_avail; rar->bytes_remaining -= bytes_avail; rar->bytes_unconsumed = bytes_avail; /* Calculate File CRC. */ - rar->crc_calculated = crc32(rar->crc_calculated, *buff, bytes_avail); + rar->crc_calculated = crc32(rar->crc_calculated, *buff, + (unsigned)bytes_avail); return (ARCHIVE_OK); } @@ -1578,7 +1809,8 @@ read_data_compressed(struct archive_read *a, const void **buff, size_t *size, *offset = rar->offset_outgoing; rar->offset_outgoing += *size; /* Calculate File CRC. */ - rar->crc_calculated = crc32(rar->crc_calculated, *buff, *size); + rar->crc_calculated = crc32(rar->crc_calculated, *buff, + (unsigned)*size); rar->unp_offset = 0; return (ARCHIVE_OK); } @@ -1600,7 +1832,7 @@ read_data_compressed(struct archive_read *a, const void **buff, size_t *size, bs = rar->unp_buffer_size - rar->unp_offset; else bs = (size_t)rar->bytes_uncopied; - ret = copy_from_lzss_window(a, buff, rar->offset, bs); + ret = copy_from_lzss_window(a, buff, rar->offset, (int)bs); if (ret != ARCHIVE_OK) return (ret); rar->offset += bs; @@ -1611,7 +1843,8 @@ read_data_compressed(struct archive_read *a, const void **buff, size_t *size, *offset = rar->offset_outgoing; rar->offset_outgoing += *size; /* Calculate File CRC. */ - rar->crc_calculated = crc32(rar->crc_calculated, *buff, *size); + rar->crc_calculated = crc32(rar->crc_calculated, *buff, + (unsigned)*size); return (ret); } continue; @@ -1728,7 +1961,7 @@ read_data_compressed(struct archive_read *a, const void **buff, size_t *size, bs = rar->unp_buffer_size - rar->unp_offset; else bs = (size_t)rar->bytes_uncopied; - ret = copy_from_lzss_window(a, buff, rar->offset, bs); + ret = copy_from_lzss_window(a, buff, rar->offset, (int)bs); if (ret != ARCHIVE_OK) return (ret); rar->offset += bs; @@ -1744,7 +1977,7 @@ read_data_compressed(struct archive_read *a, const void **buff, size_t *size, *offset = rar->offset_outgoing; rar->offset_outgoing += *size; /* Calculate File CRC. */ - rar->crc_calculated = crc32(rar->crc_calculated, *buff, *size); + rar->crc_calculated = crc32(rar->crc_calculated, *buff, (unsigned)*size); return ret; } @@ -1987,17 +2220,21 @@ parse_codes(struct archive_read *a) /* Seems as though dictionary sizes are not used. Even so, minimize * memory usage as much as possible. */ + void *new_window; + unsigned int new_size; + if (rar->unp_size >= DICTIONARY_MAX_SIZE) - rar->dictionary_size = DICTIONARY_MAX_SIZE; + new_size = DICTIONARY_MAX_SIZE; else - rar->dictionary_size = rar_fls((unsigned int)rar->unp_size) << 1; - rar->lzss.window = (unsigned char *)realloc(rar->lzss.window, - rar->dictionary_size); - if (rar->lzss.window == NULL) { + new_size = rar_fls((unsigned int)rar->unp_size) << 1; + new_window = realloc(rar->lzss.window, new_size); + if (new_window == NULL) { archive_set_error(&a->archive, ENOMEM, "Unable to allocate memory for uncompressed data."); return (ARCHIVE_FATAL); } + rar->lzss.window = (unsigned char *)new_window; + rar->dictionary_size = new_size; memset(rar->lzss.window, 0, rar->dictionary_size); rar->lzss.mask = rar->dictionary_size - 1; } @@ -2235,10 +2472,12 @@ add_value(struct archive_read *a, struct huffman_code *code, int value, static int new_node(struct huffman_code *code) { - code->tree = (struct huffman_tree_node *)realloc(code->tree, - (code->numentries + 1) * sizeof(*code->tree)); - if (code->tree == NULL) + void *new_tree; + + new_tree = realloc(code->tree, (code->numentries + 1) * sizeof(*code->tree)); + if (new_tree == NULL) return (-1); + code->tree = (struct huffman_tree_node *)new_tree; code->tree[code->numentries].branches[0] = -1; code->tree[code->numentries].branches[1] = -2; return 1; @@ -2253,8 +2492,8 @@ make_table(struct archive_read *a, struct huffman_code *code) code->tablesize = code->maxlength; code->table = - (struct huffman_table_entry *)malloc(sizeof(*code->table) - * (1 << code->tablesize)); + (struct huffman_table_entry *)calloc(1, sizeof(*code->table) + * ((size_t)1 << code->tablesize)); return make_table_recurse(a, code, 0, code->table, 0, code->tablesize); } @@ -2586,3 +2825,34 @@ copy_from_lzss_window(struct archive_read *a, const void **buffer, *buffer = NULL; return (ARCHIVE_OK); } + +static const void * +rar_read_ahead(struct archive_read *a, size_t min, ssize_t *avail) +{ + struct rar *rar = (struct rar *)(a->format->data); + const void *h = __archive_read_ahead(a, min, avail); + int ret; + if (avail) + { + if (a->read_data_is_posix_read && *avail > (ssize_t)a->read_data_requested) + *avail = a->read_data_requested; + if (*avail > rar->bytes_remaining) + *avail = (ssize_t)rar->bytes_remaining; + if (*avail < 0) + return NULL; + else if (*avail == 0 && rar->main_flags & MHD_VOLUME && + rar->file_flags & FHD_SPLIT_AFTER) + { + ret = archive_read_format_rar_read_header(a, a->entry); + if (ret == (ARCHIVE_EOF)) + { + rar->has_endarc_header = 1; + ret = archive_read_format_rar_read_header(a, a->entry); + } + if (ret != (ARCHIVE_OK)) + return NULL; + return rar_read_ahead(a, min, avail); + } + } + return h; +} diff --git a/libarchive/archive_read_support_format_raw.c b/libarchive/archive_read_support_format_raw.c index df2c00c96c32..843497878a36 100644 --- a/libarchive/archive_read_support_format_raw.c +++ b/libarchive/archive_read_support_format_raw.c @@ -77,6 +77,7 @@ archive_read_support_format_raw(struct archive *_a) archive_read_format_raw_read_header, archive_read_format_raw_read_data, archive_read_format_raw_read_data_skip, + NULL, archive_read_format_raw_cleanup); if (r != ARCHIVE_OK) free(info); @@ -157,7 +158,7 @@ archive_read_format_raw_read_data(struct archive_read *a, /* Record and return an error. */ *size = 0; *offset = info->offset; - return (avail); + return ((int)avail); } } diff --git a/libarchive/archive_read_support_format_tar.c b/libarchive/archive_read_support_format_tar.c index 4538331f3d05..e9523cb687c8 100644 --- a/libarchive/archive_read_support_format_tar.c +++ b/libarchive/archive_read_support_format_tar.c @@ -210,10 +210,10 @@ static int read_body_to_string(struct archive_read *, struct tar *, struct archive_string *, const void *h, size_t *); static int solaris_sparse_parse(struct archive_read *, struct tar *, struct archive_entry *, const char *); -static int64_t tar_atol(const char *, unsigned); -static int64_t tar_atol10(const char *, unsigned); -static int64_t tar_atol256(const char *, unsigned); -static int64_t tar_atol8(const char *, unsigned); +static int64_t tar_atol(const char *, size_t); +static int64_t tar_atol10(const char *, size_t); +static int64_t tar_atol256(const char *, size_t); +static int64_t tar_atol8(const char *, size_t); static int tar_read_header(struct archive_read *, struct tar *, struct archive_entry *, size_t *); static int tohex(int c); @@ -253,6 +253,7 @@ archive_read_support_format_tar(struct archive *_a) archive_read_format_tar_read_header, archive_read_format_tar_read_data, archive_read_format_tar_skip, + NULL, archive_read_format_tar_cleanup); if (r != ARCHIVE_OK) @@ -616,13 +617,14 @@ tar_read_header(struct archive_read *a, struct tar *tar, int err; const char *h; const struct archive_entry_header_ustar *header; + const struct archive_entry_header_gnutar *gnuheader; tar_flush_unconsumed(a, unconsumed); /* Read 512-byte header record */ h = __archive_read_ahead(a, 512, &bytes); if (bytes < 0) - return (bytes); + return ((int)bytes); if (bytes == 0) { /* EOF at a block boundary. */ /* Some writers do omit the block of nulls. */ return (ARCHIVE_EOF); @@ -703,7 +705,8 @@ tar_read_header(struct archive_read *a, struct tar *tar, err = header_pax_extensions(a, tar, entry, h, unconsumed); break; default: - if (memcmp(header->magic, "ustar \0", 8) == 0) { + gnuheader = (const struct archive_entry_header_gnutar *)h; + if (memcmp(gnuheader->magic, "ustar \0", 8) == 0) { a->archive.archive_format = ARCHIVE_FORMAT_TAR_GNUTAR; a->archive.archive_format_name = "GNU tar format"; err = header_gnutar(a, tar, entry, h, unconsumed); @@ -752,7 +755,7 @@ tar_read_header(struct archive_read *a, struct tar *tar, bytes_read = gnu_sparse_10_read(a, tar, unconsumed); tar->entry_bytes_remaining -= bytes_read; if (bytes_read < 0) - return (bytes_read); + return ((int)bytes_read); } else { archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, @@ -2390,7 +2393,7 @@ solaris_sparse_parse(struct archive_read *a, struct tar *tar, * On read, this implementation supports both extensions. */ static int64_t -tar_atol(const char *p, unsigned char_cnt) +tar_atol(const char *p, size_t char_cnt) { /* * Technically, GNU tar considers a field to be in base-256 @@ -2407,70 +2410,55 @@ tar_atol(const char *p, unsigned char_cnt) * it does obey locale. */ static int64_t -tar_atol8(const char *p, unsigned char_cnt) +tar_atol_base_n(const char *p, size_t char_cnt, int base) { int64_t l, limit, last_digit_limit; - int digit, sign, base; + int digit, sign; - base = 8; limit = INT64_MAX / base; last_digit_limit = INT64_MAX % base; - while (*p == ' ' || *p == '\t') + /* the pointer will not be dereferenced if char_cnt is zero + * due to the way the && operator is evaulated. + */ + while (char_cnt != 0 && (*p == ' ' || *p == '\t')) { p++; - if (*p == '-') { + char_cnt--; + } + + sign = 1; + if (char_cnt != 0 && *p == '-') { sign = -1; p++; - } else - sign = 1; + char_cnt--; + } l = 0; - digit = *p - '0'; - while (digit >= 0 && digit < base && char_cnt-- > 0) { - if (l>limit || (l == limit && digit > last_digit_limit)) { - l = INT64_MAX; /* Truncate on overflow. */ - break; + if (char_cnt != 0) { + digit = *p - '0'; + while (digit >= 0 && digit < base && char_cnt != 0) { + if (l>limit || (l == limit && digit > last_digit_limit)) { + l = INT64_MAX; /* Truncate on overflow. */ + break; + } + l = (l * base) + digit; + digit = *++p - '0'; + char_cnt--; } - l = (l * base) + digit; - digit = *++p - '0'; } return (sign < 0) ? -l : l; } -/* - * Note that this implementation does not (and should not!) obey - * locale settings; you cannot simply substitute strtol here, since - * it does obey locale. - */ static int64_t -tar_atol10(const char *p, unsigned char_cnt) +tar_atol8(const char *p, size_t char_cnt) { - int64_t l, limit, last_digit_limit; - int base, digit, sign; + return tar_atol_base_n(p, char_cnt, 8); +} - base = 10; - limit = INT64_MAX / base; - last_digit_limit = INT64_MAX % base; - - while (*p == ' ' || *p == '\t') - p++; - if (*p == '-') { - sign = -1; - p++; - } else - sign = 1; - - l = 0; - digit = *p - '0'; - while (digit >= 0 && digit < base && char_cnt-- > 0) { - if (l > limit || (l == limit && digit > last_digit_limit)) { - l = INT64_MAX; /* Truncate on overflow. */ - break; - } - l = (l * base) + digit; - digit = *++p - '0'; - } - return (sign < 0) ? -l : l; +static int64_t +tar_atol10(const char *p, size_t char_cnt) +{ + return tar_atol_base_n(p, char_cnt, 10); } /* @@ -2479,7 +2467,7 @@ tar_atol10(const char *p, unsigned char_cnt) * ignored. */ static int64_t -tar_atol256(const char *_p, unsigned char_cnt) +tar_atol256(const char *_p, size_t char_cnt) { int64_t l, upper_limit, lower_limit; const unsigned char *p = (const unsigned char *)_p; diff --git a/libarchive/archive_read_support_format_xar.c b/libarchive/archive_read_support_format_xar.c index 733011c262fe..780e749d7096 100644 --- a/libarchive/archive_read_support_format_xar.c +++ b/libarchive/archive_read_support_format_xar.c @@ -467,6 +467,7 @@ archive_read_support_format_xar(struct archive *_a) xar_read_header, xar_read_data, xar_read_data_skip, + NULL, xar_cleanup); if (r != ARCHIVE_OK) free(xar); diff --git a/libarchive/archive_read_support_format_zip.c b/libarchive/archive_read_support_format_zip.c index 2055313a46b7..450a6f7da519 100644 --- a/libarchive/archive_read_support_format_zip.c +++ b/libarchive/archive_read_support_format_zip.c @@ -57,6 +57,7 @@ struct zip_entry { int64_t gid; int64_t uid; struct archive_entry *entry; + struct archive_string rsrcname; time_t mtime; time_t atime; time_t ctime; @@ -69,6 +70,7 @@ struct zip_entry { struct zip { /* Structural information about the archive. */ + int64_t end_of_central_directory_offset; int64_t central_directory_offset; size_t central_directory_size; size_t central_directory_entries; @@ -80,6 +82,7 @@ struct zip { struct zip_entry *zip_entries; struct zip_entry *entry; struct archive_rb_tree tree; + struct archive_rb_tree tree_rsrc; size_t unconsumed; @@ -120,29 +123,33 @@ struct zip { #define ZIP_STRONG_ENCRYPTED (1<<6) #define ZIP_UTF8_NAME (1<<11) -static int archive_read_format_zip_streamable_bid(struct archive_read *, int); -static int archive_read_format_zip_seekable_bid(struct archive_read *, int); +static int archive_read_format_zip_streamable_bid(struct archive_read *, + int); +static int archive_read_format_zip_seekable_bid(struct archive_read *, + int); static int archive_read_format_zip_options(struct archive_read *, const char *, const char *); static int archive_read_format_zip_cleanup(struct archive_read *); static int archive_read_format_zip_read_data(struct archive_read *, const void **, size_t *, int64_t *); static int archive_read_format_zip_read_data_skip(struct archive_read *a); -static int archive_read_format_zip_seekable_read_header(struct archive_read *, - struct archive_entry *); -static int archive_read_format_zip_streamable_read_header(struct archive_read *, - struct archive_entry *); +static int archive_read_format_zip_seekable_read_header( + struct archive_read *, struct archive_entry *); +static int archive_read_format_zip_streamable_read_header( + struct archive_read *, struct archive_entry *); +static ssize_t zip_get_local_file_header_size(struct archive_read *, size_t); #ifdef HAVE_ZLIB_H +static int zip_deflate_init(struct archive_read *, struct zip *); static int zip_read_data_deflate(struct archive_read *a, const void **buff, size_t *size, int64_t *offset); #endif static int zip_read_data_none(struct archive_read *a, const void **buff, size_t *size, int64_t *offset); static int zip_read_local_file_header(struct archive_read *a, - struct archive_entry *entry, struct zip *); + struct archive_entry *entry, struct zip *); static time_t zip_time(const char *); static const char *compression_name(int compression); -static void process_extra(const char *, size_t, struct zip_entry *); +static void process_extra(const char *, size_t, struct zip_entry *); int archive_read_support_format_zip_streamable(struct archive *); int archive_read_support_format_zip_seekable(struct archive *); @@ -173,6 +180,7 @@ archive_read_support_format_zip_streamable(struct archive *_a) archive_read_format_zip_streamable_read_header, archive_read_format_zip_read_data, archive_read_format_zip_read_data_skip, + NULL, archive_read_format_zip_cleanup); if (r != ARCHIVE_OK) @@ -206,6 +214,7 @@ archive_read_support_format_zip_seekable(struct archive *_a) archive_read_format_zip_seekable_read_header, archive_read_format_zip_read_data, archive_read_format_zip_read_data_skip, + NULL, archive_read_format_zip_cleanup); if (r != ARCHIVE_OK) @@ -255,8 +264,48 @@ archive_read_format_zip_seekable_bid(struct archive_read *a, int best_bid) /* First four bytes are signature for end of central directory record. Four zero bytes ensure this isn't a multi-volume Zip file (which we don't yet support). */ - if (memcmp(p, "PK\005\006\000\000\000\000", 8) != 0) - return 0; + if (memcmp(p, "PK\005\006\000\000\000\000", 8) != 0) { + int64_t i, tail; + int found; + + /* + * If there is a comment in end of central directory + * record, 22 bytes are too short. we have to read more + * to properly detect the record. Hopefully, a length + * of the comment is not longer than 16362 bytes(16K-22). + */ + if (filesize + 22 > 1024 * 16) { + tail = 1024 * 16; + filesize = __archive_read_seek(a, tail * -1, SEEK_END); + } else { + tail = filesize + 22; + filesize = __archive_read_seek(a, 0, SEEK_SET); + } + if (filesize < 0) + return 0; + if ((p = __archive_read_ahead(a, (size_t)tail, NULL)) == NULL) + return 0; + for (found = 0, i = 0;!found && i < tail - 22;) { + switch (p[i]) { + case 'P': + if (memcmp(p+i, + "PK\005\006\000\000\000\000", 8) == 0) { + p += i; + filesize += tail - + (22 + archive_le16dec(p+20)); + found = 1; + } else + i += 8; + break; + case 'K': i += 7; break; + case 005: i += 6; break; + case 006: i += 5; break; + default: i += 1; break; + } + } + if (!found) + return 0; + } /* Since we've already done the hard work of finding the end of central directory record, let's save the important @@ -264,12 +313,14 @@ archive_read_format_zip_seekable_bid(struct archive_read *a, int best_bid) zip->central_directory_entries = archive_le16dec(p + 10); zip->central_directory_size = archive_le32dec(p + 12); zip->central_directory_offset = archive_le32dec(p + 16); + zip->end_of_central_directory_offset = filesize; /* Just one volume, so central dir must all be on this volume. */ if (zip->central_directory_entries != archive_le16dec(p + 8)) return 0; /* Central directory can't extend beyond end of this file. */ - if (zip->central_directory_offset + (int64_t)zip->central_directory_size > filesize) + if (zip->central_directory_offset + + (int64_t)zip->central_directory_size > filesize) return 0; /* This is just a tiny bit higher than the maximum returned by @@ -296,17 +347,92 @@ cmp_key(const struct archive_rb_node *n, const void *key) return 1; } +static int +rsrc_cmp_node(const struct archive_rb_node *n1, + const struct archive_rb_node *n2) +{ + const struct zip_entry *e1 = (const struct zip_entry *)n1; + const struct zip_entry *e2 = (const struct zip_entry *)n2; + + return (strcmp(e2->rsrcname.s, e1->rsrcname.s)); +} + +static int +rsrc_cmp_key(const struct archive_rb_node *n, const void *key) +{ + const struct zip_entry *e = (const struct zip_entry *)n; + return (strcmp((const char *)key, e->rsrcname.s)); +} + +static const char * +rsrc_basename(const char *name, size_t name_length) +{ + const char *s, *r; + + r = s = name; + for (;;) { + s = memchr(s, '/', name_length - (s - name)); + if (s == NULL) + break; + r = ++s; + } + return (r); +} + +static void +expose_parent_dirs(struct zip *zip, const char *name, size_t name_length) +{ + struct archive_string str; + struct zip_entry *dir; + char *s; + + archive_string_init(&str); + archive_strncpy(&str, name, name_length); + for (;;) { + s = strrchr(str.s, '/'); + if (s == NULL) + break; + *s = '\0'; + /* Transfer the parent directory from zip->tree_rsrc RB + * tree to zip->tree RB tree to expose. */ + dir = (struct zip_entry *) + __archive_rb_tree_find_node(&zip->tree_rsrc, str.s); + if (dir == NULL) + break; + __archive_rb_tree_remove_node(&zip->tree_rsrc, &dir->node); + archive_string_free(&dir->rsrcname); + __archive_rb_tree_insert_node(&zip->tree, &dir->node); + } + archive_string_free(&str); +} + static int slurp_central_directory(struct archive_read *a, struct zip *zip) { unsigned i; + int64_t correction; static const struct archive_rb_tree_ops rb_ops = { &cmp_node, &cmp_key }; + static const struct archive_rb_tree_ops rb_rsrc_ops = { + &rsrc_cmp_node, &rsrc_cmp_key + }; + + /* + * Consider the archive file we are reading may be SFX. + * So we have to calculate a SFX header size to revise + * ZIP header offsets. + */ + correction = zip->end_of_central_directory_offset - + (zip->central_directory_offset + zip->central_directory_size); + /* The central directory offset is relative value, and so + * we revise this offset for SFX. */ + zip->central_directory_offset += correction; __archive_read_seek(a, zip->central_directory_offset, SEEK_SET); zip->offset = zip->central_directory_offset; __archive_rb_tree_init(&zip->tree, &rb_ops); + __archive_rb_tree_init(&zip->tree_rsrc, &rb_rsrc_ops); zip->zip_entries = calloc(zip->central_directory_entries, sizeof(struct zip_entry)); @@ -314,7 +440,7 @@ slurp_central_directory(struct archive_read *a, struct zip *zip) struct zip_entry *zip_entry = &zip->zip_entries[i]; size_t filename_length, extra_length, comment_length; uint32_t external_attributes; - const char *p; + const char *name, *p, *r; if ((p = __archive_read_ahead(a, 46, NULL)) == NULL) return ARCHIVE_FATAL; @@ -339,7 +465,8 @@ slurp_central_directory(struct archive_read *a, struct zip *zip) /* disk_start = archive_le16dec(p + 34); */ /* Better be zero. */ /* internal_attributes = archive_le16dec(p + 36); */ /* text bit */ external_attributes = archive_le32dec(p + 38); - zip_entry->local_header_offset = archive_le32dec(p + 42); + zip_entry->local_header_offset = + archive_le32dec(p + 42) + correction; /* If we can't guess the mode, leave it zero here; when we read the local file header we might get @@ -348,8 +475,50 @@ slurp_central_directory(struct archive_read *a, struct zip *zip) if (zip_entry->system == 3) { zip_entry->mode = external_attributes >> 16; } - /* Register an entry to RB tree to sort it by file offset. */ - __archive_rb_tree_insert_node(&zip->tree, &zip_entry->node); + + /* + * Mac resource fork files are stored under the + * "__MACOSX/" directory, so we should check if + * it is. + */ + /* Make sure we have the file name. */ + if ((p = __archive_read_ahead(a, 46 + filename_length, NULL)) + == NULL) + return ARCHIVE_FATAL; + name = p + 46; + r = rsrc_basename(name, filename_length); + if (filename_length >= 9 && + strncmp("__MACOSX/", name, 9) == 0) { + /* If this file is not a resource fork nor + * a directory. We should treat it as a non + * resource fork file to expose it. */ + if (name[filename_length-1] != '/' && + (r - name < 3 || r[0] != '.' || r[1] != '_')) { + __archive_rb_tree_insert_node(&zip->tree, + &zip_entry->node); + /* Expose its parent directories. */ + expose_parent_dirs(zip, name, filename_length); + } else { + /* This file is a resource fork file or + * a directory. */ + archive_strncpy(&(zip_entry->rsrcname), name, + filename_length); + __archive_rb_tree_insert_node(&zip->tree_rsrc, + &zip_entry->node); + } + } else { + /* Generate resource fork name to find its resource + * file at zip->tree_rsrc. */ + archive_strcpy(&(zip_entry->rsrcname), "__MACOSX/"); + archive_strncat(&(zip_entry->rsrcname), name, r - name); + archive_strcat(&(zip_entry->rsrcname), "._"); + archive_strncat(&(zip_entry->rsrcname), + name + (r - name), filename_length - (r - name)); + /* Register an entry to RB tree to sort it by + * file offset. */ + __archive_rb_tree_insert_node(&zip->tree, + &zip_entry->node); + } /* We don't read the filename until we get to the local file header. Reading it here would speed up @@ -378,11 +547,150 @@ zip_read_consume(struct archive_read *a, int64_t bytes) return (skip); } +static int +zip_read_mac_metadata(struct archive_read *a, struct archive_entry *entry, + struct zip_entry *rsrc) +{ + struct zip *zip = (struct zip *)a->format->data; + unsigned char *metadata, *mp; + int64_t offset = zip->offset; + size_t remaining_bytes, metadata_bytes; + ssize_t hsize; + int ret = ARCHIVE_OK, eof; + + switch(rsrc->compression) { + case 0: /* No compression. */ +#ifdef HAVE_ZLIB_H + case 8: /* Deflate compression. */ +#endif + break; + default: /* Unsupported compression. */ + /* Return a warning. */ + archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT, + "Unsupported ZIP compression method (%s)", + compression_name(rsrc->compression)); + /* We can't decompress this entry, but we will + * be able to skip() it and try the next entry. */ + return (ARCHIVE_WARN); + } + + if (rsrc->uncompressed_size > (128 * 1024)) { + archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT, + "Mac metadata is too large: %jd > 128K bytes", + (intmax_t)rsrc->uncompressed_size); + return (ARCHIVE_WARN); + } + + metadata = malloc((size_t)rsrc->uncompressed_size); + if (metadata == NULL) { + archive_set_error(&a->archive, ENOMEM, + "Can't allocate memory for Mac metadata"); + return (ARCHIVE_FATAL); + } + + if (zip->offset < rsrc->local_header_offset) + zip_read_consume(a, rsrc->local_header_offset - zip->offset); + else if (zip->offset != rsrc->local_header_offset) { + __archive_read_seek(a, rsrc->local_header_offset, SEEK_SET); + zip->offset = zip->entry->local_header_offset; + } + + hsize = zip_get_local_file_header_size(a, 0); + zip_read_consume(a, hsize); + + remaining_bytes = (size_t)rsrc->compressed_size; + metadata_bytes = (size_t)rsrc->uncompressed_size; + mp = metadata; + eof = 0; + while (!eof && remaining_bytes) { + const unsigned char *p; + ssize_t bytes_avail; + size_t bytes_used; + + p = __archive_read_ahead(a, 1, &bytes_avail); + if (p == NULL) { + archive_set_error(&a->archive, + ARCHIVE_ERRNO_FILE_FORMAT, + "Truncated ZIP file header"); + ret = ARCHIVE_WARN; + goto exit_mac_metadata; + } + if ((size_t)bytes_avail > remaining_bytes) + bytes_avail = remaining_bytes; + switch(rsrc->compression) { + case 0: /* No compression. */ + memcpy(mp, p, bytes_avail); + bytes_used = (size_t)bytes_avail; + metadata_bytes -= bytes_used; + mp += bytes_used; + if (metadata_bytes == 0) + eof = 1; + break; +#ifdef HAVE_ZLIB_H + case 8: /* Deflate compression. */ + { + int r; + + ret = zip_deflate_init(a, zip); + if (ret != ARCHIVE_OK) + goto exit_mac_metadata; + zip->stream.next_in = + (Bytef *)(uintptr_t)(const void *)p; + zip->stream.avail_in = (uInt)bytes_avail; + zip->stream.total_in = 0; + zip->stream.next_out = mp; + zip->stream.avail_out = (uInt)metadata_bytes; + zip->stream.total_out = 0; + + r = inflate(&zip->stream, 0); + switch (r) { + case Z_OK: + break; + case Z_STREAM_END: + eof = 1; + break; + case Z_MEM_ERROR: + archive_set_error(&a->archive, ENOMEM, + "Out of memory for ZIP decompression"); + ret = ARCHIVE_FATAL; + goto exit_mac_metadata; + default: + archive_set_error(&a->archive, + ARCHIVE_ERRNO_MISC, + "ZIP decompression failed (%d)", r); + ret = ARCHIVE_FATAL; + goto exit_mac_metadata; + } + bytes_used = zip->stream.total_in; + metadata_bytes -= zip->stream.total_out; + mp += zip->stream.total_out; + break; + } +#endif + default: + bytes_used = 0; + break; + } + zip_read_consume(a, bytes_used); + remaining_bytes -= bytes_used; + } + archive_entry_copy_mac_metadata(entry, metadata, + (size_t)rsrc->uncompressed_size - metadata_bytes); + + __archive_read_seek(a, offset, SEEK_SET); + zip->offset = offset; +exit_mac_metadata: + zip->decompress_init = 0; + free(metadata); + return (ret); +} + static int archive_read_format_zip_seekable_read_header(struct archive_read *a, struct archive_entry *entry) { struct zip *zip = (struct zip *)a->format->data; + struct zip_entry *rsrc; int r, ret = ARCHIVE_OK; a->archive.archive_format = ARCHIVE_FORMAT_ZIP; @@ -408,7 +716,19 @@ archive_read_format_zip_seekable_read_header(struct archive_read *a, return ARCHIVE_EOF; --zip->entries_remaining; - if (zip->offset != zip->entry->local_header_offset) { + if (zip->entry->rsrcname.s) + rsrc = (struct zip_entry *)__archive_rb_tree_find_node( + &zip->tree_rsrc, zip->entry->rsrcname.s); + else + rsrc = NULL; + + /* File entries are sorted by the header offset, we should mostly + * use zip_read_consume to advance a read point to avoid redundant + * data reading. */ + if (zip->offset < zip->entry->local_header_offset) + zip_read_consume(a, + zip->entry->local_header_offset - zip->offset); + else if (zip->offset != zip->entry->local_header_offset) { __archive_read_seek(a, zip->entry->local_header_offset, SEEK_SET); zip->offset = zip->entry->local_header_offset; @@ -463,6 +783,11 @@ archive_read_format_zip_seekable_read_header(struct archive_read *a, } } } + if (rsrc) { + int ret2 = zip_read_mac_metadata(a, entry, rsrc); + if (ret2 < ret) + ret = ret2; + } return (ret); } @@ -513,7 +838,8 @@ archive_read_format_zip_options(struct archive_read *a, } else if (strcmp(key, "hdrcharset") == 0) { if (val == NULL || val[0] == 0) archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, - "zip: hdrcharset option needs a character-set name"); + "zip: hdrcharset option needs a character-set name" + ); else { zip->sconv = archive_string_conversion_from_charset( &a->archive, val, 0); @@ -549,7 +875,8 @@ archive_read_format_zip_streamable_read_header(struct archive_read *a, if (zip->zip_entries == NULL) { zip->zip_entries = malloc(sizeof(struct zip_entry)); if (zip->zip_entries == NULL) { - archive_set_error(&a->archive, ENOMEM, "Out of memory"); + archive_set_error(&a->archive, ENOMEM, + "Out of memory"); return ARCHIVE_FATAL; } } @@ -578,7 +905,8 @@ archive_read_format_zip_streamable_read_header(struct archive_read *a, if (p[2] == '\003' && p[3] == '\004') { /* Regular file entry. */ zip_read_consume(a, skipped); - return zip_read_local_file_header(a, entry, zip); + return zip_read_local_file_header(a, + entry, zip); } if (p[2] == '\005' && p[3] == '\006') @@ -592,6 +920,29 @@ archive_read_format_zip_streamable_read_header(struct archive_read *a, } } +static ssize_t +zip_get_local_file_header_size(struct archive_read *a, size_t extra) +{ + const char *p; + ssize_t filename_length, extra_length; + + if ((p = __archive_read_ahead(a, extra + 30, NULL)) == NULL) { + archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT, + "Truncated ZIP file header"); + return (ARCHIVE_WARN); + } + p += extra; + + if (memcmp(p, "PK\003\004", 4) != 0) { + archive_set_error(&a->archive, -1, "Damaged Zip archive"); + return ARCHIVE_WARN; + } + filename_length = archive_le16dec(p + 26); + extra_length = archive_le16dec(p + 28); + + return (30 + filename_length + extra_length); +} + /* * Assumes file pointer is at beginning of local file header. */ @@ -648,8 +999,8 @@ zip_read_local_file_header(struct archive_read *a, struct archive_entry *entry, zip_read_consume(a, 30); if (zip->have_central_directory) { - /* If we read the central dir entry, we must have size information - as well, so ignore the length-at-end flag. */ + /* If we read the central dir entry, we must have size + * information as well, so ignore the length-at-end flag. */ zip_entry->flags &= ~ZIP_LENGTH_AT_END; /* If we have values from both the local file header and the central directory, warn about mismatches @@ -657,19 +1008,22 @@ zip_read_local_file_header(struct archive_read *a, struct archive_entry *entry, writers always put zero in the local header; don't bother warning about that. */ if (local_crc32 != 0 && local_crc32 != zip_entry->crc32) { - archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT, + archive_set_error(&a->archive, + ARCHIVE_ERRNO_FILE_FORMAT, "Inconsistent CRC32 values"); ret = ARCHIVE_WARN; } if (compressed_size != 0 && compressed_size != zip_entry->compressed_size) { - archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT, + archive_set_error(&a->archive, + ARCHIVE_ERRNO_FILE_FORMAT, "Inconsistent compressed size"); ret = ARCHIVE_WARN; } if (uncompressed_size != 0 && uncompressed_size != zip_entry->uncompressed_size) { - archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT, + archive_set_error(&a->archive, + ARCHIVE_ERRNO_FILE_FORMAT, "Inconsistent uncompressed size"); ret = ARCHIVE_WARN; } @@ -868,13 +1222,16 @@ archive_read_format_zip_read_data(struct archive_read *a, return (r); /* Update checksum */ if (*size) - zip->entry_crc32 = crc32(zip->entry_crc32, *buff, *size); + zip->entry_crc32 = crc32(zip->entry_crc32, *buff, + (unsigned)*size); /* If we hit the end, swallow any end-of-data marker. */ if (zip->end_of_entry) { /* Check file size, CRC against these values. */ - if (zip->entry->compressed_size != zip->entry_compressed_bytes_read) { + if (zip->entry->compressed_size != + zip->entry_compressed_bytes_read) { archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, - "ZIP compressed data is wrong size (read %jd, expected %jd)", + "ZIP compressed data is wrong size " + "(read %jd, expected %jd)", (intmax_t)zip->entry_compressed_bytes_read, (intmax_t)zip->entry->compressed_size); return (ARCHIVE_WARN); @@ -884,7 +1241,8 @@ archive_read_format_zip_read_data(struct archive_read *a, if ((zip->entry->uncompressed_size & UINT32_MAX) != (zip->entry_uncompressed_bytes_read & UINT32_MAX)) { archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, - "ZIP uncompressed data is wrong size (read %jd, expected %jd)", + "ZIP uncompressed data is wrong size " + "(read %jd, expected %jd)", (intmax_t)zip->entry_uncompressed_bytes_read, (intmax_t)zip->entry->uncompressed_size); return (ARCHIVE_WARN); @@ -947,7 +1305,8 @@ zip_read_data_none(struct archive_read *a, const void **_buff, that are longer than this, so a failure to get at least 16 bytes really does indicate a truncated file. */ - archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT, + archive_set_error(&a->archive, + ARCHIVE_ERRNO_FILE_FORMAT, "Truncated ZIP file data"); return (ARCHIVE_FATAL); } @@ -956,8 +1315,10 @@ zip_read_data_none(struct archive_read *a, const void **_buff, if (p[0] == 'P' && p[1] == 'K' && p[2] == '\007' && p[3] == '\010' && archive_le32dec(p + 4) == zip->entry_crc32 - && archive_le32dec(p + 8) == zip->entry_compressed_bytes_read - && archive_le32dec(p + 12) == zip->entry_uncompressed_bytes_read) { + && archive_le32dec(p + 8) == + zip->entry_compressed_bytes_read + && archive_le32dec(p + 12) == + zip->entry_uncompressed_bytes_read) { zip->entry->crc32 = archive_le32dec(p + 4); zip->entry->compressed_size = archive_le32dec(p + 8); zip->entry->uncompressed_size = archive_le32dec(p + 12); @@ -968,9 +1329,10 @@ zip_read_data_none(struct archive_read *a, const void **_buff, /* If not at EOF, ensure we consume at least one byte. */ ++p; - /* Scan forward until we see where a PK\007\010 signature might be. */ - /* Return bytes up until that point. On the next call, the code - above will verify the data descriptor. */ + /* Scan forward until we see where a PK\007\010 signature + * might be. */ + /* Return bytes up until that point. On the next call, + * the code above will verify the data descriptor. */ while (p < buff + bytes_avail - 4) { if (p[3] == 'P') { p += 3; } else if (p[3] == 'K') { p += 2; } @@ -989,7 +1351,8 @@ zip_read_data_none(struct archive_read *a, const void **_buff, /* Grab a bunch of bytes. */ buff = __archive_read_ahead(a, 1, &bytes_avail); if (bytes_avail <= 0) { - archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT, + archive_set_error(&a->archive, + ARCHIVE_ERRNO_FILE_FORMAT, "Truncated ZIP file data"); return (ARCHIVE_FATAL); } @@ -1006,6 +1369,31 @@ zip_read_data_none(struct archive_read *a, const void **_buff, } #ifdef HAVE_ZLIB_H +static int +zip_deflate_init(struct archive_read *a, struct zip *zip) +{ + int r; + + /* If we haven't yet read any data, initialize the decompressor. */ + if (!zip->decompress_init) { + if (zip->stream_valid) + r = inflateReset(&zip->stream); + else + r = inflateInit2(&zip->stream, + -15 /* Don't check for zlib header */); + if (r != Z_OK) { + archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, + "Can't initialize ZIP decompression."); + return (ARCHIVE_FATAL); + } + /* Stream structure has been set up. */ + zip->stream_valid = 1; + /* We've initialized decompression for this stream. */ + zip->decompress_init = 1; + } + return (ARCHIVE_OK); +} + static int zip_read_data_deflate(struct archive_read *a, const void **buff, size_t *size, int64_t *offset) @@ -1031,23 +1419,9 @@ zip_read_data_deflate(struct archive_read *a, const void **buff, } } - /* If we haven't yet read any data, initialize the decompressor. */ - if (!zip->decompress_init) { - if (zip->stream_valid) - r = inflateReset(&zip->stream); - else - r = inflateInit2(&zip->stream, - -15 /* Don't check for zlib header */); - if (r != Z_OK) { - archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, - "Can't initialize ZIP decompression."); - return (ARCHIVE_FATAL); - } - /* Stream structure has been set up. */ - zip->stream_valid = 1; - /* We've initialized decompression for this stream. */ - zip->decompress_init = 1; - } + r = zip_deflate_init(a, zip); + if (r != ARCHIVE_OK) + return (r); /* * Note: '1' here is a performance optimization. @@ -1073,10 +1447,10 @@ zip_read_data_deflate(struct archive_read *a, const void **buff, * cast to remove 'const'. */ zip->stream.next_in = (Bytef *)(uintptr_t)(const void *)compressed_buff; - zip->stream.avail_in = bytes_avail; + zip->stream.avail_in = (uInt)bytes_avail; zip->stream.total_in = 0; zip->stream.next_out = zip->uncompressed_buffer; - zip->stream.avail_out = zip->uncompressed_buffer_size; + zip->stream.avail_out = (uInt)zip->uncompressed_buffer_size; zip->stream.total_out = 0; r = inflate(&zip->stream, 0); @@ -1116,7 +1490,8 @@ zip_read_data_deflate(struct archive_read *a, const void **buff, return (ARCHIVE_FATAL); } /* Consume the optional PK\007\010 marker. */ - if (p[0] == 'P' && p[1] == 'K' && p[2] == '\007' && p[3] == '\010') { + if (p[0] == 'P' && p[1] == 'K' && + p[2] == '\007' && p[3] == '\010') { zip->entry->crc32 = archive_le32dec(p + 4); zip->entry->compressed_size = archive_le32dec(p + 8); zip->entry->uncompressed_size = archive_le32dec(p + 12); @@ -1176,7 +1551,8 @@ archive_read_format_zip_read_data_skip(struct archive_read *a) ssize_t bytes_avail; buff = __archive_read_ahead(a, 16, &bytes_avail); if (bytes_avail < 16) { - archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT, + archive_set_error(&a->archive, + ARCHIVE_ERRNO_FILE_FORMAT, "Truncated ZIP file data"); return (ARCHIVE_FATAL); } @@ -1206,6 +1582,11 @@ archive_read_format_zip_cleanup(struct archive_read *a) if (zip->stream_valid) inflateEnd(&zip->stream); #endif + if (zip->zip_entries && zip->central_directory_entries) { + unsigned i; + for (i = 0; i < zip->central_directory_entries; i++) + archive_string_free(&(zip->zip_entries[i].rsrcname)); + } free(zip->zip_entries); free(zip->uncompressed_buffer); archive_string_free(&(zip->extra)); @@ -1288,11 +1669,14 @@ process_extra(const char *p, size_t extra_length, struct zip_entry* zip_entry) /* Info-ZIP Unix Extra Field (old version) "UX". */ if (datasize >= 8) { zip_entry->atime = archive_le32dec(p + offset); - zip_entry->mtime = archive_le32dec(p + offset + 4); + zip_entry->mtime = + archive_le32dec(p + offset + 4); } if (datasize >= 12) { - zip_entry->uid = archive_le16dec(p + offset + 8); - zip_entry->gid = archive_le16dec(p + offset + 10); + zip_entry->uid = + archive_le16dec(p + offset + 8); + zip_entry->gid = + archive_le16dec(p + offset + 10); } break; } @@ -1306,7 +1690,8 @@ process_extra(const char *p, size_t extra_length, struct zip_entry* zip_entry) if (datasize >= 2) zip_entry->uid = archive_le16dec(p + offset); if (datasize >= 4) - zip_entry->gid = archive_le16dec(p + offset + 2); + zip_entry->gid = + archive_le16dec(p + offset + 2); break; case 0x7875: { @@ -1318,22 +1703,26 @@ process_extra(const char *p, size_t extra_length, struct zip_entry* zip_entry) /* get a uid size. */ uidsize = p[offset+1]; if (uidsize == 2) - zip_entry->uid = archive_le16dec( - p + offset + 2); + zip_entry->uid = + archive_le16dec( + p + offset + 2); else if (uidsize == 4 && datasize >= 6) - zip_entry->uid = archive_le32dec( - p + offset + 2); + zip_entry->uid = + archive_le32dec( + p + offset + 2); } if (datasize >= (2 + uidsize + 3)) { /* get a gid size. */ gidsize = p[offset+2+uidsize]; if (gidsize == 2) - zip_entry->gid = archive_le16dec( - p+offset+2+uidsize+1); + zip_entry->gid = + archive_le16dec( + p+offset+2+uidsize+1); else if (gidsize == 4 && datasize >= (2 + uidsize + 5)) - zip_entry->gid = archive_le32dec( - p+offset+2+uidsize+1); + zip_entry->gid = + archive_le32dec( + p+offset+2+uidsize+1); } } break; diff --git a/libarchive/archive_string.c b/libarchive/archive_string.c index 2728a376c669..87f9288f1966 100644 --- a/libarchive/archive_string.c +++ b/libarchive/archive_string.c @@ -486,13 +486,13 @@ archive_wstring_append_from_mbs_in_codepage(struct archive_wstring *dest, * UTF-16BE/LE NFD ===> UTF-16 NFC * UTF-16BE/LE NFC ===> UTF-16 NFD */ - count = utf16nbytes(s, length); + count = (int)utf16nbytes(s, length); } else { /* * UTF-8 NFD ===> UTF-16 NFC * UTF-8 NFC ===> UTF-16 NFD */ - count = mbsnbytes(s, length); + count = (int)mbsnbytes(s, length); } u16.s = (char *)dest->s; u16.length = dest->length << 1;; @@ -507,7 +507,7 @@ archive_wstring_append_from_mbs_in_codepage(struct archive_wstring *dest, sc->flag = saved_flag;/* restore the saved flag. */ return (ret); } else if (sc != NULL && (sc->flag & SCONV_FROM_UTF16)) { - count = utf16nbytes(s, length); + count = (int)utf16nbytes(s, length); count >>= 1; /* to be WCS length */ /* Allocate memory for WCS. */ if (NULL == archive_wstring_ensure(dest, @@ -550,8 +550,8 @@ archive_wstring_append_from_mbs_in_codepage(struct archive_wstring *dest, return (-1); /* Convert MBS to WCS. */ count = MultiByteToWideChar(from_cp, - mbflag, s, length, dest->s + dest->length, - (dest->buffer_length >> 1) -1); + mbflag, s, (int)length, dest->s + dest->length, + (int)(dest->buffer_length >> 1) -1); if (count == 0 && GetLastError() == ERROR_INSUFFICIENT_BUFFER) { /* Expand the WCS buffer. */ @@ -727,7 +727,7 @@ archive_string_append_from_wcs_in_codepage(struct archive_string *as, else dp = &defchar_used; count = WideCharToMultiByte(to_cp, 0, ws, wslen, - as->s + as->length, as->buffer_length-1, NULL, dp); + as->s + as->length, (int)as->buffer_length-1, NULL, dp); if (count == 0 && GetLastError() == ERROR_INSUFFICIENT_BUFFER) { /* Expand the MBS buffer and retry. */ @@ -1120,8 +1120,8 @@ create_sconv_object(const char *fc, const char *tc, } sc->to_charset = strdup(tc); if (sc->to_charset == NULL) { - free(sc); free(sc->from_charset); + free(sc); return (NULL); } archive_string_init(&sc->utftmp); @@ -1997,7 +1997,7 @@ static int iconv_strncat_in_locale(struct archive_string *as, const void *_p, size_t length, struct archive_string_conv *sc) { - ICONV_CONST char *inp; + ICONV_CONST char *itp; size_t remaining; iconv_t cd; char *outp; @@ -2018,12 +2018,12 @@ iconv_strncat_in_locale(struct archive_string *as, const void *_p, return (-1); cd = sc->cd; - inp = (char *)(uintptr_t)_p; + itp = (char *)(uintptr_t)_p; remaining = length; outp = as->s + as->length; avail = as->buffer_length - as->length - to_size; while (remaining >= (size_t)from_size) { - size_t result = iconv(cd, &inp, &remaining, &outp, &avail); + size_t result = iconv(cd, &itp, &remaining, &outp, &avail); if (result != (size_t)-1) break; /* Conversion completed. */ @@ -2065,7 +2065,7 @@ iconv_strncat_in_locale(struct archive_string *as, const void *_p, *outp++ = '?'; avail--; } - inp += from_size; + itp += from_size; remaining -= from_size; return_value = -1; /* failure */ } else { @@ -2145,7 +2145,7 @@ invalid_mbs(const void *_p, size_t n, struct archive_string_conv *sc) if (codepage != CP_UTF8) mbflag |= MB_PRECOMPOSED; - if (MultiByteToWideChar(codepage, mbflag, p, n, NULL, 0) == 0) + if (MultiByteToWideChar(codepage, mbflag, p, (int)n, NULL, 0) == 0) return (-1); /* Invalid */ return (0); /* Okay */ } @@ -2202,8 +2202,8 @@ best_effort_strncat_in_locale(struct archive_string *as, const void *_p, size_t length, struct archive_string_conv *sc) { size_t remaining; - char *outp; - const uint8_t *inp; + char *otp; + const uint8_t *itp; size_t avail; int return_value = 0; /* success */ @@ -2227,41 +2227,41 @@ best_effort_strncat_in_locale(struct archive_string *as, const void *_p, return (-1); remaining = length; - inp = (const uint8_t *)_p; - outp = as->s + as->length; + itp = (const uint8_t *)_p; + otp = as->s + as->length; avail = as->buffer_length - as->length -1; - while (*inp && remaining > 0) { - if (*inp > 127 && (sc->flag & SCONV_TO_UTF8)) { + while (*itp && remaining > 0) { + if (*itp > 127 && (sc->flag & SCONV_TO_UTF8)) { if (avail < UTF8_R_CHAR_SIZE) { - as->length = outp - as->s; + as->length = otp - as->s; if (NULL == archive_string_ensure(as, as->buffer_length + remaining + UTF8_R_CHAR_SIZE)) return (-1); - outp = as->s + as->length; + otp = as->s + as->length; avail = as->buffer_length - as->length -1; } /* * When coping a string in UTF-8, unknown character * should be U+FFFD (replacement character). */ - UTF8_SET_R_CHAR(outp); - outp += UTF8_R_CHAR_SIZE; + UTF8_SET_R_CHAR(otp); + otp += UTF8_R_CHAR_SIZE; avail -= UTF8_R_CHAR_SIZE; - inp++; + itp++; remaining--; return_value = -1; - } else if (*inp > 127) { - *outp++ = '?'; - inp++; + } else if (*itp > 127) { + *otp++ = '?'; + itp++; remaining--; return_value = -1; } else { - *outp++ = (char)*inp++; + *otp++ = (char)*itp++; remaining--; } } - as->length = outp - as->s; + as->length = otp - as->s; as->s[as->length] = '\0'; return (return_value); } @@ -2322,7 +2322,7 @@ _utf8_to_unicode(uint32_t *pwc, const char *s, size_t n) /* Invalide sequence or there are not plenty bytes. */ if ((int)n < cnt) { - cnt = n; + cnt = (int)n; for (i = 1; i < cnt; i++) { if ((s[i] & 0xc0) != 0x80) { cnt = i; @@ -2391,7 +2391,7 @@ _utf8_to_unicode(uint32_t *pwc, const char *s, size_t n) else cnt = 1; if ((int)n < cnt) - cnt = n; + cnt = (int)n; for (i = 1; i < cnt; i++) { if ((s[i] & 0xc0) != 0x80) { cnt = i; @@ -2447,11 +2447,12 @@ combine_surrogate_pair(uint32_t uc, uint32_t uc2) static int cesu8_to_unicode(uint32_t *pwc, const char *s, size_t n) { - uint32_t wc, wc2; + uint32_t wc = 0; int cnt; cnt = _utf8_to_unicode(&wc, s, n); if (cnt == 3 && IS_HIGH_SURROGATE_LA(wc)) { + uint32_t wc2 = 0; if (n - 3 < 3) { /* Invalid byte sequence. */ goto invalid_sequence; @@ -3396,7 +3397,6 @@ archive_string_normalize_D(struct archive_string *as, const void *_p, break; REPLACE_UC_WITH(uc2); n = n2; - ucptr = s; goto check_first_code; } as->length = p - as->s; @@ -3478,9 +3478,9 @@ strncat_from_utf8_libarchive2(struct archive_string *as, * Translates the wide-character into the current locale MBS. */ #if HAVE_WCRTOMB - n = wcrtomb(p, wc, &shift_state); + n = (int)wcrtomb(p, wc, &shift_state); #else - n = wctomb(p, wc); + n = (int)wctomb(p, wc); #endif if (n == -1) return (-1); @@ -3579,13 +3579,13 @@ win_strncat_from_utf16(struct archive_string *as, const void *_p, size_t bytes, do { defchar = 0; ll = WideCharToMultiByte(sc->to_cp, 0, - (LPCWSTR)u16, bytes>>1, mbs, mbs_size, + (LPCWSTR)u16, (int)bytes>>1, mbs, (int)mbs_size, NULL, &defchar); if (ll == 0 && GetLastError() == ERROR_INSUFFICIENT_BUFFER) { /* Need more buffer for MBS. */ ll = WideCharToMultiByte(sc->to_cp, 0, - (LPCWSTR)u16, bytes, NULL, 0, NULL, NULL); + (LPCWSTR)u16, (int)bytes, NULL, 0, NULL, NULL); if (archive_string_ensure(as, ll +1) == NULL) return (-1); mbs = as->s + as->length; @@ -3662,12 +3662,12 @@ win_strncat_to_utf16(struct archive_string *as16, const void *_p, } do { count = MultiByteToWideChar(sc->from_cp, - MB_PRECOMPOSED, s, length, (LPWSTR)u16, (int)avail>>1); + MB_PRECOMPOSED, s, (int)length, (LPWSTR)u16, (int)avail>>1); if (count == 0 && GetLastError() == ERROR_INSUFFICIENT_BUFFER) { /* Need more buffer for UTF-16 string */ count = MultiByteToWideChar(sc->from_cp, - MB_PRECOMPOSED, s, length, NULL, 0); + MB_PRECOMPOSED, s, (int)length, NULL, 0); if (archive_string_ensure(as16, (count +1) * 2) == NULL) return (-1); diff --git a/libarchive/archive_util.c b/libarchive/archive_util.c index 103c009d5bc8..34d8081cbce9 100644 --- a/libarchive/archive_util.c +++ b/libarchive/archive_util.c @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2009,2010 Michihiro NAKAJIMA + * Copyright (c) 2009-2012 Michihiro NAKAJIMA * Copyright (c) 2003-2007 Tim Kientzle * All rights reserved. * @@ -50,6 +50,10 @@ __FBSDID("$FreeBSD: head/lib/libarchive/archive_util.c 201098 2009-12-28 02:58:1 #include "archive_private.h" #include "archive_string.h" +#ifndef O_CLOEXEC +#define O_CLOEXEC 0 +#endif + /* Generic initialization of 'struct archive' objects. */ int __archive_clean(struct archive *a) @@ -239,7 +243,7 @@ __archive_mktemp(const char *tmpdir) errno = ENOMEM; goto exit_tmpfile; } - GetTempPathW(l, tmp); + GetTempPathW((DWORD)l, tmp); archive_wstrcpy(&temp_name, tmp); free(tmp); } else { @@ -293,7 +297,8 @@ __archive_mktemp(const char *tmpdir) /* Generate a random file name through CryptGenRandom(). */ p = xp; - if (!CryptGenRandom(hProv, (ep - p)*sizeof(wchar_t), (BYTE*)p)) { + if (!CryptGenRandom(hProv, (DWORD)(ep - p)*sizeof(wchar_t), + (BYTE*)p)) { la_dosmaperr(GetLastError()); goto exit_tmpfile; } @@ -385,6 +390,7 @@ __archive_mktemp(const char *tmpdir) fd = mkstemp(temp_name.s); if (fd < 0) goto exit_tmpfile; + __archive_ensure_cloexec_flag(fd); unlink(temp_name.s); exit_tmpfile: archive_string_free(&temp_name); @@ -438,7 +444,8 @@ __archive_mktemp(const char *tmpdir) archive_strcat(&temp_name, "XXXXXXXXXX"); ep = temp_name.s + archive_strlen(&temp_name); - fd = open("/dev/random", O_RDONLY); + fd = open("/dev/random", O_RDONLY | O_CLOEXEC); + __archive_ensure_cloexec_flag(fd); if (fd < 0) seed = time(NULL); else { @@ -452,10 +459,12 @@ __archive_mktemp(const char *tmpdir) p = tp; while (p < ep) *p++ = num[((unsigned)rand_r(&seed)) % sizeof(num)]; - fd = open(temp_name.s, O_CREAT | O_EXCL | O_RDWR, 0600); + fd = open(temp_name.s, O_CREAT | O_EXCL | O_RDWR | O_CLOEXEC, + 0600); } while (fd < 0 && errno == EEXIST); if (fd < 0) goto exit_tmpfile; + __archive_ensure_cloexec_flag(fd); unlink(temp_name.s); exit_tmpfile: archive_string_free(&temp_name); @@ -464,3 +473,29 @@ __archive_mktemp(const char *tmpdir) #endif /* HAVE_MKSTEMP */ #endif /* !_WIN32 || __CYGWIN__ */ + +/* + * Set FD_CLOEXEC flag to a file descriptor if it is not set. + * We have to set the flag if the platform does not provide O_CLOEXEC + * or F_DUPFD_CLOEXEC flags. + * + * Note: This function is absolutely called after creating a new file + * descriptor even if the platform seemingly provides O_CLOEXEC or + * F_DUPFD_CLOEXEC macros because it is possible that the platform + * merely declares those macros, especially Linux 2.6.18 - 2.6.24 do it. + */ +void +__archive_ensure_cloexec_flag(int fd) +{ +#if defined(_WIN32) && !defined(__CYGWIN__) + (void)fd; /* UNSED */ +#else + int flags; + + if (fd >= 0) { + flags = fcntl(fd, F_GETFD); + if (flags != -1 && (flags & FD_CLOEXEC) == 0) + fcntl(fd, F_SETFD, flags | FD_CLOEXEC); + } +#endif +} diff --git a/libarchive/archive_virtual.c b/libarchive/archive_virtual.c index 83089f27f942..0c4155f21e3b 100644 --- a/libarchive/archive_virtual.c +++ b/libarchive/archive_virtual.c @@ -66,6 +66,13 @@ archive_read_close(struct archive *a) return ((a->vtable->archive_close)(a)); } +int +archive_write_fail(struct archive *a) +{ + a->state = ARCHIVE_STATE_FATAL; + return a->state; +} + int archive_write_free(struct archive *a) { diff --git a/libarchive/archive_windows.c b/libarchive/archive_windows.c index 12ad07dc2a74..d3bf758bb39e 100644 --- a/libarchive/archive_windows.c +++ b/libarchive/archive_windows.c @@ -633,35 +633,22 @@ __la_stat(const char *path, struct stat *st) * This waitpid is limited implementation. */ pid_t -__la_waitpid(pid_t wpid, int *status, int option) +__la_waitpid(HANDLE child, int *status, int option) { - HANDLE child; - DWORD cs, ret; + DWORD cs; (void)option;/* UNUSED */ - *status = 0; - child = OpenProcess(PROCESS_QUERY_INFORMATION | SYNCHRONIZE, FALSE, wpid); - if (child == NULL) { - la_dosmaperr(GetLastError()); - return (-1); - } - ret = WaitForSingleObject(child, INFINITE); - if (ret == WAIT_FAILED) { - CloseHandle(child); - la_dosmaperr(GetLastError()); - return (-1); - } - if (GetExitCodeProcess(child, &cs) == 0) { - CloseHandle(child); - la_dosmaperr(GetLastError()); - return (-1); - } - if (cs == STILL_ACTIVE) - *status = 0x100; - else - *status = (int)(cs & 0xff); - CloseHandle(child); - return (wpid); + do { + if (GetExitCodeProcess(child, &cs) == 0) { + CloseHandle(child); + la_dosmaperr(GetLastError()); + *status = 0; + return (-1); + } + } while (cs == STILL_ACTIVE); + + *status = (int)(cs & 0xff); + return (0); } ssize_t diff --git a/libarchive/archive_windows.h b/libarchive/archive_windows.h index a8e54c593d07..c6f5bc510513 100644 --- a/libarchive/archive_windows.h +++ b/libarchive/archive_windows.h @@ -49,6 +49,9 @@ #define LIBARCHIVE_ARCHIVE_WINDOWS_H_INCLUDED /* Start of configuration for native Win32 */ +#ifndef MINGW_HAS_SECURE_API +#define MINGW_HAS_SECURE_API 1 +#endif #include #define set_errno(val) ((errno)=val) @@ -90,8 +93,14 @@ #ifndef fileno #define fileno _fileno #endif +#ifdef fstat +#undef fstat +#endif #define fstat __la_fstat #if !defined(__BORLANDC__) +#ifdef lseek +#undef lseek +#endif #define lseek _lseeki64 #else #define lseek __la_lseek @@ -103,6 +112,9 @@ #if !defined(__BORLANDC__) #define setmode _setmode #endif +#ifdef stat +#undef stat +#endif #define stat(path,stref) __la_stat(path,stref) #if !defined(__BORLANDC__) #define strdup _strdup @@ -252,7 +264,7 @@ extern __int64 __la_lseek(int fd, __int64 offset, int whence); extern int __la_open(const char *path, int flags, ...); extern ssize_t __la_read(int fd, void *buf, size_t nbytes); extern int __la_stat(const char *path, struct stat *st); -extern pid_t __la_waitpid(pid_t wpid, int *status, int option); +extern pid_t __la_waitpid(HANDLE child, int *status, int option); extern ssize_t __la_write(int fd, const void *buf, size_t nbytes); #define _stat64i32(path, st) __la_stat(path, st) diff --git a/libarchive/archive_write.c b/libarchive/archive_write.c index 6fc3907f3631..a3d1a3380c05 100644 --- a/libarchive/archive_write.c +++ b/libarchive/archive_write.c @@ -232,6 +232,10 @@ __archive_write_filter(struct archive_write_filter *f, int r; if (length == 0) return(ARCHIVE_OK); + if (f->write == NULL) + /* If unset, a fatal error has already ocuured, so this filter + * didn't open. We cannot write anything. */ + return(ARCHIVE_FATAL); r = (f->write)(f, buff, length); f->bytes_written += length; return (r); @@ -437,6 +441,8 @@ archive_write_client_close(struct archive_write_filter *f) (*a->client_closer)(&a->archive, a->client_data); free(state->buffer); free(state); + /* Clear the close handler myself not to be called again. */ + f->close = NULL; a->client_data = NULL; return (ret); } diff --git a/libarchive/archive_write_add_filter.c b/libarchive/archive_write_add_filter.c index 915290aaaf99..81dd683aacc7 100644 --- a/libarchive/archive_write_add_filter.c +++ b/libarchive/archive_write_add_filter.c @@ -45,9 +45,13 @@ struct { int code; int (*setter)(struct archive *); } codes[] = { ARCHIVE_FILTER_GZIP, archive_write_add_filter_gzip }, { ARCHIVE_FILTER_BZIP2, archive_write_add_filter_bzip2 }, { ARCHIVE_FILTER_COMPRESS, archive_write_add_filter_compress }, - { ARCHIVE_FILTER_LZMA, archive_write_add_filter_lzma }, - { ARCHIVE_FILTER_XZ, archive_write_add_filter_xz }, + { ARCHIVE_FILTER_GRZIP, archive_write_add_filter_grzip }, + { ARCHIVE_FILTER_LRZIP, archive_write_add_filter_lrzip }, { ARCHIVE_FILTER_LZIP, archive_write_add_filter_lzip }, + { ARCHIVE_FILTER_LZMA, archive_write_add_filter_lzma }, + { ARCHIVE_FILTER_LZOP, archive_write_add_filter_lzip }, + { ARCHIVE_FILTER_UU, archive_write_add_filter_uuencode }, + { ARCHIVE_FILTER_XZ, archive_write_add_filter_xz }, { -1, NULL } }; diff --git a/libarchive/archive_write_add_filter_b64encode.c b/libarchive/archive_write_add_filter_b64encode.c new file mode 100644 index 000000000000..85eb087b0522 --- /dev/null +++ b/libarchive/archive_write_add_filter_b64encode.c @@ -0,0 +1,314 @@ +/*- + * Copyright (c) 2012 Michihiro NAKAJIMA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "archive_platform.h" + +__FBSDID("$FreeBSD$"); + +#ifdef HAVE_ERRNO_H +#include +#endif +#ifdef HAVE_STDLIB_H +#include +#endif +#ifdef HAVE_STRING_H +#include +#endif + +#include "archive.h" +#include "archive_private.h" +#include "archive_string.h" +#include "archive_write_private.h" + +#define LBYTES 57 + +struct private_b64encode { + int mode; + struct archive_string name; + struct archive_string encoded_buff; + size_t bs; + size_t hold_len; + unsigned char hold[LBYTES]; +}; + +static int archive_filter_b64encode_options(struct archive_write_filter *, + const char *, const char *); +static int archive_filter_b64encode_open(struct archive_write_filter *); +static int archive_filter_b64encode_write(struct archive_write_filter *, + const void *, size_t); +static int archive_filter_b64encode_close(struct archive_write_filter *); +static int archive_filter_b64encode_free(struct archive_write_filter *); +static void b64_encode(struct archive_string *, const unsigned char *, size_t); +static int64_t atol8(const char *, size_t); + +static const char base64[] = { + 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', + 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', + 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', + 'Y', 'Z', 'a', 'b', 'c', 'd', 'e', 'f', + 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', + 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', + 'w', 'x', 'y', 'z', '0', '1', '2', '3', + '4', '5', '6', '7', '8', '9', '+', '/' +}; + +/* + * Add a compress filter to this write handle. + */ +int +archive_write_add_filter_b64encode(struct archive *_a) +{ + struct archive_write *a = (struct archive_write *)_a; + struct archive_write_filter *f = __archive_write_allocate_filter(_a); + struct private_b64encode *state; + + archive_check_magic(&a->archive, ARCHIVE_WRITE_MAGIC, + ARCHIVE_STATE_NEW, "archive_write_add_filter_uu"); + + state = (struct private_b64encode *)calloc(1, sizeof(*state)); + if (state == NULL) { + archive_set_error(f->archive, ENOMEM, + "Can't allocate data for b64encode filter"); + return (ARCHIVE_FATAL); + } + archive_strcpy(&state->name, "-"); + state->mode = 0644; + + f->data = state; + f->name = "b64encode"; + f->code = ARCHIVE_FILTER_UU; + f->open = archive_filter_b64encode_open; + f->options = archive_filter_b64encode_options; + f->write = archive_filter_b64encode_write; + f->close = archive_filter_b64encode_close; + f->free = archive_filter_b64encode_free; + + return (ARCHIVE_OK); +} + +/* + * Set write options. + */ +static int +archive_filter_b64encode_options(struct archive_write_filter *f, const char *key, + const char *value) +{ + struct private_b64encode *state = (struct private_b64encode *)f->data; + + if (strcmp(key, "mode") == 0) { + if (value == NULL) { + archive_set_error(f->archive, ARCHIVE_ERRNO_MISC, + "mode option requires octal digits"); + return (ARCHIVE_FAILED); + } + state->mode = (int)atol8(value, strlen(value)) & 0777; + return (ARCHIVE_OK); + } else if (strcmp(key, "name") == 0) { + if (value == NULL) { + archive_set_error(f->archive, ARCHIVE_ERRNO_MISC, + "name option requires a string"); + return (ARCHIVE_FAILED); + } + archive_strcpy(&state->name, value); + return (ARCHIVE_OK); + } + + /* Note: The "warn" return is just to inform the options + * supervisor that we didn't handle it. It will generate + * a suitable error if no one used this option. */ + return (ARCHIVE_WARN); +} + +/* + * Setup callback. + */ +static int +archive_filter_b64encode_open(struct archive_write_filter *f) +{ + struct private_b64encode *state = (struct private_b64encode *)f->data; + size_t bs = 65536, bpb; + int ret; + + ret = __archive_write_open_filter(f->next_filter); + if (ret != ARCHIVE_OK) + return (ret); + + if (f->archive->magic == ARCHIVE_WRITE_MAGIC) { + /* Buffer size should be a multiple number of the of bytes + * per block for performance. */ + bpb = archive_write_get_bytes_per_block(f->archive); + if (bpb > bs) + bs = bpb; + else if (bpb != 0) + bs -= bs % bpb; + } + + state->bs = bs; + if (archive_string_ensure(&state->encoded_buff, bs + 512) == NULL) { + archive_set_error(f->archive, ENOMEM, + "Can't allocate data for b64encode buffer"); + return (ARCHIVE_FATAL); + } + + archive_string_sprintf(&state->encoded_buff, "begin-base64 %o %s\n", + state->mode, state->name.s); + + f->data = state; + return (0); +} + +static void +b64_encode(struct archive_string *as, const unsigned char *p, size_t len) +{ + int c; + + for (; len >= 3; p += 3, len -= 3) { + c = p[0] >> 2; + archive_strappend_char(as, base64[c]); + c = ((p[0] & 0x03) << 4) | ((p[1] & 0xf0) >> 4); + archive_strappend_char(as, base64[c]); + c = ((p[1] & 0x0f) << 2) | ((p[2] & 0xc0) >> 6); + archive_strappend_char(as, base64[c]); + c = p[2] & 0x3f; + archive_strappend_char(as, base64[c]); + } + if (len > 0) { + c = p[0] >> 2; + archive_strappend_char(as, base64[c]); + c = (p[0] & 0x03) << 4; + if (len == 1) { + archive_strappend_char(as, base64[c]); + archive_strappend_char(as, '='); + archive_strappend_char(as, '='); + } else { + c |= (p[1] & 0xf0) >> 4; + archive_strappend_char(as, base64[c]); + c = (p[1] & 0x0f) << 2; + archive_strappend_char(as, base64[c]); + archive_strappend_char(as, '='); + } + } + archive_strappend_char(as, '\n'); +} + +/* + * Write data to the encoded stream. + */ +static int +archive_filter_b64encode_write(struct archive_write_filter *f, const void *buff, + size_t length) +{ + struct private_b64encode *state = (struct private_b64encode *)f->data; + const unsigned char *p = buff; + int ret = ARCHIVE_OK; + + if (length == 0) + return (ret); + + if (state->hold_len) { + while (state->hold_len < LBYTES && length > 0) { + state->hold[state->hold_len++] = *p++; + length--; + } + if (state->hold_len < LBYTES) + return (ret); + b64_encode(&state->encoded_buff, state->hold, LBYTES); + state->hold_len = 0; + } + + for (; length >= LBYTES; length -= LBYTES, p += LBYTES) + b64_encode(&state->encoded_buff, p, LBYTES); + + /* Save remaining bytes. */ + if (length > 0) { + memcpy(state->hold, p, length); + state->hold_len = length; + } + while (archive_strlen(&state->encoded_buff) >= state->bs) { + ret = __archive_write_filter(f->next_filter, + state->encoded_buff.s, state->bs); + memmove(state->encoded_buff.s, + state->encoded_buff.s + state->bs, + state->encoded_buff.length - state->bs); + state->encoded_buff.length -= state->bs; + } + + return (ret); +} + + +/* + * Finish the compression... + */ +static int +archive_filter_b64encode_close(struct archive_write_filter *f) +{ + struct private_b64encode *state = (struct private_b64encode *)f->data; + int ret, ret2; + + /* Flush remaining bytes. */ + if (state->hold_len != 0) + b64_encode(&state->encoded_buff, state->hold, state->hold_len); + archive_string_sprintf(&state->encoded_buff, "====\n"); + /* Write the last block */ + archive_write_set_bytes_in_last_block(f->archive, 1); + ret = __archive_write_filter(f->next_filter, + state->encoded_buff.s, archive_strlen(&state->encoded_buff)); + ret2 = __archive_write_close_filter(f->next_filter); + if (ret > ret2) + ret = ret2; + return (ret); +} + +static int +archive_filter_b64encode_free(struct archive_write_filter *f) +{ + struct private_b64encode *state = (struct private_b64encode *)f->data; + + archive_string_free(&state->name); + archive_string_free(&state->encoded_buff); + free(state); + return (ARCHIVE_OK); +} + +static int64_t +atol8(const char *p, size_t char_cnt) +{ + int64_t l; + int digit; + + l = 0; + while (char_cnt-- > 0) { + if (*p >= '0' && *p <= '7') + digit = *p - '0'; + else + break; + p++; + l <<= 3; + l |= digit; + } + return (l); +} + diff --git a/libarchive/archive_write_add_filter_by_name.c b/libarchive/archive_write_add_filter_by_name.c new file mode 100644 index 000000000000..e4cba4afa01c --- /dev/null +++ b/libarchive/archive_write_add_filter_by_name.c @@ -0,0 +1,75 @@ +/*- + * Copyright (c) 2003-2007 Tim Kientzle + * Copyright (c) 2012 Michihiro NAKAJIMA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "archive_platform.h" +__FBSDID("$FreeBSD$"); + +#ifdef HAVE_SYS_TYPES_H +#include +#endif + +#ifdef HAVE_ERRNO_H +#include +#endif +#ifdef HAVE_STRING_H +#include +#endif + +#include "archive.h" +#include "archive_private.h" + +/* A table that maps names to functions. */ +static +struct { const char *name; int (*setter)(struct archive *); } names[] = +{ + { "b64encode", archive_write_add_filter_b64encode }, + { "bzip2", archive_write_add_filter_bzip2 }, + { "compress", archive_write_add_filter_compress }, + { "grzip", archive_write_add_filter_grzip }, + { "gzip", archive_write_add_filter_gzip }, + { "lrzip", archive_write_add_filter_lrzip }, + { "lzip", archive_write_add_filter_lzip }, + { "lzma", archive_write_add_filter_lzma }, + { "lzop", archive_write_add_filter_lzop }, + { "uuencode", archive_write_add_filter_uuencode }, + { "xz", archive_write_add_filter_xz }, + { NULL, NULL } +}; + +int +archive_write_add_filter_by_name(struct archive *a, const char *name) +{ + int i; + + for (i = 0; names[i].name != NULL; i++) { + if (strcmp(name, names[i].name) == 0) + return ((names[i].setter)(a)); + } + + archive_set_error(a, EINVAL, "No such filter '%s'", name); + a->state = ARCHIVE_STATE_FATAL; + return (ARCHIVE_FATAL); +} diff --git a/libarchive/archive_write_add_filter_bzip2.c b/libarchive/archive_write_add_filter_bzip2.c index 2b48959ee093..88da803a395a 100644 --- a/libarchive/archive_write_add_filter_bzip2.c +++ b/libarchive/archive_write_add_filter_bzip2.c @@ -1,5 +1,6 @@ /*- * Copyright (c) 2003-2007 Tim Kientzle + * Copyright (c) 2012 Michihiro NAKAJIMA * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -54,32 +55,18 @@ archive_write_set_compression_bzip2(struct archive *a) } #endif -#if !defined(HAVE_BZLIB_H) || !defined(BZ_CONFIG_ERROR) -int -archive_write_add_filter_bzip2(struct archive *a) -{ - archive_set_error(a, ARCHIVE_ERRNO_MISC, - "bzip2 compression not supported on this platform"); - return (ARCHIVE_FATAL); -} -#else -/* Don't compile this if we don't have bzlib. */ - struct private_data { int compression_level; +#if defined(HAVE_BZLIB_H) && defined(BZ_CONFIG_ERROR) bz_stream stream; int64_t total_in; char *compressed; size_t compressed_buffer_size; +#else + struct archive_write_program_data *pdata; +#endif }; -/* - * Yuck. bzlib.h is not const-correct, so I need this one bit - * of ugly hackery to convert a const * pointer to a non-const pointer. - */ -#define SET_NEXT_IN(st,src) \ - (st)->stream.next_in = (char *)(uintptr_t)(const void *)(src) - static int archive_compressor_bzip2_close(struct archive_write_filter *); static int archive_compressor_bzip2_free(struct archive_write_filter *); static int archive_compressor_bzip2_open(struct archive_write_filter *); @@ -87,8 +74,6 @@ static int archive_compressor_bzip2_options(struct archive_write_filter *, const char *, const char *); static int archive_compressor_bzip2_write(struct archive_write_filter *, const void *, size_t); -static int drive_compressor(struct archive_write_filter *, - struct private_data *, int finishing); /* * Add a bzip2 compression filter to this write handle. @@ -115,11 +100,64 @@ archive_write_add_filter_bzip2(struct archive *_a) f->close = &archive_compressor_bzip2_close; f->free = &archive_compressor_bzip2_free; f->open = &archive_compressor_bzip2_open; - f->code = ARCHIVE_COMPRESSION_BZIP2; + f->code = ARCHIVE_FILTER_BZIP2; f->name = "bzip2"; +#if defined(HAVE_BZLIB_H) && defined(BZ_CONFIG_ERROR) return (ARCHIVE_OK); +#else + data->pdata = __archive_write_program_allocate(); + if (data->pdata == NULL) { + free(data); + archive_set_error(&a->archive, ENOMEM, "Out of memory"); + return (ARCHIVE_FATAL); + } + data->compression_level = 0; + archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, + "Using external bzip2 program"); + return (ARCHIVE_WARN); +#endif } +/* + * Set write options. + */ +static int +archive_compressor_bzip2_options(struct archive_write_filter *f, + const char *key, const char *value) +{ + struct private_data *data = (struct private_data *)f->data; + + if (strcmp(key, "compression-level") == 0) { + if (value == NULL || !(value[0] >= '0' && value[0] <= '9') || + value[1] != '\0') + return (ARCHIVE_WARN); + data->compression_level = value[0] - '0'; + /* Make '0' be a synonym for '1'. */ + /* This way, bzip2 compressor supports the same 0..9 + * range of levels as gzip. */ + if (data->compression_level < 1) + data->compression_level = 1; + return (ARCHIVE_OK); + } + + /* Note: The "warn" return is just to inform the options + * supervisor that we didn't handle it. It will generate + * a suitable error if no one used this option. */ + return (ARCHIVE_WARN); +} + +#if defined(HAVE_BZLIB_H) && defined(BZ_CONFIG_ERROR) +/* Don't compile this if we don't have bzlib. */ + +/* + * Yuck. bzlib.h is not const-correct, so I need this one bit + * of ugly hackery to convert a const * pointer to a non-const pointer. + */ +#define SET_NEXT_IN(st,src) \ + (st)->stream.next_in = (char *)(uintptr_t)(const void *)(src) +static int drive_compressor(struct archive_write_filter *, + struct private_data *, int finishing); + /* * Setup callback. */ @@ -194,34 +232,6 @@ archive_compressor_bzip2_open(struct archive_write_filter *f) } -/* - * Set write options. - */ -static int -archive_compressor_bzip2_options(struct archive_write_filter *f, - const char *key, const char *value) -{ - struct private_data *data = (struct private_data *)f->data; - - if (strcmp(key, "compression-level") == 0) { - if (value == NULL || !(value[0] >= '0' && value[0] <= '9') || - value[1] != '\0') - return (ARCHIVE_WARN); - data->compression_level = value[0] - '0'; - /* Make '0' be a synonym for '1'. */ - /* This way, bzip2 compressor supports the same 0..9 - * range of levels as gzip. */ - if (data->compression_level < 1) - data->compression_level = 1; - return (ARCHIVE_OK); - } - - /* Note: The "warn" return is just to inform the options - * supervisor that we didn't handle it. It will generate - * a suitable error if no one used this option. */ - return (ARCHIVE_WARN); -} - /* * Write data to the compressed stream. * @@ -343,4 +353,55 @@ drive_compressor(struct archive_write_filter *f, } } +#else /* HAVE_BZLIB_H && BZ_CONFIG_ERROR */ + +static int +archive_compressor_bzip2_open(struct archive_write_filter *f) +{ + struct private_data *data = (struct private_data *)f->data; + struct archive_string as; + int r; + + archive_string_init(&as); + archive_strcpy(&as, "bzip2"); + + /* Specify compression level. */ + if (data->compression_level > 0) { + archive_strcat(&as, " -"); + archive_strappend_char(&as, '0' + data->compression_level); + } + f->write = archive_compressor_bzip2_write; + + r = __archive_write_program_open(f, data->pdata, as.s); + archive_string_free(&as); + return (r); +} + +static int +archive_compressor_bzip2_write(struct archive_write_filter *f, const void *buff, + size_t length) +{ + struct private_data *data = (struct private_data *)f->data; + + return __archive_write_program_write(f, data->pdata, buff, length); +} + +static int +archive_compressor_bzip2_close(struct archive_write_filter *f) +{ + struct private_data *data = (struct private_data *)f->data; + + return __archive_write_program_close(f, data->pdata); +} + +static int +archive_compressor_bzip2_free(struct archive_write_filter *f) +{ + struct private_data *data = (struct private_data *)f->data; + + __archive_write_program_free(data->pdata); + free(data); + return (ARCHIVE_OK); +} + #endif /* HAVE_BZLIB_H && BZ_CONFIG_ERROR */ diff --git a/libarchive/archive_write_add_filter_compress.c b/libarchive/archive_write_add_filter_compress.c index 4923316f5d8a..26fcef4d42bc 100644 --- a/libarchive/archive_write_add_filter_compress.c +++ b/libarchive/archive_write_add_filter_compress.c @@ -135,7 +135,7 @@ archive_write_add_filter_compress(struct archive *_a) archive_check_magic(&a->archive, ARCHIVE_WRITE_MAGIC, ARCHIVE_STATE_NEW, "archive_write_add_filter_compress"); f->open = &archive_compressor_compress_open; - f->code = ARCHIVE_COMPRESSION_COMPRESS; + f->code = ARCHIVE_FILTER_COMPRESS; f->name = "compress"; return (ARCHIVE_OK); } @@ -150,7 +150,7 @@ archive_compressor_compress_open(struct archive_write_filter *f) struct private_data *state; size_t bs = 65536, bpb; - f->code = ARCHIVE_COMPRESSION_COMPRESS; + f->code = ARCHIVE_FILTER_COMPRESS; f->name = "compress"; ret = __archive_write_open_filter(f->next_filter); diff --git a/libarchive/archive_write_add_filter_grzip.c b/libarchive/archive_write_add_filter_grzip.c new file mode 100644 index 000000000000..8dc287eae033 --- /dev/null +++ b/libarchive/archive_write_add_filter_grzip.c @@ -0,0 +1,135 @@ +/*- + * Copyright (c) 2003-2007 Tim Kientzle + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "archive_platform.h" + +__FBSDID("$FreeBSD$"); + +#ifdef HAVE_ERRNO_H +#include +#endif +#ifdef HAVE_STDLIB_H +#include +#endif + +#include "archive.h" +#include "archive_write_private.h" + +struct write_grzip { + struct archive_write_program_data *pdata; +}; + +static int archive_write_grzip_open(struct archive_write_filter *); +static int archive_write_grzip_options(struct archive_write_filter *, + const char *, const char *); +static int archive_write_grzip_write(struct archive_write_filter *, + const void *, size_t); +static int archive_write_grzip_close(struct archive_write_filter *); +static int archive_write_grzip_free(struct archive_write_filter *); + +int +archive_write_add_filter_grzip(struct archive *_a) +{ + struct archive_write_filter *f = __archive_write_allocate_filter(_a); + struct write_grzip *data; + + archive_check_magic(_a, ARCHIVE_WRITE_MAGIC, + ARCHIVE_STATE_NEW, "archive_write_add_filter_grzip"); + + data = calloc(1, sizeof(*data)); + if (data == NULL) { + archive_set_error(_a, ENOMEM, "Can't allocate memory"); + return (ARCHIVE_FATAL); + } + data->pdata = __archive_write_program_allocate(); + if (data->pdata == NULL) { + free(data); + archive_set_error(_a, ENOMEM, "Can't allocate memory"); + return (ARCHIVE_FATAL); + } + + f->name = "grzip"; + f->code = ARCHIVE_FILTER_GRZIP; + f->data = data; + f->open = archive_write_grzip_open; + f->options = archive_write_grzip_options; + f->write = archive_write_grzip_write; + f->close = archive_write_grzip_close; + f->free = archive_write_grzip_free; + + /* Note: This filter always uses an external program, so we + * return "warn" to inform of the fact. */ + archive_set_error(_a, ARCHIVE_ERRNO_MISC, + "Using external grzip program for grzip compression"); + return (ARCHIVE_WARN); +} + +static int +archive_write_grzip_options(struct archive_write_filter *f, const char *key, + const char *value) +{ + (void)f; /* UNUSED */ + (void)key; /* UNUSED */ + (void)value; /* UNUSED */ + /* Note: The "warn" return is just to inform the options + * supervisor that we didn't handle it. It will generate + * a suitable error if no one used this option. */ + return (ARCHIVE_WARN); +} + +static int +archive_write_grzip_open(struct archive_write_filter *f) +{ + struct write_grzip *data = (struct write_grzip *)f->data; + + return __archive_write_program_open(f, data->pdata, "grzip"); +} + +static int +archive_write_grzip_write(struct archive_write_filter *f, + const void *buff, size_t length) +{ + struct write_grzip *data = (struct write_grzip *)f->data; + + return __archive_write_program_write(f, data->pdata, buff, length); +} + +static int +archive_write_grzip_close(struct archive_write_filter *f) +{ + struct write_grzip *data = (struct write_grzip *)f->data; + + return __archive_write_program_close(f, data->pdata); +} + +static int +archive_write_grzip_free(struct archive_write_filter *f) +{ + struct write_grzip *data = (struct write_grzip *)f->data; + + __archive_write_program_free(data->pdata); + free(data); + return (ARCHIVE_OK); +} diff --git a/libarchive/archive_write_add_filter_gzip.c b/libarchive/archive_write_add_filter_gzip.c index b1564774fd51..da4607bb934c 100644 --- a/libarchive/archive_write_add_filter_gzip.c +++ b/libarchive/archive_write_add_filter_gzip.c @@ -43,6 +43,7 @@ __FBSDID("$FreeBSD: head/lib/libarchive/archive_write_set_compression_gzip.c 201 #include "archive.h" #include "archive_private.h" +#include "archive_string.h" #include "archive_write_private.h" #if ARCHIVE_VERSION_NUMBER < 4000000 @@ -54,24 +55,20 @@ archive_write_set_compression_gzip(struct archive *a) } #endif -#ifndef HAVE_ZLIB_H -int -archive_write_add_filter_gzip(struct archive *a) -{ - archive_set_error(a, ARCHIVE_ERRNO_MISC, - "gzip compression not supported on this platform"); - return (ARCHIVE_FATAL); -} -#else /* Don't compile this if we don't have zlib. */ struct private_data { int compression_level; + int timestamp; +#ifdef HAVE_ZLIB_H z_stream stream; int64_t total_in; unsigned char *compressed; size_t compressed_buffer_size; unsigned long crc; +#else + struct archive_write_program_data *pdata; +#endif }; /* @@ -88,8 +85,10 @@ static int archive_compressor_gzip_write(struct archive_write_filter *, const void *, size_t); static int archive_compressor_gzip_close(struct archive_write_filter *); static int archive_compressor_gzip_free(struct archive_write_filter *); +#ifdef HAVE_ZLIB_H static int drive_compressor(struct archive_write_filter *, struct private_data *, int finishing); +#endif /* @@ -110,16 +109,72 @@ archive_write_add_filter_gzip(struct archive *_a) return (ARCHIVE_FATAL); } f->data = data; - data->compression_level = Z_DEFAULT_COMPRESSION; f->open = &archive_compressor_gzip_open; f->options = &archive_compressor_gzip_options; f->close = &archive_compressor_gzip_close; f->free = &archive_compressor_gzip_free; - f->code = ARCHIVE_COMPRESSION_GZIP; + f->code = ARCHIVE_FILTER_GZIP; f->name = "gzip"; +#ifdef HAVE_ZLIB_H + data->compression_level = Z_DEFAULT_COMPRESSION; + return (ARCHIVE_OK); +#else + data->pdata = __archive_write_program_allocate(); + if (data->pdata == NULL) { + free(data); + archive_set_error(&a->archive, ENOMEM, "Out of memory"); + return (ARCHIVE_FATAL); + } + data->compression_level = 0; + archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, + "Using external gzip program"); + return (ARCHIVE_WARN); +#endif +} + +static int +archive_compressor_gzip_free(struct archive_write_filter *f) +{ + struct private_data *data = (struct private_data *)f->data; + +#ifdef HAVE_ZLIB_H + free(data->compressed); +#else + __archive_write_program_free(data->pdata); +#endif + free(data); + f->data = NULL; return (ARCHIVE_OK); } +/* + * Set write options. + */ +static int +archive_compressor_gzip_options(struct archive_write_filter *f, const char *key, + const char *value) +{ + struct private_data *data = (struct private_data *)f->data; + + if (strcmp(key, "compression-level") == 0) { + if (value == NULL || !(value[0] >= '0' && value[0] <= '9') || + value[1] != '\0') + return (ARCHIVE_WARN); + data->compression_level = value[0] - '0'; + return (ARCHIVE_OK); + } + if (strcmp(key, "timestamp") == 0) { + data->timestamp = (value == NULL)?-1:1; + return (ARCHIVE_OK); + } + + /* Note: The "warn" return is just to inform the options + * supervisor that we didn't handle it. It will generate + * a suitable error if no one used this option. */ + return (ARCHIVE_WARN); +} + +#ifdef HAVE_ZLIB_H /* * Setup callback. */ @@ -128,7 +183,6 @@ archive_compressor_gzip_open(struct archive_write_filter *f) { struct private_data *data = (struct private_data *)f->data; int ret; - time_t t; ret = __archive_write_open_filter(f->next_filter); if (ret != ARCHIVE_OK) @@ -137,8 +191,8 @@ archive_compressor_gzip_open(struct archive_write_filter *f) if (data->compressed == NULL) { size_t bs = 65536, bpb; if (f->archive->magic == ARCHIVE_WRITE_MAGIC) { - /* Buffer size should be a multiple number of the of bytes - * per block for performance. */ + /* Buffer size should be a multiple number of + * the of bytes per block for performance. */ bpb = archive_write_get_bytes_per_block(f->archive); if (bpb > bs) bs = bpb; @@ -157,18 +211,21 @@ archive_compressor_gzip_open(struct archive_write_filter *f) data->crc = crc32(0L, NULL, 0); data->stream.next_out = data->compressed; - data->stream.avail_out = data->compressed_buffer_size; + data->stream.avail_out = (uInt)data->compressed_buffer_size; /* Prime output buffer with a gzip header. */ - t = time(NULL); data->compressed[0] = 0x1f; /* GZip signature bytes */ data->compressed[1] = 0x8b; data->compressed[2] = 0x08; /* "Deflate" compression */ data->compressed[3] = 0; /* No options */ - data->compressed[4] = (uint8_t)(t)&0xff; /* Timestamp */ - data->compressed[5] = (uint8_t)(t>>8)&0xff; - data->compressed[6] = (uint8_t)(t>>16)&0xff; - data->compressed[7] = (uint8_t)(t>>24)&0xff; + if (data->timestamp >= 0) { + time_t t = time(NULL); + data->compressed[4] = (uint8_t)(t)&0xff; /* Timestamp */ + data->compressed[5] = (uint8_t)(t>>8)&0xff; + data->compressed[6] = (uint8_t)(t>>16)&0xff; + data->compressed[7] = (uint8_t)(t>>24)&0xff; + } else + memset(&data->compressed[4], 0, 4); data->compressed[8] = 0; /* No deflate options */ data->compressed[9] = 3; /* OS=Unix */ data->stream.next_out += 10; @@ -201,8 +258,8 @@ archive_compressor_gzip_open(struct archive_write_filter *f) "compression library: invalid setup parameter"); break; case Z_MEM_ERROR: - archive_set_error(f->archive, ENOMEM, "Internal error initializing " - "compression library"); + archive_set_error(f->archive, ENOMEM, + "Internal error initializing compression library"); break; case Z_VERSION_ERROR: archive_set_error(f->archive, ARCHIVE_ERRNO_MISC, @@ -214,29 +271,6 @@ archive_compressor_gzip_open(struct archive_write_filter *f) return (ARCHIVE_FATAL); } -/* - * Set write options. - */ -static int -archive_compressor_gzip_options(struct archive_write_filter *f, const char *key, - const char *value) -{ - struct private_data *data = (struct private_data *)f->data; - - if (strcmp(key, "compression-level") == 0) { - if (value == NULL || !(value[0] >= '0' && value[0] <= '9') || - value[1] != '\0') - return (ARCHIVE_WARN); - data->compression_level = value[0] - '0'; - return (ARCHIVE_OK); - } - - /* Note: The "warn" return is just to inform the options - * supervisor that we didn't handle it. It will generate - * a suitable error if no one used this option. */ - return (ARCHIVE_WARN); -} - /* * Write data to the compressed stream. */ @@ -248,12 +282,12 @@ archive_compressor_gzip_write(struct archive_write_filter *f, const void *buff, int ret; /* Update statistics */ - data->crc = crc32(data->crc, (const Bytef *)buff, length); + data->crc = crc32(data->crc, (const Bytef *)buff, (uInt)length); data->total_in += length; /* Compress input data to output buffer */ SET_NEXT_IN(data, buff); - data->stream.avail_in = length; + data->stream.avail_in = (uInt)length; if ((ret = drive_compressor(f, data, 0)) != ARCHIVE_OK) return (ret); @@ -303,16 +337,6 @@ archive_compressor_gzip_close(struct archive_write_filter *f) return (r1 < ret ? r1 : ret); } -static int -archive_compressor_gzip_free(struct archive_write_filter *f) -{ - struct private_data *data = (struct private_data *)f->data; - free(data->compressed); - free(data); - f->data = NULL; - return (ARCHIVE_OK); -} - /* * Utility function to push input data through compressor, * writing full output blocks as necessary. @@ -334,7 +358,8 @@ drive_compressor(struct archive_write_filter *f, if (ret != ARCHIVE_OK) return (ARCHIVE_FATAL); data->stream.next_out = data->compressed; - data->stream.avail_out = data->compressed_buffer_size; + data->stream.avail_out = + (uInt)data->compressed_buffer_size; } /* If there's nothing to do, we're done. */ @@ -367,4 +392,51 @@ drive_compressor(struct archive_write_filter *f, } } +#else /* HAVE_ZLIB_H */ + +static int +archive_compressor_gzip_open(struct archive_write_filter *f) +{ + struct private_data *data = (struct private_data *)f->data; + struct archive_string as; + int r; + + archive_string_init(&as); + archive_strcpy(&as, "gzip"); + + /* Specify compression level. */ + if (data->compression_level > 0) { + archive_strcat(&as, " -"); + archive_strappend_char(&as, '0' + data->compression_level); + } + if (data->timestamp < 0) + /* Do not save timestamp. */ + archive_strcat(&as, " -n"); + else if (data->timestamp > 0) + /* Save timestamp. */ + archive_strcat(&as, " -N"); + + f->write = archive_compressor_gzip_write; + r = __archive_write_program_open(f, data->pdata, as.s); + archive_string_free(&as); + return (r); +} + +static int +archive_compressor_gzip_write(struct archive_write_filter *f, const void *buff, + size_t length) +{ + struct private_data *data = (struct private_data *)f->data; + + return __archive_write_program_write(f, data->pdata, buff, length); +} + +static int +archive_compressor_gzip_close(struct archive_write_filter *f) +{ + struct private_data *data = (struct private_data *)f->data; + + return __archive_write_program_close(f, data->pdata); +} + #endif /* HAVE_ZLIB_H */ diff --git a/libarchive/archive_write_add_filter_lrzip.c b/libarchive/archive_write_add_filter_lrzip.c new file mode 100644 index 000000000000..85fdf6af57f5 --- /dev/null +++ b/libarchive/archive_write_add_filter_lrzip.c @@ -0,0 +1,192 @@ +/*- + * Copyright (c) 2003-2007 Tim Kientzle + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "archive_platform.h" + +__FBSDID("$FreeBSD$"); + +#ifdef HAVE_ERRNO_H +#include +#endif +#ifdef HAVE_STDLIB_H +#include +#endif +#ifdef HAVE_STRING_H +#include +#endif + +#include "archive.h" +#include "archive_string.h" +#include "archive_write_private.h" + +struct write_lrzip { + struct archive_write_program_data *pdata; + int compression_level; + enum { lzma = 0, bzip2, gzip, lzo, zpaq } compression; +}; + +static int archive_write_lrzip_open(struct archive_write_filter *); +static int archive_write_lrzip_options(struct archive_write_filter *, + const char *, const char *); +static int archive_write_lrzip_write(struct archive_write_filter *, + const void *, size_t); +static int archive_write_lrzip_close(struct archive_write_filter *); +static int archive_write_lrzip_free(struct archive_write_filter *); + +int +archive_write_add_filter_lrzip(struct archive *_a) +{ + struct archive_write_filter *f = __archive_write_allocate_filter(_a); + struct write_lrzip *data; + + archive_check_magic(_a, ARCHIVE_WRITE_MAGIC, + ARCHIVE_STATE_NEW, "archive_write_add_filter_lrzip"); + + data = calloc(1, sizeof(*data)); + if (data == NULL) { + archive_set_error(_a, ENOMEM, "Can't allocate memory"); + return (ARCHIVE_FATAL); + } + data->pdata = __archive_write_program_allocate(); + if (data->pdata == NULL) { + free(data); + archive_set_error(_a, ENOMEM, "Can't allocate memory"); + return (ARCHIVE_FATAL); + } + + f->name = "lrzip"; + f->code = ARCHIVE_FILTER_LRZIP; + f->data = data; + f->open = archive_write_lrzip_open; + f->options = archive_write_lrzip_options; + f->write = archive_write_lrzip_write; + f->close = archive_write_lrzip_close; + f->free = archive_write_lrzip_free; + + /* Note: This filter always uses an external program, so we + * return "warn" to inform of the fact. */ + archive_set_error(_a, ARCHIVE_ERRNO_MISC, + "Using external lrzip program for lrzip compression"); + return (ARCHIVE_WARN); +} + +static int +archive_write_lrzip_options(struct archive_write_filter *f, const char *key, + const char *value) +{ + struct write_lrzip *data = (struct write_lrzip *)f->data; + + if (strcmp(key, "compression") == 0) { + if (value == NULL) + return (ARCHIVE_WARN); + else if (strcmp(value, "bzip2") == 0) + data->compression = bzip2; + else if (strcmp(value, "gzip") == 0) + data->compression = gzip; + else if (strcmp(value, "lzo") == 0) + data->compression = lzo; + else if (strcmp(value, "zpaq") == 0) + data->compression = zpaq; + else + return (ARCHIVE_WARN); + return (ARCHIVE_OK); + } else if (strcmp(key, "compression-level") == 0) { + if (value == NULL || !(value[0] >= '1' && value[0] <= '9') || + value[1] != '\0') + return (ARCHIVE_WARN); + data->compression_level = value[0] - '0'; + return (ARCHIVE_OK); + } + /* Note: The "warn" return is just to inform the options + * supervisor that we didn't handle it. It will generate + * a suitable error if no one used this option. */ + return (ARCHIVE_WARN); +} + +static int +archive_write_lrzip_open(struct archive_write_filter *f) +{ + struct write_lrzip *data = (struct write_lrzip *)f->data; + struct archive_string as; + int r; + + archive_string_init(&as); + archive_strcpy(&as, "lrzip -q"); + + /* Specify compression type. */ + switch (data->compression) { + case lzma:/* default compression */ + break; + case bzip2: + archive_strcat(&as, " -b"); + break; + case gzip: + archive_strcat(&as, " -g"); + break; + case lzo: + archive_strcat(&as, " -l"); + break; + case zpaq: + archive_strcat(&as, " -z"); + break; + } + + /* Specify compression level. */ + if (data->compression_level > 0) { + archive_strcat(&as, " -L "); + archive_strappend_char(&as, '0' + data->compression_level); + } + + r = __archive_write_program_open(f, data->pdata, as.s); + archive_string_free(&as); + return (r); +} + +static int +archive_write_lrzip_write(struct archive_write_filter *f, + const void *buff, size_t length) +{ + struct write_lrzip *data = (struct write_lrzip *)f->data; + + return __archive_write_program_write(f, data->pdata, buff, length); +} + +static int +archive_write_lrzip_close(struct archive_write_filter *f) +{ + struct write_lrzip *data = (struct write_lrzip *)f->data; + + return __archive_write_program_close(f, data->pdata); +} + +static int +archive_write_lrzip_free(struct archive_write_filter *f) +{ + struct write_lrzip *data = (struct write_lrzip *)f->data; + + __archive_write_program_free(data->pdata); + free(data); + return (ARCHIVE_OK); +} diff --git a/libarchive/archive_write_add_filter_lzop.c b/libarchive/archive_write_add_filter_lzop.c new file mode 100644 index 000000000000..088ecea5167a --- /dev/null +++ b/libarchive/archive_write_add_filter_lzop.c @@ -0,0 +1,486 @@ +/*- + * Copyright (c) 2012 Michihiro NAKAJIMA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "archive_platform.h" + +__FBSDID("$FreeBSD$"); +//#undef HAVE_LZO_LZOCONF_H +//#undef HAVE_LZO_LZO1X_H + +#ifdef HAVE_ERRNO_H +#include +#endif +#ifdef HAVE_STDLIB_H +#include +#endif +#ifdef HAVE_STRING_H +#include +#endif +#include +#ifdef HAVE_LZO_LZOCONF_H +#include +#endif +#ifdef HAVE_LZO_LZO1X_H +#include +#endif + +#include "archive.h" +#include "archive_string.h" +#include "archive_endian.h" +#include "archive_write_private.h" + +enum lzo_method { + METHOD_LZO1X_1 = 1, + METHOD_LZO1X_1_15 = 2, + METHOD_LZO1X_999 = 3 +}; +struct write_lzop { + int compression_level; +#if defined(HAVE_LZO_LZOCONF_H) && defined(HAVE_LZO_LZO1X_H) + unsigned char *uncompressed; + size_t uncompressed_buffer_size; + size_t uncompressed_avail_bytes; + unsigned char *compressed; + size_t compressed_buffer_size; + enum lzo_method method; + unsigned char level; + lzo_voidp work_buffer; + lzo_uint32 work_buffer_size; + char header_written; +#else + struct archive_write_program_data *pdata; +#endif +}; + +static int archive_write_lzop_open(struct archive_write_filter *); +static int archive_write_lzop_options(struct archive_write_filter *, + const char *, const char *); +static int archive_write_lzop_write(struct archive_write_filter *, + const void *, size_t); +static int archive_write_lzop_close(struct archive_write_filter *); +static int archive_write_lzop_free(struct archive_write_filter *); + +#if defined(HAVE_LZO_LZOCONF_H) && defined(HAVE_LZO_LZO1X_H) +/* Maximum block size. */ +#define BLOCK_SIZE (256 * 1024) +/* Block infomation is composed of uncompressed size(4 bytes), + * compressed size(4 bytes) and the checksum of uncompressed data(4 bytes) + * in this lzop writer. */ +#define BLOCK_INfO_SIZE 12 + +#define HEADER_VERSION 9 +#define HEADER_LIBVERSION 11 +#define HEADER_METHOD 15 +#define HEADER_LEVEL 16 +#define HEADER_MTIME_LOW 25 +#define HEADER_MTIME_HIGH 29 +#define HEADER_H_CHECKSUM 34 + +/* + * Header template. + */ +static const unsigned char header[] = { + /* LZOP Magic code 9 bytes */ + 0x89, 0x4c, 0x5a, 0x4f, 0x00, 0x0d, 0x0a, 0x1a, 0x0a, + /* LZOP utility version(fake data) 2 bytes */ + 0x10, 0x30, + /* LZO library version 2 bytes */ + 0x09, 0x40, + /* Minimum required LZO library version 2 bytes */ + 0x09, 0x40, + /* Method */ + 1, + /* Level */ + 5, + /* Flags 4 bytes + * -OS Unix + * -Stdout + * -Stdin + * -Adler32 used for uncompressed data 4 bytes */ + 0x03, 0x00, 0x00, 0x0d, + /* Mode (AE_IFREG | 0644) 4 bytes */ + 0x00, 0x00, 0x81, 0xa4, + /* Mtime low 4 bytes */ + 0x00, 0x00, 0x00, 0x00, + /* Mtime high 4 bytes */ + 0x00, 0x00, 0x00, 0x00, + /* Filename length */ + 0x00, + /* Header checksum 4 bytes */ + 0x00, 0x00, 0x00, 0x00, +}; +#endif + +int +archive_write_add_filter_lzop(struct archive *_a) +{ + struct archive_write_filter *f = __archive_write_allocate_filter(_a); + struct write_lzop *data; + + archive_check_magic(_a, ARCHIVE_WRITE_MAGIC, + ARCHIVE_STATE_NEW, "archive_write_add_filter_lzop"); + + data = calloc(1, sizeof(*data)); + if (data == NULL) { + archive_set_error(_a, ENOMEM, "Can't allocate memory"); + return (ARCHIVE_FATAL); + } + + f->name = "lzop"; + f->code = ARCHIVE_FILTER_LZOP; + f->data = data; + f->open = archive_write_lzop_open; + f->options = archive_write_lzop_options; + f->write = archive_write_lzop_write; + f->close = archive_write_lzop_close; + f->free = archive_write_lzop_free; +#if defined(HAVE_LZO_LZOCONF_H) && defined(HAVE_LZO_LZO1X_H) + if (lzo_init() != LZO_E_OK) { + free(data); + archive_set_error(_a, ARCHIVE_ERRNO_MISC, + "lzo_init(type check) failed"); + return (ARCHIVE_FATAL); + } + if (lzo_version() < 0x940) { + free(data); + archive_set_error(_a, ARCHIVE_ERRNO_MISC, + "liblzo library is too old(%s < 0.940)", + lzo_version_string()); + return (ARCHIVE_FATAL); + } + data->compression_level = 5; + return (ARCHIVE_OK); +#else + data->pdata = __archive_write_program_allocate(); + if (data->pdata == NULL) { + free(data); + archive_set_error(_a, ENOMEM, "Can't allocate memory"); + return (ARCHIVE_FATAL); + } + data->compression_level = 0; + /* Note: We return "warn" to inform of using an external lzop + * program. */ + archive_set_error(_a, ARCHIVE_ERRNO_MISC, + "Using external lzop program for lzop compression"); + return (ARCHIVE_WARN); +#endif +} + +static int +archive_write_lzop_free(struct archive_write_filter *f) +{ + struct write_lzop *data = (struct write_lzop *)f->data; + +#if defined(HAVE_LZO_LZOCONF_H) && defined(HAVE_LZO_LZO1X_H) + free(data->uncompressed); + free(data->compressed); + free(data->work_buffer); +#else + __archive_write_program_free(data->pdata); +#endif + free(data); + return (ARCHIVE_OK); +} + +static int +archive_write_lzop_options(struct archive_write_filter *f, const char *key, + const char *value) +{ + struct write_lzop *data = (struct write_lzop *)f->data; + + if (strcmp(key, "compression-level") == 0) { + if (value == NULL || !(value[0] >= '1' && value[0] <= '9') || + value[1] != '\0') + return (ARCHIVE_WARN); + data->compression_level = value[0] - '0'; + return (ARCHIVE_OK); + } + /* Note: The "warn" return is just to inform the options + * supervisor that we didn't handle it. It will generate + * a suitable error if no one used this option. */ + return (ARCHIVE_WARN); +} + +#if defined(HAVE_LZO_LZOCONF_H) && defined(HAVE_LZO_LZO1X_H) +static int +archive_write_lzop_open(struct archive_write_filter *f) +{ + struct write_lzop *data = (struct write_lzop *)f->data; + int ret; + + ret = __archive_write_open_filter(f->next_filter); + if (ret != ARCHIVE_OK) + return (ret); + + switch (data->compression_level) { + case 1: + data->method = METHOD_LZO1X_1_15; data->level = 1; break; + default: + case 2: case 3: case 4: case 5: case 6: + data->method = METHOD_LZO1X_1; data->level = 5; break; + case 7: + data->method = METHOD_LZO1X_999; data->level = 7; break; + case 8: + data->method = METHOD_LZO1X_999; data->level = 8; break; + case 9: + data->method = METHOD_LZO1X_999; data->level = 9; break; + } + switch (data->method) { + case METHOD_LZO1X_1: + data->work_buffer_size = LZO1X_1_MEM_COMPRESS; break; + case METHOD_LZO1X_1_15: + data->work_buffer_size = LZO1X_1_15_MEM_COMPRESS; break; + case METHOD_LZO1X_999: + data->work_buffer_size = LZO1X_999_MEM_COMPRESS; break; + } + if (data->work_buffer == NULL) { + data->work_buffer = (lzo_voidp)malloc(data->work_buffer_size); + if (data->work_buffer == NULL) { + archive_set_error(f->archive, ENOMEM, + "Can't allocate data for compression buffer"); + return (ARCHIVE_FATAL); + } + } + if (data->compressed == NULL) { + data->compressed_buffer_size = sizeof(header) + + BLOCK_SIZE + (BLOCK_SIZE >> 4) + 64 + 3; + data->compressed = (unsigned char *) + malloc(data->compressed_buffer_size); + if (data->compressed == NULL) { + archive_set_error(f->archive, ENOMEM, + "Can't allocate data for compression buffer"); + return (ARCHIVE_FATAL); + } + } + if (data->uncompressed == NULL) { + data->uncompressed_buffer_size = BLOCK_SIZE; + data->uncompressed = (unsigned char *) + malloc(data->uncompressed_buffer_size); + if (data->uncompressed == NULL) { + archive_set_error(f->archive, ENOMEM, + "Can't allocate data for compression buffer"); + return (ARCHIVE_FATAL); + } + data->uncompressed_avail_bytes = BLOCK_SIZE; + } + return (ARCHIVE_OK); +} + +static int +make_header(struct archive_write_filter *f) +{ + struct write_lzop *data = (struct write_lzop *)f->data; + int64_t t; + uint32_t checksum; + + memcpy(data->compressed, header, sizeof(header)); + /* Overwrite library version. */ + data->compressed[HEADER_LIBVERSION] = (unsigned char ) + (lzo_version() >> 8) & 0xff; + data->compressed[HEADER_LIBVERSION + 1] = (unsigned char ) + lzo_version() & 0xff; + /* Overwrite method and level. */ + data->compressed[HEADER_METHOD] = (unsigned char)data->method; + data->compressed[HEADER_LEVEL] = data->level; + /* Overwrite mtime with current time. */ + t = (int64_t)time(NULL); + archive_be32enc(&data->compressed[HEADER_MTIME_LOW], + (uint32_t)(t & 0xffffffff)); + archive_be32enc(&data->compressed[HEADER_MTIME_HIGH], + (uint32_t)((t >> 32) & 0xffffffff)); + /* Overwrite header checksum with calculated value. */ + checksum = lzo_adler32(1, data->compressed + HEADER_VERSION, + (lzo_uint)(HEADER_H_CHECKSUM - HEADER_VERSION)); + archive_be32enc(&data->compressed[HEADER_H_CHECKSUM], checksum); + return (sizeof(header)); +} + +static int +drive_compressor(struct archive_write_filter *f) +{ + struct write_lzop *data = (struct write_lzop *)f->data; + unsigned char *p; + const int block_info_bytes = 12; + int header_bytes, r; + lzo_uint usize, csize; + uint32_t checksum; + + if (!data->header_written) { + header_bytes = make_header(f); + data->header_written = 1; + } else + header_bytes = 0; + p = data->compressed; + + usize = (lzo_uint) + (data->uncompressed_buffer_size - data->uncompressed_avail_bytes); + csize = 0; + switch (data->method) { + default: + case METHOD_LZO1X_1: + r = lzo1x_1_compress(data->uncompressed, usize, + p + header_bytes + block_info_bytes, &csize, + data->work_buffer); + break; + case METHOD_LZO1X_1_15: + r = lzo1x_1_15_compress(data->uncompressed, usize, + p + header_bytes + block_info_bytes, &csize, + data->work_buffer); + break; + case METHOD_LZO1X_999: + r = lzo1x_999_compress_level(data->uncompressed, usize, + p + header_bytes + block_info_bytes, &csize, + data->work_buffer, NULL, 0, 0, data->level); + break; + } + if (r != LZO_E_OK) { + archive_set_error(f->archive, ARCHIVE_ERRNO_MISC, + "Lzop compression failed: returned status %d", r); + return (ARCHIVE_FATAL); + } + + /* Store uncompressed size. */ + archive_be32enc(p + header_bytes, (uint32_t)usize); + /* Store the checksum of the uncompressed data. */ + checksum = lzo_adler32(1, data->uncompressed, usize); + archive_be32enc(p + header_bytes + 8, checksum); + + if (csize < usize) { + /* Store compressed size. */ + archive_be32enc(p + header_bytes + 4, (uint32_t)csize); + r = __archive_write_filter(f->next_filter, data->compressed, + header_bytes + block_info_bytes + csize); + } else { + /* + * This case, we output uncompressed data instead. + */ + /* Store uncompressed size as compressed size. */ + archive_be32enc(p + header_bytes + 4, (uint32_t)usize); + r = __archive_write_filter(f->next_filter, data->compressed, + header_bytes + block_info_bytes); + if (r != ARCHIVE_OK) + return (ARCHIVE_FATAL); + r = __archive_write_filter(f->next_filter, data->uncompressed, + usize); + } + + if (r != ARCHIVE_OK) + return (ARCHIVE_FATAL); + return (ARCHIVE_OK); +} + +static int +archive_write_lzop_write(struct archive_write_filter *f, + const void *buff, size_t length) +{ + struct write_lzop *data = (struct write_lzop *)f->data; + const char *p = buff; + int r; + + do { + if (data->uncompressed_avail_bytes > length) { + memcpy(data->uncompressed + + data->uncompressed_buffer_size + - data->uncompressed_avail_bytes, + p, length); + data->uncompressed_avail_bytes -= length; + return (ARCHIVE_OK); + } + + memcpy(data->uncompressed + data->uncompressed_buffer_size + - data->uncompressed_avail_bytes, + p, data->uncompressed_avail_bytes); + length -= data->uncompressed_avail_bytes; + p += data->uncompressed_avail_bytes; + data->uncompressed_avail_bytes = 0; + + r = drive_compressor(f); + if (r != ARCHIVE_OK) return (r); + data->uncompressed_avail_bytes = BLOCK_SIZE; + } while (length); + + return (ARCHIVE_OK); +} + +static int +archive_write_lzop_close(struct archive_write_filter *f) +{ + struct write_lzop *data = (struct write_lzop *)f->data; + const uint32_t endmark = 0; + int r; + + if (data->uncompressed_avail_bytes < BLOCK_SIZE) { + /* Compress and output remaining data. */ + r = drive_compressor(f); + if (r != ARCHIVE_OK) + return (r); + } + /* Write a zero uncompressed size as the end mark of the series of + * compressed block. */ + r = __archive_write_filter(f->next_filter, &endmark, sizeof(endmark)); + if (r != ARCHIVE_OK) + return (r); + return (__archive_write_close_filter(f->next_filter)); +} + +#else +static int +archive_write_lzop_open(struct archive_write_filter *f) +{ + struct write_lzop *data = (struct write_lzop *)f->data; + struct archive_string as; + int r; + + archive_string_init(&as); + archive_strcpy(&as, "lzop"); + /* Specify compression level. */ + if (data->compression_level > 0) { + archive_strappend_char(&as, ' '); + archive_strappend_char(&as, '-'); + archive_strappend_char(&as, '0' + data->compression_level); + } + + r = __archive_write_program_open(f, data->pdata, as.s); + archive_string_free(&as); + return (r); +} + +static int +archive_write_lzop_write(struct archive_write_filter *f, + const void *buff, size_t length) +{ + struct write_lzop *data = (struct write_lzop *)f->data; + + return __archive_write_program_write(f, data->pdata, buff, length); +} + +static int +archive_write_lzop_close(struct archive_write_filter *f) +{ + struct write_lzop *data = (struct write_lzop *)f->data; + + return __archive_write_program_close(f, data->pdata); +} +#endif diff --git a/libarchive/archive_write_add_filter_program.c b/libarchive/archive_write_add_filter_program.c index d7d38f7072da..fc232da0cb5e 100644 --- a/libarchive/archive_write_add_filter_program.c +++ b/libarchive/archive_write_add_filter_program.c @@ -1,5 +1,6 @@ /*- * Copyright (c) 2007 Joerg Sonnenberger + * Copyright (c) 2012 Michihiro NAKAJIMA * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -44,7 +45,9 @@ __FBSDID("$FreeBSD: head/lib/libarchive/archive_write_set_compression_program.c #include "archive.h" #include "archive_private.h" +#include "archive_string.h" #include "archive_write_private.h" +#include "filter_fork.h" #if ARCHIVE_VERSION_NUMBER < 4000000 int @@ -55,36 +58,24 @@ archive_write_set_compression_program(struct archive *a, const char *cmd) } #endif -/* This capability is only available on POSIX systems. */ -#if (!defined(HAVE_PIPE) || !defined(HAVE_FCNTL) || \ - !(defined(HAVE_FORK) || defined(HAVE_VFORK))) && (!defined(_WIN32) || defined(__CYGWIN__)) - -/* - * On non-Posix systems, allow the program to build, but choke if - * this function is actually invoked. - */ -int -archive_write_add_filter_program(struct archive *_a, const char *cmd) -{ - archive_set_error(_a, -1, - "External compression programs not supported on this platform"); - return (ARCHIVE_FATAL); -} - +struct archive_write_program_data { +#if defined(_WIN32) && !defined(__CYGWIN__) + HANDLE child; #else - -#include "filter_fork.h" - -struct private_data { - char *cmd; - char *description; pid_t child; +#endif int child_stdin, child_stdout; char *child_buf; size_t child_buf_len, child_buf_avail; }; +struct private_data { + struct archive_write_program_data *pdata; + struct archive_string description; + char *cmd; +}; + static int archive_compressor_program_open(struct archive_write_filter *); static int archive_compressor_program_write(struct archive_write_filter *, const void *, size_t); @@ -99,35 +90,125 @@ int archive_write_add_filter_program(struct archive *_a, const char *cmd) { struct archive_write_filter *f = __archive_write_allocate_filter(_a); - struct archive_write *a = (struct archive_write *)_a; struct private_data *data; static const char *prefix = "Program: "; - archive_check_magic(&a->archive, ARCHIVE_WRITE_MAGIC, - ARCHIVE_STATE_NEW, "archive_write_add_filter_program"); - data = calloc(1, sizeof(*data)); - if (data == NULL) { - archive_set_error(&a->archive, ENOMEM, "Out of memory"); - return (ARCHIVE_FATAL); - } - data->cmd = strdup(cmd); - data->description = (char *)malloc(strlen(prefix) + strlen(cmd) + 1); - strcpy(data->description, prefix); - strcat(data->description, cmd); - f->name = data->description; - f->data = data; - f->open = &archive_compressor_program_open; - f->code = ARCHIVE_COMPRESSION_PROGRAM; + archive_check_magic(_a, ARCHIVE_WRITE_MAGIC, + ARCHIVE_STATE_NEW, "archive_write_add_filter_program"); + + f->data = calloc(1, sizeof(*data)); + if (f->data == NULL) + goto memerr; + data = (struct private_data *)f->data; + + data->cmd = strdup(cmd); + if (data->cmd == NULL) + goto memerr; + + data->pdata = __archive_write_program_allocate(); + if (data->pdata == NULL) + goto memerr; + + /* Make up a description string. */ + if (archive_string_ensure(&data->description, + strlen(prefix) + strlen(cmd) + 1) == NULL) + goto memerr; + archive_strcpy(&data->description, prefix); + archive_strcat(&data->description, cmd); + + f->name = data->description.s; + f->code = ARCHIVE_FILTER_PROGRAM; + f->open = archive_compressor_program_open; + f->write = archive_compressor_program_write; + f->close = archive_compressor_program_close; + f->free = archive_compressor_program_free; return (ARCHIVE_OK); +memerr: + archive_compressor_program_free(f); + archive_set_error(_a, ENOMEM, + "Can't allocate memory for filter program"); + return (ARCHIVE_FATAL); } -/* - * Setup callback. - */ static int archive_compressor_program_open(struct archive_write_filter *f) { struct private_data *data = (struct private_data *)f->data; + + return __archive_write_program_open(f, data->pdata, data->cmd); +} + +static int +archive_compressor_program_write(struct archive_write_filter *f, + const void *buff, size_t length) +{ + struct private_data *data = (struct private_data *)f->data; + + return __archive_write_program_write(f, data->pdata, buff, length); +} + +static int +archive_compressor_program_close(struct archive_write_filter *f) +{ + struct private_data *data = (struct private_data *)f->data; + + return __archive_write_program_close(f, data->pdata); +} + +static int +archive_compressor_program_free(struct archive_write_filter *f) +{ + struct private_data *data = (struct private_data *)f->data; + + if (data) { + free(data->cmd); + archive_string_free(&data->description); + __archive_write_program_free(data->pdata); + free(data); + f->data = NULL; + } + return (ARCHIVE_OK); +} + +/* + * Allocate resources for executing an external program. + */ +struct archive_write_program_data * +__archive_write_program_allocate(void) +{ + struct archive_write_program_data *data; + + data = calloc(1, sizeof(struct archive_write_program_data)); + if (data == NULL) + return (data); + data->child_stdin = -1; + data->child_stdout = -1; + return (data); +} + +/* + * Release the resources. + */ +int +__archive_write_program_free(struct archive_write_program_data *data) +{ + + if (data) { +#if defined(_WIN32) && !defined(__CYGWIN__) + if (data->child) + CloseHandle(data->child); +#endif + free(data->child_buf); + free(data); + } + return (ARCHIVE_OK); +} + +int +__archive_write_program_open(struct archive_write_filter *f, + struct archive_write_program_data *data, const char *cmd) +{ + pid_t child; int ret; ret = __archive_write_open_filter(f->next_filter); @@ -146,23 +227,34 @@ archive_compressor_program_open(struct archive_write_filter *f) } } - if ((data->child = __archive_create_child(data->cmd, - &data->child_stdin, &data->child_stdout)) == -1) { + child = __archive_create_child(cmd, &data->child_stdin, + &data->child_stdout); + if (child == -1) { archive_set_error(f->archive, EINVAL, "Can't initialise filter"); return (ARCHIVE_FATAL); } - - f->write = archive_compressor_program_write; - f->close = archive_compressor_program_close; - f->free = archive_compressor_program_free; - return (0); +#if defined(_WIN32) && !defined(__CYGWIN__) + data->child = OpenProcess(PROCESS_QUERY_INFORMATION, FALSE, child); + if (data->child == NULL) { + close(data->child_stdin); + data->child_stdin = -1; + close(data->child_stdout); + data->child_stdout = -1; + archive_set_error(f->archive, EINVAL, + "Can't initialise filter"); + return (ARCHIVE_FATAL); + } +#else + data->child = child; +#endif + return (ARCHIVE_OK); } static ssize_t -child_write(struct archive_write_filter *f, const char *buf, size_t buf_len) +child_write(struct archive_write_filter *f, + struct archive_write_program_data *data, const char *buf, size_t buf_len) { - struct private_data *data = f->data; ssize_t ret; if (data->child_stdin == -1) @@ -218,30 +310,28 @@ child_write(struct archive_write_filter *f, const char *buf, size_t buf_len) ret = __archive_write_filter(f->next_filter, data->child_buf, data->child_buf_avail); - if (ret <= 0) + if (ret != ARCHIVE_OK) return (-1); - - if ((size_t)ret < data->child_buf_avail) { - memmove(data->child_buf, data->child_buf + ret, - data->child_buf_avail - ret); - } - data->child_buf_avail -= ret; + data->child_buf_avail = 0; } } /* - * Write data to the compressed stream. + * Write data to the filter stream. */ -static int -archive_compressor_program_write(struct archive_write_filter *f, - const void *buff, size_t length) +int +__archive_write_program_write(struct archive_write_filter *f, + struct archive_write_program_data *data, const void *buff, size_t length) { ssize_t ret; const char *buf; + if (data->child == 0) + return (ARCHIVE_OK); + buf = buff; while (length > 0) { - ret = child_write(f, buf, length); + ret = child_write(f, data, buf, length); if (ret == -1 || ret == 0) { archive_set_error(f->archive, EIO, "Can't write to filter"); @@ -253,17 +343,19 @@ archive_compressor_program_write(struct archive_write_filter *f, return (ARCHIVE_OK); } - /* - * Finish the compression... + * Finish the filtering... */ -static int -archive_compressor_program_close(struct archive_write_filter *f) +int +__archive_write_program_close(struct archive_write_filter *f, + struct archive_write_program_data *data) { - struct private_data *data = (struct private_data *)f->data; int ret, r1, status; ssize_t bytes_read; + if (data->child == 0) + return __archive_write_close_filter(f->next_filter); + ret = 0; close(data->child_stdin); data->child_stdin = -1; @@ -304,6 +396,10 @@ archive_compressor_program_close(struct archive_write_filter *f) close(data->child_stdout); while (waitpid(data->child, &status, 0) == -1 && errno == EINTR) continue; +#if defined(_WIN32) && !defined(__CYGWIN__) + CloseHandle(data->child); +#endif + data->child = 0; if (status != 0) { archive_set_error(f->archive, EIO, @@ -314,16 +410,3 @@ archive_compressor_program_close(struct archive_write_filter *f) return (r1 < ret ? r1 : ret); } -static int -archive_compressor_program_free(struct archive_write_filter *f) -{ - struct private_data *data = (struct private_data *)f->data; - free(data->cmd); - free(data->description); - free(data->child_buf); - free(data); - f->data = NULL; - return (ARCHIVE_OK); -} - -#endif /* !defined(HAVE_PIPE) || !defined(HAVE_VFORK) || !defined(HAVE_FCNTL) */ diff --git a/libarchive/archive_write_add_filter_uuencode.c b/libarchive/archive_write_add_filter_uuencode.c new file mode 100644 index 000000000000..23d9c150d17f --- /dev/null +++ b/libarchive/archive_write_add_filter_uuencode.c @@ -0,0 +1,305 @@ +/*- + * Copyright (c) 2012 Michihiro NAKAJIMA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "archive_platform.h" + +__FBSDID("$FreeBSD$"); + +#ifdef HAVE_ERRNO_H +#include +#endif +#ifdef HAVE_STDLIB_H +#include +#endif +#ifdef HAVE_STRING_H +#include +#endif + +#include "archive.h" +#include "archive_private.h" +#include "archive_string.h" +#include "archive_write_private.h" + +#define LBYTES 45 + +struct private_uuencode { + int mode; + struct archive_string name; + struct archive_string encoded_buff; + size_t bs; + size_t hold_len; + unsigned char hold[LBYTES]; +}; + +static int archive_filter_uuencode_options(struct archive_write_filter *, + const char *, const char *); +static int archive_filter_uuencode_open(struct archive_write_filter *); +static int archive_filter_uuencode_write(struct archive_write_filter *, + const void *, size_t); +static int archive_filter_uuencode_close(struct archive_write_filter *); +static int archive_filter_uuencode_free(struct archive_write_filter *); +static void uu_encode(struct archive_string *, const unsigned char *, size_t); +static int64_t atol8(const char *, size_t); + +/* + * Add a compress filter to this write handle. + */ +int +archive_write_add_filter_uuencode(struct archive *_a) +{ + struct archive_write *a = (struct archive_write *)_a; + struct archive_write_filter *f = __archive_write_allocate_filter(_a); + struct private_uuencode *state; + + archive_check_magic(&a->archive, ARCHIVE_WRITE_MAGIC, + ARCHIVE_STATE_NEW, "archive_write_add_filter_uu"); + + state = (struct private_uuencode *)calloc(1, sizeof(*state)); + if (state == NULL) { + archive_set_error(f->archive, ENOMEM, + "Can't allocate data for uuencode filter"); + return (ARCHIVE_FATAL); + } + archive_strcpy(&state->name, "-"); + state->mode = 0644; + + f->data = state; + f->name = "uuencode"; + f->code = ARCHIVE_FILTER_UU; + f->open = archive_filter_uuencode_open; + f->options = archive_filter_uuencode_options; + f->write = archive_filter_uuencode_write; + f->close = archive_filter_uuencode_close; + f->free = archive_filter_uuencode_free; + + return (ARCHIVE_OK); +} + +/* + * Set write options. + */ +static int +archive_filter_uuencode_options(struct archive_write_filter *f, const char *key, + const char *value) +{ + struct private_uuencode *state = (struct private_uuencode *)f->data; + + if (strcmp(key, "mode") == 0) { + if (value == NULL) { + archive_set_error(f->archive, ARCHIVE_ERRNO_MISC, + "mode option requires octal digits"); + return (ARCHIVE_FAILED); + } + state->mode = (int)atol8(value, strlen(value)) & 0777; + return (ARCHIVE_OK); + } else if (strcmp(key, "name") == 0) { + if (value == NULL) { + archive_set_error(f->archive, ARCHIVE_ERRNO_MISC, + "name option requires a string"); + return (ARCHIVE_FAILED); + } + archive_strcpy(&state->name, value); + return (ARCHIVE_OK); + } + + /* Note: The "warn" return is just to inform the options + * supervisor that we didn't handle it. It will generate + * a suitable error if no one used this option. */ + return (ARCHIVE_WARN); +} + +/* + * Setup callback. + */ +static int +archive_filter_uuencode_open(struct archive_write_filter *f) +{ + struct private_uuencode *state = (struct private_uuencode *)f->data; + size_t bs = 65536, bpb; + int ret; + + ret = __archive_write_open_filter(f->next_filter); + if (ret != ARCHIVE_OK) + return (ret); + + if (f->archive->magic == ARCHIVE_WRITE_MAGIC) { + /* Buffer size should be a multiple number of the of bytes + * per block for performance. */ + bpb = archive_write_get_bytes_per_block(f->archive); + if (bpb > bs) + bs = bpb; + else if (bpb != 0) + bs -= bs % bpb; + } + + state->bs = bs; + if (archive_string_ensure(&state->encoded_buff, bs + 512) == NULL) { + archive_set_error(f->archive, ENOMEM, + "Can't allocate data for uuencode buffer"); + return (ARCHIVE_FATAL); + } + + archive_string_sprintf(&state->encoded_buff, "begin %o %s\n", + state->mode, state->name.s); + + f->data = state; + return (0); +} + +static void +uu_encode(struct archive_string *as, const unsigned char *p, size_t len) +{ + int c; + + c = (int)len; + archive_strappend_char(as, c?c + 0x20:'`'); + for (; len >= 3; p += 3, len -= 3) { + c = p[0] >> 2; + archive_strappend_char(as, c?c + 0x20:'`'); + c = ((p[0] & 0x03) << 4) | ((p[1] & 0xf0) >> 4); + archive_strappend_char(as, c?c + 0x20:'`'); + c = ((p[1] & 0x0f) << 2) | ((p[2] & 0xc0) >> 6); + archive_strappend_char(as, c?c + 0x20:'`'); + c = p[2] & 0x3f; + archive_strappend_char(as, c?c + 0x20:'`'); + } + if (len > 0) { + c = p[0] >> 2; + archive_strappend_char(as, c?c + 0x20:'`'); + c = (p[0] & 0x03) << 4; + if (len == 1) { + archive_strappend_char(as, c?c + 0x20:'`'); + archive_strappend_char(as, '`'); + archive_strappend_char(as, '`'); + } else { + c |= (p[1] & 0xf0) >> 4; + archive_strappend_char(as, c?c + 0x20:'`'); + c = (p[1] & 0x0f) << 2; + archive_strappend_char(as, c?c + 0x20:'`'); + archive_strappend_char(as, '`'); + } + } + archive_strappend_char(as, '\n'); +} + +/* + * Write data to the encoded stream. + */ +static int +archive_filter_uuencode_write(struct archive_write_filter *f, const void *buff, + size_t length) +{ + struct private_uuencode *state = (struct private_uuencode *)f->data; + const unsigned char *p = buff; + int ret = ARCHIVE_OK; + + if (length == 0) + return (ret); + + if (state->hold_len) { + while (state->hold_len < LBYTES && length > 0) { + state->hold[state->hold_len++] = *p++; + length--; + } + if (state->hold_len < LBYTES) + return (ret); + uu_encode(&state->encoded_buff, state->hold, LBYTES); + state->hold_len = 0; + } + + for (; length >= LBYTES; length -= LBYTES, p += LBYTES) + uu_encode(&state->encoded_buff, p, LBYTES); + + /* Save remaining bytes. */ + if (length > 0) { + memcpy(state->hold, p, length); + state->hold_len = length; + } + while (archive_strlen(&state->encoded_buff) >= state->bs) { + ret = __archive_write_filter(f->next_filter, + state->encoded_buff.s, state->bs); + memmove(state->encoded_buff.s, + state->encoded_buff.s + state->bs, + state->encoded_buff.length - state->bs); + state->encoded_buff.length -= state->bs; + } + + return (ret); +} + + +/* + * Finish the compression... + */ +static int +archive_filter_uuencode_close(struct archive_write_filter *f) +{ + struct private_uuencode *state = (struct private_uuencode *)f->data; + int ret, ret2; + + /* Flush remaining bytes. */ + if (state->hold_len != 0) + uu_encode(&state->encoded_buff, state->hold, state->hold_len); + archive_string_sprintf(&state->encoded_buff, "`\nend\n"); + /* Write the last block */ + archive_write_set_bytes_in_last_block(f->archive, 1); + ret = __archive_write_filter(f->next_filter, + state->encoded_buff.s, archive_strlen(&state->encoded_buff)); + ret2 = __archive_write_close_filter(f->next_filter); + if (ret > ret2) + ret = ret2; + return (ret); +} + +static int +archive_filter_uuencode_free(struct archive_write_filter *f) +{ + struct private_uuencode *state = (struct private_uuencode *)f->data; + + archive_string_free(&state->name); + archive_string_free(&state->encoded_buff); + free(state); + return (ARCHIVE_OK); +} + +static int64_t +atol8(const char *p, size_t char_cnt) +{ + int64_t l; + int digit; + + l = 0; + while (char_cnt-- > 0) { + if (*p >= '0' && *p <= '7') + digit = *p - '0'; + else + break; + p++; + l <<= 3; + l |= digit; + } + return (l); +} + diff --git a/libarchive/archive_write_add_filter_xz.c b/libarchive/archive_write_add_filter_xz.c index 834d59670167..fa73311e7ef4 100644 --- a/libarchive/archive_write_add_filter_xz.c +++ b/libarchive/archive_write_add_filter_xz.c @@ -172,7 +172,7 @@ archive_write_add_filter_xz(struct archive *_a) f = __archive_write_allocate_filter(_a); r = common_setup(f); if (r == ARCHIVE_OK) { - f->code = ARCHIVE_COMPRESSION_XZ; + f->code = ARCHIVE_FILTER_XZ; f->name = "xz"; } return (r); @@ -192,7 +192,7 @@ archive_write_add_filter_lzma(struct archive *_a) f = __archive_write_allocate_filter(_a); r = common_setup(f); if (r == ARCHIVE_OK) { - f->code = ARCHIVE_COMPRESSION_LZMA; + f->code = ARCHIVE_FILTER_LZMA; f->name = "lzma"; } return (r); @@ -209,7 +209,7 @@ archive_write_add_filter_lzip(struct archive *_a) f = __archive_write_allocate_filter(_a); r = common_setup(f); if (r == ARCHIVE_OK) { - f->code = ARCHIVE_COMPRESSION_LZIP; + f->code = ARCHIVE_FILTER_LZIP; f->name = "lzip"; } return (r); @@ -225,12 +225,12 @@ archive_compressor_xz_init_stream(struct archive_write_filter *f, data->stream = lzma_stream_init_data; data->stream.next_out = data->compressed; data->stream.avail_out = data->compressed_buffer_size; - if (f->code == ARCHIVE_COMPRESSION_XZ) + if (f->code == ARCHIVE_FILTER_XZ) ret = lzma_stream_encoder(&(data->stream), data->lzmafilters, LZMA_CHECK_CRC64); - else if (f->code == ARCHIVE_COMPRESSION_LZMA) + else if (f->code == ARCHIVE_FILTER_LZMA) ret = lzma_alone_encoder(&(data->stream), &data->lzma_opt); - else { /* ARCHIVE_COMPRESSION_LZIP */ + else { /* ARCHIVE_FILTER_LZIP */ int dict_size = data->lzma_opt.dict_size; int ds, log2dic, wedges; @@ -321,7 +321,7 @@ archive_compressor_xz_open(struct archive_write_filter *f) f->write = archive_compressor_xz_write; /* Initialize compression library. */ - if (f->code == ARCHIVE_COMPRESSION_LZIP) { + if (f->code == ARCHIVE_FILTER_LZIP) { const struct option_value *val = &option_values[data->compression_level]; @@ -393,7 +393,7 @@ archive_compressor_xz_write(struct archive_write_filter *f, /* Update statistics */ data->total_in += length; - if (f->code == ARCHIVE_COMPRESSION_LZIP) + if (f->code == ARCHIVE_FILTER_LZIP) data->crc32 = lzma_crc32(buff, length, data->crc32); /* Compress input data to output buffer */ @@ -422,7 +422,7 @@ archive_compressor_xz_close(struct archive_write_filter *f) ret = __archive_write_filter(f->next_filter, data->compressed, data->compressed_buffer_size - data->stream.avail_out); - if (f->code == ARCHIVE_COMPRESSION_LZIP && ret == ARCHIVE_OK) { + if (f->code == ARCHIVE_FILTER_LZIP && ret == ARCHIVE_OK) { archive_le32enc(data->compressed, data->crc32); archive_le64enc(data->compressed+4, data->total_in); archive_le64enc(data->compressed+12, data->total_out + 20); diff --git a/libarchive/archive_write_disk_acl.c b/libarchive/archive_write_disk_acl.c new file mode 100644 index 000000000000..97972033c080 --- /dev/null +++ b/libarchive/archive_write_disk_acl.c @@ -0,0 +1,249 @@ +/*- + * Copyright (c) 2003-2010 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 + * 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 "archive_platform.h" +__FBSDID("$FreeBSD: head/lib/libarchive/archive_write_disk.c 201159 2009-12-29 05:35:40Z kientzle $"); + +#ifdef HAVE_SYS_TYPES_H +#include +#endif +#ifdef HAVE_SYS_ACL_H +#define _ACL_PRIVATE /* For debugging */ +#include +#endif +#ifdef HAVE_ERRNO_H +#include +#endif + +#include "archive.h" +#include "archive_entry.h" +#include "archive_acl_private.h" +#include "archive_write_disk_private.h" + +#if !defined(HAVE_POSIX_ACL) || !defined(ACL_TYPE_NFS4) +/* Default empty function body to satisfy mainline code. */ +int +archive_write_disk_set_acls(struct archive *a, int fd, const char *name, + struct archive_acl *abstract_acl) +{ + (void)a; /* UNUSED */ + (void)fd; /* UNUSED */ + (void)name; /* UNUSED */ + (void)abstract_acl; /* UNUSED */ + return (ARCHIVE_OK); +} + +#else + +static int set_acl(struct archive *, int fd, const char *, + struct archive_acl *, + acl_type_t, int archive_entry_acl_type, const char *tn); + +/* + * XXX TODO: What about ACL types other than ACCESS and DEFAULT? + */ +int +archive_write_disk_set_acls(struct archive *a, int fd, const char *name, + struct archive_acl *abstract_acl) +{ + int ret; + + if (archive_acl_count(abstract_acl, ARCHIVE_ENTRY_ACL_TYPE_POSIX1E) > 0) { + ret = set_acl(a, fd, name, abstract_acl, ACL_TYPE_ACCESS, + ARCHIVE_ENTRY_ACL_TYPE_ACCESS, "access"); + if (ret != ARCHIVE_OK) + return (ret); + ret = set_acl(a, fd, name, abstract_acl, ACL_TYPE_DEFAULT, + ARCHIVE_ENTRY_ACL_TYPE_DEFAULT, "default"); + return (ret); + } else if (archive_acl_count(abstract_acl, ARCHIVE_ENTRY_ACL_TYPE_NFS4) > 0) { + ret = set_acl(a, fd, name, abstract_acl, ACL_TYPE_NFS4, + ARCHIVE_ENTRY_ACL_TYPE_NFS4, "nfs4"); + return (ret); + } else + return ARCHIVE_OK; +} + +static struct { + int archive_perm; + int platform_perm; +} acl_perm_map[] = { + {ARCHIVE_ENTRY_ACL_EXECUTE, ACL_EXECUTE}, + {ARCHIVE_ENTRY_ACL_WRITE, ACL_WRITE}, + {ARCHIVE_ENTRY_ACL_READ, ACL_READ}, + {ARCHIVE_ENTRY_ACL_READ_DATA, ACL_READ_DATA}, + {ARCHIVE_ENTRY_ACL_LIST_DIRECTORY, ACL_LIST_DIRECTORY}, + {ARCHIVE_ENTRY_ACL_WRITE_DATA, ACL_WRITE_DATA}, + {ARCHIVE_ENTRY_ACL_ADD_FILE, ACL_ADD_FILE}, + {ARCHIVE_ENTRY_ACL_APPEND_DATA, ACL_APPEND_DATA}, + {ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY, ACL_ADD_SUBDIRECTORY}, + {ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS, ACL_READ_NAMED_ATTRS}, + {ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS, ACL_WRITE_NAMED_ATTRS}, + {ARCHIVE_ENTRY_ACL_DELETE_CHILD, ACL_DELETE_CHILD}, + {ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES, ACL_READ_ATTRIBUTES}, + {ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES, ACL_WRITE_ATTRIBUTES}, + {ARCHIVE_ENTRY_ACL_DELETE, ACL_DELETE}, + {ARCHIVE_ENTRY_ACL_READ_ACL, ACL_READ_ACL}, + {ARCHIVE_ENTRY_ACL_WRITE_ACL, ACL_WRITE_ACL}, + {ARCHIVE_ENTRY_ACL_WRITE_OWNER, ACL_WRITE_OWNER}, + {ARCHIVE_ENTRY_ACL_SYNCHRONIZE, ACL_SYNCHRONIZE} +}; + +static struct { + int archive_inherit; + int platform_inherit; +} acl_inherit_map[] = { + {ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT, ACL_ENTRY_FILE_INHERIT}, + {ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT, ACL_ENTRY_DIRECTORY_INHERIT}, + {ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT, ACL_ENTRY_NO_PROPAGATE_INHERIT}, + {ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY, ACL_ENTRY_INHERIT_ONLY} +}; + +static int +set_acl(struct archive *a, int fd, const char *name, + struct archive_acl *abstract_acl, + acl_type_t acl_type, int ae_requested_type, const char *tname) +{ + acl_t acl; + acl_entry_t acl_entry; + acl_permset_t acl_permset; + acl_flagset_t acl_flagset; + int ret; + int ae_type, ae_permset, ae_tag, ae_id; + uid_t ae_uid; + gid_t ae_gid; + const char *ae_name; + int entries; + int i; + + ret = ARCHIVE_OK; + entries = archive_acl_reset(abstract_acl, ae_requested_type); + if (entries == 0) + return (ARCHIVE_OK); + acl = acl_init(entries); + while (archive_acl_next(a, abstract_acl, ae_requested_type, &ae_type, + &ae_permset, &ae_tag, &ae_id, &ae_name) == ARCHIVE_OK) { + acl_create_entry(&acl, &acl_entry); + + switch (ae_tag) { + case ARCHIVE_ENTRY_ACL_USER: + acl_set_tag_type(acl_entry, ACL_USER); + ae_uid = archive_write_disk_uid(a, ae_name, ae_id); + acl_set_qualifier(acl_entry, &ae_uid); + break; + case ARCHIVE_ENTRY_ACL_GROUP: + acl_set_tag_type(acl_entry, ACL_GROUP); + ae_gid = archive_write_disk_gid(a, ae_name, ae_id); + acl_set_qualifier(acl_entry, &ae_gid); + break; + case ARCHIVE_ENTRY_ACL_USER_OBJ: + acl_set_tag_type(acl_entry, ACL_USER_OBJ); + break; + case ARCHIVE_ENTRY_ACL_GROUP_OBJ: + acl_set_tag_type(acl_entry, ACL_GROUP_OBJ); + break; + case ARCHIVE_ENTRY_ACL_MASK: + acl_set_tag_type(acl_entry, ACL_MASK); + break; + case ARCHIVE_ENTRY_ACL_OTHER: + acl_set_tag_type(acl_entry, ACL_OTHER); + break; + case ARCHIVE_ENTRY_ACL_EVERYONE: + acl_set_tag_type(acl_entry, ACL_EVERYONE); + break; + default: + /* XXX */ + break; + } + + switch (ae_type) { + case ARCHIVE_ENTRY_ACL_TYPE_ALLOW: + acl_set_entry_type_np(acl_entry, ACL_ENTRY_TYPE_ALLOW); + break; + case ARCHIVE_ENTRY_ACL_TYPE_DENY: + acl_set_entry_type_np(acl_entry, ACL_ENTRY_TYPE_DENY); + break; + case ARCHIVE_ENTRY_ACL_TYPE_AUDIT: + acl_set_entry_type_np(acl_entry, ACL_ENTRY_TYPE_AUDIT); + break; + case ARCHIVE_ENTRY_ACL_TYPE_ALARM: + acl_set_entry_type_np(acl_entry, ACL_ENTRY_TYPE_ALARM); + break; + case ARCHIVE_ENTRY_ACL_TYPE_ACCESS: + case ARCHIVE_ENTRY_ACL_TYPE_DEFAULT: + // These don't translate directly into the system ACL. + break; + default: + // XXX error handling here. + break; + } + + acl_get_permset(acl_entry, &acl_permset); + acl_clear_perms(acl_permset); + + for (i = 0; i < (int)(sizeof(acl_perm_map) / sizeof(acl_perm_map[0])); ++i) { + if (ae_permset & acl_perm_map[i].archive_perm) + acl_add_perm(acl_permset, + acl_perm_map[i].platform_perm); + } + + acl_get_flagset_np(acl_entry, &acl_flagset); + acl_clear_flags_np(acl_flagset); + for (i = 0; i < (int)(sizeof(acl_inherit_map) / sizeof(acl_inherit_map[0])); ++i) { + if (ae_permset & acl_inherit_map[i].archive_inherit) + acl_add_flag_np(acl_flagset, + acl_inherit_map[i].platform_inherit); + } + } + + /* Try restoring the ACL through 'fd' if we can. */ +#if HAVE_ACL_SET_FD + if (fd >= 0 && acl_type == ACL_TYPE_ACCESS && acl_set_fd(fd, acl) == 0) + ret = ARCHIVE_OK; + else +#else +#if HAVE_ACL_SET_FD_NP + if (fd >= 0 && acl_set_fd_np(fd, acl, acl_type) == 0) + ret = ARCHIVE_OK; + else +#endif +#endif +#if HAVE_ACL_SET_LINK_NP + if (acl_set_link_np(name, acl_type, acl) != 0) { + archive_set_error(a, errno, "Failed to set %s acl", tname); + ret = ARCHIVE_WARN; + } +#else + /* TODO: Skip this if 'name' is a symlink. */ + if (acl_set_file(name, acl_type, acl) != 0) { + archive_set_error(a, errno, "Failed to set %s acl", tname); + ret = ARCHIVE_WARN; + } +#endif + acl_free(acl); + return (ret); +} +#endif diff --git a/libarchive/archive_write_disk_posix.c b/libarchive/archive_write_disk_posix.c index d79b0f685a3d..bbd50a637648 100644 --- a/libarchive/archive_write_disk_posix.c +++ b/libarchive/archive_write_disk_posix.c @@ -1,5 +1,6 @@ /*- * Copyright (c) 2003-2010 Tim Kientzle + * Copyright (c) 2012 Michihiro NAKAJIMA * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -38,15 +39,14 @@ __FBSDID("$FreeBSD$"); #ifdef HAVE_SYS_EXTATTR_H #include #endif -#ifdef HAVE_SYS_XATTR_H +#if defined(HAVE_SYS_XATTR_H) #include +#elif defined(HAVE_ATTR_XATTR_H) +#include #endif #ifdef HAVE_SYS_EA_H #include #endif -#ifdef HAVE_ATTR_XATTR_H -#include -#endif #ifdef HAVE_SYS_IOCTL_H #include #endif @@ -118,6 +118,10 @@ __FBSDID("$FreeBSD$"); #endif #endif +#ifdef HAVE_ZLIB_H +#include +#endif + /* TODO: Support Mac OS 'quarantine' feature. This is really just a * standard tag to mark files that have been downloaded as "tainted". * On Mac OS, we should mark the extracted files as tainted if the @@ -127,12 +131,17 @@ __FBSDID("$FreeBSD$"); #include "archive.h" #include "archive_acl_private.h" #include "archive_string.h" +#include "archive_endian.h" #include "archive_entry.h" #include "archive_private.h" +#include "archive_write_disk_private.h" #ifndef O_BINARY #define O_BINARY 0 #endif +#ifndef O_CLOEXEC +#define O_CLOEXEC 0 +#endif struct fixup_entry { struct fixup_entry *next; @@ -172,6 +181,7 @@ struct fixup_entry { #define TODO_SUID_CHECK 0x08000000 #define TODO_SGID 0x04000000 #define TODO_SGID_CHECK 0x02000000 +#define TODO_APPLEDOUBLE 0x01000000 #define TODO_MODE (TODO_MODE_BASE|TODO_SUID|TODO_SGID) #define TODO_TIMES ARCHIVE_EXTRACT_TIME #define TODO_OWNER ARCHIVE_EXTRACT_OWNER @@ -179,6 +189,7 @@ struct fixup_entry { #define TODO_ACLS ARCHIVE_EXTRACT_ACL #define TODO_XATTR ARCHIVE_EXTRACT_XATTR #define TODO_MAC_METADATA ARCHIVE_EXTRACT_MAC_METADATA +#define TODO_HFS_COMPRESSION ARCHIVE_EXTRACT_HFS_COMPRESSION_FORCED struct archive_write_disk { struct archive archive; @@ -239,6 +250,36 @@ struct archive_write_disk { /* UID/GID to use in restoring this entry. */ int64_t uid; int64_t gid; + /* + * HFS+ Compression. + */ + /* Xattr "com.apple.decmpfs". */ + uint32_t decmpfs_attr_size; + unsigned char *decmpfs_header_p; + /* ResourceFork set options used for fsetxattr. */ + int rsrc_xattr_options; + /* Xattr "com.apple.ResourceFork". */ + unsigned char *resource_fork; + size_t resource_fork_allocated_size; + unsigned int decmpfs_block_count; + uint32_t *decmpfs_block_info; + /* Buffer for compressed data. */ + unsigned char *compressed_buffer; + size_t compressed_buffer_size; + size_t compressed_buffer_remaining; + /* The offset of the ResourceFork where compressed data will + * be placed. */ + uint32_t compressed_rsrc_position; + uint32_t compressed_rsrc_position_v; + /* Buffer for uncompressed data. */ + char *uncompressed_buffer; + size_t block_remaining_bytes; + size_t file_remaining_bytes; +#ifdef HAVE_ZLIB_H + z_stream stream; + int stream_valid; + int decmpfs_compression_level; +#endif }; /* @@ -256,6 +297,35 @@ struct archive_write_disk { #define MINIMUM_DIR_MODE 0700 #define MAXIMUM_DIR_MODE 0775 +/* + * Maxinum uncompressed size of a decmpfs block. + */ +#define MAX_DECMPFS_BLOCK_SIZE (64 * 1024) +/* + * HFS+ compression type. + */ +#define CMP_XATTR 3/* Compressed data in xattr. */ +#define CMP_RESOURCE_FORK 4/* Compressed data in resource fork. */ +/* + * HFS+ compression resource fork. + */ +#define RSRC_H_SIZE 260 /* Base size of Resource fork header. */ +#define RSRC_F_SIZE 50 /* Size of Resource fork footer. */ +/* Size to write compressed data to resource fork. */ +#define COMPRESSED_W_SIZE (64 * 1024) +/* decmpfs difinitions. */ +#define MAX_DECMPFS_XATTR_SIZE 3802 +#ifndef DECMPFS_XATTR_NAME +#define DECMPFS_XATTR_NAME "com.apple.decmpfs" +#endif +#define DECMPFS_MAGIC 0x636d7066 +#define DECMPFS_COMPRESSION_MAGIC 0 +#define DECMPFS_COMPRESSION_TYPE 4 +#define DECMPFS_UNCOMPRESSED_SIZE 8 +#define DECMPFS_HEADER_SIZE 16 + +#define HFS_BLOCKS(s) ((s) >> 12) + static int check_symlinks(struct archive_write_disk *); static int create_filesystem_object(struct archive_write_disk *); static struct fixup_entry *current_fixup(struct archive_write_disk *, const char *pathname); @@ -265,13 +335,11 @@ static void edit_deep_directories(struct archive_write_disk *ad); static int cleanup_pathname(struct archive_write_disk *); static int create_dir(struct archive_write_disk *, char *); static int create_parent_dir(struct archive_write_disk *, char *); +static ssize_t hfs_write_data_block(struct archive_write_disk *, + const char *, size_t); +static int fixup_appledouble(struct archive_write_disk *, const char *); static int older(struct stat *, struct archive_entry *); static int restore_entry(struct archive_write_disk *); -#ifdef HAVE_POSIX_ACL -static int set_acl(struct archive_write_disk *, int fd, const char *, struct archive_acl *, - acl_type_t, int archive_entry_acl_type, const char *tn); -#endif -static int set_acls(struct archive_write_disk *, int fd, const char *, struct archive_acl *); static int set_mac_metadata(struct archive_write_disk *, const char *, const void *, size_t); static int set_xattrs(struct archive_write_disk *); @@ -485,6 +553,39 @@ _archive_write_disk_header(struct archive *_a, struct archive_entry *entry) else a->todo |= TODO_MAC_METADATA; } +#if defined(__APPLE__) && defined(UF_COMPRESSED) && defined(HAVE_ZLIB_H) + if ((a->flags & ARCHIVE_EXTRACT_NO_HFS_COMPRESSION) == 0) { + unsigned long set, clear; + archive_entry_fflags(a->entry, &set, &clear); + if ((set & ~clear) & UF_COMPRESSED) { + a->todo |= TODO_HFS_COMPRESSION; + a->decmpfs_block_count = (unsigned)-1; + } + } + if ((a->flags & ARCHIVE_EXTRACT_HFS_COMPRESSION_FORCED) != 0 && + (a->mode & AE_IFMT) == AE_IFREG && a->filesize > 0) { + a->todo |= TODO_HFS_COMPRESSION; + a->decmpfs_block_count = (unsigned)-1; + } + { + const char *p; + + /* Check if the current file name is a type of the + * resource fork file. */ + p = strrchr(a->name, '/'); + if (p == NULL) + p = a->name; + else + p++; + if (p[0] == '.' && p[1] == '_') { + /* Do not compress "._XXX" files. */ + a->todo &= ~TODO_HFS_COMPRESSION; + if (a->filesize > 0) + a->todo |= TODO_APPLEDOUBLE; + } + } +#endif + if (a->flags & ARCHIVE_EXTRACT_XATTR) a->todo |= TODO_XATTR; if (a->flags & ARCHIVE_EXTRACT_FFLAGS) @@ -501,6 +602,25 @@ _archive_write_disk_header(struct archive *_a, struct archive_entry *entry) ret = restore_entry(a); +#if defined(__APPLE__) && defined(UF_COMPRESSED) && defined(HAVE_ZLIB_H) + /* + * Check if the filesystem the file is restoring on supports + * HFS+ Compression. If not, cancel HFS+ Compression. + */ + if (a->todo | TODO_HFS_COMPRESSION) { + /* + * NOTE: UF_COMPRESSED is ignored even if the filesystem + * supports HFS+ Compression because the file should + * have at least an extended attriute "com.apple.decmpfs" + * before the flag is set to indicate that the file have + * been compressed. If hte filesystem does not support + * HFS+ Compression the system call will fail. + */ + if (a->fd < 0 || fchflags(a->fd, UF_COMPRESSED) != 0) + a->todo &= ~TODO_HFS_COMPRESSION; + } +#endif + /* * TODO: There are rumours that some extended attributes must * be restored before file data is written. If this is true, @@ -532,6 +652,8 @@ _archive_write_disk_header(struct archive *_a, struct archive_entry *entry) */ if (a->deferred & TODO_MODE) { fe = current_fixup(a, archive_entry_pathname(entry)); + if (fe == NULL) + return (ARCHIVE_FATAL); fe->fixup |= TODO_MODE_BASE; fe->mode = a->mode; } @@ -540,6 +662,8 @@ _archive_write_disk_header(struct archive *_a, struct archive_entry *entry) && (archive_entry_mtime_is_set(entry) || archive_entry_atime_is_set(entry))) { fe = current_fixup(a, archive_entry_pathname(entry)); + if (fe == NULL) + return (ARCHIVE_FATAL); fe->mode = a->mode; fe->fixup |= TODO_TIMES; if (archive_entry_atime_is_set(entry)) { @@ -570,6 +694,9 @@ _archive_write_disk_header(struct archive *_a, struct archive_entry *entry) if (a->deferred & TODO_ACLS) { fe = current_fixup(a, archive_entry_pathname(entry)); + if (fe == NULL) + return (ARCHIVE_FATAL); + fe->fixup |= TODO_ACLS; archive_acl_copy(&fe->acl, archive_entry_acl(entry)); } @@ -579,6 +706,8 @@ _archive_write_disk_header(struct archive *_a, struct archive_entry *entry) metadata = archive_entry_mac_metadata(a->entry, &metadata_size); if (metadata != NULL && metadata_size > 0) { fe = current_fixup(a, archive_entry_pathname(entry)); + if (fe == NULL) + return (ARCHIVE_FATAL); fe->mac_metadata = malloc(metadata_size); if (fe->mac_metadata != NULL) { memcpy(fe->mac_metadata, metadata, metadata_size); @@ -590,6 +719,8 @@ _archive_write_disk_header(struct archive *_a, struct archive_entry *entry) if (a->deferred & TODO_FFLAGS) { fe = current_fixup(a, archive_entry_pathname(entry)); + if (fe == NULL) + return (ARCHIVE_FATAL); fe->fixup |= TODO_FFLAGS; /* TODO: Complete this.. defer fflags from below. */ } @@ -707,6 +838,616 @@ write_data_block(struct archive_write_disk *a, const char *buff, size_t size) return (start_size - size); } +#if defined(__APPLE__) && defined(UF_COMPRESSED) && defined(HAVE_SYS_XATTR_H)\ + && defined(HAVE_ZLIB_H) + +/* + * Set UF_COMPRESSED file flag. + * This have to be called after hfs_write_decmpfs() because if the + * file does not have "com.apple.decmpfs" xattr the flag is ignored. + */ +static int +hfs_set_compressed_fflag(struct archive_write_disk *a) +{ + int r; + + if ((r = lazy_stat(a)) != ARCHIVE_OK) + return (r); + + a->st.st_flags |= UF_COMPRESSED; + if (fchflags(a->fd, a->st.st_flags) != 0) { + archive_set_error(&a->archive, errno, + "Failed to set UF_COMPRESSED file flag"); + return (ARCHIVE_WARN); + } + return (ARCHIVE_OK); +} + +/* + * HFS+ Compression decmpfs + * + * +------------------------------+ +0 + * | Magic(LE 4 bytes) | + * +------------------------------+ + * | Type(LE 4 bytes) | + * +------------------------------+ + * | Uncompressed size(LE 8 bytes)| + * +------------------------------+ +16 + * | | + * | Compressed data | + * | (Placed only if Type == 3) | + * | | + * +------------------------------+ +3802 = MAX_DECMPFS_XATTR_SIZE + * + * Type is 3: decmpfs has compressed data. + * Type is 4: Resource Fork has compressed data. + */ +/* + * Write "com.apple.decmpfs" + */ +static int +hfs_write_decmpfs(struct archive_write_disk *a) +{ + int r; + uint32_t compression_type; + + r = fsetxattr(a->fd, DECMPFS_XATTR_NAME, a->decmpfs_header_p, + a->decmpfs_attr_size, 0, 0); + if (r < 0) { + archive_set_error(&a->archive, errno, + "Cannot restore xattr:%s", DECMPFS_XATTR_NAME); + compression_type = archive_le32dec( + &a->decmpfs_header_p[DECMPFS_COMPRESSION_TYPE]); + if (compression_type == CMP_RESOURCE_FORK) + fremovexattr(a->fd, XATTR_RESOURCEFORK_NAME, + XATTR_SHOWCOMPRESSION); + return (ARCHIVE_WARN); + } + return (ARCHIVE_OK); +} + +/* + * HFS+ Compression Resource Fork + * + * +-----------------------------+ + * | Header(260 bytes) | + * +-----------------------------+ + * | Block count(LE 4 bytes) | + * +-----------------------------+ --+ + * +-- | Offset (LE 4 bytes) | | + * | | [distance from Block count] | | Block 0 + * | +-----------------------------+ | + * | | Compressed size(LE 4 bytes) | | + * | +-----------------------------+ --+ + * | | | + * | | .................. | + * | | | + * | +-----------------------------+ --+ + * | | Offset (LE 4 bytes) | | + * | +-----------------------------+ | Block (Block count -1) + * | | Compressed size(LE 4 bytes) | | + * +-> +-----------------------------+ --+ + * | Compressed data(n bytes) | Block 0 + * +-----------------------------+ + * | | + * | .................. | + * | | + * +-----------------------------+ + * | Compressed data(n bytes) | Block (Block count -1) + * +-----------------------------+ + * | Footer(50 bytes) | + * +-----------------------------+ + * + */ +/* + * Write the header of "com.apple.ResourceFork" + */ +static int +hfs_write_resource_fork(struct archive_write_disk *a, unsigned char *buff, + size_t bytes, uint32_t position) +{ + int ret; + + ret = fsetxattr(a->fd, XATTR_RESOURCEFORK_NAME, buff, bytes, + position, a->rsrc_xattr_options); + if (ret < 0) { + archive_set_error(&a->archive, errno, + "Cannot restore xattr: %s at %u pos %u bytes", + XATTR_RESOURCEFORK_NAME, + (unsigned)position, + (unsigned)bytes); + return (ARCHIVE_WARN); + } + a->rsrc_xattr_options &= ~XATTR_CREATE; + return (ARCHIVE_OK); +} + +static int +hfs_write_compressed_data(struct archive_write_disk *a, size_t bytes_compressed) +{ + int ret; + + ret = hfs_write_resource_fork(a, a->compressed_buffer, + bytes_compressed, a->compressed_rsrc_position); + if (ret == ARCHIVE_OK) + a->compressed_rsrc_position += bytes_compressed; + return (ret); +} + +static int +hfs_write_resource_fork_header(struct archive_write_disk *a) +{ + unsigned char *buff; + uint32_t rsrc_bytes; + uint32_t rsrc_header_bytes; + + /* + * Write resource fork header + block info. + */ + buff = a->resource_fork; + rsrc_bytes = a->compressed_rsrc_position - RSRC_F_SIZE; + rsrc_header_bytes = + RSRC_H_SIZE + /* Header base size. */ + 4 + /* Block count. */ + (a->decmpfs_block_count * 8);/* Block info */ + archive_be32enc(buff, 0x100); + archive_be32enc(buff + 4, rsrc_bytes); + archive_be32enc(buff + 8, rsrc_bytes - 256); + archive_be32enc(buff + 12, 0x32); + memset(buff + 16, 0, 240); + archive_be32enc(buff + 256, rsrc_bytes - 260); + return hfs_write_resource_fork(a, buff, rsrc_header_bytes, 0); +} + +static size_t +hfs_set_resource_fork_footer(unsigned char *buff, size_t buff_size) +{ + static const char rsrc_footer[RSRC_F_SIZE] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x1c, 0x00, 0x32, 0x00, 0x00, 'c', 'm', + 'p', 'f', 0x00, 0x00, 0x00, 0x0a, 0x00, 0x01, + 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00 + }; + if (buff_size < sizeof(rsrc_footer)) + return (0); + memcpy(buff, rsrc_footer, sizeof(rsrc_footer)); + return (sizeof(rsrc_footer)); +} + +static int +hfs_reset_compressor(struct archive_write_disk *a) +{ + int ret; + + if (a->stream_valid) + ret = deflateReset(&a->stream); + else + ret = deflateInit(&a->stream, a->decmpfs_compression_level); + + if (ret != Z_OK) { + archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, + "Failed to initialize compressor"); + return (ARCHIVE_FATAL); + } else + a->stream_valid = 1; + + return (ARCHIVE_OK); +} + +static int +hfs_decompress(struct archive_write_disk *a) +{ + uint32_t *block_info; + unsigned int block_count; + uint32_t data_pos, data_size; + ssize_t r; + ssize_t bytes_written, bytes_to_write; + unsigned char *b; + + block_info = (uint32_t *)(a->resource_fork + RSRC_H_SIZE); + block_count = archive_le32dec(block_info++); + while (block_count--) { + data_pos = RSRC_H_SIZE + archive_le32dec(block_info++); + data_size = archive_le32dec(block_info++); + r = fgetxattr(a->fd, XATTR_RESOURCEFORK_NAME, + a->compressed_buffer, data_size, data_pos, 0); + if (r != data_size) { + archive_set_error(&a->archive, + (r < 0)?errno:ARCHIVE_ERRNO_MISC, + "Failed to read resource fork"); + return (ARCHIVE_WARN); + } + if (a->compressed_buffer[0] == 0xff) { + bytes_to_write = data_size -1; + b = a->compressed_buffer + 1; + } else { + uLong dest_len = MAX_DECMPFS_BLOCK_SIZE; + int zr; + + zr = uncompress((Bytef *)a->uncompressed_buffer, + &dest_len, a->compressed_buffer, data_size); + if (zr != Z_OK) { + archive_set_error(&a->archive, + ARCHIVE_ERRNO_MISC, + "Failed to decompress resource fork"); + return (ARCHIVE_WARN); + } + bytes_to_write = dest_len; + b = (unsigned char *)a->uncompressed_buffer; + } + do { + bytes_written = write(a->fd, b, bytes_to_write); + if (bytes_written < 0) { + archive_set_error(&a->archive, errno, + "Write failed"); + return (ARCHIVE_WARN); + } + bytes_to_write -= bytes_written; + b += bytes_written; + } while (bytes_to_write > 0); + } + r = fremovexattr(a->fd, XATTR_RESOURCEFORK_NAME, 0); + if (r == -1) { + archive_set_error(&a->archive, errno, + "Failed to remove resource fork"); + return (ARCHIVE_WARN); + } + return (ARCHIVE_OK); +} + +static int +hfs_drive_compressor(struct archive_write_disk *a, const char *buff, + size_t size) +{ + unsigned char *buffer_compressed; + size_t bytes_compressed; + size_t bytes_used; + int ret; + + ret = hfs_reset_compressor(a); + if (ret != ARCHIVE_OK) + return (ret); + + if (a->compressed_buffer == NULL) { + size_t block_size; + + block_size = COMPRESSED_W_SIZE + RSRC_F_SIZE + + + compressBound(MAX_DECMPFS_BLOCK_SIZE); + a->compressed_buffer = malloc(block_size); + if (a->compressed_buffer == NULL) { + archive_set_error(&a->archive, ENOMEM, + "Can't allocate memory for Resource Fork"); + return (ARCHIVE_FATAL); + } + a->compressed_buffer_size = block_size; + a->compressed_buffer_remaining = block_size; + } + + buffer_compressed = a->compressed_buffer + + a->compressed_buffer_size - a->compressed_buffer_remaining; + a->stream.next_in = (Bytef *)(uintptr_t)(const void *)buff; + a->stream.avail_in = size; + a->stream.next_out = buffer_compressed; + a->stream.avail_out = a->compressed_buffer_remaining; + do { + ret = deflate(&a->stream, Z_FINISH); + switch (ret) { + case Z_OK: + case Z_STREAM_END: + break; + default: + archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, + "Failed to compress data"); + return (ARCHIVE_FAILED); + } + } while (ret == Z_OK); + bytes_compressed = a->compressed_buffer_remaining - a->stream.avail_out; + + /* + * If the compressed size is larger than the original size, + * throw away compressed data, use uncompressed data instead. + */ + if (bytes_compressed > size) { + buffer_compressed[0] = 0xFF;/* uncompressed marker. */ + memcpy(buffer_compressed + 1, buff, size); + bytes_compressed = size + 1; + } + a->compressed_buffer_remaining -= bytes_compressed; + + /* + * If the compressed size is smaller than MAX_DECMPFS_XATTR_SIZE + * and the block count in the file is only one, store compressed + * data to decmpfs xattr instead of the resource fork. + */ + if (a->decmpfs_block_count == 1 && + (a->decmpfs_attr_size + bytes_compressed) + <= MAX_DECMPFS_XATTR_SIZE) { + archive_le32enc(&a->decmpfs_header_p[DECMPFS_COMPRESSION_TYPE], + CMP_XATTR); + memcpy(a->decmpfs_header_p + DECMPFS_HEADER_SIZE, + buffer_compressed, bytes_compressed); + a->decmpfs_attr_size += bytes_compressed; + a->compressed_buffer_remaining = a->compressed_buffer_size; + /* + * Finish HFS+ Compression. + * - Write the decmpfs xattr. + * - Set the UF_COMPRESSED file flag. + */ + ret = hfs_write_decmpfs(a); + if (ret == ARCHIVE_OK) + ret = hfs_set_compressed_fflag(a); + return (ret); + } + + /* Update block info. */ + archive_le32enc(a->decmpfs_block_info++, + a->compressed_rsrc_position_v - RSRC_H_SIZE); + archive_le32enc(a->decmpfs_block_info++, bytes_compressed); + a->compressed_rsrc_position_v += bytes_compressed; + + /* + * Write the compressed data to the resource fork. + */ + bytes_used = a->compressed_buffer_size - a->compressed_buffer_remaining; + while (bytes_used >= COMPRESSED_W_SIZE) { + ret = hfs_write_compressed_data(a, COMPRESSED_W_SIZE); + if (ret != ARCHIVE_OK) + return (ret); + bytes_used -= COMPRESSED_W_SIZE; + if (bytes_used > COMPRESSED_W_SIZE) + memmove(a->compressed_buffer, + a->compressed_buffer + COMPRESSED_W_SIZE, + bytes_used); + else + memcpy(a->compressed_buffer, + a->compressed_buffer + COMPRESSED_W_SIZE, + bytes_used); + } + a->compressed_buffer_remaining = a->compressed_buffer_size - bytes_used; + + /* + * If the current block is the last block, write the remaining + * compressed data and the resource fork footer. + */ + if (a->file_remaining_bytes == 0) { + size_t rsrc_size; + int64_t bk; + + /* Append the resource footer. */ + rsrc_size = hfs_set_resource_fork_footer( + a->compressed_buffer + bytes_used, + a->compressed_buffer_remaining); + ret = hfs_write_compressed_data(a, bytes_used + rsrc_size); + a->compressed_buffer_remaining = a->compressed_buffer_size; + + /* If the compressed size is not enouph smaller than + * the uncompressed size. cancel HFS+ compression. + * TODO: study a behavior of ditto utility and improve + * the condition to fall back into no HFS+ compression. */ + bk = HFS_BLOCKS(a->compressed_rsrc_position); + bk += bk >> 7; + if (bk > HFS_BLOCKS(a->filesize)) + return hfs_decompress(a); + /* + * Write the resourcefork header. + */ + if (ret == ARCHIVE_OK) + ret = hfs_write_resource_fork_header(a); + /* + * Finish HFS+ Compression. + * - Write the decmpfs xattr. + * - Set the UF_COMPRESSED file flag. + */ + if (ret == ARCHIVE_OK) + ret = hfs_write_decmpfs(a); + if (ret == ARCHIVE_OK) + ret = hfs_set_compressed_fflag(a); + } + return (ret); +} + +static ssize_t +hfs_write_decmpfs_block(struct archive_write_disk *a, const char *buff, + size_t size) +{ + const char *buffer_to_write; + size_t bytes_to_write; + int ret; + + if (a->decmpfs_block_count == (unsigned)-1) { + void *new_block; + size_t new_size; + unsigned int block_count; + + if (a->decmpfs_header_p == NULL) { + new_block = malloc(MAX_DECMPFS_XATTR_SIZE + + sizeof(uint32_t)); + if (new_block == NULL) { + archive_set_error(&a->archive, ENOMEM, + "Can't allocate memory for decmpfs"); + return (ARCHIVE_FATAL); + } + a->decmpfs_header_p = new_block; + } + a->decmpfs_attr_size = DECMPFS_HEADER_SIZE; + archive_le32enc(&a->decmpfs_header_p[DECMPFS_COMPRESSION_MAGIC], + DECMPFS_MAGIC); + archive_le32enc(&a->decmpfs_header_p[DECMPFS_COMPRESSION_TYPE], + CMP_RESOURCE_FORK); + archive_le64enc(&a->decmpfs_header_p[DECMPFS_UNCOMPRESSED_SIZE], + a->filesize); + + /* Calculate a block count of the file. */ + block_count = + (a->filesize + MAX_DECMPFS_BLOCK_SIZE -1) / + MAX_DECMPFS_BLOCK_SIZE; + /* + * Allocate buffer for resource fork. + * Set up related pointers; + */ + new_size = + RSRC_H_SIZE + /* header */ + 4 + /* Block count */ + (block_count * sizeof(uint32_t) * 2) + + RSRC_F_SIZE; /* footer */ + if (new_size > a->resource_fork_allocated_size) { + new_block = realloc(a->resource_fork, new_size); + if (new_block == NULL) { + archive_set_error(&a->archive, ENOMEM, + "Can't allocate memory for ResourceFork"); + return (ARCHIVE_FATAL); + } + a->resource_fork_allocated_size = new_size; + a->resource_fork = new_block; + } + + /* Allocate uncompressed buffer */ + if (a->uncompressed_buffer == NULL) { + new_block = malloc(MAX_DECMPFS_BLOCK_SIZE); + if (new_block == NULL) { + archive_set_error(&a->archive, ENOMEM, + "Can't allocate memory for decmpfs"); + return (ARCHIVE_FATAL); + } + a->uncompressed_buffer = new_block; + } + a->block_remaining_bytes = MAX_DECMPFS_BLOCK_SIZE; + a->file_remaining_bytes = a->filesize; + a->compressed_buffer_remaining = a->compressed_buffer_size; + + /* + * Set up a resource fork. + */ + a->rsrc_xattr_options = XATTR_CREATE; + /* Get the position where we are going to set a bunch + * of block info. */ + a->decmpfs_block_info = + (uint32_t *)(a->resource_fork + RSRC_H_SIZE); + /* Set the block count to the resource fork. */ + archive_le32enc(a->decmpfs_block_info++, block_count); + /* Get the position where we are goint to set compressed + * data. */ + a->compressed_rsrc_position = + RSRC_H_SIZE + 4 + (block_count * 8); + a->compressed_rsrc_position_v = a->compressed_rsrc_position; + a->decmpfs_block_count = block_count; + } + + /* Ignore redundant bytes. */ + if (a->file_remaining_bytes == 0) + return ((ssize_t)size); + + /* Do not overrun a block size. */ + if (size > a->block_remaining_bytes) + bytes_to_write = a->block_remaining_bytes; + else + bytes_to_write = size; + /* Do not overrun the file size. */ + if (bytes_to_write > a->file_remaining_bytes) + bytes_to_write = a->file_remaining_bytes; + + /* For efficiency, if a copy length is full of the uncompressed + * buffer size, do not copy writing data to it. */ + if (bytes_to_write == MAX_DECMPFS_BLOCK_SIZE) + buffer_to_write = buff; + else { + memcpy(a->uncompressed_buffer + + MAX_DECMPFS_BLOCK_SIZE - a->block_remaining_bytes, + buff, bytes_to_write); + buffer_to_write = a->uncompressed_buffer; + } + a->block_remaining_bytes -= bytes_to_write; + a->file_remaining_bytes -= bytes_to_write; + + if (a->block_remaining_bytes == 0 || a->file_remaining_bytes == 0) { + ret = hfs_drive_compressor(a, buffer_to_write, + MAX_DECMPFS_BLOCK_SIZE - a->block_remaining_bytes); + if (ret < 0) + return (ret); + a->block_remaining_bytes = MAX_DECMPFS_BLOCK_SIZE; + } + /* Ignore redundant bytes. */ + if (a->file_remaining_bytes == 0) + return ((ssize_t)size); + return (bytes_to_write); +} + +static ssize_t +hfs_write_data_block(struct archive_write_disk *a, const char *buff, + size_t size) +{ + uint64_t start_size = size; + ssize_t bytes_written = 0; + ssize_t bytes_to_write; + + if (size == 0) + return (ARCHIVE_OK); + + if (a->filesize == 0 || a->fd < 0) { + archive_set_error(&a->archive, 0, + "Attempt to write to an empty file"); + return (ARCHIVE_WARN); + } + + /* If this write would run beyond the file size, truncate it. */ + if (a->filesize >= 0 && (int64_t)(a->offset + size) > a->filesize) + start_size = size = (size_t)(a->filesize - a->offset); + + /* Write the data. */ + while (size > 0) { + bytes_to_write = size; + /* Seek if necessary to the specified offset. */ + if (a->offset < a->fd_offset) { + /* Can't support backword move. */ + archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, + "Seek failed"); + return (ARCHIVE_FATAL); + } else if (a->offset > a->fd_offset) { + int64_t skip = a->offset - a->fd_offset; + char nullblock[1024]; + + memset(nullblock, 0, sizeof(nullblock)); + while (skip > 0) { + if (skip > (int64_t)sizeof(nullblock)) + bytes_written = hfs_write_decmpfs_block( + a, nullblock, sizeof(nullblock)); + else + bytes_written = hfs_write_decmpfs_block( + a, nullblock, skip); + if (bytes_written < 0) { + archive_set_error(&a->archive, errno, + "Write failed"); + return (ARCHIVE_WARN); + } + skip -= bytes_written; + } + + a->fd_offset = a->offset; + } + bytes_written = + hfs_write_decmpfs_block(a, buff, bytes_to_write); + if (bytes_written < 0) + return (bytes_written); + buff += bytes_written; + size -= bytes_written; + a->total_bytes_written += bytes_written; + a->offset += bytes_written; + a->fd_offset = a->offset; + } + return (start_size - size); +} +#else +static ssize_t +hfs_write_data_block(struct archive_write_disk *a, const char *buff, + size_t size) +{ + return (write_data_block(a, buff, size)); +} +#endif + static ssize_t _archive_write_disk_data_block(struct archive *_a, const void *buff, size_t size, int64_t offset) @@ -718,7 +1459,10 @@ _archive_write_disk_data_block(struct archive *_a, ARCHIVE_STATE_DATA, "archive_write_data_block"); a->offset = offset; - r = write_data_block(a, buff, size); + if (a->todo & TODO_HFS_COMPRESSION) + r = hfs_write_data_block(a, buff, size); + else + r = write_data_block(a, buff, size); if (r < ARCHIVE_OK) return (r); if ((size_t)r < size) { @@ -737,6 +1481,8 @@ _archive_write_disk_data(struct archive *_a, const void *buff, size_t size) archive_check_magic(&a->archive, ARCHIVE_WRITE_DISK_MAGIC, ARCHIVE_STATE_DATA, "archive_write_data"); + if (a->todo & TODO_HFS_COMPRESSION) + return (hfs_write_data_block(a, buff, size)); return (write_data_block(a, buff, size)); } @@ -761,6 +1507,24 @@ _archive_write_disk_finish_entry(struct archive *_a) } else if (a->fd_offset == a->filesize) { /* Last write ended at exactly the filesize; we're done. */ /* Hopefully, this is the common case. */ +#if defined(__APPLE__) && defined(UF_COMPRESSED) && defined(HAVE_ZLIB_H) + } else if (a->todo & TODO_HFS_COMPRESSION) { + char null_d[1024]; + ssize_t r; + + if (a->file_remaining_bytes) + memset(null_d, 0, sizeof(null_d)); + while (a->file_remaining_bytes) { + if (a->file_remaining_bytes > sizeof(null_d)) + r = hfs_write_data_block( + a, null_d, sizeof(null_d)); + else + r = hfs_write_data_block( + a, null_d, a->file_remaining_bytes); + if (r < 0) + return ((int)r); + } +#endif } else { #if HAVE_FTRUNCATE if (ftruncate(a->fd, a->filesize) == -1 && @@ -798,6 +1562,22 @@ _archive_write_disk_finish_entry(struct archive *_a) /* Restore metadata. */ + /* + * This is specific to Mac OS X. + * If the current file is an AppleDouble file, it should be + * linked with the data fork file and remove it. + */ + if (a->todo & TODO_APPLEDOUBLE) { + int r2 = fixup_appledouble(a, a->name); + if (r2 == ARCHIVE_EOF) { + /* The current file has been successfully linked + * with the data fork file and removed. So there + * is nothing to do on the current file. */ + goto finish_metadata; + } + if (r2 < ret) ret = r2; + } + /* * Look up the "real" UID only if we're going to need it. * TODO: the TODO_SGID condition can be dropped here, can't it? @@ -820,8 +1600,10 @@ _archive_write_disk_finish_entry(struct archive *_a) * bits. If we set the owner, we know what it is and can skip * a stat() call to examine the ownership of the file on disk. */ - if (a->todo & TODO_OWNER) - ret = set_ownership(a); + if (a->todo & TODO_OWNER) { + int r2 = set_ownership(a); + if (r2 < ret) ret = r2; + } /* * set_mode must precede ACLs on systems such as Solaris and @@ -868,7 +1650,8 @@ _archive_write_disk_finish_entry(struct archive *_a) size_t metadata_size; metadata = archive_entry_mac_metadata(a->entry, &metadata_size); if (metadata != NULL && metadata_size > 0) { - int r2 = set_mac_metadata(a, archive_entry_pathname(a->entry), metadata, metadata_size); + int r2 = set_mac_metadata(a, archive_entry_pathname( + a->entry), metadata, metadata_size); if (r2 < ret) ret = r2; } } @@ -878,12 +1661,13 @@ _archive_write_disk_finish_entry(struct archive *_a) * ACLs that prevent attribute changes (including time). */ if (a->todo & TODO_ACLS) { - int r2 = set_acls(a, a->fd, + int r2 = archive_write_disk_set_acls(&a->archive, a->fd, archive_entry_pathname(a->entry), archive_entry_acl(a->entry)); if (r2 < ret) ret = r2; } +finish_metadata: /* If there's an fd, we can close it now. */ if (a->fd >= 0) { close(a->fd); @@ -950,12 +1734,12 @@ archive_write_disk_gid(struct archive *_a, const char *name, int64_t id) int64_t archive_write_disk_uid(struct archive *_a, const char *name, int64_t id) { - struct archive_write_disk *a = (struct archive_write_disk *)_a; - archive_check_magic(&a->archive, ARCHIVE_WRITE_DISK_MAGIC, - ARCHIVE_STATE_ANY, "archive_write_disk_uid"); - if (a->lookup_uid) - return (a->lookup_uid)(a->lookup_uid_data, name, id); - return (id); + struct archive_write_disk *a = (struct archive_write_disk *)_a; + archive_check_magic(&a->archive, ARCHIVE_WRITE_DISK_MAGIC, + ARCHIVE_STATE_ANY, "archive_write_disk_uid"); + if (a->lookup_uid) + return (a->lookup_uid)(a->lookup_uid_data, name, id); + return (id); } /* @@ -984,6 +1768,9 @@ archive_write_disk_new(void) free(a); return (NULL); } +#ifdef HAVE_ZLIB_H + a->decmpfs_compression_level = 5; +#endif return (&a->archive); } @@ -1008,7 +1795,8 @@ edit_deep_directories(struct archive_write_disk *a) return; /* Try to record our starting dir. */ - a->restore_pwd = open(".", O_RDONLY | O_BINARY); + a->restore_pwd = open(".", O_RDONLY | O_BINARY | O_CLOEXEC); + __archive_ensure_cloexec_flag(a->restore_pwd); if (a->restore_pwd < 0) return; @@ -1233,7 +2021,9 @@ create_filesystem_object(struct archive_write_disk *a) a->todo = 0; a->deferred = 0; } else if (r == 0 && a->filesize > 0) { - a->fd = open(a->name, O_WRONLY | O_TRUNC | O_BINARY); + a->fd = open(a->name, + O_WRONLY | O_TRUNC | O_BINARY | O_CLOEXEC); + __archive_ensure_cloexec_flag(a->fd); if (a->fd < 0) r = errno; } @@ -1262,7 +2052,7 @@ create_filesystem_object(struct archive_write_disk *a) * that SUID, SGID, etc, require additional work to ensure * security, so we never restore them at this point. */ - mode = final_mode & 0777 & a->user_umask; + mode = final_mode & 0777 & ~a->user_umask; switch (a->mode & AE_IFMT) { default: @@ -1270,7 +2060,8 @@ create_filesystem_object(struct archive_write_disk *a) /* FALLTHROUGH */ case AE_IFREG: a->fd = open(a->name, - O_WRONLY | O_CREAT | O_EXCL | O_BINARY, mode); + O_WRONLY | O_CREAT | O_EXCL | O_BINARY | O_CLOEXEC, mode); + __archive_ensure_cloexec_flag(a->fd); r = (a->fd < 0); break; case AE_IFCHR: @@ -1381,7 +2172,8 @@ _archive_write_disk_close(struct archive *_a) if (p->fixup & TODO_MODE_BASE) chmod(p->name, p->mode); if (p->fixup & TODO_ACLS) - set_acls(a, -1, p->name, &p->acl); + archive_write_disk_set_acls(&a->archive, + -1, p->name, &p->acl); if (p->fixup & TODO_FFLAGS) set_fflags_platform(a, -1, p->name, p->mode, p->fflags_set, 0); @@ -1419,6 +2211,23 @@ _archive_write_disk_free(struct archive *_a) archive_string_free(&a->path_safe); a->archive.magic = 0; __archive_clean(&a->archive); + free(a->decmpfs_header_p); + free(a->resource_fork); + free(a->compressed_buffer); + free(a->uncompressed_buffer); +#ifdef HAVE_ZLIB_H + if (a->stream_valid) { + switch (deflateEnd(&a->stream)) { + case Z_OK: + break; + default: + archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, + "Failed to clean up compressor"); + ret = ARCHIVE_FATAL; + break; + } + } +#endif free(a); return (ret); } @@ -1500,8 +2309,11 @@ new_fixup(struct archive_write_disk *a, const char *pathname) struct fixup_entry *fe; fe = (struct fixup_entry *)calloc(1, sizeof(struct fixup_entry)); - if (fe == NULL) + if (fe == NULL) { + archive_set_error(&a->archive, ENOMEM, + "Can't allocate memory for a fixup"); return (NULL); + } fe->next = a->fixup_list; a->fixup_list = fe; fe->fixup = 0; @@ -1888,6 +2700,8 @@ create_dir(struct archive_write_disk *a, char *path) if (mkdir(path, mode) == 0) { if (mode != mode_final) { le = new_fixup(a, path); + if (le == NULL) + return (ARCHIVE_FATAL); le->fixup |=TODO_MODE_BASE; le->mode = mode_final; } @@ -2325,6 +3139,8 @@ set_fflags(struct archive_write_disk *a) */ if ((critical_flags != 0) && (set & critical_flags)) { le = current_fixup(a, a->name); + if (le == NULL) + return (ARCHIVE_FATAL); le->fixup |= TODO_FFLAGS; le->fflags_set = set; /* Store the mode if it's not already there. */ @@ -2403,8 +3219,8 @@ set_fflags_platform(struct archive_write_disk *a, int fd, const char *name, { int ret; int myfd = fd; - unsigned long newflags, oldflags; - unsigned long sf_mask = 0; + int newflags, oldflags; + int sf_mask = 0; if (set == 0 && clear == 0) return (ARCHIVE_OK); @@ -2413,8 +3229,10 @@ set_fflags_platform(struct archive_write_disk *a, int fd, const char *name, return (ARCHIVE_OK); /* If we weren't given an fd, open it ourselves. */ - if (myfd < 0) - myfd = open(name, O_RDONLY | O_NONBLOCK | O_BINARY); + if (myfd < 0) { + myfd = open(name, O_RDONLY | O_NONBLOCK | O_BINARY | O_CLOEXEC); + __archive_ensure_cloexec_flag(myfd); + } if (myfd < 0) return (ARCHIVE_OK); @@ -2499,12 +3317,196 @@ set_mac_metadata(struct archive_write_disk *a, const char *pathname, (void)metadata_size; /* UNUSED */ return (ARCHIVE_OK); } + +static int +fixup_appledouble(struct archive_write_disk *a, const char *pathname) +{ + (void)a; /* UNUSED */ + (void)pathname; /* UNUSED */ + return (ARCHIVE_OK); +} #else /* * On Mac OS, we use copyfile() to unpack the metadata and * apply it to the target file. */ + +#if defined(HAVE_SYS_XATTR_H) +static int +copy_xattrs(struct archive_write_disk *a, int tmpfd, int dffd) +{ + ssize_t xattr_size; + char *xattr_names = NULL, *xattr_val = NULL; + int ret = ARCHIVE_OK, xattr_i; + + xattr_size = flistxattr(tmpfd, NULL, 0, 0); + if (xattr_size == -1) { + archive_set_error(&a->archive, errno, + "Failed to read metadata(xattr)"); + ret = ARCHIVE_WARN; + goto exit_xattr; + } + xattr_names = malloc(xattr_size); + if (xattr_names == NULL) { + archive_set_error(&a->archive, ENOMEM, + "Can't allocate memory for metadata(xattr)"); + ret = ARCHIVE_FATAL; + goto exit_xattr; + } + xattr_size = flistxattr(tmpfd, xattr_names, xattr_size, 0); + if (xattr_size == -1) { + archive_set_error(&a->archive, errno, + "Failed to read metadata(xattr)"); + ret = ARCHIVE_WARN; + goto exit_xattr; + } + for (xattr_i = 0; xattr_i < xattr_size; + xattr_i += strlen(xattr_names + xattr_i) + 1) { + ssize_t s; + int f; + + s = fgetxattr(tmpfd, xattr_names + xattr_i, NULL, 0, 0, 0); + if (s == -1) { + archive_set_error(&a->archive, errno, + "Failed to get metadata(xattr)"); + ret = ARCHIVE_WARN; + goto exit_xattr; + } + xattr_val = realloc(xattr_val, s); + if (xattr_val == NULL) { + archive_set_error(&a->archive, ENOMEM, + "Failed to get metadata(xattr)"); + ret = ARCHIVE_WARN; + goto exit_xattr; + } + s = fgetxattr(tmpfd, xattr_names + xattr_i, xattr_val, s, 0, 0); + if (s == -1) { + archive_set_error(&a->archive, errno, + "Failed to get metadata(xattr)"); + ret = ARCHIVE_WARN; + goto exit_xattr; + } + f = fsetxattr(dffd, xattr_names + xattr_i, xattr_val, s, 0, 0); + if (f == -1) { + archive_set_error(&a->archive, errno, + "Failed to get metadata(xattr)"); + ret = ARCHIVE_WARN; + goto exit_xattr; + } + } +exit_xattr: + free(xattr_names); + free(xattr_val); + return (ret); +} +#endif + +static int +copy_acls(struct archive_write_disk *a, int tmpfd, int dffd) +{ + acl_t acl, dfacl = NULL; + int acl_r, ret = ARCHIVE_OK; + + acl = acl_get_fd(tmpfd); + if (acl == NULL) { + if (errno == ENOENT) + /* There are not any ACLs. */ + return (ret); + archive_set_error(&a->archive, errno, + "Failed to get metadata(acl)"); + ret = ARCHIVE_WARN; + goto exit_acl; + } + dfacl = acl_dup(acl); + acl_r = acl_set_fd(dffd, dfacl); + if (acl_r == -1) { + archive_set_error(&a->archive, errno, + "Failed to get metadata(acl)"); + ret = ARCHIVE_WARN; + goto exit_acl; + } +exit_acl: + if (acl) + acl_free(acl); + if (dfacl) + acl_free(dfacl); + return (ret); +} + +static int +create_tempdatafork(struct archive_write_disk *a, const char *pathname) +{ + struct archive_string tmpdatafork; + int tmpfd; + + archive_string_init(&tmpdatafork); + archive_strcpy(&tmpdatafork, "tar.md.XXXXXX"); + tmpfd = mkstemp(tmpdatafork.s); + if (tmpfd < 0) { + archive_set_error(&a->archive, errno, + "Failed to mkstemp"); + archive_string_free(&tmpdatafork); + return (-1); + } + if (copyfile(pathname, tmpdatafork.s, 0, + COPYFILE_UNPACK | COPYFILE_NOFOLLOW + | COPYFILE_ACL | COPYFILE_XATTR) < 0) { + archive_set_error(&a->archive, errno, + "Failed to restore metadata"); + close(tmpfd); + tmpfd = -1; + } + unlink(tmpdatafork.s); + archive_string_free(&tmpdatafork); + return (tmpfd); +} + +static int +copy_metadata(struct archive_write_disk *a, const char *metadata, + const char *datafork, int datafork_compressed) +{ + int ret = ARCHIVE_OK; + + if (datafork_compressed) { + int dffd, tmpfd; + + tmpfd = create_tempdatafork(a, metadata); + if (tmpfd == -1) + return (ARCHIVE_WARN); + + /* + * Do not open the data fork compressed by HFS+ compression + * with at least a writing mode(O_RDWR or O_WRONLY). it + * makes the data fork uncompressed. + */ + dffd = open(datafork, 0); + if (dffd == -1) { + archive_set_error(&a->archive, errno, + "Failed to open the data fork for metadata"); + close(tmpfd); + return (ARCHIVE_WARN); + } + +#if defined(HAVE_SYS_XATTR_H) + ret = copy_xattrs(a, tmpfd, dffd); + if (ret == ARCHIVE_OK) +#endif + ret = copy_acls(a, tmpfd, dffd); + close(tmpfd); + close(dffd); + } else { + if (copyfile(metadata, datafork, 0, + COPYFILE_UNPACK | COPYFILE_NOFOLLOW + | COPYFILE_ACL | COPYFILE_XATTR) < 0) { + archive_set_error(&a->archive, errno, + "Failed to restore metadata"); + ret = ARCHIVE_WARN; + } + } + return (ret); +} + static int set_mac_metadata(struct archive_write_disk *a, const char *pathname, const void *metadata, size_t metadata_size) @@ -2526,145 +3528,101 @@ set_mac_metadata(struct archive_write_disk *a, const char *pathname, if (fd < 0) { archive_set_error(&a->archive, errno, "Failed to restore metadata"); + archive_string_free(&tmp); return (ARCHIVE_WARN); } written = write(fd, metadata, metadata_size); close(fd); - if ((size_t)written != metadata_size - || copyfile(tmp.s, pathname, 0, - COPYFILE_UNPACK | COPYFILE_NOFOLLOW - | COPYFILE_ACL | COPYFILE_XATTR)) { + if ((size_t)written != metadata_size) { archive_set_error(&a->archive, errno, "Failed to restore metadata"); ret = ARCHIVE_WARN; + } else { + int compressed; + +#if defined(UF_COMPRESSED) + if ((a->todo & TODO_HFS_COMPRESSION) != 0 && + (ret = lazy_stat(a)) == ARCHIVE_OK) + compressed = a->st.st_flags & UF_COMPRESSED; + else +#endif + compressed = 0; + ret = copy_metadata(a, tmp.s, pathname, compressed); } unlink(tmp.s); - return (ret); -} -#endif - -#ifndef HAVE_POSIX_ACL -/* Default empty function body to satisfy mainline code. */ -static int -set_acls(struct archive_write_disk *a, int fd, const char *name, - struct archive_acl *aacl) -{ - (void)a; /* UNUSED */ - (void)fd; /* UNUSED */ - (void)name; /* UNUSED */ - (void)aacl; /* UNUSED */ - return (ARCHIVE_OK); -} - -#else - -/* - * XXX TODO: What about ACL types other than ACCESS and DEFAULT? - */ -static int -set_acls(struct archive_write_disk *a, int fd, const char *name, - struct archive_acl *abstract_acl) -{ - int ret; - - ret = set_acl(a, fd, name, abstract_acl, ACL_TYPE_ACCESS, - ARCHIVE_ENTRY_ACL_TYPE_ACCESS, "access"); - if (ret != ARCHIVE_OK) - return (ret); - ret = set_acl(a, fd, name, abstract_acl, ACL_TYPE_DEFAULT, - ARCHIVE_ENTRY_ACL_TYPE_DEFAULT, "default"); + archive_string_free(&tmp); return (ret); } - static int -set_acl(struct archive_write_disk *a, int fd, const char *name, - struct archive_acl *abstract_acl, - acl_type_t acl_type, int ae_requested_type, const char *tname) +fixup_appledouble(struct archive_write_disk *a, const char *pathname) { - acl_t acl; - acl_entry_t acl_entry; - acl_permset_t acl_permset; - int ret, r; - int ae_type, ae_permset, ae_tag, ae_id; - uid_t ae_uid; - gid_t ae_gid; - const char *ae_name; - int entries; + char buff[8]; + struct stat st; + const char *p; + struct archive_string datafork; + int fd = -1, ret = ARCHIVE_OK; - ret = ARCHIVE_OK; - entries = archive_acl_reset(abstract_acl, ae_requested_type); - if (entries == 0) - return (ARCHIVE_OK); - acl = acl_init(entries); - while ((r = archive_acl_next(&a->archive, abstract_acl, - ae_requested_type, &ae_type, &ae_permset, &ae_tag, &ae_id, - &ae_name)) == ARCHIVE_OK) { - acl_create_entry(&acl, &acl_entry); + archive_string_init(&datafork); + /* Check if the current file name is a type of the resource + * fork file. */ + p = strrchr(pathname, '/'); + if (p == NULL) + p = pathname; + else + p++; + if (p[0] != '.' || p[1] != '_') + goto skip_appledouble; - switch (ae_tag) { - case ARCHIVE_ENTRY_ACL_USER: - acl_set_tag_type(acl_entry, ACL_USER); - ae_uid = archive_write_disk_uid(&a->archive, - ae_name, ae_id); - acl_set_qualifier(acl_entry, &ae_uid); - break; - case ARCHIVE_ENTRY_ACL_GROUP: - acl_set_tag_type(acl_entry, ACL_GROUP); - ae_gid = archive_write_disk_gid(&a->archive, - ae_name, ae_id); - acl_set_qualifier(acl_entry, &ae_gid); - break; - case ARCHIVE_ENTRY_ACL_USER_OBJ: - acl_set_tag_type(acl_entry, ACL_USER_OBJ); - break; - case ARCHIVE_ENTRY_ACL_GROUP_OBJ: - acl_set_tag_type(acl_entry, ACL_GROUP_OBJ); - break; - case ARCHIVE_ENTRY_ACL_MASK: - acl_set_tag_type(acl_entry, ACL_MASK); - break; - case ARCHIVE_ENTRY_ACL_OTHER: - acl_set_tag_type(acl_entry, ACL_OTHER); - break; - default: - /* XXX */ - break; - } + /* + * Check if the data fork file exists. + * + * TODO: Check if this write disk object has handled it. + */ + archive_strncpy(&datafork, pathname, p - pathname); + archive_strcat(&datafork, p + 2); + if (lstat(datafork.s, &st) == -1 || + (st.st_mode & AE_IFMT) != AE_IFREG) + goto skip_appledouble; - acl_get_permset(acl_entry, &acl_permset); - acl_clear_perms(acl_permset); - if (ae_permset & ARCHIVE_ENTRY_ACL_EXECUTE) - acl_add_perm(acl_permset, ACL_EXECUTE); - if (ae_permset & ARCHIVE_ENTRY_ACL_WRITE) - acl_add_perm(acl_permset, ACL_WRITE); - if (ae_permset & ARCHIVE_ENTRY_ACL_READ) - acl_add_perm(acl_permset, ACL_READ); - } - if (r == ARCHIVE_FATAL) { - acl_free(acl); + /* + * Check if the file is in the AppleDouble form. + */ + fd = open(pathname, O_RDONLY | O_BINARY | O_CLOEXEC); + __archive_ensure_cloexec_flag(fd); + if (fd == -1) { archive_set_error(&a->archive, errno, - "Failed to archive_acl_next"); - return (r); - } - - /* Try restoring the ACL through 'fd' if we can. */ -#if HAVE_ACL_SET_FD - if (fd >= 0 && acl_type == ACL_TYPE_ACCESS && acl_set_fd(fd, acl) == 0) - ret = ARCHIVE_OK; - else -#else -#if HAVE_ACL_SET_FD_NP - if (fd >= 0 && acl_set_fd_np(fd, acl, acl_type) == 0) - ret = ARCHIVE_OK; - else -#endif -#endif - if (acl_set_file(name, acl_type, acl) != 0) { - archive_set_error(&a->archive, errno, "Failed to set %s acl", tname); + "Failed to open a restoring file"); ret = ARCHIVE_WARN; + goto skip_appledouble; } - acl_free(acl); + if (read(fd, buff, 8) == -1) { + archive_set_error(&a->archive, errno, + "Failed to read a restoring file"); + close(fd); + ret = ARCHIVE_WARN; + goto skip_appledouble; + } + close(fd); + /* Check AppleDouble Magic Code. */ + if (archive_be32dec(buff) != 0x00051607) + goto skip_appledouble; + /* Check AppleDouble Version. */ + if (archive_be32dec(buff+4) != 0x00020000) + goto skip_appledouble; + + ret = copy_metadata(a, pathname, datafork.s, +#if defined(UF_COMPRESSED) + st.st_flags & UF_COMPRESSED); +#else + 0); +#endif + if (ret == ARCHIVE_OK) { + unlink(pathname); + ret = ARCHIVE_EOF; + } +skip_appledouble: + archive_string_free(&datafork); return (ret); } #endif diff --git a/libarchive/archive_write_disk_private.h b/libarchive/archive_write_disk_private.h index 707c0cf03b2e..d84e7e1cd64c 100644 --- a/libarchive/archive_write_disk_private.h +++ b/libarchive/archive_write_disk_private.h @@ -33,6 +33,11 @@ #ifndef ARCHIVE_WRITE_DISK_PRIVATE_H_INCLUDED #define ARCHIVE_WRITE_DISK_PRIVATE_H_INCLUDED +#include "archive_acl_private.h" + struct archive_write_disk; +int +archive_write_disk_set_acls(struct archive *, int /* fd */, const char * /* pathname */, struct archive_acl *); + #endif diff --git a/libarchive/archive_write_disk_windows.c b/libarchive/archive_write_disk_windows.c index 39fd65fa0b8f..0f0780a8e47e 100644 --- a/libarchive/archive_write_disk_windows.c +++ b/libarchive/archive_write_disk_windows.c @@ -1511,7 +1511,7 @@ create_filesystem_object(struct archive_write_disk *a) * that SUID, SGID, etc, require additional work to ensure * security, so we never restore them at this point. */ - mode = final_mode & 0777 & a->user_umask; + mode = final_mode & 0777 & ~a->user_umask; switch (a->mode & AE_IFMT) { default: diff --git a/libarchive/archive_write_free.3 b/libarchive/archive_write_free.3 index ac01dd4b96dd..1b2d07131d8e 100644 --- a/libarchive/archive_write_free.3 +++ b/libarchive/archive_write_free.3 @@ -28,6 +28,7 @@ .Dt ARCHIVE_WRITE_FREE 3 .Os .Sh NAME +.Nm archive_write_fail , .Nm archive_write_close , .Nm archive_write_finish , .Nm archive_write_free @@ -37,6 +38,8 @@ Streaming Archive Library (libarchive, -larchive) .Sh SYNOPSIS .In archive.h .Ft int +.Fn archive_write_fail "struct archive *" +.Ft int .Fn archive_write_close "struct archive *" .Ft int .Fn archive_write_finish "struct archive *" @@ -44,6 +47,16 @@ Streaming Archive Library (libarchive, -larchive) .Fn archive_write_free "struct archive *" .Sh DESCRIPTION .Bl -tag -width indent +.It Fn archive_write_fail +Always returns +.Cm ARCHIVE_FATAL . +This marks the archive object as being unusable; +after calling this function, the only call that can succeed is +.Fn archive_write_free +to release the resources. +This can be used to speed recovery when the archive creation +must be aborted. +Note that the created archive is likely to be malformed in this case; .It Fn archive_write_close Complete the archive and invoke the close callback. .It Fn archive_write_finish diff --git a/libarchive/archive_write_open_filename.c b/libarchive/archive_write_open_filename.c index bcde200d46b9..196b770e8e83 100644 --- a/libarchive/archive_write_open_filename.c +++ b/libarchive/archive_write_open_filename.c @@ -46,11 +46,15 @@ __FBSDID("$FreeBSD: head/lib/libarchive/archive_write_open_filename.c 191165 200 #endif #include "archive.h" +#include "archive_private.h" #include "archive_string.h" #ifndef O_BINARY #define O_BINARY 0 #endif +#ifndef O_CLOEXEC +#define O_CLOEXEC 0 +#endif struct write_file_data { int fd; @@ -136,7 +140,7 @@ file_open(struct archive *a, void *client_data) const char *mbs; mine = (struct write_file_data *)client_data; - flags = O_WRONLY | O_CREAT | O_TRUNC | O_BINARY; + flags = O_WRONLY | O_CREAT | O_TRUNC | O_BINARY | O_CLOEXEC; /* * Open the file. @@ -171,6 +175,7 @@ file_open(struct archive *a, void *client_data) return (ARCHIVE_FATAL); } mine->fd = open(mbs, flags, 0666); + __archive_ensure_cloexec_flag(mine->fd); #endif if (mine->fd < 0) { if (mbs != NULL) diff --git a/libarchive/archive_write_private.h b/libarchive/archive_write_private.h index 06a24a8a611f..e600d54749bb 100644 --- a/libarchive/archive_write_private.h +++ b/libarchive/archive_write_private.h @@ -133,4 +133,13 @@ __archive_write_format_header_ustar(struct archive_write *, char buff[512], struct archive_entry *, int tartype, int strict, struct archive_string_conv *); +struct archive_write_program_data; +struct archive_write_program_data * __archive_write_program_allocate(void); +int __archive_write_program_free(struct archive_write_program_data *); +int __archive_write_program_open(struct archive_write_filter *, + struct archive_write_program_data *, const char *); +int __archive_write_program_close(struct archive_write_filter *, + struct archive_write_program_data *); +int __archive_write_program_write(struct archive_write_filter *, + struct archive_write_program_data *, const void *, size_t); #endif diff --git a/libarchive/archive_write_set_format_7zip.c b/libarchive/archive_write_set_format_7zip.c index 7e1240a2c32c..7847cb3c5994 100644 --- a/libarchive/archive_write_set_format_7zip.c +++ b/libarchive/archive_write_set_format_7zip.c @@ -385,7 +385,7 @@ _7z_options(struct archive_write *a, const char *key, const char *value) else { archive_set_error(&(a->archive), ARCHIVE_ERRNO_MISC, - "Unkonwn compression name: `%s'", + "Unknown compression name: `%s'", value); return (ARCHIVE_FAILED); } @@ -405,7 +405,7 @@ _7z_options(struct archive_write *a, const char *key, const char *value) value[1] != '\0') { archive_set_error(&(a->archive), ARCHIVE_ERRNO_MISC, - "Illeagal value `%s'", + "Illegal value `%s'", value); return (ARCHIVE_FAILED); } @@ -442,6 +442,14 @@ _7z_write_header(struct archive_write *a, struct archive_entry *entry) file_free(file); return (r); } + if (file->size == 0 && file->dir) { + if (!__archive_rb_tree_insert_node(&(zip->rbtree), + (struct archive_rb_node *)file)) { + /* We have already had the same file. */ + file_free(file); + return (ARCHIVE_OK); + } + } if (file->flg & MTIME_IS_SET) zip->total_number_time_defined[MTIME]++; @@ -450,11 +458,6 @@ _7z_write_header(struct archive_write *a, struct archive_entry *entry) if (file->flg & ATIME_IS_SET) zip->total_number_time_defined[ATIME]++; - if (file->size == 0 && file->dir) { - if (!__archive_rb_tree_insert_node(&(zip->rbtree), - (struct archive_rb_node *)file)) - file_free(file); - } zip->total_number_entry++; zip->total_bytes_entry_name += file->name_len + 2; if (file->size == 0) { @@ -501,7 +504,7 @@ _7z_write_header(struct archive_write *a, struct archive_entry *entry) bytes = compress_out(a, p, (size_t)file->size, ARCHIVE_Z_RUN); if (bytes < 0) return ((int)bytes); - zip->entry_crc32 = crc32(zip->entry_crc32, p, bytes); + zip->entry_crc32 = crc32(zip->entry_crc32, p, (unsigned)bytes); zip->entry_bytes_remaining -= bytes; } @@ -559,10 +562,11 @@ compress_out(struct archive_write *a, const void *buff, size_t s, return (0); if ((zip->crc32flg & PRECODE_CRC32) && s) - zip->precode_crc32 = crc32(zip->precode_crc32, buff, s); + zip->precode_crc32 = crc32(zip->precode_crc32, buff, + (unsigned)s); zip->stream.next_in = (const unsigned char *)buff; zip->stream.avail_in = s; - do { + for (;;) { /* Compress file data. */ r = compression_code(&(a->archive), &(zip->stream), run); if (r != ARCHIVE_OK && r != ARCHIVE_EOF) @@ -576,8 +580,12 @@ compress_out(struct archive_write *a, const void *buff, size_t s, if (zip->crc32flg & ENCODED_CRC32) zip->encoded_crc32 = crc32(zip->encoded_crc32, zip->wbuff, sizeof(zip->wbuff)); + if (run == ARCHIVE_Z_FINISH && r != ARCHIVE_EOF) + continue; } - } while (zip->stream.avail_in); + if (zip->stream.avail_in == 0) + break; + } if (run == ARCHIVE_Z_FINISH) { uint64_t bytes = sizeof(zip->wbuff) - zip->stream.avail_out; if (write_to_temp(a, zip->wbuff, (size_t)bytes) != ARCHIVE_OK) @@ -605,7 +613,7 @@ _7z_write_data(struct archive_write *a, const void *buff, size_t s) bytes = compress_out(a, buff, s, ARCHIVE_Z_RUN); if (bytes < 0) return (bytes); - zip->entry_crc32 = crc32(zip->entry_crc32, buff, bytes); + zip->entry_crc32 = crc32(zip->entry_crc32, buff, (unsigned)bytes); zip->entry_bytes_remaining -= bytes; return (bytes); } @@ -627,7 +635,7 @@ _7z_finish_entry(struct archive_write *a) s = a->null_length; r = _7z_write_data(a, a->nulls, s); if (r < 0) - return (r); + return ((int)r); } zip->total_bytes_compressed += zip->stream.total_in; zip->total_bytes_uncompressed += zip->stream.total_out; @@ -859,7 +867,7 @@ enc_uint64(struct archive_write *a, uint64_t val) numdata[0] |= mask; mask >>= 1; } - return (compress_out(a, numdata, i, ARCHIVE_Z_RUN)); + return ((int)compress_out(a, numdata, i, ARCHIVE_Z_RUN)); } static int @@ -924,7 +932,7 @@ make_substreamsInfo(struct archive_write *a, struct coder *coders) if (file->size == 0) break; archive_le32enc(crc, file->crc32); - r = compress_out(a, crc, 4, ARCHIVE_Z_RUN); + r = (int)compress_out(a, crc, 4, ARCHIVE_Z_RUN); if (r < 0) return (r); } @@ -948,7 +956,7 @@ make_streamsInfo(struct archive_write *a, uint64_t offset, uint64_t pack_size, int i, r; if (coders->codec == _7Z_COPY) - numFolders = zip->total_number_nonempty_entry; + numFolders = (int)zip->total_number_nonempty_entry; else numFolders = 1; @@ -1044,7 +1052,7 @@ make_streamsInfo(struct archive_write *a, uint64_t offset, uint64_t pack_size, /* Write Codec ID. */ codec_size &= 0x0f; - r = compress_out(a, &codec_buff[8-codec_size], + r = (int)compress_out(a, &codec_buff[8-codec_size], codec_size, ARCHIVE_Z_RUN); if (r < 0) return (r); @@ -1056,7 +1064,7 @@ make_streamsInfo(struct archive_write *a, uint64_t offset, uint64_t pack_size, return (r); /* Write Codec properties. */ - r = compress_out(a, coders[i].props, + r = (int)compress_out(a, coders[i].props, coders[i].prop_size, ARCHIVE_Z_RUN); if (r < 0) return (r); @@ -1102,7 +1110,7 @@ make_streamsInfo(struct archive_write *a, uint64_t offset, uint64_t pack_size, if (r < 0) return (r); archive_le32enc(crc, header_crc); - r = compress_out(a, crc, 4, ARCHIVE_Z_RUN); + r = (int)compress_out(a, crc, 4, ARCHIVE_Z_RUN); if (r < 0) return (r); } @@ -1196,7 +1204,7 @@ make_time(struct archive_write *a, uint8_t type, unsigned flg, int ti) b |= mask; mask >>= 1; if (mask == 0) { - r = compress_out(a, &b, 1, ARCHIVE_Z_RUN); + r = (int)compress_out(a, &b, 1, ARCHIVE_Z_RUN); if (r < 0) return (r); mask = 0x80; @@ -1204,7 +1212,7 @@ make_time(struct archive_write *a, uint8_t type, unsigned flg, int ti) } } if (mask != 0x80) { - r = compress_out(a, &b, 1, ARCHIVE_Z_RUN); + r = (int)compress_out(a, &b, 1, ARCHIVE_Z_RUN); if (r < 0) return (r); } @@ -1225,7 +1233,7 @@ make_time(struct archive_write *a, uint8_t type, unsigned flg, int ti) continue; archive_le64enc(filetime, utcToFiletime(file->times[ti].time, file->times[ti].time_ns)); - r = compress_out(a, filetime, 8, ARCHIVE_Z_RUN); + r = (int)compress_out(a, filetime, 8, ARCHIVE_Z_RUN); if (r < 0) return (r); } @@ -1296,7 +1304,7 @@ make_header(struct archive_write *a, uint64_t offset, uint64_t pack_size, b |= mask; mask >>= 1; if (mask == 0) { - r = compress_out(a, &b, 1, ARCHIVE_Z_RUN); + r = (int)compress_out(a, &b, 1, ARCHIVE_Z_RUN); if (r < 0) return (r); mask = 0x80; @@ -1304,7 +1312,7 @@ make_header(struct archive_write *a, uint64_t offset, uint64_t pack_size, } } if (mask != 0x80) { - r = compress_out(a, &b, 1, ARCHIVE_Z_RUN); + r = (int)compress_out(a, &b, 1, ARCHIVE_Z_RUN); if (r < 0) return (r); } @@ -1331,7 +1339,7 @@ make_header(struct archive_write *a, uint64_t offset, uint64_t pack_size, b |= mask; mask >>= 1; if (mask == 0) { - r = compress_out(a, &b, 1, ARCHIVE_Z_RUN); + r = (int)compress_out(a, &b, 1, ARCHIVE_Z_RUN); if (r < 0) return (r); mask = 0x80; @@ -1339,7 +1347,7 @@ make_header(struct archive_write *a, uint64_t offset, uint64_t pack_size, } } if (mask != 0x80) { - r = compress_out(a, &b, 1, ARCHIVE_Z_RUN); + r = (int)compress_out(a, &b, 1, ARCHIVE_Z_RUN); if (r < 0) return (r); } @@ -1362,7 +1370,7 @@ make_header(struct archive_write *a, uint64_t offset, uint64_t pack_size, file = zip->file_list.first; for (;file != NULL; file = file->next) { - r = compress_out(a, file->utf16name, file->name_len+2, + r = (int)compress_out(a, file->utf16name, file->name_len+2, ARCHIVE_Z_RUN); if (r < 0) return (r); @@ -1418,7 +1426,7 @@ make_header(struct archive_write *a, uint64_t offset, uint64_t pack_size, attr |= 1;/* Read Only. */ attr |= ((uint32_t)file->mode) << 16; archive_le32enc(&encattr, attr); - r = compress_out(a, &encattr, 4, ARCHIVE_Z_RUN); + r = (int)compress_out(a, &encattr, 4, ARCHIVE_Z_RUN); if (r < 0) return (r); } @@ -1512,7 +1520,7 @@ file_new(struct archive_write *a, struct archive_entry *entry, memcpy(file->utf16name, u16, u16len); file->utf16name[u16len+0] = 0; file->utf16name[u16len+1] = 0; - file->name_len = u16len; + file->name_len = (unsigned)u16len; file->mode = archive_entry_mode(entry); if (archive_entry_filetype(entry) == AE_IFREG) file->size = archive_entry_size(entry); @@ -1677,10 +1685,10 @@ compression_init_encoder_deflate(struct archive *a, * of ugly hackery to convert a const * pointer to * a non-const pointer. */ strm->next_in = (Bytef *)(uintptr_t)(const void *)lastrm->next_in; - strm->avail_in = lastrm->avail_in; + strm->avail_in = (uInt)lastrm->avail_in; strm->total_in = (uLong)lastrm->total_in; strm->next_out = lastrm->next_out; - strm->avail_out = lastrm->avail_out; + strm->avail_out = (uInt)lastrm->avail_out; strm->total_out = (uLong)lastrm->total_out; if (deflateInit2(strm, level, Z_DEFLATED, (withheader)?15:-15, @@ -1710,10 +1718,10 @@ compression_code_deflate(struct archive *a, * of ugly hackery to convert a const * pointer to * a non-const pointer. */ strm->next_in = (Bytef *)(uintptr_t)(const void *)lastrm->next_in; - strm->avail_in = lastrm->avail_in; + strm->avail_in = (uInt)lastrm->avail_in; strm->total_in = (uLong)lastrm->total_in; strm->next_out = lastrm->next_out; - strm->avail_out = lastrm->avail_out; + strm->avail_out = (uInt)lastrm->avail_out; strm->total_out = (uLong)lastrm->total_out; r = deflate(strm, (action == ARCHIVE_Z_FINISH)? Z_FINISH: Z_NO_FLUSH); diff --git a/libarchive/archive_write_set_format_ar.c b/libarchive/archive_write_set_format_ar.c index beff49031b23..9f17564c34c3 100644 --- a/libarchive/archive_write_set_format_ar.c +++ b/libarchive/archive_write_set_format_ar.c @@ -165,7 +165,7 @@ archive_write_ar_header(struct archive_write *a, struct archive_entry *entry) * Reject files with empty name. */ pathname = archive_entry_pathname(entry); - if (*pathname == '\0') { + if (pathname == NULL || *pathname == '\0') { archive_set_error(&a->archive, EINVAL, "Invalid filename"); return (ARCHIVE_WARN); diff --git a/libarchive/archive_write_set_format_by_name.c b/libarchive/archive_write_set_format_by_name.c index 9671f60f8cd1..af3105e482d6 100644 --- a/libarchive/archive_write_set_format_by_name.c +++ b/libarchive/archive_write_set_format_by_name.c @@ -56,8 +56,10 @@ struct { const char *name; int (*setter)(struct archive *); } names[] = { "iso", archive_write_set_format_iso9660 }, { "iso9660", archive_write_set_format_iso9660 }, { "mtree", archive_write_set_format_mtree }, + { "mtree-classic", archive_write_set_format_mtree_classic }, { "newc", archive_write_set_format_cpio_newc }, { "odc", archive_write_set_format_cpio }, + { "oldtar", archive_write_set_format_v7tar }, { "pax", archive_write_set_format_pax }, { "paxr", archive_write_set_format_pax_restricted }, { "posix", archive_write_set_format_pax }, @@ -65,6 +67,8 @@ struct { const char *name; int (*setter)(struct archive *); } names[] = { "shar", archive_write_set_format_shar }, { "shardump", archive_write_set_format_shar_dump }, { "ustar", archive_write_set_format_ustar }, + { "v7tar", archive_write_set_format_v7tar }, + { "v7", archive_write_set_format_v7tar }, { "xar", archive_write_set_format_xar }, { "zip", archive_write_set_format_zip }, { NULL, NULL } diff --git a/libarchive/archive_write_set_format_iso9660.c b/libarchive/archive_write_set_format_iso9660.c index 483de9086589..591370298d51 100644 --- a/libarchive/archive_write_set_format_iso9660.c +++ b/libarchive/archive_write_set_format_iso9660.c @@ -994,7 +994,7 @@ static void isoent_remove_child(struct isoent *, struct isoent *); static void isoent_setup_directory_location(struct iso9660 *, int, struct vdd *); static void isoent_setup_file_location(struct iso9660 *, int); -static int get_path_component(char *, int, const char *); +static int get_path_component(char *, size_t, const char *); static int isoent_tree(struct archive_write *, struct isoent **); static struct isoent *isoent_find_child(struct isoent *, const char *); static struct isoent *isoent_find_entry(struct isoent *, const char *); @@ -2889,7 +2889,7 @@ set_directory_record_rr(unsigned char *bp, int dr_len, if (nmmax > 0xff) nmmax = 0xff; while (nmlen + 5 > nmmax) { - length = nmmax; + length = (int)nmmax; if (bp != NULL) { bp[3] = length; bp[5] = 0x01;/* Alternate Name continues @@ -2912,7 +2912,7 @@ set_directory_record_rr(unsigned char *bp, int dr_len, bp[4] = 1; /* version */ } } - length = 5 + nmlen; + length = 5 + (int)nmlen; if (bp != NULL) { bp[3] = length; bp[5] = 0; @@ -3511,7 +3511,7 @@ set_directory_record(unsigned char *p, size_t n, struct isoent *isoent, /* Volume Sequence Number */ set_num_723(bp+29, iso9660->volume_sequence_number); /* Length of File Identifier */ - set_num_711(bp+33, fi_len); + set_num_711(bp+33, (unsigned char)fi_len); /* File Identifier */ switch (t) { case DIR_REC_VD: @@ -3542,20 +3542,20 @@ set_directory_record(unsigned char *p, size_t n, struct isoent *isoent, if (t == DIR_REC_VD) { if (p != NULL) /* Length of Directory Record */ - set_num_711(p, dr_len); + set_num_711(p, (unsigned char)dr_len); else - isoent->dr_len.vd = dr_len; - return (dr_len); + isoent->dr_len.vd = (int)dr_len; + return ((int)dr_len); } /* Rockridge */ if (iso9660->opt.rr && vdd_type != VDD_JOLIET) - dr_len = set_directory_record_rr(bp, dr_len, + dr_len = set_directory_record_rr(bp, (int)dr_len, isoent, iso9660, t); if (p != NULL) /* Length of Directory Record */ - set_num_711(p, dr_len); + set_num_711(p, (unsigned char)dr_len); else { /* * Save the size which is needed to write this @@ -3568,15 +3568,15 @@ set_directory_record(unsigned char *p, size_t n, struct isoent *isoent, * in switch .... */ break; case DIR_REC_SELF: - isoent->dr_len.self = dr_len; break; + isoent->dr_len.self = (int)dr_len; break; case DIR_REC_PARENT: - isoent->dr_len.parent = dr_len; break; + isoent->dr_len.parent = (int)dr_len; break; case DIR_REC_NORMAL: - isoent->dr_len.normal = dr_len; break; + isoent->dr_len.normal = (int)dr_len; break; } } - return (dr_len); + return ((int)dr_len); } /* @@ -4255,7 +4255,7 @@ _write_path_table(struct archive_write *a, int type_m, int depth, bp = wb -1; } /* Length of Directory Identifier */ - set_num_711(bp+1, len); + set_num_711(bp+1, (unsigned char)len); /* Extended Attribute Record Length */ set_num_711(bp+2, 0); /* Location of Extent */ @@ -4278,7 +4278,7 @@ _write_path_table(struct archive_write *a, int type_m, int depth, bp[9+len] = 0; len++; } - wsize += 8 + len; + wsize += 8 + (int)len; bp += 8 + len; } if ((bp + 1) > wb) { @@ -5448,7 +5448,8 @@ isoent_setup_file_location(struct iso9660 *iso9660, int location) size = fd_boot_image_size(iso9660->el_torito.media_type); if (size == 0) size = (size_t)archive_entry_size(isoent->file->entry); - block = (size + LOGICAL_BLOCK_SIZE -1) >> LOGICAL_BLOCK_BITS; + block = ((int)size + LOGICAL_BLOCK_SIZE -1) + >> LOGICAL_BLOCK_BITS; location += block; iso9660->total_file_block += block; isoent->file->content.blocks = block; @@ -5509,10 +5510,10 @@ isoent_setup_file_location(struct iso9660 *iso9660, int location) } static int -get_path_component(char *name, int n, const char *fn) +get_path_component(char *name, size_t n, const char *fn) { char *p; - int l; + size_t l; p = strchr(fn, '/'); if (p == NULL) { @@ -5525,7 +5526,7 @@ get_path_component(char *name, int n, const char *fn) memcpy(name, fn, l); name[l] = '\0'; - return (l); + return ((int)l); } /* @@ -5818,17 +5819,18 @@ idr_ensure_poolsize(struct archive_write *a, struct idr *idr, { if (idr->pool_size < cnt) { + void *p; const int bk = (1 << 7) - 1; int psize; psize = (cnt + bk) & ~bk; - idr->idrent_pool = realloc(idr->idrent_pool, - sizeof(struct idrent) * psize); - if (idr->idrent_pool == NULL) { + p = realloc(idr->idrent_pool, sizeof(struct idrent) * psize); + if (p == NULL) { archive_set_error(&a->archive, ENOMEM, "Can't allocate memory"); return (ARCHIVE_FATAL); } + idr->idrent_pool = (struct idrent *)p; idr->pool_size = psize; } return (ARCHIVE_OK); @@ -6016,7 +6018,7 @@ isoent_gen_iso9660_identifier(struct archive_write *a, struct isoent *isoent, char *dot, *xdot; int ext_off, noff, weight; - l = np->file->basename.length; + l = (int)np->file->basename.length; p = malloc(l+31+2+1); if (p == NULL) { archive_set_error(&a->archive, ENOMEM, @@ -6080,7 +6082,7 @@ isoent_gen_iso9660_identifier(struct archive_write *a, struct isoent *isoent, ext_off = l; } else { *dot = '.'; - ext_off = dot - p; + ext_off = (int)(dot - p); if (iso9660->opt.iso_level == 1) { if (dot - p <= 8) { @@ -6107,11 +6109,11 @@ isoent_gen_iso9660_identifier(struct archive_write *a, struct isoent *isoent, ext_off = dnmax; } } else if (l > ffmax) { - int extlen = strlen(dot); + int extlen = (int)strlen(dot); int xdoff; if (xdot != NULL) - xdoff = xdot - p; + xdoff = (int)(xdot - p); else xdoff = 0; @@ -6148,7 +6150,7 @@ isoent_gen_iso9660_identifier(struct archive_write *a, struct isoent *isoent, } /* Save an offset of a file name extension to sort files. */ np->ext_off = ext_off; - np->ext_len = strlen(&p[ext_off]); + np->ext_len = (int)strlen(&p[ext_off]); np->id_len = l = ext_off + np->ext_len; /* Make an offset of the number which is used to be set @@ -6265,10 +6267,10 @@ isoent_gen_joliet_identifier(struct archive_write *a, struct isoent *isoent, p += 2; lt -= 2; } - ext_off = dot - (unsigned char *)np->identifier; + ext_off = (int)(dot - (unsigned char *)np->identifier); np->ext_off = ext_off; - np->ext_len = l - ext_off; - np->id_len = l; + np->ext_len = (int)l - ext_off; + np->id_len = (int)l; /* * Get a length of MBS of a full-pathname. @@ -6282,11 +6284,11 @@ isoent_gen_joliet_identifier(struct archive_write *a, struct isoent *isoent, "No memory"); return (ARCHIVE_FATAL); } - np->mb_len = iso9660->mbs.length; + np->mb_len = (int)iso9660->mbs.length; if (np->mb_len != (int)np->file->basename.length) weight = np->mb_len; } else - np->mb_len = np->file->basename.length; + np->mb_len = (int)np->file->basename.length; /* If a length of full-pathname is longer than 240 bytes, * it violates Joliet extensions regulation. */ @@ -6916,12 +6918,22 @@ isoent_make_path_table_2(struct archive_write *a, struct vdd *vdd, switch (vdd->vdd_type) { case VDD_PRIMARY: case VDD_ENHANCED: +#ifdef __COMPAR_FN_T + qsort(enttbl, pt->cnt, sizeof(struct isoent *), + (__compar_fn_t)_compare_path_table); +#else qsort(enttbl, pt->cnt, sizeof(struct isoent *), _compare_path_table); +#endif break; case VDD_JOLIET: +#ifdef __COMPAR_FN_T + qsort(enttbl, pt->cnt, sizeof(struct isoent *), + (__compar_fn_t)_compare_path_table_joliet); +#else qsort(enttbl, pt->cnt, sizeof(struct isoent *), _compare_path_table_joliet); +#endif break; } for (i = 0; i < pt->cnt; i++) @@ -7390,7 +7402,7 @@ zisofs_init(struct archive_write *a, struct isofile *file) struct iso9660 *iso9660 = a->format_data; #ifdef HAVE_ZLIB_H uint64_t tsize; - size_t ceil, bpsize; + size_t _ceil, bpsize; int r; #endif @@ -7429,9 +7441,9 @@ zisofs_init(struct archive_write *a, struct isofile *file) (uint32_t)archive_entry_size(file->entry); /* Calculate a size of Block Pointers of zisofs. */ - ceil = (file->zisofs.uncompressed_size + ZF_BLOCK_SIZE -1) + _ceil = (file->zisofs.uncompressed_size + ZF_BLOCK_SIZE -1) >> file->zisofs.log2_bs; - iso9660->zisofs.block_pointers_cnt = ceil + 1; + iso9660->zisofs.block_pointers_cnt = (int)_ceil + 1; iso9660->zisofs.block_pointers_idx = 0; /* Ensure a buffer size used for Block Pointers */ @@ -7483,7 +7495,7 @@ zisofs_detect_magic(struct archive_write *a, const void *buff, size_t s) uint32_t uncompressed_size; unsigned char header_size; unsigned char log2_bs; - size_t ceil, doff; + size_t _ceil, doff; uint32_t bst, bed; int magic_max; int64_t entry_size; @@ -7507,7 +7519,7 @@ zisofs_detect_magic(struct archive_write *a, const void *buff, size_t s) l = s; memcpy(iso9660->zisofs.magic_buffer + iso9660->zisofs.magic_cnt, buff, l); - iso9660->zisofs.magic_cnt += l; + iso9660->zisofs.magic_cnt += (int)l; if (iso9660->zisofs.magic_cnt < magic_max) return; } @@ -7531,16 +7543,16 @@ zisofs_detect_magic(struct archive_write *a, const void *buff, size_t s) return;/* Invalid or not supported header. */ /* Calculate a size of Block Pointers of zisofs. */ - ceil = (uncompressed_size + + _ceil = (uncompressed_size + (ARCHIVE_LITERAL_LL(1) << log2_bs) -1) >> log2_bs; - doff = (ceil + 1) * 4 + 16; + doff = (_ceil + 1) * 4 + 16; if (entry_size < (int64_t)doff) return;/* Invalid data. */ /* Check every Block Pointer has valid value. */ p = magic_buff + 16; endp = magic_buff + magic_max; - while (ceil && p + 8 <= endp) { + while (_ceil && p + 8 <= endp) { bst = archive_le32dec(p); if (bst != doff) return;/* Invalid data. */ @@ -7549,7 +7561,7 @@ zisofs_detect_magic(struct archive_write *a, const void *buff, size_t s) if (bed < bst || bed > entry_size) return;/* Invalid data. */ doff += bed - bst; - ceil--; + _ceil--; } file->zisofs.uncompressed_size = uncompressed_size; @@ -7577,7 +7589,7 @@ zisofs_write_to_temp(struct archive_write *a, const void *buff, size_t s) zstrm = &(iso9660->zisofs.stream); zstrm->next_out = wb_buffptr(a); - zstrm->avail_out = wb_remaining(a); + zstrm->avail_out = (uInt)wb_remaining(a); b = (const unsigned char *)buff; do { avail = ZF_BLOCK_SIZE - zstrm->total_in; @@ -7591,7 +7603,7 @@ zisofs_write_to_temp(struct archive_write *a, const void *buff, size_t s) flush = Z_FINISH; zstrm->next_in = (Bytef *)(uintptr_t)(const void *)b; - zstrm->avail_in = avail; + zstrm->avail_in = (uInt)avail; /* * Check if current data block are all zero. @@ -7647,7 +7659,7 @@ zisofs_write_to_temp(struct archive_write *a, const void *buff, size_t s) iso9660->zisofs.total_size += csize; iso9660->cur_file->cur_content->size += csize; zstrm->next_out = wb_buffptr(a); - zstrm->avail_out = wb_remaining(a); + zstrm->avail_out = (uInt)wb_remaining(a); break; default: archive_set_error(&a->archive, @@ -7792,13 +7804,13 @@ zisofs_extract_init(struct archive_write *a, struct zisofs_extract *zisofs, const unsigned char *p, size_t bytes) { size_t avail = bytes; - size_t ceil, xsize; + size_t _ceil, xsize; /* Allocate block pointers buffer. */ - ceil = (size_t)((zisofs->pz_uncompressed_size + + _ceil = (size_t)((zisofs->pz_uncompressed_size + (((int64_t)1) << zisofs->pz_log2_bs) - 1) >> zisofs->pz_log2_bs); - xsize = (ceil + 1) * 4; + xsize = (_ceil + 1) * 4; if (zisofs->block_pointers == NULL) { size_t alloc = ((xsize >> 10) + 1) << 10; zisofs->block_pointers = malloc(alloc); @@ -7811,7 +7823,7 @@ zisofs_extract_init(struct archive_write *a, struct zisofs_extract *zisofs, zisofs->block_pointers_size = xsize; /* Allocate uncompressed data buffer. */ - zisofs->uncompressed_buffer_size = 1UL << zisofs->pz_log2_bs; + zisofs->uncompressed_buffer_size = (size_t)1UL << zisofs->pz_log2_bs; /* * Read the file header, and check the magic code of zisofs. @@ -7881,7 +7893,7 @@ zisofs_extract(struct archive_write *a, struct zisofs_extract *zisofs, return (rs); if (!zisofs->initialized) { /* We need more data. */ - zisofs->pz_offset += bytes; + zisofs->pz_offset += (uint32_t)bytes; return (bytes); } avail = rs; @@ -7964,9 +7976,9 @@ zisofs_extract(struct archive_write *a, struct zisofs_extract *zisofs, if (avail > zisofs->block_avail) zisofs->stream.avail_in = zisofs->block_avail; else - zisofs->stream.avail_in = avail; + zisofs->stream.avail_in = (uInt)avail; zisofs->stream.next_out = wb_buffptr(a); - zisofs->stream.avail_out = wb_remaining(a); + zisofs->stream.avail_out = (uInt)wb_remaining(a); r = inflate(&zisofs->stream, 0); switch (r) { @@ -7979,12 +7991,12 @@ zisofs_extract(struct archive_write *a, struct zisofs_extract *zisofs, return (ARCHIVE_FATAL); } avail -= zisofs->stream.next_in - p; - zisofs->block_avail -= zisofs->stream.next_in - p; + zisofs->block_avail -= (uint32_t)(zisofs->stream.next_in - p); r = wb_consume(a, wb_remaining(a) - zisofs->stream.avail_out); if (r < 0) return (r); } - zisofs->pz_offset += bytes; + zisofs->pz_offset += (uint32_t)bytes; return (bytes - avail); } diff --git a/libarchive/archive_write_set_format_mtree.c b/libarchive/archive_write_set_format_mtree.c index 4b300012f7a6..9c0613c9b025 100644 --- a/libarchive/archive_write_set_format_mtree.c +++ b/libarchive/archive_write_set_format_mtree.c @@ -38,6 +38,8 @@ __FBSDID("$FreeBSD: head/lib/libarchive/archive_write_set_format_mtree.c 201171 #include "archive_crypto_private.h" #include "archive_entry.h" #include "archive_private.h" +#include "archive_rb.h" +#include "archive_string.h" #include "archive_write_private.h" #define INDENTNAMELEN 15 @@ -45,27 +47,39 @@ __FBSDID("$FreeBSD: head/lib/libarchive/archive_write_set_format_mtree.c 201171 #define SET_KEYS \ (F_FLAGS | F_GID | F_GNAME | F_MODE | F_TYPE | F_UID | F_UNAME) -struct mtree_entry { - struct mtree_entry *next; +struct attr_counter { + struct attr_counter *prev; + struct attr_counter *next; + struct mtree_entry *m_entry; + int count; +}; - char *pathname; - char *symlink; - unsigned int nlink; - mode_t filetype; - mode_t mode; - int64_t uid; - int64_t gid; - char *uname; - char *gname; - char *fflags_text; - unsigned long fflags_set; - unsigned long fflags_clear; - time_t mtime; - long mtime_nsec; - dev_t rdevmajor; - dev_t rdevminor; - int64_t size; +struct att_counter_set { + struct attr_counter *uid_list; + struct attr_counter *gid_list; + struct attr_counter *mode_list; + struct attr_counter *flags_list; +}; +struct mtree_chain { + struct mtree_entry *first; + struct mtree_entry **last; +}; + +/* + * The Data only for a directory file. + */ +struct dir_info { + struct archive_rb_tree rbtree; + struct mtree_chain children; + struct mtree_entry *chnext; + int virtual; +}; + +/* + * The Data only for a regular file. + */ +struct reg_info { int compute_sum; uint32_t crc; #ifdef ARCHIVE_HAS_MD5 @@ -88,23 +102,51 @@ struct mtree_entry { #endif }; -struct attr_counter { - struct attr_counter *prev; - struct attr_counter *next; - int count; - struct mtree_entry *m_entry; +struct mtree_entry { + struct archive_rb_node rbnode; + struct mtree_entry *next; + struct mtree_entry *parent; + struct dir_info *dir_info; + struct reg_info *reg_info; + + struct archive_string parentdir; + struct archive_string basename; + struct archive_string pathname; + struct archive_string symlink; + struct archive_string uname; + struct archive_string gname; + struct archive_string fflags_text; + unsigned int nlink; + mode_t filetype; + mode_t mode; + int64_t size; + int64_t uid; + int64_t gid; + time_t mtime; + long mtime_nsec; + unsigned long fflags_set; + unsigned long fflags_clear; + dev_t rdevmajor; + dev_t rdevminor; }; struct mtree_writer { struct mtree_entry *mtree_entry; + struct mtree_entry *root; + struct mtree_entry *cur_dirent; + struct archive_string cur_dirstr; + struct mtree_chain file_list; + struct archive_string ebuf; struct archive_string buf; int first; uint64_t entry_bytes_remaining; + + /* + * Set global value. + */ struct { - int output; - int processed; - struct archive_string parent; + int processing; mode_t type; int keys; int64_t uid; @@ -112,14 +154,11 @@ struct mtree_writer { mode_t mode; unsigned long fflags_set; unsigned long fflags_clear; - - struct attr_counter *uid_list; - struct attr_counter *gid_list; - struct attr_counter *mode_list; - struct attr_counter *flags_list; - struct mtree_entry *me_first; - struct mtree_entry **me_last; } set; + struct att_counter_set acs; + int classic; + int depth; + /* check sum */ int compute_sum; uint32_t crc; @@ -173,27 +212,51 @@ struct mtree_writer { #define F_SHA512 0x02000000 /* SHA-512 digest */ /* Options */ - int dironly; /* if the dironly is 1, ignore everything except - * directory type files. like mtree(8) -d option. - */ - int indent; /* if the indent is 1, indent writing data. */ + int dironly; /* If it is set, ignore all files except + * directory files, like mtree(8) -d option. */ + int indent; /* If it is set, indent output data. */ + int output_global_set; /* If it is set, use /set keyword to set + * global values. When generating mtree + * classic format, it is set by default. */ }; #define DEFAULT_KEYS (F_DEV | F_FLAGS | F_GID | F_GNAME | F_SLINK | F_MODE\ | F_NLINK | F_SIZE | F_TIME | F_TYPE | F_UID\ | F_UNAME) +#define attr_counter_set_reset attr_counter_set_free -static struct attr_counter * new_attr_count(struct mtree_entry *, - struct attr_counter *); -static void free_attr_count(struct attr_counter **); -static int inc_attr_count(struct attr_counter **, struct attr_counter *, +static void attr_counter_free(struct attr_counter **); +static int attr_counter_inc(struct attr_counter **, struct attr_counter *, struct attr_counter *, struct mtree_entry *); -static int collect_set_values(struct mtree_writer *, struct mtree_entry *); -static int get_keys(struct mtree_writer *, struct mtree_entry *); +static struct attr_counter * attr_counter_new(struct mtree_entry *, + struct attr_counter *); +static int attr_counter_set_collect(struct mtree_writer *, + struct mtree_entry *); +static void attr_counter_set_free(struct mtree_writer *); +static int get_global_set_keys(struct mtree_writer *, struct mtree_entry *); +static int mtree_entry_add_child_tail(struct mtree_entry *, + struct mtree_entry *); +static int mtree_entry_create_virtual_dir(struct archive_write *, const char *, + struct mtree_entry **); +static int mtree_entry_cmp_node(const struct archive_rb_node *, + const struct archive_rb_node *); +static int mtree_entry_cmp_key(const struct archive_rb_node *, const void *); +static int mtree_entry_exchange_same_entry(struct archive_write *, + struct mtree_entry *, struct mtree_entry *); +static void mtree_entry_free(struct mtree_entry *); +static int mtree_entry_new(struct archive_write *, struct archive_entry *, + struct mtree_entry **); +static void mtree_entry_register_free(struct mtree_writer *); +static void mtree_entry_register_init(struct mtree_writer *); +static int mtree_entry_setup_filenames(struct archive_write *, + struct mtree_entry *, struct archive_entry *); +static int mtree_entry_tree_add(struct archive_write *, struct mtree_entry **); static void sum_init(struct mtree_writer *); static void sum_update(struct mtree_writer *, const void *, size_t); -static void sum_final(struct mtree_writer *, struct mtree_entry *); -static void sum_write(struct archive_string *, struct mtree_entry *); +static void sum_final(struct mtree_writer *, struct reg_info *); +static void sum_write(struct archive_string *, struct reg_info *); +static int write_mtree_entry(struct archive_write *, struct mtree_entry *); +static int write_dot_dot_entry(struct archive_write *, struct mtree_entry *); #define COMPUTE_CRC(var, ch) (var) = (var) << 8 ^ crctab[(var) >> 24 ^ (ch)] static const uint32_t crctab[] = { @@ -251,26 +314,30 @@ static const uint32_t crctab[] = { 0xa2f33668, 0xbcb4666d, 0xb8757bda, 0xb5365d03, 0xb1f740b4 }; -static int -mtree_safe_char(char c) -{ - if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z')) - return 1; - if (c >= '0' && c <= '9') - return 1; - if (c == 35 || c == 61 || c == 92) - return 0; /* #, = and \ are always quoted */ - - if (c >= 33 && c <= 47) /* !"$%&'()*+,-./ */ - return 1; - if (c >= 58 && c <= 64) /* :;<>?@ */ - return 1; - if (c >= 91 && c <= 96) /* []^_` */ - return 1; - if (c >= 123 && c <= 126) /* {|}~ */ - return 1; - return 0; -} +static const unsigned char safe_char[256] = { + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 00 - 0F */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 10 - 1F */ + /* !"$%&'()*+,-./ EXCLUSION:0x20( ) 0x23(#) */ + 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 20 - 2F */ + /* 0123456789:;<>? EXCLUSION:0x3d(=) */ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, /* 30 - 3F */ + /* @ABCDEFGHIJKLMNO */ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 40 - 4F */ + /* PQRSTUVWXYZ[]^_ EXCLUSION:0x5c(\) */ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, /* 50 - 5F */ + /* `abcdefghijklmno */ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, /* 60 - 6F */ + /* pqrstuvwxyz{|}~ */ + 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, /* 70 - 7F */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 80 - 8F */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* 90 - 9F */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* A0 - AF */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* B0 - BF */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* C0 - CF */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* D0 - DF */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* E0 - EF */ + 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, /* F0 - FF */ +}; static void mtree_quote(struct archive_string *s, const char *str) @@ -280,7 +347,7 @@ mtree_quote(struct archive_string *s, const char *str) unsigned char c; for (start = str; *str != '\0'; ++str) { - if (mtree_safe_char(*str)) + if (safe_char[*(const unsigned char *)str]) continue; if (start != str) archive_strncat(s, start, str - start); @@ -303,9 +370,19 @@ mtree_quote(struct archive_string *s, const char *str) static void mtree_indent(struct mtree_writer *mtree) { - int i, fn; + int i, fn, nd, pd; const char *r, *s, *x; + if (mtree->classic) { + if (mtree->indent) { + nd = 0; + pd = mtree->depth * 4; + } else { + nd = mtree->depth?4:0; + pd = 0; + } + } else + nd = pd = 0; fn = 1; s = r = mtree->ebuf.s; x = NULL; @@ -314,37 +391,46 @@ mtree_indent(struct mtree_writer *mtree) while ((r = strchr(r, ' ')) != NULL) { if (fn) { fn = 0; + for (i = 0; i < nd + pd; i++) + archive_strappend_char(&mtree->buf, ' '); archive_strncat(&mtree->buf, s, r - s); - if (r -s > INDENTNAMELEN) { + if (nd + (r -s) > INDENTNAMELEN) { archive_strncat(&mtree->buf, " \\\n", 3); - for (i = 0; i < (INDENTNAMELEN + 1); i++) + for (i = 0; i < (INDENTNAMELEN + 1 + pd); i++) archive_strappend_char(&mtree->buf, ' '); } else { - for (i = r -s; i < (INDENTNAMELEN + 1); i++) + for (i = (int)(r -s + nd); + i < (INDENTNAMELEN + 1); i++) archive_strappend_char(&mtree->buf, ' '); } s = ++r; x = NULL; continue; } - if (r - s <= MAXLINELEN - 3 - INDENTNAMELEN) + if (pd + (r - s) <= MAXLINELEN - 3 - INDENTNAMELEN) x = r++; else { if (x == NULL) x = r; archive_strncat(&mtree->buf, s, x - s); archive_strncat(&mtree->buf, " \\\n", 3); - for (i = 0; i < (INDENTNAMELEN + 1); i++) + for (i = 0; i < (INDENTNAMELEN + 1 + pd); i++) archive_strappend_char(&mtree->buf, ' '); s = r = ++x; x = NULL; } } - if (x != NULL && strlen(s) > MAXLINELEN - 3 - INDENTNAMELEN) { + if (fn) { + for (i = 0; i < nd + pd; i++) + archive_strappend_char(&mtree->buf, ' '); + archive_strcat(&mtree->buf, s); + s += strlen(s); + } + if (x != NULL && pd + strlen(s) > MAXLINELEN - 3 - INDENTNAMELEN) { /* Last keyword is longer. */ archive_strncat(&mtree->buf, s, x - s); archive_strncat(&mtree->buf, " \\\n", 3); - for (i = 0; i < (INDENTNAMELEN + 1); i++) + for (i = 0; i < (INDENTNAMELEN + 1 + pd); i++) archive_strappend_char(&mtree->buf, ' '); s = ++x; } @@ -352,163 +438,70 @@ mtree_indent(struct mtree_writer *mtree) archive_string_empty(&mtree->ebuf); } -#if !defined(_WIN32) || defined(__CYGWIN__) -static size_t -dir_len(struct mtree_entry *me) -{ - const char *path, *r; - - path = me->pathname; - r = strrchr(path, '/'); - if (r == NULL) - return (0); - /* Include a separator size */ - return (r - path + 1); -} - -#else /* _WIN32 && !__CYGWIN__ */ -/* - * Note: We should use wide-character for findng '\' character, - * a directory separator on Windows, because some character-set have - * been using the '\' character for a part of its multibyte character - * code. - */ -static size_t -dir_len(struct mtree_entry *me) -{ - wchar_t wc; - const char *path; - const char *p, *rp; - size_t al, l, size; - - path = me->pathname; - al = l = -1; - for (p = path; *p != '\0'; ++p) { - if (*p == '\\') - al = l = p - path; - else if (*p == '/') - al = p - path; - } - if (l == (size_t)-1) - goto alen; - size = p - path; - rp = p = path; - while (*p != '\0') { - l = mbtowc(&wc, p, size); - if (l == (size_t)-1) - goto alen; - if (l == 1 && (wc == L'/' || wc == L'\\')) - rp = p; - p += l; - size -= l; - } - return (rp - path + 1); -alen: - if (al == (size_t)-1) - return (0); - return (al + 1); -} -#endif /* _WIN32 && !__CYGWIN__ */ - -/* - * Test if a parent directory of the current entry is changed. - */ -static int -parent_dir_changed(struct archive_string *dir, struct mtree_entry *me) -{ - const char *path; - size_t l; - - l = dir_len(me); - path = me->pathname; - if (archive_strlen(dir) > 0) { - if (l == 0) { - archive_string_empty(dir); - return (1); - } - if (strncmp(dir->s, path, l) == 0) - return (0); /* The parent directory is the same. */ - } else if (l == 0) - return (0); /* The parent directory is the same. */ - archive_strncpy(dir, path, l); - return (1); -} - /* * Write /set keyword. * Set most used value of uid,gid,mode and fflags, which are - * collected by collect_set_values() function. + * collected by attr_counter_set_collect() function. */ static void write_global(struct mtree_writer *mtree) { struct archive_string setstr; struct archive_string unsetstr; - const char *name; + struct att_counter_set *acs; int keys, oldkeys, effkeys; - struct attr_counter *ac; archive_string_init(&setstr); archive_string_init(&unsetstr); keys = mtree->keys & SET_KEYS; oldkeys = mtree->set.keys; effkeys = keys; - if (mtree->set.processed) { + acs = &mtree->acs; + if (mtree->set.processing) { /* * Check if the global data needs updating. */ effkeys &= ~F_TYPE; - if (oldkeys & (F_UNAME | F_UID)) { - ac = mtree->set.uid_list; - do { - if (mtree->set.uid == ac->m_entry->uid) { - effkeys &= ~(F_UNAME | F_UID); - break; - } - if (ac->next != NULL && - ac->next->count == ac->count) - continue; - } while (0); + if (acs->uid_list == NULL) + effkeys &= ~(F_UNAME | F_UID); + else if (oldkeys & (F_UNAME | F_UID)) { + if (acs->uid_list->count < 2 || + mtree->set.uid == acs->uid_list->m_entry->uid) + effkeys &= ~(F_UNAME | F_UID); } - if (oldkeys & (F_GNAME | F_GID)) { - ac = mtree->set.gid_list; - do { - if (mtree->set.gid == ac->m_entry->gid) { - effkeys &= ~(F_GNAME | F_GID); - break; - } - if (ac->next != NULL && - ac->next->count == ac->count) - continue; - } while (0); + if (acs->gid_list == NULL) + effkeys &= ~(F_GNAME | F_GID); + else if (oldkeys & (F_GNAME | F_GID)) { + if (acs->gid_list->count < 2 || + mtree->set.gid == acs->gid_list->m_entry->gid) + effkeys &= ~(F_GNAME | F_GID); } - if (oldkeys & F_MODE) { - ac = mtree->set.mode_list; - do { - if (mtree->set.mode == ac->m_entry->mode) { - effkeys &= ~F_MODE; - break; - } - if (ac->next != NULL && - ac->next->count == ac->count) - continue; - } while (0); + if (acs->mode_list == NULL) + effkeys &= ~F_MODE; + else if (oldkeys & F_MODE) { + if (acs->mode_list->count < 2 || + mtree->set.mode == acs->mode_list->m_entry->mode) + effkeys &= ~F_MODE; } - if ((oldkeys & F_FLAGS) != 0) { - ac = mtree->set.flags_list; - do { - if (ac->m_entry->fflags_set == - mtree->set.fflags_set && - ac->m_entry->fflags_clear == - mtree->set.fflags_clear) { - effkeys &= ~F_FLAGS; - break; - } - if (ac->next != NULL && - ac->next->count == ac->count) - continue; - } while (0); + if (acs->flags_list == NULL) + effkeys &= ~F_FLAGS; + else if ((oldkeys & F_FLAGS) != 0) { + if (acs->flags_list->count < 2 || + (acs->flags_list->m_entry->fflags_set == + mtree->set.fflags_set && + acs->flags_list->m_entry->fflags_clear == + mtree->set.fflags_clear)) + effkeys &= ~F_FLAGS; } + } else { + if (acs->uid_list == NULL) + keys &= ~(F_UNAME | F_UID); + if (acs->gid_list == NULL) + keys &= ~(F_GNAME | F_GID); + if (acs->mode_list == NULL) + keys &= ~F_MODE; + if (acs->flags_list == NULL) + keys &= ~F_FLAGS; } if ((keys & effkeys & F_TYPE) != 0) { if (mtree->dironly) { @@ -520,10 +513,9 @@ write_global(struct mtree_writer *mtree) } } if ((keys & effkeys & F_UNAME) != 0) { - name = mtree->set.uid_list->m_entry->uname; - if (name != NULL) { + if (archive_strlen(&(acs->uid_list->m_entry->uname)) > 0) { archive_strcat(&setstr, " uname="); - mtree_quote(&setstr, name); + mtree_quote(&setstr, acs->uid_list->m_entry->uname.s); } else { keys &= ~F_UNAME; if ((oldkeys & F_UNAME) != 0) @@ -531,15 +523,14 @@ write_global(struct mtree_writer *mtree) } } if ((keys & effkeys & F_UID) != 0) { - mtree->set.uid = mtree->set.uid_list->m_entry->uid; + mtree->set.uid = acs->uid_list->m_entry->uid; archive_string_sprintf(&setstr, " uid=%jd", (intmax_t)mtree->set.uid); } if ((keys & effkeys & F_GNAME) != 0) { - name = mtree->set.gid_list->m_entry->gname; - if (name != NULL) { + if (archive_strlen(&(acs->gid_list->m_entry->gname)) > 0) { archive_strcat(&setstr, " gname="); - mtree_quote(&setstr, name); + mtree_quote(&setstr, acs->gid_list->m_entry->gname.s); } else { keys &= ~F_GNAME; if ((oldkeys & F_GNAME) != 0) @@ -547,24 +538,25 @@ write_global(struct mtree_writer *mtree) } } if ((keys & effkeys & F_GID) != 0) { - mtree->set.gid = mtree->set.gid_list->m_entry->gid; + mtree->set.gid = acs->gid_list->m_entry->gid; archive_string_sprintf(&setstr, " gid=%jd", (intmax_t)mtree->set.gid); } if ((keys & effkeys & F_MODE) != 0) { - mtree->set.mode = mtree->set.mode_list->m_entry->mode; + mtree->set.mode = acs->mode_list->m_entry->mode; archive_string_sprintf(&setstr, " mode=%o", (unsigned int)mtree->set.mode); } if ((keys & effkeys & F_FLAGS) != 0) { - name = mtree->set.flags_list->m_entry->fflags_text; - if (name != NULL) { + if (archive_strlen( + &(acs->flags_list->m_entry->fflags_text)) > 0) { archive_strcat(&setstr, " flags="); - mtree_quote(&setstr, name); + mtree_quote(&setstr, + acs->flags_list->m_entry->fflags_text.s); mtree->set.fflags_set = - mtree->set.flags_list->m_entry->fflags_set; + acs->flags_list->m_entry->fflags_set; mtree->set.fflags_clear = - mtree->set.flags_list->m_entry->fflags_clear; + acs->flags_list->m_entry->fflags_clear; } else { keys &= ~F_FLAGS; if ((oldkeys & F_FLAGS) != 0) @@ -578,16 +570,11 @@ write_global(struct mtree_writer *mtree) archive_string_sprintf(&mtree->buf, "/set%s\n", setstr.s); archive_string_free(&setstr); mtree->set.keys = keys; - mtree->set.processed = 1; - - free_attr_count(&mtree->set.uid_list); - free_attr_count(&mtree->set.gid_list); - free_attr_count(&mtree->set.mode_list); - free_attr_count(&mtree->set.flags_list); + mtree->set.processing = 1; } static struct attr_counter * -new_attr_count(struct mtree_entry *me, struct attr_counter *prev) +attr_counter_new(struct mtree_entry *me, struct attr_counter *prev) { struct attr_counter *ac; @@ -602,7 +589,7 @@ new_attr_count(struct mtree_entry *me, struct attr_counter *prev) } static void -free_attr_count(struct attr_counter **top) +attr_counter_free(struct attr_counter **top) { struct attr_counter *ac, *tac; @@ -618,7 +605,7 @@ free_attr_count(struct attr_counter **top) } static int -inc_attr_count(struct attr_counter **top, struct attr_counter *ac, +attr_counter_inc(struct attr_counter **top, struct attr_counter *ac, struct attr_counter *last, struct mtree_entry *me) { struct attr_counter *pac; @@ -647,7 +634,7 @@ inc_attr_count(struct attr_counter **top, struct attr_counter *ac, ac->next->prev = ac; } } else { - ac = new_attr_count(me, last); + ac = attr_counter_new(me, last); if (ac == NULL) return (-1); last->next = ac; @@ -655,93 +642,99 @@ inc_attr_count(struct attr_counter **top, struct attr_counter *ac, return (0); } +/* + * Tabulate uid,gid,mode and fflags of a entry in order to be used for /set. + */ static int -collect_set_values(struct mtree_writer *mtree, struct mtree_entry *me) +attr_counter_set_collect(struct mtree_writer *mtree, struct mtree_entry *me) { - int keys = mtree->keys; struct attr_counter *ac, *last; + struct att_counter_set *acs = &mtree->acs; + int keys = mtree->keys; if (keys & (F_UNAME | F_UID)) { - if (mtree->set.uid_list == NULL) { - mtree->set.uid_list = new_attr_count(me, NULL); - if (mtree->set.uid_list == NULL) + if (acs->uid_list == NULL) { + acs->uid_list = attr_counter_new(me, NULL); + if (acs->uid_list == NULL) return (-1); } else { last = NULL; - for (ac = mtree->set.uid_list; ac; ac = ac->next) { + for (ac = acs->uid_list; ac; ac = ac->next) { if (ac->m_entry->uid == me->uid) break; last = ac; } - if (inc_attr_count( - &mtree->set.uid_list, ac, last, me) < 0) + if (attr_counter_inc(&acs->uid_list, ac, last, me) < 0) return (-1); } } if (keys & (F_GNAME | F_GID)) { - if (mtree->set.gid_list == NULL) { - mtree->set.gid_list = new_attr_count(me, NULL); - if (mtree->set.gid_list == NULL) + if (acs->gid_list == NULL) { + acs->gid_list = attr_counter_new(me, NULL); + if (acs->gid_list == NULL) return (-1); } else { last = NULL; - for (ac = mtree->set.gid_list; ac; ac = ac->next) { + for (ac = acs->gid_list; ac; ac = ac->next) { if (ac->m_entry->gid == me->gid) break; last = ac; } - if (inc_attr_count( - &mtree->set.gid_list, ac, last, me) < 0) + if (attr_counter_inc(&acs->gid_list, ac, last, me) < 0) return (-1); } } if (keys & F_MODE) { - if (mtree->set.mode_list == NULL) { - mtree->set.mode_list = new_attr_count(me, NULL); - if (mtree->set.mode_list == NULL) + if (acs->mode_list == NULL) { + acs->mode_list = attr_counter_new(me, NULL); + if (acs->mode_list == NULL) return (-1); } else { last = NULL; - for (ac = mtree->set.mode_list; ac; ac = ac->next) { + for (ac = acs->mode_list; ac; ac = ac->next) { if (ac->m_entry->mode == me->mode) break; last = ac; } - if (inc_attr_count( - &mtree->set.mode_list, ac, last, me) < 0) + if (attr_counter_inc(&acs->mode_list, ac, last, me) < 0) return (-1); } } if (keys & F_FLAGS) { - if (mtree->set.flags_list == NULL) { - mtree->set.flags_list = new_attr_count(me, NULL); - if (mtree->set.flags_list == NULL) + if (acs->flags_list == NULL) { + acs->flags_list = attr_counter_new(me, NULL); + if (acs->flags_list == NULL) return (-1); } else { last = NULL; - for (ac = mtree->set.flags_list; ac; ac = ac->next) { + for (ac = acs->flags_list; ac; ac = ac->next) { if (ac->m_entry->fflags_set == me->fflags_set && - ac->m_entry->fflags_clear == me->fflags_clear) + ac->m_entry->fflags_clear == + me->fflags_clear) break; last = ac; } - if (inc_attr_count( - &mtree->set.flags_list, ac, last, me) < 0) + if (attr_counter_inc(&acs->flags_list, ac, last, me) < 0) return (-1); } } - /* - * Save a entry. - */ - me->next = NULL; - *mtree->set.me_last = me; - mtree->set.me_last = &me->next; return (0); } +static void +attr_counter_set_free(struct mtree_writer *mtree) +{ + struct att_counter_set *acs = &mtree->acs; + + attr_counter_free(&acs->uid_list); + attr_counter_free(&acs->gid_list); + attr_counter_free(&acs->mode_list); + attr_counter_free(&acs->flags_list); +} + static int -get_keys(struct mtree_writer *mtree, struct mtree_entry *me) +get_global_set_keys(struct mtree_writer *mtree, struct mtree_entry *me) { int keys; @@ -788,56 +781,92 @@ get_keys(struct mtree_writer *mtree, struct mtree_entry *me) return (keys); } -static struct mtree_entry * -new_mtree_entry(struct archive_entry *entry) +static int +mtree_entry_new(struct archive_write *a, struct archive_entry *entry, + struct mtree_entry **m_entry) { struct mtree_entry *me; const char *s; + int r; + static const struct archive_rb_tree_ops rb_ops = { + mtree_entry_cmp_node, mtree_entry_cmp_key + }; me = calloc(1, sizeof(*me)); - if (me == NULL) - return (NULL); - me->pathname = strdup(archive_entry_pathname(entry)); + if (me == NULL) { + archive_set_error(&a->archive, ENOMEM, + "Can't allocate memory for a mtree entry"); + *m_entry = NULL; + return (ARCHIVE_FATAL); + } + + r = mtree_entry_setup_filenames(a, me, entry); + if (r < ARCHIVE_WARN) { + mtree_entry_free(me); + *m_entry = NULL; + return (r); + } + if ((s = archive_entry_symlink(entry)) != NULL) - me->symlink = strdup(s); - else - me->symlink = NULL; + archive_strcpy(&me->symlink, s); me->nlink = archive_entry_nlink(entry); me->filetype = archive_entry_filetype(entry); me->mode = archive_entry_mode(entry) & 07777; me->uid = archive_entry_uid(entry); me->gid = archive_entry_gid(entry); if ((s = archive_entry_uname(entry)) != NULL) - me->uname = strdup(s); - else - me->uname = NULL; + archive_strcpy(&me->uname, s); if ((s = archive_entry_gname(entry)) != NULL) - me->gname = strdup(s); - else - me->gname = NULL; + archive_strcpy(&me->gname, s); if ((s = archive_entry_fflags_text(entry)) != NULL) - me->fflags_text = strdup(s); - else - me->fflags_text = NULL; + archive_strcpy(&me->fflags_text, s); archive_entry_fflags(entry, &me->fflags_set, &me->fflags_clear); me->mtime = archive_entry_mtime(entry); me->mtime_nsec = archive_entry_mtime_nsec(entry); me->rdevmajor = archive_entry_rdevmajor(entry); me->rdevminor = archive_entry_rdevminor(entry); me->size = archive_entry_size(entry); - me->compute_sum = 0; + if (me->filetype == AE_IFDIR) { + me->dir_info = calloc(1, sizeof(*me->dir_info)); + if (me->dir_info == NULL) { + mtree_entry_free(me); + archive_set_error(&a->archive, ENOMEM, + "Can't allocate memory for a mtree entry"); + *m_entry = NULL; + return (ARCHIVE_FATAL); + } + __archive_rb_tree_init(&me->dir_info->rbtree, &rb_ops); + me->dir_info->children.first = NULL; + me->dir_info->children.last = &(me->dir_info->children.first); + me->dir_info->chnext = NULL; + } else if (me->filetype == AE_IFREG) { + me->reg_info = calloc(1, sizeof(*me->reg_info)); + if (me->reg_info == NULL) { + mtree_entry_free(me); + archive_set_error(&a->archive, ENOMEM, + "Can't allocate memory for a mtree entry"); + *m_entry = NULL; + return (ARCHIVE_FATAL); + } + me->reg_info->compute_sum = 0; + } - return (me); + *m_entry = me; + return (ARCHIVE_OK); } static void -free_mtree_entry(struct mtree_entry *me) +mtree_entry_free(struct mtree_entry *me) { - free(me->pathname); - free(me->symlink); - free(me->uname); - free(me->gname); - free(me->fflags_text); + archive_string_free(&me->parentdir); + archive_string_free(&me->basename); + archive_string_free(&me->pathname); + archive_string_free(&me->symlink); + archive_string_free(&me->uname); + archive_string_free(&me->gname); + archive_string_free(&me->fflags_text); + free(me->dir_info); + free(me->reg_info); free(me); } @@ -846,66 +875,100 @@ archive_write_mtree_header(struct archive_write *a, struct archive_entry *entry) { struct mtree_writer *mtree= a->format_data; + struct mtree_entry *mtree_entry; + int r, r2; if (mtree->first) { mtree->first = 0; archive_strcat(&mtree->buf, "#mtree\n"); if ((mtree->keys & SET_KEYS) == 0) - mtree->set.output = 0;/* Disalbed. */ + mtree->output_global_set = 0;/* Disalbed. */ } mtree->entry_bytes_remaining = archive_entry_size(entry); + + /* While directory only mode, we do not handle non directory files. */ if (mtree->dironly && archive_entry_filetype(entry) != AE_IFDIR) return (ARCHIVE_OK); - mtree->mtree_entry = new_mtree_entry(entry); - if (mtree->mtree_entry == NULL) { - archive_set_error(&a->archive, ENOMEM, - "Can't allocate mtree entry"); - return (ARCHIVE_FATAL); + r2 = mtree_entry_new(a, entry, &mtree_entry); + if (r2 < ARCHIVE_WARN) + return (r2); + r = mtree_entry_tree_add(a, &mtree_entry); + if (r < ARCHIVE_WARN) { + mtree_entry_free(mtree_entry); + return (r); } + mtree->mtree_entry = mtree_entry; - mtree->compute_sum = 0; + /* If the current file is a regular file, we have to + * compute the sum of its content. + * Initialize a bunch of sum check context. */ + if (mtree_entry->reg_info) + sum_init(mtree); - /* If current file is not a regular file, we do not have to - * compute the sum of its content. */ - if (archive_entry_filetype(entry) != AE_IFREG) - return (ARCHIVE_OK); - - /* Initialize a bunch of sum check context. */ - sum_init(mtree); - - return (ARCHIVE_OK); + return (r2); } static int -write_entry(struct archive_write *a, struct mtree_entry *me) +write_mtree_entry(struct archive_write *a, struct mtree_entry *me) { struct mtree_writer *mtree = a->format_data; struct archive_string *str; int keys, ret; + if (me->dir_info) { + if (mtree->classic) { + /* + * Output a comment line to describe the full + * pathname of the entry as mtree utility does + * while generating classic format. + */ + if (!mtree->dironly) + archive_strappend_char(&mtree->buf, '\n'); + if (me->parentdir.s) + archive_string_sprintf(&mtree->buf, + "# %s/%s\n", + me->parentdir.s, me->basename.s); + else + archive_string_sprintf(&mtree->buf, + "# %s\n", + me->basename.s); + } + if (mtree->output_global_set) + write_global(mtree); + } archive_string_empty(&mtree->ebuf); - str = (mtree->indent)? &mtree->ebuf : &mtree->buf; - mtree_quote(str, me->pathname); - keys = get_keys(mtree, me); + str = (mtree->indent || mtree->classic)? &mtree->ebuf : &mtree->buf; + + if (!mtree->classic && me->parentdir.s) { + /* + * If generating format is not classic one(v1), output + * a full pathname. + */ + mtree_quote(str, me->parentdir.s); + archive_strappend_char(str, '/'); + } + mtree_quote(str, me->basename.s); + + keys = get_global_set_keys(mtree, me); if ((keys & F_NLINK) != 0 && me->nlink != 1 && me->filetype != AE_IFDIR) archive_string_sprintf(str, " nlink=%u", me->nlink); - if ((keys & F_GNAME) != 0 && me->gname != NULL) { + if ((keys & F_GNAME) != 0 && archive_strlen(&me->gname) > 0) { archive_strcat(str, " gname="); - mtree_quote(str, me->gname); + mtree_quote(str, me->gname.s); } - if ((keys & F_UNAME) != 0 && me->uname != NULL) { + if ((keys & F_UNAME) != 0 && archive_strlen(&me->uname) > 0) { archive_strcat(str, " uname="); - mtree_quote(str, me->uname); + mtree_quote(str, me->uname.s); } if ((keys & F_FLAGS) != 0) { - if (me->fflags_text != NULL) { + if (archive_strlen(&me->fflags_text) > 0) { archive_strcat(str, " flags="); - mtree_quote(str, me->fflags_text); - } else if (mtree->set.processed && + mtree_quote(str, me->fflags_text.s); + } else if (mtree->set.processing && (mtree->set.keys & F_FLAGS) != 0) /* Overwrite the global parameter. */ archive_strcat(str, " flags=none"); @@ -926,7 +989,7 @@ write_entry(struct archive_write *a, struct mtree_entry *me) archive_strcat(str, " type=link"); if ((keys & F_SLINK) != 0) { archive_strcat(str, " link="); - mtree_quote(str, me->symlink); + mtree_quote(str, me->symlink.s); } break; case AE_IFSOCK: @@ -972,15 +1035,48 @@ write_entry(struct archive_write *a, struct mtree_entry *me) } /* Write a bunch of sum. */ - if (me->filetype == AE_IFREG) - sum_write(str, me); + if (me->reg_info) + sum_write(str, me->reg_info); - archive_strcat(str, "\n"); - if (mtree->indent) + archive_strappend_char(str, '\n'); + if (mtree->indent || mtree->classic) mtree_indent(mtree); if (mtree->buf.length > 32768) { - ret = __archive_write_output(a, mtree->buf.s, mtree->buf.length); + ret = __archive_write_output( + a, mtree->buf.s, mtree->buf.length); + archive_string_empty(&mtree->buf); + } else + ret = ARCHIVE_OK; + return (ret); +} + +static int +write_dot_dot_entry(struct archive_write *a, struct mtree_entry *n) +{ + struct mtree_writer *mtree = a->format_data; + int ret; + + if (n->parentdir.s) { + if (mtree->indent) { + int i, pd = mtree->depth * 4; + for (i = 0; i < pd; i++) + archive_strappend_char(&mtree->buf, ' '); + } + archive_string_sprintf(&mtree->buf, "# %s/%s\n", + n->parentdir.s, n->basename.s); + } + + if (mtree->indent) { + archive_string_empty(&mtree->ebuf); + archive_strncat(&mtree->ebuf, "..\n\n", (mtree->dironly)?3:4); + mtree_indent(mtree); + } else + archive_strncat(&mtree->buf, "..\n\n", (mtree->dironly)?3:4); + + if (mtree->buf.length > 32768) { + ret = __archive_write_output( + a, mtree->buf.s, mtree->buf.length); archive_string_empty(&mtree->buf); } else ret = ARCHIVE_OK; @@ -988,29 +1084,106 @@ write_entry(struct archive_write *a, struct mtree_entry *me) } /* - * Write mtree entries saved at collect_set_values() function. + * Write mtree entries saved at attr_counter_set_collect() function. */ static int -write_mtree_entries(struct archive_write *a) +write_mtree_entry_tree(struct archive_write *a) { struct mtree_writer *mtree = a->format_data; - struct mtree_entry *me, *tme; + struct mtree_entry *np = mtree->root; + struct archive_rb_node *n; int ret; - for (me = mtree->set.me_first; me; me = me->next) { - ret = write_entry(a, me); - if (ret != ARCHIVE_OK) - return (ARCHIVE_FATAL); - } + do { + if (mtree->output_global_set) { + /* + * Collect attribute infomation to know which value + * is frequently used among the children. + */ + attr_counter_set_reset(mtree); + ARCHIVE_RB_TREE_FOREACH(n, &(np->dir_info->rbtree)) { + struct mtree_entry *e = (struct mtree_entry *)n; + if (attr_counter_set_collect(mtree, e) < 0) { + archive_set_error(&a->archive, ENOMEM, + "Can't allocate memory"); + return (ARCHIVE_FATAL); + } + } + } + if (!np->dir_info->virtual || mtree->classic) { + ret = write_mtree_entry(a, np); + if (ret != ARCHIVE_OK) + return (ARCHIVE_FATAL); + } else { + /* Whenever output_global_set is enabled + * output global value(/set keywords) + * even if the directory entry is not allowd + * to be written because the global values + * can be used for the children. */ + if (mtree->output_global_set) + write_global(mtree); + } + /* + * Output the attribute of all files except directory files. + */ + mtree->depth++; + ARCHIVE_RB_TREE_FOREACH(n, &(np->dir_info->rbtree)) { + struct mtree_entry *e = (struct mtree_entry *)n; + + if (e->dir_info) + mtree_entry_add_child_tail(np, e); + else { + ret = write_mtree_entry(a, e); + if (ret != ARCHIVE_OK) + return (ARCHIVE_FATAL); + } + } + mtree->depth--; + + if (np->dir_info->children.first != NULL) { + /* + * Descend the tree. + */ + np = np->dir_info->children.first; + if (mtree->indent) + mtree->depth++; + continue; + } else if (mtree->classic) { + /* + * While printing mtree classic, if there are not + * any directory files(except "." and "..") in the + * directory, output two dots ".." as returning + * the parent directory. + */ + ret = write_dot_dot_entry(a, np); + if (ret != ARCHIVE_OK) + return (ARCHIVE_FATAL); + } + + while (np != np->parent) { + if (np->dir_info->chnext == NULL) { + /* + * Ascend the tree; go back to the parent. + */ + if (mtree->indent) + mtree->depth--; + if (mtree->classic) { + ret = write_dot_dot_entry(a, + np->parent); + if (ret != ARCHIVE_OK) + return (ARCHIVE_FATAL); + } + np = np->parent; + } else { + /* + * Switch to next mtree entry in the directory. + */ + np = np->dir_info->chnext; + break; + } + } + } while (np != np->parent); - me = mtree->set.me_first; - while (me != NULL) { - tme = me->next; - free_mtree_entry(me); - me = tme; - } - mtree->set.me_first = NULL; - mtree->set.me_last = &mtree->set.me_first; return (ARCHIVE_OK); } @@ -1019,40 +1192,15 @@ archive_write_mtree_finish_entry(struct archive_write *a) { struct mtree_writer *mtree = a->format_data; struct mtree_entry *me; - int ret; if ((me = mtree->mtree_entry) == NULL) return (ARCHIVE_OK); mtree->mtree_entry = NULL; - if (me->filetype == AE_IFREG) - sum_final(mtree, me); + if (me->reg_info) + sum_final(mtree, me->reg_info); - if (mtree->set.output) { - if (!mtree->dironly) { - if (archive_strlen(&mtree->set.parent) == 0) - parent_dir_changed(&mtree->set.parent, me); - if (parent_dir_changed(&mtree->set.parent, me)) { - /* Write /set keyword */ - write_global(mtree); - /* Write entries saved by - * collect_set_values() function. */ - ret = write_mtree_entries(a); - if (ret != ARCHIVE_OK) - return (ARCHIVE_FATAL); - } - } - /* Tabulate uid,gid,mode and fflags of a entry - * in order to be used for /set. and, at this time - * we do not write a entry. */ - collect_set_values(mtree, me); - return (ARCHIVE_OK); - } else { - /* Write the current entry and free it. */ - ret = write_entry(a, me); - free_mtree_entry(me); - } - return (ret == ARCHIVE_OK ? ret : ARCHIVE_FATAL); + return (ARCHIVE_OK); } static int @@ -1061,9 +1209,8 @@ archive_write_mtree_close(struct archive_write *a) struct mtree_writer *mtree= a->format_data; int ret; - if (mtree->set.output && mtree->set.me_first != NULL) { - write_global(mtree); - ret = write_mtree_entries(a); + if (mtree->root != NULL) { + ret = write_mtree_entry_tree(a); if (ret != ARCHIVE_OK) return (ARCHIVE_FATAL); } @@ -1096,25 +1243,16 @@ static int archive_write_mtree_free(struct archive_write *a) { struct mtree_writer *mtree= a->format_data; - struct mtree_entry *me, *tme; if (mtree == NULL) return (ARCHIVE_OK); /* Make sure we dot not leave any entries. */ - me = mtree->set.me_first; - while (me != NULL) { - tme = me->next; - free_mtree_entry(me); - me = tme; - } + mtree_entry_register_free(mtree); + archive_string_free(&mtree->cur_dirstr); archive_string_free(&mtree->ebuf); archive_string_free(&mtree->buf); - archive_string_free(&mtree->set.parent); - free_attr_count(&mtree->set.uid_list); - free_attr_count(&mtree->set.gid_list); - free_attr_count(&mtree->set.mode_list); - free_attr_count(&mtree->set.flags_list); + attr_counter_set_free(mtree); free(mtree); a->format_data = NULL; return (ARCHIVE_OK); @@ -1209,7 +1347,7 @@ archive_write_mtree_options(struct archive_write *a, const char *key, else if (strcmp(key, "uname") == 0) keybit = F_UNAME; else if (strcmp(key, "use-set") == 0) { - mtree->set.output = (value != NULL)? 1: 0; + mtree->output_global_set = (value != NULL)? 1: 0; return (ARCHIVE_OK); } break; @@ -1228,14 +1366,13 @@ archive_write_mtree_options(struct archive_write *a, const char *key, return (ARCHIVE_WARN); } -int -archive_write_set_format_mtree(struct archive *_a) +static int +archive_write_set_format_mtree_default(struct archive *_a, const char *fn) { struct archive_write *a = (struct archive_write *)_a; struct mtree_writer *mtree; - archive_check_magic(_a, ARCHIVE_WRITE_MAGIC, - ARCHIVE_STATE_NEW, "archive_write_set_format_mtree"); + archive_check_magic(_a, ARCHIVE_WRITE_MAGIC, ARCHIVE_STATE_NEW, fn); if (a->format_free != NULL) (a->format_free)(a); @@ -1249,14 +1386,12 @@ archive_write_set_format_mtree(struct archive *_a) mtree->mtree_entry = NULL; mtree->first = 1; memset(&(mtree->set), 0, sizeof(mtree->set)); - archive_string_init(&mtree->set.parent); mtree->keys = DEFAULT_KEYS; mtree->dironly = 0; mtree->indent = 0; archive_string_init(&mtree->ebuf); archive_string_init(&mtree->buf); - mtree->set.me_first = NULL; - mtree->set.me_last = &mtree->set.me_first; + mtree_entry_register_init(mtree); a->format_data = mtree; a->format_free = archive_write_mtree_free; a->format_name = "mtree"; @@ -1271,9 +1406,41 @@ archive_write_set_format_mtree(struct archive *_a) return (ARCHIVE_OK); } +int +archive_write_set_format_mtree(struct archive *_a) +{ + return archive_write_set_format_mtree_default(_a, + "archive_write_set_format_mtree"); +} + +int +archive_write_set_format_mtree_classic(struct archive *_a) +{ + int r; + + r = archive_write_set_format_mtree_default(_a, + "archive_write_set_format_mtree_classic"); + if (r == ARCHIVE_OK) { + struct archive_write *a = (struct archive_write *)_a; + struct mtree_writer *mtree; + + mtree = (struct mtree_writer *)a->format_data; + + /* Set to output a mtree archive in classic format. */ + mtree->classic = 1; + /* Basically, mtree classic format uses '/set' global + * value. */ + mtree->output_global_set = 1; + } + return (r); +} + static void sum_init(struct mtree_writer *mtree) { + + mtree->compute_sum = 0; + if (mtree->keys & F_CKSUM) { mtree->compute_sum |= F_CKSUM; mtree->crc = 0; @@ -1370,7 +1537,7 @@ sum_update(struct mtree_writer *mtree, const void *buff, size_t n) } static void -sum_final(struct mtree_writer *mtree, struct mtree_entry *me) +sum_final(struct mtree_writer *mtree, struct reg_info *reg) { if (mtree->compute_sum & F_CKSUM) { @@ -1378,34 +1545,34 @@ sum_final(struct mtree_writer *mtree, struct mtree_entry *me) /* Include the length of the file. */ for (len = mtree->crc_len; len != 0; len >>= 8) COMPUTE_CRC(mtree->crc, len & 0xff); - me->crc = ~mtree->crc; + reg->crc = ~mtree->crc; } #ifdef ARCHIVE_HAS_MD5 if (mtree->compute_sum & F_MD5) - archive_md5_final(&mtree->md5ctx, me->buf_md5); + archive_md5_final(&mtree->md5ctx, reg->buf_md5); #endif #ifdef ARCHIVE_HAS_RMD160 if (mtree->compute_sum & F_RMD160) - archive_rmd160_final(&mtree->rmd160ctx, me->buf_rmd160); + archive_rmd160_final(&mtree->rmd160ctx, reg->buf_rmd160); #endif #ifdef ARCHIVE_HAS_SHA1 if (mtree->compute_sum & F_SHA1) - archive_sha1_final(&mtree->sha1ctx, me->buf_sha1); + archive_sha1_final(&mtree->sha1ctx, reg->buf_sha1); #endif #ifdef ARCHIVE_HAS_SHA256 if (mtree->compute_sum & F_SHA256) - archive_sha256_final(&mtree->sha256ctx, me->buf_sha256); + archive_sha256_final(&mtree->sha256ctx, reg->buf_sha256); #endif #ifdef ARCHIVE_HAS_SHA384 if (mtree->compute_sum & F_SHA384) - archive_sha384_final(&mtree->sha384ctx, me->buf_sha384); + archive_sha384_final(&mtree->sha384ctx, reg->buf_sha384); #endif #ifdef ARCHIVE_HAS_SHA512 if (mtree->compute_sum & F_SHA512) - archive_sha512_final(&mtree->sha512ctx, me->buf_sha512); + archive_sha512_final(&mtree->sha512ctx, reg->buf_sha512); #endif /* Save what types of sum are computed. */ - me->compute_sum = mtree->compute_sum; + reg->compute_sum = mtree->compute_sum; } #if defined(ARCHIVE_HAS_MD5) || defined(ARCHIVE_HAS_RMD160) || \ @@ -1425,47 +1592,612 @@ strappend_bin(struct archive_string *s, const unsigned char *bin, int n) #endif static void -sum_write(struct archive_string *str, struct mtree_entry *me) +sum_write(struct archive_string *str, struct reg_info *reg) { - if (me->compute_sum & F_CKSUM) { + if (reg->compute_sum & F_CKSUM) { archive_string_sprintf(str, " cksum=%ju", - (uintmax_t)me->crc); + (uintmax_t)reg->crc); } #ifdef ARCHIVE_HAS_MD5 - if (me->compute_sum & F_MD5) { + if (reg->compute_sum & F_MD5) { archive_strcat(str, " md5digest="); - strappend_bin(str, me->buf_md5, sizeof(me->buf_md5)); + strappend_bin(str, reg->buf_md5, sizeof(reg->buf_md5)); } #endif #ifdef ARCHIVE_HAS_RMD160 - if (me->compute_sum & F_RMD160) { + if (reg->compute_sum & F_RMD160) { archive_strcat(str, " rmd160digest="); - strappend_bin(str, me->buf_rmd160, sizeof(me->buf_rmd160)); + strappend_bin(str, reg->buf_rmd160, sizeof(reg->buf_rmd160)); } #endif #ifdef ARCHIVE_HAS_SHA1 - if (me->compute_sum & F_SHA1) { + if (reg->compute_sum & F_SHA1) { archive_strcat(str, " sha1digest="); - strappend_bin(str, me->buf_sha1, sizeof(me->buf_sha1)); + strappend_bin(str, reg->buf_sha1, sizeof(reg->buf_sha1)); } #endif #ifdef ARCHIVE_HAS_SHA256 - if (me->compute_sum & F_SHA256) { + if (reg->compute_sum & F_SHA256) { archive_strcat(str, " sha256digest="); - strappend_bin(str, me->buf_sha256, sizeof(me->buf_sha256)); + strappend_bin(str, reg->buf_sha256, sizeof(reg->buf_sha256)); } #endif #ifdef ARCHIVE_HAS_SHA384 - if (me->compute_sum & F_SHA384) { + if (reg->compute_sum & F_SHA384) { archive_strcat(str, " sha384digest="); - strappend_bin(str, me->buf_sha384, sizeof(me->buf_sha384)); + strappend_bin(str, reg->buf_sha384, sizeof(reg->buf_sha384)); } #endif #ifdef ARCHIVE_HAS_SHA512 - if (me->compute_sum & F_SHA512) { + if (reg->compute_sum & F_SHA512) { archive_strcat(str, " sha512digest="); - strappend_bin(str, me->buf_sha512, sizeof(me->buf_sha512)); + strappend_bin(str, reg->buf_sha512, sizeof(reg->buf_sha512)); } #endif } + +static int +mtree_entry_cmp_node(const struct archive_rb_node *n1, + const struct archive_rb_node *n2) +{ + const struct mtree_entry *e1 = (const struct mtree_entry *)n1; + const struct mtree_entry *e2 = (const struct mtree_entry *)n2; + + return (strcmp(e2->basename.s, e1->basename.s)); +} + +static int +mtree_entry_cmp_key(const struct archive_rb_node *n, const void *key) +{ + const struct mtree_entry *e = (const struct mtree_entry *)n; + + return (strcmp((const char *)key, e->basename.s)); +} + +#if defined(_WIN32) || defined(__CYGWIN__) +static int +cleanup_backslash_1(char *p) +{ + int mb, dos; + + mb = dos = 0; + while (*p) { + if (*(unsigned char *)p > 127) + mb = 1; + if (*p == '\\') { + /* If we have not met any multi-byte characters, + * we can replace '\' with '/'. */ + if (!mb) + *p = '/'; + dos = 1; + } + p++; + } + if (!mb || !dos) + return (0); + return (-1); +} + +static void +cleanup_backslash_2(wchar_t *p) +{ + + /* Convert a path-separator from '\' to '/' */ + while (*p != L'\0') { + if (*p == L'\\') + *p = L'/'; + p++; + } +} +#endif + +/* + * Generate a parent directory name and a base name from a pathname. + */ +static int +mtree_entry_setup_filenames(struct archive_write *a, struct mtree_entry *file, + struct archive_entry *entry) +{ + const char *pathname; + char *p, *dirname, *slash; + size_t len; + int ret = ARCHIVE_OK; + + archive_strcpy(&file->pathname, archive_entry_pathname(entry)); +#if defined(_WIN32) || defined(__CYGWIN__) + /* + * Convert a path-separator from '\' to '/' + */ + if (cleanup_backslash_1(file->pathname.s) != 0) { + const wchar_t *wp = archive_entry_pathname_w(entry); + struct archive_wstring ws; + + if (wp != NULL) { + int r; + archive_string_init(&ws); + archive_wstrcpy(&ws, wp); + cleanup_backslash_2(ws.s); + archive_string_empty(&(file->pathname)); + r = archive_string_append_from_wcs(&(file->pathname), + ws.s, ws.length); + archive_wstring_free(&ws); + if (r < 0 && errno == ENOMEM) { + archive_set_error(&a->archive, ENOMEM, + "Can't allocate memory"); + return (ARCHIVE_FATAL); + } + } + } +#else + (void)a; /* UNUSED */ +#endif + pathname = file->pathname.s; + if (strcmp(pathname, ".") == 0) { + archive_strcpy(&file->basename, "."); + return (ARCHIVE_OK); + } + + archive_strcpy(&(file->parentdir), pathname); + + len = file->parentdir.length; + p = dirname = file->parentdir.s; + + /* + * Remove leading '/' and '../' elements + */ + while (*p) { + if (p[0] == '/') { + p++; + len--; + } else if (p[0] != '.') + break; + else if (p[1] == '.' && p[2] == '/') { + p += 3; + len -= 3; + } else + break; + } + if (p != dirname) { + memmove(dirname, p, len+1); + p = dirname; + } + /* + * Remove "/","/." and "/.." elements from tail. + */ + while (len > 0) { + size_t ll = len; + + if (len > 0 && p[len-1] == '/') { + p[len-1] = '\0'; + len--; + } + if (len > 1 && p[len-2] == '/' && p[len-1] == '.') { + p[len-2] = '\0'; + len -= 2; + } + if (len > 2 && p[len-3] == '/' && p[len-2] == '.' && + p[len-1] == '.') { + p[len-3] = '\0'; + len -= 3; + } + if (ll == len) + break; + } + while (*p) { + if (p[0] == '/') { + if (p[1] == '/') + /* Convert '//' --> '/' */ + strcpy(p, p+1); + else if (p[1] == '.' && p[2] == '/') + /* Convert '/./' --> '/' */ + strcpy(p, p+2); + else if (p[1] == '.' && p[2] == '.' && p[3] == '/') { + /* Convert 'dir/dir1/../dir2/' + * --> 'dir/dir2/' + */ + char *rp = p -1; + while (rp >= dirname) { + if (*rp == '/') + break; + --rp; + } + if (rp > dirname) { + strcpy(rp, p+3); + p = rp; + } else { + strcpy(dirname, p+4); + p = dirname; + } + } else + p++; + } else + p++; + } + p = dirname; + len = strlen(p); + + /* + * Add "./" prefiex. + * NOTE: If the pathname does not have a path separator, we have + * to add "./" to the head of the pathename because mtree reader + * will suppose that it is v1(a.k.a classic) mtree format and + * change the directory unexpectedly and so it will make a wrong + * path. + */ + if (strcmp(p, ".") != 0 && strncmp(p, "./", 2) != 0) { + struct archive_string as; + archive_string_init(&as); + archive_strcpy(&as, "./"); + archive_strncat(&as, p, len); + archive_string_empty(&file->parentdir); + archive_string_concat(&file->parentdir, &as); + archive_string_free(&as); + p = file->parentdir.s; + len = archive_strlen(&file->parentdir); + } + + /* + * Find out the position which points the last position of + * path separator('/'). + */ + slash = NULL; + for (; *p != '\0'; p++) { + if (*p == '/') + slash = p; + } + if (slash == NULL) { + /* The pathname doesn't have a parent directory. */ + file->parentdir.length = len; + archive_string_copy(&(file->basename), &(file->parentdir)); + archive_string_empty(&(file->parentdir)); + *file->parentdir.s = '\0'; + return (ret); + } + + /* Make a basename from dirname and slash */ + *slash = '\0'; + file->parentdir.length = slash - dirname; + archive_strcpy(&(file->basename), slash + 1); + return (ret); +} + +static int +mtree_entry_create_virtual_dir(struct archive_write *a, const char *pathname, + struct mtree_entry **m_entry) +{ + struct archive_entry *entry; + struct mtree_entry *file; + int r; + + entry = archive_entry_new(); + if (entry == NULL) { + *m_entry = NULL; + archive_set_error(&a->archive, ENOMEM, + "Can't allocate memory"); + return (ARCHIVE_FATAL); + } + archive_entry_copy_pathname(entry, pathname); + archive_entry_set_mode(entry, AE_IFDIR | 0755); + archive_entry_set_mtime(entry, time(NULL), 0); + + r = mtree_entry_new(a, entry, &file); + archive_entry_free(entry); + if (r < ARCHIVE_WARN) { + *m_entry = NULL; + archive_set_error(&a->archive, ENOMEM, + "Can't allocate memory"); + return (ARCHIVE_FATAL); + } + + file->dir_info->virtual = 1; + + *m_entry = file; + return (ARCHIVE_OK); +} + +static void +mtree_entry_register_add(struct mtree_writer *mtree, struct mtree_entry *file) +{ + file->next = NULL; + *mtree->file_list.last = file; + mtree->file_list.last = &(file->next); +} + +static void +mtree_entry_register_init(struct mtree_writer *mtree) +{ + mtree->file_list.first = NULL; + mtree->file_list.last = &(mtree->file_list.first); +} + +static void +mtree_entry_register_free(struct mtree_writer *mtree) +{ + struct mtree_entry *file, *file_next; + + file = mtree->file_list.first; + while (file != NULL) { + file_next = file->next; + mtree_entry_free(file); + file = file_next; + } +} + +static int +mtree_entry_add_child_tail(struct mtree_entry *parent, + struct mtree_entry *child) +{ + child->dir_info->chnext = NULL; + *parent->dir_info->children.last = child; + parent->dir_info->children.last = &(child->dir_info->chnext); + return (1); +} + +/* + * Find a entry from a parent entry with the name. + */ +static struct mtree_entry * +mtree_entry_find_child(struct mtree_entry *parent, const char *child_name) +{ + struct mtree_entry *np; + + if (parent == NULL) + return (NULL); + np = (struct mtree_entry *)__archive_rb_tree_find_node( + &(parent->dir_info->rbtree), child_name); + return (np); +} + +static int +get_path_component(char *name, size_t n, const char *fn) +{ + char *p; + size_t l; + + p = strchr(fn, '/'); + if (p == NULL) { + if ((l = strlen(fn)) == 0) + return (0); + } else + l = p - fn; + if (l > n -1) + return (-1); + memcpy(name, fn, l); + name[l] = '\0'; + + return ((int)l); +} + +/* + * Add a new entry into the tree. + */ +static int +mtree_entry_tree_add(struct archive_write *a, struct mtree_entry **filep) +{ +#if defined(_WIN32) && !defined(__CYGWIN__) + char name[_MAX_FNAME];/* Included null terminator size. */ +#elif defined(NAME_MAX) && NAME_MAX >= 255 + char name[NAME_MAX+1]; +#else + char name[256]; +#endif + struct mtree_writer *mtree = (struct mtree_writer *)a->format_data; + struct mtree_entry *dent, *file, *np; + const char *fn, *p; + int l, r; + + file = *filep; + if (file->parentdir.length == 0 && file->basename.length == 1 && + file->basename.s[0] == '.') { + file->parent = file; + if (mtree->root != NULL) { + np = mtree->root; + goto same_entry; + } + mtree->root = file; + mtree_entry_register_add(mtree, file); + return (ARCHIVE_OK); + } + + if (file->parentdir.length == 0) { + archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, + "Internal programing error " + "in generating canonical name for %s", + file->pathname.s); + return (ARCHIVE_FAILED); + } + + fn = p = file->parentdir.s; + + /* + * If the path of the parent directory of `file' entry is + * the same as the path of `cur_dirent', add `file' entry to + * `cur_dirent'. + */ + if (archive_strlen(&(mtree->cur_dirstr)) + == archive_strlen(&(file->parentdir)) && + strcmp(mtree->cur_dirstr.s, fn) == 0) { + if (!__archive_rb_tree_insert_node( + &(mtree->cur_dirent->dir_info->rbtree), + (struct archive_rb_node *)file)) { + /* There is the same name in the tree. */ + np = (struct mtree_entry *)__archive_rb_tree_find_node( + &(mtree->cur_dirent->dir_info->rbtree), + file->basename.s); + goto same_entry; + } + file->parent = mtree->cur_dirent; + mtree_entry_register_add(mtree, file); + return (ARCHIVE_OK); + } + + dent = mtree->root; + for (;;) { + l = get_path_component(name, sizeof(name), fn); + if (l == 0) { + np = NULL; + break; + } + if (l < 0) { + archive_set_error(&a->archive, + ARCHIVE_ERRNO_MISC, + "A name buffer is too small"); + return (ARCHIVE_FATAL); + } + if (l == 1 && name[0] == '.' && dent != NULL && + dent == mtree->root) { + fn += l; + if (fn[0] == '/') + fn++; + continue; + } + + np = mtree_entry_find_child(dent, name); + if (np == NULL || fn[0] == '\0') + break; + + /* Find next sub directory. */ + if (!np->dir_info) { + /* NOT Directory! */ + archive_set_error(&a->archive, + ARCHIVE_ERRNO_MISC, + "`%s' is not directory, we cannot insert `%s' ", + np->pathname.s, file->pathname.s); + return (ARCHIVE_FAILED); + } + fn += l; + if (fn[0] == '/') + fn++; + dent = np; + } + if (np == NULL) { + /* + * Create virtual parent directories. + */ + while (fn[0] != '\0') { + struct mtree_entry *vp; + struct archive_string as; + + archive_string_init(&as); + archive_strncat(&as, p, fn - p + l); + if (as.s[as.length-1] == '/') { + as.s[as.length-1] = '\0'; + as.length--; + } + r = mtree_entry_create_virtual_dir(a, as.s, &vp); + archive_string_free(&as); + if (r < ARCHIVE_WARN) + return (r); + + if (strcmp(vp->pathname.s, ".") == 0) { + vp->parent = vp; + mtree->root = vp; + } else { + __archive_rb_tree_insert_node( + &(dent->dir_info->rbtree), + (struct archive_rb_node *)vp); + vp->parent = dent; + } + mtree_entry_register_add(mtree, vp); + np = vp; + + fn += l; + if (fn[0] == '/') + fn++; + l = get_path_component(name, sizeof(name), fn); + if (l < 0) { + archive_string_free(&as); + archive_set_error(&a->archive, + ARCHIVE_ERRNO_MISC, + "A name buffer is too small"); + return (ARCHIVE_FATAL); + } + dent = np; + } + + /* Found out the parent directory where `file' can be + * inserted. */ + mtree->cur_dirent = dent; + archive_string_empty(&(mtree->cur_dirstr)); + archive_string_ensure(&(mtree->cur_dirstr), + archive_strlen(&(dent->parentdir)) + + archive_strlen(&(dent->basename)) + 2); + if (archive_strlen(&(dent->parentdir)) + + archive_strlen(&(dent->basename)) == 0) + mtree->cur_dirstr.s[0] = 0; + else { + if (archive_strlen(&(dent->parentdir)) > 0) { + archive_string_copy(&(mtree->cur_dirstr), + &(dent->parentdir)); + archive_strappend_char( + &(mtree->cur_dirstr), '/'); + } + archive_string_concat(&(mtree->cur_dirstr), + &(dent->basename)); + } + + if (!__archive_rb_tree_insert_node( + &(dent->dir_info->rbtree), + (struct archive_rb_node *)file)) { + np = (struct mtree_entry *)__archive_rb_tree_find_node( + &(dent->dir_info->rbtree), file->basename.s); + goto same_entry; + } + file->parent = dent; + mtree_entry_register_add(mtree, file); + return (ARCHIVE_OK); + } + +same_entry: + /* + * We have already has the entry the filename of which is + * the same. + */ + r = mtree_entry_exchange_same_entry(a, np, file); + if (r < ARCHIVE_WARN) + return (r); + if (np->dir_info) + np->dir_info->virtual = 0; + *filep = np; + mtree_entry_free(file); + return (ARCHIVE_WARN); +} + +static int +mtree_entry_exchange_same_entry(struct archive_write *a, struct mtree_entry *np, + struct mtree_entry *file) +{ + + if ((np->mode & AE_IFMT) != (file->mode & AE_IFMT)) { + archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, + "Found duplicate entries `%s' and its file type is " + "different", + np->pathname.s); + return (ARCHIVE_FAILED); + } + + /* Update the existent mtree entry's attributes by the new one's. */ + archive_string_empty(&np->symlink); + archive_string_concat(&np->symlink, &file->symlink); + archive_string_empty(&np->uname); + archive_string_concat(&np->uname, &file->uname); + archive_string_empty(&np->gname); + archive_string_concat(&np->gname, &file->gname); + archive_string_empty(&np->fflags_text); + archive_string_concat(&np->fflags_text, &file->fflags_text); + np->nlink = file->nlink; + np->filetype = file->filetype; + np->mode = file->mode; + np->size = file->size; + np->uid = file->uid; + np->gid = file->gid; + np->fflags_set = file->fflags_set; + np->fflags_clear = file->fflags_clear; + np->mtime = file->mtime; + np->mtime_nsec = file->mtime_nsec; + np->rdevmajor = file->rdevmajor; + np->rdevminor = file->rdevminor; + + return (ARCHIVE_WARN); +} diff --git a/libarchive/archive_write_set_format_pax.c b/libarchive/archive_write_set_format_pax.c index 3b0f4ae294da..687f8e48a9b7 100644 --- a/libarchive/archive_write_set_format_pax.c +++ b/libarchive/archive_write_set_format_pax.c @@ -647,8 +647,10 @@ archive_write_pax_header(struct archive_write *a, oname = archive_entry_pathname(entry_original); name_length = strlen(oname); name = malloc(name_length + 3); - if (name == NULL) { + if (name == NULL || extra == NULL) { /* XXX error message */ + archive_entry_free(extra); + free(name); return (ARCHIVE_FAILED); } strcpy(name, oname); @@ -687,11 +689,13 @@ archive_write_pax_header(struct archive_write *a, /* Recurse to write the special copyfile entry. */ r = archive_write_pax_header(a, extra); + archive_entry_free(extra); if (r < ARCHIVE_WARN) return (r); if (r < ret) ret = r; - r = archive_write_pax_data(a, mac_metadata, mac_metadata_size); + r = (int)archive_write_pax_data(a, mac_metadata, + mac_metadata_size); if (r < ARCHIVE_WARN) return (r); if (r < ret) @@ -1862,7 +1866,7 @@ _sparse_list_add_block(struct pax *pax, int64_t offset, int64_t length, sb->is_hole = is_hole; sb->offset = offset; sb->remaining = length; - if (pax->sparse_list == NULL) + if (pax->sparse_list == NULL || pax->sparse_tail == NULL) pax->sparse_list = pax->sparse_tail = sb; else { pax->sparse_tail->next = sb; diff --git a/libarchive/archive_write_set_format_v7tar.c b/libarchive/archive_write_set_format_v7tar.c new file mode 100644 index 000000000000..17efbaf753f8 --- /dev/null +++ b/libarchive/archive_write_set_format_v7tar.c @@ -0,0 +1,661 @@ +/*- + * Copyright (c) 2003-2007 Tim Kientzle + * Copyright (c) 2011-2012 Michihiro NAKAJIMA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "archive_platform.h" +__FBSDID("$FreeBSD$"); + + +#ifdef HAVE_ERRNO_H +#include +#endif +#include +#ifdef HAVE_STDLIB_H +#include +#endif +#ifdef HAVE_STRING_H +#include +#endif + +#include "archive.h" +#include "archive_entry.h" +#include "archive_entry_locale.h" +#include "archive_private.h" +#include "archive_write_private.h" + +struct v7tar { + uint64_t entry_bytes_remaining; + uint64_t entry_padding; + + struct archive_string_conv *opt_sconv; + struct archive_string_conv *sconv_default; + int init_default_conversion; +}; + +/* + * Define structure of POSIX 'v7tar' tar header. + */ +#define V7TAR_name_offset 0 +#define V7TAR_name_size 100 +#define V7TAR_mode_offset 100 +#define V7TAR_mode_size 6 +#define V7TAR_mode_max_size 8 +#define V7TAR_uid_offset 108 +#define V7TAR_uid_size 6 +#define V7TAR_uid_max_size 8 +#define V7TAR_gid_offset 116 +#define V7TAR_gid_size 6 +#define V7TAR_gid_max_size 8 +#define V7TAR_size_offset 124 +#define V7TAR_size_size 11 +#define V7TAR_size_max_size 12 +#define V7TAR_mtime_offset 136 +#define V7TAR_mtime_size 11 +#define V7TAR_mtime_max_size 12 +#define V7TAR_checksum_offset 148 +#define V7TAR_checksum_size 8 +#define V7TAR_typeflag_offset 156 +#define V7TAR_typeflag_size 1 +#define V7TAR_linkname_offset 157 +#define V7TAR_linkname_size 100 +#define V7TAR_padding_offset 257 +#define V7TAR_padding_size 255 + +/* + * A filled-in copy of the header for initialization. + */ +static const char template_header[] = { + /* name: 100 bytes */ + 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, + 0,0,0,0, + /* Mode, space-null termination: 8 bytes */ + '0','0','0','0','0','0', ' ','\0', + /* uid, space-null termination: 8 bytes */ + '0','0','0','0','0','0', ' ','\0', + /* gid, space-null termination: 8 bytes */ + '0','0','0','0','0','0', ' ','\0', + /* size, space termation: 12 bytes */ + '0','0','0','0','0','0','0','0','0','0','0', ' ', + /* mtime, space termation: 12 bytes */ + '0','0','0','0','0','0','0','0','0','0','0', ' ', + /* Initial checksum value: 8 spaces */ + ' ',' ',' ',' ',' ',' ',' ',' ', + /* Typeflag: 1 byte */ + 0, + /* Linkname: 100 bytes */ + 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, + 0,0,0,0, + /* Padding: 255 bytes */ + 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, + 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0 +}; + +static ssize_t archive_write_v7tar_data(struct archive_write *a, const void *buff, + size_t s); +static int archive_write_v7tar_free(struct archive_write *); +static int archive_write_v7tar_close(struct archive_write *); +static int archive_write_v7tar_finish_entry(struct archive_write *); +static int archive_write_v7tar_header(struct archive_write *, + struct archive_entry *entry); +static int archive_write_v7tar_options(struct archive_write *, + const char *, const char *); +static int format_256(int64_t, char *, int); +static int format_number(int64_t, char *, int size, int max, int strict); +static int format_octal(int64_t, char *, int); +static int format_header_v7tar(struct archive_write *, char h[512], + struct archive_entry *, int, struct archive_string_conv *); + +/* + * Set output format to 'v7tar' format. + */ +int +archive_write_set_format_v7tar(struct archive *_a) +{ + struct archive_write *a = (struct archive_write *)_a; + struct v7tar *v7tar; + + archive_check_magic(_a, ARCHIVE_WRITE_MAGIC, + ARCHIVE_STATE_NEW, "archive_write_set_format_v7tar"); + + /* If someone else was already registered, unregister them. */ + if (a->format_free != NULL) + (a->format_free)(a); + + /* Basic internal sanity test. */ + if (sizeof(template_header) != 512) { + archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, + "Internal: template_header wrong size: %zu should be 512", + sizeof(template_header)); + return (ARCHIVE_FATAL); + } + + v7tar = (struct v7tar *)malloc(sizeof(*v7tar)); + if (v7tar == NULL) { + archive_set_error(&a->archive, ENOMEM, + "Can't allocate v7tar data"); + return (ARCHIVE_FATAL); + } + memset(v7tar, 0, sizeof(*v7tar)); + a->format_data = v7tar; + a->format_name = "tar (non-POSIX)"; + a->format_options = archive_write_v7tar_options; + a->format_write_header = archive_write_v7tar_header; + a->format_write_data = archive_write_v7tar_data; + a->format_close = archive_write_v7tar_close; + a->format_free = archive_write_v7tar_free; + a->format_finish_entry = archive_write_v7tar_finish_entry; + a->archive.archive_format = ARCHIVE_FORMAT_TAR; + a->archive.archive_format_name = "tar (non-POSIX)"; + return (ARCHIVE_OK); +} + +static int +archive_write_v7tar_options(struct archive_write *a, const char *key, + const char *val) +{ + struct v7tar *v7tar = (struct v7tar *)a->format_data; + int ret = ARCHIVE_FAILED; + + if (strcmp(key, "hdrcharset") == 0) { + if (val == NULL || val[0] == 0) + archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, + "%s: hdrcharset option needs a character-set name", + a->format_name); + else { + v7tar->opt_sconv = archive_string_conversion_to_charset( + &a->archive, val, 0); + if (v7tar->opt_sconv != NULL) + ret = ARCHIVE_OK; + else + ret = ARCHIVE_FATAL; + } + return (ret); + } + + /* Note: The "warn" return is just to inform the options + * supervisor that we didn't handle it. It will generate + * a suitable error if no one used this option. */ + return (ARCHIVE_WARN); +} + +static int +archive_write_v7tar_header(struct archive_write *a, struct archive_entry *entry) +{ + char buff[512]; + int ret, ret2; + struct v7tar *v7tar; + struct archive_entry *entry_main; + struct archive_string_conv *sconv; + + v7tar = (struct v7tar *)a->format_data; + + /* Setup default string conversion. */ + if (v7tar->opt_sconv == NULL) { + if (!v7tar->init_default_conversion) { + v7tar->sconv_default = + archive_string_default_conversion_for_write( + &(a->archive)); + v7tar->init_default_conversion = 1; + } + sconv = v7tar->sconv_default; + } else + sconv = v7tar->opt_sconv; + + /* Sanity check. */ + if (archive_entry_pathname(entry) == NULL) { + archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, + "Can't record entry in tar file without pathname"); + return (ARCHIVE_FAILED); + } + + /* Only regular files (not hardlinks) have data. */ + if (archive_entry_hardlink(entry) != NULL || + archive_entry_symlink(entry) != NULL || + !(archive_entry_filetype(entry) == AE_IFREG)) + archive_entry_set_size(entry, 0); + + if (AE_IFDIR == archive_entry_filetype(entry)) { + const char *p; + size_t path_length; + /* + * Ensure a trailing '/'. Modify the entry so + * the client sees the change. + */ +#if defined(_WIN32) && !defined(__CYGWIN__) + const wchar_t *wp; + + wp = archive_entry_pathname_w(entry); + if (wp != NULL && wp[wcslen(wp) -1] != L'/') { + struct archive_wstring ws; + + archive_string_init(&ws); + path_length = wcslen(wp); + if (archive_wstring_ensure(&ws, + path_length + 2) == NULL) { + archive_set_error(&a->archive, ENOMEM, + "Can't allocate v7tar data"); + archive_wstring_free(&ws); + return(ARCHIVE_FATAL); + } + /* Should we keep '\' ? */ + if (wp[path_length -1] == L'\\') + path_length--; + archive_wstrncpy(&ws, wp, path_length); + archive_wstrappend_wchar(&ws, L'/'); + archive_entry_copy_pathname_w(entry, ws.s); + archive_wstring_free(&ws); + p = NULL; + } else +#endif + p = archive_entry_pathname(entry); + /* + * On Windows, this is a backup operation just in + * case getting WCS failed. On POSIX, this is a + * normal operation. + */ + if (p != NULL && p[strlen(p) - 1] != '/') { + struct archive_string as; + + archive_string_init(&as); + path_length = strlen(p); + if (archive_string_ensure(&as, + path_length + 2) == NULL) { + archive_set_error(&a->archive, ENOMEM, + "Can't allocate v7tar data"); + archive_string_free(&as); + return(ARCHIVE_FATAL); + } +#if defined(_WIN32) && !defined(__CYGWIN__) + /* NOTE: This might break the pathname + * if the current code page is CP932 and + * the pathname includes a character '\' + * as a part of its multibyte pathname. */ + if (p[strlen(p) -1] == '\\') + path_length--; + else +#endif + archive_strncpy(&as, p, path_length); + archive_strappend_char(&as, '/'); + archive_entry_copy_pathname(entry, as.s); + archive_string_free(&as); + } + } + +#if defined(_WIN32) && !defined(__CYGWIN__) + /* Make sure the path separators in pahtname, hardlink and symlink + * are all slash '/', not the Windows path separator '\'. */ + entry_main = __la_win_entry_in_posix_pathseparator(entry); + if (entry_main == NULL) { + archive_set_error(&a->archive, ENOMEM, + "Can't allocate v7tar data"); + return(ARCHIVE_FATAL); + } + if (entry != entry_main) + entry = entry_main; + else + entry_main = NULL; +#else + entry_main = NULL; +#endif + ret = format_header_v7tar(a, buff, entry, 1, sconv); + if (ret < ARCHIVE_WARN) { + if (entry_main) + archive_entry_free(entry_main); + return (ret); + } + ret2 = __archive_write_output(a, buff, 512); + if (ret2 < ARCHIVE_WARN) { + if (entry_main) + archive_entry_free(entry_main); + return (ret2); + } + if (ret2 < ret) + ret = ret2; + + v7tar->entry_bytes_remaining = archive_entry_size(entry); + v7tar->entry_padding = 0x1ff & (-(int64_t)v7tar->entry_bytes_remaining); + if (entry_main) + archive_entry_free(entry_main); + return (ret); +} + +/* + * Format a basic 512-byte "v7tar" header. + * + * Returns -1 if format failed (due to field overflow). + * Note that this always formats as much of the header as possible. + * If "strict" is set to zero, it will extend numeric fields as + * necessary (overwriting terminators or using base-256 extensions). + * + */ +static int +format_header_v7tar(struct archive_write *a, char h[512], + struct archive_entry *entry, int strict, + struct archive_string_conv *sconv) +{ + unsigned int checksum; + int i, r, ret; + size_t copy_length; + const char *p, *pp; + int mytartype; + + ret = 0; + mytartype = -1; + /* + * The "template header" already includes the "v7tar" + * signature, various end-of-field markers and other required + * elements. + */ + memcpy(h, &template_header, 512); + + /* + * Because the block is already null-filled, and strings + * are allowed to exactly fill their destination (without null), + * I use memcpy(dest, src, strlen()) here a lot to copy strings. + */ + r = archive_entry_pathname_l(entry, &pp, ©_length, sconv); + if (r != 0) { + if (errno == ENOMEM) { + archive_set_error(&a->archive, ENOMEM, + "Can't allocate memory for Pathname"); + return (ARCHIVE_FATAL); + } + archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT, + "Can't translate pathname '%s' to %s", + pp, archive_string_conversion_charset_name(sconv)); + ret = ARCHIVE_WARN; + } + if (strict && copy_length < V7TAR_name_size) + memcpy(h + V7TAR_name_offset, pp, copy_length); + else if (!strict && copy_length <= V7TAR_name_size) + memcpy(h + V7TAR_name_offset, pp, copy_length); + else { + /* Prefix is too long. */ + archive_set_error(&a->archive, ENAMETOOLONG, + "Pathname too long"); + ret = ARCHIVE_FAILED; + } + + r = archive_entry_hardlink_l(entry, &p, ©_length, sconv); + if (r != 0) { + if (errno == ENOMEM) { + archive_set_error(&a->archive, ENOMEM, + "Can't allocate memory for Linkname"); + return (ARCHIVE_FATAL); + } + archive_set_error(&a->archive, + ARCHIVE_ERRNO_FILE_FORMAT, + "Can't translate linkname '%s' to %s", + p, archive_string_conversion_charset_name(sconv)); + ret = ARCHIVE_WARN; + } + if (copy_length > 0) + mytartype = '1'; + else { + r = archive_entry_symlink_l(entry, &p, ©_length, sconv); + if (r != 0) { + if (errno == ENOMEM) { + archive_set_error(&a->archive, ENOMEM, + "Can't allocate memory for Linkname"); + return (ARCHIVE_FATAL); + } + archive_set_error(&a->archive, + ARCHIVE_ERRNO_FILE_FORMAT, + "Can't translate linkname '%s' to %s", + p, archive_string_conversion_charset_name(sconv)); + ret = ARCHIVE_WARN; + } + } + if (copy_length > 0) { + if (copy_length >= V7TAR_linkname_size) { + archive_set_error(&a->archive, ENAMETOOLONG, + "Link contents too long"); + ret = ARCHIVE_FAILED; + copy_length = V7TAR_linkname_size; + } + memcpy(h + V7TAR_linkname_offset, p, copy_length); + } + + if (format_number(archive_entry_mode(entry) & 07777, + h + V7TAR_mode_offset, V7TAR_mode_size, + V7TAR_mode_max_size, strict)) { + archive_set_error(&a->archive, ERANGE, + "Numeric mode too large"); + ret = ARCHIVE_FAILED; + } + + if (format_number(archive_entry_uid(entry), + h + V7TAR_uid_offset, V7TAR_uid_size, V7TAR_uid_max_size, strict)) { + archive_set_error(&a->archive, ERANGE, + "Numeric user ID too large"); + ret = ARCHIVE_FAILED; + } + + if (format_number(archive_entry_gid(entry), + h + V7TAR_gid_offset, V7TAR_gid_size, V7TAR_gid_max_size, strict)) { + archive_set_error(&a->archive, ERANGE, + "Numeric group ID too large"); + ret = ARCHIVE_FAILED; + } + + if (format_number(archive_entry_size(entry), + h + V7TAR_size_offset, V7TAR_size_size, + V7TAR_size_max_size, strict)) { + archive_set_error(&a->archive, ERANGE, + "File size out of range"); + ret = ARCHIVE_FAILED; + } + + if (format_number(archive_entry_mtime(entry), + h + V7TAR_mtime_offset, V7TAR_mtime_size, + V7TAR_mtime_max_size, strict)) { + archive_set_error(&a->archive, ERANGE, + "File modification time too large"); + ret = ARCHIVE_FAILED; + } + + if (mytartype >= 0) { + h[V7TAR_typeflag_offset] = mytartype; + } else { + switch (archive_entry_filetype(entry)) { + case AE_IFREG: case AE_IFDIR: + break; + case AE_IFLNK: + h[V7TAR_typeflag_offset] = '2'; + break; + case AE_IFCHR: + archive_set_error(&a->archive, + ARCHIVE_ERRNO_FILE_FORMAT, + "tar format cannot archive character device"); + return (ARCHIVE_FAILED); + case AE_IFBLK: + archive_set_error(&a->archive, + ARCHIVE_ERRNO_FILE_FORMAT, + "tar format cannot archive block device"); + return (ARCHIVE_FAILED); + case AE_IFIFO: + archive_set_error(&a->archive, + ARCHIVE_ERRNO_FILE_FORMAT, + "tar format cannot archive fifo"); + return (ARCHIVE_FAILED); + case AE_IFSOCK: + archive_set_error(&a->archive, + ARCHIVE_ERRNO_FILE_FORMAT, + "tar format cannot archive socket"); + return (ARCHIVE_FAILED); + default: + archive_set_error(&a->archive, + ARCHIVE_ERRNO_FILE_FORMAT, + "tar format cannot archive this (mode=0%lo)", + (unsigned long)archive_entry_mode(entry)); + ret = ARCHIVE_FAILED; + } + } + + checksum = 0; + for (i = 0; i < 512; i++) + checksum += 255 & (unsigned int)h[i]; + format_octal(checksum, h + V7TAR_checksum_offset, 6); + /* Can't be pre-set in the template. */ + h[V7TAR_checksum_offset + 6] = '\0'; + return (ret); +} + +/* + * Format a number into a field, with some intelligence. + */ +static int +format_number(int64_t v, char *p, int s, int maxsize, int strict) +{ + int64_t limit; + + limit = ((int64_t)1 << (s*3)); + + /* "Strict" only permits octal values with proper termination. */ + if (strict) + return (format_octal(v, p, s)); + + /* + * In non-strict mode, we allow the number to overwrite one or + * more bytes of the field termination. Even old tar + * implementations should be able to handle this with no + * problem. + */ + if (v >= 0) { + while (s <= maxsize) { + if (v < limit) + return (format_octal(v, p, s)); + s++; + limit <<= 3; + } + } + + /* Base-256 can handle any number, positive or negative. */ + return (format_256(v, p, maxsize)); +} + +/* + * Format a number into the specified field using base-256. + */ +static int +format_256(int64_t v, char *p, int s) +{ + p += s; + while (s-- > 0) { + *--p = (char)(v & 0xff); + v >>= 8; + } + *p |= 0x80; /* Set the base-256 marker bit. */ + return (0); +} + +/* + * Format a number into the specified field. + */ +static int +format_octal(int64_t v, char *p, int s) +{ + int len; + + len = s; + + /* Octal values can't be negative, so use 0. */ + if (v < 0) { + while (len-- > 0) + *p++ = '0'; + return (-1); + } + + p += s; /* Start at the end and work backwards. */ + while (s-- > 0) { + *--p = (char)('0' + (v & 7)); + v >>= 3; + } + + if (v == 0) + return (0); + + /* If it overflowed, fill field with max value. */ + while (len-- > 0) + *p++ = '7'; + + return (-1); +} + +static int +archive_write_v7tar_close(struct archive_write *a) +{ + return (__archive_write_nulls(a, 512*2)); +} + +static int +archive_write_v7tar_free(struct archive_write *a) +{ + struct v7tar *v7tar; + + v7tar = (struct v7tar *)a->format_data; + free(v7tar); + a->format_data = NULL; + return (ARCHIVE_OK); +} + +static int +archive_write_v7tar_finish_entry(struct archive_write *a) +{ + struct v7tar *v7tar; + int ret; + + v7tar = (struct v7tar *)a->format_data; + ret = __archive_write_nulls(a, + (size_t)(v7tar->entry_bytes_remaining + v7tar->entry_padding)); + v7tar->entry_bytes_remaining = v7tar->entry_padding = 0; + return (ret); +} + +static ssize_t +archive_write_v7tar_data(struct archive_write *a, const void *buff, size_t s) +{ + struct v7tar *v7tar; + int ret; + + v7tar = (struct v7tar *)a->format_data; + if (s > v7tar->entry_bytes_remaining) + s = (size_t)v7tar->entry_bytes_remaining; + ret = __archive_write_output(a, buff, s); + v7tar->entry_bytes_remaining -= s; + if (ret != ARCHIVE_OK) + return (ret); + return (s); +} diff --git a/libarchive/archive_write_set_format_xar.c b/libarchive/archive_write_set_format_xar.c index 3a48e052fb71..79667e563d7a 100644 --- a/libarchive/archive_write_set_format_xar.c +++ b/libarchive/archive_write_set_format_xar.c @@ -416,7 +416,7 @@ xar_options(struct archive_write *a, const char *key, const char *value) else { archive_set_error(&(a->archive), ARCHIVE_ERRNO_MISC, - "Unkonwn checksum name: `%s'", + "Unknown checksum name: `%s'", value); return (ARCHIVE_FAILED); } @@ -450,7 +450,7 @@ xar_options(struct archive_write *a, const char *key, const char *value) else { archive_set_error(&(a->archive), ARCHIVE_ERRNO_MISC, - "Unkonwn compression name: `%s'", + "Unknown compression name: `%s'", value); return (ARCHIVE_FAILED); } @@ -470,7 +470,7 @@ xar_options(struct archive_write *a, const char *key, const char *value) value[1] != '\0') { archive_set_error(&(a->archive), ARCHIVE_ERRNO_MISC, - "Illeagal value `%s'", + "Illegal value `%s'", value); return (ARCHIVE_FAILED); } @@ -487,7 +487,7 @@ xar_options(struct archive_write *a, const char *key, const char *value) else { archive_set_error(&(a->archive), ARCHIVE_ERRNO_MISC, - "Unkonwn checksum name: `%s'", + "Unknown checksum name: `%s'", value); return (ARCHIVE_FAILED); } @@ -3090,8 +3090,10 @@ save_xattrs(struct archive_write *a, struct file *file) checksum_update(&(xar->a_sumwrk), value, size); checksum_final(&(xar->a_sumwrk), &(heap->a_sum)); if (write_to_temp(a, value, size) - != ARCHIVE_OK) + != ARCHIVE_OK) { + free(heap); return (ARCHIVE_FATAL); + } heap->length = size; /* Add heap to the tail of file->xattr. */ heap->next = NULL; diff --git a/libarchive/archive_write_set_format_zip.c b/libarchive/archive_write_set_format_zip.c index 845c46ce8e76..3d8b3b5f9ca7 100644 --- a/libarchive/archive_write_set_format_zip.c +++ b/libarchive/archive_write_set_format_zip.c @@ -256,6 +256,55 @@ archive_write_zip_options(struct archive_write *a, const char *key, return (ARCHIVE_WARN); } +int +archive_write_zip_set_compression_deflate(struct archive *_a) +{ + struct archive_write *a = (struct archive_write *)_a; + int ret = ARCHIVE_FAILED; + + archive_check_magic(_a, ARCHIVE_WRITE_MAGIC, + ARCHIVE_STATE_NEW | ARCHIVE_STATE_HEADER, + "archive_write_zip_set_compression_deflate"); + if (a->archive.archive_format != ARCHIVE_FORMAT_ZIP) { + archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, + "Can only use archive_write_zip_set_compression_deflate" + " with zip format"); + ret = ARCHIVE_FATAL; + } else { +#ifdef HAVE_ZLIB_H + struct zip *zip = a->format_data; + zip->compression = COMPRESSION_DEFLATE; + ret = ARCHIVE_OK; +#else + archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, + "deflate compression not supported"); +#endif + } + return (ret); +} + +int +archive_write_zip_set_compression_store(struct archive *_a) +{ + struct archive_write *a = (struct archive_write *)_a; + struct zip *zip = a->format_data; + int ret = ARCHIVE_FAILED; + + archive_check_magic(_a, ARCHIVE_WRITE_MAGIC, + ARCHIVE_STATE_NEW | ARCHIVE_STATE_HEADER, + "archive_write_zip_set_compression_deflate"); + if (a->archive.archive_format != ARCHIVE_FORMAT_ZIP) { + archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, + "Can only use archive_write_zip_set_compression_store" + " with zip format"); + ret = ARCHIVE_FATAL; + } else { + zip->compression = COMPRESSION_STORE; + ret = ARCHIVE_OK; + } + return (ret); +} + int archive_write_set_format_zip(struct archive *_a) { @@ -343,7 +392,7 @@ archive_write_zip_header(struct archive_write *a, struct archive_entry *entry) archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC, "Filetype not supported"); return ARCHIVE_FAILED; - }; + }; /* Directory entries should have a size of 0. */ if (type == AE_IFDIR) @@ -511,7 +560,7 @@ archive_write_zip_header(struct archive_write *a, struct archive_entry *entry) zip->stream.zfree = Z_NULL; zip->stream.opaque = Z_NULL; zip->stream.next_out = zip->buf; - zip->stream.avail_out = zip->len_buf; + zip->stream.avail_out = (uInt)zip->len_buf; if (deflateInit2(&zip->stream, Z_DEFAULT_COMPRESSION, Z_DEFLATED, -15, 8, Z_DEFAULT_STRATEGY) != Z_OK) { archive_set_error(&a->archive, ENOMEM, @@ -599,12 +648,12 @@ archive_write_zip_data(struct archive_write *a, const void *buff, size_t s) zip->written_bytes += s; zip->remaining_data_bytes -= s; l->compressed_size += s; - l->crc32 = crc32(l->crc32, buff, s); + l->crc32 = crc32(l->crc32, buff, (unsigned)s); return (s); #if HAVE_ZLIB_H case COMPRESSION_DEFLATE: zip->stream.next_in = (unsigned char*)(uintptr_t)buff; - zip->stream.avail_in = s; + zip->stream.avail_in = (uInt)s; do { ret = deflate(&zip->stream, Z_NO_FLUSH); if (ret == Z_STREAM_ERROR) @@ -617,12 +666,12 @@ archive_write_zip_data(struct archive_write *a, const void *buff, size_t s) l->compressed_size += zip->len_buf; zip->written_bytes += zip->len_buf; zip->stream.next_out = zip->buf; - zip->stream.avail_out = zip->len_buf; + zip->stream.avail_out = (uInt)zip->len_buf; } } while (zip->stream.avail_in != 0); zip->remaining_data_bytes -= s; /* If we have it, use zlib's fast crc32() */ - l->crc32 = crc32(l->crc32, buff, s); + l->crc32 = crc32(l->crc32, buff, (uInt)s); return (s); #endif @@ -663,7 +712,7 @@ archive_write_zip_finish_entry(struct archive_write *a) zip->stream.next_out = zip->buf; if (zip->stream.avail_out != 0) break; - zip->stream.avail_out = zip->len_buf; + zip->stream.avail_out = (uInt)zip->len_buf; } deflateEnd(&zip->stream); break; @@ -842,7 +891,10 @@ path_length(struct archive_entry *entry) type = archive_entry_filetype(entry); path = archive_entry_pathname(entry); - if ((type == AE_IFDIR) & (path[strlen(path) - 1] != '/')) { + if (path == NULL) + return (0); + if (type == AE_IFDIR && + (path[0] == '\0' || path[strlen(path) - 1] != '/')) { return strlen(path) + 1; } else { return strlen(path); diff --git a/libarchive/archive_write_set_options.c b/libarchive/archive_write_set_options.c index 2e17984216a2..962309ada5ce 100644 --- a/libarchive/archive_write_set_options.c +++ b/libarchive/archive_write_set_options.c @@ -78,7 +78,7 @@ archive_set_format_option(struct archive *_a, const char *m, const char *o, struct archive_write *a = (struct archive_write *)_a; if (a->format_name == NULL) - return (ARCHIVE_FAILED); + return (m == NULL)?ARCHIVE_FAILED:ARCHIVE_WARN - 1; /* If the format name didn't match, return a special code for * _archive_set_option[s]. */ if (m != NULL && strcmp(m, a->format_name) != 0) diff --git a/libarchive/filter_fork.h b/libarchive/filter_fork.h index 453d032d1c81..a28272bee33b 100644 --- a/libarchive/filter_fork.h +++ b/libarchive/filter_fork.h @@ -33,7 +33,7 @@ #define FILTER_FORK_H pid_t -__archive_create_child(const char *path, int *child_stdin, int *child_stdout); +__archive_create_child(const char *cmd, int *child_stdin, int *child_stdout); void __archive_check_child(int in, int out); diff --git a/libarchive/filter_fork_posix.c b/libarchive/filter_fork_posix.c new file mode 100644 index 000000000000..02dbd4bb4362 --- /dev/null +++ b/libarchive/filter_fork_posix.c @@ -0,0 +1,238 @@ +/*- + * Copyright (c) 2007 Joerg Sonnenberger + * Copyright (c) 2012 Michihiro NAKAJIMA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "archive_platform.h" + +/* This capability is only available on POSIX systems. */ +#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 +#endif +#ifdef HAVE_ERRNO_H +# include +#endif +#ifdef HAVE_STRING_H +# include +#endif +#if defined(HAVE_POLL) && (defined(HAVE_POLL_H) || defined(HAVE_SYS_POLL_H)) +# if defined(HAVE_POLL_H) +# include +# elif defined(HAVE_SYS_POLL_H) +# include +# endif +#elif defined(HAVE_SELECT) +# if defined(HAVE_SYS_SELECT_H) +# include +# elif defined(HAVE_UNISTD_H) +# include +# endif +#endif +#ifdef HAVE_FCNTL_H +# include +#endif +#ifdef HAVE_SPAWN_H +# include +#endif +#ifdef HAVE_STDLIB_H +# include +#endif +#ifdef HAVE_UNISTD_H +# include +#endif + +#include "archive.h" +#include "archive_cmdline_private.h" + +#include "filter_fork.h" + +pid_t +__archive_create_child(const char *cmd, int *child_stdin, int *child_stdout) +{ + pid_t child; + int stdin_pipe[2], stdout_pipe[2], tmp; +#if HAVE_POSIX_SPAWNP + posix_spawn_file_actions_t actions; + int r; +#endif + struct archive_cmdline *cmdline; + + cmdline = __archive_cmdline_allocate(); + if (cmdline == NULL) + goto state_allocated; + if (__archive_cmdline_parse(cmdline, cmd) != ARCHIVE_OK) + goto state_allocated; + + if (pipe(stdin_pipe) == -1) + goto state_allocated; + if (stdin_pipe[0] == 1 /* stdout */) { + if ((tmp = dup(stdin_pipe[0])) == -1) + goto stdin_opened; + close(stdin_pipe[0]); + stdin_pipe[0] = tmp; + } + if (pipe(stdout_pipe) == -1) + goto stdin_opened; + if (stdout_pipe[1] == 0 /* stdin */) { + if ((tmp = dup(stdout_pipe[1])) == -1) + goto stdout_opened; + close(stdout_pipe[1]); + stdout_pipe[1] = tmp; + } + +#if HAVE_POSIX_SPAWNP + + r = posix_spawn_file_actions_init(&actions); + if (r != 0) { + errno = r; + goto stdout_opened; + } + r = posix_spawn_file_actions_addclose(&actions, stdin_pipe[1]); + if (r != 0) + goto actions_inited; + r = posix_spawn_file_actions_addclose(&actions, stdout_pipe[0]); + if (r != 0) + goto actions_inited; + /* Setup for stdin. */ + r = posix_spawn_file_actions_adddup2(&actions, stdin_pipe[0], 0); + if (r != 0) + goto actions_inited; + if (stdin_pipe[0] != 0 /* stdin */) { + r = posix_spawn_file_actions_addclose(&actions, stdin_pipe[0]); + if (r != 0) + goto actions_inited; + } + /* Setup for stdout. */ + r = posix_spawn_file_actions_adddup2(&actions, stdout_pipe[1], 1); + if (r != 0) + goto actions_inited; + if (stdout_pipe[1] != 1 /* stdout */) { + r = posix_spawn_file_actions_addclose(&actions, stdout_pipe[1]); + if (r != 0) + goto actions_inited; + } + r = posix_spawnp(&child, cmdline->path, &actions, NULL, + cmdline->argv, NULL); + if (r != 0) + goto actions_inited; + posix_spawn_file_actions_destroy(&actions); + +#else /* HAVE_POSIX_SPAWNP */ + +#if HAVE_VFORK + child = vfork(); +#else + child = fork(); +#endif + if (child == -1) + goto stdout_opened; + if (child == 0) { + close(stdin_pipe[1]); + close(stdout_pipe[0]); + if (dup2(stdin_pipe[0], 0 /* stdin */) == -1) + _exit(254); + if (stdin_pipe[0] != 0 /* stdin */) + close(stdin_pipe[0]); + if (dup2(stdout_pipe[1], 1 /* stdout */) == -1) + _exit(254); + if (stdout_pipe[1] != 1 /* stdout */) + close(stdout_pipe[1]); + execvp(cmdline->path, cmdline->argv); + _exit(254); + } +#endif /* HAVE_POSIX_SPAWNP */ + + close(stdin_pipe[0]); + close(stdout_pipe[1]); + + *child_stdin = stdin_pipe[1]; + fcntl(*child_stdin, F_SETFL, O_NONBLOCK); + *child_stdout = stdout_pipe[0]; + fcntl(*child_stdout, F_SETFL, O_NONBLOCK); + __archive_cmdline_free(cmdline); + + return child; + +#if HAVE_POSIX_SPAWNP +actions_inited: + errno = r; + posix_spawn_file_actions_destroy(&actions); +#endif +stdout_opened: + close(stdout_pipe[0]); + close(stdout_pipe[1]); +stdin_opened: + close(stdin_pipe[0]); + close(stdin_pipe[1]); +state_allocated: + __archive_cmdline_free(cmdline); + return -1; +} + +void +__archive_check_child(int in, int out) +{ +#if defined(HAVE_POLL) && (defined(HAVE_POLL_H) || defined(HAVE_SYS_POLL_H)) + struct pollfd fds[2]; + int idx; + + idx = 0; + if (in != -1) { + fds[idx].fd = in; + fds[idx].events = POLLOUT; + ++idx; + } + if (out != -1) { + fds[idx].fd = out; + fds[idx].events = POLLIN; + ++idx; + } + + poll(fds, idx, -1); /* -1 == INFTIM, wait forever */ +#elif defined(HAVE_SELECT) + fd_set fds_in, fds_out, fds_error; + + FD_ZERO(&fds_in); + FD_ZERO(&fds_out); + FD_ZERO(&fds_error); + if (out != -1) { + FD_SET(out, &fds_in); + FD_SET(out, &fds_error); + } + if (in != -1) { + FD_SET(in, &fds_out); + FD_SET(in, &fds_error); + } + select(in < out ? out + 1 : in + 1, &fds_in, &fds_out, &fds_error, NULL); +#else + sleep(1); +#endif +} + +#endif /* defined(HAVE_PIPE) && defined(HAVE_VFORK) && defined(HAVE_FCNTL) */ diff --git a/libarchive/filter_fork_windows.c b/libarchive/filter_fork_windows.c index 8d8beb01eb25..fa59cc9e90ce 100644 --- a/libarchive/filter_fork_windows.c +++ b/libarchive/filter_fork_windows.c @@ -1,5 +1,5 @@ /*- - * Copyright (c) 2009 Michihiro NAKAJIMA + * Copyright (c) 2009-2012 Michihiro NAKAJIMA * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -26,17 +26,100 @@ #include "archive_platform.h" #if defined(_WIN32) && !defined(__CYGWIN__) +#include "archive_cmdline_private.h" +#include "archive_string.h" #include "filter_fork.h" pid_t -__archive_create_child(const char *path, int *child_stdin, int *child_stdout) +__archive_create_child(const char *cmd, int *child_stdin, int *child_stdout) { HANDLE childStdout[2], childStdin[2],childStderr; SECURITY_ATTRIBUTES secAtts; STARTUPINFO staInfo; PROCESS_INFORMATION childInfo; - char cmd[MAX_PATH]; + struct archive_string cmdline; + struct archive_string fullpath; + struct archive_cmdline *acmd; + char *arg0, *ext; + int i, l; + DWORD fl, fl_old; + + childStdout[0] = childStdout[1] = INVALID_HANDLE_VALUE; + childStdin[0] = childStdin[1] = INVALID_HANDLE_VALUE; + childStderr = INVALID_HANDLE_VALUE; + archive_string_init(&cmdline); + archive_string_init(&fullpath); + + acmd = __archive_cmdline_allocate(); + if (acmd == NULL) + goto fail; + if (__archive_cmdline_parse(acmd, cmd) != ARCHIVE_OK) + goto fail; + + /* + * Search the full path of 'path'. + * NOTE: This does not need if we give CreateProcessA 'path' as + * a part of the cmdline and give CreateProcessA NULL as first + * parameter, but I do not like that way. + */ + ext = strrchr(acmd->path, '.'); + if (ext == NULL || strlen(ext) > 4) + /* 'path' does not have a proper extension, so we have to + * give SearchPath() ".exe" as the extension. */ + ext = ".exe"; + else + ext = NULL;/* 'path' has an extension. */ + + fl = MAX_PATH; + do { + if (archive_string_ensure(&fullpath, fl) == NULL) + goto fail; + fl_old = fl; + fl = SearchPathA(NULL, acmd->path, ext, fl, fullpath.s, + &arg0); + } while (fl != 0 && fl > fl_old); + if (fl == 0) + goto fail; + + /* + * Make a command line. + */ + for (l = 0, i = 0; acmd->argv[i] != NULL; i++) { + if (i == 0) + continue; + l += (int)strlen(acmd->argv[i]) + 1; + } + if (archive_string_ensure(&cmdline, l + 1) == NULL) + goto fail; + for (i = 0; acmd->argv[i] != NULL; i++) { + if (i == 0) { + const char *p, *sp; + + if ((p = strchr(acmd->argv[i], '/')) != NULL || + (p = strchr(acmd->argv[i], '\\')) != NULL) + p++; + else + p = acmd->argv[i]; + if ((sp = strchr(p, ' ')) != NULL) + archive_strappend_char(&cmdline, '"'); + archive_strcat(&cmdline, p); + if (sp != NULL) + archive_strappend_char(&cmdline, '"'); + } else { + archive_strappend_char(&cmdline, ' '); + archive_strcat(&cmdline, acmd->argv[i]); + } + } + if (i <= 1) { + const char *sp; + + if ((sp = strchr(arg0, ' ')) != NULL) + archive_strappend_char(&cmdline, '"'); + archive_strcat(&cmdline, arg0); + if (sp != NULL) + archive_strappend_char(&cmdline, '"'); + } secAtts.nLength = sizeof(SECURITY_ATTRIBUTES); secAtts.bInheritHandle = TRUE; @@ -44,33 +127,15 @@ __archive_create_child(const char *path, int *child_stdin, int *child_stdout) if (CreatePipe(&childStdout[0], &childStdout[1], &secAtts, 0) == 0) goto fail; if (!SetHandleInformation(childStdout[0], HANDLE_FLAG_INHERIT, 0)) - { - CloseHandle(childStdout[0]); - CloseHandle(childStdout[1]); goto fail; - } - if (CreatePipe(&childStdin[0], &childStdin[1], &secAtts, 0) == 0) { - CloseHandle(childStdout[0]); - CloseHandle(childStdout[1]); + if (CreatePipe(&childStdin[0], &childStdin[1], &secAtts, 0) == 0) goto fail; - } if (!SetHandleInformation(childStdin[1], HANDLE_FLAG_INHERIT, 0)) - { - CloseHandle(childStdout[0]); - CloseHandle(childStdout[1]); - CloseHandle(childStdin[0]); - CloseHandle(childStdin[1]); goto fail; - } if (DuplicateHandle(GetCurrentProcess(), GetStdHandle(STD_ERROR_HANDLE), GetCurrentProcess(), &childStderr, 0, TRUE, - DUPLICATE_SAME_ACCESS) == 0) { - CloseHandle(childStdout[0]); - CloseHandle(childStdout[1]); - CloseHandle(childStdin[0]); - CloseHandle(childStdin[1]); + DUPLICATE_SAME_ACCESS) == 0) goto fail; - } memset(&staInfo, 0, sizeof(staInfo)); staInfo.cb = sizeof(staInfo); @@ -79,17 +144,9 @@ __archive_create_child(const char *path, int *child_stdin, int *child_stdout) staInfo.hStdInput = childStdin[0]; staInfo.wShowWindow = SW_HIDE; staInfo.dwFlags = STARTF_USESTDHANDLES | STARTF_USESHOWWINDOW; - strncpy(cmd, path, sizeof(cmd)-1); - cmd[sizeof(cmd)-1] = '\0'; - if (CreateProcessA(NULL, cmd, NULL, NULL, TRUE, 0, NULL, NULL, - &staInfo, &childInfo) == 0) { - CloseHandle(childStdout[0]); - CloseHandle(childStdout[1]); - CloseHandle(childStdin[0]); - CloseHandle(childStdin[1]); - CloseHandle(childStderr); + if (CreateProcessA(fullpath.s, cmdline.s, NULL, NULL, TRUE, 0, + NULL, NULL, &staInfo, &childInfo) == 0) goto fail; - } WaitForInputIdle(childInfo.hProcess, INFINITE); CloseHandle(childInfo.hProcess); CloseHandle(childInfo.hThread); @@ -100,9 +157,25 @@ __archive_create_child(const char *path, int *child_stdin, int *child_stdout) CloseHandle(childStdout[1]); CloseHandle(childStdin[0]); + archive_string_free(&cmdline); + archive_string_free(&fullpath); + __archive_cmdline_free(acmd); return (childInfo.dwProcessId); fail: + if (childStdout[0] != INVALID_HANDLE_VALUE) + CloseHandle(childStdout[0]); + if (childStdout[1] != INVALID_HANDLE_VALUE) + CloseHandle(childStdout[1]); + if (childStdin[0] != INVALID_HANDLE_VALUE) + CloseHandle(childStdin[0]); + if (childStdin[1] != INVALID_HANDLE_VALUE) + CloseHandle(childStdin[1]); + if (childStderr != INVALID_HANDLE_VALUE) + CloseHandle(childStderr); + archive_string_free(&cmdline); + archive_string_free(&fullpath); + __archive_cmdline_free(acmd); return (-1); } diff --git a/libarchive/libarchive-formats.5 b/libarchive/libarchive-formats.5 index 0fdf470b63cf..4a709b33c949 100644 --- a/libarchive/libarchive-formats.5 +++ b/libarchive/libarchive-formats.5 @@ -379,7 +379,7 @@ of a file hierarchy in which each line specifies the name of a file and provides specific metadata about that file. Libarchive can read all of the keywords supported by both the NetBSD and FreeBSD versions of -.Xr mtree 1 , +.Xr mtree 8 , although many of the keywords cannot currently be stored in an .Tn archive_entry object. diff --git a/libarchive/test/CMakeLists.txt b/libarchive/test/CMakeLists.txt index 06bbf9af5a2a..d2eb2c2f39ef 100644 --- a/libarchive/test/CMakeLists.txt +++ b/libarchive/test/CMakeLists.txt @@ -5,15 +5,18 @@ ############################################ IF(ENABLE_TEST) SET(libarchive_test_SOURCES + ../../test_utils/test_utils.c main.c read_open_memory.c test.h - test_acl_freebsd.c + test_acl_freebsd_posix1e.c + test_acl_freebsd_nfs4.c test_acl_nfs4.c test_acl_pax.c test_acl_posix1e.c test_archive_api_feature.c test_archive_clear_error.c + test_archive_cmdline.c test_archive_crypto.c test_archive_getdate.c test_archive_match_owner.c @@ -23,6 +26,7 @@ IF(ENABLE_TEST) test_archive_read_close_twice.c test_archive_read_close_twice_open_fd.c test_archive_read_close_twice_open_filename.c + test_archive_read_multiple_data_objects.c test_archive_read_next_header_empty.c test_archive_read_next_header_raw.c test_archive_read_open2.c @@ -34,7 +38,9 @@ IF(ENABLE_TEST) test_archive_set_error.c test_archive_string.c test_archive_string_conversion.c + test_archive_write_add_filter_by_name.c test_archive_write_set_filter_option.c + test_archive_write_set_format_by_name.c test_archive_write_set_format_option.c test_archive_write_set_option.c test_archive_write_set_options.c @@ -45,11 +51,13 @@ IF(ENABLE_TEST) test_compat_gzip.c test_compat_lzip.c test_compat_lzma.c + test_compat_lzop.c test_compat_mac.c test_compat_pax_libarchive_2x.c test_compat_solaris_tar_acl.c test_compat_solaris_pax_sparse.c test_compat_tar_hardlink.c + test_compat_uudecode.c test_compat_xz.c test_compat_zip.c test_empty_write.c @@ -65,13 +73,19 @@ IF(ENABLE_TEST) test_open_file.c test_open_filename.c test_pax_filename_encoding.c - test_read_compress_program.c test_read_data_large.c test_read_disk.c test_read_disk_directory_traversals.c test_read_disk_entry_from_file.c test_read_extract.c test_read_file_nonexistent.c + test_read_filter_grzip.c + test_read_filter_lrzip.c + test_read_filter_lzop.c + test_read_filter_lzop_multiple_parts.c + test_read_filter_program.c + test_read_filter_program_signature.c + test_read_filter_uudecode.c test_read_format_7zip.c test_read_format_ar.c test_read_format_cab.c @@ -125,35 +139,49 @@ IF(ENABLE_TEST) test_read_format_ustar_filename.c test_read_format_xar.c test_read_format_zip.c + test_read_format_zip_comment_stored.c test_read_format_zip_filename.c + test_read_format_zip_mac_metadata.c + test_read_format_zip_sfx.c test_read_large.c test_read_pax_truncated.c test_read_position.c + test_read_set_format.c test_read_truncated.c test_read_truncated_filter.c - test_read_uu.c test_sparse_basic.c test_tar_filenames.c test_tar_large.c test_ustar_filenames.c test_ustar_filename_encoding.c - test_write_compress.c - test_write_compress_bzip2.c - test_write_compress_gzip.c - test_write_compress_lzip.c - test_write_compress_lzma.c - test_write_compress_program.c - test_write_compress_xz.c test_write_disk.c + test_write_disk_appledouble.c test_write_disk_failures.c test_write_disk_hardlink.c + test_write_disk_hfs_compression.c test_write_disk_lookup.c + test_write_disk_mac_metadata.c + test_write_disk_no_hfs_compression.c test_write_disk_perms.c test_write_disk_secure.c test_write_disk_sparse.c test_write_disk_symlink.c test_write_disk_times.c + test_write_filter_b64encode.c + test_write_filter_bzip2.c + test_write_filter_compress.c + test_write_filter_gzip.c + test_write_filter_gzip_timestamp.c + test_write_filter_lrzip.c + test_write_filter_lzip.c + test_write_filter_lzma.c + test_write_filter_lzop.c + test_write_filter_program.c + test_write_filter_uuencode.c + test_write_filter_xz.c test_write_format_7zip.c + test_write_format_7zip_empty.c + test_write_format_7zip_large.c test_write_format_ar.c test_write_format_cpio.c test_write_format_cpio_empty.c @@ -166,18 +194,25 @@ IF(ENABLE_TEST) test_write_format_iso9660_filename.c test_write_format_iso9660_zisofs.c test_write_format_mtree.c + test_write_format_mtree_absolute_path.c + test_write_format_mtree_classic.c + test_write_format_mtree_classic_indent.c test_write_format_mtree_fflags.c + test_write_format_mtree_no_separator.c + test_write_format_mtree_quoted_filename.c test_write_format_pax.c test_write_format_shar_empty.c test_write_format_tar.c test_write_format_tar_empty.c test_write_format_tar_sparse.c test_write_format_tar_ustar.c + test_write_format_tar_v7tar.c test_write_format_xar.c test_write_format_xar_empty.c test_write_format_zip.c test_write_format_zip_empty.c test_write_format_zip_no_compression.c + test_write_zip_set_compression_store.c test_write_open_memory.c test_zip_filename_encoding.c ) @@ -210,6 +245,8 @@ IF(ENABLE_TEST) ENDMACRO (DEFINE_TEST _testname) INCLUDE(${CMAKE_CURRENT_BINARY_DIR}/list.h) + INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) + INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/test_utils) # Experimental new test handling ADD_CUSTOM_TARGET(run_libarchive_test diff --git a/libarchive/test/main.c b/libarchive/test/main.c index 8dc0084365b3..a94fa9251a71 100644 --- a/libarchive/test/main.c +++ b/libarchive/test/main.c @@ -24,6 +24,7 @@ */ #include "test.h" +#include "test_utils.h" #ifdef HAVE_SYS_IOCTL_H #include #endif @@ -89,6 +90,7 @@ __FBSDID("$FreeBSD: head/lib/libarchive/test/main.c 201247 2009-12-30 05:59:21Z */ #if defined(_WIN32) && !defined(__CYGWIN__) #include +#include #include #ifndef F_OK #define F_OK (0) @@ -387,7 +389,6 @@ failure_finish(void *extra) fprintf(stderr, " *** forcing core dump so failure can be debugged ***\n"); abort(); - exit(1); } } @@ -620,8 +621,8 @@ assertion_equal_string(const char *file, int line, if (v1 == v2 || (v1 != NULL && v2 != NULL && strcmp(v1, v2) == 0)) return (1); failure_start(file, line, "%s != %s", e1, e2); - l1 = strlen(e1); - l2 = strlen(e2); + l1 = (int)strlen(e1); + l2 = (int)strlen(e2); if (l1 < l2) l1 = l2; strdump(e1, v1, l1, utf8); @@ -744,6 +745,8 @@ assertion_equal_mem(const char *file, int line, assertion_count(file, line); if (v1 == v2 || (v1 != NULL && v2 != NULL && memcmp(v1, v2, l) == 0)) return (1); + if (v1 == NULL || v2 == NULL) + return (0); failure_start(file, line, "%s != %s", e1, e2); logprintf(" size %s = %d\n", ld, (int)l); @@ -837,9 +840,14 @@ assertion_equal_file(const char *filename, int line, const char *fn1, const char f1 = fopen(fn1, "rb"); f2 = fopen(fn2, "rb"); + if (f1 == NULL || f2 == NULL) { + if (f1) fclose(f1); + if (f2) fclose(f2); + return (0); + } for (;;) { - n1 = fread(buff1, 1, sizeof(buff1), f1); - n2 = fread(buff2, 1, sizeof(buff2), f2); + n1 = (int)fread(buff1, 1, sizeof(buff1), f1); + n2 = (int)fread(buff2, 1, sizeof(buff2), f2); if (n1 != n2) break; if (n1 == 0 && n2 == 0) { @@ -913,7 +921,7 @@ assertion_file_contents(const char *filename, int line, const void *buff, int s, return (0); } contents = malloc(s * 2); - n = fread(contents, 1, s * 2, f); + n = (int)fread(contents, 1, s * 2, f); fclose(f); if (n == s && memcmp(buff, contents, s) == 0) { free(contents); @@ -949,9 +957,9 @@ assertion_text_file_contents(const char *filename, int line, const char *buff, c failure_finish(NULL); return (0); } - s = strlen(buff); + s = (int)strlen(buff); contents = malloc(s * 2 + 128); - n = fread(contents, 1, s * 2 + 128 - 1, f); + n = (int)fread(contents, 1, s * 2 + 128 - 1, f); if (n >= 0) contents[n] = '\0'; fclose(f); @@ -1002,8 +1010,8 @@ assertion_file_contains_lines_any_order(const char *file, int line, char *buff; size_t buff_size; size_t expected_count, actual_count, i, j; - char **expected; - char *p, **actual; + char **expected = NULL; + char *p, **actual = NULL; char c; int expected_failure = 0, actual_failure = 0; @@ -1016,14 +1024,21 @@ assertion_file_contains_lines_any_order(const char *file, int line, return (0); } - /* Make a copy of the provided lines and count up the expected file size. */ - expected_count = 0; + /* Make a copy of the provided lines and count up the expected + * file size. */ for (i = 0; lines[i] != NULL; ++i) { } expected_count = i; - expected = malloc(sizeof(char *) * expected_count); - for (i = 0; lines[i] != NULL; ++i) { - expected[i] = strdup(lines[i]); + if (expected_count) { + expected = malloc(sizeof(char *) * expected_count); + if (expected == NULL) { + failure_start(pathname, line, "Can't allocate memory"); + failure_finish(NULL); + return (0); + } + for (i = 0; lines[i] != NULL; ++i) { + expected[i] = strdup(lines[i]); + } } /* Break the file into lines */ @@ -1035,11 +1050,20 @@ assertion_file_contains_lines_any_order(const char *file, int line, ++actual_count; c = *p; } - actual = malloc(sizeof(char *) * actual_count); - for (j = 0, p = buff; p < buff + buff_size; p += 1 + strlen(p)) { - if (*p != '\0') { - actual[j] = p; - ++j; + if (actual_count) { + actual = calloc(sizeof(char *), actual_count); + if (actual == NULL) { + failure_start(pathname, line, "Can't allocate memory"); + failure_finish(NULL); + free(expected); + return (0); + } + for (j = 0, p = buff; p < buff + buff_size; + p += 1 + strlen(p)) { + if (*p != '\0') { + actual[j] = p; + ++j; + } } } @@ -1174,11 +1198,11 @@ assertion_file_time(const char *file, int line, #if defined(_WIN32) && !defined(__CYGWIN__) #define EPOC_TIME (116444736000000000ULL) - FILETIME ftime, fbirthtime, fatime, fmtime; + FILETIME fxtime, fbirthtime, fatime, fmtime; ULARGE_INTEGER wintm; HANDLE h; - ftime.dwLowDateTime = 0; - ftime.dwHighDateTime = 0; + fxtime.dwLowDateTime = 0; + fxtime.dwHighDateTime = 0; assertion_count(file, line); /* Note: FILE_FLAG_BACKUP_SEMANTICS applies to open @@ -1193,9 +1217,9 @@ assertion_file_time(const char *file, int line, } r = GetFileTime(h, &fbirthtime, &fatime, &fmtime); switch (type) { - case 'a': ftime = fatime; break; - case 'b': ftime = fbirthtime; break; - case 'm': ftime = fmtime; break; + case 'a': fxtime = fatime; break; + case 'b': fxtime = fbirthtime; break; + case 'm': fxtime = fmtime; break; } CloseHandle(h); if (r == 0) { @@ -1203,8 +1227,8 @@ assertion_file_time(const char *file, int line, failure_finish(NULL); return (0); } - wintm.LowPart = ftime.dwLowDateTime; - wintm.HighPart = ftime.dwHighDateTime; + wintm.LowPart = fxtime.dwLowDateTime; + wintm.HighPart = fxtime.dwHighDateTime; filet = (wintm.QuadPart - EPOC_TIME) / 10000000; filet_nsec = ((wintm.QuadPart - EPOC_TIME) % 10000000) * 100; nsec = (nsec / 100) * 100; /* Round the request */ @@ -1832,15 +1856,45 @@ canSymlink(void) return (value); } -/* - * Can this platform run the gzip program? - */ /* Platform-dependent options for hiding the output of a subcommand. */ #if defined(_WIN32) && !defined(__CYGWIN__) static const char *redirectArgs = ">NUL 2>NUL"; /* Win32 cmd.exe */ #else static const char *redirectArgs = ">/dev/null 2>/dev/null"; /* POSIX 'sh' */ #endif +/* + * Can this platform run the bzip2 program? + */ +int +canBzip2(void) +{ + static int tested = 0, value = 0; + if (!tested) { + tested = 1; + if (systemf("bzip2 -d -V %s", redirectArgs) == 0) + value = 1; + } + return (value); +} + +/* + * Can this platform run the grzip program? + */ +int +canGrzip(void) +{ + static int tested = 0, value = 0; + if (!tested) { + tested = 1; + if (systemf("grzip -V %s", redirectArgs) == 0) + value = 1; + } + return (value); +} + +/* + * Can this platform run the gzip program? + */ int canGzip(void) { @@ -1854,15 +1908,87 @@ canGzip(void) } /* - * Can this platform run the gunzip program? + * Can this platform run the lrzip program? */ int -canGunzip(void) +canRunCommand(const char *cmd) +{ + static int tested = 0, value = 0; + if (!tested) { + tested = 1; + if (systemf("%s %s", cmd, redirectArgs) == 0) + value = 1; + } + return (value); +} + +int +canLrzip(void) { static int tested = 0, value = 0; if (!tested) { tested = 1; - if (systemf("gunzip -V %s", redirectArgs) == 0) + if (systemf("lrzip -V %s", redirectArgs) == 0) + value = 1; + } + return (value); +} + +/* + * Can this platform run the lzip program? + */ +int +canLzip(void) +{ + static int tested = 0, value = 0; + if (!tested) { + tested = 1; + if (systemf("lzip -V %s", redirectArgs) == 0) + value = 1; + } + return (value); +} + +/* + * Can this platform run the lzma program? + */ +int +canLzma(void) +{ + static int tested = 0, value = 0; + if (!tested) { + tested = 1; + if (systemf("lzma -V %s", redirectArgs) == 0) + value = 1; + } + return (value); +} + +/* + * Can this platform run the lzop program? + */ +int +canLzop(void) +{ + static int tested = 0, value = 0; + if (!tested) { + tested = 1; + if (systemf("lzop -V %s", redirectArgs) == 0) + value = 1; + } + return (value); +} + +/* + * Can this platform run the xz program? + */ +int +canXz(void) +{ + static int tested = 0, value = 0; + if (!tested) { + tested = 1; + if (systemf("xz -V %s", redirectArgs) == 0) value = 1; } return (value); @@ -2101,6 +2227,14 @@ is_LargeInode(const char *file) return (ino > 0xffffffff); #endif } + +void +extract_reference_files(const char **names) +{ + while (names && *names) + extract_reference_file(*names++); +} + /* * * TEST management @@ -2122,7 +2256,7 @@ is_LargeInode(const char *file) /* Use "list.h" to create a list of all tests (functions and names). */ #undef DEFINE_TEST #define DEFINE_TEST(n) { n, #n, 0 }, -struct { void (*func)(void); const char *name; int failures; } tests[] = { +struct test_list_t tests[] = { #include "list.h" }; @@ -2375,65 +2509,6 @@ get_refdir(const char *d) return strdup(buff); } -static int -get_test_set(int *test_set, int limit, const char *test) -{ - int start, end; - int idx = 0; - - if (test == NULL) { - /* Default: Run all tests. */ - for (;idx < limit; idx++) - test_set[idx] = idx; - return (limit); - } - if (*test >= '0' && *test <= '9') { - const char *vp = test; - start = 0; - while (*vp >= '0' && *vp <= '9') { - start *= 10; - start += *vp - '0'; - ++vp; - } - if (*vp == '\0') { - end = start; - } else if (*vp == '-') { - ++vp; - if (*vp == '\0') { - end = limit - 1; - } else { - end = 0; - while (*vp >= '0' && *vp <= '9') { - end *= 10; - end += *vp - '0'; - ++vp; - } - } - } else - return (-1); - if (start < 0 || end >= limit || start > end) - return (-1); - while (start <= end) - test_set[idx++] = start++; - } else { - size_t len = strlen(test); - for (start = 0; start < limit; ++start) { - const char *name = tests[start].name; - const char *p; - - while ((p = strchr(name, test[0])) != NULL) { - if (strncmp(p, test, len) == 0) { - test_set[idx++] = start; - break; - } else - name = p + 1; - } - - } - } - return ((idx == 0)?-1:idx); -} - int main(int argc, char **argv) { @@ -2718,10 +2793,11 @@ main(int argc, char **argv) do { int test_num; - test_num = get_test_set(test_set, limit, *argv); + test_num = get_test_set(test_set, limit, *argv, tests); if (test_num < 0) { printf("*** INVALID Test %s\n", *argv); free(refdir_alloc); + free(testprogdir); usage(progname); return (1); } diff --git a/libarchive/test/test.h b/libarchive/test/test.h index 7d2f20826f45..7ca2da7ac39e 100644 --- a/libarchive/test/test.h +++ b/libarchive/test/test.h @@ -266,11 +266,32 @@ void sleepUntilAfter(time_t); /* Return true if this platform can create symlinks. */ int canSymlink(void); +/* Return true if this platform can run the "bzip2" program. */ +int canBzip2(void); + +/* Return true if this platform can run the "grzip" program. */ +int canGrzip(void); + /* Return true if this platform can run the "gzip" program. */ int canGzip(void); -/* Return true if this platform can run the "gunzip" program. */ -int canGunzip(void); +/* Return true if this platform can run the specified command. */ +int canRunCommand(const char *); + +/* Return true if this platform can run the "lrzip" program. */ +int canLrzip(void); + +/* Return true if this platform can run the "lzip" program. */ +int canLzip(void); + +/* Return true if this platform can run the "lzma" program. */ +int canLzma(void); + +/* Return true if this platform can run the "lzop" program. */ +int canLzop(void); + +/* Return true if this platform can run the "xz" program. */ +int canXz(void); /* Return true if this filesystem can handle nodump flags. */ int canNodump(void); @@ -285,6 +306,11 @@ char *slurpfile(size_t *, const char *fmt, ...); /* Extracts named reference file to the current directory. */ void extract_reference_file(const char *); +/* Extracts a list of files to the current directory. + * List must be NULL terminated. + */ +void extract_reference_files(const char **); + /* Path to working directory for current test */ const char *testworkdir; diff --git a/libarchive/test/test_acl_freebsd_nfs4.c b/libarchive/test/test_acl_freebsd_nfs4.c new file mode 100644 index 000000000000..fd2301d1f3dd --- /dev/null +++ b/libarchive/test/test_acl_freebsd_nfs4.c @@ -0,0 +1,547 @@ +/*- + * Copyright (c) 2003-2010 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" +__FBSDID("$FreeBSD$"); + +#if defined(__FreeBSD__) && __FreeBSD__ >= 8 +#define _ACL_PRIVATE +#include + +struct myacl_t { + int type; + int permset; + int tag; + int qual; /* GID or UID of user/group, depending on tag. */ + const char *name; /* Name of user/group, depending on tag. */ +}; + +static struct myacl_t acls_reg[] = { + /* For this test, we need the file owner to be able to read and write the ACL. */ + { ARCHIVE_ENTRY_ACL_TYPE_ALLOW, + ARCHIVE_ENTRY_ACL_READ_DATA | ARCHIVE_ENTRY_ACL_READ_ACL | ARCHIVE_ENTRY_ACL_WRITE_ACL | ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS | ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES, + ARCHIVE_ENTRY_ACL_USER_OBJ, -1, ""}, + + /* An entry for each type. */ + { ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_EXECUTE, + ARCHIVE_ENTRY_ACL_USER, 108, "user108" }, + { ARCHIVE_ENTRY_ACL_TYPE_DENY, ARCHIVE_ENTRY_ACL_EXECUTE, + ARCHIVE_ENTRY_ACL_USER, 109, "user109" }, + + /* An entry for each permission. */ + { ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_EXECUTE, + ARCHIVE_ENTRY_ACL_USER, 112, "user112" }, + { ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_READ_DATA, + ARCHIVE_ENTRY_ACL_USER, 113, "user113" }, + { ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_WRITE_DATA, + ARCHIVE_ENTRY_ACL_USER, 115, "user115" }, + { ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_APPEND_DATA, + ARCHIVE_ENTRY_ACL_USER, 117, "user117" }, + { ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS, + ARCHIVE_ENTRY_ACL_USER, 119, "user119" }, + { ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS, + ARCHIVE_ENTRY_ACL_USER, 120, "user120" }, + { ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES, + ARCHIVE_ENTRY_ACL_USER, 122, "user122" }, + { ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES, + ARCHIVE_ENTRY_ACL_USER, 123, "user123" }, + { ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_DELETE, + ARCHIVE_ENTRY_ACL_USER, 124, "user124" }, + { ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_READ_ACL, + ARCHIVE_ENTRY_ACL_USER, 125, "user125" }, + { ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_WRITE_ACL, + ARCHIVE_ENTRY_ACL_USER, 126, "user126" }, + { ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_WRITE_OWNER, + ARCHIVE_ENTRY_ACL_USER, 127, "user127" }, + { ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_SYNCHRONIZE, + ARCHIVE_ENTRY_ACL_USER, 128, "user128" }, + + /* One entry for each qualifier. */ + { ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_EXECUTE, + ARCHIVE_ENTRY_ACL_USER, 135, "user135" }, +// { ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_EXECUTE, +// ARCHIVE_ENTRY_ACL_USER_OBJ, -1, "" }, + { ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_EXECUTE, + ARCHIVE_ENTRY_ACL_GROUP, 136, "group136" }, + { ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_EXECUTE, + ARCHIVE_ENTRY_ACL_GROUP_OBJ, -1, "" }, + { ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_EXECUTE, + ARCHIVE_ENTRY_ACL_EVERYONE, -1, "" } +}; + + +static struct myacl_t acls_dir[] = { + /* For this test, we need to be able to read and write the ACL. */ + { ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_READ_ACL, + ARCHIVE_ENTRY_ACL_USER_OBJ, -1, ""}, + + /* An entry for each type. */ + { ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_LIST_DIRECTORY, + ARCHIVE_ENTRY_ACL_USER, 101, "user101" }, + { ARCHIVE_ENTRY_ACL_TYPE_DENY, ARCHIVE_ENTRY_ACL_LIST_DIRECTORY, + ARCHIVE_ENTRY_ACL_USER, 102, "user102" }, + + /* An entry for each permission. */ + { ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_LIST_DIRECTORY, + ARCHIVE_ENTRY_ACL_USER, 201, "user201" }, + { ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_ADD_FILE, + ARCHIVE_ENTRY_ACL_USER, 202, "user202" }, + { ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY, + ARCHIVE_ENTRY_ACL_USER, 203, "user203" }, + { ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS, + ARCHIVE_ENTRY_ACL_USER, 204, "user204" }, + { ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS, + ARCHIVE_ENTRY_ACL_USER, 205, "user205" }, + { ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_DELETE_CHILD, + ARCHIVE_ENTRY_ACL_USER, 206, "user206" }, + { ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES, + ARCHIVE_ENTRY_ACL_USER, 207, "user207" }, + { ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES, + ARCHIVE_ENTRY_ACL_USER, 208, "user208" }, + { ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_DELETE, + ARCHIVE_ENTRY_ACL_USER, 209, "user209" }, + { ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_READ_ACL, + ARCHIVE_ENTRY_ACL_USER, 210, "user210" }, + { ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_WRITE_ACL, + ARCHIVE_ENTRY_ACL_USER, 211, "user211" }, + { ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_WRITE_OWNER, + ARCHIVE_ENTRY_ACL_USER, 212, "user212" }, + { ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_SYNCHRONIZE, + ARCHIVE_ENTRY_ACL_USER, 213, "user213" }, + + /* One entry with each inheritance value. */ + { ARCHIVE_ENTRY_ACL_TYPE_ALLOW, + ARCHIVE_ENTRY_ACL_READ_DATA | ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT, + ARCHIVE_ENTRY_ACL_USER, 301, "user301" }, + { ARCHIVE_ENTRY_ACL_TYPE_ALLOW, + ARCHIVE_ENTRY_ACL_READ_DATA | ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT, + ARCHIVE_ENTRY_ACL_USER, 302, "user302" }, +#if 0 + { ARCHIVE_ENTRY_ACL_TYPE_ALLOW, + ARCHIVE_ENTRY_ACL_READ_DATA | ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT, + ARCHIVE_ENTRY_ACL_USER, 303, "user303" }, + { ARCHIVE_ENTRY_ACL_TYPE_ALLOW, + ARCHIVE_ENTRY_ACL_READ_DATA | ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY, + ARCHIVE_ENTRY_ACL_USER, 304, "user304" }, +#endif + +#if 0 + /* FreeBSD does not support audit entries. */ + { ARCHIVE_ENTRY_ACL_TYPE_AUDIT, + ARCHIVE_ENTRY_ACL_READ_DATA | ARCHIVE_ENTRY_ACL_ENTRY_SUCCESSFUL_ACCESS, + ARCHIVE_ENTRY_ACL_USER, 401, "user401" }, + { ARCHIVE_ENTRY_ACL_TYPE_AUDIT, + ARCHIVE_ENTRY_ACL_READ_DATA | ARCHIVE_ENTRY_ACL_ENTRY_FAILED_ACCESS, + ARCHIVE_ENTRY_ACL_USER, 402, "user402" }, +#endif + + /* One entry for each qualifier. */ + { ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_LIST_DIRECTORY, + ARCHIVE_ENTRY_ACL_USER, 501, "user501" }, + { ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_LIST_DIRECTORY, + ARCHIVE_ENTRY_ACL_GROUP, 502, "group502" }, + { ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_LIST_DIRECTORY, + ARCHIVE_ENTRY_ACL_GROUP_OBJ, -1, "" }, + { ARCHIVE_ENTRY_ACL_TYPE_ALLOW, ARCHIVE_ENTRY_ACL_LIST_DIRECTORY, + ARCHIVE_ENTRY_ACL_EVERYONE, -1, "" } +}; + +static void +set_acls(struct archive_entry *ae, struct myacl_t *acls, int start, int end) +{ + int i; + + archive_entry_acl_clear(ae); + if (start > 0) { + assertEqualInt(ARCHIVE_OK, + archive_entry_acl_add_entry(ae, + acls[0].type, acls[0].permset, acls[0].tag, + acls[0].qual, acls[0].name)); + } + for (i = start; i < end; i++) { + assertEqualInt(ARCHIVE_OK, + archive_entry_acl_add_entry(ae, + acls[i].type, acls[i].permset, acls[i].tag, + acls[i].qual, acls[i].name)); + } +} + +static int +acl_permset_to_bitmap(acl_permset_t opaque_ps) +{ + static struct { int machine; int portable; } perms[] = { + {ACL_EXECUTE, ARCHIVE_ENTRY_ACL_EXECUTE}, + {ACL_WRITE, ARCHIVE_ENTRY_ACL_WRITE}, + {ACL_READ, ARCHIVE_ENTRY_ACL_READ}, + {ACL_READ_DATA, ARCHIVE_ENTRY_ACL_READ_DATA}, + {ACL_LIST_DIRECTORY, ARCHIVE_ENTRY_ACL_LIST_DIRECTORY}, + {ACL_WRITE_DATA, ARCHIVE_ENTRY_ACL_WRITE_DATA}, + {ACL_ADD_FILE, ARCHIVE_ENTRY_ACL_ADD_FILE}, + {ACL_APPEND_DATA, ARCHIVE_ENTRY_ACL_APPEND_DATA}, + {ACL_ADD_SUBDIRECTORY, ARCHIVE_ENTRY_ACL_ADD_SUBDIRECTORY}, + {ACL_READ_NAMED_ATTRS, ARCHIVE_ENTRY_ACL_READ_NAMED_ATTRS}, + {ACL_WRITE_NAMED_ATTRS, ARCHIVE_ENTRY_ACL_WRITE_NAMED_ATTRS}, + {ACL_DELETE_CHILD, ARCHIVE_ENTRY_ACL_DELETE_CHILD}, + {ACL_READ_ATTRIBUTES, ARCHIVE_ENTRY_ACL_READ_ATTRIBUTES}, + {ACL_WRITE_ATTRIBUTES, ARCHIVE_ENTRY_ACL_WRITE_ATTRIBUTES}, + {ACL_DELETE, ARCHIVE_ENTRY_ACL_DELETE}, + {ACL_READ_ACL, ARCHIVE_ENTRY_ACL_READ_ACL}, + {ACL_WRITE_ACL, ARCHIVE_ENTRY_ACL_WRITE_ACL}, + {ACL_WRITE_OWNER, ARCHIVE_ENTRY_ACL_WRITE_OWNER}, + {ACL_SYNCHRONIZE, ARCHIVE_ENTRY_ACL_SYNCHRONIZE} + }; + int i, permset = 0; + + for (i = 0; i < (int)(sizeof(perms)/sizeof(perms[0])); ++i) + if (acl_get_perm_np(opaque_ps, perms[i].machine)) + permset |= perms[i].portable; + return permset; +} + +static int +acl_flagset_to_bitmap(acl_flagset_t opaque_fs) +{ + static struct { int machine; int portable; } flags[] = { + {ACL_ENTRY_FILE_INHERIT, ARCHIVE_ENTRY_ACL_ENTRY_FILE_INHERIT}, + {ACL_ENTRY_DIRECTORY_INHERIT, ARCHIVE_ENTRY_ACL_ENTRY_DIRECTORY_INHERIT}, + {ACL_ENTRY_NO_PROPAGATE_INHERIT, ARCHIVE_ENTRY_ACL_ENTRY_NO_PROPAGATE_INHERIT}, + {ACL_ENTRY_INHERIT_ONLY, ARCHIVE_ENTRY_ACL_ENTRY_INHERIT_ONLY}, + }; + int i, flagset = 0; + + for (i = 0; i < (int)(sizeof(flags)/sizeof(flags[0])); ++i) + if (acl_get_flag_np(opaque_fs, flags[i].machine)) + flagset |= flags[i].portable; + return flagset; +} + +static int +acl_match(acl_entry_t aclent, struct myacl_t *myacl) +{ + gid_t g, *gp; + uid_t u, *up; + acl_tag_t tag_type; + acl_permset_t opaque_ps; + acl_flagset_t opaque_fs; + int perms; + + acl_get_tag_type(aclent, &tag_type); + + /* translate the silly opaque permset to a bitmap */ + acl_get_permset(aclent, &opaque_ps); + acl_get_flagset_np(aclent, &opaque_fs); + perms = acl_permset_to_bitmap(opaque_ps) | acl_flagset_to_bitmap(opaque_fs); + if (perms != myacl->permset) + return (0); + + switch (tag_type) { + case ACL_USER_OBJ: + if (myacl->tag != ARCHIVE_ENTRY_ACL_USER_OBJ) return (0); + break; + case ACL_USER: + if (myacl->tag != ARCHIVE_ENTRY_ACL_USER) + return (0); + up = acl_get_qualifier(aclent); + u = *up; + acl_free(up); + if ((uid_t)myacl->qual != u) + return (0); + break; + case ACL_GROUP_OBJ: + if (myacl->tag != ARCHIVE_ENTRY_ACL_GROUP_OBJ) return (0); + break; + case ACL_GROUP: + if (myacl->tag != ARCHIVE_ENTRY_ACL_GROUP) + return (0); + gp = acl_get_qualifier(aclent); + g = *gp; + acl_free(gp); + if ((gid_t)myacl->qual != g) + return (0); + break; + case ACL_MASK: + if (myacl->tag != ARCHIVE_ENTRY_ACL_MASK) return (0); + break; + case ACL_EVERYONE: + if (myacl->tag != ARCHIVE_ENTRY_ACL_EVERYONE) return (0); + break; + } + return (1); +} + +static void +compare_acls(acl_t acl, struct myacl_t *myacls, const char *filename, int start, int end) +{ + int *marker; + int entry_id = ACL_FIRST_ENTRY; + int matched; + int i, n; + acl_entry_t acl_entry; + + n = end - start; + marker = malloc(sizeof(marker[0]) * (n + 1)); + for (i = 0; i < n; i++) + marker[i] = i + start; + /* Always include the first ACE. */ + if (start > 0) { + marker[n] = 0; + ++n; + } + + /* + * Iterate over acls in system acl object, try to match each + * one with an item in the myacls array. + */ + while (1 == acl_get_entry(acl, entry_id, &acl_entry)) { + /* After the first time... */ + entry_id = ACL_NEXT_ENTRY; + + /* Search for a matching entry (tag and qualifier) */ + for (i = 0, matched = 0; i < n && !matched; i++) { + if (acl_match(acl_entry, &myacls[marker[i]])) { + /* We found a match; remove it. */ + marker[i] = marker[n - 1]; + n--; + matched = 1; + } + } + + failure("ACL entry on file %s that shouldn't be there", filename); + assert(matched == 1); + } + + /* Dump entries in the myacls array that weren't in the system acl. */ + for (i = 0; i < n; ++i) { + failure(" ACL entry %d missing from %s: " + "type=%d,permset=%x,tag=%d,qual=%d,name=``%s''\n", + marker[i], filename, + myacls[marker[i]].type, myacls[marker[i]].permset, + myacls[marker[i]].tag, myacls[marker[i]].qual, + myacls[marker[i]].name); + assert(0); /* Record this as a failure. */ + } + free(marker); +} + +static void +compare_entry_acls(struct archive_entry *ae, struct myacl_t *myacls, const char *filename, int start, int end) +{ + int *marker; + int matched; + int i, n; + int type, permset, tag, qual; + const char *name; + + /* Count ACL entries in myacls array and allocate an indirect array. */ + n = end - start; + marker = malloc(sizeof(marker[0]) * (n + 1)); + for (i = 0; i < n; i++) + marker[i] = i + start; + /* Always include the first ACE. */ + if (start > 0) { + marker[n] = 0; + ++n; + } + + /* + * Iterate over acls in entry, try to match each + * one with an item in the myacls array. + */ + assertEqualInt(n, archive_entry_acl_reset(ae, ARCHIVE_ENTRY_ACL_TYPE_NFS4)); + while (ARCHIVE_OK == archive_entry_acl_next(ae, + ARCHIVE_ENTRY_ACL_TYPE_NFS4, &type, &permset, &tag, &qual, &name)) { + + /* Search for a matching entry (tag and qualifier) */ + for (i = 0, matched = 0; i < n && !matched; i++) { + if (tag == myacls[marker[i]].tag + && qual == myacls[marker[i]].qual + && permset == myacls[marker[i]].permset + && type == myacls[marker[i]].type) { + /* We found a match; remove it. */ + marker[i] = marker[n - 1]; + n--; + matched = 1; + } + } + + failure("ACL entry on file that shouldn't be there: " + "type=%d,permset=%x,tag=%d,qual=%d", + type,permset,tag,qual); + assert(matched == 1); + } + + /* Dump entries in the myacls array that weren't in the system acl. */ + for (i = 0; i < n; ++i) { + failure(" ACL entry %d missing from %s: " + "type=%d,permset=%x,tag=%d,qual=%d,name=``%s''\n", + marker[i], filename, + myacls[marker[i]].type, myacls[marker[i]].permset, + myacls[marker[i]].tag, myacls[marker[i]].qual, + myacls[marker[i]].name); + assert(0); /* Record this as a failure. */ + } + free(marker); +} +#endif + +/* + * Verify ACL restore-to-disk. This test is FreeBSD-specific. + */ + +DEFINE_TEST(test_acl_freebsd_nfs4) +{ +#if !defined(__FreeBSD__) + skipping("FreeBSD-specific NFS4 ACL restore test"); +#elif __FreeBSD__ < 8 + skipping("NFS4 ACLs supported only on FreeBSD 8.0 and later"); +#else + char buff[64]; + struct stat st; + struct archive *a; + struct archive_entry *ae; + int i, n; + acl_t acl; + + /* + * First, do a quick manual set/read of ACL data to + * verify that the local filesystem does support ACLs. + * If it doesn't, we'll simply skip the remaining tests. + */ + acl = acl_from_text("owner@:rwxp::allow,group@:rwp:f:allow"); + assert((void *)acl != NULL); + /* Create a test dir and try to set an ACL on it. */ + if (!assertMakeDir("pretest", 0755)) { + acl_free(acl); + return; + } + + n = acl_set_file("pretest", ACL_TYPE_NFS4, acl); + acl_free(acl); + if (n != 0 && errno == EOPNOTSUPP) { + skipping("NFS4 ACL tests require that NFS4 ACLs" + " be enabled on the filesystem"); + return; + } + if (n != 0 && errno == EINVAL) { + skipping("This filesystem does not support NFS4 ACLs"); + return; + } + failure("acl_set_file(): errno = %d (%s)", + errno, strerror(errno)); + assertEqualInt(0, n); + + /* Create a write-to-disk object. */ + assert(NULL != (a = archive_write_disk_new())); + archive_write_disk_set_options(a, + ARCHIVE_EXTRACT_TIME | ARCHIVE_EXTRACT_PERM | ARCHIVE_EXTRACT_ACL); + + /* Populate an archive entry with some metadata, including ACL info */ + ae = archive_entry_new(); + assert(ae != NULL); + archive_entry_set_pathname(ae, "testall"); + archive_entry_set_filetype(ae, AE_IFREG); + archive_entry_set_perm(ae, 0654); + archive_entry_set_mtime(ae, 123456, 7890); + archive_entry_set_size(ae, 0); + set_acls(ae, acls_reg, 0, (int)(sizeof(acls_reg)/sizeof(acls_reg[0]))); + + /* Write the entry to disk, including ACLs. */ + assertEqualIntA(a, ARCHIVE_OK, archive_write_header(a, ae)); + + /* Likewise for a dir. */ + archive_entry_set_pathname(ae, "dirall"); + archive_entry_set_filetype(ae, AE_IFDIR); + archive_entry_set_perm(ae, 0654); + archive_entry_set_mtime(ae, 123456, 7890); + set_acls(ae, acls_dir, 0, (int)(sizeof(acls_dir)/sizeof(acls_dir[0]))); + assertEqualIntA(a, ARCHIVE_OK, archive_write_header(a, ae)); + + for (i = 0; i < (int)(sizeof(acls_dir)/sizeof(acls_dir[0])); ++i) { + sprintf(buff, "dir%d", i); + archive_entry_set_pathname(ae, buff); + archive_entry_set_filetype(ae, AE_IFDIR); + archive_entry_set_perm(ae, 0654); + archive_entry_set_mtime(ae, 123456 + i, 7891 + i); + set_acls(ae, acls_dir, i, i + 1); + assertEqualIntA(a, ARCHIVE_OK, archive_write_header(a, ae)); + } + + archive_entry_free(ae); + + /* Close the archive. */ + assertEqualIntA(a, ARCHIVE_OK, archive_write_close(a)); + assertEqualInt(ARCHIVE_OK, archive_write_free(a)); + + /* Verify the data on disk. */ + assertEqualInt(0, stat("testall", &st)); + assertEqualInt(st.st_mtime, 123456); + acl = acl_get_file("testall", ACL_TYPE_NFS4); + assert(acl != (acl_t)NULL); + compare_acls(acl, acls_reg, "testall", 0, (int)(sizeof(acls_reg)/sizeof(acls_reg[0]))); + acl_free(acl); + + /* Verify single-permission dirs on disk. */ + for (i = 0; i < (int)(sizeof(acls_dir)/sizeof(acls_dir[0])); ++i) { + sprintf(buff, "dir%d", i); + assertEqualInt(0, stat(buff, &st)); + assertEqualInt(st.st_mtime, 123456 + i); + acl = acl_get_file(buff, ACL_TYPE_NFS4); + assert(acl != (acl_t)NULL); + compare_acls(acl, acls_dir, buff, i, i + 1); + acl_free(acl); + } + + /* Verify "dirall" on disk. */ + assertEqualInt(0, stat("dirall", &st)); + assertEqualInt(st.st_mtime, 123456); + acl = acl_get_file("dirall", ACL_TYPE_NFS4); + assert(acl != (acl_t)NULL); + compare_acls(acl, acls_dir, "dirall", 0, (int)(sizeof(acls_dir)/sizeof(acls_dir[0]))); + acl_free(acl); + + /* Read and compare ACL via archive_read_disk */ + a = archive_read_disk_new(); + assert(a != NULL); + ae = archive_entry_new(); + assert(ae != NULL); + archive_entry_set_pathname(ae, "testall"); + assertEqualInt(ARCHIVE_OK, + archive_read_disk_entry_from_file(a, ae, -1, NULL)); + compare_entry_acls(ae, acls_reg, "testall", 0, (int)(sizeof(acls_reg)/sizeof(acls_reg[0]))); + archive_entry_free(ae); + assertEqualInt(ARCHIVE_OK, archive_read_free(a)); + + /* Read and compare ACL via archive_read_disk */ + a = archive_read_disk_new(); + assert(a != NULL); + ae = archive_entry_new(); + assert(ae != NULL); + archive_entry_set_pathname(ae, "dirall"); + assertEqualInt(ARCHIVE_OK, + archive_read_disk_entry_from_file(a, ae, -1, NULL)); + compare_entry_acls(ae, acls_dir, "dirall", 0, (int)(sizeof(acls_dir)/sizeof(acls_dir[0]))); + archive_entry_free(ae); + assertEqualInt(ARCHIVE_OK, archive_read_free(a)); +#endif +} diff --git a/libarchive/test/test_acl_freebsd_posix1e.c b/libarchive/test/test_acl_freebsd_posix1e.c new file mode 100644 index 000000000000..36f9499f4c73 --- /dev/null +++ b/libarchive/test/test_acl_freebsd_posix1e.c @@ -0,0 +1,265 @@ +/*- + * 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. + */ +#include "test.h" +__FBSDID("$FreeBSD: head/lib/libarchive/test/test_acl_freebsd.c 189427 2009-03-06 04:21:23Z kientzle $"); + +#if defined(__FreeBSD__) && __FreeBSD__ > 4 +#include + +struct myacl_t { + int type; /* Type of ACL: "access" or "default" */ + int permset; /* Permissions for this class of users. */ + int tag; /* Owner, User, Owning group, group, other, etc. */ + int qual; /* GID or UID of user/group, depending on tag. */ + const char *name; /* Name of user/group, depending on tag. */ +}; + +static struct myacl_t acls2[] = { + { ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_EXECUTE | ARCHIVE_ENTRY_ACL_READ, + ARCHIVE_ENTRY_ACL_USER_OBJ, -1, "" }, + { ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_READ, + ARCHIVE_ENTRY_ACL_USER, 77, "user77" }, + { ARCHIVE_ENTRY_ACL_TYPE_ACCESS, 0, + ARCHIVE_ENTRY_ACL_USER, 78, "user78" }, + { ARCHIVE_ENTRY_ACL_TYPE_ACCESS, ARCHIVE_ENTRY_ACL_READ, + ARCHIVE_ENTRY_ACL_GROUP_OBJ, -1, "" }, + { ARCHIVE_ENTRY_ACL_TYPE_ACCESS, 0007, + ARCHIVE_ENTRY_ACL_GROUP, 78, "group78" }, + { ARCHIVE_ENTRY_ACL_TYPE_ACCESS, + ARCHIVE_ENTRY_ACL_WRITE | ARCHIVE_ENTRY_ACL_EXECUTE, + ARCHIVE_ENTRY_ACL_OTHER, -1, "" }, + { ARCHIVE_ENTRY_ACL_TYPE_ACCESS, + ARCHIVE_ENTRY_ACL_WRITE | ARCHIVE_ENTRY_ACL_READ | ARCHIVE_ENTRY_ACL_EXECUTE, + ARCHIVE_ENTRY_ACL_MASK, -1, "" }, + { 0, 0, 0, 0, NULL } +}; + +static void +set_acls(struct archive_entry *ae, struct myacl_t *acls) +{ + int i; + + archive_entry_acl_clear(ae); + for (i = 0; acls[i].name != NULL; i++) { + archive_entry_acl_add_entry(ae, + acls[i].type, acls[i].permset, acls[i].tag, acls[i].qual, + acls[i].name); + } +} + +static int +acl_match(acl_entry_t aclent, struct myacl_t *myacl) +{ + gid_t g, *gp; + uid_t u, *up; + acl_tag_t tag_type; + acl_permset_t opaque_ps; + int permset = 0; + + acl_get_tag_type(aclent, &tag_type); + + /* translate the silly opaque permset to a bitmap */ + acl_get_permset(aclent, &opaque_ps); + if (acl_get_perm_np(opaque_ps, ACL_EXECUTE)) + permset |= ARCHIVE_ENTRY_ACL_EXECUTE; + if (acl_get_perm_np(opaque_ps, ACL_WRITE)) + permset |= ARCHIVE_ENTRY_ACL_WRITE; + if (acl_get_perm_np(opaque_ps, ACL_READ)) + permset |= ARCHIVE_ENTRY_ACL_READ; + + if (permset != myacl->permset) + return (0); + + switch (tag_type) { + case ACL_USER_OBJ: + if (myacl->tag != ARCHIVE_ENTRY_ACL_USER_OBJ) return (0); + break; + case ACL_USER: + if (myacl->tag != ARCHIVE_ENTRY_ACL_USER) + return (0); + up = acl_get_qualifier(aclent); + u = *up; + acl_free(up); + if ((uid_t)myacl->qual != u) + return (0); + break; + case ACL_GROUP_OBJ: + if (myacl->tag != ARCHIVE_ENTRY_ACL_GROUP_OBJ) return (0); + break; + case ACL_GROUP: + if (myacl->tag != ARCHIVE_ENTRY_ACL_GROUP) + return (0); + gp = acl_get_qualifier(aclent); + g = *gp; + acl_free(gp); + if ((gid_t)myacl->qual != g) + return (0); + break; + case ACL_MASK: + if (myacl->tag != ARCHIVE_ENTRY_ACL_MASK) return (0); + break; + case ACL_OTHER: + if (myacl->tag != ARCHIVE_ENTRY_ACL_OTHER) return (0); + break; + } + return (1); +} + +static void +compare_acls(acl_t acl, struct myacl_t *myacls) +{ + int *marker; + int entry_id = ACL_FIRST_ENTRY; + int matched; + int i, n; + acl_entry_t acl_entry; + + /* Count ACL entries in myacls array and allocate an indirect array. */ + for (n = 0; myacls[n].name != NULL; ++n) + continue; + if (n) { + marker = malloc(sizeof(marker[0]) * n); + if (marker == NULL) + return; + for (i = 0; i < n; i++) + marker[i] = i; + } else + marker = NULL; + + /* + * Iterate over acls in system acl object, try to match each + * one with an item in the myacls array. + */ + while (1 == acl_get_entry(acl, entry_id, &acl_entry)) { + /* After the first time... */ + entry_id = ACL_NEXT_ENTRY; + + /* Search for a matching entry (tag and qualifier) */ + for (i = 0, matched = 0; i < n && !matched; i++) { + if (acl_match(acl_entry, &myacls[marker[i]])) { + /* We found a match; remove it. */ + marker[i] = marker[n - 1]; + n--; + matched = 1; + } + } + + /* TODO: Print out more details in this case. */ + failure("ACL entry on file that shouldn't be there"); + assert(matched == 1); + } + + /* Dump entries in the myacls array that weren't in the system acl. */ + for (i = 0; i < n; ++i) { + failure(" ACL entry missing from file: " + "type=%d,permset=%d,tag=%d,qual=%d,name=``%s''\n", + myacls[marker[i]].type, myacls[marker[i]].permset, + myacls[marker[i]].tag, myacls[marker[i]].qual, + myacls[marker[i]].name); + assert(0); /* Record this as a failure. */ + } + free(marker); +} + +#endif + + +/* + * Verify ACL restore-to-disk. This test is FreeBSD-specific. + */ + +DEFINE_TEST(test_acl_freebsd_posix1e) +{ +#if !defined(__FreeBSD__) + skipping("FreeBSD-specific ACL restore test"); +#elif __FreeBSD__ < 5 + skipping("ACL restore supported only on FreeBSD 5.0 and later"); +#else + struct stat st; + struct archive *a; + struct archive_entry *ae; + int n, fd; + acl_t acl; + + /* + * First, do a quick manual set/read of ACL data to + * verify that the local filesystem does support ACLs. + * If it doesn't, we'll simply skip the remaining tests. + */ + acl = acl_from_text("u::rwx,u:1:rw,g::rwx,g:15:rx,o::rwx,m::rwx"); + assert((void *)acl != NULL); + /* Create a test file and try to set an ACL on it. */ + fd = open("pretest", O_WRONLY | O_CREAT | O_EXCL, 0777); + failure("Could not create test file?!"); + if (!assert(fd >= 0)) { + acl_free(acl); + return; + } + + n = acl_set_fd(fd, acl); + acl_free(acl); + if (n != 0 && errno == EOPNOTSUPP) { + close(fd); + skipping("ACL tests require that ACL support be enabled on the filesystem"); + return; + } + if (n != 0 && errno == EINVAL) { + close(fd); + skipping("This filesystem does not support POSIX.1e ACLs"); + return; + } + failure("acl_set_fd(): errno = %d (%s)", + errno, strerror(errno)); + assertEqualInt(0, n); + close(fd); + + /* Create a write-to-disk object. */ + assert(NULL != (a = archive_write_disk_new())); + archive_write_disk_set_options(a, + ARCHIVE_EXTRACT_TIME | ARCHIVE_EXTRACT_PERM | ARCHIVE_EXTRACT_ACL); + + /* Populate an archive entry with some metadata, including ACL info */ + ae = archive_entry_new(); + assert(ae != NULL); + archive_entry_set_pathname(ae, "test0"); + archive_entry_set_mtime(ae, 123456, 7890); + archive_entry_set_size(ae, 0); + set_acls(ae, acls2); + assertEqualIntA(a, ARCHIVE_OK, archive_write_header(a, ae)); + archive_entry_free(ae); + + /* Close the archive. */ + assertEqualIntA(a, ARCHIVE_OK, archive_write_close(a)); + assertEqualInt(ARCHIVE_OK, archive_write_free(a)); + + /* Verify the data on disk. */ + assertEqualInt(0, stat("test0", &st)); + assertEqualInt(st.st_mtime, 123456); + acl = acl_get_file("test0", ACL_TYPE_ACCESS); + assert(acl != (acl_t)NULL); + compare_acls(acl, acls2); + acl_free(acl); +#endif +} diff --git a/libarchive/test/test_acl_nfs4.c b/libarchive/test/test_acl_nfs4.c index ebf9a4656ba5..c8f59371a52b 100644 --- a/libarchive/test/test_acl_nfs4.c +++ b/libarchive/test/test_acl_nfs4.c @@ -174,8 +174,11 @@ set_acls(struct archive_entry *ae, struct acl_t *acls, int n) } static int -acl_match(struct acl_t *acl, int type, int permset, int tag, int qual, const char *name) +acl_match(struct acl_t *acl, int type, int permset, int tag, int qual, + const char *name) { + if (acl == NULL) + return (0); if (type != acl->type) return (0); if (permset != acl->permset) @@ -193,10 +196,12 @@ acl_match(struct acl_t *acl, int type, int permset, int tag, int qual, const cha if (name == NULL) { if (acl->name == NULL || acl->name[0] == '\0') return (1); + return (0); } if (acl->name == NULL) { if (name[0] == '\0') return (1); + return (0); } return (0 == strcmp(name, acl->name)); } diff --git a/libarchive/test/test_acl_pax.c b/libarchive/test/test_acl_pax.c index 2bee4572cf7f..5150b11d63b5 100644 --- a/libarchive/test/test_acl_pax.c +++ b/libarchive/test/test_acl_pax.c @@ -184,7 +184,7 @@ DEFINE_TEST(test_acl_pax) /* Write an archive to memory. */ assert(NULL != (a = archive_write_new())); assertA(0 == archive_write_set_format_pax(a)); - assertA(0 == archive_write_set_compression_none(a)); + assertA(0 == archive_write_add_filter_none(a)); assertA(0 == archive_write_set_bytes_per_block(a, 1)); assertA(0 == archive_write_set_bytes_in_last_block(a, 1)); assertA(0 == archive_write_open_memory(a, buff, sizeof(buff), &used)); diff --git a/libarchive/test/test_acl_posix1e.c b/libarchive/test/test_acl_posix1e.c index 2055682bb2ab..9984d44188ee 100644 --- a/libarchive/test/test_acl_posix1e.c +++ b/libarchive/test/test_acl_posix1e.c @@ -137,10 +137,12 @@ acl_match(struct acl_t *acl, int type, int permset, int tag, int qual, const cha if (name == NULL) { if (acl->name == NULL || acl->name[0] == '\0') return (1); + return (0); } if (acl->name == NULL) { if (name[0] == '\0') return (1); + return (0); } return (0 == strcmp(name, acl->name)); } diff --git a/libarchive/test/test_archive_clear_error.c b/libarchive/test/test_archive_clear_error.c index 43265b5391b4..66dbe93ec9e8 100644 --- a/libarchive/test/test_archive_clear_error.c +++ b/libarchive/test/test_archive_clear_error.c @@ -38,5 +38,5 @@ DEFINE_TEST(test_archive_clear_error) assertEqualInt(0, archive_errno(a)); assertEqualString(NULL, archive_error_string(a)); - archive_read_finish(a); + archive_read_free(a); } diff --git a/libarchive/test/test_archive_cmdline.c b/libarchive/test/test_archive_cmdline.c new file mode 100644 index 000000000000..a411821356c9 --- /dev/null +++ b/libarchive/test/test_archive_cmdline.c @@ -0,0 +1,141 @@ +/*- + * Copyright (c) 2012 Michihiro NAKAJIMA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "test.h" +__FBSDID("$FreeBSD$"); + +#define __LIBARCHIVE_TEST +#include "archive_cmdline_private.h" + +DEFINE_TEST(test_archive_cmdline) +{ + struct archive_cmdline *cl; + + /* Command name only. */ + assert((cl = __archive_cmdline_allocate()) != NULL); + if (cl == NULL) + return; + assertEqualInt(ARCHIVE_OK, __archive_cmdline_parse(cl, "gzip")); + assertEqualInt(1, cl->argc); + assertEqualString("gzip", cl->path); + assertEqualString("gzip", cl->argv[0]); + assertEqualInt(ARCHIVE_OK, __archive_cmdline_free(cl)); + + assert((cl = __archive_cmdline_allocate()) != NULL); + if (cl == NULL) + return; + assertEqualInt(ARCHIVE_OK, __archive_cmdline_parse(cl, "gzip ")); + assertEqualInt(1, cl->argc); + failure("path should not include a space character"); + assertEqualString("gzip", cl->path); + failure("arg0 should not include a space character"); + assertEqualString("gzip", cl->argv[0]); + assertEqualInt(ARCHIVE_OK, __archive_cmdline_free(cl)); + + assert((cl = __archive_cmdline_allocate()) != NULL); + if (cl == NULL) + return; + assertEqualInt(ARCHIVE_OK, __archive_cmdline_parse(cl, + "/usr/bin/gzip ")); + assertEqualInt(1, cl->argc); + failure("path should be a full path"); + assertEqualString("/usr/bin/gzip", cl->path); + failure("arg0 should not be a full path"); + assertEqualString("gzip", cl->argv[0]); + assertEqualInt(ARCHIVE_OK, __archive_cmdline_free(cl)); + + /* A command line includes space characer. */ + assert((cl = __archive_cmdline_allocate()) != NULL); + if (cl == NULL) + return; + assertEqualInt(ARCHIVE_OK, __archive_cmdline_parse(cl, "\"gzip \"")); + assertEqualInt(1, cl->argc); + failure("path should include a space character"); + assertEqualString("gzip ", cl->path); + failure("arg0 should include a space character"); + assertEqualString("gzip ", cl->argv[0]); + assertEqualInt(ARCHIVE_OK, __archive_cmdline_free(cl)); + + /* A command line includes space characer: pattern 2.*/ + assert((cl = __archive_cmdline_allocate()) != NULL); + if (cl == NULL) + return; + assertEqualInt(ARCHIVE_OK, __archive_cmdline_parse(cl, "\"gzip \"x")); + assertEqualInt(1, cl->argc); + failure("path should include a space character"); + assertEqualString("gzip x", cl->path); + failure("arg0 should include a space character"); + assertEqualString("gzip x", cl->argv[0]); + assertEqualInt(ARCHIVE_OK, __archive_cmdline_free(cl)); + + /* A command line includes space characer: pattern 3.*/ + assert((cl = __archive_cmdline_allocate()) != NULL); + if (cl == NULL) + return; + assertEqualInt(ARCHIVE_OK, __archive_cmdline_parse(cl, + "\"gzip \"x\" s \"")); + assertEqualInt(1, cl->argc); + failure("path should include a space character"); + assertEqualString("gzip x s ", cl->path); + failure("arg0 should include a space character"); + assertEqualString("gzip x s ", cl->argv[0]); + assertEqualInt(ARCHIVE_OK, __archive_cmdline_free(cl)); + + /* A command line includes space characer: pattern 4.*/ + assert((cl = __archive_cmdline_allocate()) != NULL); + if (cl == NULL) + return; + assertEqualInt(ARCHIVE_OK, __archive_cmdline_parse(cl, + "\"gzip\\\" \"")); + assertEqualInt(1, cl->argc); + failure("path should include a space character"); + assertEqualString("gzip\" ", cl->path); + failure("arg0 should include a space character"); + assertEqualString("gzip\" ", cl->argv[0]); + assertEqualInt(ARCHIVE_OK, __archive_cmdline_free(cl)); + + /* A command name with a argument. */ + assert((cl = __archive_cmdline_allocate()) != NULL); + if (cl == NULL) + return; + assertEqualInt(ARCHIVE_OK, __archive_cmdline_parse(cl, "gzip -d")); + assertEqualInt(2, cl->argc); + assertEqualString("gzip", cl->path); + assertEqualString("gzip", cl->argv[0]); + assertEqualString("-d", cl->argv[1]); + assertEqualInt(ARCHIVE_OK, __archive_cmdline_free(cl)); + + /* A command name with two arguments. */ + assert((cl = __archive_cmdline_allocate()) != NULL); + if (cl == NULL) + return; + assertEqualInt(ARCHIVE_OK, __archive_cmdline_parse(cl, "gzip -d -q")); + assertEqualInt(3, cl->argc); + assertEqualString("gzip", cl->path); + assertEqualString("gzip", cl->argv[0]); + assertEqualString("-d", cl->argv[1]); + assertEqualString("-q", cl->argv[2]); + assertEqualInt(ARCHIVE_OK, __archive_cmdline_free(cl)); +} diff --git a/libarchive/test/test_archive_read_close_twice.c b/libarchive/test/test_archive_read_close_twice.c index d69054b4fe5a..16cc805fe027 100644 --- a/libarchive/test/test_archive_read_close_twice.c +++ b/libarchive/test/test_archive_read_close_twice.c @@ -39,5 +39,5 @@ DEFINE_TEST(test_archive_read_close_twice) assertEqualInt(0, archive_errno(a)); assertEqualString(NULL, archive_error_string(a)); - archive_read_finish(a); + archive_read_free(a); } 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 d30735e4c48b..3aba31791357 100644 --- a/libarchive/test/test_archive_read_close_twice_open_fd.c +++ b/libarchive/test/test_archive_read_close_twice_open_fd.c @@ -43,5 +43,5 @@ DEFINE_TEST(test_archive_read_close_twice_open_fd) assertEqualInt(0, archive_errno(a)); assertEqualString(NULL, archive_error_string(a)); - assertEqualInt(ARCHIVE_OK, archive_read_finish(a)); + assertEqualInt(ARCHIVE_OK, archive_read_free(a)); } 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 456b6d688e55..f82539117bcb 100644 --- a/libarchive/test/test_archive_read_close_twice_open_filename.c +++ b/libarchive/test/test_archive_read_close_twice_open_filename.c @@ -43,5 +43,5 @@ DEFINE_TEST(test_archive_read_close_twice_open_filename) assertEqualInt(0, archive_errno(a)); assertEqualString(NULL, archive_error_string(a)); - assertEqualInt(ARCHIVE_OK, archive_read_finish(a)); + assertEqualInt(ARCHIVE_OK, archive_read_free(a)); } diff --git a/libarchive/test/test_archive_read_multiple_data_objects.c b/libarchive/test/test_archive_read_multiple_data_objects.c new file mode 100644 index 000000000000..9962cf7fdf33 --- /dev/null +++ b/libarchive/test/test_archive_read_multiple_data_objects.c @@ -0,0 +1,372 @@ +/*- + * Copyright (c) 2011 Tim Kientzle + * Copyright (c) 2011-2012 Andres Mejia + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "test.h" +__FBSDID("$FreeBSD$"); + +#if defined(_WIN32) && !defined(__CYGWIN__) +#define open _open +#define close _close +#define read _read +#if !defined(__BORLANDC__) +#ifdef lseek +#undef lseek +#endif +#define lseek(f, o, w) _lseek(f, (long)(o), (int)(w)) +#endif +#endif + +static void +test_splitted_file(void) +{ + char buff[64]; + static const char *reffiles[] = + { + "test_read_splitted_rar_aa", + "test_read_splitted_rar_ab", + "test_read_splitted_rar_ac", + "test_read_splitted_rar_ad", + NULL + }; + const char test_txt[] = "test text document\r\n"; + int size = sizeof(test_txt)-1; + 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)); + assertEqualString("test.txt", archive_entry_pathname(ae)); + assertA((int)archive_entry_mtime(ae)); + assertA((int)archive_entry_ctime(ae)); + assertA((int)archive_entry_atime(ae)); + assertEqualInt(20, archive_entry_size(ae)); + assertEqualInt(33188, archive_entry_mode(ae)); + assertA(size == archive_read_data(a, buff, size)); + assertEqualMem(buff, test_txt, size); + + /* Second header. */ + assertA(0 == archive_read_next_header(a, &ae)); + assertEqualString("testlink", archive_entry_pathname(ae)); + assertA((int)archive_entry_mtime(ae)); + assertA((int)archive_entry_ctime(ae)); + assertA((int)archive_entry_atime(ae)); + assertEqualInt(0, archive_entry_size(ae)); + assertEqualInt(41471, archive_entry_mode(ae)); + assertEqualString("test.txt", archive_entry_symlink(ae)); + assertEqualIntA(a, 0, archive_read_data(a, buff, sizeof(buff))); + + /* Third header. */ + assertA(0 == archive_read_next_header(a, &ae)); + assertEqualString("testdir/test.txt", archive_entry_pathname(ae)); + assertA((int)archive_entry_mtime(ae)); + assertA((int)archive_entry_ctime(ae)); + assertA((int)archive_entry_atime(ae)); + assertEqualInt(20, archive_entry_size(ae)); + assertEqualInt(33188, archive_entry_mode(ae)); + assertA(size == archive_read_data(a, buff, size)); + assertEqualMem(buff, test_txt, size); + + /* Fourth header. */ + assertA(0 == archive_read_next_header(a, &ae)); + assertEqualString("testdir", archive_entry_pathname(ae)); + assertA((int)archive_entry_mtime(ae)); + assertA((int)archive_entry_ctime(ae)); + assertA((int)archive_entry_atime(ae)); + assertEqualInt(0, archive_entry_size(ae)); + assertEqualInt(16877, archive_entry_mode(ae)); + + /* Fifth header. */ + assertA(0 == archive_read_next_header(a, &ae)); + assertEqualString("testemptydir", archive_entry_pathname(ae)); + assertA((int)archive_entry_mtime(ae)); + assertA((int)archive_entry_ctime(ae)); + assertA((int)archive_entry_atime(ae)); + assertEqualInt(0, archive_entry_size(ae)); + assertEqualInt(16877, archive_entry_mode(ae)); + + /* Test EOF */ + assertA(1 == archive_read_next_header(a, &ae)); + assertEqualInt(5, archive_file_count(a)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a)); + assertEqualInt(ARCHIVE_OK, archive_read_free(a)); +} + +static void +test_large_splitted_file(void) +{ + static const char *reffiles[] = + { + "test_read_large_splitted_rar_aa", + "test_read_large_splitted_rar_ab", + "test_read_large_splitted_rar_ac", + "test_read_large_splitted_rar_ad", + "test_read_large_splitted_rar_ae", + NULL + }; + const char test_txt[] = "gin-bottom: 0in\">
\n

\n\n"; + int size = 241647978, offset = 0; + char buff[64]; + 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)); + assertEqualString("ppmd_lzss_conversion_test.txt", + archive_entry_pathname(ae)); + assertA((int)archive_entry_mtime(ae)); + assertA((int)archive_entry_ctime(ae)); + assertA((int)archive_entry_atime(ae)); + assertEqualInt(size, archive_entry_size(ae)); + assertEqualInt(33188, archive_entry_mode(ae)); + while (offset + (int)sizeof(buff) < size) + { + assertA(sizeof(buff) == archive_read_data(a, buff, sizeof(buff))); + offset += sizeof(buff); + } + assertA(size - offset == archive_read_data(a, buff, size - offset)); + assertEqualMem(buff, test_txt, size - offset); + + /* Test EOF */ + assertA(1 == archive_read_next_header(a, &ae)); + assertEqualInt(1, archive_file_count(a)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a)); + assertEqualInt(ARCHIVE_OK, archive_read_free(a)); +} + +#define BLOCK_SIZE 10240 +struct mydata { + char *filename; + void *buffer; + int fd; +}; + +static int +file_open(struct archive *a, void *data) +{ + struct mydata *mydata = (struct mydata *)data; + (void)a; + if (mydata->fd < 0) + { + mydata->fd = open(mydata->filename, O_RDONLY | O_BINARY); + if (mydata->fd >= 0) + { + if ((mydata->buffer = (void*)calloc(1, BLOCK_SIZE)) == NULL) + return (ARCHIVE_FAILED); + } + } + return (ARCHIVE_OK); +} +static ssize_t +file_read(struct archive *a, void *data, const void **buff) +{ + struct mydata *mydata = (struct mydata *)data; + (void)a; + *buff = mydata->buffer; + return read(mydata->fd, mydata->buffer, BLOCK_SIZE); +} +static int64_t +file_skip(struct archive *a, void *data, int64_t request) +{ + struct mydata *mydata = (struct mydata *)data; + int64_t result = lseek(mydata->fd, SEEK_CUR, request); + if (result >= 0) + return result; + archive_set_error(a, errno, "Error seeking in '%s'", mydata->filename); + return -1; +} +static int +file_switch(struct archive *a, void *data1, void *data2) +{ + struct mydata *mydata1 = (struct mydata *)data1; + struct mydata *mydata2 = (struct mydata *)data2; + int r = (ARCHIVE_OK); + + (void)a; + if (mydata1 && mydata1->fd >= 0) + { + close(mydata1->fd); + free(mydata1->buffer); + mydata1->buffer = NULL; + mydata1->fd = -1; + } + if (mydata2) + { + r = file_open(a, mydata2); + } + return (r); +} +static int +file_close(struct archive *a, void *data) +{ + struct mydata *mydata = (struct mydata *)data; + if (mydata == NULL) + return (ARCHIVE_FATAL); + file_switch(a, mydata, NULL); + free(mydata->filename); + free(mydata); + return (ARCHIVE_OK); +} +static int64_t +file_seek(struct archive *a, void *data, int64_t request, int whence) +{ + struct mydata *mine = (struct mydata *)data; + int64_t r; + + (void)a; + r = lseek(mine->fd, request, whence); + if (r >= 0) + return r; + return (ARCHIVE_FATAL); +} + +static void +test_customized_multiple_data_objects(void) +{ + char buff[64]; + static const char *reffiles[] = + { + "test_read_splitted_rar_aa", + "test_read_splitted_rar_ab", + "test_read_splitted_rar_ac", + "test_read_splitted_rar_ad", + NULL + }; + const char test_txt[] = "test text document\r\n"; + int size = sizeof(test_txt)-1; + struct archive_entry *ae; + struct archive *a; + struct mydata *mydata; + const char *filename = *reffiles; + int i; + + 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)); + + for (i = 0; filename != NULL;) + { + assert((mydata = (struct mydata *)calloc(1, sizeof(*mydata))) != NULL); + if (mydata == NULL) { + assertEqualInt(ARCHIVE_OK, archive_read_free(a)); + return; + } + assert((mydata->filename = + (char *)calloc(1, strlen(filename) + 1)) != NULL); + if (mydata->filename == NULL) { + free(mydata); + assertEqualInt(ARCHIVE_OK, archive_read_free(a)); + return; + } + strcpy(mydata->filename, filename); + mydata->fd = -1; + filename = reffiles[++i]; + assertA(0 == archive_read_append_callback_data(a, mydata)); + } + assertA(0 == archive_read_set_open_callback(a, file_open)); + assertA(0 == archive_read_set_read_callback(a, file_read)); + assertA(0 == archive_read_set_skip_callback(a, file_skip)); + assertA(0 == archive_read_set_close_callback(a, file_close)); + assertA(0 == archive_read_set_switch_callback(a, file_switch)); + assertA(0 == archive_read_set_seek_callback(a, file_seek)); + assertA(0 == archive_read_open1(a)); + + /* First header. */ + assertA(0 == archive_read_next_header(a, &ae)); + assertEqualString("test.txt", archive_entry_pathname(ae)); + assertA((int)archive_entry_mtime(ae)); + assertA((int)archive_entry_ctime(ae)); + assertA((int)archive_entry_atime(ae)); + assertEqualInt(20, archive_entry_size(ae)); + assertEqualInt(33188, archive_entry_mode(ae)); + assertA(size == archive_read_data(a, buff, size)); + assertEqualMem(buff, test_txt, size); + + /* Second header. */ + assertA(0 == archive_read_next_header(a, &ae)); + assertEqualString("testlink", archive_entry_pathname(ae)); + assertA((int)archive_entry_mtime(ae)); + assertA((int)archive_entry_ctime(ae)); + assertA((int)archive_entry_atime(ae)); + assertEqualInt(0, archive_entry_size(ae)); + assertEqualInt(41471, archive_entry_mode(ae)); + assertEqualString("test.txt", archive_entry_symlink(ae)); + assertEqualIntA(a, 0, archive_read_data(a, buff, sizeof(buff))); + + /* Third header. */ + assertA(0 == archive_read_next_header(a, &ae)); + assertEqualString("testdir/test.txt", archive_entry_pathname(ae)); + assertA((int)archive_entry_mtime(ae)); + assertA((int)archive_entry_ctime(ae)); + assertA((int)archive_entry_atime(ae)); + assertEqualInt(20, archive_entry_size(ae)); + assertEqualInt(33188, archive_entry_mode(ae)); + assertA(size == archive_read_data(a, buff, size)); + assertEqualMem(buff, test_txt, size); + + /* Fourth header. */ + assertA(0 == archive_read_next_header(a, &ae)); + assertEqualString("testdir", archive_entry_pathname(ae)); + assertA((int)archive_entry_mtime(ae)); + assertA((int)archive_entry_ctime(ae)); + assertA((int)archive_entry_atime(ae)); + assertEqualInt(0, archive_entry_size(ae)); + assertEqualInt(16877, archive_entry_mode(ae)); + + /* Fifth header. */ + assertA(0 == archive_read_next_header(a, &ae)); + assertEqualString("testemptydir", archive_entry_pathname(ae)); + assertA((int)archive_entry_mtime(ae)); + assertA((int)archive_entry_ctime(ae)); + assertA((int)archive_entry_atime(ae)); + assertEqualInt(0, archive_entry_size(ae)); + assertEqualInt(16877, archive_entry_mode(ae)); + + /* Test EOF */ + assertA(1 == archive_read_next_header(a, &ae)); + assertEqualInt(5, archive_file_count(a)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a)); + assertEqualInt(ARCHIVE_OK, archive_read_free(a)); +} + +DEFINE_TEST(test_archive_read_multiple_data_objects) +{ + test_splitted_file(); + test_large_splitted_file(); + test_customized_multiple_data_objects(); +} diff --git a/libarchive/test/test_archive_read_set_filter_option.c b/libarchive/test/test_archive_read_set_filter_option.c index 7ff3c267947d..31d575fc737e 100644 --- a/libarchive/test/test_archive_read_set_filter_option.c +++ b/libarchive/test/test_archive_read_set_filter_option.c @@ -45,7 +45,7 @@ test(int pristine) should(a, ARCHIVE_FAILED, "fubar", "snafu", NULL); should(a, ARCHIVE_FAILED, "fubar", "snafu", "betcha"); - archive_read_finish(a); + archive_read_free(a); } DEFINE_TEST(test_archive_read_set_filter_option) diff --git a/libarchive/test/test_archive_read_set_format_option.c b/libarchive/test/test_archive_read_set_format_option.c index e1aac574e158..2d7acf3a0aa4 100644 --- a/libarchive/test/test_archive_read_set_format_option.c +++ b/libarchive/test/test_archive_read_set_format_option.c @@ -57,7 +57,7 @@ test(int pristine) should(a, known_option_rv, NULL, "joliet", NULL); should(a, known_option_rv, NULL, "joliet", NULL); - archive_read_finish(a); + archive_read_free(a); } DEFINE_TEST(test_archive_read_set_format_option) diff --git a/libarchive/test/test_archive_read_set_option.c b/libarchive/test/test_archive_read_set_option.c index 2ad5b0bda8e2..0b816b7cd838 100644 --- a/libarchive/test/test_archive_read_set_option.c +++ b/libarchive/test/test_archive_read_set_option.c @@ -59,7 +59,7 @@ test(int pristine) should(a, known_option_rv, NULL, "joliet", NULL); should(a, known_option_rv, NULL, "joliet", NULL); - archive_read_finish(a); + archive_read_free(a); } DEFINE_TEST(test_archive_read_set_option) diff --git a/libarchive/test/test_archive_read_set_options.c b/libarchive/test/test_archive_read_set_options.c index 297d8fe8bf8f..a8c68d7dd4cf 100644 --- a/libarchive/test/test_archive_read_set_options.c +++ b/libarchive/test/test_archive_read_set_options.c @@ -116,7 +116,7 @@ test(int pristine) archive_error_string(a)); } - archive_read_finish(a); + archive_read_free(a); } DEFINE_TEST(test_archive_read_set_options) diff --git a/libarchive/test/test_archive_set_error.c b/libarchive/test/test_archive_set_error.c index 18897fbda8d2..b83c08c884e9 100644 --- a/libarchive/test/test_archive_set_error.c +++ b/libarchive/test/test_archive_set_error.c @@ -47,5 +47,5 @@ DEFINE_TEST(test_archive_set_error) test(a, -1, "tuvw"); test(a, 34, "XYZ"); - archive_read_finish(a); + archive_read_free(a); } diff --git a/libarchive/test/test_archive_write_add_filter_by_name.c b/libarchive/test/test_archive_write_add_filter_by_name.c new file mode 100644 index 000000000000..ff5ca5b1d471 --- /dev/null +++ b/libarchive/test/test_archive_write_add_filter_by_name.c @@ -0,0 +1,194 @@ +/*- + * Copyright (c) 2012 Michihiro NAKAJIMA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + + +#include "test.h" +__FBSDID("$FreeBSD$"); + +static void +test_filter_by_name(const char *filter_name, int filter_code, + int (*can_filter_prog)(void)) +{ + struct archive_entry *ae; + struct archive *a; + size_t used; + size_t buffsize = 1024 * 128; + char *buff; + int r; + + assert((buff = malloc(buffsize)) != NULL); + if (buff == NULL) + return; + + /* Create a new archive in memory. */ + assert((a = archive_write_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_write_set_format_ustar(a)); + r = archive_write_add_filter_by_name(a, filter_name); + if (r == ARCHIVE_WARN) { + if (!can_filter_prog()) { + skipping("%s filter not suported on this platform", + filter_name); + assertEqualInt(ARCHIVE_OK, archive_write_free(a)); + free(buff); + return; + } + } else if (r == ARCHIVE_FATAL && + (strcmp(archive_error_string(a), + "lzma compression not supported on this platform") == 0 || + strcmp(archive_error_string(a), + "xz compression not supported on this platform") == 0)) { + skipping("%s filter not suported on this platform", filter_name); + assertEqualInt(ARCHIVE_OK, archive_write_free(a)); + free(buff); + return; + } else { + if (!assertEqualIntA(a, ARCHIVE_OK, r)) { + assertEqualInt(ARCHIVE_OK, archive_write_free(a)); + free(buff); + return; + } + } + assertEqualIntA(a, ARCHIVE_OK, archive_write_set_bytes_per_block(a, 10)); + assertEqualIntA(a, ARCHIVE_OK, + archive_write_open_memory(a, buff, buffsize, &used)); + + /* + * Write a file to it. + */ + assert((ae = archive_entry_new()) != NULL); + archive_entry_set_mtime(ae, 1, 0); + assertEqualInt(1, archive_entry_mtime(ae)); + archive_entry_set_ctime(ae, 1, 0); + assertEqualInt(1, archive_entry_ctime(ae)); + archive_entry_set_atime(ae, 1, 0); + assertEqualInt(1, archive_entry_atime(ae)); + archive_entry_copy_pathname(ae, "file"); + assertEqualString("file", archive_entry_pathname(ae)); + archive_entry_set_mode(ae, AE_IFREG | 0755); + assertEqualInt((AE_IFREG | 0755), archive_entry_mode(ae)); + archive_entry_set_size(ae, 8); + assertEqualInt(0, archive_write_header(a, ae)); + archive_entry_free(ae); + assertEqualInt(8, archive_write_data(a, "12345678", 8)); + + /* Close out the archive. */ + assertEqualIntA(a, ARCHIVE_OK, archive_write_close(a)); + assertEqualInt(ARCHIVE_OK, archive_write_free(a)); + + /* + * Now, read the data back. + */ + assert((a = archive_read_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_support_filter_all(a)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_open_memory(a, buff, used)); + + /* + * Read and verify the file. + */ + assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); + assertEqualInt(1, archive_entry_mtime(ae)); + assertEqualString("file", archive_entry_pathname(ae)); + assertEqualInt(AE_IFREG, archive_entry_filetype(ae)); + assertEqualInt(8, archive_entry_size(ae)); + + /* Verify the end of the archive. */ + assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae)); + + /* Verify archive format. */ + assertEqualIntA(a, filter_code, archive_filter_code(a, 0)); + assertEqualIntA(a, ARCHIVE_FORMAT_TAR_USTAR, archive_format(a)); + + assertEqualInt(ARCHIVE_OK, archive_read_close(a)); + assertEqualInt(ARCHIVE_OK, archive_read_free(a)); + free(buff); +} + +static int +canAlways(void) +{ + return 1; +} + +static int +cannot(void) +{ + return 0; +} + +DEFINE_TEST(test_archive_write_add_filter_by_name_b64encode) +{ + test_filter_by_name("b64encode", ARCHIVE_FILTER_UU, canAlways); +} + +DEFINE_TEST(test_archive_write_add_filter_by_name_bzip2) +{ + test_filter_by_name("bzip2", ARCHIVE_FILTER_BZIP2, canBzip2); +} + +DEFINE_TEST(test_archive_write_add_filter_by_name_compress) +{ + test_filter_by_name("compress", ARCHIVE_FILTER_COMPRESS, canAlways); +} + +DEFINE_TEST(test_archive_write_add_filter_by_name_grzip) +{ + test_filter_by_name("grzip", ARCHIVE_FILTER_GRZIP, canGrzip); +} + +DEFINE_TEST(test_archive_write_add_filter_by_name_gzip) +{ + test_filter_by_name("gzip", ARCHIVE_FILTER_GZIP, canGzip); +} + +DEFINE_TEST(test_archive_write_add_filter_by_name_lrzip) +{ + test_filter_by_name("lrzip", ARCHIVE_FILTER_LRZIP, canLrzip); +} + +DEFINE_TEST(test_archive_write_add_filter_by_name_lzip) +{ + test_filter_by_name("lzip", ARCHIVE_FILTER_LZIP, cannot); +} + +DEFINE_TEST(test_archive_write_add_filter_by_name_lzma) +{ + test_filter_by_name("lzma", ARCHIVE_FILTER_LZMA, cannot); +} + +DEFINE_TEST(test_archive_write_add_filter_by_name_lzop) +{ + test_filter_by_name("lzop", ARCHIVE_FILTER_LZOP, canLzop); +} + +DEFINE_TEST(test_archive_write_add_filter_by_name_uuencode) +{ + test_filter_by_name("uuencode", ARCHIVE_FILTER_UU, canAlways); +} + +DEFINE_TEST(test_archive_write_add_filter_by_name_xz) +{ + test_filter_by_name("xz", ARCHIVE_FILTER_XZ, cannot); +} diff --git a/libarchive/test/test_archive_write_set_filter_option.c b/libarchive/test/test_archive_write_set_filter_option.c index 87a3e5350bd4..ab8e67773b50 100644 --- a/libarchive/test/test_archive_write_set_filter_option.c +++ b/libarchive/test/test_archive_write_set_filter_option.c @@ -35,7 +35,7 @@ test(int pristine) struct archive* a = archive_write_new(); if (!pristine) - archive_write_set_compression_gzip(a); + archive_write_add_filter_gzip(a); should(a, ARCHIVE_OK, NULL, NULL, NULL); should(a, ARCHIVE_OK, "", "", ""); @@ -45,7 +45,7 @@ test(int pristine) should(a, ARCHIVE_FAILED, "fubar", "snafu", NULL); should(a, ARCHIVE_FAILED, "fubar", "snafu", "betcha"); - archive_write_finish(a); + archive_write_free(a); } DEFINE_TEST(test_archive_write_set_filter_option) diff --git a/libarchive/test/test_archive_write_set_format_by_name.c b/libarchive/test/test_archive_write_set_format_by_name.c new file mode 100644 index 000000000000..b5fad2ab6c78 --- /dev/null +++ b/libarchive/test/test_archive_write_set_format_by_name.c @@ -0,0 +1,285 @@ +/*- + * Copyright (c) 2012 Michihiro NAKAJIMA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + + +#include "test.h" +__FBSDID("$FreeBSD$"); + +static void +test_format_by_name(const char *format_name, const char *compression_type, + int format_id, int dot_stored, const void *image, size_t image_size) +{ + struct archive_entry *ae; + struct archive *a; + size_t used; + size_t buffsize = 1024 * 1024; + char *buff; + int r; + + assert((buff = malloc(buffsize)) != NULL); + if (buff == NULL) + return; + + /* Create a new archive in memory. */ + assert((a = archive_write_new()) != NULL); + r = archive_write_set_format_by_name(a, format_name); + if (r == ARCHIVE_WARN) { + skipping("%s format not fully supported on this platform", + compression_type); + assertEqualInt(ARCHIVE_OK, archive_write_free(a)); + free(buff); + return; + } + assertEqualIntA(a, ARCHIVE_OK, r); + if (compression_type != NULL && + ARCHIVE_OK != archive_write_set_format_option(a, format_name, + "compression", compression_type)) { + skipping("%s writing not fully supported on this platform", + compression_type); + assertEqualInt(ARCHIVE_OK, archive_write_free(a)); + free(buff); + return; + } + assertEqualIntA(a, ARCHIVE_OK, archive_write_add_filter_none(a)); + assertEqualIntA(a, ARCHIVE_OK, + archive_write_open_memory(a, buff, buffsize, &used)); + + /* + * Write a file to it. + */ + assert((ae = archive_entry_new()) != NULL); + archive_entry_set_mtime(ae, 1, 0); + assertEqualInt(1, archive_entry_mtime(ae)); + archive_entry_set_ctime(ae, 1, 0); + assertEqualInt(1, archive_entry_ctime(ae)); + archive_entry_set_atime(ae, 1, 0); + assertEqualInt(1, archive_entry_atime(ae)); + archive_entry_copy_pathname(ae, "file"); + assertEqualString("file", archive_entry_pathname(ae)); + archive_entry_set_mode(ae, AE_IFREG | 0755); + assertEqualInt((AE_IFREG | 0755), archive_entry_mode(ae)); + archive_entry_set_size(ae, 8); + assertEqualInt(0, archive_write_header(a, ae)); + archive_entry_free(ae); + assertEqualInt(8, archive_write_data(a, "12345678", 8)); + + /* Close out the archive. */ + assertEqualIntA(a, ARCHIVE_OK, archive_write_close(a)); + assertEqualInt(ARCHIVE_OK, archive_write_free(a)); + + if (image && image_size > 0) { + assertEqualMem(buff, image, image_size); + } + if (format_id > 0) { + /* + * Now, read the data back. + */ + /* With the test memory reader -- seeking mode. */ + assert((a = archive_read_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, + archive_read_support_format_all(a)); + assertEqualIntA(a, ARCHIVE_OK, + archive_read_support_filter_all(a)); + assertEqualIntA(a, ARCHIVE_OK, + read_open_memory_seek(a, buff, used, 7)); + + if (dot_stored & 1) { + assertEqualIntA(a, ARCHIVE_OK, + archive_read_next_header(a, &ae)); + assertEqualString(".", archive_entry_pathname(ae)); + assertEqualInt(AE_IFDIR, archive_entry_filetype(ae)); + } + /* + * Read and verify the file. + */ + assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); + assertEqualInt(1, archive_entry_mtime(ae)); + if (dot_stored & 2) { + assertEqualString("./file", archive_entry_pathname(ae)); + } else { + assertEqualString("file", archive_entry_pathname(ae)); + } + assertEqualInt(AE_IFREG, archive_entry_filetype(ae)); + assertEqualInt(8, archive_entry_size(ae)); + + /* Verify the end of the 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, format_id, archive_format(a)); + + assertEqualInt(ARCHIVE_OK, archive_read_close(a)); + assertEqualInt(ARCHIVE_OK, archive_read_free(a)); + } + free(buff); +} + +DEFINE_TEST(test_archive_write_set_format_by_name_7zip) +{ + test_format_by_name("7zip", "copy", ARCHIVE_FORMAT_7ZIP, 0, + "\x37\x7a\xbc\xaf\x27\x1c\x00\x03", 8); +} + +DEFINE_TEST(test_archive_write_set_format_by_name_ar) +{ + test_format_by_name("ar", NULL, ARCHIVE_FORMAT_AR, 0, NULL, 0); +} + +DEFINE_TEST(test_archive_write_set_format_by_name_arbsd) +{ + test_format_by_name("arbsd", NULL, ARCHIVE_FORMAT_AR, 0, NULL, 0); +} + +DEFINE_TEST(test_archive_write_set_format_by_name_argnu) +{ + test_format_by_name("argnu", NULL, ARCHIVE_FORMAT_AR_GNU, 0, NULL, 0); +} + +DEFINE_TEST(test_archive_write_set_format_by_name_arsvr4) +{ + test_format_by_name("arsvr4", NULL, ARCHIVE_FORMAT_AR_GNU, 0, NULL, 0); +} + +DEFINE_TEST(test_archive_write_set_format_by_name_bsdtar) +{ + test_format_by_name("bsdtar", NULL, ARCHIVE_FORMAT_TAR_USTAR, 0, NULL, 0); +} + +DEFINE_TEST(test_archive_write_set_format_by_name_cd9660) +{ + test_format_by_name("cd9660", NULL, ARCHIVE_FORMAT_ISO9660_ROCKRIDGE, 1, + NULL, 0); +} + +DEFINE_TEST(test_archive_write_set_format_by_name_cpio) +{ + test_format_by_name("cpio", NULL, ARCHIVE_FORMAT_CPIO_POSIX, 0, NULL, 0); +} + +DEFINE_TEST(test_archive_write_set_format_by_name_gnutar) +{ + test_format_by_name("gnutar", NULL, ARCHIVE_FORMAT_TAR_GNUTAR, 0, + NULL, 0); +} + +DEFINE_TEST(test_archive_write_set_format_by_name_iso) +{ + test_format_by_name("iso", NULL, ARCHIVE_FORMAT_ISO9660_ROCKRIDGE, 1, + NULL, 0); +} + +DEFINE_TEST(test_archive_write_set_format_by_name_iso9660) +{ + test_format_by_name("iso9660", NULL, ARCHIVE_FORMAT_ISO9660_ROCKRIDGE, 1, + NULL, 0); +} + +DEFINE_TEST(test_archive_write_set_format_by_name_mtree) +{ + test_format_by_name("mtree", NULL, ARCHIVE_FORMAT_MTREE, 2, NULL, 0); +} + +DEFINE_TEST(test_archive_write_set_format_by_name_mtree_classic) +{ + test_format_by_name("mtree-classic", NULL, ARCHIVE_FORMAT_MTREE, 1, + NULL, 0); +} + +DEFINE_TEST(test_archive_write_set_format_by_name_newc) +{ + test_format_by_name("newc", NULL, ARCHIVE_FORMAT_CPIO_SVR4_NOCRC, 0, + NULL, 0); +} + +DEFINE_TEST(test_archive_write_set_format_by_name_odc) +{ + test_format_by_name("odc", NULL, ARCHIVE_FORMAT_CPIO_POSIX, 0, NULL, 0); +} + +DEFINE_TEST(test_archive_write_set_format_by_name_oldtar) +{ + test_format_by_name("oldtar", NULL, ARCHIVE_FORMAT_TAR, 0, NULL, 0); +} + +DEFINE_TEST(test_archive_write_set_format_by_name_pax) +{ + test_format_by_name("pax", NULL, ARCHIVE_FORMAT_TAR_PAX_INTERCHANGE, 0, + NULL, 0); +} + +DEFINE_TEST(test_archive_write_set_format_by_name_paxr) +{ + test_format_by_name("paxr", NULL, ARCHIVE_FORMAT_TAR_USTAR, 0, NULL, 0); +} + +DEFINE_TEST(test_archive_write_set_format_by_name_posix) +{ + test_format_by_name("posix", NULL, ARCHIVE_FORMAT_TAR_PAX_INTERCHANGE, 0, + NULL, 0); +} + +DEFINE_TEST(test_archive_write_set_format_by_name_rpax) +{ + test_format_by_name("rpax", NULL, ARCHIVE_FORMAT_TAR_USTAR, 0, NULL, 0); +} + +DEFINE_TEST(test_archive_write_set_format_by_name_shar) +{ + test_format_by_name("shar", NULL, -1, 0, + "#!/bin/sh\n# This is a shell archive\n", 36); +} + +DEFINE_TEST(test_archive_write_set_format_by_name_shardump) +{ + test_format_by_name("shardump", NULL, -1, 0, + "#!/bin/sh\n# This is a shell archive\n", 36); +} + +DEFINE_TEST(test_archive_write_set_format_by_name_ustar) +{ + test_format_by_name("ustar", NULL, ARCHIVE_FORMAT_TAR_USTAR, 0, NULL, 0); +} + +DEFINE_TEST(test_archive_write_set_format_by_name_v7tar) +{ + test_format_by_name("v7tar", NULL, ARCHIVE_FORMAT_TAR, 0, NULL, 0); +} + +DEFINE_TEST(test_archive_write_set_format_by_name_v7) +{ + test_format_by_name("v7", NULL, ARCHIVE_FORMAT_TAR, 0, NULL, 0); +} + +DEFINE_TEST(test_archive_write_set_format_by_name_xar) +{ + test_format_by_name("xar", "gzip", ARCHIVE_FORMAT_XAR, 0, NULL, 0); +} + +DEFINE_TEST(test_archive_write_set_format_by_name_zip) +{ + test_format_by_name("zip", "store", ARCHIVE_FORMAT_ZIP, 0, NULL, 0); +} diff --git a/libarchive/test/test_archive_write_set_format_option.c b/libarchive/test/test_archive_write_set_format_option.c index ee53ca4c39d2..d964df44d7fa 100644 --- a/libarchive/test/test_archive_write_set_format_option.c +++ b/libarchive/test/test_archive_write_set_format_option.c @@ -57,7 +57,7 @@ test(int pristine) should(a, known_option_rv, NULL, "joliet", NULL); should(a, known_option_rv, NULL, "joliet", NULL); - archive_write_finish(a); + archive_write_free(a); } DEFINE_TEST(test_archive_write_set_format_option) diff --git a/libarchive/test/test_archive_write_set_option.c b/libarchive/test/test_archive_write_set_option.c index a7957ed7b266..27782342f330 100644 --- a/libarchive/test/test_archive_write_set_option.c +++ b/libarchive/test/test_archive_write_set_option.c @@ -36,7 +36,7 @@ test(int pristine) int known_option_rv = pristine ? ARCHIVE_FAILED : ARCHIVE_OK; if (!pristine) { - archive_write_set_compression_gzip(a); + archive_write_add_filter_gzip(a); archive_write_set_format_iso9660(a); } @@ -59,7 +59,7 @@ test(int pristine) should(a, known_option_rv, NULL, "joliet", NULL); should(a, known_option_rv, NULL, "joliet", NULL); - archive_write_finish(a); + archive_write_free(a); } DEFINE_TEST(test_archive_write_set_option) diff --git a/libarchive/test/test_archive_write_set_options.c b/libarchive/test/test_archive_write_set_options.c index 57aba98c18c9..db7e50e7f0f8 100644 --- a/libarchive/test/test_archive_write_set_options.c +++ b/libarchive/test/test_archive_write_set_options.c @@ -37,7 +37,7 @@ test(int pristine) int known_option_rv = pristine ? ARCHIVE_FAILED : ARCHIVE_OK; if (!pristine) { - archive_write_set_compression_gzip(a); + archive_write_add_filter_gzip(a); archive_write_set_format_iso9660(a); } @@ -116,7 +116,7 @@ test(int pristine) archive_error_string(a)); } - archive_write_finish(a); + archive_write_free(a); } DEFINE_TEST(test_archive_write_set_options) diff --git a/libarchive/test/test_compat_bzip2.c b/libarchive/test/test_compat_bzip2.c index d0726a1d36a0..7df086ff382d 100644 --- a/libarchive/test/test_compat_bzip2.c +++ b/libarchive/test/test_compat_bzip2.c @@ -67,13 +67,13 @@ compat_bzip2(const char *name) assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae)); /* Verify that the format detection worked. */ - assertEqualInt(archive_compression(a), ARCHIVE_COMPRESSION_BZIP2); - assertEqualString(archive_compression_name(a), "bzip2"); + assertEqualInt(archive_filter_code(a, 0), ARCHIVE_FILTER_BZIP2); + assertEqualString(archive_filter_name(a, 0), "bzip2"); assertEqualInt(archive_format(a), ARCHIVE_FORMAT_TAR_USTAR); assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a)); - assertEqualInt(archive_compression(a), ARCHIVE_COMPRESSION_BZIP2); - assertEqualString(archive_compression_name(a), "bzip2"); + assertEqualInt(archive_filter_code(a, 0), ARCHIVE_FILTER_BZIP2); + assertEqualString(archive_filter_name(a, 0), "bzip2"); assertEqualInt(archive_format(a), ARCHIVE_FORMAT_TAR_USTAR); assertEqualInt(ARCHIVE_OK, archive_read_free(a)); diff --git a/libarchive/test/test_compat_cpio.c b/libarchive/test/test_compat_cpio.c index e1e4e13997f6..0c8b04232521 100644 --- a/libarchive/test/test_compat_cpio.c +++ b/libarchive/test/test_compat_cpio.c @@ -90,7 +90,7 @@ test_compat_cpio_1(void) assertEqualInt(0100644, archive_entry_mode(ae)); /* Verify that the format detection worked. */ - assertEqualInt(archive_compression(a), ARCHIVE_COMPRESSION_NONE); + assertEqualInt(archive_filter_code(a, 0), ARCHIVE_FILTER_NONE); assertEqualInt(archive_format(a), ARCHIVE_FORMAT_CPIO_SVR4_NOCRC); assertEqualInt(ARCHIVE_OK, archive_read_close(a)); diff --git a/libarchive/test/test_compat_gtar.c b/libarchive/test/test_compat_gtar.c index f8f3ec06d280..3d5e456e56e6 100644 --- a/libarchive/test/test_compat_gtar.c +++ b/libarchive/test/test_compat_gtar.c @@ -99,7 +99,7 @@ test_compat_gtar_1(void) assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae)); /* Verify that the format detection worked. */ - assertEqualInt(archive_compression(a), ARCHIVE_COMPRESSION_NONE); + assertEqualInt(archive_filter_code(a, 0), ARCHIVE_FILTER_NONE); assertEqualInt(archive_format(a), ARCHIVE_FORMAT_TAR_GNUTAR); assertEqualInt(ARCHIVE_OK, archive_read_close(a)); diff --git a/libarchive/test/test_compat_gzip.c b/libarchive/test/test_compat_gzip.c index 885c681415ec..befb825c8ce6 100644 --- a/libarchive/test/test_compat_gzip.c +++ b/libarchive/test/test_compat_gzip.c @@ -74,8 +74,8 @@ verify(const char *name) assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae)); /* Verify that the format detection worked. */ - assertEqualInt(archive_compression(a), ARCHIVE_COMPRESSION_GZIP); - assertEqualString(archive_compression_name(a), "gzip"); + assertEqualInt(archive_filter_code(a, 0), ARCHIVE_FILTER_GZIP); + assertEqualString(archive_filter_name(a, 0), "gzip"); assertEqualInt(archive_format(a), ARCHIVE_FORMAT_TAR_USTAR); assertEqualInt(ARCHIVE_OK, archive_read_close(a)); diff --git a/libarchive/test/test_compat_lzip.c b/libarchive/test/test_compat_lzip.c index f474cd49e1d7..8f4e06d3af77 100644 --- a/libarchive/test/test_compat_lzip.c +++ b/libarchive/test/test_compat_lzip.c @@ -121,8 +121,8 @@ compat_lzip(const char *name) assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae)); /* Verify that the format detection worked. */ - assertEqualInt(archive_compression(a), ARCHIVE_COMPRESSION_LZIP); - assertEqualString(archive_compression_name(a), "lzip"); + 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)); diff --git a/libarchive/test/test_compat_lzma.c b/libarchive/test/test_compat_lzma.c index 8d37dd1879f6..86a2665b3518 100644 --- a/libarchive/test/test_compat_lzma.c +++ b/libarchive/test/test_compat_lzma.c @@ -130,8 +130,8 @@ compat_lzma(const char *name) assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae)); /* Verify that the format detection worked. */ - assertEqualInt(archive_compression(a), ARCHIVE_COMPRESSION_LZMA); - assertEqualString(archive_compression_name(a), "lzma"); + assertEqualInt(archive_filter_code(a, 0), ARCHIVE_FILTER_LZMA); + assertEqualString(archive_filter_name(a, 0), "lzma"); assertEqualInt(archive_format(a), ARCHIVE_FORMAT_TAR_USTAR); assertEqualInt(ARCHIVE_OK, archive_read_close(a)); diff --git a/libarchive/test/test_compat_lzop.c b/libarchive/test/test_compat_lzop.c new file mode 100644 index 000000000000..cd43afcf3e99 --- /dev/null +++ b/libarchive/test/test_compat_lzop.c @@ -0,0 +1,131 @@ +/*- + * Copyright (c) 2003-2008 Tim Kientzle + * Copyright (c) 2012 Michihiro NAKAJIMA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#include "test.h" +__FBSDID("$FreeBSD$"); + +/* + * Verify our ability to read sample files compatibly with lzop. + * + * In particular: + * * lzop will stop at the end of a stream if the following data + * doesn't start with a lzop signature. + * + */ + +DEFINE_TEST(test_compat_lzop) +{ + const char *sample1 = "test_compat_lzop_1.tar.lzo"; + const char *sample2 = "test_compat_lzop_2.tar.lzo"; + const char *sample3 = "test_compat_lzop_3.tar.lzo"; + struct archive_entry *ae; + struct archive *a; + int r; + + /* + * Test1: tar ball compressed in one block. + */ + assert((a = archive_read_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_read_support_filter_all(a)); + r = archive_read_support_filter_lzop(a); + if (r == ARCHIVE_WARN) { + skipping("lzop 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(sample1); + assertEqualIntA(a, ARCHIVE_OK, + archive_read_open_filename(a, sample1, 2)); + + assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); + assertEqualString("INSTALL", archive_entry_pathname(ae)); + + /* Verify the end-of-archive. */ + assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae)); + + /* Verify that the format detection worked. */ + assertEqualInt(archive_filter_code(a, 0), ARCHIVE_FILTER_LZOP); + assertEqualString(archive_filter_name(a, 0), "lzop"); + assertEqualInt(archive_format(a), ARCHIVE_FORMAT_TAR_USTAR); + + assertEqualInt(ARCHIVE_OK, archive_read_close(a)); + assertEqualInt(ARCHIVE_OK, archive_read_free(a)); + + /* + * Test2: tar ball compressed in multi blocks. + */ + assert((a = archive_read_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_read_support_filter_all(a)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a)); + extract_reference_file(sample2); + assertEqualIntA(a, ARCHIVE_OK, + archive_read_open_filename(a, sample2, 2)); + + assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); + assertEqualString("file1", archive_entry_pathname(ae)); + assertEqualInt(19, archive_entry_size(ae)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); + assertEqualString("file2", archive_entry_pathname(ae)); + assertEqualInt(262144, archive_entry_size(ae)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); + assertEqualString("file3", archive_entry_pathname(ae)); + assertEqualInt(19, archive_entry_size(ae)); + + /* Verify the end-of-archive. */ + assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae)); + + /* Verify that the format detection worked. */ + assertEqualInt(archive_filter_code(a, 0), ARCHIVE_FILTER_LZOP); + assertEqualString(archive_filter_name(a, 0), "lzop"); + assertEqualInt(archive_format(a), ARCHIVE_FORMAT_TAR_USTAR); + + assertEqualInt(ARCHIVE_OK, archive_read_close(a)); + assertEqualInt(ARCHIVE_OK, archive_read_free(a)); + + /* + * Test3: tar ball compressed in one block with junk data. + */ + assert((a = archive_read_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_read_support_filter_all(a)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a)); + extract_reference_file(sample3); + assertEqualIntA(a, ARCHIVE_OK, + archive_read_open_filename(a, sample3, 2)); + + assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); + assertEqualString("INSTALL", archive_entry_pathname(ae)); + + /* Verify the end-of-archive. */ + assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae)); + + /* Verify that the format detection worked. */ + assertEqualInt(archive_filter_code(a, 0), ARCHIVE_FILTER_LZOP); + assertEqualString(archive_filter_name(a, 0), "lzop"); + assertEqualInt(archive_format(a), ARCHIVE_FORMAT_TAR_USTAR); + + assertEqualInt(ARCHIVE_OK, archive_read_close(a)); + assertEqualInt(ARCHIVE_OK, archive_read_free(a)); +} diff --git a/libarchive/test/test_compat_lzop_1.tar.lzo.uu b/libarchive/test/test_compat_lzop_1.tar.lzo.uu new file mode 100644 index 000000000000..9eeca6a6c82c --- /dev/null +++ b/libarchive/test/test_compat_lzop_1.tar.lzo.uu @@ -0,0 +1,30 @@ +begin 664 test_compat_lzop_1.tar.lzo +MB4Q:3P`-"AH*$#`@8`E``04#```!``"!M%"`FEX`````%G1E2`H82?@"@-F'4"+"!T;PJL!`-W:71H(%AH +M;6!T!$UA8R!/4RQT%@$@8V%N)X`&+',,86YDO#.4(0(@+4<@(H0(`2(@?B\H +M;`D`#2UD;W=N;&]A9"UD:7(O"E1H92!R97-U;'0@=VEL;"!P=01P<')O<')I +M8"A\(I0F`BP@?!\#('1O;VPND!`!9&5F8780;VXP.Q$@:7-L +M*<0K`V4@36%K98P.=!)U(@IW(F%L2`H82?@"@-F'4"+"!T;PJL!`-W:71H(%AH +M;6!T!$UA8R!/4RQT%@$@8V%N)X`&+',,86YDO#.4(0(@+4<@(H0(`2(@?B\H +M;`D`#2UD;W=N;&]A9"UD:7(O"E1H92!R97-U;'0@=VEL;"!P=01P<')O<')I +M8"A\(I0F`BP@?!\#('1O;VPND!`!9&5F8780;VXP.Q$@:7-L +M*<0K`V4@36%K98P.=!)U(@IW(F%L/1A2\n" +"IHU\"0%9=*G4JUJM6K6+-JWO8,.*'4NVK-FS:-.J7st_atime, 456789); assertEqualInt(pst->st_ctime, 345678); @@ -717,33 +719,53 @@ DEFINE_TEST(test_entry) /* Changing any one value should update struct stat. */ archive_entry_set_atime(e, 456788, 0); assert((pst = archive_entry_stat(e)) != NULL); + if (pst == NULL) + return; assertEqualInt(pst->st_atime, 456788); archive_entry_set_ctime(e, 345677, 431); assert((pst = archive_entry_stat(e)) != NULL); + if (pst == NULL) + return; assertEqualInt(pst->st_ctime, 345677); archive_entry_set_dev(e, 122); assert((pst = archive_entry_stat(e)) != NULL); + if (pst == NULL) + return; assertEqualInt(pst->st_dev, 122); archive_entry_set_gid(e, 33); assert((pst = archive_entry_stat(e)) != NULL); + if (pst == NULL) + return; assertEqualInt(pst->st_gid, 33); archive_entry_set_ino(e, 233); assert((pst = archive_entry_stat(e)) != NULL); + if (pst == NULL) + return; assertEqualInt(pst->st_ino, 233); archive_entry_set_mode(e, 012344); assert((pst = archive_entry_stat(e)) != NULL); + if (pst == NULL) + return; assertEqualInt(pst->st_mode, 012344); archive_entry_set_mtime(e, 234566, 542); assert((pst = archive_entry_stat(e)) != NULL); + if (pst == NULL) + return; assertEqualInt(pst->st_mtime, 234566); archive_entry_set_nlink(e, 344); assert((pst = archive_entry_stat(e)) != NULL); + if (pst == NULL) + return; assertEqualInt(pst->st_nlink, 344); archive_entry_set_size(e, 123456788); assert((pst = archive_entry_stat(e)) != NULL); + if (pst == NULL) + return; assertEqualInt(pst->st_size, 123456788); archive_entry_set_uid(e, 22); assert((pst = archive_entry_stat(e)) != NULL); + if (pst == NULL) + return; assertEqualInt(pst->st_uid, 22); /* We don't need to check high-res fields here. */ diff --git a/libarchive/test/test_filter_count.c b/libarchive/test/test_filter_count.c index 175c88cc255a..4885ab89a52e 100644 --- a/libarchive/test/test_filter_count.c +++ b/libarchive/test/test_filter_count.c @@ -32,7 +32,10 @@ static void read_test(const char *name) { struct archive* a = archive_read_new(); - if(ARCHIVE_OK != archive_read_support_filter_bzip2(a)) { + int r; + + r = archive_read_support_filter_bzip2(a); + if((ARCHIVE_WARN == r && !canBzip2()) || ARCHIVE_WARN > r) { skipping("bzip2 unsupported"); return; } @@ -52,11 +55,13 @@ write_test(void) { char buff[4096]; struct archive* a = archive_write_new(); + int r; assertEqualIntA(a, ARCHIVE_OK, archive_write_set_format_ustar(a)); assertEqualIntA(a, ARCHIVE_OK, archive_write_set_bytes_per_block(a, 10)); - if(ARCHIVE_OK != archive_write_set_compression_bzip2(a)) { + r = archive_write_add_filter_bzip2(a); + if((ARCHIVE_WARN == r && !canBzip2()) || ARCHIVE_WARN > r) { skipping("bzip2 unsupported"); return; } diff --git a/libarchive/test/test_fuzz.c b/libarchive/test/test_fuzz.c index 78d941d1a8ac..cd8f7e0d5549 100644 --- a/libarchive/test/test_fuzz.c +++ b/libarchive/test/test_fuzz.c @@ -46,77 +46,29 @@ __FBSDID("$FreeBSD: head/lib/libarchive/test/test_fuzz.c 201247 2009-12-30 05:59 /* Because this works for any archive, we can just re-use the archives * developed for other tests. */ -static struct { +struct files { int uncompress; /* If 1, decompress the file before fuzzing. */ - const char *name; -} files[] = { - {0, "test_fuzz_1.iso.Z"}, /* Exercise compress decompressor. */ - {1, "test_fuzz_1.iso.Z"}, - {0, "test_fuzz.cab"}, - {0, "test_fuzz.lzh"}, - {0, "test_compat_bzip2_1.tbz"}, /* Exercise bzip2 decompressor. */ - {1, "test_compat_bzip2_1.tbz"}, - {0, "test_compat_gtar_1.tar"}, - {0, "test_compat_gzip_1.tgz"}, /* Exercise gzip decompressor. */ - {0, "test_compat_gzip_2.tgz"}, /* Exercise gzip decompressor. */ - {0, "test_compat_tar_hardlink_1.tar"}, - {0, "test_compat_xz_1.txz"}, /* Exercise xz decompressor. */ - {0, "test_compat_zip_1.zip"}, - {0, "test_read_format_7zip_bzip2.7z"}, - {0, "test_read_format_7zip_bcj_lzma1.7z"}, - {0, "test_read_format_7zip_bcj_lzma2.7z"}, - {0, "test_read_format_7zip_bcj2_lzma1_1.7z"}, - {0, "test_read_format_7zip_bcj2_lzma1_2.7z"}, - {0, "test_read_format_7zip_bcj2_lzma2_1.7z"}, - {0, "test_read_format_7zip_bcj2_lzma2_2.7z"}, - {0, "test_read_format_7zip_copy.7z"}, - {0, "test_read_format_7zip_deflate.7z"}, - {0, "test_read_format_7zip_lzma1.7z"}, - {0, "test_read_format_7zip_lzma1_lzma2.7z"}, - {0, "test_read_format_7zip_ppmd.7z"}, - {0, "test_read_format_ar.ar"}, - {0, "test_read_format_cpio_bin_be.cpio"}, - {0, "test_read_format_cpio_svr4_gzip_rpm.rpm"}, /* Test RPM unwrapper */ - {0, "test_read_format_rar.rar"}, /* Uncompressed RAR test */ - {0, "test_read_format_rar_binary_data.rar"}, /* RAR file with binary data */ - {0, "test_read_format_rar_compress_best.rar"}, /* Best Compressed RAR test */ - {0, "test_read_format_rar_compress_normal.rar"}, /* Normal Compressed RAR - * test */ - {0, "test_read_format_rar_multi_lzss_blocks.rar"}, /* Normal Compressed Multi - * LZSS blocks RAR test */ - {0, "test_read_format_rar_noeof.rar"}, /* RAR with no EOF header */ - {0, "test_read_format_rar_ppmd_lzss_conversion.rar"}, /* Best Compressed - * RAR file with both - * PPMd and LZSS - * blocks */ - {0, "test_read_format_rar_sfx.exe"}, /* RAR SFX archive */ - {0, "test_read_format_rar_subblock.rar"}, /* RAR with subblocks */ - {0, "test_read_format_rar_unicode.rar"}, /* RAR with Unicode filenames */ - {0, "test_read_format_gtar_sparse_1_17_posix10_modified.tar"}, - {0, "test_read_format_mtree.mtree"}, - {0, "test_read_format_tar_empty_filename.tar"}, - {0, "test_read_format_zip.zip"}, - {1, NULL} + const char **names; }; -DEFINE_TEST(test_fuzz) +static void +test_fuzz(const struct files *filesets) { const void *blk; size_t blk_size; int64_t blk_offset; int n; - for (n = 0; files[n].name != NULL; ++n) { + for (n = 0; filesets[n].names != NULL; ++n) { const size_t buffsize = 30000000; - const char *filename = files[n].name; struct archive_entry *ae; struct archive *a; - char *rawimage, *image; - size_t size; + char *rawimage = NULL, *image = NULL, *tmp = NULL; + size_t size = 0, oldsize = 0; int i, q; - extract_reference_file(filename); - if (files[n].uncompress) { + extract_reference_files(filesets[n].names); + if (filesets[n].uncompress) { int r; /* Use format_raw to decompress the data. */ assert((a = archive_read_new()) != NULL); @@ -124,10 +76,14 @@ DEFINE_TEST(test_fuzz) archive_read_support_filter_all(a)); assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_raw(a)); - r = archive_read_open_filename(a, filename, 16384); + r = archive_read_open_filenames(a, filesets[n].names, 16384); if (r != ARCHIVE_OK) { archive_read_free(a); - skipping("Cannot uncompress %s", filename); + if (filesets[n].names[0] == NULL || filesets[n].names[1] == NULL) { + skipping("Cannot uncompress fileset"); + } else { + skipping("Cannot uncompress %s", filesets[n].names[0]); + } continue; } assertEqualIntA(a, ARCHIVE_OK, @@ -139,19 +95,36 @@ DEFINE_TEST(test_fuzz) assertEqualInt(ARCHIVE_OK, archive_read_free(a)); assert(size > 0); - failure("Internal buffer is not big enough for " - "uncompressed test file: %s", filename); + if (filesets[n].names[0] == NULL || filesets[n].names[1] == NULL) { + failure("Internal buffer is not big enough for " + "uncompressed test files"); + } else { + failure("Internal buffer is not big enough for " + "uncompressed test file: %s", filesets[n].names[0]); + } if (!assert(size < buffsize)) { free(rawimage); continue; } } else { - rawimage = slurpfile(&size, filename); - if (!assert(rawimage != NULL)) - continue; + for (i = 0; filesets[n].names[i] != NULL; ++i) + { + tmp = slurpfile(&size, filesets[n].names[i]); + rawimage = (char *)realloc(rawimage, oldsize + size); + memcpy(rawimage + oldsize, tmp, size); + oldsize += size; + size = oldsize; + free(tmp); + if (!assert(rawimage != NULL)) + continue; + } } + if (size == 0) + continue; image = malloc(size); assert(image != NULL); + if (image == NULL) + return; srand((unsigned)time(NULL)); for (i = 0; i < 100; ++i) { @@ -160,7 +133,7 @@ DEFINE_TEST(test_fuzz) /* Fuzz < 1% of the bytes in the archive. */ memcpy(image, rawimage, size); - q = size / 100; + q = (int)size / 100; if (!q) q = 1; numbytes = (int)(rand() % q); for (j = 0; j < numbytes; ++j) @@ -206,4 +179,230 @@ DEFINE_TEST(test_fuzz) } } +DEFINE_TEST(test_fuzz_ar) +{ + static const char *fileset1[] = { + "test_read_format_ar.ar", + NULL + }; + static const struct files filesets[] = { + {0, fileset1}, + {1, NULL} + }; + test_fuzz(filesets); +} + +DEFINE_TEST(test_fuzz_cab) +{ + static const char *fileset1[] = { + "test_fuzz.cab", + NULL + }; + static const struct files filesets[] = { + {0, fileset1}, + {1, NULL} + }; + test_fuzz(filesets); +} + +DEFINE_TEST(test_fuzz_cpio) +{ + static const char *fileset1[] = { + "test_read_format_cpio_bin_be.cpio", + NULL + }; + static const char *fileset2[] = { + /* Test RPM unwrapper */ + "test_read_format_cpio_svr4_gzip_rpm.rpm", + NULL + }; + static const struct files filesets[] = { + {0, fileset1}, + {0, fileset2}, + {1, NULL} + }; + test_fuzz(filesets); +} + +DEFINE_TEST(test_fuzz_iso9660) +{ + static const char *fileset1[] = { + "test_fuzz_1.iso.Z", + NULL + }; + static const struct files filesets[] = { + {0, fileset1}, /* Exercise compress decompressor. */ + {1, fileset1}, + {1, NULL} + }; + test_fuzz(filesets); +} + +DEFINE_TEST(test_fuzz_lzh) +{ + static const char *fileset1[] = { + "test_fuzz.lzh", + NULL + }; + static const struct files filesets[] = { + {0, fileset1}, + {1, NULL} + }; + test_fuzz(filesets); +} + +DEFINE_TEST(test_fuzz_mtree) +{ + static const char *fileset1[] = { + "test_read_format_mtree.mtree", + NULL + }; + static const struct files filesets[] = { + {0, fileset1}, + {1, NULL} + }; + test_fuzz(filesets); +} + +DEFINE_TEST(test_fuzz_rar) +{ + static const char *fileset1[] = { + /* Uncompressed RAR test */ + "test_read_format_rar.rar", + NULL + }; + static const char *fileset2[] = { + /* RAR file with binary data */ + "test_read_format_rar_binary_data.rar", + NULL + }; + static const char *fileset3[] = { + /* Best Compressed RAR test */ + "test_read_format_rar_compress_best.rar", + NULL + }; + static const char *fileset4[] = { + /* Normal Compressed RAR test */ + "test_read_format_rar_compress_normal.rar", + NULL + }; + static const char *fileset5[] = { + /* Normal Compressed Multi LZSS blocks RAR test */ + "test_read_format_rar_multi_lzss_blocks.rar", + NULL + }; + static const char *fileset6[] = { + /* RAR with no EOF header */ + "test_read_format_rar_noeof.rar", + NULL + }; + static const char *fileset7[] = { + /* Best Compressed RAR file with both PPMd and LZSS blocks */ + "test_read_format_rar_ppmd_lzss_conversion.rar", + NULL + }; + static const char *fileset8[] = { + /* RAR with subblocks */ + "test_read_format_rar_subblock.rar", + NULL + }; + static const char *fileset9[] = { + /* RAR with Unicode filenames */ + "test_read_format_rar_unicode.rar", + NULL + }; + static const char *fileset10[] = { + "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 + }; + static const struct files filesets[] = { + {0, fileset1}, + {0, fileset2}, + {0, fileset3}, + {0, fileset4}, + {0, fileset5}, + {0, fileset6}, + {0, fileset7}, + {0, fileset8}, + {0, fileset9}, + {0, fileset10}, + {1, NULL} + }; + test_fuzz(filesets); +} + +DEFINE_TEST(test_fuzz_tar) +{ + static const char *fileset1[] = { + "test_compat_bzip2_1.tbz", + NULL + }; + static const char *fileset2[] = { + "test_compat_gtar_1.tar", + NULL + }; + static const char *fileset3[] = { + "test_compat_gzip_1.tgz", + NULL + }; + static const char *fileset4[] = { + "test_compat_gzip_2.tgz", + NULL + }; + static const char *fileset5[] = { + "test_compat_tar_hardlink_1.tar", + NULL + }; + static const char *fileset6[] = { + "test_compat_xz_1.txz", + NULL + }; + static const char *fileset7[] = { + "test_read_format_gtar_sparse_1_17_posix10_modified.tar", + NULL + }; + static const char *fileset8[] = { + "test_read_format_tar_empty_filename.tar", + NULL + }; + static const char *fileset9[] = { + "test_compat_lzop_1.tar.lzo", + NULL + }; + static const struct files filesets[] = { + {0, fileset1}, /* Exercise bzip2 decompressor. */ + {1, fileset1}, + {0, fileset2}, + {0, fileset3}, /* Exercise gzip decompressor. */ + {0, fileset4}, /* Exercise gzip decompressor. */ + {0, fileset5}, + {0, fileset6}, /* Exercise xz decompressor. */ + {0, fileset7}, + {0, fileset8}, + {0, fileset9}, /* Exercise lzo decompressor. */ + {1, NULL} + }; + test_fuzz(filesets); +} + +DEFINE_TEST(test_fuzz_zip) +{ + static const char *fileset1[] = { + "test_compat_zip_1.zip", + NULL + }; + static const char *fileset2[] = { + "test_read_format_zip.zip", + NULL + }; + static const struct files filesets[] = { + {0, fileset1}, + {0, fileset2}, + {1, NULL} + }; + test_fuzz(filesets); +} diff --git a/libarchive/test/test_open_failure.c b/libarchive/test/test_open_failure.c index 06a3a2c1fa35..845486cf9216 100644 --- a/libarchive/test/test_open_failure.c +++ b/libarchive/test/test_open_failure.c @@ -97,7 +97,7 @@ DEFINE_TEST(test_open_failure) assertEqualInt(1, private.open_called); assertEqualInt(0, private.read_called); assertEqualInt(1, private.close_called); - assertEqualInt(ARCHIVE_OK, archive_read_finish(a)); + assertEqualInt(ARCHIVE_OK, archive_read_free(a)); assertEqualInt(1, private.open_called); assertEqualInt(0, private.read_called); assertEqualInt(1, private.close_called); @@ -112,7 +112,7 @@ DEFINE_TEST(test_open_failure) assertEqualInt(1, private.open_called); assertEqualInt(0, private.read_called); assertEqualInt(1, private.close_called); - assertEqualInt(ARCHIVE_OK, archive_read_finish(a)); + assertEqualInt(ARCHIVE_OK, archive_read_free(a)); assertEqualInt(1, private.open_called); assertEqualInt(0, private.read_called); assertEqualInt(1, private.close_called); @@ -127,7 +127,7 @@ DEFINE_TEST(test_open_failure) assertEqualInt(1, private.open_called); assertEqualInt(0, private.read_called); assertEqualInt(1, private.close_called); - assertEqualInt(ARCHIVE_OK, archive_read_finish(a)); + assertEqualInt(ARCHIVE_OK, archive_read_free(a)); assertEqualInt(1, private.open_called); assertEqualInt(0, private.read_called); assertEqualInt(1, private.close_called); @@ -146,7 +146,7 @@ DEFINE_TEST(test_open_failure) assertEqualInt(1, private.open_called); assertEqualInt(1, private.read_called); assertEqualInt(1, private.close_called); - assertEqualInt(ARCHIVE_OK, archive_read_finish(a)); + assertEqualInt(ARCHIVE_OK, archive_read_free(a)); assertEqualInt(1, private.open_called); assertEqualInt(1, private.read_called); assertEqualInt(1, private.close_called); @@ -161,7 +161,7 @@ DEFINE_TEST(test_open_failure) assertEqualInt(1, private.open_called); assertEqualInt(0, private.write_called); assertEqualInt(1, private.close_called); - assertEqualInt(ARCHIVE_OK, archive_write_finish(a)); + assertEqualInt(ARCHIVE_OK, archive_write_free(a)); assertEqualInt(1, private.open_called); assertEqualInt(0, private.write_called); assertEqualInt(1, private.close_called); @@ -178,7 +178,7 @@ DEFINE_TEST(test_open_failure) assertEqualInt(1, private.open_called); assertEqualInt(0, private.write_called); assertEqualInt(1, private.close_called); - assertEqualInt(ARCHIVE_OK, archive_write_finish(a)); + assertEqualInt(ARCHIVE_OK, archive_write_free(a)); assertEqualInt(1, private.open_called); assertEqualInt(0, private.write_called); assertEqualInt(1, private.close_called); @@ -194,7 +194,7 @@ DEFINE_TEST(test_open_failure) assertEqualInt(1, private.open_called); assertEqualInt(0, private.write_called); assertEqualInt(1, private.close_called); - assertEqualInt(ARCHIVE_OK, archive_write_finish(a)); + assertEqualInt(ARCHIVE_OK, archive_write_free(a)); assertEqualInt(1, private.open_called); assertEqualInt(0, private.write_called); assertEqualInt(1, private.close_called); @@ -210,7 +210,7 @@ DEFINE_TEST(test_open_failure) assertEqualInt(1, private.open_called); assertEqualInt(0, private.write_called); assertEqualInt(1, private.close_called); - assertEqualInt(ARCHIVE_OK, archive_write_finish(a)); + assertEqualInt(ARCHIVE_OK, archive_write_free(a)); assertEqualInt(1, private.open_called); assertEqualInt(0, private.write_called); assertEqualInt(1, private.close_called); diff --git a/libarchive/test/test_open_fd.c b/libarchive/test/test_open_fd.c index 52b34bd125f7..ff5fab1ad45b 100644 --- a/libarchive/test/test_open_fd.c +++ b/libarchive/test/test_open_fd.c @@ -28,6 +28,9 @@ __FBSDID("$FreeBSD: head/lib/libarchive/test/test_open_fd.c 201247 2009-12-30 05 #if defined(_WIN32) && !defined(__CYGWIN__) #define open _open #if !defined(__BORLANDC__) +#ifdef lseek +#undef lseek +#endif #define lseek _lseek #endif #define close _close @@ -52,7 +55,7 @@ DEFINE_TEST(test_open_fd) /* Write an archive through this fd. */ assert((a = archive_write_new()) != NULL); assertEqualIntA(a, ARCHIVE_OK, archive_write_set_format_ustar(a)); - assertEqualIntA(a, ARCHIVE_OK, archive_write_set_compression_none(a)); + assertEqualIntA(a, ARCHIVE_OK, archive_write_add_filter_none(a)); assertEqualIntA(a, ARCHIVE_OK, archive_write_open_fd(a, fd)); /* diff --git a/libarchive/test/test_open_file.c b/libarchive/test/test_open_file.c index 4308f024344b..bee4b3b4835b 100644 --- a/libarchive/test/test_open_file.c +++ b/libarchive/test/test_open_file.c @@ -40,7 +40,7 @@ DEFINE_TEST(test_open_file) /* Write an archive through this FILE *. */ assert((a = archive_write_new()) != NULL); assertEqualIntA(a, ARCHIVE_OK, archive_write_set_format_ustar(a)); - assertEqualIntA(a, ARCHIVE_OK, archive_write_set_compression_none(a)); + assertEqualIntA(a, ARCHIVE_OK, archive_write_add_filter_none(a)); assertEqualIntA(a, ARCHIVE_OK, archive_write_open_FILE(a, f)); /* diff --git a/libarchive/test/test_open_filename.c b/libarchive/test/test_open_filename.c index 15646b86162b..91afce244ae4 100644 --- a/libarchive/test/test_open_filename.c +++ b/libarchive/test/test_open_filename.c @@ -35,7 +35,7 @@ test_open_filename_mbs(void) /* Write an archive through this FILE *. */ assert((a = archive_write_new()) != NULL); assertEqualIntA(a, ARCHIVE_OK, archive_write_set_format_ustar(a)); - assertEqualIntA(a, ARCHIVE_OK, archive_write_set_compression_none(a)); + assertEqualIntA(a, ARCHIVE_OK, archive_write_add_filter_none(a)); assertEqualIntA(a, ARCHIVE_OK, archive_write_open_filename(a, "test.tar")); @@ -119,7 +119,7 @@ test_open_filename_wcs(void) /* Write an archive through this FILE *. */ assert((a = archive_write_new()) != NULL); assertEqualIntA(a, ARCHIVE_OK, archive_write_set_format_ustar(a)); - assertEqualIntA(a, ARCHIVE_OK, archive_write_set_compression_none(a)); + assertEqualIntA(a, ARCHIVE_OK, archive_write_add_filter_none(a)); assertEqualIntA(a, ARCHIVE_OK, archive_write_open_filename_w(a, L"test.tar")); diff --git a/libarchive/test/test_pax_filename_encoding.c b/libarchive/test/test_pax_filename_encoding.c index 3a28e2f7dda2..e03276e411f0 100644 --- a/libarchive/test/test_pax_filename_encoding.c +++ b/libarchive/test/test_pax_filename_encoding.c @@ -115,7 +115,7 @@ test_pax_filename_encoding_2(void) assert((a = archive_write_new()) != NULL); assertEqualIntA(a, 0, archive_write_set_format_pax(a)); - assertEqualIntA(a, 0, archive_write_set_compression_none(a)); + assertEqualIntA(a, 0, archive_write_add_filter_none(a)); assertEqualIntA(a, 0, archive_write_set_bytes_per_block(a, 0)); assertEqualInt(0, archive_write_open_memory(a, buff, sizeof(buff), &used)); @@ -234,7 +234,7 @@ test_pax_filename_encoding_3(void) assert((a = archive_write_new()) != NULL); assertEqualIntA(a, 0, archive_write_set_format_pax(a)); - assertEqualIntA(a, 0, archive_write_set_compression_none(a)); + assertEqualIntA(a, 0, archive_write_add_filter_none(a)); assertEqualIntA(a, 0, archive_write_set_bytes_per_block(a, 0)); assertEqualInt(0, archive_write_open_memory(a, buff, sizeof(buff), &used)); diff --git a/libarchive/test/test_rar_multivolume_multiple_files.part1.rar.uu b/libarchive/test/test_rar_multivolume_multiple_files.part1.rar.uu new file mode 100644 index 000000000000..fee150c1a596 --- /dev/null +++ b/libarchive/test/test_rar_multivolume_multiple_files.part1.rar.uu @@ -0,0 +1,163 @@ +begin 644 test_rar_multivolume_multiple_files.part1.rar +M4F%R(1H'`%INR!M87)G:6XM8F]T=&]M.B`P+C`X +M:6X@?0H)"4@Q('L@;6%R9VEN+6)O='1O;3H@,"XP.&EN('T*"0E(,2YW97-T +M97)N('L@9F]N="UF86UI;'DZ("),:6)E2!C;VUP;&5X('!I +M96-E(&]F('-O9G1W87)E('1H870@6EN9R!N97<@<&]R=',@86YD(&9O2!S:6=N:69I8V%N="!C +M:&%N9V4@=&\@;&EB87)C:&EV92P@:6YC;'5D:6YG(&UO&5S +M+`IS:&]U;&0@8F4@86-C;VUP86YI960@8GD@;F5W('1E'!L86EN2!O9B!T:&%T(&-O;7!O;F5N="X@5&AE +M6]U +M(&YE960@=&\@9VEV92!T:&5M('1W;R!P:65C97,@;V8*:6YF;W)M871I;VXZ +M(`H\+U`^"CQ53#X*"3Q,23X\4"!35%E,13TB;6%R9VEN+6)O='1O;3H@,&EN +M(CY4:&4@9G5L;"!P871H('1O('1H92!D:7)E8W1O&5C=71A8FQE('!R;V=R86T@8F5I;F<@ +M=&5S=&5D("AN;W0*"6%P<&QI8V%B;&4@=&\@;&EB87)C:&EV95]T97-T('-I +M;F-E(&QI8F%R8VAI=F4@:7,@8V]M<&EL960@:6YT;R!T:&4*"71E'1E;G-I;VXN(%1H92!T97-T('!R;V=R86US(&QO;VL@:6X@82!F97<* +M3L@=&AE>2!N965D('1H92!F=6QL('!A=&@@=&\@ +M=&AE(&%P<')O<')I871E(&5X96-U=&%B;&4N"D%L=&AO=6=H(&)S9'1A2!I;G1E;F1E +M9"!F;W(*=&5S=&EN9R!B2!T;R!V97)I9GD@=&AA="!T:&4@=&5S=`IP2X@"CPO4#X*/%`^5VAE;B!R=6XL('1H +M92!T97-T('!R;V=R86US(&]U='!U="!A('!R;V=R97-S(&UE&5R8VES:6YG.B!B0HF;F)S<#L@=&5S=%]C;W!Y+F,Z,32YC.C$W,3H@ +M1F%I;&5D(#(V-"!T:6UE2!F;W(@9G5R=&AE +M&5R8VES960N(`H)/"]0/@H)/$Q)/CQ0/D)A&%M +M<&QE+`IM86YY(&]F('1H92!L:6)AFEP/"]45#XL"G=H:6-H('9E&%M<&QE +M(&%B;W9E*0IG96YE2!P2!S:6UP;&EF:65S(&1I86=N +M;W-I;F<*9F%I;'5R97,N(`H\+U`^"CQ(,2!#3$%34STB=V5S=&4`9GL/0!0` +-+CO?G@`````````````` +` +end diff --git a/libarchive/test/test_rar_multivolume_multiple_files.part2.rar.uu b/libarchive/test/test_rar_multivolume_multiple_files.part2.rar.uu new file mode 100644 index 000000000000..012399a5c1dd --- /dev/null +++ b/libarchive/test/test_rar_multivolume_multiple_files.part2.rar.uu @@ -0,0 +1,163 @@ +begin 644 test_rar_multivolume_multiple_files.part2.rar +M4F%R(1H'`!EZ2!E87-Y('1O"F%D9"!N97<@=&5S=',N*2`*/"]0/@H\ +M4#Y4:&4@=&5S="!H87)N97-S(&1E=&5R;6EN97,@=VAI8V@@=&5S=',@=&\@ +M&-E<'0@9F]R('-T9&EN+"!S=&1O=70L(&%N9"!S +M=&1E2!D:7)E8W1O2!D +M:7)E8W1O2!A2!I0H)=VAE;B!T:&4@=&5S="!S=&%R=',N(`H)/"]0/@H)/$Q)/CQ0(%-4 +M64Q%/2)M87)G:6XM8F]T=&]M.B`P:6XB/D%N>2!F:6QE2X@5&AE('1E2!D +M96)U9V=E2!D:69F97)E;G0@<&QA +M=&9O2!W'@H*2!F=6YC=&EO;G,@=&AA="!Y;W4@8V%N +M('5S92X@5&AE3PO5%0^+"`\5%0@0TQ!4U,](G=E2!T97-T6]U(&-A;B!R96-O=F5R('1H +M92!R969E2!O9B!C:&%R86-T97)S+B!4:&ES('=A2X@270GF5D +M(&9O6]U('1H:6YK"@EY;W4G=F4@9F]U;F0@82!B=6&EN9R!T:&4@8G5G+B`*"3PO4#X*"3Q,23X\ +M4"!35%E,13TB;6%R9VEN+6)O='1O;3H@,&EN(CY$3R!R=6X@86QL(&]F('1H +M92!T97-T0H)97AE6]U('-E92!A('1E6]U(&AA=F4@<75E2!R96%D(&$@<')E+6)U:6QT"FEN<'5T(&9I;&4@86YD('9E2!T:&4@2!S=')A:6=H=&9O0IA;F0@=&AE;B!O<&5N('1H92!M96UO71E&%C="!D871A(&-O;G1A:6YS('9A;'5E2!V97)I9GEI +M;F<@9FEL97,@;VX@9&ES:RX@5&\@;6%K92!T:&ES(&5A0IA +M=F%I;&%B;&4N(`H\+U`^"CQ(,B!#3$%34STB=V5S=&5R;B(^/$$@3D%-13TB +M1G5Z>E]T97-T97(B/CPO03Y&=7IZ('1E0IU2!D86UA9V5D+B`H4F5M96UB97(@=&AA="!L +M:6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9&EF9F5R96YT('!L871F;W)M2X@"CPO4#X*/%`^06YY('-I9VYI9FEC86YT(&-H86YG92!T;R!L:6)A +M2!N97<@=&5S=',@;W(@8VAA;F=E&ES=&EN +M9R!T97-T0H):&]L9&EN9R!T:&4@)G%U;W0[6]U)VQL(&YE960@=&\@ +M2!T:&4*/%14($-,05-3/2)W97-T97)N(CXM2!S:&]U;&0@8F4@=7-A8FQE(&9O +M2!T:&%T('=I;&P@8F4@=7-E +M9`H)9F]R('-C2!F&5C=71A8FQE(&)E:6YG(&5X97)C:7-E +M9"X@"@D\+U`^"@D\3$D^/%`^0F%S:6,@=F5R2(^/"]!/D)A2!T:&%T(&EL;&5G86P@&-E2!W +M:71H('9A'1?:&5A9&5R*&$L("9A;7`[864I*3L*)FYB5]P871H;F%M92AA92DI.SPO +M4%)%/CQ0/@I4:&4@/%14($-,05-3/2)W97-T97)N(CYA2!D969A=6QT+`IT:&5Y(')E<&]R="!T:&4@9F%I;'5R92!A;F0@2!O9@IS<&5C:69I8R!T97-T2!E87-Y +M('1O"F%D9"!N97<@=&5S=',N*2`*/"]0/@H\4#Y4:&4@=&5S="!H87)N97-S +M(&1E=&5R;6EN97,@=VAI8V@@=&5S=',@=&\@&-E +M<'0@9F]R('-T9&EN+"!S=&1O=70L(&%N9"!S=&1E2!D:7)E8W1P6GL/0!0` +-_]75M@,````````````` +` +end diff --git a/libarchive/test/test_rar_multivolume_multiple_files.part5.rar.uu b/libarchive/test/test_rar_multivolume_multiple_files.part5.rar.uu new file mode 100644 index 000000000000..d5ff36ac6fcc --- /dev/null +++ b/libarchive/test/test_rar_multivolume_multiple_files.part5.rar.uu @@ -0,0 +1,163 @@ +begin 644 test_rar_multivolume_multiple_files.part5.rar +M4F%R(1H'`!EZ2X@*$EF(#Q45"!#3$%34STB=V5S=&5R;B(^+6L\ +M+U14/@H):7,@6]U+B`*"3PO4#X*"3Q, +M23X\4#Y4:&4@8W5R6]U(&-A;B!U6UL:6YK/"]45#XL"@D\5%0@0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65S('1H2!H86YD;&5S(&%L;"!O9B!T:&4@8F]U;F1AF5R;RUC +M;W!Y+B!7:&5N('EO=2!G:79E(&ET(&$@;&%R9V4*8FQO8VL@=&\@=W)I=&4@ +M=&\@86X@96YT2P@:70@=VEL;"!P87-S('!O:6YT97)S('-T&-E<'0@:6X@ +M=&AO2!D971E8W0@=VAE;B!A(&)L +M;V-K(&)E:6YG('=R:71T96X@;W5T(&)Y"G1H92!A2!B;V1Y+"!A;F0@F5S +M('=H:6-H('1R861E(&]F9@IP;W)T86)I;&ET>2!V97)S=7,@PY`%`!.[9:E +)!0`````````` +` +end diff --git a/libarchive/test/test_rar_multivolume_single_file.part1.rar.uu b/libarchive/test/test_rar_multivolume_single_file.part1.rar.uu new file mode 100644 index 000000000000..22b5c8dfa3e8 --- /dev/null +++ b/libarchive/test/test_rar_multivolume_single_file.part1.rar.uu @@ -0,0 +1,159 @@ +begin 644 - +M4F%R(1H'`%INR!M87)G:6XZ(#`N-SEI;B!]"@D)4"![(&UAR!M87)G:6XM8F]T=&]M.B`P+C`X:6X@?0H)"4@Q+G=ER!F;VYT+69A;6EL>3H@(DQI8F5R871I;VX@4V5R:68B+"!S97)I9B!] +M"@D)2#$N8VIK('L@9F]N="UF86UI;'DZ(")":71S=')E86T@5F5R82!386YS +M(B!]"@D)2#$N8W1L('L@9F]N="UF86UI;'DZ(")&R!F;VYT+69A;6EL>3H@(D)I='-TR!F;VYT+69A;6EL>3H@(D9R965386YS(B!]"@D)5%0N8VIK('L@ +M9F]N="UF86UI;'DZ(")":71S=')E86T@5F5R82!386YS(BP@;6]N;W-P86-E +M('T*"2TM/@H)/"]35%E,13X*/"](14%$/@H\0D]$62!,04Y'/2)E;BU54R(@ +M1$E2/2),5%(B/@H\2#$@0TQ!4U,](G=E2X@"CPO4#X*/%`^06YY('-I9VYI9FEC86YT(&-H +M86YG92!T;R!L:6)A2!N97<@=&5S=',@;W(@8VAA;F=E +M&ES=&EN9R!T97-T0H):&]L9&EN9R!T:&4@ +M)G%U;W0[6]U +M)VQL(&YE960@=&\@2!T:&4*/%14($-,05-3/2)W97-T97)N(CXM +M2!S:&]U;&0@ +M8F4@=7-A8FQE(&9O2!F&5C=71A8FQE(&)E +M:6YG(&5X97)C:7-E9"X@"@D\+U`^"@D\3$D^/%`^0F%S:6,@=F5R2(^/"]!/D)A2!T:&%T(&EL;&5G86P@&-E2!W:71H('9A'1R +M86-T7W)E9F5R96YC95]F:6QE*&YA;64I.PHF;F)S<#L@)FYB'1?:&5A9&5R*&$L("9A;7`[864I*3L* +M)FYB5]P871H +M;F%M92AA92DI.SPO4%)%/CQ0/@I4:&4@/%14($-,05-3/2)W97-T97)N(CYA +M2!D969A=6QT+`IT:&5Y(')E<&]R="!T:&4@9F%I;'5R +M92!A;F0@EGL/0!0`O*TOS@`````````````` +` +end diff --git a/libarchive/test/test_rar_multivolume_single_file.part2.rar.uu b/libarchive/test/test_rar_multivolume_single_file.part2.rar.uu new file mode 100644 index 000000000000..e00e06cb278e --- /dev/null +++ b/libarchive/test/test_rar_multivolume_single_file.part2.rar.uu @@ -0,0 +1,159 @@ +begin 644 - +M4F%R(1H'`!EZ2!P2!S:6UP;&EF:65S(&1I86=N;W-I;F<*9F%I +M;'5R97,N(`H\+U`^"CQ(,2!#3$%34STB=V5S=&5R;B(^/$$@3D%-13TB3&EF +M95]C>6-L95]O9E]A7W1E"UL:6ME('!L871F;W)M +M2!T;PIA9&0@;F5W('1E2X@*$EF(#Q45"!#3$%34STB=V5S=&5R;B(^+6L\ +M+U14/@H):7,@6]U+B`*"3PO4#X*"3Q, +M23X\4#Y4:&4@8W5R6]U(&-A;B!U6UL:6YK/"]45#XL"@D\5%0@0TQ!4U,](G=E3PO5%0^+`H)/%14($-, +M05-3/2)W97-T97)N(CYA&%M<&QE+"!I9B!Y;W4@;F5E9"!A +M(')E9F5R96YC92!T87(@87)C:&EV92!T;R!U2X@"CPO4#X*/%`^3&]O:R!A="`\5%0@0TQ!4U,](G=E&%M<&QE(&]F('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G:79E(&ET(&$@;&%R9V4*8FQO8VL@=&\@=W)I=&4@=&\@86X@96YT2P@:70@=VEL;"!P87-S('!O:6YT97)S('-T&-E<'0@:6X@=&AO2!D971E8W0@=VAE;B!A(&)L;V-K(&)E:6YG('=R +M:71T96X@;W5T(&)Y"G1H92!A2!B;V1Y+"!A;F0@F5S('=H:6-H('1R861E +M(&]F9@IP;W)T86)I;&ET>2!V97)S=7,@5>PY`%`"G$@X2`@`````````` +` +end diff --git a/libarchive/test/test_rar_multivolume_uncompressed_files.part01.rar.uu b/libarchive/test/test_rar_multivolume_uncompressed_files.part01.rar.uu new file mode 100644 index 000000000000..876b7e9acbd1 --- /dev/null +++ b/libarchive/test/test_rar_multivolume_uncompressed_files.part01.rar.uu @@ -0,0 +1,299 @@ +begin 644 - +M4F%R(1H'`%INR!M87)G:6XZ(#`N-SEI;B!]"@D)4"![(&UAR!M87)G:6XM8F]T=&]M.B`P+C`X:6X@?0H) +M"4@Q+G=ER!F;VYT+69A;6EL>3H@(DQI8F5R871I;VX@4V5R:68B +M+"!S97)I9B!]"@D)2#$N8VIK('L@9F]N="UF86UI;'DZ(")":71S=')E86T@ +M5F5R82!386YS(B!]"@D)2#$N8W1L('L@9F]N="UF86UI;'DZ(")&R!F;VYT+69A;6EL>3H@(D)I='-TR!F;VYT+69A;6EL>3H@(D9R965386YS(B!]"@D) +M5%0N8VIK('L@9F]N="UF86UI;'DZ(")":71S=')E86T@5F5R82!386YS(BP@ +M;6]N;W-P86-E('T*"2TM/@H)/"]35%E,13X*/"](14%$/@H\0D]$62!,04Y' +M/2)E;BU54R(@1$E2/2),5%(B/@H\2#$@0TQ!4U,](G=E2X@"CPO4#X*/%`^06YY('-I9VYI +M9FEC86YT(&-H86YG92!T;R!L:6)A2!N97<@=&5S=',@ +M;W(@8VAA;F=E&ES=&EN9R!T97-T0H):&]L +M9&EN9R!T:&4@)G%U;W0[6]U)VQL(&YE960@=&\@2!T:&4*/%14($-,05-3/2)W +M97-T97)N(CXM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+M+69A;6EL>3H@(DQI8F5R871I;VX@4V5R:68B+"!S97)I9B!]"@D)2#$N8VIK +M('L@9F]N="UF86UI;'DZ(")":71S=')E86T@5F5R82!386YS(B!]"@D)2#$N +M8W1L('L@9F]N="UF86UI;'DZ(")&R!F +M;VYT+69A;6EL>3H@(D)I='-TR!F +M;VYT+69A;6EL>3H@(D9R965386YS(B!]"@D)5%0N8VIK('L@9F]N="UF86UI +M;'DZ(")":71S=')E86T@5F5R82!386YS(BP@;6]N;W-P86-E('T*"2TM/@H) +M/"]35%E,13X*/"](14%$/@H\0D]$62!,04Y'/2)E;BU54R(@1$E2/2),5%(B +M/@H\2#$@0TQ!4U,](G=E2X@"CPO4#X*/%`^06YY('-I9VYI9FEC86YT(&-H86YG92!T;R!L +M:6)A2!N97<@=&5S=',@;W(@8VAA;F=E&ES +M=&EN9R!T97-T0H):&]L9&EN9R!T:&4@)G%U;W0[6]U)VQL(&YE960@ +M=&\@2!T:&4*/%14($-,05-3/2)W97-T97)N(CXM2!S:&]U;&0@8F4@=7-A8FQE +M(&9O2!T:&%T('=I;&P@8F4@ +M=7-E9`H)9F]R('-C2!F&5C=71A8FQE(&)E:6YG(&5X97)C +M:7-E9"X@"@D\+U`^"@D\3$D^/%`^0F%S:6,@=F5R2(^/"]!/D)A2!T:&%T(&EL;&5G86P@&-E2!W:71H('9A'1?:&5A9&5R*&$L("9A;7`[864I*3L*)FYB5]P871H;F%M92AA92DI +M.SPO4%)%/CQ0/@I4:&4@/%14($-,05-3/2)W97-T97)N(CYA2!D969A=6QT+`IT:&5Y(')E<&]R="!T:&4@9F%I;'5R92!A;F0@2!O9@IS<&5C:69I8R!T97-T2!E +M87-Y('1O"F%D9"!N97<@=&5S=',N*2`*/"]0/@H\4#Y4:&4@=&5S="!H87)N +M97-S(&1E=&5R;6EN97,@=VAI8V@@=&5S=',@=&\@&-E<'0@9F]R('-T9&EN+"!S=&1O=70L(&%N9"!S=&1E2!D:7)E8W1O2!D:7)E8W1O2!A2!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7-E(&%S +M2!A;F0@8W)A2!F965D:6YG"FET(&EN<'5T('1H870@:7,@B!F86EL=7)E(&-A=7-E +MGH@=&5S=&5R(&EN7-IGH@=&5S=&5R(&AA2P@=&AE(&YE960@=&\@=W)I=&4@=&AE(&1A=&$@=&\@9&ES:R!B969O&5R8VES92!B;W5N9&%R>2!C +M87-E2!T;R!A +M;B!U;F-O;7!R97-S960@87)C:&EV92!O;B!D:7-K(&]R(&UE;6]R>2!I2!S;6%L;"!H96%D97)S(&%N9"!S=&]R +M92!A(&-O=6YT(&]F(&5A8V@@8V]N=&EG=6]U2!W2X@ +M5VAE;B!Y;W4@9VEV92!I="!A(&QA2!D871A('1O(&-O2!B +M=6EL9"!B;&]C:W,N(%1H92!L87)G92!T87(@=&5S=&5R('1A:V5S"F%D=F%N +M=&%G92!O9B!T:&ES('1O('%U:6-K;'D@9&5T96-T('=H96X@82!B;&]C:R!B +E96EN9R!WG0AD%<`W`(``(].```#8Z8%7KM,-4$4 +M,"T`I($``'1E0IT:&4@87)C:&EV92!W0IT +M:&4@=&5S="!A2P@86YD('-I;6EL87)L>2!W:&5N +M(')E861I;F<@=&AE(&%R8VAI=F4*8F%C:RX@"CPO4#X*/%`^5&%K96X@=&]G +M971H97(L('1H97-E('1R:6-K7,@=&\@70BD$0`83```(].```# +MC+J$FKM,-4$4,!H`I($``$QI8F%R8VAI=F5!9&1I;F=497-T,BYH=&ULP,P) +M7SM",E\[0CPA1$]#5%E012!(5$U,(%!50DQ)0R`B+2\O5S-#+R]$5$0@2%1- +M3"`T+C`@5')A;G-I=&EO;F%L+R]%3B(^"CQ(5$U,/@H\2$5!1#X*"3Q-151! +M($A45%`M15%5258](D-/3E1%3E0M5%E012(@0T].5$5.5#TB=&5X="]H=&UL +M.R!C:&%RR!M87)G:6XM8F]T +M=&]M.B`P+C`X:6X@?0H)"4@Q('L@;6%R9VEN+6)O='1O;3H@,"XP.&EN('T* +M"0E(,2YW97-T97)N('L@9F]N="UF86UI;'DZ("),:6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L95]O9E]A7W1E"UL:6ME('!L871F;W)M2!T;PIA9&0@;F5W('1E2X@*$EF(#Q45"!# +M3$%34STB=V5S=&5R;B(^+6L\+U14/@H):7,@6]U+B`*"3PO4#X*"3Q,23X\4#Y4:&4@8W5R6]U +M(&-A;B!U6UL:6YK/"]45#XL"@D\5%0@0TQ! +M4U,](G=E3PO5%0^+`H)/%14($-,05-3/2)W97-T97)N(CYA&%M +M<&QE+"!I9B!Y;W4@;F5E9"!A(')E9F5R96YC92!T87(@87)C:&EV92!T;R!U +M'1R86-T7W)E9F5R96YC95]F +M:6QE*"D\+U14/B!F=6YC=&EO;B!W:6QL"G5U9&5C;V1E('1H92!R97%U97-T +M960@9FEL92!A;F0@<'5T('1H92!R97-U;'0@:6X@=&AE(&-U2!O9B!C:&%R +M86-T97)S+B!4:&ES('=A2X@270G +M2!L +M:6YE+B`*"3PO4#X*"3Q,23X\4"!35%E,13TB;6%R9VEN+6)O='1O;3H@,&EN +M(CY$3R!U2!I;G-T96%D(&]F('!L +M86EN"@EAF5D(&9O6]U('1H:6YK +M"@EY;W4G=F4@9F]U;F0@82!B=6&EN9R!T:&4@8G5G+B`*"3PO4#X*"3Q,23X\4"!35%E,13TB;6%R9VEN +M+6)O='1O;3H@,&EN(CY$3R!R=6X@86QL(&]F('1H92!T97-T2!T +M;R!S970@86X@04-,(&]N(&$@9FEL92!A;F0*"7)E860@:70@8F%C:R!T;R!D +M971E&ES=&EN9R!T97-T&%M<&QE2!J=7-T('9E2!T:&%T(&QI8F%R8VAI=F4@8V%N"G)E +M860@=VAA="!I="!W2!U2!I;G1E2!A;F0@=&AE;B!I;G-P96-T"G1H92!A8W1U86P@8GET97,@ +M=&\@=F5R:69Y('1H870@=&AE(&%R8VAI=F4@=V%S(&-R96%T960@8V]R2!S:6YC92!T:&4@97AA8W0@9&%T82!C +M;VYT86EN2!C;VYT7-T96T@8V%L +M;',@9F]R(&5A8V@@<&QA=&9OGI?=&5S=&5R(CX\+T$^1G5Z +M>B!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(B/CPO03Y&=7IZ('1E0IUB!T +M97-T97(@:6YS=&5A9"!G96YE2UD86UA9V5D(&9I +M;&4L('-A=F5S('1H870@9FEL92!T;R!D:7-K+"!T:&5N(')U;G,@=&AE(&9I +M;&4*=&AR;W5G:"!L:6)A2!T;R!PB!T97-T97(@:&%S('!R;W9E;B!Q +M=6ET92!U0IL87)G92!E;G1R:65S+"!U +M<"!T;R`Q('1E71E+B!/9B!C;W5R71E"F5N=')Y('1O(&%N('5N8V]M<')EFEP,@IC;VUP +M65R('1H +M870@:6UP;&5M96YT2!L87)G92!E;G1R:65S('1H2!H86YD;&5S(&%L;"!O9B!T:&4@8F]U;F1AF5R;RUC;W!Y +M+B!7:&5N('EO=2!G:79E(&ET(&$@;&%R9V4*8FQO8VL@=&\@=W)I=&4@=&\@ +M86X@96YT2P@:70@=VEL;"!P87-S('!O:6YT97)S('-T&-E<'0@:6X@=&AO +M2!D971E8W0@=VAE;B!A(&)L;V-K +M(&)E:6YG('=R:71T96X@;W5T(&)Y"G1H92!A2!B;V1Y+"!A;F0@F5S('=H +M:6-H('1R861E(&]F9@IP;W)T86)I;&ET>2!V97)S=7,@R!M87)G:6XZ(#`N-SEI +M;B!]"@D)4"![(&UAR!M87)G +M:6XM8F]T=&]M.B`P+C`X:6X@?0H)"4@Q+G=ER!F;VYT+69A;6EL +M>3H@(DQI8F5R871I;VX@4V5R:68B+"!S97)I9B!]"@D)2#$N8VIK('L@9F]N +M="UF86UI;'DZ(")":71S=')E86T@5F5R82!386YS(B!]"@D)2#$N8W1L('L@ +M9F]N="UF86UI;'DZ(")&R!F;VYT+69A +M;6EL>3H@(D)I='-TR!F;VYT+69A +M;6EL>3H@(D9R965386YS(B!]"@D)5%0N8VIK('L@9F]N="UF86UI;'DZ(")" +M:71S=')E86T@5F5R82!386YS(BP@;6]N;W-P86-E('T*"2TM/@H)/"]35%E, +M13X*/"](14%$/@H\0D]$62!,04Y'/2)E;BU54R(@1$E2/2),5%(B/@H\2#$@ +M0TQ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86QI='D@;V8@=&AA="!C;VUP;VYE;G0N(%1H +M97-E"G1E2!T:&%T('1H92!R97-T(&]F('1H90IL:6)A2!A2X@"CPO4#X*/%`^5&AE(&)S9'1A&5C=71A8FQE+@I!;'1H;W5G:"!B3H@"CPO4#X*/%!212!# +M3$%34STB=V5S=&5R;B(^)FYB2YC.C$W +M,3H@07-S97)T:6]N(&9A:6QE9#H@26YT6]U"F-A;B!S964L('1H97)E('=AF5R;R!T:&%T('=A'!E8W1E +E9"X@"CPO4#X*/$@Q($-,05.HQWL/0!0`.^^E?`<````````````` +` +end diff --git a/libarchive/test/test_rar_multivolume_uncompressed_files.part09.rar.uu b/libarchive/test/test_rar_multivolume_uncompressed_files.part09.rar.uu new file mode 100644 index 000000000000..bdcdc999c4d6 --- /dev/null +++ b/libarchive/test/test_rar_multivolume_uncompressed_files.part09.rar.uu @@ -0,0 +1,299 @@ +begin 644 - +M4F%R(1H'`!EZ2(^/"]! +M/D)A2!T:&%T(&EL;&5G86P@&-E2!W:71H('9A +M'1R86-T7W)E9F5R96YC95]F:6QE +M*&YA;64I.PHF;F)S<#L@)FYB'1?:&5A9&5R*&$L("9A;7`[864I*3L*)FYB5]P871H;F%M92AA92DI.SPO4%)%/CQ0 +M/@I4:&4@/%14($-,05-3/2)W97-T97)N(CYA2!D969A +M=6QT+`IT:&5Y(')E<&]R="!T:&4@9F%I;'5R92!A;F0@2!O9@IS<&5C:69I8R!T97-T2!E87-Y('1O"F%D +M9"!N97<@=&5S=',N*2`*/"]0/@H\4#Y4:&4@=&5S="!H87)N97-S(&1E=&5R +M;6EN97,@=VAI8V@@=&5S=',@=&\@&-E<'0@9F]R +M('-T9&EN+"!S=&1O=70L(&%N9"!S=&1E2!D:7)E8W1O2!D:7)E8W1O2!A2!I0H)=VAE;B!T:&4@=&5S="!S=&%R +M=',N(`H)/"]0/@H)/$Q)/CQ0(%-464Q%/2)M87)G:6XM8F]T=&]M.B`P:6XB +M/D%N>2!F:6QE2X@5&AE('1E2!D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&AA2P@=&AE(&YE +M960@=&\@=W)I=&4@=&AE(&1A=&$@=&\@9&ES:R!B969OFEP(&]R(&)Z:7`R"F-O +M;7!R97-S:6]N('=O;B=T(&AE;'`[(&%L=&AO=6=H('-M86QL97(L('1H92!O +M=71P=70@:7,@F5R;R!B +M>71E0IE9F9E8W1I=F4L(&-O;7!R97-S:6YG +M(&$@F5N(&5N=')I97,@9&]W;B!T +M;PIJ=7-T(&$@9F5W(&MI;&]B>71E2!T:&%T(&QI +M8F%R8VAI=F4@8V]R0IC87-EF%T:6]N.@I,:6)A29Q +M=6]T.R!Z97)O+6-O<'DN(%=H96X@>6]U(&=I=F4@:70@82!L87)G90IB;&]C +M:R!T;R!W2!B;V1Y+"!I="!W:6QL('!A2!L87)G92!F:6QE('-I>F5S("AT87(@ +M9FEL97,*2D@86YD(&EN=&5G97(@ +M;W9E2D@:6X@82!T97-T('1H +M870@6UL:6YK-<#,;5\[0G%?.T)T97-T6UL:6YK@`A-7SM"35\[0G1E6UL:6YK,\`(6U\[0EM?.T)T97-T9&ER+W1EPY`%`"RV@*;"0`` +&```````` +` +end diff --git a/libarchive/test/test_read_data_large.c b/libarchive/test/test_read_data_large.c index 963ee95ef66f..7bb72c01ed50 100644 --- a/libarchive/test/test_read_data_large.c +++ b/libarchive/test/test_read_data_large.c @@ -55,7 +55,7 @@ DEFINE_TEST(test_read_data_large) /* Create a new archive in memory. */ assert((a = archive_write_new()) != NULL); assertA(0 == archive_write_set_format_ustar(a)); - assertA(0 == archive_write_set_compression_none(a)); + assertA(0 == archive_write_add_filter_none(a)); assertA(0 == archive_write_open_memory(a, buff1, sizeof(buff1), &used)); /* diff --git a/libarchive/test/test_read_disk.c b/libarchive/test/test_read_disk.c index b69e55cfa292..bd36c396a1af 100644 --- a/libarchive/test/test_read_disk.c +++ b/libarchive/test/test_read_disk.c @@ -126,7 +126,8 @@ DEFINE_TEST(test_read_disk) /* Get the group name for group 0 and see if it makes sense. */ p = archive_read_disk_gname(a, 0); - if (assert(p != NULL)) { + assert(p != NULL); + if (p != NULL) { i = 0; while (i < sizeof(zero_groups)/sizeof(zero_groups[0])) { if (strcmp(zero_groups[i], p) == 0) diff --git a/libarchive/test/test_read_extract.c b/libarchive/test/test_read_extract.c index d7de26b6ee61..c537e4f936c4 100644 --- a/libarchive/test/test_read_extract.c +++ b/libarchive/test/test_read_extract.c @@ -45,7 +45,7 @@ DEFINE_TEST(test_read_extract) /* Create a new archive in memory containing various types of entries. */ assert((a = archive_write_new()) != NULL); assertA(0 == archive_write_set_format_ustar(a)); - assertA(0 == archive_write_set_compression_none(a)); + assertA(0 == archive_write_add_filter_none(a)); assertA(0 == archive_write_open_memory(a, buff, BUFF_SIZE, &used)); /* A directory to be restored with EXTRACT_PERM. */ ++numEntries; diff --git a/libarchive/test/test_read_filter_grzip.c b/libarchive/test/test_read_filter_grzip.c new file mode 100644 index 000000000000..43bd5bca2658 --- /dev/null +++ b/libarchive/test/test_read_filter_grzip.c @@ -0,0 +1,67 @@ +/*- + * 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. + */ +#include "test.h" + +DEFINE_TEST(test_read_filter_grzip) +{ + const char *name = "test_read_filter_grzip.tar.grz"; + /* grzip tracks directories as files, ensure that we list everything */ + const char *n[] = { + "f1", "f2", "f3", "d1/f1", "d1/f2", "d1/f3", NULL }; + struct archive_entry *ae; + struct archive *a; + int i; + + if (!canGrzip()) { + skipping("grzip command-line program not found"); + return; + } + + assert((a = archive_read_new()) != NULL); + assertEqualIntA(a, ARCHIVE_WARN, archive_read_support_filter_grzip(a)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a)); + extract_reference_file(name); + assertEqualIntA(a, ARCHIVE_OK, + archive_read_open_filename(a, name, 200)); + + /* Read entries, match up names with list above. */ + for (i = 0; n[i] != NULL; ++i) { + failure("Could not read file %d (%s) from %s", i, n[i], name); + assertEqualIntA(a, ARCHIVE_OK, + archive_read_next_header(a, &ae)); + assertEqualString(n[i], archive_entry_pathname(ae)); + } + + /* Verify the end-of-archive. */ + assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae)); + + /* Verify that the format detection worked. */ + assertEqualInt(archive_filter_code(a, 0), ARCHIVE_FILTER_GRZIP); + assertEqualString(archive_filter_name(a, 0), "grzip"); + assertEqualInt(archive_format(a), ARCHIVE_FORMAT_TAR_USTAR); + + assertEqualInt(ARCHIVE_OK, archive_read_close(a)); + assertEqualInt(ARCHIVE_OK, archive_read_free(a)); +} diff --git a/libarchive/test/test_read_filter_grzip.tar.grz.uu b/libarchive/test/test_read_filter_grzip.tar.grz.uu new file mode 100644 index 000000000000..3f55b9347cbd --- /dev/null +++ b/libarchive/test/test_read_filter_grzip.tar.grz.uu @@ -0,0 +1,8 @@ +begin 644 test_read_filter_grzip.tar.grz +M1U)::7!)20`"!#HI`!P``*P,```L`0``\````)D```#Y.$+F+B8PQP#^C=PP +MI/#7H?$H,(_!0<=O!,4![T/;;'S,=B0_3(R1=9"=YKA%RKR-\,+PJIO2]!I*2V31X]P[DN$GOEND]NJE=5AP+]64N7$3):G02EKP>+AD`!IH`HQ(` +M```R#$'@#E`G"/SW..;YC%X%73G3%U_;&GA#Y7N&P\[%?V!^'>:#?(>JQW** +M1]!%JV?=U`TD.@:H85S[7D\VH/]%6JQ>/;HI.E&)I2N1_M4BU:942T`-IN<9%AZFZVY]'A)5%EY;Y0S/4MGN]Y +D9.U/9Y/!R!PQ$O_\1>]J_8\^I0",9(YV]K_!A:WK9='*J7,1 +` +end diff --git a/libarchive/test/test_read_filter_lzop.c b/libarchive/test/test_read_filter_lzop.c new file mode 100644 index 000000000000..86a5e6e84482 --- /dev/null +++ b/libarchive/test/test_read_filter_lzop.c @@ -0,0 +1,74 @@ +/*- + * Copyright (c) 2003-2008 Tim Kientzle + * Copyright (c) 2012 Michihiro NAKAJIMA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#include "test.h" + +DEFINE_TEST(test_read_filter_lzop) +{ + const char *reference = "test_read_filter_lzop.tar.lzo"; + /* lrzip tracks directories as files, ensure that we list everything */ + const char *n[] = { + "d1/", "d1/f2", "d1/f3", "d1/f1", "f1", "f2", "f3", NULL }; + struct archive_entry *ae; + struct archive *a; + int i, r; + + extract_reference_file(reference); + assert((a = archive_read_new()) != NULL); + r = archive_read_support_filter_lzop(a); + if (r != ARCHIVE_OK) { + if (r == ARCHIVE_WARN && !canLzop()) { + assertEqualInt(ARCHIVE_OK, archive_read_free(a)); + skipping("lzop compression is not supported " + "on this platform"); + } else + assertEqualIntA(a, ARCHIVE_OK, r); + return; + } + assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a)); + assertEqualIntA(a, ARCHIVE_OK, + archive_read_open_filename(a, reference, 10240)); + + /* Read entries, match up names with list above. */ + for (i = 0; n[i] != NULL; ++i) { + failure("Could not read file %d (%s) from %s", + i, n[i], reference); + assertEqualIntA(a, ARCHIVE_OK, + archive_read_next_header(a, &ae)); + assertEqualString(n[i], archive_entry_pathname(ae)); + } + + /* Verify the end-of-archive. */ + assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae)); + + /* Verify that the format detection worked. */ + assertEqualInt(archive_filter_count(a), 2); + assertEqualInt(archive_filter_code(a, 0), ARCHIVE_FILTER_LZOP); + assertEqualString(archive_filter_name(a, 0), "lzop"); + assertEqualInt(archive_format(a), ARCHIVE_FORMAT_TAR_USTAR); + + assertEqualInt(ARCHIVE_OK, archive_read_close(a)); + assertEqualInt(ARCHIVE_OK, archive_read_free(a)); +} diff --git a/libarchive/test/test_read_filter_lzop.tar.lzo.uu b/libarchive/test/test_read_filter_lzop.tar.lzo.uu new file mode 100644 index 000000000000..d5fcc3026bf5 --- /dev/null +++ b/libarchive/test/test_read_filter_lzop.tar.lzo.uu @@ -0,0 +1,11 @@ +begin 664 test_read_filter_lzop.tar.lzo +MB4Q:3P`-"AH*$#`@8`E``04#```!``"!M%!PQ.T`````&71E`V0Q+P```"`]```+,#`P +M-S@'A`L@%/T',"``1OT'9B`_\P<````@#?T'-W__-C8V(`!'_`<@ +M/_`?(!?]!S<@`$?\!R`_\!\@%OT'-R``1_P7@/0@````RA````$````````` +3````````````````$0`````````` +` +end diff --git a/libarchive/test/test_read_filter_lzop_multiple_parts.c b/libarchive/test/test_read_filter_lzop_multiple_parts.c new file mode 100644 index 000000000000..3b0febbd785c --- /dev/null +++ b/libarchive/test/test_read_filter_lzop_multiple_parts.c @@ -0,0 +1,72 @@ +/*- + * Copyright (c) 2003-2008 Tim Kientzle + * Copyright (c) 2012 Michihiro NAKAJIMA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#include "test.h" + +DEFINE_TEST(test_read_filter_lzop_multiple_parts) +{ + const char *reference = "test_read_filter_lzop_multiple_parts.tar.lzo"; + struct archive_entry *ae; + struct archive *a; + int r; + + extract_reference_file(reference); + assert((a = archive_read_new()) != NULL); + r = archive_read_support_filter_lzop(a); + if (r != ARCHIVE_OK) { + if (r == ARCHIVE_WARN && !canLzop()) { + assertEqualInt(ARCHIVE_OK, archive_read_free(a)); + skipping("lzop compression is not supported " + "on this platform"); + } else + assertEqualIntA(a, ARCHIVE_OK, r); + return; + } + assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a)); + assertEqualIntA(a, ARCHIVE_OK, + archive_read_open_filename(a, reference, 10240)); + + assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); + assertEqualString("file1", archive_entry_pathname(ae)); + assertEqualInt(19, archive_entry_size(ae)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); + assertEqualString("file2", archive_entry_pathname(ae)); + assertEqualInt(262144, archive_entry_size(ae)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); + assertEqualString("file3", archive_entry_pathname(ae)); + assertEqualInt(19, archive_entry_size(ae)); + + /* Verify the end-of-archive. */ + assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae)); + + /* Verify that the format detection worked. */ + assertEqualInt(archive_filter_count(a), 2); + assertEqualInt(archive_filter_code(a, 0), ARCHIVE_FILTER_LZOP); + assertEqualString(archive_filter_name(a, 0), "lzop"); + assertEqualInt(archive_format(a), ARCHIVE_FORMAT_TAR_USTAR); + + assertEqualInt(ARCHIVE_OK, archive_read_close(a)); + assertEqualInt(ARCHIVE_OK, archive_read_free(a)); +} diff --git a/libarchive/test/test_read_filter_lzop_multiple_parts.tar.lzo.uu b/libarchive/test/test_read_filter_lzop_multiple_parts.tar.lzo.uu new file mode 100644 index 000000000000..4f8fcbf06c79 --- /dev/null +++ b/libarchive/test/test_read_filter_lzop_multiple_parts.tar.lzo.uu @@ -0,0 +1,89 @@ +begin 664 test_read_filter_lzop_multiple_parts.tar.lzo +MB4Q:3P`-"AH*$#`@8`E``04#```!``"!M%"`KW@`````"W1E?S4W(`!&_`\@/N@'(``````` +M`````````````````````````````````````)!X`0X````````````````` +M`````!$```````")3%I/``T*&@H0,"!@"4`!!0,```$``(&T4("O>``````+ +M=&5S=%]L>F]P86)^0`CR```H`````$DH```!`@``````(``````````````` +M`````````````````````````````````````.X0```!```````````````` +M`````````!$```````")3%I/``T*&@H0,"!@"4`!!0,```$``(&T4("O>``` +M```+=&5S=%]L>F]P86-^00CS```H`````$DH```!`@``````(``````````` +M`````````````````````````````````````````.X0```!```````````` +M`````````````!$```````")3%I/``T*&@H0,"!@"4`!!0,```$``(&T4("O +M>``````+=&5S=%]L>F]P861^0@CT```H`````$DH```!`@``````(``````` +M`````````````````````````````````````````````.X0```!```````` +M`````````````````!$```````")3%I/``T*&@H0,"!@"4`!!0,```$``(&T +M4("O>``````+=&5S=%]L>F]P865^0PCU```H`````$DH```!`@``````(``` +M`````````````````````````````````````````````````.X0```!```` +M`````````````````````!$```````")3%I/``T*&@H0,"!@"4`!!0,```$` +M`(&T4("O>``````+=&5S=%]L>F]P869^1`CV```H`````$DH```!`@`````` +M(````````````````````````````````````````````````````.X0```! +M`````````````````````````!$```````")3%I/``T*&@H0,"!@"4`!!0,` +M``$``(&T4("O>``````+=&5S=%]L>F]P86=^10CW```H`````$DH```!`@`` +M````(````````````````````````````````````````````````````.X0 +M```!`````````````````````````!$```````")3%I/``T*&@H0,"!@"4`! +M!0,```$``(&T4("O>``````+=&5S=%]L>F]P86A^1@CX```H`````$DH```! +M`@``````(``````````````````````````````````````````````````` +M`.X0```!`````````````````````````!$```````")3%I/``T*&@H0,"!@ +M"4`!!0,```$``(&T4("O>``````+=&5S=%]L>F]P86E^1PCY```H`````$DH +M```!`@``````(``````````````````````````````````````````````` +M`````.X0```!`````````````````````````!$```````")3%I/``T*&@H0 +M,"!@"4`!!0,```$``(&T4("O>``````+=&5S=%]L>F]P86I^2`CZ```H```` +M`$DH```!`@``````(``````````````````````````````````````````` +M`````````.X0```!`````````````````````````!$```````")3%I/``T* +M&@H0,"!@"4`!!0,```$``(&T4("O>``````+=&5S=%]L>F]P86M^20C[```H +M`````$DH```!`@``````(``````````````````````````````````````` +M`````````````.X0```!`````````````````````````!$```````")3%I/ +M``T*&@H0,"!@"4`!!0,```$``(&T4("O>``````+=&5S=%]L>F]P86Q^2@C\ +M```H`````$DH```!`@``````(``````````````````````````````````` +M`````````````````.X0```!`````````````````````````!$```````") +M3%I/``T*&@H0,"!@"4`!!0,```$``(&T4("O>``````+=&5S=%]L>F]P86U^ +M2PC]```H`````$DH```!`@``````(``````````````````````````````` +M`````````````````````.X0```!`````````````````````````!$````` +M``")3%I/``T*&@H0,"!@"4`!!0,```$``(&T4("O>``````+=&5S=%]L>F]P +M86Y^3`C^```H`````$DH```!`@``````(``````````````````````````` +M`````````````````````````.X0```!`````````````````````````!$` +M``````")3%I/``T*&@H0,"!@"4`!!0,```$``(&T4("O>``````+=&5S=%]L +M>F]P86]^30C_```H`````$DH```!`@``````(``````````````````````` +M`````````````````````````````.X0```!```````````````````````` +M`!$```````")3%I/``T*&@H0,"!@"4`!!0,```$``(&T4("O>``````+=&5S +M=%]L>F]P87!^3@D````H`````$DH```!`@``````(``````````````````` +M`````````````````````````````````.X0```!```````````````````` +M`````!$```````")3%I/``T*&@H0,"!@"4`!!0,```$``(&T4("O>``````+ +M=&5S=%]L>F]P87%^3PD!```H`````$DH```!`@``````(``````````````` +M`````````````````````````````````````.X0```!```````````````` +M`````````!$```````")3%I/``T*&@H0,"!@"4`!!0,```$``(&T4("O>``` +M```+=&5S=%]L>F]P87)^4`D"```H`````$DH```!`@``````(``````````` +M`````````````````````````````````````````.X0```!```````````` +M`````````````!$```````")3%I/``T*&@H0,"!@"4`!!0,```$``(&T4("O +M>``````+=&5S=%]L>F]P87-^40D#```H`````$DH```!`@``````(``````` +M`````````````````````````````````````````````.X0```!```````` +M`````````````````!$```````")3%I/``T*&@H0,"!@"4`!!0,```$``(&T +M4("O>``````+=&5S=%]L>F]P871^4@D$```H`````$DH```!`@``````(``` +M`````````````````````````````````````````````````.X0```!```` +M`````````````````````!$```````")3%I/``T*&@H0,"!@"4`!!0,```$` +M`(&T4("O>``````+=&5S=%]L>F]P875^4PD%```H`````$DH```!`@`````` +M(````````````````````````````````````````````````````.X0```! +M`````````````````````````!$```````")3%I/``T*&@H0,"!@"4`!!0,` +M``$``(&T4("O>``````+=&5S=%]L>F]P879^5`D&```H`````$DH```!`@`` +M````(````````````````````````````````````````````````````.X0 +M```!`````````````````````````!$```````")3%I/``T*&@H0,"!@"4`! +M!0,```$``(&T4("O>``````+=&5S=%]L>F]P87=^50D'```H`````$DH```! +M`@``````(``````````````````````````````````````````````````` +M`.X0```!`````````````````````````!$```````")3%I/``T*&@H0,"!@ +M"4`!!0,```$``(&T4("O>``````+=&5S=%]L>F]P87A^5@D(```H`````$DH +M```!`@``````(``````````````````````````````````````````````` +M`````.X0```!`````````````````````````!$```````")3%I/``T*&@H0 +M,"!@"4`!!0,```$``(&T4("O>``````+=&5S=%]L>F]P87E^5PD)```H```` +M`$DH```!`@``````(``````````````````````````````````````````` +M`````````.X0```!`````````````````````````!$```````")3%I/``T* +M&@H0,"!@"4`!!0,```$``(&T4("O>``````+=&5S=%]L>F]P87I^6`D*```F +M`````+OSXAG6`@``````(``````````````````````````````````````` +M]Q```F9I;&4S(#[\=PLP,#`V-C0@`#`P,3/1A2\n" +"IHU\"0%9=*G4JUJM6K6+-JWO8,.*'4NVK-FS:-.J7\n" +"Received: from libarchive (localhost [127.0.0.1])\n" +" by libarchive (8.14.2/8.14.2) with ESMTP id m5233UT1006448\n" +" for ; Mon, 2 Jun 2008 03:03:31 GMT\n" +" (envelope-from uudecode@libarchive)\n" +"Received: (from uudecode@localhost)\n" +" by libarchive (8.14.2/8.14.2/Submit) id m5233U3e006406\n" +" for uudecode; Mon, 2 Jun 2008 03:03:30 GMT\n" +" (envelope-from root)\n" +"Date: Mon, 2 Jun 2008 03:03:30 GMT\n" +"From: Libarchive Test \n" +"Message-Id: <200806020303.m5233U3e006406@libarchive>\n" +"To: uudecode@libarchive\n" +"Subject: Libarchive uudecode test\n" +"\n" +"* Redistribution and use in source and binary forms, with or without\n" +"* modification, are permitted provided that the following conditions\n" +"* are met:\n" +"\n" +"01234567890abcdeghijklmnopqrstuvwxyz\n" +"01234567890ABCEFGHIJKLMNOPQRSTUVWXYZ\n" +"\n" +}; + +static void +test_read_uu_sub(const char *uudata, size_t uusize, int no_nl) +{ + struct archive_entry *ae; + struct archive *a; + char *buff; + char extradata_no_nl[sizeof(extradata)]; + const char *extradata_ptr; + int extra; + size_t size; + + if (no_nl) { + /* Remove '\n' from extra data to make a very long line. */ + char *p; + memcpy(extradata_no_nl, extradata, sizeof(extradata)); + extradata_ptr = extradata_no_nl; + for (p = extradata_no_nl; + *p && (p = strchr(p, '\n')) != NULL; p++) + *p = ' ';/* Replace '\n' with ' ' a space character. */ + } else + extradata_ptr = extradata; + + assert(NULL != (buff = malloc(uusize + 1024 * 1024))); + if (buff == NULL) + return; + for (extra = 0; extra <= 64; extra = extra==0?1:extra*2) { + char *p = buff; + + size = extra * 1024; + /* Add extra text size of which is from 1K bytes to + * 64Kbytes before uuencoded data. */ + while (size) { + if (size > sizeof(extradata)-1) { + memcpy(p, extradata_ptr, sizeof(extradata)-1); + p += sizeof(extradata)-1; + size -= sizeof(extradata)-1; + } else { + memcpy(p, extradata_ptr, size-1); + p += size-1; + *p++ = '\n';/* the last of extra text must have + * '\n' character. */ + break; + } + } + memcpy(p, uudata, uusize); + size = extra * 1024 + uusize; + + 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, + read_open_memory(a, buff, size, 2)); + assertEqualIntA(a, ARCHIVE_OK, + archive_read_next_header(a, &ae)); + failure("archive_filter_name(a, 0)=\"%s\"" + "extra %d, NL %d", + archive_filter_name(a, 0), extra, !no_nl); + assertEqualInt(archive_filter_code(a, 0), + ARCHIVE_FILTER_COMPRESS); + failure("archive_format_name(a)=\"%s\"" + "extra %d, NL %d", + archive_format_name(a), extra, !no_nl); + assertEqualInt(archive_format(a), + ARCHIVE_FORMAT_TAR_USTAR); + assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a)); + assertEqualInt(ARCHIVE_OK, archive_read_free(a)); + } + + /* UUdecode bidder shouldn't scan too much data; make sure it + * fails if we put 512k of data before the start. */ + size = 512 * 1024; + for (extra = 0; (size_t)extra < size; ++extra) + buff[extra + 1024] = buff[extra]; + buff[size - 1] = '\n'; + memcpy(buff + size, uudata, uusize); + size += uusize; + 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_FATAL, + read_open_memory(a, buff, size, 2)); + assertEqualInt(ARCHIVE_OK, archive_read_free(a)); + + free(buff); +} + +DEFINE_TEST(test_read_filter_uudecode) +{ + /* Read the traditional uuencoded data. */ + test_read_uu_sub(archive, sizeof(archive)-1, 0); + /* Read the traditional uuencoded data with very long line extra + * data in front of it. */ + test_read_uu_sub(archive, sizeof(archive)-1, 1); +} + +DEFINE_TEST(test_read_filter_uudecode_base64) +{ + /* Read the Base64 uuencoded data. */ + test_read_uu_sub(archive64, sizeof(archive64)-1, 0); + /* Read the Base64 uuencoded data with very long line extra data + * in front of it. */ + test_read_uu_sub(archive64, sizeof(archive64)-1, 1); +} diff --git a/libarchive/test/test_read_format_7zip.c b/libarchive/test/test_read_format_7zip.c index 043ef9f4e532..62657a82165a 100644 --- a/libarchive/test/test_read_format_7zip.c +++ b/libarchive/test/test_read_format_7zip.c @@ -59,7 +59,7 @@ test_copy() assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae)); /* Verify archive format. */ - assertEqualIntA(a, ARCHIVE_COMPRESSION_NONE, archive_compression(a)); + assertEqualIntA(a, ARCHIVE_FILTER_NONE, archive_filter_code(a, 0)); assertEqualIntA(a, ARCHIVE_FORMAT_7ZIP, archive_format(a)); /* Close the archive. */ @@ -90,7 +90,7 @@ test_empty_archive() assertEqualInt(0, archive_file_count(a)); /* Verify archive format. */ - assertEqualIntA(a, ARCHIVE_COMPRESSION_NONE, archive_compression(a)); + assertEqualIntA(a, ARCHIVE_FILTER_NONE, archive_filter_code(a, 0)); assertEqualIntA(a, ARCHIVE_FORMAT_7ZIP, archive_format(a)); /* Close the archive. */ @@ -129,7 +129,7 @@ test_empty_file() assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae)); /* Verify archive format. */ - assertEqualIntA(a, ARCHIVE_COMPRESSION_NONE, archive_compression(a)); + assertEqualIntA(a, ARCHIVE_FILTER_NONE, archive_filter_code(a, 0)); assertEqualIntA(a, ARCHIVE_FORMAT_7ZIP, archive_format(a)); /* Close the archive. */ @@ -170,7 +170,7 @@ test_plain_header(const char *refname) assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae)); /* Verify archive format. */ - assertEqualIntA(a, ARCHIVE_COMPRESSION_NONE, archive_compression(a)); + assertEqualIntA(a, ARCHIVE_FILTER_NONE, archive_filter_code(a, 0)); assertEqualIntA(a, ARCHIVE_FORMAT_7ZIP, archive_format(a)); /* Close the archive. */ @@ -245,7 +245,7 @@ test_extract_all_files(const char *refname) assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae)); /* Verify archive format. */ - assertEqualIntA(a, ARCHIVE_COMPRESSION_NONE, archive_compression(a)); + assertEqualIntA(a, ARCHIVE_FILTER_NONE, archive_filter_code(a, 0)); assertEqualIntA(a, ARCHIVE_FORMAT_7ZIP, archive_format(a)); /* Close the archive. */ @@ -314,7 +314,7 @@ test_extract_last_file(const char *refname) assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae)); /* Verify archive format. */ - assertEqualIntA(a, ARCHIVE_COMPRESSION_NONE, archive_compression(a)); + assertEqualIntA(a, ARCHIVE_FILTER_NONE, archive_filter_code(a, 0)); assertEqualIntA(a, ARCHIVE_FORMAT_7ZIP, archive_format(a)); /* Close the archive. */ @@ -427,7 +427,7 @@ test_extract_all_files2(const char *refname) assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae)); /* Verify archive format. */ - assertEqualIntA(a, ARCHIVE_COMPRESSION_NONE, archive_compression(a)); + assertEqualIntA(a, ARCHIVE_FILTER_NONE, archive_filter_code(a, 0)); assertEqualIntA(a, ARCHIVE_FORMAT_7ZIP, archive_format(a)); /* Close the archive. */ @@ -481,7 +481,7 @@ test_delta_lzma(const char *refname) assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae)); /* Verify archive format. */ - assertEqualIntA(a, ARCHIVE_COMPRESSION_NONE, archive_compression(a)); + assertEqualIntA(a, ARCHIVE_FILTER_NONE, archive_filter_code(a, 0)); assertEqualIntA(a, ARCHIVE_FORMAT_7ZIP, archive_format(a)); /* Close the archive. */ @@ -535,7 +535,7 @@ test_bcj(const char *refname) assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae)); /* Verify archive format. */ - assertEqualIntA(a, ARCHIVE_COMPRESSION_NONE, archive_compression(a)); + assertEqualIntA(a, ARCHIVE_FILTER_NONE, archive_filter_code(a, 0)); assertEqualIntA(a, ARCHIVE_FORMAT_7ZIP, archive_format(a)); /* Close the archive. */ @@ -590,7 +590,7 @@ test_ppmd() assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae)); /* Verify archive format. */ - assertEqualIntA(a, ARCHIVE_COMPRESSION_NONE, archive_compression(a)); + assertEqualIntA(a, ARCHIVE_FILTER_NONE, archive_filter_code(a, 0)); assertEqualIntA(a, ARCHIVE_FORMAT_7ZIP, archive_format(a)); /* Close the archive. */ @@ -635,7 +635,7 @@ test_symname() assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae)); /* Verify archive format. */ - assertEqualIntA(a, ARCHIVE_COMPRESSION_NONE, archive_compression(a)); + assertEqualIntA(a, ARCHIVE_FILTER_NONE, archive_filter_code(a, 0)); assertEqualIntA(a, ARCHIVE_FORMAT_7ZIP, archive_format(a)); /* Close the archive. */ @@ -648,13 +648,24 @@ DEFINE_TEST(test_read_format_7zip) { struct archive *a; - test_copy(); - test_empty_archive(); - test_empty_file(); - test_ppmd(); - test_bcj("test_read_format_7zip_bcj_copy.7z"); - test_bcj("test_read_format_7zip_bcj2_copy_1.7z"); - test_bcj("test_read_format_7zip_bcj2_copy_2.7z"); + assert((a = archive_read_new()) != NULL); + + /* Extracting with liblzma */ + if (ARCHIVE_OK != archive_read_support_filter_xz(a)) { + skipping("7zip:lzma decoding is not supported on this platform"); + } else { + test_symname(); + test_extract_all_files("test_read_format_7zip_copy_2.7z"); + test_extract_last_file("test_read_format_7zip_copy_2.7z"); + test_extract_all_files2("test_read_format_7zip_lzma1_lzma2.7z"); + test_bcj("test_read_format_7zip_bcj2_copy_lzma.7z"); + } + assertEqualInt(ARCHIVE_OK, archive_read_free(a)); +} + +DEFINE_TEST(test_read_format_7zip_bzip2) +{ + struct archive *a; assert((a = archive_read_new()) != NULL); @@ -667,37 +678,83 @@ DEFINE_TEST(test_read_format_7zip) test_bcj("test_read_format_7zip_bcj2_bzip2.7z"); } + assertEqualInt(ARCHIVE_OK, archive_read_free(a)); +} + +DEFINE_TEST(test_read_format_7zip_copy) +{ + test_copy(); + test_bcj("test_read_format_7zip_bcj_copy.7z"); + test_bcj("test_read_format_7zip_bcj2_copy_1.7z"); + test_bcj("test_read_format_7zip_bcj2_copy_2.7z"); +} + +DEFINE_TEST(test_read_format_7zip_deflate) +{ + struct archive *a; + + assert((a = archive_read_new()) != NULL); + /* Extracting with libz */ if (ARCHIVE_OK != archive_read_support_filter_gzip(a)) { - skipping("7zip:deflate decoding is not supported on this platform"); + skipping( + "7zip:deflate decoding is not supported on this platform"); } else { test_plain_header("test_read_format_7zip_deflate.7z"); test_bcj("test_read_format_7zip_bcj_deflate.7z"); test_bcj("test_read_format_7zip_bcj2_deflate.7z"); } + assertEqualInt(ARCHIVE_OK, archive_read_free(a)); +} + +DEFINE_TEST(test_read_format_7zip_empty) +{ + test_empty_archive(); + test_empty_file(); +} + +DEFINE_TEST(test_read_format_7zip_lzma1) +{ + struct archive *a; + + assert((a = archive_read_new()) != NULL); + /* Extracting with liblzma */ if (ARCHIVE_OK != archive_read_support_filter_xz(a)) { skipping("7zip:lzma decoding is not supported on this platform"); } else { - test_symname(); test_plain_header("test_read_format_7zip_lzma1.7z"); - test_plain_header("test_read_format_7zip_lzma2.7z"); - test_extract_all_files("test_read_format_7zip_copy_2.7z"); test_extract_all_files("test_read_format_7zip_lzma1_2.7z"); - test_extract_last_file("test_read_format_7zip_copy_2.7z"); test_extract_last_file("test_read_format_7zip_lzma1_2.7z"); - test_extract_all_files2("test_read_format_7zip_lzma1_lzma2.7z"); test_bcj("test_read_format_7zip_bcj_lzma1.7z"); - test_bcj("test_read_format_7zip_bcj_lzma2.7z"); - test_bcj("test_read_format_7zip_bcj2_copy_lzma.7z"); test_bcj("test_read_format_7zip_bcj2_lzma1_1.7z"); test_bcj("test_read_format_7zip_bcj2_lzma1_2.7z"); + test_delta_lzma("test_read_format_7zip_delta_lzma1.7z"); + } + assertEqualInt(ARCHIVE_OK, archive_read_free(a)); +} + +DEFINE_TEST(test_read_format_7zip_lzma2) +{ + struct archive *a; + + assert((a = archive_read_new()) != NULL); + + /* Extracting with liblzma */ + if (ARCHIVE_OK != archive_read_support_filter_xz(a)) { + skipping("7zip:lzma decoding is not supported on this platform"); + } else { + test_plain_header("test_read_format_7zip_lzma2.7z"); + test_bcj("test_read_format_7zip_bcj_lzma2.7z"); test_bcj("test_read_format_7zip_bcj2_lzma2_1.7z"); test_bcj("test_read_format_7zip_bcj2_lzma2_2.7z"); - test_delta_lzma("test_read_format_7zip_delta_lzma1.7z"); test_delta_lzma("test_read_format_7zip_delta_lzma2.7z"); } assertEqualInt(ARCHIVE_OK, archive_read_free(a)); } +DEFINE_TEST(test_read_format_7zip_ppmd) +{ + test_ppmd(); +} diff --git a/libarchive/test/test_read_format_ar.c b/libarchive/test/test_read_format_ar.c index a7ec62d4928f..e70d1ae552bf 100644 --- a/libarchive/test/test_read_format_ar.c +++ b/libarchive/test/test_read_format_ar.c @@ -40,7 +40,7 @@ DEFINE_TEST(test_read_format_ar) 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_file(a, reffile, 7)); + assertA(0 == archive_read_open_filename(a, reffile, 7)); /* Filename table. */ assertA(0 == archive_read_next_header(a, &ae)); diff --git a/libarchive/test/test_read_format_cab.c b/libarchive/test/test_read_format_cab.c index 004d6e8a93e7..e09d46d23835 100644 --- a/libarchive/test/test_read_format_cab.c +++ b/libarchive/test/test_read_format_cab.c @@ -260,7 +260,7 @@ verify(const char *refname, enum comp_type comp) } /* Verify archive format. */ - assertEqualIntA(a, ARCHIVE_COMPRESSION_NONE, archive_compression(a)); + assertEqualIntA(a, ARCHIVE_FILTER_NONE, archive_filter_code(a, 0)); assertEqualIntA(a, ARCHIVE_FORMAT_CAB, archive_format(a)); /* Close the archive. */ @@ -280,6 +280,11 @@ verify2(const char *refname, enum comp_type comp) char buff[128]; char zero[128]; + if (comp == MSZIP && !libz_enabled) { + skipping("Skipping CAB format(MSZIP) check for %s", + refname); + return; + } memset(zero, 0, sizeof(zero)); extract_reference_file(refname); assert((a = archive_read_new()) != NULL); @@ -316,7 +321,7 @@ verify2(const char *refname, enum comp_type comp) } /* Verify archive format. */ - assertEqualIntA(a, ARCHIVE_COMPRESSION_NONE, archive_compression(a)); + assertEqualIntA(a, ARCHIVE_FILTER_NONE, archive_filter_code(a, 0)); assertEqualIntA(a, ARCHIVE_FORMAT_CAB, archive_format(a)); /* Close the archive. */ @@ -363,7 +368,7 @@ verify3(const char *refname, enum comp_type comp) } /* Verify archive format. */ - assertEqualIntA(a, ARCHIVE_COMPRESSION_NONE, archive_compression(a)); + assertEqualIntA(a, ARCHIVE_FILTER_NONE, archive_filter_code(a, 0)); assertEqualIntA(a, ARCHIVE_FORMAT_CAB, archive_format(a)); /* Close the archive. */ diff --git a/libarchive/test/test_read_format_cab_filename.c b/libarchive/test/test_read_format_cab_filename.c index 54374deb9b37..f148590ff508 100644 --- a/libarchive/test/test_read_format_cab_filename.c +++ b/libarchive/test/test_read_format_cab_filename.c @@ -71,7 +71,7 @@ test_read_format_cab_filename_CP932_eucJP(const char *refname) assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae)); /* Verify archive format. */ - assertEqualIntA(a, ARCHIVE_COMPRESSION_NONE, archive_compression(a)); + assertEqualIntA(a, ARCHIVE_FILTER_NONE, archive_filter_code(a, 0)); assertEqualIntA(a, ARCHIVE_FORMAT_CAB, archive_format(a)); /* Close the archive. */ @@ -145,7 +145,7 @@ test_read_format_cab_filename_CP932_UTF8(const char *refname) assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae)); /* Verify archive format. */ - assertEqualIntA(a, ARCHIVE_COMPRESSION_NONE, archive_compression(a)); + assertEqualIntA(a, ARCHIVE_FILTER_NONE, archive_filter_code(a, 0)); assertEqualIntA(a, ARCHIVE_FORMAT_CAB, archive_format(a)); /* Close the archive. */ diff --git a/libarchive/test/test_read_format_cpio_afio.c b/libarchive/test/test_read_format_cpio_afio.c index 7aec833c2302..db6003f95a60 100644 --- a/libarchive/test/test_read_format_cpio_afio.c +++ b/libarchive/test/test_read_format_cpio_afio.c @@ -84,7 +84,8 @@ DEFINE_TEST(test_read_format_cpio_afio) /* The default block size of afio is 5120. we simulate it */ size = (sizeof(archive) + 5120 -1 / 5120) * 5120; - if (!assert((p = malloc(size)) != NULL)) + assert((p = malloc(size)) != NULL); + if (p == NULL) return; memset(p, 0, size); memcpy(p, archive, sizeof(archive)); @@ -97,7 +98,7 @@ DEFINE_TEST(test_read_format_cpio_afio) */ assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); assertEqualInt(17, archive_entry_size(ae)); - assertA(archive_compression(a) == ARCHIVE_COMPRESSION_NONE); + assertA(archive_filter_code(a, 0) == ARCHIVE_FILTER_NONE); assertA(archive_format(a) == ARCHIVE_FORMAT_CPIO_POSIX); /* * Second entry is afio large ASCII format. @@ -106,7 +107,7 @@ DEFINE_TEST(test_read_format_cpio_afio) assertEqualInt(17, archive_entry_size(ae)); if (uid_size() > 4) assertEqualInt(65536, archive_entry_uid(ae)); - assertA(archive_compression(a) == ARCHIVE_COMPRESSION_NONE); + assertA(archive_filter_code(a, 0) == ARCHIVE_FILTER_NONE); assertA(archive_format(a) == ARCHIVE_FORMAT_CPIO_AFIO_LARGE); assertEqualInt(ARCHIVE_OK, archive_read_close(a)); assertEqualInt(ARCHIVE_OK, archive_read_free(a)); diff --git a/libarchive/test/test_read_format_cpio_bin.c b/libarchive/test/test_read_format_cpio_bin.c index 42ec4214f91f..e65cb9b3870c 100644 --- a/libarchive/test/test_read_format_cpio_bin.c +++ b/libarchive/test/test_read_format_cpio_bin.c @@ -52,7 +52,7 @@ DEFINE_TEST(test_read_format_cpio_bin) assertEqualIntA(a, 0, archive_read_open_memory(a, archive, sizeof(archive))); assertEqualIntA(a, 0, archive_read_next_header(a, &ae)); assertEqualInt(1, archive_file_count(a)); - assertEqualIntA(a, ARCHIVE_COMPRESSION_NONE, archive_compression(a)); + assertEqualIntA(a, ARCHIVE_FILTER_NONE, archive_filter_code(a, 0)); assertEqualIntA(a, ARCHIVE_FORMAT_CPIO_BIN_LE, archive_format(a)); assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a)); assertEqualInt(ARCHIVE_OK, archive_read_free(a)); diff --git a/libarchive/test/test_read_format_cpio_bin_Z.c b/libarchive/test/test_read_format_cpio_bin_Z.c index e818a01ac1a2..8aca71f2476d 100644 --- a/libarchive/test/test_read_format_cpio_bin_Z.c +++ b/libarchive/test/test_read_format_cpio_bin_Z.c @@ -44,10 +44,10 @@ DEFINE_TEST(test_read_format_cpio_bin_Z) archive_read_open_memory(a, archive, sizeof(archive))); assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); assertEqualInt(1, archive_file_count(a)); - failure("archive_compression_name(a)=\"%s\"", - archive_compression_name(a)); - assertEqualInt(archive_compression(a), ARCHIVE_COMPRESSION_COMPRESS); - assertEqualString(archive_compression_name(a), "compress (.Z)"); + failure("archive_filter_name(a, 0)=\"%s\"", + archive_filter_name(a, 0)); + assertEqualInt(archive_filter_code(a, 0), ARCHIVE_FILTER_COMPRESS); + assertEqualString(archive_filter_name(a, 0), "compress (.Z)"); failure("archive_format_name(a)=\"%s\"", archive_format_name(a)); assertEqualInt(archive_format(a), ARCHIVE_FORMAT_CPIO_BIN_LE); diff --git a/libarchive/test/test_read_format_cpio_bin_be.c b/libarchive/test/test_read_format_cpio_bin_be.c index 534471a1ca8a..dfd664c9a4d2 100644 --- a/libarchive/test/test_read_format_cpio_bin_be.c +++ b/libarchive/test/test_read_format_cpio_bin_be.c @@ -45,7 +45,7 @@ DEFINE_TEST(test_read_format_cpio_bin_be) assertEqualInt(archive_entry_uid(ae), 1000); assertEqualInt(archive_entry_gid(ae), 0); - assertEqualInt(archive_compression(a), ARCHIVE_COMPRESSION_NONE); + assertEqualInt(archive_filter_code(a, 0), ARCHIVE_FILTER_NONE); assertEqualInt(archive_format(a), ARCHIVE_FORMAT_CPIO_BIN_BE); assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae)); assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a)); diff --git a/libarchive/test/test_read_format_cpio_bin_bz2.c b/libarchive/test/test_read_format_cpio_bin_bz2.c index c19efed88db2..8afbbcd1ebc1 100644 --- a/libarchive/test/test_read_format_cpio_bin_bz2.c +++ b/libarchive/test/test_read_format_cpio_bin_bz2.c @@ -49,7 +49,7 @@ DEFINE_TEST(test_read_format_cpio_bin_bz2) assertEqualIntA(a, ARCHIVE_OK, archive_read_open_memory(a, archive, sizeof(archive))); assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); - assert(archive_compression(a) == ARCHIVE_COMPRESSION_BZIP2); + assert(archive_filter_code(a, 0) == ARCHIVE_FILTER_BZIP2); assert(archive_format(a) == ARCHIVE_FORMAT_CPIO_BIN_LE); assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a)); assertEqualInt(ARCHIVE_OK, archive_read_free(a)); diff --git a/libarchive/test/test_read_format_cpio_bin_gz.c b/libarchive/test/test_read_format_cpio_bin_gz.c index a807b5b190ae..98f53578e129 100644 --- a/libarchive/test/test_read_format_cpio_bin_gz.c +++ b/libarchive/test/test_read_format_cpio_bin_gz.c @@ -51,8 +51,8 @@ DEFINE_TEST(test_read_format_cpio_bin_gz) assertEqualInt(ARCHIVE_OK, archive_read_open_memory(a, archive, sizeof(archive))); assertEqualInt(ARCHIVE_OK, archive_read_next_header(a, &ae)); - assertEqualInt(archive_compression(a), - ARCHIVE_COMPRESSION_GZIP); + assertEqualInt(archive_filter_code(a, 0), + ARCHIVE_FILTER_GZIP); assertEqualInt(archive_format(a), ARCHIVE_FORMAT_CPIO_BIN_LE); assertEqualInt(ARCHIVE_OK, archive_read_close(a)); assertEqualInt(ARCHIVE_OK, archive_read_free(a)); diff --git a/libarchive/test/test_read_format_cpio_bin_lzip.c b/libarchive/test/test_read_format_cpio_bin_lzip.c index 16effb91652b..4e3fb58722fe 100644 --- a/libarchive/test/test_read_format_cpio_bin_lzip.c +++ b/libarchive/test/test_read_format_cpio_bin_lzip.c @@ -53,7 +53,7 @@ DEFINE_TEST(test_read_format_cpio_bin_lzip) assertEqualIntA(a, ARCHIVE_OK, archive_read_open_memory(a, archive, sizeof(archive))); assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); - assertEqualInt(archive_compression(a), ARCHIVE_COMPRESSION_LZIP); + assertEqualInt(archive_filter_code(a, 0), ARCHIVE_FILTER_LZIP); assertEqualInt(archive_format(a), ARCHIVE_FORMAT_CPIO_BIN_LE); assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a)); assertEqualInt(ARCHIVE_OK, archive_read_free(a)); diff --git a/libarchive/test/test_read_format_cpio_bin_lzma.c b/libarchive/test/test_read_format_cpio_bin_lzma.c index e168e2f9c55a..cca19ffa7786 100644 --- a/libarchive/test/test_read_format_cpio_bin_lzma.c +++ b/libarchive/test/test_read_format_cpio_bin_lzma.c @@ -52,7 +52,7 @@ DEFINE_TEST(test_read_format_cpio_bin_lzma) assertEqualIntA(a, ARCHIVE_OK, archive_read_open_memory(a, archive, sizeof(archive))); assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); - assertEqualInt(archive_compression(a), ARCHIVE_COMPRESSION_LZMA); + assertEqualInt(archive_filter_code(a, 0), ARCHIVE_FILTER_LZMA); assertEqualInt(archive_format(a), ARCHIVE_FORMAT_CPIO_BIN_LE); assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a)); assertEqualInt(ARCHIVE_OK, archive_read_free(a)); diff --git a/libarchive/test/test_read_format_cpio_bin_xz.c b/libarchive/test/test_read_format_cpio_bin_xz.c index 7c65da67751d..2b5e6143ca5a 100644 --- a/libarchive/test/test_read_format_cpio_bin_xz.c +++ b/libarchive/test/test_read_format_cpio_bin_xz.c @@ -62,7 +62,7 @@ DEFINE_TEST(test_read_format_cpio_bin_xz) assertEqualIntA(a, ARCHIVE_OK, archive_read_open_memory(a, archive, sizeof(archive))); assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); - assertEqualInt(archive_compression(a), ARCHIVE_COMPRESSION_XZ); + assertEqualInt(archive_filter_code(a, 0), ARCHIVE_FILTER_XZ); assertEqualInt(archive_format(a), ARCHIVE_FORMAT_CPIO_BIN_LE); assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a)); assertEqualInt(ARCHIVE_OK, archive_read_free(a)); diff --git a/libarchive/test/test_read_format_cpio_filename.c b/libarchive/test/test_read_format_cpio_filename.c index e347b506844b..d0c7c7afafff 100644 --- a/libarchive/test/test_read_format_cpio_filename.c +++ b/libarchive/test/test_read_format_cpio_filename.c @@ -68,7 +68,7 @@ test_read_format_cpio_filename_eucJP_UTF8(const char *refname) assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae)); /* Verify archive format. */ - assertEqualIntA(a, ARCHIVE_COMPRESSION_NONE, archive_compression(a)); + assertEqualIntA(a, ARCHIVE_FILTER_NONE, archive_filter_code(a, 0)); assertEqualIntA(a, ARCHIVE_FORMAT_CPIO_POSIX, archive_format(a)); /* Close the archive. */ @@ -119,7 +119,7 @@ test_read_format_cpio_filename_UTF8_eucJP(const char *refname) assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae)); /* Verify archive format. */ - assertEqualIntA(a, ARCHIVE_COMPRESSION_NONE, archive_compression(a)); + assertEqualIntA(a, ARCHIVE_FILTER_NONE, archive_filter_code(a, 0)); assertEqualIntA(a, ARCHIVE_FORMAT_CPIO_POSIX, archive_format(a)); /* Close the archive. */ @@ -166,7 +166,7 @@ test_read_format_cpio_filename_UTF8_UTF8_jp(const char *refname) assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae)); /* Verify archive format. */ - assertEqualIntA(a, ARCHIVE_COMPRESSION_NONE, archive_compression(a)); + assertEqualIntA(a, ARCHIVE_FILTER_NONE, archive_filter_code(a, 0)); assertEqualIntA(a, ARCHIVE_FORMAT_CPIO_POSIX, archive_format(a)); /* Close the archive. */ @@ -217,7 +217,7 @@ test_read_format_cpio_filename_CP866_KOI8R(const char *refname) assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae)); /* Verify archive format. */ - assertEqualIntA(a, ARCHIVE_COMPRESSION_NONE, archive_compression(a)); + assertEqualIntA(a, ARCHIVE_FILTER_NONE, archive_filter_code(a, 0)); assertEqualIntA(a, ARCHIVE_FORMAT_CPIO_POSIX, archive_format(a)); /* Close the archive. */ @@ -268,7 +268,7 @@ test_read_format_cpio_filename_CP866_UTF8(const char *refname) assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae)); /* Verify archive format. */ - assertEqualIntA(a, ARCHIVE_COMPRESSION_NONE, archive_compression(a)); + assertEqualIntA(a, ARCHIVE_FILTER_NONE, archive_filter_code(a, 0)); assertEqualIntA(a, ARCHIVE_FORMAT_CPIO_POSIX, archive_format(a)); /* Close the archive. */ @@ -320,7 +320,7 @@ test_read_format_cpio_filename_KOI8R_CP866(const char *refname) assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae)); /* Verify archive format. */ - assertEqualIntA(a, ARCHIVE_COMPRESSION_NONE, archive_compression(a)); + assertEqualIntA(a, ARCHIVE_FILTER_NONE, archive_filter_code(a, 0)); assertEqualIntA(a, ARCHIVE_FORMAT_CPIO_POSIX, archive_format(a)); /* Close the archive. */ @@ -371,7 +371,7 @@ test_read_format_cpio_filename_KOI8R_UTF8(const char *refname) assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae)); /* Verify archive format. */ - assertEqualIntA(a, ARCHIVE_COMPRESSION_NONE, archive_compression(a)); + assertEqualIntA(a, ARCHIVE_FILTER_NONE, archive_filter_code(a, 0)); assertEqualIntA(a, ARCHIVE_FORMAT_CPIO_POSIX, archive_format(a)); /* Close the archive. */ @@ -423,7 +423,7 @@ test_read_format_cpio_filename_UTF8_KOI8R(const char *refname) assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae)); /* Verify archive format. */ - assertEqualIntA(a, ARCHIVE_COMPRESSION_NONE, archive_compression(a)); + assertEqualIntA(a, ARCHIVE_FILTER_NONE, archive_filter_code(a, 0)); assertEqualIntA(a, ARCHIVE_FORMAT_CPIO_POSIX, archive_format(a)); /* Close the archive. */ @@ -475,7 +475,7 @@ test_read_format_cpio_filename_UTF8_CP866(const char *refname) assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae)); /* Verify archive format. */ - assertEqualIntA(a, ARCHIVE_COMPRESSION_NONE, archive_compression(a)); + assertEqualIntA(a, ARCHIVE_FILTER_NONE, archive_filter_code(a, 0)); assertEqualIntA(a, ARCHIVE_FORMAT_CPIO_POSIX, archive_format(a)); /* Close the archive. */ @@ -521,7 +521,7 @@ test_read_format_cpio_filename_UTF8_UTF8_ru(const char *refname) assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae)); /* Verify archive format. */ - assertEqualIntA(a, ARCHIVE_COMPRESSION_NONE, archive_compression(a)); + assertEqualIntA(a, ARCHIVE_FILTER_NONE, archive_filter_code(a, 0)); assertEqualIntA(a, ARCHIVE_FORMAT_CPIO_POSIX, archive_format(a)); /* Close the archive. */ @@ -570,7 +570,7 @@ test_read_format_cpio_filename_eucJP_CP932(const char *refname) assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae)); /* Verify archive format. */ - assertEqualIntA(a, ARCHIVE_COMPRESSION_NONE, archive_compression(a)); + assertEqualIntA(a, ARCHIVE_FILTER_NONE, archive_filter_code(a, 0)); assertEqualIntA(a, ARCHIVE_FORMAT_CPIO_POSIX, archive_format(a)); /* Close the archive. */ @@ -621,7 +621,7 @@ test_read_format_cpio_filename_UTF8_CP932(const char *refname) assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae)); /* Verify archive format. */ - assertEqualIntA(a, ARCHIVE_COMPRESSION_NONE, archive_compression(a)); + assertEqualIntA(a, ARCHIVE_FILTER_NONE, archive_filter_code(a, 0)); assertEqualIntA(a, ARCHIVE_FORMAT_CPIO_POSIX, archive_format(a)); /* Close the archive. */ @@ -673,7 +673,7 @@ test_read_format_cpio_filename_CP866_CP1251(const char *refname) assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae)); /* Verify archive format. */ - assertEqualIntA(a, ARCHIVE_COMPRESSION_NONE, archive_compression(a)); + assertEqualIntA(a, ARCHIVE_FILTER_NONE, archive_filter_code(a, 0)); assertEqualIntA(a, ARCHIVE_FORMAT_CPIO_POSIX, archive_format(a)); /* Close the archive. */ @@ -725,7 +725,7 @@ test_read_format_cpio_filename_CP866_CP1251_win(const char *refname) assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae)); /* Verify archive format. */ - assertEqualIntA(a, ARCHIVE_COMPRESSION_NONE, archive_compression(a)); + assertEqualIntA(a, ARCHIVE_FILTER_NONE, archive_filter_code(a, 0)); assertEqualIntA(a, ARCHIVE_FORMAT_CPIO_POSIX, archive_format(a)); /* Close the archive. */ @@ -776,7 +776,7 @@ test_read_format_cpio_filename_KOI8R_CP1251(const char *refname) assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae)); /* Verify archive format. */ - assertEqualIntA(a, ARCHIVE_COMPRESSION_NONE, archive_compression(a)); + assertEqualIntA(a, ARCHIVE_FILTER_NONE, archive_filter_code(a, 0)); assertEqualIntA(a, ARCHIVE_FORMAT_CPIO_POSIX, archive_format(a)); /* Close the archive. */ @@ -828,7 +828,7 @@ test_read_format_cpio_filename_UTF8_CP1251(const char *refname) assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae)); /* Verify archive format. */ - assertEqualIntA(a, ARCHIVE_COMPRESSION_NONE, archive_compression(a)); + assertEqualIntA(a, ARCHIVE_FILTER_NONE, archive_filter_code(a, 0)); assertEqualIntA(a, ARCHIVE_FORMAT_CPIO_POSIX, archive_format(a)); /* Close the archive. */ diff --git a/libarchive/test/test_read_format_cpio_odc.c b/libarchive/test/test_read_format_cpio_odc.c index cdcf0b5aff31..c608bf045a50 100644 --- a/libarchive/test/test_read_format_cpio_odc.c +++ b/libarchive/test/test_read_format_cpio_odc.c @@ -55,7 +55,7 @@ DEFINE_TEST(test_read_format_cpio_odc) assertA(0 == archive_read_support_format_all(a)); assertA(0 == archive_read_open_memory(a, archive, sizeof(archive))); assertEqualIntA(a, 0, archive_read_next_header(a, &ae)); - assertA(archive_compression(a) == ARCHIVE_COMPRESSION_NONE); + assertA(archive_filter_code(a, 0) == ARCHIVE_FILTER_NONE); assertA(archive_format(a) == ARCHIVE_FORMAT_CPIO_POSIX); assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a)); assertEqualInt(ARCHIVE_OK, archive_read_free(a)); diff --git a/libarchive/test/test_read_format_cpio_svr4_bzip2_rpm.c b/libarchive/test/test_read_format_cpio_svr4_bzip2_rpm.c index b354b8c06b3c..d069da39eb74 100644 --- a/libarchive/test/test_read_format_cpio_svr4_bzip2_rpm.c +++ b/libarchive/test/test_read_format_cpio_svr4_bzip2_rpm.c @@ -117,8 +117,8 @@ DEFINE_TEST(test_read_format_cpio_svr4_bzip2_rpm) assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae)); /* Verify that the format detection worked. */ - assertEqualInt(archive_compression(a), ARCHIVE_COMPRESSION_BZIP2); - assertEqualString(archive_compression_name(a), "bzip2"); + assertEqualInt(archive_filter_code(a, 0), ARCHIVE_FILTER_BZIP2); + assertEqualString(archive_filter_name(a, 0), "bzip2"); assertEqualInt(archive_format(a), ARCHIVE_FORMAT_CPIO_SVR4_NOCRC); assertEqualInt(ARCHIVE_OK, archive_read_close(a)); diff --git a/libarchive/test/test_read_format_cpio_svr4_gzip.c b/libarchive/test/test_read_format_cpio_svr4_gzip.c index 88d54d172c18..9b96234644ce 100644 --- a/libarchive/test/test_read_format_cpio_svr4_gzip.c +++ b/libarchive/test/test_read_format_cpio_svr4_gzip.c @@ -50,8 +50,8 @@ DEFINE_TEST(test_read_format_cpio_svr4_gzip) assertEqualInt(ARCHIVE_OK, archive_read_open_memory(a, archive, sizeof(archive))); assertEqualInt(ARCHIVE_OK, archive_read_next_header(a, &ae)); - assertEqualInt(archive_compression(a), - ARCHIVE_COMPRESSION_GZIP); + assertEqualInt(archive_filter_code(a, 0), + ARCHIVE_FILTER_GZIP); assertEqualInt(archive_format(a), ARCHIVE_FORMAT_CPIO_SVR4_NOCRC); assertEqualInt(ARCHIVE_OK, archive_read_close(a)); diff --git a/libarchive/test/test_read_format_cpio_svr4_gzip_rpm.c b/libarchive/test/test_read_format_cpio_svr4_gzip_rpm.c index 582096bf4753..eccde65ad53c 100644 --- a/libarchive/test/test_read_format_cpio_svr4_gzip_rpm.c +++ b/libarchive/test/test_read_format_cpio_svr4_gzip_rpm.c @@ -117,8 +117,8 @@ DEFINE_TEST(test_read_format_cpio_svr4_gzip_rpm) assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae)); /* Verify that the format detection worked. */ - assertEqualInt(archive_compression(a), ARCHIVE_COMPRESSION_GZIP); - assertEqualString(archive_compression_name(a), "gzip"); + assertEqualInt(archive_filter_code(a, 0), ARCHIVE_FILTER_GZIP); + assertEqualString(archive_filter_name(a, 0), "gzip"); assertEqualInt(archive_format(a), ARCHIVE_FORMAT_CPIO_SVR4_NOCRC); assertEqualInt(ARCHIVE_OK, archive_read_close(a)); diff --git a/libarchive/test/test_read_format_cpio_svr4c_Z.c b/libarchive/test/test_read_format_cpio_svr4c_Z.c index ca3d5ce07668..c33cd07ef83c 100644 --- a/libarchive/test/test_read_format_cpio_svr4c_Z.c +++ b/libarchive/test/test_read_format_cpio_svr4c_Z.c @@ -46,9 +46,9 @@ DEFINE_TEST(test_read_format_cpio_svr4c_Z) assertEqualIntA(a, ARCHIVE_OK, archive_read_open_memory(a, archive, sizeof(archive))); assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); - failure("archive_compression_name(a)=\"%s\"", - archive_compression_name(a)); - assertEqualInt(archive_compression(a), ARCHIVE_COMPRESSION_COMPRESS); + failure("archive_filter_name(a, 0)=\"%s\"", + archive_filter_name(a, 0)); + assertEqualInt(archive_filter_code(a, 0), ARCHIVE_FILTER_COMPRESS); failure("archive_format_name(a)=\"%s\"", archive_format_name(a)); assertEqualInt(archive_format(a), ARCHIVE_FORMAT_CPIO_SVR4_CRC); assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a)); diff --git a/libarchive/test/test_read_format_empty.c b/libarchive/test/test_read_format_empty.c index 0dafe9f6c958..c27d57ad5a82 100644 --- a/libarchive/test/test_read_format_empty.c +++ b/libarchive/test/test_read_format_empty.c @@ -36,7 +36,7 @@ DEFINE_TEST(test_read_format_empty) assertA(0 == archive_read_support_format_all(a)); assertA(0 == archive_read_open_memory(a, archive, 0)); assertA(ARCHIVE_EOF == archive_read_next_header(a, &ae)); - assertA(archive_compression(a) == ARCHIVE_COMPRESSION_NONE); + assertA(archive_filter_code(a, 0) == ARCHIVE_FILTER_NONE); assertA(archive_format(a) == ARCHIVE_FORMAT_EMPTY); assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a)); assertEqualInt(ARCHIVE_OK, archive_read_free(a)); diff --git a/libarchive/test/test_read_format_gtar_gz.c b/libarchive/test/test_read_format_gtar_gz.c index d688f08fec21..8d60de00754f 100644 --- a/libarchive/test/test_read_format_gtar_gz.c +++ b/libarchive/test/test_read_format_gtar_gz.c @@ -51,8 +51,8 @@ DEFINE_TEST(test_read_format_gtar_gz) archive_read_open_memory(a, archive, sizeof(archive))); assertEqualInt(ARCHIVE_OK, archive_read_next_header(a, &ae)); assertEqualInt(1, archive_file_count(a)); - assertEqualInt(archive_compression(a), - ARCHIVE_COMPRESSION_GZIP); + assertEqualInt(archive_filter_code(a, 0), + ARCHIVE_FILTER_GZIP); assertEqualInt(archive_format(a), ARCHIVE_FORMAT_TAR_GNUTAR); assertEqualInt(ARCHIVE_OK, archive_read_close(a)); assertEqualInt(ARCHIVE_OK, archive_read_free(a)); diff --git a/libarchive/test/test_read_format_gtar_lzma.c b/libarchive/test/test_read_format_gtar_lzma.c index 29ffae12fcf7..5dfbb2c227f2 100644 --- a/libarchive/test/test_read_format_gtar_lzma.c +++ b/libarchive/test/test_read_format_gtar_lzma.c @@ -64,7 +64,7 @@ DEFINE_TEST(test_read_format_gtar_lzma) } assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); - assertEqualInt(archive_compression(a), ARCHIVE_COMPRESSION_LZMA); + assertEqualInt(archive_filter_code(a, 0), ARCHIVE_FILTER_LZMA); assertEqualInt(archive_format(a), ARCHIVE_FORMAT_TAR_GNUTAR); assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a)); finish: diff --git a/libarchive/test/test_read_format_iso_Z.c b/libarchive/test/test_read_format_iso_Z.c index 61b2abdc16c2..551e0cf3431c 100644 --- a/libarchive/test/test_read_format_iso_Z.c +++ b/libarchive/test/test_read_format_iso_Z.c @@ -44,8 +44,8 @@ test1(void) assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); assertEqualInt(1, archive_file_count(a)); - assertEqualInt(archive_compression(a), - ARCHIVE_COMPRESSION_COMPRESS); + assertEqualInt(archive_filter_code(a, 0), + ARCHIVE_FILTER_COMPRESS); assertEqualInt(archive_format(a), ARCHIVE_FORMAT_ISO9660); assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a)); assertEqualInt(ARCHIVE_OK, archive_read_free(a)); @@ -85,8 +85,8 @@ test2(void) assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae)); assertEqualInt(5, archive_file_count(a)); - assertEqualInt(archive_compression(a), - ARCHIVE_COMPRESSION_COMPRESS); + assertEqualInt(archive_filter_code(a, 0), + ARCHIVE_FILTER_COMPRESS); assertEqualInt(archive_format(a), ARCHIVE_FORMAT_ISO9660); assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a)); assertEqualInt(ARCHIVE_OK, archive_read_free(a)); diff --git a/libarchive/test/test_read_format_iso_multi_extent.c b/libarchive/test/test_read_format_iso_multi_extent.c index 2230d8e2089c..63b5cf7abb5d 100644 --- a/libarchive/test/test_read_format_iso_multi_extent.c +++ b/libarchive/test/test_read_format_iso_multi_extent.c @@ -83,7 +83,7 @@ DEFINE_TEST(test_read_format_iso_multi_extent) assertEqualInt(ARCHIVE_EOF, archive_read_next_header(a, &ae)); /* Verify archive format. */ - assertEqualInt(archive_compression(a), ARCHIVE_COMPRESSION_COMPRESS); + assertEqualInt(archive_filter_code(a, 0), ARCHIVE_FILTER_COMPRESS); assertEqualInt(archive_format(a), ARCHIVE_FORMAT_ISO9660_ROCKRIDGE); /* Close the archive. */ diff --git a/libarchive/test/test_read_format_iso_xorriso.c b/libarchive/test/test_read_format_iso_xorriso.c index bb53e3b67537..13502605a2ba 100644 --- a/libarchive/test/test_read_format_iso_xorriso.c +++ b/libarchive/test/test_read_format_iso_xorriso.c @@ -202,7 +202,7 @@ DEFINE_TEST(test_read_format_iso_xorriso) assertEqualInt(ARCHIVE_EOF, archive_read_next_header(a, &ae)); /* Verify archive format. */ - assertEqualInt(archive_compression(a), ARCHIVE_COMPRESSION_COMPRESS); + assertEqualInt(archive_filter_code(a, 0), ARCHIVE_FILTER_COMPRESS); assertEqualInt(archive_format(a), ARCHIVE_FORMAT_ISO9660_ROCKRIDGE); /* Close the archive. */ diff --git a/libarchive/test/test_read_format_isojoliet_bz2.c b/libarchive/test/test_read_format_isojoliet_bz2.c index f42372675af2..36239d121fea 100644 --- a/libarchive/test/test_read_format_isojoliet_bz2.c +++ b/libarchive/test/test_read_format_isojoliet_bz2.c @@ -126,7 +126,7 @@ DEFINE_TEST(test_read_format_isojoliet_bz2) assertEqualInt(ARCHIVE_EOF, archive_read_next_header(a, &ae)); /* Verify archive format. */ - assertEqualInt(archive_compression(a), ARCHIVE_COMPRESSION_COMPRESS); + assertEqualInt(archive_filter_code(a, 0), ARCHIVE_FILTER_COMPRESS); /* Close the archive. */ assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a)); diff --git a/libarchive/test/test_read_format_isojoliet_long.c b/libarchive/test/test_read_format_isojoliet_long.c index d15face79bd5..06f3f4fee488 100644 --- a/libarchive/test/test_read_format_isojoliet_long.c +++ b/libarchive/test/test_read_format_isojoliet_long.c @@ -132,7 +132,7 @@ DEFINE_TEST(test_read_format_isojoliet_long) assertEqualInt(ARCHIVE_EOF, archive_read_next_header(a, &ae)); /* Verify archive format. */ - assertEqualInt(archive_compression(a), ARCHIVE_COMPRESSION_COMPRESS); + assertEqualInt(archive_filter_code(a, 0), ARCHIVE_FILTER_COMPRESS); /* Close the archive. */ assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a)); diff --git a/libarchive/test/test_read_format_isojoliet_rr.c b/libarchive/test/test_read_format_isojoliet_rr.c index f2e0ea35f649..ebf1b92d97f5 100644 --- a/libarchive/test/test_read_format_isojoliet_rr.c +++ b/libarchive/test/test_read_format_isojoliet_rr.c @@ -150,7 +150,7 @@ DEFINE_TEST(test_read_format_isojoliet_rr) assertEqualInt(ARCHIVE_EOF, archive_read_next_header(a, &ae)); /* Verify archive format. */ - assertEqualInt(archive_compression(a), ARCHIVE_COMPRESSION_COMPRESS); + assertEqualInt(archive_filter_code(a, 0), ARCHIVE_FILTER_COMPRESS); assertEqualInt(archive_format(a), ARCHIVE_FORMAT_ISO9660_ROCKRIDGE); /* Close the archive. */ diff --git a/libarchive/test/test_read_format_isojoliet_versioned.c b/libarchive/test/test_read_format_isojoliet_versioned.c index 82c5ab1f3b7b..8fa974b9806f 100644 --- a/libarchive/test/test_read_format_isojoliet_versioned.c +++ b/libarchive/test/test_read_format_isojoliet_versioned.c @@ -74,7 +74,7 @@ DEFINE_TEST(test_read_format_isojoliet_versioned) assertEqualInt(ARCHIVE_EOF, archive_read_next_header(a, &ae)); /* Verify archive format. */ - assertEqualInt(archive_compression(a), ARCHIVE_COMPRESSION_COMPRESS); + assertEqualInt(archive_filter_code(a, 0), ARCHIVE_FILTER_COMPRESS); /* Close the archive. */ assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a)); diff --git a/libarchive/test/test_read_format_isorr_bz2.c b/libarchive/test/test_read_format_isorr_bz2.c index bc502e270645..1c16f3cb1ef7 100644 --- a/libarchive/test/test_read_format_isorr_bz2.c +++ b/libarchive/test/test_read_format_isorr_bz2.c @@ -192,7 +192,7 @@ DEFINE_TEST(test_read_format_isorr_bz2) assertEqualInt(ARCHIVE_EOF, archive_read_next_header(a, &ae)); /* Verify archive format. */ - assertEqualInt(archive_compression(a), ARCHIVE_COMPRESSION_COMPRESS); + assertEqualInt(archive_filter_code(a, 0), ARCHIVE_FILTER_COMPRESS); assertEqualInt(archive_format(a), ARCHIVE_FORMAT_ISO9660_ROCKRIDGE); /* Close the archive. */ diff --git a/libarchive/test/test_read_format_isorr_ce.c b/libarchive/test/test_read_format_isorr_ce.c index d4ca160243aa..c19864348664 100644 --- a/libarchive/test/test_read_format_isorr_ce.c +++ b/libarchive/test/test_read_format_isorr_ce.c @@ -212,7 +212,7 @@ DEFINE_TEST(test_read_format_isorr_ce) assertEqualInt(ARCHIVE_EOF, archive_read_next_header(a, &ae)); /* Verify archive format. */ - assertEqualInt(archive_compression(a), ARCHIVE_COMPRESSION_COMPRESS); + assertEqualInt(archive_filter_code(a, 0), ARCHIVE_FILTER_COMPRESS); assertEqualInt(archive_format(a), ARCHIVE_FORMAT_ISO9660_ROCKRIDGE); /* Close the archive. */ diff --git a/libarchive/test/test_read_format_isorr_new_bz2.c b/libarchive/test/test_read_format_isorr_new_bz2.c index 997b63746335..96fb0589340c 100644 --- a/libarchive/test/test_read_format_isorr_new_bz2.c +++ b/libarchive/test/test_read_format_isorr_new_bz2.c @@ -193,7 +193,7 @@ DEFINE_TEST(test_read_format_isorr_new_bz2) assertEqualInt(ARCHIVE_EOF, archive_read_next_header(a, &ae)); /* Verify archive format. */ - assertEqualInt(archive_compression(a), ARCHIVE_COMPRESSION_COMPRESS); + assertEqualInt(archive_filter_code(a, 0), ARCHIVE_FILTER_COMPRESS); assertEqualInt(archive_format(a), ARCHIVE_FORMAT_ISO9660_ROCKRIDGE); /* Close the archive. */ diff --git a/libarchive/test/test_read_format_isorr_rr_moved.c b/libarchive/test/test_read_format_isorr_rr_moved.c index 05aa97e62df7..57e7e1f85951 100644 --- a/libarchive/test/test_read_format_isorr_rr_moved.c +++ b/libarchive/test/test_read_format_isorr_rr_moved.c @@ -259,7 +259,7 @@ DEFINE_TEST(test_read_format_isorr_rr_moved) assertEqualInt(ARCHIVE_EOF, archive_read_next_header(a, &ae)); /* Verify archive format. */ - assertEqualInt(archive_compression(a), ARCHIVE_COMPRESSION_COMPRESS); + assertEqualInt(archive_filter_code(a, 0), ARCHIVE_FILTER_COMPRESS); assertEqualInt(archive_format(a), ARCHIVE_FORMAT_ISO9660_ROCKRIDGE); /* Close the archive. */ diff --git a/libarchive/test/test_read_format_isozisofs_bz2.c b/libarchive/test/test_read_format_isozisofs_bz2.c index 60204258926b..50ad32c70b01 100644 --- a/libarchive/test/test_read_format_isozisofs_bz2.c +++ b/libarchive/test/test_read_format_isozisofs_bz2.c @@ -176,7 +176,7 @@ DEFINE_TEST(test_read_format_isozisofs_bz2) assertEqualInt(ARCHIVE_EOF, archive_read_next_header(a, &ae)); /* Verify archive format. */ - assertEqualInt(archive_compression(a), ARCHIVE_COMPRESSION_COMPRESS); + assertEqualInt(archive_filter_code(a, 0), ARCHIVE_FILTER_COMPRESS); assertEqualInt(archive_format(a), ARCHIVE_FORMAT_ISO9660_ROCKRIDGE); /* Close the archive. */ diff --git a/libarchive/test/test_read_format_lha.c b/libarchive/test/test_read_format_lha.c index a01386eafd0a..36c5d080340a 100644 --- a/libarchive/test/test_read_format_lha.c +++ b/libarchive/test/test_read_format_lha.c @@ -247,7 +247,7 @@ verify(const char *refname, int posix) } /* Verify archive format. */ - assertEqualIntA(a, ARCHIVE_COMPRESSION_NONE, archive_compression(a)); + assertEqualIntA(a, ARCHIVE_FILTER_NONE, archive_filter_code(a, 0)); assertEqualIntA(a, ARCHIVE_FORMAT_LHA, archive_format(a)); /* Close the archive. */ diff --git a/libarchive/test/test_read_format_lha_filename.c b/libarchive/test/test_read_format_lha_filename.c index e39dfac41ac1..67b6f3643843 100644 --- a/libarchive/test/test_read_format_lha_filename.c +++ b/libarchive/test/test_read_format_lha_filename.c @@ -79,7 +79,7 @@ test_read_format_lha_filename_CP932_eucJP(const char *refname) assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae)); /* Verify archive format. */ - assertEqualIntA(a, ARCHIVE_COMPRESSION_NONE, archive_compression(a)); + assertEqualIntA(a, ARCHIVE_FILTER_NONE, archive_filter_code(a, 0)); assertEqualIntA(a, ARCHIVE_FORMAT_LHA, archive_format(a)); /* Close the archive. */ @@ -139,7 +139,7 @@ test_read_format_lha_filename_CP932_UTF8(const char *refname) assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae)); /* Verify archive format. */ - assertEqualIntA(a, ARCHIVE_COMPRESSION_NONE, archive_compression(a)); + assertEqualIntA(a, ARCHIVE_FILTER_NONE, archive_filter_code(a, 0)); assertEqualIntA(a, ARCHIVE_FORMAT_LHA, archive_format(a)); /* Close the archive. */ @@ -189,7 +189,7 @@ test_read_format_lha_filename_CP932_Windows(const char *refname) assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae)); /* Verify archive format. */ - assertEqualIntA(a, ARCHIVE_COMPRESSION_NONE, archive_compression(a)); + assertEqualIntA(a, ARCHIVE_FILTER_NONE, archive_filter_code(a, 0)); assertEqualIntA(a, ARCHIVE_FORMAT_LHA, archive_format(a)); /* Close the archive. */ diff --git a/libarchive/test/test_read_format_mtree.c b/libarchive/test/test_read_format_mtree.c index 0d86bd4788c7..efedc415eb6d 100644 --- a/libarchive/test/test_read_format_mtree.c +++ b/libarchive/test/test_read_format_mtree.c @@ -1,5 +1,6 @@ /*- * Copyright (c) 2003-2007 Tim Kientzle + * Copyright (c) 2011-2012 Michihiro NAKAJIMA * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -37,7 +38,8 @@ test_read_format_mtree1(void) * without relying on overflow. This assumes that long long * is at least 64 bits. */ static const long long max_int64 = ((((long long)1) << 62) - 1) + (((long long)1) << 62); - time_t min_time, t; + time_t min_time; + volatile time_t t; extract_reference_file(reffile); @@ -55,7 +57,8 @@ test_read_format_mtree1(void) archive_read_support_filter_all(a)); assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a)); - assertEqualIntA(a, ARCHIVE_OK, archive_read_open_file(a, reffile, 11)); + assertEqualIntA(a, ARCHIVE_OK, + archive_read_open_filename(a, reffile, 11)); /* * Read "file", whose data is available on disk. @@ -222,9 +225,147 @@ test_read_format_mtree3(void) assertChdir(".."); } +DEFINE_TEST(test_read_format_mtree) +{ + test_read_format_mtree1(); + test_read_format_mtree2(); + test_read_format_mtree3(); +} -static void -test_read_format_mtree4(void) +DEFINE_TEST(test_read_format_mtree_filenames_only) +{ + static char archive[] = + "/set type=file mode=0644\n" + "./a\n" + "./b\n" + "./c\n" + "./d\n" + "./e\n" + "./f mode=0444\n"; + struct archive_entry *ae; + struct archive *a; + + assertMakeFile("file", 0644, "file contents"); + + 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_mode(ae), AE_IFREG | 0644); + assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); + assertEqualString(archive_entry_pathname(ae), "./b"); + assertEqualInt(archive_entry_mode(ae), AE_IFREG | 0644); + assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); + assertEqualString(archive_entry_pathname(ae), "./c"); + assertEqualInt(archive_entry_mode(ae), AE_IFREG | 0644); + assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); + assertEqualString(archive_entry_pathname(ae), "./d"); + assertEqualInt(archive_entry_mode(ae), AE_IFREG | 0644); + assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); + assertEqualString(archive_entry_pathname(ae), "./e"); + assertEqualInt(archive_entry_mode(ae), AE_IFREG | 0644); + assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); + assertEqualString(archive_entry_pathname(ae), "./f"); + assertEqualInt(archive_entry_mode(ae), AE_IFREG | 0444); + + assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae)); + assertEqualInt(6, archive_file_count(a)); + assertEqualInt(ARCHIVE_OK, archive_read_close(a)); + assertEqualInt(ARCHIVE_OK, archive_read_free(a)); +} + +DEFINE_TEST(test_read_format_mtree_nochange) +{ + static char archive[] = + "#mtree\n" + "./a type=file mode=0644 time=123\n" + "./b type=file mode=0644 time=234\n" + "./c type=file mode=0644 time=345\n"; + static char archive2[] = + "#mtree\n" + "./a type=file mode=0644 time=123 nochange\n" + "./b type=file mode=0644 time=234\n" + "./c type=file mode=0644 time=345 nochange\n"; + struct archive_entry *ae; + struct archive *a; + + assertMakeFile("a", 0640, "12345"); + assertMakeFile("b", 0664, "123456"); + assertMakeFile("c", 0755, "1234567"); + + /* + * Test 1. Read a mtree archive without `nochange' keyword. + */ + 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_mode(ae), AE_IFREG | 0644); + assertEqualInt(archive_entry_mtime(ae), 123); + assertEqualInt(archive_entry_size(ae), 5); + assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); + assertEqualString(archive_entry_pathname(ae), "./b"); + assertEqualInt(archive_entry_mode(ae), AE_IFREG | 0644); + assertEqualInt(archive_entry_mtime(ae), 234); + assertEqualInt(archive_entry_size(ae), 6); + assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); + assertEqualString(archive_entry_pathname(ae), "./c"); + assertEqualInt(archive_entry_mode(ae), AE_IFREG | 0644); + assertEqualInt(archive_entry_mtime(ae), 345); + assertEqualInt(archive_entry_size(ae), 7); + + assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae)); + assertEqualInt(3, archive_file_count(a)); + assertEqualInt(ARCHIVE_OK, archive_read_close(a)); + assertEqualInt(ARCHIVE_OK, archive_read_free(a)); + + /* + * Test 2. Read a mtree archive with `nochange' keyword. + */ + 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, archive2, sizeof(archive2))); + assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); + assertEqualString(archive_entry_pathname(ae), "./a"); +#if !defined(_WIN32) || defined(__CYGWIN__) + assertEqualInt(archive_entry_mode(ae), AE_IFREG | 0640); +#endif + assert(archive_entry_mtime(ae) != 123); + assertEqualInt(archive_entry_size(ae), 5); + assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); + assertEqualString(archive_entry_pathname(ae), "./b"); + assertEqualInt(archive_entry_mode(ae), AE_IFREG | 0644); + assertEqualInt(archive_entry_mtime(ae), 234); + assertEqualInt(archive_entry_size(ae), 6); + assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); + assertEqualString(archive_entry_pathname(ae), "./c"); +#if !defined(_WIN32) || defined(__CYGWIN__) + assertEqualInt(archive_entry_mode(ae), AE_IFREG | 0755); +#endif + assert(archive_entry_mtime(ae) != 345); + assertEqualInt(archive_entry_size(ae), 7); + + assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae)); + assertEqualInt(3, archive_file_count(a)); + assertEqualInt(ARCHIVE_OK, archive_read_close(a)); + assertEqualInt(ARCHIVE_OK, archive_read_free(a)); +} + +DEFINE_TEST(test_read_format_mtree_nomagic_v1_form) { const char reffile[] = "test_read_format_mtree_nomagic.mtree"; char buff[16]; @@ -232,9 +373,6 @@ test_read_format_mtree4(void) struct archive *a; FILE *f; - assertMakeDir("mtree4", 0777); - assertChdir("mtree4"); - extract_reference_file(reffile); assert((a = archive_read_new()) != NULL); @@ -242,7 +380,8 @@ test_read_format_mtree4(void) archive_read_support_filter_all(a)); assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a)); - assertEqualIntA(a, ARCHIVE_OK, archive_read_open_file(a, reffile, 11)); + assertEqualIntA(a, ARCHIVE_OK, + archive_read_open_filename(a, reffile, 11)); /* * Read "file", whose data is available on disk. @@ -300,15 +439,142 @@ test_read_format_mtree4(void) assertEqualInt(12, archive_file_count(a)); assertEqualInt(ARCHIVE_OK, archive_read_close(a)); assertEqualInt(ARCHIVE_OK, archive_read_free(a)); +} - assertChdir(".."); +/* + * Test for a format that NetBSD mtree -C generates. + */ +DEFINE_TEST(test_read_format_mtree_nomagic_v2_form) +{ + const char reffile[] = "test_read_format_mtree_nomagic2.mtree"; + char buff[16]; + struct archive_entry *ae; + struct archive *a; + FILE *f; + + extract_reference_file(reffile); + + 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, reffile, 11)); + + /* + * Read "file", whose data is available on disk. + */ + f = fopen("file", "wb"); + assert(f != NULL); + assertEqualInt(3, fwrite("hi\n", 1, 3, f)); + fclose(f); + assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); + assertEqualInt(archive_format(a), ARCHIVE_FORMAT_MTREE); + assertEqualString(archive_entry_pathname(ae), "./file"); + assertEqualInt(archive_entry_uid(ae), 18); + assertEqualInt(AE_IFREG, archive_entry_filetype(ae)); + assertEqualInt(archive_entry_mode(ae), AE_IFREG | 0123); + assertEqualInt(archive_entry_size(ae), 3); + assertEqualInt(3, archive_read_data(a, buff, 3)); + assertEqualMem(buff, "hi\n", 3); + + assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); + assertEqualString(archive_entry_pathname(ae), "./dir"); + assertEqualInt(archive_entry_mode(ae), AE_IFDIR | 0755); + + assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); + assertEqualString(archive_entry_pathname(ae), "./dir/file with space"); + assertEqualInt(archive_entry_uid(ae), 18); + assertEqualInt(archive_entry_mode(ae), AE_IFREG | 0644); + + assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); + assertEqualString(archive_entry_pathname(ae), "./file with space"); + assertEqualInt(archive_entry_mode(ae), AE_IFREG | 0644); + + assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); + assertEqualString(archive_entry_pathname(ae), "./dir2"); + assertEqualInt(archive_entry_mode(ae), AE_IFDIR | 0755); + + assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); + assertEqualString(archive_entry_pathname(ae), "./dir2/dir3a"); + assertEqualInt(archive_entry_mode(ae), AE_IFDIR | 0755); + + assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae)); + assertEqualInt(6, archive_file_count(a)); + assertEqualInt(ARCHIVE_OK, archive_read_close(a)); + assertEqualInt(ARCHIVE_OK, archive_read_free(a)); +} + +/* + * Test for a format that NetBSD mtree -D generates. + */ +DEFINE_TEST(test_read_format_mtree_nomagic_v2_netbsd_form) +{ + const char reffile[] = "test_read_format_mtree_nomagic3.mtree"; + char buff[16]; + struct archive_entry *ae; + struct archive *a; + FILE *f; + + extract_reference_file(reffile); + + 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, reffile, 11)); + + /* + * Read "file", whose data is available on disk. + */ + f = fopen("file", "wb"); + assert(f != NULL); + assertEqualInt(3, fwrite("hi\n", 1, 3, f)); + fclose(f); + assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); + assertEqualInt(archive_format(a), ARCHIVE_FORMAT_MTREE); + assertEqualString(archive_entry_pathname(ae), "./file"); + assertEqualInt(archive_entry_uid(ae), 18); + assertEqualInt(AE_IFREG, archive_entry_filetype(ae)); + assertEqualInt(archive_entry_mode(ae), AE_IFREG | 0123); + assertEqualInt(archive_entry_size(ae), 3); + assertEqualInt(3, archive_read_data(a, buff, 3)); + assertEqualMem(buff, "hi\n", 3); + + assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); + assertEqualString(archive_entry_pathname(ae), "./dir"); + assertEqualInt(archive_entry_mode(ae), AE_IFDIR | 0755); + + assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); + assertEqualString(archive_entry_pathname(ae), "./dir/file with space"); + assertEqualInt(archive_entry_uid(ae), 18); + assertEqualInt(archive_entry_mode(ae), AE_IFREG | 0644); + + assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); + assertEqualString(archive_entry_pathname(ae), "./file with space"); + assertEqualInt(archive_entry_mode(ae), AE_IFREG | 0644); + + assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); + assertEqualString(archive_entry_pathname(ae), "./dir2"); + assertEqualInt(archive_entry_mode(ae), AE_IFDIR | 0755); + + assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); + assertEqualString(archive_entry_pathname(ae), "./dir2/dir3a"); + assertEqualInt(archive_entry_mode(ae), AE_IFDIR | 0755); + + assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae)); + assertEqualInt(6, archive_file_count(a)); + assertEqualInt(ARCHIVE_OK, archive_read_close(a)); + assertEqualInt(ARCHIVE_OK, archive_read_free(a)); } /* * We should get a warning if the contents file doesn't exist. */ -static void -test_read_format_mtree5(void) +DEFINE_TEST(test_read_format_mtree_nonexistent_contents_file) { static char archive[] = "#mtree\n" @@ -316,9 +582,6 @@ test_read_format_mtree5(void) struct archive_entry *ae; struct archive *a; - assertMakeDir("mtree5", 0777); - assertChdir("mtree5"); - assert((a = archive_read_new()) != NULL); assertEqualIntA(a, ARCHIVE_OK, archive_read_support_filter_all(a)); @@ -335,15 +598,5 @@ test_read_format_mtree5(void) assertEqualInt(1, archive_file_count(a)); assertEqualInt(ARCHIVE_OK, archive_read_close(a)); assertEqualInt(ARCHIVE_OK, archive_read_free(a)); - - assertChdir(".."); } -DEFINE_TEST(test_read_format_mtree) -{ - test_read_format_mtree1(); - test_read_format_mtree2(); - test_read_format_mtree3(); - test_read_format_mtree4(); - test_read_format_mtree5(); -} diff --git a/libarchive/test/test_read_format_mtree_nomagic2.mtree.uu b/libarchive/test/test_read_format_mtree_nomagic2.mtree.uu new file mode 100644 index 000000000000..f27fb2b9c555 --- /dev/null +++ b/libarchive/test/test_read_format_mtree_nomagic2.mtree.uu @@ -0,0 +1,10 @@ +begin 644 test_read_format_mtree_nomagic2.mtree +M(PHC(%1H:7,@9F]R;2!IF4],PHN +M+V1I7!E/61I7!E/61I7!E/61I -static void -test_basic(void) +DEFINE_TEST(test_read_format_rar_basic) { char buff[64]; const char reffile[] = "test_read_format_rar.rar"; @@ -42,7 +41,7 @@ test_basic(void) 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_file(a, reffile, 10240)); + assertA(0 == archive_read_open_filename(a, reffile, 10240)); /* First header. */ assertA(0 == archive_read_next_header(a, &ae)); @@ -102,8 +101,7 @@ test_basic(void) assertEqualInt(ARCHIVE_OK, archive_read_free(a)); } -static void -test_subblock(void) +DEFINE_TEST(test_read_format_rar_subblock) { char buff[64]; const char reffile[] = "test_read_format_rar_subblock.rar"; @@ -116,7 +114,7 @@ test_subblock(void) 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_file(a, reffile, 10240)); + assertA(0 == archive_read_open_filename(a, reffile, 10240)); /* First header. */ assertA(0 == archive_read_next_header(a, &ae)); @@ -136,8 +134,7 @@ test_subblock(void) assertEqualInt(ARCHIVE_OK, archive_read_free(a)); } -static void -test_noeof(void) +DEFINE_TEST(test_read_format_rar_noeof) { char buff[64]; const char reffile[] = "test_read_format_rar_noeof.rar"; @@ -150,7 +147,7 @@ test_noeof(void) 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_file(a, reffile, 10240)); + assertA(0 == archive_read_open_filename(a, reffile, 10240)); /* First header. */ assertA(0 == archive_read_next_header(a, &ae)); @@ -170,8 +167,7 @@ test_noeof(void) assertEqualInt(ARCHIVE_OK, archive_read_free(a)); } -static void -test_unicode_UTF8(void) +DEFINE_TEST(test_read_format_rar_unicode_UTF8) { char buff[30]; const char reffile[] = "test_read_format_rar_unicode.rar"; @@ -188,7 +184,7 @@ test_unicode_UTF8(void) 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_file(a, reffile, 10240)); + assertA(0 == archive_read_open_filename(a, reffile, 10240)); /* First header. */ assertA(0 == archive_read_next_header(a, &ae)); @@ -296,8 +292,7 @@ test_unicode_UTF8(void) assertEqualInt(ARCHIVE_OK, archive_read_free(a)); } -static void -test_unicode_CP932(void) +DEFINE_TEST(test_read_format_rar_unicode_CP932) { char buff[30]; const char reffile[] = "test_read_format_rar_unicode.rar"; @@ -322,7 +317,7 @@ test_unicode_CP932(void) assertEqualInt(ARCHIVE_OK, archive_read_free(a)); return; } - assertA(0 == archive_read_open_file(a, reffile, 10240)); + assertA(0 == archive_read_open_filename(a, reffile, 10240)); /* First header. */ assertA(0 == archive_read_next_header(a, &ae)); @@ -392,8 +387,7 @@ test_unicode_CP932(void) assertEqualInt(ARCHIVE_OK, archive_read_free(a)); } -static void -test_compress_normal(void) +DEFINE_TEST(test_read_format_rar_compress_normal) { const char reffile[] = "test_read_format_rar_compress_normal.rar"; char file1_buff[20111]; @@ -412,7 +406,7 @@ test_compress_normal(void) 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_file(a, reffile, 10240)); + assertA(0 == archive_read_open_filename(a, reffile, 10240)); /* First header. */ assertA(0 == archive_read_next_header(a, &ae)); @@ -490,8 +484,7 @@ test_compress_normal(void) /* This test is for sufficiently large files that would have been compressed * using multiple lzss blocks. */ -static void -test_multi_lzss_blocks(void) +DEFINE_TEST(test_read_format_rar_multi_lzss_blocks) { const char reffile[] = "test_read_format_rar_multi_lzss_blocks.rar"; const char test_txt[] = "-bottom: 0in\">
\n

\n\n"; @@ -504,7 +497,7 @@ test_multi_lzss_blocks(void) 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_file(a, reffile, 10240)); + assertA(0 == archive_read_open_filename(a, reffile, 10240)); /* First header. */ assertA(0 == archive_read_next_header(a, &ae)); @@ -529,8 +522,7 @@ test_multi_lzss_blocks(void) assertEqualInt(ARCHIVE_OK, archive_read_free(a)); } -static void -test_compress_best(void) +DEFINE_TEST(test_read_format_rar_compress_best) { const char reffile[] = "test_read_format_rar_compress_best.rar"; char file1_buff[20111]; @@ -549,7 +541,7 @@ test_compress_best(void) 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_file(a, reffile, 10240)); + assertA(0 == archive_read_open_filename(a, reffile, 10240)); /* First header. */ assertA(0 == archive_read_next_header(a, &ae)); @@ -627,8 +619,7 @@ test_compress_best(void) /* This is a test for RAR files compressed using a technique where compression * switches back and forth to and from ppmd and lzss decoding. */ -static void -test_ppmd_lzss_conversion(void) +DEFINE_TEST(test_read_format_rar_ppmd_lzss_conversion) { const char reffile[] = "test_read_format_rar_ppmd_lzss_conversion.rar"; const char test_txt[] = "gin-bottom: 0in\">
\n

\n\n"; @@ -641,7 +632,7 @@ test_ppmd_lzss_conversion(void) 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_file(a, reffile, 10240)); + assertA(0 == archive_read_open_filename(a, reffile, 10240)); /* First header. */ assertA(0 == archive_read_next_header(a, &ae)); @@ -667,8 +658,7 @@ test_ppmd_lzss_conversion(void) assertEqualInt(ARCHIVE_OK, archive_read_free(a)); } -static void -test_binary(void) +DEFINE_TEST(test_read_format_rar_binary) { const char reffile[] = "test_read_format_rar_binary_data.rar"; char file1_buff[1048576]; @@ -692,7 +682,7 @@ test_binary(void) 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_file(a, reffile, 10240)); + assertA(0 == archive_read_open_filename(a, reffile, 10240)); /* First header. */ assertA(0 == archive_read_next_header(a, &ae)); @@ -725,8 +715,7 @@ test_binary(void) assertEqualInt(ARCHIVE_OK, archive_read_free(a)); } -static void -test_windows(void) +DEFINE_TEST(test_read_format_rar_windows) { char buff[441]; const char reffile[] = "test_read_format_rar_windows.rar"; @@ -739,7 +728,7 @@ test_windows(void) 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_file(a, reffile, 10240)); + assertA(0 == archive_read_open_filename(a, reffile, 10240)); /* First header. */ assertA(0 == archive_read_next_header(a, &ae)); @@ -798,8 +787,225 @@ test_windows(void) assertEqualInt(ARCHIVE_OK, archive_read_free(a)); } -static void -test_sfx(void) +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 + }; + int file1_size = 241647978, offset = 0; + char buff[64]; + const char file1_test_txt[] = "gin-bottom: 0in\">
\n

\n\n" + ""; + char file2_buff[20111]; + int file2_size = sizeof(file2_buff); + const char file2_test_txt[] = "


\n" + "

\n" + "\n" + ""; + char file3_buff[20]; + 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)); + assertEqualString("ppmd_lzss_conversion_test.txt", + archive_entry_pathname(ae)); + assertA((int)archive_entry_mtime(ae)); + assertA((int)archive_entry_ctime(ae)); + assertA((int)archive_entry_atime(ae)); + assertEqualInt(file1_size, archive_entry_size(ae)); + assertEqualInt(33188, archive_entry_mode(ae)); + while (offset + (int)sizeof(buff) < file1_size) + { + assertA(sizeof(buff) == archive_read_data(a, buff, sizeof(buff))); + offset += sizeof(buff); + } + assertA(file1_size - offset == + archive_read_data(a, buff, file1_size - offset)); + assertEqualMem(buff, file1_test_txt, file1_size - offset); + + /* Second header. */ + assertA(0 == archive_read_next_header(a, &ae)); + assertEqualString("LibarchiveAddingTest.html", archive_entry_pathname(ae)); + assertA((int)archive_entry_mtime(ae)); + assertA((int)archive_entry_ctime(ae)); + assertA((int)archive_entry_atime(ae)); + assertEqualInt(file2_size, archive_entry_size(ae)); + assertEqualInt(33188, archive_entry_mode(ae)); + assertA(file2_size == archive_read_data(a, file2_buff, file2_size)); + assertEqualMem(&file2_buff[file2_size - sizeof(file2_test_txt) + 1], + file2_test_txt, sizeof(file2_test_txt) - 1); + + /* Third header. */ + assertA(0 == archive_read_next_header(a, &ae)); + assertEqualString("testlink", archive_entry_pathname(ae)); + assertA((int)archive_entry_mtime(ae)); + assertA((int)archive_entry_ctime(ae)); + assertA((int)archive_entry_atime(ae)); + assertEqualInt(0, archive_entry_size(ae)); + assertEqualInt(41471, archive_entry_mode(ae)); + assertEqualString("LibarchiveAddingTest.html", archive_entry_symlink(ae)); + assertEqualIntA(a, 0, archive_read_data(a, file2_buff, 30)); + + /* Fourth header. */ + assertA(0 == archive_read_next_header(a, &ae)); + assertEqualString("testdir/test.txt", archive_entry_pathname(ae)); + assertA((int)archive_entry_mtime(ae)); + assertA((int)archive_entry_ctime(ae)); + assertA((int)archive_entry_atime(ae)); + assertEqualInt(file3_size, archive_entry_size(ae)); + assertEqualInt(33188, archive_entry_mode(ae)); + assertA(file3_size == archive_read_data(a, file3_buff, file3_size)); + assertEqualMem(&file3_buff[file3_size + 1 - sizeof(file3_test_txt)], + file3_test_txt, sizeof(file3_test_txt) - 1); + + /* Fifth header. */ + assertA(0 == archive_read_next_header(a, &ae)); + assertEqualString("testdir/LibarchiveAddingTest.html", + archive_entry_pathname(ae)); + assertA((int)archive_entry_mtime(ae)); + assertA((int)archive_entry_ctime(ae)); + assertA((int)archive_entry_atime(ae)); + assertEqualInt(file2_size, archive_entry_size(ae)); + assertEqualInt(33188, archive_entry_mode(ae)); + assertA(file2_size == archive_read_data(a, file2_buff, file2_size)); + assertEqualMem(&file2_buff[file2_size - sizeof(file2_test_txt) + 1], + file2_test_txt, sizeof(file2_test_txt) - 1); + + /* Sixth header. */ + assertA(0 == archive_read_next_header(a, &ae)); + assertEqualString("testdir", archive_entry_pathname(ae)); + assertA((int)archive_entry_mtime(ae)); + assertA((int)archive_entry_ctime(ae)); + assertA((int)archive_entry_atime(ae)); + assertEqualInt(0, archive_entry_size(ae)); + assertEqualInt(16877, archive_entry_mode(ae)); + + /* Seventh header. */ + assertA(0 == archive_read_next_header(a, &ae)); + assertEqualString("testemptydir", archive_entry_pathname(ae)); + assertA((int)archive_entry_mtime(ae)); + assertA((int)archive_entry_ctime(ae)); + assertA((int)archive_entry_atime(ae)); + assertEqualInt(0, archive_entry_size(ae)); + assertEqualInt(16877, archive_entry_mode(ae)); + + /* Test EOF */ + assertA(1 == archive_read_next_header(a, &ae)); + assertEqualInt(7, archive_file_count(a)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a)); + assertEqualInt(ARCHIVE_OK, archive_read_free(a)); +} + +DEFINE_TEST(test_read_format_rar_multivolume_skip) +{ + 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; + int file2_size = 20111; + int file3_size = 20; + 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)); + assertEqualString("ppmd_lzss_conversion_test.txt", + archive_entry_pathname(ae)); + assertA((int)archive_entry_mtime(ae)); + assertA((int)archive_entry_ctime(ae)); + assertA((int)archive_entry_atime(ae)); + assertEqualInt(file1_size, archive_entry_size(ae)); + assertEqualInt(33188, archive_entry_mode(ae)); + + /* Second header. */ + assertA(0 == archive_read_next_header(a, &ae)); + assertEqualString("LibarchiveAddingTest.html", archive_entry_pathname(ae)); + assertA((int)archive_entry_mtime(ae)); + assertA((int)archive_entry_ctime(ae)); + assertA((int)archive_entry_atime(ae)); + assertEqualInt(file2_size, archive_entry_size(ae)); + assertEqualInt(33188, archive_entry_mode(ae)); + + /* Third header. */ + assertA(0 == archive_read_next_header(a, &ae)); + assertEqualString("testlink", archive_entry_pathname(ae)); + assertA((int)archive_entry_mtime(ae)); + assertA((int)archive_entry_ctime(ae)); + assertA((int)archive_entry_atime(ae)); + assertEqualInt(0, archive_entry_size(ae)); + assertEqualInt(41471, archive_entry_mode(ae)); + assertEqualString("LibarchiveAddingTest.html", archive_entry_symlink(ae)); + + /* Fourth header. */ + assertA(0 == archive_read_next_header(a, &ae)); + assertEqualString("testdir/test.txt", archive_entry_pathname(ae)); + assertA((int)archive_entry_mtime(ae)); + assertA((int)archive_entry_ctime(ae)); + assertA((int)archive_entry_atime(ae)); + assertEqualInt(file3_size, archive_entry_size(ae)); + assertEqualInt(33188, archive_entry_mode(ae)); + + /* Fifth header. */ + assertA(0 == archive_read_next_header(a, &ae)); + assertEqualString("testdir/LibarchiveAddingTest.html", + archive_entry_pathname(ae)); + assertA((int)archive_entry_mtime(ae)); + assertA((int)archive_entry_ctime(ae)); + assertA((int)archive_entry_atime(ae)); + assertEqualInt(file2_size, archive_entry_size(ae)); + assertEqualInt(33188, archive_entry_mode(ae)); + + /* Sixth header. */ + assertA(0 == archive_read_next_header(a, &ae)); + assertEqualString("testdir", archive_entry_pathname(ae)); + assertA((int)archive_entry_mtime(ae)); + assertA((int)archive_entry_ctime(ae)); + assertA((int)archive_entry_atime(ae)); + assertEqualInt(0, archive_entry_size(ae)); + assertEqualInt(16877, archive_entry_mode(ae)); + + /* Seventh header. */ + assertA(0 == archive_read_next_header(a, &ae)); + assertEqualString("testemptydir", archive_entry_pathname(ae)); + assertA((int)archive_entry_mtime(ae)); + assertA((int)archive_entry_ctime(ae)); + assertA((int)archive_entry_atime(ae)); + assertEqualInt(0, archive_entry_size(ae)); + assertEqualInt(16877, archive_entry_mode(ae)); + + /* Test EOF */ + assertA(1 == archive_read_next_header(a, &ae)); + assertEqualInt(7, archive_file_count(a)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a)); + assertEqualInt(ARCHIVE_OK, archive_read_free(a)); +} + +DEFINE_TEST(test_read_format_rar_sfx) { char buff[441]; const char reffile[] = "test_read_format_rar_sfx.exe"; @@ -812,7 +1018,7 @@ test_sfx(void) 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_file(a, reffile, 10240)); + assertA(0 == archive_read_open_filename(a, reffile, 10240)); /* First header. */ assertA(0 == archive_read_next_header(a, &ae)); @@ -871,18 +1077,2510 @@ test_sfx(void) assertEqualInt(ARCHIVE_OK, archive_read_free(a)); } -DEFINE_TEST(test_read_format_rar) +DEFINE_TEST(test_read_format_rar_multivolume_stored_file) { - test_basic(); - test_subblock(); - test_noeof(); - test_unicode_UTF8(); - test_unicode_CP932(); - test_compress_normal(); - test_multi_lzss_blocks(); - test_compress_best(); - test_ppmd_lzss_conversion(); - test_binary(); - test_windows(); - test_sfx(); + const char *reffiles[] = + { + "test_rar_multivolume_single_file.part1.rar", + "test_rar_multivolume_single_file.part2.rar", + "test_rar_multivolume_single_file.part3.rar", + NULL + }; + char file_buff[20111]; + int file_size = sizeof(file_buff); + const char file_test_txt[] = "


\n" + "

\n" + "\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)); + assertEqualString("LibarchiveAddingTest.html", archive_entry_pathname(ae)); + assertA((int)archive_entry_mtime(ae)); + assertA((int)archive_entry_ctime(ae)); + assertA((int)archive_entry_atime(ae)); + assertEqualInt(file_size, archive_entry_size(ae)); + assertEqualInt(33188, archive_entry_mode(ae)); + assertA(file_size == archive_read_data(a, file_buff, file_size)); + assertEqualMem(&file_buff[file_size - sizeof(file_test_txt) + 1], + file_test_txt, sizeof(file_test_txt) - 1); + + /* Test EOF */ + assertA(1 == archive_read_next_header(a, &ae)); + assertEqualInt(1, archive_file_count(a)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a)); + assertEqualInt(ARCHIVE_OK, archive_read_free(a)); +} + +DEFINE_TEST(test_read_format_rar_multivolume_stored_file_skip) +{ + const char *reffiles[] = + { + "test_rar_multivolume_single_file.part1.rar", + "test_rar_multivolume_single_file.part2.rar", + "test_rar_multivolume_single_file.part3.rar", + NULL + }; + int file_size = 20111; + 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)); + assertEqualString("LibarchiveAddingTest.html", archive_entry_pathname(ae)); + assertA((int)archive_entry_mtime(ae)); + assertA((int)archive_entry_ctime(ae)); + assertA((int)archive_entry_atime(ae)); + assertEqualInt(file_size, archive_entry_size(ae)); + assertEqualInt(33188, archive_entry_mode(ae)); + + /* Test EOF */ + assertA(1 == archive_read_next_header(a, &ae)); + assertEqualInt(1, archive_file_count(a)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a)); + assertEqualInt(ARCHIVE_OK, archive_read_free(a)); +} + +DEFINE_TEST(test_read_format_rar_multivolume_seek_data) +{ + const char *reffiles[] = + { + "test_rar_multivolume_single_file.part1.rar", + "test_rar_multivolume_single_file.part2.rar", + "test_rar_multivolume_single_file.part3.rar", + NULL + }; + char buff[64]; + int file_size = 20111; + const char file_test_txt1[] = "d. \n

\n

" + "
\n

\n\n"; + const char file_test_txt2[] = "\n<"; + const char file_test_txt3[] = "mplify writing such tests,\ntry to use plat" + "form-independent codin"; + const char file_test_txt4[] = "lString in the example above)\ngenerat" + "e detailed log message"; + const char file_test_txt5[] = "SS=\"western\">make check will usually" + " run\n\tall of the tests."; + 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)); + assertEqualString("LibarchiveAddingTest.html", archive_entry_pathname(ae)); + assertA((int)archive_entry_mtime(ae)); + assertA((int)archive_entry_ctime(ae)); + assertA((int)archive_entry_atime(ae)); + assertEqualInt(file_size, archive_entry_size(ae)); + assertEqualInt(33188, archive_entry_mode(ae)); + + /* Seek to the end minus 64 bytes */ + assertA(file_size - (int)sizeof(buff) == + archive_seek_data(a, file_size - (int)sizeof(buff), SEEK_SET)); + assertA(sizeof(buff) == archive_read_data(a, buff, sizeof(buff))); + assertEqualMem(buff, file_test_txt1, sizeof(file_test_txt1) - 1); + + /* Seek back to the beginning */ + assertA(0 == archive_seek_data(a, 0, SEEK_SET)); + assertA(sizeof(buff) == archive_read_data(a, buff, sizeof(buff))); + assertEqualMem(buff, file_test_txt2, sizeof(file_test_txt2) - 1); + + /* Seek to the middle of the combined data block */ + assertA(10054 == archive_seek_data(a, 10054, SEEK_SET)); + assertA(sizeof(buff) == archive_read_data(a, buff, sizeof(buff))); + assertEqualMem(buff, file_test_txt3, sizeof(file_test_txt3) - 1); + + /* Seek to 32 bytes before the end of the first data sub-block */ + assertA(6860 == archive_seek_data(a, 6860, SEEK_SET)); + assertA(sizeof(buff) == archive_read_data(a, buff, sizeof(buff))); + assertEqualMem(buff, file_test_txt4, sizeof(file_test_txt4) - 1); + + /* Seek to 32 bytes before the end of the second data sub-block */ + assertA(13752 == archive_seek_data(a, 13752, SEEK_SET)); + assertA(sizeof(buff) == archive_read_data(a, buff, sizeof(buff))); + assertEqualMem(buff, file_test_txt5, sizeof(file_test_txt5) - 1); + + /* Use various combinations of SEEK_SET, SEEK_CUR, and SEEK_END */ + assertEqualInt(file_size, archive_seek_data(a, 0, SEEK_END)); + assertEqualInt(0, archive_seek_data(a, 0, SEEK_SET)); + assertEqualInt(0, archive_seek_data(a, 0, SEEK_CUR)); + assertEqualInt(-1, archive_seek_data(a, -10, SEEK_CUR)); + assertEqualInt(10, archive_seek_data(a, 10, SEEK_CUR)); + assertEqualInt(-1, archive_seek_data(a, -20, SEEK_CUR)); + assertEqualInt(10, archive_seek_data(a, 0, SEEK_CUR)); + assertEqualInt(file_size, archive_seek_data(a, 0, SEEK_END)); + assertEqualInt(file_size - 20, archive_seek_data(a, -20, SEEK_END)); + assertEqualInt(file_size + 40, archive_seek_data(a, 40, SEEK_END)); + assertEqualInt(file_size + 40, archive_seek_data(a, 0, SEEK_CUR)); + assertEqualInt(file_size + 40 + 20, archive_seek_data(a, 20, SEEK_CUR)); + assertEqualInt(file_size + 40 + 20 + 20, archive_seek_data(a, 20, SEEK_CUR)); + assertEqualInt(file_size + 20, archive_seek_data(a, 20, SEEK_END)); + assertEqualInt(file_size - 20, archive_seek_data(a, -20, SEEK_END)); + + /* + * Attempt to read from the end of the file. These should return + * 0 for end of file. + */ + assertEqualInt(file_size, archive_seek_data(a, 0, SEEK_END)); + assertA(0 == archive_read_data(a, buff, sizeof(buff))); + assertEqualInt(file_size + 40, archive_seek_data(a, 40, SEEK_CUR)); + assertA(0 == archive_read_data(a, buff, sizeof(buff))); + + /* Seek to the end minus 64 bytes */ + assertA(0 == archive_seek_data(a, 0, SEEK_SET)); + assertA(file_size - (int)sizeof(buff) == + archive_seek_data(a, -(int)sizeof(buff), SEEK_END)); + assertA(sizeof(buff) == archive_read_data(a, buff, sizeof(buff))); + assertEqualMem(buff, file_test_txt1, sizeof(file_test_txt1) - 1); + + /* The file position should be at the end of the file here */ + assertA(file_size == archive_seek_data(a, 0, SEEK_CUR)); + + /* Seek back to the beginning */ + assertA(0 == archive_seek_data(a, -file_size, SEEK_CUR)); + assertA(sizeof(buff) == archive_read_data(a, buff, sizeof(buff))); + assertEqualMem(buff, file_test_txt2, sizeof(file_test_txt2) - 1); + + /* Seek to the middle of the combined data block */ + assertA(10054 == archive_seek_data(a, 10054 - (int)sizeof(buff), SEEK_CUR)); + assertA(sizeof(buff) == archive_read_data(a, buff, sizeof(buff))); + assertEqualMem(buff, file_test_txt3, sizeof(file_test_txt3) - 1); + + /* Seek to 32 bytes before the end of the first data sub-block */ + assertA(6860 == archive_seek_data(a, 6860 - (10054 + (int)sizeof(buff)), + SEEK_CUR)); + assertA(sizeof(buff) == archive_read_data(a, buff, sizeof(buff))); + assertEqualMem(buff, file_test_txt4, sizeof(file_test_txt4) - 1); + + /* Seek to 32 bytes before the end of the second data sub-block */ + assertA(13752 == archive_seek_data(a, 13752 - file_size, SEEK_END)); + assertA(sizeof(buff) == archive_read_data(a, buff, sizeof(buff))); + assertEqualMem(buff, file_test_txt5, sizeof(file_test_txt5) - 1); + + /* Test EOF */ + assertA(1 == archive_read_next_header(a, &ae)); + assertEqualInt(1, archive_file_count(a)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a)); + assertEqualInt(ARCHIVE_OK, archive_read_free(a)); +} + +DEFINE_TEST(test_read_format_rar_multivolume_seek_multiple_files) +{ + const char *reffiles[] = + { + "test_rar_multivolume_multiple_files.part1.rar", + "test_rar_multivolume_multiple_files.part2.rar", + "test_rar_multivolume_multiple_files.part3.rar", + "test_rar_multivolume_multiple_files.part4.rar", + "test_rar_multivolume_multiple_files.part5.rar", + "test_rar_multivolume_multiple_files.part6.rar", + NULL + }; + char buff[64]; + int file_size = 20111; + const char file_test_txt1[] = "d. \n

\n

" + "
\n

\n\n"; + const char file_test_txt2[] = "\n<"; + const char file_test_txt3[] = "mplify writing such tests,\ntry to use plat" + "form-independent codin"; + const char file_test_txt4[] = "\nfailures. \n

\n

<" + "A NAME=\"Life_cycle_of_a_te"; + const char file_test_txt5[] = "LE=\"margin-bottom: 0in\">DO use runtime te" + "sts for platform\n\tfeatu"; + const char file_test_txt6[] = "rough test suite is essential\nboth for ver" + "ifying new ports and f"; + const char file_test_txt7[] = "m: 0in\">Creates a temporary directory\n\tw" + "hose name matches the na"; + const char file_test_txt8[] = "lt\ninput file and verify the results. Thes" + "e use \n", buff); + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, -1, archive_seek_data(a, -(((int)sizeof(buff)-1)*2), SEEK_CUR)); + assertEqualIntA(a, (sizeof(buff)-1), archive_seek_data(a, 0, SEEK_CUR)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualIntA(a, ((sizeof(buff)-1)*2), archive_seek_data(a, 0, SEEK_CUR)); + assertEqualStringA(a, "\n\n\t\n\t\n\t 0); + + /* Seek to the end minus (sizeof(buff)-1) bytes */ + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 20111 - (int)(sizeof(buff)-1), + archive_seek_data(a, -((int)sizeof(buff)-1), SEEK_END)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, ". \n

\n


\n" + "

\n\n", buff); + + /* Seek back to the beginning */ + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 0, archive_seek_data(a, -20111, SEEK_END)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "\n", buff); + + /* Test that SEEK_SET works correctly between data blocks */ + assertEqualIntA(a, 0, archive_seek_data(a, 0, SEEK_SET)); + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 13164, + archive_seek_data(a, 13164, SEEK_SET)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "ertEqualInt,\n\tassertEqualString, " + "assertEqualMem to test equalit", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 0, + archive_seek_data(a, 0, SEEK_SET)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "\n", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 20111 - (int)(sizeof(buff)-1), + archive_seek_data(a, 20111 - (int)(sizeof(buff)-1), SEEK_SET)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, ". \n

\n


\n" + "

\n\n", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 13164, + archive_seek_data(a, 13164, SEEK_SET)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "ertEqualInt,\n\tassertEqualString, " + "assertEqualMem to test equalit", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 20111 - (int)(sizeof(buff)-1), + archive_seek_data(a, 20111 - (int)(sizeof(buff)-1), SEEK_SET)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, ". \n

\n


\n" + "

\n\n", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 0, + archive_seek_data(a, 0, SEEK_SET)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "\n", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 20111 - (int)(sizeof(buff)-1), + archive_seek_data(a, 20111 - (int)(sizeof(buff)-1), SEEK_SET)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, ". \n

\n


\n" + "

\n\n", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 13164, + archive_seek_data(a, 13164, SEEK_SET)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "ertEqualInt,\n\tassertEqualString, " + "assertEqualMem to test equalit", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 0, + archive_seek_data(a, 0, SEEK_SET)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "\n", buff); + + /* Test that SEEK_CUR works correctly between data blocks */ + assertEqualIntA(a, 0, archive_seek_data(a, 0, SEEK_SET)); + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 13164, + archive_seek_data(a, 13164, SEEK_CUR)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "ertEqualInt,\n\tassertEqualString, " + "assertEqualMem to test equalit", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 0, + archive_seek_data(a, -13227, SEEK_CUR)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "\n", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 20111 - (int)(sizeof(buff)-1), + archive_seek_data(a, 19985, SEEK_CUR)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, ". \n

\n


\n" + "

\n\n", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 13164, + archive_seek_data(a, -6947, SEEK_CUR)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "ertEqualInt,\n\tassertEqualString, " + "assertEqualMem to test equalit", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 20111 - (int)(sizeof(buff)-1), + archive_seek_data(a, 6821, SEEK_CUR)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, ". \n

\n


\n" + "

\n\n", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 0, + archive_seek_data(a, -20111, SEEK_CUR)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "\n", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 20111 - (int)(sizeof(buff)-1), + archive_seek_data(a, 19985, SEEK_CUR)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, ". \n

\n


\n" + "

\n\n", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 13164, + archive_seek_data(a, -6947, SEEK_CUR)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "ertEqualInt,\n\tassertEqualString, " + "assertEqualMem to test equalit", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 0, + archive_seek_data(a, -13227, SEEK_CUR)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "\n", buff); + + /* Test that SEEK_END works correctly between data blocks */ + assertEqualIntA(a, 0, archive_seek_data(a, 0, SEEK_SET)); + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 13164, + archive_seek_data(a, -6947, SEEK_END)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "ertEqualInt,\n\tassertEqualString, " + "assertEqualMem to test equalit", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 0, + archive_seek_data(a, -20111, SEEK_END)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "\n", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 20111 - (int)(sizeof(buff)-1), + archive_seek_data(a, -((int)sizeof(buff)-1), SEEK_END)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, ". \n

\n


\n" + "

\n\n", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 13164, + archive_seek_data(a, -6947, SEEK_END)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "ertEqualInt,\n\tassertEqualString, " + "assertEqualMem to test equalit", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 20111 - (int)(sizeof(buff)-1), + archive_seek_data(a, -((int)sizeof(buff)-1), SEEK_END)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, ". \n

\n


\n" + "

\n\n", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 0, + archive_seek_data(a, -20111, SEEK_END)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "\n", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 20111 - (int)(sizeof(buff)-1), + archive_seek_data(a, -((int)sizeof(buff)-1), SEEK_END)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, ". \n

\n


\n" + "

\n\n", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 13164, + archive_seek_data(a, -6947, SEEK_END)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "ertEqualInt,\n\tassertEqualString, " + "assertEqualMem to test equalit", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 0, + archive_seek_data(a, -20111, SEEK_END)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "\n", buff); + + test_read_format_rar_multivolume_uncompressed_files_helper(a); + + /* + * Second header. + */ + assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); + assertEqualStringA(a, "testdir/testsubdir/LibarchiveAddingTest2.html", + archive_entry_pathname(ae)); + assertA((int)archive_entry_mtime(ae)); + assertA((int)archive_entry_ctime(ae)); + assertA((int)archive_entry_atime(ae)); + assertEqualIntA(a, 20111, archive_entry_size(ae)); + assertEqualIntA(a, 33188, archive_entry_mode(ae)); + + test_read_format_rar_multivolume_uncompressed_files_helper(a); + + /* Read from the beginning to the end of the file */ + assertEqualIntA(a, 0, archive_seek_data(a, 0, SEEK_SET)); + do + { + memset(buff, 0, sizeof(buff)); + bytes_read = archive_read_data(a, buff, (sizeof(buff)-1)); + } while (bytes_read > 0); + + /* Seek to the end minus (sizeof(buff)-1) bytes */ + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 20111 - (int)(sizeof(buff)-1), + archive_seek_data(a, -((int)sizeof(buff)-1), SEEK_END)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, ". \n

\n


\n" + "

\n\n", buff); + + /* Seek back to the beginning */ + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 0, archive_seek_data(a, -20111, SEEK_END)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "\n", buff); + + /* Test that SEEK_SET works correctly between data blocks */ + assertEqualIntA(a, 0, archive_seek_data(a, 0, SEEK_SET)); + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 6162, + archive_seek_data(a, 6162, SEEK_SET)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "arguments satisfy certain conditions. " + "If the assertion fails--f", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 19347, + archive_seek_data(a, 19347, SEEK_SET)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, " when a block being written out by\n" + "the archive writer is the sa", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 20111 - (int)(sizeof(buff)-1), + archive_seek_data(a, 20111 - (int)(sizeof(buff)-1), SEEK_SET)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, ". \n

\n


\n" + "

\n\n", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 19347, + archive_seek_data(a, 19347, SEEK_SET)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, " when a block being written out by\n" + "the archive writer is the sa", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 6162, + archive_seek_data(a, 6162, SEEK_SET)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "arguments satisfy certain conditions. " + "If the assertion fails--f", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 0, + archive_seek_data(a, 0, SEEK_SET)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "\n", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 20111 - (int)(sizeof(buff)-1), + archive_seek_data(a, 20111 - (int)(sizeof(buff)-1), SEEK_SET)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, ". \n

\n


\n" + "

\n\n", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 6162, + archive_seek_data(a, 6162, SEEK_SET)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "arguments satisfy certain conditions. " + "If the assertion fails--f", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 19347, + archive_seek_data(a, 19347, SEEK_SET)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, " when a block being written out by\n" + "the archive writer is the sa", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 0, + archive_seek_data(a, 0, SEEK_SET)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "\n", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 20111 - (int)(sizeof(buff)-1), + archive_seek_data(a, 20111 - (int)(sizeof(buff)-1), SEEK_SET)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, ". \n

\n


\n" + "

\n\n", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 0, + archive_seek_data(a, 0, SEEK_SET)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "\n", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 19347, + archive_seek_data(a, 19347, SEEK_SET)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, " when a block being written out by\n" + "the archive writer is the sa", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 6162, + archive_seek_data(a, 6162, SEEK_SET)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "arguments satisfy certain conditions. " + "If the assertion fails--f", buff); + + /* Test that SEEK_CUR works correctly between data blocks */ + assertEqualIntA(a, 0, archive_seek_data(a, 0, SEEK_SET)); + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 6162, + archive_seek_data(a, 6162, SEEK_CUR)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "arguments satisfy certain conditions. " + "If the assertion fails--f", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 19347, + archive_seek_data(a, 13122, SEEK_CUR)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, " when a block being written out by\n" + "the archive writer is the sa", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 20111 - (int)(sizeof(buff)-1), + archive_seek_data(a, 638, SEEK_CUR)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, ". \n

\n


\n" + "

\n\n", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 19347, + archive_seek_data(a, -764, SEEK_CUR)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, " when a block being written out by\n" + "the archive writer is the sa", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 6162, + archive_seek_data(a, -13248, SEEK_CUR)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "arguments satisfy certain conditions. " + "If the assertion fails--f", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 0, + archive_seek_data(a, -6225, SEEK_CUR)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "\n", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 20111 - (int)(sizeof(buff)-1), + archive_seek_data(a, 19985, SEEK_CUR)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, ". \n

\n


\n" + "

\n\n", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 6162, + archive_seek_data(a, -13949, SEEK_CUR)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "arguments satisfy certain conditions. " + "If the assertion fails--f", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 19347, + archive_seek_data(a, 13122, SEEK_CUR)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, " when a block being written out by\n" + "the archive writer is the sa", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 0, + archive_seek_data(a, -19410, SEEK_CUR)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "\n", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 20111 - (int)(sizeof(buff)-1), + archive_seek_data(a, 19985, SEEK_CUR)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, ". \n

\n


\n" + "

\n\n", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 0, + archive_seek_data(a, -20111, SEEK_CUR)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "\n", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 19347, + archive_seek_data(a, 19284, SEEK_CUR)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, " when a block being written out by\n" + "the archive writer is the sa", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 6162, + archive_seek_data(a, -13248, SEEK_CUR)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "arguments satisfy certain conditions. " + "If the assertion fails--f", buff); + + /* Test that SEEK_END works correctly between data blocks */ + assertEqualIntA(a, 0, archive_seek_data(a, 0, SEEK_SET)); + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 6162, + archive_seek_data(a, -13949, SEEK_END)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "arguments satisfy certain conditions. " + "If the assertion fails--f", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 19347, + archive_seek_data(a, -764, SEEK_END)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, " when a block being written out by\n" + "the archive writer is the sa", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 20111 - (int)(sizeof(buff)-1), + archive_seek_data(a, -((int)sizeof(buff)-1), SEEK_END)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, ". \n

\n


\n" + "

\n\n", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 19347, + archive_seek_data(a, -764, SEEK_END)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, " when a block being written out by\n" + "the archive writer is the sa", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 6162, + archive_seek_data(a, -13949, SEEK_END)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "arguments satisfy certain conditions. " + "If the assertion fails--f", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 0, + archive_seek_data(a, -20111, SEEK_END)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "\n", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 20111 - (int)(sizeof(buff)-1), + archive_seek_data(a, -((int)sizeof(buff)-1), SEEK_END)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, ". \n

\n


\n" + "

\n\n", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 6162, + archive_seek_data(a, -13949, SEEK_END)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "arguments satisfy certain conditions. " + "If the assertion fails--f", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 19347, + archive_seek_data(a, -764, SEEK_END)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, " when a block being written out by\n" + "the archive writer is the sa", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 0, + archive_seek_data(a, -20111, SEEK_END)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "\n", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 20111 - (int)(sizeof(buff)-1), + archive_seek_data(a, -((int)sizeof(buff)-1), SEEK_END)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, ". \n

\n


\n" + "

\n\n", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 0, + archive_seek_data(a, -20111, SEEK_END)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "\n", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 19347, + archive_seek_data(a, -764, SEEK_END)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, " when a block being written out by\n" + "the archive writer is the sa", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 6162, + archive_seek_data(a, -13949, SEEK_END)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "arguments satisfy certain conditions. " + "If the assertion fails--f", buff); + + test_read_format_rar_multivolume_uncompressed_files_helper(a); + + /* + * Third header. + */ + assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); + assertEqualStringA(a, "LibarchiveAddingTest2.html", + archive_entry_pathname(ae)); + assertA((int)archive_entry_mtime(ae)); + assertA((int)archive_entry_ctime(ae)); + assertA((int)archive_entry_atime(ae)); + assertEqualIntA(a, 20111, archive_entry_size(ae)); + assertEqualIntA(a, 33188, archive_entry_mode(ae)); + + test_read_format_rar_multivolume_uncompressed_files_helper(a); + + /* Read from the beginning to the end of the file */ + assertEqualIntA(a, 0, archive_seek_data(a, 0, SEEK_SET)); + do + { + memset(buff, 0, sizeof(buff)); + bytes_read = archive_read_data(a, buff, (sizeof(buff)-1)); + } while (bytes_read > 0); + + /* Seek to the end minus (sizeof(buff)-1) bytes */ + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 20111 - (int)(sizeof(buff)-1), + archive_seek_data(a, -((int)sizeof(buff)-1), SEEK_END)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, ". \n

\n


\n" + "

\n\n", buff); + + /* Seek back to the beginning */ + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 0, archive_seek_data(a, -20111, SEEK_END)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "\n", buff); + + /* Test that SEEK_SET works correctly between data blocks */ + assertEqualIntA(a, 0, archive_seek_data(a, 0, SEEK_SET)); + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 12353, + archive_seek_data(a, 12353, SEEK_SET)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, " 0.2in\">    " + "extract_reference_file("test_foo.tar", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 0, + archive_seek_data(a, 0, SEEK_SET)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "\n", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 20111 - (int)(sizeof(buff)-1), + archive_seek_data(a, 20111 - (int)(sizeof(buff)-1), SEEK_SET)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, ". \n

\n


\n" + "

\n\n", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 12353, + archive_seek_data(a, 12353, SEEK_SET)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, " 0.2in\">    " + "extract_reference_file("test_foo.tar", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 20111 - (int)(sizeof(buff)-1), + archive_seek_data(a, 20111 - (int)(sizeof(buff)-1), SEEK_SET)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, ". \n

\n


\n" + "

\n\n", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 0, + archive_seek_data(a, 0, SEEK_SET)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "\n", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 20111 - (int)(sizeof(buff)-1), + archive_seek_data(a, 20111 - (int)(sizeof(buff)-1), SEEK_SET)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, ". \n

\n


\n" + "

\n\n", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 12353, + archive_seek_data(a, 12353, SEEK_SET)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, " 0.2in\">    " + "extract_reference_file("test_foo.tar", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 0, + archive_seek_data(a, 0, SEEK_SET)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "\n", buff); + + /* Test that SEEK_CUR works correctly between data blocks */ + assertEqualIntA(a, 0, archive_seek_data(a, 0, SEEK_SET)); + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 12353, + archive_seek_data(a, 12353, SEEK_CUR)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, " 0.2in\">    " + "extract_reference_file("test_foo.tar", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 0, + archive_seek_data(a, -12416, SEEK_CUR)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "\n", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 20111 - (int)(sizeof(buff)-1), + archive_seek_data(a, 19985, SEEK_CUR)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, ". \n

\n


\n" + "

\n\n", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 12353, + archive_seek_data(a, -7758, SEEK_CUR)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, " 0.2in\">    " + "extract_reference_file("test_foo.tar", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 20111 - (int)(sizeof(buff)-1), + archive_seek_data(a, 7632, SEEK_CUR)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, ". \n

\n


\n" + "

\n\n", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 0, + archive_seek_data(a, -20111, SEEK_CUR)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "\n", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 20111 - (int)(sizeof(buff)-1), + archive_seek_data(a, 19985, SEEK_CUR)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, ". \n

\n


\n" + "

\n\n", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 12353, + archive_seek_data(a, -7758, SEEK_CUR)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, " 0.2in\">    " + "extract_reference_file("test_foo.tar", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 0, + archive_seek_data(a, -12416, SEEK_CUR)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "\n", buff); + + /* Test that SEEK_END works correctly between data blocks */ + assertEqualIntA(a, 0, archive_seek_data(a, 0, SEEK_SET)); + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 12353, + archive_seek_data(a, -7758, SEEK_END)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, " 0.2in\">    " + "extract_reference_file("test_foo.tar", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 0, + archive_seek_data(a, -20111, SEEK_END)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "\n", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 20111 - (int)(sizeof(buff)-1), + archive_seek_data(a, -((int)sizeof(buff)-1), SEEK_END)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, ". \n

\n


\n" + "

\n\n", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 12353, + archive_seek_data(a, -7758, SEEK_END)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, " 0.2in\">    " + "extract_reference_file("test_foo.tar", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 20111 - (int)(sizeof(buff)-1), + archive_seek_data(a, -((int)sizeof(buff)-1), SEEK_END)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, ". \n

\n


\n" + "

\n\n", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 0, + archive_seek_data(a, -20111, SEEK_END)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "\n", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 20111 - (int)(sizeof(buff)-1), + archive_seek_data(a, -((int)sizeof(buff)-1), SEEK_END)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, ". \n

\n


\n" + "

\n\n", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 12353, + archive_seek_data(a, -7758, SEEK_END)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, " 0.2in\">    " + "extract_reference_file("test_foo.tar", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 0, + archive_seek_data(a, -20111, SEEK_END)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "\n", buff); + + test_read_format_rar_multivolume_uncompressed_files_helper(a); + + /* + * Fourth header. + */ + assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); + assertEqualStringA(a, "testdir/LibarchiveAddingTest.html", + archive_entry_pathname(ae)); + assertA((int)archive_entry_mtime(ae)); + assertA((int)archive_entry_ctime(ae)); + assertA((int)archive_entry_atime(ae)); + assertEqualIntA(a, 20111, archive_entry_size(ae)); + assertEqualIntA(a, 33188, archive_entry_mode(ae)); + + test_read_format_rar_multivolume_uncompressed_files_helper(a); + + /* Read from the beginning to the end of the file */ + assertEqualIntA(a, 0, archive_seek_data(a, 0, SEEK_SET)); + do + { + memset(buff, 0, sizeof(buff)); + bytes_read = archive_read_data(a, buff, (sizeof(buff)-1)); + } while (bytes_read > 0); + + /* Seek to the end minus (sizeof(buff)-1) bytes */ + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 20111 - (int)(sizeof(buff)-1), + archive_seek_data(a, -((int)sizeof(buff)-1), SEEK_END)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, ". \n

\n


\n" + "

\n\n", buff); + + /* Seek back to the beginning */ + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 0, archive_seek_data(a, -20111, SEEK_END)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "\n", buff); + + /* Test that SEEK_SET works correctly between data blocks */ + assertEqualIntA(a, 0, archive_seek_data(a, 0, SEEK_SET)); + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 5371, + archive_seek_data(a, 5371, SEEK_SET)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "zip)\n  {\n    " + "/* ... setup omitted ... */\n  ", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 13165, + archive_seek_data(a, 13165, SEEK_SET)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "rtEqualInt,\n\tassertEqualString, " + "assertEqualMem to test equality", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 20111 - (int)(sizeof(buff)-1), + archive_seek_data(a, 20111 - (int)(sizeof(buff)-1), SEEK_SET)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, ". \n

\n


\n" + "

\n\n", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 13165, + archive_seek_data(a, 13165, SEEK_SET)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "rtEqualInt,\n\tassertEqualString, " + "assertEqualMem to test equality", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 5371, + archive_seek_data(a, 5371, SEEK_SET)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "zip)\n  {\n    " + "/* ... setup omitted ... */\n  ", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 0, + archive_seek_data(a, 0, SEEK_SET)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "\n", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 20111 - (int)(sizeof(buff)-1), + archive_seek_data(a, 20111 - (int)(sizeof(buff)-1), SEEK_SET)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, ". \n

\n


\n" + "

\n\n", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 5371, + archive_seek_data(a, 5371, SEEK_SET)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "zip)\n  {\n    " + "/* ... setup omitted ... */\n  ", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 13165, + archive_seek_data(a, 13165, SEEK_SET)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "rtEqualInt,\n\tassertEqualString, " + "assertEqualMem to test equality", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 0, + archive_seek_data(a, 0, SEEK_SET)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "\n", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 20111 - (int)(sizeof(buff)-1), + archive_seek_data(a, 20111 - (int)(sizeof(buff)-1), SEEK_SET)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, ". \n

\n


\n" + "

\n\n", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 0, + archive_seek_data(a, 0, SEEK_SET)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "\n", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 13165, + archive_seek_data(a, 13165, SEEK_SET)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "rtEqualInt,\n\tassertEqualString, " + "assertEqualMem to test equality", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 5371, + archive_seek_data(a, 5371, SEEK_SET)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "zip)\n  {\n    " + "/* ... setup omitted ... */\n  ", buff); + + /* Test that SEEK_CUR works correctly between data blocks */ + assertEqualIntA(a, 0, archive_seek_data(a, 0, SEEK_SET)); + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 5371, + archive_seek_data(a, 5371, SEEK_CUR)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "zip)\n  {\n    " + "/* ... setup omitted ... */\n  ", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 13165, + archive_seek_data(a, 7731, SEEK_CUR)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "rtEqualInt,\n\tassertEqualString, " + "assertEqualMem to test equality", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 20111 - (int)(sizeof(buff)-1), + archive_seek_data(a, 6820, SEEK_CUR)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, ". \n

\n


\n" + "

\n\n", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 13165, + archive_seek_data(a, -6946, SEEK_CUR)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "rtEqualInt,\n\tassertEqualString, " + "assertEqualMem to test equality", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 5371, + archive_seek_data(a, -7857, SEEK_CUR)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "zip)\n  {\n    " + "/* ... setup omitted ... */\n  ", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 0, + archive_seek_data(a, -5434, SEEK_CUR)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "\n", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 20111 - (int)(sizeof(buff)-1), + archive_seek_data(a, 19985, SEEK_CUR)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, ". \n

\n


\n" + "

\n\n", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 5371, + archive_seek_data(a, -14740, SEEK_CUR)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "zip)\n  {\n    " + "/* ... setup omitted ... */\n  ", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 13165, + archive_seek_data(a, 7731, SEEK_CUR)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "rtEqualInt,\n\tassertEqualString, " + "assertEqualMem to test equality", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 0, + archive_seek_data(a, -13228, SEEK_CUR)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "\n", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 20111 - (int)(sizeof(buff)-1), + archive_seek_data(a, 19985, SEEK_CUR)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, ". \n

\n


\n" + "

\n\n", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 0, + archive_seek_data(a, -20111, SEEK_CUR)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "\n", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 13165, + archive_seek_data(a, 13102, SEEK_CUR)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "rtEqualInt,\n\tassertEqualString, " + "assertEqualMem to test equality", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 5371, + archive_seek_data(a, -7857, SEEK_CUR)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "zip)\n  {\n    " + "/* ... setup omitted ... */\n  ", buff); + + /* Test that SEEK_END works correctly between data blocks */ + assertEqualIntA(a, 0, archive_seek_data(a, 0, SEEK_SET)); + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 5371, + archive_seek_data(a, -14740, SEEK_END)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "zip)\n  {\n    " + "/* ... setup omitted ... */\n  ", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 13165, + archive_seek_data(a, -6946, SEEK_END)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "rtEqualInt,\n\tassertEqualString, " + "assertEqualMem to test equality", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 20111 - (int)(sizeof(buff)-1), + archive_seek_data(a, -((int)sizeof(buff)-1), SEEK_END)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, ". \n

\n


\n" + "

\n\n", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 13165, + archive_seek_data(a, -6946, SEEK_END)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "rtEqualInt,\n\tassertEqualString, " + "assertEqualMem to test equality", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 5371, + archive_seek_data(a, -14740, SEEK_END)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "zip)\n  {\n    " + "/* ... setup omitted ... */\n  ", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 0, + archive_seek_data(a, -20111, SEEK_END)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "\n", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 20111 - (int)(sizeof(buff)-1), + archive_seek_data(a, -((int)sizeof(buff)-1), SEEK_END)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, ". \n

\n


\n" + "

\n\n", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 5371, + archive_seek_data(a, -14740, SEEK_END)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "zip)\n  {\n    " + "/* ... setup omitted ... */\n  ", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 13165, + archive_seek_data(a, -6946, SEEK_END)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "rtEqualInt,\n\tassertEqualString, " + "assertEqualMem to test equality", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 0, + archive_seek_data(a, -20111, SEEK_END)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "\n", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 20111 - (int)(sizeof(buff)-1), + archive_seek_data(a, -((int)sizeof(buff)-1), SEEK_END)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, ". \n

\n


\n" + "

\n\n", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 0, + archive_seek_data(a, -20111, SEEK_END)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "\n", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 13165, + archive_seek_data(a, -6946, SEEK_END)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "rtEqualInt,\n\tassertEqualString, " + "assertEqualMem to test equality", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 5371, + archive_seek_data(a, -14740, SEEK_END)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "zip)\n  {\n    " + "/* ... setup omitted ... */\n  ", buff); + + test_read_format_rar_multivolume_uncompressed_files_helper(a); + + /* + * Fifth header. + */ + assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); + assertEqualStringA(a, "testdir/testsubdir/LibarchiveAddingTest.html", + archive_entry_pathname(ae)); + assertA((int)archive_entry_mtime(ae)); + assertA((int)archive_entry_ctime(ae)); + assertA((int)archive_entry_atime(ae)); + assertEqualIntA(a, 20111, archive_entry_size(ae)); + assertEqualIntA(a, 33188, archive_entry_mode(ae)); + + test_read_format_rar_multivolume_uncompressed_files_helper(a); + + /* Read from the beginning to the end of the file */ + assertEqualIntA(a, 0, archive_seek_data(a, 0, SEEK_SET)); + do + { + memset(buff, 0, sizeof(buff)); + bytes_read = archive_read_data(a, buff, (sizeof(buff)-1)); + } while (bytes_read > 0); + + /* Seek to the end minus (sizeof(buff)-1) bytes */ + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 20111 - (int)(sizeof(buff)-1), + archive_seek_data(a, -((int)sizeof(buff)-1), SEEK_END)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, ". \n

\n


\n" + "

\n\n", buff); + + /* Seek back to the beginning */ + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 0, archive_seek_data(a, -20111, SEEK_END)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "\n", buff); + + /* Test that SEEK_SET works correctly between data blocks */ + assertEqualIntA(a, 0, archive_seek_data(a, 0, SEEK_SET)); + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 11568, + archive_seek_data(a, 11568, SEEK_SET)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, ", assertFileContents," + "\n\t\n", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 20111 - (int)(sizeof(buff)-1), + archive_seek_data(a, 20111 - (int)(sizeof(buff)-1), SEEK_SET)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, ". \n

\n


\n" + "

\n\n", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 11568, + archive_seek_data(a, 11568, SEEK_SET)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, ", assertFileContents," + "\n\t\n


\n" + "

\n\n", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 0, + archive_seek_data(a, 0, SEEK_SET)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "\n", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 20111 - (int)(sizeof(buff)-1), + archive_seek_data(a, 20111 - (int)(sizeof(buff)-1), SEEK_SET)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, ". \n

\n


\n" + "

\n\n", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 11568, + archive_seek_data(a, 11568, SEEK_SET)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, ", assertFileContents," + "\n\t\n", buff); + + /* Test that SEEK_CUR works correctly between data blocks */ + assertEqualIntA(a, 0, archive_seek_data(a, 0, SEEK_SET)); + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 11568, + archive_seek_data(a, 11568, SEEK_CUR)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, ", assertFileContents," + "\n\t\n", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 20111 - (int)(sizeof(buff)-1), + archive_seek_data(a, 19985, SEEK_CUR)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, ". \n

\n


\n" + "

\n\n", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 11568, + archive_seek_data(a, -8543, SEEK_CUR)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, ", assertFileContents," + "\n\t\n


\n" + "

\n\n", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 0, + archive_seek_data(a, -20111, SEEK_CUR)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "\n", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 20111 - (int)(sizeof(buff)-1), + archive_seek_data(a, 19985, SEEK_CUR)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, ". \n

\n


\n" + "

\n\n", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 11568, + archive_seek_data(a, -8543, SEEK_CUR)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, ", assertFileContents," + "\n\t\n", buff); + + /* Test that SEEK_END works correctly between data blocks */ + assertEqualIntA(a, 0, archive_seek_data(a, 0, SEEK_SET)); + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 11568, + archive_seek_data(a, -8543, SEEK_END)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, ", assertFileContents," + "\n\t\n", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 20111 - (int)(sizeof(buff)-1), + archive_seek_data(a, -((int)sizeof(buff)-1), SEEK_END)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, ". \n

\n


\n" + "

\n\n", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 11568, + archive_seek_data(a, -8543, SEEK_END)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, ", assertFileContents," + "\n\t\n


\n" + "

\n\n", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 0, + archive_seek_data(a, -20111, SEEK_END)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "\n", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 20111 - (int)(sizeof(buff)-1), + archive_seek_data(a, -((int)sizeof(buff)-1), SEEK_END)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, ". \n

\n


\n" + "

\n\n", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 11568, + archive_seek_data(a, -8543, SEEK_END)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, ", assertFileContents," + "\n\t\n", buff); + + test_read_format_rar_multivolume_uncompressed_files_helper(a); + + /* + * Sixth header. + */ + assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); + assertEqualStringA(a, "LibarchiveAddingTest.html", + archive_entry_pathname(ae)); + assertA((int)archive_entry_mtime(ae)); + assertA((int)archive_entry_ctime(ae)); + assertA((int)archive_entry_atime(ae)); + assertEqualIntA(a, 20111, archive_entry_size(ae)); + assertEqualIntA(a, 33188, archive_entry_mode(ae)); + + test_read_format_rar_multivolume_uncompressed_files_helper(a); + + /* Read from the beginning to the end of the file */ + assertEqualIntA(a, 0, archive_seek_data(a, 0, SEEK_SET)); + do + { + memset(buff, 0, sizeof(buff)); + bytes_read = archive_read_data(a, buff, (sizeof(buff)-1)); + } while (bytes_read > 0); + + /* Seek to the end minus (sizeof(buff)-1) bytes */ + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 20111 - (int)(sizeof(buff)-1), + archive_seek_data(a, -((int)sizeof(buff)-1), SEEK_END)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, ". \n

\n


\n" + "

\n\n", buff); + + /* Seek back to the beginning */ + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 0, archive_seek_data(a, -20111, SEEK_END)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "\n", buff); + + /* Test that SEEK_SET works correctly between data blocks */ + assertEqualIntA(a, 0, archive_seek_data(a, 0, SEEK_SET)); + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 4576, + archive_seek_data(a, 4576, SEEK_SET)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "hat was expected. \n

\n

Large tar tester

\n

The " + "large tar tester attempts to", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 20111 - (int)(sizeof(buff)-1), + archive_seek_data(a, 20111 - (int)(sizeof(buff)-1), SEEK_SET)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, ". \n

\n


\n" + "

\n\n", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 17749, + archive_seek_data(a, 17749, SEEK_SET)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "\">Large tar tester

\n

The " + "large tar tester attempts to", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 4576, + archive_seek_data(a, 4576, SEEK_SET)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "hat was expected. \n

\n

\n", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 20111 - (int)(sizeof(buff)-1), + archive_seek_data(a, 20111 - (int)(sizeof(buff)-1), SEEK_SET)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, ". \n

\n


\n" + "

\n\n", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 4576, + archive_seek_data(a, 4576, SEEK_SET)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "hat was expected. \n

\n

Large tar tester

\n

The " + "large tar tester attempts to", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 0, + archive_seek_data(a, 0, SEEK_SET)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "\n", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 20111 - (int)(sizeof(buff)-1), + archive_seek_data(a, 20111 - (int)(sizeof(buff)-1), SEEK_SET)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, ". \n

\n


\n" + "

\n\n", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 0, + archive_seek_data(a, 0, SEEK_SET)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "\n", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 17749, + archive_seek_data(a, 17749, SEEK_SET)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "\">Large tar tester

\n

The " + "large tar tester attempts to", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 4576, + archive_seek_data(a, 4576, SEEK_SET)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "hat was expected. \n

\n

\n

Large tar tester

\n

The " + "large tar tester attempts to", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 20111 - (int)(sizeof(buff)-1), + archive_seek_data(a, 2236, SEEK_CUR)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, ". \n

\n


\n" + "

\n\n", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 17749, + archive_seek_data(a, -2362, SEEK_CUR)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "\">Large tar tester

\n

The " + "large tar tester attempts to", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 4576, + archive_seek_data(a, -13236, SEEK_CUR)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "hat was expected. \n

\n

\n", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 20111 - (int)(sizeof(buff)-1), + archive_seek_data(a, 19985, SEEK_CUR)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, ". \n

\n


\n" + "

\n\n", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 4576, + archive_seek_data(a, -15535, SEEK_CUR)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "hat was expected. \n

\n

Large tar tester

\n

The " + "large tar tester attempts to", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 0, + archive_seek_data(a, -17812, SEEK_CUR)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "\n", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 20111 - (int)(sizeof(buff)-1), + archive_seek_data(a, 19985, SEEK_CUR)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, ". \n

\n


\n" + "

\n\n", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 0, + archive_seek_data(a, -20111, SEEK_CUR)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "\n", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 17749, + archive_seek_data(a, 17686, SEEK_CUR)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "\">Large tar tester

\n

The " + "large tar tester attempts to", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 4576, + archive_seek_data(a, -13236, SEEK_CUR)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "hat was expected. \n

\n

\n

Large tar tester

\n

The " + "large tar tester attempts to", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 20111 - (int)(sizeof(buff)-1), + archive_seek_data(a, -((int)sizeof(buff)-1), SEEK_END)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, ". \n

\n


\n" + "

\n\n", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 17749, + archive_seek_data(a, -2362, SEEK_END)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "\">Large tar tester

\n

The " + "large tar tester attempts to", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 4576, + archive_seek_data(a, -15535, SEEK_END)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "hat was expected. \n

\n

\n", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 20111 - (int)(sizeof(buff)-1), + archive_seek_data(a, -((int)sizeof(buff)-1), SEEK_END)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, ". \n

\n


\n" + "

\n\n", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 4576, + archive_seek_data(a, -15535, SEEK_END)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "hat was expected. \n

\n

Large tar tester

\n

The " + "large tar tester attempts to", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 0, + archive_seek_data(a, -20111, SEEK_END)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "\n", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 20111 - (int)(sizeof(buff)-1), + archive_seek_data(a, -((int)sizeof(buff)-1), SEEK_END)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, ". \n

\n


\n" + "

\n\n", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 0, + archive_seek_data(a, -20111, SEEK_END)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "\n", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 17749, + archive_seek_data(a, -2362, SEEK_END)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "\">Large tar tester

\n

The " + "large tar tester attempts to", buff); + + memset(buff, 0, sizeof(buff)); + assertEqualIntA(a, 4576, + archive_seek_data(a, -15535, SEEK_END)); + assertEqualIntA(a, (sizeof(buff)-1), + archive_read_data(a, buff, (sizeof(buff)-1))); + assertEqualStringA(a, "hat was expected. \n

\n

D``&I!9PX#@*>#,/AM$C\= +M-1T`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O3"18!4__4F7R +MH')EA?'O33NS:7&?NTW9`?JJ6LS?_X^IPYJ!Z-0=WP[O,1K_W1`?[$7WE-XB +M.2OL-@GHY[[M]81'*WAM.[/'#)RHM!IZQG]$)PR][O1P[*4$8GX.\RJC^Y!) +M@8_V`(]5%ZF?!0$W5GHLA@ED:VDN?@V[C,*97#R42-NTMYJN?T'&^9*DHBGS +MW7<>Q=B%,(O&;%V222=;"N<4?;@TEI_N7=;L5%TK7H#G%&V$0W![+EJ#/];- +MJ5_:YB?0ER`ESRD3-"*;?]I8P?4?,0/%B;.-+Q*NFZZJ,3HU)%7["@!H"059 +MC#IY""-+"[C-/08(4I>EA*`;@(<$$AKE?.DQ,&/UQ0/K.V5HX5`-"?VMV*WQ +MP$G>?H1+KU,LQ3-+`GS.=>!$H2PGKS.OOBUK-<9'X/"]'FR$S]Q4S@]C"MUX +M84HP;6F6I$9PY<5N.A]:,3AT2Z:7X!.LW"SGLX&1WZ^6:U5`^%VJ*"HJ)2Q> +MR<@`'/+UQN+QY`D;S.@[Q97M"YI^`V2LX019:A-4J-C<8;Q+2=O_VI+4_CYU +M$P$T]ASI5Z2NP1\(W4NS*/O8Q1Y6/EUN*]U($#<#']T?-7OZBK:C5*8$#\.\ +M`.?4B6B?0H.VGOEB?`0L$[CWO0RV;PQG[]YO4([OS^KUC!*VS;,:7,B@%/B- +ML,D]E.)F'Q)BX=J>QGX66+-A([-<4XT!"502XQSFA0'$.ZXX!39$L*F)I?UU_TX"L.M-<1SPH)CSO_O +MA8MW[+D&\>VQP,&#GUYN7_]:`O*R:X7CX8Z!!BVU2QBP<531RE'BN,(?(.K$ +M_/1ZJ6?\ZWC_%H$EZBK^[><0D/]$7S^D?T.:$(4@*$_V +MZ(`````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M`````````````8``````````````````*$OPP`Q?VO4_^?______________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M_______________^@$?\B__K'_I_________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M_________________________________________________________Z!' +M_(O_ZQ_Z?___________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M______________________________________^@3`'1%0R-%\6=F]S/A7.S +M5W8"T;9`[O=G2*&IP\3W2`(833>H2:8/`,[&-M/&Y!GWK4@ +M,-D75WT2#SF#E*Z5VOR5^KBL`````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M`````````````````````````````````````````````````````````>K] +M7T\[_GZN?T/^/I_GT/4O.Q?SYW0Y_K]^YZGQ].4NQT.+`?0]2.AT80FY^38M +MC-UH&0]R&?>\/3Z/1^X4ZT^!N4Z4:9*:-$CN+!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7]KVPYX0A2`H3^W1```````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M``````````````%`2_#`#%_:]3_Y________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M__________________________________________________________Z` +M1_R+_^L?^G__________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M________________________________________H$S/],17/Z59'_P````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M````````(``````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M`````````````````````````'!,`9$53(T7Q5F;[,_%5R8N9`6#;(',YDX1 +M0Q.'4\P@"&$PSB$FF#V!OD8VT]MR#/_42!R0!DOIUT[>VQ[89(N+GPD'O6]7 +M5U=W5U===[_)5Z$7E>5T:I72NUXE?QTE8``````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M`````````````````````````````````````````````!ZOS?3SO^?JY_0_ +MX^G^?0]2\[%_/G=#G^OW[GJ?'TY2['0XL!]#U(Z'1A";GY-BV,W6@9#W(9][ +MP]/H]'[A3K3X&Y3I1IDIHT2.XL$R&Y[I4@=.F[#?/^ZK1ZD#&6'[\,TB^]<> +M9\"Y-'I=B--7:1>90X9!B^ZVMRLSBZ9H3>*UL(X9WO3T;88(NBWJ;FWYMCU: +M_`%SO[.K)IJ?V@]X?H^G?YY_.^CG18D4%>CL=WJ];U#S>YFST<_/_)_+L;'E +M@R"(8&S]S/W[H'VO3[-G[XE?]16`H7C7$6F?`7.ERJ_\NC3.&L[XU<8.@9'& +ML'1%!-IUL?&T8$DS.,.S_X.*MFY1YV-X9_`(S_AWXIX>G6]DL&G_OS_IAR`Z +M?BI3QZ.HD:>+P"$%C35TX0*EI^YVGV?T]ST4:L"3( +M)CQ_;TU>HQ6M?7%4=POV:74YL0'I09'.UA@H)]/=\OOS@G5Z&CX/T-X0-588 +M>U]NIXZNWI5>"XTEJY?OC;IM''%S(ZHSSRMS1_9,TNG9F9*F04#YUGBD(U/- +M>&+/_<==8H-%>N,41#3C!FNWYH_9"0.>;IUU'VT]?W7S>YV]+1\&G+.*[KK$ +M#3UQL@WJ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EG*K9B' +MO:H9.XV:B]$??CZ,0!89*P^2[&LE7_?6GS&2Z-_CTPI'A"AT71M;M#+M#DL; +MAXT94K'FZ..IMS?4VM*[>-&8[B#UHSF.2)!7WRJLA$AJR#L;>/NJS\*9\JXP +M4:2'U)]W2EC2#[BP9%1GY)R*=CJ]/^^G"CHO5AO,[W4Z1*BZ?=]P.]V]/V3[.[H>Q='K>Z?5NF;D>W\K)STYV/HOPQOZDH@[MU;7`DDVF=L1+MBC0[>WK2J%+` +M!PK6QT>.I+5Z?'8Y5R\-6]78Y]K9`\U^8BL-RIT=/P)W=MUW`<`+7@7.J_M% +M?&GL*GT`9Y9.R/#;/H5QUC\9P1?FE6]A+@3[IP,/12G_AS*3.>)L-E>+_%NQ +M=[-L\U7NU2JXDIPXS#7AUR!)$HMA_R`%@"ZJP3S:J_C'BIG^1,[>NAY373*# +MO)5?X]BC-4U!EX?OX&6/\^(:@[L,[%.%TZ_QP]`!V<@\;EL@[&7&E +MD&AW(BSGW*'RLG2C+__M/40````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````?^TO(_HQ?VO4_^?__________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M___________^@$?\B__K'_I_____________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M_____________________________________________________Z!'_(O_ +MZQ_Z?_______________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M__________________________________^@1_R+_^L?^G______________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M________________H$?\B__K'_I_________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M_____________________________________________]"'A_UBY2R"4]W" +ML*RE:_OGG3#+\L@,>,PN7D[&4009/5G@?.;JM:BXCPHCK]VV[!W!8P +MYAI3ZHH(AMZ-VR@&&VJ'#SQX0QE)?R4N3VT'614`IIGL^R($79%MI#B-X4CY +M2<,-?%!I-[HQ#M]PYYZ?6SOAM+5LW +MF&<#GI93057E-9"T'5(%972#)X_X&MZ%%>,"#R0K[^%DUAQ_L=6WC_=;3^$B&IX@7 +M6#\FJ!/@DO,_:Q4&@$=1%+9L9'QX-`*25C]4+S1EM<'\+&/@+SZ!Z;8S%PZ; +M(==I$41B7WFK6VK3@'SRI+W`+B[X)G@4O0_W,7;CI_)#=I9$>48_/@*[!9_P6E;Z30VBMPXWC4A +MRUON:T2OHRGTI6-N1.9O4Q7!K2]V<9LB\ZOK`;O-+6./K\O;V>YL3U0;<@G] +MLA2,Q)]X^--?L#,";:,7QJQN4A;W5Z;,Q7 +M)^5/T,L?'O%IN1VBJHSYE"_F##3P-7AKO2*<+FA"Q7SX?[-K1*!"L]\N9+:. +M0,0/+O.NFOO8/98)R4T.=YUS'P05OYLC5UIA3#;.%]R3H86ZW$_$0R7#/%`, +MXN35/Z7_EIY(DISE:VN1+&?5:$\/OB?_.UY_;YHU]1>KOO^1>SO&=^G!C.=( +MELO]V=4)15`MSI")D`+9IQ_M4>U*+:4'_Z>[O6X((_Q"?<;ZJ5$<+9V6$EU40\:$&L%"BJB(8<0I[G_ +M!\`J./DJ`+W_1/'D9-O>\"'>)A+>%(A^RMG>^['D=3[P%6?=^<0A-E2XHAZ& +MM=M"/D&+NG;>+:_<_&(J-_X/$>`%(*^FHJEU.9*6OP.!?U:YX0_DSJ)4K>;9 +M<`K%R=FAF@5??,.T'?Q$9N9;%S:]GTXV!-OLL]NJ;\1'O+T/NS/BRH>?$*/D +M[P!,C_A?VNV'/"$*0%"?VZ(````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M`````````````````````````````````````````````````````H!+\,`, +M7]KU/_G_____________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M_____________________________________________________U95>P]` +/%`##I8[U```````````` +` +end diff --git a/libarchive/test/test_read_format_rar_multivolume.part0002.rar.uu b/libarchive/test/test_read_format_rar_multivolume.part0002.rar.uu new file mode 100644 index 000000000000..696ff565bdfd --- /dev/null +++ b/libarchive/test/test_read_format_rar_multivolume.part0002.rar.uu @@ -0,0 +1,1337 @@ +begin 644 - +M4F%R(1H'`!EZD``&I!9PX#%Y:4IOAM$C\= +M-1T`I($``'!P;61?;'IS?$J_A%^K +M]7@Y2NE=K\E:7/38```````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M``````````````````````````````'J_/Z>=_S]7/Z'_'T_SZ'J7G8OY\[H +M<_U^_<]3X^G*78Z'%@/H>I'0Z,(3<_)L6QFZT#(>Y#/O>'I]'H_<*=:?`W*= +M*-,E-&B1W%@F0W/=*D#ITW8;Y_W5:/4@8RP_?AFD7WKCS/@7)H]+L1IJ[2+S +M*'#(,7W6UN5F<73-";Q6MA'#.]Z>C;#!%T6]3K7X`N=_9U9--3^T'O +M#]'T[_//YWTH>;W,V>CGY_Y/Y=C8\L&01#`V?N9^_=`^U +MZ?9L_?$K_J*P%"\:XBTSX"YTN57_ET:9PUG?&KC!T#(XU@Z(H)M.MCXVC`DF +M9QAV?_!Q5LW*/.QO#/X!&?\._%/#TZWLE@T_]^?],.0'3\5*>/1U$C3Q>`0@ +ML::NG"!4M/W.T^S^GN>CFZ?6@N@2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=H9=HM&ZG3C^!8+G(M0@?))-OP^6W[._H]GJ:<*3) +M=&#H!T>UU_KR)473[ON!WNWI^R?9W=#V+H];W3ZMSF7P^*/_3?C&=BY+*B?% +M3TSG.Q]%^&-[D-JQ0HZ5P=N_D#W4E$'=NKER,[9$K4[.HLZL1A=T +M:G.8W,U*[\@+NI*PUQDSS:X$DFTSMB)=L4:';V]:50I8`.%:V.CQU):O3X[' +M*N7AJWJ['/M;('FOS$5AN5.CI^!.[MNNX#@!:\"YU7]HKXT]A4^@#/+)V1X; +M9]"N.L?C."+\TJWL)<"?=.!AZ*4_\.929SQ-ALKQ?XMV+O9MGFJ]VJ57$E.' +M&8:\.N0)(E%L/^0`L`756">;57\8\5,_R)G;UT/*:Z90=Y*K_'L49JFH,O#] +M_`RQ_GQ#4'=AG8IPNG7^.'H`.SD'CDR````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````Y?C_Q[O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Y+>0S&;\Z/X +M*[4HX-0`6&ZIZE3]YXSVHG.&W:\]&U[FTV'$NGEC$7?F2]H3)D)IR7Q1-YY( +MATC&DUB;1>N,WG:ZG[:[`2\_&1F?)Y,'/Y*YY;PLM/:Q[D3(`2X^EH7?Y*90L^+\6 +M-W0%CC5P9:B@9'R14RFLDAS*>3"KK1WZ_9K!>8HHT9^*AW6Q;S13I3>9(RNV +MF(5JCUXDX[N8_8B[IT1(LU*J]_SWPM_[?N2>]\7;J>[2.V^9N]&!>.Z/?R4F +M(*5RD7>_'-0VK+4V +MN=\DLK?Q^:N!T8LT13%V9R1]/`+Z5.>L[IQ3MW/D^;8GW*#@`;__[3HX```` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M````````````````````/_E+Q/[,7]KU/_G_________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M_____H!'_(O_ZQ_Z?___________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M______________________________________________^@1_R+_^L?^G__ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________H$?\B__K'_I_____________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M_________Z!,`=$5#(T7Q9V;W,^%<[-7=@+1MD#N]V=(H:G#Q/=(`AA--ZA) +MI@\`SL8VT\;D&?>M2!R0!DOP\\./&QXPV1=7?1(/.9RZNKNZNKKQWGQ*OX1? +MJ_5X.4KI7=_DN>RP```````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M``````````>KO]/._Y^KG]#_CZ?Y]#U+SL7\^=T.?Z_?N>I\?3E+L=#BP'T/ +M4CH=&$)N?DV+8S=:!D/EV(TU=I%YE#AD&+[K:W*S.+IFA-XK6 +MPCAG>]/1MA@BZ+>IN;?FV/5K\`7._LZLFFI_:#WA^CZ=_GG\[Z.=%B105Z.Q +MW>KUO4/-[F;/1S\_\G\NQL>6#((A@;/W,_?N@?:]/LV?OB5_U%8"A>-<1:9\ +M!E!D<[6&"@ +MGT]WR^_."=7H:/@_0WA`U5AA[7VZGCJ[>E5X+C26KE^^-NFT<<7,CJC//*W- +M']DS2Z=F9DJ9!0/G6>*0C4\UX8L_]QUUB@T5ZXQ1$-.,&:[?FC]D)`YYNG74 +M?;3U_=?-[G;TM'P:I`2I;4COU_54TGF_4=X6$526/(,I+ +M9@CRP2#]'J=7]ZU+Z\W6KIQA?7?2I\I"!+Q71:_9!2I4HR.X2B4-\W2K\DR7 +M]>JGT7Q>KRZ_9!HH(>?]V&+1UT]+;@0'L;[5_S3%"?UWAM_;!D^W]/K_X^;I +M7OE?R]S_VLGF!NCMZ6?X(VK?0N?#]U)QT_NBWX(*EF+3B8NCP)=.._C?N@N\ +MZL^#"9AKST*.D,-EEKC&[UWHO%>N/W@X=9M2M]J?'QI?=VK^UNWT)\:GK;]Y +MX:?MB?`EF)'ADC\97[/PY`BGY%>MG/+/42R_\;S\()->K5G^\1!9..A.\O+D +M)NB.S($502T+`7)*,XVA30M^,A459Q'!N;6ZY-6C.JLQ%/Y52F+3EE1>&4,&R8 +MXU':!$F;F5"OCP[G9]A#=)6ES/C@I$^=\E&"_%CF2%_ +MA[10FG@"9^E,FKBG@OD$[6.JEU.YI]$W@W(N.VC[-#'%XX%/;/1[?R_J]$^' +M*EK5"=SZ]M-^"&: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;IGV +M(.8:6^>$+ES#DK\KE=G'6IM?8LV;4$.OB5MK?5`!1L]O:0T$GNQTV3].>,)] +M:3S@E6U9KDKAPNN5+9.2::]/N:/;N:;5S,+0T)\0%=/2[&AW>KU*!SK=:J,@ +M(2N"PW%9W!KB\T>WT[3%?)+Y[V_GPF#H2O%R8)_`P9'B__T&"X-I_\KV0>A( +M"_D/:L>!3(?BJ2Y"RVW7$:-=2G^'Z",NLI#;QDHK&K(;<;_]?;H%)^9E2*BV +M.C;($ZV->]'M7_KNY`T15D#0L;; +MO+5;U9OO8W8]+R2_&EG*K9B'O:H9.XV:B]$??CZ,0!89*P^2[&LE7_?6GS&2 +MZ-_CTPI'A"AT71M;M#+M#DL;AXT94K'FZ..IMS?4VM*[>-&8[B#UHSF.2)!7 +MWRJLA$AJR#L;>/NJS\*9\JXP4:2'U)]W2EC2#[BP9%1GY)R*=CJ]/^^G"CHO +M5AO,[W4Z1*BZ?=]P. +M]V]/V3[.[H>Q='K>Z?5NF;D>W\K)STYV/HOPQO< +MAM6*%'2N#MW\@>ZDH@[MU +M;7`DDVF=L1+MBC0[>WK2J%+`!PK6QT>.I+5Z?'8Y5R\-6]78Y]K9`\U^8BL- +MRIT=/P)W=MUW`<`+7@7.J_M%?&GL*GT`9Y9.R/#;/H5QUC\9P1?FE6]A+@3[ +MIP,/12G_AS*3.>)L-E>+_%NQ=[-L\U7NU2JXDIPXS#7AUR!)$HMA_R`%@"ZJ +MP3S:J_C'BIG^1,[>NAY373*#O)5?X]BC-4U!EX?OX&6/\^(:@[L,[%.%TZ_Q +MP]`!V<@\;EL@[&7&ED&AW(BSGW*'RLG2C+__M/40````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M`````````#_V2\C^C%_:]3_Y____________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M______________________________________________________Z`1_R+ +M_^L?^G______________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________H$?\B__K'_I_____________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M_________________Z!)#_4%IS_=3_\````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M``````````````````````````$````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M`!Q,(=41#,T1`!85O9S\*.C/!I9I1:2;N[&-B[`5MIBT,?1836;F[OB11)I) +M5B)-+34%IEX-^[V`4GT(E*.1T3,T512)P;F^.L,(DS43'5SOBOB7/\(/W/[] +MSD1P3SPF!'I,@``````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M````````````````.7XW\>[_'Z.[^I\O\.YZ>>OI?P^;^'I__RVDL4?\2G5G +M_T:?&__KIY7K#H7@A(IWJ%<*'!9%"OLP-!P7AD6BR0E+P\"H8V._E_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^*T3\DM^,6X],V3PG'R=/9.AKN@`=51G"LJ]IHZH;I]I='PU1EOXY'XJU2:;1TR9/*]V/=6")LTZ[AJCE +M4ZBGEG.3/1EYXE5SSYX'GCBF[!3+_TAAEZ>8LP4IWS:;SZ&^[SU-=_[+TF6T +M2-PJFXZ!44BM*.PC9$K>/JA\&"AFW64_[#VS\LVRWK!\M_H?)L4^@ADQKKU< +MO]5#HV8?6LO6[DKKXLD'OH5H[=N7X*I^%@NG&P, +MU8J>]$Y!`Q(HE@#L_%>BZ1S;#W<\\2MGLWT)4Q[:P1FG0UF2!#HF2/[\F`MYZ]LC7S,RX4DZ +MM?5$#2QJG)[0N.?8@\P$9-)^0.OMHW,VF()]_"@]_N<*U(DS02,0@FJ4'Z.X +M6-PG8Y3]WX`WR1P9=1]AT[_LS[T=5-U8D=/ZM[-1V-^;6YB-QIHS\8;">P]` +/%``FB51Y`0`````````` +` +end diff --git a/libarchive/test/test_read_format_rar_multivolume.part0003.rar.uu b/libarchive/test/test_read_format_rar_multivolume.part0003.rar.uu new file mode 100644 index 000000000000..91b7f28c5968 --- /dev/null +++ b/libarchive/test/test_read_format_rar_multivolume.part0003.rar.uu @@ -0,0 +1,1337 @@ +begin 644 - +M4F%R(1H'`!EZ*%?VW`H%5HFLFX).4Z`.;V?GKX;T]^755<'V<*UC>;-[%*;/X0]]!P>WI\ +M4,Y&PE_B_KBY3_KR8A*=V5Y9^":+9OY.2W-%I:#J"YC[#9]&6)@HH1ZHV*<8 +MTFQK2]$+2^(@3/9+1"6W2O)L +M"JZC)MCDJG+%_;+=UEV.2(I,V[T@EI4_>>,]J)SAMVO/1M>YM-AQ+IY8Q%WYDO:$R9":>2(=(QI-8FT7K +MC-YVNI^VNP$O'+G7+LUC#W-PU`SJ5TG3!'3-Y$71F&\RIAPA-3+KMQ`A.LV> +MT\I=DWOQD9GR>3!S^2N>6\'-??Y*P]1Z)]:MSNVK3KLQO<_'-NOXQU:K;F)9 +MUV*]@/U`:IFZLT$S[=SKY$R`$N/I:%W^2F4+/B_%C=T!8XU<&6H +MH&1\D5,IK)()..[ +MF/V(NZ=$2+-2JO?\]\+?^W[DGO?%VZGNTCMOF;O1@7CNCW\E)B"E\79I]#\?;E*)GX0XO'&S/8K]`A_E[O +M:W-?VBQ++>W23#MSBS^;+K!B)WYOZGT*KTU5WI%WOQS4-JRU-KG?)+*W\?FK +M@=&+-$4Q=FH2:8/`,[&-M/&Y!GWK4@,-D75WT2#SF#E*Z5W?Y+GLL``````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````' +MJ[_3SO^?JY_0_X^G^?0]2\[%_/G=#G^OW[GJ?'TY2['0XL!]#U(Z'1A";GY- +MBV,W6@9#W(9][P]/H]'[A3K3X&Y3I1IDIHT2.XL$R&Y[I4@=.F[#?/^ZK1ZD +M#&6'[\,TB^]<>9\"Y-'I=B--7:1>90X9!B^ZVMRLSBZ9H3>*UL(X9WO3T;88 +M(NBWJ;FWYMCU:_`%SO[.K)IJ?V@]X?H^G?YY_.^CG18D4%>CL=WJ];U#S>YF +MST<_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=V&=BG"Z=?XX>@`[.0>-RV +M0=C+C2N8>KJLO2#0[D19S[E#Y63I1E__VGJ(```````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M``````````````````!_[$O(_HQ?VO4_^?__________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M___^@$?\B__K'_I_____________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M_____________________________________________Z!'_(O_ZQ_Z?___ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M__________________________^@1_R+_^L?^G______________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M________H$PAU1$,S1$`%A6]G/PHZ,\&EFE%I)N[L8V+L!6VF+0Q]%A-9N;N +M^)%$FDE6(DTM-46F7@W[O@!2?0B4HY'1,S15%(G!N;XZPPB3-1,=7.^*^)<_ +MP@_<_OW.1'!//"8$>DR````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M``!R_'_CW?X_1W?U/E_AW/3SU]+^'S?P]/_^6TEBC_B4ZL_^C3XW_]=/*]8= +M"\$)%.]0KA0X+(H5]F!H."\,BT62$I>'@5#&QW\OY3F,N#>]FNE0AU(AG"5S +M=S/X>.'21%AWLTD4CBAW/7HT6UL=Z5OST;],TO:"AD\-E.G',K-)>N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&-)K$VB]<9O.UU/VUV`EXY +MYN&H&=2NDZ8(Z9O(BZ,PWF5,.$)J9==N($)UFSVGE+LF]^,C,^3R8.?R5SRW +M@YK[_)6'J/1/K5N=VU:==F-[GXYMU_&.K5;UCW(F0`EQ]+0N_R4RA9\7XL;N@+'&K@RU%`R/DBIE-9)#F4\F%76COU +M^S6"\Q11HS\5#NMBWFBG2F\R1E=M,0K5'KQ)QW_DI,04KDYT:D./HU!O:U?RO83D,0BGM313Y@ +M:P*+>I2SWB[-/H?C[FJN](N]^.:AM66IM<[Y)96_C\U<#HQ9HBF+LSDCZ>`7TJ<]9 +MW3BG;N?)\VQ/N4'``W__VG1P```````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M````````````````````````````/_E+Q/[,7]KU/_G_________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M_____________H!'_(O_ZQ_Z?___________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M______________________________________________________^@1_R+ +M_^L?^G______________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________H$?\B__K'_I_____________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M_________________Z!,`=$5#(T7Q9V;W,^%<[-7=@+1MD#N]V=(H:G#Q/=( +M`AA--ZA)I@\`SL8VT\;D&?>M2!R0!DOP\\./&QXPV1=7?1(/.9RZNKNZNKKQ +MWGQ*OX1?J_5X.4KI7=_DN>RP```````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M``````````````````````````````````````]7?Z>=_S]7/Z'_'T_SZ'J7 +MG8OY\[H<_U^_<]3X^G*78Z'%@/H>I'0Z,(3<_)L6QFZT#(>Y#/O>'I]'H_<* +M=:?`W*=*-,E-&B1W%@F0W/=*D#ITW8;Y_W5:/4@8RP_?AFD7WKCS/@7)H]+L +M1IJ[2+S*'#(,7W6UN5F<73-";Q6MA'#.]Z>C;#!%T6]3K7X`N=_9U9 +M--3^T'O#]'T[_//YWTH>;W,V>CGY_Y/Y=C8\L&01#`V?N +M9^_=`^UZ?9L_?$K_J*P%"\:XBTSX"YTN57_ET:9PUG?&KC!T#(XU@Z(H)M.M +MCXVC`DF9QAV?_!Q5LW*/.QO#/X!&?\._%/#TZWLE@T_]^?],.0'3\5*>/1U$ +MC3Q>`0@L::NG"!4M/W.T^S^GN>CFZ?6@N@2`<1RL`U7+CRC5@29!,>/[>FKU +M&*UKZXJCN%^S2ZG-B`]*#(YVL,%!/I[OE]^<$ZO0T?!^AO"!JK##VOMU/'5V +M]*KP7&DM7+]\;=-HXXN9'5&>>5N:/[)FET[,S)4R"@?.L\4A&IYKPQ9_[CKK +M%!HKUQBB(:<8,UV_-'[(2!SS=.NH^VGK^Z^;W.WI:/@TY9Q7==8@:>N-D&]2 +M`E2VI'?K^JII/-^H[PL(JDL>0926S!'E@D'Z/4ZO[UJ7UYNM73C"^N^E3Y2$ +M"7BNBU^R"E2I1D=PE$H;YNE7Y)DOZ]5/HOB]7EU^R#100\_[L,6CKIZ6W`@/ +M8WVK_FF*$_KO#;^V#)]OZ?7_Q\W2O?*_E[G_M9/,#=';TL_P1M6^A<^'[J3C +MI_=%OP05+,6G$Q='@2Z<=_&_=!=YU9\&$S#7GH4=(8;++7&-WKO1>*]6> +MHEE_XWGX02:]6K/]XB"R<="=Y>7(3=$=F0(J@EH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M#9?/,;8#AGKJ^&>TW+OJ_PZIW\\;!NS]:K77N:KM;EE$"\F+=ZZFVJ7[FI +M4;-8BH`_0%+,TP>18F`>>C3RS]*C81!3K7S.^49,D#O"+V`:N-_`>9!QCTE#GBQR&#/FF+YT +M__RE!AL$3WT4U-0NFF.#\CT',T83SUZQ&Z[[Y=K9SLGGRDJ7G9M#?-6;F1,% +M:O*;F:56.:E]\JHWSJJ4PQP4R%D<$*]@E8_?7=W>#)SMT01Q&1$.>!2YKF6$ +M@%1](?_RA0FL>D"O'C_1UB^1'83'4>8Y95+1L3Z4'8'P6?*9Y:J"H4.;3IGS2J"[,S41\8^;Z\U2.%GI^L=FS/*!>?5:!O`7Z3OF(,#F+-D?)S@,%_Q7/EG\`;NF!1XU' +MVE$)*Y'@"8&Z_SES.X!!NU'"4$W9(%QFJCZ*D@PI9A57VGZ7X>^X=KV4WJWR +M=6Z1E>+R].WV">O68NY/8L(`R&D:F1LU>Q!&==(8>(NVEA.([@?W9^J"07@O +MY[5*;?VOMHS&^D-Z=8:),#87K9%[T.4=IAM^9:^=C;[3'9M%7]4T[=$T".LQ +MV,DG[_'^&;V8ZA'.&X+>OXJ!';3$T;[L!=29I4WU]%M+5JZ(#?WL,D2#-J=H +M/'+%EPE_9M3J1<$VTAG]PX;@N5,:NC,_K0P*"H%3NB6?P]` +/%`!8UZ=L`@`````````` +` +end diff --git a/libarchive/test/test_read_format_rar_multivolume.part0004.rar.uu b/libarchive/test/test_read_format_rar_multivolume.part0004.rar.uu new file mode 100644 index 000000000000..0bfad779e1bd --- /dev/null +++ b/libarchive/test/test_read_format_rar_multivolume.part0004.rar.uu @@ -0,0 +1,208 @@ +begin 644 - +M4F%R(1H'`!EZ5J2C]?9NI\:;KW2+#TR@_Y5=4S)O&)O_B>J0/A0T-,@"ER';1YX:$ +M>AMQ1<[:Q1,R`,93"OEGSEK=MI8?J`.7F@.OG"C!,7`D$L>"<=.F[V1><*&Z +MR!RD@+&WIGW-?>ZZ^_[)-77?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%3.#V,*W7AA2C!M:9:D1G#EQ6XZ'UHQ.'1+II?@$ZS<+.>S@9'?KY9K54#X +M7:HH*BHE+%[)R``<\O7&XO'D"1O,Z#O%E>T+FGX#9*SA!%EJ$U2HV-QAO$M) +MV__:DM3^/G43`33V'.E7I*[!'PC=2[,H^]C%'E8^76XKW4@0-P,?W1\U>_J* +MMJ-4I@0/P[P`Y]2):)]"@[:>_I(A-",```"_B&?VJ?_4NIQTX)`Q```````` +M`````P````"R@1(_%#`'`.U!``!T97-T9&ERP`BR@1(_LX$2/YN==."0-@`` +M``````````,`````MX$2/Q0P#`#M00``=&5S=&5M<'1Y9&ER@`BW@1(_N8$2 +5/RRE>PY`%`!/(RA<`P`````````` +` +end diff --git a/libarchive/test/test_read_format_tar.c b/libarchive/test/test_read_format_tar.c index 31e6ae303dae..8273e7530658 100644 --- a/libarchive/test/test_read_format_tar.c +++ b/libarchive/test/test_read_format_tar.c @@ -70,8 +70,8 @@ static void verifyEmpty(void) assertA(0 == archive_read_support_format_all(a)); assertA(0 == archive_read_open_memory(a, archiveEmpty, 512)); assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae)); - assertEqualInt(archive_compression(a), ARCHIVE_COMPRESSION_NONE); - assertEqualString(archive_compression_name(a), "none"); + assertEqualInt(archive_filter_code(a, 0), ARCHIVE_FILTER_NONE); + assertEqualString(archive_filter_name(a, 0), "none"); failure("512 zero bytes should be recognized as a tar archive."); assertEqualInt(archive_format(a), ARCHIVE_FORMAT_TAR); @@ -437,7 +437,7 @@ static void verify(unsigned char *d, size_t s, 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_compression(a), compression); + assertEqualInt(archive_filter_code(a, 0), compression); assertEqualInt(archive_format(a), format); /* Verify the only entry. */ @@ -452,21 +452,21 @@ DEFINE_TEST(test_read_format_tar) { verifyEmpty(); verify(archive1, sizeof(archive1), verify1, - ARCHIVE_COMPRESSION_NONE, ARCHIVE_FORMAT_TAR_USTAR); + ARCHIVE_FILTER_NONE, ARCHIVE_FORMAT_TAR_USTAR); verify(archive2, sizeof(archive2), verify2, - ARCHIVE_COMPRESSION_NONE, ARCHIVE_FORMAT_TAR_USTAR); + ARCHIVE_FILTER_NONE, ARCHIVE_FORMAT_TAR_USTAR); verify(archive3, sizeof(archive3), verify3, - ARCHIVE_COMPRESSION_NONE, ARCHIVE_FORMAT_TAR_USTAR); + ARCHIVE_FILTER_NONE, ARCHIVE_FORMAT_TAR_USTAR); verify(archive4, sizeof(archive4), verify4, - ARCHIVE_COMPRESSION_NONE, ARCHIVE_FORMAT_TAR_USTAR); + ARCHIVE_FILTER_NONE, ARCHIVE_FORMAT_TAR_USTAR); verify(archive5, sizeof(archive5), verify5, - ARCHIVE_COMPRESSION_NONE, ARCHIVE_FORMAT_TAR_USTAR); + ARCHIVE_FILTER_NONE, ARCHIVE_FORMAT_TAR_USTAR); verify(archive6, sizeof(archive6), verify6, - ARCHIVE_COMPRESSION_NONE, ARCHIVE_FORMAT_TAR_USTAR); + ARCHIVE_FILTER_NONE, ARCHIVE_FORMAT_TAR_USTAR); verify(archiveK, sizeof(archiveK), verifyK, - ARCHIVE_COMPRESSION_NONE, ARCHIVE_FORMAT_TAR_GNUTAR); + ARCHIVE_FILTER_NONE, ARCHIVE_FORMAT_TAR_GNUTAR); verify(archivexL, sizeof(archivexL), verifyxL, - ARCHIVE_COMPRESSION_NONE, ARCHIVE_FORMAT_TAR_PAX_INTERCHANGE); + ARCHIVE_FILTER_NONE, ARCHIVE_FORMAT_TAR_PAX_INTERCHANGE); } diff --git a/libarchive/test/test_read_format_tar_empty_filename.c b/libarchive/test/test_read_format_tar_empty_filename.c index b83226ba3d80..d7c8105a4262 100644 --- a/libarchive/test/test_read_format_tar_empty_filename.c +++ b/libarchive/test/test_read_format_tar_empty_filename.c @@ -54,7 +54,7 @@ DEFINE_TEST(test_read_format_tar_empty_filename) assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae)); /* Verify that the format detection worked. */ - assertEqualInt(archive_compression(a), ARCHIVE_COMPRESSION_NONE); + assertEqualInt(archive_filter_code(a, 0), ARCHIVE_FILTER_NONE); assertEqualInt(archive_format(a), ARCHIVE_FORMAT_TAR_USTAR); assertEqualInt(ARCHIVE_OK, archive_read_close(a)); diff --git a/libarchive/test/test_read_format_tbz.c b/libarchive/test/test_read_format_tbz.c index ec38d5a9f8f9..475c558eefc5 100644 --- a/libarchive/test/test_read_format_tbz.c +++ b/libarchive/test/test_read_format_tbz.c @@ -51,7 +51,7 @@ DEFINE_TEST(test_read_format_tbz) archive_read_open_memory(a, archive, sizeof(archive))); assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); assertEqualInt(1, archive_file_count(a)); - assertEqualInt(archive_compression(a), ARCHIVE_COMPRESSION_BZIP2); + assertEqualInt(archive_filter_code(a, 0), ARCHIVE_FILTER_BZIP2); assertEqualInt(archive_format(a), ARCHIVE_FORMAT_TAR_USTAR); assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a)); assertEqualInt(ARCHIVE_OK, archive_read_free(a)); diff --git a/libarchive/test/test_read_format_tgz.c b/libarchive/test/test_read_format_tgz.c index f8526771977f..60985a0d9f8c 100644 --- a/libarchive/test/test_read_format_tgz.c +++ b/libarchive/test/test_read_format_tgz.c @@ -51,8 +51,8 @@ DEFINE_TEST(test_read_format_tgz) archive_read_open_memory(a, archive, sizeof(archive))); assertEqualInt(ARCHIVE_OK, archive_read_next_header(a, &ae)); assertEqualInt(1, archive_file_count(a)); - assertEqualInt(archive_compression(a), - ARCHIVE_COMPRESSION_GZIP); + assertEqualInt(archive_filter_code(a, 0), + ARCHIVE_FILTER_GZIP); assertEqualInt(archive_format(a), ARCHIVE_FORMAT_TAR_USTAR); assertEqualInt(ARCHIVE_OK, archive_read_close(a)); assertEqualInt(ARCHIVE_OK,archive_read_free(a)); diff --git a/libarchive/test/test_read_format_tlz.c b/libarchive/test/test_read_format_tlz.c index 9054fa6b49dc..2a058d03971b 100644 --- a/libarchive/test/test_read_format_tlz.c +++ b/libarchive/test/test_read_format_tlz.c @@ -54,7 +54,7 @@ DEFINE_TEST(test_read_format_tlz) archive_read_open_memory(a, archive, sizeof(archive))); assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); assertEqualInt(1, archive_file_count(a)); - assertEqualInt(archive_compression(a), ARCHIVE_COMPRESSION_LZMA); + assertEqualInt(archive_filter_code(a, 0), ARCHIVE_FILTER_LZMA); assertEqualInt(archive_format(a), ARCHIVE_FORMAT_TAR_USTAR); assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a)); assertEqualInt(ARCHIVE_OK, archive_read_free(a)); diff --git a/libarchive/test/test_read_format_txz.c b/libarchive/test/test_read_format_txz.c index 6a9ba2091b7d..6672ad2f0864 100644 --- a/libarchive/test/test_read_format_txz.c +++ b/libarchive/test/test_read_format_txz.c @@ -57,7 +57,7 @@ DEFINE_TEST(test_read_format_txz) archive_read_open_memory(a, archive, sizeof(archive))); assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); assertEqualInt(1, archive_file_count(a)); - assertEqualInt(archive_compression(a), ARCHIVE_COMPRESSION_XZ); + assertEqualInt(archive_filter_code(a, 0), ARCHIVE_FILTER_XZ); assertEqualInt(archive_format(a), ARCHIVE_FORMAT_TAR_USTAR); assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a)); assertEqualInt(ARCHIVE_OK, archive_read_free(a)); diff --git a/libarchive/test/test_read_format_tz.c b/libarchive/test/test_read_format_tz.c index 3a1dcec04666..60d8a4e61514 100644 --- a/libarchive/test/test_read_format_tz.c +++ b/libarchive/test/test_read_format_tz.c @@ -46,9 +46,9 @@ DEFINE_TEST(test_read_format_tz) archive_read_open_memory(a, archive, sizeof(archive))); assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); assertEqualInt(1, archive_file_count(a)); - failure("archive_compression_name(a)=\"%s\"", - archive_compression_name(a)); - assertEqualInt(archive_compression(a), ARCHIVE_COMPRESSION_COMPRESS); + failure("archive_filter_name(a, 0)=\"%s\"", + archive_filter_name(a, 0)); + assertEqualInt(archive_filter_code(a, 0), ARCHIVE_FILTER_COMPRESS); failure("archive_format_name(a)=\"%s\"", archive_format_name(a)); assertEqualInt(archive_format(a), ARCHIVE_FORMAT_TAR_USTAR); assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a)); diff --git a/libarchive/test/test_read_format_xar.c b/libarchive/test/test_read_format_xar.c index 4dc55c21d7e0..f2de1e013945 100644 --- a/libarchive/test/test_read_format_xar.c +++ b/libarchive/test/test_read_format_xar.c @@ -661,13 +661,13 @@ static void verify(unsigned char *d, size_t s, 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_compression(a), ARCHIVE_COMPRESSION_NONE); + assertEqualInt(archive_filter_code(a, 0), ARCHIVE_FILTER_NONE); assertEqualInt(archive_format(a), ARCHIVE_FORMAT_XAR); /* Verify the only entry. */ f1(a, ae); if (f2) { assertA(0 == archive_read_next_header(a, &ae)); - assertEqualInt(archive_compression(a), ARCHIVE_COMPRESSION_NONE); + assertEqualInt(archive_filter_code(a, 0), ARCHIVE_FILTER_NONE); assertEqualInt(archive_format(a), ARCHIVE_FORMAT_XAR); /* Verify the only entry. */ f2(a, ae); diff --git a/libarchive/test/test_read_format_zip.c b/libarchive/test/test_read_format_zip.c index 8c8c92ae4545..7f3568157b5b 100644 --- a/libarchive/test/test_read_format_zip.c +++ b/libarchive/test/test_read_format_zip.c @@ -98,7 +98,7 @@ verify_basic(struct archive *a, int seek_checks) /* Verify the number of files read. */ failure("the archive file has three files"); assertEqualInt(3, archive_file_count(a)); - assertEqualIntA(a, ARCHIVE_COMPRESSION_NONE, archive_compression(a)); + assertEqualIntA(a, ARCHIVE_FILTER_NONE, archive_filter_code(a, 0)); assertEqualIntA(a, ARCHIVE_FORMAT_ZIP, archive_format(a)); assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a)); assertEqualInt(ARCHIVE_OK, archive_read_free(a)); @@ -165,7 +165,7 @@ verify_info_zip_ux(struct archive *a, int seek_checks) failure("the archive file has just one file"); assertEqualInt(1, archive_file_count(a)); - assertEqualIntA(a, ARCHIVE_COMPRESSION_NONE, archive_compression(a)); + assertEqualIntA(a, ARCHIVE_FILTER_NONE, archive_filter_code(a, 0)); assertEqualIntA(a, ARCHIVE_FORMAT_ZIP, archive_format(a)); assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a)); assertEqualInt(ARCHIVE_OK, archive_read_free(a)); diff --git a/libarchive/test/test_read_format_zip_comment_stored.c b/libarchive/test/test_read_format_zip_comment_stored.c new file mode 100644 index 000000000000..5394cebc0507 --- /dev/null +++ b/libarchive/test/test_read_format_zip_comment_stored.c @@ -0,0 +1,66 @@ +/*- + * Copyright (c) 2012 Michihiro NAKAJIMA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#include "test.h" +__FBSDID("$FreeBSD$"); + +/* + * Read a zip file that has a zip comment in the end of the central + * directory record. + */ +static void +verify(const char *refname) +{ + char *p; + size_t s; + struct archive *a; + struct archive_entry *ae; + + extract_reference_file(refname); + p = slurpfile(&s, refname); + + /* Symlinks can only be extracted with the seeking reader. */ + assert((a = archive_read_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_zip(a)); + assertEqualIntA(a, ARCHIVE_OK, read_open_memory_seek(a, p, s, 1)); + + assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); + assertEqualString("file0", archive_entry_pathname(ae)); + assertEqualInt(AE_IFREG | 0644, archive_entry_mode(ae)); + + assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); + assertEqualString("build.sh", archive_entry_pathname(ae)); + assertEqualInt(AE_IFREG | 0755, archive_entry_mode(ae)); + assertEqualInt(23, archive_entry_size(ae)); + + assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_free(a)); +} + +DEFINE_TEST(test_read_format_zip_comment_stored) +{ + verify("test_read_format_zip_comment_stored_1.zip"); + verify("test_read_format_zip_comment_stored_2.zip"); +} diff --git a/libarchive/test/test_read_format_zip_comment_stored_1.zip.uu b/libarchive/test/test_read_format_zip_comment_stored_1.zip.uu new file mode 100644 index 000000000000..9b6449ec623f --- /dev/null +++ b/libarchive/test/test_read_format_zip_comment_stored_1.zip.uu @@ -0,0 +1,12 @@ +begin 644 test_read_format_zip_comment_stored_1.zip +M4$L#!`H``````.&`9D$````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O>?*"1$J6K/5_Z-\53$I7H#:0`HU'$!)%"6; +M^+B)7)0X6HN%N91:.WV.>'IE!M=[!HQE.JWO"6\''ZYJMY^W\1K.]V]$*;8# +MJ6;1MZ8M#BSHY2."_B]02P,$"@``````O'MF0>I8ZGT7````%P````@`'`!B +M=6EL9"YS:%54"0`#8ZZ84,8XFE!U>`L``03U`0``!!0````C(2]B:6XO`Q0````(`!*<9T$V32@KLU<``&H^`0`%`!@` +M``````$```"D@0````!F:6QE,%54!0`#Q#B:4'5X"P`!!/4!```$%````%!+ +M`0(>`PH``````+Q[9D'J6.I]%P```!<````(`!@```````$```#M@?)7``!B +M=6EL9"YS:%54!0`#8ZZ84'5X"P`!!/4!```$%````%!+!08``````@`"`)D` +M``!+6```M094:&ES(&ES(&$@FEP(&-O;6UE;G0N#0IA86%A +M86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A +M86%A86%A86%A86%A86%A86%A86%A86%A86%A#0IA86%A86%A86%A86%A86%A +M86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A +M86%A86%A86%A86%A86%A#0IA86%A86%A86%A86%A86%A86%A86%A86%A86%A +M86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A +M86%A#0IA86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A +M86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A#0IA86%A86%A +M86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A +M86%A86%A86%A86%A86%A86%A86%A86%A#0IA86%A86%A86%A86%A86%A86%A +M86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A +M86%A86%A86%A86%A#0IA86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A +M86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A +M#0IA86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A +M86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A#0IA86%A86%A86%A +M86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A +M86%A86%A86%A86%A86%A86%A86%A#0IA86%A86%A86%A86%A86%A86%A86%A +M86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A +M86%A86%A86%A#0IA86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A +M86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A#0IA +M86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A +M86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A#0IA86%A86%A86%A86%A +M86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A +M86%A86%A86%A86%A86%A86%A#0IV#0IA86%A86%A86%A86%A86%A86%A86%A +M86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A +M86%A86%A86%A#0IA86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A +M86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A#0IA +M86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A +M86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A#0IA86%A86%A86%A86%A +M86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A +M86%A86%A86%A86%A86%A86%A#0IA86%A86%A86%A86%A86%A86%A86%A86%A +M86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A +M86%A86%A#0IA86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A +M86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A#0IA86%A +M86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A +M86%A86%A86%A86%A86%A86%A86%A86%A86%A#0IA86%A86%A86%A86%A86%A +M86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A86%A +/86%A86%A86%A86%A86%A +` +end diff --git a/libarchive/test/test_read_format_zip_filename.c b/libarchive/test/test_read_format_zip_filename.c index 701fe05e8300..21b6160275d5 100644 --- a/libarchive/test/test_read_format_zip_filename.c +++ b/libarchive/test/test_read_format_zip_filename.c @@ -71,7 +71,7 @@ test_read_format_zip_filename_CP932_eucJP(const char *refname) assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae)); /* Verify archive format. */ - assertEqualIntA(a, ARCHIVE_COMPRESSION_NONE, archive_compression(a)); + assertEqualIntA(a, ARCHIVE_FILTER_NONE, archive_filter_code(a, 0)); assertEqualIntA(a, ARCHIVE_FORMAT_ZIP, archive_format(a)); /* Close the archive. */ @@ -144,7 +144,7 @@ test_read_format_zip_filename_CP932_UTF8(const char *refname) assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae)); /* Verify archive format. */ - assertEqualIntA(a, ARCHIVE_COMPRESSION_NONE, archive_compression(a)); + assertEqualIntA(a, ARCHIVE_FILTER_NONE, archive_filter_code(a, 0)); assertEqualIntA(a, ARCHIVE_FORMAT_ZIP, archive_format(a)); /* Close the archive. */ @@ -211,7 +211,7 @@ test_read_format_zip_filename_UTF8_eucJP(const char *refname) assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae)); /* Verify archive format. */ - assertEqualIntA(a, ARCHIVE_COMPRESSION_NONE, archive_compression(a)); + assertEqualIntA(a, ARCHIVE_FILTER_NONE, archive_filter_code(a, 0)); assertEqualIntA(a, ARCHIVE_FORMAT_ZIP, archive_format(a)); /* Close the archive. */ @@ -299,7 +299,7 @@ test_read_format_zip_filename_UTF8_UTF8(const char *refname) assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae)); /* Verify archive format. */ - assertEqualIntA(a, ARCHIVE_COMPRESSION_NONE, archive_compression(a)); + assertEqualIntA(a, ARCHIVE_FILTER_NONE, archive_filter_code(a, 0)); assertEqualIntA(a, ARCHIVE_FORMAT_ZIP, archive_format(a)); /* Close the archive. */ @@ -350,7 +350,7 @@ test_read_format_zip_filename_CP866_KOI8R(const char *refname) assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae)); /* Verify archive format. */ - assertEqualIntA(a, ARCHIVE_COMPRESSION_NONE, archive_compression(a)); + assertEqualIntA(a, ARCHIVE_FILTER_NONE, archive_filter_code(a, 0)); assertEqualIntA(a, ARCHIVE_FORMAT_ZIP, archive_format(a)); /* Close the archive. */ @@ -401,7 +401,7 @@ test_read_format_zip_filename_CP866_UTF8(const char *refname) assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae)); /* Verify archive format. */ - assertEqualIntA(a, ARCHIVE_COMPRESSION_NONE, archive_compression(a)); + assertEqualIntA(a, ARCHIVE_FILTER_NONE, archive_filter_code(a, 0)); assertEqualIntA(a, ARCHIVE_FORMAT_ZIP, archive_format(a)); /* Close the archive. */ @@ -453,7 +453,7 @@ test_read_format_zip_filename_KOI8R_CP866(const char *refname) assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae)); /* Verify archive format. */ - assertEqualIntA(a, ARCHIVE_COMPRESSION_NONE, archive_compression(a)); + assertEqualIntA(a, ARCHIVE_FILTER_NONE, archive_filter_code(a, 0)); assertEqualIntA(a, ARCHIVE_FORMAT_ZIP, archive_format(a)); /* Close the archive. */ @@ -504,7 +504,7 @@ test_read_format_zip_filename_KOI8R_UTF8(const char *refname) assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae)); /* Verify archive format. */ - assertEqualIntA(a, ARCHIVE_COMPRESSION_NONE, archive_compression(a)); + assertEqualIntA(a, ARCHIVE_FILTER_NONE, archive_filter_code(a, 0)); assertEqualIntA(a, ARCHIVE_FORMAT_ZIP, archive_format(a)); /* Close the archive. */ @@ -561,7 +561,7 @@ test_read_format_zip_filename_UTF8_KOI8R(const char *refname) assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae)); /* Verify archive format. */ - assertEqualIntA(a, ARCHIVE_COMPRESSION_NONE, archive_compression(a)); + assertEqualIntA(a, ARCHIVE_FILTER_NONE, archive_filter_code(a, 0)); assertEqualIntA(a, ARCHIVE_FORMAT_ZIP, archive_format(a)); /* Close the archive. */ @@ -621,7 +621,7 @@ test_read_format_zip_filename_UTF8_CP866(const char *refname) assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae)); /* Verify archive format. */ - assertEqualIntA(a, ARCHIVE_COMPRESSION_NONE, archive_compression(a)); + assertEqualIntA(a, ARCHIVE_FILTER_NONE, archive_filter_code(a, 0)); assertEqualIntA(a, ARCHIVE_FORMAT_ZIP, archive_format(a)); /* Close the archive. */ @@ -669,7 +669,7 @@ test_read_format_zip_filename_UTF8_UTF8_ru(const char *refname) assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae)); /* Verify archive format. */ - assertEqualIntA(a, ARCHIVE_COMPRESSION_NONE, archive_compression(a)); + assertEqualIntA(a, ARCHIVE_FILTER_NONE, archive_filter_code(a, 0)); assertEqualIntA(a, ARCHIVE_FORMAT_ZIP, archive_format(a)); /* Close the archive. */ @@ -722,7 +722,7 @@ test_read_format_zip_filename_CP932_CP932(const char *refname) assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae)); /* Verify archive format. */ - assertEqualIntA(a, ARCHIVE_COMPRESSION_NONE, archive_compression(a)); + assertEqualIntA(a, ARCHIVE_FILTER_NONE, archive_filter_code(a, 0)); assertEqualIntA(a, ARCHIVE_FORMAT_ZIP, archive_format(a)); /* Close the archive. */ @@ -792,7 +792,7 @@ test_read_format_zip_filename_UTF8_CP932(const char *refname) assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae)); /* Verify archive format. */ - assertEqualIntA(a, ARCHIVE_COMPRESSION_NONE, archive_compression(a)); + assertEqualIntA(a, ARCHIVE_FILTER_NONE, archive_filter_code(a, 0)); assertEqualIntA(a, ARCHIVE_FORMAT_ZIP, archive_format(a)); /* Close the archive. */ @@ -844,7 +844,7 @@ test_read_format_zip_filename_CP866_CP1251(const char *refname) assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae)); /* Verify archive format. */ - assertEqualIntA(a, ARCHIVE_COMPRESSION_NONE, archive_compression(a)); + assertEqualIntA(a, ARCHIVE_FILTER_NONE, archive_filter_code(a, 0)); assertEqualIntA(a, ARCHIVE_FORMAT_ZIP, archive_format(a)); /* Close the archive. */ @@ -896,7 +896,7 @@ test_read_format_zip_filename_CP866_CP1251_win(const char *refname) assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae)); /* Verify archive format. */ - assertEqualIntA(a, ARCHIVE_COMPRESSION_NONE, archive_compression(a)); + assertEqualIntA(a, ARCHIVE_FILTER_NONE, archive_filter_code(a, 0)); assertEqualIntA(a, ARCHIVE_FORMAT_ZIP, archive_format(a)); /* Close the archive. */ @@ -947,7 +947,7 @@ test_read_format_zip_filename_KOI8R_CP1251(const char *refname) assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae)); /* Verify archive format. */ - assertEqualIntA(a, ARCHIVE_COMPRESSION_NONE, archive_compression(a)); + assertEqualIntA(a, ARCHIVE_FILTER_NONE, archive_filter_code(a, 0)); assertEqualIntA(a, ARCHIVE_FORMAT_ZIP, archive_format(a)); /* Close the archive. */ @@ -1006,7 +1006,7 @@ test_read_format_zip_filename_UTF8_CP1251(const char *refname) assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae)); /* Verify archive format. */ - assertEqualIntA(a, ARCHIVE_COMPRESSION_NONE, archive_compression(a)); + assertEqualIntA(a, ARCHIVE_FILTER_NONE, archive_filter_code(a, 0)); assertEqualIntA(a, ARCHIVE_FORMAT_ZIP, archive_format(a)); /* Close the archive. */ @@ -1071,7 +1071,7 @@ test_read_format_zip_filename_KOI8R_UTF8_2(const char *refname) assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae)); /* Verify archive format. */ - assertEqualIntA(a, ARCHIVE_COMPRESSION_NONE, archive_compression(a)); + assertEqualIntA(a, ARCHIVE_FILTER_NONE, archive_filter_code(a, 0)); assertEqualIntA(a, ARCHIVE_FORMAT_ZIP, archive_format(a)); /* Close the archive. */ @@ -1112,7 +1112,7 @@ test_read_format_zip_filename_KOI8R_UTF8_2(const char *refname) assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae)); /* Verify archive format. */ - assertEqualIntA(a, ARCHIVE_COMPRESSION_NONE, archive_compression(a)); + assertEqualIntA(a, ARCHIVE_FILTER_NONE, archive_filter_code(a, 0)); assertEqualIntA(a, ARCHIVE_FORMAT_ZIP, archive_format(a)); /* Close the archive. */ diff --git a/libarchive/test/test_read_format_zip_mac_metadata.c b/libarchive/test/test_read_format_zip_mac_metadata.c new file mode 100644 index 000000000000..dd48fd433a59 --- /dev/null +++ b/libarchive/test/test_read_format_zip_mac_metadata.c @@ -0,0 +1,118 @@ +/*- + * Copyright (c) 2012 Michihiro NAKAJIMA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#include "test.h" +__FBSDID("$FreeBSD$"); + +#ifdef HAVE_LIBZ +static const int libz_enabled = 1; +#else +static const int libz_enabled = 0; +#endif + +/* + * Read a zip file that has a zip comment in the end of the central + * directory record. + */ +DEFINE_TEST(test_read_format_zip_mac_metadata) +{ + const char *refname = "test_read_format_zip_mac_metadata.zip"; + char *p; + size_t s; + struct archive *a; + struct archive_entry *ae; + const unsigned char appledouble[] = { + 0x00, 0x05, 0x16, 0x07, 0x00, 0x02, 0x00, 0x00, + 0x4d, 0x61, 0x63, 0x20, 0x4f, 0x53, 0x20, 0x58, + 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, + 0x00, 0x02, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, + 0x00, 0x32, 0x00, 0x00, 0x00, 0xed, 0x00, 0x00, + 0x00, 0x02, 0x00, 0x00, 0x01, 0x1f, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x41, 0x54, 0x54, 0x52, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x1f, + 0x00, 0x00, 0x00, 0x98, 0x00, 0x00, 0x00, 0x87, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, + 0x00, 0x00, 0x00, 0x98, 0x00, 0x00, 0x00, 0x87, + 0x00, 0x00, 0x13, 0x63, 0x6f, 0x6d, 0x2e, 0x61, + 0x70, 0x70, 0x6c, 0x65, 0x2e, 0x61, 0x63, 0x6c, + 0x2e, 0x74, 0x65, 0x78, 0x74, 0x00, 0x00, 0x00, + 0x21, 0x23, 0x61, 0x63, 0x6c, 0x20, 0x31, 0x0a, + 0x75, 0x73, 0x65, 0x72, 0x3a, 0x46, 0x46, 0x46, + 0x46, 0x45, 0x45, 0x45, 0x45, 0x2d, 0x44, 0x44, + 0x44, 0x44, 0x2d, 0x43, 0x43, 0x43, 0x43, 0x2d, + 0x42, 0x42, 0x42, 0x42, 0x2d, 0x41, 0x41, 0x41, + 0x41, 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x43, + 0x39, 0x3a, 0x47, 0x75, 0x65, 0x73, 0x74, 0x3a, + 0x32, 0x30, 0x31, 0x3a, 0x64, 0x65, 0x6e, 0x79, + 0x3a, 0x72, 0x65, 0x61, 0x64, 0x0a, 0x67, 0x72, + 0x6f, 0x75, 0x70, 0x3a, 0x41, 0x42, 0x43, 0x44, + 0x45, 0x46, 0x41, 0x42, 0x2d, 0x43, 0x44, 0x45, + 0x46, 0x2d, 0x41, 0x42, 0x43, 0x44, 0x2d, 0x45, + 0x46, 0x41, 0x42, 0x2d, 0x43, 0x44, 0x45, 0x46, + 0x30, 0x30, 0x30, 0x30, 0x30, 0x30, 0x35, 0x30, + 0x3a, 0x61, 0x64, 0x6d, 0x69, 0x6e, 0x3a, 0x38, + 0x30, 0x3a, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x3a, + 0x77, 0x72, 0x69, 0x74, 0x65, 0x0a, 0x00 + }; + + extract_reference_file(refname); + p = slurpfile(&s, refname); + + /* Mac metadata can only be extracted with the seeking reader. */ + assert((a = archive_read_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_zip(a)); + assertEqualIntA(a, ARCHIVE_OK, read_open_memory_seek(a, p, s, 1)); + + if (libz_enabled) { + assertEqualIntA(a, ARCHIVE_OK, + archive_read_next_header(a, &ae)); + } else { + assertEqualIntA(a, ARCHIVE_WARN, + archive_read_next_header(a, &ae)); + assertEqualString(archive_error_string(a), + "Unsupported ZIP compression method (deflation)"); + assert(archive_errno(a) != 0); + } + assertEqualString("file3", archive_entry_pathname(ae)); + assertEqualInt(AE_IFREG | 0644, archive_entry_mode(ae)); + failure("Mac metadata should be set"); + if (libz_enabled) { + const void *metadata; + if (assert((metadata = archive_entry_mac_metadata(ae, &s)) + != NULL)) { + assertEqualMem(metadata, appledouble, + sizeof(appledouble)); + } + } else { + assert(archive_entry_mac_metadata(ae, &s) == NULL); + } + assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_free(a)); +} diff --git a/libarchive/test/test_read_format_zip_mac_metadata.zip.uu b/libarchive/test/test_read_format_zip_mac_metadata.zip.uu new file mode 100644 index 000000000000..d54c24d98baf --- /dev/null +++ b/libarchive/test/test_read_format_zip_mac_metadata.zip.uu @@ -0,0 +1,17 @@ +begin 644 test_read_format_zip_mac_metadata.zip +M4$L#!!0`"``(`"UH8T$````````````````%`!``9FEL93-56`P`U?264!:7 +ME%#U`10`2TQ*3DE-2^<"`%!+!P@D*E,-"@````@```!02P,$"@``````5VAF +M00````````````````D`$`!?7TU!0T]36"]56`P`YHN84.:+F%#U`10`4$L# +M!!0`"``(`"UH8T$````````````````0`!``7U]-04-/4U@O+E]F:6QE,U58 +M#`#5])90%I>44/4!%`!C8!5C9V!B8/!-3%;P#U:(4(`"D!@#)Q`;`?%;(`;R +M&>49B`*.(2%!$!98QPP@;D=3PH@0%T[.S]5++"C(2=5+3,[1*TFM*`%**"H# +M.0J&7*7%J456;D#@"@2Z+D"@ZPP$NDY`H.L(!`9@X&QIY5Z:6EQB961@:)62 +MFE=I592:F,*57I1?6F#EZ.3LXNKFZ*0+HG1!/%TX%Z+=U,`J,24W,\_*`LC( +MR^LP```!\!``!02P$"%0,4``@`"``M:&-! +M)"I3#0H````(````!0`,``````````!`I($`````9FEL93-56`@`U?264!:7 +ME%!02P$"%0,*``````!7:&9!````````````````"0`,``````````!`_4%- +M````7U]-04-/4U@O55@(`.:+F%#FBYA04$L!`A4#%``(``@`+6AC0?@\%[ZS +M````'P$``!``#```````````0*2!A````%]?34%#3U-8+RY?9FEL93-56`@` +>U?264!:7E%!02P4&``````,``P#,````A0$````` +` +end diff --git a/libarchive/test/test_read_format_zip_sfx.c b/libarchive/test/test_read_format_zip_sfx.c new file mode 100644 index 000000000000..50e5fa723c29 --- /dev/null +++ b/libarchive/test/test_read_format_zip_sfx.c @@ -0,0 +1,59 @@ +/*- + * Copyright (c) 2012 Michihiro NAKAJIMA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#include "test.h" +__FBSDID("$FreeBSD$"); + +/* + * Read a zip file that is a SFX. + */ +DEFINE_TEST(test_read_format_zip_sfx) +{ + const char *refname = "test_read_format_zip_sfx"; + char *p; + size_t s; + struct archive *a; + struct archive_entry *ae; + + extract_reference_file(refname); + p = slurpfile(&s, refname); + + /* Symlinks can only be extracted with the seeking reader. */ + assert((a = archive_read_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_zip(a)); + assertEqualIntA(a, ARCHIVE_OK, read_open_memory_seek(a, p, s, 1)); + + assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); + assertEqualString("file0", archive_entry_pathname(ae)); + assertEqualInt(AE_IFREG | 0644, archive_entry_mode(ae)); + + assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); + assertEqualString("build.sh", archive_entry_pathname(ae)); + assertEqualInt(AE_IFREG | 0755, archive_entry_mode(ae)); + assertEqualInt(23, archive_entry_size(ae)); + + assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_free(a)); +} diff --git a/libarchive/test/test_read_format_zip_sfx.uu b/libarchive/test/test_read_format_zip_sfx.uu new file mode 100644 index 000000000000..aab730ba85db --- /dev/null +++ b/libarchive/test/test_read_format_zip_sfx.uu @@ -0,0 +1,34 @@ +begin 644 test_read_format_zip_sfx +M!5@J$E]]1]?.)[Z/+RR:J';4YIJ7H0[7:BO"S8^VFB`_M_2)627VRG7%.)ZR +M->RL72GY3(0UJMJ0;.F=<-36\SK.=/A%FK!K4Z0URPF<&M#E<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KIA0=7@+``$$]0$```04````4$L%!@`````"``(`F0```)@````D +E`%1H:7,@:7,@82!S86UP;&4@9FEL92!F;W(@:7-S=64@,C4W+@`` +` +end diff --git a/libarchive/test/test_read_large_splitted_rar_aa.uu b/libarchive/test/test_read_large_splitted_rar_aa.uu new file mode 100644 index 000000000000..a6c3b3cffebf --- /dev/null +++ b/libarchive/test/test_read_large_splitted_rar_aa.uu @@ -0,0 +1,892 @@ +begin 644 - +M4F%R(1H'`,^0%0P +M/&L'[WB2!U7<*?4L4NOOUTT.SR!`I\R[_P1F=02HR>'QX8'^2HV&5JV`]-KQ +MI+1)$DI5RKBB(D_C'\_+]51?<,M@,F]PE+VS +M]2/>+LTL^)KUF2N[8ZO?.RN>$#S?0H]0YSYGBDJB]E^_&DDB:%;!B8J8GW*J +MO9*/%:M1X$FFP^&O`[RU:XM%UY]0#EF9\,:3">!<)ETSY)F5GC:.-&AY:MMY +M?U9WS&?(9@3"\/]9=PU??)T!9PR=N(\&#=,WX8AKH;:/SKE13]KR`RMXSC6_ +M^IXE6RJ:_VX+-U:3J`1R_HK<>S2[KP=XHKKNY&^5,X`_EJ,Q%SP[P=:;DP!V +M0!/%2"66A!1(2(+-#&]E)ZM83H-(N9*;>3I['T&=*&8?"1L$%$;3I6]YGM7D +MA@WYC]Y1YC(KRNJ.,K9ISE/HX0L[5W!@N8&,/@KJA3[(SRV0;9*#>[IC8&(O\6E?P5CO+^4Q.EB +M@5_+,2,=*PW'V6\5:'`GU$42X'+ML^24T+V!U"[7`*WU5Q]A$I;.G*JG3N>M +M(\%C1N33':_HHW*]Y@\[G\VP2BSYTEQL1Z8P$U-TE)M#',SS=QF:;,%!X>FAS*\$LTE:N;-E6JH>UCSZ1^*'21$RTA7<71W\*'6M7UH/$P-#82?]^*:&%&S?D\9SP=W8 +M=U"D#*O8TJ'PI?QPA5Y[1`3&LES]V4]=\A6GM]#HQ+($<>?RFPOA_\/#^3H) +M9M3;PAY%/JU7%9Y??]05JHLVQ:NH:N_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=;"N<4?;@TEI_N7=;L5%TK7H#G%&V$0W![+EJ#/];- +MJ5_:YB?0ER`ESRD3-"*;?]I8P?4?,0/%B;.-+Q*NFZZJ,3HU)%7["@!H"059 +MC#IY""-+"[C-/08(4I>EA*`;@(<$$AKE?.DQ,&/UQ0/K.V5HX5`-"?VMV*WQ +MP$G>?H1+KU,LQ3-+`GS.=>!$H2PGKS.OOBUK-<9'X/"]'FR$S]Q4S@]C"MUX +M84HP;6F6I$9PY<5N.A]:,3AT2Z:7X!.LW"SGLX&1WZ^6:U5`^%VJ*"HJ)2Q> +MR<@`'/+UQN+QY`D;S.@[Q97M"YI^`V2LX019:A-4J-C<8;Q+2=O_VI+4_CYU +M$P$T]ASI5Z2NP1\(W4NS*/O8Q1Y6/EUN*]U($#<#']T?-7OZBK:C5*8$#\.\ +M`.?4B6B?0H.VGOEB?`0L$[CWO0RV;PQG[]YO4([OS^KUC!*VS;,:7,B@%/B- +ML,D]E.)F'Q)BX=J>QGX66+-A([-<4XT!"502XQSFA0'$.ZXX!39$L*F)I?UU_TX"L.M-<1SPH)CSO_O +MA8MW[+D&\>VQP,&#GUYN7_]:`O*R:X7CX8Z!!BVU2QBP<531RE'BN,(?(.K$ +M_/1ZJ6?\ZWC_%H$EZBK^[><0D/]$7S^D?T.:$(4@*$_V +MZ(`````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M`````````````8``````````````````*$OPP`Q?VO4_^?______________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M_______________^@$?\B__K'_I_________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M_________________________________________________________Z!' +M_(O_ZQ_Z?___________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M______________________________________^@3`'1%0R-%\6=F]S/A7.S +M5W8"T;9`[O=G2*&IP\3W2`(833>H2:8/`,[&-M/&Y!GWK4@ +M,-D75WT2#SF#E*Z5VOR5^KBL`````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M`````````````````````````````````````````````````````````>K] +M7T\[_GZN?T/^/I_GT/4O.Q?SYW0Y_K]^YZGQ].4NQT.+`?0]2.AT80FY^38M +MC-UH&0]R&?>\/3Z/1^X4ZT^!N4Z4:9*:-$CN+!,AN>Z5('3INPWS_NJT>I`Q +MEA^_#-(OO7'F?`N31Z78C35VD7F4.&08ONMK'Z/IW^>?SOHYT6)%!7H['=ZO6]0\WN9L] +M'/S_R?R[&QY8,@B&!L_=C>&?P",_X=^*>'IUO9+ +M!I_[\_Z8<@.GXJ4\>CJ)&GB\`A!8TU=.$"I:?N=I]G]/<]'-T^M!=`D`XCE8 +M!JN7'E&K`DR"8\?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ALS;75>P>"E5\-;N4E/M +M0A%P9LKU*,B)FLB7(LC%+GP-Z^OAE/&,`'46Y6\TGV,SB'PST\;25YCUTI@) +M"8'KR_&OC2FE?A7ZGV6/IWY1];IKK:><9*`-O+^*CC4T2?\3C +M_M'7BFGLD;Y)8-WV+?F70"PKR_K2?DS;!F2K#Q)U^)[$X!XV5*%UYZ=7A]'N +MJRJW(KWG&Y:)'M=LW^%%XYMC7J/SQ2BQFE=9%4H:KU#/U&Z)XW&/F1DY^*&? +MKF)^:[Y;RQ8402:`0.G!SK912WR+3;6S1-%I+>%40ZT<0YQAHQO;* +M\@_]:\Z&\O@X6JRH!7L'0]=%F\#4G+=W3O;]?@ST(*H"J*!>=9,1I"NM^<5$ +M,?M3##_F0@61;>:`LF\VDL')];&<]T56:4]2!OY.9(`/*6V>1@]'8#"*GU77 +M;#NK:^GSZ[&-$_(WYR<(5I51ZVR&>0E=MYM$UWTOV5=5'&,CR +MBKOW;AR"NES,-/?Z>M505*><)/.8)UL,A0CY:\.+IC`GC%8_TJ5_HG*`HW#K&]2WB/L(8";`73ZE8Y;1D(J@(T,=])2H!$P7 +M0R:0/B15*(]<*@J1D[43+>O$MZ$A&')!G0?"`I/RWJEW*L#<#D!I$\V:\",/ +M[J!XYT&0)B+9L6#"$>!0#V` +M*;I#]B(J/TC[I-H4P\V$J3&_7VBB^Z,]'9,8PUO5QM2^Y5?P +M1\:_.IO%T4N"#U2-1H8Z]$6"3B%^+CQZ7CM4]>!+A*F1!\CK@_PCBB3,5V$W +MFK@M_W+2%)';;*J7&Y01`W``3(_X7]KVPYX0A2`H3^W1```````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M``````````````%`2_#`#%_:]3_Y________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M__________________________________________________________Z` +M1_R+_^L?^G__________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M________________________________________H$S/],17/Z59'_P````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M````````(``````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +H```````````````````````````````````````````````````````` +` +end diff --git a/libarchive/test/test_read_large_splitted_rar_ab.uu b/libarchive/test/test_read_large_splitted_rar_ab.uu new file mode 100644 index 000000000000..43869789a075 --- /dev/null +++ b/libarchive/test/test_read_large_splitted_rar_ab.uu @@ -0,0 +1,892 @@ +begin 644 - +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M````````````````````````````````<$P!D15,C1?%69OLS\57)BYD!8-L +M@];U=75W=75UUWO\E7H1>5Y71JE=*[7B5_'25@```````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M````````````````````````````````````````````````````'J_-]/._ +MY^KG]#_CZ?Y]#U+SL7\^=T.?Z_?N>I\?3E+L=#BP'T/4CH=&$)N?DV+8S=:! +MD/EV(TU=I%YE#AD&+[K:W*S.+IFA-XK6PCAG>]/1MA@BZ+>IN +M;?FV/5K\`7._LZLFFI_:#WA^CZ=_GG\[Z.=%B105Z.QW>KUO4/-[F;/1S\_\ +MG\NQL>6#((A@;/W,_?N@?:]/LV?OB5_U%8"A>-<1:9\!E!D<[6&"@GT]WR^_."=7H:/@_0 +MWA`U5AA[7VZGCJ[>E5X+C26KE^^-NFT<<7,CJC//*W-']DS2Z=F9DJ9!0/G6 +M>*0C4\UX8L_]QUUB@T5ZXQ1$-.,&:[?FC]D)`YYNG74?;3U_=?-[G;TM'P:< +MLXKNNL0-/7&R#>I`2I;4COU_54TGF_4=X6$526/(,I+9@CRP2#]'J=7]ZU+Z +M\W6KIQA?7?2I\I"!+Q71:_9!2I4HR.X2B4-\W2K\DR7]>JGT7Q>KRZ_9!HH( +M>?]V&+1UT]+;@0'L;[5_S3%"?UWAM_;!D^W]/K_X^;I7OE?R]S_VLGF!NCMZ +M6?X(VK?0N?#]U)QT_NBWX(*EF+3B8NCP)=.._C?N@N\ZL^#"9AKST*.D,-EE +MKC&[UWHO%>N/W@X=9M2M]J?'QI?=VK^UNWT)\:GK;]YX:?MB?`EF)'ADC\97 +M[/PY`BGY%>MG/+/42R_\;S\()->K5G^\1!9..A.\O+D)NB.S($502T+`7)*, +MXVA30M^,A459Q'!N;6ZY-6C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Y&<=MR7LHXJF@O9D8*`K!GFU#CA?Y\8^`&'KKKR?5&3J,8SZLF. +MW:9TU>%-C&(J2X&4V/Y-51[N];@@C_$)]QOJI41PMG982751#QH0:P4**J(A +MAQ"GN?\'P"HX^2H`O?]$\>1DV][P(=XF$MX4B'[*V=[[L>1U/O`59]WYQ"$V +M5+BB'H:UVT(^08NZ=MXMK]S\8BHW_@\1X`4@KZ:BJ74YDI:_`X%_5KGA#^3. +MHE2MYMEP"L7)V:&:!5]\P[0=_$1FYEL7-KV?3C8$V^RSVZIOQ$>\O0^[,^+* +MAY\0H^3O`$R/^%_:[8<\(0I`4)_;H@`````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````" +M@$OPP`Q?VO4_^?______________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M___________________________________________^@$?\B__K'_I_____ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M_________________________Z!'_(O_ZQ_Z?_______________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M______^@3`'1%0R-%\6=F]S/A7.S5W8"T;9`[O=G2*&IP\3W2`(833>H2:8/ +M`,[&-M/&Y!GWK4@,-D75WT2#SF#E*Z5VOR5I<]-@````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M`````````````````````````````>K\_IYW_/U<_H?\?3_/H>I>=B_GSNAS +M_7[]SU/CZGT>C]PIUI\#N/,^!\/ +MT?3O\\_G?1SHL2*"O1V.[U>MZAYOR6#3_WY_TPY`=/Q4IX]'42-/%X!""Q +MIJZ<(%2T_<[3[/Z>YZ.;I]:"Z!(!Q'*P#5O[KYO<[>EH^#3EG%=UUB!IZXV0;U("5+:D=^O +MZJFD\WZCO"PBJ2QY!E);,$>6"0?H]3J_O6I?7FZU=.,+Z[Z5/E(0)>*Z+7[( +M*5*E&1W"42AOFZ5?DF2_KU4^B^+U>77[(-%!#S_NPQ:.NGI;<"`]C?:O^:8H +M3^N\-O[8,GV_I]?_'S=*]\K^7N?^UD\P-T=O2S_!&U;Z%SX?NI..G]T6_!!4 +MLQ:<3%T>!+IQW\;]T%WG5GP83,->>A1TAALLM<8W>N]%XKUQ^\'#K-J5OM3X +M^-+[NU?VMV^A/C4];?O/#3]L3X$LQ(\,D?C*_9^'($4_(KULYY9ZB67_C>?A +M!)KU:L_WB(+)QT)WEY/MR*NCJ1F2;O> +MVH,6B5SQ:286\>KD<(SP5\>'<[/L(;I*T +MN9\<%(GSODHP7XL_407$P5-YIQ7[8F681SO*L)%M%;)JM\QRPTI*1$ +M5(6^,L=_U=5S9'$"9N;%YV3NOV."UA%X/QR+L?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````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M````````#_V`2\C^C%_:]3_Y____________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M______________________________________________________Z`1_R+ +M_^L?^G______________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________H$?\B__K'_I_____________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M_________________Z!'_(O_ZQ_Z?_______________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +H_____________________________________________________P`` +` +end diff --git a/libarchive/test/test_read_large_splitted_rar_ac.uu b/libarchive/test/test_read_large_splitted_rar_ac.uu new file mode 100644 index 000000000000..0ceeae1b7fc4 --- /dev/null +++ b/libarchive/test/test_read_large_splitted_rar_ac.uu @@ -0,0 +1,892 @@ +begin 644 - +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M_____Z!,(=41#,T1`!85O9S\*.C/!I9I1:2;N[&-B[`5MIBT,?1836;F[OB1 +M1)I)5B)-+35%IEX-^[X`4GT(E*.1T3,T512)P;F^.L,(DS43'5SOBOB7/\(/ +MW/[]SD1P3SPF!'I,@``````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M````````````````````````````````````````.7X_\>[_'Z.[^I\O\.YZ +M>>OI?P^;^'I__RVDL4?\2G5G_T:?&__KIY7K#H7@A(IWJ%<*'!9%"OLP-!P7 +MAD6BR0E+P\"H8V._E_*C?IFE[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2JO?\]\+?^W[DGO?%VZGNTCMOF;O1@7CN +MCW\E)B"E\79I]#\?;E*)GX +M0XO'&S/8K]`A_E[O:W-?VBQ++>W23#MSBS^;+K!B)WYOZGT*KTU5WI%WOQS4 +M-JRU-KG?)+*W\?FK@=&+-$4Q=FH2:8/`,[&-M/&Y!GWK4@,-D75WT2#SF#E*Z5W?Y+GLL``````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````'J[_3SO^?JY_0_X^G^?0]2\[%_/G=#G^OW[GJ?'TY2['0 +MXL!]#U(Z'1A";GY-BV,W6@9#W(9][P]/H]'[A3K3X&Y3I1IDIHT2.XL$R&Y[ +MI4@=.F[#?/^ZK1ZD#&6'[\,TB^]<>9\"Y-'I=B--7:1>90X9!B^ZVMRLSBZ9 +MH3>*UL(X9WO3T;88(NBWJ;FWYMCU:_`%SO[.K)IJ?V@]X?H^G?YY_.^CG18D +M4%>CL=WJ];U#S>YFST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M_'+L=;(2M<=7=782%C['Y_1.#+ORC]FP+NCG-W]^P9%)B;@DGI@+>>O;(U\S +M,N%).K7U1`TL:IR>T+CGV(/,!&32?D#K[:-S-IB"??PH/?[G"M2),T$C$()J +ME!^CN%C<)V.4_=^`-\D<&74?8=._[,^]'53=6)'3^K>S4=C?FUN8C<::,_$; +MZT90_J/CQ4H\]2OQ2FS^$/?0<``` +` +end diff --git a/libarchive/test/test_read_large_splitted_rar_ad.uu b/libarchive/test/test_read_large_splitted_rar_ad.uu new file mode 100644 index 000000000000..f736f13c7cb1 --- /dev/null +++ b/libarchive/test/test_read_large_splitted_rar_ad.uu @@ -0,0 +1,892 @@ +begin 644 - +M>WI\4,Y&PE_B_KBY3_KR8A*=V5Y9^":+9OY.2W-%I:#J"YC[#9]&6)@HH1ZH +MV*<8TFQK2]$+2^(@3/9+1"6W +M2O)L"JZC)MCDJG+%_;+=UEV.2(I,V[T@EI4_>>,]J)SAMVO/1M>YM-AQ+IY8Q%WYDO:$R9":>2(=(QI-8 +MFT7KC-YVNI^VNP$O'+G7+LUC#W-PU`SJ5TG3!'3-Y$71F&\RIAPA-3+KMQ`A +M.LV>T\I=DWOQD9GR>3!S^2N>6\'-??Y*P]1Z)]:MSNVK3KLQO<_'-NOXQU:K +M;F)9UV*]@/U`:IFZLT$S[=SKY$R`$N/I:%W^2F4+/B_%C=T!8XU +M<&6HH&1\D5,IK)( +M)..[F/V(NZ=$2+-2JO?\]\+?^W[DGO?%VZGNTCMOF;O1@7CNCW\E)B"E\79I]#\?;E*)GX0XO'&S/8K]`A +M_E[O:W-?VBQ++>W23#MSBS^;+K!B)WYOZGT*KTU5WI%WOQS4-JRU-KG?)+*W +M\?FK@=&+-$4Q=FH2:8/`,[&-M/&Y!GWK4@,-D75WT2#SF#E*Z5W?Y+GLL``````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```'J[_3SO^?JY_0_X^G^?0]2\[%_/G=#G^OW[GJ?'TY2['0XL!]#U(Z'1A" +M;GY-BV,W6@9#W(9][P]/H]'[A3K3X&Y3I1IDIHT2.XL$R&Y[I4@=.F[#?/^Z +MK1ZD#&6'[\,TB^]<>9\"Y-'I=B--7:1>90X9!B^ZVMRLSBZ9H3>*UL(X9WO3 +MT;88(NBWJ;FWYMCU:_`%SO[.K)IJ?V@]X?H^G?YY_.^CG18D4%>CL=WJ];U# +MS>YFST<_/_)_+L;'E@R"(8&S]S/W[H'VO3[-G[XE?]16`H7C7$6F?`7.ERJ_ +M\NC3.&L[XU<8.@9'&L'1%!-IUL?&T8$DS.,.S_X.*MFY1YV-X9_`(S_AWXIX +M>G6]DL&G_OS_IAR`Z?BI3QZ.HD:>+P"$%C35TX0*EI^YVGV?T]ST4:L"3()CQ_;TU>HQ6M?7%4=POV:74YL0'I09'.UA@H)]/=\OO +MS@G5Z&CX/T-X0-588>U]NIXZNWI5>"XTEJY?OC;IM''%S(ZHSSRMS1_9,TNG +M9F9*F04#YUGBD(U/->&+/_<==8H-%>N,41#3C!FNWYH_9"0.>;IUU'VT]?W7 +MS>YV]+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F%H:$^("NGI=C0[O5ZE`YUNM5&0$)7!8;B +ML[@UQ>:/;Z=IBODE\][?SX3!T)7BY,$_@8,CQ?_Z#!<&T_^5[(/0D!?R'M6/ +M`ID/Q5)CVKN7FWC*8*6G@T/?UW<@:(JR!H6-MWEJMZLW +MWL;L>EY)?C2SE5LQ#WM4,G<;-1>B/OQ]&(`L,E8?)=C62K_OK3YC)=&_QZ84 +MCPA0Z+HVMVAEVAR6-P\:,J5CS=''4VYOJ;6E=O&C,=Q!ZT9S')$@K[Y560B0 +MU9!V-O'W59^%,^5<8*-)#ZD^[I2QI!]Q8,BHS\DY%.QU>G_?3A1T7JPWF=[J +M=./X%@NIIPI,ET8.@'1[77^O(E1=/N^X'>[>G[)] +MG=T/8NCUO=/JW.9?#XH_]-^,9V+DLJ)\5/3-R/;^5DYZ<['T7X8WN0VK%"CI +M7!V[^0/=240=VZN7(SMD2M3LZBSJQ&%W1J&K>KL<^UL@>:_,16&Y4Z.GX$ +M[NVZ[@.`%KP+G5?VBOC3V%3Z`,\LG9'AMGT*XZQ^,X(OS2K>PEP)]TX&'HI3 +M_PYE)G/$V&RO%_BW8N]FV>:KW:I5<24X<9AKPZY`DB46P_Y`"P!=58)YM5?Q +MCQ4S_(F=O70\IKIE!WDJO\>Q1FJ:@R\/W\#+'^?$-0=V&=BG"Z=?XX>@`[.0 +M>-RV0=C+C2N8>KJLO2#0[D19S[E#Y63I1E__VGJ(```````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M``````````````````````!_[$O(_HQ?VO4_^?______________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M_______^@$?\B__K'_I_________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M_________________________________________________Z!'_(O_ZQ_Z +M?___________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M______________________________^@1_R+_^L?^G__________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________H$PAU1$,S1$`%A6]G/PHZ,\&EFE%I)N[L8V+L!6VF+0Q]%A- +M9N;N^)%$FDE6(DTM-46F7@W[O@!2?0B4HY'1,S15%(G!N;XZPPB3-1,=7.^* +M^)<_P@_<_OW.1'!//"8$>DR````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M``````!R_'_CW?X_1W?U/E_AW/3SU]+^'S?P]/_^6TEBC_B4ZL_^C3XW_]=/ +M*]8="\$)%.]0KA0X+(H5]F!H."\,BT62$I>'@5#&QW\OY3F,N#>]FNE0AU(A +MG"5S=S/X>.'21%AWLTD4CBAW/7HT6UL=Z5OST;],TO:"AD\-E.G',K-)>NEN +MIY9I3-$WZ)QZDU]9N>290F/CYE\V>*]OF^/CE&\%47;1=1&AD+1D\TD@'--[ +MTRL?#/5O/#SXPO[T(P_K][AY)NRZ9]SATVBMK&S^\;W@FP\(;;$//S1LW8+A +M>3=C:7F[FH8QD[/GNHET1Z/!?IOJ2)S*X]OP\?#PQ^\O=VX?@6W2*>:G1+K6R>(>FI +MY<])L.$@#-J\60A8S`RY)V*;Q-O3L>/CE@^>$N6G$T>.>*710.G)7=C:YCT_2BS +M;".E.\N@PI]_/G\T7#.3Q[0&-:B0'-Z1O'V<<.6@06?1EF/)[CL3HI$,;#;U=/0(-2TP3NK8 +M[IR0A[.-_D^B,/K(1^M!E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HG!EWY1^S8%W1SF[^_8,BDQ-P23TP%O/7MD:^9F7"DG5KZH@:6-4Y +M/:%QS[$'F`C)I/R!U]M&YFTQ!/OX4'O]SA6I$F:"1B$$U2@_1W"QN$['*?N_ +M`&^2.#+J/L.G?]F?>CJINK$CI_5O9J.QOS:W,1N--&?B-]:,H?U'QXJ4>>I7 +MNI?1R/\8OR>]^QCRK1LUPB45VXF)M"(-)BT0CA;F_GW +M?-=7*MFR5-5SM01[FSVOWGMMD!--4&EKBGP1DJ88\Z<+Q0K^VX%`JM$UDW!) +MRG0!S>S\]?#>GORZJK@^SA6L;S9O8I39_"'OH.#V]/BAG(V$O\7]<7*?]>3$ +M)3NRO+/P31;-_)R6YHM+0=07,?8;/HRQ,%%"/5&Q3C&DV-:7HCD*RBIP344+ +MN7SCMU]1`IE!*18+-`IP(57D$KG&-<(7DYQ0\\AF,WYT?P5VI1P:@`L-U3U*G[SQGM1.<-NUYZ +M-KW-IL.)=/+&(N_,E[0F3(33DOBB;SR1#I&-)K$VB]<9O.UU/VUV`EXYYN&H&=2NDZ8(Z9O(BZ,PWF5,.$)J9==N($)UFSVGE+LF]^,C,^3R8.?R +M5SRW@YK[_)6'J/1/K5N=VU:==F-[GXYMU_&.K5;UCW(F0`EQ]+0N_R4RA9\7XL;N@+'&K@RU%`R/DBIE-9)#F4\F%7 +M6COU^S6"\Q11HS\5#NMBWFBG2F\R1E=M,0K5'KQ)QW_DI,04KDYT:D./HU!O:U?RO83D,0BGM3 +M13Y@:P*+>I2SWB[-/H?C[FJN](N]^.:AM66IM<[Y)96_C\U<#HQ9HBF+LSDCZ>`7T +MJ<]9W3BG;N?)\VQ/N4'``W__VG1P```````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M````````````````````````````````/_E+Q/[,7]KU/_G_____________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M_________________H!'_(O_ZQ_Z?_______________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M__________________________________________________________^@ +M1_R+_^L?^G__________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M________________________________________H$?\B__K'_I_________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +H_____________________________________________________P`` +` +end diff --git a/libarchive/test/test_read_large_splitted_rar_ae.uu b/libarchive/test/test_read_large_splitted_rar_ae.uu new file mode 100644 index 000000000000..9f463a4ae384 --- /dev/null +++ b/libarchive/test/test_read_large_splitted_rar_ae.uu @@ -0,0 +1,375 @@ +begin 644 - +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________________________________________ +M____________________________H$P!T14,C1?%G9O?$J_A%^K]7@Y2NE=W^2Y[+`````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M```````````````````````````````````````````````````````````` +M````````````````````````````````````````````````#U=_IYW_/U<_ +MH?\?3_/H>I>=B_GSNAS_7[]SU/CZGT>C]PIUI\# +MN/,^!\/T?3O\\_G?1SHL2*"O1V.[U>MZAYOR6#3_WY_TPY +M`=/Q4IX]'42-/%X!""QIJZ<(%2T_<[3[/Z>YZ.;I]:"Z!(!Q'*P#5O[KYO<[>EH^#3EG%=U +MUB!IZXV0;U("5+:D=^OZJFD\WZCO"PBJ2QY!E);,$>6"0?H]3J_O6I?7FZU= +M.,+Z[Z5/E(0)>*Z+7[(*5*E&1W"42AOFZ5?DF2_KU4^B^+U>77[(-%!#S_NP +MQ:.NGI;<"`]C?:O^:8H3^N\-O[8,GV_I]?_'S=*]\K^7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[DT)F]%M.9/8%$58 +M0S)=?9\16F`[F7>"]22&A^BE$`:%]89YK8LMX4\?*>YWLG)25RK*.K)901`V +M]&IJZOJ1J_6GW!LR>I^"`[07J:]@%V?5BQJ?SP/;WQ=6$)VG)G>,CD;"*2]BO';UTABY)#56A_?JZ>CVO<+0[/9T^Y#1S1\'1BO@_7G[ +MF+:SX]=K^LYM7V:F+!8@8VWCQE9 +MON?5'U;4?[#8J%5Z%VJ6=4&'1J4HO;()4E6Z9]B#F&EOGA"Y]OY\)@Z$KQP\]L>4<',^O+3P:'OZ[N0-$59`T+&V[RU6]6;[V-V/2\DOQI9RJV +M8A[VJ&3N-FHO1'WX^C$`6&2L/DNQK)5_WUI\QDNC?X],*1X0H=%T;6[0R[0Y +M+&X>-&5*QYNCCJ;63LCPVSZ%<=8_&<$7YI5O82X$^Z<##T4I_XS;/-5[M4JN)*<.,PUX=<@21*+8?\@!8`NJL$\VJOXQXJ9_D3.WKH>4UT +MR@[R57^/8HS5-09>'[^!EC_/B&H.[#.Q3A=.O\P!`!P`` +` +end diff --git a/libarchive/test/test_read_pax_truncated.c b/libarchive/test/test_read_pax_truncated.c index 7c1ba6c1e2ab..bc5d74d5bdb8 100644 --- a/libarchive/test/test_read_pax_truncated.c +++ b/libarchive/test/test_read_pax_truncated.c @@ -38,7 +38,7 @@ DEFINE_TEST(test_read_pax_truncated) /* Create a new archive in memory. */ assert((a = archive_write_new()) != NULL); assertEqualIntA(a, ARCHIVE_OK, archive_write_set_format_pax(a)); - assertEqualIntA(a, ARCHIVE_OK, archive_write_set_compression_none(a)); + assertEqualIntA(a, ARCHIVE_OK, archive_write_add_filter_none(a)); assertEqualIntA(a, ARCHIVE_OK, archive_write_open_memory(a, buff, buff_size, &used)); diff --git a/libarchive/test/test_read_set_format.c b/libarchive/test/test_read_set_format.c new file mode 100644 index 000000000000..9208833e53a7 --- /dev/null +++ b/libarchive/test/test_read_set_format.c @@ -0,0 +1,220 @@ +/*- + * Copyright (c) 2003-2007 Tim Kientzle + * Copyright (c) 2012 Andres Mejia + * Copyright (c) 2011-2012 Michihiro NAKAJIMA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#include "test.h" + +DEFINE_TEST(test_read_set_format) +{ + char buff[64]; + const char reffile[] = "test_read_format_rar.rar"; + const char test_txt[] = "test text document\r\n"; + int size = sizeof(test_txt)-1; + struct archive_entry *ae; + struct archive *a; + + extract_reference_file(reffile); + assert((a = archive_read_new()) != NULL); + assertA(0 == archive_read_set_format(a, ARCHIVE_FORMAT_RAR)); + assertA(0 == archive_read_append_filter(a, ARCHIVE_FILTER_NONE)); + assertA(0 == archive_read_open_filename(a, reffile, 10240)); + + /* First header. */ + assertA(0 == archive_read_next_header(a, &ae)); + assertEqualString("test.txt", archive_entry_pathname(ae)); + assertA((int)archive_entry_mtime(ae)); + assertA((int)archive_entry_ctime(ae)); + assertA((int)archive_entry_atime(ae)); + assertEqualInt(20, archive_entry_size(ae)); + assertEqualInt(33188, archive_entry_mode(ae)); + assertA(size == archive_read_data(a, buff, size)); + assertEqualMem(buff, test_txt, size); + + /* Second header. */ + assertA(0 == archive_read_next_header(a, &ae)); + assertEqualString("testlink", archive_entry_pathname(ae)); + assertA((int)archive_entry_mtime(ae)); + assertA((int)archive_entry_ctime(ae)); + assertA((int)archive_entry_atime(ae)); + assertEqualInt(0, archive_entry_size(ae)); + assertEqualInt(41471, archive_entry_mode(ae)); + assertEqualString("test.txt", archive_entry_symlink(ae)); + assertEqualIntA(a, 0, archive_read_data(a, buff, sizeof(buff))); + + /* Third header. */ + assertA(0 == archive_read_next_header(a, &ae)); + assertEqualString("testdir/test.txt", archive_entry_pathname(ae)); + assertA((int)archive_entry_mtime(ae)); + assertA((int)archive_entry_ctime(ae)); + assertA((int)archive_entry_atime(ae)); + assertEqualInt(20, archive_entry_size(ae)); + assertEqualInt(33188, archive_entry_mode(ae)); + assertA(size == archive_read_data(a, buff, size)); + assertEqualMem(buff, test_txt, size); + + /* Fourth header. */ + assertA(0 == archive_read_next_header(a, &ae)); + assertEqualString("testdir", archive_entry_pathname(ae)); + assertA((int)archive_entry_mtime(ae)); + assertA((int)archive_entry_ctime(ae)); + assertA((int)archive_entry_atime(ae)); + assertEqualInt(0, archive_entry_size(ae)); + assertEqualInt(16877, archive_entry_mode(ae)); + + /* Fifth header. */ + assertA(0 == archive_read_next_header(a, &ae)); + assertEqualString("testemptydir", archive_entry_pathname(ae)); + assertA((int)archive_entry_mtime(ae)); + assertA((int)archive_entry_ctime(ae)); + assertA((int)archive_entry_atime(ae)); + assertEqualInt(0, archive_entry_size(ae)); + assertEqualInt(16877, archive_entry_mode(ae)); + + /* Test EOF */ + assertA(1 == archive_read_next_header(a, &ae)); + assertEqualInt(5, archive_file_count(a)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a)); + assertEqualInt(ARCHIVE_OK, archive_read_free(a)); +} + +DEFINE_TEST(test_read_set_wrong_format) +{ + const char reffile[] = "test_read_format_zip.zip"; + struct archive_entry *ae; + struct archive *a; + + extract_reference_file(reffile); + assert((a = archive_read_new()) != NULL); + assertA(0 == archive_read_set_format(a, ARCHIVE_FORMAT_RAR)); + assertA(0 == archive_read_append_filter(a, ARCHIVE_FILTER_NONE)); + assertA(0 == archive_read_open_filename(a, reffile, 10240)); + + /* Check that this actually fails, then close the archive. */ + assertA(archive_read_next_header(a, &ae) < (ARCHIVE_WARN)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a)); + assertEqualInt(ARCHIVE_OK, archive_read_free(a)); +} + +static unsigned char archive[] = { +31,139,8,0,222,'C','p','C',0,3,211,'c',160,'=','0','0','0','0','7','5','U', +0,210,134,230,166,6,200,'4',28,'(',24,26,24,27,155,24,152,24,154,27,155,')', +24,24,26,152,154,25,'2','(',152,210,193,'m',12,165,197,'%',137,'E','@',167, +148,'d',230,226,'U','G','H',30,234,15,'8','=',10,'F',193,'(',24,5,131,28, +0,0,29,172,5,240,0,6,0,0}; + +DEFINE_TEST(test_read_append_filter) +{ + struct archive_entry *ae; + struct archive *a; + int r; + + assert((a = archive_read_new()) != NULL); + assertA(0 == archive_read_set_format(a, ARCHIVE_FORMAT_TAR)); + r = archive_read_append_filter(a, ARCHIVE_FILTER_GZIP); + if (r == ARCHIVE_WARN && !canGzip()) { + skipping("gzip reading not fully supported on this platform"); + assertEqualInt(ARCHIVE_OK, archive_read_free(a)); + return; + } + assertEqualInt(ARCHIVE_OK, + archive_read_open_memory(a, archive, sizeof(archive))); + assertEqualInt(ARCHIVE_OK, archive_read_next_header(a, &ae)); + assertEqualInt(1, archive_file_count(a)); + assertEqualInt(archive_filter_code(a, 0), ARCHIVE_COMPRESSION_GZIP); + 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_read_append_wrong_filter) +{ + struct archive_entry *ae; + struct archive *a; + int r; + + assert((a = archive_read_new()) != NULL); + assertA(0 == archive_read_set_format(a, ARCHIVE_FORMAT_TAR)); + r = archive_read_append_filter(a, ARCHIVE_FILTER_XZ); + if (r == ARCHIVE_WARN && !canXz()) { + skipping("xz reading not fully supported on this platform"); + assertEqualInt(ARCHIVE_OK, archive_read_free(a)); + return; + } + assertEqualInt(ARCHIVE_OK, + archive_read_open_memory(a, archive, sizeof(archive))); + assertA(archive_read_next_header(a, &ae) < (ARCHIVE_WARN)); + if (r == ARCHIVE_WARN && canXz()) { + assertEqualIntA(a, ARCHIVE_WARN, archive_read_close(a)); + } else { + assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a)); + } + assertEqualInt(ARCHIVE_OK,archive_read_free(a)); +} + +DEFINE_TEST(test_read_append_filter_program) +{ + struct archive_entry *ae; + struct archive *a; + + if (!canGzip()) { + skipping("Can't run gzip program on this platform"); + return; + } + assert((a = archive_read_new()) != NULL); + assertA(0 == archive_read_set_format(a, ARCHIVE_FORMAT_TAR)); + assertEqualIntA(a, ARCHIVE_OK, + archive_read_append_filter_program(a, "gzip -d")); + assertEqualIntA(a, ARCHIVE_OK, + archive_read_open_memory(a, archive, sizeof(archive))); + assertEqualIntA(a, ARCHIVE_OK, + archive_read_next_header(a, &ae)); + assertEqualInt(archive_filter_code(a, 0), ARCHIVE_FILTER_PROGRAM); + assertEqualInt(archive_format(a), ARCHIVE_FORMAT_TAR_USTAR); + assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a)); + assertEqualInt(ARCHIVE_OK, archive_read_free(a)); +} + +DEFINE_TEST(test_read_append_filter_wrong_program) +{ + struct archive_entry *ae; + struct archive *a; + + /* + * If we have "bunzip2 -q", try using that. + */ + if (!canRunCommand("bunzip2 -V")) { + skipping("Can't run bunzip2 program on this platform"); + return; + } + assert((a = archive_read_new()) != NULL); + assertA(0 == archive_read_set_format(a, ARCHIVE_FORMAT_TAR)); + assertEqualIntA(a, ARCHIVE_OK, + archive_read_append_filter_program(a, "bunzip2 -q")); + assertEqualIntA(a, ARCHIVE_OK, + archive_read_open_memory(a, archive, sizeof(archive))); + assertA(archive_read_next_header(a, &ae) < (ARCHIVE_WARN)); + assertEqualIntA(a, ARCHIVE_WARN, archive_read_close(a)); + assertEqualInt(ARCHIVE_OK, archive_read_free(a)); +} diff --git a/libarchive/test/test_read_splitted_rar_aa.uu b/libarchive/test/test_read_splitted_rar_aa.uu new file mode 100644 index 000000000000..9a510cb4c94a --- /dev/null +++ b/libarchive/test/test_read_splitted_rar_aa.uu @@ -0,0 +1,6 @@ +begin 644 - +M4F%R(1H'`,^061Isize; while (size) { if (size > sizeof(buff)) w = sizeof(buff); else - w = size; + w = (DWORD)size; assert(WriteFile(handle, buff, w, &wr, NULL) != 0); size -= wr; } @@ -172,6 +173,7 @@ is_sparse_supported(const char *path) const char *testfile = "can_sparse"; (void)path; /* UNUSED */ + memset(buff, 0, sizeof(buff)); create_sparse_file(testfile, sparse_file); fd = open(testfile, O_RDWR); if (fd < 0) diff --git a/libarchive/test/test_splitted_rar_seek_support_aa.uu b/libarchive/test/test_splitted_rar_seek_support_aa.uu new file mode 100644 index 000000000000..0344d2ce30ef --- /dev/null +++ b/libarchive/test/test_splitted_rar_seek_support_aa.uu @@ -0,0 +1,159 @@ +begin 644 - +M4F%R(1H'`,^0R!M87)G:6XZ(#`N-SEI;B!]"@D)4"![(&UAR!M87)G:6XM8F]T=&]M.B`P+C`X:6X@?0H)"4@Q+G=ER!F;VYT+69A;6EL>3H@(DQI8F5R871I;VX@4V5R:68B+"!S97)I9B!] +M"@D)2#$N8VIK('L@9F]N="UF86UI;'DZ(")":71S=')E86T@5F5R82!386YS +M(B!]"@D)2#$N8W1L('L@9F]N="UF86UI;'DZ(")&R!F;VYT+69A;6EL>3H@(D)I='-TR!F;VYT+69A;6EL>3H@(D9R965386YS(B!]"@D)5%0N8VIK('L@ +M9F]N="UF86UI;'DZ(")":71S=')E86T@5F5R82!386YS(BP@;6]N;W-P86-E +M('T*"2TM/@H)/"]35%E,13X*/"](14%$/@H\0D]$62!,04Y'/2)E;BU54R(@ +M1$E2/2),5%(B/@H\2#$@0TQ!4U,](G=E2X@"CPO4#X*/%`^06YY('-I9VYI9FEC86YT(&-H +M86YG92!T;R!L:6)A2!N97<@=&5S=',@;W(@8VAA;F=E +M&ES=&EN9R!T97-T0H):&]L9&EN9R!T:&4@ +M)G%U;W0[6]U +M)VQL(&YE960@=&\@2!T:&4*/%14($-,05-3/2)W97-T97)N(CXM +M2!S:&]U;&0@ +M8F4@=7-A8FQE(&9O2!F&5C=71A8FQE(&)E +M:6YG(&5X97)C:7-E9"X@"@D\+U`^"@D\3$D^/%`^0F%S:6,@=F5R2(^/"]!/D)A2!T:&%T(&EL;&5G86P@&-E2!W:71H('9A'1R +M86-T7W)E9F5R96YC95]F:6QE*&YA;64I.PHF;F)S<#L@)FYB'1?:&5A9&5R*&$L("9A;7`[864I*3L* +M)FYB5]P871H +M;F%M92AA92DI.SPO4%)%/CQ0/@I4:&4@/%14($-,05-3/2)W97-T97)N(CYA +M2!D969A=6QT+`IT:&5Y(')E<&]R="!T:&4@9F%I;'5R +M92!A;F0@6-L92!O9@IA('1E0IA;F0@87,@82!L +M86)E;"!T:&%T(&-A;B!B92!U2X@"@D\+U`^"@D\3$D^/%`@4U193$4](FUA2!D:7)E8W1O2!A2!O<&5N(&9I;&4@9&5S8W)I<'1O2!W:6QL(&)E +M(')E;6]V960@9F]R('EO=2X@"@D\+U`^"@D\3$D^/%`^5&AE(&-U2X@"@D\+U`^"@D\3$D^/%`@4U193$4](FUA +MPHC:68@7U]03$%41D]230HF;F)S<#L@ +M)FYB"@I(&9U;F-T:6]N +M2!I;F-O;7!L971E(&QI +M'1&:6QE0V]N=&5N=',\+U14/B`*"3PO4#X*/"]53#X*/$@Q($-, +M05-3/2)W97-T97)N(CX\02!.04U%/2)2969E6]U(&YE960@82!R969E'1R86-T7W)E9F5R96YC95]F:6QE*"9Q=6]T +M.W1E"UE;F-O9&5D(&%R'1R86-T7W)E +M9F5R96YC95]F:6QE*"D\+U14/B!W87,@861D960@86YD(&ES"FYO="!R96-O +M;6UE;F1E9"!F;W(@;F5W(&-O9&4N(`H\+U`^"CQ(,2!#3$%34STB=V5S=&5R +M;B(^/$$@3D%-13TB1&]S7V%N9%]$;VYT6]U6]U2!R=6X* +M"6%L;"!O9B!T:&4@=&5S=',N(`H)/"]0/@H)/$Q)/CQ0(%-464Q%/2)M87)G +M:6XM8F]T=&]M.B`P:6XB/D1/3B=4(')E;'D@;VX@/%14($-,05-3/2)W97-T +997)N(CY(059%7SPO5%0^"@EM86-R;W,@9@`` +` +end diff --git a/libarchive/test/test_splitted_rar_seek_support_ac.uu b/libarchive/test/test_splitted_rar_seek_support_ac.uu new file mode 100644 index 000000000000..ee9f78c48967 --- /dev/null +++ b/libarchive/test/test_splitted_rar_seek_support_ac.uu @@ -0,0 +1,141 @@ +begin 644 - +M2!A9&1I;F<@:G5S="!A(&-O=7!L92!O9B!A&ES=&EN9R!T97-T(&EN&%M<&QE'1R86-T7W)E9F5R96YC +M95]F:6QE*"D\+U14/@IT;R!D96-O9&4@82!U=65N8V]D960@:6YP=70@9FEL +M92P@=&AE;B!O<&5N('1H870@9FEL92!W:71H(&QI8F%R8VAI=F4*86YD('9E +M2!T:&4@0IF965D(&%R8VAI=F4@96YT2!A9V%I;B!T;R!R96%D('1H +M92!D871A(&)A8VL@86YD('9E2!T:&%T"FET(&ES('1H92!S86UE+B`* +M/"]0/@H\2#(@0TQ!4U,](G=E2!T:&%T('1H92!A2X*5&AE2!T6EN9R!F:6QE2!T +M:6UE2!T;PIA=F]I9"!UGH@=&5S=&5R/"](,CX*/%`^5&AE(&9U>GH@=&5S=&5R(&ES(&]N92!O +M9B!T:&4@9F5W('1E2!A8F]R +M=',@=&AE(&5N=&ER92!PGH@9F%I;'5R92!C +M875S97,@82!CFEP(&]R(&)Z:7`R"F-O;7!R97-S:6]N('=O +M;B=T(&AE;'`[(&%L=&AO=6=H('-M86QL97(L('1H92!O=71P=70@:7,@F5R;R!B>71E0IE9F9E8W1I=F4L(&-O;7!R97-S:6YG(&$@F5N(&5N=')I97,@9&]W;B!T;PIJ=7-T(&$@9F5W +M(&MI;&]B>71E2!T:&%T(&QI8F%R8VAI=F4@8V]R +M0IC87-EF5R;R!B;&]C:W,@8V%N('1A:V4*<75I=&4@82!W:&EL92P@F%T +M:6]N.@I,:6)A29Q=6]T.R!Z97)O+6-O +M<'DN(%=H96X@>6]U(&=I=F4@:70@82!L87)G90IB;&]C:R!T;R!W2!B;V1Y+"!I="!W:6QL('!A2!L87)G92!F:6QE('-I>F5S("AT87(@9FEL97,*2D@86YD(&EN=&5G97(@;W9E2D@:6X@82!T97-T('1H870@ +#endif +#ifdef HAVE_SYS_XATTR_H +#include +#endif + +#if defined(__APPLE__) && defined(UF_COMPRESSED) && defined(HAVE_SYS_XATTR_H)\ + && defined(HAVE_ZLIB_H) +static int +has_xattr(const char *filename, const char *xattrname) +{ + char *nl, *nlp; + ssize_t r; + int exisiting; + + r = listxattr(filename, NULL, 0, XATTR_SHOWCOMPRESSION); + if (r < 0) + return (0); + if (r == 0) + return (0); + + nl = malloc(r); + if (!assert(nl != NULL)) + return (0); + + r = listxattr(filename, nl, r, XATTR_SHOWCOMPRESSION); + if (r < 0) { + free(nl); + return (0); + } + + exisiting = 0; + for (nlp = nl; nlp < nl + r; nlp += strlen(nlp) + 1) { + if (strcmp(nlp, xattrname) == 0) { + exisiting = 1; + break; + } + } + free(nl); + return (exisiting); +} + +#endif + +/* + * Exercise HFS+ Compression. + */ +DEFINE_TEST(test_write_disk_appledouble) +{ +#if !defined(__APPLE__) || !defined(UF_COMPRESSED) || !defined(HAVE_SYS_XATTR_H)\ + || !defined(HAVE_ZLIB_H) + skipping("MacOS-specific AppleDouble test"); +#else + const char *refname = "test_write_disk_appledouble.cpio.gz"; + struct archive *ad, *a; + struct archive_entry *ae; + struct stat st; + acl_t acl; + + extract_reference_file(refname); + + /* + * Extract an archive to disk with HFS+ Compression. + */ + assert((ad = archive_write_disk_new()) != NULL); + assertEqualIntA(ad, ARCHIVE_OK, + archive_write_disk_set_standard_lookup(ad)); + assertEqualIntA(ad, ARCHIVE_OK, + archive_write_disk_set_options(ad, + ARCHIVE_EXTRACT_TIME | + ARCHIVE_EXTRACT_SECURE_SYMLINKS | + ARCHIVE_EXTRACT_SECURE_NODOTDOT | + ARCHIVE_EXTRACT_HFS_COMPRESSION_FORCED)); + + 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, 512 * 20)); + + assertMakeDir("hfscmp", 0755); + assertChdir("hfscmp"); + + /* Skip "." */ + assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); + assertEqualString(".", archive_entry_pathname(ae)); + /* Extract file3. */ + assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); + assertEqualString("./file3", archive_entry_pathname(ae)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_extract2(a, ae, ad)); + /* Extract ._file3 which will be merged into file3 as medtadata. */ + assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); + assertEqualString("./._file3", archive_entry_pathname(ae)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_extract2(a, ae, ad)); + + assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a)); + assertEqualInt(ARCHIVE_OK, archive_read_free(a)); + assertEqualIntA(ad, ARCHIVE_OK, archive_write_free(ad)); + + /* Test file3. */ + assertEqualInt(0, stat("file3", &st)); + assertEqualInt(UF_COMPRESSED, st.st_flags & UF_COMPRESSED); + assertFileSize("file3", 8); + failure("'%s' should not have Resource Fork", "file3"); + assertEqualInt(0, has_xattr("file3", "com.apple.ResourceFork")); + failure("'%s' should have decompfs xattr", "file3"); + assertEqualInt(1, has_xattr("file3", "com.apple.decmpfs")); + assert(NULL != (acl = acl_get_file("file3", ACL_TYPE_EXTENDED))); + assertEqualString(acl_to_text(acl, NULL), + "!#acl 1\n" + "user:FFFFEEEE-DDDD-CCCC-BBBB-AAAA000000C9:Guest:201:deny:read\n" + "group:ABCDEFAB-CDEF-ABCD-EFAB-CDEF00000050:admin:80:allow:write\n" + ); + if (acl) acl_free(acl); + /* Test ._file3. */ + failure("'file3' should be merged and removed"); + assertFileNotExists("._file3"); + + assertChdir(".."); + + /* + * Extract an archive to disk without HFS+ Compression. + */ + assert((ad = archive_write_disk_new()) != NULL); + assertEqualIntA(ad, ARCHIVE_OK, + archive_write_disk_set_standard_lookup(ad)); + assertEqualIntA(ad, ARCHIVE_OK, + archive_write_disk_set_options(ad, + ARCHIVE_EXTRACT_TIME | + ARCHIVE_EXTRACT_SECURE_SYMLINKS | + ARCHIVE_EXTRACT_SECURE_NODOTDOT)); + + 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, 512 * 20)); + + assertMakeDir("nocmp", 0755); + assertChdir("nocmp"); + + /* Skip "." */ + assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); + assertEqualString(".", archive_entry_pathname(ae)); + /* Extract file3. */ + assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); + assertEqualString("./file3", archive_entry_pathname(ae)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_extract2(a, ae, ad)); + /* Extract ._file3 which will be merged into file3 as medtadata. */ + assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); + assertEqualString("./._file3", archive_entry_pathname(ae)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_extract2(a, ae, ad)); + + assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a)); + assertEqualInt(ARCHIVE_OK, archive_read_free(a)); + assertEqualIntA(ad, ARCHIVE_OK, archive_write_free(ad)); + + /* Test file3. */ + assertEqualInt(0, stat("file3", &st)); + assertEqualInt(0, st.st_flags & UF_COMPRESSED); + assertFileSize("file3", 8); + failure("'%s' should not have Resource Fork", "file3"); + assertEqualInt(0, has_xattr("file3", "com.apple.ResourceFork")); + failure("'%s' should not have decmpfs", "file3"); + assertEqualInt(0, has_xattr("file3", "com.apple.decmpfs")); + assert(NULL != (acl = acl_get_file("file3", ACL_TYPE_EXTENDED))); + assertEqualString(acl_to_text(acl, NULL), + "!#acl 1\n" + "user:FFFFEEEE-DDDD-CCCC-BBBB-AAAA000000C9:Guest:201:deny:read\n" + "group:ABCDEFAB-CDEF-ABCD-EFAB-CDEF00000050:admin:80:allow:write\n" + ); + if (acl) acl_free(acl); + /* Test ._file3. */ + failure("'file3' should be merged and removed"); + assertFileNotExists("._file3"); + + assertChdir(".."); + + assertEqualFile("hfscmp/file3", "nocmp/file3"); +#endif +} diff --git a/libarchive/test/test_write_disk_appledouble.cpio.gz.uu b/libarchive/test/test_write_disk_appledouble.cpio.gz.uu new file mode 100644 index 000000000000..f2797d96e0f0 --- /dev/null +++ b/libarchive/test/test_write_disk_appledouble.cpio.gz.uu @@ -0,0 +1,12 @@ +begin 644 test_write_disk_appledouble.cpio.gz +M'XL("#N]E5```W1E^_VO?/X52A[:CCZ".9<'JV.U, +MN6AG9G6;C%-A,2X*7 +M)%6SN;;CS7_GO;VI,!TR)L^=.SH^/T%'"-W'B?[PJ#_IW[0U=`K!(3XA0(\N +MT$&X411VV:;C`^)]<&3T4S]+B@6)RS)7)$YR4JO7&C:,2Q`ZTYJ5JN04"``\ +M`;`/8`_`+M!]DW\M;QJUJB6G3*9J^28K%:?:O"J:4KJ>/PFFKH?;!;<*;V77 +M;E$9IXML*:\@R?-B+==55BMM]T%-NA^VO]H_'H7N[5T0&H9QV&_\YP_X`B-U +&WD<`!``` +` +end diff --git a/libarchive/test/test_write_disk_hfs_compression.c b/libarchive/test/test_write_disk_hfs_compression.c new file mode 100644 index 000000000000..24c13c4ed68a --- /dev/null +++ b/libarchive/test/test_write_disk_hfs_compression.c @@ -0,0 +1,278 @@ +/*- + * Copyright (c) 2003-2007 Tim Kientzle + * Copyright (c) 2012 Michihiro NAKAJIMA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#include "test.h" +__FBSDID("$FreeBSD$"); + +#ifdef HAVE_SYS_XATTR_H +#include +#endif + +#if defined(__APPLE__) && defined(UF_COMPRESSED) && defined(HAVE_SYS_XATTR_H)\ + && defined(HAVE_ZLIB_H) +static int +has_xattr(const char *filename, const char *xattrname) +{ + char *nl, *nlp; + ssize_t r; + int exisiting; + + r = listxattr(filename, NULL, 0, XATTR_SHOWCOMPRESSION); + if (r < 0) + return (0); + if (r == 0) + return (0); + + nl = malloc(r); + if (!assert(nl != NULL)) + return (0); + + r = listxattr(filename, nl, r, XATTR_SHOWCOMPRESSION); + if (r < 0) { + free(nl); + return (0); + } + + exisiting = 0; + for (nlp = nl; nlp < nl + r; nlp += strlen(nlp) + 1) { + if (strcmp(nlp, xattrname) == 0) { + exisiting = 1; + break; + } + } + free(nl); + return (exisiting); +} +static int +get_rsrc_footer(const char *filename, char *buff, size_t s) +{ + ssize_t r; + + r = getxattr(filename, "com.apple.ResourceFork", NULL, 0, 0, + XATTR_SHOWCOMPRESSION); + if (r < (ssize_t)s) + return (-1); + r = getxattr(filename, "com.apple.ResourceFork", buff, s, + r - s, XATTR_SHOWCOMPRESSION); + if (r < (ssize_t)s) + return (-1); + return (0); +} + +#endif + +/* + * Exercise HFS+ Compression. + */ +DEFINE_TEST(test_write_disk_hfs_compression) +{ +#if !defined(__APPLE__) || !defined(UF_COMPRESSED) || !defined(HAVE_SYS_XATTR_H)\ + || !defined(HAVE_ZLIB_H) + skipping("MacOS-specific HFS+ Compression test"); +#else + const char *refname = "test_write_disk_hfs_compression.tgz"; + struct archive *ad, *a; + struct archive_entry *ae; + struct stat st; + char rsrc[50]; + static const char rsrc_footer[50] = { + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x1c, 0x00, 0x32, 0x00, 0x00, 'c', 'm', + 'p', 'f', 0x00, 0x00, 0x00, 0x0a, 0x00, 0x01, + 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00 + }; + + extract_reference_file(refname); + + /* + * Extract an archive to disk with HFS+ Compression. + */ + assert((ad = archive_write_disk_new()) != NULL); + assertEqualIntA(ad, ARCHIVE_OK, + archive_write_disk_set_standard_lookup(ad)); + assertEqualIntA(ad, ARCHIVE_OK, + archive_write_disk_set_options(ad, + ARCHIVE_EXTRACT_TIME | + ARCHIVE_EXTRACT_SECURE_SYMLINKS | + ARCHIVE_EXTRACT_SECURE_NODOTDOT | + ARCHIVE_EXTRACT_HFS_COMPRESSION_FORCED)); + + 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, 512 * 20)); + + assertMakeDir("hfscmp", 0755); + assertChdir("hfscmp"); + + /* Extract file1. */ + assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_extract2(a, ae, ad)); + /* Extract README. */ + assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_extract2(a, ae, ad)); + /* Extract NEWS. */ + assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_extract2(a, ae, ad)); + /* Extract Makefile. */ + assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_extract2(a, ae, ad)); + + assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a)); + assertEqualInt(ARCHIVE_OK, archive_read_free(a)); + assertEqualIntA(ad, ARCHIVE_OK, archive_write_free(ad)); + + /* Test file1. */ + assertEqualInt(0, stat("file1", &st)); + assertEqualInt(UF_COMPRESSED, st.st_flags & UF_COMPRESSED); + assertFileSize("file1", 8); + failure("'%s' should not have Resource Fork", "file1"); + assertEqualInt(0, has_xattr("file1", "com.apple.ResourceFork")); + failure("'%s' should have decompfs xattr", "file1"); + assertEqualInt(1, has_xattr("file1", "com.apple.decmpfs")); + + /* Test README. */ + assertEqualInt(0, stat("README", &st)); + assertEqualInt(UF_COMPRESSED, st.st_flags & UF_COMPRESSED); + assertFileSize("README", 6586); + failure("'%s' should not have Resource Fork", "README"); + assertEqualInt(0, has_xattr("README", "com.apple.ResourceFork")); + failure("'%s' should have decompfs xattr", "README"); + assertEqualInt(1, has_xattr("README", "com.apple.decmpfs")); + + /* Test NEWS. */ + assertEqualInt(0, stat("NEWS", &st)); + assertEqualInt(UF_COMPRESSED, st.st_flags & UF_COMPRESSED); + assertFileSize("NEWS", 28438); + failure("'%s' should have Resource Fork", "NEWS"); + assertEqualInt(1, has_xattr("NEWS", "com.apple.ResourceFork")); + failure("'%s' should have decompfs xattr", "NEWS"); + assertEqualInt(1, has_xattr("NEWS", "com.apple.decmpfs")); + assertEqualInt(0, get_rsrc_footer("NEWS", rsrc, sizeof(rsrc))); + failure("Resource Fork should have consistent 50 bytes data"); + assertEqualMem(rsrc_footer, rsrc, sizeof(rsrc)); + + /* Test Makefile. */ + assertEqualInt(0, stat("Makefile", &st)); + assertEqualInt(UF_COMPRESSED, st.st_flags & UF_COMPRESSED); + assertFileSize("Makefile", 1264000); + failure("'%s' should have Resource Fork", "Makefile"); + assertEqualInt(1, has_xattr("Makefile", "com.apple.ResourceFork")); + failure("'%s' should have decompfs xattr", "Makefile"); + assertEqualInt(1, has_xattr("Makefile", "com.apple.decmpfs")); + assertEqualInt(0, get_rsrc_footer("Makefile", rsrc, sizeof(rsrc))); + failure("Resource Fork should have consistent 50 bytes data"); + assertEqualMem(rsrc_footer, rsrc, sizeof(rsrc)); + + assertChdir(".."); + + /* + * Extract an archive to disk without HFS+ Compression. + */ + assert((ad = archive_write_disk_new()) != NULL); + assertEqualIntA(ad, ARCHIVE_OK, + archive_write_disk_set_standard_lookup(ad)); + assertEqualIntA(ad, ARCHIVE_OK, + archive_write_disk_set_options(ad, + ARCHIVE_EXTRACT_TIME | + ARCHIVE_EXTRACT_SECURE_SYMLINKS | + ARCHIVE_EXTRACT_SECURE_NODOTDOT)); + + 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, 512 * 20)); + + assertMakeDir("nocmp", 0755); + assertChdir("nocmp"); + + /* Extract file1. */ + assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_extract2(a, ae, ad)); + /* Extract README. */ + assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_extract2(a, ae, ad)); + /* Extract NEWS. */ + assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_extract2(a, ae, ad)); + /* Extract Makefile. */ + assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_extract2(a, ae, ad)); + + assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a)); + assertEqualInt(ARCHIVE_OK, archive_read_free(a)); + assertEqualIntA(ad, ARCHIVE_OK, archive_write_free(ad)); + + /* Test file1. */ + assertEqualInt(0, stat("file1", &st)); + assertEqualInt(0, st.st_flags & UF_COMPRESSED); + assertFileSize("file1", 8); + failure("'%s' should not have Resource Fork", "file1"); + assertEqualInt(0, has_xattr("file1", "com.apple.ResourceFork")); + failure("'%s' should not have decmpfs", "file1"); + assertEqualInt(0, has_xattr("file1", "com.apple.decmpfs")); + + /* Test README. */ + assertEqualInt(0, stat("README", &st)); + assertEqualInt(0, st.st_flags & UF_COMPRESSED); + assertFileSize("README", 6586); + failure("'%s' should not have Resource Fork", "README"); + assertEqualInt(0, has_xattr("README", "com.apple.ResourceFork")); + failure("'%s' should not have decmpfs", "README"); + assertEqualInt(0, has_xattr("README", "com.apple.decmpfs")); + + /* Test NEWS. */ + assertEqualInt(0, stat("NEWS", &st)); + assertEqualInt(0, st.st_flags & UF_COMPRESSED); + assertFileSize("NEWS", 28438); + failure("'%s' should not have Resource Fork", "NEWS"); + assertEqualInt(0, has_xattr("NEWS", "com.apple.ResourceFork")); + failure("'%s' should not have decmpfs", "NEWS"); + assertEqualInt(0, has_xattr("NEWS", "com.apple.decmpfs")); + + /* Test Makefile. */ + assertEqualInt(0, stat("Makefile", &st)); + assertEqualInt(0, st.st_flags & UF_COMPRESSED); + assertFileSize("Makefile", 1264000); + failure("'%s' should not have Resource Fork", "Makefile"); + assertEqualInt(0, has_xattr("Makefile", "com.apple.ResourceFork")); + failure("'%s' should not have decmpfs", "Makefile"); + assertEqualInt(0, has_xattr("Makefile", "com.apple.decmpfs")); + + assertChdir(".."); + + assertEqualFile("hfscmp/file1", "nocmp/file1"); + assertEqualFile("hfscmp/README", "nocmp/README"); + assertEqualFile("hfscmp/NEWS", "nocmp/NEWS"); + assertEqualFile("hfscmp/Makefile", "nocmp/Makefile"); +#endif +} diff --git a/libarchive/test/test_write_disk_hfs_compression.tgz.uu b/libarchive/test/test_write_disk_hfs_compression.tgz.uu new file mode 100644 index 000000000000..35e26aed44dc --- /dev/null +++ b/libarchive/test/test_write_disk_hfs_compression.tgz.uu @@ -0,0 +1,1800 @@ +begin 644 test_write_disk_hfs_compression.tgz +M'XL(`,'#B5```^R]ZWK;1K(HNO^*3X%1O$=2EDA=;2?RSEI#2[+-1+9+]4.?'>8']8J_SYZ)30!5U?>Z=77U +MV/6FG+:-\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$>O&=_^1.6? +M:C/%+3-YML_/ZA^]WI?WR/S/)1O''UF*@V-V(>Y\46\@8G'YC2ZCJ?DW^ +MY?-C^VSV-C]J^08%OM[J+#Z_EZ:HN?36SPEGW9Y]D'?9?_WX;T^>/A9OALS^ +MW/)YZ?P9]O;*XKD\93GX^N>JQ=S;JRKG\BS5Z.N?IAY55#MG57N;+_C7[BRS +MG^X=W?_3G7M'?[QWBY?RFZ<_RN8H9N+-4.JMR;S0;_N+4?]L+&O\/;^SZ6JT +MS'DIWRV+?,+2-V$%O\EA^?S=\I\96S1_DU%Q2YP&.LM9K(%`\M'>T=/O'_^+ + +#endif +#ifdef HAVE_SYS_XATTR_H +#include +#endif + +#if defined(__APPLE__) && defined(UF_COMPRESSED) && defined(HAVE_SYS_XATTR_H)\ + && defined(HAVE_ZLIB_H) +static int +has_xattr(const char *filename, const char *xattrname) +{ + char *nl, *nlp; + ssize_t r; + int exisiting; + + r = listxattr(filename, NULL, 0, XATTR_SHOWCOMPRESSION); + if (r < 0) + return (0); + if (r == 0) + return (0); + + nl = malloc(r); + if (!assert(nl != NULL)) + return (0); + + r = listxattr(filename, nl, r, XATTR_SHOWCOMPRESSION); + if (r < 0) { + free(nl); + return (0); + } + + exisiting = 0; + for (nlp = nl; nlp < nl + r; nlp += strlen(nlp) + 1) { + if (strcmp(nlp, xattrname) == 0) { + exisiting = 1; + break; + } + } + free(nl); + return (exisiting); +} + +#endif + +/* + * Exercise HFS+ Compression. + */ +DEFINE_TEST(test_write_disk_mac_metadata) +{ +#if !defined(__APPLE__) || !defined(UF_COMPRESSED) || !defined(HAVE_SYS_XATTR_H)\ + || !defined(HAVE_ZLIB_H) + skipping("MacOS-specific Mac Metadata test"); +#else + const char *refname = "test_write_disk_mac_metadata.tar.gz"; + struct archive *ad, *a; + struct archive_entry *ae; + struct stat st; + acl_t acl; + + extract_reference_file(refname); + + /* + * Extract an archive to disk with HFS+ Compression. + */ + assert((ad = archive_write_disk_new()) != NULL); + assertEqualIntA(ad, ARCHIVE_OK, + archive_write_disk_set_standard_lookup(ad)); + assertEqualIntA(ad, ARCHIVE_OK, + archive_write_disk_set_options(ad, + ARCHIVE_EXTRACT_TIME | + ARCHIVE_EXTRACT_SECURE_SYMLINKS | + ARCHIVE_EXTRACT_SECURE_NODOTDOT | + ARCHIVE_EXTRACT_MAC_METADATA)); + + 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, 512 * 20)); + + assertMakeDir("hfscmp", 0755); + assertChdir("hfscmp"); + + /* Extract file3. */ + assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); + assertEqualString("file3", archive_entry_pathname(ae)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_extract2(a, ae, ad)); + + assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a)); + assertEqualInt(ARCHIVE_OK, archive_read_free(a)); + assertEqualIntA(ad, ARCHIVE_OK, archive_write_free(ad)); + + /* Test file3. */ + assertEqualInt(0, stat("file3", &st)); + assertEqualInt(UF_COMPRESSED, st.st_flags & UF_COMPRESSED); + assertFileSize("file3", 8); + failure("'%s' should not have Resource Fork", "file3"); + assertEqualInt(0, has_xattr("file3", "com.apple.ResourceFork")); + failure("'%s' should have decompfs xattr", "file3"); + assertEqualInt(1, has_xattr("file3", "com.apple.decmpfs")); + assert(NULL != (acl = acl_get_file("file3", ACL_TYPE_EXTENDED))); + assertEqualString(acl_to_text(acl, NULL), + "!#acl 1\n" + "user:FFFFEEEE-DDDD-CCCC-BBBB-AAAA000000C9:Guest:201:deny:read\n" + "group:ABCDEFAB-CDEF-ABCD-EFAB-CDEF00000050:admin:80:allow:write\n" + ); + if (acl) acl_free(acl); + + assertChdir(".."); + + /* + * Extract an archive to disk without HFS+ Compression. + */ + assert((ad = archive_write_disk_new()) != NULL); + assertEqualIntA(ad, ARCHIVE_OK, + archive_write_disk_set_standard_lookup(ad)); + assertEqualIntA(ad, ARCHIVE_OK, + archive_write_disk_set_options(ad, + ARCHIVE_EXTRACT_TIME | + ARCHIVE_EXTRACT_SECURE_SYMLINKS | + ARCHIVE_EXTRACT_SECURE_NODOTDOT | + ARCHIVE_EXTRACT_MAC_METADATA | + ARCHIVE_EXTRACT_NO_HFS_COMPRESSION)); + + 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, 512 * 20)); + + assertMakeDir("nocmp", 0755); + assertChdir("nocmp"); + + /* Extract file3. */ + assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); + assertEqualString("file3", archive_entry_pathname(ae)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_extract2(a, ae, ad)); + + assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a)); + assertEqualInt(ARCHIVE_OK, archive_read_free(a)); + assertEqualIntA(ad, ARCHIVE_OK, archive_write_free(ad)); + + /* Test file3. */ + assertEqualInt(0, stat("file3", &st)); + assertEqualInt(0, st.st_flags & UF_COMPRESSED); + assertFileSize("file3", 8); + failure("'%s' should not have Resource Fork", "file3"); + assertEqualInt(0, has_xattr("file3", "com.apple.ResourceFork")); + failure("'%s' should not have decmpfs", "file3"); + assertEqualInt(0, has_xattr("file3", "com.apple.decmpfs")); + assert(NULL != (acl = acl_get_file("file3", ACL_TYPE_EXTENDED))); + assertEqualString(acl_to_text(acl, NULL), + "!#acl 1\n" + "user:FFFFEEEE-DDDD-CCCC-BBBB-AAAA000000C9:Guest:201:deny:read\n" + "group:ABCDEFAB-CDEF-ABCD-EFAB-CDEF00000050:admin:80:allow:write\n" + ); + if (acl) acl_free(acl); + + assertChdir(".."); + + assertEqualFile("hfscmp/file3", "nocmp/file3"); +#endif +} diff --git a/libarchive/test/test_write_disk_mac_metadata.tar.gz.uu b/libarchive/test/test_write_disk_mac_metadata.tar.gz.uu new file mode 100644 index 000000000000..216b6ef69c8e --- /dev/null +++ b/libarchive/test/test_write_disk_mac_metadata.tar.gz.uu @@ -0,0 +1,14 @@ +begin 644 test_write_disk_mac_metadata.tar.gz +M'XL(")$=EU```W1ED^J[X=\E-1`VU$L +MDD1X!Z"E_TCQM_]^_6."M_1/+&R5]_]OP%]<3_BC4ITE)24E!\8G]#K>=@`0 +"```` +` +end diff --git a/libarchive/test/test_write_disk_no_hfs_compression.c b/libarchive/test/test_write_disk_no_hfs_compression.c new file mode 100644 index 000000000000..a1afb9bb290f --- /dev/null +++ b/libarchive/test/test_write_disk_no_hfs_compression.c @@ -0,0 +1,231 @@ +/*- + * Copyright (c) 2003-2007 Tim Kientzle + * Copyright (c) 2012 Michihiro NAKAJIMA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#include "test.h" +__FBSDID("$FreeBSD$"); + +#ifdef HAVE_SYS_XATTR_H +#include +#endif + +#if defined(__APPLE__) && defined(UF_COMPRESSED) && defined(HAVE_SYS_XATTR_H)\ + && defined(HAVE_ZLIB_H) +static int +has_xattr(const char *filename, const char *xattrname) +{ + char *nl, *nlp; + ssize_t r; + int exisiting; + + r = listxattr(filename, NULL, 0, XATTR_SHOWCOMPRESSION); + if (r < 0) + return (0); + if (r == 0) + return (0); + + nl = malloc(r); + if (!assert(nl != NULL)) + return (0); + + r = listxattr(filename, nl, r, XATTR_SHOWCOMPRESSION); + if (r < 0) { + free(nl); + return (0); + } + + exisiting = 0; + for (nlp = nl; nlp < nl + r; nlp += strlen(nlp) + 1) { + if (strcmp(nlp, xattrname) == 0) { + exisiting = 1; + break; + } + } + free(nl); + return (exisiting); +} +#endif + +/* + * Exercise HFS+ Compression. + */ +DEFINE_TEST(test_write_disk_no_hfs_compression) +{ +#if !defined(__APPLE__) || !defined(UF_COMPRESSED) || !defined(HAVE_SYS_XATTR_H)\ + || !defined(HAVE_ZLIB_H) + skipping("MacOS-specific HFS+ Compression test"); +#else + const char *refname = "test_write_disk_no_hfs_compression.tgz"; + struct archive *ad, *a; + struct archive_entry *ae; + struct stat st; + + extract_reference_file(refname); + + /* + * Extract an archive to disk with HFS+ Compression + * the file was compressed. + */ + assert((ad = archive_write_disk_new()) != NULL); + assertEqualIntA(ad, ARCHIVE_OK, + archive_write_disk_set_standard_lookup(ad)); + assertEqualIntA(ad, ARCHIVE_OK, + archive_write_disk_set_options(ad, + ARCHIVE_EXTRACT_TIME | + ARCHIVE_EXTRACT_SECURE_SYMLINKS | + ARCHIVE_EXTRACT_SECURE_NODOTDOT)); + + 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, 512 * 20)); + + assertMakeDir("hfscmp", 0755); + assertChdir("hfscmp"); + + /* Extract file1. */ + assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_extract2(a, ae, ad)); + /* Extract README. */ + assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_extract2(a, ae, ad)); + /* Extract NEWS. */ + assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_extract2(a, ae, ad)); + /* Extract Makefile. */ + assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_extract2(a, ae, ad)); + + assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a)); + assertEqualInt(ARCHIVE_OK, archive_read_free(a)); + assertEqualIntA(ad, ARCHIVE_OK, archive_write_free(ad)); + + /* Test file1. */ + assertEqualInt(0, stat("file1", &st)); + assertEqualInt(0, st.st_flags & UF_COMPRESSED); + assertFileSize("file1", 8); + assertEqualInt(0, has_xattr("file1", "com.apple.ResourceFork")); + assertEqualInt(0, has_xattr("file1", "com.apple.decmpfs")); + + /* Test README. */ + assertEqualInt(0, stat("README", &st)); + assertEqualInt(UF_COMPRESSED, st.st_flags & UF_COMPRESSED); + assertFileSize("README", 6586); + assertEqualInt(0, has_xattr("README", "com.apple.ResourceFork")); + assertEqualInt(1, has_xattr("README", "com.apple.decmpfs")); + + /* Test NEWS. */ + assertEqualInt(0, stat("NEWS", &st)); + assertEqualInt(0, st.st_flags & UF_COMPRESSED); + assertFileSize("NEWS", 28438); + assertEqualInt(0, has_xattr("NEWS", "com.apple.ResourceFork")); + assertEqualInt(0, has_xattr("NEWS", "com.apple.decmpfs")); + + /* Test Makefile. */ + assertEqualInt(0, stat("Makefile", &st)); + assertEqualInt(UF_COMPRESSED, st.st_flags & UF_COMPRESSED); + assertFileSize("Makefile", 1238119); + assertEqualInt(1, has_xattr("Makefile", "com.apple.ResourceFork")); + assertEqualInt(1, has_xattr("Makefile", "com.apple.decmpfs")); + + assertChdir(".."); + + /* + * Extract an archive to disk without HFS+ Compression. + */ + assert((ad = archive_write_disk_new()) != NULL); + assertEqualIntA(ad, ARCHIVE_OK, + archive_write_disk_set_standard_lookup(ad)); + assertEqualIntA(ad, ARCHIVE_OK, + archive_write_disk_set_options(ad, + ARCHIVE_EXTRACT_TIME | + ARCHIVE_EXTRACT_SECURE_SYMLINKS | + ARCHIVE_EXTRACT_SECURE_NODOTDOT | + ARCHIVE_EXTRACT_NO_HFS_COMPRESSION)); + + 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, 512 * 20)); + + assertMakeDir("nocmp", 0755); + assertChdir("nocmp"); + + /* Extract file1. */ + assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_extract2(a, ae, ad)); + /* Extract README. */ + assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_extract2(a, ae, ad)); + /* Extract NEWS. */ + assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_extract2(a, ae, ad)); + /* Extract Makefile. */ + assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_extract2(a, ae, ad)); + + assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a)); + assertEqualInt(ARCHIVE_OK, archive_read_free(a)); + assertEqualIntA(ad, ARCHIVE_OK, archive_write_free(ad)); + + /* Test file1. */ + assertEqualInt(0, stat("file1", &st)); + assertEqualInt(0, st.st_flags & UF_COMPRESSED); + assertFileSize("file1", 8); + assertEqualInt(0, has_xattr("file1", "com.apple.ResourceFork")); + assertEqualInt(0, has_xattr("file1", "com.apple.decmpfs")); + + /* Test README. */ + assertEqualInt(0, stat("README", &st)); + assertEqualInt(0, st.st_flags & UF_COMPRESSED); + assertFileSize("README", 6586); + assertEqualInt(0, has_xattr("README", "com.apple.ResourceFork")); + assertEqualInt(0, has_xattr("README", "com.apple.decmpfs")); + + /* Test NEWS. */ + assertEqualInt(0, stat("NEWS", &st)); + assertEqualInt(0, st.st_flags & UF_COMPRESSED); + assertFileSize("NEWS", 28438); + assertEqualInt(0, has_xattr("NEWS", "com.apple.ResourceFork")); + assertEqualInt(0, has_xattr("NEWS", "com.apple.decmpfs")); + + /* Test Makefile. */ + assertEqualInt(0, stat("Makefile", &st)); + assertEqualInt(0, st.st_flags & UF_COMPRESSED); + assertFileSize("Makefile", 1238119); + assertEqualInt(0, has_xattr("Makefile", "com.apple.ResourceFork")); + assertEqualInt(0, has_xattr("Makefile", "com.apple.decmpfs")); + + assertChdir(".."); + + assertEqualFile("hfscmp/file1", "nocmp/file1"); + assertEqualFile("hfscmp/README", "nocmp/README"); + assertEqualFile("hfscmp/NEWS", "nocmp/NEWS"); + assertEqualFile("hfscmp/Makefile", "nocmp/Makefile"); +#endif +} diff --git a/libarchive/test/test_write_disk_no_hfs_compression.tgz.uu b/libarchive/test/test_write_disk_no_hfs_compression.tgz.uu new file mode 100644 index 000000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#5*VR:.B_;Y;#(:2C?%XM\3-PW)@&_1F'YXGWQKXP,FG[` +M;7'`-HI. used1); + + assert((a = archive_read_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a)); + 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 < 999; i++) { + sprintf(path, "file%03d", i); + if (!assertEqualInt(0, archive_read_next_header(a, &ae))) + break; + assertEqualString(path, archive_entry_pathname(ae)); + assertEqualInt((int)datasize, archive_entry_size(ae)); + } + assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a)); + assertEqualInt(ARCHIVE_OK, archive_read_free(a)); + + /* + * Test various premature shutdown scenarios to make sure we + * don't crash or leak memory. + */ + assert((a = archive_write_new()) != NULL); + if (use_prog) + assertEqualIntA(a, ARCHIVE_WARN, + archive_write_add_filter_bzip2(a)); + else + assertEqualIntA(a, ARCHIVE_OK, + archive_write_add_filter_bzip2(a)); + assertEqualInt(ARCHIVE_OK, archive_write_free(a)); + + assert((a = archive_write_new()) != NULL); + if (use_prog) + assertEqualIntA(a, ARCHIVE_WARN, + archive_write_add_filter_bzip2(a)); + else + assertEqualIntA(a, ARCHIVE_OK, + archive_write_add_filter_bzip2(a)); + assertEqualInt(ARCHIVE_OK, archive_write_close(a)); + assertEqualInt(ARCHIVE_OK, archive_write_free(a)); + + assert((a = archive_write_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_write_set_format_ustar(a)); + if (use_prog) + assertEqualIntA(a, ARCHIVE_WARN, + archive_write_add_filter_bzip2(a)); + else + assertEqualIntA(a, ARCHIVE_OK, + archive_write_add_filter_bzip2(a)); + assertEqualInt(ARCHIVE_OK, archive_write_close(a)); + assertEqualInt(ARCHIVE_OK, archive_write_free(a)); + + assert((a = archive_write_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_write_set_format_ustar(a)); + if (use_prog) + assertEqualIntA(a, ARCHIVE_WARN, + archive_write_add_filter_bzip2(a)); + else + assertEqualIntA(a, ARCHIVE_OK, + archive_write_add_filter_bzip2(a)); + assertEqualIntA(a, ARCHIVE_OK, + archive_write_open_memory(a, buff, buffsize, &used2)); + assertEqualInt(ARCHIVE_OK, archive_write_close(a)); + assertEqualInt(ARCHIVE_OK, archive_write_free(a)); + + /* + * Clean up. + */ + free(data); + free(buff); +} diff --git a/libarchive/test/test_write_filter_compress.c b/libarchive/test/test_write_filter_compress.c new file mode 100644 index 000000000000..1b8910e51adb --- /dev/null +++ b/libarchive/test/test_write_filter_compress.c @@ -0,0 +1,97 @@ +/*- + * Copyright (c) 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 + * 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" +__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. + * + * TODO: Add a reference file and make sure we can decompress that. + */ + +DEFINE_TEST(test_write_filter_compress) +{ + struct archive_entry *ae; + struct archive* a; + char *buff, *data; + size_t buffsize, datasize; + char path[16]; + size_t used; + int i; + + buffsize = 1000000; + assert(NULL != (buff = (char *)malloc(buffsize))); + + datasize = 10000; + assert(NULL != (data = (char *)malloc(datasize))); + memset(data, 0, datasize); + + assert((a = archive_write_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, + archive_write_set_format_ustar(a)); + assertEqualIntA(a, ARCHIVE_OK, + archive_write_add_filter_compress(a)); + assertEqualIntA(a, ARCHIVE_OK, + archive_write_open_memory(a, buff, buffsize, &used)); + + for (i = 0; i < 100; i++) { + sprintf(path, "file%03d", i); + assert((ae = archive_entry_new()) != NULL); + archive_entry_copy_pathname(ae, path); + archive_entry_set_size(ae, datasize); + archive_entry_set_filetype(ae, AE_IFREG); + assertEqualIntA(a, ARCHIVE_OK, archive_write_header(a, ae)); + assertEqualInt(datasize, + archive_write_data(a, data, datasize)); + archive_entry_free(ae); + } + + assertEqualIntA(a, ARCHIVE_OK, archive_write_close(a)); + assertEqualInt(ARCHIVE_OK, archive_write_free(a)); + + /* + * Now, read the data back. + */ + assert((a = archive_read_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_support_filter_all(a)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_open_memory(a, buff, used)); + + + for (i = 0; i < 100; i++) { + sprintf(path, "file%03d", i); + if (!assertEqualInt(0, archive_read_next_header(a, &ae))) + break; + assertEqualString(path, archive_entry_pathname(ae)); + assertEqualInt((int)datasize, archive_entry_size(ae)); + } + assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a)); + assertEqualInt(ARCHIVE_OK, archive_read_free(a)); + + free(data); + free(buff); +} diff --git a/libarchive/test/test_write_filter_gzip.c b/libarchive/test/test_write_filter_gzip.c new file mode 100644 index 000000000000..7bbdb1232a97 --- /dev/null +++ b/libarchive/test/test_write_filter_gzip.c @@ -0,0 +1,272 @@ +/*- + * Copyright (c) 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 + * 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" +__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. + * + * TODO: Add a reference file and make sure we can decompress that. + */ + +DEFINE_TEST(test_write_filter_gzip) +{ + struct archive_entry *ae; + struct archive* a; + char *buff, *data; + size_t buffsize, datasize; + char path[16]; + size_t used1, used2; + int i, r, use_prog = 0; + + buffsize = 2000000; + assert(NULL != (buff = (char *)malloc(buffsize))); + if (buff == NULL) + return; + + datasize = 10000; + assert(NULL != (data = (char *)malloc(datasize))); + if (data == NULL) { + free(buff); + return; + } + memset(data, 0, datasize); + + /* + * Write a 100 files and read them all back. + */ + assert((a = archive_write_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_write_set_format_ustar(a)); + r = archive_write_add_filter_gzip(a); + if (r != ARCHIVE_OK) { + if (canGzip() && r == ARCHIVE_WARN) + use_prog = 1; + else { + skipping("gzip writing not supported on this platform"); + assertEqualInt(ARCHIVE_OK, archive_write_free(a)); + free(buff); + free(data); + return; + } + } + assertEqualIntA(a, ARCHIVE_OK, + archive_write_set_bytes_per_block(a, 10)); + assertEqualInt(ARCHIVE_FILTER_GZIP, archive_filter_code(a, 0)); + assertEqualString("gzip", archive_filter_name(a, 0)); + assertEqualIntA(a, ARCHIVE_OK, + archive_write_open_memory(a, buff, buffsize, &used1)); + assert((ae = archive_entry_new()) != NULL); + archive_entry_set_filetype(ae, AE_IFREG); + archive_entry_set_size(ae, datasize); + for (i = 0; i < 100; i++) { + sprintf(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)); + } + archive_entry_free(ae); + assertEqualIntA(a, ARCHIVE_OK, archive_write_close(a)); + assertEqualInt(ARCHIVE_OK, archive_write_free(a)); + + assert((a = archive_read_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a)); + r = archive_read_support_filter_gzip(a); + if (r == ARCHIVE_WARN) { + skipping("Can't verify gzip writing by reading back;" + " gzip reading not fully supported on this platform"); + } else { + assertEqualIntA(a, ARCHIVE_OK, + archive_read_open_memory(a, buff, used1)); + for (i = 0; i < 100; i++) { + sprintf(path, "file%03d", i); + if (!assertEqualInt(ARCHIVE_OK, + archive_read_next_header(a, &ae))) + break; + assertEqualString(path, archive_entry_pathname(ae)); + assertEqualInt((int)datasize, archive_entry_size(ae)); + } + assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a)); + } + assertEqualInt(ARCHIVE_OK, archive_read_free(a)); + + /* + * Repeat the cycle again, this time setting some compression + * options. + */ + assert((a = archive_write_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_write_set_format_ustar(a)); + assertEqualIntA(a, ARCHIVE_OK, + archive_write_set_bytes_per_block(a, 10)); + assertEqualIntA(a, (use_prog)?ARCHIVE_WARN:ARCHIVE_OK, + archive_write_add_filter_gzip(a)); + assertEqualIntA(a, ARCHIVE_FAILED, + archive_write_set_options(a, "gzip:nonexistent-option=0")); + assertEqualIntA(a, ARCHIVE_OK, + archive_write_set_options(a, "gzip:compression-level=1")); + assertEqualIntA(a, ARCHIVE_OK, + archive_write_set_filter_option(a, NULL, "compression-level", "9")); + assertEqualIntA(a, ARCHIVE_FAILED, + archive_write_set_filter_option(a, NULL, "compression-level", "abc")); + assertEqualIntA(a, ARCHIVE_FAILED, + archive_write_set_filter_option(a, NULL, "compression-level", "99")); + assertEqualIntA(a, ARCHIVE_OK, + 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); + assert((ae = archive_entry_new()) != NULL); + archive_entry_copy_pathname(ae, path); + archive_entry_set_size(ae, datasize); + archive_entry_set_filetype(ae, AE_IFREG); + assertEqualIntA(a, ARCHIVE_OK, archive_write_header(a, ae)); + assertA(datasize == (size_t)archive_write_data(a, data, datasize)); + archive_entry_free(ae); + } + assertEqualIntA(a, ARCHIVE_OK, archive_write_close(a)); + assertEqualInt(ARCHIVE_OK, archive_write_free(a)); + + /* Curiously, this test fails; the test data above compresses + * better at default compression than at level 9. */ + /* + failure("compression-level=9 wrote %d bytes, default wrote %d bytes", + (int)used2, (int)used1); + assert(used2 < used1); + */ + + assert((a = archive_read_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a)); + r = archive_read_support_filter_gzip(a); + if (r != ARCHIVE_OK && !use_prog) { + skipping("gzip reading not fully supported on this platform"); + } else { + 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 < 100; i++) { + sprintf(path, "file%03d", i); + if (!assertEqualInt(ARCHIVE_OK, + archive_read_next_header(a, &ae))) + break; + assertEqualString(path, archive_entry_pathname(ae)); + assertEqualInt((int)datasize, archive_entry_size(ae)); + } + assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a)); + } + assertEqualInt(ARCHIVE_OK, archive_read_free(a)); + + /* + * Repeat again, with much lower compression. + */ + assert((a = archive_write_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_write_set_format_ustar(a)); + assertEqualIntA(a, ARCHIVE_OK, + archive_write_set_bytes_per_block(a, 10)); + assertEqualIntA(a, (use_prog)?ARCHIVE_WARN:ARCHIVE_OK, + archive_write_add_filter_gzip(a)); + assertEqualIntA(a, ARCHIVE_OK, + archive_write_set_filter_option(a, NULL, "compression-level", "1")); + assertEqualIntA(a, ARCHIVE_OK, + archive_write_open_memory(a, buff, buffsize, &used2)); + for (i = 0; i < 100; i++) { + sprintf(path, "file%03d", i); + assert((ae = archive_entry_new()) != NULL); + archive_entry_copy_pathname(ae, path); + archive_entry_set_size(ae, datasize); + archive_entry_set_filetype(ae, AE_IFREG); + assertEqualIntA(a, ARCHIVE_OK, archive_write_header(a, ae)); + failure("Writing file %s", path); + assertEqualIntA(a, datasize, + (size_t)archive_write_data(a, data, datasize)); + archive_entry_free(ae); + } + assertEqualIntA(a, ARCHIVE_OK, archive_write_close(a)); + assertEqualInt(ARCHIVE_OK, archive_write_free(a)); + + /* Level 1 really does result in larger data. */ + failure("Compression-level=1 wrote %d bytes; default wrote %d bytes", + (int)used2, (int)used1); + assert(used2 > used1); + + assert((a = archive_read_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_support_filter_all(a)); + r = archive_read_support_filter_gzip(a); + if (r == ARCHIVE_WARN) { + skipping("gzip reading not fully supported on this platform"); + } else { + assertEqualIntA(a, ARCHIVE_OK, + archive_read_open_memory(a, buff, used2)); + for (i = 0; i < 100; i++) { + sprintf(path, "file%03d", i); + if (!assertEqualInt(ARCHIVE_OK, + archive_read_next_header(a, &ae))) + break; + assertEqualString(path, archive_entry_pathname(ae)); + assertEqualInt((int)datasize, archive_entry_size(ae)); + } + assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a)); + } + assertEqualInt(ARCHIVE_OK, archive_read_free(a)); + + /* + * Test various premature shutdown scenarios to make sure we + * don't crash or leak memory. + */ + assert((a = archive_write_new()) != NULL); + assertEqualIntA(a, (use_prog)?ARCHIVE_WARN:ARCHIVE_OK, + archive_write_add_filter_gzip(a)); + assertEqualInt(ARCHIVE_OK, archive_write_free(a)); + + assert((a = archive_write_new()) != NULL); + assertEqualIntA(a, (use_prog)?ARCHIVE_WARN:ARCHIVE_OK, + archive_write_add_filter_gzip(a)); + assertEqualInt(ARCHIVE_OK, archive_write_close(a)); + assertEqualInt(ARCHIVE_OK, archive_write_free(a)); + + assert((a = archive_write_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_write_set_format_ustar(a)); + assertEqualIntA(a, (use_prog)?ARCHIVE_WARN:ARCHIVE_OK, + archive_write_add_filter_gzip(a)); + assertEqualInt(ARCHIVE_OK, archive_write_close(a)); + assertEqualInt(ARCHIVE_OK, archive_write_free(a)); + + assert((a = archive_write_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_write_set_format_ustar(a)); + assertEqualIntA(a, (use_prog)?ARCHIVE_WARN:ARCHIVE_OK, + archive_write_add_filter_gzip(a)); + assertEqualIntA(a, ARCHIVE_OK, archive_write_open_memory(a, buff, buffsize, &used2)); + assertEqualInt(ARCHIVE_OK, archive_write_close(a)); + assertEqualInt(ARCHIVE_OK, archive_write_free(a)); + + /* + * Clean up. + */ + free(data); + free(buff); +} diff --git a/libarchive/test/test_write_filter_gzip_timestamp.c b/libarchive/test/test_write_filter_gzip_timestamp.c new file mode 100644 index 000000000000..23b11dba79a6 --- /dev/null +++ b/libarchive/test/test_write_filter_gzip_timestamp.c @@ -0,0 +1,118 @@ +/*- + * Copyright (c) 2007 Tim Kientzle + * Copyright (c) 2012 Michihiro NAKAJIMA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer + * 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" +__FBSDID("$FreeBSD$"); + +DEFINE_TEST(test_write_filter_gzip_timestamp) +{ + struct archive_entry *ae; + struct archive* a; + char *buff, *data; + size_t buffsize, datasize; + size_t used1; + int r, use_prog = 0; + + buffsize = 10000; + assert(NULL != (buff = (char *)malloc(buffsize))); + if (buff == NULL) + return; + + datasize = 10000; + assert(NULL != (data = (char *)malloc(datasize))); + if (data == NULL) { + free(buff); + return; + } + memset(data, 0, datasize); + + /* Test1: set "gzip:timestamp" option. */ + assert((a = archive_write_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_write_set_format_ustar(a)); + r = archive_write_add_filter_gzip(a); + if (r != ARCHIVE_OK) { + if (canGzip() && r == ARCHIVE_WARN) + use_prog = 1; + else { + skipping("gzip writing not supported on this platform"); + assertEqualInt(ARCHIVE_OK, archive_write_free(a)); + free(buff); + free(data); + return; + } + } + assertEqualIntA(a, ARCHIVE_OK, + archive_write_set_options(a, "gzip:timestamp")); + assertEqualIntA(a, ARCHIVE_OK, + archive_write_set_bytes_per_block(a, 10)); + assertEqualInt(ARCHIVE_FILTER_GZIP, archive_filter_code(a, 0)); + assertEqualString("gzip", archive_filter_name(a, 0)); + assertEqualIntA(a, ARCHIVE_OK, + archive_write_open_memory(a, buff, buffsize, &used1)); + assert((ae = archive_entry_new()) != NULL); + archive_entry_set_filetype(ae, AE_IFREG); + archive_entry_set_size(ae, datasize); + archive_entry_copy_pathname(ae, "file"); + assertEqualIntA(a, ARCHIVE_OK, archive_write_header(a, ae)); + assertEqualIntA(a, datasize, archive_write_data(a, data, datasize)); + archive_entry_free(ae); + assertEqualIntA(a, ARCHIVE_OK, archive_write_close(a)); + assertEqualInt(ARCHIVE_OK, archive_write_free(a)); + failure("Timestamp should be recorded"); + assert(memcmp(buff + 4, "\x00\x00\x00\x00", 4) != 0); + + /* Test2: set "gzip:!timestamp" option. */ + assert((a = archive_write_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_write_set_format_ustar(a)); + assertEqualIntA(a, (use_prog)?ARCHIVE_WARN:ARCHIVE_OK, + archive_write_add_filter_gzip(a)); + assertEqualIntA(a, ARCHIVE_OK, + archive_write_set_options(a, "gzip:!timestamp")); + assertEqualIntA(a, ARCHIVE_OK, + archive_write_set_bytes_per_block(a, 10)); + assertEqualInt(ARCHIVE_FILTER_GZIP, archive_filter_code(a, 0)); + assertEqualString("gzip", archive_filter_name(a, 0)); + assertEqualIntA(a, ARCHIVE_OK, + archive_write_open_memory(a, buff, buffsize, &used1)); + assert((ae = archive_entry_new()) != NULL); + archive_entry_set_filetype(ae, AE_IFREG); + archive_entry_set_size(ae, datasize); + archive_entry_copy_pathname(ae, "file"); + assertEqualIntA(a, ARCHIVE_OK, archive_write_header(a, ae)); + assertEqualIntA(a, datasize, archive_write_data(a, data, datasize)); + archive_entry_free(ae); + assertEqualIntA(a, ARCHIVE_OK, archive_write_close(a)); + assertEqualInt(ARCHIVE_OK, archive_write_free(a)); + failure("Timestamp should not be recorded"); + assertEqualMem(buff + 4, "\x00\x00\x00\x00", 4); + + /* + * Clean up. + */ + free(data); + free(buff); +} diff --git a/libarchive/test/test_write_filter_lrzip.c b/libarchive/test/test_write_filter_lrzip.c new file mode 100644 index 000000000000..f28c8358363d --- /dev/null +++ b/libarchive/test/test_write_filter_lrzip.c @@ -0,0 +1,131 @@ +/*- + * Copyright (c) 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 + * 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" + +/* + * A basic exercise of lrzip reading and writing. + */ + +DEFINE_TEST(test_write_filter_lrzip) +{ + struct archive_entry *ae; + struct archive* a; + char *buff, *data; + size_t buffsize, datasize; + char path[16]; + size_t used1, used2; + int i; + + if (!canLrzip()) { + skipping("lrzip command-line program not found"); + return; + } + + buffsize = 2000000; + assert(NULL != (buff = (char *)malloc(buffsize))); + + datasize = 10000; + assert(NULL != (data = (char *)malloc(datasize))); + memset(data, 0, datasize); + + /* + * Write 100 files and read them all back. + */ + assert((a = archive_write_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_write_set_format_gnutar(a)); + assertEqualIntA(a, ARCHIVE_WARN, archive_write_add_filter_lrzip(a)); + assertEqualIntA(a, ARCHIVE_OK, + archive_write_set_bytes_per_block(a, 10)); + assertEqualInt(ARCHIVE_FILTER_LRZIP, archive_filter_code(a, 0)); + assertEqualString("lrzip", archive_filter_name(a, 0)); + assertEqualIntA(a, ARCHIVE_OK, + archive_write_open_memory(a, buff, buffsize, &used1)); + assert((ae = archive_entry_new()) != NULL); + archive_entry_set_filetype(ae, AE_IFREG); + archive_entry_set_size(ae, datasize); + for (i = 0; i < 100; i++) { + sprintf(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)); + } + archive_entry_free(ae); + assertEqualIntA(a, ARCHIVE_OK, archive_write_close(a)); + assertEqualInt(ARCHIVE_OK, archive_write_free(a)); + + assert((a = archive_read_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a)); + assertEqualIntA(a, ARCHIVE_WARN, archive_read_support_filter_lrzip(a)); + assertEqualIntA(a, ARCHIVE_OK, + archive_read_open_memory(a, buff, used1)); + for (i = 0; i < 100; i++) { + sprintf(path, "file%03d", i); + if (!assertEqualInt(ARCHIVE_OK, + archive_read_next_header(a, &ae))) + break; + assertEqualString(path, archive_entry_pathname(ae)); + assertEqualInt((int)datasize, archive_entry_size(ae)); + } + assertEqualInt(ARCHIVE_FILTER_LRZIP, archive_filter_code(a, 0)); + assertEqualString("lrzip", archive_filter_name(a, 0)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a)); + assertEqualInt(ARCHIVE_OK, archive_read_free(a)); + + /* + * Test various premature shutdown scenarios to make sure we + * don't crash or leak memory. + */ + assert((a = archive_write_new()) != NULL); + assertEqualIntA(a, ARCHIVE_WARN, archive_write_add_filter_lrzip(a)); + assertEqualInt(ARCHIVE_OK, archive_write_free(a)); + + assert((a = archive_write_new()) != NULL); + assertEqualIntA(a, ARCHIVE_WARN, archive_write_add_filter_lrzip(a)); + assertEqualInt(ARCHIVE_OK, archive_write_close(a)); + assertEqualInt(ARCHIVE_OK, archive_write_free(a)); + + assert((a = archive_write_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_write_set_format_ustar(a)); + assertEqualIntA(a, ARCHIVE_WARN, archive_write_add_filter_lrzip(a)); + assertEqualInt(ARCHIVE_OK, archive_write_close(a)); + assertEqualInt(ARCHIVE_OK, archive_write_free(a)); + + assert((a = archive_write_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_write_set_format_ustar(a)); + assertEqualIntA(a, ARCHIVE_WARN, archive_write_add_filter_lrzip(a)); + assertEqualIntA(a, ARCHIVE_OK, + archive_write_open_memory(a, buff, buffsize, &used2)); + assertEqualInt(ARCHIVE_OK, archive_write_close(a)); + assertEqualInt(ARCHIVE_OK, archive_write_free(a)); + + /* + * Clean up. + */ + free(data); + free(buff); +} diff --git a/libarchive/test/test_write_filter_lzip.c b/libarchive/test/test_write_filter_lzip.c new file mode 100644 index 000000000000..145a3084d3de --- /dev/null +++ b/libarchive/test/test_write_filter_lzip.c @@ -0,0 +1,255 @@ +/*- + * Copyright (c) 2010 Michihiro NAKAJIMA + * Copyright (c) 2007-2009 Tim Kientzle + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer + * 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" +__FBSDID("$FreeBSD$"); + +/* + * A basic exercise of lzip reading and writing. + * + */ + +DEFINE_TEST(test_write_filter_lzip) +{ + struct archive_entry *ae; + struct archive* a; + char *buff, *data; + size_t buffsize, datasize; + char path[16]; + size_t used1, used2; + int i, r; + + buffsize = 2000000; + assert(NULL != (buff = (char *)malloc(buffsize))); + if (buff == NULL) + return; + + datasize = 10000; + assert(NULL != (data = (char *)malloc(datasize))); + if (data == NULL) { + free(buff); + return; + } + memset(data, 0, datasize); + + /* + * Write a 100 files and read them all back. + */ + assert((a = archive_write_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_write_set_format_ustar(a)); + r = archive_write_add_filter_lzip(a); + if (r == ARCHIVE_FATAL) { + skipping("lzip writing not supported on this platform"); + assertEqualInt(ARCHIVE_OK, archive_write_free(a)); + free(buff); + free(data); + return; + } + assertEqualIntA(a, ARCHIVE_OK, + archive_write_set_bytes_per_block(a, 10)); + assertEqualInt(ARCHIVE_FILTER_LZIP, archive_filter_code(a, 0)); + assertEqualString("lzip", archive_filter_name(a, 0)); + assertEqualIntA(a, ARCHIVE_OK, + archive_write_open_memory(a, buff, buffsize, &used1)); + assertEqualInt(ARCHIVE_FILTER_LZIP, archive_filter_code(a, 0)); + assertEqualString("lzip", archive_filter_name(a, 0)); + assert((ae = archive_entry_new()) != NULL); + archive_entry_set_filetype(ae, AE_IFREG); + archive_entry_set_size(ae, datasize); + for (i = 0; i < 100; i++) { + sprintf(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)); + } + archive_entry_free(ae); + assertEqualIntA(a, ARCHIVE_OK, archive_write_close(a)); + assertEqualInt(ARCHIVE_OK, archive_write_free(a)); + + assert((a = archive_read_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a)); + r = archive_read_support_filter_lzip(a); + if (r == ARCHIVE_WARN) { + skipping("Can't verify lzip writing by reading back;" + " lzip reading not fully supported on this platform"); + } else { + 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 < 100; i++) { + sprintf(path, "file%03d", i); + if (!assertEqualInt(ARCHIVE_OK, + archive_read_next_header(a, &ae))) + break; + assertEqualString(path, archive_entry_pathname(ae)); + assertEqualInt((int)datasize, archive_entry_size(ae)); + } + assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a)); + } + assertEqualInt(ARCHIVE_OK, archive_read_free(a)); + + /* + * Repeat the cycle again, this time setting some compression + * options. + */ + assert((a = archive_write_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_write_set_format_ustar(a)); + assertEqualIntA(a, ARCHIVE_OK, + archive_write_set_bytes_per_block(a, 10)); + assertEqualIntA(a, ARCHIVE_OK, archive_write_add_filter_lzip(a)); + assertEqualIntA(a, ARCHIVE_FAILED, + archive_write_set_filter_option(a, NULL, "nonexistent-option", "0")); + assertEqualIntA(a, ARCHIVE_FAILED, + archive_write_set_filter_option(a, NULL, "compression-level", "abc")); + assertEqualIntA(a, ARCHIVE_FAILED, + archive_write_set_filter_option(a, NULL, "compression-level", "99")); + assertEqualIntA(a, ARCHIVE_OK, + 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); + assert((ae = archive_entry_new()) != NULL); + archive_entry_copy_pathname(ae, path); + archive_entry_set_size(ae, datasize); + archive_entry_set_filetype(ae, AE_IFREG); + assertEqualIntA(a, ARCHIVE_OK, archive_write_header(a, ae)); + assertA(datasize == (size_t)archive_write_data(a, data, datasize)); + archive_entry_free(ae); + } + assertEqualIntA(a, ARCHIVE_OK, archive_write_close(a)); + assertEqualInt(ARCHIVE_OK, archive_write_free(a)); + + + assert((a = archive_read_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a)); + r = archive_read_support_filter_lzip(a); + if (r == ARCHIVE_WARN) { + skipping("lzip reading not fully supported on this platform"); + } else { + 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 < 100; i++) { + sprintf(path, "file%03d", i); + failure("Trying to read %s", path); + if (!assertEqualIntA(a, ARCHIVE_OK, + archive_read_next_header(a, &ae))) + break; + assertEqualString(path, archive_entry_pathname(ae)); + assertEqualInt((int)datasize, archive_entry_size(ae)); + } + assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a)); + } + assertEqualInt(ARCHIVE_OK, archive_read_free(a)); + + /* + * Repeat again, with much lower compression. + */ + assert((a = archive_write_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_write_set_format_ustar(a)); + assertEqualIntA(a, ARCHIVE_OK, + archive_write_set_bytes_per_block(a, 10)); + assertEqualIntA(a, ARCHIVE_OK, archive_write_add_filter_lzip(a)); + assertEqualIntA(a, ARCHIVE_OK, + 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); + assert((ae = archive_entry_new()) != NULL); + archive_entry_copy_pathname(ae, path); + archive_entry_set_size(ae, datasize); + archive_entry_set_filetype(ae, AE_IFREG); + assertEqualIntA(a, ARCHIVE_OK, archive_write_header(a, ae)); + failure("Writing file %s", path); + assertEqualIntA(a, datasize, + (size_t)archive_write_data(a, data, datasize)); + archive_entry_free(ae); + } + assertEqualIntA(a, ARCHIVE_OK, archive_write_close(a)); + assertEqualInt(ARCHIVE_OK, archive_write_free(a)); + + /* Level 0 really does result in larger data. */ + failure("Compression-level=0 wrote %d bytes; default wrote %d bytes", + (int)used2, (int)used1); + assert(used2 > used1); + + assert((a = archive_read_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_support_filter_all(a)); + r = archive_read_support_filter_lzip(a); + if (r == ARCHIVE_WARN) { + skipping("lzip reading not fully supported on this platform"); + } else { + assertEqualIntA(a, ARCHIVE_OK, + archive_read_open_memory(a, buff, used2)); + for (i = 0; i < 100; i++) { + sprintf(path, "file%03d", i); + if (!assertEqualInt(ARCHIVE_OK, + archive_read_next_header(a, &ae))) + break; + assertEqualString(path, archive_entry_pathname(ae)); + assertEqualInt((int)datasize, archive_entry_size(ae)); + } + assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a)); + } + assertEqualInt(ARCHIVE_OK, archive_read_free(a)); + + /* + * Test various premature shutdown scenarios to make sure we + * don't crash or leak memory. + */ + assert((a = archive_write_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_write_add_filter_lzip(a)); + assertEqualInt(ARCHIVE_OK, archive_write_free(a)); + + assert((a = archive_write_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_write_add_filter_lzip(a)); + assertEqualInt(ARCHIVE_OK, archive_write_close(a)); + assertEqualInt(ARCHIVE_OK, archive_write_free(a)); + + assert((a = archive_write_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_write_set_format_ustar(a)); + assertEqualIntA(a, ARCHIVE_OK, archive_write_add_filter_lzip(a)); + assertEqualInt(ARCHIVE_OK, archive_write_close(a)); + assertEqualInt(ARCHIVE_OK, archive_write_free(a)); + + assert((a = archive_write_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_write_set_format_ustar(a)); + assertEqualIntA(a, ARCHIVE_OK, archive_write_add_filter_lzip(a)); + assertEqualIntA(a, ARCHIVE_OK, archive_write_open_memory(a, buff, buffsize, &used2)); + assertEqualInt(ARCHIVE_OK, archive_write_close(a)); + assertEqualInt(ARCHIVE_OK, archive_write_free(a)); + + /* + * Clean up. + */ + free(data); + free(buff); +} diff --git a/libarchive/test/test_write_filter_lzma.c b/libarchive/test/test_write_filter_lzma.c new file mode 100644 index 000000000000..68e489832504 --- /dev/null +++ b/libarchive/test/test_write_filter_lzma.c @@ -0,0 +1,259 @@ +/*- + * Copyright (c) 2007-2009 Tim Kientzle + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer + * 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" +__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. + * + */ + +DEFINE_TEST(test_write_filter_lzma) +{ + struct archive_entry *ae; + struct archive* a; + char *buff, *data; + size_t buffsize, datasize; + char path[16]; + size_t used1, used2; + int i, r; + + buffsize = 2000000; + assert(NULL != (buff = (char *)malloc(buffsize))); + if (buff == NULL) + return; + + datasize = 10000; + assert(NULL != (data = (char *)malloc(datasize))); + if (data == NULL) { + free(buff); + return; + } + memset(data, 0, datasize); + + /* + * Write a 100 files and read them all back. + */ + assert((a = archive_write_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_write_set_format_ustar(a)); + r = archive_write_add_filter_lzma(a); + if (r == ARCHIVE_FATAL) { + skipping("lzma writing not supported on this platform"); + assertEqualInt(ARCHIVE_OK, archive_write_free(a)); + free(buff); + free(data); + return; + } + assertEqualIntA(a, ARCHIVE_OK, + archive_write_set_bytes_per_block(a, 10)); + assertEqualInt(ARCHIVE_FILTER_LZMA, archive_filter_code(a, 0)); + assertEqualString("lzma", archive_filter_name(a, 0)); + assertEqualIntA(a, ARCHIVE_OK, + archive_write_open_memory(a, buff, buffsize, &used1)); + assertEqualInt(ARCHIVE_FILTER_LZMA, archive_filter_code(a, 0)); + assertEqualString("lzma", archive_filter_name(a, 0)); + assert((ae = archive_entry_new()) != NULL); + archive_entry_set_filetype(ae, AE_IFREG); + archive_entry_set_size(ae, datasize); + for (i = 0; i < 100; i++) { + sprintf(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)); + } + archive_entry_free(ae); + assertEqualIntA(a, ARCHIVE_OK, archive_write_close(a)); + assertEqualInt(ARCHIVE_OK, archive_write_free(a)); + + assert((a = archive_read_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a)); + r = archive_read_support_filter_lzma(a); + if (r == ARCHIVE_WARN) { + skipping("Can't verify lzma writing by reading back;" + " lzma reading not fully supported on this platform"); + } else { + 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 < 100; i++) { + sprintf(path, "file%03d", i); + if (!assertEqualInt(ARCHIVE_OK, + archive_read_next_header(a, &ae))) + break; + assertEqualString(path, archive_entry_pathname(ae)); + assertEqualInt((int)datasize, archive_entry_size(ae)); + } + assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a)); + } + assertEqualInt(ARCHIVE_OK, archive_read_free(a)); + + /* + * Repeat the cycle again, this time setting some compression + * options. + */ + assert((a = archive_write_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_write_set_format_ustar(a)); + assertEqualIntA(a, ARCHIVE_OK, + archive_write_set_bytes_per_block(a, 10)); + assertEqualIntA(a, ARCHIVE_OK, archive_write_add_filter_lzma(a)); + assertEqualIntA(a, ARCHIVE_FAILED, + archive_write_set_filter_option(a, NULL, "nonexistent-option", "0")); + assertEqualIntA(a, ARCHIVE_FAILED, + archive_write_set_filter_option(a, NULL, "compression-level", "abc")); + assertEqualIntA(a, ARCHIVE_FAILED, + archive_write_set_filter_option(a, NULL, "compression-level", "99")); + assertEqualIntA(a, ARCHIVE_OK, + 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); + assert((ae = archive_entry_new()) != NULL); + archive_entry_copy_pathname(ae, path); + archive_entry_set_size(ae, datasize); + archive_entry_set_filetype(ae, AE_IFREG); + assertEqualIntA(a, ARCHIVE_OK, archive_write_header(a, ae)); + assertA(datasize == (size_t)archive_write_data(a, data, datasize)); + archive_entry_free(ae); + } + assertEqualIntA(a, ARCHIVE_OK, archive_write_close(a)); + assertEqualInt(ARCHIVE_OK, archive_write_free(a)); + + + assert((a = archive_read_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a)); + r = archive_read_support_filter_lzma(a); + if (r == ARCHIVE_WARN) { + skipping("lzma reading not fully supported on this platform"); + } else { + 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 < 100; i++) { + sprintf(path, "file%03d", i); + failure("Trying to read %s", path); + if (!assertEqualIntA(a, ARCHIVE_OK, + archive_read_next_header(a, &ae))) + break; + assertEqualString(path, archive_entry_pathname(ae)); + assertEqualInt((int)datasize, archive_entry_size(ae)); + } + assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a)); + } + assertEqualInt(ARCHIVE_OK, archive_read_free(a)); + + /* + * Repeat again, with much lower compression. + */ + assert((a = archive_write_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_write_set_format_ustar(a)); + assertEqualIntA(a, ARCHIVE_OK, + archive_write_set_bytes_per_block(a, 10)); + assertEqualIntA(a, ARCHIVE_OK, archive_write_add_filter_lzma(a)); + assertEqualIntA(a, ARCHIVE_OK, + 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); + assert((ae = archive_entry_new()) != NULL); + archive_entry_copy_pathname(ae, path); + archive_entry_set_size(ae, datasize); + archive_entry_set_filetype(ae, AE_IFREG); + assertEqualIntA(a, ARCHIVE_OK, archive_write_header(a, ae)); + failure("Writing file %s", path); + assertEqualIntA(a, datasize, + (size_t)archive_write_data(a, data, datasize)); + archive_entry_free(ae); + } + assertEqualIntA(a, ARCHIVE_OK, archive_write_close(a)); + assertEqualInt(ARCHIVE_OK, archive_write_free(a)); + + /* It would be nice to assert that compression-level=0 produced + * consistently larger/smaller results than the default compression, + * but the results here vary a lot depending on the version of liblzma + * being used. */ + /* + failure("Compression-level=0 wrote %d bytes; default wrote %d bytes", + (int)used2, (int)used1); + assert(used2 > used1); + */ + + assert((a = archive_read_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_support_filter_all(a)); + r = archive_read_support_filter_lzma(a); + if (r == ARCHIVE_WARN) { + skipping("lzma reading not fully supported on this platform"); + } else { + assertEqualIntA(a, ARCHIVE_OK, + archive_read_open_memory(a, buff, used2)); + for (i = 0; i < 100; i++) { + sprintf(path, "file%03d", i); + if (!assertEqualInt(ARCHIVE_OK, + archive_read_next_header(a, &ae))) + break; + assertEqualString(path, archive_entry_pathname(ae)); + assertEqualInt((int)datasize, archive_entry_size(ae)); + } + assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a)); + } + assertEqualInt(ARCHIVE_OK, archive_read_free(a)); + + /* + * Test various premature shutdown scenarios to make sure we + * don't crash or leak memory. + */ + assert((a = archive_write_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_write_add_filter_lzma(a)); + assertEqualInt(ARCHIVE_OK, archive_write_free(a)); + + assert((a = archive_write_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_write_add_filter_lzma(a)); + assertEqualInt(ARCHIVE_OK, archive_write_close(a)); + assertEqualInt(ARCHIVE_OK, archive_write_free(a)); + + assert((a = archive_write_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_write_set_format_ustar(a)); + assertEqualIntA(a, ARCHIVE_OK, archive_write_add_filter_lzma(a)); + assertEqualInt(ARCHIVE_OK, archive_write_close(a)); + assertEqualInt(ARCHIVE_OK, archive_write_free(a)); + + assert((a = archive_write_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_write_set_format_ustar(a)); + assertEqualIntA(a, ARCHIVE_OK, archive_write_add_filter_lzma(a)); + assertEqualIntA(a, ARCHIVE_OK, archive_write_open_memory(a, buff, buffsize, &used2)); + assertEqualInt(ARCHIVE_OK, archive_write_close(a)); + assertEqualInt(ARCHIVE_OK, archive_write_free(a)); + + /* + * Clean up. + */ + free(data); + free(buff); +} diff --git a/libarchive/test/test_write_filter_lzop.c b/libarchive/test/test_write_filter_lzop.c new file mode 100644 index 000000000000..9e840bd5cae6 --- /dev/null +++ b/libarchive/test/test_write_filter_lzop.c @@ -0,0 +1,267 @@ +/*- + * Copyright (c) 2012 Michihiro NAKAJIMA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer + * 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" +__FBSDID("$FreeBSD$"); + +/* + * A basic exercise of lzop reading and writing. + */ + +DEFINE_TEST(test_write_filter_lzop) +{ + struct archive_entry *ae; + struct archive* a; + char *buff, *data; + size_t buffsize, datasize; + char path[16]; + size_t used1, used2; + int i, r, use_prog = 0; + + assert((a = archive_write_new()) != NULL); + r = archive_write_add_filter_lzop(a); + if (r != ARCHIVE_OK) { + if (canLzop() && r == ARCHIVE_WARN) + use_prog = 1; + else { + skipping("lzop writing not supported on this platform"); + assertEqualInt(ARCHIVE_OK, archive_write_free(a)); + return; + } + } + + buffsize = 2000000; + assert(NULL != (buff = (char *)malloc(buffsize))); + + datasize = 10000; + assert(NULL != (data = (char *)calloc(1, datasize))); + + /* + * Write a 100 files and read them all back. + */ + assert((a = archive_write_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_write_set_format_ustar(a)); + assertEqualIntA(a, (use_prog)?ARCHIVE_WARN:ARCHIVE_OK, + archive_write_add_filter_lzop(a)); + assertEqualIntA(a, ARCHIVE_OK, + archive_write_set_bytes_per_block(a, 1024)); + assertEqualIntA(a, ARCHIVE_OK, + archive_write_set_bytes_in_last_block(a, 1024)); + assertEqualInt(ARCHIVE_FILTER_LZOP, archive_filter_code(a, 0)); + assertEqualString("lzop", archive_filter_name(a, 0)); + assertEqualIntA(a, ARCHIVE_OK, + archive_write_open_memory(a, buff, buffsize, &used1)); + assert((ae = archive_entry_new()) != NULL); + archive_entry_set_filetype(ae, AE_IFREG); + archive_entry_set_size(ae, datasize); + for (i = 0; i < 100; i++) { + sprintf(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)); + } + archive_entry_free(ae); + assertEqualIntA(a, ARCHIVE_OK, archive_write_close(a)); + assertEqualInt(ARCHIVE_OK, archive_write_free(a)); + + assert((a = archive_read_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a)); + r = archive_read_support_filter_lzop(a); + if (r == ARCHIVE_WARN) { + skipping("Can't verify lzop writing by reading back;" + " lzop reading not fully supported on this platform"); + } else { + assertEqualIntA(a, ARCHIVE_OK, + archive_read_open_memory(a, buff, used1)); + for (i = 0; i < 100; i++) { + sprintf(path, "file%03d", i); + if (!assertEqualInt(ARCHIVE_OK, + archive_read_next_header(a, &ae))) + break; + assertEqualString(path, archive_entry_pathname(ae)); + assertEqualInt((int)datasize, archive_entry_size(ae)); + } + assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a)); + } + assertEqualInt(ARCHIVE_OK, archive_read_free(a)); + + /* + * Repeat the cycle again, this time setting some compression + * options. + */ + assert((a = archive_write_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_write_set_format_ustar(a)); + assertEqualIntA(a, ARCHIVE_OK, + archive_write_set_bytes_per_block(a, 10)); + assertEqualIntA(a, (use_prog)?ARCHIVE_WARN:ARCHIVE_OK, + archive_write_add_filter_lzop(a)); + assertEqualIntA(a, ARCHIVE_FAILED, + archive_write_set_options(a, "lzop:nonexistent-option=0")); + assertEqualIntA(a, ARCHIVE_OK, + archive_write_set_options(a, "lzop:compression-level=1")); + assertEqualIntA(a, ARCHIVE_OK, + archive_write_set_filter_option(a, NULL, "compression-level", "9")); + assertEqualIntA(a, ARCHIVE_FAILED, + archive_write_set_filter_option(a, NULL, "compression-level", "abc")); + assertEqualIntA(a, ARCHIVE_FAILED, + archive_write_set_filter_option(a, NULL, "compression-level", "99")); + assertEqualIntA(a, ARCHIVE_OK, + archive_write_set_options(a, "lzop: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); + assert((ae = archive_entry_new()) != NULL); + archive_entry_copy_pathname(ae, path); + archive_entry_set_size(ae, datasize); + archive_entry_set_filetype(ae, AE_IFREG); + assertEqualIntA(a, ARCHIVE_OK, archive_write_header(a, ae)); + assertA(datasize == (size_t)archive_write_data( + a, data, datasize)); + archive_entry_free(ae); + } + assertEqualIntA(a, ARCHIVE_OK, archive_write_close(a)); + assertEqualInt(ARCHIVE_OK, archive_write_free(a)); + + failure("compression-level=9 wrote %d bytes, default wrote %d bytes", + (int)used2, (int)used1); + assert(used2 < used1); + + assert((a = archive_read_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a)); + r = archive_read_support_filter_lzop(a); + if (r != ARCHIVE_OK && !use_prog) { + skipping("lzop reading not fully supported on this platform"); + } else { + 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 < 100; i++) { + sprintf(path, "file%03d", i); + if (!assertEqualInt(ARCHIVE_OK, + archive_read_next_header(a, &ae))) + break; + assertEqualString(path, archive_entry_pathname(ae)); + assertEqualInt((int)datasize, archive_entry_size(ae)); + } + assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a)); + } + assertEqualInt(ARCHIVE_OK, archive_read_free(a)); + + /* + * Repeat again, with much lower compression. + */ + assert((a = archive_write_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_write_set_format_ustar(a)); + assertEqualIntA(a, ARCHIVE_OK, + archive_write_set_bytes_per_block(a, 10)); + assertEqualIntA(a, (use_prog)?ARCHIVE_WARN:ARCHIVE_OK, + archive_write_add_filter_lzop(a)); + assertEqualIntA(a, ARCHIVE_OK, + archive_write_set_filter_option(a, NULL, "compression-level", "1")); + assertEqualIntA(a, ARCHIVE_OK, + archive_write_open_memory(a, buff, buffsize, &used2)); + for (i = 0; i < 100; i++) { + sprintf(path, "file%03d", i); + assert((ae = archive_entry_new()) != NULL); + archive_entry_copy_pathname(ae, path); + archive_entry_set_size(ae, datasize); + archive_entry_set_filetype(ae, AE_IFREG); + assertEqualIntA(a, ARCHIVE_OK, archive_write_header(a, ae)); + failure("Writing file %s", path); + assertEqualIntA(a, datasize, + (size_t)archive_write_data(a, data, datasize)); + archive_entry_free(ae); + } + assertEqualIntA(a, ARCHIVE_OK, archive_write_close(a)); + assertEqualInt(ARCHIVE_OK, archive_write_free(a)); + +#if 0 + failure("Compression-level=1 wrote %d bytes; default wrote %d bytes", + (int)used2, (int)used1); + assert(used2 > used1); +#endif + + assert((a = archive_read_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_support_filter_all(a)); + r = archive_read_support_filter_lzop(a); + if (r == ARCHIVE_WARN) { + skipping("lzop reading not fully supported on this platform"); + } else { + assertEqualIntA(a, ARCHIVE_OK, + archive_read_open_memory(a, buff, used2)); + for (i = 0; i < 100; i++) { + sprintf(path, "file%03d", i); + if (!assertEqualInt(ARCHIVE_OK, + archive_read_next_header(a, &ae))) + break; + assertEqualString(path, archive_entry_pathname(ae)); + assertEqualInt((int)datasize, archive_entry_size(ae)); + } + assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a)); + } + assertEqualInt(ARCHIVE_OK, archive_read_free(a)); + + /* + * Test various premature shutdown scenarios to make sure we + * don't crash or leak memory. + */ + assert((a = archive_write_new()) != NULL); + assertEqualIntA(a, (use_prog)?ARCHIVE_WARN:ARCHIVE_OK, + archive_write_add_filter_lzop(a)); + assertEqualInt(ARCHIVE_OK, archive_write_free(a)); + + assert((a = archive_write_new()) != NULL); + assertEqualIntA(a, (use_prog)?ARCHIVE_WARN:ARCHIVE_OK, + archive_write_add_filter_lzop(a)); + assertEqualInt(ARCHIVE_OK, archive_write_close(a)); + assertEqualInt(ARCHIVE_OK, archive_write_free(a)); + + assert((a = archive_write_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_write_set_format_ustar(a)); + assertEqualIntA(a, (use_prog)?ARCHIVE_WARN:ARCHIVE_OK, + archive_write_add_filter_lzop(a)); + assertEqualInt(ARCHIVE_OK, archive_write_close(a)); + assertEqualInt(ARCHIVE_OK, archive_write_free(a)); + + assert((a = archive_write_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_write_set_format_ustar(a)); + assertEqualIntA(a, (use_prog)?ARCHIVE_WARN:ARCHIVE_OK, + archive_write_add_filter_lzop(a)); + assertEqualIntA(a, ARCHIVE_OK, + archive_write_open_memory(a, buff, buffsize, &used2)); + assertEqualInt(ARCHIVE_OK, archive_write_close(a)); + assertEqualInt(ARCHIVE_OK, archive_write_free(a)); + + /* + * Clean up. + */ + free(data); + free(buff); +} diff --git a/libarchive/test/test_write_filter_program.c b/libarchive/test/test_write_filter_program.c new file mode 100644 index 000000000000..c156b6d55d1e --- /dev/null +++ b/libarchive/test/test_write_filter_program.c @@ -0,0 +1,124 @@ +/*- + * Copyright (c) 2003-2007 Tim Kientzle + * Copyright (c) 2012 Michihiro NAKAJIMA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#include "test.h" +__FBSDID("$FreeBSD: head/lib/libarchive/test/test_write_compress_program.c 201247 2009-12-30 05:59:21Z kientzle $"); + +char buff[1000000]; +char buff2[64]; + +DEFINE_TEST(test_write_filter_program) +{ + struct archive_entry *ae; + struct archive *a; + size_t used; + int blocksize = 1024; + int r; + + if (!canGzip()) { + skipping("Cannot run 'gzip'"); + return; + } + /* NOTE: Setting blocksize=1024 will cause gunzip failure because + * it add extra bytes that gunzip ignores with its warning and + * exit code 1. So we should set blocksize=1 in order not to + * yield the extra bytes when using gunzip. */ + assert((a = archive_read_new()) != NULL); + r = archive_read_support_filter_gzip(a); + if (r != ARCHIVE_OK && canGzip()) + blocksize = 1; + assertEqualInt(ARCHIVE_OK, archive_read_free(a)); + + /* Create a new archive in memory. */ + /* Write it through an external "gzip" program. */ + assert((a = archive_write_new()) != NULL); + assertA(0 == archive_write_set_format_ustar(a)); + r = archive_write_add_filter_program(a, "gzip -6"); + if (r == ARCHIVE_FATAL) { + skipping("Write compression via external " + "program unsupported on this platform"); + archive_write_free(a); + return; + } + assertA(0 == archive_write_set_bytes_per_block(a, blocksize)); + assertA(0 == archive_write_set_bytes_in_last_block(a, blocksize)); + assertA(blocksize == archive_write_get_bytes_in_last_block(a)); + assertA(0 == archive_write_open_memory(a, buff, sizeof(buff), &used)); + assertA(blocksize == archive_write_get_bytes_in_last_block(a)); + + /* + * Write a file to it. + */ + assert((ae = archive_entry_new()) != NULL); + archive_entry_set_mtime(ae, 1, 10); + archive_entry_copy_pathname(ae, "file"); + archive_entry_set_mode(ae, S_IFREG | 0755); + archive_entry_set_size(ae, 8); + + assertA(0 == archive_write_header(a, ae)); + archive_entry_free(ae); + assertA(8 == archive_write_data(a, "12345678", 9)); + + /* Close out the archive. */ + assertEqualIntA(a, ARCHIVE_OK, archive_write_close(a)); + assertEqualInt(ARCHIVE_OK, archive_write_free(a)); + + /* + * Now, read the data back through the built-in gzip support. + */ + assert((a = archive_read_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_support_filter_all(a)); + r = archive_read_support_filter_gzip(a); + /* The compression_gzip() handler will fall back to gunzip + * automatically, but if we know gunzip isn't available, then + * skip the rest. */ + if (r != ARCHIVE_OK && !canGzip()) { + skipping("No libz and no gunzip program, " + "unable to verify gzip compression"); + assertEqualInt(ARCHIVE_OK, archive_read_free(a)); + return; + } + assertEqualIntA(a, ARCHIVE_OK, archive_read_open_memory(a, buff, used)); + + if (!assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae))) { + archive_read_free(a); + return; + } + + assertEqualInt(1, archive_entry_mtime(ae)); + assertEqualInt(0, archive_entry_atime(ae)); + assertEqualInt(0, archive_entry_ctime(ae)); + assertEqualString("file", archive_entry_pathname(ae)); + assertEqualInt((S_IFREG | 0755), archive_entry_mode(ae)); + assertEqualInt(8, archive_entry_size(ae)); + assertEqualIntA(a, 8, archive_read_data(a, buff2, 10)); + assertEqualMem(buff2, "12345678", 8); + + /* Verify the end of the archive. */ + assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a)); + assertEqualInt(ARCHIVE_OK, archive_read_free(a)); +} diff --git a/libarchive/test/test_write_filter_uuencode.c b/libarchive/test/test_write_filter_uuencode.c new file mode 100644 index 000000000000..57a4b49bd2a6 --- /dev/null +++ b/libarchive/test/test_write_filter_uuencode.c @@ -0,0 +1,173 @@ +/*- + * Copyright (c) 2012 Michihiro NAKAJIMA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer + * 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" +__FBSDID("$FreeBSD$"); + +/* + * A basic exercise of uuencode reading and writing. + */ + +DEFINE_TEST(test_write_filter_uuencode) +{ + struct archive_entry *ae; + struct archive* a; + char *buff, *data; + size_t buffsize, datasize; + char path[16]; + size_t used1, used2; + int i; + + buffsize = 2000000; + assert(NULL != (buff = (char *)malloc(buffsize))); + + datasize = 10000; + assert(NULL != (data = (char *)malloc(datasize))); + memset(data, 0, datasize); + + /* + * Write a 100 files and read them all back. + */ + assert((a = archive_write_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_write_set_format_ustar(a)); + assertEqualIntA(a, ARCHIVE_OK, archive_write_add_filter_uuencode(a)); + assertEqualIntA(a, ARCHIVE_OK, + archive_write_set_bytes_per_block(a, 10)); + assertEqualInt(ARCHIVE_FILTER_UU, archive_filter_code(a, 0)); + assertEqualString("uuencode", archive_filter_name(a, 0)); + assertEqualIntA(a, ARCHIVE_OK, + archive_write_open_memory(a, buff, buffsize, &used1)); + for (i = 0; i < 99; i++) { + assert((ae = archive_entry_new()) != NULL); + archive_entry_set_filetype(ae, AE_IFREG); + archive_entry_set_size(ae, datasize); + sprintf(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)); + archive_entry_free(ae); + } + assertEqualIntA(a, ARCHIVE_OK, archive_write_close(a)); + assertEqualInt(ARCHIVE_OK, archive_write_free(a)); + + assert((a = archive_read_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a)); + 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); + if (!assertEqualIntA(a, 0, archive_read_next_header(a, &ae))) + break; + assertEqualString(path, archive_entry_pathname(ae)); + assertEqualInt((int)datasize, archive_entry_size(ae)); + } + assertEqualInt(ARCHIVE_FILTER_UU, archive_filter_code(a, 0)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a)); + assertEqualInt(ARCHIVE_OK, archive_read_free(a)); + + /* + * Repeat the cycle again, this time setting name and mode + * options. + */ + assert((a = archive_write_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_write_set_format_ustar(a)); + assertEqualIntA(a, ARCHIVE_OK, + archive_write_set_bytes_per_block(a, 10)); + assertEqualIntA(a, ARCHIVE_OK, archive_write_add_filter_uuencode(a)); + assertEqualIntA(a, ARCHIVE_FAILED, + archive_write_set_filter_option(a, NULL, "nonexistent-option", "0")); + assertEqualIntA(a, ARCHIVE_FAILED, + archive_write_set_filter_option(a, NULL, "compression-level", "abc")); + assertEqualIntA(a, ARCHIVE_FAILED, + archive_write_set_filter_option(a, NULL, "compression-level", "99")); + assertEqualIntA(a, ARCHIVE_OK, + archive_write_set_filter_option(a, NULL, "name", "test.tar")); + assertEqualIntA(a, ARCHIVE_OK, + archive_write_set_filter_option(a, NULL, "mode", "0640")); + assertEqualIntA(a, ARCHIVE_OK, + archive_write_open_memory(a, buff, buffsize, &used2)); + for (i = 0; i < 99; i++) { + sprintf(path, "file%03d", i); + assert((ae = archive_entry_new()) != NULL); + archive_entry_copy_pathname(ae, path); + archive_entry_set_size(ae, datasize); + archive_entry_set_filetype(ae, AE_IFREG); + assertEqualIntA(a, ARCHIVE_OK, archive_write_header(a, ae)); + assertA(datasize == (size_t)archive_write_data(a, data, datasize)); + archive_entry_free(ae); + } + assertEqualIntA(a, ARCHIVE_OK, archive_write_close(a)); + assertEqualInt(ARCHIVE_OK, archive_write_free(a)); + + assert((a = archive_read_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a)); + 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); + if (!assertEqualInt(0, archive_read_next_header(a, &ae))) + break; + assertEqualString(path, archive_entry_pathname(ae)); + assertEqualInt((int)datasize, archive_entry_size(ae)); + } + assertEqualInt(ARCHIVE_FILTER_UU, archive_filter_code(a, 0)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a)); + assertEqualInt(ARCHIVE_OK, archive_read_free(a)); + + /* + * Test various premature shutdown scenarios to make sure we + * don't crash or leak memory. + */ + assert((a = archive_write_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_write_add_filter_uuencode(a)); + assertEqualInt(ARCHIVE_OK, archive_write_free(a)); + + assert((a = archive_write_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_write_add_filter_uuencode(a)); + assertEqualInt(ARCHIVE_OK, archive_write_close(a)); + assertEqualInt(ARCHIVE_OK, archive_write_free(a)); + + assert((a = archive_write_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_write_set_format_ustar(a)); + assertEqualIntA(a, ARCHIVE_OK, archive_write_add_filter_uuencode(a)); + assertEqualInt(ARCHIVE_OK, archive_write_close(a)); + assertEqualInt(ARCHIVE_OK, archive_write_free(a)); + + assert((a = archive_write_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_write_set_format_ustar(a)); + assertEqualIntA(a, ARCHIVE_OK, archive_write_add_filter_uuencode(a)); + assertEqualIntA(a, ARCHIVE_OK, + archive_write_open_memory(a, buff, buffsize, &used2)); + assertEqualInt(ARCHIVE_OK, archive_write_close(a)); + assertEqualInt(ARCHIVE_OK, archive_write_free(a)); + + /* + * Clean up. + */ + free(data); + free(buff); +} diff --git a/libarchive/test/test_write_filter_xz.c b/libarchive/test/test_write_filter_xz.c new file mode 100644 index 000000000000..bf1265c65b6f --- /dev/null +++ b/libarchive/test/test_write_filter_xz.c @@ -0,0 +1,265 @@ +/*- + * Copyright (c) 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 + * 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" +__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. + * + * TODO: Add a reference file and make sure we can decompress that. + */ + +DEFINE_TEST(test_write_filter_xz) +{ + struct archive_entry *ae; + struct archive* a; + char *buff, *data; + size_t buffsize, datasize; + char path[16]; + size_t used1, used2; + int i, r; + + buffsize = 2000000; + assert(NULL != (buff = (char *)malloc(buffsize))); + if (buff == NULL) + return; + + datasize = 10000; + assert(NULL != (data = (char *)malloc(datasize))); + if (data == NULL) { + free(buff); + return; + } + memset(data, 0, datasize); + + /* + * Write a 100 files and read them all back. + */ + assert((a = archive_write_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_write_set_format_ustar(a)); + r = archive_write_add_filter_xz(a); + if (r == ARCHIVE_FATAL) { + skipping("xz writing not supported on this platform"); + assertEqualInt(ARCHIVE_OK, archive_write_free(a)); + free(buff); + free(data); + return; + } + assertEqualIntA(a, ARCHIVE_OK, + archive_write_set_bytes_per_block(a, 10)); + assertEqualInt(ARCHIVE_FILTER_XZ, archive_filter_code(a, 0)); + assertEqualString("xz", archive_filter_name(a, 0)); + assertEqualIntA(a, ARCHIVE_OK, archive_write_open_memory(a, buff, buffsize, &used1)); + assertEqualInt(ARCHIVE_FILTER_XZ, archive_filter_code(a, 0)); + assertEqualString("xz", archive_filter_name(a, 0)); + assert((ae = archive_entry_new()) != NULL); + archive_entry_set_filetype(ae, AE_IFREG); + archive_entry_set_size(ae, datasize); + for (i = 0; i < 100; i++) { + sprintf(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)); + } + archive_entry_free(ae); + assertEqualIntA(a, ARCHIVE_OK, archive_write_close(a)); + assertEqualInt(ARCHIVE_OK, archive_write_free(a)); + + assert((a = archive_read_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a)); + r = archive_read_support_filter_xz(a); + if (r == ARCHIVE_WARN) { + skipping("Can't verify xz writing by reading back;" + " xz reading not fully supported on this platform"); + } else { + 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 < 100; i++) { + sprintf(path, "file%03d", i); + if (!assertEqualInt(ARCHIVE_OK, + archive_read_next_header(a, &ae))) + break; + assertEqualString(path, archive_entry_pathname(ae)); + assertEqualInt((int)datasize, archive_entry_size(ae)); + } + assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a)); + } + assertEqualInt(ARCHIVE_OK, archive_read_free(a)); + + /* + * Repeat the cycle again, this time setting some compression + * options. + */ + assert((a = archive_write_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_write_set_format_ustar(a)); + assertEqualIntA(a, ARCHIVE_OK, + archive_write_set_bytes_per_block(a, 10)); + assertEqualIntA(a, ARCHIVE_OK, archive_write_add_filter_xz(a)); + assertEqualIntA(a, ARCHIVE_FAILED, + archive_write_set_filter_option(a, NULL, "nonexistent-option", "0")); + assertEqualIntA(a, ARCHIVE_FAILED, + archive_write_set_filter_option(a, NULL, "compression-level", "abc")); + assertEqualIntA(a, ARCHIVE_FAILED, + archive_write_set_filter_option(a, NULL, "compression-level", "99")); + assertEqualIntA(a, ARCHIVE_OK, + 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); + assert((ae = archive_entry_new()) != NULL); + archive_entry_copy_pathname(ae, path); + archive_entry_set_size(ae, datasize); + archive_entry_set_filetype(ae, AE_IFREG); + assertEqualIntA(a, ARCHIVE_OK, archive_write_header(a, ae)); + assertA(datasize == (size_t)archive_write_data(a, data, datasize)); + archive_entry_free(ae); + } + assertEqualIntA(a, ARCHIVE_OK, archive_write_close(a)); + assertEqualInt(ARCHIVE_OK, archive_write_free(a)); + + /* Curiously, this test fails; the test data above compresses + * better at default compression than at level 9. */ + /* + failure("compression-level=9 wrote %d bytes, default wrote %d bytes", + (int)used2, (int)used1); + assert(used2 < used1); + */ + + assert((a = archive_read_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a)); + r = archive_read_support_filter_xz(a); + if (r == ARCHIVE_WARN) { + skipping("xz reading not fully supported on this platform"); + } else { + 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 < 100; i++) { + sprintf(path, "file%03d", i); + failure("Trying to read %s", path); + if (!assertEqualIntA(a, ARCHIVE_OK, + archive_read_next_header(a, &ae))) + break; + assertEqualString(path, archive_entry_pathname(ae)); + assertEqualInt((int)datasize, archive_entry_size(ae)); + } + assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a)); + } + assertEqualInt(ARCHIVE_OK, archive_read_free(a)); + + /* + * Repeat again, with much lower compression. + */ + assert((a = archive_write_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_write_set_format_ustar(a)); + assertEqualIntA(a, ARCHIVE_OK, + archive_write_set_bytes_per_block(a, 10)); + assertEqualIntA(a, ARCHIVE_OK, archive_write_add_filter_xz(a)); + assertEqualIntA(a, ARCHIVE_OK, + 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); + assert((ae = archive_entry_new()) != NULL); + archive_entry_copy_pathname(ae, path); + archive_entry_set_size(ae, datasize); + archive_entry_set_filetype(ae, AE_IFREG); + assertEqualIntA(a, ARCHIVE_OK, archive_write_header(a, ae)); + failure("Writing file %s", path); + assertEqualIntA(a, datasize, + (size_t)archive_write_data(a, data, datasize)); + archive_entry_free(ae); + } + assertEqualIntA(a, ARCHIVE_OK, archive_write_close(a)); + assertEqualInt(ARCHIVE_OK, archive_write_free(a)); + + /* I would like to assert that compression-level=0 results in + * larger data than the default compression, but that's not true + * for all versions of liblzma. */ + /* + failure("Compression-level=0 wrote %d bytes; default wrote %d bytes", + (int)used2, (int)used1); + assert(used2 > used1); + */ + + assert((a = archive_read_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_support_filter_all(a)); + r = archive_read_support_filter_xz(a); + if (r == ARCHIVE_WARN) { + skipping("xz reading not fully supported on this platform"); + } else { + assertEqualIntA(a, ARCHIVE_OK, + archive_read_open_memory(a, buff, used2)); + for (i = 0; i < 100; i++) { + sprintf(path, "file%03d", i); + if (!assertEqualInt(ARCHIVE_OK, + archive_read_next_header(a, &ae))) + break; + assertEqualString(path, archive_entry_pathname(ae)); + assertEqualInt((int)datasize, archive_entry_size(ae)); + } + assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a)); + } + assertEqualInt(ARCHIVE_OK, archive_read_free(a)); + + /* + * Test various premature shutdown scenarios to make sure we + * don't crash or leak memory. + */ + assert((a = archive_write_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_write_add_filter_xz(a)); + assertEqualInt(ARCHIVE_OK, archive_write_free(a)); + + assert((a = archive_write_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_write_add_filter_xz(a)); + assertEqualInt(ARCHIVE_OK, archive_write_close(a)); + assertEqualInt(ARCHIVE_OK, archive_write_free(a)); + + assert((a = archive_write_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_write_set_format_ustar(a)); + assertEqualIntA(a, ARCHIVE_OK, archive_write_add_filter_xz(a)); + assertEqualInt(ARCHIVE_OK, archive_write_close(a)); + assertEqualInt(ARCHIVE_OK, archive_write_free(a)); + + assert((a = archive_write_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_write_set_format_ustar(a)); + assertEqualIntA(a, ARCHIVE_OK, archive_write_add_filter_xz(a)); + assertEqualIntA(a, ARCHIVE_OK, archive_write_open_memory(a, buff, buffsize, &used2)); + assertEqualInt(ARCHIVE_OK, archive_write_close(a)); + assertEqualInt(ARCHIVE_OK, archive_write_free(a)); + + /* + * Clean up. + */ + free(data); + free(buff); +} diff --git a/libarchive/test/test_write_format_7zip.c b/libarchive/test/test_write_format_7zip.c index b0f0a68fb630..c8fdcd02cc84 100644 --- a/libarchive/test/test_write_format_7zip.c +++ b/libarchive/test/test_write_format_7zip.c @@ -51,7 +51,7 @@ test_basic(const char *compression_type) free(buff); return; } - assertEqualIntA(a, ARCHIVE_OK, archive_write_set_compression_none(a)); + assertEqualIntA(a, ARCHIVE_OK, archive_write_add_filter_none(a)); assertEqualIntA(a, ARCHIVE_OK, archive_write_open_memory(a, buff, buffsize, &used)); @@ -308,7 +308,7 @@ test_basic(const char *compression_type) assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae)); /* Verify archive format. */ - assertEqualIntA(a, ARCHIVE_COMPRESSION_NONE, archive_compression(a)); + assertEqualIntA(a, ARCHIVE_FILTER_NONE, archive_filter_code(a, 0)); assertEqualIntA(a, ARCHIVE_FORMAT_7ZIP, archive_format(a)); assertEqualInt(ARCHIVE_OK, archive_read_close(a)); @@ -341,7 +341,7 @@ test_basic2(const char *compression_type) free(buff); return; } - assertEqualIntA(a, ARCHIVE_OK, archive_write_set_compression_none(a)); + assertEqualIntA(a, ARCHIVE_OK, archive_write_add_filter_none(a)); assertEqualIntA(a, ARCHIVE_OK, archive_write_open_memory(a, buff, buffsize, &used)); @@ -515,272 +515,7 @@ test_basic2(const char *compression_type) assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae)); /* Verify archive format. */ - assertEqualIntA(a, ARCHIVE_COMPRESSION_NONE, archive_compression(a)); - assertEqualIntA(a, ARCHIVE_FORMAT_7ZIP, archive_format(a)); - - assertEqualInt(ARCHIVE_OK, archive_read_close(a)); - assertEqualInt(ARCHIVE_OK, archive_read_free(a)); - - free(buff); -} - -/* - * Test writing an empty archive. - */ -static void -test_empty_archive(void) -{ - struct archive *a; - size_t buffsize = 1000; - char *buff; - size_t used; - - buff = malloc(buffsize); - - /* Create a new archive in memory. */ - assert((a = archive_write_new()) != NULL); - assertEqualIntA(a, ARCHIVE_OK, archive_write_set_format_7zip(a)); - assertEqualIntA(a, ARCHIVE_OK, archive_write_set_compression_none(a)); - assertEqualIntA(a, ARCHIVE_OK, - archive_write_open_memory(a, buff, buffsize, &used)); - - /* Close out the archive. */ - assertEqualInt(ARCHIVE_OK, archive_write_close(a)); - assertEqualInt(ARCHIVE_OK, archive_write_free(a)); - - /* Verify the archive file size. */ - assertEqualInt(32, used); - - /* Verify the initial header. */ - assertEqualMem(buff, - "\x37\x7a\xbc\xaf\x27\x1c\x00\x03" - "\x8d\x9b\xd5\x0f\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00" - "\x00\x00\x00\x00\x00\x00\x00\x00", 32); - - free(buff); -} - -/* - * Test writing an empty file. - */ -static void -test_only_empty_file(void) -{ - struct archive *a; - struct archive_entry *ae; - size_t buffsize = 1000; - char *buff; - size_t used; - - buff = malloc(buffsize); - - /* Create a new archive in memory. */ - assert((a = archive_write_new()) != NULL); - assertEqualIntA(a, ARCHIVE_OK, archive_write_set_format_7zip(a)); - assertEqualIntA(a, ARCHIVE_OK, archive_write_set_compression_none(a)); - assertEqualIntA(a, ARCHIVE_OK, - archive_write_open_memory(a, buff, buffsize, &used)); - - /* - * Write an empty file to it. - */ - assert((ae = archive_entry_new()) != NULL); - archive_entry_set_mtime(ae, 1, 10); - assertEqualInt(1, archive_entry_mtime(ae)); - assertEqualInt(10, archive_entry_mtime_nsec(ae)); - archive_entry_set_atime(ae, 2, 20); - assertEqualInt(2, archive_entry_atime(ae)); - assertEqualInt(20, archive_entry_atime_nsec(ae)); - archive_entry_set_ctime(ae, 0, 100); - assertEqualInt(0, archive_entry_ctime(ae)); - assertEqualInt(100, archive_entry_ctime_nsec(ae)); - archive_entry_copy_pathname(ae, "empty"); - assertEqualString("empty", archive_entry_pathname(ae)); - archive_entry_set_mode(ae, AE_IFREG | 0755); - assertEqualInt((S_IFREG | 0755), archive_entry_mode(ae)); - - assertEqualInt(ARCHIVE_OK, archive_write_header(a, ae)); - archive_entry_free(ae); - - /* Close out the archive. */ - assertEqualInt(ARCHIVE_OK, archive_write_close(a)); - assertEqualInt(ARCHIVE_OK, archive_write_free(a)); - - /* Verify the archive file size. */ - assertEqualInt(102, used); - - /* Verify the initial header. */ - assertEqualMem(buff, - "\x37\x7a\xbc\xaf\x27\x1c\x00\x03" - "\x00\x5b\x58\x25\x00\x00\x00\x00" - "\x00\x00\x00\x00\x46\x00\x00\x00" - "\x00\x00\x00\x00\x8f\xce\x1d\xf3", 32); - - /* - * Now, read the data back. - */ - /* With the test memory reader -- seeking mode. */ - assert((a = archive_read_new()) != NULL); - assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a)); - assertEqualIntA(a, ARCHIVE_OK, archive_read_support_filter_all(a)); - assertEqualIntA(a, ARCHIVE_OK, read_open_memory_seek(a, buff, used, 7)); - - /* - * Read and verify an empty file. - */ - assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); - assertEqualInt(1, archive_entry_mtime(ae)); - assertEqualInt(0, archive_entry_mtime_nsec(ae)); - assertEqualInt(2, archive_entry_atime(ae)); - assertEqualInt(0, archive_entry_atime_nsec(ae)); - assertEqualInt(0, archive_entry_ctime(ae)); - assertEqualInt(100, archive_entry_ctime_nsec(ae)); - assertEqualString("empty", archive_entry_pathname(ae)); - assertEqualInt(AE_IFREG | 0755, archive_entry_mode(ae)); - assertEqualInt(0, archive_entry_size(ae)); - - /* Verify the end of the archive. */ - assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae)); - - /* Verify archive format. */ - assertEqualIntA(a, ARCHIVE_COMPRESSION_NONE, archive_compression(a)); - assertEqualIntA(a, ARCHIVE_FORMAT_7ZIP, archive_format(a)); - - assertEqualInt(ARCHIVE_OK, archive_read_close(a)); - assertEqualInt(ARCHIVE_OK, archive_read_free(a)); - - free(buff); -} - -static void -test_only_empty_files(void) -{ - struct archive *a; - struct archive_entry *ae; - size_t buffsize = 1000; - char *buff; - size_t used; - - buff = malloc(buffsize); - - /* Create a new archive in memory. */ - assert((a = archive_write_new()) != NULL); - assertEqualIntA(a, ARCHIVE_OK, archive_write_set_format_7zip(a)); - assertEqualIntA(a, ARCHIVE_OK, archive_write_set_compression_none(a)); - assertEqualIntA(a, ARCHIVE_OK, - archive_write_open_memory(a, buff, buffsize, &used)); - - /* - * Write an empty file to it. - */ - assert((ae = archive_entry_new()) != NULL); - archive_entry_set_mtime(ae, 1, 10); - assertEqualInt(1, archive_entry_mtime(ae)); - assertEqualInt(10, archive_entry_mtime_nsec(ae)); - archive_entry_set_atime(ae, 2, 20); - assertEqualInt(2, archive_entry_atime(ae)); - assertEqualInt(20, archive_entry_atime_nsec(ae)); - archive_entry_copy_pathname(ae, "empty"); - assertEqualString("empty", archive_entry_pathname(ae)); - archive_entry_set_mode(ae, AE_IFREG | 0755); - assertEqualInt((AE_IFREG | 0755), archive_entry_mode(ae)); - - assertEqualInt(ARCHIVE_OK, archive_write_header(a, ae)); - archive_entry_free(ae); - - /* - * Write second empty file to it. - */ - assert((ae = archive_entry_new()) != NULL); - archive_entry_set_mtime(ae, 2, 10); - assertEqualInt(2, archive_entry_mtime(ae)); - assertEqualInt(10, archive_entry_mtime_nsec(ae)); - archive_entry_set_ctime(ae, 2, 10); - assertEqualInt(2, archive_entry_ctime(ae)); - assertEqualInt(10, archive_entry_ctime_nsec(ae)); - archive_entry_copy_pathname(ae, "empty2"); - assertEqualString("empty2", archive_entry_pathname(ae)); - archive_entry_set_mode(ae, AE_IFREG | 0644); - assertEqualInt((AE_IFREG | 0644), archive_entry_mode(ae)); - - assertEqualInt(ARCHIVE_OK, archive_write_header(a, ae)); - archive_entry_free(ae); - - /* - * Write third empty file to it. - */ - assert((ae = archive_entry_new()) != NULL); - archive_entry_set_mtime(ae, 3, 10); - assertEqualInt(3, archive_entry_mtime(ae)); - assertEqualInt(10, archive_entry_mtime_nsec(ae)); - archive_entry_copy_pathname(ae, "empty3"); - assertEqualString("empty3", archive_entry_pathname(ae)); - archive_entry_set_mode(ae, AE_IFREG | 0644); - assertEqualInt((AE_IFREG | 0644), archive_entry_mode(ae)); - - assertEqualInt(ARCHIVE_OK, archive_write_header(a, ae)); - archive_entry_free(ae); - - /* Close out the archive. */ - assertEqualInt(ARCHIVE_OK, archive_write_close(a)); - assertEqualInt(ARCHIVE_OK, archive_write_free(a)); - - /* Verify the initial header. */ - assertEqualMem(buff, "\x37\x7a\xbc\xaf\x27\x1c\x00\x03", 8); - - /* - * Now, read the data back. - */ - /* With the test memory reader -- seeking mode. */ - assert((a = archive_read_new()) != NULL); - assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a)); - assertEqualIntA(a, ARCHIVE_OK, archive_read_support_filter_all(a)); - assertEqualIntA(a, ARCHIVE_OK, read_open_memory_seek(a, buff, used, 7)); - - /* - * Read and verify an empty file. - */ - assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); - assertEqualInt(1, archive_entry_mtime(ae)); - assertEqualInt(0, archive_entry_mtime_nsec(ae)); - assertEqualInt(2, archive_entry_atime(ae)); - assertEqualInt(0, archive_entry_atime_nsec(ae)); - assertEqualInt(0, archive_entry_ctime(ae)); - assertEqualString("empty", archive_entry_pathname(ae)); - assertEqualInt(AE_IFREG | 0755, archive_entry_mode(ae)); - assertEqualInt(0, archive_entry_size(ae)); - - /* - * Read and verify second empty file. - */ - assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); - assertEqualInt(2, archive_entry_mtime(ae)); - assertEqualInt(0, archive_entry_mtime_nsec(ae)); - assertEqualInt(0, archive_entry_atime(ae)); - assertEqualInt(2, archive_entry_ctime(ae)); - assertEqualInt(0, archive_entry_ctime_nsec(ae)); - assertEqualString("empty2", archive_entry_pathname(ae)); - assertEqualInt(AE_IFREG | 0644, archive_entry_mode(ae)); - assertEqualInt(0, archive_entry_size(ae)); - - /* - * Read and verify third empty file. - */ - assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); - assertEqualInt(3, archive_entry_mtime(ae)); - assertEqualInt(0, archive_entry_mtime_nsec(ae)); - assertEqualInt(0, archive_entry_atime(ae)); - assertEqualInt(0, archive_entry_ctime(ae)); - assertEqualString("empty3", archive_entry_pathname(ae)); - assertEqualInt(AE_IFREG | 0644, archive_entry_mode(ae)); - assertEqualInt(0, archive_entry_size(ae)); - - /* Verify the end of the archive. */ - assertEqualIntA(a, ARCHIVE_EOF, archive_read_next_header(a, &ae)); - - /* Verify archive format. */ - assertEqualIntA(a, ARCHIVE_COMPRESSION_NONE, archive_compression(a)); + assertEqualIntA(a, ARCHIVE_FILTER_NONE, archive_filter_code(a, 0)); assertEqualIntA(a, ARCHIVE_FORMAT_7ZIP, archive_format(a)); assertEqualInt(ARCHIVE_OK, archive_read_close(a)); @@ -794,23 +529,42 @@ DEFINE_TEST(test_write_format_7zip) /* Test that making a 7-Zip archive file by default compression * in whatever compressions are supported on the running platform. */ test_basic(NULL); - /* Test that making a 7-Zip archive file without compression. */ - test_basic("copy"); - /* Test that making a 7-Zip archive file with deflate compression. */ - test_basic("deflate"); - /* Test that making a 7-Zip archive file with bzip2 compression. */ - test_basic("bzip2"); - /* Test that making a 7-Zip archive file with lzma1 compression. */ - test_basic("lzma1"); - /* Test that making a 7-Zip archive file with lzma2 compression. */ - test_basic("lzma2"); - /* Test that making a 7-Zip archive file with PPMd compression. */ - test_basic("ppmd"); /* Test that making a 7-Zip archive file without empty files. */ test_basic2(NULL); - /* Test that making an empty 7-Zip archive file. */ - test_empty_archive(); - /* Test that write an empty file. */ - test_only_empty_file(); - test_only_empty_files(); +} + +DEFINE_TEST(test_write_format_7zip_basic_bzip2) +{ + /* Test that making a 7-Zip archive file with bzip2 compression. */ + test_basic("bzip2"); +} + +DEFINE_TEST(test_write_format_7zip_basic_copy) +{ + /* Test that making a 7-Zip archive file without compression. */ + test_basic("copy"); +} + +DEFINE_TEST(test_write_format_7zip_basic_deflate) +{ + /* Test that making a 7-Zip archive file with deflate compression. */ + test_basic("deflate"); +} + +DEFINE_TEST(test_write_format_7zip_basic_lzma1) +{ + /* Test that making a 7-Zip archive file with lzma1 compression. */ + test_basic("lzma1"); +} + +DEFINE_TEST(test_write_format_7zip_basic_lzma2) +{ + /* Test that making a 7-Zip archive file with lzma2 compression. */ + test_basic("lzma2"); +} + +DEFINE_TEST(test_write_format_7zip_basic_ppmd) +{ + /* Test that making a 7-Zip archive file with PPMd compression. */ + test_basic("ppmd"); } diff --git a/libarchive/test/test_write_format_7zip_empty.c b/libarchive/test/test_write_format_7zip_empty.c new file mode 100644 index 000000000000..9a503e9d6bac --- /dev/null +++ b/libarchive/test/test_write_format_7zip_empty.c @@ -0,0 +1,299 @@ +/*- + * Copyright (c) 2011-2012 Michihiro NAKAJIMA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + + +#include "test.h" +__FBSDID("$FreeBSD$"); + +/* + * Test writing an empty archive. + */ +DEFINE_TEST(test_write_format_7zip_empty_archive) +{ + struct archive *a; + size_t buffsize = 1000; + char *buff; + size_t used; + + buff = malloc(buffsize); + + /* Create a new archive in memory. */ + assert((a = archive_write_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_write_set_format_7zip(a)); + assertEqualIntA(a, ARCHIVE_OK, archive_write_add_filter_none(a)); + assertEqualIntA(a, ARCHIVE_OK, + archive_write_open_memory(a, buff, buffsize, &used)); + + /* Close out the archive. */ + assertEqualInt(ARCHIVE_OK, archive_write_close(a)); + assertEqualInt(ARCHIVE_OK, archive_write_free(a)); + + /* Verify the archive file size. */ + assertEqualInt(32, used); + + /* Verify the initial header. */ + assertEqualMem(buff, + "\x37\x7a\xbc\xaf\x27\x1c\x00\x03" + "\x8d\x9b\xd5\x0f\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00" + "\x00\x00\x00\x00\x00\x00\x00\x00", 32); + + free(buff); +} + +/* + * Test writing an empty file. + */ +static void +test_only_empty_file(void) +{ + struct archive *a; + struct archive_entry *ae; + size_t buffsize = 1000; + char *buff; + size_t used; + + buff = malloc(buffsize); + + /* Create a new archive in memory. */ + assert((a = archive_write_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_write_set_format_7zip(a)); + assertEqualIntA(a, ARCHIVE_OK, archive_write_add_filter_none(a)); + assertEqualIntA(a, ARCHIVE_OK, + archive_write_open_memory(a, buff, buffsize, &used)); + + /* + * Write an empty file to it. + */ + assert((ae = archive_entry_new()) != NULL); + archive_entry_set_mtime(ae, 1, 10); + assertEqualInt(1, archive_entry_mtime(ae)); + assertEqualInt(10, archive_entry_mtime_nsec(ae)); + archive_entry_set_atime(ae, 2, 20); + assertEqualInt(2, archive_entry_atime(ae)); + assertEqualInt(20, archive_entry_atime_nsec(ae)); + archive_entry_set_ctime(ae, 0, 100); + assertEqualInt(0, archive_entry_ctime(ae)); + assertEqualInt(100, archive_entry_ctime_nsec(ae)); + archive_entry_copy_pathname(ae, "empty"); + assertEqualString("empty", archive_entry_pathname(ae)); + archive_entry_set_mode(ae, AE_IFREG | 0755); + assertEqualInt((S_IFREG | 0755), archive_entry_mode(ae)); + + assertEqualInt(ARCHIVE_OK, archive_write_header(a, ae)); + archive_entry_free(ae); + + /* Close out the archive. */ + assertEqualInt(ARCHIVE_OK, archive_write_close(a)); + assertEqualInt(ARCHIVE_OK, archive_write_free(a)); + + /* Verify the archive file size. */ + assertEqualInt(102, used); + + /* Verify the initial header. */ + assertEqualMem(buff, + "\x37\x7a\xbc\xaf\x27\x1c\x00\x03" + "\x00\x5b\x58\x25\x00\x00\x00\x00" + "\x00\x00\x00\x00\x46\x00\x00\x00" + "\x00\x00\x00\x00\x8f\xce\x1d\xf3", 32); + + /* + * Now, read the data back. + */ + /* With the test memory reader -- seeking mode. */ + assert((a = archive_read_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_support_filter_all(a)); + assertEqualIntA(a, ARCHIVE_OK, read_open_memory_seek(a, buff, used, 7)); + + /* + * Read and verify an empty file. + */ + assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); + assertEqualInt(1, archive_entry_mtime(ae)); + assertEqualInt(0, archive_entry_mtime_nsec(ae)); + assertEqualInt(2, archive_entry_atime(ae)); + assertEqualInt(0, archive_entry_atime_nsec(ae)); + assertEqualInt(0, archive_entry_ctime(ae)); + assertEqualInt(100, archive_entry_ctime_nsec(ae)); + assertEqualString("empty", archive_entry_pathname(ae)); + assertEqualInt(AE_IFREG | 0755, archive_entry_mode(ae)); + assertEqualInt(0, archive_entry_size(ae)); + + /* Verify the end of the 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)); + + assertEqualInt(ARCHIVE_OK, archive_read_close(a)); + assertEqualInt(ARCHIVE_OK, archive_read_free(a)); + + free(buff); +} + +static void +test_only_empty_files(void) +{ + struct archive *a; + struct archive_entry *ae; + size_t buffsize = 1000; + char *buff; + size_t used; + + buff = malloc(buffsize); + + /* Create a new archive in memory. */ + assert((a = archive_write_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_write_set_format_7zip(a)); + assertEqualIntA(a, ARCHIVE_OK, archive_write_add_filter_none(a)); + assertEqualIntA(a, ARCHIVE_OK, + archive_write_open_memory(a, buff, buffsize, &used)); + + /* + * Write an empty file to it. + */ + assert((ae = archive_entry_new()) != NULL); + archive_entry_set_mtime(ae, 1, 10); + assertEqualInt(1, archive_entry_mtime(ae)); + assertEqualInt(10, archive_entry_mtime_nsec(ae)); + archive_entry_set_atime(ae, 2, 20); + assertEqualInt(2, archive_entry_atime(ae)); + assertEqualInt(20, archive_entry_atime_nsec(ae)); + archive_entry_copy_pathname(ae, "empty"); + assertEqualString("empty", archive_entry_pathname(ae)); + archive_entry_set_mode(ae, AE_IFREG | 0755); + assertEqualInt((AE_IFREG | 0755), archive_entry_mode(ae)); + + assertEqualInt(ARCHIVE_OK, archive_write_header(a, ae)); + archive_entry_free(ae); + + /* + * Write second empty file to it. + */ + assert((ae = archive_entry_new()) != NULL); + archive_entry_set_mtime(ae, 2, 10); + assertEqualInt(2, archive_entry_mtime(ae)); + assertEqualInt(10, archive_entry_mtime_nsec(ae)); + archive_entry_set_ctime(ae, 2, 10); + assertEqualInt(2, archive_entry_ctime(ae)); + assertEqualInt(10, archive_entry_ctime_nsec(ae)); + archive_entry_copy_pathname(ae, "empty2"); + assertEqualString("empty2", archive_entry_pathname(ae)); + archive_entry_set_mode(ae, AE_IFREG | 0644); + assertEqualInt((AE_IFREG | 0644), archive_entry_mode(ae)); + + assertEqualInt(ARCHIVE_OK, archive_write_header(a, ae)); + archive_entry_free(ae); + + /* + * Write third empty file to it. + */ + assert((ae = archive_entry_new()) != NULL); + archive_entry_set_mtime(ae, 3, 10); + assertEqualInt(3, archive_entry_mtime(ae)); + assertEqualInt(10, archive_entry_mtime_nsec(ae)); + archive_entry_copy_pathname(ae, "empty3"); + assertEqualString("empty3", archive_entry_pathname(ae)); + archive_entry_set_mode(ae, AE_IFREG | 0644); + assertEqualInt((AE_IFREG | 0644), archive_entry_mode(ae)); + + assertEqualInt(ARCHIVE_OK, archive_write_header(a, ae)); + archive_entry_free(ae); + + /* Close out the archive. */ + assertEqualInt(ARCHIVE_OK, archive_write_close(a)); + assertEqualInt(ARCHIVE_OK, archive_write_free(a)); + + /* Verify the initial header. */ + assertEqualMem(buff, "\x37\x7a\xbc\xaf\x27\x1c\x00\x03", 8); + + /* + * Now, read the data back. + */ + /* With the test memory reader -- seeking mode. */ + assert((a = archive_read_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_support_filter_all(a)); + assertEqualIntA(a, ARCHIVE_OK, read_open_memory_seek(a, buff, used, 7)); + + /* + * Read and verify an empty file. + */ + assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); + assertEqualInt(1, archive_entry_mtime(ae)); + assertEqualInt(0, archive_entry_mtime_nsec(ae)); + assertEqualInt(2, archive_entry_atime(ae)); + assertEqualInt(0, archive_entry_atime_nsec(ae)); + assertEqualInt(0, archive_entry_ctime(ae)); + assertEqualString("empty", archive_entry_pathname(ae)); + assertEqualInt(AE_IFREG | 0755, archive_entry_mode(ae)); + assertEqualInt(0, archive_entry_size(ae)); + + /* + * Read and verify second empty file. + */ + assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); + assertEqualInt(2, archive_entry_mtime(ae)); + assertEqualInt(0, archive_entry_mtime_nsec(ae)); + assertEqualInt(0, archive_entry_atime(ae)); + assertEqualInt(2, archive_entry_ctime(ae)); + assertEqualInt(0, archive_entry_ctime_nsec(ae)); + assertEqualString("empty2", archive_entry_pathname(ae)); + assertEqualInt(AE_IFREG | 0644, archive_entry_mode(ae)); + assertEqualInt(0, archive_entry_size(ae)); + + /* + * Read and verify third empty file. + */ + assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); + assertEqualInt(3, archive_entry_mtime(ae)); + assertEqualInt(0, archive_entry_mtime_nsec(ae)); + assertEqualInt(0, archive_entry_atime(ae)); + assertEqualInt(0, archive_entry_ctime(ae)); + assertEqualString("empty3", archive_entry_pathname(ae)); + assertEqualInt(AE_IFREG | 0644, archive_entry_mode(ae)); + assertEqualInt(0, archive_entry_size(ae)); + + /* Verify the end of the 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)); + + assertEqualInt(ARCHIVE_OK, archive_read_close(a)); + assertEqualInt(ARCHIVE_OK, archive_read_free(a)); + + free(buff); +} + +DEFINE_TEST(test_write_format_7zip_empty_files) +{ + /* Test that write an empty file. */ + test_only_empty_file(); + test_only_empty_files(); +} diff --git a/libarchive/test/test_write_format_7zip_large.c b/libarchive/test/test_write_format_7zip_large.c new file mode 100644 index 000000000000..5c49f59a1d4d --- /dev/null +++ b/libarchive/test/test_write_format_7zip_large.c @@ -0,0 +1,174 @@ +/*- + * Copyright (c) 2012 Michihiro NAKAJIMA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + + +#include "test.h" +__FBSDID("$FreeBSD$"); + +#define LARGE_SIZE (16*1024*1024) +static void +test_large(const char *compression_type) +{ + struct archive_entry *ae; + struct archive *a; + size_t used; + size_t buffsize = LARGE_SIZE + 1024 * 256; + size_t datasize = LARGE_SIZE; + char *buff, *filedata, *filedata2; + unsigned i; + + assert((buff = malloc(buffsize)) != NULL); + assert((filedata = malloc(datasize)) != NULL); + assert((filedata2 = malloc(datasize)) != NULL); + + /* Create a new archive in memory. */ + assert((a = archive_write_new()) != NULL); + if (a == NULL || buff == NULL || filedata == NULL || filedata2 == NULL) { + archive_write_free(a); + free(buff); + free(filedata); + free(filedata2); + return; + } + assertEqualIntA(a, ARCHIVE_OK, archive_write_set_format_7zip(a)); + if (compression_type != NULL && + ARCHIVE_OK != archive_write_set_format_option(a, "7zip", + "compression", compression_type)) { + skipping("%s writing not fully supported on this platform", + compression_type); + assertEqualInt(ARCHIVE_OK, archive_write_free(a)); + free(buff); + free(filedata); + free(filedata2); + return; + } + assertEqualIntA(a, ARCHIVE_OK, archive_write_add_filter_none(a)); + assertEqualIntA(a, ARCHIVE_OK, + archive_write_open_memory(a, buff, buffsize, &used)); + + /* + * Write a large file to it. + */ + assert((ae = archive_entry_new()) != NULL); + archive_entry_set_mtime(ae, 1, 100); + assertEqualInt(1, archive_entry_mtime(ae)); + assertEqualInt(100, archive_entry_mtime_nsec(ae)); + archive_entry_copy_pathname(ae, "file"); + assertEqualString("file", archive_entry_pathname(ae)); + archive_entry_set_mode(ae, AE_IFREG | 0755); + assertEqualInt((AE_IFREG | 0755), archive_entry_mode(ae)); + archive_entry_set_size(ae, datasize); + + assertEqualInt(0, archive_write_header(a, ae)); + archive_entry_free(ae); + if (strcmp(compression_type, "ppmd") == 0) { + /* NOTE: PPMd cannot handle random data correctly.*/ + memset(filedata, 'a', datasize); + } else { + for (i = 0; i < datasize; i++) + filedata[i] = (char)rand(); + } + assertEqualInt(datasize, archive_write_data(a, filedata, datasize)); + + /* Close out the archive. */ + assertEqualIntA(a, ARCHIVE_OK, archive_write_close(a)); + assertEqualInt(ARCHIVE_OK, archive_write_free(a)); + + /* Verify the initial header. */ + assertEqualMem(buff, "\x37\x7a\xbc\xaf\x27\x1c\x00\x03", 8); + + /* + * Now, read the data back. + */ + /* With the test memory reader -- seeking mode. */ + assert((a = archive_read_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_support_filter_all(a)); + assertEqualIntA(a, ARCHIVE_OK, read_open_memory_seek(a, buff, used, 7)); + + /* + * Read and verify a large file. + */ + assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); + assertEqualInt(1, archive_entry_mtime(ae)); + assertEqualInt(100, archive_entry_mtime_nsec(ae)); + assertEqualInt(0, archive_entry_atime(ae)); + assertEqualInt(0, archive_entry_ctime(ae)); + assertEqualString("file", archive_entry_pathname(ae)); + assertEqualInt(AE_IFREG | 0755, archive_entry_mode(ae)); + assertEqualInt(datasize, archive_entry_size(ae)); + assertEqualIntA(a, datasize, archive_read_data(a, filedata2, datasize)); + assertEqualMem(filedata, filedata2, datasize); + + /* Verify the end of the 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)); + + assertEqualInt(ARCHIVE_OK, archive_read_close(a)); + assertEqualInt(ARCHIVE_OK, archive_read_free(a)); + + free(buff); + free(filedata); + free(filedata2); +} + +DEFINE_TEST(test_write_format_7zip_large_bzip2) +{ + /* Test that making a 7-Zip archive file with bzip2 compression. */ + test_large("bzip2"); +} + +DEFINE_TEST(test_write_format_7zip_large_copy) +{ + /* Test that making a 7-Zip archive file without compression. */ + test_large("copy"); +} + +DEFINE_TEST(test_write_format_7zip_large_deflate) +{ + /* Test that making a 7-Zip archive file with deflate compression. */ + test_large("deflate"); +} + +DEFINE_TEST(test_write_format_7zip_large_lzma1) +{ + /* Test that making a 7-Zip archive file with lzma1 compression. */ + test_large("lzma1"); +} + +DEFINE_TEST(test_write_format_7zip_large_lzma2) +{ + /* Test that making a 7-Zip archive file with lzma2 compression. */ + test_large("lzma2"); +} + +DEFINE_TEST(test_write_format_7zip_large_ppmd) +{ + /* Test that making a 7-Zip archive file with PPMd compression. */ + test_large("ppmd"); +} diff --git a/libarchive/test/test_write_format_ar.c b/libarchive/test/test_write_format_ar.c index 1c1b2a718b07..5db75871c75c 100644 --- a/libarchive/test/test_write_format_ar.c +++ b/libarchive/test/test_write_format_ar.c @@ -98,9 +98,9 @@ DEFINE_TEST(test_write_format_ar) archive_entry_free(ae); assertEqualIntA(a, ARCHIVE_OK, archive_write_close(a)); - assertEqualInt(archive_position_compressed(a), - archive_position_uncompressed(a)); - assertEqualInt(used, archive_position_uncompressed(a)); + assertEqualInt(archive_filter_bytes(a, -1), + archive_filter_bytes(a, 0)); + assertEqualInt(used, archive_filter_bytes(a, 0)); assertEqualInt(ARCHIVE_OK, archive_write_free(a)); /* diff --git a/libarchive/test/test_write_format_cpio.c b/libarchive/test/test_write_format_cpio.c index 2984a6a37c9a..9f7307f28ca2 100644 --- a/libarchive/test/test_write_format_cpio.c +++ b/libarchive/test/test_write_format_cpio.c @@ -42,7 +42,7 @@ test_format(int (*set_format)(struct archive *)) /* Create a new archive in memory. */ assert((a = archive_write_new()) != NULL); assertA(0 == (*set_format)(a)); - assertA(0 == archive_write_set_compression_none(a)); + assertA(0 == archive_write_add_filter_none(a)); assertA(0 == archive_write_open_memory(a, buff, buffsize, &used)); /* @@ -234,7 +234,7 @@ test_big_entries(int (*set_format)(struct archive *), int64_t size, int expected /* Create a new archive in memory. */ assert((a = archive_write_new()) != NULL); assertA(0 == (*set_format)(a)); - assertA(0 == archive_write_set_compression_none(a)); + assertA(0 == archive_write_add_filter_none(a)); assertA(0 == archive_write_open_memory(a, buff, buffsize, &used)); assert((ae = archive_entry_new()) != NULL); diff --git a/libarchive/test/test_write_format_cpio_empty.c b/libarchive/test/test_write_format_cpio_empty.c index 53aaec822712..60fb28340133 100644 --- a/libarchive/test/test_write_format_cpio_empty.c +++ b/libarchive/test/test_write_format_cpio_empty.c @@ -53,7 +53,7 @@ DEFINE_TEST(test_write_format_cpio_empty) /* Create a new archive in memory. */ assert((a = archive_write_new()) != NULL); assertA(0 == archive_write_set_format_cpio(a)); - assertA(0 == archive_write_set_compression_none(a)); + assertA(0 == archive_write_add_filter_none(a)); /* 1-byte block size ensures we see only the required bytes. */ /* We're not testing the padding here. */ assertA(0 == archive_write_set_bytes_per_block(a, 1)); diff --git a/libarchive/test/test_write_format_cpio_newc.c b/libarchive/test/test_write_format_cpio_newc.c index 81c3d22d90e1..3bbc173017f9 100644 --- a/libarchive/test/test_write_format_cpio_newc.c +++ b/libarchive/test/test_write_format_cpio_newc.c @@ -61,7 +61,7 @@ DEFINE_TEST(test_write_format_cpio_newc) /* Create a new archive in memory. */ assert((a = archive_write_new()) != NULL); assertEqualIntA(a, 0, archive_write_set_format_cpio_newc(a)); - assertEqualIntA(a, 0, archive_write_set_compression_none(a)); + assertEqualIntA(a, 0, archive_write_add_filter_none(a)); assertEqualIntA(a, 0, archive_write_open_memory(a, buff, buffsize, &used)); /* diff --git a/libarchive/test/test_write_format_cpio_odc.c b/libarchive/test/test_write_format_cpio_odc.c index 48af04ecf355..ba1fecd5f0ea 100644 --- a/libarchive/test/test_write_format_cpio_odc.c +++ b/libarchive/test/test_write_format_cpio_odc.c @@ -55,7 +55,7 @@ DEFINE_TEST(test_write_format_cpio_odc) /* Create a new archive in memory. */ assert((a = archive_write_new()) != NULL); assertEqualIntA(a, 0, archive_write_set_format_cpio(a)); - assertEqualIntA(a, 0, archive_write_set_compression_none(a)); + assertEqualIntA(a, 0, archive_write_add_filter_none(a)); assertEqualIntA(a, 0, archive_write_open_memory(a, buff, buffsize, &used)); /* diff --git a/libarchive/test/test_write_format_gnutar.c b/libarchive/test/test_write_format_gnutar.c index 42063e9cfa36..67f5a107cb4c 100644 --- a/libarchive/test/test_write_format_gnutar.c +++ b/libarchive/test/test_write_format_gnutar.c @@ -109,7 +109,7 @@ DEFINE_TEST(test_write_format_gnutar) /* Create a new archive in memory. */ assert((a = archive_write_new()) != NULL); assertA(0 == archive_write_set_format_gnutar(a)); - assertA(0 == archive_write_set_compression_none(a)); + assertA(0 == archive_write_add_filter_none(a)); assertA(0 == archive_write_open_memory(a, buff, buffsize, &used)); /* diff --git a/libarchive/test/test_write_format_iso9660.c b/libarchive/test/test_write_format_iso9660.c index dd027afa32d5..9c5a005fd131 100644 --- a/libarchive/test/test_write_format_iso9660.c +++ b/libarchive/test/test_write_format_iso9660.c @@ -50,7 +50,7 @@ DEFINE_TEST(test_write_format_iso9660) /* Create a new archive in memory. */ assert((a = archive_write_new()) != NULL); assertA(0 == archive_write_set_format_iso9660(a)); - assertA(0 == archive_write_set_compression_none(a)); + assertA(0 == archive_write_add_filter_none(a)); assertA(0 == archive_write_open_memory(a, buff, buffsize, &used)); /* diff --git a/libarchive/test/test_write_format_iso9660_boot.c b/libarchive/test/test_write_format_iso9660_boot.c index d3f8ab0e9349..b1f185b9c455 100644 --- a/libarchive/test/test_write_format_iso9660_boot.c +++ b/libarchive/test/test_write_format_iso9660_boot.c @@ -104,7 +104,7 @@ _test_write_format_iso9660_boot(int write_info_tbl) /* ISO9660 format: Create a new archive in memory. */ assert((a = archive_write_new()) != NULL); assertA(0 == archive_write_set_format_iso9660(a)); - assertA(0 == archive_write_set_compression_none(a)); + assertA(0 == archive_write_add_filter_none(a)); assertA(0 == archive_write_set_option(a, NULL, "boot", "boot.img")); if (write_info_tbl) assertA(0 == archive_write_set_option(a, NULL, "boot-info-table", "1")); diff --git a/libarchive/test/test_write_format_iso9660_empty.c b/libarchive/test/test_write_format_iso9660_empty.c index 1c5acdbfc58b..55c6c3c7e567 100644 --- a/libarchive/test/test_write_format_iso9660_empty.c +++ b/libarchive/test/test_write_format_iso9660_empty.c @@ -58,11 +58,13 @@ DEFINE_TEST(test_write_format_iso9660_empty) buff = malloc(buffsize); assert(buff != NULL); + if (buff == NULL) + return; /* ISO9660 format: Create a new archive in memory. */ assert((a = archive_write_new()) != NULL); assertA(0 == archive_write_set_format_iso9660(a)); - assertA(0 == archive_write_set_compression_none(a)); + assertA(0 == archive_write_add_filter_none(a)); assertA(0 == archive_write_set_bytes_per_block(a, 1)); assertA(0 == archive_write_set_bytes_in_last_block(a, 1)); assertA(0 == archive_write_open_memory(a, buff, buffsize, &used)); diff --git a/libarchive/test/test_write_format_iso9660_filename.c b/libarchive/test/test_write_format_iso9660_filename.c index 1565af6b37ce..713883bdc8cb 100644 --- a/libarchive/test/test_write_format_iso9660_filename.c +++ b/libarchive/test/test_write_format_iso9660_filename.c @@ -218,7 +218,7 @@ create_iso_image(unsigned char *buff, size_t buffsize, size_t *used, /* ISO9660 format: Create a new archive in memory. */ assert((a = archive_write_new()) != NULL); assertA(0 == archive_write_set_format_iso9660(a)); - assertA(0 == archive_write_set_compression_none(a)); + assertA(0 == archive_write_add_filter_none(a)); assertA(0 == archive_write_set_option(a, NULL, "pad", NULL)); if (opt) assertA(0 == archive_write_set_options(a, opt)); @@ -312,6 +312,8 @@ DEFINE_TEST(test_write_format_iso9660_filename) buff = malloc(buffsize); assert(buff != NULL); + if (buff == NULL) + return; memset(&fns, 0, sizeof(fns)); /* @@ -321,6 +323,10 @@ DEFINE_TEST(test_write_format_iso9660_filename) fns.names = (char **)malloc(sizeof(char *) * fcnt); assert(fns.names != NULL); + if (fns.names == NULL) { + free(buff); + return; + } fns.alloc = fcnt; /* Verify rockridge filenames. */ diff --git a/libarchive/test/test_write_format_iso9660_zisofs.c b/libarchive/test/test_write_format_iso9660_zisofs.c index 2e3e03f15f92..136255b32ef9 100644 --- a/libarchive/test/test_write_format_iso9660_zisofs.c +++ b/libarchive/test/test_write_format_iso9660_zisofs.c @@ -106,15 +106,18 @@ test_write_format_iso9660_zisofs_1(void) memset(nullb, 0, sizeof(nullb)); buff = malloc(buffsize); assert(buff != NULL); + if (buff == NULL) + return; /* ISO9660 format: Create a new archive in memory. */ assert((a = archive_write_new()) != NULL); assertEqualIntA(a, 0, archive_write_set_format_iso9660(a)); - assertEqualIntA(a, 0, archive_write_set_compression_none(a)); + assertEqualIntA(a, 0, archive_write_add_filter_none(a)); r = archive_write_set_option(a, NULL, "zisofs", "1"); if (r == ARCHIVE_FATAL) { skipping("zisofs option not supported on this platform"); assertEqualInt(ARCHIVE_OK, archive_write_free(a)); + free(buff); return; } assertEqualIntA(a, 0, archive_write_set_option(a, NULL, "pad", NULL)); @@ -335,15 +338,18 @@ test_write_format_iso9660_zisofs_2(void) buff = malloc(buffsize); assert(buff != NULL); + if (buff == NULL) + return; /* ISO9660 format: Create a new archive in memory. */ assert((a = archive_write_new()) != NULL); assertEqualIntA(a, 0, archive_write_set_format_iso9660(a)); - assertEqualIntA(a, 0, archive_write_set_compression_none(a)); + assertEqualIntA(a, 0, archive_write_add_filter_none(a)); r = archive_write_set_option(a, NULL, "zisofs", "1"); if (r == ARCHIVE_FATAL) { skipping("zisofs option not supported on this platform"); assertEqualInt(ARCHIVE_OK, archive_write_free(a)); + free(buff); return; } assertEqualIntA(a, 0, archive_write_set_option(a, NULL, "pad", NULL)); @@ -585,15 +591,18 @@ test_write_format_iso9660_zisofs_3(void) memset(nullb, 0, sizeof(nullb)); buff = malloc(buffsize); assert(buff != NULL); + if (buff == NULL) + return; /* ISO9660 format: Create a new archive in memory. */ assert((a = archive_write_new()) != NULL); assertEqualIntA(a, 0, archive_write_set_format_iso9660(a)); - assertEqualIntA(a, 0, archive_write_set_compression_none(a)); + assertEqualIntA(a, 0, archive_write_add_filter_none(a)); r = archive_write_set_option(a, NULL, "zisofs", "1"); if (r == ARCHIVE_FATAL) { skipping("zisofs option not supported on this platform"); assertEqualInt(ARCHIVE_OK, archive_write_free(a)); + free(buff); return; } assertEqualIntA(a, 0, archive_write_set_option(a, NULL, "boot", "boot.img")); diff --git a/libarchive/test/test_write_format_mtree.c b/libarchive/test/test_write_format_mtree.c index ee436d08d5bf..c886709bf19c 100644 --- a/libarchive/test/test_write_format_mtree.c +++ b/libarchive/test/test_write_format_mtree.c @@ -35,11 +35,11 @@ static struct { uid_t uid; gid_t gid; } entries[] = { + { "./COPYING", S_IFREG | 0644, 1231975636, 1001, 1001 }, { "./Makefile", S_IFREG | 0644, 1233041050, 1001, 1001 }, { "./NEWS", S_IFREG | 0644, 1231975636, 1001, 1001 }, { "./PROJECTS", S_IFREG | 0644, 1231975636, 1001, 1001 }, { "./README", S_IFREG | 0644, 1231975636, 1001, 1001 }, - { "./COPYING", S_IFREG | 0644, 1231975636, 1001, 1001 }, { "./subdir", S_IFDIR | 0755, 1233504586, 1001, 1001 }, { "./subdir/README", S_IFREG | 0664, 1231975636, 1002, 1001 }, { "./subdir/config", S_IFREG | 0664, 1232266273, 1003, 1003 }, diff --git a/libarchive/test/test_write_format_mtree_absolute_path.c b/libarchive/test/test_write_format_mtree_absolute_path.c new file mode 100644 index 000000000000..e3972f1f1135 --- /dev/null +++ b/libarchive/test/test_write_format_mtree_absolute_path.c @@ -0,0 +1,99 @@ +/*- + * Copyright (c) 2012 Michihiro NAKAJIMA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer + * 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" +__FBSDID("$FreeBSD$"); + +static char buff[4096]; + +DEFINE_TEST(test_write_format_mtree_absolute_path) +{ + struct archive_entry *ae; + struct archive* a; + size_t used; + + /* Create a mtree format archive. */ + assert((a = archive_write_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_write_set_format_mtree(a)); + assertEqualIntA(a, ARCHIVE_OK, + archive_write_open_memory(a, buff, sizeof(buff)-1, &used)); + + /* Write "." file. */ + assert((ae = archive_entry_new()) != NULL); + archive_entry_copy_pathname(ae, "."); + archive_entry_set_mode(ae, AE_IFDIR | 0755); + assertEqualIntA(a, ARCHIVE_OK, archive_write_header(a, ae)); + archive_entry_free(ae); + + /* Write "/file" file. */ + assert((ae = archive_entry_new()) != NULL); + archive_entry_copy_pathname(ae, "/file"); + archive_entry_set_size(ae, 0); + archive_entry_set_mode(ae, AE_IFREG | 0644); + assertEqualIntA(a, ARCHIVE_OK, archive_write_header(a, ae)); + archive_entry_free(ae); + + /* Write "/dir" directory. */ + assert((ae = archive_entry_new()) != NULL); + archive_entry_copy_pathname(ae, "/dir"); + archive_entry_set_mode(ae, AE_IFDIR | 0755); + assertEqualIntA(a, ARCHIVE_OK, archive_write_header(a, ae)); + archive_entry_free(ae); + + assertEqualIntA(a, ARCHIVE_OK, archive_write_close(a)); + assertEqualInt(ARCHIVE_OK, archive_write_free(a)); + + /* + * Read the data and check it. + */ + assert((a = archive_read_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_support_filter_all(a)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_open_memory(a, buff, used)); + + /* Read "." file. */ + assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); + failure("The path should be just \".\""); + assertEqualString(archive_entry_pathname(ae), "."); + assertEqualInt(archive_entry_mode(ae), AE_IFDIR | 0755); + + /* Read "/file" file. */ + assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); + failure("The path should have \"./\" prefix"); + assertEqualString(archive_entry_pathname(ae), "./file"); + assertEqualInt(archive_entry_size(ae), 0); + assertEqualInt(archive_entry_mode(ae), AE_IFREG | 0644); + + /* Read "/dir" file. */ + assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); + failure("The path should have \"./\" prefix"); + assertEqualString(archive_entry_pathname(ae), "./dir"); + assertEqualInt(archive_entry_mode(ae), AE_IFDIR | 0755); + + assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a)); + assertEqualInt(ARCHIVE_OK, archive_read_free(a)); +} + diff --git a/libarchive/test/test_write_format_mtree_classic.c b/libarchive/test/test_write_format_mtree_classic.c new file mode 100644 index 000000000000..9a75fdd71f52 --- /dev/null +++ b/libarchive/test/test_write_format_mtree_classic.c @@ -0,0 +1,194 @@ +/*- + * Copyright (c) 2012 Michihiro NAKAJIMA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer + * 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" +__FBSDID("$FreeBSD$"); + +static char buff[4096]; +static struct { + const char *path; + mode_t mode; + int nlink; + time_t mtime; + uid_t uid; + gid_t gid; +} entries[] = { + { ".", S_IFDIR | 0755, 3, 1231975636, 1001, 1001 }, + { "./COPYING", S_IFREG | 0644, 1, 1231975636, 1001, 1001 }, + { "./Makefile", S_IFREG | 0644, 1, 1233041050, 1001, 1001 }, + { "./NEWS", S_IFREG | 0644, 1, 1231975636, 1001, 1001 }, + { "./PROJECTS", S_IFREG | 0644, 1, 1231975636, 1001, 1001 }, + { "./README", S_IFREG | 0644, 1, 1231975636, 1001, 1001 }, + { "./subdir", S_IFDIR | 0755, 3, 1233504586, 1001, 1001 }, + { "./subdir/README", S_IFREG | 0664, 1, 1231975636, 1002, 1001 }, + { "./subdir/config", S_IFREG | 0664, 1, 1232266273, 1003, 1003 }, + { "./subdir2", S_IFDIR | 0755, 3, 1233504586, 1001, 1001 }, + { "./subdir3", S_IFDIR | 0755, 3, 1233504586, 1001, 1001 }, + { "./subdir3/mtree", S_IFREG | 0664, 2, 1232266273, 1003, 1003 }, + { NULL, 0, 0, 0, 0, 0 } +}; + +static const char image [] = { +"#mtree\n" +"\n" +"# .\n" +"/set type=file uid=1001 gid=1001 mode=644\n" +". time=1231975636.0 mode=755 type=dir\n" +" COPYING time=1231975636.0 size=8\n" +" Makefile time=1233041050.0 size=8\n" +" NEWS time=1231975636.0 size=8\n" +" PROJECTS time=1231975636.0 size=8\n" +" README time=1231975636.0 size=8\n" +"\n" +"# ./subdir\n" +"/set mode=664\n" +"subdir time=1233504586.0 mode=755 type=dir\n" +" README time=1231975636.0 uid=1002 size=8\n" +" config time=1232266273.0 gid=1003 uid=1003 size=8\n" +"# ./subdir\n" +"..\n" +"\n" +"\n" +"# ./subdir2\n" +"subdir2 time=1233504586.0 mode=755 type=dir\n" +"# ./subdir2\n" +"..\n" +"\n" +"\n" +"# ./subdir3\n" +"subdir3 time=1233504586.0 mode=755 type=dir\n" +" mtree nlink=2 time=1232266273.0 gid=1003 uid=1003 size=8\n" +"# ./subdir3\n" +"..\n" +"\n" +"..\n\n" +}; + +static const char image_dironly [] = { +"#mtree\n" +"# .\n" +"/set type=dir uid=1001 gid=1001 mode=755\n" +". time=1231975636.0\n" +"# ./subdir\n" +"subdir time=1233504586.0\n" +"# ./subdir\n" +"..\n" +"# ./subdir2\n" +"subdir2 time=1233504586.0\n" +"# ./subdir2\n" +"..\n" +"# ./subdir3\n" +"subdir3 time=1233504586.0\n" +"# ./subdir3\n" +"..\n" +"..\n" +}; + +static void +test_write_format_mtree_sub(int dironly) +{ + struct archive_entry *ae; + struct archive* a; + size_t used; + int i; + + /* Create a mtree format archive. */ + assert((a = archive_write_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_write_set_format_mtree_classic(a)); + if (dironly) + assertEqualIntA(a, ARCHIVE_OK, + archive_write_set_format_option(a, NULL, "dironly", "1")); + assertEqualIntA(a, ARCHIVE_OK, + archive_write_open_memory(a, buff, sizeof(buff)-1, &used)); + + /* Write entries */ + for (i = 0; entries[i].path != NULL; i++) { + assert((ae = archive_entry_new()) != NULL); + archive_entry_set_nlink(ae, entries[i].nlink); + assertEqualInt(entries[i].nlink, archive_entry_nlink(ae)); + archive_entry_set_mtime(ae, entries[i].mtime, 0); + assertEqualInt(entries[i].mtime, archive_entry_mtime(ae)); + archive_entry_set_mode(ae, entries[i].mode); + assertEqualInt(entries[i].mode, archive_entry_mode(ae)); + archive_entry_set_uid(ae, entries[i].uid); + assertEqualInt(entries[i].uid, archive_entry_uid(ae)); + archive_entry_set_gid(ae, entries[i].gid); + assertEqualInt(entries[i].gid, archive_entry_gid(ae)); + archive_entry_copy_pathname(ae, entries[i].path); + if ((entries[i].mode & AE_IFMT) != S_IFDIR) + archive_entry_set_size(ae, 8); + assertEqualIntA(a, ARCHIVE_OK, archive_write_header(a, ae)); + if ((entries[i].mode & AE_IFMT) != S_IFDIR) + assertEqualIntA(a, 8, + archive_write_data(a, "Hello012", 15)); + archive_entry_free(ae); + } + assertEqualIntA(a, ARCHIVE_OK, archive_write_close(a)); + assertEqualInt(ARCHIVE_OK, archive_write_free(a)); + + buff[used] = '\0'; + if (dironly) + assertEqualString(buff, image_dironly); + else + assertEqualString(buff, image); + + /* + * Read the data and check it. + */ + assert((a = archive_read_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_support_filter_all(a)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_open_memory(a, buff, used)); + + /* Read entries */ + for (i = 0; entries[i].path != NULL; i++) { + if (dironly && (entries[i].mode & AE_IFMT) != S_IFDIR) + continue; + assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); + assertEqualInt(entries[i].mtime, archive_entry_mtime(ae)); + assertEqualInt(entries[i].mode, archive_entry_mode(ae)); + assertEqualInt(entries[i].uid, archive_entry_uid(ae)); + assertEqualInt(entries[i].gid, archive_entry_gid(ae)); + if (i > 0) + assertEqualString(entries[i].path + 2, + archive_entry_pathname(ae)); + else + assertEqualString(entries[i].path, + archive_entry_pathname(ae)); + if ((entries[i].mode & AE_IFMT) != S_IFDIR) + assertEqualInt(8, archive_entry_size(ae)); + } + assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a)); + assertEqualInt(ARCHIVE_OK, archive_read_free(a)); +} + +DEFINE_TEST(test_write_format_mtree_classic) +{ + /* Generate classic format. */ + test_write_format_mtree_sub(0); + /* Generate classic format and Write directory only. */ + test_write_format_mtree_sub(1); +} diff --git a/libarchive/test/test_write_format_mtree_classic_indent.c b/libarchive/test/test_write_format_mtree_classic_indent.c new file mode 100644 index 000000000000..6d1c54911558 --- /dev/null +++ b/libarchive/test/test_write_format_mtree_classic_indent.c @@ -0,0 +1,196 @@ +/*- + * Copyright (c) 2012 Michihiro NAKAJIMA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer + * 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" +__FBSDID("$FreeBSD$"); + +static char buff[4096]; +static struct { + const char *path; + mode_t mode; + int nlink; + time_t mtime; + uid_t uid; + gid_t gid; +} entries[] = { + { ".", S_IFDIR | 0755, 3, 1231975636, 1001, 1001 }, + { "./COPYING", S_IFREG | 0644, 1, 1231975636, 1001, 1001 }, + { "./Makefile", S_IFREG | 0644, 1, 1233041050, 1001, 1001 }, + { "./NEWS", S_IFREG | 0644, 1, 1231975636, 1001, 1001 }, + { "./PROJECTS", S_IFREG | 0644, 1, 1231975636, 1001, 1001 }, + { "./README", S_IFREG | 0644, 1, 1231975636, 1001, 1001 }, + { "./subdir", S_IFDIR | 0755, 3, 1233504586, 1001, 1001 }, + { "./subdir/README", S_IFREG | 0664, 1, 1231975636, 1002, 1001 }, + { "./subdir/config", S_IFREG | 0664, 1, 1232266273, 1003, 1003 }, + { "./subdir2", S_IFDIR | 0755, 3, 1233504586, 1001, 1001 }, + { "./subdir3", S_IFDIR | 0755, 3, 1233504586, 1001, 1001 }, + { "./subdir3/mtree", S_IFREG | 0664, 2, 1232266273, 1003, 1003 }, + { NULL, 0, 0, 0, 0, 0 } +}; + +static const char image [] = { +"#mtree\n" +"\n" +"# .\n" +"/set type=file uid=1001 gid=1001 mode=644\n" +". time=1231975636.0 mode=755 type=dir\n" +" COPYING time=1231975636.0 size=8\n" +" Makefile time=1233041050.0 size=8\n" +" NEWS time=1231975636.0 size=8\n" +" PROJECTS time=1231975636.0 size=8\n" +" README time=1231975636.0 size=8\n" +"\n" +"# ./subdir\n" +"/set mode=664\n" +" subdir time=1233504586.0 mode=755 type=dir\n" +" README time=1231975636.0 uid=1002 size=8\n" +" config time=1232266273.0 gid=1003 uid=1003 size=8\n" +" # ./subdir\n" +" ..\n" +"\n" +"\n" +"# ./subdir2\n" +" subdir2 time=1233504586.0 mode=755 type=dir\n" +" # ./subdir2\n" +" ..\n" +"\n" +"\n" +"# ./subdir3\n" +" subdir3 time=1233504586.0 mode=755 type=dir\n" +" mtree nlink=2 time=1232266273.0 gid=1003 uid=1003 size=8\n" +" # ./subdir3\n" +" ..\n" +"\n" +"..\n\n" +}; + +static const char image_dironly [] = { +"#mtree\n" +"# .\n" +"/set type=dir uid=1001 gid=1001 mode=755\n" +". time=1231975636.0\n" +"# ./subdir\n" +" subdir time=1233504586.0\n" +" # ./subdir\n" +" ..\n" +"# ./subdir2\n" +" subdir2 time=1233504586.0\n" +" # ./subdir2\n" +" ..\n" +"# ./subdir3\n" +" subdir3 time=1233504586.0\n" +" # ./subdir3\n" +" ..\n" +"..\n" +}; + +static void +test_write_format_mtree_sub(int dironly) +{ + struct archive_entry *ae; + struct archive* a; + size_t used; + int i; + + /* Create a mtree format archive. */ + assert((a = archive_write_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_write_set_format_mtree_classic(a)); + assertEqualIntA(a, ARCHIVE_OK, + archive_write_set_format_option(a, NULL, "indent", "1")); + if (dironly) + assertEqualIntA(a, ARCHIVE_OK, + archive_write_set_format_option(a, NULL, "dironly", "1")); + assertEqualIntA(a, ARCHIVE_OK, + archive_write_open_memory(a, buff, sizeof(buff)-1, &used)); + + /* Write entries */ + for (i = 0; entries[i].path != NULL; i++) { + assert((ae = archive_entry_new()) != NULL); + archive_entry_set_nlink(ae, entries[i].nlink); + assertEqualInt(entries[i].nlink, archive_entry_nlink(ae)); + archive_entry_set_mtime(ae, entries[i].mtime, 0); + assertEqualInt(entries[i].mtime, archive_entry_mtime(ae)); + archive_entry_set_mode(ae, entries[i].mode); + assertEqualInt(entries[i].mode, archive_entry_mode(ae)); + archive_entry_set_uid(ae, entries[i].uid); + assertEqualInt(entries[i].uid, archive_entry_uid(ae)); + archive_entry_set_gid(ae, entries[i].gid); + assertEqualInt(entries[i].gid, archive_entry_gid(ae)); + archive_entry_copy_pathname(ae, entries[i].path); + if ((entries[i].mode & AE_IFMT) != S_IFDIR) + archive_entry_set_size(ae, 8); + assertEqualIntA(a, ARCHIVE_OK, archive_write_header(a, ae)); + if ((entries[i].mode & AE_IFMT) != S_IFDIR) + assertEqualIntA(a, 8, + archive_write_data(a, "Hello012", 15)); + archive_entry_free(ae); + } + assertEqualIntA(a, ARCHIVE_OK, archive_write_close(a)); + assertEqualInt(ARCHIVE_OK, archive_write_free(a)); + + buff[used] = '\0'; + if (dironly) + assertEqualString(buff, image_dironly); + else + assertEqualString(buff, image); + + /* + * Read the data and check it. + */ + assert((a = archive_read_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_support_filter_all(a)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_open_memory(a, buff, used)); + + /* Read entries */ + for (i = 0; entries[i].path != NULL; i++) { + if (dironly && (entries[i].mode & AE_IFMT) != S_IFDIR) + continue; + assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); + assertEqualInt(entries[i].mtime, archive_entry_mtime(ae)); + assertEqualInt(entries[i].mode, archive_entry_mode(ae)); + assertEqualInt(entries[i].uid, archive_entry_uid(ae)); + assertEqualInt(entries[i].gid, archive_entry_gid(ae)); + if (i > 0) + assertEqualString(entries[i].path + 2, + archive_entry_pathname(ae)); + else + assertEqualString(entries[i].path, + archive_entry_pathname(ae)); + if ((entries[i].mode & AE_IFMT) != S_IFDIR) + assertEqualInt(8, archive_entry_size(ae)); + } + assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a)); + assertEqualInt(ARCHIVE_OK, archive_read_free(a)); +} + +DEFINE_TEST(test_write_format_mtree_classic_indent) +{ + /* Generate classic format. */ + test_write_format_mtree_sub(0); + /* Generate classic format and Write directory only. */ + test_write_format_mtree_sub(1); +} diff --git a/libarchive/test/test_write_format_mtree_fflags.c b/libarchive/test/test_write_format_mtree_fflags.c index 18689fe855de..820d86f70b3d 100644 --- a/libarchive/test/test_write_format_mtree_fflags.c +++ b/libarchive/test/test_write_format_mtree_fflags.c @@ -41,6 +41,7 @@ static struct { unsigned long fflags; } entries[] = { { "./f1", UF_IMMUTABLE | UF_NODUMP }, + { "./f11", UF_IMMUTABLE | UF_NODUMP }, { "./f2", 0 }, { "./f3", UF_NODUMP }, { NULL, 0 } diff --git a/libarchive/test/test_write_format_mtree_no_separator.c b/libarchive/test/test_write_format_mtree_no_separator.c new file mode 100644 index 000000000000..faf42dd5245b --- /dev/null +++ b/libarchive/test/test_write_format_mtree_no_separator.c @@ -0,0 +1,103 @@ +/*- + * Copyright (c) 2012 Michihiro NAKAJIMA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer + * 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" +__FBSDID("$FreeBSD$"); +#ifdef HAVE_SYS_STAT_H +#include +#endif + +static char buff[4096]; + +DEFINE_TEST(test_write_format_mtree_no_separator) +{ + struct archive_entry *ae; + struct archive* a; + size_t used; + + /* Create a mtree format archive. */ + assert((a = archive_write_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_write_set_format_mtree(a)); + assertEqualIntA(a, ARCHIVE_OK, + archive_write_open_memory(a, buff, sizeof(buff)-1, &used)); + + /* Write "." file. */ + assert((ae = archive_entry_new()) != NULL); + archive_entry_copy_pathname(ae, "."); + archive_entry_set_mode(ae, AE_IFDIR | 0755); + assertEqualIntA(a, ARCHIVE_OK, archive_write_header(a, ae)); + archive_entry_free(ae); + + /* Write "noseparator" file. */ + assert((ae = archive_entry_new()) != NULL); + archive_entry_copy_pathname(ae, "noseparator"); + archive_entry_set_size(ae, 0); + archive_entry_set_mode(ae, AE_IFREG | 0644); + assertEqualIntA(a, ARCHIVE_OK, archive_write_header(a, ae)); + archive_entry_free(ae); + + /* Write "./withseparator" file. */ + assert((ae = archive_entry_new()) != NULL); + archive_entry_copy_pathname(ae, "./withseparator"); + archive_entry_set_size(ae, 0); + archive_entry_set_mode(ae, AE_IFREG | 0644); + assertEqualIntA(a, ARCHIVE_OK, archive_write_header(a, ae)); + archive_entry_free(ae); + + assertEqualIntA(a, ARCHIVE_OK, archive_write_close(a)); + assertEqualInt(ARCHIVE_OK, archive_write_free(a)); + + /* + * Read the data and check it. + */ + assert((a = archive_read_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_support_filter_all(a)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_open_memory(a, buff, used)); + + /* Read "." file. */ + assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); + failure("The path should be just \".\""); + assertEqualString(archive_entry_pathname(ae), "."); + assertEqualInt(archive_entry_mode(ae), AE_IFDIR | 0755); + + /* Read "./noseparator" file. */ + assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); + failure("The path should have \"./\" prefix"); + assertEqualString(archive_entry_pathname(ae), "./noseparator"); + assertEqualInt(archive_entry_size(ae), 0); + assertEqualInt(archive_entry_mode(ae), AE_IFREG | 0644); + + /* Read "./withseparator" file. */ + assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); + assertEqualString(archive_entry_pathname(ae), "./withseparator"); + assertEqualInt(archive_entry_size(ae), 0); + assertEqualInt(archive_entry_mode(ae), AE_IFREG | 0644); + + assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a)); + assertEqualInt(ARCHIVE_OK, archive_read_free(a)); +} + diff --git a/libarchive/test/test_write_format_mtree_quoted_filename.c b/libarchive/test/test_write_format_mtree_quoted_filename.c new file mode 100644 index 000000000000..63e927a81ffe --- /dev/null +++ b/libarchive/test/test_write_format_mtree_quoted_filename.c @@ -0,0 +1,86 @@ +/*- + * Copyright (c) 2012 Michihiro NAKAJIMA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer + * 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" +__FBSDID("$FreeBSD$"); + +static char buff[4096]; + +static const char image [] = { +"#mtree\n" +"./a\\040!$\\043&\\075_^z\\177~ mode=644 type=file\n" +}; + + +DEFINE_TEST(test_write_format_mtree_quoted_filename) +{ + struct archive_entry *ae; + struct archive* a; + size_t used; + + /* Create a mtree format archive. */ + assert((a = archive_write_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_write_set_format_mtree(a)); + assertEqualIntA(a, ARCHIVE_OK, + archive_write_set_format_option(a, NULL, "all", NULL)); + assertEqualIntA(a, ARCHIVE_OK, + archive_write_set_format_option(a, NULL, "type", "1")); + assertEqualIntA(a, ARCHIVE_OK, + archive_write_set_format_option(a, NULL, "mode", "1")); + assertEqualIntA(a, ARCHIVE_OK, + archive_write_open_memory(a, buff, sizeof(buff)-1, &used)); + + /* Write entry which has #, = , \ and DEL(0177) in the filename. */ + assert((ae = archive_entry_new()) != NULL); + archive_entry_set_mode(ae, AE_IFREG | 0644); + assertEqualInt(AE_IFREG | 0644, archive_entry_mode(ae)); + archive_entry_copy_pathname(ae, "./a !$#&=_^z\177~"); + assertEqualIntA(a, ARCHIVE_OK, archive_write_header(a, ae)); + archive_entry_free(ae); + + assertEqualIntA(a, ARCHIVE_OK, archive_write_close(a)); + assertEqualInt(ARCHIVE_OK, archive_write_free(a)); + + buff[used] = '\0'; + failure("#, = and \\ in the filename should be quoted"); + assertEqualString(buff, image); + + /* + * Read the data and check it. + */ + assert((a = archive_read_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, archive_read_support_format_all(a)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_support_filter_all(a)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_open_memory(a, buff, used)); + + /* Read entry */ + assertEqualIntA(a, ARCHIVE_OK, archive_read_next_header(a, &ae)); + assertEqualInt(AE_IFREG | 0644, archive_entry_mode(ae)); + assertEqualString("./a !$#&=_^z\177~", archive_entry_pathname(ae)); + assertEqualIntA(a, ARCHIVE_OK, archive_read_close(a)); + assertEqualInt(ARCHIVE_OK, archive_read_free(a)); +} + diff --git a/libarchive/test/test_write_format_pax.c b/libarchive/test/test_write_format_pax.c index 21517188e1da..d29e9adcd867 100644 --- a/libarchive/test/test_write_format_pax.c +++ b/libarchive/test/test_write_format_pax.c @@ -44,7 +44,7 @@ DEFINE_TEST(test_write_format_pax) /* Create a new archive in memory. */ assert((a = archive_write_new()) != NULL); assertA(0 == archive_write_set_format_pax(a)); - assertA(0 == archive_write_set_compression_none(a)); + assertA(0 == archive_write_add_filter_none(a)); assertA(0 == archive_write_open_memory(a, buff, buffsize, &used)); /* diff --git a/libarchive/test/test_write_format_shar_empty.c b/libarchive/test/test_write_format_shar_empty.c index 09cfcd6b7598..03d70a3b5fa6 100644 --- a/libarchive/test/test_write_format_shar_empty.c +++ b/libarchive/test/test_write_format_shar_empty.c @@ -38,7 +38,7 @@ DEFINE_TEST(test_write_format_shar_empty) /* Create a new archive in memory. */ assert((a = archive_write_new()) != NULL); assertA(0 == archive_write_set_format_shar(a)); - assertA(0 == archive_write_set_compression_none(a)); + assertA(0 == archive_write_add_filter_none(a)); /* 1-byte block size ensures we see only the required bytes. */ /* We're not testing the padding here. */ assertA(0 == archive_write_set_bytes_per_block(a, 1)); diff --git a/libarchive/test/test_write_format_tar.c b/libarchive/test/test_write_format_tar.c index 81aeab64b334..7d16bbfc6ec3 100644 --- a/libarchive/test/test_write_format_tar.c +++ b/libarchive/test/test_write_format_tar.c @@ -43,7 +43,7 @@ DEFINE_TEST(test_write_format_tar) assertEqualIntA(a, ARCHIVE_OK, archive_write_set_format_ustar(a)); assertEqualIntA(a, ARCHIVE_OK, - archive_write_set_compression_none(a)); + archive_write_add_filter_none(a)); assertEqualIntA(a, ARCHIVE_OK, archive_write_set_bytes_per_block(a, (int)blocksize)); assertEqualIntA(a, ARCHIVE_OK, diff --git a/libarchive/test/test_write_format_tar_empty.c b/libarchive/test/test_write_format_tar_empty.c index f9e972b4064b..7ccd435f1233 100644 --- a/libarchive/test/test_write_format_tar_empty.c +++ b/libarchive/test/test_write_format_tar_empty.c @@ -39,7 +39,7 @@ DEFINE_TEST(test_write_format_tar_empty) /* USTAR format: Create a new archive in memory. */ assert((a = archive_write_new()) != NULL); assertA(0 == archive_write_set_format_ustar(a)); - assertA(0 == archive_write_set_compression_none(a)); + assertA(0 == archive_write_add_filter_none(a)); assertA(0 == archive_write_set_bytes_per_block(a, 512)); assertA(0 == archive_write_set_bytes_in_last_block(a, 512)); assertA(0 == archive_write_open_memory(a, buff, sizeof(buff), &used)); @@ -57,7 +57,7 @@ DEFINE_TEST(test_write_format_tar_empty) /* PAX format: Create a new archive in memory. */ assert((a = archive_write_new()) != NULL); assertA(0 == archive_write_set_format_pax(a)); - assertA(0 == archive_write_set_compression_none(a)); + assertA(0 == archive_write_add_filter_none(a)); assertA(0 == archive_write_set_bytes_per_block(a, 512)); assertA(0 == archive_write_set_bytes_in_last_block(a, 512)); assertA(0 == archive_write_open_memory(a, buff, sizeof(buff), &used)); diff --git a/libarchive/test/test_write_format_tar_sparse.c b/libarchive/test/test_write_format_tar_sparse.c index 00478160df9a..c8e0f479779e 100644 --- a/libarchive/test/test_write_format_tar_sparse.c +++ b/libarchive/test/test_write_format_tar_sparse.c @@ -49,7 +49,7 @@ test_1(void) assertEqualIntA(a, ARCHIVE_OK, archive_write_set_format_pax(a)); assertEqualIntA(a, ARCHIVE_OK, - archive_write_set_compression_none(a)); + archive_write_add_filter_none(a)); assertEqualIntA(a, ARCHIVE_OK, archive_write_set_bytes_per_block(a, (int)blocksize)); assertEqualIntA(a, ARCHIVE_OK, @@ -85,7 +85,7 @@ test_1(void) ws = 0x81000 - i; assertEqualInt(ws, archive_write_data(a, buff2, ws)); - i += ws; + i += (long)ws; } /* Close out the archive. */ @@ -190,7 +190,7 @@ test_2(void) assertEqualIntA(a, ARCHIVE_OK, archive_write_set_format_pax(a)); assertEqualIntA(a, ARCHIVE_OK, - archive_write_set_compression_none(a)); + archive_write_add_filter_none(a)); assertEqualIntA(a, ARCHIVE_OK, archive_write_set_bytes_per_block(a, (int)blocksize)); assertEqualIntA(a, ARCHIVE_OK, diff --git a/libarchive/test/test_write_format_tar_ustar.c b/libarchive/test/test_write_format_tar_ustar.c index 52b50f45197d..7bc38f7b57fd 100644 --- a/libarchive/test/test_write_format_tar_ustar.c +++ b/libarchive/test/test_write_format_tar_ustar.c @@ -79,7 +79,7 @@ DEFINE_TEST(test_write_format_tar_ustar) assertEqualIntA(a, ARCHIVE_OK, archive_write_set_format_ustar(a)); assertEqualIntA(a, ARCHIVE_OK, - archive_write_set_compression_none(a)); + archive_write_add_filter_none(a)); assertEqualIntA(a, ARCHIVE_OK, archive_write_open_memory(a, buff, buffsize, &used)); diff --git a/libarchive/test/test_write_format_tar_v7tar.c b/libarchive/test/test_write_format_tar_v7tar.c new file mode 100644 index 000000000000..16909956878b --- /dev/null +++ b/libarchive/test/test_write_format_tar_v7tar.c @@ -0,0 +1,259 @@ +/*- + * Copyright (c) 2003-2007 Tim Kientzle + * Copyright (c) 2012 Michihiro NAKAJIMA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#include "test.h" +__FBSDID("$FreeBSD$"); + +static int +is_null(const char *p, size_t l) +{ + while (l > 0) { + if (*p != '\0') + return (0); + --l; + ++p; + } + return (1); +} + +/* Verify the contents, then erase them to NUL bytes. */ +/* Tar requires all "unused" bytes be set to NUL; this allows us + * to easily verify that by invoking is_null() over the entire header + * after verifying each field. */ +#define myAssertEqualMem(a,b,s) assertEqualMem(a, b, s); memset(a, 0, s) + +/* + * Detailed verification that 'v7tar' archives are written with + * the correct format. + */ +DEFINE_TEST(test_write_format_tar_v7tar) +{ + struct archive *a; + struct archive_entry *entry; + char *buff, *e; + size_t buffsize = 100000; + size_t used; + int i; + char f99[100]; + char f100[101]; + + for (i = 0; i < 99; ++i) + f99[i] = 'a' + i % 26; + f99[99] = '\0'; + + for (i = 0; i < 100; ++i) + f100[i] = 'A' + i % 26; + f100[100] = '\0'; + + buff = malloc(buffsize); + + /* Create a new archive in memory. */ + assert((a = archive_write_new()) != NULL); + assertEqualIntA(a, ARCHIVE_OK, + archive_write_set_format_v7tar(a)); + assertEqualIntA(a, ARCHIVE_OK, + archive_write_add_filter_none(a)); + assertEqualIntA(a, ARCHIVE_OK, + archive_write_open_memory(a, buff, buffsize, &used)); + + /* + * Add various files to it. + * TODO: Extend this to cover more filetypes. + */ + + /* "file" with 10 bytes of content */ + assert((entry = archive_entry_new()) != NULL); + archive_entry_set_mtime(entry, 1, 10); + archive_entry_set_pathname(entry, "file"); + archive_entry_set_mode(entry, S_IFREG | 0664); + archive_entry_set_size(entry, 10); + archive_entry_set_uid(entry, 80); + archive_entry_set_gid(entry, 90); + archive_entry_set_dev(entry, 12); + archive_entry_set_ino(entry, 89); + archive_entry_set_nlink(entry, 2); + assertEqualIntA(a, ARCHIVE_OK, archive_write_header(a, entry)); + archive_entry_free(entry); + assertEqualIntA(a, 10, archive_write_data(a, "1234567890", 10)); + + /* Hardlink to "file" with 10 bytes of content */ + assert((entry = archive_entry_new()) != NULL); + archive_entry_set_mtime(entry, 1, 10); + archive_entry_set_pathname(entry, "linkfile"); + archive_entry_set_hardlink(entry, "file"); + archive_entry_set_mode(entry, S_IFREG | 0664); + archive_entry_set_size(entry, 10); + archive_entry_set_uid(entry, 80); + archive_entry_set_gid(entry, 90); + archive_entry_set_dev(entry, 12); + archive_entry_set_ino(entry, 89); + archive_entry_set_nlink(entry, 2); + assertEqualIntA(a, ARCHIVE_OK, archive_write_header(a, entry)); + archive_entry_free(entry); + /* Write of data to dir should fail == zero bytes get written. */ + assertEqualIntA(a, 0, archive_write_data(a, "1234567890", 10)); + + /* "dir" */ + assert((entry = archive_entry_new()) != NULL); + archive_entry_set_mtime(entry, 2, 20); + archive_entry_set_pathname(entry, "dir"); + archive_entry_set_mode(entry, S_IFDIR | 0775); + archive_entry_set_size(entry, 10); + archive_entry_set_nlink(entry, 2); + assertEqualIntA(a, ARCHIVE_OK, archive_write_header(a, entry)); + archive_entry_free(entry); + /* Write of data to dir should fail == zero bytes get written. */ + assertEqualIntA(a, 0, archive_write_data(a, "1234567890", 10)); + + /* "symlink" pointing to "file" */ + assert((entry = archive_entry_new()) != NULL); + archive_entry_set_mtime(entry, 3, 30); + archive_entry_set_pathname(entry, "symlink"); + archive_entry_set_mode(entry, 0664); + archive_entry_set_filetype(entry, AE_IFLNK); + archive_entry_set_symlink(entry,"file"); + archive_entry_set_size(entry, 0); + archive_entry_set_uid(entry, 88); + archive_entry_set_gid(entry, 98); + archive_entry_set_dev(entry, 12); + archive_entry_set_ino(entry, 90); + archive_entry_set_nlink(entry, 1); + assertEqualIntA(a, ARCHIVE_OK, archive_write_header(a, entry)); + archive_entry_free(entry); + + /* file with 99-char filename. */ + assert((entry = archive_entry_new()) != NULL); + archive_entry_set_mtime(entry, 1, 10); + archive_entry_set_pathname(entry, f99); + archive_entry_set_mode(entry, S_IFREG | 0664); + archive_entry_set_size(entry, 0); + archive_entry_set_uid(entry, 82); + archive_entry_set_gid(entry, 93); + archive_entry_set_dev(entry, 102); + archive_entry_set_ino(entry, 7); + archive_entry_set_nlink(entry, 1); + assertEqualIntA(a, ARCHIVE_OK, archive_write_header(a, entry)); + archive_entry_free(entry); + + /* file with 100-char filename. */ + assert((entry = archive_entry_new()) != NULL); + archive_entry_set_mtime(entry, 1, 10); + archive_entry_set_pathname(entry, f100); + archive_entry_set_mode(entry, S_IFREG | 0664); + archive_entry_set_size(entry, 0); + archive_entry_set_uid(entry, 82); + archive_entry_set_gid(entry, 93); + archive_entry_set_dev(entry, 102); + archive_entry_set_ino(entry, 7); + archive_entry_set_nlink(entry, 1); + failure("100-char filename should be rejected"); + assertEqualIntA(a, ARCHIVE_FAILED, archive_write_header(a, entry)); + archive_entry_free(entry); + + /* Close out the archive. */ + assertEqualInt(ARCHIVE_OK, archive_write_free(a)); + + /* + * Verify the archive format. + */ + e = buff; + + /* "file" */ + myAssertEqualMem(e + 0, "file", 5); /* Filename */ + myAssertEqualMem(e + 100, "000664 ", 8); /* mode */ + myAssertEqualMem(e + 108, "000120 ", 8); /* uid */ + myAssertEqualMem(e + 116, "000132 ", 8); /* gid */ + myAssertEqualMem(e + 124, "00000000012 ", 12); /* size */ + myAssertEqualMem(e + 136, "00000000001 ", 12); /* mtime */ + myAssertEqualMem(e + 148, "005335\0 ", 8); /* checksum */ + myAssertEqualMem(e + 156, "", 1); /* linkflag */ + myAssertEqualMem(e + 157, "", 1); /* linkname */ + assert(is_null(e + 0, 512)); + myAssertEqualMem(e + 512, "1234567890", 10); + assert(is_null(e + 512, 512)); + e += 1024; + + /* hardlink to "file" */ + myAssertEqualMem(e + 0, "linkfile", 9); /* Filename */ + myAssertEqualMem(e + 100, "000664 ", 8); /* mode */ + myAssertEqualMem(e + 108, "000120 ", 8); /* uid */ + myAssertEqualMem(e + 116, "000132 ", 8); /* gid */ + myAssertEqualMem(e + 124, "00000000000 ", 12); /* size */ + myAssertEqualMem(e + 136, "00000000001 ", 12); /* mtime */ + myAssertEqualMem(e + 148, "007131\0 ", 8); /* checksum */ + myAssertEqualMem(e + 156, "1", 1); /* linkflag */ + myAssertEqualMem(e + 157, "file", 5); /* linkname */ + assert(is_null(e + 0, 512)); + e += 512; + + /* "dir" */ + myAssertEqualMem(e + 0, "dir/", 4); /* Filename */ + myAssertEqualMem(e + 100, "000775 ", 8); /* mode */ + myAssertEqualMem(e + 108, "000000 ", 8); /* uid */ + myAssertEqualMem(e + 116, "000000 ", 8); /* gid */ + myAssertEqualMem(e + 124, "00000000000 ", 12); /* size */ + myAssertEqualMem(e + 136, "00000000002 ", 12); /* mtime */ + myAssertEqualMem(e + 148, "005243\0 ", 8); /* checksum */ + myAssertEqualMem(e + 156, "", 1); /* typeflag */ + myAssertEqualMem(e + 157, "", 1); /* linkname */ + assert(is_null(e + 0, 512)); + e += 512; + + /* "symlink" pointing to "file" */ + myAssertEqualMem(e + 0, "symlink", 8); /* Filename */ + myAssertEqualMem(e + 100, "000664 ", 8); /* mode */ + myAssertEqualMem(e + 108, "000130 ", 8); /* uid */ + myAssertEqualMem(e + 116, "000142 ", 8); /* gid */ + myAssertEqualMem(e + 124, "00000000000 ", 12); /* size */ + myAssertEqualMem(e + 136, "00000000003 ", 12); /* mtime */ + myAssertEqualMem(e + 148, "007027\0 ", 8); /* checksum */ + myAssertEqualMem(e + 156, "2", 1); /* linkflag */ + myAssertEqualMem(e + 157, "file", 5); /* linkname */ + assert(is_null(e + 0, 512)); + e += 512; + + /* File with 99-char filename */ + myAssertEqualMem(e + 0, f99, 100); /* Filename */ + myAssertEqualMem(e + 100, "000664 ", 8); /* mode */ + myAssertEqualMem(e + 108, "000122 ", 8); /* uid */ + myAssertEqualMem(e + 116, "000135 ", 8); /* gid */ + myAssertEqualMem(e + 124, "00000000000 ", 12); /* size */ + myAssertEqualMem(e + 136, "00000000001 ", 12); /* mtime */ + myAssertEqualMem(e + 148, "031543\0 ", 8); /* checksum */ + myAssertEqualMem(e + 156, "", 1); /* linkflag */ + myAssertEqualMem(e + 157, "", 1); /* linkname */ + assert(is_null(e + 0, 512)); + e += 512; + + /* TODO: Verify other types of entries. */ + + /* Last entry is end-of-archive marker. */ + assert(is_null(e, 1024)); + e += 1024; + + assertEqualInt((int)used, e - buff); + + free(buff); +} diff --git a/libarchive/test/test_write_format_xar.c b/libarchive/test/test_write_format_xar.c index 449e49da1a9b..7cfdbcf4d17d 100644 --- a/libarchive/test/test_write_format_xar.c +++ b/libarchive/test/test_write_format_xar.c @@ -46,7 +46,7 @@ test_xar(const char *option) assertEqualIntA(a, ARCHIVE_OK, archive_write_free(a)); return; } - assertA(0 == archive_write_set_compression_none(a)); + assertA(0 == archive_write_add_filter_none(a)); if (option != NULL && archive_write_set_options(a, option) != ARCHIVE_OK) { skipping("option `%s` is not supported on this platform", option); diff --git a/libarchive/test/test_write_format_xar_empty.c b/libarchive/test/test_write_format_xar_empty.c index c9e6c4a221f1..aa26d5d151c9 100644 --- a/libarchive/test/test_write_format_xar_empty.c +++ b/libarchive/test/test_write_format_xar_empty.c @@ -45,7 +45,7 @@ DEFINE_TEST(test_write_format_xar_empty) assertEqualIntA(a, ARCHIVE_OK, archive_write_free(a)); return; } - assertEqualIntA(a, ARCHIVE_OK, archive_write_set_compression_none(a)); + assertEqualIntA(a, ARCHIVE_OK, archive_write_add_filter_none(a)); assertEqualIntA(a, ARCHIVE_OK, archive_write_set_bytes_per_block(a, 1)); assertEqualIntA(a, ARCHIVE_OK, archive_write_set_bytes_in_last_block(a, 1)); assertEqualIntA(a, ARCHIVE_OK, diff --git a/libarchive/test/test_write_format_zip.c b/libarchive/test/test_write_format_zip.c index f7e5ebfffbb5..53ce3acc8537 100644 --- a/libarchive/test/test_write_format_zip.c +++ b/libarchive/test/test_write_format_zip.c @@ -136,7 +136,7 @@ DEFINE_TEST(test_write_format_zip) #endif assertEqualIntA(a, ARCHIVE_OK, archive_write_set_format_option(a, "zip", "compression", compression_type)); - assertEqualIntA(a, ARCHIVE_OK, archive_write_set_compression_none(a)); + assertEqualIntA(a, ARCHIVE_OK, archive_write_add_filter_none(a)); assertEqualIntA(a, ARCHIVE_OK, archive_write_open_memory(a, buff, buffsize, &used)); diff --git a/libarchive/test/test_write_format_zip_empty.c b/libarchive/test/test_write_format_zip_empty.c index 156726080520..2e3afec71fd3 100644 --- a/libarchive/test/test_write_format_zip_empty.c +++ b/libarchive/test/test_write_format_zip_empty.c @@ -40,7 +40,7 @@ DEFINE_TEST(test_write_format_zip_empty) /* Zip format: 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_compression_none(a)); + assertEqualIntA(a, ARCHIVE_OK, archive_write_add_filter_none(a)); assertEqualIntA(a, ARCHIVE_OK, archive_write_set_bytes_per_block(a, 1)); assertEqualIntA(a, ARCHIVE_OK, archive_write_set_bytes_in_last_block(a, 1)); assertEqualIntA(a, ARCHIVE_OK, archive_write_open_memory(a, buff, sizeof(buff), &used)); diff --git a/libarchive/test/test_write_format_zip_no_compression.c b/libarchive/test/test_write_format_zip_no_compression.c index 9c570c942489..9d47f9b746f7 100644 --- a/libarchive/test/test_write_format_zip_no_compression.c +++ b/libarchive/test/test_write_format_zip_no_compression.c @@ -99,7 +99,7 @@ DEFINE_TEST(test_write_format_zip_no_compression) assert((a = archive_write_new()) != NULL); assertA(0 == archive_write_set_format_zip(a)); assertA(0 == archive_write_set_options(a, "zip:compression=store")); - assertA(0 == archive_write_set_compression_none(a)); + assertA(0 == archive_write_add_filter_none(a)); assertA(0 == archive_write_set_bytes_per_block(a, 1)); assertA(0 == archive_write_set_bytes_in_last_block(a, 1)); assertA(0 == archive_write_open_memory(a, buff, sizeof(buff), &used)); diff --git a/libarchive/test/test_write_open_memory.c b/libarchive/test/test_write_open_memory.c index e9a01de08829..3dbed113e799 100644 --- a/libarchive/test/test_write_open_memory.c +++ b/libarchive/test/test_write_open_memory.c @@ -72,9 +72,9 @@ DEFINE_TEST(test_write_open_memory) archive_write_close(a)); else { assertEqualIntA(a, ARCHIVE_OK, archive_write_close(a)); - assertEqualInt(used, archive_position_compressed(a)); - assertEqualInt(archive_position_compressed(a), - archive_position_uncompressed(a)); + assertEqualInt(used, archive_filter_bytes(a, -1)); + assertEqualInt(archive_filter_bytes(a, -1), + archive_filter_bytes(a, 0)); } assertEqualInt(ARCHIVE_OK, archive_write_free(a)); assertEqualInt(buff[i], 0xAE); diff --git a/libarchive/test/test_write_zip_set_compression_store.c b/libarchive/test/test_write_zip_set_compression_store.c new file mode 100644 index 000000000000..f77eb1be0685 --- /dev/null +++ b/libarchive/test/test_write_zip_set_compression_store.c @@ -0,0 +1,308 @@ +/*- + * Copyright (c) 2012 Matthias Brantner + * 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" + +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 int i2(const char *p) { return ((p[0] & 0xff) | ((p[1] & 0xff) << 8)); } +static int i4(const char *p) { return (i2(p) | (i2(p + 2) << 16)); } + +DEFINE_TEST(test_write_zip_set_compression_store) +{ + /* Buffer data */ + struct archive *a; + struct archive_entry *entry; + char buff[100000]; + const char *buffend; + /* 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; + size_t used; + + /* File data */ + char file_name[] = "file"; + char file_data1[] = {'1', '2', '3', '4', '5'}; + char file_data2[] = {'6', '7', '8', '9', '0'}; + int file_perm = 00644; + short file_uid = 10; + short file_gid = 20; + + /* Folder data */ + char folder_name[] = "folder/"; + int folder_perm = 00755; + short folder_uid = 30; + short folder_gid = 40; + + /* Time data */ + time_t t = time(NULL); + struct tm *tm = localtime(&t); + + /* Misc variables */ + unsigned long crc; + + /* Create new ZIP archive in memory without padding. */ + assert((a = archive_write_new()) != NULL); + assertA(0 == archive_write_set_format_zip(a)); + assertA(0 == archive_write_add_filter_none(a)); + assertA(0 == archive_write_set_bytes_per_block(a, 1)); + assertA(0 == archive_write_set_bytes_in_last_block(a, 1)); + assertA(0 == archive_write_open_memory(a, buff, sizeof(buff), &used)); + + /* Write entries. */ + + /* Regular file */ + assert((entry = archive_entry_new()) != NULL); + archive_entry_set_pathname(entry, file_name); + archive_entry_set_mode(entry, S_IFREG | 0644); + archive_entry_set_size(entry, sizeof(file_data1) + sizeof(file_data2)); + archive_entry_set_uid(entry, file_uid); + archive_entry_set_gid(entry, file_gid); + archive_entry_set_mtime(entry, t, 0); + archive_entry_set_atime(entry, t, 0); + archive_entry_set_ctime(entry, t, 0); + archive_write_zip_set_compression_store(a); + assertEqualIntA(a, 0, archive_write_header(a, entry)); + assertEqualIntA(a, sizeof(file_data1), archive_write_data(a, file_data1, sizeof(file_data1))); + assertEqualIntA(a, sizeof(file_data2), archive_write_data(a, file_data2, sizeof(file_data2))); + archive_entry_free(entry); + archive_write_finish_entry(a); + + /* Folder */ + assert((entry = archive_entry_new()) != NULL); + archive_entry_set_pathname(entry, folder_name); + archive_entry_set_mode(entry, S_IFDIR | folder_perm); + archive_entry_set_size(entry, 0); + archive_entry_set_uid(entry, folder_uid); + archive_entry_set_gid(entry, folder_gid); + archive_entry_set_mtime(entry, t, 0); + archive_entry_set_atime(entry, t, 0); + archive_entry_set_ctime(entry, t, 0); + archive_write_zip_set_compression_store(a); + assertEqualIntA(a, 0, archive_write_header(a, entry)); + archive_entry_free(entry); + archive_write_finish_entry(a); + + /* Close the archive . */ + assertEqualIntA(a, ARCHIVE_OK, archive_write_close(a)); + assertEqualInt(ARCHIVE_OK, archive_write_free(a)); + + /* Remember the end of the archive in memory. */ + buffend = buff + used; + + /* Verify "End of Central Directory" record. */ + /* Get address of end-of-central-directory 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)); + failure("CD start (%d) + CD length (%d) should == archive size - 22", + i4(p + 12), i4(p + 16)); + assertEqualInt(i4(p + 12) + i4(p + 16), used - 22); + failure("no zip comment"); + assertEqualInt(i2(p + 20), 0); + + /* Get address of first entry in central directory. */ + 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 + 20); /* Version made by */ + assertEqualInt(i2(p + 6), 20); /* Version needed to extract */ + assertEqualInt(i2(p + 8), 8); /* Flags */ + assertEqualInt(i2(p + 10), 0); /* Compression method */ + assertEqualInt(i2(p + 12), (tm->tm_hour * 2048) + (tm->tm_min * 32) + (tm->tm_sec / 2)); /* File time */ + assertEqualInt(i2(p + 14), ((tm->tm_year - 80) * 512) + ((tm->tm_mon + 1) * 32) + tm->tm_mday); /* File date */ + crc = bitcrc32(0, file_data1, sizeof(file_data1)); + crc = bitcrc32(crc, file_data2, sizeof(file_data2)); + assertEqualInt(i4(p + 16), crc); /* CRC-32 */ + 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), 13); /* 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 */ + 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 = p + 46 + strlen(file_name); + assertEqualInt(i2(p), 0x5455); /* 'UT' extension header */ + assertEqualInt(i2(p + 2), 5); /* 'UT' size */ + assertEqualInt(p[4], 7); /* 'UT' flags */ + assertEqualInt(i4(p + 5), t); /* 'UT' mtime */ + p = p + 9; + assertEqualInt(i2(p), 0x7875); /* 'ux' extension header */ + assertEqualInt(i2(p + 2), 0); /* 'ux' size */ + p = p + 4; + + /* Verify local header of file entry. */ + q = buff; + assertEqualMem(q, "PK\003\004", 4); /* Signature */ + assertEqualInt(i2(q + 4), 20); /* Version needed to extract */ + assertEqualInt(i2(q + 6), 8); /* Flags */ + 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(i2(q + 26), strlen(file_name)); /* Pathname length */ + assertEqualInt(i2(q + 28), 32); /* Extra field length */ + assertEqualMem(q + 30, file_name, strlen(file_name)); /* Pathname */ + q = q + 30 + strlen(file_name); + assertEqualInt(i2(q), 0x5455); /* 'UT' extension header */ + assertEqualInt(i2(q + 2), 13); /* 'UT' size */ + assertEqualInt(q[4], 7); /* 'UT' flags */ + assertEqualInt(i4(q + 5), t); /* 'UT' mtime */ + assertEqualInt(i4(q + 9), t); /* 'UT' atime */ + assertEqualInt(i4(q + 13), t); /* 'UT' ctime */ + q = q + 17; + assertEqualInt(i2(q), 0x7875); /* 'ux' extension header */ + assertEqualInt(i2(q + 2), 11); /* 'ux' size */ + assertEqualInt(q[4], 1); /* 'ux' version */ + assertEqualInt(q[5], 4); /* 'ux' uid size */ + assertEqualInt(i4(q + 6), file_uid); /* 'Ux' UID */ + assertEqualInt(q[10], 4); /* 'ux' gid size */ + assertEqualInt(i4(q + 11), file_gid); /* 'Ux' GID */ + q = q + 15; + + /* Verify data of file entry. */ + assertEqualMem(q, file_data1, sizeof(file_data1)); + assertEqualMem(q + sizeof(file_data1), file_data2, sizeof(file_data2)); + q = q + sizeof(file_data1) + sizeof(file_data2); + + /* Verify data descriptor of file entry. */ + assertEqualMem(q, "PK\007\010", 4); /* Signature */ + assertEqualInt(i4(q + 4), crc); /* CRC-32 */ + assertEqualInt(i4(q + 8), sizeof(file_data1) + sizeof(file_data2)); /* Compressed size */ + assertEqualInt(i4(q + 12), sizeof(file_data1) + sizeof(file_data2)); /* Uncompressed size */ + q = q + 16; + + /* Verify folder entry in central directory. */ + assertEqualMem(p, "PK\001\002", 4); /* Signature */ + assertEqualInt(i2(p + 4), 3 * 256 + 20); /* Version made by */ + assertEqualInt(i2(p + 6), 20); /* Version needed to extract */ + assertEqualInt(i2(p + 8), 8); /* Flags */ + assertEqualInt(i2(p + 10), 0); /* Compression method */ + assertEqualInt(i2(p + 12), (tm->tm_hour * 2048) + (tm->tm_min * 32) + (tm->tm_sec / 2)); /* File time */ + assertEqualInt(i2(p + 14), ((tm->tm_year - 80) * 512) + ((tm->tm_mon + 1) * 32) + tm->tm_mday); /* File date */ + crc = 0; + assertEqualInt(i4(p + 16), crc); /* CRC-32 */ + 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), 13); /* 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 */ + assertEqualInt(i4(p + 38) >> 16 & 01777, folder_perm); /* External file attrs */ + 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), 5); /* 'UT' size */ + assertEqualInt(p[4], 7); /* 'UT' flags */ + assertEqualInt(i4(p + 5), t); /* 'UT' mtime */ + p = p + 9; + assertEqualInt(i2(p), 0x7875); /* 'ux' extension header */ + assertEqualInt(i2(p + 2), 0); /* 'ux' size */ + /*p = p + 4;*/ + + /* Verify local header of folder entry. */ + assertEqualMem(q, "PK\003\004", 4); /* Signature */ + assertEqualInt(i2(q + 4), 20); /* Version needed to extract */ + assertEqualInt(i2(q + 6), 8); /* Flags */ + 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), 0); /* Compressed size */ + assertEqualInt(i4(q + 22), 0); /* Uncompressed size */ + assertEqualInt(i2(q + 26), strlen(folder_name)); /* Pathname length */ + assertEqualInt(i2(q + 28), 32); /* Extra field length */ + assertEqualMem(q + 30, folder_name, strlen(folder_name)); /* Pathname */ + q = q + 30 + strlen(folder_name); + assertEqualInt(i2(q), 0x5455); /* 'UT' extension header */ + assertEqualInt(i2(q + 2), 13); /* 'UT' size */ + assertEqualInt(q[4], 7); /* 'UT' flags */ + assertEqualInt(i4(q + 5), t); /* 'UT' mtime */ + assertEqualInt(i4(q + 9), t); /* 'UT' atime */ + assertEqualInt(i4(q + 13), t); /* 'UT' ctime */ + q = q + 17; + assertEqualInt(i2(q), 0x7875); /* 'ux' extension header */ + assertEqualInt(i2(q + 2), 11); /* 'ux' size */ + assertEqualInt(q[4], 1); /* 'ux' version */ + assertEqualInt(q[5], 4); /* 'ux' uid size */ + assertEqualInt(i4(q + 6), folder_uid); /* 'ux' UID */ + assertEqualInt(q[10], 4); /* 'ux' gid size */ + assertEqualInt(i4(q + 11), folder_gid); /* 'ux' GID */ + q = q + 15; + + /* There should not be any data in the folder entry, + * meaning next is the data descriptor header. */ + + /* Verify data descriptor of folder entry. */ + assertEqualMem(q, "PK\007\010", 4); /* Signature */ + assertEqualInt(i4(q + 4), crc); /* CRC-32 */ + assertEqualInt(i4(q + 8), 0); /* Compressed size */ + assertEqualInt(i4(q + 12), 0); /* Uncompressed size */ + /*q = q + 16;*/ +} diff --git a/tar/CMakeLists.txt b/tar/CMakeLists.txt index eddf7ecc1ebb..46ce58b02e2e 100644 --- a/tar/CMakeLists.txt +++ b/tar/CMakeLists.txt @@ -10,6 +10,7 @@ IF(ENABLE_TAR) bsdtar.h bsdtar_platform.h cmdline.c + creation_set.c read.c subst.c util.c diff --git a/tar/bsdtar.1 b/tar/bsdtar.1 index 8298544cc7df..7bb6a6084d54 100644 --- a/tar/bsdtar.1 +++ b/tar/bsdtar.1 @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd December 24, 2011 +.Dd November 1, 2012 .Dt TAR 1 .Os .Sh NAME @@ -144,6 +144,26 @@ pax-format archive on stdout. In this way, .Nm can be used to convert archives from one format to another. +.It Fl a , Fl Fl auto-compress +(c mode only) +Use the archive suffix to decide a set of the format and +the compressions. +As a simple example, +.Dl Nm Fl a Fl cf Pa archive.tgz source.c source.h +creates a new archive with restricted pax format and gzip compression, +.Dl Nm Fl a Fl cf Pa archive.tar.bz2.uu source.c source.h +creates a new archive with restricted pax format and bzip2 compression +and uuencode compression, +.Dl Nm Fl a Fl cf Pa archive.zip source.c source.h +creates a new archive with zip format, +.Dl Nm Fl a Fl jcf Pa archive.tgz source.c source.h +ignores the +.Dq -j +option, and creates a new archive with restricted pax format +and gzip compression, +.Dl Nm Fl a Fl jcf Pa archive.xxx source.c source.h +if it is unknown suffix or no suffix, creates a new archive with +restricted pax format and bzip2 compression. .It Fl B , Fl Fl read-full-blocks Ignored for compatibility with other .Xr tar 1 @@ -233,6 +253,9 @@ Synonym for .Fl T . .It Fl Fl help Show usage. +.It Fl Fl hfsCompression +(x mode only) +Mac OS X specific(v10.6 or later). Compress extracted regular files with HFS+ compression. .It Fl Fl include Ar pattern Process only files or directories that match the specified pattern. Note that exclusions specified with @@ -286,6 +309,11 @@ With this option, the target of the link will be archived instead. .It Fl l , Fl Fl check-links (c and r modes only) Issue a warning message unless all links to each file are archived. +.It Fl Fl lrzip +(c mode only) +Compress the resulting archive with +.Xr lrzip 1 . +In extract or list modes, this option is ignored. .It Fl Fl lzma (c mode only) Compress the resulting archive with the original LZMA algorithm. Use of this option is discouraged and new archives should be created with @@ -295,6 +323,11 @@ Note that, unlike other .Nm tar implementations, this implementation recognizes LZMA compression automatically when reading archives. +.It Fl Fl lzop +(c mode only) +Compress the resulting archive with +.Xr lzop 1 . +In extract or list modes, this option is ignored. .It Fl m , Fl Fl modification-time (x mode only) Do not extract modification time. @@ -323,6 +356,11 @@ except it compares mtime entries instead of ctime entries. .It Fl Fl nodump (c and r modes only) Honor the nodump file flag by skipping this file. +.It Fl Fl nopreserveHFSCompression +(x mode only) +Mac OS X specific(v10.6 or later). Do not compress extracted regular files +which were compressed with HFS+ compression before archived. +By default, compress the regular files again with HFS+ compression. .It Fl Fl null (use with .Fl I @@ -381,6 +419,24 @@ the archive will be discarded. (c, r, u mode) A synonym for .Fl Fl format Ar ustar +.It Fl Fl older Ar date +(c, r, u modes only) +Only include files and directories older than the specified date. +This compares ctime entries. +.It Fl Fl older-mtime Ar date +(c, r, u modes only) +Like +.Fl Fl older , +except it compares mtime entries instead of ctime entries. +.It Fl Fl older-than Pa file +(c, r, u modes only) +Only include files and directories older than the specified file. +This compares ctime entries. +.It Fl Fl older-mtime-than Pa file +(c, r, u modes only) +Like +.Fl Fl older-than , +except it compares mtime entries instead of ctime entries. .It Fl Fl one-file-system (c, r, and u modes) Do not cross mount points. @@ -423,7 +479,23 @@ or .Cm iso9660:!rockridge to disable. .It Cm gzip:compression-level -A decimal integer from 0 to 9 specifying the gzip compression level. +A decimal integer from 1 to 9 specifying the gzip compression level. +.It Cm gzip:timestamp +Store timestamp. This is enabled by default, use +.Cm !timestamp +or +.Cm gzip:!timestamp +to disable. +.It Cm lrzip:compression Ns = Ns Ar type +Use +.Ar type +as compression method. +Supported values are bzip2, gzip, lzo (ultra fast), +and zpaq (best, extremely slow). +.It Cm lrzip:compression-level +A decimal integer from 1 to 9 specifying the lrzip compression level. +.It Cm lzop:compression-level +A decimal integer from 1 to 9 specifying the lzop compression level. .It Cm xz:compression-level A decimal integer from 0 to 9 specifying the xz compression level. .It Cm mtree: Ns Ar keyword @@ -565,6 +637,11 @@ Note that .Fl Fl null also disables the special handling of lines containing .Dq -C . +Note: If you are generating lists of files using +.Xr find 1 , +you probably want to use +.Fl n +as well. .It Fl Fl totals (c, r, u mode only) After archiving all files, print a summary to stderr. @@ -660,6 +737,16 @@ automatically when reading archives. The following environment variables affect the execution of .Nm : .Bl -tag -width ".Ev BLOCKSIZE" +.It Ev TAR_READER_OPTIONS +The default options for format readers and compression readers. +The +.Fl Fl options +option overrides this. +.It Ev TAR_WRITER_OPTIONS +The default options for format writers and compression writers. +The +.Fl Fl options +option overrides this. .It Ev LANG The locale to use. See diff --git a/tar/bsdtar.c b/tar/bsdtar.c index b92ada1ecb3c..47267579f0c4 100644 --- a/tar/bsdtar.c +++ b/tar/bsdtar.c @@ -134,7 +134,10 @@ main(int argc, char **argv) { struct bsdtar *bsdtar, bsdtar_storage; int opt, t; - char option_o; + char compression, compression2; + const char *compression_name, *compression2_name; + const char *compress_program; + char option_a, option_o; char possible_help_request; char buff[16]; @@ -147,7 +150,10 @@ main(int argc, char **argv) bsdtar->fd = -1; /* Mark as "unused" */ bsdtar->gid = -1; bsdtar->uid = -1; - option_o = 0; + option_a = option_o = 0; + compression = compression2 = '\0'; + compression_name = compression2_name = NULL; + compress_program = NULL; #if defined(HAVE_SIGACTION) { /* Set up signal handling. */ @@ -243,6 +249,9 @@ main(int argc, char **argv) bsdtar->matching = archive_match_new(); if (bsdtar->matching == NULL) lafe_errc(1, errno, "Out of memory"); + bsdtar->cset = cset_new(); + if (bsdtar->cset == NULL) + lafe_errc(1, errno, "Out of memory"); bsdtar->argv = argv; bsdtar->argc = argc; @@ -255,6 +264,9 @@ main(int argc, char **argv) */ while ((opt = bsdtar_getopt(bsdtar)) != -1) { switch (opt) { + case 'a': /* GNU tar */ + option_a = 1; /* Record it and resolve it later. */ + break; case 'B': /* GNU tar */ /* libarchive doesn't need this; just ignore it. */ break; @@ -267,6 +279,14 @@ main(int argc, char **argv) /* Explicit -b forces last block size. */ bsdtar->bytes_in_last_block = bsdtar->bytes_per_block; break; + case OPTION_B64ENCODE: + if (compression2 != '\0') + lafe_errc(1, 0, + "Can't specify both --uuencode and " + "--b64encode"); + compression2 = opt; + compression2_name = "b64encode"; + break; case 'C': /* GNU tar */ if (strlen(bsdtar->argument) == 0) lafe_errc(1, 0, @@ -293,7 +313,7 @@ main(int argc, char **argv) "Couldn't exclude %s\n", bsdtar->argument); break; case OPTION_FORMAT: /* GNU tar, others */ - bsdtar->create_format = bsdtar->argument; + cset_set_format(bsdtar->cset, bsdtar->argument); break; case 'f': /* SUSv2 */ bsdtar->filename = bsdtar->argument; @@ -308,6 +328,14 @@ main(int argc, char **argv) case OPTION_GNAME: /* cpio */ bsdtar->gname = bsdtar->argument; break; + case OPTION_GRZIP: + if (compression != '\0') + lafe_errc(1, 0, + "Can't specify both -%c and -%c", opt, + compression); + compression = opt; + compression_name = "grzip"; + break; case 'H': /* BSD convention */ bsdtar->symlink_mode = 'H'; break; @@ -320,6 +348,10 @@ main(int argc, char **argv) long_help(); exit(0); break; + case OPTION_HFS_COMPRESSION: /* Mac OS X v10.6 or later */ + bsdtar->extract_flags |= + ARCHIVE_EXTRACT_HFS_COMPRESSION_FORCED; + break; case 'I': /* GNU tar */ /* * TODO: Allow 'names' to come from an archive, @@ -346,18 +378,20 @@ main(int argc, char **argv) bsdtar->argument); break; case 'j': /* GNU tar */ - if (bsdtar->create_compression != '\0') + if (compression != '\0') lafe_errc(1, 0, "Can't specify both -%c and -%c", opt, - bsdtar->create_compression); - bsdtar->create_compression = opt; + compression); + compression = opt; + compression_name = "bzip2"; break; case 'J': /* GNU tar 1.21 and later */ - if (bsdtar->create_compression != '\0') + if (compression != '\0') lafe_errc(1, 0, "Can't specify both -%c and -%c", opt, - bsdtar->create_compression); - bsdtar->create_compression = opt; + compression); + compression = opt; + compression_name = "xz"; break; case 'k': /* GNU tar */ bsdtar->extract_flags |= ARCHIVE_EXTRACT_NO_OVERWRITE; @@ -372,13 +406,21 @@ main(int argc, char **argv) /* GNU tar 1.13 used -l for --one-file-system */ bsdtar->option_warn_links = 1; break; + case OPTION_LRZIP: case OPTION_LZIP: /* GNU tar beginning with 1.23 */ case OPTION_LZMA: /* GNU tar beginning with 1.20 */ - if (bsdtar->create_compression != '\0') + case OPTION_LZOP: /* GNU tar beginning with 1.21 */ + if (compression != '\0') lafe_errc(1, 0, "Can't specify both -%c and -%c", opt, - bsdtar->create_compression); - bsdtar->create_compression = opt; + compression); + compression = opt; + switch (opt) { + case OPTION_LRZIP: compression_name = "lrzip"; break; + case OPTION_LZIP: compression_name = "lzip"; break; + case OPTION_LZMA: compression_name = "lzma"; break; + case OPTION_LZOP: compression_name = "lzop"; break; + } break; case 'm': /* SUSv2 */ bsdtar->extract_flags &= ~ARCHIVE_EXTRACT_TIME; @@ -391,7 +433,6 @@ main(int argc, char **argv) * --newer-?time='date' Only files newer than 'date' * --newer-?time-than='file' Only files newer than time * on specified file (useful for incremental backups) - * TODO: Add corresponding "older" options to reverse these. */ case OPTION_NEWER_CTIME: /* GNU tar */ if (archive_match_include_date(bsdtar->matching, @@ -424,6 +465,11 @@ main(int argc, char **argv) case OPTION_NODUMP: /* star */ bsdtar->readdisk_flags |= ARCHIVE_READDISK_HONOR_NODUMP; break; + case OPTION_NOPRESERVE_HFS_COMPRESSION: + /* Mac OS X v10.6 or later */ + bsdtar->extract_flags |= + ARCHIVE_EXTRACT_NO_HFS_COMPRESSION; + break; case OPTION_NO_SAME_OWNER: /* GNU tar */ bsdtar->extract_flags &= ~ARCHIVE_EXTRACT_OWNER; break; @@ -448,6 +494,40 @@ main(int argc, char **argv) case 'o': /* SUSv2 and GNU conflict here, but not fatally */ option_o = 1; /* Record it and resolve it later. */ break; + /* + * Selecting files by time: + * --older-?time='date' Only files older than 'date' + * --older-?time-than='file' Only files older than time + * on specified file + */ + case OPTION_OLDER_CTIME: + if (archive_match_include_date(bsdtar->matching, + ARCHIVE_MATCH_CTIME | ARCHIVE_MATCH_OLDER, + bsdtar->argument) != ARCHIVE_OK) + lafe_errc(1, 0, "Error : %s", + archive_error_string(bsdtar->matching)); + break; + case OPTION_OLDER_CTIME_THAN: + if (archive_match_include_file_time(bsdtar->matching, + ARCHIVE_MATCH_CTIME | ARCHIVE_MATCH_OLDER, + bsdtar->argument) != ARCHIVE_OK) + lafe_errc(1, 0, "Error : %s", + archive_error_string(bsdtar->matching)); + break; + case OPTION_OLDER_MTIME: + if (archive_match_include_date(bsdtar->matching, + ARCHIVE_MATCH_MTIME | ARCHIVE_MATCH_OLDER, + bsdtar->argument) != ARCHIVE_OK) + lafe_errc(1, 0, "Error : %s", + archive_error_string(bsdtar->matching)); + break; + case OPTION_OLDER_MTIME_THAN: + if (archive_match_include_file_time(bsdtar->matching, + ARCHIVE_MATCH_MTIME | ARCHIVE_MATCH_OLDER, + bsdtar->argument) != ARCHIVE_OK) + lafe_errc(1, 0, "Error : %s", + archive_error_string(bsdtar->matching)); + break; case OPTION_ONE_FILE_SYSTEM: /* GNU tar */ bsdtar->readdisk_flags |= ARCHIVE_READDISK_NO_TRAVERSE_MOUNTS; @@ -478,7 +558,7 @@ main(int argc, char **argv) bsdtar->extract_flags |= ARCHIVE_EXTRACT_MAC_METADATA; break; case OPTION_POSIX: /* GNU tar */ - bsdtar->create_format = "pax"; + cset_set_format(bsdtar->cset, "pax"); break; case 'q': /* FreeBSD GNU tar --fast-read, NetBSD -q */ bsdtar->option_fast_read = 1; @@ -490,7 +570,7 @@ main(int argc, char **argv) bsdtar->extract_flags |= ARCHIVE_EXTRACT_SPARSE; break; case 's': /* NetBSD pax-as-tar */ -#if HAVE_REGEX_H +#if defined(HAVE_REGEX_H) || defined(HAVE_PCREPOSIX_H) add_substitution(bsdtar, bsdtar->argument); #else lafe_warnc(0, @@ -537,6 +617,14 @@ main(int argc, char **argv) case OPTION_UNAME: /* cpio */ bsdtar->uname = bsdtar->argument; break; + case OPTION_UUENCODE: + if (compression2 != '\0') + lafe_errc(1, 0, + "Can't specify both --uuencode and " + "--b64encode"); + compression2 = opt; + compression2_name = "uuencode"; + break; case 'v': /* SUSv2 */ bsdtar->verbose++; break; @@ -565,28 +653,31 @@ main(int argc, char **argv) set_mode(bsdtar, opt); break; case 'y': /* FreeBSD version of GNU tar */ - if (bsdtar->create_compression != '\0') + if (compression != '\0') lafe_errc(1, 0, "Can't specify both -%c and -%c", opt, - bsdtar->create_compression); - bsdtar->create_compression = opt; + compression); + compression = opt; + compression_name = "bzip2"; break; case 'Z': /* GNU tar */ - if (bsdtar->create_compression != '\0') + if (compression != '\0') lafe_errc(1, 0, "Can't specify both -%c and -%c", opt, - bsdtar->create_compression); - bsdtar->create_compression = opt; + compression); + compression = opt; + compression_name = "compress"; break; case 'z': /* GNU tar, star, many others */ - if (bsdtar->create_compression != '\0') + if (compression != '\0') lafe_errc(1, 0, "Can't specify both -%c and -%c", opt, - bsdtar->create_compression); - bsdtar->create_compression = opt; + compression); + compression = opt; + compression_name = "gzip"; break; case OPTION_USE_COMPRESS_PROGRAM: - bsdtar->compress_program = bsdtar->argument; + compress_program = bsdtar->argument; break; default: usage(); @@ -609,10 +700,16 @@ main(int argc, char **argv) "Must specify one of -c, -r, -t, -u, -x"); /* Check boolean options only permitted in certain modes. */ + if (option_a) + only_mode(bsdtar, "-a", "c"); if (bsdtar->readdisk_flags & ARCHIVE_READDISK_NO_TRAVERSE_MOUNTS) only_mode(bsdtar, "--one-file-system", "cru"); if (bsdtar->option_fast_read) only_mode(bsdtar, "--fast-read", "xt"); + if (bsdtar->extract_flags & ARCHIVE_EXTRACT_HFS_COMPRESSION_FORCED) + only_mode(bsdtar, "--hfsCompression", "x"); + if (bsdtar->extract_flags & ARCHIVE_EXTRACT_NO_HFS_COMPRESSION) + only_mode(bsdtar, "--nopreserveHFSCompression", "x"); if (bsdtar->readdisk_flags & ARCHIVE_READDISK_HONOR_NODUMP) only_mode(bsdtar, "--nodump", "cru"); if (option_o > 0) { @@ -623,7 +720,7 @@ main(int argc, char **argv) * "ustar" format is the closest thing * supported by libarchive. */ - bsdtar->create_format = "ustar"; + cset_set_format(bsdtar->cset, "ustar"); /* TODO: bsdtar->create_format = "v7"; */ break; case 'x': @@ -645,13 +742,40 @@ main(int argc, char **argv) if (bsdtar->option_warn_links) only_mode(bsdtar, "--check-links", "cr"); - /* Check other parameters only permitted in certain modes. */ - if (bsdtar->create_compression != '\0') { - strcpy(buff, "-?"); - buff[1] = bsdtar->create_compression; - only_mode(bsdtar, buff, "cxt"); + if (option_a && cset_auto_compress(bsdtar->cset, bsdtar->filename)) { + /* Ignore specified compressions if auto-compress works. */ + compression = '\0'; + compression2 = '\0'; } - if (bsdtar->create_format != NULL) + /* Check other parameters only permitted in certain modes. */ + if (compress_program != NULL) { + only_mode(bsdtar, "--use-compress-program", "cxt"); + cset_add_filter_program(bsdtar->cset, compress_program); + /* Ignore specified compressions. */ + compression = '\0'; + compression2 = '\0'; + } + if (compression != '\0') { + switch (compression) { + case 'J': case 'j': case 'y': case 'Z': case 'z': + strcpy(buff, "-?"); + buff[1] = compression; + break; + default: + strcpy(buff, "--"); + strcat(buff, compression_name); + break; + } + only_mode(bsdtar, buff, "cxt"); + cset_add_filter(bsdtar->cset, compression_name); + } + if (compression2 != '\0') { + strcpy(buff, "--"); + strcat(buff, compression2_name); + only_mode(bsdtar, buff, "cxt"); + cset_add_filter(bsdtar->cset, compression2_name); + } + if (cset_get_format(bsdtar->cset) != NULL) only_mode(bsdtar, "--format", "cru"); if (bsdtar->symlink_mode != '\0') { strcpy(buff, "-?"); @@ -682,9 +806,10 @@ main(int argc, char **argv) } archive_match_free(bsdtar->matching); -#if HAVE_REGEX_H +#if defined(HAVE_REGEX_H) || defined(HAVE_PCREPOSIX_H) cleanup_substitution(bsdtar); #endif + cset_free(bsdtar->cset); if (bsdtar->return_value != 0) lafe_warnc(0, diff --git a/tar/bsdtar.h b/tar/bsdtar.h index 2387c44a3546..637e1b9d4fee 100644 --- a/tar/bsdtar.h +++ b/tar/bsdtar.h @@ -29,7 +29,11 @@ #include #define DEFAULT_BYTES_PER_BLOCK (20*512) +#define ENV_READER_OPTIONS "TAR_READER_OPTIONS" +#define ENV_WRITER_OPTIONS "TAR_WRITER_OPTIONS" +#define IGNORE_WRONG_MODULE_NAME "__ignore_wrong_module_name__," +struct creation_set; /* * The internal state for the "bsdtar" program. * @@ -41,7 +45,6 @@ struct bsdtar { /* Options */ const char *filename; /* -f filename */ - const char *create_format; /* -F format */ char *pending_chdir; /* -C dir */ const char *names_from_file; /* -T file */ int bytes_per_block; /* -b block_size */ @@ -56,8 +59,6 @@ struct bsdtar { const char *uname; /* --uname */ char mode; /* Program mode: 'c', 't', 'r', 'u', 'x' */ char symlink_mode; /* H or L, per BSD conventions */ - char create_compression; /* j, y, or z */ - const char *compress_program; char option_absolute_paths; /* -P */ char option_chroot; /* --chroot */ char option_fast_read; /* --fast-read */ @@ -72,6 +73,7 @@ struct bsdtar { char option_unlink_first; /* -U */ char option_warn_links; /* --check-links */ char day_first; /* show day before month in -tv output */ + struct creation_set *cset; /* Option parser state */ int getopt_state; @@ -111,27 +113,37 @@ struct bsdtar { /* Fake short equivalents for long options that otherwise lack them. */ enum { - OPTION_CHECK_LINKS = 1, + OPTION_B64ENCODE = 1, + OPTION_CHECK_LINKS, OPTION_CHROOT, OPTION_DISABLE_COPYFILE, OPTION_EXCLUDE, OPTION_FORMAT, OPTION_GID, OPTION_GNAME, + OPTION_GRZIP, OPTION_HELP, + OPTION_HFS_COMPRESSION, OPTION_INCLUDE, OPTION_KEEP_NEWER_FILES, + OPTION_LRZIP, OPTION_LZIP, OPTION_LZMA, + OPTION_LZOP, OPTION_NEWER_CTIME, OPTION_NEWER_CTIME_THAN, OPTION_NEWER_MTIME, OPTION_NEWER_MTIME_THAN, OPTION_NODUMP, + OPTION_NOPRESERVE_HFS_COMPRESSION, OPTION_NO_SAME_OWNER, OPTION_NO_SAME_PERMISSIONS, OPTION_NULL, OPTION_NUMERIC_OWNER, + OPTION_OLDER_CTIME, + OPTION_OLDER_CTIME_THAN, + OPTION_OLDER_MTIME, + OPTION_OLDER_MTIME_THAN, OPTION_ONE_FILE_SYSTEM, OPTION_OPTIONS, OPTION_POSIX, @@ -141,6 +153,7 @@ enum { OPTION_UID, OPTION_UNAME, OPTION_USE_COMPRESS_PROGRAM, + OPTION_UUENCODE, OPTION_VERSION }; @@ -160,8 +173,21 @@ void tar_mode_x(struct bsdtar *bsdtar); void usage(void); int yes(const char *fmt, ...); -#if HAVE_REGEX_H +#if defined(HAVE_REGEX_H) || defined(HAVE_PCREPOSIX_H) void add_substitution(struct bsdtar *, const char *); int apply_substitution(struct bsdtar *, const char *, char **, int, int); void cleanup_substitution(struct bsdtar *); #endif + +void cset_add_filter(struct creation_set *, const char *); +void cset_add_filter_program(struct creation_set *, const char *); +int cset_auto_compress(struct creation_set *, const char *); +void cset_free(struct creation_set *); +const char * cset_get_format(struct creation_set *); +struct creation_set *cset_new(void); +int cset_read_support_filter_program(struct creation_set *, + struct archive *); +void cset_set_format(struct creation_set *, const char *); +int cset_write_add_filters(struct creation_set *, + struct archive *, const void **); + diff --git a/tar/cmdline.c b/tar/cmdline.c index 83bbda13629f..4444b80c5580 100644 --- a/tar/cmdline.c +++ b/tar/cmdline.c @@ -47,7 +47,7 @@ __FBSDID("$FreeBSD$"); * Short options for tar. Please keep this sorted. */ static const char *short_options - = "Bb:C:cf:HhI:JjkLlmnOoPpqrSs:T:tUuvW:wX:xyZz"; + = "aBb:C:cf:HhI:JjkLlmnOoPpqrSs:T:tUuvW:wX:xyZz"; /* * Long options for tar. Please keep this list sorted. @@ -65,6 +65,8 @@ static const struct bsdtar_option { } tar_longopts[] = { { "absolute-paths", 0, 'P' }, { "append", 0, 'r' }, + { "auto-compress", 0, 'a' }, + { "b64encode", 0, OPTION_B64ENCODE }, { "block-size", 1, 'b' }, { "bunzip2", 0, 'j' }, { "bzip", 0, 'j' }, @@ -87,17 +89,21 @@ static const struct bsdtar_option { { "format", 1, OPTION_FORMAT }, { "gid", 1, OPTION_GID }, { "gname", 1, OPTION_GNAME }, + { "grzip", 0, OPTION_GRZIP }, { "gunzip", 0, 'z' }, { "gzip", 0, 'z' }, { "help", 0, OPTION_HELP }, + { "hfsCompression", 0, OPTION_HFS_COMPRESSION }, { "include", 1, OPTION_INCLUDE }, { "insecure", 0, 'P' }, { "interactive", 0, 'w' }, { "keep-newer-files", 0, OPTION_KEEP_NEWER_FILES }, { "keep-old-files", 0, 'k' }, { "list", 0, 't' }, + { "lrzip", 0, OPTION_LRZIP }, { "lzip", 0, OPTION_LZIP }, { "lzma", 0, OPTION_LZMA }, + { "lzop", 0, OPTION_LZOP }, { "modification-time", 0, 'm' }, { "newer", 1, OPTION_NEWER_CTIME }, { "newer-ctime", 1, OPTION_NEWER_CTIME }, @@ -109,9 +115,16 @@ static const struct bsdtar_option { { "no-same-owner", 0, OPTION_NO_SAME_OWNER }, { "no-same-permissions", 0, OPTION_NO_SAME_PERMISSIONS }, { "nodump", 0, OPTION_NODUMP }, + { "nopreserveHFSCompression",0, OPTION_NOPRESERVE_HFS_COMPRESSION }, { "norecurse", 0, 'n' }, { "null", 0, OPTION_NULL }, { "numeric-owner", 0, OPTION_NUMERIC_OWNER }, + { "older", 1, OPTION_OLDER_CTIME }, + { "older-ctime", 1, OPTION_OLDER_CTIME }, + { "older-ctime-than", 1, OPTION_OLDER_CTIME_THAN }, + { "older-mtime", 1, OPTION_OLDER_MTIME }, + { "older-mtime-than", 1, OPTION_OLDER_MTIME_THAN }, + { "older-than", 1, OPTION_OLDER_CTIME_THAN }, { "one-file-system", 0, OPTION_ONE_FILE_SYSTEM }, { "options", 1, OPTION_OPTIONS }, { "posix", 0, OPTION_POSIX }, @@ -129,6 +142,7 @@ static const struct bsdtar_option { { "unlink-first", 0, 'U' }, { "update", 0, 'u' }, { "use-compress-program", 1, OPTION_USE_COMPRESS_PROGRAM }, + { "uuencode", 0, OPTION_UUENCODE }, { "verbose", 0, 'v' }, { "version", 0, OPTION_VERSION }, { "xz", 0, 'J' }, diff --git a/tar/creation_set.c b/tar/creation_set.c new file mode 100644 index 000000000000..3d7764d46dba --- /dev/null +++ b/tar/creation_set.c @@ -0,0 +1,314 @@ +/*- + * Copyright (c) 2012 Michihiro NAKAJIMA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +#include "bsdtar_platform.h" +__FBSDID("$FreeBSD$"); + +#ifdef HAVE_STDLIB_H +#include +#endif +#ifdef HAVE_STRING_H +#include +#endif + +#include "bsdtar.h" +#include "err.h" + +struct creation_set { + char *create_format; + struct filter_set { + int program; /* Set 1 if filter is a program name */ + char *filter_name; + } *filters; + int filter_count; +}; + +struct suffix_code_t { + const char *suffix; + const char *form; +}; + +static const char * +get_suffix_code(const struct suffix_code_t *tbl, const char *suffix) +{ + int i; + + if (suffix == NULL) + return (NULL); + for (i = 0; tbl[i].suffix != NULL; i++) { + if (strcmp(tbl[i].suffix, suffix) == 0) + return (tbl[i].form); + } + return (NULL); +} + +static const char * +get_filter_code(const char *suffix) +{ + /* A pair of suffix and compression/filter. */ + static const struct suffix_code_t filters[] = { + { ".Z", "compress" }, + { ".bz2", "bzip2" }, + { ".gz", "gzip" }, + { ".grz", "grzip" }, + { ".lrz", "lrzip" }, + { ".lz", "lzip" }, + { ".lzo", "lzop" }, + { ".lzma", "lzma" }, + { ".uu", "uuencode" }, + { ".xz", "xz" }, + { NULL, NULL } + }; + + return get_suffix_code(filters, suffix); +} + +static const char * +get_format_code(const char *suffix) +{ + /* A pair of suffix and format. */ + static const struct suffix_code_t formats[] = { + { ".7z", "7zip" }, + { ".ar", "arbsd" }, + { ".cpio", "cpio" }, + { ".iso", "iso9960" }, + { ".mtree", "mtree" }, + { ".shar", "shar" }, + { ".tar", "paxr" }, + { ".xar", "xar" }, + { ".zip", "zip" }, + { NULL, NULL } + }; + + return get_suffix_code(formats, suffix); +} + +static const char * +decompose_alias(const char *suffix) +{ + static const struct suffix_code_t alias[] = { + { ".taz", ".tar.gz" }, + { ".tgz", ".tar.gz" }, + { ".tbz", ".tar.bz2" }, + { ".tbz2", ".tar.bz2" }, + { ".tz2", ".tar.bz2" }, + { ".tlz", ".tar.lzma" }, + { ".txz", ".tar.xz" }, + { ".tzo", ".tar.lzo" }, + { ".taZ", ".tar.Z" }, + { ".tZ", ".tar.Z" }, + { NULL, NULL } + }; + + return get_suffix_code(alias, suffix); +} + +static void +_cset_add_filter(struct creation_set *cset, int program, const char *filter) +{ + struct filter_set *new_ptr; + char *new_filter; + + new_ptr = (struct filter_set *)realloc(cset->filters, + sizeof(*cset->filters) * (cset->filter_count + 1)); + if (new_ptr == NULL) + lafe_errc(1, 0, "No memory"); + new_filter = strdup(filter); + if (new_filter == NULL) + lafe_errc(1, 0, "No memory"); + cset->filters = new_ptr; + cset->filters[cset->filter_count].program = program; + cset->filters[cset->filter_count].filter_name = new_filter; + cset->filter_count++; +} + +void +cset_add_filter(struct creation_set *cset, const char *filter) +{ + _cset_add_filter(cset, 0, filter); +} + +void +cset_add_filter_program(struct creation_set *cset, const char *filter) +{ + _cset_add_filter(cset, 1, filter); +} + +int +cset_read_support_filter_program(struct creation_set *cset, struct archive *a) +{ + int cnt = 0, i; + + for (i = 0; i < cset->filter_count; i++) { + if (cset->filters[i].program) { + archive_read_support_filter_program(a, + cset->filters[i].filter_name); + ++cnt; + } + } + return (cnt); +} + +int +cset_write_add_filters(struct creation_set *cset, struct archive *a, + const void **filter_name) +{ + int cnt = 0, i, r; + + for (i = 0; i < cset->filter_count; i++) { + if (cset->filters[i].program) + r = archive_write_add_filter_program(a, + cset->filters[i].filter_name); + else + r = archive_write_add_filter_by_name(a, + cset->filters[i].filter_name); + if (r < ARCHIVE_WARN) { + *filter_name = cset->filters[i].filter_name; + return (r); + } + ++cnt; + } + return (cnt); +} + +void +cset_set_format(struct creation_set *cset, const char *format) +{ + char *f; + + f = strdup(format); + if (f == NULL) + lafe_errc(1, 0, "No memory"); + free(cset->create_format); + cset->create_format = f; +} + +const char * +cset_get_format(struct creation_set *cset) +{ + return (cset->create_format); +} + +static void +_cleanup_filters(struct filter_set *filters, int count) +{ + int i; + + for (i = 0; i < count; i++) + free(filters[i].filter_name); + free(filters); +} + +/* + * Clean up a creation set. + */ +void +cset_free(struct creation_set *cset) +{ + _cleanup_filters(cset->filters, cset->filter_count); + free(cset->create_format); + free(cset); +} + +struct creation_set * +cset_new(void) +{ + return calloc(1, sizeof(struct creation_set)); +} + +/* + * Build a creation set by a file name suffix. + */ +int +cset_auto_compress(struct creation_set *cset, const char *filename) +{ + struct filter_set *old_filters; + char *name, *p; + const char *code; + int old_filter_count; + + name = strdup(filename); + if (name == NULL) + lafe_errc(1, 0, "No memory"); + /* Save previous filters. */ + old_filters = cset->filters; + old_filter_count = cset->filter_count; + cset->filters = NULL; + cset->filter_count = 0; + + for (;;) { + /* Get the suffix. */ + p = strrchr(name, '.'); + if (p == NULL) + break; + /* Suppose it indicates compression/filter type + * such as ".gz". */ + code = get_filter_code(p); + if (code != NULL) { + cset_add_filter(cset, code); + *p = '\0'; + continue; + } + /* Suppose it indicates format type such as ".tar". */ + code = get_format_code(p); + if (code != NULL) { + cset_set_format(cset, code); + break; + } + /* Suppose it indicates alias such as ".tgz". */ + code = decompose_alias(p); + if (code == NULL) + break; + /* Replace the suffix. */ + *p = '\0'; + name = realloc(name, strlen(name) + strlen(code) + 1); + if (name == NULL) + lafe_errc(1, 0, "No memory"); + strcat(name, code); + } + free(name); + if (cset->filters) { + struct filter_set *v; + int i, r; + + /* Release previos filters. */ + _cleanup_filters(old_filters, old_filter_count); + + v = malloc(sizeof(*v) * cset->filter_count); + if (v == NULL) + lafe_errc(1, 0, "No memory"); + /* Reverse filter sequence. */ + for (i = 0, r = cset->filter_count; r > 0; ) + v[i++] = cset->filters[--r]; + free(cset->filters); + cset->filters = v; + return (1); + } else { + /* Put previos filters back. */ + cset->filters = old_filters; + cset->filter_count = old_filter_count; + return (0); + } +} diff --git a/tar/read.c b/tar/read.c index 676ea0aa381b..e2bacad9573c 100644 --- a/tar/read.c +++ b/tar/read.c @@ -125,8 +125,8 @@ progress_func(void *cookie) if (bsdtar->verbose) fprintf(stderr, "\n"); if (a != NULL) { - comp = archive_position_compressed(a); - uncomp = archive_position_uncompressed(a); + comp = archive_filter_bytes(a, -1); + uncomp = archive_filter_bytes(a, 0); if (comp > uncomp) compression = 0; else @@ -155,6 +155,7 @@ read_archive(struct bsdtar *bsdtar, char mode, struct archive *writer) FILE *out; struct archive *a; struct archive_entry *entry; + const char *reader_options; int r; while (*bsdtar->argv) { @@ -173,14 +174,35 @@ read_archive(struct bsdtar *bsdtar, char mode, struct archive *writer) archive_error_string(bsdtar->matching)); a = archive_read_new(); - if (bsdtar->compress_program != NULL) - archive_read_support_filter_program(a, bsdtar->compress_program); - else + if (cset_read_support_filter_program(bsdtar->cset, a) == 0) archive_read_support_filter_all(a); archive_read_support_format_all(a); + + reader_options = getenv(ENV_READER_OPTIONS); + if (reader_options != NULL) { + char *p; + /* Set default read options. */ + p = malloc(sizeof(IGNORE_WRONG_MODULE_NAME) + + strlen(reader_options) + 1); + if (p == NULL) + lafe_errc(1, errno, "Out of memory"); + /* Prepend magic code to ignore options for + * a format or modules which are not added to + * the archive read object. */ + strncpy(p, IGNORE_WRONG_MODULE_NAME, + sizeof(IGNORE_WRONG_MODULE_NAME) -1); + strcpy(p + sizeof(IGNORE_WRONG_MODULE_NAME) -1, reader_options); + r = archive_read_set_options(a, p); + free(p); + if (r == ARCHIVE_FATAL) + lafe_errc(1, 0, "%s", archive_error_string(a)); + else + archive_clear_error(a); + } if (ARCHIVE_OK != archive_read_set_options(a, bsdtar->option_options)) lafe_errc(1, 0, "%s", archive_error_string(a)); - if (archive_read_open_file(a, bsdtar->filename, bsdtar->bytes_per_block)) + if (archive_read_open_filename(a, bsdtar->filename, + bsdtar->bytes_per_block)) lafe_errc(1, 0, "Error opening archive: %s", archive_error_string(a)); @@ -338,7 +360,7 @@ read_archive(struct bsdtar *bsdtar, char mode, struct archive *writer) if (bsdtar->verbose > 2) fprintf(stdout, "Archive Format: %s, Compression: %s\n", - archive_format_name(a), archive_compression_name(a)); + archive_format_name(a), archive_filter_name(a, 0)); archive_read_free(a); } diff --git a/tar/subst.c b/tar/subst.c index 0ef95b917d5d..fd6f8e222c6a 100644 --- a/tar/subst.c +++ b/tar/subst.c @@ -26,11 +26,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 HAVE_REGEX_H +#if defined(HAVE_REGEX_H) || defined(HAVE_PCREPOSIX_H) #include "bsdtar.h" #include +#ifdef HAVE_PCREPOSIX_H +#include +#else #include +#endif #include #include @@ -317,4 +321,4 @@ cleanup_substitution(struct bsdtar *bsdtar) } free(subst); } -#endif /* HAVE_REGEX_H */ +#endif /* defined(HAVE_REGEX_H) || defined(HAVE_PCREPOSIX_H) */ diff --git a/tar/test/CMakeLists.txt b/tar/test/CMakeLists.txt index d776d781783b..98f49e29298b 100644 --- a/tar/test/CMakeLists.txt +++ b/tar/test/CMakeLists.txt @@ -5,12 +5,22 @@ ############################################ IF(ENABLE_TAR AND ENABLE_TEST) SET(bsdtar_test_SOURCES + ../../test_utils/test_utils.c main.c test.h test_0.c test_basic.c test_copy.c test_empty_mtree.c + test_extract_tar_Z.c + test_extract_tar_bz2.c + test_extract_tar_grz.c + test_extract_tar_gz.c + test_extract_tar_lrz.c + test_extract_tar_lz.c + test_extract_tar_lzma.c + test_extract_tar_lzo.c + test_extract_tar_xz.c test_format_newc.c test_help.c test_option_C_upper.c @@ -20,18 +30,29 @@ IF(ENABLE_TAR AND ENABLE_TEST) test_option_T_upper.c test_option_U_upper.c test_option_X_upper.c + test_option_a.c test_option_b.c + test_option_b64encode.c test_option_exclude.c test_option_gid_gname.c + test_option_grzip.c + test_option_j.c test_option_k.c test_option_keep_newer_files.c + test_option_lrzip.c + test_option_lzma.c + test_option_lzop.c test_option_n.c test_option_newer_than.c test_option_nodump.c + test_option_older_than.c test_option_q.c test_option_r.c test_option_s.c test_option_uid_uname.c + test_option_uuencode.c + test_option_xz.c + test_option_z.c test_patterns.c test_print_longpath.c test_stdio.c @@ -68,6 +89,8 @@ IF(ENABLE_TAR AND ENABLE_TEST) ENDMACRO (DEFINE_TEST _testname) INCLUDE(${CMAKE_CURRENT_BINARY_DIR}/list.h) + INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}) + INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/test_utils) # Experimental new test handling ADD_CUSTOM_TARGET(run_bsdtar_test diff --git a/tar/test/main.c b/tar/test/main.c index d026203ccee5..f2dcaf4ae83b 100644 --- a/tar/test/main.c +++ b/tar/test/main.c @@ -24,6 +24,7 @@ */ #include "test.h" +#include "test_utils.h" #ifdef HAVE_SYS_IOCTL_H #include #endif @@ -91,6 +92,7 @@ __FBSDID("$FreeBSD: src/usr.bin/tar/test/main.c,v 1.6 2008/11/05 06:40:53 kientz */ #if defined(_WIN32) && !defined(__CYGWIN__) #include +#include #include #ifndef F_OK #define F_OK (0) @@ -389,7 +391,6 @@ failure_finish(void *extra) fprintf(stderr, " *** forcing core dump so failure can be debugged ***\n"); abort(); - exit(1); } } @@ -622,8 +623,8 @@ assertion_equal_string(const char *file, int line, if (v1 == v2 || (v1 != NULL && v2 != NULL && strcmp(v1, v2) == 0)) return (1); failure_start(file, line, "%s != %s", e1, e2); - l1 = strlen(e1); - l2 = strlen(e2); + l1 = (int)strlen(e1); + l2 = (int)strlen(e2); if (l1 < l2) l1 = l2; strdump(e1, v1, l1, utf8); @@ -746,6 +747,8 @@ assertion_equal_mem(const char *file, int line, assertion_count(file, line); if (v1 == v2 || (v1 != NULL && v2 != NULL && memcmp(v1, v2, l) == 0)) return (1); + if (v1 == NULL || v2 == NULL) + return (0); failure_start(file, line, "%s != %s", e1, e2); logprintf(" size %s = %d\n", ld, (int)l); @@ -839,9 +842,14 @@ assertion_equal_file(const char *filename, int line, const char *fn1, const char f1 = fopen(fn1, "rb"); f2 = fopen(fn2, "rb"); + if (f1 == NULL || f2 == NULL) { + if (f1) fclose(f1); + if (f2) fclose(f2); + return (0); + } for (;;) { - n1 = fread(buff1, 1, sizeof(buff1), f1); - n2 = fread(buff2, 1, sizeof(buff2), f2); + n1 = (int)fread(buff1, 1, sizeof(buff1), f1); + n2 = (int)fread(buff2, 1, sizeof(buff2), f2); if (n1 != n2) break; if (n1 == 0 && n2 == 0) { @@ -915,7 +923,7 @@ assertion_file_contents(const char *filename, int line, const void *buff, int s, return (0); } contents = malloc(s * 2); - n = fread(contents, 1, s * 2, f); + n = (int)fread(contents, 1, s * 2, f); fclose(f); if (n == s && memcmp(buff, contents, s) == 0) { free(contents); @@ -951,9 +959,9 @@ assertion_text_file_contents(const char *filename, int line, const char *buff, c failure_finish(NULL); return (0); } - s = strlen(buff); + s = (int)strlen(buff); contents = malloc(s * 2 + 128); - n = fread(contents, 1, s * 2 + 128 - 1, f); + n = (int)fread(contents, 1, s * 2 + 128 - 1, f); if (n >= 0) contents[n] = '\0'; fclose(f); @@ -1004,8 +1012,8 @@ assertion_file_contains_lines_any_order(const char *file, int line, char *buff; size_t buff_size; size_t expected_count, actual_count, i, j; - char **expected; - char *p, **actual; + char **expected = NULL; + char *p, **actual = NULL; char c; int expected_failure = 0, actual_failure = 0; @@ -1018,14 +1026,22 @@ assertion_file_contains_lines_any_order(const char *file, int line, return (0); } - /* Make a copy of the provided lines and count up the expected file size. */ - expected_count = 0; + /* Make a copy of the provided lines and count up the expected + * file size. */ for (i = 0; lines[i] != NULL; ++i) { } expected_count = i; - expected = malloc(sizeof(char *) * expected_count); - for (i = 0; lines[i] != NULL; ++i) { - expected[i] = strdup(lines[i]); + if (expected_count) { + expected = malloc(sizeof(char *) * expected_count); + if (expected == NULL) { + failure_start(pathname, line, "Can't allocate memory"); + failure_finish(NULL); + free(expected); + return (0); + } + for (i = 0; lines[i] != NULL; ++i) { + expected[i] = strdup(lines[i]); + } } /* Break the file into lines */ @@ -1037,11 +1053,19 @@ assertion_file_contains_lines_any_order(const char *file, int line, ++actual_count; c = *p; } - actual = malloc(sizeof(char *) * actual_count); - for (j = 0, p = buff; p < buff + buff_size; p += 1 + strlen(p)) { - if (*p != '\0') { - actual[j] = p; - ++j; + if (actual_count) { + actual = calloc(sizeof(char *), actual_count); + if (actual == NULL) { + failure_start(pathname, line, "Can't allocate memory"); + failure_finish(NULL); + free(expected); + return (0); + } + for (j = 0, p = buff; p < buff + buff_size; p += 1 + strlen(p)) { + if (*p != '\0') { + actual[j] = p; + ++j; + } } } @@ -1176,11 +1200,11 @@ assertion_file_time(const char *file, int line, #if defined(_WIN32) && !defined(__CYGWIN__) #define EPOC_TIME (116444736000000000ULL) - FILETIME ftime, fbirthtime, fatime, fmtime; + FILETIME fxtime, fbirthtime, fatime, fmtime; ULARGE_INTEGER wintm; HANDLE h; - ftime.dwLowDateTime = 0; - ftime.dwHighDateTime = 0; + fxtime.dwLowDateTime = 0; + fxtime.dwHighDateTime = 0; assertion_count(file, line); /* Note: FILE_FLAG_BACKUP_SEMANTICS applies to open @@ -1195,9 +1219,9 @@ assertion_file_time(const char *file, int line, } r = GetFileTime(h, &fbirthtime, &fatime, &fmtime); switch (type) { - case 'a': ftime = fatime; break; - case 'b': ftime = fbirthtime; break; - case 'm': ftime = fmtime; break; + case 'a': fxtime = fatime; break; + case 'b': fxtime = fbirthtime; break; + case 'm': fxtime = fmtime; break; } CloseHandle(h); if (r == 0) { @@ -1205,8 +1229,8 @@ assertion_file_time(const char *file, int line, failure_finish(NULL); return (0); } - wintm.LowPart = ftime.dwLowDateTime; - wintm.HighPart = ftime.dwHighDateTime; + wintm.LowPart = fxtime.dwLowDateTime; + wintm.HighPart = fxtime.dwHighDateTime; filet = (wintm.QuadPart - EPOC_TIME) / 10000000; filet_nsec = ((wintm.QuadPart - EPOC_TIME) % 10000000) * 100; nsec = (nsec / 100) * 100; /* Round the request */ @@ -1834,15 +1858,45 @@ canSymlink(void) return (value); } -/* - * Can this platform run the gzip program? - */ /* Platform-dependent options for hiding the output of a subcommand. */ #if defined(_WIN32) && !defined(__CYGWIN__) static const char *redirectArgs = ">NUL 2>NUL"; /* Win32 cmd.exe */ #else static const char *redirectArgs = ">/dev/null 2>/dev/null"; /* POSIX 'sh' */ #endif +/* + * Can this platform run the bzip2 program? + */ +int +canBzip2(void) +{ + static int tested = 0, value = 0; + if (!tested) { + tested = 1; + if (systemf("bzip2 -d -V %s", redirectArgs) == 0) + value = 1; + } + return (value); +} + +/* + * Can this platform run the grzip program? + */ +int +canGrzip(void) +{ + static int tested = 0, value = 0; + if (!tested) { + tested = 1; + if (systemf("grzip -V %s", redirectArgs) == 0) + value = 1; + } + return (value); +} + +/* + * Can this platform run the gzip program? + */ int canGzip(void) { @@ -1856,15 +1910,75 @@ canGzip(void) } /* - * Can this platform run the gunzip program? + * Can this platform run the lrzip program? */ int -canGunzip(void) +canLrzip(void) { static int tested = 0, value = 0; if (!tested) { tested = 1; - if (systemf("gunzip -V %s", redirectArgs) == 0) + if (systemf("lrzip -V %s", redirectArgs) == 0) + value = 1; + } + return (value); +} + +/* + * Can this platform run the lzip program? + */ +int +canLzip(void) +{ + static int tested = 0, value = 0; + if (!tested) { + tested = 1; + if (systemf("lzip -V %s", redirectArgs) == 0) + value = 1; + } + return (value); +} + +/* + * Can this platform run the lzma program? + */ +int +canLzma(void) +{ + static int tested = 0, value = 0; + if (!tested) { + tested = 1; + if (systemf("lzma -V %s", redirectArgs) == 0) + value = 1; + } + return (value); +} + +/* + * Can this platform run the lzop program? + */ +int +canLzop(void) +{ + static int tested = 0, value = 0; + if (!tested) { + tested = 1; + if (systemf("lzop -V %s", redirectArgs) == 0) + value = 1; + } + return (value); +} + +/* + * Can this platform run the xz program? + */ +int +canXz(void) +{ + static int tested = 0, value = 0; + if (!tested) { + tested = 1; + if (systemf("xz -V %s", redirectArgs) == 0) value = 1; } return (value); @@ -2124,7 +2238,7 @@ is_LargeInode(const char *file) /* Use "list.h" to create a list of all tests (functions and names). */ #undef DEFINE_TEST #define DEFINE_TEST(n) { n, #n, 0 }, -struct { void (*func)(void); const char *name; int failures; } tests[] = { +struct test_list_t tests[] = { #include "list.h" }; @@ -2377,65 +2491,6 @@ get_refdir(const char *d) return strdup(buff); } -static int -get_test_set(int *test_set, int limit, const char *test) -{ - int start, end; - int idx = 0; - - if (test == NULL) { - /* Default: Run all tests. */ - for (;idx < limit; idx++) - test_set[idx] = idx; - return (limit); - } - if (*test >= '0' && *test <= '9') { - const char *vp = test; - start = 0; - while (*vp >= '0' && *vp <= '9') { - start *= 10; - start += *vp - '0'; - ++vp; - } - if (*vp == '\0') { - end = start; - } else if (*vp == '-') { - ++vp; - if (*vp == '\0') { - end = limit - 1; - } else { - end = 0; - while (*vp >= '0' && *vp <= '9') { - end *= 10; - end += *vp - '0'; - ++vp; - } - } - } else - return (-1); - if (start < 0 || end >= limit || start > end) - return (-1); - while (start <= end) - test_set[idx++] = start++; - } else { - size_t len = strlen(test); - for (start = 0; start < limit; ++start) { - const char *name = tests[start].name; - const char *p; - - while ((p = strchr(name, test[0])) != NULL) { - if (strncmp(p, test, len) == 0) { - test_set[idx++] = start; - break; - } else - name = p + 1; - } - - } - } - return ((idx == 0)?-1:idx); -} - int main(int argc, char **argv) { @@ -2720,10 +2775,11 @@ main(int argc, char **argv) do { int test_num; - test_num = get_test_set(test_set, limit, *argv); + test_num = get_test_set(test_set, limit, *argv, tests); if (test_num < 0) { printf("*** INVALID Test %s\n", *argv); free(refdir_alloc); + free(testprogdir); usage(progname); return (1); } diff --git a/tar/test/test.h b/tar/test/test.h index 46abb59eceee..a0a9bb6f600c 100644 --- a/tar/test/test.h +++ b/tar/test/test.h @@ -268,11 +268,29 @@ void sleepUntilAfter(time_t); /* Return true if this platform can create symlinks. */ int canSymlink(void); +/* Return true if this platform can run the "bzip2" program. */ +int canBzip2(void); + +/* Return true if this platform can run the "grzip" program. */ +int canGrzip(void); + /* Return true if this platform can run the "gzip" program. */ int canGzip(void); -/* Return true if this platform can run the "gunzip" program. */ -int canGunzip(void); +/* Return true if this platform can run the "lrzip" program. */ +int canLrzip(void); + +/* Return true if this platform can run the "lzip" program. */ +int canLzip(void); + +/* Return true if this platform can run the "lzma" program. */ +int canLzma(void); + +/* Return true if this platform can run the "lzop" program. */ +int canLzop(void); + +/* Return true if this platform can run the "xz" program. */ +int canXz(void); /* Return true if this filesystem can handle nodump flags. */ int canNodump(void); diff --git a/tar/test/test_basic.c b/tar/test/test_basic.c index 8832787ee63d..0008e1cfb70d 100644 --- a/tar/test/test_basic.c +++ b/tar/test/test_basic.c @@ -58,14 +58,19 @@ verify_files(const char *target) assertChdir(target); /* Regular file with 2 links. */ + failure("%s", target); assertIsReg("file", -1); + failure("%s", target); assertFileSize("file", 10); + failure("%s", target); assertFileContents("123456789", 10, "file"); failure("%s", target); assertFileNLinks("file", 2); /* Another name for the same file. */ + failure("%s", target); assertIsReg("linkfile", -1); + failure("%s", target); assertFileSize("linkfile", 10); assertFileContents("123456789", 10, "linkfile"); assertFileNLinks("linkfile", 2); @@ -76,6 +81,7 @@ verify_files(const char *target) assertIsSymlink("symlink", "file"); /* dir */ + failure("%s", target); assertIsDir("dir", 0775); assertChdir(".."); } diff --git a/tar/test/test_copy.c b/tar/test/test_copy.c index 69112900e536..c4c1aa05745d 100644 --- a/tar/test/test_copy.c +++ b/tar/test/test_copy.c @@ -29,6 +29,9 @@ __FBSDID("$FreeBSD: src/usr.bin/tar/test/test_copy.c,v 1.3 2008/08/15 06:12:02 k # include # include #endif +#if defined(_WIN32) && !defined(__CYGWIN__) +# include +#endif /* * Try to figure out how deep we can go in our tests. Assumes that @@ -119,7 +122,7 @@ compute_filenames(void) if (i > 9) { buff[j--] = '0' + ((i / 10) % 10); if (i > 99) - buff[j--] = '0' + (i / 100); + buff[j--] = '0' + (char)(i / 100); } buff[j] = '_'; /* Guard against obvious screwups in the above code. */ @@ -202,7 +205,7 @@ verify_tree(size_t limit) sprintf(name1, "f/%s", filenames[i]); if (i <= limit) { assertFileExists(name1); - assertFileContents(name1, strlen(name1), name1); + assertFileContents(name1, (int)strlen(name1), name1); } sprintf(name2, "l/%s", filenames[i]); diff --git a/tar/test/test_extract.tar.Z.uu b/tar/test/test_extract.tar.Z.uu new file mode 100644 index 000000000000..92713a544280 --- /dev/null +++ b/tar/test/test_extract.tar.Z.uu @@ -0,0 +1,9 @@ +begin 664 test_extract.tar.Z +M'YV09M*P*1,#@,&#"!,J7,BPH<.'$",BA$'1A@T:(`!0C'&C!HR,&SM^U$BQ +M9$D9,T#$D`%CAHP;-&"@Q`@C1HP9-FH```%#HL^?0(,*!5!G#ITP//JW-F?'18\FI0@5;FFOCJV:Q/JYM>NM8,62I6,6K5J!@-V^WLV[M^_?P(,+'TZ\ +0N/'CR),K7\Z\N?/GT*,K!P`` +` +end diff --git a/tar/test/test_extract.tar.bz2.uu b/tar/test/test_extract.tar.bz2.uu new file mode 100644 index 000000000000..9a37413ad406 --- /dev/null +++ b/tar/test/test_extract.tar.bz2.uu @@ -0,0 +1,7 @@ +begin 664 test_extract.tar.bz2 +M0EIH.3%!629368N]6:```'U[D=(0`"!``7^```AK)9X`!```$0`(,`"X#&$Q +M,F`F``,83$R8"8``*J:")M0TCQ30-/%-3*]V3EE!&(DSM8?BJ4J)=TSJ4/"B +M,?#R_6>?9K=+H02NT0V040P3.SHF:(573*)M5&;!-%6RO=6F5":N"+,"YZ;L +AV+<]%F[GWYCR<%FRKAPR=7VY+'+1)_B[DBG"A(1=ZLT` +` +end diff --git a/tar/test/test_extract.tar.grz.uu b/tar/test/test_extract.tar.grz.uu new file mode 100644 index 000000000000..44651e116798 --- /dev/null +++ b/tar/test/test_extract.tar.grz.uu @@ -0,0 +1,7 @@ +begin 644 test_extract.tar.grz +M1U)::7!)20`"!#HI``P``*P,``#U````SP```'<````[-=0OM"R^UP#^C?Z< +MFGU0]I:>SW7]H01)1\WY:59("M_=V4[N[R*'`H&:'E=O@5B(?T,0?@)%-:_D +M;EUP)!JVN)@V_:ABYS3+[[6/R(NU,-::]'X&;,]:,HR[*3#R!@:W)IGC`,&G +8L+IZ7]FP=8U_R?CZ2XPO)"H-ME3@P]$` +` +end diff --git a/tar/test/test_extract.tar.gz.uu b/tar/test/test_extract.tar.gz.uu new file mode 100644 index 000000000000..19f8bc047789 --- /dev/null +++ b/tar/test/test_extract.tar.gz.uu @@ -0,0 +1,7 @@ +begin 664 test_extract.tar.gz +M'XL(""S!:U```W1E26I>27%"OEI"FF@M*#'-=!.&@5T!*`X-Z*Q'23E?Q-3 +AP?_D@0*H:&)P-5? +MZX%NI60,IT@(N<,S%?7H2TLP5)FN#[-;&&[/2A#BNH4(7#C+*&ZP<>K&B)AG +M:Z(;Y=]3<5Q$)_[[5M\7=]N7A$%\ZF:H2/,Q%BK$JA4L!,K(-RZU2X[/`%69 +.9U@/B[!N",NH4]8F,M(` +` +end diff --git a/tar/test/test_extract.tar.lz.uu b/tar/test/test_extract.tar.lz.uu new file mode 100644 index 000000000000..cb380e3a0cb1 --- /dev/null +++ b/tar/test/test_extract.tar.lz.uu @@ -0,0 +1,7 @@ +begin 664 test_extract.tar.lz +M3%I)4`$,`#,:2=:X2EY2J/TZ6]L7]]N4K?J&A)E2#"A'E"T1EP+MU&;(P1FY +MV\,8BTS,N0/O2=#67;G5)%I'C,D.U?*T!NX("FYPYI9I40F>X))?^8\?E?#> +MOP";"GD#8(9*K;XP318HXZ\?_^SZ +6K-(!CH7```P```````"=```````````` +` +end diff --git a/tar/test/test_extract.tar.lzma.uu b/tar/test/test_extract.tar.lzma.uu new file mode 100644 index 000000000000..581236ac38f0 --- /dev/null +++ b/tar/test/test_extract.tar.lzma.uu @@ -0,0 +1,7 @@ +begin 664 test_extract.tar.lzma +M70``@`#__________P`S&DG6N$I>4JC].EO;%_?;E*WZAH294@PH1Y0M$9<" +M[=1FR,$9N=O#&(M,Q24U'H+5Z^7^*J;G!)OU]O'2D;AZ&0^IO?>-YA]$:-X_ +MD^O)YVM(4`^-MT$X`.D(6)*$]3HNB9KJ_H=1$QKYZ:`:,H_L"H[#"?#Z5A<] +%O_OZW=D` +` +end diff --git a/tar/test/test_extract.tar.lzo.uu b/tar/test/test_extract.tar.lzo.uu new file mode 100644 index 000000000000..29dd8d8521b6 --- /dev/null +++ b/tar/test/test_extract.tar.lzo.uu @@ -0,0 +1,9 @@ +begin 664 test_extract.tar.lzo +MB4Q:3P`-"AH*$#`@8`E``04#```!``"!M%!R@T``````$'1E?S@M7KY?XJIN<$F_7V +M\=*1N'H9#ZF]]XWF'T1HWC^3Z\GG:TA0#XVW03@`Z0A8DH3U.BZ)FNK^AU$3 +M&OGIH!HRC^P*CL,)\/,MGP``````2IVA+$<(^YX``94!@!@``&X^\DRQQ&?[ +(`@`````$65H` +` +end diff --git a/tar/test/test_extract_tar_Z.c b/tar/test/test_extract_tar_Z.c new file mode 100644 index 000000000000..7c994b472a79 --- /dev/null +++ b/tar/test/test_extract_tar_Z.c @@ -0,0 +1,42 @@ +/*- + * Copyright (c) 2012 Michihiro NAKAJIMA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#include "test.h" +__FBSDID("$FreeBSD$"); + +DEFINE_TEST(test_extract_tar_Z) +{ + const char *reffile = "test_extract.tar.Z"; + + extract_reference_file(reffile); + assertEqualInt(0, systemf("%s -xf %s >test.out 2>test.err", + testprog, reffile)); + + assertFileExists("file1"); + assertTextFileContents("contents of file1.\n", "file1"); + assertFileExists("file2"); + assertTextFileContents("contents of file2.\n", "file2"); + assertEmptyFile("test.out"); + assertEmptyFile("test.err"); +} diff --git a/tar/test/test_extract_tar_bz2.c b/tar/test/test_extract_tar_bz2.c new file mode 100644 index 000000000000..b734dd28ba74 --- /dev/null +++ b/tar/test/test_extract_tar_bz2.c @@ -0,0 +1,48 @@ +/*- + * Copyright (c) 2012 Michihiro NAKAJIMA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#include "test.h" +__FBSDID("$FreeBSD$"); + +DEFINE_TEST(test_extract_tar_bz2) +{ + const char *reffile = "test_extract.tar.bz2"; + int f; + + extract_reference_file(reffile); + f = systemf("%s -tf %s >test.out 2>test.err", testprog, reffile); + if (f == 0 || canBzip2()) { + assertEqualInt(0, systemf("%s -xf %s >test.out 2>test.err", + testprog, reffile)); + + assertFileExists("file1"); + assertTextFileContents("contents of file1.\n", "file1"); + assertFileExists("file2"); + assertTextFileContents("contents of file2.\n", "file2"); + assertEmptyFile("test.out"); + assertEmptyFile("test.err"); + } else { + skipping("It seems bzip2 is not supported on this platform"); + } +} diff --git a/tar/test/test_extract_tar_grz.c b/tar/test/test_extract_tar_grz.c new file mode 100644 index 000000000000..9c0615e981f2 --- /dev/null +++ b/tar/test/test_extract_tar_grz.c @@ -0,0 +1,48 @@ +/*- + * Copyright (c) 2012 Michihiro NAKAJIMA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#include "test.h" +__FBSDID("$FreeBSD$"); + +DEFINE_TEST(test_extract_tar_grz) +{ + const char *reffile = "test_extract.tar.grz"; + int f; + + extract_reference_file(reffile); + f = systemf("%s -tf %s >test.out 2>test.err", testprog, reffile); + if (f == 0 || canGrzip()) { + assertEqualInt(0, systemf("%s -xf %s >test.out 2>test.err", + testprog, reffile)); + + assertFileExists("file1"); + assertTextFileContents("contents of file1.\n", "file1"); + assertFileExists("file2"); + assertTextFileContents("contents of file2.\n", "file2"); + assertEmptyFile("test.out"); + assertEmptyFile("test.err"); + } else { + skipping("It seems grzip is not supported on this platform"); + } +} diff --git a/tar/test/test_extract_tar_gz.c b/tar/test/test_extract_tar_gz.c new file mode 100644 index 000000000000..2fdb4ba7cdff --- /dev/null +++ b/tar/test/test_extract_tar_gz.c @@ -0,0 +1,48 @@ +/*- + * Copyright (c) 2012 Michihiro NAKAJIMA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#include "test.h" +__FBSDID("$FreeBSD$"); + +DEFINE_TEST(test_extract_tar_gz) +{ + const char *reffile = "test_extract.tar.gz"; + int f; + + extract_reference_file(reffile); + f = systemf("%s -tf %s >test.out 2>test.err", testprog, reffile); + if (f == 0 || canGzip()) { + assertEqualInt(0, systemf("%s -xf %s >test.out 2>test.err", + testprog, reffile)); + + assertFileExists("file1"); + assertTextFileContents("contents of file1.\n", "file1"); + assertFileExists("file2"); + assertTextFileContents("contents of file2.\n", "file2"); + assertEmptyFile("test.out"); + assertEmptyFile("test.err"); + } else { + skipping("It seems gzip is not supported on this platform"); + } +} diff --git a/tar/test/test_extract_tar_lrz.c b/tar/test/test_extract_tar_lrz.c new file mode 100644 index 000000000000..56a0fb88231e --- /dev/null +++ b/tar/test/test_extract_tar_lrz.c @@ -0,0 +1,48 @@ +/*- + * Copyright (c) 2012 Michihiro NAKAJIMA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#include "test.h" +__FBSDID("$FreeBSD$"); + +DEFINE_TEST(test_extract_tar_lrz) +{ + const char *reffile = "test_extract.tar.lrz"; + int f; + + extract_reference_file(reffile); + f = systemf("%s -tf %s >test.out 2>test.err", testprog, reffile); + if (f == 0 || canLrzip()) { + assertEqualInt(0, systemf("%s -xf %s >test.out 2>test.err", + testprog, reffile)); + + assertFileExists("file1"); + assertTextFileContents("contents of file1.\n", "file1"); + assertFileExists("file2"); + assertTextFileContents("contents of file2.\n", "file2"); + assertEmptyFile("test.out"); + assertEmptyFile("test.err"); + } else { + skipping("It seems lrzip is not supported on this platform"); + } +} diff --git a/tar/test/test_extract_tar_lz.c b/tar/test/test_extract_tar_lz.c new file mode 100644 index 000000000000..5ec7e9a48f2f --- /dev/null +++ b/tar/test/test_extract_tar_lz.c @@ -0,0 +1,48 @@ +/*- + * Copyright (c) 2012 Michihiro NAKAJIMA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#include "test.h" +__FBSDID("$FreeBSD$"); + +DEFINE_TEST(test_extract_tar_lz) +{ + const char *reffile = "test_extract.tar.lz"; + int f; + + extract_reference_file(reffile); + f = systemf("%s -tf %s >test.out 2>test.err", testprog, reffile); + if (f == 0 || canLzip()) { + assertEqualInt(0, systemf("%s -xf %s >test.out 2>test.err", + testprog, reffile)); + + assertFileExists("file1"); + assertTextFileContents("contents of file1.\n", "file1"); + assertFileExists("file2"); + assertTextFileContents("contents of file2.\n", "file2"); + assertEmptyFile("test.out"); + assertEmptyFile("test.err"); + } else { + skipping("It seems lzip is not supported on this platform"); + } +} diff --git a/tar/test/test_extract_tar_lzma.c b/tar/test/test_extract_tar_lzma.c new file mode 100644 index 000000000000..2fa2af049446 --- /dev/null +++ b/tar/test/test_extract_tar_lzma.c @@ -0,0 +1,48 @@ +/*- + * Copyright (c) 2012 Michihiro NAKAJIMA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#include "test.h" +__FBSDID("$FreeBSD$"); + +DEFINE_TEST(test_extract_tar_lzma) +{ + const char *reffile = "test_extract.tar.lzma"; + int f; + + extract_reference_file(reffile); + f = systemf("%s -tf %s >test.out 2>test.err", testprog, reffile); + if (f == 0 || canLzma()) { + assertEqualInt(0, systemf("%s -xf %s >test.out 2>test.err", + testprog, reffile)); + + assertFileExists("file1"); + assertTextFileContents("contents of file1.\n", "file1"); + assertFileExists("file2"); + assertTextFileContents("contents of file2.\n", "file2"); + assertEmptyFile("test.out"); + assertEmptyFile("test.err"); + } else { + skipping("It seems lzma is not supported on this platform"); + } +} diff --git a/tar/test/test_extract_tar_lzo.c b/tar/test/test_extract_tar_lzo.c new file mode 100644 index 000000000000..17b4295edf63 --- /dev/null +++ b/tar/test/test_extract_tar_lzo.c @@ -0,0 +1,48 @@ +/*- + * Copyright (c) 2012 Michihiro NAKAJIMA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#include "test.h" +__FBSDID("$FreeBSD$"); + +DEFINE_TEST(test_extract_tar_lzo) +{ + const char *reffile = "test_extract.tar.lzo"; + int f; + + extract_reference_file(reffile); + f = systemf("%s -tf %s >test.out 2>test.err", testprog, reffile); + if (f == 0 || canLzop()) { + assertEqualInt(0, systemf("%s -xf %s >test.out 2>test.err", + testprog, reffile)); + + assertFileExists("file1"); + assertTextFileContents("contents of file1.\n", "file1"); + assertFileExists("file2"); + assertTextFileContents("contents of file2.\n", "file2"); + assertEmptyFile("test.out"); + assertEmptyFile("test.err"); + } else { + skipping("It seems lzop is not supported on this platform"); + } +} diff --git a/tar/test/test_extract_tar_xz.c b/tar/test/test_extract_tar_xz.c new file mode 100644 index 000000000000..860bab75acf7 --- /dev/null +++ b/tar/test/test_extract_tar_xz.c @@ -0,0 +1,48 @@ +/*- + * Copyright (c) 2012 Michihiro NAKAJIMA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#include "test.h" +__FBSDID("$FreeBSD$"); + +DEFINE_TEST(test_extract_tar_xz) +{ + const char *reffile = "test_extract.tar.xz"; + int f; + + extract_reference_file(reffile); + f = systemf("%s -tf %s >test.out 2>test.err", testprog, reffile); + if (f == 0 || canXz()) { + assertEqualInt(0, systemf("%s -xf %s >test.out 2>test.err", + testprog, reffile)); + + assertFileExists("file1"); + assertTextFileContents("contents of file1.\n", "file1"); + assertFileExists("file2"); + assertTextFileContents("contents of file2.\n", "file2"); + assertEmptyFile("test.out"); + assertEmptyFile("test.err"); + } else { + skipping("It seems xz is not supported on this platform"); + } +} diff --git a/tar/test/test_option_a.c b/tar/test/test_option_a.c new file mode 100644 index 000000000000..a000621cb8b5 --- /dev/null +++ b/tar/test/test_option_a.c @@ -0,0 +1,110 @@ +/*- + * Copyright (c) 2003-2007 Tim Kientzle + * Copyright (c) 2012 Michihiro NAKAJIMA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#include "test.h" +__FBSDID("$FreeBSD$"); + +DEFINE_TEST(test_option_a) +{ + size_t s; + char *p; + + /* Create a file. */ + assertMakeFile("f", 0644, "a"); + + /* Test1: archive it with .tar.Z suffix. */ + assertEqualInt(0, + systemf("%s -acf test1.tar.Z f 2>test1.err", testprog)); + assertEmptyFile("test1.err"); + /* Check that the archive file has a compress signature. */ + p = slurpfile(&s, "test1.tar.Z"); + assert(s > 2); + failure("The archive should be compressed"); + assertEqualMem(p, "\x1f\x9d", 2); + + /* Test2: archive it with .taZ suffix. */ + assertEqualInt(0, + systemf("%s -acf test2.taZ f 2>test2.err", testprog)); + assertEmptyFile("test2.err"); + /* Check that the archive file has a compress signature. */ + p = slurpfile(&s, "test2.taZ"); + assert(s > 2); + failure("The archive should be compressed"); + assertEqualMem(p, "\x1f\x9d", 2); + + /* Test3: archive it with .tar.Z.uu suffix. */ + assertEqualInt(0, + systemf("%s -acf test3.tar.Z.uu f 2>test3.err", testprog)); + assertEmptyFile("test3.err"); + /* Check that the archive file has a compress signature. */ + p = slurpfile(&s, "test3.tar.Z.uu"); + assert(s > 12); + failure("The archive should be uuencoded"); + assertEqualMem(p, "begin 644 -\n", 12); + + /* Test4: archive it with .zip suffix. */ + assertEqualInt(0, + systemf("%s -acf test4.zip f 2>test4.err", testprog)); + assertEmptyFile("test4.err"); + /* Check that the archive file has a compress signature. */ + p = slurpfile(&s, "test4.zip"); + assert(s > 4); + failure("The archive should be zipped"); + assertEqualMem(p, "\x50\x4b\x03\x04", 4); + + /* Test5: archive it with .tar.Z suffix and --uuencode option. */ + assertEqualInt(0, + systemf("%s -acf test5.tar.Z --uuencode f 2>test5.err", + testprog)); + assertEmptyFile("test5.err"); + /* Check that the archive file has a compress signature. */ + p = slurpfile(&s, "test5.tar.Z"); + assert(s > 2); + failure("The archive should be compressed, ignoring --uuencode option"); + assertEqualMem(p, "\x1f\x9d", 2); + + /* Test6: archive it with .xxx suffix(unknown suffix) and + * --uuencode option. */ + assertEqualInt(0, + systemf("%s -acf test6.xxx --uuencode f 2>test6.err", + testprog)); + assertEmptyFile("test6.err"); + /* Check that the archive file has a compress signature. */ + p = slurpfile(&s, "test6.xxx"); + assert(s > 12); + failure("The archive should be uuencoded"); + assertEqualMem(p, "begin 644 -\n", 12); + + /* Test7: archive it with .tar.Z suffix using a long-name option. */ + assertEqualInt(0, + systemf("%s --auto-compress -cf test7.tar.Z f 2>test7.err", + testprog)); + assertEmptyFile("test7.err"); + /* Check that the archive file has a compress signature. */ + p = slurpfile(&s, "test7.tar.Z"); + assert(s > 2); + failure("The archive should be compressed"); + assertEqualMem(p, "\x1f\x9d", 2); +} diff --git a/tar/test/test_option_b64encode.c b/tar/test/test_option_b64encode.c new file mode 100644 index 000000000000..1e7c57175ce1 --- /dev/null +++ b/tar/test/test_option_b64encode.c @@ -0,0 +1,54 @@ +/*- + * Copyright (c) 2003-2007 Tim Kientzle + * Copyright (c) 2012 Michihiro NAKAJIMA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#include "test.h" +__FBSDID("$FreeBSD$"); + +DEFINE_TEST(test_option_b64encode) +{ + char *p; + size_t s; + + /* Create a file. */ + assertMakeFile("f", 0644, "a"); + + /* Archive it with compress compression and uuencode. */ + assertEqualInt(0, + systemf("%s -cf - -Z --b64encode f >archive.out 2>archive.err", + testprog)); + /* Check that the archive file has an uuencode signature. */ + p = slurpfile(&s, "archive.out"); + assert(s > 2); + assertEqualMem(p, "begin-base64 644", 16); + + /* Archive it with uuencode only. */ + assertEqualInt(0, + systemf("%s -cf - --b64encode f >archive.out 2>archive.err", + testprog)); + /* Check that the archive file has an uuencode signature. */ + p = slurpfile(&s, "archive.out"); + assert(s > 2); + assertEqualMem(p, "begin-base64 644", 16); +} diff --git a/tar/test/test_option_grzip.c b/tar/test/test_option_grzip.c new file mode 100644 index 000000000000..5132eeec26ec --- /dev/null +++ b/tar/test/test_option_grzip.c @@ -0,0 +1,52 @@ +/*- + * Copyright (c) 2003-2007 Tim Kientzle + * Copyright (c) 2012 Michihiro NAKAJIMA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#include "test.h" +__FBSDID("$FreeBSD$"); + +DEFINE_TEST(test_option_grzip) +{ + char *p; + size_t s; + + if (!canGrzip()) { + skipping("grzip is not supported on this platform"); + return; + } + + /* Create a file. */ + assertMakeFile("f", 0644, "a"); + + /* Archive it with grzip compression. */ + assertEqualInt(0, + systemf("%s -cf - --grzip f >archive.out 2>archive.err", + testprog)); + p = slurpfile(&s, "archive.err"); + p[s] = '\0'; + /* Check that the archive file has an grzip signature. */ + p = slurpfile(&s, "archive.out"); + assert(s > 2); + assertEqualMem(p, "GRZipII\x00\x02\x04:)", 12); +} diff --git a/tar/test/test_option_j.c b/tar/test/test_option_j.c new file mode 100644 index 000000000000..3202c3b83914 --- /dev/null +++ b/tar/test/test_option_j.c @@ -0,0 +1,56 @@ +/*- + * Copyright (c) 2003-2007 Tim Kientzle + * Copyright (c) 2012 Michihiro NAKAJIMA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#include "test.h" +__FBSDID("$FreeBSD$"); + +DEFINE_TEST(test_option_j) +{ + char *p; + int r; + size_t s; + + /* Create a file. */ + assertMakeFile("f", 0644, "a"); + + /* Archive it with bzip2 compression. */ + r = systemf("%s -jcf archive.out f 2>archive.err", testprog); + p = slurpfile(&s, "archive.err"); + p[s] = '\0'; + if (r != 0) { + if (!canBzip2()) { + skipping("bzip2 is not supported on this platform"); + return; + } + failure("-j option is broken"); + assertEqualInt(r, 0); + return; + } + assertEmptyFile("archive.err"); + /* Check that the archive file has a bzip2 signature. */ + p = slurpfile(&s, "archive.out"); + assert(s > 2); + assertEqualMem(p, "BZh9", 4); +} diff --git a/tar/test/test_option_lrzip.c b/tar/test/test_option_lrzip.c new file mode 100644 index 000000000000..d3486a3a27b7 --- /dev/null +++ b/tar/test/test_option_lrzip.c @@ -0,0 +1,52 @@ +/*- + * Copyright (c) 2003-2007 Tim Kientzle + * Copyright (c) 2012 Michihiro NAKAJIMA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#include "test.h" +__FBSDID("$FreeBSD$"); + +DEFINE_TEST(test_option_lrzip) +{ + char *p; + size_t s; + + if (!canLrzip()) { + skipping("lrzip is not supported on this platform"); + return; + } + + /* Create a file. */ + assertMakeFile("f", 0644, "a"); + + /* Archive it with lrzip compression. */ + assertEqualInt(0, + systemf("%s -cf - --lrzip f >archive.out 2>archive.err", + testprog)); + p = slurpfile(&s, "archive.err"); + p[s] = '\0'; + /* Check that the archive file has an lzma signature. */ + p = slurpfile(&s, "archive.out"); + assert(s > 2); + assertEqualMem(p, "LRZI\x00", 5); +} diff --git a/tar/test/test_option_lzma.c b/tar/test/test_option_lzma.c new file mode 100644 index 000000000000..a845666e34f9 --- /dev/null +++ b/tar/test/test_option_lzma.c @@ -0,0 +1,57 @@ +/*- + * Copyright (c) 2003-2007 Tim Kientzle + * Copyright (c) 2012 Michihiro NAKAJIMA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#include "test.h" +__FBSDID("$FreeBSD$"); + +DEFINE_TEST(test_option_lzma) +{ + char *p; + int r; + size_t s; + + /* Create a file. */ + assertMakeFile("f", 0644, "a"); + + /* Archive it with lzma compression. */ + r = systemf("%s -cf - --lzma f >archive.out 2>archive.err", + testprog); + p = slurpfile(&s, "archive.err"); + p[s] = '\0'; + if (r != 0) { + if (strstr(p, "Unsupported compression") != NULL) { + skipping("This version of bsdtar was compiled " + "without lzma support"); + return; + } + failure("--lzma option is broken"); + assertEqualInt(r, 0); + return; + } + /* Check that the archive file has an lzma signature. */ + p = slurpfile(&s, "archive.out"); + assert(s > 2); + assertEqualMem(p, "\x5d\00\00", 3); +} diff --git a/tar/test/test_option_lzop.c b/tar/test/test_option_lzop.c new file mode 100644 index 000000000000..1145499a4605 --- /dev/null +++ b/tar/test/test_option_lzop.c @@ -0,0 +1,55 @@ +/*- + * Copyright (c) 2003-2007 Tim Kientzle + * Copyright (c) 2012 Michihiro NAKAJIMA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#include "test.h" +__FBSDID("$FreeBSD$"); + +DEFINE_TEST(test_option_lzop) +{ + char *p; + int r; + size_t s; + + /* Create a file. */ + assertMakeFile("f", 0644, "a"); + + /* Archive it with lzop compression. */ + r = systemf("%s -cf - --lzop f >archive.out 2>archive.err", testprog); + p = slurpfile(&s, "archive.err"); + p[s] = '\0'; + if (r != 0) { + if (!canLzop()) { + skipping("lzop is not supported on this platform"); + return; + } + failure("--lzop option is broken"); + assertEqualInt(r, 0); + return; + } + /* Check that the archive file has an lzma signature. */ + p = slurpfile(&s, "archive.out"); + assert(s > 2); + assertEqualMem(p, "\x89\x4c\x5a\x4f\x00\x0d\x0a\x1a\x0a", 9); +} diff --git a/tar/test/test_option_newer_than.c b/tar/test/test_option_newer_than.c index c9432dcb5f75..2a5fe04e6968 100644 --- a/tar/test/test_option_newer_than.c +++ b/tar/test/test_option_newer_than.c @@ -48,8 +48,11 @@ DEFINE_TEST(test_option_newer_than) assertMakeFile("a/b/new.txt", 0644, "new file in old directory"); /* Test --newer-than on create */ - assertEqualInt(0, systemf("%s -cf ../test1.tar --newer-than middle.txt *.txt a", testprog)); - assertEqualInt(0, systemf("%s -cf ../test2.tar *.txt a", testprog)); + assertEqualInt(0, + systemf("%s --format pax -cf ../test1.tar " + "--newer-than middle.txt *.txt a", testprog)); + assertEqualInt(0, + systemf("%s --format pax -cf ../test2.tar *.txt a", testprog)); assertChdir(".."); /* Extract test1.tar to a clean dir and verify what got archived. */ diff --git a/tar/test/test_option_older_than.c b/tar/test/test_option_older_than.c new file mode 100644 index 000000000000..4bdd2edfe0bd --- /dev/null +++ b/tar/test/test_option_older_than.c @@ -0,0 +1,85 @@ +/*- + * Copyright (c) 2010 Tim Kientzle + * Copyright (c) 2012 Michihiro NAKAJIMA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#include "test.h" +__FBSDID("$FreeBSD$"); + +DEFINE_TEST(test_option_older_than) +{ + struct stat st; + + /* + * Basic test of --older-than. + * First, create three files with different mtimes. + * Create test1.tar with --older-than, test2.tar without. + */ + assertMakeDir("test1in", 0755); + assertChdir("test1in"); + assertMakeDir("a", 0755); + assertMakeDir("a/b", 0755); + assertMakeFile("old.txt", 0644, "old.txt"); + assertMakeFile("a/b/old.txt", 0644, "old file in old directory"); + assertEqualInt(0, stat("old.txt", &st)); + sleepUntilAfter(st.st_mtime); + assertMakeFile("middle.txt", 0644, "middle.txt"); + assertEqualInt(0, stat("middle.txt", &st)); + sleepUntilAfter(st.st_mtime); + assertMakeFile("new.txt", 0644, "new"); + assertMakeFile("a/b/new.txt", 0644, "new file in old directory"); + + /* Test --older-than on create */ + assertEqualInt(0, + systemf("%s --format pax -cf ../test1.tar " + "--older-than middle.txt *.txt a", + testprog)); + assertEqualInt(0, + systemf("%s --format pax -cf ../test2.tar *.txt a", + testprog)); + assertChdir(".."); + + /* Extract test1.tar to a clean dir and verify what got archived. */ + assertMakeDir("test1out", 0755); + assertChdir("test1out"); + assertEqualInt(0, systemf("%s xf ../test1.tar", testprog)); + assertFileNotExists("new.txt"); + assertFileNotExists("a/b/new.txt"); + assertFileNotExists("middle.txt"); + assertFileExists("old.txt"); + assertFileExists("a/b/old.txt"); + assertChdir(".."); + + /* Extract test2.tar to a clean dir with --older-than and verify. */ + assertMakeDir("test2out", 0755); + assertChdir("test2out"); + assertEqualInt(0, + systemf("%s xf ../test2.tar --older-than ../test1in/middle.txt", + testprog)); + assertFileNotExists("new.txt"); + assertFileNotExists("a/b/new.txt"); + assertFileNotExists("middle.txt"); + assertFileExists("old.txt"); + assertFileExists("a/b/old.txt"); + assertChdir(".."); +} diff --git a/tar/test/test_option_r.c b/tar/test/test_option_r.c index 70c2087c9f6f..77876857ea77 100644 --- a/tar/test/test_option_r.c +++ b/tar/test/test_option_r.c @@ -60,6 +60,11 @@ DEFINE_TEST(test_option_r) /* Edit that file with a lot more data and update the archive with a new copy. */ buff = malloc(buff_size); assert(buff != NULL); + if (buff == NULL) { + free(p0); + return; + } + for (i = 0; i < (int)buff_size; ++i) buff[i] = "abcdefghijklmnopqrstuvwxyz"[rand() % 26]; buff[buff_size - 1] = '\0'; @@ -126,5 +131,5 @@ DEFINE_TEST(test_option_r) assertEmptyFile("extract.err"); /* Verify that the second copy of f1 overwrote the first. */ - assertFileContents(buff, strlen(buff), "f1"); + assertFileContents(buff, (int)strlen(buff), "f1"); } diff --git a/tar/test/test_option_uuencode.c b/tar/test/test_option_uuencode.c new file mode 100644 index 000000000000..cdc6babd5192 --- /dev/null +++ b/tar/test/test_option_uuencode.c @@ -0,0 +1,54 @@ +/*- + * Copyright (c) 2003-2007 Tim Kientzle + * Copyright (c) 2012 Michihiro NAKAJIMA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#include "test.h" +__FBSDID("$FreeBSD$"); + +DEFINE_TEST(test_option_uuencode) +{ + char *p; + size_t s; + + /* Create a file. */ + assertMakeFile("f", 0644, "a"); + + /* Archive it with compress compression and uuencode. */ + assertEqualInt(0, + systemf("%s -cf - -Z --uuencode f >archive.out 2>archive.err", + testprog)); + /* Check that the archive file has an uuencode signature. */ + p = slurpfile(&s, "archive.out"); + assert(s > 2); + assertEqualMem(p, "begin 644", 9); + + /* Archive it with uuencode only. */ + assertEqualInt(0, + systemf("%s -cf - --uuencode f >archive.out 2>archive.err", + testprog)); + /* Check that the archive file has an uuencode signature. */ + p = slurpfile(&s, "archive.out"); + assert(s > 2); + assertEqualMem(p, "begin 644", 9); +} diff --git a/tar/test/test_option_xz.c b/tar/test/test_option_xz.c new file mode 100644 index 000000000000..7387a604e072 --- /dev/null +++ b/tar/test/test_option_xz.c @@ -0,0 +1,57 @@ +/*- + * Copyright (c) 2003-2007 Tim Kientzle + * Copyright (c) 2012 Michihiro NAKAJIMA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#include "test.h" +__FBSDID("$FreeBSD$"); + +DEFINE_TEST(test_option_xz) +{ + char *p; + int r; + size_t s; + + /* Create a file. */ + assertMakeFile("f", 0644, "a"); + + /* Archive it with xz compression. */ + r = systemf("%s -cf - --xz f >archive.out 2>archive.err", + testprog); + p = slurpfile(&s, "archive.err"); + p[s] = '\0'; + if (r != 0) { + if (strstr(p, "Unsupported compression") != NULL) { + skipping("This version of bsdtar was compiled " + "without xz support"); + return; + } + failure("--xz option is broken"); + assertEqualInt(r, 0); + return; + } + /* Check that the archive file has an xz signature. */ + p = slurpfile(&s, "archive.out"); + assert(s > 2); + assertEqualMem(p, "\xFD\x37\x7A\x58\x5A\x00", 6); +} diff --git a/tar/test/test_option_z.c b/tar/test/test_option_z.c new file mode 100644 index 000000000000..1f952abe3aff --- /dev/null +++ b/tar/test/test_option_z.c @@ -0,0 +1,55 @@ +/*- + * Copyright (c) 2003-2007 Tim Kientzle + * Copyright (c) 2012 Michihiro NAKAJIMA + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. + * IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT + * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF + * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ +#include "test.h" +__FBSDID("$FreeBSD$"); + +DEFINE_TEST(test_option_z) +{ + char *p; + int r; + size_t s; + + /* Create a file. */ + assertMakeFile("f", 0644, "a"); + + /* Archive it with gzip compression. */ + r = systemf("%s -zcf archive.out f 2>archive.err", testprog); + p = slurpfile(&s, "archive.err"); + p[s] = '\0'; + if (r != 0) { + if (!canGzip()) { + skipping("gzip is not supported on this platform"); + return; + } + failure("-z option is broken"); + assertEqualInt(r, 0); + return; + } + /* Check that the archive file has a gzip signature. */ + p = slurpfile(&s, "archive.out"); + assert(s > 4); + assertEqualMem(p, "\x1f\x8b\x08\x00", 4); +} diff --git a/tar/test/test_stdio.c b/tar/test/test_stdio.c index b95a4e30542c..bf5dd77443b7 100644 --- a/tar/test/test_stdio.c +++ b/tar/test/test_stdio.c @@ -113,7 +113,7 @@ DEFINE_TEST(test_stdio) assertEqualInt(r, 0); /* Verify xvOf.out is the file contents */ p = slurpfile(&s, "xvOf.out"); - assert(s = 3); + assertEqualInt((int)s, 3); assertEqualMem(p, "abc", 3); /* TODO: Verify xvf.err */ diff --git a/tar/test/test_windows.c b/tar/test/test_windows.c index a2d0c214b956..1977ec644e68 100644 --- a/tar/test/test_windows.c +++ b/tar/test/test_windows.c @@ -25,6 +25,7 @@ #include "test.h" #if defined(_WIN32) && !defined(__CYGWIN__) +#include #include static void @@ -53,7 +54,7 @@ mkfullpath(char **path1, char **path2, const char *tpath, int type) assert(NULL != fp1); fp2 = malloc(l*2); assert(NULL != fp2); - l = GetFullPathNameA(tpath, l, fp1, NULL); + l = GetFullPathNameA(tpath, (DWORD)l, fp1, NULL); if ((type & 0x01) == 0) { for (p1 = fp1; *p1 != '\0'; p1++) if (*p1 == '\\') @@ -228,7 +229,7 @@ DEFINE_TEST(test_windows) assertEqualInt(0, systemf("%s -tf ../archive10.tar > ../list10", testprog)); /* Check drive letters have been stripped. */ - assertFileContents(fp2, strlen(fp2), "../list10"); + assertFileContents(fp2, (int)strlen(fp2), "../list10"); free(fp1); free(fp2); @@ -240,7 +241,7 @@ DEFINE_TEST(test_windows) assertEqualInt(0, systemf("%s -tf ../archive11.tar > ../list11", testprog)); /* Check drive letters have been stripped. */ - assertFileContents(fp2, strlen(fp2), "../list11"); + assertFileContents(fp2, (int)strlen(fp2), "../list11"); free(fp1); free(fp2); @@ -252,7 +253,7 @@ DEFINE_TEST(test_windows) assertEqualInt(0, systemf("%s -tf ../archive12.tar > ../list12", testprog)); /* Check drive letters have been stripped. */ - assertFileContents(fp2, strlen(fp2), "../list12"); + assertFileContents(fp2, (int)strlen(fp2), "../list12"); free(fp1); free(fp2); @@ -264,7 +265,7 @@ DEFINE_TEST(test_windows) assertEqualInt(0, systemf("%s -tf ../archive13.tar > ../list13", testprog)); /* Check drive letters have been stripped. */ - assertFileContents(fp2, strlen(fp2), "../list13"); + assertFileContents(fp2, (int)strlen(fp2), "../list13"); free(fp1); free(fp2); @@ -276,7 +277,7 @@ DEFINE_TEST(test_windows) assertEqualInt(0, systemf("%s -tf ../archive14.tar > ../list14", testprog)); /* Check drive letters have been stripped. */ - assertFileContents(fp2, strlen(fp2), "../list14"); + assertFileContents(fp2, (int)strlen(fp2), "../list14"); free(fp1); free(fp2); @@ -288,7 +289,7 @@ DEFINE_TEST(test_windows) assertEqualInt(0, systemf("%s -tf ../archive15.tar > ../list15", testprog)); /* Check drive letters have been stripped. */ - assertFileContents(fp2, strlen(fp2), "../list15"); + assertFileContents(fp2, (int)strlen(fp2), "../list15"); free(fp1); free(fp2); @@ -301,7 +302,7 @@ DEFINE_TEST(test_windows) assertEqualInt(0, systemf("%s -tf ../archive16.tar > ../list16", testprog)); /* Check drive letters have been stripped. */ - assertFileContents(fp2, strlen(fp2), "../list16"); + assertFileContents(fp2, (int)strlen(fp2), "../list16"); free(fp1); free(fp2); @@ -314,7 +315,7 @@ DEFINE_TEST(test_windows) assertEqualInt(0, systemf("%s -tf ../archive17.tar > ../list17", testprog)); /* Check drive letters have been stripped. */ - assertFileContents(fp2, strlen(fp2), "../list17"); + assertFileContents(fp2, (int)strlen(fp2), "../list17"); free(fp1); free(fp2); #else diff --git a/tar/util.c b/tar/util.c index 7e705c2be228..b1b9b93d0e93 100644 --- a/tar/util.c +++ b/tar/util.c @@ -120,14 +120,12 @@ safe_fprintf(FILE *f, const char *fmt, ...) fmtbuff_length = length+1; else if (fmtbuff_length < 8192) fmtbuff_length *= 2; - else { - int old_length = fmtbuff_length; + else if (fmtbuff_length < 1000000) fmtbuff_length += fmtbuff_length / 4; - if (old_length > fmtbuff_length) { - length = old_length; - fmtbuff_heap[length-1] = '\0'; - break; - } + else { + length = fmtbuff_length; + fmtbuff_heap[length-1] = '\0'; + break; } free(fmtbuff_heap); fmtbuff_heap = malloc(fmtbuff_length); @@ -148,7 +146,12 @@ safe_fprintf(FILE *f, const char *fmt, ...) /* Note: mbrtowc() has a cleaner API, but mbtowc() seems a bit * more portable, so we use that here instead. */ - n = mbtowc(NULL, NULL, 1); /* Reset the shift state. */ + if (mbtowc(NULL, NULL, 1) == -1) { /* Reset the shift state. */ + /* mbtowc() should never fail in practice, but + * handle the theoretical error anyway. */ + free(fmtbuff_heap); + return; + } /* Write data, expanding unprintable characters. */ p = fmtbuff; @@ -188,8 +191,7 @@ safe_fprintf(FILE *f, const char *fmt, ...) fprintf(f, "%s", outbuff); /* If we allocated a heap-based formatting buffer, free it now. */ - if (fmtbuff_heap != NULL) - free(fmtbuff_heap); + free(fmtbuff_heap); } /* @@ -380,7 +382,7 @@ int edit_pathname(struct bsdtar *bsdtar, struct archive_entry *entry) { const char *name = archive_entry_pathname(entry); -#if HAVE_REGEX_H +#if defined(HAVE_REGEX_H) || defined(HAVE_PCREPOSIX_H) char *subst_name; int r; diff --git a/tar/write.c b/tar/write.c index 273fdda3bd9f..40d2fb0a9f52 100644 --- a/tar/write.c +++ b/tar/write.c @@ -131,13 +131,79 @@ seek_file(int fd, int64_t offset, int whence) #define open _open #define close _close #define read _read +#ifdef lseek +#undef lseek +#endif #define lseek seek_file #endif +static void +set_writer_options(struct bsdtar *bsdtar, struct archive *a) +{ + const char *writer_options; + int r; + + writer_options = getenv(ENV_WRITER_OPTIONS); + if (writer_options != NULL) { + char *p; + /* Set default write options. */ + p = malloc(sizeof(IGNORE_WRONG_MODULE_NAME) + + strlen(writer_options) + 1); + if (p == NULL) + lafe_errc(1, errno, "Out of memory"); + /* Prepend magic code to ignore options for + * a format or filters which are not added to + * the archive write object. */ + strncpy(p, IGNORE_WRONG_MODULE_NAME, + sizeof(IGNORE_WRONG_MODULE_NAME) -1); + strcpy(p + sizeof(IGNORE_WRONG_MODULE_NAME) -1, writer_options); + r = archive_write_set_options(a, p); + free(p); + if (r < ARCHIVE_WARN) + lafe_errc(1, 0, "%s", archive_error_string(a)); + else + archive_clear_error(a); + } + if (ARCHIVE_OK != archive_write_set_options(a, bsdtar->option_options)) + lafe_errc(1, 0, "%s", archive_error_string(a)); +} + +static void +set_reader_options(struct bsdtar *bsdtar, struct archive *a) +{ + const char *reader_options; + int r; + + (void)bsdtar; /* UNUSED */ + + reader_options = getenv(ENV_READER_OPTIONS); + if (reader_options != NULL) { + char *p; + /* Set default write options. */ + p = malloc(sizeof(IGNORE_WRONG_MODULE_NAME) + + strlen(reader_options) + 1); + if (p == NULL) + lafe_errc(1, errno, "Out of memory"); + /* Prepend magic code to ignore options for + * a format or filters which are not added to + * the archive write object. */ + strncpy(p, IGNORE_WRONG_MODULE_NAME, + sizeof(IGNORE_WRONG_MODULE_NAME) -1); + strcpy(p + sizeof(IGNORE_WRONG_MODULE_NAME) -1, reader_options); + r = archive_read_set_options(a, p); + free(p); + if (r < ARCHIVE_WARN) + lafe_errc(1, 0, "%s", archive_error_string(a)); + else + archive_clear_error(a); + } +} + void tar_mode_c(struct bsdtar *bsdtar) { struct archive *a; + const void *filter_name; int r; if (*bsdtar->argv == NULL && bsdtar->names_from_file == NULL) @@ -146,15 +212,16 @@ tar_mode_c(struct bsdtar *bsdtar) a = archive_write_new(); /* Support any format that the library supports. */ - if (bsdtar->create_format == NULL) { + if (cset_get_format(bsdtar->cset) == NULL) { r = archive_write_set_format_pax_restricted(a); - bsdtar->create_format = "pax restricted"; + cset_set_format(bsdtar->cset, "pax restricted"); } else { - r = archive_write_set_format_by_name(a, bsdtar->create_format); + r = archive_write_set_format_by_name(a, + cset_get_format(bsdtar->cset)); } if (r != ARCHIVE_OK) { fprintf(stderr, "Can't use format %s: %s\n", - bsdtar->create_format, + cset_get_format(bsdtar->cset), archive_error_string(a)); usage(); } @@ -162,46 +229,14 @@ tar_mode_c(struct bsdtar *bsdtar) archive_write_set_bytes_per_block(a, bsdtar->bytes_per_block); archive_write_set_bytes_in_last_block(a, bsdtar->bytes_in_last_block); - if (bsdtar->compress_program) { - archive_write_set_compression_program(a, bsdtar->compress_program); - } else { - switch (bsdtar->create_compression) { - case 0: - r = ARCHIVE_OK; - break; - case 'j': case 'y': - r = archive_write_set_compression_bzip2(a); - break; - case 'J': - r = archive_write_set_compression_xz(a); - break; - case OPTION_LZIP: - r = archive_write_set_compression_lzip(a); - break; - case OPTION_LZMA: - r = archive_write_set_compression_lzma(a); - break; - case 'z': - r = archive_write_set_compression_gzip(a); - break; - case 'Z': - r = archive_write_set_compression_compress(a); - break; - default: - lafe_errc(1, 0, - "Unrecognized compression option -%c", - bsdtar->create_compression); - } - if (r != ARCHIVE_OK) { - lafe_errc(1, 0, - "Unsupported compression option -%c", - bsdtar->create_compression); - } + r = cset_write_add_filters(bsdtar->cset, a, &filter_name); + if (r < ARCHIVE_WARN) { + lafe_errc(1, 0, "Unsupported compression option --%s", + (const char *)filter_name); } - if (ARCHIVE_OK != archive_write_set_options(a, bsdtar->option_options)) - lafe_errc(1, 0, "%s", archive_error_string(a)); - if (ARCHIVE_OK != archive_write_open_file(a, bsdtar->filename)) + set_writer_options(bsdtar, a); + if (ARCHIVE_OK != archive_write_open_filename(a, bsdtar->filename)) lafe_errc(1, 0, "%s", archive_error_string(a)); write_archive(a, bsdtar); } @@ -235,15 +270,17 @@ tar_mode_r(struct bsdtar *bsdtar) a = archive_read_new(); archive_read_support_filter_all(a); + archive_read_support_format_empty(a); archive_read_support_format_tar(a); archive_read_support_format_gnutar(a); + set_reader_options(bsdtar, a); r = archive_read_open_fd(a, bsdtar->fd, 10240); if (r != ARCHIVE_OK) lafe_errc(1, archive_errno(a), "Can't read archive %s: %s", bsdtar->filename, archive_error_string(a)); while (0 == archive_read_next_header(a, &entry)) { - if (archive_compression(a) != ARCHIVE_COMPRESSION_NONE) { + if (archive_filter_code(a, 0) != ARCHIVE_FILTER_NONE) { archive_read_free(a); close(bsdtar->fd); lafe_errc(1, 0, @@ -266,17 +303,17 @@ tar_mode_r(struct bsdtar *bsdtar) * of arcane ugliness. */ - if (bsdtar->create_format != NULL) { + if (cset_get_format(bsdtar->cset) != NULL) { /* If the user requested a format, use that, but ... */ archive_write_set_format_by_name(a, - bsdtar->create_format); + cset_get_format(bsdtar->cset)); /* ... complain if it's not compatible. */ format &= ARCHIVE_FORMAT_BASE_MASK; if (format != (int)(archive_format(a) & ARCHIVE_FORMAT_BASE_MASK) && format != ARCHIVE_FORMAT_EMPTY) { lafe_errc(1, 0, "Format %s is incompatible with the archive %s.", - bsdtar->create_format, bsdtar->filename); + cset_get_format(bsdtar->cset), bsdtar->filename); } } else { /* @@ -289,8 +326,7 @@ tar_mode_r(struct bsdtar *bsdtar) } if (lseek(bsdtar->fd, end_offset, SEEK_SET) < 0) lafe_errc(1, errno, "Could not seek to archive end"); - if (ARCHIVE_OK != archive_write_set_options(a, bsdtar->option_options)) - lafe_errc(1, 0, "%s", archive_error_string(a)); + set_writer_options(bsdtar, a); if (ARCHIVE_OK != archive_write_open_fd(a, bsdtar->fd)) lafe_errc(1, 0, "%s", archive_error_string(a)); @@ -327,6 +363,7 @@ tar_mode_u(struct bsdtar *bsdtar) archive_read_support_filter_all(a); archive_read_support_format_tar(a); archive_read_support_format_gnutar(a); + set_reader_options(bsdtar, a); if (archive_read_open_fd(a, bsdtar->fd, bsdtar->bytes_per_block) != ARCHIVE_OK) { lafe_errc(1, 0, @@ -336,7 +373,7 @@ tar_mode_u(struct bsdtar *bsdtar) /* Build a list of all entries and their recorded mod times. */ while (0 == archive_read_next_header(a, &entry)) { - if (archive_compression(a) != ARCHIVE_COMPRESSION_NONE) { + if (archive_filter_code(a, 0) != ARCHIVE_FILTER_NONE) { archive_read_free(a); close(bsdtar->fd); lafe_errc(1, 0, @@ -366,8 +403,7 @@ tar_mode_u(struct bsdtar *bsdtar) if (lseek(bsdtar->fd, end_offset, SEEK_SET) < 0) lafe_errc(1, errno, "Could not seek to archive end"); - if (ARCHIVE_OK != archive_write_set_options(a, bsdtar->option_options)) - lafe_errc(1, 0, "%s", archive_error_string(a)); + set_writer_options(bsdtar, a); if (ARCHIVE_OK != archive_write_open_fd(a, bsdtar->fd)) lafe_errc(1, 0, "%s", archive_error_string(a)); @@ -543,7 +579,7 @@ write_archive(struct archive *a, struct bsdtar *bsdtar) if (bsdtar->option_totals) { fprintf(stderr, "Total bytes written: %s\n", - tar_i64toa(archive_position_compressed(a))); + tar_i64toa(archive_filter_bytes(a, -1))); } archive_write_free(a); @@ -611,7 +647,9 @@ append_archive_filename(struct bsdtar *bsdtar, struct archive *a, ina = archive_read_new(); archive_read_support_format_all(ina); archive_read_support_filter_all(ina); - if (archive_read_open_file(ina, filename, bsdtar->bytes_per_block)) { + set_reader_options(bsdtar, a); + if (archive_read_open_filename(ina, filename, + bsdtar->bytes_per_block)) { lafe_warnc(0, "%s", archive_error_string(ina)); bsdtar->return_value = 1; return (0); @@ -941,8 +979,8 @@ report_write(struct bsdtar *bsdtar, struct archive *a, if (bsdtar->verbose) fprintf(stderr, "\n"); - comp = archive_position_compressed(a); - uncomp = archive_position_uncompressed(a); + comp = archive_filter_bytes(a, -1); + uncomp = archive_filter_bytes(a, 0); fprintf(stderr, "In: %d files, %s bytes;", archive_file_count(a), tar_i64toa(uncomp)); if (comp > uncomp) @@ -970,10 +1008,6 @@ test_for_append(struct bsdtar *bsdtar) if (bsdtar->filename == NULL) lafe_errc(1, 0, "Cannot append to stdout."); - if (bsdtar->create_compression != 0) - lafe_errc(1, 0, - "Cannot append to %s with compression", bsdtar->filename); - if (stat(bsdtar->filename, &s) != 0) return; diff --git a/test_utils/test_utils.c b/test_utils/test_utils.c new file mode 100644 index 000000000000..8ea3d3c4b33d --- /dev/null +++ b/test_utils/test_utils.c @@ -0,0 +1,124 @@ +/* + * Copyright (c) 2003-2012 Tim Kientzle + * Copyright (c) 2012 Andres Mejia + * 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_utils.h" + +#include +#include + +/* Filter tests against a glob pattern. Returns non-zero if test matches + * pattern, zero otherwise. A '^' at the beginning of the pattern negates + * the return values (i.e. returns zero for a match, non-zero otherwise. + */ +static int +test_filter(const char *pattern, const char *test) +{ + int retval = 0; + int negate = 0; + const char *p = pattern; + const char *t = test; + + if (p[0] == '^') + { + negate = 1; + p++; + } + + while (1) + { + if (p[0] == '\\') + p++; + else if (p[0] == '*') + { + while (p[0] == '*') + p++; + if (p[0] == '\\') + p++; + if ((t = strchr(t, p[0])) == 0) + break; + } + if (p[0] != t[0]) + break; + if (p[0] == '\0') { + retval = 1; + break; + } + p++; + t++; + } + + return (negate) ? !retval : retval; +} + +int get_test_set(int *test_set, int limit, const char *test, + struct test_list_t *tests) +{ + int start, end; + int idx = 0; + + if (test == NULL) { + /* Default: Run all tests. */ + for (;idx < limit; idx++) + test_set[idx] = idx; + return (limit); + } + if (*test >= '0' && *test <= '9') { + const char *vp = test; + start = 0; + while (*vp >= '0' && *vp <= '9') { + start *= 10; + start += *vp - '0'; + ++vp; + } + if (*vp == '\0') { + end = start; + } else if (*vp == '-') { + ++vp; + if (*vp == '\0') { + end = limit - 1; + } else { + end = 0; + while (*vp >= '0' && *vp <= '9') { + end *= 10; + end += *vp - '0'; + ++vp; + } + } + } else + return (-1); + if (start < 0 || end >= limit || start > end) + return (-1); + while (start <= end) + test_set[idx++] = start++; + } else { + for (start = 0; start < limit; ++start) { + const char *name = tests[start].name; + if (test_filter(test, name)) + test_set[idx++] = start; + } + } + return ((idx == 0)?-1:idx); +} diff --git a/test_utils/test_utils.h b/test_utils/test_utils.h new file mode 100644 index 000000000000..164c528fc1de --- /dev/null +++ b/test_utils/test_utils.h @@ -0,0 +1,39 @@ +/* + * Copyright (c) 2003-2012 Tim Kientzle + * Copyright (c) 2012 Andres Mejia + * 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 TEST_UTILS_H +#define TEST_UTILS_H + +struct test_list_t +{ + void (*func)(void); + const char *name; + int failures; +}; + +int get_test_set(int *, int, const char *, struct test_list_t *); + +#endif /* TEST_UTILS_H */