Skip to content

Commit 38050d6

Browse files
authored
Merge branch 'libarchive:master' into rar-encryption
2 parents 81717b5 + 3fdf9bf commit 38050d6

File tree

113 files changed

+3678
-1445
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

113 files changed

+3678
-1445
lines changed

Diff for: .cirrus.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ FreeBSD_task:
1212
freebsd_instance:
1313
image_family: freebsd-14-0
1414
freebsd_instance:
15-
image_family: freebsd-13-2
15+
image_family: freebsd-13-3
1616
prepare_script:
1717
- ./build/ci/cirrus_ci/ci.sh prepare
1818
configure_script:

Diff for: .github/dependabot.yml

+2
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ updates:
99
directory: "/"
1010
schedule:
1111
interval: "weekly"
12+
commit-message:
13+
prefix: "CI"
1214
groups:
1315
all-actions:
1416
patterns:

Diff for: .github/workflows/ci.yml

+8-8
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
matrix:
1313
bs: [autotools, cmake]
1414
steps:
15-
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
15+
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
1616
- name: Install dependencies
1717
run: ./build/ci/github_actions/macos.sh prepare
1818
- name: Autogen
@@ -45,7 +45,7 @@ jobs:
4545
run: ./build/ci/build.sh -a artifact
4646
env:
4747
BS: ${{ matrix.bs }}
48-
- uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
48+
- uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
4949
with:
5050
name: libarchive-macos-${{ matrix.bs }}-${{ github.sha }}
5151
path: libarchive.tar.xz
@@ -57,7 +57,7 @@ jobs:
5757
bs: [autotools, cmake]
5858
crypto: [mbedtls, nettle, openssl]
5959
steps:
60-
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
60+
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
6161
- name: Update apt cache
6262
run: sudo apt-get update
6363
- name: Install dependencies
@@ -91,14 +91,14 @@ jobs:
9191
run: ./build/ci/build.sh -a artifact
9292
env:
9393
BS: ${{ matrix.bs }}
94-
- uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
94+
- uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
9595
with:
9696
name: libarchive-ubuntu-${{ matrix.bs }}-${{ matrix.crypto }}-${{ github.sha }}
9797
path: libarchive.tar.xz
9898
Ubuntu-distcheck:
9999
runs-on: ubuntu-22.04
100100
steps:
101-
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
101+
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
102102
- name: Update package definitions
103103
run: sudo apt-get update
104104
- name: Install dependencies
@@ -113,7 +113,7 @@ jobs:
113113
SKIP_OPEN_FD_ERR_TEST: 1
114114
- name: Dist-Artifact
115115
run: ./build/ci/build.sh -a dist-artifact
116-
- uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
116+
- uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
117117
with:
118118
name: libarchive-${{ github.sha }}
119119
path: libarchive-dist.tar
@@ -125,7 +125,7 @@ jobs:
125125
matrix:
126126
be: [mingw-gcc, msvc]
127127
steps:
128-
- uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
128+
- uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
129129
- name: Install mingw
130130
if: ${{ matrix.be=='mingw-gcc' }}
131131
run: choco install mingw
@@ -161,7 +161,7 @@ jobs:
161161
shell: cmd
162162
env:
163163
BE: ${{ matrix.be }}
164-
- uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
164+
- uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
165165
with:
166166
name: libarchive-windows-${{ matrix.be }}-${{ github.sha }}
167167
path: libarchive.zip

Diff for: .github/workflows/cifuzz.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ jobs:
2121
fuzz-seconds: 600
2222
dry-run: false
2323
- name: Upload Crash
24-
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
24+
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
2525
if: failure() && steps.build.outcome == 'success'
2626
with:
2727
name: artifacts

Diff for: .github/workflows/codeql.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -26,18 +26,18 @@ jobs:
2626

2727
steps:
2828
- name: Checkout
29-
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
29+
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
3030

3131
- name: Initialize CodeQL
32-
uses: github/codeql-action/init@05963f47d870e2cb19a537396c1f668a348c7d8f # v3.24.8
32+
uses: github/codeql-action/init@9fdb3e49720b44c48891d036bb502feb25684276 # v3.25.6
3333
with:
3434
languages: ${{ matrix.language }}
3535
queries: +security-and-quality
3636

