libarchive-static 1.0.5 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (296) hide show
  1. checksums.yaml +5 -5
  2. data/ext/extconf.rb +2 -9
  3. data/ext/libarchive-0.1.1/ext/archive_read_support_compression.c +6 -6
  4. data/ext/libarchive-0.1.1/ext/archive_read_support_compression.o +0 -0
  5. data/ext/libarchive-0.1.1/ext/archive_read_support_format.o +0 -0
  6. data/ext/libarchive-0.1.1/ext/archive_write_open_rb_str.c +1 -1
  7. data/ext/libarchive-0.1.1/ext/archive_write_open_rb_str.o +0 -0
  8. data/ext/libarchive-0.1.1/ext/archive_write_set_compression.c +5 -5
  9. data/ext/libarchive-0.1.1/ext/archive_write_set_compression.o +0 -0
  10. data/ext/libarchive-0.1.1/ext/config.h +23 -0
  11. data/ext/libarchive-0.1.1/ext/config.log +230 -0
  12. data/ext/libarchive-0.1.1/ext/config.status +671 -0
  13. data/ext/libarchive-0.1.1/ext/libarchive.c +1 -1
  14. data/ext/libarchive-0.1.1/ext/libarchive.o +0 -0
  15. data/ext/libarchive-0.1.1/ext/libarchive_archive.c +7 -7
  16. data/ext/libarchive-0.1.1/ext/libarchive_archive.o +0 -0
  17. data/ext/libarchive-0.1.1/ext/libarchive_entry.c +6 -0
  18. data/ext/libarchive-0.1.1/ext/libarchive_entry.o +0 -0
  19. data/ext/libarchive-0.1.1/ext/libarchive_internal.h +0 -1
  20. data/ext/libarchive-0.1.1/ext/libarchive_reader.c +6 -4
  21. data/ext/libarchive-0.1.1/ext/libarchive_reader.o +0 -0
  22. data/ext/libarchive-0.1.1/ext/libarchive_ruby.so +0 -0
  23. data/ext/libarchive-0.1.1/ext/libarchive_win32.h +1 -1
  24. data/ext/libarchive-0.1.1/ext/libarchive_writer.c +2 -2
  25. data/ext/libarchive-0.1.1/ext/libarchive_writer.o +0 -0
  26. data/ext/libarchive-3.6.2/Makefile.in +16892 -0
  27. data/ext/libarchive-3.6.2/build/autoconf/ax_append_compile_flags.m4 +67 -0
  28. data/ext/libarchive-3.6.2/build/autoconf/ax_append_flag.m4 +71 -0
  29. data/ext/libarchive-3.6.2/build/autoconf/ax_check_compile_flag.m4 +74 -0
  30. data/ext/libarchive-3.6.2/build/autoconf/ax_require_defined.m4 +37 -0
  31. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/build/autoconf/check_stdcall_func.m4 +0 -0
  32. data/ext/libarchive-3.6.2/build/autoconf/compile +348 -0
  33. data/ext/libarchive-3.6.2/build/autoconf/config.guess +1754 -0
  34. data/ext/libarchive-3.6.2/build/autoconf/config.rpath +696 -0
  35. data/ext/libarchive-3.6.2/build/autoconf/config.sub +1890 -0
  36. data/ext/libarchive-3.6.2/build/autoconf/depcomp +791 -0
  37. data/ext/libarchive-3.6.2/build/autoconf/iconv.m4 +271 -0
  38. data/ext/libarchive-3.6.2/build/autoconf/install-sh +541 -0
  39. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/build/autoconf/la_uid_t.m4 +0 -0
  40. data/ext/libarchive-3.6.2/build/autoconf/lib-ld.m4 +109 -0
  41. data/ext/libarchive-3.6.2/build/autoconf/lib-link.m4 +777 -0
  42. data/ext/libarchive-3.6.2/build/autoconf/lib-prefix.m4 +224 -0
  43. data/ext/libarchive-3.6.2/build/autoconf/ltmain.sh +11251 -0
  44. data/ext/libarchive-3.6.2/build/autoconf/m4_ax_compile_check_sizeof.m4 +115 -0
  45. data/ext/libarchive-3.6.2/build/autoconf/missing +215 -0
  46. data/ext/libarchive-3.6.2/build/autoconf/test-driver +153 -0
  47. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/build/pkgconfig/libarchive.pc.in +4 -1
  48. data/ext/libarchive-3.6.2/config.h.in +1504 -0
  49. data/ext/libarchive-3.6.2/configure +25558 -0
  50. data/ext/libarchive-3.6.2/libarchive/archive.h +1212 -0
  51. data/ext/libarchive-3.6.2/libarchive/archive_acl.c +2097 -0
  52. data/ext/libarchive-3.6.2/libarchive/archive_acl_private.h +83 -0
  53. data/ext/libarchive-3.6.2/libarchive/archive_blake2.h +197 -0
  54. data/ext/libarchive-3.6.2/libarchive/archive_blake2_impl.h +161 -0
  55. data/ext/libarchive-3.6.2/libarchive/archive_blake2s_ref.c +369 -0
  56. data/ext/libarchive-3.6.2/libarchive/archive_blake2sp_ref.c +361 -0
  57. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_check_magic.c +63 -22
  58. data/ext/libarchive-3.6.2/libarchive/archive_cmdline.c +227 -0
  59. data/ext/libarchive-3.6.2/libarchive/archive_cmdline_private.h +47 -0
  60. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_crc32.h +17 -0
  61. data/ext/libarchive-3.6.2/libarchive/archive_cryptor.c +534 -0
  62. data/ext/libarchive-3.6.2/libarchive/archive_cryptor_private.h +188 -0
  63. data/ext/libarchive-3.6.2/libarchive/archive_digest.c +1505 -0
  64. data/ext/libarchive-3.6.2/libarchive/archive_digest_private.h +416 -0
  65. data/ext/libarchive-3.6.2/libarchive/archive_disk_acl_darwin.c +559 -0
  66. data/ext/libarchive-3.6.2/libarchive/archive_disk_acl_freebsd.c +712 -0
  67. data/ext/libarchive-3.6.2/libarchive/archive_disk_acl_linux.c +760 -0
  68. data/ext/libarchive-3.6.2/libarchive/archive_disk_acl_sunos.c +824 -0
  69. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_endian.h +48 -15
  70. data/ext/libarchive-3.6.2/libarchive/archive_entry.c +2149 -0
  71. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_entry.h +305 -106
  72. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_entry_copy_bhfi.c +5 -4
  73. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_entry_copy_stat.c +9 -3
  74. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_entry_link_resolver.c +104 -62
  75. data/ext/libarchive-3.6.2/libarchive/archive_entry_locale.h +92 -0
  76. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_entry_private.h +65 -49
  77. data/ext/libarchive-3.6.2/libarchive/archive_entry_sparse.c +156 -0
  78. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_entry_stat.c +6 -6
  79. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_entry_strmode.c +1 -1
  80. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_entry_xattr.c +4 -6
  81. data/ext/libarchive-3.6.2/libarchive/archive_getdate.c +1165 -0
  82. data/ext/libarchive-3.6.2/libarchive/archive_getdate.h +39 -0
  83. data/ext/libarchive-3.6.2/libarchive/archive_hmac.c +334 -0
  84. data/ext/libarchive-3.6.2/libarchive/archive_hmac_private.h +117 -0
  85. data/ext/libarchive-3.6.2/libarchive/archive_match.c +1875 -0
  86. data/ext/libarchive-3.6.2/libarchive/archive_openssl_evp_private.h +53 -0
  87. data/ext/libarchive-3.6.2/libarchive/archive_openssl_hmac_private.h +54 -0
  88. data/ext/libarchive-3.6.2/libarchive/archive_options.c +218 -0
  89. data/ext/libarchive-3.6.2/libarchive/archive_options_private.h +51 -0
  90. data/ext/libarchive-3.6.2/libarchive/archive_pack_dev.c +337 -0
  91. data/ext/libarchive-3.6.2/libarchive/archive_pack_dev.h +49 -0
  92. data/ext/libarchive-3.6.2/libarchive/archive_pathmatch.c +463 -0
  93. data/ext/libarchive-3.6.2/libarchive/archive_pathmatch.h +52 -0
  94. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_platform.h +77 -9
  95. data/ext/libarchive-3.6.2/libarchive/archive_platform_acl.h +55 -0
  96. data/ext/libarchive-3.6.2/libarchive/archive_platform_xattr.h +47 -0
  97. data/ext/libarchive-3.6.2/libarchive/archive_ppmd7.c +1168 -0
  98. data/ext/libarchive-3.6.2/libarchive/archive_ppmd7_private.h +119 -0
  99. data/ext/libarchive-3.6.2/libarchive/archive_ppmd8.c +1287 -0
  100. data/ext/libarchive-3.6.2/libarchive/archive_ppmd8_private.h +148 -0
  101. data/ext/libarchive-3.6.2/libarchive/archive_ppmd_private.h +151 -0
  102. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_private.h +74 -18
  103. data/ext/libarchive-3.6.2/libarchive/archive_random.c +272 -0
  104. data/ext/libarchive-3.6.2/libarchive/archive_random_private.h +36 -0
  105. data/ext/libarchive-3.6.2/libarchive/archive_rb.c +709 -0
  106. data/ext/libarchive-3.6.2/libarchive/archive_rb.h +113 -0
  107. data/ext/libarchive-3.6.2/libarchive/archive_read.c +1756 -0
  108. data/ext/libarchive-3.6.2/libarchive/archive_read_add_passphrase.c +190 -0
  109. data/ext/libarchive-3.6.2/libarchive/archive_read_append_filter.c +204 -0
  110. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_read_data_into_fd.c +64 -18
  111. data/ext/libarchive-3.6.2/libarchive/archive_read_disk_entry_from_file.c +1086 -0
  112. data/ext/libarchive-3.6.2/libarchive/archive_read_disk_posix.c +2732 -0
  113. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_read_disk_private.h +40 -4
  114. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_read_disk_set_standard_lookup.c +21 -11
  115. data/ext/libarchive-3.6.2/libarchive/archive_read_disk_windows.c +2479 -0
  116. data/ext/libarchive-3.6.2/libarchive/archive_read_extract.c +60 -0
  117. data/ext/{libarchive-2.8.4/libarchive/archive_read_extract.c → libarchive-3.6.2/libarchive/archive_read_extract2.c} +34 -61
  118. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_read_open_fd.c +70 -49
  119. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_read_open_file.c +38 -23
  120. data/ext/libarchive-3.6.2/libarchive/archive_read_open_filename.c +586 -0
  121. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_read_open_memory.c +58 -28
  122. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_read_private.h +127 -59
  123. data/ext/libarchive-3.6.2/libarchive/archive_read_set_format.c +117 -0
  124. data/ext/libarchive-3.6.2/libarchive/archive_read_set_options.c +133 -0
  125. 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
  126. data/ext/libarchive-3.6.2/libarchive/archive_read_support_filter_by_code.c +83 -0
  127. 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
  128. 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
  129. data/ext/libarchive-3.6.2/libarchive/archive_read_support_filter_grzip.c +112 -0
  130. 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
  131. data/ext/libarchive-3.6.2/libarchive/archive_read_support_filter_lrzip.c +122 -0
  132. data/ext/libarchive-3.6.2/libarchive/archive_read_support_filter_lz4.c +742 -0
  133. data/ext/libarchive-3.6.2/libarchive/archive_read_support_filter_lzop.c +499 -0
  134. 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
  135. 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
  136. 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
  137. 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
  138. 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
  139. data/ext/libarchive-3.6.2/libarchive/archive_read_support_filter_zstd.c +297 -0
  140. data/ext/libarchive-3.6.2/libarchive/archive_read_support_format_7zip.c +3900 -0
  141. data/ext/libarchive-3.6.2/libarchive/archive_read_support_format_all.c +89 -0
  142. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_read_support_format_ar.c +126 -72
  143. data/ext/libarchive-3.6.2/libarchive/archive_read_support_format_by_code.c +92 -0
  144. data/ext/libarchive-3.6.2/libarchive/archive_read_support_format_cab.c +3228 -0
  145. data/ext/libarchive-3.6.2/libarchive/archive_read_support_format_cpio.c +1104 -0
  146. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_read_support_format_empty.c +14 -11
  147. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_read_support_format_iso9660.c +990 -541
  148. data/ext/libarchive-3.6.2/libarchive/archive_read_support_format_lha.c +2916 -0
  149. data/ext/libarchive-3.6.2/libarchive/archive_read_support_format_mtree.c +2150 -0
  150. data/ext/libarchive-3.6.2/libarchive/archive_read_support_format_rar.c +3797 -0
  151. data/ext/libarchive-3.6.2/libarchive/archive_read_support_format_rar5.c +4251 -0
  152. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_read_support_format_raw.c +38 -31
  153. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_read_support_format_tar.c +1157 -629
  154. data/ext/libarchive-3.6.2/libarchive/archive_read_support_format_warc.c +848 -0
  155. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_read_support_format_xar.c +439 -258
  156. data/ext/libarchive-3.6.2/libarchive/archive_read_support_format_zip.c +4270 -0
  157. data/ext/libarchive-3.6.2/libarchive/archive_string.c +4240 -0
  158. data/ext/libarchive-3.6.2/libarchive/archive_string.h +243 -0
  159. data/ext/libarchive-3.6.2/libarchive/archive_string_composition.h +2292 -0
  160. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_string_sprintf.c +44 -16
  161. data/ext/libarchive-3.6.2/libarchive/archive_util.c +655 -0
  162. data/ext/libarchive-3.6.2/libarchive/archive_version_details.c +151 -0
  163. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_virtual.c +85 -16
  164. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_windows.c +214 -541
  165. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_windows.h +74 -106
  166. data/ext/libarchive-3.6.2/libarchive/archive_write.c +828 -0
  167. data/ext/libarchive-3.6.2/libarchive/archive_write_add_filter.c +72 -0
  168. data/ext/libarchive-3.6.2/libarchive/archive_write_add_filter_b64encode.c +304 -0
  169. data/ext/libarchive-3.6.2/libarchive/archive_write_add_filter_by_name.c +77 -0
  170. data/ext/libarchive-3.6.2/libarchive/archive_write_add_filter_bzip2.c +401 -0
  171. 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
  172. data/ext/libarchive-3.6.2/libarchive/archive_write_add_filter_grzip.c +135 -0
  173. data/ext/libarchive-3.6.2/libarchive/archive_write_add_filter_gzip.c +442 -0
  174. data/ext/libarchive-3.6.2/libarchive/archive_write_add_filter_lrzip.c +197 -0
  175. data/ext/libarchive-3.6.2/libarchive/archive_write_add_filter_lz4.c +700 -0
  176. data/ext/libarchive-3.6.2/libarchive/archive_write_add_filter_lzop.c +478 -0
  177. 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
  178. data/ext/libarchive-3.6.2/libarchive/archive_write_add_filter_program.c +391 -0
  179. data/ext/libarchive-3.6.2/libarchive/archive_write_add_filter_uuencode.c +295 -0
  180. data/ext/libarchive-3.6.2/libarchive/archive_write_add_filter_xz.c +545 -0
  181. data/ext/libarchive-3.6.2/libarchive/archive_write_add_filter_zstd.c +418 -0
  182. data/ext/libarchive-3.6.2/libarchive/archive_write_disk_posix.c +4711 -0
  183. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_write_disk_private.h +9 -2
  184. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_write_disk_set_standard_lookup.c +30 -29
  185. data/ext/libarchive-3.6.2/libarchive/archive_write_disk_windows.c +2842 -0
  186. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_write_open_fd.c +15 -10
  187. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_write_open_file.c +15 -9
  188. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_write_open_filename.c +128 -20
  189. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_write_open_memory.c +7 -18
  190. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_write_private.h +72 -29
  191. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_write_set_format.c +56 -3
  192. data/ext/libarchive-3.6.2/libarchive/archive_write_set_format_7zip.c +2322 -0
  193. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_write_set_format_ar.c +54 -34
  194. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_write_set_format_by_name.c +20 -2
  195. data/ext/libarchive-3.6.2/libarchive/archive_write_set_format_cpio.c +11 -0
  196. data/ext/libarchive-3.6.2/libarchive/archive_write_set_format_cpio_binary.c +610 -0
  197. data/ext/libarchive-3.6.2/libarchive/archive_write_set_format_cpio_newc.c +457 -0
  198. data/ext/libarchive-3.6.2/libarchive/archive_write_set_format_cpio_odc.c +500 -0
  199. data/ext/libarchive-3.6.2/libarchive/archive_write_set_format_filter_by_ext.c +142 -0
  200. data/ext/libarchive-3.6.2/libarchive/archive_write_set_format_gnutar.c +755 -0
  201. data/ext/libarchive-3.6.2/libarchive/archive_write_set_format_iso9660.c +8165 -0
  202. data/ext/libarchive-3.6.2/libarchive/archive_write_set_format_mtree.c +2217 -0
  203. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_write_set_format_pax.c +1049 -387
  204. data/ext/libarchive-3.6.2/libarchive/archive_write_set_format_private.h +42 -0
  205. data/ext/libarchive-3.6.2/libarchive/archive_write_set_format_raw.c +125 -0
  206. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_write_set_format_shar.c +62 -47
  207. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/archive_write_set_format_ustar.c +279 -108
  208. data/ext/libarchive-3.6.2/libarchive/archive_write_set_format_v7tar.c +638 -0
  209. data/ext/libarchive-3.6.2/libarchive/archive_write_set_format_warc.c +453 -0
  210. data/ext/libarchive-3.6.2/libarchive/archive_write_set_format_xar.c +3259 -0
  211. data/ext/libarchive-3.6.2/libarchive/archive_write_set_format_zip.c +1704 -0
  212. data/ext/libarchive-3.6.2/libarchive/archive_write_set_options.c +130 -0
  213. data/ext/libarchive-3.6.2/libarchive/archive_write_set_passphrase.c +95 -0
  214. data/ext/libarchive-3.6.2/libarchive/archive_xxhash.h +48 -0
  215. data/ext/libarchive-3.6.2/libarchive/config_freebsd.h +271 -0
  216. data/ext/{libarchive-2.8.4 → libarchive-3.6.2}/libarchive/filter_fork.h +10 -5
  217. data/ext/{libarchive-2.8.4/libarchive/filter_fork.c → libarchive-3.6.2/libarchive/filter_fork_posix.c} +98 -19
  218. data/ext/libarchive-3.6.2/libarchive/filter_fork_windows.c +236 -0
  219. data/ext/libarchive-3.6.2/libarchive/xxhash.c +525 -0
  220. data/ext/libarchive-static-makefile +144 -80
  221. data/ext/libarchive-static-wrapper-makefile +1 -1
  222. data/ext/zlib-1.2.13/Makefile.in +404 -0
  223. data/ext/{zlib-1.2.5 → zlib-1.2.13}/adler32.c +51 -34
  224. data/ext/{zlib-1.2.5 → zlib-1.2.13}/compress.c +27 -21
  225. data/ext/zlib-1.2.13/configure +922 -0
  226. data/ext/zlib-1.2.13/crc32.c +1125 -0
  227. data/ext/zlib-1.2.13/crc32.h +9446 -0
  228. data/ext/{zlib-1.2.5 → zlib-1.2.13}/deflate.c +842 -459
  229. data/ext/{zlib-1.2.5 → zlib-1.2.13}/deflate.h +37 -33
  230. data/ext/{zlib-1.2.5 → zlib-1.2.13}/gzclose.c +0 -0
  231. data/ext/{zlib-1.2.5 → zlib-1.2.13}/gzguts.h +103 -16
  232. data/ext/{zlib-1.2.5 → zlib-1.2.13}/gzlib.c +155 -53
  233. data/ext/zlib-1.2.13/gzread.c +650 -0
  234. data/ext/zlib-1.2.13/gzwrite.c +677 -0
  235. data/ext/{zlib-1.2.5 → zlib-1.2.13}/infback.c +24 -12
  236. data/ext/{zlib-1.2.5 → zlib-1.2.13}/inffast.c +49 -66
  237. data/ext/{zlib-1.2.5 → zlib-1.2.13}/inffast.h +0 -0
  238. data/ext/{zlib-1.2.5 → zlib-1.2.13}/inffixed.h +3 -3
  239. data/ext/{zlib-1.2.5 → zlib-1.2.13}/inflate.c +209 -94
  240. data/ext/{zlib-1.2.5 → zlib-1.2.13}/inflate.h +9 -5
  241. data/ext/{zlib-1.2.5 → zlib-1.2.13}/inftrees.c +24 -50
  242. data/ext/{zlib-1.2.5 → zlib-1.2.13}/inftrees.h +1 -1
  243. data/ext/{zlib-1.2.5 → zlib-1.2.13}/trees.c +135 -198
  244. data/ext/{zlib-1.2.5 → zlib-1.2.13}/trees.h +0 -0
  245. data/ext/zlib-1.2.13/uncompr.c +93 -0
  246. data/ext/{zlib-1.2.5 → zlib-1.2.13}/zconf.h +182 -63
  247. data/ext/{zlib-1.2.5 → zlib-1.2.13}/zlib.h +617 -295
  248. data/ext/{zlib-1.2.5 → zlib-1.2.13}/zutil.c +50 -41
  249. data/ext/{zlib-1.2.5 → zlib-1.2.13}/zutil.h +83 -82
  250. metadata +244 -137
  251. data/ext/libarchive-0.1.1/libarchive.c +0 -1762
  252. data/ext/libarchive-2.8.4/Makefile.in +0 -7076
  253. data/ext/libarchive-2.8.4/build/autoconf/compile +0 -143
  254. data/ext/libarchive-2.8.4/build/autoconf/config.guess +0 -1502
  255. data/ext/libarchive-2.8.4/build/autoconf/config.sub +0 -1708
  256. data/ext/libarchive-2.8.4/build/autoconf/depcomp +0 -630
  257. data/ext/libarchive-2.8.4/build/autoconf/install-sh +0 -291
  258. data/ext/libarchive-2.8.4/build/autoconf/ltmain.sh +0 -8406
  259. data/ext/libarchive-2.8.4/build/autoconf/missing +0 -376
  260. data/ext/libarchive-2.8.4/config.h.in +0 -772
  261. data/ext/libarchive-2.8.4/configure +0 -17916
  262. data/ext/libarchive-2.8.4/libarchive/archive.h +0 -741
  263. data/ext/libarchive-2.8.4/libarchive/archive_entry.c +0 -2202
  264. data/ext/libarchive-2.8.4/libarchive/archive_hash.h +0 -281
  265. data/ext/libarchive-2.8.4/libarchive/archive_read.c +0 -1249
  266. data/ext/libarchive-2.8.4/libarchive/archive_read_disk.c +0 -198
  267. data/ext/libarchive-2.8.4/libarchive/archive_read_disk_entry_from_file.c +0 -570
  268. data/ext/libarchive-2.8.4/libarchive/archive_read_open_filename.c +0 -272
  269. data/ext/libarchive-2.8.4/libarchive/archive_read_support_format_cpio.c +0 -777
  270. data/ext/libarchive-2.8.4/libarchive/archive_read_support_format_mtree.c +0 -1304
  271. data/ext/libarchive-2.8.4/libarchive/archive_read_support_format_zip.c +0 -903
  272. data/ext/libarchive-2.8.4/libarchive/archive_string.c +0 -453
  273. data/ext/libarchive-2.8.4/libarchive/archive_string.h +0 -148
  274. data/ext/libarchive-2.8.4/libarchive/archive_util.c +0 -391
  275. data/ext/libarchive-2.8.4/libarchive/archive_write.c +0 -466
  276. data/ext/libarchive-2.8.4/libarchive/archive_write_disk.c +0 -2628
  277. data/ext/libarchive-2.8.4/libarchive/archive_write_set_compression_bzip2.c +0 -408
  278. data/ext/libarchive-2.8.4/libarchive/archive_write_set_compression_gzip.c +0 -477
  279. data/ext/libarchive-2.8.4/libarchive/archive_write_set_compression_none.c +0 -257
  280. data/ext/libarchive-2.8.4/libarchive/archive_write_set_compression_program.c +0 -347
  281. data/ext/libarchive-2.8.4/libarchive/archive_write_set_compression_xz.c +0 -438
  282. data/ext/libarchive-2.8.4/libarchive/archive_write_set_format_cpio.c +0 -344
  283. data/ext/libarchive-2.8.4/libarchive/archive_write_set_format_cpio_newc.c +0 -295
  284. data/ext/libarchive-2.8.4/libarchive/archive_write_set_format_mtree.c +0 -1050
  285. data/ext/libarchive-2.8.4/libarchive/archive_write_set_format_zip.c +0 -667
  286. data/ext/libarchive-2.8.4/libarchive/config_freebsd.h +0 -154
  287. data/ext/libarchive-2.8.4/libarchive/filter_fork_windows.c +0 -113
  288. data/ext/zlib-1.2.5/Makefile.in +0 -257
  289. data/ext/zlib-1.2.5/configure +0 -596
  290. data/ext/zlib-1.2.5/crc32.c +0 -442
  291. data/ext/zlib-1.2.5/crc32.h +0 -441
  292. data/ext/zlib-1.2.5/example.c +0 -565
  293. data/ext/zlib-1.2.5/gzread.c +0 -653
  294. data/ext/zlib-1.2.5/gzwrite.c +0 -531
  295. data/ext/zlib-1.2.5/minigzip.c +0 -440
  296. data/ext/zlib-1.2.5/uncompr.c +0 -59
