libarchive-static 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (157) hide show
  1. data/ext/Makefile +6 -0
  2. data/ext/extconf.rb +61 -0
  3. data/ext/libarchive-0.1.1/COPYING.libarchive +60 -0
  4. data/ext/libarchive-0.1.1/LICENSE.libbzip2 +42 -0
  5. data/ext/libarchive-0.1.1/README.txt +143 -0
  6. data/ext/libarchive-0.1.1/ext/Makefile.in +0 -0
  7. data/ext/libarchive-0.1.1/ext/archive_read_support_compression.c +31 -0
  8. data/ext/libarchive-0.1.1/ext/archive_read_support_compression.h +6 -0
  9. data/ext/libarchive-0.1.1/ext/archive_read_support_format.c +32 -0
  10. data/ext/libarchive-0.1.1/ext/archive_read_support_format.h +6 -0
  11. data/ext/libarchive-0.1.1/ext/archive_write_open_rb_str.c +29 -0
  12. data/ext/libarchive-0.1.1/ext/archive_write_open_rb_str.h +6 -0
  13. data/ext/libarchive-0.1.1/ext/archive_write_set_compression.c +32 -0
  14. data/ext/libarchive-0.1.1/ext/archive_write_set_compression.h +6 -0
  15. data/ext/libarchive-0.1.1/ext/config.h.in +22 -0
  16. data/ext/libarchive-0.1.1/ext/configure +3904 -0
  17. data/ext/libarchive-0.1.1/ext/configure.in +11 -0
  18. data/ext/libarchive-0.1.1/ext/depend +19 -0
  19. data/ext/libarchive-0.1.1/ext/extconf.rb +6 -0
  20. data/ext/libarchive-0.1.1/ext/install-sh +250 -0
  21. data/ext/libarchive-0.1.1/ext/libarchive.c +89 -0
  22. data/ext/libarchive-0.1.1/ext/libarchive_archive.c +84 -0
  23. data/ext/libarchive-0.1.1/ext/libarchive_entry.c +1015 -0
  24. data/ext/libarchive-0.1.1/ext/libarchive_internal.h +155 -0
  25. data/ext/libarchive-0.1.1/ext/libarchive_reader.c +328 -0
  26. data/ext/libarchive-0.1.1/ext/libarchive_win32.h +52 -0
  27. data/ext/libarchive-0.1.1/ext/libarchive_writer.c +246 -0
  28. data/ext/libarchive-0.1.1/libarchive.c +1762 -0
  29. data/ext/libarchive-2.8.4/Makefile.in +7076 -0
  30. data/ext/libarchive-2.8.4/build/autoconf/check_stdcall_func.m4 +51 -0
  31. data/ext/libarchive-2.8.4/build/autoconf/compile +143 -0
  32. data/ext/libarchive-2.8.4/build/autoconf/config.guess +1502 -0
  33. data/ext/libarchive-2.8.4/build/autoconf/config.sub +1708 -0
  34. data/ext/libarchive-2.8.4/build/autoconf/depcomp +630 -0
  35. data/ext/libarchive-2.8.4/build/autoconf/install-sh +291 -0
  36. data/ext/libarchive-2.8.4/build/autoconf/la_uid_t.m4 +20 -0
  37. data/ext/libarchive-2.8.4/build/autoconf/ltmain.sh +8406 -0
  38. data/ext/libarchive-2.8.4/build/autoconf/missing +376 -0
  39. data/ext/libarchive-2.8.4/build/pkgconfig/libarchive.pc.in +10 -0
  40. data/ext/libarchive-2.8.4/config.h.in +772 -0
  41. data/ext/libarchive-2.8.4/configure +17916 -0
  42. data/ext/libarchive-2.8.4/libarchive/archive.h +741 -0
  43. data/ext/libarchive-2.8.4/libarchive/archive_check_magic.c +134 -0
  44. data/ext/libarchive-2.8.4/libarchive/archive_crc32.h +66 -0
  45. data/ext/libarchive-2.8.4/libarchive/archive_endian.h +162 -0
  46. data/ext/libarchive-2.8.4/libarchive/archive_entry.c +2202 -0
  47. data/ext/libarchive-2.8.4/libarchive/archive_entry.h +524 -0
  48. data/ext/libarchive-2.8.4/libarchive/archive_entry_copy_bhfi.c +74 -0
  49. data/ext/libarchive-2.8.4/libarchive/archive_entry_copy_stat.c +77 -0
  50. data/ext/libarchive-2.8.4/libarchive/archive_entry_link_resolver.c +405 -0
  51. data/ext/libarchive-2.8.4/libarchive/archive_entry_private.h +184 -0
  52. data/ext/libarchive-2.8.4/libarchive/archive_entry_stat.c +118 -0
  53. data/ext/libarchive-2.8.4/libarchive/archive_entry_strmode.c +87 -0
  54. data/ext/libarchive-2.8.4/libarchive/archive_entry_xattr.c +158 -0
  55. data/ext/libarchive-2.8.4/libarchive/archive_hash.h +281 -0
  56. data/ext/libarchive-2.8.4/libarchive/archive_platform.h +165 -0
  57. data/ext/libarchive-2.8.4/libarchive/archive_private.h +124 -0
  58. data/ext/libarchive-2.8.4/libarchive/archive_read.c +1249 -0
  59. data/ext/libarchive-2.8.4/libarchive/archive_read_data_into_fd.c +93 -0
  60. data/ext/libarchive-2.8.4/libarchive/archive_read_disk.c +198 -0
  61. data/ext/libarchive-2.8.4/libarchive/archive_read_disk_entry_from_file.c +570 -0
  62. data/ext/libarchive-2.8.4/libarchive/archive_read_disk_private.h +62 -0
  63. data/ext/libarchive-2.8.4/libarchive/archive_read_disk_set_standard_lookup.c +303 -0
  64. data/ext/libarchive-2.8.4/libarchive/archive_read_extract.c +182 -0
  65. data/ext/libarchive-2.8.4/libarchive/archive_read_open_fd.c +190 -0
  66. data/ext/libarchive-2.8.4/libarchive/archive_read_open_file.c +165 -0
  67. data/ext/libarchive-2.8.4/libarchive/archive_read_open_filename.c +272 -0
  68. data/ext/libarchive-2.8.4/libarchive/archive_read_open_memory.c +156 -0
  69. data/ext/libarchive-2.8.4/libarchive/archive_read_private.h +199 -0
  70. data/ext/libarchive-2.8.4/libarchive/archive_read_support_compression_all.c +60 -0
  71. data/ext/libarchive-2.8.4/libarchive/archive_read_support_compression_bzip2.c +353 -0
  72. data/ext/libarchive-2.8.4/libarchive/archive_read_support_compression_compress.c +444 -0
  73. data/ext/libarchive-2.8.4/libarchive/archive_read_support_compression_gzip.c +465 -0
  74. data/ext/libarchive-2.8.4/libarchive/archive_read_support_compression_none.c +40 -0
  75. data/ext/libarchive-2.8.4/libarchive/archive_read_support_compression_program.c +459 -0
  76. data/ext/libarchive-2.8.4/libarchive/archive_read_support_compression_rpm.c +287 -0
  77. data/ext/libarchive-2.8.4/libarchive/archive_read_support_compression_uu.c +627 -0
  78. data/ext/libarchive-2.8.4/libarchive/archive_read_support_compression_xz.c +708 -0
  79. data/ext/libarchive-2.8.4/libarchive/archive_read_support_format_all.c +43 -0
  80. data/ext/libarchive-2.8.4/libarchive/archive_read_support_format_ar.c +584 -0
  81. data/ext/libarchive-2.8.4/libarchive/archive_read_support_format_cpio.c +777 -0
  82. data/ext/libarchive-2.8.4/libarchive/archive_read_support_format_empty.c +93 -0
  83. data/ext/libarchive-2.8.4/libarchive/archive_read_support_format_iso9660.c +2830 -0
  84. data/ext/libarchive-2.8.4/libarchive/archive_read_support_format_mtree.c +1304 -0
  85. data/ext/libarchive-2.8.4/libarchive/archive_read_support_format_raw.c +185 -0
  86. data/ext/libarchive-2.8.4/libarchive/archive_read_support_format_tar.c +2418 -0
  87. data/ext/libarchive-2.8.4/libarchive/archive_read_support_format_xar.c +3151 -0
  88. data/ext/libarchive-2.8.4/libarchive/archive_read_support_format_zip.c +903 -0
  89. data/ext/libarchive-2.8.4/libarchive/archive_string.c +453 -0
  90. data/ext/libarchive-2.8.4/libarchive/archive_string.h +148 -0
  91. data/ext/libarchive-2.8.4/libarchive/archive_string_sprintf.c +164 -0
  92. data/ext/libarchive-2.8.4/libarchive/archive_util.c +391 -0
  93. data/ext/libarchive-2.8.4/libarchive/archive_virtual.c +94 -0
  94. data/ext/libarchive-2.8.4/libarchive/archive_windows.c +1236 -0
  95. data/ext/libarchive-2.8.4/libarchive/archive_windows.h +347 -0
  96. data/ext/libarchive-2.8.4/libarchive/archive_write.c +466 -0
  97. data/ext/libarchive-2.8.4/libarchive/archive_write_disk.c +2628 -0
  98. data/ext/libarchive-2.8.4/libarchive/archive_write_disk_private.h +38 -0
  99. data/ext/libarchive-2.8.4/libarchive/archive_write_disk_set_standard_lookup.c +262 -0
  100. data/ext/libarchive-2.8.4/libarchive/archive_write_open_fd.c +141 -0
  101. data/ext/libarchive-2.8.4/libarchive/archive_write_open_file.c +105 -0
  102. data/ext/libarchive-2.8.4/libarchive/archive_write_open_filename.c +162 -0
  103. data/ext/libarchive-2.8.4/libarchive/archive_write_open_memory.c +126 -0
  104. data/ext/libarchive-2.8.4/libarchive/archive_write_private.h +122 -0
  105. data/ext/libarchive-2.8.4/libarchive/archive_write_set_compression_bzip2.c +408 -0
  106. data/ext/libarchive-2.8.4/libarchive/archive_write_set_compression_compress.c +492 -0
  107. data/ext/libarchive-2.8.4/libarchive/archive_write_set_compression_gzip.c +477 -0
  108. data/ext/libarchive-2.8.4/libarchive/archive_write_set_compression_none.c +257 -0
  109. data/ext/libarchive-2.8.4/libarchive/archive_write_set_compression_program.c +347 -0
  110. data/ext/libarchive-2.8.4/libarchive/archive_write_set_compression_xz.c +438 -0
  111. data/ext/libarchive-2.8.4/libarchive/archive_write_set_format.c +72 -0
  112. data/ext/libarchive-2.8.4/libarchive/archive_write_set_format_ar.c +550 -0
  113. data/ext/libarchive-2.8.4/libarchive/archive_write_set_format_by_name.c +76 -0
  114. data/ext/libarchive-2.8.4/libarchive/archive_write_set_format_cpio.c +344 -0
  115. data/ext/libarchive-2.8.4/libarchive/archive_write_set_format_cpio_newc.c +295 -0
  116. data/ext/libarchive-2.8.4/libarchive/archive_write_set_format_mtree.c +1050 -0
  117. data/ext/libarchive-2.8.4/libarchive/archive_write_set_format_pax.c +1386 -0
  118. data/ext/libarchive-2.8.4/libarchive/archive_write_set_format_shar.c +626 -0
  119. data/ext/libarchive-2.8.4/libarchive/archive_write_set_format_ustar.c +587 -0
  120. data/ext/libarchive-2.8.4/libarchive/archive_write_set_format_zip.c +667 -0
  121. data/ext/libarchive-2.8.4/libarchive/config_freebsd.h +154 -0
  122. data/ext/libarchive-2.8.4/libarchive/filter_fork.c +161 -0
  123. data/ext/libarchive-2.8.4/libarchive/filter_fork.h +41 -0
  124. data/ext/libarchive-2.8.4/libarchive/filter_fork_windows.c +113 -0
  125. data/ext/libarchive-static-makefile +80 -0
  126. data/ext/libarchive-static-wrapper-makefile +22 -0
  127. data/ext/zlib-1.2.5/Makefile.in +257 -0
  128. data/ext/zlib-1.2.5/adler32.c +169 -0
  129. data/ext/zlib-1.2.5/compress.c +80 -0
  130. data/ext/zlib-1.2.5/configure +596 -0
  131. data/ext/zlib-1.2.5/crc32.c +442 -0
  132. data/ext/zlib-1.2.5/crc32.h +441 -0
  133. data/ext/zlib-1.2.5/deflate.c +1834 -0
  134. data/ext/zlib-1.2.5/deflate.h +342 -0
  135. data/ext/zlib-1.2.5/example.c +565 -0
  136. data/ext/zlib-1.2.5/gzclose.c +25 -0
  137. data/ext/zlib-1.2.5/gzguts.h +132 -0
  138. data/ext/zlib-1.2.5/gzlib.c +537 -0
  139. data/ext/zlib-1.2.5/gzread.c +653 -0
  140. data/ext/zlib-1.2.5/gzwrite.c +531 -0
  141. data/ext/zlib-1.2.5/infback.c +632 -0
  142. data/ext/zlib-1.2.5/inffast.c +340 -0
  143. data/ext/zlib-1.2.5/inffast.h +11 -0
  144. data/ext/zlib-1.2.5/inffixed.h +94 -0
  145. data/ext/zlib-1.2.5/inflate.c +1480 -0
  146. data/ext/zlib-1.2.5/inflate.h +122 -0
  147. data/ext/zlib-1.2.5/inftrees.c +330 -0
  148. data/ext/zlib-1.2.5/inftrees.h +62 -0
  149. data/ext/zlib-1.2.5/minigzip.c +440 -0
  150. data/ext/zlib-1.2.5/trees.c +1244 -0
  151. data/ext/zlib-1.2.5/trees.h +128 -0
  152. data/ext/zlib-1.2.5/uncompr.c +59 -0
  153. data/ext/zlib-1.2.5/zconf.h +428 -0
  154. data/ext/zlib-1.2.5/zlib.h +1613 -0
  155. data/ext/zlib-1.2.5/zutil.c +318 -0
  156. data/ext/zlib-1.2.5/zutil.h +274 -0
  157. metadata +211 -0