3737
- name: Autobuild
38-
uses: github/codeql-action/autobuild@05963f47d870e2cb19a537396c1f668a348c7d8f # v3.24.8
38+
uses: github/codeql-action/autobuild@9fdb3e49720b44c48891d036bb502feb25684276 # v3.25.6
3939

4040
- name: Perform CodeQL Analysis
41-
uses: github/codeql-action/analyze@05963f47d870e2cb19a537396c1f668a348c7d8f # v3.24.8
41+
uses: github/codeql-action/analyze@9fdb3e49720b44c48891d036bb502feb25684276 # v3.25.6
4242
with:
4343
category: "/language:${{ matrix.language }}"

Diff for: .github/workflows/scorecard.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ jobs:
2929

3030
steps:
3131
- name: "Checkout code"
32-
uses: actions/checkout@9bb56186c3b09b4f86b1c65136769dd318469633 # v4.1.2
32+
uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 # v4.1.6
3333
with:
3434
persist-credentials: false
3535

3636
- name: "Run analysis"
37-
uses: ossf/scorecard-action@0864cf19026789058feabb7e87baa5f140aac736 # v2.3.1
37+
uses: ossf/scorecard-action@dc50aa9510b46c811795eb24b2f1ba02a914e534 # v2.3.3
3838
with:
3939
results_file: results.sarif
4040
results_format: sarif
@@ -52,14 +52,14 @@ jobs:
5252
# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
5353
# format to the repository Actions tab.
5454
- name: "Upload artifact"
55-
uses: actions/upload-artifact@5d5d22a31266ced268874388b861e4b58bb5c2f3 # v4.3.1
55+
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
5656
with:
5757
name: SARIF file
5858
path: results.sarif
5959
retention-days: 5
6060

6161
# Upload the results to GitHub's code scanning dashboard.
6262
- name: "Upload to code-scanning"
63-
uses: github/codeql-action/upload-sarif@05963f47d870e2cb19a537396c1f668a348c7d8f # v3.24.8
63+
uses: github/codeql-action/upload-sarif@9fdb3e49720b44c48891d036bb502feb25684276 # v3.25.6
6464
with:
6565
sarif_file: results.sarif

Diff for: .gitignore

