libarchive-static 1.0.6 → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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
@@ -1,5 +1,6 @@
|
|
1
1
|
/*-
|
2
2
|
* Copyright (c) 2003-2007 Tim Kientzle
|
3
|
+
* Copyright (c) 2011-2012 Michihiro NAKAJIMA
|
3
4
|
* All rights reserved.
|
4
5
|
*
|
5
6
|
* Redistribution and use in source and binary forms, with or without
|
@@ -40,12 +41,18 @@ __FBSDID("$FreeBSD: head/lib/libarchive/archive_write_set_format_ustar.c 191579
|
|
40
41
|
|
41
42
|
#include "archive.h"
|
42
43
|
#include "archive_entry.h"
|
44
|
+
#include "archive_entry_locale.h"
|
43
45
|
#include "archive_private.h"
|
44
46
|
#include "archive_write_private.h"
|
47
|
+
#include "archive_write_set_format_private.h"
|
45
48
|
|
46
49
|
struct ustar {
|
47
50
|
uint64_t entry_bytes_remaining;
|
48
51
|
uint64_t entry_padding;
|
52
|
+
|
53
|
+
struct archive_string_conv *opt_sconv;
|
54
|
+
struct archive_string_conv *sconv_default;
|
55
|
+
int init_default_conversion;
|
49
56
|
};
|
50
57
|
|
51
58
|
/*
|
@@ -108,9 +115,9 @@ static const char template_header[] = {
|
|
108
115
|
'0','0','0','0','0','0', ' ','\0',
|
109
116
|
/* gid, space-null termination: 8 bytes */
|
110
117
|
'0','0','0','0','0','0', ' ','\0',
|
111
|
-
/* size, space
|
118
|
+
/* size, space termination: 12 bytes */
|
112
119
|
'0','0','0','0','0','0','0','0','0','0','0', ' ',
|
113
|
-
/* mtime, space
|
120
|
+
/* mtime, space termination: 12 bytes */
|
114
121
|
'0','0','0','0','0','0','0','0','0','0','0', ' ',
|
115
122
|
/* Initial checksum value: 8 spaces */
|
116
123
|
' ',' ',' ',' ',' ',' ',' ',' ',
|
@@ -143,15 +150,16 @@ static const char template_header[] = {
|
|
143
150
|
|
144
151
|
static ssize_t archive_write_ustar_data(struct archive_write *a, const void *buff,
|
145
152
|
size_t s);
|
146
|
-
static int
|
147
|
-
static int
|
153
|
+
static int archive_write_ustar_free(struct archive_write *);
|
154
|
+
static int archive_write_ustar_close(struct archive_write *);
|
148
155
|
static int archive_write_ustar_finish_entry(struct archive_write *);
|
149
156
|
static int archive_write_ustar_header(struct archive_write *,
|
150
157
|
struct archive_entry *entry);
|
158
|
+
static int archive_write_ustar_options(struct archive_write *,
|
159
|
+
const char *, const char *);
|
151
160
|
static int format_256(int64_t, char *, int);
|
152
161
|
static int format_number(int64_t, char *, int size, int max, int strict);
|
153
162
|
static int format_octal(int64_t, char *, int);
|
154
|
-
static int write_nulls(struct archive_write *a, size_t);
|
155
163
|
|
156
164
|
/*
|
157
165
|
* Set output format to 'ustar' format.
|
@@ -162,45 +170,98 @@ archive_write_set_format_ustar(struct archive *_a)
|
|
162
170
|
struct archive_write *a = (struct archive_write *)_a;
|
163
171
|
struct ustar *ustar;
|
164
172
|
|
173
|
+
archive_check_magic(_a, ARCHIVE_WRITE_MAGIC,
|
174
|
+
ARCHIVE_STATE_NEW, "archive_write_set_format_ustar");
|
175
|
+
|
165
176
|
/* If someone else was already registered, unregister them. */
|
166
|
-
if (a->
|
167
|
-
(a->
|
177
|
+
if (a->format_free != NULL)
|
178
|
+
(a->format_free)(a);
|
168
179
|
|
169
180
|
/* Basic internal sanity test. */
|
170
181
|
if (sizeof(template_header) != 512) {
|
171
|
-
archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
|
182
|
+
archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
|
183
|
+
"Internal: template_header wrong size: %zu should be 512",
|
184
|
+
sizeof(template_header));
|
172
185
|
return (ARCHIVE_FATAL);
|
173
186
|
}
|
174
187
|
|
175
|
-
ustar = (struct ustar *)
|
188
|
+
ustar = (struct ustar *)calloc(1, sizeof(*ustar));
|
176
189
|
if (ustar == NULL) {
|
177
|
-
archive_set_error(&a->archive, ENOMEM,
|
190
|
+
archive_set_error(&a->archive, ENOMEM,
|
191
|
+
"Can't allocate ustar data");
|
178
192
|
return (ARCHIVE_FATAL);
|
179
193
|
}
|
180
|
-
memset(ustar, 0, sizeof(*ustar));
|
181
194
|
a->format_data = ustar;
|
182
|
-
|
183
|
-
a->pad_uncompressed = 1; /* Mimic gtar in this respect. */
|
184
195
|
a->format_name = "ustar";
|
196
|
+
a->format_options = archive_write_ustar_options;
|
185
197
|
a->format_write_header = archive_write_ustar_header;
|
186
198
|
a->format_write_data = archive_write_ustar_data;
|
187
|
-
a->
|
188
|
-
a->
|
199
|
+
a->format_close = archive_write_ustar_close;
|
200
|
+
a->format_free = archive_write_ustar_free;
|
189
201
|
a->format_finish_entry = archive_write_ustar_finish_entry;
|
190
202
|
a->archive.archive_format = ARCHIVE_FORMAT_TAR_USTAR;
|
191
203
|
a->archive.archive_format_name = "POSIX ustar";
|
192
204
|
return (ARCHIVE_OK);
|
193
205
|
}
|
194
206
|
|
207
|
+
static int
|
208
|
+
archive_write_ustar_options(struct archive_write *a, const char *key,
|
209
|
+
const char *val)
|
210
|
+
{
|
211
|
+
struct ustar *ustar = (struct ustar *)a->format_data;
|
212
|
+
int ret = ARCHIVE_FAILED;
|
213
|
+
|
214
|
+
if (strcmp(key, "hdrcharset") == 0) {
|
215
|
+
if (val == NULL || val[0] == 0)
|
216
|
+
archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
|
217
|
+
"%s: hdrcharset option needs a character-set name",
|
218
|
+
a->format_name);
|
219
|
+
else {
|
220
|
+
ustar->opt_sconv = archive_string_conversion_to_charset(
|
221
|
+
&a->archive, val, 0);
|
222
|
+
if (ustar->opt_sconv != NULL)
|
223
|
+
ret = ARCHIVE_OK;
|
224
|
+
else
|
225
|
+
ret = ARCHIVE_FATAL;
|
226
|
+
}
|
227
|
+
return (ret);
|
228
|
+
}
|
229
|
+
|
230
|
+
/* Note: The "warn" return is just to inform the options
|
231
|
+
* supervisor that we didn't handle it. It will generate
|
232
|
+
* a suitable error if no one used this option. */
|
233
|
+
return (ARCHIVE_WARN);
|
234
|
+
}
|
235
|
+
|
195
236
|
static int
|
196
237
|
archive_write_ustar_header(struct archive_write *a, struct archive_entry *entry)
|
197
238
|
{
|
198
239
|
char buff[512];
|
199
240
|
int ret, ret2;
|
200
241
|
struct ustar *ustar;
|
242
|
+
struct archive_entry *entry_main;
|
243
|
+
struct archive_string_conv *sconv;
|
201
244
|
|
202
245
|
ustar = (struct ustar *)a->format_data;
|
203
246
|
|
247
|
+
/* Setup default string conversion. */
|
248
|
+
if (ustar->opt_sconv == NULL) {
|
249
|
+
if (!ustar->init_default_conversion) {
|
250
|
+
ustar->sconv_default =
|
251
|
+
archive_string_default_conversion_for_write(&(a->archive));
|
252
|
+
ustar->init_default_conversion = 1;
|
253
|
+
}
|
254
|
+
sconv = ustar->sconv_default;
|
255
|
+
} else
|
256
|
+
sconv = ustar->opt_sconv;
|
257
|
+
|
258
|
+
/* Sanity check. */
|
259
|
+
if (archive_entry_pathname(entry) == NULL) {
|
260
|
+
archive_set_error(&a->archive, ARCHIVE_ERRNO_MISC,
|
261
|
+
"Can't record entry in tar file without pathname");
|
262
|
+
return (ARCHIVE_FAILED);
|
263
|
+
}
|
264
|
+
|
204
265
|
/* Only regular files (not hardlinks) have data. */
|
205
266
|
if (archive_entry_hardlink(entry) != NULL ||
|
206
267
|
archive_entry_symlink(entry) != NULL ||
|
@@ -209,37 +270,103 @@ archive_write_ustar_header(struct archive_write *a, struct archive_entry *entry)
|
|
209
270
|
|
210
271
|
if (AE_IFDIR == archive_entry_filetype(entry)) {
|
211
272
|
const char *p;
|
212
|
-
|
273
|
+
size_t path_length;
|
213
274
|
/*
|
214
275
|
* Ensure a trailing '/'. Modify the entry so
|
215
276
|
* the client sees the change.
|
216
277
|
*/
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
278
|
+
#if defined(_WIN32) && !defined(__CYGWIN__)
|
279
|
+
const wchar_t *wp;
|
280
|
+
|
281
|
+
wp = archive_entry_pathname_w(entry);
|
282
|
+
if (wp != NULL && wp[wcslen(wp) -1] != L'/') {
|
283
|
+
struct archive_wstring ws;
|
284
|
+
|
285
|
+
archive_string_init(&ws);
|
286
|
+
path_length = wcslen(wp);
|
287
|
+
if (archive_wstring_ensure(&ws,
|
288
|
+
path_length + 2) == NULL) {
|
289
|
+
archive_set_error(&a->archive, ENOMEM,
|
290
|
+
"Can't allocate ustar data");
|
291
|
+
archive_wstring_free(&ws);
|
292
|
+
return(ARCHIVE_FATAL);
|
293
|
+
}
|
294
|
+
/* Should we keep '\' ? */
|
295
|
+
if (wp[path_length -1] == L'\\')
|
296
|
+
path_length--;
|
297
|
+
archive_wstrncpy(&ws, wp, path_length);
|
298
|
+
archive_wstrappend_wchar(&ws, L'/');
|
299
|
+
archive_entry_copy_pathname_w(entry, ws.s);
|
300
|
+
archive_wstring_free(&ws);
|
301
|
+
p = NULL;
|
302
|
+
} else
|
303
|
+
#endif
|
304
|
+
p = archive_entry_pathname(entry);
|
305
|
+
/*
|
306
|
+
* On Windows, this is a backup operation just in
|
307
|
+
* case getting WCS failed. On POSIX, this is a
|
308
|
+
* normal operation.
|
309
|
+
*/
|
310
|
+
if (p != NULL && p[0] != '\0' && p[strlen(p) - 1] != '/') {
|
311
|
+
struct archive_string as;
|
312
|
+
|
313
|
+
archive_string_init(&as);
|
314
|
+
path_length = strlen(p);
|
315
|
+
if (archive_string_ensure(&as,
|
316
|
+
path_length + 2) == NULL) {
|
221
317
|
archive_set_error(&a->archive, ENOMEM,
|
222
|
-
|
318
|
+
"Can't allocate ustar data");
|
319
|
+
archive_string_free(&as);
|
223
320
|
return(ARCHIVE_FATAL);
|
224
321
|
}
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
322
|
+
#if defined(_WIN32) && !defined(__CYGWIN__)
|
323
|
+
/* NOTE: This might break the pathname
|
324
|
+
* if the current code page is CP932 and
|
325
|
+
* the pathname includes a character '\'
|
326
|
+
* as a part of its multibyte pathname. */
|
327
|
+
if (p[strlen(p) -1] == '\\')
|
328
|
+
path_length--;
|
329
|
+
else
|
330
|
+
#endif
|
331
|
+
archive_strncpy(&as, p, path_length);
|
332
|
+
archive_strappend_char(&as, '/');
|
333
|
+
archive_entry_copy_pathname(entry, as.s);
|
334
|
+
archive_string_free(&as);
|
229
335
|
}
|
230
336
|
}
|
231
337
|
|
232
|
-
|
233
|
-
|
338
|
+
#if defined(_WIN32) && !defined(__CYGWIN__)
|
339
|
+
/* Make sure the path separators in pathname, hardlink and symlink
|
340
|
+
* are all slash '/', not the Windows path separator '\'. */
|
341
|
+
entry_main = __la_win_entry_in_posix_pathseparator(entry);
|
342
|
+
if (entry_main == NULL) {
|
343
|
+
archive_set_error(&a->archive, ENOMEM,
|
344
|
+
"Can't allocate ustar data");
|
345
|
+
return(ARCHIVE_FATAL);
|
346
|
+
}
|
347
|
+
if (entry != entry_main)
|
348
|
+
entry = entry_main;
|
349
|
+
else
|
350
|
+
entry_main = NULL;
|
351
|
+
#else
|
352
|
+
entry_main = NULL;
|
353
|
+
#endif
|
354
|
+
ret = __archive_write_format_header_ustar(a, buff, entry, -1, 1, sconv);
|
355
|
+
if (ret < ARCHIVE_WARN) {
|
356
|
+
archive_entry_free(entry_main);
|
234
357
|
return (ret);
|
235
|
-
|
236
|
-
|
358
|
+
}
|
359
|
+
ret2 = __archive_write_output(a, buff, 512);
|
360
|
+
if (ret2 < ARCHIVE_WARN) {
|
361
|
+
archive_entry_free(entry_main);
|
237
362
|
return (ret2);
|
363
|
+
}
|
238
364
|
if (ret2 < ret)
|
239
365
|
ret = ret2;
|
240
366
|
|
241
367
|
ustar->entry_bytes_remaining = archive_entry_size(entry);
|
242
368
|
ustar->entry_padding = 0x1ff & (-(int64_t)ustar->entry_bytes_remaining);
|
369
|
+
archive_entry_free(entry_main);
|
243
370
|
return (ret);
|
244
371
|
}
|
245
372
|
|
@@ -255,10 +382,11 @@ archive_write_ustar_header(struct archive_write *a, struct archive_entry *entry)
|
|
255
382
|
*/
|
256
383
|
int
|
257
384
|
__archive_write_format_header_ustar(struct archive_write *a, char h[512],
|
258
|
-
struct archive_entry *entry, int tartype, int strict
|
385
|
+
struct archive_entry *entry, int tartype, int strict,
|
386
|
+
struct archive_string_conv *sconv)
|
259
387
|
{
|
260
388
|
unsigned int checksum;
|
261
|
-
int i, ret;
|
389
|
+
int i, r, ret;
|
262
390
|
size_t copy_length;
|
263
391
|
const char *p, *pp;
|
264
392
|
int mytartype;
|
@@ -277,13 +405,23 @@ __archive_write_format_header_ustar(struct archive_write *a, char h[512],
|
|
277
405
|
* are allowed to exactly fill their destination (without null),
|
278
406
|
* I use memcpy(dest, src, strlen()) here a lot to copy strings.
|
279
407
|
*/
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
408
|
+
r = archive_entry_pathname_l(entry, &pp, ©_length, sconv);
|
409
|
+
if (r != 0) {
|
410
|
+
if (errno == ENOMEM) {
|
411
|
+
archive_set_error(&a->archive, ENOMEM,
|
412
|
+
"Can't allocate memory for Pathname");
|
413
|
+
return (ARCHIVE_FATAL);
|
414
|
+
}
|
415
|
+
archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT,
|
416
|
+
"Can't translate pathname '%s' to %s",
|
417
|
+
pp, archive_string_conversion_charset_name(sconv));
|
418
|
+
ret = ARCHIVE_WARN;
|
419
|
+
}
|
420
|
+
if (copy_length <= USTAR_name_size)
|
421
|
+
memcpy(h + USTAR_name_offset, pp, copy_length);
|
284
422
|
else {
|
285
423
|
/* Store in two pieces, splitting at a '/'. */
|
286
|
-
p = strchr(pp +
|
424
|
+
p = strchr(pp + copy_length - USTAR_name_size - 1, '/');
|
287
425
|
/*
|
288
426
|
* Look for the next '/' if we chose the first character
|
289
427
|
* as the separator. (ustar format doesn't permit
|
@@ -302,7 +440,7 @@ __archive_write_format_header_ustar(struct archive_write *a, char h[512],
|
|
302
440
|
* The only feasible separator is a final '/';
|
303
441
|
* this would result in a non-empty prefix and
|
304
442
|
* an empty name, which POSIX doesn't
|
305
|
-
*
|
443
|
+
* explicitly forbid, but it just feels wrong.
|
306
444
|
*/
|
307
445
|
archive_set_error(&a->archive, ENAMETOOLONG,
|
308
446
|
"Pathname too long");
|
@@ -315,17 +453,42 @@ __archive_write_format_header_ustar(struct archive_write *a, char h[512],
|
|
315
453
|
} else {
|
316
454
|
/* Copy prefix and remainder to appropriate places */
|
317
455
|
memcpy(h + USTAR_prefix_offset, pp, p - pp);
|
318
|
-
memcpy(h + USTAR_name_offset, p + 1,
|
456
|
+
memcpy(h + USTAR_name_offset, p + 1,
|
457
|
+
pp + copy_length - p - 1);
|
319
458
|
}
|
320
459
|
}
|
321
460
|
|
322
|
-
|
323
|
-
if (
|
461
|
+
r = archive_entry_hardlink_l(entry, &p, ©_length, sconv);
|
462
|
+
if (r != 0) {
|
463
|
+
if (errno == ENOMEM) {
|
464
|
+
archive_set_error(&a->archive, ENOMEM,
|
465
|
+
"Can't allocate memory for Linkname");
|
466
|
+
return (ARCHIVE_FATAL);
|
467
|
+
}
|
468
|
+
archive_set_error(&a->archive,
|
469
|
+
ARCHIVE_ERRNO_FILE_FORMAT,
|
470
|
+
"Can't translate linkname '%s' to %s",
|
471
|
+
p, archive_string_conversion_charset_name(sconv));
|
472
|
+
ret = ARCHIVE_WARN;
|
473
|
+
}
|
474
|
+
if (copy_length > 0)
|
324
475
|
mytartype = '1';
|
325
|
-
else
|
326
|
-
|
327
|
-
|
328
|
-
|
476
|
+
else {
|
477
|
+
r = archive_entry_symlink_l(entry, &p, ©_length, sconv);
|
478
|
+
if (r != 0) {
|
479
|
+
if (errno == ENOMEM) {
|
480
|
+
archive_set_error(&a->archive, ENOMEM,
|
481
|
+
"Can't allocate memory for Linkname");
|
482
|
+
return (ARCHIVE_FATAL);
|
483
|
+
}
|
484
|
+
archive_set_error(&a->archive,
|
485
|
+
ARCHIVE_ERRNO_FILE_FORMAT,
|
486
|
+
"Can't translate linkname '%s' to %s",
|
487
|
+
p, archive_string_conversion_charset_name(sconv));
|
488
|
+
ret = ARCHIVE_WARN;
|
489
|
+
}
|
490
|
+
}
|
491
|
+
if (copy_length > 0) {
|
329
492
|
if (copy_length > USTAR_linkname_size) {
|
330
493
|
archive_set_error(&a->archive, ENAMETOOLONG,
|
331
494
|
"Link contents too long");
|
@@ -335,51 +498,86 @@ __archive_write_format_header_ustar(struct archive_write *a, char h[512],
|
|
335
498
|
memcpy(h + USTAR_linkname_offset, p, copy_length);
|
336
499
|
}
|
337
500
|
|
338
|
-
|
339
|
-
if (
|
340
|
-
|
501
|
+
r = archive_entry_uname_l(entry, &p, ©_length, sconv);
|
502
|
+
if (r != 0) {
|
503
|
+
if (errno == ENOMEM) {
|
504
|
+
archive_set_error(&a->archive, ENOMEM,
|
505
|
+
"Can't allocate memory for Uname");
|
506
|
+
return (ARCHIVE_FATAL);
|
507
|
+
}
|
508
|
+
archive_set_error(&a->archive,
|
509
|
+
ARCHIVE_ERRNO_FILE_FORMAT,
|
510
|
+
"Can't translate uname '%s' to %s",
|
511
|
+
p, archive_string_conversion_charset_name(sconv));
|
512
|
+
ret = ARCHIVE_WARN;
|
513
|
+
}
|
514
|
+
if (copy_length > 0) {
|
341
515
|
if (copy_length > USTAR_uname_size) {
|
342
|
-
|
343
|
-
|
344
|
-
|
516
|
+
if (tartype != 'x') {
|
517
|
+
archive_set_error(&a->archive,
|
518
|
+
ARCHIVE_ERRNO_MISC, "Username too long");
|
519
|
+
ret = ARCHIVE_FAILED;
|
520
|
+
}
|
345
521
|
copy_length = USTAR_uname_size;
|
346
522
|
}
|
347
523
|
memcpy(h + USTAR_uname_offset, p, copy_length);
|
348
524
|
}
|
349
525
|
|
350
|
-
|
351
|
-
if (
|
352
|
-
|
526
|
+
r = archive_entry_gname_l(entry, &p, ©_length, sconv);
|
527
|
+
if (r != 0) {
|
528
|
+
if (errno == ENOMEM) {
|
529
|
+
archive_set_error(&a->archive, ENOMEM,
|
530
|
+
"Can't allocate memory for Gname");
|
531
|
+
return (ARCHIVE_FATAL);
|
532
|
+
}
|
533
|
+
archive_set_error(&a->archive,
|
534
|
+
ARCHIVE_ERRNO_FILE_FORMAT,
|
535
|
+
"Can't translate gname '%s' to %s",
|
536
|
+
p, archive_string_conversion_charset_name(sconv));
|
537
|
+
ret = ARCHIVE_WARN;
|
538
|
+
}
|
539
|
+
if (copy_length > 0) {
|
353
540
|
if (strlen(p) > USTAR_gname_size) {
|
354
|
-
|
355
|
-
|
356
|
-
|
541
|
+
if (tartype != 'x') {
|
542
|
+
archive_set_error(&a->archive,
|
543
|
+
ARCHIVE_ERRNO_MISC, "Group name too long");
|
544
|
+
ret = ARCHIVE_FAILED;
|
545
|
+
}
|
357
546
|
copy_length = USTAR_gname_size;
|
358
547
|
}
|
359
548
|
memcpy(h + USTAR_gname_offset, p, copy_length);
|
360
549
|
}
|
361
550
|
|
362
|
-
if (format_number(archive_entry_mode(entry) & 07777,
|
363
|
-
|
551
|
+
if (format_number(archive_entry_mode(entry) & 07777,
|
552
|
+
h + USTAR_mode_offset, USTAR_mode_size, USTAR_mode_max_size, strict)) {
|
553
|
+
archive_set_error(&a->archive, ERANGE,
|
554
|
+
"Numeric mode too large");
|
364
555
|
ret = ARCHIVE_FAILED;
|
365
556
|
}
|
366
557
|
|
367
|
-
if (format_number(archive_entry_uid(entry),
|
368
|
-
|
558
|
+
if (format_number(archive_entry_uid(entry),
|
559
|
+
h + USTAR_uid_offset, USTAR_uid_size, USTAR_uid_max_size, strict)) {
|
560
|
+
archive_set_error(&a->archive, ERANGE,
|
561
|
+
"Numeric user ID too large");
|
369
562
|
ret = ARCHIVE_FAILED;
|
370
563
|
}
|
371
564
|
|
372
|
-
if (format_number(archive_entry_gid(entry),
|
373
|
-
|
565
|
+
if (format_number(archive_entry_gid(entry),
|
566
|
+
h + USTAR_gid_offset, USTAR_gid_size, USTAR_gid_max_size, strict)) {
|
567
|
+
archive_set_error(&a->archive, ERANGE,
|
568
|
+
"Numeric group ID too large");
|
374
569
|
ret = ARCHIVE_FAILED;
|
375
570
|
}
|
376
571
|
|
377
|
-
if (format_number(archive_entry_size(entry),
|
378
|
-
|
572
|
+
if (format_number(archive_entry_size(entry),
|
573
|
+
h + USTAR_size_offset, USTAR_size_size, USTAR_size_max_size, strict)) {
|
574
|
+
archive_set_error(&a->archive, ERANGE,
|
575
|
+
"File size out of range");
|
379
576
|
ret = ARCHIVE_FAILED;
|
380
577
|
}
|
381
578
|
|
382
|
-
if (format_number(archive_entry_mtime(entry),
|
579
|
+
if (format_number(archive_entry_mtime(entry),
|
580
|
+
h + USTAR_mtime_offset, USTAR_mtime_size, USTAR_mtime_max_size, strict)) {
|
383
581
|
archive_set_error(&a->archive, ERANGE,
|
384
582
|
"File modification time too large");
|
385
583
|
ret = ARCHIVE_FAILED;
|
@@ -387,15 +585,17 @@ __archive_write_format_header_ustar(struct archive_write *a, char h[512],
|
|
387
585
|
|
388
586
|
if (archive_entry_filetype(entry) == AE_IFBLK
|
389
587
|
|| archive_entry_filetype(entry) == AE_IFCHR) {
|
390
|
-
if (format_number(archive_entry_rdevmajor(entry),
|
391
|
-
|
588
|
+
if (format_number(archive_entry_rdevmajor(entry),
|
589
|
+
h + USTAR_rdevmajor_offset, USTAR_rdevmajor_size,
|
590
|
+
USTAR_rdevmajor_max_size, strict)) {
|
392
591
|
archive_set_error(&a->archive, ERANGE,
|
393
592
|
"Major device number too large");
|
394
593
|
ret = ARCHIVE_FAILED;
|
395
594
|
}
|
396
595
|
|
397
|
-
if (format_number(archive_entry_rdevminor(entry),
|
398
|
-
|
596
|
+
if (format_number(archive_entry_rdevminor(entry),
|
597
|
+
h + USTAR_rdevminor_offset, USTAR_rdevminor_size,
|
598
|
+
USTAR_rdevminor_max_size, strict)) {
|
399
599
|
archive_set_error(&a->archive, ERANGE,
|
400
600
|
"Minor device number too large");
|
401
601
|
ret = ARCHIVE_FAILED;
|
@@ -414,16 +614,9 @@ __archive_write_format_header_ustar(struct archive_write *a, char h[512],
|
|
414
614
|
case AE_IFBLK: h[USTAR_typeflag_offset] = '4' ; break;
|
415
615
|
case AE_IFDIR: h[USTAR_typeflag_offset] = '5' ; break;
|
416
616
|
case AE_IFIFO: h[USTAR_typeflag_offset] = '6' ; break;
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
"tar format cannot archive socket");
|
421
|
-
return (ARCHIVE_FAILED);
|
422
|
-
default:
|
423
|
-
archive_set_error(&a->archive,
|
424
|
-
ARCHIVE_ERRNO_FILE_FORMAT,
|
425
|
-
"tar format cannot archive this (mode=0%lo)",
|
426
|
-
(unsigned long)archive_entry_mode(entry));
|
617
|
+
default: /* AE_IFSOCK and unknown */
|
618
|
+
__archive_write_entry_filetype_unsupported(
|
619
|
+
&a->archive, entry, "ustar");
|
427
620
|
ret = ARCHIVE_FAILED;
|
428
621
|
}
|
429
622
|
}
|
@@ -519,19 +712,13 @@ format_octal(int64_t v, char *p, int s)
|
|
519
712
|
}
|
520
713
|
|
521
714
|
static int
|
522
|
-
|
715
|
+
archive_write_ustar_close(struct archive_write *a)
|
523
716
|
{
|
524
|
-
|
525
|
-
|
526
|
-
if (a->compressor.write == NULL)
|
527
|
-
return (ARCHIVE_OK);
|
528
|
-
|
529
|
-
r = write_nulls(a, 512*2);
|
530
|
-
return (r);
|
717
|
+
return (__archive_write_nulls(a, 512*2));
|
531
718
|
}
|
532
719
|
|
533
720
|
static int
|
534
|
-
|
721
|
+
archive_write_ustar_free(struct archive_write *a)
|
535
722
|
{
|
536
723
|
struct ustar *ustar;
|
537
724
|
|
@@ -548,28 +735,12 @@ archive_write_ustar_finish_entry(struct archive_write *a)
|
|
548
735
|
int ret;
|
549
736
|
|
550
737
|
ustar = (struct ustar *)a->format_data;
|
551
|
-
ret =
|
552
|
-
ustar->entry_bytes_remaining + ustar->entry_padding);
|
738
|
+
ret = __archive_write_nulls(a,
|
739
|
+
(size_t)(ustar->entry_bytes_remaining + ustar->entry_padding));
|
553
740
|
ustar->entry_bytes_remaining = ustar->entry_padding = 0;
|
554
741
|
return (ret);
|
555
742
|
}
|
556
743
|
|
557
|
-
static int
|
558
|
-
write_nulls(struct archive_write *a, size_t padding)
|
559
|
-
{
|
560
|
-
int ret;
|
561
|
-
size_t to_write;
|
562
|
-
|
563
|
-
while (padding > 0) {
|
564
|
-
to_write = padding < a->null_length ? padding : a->null_length;
|
565
|
-
ret = (a->compressor.write)(a, a->nulls, to_write);
|
566
|
-
if (ret != ARCHIVE_OK)
|
567
|
-
return (ret);
|
568
|
-
padding -= to_write;
|
569
|
-
}
|
570
|
-
return (ARCHIVE_OK);
|
571
|
-
}
|
572
|
-
|
573
744
|
static ssize_t
|
574
745
|
archive_write_ustar_data(struct archive_write *a, const void *buff, size_t s)
|
575
746
|
{
|
@@ -578,8 +749,8 @@ archive_write_ustar_data(struct archive_write *a, const void *buff, size_t s)
|
|
578
749
|
|
579
750
|
ustar = (struct ustar *)a->format_data;
|
580
751
|
if (s > ustar->entry_bytes_remaining)
|
581
|
-
s = ustar->entry_bytes_remaining;
|
582
|
-
ret = (a
|
752
|
+
s = (size_t)ustar->entry_bytes_remaining;
|
753
|
+
ret = __archive_write_output(a, buff, s);
|
583
754
|
ustar->entry_bytes_remaining -= s;
|
584
755
|
if (ret != ARCHIVE_OK)
|
585
756
|
return (ret);
|