@@ -0,0 +1,154 @@
1
+ /*-
2
+ * Copyright (c) 2003-2007 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
+ * $FreeBSD: head/lib/libarchive/config_freebsd.h 201079 2009-12-28 02:01:42Z kientzle $
26
+ */
27
+
28
+ /* FreeBSD 5.0 and later have ACL and extattr support. */
29
+ #if __FreeBSD__ > 4
30
+ #define HAVE_ACL_CREATE_ENTRY 1
31
+ #define HAVE_ACL_GET_LINK_NP 1
32
+ #define HAVE_ACL_GET_PERM_NP 1
33
+ #define HAVE_ACL_INIT 1
34
+ #define HAVE_ACL_SET_FD 1
35
+ #define HAVE_ACL_SET_FD_NP 1
36
+ #define HAVE_ACL_SET_FILE 1
37
+ #define HAVE_ACL_USER 1
38
+ #define HAVE_EXTATTR_GET_FILE 1
39
+ #define HAVE_EXTATTR_LIST_FILE 1
40
+ #define HAVE_EXTATTR_SET_FD 1
41
+ #define HAVE_EXTATTR_SET_FILE 1
42
+ #define HAVE_SYS_ACL_H 1
43
+ #define HAVE_SYS_EXTATTR_H 1
44
+ #endif
45
+
46
+ #ifdef WITH_OPENSSL
47
+ #define HAVE_OPENSSL_MD5_H 1
48
+ #define HAVE_OPENSSL_RIPEMD_H 1
49
+ #define HAVE_OPENSSL_SHA_H 1
50
+ #define HAVE_SHA384 1
51
+ #define HAVE_SHA512 1
52
+ #endif
53
+
54
+ #define HAVE_BSDXML_H 1
55
+ #define HAVE_BZLIB_H 1
56
+ #define HAVE_CHFLAGS 1
57
+ #define HAVE_CHOWN 1
58
+ #define HAVE_DECL_INT64_MAX 1
59
+ #define HAVE_DECL_INT64_MIN 1
60
+ #define HAVE_DECL_SIZE_MAX 1
61
+ #define HAVE_DECL_SSIZE_MAX 1
62
+ #define HAVE_DECL_STRERROR_R 1
63
+ #define HAVE_DECL_UINT32_MAX 1
64
+ #define HAVE_DECL_UINT64_MAX 1
65
+ #define HAVE_DIRENT_H 1
66
+ #define HAVE_EFTYPE 1
67
+ #define HAVE_EILSEQ 1
68
+ #define HAVE_ERRNO_H 1
69
+ #define HAVE_FCHDIR 1
70
+ #define HAVE_FCHFLAGS 1
71
+ #define HAVE_FCHMOD 1
72
+ #define HAVE_FCHOWN 1
73
+ #define HAVE_FCNTL 1
74
+ #define HAVE_FCNTL_H 1
75
+ #define HAVE_FSEEKO 1
76
+ #define HAVE_FSTAT 1
77
+ #define HAVE_FTRUNCATE 1
78
+ #define HAVE_FUTIMES 1
79
+ #define HAVE_GETEUID 1
80
+ #define HAVE_GETPID 1
81
+ #define HAVE_GRP_H 1
82
+ #define HAVE_INTTYPES_H 1
83
+ #define HAVE_LCHFLAGS 1
84
+ #define HAVE_LCHMOD 1
85
+ #define HAVE_LCHOWN 1
86
+ #define HAVE_LIMITS_H 1
87
+ #define HAVE_LINK 1
88
+ #define HAVE_LSTAT 1
89
+ #define HAVE_LUTIMES 1
90
+ #define HAVE_MALLOC 1
91
+ #define HAVE_MD5 1
92
+ #define HAVE_MD5_H 1
93
+ #define HAVE_MEMMOVE 1
94
+ #define HAVE_MKDIR 1
95
+ #define HAVE_MKFIFO 1
96
+ #define HAVE_MKNOD 1
97
+ #define HAVE_PIPE 1
98
+ #define HAVE_POLL 1
99
+ #define HAVE_POLL_H 1
100
+ #define HAVE_PWD_H 1
101
+ #define HAVE_READLINK 1
102
+ #define HAVE_RMD160 1
103
+ #define HAVE_SELECT 1
104
+ #define HAVE_SETENV 1
105
+ #define HAVE_SHA_H 1
106
+ #define HAVE_SHA1 1
107
+ #define HAVE_SHA256 1
108
+ #define HAVE_SHA256_H 1
109
+ #define HAVE_SIGNAL_H 1
110
+ #define HAVE_STDINT_H 1
111
+ #define HAVE_STDLIB_H 1
112
+ #define HAVE_STRCHR 1
113
+ #define HAVE_STRDUP 1
114
+ #define HAVE_STRERROR 1
115
+ #define HAVE_STRERROR_R 1
116
+ #define HAVE_STRINGS_H 1
117
+ #define HAVE_STRING_H 1
118
+ #define HAVE_STRRCHR 1
119
+ #define HAVE_STRUCT_STAT_ST_BLKSIZE 1
120
+ #define HAVE_STRUCT_STAT_ST_BIRTHTIME 1
121
+ #define HAVE_STRUCT_STAT_ST_BIRTHTIMESPEC_TV_NSEC 1
122
+ #define HAVE_STRUCT_STAT_ST_FLAGS 1
123
+ #define HAVE_STRUCT_STAT_ST_MTIMESPEC_TV_NSEC 1
124
+ #define HAVE_SYMLINK 1
125
+ #define HAVE_SYS_CDEFS_H 1
126
+ #define HAVE_SYS_IOCTL_H 1
127
+ #define HAVE_SYS_SELECT_H 1
128
+ #define HAVE_SYS_STAT_H 1
129
+ #define HAVE_SYS_TIME_H 1
130
+ #define HAVE_SYS_TYPES_H 1
131
+ #undef HAVE_SYS_UTIME_H
132
+ #define HAVE_SYS_WAIT_H 1
133
+ #define HAVE_TIMEGM 1
134
+ #define HAVE_TZSET 1
135
+ #define HAVE_UNISTD_H 1
136
+ #define HAVE_UNSETENV 1
137
+ #define HAVE_UTIME 1
138
+ #define HAVE_UTIMES 1
139
+ #define HAVE_UTIME_H 1
140
+ #define HAVE_VFORK 1
141
+ #define HAVE_WCHAR_H 1
142
+ #define HAVE_WCSCPY 1
143
+ #define HAVE_WCSLEN 1
144
+ #define HAVE_WCTOMB 1
145
+ #define HAVE_WMEMCMP 1
146
+ #define HAVE_WMEMCPY 1
147
+ #define HAVE_ZLIB_H 1
148
+ #define TIME_WITH_SYS_TIME 1
149
+
150
+ /* FreeBSD 4 and earlier lack intmax_t/uintmax_t */
151
+ #if __FreeBSD__ < 5
152
+ #define intmax_t int64_t
153
+ #define uintmax_t uint64_t
154
+ #endif
@@ -0,0 +1,161 @@
1
+ /*-
2
+ * Copyright (c) 2007 Joerg Sonnenberger
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
+
28
+ /* This capability is only available on POSIX systems. */
29
+ #if defined(HAVE_PIPE) && defined(HAVE_FCNTL) && \
30
+ (defined(HAVE_FORK) || defined(HAVE_VFORK))
31
+
32
+ __FBSDID("$FreeBSD: head/lib/libarchive/filter_fork.c 182958 2008-09-12 05:33:00Z kientzle $");
33
+
34
+ #if defined(HAVE_POLL) && (defined(HAVE_POLL_H) || defined(HAVE_SYS_POLL_H))
35
+ # if defined(HAVE_POLL_H)
36
+ # include <poll.h>
37
+ # elif defined(HAVE_SYS_POLL_H)
38
+ # include <sys/poll.h>
39
+ # endif
40
+ #elif defined(HAVE_SELECT)
41
+ # if defined(HAVE_SYS_SELECT_H)
42
+ # include <sys/select.h>
43
+ # elif defined(HAVE_UNISTD_H)
44
+ # include <unistd.h>
45
+ # endif
46
+ #endif
47
+ #ifdef HAVE_FCNTL_H
48
+ # include <fcntl.h>
49
+ #endif
50
+ #ifdef HAVE_UNISTD_H
51
+ # include <unistd.h>
52
+ #endif
53
+
54
+ #include "filter_fork.h"
55
+
56
+ pid_t
57
+ __archive_create_child(const char *path, int *child_stdin, int *child_stdout)
58
+ {
59
+ pid_t child;
60
+ int stdin_pipe[2], stdout_pipe[2], tmp;
61
+
62
+ if (pipe(stdin_pipe) == -1)
63
+ goto state_allocated;
64
+ if (stdin_pipe[0] == 1 /* stdout */) {
65
+ if ((tmp = dup(stdin_pipe[0])) == -1)
66
+ goto stdin_opened;
67
+ close(stdin_pipe[0]);
68
+ stdin_pipe[0] = tmp;
69
+ }
70
+ if (pipe(stdout_pipe) == -1)
71
+ goto stdin_opened;
72
+ if (stdout_pipe[1] == 0 /* stdin */) {
73
+ if ((tmp = dup(stdout_pipe[1])) == -1)
74
+ goto stdout_opened;
75
+ close(stdout_pipe[1]);
76
+ stdout_pipe[1] = tmp;
77
+ }
78
+
79
+ #if HAVE_VFORK
80
+ switch ((child = vfork())) {
81
+ #else
82
+ switch ((child = fork())) {
83
+ #endif
84
+ case -1:
85
+ goto stdout_opened;
86
+ case 0:
87
+ close(stdin_pipe[1]);
88
+ close(stdout_pipe[0]);
89
+ if (dup2(stdin_pipe[0], 0 /* stdin */) == -1)
90
+ _exit(254);
91
+ if (stdin_pipe[0] != 0 /* stdin */)
92
+ close(stdin_pipe[0]);
93
+ if (dup2(stdout_pipe[1], 1 /* stdout */) == -1)
94
+ _exit(254);
95
+ if (stdout_pipe[1] != 1 /* stdout */)
96
+ close(stdout_pipe[1]);
97
+ execlp(path, path, (char *)NULL);
98
+ _exit(254);
99
+ default:
100
+ close(stdin_pipe[0]);
101
+ close(stdout_pipe[1]);
102
+
103
+ *child_stdin = stdin_pipe[1];
104
+ fcntl(*child_stdin, F_SETFL, O_NONBLOCK);
105
+ *child_stdout = stdout_pipe[0];
106
+ fcntl(*child_stdout, F_SETFL, O_NONBLOCK);
107
+ }
108
+
109
+ return child;
110
+
111
+ stdout_opened:
112
+ close(stdout_pipe[0]);
113
+ close(stdout_pipe[1]);
114
+ stdin_opened:
115
+ close(stdin_pipe[0]);
116
+ close(stdin_pipe[1]);
117
+ state_allocated:
118
+ return -1;
119
+ }
120
+
121
+ void
122
+ __archive_check_child(int in, int out)
123
+ {
124
+ #if defined(HAVE_POLL) && (defined(HAVE_POLL_H) || defined(HAVE_SYS_POLL_H))
125
+ struct pollfd fds[2];
126
+ int idx;
127
+
128
+ idx = 0;
129
+ if (in != -1) {
130
+ fds[idx].fd = in;
131
+ fds[idx].events = POLLOUT;
132
+ ++idx;
133
+ }
134
+ if (out != -1) {
135
+ fds[idx].fd = out;
136
+ fds[idx].events = POLLIN;
137
+ ++idx;
138
+ }
139
+
140
+ poll(fds, idx, -1); /* -1 == INFTIM, wait forever */
141
+ #elif defined(HAVE_SELECT)
142
+ fd_set fds_in, fds_out, fds_error;
143
+
144
+ FD_ZERO(&fds_in);
145
+ FD_ZERO(&fds_out);
146
+ FD_ZERO(&fds_error);
147
+ if (out != -1) {
148
+ FD_SET(out, &fds_in);
149
+ FD_SET(out, &fds_error);
150
+ }
151
+ if (in != -1) {
152
+ FD_SET(in, &fds_out);
153
+ FD_SET(in, &fds_error);
154
+ }
155
+ select(in < out ? out + 1 : in + 1, &fds_in, &fds_out, &fds_error, NULL);
156
+ #else
157
+ sleep(1);
158
+ #endif
159
+ }
160
+
161
+ #endif /* defined(HAVE_PIPE) && defined(HAVE_VFORK) && defined(HAVE_FCNTL) */
@@ -0,0 +1,41 @@
1
+ /*-
2
+ * Copyright (c) 2007 Joerg Sonnenberger
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
+ * $FreeBSD: head/lib/libarchive/filter_fork.h 201087 2009-12-28 02:18:26Z kientzle $
26
+ */
27
+
28
+ #ifndef __LIBARCHIVE_BUILD
29
+ #error This header is only to be used internally to libarchive.
30
+ #endif
31
+
32
+ #ifndef FILTER_FORK_H
33
+ #define FILTER_FORK_H
34
+
35
+ pid_t
36
+ __archive_create_child(const char *path, int *child_stdin, int *child_stdout);
37
+
38
+ void
39
+ __archive_check_child(int in, int out);
40
+
41
+ #endif
@@ -0,0 +1,113 @@
1
+ /*-
2
+ * Copyright (c) 2009 Michihiro NAKAJIMA
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
+
28
+ #if defined(_WIN32) && !defined(__CYGWIN__)
29
+
30
+ #include "filter_fork.h"
31
+
32
+ pid_t
33
+ __archive_create_child(const char *path, int *child_stdin, int *child_stdout)
34
+ {
35
+ HANDLE childStdout[2], childStdin[2], childStdinWr, childStdoutRd;
36
+ SECURITY_ATTRIBUTES secAtts;
37
+ STARTUPINFO staInfo;
38
+ PROCESS_INFORMATION childInfo;
39
+ char cmd[MAX_PATH];
40
+ DWORD mode;
41
+
42
+ secAtts.nLength = sizeof(SECURITY_ATTRIBUTES);
43
+ secAtts.bInheritHandle = TRUE;
44
+ secAtts.lpSecurityDescriptor = NULL;
45
+ if (CreatePipe(&childStdout[0], &childStdout[1], &secAtts, 0) == 0)
46
+ goto fail;
47
+ if (DuplicateHandle(GetCurrentProcess(), childStdout[0],
48
+ GetCurrentProcess(), &childStdoutRd, 0, FALSE,
49
+ DUPLICATE_SAME_ACCESS) == 0) {
50
+ CloseHandle(childStdout[0]);
51
+ CloseHandle(childStdout[1]);
52
+ goto fail;
53
+ }
54
+ CloseHandle(childStdout[0]);
55
+
56
+ if (CreatePipe(&childStdin[0], &childStdin[1], &secAtts, 0) == 0) {
57
+ CloseHandle(childStdoutRd);
58
+ CloseHandle(childStdout[1]);
59
+ goto fail;
60
+ }
61
+
62
+ if (DuplicateHandle(GetCurrentProcess(), childStdin[1],
63
+ GetCurrentProcess(), &childStdinWr, 0, FALSE,
64
+ DUPLICATE_SAME_ACCESS) == 0) {
65
+ CloseHandle(childStdoutRd);
66
+ CloseHandle(childStdout[1]);
67
+ CloseHandle(childStdin[0]);
68
+ CloseHandle(childStdin[1]);
69
+ goto fail;
70
+ }
71
+ CloseHandle(childStdin[1]);
72
+
73
+ memset(&staInfo, 0, sizeof(staInfo));
74
+ staInfo.cb = sizeof(staInfo);
75
+ staInfo.hStdOutput = childStdout[1];
76
+ staInfo.hStdInput = childStdin[0];
77
+ staInfo.wShowWindow = SW_HIDE;
78
+ staInfo.dwFlags = STARTF_USEFILLATTRIBUTE | STARTF_USECOUNTCHARS |
79
+ STARTF_USESTDHANDLES | STARTF_USESHOWWINDOW;
80
+ strncpy(cmd, path, sizeof(cmd)-1);
81
+ cmd[sizeof(cmd)-1] = '\0';
82
+ if (CreateProcessA(NULL, cmd, NULL, NULL, TRUE, 0, NULL, NULL,
83
+ &staInfo, &childInfo) == 0) {
84
+ CloseHandle(childStdoutRd);
85
+ CloseHandle(childStdout[1]);
86
+ CloseHandle(childStdin[0]);
87
+ CloseHandle(childStdinWr);
88
+ goto fail;
89
+ }
90
+ WaitForInputIdle(childInfo.hProcess, INFINITE);
91
+ CloseHandle(childInfo.hProcess);
92
+ CloseHandle(childInfo.hThread);
93
+
94
+ mode = PIPE_NOWAIT;
95
+ SetNamedPipeHandleState(childStdoutRd, &mode, NULL, NULL);
96
+ *child_stdout = _open_osfhandle((intptr_t)childStdoutRd, _O_RDONLY);
97
+ *child_stdin = _open_osfhandle((intptr_t)childStdinWr, _O_WRONLY);
98
+
99
+ return (childInfo.dwProcessId);
100
+
101
+ fail:
102
+ return (-1);
103
+ }
104
+
105
+ void
106
+ __archive_check_child(int in, int out)
107
+ {
108
+ (void)in; /* UNSED */
109
+ (void)out; /* UNSED */
110
+ Sleep(100);
111
+ }
112
+
113
+ #endif /* _WIN32 && !__CYGWIN__ */
@@ -0,0 +1,80 @@
1
+ LIBARCHIVE_OBJS = \
2
+ archive_check_magic.o \
3
+ archive_entry.o \
4
+ archive_entry_copy_bhfi.o \
5
+ archive_entry_copy_stat.o \
6
+ archive_entry_link_resolver.o \
7
+ archive_entry_stat.o \
8
+ archive_entry_strmode.o \
9
+ archive_entry_xattr.o \
10
+ archive_read.o \
11
+ archive_read_data_into_fd.o \
12
+ archive_read_disk.o \
13
+ archive_read_disk_entry_from_file.o \
14
+ archive_read_disk_set_standard_lookup.o \
15
+ archive_read_extract.o \
16
+ archive_read_open_fd.o \
17
+ archive_read_open_file.o \
18
+ archive_read_open_filename.o \
19
+ archive_read_open_memory.o \
20
+ archive_read_support_compression_all.o \
21
+ archive_read_support_compression_bzip2.o \
22
+ archive_read_support_compression_compress.o \
23
+ archive_read_support_compression_gzip.o \
24
+ archive_read_support_compression_none.o \
25
+ archive_read_support_compression_program.o \
26
+ archive_read_support_compression_rpm.o \
27
+ archive_read_support_compression_uu.o \
28
+ archive_read_support_compression_xz.o \
29
+ archive_read_support_format_all.o \
30
+ archive_read_support_format_ar.o \
31
+ archive_read_support_format_cpio.o \
32
+ archive_read_support_format_empty.o \
33
+ archive_read_support_format_iso9660.o \
34
+ archive_read_support_format_mtree.o \
35
+ archive_read_support_format_raw.o \
36
+ archive_read_support_format_tar.o \
37
+ archive_read_support_format_xar.o \
38
+ archive_read_support_format_zip.o \
39
+ archive_string.o \
40
+ archive_string_sprintf.o \
41
+ archive_util.o \
42
+ archive_virtual.o \
43
+ archive_windows.o \
44
+ archive_write.o \
45
+ archive_write_disk.o \
46
+ archive_write_disk_set_standard_lookup.o \
47
+ archive_write_open_fd.o \
48
+ archive_write_open_file.o \
49
+ archive_write_open_filename.o \
50
+ archive_write_open_memory.o \
51
+ archive_write_set_compression_bzip2.o \
52
+ archive_write_set_compression_compress.o \
53
+ archive_write_set_compression_gzip.o \
54
+ archive_write_set_compression_none.o \
55
+ archive_write_set_compression_program.o \
56
+ archive_write_set_compression_xz.o \
57
+ archive_write_set_format.o \
58
+ archive_write_set_format_ar.o \
59
+ archive_write_set_format_by_name.o \
60
+ archive_write_set_format_cpio.o \
61
+ archive_write_set_format_cpio_newc.o \
62
+ archive_write_set_format_mtree.o \
63
+ archive_write_set_format_pax.o \
64
+ archive_write_set_format_shar.o \
65
+ archive_write_set_format_ustar.o \
66
+ archive_write_set_format_zip.o \
67
+ filter_fork.o \
68
+ filter_fork_windows.o
69
+
70
+ .c.o:
71
+ gcc -DHAVE_CONFIG_H -I.. $(CFLAGS) -g -O2 -MD -MP -c -DPIC $<
72
+
73
+ libarchive.a: $(LIBARCHIVE_OBJS)
74
+ ar cru libarchive.a $^ $(LIBZLIB_A)
75
+
76
+ clean:
77
+ rm -f *.o *.d libarchive.a
78
+
79
+ veryclean: clean
80
+ rm -f Makefile config.h
@@ -0,0 +1,22 @@
1
+ LIBARCHIVE_WRAPPER_OBJS = \
2
+ archive_read_support_compression.o \
3
+ archive_read_support_format.o \
4
+ archive_write_open_rb_str.o \
5
+ archive_write_set_compression.o \
6
+ libarchive.o \
7
+ libarchive_archive.o \
8
+ libarchive_entry.o \
9
+ libarchive_reader.o \
10
+ libarchive_writer.o
11
+
12
+ .c.o:
13
+ gcc $(CFLAGS) -I. -I../../libarchive-2.8.4/libarchive -DLIBARCHIVE_STATIC -DHAVE_CONFIG_H -DHAVE_ARCHIVE_H -DHAVE_ARCHIVE_ENTRY_H -O3 -g -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-initializers -Wno-long-long -c -DPIC $<
14
+
15
+ libarchive_ruby.so: $(LIBARCHIVE_WRAPPER_OBJS)
16
+ gcc -shared -s -o libarchive_ruby.so $^ $(LDFLAGS)
17
+
18
+ clean:
19
+ rm -f *.o libarchive_ruby.so
20
+
21
+ veryclean: clean
22
+ rm -f Makefile config.h