mirror of
https://github.com/ARMSX2/ARMSX2.git
synced 2026-08-24 16:50:16 -07:00
Deps: Update to libzip 1.11.1
This commit is contained in:
Vendored
+1
-1
@@ -1,2 +1,2 @@
|
||||
Dieter Baron <dillo@nih.at>
|
||||
Thomas Klausner <tk@giga.or.at>
|
||||
Thomas Klausner <wiz@gatalith.at>
|
||||
|
||||
Vendored
+1
@@ -250,6 +250,7 @@ add_library(zip STATIC
|
||||
lib/zip_unchange_archive.c
|
||||
lib/zip_unchange_data.c
|
||||
lib/zip_utf-8.c
|
||||
lib/zip_source_get_dostime.c
|
||||
${CMAKE_CURRENT_BINARY_DIR}/zip_err_str.c
|
||||
)
|
||||
|
||||
|
||||
Vendored
+343
@@ -0,0 +1,343 @@
|
||||
# 1.11.1 [2024-09-19]
|
||||
|
||||
* Fix zipconf.h for version number with missing third component.
|
||||
|
||||
# 1.11 [2024-09-19]
|
||||
|
||||
* Stop searching after finding acceptable central directory, even if it contains inconsistencies.
|
||||
* Only write Zip64 EOCD if fields don't fit in normal EOCD. Previously libzip also wrote it when any directory entry required Zip64.
|
||||
* Allow bytes from 0x00-0x1F as UTF-8.
|
||||
* Add new error code `ZIP_ER_TRUNCATED_ZIP` for files that start with a valid local header signature.
|
||||
* `zipcmp`: add `-T` option for comparing timestamps.
|
||||
* `zip_file_replace` now removes the target's extra field information.
|
||||
|
||||
# 1.10.1 [2023-08-23]
|
||||
|
||||
* Add `ZIP_LENGTH_TO_END` and `ZIP_LENGTH_UNCHECKED`. Unless `ZIP_LENGTH_UNCHECKED` is used as `length`, it is an error for a file to shrink between the time when the source is created and when its data is read.
|
||||
* Fix test on Windows.
|
||||
|
||||
# 1.10.0 [2023-06-23]
|
||||
|
||||
* Make support for layered sources public.
|
||||
* Add `zip_source_zip_file` and `zip_source_zip_file_create`, deprecate `zip_source_zip` and `zip_source_zip_create`.
|
||||
* Allow reading changed file data.
|
||||
* Fix handling of files of size 4294967295.
|
||||
* `zipmerge`: copy extra fields.
|
||||
* `zipmerge`: add option to keep files uncompressed.
|
||||
* Switch test framework to use nihtest instead of Perl.
|
||||
* Fix reading/writing compressed data with buffers > 4GiB.
|
||||
* Restore support for torrentzip.
|
||||
* Add warnings when using deprecated functions.
|
||||
* Allow keeping files for empty archives.
|
||||
* Support mbedTLS>=3.3.0.
|
||||
* Support OpenSSL 3.
|
||||
* Use ISO C secure library functions, if available.
|
||||
|
||||
|
||||
# 1.9.2 [2022-06-28]
|
||||
|
||||
* Fix version number in header file.
|
||||
|
||||
|
||||
# 1.9.1 [2022-06-28]
|
||||
|
||||
* Fix `zip_file_is_seekable()`.
|
||||
|
||||
|
||||
# 1.9.0 [2022-06-13]
|
||||
|
||||
* Add `zip_file_is_seekable()`.
|
||||
* Improve compatibility with WinAES.
|
||||
* Fix encoding handling in `zip_name_locate()`.
|
||||
* Add option to `zipcmp` to output summary of changes.
|
||||
* Various bug fixes and documentation improvements.
|
||||
|
||||
|
||||
# 1.8.0 [2021-06-18]
|
||||
|
||||
* Add support for zstd (Zstandard) compression.
|
||||
* Add support for lzma (ID 14) compression.
|
||||
* Add `zip_source_window_create()`.
|
||||
* Add `zip_source_zip_create()` variant to `zip_source_zip()`.
|
||||
* Allow method specific `comp_flags` in `zip_set_file_compression()`.
|
||||
* Allow `zip_source_tell()` on sources that don't support seeking and `zip_ftell()` on compressed data.
|
||||
* Provide more details for consistency check errors.
|
||||
* Improve output of `zipcmp`.
|
||||
* In `zipcmp`, don’t ignore empty directories when comparing directory listing.
|
||||
* Treat empty string as no password given in `zip_file_set_encryption()`, `zip_fopen_encrypted()`, and `zip_set_default_password()`.
|
||||
|
||||
|
||||
# 1.7.3 [2020-07-15]
|
||||
|
||||
* Support cmake < 3.17 again.
|
||||
* Fix pkgconfig file (regression in 1.7.2).
|
||||
|
||||
|
||||
# 1.7.2 [2020-07-11]
|
||||
|
||||
* Fixes for the CMake `find_project()` files.
|
||||
* libzip moved to the CMake `libzip::` `NAMESPACE`.
|
||||
* CMake usage best practice cleanups.
|
||||
|
||||
|
||||
# 1.7.1 [2020-06-13]
|
||||
|
||||
* Restore `LIBZIP_VERSION_{MAJOR,MINOR,MICRO}` symbols.
|
||||
* Fixes warnings reported by PVS-Studio.
|
||||
* Add `LIBZIP_DO_INSTALL` build setting to make it easier to use
|
||||
libzip as subproject.
|
||||
|
||||
|
||||
# 1.7.0 [2020-06-05]
|
||||
|
||||
* Add support for encrypting using traditional PKWare encryption.
|
||||
* Add `zip_compression_method_supported()`.
|
||||
* Add `zip_encryption_method_supported()`.
|
||||
* Add the `ZIP_SOURCE_GET_FILE_ATTRIBUTES` source command.
|
||||
* Refactor stdio file backend.
|
||||
* Add CMake find_project() support.
|
||||
|
||||
|
||||
# 1.6.1 [2020-02-03]
|
||||
|
||||
* Bugfix for double-free in `zipcmp(1)` during cleanup.
|
||||
|
||||
|
||||
# 1.6.0 [2020-01-24]
|
||||
|
||||
* Avoid using `umask()` since it's not thread-safe.
|
||||
* Set close-on-exec flag when opening files.
|
||||
* Do not accept empty files as valid zip archives any longer.
|
||||
* Add support for XZ compressed files (using liblzma).
|
||||
* Add support for cancelling while closing zip archives.
|
||||
* Add support for setting the time in the on-disk format.
|
||||
|
||||
|
||||
# 1.5.2 [2019-03-12]
|
||||
|
||||
* Fix bug in AES encryption affecting certain file sizes
|
||||
* Keep file permissions when modifying zip archives
|
||||
* Support systems with small stack size.
|
||||
* Support mbed TLS as crypto backend.
|
||||
* Add nullability annotations.
|
||||
|
||||
|
||||
# 1.5.1 [2018-04-11]
|
||||
|
||||
* Choose format of installed documentation based on available tools.
|
||||
* Fix visibility of symbols.
|
||||
* Fix zipcmp directory support.
|
||||
* Don't set RPATH on Linux.
|
||||
* Use Libs.private for link dependencies in pkg-config file.
|
||||
* Fix build with LibreSSL.
|
||||
* Various bugfixes.
|
||||
|
||||
|
||||
# 1.5.0 [2018-03-11]
|
||||
|
||||
* Use standard cryptographic library instead of custom AES implementation.
|
||||
This also simplifies the license.
|
||||
* Use `clang-format` to format the source code.
|
||||
* More Windows improvements.
|
||||
|
||||
|
||||
# 1.4.0 [2017-12-29]
|
||||
|
||||
* Improve build with cmake
|
||||
* Retire autoconf/automake build system
|
||||
* Add `zip_source_buffer_fragment()`.
|
||||
* Add support to clone unchanged beginning of archive (instead of rewriting it).
|
||||
Supported for buffer sources and on Apple File System.
|
||||
* Add support for Microsoft Universal Windows Platform.
|
||||
|
||||
|
||||
# 1.3.2 [2017-11-20]
|
||||
|
||||
* Fix bug introduced in last: zip_t was erroneously freed if zip_close() failed.
|
||||
|
||||
|
||||
# 1.3.1 [2017-11-19]
|
||||
|
||||
* Install zipconf.h into ${PREFIX}/include
|
||||
* Add zip_libzip_version()
|
||||
* Fix AES tests on Linux
|
||||
|
||||
|
||||
# 1.3.0 [2017-09-02]
|
||||
|
||||
* Support bzip2 compressed zip archives
|
||||
* Improve file progress callback code
|
||||
* Fix zip_fdopen()
|
||||
* CVE-2017-12858: Fix double free()
|
||||
* CVE-2017-14107: Improve EOCD64 parsing
|
||||
|
||||
|
||||
# 1.2.0 [2017-02-19]
|
||||
|
||||
* Support for AES encryption (Winzip version), both encryption
|
||||
and decryption
|
||||
* Support legacy zip files with >64k entries
|
||||
* Fix seeking in zip_source_file if start > 0
|
||||
* Add zip_fseek() for seeking in uncompressed data
|
||||
* Add zip_ftell() for telling position in uncompressed data
|
||||
* Add zip_register_progress_callback() for UI updates during zip_close()
|
||||
|
||||
|
||||
# 1.1.3 [2016-05-28]
|
||||
|
||||
* Fix build on Windows when using autoconf
|
||||
|
||||
|
||||
# 1.1.2 [2016-02-19]
|
||||
|
||||
* Improve support for 3MF files
|
||||
|
||||
|
||||
# 1.1.1 [2016-02-07]
|
||||
|
||||
* Build fixes for Linux
|
||||
* Fix some warnings reported by PVS-Studio
|
||||
|
||||
|
||||
# 1.1 [2016-01-26]
|
||||
|
||||
* ziptool(1): command line tool to modify zip archives
|
||||
* Speedups for archives with many entries
|
||||
* Coverity fixes
|
||||
* Better APK support
|
||||
* Support for running tests on Windows
|
||||
* More build fixes for Windows
|
||||
* Portability fixes
|
||||
* Documentation improvements
|
||||
|
||||
|
||||
# 1.0.1 [2015-05-04]
|
||||
|
||||
* Build fixes for Windows
|
||||
|
||||
|
||||
# 1.0 [2015-05-03]
|
||||
|
||||
* Implemented an I/O abstraction layer
|
||||
* Added support for native Windows API for files
|
||||
* Added support for setting the last modification time for a file
|
||||
* Added a new type zip_error_t for errors
|
||||
* Added more typedefs for structs
|
||||
* Torrentzip support was removed
|
||||
* CVE-2015-2331 was fixed
|
||||
* Addressed all Coverity CIDs
|
||||
|
||||
|
||||
# 0.11.2 [2013-12-19]
|
||||
|
||||
* Support querying/setting operating system and external attributes
|
||||
* For newly added files, set operating system to UNIX, permissions
|
||||
to 0666 (0777 for directories)
|
||||
* Fix bug when writing zip archives containing files bigger than 4GB
|
||||
|
||||
|
||||
# 0.11.1 [2013-04-27]
|
||||
|
||||
* Fix bugs in zip_set_file_compression()
|
||||
* Include Xcode build infrastructure
|
||||
|
||||
|
||||
# 0.11 [2013-03-23]
|
||||
|
||||
* Added Zip64 support (large file support)
|
||||
* Added UTF-8 support for file names, file comments, and archive comments
|
||||
* Changed API for name and comment related functions for UTF-8 support
|
||||
* Added zip_discard()
|
||||
* Added ZIP_TRUNCATE for zip_open()
|
||||
* Added zip_set_file_compression()
|
||||
* Added API for accessing and modifying extra fields
|
||||
* Improved API type consistency
|
||||
* Use gcc4's visibility __attribute__
|
||||
* More changes for Windows support
|
||||
* Additional test cases
|
||||
|
||||
|
||||
# 0.10.1 [2012-03-20]
|
||||
|
||||
* Fixed CVE-2012-1162
|
||||
* Fixed CVE-2012-1163
|
||||
|
||||
|
||||
# 0.10 [2010-03-18]
|
||||
|
||||
* Added zip_get_num_entries(), deprecated zip_get_num_files()
|
||||
* Better windows support
|
||||
* Support for traditional PKWARE encryption added
|
||||
* Fix opening archives with more than 65535 entries
|
||||
* Fix some memory leaks
|
||||
* Fix cmake build and installation
|
||||
* Fix memory leak in error case in zip_open()
|
||||
* Fixed CVE-2011-0421 (no security implications though)
|
||||
* More documentation
|
||||
|
||||
|
||||
# 0.9.3 [2010-02-01]
|
||||
|
||||
* Include m4/ directory in distribution; some packagers need it
|
||||
|
||||
|
||||
# 0.9.2 [2010-01-31]
|
||||
|
||||
* Avoid passing uninitialized data to deflate()
|
||||
* Fix memory leak when closing zip archives
|
||||
|
||||
|
||||
# 0.9.1 [2010-01-24]
|
||||
|
||||
* Fix infinite loop on reading some broken files
|
||||
* Optimization in time conversion (don't call localtime())
|
||||
* Clear data descriptor flag in central directory, fixing Open Office files
|
||||
* Allow more than 64k entries
|
||||
|
||||
|
||||
# 0.9 [2008-07-25]
|
||||
|
||||
* on Windows, explicitly set dllimport/dllexport
|
||||
* remove erroneous references to GPL
|
||||
* add support for torrentzip
|
||||
* new functions: zip_get_archive_flag, zip_set_archive_flag
|
||||
* zip_source_zip: add flag to force recompression
|
||||
* zip_sorce_file: only keep file open while reading from it
|
||||
|
||||
|
||||
# 0.8 [2007-06-06]
|
||||
|
||||
* fix for zip archives larger than 2GiB
|
||||
* fix zip_error_strerror to include libzip error string
|
||||
* add support for reading streamed zip files
|
||||
* new functions: zip_add_dir, zip_error_clear, zip_file_error_clear
|
||||
* add basic support for building with CMake (incomplete)
|
||||
|
||||
|
||||
# 0.7.1 [2006-05-18]
|
||||
|
||||
* bugfix for zip_close
|
||||
|
||||
|
||||
# 0.7 [2006-05-06]
|
||||
|
||||
* struct zip_stat increased for future encryption support
|
||||
* zip_add return value changed (now returns new index of added file)
|
||||
* shared library major bump because of previous two
|
||||
* added functions for reading and writing file and archive comments
|
||||
New functions: zip_get_archive_comment, zip_get_file_comment,
|
||||
zip_set_archive_comment, zip_set_file_comment, zip_unchange_archive
|
||||
|
||||
|
||||
# 0.6.1 [2005-07-14]
|
||||
|
||||
* various bug fixes
|
||||
|
||||
|
||||
# 0.6 [2005-06-09]
|
||||
|
||||
* first standalone release
|
||||
* changed license to three-clause BSD
|
||||
* overhauled API
|
||||
* added man pages
|
||||
* install zipcmp and zipmerge
|
||||
Vendored
+4
-1
@@ -82,6 +82,7 @@ add_library(zip
|
||||
zip_source_file_stdio.c
|
||||
zip_source_free.c
|
||||
zip_source_function.c
|
||||
zip_source_get_dostime.c
|
||||
zip_source_get_file_attributes.c
|
||||
zip_source_is_deleted.c
|
||||
zip_source_layered.c
|
||||
@@ -117,6 +118,7 @@ add_library(zip
|
||||
add_library(libzip::zip ALIAS zip)
|
||||
|
||||
if(WIN32)
|
||||
target_compile_definitions(zip PRIVATE WIN32_LEAN_AND_MEAN)
|
||||
target_sources(zip PRIVATE
|
||||
zip_source_file_win32.c
|
||||
zip_source_file_win32_named.c
|
||||
@@ -172,7 +174,8 @@ if(HAVE_CRYPTO)
|
||||
endif()
|
||||
|
||||
if(SHARED_LIB_VERSIONNING)
|
||||
set_target_properties(zip PROPERTIES VERSION 5.5 SOVERSION 5)
|
||||
# MACHO_*_VERSION can be removed when SOVERSION gets increased. Cf #405
|
||||
set_target_properties(zip PROPERTIES VERSION 5.5 SOVERSION 5 MACHO_CURRENT_VERSION 6.5 MACHO_COMPATIBILITY_VERSION 6)
|
||||
endif()
|
||||
|
||||
target_link_libraries(zip PRIVATE ZLIB::ZLIB)
|
||||
|
||||
Vendored
+1
-1
@@ -3,7 +3,7 @@
|
||||
|
||||
/*
|
||||
compat.h -- compatibility defines.
|
||||
Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner
|
||||
Copyright (C) 1999-2022 Dieter Baron and Thomas Klausner
|
||||
|
||||
This file is part of libzip, a library to manipulate ZIP archives.
|
||||
The authors can be contacted at <info@libzip.org>
|
||||
|
||||
Vendored
+4
-2
@@ -3,7 +3,7 @@
|
||||
|
||||
/*
|
||||
zip.h -- exported declarations.
|
||||
Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner
|
||||
Copyright (C) 1999-2024 Dieter Baron and Thomas Klausner
|
||||
|
||||
This file is part of libzip, a library to manipulate ZIP archives.
|
||||
The authors can be contacted at <info@libzip.org>
|
||||
@@ -154,6 +154,7 @@ extern "C" {
|
||||
#define ZIP_ER_CANCELLED 32 /* N Operation cancelled */
|
||||
#define ZIP_ER_DATA_LENGTH 33 /* N Unexpected length of data */
|
||||
#define ZIP_ER_NOT_ALLOWED 34 /* N Not allowed in torrentzip */
|
||||
#define ZIP_ER_TRUNCATED_ZIP 35 /* N Possibly truncated or corrupted zip archive */
|
||||
|
||||
/* type of system error value */
|
||||
|
||||
@@ -256,7 +257,8 @@ enum zip_source_cmd {
|
||||
ZIP_SOURCE_BEGIN_WRITE_CLONING, /* like ZIP_SOURCE_BEGIN_WRITE, but keep part of original file */
|
||||
ZIP_SOURCE_ACCEPT_EMPTY, /* whether empty files are valid archives */
|
||||
ZIP_SOURCE_GET_FILE_ATTRIBUTES, /* get additional file attributes */
|
||||
ZIP_SOURCE_SUPPORTS_REOPEN /* allow reading from changed entry */
|
||||
ZIP_SOURCE_SUPPORTS_REOPEN, /* allow reading from changed entry */
|
||||
ZIP_SOURCE_GET_DOS_TIME /* get last modification time in DOS format */
|
||||
};
|
||||
typedef enum zip_source_cmd zip_source_cmd_t;
|
||||
|
||||
|
||||
Vendored
+1
-1
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
zip_add.c -- add file via callback function
|
||||
Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner
|
||||
Copyright (C) 1999-2022 Dieter Baron and Thomas Klausner
|
||||
|
||||
This file is part of libzip, a library to manipulate ZIP archives.
|
||||
The authors can be contacted at <info@libzip.org>
|
||||
|
||||
Vendored
+1
-1
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
zip_add_dir.c -- add directory
|
||||
Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner
|
||||
Copyright (C) 1999-2022 Dieter Baron and Thomas Klausner
|
||||
|
||||
This file is part of libzip, a library to manipulate ZIP archives.
|
||||
The authors can be contacted at <info@libzip.org>
|
||||
|
||||
Vendored
+2
-2
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
zip_add_entry.c -- create and init struct zip_entry
|
||||
Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner
|
||||
Copyright (C) 1999-2024 Dieter Baron and Thomas Klausner
|
||||
|
||||
This file is part of libzip, a library to manipulate ZIP archives.
|
||||
The authors can be contacted at <info@libzip.org>
|
||||
@@ -64,7 +64,7 @@ _zip_add_entry(zip_t *za) {
|
||||
return -1;
|
||||
}
|
||||
rentries = (zip_entry_t *)realloc(za->entry, sizeof(struct zip_entry) * (size_t)nalloc);
|
||||
if (!rentries) {
|
||||
if (rentries == NULL) {
|
||||
zip_error_set(&za->error, ZIP_ER_MEMORY, 0);
|
||||
return -1;
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
zip_algorithm_bzip2.c -- bzip2 (de)compression routines
|
||||
Copyright (C) 2017-2021 Dieter Baron and Thomas Klausner
|
||||
Copyright (C) 2017-2023 Dieter Baron and Thomas Klausner
|
||||
|
||||
This file is part of libzip, a library to manipulate ZIP archives.
|
||||
The authors can be contacted at <info@libzip.org>
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
zip_algorithm_deflate.c -- deflate (de)compression routines
|
||||
Copyright (C) 2017-2021 Dieter Baron and Thomas Klausner
|
||||
Copyright (C) 2017-2023 Dieter Baron and Thomas Klausner
|
||||
|
||||
This file is part of libzip, a library to manipulate ZIP archives.
|
||||
The authors can be contacted at <info@libzip.org>
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
zip_algorithm_xz.c -- LZMA/XZ (de)compression routines
|
||||
Bazed on zip_algorithm_deflate.c -- deflate (de)compression routines
|
||||
Copyright (C) 2017-2021 Dieter Baron and Thomas Klausner
|
||||
Copyright (C) 2017-2023 Dieter Baron and Thomas Klausner
|
||||
|
||||
This file is part of libzip, a library to manipulate ZIP archives.
|
||||
The authors can be contacted at <info@libzip.org>
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
zip_algorithm_zstd.c -- zstd (de)compression routines
|
||||
Copyright (C) 2020-2021 Dieter Baron and Thomas Klausner
|
||||
Copyright (C) 2020-2023 Dieter Baron and Thomas Klausner
|
||||
|
||||
This file is part of libzip, a library to manipulate ZIP archives.
|
||||
The authors can be contacted at <info@libzip.org>
|
||||
|
||||
Vendored
+2
-3
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
zip_buffer.c -- bounds checked access to memory buffer
|
||||
Copyright (C) 2014-2021 Dieter Baron and Thomas Klausner
|
||||
Copyright (C) 2014-2024 Dieter Baron and Thomas Klausner
|
||||
|
||||
This file is part of libzip, a library to manipulate ZIP archives.
|
||||
The authors can be contacted at <info@libzip.org>
|
||||
@@ -306,8 +306,7 @@ _zip_buffer_put_8(zip_buffer_t *buffer, zip_uint8_t i) {
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
_zip_buffer_set_offset(zip_buffer_t *buffer, zip_uint64_t offset) {
|
||||
int _zip_buffer_set_offset(zip_buffer_t *buffer, zip_uint64_t offset) {
|
||||
if (offset > buffer->size) {
|
||||
buffer->ok = false;
|
||||
return -1;
|
||||
|
||||
Vendored
+30
-15
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
zip_close.c -- close zip archive and update changes
|
||||
Copyright (C) 1999-2022 Dieter Baron and Thomas Klausner
|
||||
Copyright (C) 1999-2024 Dieter Baron and Thomas Klausner
|
||||
|
||||
This file is part of libzip, a library to manipulate ZIP archives.
|
||||
The authors can be contacted at <info@libzip.org>
|
||||
@@ -44,7 +44,7 @@
|
||||
|
||||
static int add_data(zip_t *, zip_source_t *, zip_dirent_t *, zip_uint32_t);
|
||||
static int copy_data(zip_t *, zip_uint64_t);
|
||||
static int copy_source(zip_t *, zip_source_t *, zip_int64_t);
|
||||
static int copy_source(zip_t *, zip_source_t *, zip_source_t *, zip_int64_t);
|
||||
static int torrentzip_compare_names(const void *a, const void *b);
|
||||
static int write_cdir(zip_t *, const zip_filelist_t *, zip_uint64_t);
|
||||
static int write_data_descriptor(zip_t *za, const zip_dirent_t *dirent, int is_zip64);
|
||||
@@ -468,11 +468,7 @@ add_data(zip_t *za, zip_source_t *src, zip_dirent_t *de, zip_uint32_t changed) {
|
||||
|
||||
/* PKWare encryption uses last_mod, make sure it gets the right value. */
|
||||
if (de->changed & ZIP_DIRENT_LAST_MOD) {
|
||||
zip_stat_t st_mtime;
|
||||
zip_stat_init(&st_mtime);
|
||||
st_mtime.valid = ZIP_STAT_MTIME;
|
||||
st_mtime.mtime = de->last_mod;
|
||||
if ((src_tmp = _zip_source_window_new(src_final, 0, -1, &st_mtime, 0, NULL, NULL, 0, true, &za->error)) == NULL) {
|
||||
if ((src_tmp = _zip_source_window_new(src_final, 0, -1, NULL, 0, NULL, &de->last_mod, NULL, 0, true, &za->error)) == NULL) {
|
||||
zip_source_free(src_final);
|
||||
return -1;
|
||||
}
|
||||
@@ -495,7 +491,7 @@ add_data(zip_t *za, zip_source_t *src, zip_dirent_t *de, zip_uint32_t changed) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
ret = copy_source(za, src_final, data_length);
|
||||
ret = copy_source(za, src_final, src, data_length);
|
||||
|
||||
if (zip_source_stat(src_final, &st) < 0) {
|
||||
zip_error_set_from_source(&za->error, src_final);
|
||||
@@ -529,10 +525,23 @@ add_data(zip_t *za, zip_source_t *src, zip_dirent_t *de, zip_uint32_t changed) {
|
||||
}
|
||||
|
||||
if ((de->changed & ZIP_DIRENT_LAST_MOD) == 0) {
|
||||
if (st.valid & ZIP_STAT_MTIME)
|
||||
de->last_mod = st.mtime;
|
||||
else
|
||||
time(&de->last_mod);
|
||||
int ret2 = zip_source_get_dos_time(src, &de->last_mod);
|
||||
if (ret2 < 0) {
|
||||
zip_error_set_from_source(&za->error, src);
|
||||
return -1;
|
||||
}
|
||||
if (ret2 == 0) {
|
||||
time_t mtime;
|
||||
if (st.valid & ZIP_STAT_MTIME) {
|
||||
mtime = st.mtime;
|
||||
}
|
||||
else {
|
||||
time(&mtime);
|
||||
}
|
||||
if (_zip_u2d_time(mtime, &de->last_mod, &za->error) < 0) {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
de->comp_method = st.comp_method;
|
||||
de->crc = st.crc;
|
||||
@@ -605,7 +614,7 @@ copy_data(zip_t *za, zip_uint64_t len) {
|
||||
|
||||
|
||||
static int
|
||||
copy_source(zip_t *za, zip_source_t *src, zip_int64_t data_length) {
|
||||
copy_source(zip_t *za, zip_source_t *src, zip_source_t *src_for_length, zip_int64_t data_length) {
|
||||
DEFINE_BYTE_ARRAY(buf, BUFSIZE);
|
||||
zip_int64_t n, current;
|
||||
int ret;
|
||||
@@ -628,7 +637,13 @@ copy_source(zip_t *za, zip_source_t *src, zip_int64_t data_length) {
|
||||
break;
|
||||
}
|
||||
if (n == BUFSIZE && za->progress && data_length > 0) {
|
||||
current += n;
|
||||
zip_int64_t t;
|
||||
t = zip_source_tell(src_for_length);
|
||||
if (t >= 0) {
|
||||
current = t;
|
||||
} else {
|
||||
current += n;
|
||||
}
|
||||
if (_zip_progress_update(za->progress, (double)current / (double)data_length) != 0) {
|
||||
zip_error_set(&za->error, ZIP_ER_CANCELLED, 0);
|
||||
ret = -1;
|
||||
@@ -742,4 +757,4 @@ static int torrentzip_compare_names(const void *a, const void *b) {
|
||||
}
|
||||
|
||||
return strcasecmp(aname, bname);
|
||||
}
|
||||
}
|
||||
|
||||
Vendored
+1
-1
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
zip_crypto.h -- crypto definitions
|
||||
Copyright (C) 2017-2021 Dieter Baron and Thomas Klausner
|
||||
Copyright (C) 2017-2022 Dieter Baron and Thomas Klausner
|
||||
|
||||
This file is part of libzip, a library to manipulate ZIP archives.
|
||||
The authors can be contacted at <info@libzip.org>
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
zip_crypto_commoncrypto.c -- CommonCrypto wrapper.
|
||||
Copyright (C) 2018-2021 Dieter Baron and Thomas Klausner
|
||||
Copyright (C) 2018-2022 Dieter Baron and Thomas Klausner
|
||||
|
||||
This file is part of libzip, a library to manipulate ZIP archives.
|
||||
The authors can be contacted at <info@libzip.org>
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
zip_crypto_commoncrypto.h -- definitions for CommonCrypto wrapper.
|
||||
Copyright (C) 2018 Dieter Baron and Thomas Klausner
|
||||
Copyright (C) 2018-2022 Dieter Baron and Thomas Klausner
|
||||
|
||||
This file is part of libzip, a library to manipulate ZIP archives.
|
||||
The authors can be contacted at <info@libzip.org>
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
zip_crypto_gnutls.c -- GnuTLS wrapper.
|
||||
Copyright (C) 2018-2021 Dieter Baron and Thomas Klausner
|
||||
Copyright (C) 2018-2022 Dieter Baron and Thomas Klausner
|
||||
|
||||
This file is part of libzip, a library to manipulate ZIP archives.
|
||||
The authors can be contacted at <info@libzip.org>
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
zip_crypto_gnutls.h -- definitions for GnuTLS wrapper.
|
||||
Copyright (C) 2018-2021 Dieter Baron and Thomas Klausner
|
||||
Copyright (C) 2018-2022 Dieter Baron and Thomas Klausner
|
||||
|
||||
This file is part of libzip, a library to manipulate ZIP archives.
|
||||
The authors can be contacted at <info@libzip.org>
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user