+17
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,23 @@
11
*~
22
*.o
3+
*.obj
34
*.exe
5+
*.exp
6+
*.ilk
47
*.la
8+
*.lib
59
*.lo
10+
*.recipe
11+
*.sln
12+
*.tlog
613
*.cmake
14+
*.vcxproj
15+
*.vcxproj.filters
716
!build/cmake/*.cmake
817
.deps/
918
.libs/
1019
bin/
20+
out/
1121
.dirstamp
1222
Makefile
1323
Makefile.in
@@ -29,7 +39,13 @@ build/autoconf/ltsugar.m4
2939
build/autoconf/ltversion.m4
3040
build/autoconf/lt~obsolete.m4
3141
build/autoconf/missing
42+
build/build/pkgconfig/libarchive.pc
43+
build/cat/test/list.h
44+
build/cpio/test/list.h
45+
build/libarchive/test/list.h
3246
build/pkgconfig/libarchive.pc
47+
build/tar/test/list.h
48+
build/unzip/test/list.h
3349
cat/test/list.h
3450
config.cache
3551
config.h
@@ -47,6 +63,7 @@ CMakeCache.txt
4763
CMakeFiles/
4864
DartConfiguration.tcl
4965
cmake.tmp/
66+
.vs/
5067
.vscode/
5168

5269
doc/html/*.html

Diff for: CMakeLists.txt

+16-9
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,15 @@ IF("${cached_type}" STREQUAL "UNINITIALIZED")
3434
SET(CMAKE_BUILD_TYPE "${CMAKE_BUILD_TYPE}" CACHE STRING "Build Type" FORCE)
3535
ENDIF("${cached_type}" STREQUAL "UNINITIALIZED")
3636
# Check the Build Type.
37-
IF(NOT "${CMAKE_BUILD_TYPE}"
38-
MATCHES "^(Debug|Release|RelWithDebInfo|MinSizeRel|None)\$")
37+
# Convert the CMAKE_BUILD_TYPE to uppercase to perform a case-insensitive comparison.
38+
string(TOUPPER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE_UPPER)
39+
IF(NOT "${CMAKE_BUILD_TYPE_UPPER}"
40+
MATCHES "^(DEBUG|RELEASE|RELWITHDEBINFO|MINSIZEREL|NONE)\$")
3941
MESSAGE(FATAL_ERROR
4042
"Unknown keyword for CMAKE_BUILD_TYPE: ${CMAKE_BUILD_TYPE}\n"
41-
"Acceptable keywords: Debug,Release,RelWithDebInfo,MinSizeRel,None")
42-
ENDIF(NOT "${CMAKE_BUILD_TYPE}"
43-
MATCHES "^(Debug|Release|RelWithDebInfo|MinSizeRel|None)\$")
43+
"Acceptable keywords: Debug, Release, RelWithDebInfo, MinSizeRel, None")
44+
ENDIF(NOT "${CMAKE_BUILD_TYPE_UPPER}"
45+
MATCHES "^(DEBUG|RELEASE|RELWITHDEBINFO|MINSIZEREL|NONE)\$")
4446

4547
# On MacOS, prefer MacPorts libraries to system libraries.
4648
# I haven't come up with a compelling argument for this to be conditional.
@@ -105,7 +107,7 @@ endif ()
105107
# aggressive about diagnosing build problems; this can get
106108
# relaxed somewhat in final shipping versions.
107109
IF (CMAKE_C_COMPILER_ID MATCHES "^GNU$" OR
108-
CMAKE_C_COMPILER_ID MATCHES "^Clang$")
110+
CMAKE_C_COMPILER_ID MATCHES "^Clang$" AND NOT MSVC)
109111
SET(CMAKE_REQUIRED_FLAGS "-Wall -Wformat -Wformat-security")
110112
#################################################################
111113
# Set compile flags for all build types.
@@ -142,7 +144,7 @@ IF (CMAKE_C_COMPILER_ID MATCHES "^GNU$" OR
142144
SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-dead_strip")
143145
ENDIF(NOT CMAKE_SYSTEM_NAME MATCHES "Darwin")
144146
ENDIF (CMAKE_C_COMPILER_ID MATCHES "^GNU$" OR
145-
CMAKE_C_COMPILER_ID MATCHES "^Clang$")
147+
CMAKE_C_COMPILER_ID MATCHES "^Clang$" AND NOT MSVC)
146148
IF (CMAKE_C_COMPILER_ID MATCHES "^XL$")
147149
SET(CMAKE_C_COMPILER "xlc_r")
148150
SET(CMAKE_REQUIRED_FLAGS "-qflag=e:e -qformat=sec")
@@ -660,7 +662,7 @@ IF(ZSTD_FOUND)
660662
SET(CMAKE_REQUIRED_LIBRARIES ${ZSTD_LIBRARY})
661663
SET(CMAKE_REQUIRED_INCLUDES ${ZSTD_INCLUDE_DIR})
662664
CHECK_FUNCTION_EXISTS(ZSTD_decompressStream HAVE_LIBZSTD)
663-
CHECK_FUNCTION_EXISTS(ZSTD_compressStream HAVE_LIBZSTD_COMPRESSOR)
665+
CHECK_FUNCTION_EXISTS(ZSTD_compressStream HAVE_ZSTD_compressStream)
664666
#
665667
# TODO: test for static library.
666668
#
@@ -741,7 +743,6 @@ LA_CHECK_INCLUDE_FILE("sys/mkdev.h" HAVE_SYS_MKDEV_H)
741743
LA_CHECK_INCLUDE_FILE("sys/mount.h" HAVE_SYS_MOUNT_H)
742744
LA_CHECK_INCLUDE_FILE("sys/param.h" HAVE_SYS_PARAM_H)
743745
LA_CHECK_INCLUDE_FILE("sys/poll.h" HAVE_SYS_POLL_H)
744-
LA_CHECK_INCLUDE_FILE("sys/queue.h" HAVE_SYS_QUEUE_H)
745746
LA_CHECK_INCLUDE_FILE("sys/richacl.h" HAVE_SYS_RICHACL_H)
746747
LA_CHECK_INCLUDE_FILE("sys/select.h" HAVE_SYS_SELECT_H)
747748
LA_CHECK_INCLUDE_FILE("sys/stat.h" HAVE_SYS_STAT_H)
@@ -1495,6 +1496,7 @@ CHECK_FUNCTION_EXISTS_GLIBC(strncpy_s HAVE_STRNCPY_S)
14951496
CHECK_FUNCTION_EXISTS_GLIBC(strnlen HAVE_STRNLEN)
14961497
CHECK_FUNCTION_EXISTS_GLIBC(strrchr HAVE_STRRCHR)
14971498
CHECK_FUNCTION_EXISTS_GLIBC(symlink HAVE_SYMLINK)
1499+
CHECK_FUNCTION_EXISTS_GLIBC(sysconf HAVE_SYSCONF)
14981500
CHECK_FUNCTION_EXISTS_GLIBC(timegm HAVE_TIMEGM)
14991501
CHECK_FUNCTION_EXISTS_GLIBC(tzset HAVE_TZSET)
15001502
CHECK_FUNCTION_EXISTS_GLIBC(unlinkat HAVE_UNLINKAT)
@@ -2171,6 +2173,11 @@ IF(APPLE)
21712173
ADD_DEFINITIONS(-Wno-deprecated-declarations)
21722174
ENDIF(APPLE)
21732175

2176+
OPTION(DONT_FAIL_ON_CRC_ERROR "Ignore CRC errors during parsing (For fuzzing)" OFF)
2177+
IF(DONT_FAIL_ON_CRC_ERROR)
2178+
ADD_DEFINITIONS(-DDONT_FAIL_ON_CRC_ERROR=1)
2179+
ENDIF(DONT_FAIL_ON_CRC_ERROR)
2180+
21742181
IF(ENABLE_TEST)
21752182
ADD_CUSTOM_TARGET(run_all_tests)
21762183
ENDIF(ENABLE_TEST)

Diff for: Makefile.am

+9
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,7 @@ libarchive_test_SOURCES= \
380380
libarchive/test/test_archive_match_path.c \
381381
libarchive/test/test_archive_match_time.c \
382382
libarchive/test/test_archive_pathmatch.c \
383+
libarchive/test/test_archive_read.c \
383384
libarchive/test/test_archive_read_add_passphrase.c \
384385
libarchive/test/test_archive_read_close_twice.c \
385386
libarchive/test/test_archive_read_close_twice_open_fd.c \
@@ -486,6 +487,7 @@ libarchive_test_SOURCES= \
486487
libarchive/test/test_read_format_gtar_lzma.c \
487488
libarchive/test/test_read_format_gtar_sparse.c \
488489
libarchive/test/test_read_format_gtar_sparse_skip_entry.c \
490+
libarchive/test/test_read_format_huge_rpm.c \
489491
libarchive/test/test_read_format_iso_Z.c \
490492
libarchive/test/test_read_format_iso_multi_extent.c \
491493
libarchive/test/test_read_format_iso_xorriso.c \
@@ -521,6 +523,7 @@ libarchive_test_SOURCES= \
521523
libarchive/test/test_read_format_tar_empty_with_gnulabel.c \
522524
libarchive/test/test_read_format_tar_filename.c \
523525
libarchive/test/test_read_format_tar_invalid_pax_size.c \
526+
libarchive/test/test_read_format_tar_pax_large_attr.c \
524527
libarchive/test/test_read_format_tbz.c \
525528
libarchive/test/test_read_format_tgz.c \
526529
libarchive/test/test_read_format_tlz.c \
@@ -529,6 +532,7 @@ libarchive_test_SOURCES= \
529532
libarchive/test/test_read_format_ustar_filename.c \
530533
libarchive/test/test_read_format_warc.c \
531534
libarchive/test/test_read_format_xar.c \
535+
libarchive/test/test_read_format_xar_doublelink.c \
532536
libarchive/test/test_read_format_zip.c \
533537
libarchive/test/test_read_format_zip_7075_utf8_paths.c \
534538
libarchive/test/test_read_format_zip_comment_stored.c \
@@ -827,8 +831,10 @@ libarchive_test_EXTRA_DIST=\
827831
libarchive/test/test_read_format_gtar_sparse_1_17_posix10.tar.uu \
828832
libarchive/test/test_read_format_gtar_sparse_1_17_posix10_modified.tar.uu \
829833
libarchive/test/test_read_format_gtar_sparse_skip_entry.tar.Z.uu \
834+
libarchive/test/test_read_format_huge_rpm.rpm.uu \
830835
libarchive/test/test_read_format_iso.iso.Z.uu \
831836
libarchive/test/test_read_format_iso_2.iso.Z.uu \
837+
libarchive/test/test_read_format_iso_3.iso.Z.uu \
832838
libarchive/test/test_read_format_iso_joliet.iso.Z.uu \
833839
libarchive/test/test_read_format_iso_joliet_by_nero.iso.Z.uu \
834840
libarchive/test/test_read_format_iso_joliet_long.iso.Z.uu \
@@ -937,10 +943,13 @@ libarchive_test_EXTRA_DIST=\
937943
libarchive/test/test_read_format_tar_empty_pax.tar.Z.uu \
938944
libarchive/test/test_read_format_tar_filename_koi8r.tar.Z.uu \
939945
libarchive/test/test_read_format_tar_invalid_pax_size.tar.uu \
946+
libarchive/test/test_read_format_tar_pax_large_attr.tar.Z.uu \
940947
libarchive/test/test_read_format_ustar_filename_cp866.tar.Z.uu \
941948
libarchive/test/test_read_format_ustar_filename_eucjp.tar.Z.uu \
942949
libarchive/test/test_read_format_ustar_filename_koi8r.tar.Z.uu \
943950
libarchive/test/test_read_format_warc.warc.uu \
951+
libarchive/test/test_read_format_xar_doublelink.xar.uu \
952+
libarchive/test/test_read_format_xar_duplicate_filename_node.xar.uu \
944953
libarchive/test/test_read_format_zip.zip.uu \
945954
libarchive/test/test_read_format_zip_7075_utf8_paths.zip.uu \
946955
libarchive/test/test_read_format_zip_7z_deflate.zip.uu \

Diff for: NEWS

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
Apr 26, 2024: libarchive 3.7.4 released
2+
3+
Apr 08, 2024: libarchive 3.7.3 released
4+
15
Sep 12, 2023: libarchive 3.7.2 released
26

37
Jul 29, 2023: libarchive 3.7.1 released

Diff for: README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ questions we are asked about libarchive:
201201
In case other thread calls the same function in parallel, it might
202202
get interrupted by it and cause the executable to use umask=0 for the
203203
remaining execution.
204-
This will then lead to implicitely created directories to have 777
204+
This will then lead to implicitly created directories to have 777
205205
permissions without sticky bit.
206206

207207
* In particular, libarchive's modules to read or write a directory

Diff for: build/ci/github_actions/macos.sh

+1
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ then
1818
xz \
1919
lz4 \
2020
zstd \
21+
libxml2 \
2122
openssl
2223
do
2324
brew list $pkg > /dev/null && brew upgrade $pkg || brew install $pkg

Diff for: build/cmake/config.h.in

+5-6
Original file line numberDiff line numberDiff line change
@@ -774,9 +774,8 @@ typedef uint64_t uintmax_t;
774774
/* Define to 1 if you have the `zstd' library (-lzstd). */
775775
#cmakedefine HAVE_LIBZSTD 1
776776

