Skip to content

Commit 4a46f49

Browse files
committed
Updated libzip to 1.9.2
1 parent bbaaa6c commit 4a46f49

File tree

370 files changed

+9665
-7092
lines changed

Some content is hidden

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

370 files changed

+9665
-7092
lines changed

.clang-format

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ BreakBeforeBraces: Custom
88
BraceWrapping:
99
BeforeElse: true
1010
AlignEscapedNewlines: Left
11-
UseTab: ForContinuationAndIndentation
11+
UseTab: Never
1212
#PPDirectiveIndentStyle: AfterHash

CMakeLists.txt

+31-29
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ if (${CMAKE_VERSION} VERSION_LESS "3.17.0")
66
endif()
77

88
project(libzip
9-
VERSION 1.7.3
9+
VERSION 1.9.2
1010
LANGUAGES C)
1111

1212
option(ENABLE_COMMONCRYPTO "Enable use of CommonCrypto" ON)
@@ -17,6 +17,7 @@ option(ENABLE_WINDOWS_CRYPTO "Enable use of Windows cryptography libraries" ON)
1717

1818
option(ENABLE_BZIP2 "Enable use of BZip2" ON)
1919
option(ENABLE_LZMA "Enable use of LZMA" ON)
20+
option(ENABLE_ZSTD "Enable use of Zstandard" ON)
2021

2122
option(BUILD_TOOLS "Build tools in the src directory (zipcmp, zipmerge, ziptool)" ON)
2223
option(BUILD_REGRESS "Build regression tests" ON)
@@ -33,33 +34,24 @@ include(CheckCSourceCompiles)
3334
include(CheckStructHasMember)
3435
include(TestBigEndian)
3536
include(GNUInstallDirs)
37+
3638
if(ENABLE_COMMONCRYPTO)
3739
check_include_files(CommonCrypto/CommonCrypto.h COMMONCRYPTO_FOUND)
38-
else()
39-
set(COMMONCRYPTO_FOUND FALSE)
4040
endif()
4141
if(ENABLE_GNUTLS)
4242
find_package(Nettle 3.0)
4343
find_package(GnuTLS)
44-
else()
45-
set(GNUTLS_FOUND FALSE)
4644
endif()
4745
if(ENABLE_MBEDTLS)
4846
find_package(MbedTLS 1.0)
49-
else()
50-
set(MBEDTLS_LIBRARIES FALSE)
5147
endif()
5248
if(ENABLE_OPENSSL)
5349
find_package(OpenSSL)
54-
else()
55-
set(OPENSSL_FOUND FALSE)
5650
endif()
5751
if(WIN32)
5852
if(ENABLE_WINDOWS_CRYPTO)
5953
set(WINDOWS_CRYPTO_FOUND TRUE)
6054
endif()
61-
else()
62-
set(WINDOWS_CRYPTO_FOUND FALSE)
6355
endif()
6456

6557
option(BUILD_SHARED_LIBS "Build shared libraries" ON)
@@ -100,24 +92,25 @@ check_function_exists(_dup HAVE__DUP)
10092
check_function_exists(_fdopen HAVE__FDOPEN)
10193
check_function_exists(_fileno HAVE__FILENO)
10294
check_function_exists(_setmode HAVE__SETMODE)
103-
check_function_exists(_snprintf HAVE__SNPRINTF)
95+
check_symbol_exists(_snprintf stdio.h HAVE__SNPRINTF)
10496
check_function_exists(_strdup HAVE__STRDUP)
105-
check_function_exists(_stricmp HAVE__STRICMP)
97+
check_symbol_exists(_stricmp string.h HAVE__STRICMP)
10698
check_function_exists(_strtoi64 HAVE__STRTOI64)
10799
check_function_exists(_strtoui64 HAVE__STRTOUI64)
108100
check_function_exists(_unlink HAVE__UNLINK)
109101
check_function_exists(arc4random HAVE_ARC4RANDOM)
110102
check_function_exists(clonefile HAVE_CLONEFILE)
111103
check_function_exists(explicit_bzero HAVE_EXPLICIT_BZERO)
112104
check_function_exists(explicit_memset HAVE_EXPLICIT_MEMSET)
105+
check_function_exists(fchmod HAVE_FCHMOD)
113106
check_function_exists(fileno HAVE_FILENO)
114107
check_function_exists(fseeko HAVE_FSEEKO)
115108
check_function_exists(ftello HAVE_FTELLO)
116109
check_function_exists(getprogname HAVE_GETPROGNAME)
117110
check_function_exists(localtime_r HAVE_LOCALTIME_R)
118111
check_function_exists(setmode HAVE_SETMODE)
119-
check_function_exists(snprintf HAVE_SNPRINTF)
120-
check_function_exists(strcasecmp HAVE_STRCASECMP)
112+
check_symbol_exists(snprintf stdio.h HAVE_SNPRINTF)
113+
check_symbol_exists(strcasecmp strings.h HAVE_STRCASECMP)
121114
check_function_exists(strdup HAVE_STRDUP)
122115
check_function_exists(stricmp HAVE_STRICMP)
123116
check_function_exists(strtoll HAVE_STRTOLL)
@@ -199,10 +192,18 @@ if(ENABLE_LZMA)
199192
if(LIBLZMA_FOUND)
200193
set(HAVE_LIBLZMA 1)
201194
else()
202-
message(WARNING "-- lzma library not found; lzma support disabled")
195+
message(WARNING "-- lzma library not found; lzma/xz support disabled")
203196
endif(LIBLZMA_FOUND)
204197
endif(ENABLE_LZMA)
205198

