mirror of
https://github.com/libarchive/libarchive.git
synced 2026-01-27 09:54:38 +00:00
Compare commits
493 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8d1c9b95f1 | ||
|
|
dea03d6e00 | ||
|
|
3cd503b75a | ||
|
|
86851e3092 | ||
|
|
02eba33825 | ||
|
|
0bb2058bd5 | ||
|
|
e663efb430 | ||
|
|
3ff73fdfce | ||
|
|
e91171c9a0 | ||
|
|
7f27446a51 | ||
|
|
090fbc3655 | ||
|
|
8c2241a7e4 | ||
|
|
d54b2241b9 | ||
|
|
782cdd88b6 | ||
|
|
d1b87af584 | ||
|
|
9a089dc44a | ||
|
|
a55b8e8aec | ||
|
|
76558692a4 | ||
|
|
4a32d9ff7f | ||
|
|
998c0b4080 | ||
|
|
030a93817c | ||
|
|
9298dc503a | ||
|
|
e54c735586 | ||
|
|
b2d68e2f1a | ||
|
|
1cd0b9179c | ||
|
|
095609e89b | ||
|
|
5c84afd664 | ||
|
|
f366e98107 | ||
|
|
c4597a73f3 | ||
|
|
79fac84eb2 | ||
|
|
8042630d4f | ||
|
|
214ee3edc7 | ||
|
|
eb6f992ba1 | ||
|
|
544b07541b | ||
|
|
5e88593708 | ||
|
|
8f3fcf9ecd | ||
|
|
6e77f521fa | ||
|
|
50a67c9223 | ||
|
|
b39f91e5da | ||
|
|
55fbf225c8 | ||
|
|
e75e5892fd | ||
|
|
784b778f3b | ||
|
|
b51e59bcfb | ||
|
|
a7f3b56af6 | ||
|
|
cfb02de558 | ||
|
|
8295366f94 | ||
|
|
8c86c46d1b | ||
|
|
752df6abb7 | ||
|
|
728b43c0c1 | ||
|
|
0a594ab77d | ||
|
|
a819cc2829 | ||
|
|
1b9b42720f | ||
|
|
827905c93f | ||
|
|
aac59c1bd5 | ||
|
|
f49372e945 | ||
|
|
8ef2084104 | ||
|
|
e17f169356 | ||
|
|
47809f10bf | ||
|
|
81bc00a549 | ||
|
|
3150539edb | ||
|
|
8f7d334646 | ||
|
|
12522911fa | ||
|
|
1890755ab2 | ||
|
|
35aac8a925 | ||
|
|
fdec8c2f24 | ||
|
|
2df76f52c2 | ||
|
|
ce7b3f1c15 | ||
|
|
dbacda991c | ||
|
|
2caee6a37e | ||
|
|
d5bd2dfafe | ||
|
|
e1c3061b12 | ||
|
|
c2333a511d | ||
|
|
d8fba4df3a | ||
|
|
f75b5ddab0 | ||
|
|
02a76f2dc9 | ||
|
|
c5cc510145 | ||
|
|
ab09af7304 | ||
|
|
e929454ec8 | ||
|
|
3aa9c22ddf | ||
|
|
daf5abf802 | ||
|
|
f18a754d02 | ||
|
|
3396ba84d7 | ||
|
|
26c769ecdc | ||
|
|
45a873e998 | ||
|
|
fa5f70627c | ||
|
|
c45a07854d | ||
|
|
f80b1ae294 | ||
|
|
1435c4b20c | ||
|
|
989a303793 | ||
|
|
f02961f402 | ||
|
|
dc6c0c5f35 | ||
|
|
ce614c6524 | ||
|
|
8855146220 | ||
|
|
edbada88c0 | ||
|
|
212426e751 | ||
|
|
83c30ee813 | ||
|
|
d2e861769c | ||
|
|
89cbfe1028 | ||
|
|
1c08abc60d | ||
|
|
8fff509f1a | ||
|
|
d0f69b355d | ||
|
|
7976476c9f | ||
|
|
51b3e14257 | ||
|
|
33ac104169 | ||
|
|
de73860cda | ||
|
|
d207d816d0 | ||
|
|
12cdd35f31 | ||
|
|
e12c955dca | ||
|
|
46fe318edd | ||
|
|
582799ee57 | ||
|
|
b12d1c14d1 | ||
|
|
6d8e1a883c | ||
|
|
eb54a4d869 | ||
|
|
fda50c79ba | ||
|
|
372e709c1a | ||
|
|
4ecf62fbd7 | ||
|
|
c34ff01c02 | ||
|
|
2d987e725f | ||
|
|
7fdf32b6b2 | ||
|
|
98731ad500 | ||
|
|
be31ad37f3 | ||
|
|
619e22cae7 | ||
|
|
52bf0d7de0 | ||
|
|
36a530973a | ||
|
|
39dc43b3e0 | ||
|
|
638464b477 | ||
|
|
ab5cb61f49 | ||
|
|
38debf6be1 | ||
|
|
e1dea559c7 | ||
|
|
96f76577d3 | ||
|
|
e5c2eb783b | ||
|
|
a3787a34a8 | ||
|
|
a2933fbefd | ||
|
|
123d92bc3a | ||
|
|
ff3a0c37aa | ||
|
|
589659ed7f | ||
|
|
52db141ece | ||
|
|
3b1100f9a9 | ||
|
|
6bd863f612 | ||
|
|
4768f38535 | ||
|
|
3a072e0bb0 | ||
|
|
06191cd287 | ||
|
|
53135ca48e | ||
|
|
37ab51c2d3 | ||
|
|
ab4d21e4cb | ||
|
|
f12d80442c | ||
|
|
892f331450 | ||
|
|
bf50fe0538 | ||
|
|
2db13f7422 | ||
|
|
93f9e93d73 | ||
|
|
12ffcef28c | ||
|
|
02ebfb5a48 | ||
|
|
e099b418e3 | ||
|
|
6a008e524e | ||
|
|
835fe1133f | ||
|
|
466a2b5c7b | ||
|
|
640c9feced | ||
|
|
9e7af6f21c | ||
|
|
652a0c107b | ||
|
|
980b541632 | ||
|
|
8b3d3ee99b | ||
|
|
fb859e6d3f | ||
|
|
da65b39c06 | ||
|
|
e47c315f51 | ||
|
|
cb403667d7 | ||
|
|
0ff100c8d3 | ||
|
|
3bf1035e67 | ||
|
|
a335429c5e | ||
|
|
23ee781520 | ||
|
|
64bcf69ef8 | ||
|
|
ecce46744f | ||
|
|
6062470cbc | ||
|
|
aa1fc90ae5 | ||
|
|
d1418af239 | ||
|
|
cc97338239 | ||
|
|
ed2ada78a6 | ||
|
|
4dfaf2d359 | ||
|
|
cb6b9e9a28 | ||
|
|
d2d72ac78a | ||
|
|
b57d14f9c9 | ||
|
|
267042ebc7 | ||
|
|
a3d261a29a | ||
|
|
3c646995db | ||
|
|
7b59a6b693 | ||
|
|
e559754d6d | ||
|
|
82e247fe7c | ||
|
|
eff524fa4e | ||
|
|
84e8f3c98e | ||
|
|
4035fca93a | ||
|
|
3997a5f28a | ||
|
|
d01dc496d3 | ||
|
|
d06700a098 | ||
|
|
2db02ae6ae | ||
|
|
595fb29e4c | ||
|
|
609d8122f1 | ||
|
|
31cff981e4 | ||
|
|
d8aaf88c9f | ||
|
|
ee49ac8106 | ||
|
|
9fe18ba0a6 | ||
|
|
cd020d1ccb | ||
|
|
a474bab7e3 | ||
|
|
489d0b8e2f | ||
|
|
1e4b84ed30 | ||
|
|
50d44b4202 | ||
|
|
b1b3709cae | ||
|
|
ffde04f272 | ||
|
|
fd4ecc0146 | ||
|
|
a218a52dbb | ||
|
|
0de62cbda8 | ||
|
|
e4978e2edd | ||
|
|
40a89c7379 | ||
|
|
6a252c84a2 | ||
|
|
4984c652db | ||
|
|
664a20b6c7 | ||
|
|
b7066d4a6b | ||
|
|
6effe2ec6b | ||
|
|
251f7e839c | ||
|
|
47bdf82489 | ||
|
|
c3be70e071 | ||
|
|
9bdc5b82f7 | ||
|
|
475423a154 | ||
|
|
864c904442 | ||
|
|
dcf5475661 | ||
|
|
90c1e32a0d | ||
|
|
c0691458a0 | ||
|
|
75ef803092 | ||
|
|
0931c12b7e | ||
|
|
b1839a20e5 | ||
|
|
f3949062ed | ||
|
|
cdb45d71b2 | ||
|
|
fa85c7eaae | ||
|
|
aa69d34311 | ||
|
|
5a60d8cda4 | ||
|
|
ac66e0bc42 | ||
|
|
f2c3c790ff | ||
|
|
b7e1c617cb | ||
|
|
c40a3887ab | ||
|
|
9836e7e2fe | ||
|
|
a8f93f2480 | ||
|
|
b76c4042ae | ||
|
|
36bac92cd2 | ||
|
|
2764062e65 | ||
|
|
13700e1fb8 | ||
|
|
d7d1d19bb6 | ||
|
|
0f9a06d6ab | ||
|
|
1311a438a3 | ||
|
|
70978468e9 | ||
|
|
c7b7bd7c0e | ||
|
|
8d074302ac | ||
|
|
e1ca935c00 | ||
|
|
e1c0f9a660 | ||
|
|
20b4a4cb7c | ||
|
|
101230094c | ||
|
|
8540cb7cfb | ||
|
|
e2eda9e68b | ||
|
|
9ac39a0168 | ||
|
|
0a320b6a37 | ||
|
|
f90d036057 | ||
|
|
65d0393f24 | ||
|
|
e70e24a738 | ||
|
|
9b07a143ee | ||
|
|
cd5c44c5d0 | ||
|
|
2ed2db55e8 | ||
|
|
59b09796c3 | ||
|
|
d261f46ae5 | ||
|
|
dcdd7338d6 | ||
|
|
702f31a01c | ||
|
|
ebca997192 | ||
|
|
9d07162b08 | ||
|
|
33d3528723 | ||
|
|
715f7eac02 | ||
|
|
51b4c35bb3 | ||
|
|
6389d172ed | ||
|
|
ac96967e36 | ||
|
|
341dd5d1d4 | ||
|
|
18d456377e | ||
|
|
bc5f0884e3 | ||
|
|
101646e34e | ||
|
|
b6e1f06457 | ||
|
|
0685c77e83 | ||
|
|
5bb36db5e1 | ||
|
|
42c2f84649 | ||
|
|
6dbea2df3b | ||
|
|
a5d9c9a7cd | ||
|
|
cdc185e917 | ||
|
|
8b978a0368 | ||
|
|
bef52da622 | ||
|
|
8b763d872c | ||
|
|
51e66d32c6 | ||
|
|
4223b4c548 | ||
|
|
612223356e | ||
|
|
0ed4435209 | ||
|
|
992734d6cc | ||
|
|
627ba5bbbf | ||
|
|
2cdf47f332 | ||
|
|
d8ff8dd62c | ||
|
|
d6f6fdf979 | ||
|
|
38ac49553d | ||
|
|
9eacf09a86 | ||
|
|
0ddaa5f71c | ||
|
|
2961b132d0 | ||
|
|
182726d16a | ||
|
|
714e357b97 | ||
|
|
d80d734190 | ||
|
|
352b710754 | ||
|
|
6976a252aa | ||
|
|
a4f0571fb6 | ||
|
|
b921c8673b | ||
|
|
2c1ee4d2b1 | ||
|
|
9f4c179c3f | ||
|
|
fd2130b970 | ||
|
|
bde1c16393 | ||
|
|
b1348fbfab | ||
|
|
cfc1f3a9da | ||
|
|
17a63c7e35 | ||
|
|
51793de834 | ||
|
|
23f414385e | ||
|
|
0a4e506f3e | ||
|
|
3b4bf62fbd | ||
|
|
fe41cec3da | ||
|
|
ead8cd69bd | ||
|
|
5c61984652 | ||
|
|
3128f04f58 | ||
|
|
fbd168bd2a | ||
|
|
6b2c5e0ba4 | ||
|
|
fc4964751f | ||
|
|
6dd27bc4a3 | ||
|
|
0e88bc1ecc | ||
|
|
ea49bb3057 | ||
|
|
7b0c8a62cc | ||
|
|
981fd9afed | ||
|
|
1b9c075735 | ||
|
|
c2d06848ea | ||
|
|
f3f2aaf0ac | ||
|
|
d1a260932c | ||
|
|
0e15b864c1 | ||
|
|
3f1e45d146 | ||
|
|
c7203f805d | ||
|
|
00d559e4b9 | ||
|
|
428167e750 | ||
|
|
6b97a57e8e | ||
|
|
c26f037745 | ||
|
|
84ac71335f | ||
|
|
293c8bb992 | ||
|
|
63d7c24eea | ||
|
|
b50b8a42f6 | ||
|
|
1667b31d0b | ||
|
|
a612bf62f8 | ||
|
|
09685126fc | ||
|
|
c8dc3bcb47 | ||
|
|
5d2a788e41 | ||
|
|
16fd043f51 | ||
|
|
1ba83d4b3f | ||
|
|
1d7eadf417 | ||
|
|
3e4683f5c4 | ||
|
|
2b8db0f82d | ||
|
|
4f4e0e4b70 | ||
|
|
e744746cc1 | ||
|
|
761e2f3c1e | ||
|
|
966010ce79 | ||
|
|
7c02cde37a | ||
|
|
be8d08868c | ||
|
|
dcbf1e0ede | ||
|
|
f96497248e | ||
|
|
948a52d672 | ||
|
|
e1c8c9ef64 | ||
|
|
8f49a18f64 | ||
|
|
992a596290 | ||
|
|
da6bc7bf27 | ||
|
|
95c386317f | ||
|
|
4c0b3618a4 | ||
|
|
ef09372952 | ||
|
|
b580147278 | ||
|
|
ea9fd828dc | ||
|
|
81c43ea168 | ||
|
|
89b8c35ff4 | ||
|
|
fed3712d6e | ||
|
|
1b6009d17b | ||
|
|
29fd918e18 | ||
|
|
3a5a34b821 | ||
|
|
6bb0952602 | ||
|
|
4237b476fd | ||
|
|
9ad0e27f53 | ||
|
|
2c2266432f | ||
|
|
f8a34abfbb | ||
|
|
a323e5fa68 | ||
|
|
a88e09a370 | ||
|
|
09a2ed4853 | ||
|
|
03e15babd6 | ||
|
|
c9bc934e7e | ||
|
|
52e0bfd750 | ||
|
|
de77e6d671 | ||
|
|
3512329ba9 | ||
|
|
21f74252f2 | ||
|
|
b6f6557abb | ||
|
|
447201758e | ||
|
|
65196fdd1a | ||
|
|
27588eba50 | ||
|
|
42565b88b5 | ||
|
|
743bbe9769 | ||
|
|
7708713b63 | ||
|
|
a186d9662b | ||
|
|
14b8803c40 | ||
|
|
25c3d9afea | ||
|
|
982747fd66 | ||
|
|
adc54b374e | ||
|
|
ef3f9c45d5 | ||
|
|
1427f3431d | ||
|
|
edcae6c164 | ||
|
|
561b6430fd | ||
|
|
4ce9c2f4be | ||
|
|
dc5e1405b6 | ||
|
|
a2086b67d8 | ||
|
|
14221c7ba2 | ||
|
|
28cb5064d8 | ||
|
|
a659a44a85 | ||
|
|
b557c1f161 | ||
|
|
12517fa78d | ||
|
|
4d5106f2b5 | ||
|
|
4ebca5ff83 | ||
|
|
e6d8a479b1 | ||
|
|
0acaa2994a | ||
|
|
35da265cc3 | ||
|
|
0d1ac07d3f | ||
|
|
a17bded84a | ||
|
|
e99c6d69f1 | ||
|
|
af4a3562cd | ||
|
|
1f6cdd4625 | ||
|
|
72bbf9ec25 | ||
|
|
819a50a043 | ||
|
|
ee9b638fba | ||
|
|
b0d48940f8 | ||
|
|
6516cd137e | ||
|
|
8291210321 | ||
|
|
7efa99bdb1 | ||
|
|
8ac45a813e | ||
|
|
ba76798136 | ||
|
|
29802f6a5e | ||
|
|
0bbbe2883e | ||
|
|
9b7540aaf1 | ||
|
|
f745a848d7 | ||
|
|
819c5b01a9 | ||
|
|
b5d95321d4 | ||
|
|
68238f28ee | ||
|
|
84ad874530 | ||
|
|
cbfe4d9e6d | ||
|
|
e37d378186 | ||
|
|
d60f3ea1b3 | ||
|
|
974b59113d | ||
|
|
e36d6fe935 | ||
|
|
87fa733679 | ||
|
|
2cea675da2 | ||
|
|
043b6feeef | ||
|
|
206df6192c | ||
|
|
ea56096020 | ||
|
|
e619342dfa | ||
|
|
ae23713ceb | ||
|
|
15c686c55f | ||
|
|
755af84301 | ||
|
|
ac43e8e3fe | ||
|
|
40ff837717 | ||
|
|
d8c3b97b31 | ||
|
|
971c043a1d | ||
|
|
295f47a074 | ||
|
|
aada018f05 | ||
|
|
6287b99eb7 | ||
|
|
b8d7e074c1 | ||
|
|
e2c512a59f | ||
|
|
c0ce80b970 | ||
|
|
3343bb8a28 | ||
|
|
10c817cdc3 | ||
|
|
2121da4bbb | ||
|
|
6177e4d0c0 | ||
|
|
e4068fb87c | ||
|
|
94da78b084 | ||
|
|
565b5aea49 | ||
|
|
b34c1f4def | ||
|
|
35e630174e | ||
|
|
41a2d01453 | ||
|
|
08ab094ea7 | ||
|
|
a65f765f17 | ||
|
|
d6dd082adf | ||
|
|
62ce582d1c | ||
|
|
9d5289ae9e | ||
|
|
a90e9d84ec | ||
|
|
2fd35b0fdb | ||
|
|
6567375f27 | ||
|
|
4b6dd229c6 | ||
|
|
75cdc59470 | ||
|
|
fa7e9cd7cb | ||
|
|
7c3980367e | ||
|
|
e939c97a57 | ||
|
|
915c9f83a4 |
28
.cirrus.yml
28
.cirrus.yml
@ -1,3 +1,4 @@
|
||||
---
|
||||
env:
|
||||
CIRRUS_CLONE_DEPTH: 1
|
||||
ARCH: amd64
|
||||
@ -9,22 +10,33 @@ FreeBSD_task:
|
||||
env:
|
||||
BS: cmake
|
||||
matrix:
|
||||
freebsd_instance:
|
||||
image_family: freebsd-14-0
|
||||
freebsd_instance:
|
||||
image_family: freebsd-13-3
|
||||
- name: 15.0-STABLE (UFS)
|
||||
freebsd_instance:
|
||||
image_family: freebsd-15-0-amd64-ufs-snap
|
||||
- name: 15.0-RELEASE (UFS)
|
||||
freebsd_instance:
|
||||
image_family: freebsd-15-0-amd64-ufs
|
||||
- name: 15.0-RELEASE (ZFS)
|
||||
freebsd_instance:
|
||||
image_family: freebsd-15-0-amd64-zfs
|
||||
- name: 14.3-RELEASE
|
||||
freebsd_instance:
|
||||
image_family: freebsd-14-3
|
||||
- name: 13.5-RELEASE
|
||||
freebsd_instance:
|
||||
image_family: freebsd-13-5
|
||||
prepare_script:
|
||||
- ./build/ci/cirrus_ci/ci.sh prepare
|
||||
configure_script:
|
||||
- env CFLAGS=-I/usr/local/include LDFLAGS=-L/usr/local/lib ./build/ci/build.sh -a autogen
|
||||
- env CFLAGS=-I/usr/local/include LDFLAGS=-L/usr/local/lib ./build/ci/build.sh -a configure
|
||||
- env MAKE=gmake CFLAGS=-I/usr/local/include LDFLAGS=-L/usr/local/lib ./build/ci/build.sh -a configure
|
||||
build_script:
|
||||
- env MAKE_ARGS="-j 2" ./build/ci/build.sh -a build
|
||||
- env MAKE=gmake MAKE_ARGS="-j 2" ./build/ci/build.sh -a build
|
||||
test_script:
|
||||
- env SKIP_TEST_RESTORE_ATIME=1 MAKE_ARGS="-j 2" ./build/ci/build.sh -a test
|
||||
- env MAKE=gmake SKIP_TEST_RESTORE_ATIME=1 MAKE_ARGS="-j 2" ./build/ci/build.sh -a test
|
||||
- ./build/ci/cirrus_ci/ci.sh test
|
||||
install_script:
|
||||
- env MAKE_ARGS="-j 2" ./build/ci/build.sh -a install
|
||||
- env MAKE=gmake MAKE_ARGS="-j 2" ./build/ci/build.sh -a install
|
||||
|
||||
Windows_Cygwin_task:
|
||||
windows_container:
|
||||
|
||||
36
.github/workflows/ci.yml
vendored
36
.github/workflows/ci.yml
vendored
@ -7,14 +7,14 @@ permissions:
|
||||
|
||||
jobs:
|
||||
MacOS:
|
||||
runs-on: macos-13
|
||||
runs-on: macos-15
|
||||
strategy:
|
||||
matrix:
|
||||
bs: [autotools, cmake]
|
||||
steps:
|
||||
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
|
||||
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
||||
- name: Install dependencies
|
||||
run: ./build/ci/github_actions/macos.sh prepare
|
||||
run: ./build/ci/github_actions/install-macos-dependencies.sh
|
||||
- name: Autogen
|
||||
run: ./build/ci/build.sh -a autogen
|
||||
env:
|
||||
@ -23,41 +23,43 @@ jobs:
|
||||
run: ./build/ci/build.sh -a configure
|
||||
env:
|
||||
BS: ${{ matrix.bs }}
|
||||
# Avoid using liblzma from the Xcode 16 / MacOSX15.0.sdk, which fails RISCV filter tests.
|
||||
CMAKE_ARGS: -D LIBLZMA_LIBRARY=/opt/homebrew/lib/liblzma.dylib -D LIBLZMA_INCLUDE_DIR=/opt/homebrew/include/lzma.h
|
||||
- name: Build
|
||||
run: ./build/ci/build.sh -a build
|
||||
env:
|
||||
BS: ${{ matrix.bs }}
|
||||
MAKE_ARGS: -j
|
||||
MAKE_ARGS: -j3
|
||||
- name: Test
|
||||
run: ./build/ci/build.sh -a test
|
||||
env:
|
||||
BS: ${{ matrix.bs }}
|
||||
SKIP_OPEN_FD_ERR_TEST: 1
|
||||
IGNORE_TRAVERSALS_TEST4: 1
|
||||
MAKE_ARGS: -j
|
||||
MAKE_ARGS: -j3
|
||||
CTEST_OUTPUT_ON_FAILURE: ON
|
||||
- name: Install
|
||||
run: ./build/ci/build.sh -a install
|
||||
env:
|
||||
BS: ${{ matrix.bs }}
|
||||
MAKE_ARGS: -j
|
||||
MAKE_ARGS: -j3
|
||||
- name: Artifact
|
||||
run: ./build/ci/build.sh -a artifact
|
||||
env:
|
||||
BS: ${{ matrix.bs }}
|
||||
- uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
|
||||
- uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
|
||||
with:
|
||||
name: libarchive-macos-${{ matrix.bs }}-${{ github.sha }}
|
||||
path: libarchive.tar.xz
|
||||
|
||||
Ubuntu:
|
||||
runs-on: ubuntu-22.04
|
||||
runs-on: ubuntu-24.04
|
||||
strategy:
|
||||
matrix:
|
||||
bs: [autotools, cmake]
|
||||
crypto: [mbedtls, nettle, openssl]
|
||||
steps:
|
||||
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
|
||||
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
||||
- name: Update apt cache
|
||||
run: sudo apt-get update
|
||||
- name: Install dependencies
|
||||
@ -75,13 +77,13 @@ jobs:
|
||||
run: ./build/ci/build.sh -a build
|
||||
env:
|
||||
BS: ${{ matrix.bs }}
|
||||
MAKE_ARGS: -j
|
||||
MAKE_ARGS: -j4
|
||||
- name: Test
|
||||
run: ./build/ci/build.sh -a test
|
||||
env:
|
||||
BS: ${{ matrix.bs }}
|
||||
SKIP_OPEN_FD_ERR_TEST: 1
|
||||
MAKE_ARGS: -j
|
||||
MAKE_ARGS: -j4
|
||||
CTEST_OUTPUT_ON_FAILURE: ON
|
||||
- name: Install
|
||||
run: ./build/ci/build.sh -a install
|
||||
@ -91,14 +93,14 @@ jobs:
|
||||
run: ./build/ci/build.sh -a artifact
|
||||
env:
|
||||
BS: ${{ matrix.bs }}
|
||||
- uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
|
||||
- uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
|
||||
with:
|
||||
name: libarchive-ubuntu-${{ matrix.bs }}-${{ matrix.crypto }}-${{ github.sha }}
|
||||
path: libarchive.tar.xz
|
||||
Ubuntu-distcheck:
|
||||
runs-on: ubuntu-22.04
|
||||
runs-on: ubuntu-24.04
|
||||
steps:
|
||||
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
|
||||
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
||||
- name: Update package definitions
|
||||
run: sudo apt-get update
|
||||
- name: Install dependencies
|
||||
@ -113,7 +115,7 @@ jobs:
|
||||
SKIP_OPEN_FD_ERR_TEST: 1
|
||||
- name: Dist-Artifact
|
||||
run: ./build/ci/build.sh -a dist-artifact
|
||||
- uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
|
||||
- uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
|
||||
with:
|
||||
name: libarchive-${{ github.sha }}
|
||||
path: libarchive-dist.tar
|
||||
@ -125,7 +127,7 @@ jobs:
|
||||
matrix:
|
||||
be: [mingw-gcc, msvc]
|
||||
steps:
|
||||
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
|
||||
- uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
||||
- name: Install mingw
|
||||
if: ${{ matrix.be=='mingw-gcc' }}
|
||||
run: choco install mingw
|
||||
@ -161,7 +163,7 @@ jobs:
|
||||
shell: cmd
|
||||
env:
|
||||
BE: ${{ matrix.be }}
|
||||
- uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
|
||||
- uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
|
||||
with:
|
||||
name: libarchive-windows-${{ matrix.be }}-${{ github.sha }}
|
||||
path: libarchive.zip
|
||||
|
||||
2
.github/workflows/cifuzz.yml
vendored
2
.github/workflows/cifuzz.yml
vendored
@ -21,7 +21,7 @@ jobs:
|
||||
fuzz-seconds: 600
|
||||
dry-run: false
|
||||
- name: Upload Crash
|
||||
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
|
||||
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
|
||||
if: failure() && steps.build.outcome == 'success'
|
||||
with:
|
||||
name: artifacts
|
||||
|
||||
8
.github/workflows/codeql.yml
vendored
8
.github/workflows/codeql.yml
vendored
@ -26,18 +26,18 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
|
||||
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
||||
|
||||
- name: Initialize CodeQL
|
||||
uses: github/codeql-action/init@9fdb3e49720b44c48891d036bb502feb25684276 # v3.25.6
|
||||
uses: github/codeql-action/init@5d4e8d1aca955e8d8589aabd499c5cae939e33c7 # v4.31.9
|
||||
with:
|
||||
languages: ${{ matrix.language }}
|
||||
queries: +security-and-quality
|
||||
|
||||
- name: Autobuild
|
||||
uses: github/codeql-action/autobuild@9fdb3e49720b44c48891d036bb502feb25684276 # v3.25.6
|
||||
uses: github/codeql-action/autobuild@5d4e8d1aca955e8d8589aabd499c5cae939e33c7 # v4.31.9
|
||||
|
||||
- name: Perform CodeQL Analysis
|
||||
uses: github/codeql-action/analyze@9fdb3e49720b44c48891d036bb502feb25684276 # v3.25.6
|
||||
uses: github/codeql-action/analyze@5d4e8d1aca955e8d8589aabd499c5cae939e33c7 # v4.31.9
|
||||
with:
|
||||
category: "/language:${{ matrix.language }}"
|
||||
|
||||
8
.github/workflows/scorecard.yml
vendored
8
.github/workflows/scorecard.yml
vendored
@ -29,12 +29,12 @@ jobs:
|
||||
|
||||
steps:
|
||||
- name: "Checkout code"
|
||||
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
|
||||
uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6.0.1
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: "Run analysis"
|
||||
uses: ossf/scorecard-action@dc50aa9510b46c811795eb24b2f1ba02a914e534 # v2.3.3
|
||||
uses: ossf/scorecard-action@4eaacf0543bb3f2c246792bd56e8cdeffafb205a # v2.4.3
|
||||
with:
|
||||
results_file: results.sarif
|
||||
results_format: sarif
|
||||
@ -52,7 +52,7 @@ jobs:
|
||||
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
|
||||
# format to the repository Actions tab.
|
||||
- name: "Upload artifact"
|
||||
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
|
||||
uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
|
||||
with:
|
||||
name: SARIF file
|
||||
path: results.sarif
|
||||
@ -60,6 +60,6 @@ jobs:
|
||||
|
||||
# Upload the results to GitHub's code scanning dashboard.
|
||||
- name: "Upload to code-scanning"
|
||||
uses: github/codeql-action/upload-sarif@9fdb3e49720b44c48891d036bb502feb25684276 # v3.25.6
|
||||
uses: github/codeql-action/upload-sarif@5d4e8d1aca955e8d8589aabd499c5cae939e33c7 # v4.31.9
|
||||
with:
|
||||
sarif_file: results.sarif
|
||||
|
||||
254
CMakeLists.txt
254
CMakeLists.txt
@ -1,21 +1,11 @@
|
||||
#
|
||||
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12 FATAL_ERROR)
|
||||
if(APPLE AND CMAKE_VERSION VERSION_LESS "3.17.0")
|
||||
message(WARNING "CMake>=3.17.0 required to make the generated shared library have the same Mach-O headers as autotools")
|
||||
endif()
|
||||
cmake_minimum_required(VERSION 3.17 FATAL_ERROR)
|
||||
|
||||
if(POLICY CMP0065)
|
||||
cmake_policy(SET CMP0065 NEW) #3.4 don't use `-rdynamic` with executables
|
||||
endif()
|
||||
if(POLICY CMP0074)
|
||||
cmake_policy(SET CMP0074 NEW) #3.12.0 `find_package()`` uses ``<PackageName>_ROOT`` variables.
|
||||
endif()
|
||||
if(POLICY CMP0075)
|
||||
cmake_policy(SET CMP0075 NEW) #3.12.0 `check_include_file()`` and friends use ``CMAKE_REQUIRED_LIBRARIES``.
|
||||
endif()
|
||||
#
|
||||
PROJECT(libarchive C)
|
||||
#
|
||||
# Include standard installation directories
|
||||
include(GNUInstallDirs)
|
||||
#
|
||||
SET(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/build/cmake")
|
||||
if(NOT CMAKE_RUNTIME_OUTPUT_DIRECTORY)
|
||||
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${libarchive_BINARY_DIR}/bin)
|
||||
@ -29,7 +19,7 @@ endif()
|
||||
# MinSizeRel : Release Min Size build
|
||||
# None : No build type
|
||||
IF(NOT CMAKE_BUILD_TYPE)
|
||||
SET(CMAKE_BUILD_TYPE "Release" CACHE STRING "Build Type" FORCE)
|
||||
SET(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Build Type" FORCE)
|
||||
ENDIF(NOT CMAKE_BUILD_TYPE)
|
||||
# Set a value type to properly display CMAKE_BUILD_TYPE on GUI if the
|
||||
# value type is "UNINITIALIZED".
|
||||
@ -107,6 +97,9 @@ set(MACHO_CURRENT_VERSION "${MACHO_COMPATIBILITY_VERSION}.${_revision}")
|
||||
# saving and restoring the state of the variables.
|
||||
INCLUDE(CMakePushCheckState)
|
||||
|
||||
# Enable the pkg-config helpers.
|
||||
INCLUDE(FindPkgConfig)
|
||||
|
||||
# Initialize the state of the variables. This initialization is not
|
||||
# necessary but this shows you what value the variables initially have.
|
||||
SET(CMAKE_REQUIRED_DEFINITIONS)
|
||||
@ -146,7 +139,12 @@ IF (CMAKE_C_COMPILER_ID MATCHES "^GNU$" OR
|
||||
# either of the following two, yet neither is supported as of 3.0.2
|
||||
# - check_linker_flag - does not exist
|
||||
# - try_compile - does not support linker flags
|
||||
IF(NOT CMAKE_SYSTEM_NAME MATCHES "Darwin")
|
||||
IF(CMAKE_SYSTEM_NAME MATCHES "Darwin")
|
||||
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-dead_strip")
|
||||
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-dead_strip")
|
||||
ELSEIF(CMAKE_SYSTEM_NAME MATCHES "SunOS")
|
||||
# SunOS linker doesn't support --gc-sections
|
||||
ELSE()
|
||||
# Place the functions and data into separate sections, allowing the linker
|
||||
# to garbage collect the unused ones.
|
||||
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ffunction-sections -fdata-sections")
|
||||
@ -155,10 +153,7 @@ IF (CMAKE_C_COMPILER_ID MATCHES "^GNU$" OR
|
||||
# Printing the discarded section is "too much", so enable on demand.
|
||||
#SET(CMAKE_EXE_LINKER_FLAGS_DEBUG "${CMAKE_EXE_LINKER_FLAGS_DEBUG} -Wl,--print-gc-sections")
|
||||
#SET(CMAKE_SHARED_LINKER_FLAGS_DEBUG "${CMAKE_SHARED_LINKER_FLAGS_DEBUG} -Wl,--print-gc-sections")
|
||||
ELSE()
|
||||
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-dead_strip")
|
||||
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-dead_strip")
|
||||
ENDIF(NOT CMAKE_SYSTEM_NAME MATCHES "Darwin")
|
||||
ENDIF()
|
||||
ENDIF (CMAKE_C_COMPILER_ID MATCHES "^GNU$" OR
|
||||
CMAKE_C_COMPILER_ID MATCHES "^Clang$" AND NOT MSVC)
|
||||
IF (CMAKE_C_COMPILER_ID MATCHES "^XL$")
|
||||
@ -238,6 +233,7 @@ OPTION(ENABLE_ZLIB "Enable the use of the system ZLIB library if found" ON)
|
||||
OPTION(ENABLE_BZip2 "Enable the use of the system BZip2 library if found" ON)
|
||||
OPTION(ENABLE_LIBXML2 "Enable the use of the system libxml2 library if found" ON)
|
||||
OPTION(ENABLE_EXPAT "Enable the use of the system EXPAT library if found" ON)
|
||||
OPTION(ENABLE_WIN32_XMLLITE "Enable the use of the Windows XmlLite library if found" ON)
|
||||
OPTION(ENABLE_PCREPOSIX "Enable the use of the system PCREPOSIX library if found" ON)
|
||||
OPTION(ENABLE_PCRE2POSIX "Enable the use of the system PCRE2POSIX library if found" ON)
|
||||
OPTION(ENABLE_LIBGCC "Enable the use of the system LibGCC library if found" ON)
|
||||
@ -264,6 +260,10 @@ OPTION(ENABLE_TEST "Enable unit and regression tests" ON)
|
||||
OPTION(ENABLE_COVERAGE "Enable code coverage (GCC only, automatically sets ENABLE_TEST to ON)" FALSE)
|
||||
OPTION(ENABLE_INSTALL "Enable installing of libraries" ON)
|
||||
|
||||
IF(WIN32 AND MSVC)
|
||||
OPTION(MSVC_USE_STATIC_CRT "Use static CRT" OFF)
|
||||
ENDIF()
|
||||
|
||||
SET(POSIX_REGEX_LIB "AUTO" CACHE STRING "Choose what library should provide POSIX regular expression support")
|
||||
SET(ENABLE_SAFESEH "AUTO" CACHE STRING "Enable use of /SAFESEH linker flag (MSVC only)")
|
||||
SET(WINDOWS_VERSION "WIN10" CACHE STRING "Set Windows version to use (Windows only)")
|
||||
@ -293,18 +293,6 @@ IF(WIN32)
|
||||
SET(NTDDI_VERSION 0x06000100)
|
||||
SET(_WIN32_WINNT 0x0600)
|
||||
SET(WINVER 0x0600)
|
||||
ELSEIF(WINDOWS_VERSION STREQUAL "VISTA")
|
||||
SET(NTDDI_VERSION 0x06000000)
|
||||
SET(_WIN32_WINNT 0x0600)
|
||||
SET(WINVER 0x0600)
|
||||
ELSEIF(WINDOWS_VERSION STREQUAL "WS03")
|
||||
SET(NTDDI_VERSION 0x05020000)
|
||||
SET(_WIN32_WINNT 0x0502)
|
||||
SET(WINVER 0x0502)
|
||||
ELSEIF(WINDOWS_VERSION STREQUAL "WINXP")
|
||||
SET(NTDDI_VERSION 0x05010000)
|
||||
SET(_WIN32_WINNT 0x0501)
|
||||
SET(WINVER 0x0501)
|
||||
ELSE(WINDOWS_VERSION STREQUAL "WIN10")
|
||||
# Default to Windows Server 2003 API if we don't recognize the specifier
|
||||
SET(NTDDI_VERSION 0x05020000)
|
||||
@ -378,10 +366,12 @@ ENDMACRO (GENERATE_LIST_H)
|
||||
# Generate installation rules for man pages.
|
||||
#
|
||||
MACRO (INSTALL_MAN __mans)
|
||||
FOREACH (_man ${ARGV})
|
||||
STRING(REGEX REPLACE "^.+[.]([1-9])" "\\1" _mansect ${_man})
|
||||
INSTALL(FILES ${_man} DESTINATION "share/man/man${_mansect}")
|
||||
ENDFOREACH (_man)
|
||||
IF(ENABLE_INSTALL)
|
||||
FOREACH (_man ${ARGV})
|
||||
STRING(REGEX REPLACE "^.+[.]([1-9])" "\\1" _mansect ${_man})
|
||||
INSTALL(FILES ${_man} DESTINATION "share/man/man${_mansect}")
|
||||
ENDFOREACH (_man)
|
||||
ENDIF(ENABLE_INSTALL)
|
||||
ENDMACRO (INSTALL_MAN __mans)
|
||||
#
|
||||
# Find out what macro is needed to use libraries on Windows.
|
||||
@ -606,6 +596,7 @@ IF(ENABLE_LIBB2)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LIBB2 DEFAULT_MSG LIBB2_LIBRARY LIBB2_INCLUDE_DIR)
|
||||
ELSE(ENABLE_LIBB2)
|
||||
SET(LIBB2_FOUND FALSE) # Override cached value
|
||||
UNSET(LIBB2_PKGCONFIG_VERSION CACHE)
|
||||
ENDIF(ENABLE_LIBB2)
|
||||
IF(LIBB2_FOUND)
|
||||
SET(HAVE_LIBB2 1)
|
||||
@ -618,8 +609,13 @@ IF(LIBB2_FOUND)
|
||||
SET(CMAKE_REQUIRED_INCLUDES ${LIBB2_INCLUDE_DIR})
|
||||
CHECK_FUNCTION_EXISTS(blake2sp_init HAVE_LIBB2)
|
||||
CMAKE_POP_CHECK_STATE()
|
||||
pkg_check_modules(LIBB2 libb2)
|
||||
IF(LIBB2_VERSION)
|
||||
SET(LIBB2_PKGCONFIG_VERSION LIBB2_VERSION)
|
||||
ENDIF(LIBB2_VERSION)
|
||||
ELSE(LIBB2_FOUND)
|
||||
SET(ARCHIVE_BLAKE2 TRUE)
|
||||
UNSET(LIBB2_PKGCONFIG_VERSION CACHE)
|
||||
ENDIF(LIBB2_FOUND)
|
||||
#
|
||||
# Find LZ4
|
||||
@ -682,6 +678,7 @@ IF(ZSTD_FOUND)
|
||||
SET(CMAKE_REQUIRED_INCLUDES ${ZSTD_INCLUDE_DIR})
|
||||
CHECK_FUNCTION_EXISTS(ZSTD_decompressStream HAVE_LIBZSTD)
|
||||
CHECK_FUNCTION_EXISTS(ZSTD_compressStream HAVE_ZSTD_compressStream)
|
||||
CHECK_FUNCTION_EXISTS(ZSTD_minCLevel HAVE_ZSTD_minCLevel)
|
||||
#
|
||||
# TODO: test for static library.
|
||||
#
|
||||
@ -690,7 +687,6 @@ ENDIF(ZSTD_FOUND)
|
||||
MARK_AS_ADVANCED(CLEAR ZSTD_INCLUDE_DIR)
|
||||
MARK_AS_ADVANCED(CLEAR ZSTD_LIBRARY)
|
||||
|
||||
|
||||
#
|
||||
# Check headers
|
||||
#
|
||||
@ -784,12 +780,22 @@ IF(ENABLE_CNG)
|
||||
LA_CHECK_INCLUDE_FILE("bcrypt.h" HAVE_BCRYPT_H)
|
||||
IF(HAVE_BCRYPT_H)
|
||||
LIST(APPEND ADDITIONAL_LIBS "bcrypt")
|
||||
# bcrypt supports these algorithms on all available versions
|
||||
SET(ARCHIVE_CRYPTO_MD5 1)
|
||||
SET(ARCHIVE_CRYPTO_MD5_WIN 1)
|
||||
SET(ARCHIVE_CRYPTO_SHA1 1)
|
||||
SET(ARCHIVE_CRYPTO_SHA1_WIN 1)
|
||||
SET(ARCHIVE_CRYPTO_SHA256 1)
|
||||
SET(ARCHIVE_CRYPTO_SHA256_WIN 1)
|
||||
SET(ARCHIVE_CRYPTO_SHA384 1)
|
||||
SET(ARCHIVE_CRYPTO_SHA384_WIN 1)
|
||||
SET(ARCHIVE_CRYPTO_SHA512 1)
|
||||
SET(ARCHIVE_CRYPTO_SHA512_WIN 1)
|
||||
ENDIF(HAVE_BCRYPT_H)
|
||||
ELSE(ENABLE_CNG)
|
||||
UNSET(HAVE_BCRYPT_H CACHE)
|
||||
ENDIF(ENABLE_CNG)
|
||||
# Following files need windows.h, so we should test it after windows.h test.
|
||||
LA_CHECK_INCLUDE_FILE("wincrypt.h" HAVE_WINCRYPT_H)
|
||||
LA_CHECK_INCLUDE_FILE("winioctl.h" HAVE_WINIOCTL_H)
|
||||
|
||||
#
|
||||
@ -821,7 +827,7 @@ IF(ENABLE_MBEDTLS)
|
||||
LA_CHECK_INCLUDE_FILE("mbedtls/aes.h" HAVE_MBEDTLS_AES_H)
|
||||
LA_CHECK_INCLUDE_FILE("mbedtls/md.h" HAVE_MBEDTLS_MD_H)
|
||||
LA_CHECK_INCLUDE_FILE("mbedtls/pkcs5.h" HAVE_MBEDTLS_PKCS5_H)
|
||||
|
||||
LA_CHECK_INCLUDE_FILE("mbedtls/version.h" HAVE_MBEDTLS_VERSION_H)
|
||||
ENDIF(MBEDTLS_FOUND)
|
||||
MARK_AS_ADVANCED(CLEAR MBEDTLS_INCLUDE_DIRS)
|
||||
MARK_AS_ADVANCED(CLEAR MBEDCRYPTO_LIBRARY)
|
||||
@ -844,7 +850,7 @@ IF(ENABLE_NETTLE)
|
||||
LA_CHECK_INCLUDE_FILE("nettle/pbkdf2.h" HAVE_NETTLE_PBKDF2_H)
|
||||
LA_CHECK_INCLUDE_FILE("nettle/ripemd160.h" HAVE_NETTLE_RIPEMD160_H)
|
||||
LA_CHECK_INCLUDE_FILE("nettle/sha.h" HAVE_NETTLE_SHA_H)
|
||||
|
||||
LA_CHECK_INCLUDE_FILE("nettle/version.h" HAVE_NETTLE_VERSION_H)
|
||||
ENDIF(NETTLE_FOUND)
|
||||
MARK_AS_ADVANCED(CLEAR NETTLE_INCLUDE_DIR)
|
||||
MARK_AS_ADVANCED(CLEAR NETTLE_LIBRARIES)
|
||||
@ -863,6 +869,7 @@ IF(ENABLE_OPENSSL AND NOT CMAKE_SYSTEM_NAME MATCHES "Darwin")
|
||||
SET(CMAKE_REQUIRED_LIBRARIES ${OPENSSL_CRYPTO_LIBRARY})
|
||||
SET(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR})
|
||||
LA_CHECK_INCLUDE_FILE("openssl/evp.h" HAVE_OPENSSL_EVP_H)
|
||||
LA_CHECK_INCLUDE_FILE("openssl/opensslv.h" HAVE_OPENSSL_OPENSSLV_H)
|
||||
CHECK_FUNCTION_EXISTS(PKCS5_PBKDF2_HMAC_SHA1 HAVE_PKCS5_PBKDF2_HMAC_SHA1)
|
||||
ENDIF(OPENSSL_FOUND)
|
||||
ELSE()
|
||||
@ -881,6 +888,14 @@ IF(NOT OPENSSL_FOUND)
|
||||
ENDIF(LIBMD_FOUND)
|
||||
ENDIF(NOT OPENSSL_FOUND)
|
||||
|
||||
# libbsd for readpassphrase on Haiku
|
||||
IF("${CMAKE_SYSTEM_NAME}" MATCHES "Haiku")
|
||||
MESSAGE(STATUS "Adding libbsd for Haiku")
|
||||
SET(CMAKE_REQUIRED_LIBRARIES "bsd")
|
||||
FIND_LIBRARY(LIBBSD_LIBRARY NAMES bsd)
|
||||
LIST(APPEND ADDITIONAL_LIBS ${LIBBSD_LIBRARY})
|
||||
ENDIF("${CMAKE_SYSTEM_NAME}" MATCHES "Haiku")
|
||||
|
||||
#
|
||||
# How to prove that CRYPTO functions, which have several names on various
|
||||
# platforms, just see if archive_digest.c can compile and link against
|
||||
@ -989,86 +1004,6 @@ main(int argc, char **argv)
|
||||
ENDFOREACH(ALGORITHM ${ALGORITHMS})
|
||||
ENDMACRO(CHECK_CRYPTO ALGORITHMS IMPLEMENTATION)
|
||||
|
||||
#
|
||||
# CRYPTO functions on Windows is defined at archive_windows.c, thus we do not
|
||||
# need the test what the functions can be mapped to archive_{crypto name}_init,
|
||||
# archive_{crypto name}_update and archive_{crypto name}_final.
|
||||
# The functions on Windows use CALG_{crypto name} macro to create a crypt object
|
||||
# and then we need to know what CALG_{crypto name} macros is available to show
|
||||
# ARCHIVE_CRYPTO_{crypto name}_WIN macros because Windows 2000 and earlier version
|
||||
# of Windows XP do not support SHA256, SHA384 and SHA512.
|
||||
#
|
||||
MACRO(CHECK_CRYPTO_WIN CRYPTO_LIST)
|
||||
IF(WIN32 AND NOT CYGWIN)
|
||||
FOREACH(CRYPTO ${CRYPTO_LIST})
|
||||
IF(NOT ARCHIVE_CRYPTO_${CRYPTO})
|
||||
IF(NOT DEFINED ARCHIVE_CRYPTO_${CRYPTO}_WIN)
|
||||
STRING(TOUPPER "${CRYPTO}" crypto)
|
||||
SET(ALGID "")
|
||||
IF ("${CRYPTO}" MATCHES "^MD5$")
|
||||
SET(ALGID "CALG_MD5")
|
||||
ENDIF ("${CRYPTO}" MATCHES "^MD5$")
|
||||
IF ("${CRYPTO}" MATCHES "^SHA1$")
|
||||
SET(ALGID "CALG_SHA1")
|
||||
ENDIF ("${CRYPTO}" MATCHES "^SHA1$")
|
||||
IF ("${CRYPTO}" MATCHES "^SHA256$")
|
||||
SET(ALGID "CALG_SHA_256")
|
||||
ENDIF ("${CRYPTO}" MATCHES "^SHA256$")
|
||||
IF ("${CRYPTO}" MATCHES "^SHA384$")
|
||||
SET(ALGID "CALG_SHA_384")
|
||||
ENDIF ("${CRYPTO}" MATCHES "^SHA384$")
|
||||
IF ("${CRYPTO}" MATCHES "^SHA512$")
|
||||
SET(ALGID "CALG_SHA_512")
|
||||
ENDIF ("${CRYPTO}" MATCHES "^SHA512$")
|
||||
|
||||
CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/build/cmake/config.h.in
|
||||
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/confdefs.h)
|
||||
FILE(READ "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/confdefs.h"
|
||||
CONFDEFS_H)
|
||||
|
||||
SET(SOURCE "${CONFDEFS_H}
|
||||
|
||||
#define ${crypto}_COMPILE_TEST
|
||||
#include <windows.h>
|
||||
#include <wincrypt.h>
|
||||
|
||||
int
|
||||
main(int argc, char **argv)
|
||||
{
|
||||
return ${ALGID};
|
||||
}
|
||||
")
|
||||
SET(SOURCE_FILE "${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeTmp/check_crypto_win.c")
|
||||
|
||||
FILE(WRITE "${SOURCE_FILE}" "${SOURCE}")
|
||||
MESSAGE(STATUS "Checking support for ARCHIVE_CRYPTO_${CRYPTO}_WIN")
|
||||
|
||||
TRY_COMPILE(ARCHIVE_CRYPTO_${CRYPTO}_WIN
|
||||
${CMAKE_BINARY_DIR}
|
||||
${SOURCE_FILE}
|
||||
CMAKE_FLAGS "-DINCLUDE_DIRECTORIES:STRING=${CMAKE_BINARY_DIR};${CMAKE_CURRENT_SOURCE_DIR}/libarchive"
|
||||
OUTPUT_VARIABLE OUTPUT)
|
||||
|
||||
IF (ARCHIVE_CRYPTO_${CRYPTO}_WIN)
|
||||
MESSAGE(STATUS
|
||||
"Checking support for ARCHIVE_CRYPTO_${CRYPTO}_WIN -- found")
|
||||
SET(ARCHIVE_CRYPTO_${CRYPTO} 1)
|
||||
ELSE (ARCHIVE_CRYPTO_${CRYPTO}_WIN)
|
||||
MESSAGE(STATUS
|
||||
"Checking support for ARCHIVE_CRYPTO_${CRYPTO}_WIN -- not found")
|
||||
FILE(APPEND
|
||||
${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log
|
||||
"Checking support for ARCHIVE_CRYPTO_${CRYPTO}_WIN failed with the following output:\n"
|
||||
"${OUTPUT}\n"
|
||||
"Source file was:\n${SOURCE}\n")
|
||||
ENDIF (ARCHIVE_CRYPTO_${CRYPTO}_WIN)
|
||||
|
||||
ENDIF(NOT DEFINED ARCHIVE_CRYPTO_${CRYPTO}_WIN)
|
||||
ENDIF(NOT ARCHIVE_CRYPTO_${CRYPTO})
|
||||
ENDFOREACH(CRYPTO)
|
||||
ENDIF(WIN32 AND NOT CYGWIN)
|
||||
ENDMACRO(CHECK_CRYPTO_WIN CRYPTO_LIST)
|
||||
|
||||
#
|
||||
# Find iconv
|
||||
# POSIX defines the second arg as const char **
|
||||
@ -1083,8 +1018,8 @@ MACRO(CHECK_ICONV LIB TRY_ICONV_CONST)
|
||||
CMAKE_C_COMPILER_ID MATCHES "^Clang$")
|
||||
#
|
||||
# During checking iconv proto type, we should use -Werror to avoid the
|
||||
# success of iconv detection with a warning which success is a miss
|
||||
# detection. So this needs for all build mode(even it's a release mode).
|
||||
# success of iconv detection with a warning, which would be a false
|
||||
# positive. So this is needed for all build modes, even in release mode.
|
||||
#
|
||||
SET(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -Werror")
|
||||
ENDIF (CMAKE_C_COMPILER_ID MATCHES "^GNU$" OR
|
||||
@ -1155,6 +1090,7 @@ IF(ENABLE_ICONV)
|
||||
CHECK_ICONV("libiconv" "const")
|
||||
CHECK_ICONV("libiconv" "")
|
||||
IF (HAVE_ICONV)
|
||||
SET(HAVE_LIBICONV 1)
|
||||
LIST(APPEND ADDITIONAL_LIBS ${LIBICONV_PATH})
|
||||
ENDIF(HAVE_ICONV)
|
||||
ENDIF(NOT HAVE_ICONV AND LIBICONV_PATH)
|
||||
@ -1198,6 +1134,7 @@ ELSE(ENABLE_ICONV)
|
||||
# (once enabled).
|
||||
UNSET(HAVE_LOCALE_CHARSET CACHE)
|
||||
UNSET(HAVE_ICONV CACHE)
|
||||
UNSET(HAVE_LIBICONV CACHE)
|
||||
UNSET(HAVE_ICONV_libc_ CACHE)
|
||||
UNSET(HAVE_ICONV_libc_const CACHE)
|
||||
UNSET(HAVE_ICONV_libiconv_ CACHE)
|
||||
@ -1227,6 +1164,7 @@ IF(LIBXML2_FOUND)
|
||||
SET(CMAKE_REQUIRED_INCLUDES ${ICONV_INCLUDE_DIR} ${LIBXML2_INCLUDE_DIR})
|
||||
CHECK_INCLUDE_FILES("libxml/xmlreader.h" HAVE_LIBXML_XMLREADER_H)
|
||||
CHECK_INCLUDE_FILES("libxml/xmlwriter.h" HAVE_LIBXML_XMLWRITER_H)
|
||||
CHECK_INCLUDE_FILES("libxml/xmlversion.h" HAVE_LIBXML_XMLVERSION_H)
|
||||
# Test if a macro is needed for the library.
|
||||
TRY_MACRO_FOR_LIBRARY(
|
||||
"${ICONV_INCLUDE_DIR};${LIBXML2_INCLUDE_DIR}"
|
||||
@ -1254,6 +1192,25 @@ ELSE(LIBXML2_FOUND)
|
||||
SET(HAVE_LIBEXPAT 1)
|
||||
LA_CHECK_INCLUDE_FILE("expat.h" HAVE_EXPAT_H)
|
||||
CMAKE_POP_CHECK_STATE() # Restore the state of the variables
|
||||
ELSE(EXPAT_FOUND)
|
||||
IF(WIN32 AND ENABLE_WIN32_XMLLITE)
|
||||
# Check linkage as well; versions of mingw-w64 before v11.0.0
|
||||
# do not contain an import library for xmllite.
|
||||
cmake_push_check_state()
|
||||
SET(CMAKE_REQUIRED_LIBRARIES "xmllite" "uuid")
|
||||
check_c_source_compiles("
|
||||
#include <initguid.h>
|
||||
#include <xmllite.h>
|
||||
int main() {
|
||||
return CreateXmlReader(&IID_IXmlReader, NULL, NULL);
|
||||
}
|
||||
" HAVE_XMLLITE_H)
|
||||
cmake_pop_check_state()
|
||||
IF(HAVE_XMLLITE_H)
|
||||
SET(XMLLITE_FOUND TRUE)
|
||||
LIST(APPEND ADDITIONAL_LIBS "xmllite" "uuid")
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
ENDIF(EXPAT_FOUND)
|
||||
ENDIF(LIBXML2_FOUND)
|
||||
MARK_AS_ADVANCED(CLEAR LIBXML2_INCLUDE_DIR)
|
||||
@ -1455,6 +1412,8 @@ CHECK_FUNCTION_EXISTS_GLIBC(arc4random_buf HAVE_ARC4RANDOM_BUF)
|
||||
CHECK_FUNCTION_EXISTS_GLIBC(chflags HAVE_CHFLAGS)
|
||||
CHECK_FUNCTION_EXISTS_GLIBC(chown HAVE_CHOWN)
|
||||
CHECK_FUNCTION_EXISTS_GLIBC(chroot HAVE_CHROOT)
|
||||
CHECK_FUNCTION_EXISTS_GLIBC(closefrom HAVE_CLOSEFROM)
|
||||
CHECK_FUNCTION_EXISTS_GLIBC(close_range HAVE_CLOSE_RANGE)
|
||||
CHECK_FUNCTION_EXISTS_GLIBC(ctime_r HAVE_CTIME_R)
|
||||
CHECK_FUNCTION_EXISTS_GLIBC(fchdir HAVE_FCHDIR)
|
||||
CHECK_FUNCTION_EXISTS_GLIBC(fchflags HAVE_FCHFLAGS)
|
||||
@ -1472,15 +1431,19 @@ CHECK_FUNCTION_EXISTS_GLIBC(ftruncate HAVE_FTRUNCATE)
|
||||
CHECK_FUNCTION_EXISTS_GLIBC(futimens HAVE_FUTIMENS)
|
||||
CHECK_FUNCTION_EXISTS_GLIBC(futimes HAVE_FUTIMES)
|
||||
CHECK_FUNCTION_EXISTS_GLIBC(futimesat HAVE_FUTIMESAT)
|
||||
CHECK_FUNCTION_EXISTS_GLIBC(getegid HAVE_GETEGID)
|
||||
CHECK_FUNCTION_EXISTS_GLIBC(geteuid HAVE_GETEUID)
|
||||
CHECK_FUNCTION_EXISTS_GLIBC(getgrgid_r HAVE_GETGRGID_R)
|
||||
CHECK_FUNCTION_EXISTS_GLIBC(getgrnam_r HAVE_GETGRNAM_R)
|
||||
CHECK_FUNCTION_EXISTS_GLIBC(getline HAVE_GETLINE)
|
||||
CHECK_FUNCTION_EXISTS_GLIBC(getpid HAVE_GETPID)
|
||||
CHECK_FUNCTION_EXISTS_GLIBC(getpwnam_r HAVE_GETPWNAM_R)
|
||||
CHECK_FUNCTION_EXISTS_GLIBC(getpwuid_r HAVE_GETPWUID_R)
|
||||
CHECK_FUNCTION_EXISTS_GLIBC(getpid HAVE_GETPID)
|
||||
CHECK_FUNCTION_EXISTS_GLIBC(getresgid HAVE_GETRESGID)
|
||||
CHECK_FUNCTION_EXISTS_GLIBC(getresuid HAVE_GETRESUID)
|
||||
CHECK_FUNCTION_EXISTS_GLIBC(getvfsbyname HAVE_GETVFSBYNAME)
|
||||
CHECK_FUNCTION_EXISTS_GLIBC(gmtime_r HAVE_GMTIME_R)
|
||||
CHECK_FUNCTION_EXISTS_GLIBC(issetugid HAVE_ISSETUGID)
|
||||
CHECK_FUNCTION_EXISTS_GLIBC(lchflags HAVE_LCHFLAGS)
|
||||
CHECK_FUNCTION_EXISTS_GLIBC(lchmod HAVE_LCHMOD)
|
||||
CHECK_FUNCTION_EXISTS_GLIBC(lchown HAVE_LCHOWN)
|
||||
@ -1499,6 +1462,7 @@ CHECK_FUNCTION_EXISTS_GLIBC(nl_langinfo HAVE_NL_LANGINFO)
|
||||
CHECK_FUNCTION_EXISTS_GLIBC(openat HAVE_OPENAT)
|
||||
CHECK_FUNCTION_EXISTS_GLIBC(pipe HAVE_PIPE)
|
||||
CHECK_FUNCTION_EXISTS_GLIBC(poll HAVE_POLL)
|
||||
CHECK_FUNCTION_EXISTS_GLIBC(posix_spawn HAVE_POSIX_SPAWN)
|
||||
CHECK_FUNCTION_EXISTS_GLIBC(posix_spawnp HAVE_POSIX_SPAWNP)
|
||||
CHECK_FUNCTION_EXISTS_GLIBC(readlink HAVE_READLINK)
|
||||
CHECK_FUNCTION_EXISTS_GLIBC(readpassphrase HAVE_READPASSPHRASE)
|
||||
@ -1516,6 +1480,8 @@ CHECK_FUNCTION_EXISTS_GLIBC(strnlen HAVE_STRNLEN)
|
||||
CHECK_FUNCTION_EXISTS_GLIBC(strrchr HAVE_STRRCHR)
|
||||
CHECK_FUNCTION_EXISTS_GLIBC(symlink HAVE_SYMLINK)
|
||||
CHECK_FUNCTION_EXISTS_GLIBC(sysconf HAVE_SYSCONF)
|
||||
CHECK_FUNCTION_EXISTS_GLIBC(tcgetattr HAVE_TCGETATTR)
|
||||
CHECK_FUNCTION_EXISTS_GLIBC(tcsetattr HAVE_TCSETATTR)
|
||||
CHECK_FUNCTION_EXISTS_GLIBC(timegm HAVE_TIMEGM)
|
||||
CHECK_FUNCTION_EXISTS_GLIBC(tzset HAVE_TZSET)
|
||||
CHECK_FUNCTION_EXISTS_GLIBC(unlinkat HAVE_UNLINKAT)
|
||||
@ -1525,9 +1491,9 @@ CHECK_FUNCTION_EXISTS_GLIBC(utimes HAVE_UTIMES)
|
||||
CHECK_FUNCTION_EXISTS_GLIBC(utimensat HAVE_UTIMENSAT)
|
||||
CHECK_FUNCTION_EXISTS_GLIBC(vfork HAVE_VFORK)
|
||||
CHECK_FUNCTION_EXISTS_GLIBC(wcrtomb HAVE_WCRTOMB)
|
||||
CHECK_FUNCTION_EXISTS_GLIBC(wcscmp HAVE_WCSCMP)
|
||||
CHECK_FUNCTION_EXISTS_GLIBC(wcscpy HAVE_WCSCPY)
|
||||
CHECK_FUNCTION_EXISTS_GLIBC(wcslen HAVE_WCSLEN)
|
||||
check_symbol_exists(wcscmp wchar.h HAVE_WCSCMP)
|
||||
check_symbol_exists(wcscpy wchar.h HAVE_WCSCPY)
|
||||
check_symbol_exists(wcslen wchar.h HAVE_WCSLEN)
|
||||
CHECK_FUNCTION_EXISTS_GLIBC(wctomb HAVE_WCTOMB)
|
||||
CHECK_FUNCTION_EXISTS_GLIBC(_fseeki64 HAVE__FSEEKI64)
|
||||
CHECK_FUNCTION_EXISTS_GLIBC(_get_timezone HAVE__GET_TIMEZONE)
|
||||
@ -1560,12 +1526,6 @@ CHECK_C_SOURCE_COMPILES(
|
||||
"#include <sys/types.h>\n#include <sys/mount.h>\nint main(void) { struct statfs s; return sizeof(s);}"
|
||||
HAVE_STRUCT_STATFS)
|
||||
|
||||
# Make sure we have the POSIX version of readdir_r, not the
|
||||
# older 2-argument version.
|
||||
CHECK_C_SOURCE_COMPILES(
|
||||
"#include <dirent.h>\nint main() {DIR *d = opendir(\".\"); struct dirent e,*r; return readdir_r(d,&e,&r);}"
|
||||
HAVE_READDIR_R)
|
||||
|
||||
# dirfd can be either a function or a macro.
|
||||
CHECK_C_SOURCE_COMPILES(
|
||||
"#include <dirent.h>\nint main() {DIR *d = opendir(\".\"); return dirfd(d);}"
|
||||
@ -1805,11 +1765,16 @@ IF(ENABLE_XATTR)
|
||||
CHECK_LIBRARY_EXISTS(attr "setxattr" "" HAVE_LIBATTR)
|
||||
IF(HAVE_LIBATTR)
|
||||
SET(CMAKE_REQUIRED_LIBRARIES "attr")
|
||||
ELSE()
|
||||
pkg_check_modules(LIBATTR libattr)
|
||||
IF(LIBATTR_VERSION)
|
||||
SET(LIBATTR_PKGCONFIG_VERSION ${LIBATTR_VERSION})
|
||||
ENDIF(LIBATTR_VERSION)
|
||||
ELSE(HAVE_LIBATTR)
|
||||
CHECK_LIBRARY_EXISTS(gnu "setxattr" "" HAVE_LIBATTR_GNU)
|
||||
IF(HAVE_LIBATTR_GNU)
|
||||
SET(CMAKE_REQUIRED_LIBRARIES "gnu")
|
||||
ENDIF()
|
||||
UNSET(LIBATTR_PKGCONFIG_VERSION CACHE)
|
||||
ENDIF(HAVE_LIBATTR)
|
||||
CHECK_SYMBOL_EXISTS(EXTATTR_NAMESPACE_USER "sys/types.h;sys/extattr.h" HAVE_DECL_EXTATTR_NAMESPACE_USER)
|
||||
CHECK_SYMBOL_EXISTS(XATTR_NOFOLLOW "sys/xattr.h" HAVE_DECL_XATTR_NOFOLLOW)
|
||||
@ -1927,6 +1892,12 @@ IF(ENABLE_ACL)
|
||||
SET(CMAKE_REQUIRED_LIBRARIES "acl")
|
||||
FIND_LIBRARY(ACL_LIBRARY NAMES acl)
|
||||
LIST(APPEND ADDITIONAL_LIBS ${ACL_LIBRARY})
|
||||
pkg_check_modules(LIBACL libacl)
|
||||
IF(LIBACL_VERSION)
|
||||
SET(LIBACL_PKGCONFIG_VERSION ${LIBACL_VERSION})
|
||||
ENDIF(LIBACL_VERSION)
|
||||
ELSE(HAVE_LIBACL)
|
||||
UNSET(LIBACL_PKGCONFIG_VERSION CACHE)
|
||||
ENDIF(HAVE_LIBACL)
|
||||
|
||||
CHECK_TYPE_EXISTS(acl_t "sys/types.h;sys/acl.h" HAVE_ACL_T)
|
||||
@ -2066,6 +2037,12 @@ int main(void) { return ACL_SYNCHRONIZE; }" HAVE_DECL_ACL_SYNCHRONIZE)
|
||||
SET(CMAKE_REQUIRED_LIBRARIES "richacl")
|
||||
FIND_LIBRARY(RICHACL_LIBRARY NAMES richacl)
|
||||
LIST(APPEND ADDITIONAL_LIBS ${RICHACL_LIBRARY})
|
||||
pkg_check_modules(LIBRICHACL librichacl)
|
||||
IF(LIBRICHACL_VERSION)
|
||||
SET(LIBRICHACL_PKGCONFIG_VERSION ${LIBRICHACL_VERSION})
|
||||
ENDIF(LIBRICHACL_VERSION)
|
||||
ELSE(HAVE_LIBRICHACL)
|
||||
UNSET(LIBRICHACL_PKGCONFIG_VERSION CACHE)
|
||||
ENDIF(HAVE_LIBRICHACL)
|
||||
|
||||
CHECK_STRUCT_HAS_MEMBER("struct richace" e_type "sys/richacl.h"
|
||||
@ -2140,8 +2117,6 @@ CHECK_CRYPTO("MD5;RMD160;SHA1;SHA256;SHA384;SHA512" OPENSSL)
|
||||
# Libmd has to be probed after OpenSSL.
|
||||
CHECK_CRYPTO("MD5;RMD160;SHA1;SHA256;SHA512" LIBMD)
|
||||
|
||||
CHECK_CRYPTO_WIN("MD5;SHA1;SHA256;SHA384;SHA512")
|
||||
|
||||
# Check visibility annotations
|
||||
SET(OLD_CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS}")
|
||||
SET(CMAKE_REQUIRED_FLAGS "${CMAKE_REQUIRED_FLAGS} -fvisibility=hidden -Werror")
|
||||
@ -2165,7 +2140,7 @@ INCLUDE(CreatePkgConfigFile)
|
||||
#
|
||||
# Register installation of PDF documents.
|
||||
#
|
||||
IF(WIN32 AND NOT CYGWIN)
|
||||
IF(WIN32 AND NOT CYGWIN AND ENABLE_INSTALL)
|
||||
#
|
||||
# On Windows platform, It's better that we install PDF documents
|
||||
# on one's computer.
|
||||
@ -2177,7 +2152,7 @@ IF(WIN32 AND NOT CYGWIN)
|
||||
FILES_MATCHING PATTERN "*.pdf"
|
||||
)
|
||||
ENDIF(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/doc/pdf)
|
||||
ENDIF(WIN32 AND NOT CYGWIN)
|
||||
ENDIF(WIN32 AND NOT CYGWIN AND ENABLE_INSTALL)
|
||||
#
|
||||
#
|
||||
#
|
||||
@ -2187,11 +2162,6 @@ IF(MSVC)
|
||||
ADD_DEFINITIONS(-D_CRT_SECURE_NO_DEPRECATE)
|
||||
ENDIF(MSVC)
|
||||
|
||||
IF(APPLE)
|
||||
# CC_MD5_Init() functions are deprecated on macOS 10.15, but we want to use them
|
||||
ADD_DEFINITIONS(-Wno-deprecated-declarations)
|
||||
ENDIF(APPLE)
|
||||
|
||||
OPTION(DONT_FAIL_ON_CRC_ERROR "Ignore CRC errors during parsing (For fuzzing)" OFF)
|
||||
IF(DONT_FAIL_ON_CRC_ERROR)
|
||||
ADD_DEFINITIONS(-DDONT_FAIL_ON_CRC_ERROR=1)
|
||||
|
||||
2
COPYING
2
COPYING
@ -20,7 +20,7 @@ the actual statements in the files are controlling.
|
||||
libarchive/mtree.5
|
||||
|
||||
* The following source files are in the public domain:
|
||||
libarchive/archive_getdate.c
|
||||
libarchive/archive_parse_date.c
|
||||
|
||||
* The following source files are triple-licensed with the ability to choose
|
||||
from CC0 1.0 Universal, OpenSSL or Apache 2.0 licenses:
|
||||
|
||||
290
Makefile.am
290
Makefile.am
@ -96,61 +96,73 @@ distclean-local:
|
||||
|
||||
include_HEADERS= libarchive/archive.h libarchive/archive_entry.h
|
||||
|
||||
libarchive_la_SOURCES= \
|
||||
libarchive/archive_acl.c \
|
||||
noinst_HEADERS= \
|
||||
libarchive/archive_acl_private.h \
|
||||
libarchive/archive_check_magic.c \
|
||||
libarchive/archive_cmdline.c \
|
||||
libarchive/archive_cmdline_private.h \
|
||||
libarchive/archive_crc32.h \
|
||||
libarchive/archive_cryptor.c \
|
||||
libarchive/archive_cryptor_private.h \
|
||||
libarchive/archive_digest.c \
|
||||
libarchive/archive_digest_private.h \
|
||||
libarchive/archive_endian.h \
|
||||
libarchive/archive_entry.c \
|
||||
libarchive/archive_entry.h \
|
||||
libarchive/archive_entry_copy_stat.c \
|
||||
libarchive/archive_entry_link_resolver.c \
|
||||
libarchive/archive_entry_locale.h \
|
||||
libarchive/archive_entry_private.h \
|
||||
libarchive/archive_hmac_private.h \
|
||||
libarchive/archive_openssl_evp_private.h \
|
||||
libarchive/archive_openssl_hmac_private.h \
|
||||
libarchive/archive_options_private.h \
|
||||
libarchive/archive_pack_dev.h \
|
||||
libarchive/archive_pathmatch.h \
|
||||
libarchive/archive_platform.h \
|
||||
libarchive/archive_platform_acl.h \
|
||||
libarchive/archive_platform_stat.h \
|
||||
libarchive/archive_platform_xattr.h \
|
||||
libarchive/archive_ppmd7_private.h \
|
||||
libarchive/archive_ppmd8_private.h \
|
||||
libarchive/archive_ppmd_private.h \
|
||||
libarchive/archive_private.h \
|
||||
libarchive/archive_random_private.h \
|
||||
libarchive/archive_rb.h \
|
||||
libarchive/archive_read_disk_private.h \
|
||||
libarchive/archive_read_private.h \
|
||||
libarchive/archive_string.h \
|
||||
libarchive/archive_string_composition.h \
|
||||
libarchive/archive_time_private.h \
|
||||
libarchive/archive_write_disk_private.h \
|
||||
libarchive/archive_write_private.h \
|
||||
libarchive/archive_write_set_format_private.h \
|
||||
libarchive/archive_xxhash.h \
|
||||
libarchive/config_freebsd.h \
|
||||
libarchive/filter_fork.h
|
||||
|
||||
libarchive_la_SOURCES= \
|
||||
libarchive/archive_acl.c \
|
||||
libarchive/archive_check_magic.c \
|
||||
libarchive/archive_cmdline.c \
|
||||
libarchive/archive_cryptor.c \
|
||||
libarchive/archive_digest.c \
|
||||
libarchive/archive_entry.c \
|
||||
libarchive/archive_entry_copy_stat.c \
|
||||
libarchive/archive_entry_link_resolver.c \
|
||||
libarchive/archive_entry_sparse.c \
|
||||
libarchive/archive_entry_stat.c \
|
||||
libarchive/archive_entry_strmode.c \
|
||||
libarchive/archive_entry_xattr.c \
|
||||
libarchive/archive_getdate.c \
|
||||
libarchive/archive_getdate.h \
|
||||
libarchive/archive_hmac.c \
|
||||
libarchive/archive_hmac_private.h \
|
||||
libarchive/archive_match.c \
|
||||
libarchive/archive_openssl_evp_private.h \
|
||||
libarchive/archive_openssl_hmac_private.h \
|
||||
libarchive/archive_options.c \
|
||||
libarchive/archive_options_private.h \
|
||||
libarchive/archive_pack_dev.h \
|
||||
libarchive/archive_pack_dev.c \
|
||||
libarchive/archive_parse_date.c \
|
||||
libarchive/archive_pathmatch.c \
|
||||
libarchive/archive_pathmatch.h \
|
||||
libarchive/archive_platform.h \
|
||||
libarchive/archive_platform_acl.h \
|
||||
libarchive/archive_platform_xattr.h \
|
||||
libarchive/archive_ppmd_private.h \
|
||||
libarchive/archive_ppmd7.c \
|
||||
libarchive/archive_ppmd7_private.h \
|
||||
libarchive/archive_ppmd8.c \
|
||||
libarchive/archive_ppmd8_private.h \
|
||||
libarchive/archive_private.h \
|
||||
libarchive/archive_random.c \
|
||||
libarchive/archive_random_private.h \
|
||||
libarchive/archive_rb.c \
|
||||
libarchive/archive_rb.h \
|
||||
libarchive/archive_read.c \
|
||||
libarchive/archive_read_add_passphrase.c \
|
||||
libarchive/archive_read_append_filter.c \
|
||||
libarchive/archive_read_data_into_fd.c \
|
||||
libarchive/archive_read_disk_entry_from_file.c \
|
||||
libarchive/archive_read_disk_posix.c \
|
||||
libarchive/archive_read_disk_private.h \
|
||||
libarchive/archive_read_disk_set_standard_lookup.c \
|
||||
libarchive/archive_read_extract.c \
|
||||
libarchive/archive_read_extract2.c \
|
||||
@ -158,12 +170,11 @@ libarchive_la_SOURCES= \
|
||||
libarchive/archive_read_open_file.c \
|
||||
libarchive/archive_read_open_filename.c \
|
||||
libarchive/archive_read_open_memory.c \
|
||||
libarchive/archive_read_private.h \
|
||||
libarchive/archive_read_set_format.c \
|
||||
libarchive/archive_read_set_options.c \
|
||||
libarchive/archive_read_support_filter_all.c \
|
||||
libarchive/archive_read_support_filter_bzip2.c \
|
||||
libarchive/archive_read_support_filter_by_code.c \
|
||||
libarchive/archive_read_support_filter_bzip2.c \
|
||||
libarchive/archive_read_support_filter_compress.c \
|
||||
libarchive/archive_read_support_filter_grzip.c \
|
||||
libarchive/archive_read_support_filter_gzip.c \
|
||||
@ -194,21 +205,12 @@ libarchive_la_SOURCES= \
|
||||
libarchive/archive_read_support_format_xar.c \
|
||||
libarchive/archive_read_support_format_zip.c \
|
||||
libarchive/archive_string.c \
|
||||
libarchive/archive_string.h \
|
||||
libarchive/archive_string_composition.h \
|
||||
libarchive/archive_string_sprintf.c \
|
||||
libarchive/archive_time.c \
|
||||
libarchive/archive_util.c \
|
||||
libarchive/archive_version_details.c \
|
||||
libarchive/archive_virtual.c \
|
||||
libarchive/archive_write.c \
|
||||
libarchive/archive_write_disk_posix.c \
|
||||
libarchive/archive_write_disk_private.h \
|
||||
libarchive/archive_write_disk_set_standard_lookup.c \
|
||||
libarchive/archive_write_open_fd.c \
|
||||
libarchive/archive_write_open_file.c \
|
||||
libarchive/archive_write_open_filename.c \
|
||||
libarchive/archive_write_open_memory.c \
|
||||
libarchive/archive_write_private.h \
|
||||
libarchive/archive_write_add_filter.c \
|
||||
libarchive/archive_write_add_filter_b64encode.c \
|
||||
libarchive/archive_write_add_filter_by_name.c \
|
||||
@ -224,6 +226,12 @@ libarchive_la_SOURCES= \
|
||||
libarchive/archive_write_add_filter_uuencode.c \
|
||||
libarchive/archive_write_add_filter_xz.c \
|
||||
libarchive/archive_write_add_filter_zstd.c \
|
||||
libarchive/archive_write_disk_posix.c \
|
||||
libarchive/archive_write_disk_set_standard_lookup.c \
|
||||
libarchive/archive_write_open_fd.c \
|
||||
libarchive/archive_write_open_file.c \
|
||||
libarchive/archive_write_open_filename.c \
|
||||
libarchive/archive_write_open_memory.c \
|
||||
libarchive/archive_write_set_format.c \
|
||||
libarchive/archive_write_set_format_7zip.c \
|
||||
libarchive/archive_write_set_format_ar.c \
|
||||
@ -233,59 +241,54 @@ libarchive_la_SOURCES= \
|
||||
libarchive/archive_write_set_format_cpio_newc.c \
|
||||
libarchive/archive_write_set_format_cpio_odc.c \
|
||||
libarchive/archive_write_set_format_filter_by_ext.c \
|
||||
libarchive/archive_write_set_format_gnutar.c \
|
||||
libarchive/archive_write_set_format_iso9660.c \
|
||||
libarchive/archive_write_set_format_mtree.c \
|
||||
libarchive/archive_write_set_format_pax.c \
|
||||
libarchive/archive_write_set_format_private.h \
|
||||
libarchive/archive_write_set_format_raw.c \
|
||||
libarchive/archive_write_set_format_shar.c \
|
||||
libarchive/archive_write_set_format_ustar.c \
|
||||
libarchive/archive_write_set_format_v7tar.c \
|
||||
libarchive/archive_write_set_format_gnutar.c \
|
||||
libarchive/archive_write_set_format_warc.c \
|
||||
libarchive/archive_write_set_format_xar.c \
|
||||
libarchive/archive_write_set_format_zip.c \
|
||||
libarchive/archive_write_set_options.c \
|
||||
libarchive/archive_write_set_passphrase.c \
|
||||
libarchive/archive_xxhash.h \
|
||||
libarchive/config_freebsd.h \
|
||||
libarchive/filter_fork_posix.c \
|
||||
libarchive/filter_fork.h \
|
||||
libarchive/xxhash.c
|
||||
|
||||
if INC_WINDOWS_FILES
|
||||
noinst_HEADERS+= \
|
||||
libarchive/archive_windows.h
|
||||
libarchive_la_SOURCES+= \
|
||||
libarchive/archive_entry_copy_bhfi.c \
|
||||
libarchive/archive_read_disk_windows.c \
|
||||
libarchive/archive_windows.h \
|
||||
libarchive/archive_windows.c \
|
||||
libarchive/archive_write_disk_windows.c \
|
||||
libarchive/filter_fork_windows.c
|
||||
endif
|
||||
|
||||
if INC_BLAKE2
|
||||
libarchive_la_SOURCES+= \
|
||||
noinst_HEADERS+= \
|
||||
libarchive/archive_blake2.h \
|
||||
libarchive/archive_blake2_impl.h \
|
||||
libarchive/archive_blake2_impl.h
|
||||
libarchive_la_SOURCES+= \
|
||||
libarchive/archive_blake2s_ref.c \
|
||||
libarchive/archive_blake2sp_ref.c
|
||||
endif
|
||||
|
||||
if INC_LINUX_ACL
|
||||
libarchive_la_SOURCES+= libarchive/archive_disk_acl_linux.c
|
||||
else
|
||||
endif
|
||||
if INC_SUNOS_ACL
|
||||
libarchive_la_SOURCES+= libarchive/archive_disk_acl_sunos.c
|
||||
else
|
||||
endif
|
||||
if INC_DARWIN_ACL
|
||||
libarchive_la_SOURCES+= libarchive/archive_disk_acl_darwin.c
|
||||
else
|
||||
endif
|
||||
if INC_FREEBSD_ACL
|
||||
libarchive_la_SOURCES+= libarchive/archive_disk_acl_freebsd.c
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
# -no-undefined marks that libarchive doesn't rely on symbols
|
||||
# defined in the application. This is mandatory for cygwin.
|
||||
@ -349,22 +352,25 @@ pkgconfigdir = $(libdir)/pkgconfig
|
||||
pkgconfig_DATA = build/pkgconfig/libarchive.pc
|
||||
|
||||
# Sources needed by all test programs
|
||||
noinst_HEADERS+= \
|
||||
test_utils/test_common.h \
|
||||
test_utils/test_utils.h
|
||||
test_utils_SOURCES= \
|
||||
test_utils/test_utils.c \
|
||||
test_utils/test_utils.h \
|
||||
test_utils/test_main.c \
|
||||
test_utils/test_common.h
|
||||
test_utils/test_utils.c
|
||||
|
||||
#
|
||||
#
|
||||
# libarchive_test program
|
||||
#
|
||||
#
|
||||
noinst_HEADERS+= \
|
||||
libarchive/test/test.h
|
||||
libarchive_test_SOURCES= \
|
||||
$(libarchive_la_SOURCES) \
|
||||
$(test_utils_SOURCES) \
|
||||
libarchive/test/read_open_memory.c \
|
||||
libarchive/test/test.h \
|
||||
libarchive/test/test_7zip_filename_encoding.c \
|
||||
libarchive/test/test_acl_nfs4.c \
|
||||
libarchive/test/test_acl_pax.c \
|
||||
libarchive/test/test_acl_platform_nfs4.c \
|
||||
@ -376,10 +382,10 @@ libarchive_test_SOURCES= \
|
||||
libarchive/test/test_archive_clear_error.c \
|
||||
libarchive/test/test_archive_cmdline.c \
|
||||
libarchive/test/test_archive_digest.c \
|
||||
libarchive/test/test_archive_getdate.c \
|
||||
libarchive/test/test_archive_match_owner.c \
|
||||
libarchive/test/test_archive_match_path.c \
|
||||
libarchive/test/test_archive_match_time.c \
|
||||
libarchive/test/test_archive_parse_date.c \
|
||||
libarchive/test/test_archive_pathmatch.c \
|
||||
libarchive/test/test_archive_read.c \
|
||||
libarchive/test/test_archive_read_add_passphrase.c \
|
||||
@ -410,6 +416,7 @@ libarchive_test_SOURCES= \
|
||||
libarchive/test/test_compat_bzip2.c \
|
||||
libarchive/test/test_compat_cpio.c \
|
||||
libarchive/test/test_compat_gtar.c \
|
||||
libarchive/test/test_compat_gtar_large.c \
|
||||
libarchive/test/test_compat_gzip.c \
|
||||
libarchive/test/test_compat_lz4.c \
|
||||
libarchive/test/test_compat_lzip.c \
|
||||
@ -450,6 +457,7 @@ libarchive_test_SOURCES= \
|
||||
libarchive/test/test_read_file_nonexistent.c \
|
||||
libarchive/test/test_read_filter_compress.c \
|
||||
libarchive/test/test_read_filter_grzip.c \
|
||||
libarchive/test/test_read_filter_gzip_recursive.c \
|
||||
libarchive/test/test_read_filter_lrzip.c \
|
||||
libarchive/test/test_read_filter_lzop.c \
|
||||
libarchive/test/test_read_filter_lzop_multiple_parts.c \
|
||||
@ -461,6 +469,7 @@ libarchive_test_SOURCES= \
|
||||
libarchive/test/test_read_format_7zip_encryption_data.c \
|
||||
libarchive/test/test_read_format_7zip_encryption_partially.c \
|
||||
libarchive/test/test_read_format_7zip_encryption_header.c \
|
||||
libarchive/test/test_read_format_7zip_issue2765.c \
|
||||
libarchive/test/test_read_format_7zip_malformed.c \
|
||||
libarchive/test/test_read_format_7zip_packinfo_digests.c \
|
||||
libarchive/test/test_read_format_ar.c \
|
||||
@ -486,7 +495,9 @@ libarchive_test_SOURCES= \
|
||||
libarchive/test/test_read_format_gtar_filename.c \
|
||||
libarchive/test/test_read_format_gtar_gz.c \
|
||||
libarchive/test/test_read_format_gtar_lzma.c \
|
||||
libarchive/test/test_read_format_gtar_redundant_L.c \
|
||||
libarchive/test/test_read_format_gtar_sparse.c \
|
||||
libarchive/test/test_read_format_gtar_sparse_length.c \
|
||||
libarchive/test/test_read_format_gtar_sparse_skip_entry.c \
|
||||
libarchive/test/test_read_format_huge_rpm.c \
|
||||
libarchive/test/test_read_format_iso_Z.c \
|
||||
@ -509,21 +520,27 @@ libarchive_test_SOURCES= \
|
||||
libarchive/test/test_read_format_mtree_crash747.c \
|
||||
libarchive/test/test_read_format_pax_bz2.c \
|
||||
libarchive/test/test_read_format_rar.c \
|
||||
libarchive/test/test_read_format_rar_encryption.c \
|
||||
libarchive/test/test_read_format_rar_encryption_data.c \
|
||||
libarchive/test/test_read_format_rar_encryption_partially.c \
|
||||
libarchive/test/test_read_format_rar_encryption_header.c \
|
||||
libarchive/test/test_read_format_rar_filter.c \
|
||||
libarchive/test/test_read_format_rar_invalid1.c \
|
||||
libarchive/test/test_read_format_rar_overflow.c \
|
||||
libarchive/test/test_read_format_rar5.c \
|
||||
libarchive/test/test_read_format_raw.c \
|
||||
libarchive/test/test_read_format_tar.c \
|
||||
libarchive/test/test_read_format_tar_V_negative_size.c \
|
||||
libarchive/test/test_read_format_tar_concatenated.c \
|
||||
libarchive/test/test_read_format_tar_empty_pax.c \
|
||||
libarchive/test/test_read_format_tar_empty_filename.c \
|
||||
libarchive/test/test_read_format_tar_empty_with_gnulabel.c \
|
||||
libarchive/test/test_read_format_tar_filename.c \
|
||||
libarchive/test/test_read_format_tar_invalid_pax_size.c \
|
||||
libarchive/test/test_read_format_tar_mac_metadata.c \
|
||||
libarchive/test/test_read_format_tar_pax_g_large.c \
|
||||
libarchive/test/test_read_format_tar_pax_large_attr.c \
|
||||
libarchive/test/test_read_format_tar_pax_negative_time.c \
|
||||
libarchive/test/test_read_format_tbz.c \
|
||||
libarchive/test/test_read_format_tgz.c \
|
||||
libarchive/test/test_read_format_tlz.c \
|
||||
@ -556,6 +573,7 @@ libarchive_test_SOURCES= \
|
||||
libarchive/test/test_read_format_zip_zip64.c \
|
||||
libarchive/test/test_read_format_zip_with_invalid_traditional_eocd.c \
|
||||
libarchive/test/test_read_large.c \
|
||||
libarchive/test/test_read_pax_empty_val_no_nl.c \
|
||||
libarchive/test/test_read_pax_xattr_rht_security_selinux.c \
|
||||
libarchive/test/test_read_pax_xattr_schily.c \
|
||||
libarchive/test/test_read_pax_truncated.c \
|
||||
@ -582,6 +600,7 @@ libarchive_test_SOURCES= \
|
||||
libarchive/test/test_write_disk_no_hfs_compression.c \
|
||||
libarchive/test/test_write_disk_perms.c \
|
||||
libarchive/test/test_write_disk_secure.c \
|
||||
libarchive/test/test_write_disk_secure_noabsolutepaths.c \
|
||||
libarchive/test/test_write_disk_secure744.c \
|
||||
libarchive/test/test_write_disk_secure745.c \
|
||||
libarchive/test/test_write_disk_secure746.c \
|
||||
@ -623,6 +642,7 @@ libarchive_test_SOURCES= \
|
||||
libarchive/test/test_write_format_mtree_classic_indent.c\
|
||||
libarchive/test/test_write_format_mtree_fflags.c \
|
||||
libarchive/test/test_write_format_mtree_no_separator.c \
|
||||
libarchive/test/test_write_format_mtree_preset_digests.c \
|
||||
libarchive/test/test_write_format_mtree_quoted_filename.c\
|
||||
libarchive/test/test_write_format_pax.c \
|
||||
libarchive/test/test_write_format_raw.c \
|
||||
@ -640,6 +660,9 @@ libarchive_test_SOURCES= \
|
||||
libarchive/test/test_write_format_zip.c \
|
||||
libarchive/test/test_write_format_zip64_stream.c \
|
||||
libarchive/test/test_write_format_zip_compression_store.c \
|
||||
libarchive/test/test_write_format_zip_compression_zstd.c \
|
||||
libarchive/test/test_write_format_zip_compression_bzip2.c \
|
||||
libarchive/test/test_write_format_zip_compression_lzmaxz.c \
|
||||
libarchive/test/test_write_format_zip_empty.c \
|
||||
libarchive/test/test_write_format_zip_empty_zip64.c \
|
||||
libarchive/test/test_write_format_zip_entry_size_unset.c \
|
||||
@ -653,7 +676,6 @@ libarchive_test_SOURCES= \
|
||||
libarchive/test/test_write_read_format_zip.c \
|
||||
libarchive/test/test_xattr_platform.c \
|
||||
libarchive/test/test_zip_filename_encoding.c
|
||||
|
||||
libarchive_test_CPPFLAGS= \
|
||||
-I$(top_srcdir)/libarchive \
|
||||
-I$(top_srcdir)/libarchive/test \
|
||||
@ -666,9 +688,9 @@ libarchive_test_LDADD= $(LTLIBICONV)
|
||||
# The "list.h" file just lists all of the tests defined in all of the sources.
|
||||
# Building it automatically provides a sanity-check on libarchive_test_SOURCES
|
||||
# above.
|
||||
libarchive/test/list.h: Makefile
|
||||
libarchive/test/list.h: $(libarchive_test_SOURCES)
|
||||
$(MKDIR_P) libarchive/test
|
||||
cat $(top_srcdir)/libarchive/test/test_*.c | grep '^DEFINE_TEST' > libarchive/test/list.h
|
||||
grep -h '^DEFINE_TEST(' $^ | LC_COLLATE=C sort > $@
|
||||
|
||||
libarchive_TESTS_ENVIRONMENT= LIBARCHIVE_TEST_FILES=`cd $(top_srcdir);/bin/pwd`/libarchive/test LRZIP=NOCONFIG
|
||||
|
||||
@ -688,6 +710,7 @@ libarchive_test_EXTRA_DIST=\
|
||||
libarchive/test/test_compat_lz4_2.tar.lz4.uu \
|
||||
libarchive/test/test_compat_lz4_3.tar.lz4.uu \
|
||||
libarchive/test/test_compat_lz4_B4.tar.lz4.uu \
|
||||
libarchive/test/test_compat_lz4_skippable_frames_B4.tar.lz4.uu \
|
||||
libarchive/test/test_compat_lz4_B4BD.tar.lz4.uu \
|
||||
libarchive/test/test_compat_lz4_B4BDBX.tar.lz4.uu \
|
||||
libarchive/test/test_compat_lz4_B5.tar.lz4.uu \
|
||||
@ -756,6 +779,7 @@ libarchive_test_EXTRA_DIST=\
|
||||
libarchive/test/test_rar_multivolume_uncompressed_files.part09.rar.uu \
|
||||
libarchive/test/test_rar_multivolume_uncompressed_files.part10.rar.uu \
|
||||
libarchive/test/test_read_filter_grzip.tar.grz.uu \
|
||||
libarchive/test/test_read_filter_gzip_recursive.gz.uu \
|
||||
libarchive/test/test_read_filter_lrzip.tar.lrz.uu \
|
||||
libarchive/test/test_read_filter_lzop.tar.lzo.uu \
|
||||
libarchive/test/test_read_filter_lzop_multiple_parts.tar.lzo.uu \
|
||||
@ -782,6 +806,7 @@ libarchive_test_EXTRA_DIST=\
|
||||
libarchive/test/test_read_format_7zip_copy_2.7z.uu \
|
||||
libarchive/test/test_read_format_7zip_deflate.7z.uu \
|
||||
libarchive/test/test_read_format_7zip_deflate_arm64.7z.uu \
|
||||
libarchive/test/test_read_format_7zip_deflate_powerpc.7z.uu \
|
||||
libarchive/test/test_read_format_7zip_delta_lzma1.7z.uu \
|
||||
libarchive/test/test_read_format_7zip_delta4_lzma1.7z.uu \
|
||||
libarchive/test/test_read_format_7zip_delta_lzma2.7z.uu \
|
||||
@ -792,22 +817,30 @@ libarchive_test_EXTRA_DIST=\
|
||||
libarchive/test/test_read_format_7zip_encryption_header.7z.uu \
|
||||
libarchive/test/test_read_format_7zip_encryption_partially.7z.uu \
|
||||
libarchive/test/test_read_format_7zip_extract_second.7z.uu \
|
||||
libarchive/test/test_read_format_7zip_issue2765.7z.uu \
|
||||
libarchive/test/test_read_format_7zip_lzma1.7z.uu \
|
||||
libarchive/test/test_read_format_7zip_lzma1_2.7z.uu \
|
||||
libarchive/test/test_read_format_7zip_lzma1_lzma2.7z.uu \
|
||||
libarchive/test/test_read_format_7zip_lzma2.7z.uu \
|
||||
libarchive/test/test_read_format_7zip_lzma2_arm64.7z.uu \
|
||||
libarchive/test/test_read_format_7zip_lzma2_arm.7z.uu \
|
||||
libarchive/test/test_read_format_7zip_lzma2_powerpc.7z.uu \
|
||||
libarchive/test/test_read_format_7zip_lzma2_riscv.7z.uu \
|
||||
libarchive/test/test_read_format_7zip_lzma2_sparc.7z.uu \
|
||||
libarchive/test/test_read_format_7zip_malformed.7z.uu \
|
||||
libarchive/test/test_read_format_7zip_malformed2.7z.uu \
|
||||
libarchive/test/test_read_format_7zip_packinfo_digests.7z.uu \
|
||||
libarchive/test/test_read_format_7zip_ppmd.7z.uu \
|
||||
libarchive/test/test_read_format_7zip_sfx_elf.elf.uu \
|
||||
libarchive/test/test_read_format_7zip_sfx_modified_pe.exe.uu \
|
||||
libarchive/test/test_read_format_7zip_sfx_pe.exe.uu \
|
||||
libarchive/test/test_read_format_7zip_solid_zstd.7z.uu \
|
||||
libarchive/test/test_read_format_7zip_symbolic_name.7z.uu \
|
||||
libarchive/test/test_read_format_7zip_win_attrib.7z.uu \
|
||||
libarchive/test/test_read_format_7zip_zstd_arm.7z.uu \
|
||||
libarchive/test/test_read_format_7zip_zstd_bcj.7z.uu \
|
||||
libarchive/test/test_read_format_7zip_zstd_nobcj.7z.uu \
|
||||
libarchive/test/test_read_format_7zip_zstd_sparc.7z.uu \
|
||||
libarchive/test/test_read_format_7zip_zstd.7z.uu \
|
||||
libarchive/test/test_read_format_ar.ar.uu \
|
||||
libarchive/test/test_read_format_cab_1.cab.uu \
|
||||
@ -826,12 +859,14 @@ libarchive_test_EXTRA_DIST=\
|
||||
libarchive/test/test_read_format_gtar_filename_cp866.tar.Z.uu \
|
||||
libarchive/test/test_read_format_gtar_filename_eucjp.tar.Z.uu \
|
||||
libarchive/test/test_read_format_gtar_filename_koi8r.tar.Z.uu \
|
||||
libarchive/test/test_read_format_gtar_redundant_L.tar.Z.uu \
|
||||
libarchive/test/test_read_format_gtar_sparse_1_13.tar.uu \
|
||||
libarchive/test/test_read_format_gtar_sparse_1_17.tar.uu \
|
||||
libarchive/test/test_read_format_gtar_sparse_1_17_posix00.tar.uu \
|
||||
libarchive/test/test_read_format_gtar_sparse_1_17_posix01.tar.uu \
|
||||
libarchive/test/test_read_format_gtar_sparse_1_17_posix10.tar.uu \
|
||||
libarchive/test/test_read_format_gtar_sparse_1_17_posix10_modified.tar.uu \
|
||||
libarchive/test/test_read_format_gtar_sparse_length.tar.Z.uu \
|
||||
libarchive/test/test_read_format_gtar_sparse_skip_entry.tar.Z.uu \
|
||||
libarchive/test/test_read_format_huge_rpm.rpm.uu \
|
||||
libarchive/test/test_read_format_iso.iso.Z.uu \
|
||||
@ -870,6 +905,7 @@ libarchive_test_EXTRA_DIST=\
|
||||
libarchive/test/test_read_format_rar_encryption_data.rar.uu \
|
||||
libarchive/test/test_read_format_rar_encryption_header.rar.uu \
|
||||
libarchive/test/test_read_format_rar_encryption_partially.rar.uu \
|
||||
libarchive/test/test_read_format_rar_endarc_huge.rar.uu \
|
||||
libarchive/test/test_read_format_rar_filter.rar.uu \
|
||||
libarchive/test/test_read_format_rar_invalid1.rar.uu \
|
||||
libarchive/test/test_read_format_rar_multi_lzss_blocks.rar.uu \
|
||||
@ -877,14 +913,28 @@ libarchive_test_EXTRA_DIST=\
|
||||
libarchive/test/test_read_format_rar_multivolume.part0002.rar.uu \
|
||||
libarchive/test/test_read_format_rar_multivolume.part0003.rar.uu \
|
||||
libarchive/test/test_read_format_rar_multivolume.part0004.rar.uu \
|
||||
libarchive/test/test_read_format_rar_newsub_huge.rar.uu \
|
||||
libarchive/test/test_read_format_rar_noeof.rar.uu \
|
||||
libarchive/test/test_read_format_rar_overflow.rar.uu \
|
||||
libarchive/test/test_read_format_rar_ppmd_lzss_conversion.rar.uu \
|
||||
libarchive/test/test_read_format_rar_ppmd_use_after_free.rar.uu \
|
||||
libarchive/test/test_read_format_rar_ppmd_use_after_free2.rar.uu \
|
||||
libarchive/test/test_read_format_rar_sfx.exe.uu \
|
||||
libarchive/test/test_read_format_rar_subblock.rar.uu \
|
||||
libarchive/test/test_read_format_rar_symlink_huge.rar.uu \
|
||||
libarchive/test/test_read_format_rar_unicode.rar.uu \
|
||||
libarchive/test/test_read_format_rar_windows.rar.uu \
|
||||
libarchive/test/test_read_format_rar4_encrypted.rar.uu \
|
||||
libarchive/test/test_read_format_rar4_encrypted_filenames.rar.uu \
|
||||
libarchive/test/test_read_format_rar4_solid_encrypted.rar.uu \
|
||||
libarchive/test/test_read_format_rar4_solid_encrypted_filenames.rar.uu \
|
||||
libarchive/test/test_read_format_rar5_only_crypt_exfld.rar.uu \
|
||||
libarchive/test/test_read_format_rar5_unsupported_exfld.rar.uu \
|
||||
libarchive/test/test_read_format_rar5_invalid_hash_valid_htime_exfld.rar.uu \
|
||||
libarchive/test/test_read_format_rar5_encrypted.rar.uu \
|
||||
libarchive/test/test_read_format_rar5_encrypted_filenames.rar.uu \
|
||||
libarchive/test/test_read_format_rar5_solid_encrypted.rar.uu \
|
||||
libarchive/test/test_read_format_rar5_solid_encrypted_filenames.rar.uu \
|
||||
libarchive/test/test_read_format_rar5_arm.rar.uu \
|
||||
libarchive/test/test_read_format_rar5_blake2.rar.uu \
|
||||
libarchive/test/test_read_format_rar5_compressed.rar.uu \
|
||||
@ -912,6 +962,7 @@ libarchive_test_EXTRA_DIST=\
|
||||
libarchive/test/test_read_format_rar5_multiple_files.rar.uu \
|
||||
libarchive/test/test_read_format_rar5_multiple_files_solid.rar.uu \
|
||||
libarchive/test/test_read_format_rar5_nonempty_dir_stream.rar.uu \
|
||||
libarchive/test/test_read_format_rar5_dirdata.rar.uu \
|
||||
libarchive/test/test_read_format_rar5_owner.rar.uu \
|
||||
libarchive/test/test_read_format_rar5_readtables_overflow.rar.uu \
|
||||
libarchive/test/test_read_format_rar5_sfx.exe.uu \
|
||||
@ -920,6 +971,7 @@ libarchive_test_EXTRA_DIST=\
|
||||
libarchive/test/test_read_format_rar5_stored_manyfiles.rar.uu \
|
||||
libarchive/test/test_read_format_rar5_symlink.rar.uu \
|
||||
libarchive/test/test_read_format_rar5_truncated_huff.rar.uu \
|
||||
libarchive/test/test_read_format_rar5_unicode.rar.uu \
|
||||
libarchive/test/test_read_format_rar5_win32.rar.uu \
|
||||
libarchive/test/test_read_format_rar5_arm_filter_on_window_boundary.rar.uu \
|
||||
libarchive/test/test_read_format_rar5_different_winsize_on_merge.rar.uu \
|
||||
@ -932,17 +984,22 @@ libarchive_test_EXTRA_DIST=\
|
||||
libarchive/test/test_read_format_raw.data.gz.uu \
|
||||
libarchive/test/test_read_format_raw.data.Z.uu \
|
||||
libarchive/test/test_read_format_raw.data.uu \
|
||||
libarchive/test/test_read_format_tar_V_negative_size.tar.uu \
|
||||
libarchive/test/test_read_format_tar_concatenated.tar.uu \
|
||||
libarchive/test/test_read_format_tar_empty_filename.tar.uu \
|
||||
libarchive/test/test_read_format_tar_empty_with_gnulabel.tar.uu \
|
||||
libarchive/test/test_read_format_tar_empty_pax.tar.Z.uu \
|
||||
libarchive/test/test_read_format_tar_filename_koi8r.tar.Z.uu \
|
||||
libarchive/test/test_read_format_tar_invalid_pax_size.tar.uu \
|
||||
libarchive/test/test_read_format_tar_mac_metadata_1.tar.uu \
|
||||
libarchive/test/test_read_format_tar_pax_g_large.tar.uu \
|
||||
libarchive/test/test_read_format_tar_pax_large_attr.tar.Z.uu \
|
||||
libarchive/test/test_read_format_tar_pax_negative_time.tar.uu \
|
||||
libarchive/test/test_read_format_ustar_filename_cp866.tar.Z.uu \
|
||||
libarchive/test/test_read_format_ustar_filename_eucjp.tar.Z.uu \
|
||||
libarchive/test/test_read_format_ustar_filename_koi8r.tar.Z.uu \
|
||||
libarchive/test/test_read_format_warc.warc.uu \
|
||||
libarchive/test/test_read_format_warc_incomplete.warc.uu \
|
||||
libarchive/test/test_read_format_xar_doublelink.xar.uu \
|
||||
libarchive/test/test_read_format_xar_duplicate_filename_node.xar.uu \
|
||||
libarchive/test/test_read_format_zip.zip.uu \
|
||||
@ -1002,6 +1059,7 @@ libarchive_test_EXTRA_DIST=\
|
||||
libarchive/test/test_read_large_splitted_rar_ac.uu \
|
||||
libarchive/test/test_read_large_splitted_rar_ad.uu \
|
||||
libarchive/test/test_read_large_splitted_rar_ae.uu \
|
||||
libarchive/test/test_read_pax_empty_val_no_nl.tar.uu \
|
||||
libarchive/test/test_read_pax_xattr_rht_security_selinux.tar.uu \
|
||||
libarchive/test/test_read_pax_xattr_schily.tar.uu \
|
||||
libarchive/test/test_read_splitted_rar_aa.uu \
|
||||
@ -1013,6 +1071,7 @@ libarchive_test_EXTRA_DIST=\
|
||||
libarchive/test/test_splitted_rar_seek_support_ab.uu \
|
||||
libarchive/test/test_splitted_rar_seek_support_ac.uu \
|
||||
libarchive/test/test_write_disk_appledouble.cpio.gz.uu \
|
||||
libarchive/test/test_write_disk_appledouble_zip.zip.uu \
|
||||
libarchive/test/test_write_disk_hfs_compression.tgz.uu \
|
||||
libarchive/test/test_write_disk_mac_metadata.tar.gz.uu \
|
||||
libarchive/test/test_write_disk_no_hfs_compression.tgz.uu \
|
||||
@ -1022,14 +1081,15 @@ libarchive_test_EXTRA_DIST=\
|
||||
#
|
||||
# Common code for libarchive frontends (cpio, tar)
|
||||
#
|
||||
libarchive_fe_la_SOURCES= \
|
||||
libarchive_fe/err.c \
|
||||
libarchive_fe/err.h \
|
||||
noinst_HEADERS+= \
|
||||
libarchive_fe/lafe_err.h \
|
||||
libarchive_fe/lafe_platform.h \
|
||||
libarchive_fe/line_reader.c \
|
||||
libarchive_fe/line_reader.h \
|
||||
libarchive_fe/passphrase.c \
|
||||
libarchive_fe/passphrase.h
|
||||
libarchive_fe_la_SOURCES= \
|
||||
libarchive_fe/lafe_err.c \
|
||||
libarchive_fe/line_reader.c \
|
||||
libarchive_fe/passphrase.c
|
||||
|
||||
libarchive_fe_la_CPPFLAGS= -I$(top_srcdir)/libarchive
|
||||
#
|
||||
@ -1038,21 +1098,23 @@ libarchive_fe_la_CPPFLAGS= -I$(top_srcdir)/libarchive
|
||||
#
|
||||
#
|
||||
|
||||
noinst_HEADERS+= \
|
||||
tar/bsdtar.h \
|
||||
tar/bsdtar_platform.h
|
||||
bsdtar_SOURCES= \
|
||||
tar/bsdtar.c \
|
||||
tar/bsdtar.h \
|
||||
tar/bsdtar_platform.h \
|
||||
tar/cmdline.c \
|
||||
tar/creation_set.c \
|
||||
tar/read.c \
|
||||
tar/subst.c \
|
||||
tar/util.c \
|
||||
tar/write.c
|
||||
tar/bsdtar.c \
|
||||
tar/cmdline.c \
|
||||
tar/creation_set.c \
|
||||
tar/read.c \
|
||||
tar/subst.c \
|
||||
tar/util.c \
|
||||
tar/write.c
|
||||
|
||||
if INC_WINDOWS_FILES
|
||||
noinst_HEADERS+= \
|
||||
tar/bsdtar_windows.h
|
||||
bsdtar_SOURCES+= \
|
||||
tar/bsdtar_windows.h \
|
||||
tar/bsdtar_windows.c
|
||||
tar/bsdtar_windows.c
|
||||
endif
|
||||
|
||||
bsdtar_DEPENDENCIES= libarchive.la libarchive_fe.la
|
||||
@ -1089,12 +1151,15 @@ endif
|
||||
# bsdtar_test
|
||||
#
|
||||
|
||||
noinst_HEADERS+= \
|
||||
tar/test/test.h
|
||||
|
||||
bsdtar_test_SOURCES= \
|
||||
$(test_utils_SOURCES) \
|
||||
tar/test/test.h \
|
||||
tar/test/test_0.c \
|
||||
tar/test/test_basic.c \
|
||||
tar/test/test_copy.c \
|
||||
tar/test/test_crlf_mtree.c \
|
||||
tar/test/test_empty_mtree.c \
|
||||
tar/test/test_extract_tar_Z.c \
|
||||
tar/test/test_extract_tar_bz2.c \
|
||||
@ -1110,12 +1175,14 @@ bsdtar_test_SOURCES= \
|
||||
tar/test/test_format_newc.c \
|
||||
tar/test/test_help.c \
|
||||
tar/test/test_leading_slash.c \
|
||||
tar/test/test_list_item.c \
|
||||
tar/test/test_missing_file.c \
|
||||
tar/test/test_option_C_mtree.c \
|
||||
tar/test/test_option_C_upper.c \
|
||||
tar/test/test_option_H_upper.c \
|
||||
tar/test/test_option_L_upper.c \
|
||||
tar/test/test_option_O_upper.c \
|
||||
tar/test/test_option_P_upper.c \
|
||||
tar/test/test_option_T_upper.c \
|
||||
tar/test/test_option_U_upper.c \
|
||||
tar/test/test_option_X_upper.c \
|
||||
@ -1137,6 +1204,7 @@ bsdtar_test_SOURCES= \
|
||||
tar/test/test_option_lz4.c \
|
||||
tar/test/test_option_lzma.c \
|
||||
tar/test/test_option_lzop.c \
|
||||
tar/test/test_option_mtime.c \
|
||||
tar/test/test_option_n.c \
|
||||
tar/test/test_option_newer_than.c \
|
||||
tar/test/test_option_nodump.c \
|
||||
@ -1168,9 +1236,9 @@ bsdtar_test_CPPFLAGS=\
|
||||
-I$(top_builddir)/tar/test \
|
||||
$(PLATFORMCPPFLAGS)
|
||||
|
||||
tar/test/list.h: Makefile
|
||||
tar/test/list.h: $(bsdtar_test_SOURCES)
|
||||
$(MKDIR_P) tar/test
|
||||
cat $(top_srcdir)/tar/test/test_*.c | grep '^DEFINE_TEST' > tar/test/list.h
|
||||
grep -h '^DEFINE_TEST(' $^ | LC_COLLATE=C sort > $@
|
||||
|
||||
if BUILD_BSDTAR
|
||||
bsdtar_test_programs= bsdtar_test
|
||||
@ -1194,6 +1262,7 @@ bsdtar_test_EXTRA_DIST= \
|
||||
tar/test/test_extract.tar.lzo.uu \
|
||||
tar/test/test_extract.tar.xz.uu \
|
||||
tar/test/test_leading_slash.tar.uu \
|
||||
tar/test/test_list_item.tar.uu \
|
||||
tar/test/test_option_keep_newer_files.tar.Z.uu \
|
||||
tar/test/test_option_passphrase.zip.uu \
|
||||
tar/test/test_option_s.tar.Z.uu \
|
||||
@ -1210,16 +1279,18 @@ bsdtar_test_EXTRA_DIST= \
|
||||
#
|
||||
#
|
||||
|
||||
noinst_HEADERS+= \
|
||||
cpio/cpio.h \
|
||||
cpio/cpio_platform.h
|
||||
bsdcpio_SOURCES= \
|
||||
cpio/cmdline.c \
|
||||
cpio/cpio.c \
|
||||
cpio/cpio.h \
|
||||
cpio/cpio_platform.h
|
||||
cpio/cmdline.c \
|
||||
cpio/cpio.c
|
||||
|
||||
if INC_WINDOWS_FILES
|
||||
noinst_HEADERS+= \
|
||||
cpio/cpio_windows.h
|
||||
bsdcpio_SOURCES+= \
|
||||
cpio/cpio_windows.h \
|
||||
cpio/cpio_windows.c
|
||||
cpio/cpio_windows.c
|
||||
endif
|
||||
|
||||
bsdcpio_DEPENDENCIES = libarchive.la libarchive_fe.la
|
||||
@ -1258,14 +1329,16 @@ endif
|
||||
# bsdcpio_test
|
||||
#
|
||||
|
||||
noinst_HEADERS+= \
|
||||
cpio/test/test.h
|
||||
bsdcpio_test_SOURCES= \
|
||||
$(test_utils_SOURCES) \
|
||||
cpio/cmdline.c \
|
||||
cpio/test/test.h \
|
||||
cpio/test/test_0.c \
|
||||
cpio/test/test_basic.c \
|
||||
cpio/test/test_cmdline.c \
|
||||
cpio/test/test_extract_cpio_Z.c \
|
||||
cpio/test/test_extract_cpio_absolute_paths.c \
|
||||
cpio/test/test_extract_cpio_bz2.c \
|
||||
cpio/test/test_extract_cpio_grz.c \
|
||||
cpio/test/test_extract_cpio_gz.c \
|
||||
@ -1319,9 +1392,9 @@ bsdcpio_test_CPPFLAGS= \
|
||||
$(PLATFORMCPPFLAGS)
|
||||
bsdcpio_test_LDADD=libarchive_fe.la
|
||||
|
||||
cpio/test/list.h: Makefile
|
||||
cpio/test/list.h: $(bsdcpio_test_SOURCES)
|
||||
$(MKDIR_P) cpio/test
|
||||
cat $(top_srcdir)/cpio/test/test_*.c | grep '^DEFINE_TEST' > cpio/test/list.h
|
||||
grep -h '^DEFINE_TEST(' $^ | LC_COLLATE=C sort > $@
|
||||
|
||||
if BUILD_BSDCPIO
|
||||
bsdcpio_test_programs= bsdcpio_test
|
||||
@ -1366,13 +1439,15 @@ bsdcpio_test_EXTRA_DIST= \
|
||||
#
|
||||
#
|
||||
|
||||
noinst_HEADERS+= \
|
||||
cat/bsdcat.h \
|
||||
cat/bsdcat_platform.h
|
||||
bsdcat_SOURCES= \
|
||||
cat/bsdcat.c \
|
||||
cat/bsdcat.h \
|
||||
cat/bsdcat_platform.h \
|
||||
cat/cmdline.c
|
||||
cat/bsdcat.c \
|
||||
cat/cmdline.c
|
||||
|
||||
if INC_WINDOWS_FILES
|
||||
noinst_HEADERS+=
|
||||
bsdcat_SOURCES+=
|
||||
endif
|
||||
|
||||
@ -1409,9 +1484,10 @@ endif
|
||||
# bsdcat_test
|
||||
#
|
||||
|
||||
noinst_HEADERS+= \
|
||||
cat/test/test.h
|
||||
bsdcat_test_SOURCES= \
|
||||
$(test_utils_SOURCES) \
|
||||
cat/test/test.h \
|
||||
cat/test/test_0.c \
|
||||
cat/test/test_empty_gz.c \
|
||||
cat/test/test_empty_lz4.c \
|
||||
@ -1439,9 +1515,9 @@ bsdcat_test_CPPFLAGS= \
|
||||
$(PLATFORMCPPFLAGS)
|
||||
bsdcat_test_LDADD=libarchive_fe.la
|
||||
|
||||
cat/test/list.h: Makefile
|
||||
cat/test/list.h: $(bsdcat_test_SOURCES)
|
||||
$(MKDIR_P) cat/test
|
||||
cat $(top_srcdir)/cat/test/test_*.c | grep '^DEFINE_TEST' > cat/test/list.h
|
||||
grep -h '^DEFINE_TEST(' $^ | LC_COLLATE=C sort > $@
|
||||
|
||||
if BUILD_BSDCAT
|
||||
bsdcat_test_programs= bsdcat_test
|
||||
@ -1472,15 +1548,18 @@ bsdcat_test_EXTRA_DIST= \
|
||||
#
|
||||
#
|
||||
|
||||
noinst_HEADERS+= \
|
||||
unzip/bsdunzip.h \
|
||||
unzip/bsdunzip_platform.h \
|
||||
unzip/la_getline.h \
|
||||
unzip/la_queue.h
|
||||
bsdunzip_SOURCES= \
|
||||
unzip/bsdunzip.c \
|
||||
unzip/bsdunzip.h \
|
||||
unzip/bsdunzip_platform.h \
|
||||
unzip/cmdline.c \
|
||||
unzip/la_getline.c \
|
||||
unzip/la_queue.h
|
||||
unzip/bsdunzip.c \
|
||||
unzip/cmdline.c \
|
||||
unzip/la_getline.c
|
||||
|
||||
if INC_WINDOWS_FILES
|
||||
noinst_HEADERS+=
|
||||
bsdunzip_SOURCES+=
|
||||
endif
|
||||
|
||||
@ -1517,9 +1596,10 @@ endif
|
||||
# bsdunzip_test
|
||||
#
|
||||
|
||||
noinst_HEADERS+= \
|
||||
unzip/test/test.h
|
||||
bsdunzip_test_SOURCES= \
|
||||
$(test_utils_SOURCES) \
|
||||
unzip/test/test.h \
|
||||
unzip/test/test_0.c \
|
||||
unzip/test/test_basic.c \
|
||||
unzip/test/test_doubledash.c \
|
||||
@ -1550,9 +1630,9 @@ bsdunzip_test_CPPFLAGS= \
|
||||
$(PLATFORMCPPFLAGS)
|
||||
bsdunzip_test_LDADD=libarchive_fe.la
|
||||
|
||||
unzip/test/list.h: Makefile
|
||||
unzip/test/list.h: $(bsdunzip_test_SOURCES)
|
||||
$(MKDIR_P) unzip/test
|
||||
cat $(top_srcdir)/unzip/test/test_*.c | grep '^DEFINE_TEST' > unzip/test/list.h
|
||||
grep -h '^DEFINE_TEST(' $^ | LC_COLLATE=C sort > $@
|
||||
|
||||
if BUILD_BSDUNZIP
|
||||
bsdunzip_test_programs= bsdunzip_test
|
||||
|
||||
10
NEWS
10
NEWS
@ -1,3 +1,13 @@
|
||||
May 20, 2025: libarchive 3.8.0 released
|
||||
|
||||
Mar 30, 2025: libarchive 3.7.9 released
|
||||
|
||||
Mar 20, 2025: libarchive 3.7.8 released
|
||||
|
||||
Oct 13, 2024: libarchive 3.7.7 released
|
||||
|
||||
Sep 23, 2024: libarchive 3.7.6 released
|
||||
|
||||
Sep 13, 2024: libarchive 3.7.5 released
|
||||
|
||||
Apr 26, 2024: libarchive 3.7.4 released
|
||||
|
||||
13
README.md
13
README.md
@ -85,13 +85,14 @@ Currently, the library automatically detects and reads the following formats:
|
||||
* PWB binary cpio
|
||||
* ISO9660 CD-ROM images (with optional Rockridge or Joliet extensions)
|
||||
* ZIP archives (with uncompressed or "deflate" compressed entries, including support for encrypted Zip archives)
|
||||
* ZIPX archives (with support for bzip2, ppmd8, lzma and xz compressed entries)
|
||||
* ZIPX archives (with support for bzip2, zstd, ppmd8, lzma and xz compressed entries)
|
||||
* GNU and BSD 'ar' archives
|
||||
* 'mtree' format
|
||||
* 7-Zip archives (including archives that use zstandard compression)
|
||||
* Microsoft CAB format
|
||||
* LHA and LZH archives
|
||||
* RAR and RAR 5.0 archives (with some limitations due to RAR's proprietary status)
|
||||
* WARC archives
|
||||
* XAR archives
|
||||
|
||||
The library also detects and handles any of the following before evaluating the archive:
|
||||
@ -120,15 +121,18 @@ The library can create archives in any of the following formats:
|
||||
* PWB binary cpio
|
||||
* shar archives
|
||||
* ZIP archives (with uncompressed or "deflate" compressed entries)
|
||||
* ZIPX archives (with bzip2, zstd, lzma or xz compressed entries)
|
||||
* GNU and BSD 'ar' archives
|
||||
* 'mtree' format
|
||||
* ISO9660 format
|
||||
* 7-Zip archives
|
||||
* 7-Zip archives (including archives that use zstandard compression)
|
||||
* WARC archives
|
||||
* XAR archives
|
||||
|
||||
When creating archives, the result can be filtered with any of the following:
|
||||
|
||||
* uuencode
|
||||
* base64
|
||||
* gzip compression
|
||||
* bzip2 compression
|
||||
* compress/LZW compression
|
||||
@ -187,7 +191,7 @@ questions we are asked about libarchive:
|
||||
libraries. This also reduces the size of statically-linked
|
||||
binaries in environments where that matters.
|
||||
|
||||
* The library is generally _thread safe_ depending on the platform:
|
||||
* The library is generally _thread-safe_ depending on the platform:
|
||||
it does not define any global variables of its own. However, some
|
||||
platforms do not provide fully thread-safe versions of key C library
|
||||
functions. On those platforms, libarchive will use the non-thread-safe
|
||||
@ -210,7 +214,7 @@ questions we are asked about libarchive:
|
||||
multiple threads. Of course, those modules are completely
|
||||
optional and you can use the rest of libarchive without them.
|
||||
|
||||
* The library is _not_ thread aware, however. It does no locking
|
||||
* The library is _not_ thread-aware, however. It does no locking
|
||||
or thread management of any kind. If you create a libarchive
|
||||
object and need to access it from multiple threads, you will
|
||||
need to provide your own locking.
|
||||
@ -241,4 +245,3 @@ questions we are asked about libarchive:
|
||||
appropriate. It has many advantages over other tar formats
|
||||
(including the legacy GNU tar format) and is widely supported by
|
||||
current tar implementations.
|
||||
|
||||
|
||||
@ -16,4 +16,4 @@ Please provide the following information in your report:
|
||||
- How to reproduce the issue
|
||||
|
||||
This project is maintained by volunteers on a reasonable-effort basis. As such, we ask
|
||||
that you give me 90 days to work on a fix before public exposure.
|
||||
that you give us 90 days to work on a fix before public exposure.
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
|
||||
PATH=/usr/local/gnu-autotools/bin/:$PATH
|
||||
export PATH
|
||||
|
||||
# Start from one level above the build directory
|
||||
if [ -f version ]; then
|
||||
@ -49,7 +49,7 @@ perl -p -i -e 's/(m4_define\(\[LIBARCHIVE_VERSION_S\]),.*\)/$1,['"$VS"'])/' conf
|
||||
perl -p -i -e 's/(m4_define\(\[LIBARCHIVE_VERSION_N\]),.*\)/$1,['"$VN"'])/' configure.ac
|
||||
|
||||
# Remove developer CFLAGS if a release build is being made
|
||||
if [ -n "${MAKE_LIBARCHIVE_RELEASE}" ]; then
|
||||
if [ -n "${MAKE_LIBARCHIVE_RELEASE:-}" ]; then
|
||||
perl -p -i -e "s/^(DEV_CFLAGS.*)/# \$1/" Makefile.am
|
||||
perl -p -i -e 's/CMAKE_BUILD_TYPE "[A-Za-z]*"/CMAKE_BUILD_TYPE "Release"/' CMakeLists.txt
|
||||
fi
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
#!/bin/sh +v
|
||||
set -eu
|
||||
|
||||
# Start from the build directory, where the version file is located
|
||||
if [ -f build/version ]; then
|
||||
|
||||
@ -12,14 +12,18 @@
|
||||
# MAKE_ARGS= # make arguments
|
||||
# DEBUG= # set -g -fsanitize=address flags
|
||||
|
||||
set -eu
|
||||
|
||||
ACTIONS=
|
||||
if [ -n "${BUILD_SYSTEM}" ]; then
|
||||
if [ -n "${BUILD_SYSTEM:-}" ]; then
|
||||
BS="${BUILD_SYSTEM}"
|
||||
fi
|
||||
|
||||
BS="${BS:-autotools}"
|
||||
MAKE="${MAKE:-make}"
|
||||
CMAKE="${CMAKE:-cmake}"
|
||||
CMAKE_ARGS="${CMAKE_ARGS:-}"
|
||||
CONFIGURE_ARGS="${CONFIGURE_ARGS:-}"
|
||||
CURDIR=`pwd`
|
||||
SRCDIR="${SRCDIR:-`pwd`}"
|
||||
RET=0
|
||||
@ -74,7 +78,7 @@ while getopts a:b:c:d:s: opt; do
|
||||
;;
|
||||
esac
|
||||
done
|
||||
case "${CRYPTO}" in
|
||||
case "${CRYPTO:-}" in
|
||||
mbedtls)
|
||||
CMAKE_ARGS="${CMAKE_ARGS} -DENABLE_OPENSSL=OFF -DENABLE_MBEDTLS=ON"
|
||||
CONFIGURE_ARGS="${CONFIGURE_ARGS} --without-openssl --with-mbedtls"
|
||||
@ -84,15 +88,21 @@ case "${CRYPTO}" in
|
||||
CONFIGURE_ARGS="${CONFIGURE_ARGS} --without-openssl --with-nettle"
|
||||
;;
|
||||
esac
|
||||
if [ -z "${MAKE_ARGS}" ]; then
|
||||
if [ -z "${MAKE_ARGS:-}" ]; then
|
||||
if [ "${BS}" = "autotools" ]; then
|
||||
MAKE_ARGS="V=1"
|
||||
elif [ "${BS}" = "cmake" ]; then
|
||||
MAKE_ARGS="VERBOSE=1"
|
||||
fi
|
||||
fi
|
||||
if [ -n "${DEBUG}" ]; then
|
||||
if [ -n "${CFLAGS}" ]; then
|
||||
if [ -d /opt/homebrew/include ]; then
|
||||
export CFLAGS="${CFLAGS:-} -I/opt/homebrew/include"
|
||||
fi
|
||||
if [ -d /opt/homebrew/lib ]; then
|
||||
export LDFLAGS="${LDFLAGS:-} -L/opt/homebrew/lib"
|
||||
fi
|
||||
if [ -n "${DEBUG:-}" ]; then
|
||||
if [ -n "${CFLAGS:-}" ]; then
|
||||
export CFLAGS="${CFLAGS} -g -fsanitize=address"
|
||||
else
|
||||
export CFLAGS="-g -fsanitize=address"
|
||||
@ -104,7 +114,7 @@ fi
|
||||
if [ -z "${BS}" ]; then
|
||||
inputerror "Missing build system (-b) parameter"
|
||||
fi
|
||||
if [ -z "${BUILDDIR}" ]; then
|
||||
if [ -z "${BUILDDIR:-}" ]; then
|
||||
BUILDDIR="${CURDIR}/build_ci/${BS}"
|
||||
fi
|
||||
mkdir -p "${BUILDDIR}"
|
||||
@ -141,18 +151,19 @@ for action in ${ACTIONS}; do
|
||||
;;
|
||||
esac
|
||||
RET="$?"
|
||||
find ${TMPDIR:-/tmp} -path '*_test.*' -name '*.log' -print -exec cat {} \;
|
||||
find ${TMPDIR:-/tmp} -path '*_test.*' -name '*.log' -print -exec cat {} \; 2>/dev/null || /bin/true
|
||||
;;
|
||||
install)
|
||||
${MAKE} ${MAKE_ARGS} install DESTDIR="${BUILDDIR}/destdir"
|
||||
RET="$?"
|
||||
cd "${BUILDDIR}/destdir" && ls -lR .
|
||||
./usr/local/bin/bsdtar --version
|
||||
;;
|
||||
distcheck)
|
||||
${MAKE} ${MAKE_ARGS} distcheck || (
|
||||
RET="$?"
|
||||
find . -name 'test-suite.log' -print -exec cat {} \;
|
||||
find ${TMPDIR:-/tmp} -path '*_test.*' -name '*.log' -print -exec cat {} \;
|
||||
find ${TMPDIR:-/tmp} -path '*_test.*' -name '*.log' -print -exec cat {} \; 2>/dev/null || /bin/true
|
||||
exit "${RET}"
|
||||
)
|
||||
RET="$?"
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
FROM cirrusci/windowsservercore:2019
|
||||
|
||||
RUN choco install -y --no-progress cygwin
|
||||
RUN C:\tools\cygwin\cygwinsetup.exe -q -P make,autoconf,automake,cmake,gcc-core,binutils,libtool,pkg-config,bison,sharutils,zlib-devel,libbz2-devel,liblzma-devel,liblz4-devel,libiconv-devel,libxml2-devel,libzstd-devel,libssl-devel
|
||||
RUN C:\tools\cygwin\cygwinsetup.exe -q -P make,autoconf,automake,cmake,gcc-core,binutils,libtool,pkg-config,bison,zlib-devel,libbz2-devel,liblzma-devel,liblz4-devel,libiconv-devel,libxml2-devel,libzstd-devel,libssl-devel
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
FROM fedora:31
|
||||
|
||||
RUN dnf -y install make cmake gcc gcc-c++ kernel-devel automake libtool bison sharutils pkgconf libacl-devel libasan librichacl-devel bzip2-devel zlib-devel xz-devel lz4-devel libzstd-devel openssl-devel nettle-devel mbedtls-devel
|
||||
RUN dnf -y install make cmake gcc gcc-c++ kernel-devel automake libtool bison pkgconf libacl-devel libasan librichacl-devel bzip2-devel zlib-devel xz-devel lz4-devel libzstd-devel openssl-devel nettle-devel mbedtls-devel
|
||||
|
||||
@ -1,3 +1,3 @@
|
||||
FROM fedora:31
|
||||
|
||||
RUN dnf -y install make cmake gcc gcc-c++ kernel-devel automake libtool bison sharutils pkgconf libacl-devel libasan librichacl-devel bzip2-devel zlib-devel xz-devel lz4-devel libzstd-devel openssl-devel groff ghostscript xz zip
|
||||
RUN dnf -y install make cmake gcc gcc-c++ kernel-devel automake libtool bison pkgconf libacl-devel libasan librichacl-devel bzip2-devel zlib-devel xz-devel lz4-devel libzstd-devel openssl-devel groff ghostscript xz zip
|
||||
|
||||
@ -9,4 +9,4 @@ RUN tar -x -f zlib-1.2.11.tar.gz
|
||||
RUN cd zlib-1.2.11 && cmake -G "Visual Studio 15 2017" . && cmake --build . --target ALL_BUILD --config Release && cmake --build . --target INSTALL --config Release
|
||||
RUN del /f /q /s zlib-1.2.11 zlib-1.2.11.tar.gz
|
||||
RUN choco install -y --no-progress cygwin
|
||||
RUN C:\tools\cygwin\cygwinsetup.exe -q -P make,autoconf,automake,cmake,gcc-core,binutils,libtool,pkg-config,bison,sharutils,zlib-devel,libbz2-devel,liblzma-devel,liblz4-devel,libiconv-devel,libxml2-devel,libzstd-devel,libssl-devel
|
||||
RUN C:\tools\cygwin\cygwinsetup.exe -q -P make,autoconf,automake,cmake,gcc-core,binutils,libtool,pkg-config,bison,zlib-devel,libbz2-devel,liblzma-devel,liblz4-devel,libiconv-devel,libxml2-devel,libzstd-devel,libssl-devel
|
||||
|
||||
@ -13,7 +13,7 @@ IF "%1%"=="prepare" (
|
||||
IF "%BE%"=="cygwin-gcc" (
|
||||
@ECHO ON
|
||||
choco install -y --no-progress cygwin || EXIT /b 1
|
||||
C:\tools\cygwin\cygwinsetup.exe -q -P make,autoconf,automake,cmake,gcc-core,binutils,libtool,pkg-config,bison,sharutils,zlib-devel,libbz2-devel,liblzma-devel,liblz4-devel,libiconv-devel,libxml2-devel,libzstd-devel,libssl-devel || EXIT /b 1
|
||||
C:\tools\cygwin\cygwinsetup.exe -q -P make,autoconf,automake,cmake,gcc-core,binutils,libtool,pkg-config,bison,zlib-devel,libbz2-devel,liblzma-devel,liblz4-devel,libiconv-devel,libxml2-devel,libzstd-devel,libssl-devel || EXIT /b 1
|
||||
@EXIT /b 0
|
||||
) ELSE IF "%BE%"=="mingw-gcc" (
|
||||
@ECHO ON
|
||||
|
||||
@ -1,4 +1,12 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
|
||||
if [ $# != 1 ]
|
||||
then
|
||||
echo "Usage: $0 prepare | test"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
UNAME=`uname`
|
||||
if [ "$1" = "prepare" ]
|
||||
then
|
||||
@ -15,7 +23,7 @@ then
|
||||
tunefs -N enable /dev/$MD
|
||||
mount /dev/$MD /tmp_acl_nfsv4
|
||||
chmod 1777 /tmp_acl_nfsv4
|
||||
pkg install -y autoconf automake cmake libiconv libtool pkgconf expat libxml2 liblz4 zstd
|
||||
pkg install -y autoconf automake cmake libiconv libtool pkgconf expat libxml2 liblz4 zstd gmake
|
||||
elif [ "${UNAME}" = "Darwin" ]
|
||||
then
|
||||
set -x -e
|
||||
@ -29,10 +37,10 @@ then
|
||||
if [ -f "/etc/debian_version" ]
|
||||
then
|
||||
apt-get -y update
|
||||
apt-get -y install build-essential locales automake libtool bison sharutils pkgconf libacl1-dev libbz2-dev zlib1g-dev liblzma-dev liblz4-dev libzstd-dev libssl-dev lrzip cmake
|
||||
apt-get -y install build-essential locales automake libtool bison pkgconf libacl1-dev libbz2-dev zlib1g-dev liblzma-dev liblz4-dev libzstd-dev libssl-dev lrzip cmake
|
||||
elif [ -f "/etc/fedora-release" ]
|
||||
then
|
||||
dnf -y install make cmake gcc gcc-c++ kernel-devel automake libtool bison sharutils pkgconf libacl-devel librichacl-devel bzip2-devel zlib-devel xz-devel lz4-devel libzstd-devel openssl-devel
|
||||
dnf -y install make cmake gcc gcc-c++ kernel-devel automake libtool bison pkgconf libacl-devel librichacl-devel bzip2-devel zlib-devel xz-devel lz4-devel libzstd-devel openssl-devel
|
||||
fi
|
||||
fi
|
||||
elif [ "$1" = "test" ]
|
||||
@ -53,6 +61,6 @@ then
|
||||
TMPDIR=/tmp_acl_nfsv4 ${BIN_SUBDIR}/libarchive_test -r "${CURDIR}/libarchive/test" -v test_acl_platform_nfs4
|
||||
fi
|
||||
else
|
||||
echo "Usage $0 prepare | test_nfsv4_acls"
|
||||
echo "Usage: $0 prepare | test"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
@ECHO OFF
|
||||
SET ZLIB_VERSION=1.3
|
||||
SET BZIP2_VERSION=1ea1ac188ad4b9cb662e3f8314673c63df95a589
|
||||
SET XZ_VERSION=5.4.4
|
||||
SET XZ_VERSION=5.6.3
|
||||
IF NOT "%BE%"=="mingw-gcc" (
|
||||
IF NOT "%BE%"=="msvc" (
|
||||
ECHO Environment variable BE must be mingw-gcc or msvc
|
||||
@ -64,7 +64,7 @@ IF "%1"=="deplibs" (
|
||||
IF "%BE%"=="mingw-gcc" (
|
||||
SET PATH=%MINGWPATH%
|
||||
cmake -G "MinGW Makefiles" -D CMAKE_BUILD_TYPE="Release" . || EXIT /b 1
|
||||
mingw32-make || EXIT /b 1
|
||||
mingw32-make -j %NUMBER_OF_PROCESSORS% || EXIT /b 1
|
||||
mingw32-make test || EXIT /b 1
|
||||
mingw32-make install || EXIT /b 1
|
||||
) ELSE IF "%BE%"=="msvc" (
|
||||
@ -78,7 +78,7 @@ IF "%1"=="deplibs" (
|
||||
IF "%BE%"=="mingw-gcc" (
|
||||
SET PATH=%MINGWPATH%
|
||||
cmake -G "MinGW Makefiles" -D CMAKE_BUILD_TYPE="Release" -D ENABLE_LIB_ONLY=ON -D ENABLE_SHARED_LIB=OFF -D ENABLE_STATIC_LIB=ON . || EXIT /b 1
|
||||
mingw32-make || EXIT /b 1
|
||||
mingw32-make -j %NUMBER_OF_PROCESSORS% || EXIT /b 1
|
||||
REM mingw32-make test || EXIT /b 1
|
||||
mingw32-make install || EXIT /b 1
|
||||
) ELSE IF "%BE%"=="msvc" (
|
||||
@ -92,7 +92,7 @@ IF "%1"=="deplibs" (
|
||||
IF "%BE%"=="mingw-gcc" (
|
||||
SET PATH=%MINGWPATH%
|
||||
cmake -G "MinGW Makefiles" -D CMAKE_BUILD_TYPE="Release" . || EXIT /b 1
|
||||
mingw32-make || EXIT /b 1
|
||||
mingw32-make -j %NUMBER_OF_PROCESSORS% || EXIT /b 1
|
||||
mingw32-make install || EXIT /b 1
|
||||
) ELSE IF "%BE%"=="msvc" (
|
||||
cmake -G "Visual Studio 17 2022" -D CMAKE_BUILD_TYPE="Release" . || EXIT /b 1
|
||||
@ -104,7 +104,7 @@ IF "%1"=="deplibs" (
|
||||
IF "%BE%"=="mingw-gcc" (
|
||||
SET PATH=%MINGWPATH%
|
||||
cmake -G "MinGW Makefiles" -D CMAKE_BUILD_TYPE="Release" . || EXIT /b 1
|
||||
mingw32-make || EXIT /b 1
|
||||
mingw32-make -j %NUMBER_OF_PROCESSORS% || EXIT /b 1
|
||||
mingw32-make install || EXIT /b 1
|
||||
) ELSE IF "%BE%"=="msvc" (
|
||||
cmake -G "Visual Studio 17 2022" -D CMAKE_BUILD_TYPE="Release" . || EXIT /b 1
|
||||
@ -120,13 +120,13 @@ IF "%1"=="deplibs" (
|
||||
) ELSE IF "%BE%"=="msvc" (
|
||||
MKDIR build_ci\cmake
|
||||
CD build_ci\cmake
|
||||
cmake -G "Visual Studio 17 2022" -D CMAKE_BUILD_TYPE="Release" -D ZLIB_LIBRARY="C:/Program Files (x86)/zlib/lib/zlibstatic.lib" -D ZLIB_INCLUDE_DIR="C:/Program Files (x86)/zlib/include" -D BZIP2_LIBRARIES="C:/Program Files (x86)/bzip2/lib/bz2_static.lib" -D BZIP2_INCLUDE_DIR="C:/Program Files (x86)/bzip2/include" -D LIBLZMA_LIBRARY="C:/Program Files (x86)/xz/lib/liblzma.lib" -D LIBLZMA_INCLUDE_DIR="C:/Program Files (x86)/xz/include" -D ZSTD_LIBRARY="C:/Program Files (x86)/zstd/lib/zstd_static.lib" -D ZSTD_INCLUDE_DIR="C:/Program Files (x86)/zstd/include" ..\.. || EXIT /b 1
|
||||
cmake -G "Visual Studio 17 2022" -D CMAKE_BUILD_TYPE="Release" -D ZLIB_LIBRARY="C:/Program Files (x86)/zlib/lib/zlibstatic.lib" -D ZLIB_INCLUDE_DIR="C:/Program Files (x86)/zlib/include" -D BZIP2_LIBRARIES="C:/Program Files (x86)/bzip2/lib/bz2_static.lib" -D BZIP2_INCLUDE_DIR="C:/Program Files (x86)/bzip2/include" -D LIBLZMA_LIBRARY="C:/Program Files (x86)/xz/lib/lzma.lib" -D LIBLZMA_INCLUDE_DIR="C:/Program Files (x86)/xz/include" -D ZSTD_LIBRARY="C:/Program Files (x86)/zstd/lib/zstd_static.lib" -D ZSTD_INCLUDE_DIR="C:/Program Files (x86)/zstd/include" ..\.. || EXIT /b 1
|
||||
)
|
||||
) ELSE IF "%1%"=="build" (
|
||||
IF "%BE%"=="mingw-gcc" (
|
||||
SET PATH=%MINGWPATH%
|
||||
CD build_ci\cmake
|
||||
mingw32-make VERBOSE=1 || EXIT /b 1
|
||||
mingw32-make -j %NUMBER_OF_PROCESSORS% VERBOSE=1 || EXIT /b 1
|
||||
) ELSE IF "%BE%"=="msvc" (
|
||||
CD build_ci\cmake
|
||||
cmake --build . --target ALL_BUILD --config Release || EXIT /b 1
|
||||
@ -138,10 +138,8 @@ IF "%1"=="deplibs" (
|
||||
SET SKIP_TEST_SPARSE=1
|
||||
mingw32-make test VERBOSE=1 || EXIT /b 1
|
||||
) ELSE IF "%BE%"=="msvc" (
|
||||
ECHO "Skipping tests on this platform"
|
||||
EXIT /b 0
|
||||
REM CD build_ci\cmake
|
||||
REM cmake --build . --target RUN_TESTS --config Release || EXIT /b 1
|
||||
CD build_ci\cmake
|
||||
cmake --build . --target RUN_TESTS --config Release || EXIT /b 1
|
||||
)
|
||||
) ELSE IF "%1%"=="install" (
|
||||
IF "%BE%"=="mingw-gcc" (
|
||||
@ -152,6 +150,7 @@ IF "%1"=="deplibs" (
|
||||
CD build_ci\cmake
|
||||
cmake --build . --target INSTALL --config Release || EXIT /b 1
|
||||
)
|
||||
"C:\Program Files (x86)\libarchive\bin\bsdtar.exe" --version
|
||||
) ELSE IF "%1"=="artifact" (
|
||||
C:\windows\system32\tar.exe -c -C "C:\Program Files (x86)" --format=zip -f libarchive.zip libarchive
|
||||
) ELSE (
|
||||
|
||||
22
build/ci/github_actions/install-macos-dependencies.sh
Executable file
22
build/ci/github_actions/install-macos-dependencies.sh
Executable file
@ -0,0 +1,22 @@
|
||||
#!/bin/sh
|
||||
set -eux
|
||||
|
||||
# Uncommenting these adds a full minute to the CI time
|
||||
#brew update > /dev/null
|
||||
#brew upgrade > /dev/null
|
||||
|
||||
# Workaround for cmake in local/pinned tap issue
|
||||
brew uninstall cmake
|
||||
|
||||
# This does an upgrade if the package is already installed
|
||||
brew install \
|
||||
autoconf \
|
||||
automake \
|
||||
libtool \
|
||||
pkg-config \
|
||||
cmake \
|
||||
xz \
|
||||
lz4 \
|
||||
zstd \
|
||||
libxml2 \
|
||||
openssl
|
||||
@ -1,21 +0,0 @@
|
||||
#!/bin/sh
|
||||
if [ "$1" = "prepare" ]
|
||||
then
|
||||
set -x -e
|
||||
#Uncommenting these adds a full minute to the CI time
|
||||
#brew update > /dev/null
|
||||
#brew upgrade > /dev/null
|
||||
|
||||
# This does an upgrade if the package is already installed
|
||||
brew install \
|
||||
autoconf \
|
||||
automake \
|
||||
libtool \
|
||||
pkg-config \
|
||||
cmake \
|
||||
xz \
|
||||
lz4 \
|
||||
zstd \
|
||||
libxml2 \
|
||||
openssl
|
||||
fi
|
||||
@ -1,33 +0,0 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
UNAME=`uname`
|
||||
CURDIR=`pwd`
|
||||
SRCDIR="${SRCDIR:-`pwd`}"
|
||||
if [ -z "${BUILDDIR}" ]; then
|
||||
BUILDDIR="${CURDIR}/build_ci/${BS}"
|
||||
fi
|
||||
mkdir -p "${BUILDDIR}"
|
||||
cd "${BUILDDIR}"
|
||||
case "$UNAME" in
|
||||
MSYS*)
|
||||
if [ "${BS}" = "msbuild" ]; then
|
||||
set -x
|
||||
cmake -G "Visual Studio 15 2017" -D CMAKE_BUILD_TYPE="Release" "${SRCDIR}"
|
||||
cmake --build . --target ALL_BUILD
|
||||
# Until fixed, we don't run tests on Windows (lots of fails + timeout)
|
||||
#export SKIP_TEST_FUZZ=1
|
||||
#cmake --build . --target RUN_TESTS
|
||||
set +x
|
||||
elif [ "${BS}" = "mingw" ]; then
|
||||
set -x
|
||||
cmake -G "MSYS Makefiles" -D CMAKE_C_COMPILER="${CC}" -D CMAKE_MAKE_PROGRAM="mingw32-make" -D CMAKE_BUILD_TYPE="Release" "${SRCDIR}"
|
||||
mingw32-make
|
||||
#export SKIP_TEST_FUZZ=1
|
||||
#mingw32-make test
|
||||
set +x
|
||||
else
|
||||
echo "Unknown or unspecified build type: ${BS}"
|
||||
exit 1
|
||||
fi
|
||||
;;
|
||||
esac
|
||||
@ -1,4 +1,5 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
|
||||
#
|
||||
# Attempt to remove as many generated files as we can.
|
||||
|
||||
@ -29,5 +29,5 @@ CONFIGURE_FILE(${CMAKE_CURRENT_SOURCE_DIR}/build/pkgconfig/libarchive.pc.in
|
||||
# And install it, of course ;).
|
||||
IF(ENABLE_INSTALL)
|
||||
INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/build/pkgconfig/libarchive.pc
|
||||
DESTINATION "lib/pkgconfig")
|
||||
DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig")
|
||||
ENDIF()
|
||||
|
||||
@ -19,13 +19,13 @@
|
||||
# xdg-open coverage/index.html
|
||||
#################################################################
|
||||
|
||||
# Find programs we need
|
||||
# Find programs we need
|
||||
FIND_PROGRAM(LCOV_EXECUTABLE lcov DOC "Full path to lcov executable")
|
||||
FIND_PROGRAM(GENHTML_EXECUTABLE genhtml DOC "Full path to genhtml executable")
|
||||
MARK_AS_ADVANCED(LCOV_EXECUTABLE GENHTML_EXECUTABLE)
|
||||
|
||||
# Check, compiler, build types and programs are available
|
||||
IF(NOT CMAKE_COMPILER_IS_GNUCC)
|
||||
IF(NOT CMAKE_C_COMPILER_ID STREQUAL "GNU")
|
||||
MESSAGE(FATAL_ERROR "Coverage can only be built on GCC")
|
||||
ELSEIF(NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||
MESSAGE(FATAL_ERROR "Coverage can only be built in Debug mode")
|
||||
@ -33,7 +33,7 @@ ELSEIF(NOT LCOV_EXECUTABLE)
|
||||
MESSAGE(FATAL_ERROR "lcov executable not found")
|
||||
ELSEIF(NOT GENHTML_EXECUTABLE)
|
||||
MESSAGE(FATAL_ERROR "genhtml executable not found")
|
||||
ENDIF(NOT CMAKE_COMPILER_IS_GNUCC)
|
||||
ENDIF()
|
||||
|
||||
# Enable testing if not already done
|
||||
SET(ENABLE_TEST ON)
|
||||
|
||||
@ -405,6 +405,12 @@ typedef uint64_t uintmax_t;
|
||||
/* Define to 1 if you have the `chroot' function. */
|
||||
#cmakedefine HAVE_CHROOT 1
|
||||
|
||||
/* Define to 1 if you have the `closefrom' function. */
|
||||
#cmakedefine HAVE_CLOSEFROM 1
|
||||
|
||||
/* Define to 1 if you have the `close_range' function. */
|
||||
#cmakedefine HAVE_CLOSE_RANGE 1
|
||||
|
||||
/* Define to 1 if you have the <copyfile.h> header file. */
|
||||
#cmakedefine HAVE_COPYFILE_H 1
|
||||
|
||||
@ -729,15 +735,15 @@ typedef uint64_t uintmax_t;
|
||||
/* Define to 1 if you have the `gcc' library (-lgcc). */
|
||||
#cmakedefine HAVE_LIBGCC 1
|
||||
|
||||
/* Define to 1 if you have the `iconv' library (-liconv). */
|
||||
#cmakedefine HAVE_LIBICONV 1
|
||||
|
||||
/* Define to 1 if you have the `lz4' library (-llz4). */
|
||||
#cmakedefine HAVE_LIBLZ4 1
|
||||
|
||||
/* Define to 1 if you have the `lzma' library (-llzma). */
|
||||
#cmakedefine HAVE_LIBLZMA 1
|
||||
|
||||
/* Define to 1 if you have the `lzmadec' library (-llzmadec). */
|
||||
#cmakedefine HAVE_LIBLZMADEC 1
|
||||
|
||||
/* Define to 1 if you have the `lzo2' library (-llzo2). */
|
||||
#cmakedefine HAVE_LIBLZO2 1
|
||||
|
||||
@ -768,6 +774,9 @@ typedef uint64_t uintmax_t;
|
||||
/* Define to 1 if you have the <libxml/xmlwriter.h> header file. */
|
||||
#cmakedefine HAVE_LIBXML_XMLWRITER_H 1
|
||||
|
||||
/* Define to 1 if you have the <libxml/xmlversion.h> header file. */
|
||||
#cmakedefine HAVE_LIBXML_XMLVERSION_H 1
|
||||
|
||||
/* Define to 1 if you have the `z' library (-lz). */
|
||||
#cmakedefine HAVE_LIBZ 1
|
||||
|
||||
@ -777,6 +786,9 @@ typedef uint64_t uintmax_t;
|
||||
/* Define to 1 if you have the ZSTD_compressStream function. */
|
||||
#cmakedefine HAVE_ZSTD_compressStream 1
|
||||
|
||||
/* Define to 1 if you have the ZSTD_minCLevel function. */
|
||||
#cmakedefine HAVE_ZSTD_minCLevel 1
|
||||
|
||||
/* Define to 1 if you have the <limits.h> header file. */
|
||||
#cmakedefine HAVE_LIMITS_H 1
|
||||
|
||||
@ -847,9 +859,6 @@ typedef uint64_t uintmax_t;
|
||||
/* Define to 1 if you have the <lz4.h> header file. */
|
||||
#cmakedefine HAVE_LZ4_H 1
|
||||
|
||||
/* Define to 1 if you have the <lzmadec.h> header file. */
|
||||
#cmakedefine HAVE_LZMADEC_H 1
|
||||
|
||||
/* Define to 1 if you have the <lzma.h> header file. */
|
||||
#cmakedefine HAVE_LZMA_H 1
|
||||
|
||||
@ -871,6 +880,9 @@ typedef uint64_t uintmax_t;
|
||||
/* Define to 1 if you have the <mbedtls/pkcs5.h> header file. */
|
||||
#cmakedefine HAVE_MBEDTLS_PKCS5_H 1
|
||||
|
||||
/* Define to 1 if you have the <mbedtls/pkcs5.h> header file. */
|
||||
#cmakedefine HAVE_MBEDTLS_VERSION_H 1
|
||||
|
||||
/* Define to 1 if you have the `mbrtowc' function. */
|
||||
#cmakedefine HAVE_MBRTOWC 1
|
||||
|
||||
@ -916,6 +928,9 @@ typedef uint64_t uintmax_t;
|
||||
/* Define to 1 if you have the <nettle/sha.h> header file. */
|
||||
#cmakedefine HAVE_NETTLE_SHA_H 1
|
||||
|
||||
/* Define to 1 if you have the <nettle/version.h> header file. */
|
||||
#cmakedefine HAVE_NETTLE_VERSION_H 1
|
||||
|
||||
/* Define to 1 if you have the `nl_langinfo' function. */
|
||||
#cmakedefine HAVE_NL_LANGINFO 1
|
||||
|
||||
@ -925,6 +940,9 @@ typedef uint64_t uintmax_t;
|
||||
/* Define to 1 if you have the <openssl/evp.h> header file. */
|
||||
#cmakedefine HAVE_OPENSSL_EVP_H 1
|
||||
|
||||
/* Define to 1 if you have the <openssl/opensslv.h> header file. */
|
||||
#cmakedefine HAVE_OPENSSL_OPENSSLV_H 1
|
||||
|
||||
/* Define to 1 if you have the <paths.h> header file. */
|
||||
#cmakedefine HAVE_PATHS_H 1
|
||||
|
||||
@ -958,9 +976,6 @@ typedef uint64_t uintmax_t;
|
||||
/* Define to 1 if you have the <pwd.h> header file. */
|
||||
#cmakedefine HAVE_PWD_H 1
|
||||
|
||||
/* Define to 1 if you have the `readdir_r' function. */
|
||||
#cmakedefine HAVE_READDIR_R 1
|
||||
|
||||
/* Define to 1 if you have the `readlink' function. */
|
||||
#cmakedefine HAVE_READLINK 1
|
||||
|
||||
@ -1147,7 +1162,6 @@ typedef uint64_t uintmax_t;
|
||||
/* Define to 1 if you have the <sys/stat.h> header file. */
|
||||
#cmakedefine HAVE_SYS_STAT_H 1
|
||||
|
||||
|
||||
/* Define to 1 if you have the <sys/sysmacros.h> header file. */
|
||||
#cmakedefine HAVE_SYS_SYSMACROS_H 1
|
||||
|
||||
@ -1172,6 +1186,12 @@ typedef uint64_t uintmax_t;
|
||||
/* Define to 1 if you have the <sys/xattr.h> header file. */
|
||||
#cmakedefine HAVE_SYS_XATTR_H 1
|
||||
|
||||
/* Define to 1 if you have the `tcgetattr' function. */
|
||||
#cmakedefine HAVE_TCGETATTR 1
|
||||
|
||||
/* Define to 1 if you have the `tcsetattr' function. */
|
||||
#cmakedefine HAVE_TCSETATTR 1
|
||||
|
||||
/* Define to 1 if you have the `timegm' function. */
|
||||
#cmakedefine HAVE_TIMEGM 1
|
||||
|
||||
@ -1265,6 +1285,9 @@ typedef uint64_t uintmax_t;
|
||||
/* Define to 1 if you have a working FS_IOC_GETFLAGS */
|
||||
#cmakedefine HAVE_WORKING_FS_IOC_GETFLAGS 1
|
||||
|
||||
/* Define to 1 if you have the Windows `xmllite' library (-lxmllite). */
|
||||
#cmakedefine HAVE_XMLLITE_H 1
|
||||
|
||||
/* Define to 1 if you have the <zlib.h> header file. */
|
||||
#cmakedefine HAVE_ZLIB_H 1
|
||||
|
||||
@ -1322,6 +1345,15 @@ typedef uint64_t uintmax_t;
|
||||
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
|
||||
#cmakedefine TIME_WITH_SYS_TIME 1
|
||||
|
||||
/* Version number of package */
|
||||
#cmakedefine LIBATTR_PKGCONFIG_VERSION "@LIBATTR_PKGCONFIG_VERSION@"
|
||||
|
||||
/* Version number of package */
|
||||
#cmakedefine LIBACL_PKGCONFIG_VERSION "@LIBACL_PKGCONFIG_VERSION@"
|
||||
|
||||
/* Version number of package */
|
||||
#cmakedefine LIBRICHACL_PKGCONFIG_VERSION "@LIBRICHACL_PKGCONFIG_VERSION@"
|
||||
|
||||
/*
|
||||
* Some platform requires a macro to use extension functions.
|
||||
*/
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
|
||||
#
|
||||
# This script exists primarily to document some of the
|
||||
@ -8,7 +9,6 @@
|
||||
#
|
||||
|
||||
PATH=/usr/local/gnu-autotools/bin/:$PATH
|
||||
export PATH
|
||||
|
||||
# Start from one level above the build directory
|
||||
if [ -f version ]; then
|
||||
@ -24,7 +24,7 @@ fi
|
||||
# Makefile. Effectively disable it.
|
||||
export MAKEOBJDIRPREFIX=/junk
|
||||
|
||||
set -ex
|
||||
set -x
|
||||
|
||||
#
|
||||
# Scrub the local tree before running the build tests below.
|
||||
|
||||
@ -1,8 +1,10 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
|
||||
ID=$(docker build -q -f build/release/Dockerfile .)
|
||||
if [ -z "$ID" ]; then
|
||||
echo "Failed to build docker image"
|
||||
exit 1
|
||||
else
|
||||
docker run $ID sh -c "tar -c -f - libarchive-*" | tar -x -f -
|
||||
docker run "$ID" sh -c "tar -c -f - libarchive-*" | tar -x -f -
|
||||
fi
|
||||
|
||||
@ -1,4 +1,12 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
|
||||
if [ $# != 1 ]
|
||||
then
|
||||
echo "Usage: $0 path/to/UnicodeData.txt"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
#
|
||||
# This needs http://unicode.org/Public/6.0.0/ucd/UnicodeData.txt
|
||||
#
|
||||
|
||||
@ -1 +1 @@
|
||||
3007005
|
||||
3009000
|
||||
|
||||
@ -1,3 +1,6 @@
|
||||
#
|
||||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
############################################
|
||||
#
|
||||
# How to build bsdcat
|
||||
@ -10,8 +13,8 @@ IF(ENABLE_CAT)
|
||||
bsdcat.h
|
||||
bsdcat_platform.h
|
||||
cmdline.c
|
||||
../libarchive_fe/err.c
|
||||
../libarchive_fe/err.h
|
||||
../libarchive_fe/lafe_err.c
|
||||
../libarchive_fe/lafe_err.h
|
||||
../libarchive_fe/lafe_platform.h
|
||||
)
|
||||
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/../libarchive_fe)
|
||||
@ -30,8 +33,10 @@ IF(ENABLE_CAT)
|
||||
ENDIF(ENABLE_CAT_SHARED)
|
||||
|
||||
# Installation rules
|
||||
INSTALL(TARGETS bsdcat RUNTIME DESTINATION bin)
|
||||
INSTALL_MAN(${bsdcat_MANS})
|
||||
IF(ENABLE_INSTALL)
|
||||
INSTALL(TARGETS bsdcat RUNTIME DESTINATION bin)
|
||||
INSTALL_MAN(${bsdcat_MANS})
|
||||
ENDIF(ENABLE_INSTALL)
|
||||
ENDIF(ENABLE_CAT)
|
||||
|
||||
add_subdirectory(test)
|
||||
|
||||
24
cat/bsdcat.1
24
cat/bsdcat.1
@ -1,27 +1,9 @@
|
||||
.\"
|
||||
.\" SPDX-License-Identifier: BSD-2-Clause
|
||||
.\"
|
||||
.\" Copyright (c) 2011-2014, Mike Kazantsev
|
||||
.\" All rights reserved.
|
||||
.\"
|
||||
.\" Redistribution and use in source and binary forms, with or without
|
||||
.\" modification, are permitted provided that the following conditions
|
||||
.\" are met:
|
||||
.\" 1. Redistributions of source code must retain the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer.
|
||||
.\" 2. Redistributions in binary form must reproduce the above copyright
|
||||
.\" notice, this list of conditions and the following disclaimer in the
|
||||
.\" documentation and/or other materials provided with the distribution.
|
||||
.\"
|
||||
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
|
||||
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
||||
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
||||
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
|
||||
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
||||
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
|
||||
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
||||
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
|
||||
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
|
||||
.\" SUCH DAMAGE.
|
||||
.\"
|
||||
.Dd March 1, 2014
|
||||
.Dt BSDCAT 1
|
||||
.Os
|
||||
|
||||
37
cat/bsdcat.c
37
cat/bsdcat.c
@ -1,30 +1,15 @@
|
||||
/*-
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*
|
||||
* Copyright (c) 2011-2014, Mike Kazantsev
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#include "bsdcat_platform.h"
|
||||
|
||||
#ifdef HAVE_SIGNAL_H
|
||||
#include <signal.h>
|
||||
#endif
|
||||
#include <stdio.h>
|
||||
#ifdef HAVE_STDLIB_H
|
||||
#include <stdlib.h>
|
||||
@ -40,7 +25,7 @@
|
||||
#include <archive_entry.h>
|
||||
|
||||
#include "bsdcat.h"
|
||||
#include "err.h"
|
||||
#include "lafe_err.h"
|
||||
|
||||
#define BYTES_PER_BLOCK (20*512)
|
||||
|
||||
@ -123,6 +108,16 @@ main(int argc, char **argv)
|
||||
bsdcat = &bsdcat_storage;
|
||||
memset(bsdcat, 0, sizeof(*bsdcat));
|
||||
|
||||
#if defined(HAVE_SIGACTION) && defined(SIGCHLD)
|
||||
{ /* Do not ignore SIGCHLD. */
|
||||
struct sigaction sa;
|
||||
sa.sa_handler = SIG_DFL;
|
||||
sigemptyset(&sa.sa_mask);
|
||||
sa.sa_flags = 0;
|
||||
sigaction(SIGCHLD, &sa, NULL);
|
||||
}
|
||||
#endif
|
||||
|
||||
lafe_setprogname(*argv, "bsdcat");
|
||||
|
||||
bsdcat->argv = argv;
|
||||
|
||||
22
cat/bsdcat.h
22
cat/bsdcat.h
@ -1,26 +1,8 @@
|
||||
/*-
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*
|
||||
* Copyright (c) 2014, Mike Kazantsev
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
#ifndef BSDCAT_H_INCLUDED
|
||||
|
||||
@ -1,26 +1,8 @@
|
||||
/*-
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*
|
||||
* Copyright (c) 2003-2007 Tim Kientzle
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -58,7 +40,7 @@
|
||||
#define __LA_NORETURN __attribute__((__noreturn__))
|
||||
#elif defined(_MSC_VER)
|
||||
#define __LA_NORETURN __declspec(noreturn)
|
||||
#else
|
||||
#else
|
||||
#define __LA_NORETURN
|
||||
#endif
|
||||
|
||||
|
||||
@ -1,26 +1,8 @@
|
||||
/*-
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*
|
||||
* Copyright (c) 2003-2008 Tim Kientzle
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/*
|
||||
@ -40,7 +22,7 @@
|
||||
#endif
|
||||
|
||||
#include "bsdcat.h"
|
||||
#include "err.h"
|
||||
#include "lafe_err.h"
|
||||
|
||||
/*
|
||||
* Short options for bsdcat. Please keep this sorted.
|
||||
|
||||
@ -1,3 +1,6 @@
|
||||
#
|
||||
# SPDX-License-Identifier: BSD-2-Clause
|
||||
#
|
||||
############################################
|
||||
#
|
||||
# How to build bsdtar_test
|
||||
@ -61,7 +64,9 @@ IF(ENABLE_CAT AND ENABLE_TEST)
|
||||
COMMAND bsdcat_test -vv
|
||||
-p $<TARGET_FILE:bsdcat>
|
||||
-r ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
-s
|
||||
${_testname})
|
||||
SET_TESTS_PROPERTIES(bsdcat_${_testname} PROPERTIES SKIP_RETURN_CODE 2)
|
||||
ENDMACRO (DEFINE_TEST _testname)
|
||||
|
||||
INCLUDE(${CMAKE_CURRENT_BINARY_DIR}/list.h)
|
||||
|
||||
@ -1,26 +1,8 @@
|
||||
/*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*
|
||||
* Copyright (c) 2003-2006 Tim Kientzle
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
|
||||
/* Every test program should #include "test.h" as the first thing. */
|
||||
|
||||
@ -1,26 +1,8 @@
|
||||
/*-
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*
|
||||
* Copyright (c) 2003-2007 Tim Kientzle
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
#include "test.h"
|
||||
|
||||
|
||||
@ -1,26 +1,8 @@
|
||||
/*-
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*
|
||||
* Copyright (c) 2014 Sebastian Freundt
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
#include "test.h"
|
||||
|
||||
|
||||
@ -1,26 +1,8 @@
|
||||
/*-
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*
|
||||
* Copyright (c) 2014 Sebastian Freundt
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
#include "test.h"
|
||||
|
||||
|
||||
@ -1,26 +1,8 @@
|
||||
/*-
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*
|
||||
* Copyright (c) 2014 Sebastian Freundt
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
#include "test.h"
|
||||
|
||||
|
||||
@ -1,26 +1,8 @@
|
||||
/*-
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*
|
||||
* Copyright (c) 2017 Sean Purcell
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
#include "test.h"
|
||||
|
||||
|
||||
@ -1,26 +1,8 @@
|
||||
/*-
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*
|
||||
* Copyright (c) 2014 Mike Kazantsev
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
#include "test.h"
|
||||
|
||||
|
||||
@ -1,26 +1,8 @@
|
||||
/*-
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*
|
||||
* Copyright (c) 2014 Mike Kazantsev
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
#include "test.h"
|
||||
|
||||
|
||||
@ -1,26 +1,8 @@
|
||||
/*-
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*
|
||||
* Copyright (c) 2014 Mike Kazantsev
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
#include "test.h"
|
||||
|
||||
|
||||
@ -1,27 +1,9 @@
|
||||
/*-
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*
|
||||
* Copyright (c) 2014 Mike Kazantsev
|
||||
* Copyright (c) 2012 Michihiro NAKAJIMA
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
#include "test.h"
|
||||
|
||||
|
||||
@ -1,27 +1,9 @@
|
||||
/*-
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*
|
||||
* Copyright (c) 2014 Mike Kazantsev
|
||||
* Copyright (c) 2012 Michihiro NAKAJIMA
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
#include "test.h"
|
||||
|
||||
|
||||
@ -1,27 +1,9 @@
|
||||
/*-
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*
|
||||
* Copyright (c) 2014 Mike Kazantsev
|
||||
* Copyright (c) 2012, 2014 Michihiro NAKAJIMA
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
#include "test.h"
|
||||
|
||||
|
||||
@ -1,26 +1,8 @@
|
||||
/*-
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*
|
||||
* Copyright (c) 2014 Mike Kazantsev
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
#include "test.h"
|
||||
|
||||
|
||||
@ -1,26 +1,8 @@
|
||||
/*-
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*
|
||||
* Copyright (c) 2014 Mike Kazantsev
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
#include "test.h"
|
||||
|
||||
|
||||
@ -1,27 +1,9 @@
|
||||
/*-
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*
|
||||
* Copyright (c) 2014 Mike Kazantsev
|
||||
* Copyright (c) 2012 Michihiro NAKAJIMA
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
#include "test.h"
|
||||
|
||||
|
||||
@ -1,26 +1,8 @@
|
||||
/*-
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*
|
||||
* Copyright (c) 2017 Sean Purcell
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
#include "test.h"
|
||||
|
||||
|
||||
@ -1,26 +1,8 @@
|
||||
/*-
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*
|
||||
* Copyright (c) 2003-2007 Tim Kientzle
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
#include "test.h"
|
||||
|
||||
|
||||
@ -1,26 +1,8 @@
|
||||
/*-
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*
|
||||
* Copyright (c) 2017 Sean Purcell
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
#include "test.h"
|
||||
|
||||
|
||||
@ -1,26 +1,8 @@
|
||||
/*-
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*
|
||||
* Copyright (c) 2003-2017 Tim Kientzle
|
||||
* All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in the
|
||||
* documentation and/or other materials provided with the distribution.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``AS IS'' AND ANY EXPRESS OR
|
||||
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
|
||||
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
|
||||
* IN NO EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
|
||||
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
||||
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
|
||||
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
|
||||
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
*/
|
||||
#include "test.h"
|
||||
|
||||
|
||||
146
configure.ac
146
configure.ac
@ -4,8 +4,8 @@ dnl First, define all of the version numbers up front.
|
||||
dnl In particular, this allows the version macro to be used in AC_INIT
|
||||
|
||||
dnl These first two version numbers are updated automatically on each release.
|
||||
m4_define([LIBARCHIVE_VERSION_S],[3.7.5])
|
||||
m4_define([LIBARCHIVE_VERSION_N],[3007005])
|
||||
m4_define([LIBARCHIVE_VERSION_S],[3.9.0dev])
|
||||
m4_define([LIBARCHIVE_VERSION_N],[3009000])
|
||||
|
||||
dnl bsdtar and bsdcpio versioning tracks libarchive
|
||||
m4_define([BSDTAR_VERSION_S],LIBARCHIVE_VERSION_S())
|
||||
@ -38,7 +38,7 @@ m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
|
||||
ARCHIVE_MINOR=$(( (LIBARCHIVE_VERSION_N() / 1000) % 1000 ))
|
||||
# Libarchive 2.7 == libtool interface 9 = 2 + 7
|
||||
# Libarchive 2.8 == libtool interface 10 = 2 + 8
|
||||
# Libarchive 2.9 == libtool interface 11 = 2 + 8
|
||||
# Libarchive 2.9 == libtool interface 11 = 2 + 9
|
||||
# Libarchive 3.0 == libtool interface 12
|
||||
# Libarchive 3.1 == libtool interface 13
|
||||
ARCHIVE_INTERFACE=`echo $((13 + ${ARCHIVE_MINOR}))`
|
||||
@ -108,6 +108,11 @@ case "$host_os" in
|
||||
esac
|
||||
AC_SUBST(PLATFORMCPPFLAGS)
|
||||
|
||||
dnl Linking on Haiku needs libbsd because of readpassphrase
|
||||
case "$host_os" in
|
||||
haiku*) LIBS="-lbsd $LIBS" ;;
|
||||
esac
|
||||
|
||||
# Checks for programs.
|
||||
AC_PROG_CC
|
||||
AM_PROG_CC_C_O
|
||||
@ -253,7 +258,8 @@ AM_CONDITIONAL([STATIC_BSDCPIO], [ test "$static_bsdcpio" = yes ])
|
||||
case $host in
|
||||
*mingw* | *cygwin* | *msys* )
|
||||
AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
|
||||
[[#ifdef _WIN32_WINNT
|
||||
[[#include <windows.h>
|
||||
#ifdef _WIN32_WINNT
|
||||
# error _WIN32_WINNT already defined
|
||||
#endif
|
||||
]],[[;]])
|
||||
@ -262,7 +268,8 @@ case $host in
|
||||
AC_DEFINE([NTDDI_VERSION], 0x05020000, [Define to '0x05020000' for Windows Server 2003 APIs.])
|
||||
])
|
||||
AC_PREPROC_IFELSE([AC_LANG_PROGRAM(
|
||||
[[#ifdef WINVER
|
||||
[[#include <windows.h>
|
||||
#ifdef WINVER
|
||||
# error WINVER already defined
|
||||
#endif
|
||||
]],[[;]])
|
||||
@ -367,9 +374,10 @@ AC_CHECK_HEADERS([sys/param.h sys/poll.h sys/richacl.h])
|
||||
AC_CHECK_HEADERS([sys/select.h sys/statfs.h sys/statvfs.h sys/sysmacros.h])
|
||||
AC_CHECK_HEADERS([sys/time.h sys/utime.h sys/utsname.h sys/vfs.h sys/xattr.h])
|
||||
AC_CHECK_HEADERS([time.h unistd.h utime.h wchar.h wctype.h])
|
||||
AC_CHECK_TYPE([suseconds_t])
|
||||
AC_CHECK_HEADERS([windows.h])
|
||||
# check windows.h first; the other headers require it.
|
||||
AC_CHECK_HEADERS([wincrypt.h winioctl.h],[],[],
|
||||
AC_CHECK_HEADERS([winioctl.h],[],[],
|
||||
[[#ifdef HAVE_WINDOWS_H
|
||||
# include <windows.h>
|
||||
#endif
|
||||
@ -393,6 +401,7 @@ if test "x$with_zlib" != "xno"; then
|
||||
int main(int argc, char **argv) { inflate(NULL, 0); return 0; }
|
||||
]])],
|
||||
[AC_DEFINE([HAVE_ZLIB_H], [1], [Define to 1 if you have zlib >= 1.2.1])
|
||||
AC_DEFINE([HAVE_LIBZ], [1], [Define to 1 if you have zlib >= 1.2.1])
|
||||
AC_MSG_RESULT([found a suitable version of zlib (>= 1.2.1)])
|
||||
],
|
||||
[AC_MSG_RESULT([could not find a suitable version of zlib (>= 1.2.1)])
|
||||
@ -429,12 +438,18 @@ if test "x$with_bz2lib" != "xno"; then
|
||||
esac
|
||||
fi
|
||||
|
||||
PKG_PROG_PKG_CONFIG
|
||||
|
||||
AC_ARG_WITH([libb2],
|
||||
AS_HELP_STRING([--without-libb2], [Don't build support for BLAKE2 through libb2]))
|
||||
|
||||
if test "x$with_libb2" != "xno"; then
|
||||
AC_CHECK_HEADERS([blake2.h])
|
||||
AC_CHECK_LIB(b2,blake2sp_init)
|
||||
BLAKE2_PC_VER=`$PKG_CONFIG --modversion libb2`
|
||||
if test "x$BLAKE2_PC_VER" != "x"; then
|
||||
AC_DEFINE_UNQUOTED([LIBB2_PKGCONFIG_VERSION], ["$BLAKE2_PC_VER"], [Libb2 version coming from pkg-config.])
|
||||
fi
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL([INC_BLAKE2], [test "x$ac_cv_lib_b2_blake2sp_init" != "xyes"])
|
||||
@ -447,13 +462,17 @@ if test "x$with_iconv" != "xno"; then
|
||||
AC_CHECK_HEADERS([iconv.h],[],[],[#include <stdlib.h>])
|
||||
if test "x$am_cv_func_iconv" = "xyes"; then
|
||||
AC_CHECK_HEADERS([localcharset.h])
|
||||
am_save_LIBS="$LIBS"
|
||||
LIBS="${LIBS} ${LIBICONV}"
|
||||
if test -n "$LIBICONV"; then
|
||||
LIBSREQUIRED="$LIBSREQUIRED${LIBSREQUIRED:+ }iconv"
|
||||
AC_DEFINE([HAVE_LIBICONV], [1], [Define to 1 if you have the `iconv' library (-liconv).])
|
||||
|
||||
# Most platforms do not provide iconv.pc, but MSYS2 MinGW does.
|
||||
# We add it to our Requires.private only if it exists.
|
||||
PKG_CHECK_MODULES(ICONV_PC, [iconv], [
|
||||
LIBSREQUIRED="$LIBSREQUIRED${LIBSREQUIRED:+ }iconv"
|
||||
], [true])
|
||||
fi
|
||||
AC_CHECK_FUNCS([locale_charset])
|
||||
LIBS="${am_save_LIBS}"
|
||||
if test "x$ac_cv_func_locale_charset" != "xyes"; then
|
||||
# If locale_charset() is not in libiconv, we have to find libcharset.
|
||||
AC_CHECK_LIB(charset,locale_charset)
|
||||
@ -477,14 +496,24 @@ if test "x$with_zstd" != "xno"; then
|
||||
AC_CHECK_LIB(zstd,ZSTD_decompressStream)
|
||||
AC_CHECK_LIB(zstd,ZSTD_compressStream,
|
||||
AC_DEFINE([HAVE_ZSTD_compressStream], [1], [Define to 1 if you have the `zstd' library (-lzstd) with compression support.]))
|
||||
AC_CHECK_LIB(zstd,ZSTD_minCLevel,
|
||||
AC_DEFINE([HAVE_ZSTD_minCLevel], [1], [Define to 1 if you have a `zstd' library version with ZSTD_minCLevel().]))
|
||||
fi
|
||||
|
||||
AC_ARG_WITH([lzma],
|
||||
AS_HELP_STRING([--without-lzma], [Don't build support for xz through lzma]))
|
||||
|
||||
if test "x$with_lzma" != "xno"; then
|
||||
PKG_PROG_PKG_CONFIG
|
||||
PKG_CHECK_MODULES(LZMA_PC, [liblzma], [
|
||||
CPPFLAGS="${CPPFLAGS} ${LZMA_PC_CFLAGS}"
|
||||
LIBS="${LIBS} ${LZMA_PC_LIBS}"
|
||||
AC_DEFINE(HAVE_LIBLZMA, [1], [Define to 1 if you have the `lzma' library.])
|
||||
], [
|
||||
AC_CHECK_LIB(lzma,lzma_stream_decoder)
|
||||
])
|
||||
AC_CHECK_HEADERS([lzma.h])
|
||||
AC_CHECK_LIB(lzma,lzma_stream_decoder)
|
||||
|
||||
# Some pre-release (but widely distributed) versions of liblzma
|
||||
# included a disabled version of lzma_stream_encoder_mt that
|
||||
# fools a naive AC_CHECK_LIB or AC_CHECK_FUNC, so we need
|
||||
@ -502,19 +531,6 @@ if test "x$with_lzma" != "xno"; then
|
||||
if test "x$ac_cv_lzma_has_mt" != xno; then
|
||||
AC_DEFINE([HAVE_LZMA_STREAM_ENCODER_MT], [1], [Define to 1 if you have the `lzma_stream_encoder_mt' function.])
|
||||
fi
|
||||
|
||||
AC_CACHE_CHECK(
|
||||
[whether we have ARM64 filter support in lzma],
|
||||
ac_cv_lzma_has_arm64,
|
||||
[AC_LINK_IFELSE([
|
||||
AC_LANG_PROGRAM([[#include <lzma.h>]
|
||||
[#ifndef LZMA_FILTER_ARM64]
|
||||
[#error unsupported]
|
||||
[#endif]])],
|
||||
[ac_cv_lzma_has_arm64=yes], [ac_cv_lzma_has_arm64=no])])
|
||||
if test "x$ac_cv_lzma_has_arm64" != xno; then
|
||||
AC_DEFINE([HAVE_LZMA_FILTER_ARM64], [1], [Define to 1 if you have the `LZMA_FILTER_ARM64' macro.])
|
||||
fi
|
||||
fi
|
||||
|
||||
AC_ARG_WITH([lzo2],
|
||||
@ -552,7 +568,7 @@ if test "x$with_xml2" != "xno"; then
|
||||
], [
|
||||
AC_CHECK_LIB(xml2,xmlInitParser)
|
||||
])
|
||||
AC_CHECK_HEADERS([libxml/xmlreader.h libxml/xmlwriter.h])
|
||||
AC_CHECK_HEADERS([libxml/xmlreader.h libxml/xmlwriter.h libxml/xmlversion.h])
|
||||
fi
|
||||
if test "x$ac_cv_header_libxml_xmlreader_h" != "xyes"; then
|
||||
if test "x$with_expat" != "xno"; then
|
||||
@ -805,20 +821,25 @@ AC_FUNC_VPRINTF
|
||||
# To avoid necessity for including windows.h or special forward declaration
|
||||
# workarounds, we use 'void *' for 'struct SECURITY_ATTRIBUTES *'
|
||||
AC_CHECK_STDCALL_FUNC([CreateHardLinkA],[const char *, const char *, void *])
|
||||
AC_CHECK_FUNCS([arc4random_buf chflags chown chroot ctime_r])
|
||||
AC_CHECK_FUNCS([arc4random_buf chflags chown chroot])
|
||||
AC_CHECK_FUNCS([closefrom close_range ctime_r])
|
||||
AC_CHECK_FUNCS([fchdir fchflags fchmod fchown fcntl fdopendir fnmatch fork])
|
||||
AC_CHECK_FUNCS([fstat fstatat fstatfs fstatvfs ftruncate])
|
||||
AC_CHECK_FUNCS([futimens futimes futimesat])
|
||||
AC_CHECK_FUNCS([geteuid getline getpid getgrgid_r getgrnam_r])
|
||||
AC_CHECK_FUNCS([getpwnam_r getpwuid_r getvfsbyname gmtime_r])
|
||||
AC_CHECK_FUNCS([getegid geteuid getline getpid getresgid getresuid])
|
||||
AC_CHECK_FUNCS([getgrgid_r getgrnam_r getpwnam_r getpwuid_r])
|
||||
AC_CHECK_FUNCS([getvfsbyname gmtime_r])
|
||||
AC_CHECK_FUNCS([issetugid])
|
||||
AC_CHECK_FUNCS([lchflags lchmod lchown link linkat localtime_r lstat lutimes])
|
||||
AC_CHECK_FUNCS([mbrtowc memmove memset])
|
||||
AC_CHECK_FUNCS([mkdir mkfifo mknod mkstemp])
|
||||
AC_CHECK_FUNCS([nl_langinfo openat pipe poll posix_spawnp readlink readlinkat])
|
||||
AC_CHECK_FUNCS([nl_langinfo openat pipe poll posix_spawn posix_spawnp])
|
||||
AC_CHECK_FUNCS([readlink readlinkat])
|
||||
AC_CHECK_FUNCS([readpassphrase])
|
||||
AC_CHECK_FUNCS([select setenv setlocale sigaction statfs statvfs])
|
||||
AC_CHECK_FUNCS([strchr strdup strerror strncpy_s strnlen strrchr symlink])
|
||||
AC_CHECK_FUNCS([sysconf])
|
||||
AC_CHECK_FUNCS([tcgetattr tcsetattr])
|
||||
AC_CHECK_FUNCS([timegm tzset unlinkat unsetenv utime utimensat utimes vfork])
|
||||
AC_CHECK_FUNCS([wcrtomb wcscmp wcscpy wcslen wctomb wmemcmp wmemcpy wmemmove])
|
||||
AC_CHECK_FUNCS([_fseeki64 _get_timezone])
|
||||
@ -864,14 +885,6 @@ AC_CHECK_TYPES(struct statfs,,,
|
||||
#include <sys/mount.h>
|
||||
])
|
||||
|
||||
# There are several variants of readdir_r around; we only
|
||||
# accept the POSIX-compliant version.
|
||||
AC_LINK_IFELSE(
|
||||
[AC_LANG_PROGRAM([[#include <dirent.h>]],
|
||||
[[DIR *dir; struct dirent e, *r;
|
||||
return(readdir_r(dir, &e, &r));]])],
|
||||
[AC_DEFINE(HAVE_READDIR_R,1,[Define to 1 if you have a POSIX compatible readdir_r])]
|
||||
)
|
||||
# dirfd can be either a function or a macro.
|
||||
AC_LINK_IFELSE(
|
||||
[AC_LANG_PROGRAM([[#include <dirent.h>
|
||||
@ -912,6 +925,10 @@ if test "x$enable_xattr" != "xno"; then
|
||||
])
|
||||
AC_CHECK_DECLS([XATTR_NOFOLLOW], [], [], [#include <sys/xattr.h>
|
||||
])
|
||||
ATTR_PC_VER=`$PKG_CONFIG --modversion libattr`
|
||||
if test "x$ATTR_PC_VER" != "x"; then
|
||||
AC_DEFINE_UNQUOTED([LIBATTR_PKGCONFIG_VERSION], ["$ATTR_PC_VER"], [Libattr version coming from pkg-config.])
|
||||
fi
|
||||
if test "x$ac_cv_header_sys_xattr_h" = "xyes" \
|
||||
-a "x$ac_cv_have_decl_XATTR_NOFOLLOW" = "xyes"; then
|
||||
# Darwin extended attributes support
|
||||
@ -923,9 +940,7 @@ if test "x$enable_xattr" != "xno"; then
|
||||
listxattr \
|
||||
setxattr,
|
||||
[ac_cv_archive_xattr_darwin=yes],
|
||||
[ac_cv_archive_xattr_darwin=no],
|
||||
[#include <sys/xattr.h>
|
||||
])
|
||||
[ac_cv_archive_xattr_darwin=no])
|
||||
]
|
||||
)
|
||||
elif test "x$ac_cv_header_sys_extattr_h" = "xyes" \
|
||||
@ -941,10 +956,7 @@ if test "x$enable_xattr" != "xno"; then
|
||||
extattr_set_fd \
|
||||
extattr_set_link,
|
||||
[ac_cv_archive_xattr_freebsd=yes],
|
||||
[ac_cv_archive_xattr_freebsd=no],
|
||||
[#include <sys/types.h>
|
||||
#include <sys/extattr.h>
|
||||
])
|
||||
[ac_cv_archive_xattr_freebsd=no])
|
||||
]
|
||||
)
|
||||
elif test "x$ac_cv_header_sys_xattr_h" = "xyes" \
|
||||
@ -960,17 +972,7 @@ if test "x$enable_xattr" != "xno"; then
|
||||
llistxattr \
|
||||
lsetxattr,
|
||||
[ac_cv_archive_xattr_linux=yes],
|
||||
[ac_cv_archive_xattr_linux=no],
|
||||
[#if HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
#if HAVE_SYS_XATTR_H
|
||||
#include <sys/xattr.h>
|
||||
#endif
|
||||
#if HAVE_ATTR_XATTR_H
|
||||
#include <attr/xatr.h>
|
||||
#endif
|
||||
])
|
||||
[ac_cv_archive_xattr_linux=no])
|
||||
]
|
||||
)
|
||||
elif test "x$ac_cv_header_sys_ea_h" = "xyes"; then
|
||||
@ -985,9 +987,7 @@ if test "x$enable_xattr" != "xno"; then
|
||||
llistea \
|
||||
lsetea,
|
||||
[ac_cv_archive_xattr_aix=yes],
|
||||
[ac_cv_archive_xattr_aix=no],
|
||||
[#include <sys/ea.h>
|
||||
])
|
||||
[ac_cv_archive_xattr_aix=no])
|
||||
]
|
||||
)
|
||||
fi
|
||||
@ -1024,7 +1024,10 @@ AC_ARG_ENABLE([acl],
|
||||
if test "x$enable_acl" != "xno"; then
|
||||
# Libacl
|
||||
AC_CHECK_LIB([acl], [acl_get_file])
|
||||
|
||||
ACL_PC_VER=`$PKG_CONFIG --modversion libacl`
|
||||
if test "x$ACL_PC_VER" != "x"; then
|
||||
AC_DEFINE_UNQUOTED([LIBACL_PKGCONFIG_VERSION], ["$ACL_PC_VER"], [Libacl version coming from pkg-config.])
|
||||
fi
|
||||
AC_CHECK_TYPES([acl_t, acl_entry_t, acl_permset_t, acl_tag_t], [], [], [
|
||||
#if HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
@ -1035,7 +1038,10 @@ if test "x$enable_acl" != "xno"; then
|
||||
])
|
||||
|
||||
AC_CHECK_LIB([richacl], [richacl_get_file])
|
||||
|
||||
RICHACL_PC_VER=`$PKG_CONFIG --modversion librichacl`
|
||||
if test "x$RICHACL_PC_VER" != "x"; then
|
||||
AC_DEFINE_UNQUOTED([LIBRICHACL_PKGCONFIG_VERSION], ["$RICHACL_PC_VER"], [Librichacl version coming from pkg-config.])
|
||||
fi
|
||||
AC_CHECK_TYPES([[struct richace], [struct richacl]], [], [], [
|
||||
#if HAVE_SYS_RICHACL_H
|
||||
#include <sys/richacl.h>
|
||||
@ -1056,7 +1062,7 @@ if test "x$enable_acl" != "xno"; then
|
||||
richacl_get_file \
|
||||
richacl_set_fd \
|
||||
richacl_set_file,
|
||||
[ac_cv_archive_acl_librichacl=yes], [ac_cv_archive_acl_librichacl=no], [#include <sys/richacl.h>])])
|
||||
[ac_cv_archive_acl_librichacl=yes], [ac_cv_archive_acl_librichacl=no])])
|
||||
fi
|
||||
|
||||
if test "x$ac_cv_func_acl" = "xyes" \
|
||||
@ -1098,14 +1104,7 @@ if test "x$enable_acl" != "xno"; then
|
||||
acl_set_file \
|
||||
acl_set_qualifier \
|
||||
acl_set_tag_type,
|
||||
[ac_cv_posix_acl_funcs=yes], [ac_cv_posix_acl_funcs=no],
|
||||
[#if HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
#if HAVE_SYS_ACL_H
|
||||
#include <sys/acl.h>
|
||||
#endif
|
||||
])
|
||||
[ac_cv_posix_acl_funcs=yes], [ac_cv_posix_acl_funcs=no])
|
||||
])
|
||||
|
||||
AC_CHECK_FUNCS(acl_get_perm)
|
||||
@ -1132,14 +1131,11 @@ if test "x$enable_acl" != "xno"; then
|
||||
acl_is_trivial_np \
|
||||
acl_set_entry_type_np \
|
||||
acl_set_fd_np \
|
||||
acl_set_link_np,,,
|
||||
[#include <sys/types.h>
|
||||
#include <sys/acl.h>])
|
||||
acl_set_link_np)
|
||||
|
||||
AC_CHECK_FUNCS(mbr_uid_to_uuid \
|
||||
mbr_uuid_to_id \
|
||||
mbr_gid_to_uuid,,,
|
||||
[#include <membership.h>])
|
||||
mbr_gid_to_uuid)
|
||||
|
||||
AC_CHECK_DECLS([ACL_TYPE_EXTENDED, ACL_TYPE_NFS4, ACL_USER,
|
||||
ACL_SYNCHRONIZE], [], [],
|
||||
@ -1328,6 +1324,7 @@ fi
|
||||
|
||||
if test "x$with_mbedtls" = "xyes"; then
|
||||
AC_CHECK_HEADERS([mbedtls/aes.h mbedtls/md.h mbedtls/pkcs5.h])
|
||||
AC_CHECK_HEADERS([mbedtls/version.h])
|
||||
saved_LIBS=$LIBS
|
||||
AC_CHECK_LIB(mbedcrypto,mbedtls_sha1_init)
|
||||
CRYPTO_CHECK(MD5, MBEDTLS, md5)
|
||||
@ -1344,6 +1341,7 @@ fi
|
||||
if test "x$with_nettle" = "xyes"; then
|
||||
AC_CHECK_HEADERS([nettle/md5.h nettle/ripemd160.h nettle/sha.h])
|
||||
AC_CHECK_HEADERS([nettle/pbkdf2.h nettle/aes.h nettle/hmac.h])
|
||||
AC_CHECK_HEADERS([nettle/version.h])
|
||||
saved_LIBS=$LIBS
|
||||
AC_CHECK_LIB(nettle,nettle_sha1_init)
|
||||
CRYPTO_CHECK(MD5, NETTLE, md5)
|
||||
@ -1358,7 +1356,7 @@ if test "x$with_nettle" = "xyes"; then
|
||||
fi
|
||||
|
||||
if test "x$with_openssl" != "xno"; then
|
||||
AC_CHECK_HEADERS([openssl/evp.h])
|
||||
AC_CHECK_HEADERS([openssl/evp.h openssl/opensslv.h])
|
||||
saved_LIBS=$LIBS
|
||||
LIBSREQUIRED="$LIBSREQUIRED${LIBSREQUIRED:+ }libcrypto"
|
||||
AC_CHECK_LIB(crypto,OPENSSL_config)
|
||||
|
||||
@ -26,6 +26,8 @@ LOCAL_PATH := $(subst /contrib/android,,$(call my-dir))
|
||||
libarchive_target_config := contrib/android/config/android.h
|
||||
|
||||
libarchive_src_files := libarchive/archive_acl.c \
|
||||
libarchive/archive_blake2s_ref.c \
|
||||
libarchive/archive_blake2sp_ref.c \
|
||||
libarchive/archive_check_magic.c \
|
||||
libarchive/archive_cmdline.c \
|
||||
libarchive/archive_cryptor.c \
|
||||
@ -37,13 +39,14 @@ libarchive_src_files := libarchive/archive_acl.c \
|
||||
libarchive/archive_entry_stat.c \
|
||||
libarchive/archive_entry_strmode.c \
|
||||
libarchive/archive_entry_xattr.c \
|
||||
libarchive/archive_getdate.c \
|
||||
libarchive/archive_hmac.c \
|
||||
libarchive/archive_match.c \
|
||||
libarchive/archive_options.c \
|
||||
libarchive/archive_pack_dev.c \
|
||||
libarchive/archive_parse_date.c \
|
||||
libarchive/archive_pathmatch.c \
|
||||
libarchive/archive_ppmd7.c \
|
||||
libarchive/archive_ppmd8.c \
|
||||
libarchive/archive_random.c \
|
||||
libarchive/archive_rb.c \
|
||||
libarchive/archive_read.c \
|
||||
@ -86,6 +89,7 @@ libarchive_src_files := libarchive/archive_acl.c \
|
||||
libarchive/archive_read_support_format_lha.c \
|
||||
libarchive/archive_read_support_format_mtree.c \
|
||||
libarchive/archive_read_support_format_rar.c \
|
||||
libarchive/archive_read_support_format_rar5.c \
|
||||
libarchive/archive_read_support_format_raw.c \
|
||||
libarchive/archive_read_support_format_tar.c \
|
||||
libarchive/archive_read_support_format_warc.c \
|
||||
@ -93,6 +97,7 @@ libarchive_src_files := libarchive/archive_acl.c \
|
||||
libarchive/archive_read_support_format_zip.c \
|
||||
libarchive/archive_string.c \
|
||||
libarchive/archive_string_sprintf.c \
|
||||
libarchive/archive_time.c \
|
||||
libarchive/archive_util.c \
|
||||
libarchive/archive_version_details.c \
|
||||
libarchive/archive_virtual.c \
|
||||
@ -123,7 +128,9 @@ libarchive_src_files := libarchive/archive_acl.c \
|
||||
libarchive/archive_write_set_format_ar.c \
|
||||
libarchive/archive_write_set_format_by_name.c \
|
||||
libarchive/archive_write_set_format_cpio.c \
|
||||
libarchive/archive_write_set_format_cpio_binary.c \
|
||||
libarchive/archive_write_set_format_cpio_newc.c \
|
||||
libarchive/archive_write_set_format_cpio_odc.c \
|
||||
libarchive/archive_write_set_format_iso9660.c \
|
||||
libarchive/archive_write_set_format_mtree.c \
|
||||
libarchive/archive_write_set_format_pax.c \
|
||||
@ -151,7 +158,7 @@ else
|
||||
libarchive_host_src_files :=
|
||||
endif
|
||||
|
||||
libarchive_fe_src_files := libarchive_fe/err.c \
|
||||
libarchive_fe_src_files := libarchive_fe/lafe_err.c \
|
||||
libarchive_fe/line_reader.c \
|
||||
libarchive_fe/passphrase.c
|
||||
|
||||
@ -305,4 +312,17 @@ LOCAL_SRC_FILES := $(bsdcat_src_files)
|
||||
LOCAL_C_INCLUDES := $(LOCAL_PATH)/libarchive $(LOCAL_PATH)/libarchive_fe $(LOCAL_PATH)/contrib/android/include
|
||||
include $(BUILD_EXECUTABLE)
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
LOCAL_MODULE := bsdtar-recovery
|
||||
LOCAL_MODULE_TAGS := optional
|
||||
LOCAL_MODULE_STEM := bsdtar
|
||||
LOCAL_CFLAGS := -DBSDTAR_VERSION_STRING=ARCHIVE_VERSION_ONLY_STRING -DPLATFORM_CONFIG_H=\"$(libarchive_target_config)\"
|
||||
LOCAL_STATIC_LIBRARIES := libarchive libarchive_fe libz
|
||||
LOCAL_SRC_FILES := $(bsdtar_src_files)
|
||||
LOCAL_C_INCLUDES := $(LOCAL_PATH)/libarchive $(LOCAL_PATH)/libarchive_fe $(LOCAL_PATH)/contrib/android/include
|
||||
LOCAL_MODULE_CLASS := RECOVERY_EXECUTABLES
|
||||
LOCAL_MODULE_PATH := $(TARGET_RECOVERY_ROOT_OUT)/sbin
|
||||
LOCAL_FORCE_STATIC_EXECUTABLE := true
|
||||
include $(BUILD_EXECUTABLE)
|
||||
|
||||
endif
|
||||
|
||||
@ -26,6 +26,8 @@
|
||||
#ifndef ARCHIVE_PLATFORM_H_ANDROID_INCLUDED
|
||||
#define ARCHIVE_PLATFORM_H_ANDROID_INCLUDED
|
||||
|
||||
#define __LIBARCHIVE_CONFIG_H_INCLUDED 1
|
||||
|
||||
#include <android/api-level.h>
|
||||
#ifdef __ANDROID_API__
|
||||
#if __ANDROID_API__ > 20
|
||||
@ -40,6 +42,8 @@
|
||||
|
||||
#define HAVE_CHOWN 1
|
||||
#define HAVE_CHROOT 1
|
||||
#define HAVE_CLOSEFROM 0
|
||||
#define HAVE_CLOSE_RANGE 0
|
||||
#define HAVE_CTIME_R 1
|
||||
#define HAVE_CTYPE_H 1
|
||||
#define HAVE_DECL_EXTATTR_NAMESPACE_USER 0
|
||||
@ -53,6 +57,8 @@
|
||||
#define HAVE_DECL_UINTMAX_MAX 1
|
||||
#define HAVE_DECL_UINT32_MAX 1
|
||||
#define HAVE_DECL_UINT64_MAX 1
|
||||
#define HAVE_DECL_INT32_MAX 1
|
||||
#define HAVE_DECL_INT32_MIN 1
|
||||
#define HAVE_DIRENT_H 1
|
||||
#define HAVE_DIRFD 1
|
||||
#define HAVE_DLFCN_H 1
|
||||
@ -135,7 +141,7 @@
|
||||
#define HAVE_STRING_H 1
|
||||
#define HAVE_STRRCHR 1
|
||||
#define HAVE_STRUCT_STAT_ST_BLKSIZE 1
|
||||
#define HAVE_STRUCT_STAT_ST_MTIME_NSEC 1
|
||||
#define HAVE_STRUCT_STAT_ST_MTIME_NSEC 0
|
||||
#define HAVE_STRUCT_TM_TM_GMTOFF 1
|
||||
#define HAVE_SYMLINK 1
|
||||
#define HAVE_SYS_CDEFS_H 1
|
||||
@ -151,6 +157,8 @@
|
||||
#define HAVE_SYS_UTSNAME_H 1
|
||||
#define HAVE_SYS_VFS_H 1
|
||||
#define HAVE_SYS_WAIT_H 1
|
||||
#define HAVE_TCGETATTR 1
|
||||
#define HAVE_TCSETATTR 1
|
||||
#define HAVE_TIME_H 1
|
||||
#define HAVE_TZSET 1
|
||||
#define HAVE_UINTMAX_T 1
|
||||
|
||||
@ -28,6 +28,8 @@
|
||||
|
||||
#define HAVE_CHOWN 1
|
||||
#define HAVE_CHROOT 1
|
||||
#define HAVE_CLOSEFROM 1
|
||||
#define HAVE_CLOSE_RANGE 1
|
||||
#define HAVE_CTIME_R 1
|
||||
#define HAVE_CTYPE_H 1
|
||||
#define HAVE_DECL_EXTATTR_NAMESPACE_USER 0
|
||||
@ -153,6 +155,8 @@
|
||||
#define HAVE_SYS_VFS_H 1
|
||||
#define HAVE_SYS_WAIT_H 1
|
||||
#define HAVE_SYS_XATTR_H 1
|
||||
#define HAVE_TCGETATTR 1
|
||||
#define HAVE_TCSETATTR 1
|
||||
#define HAVE_TIMEGM 1
|
||||
#define HAVE_TIME_H 1
|
||||
#define HAVE_TZSET 1
|
||||
@ -178,7 +182,7 @@
|
||||
#define HAVE_WMEMCMP 1
|
||||
#define HAVE_WMEMCPY 1
|
||||
#define HAVE_ZLIB_H 1
|
||||
#define ICONV_CONST
|
||||
#define ICONV_CONST
|
||||
#define LSTAT_FOLLOWS_SLASHED_SYMLINK 1
|
||||
#define SIZEOF_WCHAR_T 4
|
||||
#define STDC_HEADERS 1
|
||||
|
||||
@ -175,6 +175,12 @@
|
||||
/* Define to 1 if you have the `chroot' function. */
|
||||
/* #undef HAVE_CHROOT */
|
||||
|
||||
/* Define to 1 if you have the `closefrom' function. */
|
||||
/* #undef HAVE_CLOSEFROM */
|
||||
|
||||
/* Define to 1 if you have the `close_range' function. */
|
||||
/* #undef HAVE_CLOSE_RANGE */
|
||||
|
||||
/* Define to 1 if you have the <copyfile.h> header file. */
|
||||
/* #undef HAVE_COPYFILE_H */
|
||||
|
||||
@ -530,9 +536,6 @@
|
||||
/* Define to 1 if you have the <lz4.h> header file. */
|
||||
/* #undef HAVE_LZ4_H */
|
||||
|
||||
/* Define to 1 if you have the <lzmadec.h> header file. */
|
||||
/* #undef HAVE_LZMADEC_H */
|
||||
|
||||
/* Define to 1 if you have the <lzma.h> header file. */
|
||||
/* #undef HAVE_LZMA_H */
|
||||
|
||||
@ -623,9 +626,6 @@
|
||||
/* Define to 1 if you have the <pwd.h> header file. */
|
||||
/* #undef HAVE_PWD_H */
|
||||
|
||||
/* Define to 1 if you have a POSIX compatible readdir_r */
|
||||
#define HAVE_READDIR_R 1
|
||||
|
||||
/* Define to 1 if you have the `readlink' function. */
|
||||
/* #undef HAVE_READLINK */
|
||||
|
||||
@ -827,6 +827,12 @@
|
||||
/* Define to 1 if you have the <sys/xattr.h> header file. */
|
||||
/* #undef HAVE_SYS_XATTR_H */
|
||||
|
||||
/* Define to 1 if you have the `tcgetattr' function. */
|
||||
/* #undef HAVE_TCGETATTR */
|
||||
|
||||
/* Define to 1 if you have the `tcsetattr' function. */
|
||||
/* #undef HAVE_TCSETATTR */
|
||||
|
||||
/* Define to 1 if you have the `timegm' function. */
|
||||
/* #undef HAVE_TIMEGM */
|
||||
|
||||
@ -893,9 +899,6 @@
|
||||
/* Define to 1 if you have the <wctype.h> header file. */
|
||||
#define HAVE_WCTYPE_H 1
|
||||
|
||||
/* Define to 1 if you have the <wincrypt.h> header file. */
|
||||
#define HAVE_WINCRYPT_H 1
|
||||
|
||||
/* Define to 1 if you have the <windows.h> header file. */
|
||||
#define HAVE_WINDOWS_H 1
|
||||
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
/*
|
||||
/*
|
||||
* Macros for file64 functions
|
||||
*
|
||||
* Android does not support the macro _FILE_OFFSET_BITS=64
|
||||
@ -19,7 +19,6 @@
|
||||
#include <sys/vfs.h>
|
||||
|
||||
//dirent.h
|
||||
#define readdir_r readdir64_r
|
||||
#define readdir readdir64
|
||||
#define dirent dirent64
|
||||
//fcntl.h
|
||||
|
||||
@ -22,7 +22,6 @@ BuildRequires: libzstd-devel
|
||||
BuildRequires: lz4-devel
|
||||
BuildRequires: lzo-devel
|
||||
BuildRequires: openssl-devel
|
||||
BuildRequires: sharutils
|
||||
BuildRequires: xz-devel
|
||||
BuildRequires: zlib-devel
|
||||
|
||||
|
||||
156
contrib/oss-fuzz/fuzz_helpers.h
Normal file
156
contrib/oss-fuzz/fuzz_helpers.h
Normal file
@ -0,0 +1,156 @@
|
||||
// Copyright 2024 Google LLC
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// http://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#ifndef LIBARCHIVE_FUZZ_HELPERS_H_
|
||||
#define LIBARCHIVE_FUZZ_HELPERS_H_
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <ftw.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "archive.h"
|
||||
|
||||
// Default maximum input size for fuzzers
|
||||
static constexpr size_t kDefaultMaxInputSize = 256 * 1024; // 256KB
|
||||
|
||||
// Buffer structure for archive reading callbacks
|
||||
struct Buffer {
|
||||
const uint8_t* data;
|
||||
size_t size;
|
||||
size_t pos;
|
||||
};
|
||||
|
||||
// Archive read callback function
|
||||
static la_ssize_t reader_callback(struct archive* a, void* client_data,
|
||||
const void** buffer) {
|
||||
(void)a;
|
||||
Buffer* buf = static_cast<Buffer*>(client_data);
|
||||
|
||||
if (buf->pos >= buf->size) {
|
||||
return 0; // EOF
|
||||
}
|
||||
|
||||
*buffer = buf->data + buf->pos;
|
||||
size_t remaining = buf->size - buf->pos;
|
||||
buf->pos = buf->size; // Consume all remaining data
|
||||
return static_cast<la_ssize_t>(remaining);
|
||||
}
|
||||
|
||||
// Helper class for consuming fuzz data in structured ways
|
||||
class DataConsumer {
|
||||
public:
|
||||
DataConsumer(const uint8_t* data, size_t size)
|
||||
: data_(data), size_(size), pos_(0) {}
|
||||
|
||||
bool empty() const { return pos_ >= size_; }
|
||||
size_t remaining() const { return size_ - pos_; }
|
||||
|
||||
uint8_t consume_byte() {
|
||||
if (pos_ >= size_) return 0;
|
||||
return data_[pos_++];
|
||||
}
|
||||
|
||||
uint16_t consume_u16() {
|
||||
uint16_t val = 0;
|
||||
if (pos_ + 2 <= size_) {
|
||||
val = static_cast<uint16_t>(data_[pos_]) |
|
||||
(static_cast<uint16_t>(data_[pos_ + 1]) << 8);
|
||||
pos_ += 2;
|
||||
}
|
||||
return val;
|
||||
}
|
||||
|
||||
uint32_t consume_u32() {
|
||||
uint32_t val = 0;
|
||||
if (pos_ + 4 <= size_) {
|
||||
val = static_cast<uint32_t>(data_[pos_]) |
|
||||
(static_cast<uint32_t>(data_[pos_ + 1]) << 8) |
|
||||
(static_cast<uint32_t>(data_[pos_ + 2]) << 16) |
|
||||
(static_cast<uint32_t>(data_[pos_ + 3]) << 24);
|
||||
pos_ += 4;
|
||||
}
|
||||
return val;
|
||||
}
|
||||
|
||||
int64_t consume_i64() {
|
||||
int64_t val = 0;
|
||||
if (pos_ + 8 <= size_) {
|
||||
for (int i = 0; i < 8; i++) {
|
||||
val |= static_cast<int64_t>(data_[pos_ + i]) << (8 * i);
|
||||
}
|
||||
pos_ += 8;
|
||||
}
|
||||
return val;
|
||||
}
|
||||
|
||||
// Consume a null-terminated string up to max_len characters
|
||||
// Returns pointer to internal buffer (valid until next consume_string call)
|
||||
const char* consume_string(size_t max_len) {
|
||||
if (max_len > sizeof(string_buf_) - 1) {
|
||||
max_len = sizeof(string_buf_) - 1;
|
||||
}
|
||||
size_t avail = size_ - pos_;
|
||||
size_t len = (avail < max_len) ? avail : max_len;
|
||||
size_t actual_len = 0;
|
||||
|
||||
while (actual_len < len && pos_ < size_) {
|
||||
char c = static_cast<char>(data_[pos_++]);
|
||||
if (c == '\0') break;
|
||||
string_buf_[actual_len++] = c;
|
||||
}
|
||||
string_buf_[actual_len] = '\0';
|
||||
return string_buf_;
|
||||
}
|
||||
|
||||
// Consume raw bytes into a buffer
|
||||
size_t consume_bytes(void* out, size_t len) {
|
||||
size_t avail = size_ - pos_;
|
||||
size_t to_copy = (avail < len) ? avail : len;
|
||||
if (to_copy > 0) {
|
||||
memcpy(out, data_ + pos_, to_copy);
|
||||
pos_ += to_copy;
|
||||
}
|
||||
return to_copy;
|
||||
}
|
||||
|
||||
// Get remaining data as a buffer
|
||||
const uint8_t* remaining_data() const {
|
||||
return data_ + pos_;
|
||||
}
|
||||
|
||||
private:
|
||||
const uint8_t* data_;
|
||||
size_t size_;
|
||||
size_t pos_;
|
||||
char string_buf_[512];
|
||||
};
|
||||
|
||||
// Callback for nftw to remove files/directories
|
||||
static int remove_callback(const char* fpath, const struct stat* sb,
|
||||
int typeflag, struct FTW* ftwbuf) {
|
||||
(void)sb;
|
||||
(void)typeflag;
|
||||
(void)ftwbuf;
|
||||
return remove(fpath);
|
||||
}
|
||||
|
||||
// Recursively remove a directory tree (safer than system("rm -rf ..."))
|
||||
static int remove_directory_tree(const char* path) {
|
||||
// nftw with FTW_DEPTH processes directory contents before the directory itself
|
||||
return nftw(path, remove_callback, 64, FTW_DEPTH | FTW_PHYS);
|
||||
}
|
||||
|
||||
#endif // LIBARCHIVE_FUZZ_HELPERS_H_
|
||||
63
contrib/oss-fuzz/libarchive_7zip_fuzzer.cc
Normal file
63
contrib/oss-fuzz/libarchive_7zip_fuzzer.cc
Normal file
@ -0,0 +1,63 @@
|
||||
/*
|
||||
* 7-Zip format specific fuzzer for libarchive
|
||||
* Targets 7-Zip parsing and decompression code paths
|
||||
*/
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <vector>
|
||||
|
||||
#include "archive.h"
|
||||
#include "archive_entry.h"
|
||||
#include "fuzz_helpers.h"
|
||||
|
||||
static constexpr size_t kMaxInputSize = 512 * 1024; // 512KB
|
||||
|
||||
|
||||
|
||||
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *buf, size_t len) {
|
||||
if (len == 0 || len > kMaxInputSize) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
struct archive *a = archive_read_new();
|
||||
if (a == NULL) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Enable 7-Zip format specifically
|
||||
archive_read_support_format_7zip(a);
|
||||
// Enable all filters for 7z internal compression
|
||||
archive_read_support_filter_all(a);
|
||||
|
||||
// Set passphrase for encrypted archives
|
||||
archive_read_add_passphrase(a, "password");
|
||||
|
||||
Buffer buffer = {buf, len, 0};
|
||||
if (archive_read_open(a, &buffer, NULL, reader_callback, NULL) != ARCHIVE_OK) {
|
||||
archive_read_free(a);
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::vector<uint8_t> data_buffer(4096, 0);
|
||||
struct archive_entry *entry;
|
||||
|
||||
while (archive_read_next_header(a, &entry) == ARCHIVE_OK) {
|
||||
// Exercise entry metadata access
|
||||
archive_entry_pathname(entry);
|
||||
archive_entry_pathname_w(entry);
|
||||
archive_entry_size(entry);
|
||||
archive_entry_mtime(entry);
|
||||
archive_entry_mode(entry);
|
||||
archive_entry_is_encrypted(entry);
|
||||
archive_entry_is_data_encrypted(entry);
|
||||
archive_entry_is_metadata_encrypted(entry);
|
||||
|
||||
// Read data
|
||||
ssize_t r;
|
||||
while ((r = archive_read_data(a, data_buffer.data(), data_buffer.size())) > 0)
|
||||
;
|
||||
}
|
||||
|
||||
archive_read_free(a);
|
||||
return 0;
|
||||
}
|
||||
47
contrib/oss-fuzz/libarchive_7zip_fuzzer.dict
Normal file
47
contrib/oss-fuzz/libarchive_7zip_fuzzer.dict
Normal file
@ -0,0 +1,47 @@
|
||||
# 7-Zip format dictionary
|
||||
# Magic bytes
|
||||
"7z\xbc\xaf\x27\x1c"
|
||||
"\x37\x7a\xbc\xaf\x27\x1c"
|
||||
|
||||
# Common property IDs
|
||||
"\x00"
|
||||
"\x01"
|
||||
"\x02"
|
||||
"\x03"
|
||||
"\x04"
|
||||
"\x05"
|
||||
"\x06"
|
||||
"\x07"
|
||||
"\x08"
|
||||
"\x09"
|
||||
"\x0a"
|
||||
"\x0b"
|
||||
"\x0c"
|
||||
"\x0d"
|
||||
"\x0e"
|
||||
"\x0f"
|
||||
"\x10"
|
||||
"\x11"
|
||||
"\x17"
|
||||
"\x19"
|
||||
"\x21"
|
||||
"\x23"
|
||||
"\x24"
|
||||
"\x25"
|
||||
|
||||
# Compression method IDs
|
||||
"\x00\x00"
|
||||
"\x00\x03"
|
||||
"\x00\x04"
|
||||
"\x00\x06"
|
||||
"\x01\x01"
|
||||
"\x03\x01\x01"
|
||||
"\x04\x01\x08"
|
||||
"\x04\x02\x02"
|
||||
"\x21\x01"
|
||||
"\x30\x01\x01"
|
||||
|
||||
# Encryption
|
||||
"\x06\xf1\x07\x01"
|
||||
"Password"
|
||||
"password"
|
||||
10
contrib/oss-fuzz/libarchive_7zip_fuzzer.options
Normal file
10
contrib/oss-fuzz/libarchive_7zip_fuzzer.options
Normal file
@ -0,0 +1,10 @@
|
||||
[libfuzzer]
|
||||
max_len = 524288
|
||||
timeout = 60
|
||||
rss_limit_mb = 2048
|
||||
|
||||
[honggfuzz]
|
||||
timeout = 60
|
||||
|
||||
[afl]
|
||||
timeout = 60
|
||||
54
contrib/oss-fuzz/libarchive_ar_fuzzer.cc
Normal file
54
contrib/oss-fuzz/libarchive_ar_fuzzer.cc
Normal file
@ -0,0 +1,54 @@
|
||||
/*
|
||||
* AR (Unix archive) format fuzzer for libarchive
|
||||
* Tests BSD and GNU ar formats
|
||||
*/
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <vector>
|
||||
|
||||
#include "archive.h"
|
||||
#include "archive_entry.h"
|
||||
#include "fuzz_helpers.h"
|
||||
|
||||
static constexpr size_t kMaxInputSize = 512 * 1024;
|
||||
|
||||
|
||||
|
||||
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *buf, size_t len) {
|
||||
if (len == 0 || len > kMaxInputSize) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
struct archive *a = archive_read_new();
|
||||
if (a == NULL) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
archive_read_support_format_ar(a);
|
||||
archive_read_support_filter_all(a);
|
||||
|
||||
Buffer buffer = {buf, len, 0};
|
||||
if (archive_read_open(a, &buffer, NULL, reader_callback, NULL) != ARCHIVE_OK) {
|
||||
archive_read_free(a);
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::vector<uint8_t> data_buffer(4096, 0);
|
||||
struct archive_entry *entry;
|
||||
|
||||
while (archive_read_next_header(a, &entry) == ARCHIVE_OK) {
|
||||
archive_entry_pathname(entry);
|
||||
archive_entry_size(entry);
|
||||
archive_entry_mtime(entry);
|
||||
archive_entry_mode(entry);
|
||||
archive_entry_uid(entry);
|
||||
archive_entry_gid(entry);
|
||||
|
||||
ssize_t r;
|
||||
while ((r = archive_read_data(a, data_buffer.data(), data_buffer.size())) > 0)
|
||||
;
|
||||
}
|
||||
|
||||
archive_read_free(a);
|
||||
return 0;
|
||||
}
|
||||
20
contrib/oss-fuzz/libarchive_ar_fuzzer.dict
Normal file
20
contrib/oss-fuzz/libarchive_ar_fuzzer.dict
Normal file
@ -0,0 +1,20 @@
|
||||
# AR format dictionary
|
||||
|
||||
# AR magic
|
||||
"!<arch>\x0a"
|
||||
|
||||
# File header terminator
|
||||
"\x60\x0a"
|
||||
|
||||
# Special entries
|
||||
"/"
|
||||
"//"
|
||||
"/SYM64/"
|
||||
|
||||
# Common permissions
|
||||
"100644 "
|
||||
"100755 "
|
||||
|
||||
# UID/GID fields
|
||||
"0 "
|
||||
"1000 "
|
||||
51
contrib/oss-fuzz/libarchive_cab_fuzzer.cc
Normal file
51
contrib/oss-fuzz/libarchive_cab_fuzzer.cc
Normal file
@ -0,0 +1,51 @@
|
||||
/*
|
||||
* CAB (Microsoft Cabinet) format fuzzer for libarchive
|
||||
*/
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <vector>
|
||||
|
||||
#include "archive.h"
|
||||
#include "archive_entry.h"
|
||||
#include "fuzz_helpers.h"
|
||||
|
||||
static constexpr size_t kMaxInputSize = 512 * 1024;
|
||||
|
||||
|
||||
|
||||
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *buf, size_t len) {
|
||||
if (len == 0 || len > kMaxInputSize) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
struct archive *a = archive_read_new();
|
||||
if (a == NULL) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
archive_read_support_format_cab(a);
|
||||
archive_read_support_filter_all(a);
|
||||
|
||||
Buffer buffer = {buf, len, 0};
|
||||
if (archive_read_open(a, &buffer, NULL, reader_callback, NULL) != ARCHIVE_OK) {
|
||||
archive_read_free(a);
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::vector<uint8_t> data_buffer(4096, 0);
|
||||
struct archive_entry *entry;
|
||||
|
||||
while (archive_read_next_header(a, &entry) == ARCHIVE_OK) {
|
||||
archive_entry_pathname(entry);
|
||||
archive_entry_size(entry);
|
||||
archive_entry_mtime(entry);
|
||||
archive_entry_mode(entry);
|
||||
|
||||
ssize_t r;
|
||||
while ((r = archive_read_data(a, data_buffer.data(), data_buffer.size())) > 0)
|
||||
;
|
||||
}
|
||||
|
||||
archive_read_free(a);
|
||||
return 0;
|
||||
}
|
||||
23
contrib/oss-fuzz/libarchive_cab_fuzzer.dict
Normal file
23
contrib/oss-fuzz/libarchive_cab_fuzzer.dict
Normal file
@ -0,0 +1,23 @@
|
||||
# CAB (Microsoft Cabinet) format dictionary
|
||||
|
||||
# CAB signature
|
||||
"MSCF"
|
||||
"\x4d\x53\x43\x46"
|
||||
|
||||
# Version
|
||||
"\x03\x01"
|
||||
|
||||
# Compression types
|
||||
"\x00\x00"
|
||||
"\x01\x00"
|
||||
"\x02\x00"
|
||||
"\x03\x00"
|
||||
|
||||
# Folder count patterns
|
||||
"\x01\x00"
|
||||
"\x02\x00"
|
||||
|
||||
# Header flags
|
||||
"\x00\x00"
|
||||
"\x01\x00"
|
||||
"\x04\x00"
|
||||
58
contrib/oss-fuzz/libarchive_cpio_fuzzer.cc
Normal file
58
contrib/oss-fuzz/libarchive_cpio_fuzzer.cc
Normal file
@ -0,0 +1,58 @@
|
||||
/*
|
||||
* CPIO format fuzzer for libarchive
|
||||
* Tests all CPIO variants: binary, odc, newc, crc
|
||||
*/
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <vector>
|
||||
|
||||
#include "archive.h"
|
||||
#include "archive_entry.h"
|
||||
#include "fuzz_helpers.h"
|
||||
|
||||
static constexpr size_t kMaxInputSize = 512 * 1024;
|
||||
|
||||
|
||||
|
||||
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *buf, size_t len) {
|
||||
if (len == 0 || len > kMaxInputSize) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
struct archive *a = archive_read_new();
|
||||
if (a == NULL) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
archive_read_support_format_cpio(a);
|
||||
archive_read_support_filter_all(a);
|
||||
|
||||
Buffer buffer = {buf, len, 0};
|
||||
if (archive_read_open(a, &buffer, NULL, reader_callback, NULL) != ARCHIVE_OK) {
|
||||
archive_read_free(a);
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::vector<uint8_t> data_buffer(4096, 0);
|
||||
struct archive_entry *entry;
|
||||
|
||||
while (archive_read_next_header(a, &entry) == ARCHIVE_OK) {
|
||||
archive_entry_pathname(entry);
|
||||
archive_entry_size(entry);
|
||||
archive_entry_mtime(entry);
|
||||
archive_entry_mode(entry);
|
||||
archive_entry_uid(entry);
|
||||
archive_entry_gid(entry);
|
||||
archive_entry_ino(entry);
|
||||
archive_entry_nlink(entry);
|
||||
archive_entry_rdev(entry);
|
||||
archive_entry_hardlink(entry);
|
||||
|
||||
ssize_t r;
|
||||
while ((r = archive_read_data(a, data_buffer.data(), data_buffer.size())) > 0)
|
||||
;
|
||||
}
|
||||
|
||||
archive_read_free(a);
|
||||
return 0;
|
||||
}
|
||||
25
contrib/oss-fuzz/libarchive_cpio_fuzzer.dict
Normal file
25
contrib/oss-fuzz/libarchive_cpio_fuzzer.dict
Normal file
@ -0,0 +1,25 @@
|
||||
# CPIO format dictionary
|
||||
|
||||
# Binary magic (little endian)
|
||||
"\xc7\x71"
|
||||
|
||||
# Binary magic (big endian)
|
||||
"\x71\xc7"
|
||||
|
||||
# ASCII odc magic
|
||||
"070707"
|
||||
|
||||
# ASCII newc magic
|
||||
"070701"
|
||||
|
||||
# ASCII crc magic
|
||||
"070702"
|
||||
|
||||
# Common trailer
|
||||
"TRAILER!!!"
|
||||
|
||||
# Common field patterns
|
||||
"00000000"
|
||||
"00000001"
|
||||
"000001ed"
|
||||
"000003e8"
|
||||
101
contrib/oss-fuzz/libarchive_encryption_fuzzer.cc
Normal file
101
contrib/oss-fuzz/libarchive_encryption_fuzzer.cc
Normal file
@ -0,0 +1,101 @@
|
||||
/*
|
||||
* Encrypted archive fuzzer for libarchive
|
||||
* Tests password/passphrase handling across formats
|
||||
*/
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <vector>
|
||||
|
||||
#include "archive.h"
|
||||
#include "archive_entry.h"
|
||||
#include "fuzz_helpers.h"
|
||||
|
||||
static constexpr size_t kMaxInputSize = 512 * 1024;
|
||||
|
||||
// Passphrase callback for testing
|
||||
static const char *test_passphrases[] = {
|
||||
"password",
|
||||
"test",
|
||||
"123456",
|
||||
"",
|
||||
"secret",
|
||||
NULL
|
||||
};
|
||||
|
||||
static int passphrase_idx = 0;
|
||||
|
||||
static const char* passphrase_callback(struct archive *a, void *client_data) {
|
||||
(void)a;
|
||||
(void)client_data;
|
||||
const char *pass = test_passphrases[passphrase_idx];
|
||||
if (pass != NULL) {
|
||||
passphrase_idx++;
|
||||
}
|
||||
return pass;
|
||||
}
|
||||
|
||||
|
||||
|
||||
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *buf, size_t len) {
|
||||
if (len == 0 || len > kMaxInputSize) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Reset passphrase index
|
||||
passphrase_idx = 0;
|
||||
|
||||
struct archive *a = archive_read_new();
|
||||
if (a == NULL) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Enable all formats that support encryption
|
||||
archive_read_support_format_zip(a);
|
||||
archive_read_support_format_7zip(a);
|
||||
archive_read_support_format_rar(a);
|
||||
archive_read_support_format_rar5(a);
|
||||
archive_read_support_filter_all(a);
|
||||
|
||||
// Set up passphrase callback
|
||||
archive_read_set_passphrase_callback(a, NULL, passphrase_callback);
|
||||
|
||||
// Also add some static passphrases
|
||||
archive_read_add_passphrase(a, "password");
|
||||
archive_read_add_passphrase(a, "test123");
|
||||
|
||||
Buffer buffer = {buf, len, 0};
|
||||
if (archive_read_open(a, &buffer, NULL, reader_callback, NULL) != ARCHIVE_OK) {
|
||||
archive_read_free(a);
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::vector<uint8_t> data_buffer(4096, 0);
|
||||
struct archive_entry *entry;
|
||||
int entry_count = 0;
|
||||
|
||||
while (archive_read_next_header(a, &entry) == ARCHIVE_OK && entry_count < 100) {
|
||||
archive_entry_pathname(entry);
|
||||
|
||||
// Check encryption status
|
||||
int is_encrypted = archive_entry_is_encrypted(entry);
|
||||
int is_data_encrypted = archive_entry_is_data_encrypted(entry);
|
||||
int is_meta_encrypted = archive_entry_is_metadata_encrypted(entry);
|
||||
(void)is_encrypted;
|
||||
(void)is_data_encrypted;
|
||||
(void)is_meta_encrypted;
|
||||
|
||||
// Check if archive has encrypted entries
|
||||
archive_read_has_encrypted_entries(a);
|
||||
|
||||
// Try to read data (may fail due to wrong password)
|
||||
ssize_t r;
|
||||
while ((r = archive_read_data(a, data_buffer.data(), data_buffer.size())) > 0)
|
||||
;
|
||||
|
||||
entry_count++;
|
||||
}
|
||||
|
||||
archive_read_free(a);
|
||||
return 0;
|
||||
}
|
||||
10
contrib/oss-fuzz/libarchive_encryption_fuzzer.options
Normal file
10
contrib/oss-fuzz/libarchive_encryption_fuzzer.options
Normal file
@ -0,0 +1,10 @@
|
||||
[libfuzzer]
|
||||
max_len = 524288
|
||||
timeout = 60
|
||||
rss_limit_mb = 2048
|
||||
|
||||
[honggfuzz]
|
||||
timeout = 60
|
||||
|
||||
[afl]
|
||||
timeout = 60
|
||||
105
contrib/oss-fuzz/libarchive_entry_fuzzer.cc
Normal file
105
contrib/oss-fuzz/libarchive_entry_fuzzer.cc
Normal file
@ -0,0 +1,105 @@
|
||||
/*
|
||||
* Archive entry fuzzer for libarchive
|
||||
* Targets archive_entry_* functions including ACL, linkify, and metadata
|
||||
*/
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "archive.h"
|
||||
#include "archive_entry.h"
|
||||
#include "fuzz_helpers.h"
|
||||
|
||||
static constexpr size_t kMaxInputSize = 64 * 1024; // 64KB
|
||||
|
||||
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *buf, size_t len) {
|
||||
if (len == 0 || len > kMaxInputSize) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
DataConsumer consumer(buf, len);
|
||||
|
||||
struct archive_entry *entry = archive_entry_new();
|
||||
if (entry == NULL) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Set basic entry properties
|
||||
archive_entry_set_pathname(entry, consumer.consume_string(256));
|
||||
archive_entry_set_size(entry, consumer.consume_i64());
|
||||
archive_entry_set_mode(entry, consumer.consume_u32());
|
||||
archive_entry_set_uid(entry, consumer.consume_u32());
|
||||
archive_entry_set_gid(entry, consumer.consume_u32());
|
||||
archive_entry_set_mtime(entry, consumer.consume_i64(), 0);
|
||||
archive_entry_set_atime(entry, consumer.consume_i64(), 0);
|
||||
archive_entry_set_ctime(entry, consumer.consume_i64(), 0);
|
||||
archive_entry_set_birthtime(entry, consumer.consume_i64(), 0);
|
||||
|
||||
// Set various string fields
|
||||
archive_entry_set_uname(entry, consumer.consume_string(64));
|
||||
archive_entry_set_gname(entry, consumer.consume_string(64));
|
||||
archive_entry_set_symlink(entry, consumer.consume_string(256));
|
||||
archive_entry_set_hardlink(entry, consumer.consume_string(256));
|
||||
|
||||
// Exercise ACL functions (low coverage targets)
|
||||
int acl_type = consumer.consume_byte() & 0x0F;
|
||||
int acl_permset = consumer.consume_u32();
|
||||
int acl_tag = consumer.consume_byte() & 0x0F;
|
||||
int acl_qual = consumer.consume_u32();
|
||||
const char *acl_name = consumer.consume_string(64);
|
||||
|
||||
archive_entry_acl_add_entry(entry, acl_type, acl_permset, acl_tag, acl_qual, acl_name);
|
||||
|
||||
// Add more ACL entries based on remaining data
|
||||
while (!consumer.empty() && consumer.remaining() > 10) {
|
||||
acl_type = consumer.consume_byte() & 0x0F;
|
||||
acl_permset = consumer.consume_u32();
|
||||
acl_tag = consumer.consume_byte() & 0x0F;
|
||||
acl_qual = consumer.consume_u32();
|
||||
acl_name = consumer.consume_string(32);
|
||||
archive_entry_acl_add_entry(entry, acl_type, acl_permset, acl_tag, acl_qual, acl_name);
|
||||
}
|
||||
|
||||
// Exercise ACL text conversion functions (archive_acl_to_text_* are uncovered)
|
||||
ssize_t text_len;
|
||||
char *acl_text = archive_entry_acl_to_text(entry, &text_len, ARCHIVE_ENTRY_ACL_TYPE_ACCESS);
|
||||
if (acl_text) {
|
||||
// Parse the text back
|
||||
archive_entry_acl_from_text(entry, acl_text, ARCHIVE_ENTRY_ACL_TYPE_ACCESS);
|
||||
free(acl_text);
|
||||
}
|
||||
|
||||
acl_text = archive_entry_acl_to_text(entry, &text_len, ARCHIVE_ENTRY_ACL_TYPE_DEFAULT);
|
||||
if (acl_text) {
|
||||
free(acl_text);
|
||||
}
|
||||
|
||||
acl_text = archive_entry_acl_to_text(entry, &text_len, ARCHIVE_ENTRY_ACL_TYPE_NFS4);
|
||||
if (acl_text) {
|
||||
free(acl_text);
|
||||
}
|
||||
|
||||
// Exercise wide character versions
|
||||
wchar_t *acl_text_w = archive_entry_acl_to_text_w(entry, &text_len, ARCHIVE_ENTRY_ACL_TYPE_ACCESS);
|
||||
if (acl_text_w) {
|
||||
free(acl_text_w);
|
||||
}
|
||||
|
||||
// Get pathname variants
|
||||
archive_entry_pathname(entry);
|
||||
archive_entry_pathname_w(entry);
|
||||
archive_entry_pathname_utf8(entry);
|
||||
|
||||
// Clone the entry
|
||||
struct archive_entry *entry2 = archive_entry_clone(entry);
|
||||
if (entry2) {
|
||||
archive_entry_free(entry2);
|
||||
}
|
||||
|
||||
// Clear and reuse
|
||||
archive_entry_clear(entry);
|
||||
|
||||
archive_entry_free(entry);
|
||||
return 0;
|
||||
}
|
||||
65
contrib/oss-fuzz/libarchive_filter_fuzzer.cc
Normal file
65
contrib/oss-fuzz/libarchive_filter_fuzzer.cc
Normal file
@ -0,0 +1,65 @@
|
||||
/*
|
||||
* Compression filter fuzzer for libarchive
|
||||
* Tests decompression of gzip, bzip2, xz, lzma, zstd, lz4, etc.
|
||||
*/
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <vector>
|
||||
|
||||
#include "archive.h"
|
||||
#include "archive_entry.h"
|
||||
#include "fuzz_helpers.h"
|
||||
|
||||
static constexpr size_t kMaxInputSize = 256 * 1024;
|
||||
|
||||
|
||||
|
||||
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *buf, size_t len) {
|
||||
if (len == 0 || len > kMaxInputSize) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
struct archive *a = archive_read_new();
|
||||
if (a == NULL) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Enable raw format (just decompress, no archive format)
|
||||
archive_read_support_format_raw(a);
|
||||
|
||||
// Enable all compression filters
|
||||
archive_read_support_filter_all(a);
|
||||
|
||||
Buffer buffer = {buf, len, 0};
|
||||
if (archive_read_open(a, &buffer, NULL, reader_callback, NULL) != ARCHIVE_OK) {
|
||||
archive_read_free(a);
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::vector<uint8_t> data_buffer(8192, 0);
|
||||
struct archive_entry *entry;
|
||||
|
||||
if (archive_read_next_header(a, &entry) == ARCHIVE_OK) {
|
||||
// Get filter info
|
||||
int filter_count = archive_filter_count(a);
|
||||
for (int i = 0; i < filter_count; i++) {
|
||||
archive_filter_name(a, i);
|
||||
archive_filter_code(a, i);
|
||||
archive_filter_bytes(a, i);
|
||||
}
|
||||
|
||||
// Read all decompressed data
|
||||
ssize_t total = 0;
|
||||
ssize_t r;
|
||||
while ((r = archive_read_data(a, data_buffer.data(), data_buffer.size())) > 0) {
|
||||
total += r;
|
||||
// Limit total decompressed size to prevent zip bombs
|
||||
if (total > 10 * 1024 * 1024) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
archive_read_free(a);
|
||||
return 0;
|
||||
}
|
||||
33
contrib/oss-fuzz/libarchive_filter_fuzzer.dict
Normal file
33
contrib/oss-fuzz/libarchive_filter_fuzzer.dict
Normal file
@ -0,0 +1,33 @@
|
||||
# Compression filter dictionary
|
||||
|
||||
# GZIP magic
|
||||
"\x1f\x8b"
|
||||
"\x1f\x8b\x08"
|
||||
|
||||
# BZIP2 magic
|
||||
"BZh"
|
||||
"BZ0"
|
||||
|
||||
# XZ magic
|
||||
"\xfd7zXZ\x00"
|
||||
|
||||
# LZMA magic
|
||||
"\x5d\x00\x00"
|
||||
|
||||
# ZSTD magic
|
||||
"\x28\xb5\x2f\xfd"
|
||||
|
||||
# LZ4 magic
|
||||
"\x04\x22\x4d\x18"
|
||||
|
||||
# Compress (.Z) magic
|
||||
"\x1f\x9d"
|
||||
|
||||
# LZIP magic
|
||||
"LZIP"
|
||||
|
||||
# LRZIP magic
|
||||
"LRZI"
|
||||
|
||||
# LZO magic
|
||||
"\x89LZO\x00\x0d\x0a\x1a\x0a"
|
||||
10
contrib/oss-fuzz/libarchive_filter_fuzzer.options
Normal file
10
contrib/oss-fuzz/libarchive_filter_fuzzer.options
Normal file
@ -0,0 +1,10 @@
|
||||
[libfuzzer]
|
||||
max_len = 262144
|
||||
timeout = 30
|
||||
rss_limit_mb = 2048
|
||||
|
||||
[honggfuzz]
|
||||
timeout = 30
|
||||
|
||||
[afl]
|
||||
timeout = 30
|
||||
@ -3,20 +3,7 @@
|
||||
#include <vector>
|
||||
|
||||
#include "archive.h"
|
||||
|
||||
struct Buffer {
|
||||
const uint8_t *buf;
|
||||
size_t len;
|
||||
};
|
||||
|
||||
ssize_t reader_callback(struct archive *a, void *client_data,
|
||||
const void **block) {
|
||||
Buffer *buffer = reinterpret_cast<Buffer *>(client_data);
|
||||
*block = buffer->buf;
|
||||
ssize_t len = buffer->len;
|
||||
buffer->len = 0;
|
||||
return len;
|
||||
}
|
||||
#include "fuzz_helpers.h"
|
||||
|
||||
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *buf, size_t len) {
|
||||
int ret;
|
||||
@ -26,7 +13,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *buf, size_t len) {
|
||||
archive_read_support_filter_all(a);
|
||||
archive_read_support_format_all(a);
|
||||
|
||||
Buffer buffer = {buf, len};
|
||||
Buffer buffer = {buf, len, 0};
|
||||
archive_read_open(a, &buffer, NULL, reader_callback, NULL);
|
||||
|
||||
std::vector<uint8_t> data_buffer(getpagesize(), 0);
|
||||
|
||||
76
contrib/oss-fuzz/libarchive_fuzzer.dict
Normal file
76
contrib/oss-fuzz/libarchive_fuzzer.dict
Normal file
@ -0,0 +1,76 @@
|
||||
# General libarchive dictionary covering multiple formats
|
||||
|
||||
# TAR magic
|
||||
"ustar"
|
||||
"ustar\x00"
|
||||
"ustar \x00"
|
||||
"\x00\x00"
|
||||
|
||||
# ZIP magic
|
||||
"PK\x03\x04"
|
||||
"PK\x05\x06"
|
||||
"PK\x01\x02"
|
||||
"PK\x07\x08"
|
||||
|
||||
# 7z magic
|
||||
"7z\xbc\xaf\x27\x1c"
|
||||
|
||||
# RAR magic
|
||||
"Rar!\x1a\x07\x00"
|
||||
"Rar!\x1a\x07\x01\x00"
|
||||
|
||||
# XAR magic
|
||||
"xar!"
|
||||
|
||||
# CPIO magic
|
||||
"\xc7\x71"
|
||||
"070701"
|
||||
"070702"
|
||||
"070707"
|
||||
|
||||
# CAB magic
|
||||
"MSCF"
|
||||
|
||||
# LHA magic
|
||||
"-lh"
|
||||
"-lz"
|
||||
|
||||
# AR magic
|
||||
"!<arch>\x0a"
|
||||
|
||||
# ISO9660 magic
|
||||
"CD001"
|
||||
|
||||
# GZIP magic
|
||||
"\x1f\x8b"
|
||||
|
||||
# BZIP2 magic
|
||||
"BZ"
|
||||
"BZh"
|
||||
|
||||
# XZ magic
|
||||
"\xfd7zXZ\x00"
|
||||
|
||||
# LZMA magic
|
||||
"\x5d\x00\x00"
|
||||
|
||||
# ZSTD magic
|
||||
"\x28\xb5\x2f\xfd"
|
||||
|
||||
# LZ4 magic
|
||||
"\x04\x22\x4d\x18"
|
||||
|
||||
# Common paths
|
||||
"/"
|
||||
"./"
|
||||
"../"
|
||||
"./test"
|
||||
"test.txt"
|
||||
"test/"
|
||||
|
||||
# Common attributes
|
||||
"\x00\x00\x00\x00"
|
||||
"\xff\xff\xff\xff"
|
||||
|
||||
# Passphrase
|
||||
"password"
|
||||
9
contrib/oss-fuzz/libarchive_fuzzer.options
Normal file
9
contrib/oss-fuzz/libarchive_fuzzer.options
Normal file
@ -0,0 +1,9 @@
|
||||
[libfuzzer]
|
||||
max_len = 524288
|
||||
timeout = 30
|
||||
|
||||
[honggfuzz]
|
||||
timeout = 30
|
||||
|
||||
[afl]
|
||||
timeout = 30
|
||||
58
contrib/oss-fuzz/libarchive_iso9660_fuzzer.cc
Normal file
58
contrib/oss-fuzz/libarchive_iso9660_fuzzer.cc
Normal file
@ -0,0 +1,58 @@
|
||||
/*
|
||||
* ISO9660 format fuzzer for libarchive
|
||||
* Tests ISO, Joliet, and Rock Ridge extensions
|
||||
*/
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <vector>
|
||||
|
||||
#include "archive.h"
|
||||
#include "archive_entry.h"
|
||||
#include "fuzz_helpers.h"
|
||||
|
||||
static constexpr size_t kMaxInputSize = 1024 * 1024; // 1MB for ISO images
|
||||
|
||||
|
||||
|
||||
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *buf, size_t len) {
|
||||
if (len == 0 || len > kMaxInputSize) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
struct archive *a = archive_read_new();
|
||||
if (a == NULL) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
archive_read_support_format_iso9660(a);
|
||||
archive_read_support_filter_all(a);
|
||||
|
||||
// Set options to test various ISO extensions
|
||||
archive_read_set_options(a, "iso9660:joliet,iso9660:rockridge");
|
||||
|
||||
Buffer buffer = {buf, len, 0};
|
||||
if (archive_read_open(a, &buffer, NULL, reader_callback, NULL) != ARCHIVE_OK) {
|
||||
archive_read_free(a);
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::vector<uint8_t> data_buffer(4096, 0);
|
||||
struct archive_entry *entry;
|
||||
|
||||
while (archive_read_next_header(a, &entry) == ARCHIVE_OK) {
|
||||
archive_entry_pathname(entry);
|
||||
archive_entry_pathname_w(entry);
|
||||
archive_entry_size(entry);
|
||||
archive_entry_mtime(entry);
|
||||
archive_entry_mode(entry);
|
||||
archive_entry_symlink(entry);
|
||||
archive_entry_hardlink(entry);
|
||||
|
||||
ssize_t r;
|
||||
while ((r = archive_read_data(a, data_buffer.data(), data_buffer.size())) > 0)
|
||||
;
|
||||
}
|
||||
|
||||
archive_read_free(a);
|
||||
return 0;
|
||||
}
|
||||
36
contrib/oss-fuzz/libarchive_iso9660_fuzzer.dict
Normal file
36
contrib/oss-fuzz/libarchive_iso9660_fuzzer.dict
Normal file
@ -0,0 +1,36 @@
|
||||
# ISO9660 format dictionary
|
||||
|
||||
# Volume descriptor type
|
||||
"\x00"
|
||||
"\x01"
|
||||
"\x02"
|
||||
"\xff"
|
||||
|
||||
# Standard identifier
|
||||
"CD001"
|
||||
|
||||
# Volume descriptor version
|
||||
"\x01"
|
||||
|
||||
# Joliet escape sequences
|
||||
"%/@"
|
||||
"%/C"
|
||||
"%/E"
|
||||
|
||||
# Rock Ridge signatures
|
||||
"SP"
|
||||
"RR"
|
||||
"CE"
|
||||
"PX"
|
||||
"PN"
|
||||
"SL"
|
||||
"NM"
|
||||
"CL"
|
||||
"PL"
|
||||
"RE"
|
||||
"TF"
|
||||
"SF"
|
||||
|
||||
# System use
|
||||
"ER"
|
||||
"ES"
|
||||
10
contrib/oss-fuzz/libarchive_iso9660_fuzzer.options
Normal file
10
contrib/oss-fuzz/libarchive_iso9660_fuzzer.options
Normal file
@ -0,0 +1,10 @@
|
||||
[libfuzzer]
|
||||
max_len = 1048576
|
||||
timeout = 60
|
||||
rss_limit_mb = 2048
|
||||
|
||||
[honggfuzz]
|
||||
timeout = 60
|
||||
|
||||
[afl]
|
||||
timeout = 60
|
||||
54
contrib/oss-fuzz/libarchive_lha_fuzzer.cc
Normal file
54
contrib/oss-fuzz/libarchive_lha_fuzzer.cc
Normal file
@ -0,0 +1,54 @@
|
||||
/*
|
||||
* LHA/LZH format fuzzer for libarchive
|
||||
*/
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <vector>
|
||||
|
||||
#include "archive.h"
|
||||
#include "archive_entry.h"
|
||||
#include "fuzz_helpers.h"
|
||||
|
||||
static constexpr size_t kMaxInputSize = 512 * 1024;
|
||||
|
||||
|
||||
|
||||
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *buf, size_t len) {
|
||||
if (len == 0 || len > kMaxInputSize) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
struct archive *a = archive_read_new();
|
||||
if (a == NULL) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
archive_read_support_format_lha(a);
|
||||
archive_read_support_filter_all(a);
|
||||
|
||||
Buffer buffer = {buf, len, 0};
|
||||
if (archive_read_open(a, &buffer, NULL, reader_callback, NULL) != ARCHIVE_OK) {
|
||||
archive_read_free(a);
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::vector<uint8_t> data_buffer(4096, 0);
|
||||
struct archive_entry *entry;
|
||||
|
||||
while (archive_read_next_header(a, &entry) == ARCHIVE_OK) {
|
||||
archive_entry_pathname(entry);
|
||||
archive_entry_pathname_w(entry);
|
||||
archive_entry_size(entry);
|
||||
archive_entry_mtime(entry);
|
||||
archive_entry_mode(entry);
|
||||
archive_entry_uid(entry);
|
||||
archive_entry_gid(entry);
|
||||
|
||||
ssize_t r;
|
||||
while ((r = archive_read_data(a, data_buffer.data(), data_buffer.size())) > 0)
|
||||
;
|
||||
}
|
||||
|
||||
archive_read_free(a);
|
||||
return 0;
|
||||
}
|
||||
26
contrib/oss-fuzz/libarchive_lha_fuzzer.dict
Normal file
26
contrib/oss-fuzz/libarchive_lha_fuzzer.dict
Normal file
@ -0,0 +1,26 @@
|
||||
# LHA/LZH format dictionary
|
||||
|
||||
# Compression methods
|
||||
"-lh0-"
|
||||
"-lh1-"
|
||||
"-lh2-"
|
||||
"-lh3-"
|
||||
"-lh4-"
|
||||
"-lh5-"
|
||||
"-lh6-"
|
||||
"-lh7-"
|
||||
"-lhd-"
|
||||
"-lzs-"
|
||||
"-lz4-"
|
||||
"-lz5-"
|
||||
|
||||
# OS type
|
||||
"\x00"
|
||||
"\x4d"
|
||||
"\x55"
|
||||
|
||||
# Header levels
|
||||
"\x00"
|
||||
"\x01"
|
||||
"\x02"
|
||||
"\x03"
|
||||
110
contrib/oss-fuzz/libarchive_linkify_fuzzer.cc
Normal file
110
contrib/oss-fuzz/libarchive_linkify_fuzzer.cc
Normal file
@ -0,0 +1,110 @@
|
||||
/*
|
||||
* Archive entry link resolver fuzzer for libarchive
|
||||
* Targets archive_entry_linkify (complexity: 775, zero coverage)
|
||||
*/
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
#include "archive.h"
|
||||
#include "archive_entry.h"
|
||||
#include "fuzz_helpers.h"
|
||||
|
||||
static constexpr size_t kMaxInputSize = 64 * 1024; // 64KB
|
||||
|
||||
// Simple data consumer
|
||||
|
||||
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *buf, size_t len) {
|
||||
if (len == 0 || len > kMaxInputSize) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
DataConsumer consumer(buf, len);
|
||||
|
||||
// Create a link resolver
|
||||
struct archive_entry_linkresolver *resolver = archive_entry_linkresolver_new();
|
||||
if (resolver == NULL) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Set the format strategy based on input
|
||||
uint8_t strategy = consumer.consume_byte() % 5;
|
||||
int format;
|
||||
switch (strategy) {
|
||||
case 0: format = ARCHIVE_FORMAT_TAR_GNUTAR; break;
|
||||
case 1: format = ARCHIVE_FORMAT_TAR_PAX_INTERCHANGE; break;
|
||||
case 2: format = ARCHIVE_FORMAT_CPIO_POSIX; break;
|
||||
case 3: format = ARCHIVE_FORMAT_CPIO_SVR4_NOCRC; break;
|
||||
default: format = ARCHIVE_FORMAT_TAR_USTAR; break;
|
||||
}
|
||||
archive_entry_linkresolver_set_strategy(resolver, format);
|
||||
|
||||
// Create multiple entries to test linkify with hardlinks
|
||||
struct archive_entry *entries[32];
|
||||
int num_entries = 0;
|
||||
|
||||
while (!consumer.empty() && num_entries < 32 && consumer.remaining() > 20) {
|
||||
struct archive_entry *entry = archive_entry_new();
|
||||
if (entry == NULL) break;
|
||||
|
||||
// Set pathname
|
||||
archive_entry_set_pathname(entry, consumer.consume_string(64));
|
||||
|
||||
// Set inode and device for hardlink detection
|
||||
archive_entry_set_ino(entry, consumer.consume_i64());
|
||||
archive_entry_set_dev(entry, consumer.consume_u32());
|
||||
archive_entry_set_nlink(entry, (consumer.consume_byte() % 5) + 1);
|
||||
|
||||
// Set mode (regular file or directory)
|
||||
uint8_t ftype = consumer.consume_byte() % 2;
|
||||
mode_t mode = ftype ? (S_IFDIR | 0755) : (S_IFREG | 0644);
|
||||
archive_entry_set_mode(entry, mode);
|
||||
|
||||
archive_entry_set_size(entry, consumer.consume_i64() & 0xFFFF);
|
||||
archive_entry_set_uid(entry, consumer.consume_u32() & 0xFFFF);
|
||||
archive_entry_set_gid(entry, consumer.consume_u32() & 0xFFFF);
|
||||
|
||||
entries[num_entries++] = entry;
|
||||
}
|
||||
|
||||
// Now run all entries through the linkresolver
|
||||
for (int i = 0; i < num_entries; i++) {
|
||||
struct archive_entry *entry = entries[i];
|
||||
struct archive_entry *spare = NULL;
|
||||
|
||||
// This is the main function we want to fuzz (zero coverage)
|
||||
archive_entry_linkify(resolver, &entry, &spare);
|
||||
|
||||
// entry and spare may be modified by linkify
|
||||
// We still need to free the original entries we allocated
|
||||
if (spare != NULL) {
|
||||
archive_entry_free(spare);
|
||||
}
|
||||
}
|
||||
|
||||
// Free remaining entries from the resolver
|
||||
struct archive_entry *entry = NULL;
|
||||
struct archive_entry *spare = NULL;
|
||||
while (1) {
|
||||
archive_entry_linkify(resolver, &entry, &spare);
|
||||
if (entry == NULL)
|
||||
break;
|
||||
archive_entry_free(entry);
|
||||
entry = NULL;
|
||||
if (spare != NULL) {
|
||||
archive_entry_free(spare);
|
||||
spare = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
// Free all our created entries
|
||||
for (int i = 0; i < num_entries; i++) {
|
||||
if (entries[i] != NULL) {
|
||||
archive_entry_free(entries[i]);
|
||||
}
|
||||
}
|
||||
|
||||
archive_entry_linkresolver_free(resolver);
|
||||
return 0;
|
||||
}
|
||||
96
contrib/oss-fuzz/libarchive_match_fuzzer.cc
Normal file
96
contrib/oss-fuzz/libarchive_match_fuzzer.cc
Normal file
@ -0,0 +1,96 @@
|
||||
/*
|
||||
* Archive match fuzzer for libarchive
|
||||
* Tests pattern matching, time matching, and owner matching
|
||||
*/
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "archive.h"
|
||||
#include "archive_entry.h"
|
||||
#include "fuzz_helpers.h"
|
||||
|
||||
static constexpr size_t kMaxInputSize = 32 * 1024;
|
||||
|
||||
|
||||
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *buf, size_t len) {
|
||||
if (len == 0 || len > kMaxInputSize) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
DataConsumer consumer(buf, len);
|
||||
|
||||
struct archive *match = archive_match_new();
|
||||
if (match == NULL) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Add various match patterns
|
||||
while (!consumer.empty() && consumer.remaining() > 5) {
|
||||
uint8_t match_type = consumer.consume_byte() % 6;
|
||||
|
||||
switch (match_type) {
|
||||
case 0: {
|
||||
// Pattern exclusion
|
||||
const char *pattern = consumer.consume_string(64);
|
||||
archive_match_exclude_pattern(match, pattern);
|
||||
break;
|
||||
}
|
||||
case 1: {
|
||||
// Pattern inclusion
|
||||
const char *pattern = consumer.consume_string(64);
|
||||
archive_match_include_pattern(match, pattern);
|
||||
break;
|
||||
}
|
||||
case 2: {
|
||||
// Time comparison (newer than)
|
||||
int64_t sec = consumer.consume_i64();
|
||||
int64_t nsec = consumer.consume_i64() % 1000000000;
|
||||
archive_match_include_time(match, ARCHIVE_MATCH_MTIME | ARCHIVE_MATCH_NEWER,
|
||||
sec, nsec);
|
||||
break;
|
||||
}
|
||||
case 3: {
|
||||
// Time comparison (older than)
|
||||
int64_t sec = consumer.consume_i64();
|
||||
int64_t nsec = consumer.consume_i64() % 1000000000;
|
||||
archive_match_include_time(match, ARCHIVE_MATCH_MTIME | ARCHIVE_MATCH_OLDER,
|
||||
sec, nsec);
|
||||
break;
|
||||
}
|
||||
case 4: {
|
||||
// UID inclusion
|
||||
int64_t uid = consumer.consume_i64() & 0xFFFF;
|
||||
archive_match_include_uid(match, uid);
|
||||
break;
|
||||
}
|
||||
case 5: {
|
||||
// GID inclusion
|
||||
int64_t gid = consumer.consume_i64() & 0xFFFF;
|
||||
archive_match_include_gid(match, gid);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Create a test entry and check if it matches
|
||||
struct archive_entry *entry = archive_entry_new();
|
||||
if (entry) {
|
||||
archive_entry_set_pathname(entry, "test/file.txt");
|
||||
archive_entry_set_mtime(entry, 1234567890, 0);
|
||||
archive_entry_set_uid(entry, 1000);
|
||||
archive_entry_set_gid(entry, 1000);
|
||||
archive_entry_set_mode(entry, 0644 | 0100000); // Regular file
|
||||
|
||||
// Test matching
|
||||
archive_match_path_excluded(match, entry);
|
||||
archive_match_time_excluded(match, entry);
|
||||
archive_match_owner_excluded(match, entry);
|
||||
archive_match_excluded(match, entry);
|
||||
|
||||
archive_entry_free(entry);
|
||||
}
|
||||
|
||||
archive_match_free(match);
|
||||
return 0;
|
||||
}
|
||||
61
contrib/oss-fuzz/libarchive_mtree_fuzzer.cc
Normal file
61
contrib/oss-fuzz/libarchive_mtree_fuzzer.cc
Normal file
@ -0,0 +1,61 @@
|
||||
/*
|
||||
* MTREE format fuzzer for libarchive
|
||||
* Tests mtree manifest parsing
|
||||
*/
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <vector>
|
||||
|
||||
#include "archive.h"
|
||||
#include "archive_entry.h"
|
||||
#include "fuzz_helpers.h"
|
||||
|
||||
static constexpr size_t kMaxInputSize = 256 * 1024;
|
||||
|
||||
|
||||
|
||||
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *buf, size_t len) {
|
||||
if (len == 0 || len > kMaxInputSize) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
struct archive *a = archive_read_new();
|
||||
if (a == NULL) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
archive_read_support_format_mtree(a);
|
||||
archive_read_support_filter_all(a);
|
||||
|
||||
// Enable checkfs option to test more code paths
|
||||
archive_read_set_options(a, "mtree:checkfs");
|
||||
|
||||
Buffer buffer = {buf, len, 0};
|
||||
if (archive_read_open(a, &buffer, NULL, reader_callback, NULL) != ARCHIVE_OK) {
|
||||
archive_read_free(a);
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::vector<uint8_t> data_buffer(4096, 0);
|
||||
struct archive_entry *entry;
|
||||
|
||||
while (archive_read_next_header(a, &entry) == ARCHIVE_OK) {
|
||||
archive_entry_pathname(entry);
|
||||
archive_entry_size(entry);
|
||||
archive_entry_mtime(entry);
|
||||
archive_entry_mode(entry);
|
||||
archive_entry_uid(entry);
|
||||
archive_entry_gid(entry);
|
||||
archive_entry_uname(entry);
|
||||
archive_entry_gname(entry);
|
||||
archive_entry_symlink(entry);
|
||||
archive_entry_fflags_text(entry);
|
||||
|
||||
ssize_t r;
|
||||
while ((r = archive_read_data(a, data_buffer.data(), data_buffer.size())) > 0)
|
||||
;
|
||||
}
|
||||
|
||||
archive_read_free(a);
|
||||
return 0;
|
||||
}
|
||||
47
contrib/oss-fuzz/libarchive_mtree_fuzzer.dict
Normal file
47
contrib/oss-fuzz/libarchive_mtree_fuzzer.dict
Normal file
@ -0,0 +1,47 @@
|
||||
# MTREE format dictionary
|
||||
|
||||
# Keywords
|
||||
"/set"
|
||||
"/unset"
|
||||
".."
|
||||
|
||||
# File types
|
||||
"type=file"
|
||||
"type=dir"
|
||||
"type=link"
|
||||
"type=block"
|
||||
"type=char"
|
||||
"type=fifo"
|
||||
"type=socket"
|
||||
|
||||
# Attributes
|
||||
"mode="
|
||||
"uid="
|
||||
"gid="
|
||||
"uname="
|
||||
"gname="
|
||||
"size="
|
||||
"time="
|
||||
"link="
|
||||
"cksum="
|
||||
"md5="
|
||||
"md5digest="
|
||||
"sha1="
|
||||
"sha1digest="
|
||||
"sha256="
|
||||
"sha256digest="
|
||||
"sha384="
|
||||
"sha384digest="
|
||||
"sha512="
|
||||
"sha512digest="
|
||||
"rmd160="
|
||||
"rmd160digest="
|
||||
"flags="
|
||||
"nlink="
|
||||
"inode="
|
||||
"device="
|
||||
"resdevice="
|
||||
"contents="
|
||||
"optional"
|
||||
"ignore"
|
||||
"nochange"
|
||||
61
contrib/oss-fuzz/libarchive_rar5_fuzzer.cc
Normal file
61
contrib/oss-fuzz/libarchive_rar5_fuzzer.cc
Normal file
@ -0,0 +1,61 @@
|
||||
/*
|
||||
* RAR5 format specific fuzzer for libarchive
|
||||
* Targets RAR5 parsing code paths
|
||||
*/
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <vector>
|
||||
|
||||
#include "archive.h"
|
||||
#include "archive_entry.h"
|
||||
#include "fuzz_helpers.h"
|
||||
|
||||
static constexpr size_t kMaxInputSize = 512 * 1024; // 512KB
|
||||
|
||||
|
||||
|
||||
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *buf, size_t len) {
|
||||
if (len == 0 || len > kMaxInputSize) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
struct archive *a = archive_read_new();
|
||||
if (a == NULL) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Enable RAR5 format specifically
|
||||
archive_read_support_format_rar5(a);
|
||||
// Enable common filters
|
||||
archive_read_support_filter_all(a);
|
||||
|
||||
// Set passphrase for encrypted archives
|
||||
archive_read_add_passphrase(a, "password");
|
||||
|
||||
Buffer buffer = {buf, len, 0};
|
||||
if (archive_read_open(a, &buffer, NULL, reader_callback, NULL) != ARCHIVE_OK) {
|
||||
archive_read_free(a);
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::vector<uint8_t> data_buffer(4096, 0);
|
||||
struct archive_entry *entry;
|
||||
|
||||
while (archive_read_next_header(a, &entry) == ARCHIVE_OK) {
|
||||
// Exercise entry metadata access
|
||||
archive_entry_pathname(entry);
|
||||
archive_entry_pathname_w(entry);
|
||||
archive_entry_size(entry);
|
||||
archive_entry_mtime(entry);
|
||||
archive_entry_mode(entry);
|
||||
archive_entry_is_encrypted(entry);
|
||||
|
||||
// Read data
|
||||
ssize_t r;
|
||||
while ((r = archive_read_data(a, data_buffer.data(), data_buffer.size())) > 0)
|
||||
;
|
||||
}
|
||||
|
||||
archive_read_free(a);
|
||||
return 0;
|
||||
}
|
||||
37
contrib/oss-fuzz/libarchive_rar5_fuzzer.dict
Normal file
37
contrib/oss-fuzz/libarchive_rar5_fuzzer.dict
Normal file
@ -0,0 +1,37 @@
|
||||
# RAR5 format dictionary
|
||||
# Magic bytes (RAR5 signature)
|
||||
"Rar!\x1a\x07\x01\x00"
|
||||
"\x52\x61\x72\x21\x1a\x07\x01\x00"
|
||||
|
||||
# Common header types
|
||||
"\x01"
|
||||
"\x02"
|
||||
"\x03"
|
||||
"\x04"
|
||||
"\x05"
|
||||
|
||||
# Common flags
|
||||
"\x00\x00"
|
||||
"\x01\x00"
|
||||
"\x02\x00"
|
||||
"\x04\x00"
|
||||
|
||||
# Compression methods
|
||||
"\x00"
|
||||
"\x01"
|
||||
"\x02"
|
||||
"\x03"
|
||||
"\x04"
|
||||
"\x05"
|
||||
|
||||
# File attributes
|
||||
"\x20\x00\x00\x00"
|
||||
"\x10\x00\x00\x00"
|
||||
|
||||
# Encryption marker
|
||||
"\x80"
|
||||
"password"
|
||||
"Password"
|
||||
|
||||
# End of archive
|
||||
"\x1d\x77\x56\x51\x03\x05\x04\x00"
|
||||
56
contrib/oss-fuzz/libarchive_rar_fuzzer.cc
Normal file
56
contrib/oss-fuzz/libarchive_rar_fuzzer.cc
Normal file
@ -0,0 +1,56 @@
|
||||
/*
|
||||
* RAR v4 format fuzzer for libarchive
|
||||
*/
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <vector>
|
||||
|
||||
#include "archive.h"
|
||||
#include "archive_entry.h"
|
||||
#include "fuzz_helpers.h"
|
||||
|
||||
static constexpr size_t kMaxInputSize = 512 * 1024;
|
||||
|
||||
|
||||
|
||||
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *buf, size_t len) {
|
||||
if (len == 0 || len > kMaxInputSize) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
struct archive *a = archive_read_new();
|
||||
if (a == NULL) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
archive_read_support_format_rar(a);
|
||||
archive_read_support_filter_all(a);
|
||||
|
||||
// Add passphrase for encrypted RARs
|
||||
archive_read_add_passphrase(a, "password");
|
||||
|
||||
Buffer buffer = {buf, len, 0};
|
||||
if (archive_read_open(a, &buffer, NULL, reader_callback, NULL) != ARCHIVE_OK) {
|
||||
archive_read_free(a);
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::vector<uint8_t> data_buffer(4096, 0);
|
||||
struct archive_entry *entry;
|
||||
|
||||
while (archive_read_next_header(a, &entry) == ARCHIVE_OK) {
|
||||
archive_entry_pathname(entry);
|
||||
archive_entry_pathname_w(entry);
|
||||
archive_entry_size(entry);
|
||||
archive_entry_mtime(entry);
|
||||
archive_entry_mode(entry);
|
||||
archive_entry_is_encrypted(entry);
|
||||
|
||||
ssize_t r;
|
||||
while ((r = archive_read_data(a, data_buffer.data(), data_buffer.size())) > 0)
|
||||
;
|
||||
}
|
||||
|
||||
archive_read_free(a);
|
||||
return 0;
|
||||
}
|
||||
76
contrib/oss-fuzz/libarchive_read_disk_fuzzer.cc
Normal file
76
contrib/oss-fuzz/libarchive_read_disk_fuzzer.cc
Normal file
@ -0,0 +1,76 @@
|
||||
/*
|
||||
* Archive read disk fuzzer for libarchive
|
||||
* Tests filesystem traversal and entry creation from paths
|
||||
* Security-critical: path traversal, symlink handling
|
||||
*/
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <unistd.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
#include "archive.h"
|
||||
#include "archive_entry.h"
|
||||
#include "fuzz_helpers.h"
|
||||
|
||||
static constexpr size_t kMaxInputSize = 16 * 1024;
|
||||
|
||||
|
||||
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *buf, size_t len) {
|
||||
if (len == 0 || len > kMaxInputSize) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
DataConsumer consumer(buf, len);
|
||||
|
||||
struct archive *a = archive_read_disk_new();
|
||||
if (a == NULL) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Configure disk reader behavior
|
||||
uint8_t flags = consumer.consume_byte();
|
||||
if (flags & 0x01) {
|
||||
archive_read_disk_set_symlink_logical(a);
|
||||
} else if (flags & 0x02) {
|
||||
archive_read_disk_set_symlink_physical(a);
|
||||
} else {
|
||||
archive_read_disk_set_symlink_hybrid(a);
|
||||
}
|
||||
|
||||
archive_read_disk_set_standard_lookup(a);
|
||||
|
||||
// Set behavior flags
|
||||
int behavior = 0;
|
||||
if (flags & 0x04) behavior |= ARCHIVE_READDISK_RESTORE_ATIME;
|
||||
if (flags & 0x08) behavior |= ARCHIVE_READDISK_HONOR_NODUMP;
|
||||
if (flags & 0x10) behavior |= ARCHIVE_READDISK_NO_TRAVERSE_MOUNTS;
|
||||
archive_read_disk_set_behavior(a, behavior);
|
||||
|
||||
// Create an entry and test entry_from_file with various paths
|
||||
struct archive_entry *entry = archive_entry_new();
|
||||
if (entry) {
|
||||
// Test with /tmp (safe, always exists)
|
||||
archive_entry_copy_pathname(entry, "/tmp");
|
||||
archive_read_disk_entry_from_file(a, entry, -1, NULL);
|
||||
|
||||
// Get entry info
|
||||
archive_entry_pathname(entry);
|
||||
archive_entry_size(entry);
|
||||
archive_entry_mode(entry);
|
||||
archive_entry_uid(entry);
|
||||
archive_entry_gid(entry);
|
||||
|
||||
// Test name lookups
|
||||
archive_read_disk_gname(a, 0);
|
||||
archive_read_disk_uname(a, 0);
|
||||
archive_read_disk_gname(a, 1000);
|
||||
archive_read_disk_uname(a, 1000);
|
||||
|
||||
archive_entry_free(entry);
|
||||
}
|
||||
|
||||
archive_read_free(a);
|
||||
return 0;
|
||||
}
|
||||
110
contrib/oss-fuzz/libarchive_roundtrip_fuzzer.cc
Normal file
110
contrib/oss-fuzz/libarchive_roundtrip_fuzzer.cc
Normal file
@ -0,0 +1,110 @@
|
||||
/*
|
||||
* Archive roundtrip fuzzer for libarchive
|
||||
* Writes an archive then reads it back - tests write/read consistency
|
||||
*/
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <vector>
|
||||
|
||||
#include "archive.h"
|
||||
#include "archive_entry.h"
|
||||
#include "fuzz_helpers.h"
|
||||
|
||||
static constexpr size_t kMaxInputSize = 64 * 1024;
|
||||
|
||||
|
||||
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *buf, size_t len) {
|
||||
if (len < 10 || len > kMaxInputSize) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
DataConsumer consumer(buf, len);
|
||||
std::vector<uint8_t> archive_data;
|
||||
archive_data.reserve(len * 2);
|
||||
|
||||
// Phase 1: Write an archive
|
||||
struct archive *writer = archive_write_new();
|
||||
if (writer == NULL) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Select format
|
||||
uint8_t format = consumer.consume_byte() % 5;
|
||||
switch (format) {
|
||||
case 0: archive_write_set_format_pax_restricted(writer); break;
|
||||
case 1: archive_write_set_format_ustar(writer); break;
|
||||
case 2: archive_write_set_format_cpio_newc(writer); break;
|
||||
case 3: archive_write_set_format_zip(writer); break;
|
||||
default: archive_write_set_format_gnutar(writer); break;
|
||||
}
|
||||
|
||||
archive_write_add_filter_none(writer);
|
||||
|
||||
// Open to memory
|
||||
size_t used = 0;
|
||||
archive_data.resize(len * 4);
|
||||
if (archive_write_open_memory(writer, archive_data.data(), archive_data.size(), &used) != ARCHIVE_OK) {
|
||||
archive_write_free(writer);
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Write entries
|
||||
int entry_count = 0;
|
||||
while (!consumer.empty() && entry_count < 5 && consumer.remaining() > 10) {
|
||||
struct archive_entry *entry = archive_entry_new();
|
||||
if (entry == NULL) break;
|
||||
|
||||
archive_entry_set_pathname(entry, consumer.consume_string(32));
|
||||
archive_entry_set_mode(entry, S_IFREG | 0644);
|
||||
archive_entry_set_uid(entry, consumer.consume_u32() & 0xFFFF);
|
||||
archive_entry_set_gid(entry, consumer.consume_u32() & 0xFFFF);
|
||||
|
||||
uint8_t data_buf[256];
|
||||
size_t data_len = consumer.consume_bytes(data_buf, 256);
|
||||
archive_entry_set_size(entry, data_len);
|
||||
|
||||
if (archive_write_header(writer, entry) == ARCHIVE_OK && data_len > 0) {
|
||||
archive_write_data(writer, data_buf, data_len);
|
||||
}
|
||||
|
||||
archive_entry_free(entry);
|
||||
entry_count++;
|
||||
}
|
||||
|
||||
archive_write_close(writer);
|
||||
archive_write_free(writer);
|
||||
|
||||
if (used == 0) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Phase 2: Read the archive back
|
||||
struct archive *reader = archive_read_new();
|
||||
if (reader == NULL) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
archive_read_support_format_all(reader);
|
||||
archive_read_support_filter_all(reader);
|
||||
|
||||
if (archive_read_open_memory(reader, archive_data.data(), used) != ARCHIVE_OK) {
|
||||
archive_read_free(reader);
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::vector<uint8_t> read_buffer(4096, 0);
|
||||
struct archive_entry *entry;
|
||||
while (archive_read_next_header(reader, &entry) == ARCHIVE_OK) {
|
||||
archive_entry_pathname(entry);
|
||||
archive_entry_size(entry);
|
||||
|
||||
ssize_t r;
|
||||
while ((r = archive_read_data(reader, read_buffer.data(), read_buffer.size())) > 0)
|
||||
;
|
||||
}
|
||||
|
||||
archive_read_free(reader);
|
||||
return 0;
|
||||
}
|
||||
3
contrib/oss-fuzz/libarchive_roundtrip_fuzzer.options
Normal file
3
contrib/oss-fuzz/libarchive_roundtrip_fuzzer.options
Normal file
@ -0,0 +1,3 @@
|
||||
[libfuzzer]
|
||||
max_len = 65536
|
||||
timeout = 30
|
||||
125
contrib/oss-fuzz/libarchive_seek_fuzzer.cc
Normal file
125
contrib/oss-fuzz/libarchive_seek_fuzzer.cc
Normal file
@ -0,0 +1,125 @@
|
||||
/*
|
||||
* Archive seek/read fuzzer for libarchive
|
||||
* Tests seeking within archives and reading at random positions
|
||||
*/
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <vector>
|
||||
|
||||
#include "archive.h"
|
||||
#include "archive_entry.h"
|
||||
#include "fuzz_helpers.h"
|
||||
|
||||
static constexpr size_t kMaxInputSize = 256 * 1024;
|
||||
|
||||
struct SeekableBuffer {
|
||||
const uint8_t *buf;
|
||||
size_t len;
|
||||
size_t pos;
|
||||
};
|
||||
|
||||
static ssize_t seek_read_callback(struct archive *a, void *client_data,
|
||||
const void **block) {
|
||||
(void)a;
|
||||
SeekableBuffer *buffer = reinterpret_cast<SeekableBuffer *>(client_data);
|
||||
if (buffer->pos >= buffer->len) {
|
||||
*block = NULL;
|
||||
return 0;
|
||||
}
|
||||
*block = buffer->buf + buffer->pos;
|
||||
size_t avail = buffer->len - buffer->pos;
|
||||
size_t to_read = (avail > 4096) ? 4096 : avail;
|
||||
buffer->pos += to_read;
|
||||
return to_read;
|
||||
}
|
||||
|
||||
static la_int64_t seek_callback(struct archive *a, void *client_data,
|
||||
la_int64_t offset, int whence) {
|
||||
(void)a;
|
||||
SeekableBuffer *buffer = reinterpret_cast<SeekableBuffer *>(client_data);
|
||||
la_int64_t new_pos;
|
||||
|
||||
switch (whence) {
|
||||
case SEEK_SET:
|
||||
new_pos = offset;
|
||||
break;
|
||||
case SEEK_CUR:
|
||||
new_pos = static_cast<la_int64_t>(buffer->pos) + offset;
|
||||
break;
|
||||
case SEEK_END:
|
||||
new_pos = static_cast<la_int64_t>(buffer->len) + offset;
|
||||
break;
|
||||
default:
|
||||
return ARCHIVE_FATAL;
|
||||
}
|
||||
|
||||
if (new_pos < 0) new_pos = 0;
|
||||
if (new_pos > static_cast<la_int64_t>(buffer->len))
|
||||
new_pos = static_cast<la_int64_t>(buffer->len);
|
||||
|
||||
buffer->pos = static_cast<size_t>(new_pos);
|
||||
return new_pos;
|
||||
}
|
||||
|
||||
static la_int64_t skip_callback(struct archive *a, void *client_data,
|
||||
la_int64_t request) {
|
||||
(void)a;
|
||||
SeekableBuffer *buffer = reinterpret_cast<SeekableBuffer *>(client_data);
|
||||
size_t avail = buffer->len - buffer->pos;
|
||||
la_int64_t to_skip = (request > static_cast<la_int64_t>(avail))
|
||||
? static_cast<la_int64_t>(avail)
|
||||
: request;
|
||||
buffer->pos += static_cast<size_t>(to_skip);
|
||||
return to_skip;
|
||||
}
|
||||
|
||||
extern "C" int LLVMFuzzerTestOneInput(const uint8_t *buf, size_t len) {
|
||||
if (len == 0 || len > kMaxInputSize) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
struct archive *a = archive_read_new();
|
||||
if (a == NULL) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
// Enable formats that benefit from seeking
|
||||
archive_read_support_format_zip_seekable(a);
|
||||
archive_read_support_format_7zip(a);
|
||||
archive_read_support_format_rar(a);
|
||||
archive_read_support_format_rar5(a);
|
||||
archive_read_support_format_iso9660(a);
|
||||
archive_read_support_filter_all(a);
|
||||
|
||||
SeekableBuffer buffer = {buf, len, 0};
|
||||
|
||||
archive_read_set_read_callback(a, seek_read_callback);
|
||||
archive_read_set_seek_callback(a, seek_callback);
|
||||
archive_read_set_skip_callback(a, skip_callback);
|
||||
archive_read_set_callback_data(a, &buffer);
|
||||
|
||||
if (archive_read_open1(a) != ARCHIVE_OK) {
|
||||
archive_read_free(a);
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::vector<uint8_t> data_buffer(4096, 0);
|
||||
struct archive_entry *entry;
|
||||
int entry_count = 0;
|
||||
|
||||
while (archive_read_next_header(a, &entry) == ARCHIVE_OK && entry_count < 50) {
|
||||
archive_entry_pathname(entry);
|
||||
archive_entry_size(entry);
|
||||
|
||||
// Read data which may trigger seeks
|
||||
ssize_t r;
|
||||
while ((r = archive_read_data(a, data_buffer.data(), data_buffer.size())) > 0)
|
||||
;
|
||||
|
||||
entry_count++;
|
||||
}
|
||||
|
||||
archive_read_free(a);
|
||||
return 0;
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user