libarchive-static 1.0.6 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/extconf.rb +2 -9
- data/ext/libarchive-0.1.1/ext/archive_read_support_compression.c +6 -6
- data/ext/libarchive-0.1.1/ext/archive_read_support_compression.o +0 -0
- data/ext/libarchive-0.1.1/ext/archive_read_support_format.o +0 -0
- data/ext/libarchive-0.1.1/ext/archive_write_open_rb_str.c +1 -1
- data/ext/libarchive-0.1.1/ext/archive_write_open_rb_str.o +0 -0
- data/ext/libarchive-0.1.1/ext/archive_write_set_compression.c +5 -5
- data/ext/libarchive-0.1.1/ext/archive_write_set_compression.o +0 -0
- data/ext/libarchive-0.1.1/ext/config.h +23 -0
- data/ext/libarchive-0.1.1/ext/config.log +230 -0
- data/ext/libarchive-0.1.1/ext/config.status +671 -0
- data/ext/libarchive-0.1.1/ext/libarchive.c +1 -1
- data/ext/libarchive-0.1.1/ext/libarchive.o +0 -0
- data/ext/libarchive-0.1.1/ext/libarchive_archive.c +7 -7
- data/ext/libarchive-0.1.1/ext/libarchive_archive.o +0 -0
- data/ext/libarchive-0.1.1/ext/libarchive_entry.c +6 -0
- data/ext/libarchive-0.1.1/ext/libarchive_entry.o +0 -0
- data/ext/libarchive-0.1.1/ext/libarchive_reader.c +6 -4
- data/ext/libarchive-0.1.1/ext/libarchive_reader.o +0 -0
- data/ext/libarchive-0.1.1/ext/libarchive_ruby.so +0 -0
- data/ext/libarchive-0.1.1/ext/libarchive_win32.h +1 -1
- data/ext/libarchive-0.1.1/ext/libarchive_writer.c +2 -2
- data/ext/libarchive-0.1.1/ext/libarchive_writer.o +0 -0
- data/ext/libarchive-3.6.2/Makefile.in +16892 -0
- data/ext/libarchive-3.6.2/build/autoconf/ax_append_compile_flags.m4 +67 -0
- data/ext/libarchive-3.6.2/build/autoconf/ax_append_flag.m4 +71 -0
- data/ext/libarchive-3.6.2/build/autoconf/ax_check_compile_flag.m4 +74 -0
- data/ext/libarchive-3.6.2/build/autoconf/ax_require_defined.m4 +37 -0
- data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/build/autoconf/check_stdcall_func.m4 +0 -0
- data/ext/libarchive-3.6.2/build/autoconf/compile +348 -0
- data/ext/libarchive-3.6.2/build/autoconf/config.guess +1754 -0
- data/ext/libarchive-3.6.2/build/autoconf/config.rpath +696 -0
- data/ext/libarchive-3.6.2/build/autoconf/config.sub +1890 -0
- data/ext/libarchive-3.6.2/build/autoconf/depcomp +791 -0
- data/ext/libarchive-3.6.2/build/autoconf/iconv.m4 +271 -0
- data/ext/libarchive-3.6.2/build/autoconf/install-sh +541 -0
- data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/build/autoconf/la_uid_t.m4 +0 -0
- data/ext/libarchive-3.6.2/build/autoconf/lib-ld.m4 +109 -0
- data/ext/libarchive-3.6.2/build/autoconf/lib-link.m4 +777 -0
- data/ext/libarchive-3.6.2/build/autoconf/lib-prefix.m4 +224 -0
- data/ext/libarchive-3.6.2/build/autoconf/ltmain.sh +11251 -0
- data/ext/libarchive-3.6.2/build/autoconf/m4_ax_compile_check_sizeof.m4 +115 -0
- data/ext/libarchive-3.6.2/build/autoconf/missing +215 -0
- data/ext/libarchive-3.6.2/build/autoconf/test-driver +153 -0
- data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/build/pkgconfig/libarchive.pc.in +4 -1
- data/ext/libarchive-3.6.2/config.h.in +1504 -0
- data/ext/libarchive-3.6.2/configure +25558 -0
- data/ext/libarchive-3.6.2/libarchive/archive.h +1212 -0
- data/ext/libarchive-3.6.2/libarchive/archive_acl.c +2097 -0
- data/ext/libarchive-3.6.2/libarchive/archive_acl_private.h +83 -0
- data/ext/libarchive-3.6.2/libarchive/archive_blake2.h +197 -0
- data/ext/libarchive-3.6.2/libarchive/archive_blake2_impl.h +161 -0
- data/ext/libarchive-3.6.2/libarchive/archive_blake2s_ref.c +369 -0
- data/ext/libarchive-3.6.2/libarchive/archive_blake2sp_ref.c +361 -0
- data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_check_magic.c +63 -22
- data/ext/libarchive-3.6.2/libarchive/archive_cmdline.c +227 -0
- data/ext/libarchive-3.6.2/libarchive/archive_cmdline_private.h +47 -0
- data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_crc32.h +17 -0
- data/ext/libarchive-3.6.2/libarchive/archive_cryptor.c +534 -0
- data/ext/libarchive-3.6.2/libarchive/archive_cryptor_private.h +188 -0
- data/ext/libarchive-3.6.2/libarchive/archive_digest.c +1505 -0
- data/ext/libarchive-3.6.2/libarchive/archive_digest_private.h +416 -0
- data/ext/libarchive-3.6.2/libarchive/archive_disk_acl_darwin.c +559 -0
- data/ext/libarchive-3.6.2/libarchive/archive_disk_acl_freebsd.c +712 -0
- data/ext/libarchive-3.6.2/libarchive/archive_disk_acl_linux.c +760 -0
- data/ext/libarchive-3.6.2/libarchive/archive_disk_acl_sunos.c +824 -0
- data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_endian.h +48 -15
- data/ext/libarchive-3.6.2/libarchive/archive_entry.c +2149 -0
- data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_entry.h +305 -106
- data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_entry_copy_bhfi.c +5 -4
- data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_entry_copy_stat.c +9 -3
- data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_entry_link_resolver.c +104 -62
- data/ext/libarchive-3.6.2/libarchive/archive_entry_locale.h +92 -0
- data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_entry_private.h +65 -49
- data/ext/libarchive-3.6.2/libarchive/archive_entry_sparse.c +156 -0
- data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_entry_stat.c +6 -6
- data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_entry_strmode.c +1 -1
- data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_entry_xattr.c +4 -6
- data/ext/libarchive-3.6.2/libarchive/archive_getdate.c +1165 -0
- data/ext/libarchive-3.6.2/libarchive/archive_getdate.h +39 -0
- data/ext/libarchive-3.6.2/libarchive/archive_hmac.c +334 -0
- data/ext/libarchive-3.6.2/libarchive/archive_hmac_private.h +117 -0
- data/ext/libarchive-3.6.2/libarchive/archive_match.c +1875 -0
- data/ext/libarchive-3.6.2/libarchive/archive_openssl_evp_private.h +53 -0
- data/ext/libarchive-3.6.2/libarchive/archive_openssl_hmac_private.h +54 -0
- data/ext/libarchive-3.6.2/libarchive/archive_options.c +218 -0
- data/ext/libarchive-3.6.2/libarchive/archive_options_private.h +51 -0
- data/ext/libarchive-3.6.2/libarchive/archive_pack_dev.c +337 -0
- data/ext/libarchive-3.6.2/libarchive/archive_pack_dev.h +49 -0
- data/ext/libarchive-3.6.2/libarchive/archive_pathmatch.c +463 -0
- data/ext/libarchive-3.6.2/libarchive/archive_pathmatch.h +52 -0
- data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_platform.h +77 -9
- data/ext/libarchive-3.6.2/libarchive/archive_platform_acl.h +55 -0
- data/ext/libarchive-3.6.2/libarchive/archive_platform_xattr.h +47 -0
- data/ext/libarchive-3.6.2/libarchive/archive_ppmd7.c +1168 -0
- data/ext/libarchive-3.6.2/libarchive/archive_ppmd7_private.h +119 -0
- data/ext/libarchive-3.6.2/libarchive/archive_ppmd8.c +1287 -0
- data/ext/libarchive-3.6.2/libarchive/archive_ppmd8_private.h +148 -0
- data/ext/libarchive-3.6.2/libarchive/archive_ppmd_private.h +151 -0
- data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_private.h +74 -18
- data/ext/libarchive-3.6.2/libarchive/archive_random.c +272 -0
- data/ext/libarchive-3.6.2/libarchive/archive_random_private.h +36 -0
- data/ext/libarchive-3.6.2/libarchive/archive_rb.c +709 -0
- data/ext/libarchive-3.6.2/libarchive/archive_rb.h +113 -0
- data/ext/libarchive-3.6.2/libarchive/archive_read.c +1756 -0
- data/ext/libarchive-3.6.2/libarchive/archive_read_add_passphrase.c +190 -0
- data/ext/libarchive-3.6.2/libarchive/archive_read_append_filter.c +204 -0
- data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_read_data_into_fd.c +64 -18
- data/ext/libarchive-3.6.2/libarchive/archive_read_disk_entry_from_file.c +1086 -0
- data/ext/libarchive-3.6.2/libarchive/archive_read_disk_posix.c +2732 -0
- data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_read_disk_private.h +40 -4
- data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_read_disk_set_standard_lookup.c +21 -11
- data/ext/libarchive-3.6.2/libarchive/archive_read_disk_windows.c +2479 -0
- data/ext/libarchive-3.6.2/libarchive/archive_read_extract.c +60 -0
- data/ext/{libarchive-2.8.4/libarchive/archive_read_extract.c → libarchive-3.6.2/libarchive/archive_read_extract2.c} +34 -61
- data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_read_open_fd.c +70 -49
- data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_read_open_file.c +38 -23
- data/ext/libarchive-3.6.2/libarchive/archive_read_open_filename.c +586 -0
- data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_read_open_memory.c +58 -28
- data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_read_private.h +127 -59
- data/ext/libarchive-3.6.2/libarchive/archive_read_set_format.c +117 -0
- data/ext/libarchive-3.6.2/libarchive/archive_read_set_options.c +133 -0
- data/ext/{libarchive-2.8.4/libarchive/archive_read_support_compression_all.c → libarchive-3.6.2/libarchive/archive_read_support_filter_all.c} +35 -10
- data/ext/libarchive-3.6.2/libarchive/archive_read_support_filter_by_code.c +83 -0
- data/ext/{libarchive-2.8.4/libarchive/archive_read_support_compression_bzip2.c → libarchive-3.6.2/libarchive/archive_read_support_filter_bzip2.c} +38 -26
- data/ext/{libarchive-2.8.4/libarchive/archive_read_support_compression_compress.c → libarchive-3.6.2/libarchive/archive_read_support_filter_compress.c} +52 -44
- data/ext/libarchive-3.6.2/libarchive/archive_read_support_filter_grzip.c +112 -0
- data/ext/{libarchive-2.8.4/libarchive/archive_read_support_compression_gzip.c → libarchive-3.6.2/libarchive/archive_read_support_filter_gzip.c} +108 -37
- data/ext/libarchive-3.6.2/libarchive/archive_read_support_filter_lrzip.c +122 -0
- data/ext/libarchive-3.6.2/libarchive/archive_read_support_filter_lz4.c +742 -0
- data/ext/libarchive-3.6.2/libarchive/archive_read_support_filter_lzop.c +499 -0
- data/ext/{libarchive-2.8.4/libarchive/archive_read_support_compression_none.c → libarchive-3.6.2/libarchive/archive_read_support_filter_none.c} +15 -3
- data/ext/{libarchive-2.8.4/libarchive/archive_read_support_compression_program.c → libarchive-3.6.2/libarchive/archive_read_support_filter_program.c} +114 -77
- data/ext/{libarchive-2.8.4/libarchive/archive_read_support_compression_rpm.c → libarchive-3.6.2/libarchive/archive_read_support_filter_rpm.c} +31 -31
- data/ext/{libarchive-2.8.4/libarchive/archive_read_support_compression_uu.c → libarchive-3.6.2/libarchive/archive_read_support_filter_uu.c} +141 -85
- data/ext/{libarchive-2.8.4/libarchive/archive_read_support_compression_xz.c → libarchive-3.6.2/libarchive/archive_read_support_filter_xz.c} +369 -284
- data/ext/libarchive-3.6.2/libarchive/archive_read_support_filter_zstd.c +297 -0
- data/ext/libarchive-3.6.2/libarchive/archive_read_support_format_7zip.c +3900 -0
- data/ext/libarchive-3.6.2/libarchive/archive_read_support_format_all.c +89 -0
- data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_read_support_format_ar.c +126 -72
- data/ext/libarchive-3.6.2/libarchive/archive_read_support_format_by_code.c +92 -0
- data/ext/libarchive-3.6.2/libarchive/archive_read_support_format_cab.c +3228 -0
- data/ext/libarchive-3.6.2/libarchive/archive_read_support_format_cpio.c +1104 -0
- data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_read_support_format_empty.c +14 -11
- data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_read_support_format_iso9660.c +990 -541
- data/ext/libarchive-3.6.2/libarchive/archive_read_support_format_lha.c +2916 -0
- data/ext/libarchive-3.6.2/libarchive/archive_read_support_format_mtree.c +2150 -0
- data/ext/libarchive-3.6.2/libarchive/archive_read_support_format_rar.c +3797 -0
- data/ext/libarchive-3.6.2/libarchive/archive_read_support_format_rar5.c +4251 -0
- data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_read_support_format_raw.c +38 -31
- data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_read_support_format_tar.c +1157 -629
- data/ext/libarchive-3.6.2/libarchive/archive_read_support_format_warc.c +848 -0
- data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_read_support_format_xar.c +439 -258
- data/ext/libarchive-3.6.2/libarchive/archive_read_support_format_zip.c +4270 -0
- data/ext/libarchive-3.6.2/libarchive/archive_string.c +4240 -0
- data/ext/libarchive-3.6.2/libarchive/archive_string.h +243 -0
- data/ext/libarchive-3.6.2/libarchive/archive_string_composition.h +2292 -0
- data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_string_sprintf.c +44 -16
- data/ext/libarchive-3.6.2/libarchive/archive_util.c +655 -0
- data/ext/libarchive-3.6.2/libarchive/archive_version_details.c +151 -0
- data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_virtual.c +85 -16
- data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_windows.c +214 -541
- data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_windows.h +74 -106
- data/ext/libarchive-3.6.2/libarchive/archive_write.c +828 -0
- data/ext/libarchive-3.6.2/libarchive/archive_write_add_filter.c +72 -0
- data/ext/libarchive-3.6.2/libarchive/archive_write_add_filter_b64encode.c +304 -0
- data/ext/libarchive-3.6.2/libarchive/archive_write_add_filter_by_name.c +77 -0
- data/ext/libarchive-3.6.2/libarchive/archive_write_add_filter_bzip2.c +401 -0
- data/ext/{libarchive-2.8.4/libarchive/archive_write_set_compression_compress.c → libarchive-3.6.2/libarchive/archive_write_add_filter_compress.c} +86 -131
- data/ext/libarchive-3.6.2/libarchive/archive_write_add_filter_grzip.c +135 -0
- data/ext/libarchive-3.6.2/libarchive/archive_write_add_filter_gzip.c +442 -0
- data/ext/libarchive-3.6.2/libarchive/archive_write_add_filter_lrzip.c +197 -0
- data/ext/libarchive-3.6.2/libarchive/archive_write_add_filter_lz4.c +700 -0
- data/ext/libarchive-3.6.2/libarchive/archive_write_add_filter_lzop.c +478 -0
- data/ext/{libarchive-2.8.4/libarchive/archive_read_support_format_all.c → libarchive-3.6.2/libarchive/archive_write_add_filter_none.c} +11 -11
- data/ext/libarchive-3.6.2/libarchive/archive_write_add_filter_program.c +391 -0
- data/ext/libarchive-3.6.2/libarchive/archive_write_add_filter_uuencode.c +295 -0
- data/ext/libarchive-3.6.2/libarchive/archive_write_add_filter_xz.c +545 -0
- data/ext/libarchive-3.6.2/libarchive/archive_write_add_filter_zstd.c +418 -0
- data/ext/libarchive-3.6.2/libarchive/archive_write_disk_posix.c +4711 -0
- data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_write_disk_private.h +9 -2
- data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_write_disk_set_standard_lookup.c +30 -29
- data/ext/libarchive-3.6.2/libarchive/archive_write_disk_windows.c +2842 -0
- data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_write_open_fd.c +15 -10
- data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_write_open_file.c +15 -9
- data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_write_open_filename.c +128 -20
- data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_write_open_memory.c +7 -18
- data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_write_private.h +72 -29
- data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_write_set_format.c +56 -3
- data/ext/libarchive-3.6.2/libarchive/archive_write_set_format_7zip.c +2322 -0
- data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_write_set_format_ar.c +54 -34
- data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_write_set_format_by_name.c +20 -2
- data/ext/libarchive-3.6.2/libarchive/archive_write_set_format_cpio.c +11 -0
- data/ext/libarchive-3.6.2/libarchive/archive_write_set_format_cpio_binary.c +610 -0
- data/ext/libarchive-3.6.2/libarchive/archive_write_set_format_cpio_newc.c +457 -0
- data/ext/libarchive-3.6.2/libarchive/archive_write_set_format_cpio_odc.c +500 -0
- data/ext/libarchive-3.6.2/libarchive/archive_write_set_format_filter_by_ext.c +142 -0
- data/ext/libarchive-3.6.2/libarchive/archive_write_set_format_gnutar.c +755 -0
- data/ext/libarchive-3.6.2/libarchive/archive_write_set_format_iso9660.c +8165 -0
- data/ext/libarchive-3.6.2/libarchive/archive_write_set_format_mtree.c +2217 -0
- data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_write_set_format_pax.c +1049 -387
- data/ext/libarchive-3.6.2/libarchive/archive_write_set_format_private.h +42 -0
- data/ext/libarchive-3.6.2/libarchive/archive_write_set_format_raw.c +125 -0
- data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_write_set_format_shar.c +62 -47
- data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_write_set_format_ustar.c +279 -108
- data/ext/libarchive-3.6.2/libarchive/archive_write_set_format_v7tar.c +638 -0
- data/ext/libarchive-3.6.2/libarchive/archive_write_set_format_warc.c +453 -0
- data/ext/libarchive-3.6.2/libarchive/archive_write_set_format_xar.c +3259 -0
- data/ext/libarchive-3.6.2/libarchive/archive_write_set_format_zip.c +1704 -0
- data/ext/libarchive-3.6.2/libarchive/archive_write_set_options.c +130 -0
- data/ext/libarchive-3.6.2/libarchive/archive_write_set_passphrase.c +95 -0
- data/ext/libarchive-3.6.2/libarchive/archive_xxhash.h +48 -0
- data/ext/libarchive-3.6.2/libarchive/config_freebsd.h +271 -0
- data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/filter_fork.h +10 -5
- data/ext/{libarchive-2.8.4/libarchive/filter_fork.c → libarchive-3.6.2/libarchive/filter_fork_posix.c} +98 -19
- data/ext/libarchive-3.6.2/libarchive/filter_fork_windows.c +236 -0
- data/ext/libarchive-3.6.2/libarchive/xxhash.c +525 -0
- data/ext/libarchive-static-makefile +144 -80
- data/ext/libarchive-static-wrapper-makefile +1 -1
- data/ext/zlib-1.2.13/Makefile.in +404 -0
- data/ext/{zlib-1.2.5 → zlib-1.2.13}/adler32.c +51 -34
- data/ext/{zlib-1.2.5 → zlib-1.2.13}/compress.c +27 -21
- data/ext/zlib-1.2.13/configure +922 -0
- data/ext/zlib-1.2.13/crc32.c +1125 -0
- data/ext/zlib-1.2.13/crc32.h +9446 -0
- data/ext/{zlib-1.2.5 → zlib-1.2.13}/deflate.c +842 -459
- data/ext/{zlib-1.2.5 → zlib-1.2.13}/deflate.h +37 -33
- data/ext/{zlib-1.2.5 → zlib-1.2.13}/gzclose.c +0 -0
- data/ext/{zlib-1.2.5 → zlib-1.2.13}/gzguts.h +103 -16
- data/ext/{zlib-1.2.5 → zlib-1.2.13}/gzlib.c +155 -53
- data/ext/zlib-1.2.13/gzread.c +650 -0
- data/ext/zlib-1.2.13/gzwrite.c +677 -0
- data/ext/{zlib-1.2.5 → zlib-1.2.13}/infback.c +24 -12
- data/ext/{zlib-1.2.5 → zlib-1.2.13}/inffast.c +49 -66
- data/ext/{zlib-1.2.5 → zlib-1.2.13}/inffast.h +0 -0
- data/ext/{zlib-1.2.5 → zlib-1.2.13}/inffixed.h +3 -3
- data/ext/{zlib-1.2.5 → zlib-1.2.13}/inflate.c +209 -94
- data/ext/{zlib-1.2.5 → zlib-1.2.13}/inflate.h +9 -5
- data/ext/{zlib-1.2.5 → zlib-1.2.13}/inftrees.c +24 -50
- data/ext/{zlib-1.2.5 → zlib-1.2.13}/inftrees.h +1 -1
- data/ext/{zlib-1.2.5 → zlib-1.2.13}/trees.c +135 -198
- data/ext/{zlib-1.2.5 → zlib-1.2.13}/trees.h +0 -0
- data/ext/zlib-1.2.13/uncompr.c +93 -0
- data/ext/{zlib-1.2.5 → zlib-1.2.13}/zconf.h +182 -63
- data/ext/{zlib-1.2.5 → zlib-1.2.13}/zlib.h +617 -295
- data/ext/{zlib-1.2.5 → zlib-1.2.13}/zutil.c +50 -41
- data/ext/{zlib-1.2.5 → zlib-1.2.13}/zutil.h +83 -82
- metadata +241 -133
- data/ext/libarchive-0.1.1/libarchive.c +0 -1762
- data/ext/libarchive-2.8.4/Makefile.in +0 -7076
- data/ext/libarchive-2.8.4/build/autoconf/compile +0 -143
- data/ext/libarchive-2.8.4/build/autoconf/config.guess +0 -1502
- data/ext/libarchive-2.8.4/build/autoconf/config.sub +0 -1708
- data/ext/libarchive-2.8.4/build/autoconf/depcomp +0 -630
- data/ext/libarchive-2.8.4/build/autoconf/install-sh +0 -291
- data/ext/libarchive-2.8.4/build/autoconf/ltmain.sh +0 -8406
- data/ext/libarchive-2.8.4/build/autoconf/missing +0 -376
- data/ext/libarchive-2.8.4/config.h.in +0 -772
- data/ext/libarchive-2.8.4/configure +0 -17916
- data/ext/libarchive-2.8.4/libarchive/archive.h +0 -741
- data/ext/libarchive-2.8.4/libarchive/archive_entry.c +0 -2202
- data/ext/libarchive-2.8.4/libarchive/archive_hash.h +0 -281
- data/ext/libarchive-2.8.4/libarchive/archive_read.c +0 -1249
- data/ext/libarchive-2.8.4/libarchive/archive_read_disk.c +0 -198
- data/ext/libarchive-2.8.4/libarchive/archive_read_disk_entry_from_file.c +0 -570
- data/ext/libarchive-2.8.4/libarchive/archive_read_open_filename.c +0 -272
- data/ext/libarchive-2.8.4/libarchive/archive_read_support_format_cpio.c +0 -777
- data/ext/libarchive-2.8.4/libarchive/archive_read_support_format_mtree.c +0 -1304
- data/ext/libarchive-2.8.4/libarchive/archive_read_support_format_zip.c +0 -903
- data/ext/libarchive-2.8.4/libarchive/archive_string.c +0 -453
- data/ext/libarchive-2.8.4/libarchive/archive_string.h +0 -148
- data/ext/libarchive-2.8.4/libarchive/archive_util.c +0 -391
- data/ext/libarchive-2.8.4/libarchive/archive_write.c +0 -466
- data/ext/libarchive-2.8.4/libarchive/archive_write_disk.c +0 -2628
- data/ext/libarchive-2.8.4/libarchive/archive_write_set_compression_bzip2.c +0 -408
- data/ext/libarchive-2.8.4/libarchive/archive_write_set_compression_gzip.c +0 -477
- data/ext/libarchive-2.8.4/libarchive/archive_write_set_compression_none.c +0 -257
- data/ext/libarchive-2.8.4/libarchive/archive_write_set_compression_program.c +0 -347
- data/ext/libarchive-2.8.4/libarchive/archive_write_set_compression_xz.c +0 -438
- data/ext/libarchive-2.8.4/libarchive/archive_write_set_format_cpio.c +0 -344
- data/ext/libarchive-2.8.4/libarchive/archive_write_set_format_cpio_newc.c +0 -295
- data/ext/libarchive-2.8.4/libarchive/archive_write_set_format_mtree.c +0 -1050
- data/ext/libarchive-2.8.4/libarchive/archive_write_set_format_zip.c +0 -667
- data/ext/libarchive-2.8.4/libarchive/config_freebsd.h +0 -154
- data/ext/libarchive-2.8.4/libarchive/filter_fork_windows.c +0 -113
- data/ext/zlib-1.2.5/Makefile.in +0 -257
- data/ext/zlib-1.2.5/configure +0 -596
- data/ext/zlib-1.2.5/crc32.c +0 -442
- data/ext/zlib-1.2.5/crc32.h +0 -441
- data/ext/zlib-1.2.5/example.c +0 -565
- data/ext/zlib-1.2.5/gzread.c +0 -653
- data/ext/zlib-1.2.5/gzwrite.c +0 -531
- data/ext/zlib-1.2.5/minigzip.c +0 -440
- data/ext/zlib-1.2.5/uncompr.c +0 -59
@@ -0,0 +1,89 @@
|
|
1
|
+
/*-
|
2
|
+
* Copyright (c) 2003-2011 Tim Kientzle
|
3
|
+
* All rights reserved.
|
4
|
+
*
|
5
|
+
* Redistribution and use in source and binary forms, with or without
|
6
|
+
* modification, are permitted provided that the following conditions
|
7
|
+
* are met:
|
8
|
+
* 1. Redistributions of source code must retain the above copyright
|
9
|
+
* notice, this list of conditions and the following disclaimer.
|
10
|
+
* 2. Redistributions in binary form must reproduce the above copyright
|
11
|
+
* notice, this list of conditions and the following disclaimer in the
|
12
|
+
* documentation and/or other materials provided with the distribution.
|
13
|
+
*
|
14
|
+
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
|
15
|
+
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
16
|
+
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
17
|
+
* IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
|
18
|
+
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
19
|
+
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
20
|
+
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
21
|
+
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
22
|
+
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
23
|
+
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
24
|
+
*/
|
25
|
+
|
26
|
+
#include "archive_platform.h"
|
27
|
+
__FBSDID("$FreeBSD: head/lib/libarchive/archive_read_support_format_all.c 174991 2007-12-30 04:58:22Z kientzle $");
|
28
|
+
|
29
|
+
#include "archive.h"
|
30
|
+
#include "archive_private.h"
|
31
|
+
|
32
|
+
int
|
33
|
+
archive_read_support_format_all(struct archive *a)
|
34
|
+
{
|
35
|
+
archive_check_magic(a, ARCHIVE_READ_MAGIC,
|
36
|
+
ARCHIVE_STATE_NEW, "archive_read_support_format_all");
|
37
|
+
|
38
|
+
/* TODO: It would be nice to compute the ordering
|
39
|
+
* here automatically so that people who enable just
|
40
|
+
* a few formats can still get the benefits. That
|
41
|
+
* may just require the format registration to include
|
42
|
+
* a "maximum read-ahead" value (anything that uses seek
|
43
|
+
* would be essentially infinite read-ahead). The core
|
44
|
+
* bid management can then sort the bidders before calling
|
45
|
+
* them.
|
46
|
+
*
|
47
|
+
* If you implement the above, please return the list below
|
48
|
+
* to alphabetic order.
|
49
|
+
*/
|
50
|
+
|
51
|
+
/*
|
52
|
+
* These bidders are all pretty cheap; they just examine a
|
53
|
+
* small initial part of the archive. If one of these bids
|
54
|
+
* high, we can maybe avoid running any of the more expensive
|
55
|
+
* bidders below.
|
56
|
+
*/
|
57
|
+
archive_read_support_format_ar(a);
|
58
|
+
archive_read_support_format_cpio(a);
|
59
|
+
archive_read_support_format_empty(a);
|
60
|
+
archive_read_support_format_lha(a);
|
61
|
+
archive_read_support_format_mtree(a);
|
62
|
+
archive_read_support_format_tar(a);
|
63
|
+
archive_read_support_format_xar(a);
|
64
|
+
archive_read_support_format_warc(a);
|
65
|
+
|
66
|
+
/*
|
67
|
+
* Install expensive bidders last. By doing them last, we
|
68
|
+
* increase the chance that a high bid from someone else will
|
69
|
+
* make it unnecessary for these to do anything at all.
|
70
|
+
*/
|
71
|
+
/* These three have potentially large look-ahead. */
|
72
|
+
archive_read_support_format_7zip(a);
|
73
|
+
archive_read_support_format_cab(a);
|
74
|
+
archive_read_support_format_rar(a);
|
75
|
+
archive_read_support_format_rar5(a);
|
76
|
+
archive_read_support_format_iso9660(a);
|
77
|
+
/* Seek is really bad, since it forces the read-ahead
|
78
|
+
* logic to discard buffered data. */
|
79
|
+
archive_read_support_format_zip(a);
|
80
|
+
|
81
|
+
/* Note: We always return ARCHIVE_OK here, even if some of the
|
82
|
+
* above return ARCHIVE_WARN. The intent here is to enable
|
83
|
+
* "as much as possible." Clients who need specific
|
84
|
+
* compression should enable those individually so they can
|
85
|
+
* verify the level of support. */
|
86
|
+
/* Clear any warning messages set by the above functions. */
|
87
|
+
archive_clear_error(a);
|
88
|
+
return (ARCHIVE_OK);
|
89
|
+
}
|
@@ -50,11 +50,17 @@ __FBSDID("$FreeBSD: head/lib/libarchive/archive_read_support_format_ar.c 201101
|
|
50
50
|
#include "archive_read_private.h"
|
51
51
|
|
52
52
|
struct ar {
|
53
|
-
|
54
|
-
|
55
|
-
|
53
|
+
int64_t entry_bytes_remaining;
|
54
|
+
/* unconsumed is purely to track data we've gotten from readahead,
|
55
|
+
* but haven't yet marked as consumed. Must be paired with
|
56
|
+
* entry_bytes_remaining usage/modification.
|
57
|
+
*/
|
58
|
+
size_t entry_bytes_unconsumed;
|
59
|
+
int64_t entry_offset;
|
60
|
+
int64_t entry_padding;
|
56
61
|
char *strtab;
|
57
62
|
size_t strtab_size;
|
63
|
+
char read_global_header;
|
58
64
|
};
|
59
65
|
|
60
66
|
/*
|
@@ -75,10 +81,10 @@ struct ar {
|
|
75
81
|
#define AR_fmag_offset 58
|
76
82
|
#define AR_fmag_size 2
|
77
83
|
|
78
|
-
static int archive_read_format_ar_bid(struct archive_read *a);
|
84
|
+
static int archive_read_format_ar_bid(struct archive_read *a, int);
|
79
85
|
static int archive_read_format_ar_cleanup(struct archive_read *a);
|
80
86
|
static int archive_read_format_ar_read_data(struct archive_read *a,
|
81
|
-
const void **buff, size_t *size,
|
87
|
+
const void **buff, size_t *size, int64_t *offset);
|
82
88
|
static int archive_read_format_ar_skip(struct archive_read *a);
|
83
89
|
static int archive_read_format_ar_read_header(struct archive_read *a,
|
84
90
|
struct archive_entry *e);
|
@@ -95,13 +101,15 @@ archive_read_support_format_ar(struct archive *_a)
|
|
95
101
|
struct ar *ar;
|
96
102
|
int r;
|
97
103
|
|
98
|
-
|
104
|
+
archive_check_magic(_a, ARCHIVE_READ_MAGIC,
|
105
|
+
ARCHIVE_STATE_NEW, "archive_read_support_format_ar");
|
106
|
+
|
107
|
+
ar = (struct ar *)calloc(1, sizeof(*ar));
|
99
108
|
if (ar == NULL) {
|
100
109
|
archive_set_error(&a->archive, ENOMEM,
|
101
110
|
"Can't allocate ar data");
|
102
111
|
return (ARCHIVE_FATAL);
|
103
112
|
}
|
104
|
-
memset(ar, 0, sizeof(*ar));
|
105
113
|
ar->strtab = NULL;
|
106
114
|
|
107
115
|
r = __archive_read_register_format(a,
|
@@ -112,7 +120,10 @@ archive_read_support_format_ar(struct archive *_a)
|
|
112
120
|
archive_read_format_ar_read_header,
|
113
121
|
archive_read_format_ar_read_data,
|
114
122
|
archive_read_format_ar_skip,
|
115
|
-
|
123
|
+
NULL,
|
124
|
+
archive_read_format_ar_cleanup,
|
125
|
+
NULL,
|
126
|
+
NULL);
|
116
127
|
|
117
128
|
if (r != ARCHIVE_OK) {
|
118
129
|
free(ar);
|
@@ -127,22 +138,18 @@ archive_read_format_ar_cleanup(struct archive_read *a)
|
|
127
138
|
struct ar *ar;
|
128
139
|
|
129
140
|
ar = (struct ar *)(a->format->data);
|
130
|
-
|
131
|
-
free(ar->strtab);
|
141
|
+
free(ar->strtab);
|
132
142
|
free(ar);
|
133
143
|
(a->format->data) = NULL;
|
134
144
|
return (ARCHIVE_OK);
|
135
145
|
}
|
136
146
|
|
137
147
|
static int
|
138
|
-
archive_read_format_ar_bid(struct archive_read *a)
|
148
|
+
archive_read_format_ar_bid(struct archive_read *a, int best_bid)
|
139
149
|
{
|
140
150
|
const void *h;
|
141
151
|
|
142
|
-
|
143
|
-
(a->archive.archive_format & ARCHIVE_FORMAT_BASE_MASK) !=
|
144
|
-
ARCHIVE_FORMAT_AR)
|
145
|
-
return(0);
|
152
|
+
(void)best_bid; /* UNUSED */
|
146
153
|
|
147
154
|
/*
|
148
155
|
* Verify the 8-byte file signature.
|
@@ -150,50 +157,28 @@ archive_read_format_ar_bid(struct archive_read *a)
|
|
150
157
|
*/
|
151
158
|
if ((h = __archive_read_ahead(a, 8, NULL)) == NULL)
|
152
159
|
return (-1);
|
153
|
-
if (
|
160
|
+
if (memcmp(h, "!<arch>\n", 8) == 0) {
|
154
161
|
return (64);
|
155
162
|
}
|
156
163
|
return (-1);
|
157
164
|
}
|
158
165
|
|
159
166
|
static int
|
160
|
-
|
161
|
-
|
167
|
+
_ar_read_header(struct archive_read *a, struct archive_entry *entry,
|
168
|
+
struct ar *ar, const char *h, size_t *unconsumed)
|
162
169
|
{
|
163
170
|
char filename[AR_name_size + 1];
|
164
|
-
struct ar *ar;
|
165
171
|
uint64_t number; /* Used to hold parsed numbers before validation. */
|
166
|
-
ssize_t bytes_read;
|
167
172
|
size_t bsd_name_length, entry_size;
|
168
173
|
char *p, *st;
|
169
174
|
const void *b;
|
170
|
-
const char *h;
|
171
175
|
int r;
|
172
176
|
|
173
|
-
ar = (struct ar*)(a->format->data);
|
174
|
-
|
175
|
-
if (a->archive.file_position == 0) {
|
176
|
-
/*
|
177
|
-
* We are now at the beginning of the archive,
|
178
|
-
* so we need first consume the ar global header.
|
179
|
-
*/
|
180
|
-
__archive_read_consume(a, 8);
|
181
|
-
/* Set a default format code for now. */
|
182
|
-
a->archive.archive_format = ARCHIVE_FORMAT_AR;
|
183
|
-
}
|
184
|
-
|
185
|
-
/* Read the header for the next file entry. */
|
186
|
-
if ((b = __archive_read_ahead(a, 60, &bytes_read)) == NULL)
|
187
|
-
/* Broken header. */
|
188
|
-
return (ARCHIVE_EOF);
|
189
|
-
__archive_read_consume(a, 60);
|
190
|
-
h = (const char *)b;
|
191
|
-
|
192
177
|
/* Verify the magic signature on the file header. */
|
193
178
|
if (strncmp(h + AR_fmag_offset, "`\n", 2) != 0) {
|
194
179
|
archive_set_error(&a->archive, EINVAL,
|
195
180
|
"Incorrect file header signature");
|
196
|
-
return (
|
181
|
+
return (ARCHIVE_FATAL);
|
197
182
|
}
|
198
183
|
|
199
184
|
/* Copy filename into work buffer. */
|
@@ -252,8 +237,15 @@ archive_read_format_ar_read_header(struct archive_read *a,
|
|
252
237
|
* and are not terminated in '/', so we don't trim anything
|
253
238
|
* that starts with '/'.)
|
254
239
|
*/
|
255
|
-
if (filename[0] != '/' && *p == '/')
|
240
|
+
if (filename[0] != '/' && p > filename && *p == '/') {
|
256
241
|
*p = '\0';
|
242
|
+
}
|
243
|
+
|
244
|
+
if (p < filename) {
|
245
|
+
archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
|
246
|
+
"Found entry with empty filename");
|
247
|
+
return (ARCHIVE_FATAL);
|
248
|
+
}
|
257
249
|
|
258
250
|
/*
|
259
251
|
* '//' is the GNU filename table.
|
@@ -266,7 +258,7 @@ archive_read_format_ar_read_header(struct archive_read *a,
|
|
266
258
|
archive_entry_set_filetype(entry, AE_IFREG);
|
267
259
|
/* Get the size of the filename table. */
|
268
260
|
number = ar_atol10(h + AR_size_offset, AR_size_size);
|
269
|
-
if (number > SIZE_MAX) {
|
261
|
+
if (number > SIZE_MAX || number > 1024 * 1024 * 1024) {
|
270
262
|
archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
|
271
263
|
"Filename table too large");
|
272
264
|
return (ARCHIVE_FATAL);
|
@@ -275,12 +267,12 @@ archive_read_format_ar_read_header(struct archive_read *a,
|
|
275
267
|
if (entry_size == 0) {
|
276
268
|
archive_set_error(&a->archive, EINVAL,
|
277
269
|
"Invalid string table");
|
278
|
-
return (
|
270
|
+
return (ARCHIVE_FATAL);
|
279
271
|
}
|
280
272
|
if (ar->strtab != NULL) {
|
281
273
|
archive_set_error(&a->archive, EINVAL,
|
282
274
|
"More than one string tables exist");
|
283
|
-
return (
|
275
|
+
return (ARCHIVE_FATAL);
|
284
276
|
}
|
285
277
|
|
286
278
|
/* Read the filename table into memory. */
|
@@ -292,6 +284,12 @@ archive_read_format_ar_read_header(struct archive_read *a,
|
|
292
284
|
}
|
293
285
|
ar->strtab = st;
|
294
286
|
ar->strtab_size = entry_size;
|
287
|
+
|
288
|
+
if (*unconsumed) {
|
289
|
+
__archive_read_consume(a, *unconsumed);
|
290
|
+
*unconsumed = 0;
|
291
|
+
}
|
292
|
+
|
295
293
|
if ((b = __archive_read_ahead(a, entry_size, NULL)) == NULL)
|
296
294
|
return (ARCHIVE_FATAL);
|
297
295
|
memcpy(st, b, entry_size);
|
@@ -316,13 +314,13 @@ archive_read_format_ar_read_header(struct archive_read *a,
|
|
316
314
|
* If we can't look up the real name, warn and return
|
317
315
|
* the entry with the wrong name.
|
318
316
|
*/
|
319
|
-
if (ar->strtab == NULL || number
|
317
|
+
if (ar->strtab == NULL || number >= ar->strtab_size) {
|
320
318
|
archive_set_error(&a->archive, EINVAL,
|
321
|
-
"Can't find long filename for entry");
|
319
|
+
"Can't find long filename for GNU/SVR4 archive entry");
|
322
320
|
archive_entry_copy_pathname(entry, filename);
|
323
321
|
/* Parse the time, owner, mode, size fields. */
|
324
322
|
ar_parse_common_header(ar, entry, h);
|
325
|
-
return (
|
323
|
+
return (ARCHIVE_FATAL);
|
326
324
|
}
|
327
325
|
|
328
326
|
archive_entry_copy_pathname(entry, &ar->strtab[(size_t)number]);
|
@@ -342,28 +340,34 @@ archive_read_format_ar_read_header(struct archive_read *a,
|
|
342
340
|
|
343
341
|
/* Parse the size of the name, adjust the file size. */
|
344
342
|
number = ar_atol10(h + AR_name_offset + 3, AR_name_size - 3);
|
345
|
-
|
346
|
-
|
347
|
-
*
|
348
|
-
*
|
349
|
-
|
350
|
-
|
343
|
+
/* Sanity check the filename length:
|
344
|
+
* = Must be <= SIZE_MAX - 1
|
345
|
+
* = Must be <= 1MB
|
346
|
+
* = Cannot be bigger than the entire entry
|
347
|
+
*/
|
348
|
+
if (number > SIZE_MAX - 1
|
349
|
+
|| number > 1024 * 1024
|
350
|
+
|| (int64_t)number > ar->entry_bytes_remaining) {
|
351
351
|
archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
|
352
352
|
"Bad input file size");
|
353
353
|
return (ARCHIVE_FATAL);
|
354
354
|
}
|
355
|
+
bsd_name_length = (size_t)number;
|
355
356
|
ar->entry_bytes_remaining -= bsd_name_length;
|
356
357
|
/* Adjust file size reported to client. */
|
357
358
|
archive_entry_set_size(entry, ar->entry_bytes_remaining);
|
358
359
|
|
360
|
+
if (*unconsumed) {
|
361
|
+
__archive_read_consume(a, *unconsumed);
|
362
|
+
*unconsumed = 0;
|
363
|
+
}
|
364
|
+
|
359
365
|
/* Read the long name into memory. */
|
360
366
|
if ((b = __archive_read_ahead(a, bsd_name_length, NULL)) == NULL) {
|
361
367
|
archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
|
362
368
|
"Truncated input file");
|
363
369
|
return (ARCHIVE_FATAL);
|
364
370
|
}
|
365
|
-
__archive_read_consume(a, bsd_name_length);
|
366
|
-
|
367
371
|
/* Store it in the entry. */
|
368
372
|
p = (char *)malloc(bsd_name_length + 1);
|
369
373
|
if (p == NULL) {
|
@@ -373,6 +377,9 @@ archive_read_format_ar_read_header(struct archive_read *a,
|
|
373
377
|
}
|
374
378
|
strncpy(p, b, bsd_name_length);
|
375
379
|
p[bsd_name_length] = '\0';
|
380
|
+
|
381
|
+
__archive_read_consume(a, bsd_name_length);
|
382
|
+
|
376
383
|
archive_entry_copy_pathname(entry, p);
|
377
384
|
free(p);
|
378
385
|
return (ARCHIVE_OK);
|
@@ -380,9 +387,10 @@ archive_read_format_ar_read_header(struct archive_read *a,
|
|
380
387
|
|
381
388
|
/*
|
382
389
|
* "/" is the SVR4/GNU archive symbol table.
|
390
|
+
* "/SYM64/" is the SVR4/GNU 64-bit variant archive symbol table.
|
383
391
|
*/
|
384
|
-
if (strcmp(filename, "/") == 0) {
|
385
|
-
archive_entry_copy_pathname(entry,
|
392
|
+
if (strcmp(filename, "/") == 0 || strcmp(filename, "/SYM64/") == 0) {
|
393
|
+
archive_entry_copy_pathname(entry, filename);
|
386
394
|
/* Parse the time, owner, mode, size fields. */
|
387
395
|
r = ar_parse_common_header(ar, entry, h);
|
388
396
|
/* Force the file type to a regular file. */
|
@@ -408,6 +416,42 @@ archive_read_format_ar_read_header(struct archive_read *a,
|
|
408
416
|
return (ar_parse_common_header(ar, entry, h));
|
409
417
|
}
|
410
418
|
|
419
|
+
static int
|
420
|
+
archive_read_format_ar_read_header(struct archive_read *a,
|
421
|
+
struct archive_entry *entry)
|
422
|
+
{
|
423
|
+
struct ar *ar = (struct ar*)(a->format->data);
|
424
|
+
size_t unconsumed;
|
425
|
+
const void *header_data;
|
426
|
+
int ret;
|
427
|
+
|
428
|
+
if (!ar->read_global_header) {
|
429
|
+
/*
|
430
|
+
* We are now at the beginning of the archive,
|
431
|
+
* so we need first consume the ar global header.
|
432
|
+
*/
|
433
|
+
__archive_read_consume(a, 8);
|
434
|
+
ar->read_global_header = 1;
|
435
|
+
/* Set a default format code for now. */
|
436
|
+
a->archive.archive_format = ARCHIVE_FORMAT_AR;
|
437
|
+
}
|
438
|
+
|
439
|
+
/* Read the header for the next file entry. */
|
440
|
+
if ((header_data = __archive_read_ahead(a, 60, NULL)) == NULL)
|
441
|
+
/* Broken header. */
|
442
|
+
return (ARCHIVE_EOF);
|
443
|
+
|
444
|
+
unconsumed = 60;
|
445
|
+
|
446
|
+
ret = _ar_read_header(a, entry, ar, (const char *)header_data, &unconsumed);
|
447
|
+
|
448
|
+
if (unconsumed)
|
449
|
+
__archive_read_consume(a, unconsumed);
|
450
|
+
|
451
|
+
return ret;
|
452
|
+
}
|
453
|
+
|
454
|
+
|
411
455
|
static int
|
412
456
|
ar_parse_common_header(struct ar *ar, struct archive_entry *entry,
|
413
457
|
const char *h)
|
@@ -415,6 +459,7 @@ ar_parse_common_header(struct ar *ar, struct archive_entry *entry,
|
|
415
459
|
uint64_t n;
|
416
460
|
|
417
461
|
/* Copy remaining header */
|
462
|
+
archive_entry_set_filetype(entry, AE_IFREG);
|
418
463
|
archive_entry_set_mtime(entry,
|
419
464
|
(time_t)ar_atol10(h + AR_date_offset, AR_date_size), 0L);
|
420
465
|
archive_entry_set_uid(entry,
|
@@ -434,13 +479,18 @@ ar_parse_common_header(struct ar *ar, struct archive_entry *entry,
|
|
434
479
|
|
435
480
|
static int
|
436
481
|
archive_read_format_ar_read_data(struct archive_read *a,
|
437
|
-
const void **buff, size_t *size,
|
482
|
+
const void **buff, size_t *size, int64_t *offset)
|
438
483
|
{
|
439
484
|
ssize_t bytes_read;
|
440
485
|
struct ar *ar;
|
441
486
|
|
442
487
|
ar = (struct ar *)(a->format->data);
|
443
488
|
|
489
|
+
if (ar->entry_bytes_unconsumed) {
|
490
|
+
__archive_read_consume(a, ar->entry_bytes_unconsumed);
|
491
|
+
ar->entry_bytes_unconsumed = 0;
|
492
|
+
}
|
493
|
+
|
444
494
|
if (ar->entry_bytes_remaining > 0) {
|
445
495
|
*buff = __archive_read_ahead(a, 1, &bytes_read);
|
446
496
|
if (bytes_read == 0) {
|
@@ -453,20 +503,22 @@ archive_read_format_ar_read_data(struct archive_read *a,
|
|
453
503
|
if (bytes_read > ar->entry_bytes_remaining)
|
454
504
|
bytes_read = (ssize_t)ar->entry_bytes_remaining;
|
455
505
|
*size = bytes_read;
|
506
|
+
ar->entry_bytes_unconsumed = bytes_read;
|
456
507
|
*offset = ar->entry_offset;
|
457
508
|
ar->entry_offset += bytes_read;
|
458
509
|
ar->entry_bytes_remaining -= bytes_read;
|
459
|
-
__archive_read_consume(a, (size_t)bytes_read);
|
460
510
|
return (ARCHIVE_OK);
|
461
511
|
} else {
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
512
|
+
int64_t skipped = __archive_read_consume(a, ar->entry_padding);
|
513
|
+
if (skipped >= 0) {
|
514
|
+
ar->entry_padding -= skipped;
|
515
|
+
}
|
516
|
+
if (ar->entry_padding) {
|
517
|
+
if (skipped >= 0) {
|
518
|
+
archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
|
519
|
+
"Truncated ar archive- failed consuming padding");
|
520
|
+
}
|
521
|
+
return (ARCHIVE_FATAL);
|
470
522
|
}
|
471
523
|
*buff = NULL;
|
472
524
|
*size = 0;
|
@@ -478,17 +530,19 @@ archive_read_format_ar_read_data(struct archive_read *a,
|
|
478
530
|
static int
|
479
531
|
archive_read_format_ar_skip(struct archive_read *a)
|
480
532
|
{
|
481
|
-
|
533
|
+
int64_t bytes_skipped;
|
482
534
|
struct ar* ar;
|
483
535
|
|
484
536
|
ar = (struct ar *)(a->format->data);
|
485
537
|
|
486
|
-
bytes_skipped =
|
487
|
-
ar->entry_bytes_remaining + ar->entry_padding
|
538
|
+
bytes_skipped = __archive_read_consume(a,
|
539
|
+
ar->entry_bytes_remaining + ar->entry_padding
|
540
|
+
+ ar->entry_bytes_unconsumed);
|
488
541
|
if (bytes_skipped < 0)
|
489
542
|
return (ARCHIVE_FATAL);
|
490
543
|
|
491
544
|
ar->entry_bytes_remaining = 0;
|
545
|
+
ar->entry_bytes_unconsumed = 0;
|
492
546
|
ar->entry_padding = 0;
|
493
547
|
|
494
548
|
return (ARCHIVE_OK);
|
@@ -529,7 +583,7 @@ bad_string_table:
|
|
529
583
|
"Invalid string table");
|
530
584
|
free(ar->strtab);
|
531
585
|
ar->strtab = NULL;
|
532
|
-
return (
|
586
|
+
return (ARCHIVE_FATAL);
|
533
587
|
}
|
534
588
|
|
535
589
|
static uint64_t
|
@@ -0,0 +1,92 @@
|
|
1
|
+
/*-
|
2
|
+
* Copyright (c) 2003-2011 Tim Kientzle
|
3
|
+
* All rights reserved.
|
4
|
+
*
|
5
|
+
* Redistribution and use in source and binary forms, with or without
|
6
|
+
* modification, are permitted provided that the following conditions
|
7
|
+
* are met:
|
8
|
+
* 1. Redistributions of source code must retain the above copyright
|
9
|
+
* notice, this list of conditions and the following disclaimer.
|
10
|
+
* 2. Redistributions in binary form must reproduce the above copyright
|
11
|
+
* notice, this list of conditions and the following disclaimer in the
|
12
|
+
* documentation and/or other materials provided with the distribution.
|
13
|
+
*
|
14
|
+
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
|
15
|
+
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
16
|
+
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
17
|
+
* IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
|
18
|
+
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
19
|
+
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
20
|
+
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
21
|
+
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
22
|
+
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
23
|
+
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
24
|
+
*/
|
25
|
+
|
26
|
+
#include "archive_platform.h"
|
27
|
+
__FBSDID("$FreeBSD$");
|
28
|
+
|
29
|
+
#ifdef HAVE_ERRNO_H
|
30
|
+
#include <errno.h>
|
31
|
+
#endif
|
32
|
+
|
33
|
+
#include "archive.h"
|
34
|
+
#include "archive_private.h"
|
35
|
+
|
36
|
+
int
|
37
|
+
archive_read_support_format_by_code(struct archive *a, int format_code)
|
38
|
+
{
|
39
|
+
archive_check_magic(a, ARCHIVE_READ_MAGIC,
|
40
|
+
ARCHIVE_STATE_NEW, "archive_read_support_format_by_code");
|
41
|
+
|
42
|
+
switch (format_code & ARCHIVE_FORMAT_BASE_MASK) {
|
43
|
+
case ARCHIVE_FORMAT_7ZIP:
|
44
|
+
return archive_read_support_format_7zip(a);
|
45
|
+
break;
|
46
|
+
case ARCHIVE_FORMAT_AR:
|
47
|
+
return archive_read_support_format_ar(a);
|
48
|
+
break;
|
49
|
+
case ARCHIVE_FORMAT_CAB:
|
50
|
+
return archive_read_support_format_cab(a);
|
51
|
+
break;
|
52
|
+
case ARCHIVE_FORMAT_CPIO:
|
53
|
+
return archive_read_support_format_cpio(a);
|
54
|
+
break;
|
55
|
+
case ARCHIVE_FORMAT_EMPTY:
|
56
|
+
return archive_read_support_format_empty(a);
|
57
|
+
break;
|
58
|
+
case ARCHIVE_FORMAT_ISO9660:
|
59
|
+
return archive_read_support_format_iso9660(a);
|
60
|
+
break;
|
61
|
+
case ARCHIVE_FORMAT_LHA:
|
62
|
+
return archive_read_support_format_lha(a);
|
63
|
+
break;
|
64
|
+
case ARCHIVE_FORMAT_MTREE:
|
65
|
+
return archive_read_support_format_mtree(a);
|
66
|
+
break;
|
67
|
+
case ARCHIVE_FORMAT_RAR:
|
68
|
+
return archive_read_support_format_rar(a);
|
69
|
+
break;
|
70
|
+
case ARCHIVE_FORMAT_RAR_V5:
|
71
|
+
return archive_read_support_format_rar5(a);
|
72
|
+
break;
|
73
|
+
case ARCHIVE_FORMAT_RAW:
|
74
|
+
return archive_read_support_format_raw(a);
|
75
|
+
break;
|
76
|
+
case ARCHIVE_FORMAT_TAR:
|
77
|
+
return archive_read_support_format_tar(a);
|
78
|
+
break;
|
79
|
+
case ARCHIVE_FORMAT_WARC:
|
80
|
+
return archive_read_support_format_warc(a);
|
81
|
+
break;
|
82
|
+
case ARCHIVE_FORMAT_XAR:
|
83
|
+
return archive_read_support_format_xar(a);
|
84
|
+
break;
|
85
|
+
case ARCHIVE_FORMAT_ZIP:
|
86
|
+
return archive_read_support_format_zip(a);
|
87
|
+
break;
|
88
|
+
}
|
89
|
+
archive_set_error(a, ARCHIVE_ERRNO_PROGRAMMER,
|
90
|
+
"Invalid format code specified");
|
91
|
+
return (ARCHIVE_FATAL);
|
92
|
+
}
|