199+
if(ENABLE_ZSTD)
200+
find_package(Zstd 1.3.6)
201+
if(Zstd_FOUND)
202+
set(HAVE_LIBZSTD 1)
203+
else()
204+
message(WARNING "-- zstd library not found; zstandard support disabled")
205+
endif(Zstd_FOUND)
206+
endif(ENABLE_ZSTD)
206207

207208
if (COMMONCRYPTO_FOUND)
208209
set(HAVE_CRYPTO 1)
@@ -221,7 +222,7 @@ elseif (MBEDTLS_FOUND)
221222
set(HAVE_MBEDTLS 1)
222223
endif()
223224

224-
if (NOT HAVE_CRYPTO)
225+
if ((ENABLE_COMMONCRYPTO OR ENABLE_GNUTLS OR ENABLE_MBEDTLS OR ENABLE_OPENSSL OR ENABLE_WINDOWS_CRYPTO) AND NOT HAVE_CRYPTO)
225226
message(WARNING "-- neither Common Crypto, GnuTLS, mbed TLS, OpenSSL, nor Windows Cryptography found; AES support disabled")
226227
endif()
227228

@@ -266,7 +267,7 @@ endif()
266267

267268
include(FindPerl)
268269

269-
if(NOT PERL_FOUND)
270+
if(BUILD_REGRESS AND NOT PERL_FOUND)
270271
message(WARNING "-- perl not found, regression testing disabled")
271272
set(BUILD_REGRESS OFF)
272273
endif()
@@ -281,11 +282,12 @@ endif()
281282

282283

283284
# pkgconfig file
284-
set(prefix ${CMAKE_INSTALL_PREFIX})
285-
set(exec_prefix \${prefix})
286-
SET(bindir \${exec_prefix}/${CMAKE_INSTALL_BINDIR})
287-
SET(libdir \${exec_prefix}/${CMAKE_INSTALL_LIBDIR})
288-
SET(includedir \${prefix}/${CMAKE_INSTALL_INCLUDEDIR})
285+
file(RELATIVE_PATH pc_relative_bindir ${CMAKE_INSTALL_PREFIX} ${CMAKE_INSTALL_FULL_BINDIR})
286+
set(bindir "\${prefix}/${pc_relative_bindir}")
287+
file(RELATIVE_PATH pc_relative_libdir ${CMAKE_INSTALL_PREFIX} ${CMAKE_INSTALL_FULL_LIBDIR})
288+
set(libdir "\${prefix}/${pc_relative_libdir}")
289+
file(RELATIVE_PATH pc_relative_includedir ${CMAKE_INSTALL_PREFIX} ${CMAKE_INSTALL_FULL_INCLUDEDIR})
290+
set(includedir "\${prefix}/${pc_relative_includedir}")
289291
if(CMAKE_SYSTEM_NAME MATCHES BSD)
290292
set(PKG_CONFIG_RPATH "-Wl,-R\${libdir}")
291293
endif(CMAKE_SYSTEM_NAME MATCHES BSD)
@@ -299,6 +301,7 @@ foreach(LIB ${LIBS_PRIVATE})
299301
endforeach()
300302
string(REGEX REPLACE "-lBZip2::BZip2" "-lbz2" LIBS ${LIBS})
301303
string(REGEX REPLACE "-lLibLZMA::LibLZMA" "-llzma" LIBS ${LIBS})
304+
string(REGEX REPLACE "-lZstd::Zstd" "-lzstd" LIBS ${LIBS})
302305
string(REGEX REPLACE "-lOpenSSL::Crypto" "-lssl -lcrypto" LIBS ${LIBS})
303306
string(REGEX REPLACE "-lZLIB::ZLIB" "-lz" LIBS ${LIBS})
304307
string(REGEX REPLACE "-lGnuTLS::GnuTLS" "-lgnutls" LIBS ${LIBS})
@@ -429,12 +432,12 @@ write_basic_package_version_file("${PROJECT_BINARY_DIR}/${PROJECT_NAME}-config-v
429432
configure_package_config_file("${PROJECT_NAME}-config.cmake.in" "${PROJECT_BINARY_DIR}/${PROJECT_NAME}-config.cmake"
430433
INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/libzip)
431434

432-
# Add targets to the build-tree export set
433-
export(TARGETS zip
434-
FILE "${PROJECT_BINARY_DIR}/${PROJECT_NAME}-targets.cmake")
435-
436-
# installation
437435
if(LIBZIP_DO_INSTALL)
436+
# Add targets to the build-tree export set
437+
export(TARGETS zip
438+
FILE "${PROJECT_BINARY_DIR}/${PROJECT_NAME}-targets.cmake")
439+
440+
# installation
438441
install(FILES ${PROJECT_BINARY_DIR}/zipconf.h DESTINATION include)
439442
install(FILES ${PROJECT_BINARY_DIR}/${PROJECT_NAME}-config.cmake ${PROJECT_BINARY_DIR}/${PROJECT_NAME}-config-version.cmake
440443
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}
@@ -443,4 +446,3 @@ if(LIBZIP_DO_INSTALL)
443446
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}
444447
)
445448
endif()
446-