@@ -1,570 +0,0 @@
1
- /*-
2
- * Copyright (c) 2003-2009 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_disk_entry_from_file.c 201084 2009-12-28 02:14:09Z kientzle $");
28
-
29
- #ifdef HAVE_SYS_TYPES_H
30
- /* Mac OSX requires sys/types.h before sys/acl.h. */
31
- #include <sys/types.h>
32
- #endif
33
- #ifdef HAVE_SYS_ACL_H
34
- #include <sys/acl.h>
35
- #endif
36
- #ifdef HAVE_SYS_EXTATTR_H
37
- #include <sys/extattr.h>
38
- #endif
39
- #ifdef HAVE_SYS_PARAM_H
40
- #include <sys/param.h>
41
- #endif
42
- #ifdef HAVE_SYS_STAT_H
43
- #include <sys/stat.h>
44
- #endif
45
- #ifdef HAVE_SYS_XATTR_H
46
- #include <sys/xattr.h>
47
- #endif
48
- #ifdef HAVE_ACL_LIBACL_H
49
- #include <acl/libacl.h>
50
- #endif
51
- #ifdef HAVE_ATTR_XATTR_H
52
- #include <attr/xattr.h>
53
- #endif
54
- #ifdef HAVE_ERRNO_H
55
- #include <errno.h>
56
- #endif
57
- #ifdef HAVE_LIMITS_H
58
- #include <limits.h>
59
- #endif
60
- #ifdef HAVE_WINDOWS_H
61
- #include <windows.h>
62
- #endif
63
-
64
- #include "archive.h"
65
- #include "archive_entry.h"
66
- #include "archive_private.h"
67
- #include "archive_read_disk_private.h"
68
-
69
- /*
70
- * Linux and FreeBSD plug this obvious hole in POSIX.1e in
71
- * different ways.
72
- */
73
- #if HAVE_ACL_GET_PERM
74
- #define ACL_GET_PERM acl_get_perm
75
- #elif HAVE_ACL_GET_PERM_NP
76
- #define ACL_GET_PERM acl_get_perm_np
77
- #endif
78
-
79
- static int setup_acls_posix1e(struct archive_read_disk *,
80
- struct archive_entry *, int fd);
81
- static int setup_xattrs(struct archive_read_disk *,
82
- struct archive_entry *, int fd);
83
-
84
- int
85
- archive_read_disk_entry_from_file(struct archive *_a,
86
- struct archive_entry *entry,
87
- int fd, const struct stat *st)
88
- {
89
- struct archive_read_disk *a = (struct archive_read_disk *)_a;
90
- const char *path, *name;
91
- struct stat s;
92
- int initial_fd = fd;
93
- int r, r1;
94
-
95
- archive_clear_error(_a);
96
- path = archive_entry_sourcepath(entry);
97
- if (path == NULL)
98
- path = archive_entry_pathname(entry);
99
-
100
- #ifdef EXT2_IOC_GETFLAGS
101
- /* Linux requires an extra ioctl to pull the flags. Although
102
- * this is an extra step, it has a nice side-effect: We get an
103
- * open file descriptor which we can use in the subsequent lookups. */
104
- if ((S_ISREG(st->st_mode) || S_ISDIR(st->st_mode))) {
105
- if (fd < 0)
106
- fd = open(pathname, O_RDONLY | O_NONBLOCK | O_BINARY);
107
- if (fd >= 0) {
108
- unsigned long stflags;
109
- int r = ioctl(fd, EXT2_IOC_GETFLAGS, &stflags);
110
- if (r == 0 && stflags != 0)
111
- archive_entry_set_fflags(entry, stflags, 0);
112
- }
113
- }
114
- #endif
115
-
116
- if (st == NULL) {
117
- /* TODO: On Windows, use GetFileInfoByHandle() here.
118
- * Using Windows stat() call is badly broken, but
119
- * even the stat() wrapper has problems because
120
- * 'struct stat' is broken on Windows.
121
- */
122
- #if HAVE_FSTAT
123
- if (fd >= 0) {
124
- if (fstat(fd, &s) != 0) {
125
- archive_set_error(&a->archive, errno,
126
- "Can't fstat");
127
- return (ARCHIVE_FAILED);
128
- }
129
- } else
130
- #endif
131
- #if HAVE_LSTAT
132
- if (!a->follow_symlinks) {
133
- if (lstat(path, &s) != 0) {
134
- archive_set_error(&a->archive, errno,
135
- "Can't lstat %s", path);
136
- return (ARCHIVE_FAILED);
137
- }
138
- } else
139
- #endif
140
- if (stat(path, &s) != 0) {
141
- archive_set_error(&a->archive, errno,
142
- "Can't lstat %s", path);
143
- return (ARCHIVE_FAILED);
144
- }
145
- st = &s;
146
- }
147
- archive_entry_copy_stat(entry, st);
148
-
149
- /* Lookup uname/gname */
150
- name = archive_read_disk_uname(_a, archive_entry_uid(entry));
151
- if (name != NULL)
152
- archive_entry_copy_uname(entry, name);
153
- name = archive_read_disk_gname(_a, archive_entry_gid(entry));
154
- if (name != NULL)
155
- archive_entry_copy_gname(entry, name);
156
-
157
- #ifdef HAVE_STRUCT_STAT_ST_FLAGS
158
- /* On FreeBSD, we get flags for free with the stat. */
159
- /* TODO: Does this belong in copy_stat()? */
160
- if (st->st_flags != 0)
161
- archive_entry_set_fflags(entry, st->st_flags, 0);
162
- #endif
163
-
164
- #ifdef HAVE_READLINK
165
- if (S_ISLNK(st->st_mode)) {
166
- char linkbuffer[PATH_MAX + 1];
167
- int lnklen = readlink(path, linkbuffer, PATH_MAX);
168
- if (lnklen < 0) {
169
- archive_set_error(&a->archive, errno,
170
- "Couldn't read link data");
171
- return (ARCHIVE_FAILED);
172
- }
173
- linkbuffer[lnklen] = 0;
174
- archive_entry_set_symlink(entry, linkbuffer);
175
- }
176
- #endif
177
-
178
- r = setup_acls_posix1e(a, entry, fd);
179
- r1 = setup_xattrs(a, entry, fd);
180
- if (r1 < r)
181
- r = r1;
182
- /* If we opened the file earlier in this function, close it. */
183
- if (initial_fd != fd)
184
- close(fd);
185
- return (r);
186
- }
187
-
188
- #ifdef HAVE_POSIX_ACL
189
- static void setup_acl_posix1e(struct archive_read_disk *a,
190
- struct archive_entry *entry, acl_t acl, int archive_entry_acl_type);
191
-
192
- static int
193
- setup_acls_posix1e(struct archive_read_disk *a,
194
- struct archive_entry *entry, int fd)
195
- {
196
- const char *accpath;
197
- acl_t acl;
198
-
199
- accpath = archive_entry_sourcepath(entry);
200
- if (accpath == NULL)
201
- accpath = archive_entry_pathname(entry);
202
-
203
- archive_entry_acl_clear(entry);
204
-
205
- /* Retrieve access ACL from file. */
206
- if (fd >= 0)
207
- acl = acl_get_fd(fd);
208
- #if HAVE_ACL_GET_LINK_NP
209
- else if (!a->follow_symlinks)
210
- acl = acl_get_link_np(accpath, ACL_TYPE_ACCESS);
211
- #else
212
- else if ((!a->follow_symlinks)
213
- && (archive_entry_filetype(entry) == AE_IFLNK))
214
- /* We can't get the ACL of a symlink, so we assume it can't
215
- have one. */
216
- acl = NULL;
217
- #endif
218
- else
219
- acl = acl_get_file(accpath, ACL_TYPE_ACCESS);
220
- if (acl != NULL) {
221
- setup_acl_posix1e(a, entry, acl,
222
- ARCHIVE_ENTRY_ACL_TYPE_ACCESS);
223
- acl_free(acl);
224
- }
225
-
226
- /* Only directories can have default ACLs. */
227
- if (S_ISDIR(archive_entry_mode(entry))) {
228
- acl = acl_get_file(accpath, ACL_TYPE_DEFAULT);
229
- if (acl != NULL) {
230
- setup_acl_posix1e(a, entry, acl,
231
- ARCHIVE_ENTRY_ACL_TYPE_DEFAULT);
232
- acl_free(acl);
233
- }
234
- }
235
- return (ARCHIVE_OK);
236
- }
237
-
238
- /*
239
- * Translate POSIX.1e ACL into libarchive internal structure.
240
- */
241
- static void
242
- setup_acl_posix1e(struct archive_read_disk *a,
243
- struct archive_entry *entry, acl_t acl, int archive_entry_acl_type)
244
- {
245
- acl_tag_t acl_tag;
246
- acl_entry_t acl_entry;
247
- acl_permset_t acl_permset;
248
- int s, ae_id, ae_tag, ae_perm;
249
- const char *ae_name;
250
-
251
- s = acl_get_entry(acl, ACL_FIRST_ENTRY, &acl_entry);
252
- while (s == 1) {
253
- ae_id = -1;
254
- ae_name = NULL;
255
-
256
- acl_get_tag_type(acl_entry, &acl_tag);
257
- if (acl_tag == ACL_USER) {
258
- ae_id = (int)*(uid_t *)acl_get_qualifier(acl_entry);
259
- ae_name = archive_read_disk_uname(&a->archive, ae_id);
260
- ae_tag = ARCHIVE_ENTRY_ACL_USER;
261
- } else if (acl_tag == ACL_GROUP) {
262
- ae_id = (int)*(gid_t *)acl_get_qualifier(acl_entry);
263
- ae_name = archive_read_disk_gname(&a->archive, ae_id);
264
- ae_tag = ARCHIVE_ENTRY_ACL_GROUP;
265
- } else if (acl_tag == ACL_MASK) {
266
- ae_tag = ARCHIVE_ENTRY_ACL_MASK;
267
- } else if (acl_tag == ACL_USER_OBJ) {
268
- ae_tag = ARCHIVE_ENTRY_ACL_USER_OBJ;
269
- } else if (acl_tag == ACL_GROUP_OBJ) {
270
- ae_tag = ARCHIVE_ENTRY_ACL_GROUP_OBJ;
271
- } else if (acl_tag == ACL_OTHER) {
272
- ae_tag = ARCHIVE_ENTRY_ACL_OTHER;
273
- } else {
274
- /* Skip types that libarchive can't support. */
275
- continue;
276
- }
277
-
278
- acl_get_permset(acl_entry, &acl_permset);
279
- ae_perm = 0;
280
- /*
281
- * acl_get_perm() is spelled differently on different
282
- * platforms; see above.
283
- */
284
- if (ACL_GET_PERM(acl_permset, ACL_EXECUTE))
285
- ae_perm |= ARCHIVE_ENTRY_ACL_EXECUTE;
286
- if (ACL_GET_PERM(acl_permset, ACL_READ))
287
- ae_perm |= ARCHIVE_ENTRY_ACL_READ;
288
- if (ACL_GET_PERM(acl_permset, ACL_WRITE))
289
- ae_perm |= ARCHIVE_ENTRY_ACL_WRITE;
290
-
291
- archive_entry_acl_add_entry(entry,
292
- archive_entry_acl_type, ae_perm, ae_tag,
293
- ae_id, ae_name);
294
-
295
- s = acl_get_entry(acl, ACL_NEXT_ENTRY, &acl_entry);
296
- }
297
- }
298
- #else
299
- static int
300
- setup_acls_posix1e(struct archive_read_disk *a,
301
- struct archive_entry *entry, int fd)
302
- {
303
- (void)a; /* UNUSED */
304
- (void)entry; /* UNUSED */
305
- (void)fd; /* UNUSED */
306
- return (ARCHIVE_OK);
307
- }
308
- #endif
309
-
310
- #if HAVE_LISTXATTR && HAVE_LLISTXATTR && HAVE_GETXATTR && HAVE_LGETXATTR
311
-
312
- /*
313
- * Linux extended attribute support.
314
- *
315
- * TODO: By using a stack-allocated buffer for the first
316
- * call to getxattr(), we might be able to avoid the second
317
- * call entirely. We only need the second call if the
318
- * stack-allocated buffer is too small. But a modest buffer
319
- * of 1024 bytes or so will often be big enough. Same applies
320
- * to listxattr().
321
- */
322
-
323
-
324
- static int
325
- setup_xattr(struct archive_read_disk *a,
326
- struct archive_entry *entry, const char *name, int fd)
327
- {
328
- ssize_t size;
329
- void *value = NULL;
330
- const char *accpath;
331
-
332
- (void)fd; /* UNUSED */
333
-
334
- accpath = archive_entry_sourcepath(entry);
335
- if (accpath == NULL)
336
- accpath = archive_entry_pathname(entry);
337
-
338
- if (!a->follow_symlinks)
339
- size = lgetxattr(accpath, name, NULL, 0);
340
- else
341
- size = getxattr(accpath, name, NULL, 0);
342
-
343
- if (size == -1) {
344
- archive_set_error(&a->archive, errno,
345
- "Couldn't query extended attribute");
346
- return (ARCHIVE_WARN);
347
- }
348
-
349
- if (size > 0 && (value = malloc(size)) == NULL) {
350
- archive_set_error(&a->archive, errno, "Out of memory");
351
- return (ARCHIVE_FATAL);
352
- }
353
-
354
- if (!a->follow_symlinks)
355
- size = lgetxattr(accpath, name, value, size);
356
- else
357
- size = getxattr(accpath, name, value, size);
358
-
359
- if (size == -1) {
360
- archive_set_error(&a->archive, errno,
361
- "Couldn't read extended attribute");
362
- return (ARCHIVE_WARN);
363
- }
364
-
365
- archive_entry_xattr_add_entry(entry, name, value, size);
366
-
367
- free(value);
368
- return (ARCHIVE_OK);
369
- }
370
-
371
- static int
372
- setup_xattrs(struct archive_read_disk *a,
373
- struct archive_entry *entry, int fd)
374
- {
375
- char *list, *p;
376
- const char *path;
377
- ssize_t list_size;
378
-
379
-
380
- path = archive_entry_sourcepath(entry);
381
- if (path == NULL)
382
- path = archive_entry_pathname(entry);
383
-
384
- if (!a->follow_symlinks)
385
- list_size = llistxattr(path, NULL, 0);
386
- else
387
- list_size = listxattr(path, NULL, 0);
388
-
389
- if (list_size == -1) {
390
- if (errno == ENOTSUP)
391
- return (ARCHIVE_OK);
392
- archive_set_error(&a->archive, errno,
393
- "Couldn't list extended attributes");
394
- return (ARCHIVE_WARN);
395
- }
396
-
397
- if (list_size == 0)
398
- return (ARCHIVE_OK);
399
-
400
- if ((list = malloc(list_size)) == NULL) {
401
- archive_set_error(&a->archive, errno, "Out of memory");
402
- return (ARCHIVE_FATAL);
403
- }
404
-
405
- if (!a->follow_symlinks)
406
- list_size = llistxattr(path, list, list_size);
407
- else
408
- list_size = listxattr(path, list, list_size);
409
-
410
- if (list_size == -1) {
411
- archive_set_error(&a->archive, errno,
412
- "Couldn't retrieve extended attributes");
413
- free(list);
414
- return (ARCHIVE_WARN);
415
- }
416
-
417
- for (p = list; (p - list) < list_size; p += strlen(p) + 1) {
418
- if (strncmp(p, "system.", 7) == 0 ||
419
- strncmp(p, "xfsroot.", 8) == 0)
420
- continue;
421
- setup_xattr(a, entry, p, fd);
422
- }
423
-
424
- free(list);
425
- return (ARCHIVE_OK);
426
- }
427
-
428
- #elif HAVE_EXTATTR_GET_FILE && HAVE_EXTATTR_LIST_FILE && \
429
- HAVE_DECL_EXTATTR_NAMESPACE_USER
430
-
431
- /*
432
- * FreeBSD extattr interface.
433
- */
434
-
435
- /* TODO: Implement this. Follow the Linux model above, but
436
- * with FreeBSD-specific system calls, of course. Be careful
437
- * to not include the system extattrs that hold ACLs; we handle
438
- * those separately.
439
- */
440
- static int
441
- setup_xattr(struct archive_read_disk *a, struct archive_entry *entry,
442
- int namespace, const char *name, const char *fullname, int fd);
443
-
444
- static int
445
- setup_xattr(struct archive_read_disk *a, struct archive_entry *entry,
446
- int namespace, const char *name, const char *fullname, int fd)
447
- {
448
- ssize_t size;
449
- void *value = NULL;
450
- const char *accpath;
451
-
452
- (void)fd; /* UNUSED */
453
-
454
- accpath = archive_entry_sourcepath(entry);
455
- if (accpath == NULL)
456
- accpath = archive_entry_pathname(entry);
457
-
458
- if (!a->follow_symlinks)
459
- size = extattr_get_link(accpath, namespace, name, NULL, 0);
460
- else
461
- size = extattr_get_file(accpath, namespace, name, NULL, 0);
462
-
463
- if (size == -1) {
464
- archive_set_error(&a->archive, errno,
465
- "Couldn't query extended attribute");
466
- return (ARCHIVE_WARN);
467
- }
468
-
469
- if (size > 0 && (value = malloc(size)) == NULL) {
470
- archive_set_error(&a->archive, errno, "Out of memory");
471
- return (ARCHIVE_FATAL);
472
- }
473
-
474
- if (!a->follow_symlinks)
475
- size = extattr_get_link(accpath, namespace, name, value, size);
476
- else
477
- size = extattr_get_file(accpath, namespace, name, value, size);
478
-
479
- if (size == -1) {
480
- archive_set_error(&a->archive, errno,
481
- "Couldn't read extended attribute");
482
- return (ARCHIVE_WARN);
483
- }
484
-
485
- archive_entry_xattr_add_entry(entry, fullname, value, size);
486
-
487
- free(value);
488
- return (ARCHIVE_OK);
489
- }
490
-
491
- static int
492
- setup_xattrs(struct archive_read_disk *a,
493
- struct archive_entry *entry, int fd)
494
- {
495
- char buff[512];
496
- char *list, *p;
497
- ssize_t list_size;
498
- const char *path;
499
- int namespace = EXTATTR_NAMESPACE_USER;
500
-
501
- path = archive_entry_sourcepath(entry);
502
- if (path == NULL)
503
- path = archive_entry_pathname(entry);
504
-
505
- if (!a->follow_symlinks)
506
- list_size = extattr_list_link(path, namespace, NULL, 0);
507
- else
508
- list_size = extattr_list_file(path, namespace, NULL, 0);
509
-
510
- if (list_size == -1 && errno == EOPNOTSUPP)
511
- return (ARCHIVE_OK);
512
- if (list_size == -1) {
513
- archive_set_error(&a->archive, errno,
514
- "Couldn't list extended attributes");
515
- return (ARCHIVE_WARN);
516
- }
517
-
518
- if (list_size == 0)
519
- return (ARCHIVE_OK);
520
-
521
- if ((list = malloc(list_size)) == NULL) {
522
- archive_set_error(&a->archive, errno, "Out of memory");
523
- return (ARCHIVE_FATAL);
524
- }
525
-
526
- if (!a->follow_symlinks)
527
- list_size = extattr_list_link(path, namespace, list, list_size);
528
- else
529
- list_size = extattr_list_file(path, namespace, list, list_size);
530
-
531
- if (list_size == -1) {
532
- archive_set_error(&a->archive, errno,
533
- "Couldn't retrieve extended attributes");
534
- free(list);
535
- return (ARCHIVE_WARN);
536
- }
537
-
538
- p = list;
539
- while ((p - list) < list_size) {
540
- size_t len = 255 & (int)*p;
541
- char *name;
542
-
543
- strcpy(buff, "user.");
544
- name = buff + strlen(buff);
545
- memcpy(name, p + 1, len);
546
- name[len] = '\0';
547
- setup_xattr(a, entry, namespace, name, buff, fd);
548
- p += 1 + len;
549
- }
550
-
551
- free(list);
552
- return (ARCHIVE_OK);
553
- }
554
-
555
- #else
556
-
557
- /*
558
- * Generic (stub) extended attribute support.
559
- */
560
- static int
561
- setup_xattrs(struct archive_read_disk *a,
562
- struct archive_entry *entry, int fd)
563
- {
564
- (void)a; /* UNUSED */
565
- (void)entry; /* UNUSED */
566
- (void)fd; /* UNUSED */
567
- return (ARCHIVE_OK);
568
- }
569
-
570
- #endif