777-
/* Define to 1 if you have the `zstd' library (-lzstd) with compression
778-
support. */
779-
#cmakedefine HAVE_LIBZSTD_COMPRESSOR 1
777+
/* Define to 1 if you have the ZSTD_compressStream function. */
778+
#cmakedefine HAVE_ZSTD_compressStream 1
780779

781780
/* Define to 1 if you have the <limits.h> header file. */
782781
#cmakedefine HAVE_LIMITS_H 1
@@ -1095,6 +1094,9 @@ typedef uint64_t uintmax_t;
10951094
/* Define to 1 if you have the `symlink' function. */
10961095
#cmakedefine HAVE_SYMLINK 1
10971096

1097+
/* Define to 1 if you have the `sysconf' function. */
1098+
#cmakedefine HAVE_SYSCONF 1
1099+
10981100
/* Define to 1 if you have the <sys/acl.h> header file. */
10991101
#cmakedefine HAVE_SYS_ACL_H 1
11001102

@@ -1130,9 +1132,6 @@ typedef uint64_t uintmax_t;
11301132
/* Define to 1 if you have the <sys/poll.h> header file. */
11311133
#cmakedefine HAVE_SYS_POLL_H 1
11321134

1133-
/* Define to 1 if you have the <sys/queue.h> header file. */
1134-
#cmakedefine HAVE_SYS_QUEUE_H 1
1135-
11361135
/* Define to 1 if you have the <sys/richacl.h> header file. */
11371136
#cmakedefine HAVE_SYS_RICHACL_H 1
11381137

Diff for: build/version

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3007003
1+
3007005

0 commit comments

Comments
 (0)