INSTALL.md

+5-2
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,12 @@ comes with most operating systems.
88
For supporting bzip2-compressed zip archives, you need
99
[bzip2](http://bzip.org/).
1010

11-
For supporting xz-compressed zip archives, you need
11+
For supporting lzma- and xz-compressed zip archives, you need
1212
[liblzma](https://tukaani.org/xz/) which is part of xz, at least version 5.2.
1313

14+
For supporting zstd-compressed zip archives, you need
15+
[zstd](https://github.com/facebook/zstd/).
16+
1417
For AES (encryption) support, you need one of these cryptographic libraries,
1518
listed in order of preference:
1619

@@ -63,4 +66,4 @@ will break in `zipcmp`.
6366
You can get verbose build output with by passing `VERBOSE=1` to
6467
`make`.
6568

66-
You can also check the [cmake FAQ](https://cmake.org/Wiki/CMake_FAQ).
69+
You can also check the [cmake FAQ](https://gitlab.kitware.com/cmake/community/-/wikis/FAQ).

ImageMagick/ImageMagick.version.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
#define DELEGATE_VERSION_NUM 1,7,3
2-
#define DELEGATE_VERSION_STRING "1.7.3 (2020-07-15)"
1+
#define DELEGATE_VERSION_NUM 1,9,2
2+
#define DELEGATE_VERSION_STRING "1.9.2 (2022-06-28)"

LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Copyright (C) 1999-2020 Dieter Baron and Thomas Klausner
22

3-
The authors can be contacted at <[email protected]>
3+
The authors can be contacted at <[email protected]>
44

55
Redistribution and use in source and binary forms, with or without
66
modification, are permitted provided that the following conditions

NEWS.md

+32
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,35 @@
1+
1.9.2 [2022-06-28]
2+
3+
* Fix version number in header file.
4+
5+
1.9.1 [2022-06-28]
6+
===================
7+
8+
* Fix `zip_file_is_seekable()`.
9+
10+
1.9.0 [2022-06-13]
11+
==================
12+
13+
* Add `zip_file_is_seekable()`.
14+
* Improve compatibility with WinAES.
15+
* Fix encoding handling in `zip_name_locate()`.
16+
* Add option to `zipcmp` to output summary of changes.
17+
* Various bug fixes and documentation improvements.
18+
19+
1.8.0 [2021-06-18]
20+
==================
21+
22+
* Add support for zstd (Zstandard) compression.
23+
* Add support for lzma (ID 14) compression.
24+
* Add `zip_source_window_create()`.
25+
* Add `zip_source_zip_create()` variant to `zip_source_zip()`.
26+
* Allow method specific `comp_flags` in `zip_set_file_compression()`.
27+
* Allow `zip_source_tell()` on sources that don't support seeking and `zip_ftell()` on compressed data.
28+
* Provide more details for consistency check errors.
29+
* Improve output of `zipcmp`.
30+
* In `zipcmp`, don’t ignore empty directories when comparing directory listing.
31+
* Treat empty string as no password given in `zip_file_set_encryption()`, `zip_fopen_encrypted()`, and `zip_set_default_password()`.
32+
133
1.7.3 [2020-07-15]
234
==================
335

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ subscribe to it by sending a mail with the subject "subscribe
3232
libzip-discuss" to minimalist at nih.at. List mail should be sent
3333
to libzip-discuss at nih.at. Use this for bug reports or questions.
3434

35-
If you want to reach the authors in private, use <[email protected]>.
35+
If you want to reach the authors in private, use <[email protected]>.
3636

37-
[![Travis Build Status](https://api.travis-ci.org/nih-at/libzip.svg?branch=master)](https://travis-ci.org/nih-at/libzip)
37+
[![Github Actions Build Status](https://github.com/nih-at/libzip/workflows/build/badge.svg)](https://github.com/nih-at/libzip/actions?query=workflow%3Abuild)
3838
[![Appveyor Build status](https://ci.appveyor.com/api/projects/status/f1bqqt9djvf22f5g?svg=true)](https://ci.appveyor.com/project/nih-at/libzip)
3939
[![Coverity Status](https://scan.coverity.com/projects/127/badge.svg)](https://scan.coverity.com/projects/libzip)

SECURITY.md

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Security Policy
2+
3+
## Supported Versions
4+
5+
We are not maintaining multiple branches, so all fixes will be committed to head and included in the next release.
6+
7+
We take great care to maintain backwards compatibility, so we expect our users to use the latest version.
8+
9+
## Reporting a Vulnerability
10+
11+
You can reach us per email at [email protected].
12+
13+
For less sensitive reports, you can also open an issue or pull request on GitHub.

0 commit comments

Comments
 (0)