diff --git a/CMakeLists.txt b/CMakeLists.txt index e980792f6..95c175250 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -618,8 +618,7 @@ if(NOT LIBZIP_FOUND OR NINTENDO_SWITCH) option(BUILD_SHARED_LIBS "Build shared libraries" OFF) option(LIBZIP_DO_INSTALL "Install libzip and the related files" OFF) add_subdirectory(core/deps/libzip) - target_include_directories(${PROJECT_NAME} PRIVATE core/deps/libzip/lib) - target_link_libraries(${PROJECT_NAME} PRIVATE zip) + target_link_libraries(${PROJECT_NAME} PRIVATE libzip::zip) endif() if(WIN32) diff --git a/core/deps/libzip/.clang-format b/core/deps/libzip/.clang-format new file mode 100644 index 000000000..8bb62b8c2 --- /dev/null +++ b/core/deps/libzip/.clang-format @@ -0,0 +1,12 @@ +BasedOnStyle: LLVM +IndentWidth: 4 +ColumnLimit: 2000 +AlwaysBreakAfterReturnType: TopLevelDefinitions +KeepEmptyLinesAtTheStartOfBlocks: false +MaxEmptyLinesToKeep: 2 +BreakBeforeBraces: Custom +BraceWrapping: + BeforeElse: true +AlignEscapedNewlines: Left +UseTab: Never +#PPDirectiveIndentStyle: AfterHash diff --git a/core/deps/libzip/.github/ISSUE_TEMPLATE/bug-report.md b/core/deps/libzip/.github/ISSUE_TEMPLATE/bug-report.md new file mode 100644 index 000000000..86c107807 --- /dev/null +++ b/core/deps/libzip/.github/ISSUE_TEMPLATE/bug-report.md @@ -0,0 +1,32 @@ +--- +name: Bug Report +about: Report where libzip didn't behave like you expected. +title: '' +labels: bug +assignees: '' + +--- + +**Describe the Bug** +A clear and concise description of what the bug is. + +**Expected Behavior** +A clear and concise description of what you expected to happen. + +**Observed Behavior** +A clear and concise description of what actually happened. + +**To Reproduce** +Short program or code snippet that reproduces the problem. + +**libzip Version** +Version of libzip or revision repository used. + +**Operating System** +Operating system and version, used compiler. + +**Test Files** +If applicable, attach and describe zip archives that trigger the problem. + +**Additional context** +Add any other context about the problem here. diff --git a/core/deps/libzip/.github/ISSUE_TEMPLATE/compile-error.md b/core/deps/libzip/.github/ISSUE_TEMPLATE/compile-error.md new file mode 100644 index 000000000..45c8a7a72 --- /dev/null +++ b/core/deps/libzip/.github/ISSUE_TEMPLATE/compile-error.md @@ -0,0 +1,25 @@ +--- +name: Compile Error +about: Report when libzip does not compile. +title: '' +labels: compile +assignees: '' + +--- + +**Compiler Error** +Output from the compiler, including exact and complete error message, file name and line number. + +**libzip Version** +Version of libzip or revision repository used. + +**Operating System and Compiler** +The operating system and compiler used, including version number. + +Also, any flags passed to `cmake`. + +**Autodetected Configuration** +Attach `CmakeCache.txt` from your build directory. This list everything `cmake` detected on your system. + +**Additional context** +Add any other context about the problem here. diff --git a/core/deps/libzip/.github/ISSUE_TEMPLATE/feature-request.md b/core/deps/libzip/.github/ISSUE_TEMPLATE/feature-request.md new file mode 100644 index 000000000..c23381e02 --- /dev/null +++ b/core/deps/libzip/.github/ISSUE_TEMPLATE/feature-request.md @@ -0,0 +1,22 @@ +--- +name: Feature Request +about: Suggest an idea for this project. +title: '' +labels: enhancement +assignees: '' + +--- + +**Description** +A clear and concise description of what you want to achieve, why the current features are insufficient, and why you think it is generally useful. + +Also, have you checked whether the feature is already mentioned in TODO.md? If so, only submit a new issue if you expand on it. + +**Solution** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context about the feature request here. diff --git a/core/deps/libzip/.github/workflows/CIFuzz.yml b/core/deps/libzip/.github/workflows/CIFuzz.yml new file mode 100644 index 000000000..773e2715a --- /dev/null +++ b/core/deps/libzip/.github/workflows/CIFuzz.yml @@ -0,0 +1,25 @@ +name: CIFuzz +on: [pull_request] +permissions: + contents: read +jobs: + Fuzzing: + runs-on: ubuntu-latest + steps: + - name: Build Fuzzers + uses: google/oss-fuzz/infra/cifuzz/actions/build_fuzzers@master + with: + oss-fuzz-project-name: 'libzip' + dry-run: false + - name: Run Fuzzers + uses: google/oss-fuzz/infra/cifuzz/actions/run_fuzzers@master + with: + oss-fuzz-project-name: 'libzip' + fuzz-seconds: 600 + dry-run: false + - name: Upload Crash + uses: actions/upload-artifact@v1 + if: failure() + with: + name: artifacts + path: ./out/artifacts diff --git a/core/deps/libzip/.github/workflows/build.yml b/core/deps/libzip/.github/workflows/build.yml new file mode 100644 index 000000000..79030522b --- /dev/null +++ b/core/deps/libzip/.github/workflows/build.yml @@ -0,0 +1,65 @@ +name: build +on: [push] +permissions: + contents: read +jobs: + all: + runs-on: ${{ matrix.os }} + name: ${{ matrix.os }}${{ matrix.name_extra }} + strategy: + fail-fast: false + matrix: + os: [macos-latest, ubuntu-latest, windows-latest] + cmake_extra: [""] + name_extra: [""] + include: + - os: windows-latest + cmake_extra: "-T ClangCl" + name_extra: " clang-cl" + steps: + - name: checkout + uses: actions/checkout@v3 + - name: install python and pip + uses: actions/setup-python@v4 + with: + python-version: '3.11' + - name: install dependencies (Linux) + if: ${{ runner.os == 'Linux' }} + run: | + sudo apt-get install libzstd-dev + - name: install dependencies (Windows) + if: ${{ runner.os == 'Windows' }} + uses: lukka/run-vcpkg@v7 + id: runvcpkg + with: + vcpkgGitCommitId: f93ba152d55e1d243160e690bc302ffe8638358e + vcpkgTriplet: x64-windows + vcpkgArguments: zlib bzip2 liblzma zstd + - name: prepare build directory and install nihtest + run: | + cmake -E make_directory ${{runner.workspace}}/build + pip install nihtest + - name: configure (Unix) + if: ${{ runner.os != 'Windows' }} + working-directory: ${{runner.workspace}}/build + run: | + cmake ${{ matrix.cmake_extra }} ${{github.workspace}} + - name: configure (Windows) + if: ${{ runner.os == 'Windows' }} + working-directory: ${{runner.workspace}}/build + run: | + cmake ${{ matrix.cmake_extra }} -DCMAKE_TOOLCHAIN_FILE=${{env.VCPKG_ROOT}}/scripts/buildsystems/vcpkg.cmake ${{github.workspace}} + - name: build + working-directory: ${{runner.workspace}}/build + run: | + cmake --build . --config Release + - name: Archive production artifacts + uses: actions/upload-artifact@v3 + with: + name: regress-directory + path: | + ${{runner.workspace}}/build/regress + - name: test + working-directory: ${{runner.workspace}}/build + run: | + ctest --output-on-failure -v -C Release diff --git a/core/deps/libzip/.github/workflows/codeql-analysis.yml b/core/deps/libzip/.github/workflows/codeql-analysis.yml new file mode 100644 index 000000000..64c659a2f --- /dev/null +++ b/core/deps/libzip/.github/workflows/codeql-analysis.yml @@ -0,0 +1,74 @@ +# For most projects, this workflow file will not need changing; you simply need +# to commit it to your repository. +# +# You may wish to alter this file to override the set of languages analyzed, +# or to provide custom queries or build logic. +name: "CodeQL" + +on: + push: + branches: [master] + pull_request: + # The branches below must be a subset of the branches above + branches: [master] + schedule: + - cron: '0 10 * * 4' + +permissions: + contents: read + +jobs: + analyze: + name: Analyze + runs-on: ubuntu-latest + + permissions: + actions: read + contents: read + security-events: write + + strategy: + fail-fast: false + matrix: + # Override automatic language detection by changing the below list + # Supported options are ['csharp', 'cpp', 'go', 'java', 'javascript', 'python'] + language: ['cpp'] + # Learn more... + # https://docs.github.com/en/github/finding-security-vulnerabilities-and-errors-in-your-code/configuring-code-scanning#overriding-automatic-language-detection + + steps: + - name: Checkout repository + uses: actions/checkout@v3 + with: + # We must fetch at least the immediate parents so that if this is + # a pull request then we can checkout the head. + fetch-depth: 2 + + # Initializes the CodeQL tools for scanning. + - name: Initialize CodeQL + uses: github/codeql-action/init@v2 + with: + languages: ${{ matrix.language }} + # If you wish to specify custom queries, you can do so here or in a config file. + # By default, queries listed here will override any specified in a config file. + # Prefix the list here with "+" to use these queries and those in the config file. + # queries: ./path/to/local/query, your-org/your-repo/queries@main + + # Autobuild attempts to build any compiled languages (C/C++, C#, or Java). + # If this step fails, then you should remove it and run the build manually (see below) + - name: Autobuild + uses: github/codeql-action/autobuild@v2 + + # ℹ️ Command-line programs to run using the OS shell. + # 📚 https://git.io/JvXDl + + # ✏️ If the Autobuild fails above, remove it and uncomment the following three lines + # and modify them (or add more) to build your code if your project + # uses a compiled language + + #- run: | + # make bootstrap + # make release + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v2 diff --git a/core/deps/libzip/API-CHANGES.md b/core/deps/libzip/API-CHANGES.md index 24e3d8e1a..4bfb7b283 100644 --- a/core/deps/libzip/API-CHANGES.md +++ b/core/deps/libzip/API-CHANGES.md @@ -7,6 +7,18 @@ You can define `ZIP_DISABLE_DEPRECATED` before including `` to hide prototypes for deprecated functions, to find out about functions that might be removed at some point. +## Changed in libzip-1.10.0 + +### deprecated `zip_source_zip` and `zip_source_zip_create` + +These functions were replaced with `zip_source_zip_file` and `zip_source_zip_file_create`. The implicit handling of the flag `ZIP_FL_COMPRESSED` was removed, the flag can now be specified explicitly. + +If you want to get the compressed data for the whole file, use + +```C +zip_source_zip_file(za, source_archive, source_index, ZIP_FL_COMPRESSED, 0, -1, NULL) +``` + ## Changed in libzip-1.0 ### new type `zip_error_t` diff --git a/core/deps/libzip/CMakeLists.txt b/core/deps/libzip/CMakeLists.txt index afcc6fc31..b2e77241a 100644 --- a/core/deps/libzip/CMakeLists.txt +++ b/core/deps/libzip/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required(VERSION 3.0.2) +cmake_minimum_required(VERSION 3.5.0) list(APPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake) if (${CMAKE_VERSION} VERSION_LESS "3.17.0") @@ -6,7 +6,7 @@ if (${CMAKE_VERSION} VERSION_LESS "3.17.0") endif() project(libzip - VERSION 1.7.3.1 + VERSION 1.10.1 LANGUAGES C) option(ENABLE_COMMONCRYPTO "Enable use of CommonCrypto" ON) @@ -19,6 +19,8 @@ option(ENABLE_BZIP2 "Enable use of BZip2" ON) option(ENABLE_LZMA "Enable use of LZMA" ON) option(ENABLE_ZSTD "Enable use of Zstandard" ON) +option(ENABLE_FDOPEN "Enable zip_fdopen, which is not allowed in Microsoft CRT secure libraries" ON) + option(BUILD_TOOLS "Build tools in the src directory (zipcmp, zipmerge, ziptool)" ON) option(BUILD_REGRESS "Build regression tests" ON) option(BUILD_EXAMPLES "Build examples" ON) @@ -87,14 +89,19 @@ endif() # Checks +# Request ISO C secure library functions (memcpy_s &c) +list(APPEND CMAKE_REQUIRED_DEFINITIONS -D__STDC_WANT_LIB_EXT1__=1) + check_function_exists(_close HAVE__CLOSE) check_function_exists(_dup HAVE__DUP) check_function_exists(_fdopen HAVE__FDOPEN) check_function_exists(_fileno HAVE__FILENO) check_function_exists(_setmode HAVE__SETMODE) -check_function_exists(_snprintf HAVE__SNPRINTF) +check_symbol_exists(_snprintf stdio.h HAVE__SNPRINTF) +check_symbol_exists(_snprintf_s stdio.h HAVE__SNPRINTF_S) +check_symbol_exists(_snwprintf_s stdio.h HAVE__SNWPRINTF_S) check_function_exists(_strdup HAVE__STRDUP) -check_function_exists(_stricmp HAVE__STRICMP) +check_symbol_exists(_stricmp string.h HAVE__STRICMP) check_function_exists(_strtoi64 HAVE__STRTOI64) check_function_exists(_strtoui64 HAVE__STRTOUI64) check_function_exists(_unlink HAVE__UNLINK) @@ -102,15 +109,24 @@ check_function_exists(arc4random HAVE_ARC4RANDOM) check_function_exists(clonefile HAVE_CLONEFILE) check_function_exists(explicit_bzero HAVE_EXPLICIT_BZERO) check_function_exists(explicit_memset HAVE_EXPLICIT_MEMSET) +check_function_exists(fchmod HAVE_FCHMOD) check_function_exists(fileno HAVE_FILENO) check_function_exists(fseeko HAVE_FSEEKO) check_function_exists(ftello HAVE_FTELLO) check_function_exists(getprogname HAVE_GETPROGNAME) -check_function_exists(localtime_r HAVE_LOCALTIME_R) +check_symbol_exists(localtime_r time.h HAVE_LOCALTIME_R) +check_symbol_exists(localtime_s time.h HAVE_LOCALTIME_S) +check_function_exists(memcpy_s HAVE_MEMCPY_S) +check_function_exists(random HAVE_RANDOM) check_function_exists(setmode HAVE_SETMODE) -check_function_exists(strcasecmp HAVE_STRCASECMP) +check_symbol_exists(snprintf stdio.h HAVE_SNPRINTF) +check_symbol_exists(snprintf_s stdio.h HAVE_SNPRINTF_S) +check_symbol_exists(strcasecmp strings.h HAVE_STRCASECMP) check_function_exists(strdup HAVE_STRDUP) +check_function_exists(strerror_s HAVE_STRERROR_S) +check_function_exists(strerrorlen_s HAVE_STRERRORLEN_S) check_function_exists(stricmp HAVE_STRICMP) +check_function_exists(strncpy_s HAVE_STRNCPY_S) check_function_exists(strtoll HAVE_STRTOLL) check_function_exists(strtoull HAVE_STRTOULL) @@ -175,6 +191,34 @@ int main(int argc, char *argv[]) { }" HAVE_NULLABLE) test_big_endian(WORDS_BIGENDIAN) find_package(ZLIB 1.1.2 REQUIRED) +# so developers on systems where zlib is named differently (Windows, sometimes) +# can override the name used in the pkg-config file +if (NOT ZLIB_LINK_LIBRARY_NAME) + set(ZLIB_LINK_LIBRARY_NAME "z") + + # Get the correct name in common cases + list(LENGTH ZLIB_LIBRARIES N_ZLIB_LIBRARIES) + if(N_ZLIB_LIBRARIES EQUAL 1) + set(ZLIB_FILENAME ${ZLIB_LIBRARIES}) + elseif(N_ZLIB_LIBRARIES EQUAL 4) + # ZLIB_LIBRARIES might have the target_link_library() format like + # "optimized;path/to/zlib.lib;debug;path/to/zlibd.lib". Use the 'optimized' + # case unless we know we are in a Debug build. + if(CMAKE_BUILD_TYPE STREQUAL "Debug") + list(FIND ZLIB_LIBRARIES "debug" ZLIB_LIBRARIES_INDEX_OF_CONFIG) + else() + list(FIND ZLIB_LIBRARIES "optimized" ZLIB_LIBRARIES_INDEX_OF_CONFIG) + endif() + if(ZLIB_LIBRARIES_INDEX_OF_CONFIG GREATER_EQUAL 0) + math(EXPR ZLIB_FILENAME_INDEX "${ZLIB_LIBRARIES_INDEX_OF_CONFIG}+1") + list(GET ZLIB_LIBRARIES ${ZLIB_FILENAME_INDEX} ZLIB_FILENAME) + endif() + endif() + if(ZLIB_FILENAME) + get_filename_component(ZLIB_FILENAME ${ZLIB_FILENAME} NAME_WE) + string(REGEX REPLACE "^lib" "" ZLIB_LINK_LIBRARY_NAME ${ZLIB_FILENAME}) + endif() +endif(NOT ZLIB_LINK_LIBRARY_NAME) if(ENABLE_BZIP2) find_package(BZip2) @@ -195,12 +239,17 @@ if(ENABLE_LZMA) endif(ENABLE_LZMA) if(ENABLE_ZSTD) - find_package(Zstd) - if(Zstd_FOUND) + find_package(zstd 1.3.6) + if(zstd_FOUND) set(HAVE_LIBZSTD 1) + if(TARGET zstd::libzstd_shared) + set(zstd_TARGET zstd::libzstd_shared) + else() + set(zstd_TARGET zstd::libzstd_static) + endif() else() message(WARNING "-- zstd library not found; zstandard support disabled") - endif(Zstd_FOUND) + endif(zstd_FOUND) endif(ENABLE_ZSTD) if (COMMONCRYPTO_FOUND) @@ -209,18 +258,18 @@ if (COMMONCRYPTO_FOUND) elseif (WINDOWS_CRYPTO_FOUND) set(HAVE_CRYPTO 1) set(HAVE_WINDOWS_CRYPTO 1) -elseif (GNUTLS_FOUND AND NETTLE_FOUND) - set(HAVE_CRYPTO 1) - set(HAVE_GNUTLS 1) elseif (OPENSSL_FOUND) set(HAVE_CRYPTO 1) set(HAVE_OPENSSL 1) +elseif (GNUTLS_FOUND AND NETTLE_FOUND) + set(HAVE_CRYPTO 1) + set(HAVE_GNUTLS 1) elseif (MBEDTLS_FOUND) set(HAVE_CRYPTO 1) set(HAVE_MBEDTLS 1) endif() -if (NOT HAVE_CRYPTO) +if ((ENABLE_COMMONCRYPTO OR ENABLE_GNUTLS OR ENABLE_MBEDTLS OR ENABLE_OPENSSL OR ENABLE_WINDOWS_CRYPTO) AND NOT HAVE_CRYPTO) message(WARNING "-- neither Common Crypto, GnuTLS, mbed TLS, OpenSSL, nor Windows Cryptography found; AES support disabled") endif() @@ -263,10 +312,10 @@ else(BUILD_TOOLS) endif(BUILD_REGRESS) endif() -include(FindPerl) +find_program(NIHTEST nihtest) -if(NOT PERL_FOUND) - message(WARNING "-- perl not found, regression testing disabled") +if(BUILD_REGRESS AND NOT NIHTEST) + message(WARNING "-- nihtest not found, regression testing disabled") set(BUILD_REGRESS OFF) endif() @@ -280,11 +329,12 @@ endif() # pkgconfig file -set(prefix ${CMAKE_INSTALL_PREFIX}) -set(exec_prefix \${prefix}) -SET(bindir ${CMAKE_INSTALL_FULL_BINDIR}) -SET(libdir ${CMAKE_INSTALL_FULL_LIBDIR}) -SET(includedir ${CMAKE_INSTALL_FULL_INCLUDEDIR}) +file(RELATIVE_PATH pc_relative_bindir ${CMAKE_INSTALL_PREFIX} ${CMAKE_INSTALL_FULL_BINDIR}) +set(bindir "\${prefix}/${pc_relative_bindir}") +file(RELATIVE_PATH pc_relative_libdir ${CMAKE_INSTALL_PREFIX} ${CMAKE_INSTALL_FULL_LIBDIR}) +set(libdir "\${prefix}/${pc_relative_libdir}") +file(RELATIVE_PATH pc_relative_includedir ${CMAKE_INSTALL_PREFIX} ${CMAKE_INSTALL_FULL_INCLUDEDIR}) +set(includedir "\${prefix}/${pc_relative_includedir}") if(CMAKE_SYSTEM_NAME MATCHES BSD) set(PKG_CONFIG_RPATH "-Wl,-R\${libdir}") endif(CMAKE_SYSTEM_NAME MATCHES BSD) @@ -296,10 +346,14 @@ foreach(LIB ${LIBS_PRIVATE}) endif() set(LIBS "${LIBS} -l${LIB}") endforeach() +STRING(CONCAT zlib_link_name "-l" ${ZLIB_LINK_LIBRARY_NAME}) string(REGEX REPLACE "-lBZip2::BZip2" "-lbz2" LIBS ${LIBS}) string(REGEX REPLACE "-lLibLZMA::LibLZMA" "-llzma" LIBS ${LIBS}) +if(ENABLE_ZSTD) + string(REGEX REPLACE "-l${zstd_TARGET}" "-lzstd" LIBS ${LIBS}) +endif() string(REGEX REPLACE "-lOpenSSL::Crypto" "-lssl -lcrypto" LIBS ${LIBS}) -string(REGEX REPLACE "-lZLIB::ZLIB" "-lz" LIBS ${LIBS}) +string(REGEX REPLACE "-lZLIB::ZLIB" ${zlib_link_name} LIBS ${LIBS}) string(REGEX REPLACE "-lGnuTLS::GnuTLS" "-lgnutls" LIBS ${LIBS}) string(REGEX REPLACE "-lNettle::Nettle" "-lnettle" LIBS ${LIBS}) configure_file(libzip.pc.in libzip.pc @ONLY) @@ -409,17 +463,6 @@ set(srcdir ${CMAKE_CURRENT_SOURCE_DIR}/regress) set(abs_srcdir ${CMAKE_CURRENT_SOURCE_DIR}/regress) set(top_builddir ${PROJECT_BINARY_DIR}) # used to find config.h -configure_file(regress/nihtest.conf.in ${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/nihtest.conf @ONLY) -file(COPY ${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/nihtest.conf - DESTINATION ${PROJECT_BINARY_DIR}/regress - FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE) - -configure_file(regress/runtest.in ${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/runtest @ONLY) -file(COPY ${PROJECT_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/runtest - DESTINATION ${PROJECT_BINARY_DIR}/regress - FILE_PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE GROUP_READ GROUP_EXECUTE WORLD_READ WORLD_EXECUTE - ) - # create package config file include(CMakePackageConfigHelpers) write_basic_package_version_file("${PROJECT_BINARY_DIR}/${PROJECT_NAME}-config-version.cmake" @@ -428,6 +471,15 @@ write_basic_package_version_file("${PROJECT_BINARY_DIR}/${PROJECT_NAME}-config-v configure_package_config_file("${PROJECT_NAME}-config.cmake.in" "${PROJECT_BINARY_DIR}/${PROJECT_NAME}-config.cmake" INSTALL_DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/libzip) +# Install Find* modules, they are required by libzip-config.cmake to resolve dependencies +install(FILES + ${CMAKE_CURRENT_SOURCE_DIR}/cmake/FindNettle.cmake + ${CMAKE_CURRENT_SOURCE_DIR}/cmake/Findzstd.cmake + ${CMAKE_CURRENT_SOURCE_DIR}/cmake/FindMbedTLS.cmake + DESTINATION + ${CMAKE_INSTALL_LIBDIR}/cmake/libzip/modules + ) + if(LIBZIP_DO_INSTALL) # Add targets to the build-tree export set export(TARGETS zip @@ -442,4 +494,3 @@ if(LIBZIP_DO_INSTALL) DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME} ) endif() - diff --git a/core/deps/libzip/INSTALL.md b/core/deps/libzip/INSTALL.md index 512768cf5..83f1d97db 100644 --- a/core/deps/libzip/INSTALL.md +++ b/core/deps/libzip/INSTALL.md @@ -1,7 +1,5 @@ libzip uses [cmake](https://cmake.org) to build. -For running the tests, you need to have [perl](https://www.perl.org). - You'll need [zlib](http://www.zlib.net/) (at least version 1.1.2). It comes with most operating systems. @@ -18,15 +16,19 @@ For AES (encryption) support, you need one of these cryptographic libraries, listed in order of preference: - Apple's CommonCrypto (available on macOS and iOS) +- Microsoft Windows Cryptography Framework +- [OpenSSL](https://www.openssl.org/) >= 1.0. - [GnuTLS](https://www.gnutls.org/) and [Nettle](https://www.lysator.liu.se/~nisse/nettle/) (at least nettle 3.0) - [mbed TLS](https://tls.mbed.org/) -- [OpenSSL](https://www.openssl.org/) >= 1.0. -- Microsoft Windows Cryptography Framework If you don't want a library even if it is installed, you can pass `-DENABLE_=OFF` to cmake, where `` is one of `COMMONCRYPTO`, `GNUTLS`, `MBEDTLS`, or `OPENSSL`. +For running the tests, you need to have +[Python](https://www.python.org/) and +[nihtest](https://pypi.org/project/nihtest/) installed. + The basic usage is ```sh mkdir build @@ -48,7 +50,7 @@ Some useful parameters you can pass to `cmake` with `-Dparameter=value`: - `LIBZIP_DO_INSTALL`: If you include libzip as a subproject, link it statically and do not want to let it install its files, set this variable to `OFF`. Defaults to `ON`. - + If you want to compile with custom `CFLAGS`, set them in the environment before running `cmake`: ```sh @@ -66,4 +68,4 @@ will break in `zipcmp`. You can get verbose build output with by passing `VERBOSE=1` to `make`. -You can also check the [cmake FAQ](https://cmake.org/Wiki/CMake_FAQ). +You can also check the [cmake FAQ](https://gitlab.kitware.com/cmake/community/-/wikis/FAQ). diff --git a/core/deps/libzip/LICENSE b/core/deps/libzip/LICENSE index 573d5d94d..fa7060961 100644 --- a/core/deps/libzip/LICENSE +++ b/core/deps/libzip/LICENSE @@ -1,6 +1,6 @@ Copyright (C) 1999-2020 Dieter Baron and Thomas Klausner -The authors can be contacted at +The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/core/deps/libzip/NEWS.md b/core/deps/libzip/NEWS.md index ea1dd9ff4..e117422d8 100644 --- a/core/deps/libzip/NEWS.md +++ b/core/deps/libzip/NEWS.md @@ -1,32 +1,81 @@ -1.8.0 [2020-xx-xx] -================== +# 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] -================== +# 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] -================== + +# 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] -================== + +# 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] -================== + +# 1.7.0 [2020-06-05] * Add support for encrypting using traditional PKWare encryption. * Add `zip_compression_method_supported()`. @@ -35,13 +84,13 @@ * Refactor stdio file backend. * Add CMake find_project() support. -1.6.1 [2020-02-03] -================== + +# 1.6.1 [2020-02-03] * Bugfix for double-free in `zipcmp(1)` during cleanup. -1.6.0 [2020-01-24] -================== + +# 1.6.0 [2020-01-24] * Avoid using `umask()` since it's not thread-safe. * Set close-on-exec flag when opening files. @@ -50,8 +99,8 @@ * 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] -================== + +# 1.5.2 [2019-03-12] * Fix bug in AES encryption affecting certain file sizes * Keep file permissions when modifying zip archives @@ -59,8 +108,8 @@ * Support mbed TLS as crypto backend. * Add nullability annotations. -1.5.1 [2018-04-11] -================== + +# 1.5.1 [2018-04-11] * Choose format of installed documentation based on available tools. * Fix visibility of symbols. @@ -70,16 +119,16 @@ * Fix build with LibreSSL. * Various bugfixes. -1.5.0 [2018-03-11] -================== + +# 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] -================== + +# 1.4.0 [2017-12-29] * Improve build with cmake * Retire autoconf/automake build system @@ -88,20 +137,20 @@ Supported for buffer sources and on Apple File System. * Add support for Microsoft Universal Windows Platform. -1.3.2 [2017-11-20] -================== + +# 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] -================== + +# 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] -================== + +# 1.3.0 [2017-09-02] * Support bzip2 compressed zip archives * Improve file progress callback code @@ -109,8 +158,8 @@ * CVE-2017-12858: Fix double free() * CVE-2017-14107: Improve EOCD64 parsing -1.2.0 [2017-02-19] -================== + +# 1.2.0 [2017-02-19] * Support for AES encryption (Winzip version), both encryption and decryption @@ -120,24 +169,24 @@ * 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] -================== + +# 1.1.3 [2016-05-28] * Fix build on Windows when using autoconf -1.1.2 [2016-02-19] -================== + +# 1.1.2 [2016-02-19] * Improve support for 3MF files -1.1.1 [2016-02-07] -================== + +# 1.1.1 [2016-02-07] * Build fixes for Linux * Fix some warnings reported by PVS-Studio -1.1 [2016-01-26] -================ + +# 1.1 [2016-01-26] * ziptool(1): command line tool to modify zip archives * Speedups for archives with many entries @@ -148,13 +197,13 @@ * Portability fixes * Documentation improvements -1.0.1 [2015-05-04] -================== + +# 1.0.1 [2015-05-04] * Build fixes for Windows -1.0 [2015-05-03] -================ + +# 1.0 [2015-05-03] * Implemented an I/O abstraction layer * Added support for native Windows API for files @@ -165,22 +214,22 @@ * CVE-2015-2331 was fixed * Addressed all Coverity CIDs -0.11.2 [2013-12-19] -=================== + +# 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] -=================== + +# 0.11.1 [2013-04-27] * Fix bugs in zip_set_file_compression() * Include Xcode build infrastructure -0.11 [2013-03-23] -================= + +# 0.11 [2013-03-23] * Added Zip64 support (large file support) * Added UTF-8 support for file names, file comments, and archive comments @@ -194,14 +243,14 @@ * More changes for Windows support * Additional test cases -0.10.1 [2012-03-20] -=================== + +# 0.10.1 [2012-03-20] * Fixed CVE-2012-1162 * Fixed CVE-2012-1163 -0.10 [2010-03-18] -================= + +# 0.10 [2010-03-18] * Added zip_get_num_entries(), deprecated zip_get_num_files() * Better windows support @@ -213,27 +262,27 @@ * Fixed CVE-2011-0421 (no security implications though) * More documentation -0.9.3 [2010-02-01] -================== + +# 0.9.3 [2010-02-01] * Include m4/ directory in distribution; some packagers need it -0.9.2 [2010-01-31] -================== + +# 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] -================== + +# 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] -================== + +# 0.9 [2008-07-25] * on Windows, explicitly set dllimport/dllexport * remove erroneous references to GPL @@ -242,8 +291,8 @@ * zip_source_zip: add flag to force recompression * zip_sorce_file: only keep file open while reading from it -0.8 [2007-06-06] -================== + +# 0.8 [2007-06-06] * fix for zip archives larger than 2GiB * fix zip_error_strerror to include libzip error string @@ -251,13 +300,13 @@ * 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] -================== + +# 0.7.1 [2006-05-18] * bugfix for zip_close -0.7 [2006-05-06] -================ + +# 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) @@ -266,13 +315,13 @@ 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] -================== + +# 0.6.1 [2005-07-14] * various bug fixes -0.6 [2005-06-09] -================ + +# 0.6 [2005-06-09] * first standalone release * changed license to three-clause BSD diff --git a/core/deps/libzip/README.md b/core/deps/libzip/README.md index 9262c3def..2ca60e1d7 100644 --- a/core/deps/libzip/README.md +++ b/core/deps/libzip/README.md @@ -3,7 +3,7 @@ zip and zip64 archives. Files can be added from data buffers, files, or compressed data copied directly from other zip archives. Changes made without closing the archive can be reverted. Decryption and encryption of Winzip AES and legacy PKware encrypted files is -supported. The API is documented by man pages. +supported. libzip is fully documented via man pages. HTML versions of the man pages are on [libzip.org](https://libzip.org/documentation/) and @@ -13,13 +13,13 @@ lists all others. Example source code is in the [examples](examples) and [src](src) subdirectories. +See the [INSTALL.md](INSTALL.md) file for installation instructions and +dependencies. + If you have developed an application using libzip, you can find out about API changes and how to adapt your code for them in the included file [API-CHANGES.md](API-CHANGES.md). -See the [INSTALL.md](INSTALL.md) file for installation instructions and -dependencies. - If you make a binary distribution, please include a pointer to the distribution site: > https://libzip.org/ @@ -27,13 +27,8 @@ distribution site: The latest version can always be found there. The official repository is at [github](https://github.com/nih-at/libzip/). -There is a mailing list for developers using libzip. You can -subscribe to it by sending a mail with the subject "subscribe -libzip-discuss" to minimalist at nih.at. List mail should be sent -to libzip-discuss at nih.at. Use this for bug reports or questions. - -If you want to reach the authors in private, use . +If you want to reach the authors in private, use . -[![Travis Build Status](https://api.travis-ci.org/nih-at/libzip.svg?branch=master)](https://travis-ci.org/nih-at/libzip) +[![Github Actions Build Status](https://github.com/nih-at/libzip/workflows/build/badge.svg)](https://github.com/nih-at/libzip/actions?query=workflow%3Abuild) [![Appveyor Build status](https://ci.appveyor.com/api/projects/status/f1bqqt9djvf22f5g?svg=true)](https://ci.appveyor.com/project/nih-at/libzip) [![Coverity Status](https://scan.coverity.com/projects/127/badge.svg)](https://scan.coverity.com/projects/libzip) diff --git a/core/deps/libzip/SECURITY.md b/core/deps/libzip/SECURITY.md new file mode 100644 index 000000000..67c84eb1d --- /dev/null +++ b/core/deps/libzip/SECURITY.md @@ -0,0 +1,13 @@ +# Security Policy + +## Supported Versions + +We are not maintaining multiple branches, so all fixes will be committed to head and included in the next release. + +We take great care to maintain backwards compatibility, so we expect our users to use the latest version. + +## Reporting a Vulnerability + +You can reach us per email at info@libzip.org. + +For less sensitive reports, you can also open an issue or pull request on GitHub. diff --git a/core/deps/libzip/THANKS b/core/deps/libzip/THANKS index b7e4497f6..d36ecc9e5 100644 --- a/core/deps/libzip/THANKS +++ b/core/deps/libzip/THANKS @@ -3,10 +3,13 @@ and some other general information gathered from their sources. Thanks to these people for suggestions, testing, and bug reports: +ag2s20150909 Agostino Sarubbo +Alberto Spin Alexander Galanin Alexandr Shadchin Alexey Bykov +Andreas Deininger Andreas Falkenhahn Andrew Brampton Andrew Molyneux @@ -19,36 +22,50 @@ Beuc Boaz Stolk Bogdan Brian 'geeknik' Carpenter +BruceFan Carl Mastrangelo Cédric Tabin celan69 +chaoticgd Charlie Li Chris Nehren Christoph Cullmann Christoph M. Becker Coverity +cryi +ctenter-scs Dane Springmeyer +Daniel Russel Ларионов Даниил David Demelier Dean Ellis Declan Moran Del Merritt +Devin Davila Dmytro Rybachenko +Dylan T. +Eelco Dolstra Elvis Angelaccio Erwin Haid Eun-cheol Joo Fabrice Fontaine +Filip Niksic Florian Delizy Force Charlie François Simon Frederik Ramm +Gabriela Gutierrez +Gerard ODonnell +Giovanni gk7huki Hanno Böck HeeMyung Heiko Becker Heiko Hund +hongjunwang Ilya Voronin Info-ZIP group +Ivan Kolesnikov Jan Weiß Jay Freeman (saurik) jloqfjgk@github @@ -56,24 +73,35 @@ Joachim Reichel João Custódio Joel Ebrahimi Jono Spiro +Julien Matthey Julien Schueller +Justin Cohen kensington Keith Jones Khaled Mardam-Bey Kohei Yoshida +Krzesimir Nowak Leith Bade Lubomir I. Ivanov +Lucas Bustamante +Ludovic LANGE +M. Reiningħaus Maël Nison +Manuel Massing +Marcin Kowalczyk +Mark A. Tsuchida Martin Buchholz Martin Herkt Martin Szulecki Michael Balzer Michael Beck +Michael Heimpold Michał Janiszewski Michal Vyskocil Mikhail Gusarov . Miklos Vajna Morris Hafner +Muhammad Arslan Kabeer Oliver Kaiser Oliver Kuckertz OSS-Fuzz Team @@ -84,34 +112,51 @@ Paul Harris Paul Sheppard Pavel Raiskup Pierre Joye +Pierre Wendling Pierre-Louis Cabelguen +PW Hu +Rafał Mikrut +ralfjunker Randy Remi Collet +rezso Richard Schütz Rick Carback Rikard Falkeborn Robert Norris Roberto Tirabassi +robhz786 Roland Ortloff Rosen Penev +Rudi Heitbaum Ryan Burns +Sam Sappenfield +scribam Sebastian Kemper Sebastian Schmitt Sergei Ozerov +shenlebantongying +Shimi Simon Talbot +SpaceIm Stephen Bryant Tabata Shintaro Tarmo Pikaro Taylor C. Richberger TC +Thomas Debesse Tim Lunn Timo Warns +Timofey Tom Callaway Tomas Hoger Tomáš Malý Torsten Paul Transporter Vassili Courzakis +Vinpasso +Vitaly Murashev William Lee +William Ouwehand Wojciech Michalski Wolfgang Glunz diff --git a/core/deps/libzip/TODO.md b/core/deps/libzip/TODO.md index bd81107ac..3eeba6156 100644 --- a/core/deps/libzip/TODO.md +++ b/core/deps/libzip/TODO.md @@ -1,3 +1,14 @@ +### Torrentzip + +- Handle data sources with unknown uncompressed size. +- Handle when uncompressed size < 4GB but compressed size > 4GB. + +## Other + +- split `zip_source_t` in main part and reference so we can keep track which reference called open and we can invalidate references if the underlying source gets invalidated (e. g. by `zip_close`). +- Support extended timestamp extra field (0x5455): mtime overrides dos mtime from dirent, function to get/set all three. +- Check UTF-8 code against https://www.cl.cam.ac.uk/~mgk25/ucs/examples/UTF-8-test.txt + ## Prefixes For example for adding extractors for self-extracting zip archives. @@ -13,6 +24,8 @@ const zip_uint8_t *zip_get_archive_prefix(struct zip *za, zip_uint64_t *lengthp) ## API Issues +* Add `zip_file_use_password` to set per-file password to use if libzip needs to decrypt the file (e.g. when changing encryption or compression method). + * `zip_get_archive_comment` has `int *lenp` argument. Cleaner would be `zip_uint32_t *`. rename and fix. which other functions for naming consistency? * rename remaining `zip_XXX_{file,archive}_*` to `zip_{file,archive}_XXX_*`? @@ -21,7 +34,6 @@ const zip_uint8_t *zip_get_archive_prefix(struct zip *za, zip_uint64_t *lengthp) ## Features -* add seek support for AES-encrypted files * consistently use `_zip_crypto_clear()` for passwords * support setting extra fields from `zip_source` * introduce layers of extra fields: @@ -75,6 +87,7 @@ const zip_uint8_t *zip_get_archive_prefix(struct zip *za, zip_uint64_t *lengthp) ## Documentation +* document valid file paths * document: `zip_source_write()`: length can't be > `ZIP_INT64_MAX` * document: `ZIP_SOURCE_CLOSE` implementation can't return error * keep error codes in man pages in sync @@ -82,11 +95,12 @@ const zip_uint8_t *zip_get_archive_prefix(struct zip *za, zip_uint64_t *lengthp) ## Infrastructure +* add coverage reports, e.g. using gcovr or https://github.com/eddyxu/cpp-coveralls (coveralls.io) * review guidelines/community standards - [Linux Foundation Core Infrastructure Initiative Best Practices](https://bestpractices.coreinfrastructure.org/) - [Readme Maturity Level](https://github.com/LappleApple/feedmereadmes/blob/master/README-maturity-model.md) - [Github Community Profile](https://github.com/nih-at/libzip/community) -* test different crypto backends with TravisCI. +* test different crypto backends with GitHub actions. * improve man page formatting of tagged lists on webpage (`
`) * rewrite `make_zip_errors.sh` in cmake * script to check if all exported symbols are marked with `ZIP_EXTERN`, add to `make distcheck` @@ -97,6 +111,8 @@ const zip_uint8_t *zip_get_archive_prefix(struct zip *za, zip_uint64_t *lengthp) ## Test Case Issues +* add test cases for all `ZIP_INCONS` detail errors +* `incons-local-filename-short.zzip` doesn't test short filename, since extra fields fail to parse. * test error cases with special source - tell it which command should fail - use it both as source for `zip_add` and `zip_open_from_source` @@ -113,14 +129,14 @@ const zip_uint8_t *zip_get_archive_prefix(struct zip *za, zip_uint64_t *lengthp) - state of source (opened, EOF reached, ...) * test for zipcmp reading directory (requires fts) * add test case for clone with files > 4k -* consider testing for malloc/realloc failures +* consider testing for `malloc`/`realloc` failures * Winzip AES support * test cases decryption: <=20, >20, stat for both * test cases encryption: no password, default password, file-specific password, 128/192/256, <=20, >20 * support testing on macOS * add test cases for lots of files (including too many) * add test cases for holes (between files, between files and cdir, between cdir and eocd, + zip64 where appropriate) -* test seek in `zip_source_crc()` +* test seek in `zip_source_crc_create()` * test cases for `set_extra*`, `delete_extra*`, `*extra_field*` * test cases for in memory archives * add @@ -150,7 +166,7 @@ const zip_uint8_t *zip_get_archive_prefix(struct zip *za, zip_uint64_t *lengthp) * close * zipcmp copy expected * remove copy -* (`error_get) +* (`error_get`) * (`error_get_sys_type`) * (`error_to_str`) * (`extra_fields`) @@ -170,3 +186,4 @@ const zip_uint8_t *zip_get_archive_prefix(struct zip *za, zip_uint64_t *lengthp) * I/O abstraction layer * `zip_open_from_source` * read two zip entries interleaved +* test `zip_file_is_seekable` (via `ziptool`?) diff --git a/core/deps/libzip/android/do.sh b/core/deps/libzip/android/do.sh index c4641c9f2..0c72242af 100644 --- a/core/deps/libzip/android/do.sh +++ b/core/deps/libzip/android/do.sh @@ -20,7 +20,7 @@ build_it() want_shared=$1 cmake -DCMAKE_TOOLCHAIN_FILE=${ANDROID_NDK_ROOT}/build/cmake/android.toolchain.cmake \ - -DCMAKE_INSTALL_PREFIX:PATH=../../${INSTALL_DIR}/${ANDROID_TARGET_PLATFORM} \ + -DCMAKE_INSTALL_PREFIX:PATH=$(pwd)/../../${INSTALL_DIR}/${ANDROID_TARGET_PLATFORM} \ -DANDROID_ABI=${ANDROID_TARGET_PLATFORM} \ -DENABLE_OPENSSL:BOOL=OFF \ -DENABLE_COMMONCRYPTO:BOOL=OFF \ diff --git a/core/deps/libzip/android/readme.txt b/core/deps/libzip/android/readme.txt index aa69fbd45..dadc4b479 100644 --- a/core/deps/libzip/android/readme.txt +++ b/core/deps/libzip/android/readme.txt @@ -8,3 +8,6 @@ Prerequisites for the development machine - see docker/Dockerfile You can either set you host machine up with these prerequisites or simply use docker (in which case you need not install anything on your host machine except docker itself). See "Usage" in docker/Dockerfile for detailed instructions. + + +Please note: The libzip development team does not use Android, so this script is provided as is, as we cannot properly maintain it. We will, however, gladly accept fixes and try to work with users to resolve any issues they may have. diff --git a/core/deps/libzip/appveyor.yml b/core/deps/libzip/appveyor.yml new file mode 100644 index 000000000..609f1a60a --- /dev/null +++ b/core/deps/libzip/appveyor.yml @@ -0,0 +1,90 @@ +os: +- Visual Studio 2019 + +environment: + PATH: C:\Python311-x64\Scripts;C:\Python311-arm\Scripts;$(PATH) + matrix: + - GENERATOR: "Visual Studio 16 2019" + PLATFORM: x64 + TRIPLET: x64-windows + CMAKE_OPTS: "-DBUILD_SHARED_LIBS=off" + CMAKE_CONFIG: Release + RUN_TESTS: yes + TOXENV: py311 + - GENERATOR: "Visual Studio 16 2019" + PLATFORM: x64 + TRIPLET: x64-uwp + CMAKE_OPTS: "-DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION=10.0" + CMAKE_CONFIG: Release + RUN_TESTS: no + TOXENV: py311 + - GENERATOR: "Visual Studio 16 2019" + PLATFORM: Win32 + TRIPLET: x86-windows + CMAKE_OPTS: "-DBUILD_SHARED_LIBS=off" + CMAKE_CONFIG: Release + RUN_TESTS: yes + TOXENV: py311 + - GENERATOR: "Visual Studio 16 2019" + PLATFORM: Win32 + TRIPLET: x86-uwp + CMAKE_OPTS: "-DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION=10.0" + CMAKE_CONFIG: Release + RUN_TESTS: no + TOXENV: py311 + - GENERATOR: "Visual Studio 16 2019" + PLATFORM: ARM + TRIPLET: arm-windows + CMAKE_OPTS: "-DENABLE_OPENSSL=off" + CMAKE_CONFIG: Release + RUN_TESTS: no + TOXENV: py311 + - GENERATOR: "Visual Studio 16 2019" + PLATFORM: ARM + TRIPLET: arm-uwp + CMAKE_OPTS: "-DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION=10.0 -DENABLE_OPENSSL=off" + CMAKE_CONFIG: Release + RUN_TESTS: no + TOXENV: py311 + - GENERATOR: "Visual Studio 16 2019" + PLATFORM: ARM64 + TRIPLET: arm64-windows + CMAKE_OPTS: "-DENABLE_OPENSSL=off" + CMAKE_CONFIG: Release + RUN_TESTS: no + TOXENV: py311 + - GENERATOR: "Visual Studio 16 2019" + PLATFORM: ARM64 + TRIPLET: arm64-uwp + CMAKE_OPTS: "-DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION=10.0 -DENABLE_OPENSSL=off" + CMAKE_CONFIG: Release + RUN_TESTS: no + TOXENV: py311 + +before_build: + cmd: >- + py -m pip install nihtest + + vcpkg install zlib:%TRIPLET% bzip2:%TRIPLET% liblzma:%TRIPLET% zstd:%TRIPLET% + + mkdir build + + cd build + + cmake -DCMAKE_TOOLCHAIN_FILE=C:/tools/vcpkg/scripts/buildsystems/vcpkg.cmake .. -G "%GENERATOR%" -A "%PLATFORM%" %CMAKE_OPTS% + + appveyor PushArtifact config.h + + appveyor PushArtifact CMakeCache.txt + +build_script: + cmd: >- + cmake --build . --config %CMAKE_CONFIG% --target INSTALL + + cmake --build . --config %CMAKE_CONFIG% + +test_script: + cmd: >- + set VERBOSE=yes + + IF %RUN_TESTS%==yes ( ctest -C %CMAKE_CONFIG% --output-on-failure ) diff --git a/core/deps/libzip/cmake-config.h.in b/core/deps/libzip/cmake-config.h.in index b234acba9..630ed23f6 100644 --- a/core/deps/libzip/cmake-config.h.in +++ b/core/deps/libzip/cmake-config.h.in @@ -4,6 +4,7 @@ #include "zipconf.h" #endif /* BEGIN DEFINES */ +#cmakedefine ENABLE_FDOPEN #cmakedefine HAVE___PROGNAME #cmakedefine HAVE__CLOSE #cmakedefine HAVE__DUP @@ -11,11 +12,12 @@ #cmakedefine HAVE__FILENO #cmakedefine HAVE__SETMODE #cmakedefine HAVE__SNPRINTF +#cmakedefine HAVE__SNPRINTF_S +#cmakedefine HAVE__SNWPRINTF_S #cmakedefine HAVE__STRDUP #cmakedefine HAVE__STRICMP #cmakedefine HAVE__STRTOI64 #cmakedefine HAVE__STRTOUI64 -#cmakedefine HAVE__UMASK #cmakedefine HAVE__UNLINK #cmakedefine HAVE_ARC4RANDOM #cmakedefine HAVE_CLONEFILE @@ -23,6 +25,7 @@ #cmakedefine HAVE_CRYPTO #cmakedefine HAVE_FICLONERANGE #cmakedefine HAVE_FILENO +#cmakedefine HAVE_FCHMOD #cmakedefine HAVE_FSEEKO #cmakedefine HAVE_FTELLO #cmakedefine HAVE_GETPROGNAME @@ -31,14 +34,21 @@ #cmakedefine HAVE_LIBLZMA #cmakedefine HAVE_LIBZSTD #cmakedefine HAVE_LOCALTIME_R +#cmakedefine HAVE_LOCALTIME_S +#cmakedefine HAVE_MEMCPY_S #cmakedefine HAVE_MBEDTLS #cmakedefine HAVE_MKSTEMP #cmakedefine HAVE_NULLABLE #cmakedefine HAVE_OPENSSL #cmakedefine HAVE_SETMODE +#cmakedefine HAVE_SNPRINTF +#cmakedefine HAVE_SNPRINTF_S #cmakedefine HAVE_STRCASECMP #cmakedefine HAVE_STRDUP +#cmakedefine HAVE_STRERROR_S +#cmakedefine HAVE_STRERRORLEN_S #cmakedefine HAVE_STRICMP +#cmakedefine HAVE_STRNCPY_S #cmakedefine HAVE_STRTOLL #cmakedefine HAVE_STRTOULL #cmakedefine HAVE_STRUCT_TM_TM_ZONE diff --git a/core/deps/libzip/cmake/Dist.cmake b/core/deps/libzip/cmake/Dist.cmake index 829112f44..d2adf9f6c 100644 --- a/core/deps/libzip/cmake/Dist.cmake +++ b/core/deps/libzip/cmake/Dist.cmake @@ -1,6 +1,6 @@ # Copyright (C) 2020 Dieter Baron and Thomas Klausner # -# The authors can be contacted at +# The authors can be contacted at # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -55,14 +55,14 @@ function(Dist ARCHIVE_NAME) if(NOT TARGET dist AND NOT TARGET distcheck) add_custom_target(dist COMMAND git config tar.tar.xz.command "xz -c" - COMMAND git archive --prefix=${ARCHIVE_NAME}/ -o ${ARCHIVE_NAME}.tar.gz HEAD - COMMAND git archive --prefix=${ARCHIVE_NAME}/ -o ${ARCHIVE_NAME}.tar.xz HEAD + COMMAND git archive --prefix=${ARCHIVE_NAME}/ -o ${CMAKE_BINARY_DIR}/${ARCHIVE_NAME}.tar.gz HEAD + COMMAND git archive --prefix=${ARCHIVE_NAME}/ -o ${CMAKE_BINARY_DIR}/${ARCHIVE_NAME}.tar.xz HEAD WORKING_DIRECTORY ${CMAKE_SOURCE_DIR} ) add_custom_target(distcheck COMMAND chmod -R u+w ${ARCHIVE_NAME} ${ARCHIVE_NAME}-build ${ARCHIVE_NAME}-dest 2>/dev/null || true COMMAND rm -rf ${ARCHIVE_NAME} ${ARCHIVE_NAME}-build ${ARCHIVE_NAME}-dest - COMMAND ${CMAKE_COMMAND} -E tar xf ${ARCHIVE_NAME}.tar.gz + COMMAND ${CMAKE_COMMAND} -E tar xf ${CMAKE_BINARY_DIR}/${ARCHIVE_NAME}.tar.gz COMMAND chmod -R u-w ${ARCHIVE_NAME} COMMAND mkdir ${ARCHIVE_NAME}-build COMMAND mkdir ${ARCHIVE_NAME}-dest diff --git a/core/deps/libzip/cmake/FindMbedTLS.cmake b/core/deps/libzip/cmake/FindMbedTLS.cmake index 244b0c57c..5a6ef9d73 100644 --- a/core/deps/libzip/cmake/FindMbedTLS.cmake +++ b/core/deps/libzip/cmake/FindMbedTLS.cmake @@ -1,6 +1,6 @@ # Copyright (C) 2020 Dieter Baron and Thomas Klausner # -# The authors can be contacted at +# The authors can be contacted at # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -85,7 +85,16 @@ find_library(MbedTLS_LIBRARY # Extract version information from the header file if(MbedTLS_INCLUDE_DIR) - if(EXISTS ${MbedTLS_INCLUDE_DIR}/mbedtls/version.h) + # for major version 3 + if(EXISTS ${MbedTLS_INCLUDE_DIR}/mbedtls/build_info.h) + file(STRINGS ${MbedTLS_INCLUDE_DIR}/mbedtls/build_info.h _ver_line + REGEX "^#define MBEDTLS_VERSION_STRING *\"[0-9]+\\.[0-9]+\\.[0-9]+\"" + LIMIT_COUNT 1) + string(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+" + MbedTLS_VERSION "${_ver_line}") + unset(_ver_line) + # for major version 2 + elseif(EXISTS ${MbedTLS_INCLUDE_DIR}/mbedtls/version.h) file(STRINGS ${MbedTLS_INCLUDE_DIR}/mbedtls/version.h _ver_line REGEX "^#define MBEDTLS_VERSION_STRING *\"[0-9]+\\.[0-9]+\\.[0-9]+\"" LIMIT_COUNT 1) diff --git a/core/deps/libzip/cmake/FindNettle.cmake b/core/deps/libzip/cmake/FindNettle.cmake index 982ac81ee..8f0deb014 100644 --- a/core/deps/libzip/cmake/FindNettle.cmake +++ b/core/deps/libzip/cmake/FindNettle.cmake @@ -1,6 +1,6 @@ # Copyright (C) 2020 Dieter Baron and Thomas Klausner # -# The authors can be contacted at +# The authors can be contacted at # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions diff --git a/core/deps/libzip/cmake/FindZstd.cmake b/core/deps/libzip/cmake/FindZstd.cmake deleted file mode 100644 index a0da50381..000000000 --- a/core/deps/libzip/cmake/FindZstd.cmake +++ /dev/null @@ -1,135 +0,0 @@ -# Copyright (C) 2020 Dieter Baron and Thomas Klausner -# -# The authors can be contacted at -# -# 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. -# -# 3. The names of the authors may not be used to endorse or promote -# products derived from this software without specific prior -# written permission. -# -# THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``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 AUTHORS 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. - -#[=======================================================================[.rst: -FindZstd -------- - -Finds the Zstandard (zstd) library. - -Imported Targets -^^^^^^^^^^^^^^^^ - -This module provides the following imported targets, if found: - -``Zstd::Zstd`` - The Zstandard library - -Result Variables -^^^^^^^^^^^^^^^^ - -This will define the following variables: - -``Zstd_FOUND`` - True if the system has the Zstandard library. -``Zstd_VERSION`` - The version of the Zstandard library which was found. -``Zstd_INCLUDE_DIRS`` - Include directories needed to use Zstandard. -``Zstd_LIBRARIES`` - Libraries needed to link to Zstandard. - -Cache Variables -^^^^^^^^^^^^^^^ - -The following cache variables may also be set: - -``Zstd_INCLUDE_DIR`` - The directory containing ``zstd.h``. -``Zstd_LIBRARY`` - The path to the Zstandard library. - -#]=======================================================================] - -find_package(PkgConfig) -pkg_check_modules(PC_Zstd QUIET zstd) - -find_path(Zstd_INCLUDE_DIR - NAMES zstd.h - PATHS ${PC_Zstd_INCLUDE_DIRS} -) -find_library(Zstd_LIBRARY - NAMES zstd - PATHS ${PC_Zstd_LIBRARY_DIRS} -) - -# Extract version information from the header file -if(Zstd_INCLUDE_DIR) - file(STRINGS ${Zstd_INCLUDE_DIR}/zstd.h _ver_major_line - REGEX "^#define ZSTD_VERSION_MAJOR *[0-9]+" - LIMIT_COUNT 1) - string(REGEX MATCH "[0-9]+" - Zstd_MAJOR_VERSION "${_ver_major_line}") - file(STRINGS ${Zstd_INCLUDE_DIR}/zstd.h _ver_minor_line - REGEX "^#define ZSTD_VERSION_MINOR *[0-9]+" - LIMIT_COUNT 1) - string(REGEX MATCH "[0-9]+" - Zstd_MINOR_VERSION "${_ver_minor_line}") - file(STRINGS ${Zstd_INCLUDE_DIR}/zstd.h _ver_release_line - REGEX "^#define ZSTD_VERSION_RELEASE *[0-9]+" - LIMIT_COUNT 1) - string(REGEX MATCH "[0-9]+" - Zstd_RELEASE_VERSION "${_ver_release_line}") - set(Zstd_VERSION "${Zstd_MAJOR_VERSION}.${Zstd_MINOR_VERSION}.${Zstd_RELEASE_VERSION}") - unset(_ver_major_line) - unset(_ver_minor_line) - unset(_ver_release_line) -endif() - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(Zstd - FOUND_VAR Zstd_FOUND - REQUIRED_VARS - Zstd_LIBRARY - Zstd_INCLUDE_DIR - VERSION_VAR Zstd_VERSION -) - -if(Zstd_FOUND) - set(Zstd_LIBRARIES ${Zstd_LIBRARY}) - set(Zstd_INCLUDE_DIRS ${Zstd_INCLUDE_DIR}) - set(Zstd_DEFINITIONS ${PC_Zstd_CFLAGS_OTHER}) -endif() - -if(Zstd_FOUND AND NOT TARGET Zstd::Zstd) - add_library(Zstd::Zstd UNKNOWN IMPORTED) - set_target_properties(Zstd::Zstd PROPERTIES - IMPORTED_LOCATION "${Zstd_LIBRARY}" - INTERFACE_COMPILE_OPTIONS "${PC_Zstd_CFLAGS_OTHER}" - INTERFACE_INCLUDE_DIRECTORIES "${Zstd_INCLUDE_DIR}" - ) -endif() - -mark_as_advanced( - Zstd_INCLUDE_DIR - Zstd_LIBRARY -) diff --git a/core/deps/libzip/cmake/Findzstd.cmake b/core/deps/libzip/cmake/Findzstd.cmake new file mode 100644 index 000000000..b389c6b3d --- /dev/null +++ b/core/deps/libzip/cmake/Findzstd.cmake @@ -0,0 +1,186 @@ +# Copyright (C) 2020 Dieter Baron and Thomas Klausner +# +# The authors can be contacted at +# +# 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. +# +# 3. The names of the authors may not be used to endorse or promote +# products derived from this software without specific prior +# written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``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 AUTHORS 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. + +#[=======================================================================[.rst: +Findzstd +------- + +Finds the Zstandard (zstd) library. + +Imported Targets +^^^^^^^^^^^^^^^^ + +This module provides the following imported targets, if found: + +``zstd::libzstd_shared`` + The shared Zstandard library +``zstd::libzstd_static`` + The shared Zstandard library + +Result Variables +^^^^^^^^^^^^^^^^ + +This will define the following variables: + +``zstd_FOUND`` + True if the system has the Zstandard library. +``zstd_VERSION`` + The version of the Zstandard library which was found. + +Cache Variables +^^^^^^^^^^^^^^^ + +The following cache variables may also be set: + +``zstd_INCLUDE_DIR`` + The directory containing ``zstd.h``. +``zstd_STATIC_LIBRARY`` + The path to the Zstandard static library. +``zstd_SHARED_LIBRARY`` + The path to the Zstandard shared library. +``zstd_DLL`` + The path to the Zstandard DLL. + +#]=======================================================================] + +find_package(PkgConfig) +pkg_check_modules(PC_zstd QUIET libzstd) + +find_path(zstd_INCLUDE_DIR + NAMES zstd.h + HINTS ${PC_zstd_INCLUDE_DIRS} +) + +find_file(zstd_DLL + NAMES libzstd.dll zstd.dll + PATH_SUFFIXES bin + HINTS ${PC_zstd_PREFIX} +) + +# On Windows, we manually define the library names to avoid mistaking the +# implib for the static library +if(zstd_DLL) + set(_zstd_win_static_name zstd-static) + set(_zstd_win_shared_name zstd) +else() + # vcpkg removes the -static suffix in static builds + set(_zstd_win_static_name zstd zstd_static) + set(_zstd_win_shared_name) +endif() + +set(_previous_suffixes ${CMAKE_FIND_LIBRARY_SUFFIXES}) +set(CMAKE_FIND_LIBRARY_SUFFIXES ".so" ".dylib" ".dll.a" ".lib") +find_library(zstd_SHARED_LIBRARY + NAMES zstd ${_zstd_win_shared_name} + HINTS ${PC_zstd_LIBDIR} +) + +set(CMAKE_FIND_LIBRARY_SUFFIXES ".a" ".lib") +find_library(zstd_STATIC_LIBRARY + NAMES zstd ${_zstd_win_static_name} + HINTS ${PC_zstd_LIBDIR} +) +set(CMAKE_FIND_LIBRARY_SUFFIXES ${_previous_suffixes}) + +# Set zstd_LIBRARY to the shared library or fall back to the static library +if(zstd_SHARED_LIBRARY) + set(_zstd_LIBRARY ${zstd_SHARED_LIBRARY}) +else() + set(_zstd_LIBRARY ${zstd_STATIC_LIBRARY}) +endif() + +# Extract version information from the header file +if(zstd_INCLUDE_DIR) + file(STRINGS ${zstd_INCLUDE_DIR}/zstd.h _ver_major_line + REGEX "^#define ZSTD_VERSION_MAJOR *[0-9]+" + LIMIT_COUNT 1) + string(REGEX MATCH "[0-9]+" + zstd_MAJOR_VERSION "${_ver_major_line}") + file(STRINGS ${zstd_INCLUDE_DIR}/zstd.h _ver_minor_line + REGEX "^#define ZSTD_VERSION_MINOR *[0-9]+" + LIMIT_COUNT 1) + string(REGEX MATCH "[0-9]+" + zstd_MINOR_VERSION "${_ver_minor_line}") + file(STRINGS ${zstd_INCLUDE_DIR}/zstd.h _ver_release_line + REGEX "^#define ZSTD_VERSION_RELEASE *[0-9]+" + LIMIT_COUNT 1) + string(REGEX MATCH "[0-9]+" + zstd_RELEASE_VERSION "${_ver_release_line}") + set(Zstd_VERSION "${zstd_MAJOR_VERSION}.${zstd_MINOR_VERSION}.${zstd_RELEASE_VERSION}") + unset(_ver_major_line) + unset(_ver_minor_line) + unset(_ver_release_line) +endif() + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(zstd + FOUND_VAR zstd_FOUND + REQUIRED_VARS + _zstd_LIBRARY + zstd_INCLUDE_DIR + VERSION_VAR zstd_VERSION +) + +if(zstd_FOUND AND zstd_SHARED_LIBRARY AND NOT TARGET zstd::libzstd_shared) + add_library(zstd::libzstd_shared SHARED IMPORTED) + if(WIN32) + set_target_properties(zstd::libzstd_shared PROPERTIES + IMPORTED_LOCATION "${zstd_DLL}" + IMPORTED_IMPLIB "${zstd_SHARED_LIBRARY}" + ) + else() + set_target_properties(zstd::libzstd_shared PROPERTIES + IMPORTED_LOCATION "${zstd_SHARED_LIBRARY}" + ) + endif() + + set_target_properties(zstd::libzstd_shared PROPERTIES + INTERFACE_COMPILE_OPTIONS "${PC_zstd_CFLAGS_OTHER}" + INTERFACE_INCLUDE_DIRECTORIES "${zstd_INCLUDE_DIR}" + ) +endif() + +if(zstd_FOUND AND zstd_STATIC_LIBRARY AND NOT TARGET zstd::libzstd_static) + add_library(zstd::libzstd_static STATIC IMPORTED) + set_target_properties(zstd::libzstd_static PROPERTIES + IMPORTED_LOCATION "${zstd_STATIC_LIBRARY}" + INTERFACE_COMPILE_OPTIONS "${PC_zstd_CFLAGS_OTHER}" + INTERFACE_INCLUDE_DIRECTORIES "${zstd_INCLUDE_DIR}" + ) +endif() + +mark_as_advanced( + zstd_INCLUDE_DIR + zstd_DLL + zstd_SHARED_LIBRARY + zstd_STATIC_LIBRARY +) diff --git a/core/deps/libzip/cmake/GenerateZipErrorStrings.cmake b/core/deps/libzip/cmake/GenerateZipErrorStrings.cmake new file mode 100644 index 000000000..550412b6c --- /dev/null +++ b/core/deps/libzip/cmake/GenerateZipErrorStrings.cmake @@ -0,0 +1,47 @@ +# create zip_err_str.c from zip.h and zipint.h +file(READ ${PROJECT_SOURCE_DIR}/lib/zip.h zip_h) +string(REGEX MATCHALL "#define ZIP_ER_([A-Z0-9_]+) ([0-9]+)[ \t]+/([-*0-9a-zA-Z, ']*)/" zip_h_err ${zip_h}) +file(READ ${PROJECT_SOURCE_DIR}/lib/zipint.h zipint_h) +string(REGEX MATCHALL "#define ZIP_ER_DETAIL_([A-Z0-9_]+) ([0-9]+)[ \t]+/([-*0-9a-zA-Z, ']*)/" zipint_h_err ${zipint_h}) +set(zip_err_str [=[ +/* + This file was generated automatically by CMake + from zip.h and zipint.h\; make changes there. +*/ + +#include "zipint.h" + +#define L ZIP_ET_LIBZIP +#define N ZIP_ET_NONE +#define S ZIP_ET_SYS +#define Z ZIP_ET_ZLIB + +#define E ZIP_DETAIL_ET_ENTRY +#define G ZIP_DETAIL_ET_GLOBAL + +const struct _zip_err_info _zip_err_str[] = { +]=]) +set(zip_err_type) +foreach(errln ${zip_h_err}) + string(REGEX MATCH "#define ZIP_ER_([A-Z0-9_]+) ([0-9]+)[ \t]+/([-*0-9a-zA-Z, ']*)/" err_t_tt ${errln}) + string(REGEX MATCH "([L|N|S|Z]+) ([-0-9a-zA-Z,, ']*)" err_t_tt "${CMAKE_MATCH_3}") + string(STRIP "${CMAKE_MATCH_2}" err_t_tt) + string(APPEND zip_err_str " { ${CMAKE_MATCH_1}, \"${err_t_tt}\" },\n") +endforeach() +string(APPEND zip_err_str [=[}\; + +const int _zip_err_str_count = sizeof(_zip_err_str)/sizeof(_zip_err_str[0])\; + +const struct _zip_err_info _zip_err_details[] = { +]=]) +foreach(errln ${zipint_h_err}) + string(REGEX MATCH "#define ZIP_ER_DETAIL_([A-Z0-9_]+) ([0-9]+)[ \t]+/([-*0-9a-zA-Z, ']*)/" err_t_tt ${errln}) + string(REGEX MATCH "([E|G]+) ([-0-9a-zA-Z, ']*)" err_t_tt "${CMAKE_MATCH_3}") + string(STRIP "${CMAKE_MATCH_2}" err_t_tt) + string(APPEND zip_err_str " { ${CMAKE_MATCH_1}, \"${err_t_tt}\" },\n") +endforeach() +string(APPEND zip_err_str [=[}\; + +const int _zip_err_details_count = sizeof(_zip_err_details)/sizeof(_zip_err_details[0])\; +]=]) +file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/zip_err_str.c ${zip_err_str}) diff --git a/core/deps/libzip/developer-xcode/Info.plist b/core/deps/libzip/developer-xcode/Info.plist deleted file mode 100644 index 4cc3a77e5..000000000 --- a/core/deps/libzip/developer-xcode/Info.plist +++ /dev/null @@ -1,46 +0,0 @@ - - - - - CFBundleDevelopmentRegion - English - CFBundleExecutable - ${EXECUTABLE_NAME} - CFBundleIconFile - - CFBundleIdentifier - $(PRODUCT_BUNDLE_IDENTIFIER) - CFBundleInfoDictionaryVersion - 6.0 - CFBundleName - ${PRODUCT_NAME} - CFBundlePackageType - BNDL - CFBundleShortVersionString - PACKAGE_VERSION - CFBundleSignature - ???? - CFBundleVersion - 1 - CFPlugInDynamicRegisterFunction - - CFPlugInDynamicRegistration - NO - CFPlugInFactories - - 00000000-0000-0000-0000-000000000000 - MyFactoryFunction - - CFPlugInTypes - - 00000000-0000-0000-0000-000000000000 - - 00000000-0000-0000-0000-000000000000 - - - CFPlugInUnloadFunction - - NSHumanReadableCopyright - Copyright © 2014 Dieter Baron and Thomas Klausner - - diff --git a/core/deps/libzip/developer-xcode/README Xcode Project.md b/core/deps/libzip/developer-xcode/README Xcode Project.md deleted file mode 100644 index 8ae1f65bb..000000000 --- a/core/deps/libzip/developer-xcode/README Xcode Project.md +++ /dev/null @@ -1,6 +0,0 @@ -This Xcode project is for development only, it is not meant to -compile production builds. - -It is used internally to develop libzip and to run Xcode's diagnostic -tools on the source, and is not always kept up-to-date. Please use -the standard build method instead. diff --git a/core/deps/libzip/developer-xcode/config.h b/core/deps/libzip/developer-xcode/config.h deleted file mode 100644 index a89b2fe2f..000000000 --- a/core/deps/libzip/developer-xcode/config.h +++ /dev/null @@ -1,94 +0,0 @@ -#ifndef HAD_CONFIG_H -#define HAD_CONFIG_H -#ifndef _HAD_ZIPCONF_H -#include "zipconf.h" -#endif -/* BEGIN DEFINES */ -/* #undef HAVE___PROGNAME */ -/* #undef HAVE__CHMOD */ -/* #undef HAVE__CLOSE */ -/* #undef HAVE__DUP */ -/* #undef HAVE__FDOPEN */ -/* #undef HAVE__FILENO */ -/* #undef HAVE__OPEN */ -/* #undef HAVE__SETMODE */ -/* #undef HAVE__SNPRINTF */ -/* #undef HAVE__STRDUP */ -/* #undef HAVE__STRICMP */ -/* #undef HAVE__STRTOI64 */ -/* #undef HAVE__STRTOUI64 */ -/* #undef HAVE__UMASK */ -/* #undef HAVE__UNLINK */ -#define HAVE_ARC4RANDOM -#define HAVE_CLONEFILE -#define HAVE_COMMONCRYPTO -#define HAVE_CRYPTO -/* #undef HAVE_FICLONERANGE */ -#define HAVE_FILENO -#define HAVE_FSEEKO -#define HAVE_FTELLO -#define HAVE_GETPROGNAME -/* #undef HAVE_GNUTLS */ -#define HAVE_LIBBZ2 -#define HAVE_LIBLZMA -#define HAVE_LOCALTIME_R -/* #undef HAVE_MBEDTLS */ -/* #undef HAVE_MKSTEMP */ -#define HAVE_NULLABLE -#define HAVE_OPEN -/* #undef HAVE_OPENSSL */ -#define HAVE_SETMODE -#define HAVE_SSIZE_T_LIBZIP -#define HAVE_STRCASECMP -#define HAVE_STRDUP -/* #undef HAVE_STRICMP */ -#define HAVE_STRTOLL -#define HAVE_STRTOULL -/* #undef HAVE_STRUCT_TM_TM_ZONE */ -#define HAVE_STDBOOL_H -#define HAVE_STRINGS_H -#define HAVE_UNISTD_H -/* #undef HAVE_WINDOWS_CRYPTO */ -/* #undef __INT8_LIBZIP */ -#define INT8_T_LIBZIP 1 -#define UINT8_T_LIBZIP 1 -/* #undef __INT16_LIBZIP */ -#define INT16_T_LIBZIP 2 -#define UINT16_T_LIBZIP 2 -/* #undef __INT32_LIBZIP */ -#define INT32_T_LIBZIP 4 -#define UINT32_T_LIBZIP 4 -/* #undef __INT64_LIBZIP */ -#define INT64_T_LIBZIP 8 -#define UINT64_T_LIBZIP 8 -#define SHORT_LIBZIP 2 -#define INT_LIBZIP 4 -#define LONG_LIBZIP 8 -#define LONG_LONG_LIBZIP 8 -#define SIZEOF_OFF_T 8 -#define SIZE_T_LIBZIP 8 -#define SSIZE_T_LIBZIP 8 -/* #undef HAVE_DIRENT_H */ -#define HAVE_FTS_H -/* #undef HAVE_NDIR_H */ -/* #undef HAVE_SYS_DIR_H */ -/* #undef HAVE_SYS_NDIR_H */ -/* #undef WORDS_BIGENDIAN */ -#define HAVE_SHARED -/* END DEFINES */ -#define PACKAGE "libzip" -#define VERSION "1.5.2a" - -#ifndef HAVE_SSIZE_T_LIBZIP -#if SIZE_T_LIBZIP == INT_LIBZIP -typedef int ssize_t; -#elif SIZE_T_LIBZIP == LONG_LIBZIP -typedef long ssize_t; -#elif SIZE_T_LIBZIP == LONG_LONG_LIBZIP -typedef long long ssize_t; -#else -#error no suitable type for ssize_t found -#endif -#endif - -#endif /* HAD_CONFIG_H */ diff --git a/core/deps/libzip/developer-xcode/extract-version.sh b/core/deps/libzip/developer-xcode/extract-version.sh deleted file mode 100644 index 85e83fcb3..000000000 --- a/core/deps/libzip/developer-xcode/extract-version.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/sh - -# Replace the value for PLIST_KEY with the resolved definition from the header file that was passed in. - -SOURCE_HEADER_FILE_PATH=$1 -SOURCE_PLIST_PATH=$2 - -PLIST_KEY="CFBundleShortVersionString" - -VERSION_KEY=`/usr/libexec/PlistBuddy -c "Print :${PLIST_KEY}" "${SOURCE_PLIST_PATH}"` - -#echo "Key: ${VERSION_KEY}" - -VERSION_NUM=`cat "${SOURCE_HEADER_FILE_PATH}" | sed -n "s|#define ${VERSION_KEY} \"\(.*\)\".*|\1|p"` - -#echo "Value: ${VERSION_NUM}" - -TARGET_PLIST_PATH="${TARGET_BUILD_DIR}/${INFOPLIST_PATH}" - -/usr/libexec/PlistBuddy -c "Set :${PLIST_KEY} ${VERSION_NUM}" "${TARGET_PLIST_PATH}" diff --git a/core/deps/libzip/developer-xcode/libzip.xcodeproj/project.pbxproj b/core/deps/libzip/developer-xcode/libzip.xcodeproj/project.pbxproj deleted file mode 100644 index 8e7d23b2f..000000000 --- a/core/deps/libzip/developer-xcode/libzip.xcodeproj/project.pbxproj +++ /dev/null @@ -1,2934 +0,0 @@ -// !$*UTF8*$! -{ - archiveVersion = 1; - classes = { - }; - objectVersion = 46; - objects = { - -/* Begin PBXAggregateTarget section */ - 4B01D72815B2F5A2002D5007 /* command line tools */ = { - isa = PBXAggregateTarget; - buildConfigurationList = 4B01D72915B2F5A2002D5007 /* Build configuration list for PBXAggregateTarget "command line tools" */; - buildPhases = ( - ); - dependencies = ( - 4B2CADAC1C50D57800291DE6 /* PBXTargetDependency */, - 4B01D72D15B2F5AC002D5007 /* PBXTargetDependency */, - 4B01D72F15B2F5AC002D5007 /* PBXTargetDependency */, - ); - name = "command line tools"; - productName = "command line tools"; - }; - 4B54447915C977A20067BA33 /* all */ = { - isa = PBXAggregateTarget; - buildConfigurationList = 4B54447C15C977A20067BA33 /* Build configuration list for PBXAggregateTarget "all" */; - buildPhases = ( - ); - dependencies = ( - 4BCF6A7B1C3BDDFF00F036E9 /* PBXTargetDependency */, - 4B54447F15C977AF0067BA33 /* PBXTargetDependency */, - 4B54448115C977B10067BA33 /* PBXTargetDependency */, - ); - name = all; - productName = all; - }; - 4BACD5A715BC2D8200920691 /* test programs */ = { - isa = PBXAggregateTarget; - buildConfigurationList = 4BACD5AE15BC2D8200920691 /* Build configuration list for PBXAggregateTarget "test programs" */; - buildPhases = ( - ); - dependencies = ( - 4BFF2B531FE13002006EF3F3 /* PBXTargetDependency */, - 4BD6CB6E19E71D0800710654 /* PBXTargetDependency */, - 4BACD65515BC303B00920691 /* PBXTargetDependency */, - 4BACD65715BC303B00920691 /* PBXTargetDependency */, - 4BACD65915BC303B00920691 /* PBXTargetDependency */, - 4BACD66915BC303B00920691 /* PBXTargetDependency */, - 4B51DDC51FDAE2F000C5CA85 /* PBXTargetDependency */, - ); - name = "test programs"; - productName = "test programs"; - }; - 4BCF6A681C3BDDD500F036E9 /* examples */ = { - isa = PBXAggregateTarget; - buildConfigurationList = 4BCF6A751C3BDDD500F036E9 /* Build configuration list for PBXAggregateTarget "examples" */; - buildPhases = ( - ); - dependencies = ( - 4BCF6A791C3BDDF900F036E9 /* PBXTargetDependency */, - ); - name = examples; - productName = examples; - }; -/* End PBXAggregateTarget section */ - -/* Begin PBXBuildFile section */ - 3D7E35431B33063F00022624 /* in-memory.c in Sources */ = {isa = PBXBuildFile; fileRef = 3D7E35401B33063600022624 /* in-memory.c */; }; - 3D7E35461B33064B00022624 /* libzip.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4B01D68B15B2F3F1002D5007 /* libzip.framework */; }; - 3D7E35481B33076C00022624 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 3D7E35471B33076C00022624 /* libz.dylib */; }; - 3D7E35491B330AD500022624 /* zip_source_is_deleted.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BE402AC19D94AE400298248 /* zip_source_is_deleted.c */; }; - 3D9284821C309510001EABA7 /* zip_hash.c in Sources */ = {isa = PBXBuildFile; fileRef = 3D9284801C309510001EABA7 /* zip_hash.c */; }; - 4B00CA24242F59D700E0B71C /* zip_source_pkware_decode.c in Sources */ = {isa = PBXBuildFile; fileRef = 4B00CA21242F59D700E0B71C /* zip_source_pkware_decode.c */; }; - 4B00CA25242F59D700E0B71C /* zip_pkware.c in Sources */ = {isa = PBXBuildFile; fileRef = 4B00CA22242F59D700E0B71C /* zip_pkware.c */; }; - 4B00CA26242F59D700E0B71C /* zip_source_pkware_encode.c in Sources */ = {isa = PBXBuildFile; fileRef = 4B00CA23242F59D700E0B71C /* zip_source_pkware_encode.c */; }; - 4B00CA2D242F5C2500E0B71C /* set_file_dostime.test in Resources */ = {isa = PBXBuildFile; fileRef = 4B00CA27242F5C2500E0B71C /* set_file_dostime.test */; }; - 4B00CA2E242F5C2500E0B71C /* cancel_45.test in Resources */ = {isa = PBXBuildFile; fileRef = 4B00CA28242F5C2500E0B71C /* cancel_45.test */; }; - 4B00CA2F242F5C2500E0B71C /* set_compression_store_to_xz.test in Resources */ = {isa = PBXBuildFile; fileRef = 4B00CA29242F5C2500E0B71C /* set_compression_store_to_xz.test */; }; - 4B00CA30242F5C2500E0B71C /* encryption-nonrandom-pkware.test in Resources */ = {isa = PBXBuildFile; fileRef = 4B00CA2A242F5C2500E0B71C /* encryption-nonrandom-pkware.test */; }; - 4B00CA31242F5C2500E0B71C /* cancel_90.test in Resources */ = {isa = PBXBuildFile; fileRef = 4B00CA2B242F5C2500E0B71C /* cancel_90.test */; }; - 4B00CA32242F5C2500E0B71C /* set_compression_xz_to_store.test in Resources */ = {isa = PBXBuildFile; fileRef = 4B00CA2C242F5C2500E0B71C /* set_compression_xz_to_store.test */; }; - 4B01D6A615B2F46B002D5007 /* zip_add_dir.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC71F115B1B25E00236D3C /* zip_add_dir.c */; }; - 4B01D6A715B2F46B002D5007 /* zip_add_entry.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC71F215B1B25E00236D3C /* zip_add_entry.c */; }; - 4B01D6A815B2F46B002D5007 /* zip_add.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC71F315B1B25E00236D3C /* zip_add.c */; }; - 4B01D6A915B2F46B002D5007 /* zip_close.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC71F415B1B25E00236D3C /* zip_close.c */; }; - 4B01D6AA15B2F46B002D5007 /* zip_delete.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC71F515B1B25E00236D3C /* zip_delete.c */; }; - 4B01D6AB15B2F46B002D5007 /* zip_dir_add.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC71F615B1B25E00236D3C /* zip_dir_add.c */; }; - 4B01D6AC15B2F46B002D5007 /* zip_dirent.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC71F715B1B25E00236D3C /* zip_dirent.c */; }; - 4B01D6AD15B2F46B002D5007 /* zip_discard.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC71F815B1B25E00236D3C /* zip_discard.c */; }; - 4B01D6AE15B2F46B002D5007 /* zip_entry.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC71F915B1B25E00236D3C /* zip_entry.c */; }; - 4B01D6B015B2F46B002D5007 /* zip_error_clear.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC71FB15B1B25E00236D3C /* zip_error_clear.c */; }; - 4B01D6B115B2F46B002D5007 /* zip_error_get_sys_type.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC71FC15B1B25E00236D3C /* zip_error_get_sys_type.c */; }; - 4B01D6B215B2F46B002D5007 /* zip_error_get.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC71FD15B1B25E00236D3C /* zip_error_get.c */; }; - 4B01D6B315B2F46B002D5007 /* zip_error_strerror.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC71FE15B1B25E00236D3C /* zip_error_strerror.c */; }; - 4B01D6B415B2F46B002D5007 /* zip_error_to_str.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC71FF15B1B25E00236D3C /* zip_error_to_str.c */; }; - 4B01D6B515B2F46B002D5007 /* zip_error.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC720015B1B25E00236D3C /* zip_error.c */; }; - 4B01D6B615B2F46B002D5007 /* zip_extra_field_api.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC720115B1B25E00236D3C /* zip_extra_field_api.c */; }; - 4B01D6B715B2F46B002D5007 /* zip_extra_field.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC720215B1B25E00236D3C /* zip_extra_field.c */; }; - 4B01D6B815B2F46B002D5007 /* zip_fclose.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC720315B1B25E00236D3C /* zip_fclose.c */; }; - 4B01D6B915B2F46B002D5007 /* zip_fdopen.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC720415B1B25E00236D3C /* zip_fdopen.c */; }; - 4B01D6BA15B2F46B002D5007 /* zip_file_add.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC720515B1B25E00236D3C /* zip_file_add.c */; }; - 4B01D6BB15B2F46B002D5007 /* zip_file_error_clear.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC720615B1B25E00236D3C /* zip_file_error_clear.c */; }; - 4B01D6BC15B2F46B002D5007 /* zip_file_error_get.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC720715B1B25E00236D3C /* zip_file_error_get.c */; }; - 4B01D6BD15B2F46B002D5007 /* zip_file_get_comment.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC720815B1B25E00236D3C /* zip_file_get_comment.c */; }; - 4B01D6BE15B2F46B002D5007 /* zip_file_get_offset.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC720915B1B25E00236D3C /* zip_file_get_offset.c */; }; - 4B01D6BF15B2F46B002D5007 /* zip_file_rename.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC720A15B1B25E00236D3C /* zip_file_rename.c */; }; - 4B01D6C015B2F46B002D5007 /* zip_file_replace.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC720B15B1B25E00236D3C /* zip_file_replace.c */; }; - 4B01D6C115B2F46B002D5007 /* zip_file_set_comment.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC720C15B1B25E00236D3C /* zip_file_set_comment.c */; }; - 4B01D6C215B2F46B002D5007 /* zip_file_strerror.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC720D15B1B25E00236D3C /* zip_file_strerror.c */; }; - 4B01D6C415B2F46B002D5007 /* zip_fopen_encrypted.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC720F15B1B25E00236D3C /* zip_fopen_encrypted.c */; }; - 4B01D6C515B2F46B002D5007 /* zip_fopen_index_encrypted.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC721015B1B25E00236D3C /* zip_fopen_index_encrypted.c */; }; - 4B01D6C615B2F46B002D5007 /* zip_fopen_index.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC721115B1B25E00236D3C /* zip_fopen_index.c */; }; - 4B01D6C715B2F46B002D5007 /* zip_fopen.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC721215B1B25E00236D3C /* zip_fopen.c */; }; - 4B01D6C815B2F46B002D5007 /* zip_fread.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC721315B1B25E00236D3C /* zip_fread.c */; }; - 4B01D6C915B2F46B002D5007 /* zip_get_archive_comment.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC721415B1B25E00236D3C /* zip_get_archive_comment.c */; }; - 4B01D6CA15B2F46B002D5007 /* zip_get_archive_flag.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC721515B1B25E00236D3C /* zip_get_archive_flag.c */; }; - 4B01D6CC15B2F46B002D5007 /* zip_get_encryption_implementation.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC721715B1B25E00236D3C /* zip_get_encryption_implementation.c */; }; - 4B01D6CD15B2F46B002D5007 /* zip_get_file_comment.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC721815B1B25E00236D3C /* zip_get_file_comment.c */; }; - 4B01D6CE15B2F46B002D5007 /* zip_get_name.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC721915B1B25E00236D3C /* zip_get_name.c */; }; - 4B01D6CF15B2F46B002D5007 /* zip_get_num_entries.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC721A15B1B25E00236D3C /* zip_get_num_entries.c */; }; - 4B01D6D015B2F46B002D5007 /* zip_get_num_files.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC721B15B1B25E00236D3C /* zip_get_num_files.c */; }; - 4B01D6D115B2F46B002D5007 /* zip_memdup.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC721C15B1B25E00236D3C /* zip_memdup.c */; }; - 4B01D6D215B2F46B002D5007 /* zip_name_locate.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC721D15B1B25E00236D3C /* zip_name_locate.c */; }; - 4B01D6D315B2F46B002D5007 /* zip_new.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC721E15B1B25E00236D3C /* zip_new.c */; }; - 4B01D6D415B2F46B002D5007 /* zip_open.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC721F15B1B25E00236D3C /* zip_open.c */; }; - 4B01D6D515B2F46B002D5007 /* zip_rename.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC722015B1B25E00236D3C /* zip_rename.c */; }; - 4B01D6D615B2F46B002D5007 /* zip_replace.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC722115B1B25E00236D3C /* zip_replace.c */; }; - 4B01D6D715B2F46B002D5007 /* zip_set_archive_comment.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC722215B1B25E00236D3C /* zip_set_archive_comment.c */; }; - 4B01D6D815B2F46B002D5007 /* zip_set_archive_flag.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC722315B1B25E00236D3C /* zip_set_archive_flag.c */; }; - 4B01D6D915B2F46B002D5007 /* zip_set_default_password.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC722415B1B25E00236D3C /* zip_set_default_password.c */; }; - 4B01D6DA15B2F46B002D5007 /* zip_set_file_comment.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC722515B1B25E00236D3C /* zip_set_file_comment.c */; }; - 4B01D6DB15B2F46B002D5007 /* zip_set_file_compression.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC722615B1B25E00236D3C /* zip_set_file_compression.c */; }; - 4B01D6DC15B2F46B002D5007 /* zip_set_name.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC722715B1B25E00236D3C /* zip_set_name.c */; }; - 4B01D6DD15B2F46B002D5007 /* zip_source_buffer.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC722815B1B25E00236D3C /* zip_source_buffer.c */; }; - 4B01D6DE15B2F46B002D5007 /* zip_source_close.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC722915B1B25E00236D3C /* zip_source_close.c */; }; - 4B01D6DF15B2F46B002D5007 /* zip_source_crc.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC722A15B1B25E00236D3C /* zip_source_crc.c */; }; - 4B01D6E115B2F46B002D5007 /* zip_source_error.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC722C15B1B25E00236D3C /* zip_source_error.c */; }; - 4B01D6E415B2F46B002D5007 /* zip_source_free.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC722F15B1B25E00236D3C /* zip_source_free.c */; }; - 4B01D6E515B2F46B002D5007 /* zip_source_function.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC723015B1B25E00236D3C /* zip_source_function.c */; }; - 4B01D6E615B2F46B002D5007 /* zip_source_layered.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC723115B1B25E00236D3C /* zip_source_layered.c */; }; - 4B01D6E715B2F46B002D5007 /* zip_source_open.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC723215B1B25E00236D3C /* zip_source_open.c */; }; - 4B01D6EA15B2F46B002D5007 /* zip_source_read.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC723515B1B25E00236D3C /* zip_source_read.c */; }; - 4B01D6EB15B2F46B002D5007 /* zip_source_stat.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC723615B1B25E00236D3C /* zip_source_stat.c */; }; - 4B01D6EC15B2F46B002D5007 /* zip_source_window.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC723715B1B25E00236D3C /* zip_source_window.c */; }; - 4B01D6ED15B2F46B002D5007 /* zip_source_zip_new.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC723815B1B25E00236D3C /* zip_source_zip_new.c */; }; - 4B01D6EE15B2F46B002D5007 /* zip_source_zip.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC723915B1B25E00236D3C /* zip_source_zip.c */; }; - 4B01D6EF15B2F46B002D5007 /* zip_stat_index.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC723A15B1B25E00236D3C /* zip_stat_index.c */; }; - 4B01D6F015B2F46B002D5007 /* zip_stat_init.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC723B15B1B25E00236D3C /* zip_stat_init.c */; }; - 4B01D6F115B2F46B002D5007 /* zip_stat.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC723C15B1B25E00236D3C /* zip_stat.c */; }; - 4B01D6F215B2F46B002D5007 /* zip_strerror.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC723D15B1B25E00236D3C /* zip_strerror.c */; }; - 4B01D6F315B2F46B002D5007 /* zip_string.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC723E15B1B25E00236D3C /* zip_string.c */; }; - 4B01D6F415B2F46B002D5007 /* zip_unchange_all.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC723F15B1B25E00236D3C /* zip_unchange_all.c */; }; - 4B01D6F515B2F46B002D5007 /* zip_unchange_archive.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC724015B1B25E00236D3C /* zip_unchange_archive.c */; }; - 4B01D6F615B2F46B002D5007 /* zip_unchange_data.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC724115B1B25E00236D3C /* zip_unchange_data.c */; }; - 4B01D6F715B2F46B002D5007 /* zip_unchange.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC724215B1B25E00236D3C /* zip_unchange.c */; }; - 4B01D6F815B2F46B002D5007 /* zip_utf-8.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BDC724315B1B25E00236D3C /* zip_utf-8.c */; }; - 4B01D70715B2F4C5002D5007 /* libzip.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4B01D68B15B2F3F1002D5007 /* libzip.framework */; }; - 4B01D70915B2F4CF002D5007 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 4B01D70815B2F4CF002D5007 /* libz.dylib */; }; - 4B01D70D15B2F4EB002D5007 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 4B01D70815B2F4CF002D5007 /* libz.dylib */; }; - 4B01D70E15B2F4EB002D5007 /* libzip.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4B01D68B15B2F3F1002D5007 /* libzip.framework */; }; - 4B01D72515B2F57B002D5007 /* zipcmp.c in Sources */ = {isa = PBXBuildFile; fileRef = 4B01D72115B2F572002D5007 /* zipcmp.c */; }; - 4B01D72615B2F57F002D5007 /* zipmerge.c in Sources */ = {isa = PBXBuildFile; fileRef = 4B01D72215B2F572002D5007 /* zipmerge.c */; }; - 4B01D73215B2F5EE002D5007 /* zipconf.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BDC729E15B1B4E900236D3C /* zipconf.h */; settings = {ATTRIBUTES = (Public, ); }; }; - 4B01D73C15B2F6AF002D5007 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 4B01D70815B2F4CF002D5007 /* libz.dylib */; }; - 4B0454BA1E8E3E08002FA1F9 /* zip_source_compress.c in Sources */ = {isa = PBXBuildFile; fileRef = 4B0454B61E8E3DF7002FA1F9 /* zip_source_compress.c */; }; - 4B0454BC1E8E3E24002FA1F9 /* zip_algorithm_bzip2.c in Sources */ = {isa = PBXBuildFile; fileRef = 4B0454B41E8E3DF7002FA1F9 /* zip_algorithm_bzip2.c */; }; - 4B0454BD1E8E3E24002FA1F9 /* zip_algorithm_deflate.c in Sources */ = {isa = PBXBuildFile; fileRef = 4B0454B51E8E3DF7002FA1F9 /* zip_algorithm_deflate.c */; }; - 4B3A5F521DF96EB4005A53A1 /* zip_fseek.c in Sources */ = {isa = PBXBuildFile; fileRef = 4B3A5F4D1DF96D83005A53A1 /* zip_fseek.c */; }; - 4B3A5F531DF96EB4005A53A1 /* zip_ftell.c in Sources */ = {isa = PBXBuildFile; fileRef = 4B3A5F4E1DF96D83005A53A1 /* zip_ftell.c */; }; - 4B3FAE802385C5CC00192D6A /* zip_algorithm_xz.c in Sources */ = {isa = PBXBuildFile; fileRef = 4B3FAE7F2385C5A300192D6A /* zip_algorithm_xz.c */; }; - 4B3FAE822385C79200192D6A /* liblzma.5.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 4B3FAE812385C79200192D6A /* liblzma.5.dylib */; }; - 4B5169A822A7993E00AA4340 /* zip_mkstempm.c in Sources */ = {isa = PBXBuildFile; fileRef = 4B5169A722A7993D00AA4340 /* zip_mkstempm.c */; }; - 4B51DDBA1FDAE20A00C5CA85 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 4B01D70815B2F4CF002D5007 /* libz.dylib */; }; - 4B51DDBB1FDAE20A00C5CA85 /* libzip.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4B01D68B15B2F3F1002D5007 /* libzip.framework */; }; - 4B51DDC11FDAE25B00C5CA85 /* ziptool.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BACD57C15BC2AEF00920691 /* ziptool.c */; }; - 4B51DDC21FDAE25F00C5CA85 /* ziptool_regress.c in Sources */ = {isa = PBXBuildFile; fileRef = 4B51DDB31FDAE1DB00C5CA85 /* ziptool_regress.c */; }; - 4B51DDC31FDAE26600C5CA85 /* source_hole.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BD6CB5C19E6A5D900710654 /* source_hole.c */; }; - 4B542C2C22B12E3900960B38 /* zip_random_unix.c in Sources */ = {isa = PBXBuildFile; fileRef = 736ED9B81E3D688C00C36873 /* zip_random_unix.c */; }; - 4B5D0CD5244B154E006C2E93 /* zip_source_get_file_attributes.c in Sources */ = {isa = PBXBuildFile; fileRef = 4B5D0CD4244B154E006C2E93 /* zip_source_get_file_attributes.c */; }; - 4B69E6EE2032F18B0001EEE7 /* zip_winzip_aes.c in Sources */ = {isa = PBXBuildFile; fileRef = 4B69E6ED2032F1870001EEE7 /* zip_winzip_aes.c */; }; - 4B82CED519915F360097BC18 /* zip_file_set_mtime.c in Sources */ = {isa = PBXBuildFile; fileRef = 4B82CED319915F360097BC18 /* zip_file_set_mtime.c */; }; - 4B908F532385BE6D00886355 /* zip_libzip_version.c in Sources */ = {isa = PBXBuildFile; fileRef = 4B908F502385BE6C00886355 /* zip_libzip_version.c */; }; - 4B908F552385BE6D00886355 /* zip_source_accept_empty.c in Sources */ = {isa = PBXBuildFile; fileRef = 4B908F522385BE6D00886355 /* zip_source_accept_empty.c */; }; - 4B93995A24631B3E00AEBDA4 /* zip_source_file_stdio_named.c in Sources */ = {isa = PBXBuildFile; fileRef = 4B93995524631B3D00AEBDA4 /* zip_source_file_stdio_named.c */; }; - 4B93995B24631B3E00AEBDA4 /* zip_source_file_common.c in Sources */ = {isa = PBXBuildFile; fileRef = 4B93995624631B3E00AEBDA4 /* zip_source_file_common.c */; }; - 4B93995C24631B3E00AEBDA4 /* zip_source_file_stdio.c in Sources */ = {isa = PBXBuildFile; fileRef = 4B93995724631B3E00AEBDA4 /* zip_source_file_stdio.c */; }; - 4B93995D24631B3E00AEBDA4 /* zip_source_file_stdio.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B93995824631B3E00AEBDA4 /* zip_source_file_stdio.h */; }; - 4B93995E24631B3E00AEBDA4 /* zip_source_file.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B93995924631B3E00AEBDA4 /* zip_source_file.h */; }; - 4B972050188EBE85002FAFAD /* zip_file_get_external_attributes.c in Sources */ = {isa = PBXBuildFile; fileRef = 4B97204D188EBE85002FAFAD /* zip_file_get_external_attributes.c */; }; - 4B972052188EBE85002FAFAD /* zip_file_set_external_attributes.c in Sources */ = {isa = PBXBuildFile; fileRef = 4B97204E188EBE85002FAFAD /* zip_file_set_external_attributes.c */; }; - 4B9E577C24C7202000CEE0D6 /* zip_algorithm_zstd.c in Sources */ = {isa = PBXBuildFile; fileRef = 4B9E577A24C7026B00CEE0D6 /* zip_algorithm_zstd.c */; }; - 4B9E578824C9770C00CEE0D6 /* libzstd.1.4.5.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 4B9E578724C9770C00CEE0D6 /* libzstd.1.4.5.dylib */; }; - 4B9E578A24C9779900CEE0D6 /* zip_err_str.c in Sources */ = {isa = PBXBuildFile; fileRef = 4B9E578924C9779900CEE0D6 /* zip_err_str.c */; }; - 4BACD59315BC2CFA00920691 /* libzip.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4B01D68B15B2F3F1002D5007 /* libzip.framework */; }; - 4BACD59415BC2D0800920691 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 4B01D70815B2F4CF002D5007 /* libz.dylib */; }; - 4BACD5BB15BC2DC900920691 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 4B01D70815B2F4CF002D5007 /* libz.dylib */; }; - 4BACD5BC15BC2DC900920691 /* libzip.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4B01D68B15B2F3F1002D5007 /* libzip.framework */; }; - 4BACD5C315BC2DE000920691 /* add_from_filep.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BACD57715BC2AEF00920691 /* add_from_filep.c */; }; - 4BACD5CA15BC2DF200920691 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 4B01D70815B2F4CF002D5007 /* libz.dylib */; }; - 4BACD5CB15BC2DF200920691 /* libzip.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4B01D68B15B2F3F1002D5007 /* libzip.framework */; }; - 4BACD5D215BC2EFE00920691 /* fopen_unchanged.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BACD57A15BC2AEF00920691 /* fopen_unchanged.c */; }; - 4BACD5D915BC2F3700920691 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 4B01D70815B2F4CF002D5007 /* libz.dylib */; }; - 4BACD5DA15BC2F3700920691 /* libzip.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4B01D68B15B2F3F1002D5007 /* libzip.framework */; }; - 4BACD5E115BC2F4500920691 /* fread.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BACD57B15BC2AEF00920691 /* fread.c */; }; - 4BACD64A15BC301300920691 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 4B01D70815B2F4CF002D5007 /* libz.dylib */; }; - 4BACD64B15BC301300920691 /* libzip.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4B01D68B15B2F3F1002D5007 /* libzip.framework */; }; - 4BACD65315BC302500920691 /* tryopen.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BACD58415BC2AEF00920691 /* tryopen.c */; }; - 4BC03FA41FDD6B6F003C7B62 /* zip_source_begin_write_cloning.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BC03FA21FDD6B6F003C7B62 /* zip_source_begin_write_cloning.c */; }; - 4BCB434319E9347E0067FAA3 /* zip_buffer.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BCB434119E9347E0067FAA3 /* zip_buffer.c */; }; - 4BCF3022199A2F820064207B /* zip_io_util.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BCF3019199A2F820064207B /* zip_io_util.c */; }; - 4BCF3024199A2F820064207B /* zip_source_begin_write.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BCF301A199A2F820064207B /* zip_source_begin_write.c */; }; - 4BCF3026199A2F820064207B /* zip_source_commit_write.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BCF301B199A2F820064207B /* zip_source_commit_write.c */; }; - 4BCF3028199A2F820064207B /* zip_source_rollback_write.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BCF301C199A2F820064207B /* zip_source_rollback_write.c */; }; - 4BCF302A199A2F820064207B /* zip_source_seek.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BCF301D199A2F820064207B /* zip_source_seek.c */; }; - 4BCF302C199A2F820064207B /* zip_source_supports.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BCF301E199A2F820064207B /* zip_source_supports.c */; }; - 4BCF302E199A2F820064207B /* zip_source_tell.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BCF301F199A2F820064207B /* zip_source_tell.c */; }; - 4BCF3030199A2F820064207B /* zip_source_write.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BCF3020199A2F820064207B /* zip_source_write.c */; }; - 4BCF3033199ABD3A0064207B /* zip_source_remove.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BCF3031199ABD3A0064207B /* zip_source_remove.c */; }; - 4BCF3037199ABDDA0064207B /* zip_source_seek_write.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BCF3034199ABDDA0064207B /* zip_source_seek_write.c */; }; - 4BCF3039199ABDDA0064207B /* zip_source_tell_write.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BCF3035199ABDDA0064207B /* zip_source_tell_write.c */; }; - 4BD5053419A01BB0007DD28A /* zip_source_call.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BD5053219A0116D007DD28A /* zip_source_call.c */; }; - 4BD6CB6419E71CD100710654 /* source_hole.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BD6CB5C19E6A5D900710654 /* source_hole.c */; }; - 4BD6CB6619E71CD100710654 /* libz.dylib in Frameworks */ = {isa = PBXBuildFile; fileRef = 4B01D70815B2F4CF002D5007 /* libz.dylib */; }; - 4BD6CB6719E71CD100710654 /* libzip.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 4B01D68B15B2F3F1002D5007 /* libzip.framework */; }; - 4BD6CB6F19E71D6900710654 /* hole.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BD6CB5E19E71B3B00710654 /* hole.c */; }; - 4BD7087A1EB1CF73003F351F /* zip_progress.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BD708781EB1CF73003F351F /* zip_progress.c */; }; - 4BE92AA720345E3800509BC8 /* libbz2.tbd in Frameworks */ = {isa = PBXBuildFile; fileRef = 4BE92AA620345E3800509BC8 /* libbz2.tbd */; }; - 4BE92AAD20346B1900509BC8 /* zip_crypto_openssl.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BE92AAA20346B1900509BC8 /* zip_crypto_openssl.h */; }; - 4BE92AB3203597D700509BC8 /* zip_crypto_commoncrypto.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BE92AB0203597D700509BC8 /* zip_crypto_commoncrypto.h */; }; - 4BE92AB5203597D700509BC8 /* zip_crypto_commoncrypto.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BE92AB1203597D700509BC8 /* zip_crypto_commoncrypto.c */; }; - 4BFF2B551FE13033006EF3F3 /* can_clone_file.c in Sources */ = {isa = PBXBuildFile; fileRef = 4BFF2B541FE13033006EF3F3 /* can_clone_file.c */; }; - 736ED9BB1E3D6B6B00C36873 /* zip_source_winzip_aes_decode.c in Sources */ = {isa = PBXBuildFile; fileRef = 736ED9B91E3D688C00C36873 /* zip_source_winzip_aes_decode.c */; }; - 736ED9BC1E3D6B6F00C36873 /* zip_source_winzip_aes_encode.c in Sources */ = {isa = PBXBuildFile; fileRef = 736ED9BA1E3D688C00C36873 /* zip_source_winzip_aes_encode.c */; }; - 736ED9BF1E3D6B7C00C36873 /* zip_file_set_encryption.c in Sources */ = {isa = PBXBuildFile; fileRef = 736ED9B71E3D688C00C36873 /* zip_file_set_encryption.c */; }; -/* End PBXBuildFile section */ - -/* Begin PBXContainerItemProxy section */ - 3D7E35441B33064500022624 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 4BDC71BF15B181DA00236D3C /* Project object */; - proxyType = 1; - remoteGlobalIDString = 4B01D68A15B2F3F1002D5007; - remoteInfo = libzip; - }; - 4B01D72C15B2F5AC002D5007 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 4BDC71BF15B181DA00236D3C /* Project object */; - proxyType = 1; - remoteGlobalIDString = 4B01D6FC15B2F4B1002D5007; - remoteInfo = zipmerge; - }; - 4B01D72E15B2F5AC002D5007 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 4BDC71BF15B181DA00236D3C /* Project object */; - proxyType = 1; - remoteGlobalIDString = 4B01D70A15B2F4EB002D5007; - remoteInfo = zipcmp; - }; - 4B01D73515B2F639002D5007 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 4BDC71BF15B181DA00236D3C /* Project object */; - proxyType = 1; - remoteGlobalIDString = 4B01D68A15B2F3F1002D5007; - remoteInfo = "libzip Mac"; - }; - 4B01D73715B2F643002D5007 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 4BDC71BF15B181DA00236D3C /* Project object */; - proxyType = 1; - remoteGlobalIDString = 4B01D68A15B2F3F1002D5007; - remoteInfo = "libzip Mac"; - }; - 4B2CADAB1C50D57800291DE6 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 4BDC71BF15B181DA00236D3C /* Project object */; - proxyType = 1; - remoteGlobalIDString = 4BACD58815BC2CEA00920691; - remoteInfo = ziptool; - }; - 4B51DDB61FDAE20A00C5CA85 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 4BDC71BF15B181DA00236D3C /* Project object */; - proxyType = 1; - remoteGlobalIDString = 4B01D68A15B2F3F1002D5007; - remoteInfo = "libzip Mac"; - }; - 4B51DDC41FDAE2F000C5CA85 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 4BDC71BF15B181DA00236D3C /* Project object */; - proxyType = 1; - remoteGlobalIDString = 4B51DDB41FDAE20A00C5CA85; - remoteInfo = ziptool_regress; - }; - 4B54447E15C977AF0067BA33 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 4BDC71BF15B181DA00236D3C /* Project object */; - proxyType = 1; - remoteGlobalIDString = 4B01D72815B2F5A2002D5007; - remoteInfo = "command line tools"; - }; - 4B54448015C977B10067BA33 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 4BDC71BF15B181DA00236D3C /* Project object */; - proxyType = 1; - remoteGlobalIDString = 4BACD5A715BC2D8200920691; - remoteInfo = "test programs"; - }; - 4BACD59615BC2D3800920691 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 4BDC71BF15B181DA00236D3C /* Project object */; - proxyType = 1; - remoteGlobalIDString = 4B01D68A15B2F3F1002D5007; - remoteInfo = "libzip Mac"; - }; - 4BACD5B715BC2DC900920691 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 4BDC71BF15B181DA00236D3C /* Project object */; - proxyType = 1; - remoteGlobalIDString = 4B01D68A15B2F3F1002D5007; - remoteInfo = "libzip Mac"; - }; - 4BACD5C615BC2DF200920691 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 4BDC71BF15B181DA00236D3C /* Project object */; - proxyType = 1; - remoteGlobalIDString = 4B01D68A15B2F3F1002D5007; - remoteInfo = "libzip Mac"; - }; - 4BACD5D515BC2F3700920691 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 4BDC71BF15B181DA00236D3C /* Project object */; - proxyType = 1; - remoteGlobalIDString = 4B01D68A15B2F3F1002D5007; - remoteInfo = "libzip Mac"; - }; - 4BACD64715BC301300920691 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 4BDC71BF15B181DA00236D3C /* Project object */; - proxyType = 1; - remoteGlobalIDString = 4B01D68A15B2F3F1002D5007; - remoteInfo = "libzip Mac"; - }; - 4BACD65415BC303B00920691 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 4BDC71BF15B181DA00236D3C /* Project object */; - proxyType = 1; - remoteGlobalIDString = 4BACD5B515BC2DC900920691; - remoteInfo = add_from_filep; - }; - 4BACD65615BC303B00920691 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 4BDC71BF15B181DA00236D3C /* Project object */; - proxyType = 1; - remoteGlobalIDString = 4BACD5C415BC2DF200920691; - remoteInfo = fopen_unchanged; - }; - 4BACD65815BC303B00920691 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 4BDC71BF15B181DA00236D3C /* Project object */; - proxyType = 1; - remoteGlobalIDString = 4BACD5D315BC2F3700920691; - remoteInfo = fread; - }; - 4BACD66815BC303B00920691 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 4BDC71BF15B181DA00236D3C /* Project object */; - proxyType = 1; - remoteGlobalIDString = 4BACD64515BC301300920691; - remoteInfo = tryopen; - }; - 4BCF6A781C3BDDF900F036E9 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 4BDC71BF15B181DA00236D3C /* Project object */; - proxyType = 1; - remoteGlobalIDString = 3D7E35361B3305FB00022624; - remoteInfo = "in-memory"; - }; - 4BCF6A7A1C3BDDFF00F036E9 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 4BDC71BF15B181DA00236D3C /* Project object */; - proxyType = 1; - remoteGlobalIDString = 4BCF6A681C3BDDD500F036E9; - remoteInfo = examples; - }; - 4BD6CB6119E71CD100710654 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 4BDC71BF15B181DA00236D3C /* Project object */; - proxyType = 1; - remoteGlobalIDString = 4B01D68A15B2F3F1002D5007; - remoteInfo = "libzip Mac"; - }; - 4BD6CB6D19E71D0800710654 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 4BDC71BF15B181DA00236D3C /* Project object */; - proxyType = 1; - remoteGlobalIDString = 4BD6CB5F19E71CD100710654; - remoteInfo = hole; - }; - 4BFF2B521FE13002006EF3F3 /* PBXContainerItemProxy */ = { - isa = PBXContainerItemProxy; - containerPortal = 4BDC71BF15B181DA00236D3C /* Project object */; - proxyType = 1; - remoteGlobalIDString = 4BFF2B451FE12FCA006EF3F3; - remoteInfo = can_clone_file; - }; -/* End PBXContainerItemProxy section */ - -/* Begin PBXCopyFilesBuildPhase section */ - 3D7E35351B3305FB00022624 /* CopyFiles */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = /usr/share/man/man1/; - dstSubfolderSpec = 0; - files = ( - ); - runOnlyForDeploymentPostprocessing = 1; - }; - 4B01D6FB15B2F4B1002D5007 /* CopyFiles */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = /usr/share/man/man1/; - dstSubfolderSpec = 0; - files = ( - ); - runOnlyForDeploymentPostprocessing = 1; - }; - 4B01D70F15B2F4EB002D5007 /* CopyFiles */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 2147483647; - dstPath = /usr/share/man/man1/; - dstSubfolderSpec = 0; - files = ( - ); - runOnlyForDeploymentPostprocessing = 1; - }; - 4B51DDBC1FDAE20A00C5CA85 /* CopyFiles */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 12; - dstPath = /usr/share/man/man1/; - dstSubfolderSpec = 0; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 4BACD58715BC2CEA00920691 /* CopyFiles */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 12; - dstPath = /usr/share/man/man1/; - dstSubfolderSpec = 0; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 4BACD5BD15BC2DC900920691 /* CopyFiles */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 12; - dstPath = /usr/share/man/man1/; - dstSubfolderSpec = 0; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 4BACD5CC15BC2DF200920691 /* CopyFiles */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 12; - dstPath = /usr/share/man/man1/; - dstSubfolderSpec = 0; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 4BACD5DB15BC2F3700920691 /* CopyFiles */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 12; - dstPath = /usr/share/man/man1/; - dstSubfolderSpec = 0; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 4BACD64C15BC301300920691 /* CopyFiles */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 12; - dstPath = /usr/share/man/man1/; - dstSubfolderSpec = 0; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 4BD6CB6819E71CD100710654 /* CopyFiles */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 12; - dstPath = /usr/share/man/man1/; - dstSubfolderSpec = 0; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 4BFF2B4D1FE12FCA006EF3F3 /* CopyFiles */ = { - isa = PBXCopyFilesBuildPhase; - buildActionMask = 12; - dstPath = /usr/share/man/man1/; - dstSubfolderSpec = 0; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXCopyFilesBuildPhase section */ - -/* Begin PBXFileReference section */ - 3D77B86517009AA1000A5794 /* extract-version.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = "extract-version.sh"; sourceTree = SOURCE_ROOT; }; - 3D7E35371B3305FB00022624 /* in-memory */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = "in-memory"; sourceTree = BUILT_PRODUCTS_DIR; }; - 3D7E35401B33063600022624 /* in-memory.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = "in-memory.c"; sourceTree = ""; }; - 3D7E35421B33063600022624 /* windows-open.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = "windows-open.c"; sourceTree = ""; }; - 3D7E35471B33076C00022624 /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = usr/lib/libz.dylib; sourceTree = SDKROOT; }; - 3D9284801C309510001EABA7 /* zip_hash.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = zip_hash.c; sourceTree = ""; usesTabs = 1; }; - 4B00CA21242F59D700E0B71C /* zip_source_pkware_decode.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = zip_source_pkware_decode.c; sourceTree = ""; }; - 4B00CA22242F59D700E0B71C /* zip_pkware.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = zip_pkware.c; sourceTree = ""; }; - 4B00CA23242F59D700E0B71C /* zip_source_pkware_encode.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = zip_source_pkware_encode.c; sourceTree = ""; }; - 4B00CA27242F5C2500E0B71C /* set_file_dostime.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = set_file_dostime.test; sourceTree = ""; }; - 4B00CA28242F5C2500E0B71C /* cancel_45.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = cancel_45.test; sourceTree = ""; }; - 4B00CA29242F5C2500E0B71C /* set_compression_store_to_xz.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = set_compression_store_to_xz.test; sourceTree = ""; }; - 4B00CA2A242F5C2500E0B71C /* encryption-nonrandom-pkware.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "encryption-nonrandom-pkware.test"; sourceTree = ""; }; - 4B00CA2B242F5C2500E0B71C /* cancel_90.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = cancel_90.test; sourceTree = ""; }; - 4B00CA2C242F5C2500E0B71C /* set_compression_xz_to_store.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = set_compression_xz_to_store.test; sourceTree = ""; }; - 4B01D68B15B2F3F1002D5007 /* libzip.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = libzip.framework; sourceTree = BUILT_PRODUCTS_DIR; }; - 4B01D6FD15B2F4B1002D5007 /* zipmerge */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = zipmerge; sourceTree = BUILT_PRODUCTS_DIR; }; - 4B01D70815B2F4CF002D5007 /* libz.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libz.dylib; path = Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk/usr/lib/libz.dylib; sourceTree = DEVELOPER_DIR; }; - 4B01D71315B2F4EB002D5007 /* zipcmp */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = zipcmp; sourceTree = BUILT_PRODUCTS_DIR; }; - 4B01D72115B2F572002D5007 /* zipcmp.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = zipcmp.c; sourceTree = ""; }; - 4B01D72215B2F572002D5007 /* zipmerge.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = zipmerge.c; sourceTree = ""; }; - 4B01D73D15B2FB6B002D5007 /* Info.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = SOURCE_ROOT; }; - 4B0454B41E8E3DF7002FA1F9 /* zip_algorithm_bzip2.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = zip_algorithm_bzip2.c; sourceTree = ""; }; - 4B0454B51E8E3DF7002FA1F9 /* zip_algorithm_deflate.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = zip_algorithm_deflate.c; sourceTree = ""; }; - 4B0454B61E8E3DF7002FA1F9 /* zip_source_compress.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = zip_source_compress.c; sourceTree = ""; }; - 4B1ABD1A1A2E5DA700C93867 /* links */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = links; sourceTree = ""; }; - 4B1ABD1B1A2E5E4D00C93867 /* handle_links */ = {isa = PBXFileReference; explicitFileType = text.script.perl; fileEncoding = 4; path = handle_links; sourceTree = ""; }; - 4B1E46E51A08CB7600A376D2 /* zip_error_code_system.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_error_code_system.mdoc; sourceTree = ""; }; - 4B1E46E61A08CB7600A376D2 /* zip_error_code_zip.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_error_code_zip.mdoc; sourceTree = ""; }; - 4B1E46E71A08CB7600A376D2 /* zip_error_fini.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_error_fini.mdoc; sourceTree = ""; }; - 4B1E46E81A08CB7600A376D2 /* zip_error_init.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_error_init.mdoc; sourceTree = ""; }; - 4B1E46E91A08CB7600A376D2 /* zip_error_set.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_error_set.mdoc; sourceTree = ""; }; - 4B1E46EA1A08CB7600A376D2 /* zip_error_strerror.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_error_strerror.mdoc; sourceTree = ""; }; - 4B1E46EB1A08CB7600A376D2 /* zip_error_system_type.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_error_system_type.mdoc; sourceTree = ""; }; - 4B26FF151A07DF1A000E9788 /* zip_file_get_external_attributes.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_file_get_external_attributes.mdoc; sourceTree = ""; }; - 4B26FF161A07DF1A000E9788 /* zip_file_set_external_attributes.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_file_set_external_attributes.mdoc; sourceTree = ""; }; - 4B26FF171A07DF1A000E9788 /* zip_file_set_mtime.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_file_set_mtime.mdoc; sourceTree = ""; }; - 4B26FF181A07DFEA000E9788 /* mkdocset.pl */ = {isa = PBXFileReference; lastKnownFileType = text.script.perl; path = mkdocset.pl; sourceTree = ""; }; - 4B28A9EC15BACC3900D0C17D /* libzip.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = libzip.mdoc; sourceTree = ""; }; - 4B28A9ED15BACC3900D0C17D /* zip_add_dir.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_add_dir.mdoc; sourceTree = ""; }; - 4B28A9EE15BACC3900D0C17D /* zip_add.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_add.mdoc; sourceTree = ""; }; - 4B28A9EF15BACC3900D0C17D /* zip_close.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_close.mdoc; sourceTree = ""; }; - 4B28A9F015BACC3900D0C17D /* zip_delete.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_delete.mdoc; sourceTree = ""; }; - 4B28A9F115BACC3900D0C17D /* zip_dir_add.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_dir_add.mdoc; sourceTree = ""; }; - 4B28A9F215BACC3900D0C17D /* zip_discard.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_discard.mdoc; sourceTree = ""; }; - 4B28A9F315BACC3900D0C17D /* zip_error_clear.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_error_clear.mdoc; sourceTree = ""; }; - 4B28A9F415BACC3900D0C17D /* zip_error_get_sys_type.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_error_get_sys_type.mdoc; sourceTree = ""; }; - 4B28A9F515BACC3900D0C17D /* zip_error_get.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_error_get.mdoc; sourceTree = ""; }; - 4B28A9F615BACC3900D0C17D /* zip_error_to_str.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_error_to_str.mdoc; sourceTree = ""; }; - 4B28A9F715BACC3900D0C17D /* zip_errors.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_errors.mdoc; sourceTree = ""; }; - 4B28A9F815BACC3900D0C17D /* zip_fclose.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_fclose.mdoc; sourceTree = ""; }; - 4B28A9F915BACC3900D0C17D /* zip_fdopen.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_fdopen.mdoc; sourceTree = ""; }; - 4B28A9FA15BACC3900D0C17D /* zip_file_add.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_file_add.mdoc; sourceTree = ""; }; - 4B28A9FB15BACC3900D0C17D /* zip_file_extra_field_delete.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_file_extra_field_delete.mdoc; sourceTree = ""; }; - 4B28A9FC15BACC3900D0C17D /* zip_file_extra_field_get.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_file_extra_field_get.mdoc; sourceTree = ""; }; - 4B28A9FD15BACC3900D0C17D /* zip_file_extra_field_set.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_file_extra_field_set.mdoc; sourceTree = ""; }; - 4B28A9FE15BACC3900D0C17D /* zip_file_extra_fields_count.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_file_extra_fields_count.mdoc; sourceTree = ""; }; - 4B28A9FF15BACC3900D0C17D /* zip_file_get_comment.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_file_get_comment.mdoc; sourceTree = ""; }; - 4B28AA0015BACC3900D0C17D /* zip_file_rename.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_file_rename.mdoc; sourceTree = ""; }; - 4B28AA0115BACC3900D0C17D /* zip_file_set_comment.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_file_set_comment.mdoc; sourceTree = ""; }; - 4B28AA0215BACC3900D0C17D /* zip_file_strerror.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_file_strerror.mdoc; sourceTree = ""; }; - 4B28AA0315BACC3900D0C17D /* zip_fopen_encrypted.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_fopen_encrypted.mdoc; sourceTree = ""; }; - 4B28AA0415BACC3900D0C17D /* zip_fopen.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_fopen.mdoc; sourceTree = ""; }; - 4B28AA0515BACC3900D0C17D /* zip_fread.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_fread.mdoc; sourceTree = ""; }; - 4B28AA0615BACC3900D0C17D /* zip_get_archive_comment.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_get_archive_comment.mdoc; sourceTree = ""; }; - 4B28AA0715BACC3900D0C17D /* zip_get_archive_flag.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_get_archive_flag.mdoc; sourceTree = ""; }; - 4B28AA0815BACC3900D0C17D /* zip_get_file_comment.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_get_file_comment.mdoc; sourceTree = ""; }; - 4B28AA0915BACC3900D0C17D /* zip_get_name.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_get_name.mdoc; sourceTree = ""; }; - 4B28AA0A15BACC3900D0C17D /* zip_get_num_entries.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_get_num_entries.mdoc; sourceTree = ""; }; - 4B28AA0B15BACC3900D0C17D /* zip_get_num_files.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_get_num_files.mdoc; sourceTree = ""; }; - 4B28AA0C15BACC3900D0C17D /* zip_name_locate.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_name_locate.mdoc; sourceTree = ""; }; - 4B28AA0D15BACC3900D0C17D /* zip_open.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_open.mdoc; sourceTree = ""; }; - 4B28AA0E15BACC3900D0C17D /* zip_rename.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_rename.mdoc; sourceTree = ""; }; - 4B28AA0F15BACC3900D0C17D /* zip_set_archive_comment.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_set_archive_comment.mdoc; sourceTree = ""; }; - 4B28AA1015BACC3900D0C17D /* zip_set_archive_flag.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_set_archive_flag.mdoc; sourceTree = ""; }; - 4B28AA1115BACC3900D0C17D /* zip_set_default_password.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_set_default_password.mdoc; sourceTree = ""; }; - 4B28AA1215BACC3900D0C17D /* zip_set_file_comment.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_set_file_comment.mdoc; sourceTree = ""; }; - 4B28AA1315BACC3900D0C17D /* zip_set_file_compression.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_set_file_compression.mdoc; sourceTree = ""; }; - 4B28AA1415BACC3900D0C17D /* zip_source_buffer.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_source_buffer.mdoc; sourceTree = ""; }; - 4B28AA1515BACC3900D0C17D /* zip_source_file.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_source_file.mdoc; sourceTree = ""; }; - 4B28AA1615BACC3900D0C17D /* zip_source_filep.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_source_filep.mdoc; sourceTree = ""; }; - 4B28AA1715BACC3900D0C17D /* zip_source_free.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_source_free.mdoc; sourceTree = ""; }; - 4B28AA1815BACC3900D0C17D /* zip_source_function.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_source_function.mdoc; sourceTree = ""; }; - 4B28AA1915BACC3900D0C17D /* zip_source_zip.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_source_zip.mdoc; sourceTree = ""; }; - 4B28AA1A15BACC3900D0C17D /* zip_stat_init.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_stat_init.mdoc; sourceTree = ""; }; - 4B28AA1B15BACC3900D0C17D /* zip_stat.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_stat.mdoc; sourceTree = ""; }; - 4B28AA1C15BACC3900D0C17D /* zip_unchange_all.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_unchange_all.mdoc; sourceTree = ""; }; - 4B28AA1D15BACC3900D0C17D /* zip_unchange_archive.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_unchange_archive.mdoc; sourceTree = ""; }; - 4B28AA1E15BACC3900D0C17D /* zip_unchange.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_unchange.mdoc; sourceTree = ""; }; - 4B28AA1F15BACC3900D0C17D /* zipcmp.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zipcmp.mdoc; sourceTree = ""; }; - 4B28AA2015BACC3900D0C17D /* zipmerge.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zipmerge.mdoc; sourceTree = ""; }; - 4B28AA2215BAD4E200D0C17D /* API-CHANGES.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = "API-CHANGES.md"; sourceTree = ""; }; - 4B28AA2315BAD4E200D0C17D /* AUTHORS */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = AUTHORS; sourceTree = ""; }; - 4B28AA2415BAD4E200D0C17D /* NEWS.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = NEWS.md; sourceTree = ""; }; - 4B28AA2515BAD4E200D0C17D /* README.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = README.md; sourceTree = ""; }; - 4B28AA2615BAD4E200D0C17D /* THANKS */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = THANKS; sourceTree = ""; }; - 4B28AA2715BAD4E200D0C17D /* TODO.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = TODO.md; sourceTree = ""; }; - 4B3A5F4D1DF96D83005A53A1 /* zip_fseek.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = zip_fseek.c; sourceTree = ""; }; - 4B3A5F4E1DF96D83005A53A1 /* zip_ftell.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = zip_ftell.c; sourceTree = ""; }; - 4B3FAE7F2385C5A300192D6A /* zip_algorithm_xz.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = zip_algorithm_xz.c; sourceTree = ""; }; - 4B3FAE812385C79200192D6A /* liblzma.5.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = liblzma.5.dylib; path = ../../../../../../opt/pkg/lib/liblzma.5.dylib; sourceTree = ""; }; - 4B3FAE832385C9E900192D6A /* README Xcode Project.md */ = {isa = PBXFileReference; lastKnownFileType = net.daringfireball.markdown; path = "README Xcode Project.md"; sourceTree = ""; }; - 4B41A2651FE15E99005D8C91 /* clone-fs-add.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "clone-fs-add.test"; sourceTree = ""; }; - 4B41A2661FE15FCE005D8C91 /* clone-fs-delete.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "clone-fs-delete.test"; sourceTree = ""; }; - 4B41A2671FE1604E005D8C91 /* clone-fs-replace.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "clone-fs-replace.test"; sourceTree = ""; }; - 4B4CB5572483D7B7005C5428 /* nihtest.conf.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = nihtest.conf.in; sourceTree = ""; }; - 4B5169A722A7993D00AA4340 /* zip_mkstempm.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = zip_mkstempm.c; sourceTree = ""; }; - 4B51DDB21FDADEDF00C5CA85 /* INSTALL.md */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = net.daringfireball.markdown; path = INSTALL.md; sourceTree = ""; }; - 4B51DDB31FDAE1DB00C5CA85 /* ziptool_regress.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = ziptool_regress.c; sourceTree = ""; }; - 4B51DDC01FDAE20A00C5CA85 /* ziptool_regress */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = ziptool_regress; sourceTree = BUILT_PRODUCTS_DIR; }; - 4B55D93F2475274B00CE8C38 /* CMakeLists.txt */ = {isa = PBXFileReference; lastKnownFileType = text; path = CMakeLists.txt; sourceTree = ""; }; - 4B5D0CD4244B154E006C2E93 /* zip_source_get_file_attributes.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = zip_source_get_file_attributes.c; sourceTree = ""; }; - 4B69E6ED2032F1870001EEE7 /* zip_winzip_aes.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = zip_winzip_aes.c; sourceTree = ""; }; - 4B69E6F020330D460001EEE7 /* zip_crypto_gnutls.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = zip_crypto_gnutls.c; sourceTree = ""; }; - 4B69E6F2203341D50001EEE7 /* zip_crypto_gnutls.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = zip_crypto_gnutls.h; sourceTree = ""; }; - 4B69E6F3203342E30001EEE7 /* zip_crypto.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = zip_crypto.h; sourceTree = ""; }; - 4B77E61A1FDDCD3A006786BA /* CMakeLists.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CMakeLists.txt; sourceTree = ""; }; - 4B77E61B1FDEDEA4006786BA /* clone-buffer-delete.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "clone-buffer-delete.test"; sourceTree = ""; }; - 4B77E61C1FDEDEA5006786BA /* clone-buffer-replace.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "clone-buffer-replace.test"; sourceTree = ""; }; - 4B77E61D1FDEDEA5006786BA /* clone-buffer-add.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "clone-buffer-add.test"; sourceTree = ""; }; - 4B82CED319915F360097BC18 /* zip_file_set_mtime.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = zip_file_set_mtime.c; sourceTree = ""; }; - 4B908F502385BE6C00886355 /* zip_libzip_version.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = zip_libzip_version.c; sourceTree = ""; }; - 4B908F522385BE6D00886355 /* zip_source_accept_empty.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = zip_source_accept_empty.c; sourceTree = ""; }; - 4B93995524631B3D00AEBDA4 /* zip_source_file_stdio_named.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = zip_source_file_stdio_named.c; sourceTree = ""; }; - 4B93995624631B3E00AEBDA4 /* zip_source_file_common.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = zip_source_file_common.c; sourceTree = ""; }; - 4B93995724631B3E00AEBDA4 /* zip_source_file_stdio.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = zip_source_file_stdio.c; sourceTree = ""; }; - 4B93995824631B3E00AEBDA4 /* zip_source_file_stdio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = zip_source_file_stdio.h; sourceTree = ""; }; - 4B93995924631B3E00AEBDA4 /* zip_source_file.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = zip_source_file.h; sourceTree = ""; }; - 4B93995F24640B1700AEBDA4 /* zip_source_file_win32.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = zip_source_file_win32.h; sourceTree = ""; }; - 4B93996024640B1700AEBDA4 /* zip_source_file_win32.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = zip_source_file_win32.c; sourceTree = ""; }; - 4B93996124641D5700AEBDA4 /* zip_source_file_win32_ansi.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = zip_source_file_win32_ansi.c; sourceTree = ""; }; - 4B93996224643F5700AEBDA4 /* zip_source_file_win32_utf8.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = zip_source_file_win32_utf8.c; sourceTree = ""; }; - 4B9399632464401300AEBDA4 /* zip_source_file_win32_utf16.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = zip_source_file_win32_utf16.c; sourceTree = ""; }; - 4B93996424644E7E00AEBDA4 /* zip_source_file_win32_named.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = zip_source_file_win32_named.c; sourceTree = ""; }; - 4B939965246553FD00AEBDA4 /* appveyor.yml */ = {isa = PBXFileReference; lastKnownFileType = text.yaml; path = appveyor.yml; sourceTree = ""; }; - 4B939966246E842200AEBDA4 /* zip_random_win32.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = zip_random_win32.c; sourceTree = ""; }; - 4B939967246E842200AEBDA4 /* zip_random_uwp.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = zip_random_uwp.c; sourceTree = ""; }; - 4B97204D188EBE85002FAFAD /* zip_file_get_external_attributes.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = zip_file_get_external_attributes.c; sourceTree = ""; }; - 4B97204E188EBE85002FAFAD /* zip_file_set_external_attributes.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = zip_file_set_external_attributes.c; sourceTree = ""; }; - 4B9E577A24C7026B00CEE0D6 /* zip_algorithm_zstd.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = zip_algorithm_zstd.c; sourceTree = ""; }; - 4B9E578324C9769F00CEE0D6 /* zip_crypto_win.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = zip_crypto_win.c; sourceTree = ""; }; - 4B9E578424C9769F00CEE0D6 /* zip_crypto_mbedtls.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = zip_crypto_mbedtls.c; sourceTree = ""; }; - 4B9E578524C9769F00CEE0D6 /* zip_crypto_win.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = zip_crypto_win.h; sourceTree = ""; }; - 4B9E578624C9769F00CEE0D6 /* zip_crypto_mbedtls.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = zip_crypto_mbedtls.h; sourceTree = ""; }; - 4B9E578724C9770C00CEE0D6 /* libzstd.1.4.5.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libzstd.1.4.5.dylib; path = ../../../../../../usr/local/Cellar/zstd/1.4.5/lib/libzstd.1.4.5.dylib; sourceTree = ""; }; - 4B9E578924C9779900CEE0D6 /* zip_err_str.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = zip_err_str.c; sourceTree = SOURCE_ROOT; }; - 4BACD57715BC2AEF00920691 /* add_from_filep.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = add_from_filep.c; path = ../regress/add_from_filep.c; sourceTree = ""; }; - 4BACD57A15BC2AEF00920691 /* fopen_unchanged.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = fopen_unchanged.c; path = ../regress/fopen_unchanged.c; sourceTree = ""; }; - 4BACD57B15BC2AEF00920691 /* fread.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = fread.c; path = ../regress/fread.c; sourceTree = ""; }; - 4BACD57C15BC2AEF00920691 /* ziptool.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = ziptool.c; sourceTree = ""; }; - 4BACD58415BC2AEF00920691 /* tryopen.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; name = tryopen.c; path = ../regress/tryopen.c; sourceTree = ""; }; - 4BACD58915BC2CEA00920691 /* ziptool */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = ziptool; sourceTree = BUILT_PRODUCTS_DIR; }; - 4BACD5C115BC2DC900920691 /* add_from_filep */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = add_from_filep; sourceTree = BUILT_PRODUCTS_DIR; }; - 4BACD5D015BC2DF200920691 /* fopen_unchanged */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = fopen_unchanged; sourceTree = BUILT_PRODUCTS_DIR; }; - 4BACD5DF15BC2F3700920691 /* fread */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = fread; sourceTree = BUILT_PRODUCTS_DIR; }; - 4BACD65015BC301300920691 /* tryopen */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = tryopen; sourceTree = BUILT_PRODUCTS_DIR; }; - 4BC03F781FDD55C1003C7B62 /* zip-in-archive-comment.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "zip-in-archive-comment.test"; sourceTree = ""; }; - 4BC03F791FDD55C1003C7B62 /* decrypt-wrong-password-aes192.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "decrypt-wrong-password-aes192.test"; sourceTree = ""; }; - 4BC03F7A1FDD55C1003C7B62 /* decrypt-correct-password-pkware.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "decrypt-correct-password-pkware.test"; sourceTree = ""; }; - 4BC03F7B1FDD55C1003C7B62 /* encryption-nonrandom-aes192.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "encryption-nonrandom-aes192.test"; sourceTree = ""; }; - 4BC03F7C1FDD55C1003C7B62 /* decrypt-wrong-password-pkware.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "decrypt-wrong-password-pkware.test"; sourceTree = ""; }; - 4BC03F7D1FDD55C1003C7B62 /* preload.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = preload.test; sourceTree = ""; }; - 4BC03F7E1FDD55C1003C7B62 /* open_file_count.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = open_file_count.test; sourceTree = ""; }; - 4BC03F7F1FDD55C2003C7B62 /* fseek_fail.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = fseek_fail.test; sourceTree = ""; }; - 4BC03F801FDD55C2003C7B62 /* open_multidisk.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = open_multidisk.test; sourceTree = ""; }; - 4BC03F811FDD55C2003C7B62 /* set_compression_deflate_to_bzip2.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = set_compression_deflate_to_bzip2.test; sourceTree = ""; }; - 4BC03F821FDD55C2003C7B62 /* decrypt-correct-password-aes192.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "decrypt-correct-password-aes192.test"; sourceTree = ""; }; - 4BC03F831FDD55C2003C7B62 /* encryption-nonrandom-aes256.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "encryption-nonrandom-aes256.test"; sourceTree = ""; }; - 4BC03F841FDD55C2003C7B62 /* fseek_ok.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = fseek_ok.test; sourceTree = ""; }; - 4BC03F851FDD55C3003C7B62 /* set_compression_store_to_bzip2.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = set_compression_store_to_bzip2.test; sourceTree = ""; }; - 4BC03F861FDD55C3003C7B62 /* open_zip64_3mf.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = open_zip64_3mf.test; sourceTree = ""; }; - 4BC03F871FDD55C3003C7B62 /* fseek_deflated.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = fseek_deflated.test; sourceTree = ""; }; - 4BC03F881FDD55C3003C7B62 /* encryption-remove.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "encryption-remove.test"; sourceTree = ""; }; - 4BC03F891FDD55C3003C7B62 /* add_from_zip_deflated2.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = add_from_zip_deflated2.test; sourceTree = ""; }; - 4BC03F8A1FDD55C3003C7B62 /* decrypt-wrong-password-aes256.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "decrypt-wrong-password-aes256.test"; sourceTree = ""; }; - 4BC03F8B1FDD55C3003C7B62 /* encryption-nonrandom-aes128.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "encryption-nonrandom-aes128.test"; sourceTree = ""; }; - 4BC03F8C1FDD55C4003C7B62 /* progress.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = progress.test; sourceTree = ""; }; - 4BC03F8D1FDD55C4003C7B62 /* junk_at_start.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = junk_at_start.test; sourceTree = ""; }; - 4BC03F8E1FDD55C4003C7B62 /* buffer-fragment-read.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "buffer-fragment-read.test"; sourceTree = ""; }; - 4BC03F8F1FDD55C4003C7B62 /* decrypt-wrong-password-aes128.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "decrypt-wrong-password-aes128.test"; sourceTree = ""; }; - 4BC03F901FDD55C4003C7B62 /* fdopen_ok.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = fdopen_ok.test; sourceTree = ""; }; - 4BC03F911FDD55C4003C7B62 /* junk_at_end.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = junk_at_end.test; sourceTree = ""; }; - 4BC03F921FDD55C4003C7B62 /* decrypt-correct-password-aes128.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "decrypt-correct-password-aes128.test"; sourceTree = ""; }; - 4BC03F931FDD55C5003C7B62 /* decrypt-no-password-aes256.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "decrypt-no-password-aes256.test"; sourceTree = ""; }; - 4BC03F941FDD55C5003C7B62 /* buffer-fragment-write.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "buffer-fragment-write.test"; sourceTree = ""; }; - 4BC03F951FDD55C5003C7B62 /* decrypt-correct-password-aes256.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "decrypt-correct-password-aes256.test"; sourceTree = ""; }; - 4BC03F961FDD55C5003C7B62 /* open_many_fail.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = open_many_fail.test; sourceTree = ""; }; - 4BC03F971FDD55C5003C7B62 /* set_compression_bzip2_to_deflate.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = set_compression_bzip2_to_deflate.test; sourceTree = ""; }; - 4BC03F981FDD55C5003C7B62 /* set_file_mtime.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = set_file_mtime.test; sourceTree = ""; }; - 4BC03F991FDD5617003C7B62 /* nonrandomopen.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = nonrandomopen.c; sourceTree = ""; }; - 4BC03F9A1FDD5617003C7B62 /* fseek.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = fseek.c; sourceTree = ""; }; - 4BC03F9B1FDD5617003C7B62 /* nonrandomopentest.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = nonrandomopentest.c; sourceTree = ""; }; - 4BC03F9C1FDD5617003C7B62 /* malloc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = malloc.c; sourceTree = ""; }; - 4BC03F9D1FDD5617003C7B62 /* CMakeLists.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CMakeLists.txt; sourceTree = ""; }; - 4BC03F9E1FDD5642003C7B62 /* extra_field_align.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = extra_field_align.test; sourceTree = ""; }; - 4BC03F9F1FDD5642003C7B62 /* count_entries.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = count_entries.test; sourceTree = ""; }; - 4BC03FA01FDD5660003C7B62 /* cleanup.cmake */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = cleanup.cmake; sourceTree = ""; }; - 4BC03FA11FDD603F003C7B62 /* zip_source_buffer_fragment.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_source_buffer_fragment.mdoc; sourceTree = ""; }; - 4BC03FA21FDD6B6F003C7B62 /* zip_source_begin_write_cloning.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = zip_source_begin_write_cloning.c; sourceTree = ""; }; - 4BC3863E1A1BE00E00CDCAAC /* zip_get_error.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_get_error.mdoc; sourceTree = ""; }; - 4BC3863F1A1BE00E00CDCAAC /* zip_source_begin_write.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_source_begin_write.mdoc; sourceTree = ""; }; - 4BC386401A1BE00E00CDCAAC /* zip_source_close.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_source_close.mdoc; sourceTree = ""; }; - 4BC386411A1BE00E00CDCAAC /* zip_source_commit_write.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_source_commit_write.mdoc; sourceTree = ""; }; - 4BC386421A1BE00E00CDCAAC /* zip_source_error.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_source_error.mdoc; sourceTree = ""; }; - 4BC386431A1BE00E00CDCAAC /* ZIP_SOURCE_GET_ARGS.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = ZIP_SOURCE_GET_ARGS.mdoc; sourceTree = ""; }; - 4BC386441A1BE00E00CDCAAC /* zip_source_is_deleted.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_source_is_deleted.mdoc; sourceTree = ""; }; - 4BC386451A1BE00E00CDCAAC /* zip_source_keep.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_source_keep.mdoc; sourceTree = ""; }; - 4BC386461A1BE00E00CDCAAC /* zip_source_make_command_bitmap.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_source_make_command_bitmap.mdoc; sourceTree = ""; }; - 4BC386471A1BE00E00CDCAAC /* zip_source_open.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_source_open.mdoc; sourceTree = ""; }; - 4BC386481A1BE00E00CDCAAC /* zip_source_read.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_source_read.mdoc; sourceTree = ""; }; - 4BC386491A1BE00E00CDCAAC /* zip_source_rollback_write.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_source_rollback_write.mdoc; sourceTree = ""; }; - 4BC3864A1A1BE00E00CDCAAC /* zip_source_seek_write.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_source_seek_write.mdoc; sourceTree = ""; }; - 4BC3864B1A1BE00E00CDCAAC /* zip_source_seek.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_source_seek.mdoc; sourceTree = ""; }; - 4BC3864C1A1BE00E00CDCAAC /* zip_source_stat.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_source_stat.mdoc; sourceTree = ""; }; - 4BC3864D1A1BE00E00CDCAAC /* zip_source_tell_write.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_source_tell_write.mdoc; sourceTree = ""; }; - 4BC3864E1A1BE00E00CDCAAC /* zip_source_tell.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_source_tell.mdoc; sourceTree = ""; }; - 4BC3864F1A1BE00E00CDCAAC /* zip_source_write.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_source_write.mdoc; sourceTree = ""; }; - 4BC386501A1BE00E00CDCAAC /* zip_source.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_source.mdoc; sourceTree = ""; }; - 4BC386511A1BE04700CDCAAC /* fix-man-links.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = "fix-man-links.sh"; sourceTree = ""; }; - 4BC386521A1BE04700CDCAAC /* make_zip_errors.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = make_zip_errors.sh; sourceTree = ""; }; - 4BC386531A1BE04700CDCAAC /* nih-man.css */ = {isa = PBXFileReference; lastKnownFileType = text.css; path = "nih-man.css"; sourceTree = ""; }; - 4BC972001A0A1D85003A2981 /* zip_error_to_data.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_error_to_data.mdoc; sourceTree = ""; }; - 4BCB434119E9347E0067FAA3 /* zip_buffer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = zip_buffer.c; sourceTree = ""; }; - 4BCD77A71A14E404001A9F55 /* zip_file_get_error.mdoc */ = {isa = PBXFileReference; lastKnownFileType = text; path = zip_file_get_error.mdoc; sourceTree = ""; }; - 4BCD77A81A14E921001A9F55 /* zip_source_seek_compute_offset.mdoc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = zip_source_seek_compute_offset.mdoc; sourceTree = ""; }; - 4BCD77A91A14ED5C001A9F55 /* CMakeLists.txt */ = {isa = PBXFileReference; lastKnownFileType = text; path = CMakeLists.txt; sourceTree = ""; }; - 4BCF3019199A2F820064207B /* zip_io_util.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = zip_io_util.c; sourceTree = ""; }; - 4BCF301A199A2F820064207B /* zip_source_begin_write.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = zip_source_begin_write.c; sourceTree = ""; }; - 4BCF301B199A2F820064207B /* zip_source_commit_write.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = zip_source_commit_write.c; sourceTree = ""; }; - 4BCF301C199A2F820064207B /* zip_source_rollback_write.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = zip_source_rollback_write.c; sourceTree = ""; }; - 4BCF301D199A2F820064207B /* zip_source_seek.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = zip_source_seek.c; sourceTree = ""; }; - 4BCF301E199A2F820064207B /* zip_source_supports.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = zip_source_supports.c; sourceTree = ""; }; - 4BCF301F199A2F820064207B /* zip_source_tell.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = zip_source_tell.c; sourceTree = ""; }; - 4BCF3020199A2F820064207B /* zip_source_write.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = zip_source_write.c; sourceTree = ""; }; - 4BCF3031199ABD3A0064207B /* zip_source_remove.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = zip_source_remove.c; sourceTree = ""; }; - 4BCF3034199ABDDA0064207B /* zip_source_seek_write.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = zip_source_seek_write.c; sourceTree = ""; }; - 4BCF3035199ABDDA0064207B /* zip_source_tell_write.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = zip_source_tell_write.c; sourceTree = ""; }; - 4BD155CE191CD28D0046F012 /* NiHTest.pm */ = {isa = PBXFileReference; indentWidth = 4; lastKnownFileType = text.script.perl; path = NiHTest.pm; sourceTree = ""; tabWidth = 4; usesTabs = 1; }; - 4BD155CF191CD28D0046F012 /* runtest.in */ = {isa = PBXFileReference; lastKnownFileType = text; path = runtest.in; sourceTree = ""; }; - 4BD25DA51CF58790005A9EC4 /* compat.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = compat.h; sourceTree = ""; }; - 4BD35E411A33366200256CB7 /* add_dir.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = add_dir.test; sourceTree = ""; }; - 4BD35E421A33366200256CB7 /* add_from_buffer.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = add_from_buffer.test; sourceTree = ""; }; - 4BD35E431A33366200256CB7 /* add_from_file_duplicate.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = add_from_file_duplicate.test; sourceTree = ""; }; - 4BD35E441A33366200256CB7 /* add_from_file_twice_duplicate.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = add_from_file_twice_duplicate.test; sourceTree = ""; }; - 4BD35E451A33366200256CB7 /* add_from_file.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = add_from_file.test; sourceTree = ""; }; - 4BD35E461A33366200256CB7 /* add_from_filep.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = add_from_filep.test; sourceTree = ""; }; - 4BD35E471A33366200256CB7 /* add_from_stdin.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = add_from_stdin.test; sourceTree = ""; }; - 4BD35E481A33366200256CB7 /* add_from_zip_closed.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = add_from_zip_closed.test; sourceTree = ""; }; - 4BD35E491A33366200256CB7 /* add_from_zip_deflated.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = add_from_zip_deflated.test; sourceTree = ""; }; - 4BD35E4A1A33366200256CB7 /* add_from_zip_partial_deflated.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = add_from_zip_partial_deflated.test; sourceTree = ""; }; - 4BD35E4B1A33366200256CB7 /* add_from_zip_partial_stored.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = add_from_zip_partial_stored.test; sourceTree = ""; }; - 4BD35E4C1A33366200256CB7 /* add_from_zip_stored.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = add_from_zip_stored.test; sourceTree = ""; }; - 4BD35E4E1A33366200256CB7 /* add_stored_in_memory.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = add_stored_in_memory.test; sourceTree = ""; }; - 4BD35E4F1A33366200256CB7 /* add_stored.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = add_stored.test; sourceTree = ""; }; - 4BD35E501A33366200256CB7 /* cm-default.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "cm-default.test"; sourceTree = ""; }; - 4BD35E511A33366200256CB7 /* delete_add_same.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = delete_add_same.test; sourceTree = ""; }; - 4BD35E521A33366200256CB7 /* delete_invalid.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = delete_invalid.test; sourceTree = ""; }; - 4BD35E531A33366200256CB7 /* delete_last.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = delete_last.test; sourceTree = ""; }; - 4BD35E541A33366200256CB7 /* delete_multiple_last.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = delete_multiple_last.test; sourceTree = ""; }; - 4BD35E551A33366200256CB7 /* delete_multiple_partial.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = delete_multiple_partial.test; sourceTree = ""; }; - 4BD35E561A33366200256CB7 /* delete_renamed_rename.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = delete_renamed_rename.test; sourceTree = ""; }; - 4BD35E5B1A33366200256CB7 /* encrypt.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = encrypt.test; sourceTree = ""; }; - 4BD35E5C1A33366200256CB7 /* extra_add_multiple.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = extra_add_multiple.test; sourceTree = ""; }; - 4BD35E5D1A33366200256CB7 /* extra_add.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = extra_add.test; sourceTree = ""; }; - 4BD35E5E1A33366200256CB7 /* extra_count_by_id.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = extra_count_by_id.test; sourceTree = ""; }; - 4BD35E5F1A33366200256CB7 /* extra_count_ignore_zip64.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = extra_count_ignore_zip64.test; sourceTree = ""; }; - 4BD35E601A33366200256CB7 /* extra_count.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = extra_count.test; sourceTree = ""; }; - 4BD35E611A33366200256CB7 /* extra_delete_by_id.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = extra_delete_by_id.test; sourceTree = ""; }; - 4BD35E621A33366200256CB7 /* extra_delete.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = extra_delete.test; sourceTree = ""; }; - 4BD35E631A33366200256CB7 /* extra_get_by_id.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = extra_get_by_id.test; sourceTree = ""; }; - 4BD35E641A33366200256CB7 /* extra_get.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = extra_get.test; sourceTree = ""; }; - 4BD35E651A33366200256CB7 /* extra_set_modify_c.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = extra_set_modify_c.test; sourceTree = ""; }; - 4BD35E661A33366200256CB7 /* extra_set_modify_l.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = extra_set_modify_l.test; sourceTree = ""; }; - 4BD35E671A33366200256CB7 /* extra_set.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = extra_set.test; sourceTree = ""; }; - 4BD35E681A33366200256CB7 /* file_comment_encmismatch.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = file_comment_encmismatch.test; sourceTree = ""; }; - 4BD35E691A33366200256CB7 /* fopen_unchanged.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = fopen_unchanged.test; sourceTree = ""; }; - 4BD35E6A1A33366200256CB7 /* fread.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = fread.test; sourceTree = ""; }; - 4BD35E6B1A33366200256CB7 /* get_comment.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = get_comment.test; sourceTree = ""; }; - 4BD35E8E1A33366200256CB7 /* name_locate.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = name_locate.test; sourceTree = ""; }; - 4BD35E8F1A33366200256CB7 /* open_cons_extrabytes.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = open_cons_extrabytes.test; sourceTree = ""; }; - 4BD35E901A33366200256CB7 /* open_empty_2.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = open_empty_2.test; sourceTree = ""; }; - 4BD35E911A33366200256CB7 /* open_empty.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = open_empty.test; sourceTree = ""; }; - 4BD35E921A33366200256CB7 /* open_extrabytes.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = open_extrabytes.test; sourceTree = ""; }; - 4BD35E931A33366200256CB7 /* open_filename_duplicate_consistency.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = open_filename_duplicate_consistency.test; sourceTree = ""; }; - 4BD35E941A33366200256CB7 /* open_filename_duplicate_empty_consistency.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = open_filename_duplicate_empty_consistency.test; sourceTree = ""; }; - 4BD35E951A33366200256CB7 /* open_filename_duplicate_empty.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = open_filename_duplicate_empty.test; sourceTree = ""; }; - 4BD35E961A33366200256CB7 /* open_filename_duplicate.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = open_filename_duplicate.test; sourceTree = ""; }; - 4BD35E971A33366200256CB7 /* open_filename_empty.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = open_filename_empty.test; sourceTree = ""; }; - 4BD35E981A33366200256CB7 /* open_incons.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = open_incons.test; sourceTree = ""; }; - 4BD35E991A33366200256CB7 /* open_many_ok.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = open_many_ok.test; sourceTree = ""; }; - 4BD35E9A1A33366200256CB7 /* open_new_but_exists.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = open_new_but_exists.test; sourceTree = ""; }; - 4BD35E9B1A33366200256CB7 /* open_new_ok.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = open_new_ok.test; sourceTree = ""; }; - 4BD35E9C1A33366200256CB7 /* open_nonarchive.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = open_nonarchive.test; sourceTree = ""; }; - 4BD35E9D1A33366200256CB7 /* open_nosuchfile.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = open_nosuchfile.test; sourceTree = ""; }; - 4BD35E9E1A33366200256CB7 /* open_ok.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = open_ok.test; sourceTree = ""; }; - 4BD35E9F1A33366200256CB7 /* open_too_short.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = open_too_short.test; sourceTree = ""; }; - 4BD35EA01A33366200256CB7 /* open_truncate.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = open_truncate.test; sourceTree = ""; }; - 4BD35EA11A33366200256CB7 /* open_zip64_ok.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = open_zip64_ok.test; sourceTree = ""; }; - 4BD35EA21A33366200256CB7 /* rename_ascii.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = rename_ascii.test; sourceTree = ""; }; - 4BD35EA31A33366200256CB7 /* rename_cp437.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = rename_cp437.test; sourceTree = ""; }; - 4BD35EA41A33366200256CB7 /* rename_deleted.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = rename_deleted.test; sourceTree = ""; }; - 4BD35EA51A33366200256CB7 /* rename_fail.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = rename_fail.test; sourceTree = ""; }; - 4BD35EA61A33366200256CB7 /* rename_ok.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = rename_ok.test; sourceTree = ""; }; - 4BD35EA81A33366200256CB7 /* rename_utf8_encmismatch.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = rename_utf8_encmismatch.test; sourceTree = ""; }; - 4BD35EA91A33366200256CB7 /* rename_utf8.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = rename_utf8.test; sourceTree = ""; }; - 4BD35EAA1A33366200256CB7 /* set_comment_all.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = set_comment_all.test; sourceTree = ""; }; - 4BD35EAB1A33366200256CB7 /* set_comment_localonly.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = set_comment_localonly.test; sourceTree = ""; }; - 4BD35EAC1A33366200256CB7 /* set_comment_removeglobal.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = set_comment_removeglobal.test; sourceTree = ""; }; - 4BD35EAD1A33366200256CB7 /* set_comment_revert.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = set_comment_revert.test; sourceTree = ""; }; - 4BD35EAE1A33366200256CB7 /* set_compression_deflate_to_deflate.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = set_compression_deflate_to_deflate.test; sourceTree = ""; }; - 4BD35EAF1A33366200256CB7 /* set_compression_deflate_to_store.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = set_compression_deflate_to_store.test; sourceTree = ""; }; - 4BD35EB01A33366200256CB7 /* set_compression_store_to_deflate.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = set_compression_store_to_deflate.test; sourceTree = ""; }; - 4BD35EB11A33366200256CB7 /* set_compression_store_to_store.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = set_compression_store_to_store.test; sourceTree = ""; }; - 4BD35EB21A33366200256CB7 /* set_compression_unknown.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = set_compression_unknown.test; sourceTree = ""; }; - 4BD35EB41A33366200256CB7 /* stat_index_cp437_guess.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = stat_index_cp437_guess.test; sourceTree = ""; }; - 4BD35EB51A33366200256CB7 /* stat_index_cp437_raw.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = stat_index_cp437_raw.test; sourceTree = ""; }; - 4BD35EB61A33366200256CB7 /* stat_index_cp437_strict.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = stat_index_cp437_strict.test; sourceTree = ""; }; - 4BD35EB71A33366200256CB7 /* stat_index_fileorder.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = stat_index_fileorder.test; sourceTree = ""; }; - 4BD35EB81A33366200256CB7 /* stat_index_streamed_zip64.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = stat_index_streamed_zip64.test; sourceTree = ""; }; - 4BD35EB91A33366200256CB7 /* stat_index_streamed.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = stat_index_streamed.test; sourceTree = ""; }; - 4BD35EBA1A33366200256CB7 /* stat_index_utf8_guess.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = stat_index_utf8_guess.test; sourceTree = ""; }; - 4BD35EBB1A33366200256CB7 /* stat_index_utf8_raw.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = stat_index_utf8_raw.test; sourceTree = ""; }; - 4BD35EBC1A33366200256CB7 /* stat_index_utf8_strict.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = stat_index_utf8_strict.test; sourceTree = ""; }; - 4BD35EBD1A33366200256CB7 /* stat_index_utf8_unmarked_strict.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = stat_index_utf8_unmarked_strict.test; sourceTree = ""; }; - 4BD35EBE1A33366200256CB7 /* stat_index_zip64.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = stat_index_zip64.test; sourceTree = ""; }; - 4BD35EE11A33366300256CB7 /* utf-8-standardization.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "utf-8-standardization.test"; sourceTree = ""; }; - 4BD35EE31A33366300256CB7 /* zip64_creation.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = zip64_creation.test; sourceTree = ""; }; - 4BD35EE41A33366300256CB7 /* zip64_stored_creation.test */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = zip64_stored_creation.test; sourceTree = ""; }; - 4BD5053219A0116D007DD28A /* zip_source_call.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = zip_source_call.c; sourceTree = ""; }; - 4BD6CB5C19E6A5D900710654 /* source_hole.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = source_hole.c; sourceTree = ""; }; - 4BD6CB5E19E71B3B00710654 /* hole.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = hole.c; sourceTree = ""; }; - 4BD6CB6C19E71CD100710654 /* hole */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = hole; sourceTree = BUILT_PRODUCTS_DIR; }; - 4BD708781EB1CF73003F351F /* zip_progress.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = zip_progress.c; sourceTree = ""; }; - 4BDC71F115B1B25E00236D3C /* zip_add_dir.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_add_dir.c; path = ../lib/zip_add_dir.c; sourceTree = ""; }; - 4BDC71F215B1B25E00236D3C /* zip_add_entry.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_add_entry.c; path = ../lib/zip_add_entry.c; sourceTree = ""; }; - 4BDC71F315B1B25E00236D3C /* zip_add.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_add.c; path = ../lib/zip_add.c; sourceTree = ""; }; - 4BDC71F415B1B25E00236D3C /* zip_close.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_close.c; path = ../lib/zip_close.c; sourceTree = ""; }; - 4BDC71F515B1B25E00236D3C /* zip_delete.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_delete.c; path = ../lib/zip_delete.c; sourceTree = ""; }; - 4BDC71F615B1B25E00236D3C /* zip_dir_add.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_dir_add.c; path = ../lib/zip_dir_add.c; sourceTree = ""; }; - 4BDC71F715B1B25E00236D3C /* zip_dirent.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_dirent.c; path = ../lib/zip_dirent.c; sourceTree = ""; }; - 4BDC71F815B1B25E00236D3C /* zip_discard.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_discard.c; path = ../lib/zip_discard.c; sourceTree = ""; }; - 4BDC71F915B1B25E00236D3C /* zip_entry.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_entry.c; path = ../lib/zip_entry.c; sourceTree = ""; }; - 4BDC71FB15B1B25E00236D3C /* zip_error_clear.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_error_clear.c; path = ../lib/zip_error_clear.c; sourceTree = ""; }; - 4BDC71FC15B1B25E00236D3C /* zip_error_get_sys_type.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_error_get_sys_type.c; path = ../lib/zip_error_get_sys_type.c; sourceTree = ""; }; - 4BDC71FD15B1B25E00236D3C /* zip_error_get.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_error_get.c; path = ../lib/zip_error_get.c; sourceTree = ""; }; - 4BDC71FE15B1B25E00236D3C /* zip_error_strerror.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_error_strerror.c; path = ../lib/zip_error_strerror.c; sourceTree = ""; }; - 4BDC71FF15B1B25E00236D3C /* zip_error_to_str.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_error_to_str.c; path = ../lib/zip_error_to_str.c; sourceTree = ""; }; - 4BDC720015B1B25E00236D3C /* zip_error.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_error.c; path = ../lib/zip_error.c; sourceTree = ""; }; - 4BDC720115B1B25E00236D3C /* zip_extra_field_api.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_extra_field_api.c; path = ../lib/zip_extra_field_api.c; sourceTree = ""; }; - 4BDC720215B1B25E00236D3C /* zip_extra_field.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_extra_field.c; path = ../lib/zip_extra_field.c; sourceTree = ""; }; - 4BDC720315B1B25E00236D3C /* zip_fclose.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_fclose.c; path = ../lib/zip_fclose.c; sourceTree = ""; }; - 4BDC720415B1B25E00236D3C /* zip_fdopen.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_fdopen.c; path = ../lib/zip_fdopen.c; sourceTree = ""; }; - 4BDC720515B1B25E00236D3C /* zip_file_add.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_file_add.c; path = ../lib/zip_file_add.c; sourceTree = ""; }; - 4BDC720615B1B25E00236D3C /* zip_file_error_clear.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_file_error_clear.c; path = ../lib/zip_file_error_clear.c; sourceTree = ""; }; - 4BDC720715B1B25E00236D3C /* zip_file_error_get.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_file_error_get.c; path = ../lib/zip_file_error_get.c; sourceTree = ""; }; - 4BDC720815B1B25E00236D3C /* zip_file_get_comment.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_file_get_comment.c; path = ../lib/zip_file_get_comment.c; sourceTree = ""; }; - 4BDC720915B1B25E00236D3C /* zip_file_get_offset.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_file_get_offset.c; path = ../lib/zip_file_get_offset.c; sourceTree = ""; }; - 4BDC720A15B1B25E00236D3C /* zip_file_rename.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_file_rename.c; path = ../lib/zip_file_rename.c; sourceTree = ""; }; - 4BDC720B15B1B25E00236D3C /* zip_file_replace.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_file_replace.c; path = ../lib/zip_file_replace.c; sourceTree = ""; }; - 4BDC720C15B1B25E00236D3C /* zip_file_set_comment.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_file_set_comment.c; path = ../lib/zip_file_set_comment.c; sourceTree = ""; }; - 4BDC720D15B1B25E00236D3C /* zip_file_strerror.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_file_strerror.c; path = ../lib/zip_file_strerror.c; sourceTree = ""; }; - 4BDC720F15B1B25E00236D3C /* zip_fopen_encrypted.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_fopen_encrypted.c; path = ../lib/zip_fopen_encrypted.c; sourceTree = ""; }; - 4BDC721015B1B25E00236D3C /* zip_fopen_index_encrypted.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_fopen_index_encrypted.c; path = ../lib/zip_fopen_index_encrypted.c; sourceTree = ""; }; - 4BDC721115B1B25E00236D3C /* zip_fopen_index.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_fopen_index.c; path = ../lib/zip_fopen_index.c; sourceTree = ""; }; - 4BDC721215B1B25E00236D3C /* zip_fopen.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_fopen.c; path = ../lib/zip_fopen.c; sourceTree = ""; }; - 4BDC721315B1B25E00236D3C /* zip_fread.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_fread.c; path = ../lib/zip_fread.c; sourceTree = ""; }; - 4BDC721415B1B25E00236D3C /* zip_get_archive_comment.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_get_archive_comment.c; path = ../lib/zip_get_archive_comment.c; sourceTree = ""; }; - 4BDC721515B1B25E00236D3C /* zip_get_archive_flag.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_get_archive_flag.c; path = ../lib/zip_get_archive_flag.c; sourceTree = ""; }; - 4BDC721715B1B25E00236D3C /* zip_get_encryption_implementation.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_get_encryption_implementation.c; path = ../lib/zip_get_encryption_implementation.c; sourceTree = ""; }; - 4BDC721815B1B25E00236D3C /* zip_get_file_comment.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_get_file_comment.c; path = ../lib/zip_get_file_comment.c; sourceTree = ""; }; - 4BDC721915B1B25E00236D3C /* zip_get_name.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_get_name.c; path = ../lib/zip_get_name.c; sourceTree = ""; }; - 4BDC721A15B1B25E00236D3C /* zip_get_num_entries.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_get_num_entries.c; path = ../lib/zip_get_num_entries.c; sourceTree = ""; }; - 4BDC721B15B1B25E00236D3C /* zip_get_num_files.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_get_num_files.c; path = ../lib/zip_get_num_files.c; sourceTree = ""; }; - 4BDC721C15B1B25E00236D3C /* zip_memdup.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_memdup.c; path = ../lib/zip_memdup.c; sourceTree = ""; }; - 4BDC721D15B1B25E00236D3C /* zip_name_locate.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_name_locate.c; path = ../lib/zip_name_locate.c; sourceTree = ""; }; - 4BDC721E15B1B25E00236D3C /* zip_new.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_new.c; path = ../lib/zip_new.c; sourceTree = ""; }; - 4BDC721F15B1B25E00236D3C /* zip_open.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_open.c; path = ../lib/zip_open.c; sourceTree = ""; tabWidth = 8; usesTabs = 1; }; - 4BDC722015B1B25E00236D3C /* zip_rename.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_rename.c; path = ../lib/zip_rename.c; sourceTree = ""; }; - 4BDC722115B1B25E00236D3C /* zip_replace.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_replace.c; path = ../lib/zip_replace.c; sourceTree = ""; }; - 4BDC722215B1B25E00236D3C /* zip_set_archive_comment.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_set_archive_comment.c; path = ../lib/zip_set_archive_comment.c; sourceTree = ""; }; - 4BDC722315B1B25E00236D3C /* zip_set_archive_flag.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_set_archive_flag.c; path = ../lib/zip_set_archive_flag.c; sourceTree = ""; }; - 4BDC722415B1B25E00236D3C /* zip_set_default_password.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_set_default_password.c; path = ../lib/zip_set_default_password.c; sourceTree = ""; }; - 4BDC722515B1B25E00236D3C /* zip_set_file_comment.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_set_file_comment.c; path = ../lib/zip_set_file_comment.c; sourceTree = ""; }; - 4BDC722615B1B25E00236D3C /* zip_set_file_compression.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_set_file_compression.c; path = ../lib/zip_set_file_compression.c; sourceTree = ""; }; - 4BDC722715B1B25E00236D3C /* zip_set_name.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_set_name.c; path = ../lib/zip_set_name.c; sourceTree = ""; }; - 4BDC722815B1B25E00236D3C /* zip_source_buffer.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_source_buffer.c; path = ../lib/zip_source_buffer.c; sourceTree = ""; }; - 4BDC722915B1B25E00236D3C /* zip_source_close.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_source_close.c; path = ../lib/zip_source_close.c; sourceTree = ""; }; - 4BDC722A15B1B25E00236D3C /* zip_source_crc.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_source_crc.c; path = ../lib/zip_source_crc.c; sourceTree = ""; }; - 4BDC722C15B1B25E00236D3C /* zip_source_error.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_source_error.c; path = ../lib/zip_source_error.c; sourceTree = ""; }; - 4BDC722F15B1B25E00236D3C /* zip_source_free.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_source_free.c; path = ../lib/zip_source_free.c; sourceTree = ""; }; - 4BDC723015B1B25E00236D3C /* zip_source_function.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_source_function.c; path = ../lib/zip_source_function.c; sourceTree = ""; }; - 4BDC723115B1B25E00236D3C /* zip_source_layered.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_source_layered.c; path = ../lib/zip_source_layered.c; sourceTree = ""; }; - 4BDC723215B1B25E00236D3C /* zip_source_open.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_source_open.c; path = ../lib/zip_source_open.c; sourceTree = ""; }; - 4BDC723515B1B25E00236D3C /* zip_source_read.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_source_read.c; path = ../lib/zip_source_read.c; sourceTree = ""; }; - 4BDC723615B1B25E00236D3C /* zip_source_stat.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_source_stat.c; path = ../lib/zip_source_stat.c; sourceTree = ""; }; - 4BDC723715B1B25E00236D3C /* zip_source_window.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_source_window.c; path = ../lib/zip_source_window.c; sourceTree = ""; }; - 4BDC723815B1B25E00236D3C /* zip_source_zip_new.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_source_zip_new.c; path = ../lib/zip_source_zip_new.c; sourceTree = ""; }; - 4BDC723915B1B25E00236D3C /* zip_source_zip.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_source_zip.c; path = ../lib/zip_source_zip.c; sourceTree = ""; }; - 4BDC723A15B1B25E00236D3C /* zip_stat_index.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_stat_index.c; path = ../lib/zip_stat_index.c; sourceTree = ""; }; - 4BDC723B15B1B25E00236D3C /* zip_stat_init.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_stat_init.c; path = ../lib/zip_stat_init.c; sourceTree = ""; }; - 4BDC723C15B1B25E00236D3C /* zip_stat.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_stat.c; path = ../lib/zip_stat.c; sourceTree = ""; }; - 4BDC723D15B1B25E00236D3C /* zip_strerror.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_strerror.c; path = ../lib/zip_strerror.c; sourceTree = ""; }; - 4BDC723E15B1B25E00236D3C /* zip_string.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_string.c; path = ../lib/zip_string.c; sourceTree = ""; }; - 4BDC723F15B1B25E00236D3C /* zip_unchange_all.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_unchange_all.c; path = ../lib/zip_unchange_all.c; sourceTree = ""; }; - 4BDC724015B1B25E00236D3C /* zip_unchange_archive.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_unchange_archive.c; path = ../lib/zip_unchange_archive.c; sourceTree = ""; }; - 4BDC724115B1B25E00236D3C /* zip_unchange_data.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_unchange_data.c; path = ../lib/zip_unchange_data.c; sourceTree = ""; }; - 4BDC724215B1B25E00236D3C /* zip_unchange.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = zip_unchange.c; path = ../lib/zip_unchange.c; sourceTree = ""; }; - 4BDC724315B1B25E00236D3C /* zip_utf-8.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = "zip_utf-8.c"; path = "../lib/zip_utf-8.c"; sourceTree = ""; }; - 4BDC729815B1B2A600236D3C /* zip.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = zip.h; path = ../lib/zip.h; sourceTree = ""; }; - 4BDC729915B1B2A600236D3C /* zipint.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = zipint.h; path = ../lib/zipint.h; sourceTree = ""; }; - 4BDC729E15B1B4E900236D3C /* zipconf.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = zipconf.h; sourceTree = SOURCE_ROOT; }; - 4BDC72A015B1B56400236D3C /* config.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = config.h; sourceTree = SOURCE_ROOT; }; - 4BE402AC19D94AE400298248 /* zip_source_is_deleted.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = zip_source_is_deleted.c; sourceTree = ""; }; - 4BE92AA420345E2E00509BC8 /* libgnutls.30.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libgnutls.30.dylib; path = ../../../../../../opt/pkg/lib/libgnutls.30.dylib; sourceTree = ""; }; - 4BE92AA620345E3800509BC8 /* libbz2.tbd */ = {isa = PBXFileReference; lastKnownFileType = "sourcecode.text-based-dylib-definition"; name = libbz2.tbd; path = usr/lib/libbz2.tbd; sourceTree = SDKROOT; }; - 4BE92AA820345E5500509BC8 /* libnettle.6.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libnettle.6.dylib; path = ../../../../../../opt/pkg/lib/libnettle.6.dylib; sourceTree = ""; }; - 4BE92AAA20346B1900509BC8 /* zip_crypto_openssl.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = zip_crypto_openssl.h; sourceTree = ""; }; - 4BE92AAB20346B1900509BC8 /* zip_crypto_openssl.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = zip_crypto_openssl.c; sourceTree = ""; }; - 4BE92AB0203597D700509BC8 /* zip_crypto_commoncrypto.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = zip_crypto_commoncrypto.h; sourceTree = ""; }; - 4BE92AB1203597D700509BC8 /* zip_crypto_commoncrypto.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = zip_crypto_commoncrypto.c; sourceTree = ""; }; - 4BFF2B341FDEEF8B006EF3F3 /* CMakeLists.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = CMakeLists.txt; sourceTree = ""; }; - 4BFF2B351FDEF277006EF3F3 /* cmake-config.h.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "cmake-config.h.in"; sourceTree = ""; }; - 4BFF2B361FDEF277006EF3F3 /* cmake-zipconf.h.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "cmake-zipconf.h.in"; sourceTree = ""; }; - 4BFF2B511FE12FCA006EF3F3 /* can_clone_file */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = can_clone_file; sourceTree = BUILT_PRODUCTS_DIR; }; - 4BFF2B541FE13033006EF3F3 /* can_clone_file.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = can_clone_file.c; sourceTree = ""; }; - 736ED9B71E3D688C00C36873 /* zip_file_set_encryption.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = zip_file_set_encryption.c; sourceTree = ""; }; - 736ED9B81E3D688C00C36873 /* zip_random_unix.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = zip_random_unix.c; sourceTree = ""; }; - 736ED9B91E3D688C00C36873 /* zip_source_winzip_aes_decode.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = zip_source_winzip_aes_decode.c; sourceTree = ""; }; - 736ED9BA1E3D688C00C36873 /* zip_source_winzip_aes_encode.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = zip_source_winzip_aes_encode.c; sourceTree = ""; }; -/* End PBXFileReference section */ - -/* Begin PBXFrameworksBuildPhase section */ - 3D7E35341B3305FB00022624 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 3D7E35481B33076C00022624 /* libz.dylib in Frameworks */, - 3D7E35461B33064B00022624 /* libzip.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 4B01D68715B2F3F1002D5007 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 4B9E578824C9770C00CEE0D6 /* libzstd.1.4.5.dylib in Frameworks */, - 4BE92AA720345E3800509BC8 /* libbz2.tbd in Frameworks */, - 4B01D73C15B2F6AF002D5007 /* libz.dylib in Frameworks */, - 4B3FAE822385C79200192D6A /* liblzma.5.dylib in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 4B01D6FA15B2F4B1002D5007 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 4B01D70915B2F4CF002D5007 /* libz.dylib in Frameworks */, - 4B01D70715B2F4C5002D5007 /* libzip.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 4B01D70C15B2F4EB002D5007 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 4B01D70D15B2F4EB002D5007 /* libz.dylib in Frameworks */, - 4B01D70E15B2F4EB002D5007 /* libzip.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 4B51DDB91FDAE20A00C5CA85 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 4B51DDBA1FDAE20A00C5CA85 /* libz.dylib in Frameworks */, - 4B51DDBB1FDAE20A00C5CA85 /* libzip.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 4BACD58615BC2CEA00920691 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 4BACD59415BC2D0800920691 /* libz.dylib in Frameworks */, - 4BACD59315BC2CFA00920691 /* libzip.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 4BACD5BA15BC2DC900920691 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 4BACD5BB15BC2DC900920691 /* libz.dylib in Frameworks */, - 4BACD5BC15BC2DC900920691 /* libzip.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 4BACD5C915BC2DF200920691 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 4BACD5CA15BC2DF200920691 /* libz.dylib in Frameworks */, - 4BACD5CB15BC2DF200920691 /* libzip.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 4BACD5D815BC2F3700920691 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 4BACD5D915BC2F3700920691 /* libz.dylib in Frameworks */, - 4BACD5DA15BC2F3700920691 /* libzip.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 4BACD64915BC301300920691 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 4BACD64A15BC301300920691 /* libz.dylib in Frameworks */, - 4BACD64B15BC301300920691 /* libzip.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 4BD6CB6519E71CD100710654 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - 4BD6CB6619E71CD100710654 /* libz.dylib in Frameworks */, - 4BD6CB6719E71CD100710654 /* libzip.framework in Frameworks */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 4BFF2B4A1FE12FCA006EF3F3 /* Frameworks */ = { - isa = PBXFrameworksBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXFrameworksBuildPhase section */ - -/* Begin PBXGroup section */ - 3D7E353E1B33063600022624 /* examples */ = { - isa = PBXGroup; - children = ( - 3D7E35401B33063600022624 /* in-memory.c */, - 3D7E35421B33063600022624 /* windows-open.c */, - ); - name = examples; - path = ../examples; - sourceTree = ""; - }; - 4B01D72015B2F54C002D5007 /* src */ = { - isa = PBXGroup; - children = ( - 4B55D93F2475274B00CE8C38 /* CMakeLists.txt */, - 4B01D72115B2F572002D5007 /* zipcmp.c */, - 4B01D72215B2F572002D5007 /* zipmerge.c */, - 4BACD57C15BC2AEF00920691 /* ziptool.c */, - ); - name = src; - path = ../src; - sourceTree = ""; - }; - 4B28A9EA15BACBE100D0C17D /* man */ = { - isa = PBXGroup; - children = ( - 4BCD77A91A14ED5C001A9F55 /* CMakeLists.txt */, - 4B1ABD1B1A2E5E4D00C93867 /* handle_links */, - 4B1ABD1A1A2E5DA700C93867 /* links */, - 4BC386511A1BE04700CDCAAC /* fix-man-links.sh */, - 4BC386521A1BE04700CDCAAC /* make_zip_errors.sh */, - 4B26FF181A07DFEA000E9788 /* mkdocset.pl */, - 4BC386531A1BE04700CDCAAC /* nih-man.css */, - 4B28A9EC15BACC3900D0C17D /* libzip.mdoc */, - 4B28A9ED15BACC3900D0C17D /* zip_add_dir.mdoc */, - 4B28A9EE15BACC3900D0C17D /* zip_add.mdoc */, - 4B28A9EF15BACC3900D0C17D /* zip_close.mdoc */, - 4B28A9F015BACC3900D0C17D /* zip_delete.mdoc */, - 4B28A9F115BACC3900D0C17D /* zip_dir_add.mdoc */, - 4B28A9F215BACC3900D0C17D /* zip_discard.mdoc */, - 4B28A9F315BACC3900D0C17D /* zip_error_clear.mdoc */, - 4B1E46E51A08CB7600A376D2 /* zip_error_code_system.mdoc */, - 4B1E46E61A08CB7600A376D2 /* zip_error_code_zip.mdoc */, - 4B1E46E71A08CB7600A376D2 /* zip_error_fini.mdoc */, - 4B28A9F415BACC3900D0C17D /* zip_error_get_sys_type.mdoc */, - 4B28A9F515BACC3900D0C17D /* zip_error_get.mdoc */, - 4B1E46E81A08CB7600A376D2 /* zip_error_init.mdoc */, - 4B1E46E91A08CB7600A376D2 /* zip_error_set.mdoc */, - 4B1E46EA1A08CB7600A376D2 /* zip_error_strerror.mdoc */, - 4B1E46EB1A08CB7600A376D2 /* zip_error_system_type.mdoc */, - 4BC972001A0A1D85003A2981 /* zip_error_to_data.mdoc */, - 4B28A9F615BACC3900D0C17D /* zip_error_to_str.mdoc */, - 4B28A9F715BACC3900D0C17D /* zip_errors.mdoc */, - 4B28A9F815BACC3900D0C17D /* zip_fclose.mdoc */, - 4B28A9F915BACC3900D0C17D /* zip_fdopen.mdoc */, - 4B28A9FA15BACC3900D0C17D /* zip_file_add.mdoc */, - 4B28A9FB15BACC3900D0C17D /* zip_file_extra_field_delete.mdoc */, - 4B28A9FC15BACC3900D0C17D /* zip_file_extra_field_get.mdoc */, - 4B28A9FD15BACC3900D0C17D /* zip_file_extra_field_set.mdoc */, - 4B28A9FE15BACC3900D0C17D /* zip_file_extra_fields_count.mdoc */, - 4B28A9FF15BACC3900D0C17D /* zip_file_get_comment.mdoc */, - 4BCD77A71A14E404001A9F55 /* zip_file_get_error.mdoc */, - 4B26FF151A07DF1A000E9788 /* zip_file_get_external_attributes.mdoc */, - 4B28AA0015BACC3900D0C17D /* zip_file_rename.mdoc */, - 4B28AA0115BACC3900D0C17D /* zip_file_set_comment.mdoc */, - 4B26FF161A07DF1A000E9788 /* zip_file_set_external_attributes.mdoc */, - 4B26FF171A07DF1A000E9788 /* zip_file_set_mtime.mdoc */, - 4B28AA0215BACC3900D0C17D /* zip_file_strerror.mdoc */, - 4B28AA0315BACC3900D0C17D /* zip_fopen_encrypted.mdoc */, - 4B28AA0415BACC3900D0C17D /* zip_fopen.mdoc */, - 4B28AA0515BACC3900D0C17D /* zip_fread.mdoc */, - 4B28AA0615BACC3900D0C17D /* zip_get_archive_comment.mdoc */, - 4B28AA0715BACC3900D0C17D /* zip_get_archive_flag.mdoc */, - 4BC3863E1A1BE00E00CDCAAC /* zip_get_error.mdoc */, - 4B28AA0815BACC3900D0C17D /* zip_get_file_comment.mdoc */, - 4B28AA0915BACC3900D0C17D /* zip_get_name.mdoc */, - 4B28AA0A15BACC3900D0C17D /* zip_get_num_entries.mdoc */, - 4B28AA0B15BACC3900D0C17D /* zip_get_num_files.mdoc */, - 4B28AA0C15BACC3900D0C17D /* zip_name_locate.mdoc */, - 4B28AA0D15BACC3900D0C17D /* zip_open.mdoc */, - 4B28AA0E15BACC3900D0C17D /* zip_rename.mdoc */, - 4B28AA0F15BACC3900D0C17D /* zip_set_archive_comment.mdoc */, - 4B28AA1015BACC3900D0C17D /* zip_set_archive_flag.mdoc */, - 4B28AA1115BACC3900D0C17D /* zip_set_default_password.mdoc */, - 4B28AA1215BACC3900D0C17D /* zip_set_file_comment.mdoc */, - 4B28AA1315BACC3900D0C17D /* zip_set_file_compression.mdoc */, - 4BC3863F1A1BE00E00CDCAAC /* zip_source_begin_write.mdoc */, - 4B28AA1415BACC3900D0C17D /* zip_source_buffer.mdoc */, - 4BC03FA11FDD603F003C7B62 /* zip_source_buffer_fragment.mdoc */, - 4BC386401A1BE00E00CDCAAC /* zip_source_close.mdoc */, - 4BC386411A1BE00E00CDCAAC /* zip_source_commit_write.mdoc */, - 4BC386421A1BE00E00CDCAAC /* zip_source_error.mdoc */, - 4B28AA1515BACC3900D0C17D /* zip_source_file.mdoc */, - 4B28AA1615BACC3900D0C17D /* zip_source_filep.mdoc */, - 4B28AA1715BACC3900D0C17D /* zip_source_free.mdoc */, - 4B28AA1815BACC3900D0C17D /* zip_source_function.mdoc */, - 4BC386431A1BE00E00CDCAAC /* ZIP_SOURCE_GET_ARGS.mdoc */, - 4BC386441A1BE00E00CDCAAC /* zip_source_is_deleted.mdoc */, - 4BC386451A1BE00E00CDCAAC /* zip_source_keep.mdoc */, - 4BC386461A1BE00E00CDCAAC /* zip_source_make_command_bitmap.mdoc */, - 4BC386471A1BE00E00CDCAAC /* zip_source_open.mdoc */, - 4BC386481A1BE00E00CDCAAC /* zip_source_read.mdoc */, - 4BC386491A1BE00E00CDCAAC /* zip_source_rollback_write.mdoc */, - 4BCD77A81A14E921001A9F55 /* zip_source_seek_compute_offset.mdoc */, - 4BC3864A1A1BE00E00CDCAAC /* zip_source_seek_write.mdoc */, - 4BC3864B1A1BE00E00CDCAAC /* zip_source_seek.mdoc */, - 4BC3864C1A1BE00E00CDCAAC /* zip_source_stat.mdoc */, - 4BC3864D1A1BE00E00CDCAAC /* zip_source_tell_write.mdoc */, - 4BC3864E1A1BE00E00CDCAAC /* zip_source_tell.mdoc */, - 4BC3864F1A1BE00E00CDCAAC /* zip_source_write.mdoc */, - 4B28AA1915BACC3900D0C17D /* zip_source_zip.mdoc */, - 4BC386501A1BE00E00CDCAAC /* zip_source.mdoc */, - 4B28AA1A15BACC3900D0C17D /* zip_stat_init.mdoc */, - 4B28AA1B15BACC3900D0C17D /* zip_stat.mdoc */, - 4B28AA1C15BACC3900D0C17D /* zip_unchange_all.mdoc */, - 4B28AA1D15BACC3900D0C17D /* zip_unchange_archive.mdoc */, - 4B28AA1E15BACC3900D0C17D /* zip_unchange.mdoc */, - 4B28AA1F15BACC3900D0C17D /* zipcmp.mdoc */, - 4B28AA2015BACC3900D0C17D /* zipmerge.mdoc */, - ); - name = man; - path = ../man; - sourceTree = ""; - }; - 4B28AA2815BAD4F800D0C17D /* info */ = { - isa = PBXGroup; - children = ( - 4B939965246553FD00AEBDA4 /* appveyor.yml */, - 4B28AA2215BAD4E200D0C17D /* API-CHANGES.md */, - 4B28AA2315BAD4E200D0C17D /* AUTHORS */, - 4B28AA2415BAD4E200D0C17D /* NEWS.md */, - 4B28AA2515BAD4E200D0C17D /* README.md */, - 4B51DDB21FDADEDF00C5CA85 /* INSTALL.md */, - 4B28AA2615BAD4E200D0C17D /* THANKS */, - 4B28AA2715BAD4E200D0C17D /* TODO.md */, - 4BFF2B341FDEEF8B006EF3F3 /* CMakeLists.txt */, - 4BFF2B351FDEF277006EF3F3 /* cmake-config.h.in */, - 4BFF2B361FDEF277006EF3F3 /* cmake-zipconf.h.in */, - ); - name = info; - path = ..; - sourceTree = ""; - }; - 4BACD57415BC2AA100920691 /* regress */ = { - isa = PBXGroup; - children = ( - 4BACD57715BC2AEF00920691 /* add_from_filep.c */, - 4BFF2B541FE13033006EF3F3 /* can_clone_file.c */, - 4BC03FA01FDD5660003C7B62 /* cleanup.cmake */, - 4BC03F9D1FDD5617003C7B62 /* CMakeLists.txt */, - 4BACD57A15BC2AEF00920691 /* fopen_unchanged.c */, - 4BACD57B15BC2AEF00920691 /* fread.c */, - 4BC03F9A1FDD5617003C7B62 /* fseek.c */, - 4BD6CB5E19E71B3B00710654 /* hole.c */, - 4BC03F9C1FDD5617003C7B62 /* malloc.c */, - 4B4CB5572483D7B7005C5428 /* nihtest.conf.in */, - 4BD155CE191CD28D0046F012 /* NiHTest.pm */, - 4BC03F991FDD5617003C7B62 /* nonrandomopen.c */, - 4BC03F9B1FDD5617003C7B62 /* nonrandomopentest.c */, - 4BD155CF191CD28D0046F012 /* runtest.in */, - 4BD6CB5C19E6A5D900710654 /* source_hole.c */, - 4BD35E401A33362A00256CB7 /* test cases */, - 4BACD58415BC2AEF00920691 /* tryopen.c */, - 4B51DDB31FDAE1DB00C5CA85 /* ziptool_regress.c */, - ); - name = regress; - path = ../regress; - sourceTree = ""; - }; - 4BD35E401A33362A00256CB7 /* test cases */ = { - isa = PBXGroup; - children = ( - 4BD35E411A33366200256CB7 /* add_dir.test */, - 4BD35E421A33366200256CB7 /* add_from_buffer.test */, - 4BD35E431A33366200256CB7 /* add_from_file_duplicate.test */, - 4BD35E441A33366200256CB7 /* add_from_file_twice_duplicate.test */, - 4BD35E451A33366200256CB7 /* add_from_file.test */, - 4BD35E461A33366200256CB7 /* add_from_filep.test */, - 4BD35E471A33366200256CB7 /* add_from_stdin.test */, - 4BD35E481A33366200256CB7 /* add_from_zip_closed.test */, - 4BD35E491A33366200256CB7 /* add_from_zip_deflated.test */, - 4BC03F891FDD55C3003C7B62 /* add_from_zip_deflated2.test */, - 4BD35E4A1A33366200256CB7 /* add_from_zip_partial_deflated.test */, - 4BD35E4B1A33366200256CB7 /* add_from_zip_partial_stored.test */, - 4BD35E4C1A33366200256CB7 /* add_from_zip_stored.test */, - 4BD35E4E1A33366200256CB7 /* add_stored_in_memory.test */, - 4BD35E4F1A33366200256CB7 /* add_stored.test */, - 4BC03F8E1FDD55C4003C7B62 /* buffer-fragment-read.test */, - 4BC03F941FDD55C5003C7B62 /* buffer-fragment-write.test */, - 4B00CA28242F5C2500E0B71C /* cancel_45.test */, - 4B00CA2B242F5C2500E0B71C /* cancel_90.test */, - 4B77E61D1FDEDEA5006786BA /* clone-buffer-add.test */, - 4B77E61B1FDEDEA4006786BA /* clone-buffer-delete.test */, - 4B77E61C1FDEDEA5006786BA /* clone-buffer-replace.test */, - 4B41A2651FE15E99005D8C91 /* clone-fs-add.test */, - 4B41A2661FE15FCE005D8C91 /* clone-fs-delete.test */, - 4B41A2671FE1604E005D8C91 /* clone-fs-replace.test */, - 4BD35E501A33366200256CB7 /* cm-default.test */, - 4BC03F9F1FDD5642003C7B62 /* count_entries.test */, - 4BC03F921FDD55C4003C7B62 /* decrypt-correct-password-aes128.test */, - 4BC03F821FDD55C2003C7B62 /* decrypt-correct-password-aes192.test */, - 4BC03F951FDD55C5003C7B62 /* decrypt-correct-password-aes256.test */, - 4BC03F7A1FDD55C1003C7B62 /* decrypt-correct-password-pkware.test */, - 4BC03F931FDD55C5003C7B62 /* decrypt-no-password-aes256.test */, - 4BC03F8F1FDD55C4003C7B62 /* decrypt-wrong-password-aes128.test */, - 4BC03F791FDD55C1003C7B62 /* decrypt-wrong-password-aes192.test */, - 4BC03F8A1FDD55C3003C7B62 /* decrypt-wrong-password-aes256.test */, - 4BC03F7C1FDD55C1003C7B62 /* decrypt-wrong-password-pkware.test */, - 4BD35E511A33366200256CB7 /* delete_add_same.test */, - 4BD35E521A33366200256CB7 /* delete_invalid.test */, - 4BD35E531A33366200256CB7 /* delete_last.test */, - 4BD35E541A33366200256CB7 /* delete_multiple_last.test */, - 4BD35E551A33366200256CB7 /* delete_multiple_partial.test */, - 4BD35E561A33366200256CB7 /* delete_renamed_rename.test */, - 4BD35E5B1A33366200256CB7 /* encrypt.test */, - 4BC03F8B1FDD55C3003C7B62 /* encryption-nonrandom-aes128.test */, - 4BC03F7B1FDD55C1003C7B62 /* encryption-nonrandom-aes192.test */, - 4BC03F831FDD55C2003C7B62 /* encryption-nonrandom-aes256.test */, - 4B00CA2A242F5C2500E0B71C /* encryption-nonrandom-pkware.test */, - 4BC03F881FDD55C3003C7B62 /* encryption-remove.test */, - 4BD35E5C1A33366200256CB7 /* extra_add_multiple.test */, - 4BD35E5D1A33366200256CB7 /* extra_add.test */, - 4BD35E5E1A33366200256CB7 /* extra_count_by_id.test */, - 4BD35E5F1A33366200256CB7 /* extra_count_ignore_zip64.test */, - 4BD35E601A33366200256CB7 /* extra_count.test */, - 4BD35E611A33366200256CB7 /* extra_delete_by_id.test */, - 4BD35E621A33366200256CB7 /* extra_delete.test */, - 4BC03F9E1FDD5642003C7B62 /* extra_field_align.test */, - 4BD35E631A33366200256CB7 /* extra_get_by_id.test */, - 4BD35E641A33366200256CB7 /* extra_get.test */, - 4BD35E651A33366200256CB7 /* extra_set_modify_c.test */, - 4BD35E661A33366200256CB7 /* extra_set_modify_l.test */, - 4BD35E671A33366200256CB7 /* extra_set.test */, - 4BC03F901FDD55C4003C7B62 /* fdopen_ok.test */, - 4BD35E681A33366200256CB7 /* file_comment_encmismatch.test */, - 4BD35E691A33366200256CB7 /* fopen_unchanged.test */, - 4BD35E6A1A33366200256CB7 /* fread.test */, - 4BC03F871FDD55C3003C7B62 /* fseek_deflated.test */, - 4BC03F7F1FDD55C2003C7B62 /* fseek_fail.test */, - 4BC03F841FDD55C2003C7B62 /* fseek_ok.test */, - 4BD35E6B1A33366200256CB7 /* get_comment.test */, - 4BC03F911FDD55C4003C7B62 /* junk_at_end.test */, - 4BC03F8D1FDD55C4003C7B62 /* junk_at_start.test */, - 4BD35E8E1A33366200256CB7 /* name_locate.test */, - 4BD35E8F1A33366200256CB7 /* open_cons_extrabytes.test */, - 4BD35E901A33366200256CB7 /* open_empty_2.test */, - 4BD35E911A33366200256CB7 /* open_empty.test */, - 4BD35E921A33366200256CB7 /* open_extrabytes.test */, - 4BC03F7E1FDD55C1003C7B62 /* open_file_count.test */, - 4BD35E931A33366200256CB7 /* open_filename_duplicate_consistency.test */, - 4BD35E941A33366200256CB7 /* open_filename_duplicate_empty_consistency.test */, - 4BD35E951A33366200256CB7 /* open_filename_duplicate_empty.test */, - 4BD35E961A33366200256CB7 /* open_filename_duplicate.test */, - 4BD35E971A33366200256CB7 /* open_filename_empty.test */, - 4BD35E981A33366200256CB7 /* open_incons.test */, - 4BC03F961FDD55C5003C7B62 /* open_many_fail.test */, - 4BD35E991A33366200256CB7 /* open_many_ok.test */, - 4BC03F801FDD55C2003C7B62 /* open_multidisk.test */, - 4BD35E9A1A33366200256CB7 /* open_new_but_exists.test */, - 4BD35E9B1A33366200256CB7 /* open_new_ok.test */, - 4BD35E9C1A33366200256CB7 /* open_nonarchive.test */, - 4BD35E9D1A33366200256CB7 /* open_nosuchfile.test */, - 4BD35E9E1A33366200256CB7 /* open_ok.test */, - 4BD35E9F1A33366200256CB7 /* open_too_short.test */, - 4BD35EA01A33366200256CB7 /* open_truncate.test */, - 4BC03F861FDD55C3003C7B62 /* open_zip64_3mf.test */, - 4BD35EA11A33366200256CB7 /* open_zip64_ok.test */, - 4BC03F7D1FDD55C1003C7B62 /* preload.test */, - 4BC03F8C1FDD55C4003C7B62 /* progress.test */, - 4BD35EA21A33366200256CB7 /* rename_ascii.test */, - 4BD35EA31A33366200256CB7 /* rename_cp437.test */, - 4BD35EA41A33366200256CB7 /* rename_deleted.test */, - 4BD35EA51A33366200256CB7 /* rename_fail.test */, - 4BD35EA61A33366200256CB7 /* rename_ok.test */, - 4BD35EA81A33366200256CB7 /* rename_utf8_encmismatch.test */, - 4BD35EA91A33366200256CB7 /* rename_utf8.test */, - 4BD35EAA1A33366200256CB7 /* set_comment_all.test */, - 4BD35EAB1A33366200256CB7 /* set_comment_localonly.test */, - 4BD35EAC1A33366200256CB7 /* set_comment_removeglobal.test */, - 4BD35EAD1A33366200256CB7 /* set_comment_revert.test */, - 4BC03F971FDD55C5003C7B62 /* set_compression_bzip2_to_deflate.test */, - 4BC03F811FDD55C2003C7B62 /* set_compression_deflate_to_bzip2.test */, - 4BD35EAE1A33366200256CB7 /* set_compression_deflate_to_deflate.test */, - 4BD35EAF1A33366200256CB7 /* set_compression_deflate_to_store.test */, - 4BC03F851FDD55C3003C7B62 /* set_compression_store_to_bzip2.test */, - 4BD35EB01A33366200256CB7 /* set_compression_store_to_deflate.test */, - 4BD35EB11A33366200256CB7 /* set_compression_store_to_store.test */, - 4B00CA29242F5C2500E0B71C /* set_compression_store_to_xz.test */, - 4BD35EB21A33366200256CB7 /* set_compression_unknown.test */, - 4B00CA2C242F5C2500E0B71C /* set_compression_xz_to_store.test */, - 4B00CA27242F5C2500E0B71C /* set_file_dostime.test */, - 4BC03F981FDD55C5003C7B62 /* set_file_mtime.test */, - 4BD35EB41A33366200256CB7 /* stat_index_cp437_guess.test */, - 4BD35EB51A33366200256CB7 /* stat_index_cp437_raw.test */, - 4BD35EB61A33366200256CB7 /* stat_index_cp437_strict.test */, - 4BD35EB71A33366200256CB7 /* stat_index_fileorder.test */, - 4BD35EB81A33366200256CB7 /* stat_index_streamed_zip64.test */, - 4BD35EB91A33366200256CB7 /* stat_index_streamed.test */, - 4BD35EBA1A33366200256CB7 /* stat_index_utf8_guess.test */, - 4BD35EBB1A33366200256CB7 /* stat_index_utf8_raw.test */, - 4BD35EBC1A33366200256CB7 /* stat_index_utf8_strict.test */, - 4BD35EBD1A33366200256CB7 /* stat_index_utf8_unmarked_strict.test */, - 4BD35EBE1A33366200256CB7 /* stat_index_zip64.test */, - 4BD35EE11A33366300256CB7 /* utf-8-standardization.test */, - 4BC03F781FDD55C1003C7B62 /* zip-in-archive-comment.test */, - 4BD35EE31A33366300256CB7 /* zip64_creation.test */, - 4BD35EE41A33366300256CB7 /* zip64_stored_creation.test */, - ); - name = "test cases"; - sourceTree = ""; - }; - 4BDC71BD15B181DA00236D3C = { - isa = PBXGroup; - children = ( - 4B3FAE832385C9E900192D6A /* README Xcode Project.md */, - 4B28AA2815BAD4F800D0C17D /* info */, - 4BDC71E415B182B200236D3C /* Supporting Files */, - 3D7E353E1B33063600022624 /* examples */, - 4BDC71E315B182B200236D3C /* libzip */, - 4B01D72015B2F54C002D5007 /* src */, - 4BACD57415BC2AA100920691 /* regress */, - 4B28A9EA15BACBE100D0C17D /* man */, - 4BDC71CA15B181DA00236D3C /* Frameworks */, - 4BDC71C915B181DA00236D3C /* Products */, - ); - sourceTree = ""; - tabWidth = 8; - }; - 4BDC71C915B181DA00236D3C /* Products */ = { - isa = PBXGroup; - children = ( - 4B01D68B15B2F3F1002D5007 /* libzip.framework */, - 4B01D6FD15B2F4B1002D5007 /* zipmerge */, - 4B01D71315B2F4EB002D5007 /* zipcmp */, - 4BACD58915BC2CEA00920691 /* ziptool */, - 4BACD5C115BC2DC900920691 /* add_from_filep */, - 4BACD5D015BC2DF200920691 /* fopen_unchanged */, - 4BACD5DF15BC2F3700920691 /* fread */, - 4BACD65015BC301300920691 /* tryopen */, - 4BD6CB6C19E71CD100710654 /* hole */, - 3D7E35371B3305FB00022624 /* in-memory */, - 4B51DDC01FDAE20A00C5CA85 /* ziptool_regress */, - 4BFF2B511FE12FCA006EF3F3 /* can_clone_file */, - ); - name = Products; - sourceTree = ""; - }; - 4BDC71CA15B181DA00236D3C /* Frameworks */ = { - isa = PBXGroup; - children = ( - 4B9E578724C9770C00CEE0D6 /* libzstd.1.4.5.dylib */, - 4B3FAE812385C79200192D6A /* liblzma.5.dylib */, - 4BE92AA820345E5500509BC8 /* libnettle.6.dylib */, - 4BE92AA620345E3800509BC8 /* libbz2.tbd */, - 4BE92AA420345E2E00509BC8 /* libgnutls.30.dylib */, - 3D7E35471B33076C00022624 /* libz.dylib */, - 4B01D70815B2F4CF002D5007 /* libz.dylib */, - ); - name = Frameworks; - sourceTree = ""; - }; - 4BDC71E315B182B200236D3C /* libzip */ = { - isa = PBXGroup; - children = ( - 4B77E61A1FDDCD3A006786BA /* CMakeLists.txt */, - 4BD25DA51CF58790005A9EC4 /* compat.h */, - 4BDC72A015B1B56400236D3C /* config.h */, - 4BDC71F115B1B25E00236D3C /* zip_add_dir.c */, - 4BDC71F215B1B25E00236D3C /* zip_add_entry.c */, - 4BDC71F315B1B25E00236D3C /* zip_add.c */, - 4B0454B41E8E3DF7002FA1F9 /* zip_algorithm_bzip2.c */, - 4B0454B51E8E3DF7002FA1F9 /* zip_algorithm_deflate.c */, - 4B3FAE7F2385C5A300192D6A /* zip_algorithm_xz.c */, - 4B9E577A24C7026B00CEE0D6 /* zip_algorithm_zstd.c */, - 4BCB434119E9347E0067FAA3 /* zip_buffer.c */, - 4BDC71F415B1B25E00236D3C /* zip_close.c */, - 4BE92AB1203597D700509BC8 /* zip_crypto_commoncrypto.c */, - 4BE92AB0203597D700509BC8 /* zip_crypto_commoncrypto.h */, - 4B69E6F020330D460001EEE7 /* zip_crypto_gnutls.c */, - 4B69E6F2203341D50001EEE7 /* zip_crypto_gnutls.h */, - 4B9E578424C9769F00CEE0D6 /* zip_crypto_mbedtls.c */, - 4B9E578624C9769F00CEE0D6 /* zip_crypto_mbedtls.h */, - 4BE92AAB20346B1900509BC8 /* zip_crypto_openssl.c */, - 4BE92AAA20346B1900509BC8 /* zip_crypto_openssl.h */, - 4B9E578324C9769F00CEE0D6 /* zip_crypto_win.c */, - 4B9E578524C9769F00CEE0D6 /* zip_crypto_win.h */, - 4B69E6F3203342E30001EEE7 /* zip_crypto.h */, - 4BDC71F515B1B25E00236D3C /* zip_delete.c */, - 4BDC71F615B1B25E00236D3C /* zip_dir_add.c */, - 4BDC71F715B1B25E00236D3C /* zip_dirent.c */, - 4BDC71F815B1B25E00236D3C /* zip_discard.c */, - 4BDC71F915B1B25E00236D3C /* zip_entry.c */, - 4B9E578924C9779900CEE0D6 /* zip_err_str.c */, - 4BDC71FB15B1B25E00236D3C /* zip_error_clear.c */, - 4BDC71FC15B1B25E00236D3C /* zip_error_get_sys_type.c */, - 4BDC71FD15B1B25E00236D3C /* zip_error_get.c */, - 4BDC71FE15B1B25E00236D3C /* zip_error_strerror.c */, - 4BDC71FF15B1B25E00236D3C /* zip_error_to_str.c */, - 4BDC720015B1B25E00236D3C /* zip_error.c */, - 4BDC720115B1B25E00236D3C /* zip_extra_field_api.c */, - 4BDC720215B1B25E00236D3C /* zip_extra_field.c */, - 4BDC720315B1B25E00236D3C /* zip_fclose.c */, - 4BDC720415B1B25E00236D3C /* zip_fdopen.c */, - 4BDC720515B1B25E00236D3C /* zip_file_add.c */, - 4BDC720615B1B25E00236D3C /* zip_file_error_clear.c */, - 4BDC720715B1B25E00236D3C /* zip_file_error_get.c */, - 4BDC720815B1B25E00236D3C /* zip_file_get_comment.c */, - 4B97204D188EBE85002FAFAD /* zip_file_get_external_attributes.c */, - 4BDC720915B1B25E00236D3C /* zip_file_get_offset.c */, - 4BDC720A15B1B25E00236D3C /* zip_file_rename.c */, - 4BDC720B15B1B25E00236D3C /* zip_file_replace.c */, - 4BDC720C15B1B25E00236D3C /* zip_file_set_comment.c */, - 736ED9B71E3D688C00C36873 /* zip_file_set_encryption.c */, - 4B97204E188EBE85002FAFAD /* zip_file_set_external_attributes.c */, - 4B82CED319915F360097BC18 /* zip_file_set_mtime.c */, - 4BDC720D15B1B25E00236D3C /* zip_file_strerror.c */, - 4BDC720F15B1B25E00236D3C /* zip_fopen_encrypted.c */, - 4BDC721015B1B25E00236D3C /* zip_fopen_index_encrypted.c */, - 4BDC721115B1B25E00236D3C /* zip_fopen_index.c */, - 4BDC721215B1B25E00236D3C /* zip_fopen.c */, - 4BDC721315B1B25E00236D3C /* zip_fread.c */, - 4B3A5F4D1DF96D83005A53A1 /* zip_fseek.c */, - 4B3A5F4E1DF96D83005A53A1 /* zip_ftell.c */, - 4BDC721415B1B25E00236D3C /* zip_get_archive_comment.c */, - 4BDC721515B1B25E00236D3C /* zip_get_archive_flag.c */, - 4BDC721715B1B25E00236D3C /* zip_get_encryption_implementation.c */, - 4BDC721815B1B25E00236D3C /* zip_get_file_comment.c */, - 4BDC721915B1B25E00236D3C /* zip_get_name.c */, - 4BDC721A15B1B25E00236D3C /* zip_get_num_entries.c */, - 4BDC721B15B1B25E00236D3C /* zip_get_num_files.c */, - 3D9284801C309510001EABA7 /* zip_hash.c */, - 4BCF3019199A2F820064207B /* zip_io_util.c */, - 4B908F502385BE6C00886355 /* zip_libzip_version.c */, - 4BDC721C15B1B25E00236D3C /* zip_memdup.c */, - 4B5169A722A7993D00AA4340 /* zip_mkstempm.c */, - 4BDC721D15B1B25E00236D3C /* zip_name_locate.c */, - 4BDC721E15B1B25E00236D3C /* zip_new.c */, - 4BDC721F15B1B25E00236D3C /* zip_open.c */, - 4B00CA22242F59D700E0B71C /* zip_pkware.c */, - 4BD708781EB1CF73003F351F /* zip_progress.c */, - 736ED9B81E3D688C00C36873 /* zip_random_unix.c */, - 4B939967246E842200AEBDA4 /* zip_random_uwp.c */, - 4B939966246E842200AEBDA4 /* zip_random_win32.c */, - 4BDC722015B1B25E00236D3C /* zip_rename.c */, - 4BDC722115B1B25E00236D3C /* zip_replace.c */, - 4BDC722215B1B25E00236D3C /* zip_set_archive_comment.c */, - 4BDC722315B1B25E00236D3C /* zip_set_archive_flag.c */, - 4BDC722415B1B25E00236D3C /* zip_set_default_password.c */, - 4BDC722515B1B25E00236D3C /* zip_set_file_comment.c */, - 4BDC722615B1B25E00236D3C /* zip_set_file_compression.c */, - 4BDC722715B1B25E00236D3C /* zip_set_name.c */, - 4B908F522385BE6D00886355 /* zip_source_accept_empty.c */, - 4BC03FA21FDD6B6F003C7B62 /* zip_source_begin_write_cloning.c */, - 4BCF301A199A2F820064207B /* zip_source_begin_write.c */, - 4BDC722815B1B25E00236D3C /* zip_source_buffer.c */, - 4BD5053219A0116D007DD28A /* zip_source_call.c */, - 4BDC722915B1B25E00236D3C /* zip_source_close.c */, - 4BCF301B199A2F820064207B /* zip_source_commit_write.c */, - 4B0454B61E8E3DF7002FA1F9 /* zip_source_compress.c */, - 4BDC722A15B1B25E00236D3C /* zip_source_crc.c */, - 4BDC722C15B1B25E00236D3C /* zip_source_error.c */, - 4B93995624631B3E00AEBDA4 /* zip_source_file_common.c */, - 4B93995524631B3D00AEBDA4 /* zip_source_file_stdio_named.c */, - 4B93995724631B3E00AEBDA4 /* zip_source_file_stdio.c */, - 4B93995824631B3E00AEBDA4 /* zip_source_file_stdio.h */, - 4B93996124641D5700AEBDA4 /* zip_source_file_win32_ansi.c */, - 4B93996424644E7E00AEBDA4 /* zip_source_file_win32_named.c */, - 4B93996224643F5700AEBDA4 /* zip_source_file_win32_utf8.c */, - 4B9399632464401300AEBDA4 /* zip_source_file_win32_utf16.c */, - 4B93996024640B1700AEBDA4 /* zip_source_file_win32.c */, - 4B93995F24640B1700AEBDA4 /* zip_source_file_win32.h */, - 4B93995924631B3E00AEBDA4 /* zip_source_file.h */, - 4BDC722F15B1B25E00236D3C /* zip_source_free.c */, - 4BDC723015B1B25E00236D3C /* zip_source_function.c */, - 4B5D0CD4244B154E006C2E93 /* zip_source_get_file_attributes.c */, - 4BE402AC19D94AE400298248 /* zip_source_is_deleted.c */, - 4BDC723115B1B25E00236D3C /* zip_source_layered.c */, - 4BDC723215B1B25E00236D3C /* zip_source_open.c */, - 4B00CA21242F59D700E0B71C /* zip_source_pkware_decode.c */, - 4B00CA23242F59D700E0B71C /* zip_source_pkware_encode.c */, - 4BDC723515B1B25E00236D3C /* zip_source_read.c */, - 4BCF3031199ABD3A0064207B /* zip_source_remove.c */, - 4BCF301C199A2F820064207B /* zip_source_rollback_write.c */, - 4BCF3034199ABDDA0064207B /* zip_source_seek_write.c */, - 4BCF301D199A2F820064207B /* zip_source_seek.c */, - 4BDC723615B1B25E00236D3C /* zip_source_stat.c */, - 4BCF301E199A2F820064207B /* zip_source_supports.c */, - 4BCF3035199ABDDA0064207B /* zip_source_tell_write.c */, - 4BCF301F199A2F820064207B /* zip_source_tell.c */, - 4BDC723715B1B25E00236D3C /* zip_source_window.c */, - 736ED9B91E3D688C00C36873 /* zip_source_winzip_aes_decode.c */, - 736ED9BA1E3D688C00C36873 /* zip_source_winzip_aes_encode.c */, - 4BCF3020199A2F820064207B /* zip_source_write.c */, - 4BDC723815B1B25E00236D3C /* zip_source_zip_new.c */, - 4BDC723915B1B25E00236D3C /* zip_source_zip.c */, - 4BDC723A15B1B25E00236D3C /* zip_stat_index.c */, - 4BDC723B15B1B25E00236D3C /* zip_stat_init.c */, - 4BDC723C15B1B25E00236D3C /* zip_stat.c */, - 4BDC723D15B1B25E00236D3C /* zip_strerror.c */, - 4BDC723E15B1B25E00236D3C /* zip_string.c */, - 4BDC723F15B1B25E00236D3C /* zip_unchange_all.c */, - 4BDC724015B1B25E00236D3C /* zip_unchange_archive.c */, - 4BDC724115B1B25E00236D3C /* zip_unchange_data.c */, - 4BDC724215B1B25E00236D3C /* zip_unchange.c */, - 4BDC724315B1B25E00236D3C /* zip_utf-8.c */, - 4B69E6ED2032F1870001EEE7 /* zip_winzip_aes.c */, - 4BDC729815B1B2A600236D3C /* zip.h */, - 4BDC729E15B1B4E900236D3C /* zipconf.h */, - 4BDC729915B1B2A600236D3C /* zipint.h */, - ); - name = libzip; - path = ../lib; - sourceTree = ""; - }; - 4BDC71E415B182B200236D3C /* Supporting Files */ = { - isa = PBXGroup; - children = ( - 3D77B86517009AA1000A5794 /* extract-version.sh */, - 4B01D73D15B2FB6B002D5007 /* Info.plist */, - ); - name = "Supporting Files"; - path = libzip; - sourceTree = ""; - }; -/* End PBXGroup section */ - -/* Begin PBXHeadersBuildPhase section */ - 4B01D68815B2F3F1002D5007 /* Headers */ = { - isa = PBXHeadersBuildPhase; - buildActionMask = 2147483647; - files = ( - 4BE92AB3203597D700509BC8 /* zip_crypto_commoncrypto.h in Headers */, - 4B93995D24631B3E00AEBDA4 /* zip_source_file_stdio.h in Headers */, - 4BE92AAD20346B1900509BC8 /* zip_crypto_openssl.h in Headers */, - 4B93995E24631B3E00AEBDA4 /* zip_source_file.h in Headers */, - 4B01D73215B2F5EE002D5007 /* zipconf.h in Headers */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXHeadersBuildPhase section */ - -/* Begin PBXNativeTarget section */ - 3D7E35361B3305FB00022624 /* in-memory */ = { - isa = PBXNativeTarget; - buildConfigurationList = 3D7E353D1B3305FB00022624 /* Build configuration list for PBXNativeTarget "in-memory" */; - buildPhases = ( - 3D7E35331B3305FB00022624 /* Sources */, - 3D7E35341B3305FB00022624 /* Frameworks */, - 3D7E35351B3305FB00022624 /* CopyFiles */, - ); - buildRules = ( - ); - dependencies = ( - 3D7E35451B33064500022624 /* PBXTargetDependency */, - ); - name = "in-memory"; - productName = "in-memory-example"; - productReference = 3D7E35371B3305FB00022624 /* in-memory */; - productType = "com.apple.product-type.tool"; - }; - 4B01D68A15B2F3F1002D5007 /* libzip */ = { - isa = PBXNativeTarget; - buildConfigurationList = 4B01D69E15B2F3F1002D5007 /* Build configuration list for PBXNativeTarget "libzip" */; - buildPhases = ( - 4B01D68615B2F3F1002D5007 /* Sources */, - 4B01D68715B2F3F1002D5007 /* Frameworks */, - 4B01D68815B2F3F1002D5007 /* Headers */, - 4B01D68915B2F3F1002D5007 /* Resources */, - 3D77B86617009AC5000A5794 /* Copy Version Info from config.h */, - 4B972053188EBEB8002FAFAD /* Fix zipconf.h include. */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = libzip; - productName = "libzip Mac"; - productReference = 4B01D68B15B2F3F1002D5007 /* libzip.framework */; - productType = "com.apple.product-type.framework"; - }; - 4B01D6FC15B2F4B1002D5007 /* zipmerge */ = { - isa = PBXNativeTarget; - buildConfigurationList = 4B01D70415B2F4B1002D5007 /* Build configuration list for PBXNativeTarget "zipmerge" */; - buildPhases = ( - 4B01D6F915B2F4B1002D5007 /* Sources */, - 4B01D6FA15B2F4B1002D5007 /* Frameworks */, - 4B01D6FB15B2F4B1002D5007 /* CopyFiles */, - ); - buildRules = ( - ); - dependencies = ( - 4B01D73615B2F639002D5007 /* PBXTargetDependency */, - ); - name = zipmerge; - productName = zipmerge; - productReference = 4B01D6FD15B2F4B1002D5007 /* zipmerge */; - productType = "com.apple.product-type.tool"; - }; - 4B01D70A15B2F4EB002D5007 /* zipcmp */ = { - isa = PBXNativeTarget; - buildConfigurationList = 4B01D71015B2F4EB002D5007 /* Build configuration list for PBXNativeTarget "zipcmp" */; - buildPhases = ( - 4B01D70B15B2F4EB002D5007 /* Sources */, - 4B01D70C15B2F4EB002D5007 /* Frameworks */, - 4B01D70F15B2F4EB002D5007 /* CopyFiles */, - ); - buildRules = ( - ); - dependencies = ( - 4B01D73815B2F643002D5007 /* PBXTargetDependency */, - ); - name = zipcmp; - productName = zipcmp; - productReference = 4B01D71315B2F4EB002D5007 /* zipcmp */; - productType = "com.apple.product-type.tool"; - }; - 4B51DDB41FDAE20A00C5CA85 /* ziptool_regress */ = { - isa = PBXNativeTarget; - buildConfigurationList = 4B51DDBD1FDAE20A00C5CA85 /* Build configuration list for PBXNativeTarget "ziptool_regress" */; - buildPhases = ( - 4B51DDB71FDAE20A00C5CA85 /* Sources */, - 4B51DDB91FDAE20A00C5CA85 /* Frameworks */, - 4B51DDBC1FDAE20A00C5CA85 /* CopyFiles */, - ); - buildRules = ( - ); - dependencies = ( - 4B51DDB51FDAE20A00C5CA85 /* PBXTargetDependency */, - ); - name = ziptool_regress; - productName = ziptool; - productReference = 4B51DDC01FDAE20A00C5CA85 /* ziptool_regress */; - productType = "com.apple.product-type.tool"; - }; - 4BACD58815BC2CEA00920691 /* ziptool */ = { - isa = PBXNativeTarget; - buildConfigurationList = 4BACD59015BC2CEA00920691 /* Build configuration list for PBXNativeTarget "ziptool" */; - buildPhases = ( - 4BACD58515BC2CEA00920691 /* Sources */, - 4BACD58615BC2CEA00920691 /* Frameworks */, - 4BACD58715BC2CEA00920691 /* CopyFiles */, - ); - buildRules = ( - ); - dependencies = ( - 4BACD59715BC2D3800920691 /* PBXTargetDependency */, - ); - name = ziptool; - productName = ziptool; - productReference = 4BACD58915BC2CEA00920691 /* ziptool */; - productType = "com.apple.product-type.tool"; - }; - 4BACD5B515BC2DC900920691 /* add_from_filep */ = { - isa = PBXNativeTarget; - buildConfigurationList = 4BACD5BE15BC2DC900920691 /* Build configuration list for PBXNativeTarget "add_from_filep" */; - buildPhases = ( - 4BACD5B815BC2DC900920691 /* Sources */, - 4BACD5BA15BC2DC900920691 /* Frameworks */, - 4BACD5BD15BC2DC900920691 /* CopyFiles */, - ); - buildRules = ( - ); - dependencies = ( - 4BACD5B615BC2DC900920691 /* PBXTargetDependency */, - ); - name = add_from_filep; - productName = add_from_filep; - productReference = 4BACD5C115BC2DC900920691 /* add_from_filep */; - productType = "com.apple.product-type.tool"; - }; - 4BACD5C415BC2DF200920691 /* fopen_unchanged */ = { - isa = PBXNativeTarget; - buildConfigurationList = 4BACD5CD15BC2DF200920691 /* Build configuration list for PBXNativeTarget "fopen_unchanged" */; - buildPhases = ( - 4BACD5C715BC2DF200920691 /* Sources */, - 4BACD5C915BC2DF200920691 /* Frameworks */, - 4BACD5CC15BC2DF200920691 /* CopyFiles */, - ); - buildRules = ( - ); - dependencies = ( - 4BACD5C515BC2DF200920691 /* PBXTargetDependency */, - ); - name = fopen_unchanged; - productName = fopen_unchanged; - productReference = 4BACD5D015BC2DF200920691 /* fopen_unchanged */; - productType = "com.apple.product-type.tool"; - }; - 4BACD5D315BC2F3700920691 /* fread */ = { - isa = PBXNativeTarget; - buildConfigurationList = 4BACD5DC15BC2F3700920691 /* Build configuration list for PBXNativeTarget "fread" */; - buildPhases = ( - 4BACD5D615BC2F3700920691 /* Sources */, - 4BACD5D815BC2F3700920691 /* Frameworks */, - 4BACD5DB15BC2F3700920691 /* CopyFiles */, - ); - buildRules = ( - ); - dependencies = ( - 4BACD5D415BC2F3700920691 /* PBXTargetDependency */, - ); - name = fread; - productName = fread; - productReference = 4BACD5DF15BC2F3700920691 /* fread */; - productType = "com.apple.product-type.tool"; - }; - 4BACD64515BC301300920691 /* tryopen */ = { - isa = PBXNativeTarget; - buildConfigurationList = 4BACD64D15BC301300920691 /* Build configuration list for PBXNativeTarget "tryopen" */; - buildPhases = ( - 4BACD64815BC301300920691 /* Sources */, - 4BACD64915BC301300920691 /* Frameworks */, - 4BACD64C15BC301300920691 /* CopyFiles */, - ); - buildRules = ( - ); - dependencies = ( - 4BACD64615BC301300920691 /* PBXTargetDependency */, - ); - name = tryopen; - productName = tryopen; - productReference = 4BACD65015BC301300920691 /* tryopen */; - productType = "com.apple.product-type.tool"; - }; - 4BD6CB5F19E71CD100710654 /* hole */ = { - isa = PBXNativeTarget; - buildConfigurationList = 4BD6CB6919E71CD100710654 /* Build configuration list for PBXNativeTarget "hole" */; - buildPhases = ( - 4BD6CB6219E71CD100710654 /* Sources */, - 4BD6CB6519E71CD100710654 /* Frameworks */, - 4BD6CB6819E71CD100710654 /* CopyFiles */, - ); - buildRules = ( - ); - dependencies = ( - 4BD6CB6019E71CD100710654 /* PBXTargetDependency */, - ); - name = hole; - productName = hole; - productReference = 4BD6CB6C19E71CD100710654 /* hole */; - productType = "com.apple.product-type.tool"; - }; - 4BFF2B451FE12FCA006EF3F3 /* can_clone_file */ = { - isa = PBXNativeTarget; - buildConfigurationList = 4BFF2B4E1FE12FCA006EF3F3 /* Build configuration list for PBXNativeTarget "can_clone_file" */; - buildPhases = ( - 4BFF2B481FE12FCA006EF3F3 /* Sources */, - 4BFF2B4A1FE12FCA006EF3F3 /* Frameworks */, - 4BFF2B4D1FE12FCA006EF3F3 /* CopyFiles */, - ); - buildRules = ( - ); - dependencies = ( - ); - name = can_clone_file; - productName = tryopen; - productReference = 4BFF2B511FE12FCA006EF3F3 /* can_clone_file */; - productType = "com.apple.product-type.tool"; - }; -/* End PBXNativeTarget section */ - -/* Begin PBXProject section */ - 4BDC71BF15B181DA00236D3C /* Project object */ = { - isa = PBXProject; - attributes = { - LastUpgradeCheck = 1140; - ORGANIZATIONNAME = NiH; - TargetAttributes = { - 3D7E35361B3305FB00022624 = { - CreatedOnToolsVersion = 6.3.2; - }; - }; - }; - buildConfigurationList = 4BDC71C215B181DA00236D3C /* Build configuration list for PBXProject "libzip" */; - compatibilityVersion = "Xcode 3.2"; - developmentRegion = en; - hasScannedForEncodings = 0; - knownRegions = ( - en, - Base, - ); - mainGroup = 4BDC71BD15B181DA00236D3C; - productRefGroup = 4BDC71C915B181DA00236D3C /* Products */; - projectDirPath = ""; - projectRoot = ""; - targets = ( - 4B54447915C977A20067BA33 /* all */, - 4B01D72815B2F5A2002D5007 /* command line tools */, - 4BCF6A681C3BDDD500F036E9 /* examples */, - 4BACD5A715BC2D8200920691 /* test programs */, - 4B01D68A15B2F3F1002D5007 /* libzip */, - 4B01D6FC15B2F4B1002D5007 /* zipmerge */, - 4B01D70A15B2F4EB002D5007 /* zipcmp */, - 3D7E35361B3305FB00022624 /* in-memory */, - 4BACD5B515BC2DC900920691 /* add_from_filep */, - 4BFF2B451FE12FCA006EF3F3 /* can_clone_file */, - 4BACD5C415BC2DF200920691 /* fopen_unchanged */, - 4BACD5D315BC2F3700920691 /* fread */, - 4BD6CB5F19E71CD100710654 /* hole */, - 4BACD58815BC2CEA00920691 /* ziptool */, - 4BACD64515BC301300920691 /* tryopen */, - 4B51DDB41FDAE20A00C5CA85 /* ziptool_regress */, - ); - }; -/* End PBXProject section */ - -/* Begin PBXResourcesBuildPhase section */ - 4B01D68915B2F3F1002D5007 /* Resources */ = { - isa = PBXResourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 4B00CA32242F5C2500E0B71C /* set_compression_xz_to_store.test in Resources */, - 4B00CA2E242F5C2500E0B71C /* cancel_45.test in Resources */, - 4B00CA31242F5C2500E0B71C /* cancel_90.test in Resources */, - 4B00CA2D242F5C2500E0B71C /* set_file_dostime.test in Resources */, - 4B00CA30242F5C2500E0B71C /* encryption-nonrandom-pkware.test in Resources */, - 4B00CA2F242F5C2500E0B71C /* set_compression_store_to_xz.test in Resources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXResourcesBuildPhase section */ - -/* Begin PBXShellScriptBuildPhase section */ - 3D77B86617009AC5000A5794 /* Copy Version Info from config.h */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Copy Version Info from config.h"; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "./extract-version.sh \"config.h\" \"Info.plist\" "; - }; - 4B972053188EBEB8002FAFAD /* Fix zipconf.h include. */ = { - isa = PBXShellScriptBuildPhase; - buildActionMask = 2147483647; - files = ( - ); - inputPaths = ( - ); - name = "Fix zipconf.h include."; - outputPaths = ( - ); - runOnlyForDeploymentPostprocessing = 0; - shellPath = /bin/sh; - shellScript = "sed \"s,,<$EXECUTABLE_NAME/zipconf.h>,\" ../lib/zip.h > \"$BUILT_PRODUCTS_DIR/$CONTENTS_FOLDER_PATH/Headers/zip.h\""; - }; -/* End PBXShellScriptBuildPhase section */ - -/* Begin PBXSourcesBuildPhase section */ - 3D7E35331B3305FB00022624 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 3D7E35431B33063F00022624 /* in-memory.c in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 4B01D68615B2F3F1002D5007 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 3D7E35491B330AD500022624 /* zip_source_is_deleted.c in Sources */, - 4BCF3039199ABDDA0064207B /* zip_source_tell_write.c in Sources */, - 4B01D6A615B2F46B002D5007 /* zip_add_dir.c in Sources */, - 4B972052188EBE85002FAFAD /* zip_file_set_external_attributes.c in Sources */, - 4B0454BA1E8E3E08002FA1F9 /* zip_source_compress.c in Sources */, - 4B3FAE802385C5CC00192D6A /* zip_algorithm_xz.c in Sources */, - 4BCF3024199A2F820064207B /* zip_source_begin_write.c in Sources */, - 4B01D6A715B2F46B002D5007 /* zip_add_entry.c in Sources */, - 4B01D6A815B2F46B002D5007 /* zip_add.c in Sources */, - 4B01D6A915B2F46B002D5007 /* zip_close.c in Sources */, - 4B01D6AA15B2F46B002D5007 /* zip_delete.c in Sources */, - 4B01D6AB15B2F46B002D5007 /* zip_dir_add.c in Sources */, - 4BD7087A1EB1CF73003F351F /* zip_progress.c in Sources */, - 4B01D6AC15B2F46B002D5007 /* zip_dirent.c in Sources */, - 4B00CA24242F59D700E0B71C /* zip_source_pkware_decode.c in Sources */, - 4B93995A24631B3E00AEBDA4 /* zip_source_file_stdio_named.c in Sources */, - 4B01D6AD15B2F46B002D5007 /* zip_discard.c in Sources */, - 4B00CA25242F59D700E0B71C /* zip_pkware.c in Sources */, - 4B01D6AE15B2F46B002D5007 /* zip_entry.c in Sources */, - 4B3A5F521DF96EB4005A53A1 /* zip_fseek.c in Sources */, - 4B01D6B015B2F46B002D5007 /* zip_error_clear.c in Sources */, - 4B01D6B115B2F46B002D5007 /* zip_error_get_sys_type.c in Sources */, - 4B01D6B215B2F46B002D5007 /* zip_error_get.c in Sources */, - 4B01D6B315B2F46B002D5007 /* zip_error_strerror.c in Sources */, - 4B01D6B415B2F46B002D5007 /* zip_error_to_str.c in Sources */, - 4B01D6B515B2F46B002D5007 /* zip_error.c in Sources */, - 736ED9BB1E3D6B6B00C36873 /* zip_source_winzip_aes_decode.c in Sources */, - 4B01D6B615B2F46B002D5007 /* zip_extra_field_api.c in Sources */, - 4B9E578A24C9779900CEE0D6 /* zip_err_str.c in Sources */, - 4B3A5F531DF96EB4005A53A1 /* zip_ftell.c in Sources */, - 4B01D6B715B2F46B002D5007 /* zip_extra_field.c in Sources */, - 4B01D6B815B2F46B002D5007 /* zip_fclose.c in Sources */, - 4B01D6B915B2F46B002D5007 /* zip_fdopen.c in Sources */, - 4B01D6BA15B2F46B002D5007 /* zip_file_add.c in Sources */, - 4B01D6BB15B2F46B002D5007 /* zip_file_error_clear.c in Sources */, - 4BCF3026199A2F820064207B /* zip_source_commit_write.c in Sources */, - 4B93995C24631B3E00AEBDA4 /* zip_source_file_stdio.c in Sources */, - 4B01D6BC15B2F46B002D5007 /* zip_file_error_get.c in Sources */, - 4B01D6BD15B2F46B002D5007 /* zip_file_get_comment.c in Sources */, - 4B01D6BE15B2F46B002D5007 /* zip_file_get_offset.c in Sources */, - 4B01D6BF15B2F46B002D5007 /* zip_file_rename.c in Sources */, - 4B0454BD1E8E3E24002FA1F9 /* zip_algorithm_deflate.c in Sources */, - 4B01D6C015B2F46B002D5007 /* zip_file_replace.c in Sources */, - 4B01D6C115B2F46B002D5007 /* zip_file_set_comment.c in Sources */, - 4BCF3033199ABD3A0064207B /* zip_source_remove.c in Sources */, - 4B01D6C215B2F46B002D5007 /* zip_file_strerror.c in Sources */, - 4B01D6C415B2F46B002D5007 /* zip_fopen_encrypted.c in Sources */, - 4BCF302A199A2F820064207B /* zip_source_seek.c in Sources */, - 4B01D6C515B2F46B002D5007 /* zip_fopen_index_encrypted.c in Sources */, - 4B01D6C615B2F46B002D5007 /* zip_fopen_index.c in Sources */, - 4B5169A822A7993E00AA4340 /* zip_mkstempm.c in Sources */, - 4B69E6EE2032F18B0001EEE7 /* zip_winzip_aes.c in Sources */, - 4B01D6C715B2F46B002D5007 /* zip_fopen.c in Sources */, - 3D9284821C309510001EABA7 /* zip_hash.c in Sources */, - 4B01D6C815B2F46B002D5007 /* zip_fread.c in Sources */, - 736ED9BF1E3D6B7C00C36873 /* zip_file_set_encryption.c in Sources */, - 4B01D6C915B2F46B002D5007 /* zip_get_archive_comment.c in Sources */, - 4B5D0CD5244B154E006C2E93 /* zip_source_get_file_attributes.c in Sources */, - 4B01D6CA15B2F46B002D5007 /* zip_get_archive_flag.c in Sources */, - 4BE92AB5203597D700509BC8 /* zip_crypto_commoncrypto.c in Sources */, - 4B0454BC1E8E3E24002FA1F9 /* zip_algorithm_bzip2.c in Sources */, - 736ED9BC1E3D6B6F00C36873 /* zip_source_winzip_aes_encode.c in Sources */, - 4BD5053419A01BB0007DD28A /* zip_source_call.c in Sources */, - 4B93995B24631B3E00AEBDA4 /* zip_source_file_common.c in Sources */, - 4BCF3030199A2F820064207B /* zip_source_write.c in Sources */, - 4B01D6CC15B2F46B002D5007 /* zip_get_encryption_implementation.c in Sources */, - 4B908F552385BE6D00886355 /* zip_source_accept_empty.c in Sources */, - 4B01D6CD15B2F46B002D5007 /* zip_get_file_comment.c in Sources */, - 4B01D6CE15B2F46B002D5007 /* zip_get_name.c in Sources */, - 4B01D6CF15B2F46B002D5007 /* zip_get_num_entries.c in Sources */, - 4B01D6D015B2F46B002D5007 /* zip_get_num_files.c in Sources */, - 4B01D6D115B2F46B002D5007 /* zip_memdup.c in Sources */, - 4B01D6D215B2F46B002D5007 /* zip_name_locate.c in Sources */, - 4B9E577C24C7202000CEE0D6 /* zip_algorithm_zstd.c in Sources */, - 4B01D6D315B2F46B002D5007 /* zip_new.c in Sources */, - 4B01D6D415B2F46B002D5007 /* zip_open.c in Sources */, - 4B01D6D515B2F46B002D5007 /* zip_rename.c in Sources */, - 4BCF302E199A2F820064207B /* zip_source_tell.c in Sources */, - 4B542C2C22B12E3900960B38 /* zip_random_unix.c in Sources */, - 4B972050188EBE85002FAFAD /* zip_file_get_external_attributes.c in Sources */, - 4B01D6D615B2F46B002D5007 /* zip_replace.c in Sources */, - 4B01D6D715B2F46B002D5007 /* zip_set_archive_comment.c in Sources */, - 4B01D6D815B2F46B002D5007 /* zip_set_archive_flag.c in Sources */, - 4B01D6D915B2F46B002D5007 /* zip_set_default_password.c in Sources */, - 4B01D6DA15B2F46B002D5007 /* zip_set_file_comment.c in Sources */, - 4B01D6DB15B2F46B002D5007 /* zip_set_file_compression.c in Sources */, - 4B01D6DC15B2F46B002D5007 /* zip_set_name.c in Sources */, - 4B01D6DD15B2F46B002D5007 /* zip_source_buffer.c in Sources */, - 4BCB434319E9347E0067FAA3 /* zip_buffer.c in Sources */, - 4B01D6DE15B2F46B002D5007 /* zip_source_close.c in Sources */, - 4B01D6DF15B2F46B002D5007 /* zip_source_crc.c in Sources */, - 4B01D6E115B2F46B002D5007 /* zip_source_error.c in Sources */, - 4B01D6E415B2F46B002D5007 /* zip_source_free.c in Sources */, - 4B01D6E515B2F46B002D5007 /* zip_source_function.c in Sources */, - 4BCF3022199A2F820064207B /* zip_io_util.c in Sources */, - 4B01D6E615B2F46B002D5007 /* zip_source_layered.c in Sources */, - 4B01D6E715B2F46B002D5007 /* zip_source_open.c in Sources */, - 4B908F532385BE6D00886355 /* zip_libzip_version.c in Sources */, - 4B01D6EA15B2F46B002D5007 /* zip_source_read.c in Sources */, - 4BC03FA41FDD6B6F003C7B62 /* zip_source_begin_write_cloning.c in Sources */, - 4B01D6EB15B2F46B002D5007 /* zip_source_stat.c in Sources */, - 4BCF302C199A2F820064207B /* zip_source_supports.c in Sources */, - 4B01D6EC15B2F46B002D5007 /* zip_source_window.c in Sources */, - 4B01D6ED15B2F46B002D5007 /* zip_source_zip_new.c in Sources */, - 4B01D6EE15B2F46B002D5007 /* zip_source_zip.c in Sources */, - 4B01D6EF15B2F46B002D5007 /* zip_stat_index.c in Sources */, - 4B01D6F015B2F46B002D5007 /* zip_stat_init.c in Sources */, - 4B82CED519915F360097BC18 /* zip_file_set_mtime.c in Sources */, - 4B01D6F115B2F46B002D5007 /* zip_stat.c in Sources */, - 4B01D6F215B2F46B002D5007 /* zip_strerror.c in Sources */, - 4B01D6F315B2F46B002D5007 /* zip_string.c in Sources */, - 4B01D6F415B2F46B002D5007 /* zip_unchange_all.c in Sources */, - 4B01D6F515B2F46B002D5007 /* zip_unchange_archive.c in Sources */, - 4BCF3028199A2F820064207B /* zip_source_rollback_write.c in Sources */, - 4BCF3037199ABDDA0064207B /* zip_source_seek_write.c in Sources */, - 4B01D6F615B2F46B002D5007 /* zip_unchange_data.c in Sources */, - 4B01D6F715B2F46B002D5007 /* zip_unchange.c in Sources */, - 4B00CA26242F59D700E0B71C /* zip_source_pkware_encode.c in Sources */, - 4B01D6F815B2F46B002D5007 /* zip_utf-8.c in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 4B01D6F915B2F4B1002D5007 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 4B01D72615B2F57F002D5007 /* zipmerge.c in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 4B01D70B15B2F4EB002D5007 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 4B01D72515B2F57B002D5007 /* zipcmp.c in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 4B51DDB71FDAE20A00C5CA85 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 4B51DDC31FDAE26600C5CA85 /* source_hole.c in Sources */, - 4B51DDC21FDAE25F00C5CA85 /* ziptool_regress.c in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 4BACD58515BC2CEA00920691 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 4B51DDC11FDAE25B00C5CA85 /* ziptool.c in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 4BACD5B815BC2DC900920691 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 4BACD5C315BC2DE000920691 /* add_from_filep.c in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 4BACD5C715BC2DF200920691 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 4BACD5D215BC2EFE00920691 /* fopen_unchanged.c in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 4BACD5D615BC2F3700920691 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 4BACD5E115BC2F4500920691 /* fread.c in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 4BACD64815BC301300920691 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 4BACD65315BC302500920691 /* tryopen.c in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 4BD6CB6219E71CD100710654 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 4BD6CB6F19E71D6900710654 /* hole.c in Sources */, - 4BD6CB6419E71CD100710654 /* source_hole.c in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; - 4BFF2B481FE12FCA006EF3F3 /* Sources */ = { - isa = PBXSourcesBuildPhase; - buildActionMask = 2147483647; - files = ( - 4BFF2B551FE13033006EF3F3 /* can_clone_file.c in Sources */, - ); - runOnlyForDeploymentPostprocessing = 0; - }; -/* End PBXSourcesBuildPhase section */ - -/* Begin PBXTargetDependency section */ - 3D7E35451B33064500022624 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 4B01D68A15B2F3F1002D5007 /* libzip */; - targetProxy = 3D7E35441B33064500022624 /* PBXContainerItemProxy */; - }; - 4B01D72D15B2F5AC002D5007 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 4B01D6FC15B2F4B1002D5007 /* zipmerge */; - targetProxy = 4B01D72C15B2F5AC002D5007 /* PBXContainerItemProxy */; - }; - 4B01D72F15B2F5AC002D5007 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 4B01D70A15B2F4EB002D5007 /* zipcmp */; - targetProxy = 4B01D72E15B2F5AC002D5007 /* PBXContainerItemProxy */; - }; - 4B01D73615B2F639002D5007 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 4B01D68A15B2F3F1002D5007 /* libzip */; - targetProxy = 4B01D73515B2F639002D5007 /* PBXContainerItemProxy */; - }; - 4B01D73815B2F643002D5007 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 4B01D68A15B2F3F1002D5007 /* libzip */; - targetProxy = 4B01D73715B2F643002D5007 /* PBXContainerItemProxy */; - }; - 4B2CADAC1C50D57800291DE6 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 4BACD58815BC2CEA00920691 /* ziptool */; - targetProxy = 4B2CADAB1C50D57800291DE6 /* PBXContainerItemProxy */; - }; - 4B51DDB51FDAE20A00C5CA85 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 4B01D68A15B2F3F1002D5007 /* libzip */; - targetProxy = 4B51DDB61FDAE20A00C5CA85 /* PBXContainerItemProxy */; - }; - 4B51DDC51FDAE2F000C5CA85 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 4B51DDB41FDAE20A00C5CA85 /* ziptool_regress */; - targetProxy = 4B51DDC41FDAE2F000C5CA85 /* PBXContainerItemProxy */; - }; - 4B54447F15C977AF0067BA33 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 4B01D72815B2F5A2002D5007 /* command line tools */; - targetProxy = 4B54447E15C977AF0067BA33 /* PBXContainerItemProxy */; - }; - 4B54448115C977B10067BA33 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 4BACD5A715BC2D8200920691 /* test programs */; - targetProxy = 4B54448015C977B10067BA33 /* PBXContainerItemProxy */; - }; - 4BACD59715BC2D3800920691 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 4B01D68A15B2F3F1002D5007 /* libzip */; - targetProxy = 4BACD59615BC2D3800920691 /* PBXContainerItemProxy */; - }; - 4BACD5B615BC2DC900920691 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 4B01D68A15B2F3F1002D5007 /* libzip */; - targetProxy = 4BACD5B715BC2DC900920691 /* PBXContainerItemProxy */; - }; - 4BACD5C515BC2DF200920691 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 4B01D68A15B2F3F1002D5007 /* libzip */; - targetProxy = 4BACD5C615BC2DF200920691 /* PBXContainerItemProxy */; - }; - 4BACD5D415BC2F3700920691 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 4B01D68A15B2F3F1002D5007 /* libzip */; - targetProxy = 4BACD5D515BC2F3700920691 /* PBXContainerItemProxy */; - }; - 4BACD64615BC301300920691 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 4B01D68A15B2F3F1002D5007 /* libzip */; - targetProxy = 4BACD64715BC301300920691 /* PBXContainerItemProxy */; - }; - 4BACD65515BC303B00920691 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 4BACD5B515BC2DC900920691 /* add_from_filep */; - targetProxy = 4BACD65415BC303B00920691 /* PBXContainerItemProxy */; - }; - 4BACD65715BC303B00920691 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 4BACD5C415BC2DF200920691 /* fopen_unchanged */; - targetProxy = 4BACD65615BC303B00920691 /* PBXContainerItemProxy */; - }; - 4BACD65915BC303B00920691 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 4BACD5D315BC2F3700920691 /* fread */; - targetProxy = 4BACD65815BC303B00920691 /* PBXContainerItemProxy */; - }; - 4BACD66915BC303B00920691 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 4BACD64515BC301300920691 /* tryopen */; - targetProxy = 4BACD66815BC303B00920691 /* PBXContainerItemProxy */; - }; - 4BCF6A791C3BDDF900F036E9 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 3D7E35361B3305FB00022624 /* in-memory */; - targetProxy = 4BCF6A781C3BDDF900F036E9 /* PBXContainerItemProxy */; - }; - 4BCF6A7B1C3BDDFF00F036E9 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 4BCF6A681C3BDDD500F036E9 /* examples */; - targetProxy = 4BCF6A7A1C3BDDFF00F036E9 /* PBXContainerItemProxy */; - }; - 4BD6CB6019E71CD100710654 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 4B01D68A15B2F3F1002D5007 /* libzip */; - targetProxy = 4BD6CB6119E71CD100710654 /* PBXContainerItemProxy */; - }; - 4BD6CB6E19E71D0800710654 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 4BD6CB5F19E71CD100710654 /* hole */; - targetProxy = 4BD6CB6D19E71D0800710654 /* PBXContainerItemProxy */; - }; - 4BFF2B531FE13002006EF3F3 /* PBXTargetDependency */ = { - isa = PBXTargetDependency; - target = 4BFF2B451FE12FCA006EF3F3 /* can_clone_file */; - targetProxy = 4BFF2B521FE13002006EF3F3 /* PBXContainerItemProxy */; - }; -/* End PBXTargetDependency section */ - -/* Begin XCBuildConfiguration section */ - 3D7E353B1B3305FB00022624 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - CODE_SIGN_IDENTITY = "-"; - DEBUG_INFORMATION_FORMAT = dwarf; - LD_RUNPATH_SEARCH_PATHS = "@loader_path/"; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Debug; - }; - 3D7E353C1B3305FB00022624 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - CODE_SIGN_IDENTITY = "-"; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - LD_RUNPATH_SEARCH_PATHS = "@loader_path/"; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Release; - }; - 4B01D69C15B2F3F1002D5007 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - CLANG_WARN_IMPLICIT_SIGN_CONVERSION = YES; - CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = YES; - COMBINE_HIDPI_IMAGES = YES; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - FRAMEWORK_VERSION = A; - GCC_C_LANGUAGE_STANDARD = "compiler-default"; - GCC_ENABLE_OBJC_EXCEPTIONS = YES; - GCC_PRECOMPILE_PREFIX_HEADER = NO; - GCC_PREFIX_HEADER = ""; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_MISSING_NEWLINE = YES; - GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; - GCC_WARN_PEDANTIC = YES; - GCC_WARN_SHADOW = YES; - GCC_WARN_SIGN_COMPARE = YES; - INFOPLIST_FILE = Info.plist; - INSTALL_PATH = "@rpath"; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - /usr/local/Cellar/zstd/1.4.5/lib, - ); - PRODUCT_BUNDLE_IDENTIFIER = "at.nih.${PRODUCT_NAME:rfc1034identifier}"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SKIP_INSTALL = YES; - VERSION_INFO_BUILDER = ""; - VERSION_INFO_FILE = ""; - WRAPPER_EXTENSION = framework; - }; - name = Debug; - }; - 4B01D69D15B2F3F1002D5007 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - CLANG_WARN_IMPLICIT_SIGN_CONVERSION = YES; - CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = YES; - COMBINE_HIDPI_IMAGES = YES; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - DYLIB_COMPATIBILITY_VERSION = 1; - DYLIB_CURRENT_VERSION = 1; - FRAMEWORK_VERSION = A; - GCC_C_LANGUAGE_STANDARD = "compiler-default"; - GCC_ENABLE_OBJC_EXCEPTIONS = YES; - GCC_PRECOMPILE_PREFIX_HEADER = NO; - GCC_PREFIX_HEADER = ""; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_MISSING_NEWLINE = YES; - GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; - GCC_WARN_PEDANTIC = YES; - GCC_WARN_SHADOW = YES; - GCC_WARN_SIGN_COMPARE = YES; - INFOPLIST_FILE = Info.plist; - INSTALL_PATH = "@rpath"; - LIBRARY_SEARCH_PATHS = ( - "$(inherited)", - /usr/local/Cellar/zstd/1.4.5/lib, - ); - PRODUCT_BUNDLE_IDENTIFIER = "at.nih.${PRODUCT_NAME:rfc1034identifier}"; - PRODUCT_NAME = "$(TARGET_NAME)"; - SKIP_INSTALL = YES; - VERSION_INFO_BUILDER = ""; - VERSION_INFO_FILE = ""; - WRAPPER_EXTENSION = framework; - }; - name = Release; - }; - 4B01D70515B2F4B1002D5007 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - CLANG_WARN_IMPLICIT_SIGN_CONVERSION = YES; - CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = YES; - CODE_SIGN_IDENTITY = "-"; - DEBUG_INFORMATION_FORMAT = dwarf; - GCC_C_LANGUAGE_STANDARD = c99; - GCC_ENABLE_OBJC_EXCEPTIONS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_MISSING_NEWLINE = YES; - GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; - GCC_WARN_PEDANTIC = YES; - GCC_WARN_SHADOW = YES; - GCC_WARN_SIGN_COMPARE = YES; - LD_RUNPATH_SEARCH_PATHS = "@loader_path/"; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Debug; - }; - 4B01D70615B2F4B1002D5007 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - CLANG_WARN_IMPLICIT_SIGN_CONVERSION = YES; - CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = YES; - CODE_SIGN_IDENTITY = "-"; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - GCC_C_LANGUAGE_STANDARD = c99; - GCC_ENABLE_OBJC_EXCEPTIONS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_MISSING_NEWLINE = YES; - GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; - GCC_WARN_PEDANTIC = YES; - GCC_WARN_SHADOW = YES; - GCC_WARN_SIGN_COMPARE = YES; - LD_RUNPATH_SEARCH_PATHS = "@loader_path/"; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Release; - }; - 4B01D71115B2F4EB002D5007 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = YES; - CODE_SIGN_IDENTITY = "-"; - DEBUG_INFORMATION_FORMAT = dwarf; - GCC_ENABLE_OBJC_EXCEPTIONS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - LD_RUNPATH_SEARCH_PATHS = "@loader_path/"; - PRODUCT_NAME = zipcmp; - }; - name = Debug; - }; - 4B01D71215B2F4EB002D5007 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = YES; - CODE_SIGN_IDENTITY = "-"; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - GCC_ENABLE_OBJC_EXCEPTIONS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - LD_RUNPATH_SEARCH_PATHS = "@loader_path/"; - PRODUCT_NAME = zipcmp; - }; - name = Release; - }; - 4B01D72A15B2F5A2002D5007 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - COMBINE_HIDPI_IMAGES = YES; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Debug; - }; - 4B01D72B15B2F5A2002D5007 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - COMBINE_HIDPI_IMAGES = YES; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Release; - }; - 4B51DDBE1FDAE20A00C5CA85 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - CODE_SIGN_IDENTITY = "-"; - DEBUG_INFORMATION_FORMAT = dwarf; - GCC_ENABLE_OBJC_EXCEPTIONS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - LD_RUNPATH_SEARCH_PATHS = "@loader_path/"; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Debug; - }; - 4B51DDBF1FDAE20A00C5CA85 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - CODE_SIGN_IDENTITY = "-"; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - GCC_ENABLE_OBJC_EXCEPTIONS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - LD_RUNPATH_SEARCH_PATHS = "@loader_path/"; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Release; - }; - 4B54447A15C977A20067BA33 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - COMBINE_HIDPI_IMAGES = YES; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Debug; - }; - 4B54447B15C977A20067BA33 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - COMBINE_HIDPI_IMAGES = YES; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Release; - }; - 4BACD59115BC2CEA00920691 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - CODE_SIGN_IDENTITY = "-"; - DEBUG_INFORMATION_FORMAT = dwarf; - GCC_ENABLE_OBJC_EXCEPTIONS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - LD_RUNPATH_SEARCH_PATHS = "@loader_path/"; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Debug; - }; - 4BACD59215BC2CEA00920691 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - CODE_SIGN_IDENTITY = "-"; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - GCC_ENABLE_OBJC_EXCEPTIONS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - LD_RUNPATH_SEARCH_PATHS = "@loader_path/"; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Release; - }; - 4BACD5AF15BC2D8200920691 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - COMBINE_HIDPI_IMAGES = YES; - PRODUCT_NAME = "command line tools copy"; - }; - name = Debug; - }; - 4BACD5B015BC2D8200920691 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - COMBINE_HIDPI_IMAGES = YES; - PRODUCT_NAME = "command line tools copy"; - }; - name = Release; - }; - 4BACD5BF15BC2DC900920691 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - CODE_SIGN_IDENTITY = "-"; - DEBUG_INFORMATION_FORMAT = dwarf; - GCC_ENABLE_OBJC_EXCEPTIONS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - LD_RUNPATH_SEARCH_PATHS = "@loader_path/"; - PRODUCT_NAME = add_from_filep; - }; - name = Debug; - }; - 4BACD5C015BC2DC900920691 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - CODE_SIGN_IDENTITY = "-"; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - GCC_ENABLE_OBJC_EXCEPTIONS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - LD_RUNPATH_SEARCH_PATHS = "@loader_path/"; - PRODUCT_NAME = add_from_filep; - }; - name = Release; - }; - 4BACD5CE15BC2DF200920691 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - CODE_SIGN_IDENTITY = "-"; - DEBUG_INFORMATION_FORMAT = dwarf; - GCC_ENABLE_OBJC_EXCEPTIONS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - LD_RUNPATH_SEARCH_PATHS = "@loader_path/"; - PRODUCT_NAME = fopen_unchanged; - }; - name = Debug; - }; - 4BACD5CF15BC2DF200920691 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - CODE_SIGN_IDENTITY = "-"; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - GCC_ENABLE_OBJC_EXCEPTIONS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - LD_RUNPATH_SEARCH_PATHS = "@loader_path/"; - PRODUCT_NAME = fopen_unchanged; - }; - name = Release; - }; - 4BACD5DD15BC2F3700920691 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - CODE_SIGN_IDENTITY = "-"; - DEBUG_INFORMATION_FORMAT = dwarf; - GCC_ENABLE_OBJC_EXCEPTIONS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - LD_RUNPATH_SEARCH_PATHS = "@loader_path/"; - PRODUCT_NAME = fread; - }; - name = Debug; - }; - 4BACD5DE15BC2F3700920691 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - CODE_SIGN_IDENTITY = "-"; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - GCC_ENABLE_OBJC_EXCEPTIONS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - LD_RUNPATH_SEARCH_PATHS = "@loader_path/"; - PRODUCT_NAME = fread; - }; - name = Release; - }; - 4BACD64E15BC301300920691 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - CODE_SIGN_IDENTITY = "-"; - DEBUG_INFORMATION_FORMAT = dwarf; - GCC_ENABLE_OBJC_EXCEPTIONS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - LD_RUNPATH_SEARCH_PATHS = "@loader_path/"; - PRODUCT_NAME = tryopen; - }; - name = Debug; - }; - 4BACD64F15BC301300920691 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - CODE_SIGN_IDENTITY = "-"; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - GCC_ENABLE_OBJC_EXCEPTIONS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - LD_RUNPATH_SEARCH_PATHS = "@loader_path/"; - PRODUCT_NAME = tryopen; - }; - name = Release; - }; - 4BCF6A761C3BDDD500F036E9 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - COMBINE_HIDPI_IMAGES = YES; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Debug; - }; - 4BCF6A771C3BDDD500F036E9 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - COMBINE_HIDPI_IMAGES = YES; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Release; - }; - 4BD6CB6A19E71CD100710654 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - CODE_SIGN_IDENTITY = "-"; - DEBUG_INFORMATION_FORMAT = dwarf; - GCC_ENABLE_OBJC_EXCEPTIONS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - LD_RUNPATH_SEARCH_PATHS = "@loader_path/"; - PRODUCT_NAME = hole; - }; - name = Debug; - }; - 4BD6CB6B19E71CD100710654 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - CODE_SIGN_IDENTITY = "-"; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - GCC_ENABLE_OBJC_EXCEPTIONS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - LD_RUNPATH_SEARCH_PATHS = "@loader_path/"; - PRODUCT_NAME = hole; - }; - name = Release; - }; - 4BDC71D315B181DA00236D3C /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_IMPLICIT_SIGN_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = NO; - ENABLE_STRICT_OBJC_MSGSEND = YES; - ENABLE_TESTABILITY = YES; - GCC_C_LANGUAGE_STANDARD = "compiler-default"; - GCC_DYNAMIC_NO_PIC = NO; - GCC_NO_COMMON_BLOCKS = YES; - GCC_OPTIMIZATION_LEVEL = 0; - GCC_PREPROCESSOR_DEFINITIONS = "HAVE_CONFIG_H=1"; - GCC_SYMBOLS_PRIVATE_EXTERN = NO; - GCC_VERSION = com.apple.compilers.llvm.clang.1_0; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_MISSING_NEWLINE = YES; - GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_SHADOW = YES; - GCC_WARN_SIGN_COMPARE = YES; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - HEADER_SEARCH_PATHS = ( - /usr/local/include, - ../lib, - ., - ../src, - ); - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MACOSX_DEPLOYMENT_TARGET = 10.6; - ONLY_ACTIVE_ARCH = YES; - OTHER_CFLAGS = ""; - SDKROOT = macosx; - USE_HEADERMAP = NO; - WARNING_CFLAGS = "-Wno-nullability-extension"; - }; - name = Debug; - }; - 4BDC71D415B181DA00236D3C /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - ALWAYS_SEARCH_USER_PATHS = NO; - CLANG_ANALYZER_LOCALIZABILITY_NONLOCALIZED = YES; - CLANG_ENABLE_OBJC_ARC = YES; - CLANG_UNDEFINED_BEHAVIOR_SANITIZER_NULLABILITY = YES; - CLANG_WARN_BLOCK_CAPTURE_AUTORELEASING = YES; - CLANG_WARN_BOOL_CONVERSION = YES; - CLANG_WARN_COMMA = YES; - CLANG_WARN_CONSTANT_CONVERSION = YES; - CLANG_WARN_DEPRECATED_OBJC_IMPLEMENTATIONS = YES; - CLANG_WARN_EMPTY_BODY = YES; - CLANG_WARN_ENUM_CONVERSION = YES; - CLANG_WARN_IMPLICIT_SIGN_CONVERSION = YES; - CLANG_WARN_INFINITE_RECURSION = YES; - CLANG_WARN_INT_CONVERSION = YES; - CLANG_WARN_OBJC_IMPLICIT_RETAIN_SELF = YES; - CLANG_WARN_RANGE_LOOP_ANALYSIS = YES; - CLANG_WARN_STRICT_PROTOTYPES = YES; - CLANG_WARN_SUSPICIOUS_IMPLICIT_CONVERSION = YES; - CLANG_WARN_SUSPICIOUS_MOVE = YES; - CLANG_WARN_UNREACHABLE_CODE = YES; - CLANG_WARN__DUPLICATE_METHOD_MATCH = YES; - COPY_PHASE_STRIP = YES; - ENABLE_STRICT_OBJC_MSGSEND = YES; - GCC_C_LANGUAGE_STANDARD = "compiler-default"; - GCC_NO_COMMON_BLOCKS = YES; - GCC_PREPROCESSOR_DEFINITIONS = "HAVE_CONFIG_H=1"; - GCC_VERSION = com.apple.compilers.llvm.clang.1_0; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - GCC_WARN_ABOUT_MISSING_NEWLINE = YES; - GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES; - GCC_WARN_ABOUT_RETURN_TYPE = YES; - GCC_WARN_SHADOW = YES; - GCC_WARN_SIGN_COMPARE = YES; - GCC_WARN_UNDECLARED_SELECTOR = YES; - GCC_WARN_UNINITIALIZED_AUTOS = YES; - GCC_WARN_UNUSED_FUNCTION = YES; - GCC_WARN_UNUSED_VARIABLE = YES; - HEADER_SEARCH_PATHS = ( - /usr/local/include, - ../lib, - ., - ../src, - ); - IPHONEOS_DEPLOYMENT_TARGET = 8.0; - MACOSX_DEPLOYMENT_TARGET = 10.6; - OTHER_CFLAGS = ""; - SDKROOT = macosx; - USE_HEADERMAP = NO; - VALIDATE_PRODUCT = YES; - WARNING_CFLAGS = "-Wno-nullability-extension"; - }; - name = Release; - }; - 4BFF2B4F1FE12FCA006EF3F3 /* Debug */ = { - isa = XCBuildConfiguration; - buildSettings = { - CODE_SIGN_IDENTITY = "-"; - DEBUG_INFORMATION_FORMAT = dwarf; - GCC_ENABLE_OBJC_EXCEPTIONS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - LD_RUNPATH_SEARCH_PATHS = "@loader_path/"; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Debug; - }; - 4BFF2B501FE12FCA006EF3F3 /* Release */ = { - isa = XCBuildConfiguration; - buildSettings = { - CODE_SIGN_IDENTITY = "-"; - DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; - GCC_ENABLE_OBJC_EXCEPTIONS = YES; - GCC_WARN_64_TO_32_BIT_CONVERSION = YES; - LD_RUNPATH_SEARCH_PATHS = "@loader_path/"; - PRODUCT_NAME = "$(TARGET_NAME)"; - }; - name = Release; - }; -/* End XCBuildConfiguration section */ - -/* Begin XCConfigurationList section */ - 3D7E353D1B3305FB00022624 /* Build configuration list for PBXNativeTarget "in-memory" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 3D7E353B1B3305FB00022624 /* Debug */, - 3D7E353C1B3305FB00022624 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 4B01D69E15B2F3F1002D5007 /* Build configuration list for PBXNativeTarget "libzip" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 4B01D69C15B2F3F1002D5007 /* Debug */, - 4B01D69D15B2F3F1002D5007 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 4B01D70415B2F4B1002D5007 /* Build configuration list for PBXNativeTarget "zipmerge" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 4B01D70515B2F4B1002D5007 /* Debug */, - 4B01D70615B2F4B1002D5007 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 4B01D71015B2F4EB002D5007 /* Build configuration list for PBXNativeTarget "zipcmp" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 4B01D71115B2F4EB002D5007 /* Debug */, - 4B01D71215B2F4EB002D5007 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 4B01D72915B2F5A2002D5007 /* Build configuration list for PBXAggregateTarget "command line tools" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 4B01D72A15B2F5A2002D5007 /* Debug */, - 4B01D72B15B2F5A2002D5007 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 4B51DDBD1FDAE20A00C5CA85 /* Build configuration list for PBXNativeTarget "ziptool_regress" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 4B51DDBE1FDAE20A00C5CA85 /* Debug */, - 4B51DDBF1FDAE20A00C5CA85 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 4B54447C15C977A20067BA33 /* Build configuration list for PBXAggregateTarget "all" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 4B54447A15C977A20067BA33 /* Debug */, - 4B54447B15C977A20067BA33 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 4BACD59015BC2CEA00920691 /* Build configuration list for PBXNativeTarget "ziptool" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 4BACD59115BC2CEA00920691 /* Debug */, - 4BACD59215BC2CEA00920691 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 4BACD5AE15BC2D8200920691 /* Build configuration list for PBXAggregateTarget "test programs" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 4BACD5AF15BC2D8200920691 /* Debug */, - 4BACD5B015BC2D8200920691 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 4BACD5BE15BC2DC900920691 /* Build configuration list for PBXNativeTarget "add_from_filep" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 4BACD5BF15BC2DC900920691 /* Debug */, - 4BACD5C015BC2DC900920691 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 4BACD5CD15BC2DF200920691 /* Build configuration list for PBXNativeTarget "fopen_unchanged" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 4BACD5CE15BC2DF200920691 /* Debug */, - 4BACD5CF15BC2DF200920691 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 4BACD5DC15BC2F3700920691 /* Build configuration list for PBXNativeTarget "fread" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 4BACD5DD15BC2F3700920691 /* Debug */, - 4BACD5DE15BC2F3700920691 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 4BACD64D15BC301300920691 /* Build configuration list for PBXNativeTarget "tryopen" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 4BACD64E15BC301300920691 /* Debug */, - 4BACD64F15BC301300920691 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 4BCF6A751C3BDDD500F036E9 /* Build configuration list for PBXAggregateTarget "examples" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 4BCF6A761C3BDDD500F036E9 /* Debug */, - 4BCF6A771C3BDDD500F036E9 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 4BD6CB6919E71CD100710654 /* Build configuration list for PBXNativeTarget "hole" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 4BD6CB6A19E71CD100710654 /* Debug */, - 4BD6CB6B19E71CD100710654 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 4BDC71C215B181DA00236D3C /* Build configuration list for PBXProject "libzip" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 4BDC71D315B181DA00236D3C /* Debug */, - 4BDC71D415B181DA00236D3C /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; - 4BFF2B4E1FE12FCA006EF3F3 /* Build configuration list for PBXNativeTarget "can_clone_file" */ = { - isa = XCConfigurationList; - buildConfigurations = ( - 4BFF2B4F1FE12FCA006EF3F3 /* Debug */, - 4BFF2B501FE12FCA006EF3F3 /* Release */, - ); - defaultConfigurationIsVisible = 0; - defaultConfigurationName = Release; - }; -/* End XCConfigurationList section */ - }; - rootObject = 4BDC71BF15B181DA00236D3C /* Project object */; -} diff --git a/core/deps/libzip/developer-xcode/libzip.xcodeproj/project.xcworkspace/contents.xcworkspacedata b/core/deps/libzip/developer-xcode/libzip.xcodeproj/project.xcworkspace/contents.xcworkspacedata deleted file mode 100644 index a3025873b..000000000 --- a/core/deps/libzip/developer-xcode/libzip.xcodeproj/project.xcworkspace/contents.xcworkspacedata +++ /dev/null @@ -1,7 +0,0 @@ - - - - - diff --git a/core/deps/libzip/developer-xcode/libzip.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist b/core/deps/libzip/developer-xcode/libzip.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist deleted file mode 100644 index 18d981003..000000000 --- a/core/deps/libzip/developer-xcode/libzip.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +++ /dev/null @@ -1,8 +0,0 @@ - - - - - IDEDidComputeMac32BitWarning - - - diff --git a/core/deps/libzip/developer-xcode/mkconfig-h.sh b/core/deps/libzip/developer-xcode/mkconfig-h.sh deleted file mode 100644 index 43199f73b..000000000 --- a/core/deps/libzip/developer-xcode/mkconfig-h.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh - -DIR=tmp.$$ - -mkdir -p $DIR/32 $DIR/64 - -(cd $DIR/32; ../../../configure CFLAGS=-m32) -(cd $DIR/64; ../../../configure CFLAGS=-m64) - -diff -D __LP64__ $DIR/32/config.h $DIR/64/config.h > config.h - -rm -r $DIR diff --git a/core/deps/libzip/developer-xcode/zip_err_str.c b/core/deps/libzip/developer-xcode/zip_err_str.c deleted file mode 100644 index c46258b4a..000000000 --- a/core/deps/libzip/developer-xcode/zip_err_str.c +++ /dev/null @@ -1,84 +0,0 @@ -/* - This file was generated automatically by CMake - from zip.h; make changes there. -*/ - -#include "zipint.h" - -const char * const _zip_err_str[] = { - "No error", - "Multi-disk zip archives not supported", - "Renaming temporary file failed", - "Closing zip archive failed", - "Seek error", - "Read error", - "Write error", - "CRC error", - "Containing zip archive was closed", - "No such file", - "File already exists", - "Can't open file", - "Failure to create temporary file", - "Zlib error", - "Malloc failure", - "Entry has been changed", - "Compression method not supported", - "Premature end of file", - "Invalid argument", - "Not a zip archive", - "Internal error", - "Zip archive inconsistent", - "Can't remove file", - "Entry has been deleted", - "Encryption method not supported", - "Read-only archive", - "No password provided", - "Wrong password provided", - "Operation not supported", - "Resource still in use", - "Tell error", - "Compressed data invalid", - "Operation cancelled", -}; - -const int _zip_nerr_str = sizeof(_zip_err_str)/sizeof(_zip_err_str[0]); - -#define N ZIP_ET_NONE -#define S ZIP_ET_SYS -#define Z ZIP_ET_ZLIB - -const int _zip_err_type[] = { - N, - N, - S, - S, - S, - S, - S, - N, - N, - N, - N, - S, - S, - Z, - N, - N, - N, - N, - N, - N, - N, - N, - S, - N, - N, - N, - N, - N, - N, - N, - S, - N, - N, -}; diff --git a/core/deps/libzip/developer-xcode/zipconf.h b/core/deps/libzip/developer-xcode/zipconf.h deleted file mode 100644 index 99b3f07c4..000000000 --- a/core/deps/libzip/developer-xcode/zipconf.h +++ /dev/null @@ -1,47 +0,0 @@ -#ifndef _HAD_ZIPCONF_H -#define _HAD_ZIPCONF_H - -/* - zipconf.h -- platform specific include file - - This file was generated automatically by CMake - based on ../cmake-zipconf.h.in. - */ - -#define LIBZIP_VERSION "1.5.2a" -#define LIBZIP_VERSION_MAJOR 1 -#define LIBZIP_VERSION_MINOR 5 -#define LIBZIP_VERSION_MICRO 2a - -/* #undef ZIP_STATIC */ - - -#define __STDC_FORMAT_MACROS 1 -#include - -typedef int8_t zip_int8_t; -typedef uint8_t zip_uint8_t; -typedef int16_t zip_int16_t; -typedef uint16_t zip_uint16_t; -typedef int32_t zip_int32_t; -typedef uint32_t zip_uint32_t; -typedef int64_t zip_int64_t; -typedef uint64_t zip_uint64_t; - -#define ZIP_INT8_MIN (-ZIP_INT8_MAX - 1) -#define ZIP_INT8_MAX 0x7f -#define ZIP_UINT8_MAX 0xff - -#define ZIP_INT16_MIN (-ZIP_INT16_MAX - 1) -#define ZIP_INT16_MAX 0x7fff -#define ZIP_UINT16_MAX 0xffff - -#define ZIP_INT32_MIN (-ZIP_INT32_MAX - 1L) -#define ZIP_INT32_MAX 0x7fffffffL -#define ZIP_UINT32_MAX 0xffffffffLU - -#define ZIP_INT64_MIN (-ZIP_INT64_MAX - 1LL) -#define ZIP_INT64_MAX 0x7fffffffffffffffLL -#define ZIP_UINT64_MAX 0xffffffffffffffffULL - -#endif /* zipconf.h */ diff --git a/core/deps/libzip/examples/CMakeLists.txt b/core/deps/libzip/examples/CMakeLists.txt index 9019e0ab6..008323236 100644 --- a/core/deps/libzip/examples/CMakeLists.txt +++ b/core/deps/libzip/examples/CMakeLists.txt @@ -1,3 +1,5 @@ -add_executable(in-memory in-memory.c) -target_link_libraries(in-memory zip) -target_include_directories(in-memory PRIVATE ${PROJECT_SOURCE_DIR}/lib ${PROJECT_BINARY_DIR}) +foreach(PROGRAM add-compressed-data autoclose-archive in-memory) + add_executable(${PROGRAM} ${PROGRAM}.c) + target_link_libraries(${PROGRAM} zip) + target_include_directories(${PROGRAM} PRIVATE BEFORE ${PROJECT_SOURCE_DIR}/lib ${PROJECT_BINARY_DIR}) +endforeach() diff --git a/core/deps/libzip/examples/add-compressed-data.c b/core/deps/libzip/examples/add-compressed-data.c new file mode 100644 index 000000000..6f5810662 --- /dev/null +++ b/core/deps/libzip/examples/add-compressed-data.c @@ -0,0 +1,171 @@ +/* + add-compressed-data.c -- add already compressed file to zip archive + Copyright (C) 2022 Dieter Baron and Thomas Klausner + + This file is part of libzip, a library to manipulate ZIP archives. + The authors can be contacted at + + 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. + 3. The names of the authors may not be used to endorse or promote + products derived from this software without specific prior + written permission. + + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``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 AUTHORS 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. +*/ + +/* + This layered source can be used to add pre-compressed data to a zip archive. + The data is taken from the lower layer source. + Metadata (uncompressed size, crc, compression method) must be provided by the caller. +*/ + +#include +#include +#include + +#include + +struct ctx { + zip_uint64_t uncompressed_size; + zip_uint32_t crc; + zip_uint32_t compression_method; +}; + +zip_int64_t callback(zip_source_t* src, void *ud, void* data, zip_uint64_t length, zip_source_cmd_t command) { + struct ctx* ctx = (struct ctx*)ud; + + switch (command) { + case ZIP_SOURCE_FREE: + /* Free our context. */ + free(ctx); + return 0; + + case ZIP_SOURCE_STAT: { + zip_stat_t *st = (zip_stat_t *)data; + /* Fix metadata with provided values. */ + if (st->valid & ZIP_STAT_SIZE) { + st->comp_size = st->size; + st->valid |= ZIP_STAT_COMP_SIZE; + } + st->size = ctx->uncompressed_size; + st->crc = ctx->crc; + st->comp_method = ctx->compression_method; + st->valid |= ZIP_STAT_COMP_METHOD | ZIP_STAT_SIZE | ZIP_STAT_CRC; + + return 0; + } + + default: + /* For all other commands, use default implementation */ + return zip_source_pass_to_lower_layer(src, data, length, command); + } +} + +zip_source_t* create_layered_compressed_source(zip_source_t* source, zip_uint64_t uncompressed_size, zip_uint32_t crc, zip_uint32_t compression_method, zip_error_t *error) { + struct ctx* ctx = (struct ctx*)malloc(sizeof(*ctx)); + zip_source_t *compressed_source; + + /* Allocate context. */ + if (ctx == NULL) { + zip_error_set(error, ZIP_ER_MEMORY, 0); + return NULL; + } + + /* Initialize context */ + ctx->compression_method = compression_method; + ctx->uncompressed_size = uncompressed_size; + ctx->crc = crc; + + /* Create layered source using our callback and context. */ + compressed_source = zip_source_layered_create(source, callback, ctx, error); + + /* In case of error, free context. */ + if (compressed_source == NULL) { + free(ctx); + } + + return compressed_source; +} + + +/* This is the information needed to add pre-compressed data to a zip archive. data must be compressed in a format compatible with Zip (e.g. no gzip header for deflate). */ + +zip_uint16_t compression_method = ZIP_CM_DEFLATE; +zip_uint64_t uncompressed_size = 60; +zip_uint32_t crc = 0xb0354048; +zip_uint8_t data[] = { + 0x4B, 0x4C, 0x44, 0x06, 0x5C, 0x49, 0x28, 0x80, + 0x2B, 0x11, 0x55 ,0x36, 0x19, 0x05, 0x70, 0x01, + 0x00 +}; + + +int +main(int argc, char *argv[]) { + const char *archive; + zip_source_t *src, *src_comp; + zip_t *za; + int err; + + if (argc != 2) { + fprintf(stderr, "usage: %s archive\n", argv[0]); + return 1; + } + archive = argv[1]; + + if ((za = zip_open(archive, ZIP_CREATE, &err)) == NULL) { + zip_error_t error; + zip_error_init_with_code(&error, err); + fprintf(stderr, "%s: cannot open zip archive '%s': %s\n", argv[0], archive, zip_error_strerror(&error)); + zip_error_fini(&error); + exit(1); + } + + /* The data can come from any source. To keep the example simple, it is provided in a static buffer here. */ + if ((src = zip_source_buffer(za, data, sizeof(data), 0)) == NULL) { + fprintf(stderr, "%s: cannot create buffer source: %s\n", argv[0], zip_strerror(za)); + zip_discard(za); + exit(1); + } + + zip_error_t error; + if ((src_comp = create_layered_compressed_source(src, uncompressed_size, crc, compression_method, &error)) == NULL) { + fprintf(stderr, "%s: cannot create layered source: %s\n", argv[0], zip_error_strerror(&error)); + zip_source_free(src); + zip_discard(za); + exit(1); + } + + if ((zip_file_add(za, "precompressed", src_comp, 0)) < 0) { + fprintf(stderr, "%s: cannot add precompressed file: %s\n", argv[0], zip_strerror(za)); + zip_source_free(src_comp); + zip_discard(za); + exit(1); + } + + if ((zip_close(za)) < 0) { + fprintf(stderr, "%s: cannot close archive '%s': %s\n", argv[0], archive, zip_strerror(za)); + zip_discard(za); + exit(1); + } + + exit(0); +} diff --git a/core/deps/libzip/examples/autoclose-archive.c b/core/deps/libzip/examples/autoclose-archive.c new file mode 100644 index 000000000..73cc46faa --- /dev/null +++ b/core/deps/libzip/examples/autoclose-archive.c @@ -0,0 +1,160 @@ +/* + autoclose-archive.c -- automatically close archive when source is closed + Copyright (C) 2022 Dieter Baron and Thomas Klausner + + This file is part of libzip, a library to manipulate ZIP archives. + The authors can be contacted at + + 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. + 3. The names of the authors may not be used to endorse or promote + products derived from this software without specific prior + written permission. + + THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``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 AUTHORS 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. +*/ + +/* + This example layered source takes ownership of a zip archive and discards it when the source is freed. + It can be used to add files from various zip archives without having to keep track of them yourself. +*/ + + +#include +#include +#include + +#include + +struct ctx { + zip_t* archive; +}; + +zip_int64_t callback(zip_source_t* src, void *ud, void* data, zip_uint64_t length, zip_source_cmd_t command) { + struct ctx* ctx = (struct ctx*)ud; + + switch (command) { + case ZIP_SOURCE_FREE: + /* Close zip archive we took ownership of */ + zip_discard(ctx->archive); + /* Free our own context */ + free(ctx); + return 0; + + default: + /* For all other commands, use default implementation */ + return zip_source_pass_to_lower_layer(src, data, length, command); + } +} + +zip_source_t* create_layered_autoclose(zip_source_t* source, zip_t *archive, zip_error_t *error) { + struct ctx* ctx = (struct ctx*)malloc(sizeof(*ctx)); + zip_source_t *autoclose_source; + + /* Allocate context. */ + if (ctx == NULL) { + zip_error_set(error, ZIP_ER_MEMORY, 0); + return NULL; + } + + /* Initialize context */ + ctx->archive = archive; + + /* Create layered source using our callback and context. */ + autoclose_source = zip_source_layered_create(source, callback, ctx, error); + + /* In case of error, free context. */ + if (autoclose_source == NULL) { + free(ctx); + } + + return autoclose_source; +} + + +int +main(int argc, char *argv[]) { + const char *destination_archive, *source_archive, *source_file; + zip_int64_t index; + zip_source_t *src, *src_autoclose; + zip_t *z_source, *z_destination; + int err; + + if (argc != 4) { + fprintf(stderr, "usage: %s destination-archive source-archive source-file\n", argv[0]); + return 1; + } + destination_archive = argv[1]; + source_archive = argv[2]; + source_file = argv[3]; + + + if ((z_source = zip_open(source_archive, 0, &err)) == NULL) { + zip_error_t error; + zip_error_init_with_code(&error, err); + fprintf(stderr, "%s: cannot open zip archive '%s': %s\n", argv[0], source_archive, zip_error_strerror(&error)); + zip_error_fini(&error); + exit(1); + } + + if ((index = zip_name_locate(z_source, source_file, 0)) < 0) { + fprintf(stderr, "%s: cannot find file '%s' in '%s': %s\n", argv[0], source_file, source_archive, zip_strerror(z_source)); + zip_discard(z_source); + exit(1); + + } + if ((src = zip_source_zip_file(z_source, z_source, index, 0, 0, -1, NULL)) == NULL) { + fprintf(stderr, "%s: cannot open file '%s' in '%s': %s\n", argv[0], source_file, source_archive, zip_strerror(z_source)); + zip_discard(z_source); + exit(1); + } + + zip_error_t error; + if ((src_autoclose = create_layered_autoclose(src, z_source, &error)) == NULL) { + fprintf(stderr, "%s: cannot create layered source: %s\n", argv[0], zip_error_strerror(&error)); + zip_source_free(src); + zip_discard(z_source); + exit(1); + } + + if ((z_destination = zip_open(destination_archive, ZIP_CREATE, &err)) == NULL) { + zip_error_init_with_code(&error, err); + fprintf(stderr, "%s: cannot open zip archive '%s': %s\n", argv[0], destination_archive, zip_error_strerror(&error)); + zip_error_fini(&error); + zip_source_free(src_autoclose); /* freeing src_autoclose closes z_source */ + exit(1); + } + + + if ((zip_file_add(z_destination, source_file, src_autoclose, 0)) < 0) { + fprintf(stderr, "%s: cannot add file: %s\n", argv[0], zip_strerror(z_source)); + zip_source_free(src_autoclose); + zip_discard(z_destination); + exit(1); + } + + if ((zip_close(z_destination)) < 0) { + fprintf(stderr, "%s: cannot close archive '%s': %s\n", argv[0], destination_archive, zip_strerror(z_source)); + zip_discard(z_destination); + exit(1); + } + + exit(0); +} diff --git a/core/deps/libzip/examples/in-memory.c b/core/deps/libzip/examples/in-memory.c index 1a6f9fae6..e022a0b24 100644 --- a/core/deps/libzip/examples/in-memory.c +++ b/core/deps/libzip/examples/in-memory.c @@ -1,9 +1,9 @@ /* in-memory.c -- modify zip file in memory - Copyright (C) 2014-2019 Dieter Baron and Thomas Klausner + Copyright (C) 2014-2022 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/core/deps/libzip/examples/windows-open.c b/core/deps/libzip/examples/windows-open.c index 31704a661..67902484e 100644 --- a/core/deps/libzip/examples/windows-open.c +++ b/core/deps/libzip/examples/windows-open.c @@ -1,9 +1,9 @@ /* windows-open.c -- open zip archive using Windows UTF-16/Unicode file name - Copyright (C) 2015-2019 Dieter Baron and Thomas Klausner + Copyright (C) 2015-2022 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/core/deps/libzip/lib/CMakeLists.txt b/core/deps/libzip/lib/CMakeLists.txt index 133ca67dd..1afefae00 100644 --- a/core/deps/libzip/lib/CMakeLists.txt +++ b/core/deps/libzip/lib/CMakeLists.txt @@ -86,6 +86,7 @@ add_library(zip zip_source_is_deleted.c zip_source_layered.c zip_source_open.c + zip_source_pass_to_lower_layer.c zip_source_pkware_decode.c zip_source_pkware_encode.c zip_source_read.c @@ -123,7 +124,6 @@ if(WIN32) zip_source_file_win32_utf8.c ) if(CMAKE_SYSTEM_NAME MATCHES WindowsPhone OR CMAKE_SYSTEM_NAME MATCHES WindowsStore) - target_compile_definitions(zip PRIVATE _WIN32_WINNT=0x0A00) target_sources(zip PRIVATE zip_random_uwp.c) else() target_sources(zip PRIVATE zip_source_file_win32_ansi.c zip_random_win32.c) @@ -131,7 +131,6 @@ if(WIN32) endif() else(WIN32) target_sources(zip PRIVATE - zip_mkstempm.c zip_source_file_stdio_named.c zip_random_unix.c ) @@ -149,7 +148,7 @@ endif() if(HAVE_LIBZSTD) target_sources(zip PRIVATE zip_algorithm_zstd.c) - target_link_libraries(zip PRIVATE Zstd::Zstd) + target_link_libraries(zip PRIVATE ${zstd_TARGET}) endif() if(HAVE_COMMONCRYPTO) @@ -173,7 +172,7 @@ if(HAVE_CRYPTO) endif() if(SHARED_LIB_VERSIONNING) - set_target_properties(zip PROPERTIES VERSION 5.3 SOVERSION 5) + set_target_properties(zip PROPERTIES VERSION 5.5 SOVERSION 5) endif() target_link_libraries(zip PRIVATE ZLIB::ZLIB) @@ -194,36 +193,16 @@ if(LIBZIP_DO_INSTALL) install(FILES zip.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) endif() -# create zip_err_str.h from zip.h -file(READ ${PROJECT_SOURCE_DIR}/lib/zip.h zip_h) -string(REGEX MATCHALL "#define ZIP_ER_([A-Z_]+) ([0-9]+)[ \t]+/([-*0-9a-zA-Z ']*)/" zip_h_err ${zip_h}) -set(zip_err_str [=[ -/* - This file was generated automatically by CMake - from zip.h\; make changes there. -*/ - -#include "zipint.h" - -const char * const _zip_err_str[] = { -]=]) -set(zip_err_type) -foreach(errln ${zip_h_err}) - string(REGEX MATCH "#define ZIP_ER_([A-Z_]+) ([0-9]+)[ \t]+/([-*0-9a-zA-Z ']*)/" err_t_tt ${errln}) - string(REGEX MATCH "([N|S|Z]+) ([-0-9a-zA-Z ']*)" err_t_tt "${CMAKE_MATCH_3}") - string(APPEND zip_err_type " ${CMAKE_MATCH_1},\n") - string(STRIP "${CMAKE_MATCH_2}" err_t_tt) - string(APPEND zip_err_str " \"${err_t_tt}\",\n") -endforeach() -string(APPEND zip_err_str [=[}\; - -const int _zip_nerr_str = sizeof(_zip_err_str)/sizeof(_zip_err_str[0])\; - -#define N ZIP_ET_NONE -#define S ZIP_ET_SYS -#define Z ZIP_ET_ZLIB - -const int _zip_err_type[] = { -]=]) -string(APPEND zip_err_str "${zip_err_type}}\;\n") -file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/zip_err_str.c ${zip_err_str}) +# create zip_err_str.c from zip.h and zipint.h +add_custom_command( + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/zip_err_str.c + COMMAND "${CMAKE_COMMAND}" + "-DPROJECT_SOURCE_DIR=${PROJECT_SOURCE_DIR}" + "-DCMAKE_CURRENT_BINARY_DIR=${CMAKE_CURRENT_BINARY_DIR}" + "-P" "${PROJECT_SOURCE_DIR}/cmake/GenerateZipErrorStrings.cmake" + DEPENDS + ${PROJECT_SOURCE_DIR}/cmake/GenerateZipErrorStrings.cmake + ${PROJECT_SOURCE_DIR}/lib/zip.h + ${PROJECT_SOURCE_DIR}/lib/zipint.h + COMMENT "Generating zip_err_str.c" +) diff --git a/core/deps/libzip/lib/compat.h b/core/deps/libzip/lib/compat.h index 257e0ab45..384a611ff 100644 --- a/core/deps/libzip/lib/compat.h +++ b/core/deps/libzip/lib/compat.h @@ -3,10 +3,10 @@ /* compat.h -- compatibility defines. - Copyright (C) 1999-2020 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -41,6 +41,9 @@ /* to have *_MAX definitions for all types when compiling with g++ */ #define __STDC_LIMIT_MACROS +/* to have ISO C secure library functions */ +#define __STDC_WANT_LIB_EXT1__ 1 + #ifdef _WIN32 #ifndef ZIP_EXTERN #ifndef ZIP_STATIC @@ -94,9 +97,12 @@ typedef char bool; #if !defined(HAVE_FILENO) && defined(HAVE__FILENO) #define fileno _fileno #endif -#if defined(HAVE__SNPRINTF) +#if !defined(HAVE_SNPRINTF) && defined(HAVE__SNPRINTF) #define snprintf _snprintf #endif +#if !defined(HAVE__SNWPRINTF_S) +#define _snwprintf_s(buf, bufsz, len, fmt, ...) (_snwprintf((buf), (len), (fmt), __VA_ARGS__)) +#endif #if defined(HAVE__STRDUP) #if !defined(HAVE_STRDUP) || defined(_WIN32) #undef strdup @@ -125,6 +131,33 @@ typedef char bool; #define ftello(s) ((long)ftell((s))) #endif +#ifdef HAVE_LOCALTIME_S +#ifdef _WIN32 +/* Windows is incompatible to the C11 standard, hurray! */ +#define zip_localtime(t, tm) (localtime_s((tm), (t)) == 0 ? tm : NULL) +#else +#define zip_localtime localtime_s +#endif +#else +#ifdef HAVE_LOCALTIME_R +#define zip_localtime localtime_r +#else +#define zip_localtime(t, tm) (localtime(t)) +#endif +#endif + +#ifndef HAVE_MEMCPY_S +#define memcpy_s(dest, destsz, src, count) (memcpy((dest), (src), (count)) == NULL) +#endif + +#ifndef HAVE_SNPRINTF_S +#ifdef HAVE__SNPRINTF_S +#define snprintf_s(buf, bufsz, fmt, ...) (_snprintf_s((buf), (bufsz), (bufsz), (fmt), __VA_ARGS__)) +#else +#define snprintf_s snprintf +#endif +#endif + #if !defined(HAVE_STRCASECMP) #if defined(HAVE__STRICMP) #define strcasecmp _stricmp @@ -133,6 +166,19 @@ typedef char bool; #endif #endif +#ifndef HAVE_STRNCPY_S +#define strncpy_s(dest, destsz, src, count) (strncpy((dest), (src), (count)), 0) +#endif + +#ifndef HAVE_STRERROR_S +#define strerrorlen_s(errnum) (strlen(strerror(errnum))) +#define strerror_s(buf, bufsz, errnum) ((void)strncpy_s((buf), (bufsz), strerror(errnum), (bufsz)), (buf)[(bufsz)-1] = '\0', strerrorlen_s(errnum) >= (bufsz)) +#else +#ifndef HAVE_STRERRORLEN_S +#define strerrorlen_s(errnum) 8192 +#endif +#endif + #if SIZEOF_OFF_T == 8 #define ZIP_OFF_MAX ZIP_INT64_MAX #define ZIP_OFF_MIN ZIP_INT64_MIN diff --git a/core/deps/libzip/lib/zip.h b/core/deps/libzip/lib/zip.h index 4a1bf8912..0d31d4068 100644 --- a/core/deps/libzip/lib/zip.h +++ b/core/deps/libzip/lib/zip.h @@ -3,10 +3,10 @@ /* zip.h -- exported declarations. - Copyright (C) 1999-2020 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -58,6 +58,16 @@ extern "C" { #endif #endif +#ifndef ZIP_DEPRECATED +#if defined(__GNUC__) || defined(__clang__) +#define ZIP_DEPRECATED(x) __attribute__((deprecated(x))) +#elif defined(_MSC_VER) +#define ZIP_DEPRECATED(x) __declspec(deprecated(x)) +#else +#define ZIP_DEPRECATED(x) +#endif +#endif + #include #include #include @@ -77,7 +87,7 @@ extern "C" { #define ZIP_FL_NODIR 2u /* ignore directory component */ #define ZIP_FL_COMPRESSED 4u /* read compressed data */ #define ZIP_FL_UNCHANGED 8u /* use original data, ignoring changes */ -#define ZIP_FL_RECOMPRESS 16u /* force recompression of data */ +/* 16u was ZIP_FL_RECOMPRESS, which is deprecated */ #define ZIP_FL_ENCRYPTED 32u /* read encrypted data (implies ZIP_FL_COMPRESSED) */ #define ZIP_FL_ENC_GUESS 0u /* guess string encoding (is default) */ #define ZIP_FL_ENC_RAW 64u /* get unmodified string */ @@ -91,7 +101,10 @@ extern "C" { /* archive global flags flags */ -#define ZIP_AFL_RDONLY 2u /* read only -- cannot be cleared */ +#define ZIP_AFL_RDONLY 2u /* read only -- cannot be cleared */ +#define ZIP_AFL_IS_TORRENTZIP 4u /* current archive is torrentzipped */ +#define ZIP_AFL_WANT_TORRENTZIP 8u /* write archive in torrentzip format */ +#define ZIP_AFL_CREATE_OR_KEEP_FILE_FOR_EMPTY_ARCHIVE 16u /* don't remove file if archive is empty */ /* create a new extra field */ @@ -99,6 +112,10 @@ extern "C" { #define ZIP_EXTRA_FIELD_ALL ZIP_UINT16_MAX #define ZIP_EXTRA_FIELD_NEW ZIP_UINT16_MAX +/* length parameter to various functions */ + +#define ZIP_LENGTH_TO_END 0 +#define ZIP_LENGTH_UNCHECKED (-2) /* only supported by zip_source_file and its variants */ /* libzip error codes */ @@ -123,7 +140,7 @@ extern "C" { #define ZIP_ER_INVAL 18 /* N Invalid argument */ #define ZIP_ER_NOZIP 19 /* N Not a zip archive */ #define ZIP_ER_INTERNAL 20 /* N Internal error */ -#define ZIP_ER_INCONS 21 /* N Zip archive inconsistent */ +#define ZIP_ER_INCONS 21 /* L Zip archive inconsistent */ #define ZIP_ER_REMOVE 22 /* S Can't remove file */ #define ZIP_ER_DELETED 23 /* N Entry has been deleted */ #define ZIP_ER_ENCRNOTSUPP 24 /* N Encryption method not supported */ @@ -135,12 +152,15 @@ extern "C" { #define ZIP_ER_TELL 30 /* S Tell error */ #define ZIP_ER_COMPRESSED_DATA 31 /* N Compressed data invalid */ #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 */ /* type of system error value */ -#define ZIP_ET_NONE 0 /* sys_err unused */ -#define ZIP_ET_SYS 1 /* sys_err is errno */ -#define ZIP_ET_ZLIB 2 /* sys_err is zlib error code */ +#define ZIP_ET_NONE 0 /* sys_err unused */ +#define ZIP_ET_SYS 1 /* sys_err is errno */ +#define ZIP_ET_ZLIB 2 /* sys_err is zlib error code */ +#define ZIP_ET_LIBZIP 3 /* sys_err is libzip error code */ /* compression methods */ @@ -235,12 +255,15 @@ enum zip_source_cmd { ZIP_SOURCE_RESERVED_1, /* previously used internally */ 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_GET_FILE_ATTRIBUTES, /* get additional file attributes */ + ZIP_SOURCE_SUPPORTS_REOPEN /* allow reading from changed entry */ }; typedef enum zip_source_cmd zip_source_cmd_t; #define ZIP_SOURCE_MAKE_COMMAND_BITMASK(cmd) (((zip_int64_t)1) << (cmd)) +#define ZIP_SOURCE_CHECK_SUPPORTED(supported, cmd) (((supported) & ZIP_SOURCE_MAKE_COMMAND_BITMASK(cmd)) != 0) + /* clang-format off */ #define ZIP_SOURCE_SUPPORTS_READABLE (ZIP_SOURCE_MAKE_COMMAND_BITMASK(ZIP_SOURCE_OPEN) \ @@ -344,24 +367,29 @@ typedef struct zip_buffer_fragment zip_buffer_fragment_t; typedef zip_uint32_t zip_flags_t; typedef zip_int64_t (*zip_source_callback)(void *_Nullable, void *_Nullable, zip_uint64_t, zip_source_cmd_t); +typedef zip_int64_t (*zip_source_layered_callback)(zip_source_t *_Nonnull, void *_Nullable, void *_Nullable, zip_uint64_t, enum zip_source_cmd); typedef void (*zip_progress_callback)(zip_t *_Nonnull, double, void *_Nullable); typedef int (*zip_cancel_callback)(zip_t *_Nonnull, void *_Nullable); #ifndef ZIP_DISABLE_DEPRECATED +#define ZIP_FL_RECOMPRESS 16u /* force recompression of data */ + typedef void (*zip_progress_callback_t)(double); -ZIP_EXTERN void zip_register_progress_callback(zip_t *_Nonnull, zip_progress_callback_t _Nullable); /* use zip_register_progress_callback_with_state */ - -ZIP_EXTERN zip_int64_t zip_add(zip_t *_Nonnull, const char *_Nonnull, zip_source_t *_Nonnull); /* use zip_file_add */ -ZIP_EXTERN zip_int64_t zip_add_dir(zip_t *_Nonnull, const char *_Nonnull); /* use zip_dir_add */ -ZIP_EXTERN const char *_Nullable zip_get_file_comment(zip_t *_Nonnull, zip_uint64_t, int *_Nullable, int); /* use zip_file_get_comment */ -ZIP_EXTERN int zip_get_num_files(zip_t *_Nonnull); /* use zip_get_num_entries instead */ -ZIP_EXTERN int zip_rename(zip_t *_Nonnull, zip_uint64_t, const char *_Nonnull); /* use zip_file_rename */ -ZIP_EXTERN int zip_replace(zip_t *_Nonnull, zip_uint64_t, zip_source_t *_Nonnull); /* use zip_file_replace */ -ZIP_EXTERN int zip_set_file_comment(zip_t *_Nonnull, zip_uint64_t, const char *_Nullable, int); /* use zip_file_set_comment */ -ZIP_EXTERN int zip_error_get_sys_type(int); /* use zip_error_system_type */ -ZIP_EXTERN void zip_error_get(zip_t *_Nonnull, int *_Nullable, int *_Nullable); /* use zip_get_error, zip_error_code_zip / zip_error_code_system */ -ZIP_EXTERN int zip_error_to_str(char *_Nonnull, zip_uint64_t, int, int); /* use zip_error_init_with_code / zip_error_strerror */ -ZIP_EXTERN void zip_file_error_get(zip_file_t *_Nonnull, int *_Nullable, int *_Nullable); /* use zip_file_get_error, zip_error_code_zip / zip_error_code_system */ +ZIP_DEPRECATED("use 'zip_register_progress_callback_with_state' instead") ZIP_EXTERN void zip_register_progress_callback(zip_t *_Nonnull, zip_progress_callback_t _Nullable); + +ZIP_DEPRECATED("use 'zip_file_add' instead") ZIP_EXTERN zip_int64_t zip_add(zip_t *_Nonnull, const char *_Nonnull, zip_source_t *_Nonnull); +ZIP_DEPRECATED("use 'zip_dir_add' instead") ZIP_EXTERN zip_int64_t zip_add_dir(zip_t *_Nonnull, const char *_Nonnull); +ZIP_DEPRECATED("use 'zip_file_get_comment' instead") ZIP_EXTERN const char *_Nullable zip_get_file_comment(zip_t *_Nonnull, zip_uint64_t, int *_Nullable, int); +ZIP_DEPRECATED("use 'zip_get_num_entries' instead") ZIP_EXTERN int zip_get_num_files(zip_t *_Nonnull); +ZIP_DEPRECATED("use 'zip_file_rename' instead") ZIP_EXTERN int zip_rename(zip_t *_Nonnull, zip_uint64_t, const char *_Nonnull); +ZIP_DEPRECATED("use 'zip_file_replace' instead") ZIP_EXTERN int zip_replace(zip_t *_Nonnull, zip_uint64_t, zip_source_t *_Nonnull); +ZIP_DEPRECATED("use 'zip_file_set_comment' instead") ZIP_EXTERN int zip_set_file_comment(zip_t *_Nonnull, zip_uint64_t, const char *_Nullable, int); +ZIP_DEPRECATED("use 'zip_error_init_with_code' and 'zip_error_system_type' instead") ZIP_EXTERN int zip_error_get_sys_type(int); +ZIP_DEPRECATED("use 'zip_get_error' instead") ZIP_EXTERN void zip_error_get(zip_t *_Nonnull, int *_Nullable, int *_Nullable); +ZIP_DEPRECATED("use 'zip_error_strerror' instead") ZIP_EXTERN int zip_error_to_str(char *_Nonnull, zip_uint64_t, int, int); +ZIP_DEPRECATED("use 'zip_file_get_error' instead") ZIP_EXTERN void zip_file_error_get(zip_file_t *_Nonnull, int *_Nullable, int *_Nullable); +ZIP_DEPRECATED("use 'zip_source_zip_file' instead") ZIP_EXTERN zip_source_t *_Nullable zip_source_zip(zip_t *_Nonnull, zip_t *_Nonnull, zip_uint64_t, zip_flags_t, zip_uint64_t, zip_int64_t); +ZIP_DEPRECATED("use 'zip_source_zip_file_create' instead") ZIP_EXTERN zip_source_t *_Nullable zip_source_zip_create(zip_t *_Nonnull, zip_uint64_t, zip_flags_t, zip_uint64_t, zip_int64_t, zip_error_t *_Nullable); #endif ZIP_EXTERN int zip_close(zip_t *_Nonnull); @@ -377,6 +405,7 @@ ZIP_EXTERN void zip_error_fini(zip_error_t *_Nonnull); ZIP_EXTERN void zip_error_init(zip_error_t *_Nonnull); ZIP_EXTERN void zip_error_init_with_code(zip_error_t *_Nonnull, int); ZIP_EXTERN void zip_error_set(zip_error_t *_Nullable, int, int); +ZIP_EXTERN void zip_error_set_from_source(zip_error_t *_Nonnull, zip_source_t *_Nullable); ZIP_EXTERN const char *_Nonnull zip_error_strerror(zip_error_t *_Nonnull); ZIP_EXTERN int zip_error_system_type(const zip_error_t *_Nonnull); ZIP_EXTERN zip_int64_t zip_error_to_data(const zip_error_t *_Nonnull, void *_Nonnull, zip_uint64_t); @@ -396,6 +425,7 @@ ZIP_EXTERN const zip_uint8_t *_Nullable zip_file_extra_field_get_by_id(zip_t *_N ZIP_EXTERN const char *_Nullable zip_file_get_comment(zip_t *_Nonnull, zip_uint64_t, zip_uint32_t *_Nullable, zip_flags_t); ZIP_EXTERN zip_error_t *_Nonnull zip_file_get_error(zip_file_t *_Nonnull); ZIP_EXTERN int zip_file_get_external_attributes(zip_t *_Nonnull, zip_uint64_t, zip_flags_t, zip_uint8_t *_Nullable, zip_uint32_t *_Nullable); +ZIP_EXTERN int zip_file_is_seekable(zip_file_t *_Nonnull); ZIP_EXTERN int zip_file_rename(zip_t *_Nonnull, zip_uint64_t, const char *_Nonnull, zip_flags_t); ZIP_EXTERN int zip_file_replace(zip_t *_Nonnull, zip_uint64_t, zip_source_t *_Nonnull, zip_flags_t); ZIP_EXTERN int zip_file_set_comment(zip_t *_Nonnull, zip_uint64_t, const char *_Nullable, zip_uint16_t, zip_flags_t); @@ -443,9 +473,13 @@ ZIP_EXTERN zip_source_t *_Nullable zip_source_function(zip_t *_Nonnull, zip_sour ZIP_EXTERN zip_source_t *_Nullable zip_source_function_create(zip_source_callback _Nonnull, void *_Nullable, zip_error_t *_Nullable); ZIP_EXTERN int zip_source_get_file_attributes(zip_source_t *_Nonnull, zip_file_attributes_t *_Nonnull); ZIP_EXTERN int zip_source_is_deleted(zip_source_t *_Nonnull); +ZIP_EXTERN int zip_source_is_seekable(zip_source_t *_Nonnull); ZIP_EXTERN void zip_source_keep(zip_source_t *_Nonnull); +ZIP_EXTERN zip_source_t *_Nullable zip_source_layered(zip_t *_Nullable, zip_source_t *_Nonnull, zip_source_layered_callback _Nonnull, void *_Nullable); +ZIP_EXTERN zip_source_t *_Nullable zip_source_layered_create(zip_source_t *_Nonnull, zip_source_layered_callback _Nonnull, void *_Nullable, zip_error_t *_Nullable); ZIP_EXTERN zip_int64_t zip_source_make_command_bitmap(zip_source_cmd_t, ...); ZIP_EXTERN int zip_source_open(zip_source_t *_Nonnull); +ZIP_EXTERN zip_int64_t zip_source_pass_to_lower_layer(zip_source_t *_Nonnull, void *_Nullable, zip_uint64_t, zip_source_cmd_t); ZIP_EXTERN zip_int64_t zip_source_read(zip_source_t *_Nonnull, void *_Nonnull, zip_uint64_t); ZIP_EXTERN void zip_source_rollback_write(zip_source_t *_Nonnull); ZIP_EXTERN int zip_source_seek(zip_source_t *_Nonnull, zip_int64_t, int); @@ -455,15 +489,17 @@ ZIP_EXTERN int zip_source_stat(zip_source_t *_Nonnull, zip_stat_t *_Nonnull); ZIP_EXTERN zip_int64_t zip_source_tell(zip_source_t *_Nonnull); ZIP_EXTERN zip_int64_t zip_source_tell_write(zip_source_t *_Nonnull); #ifdef _WIN32 -ZIP_EXTERN zip_source_t *zip_source_win32a(zip_t *, const char *, zip_uint64_t, zip_int64_t); -ZIP_EXTERN zip_source_t *zip_source_win32a_create(const char *, zip_uint64_t, zip_int64_t, zip_error_t *); -ZIP_EXTERN zip_source_t *zip_source_win32handle(zip_t *, void *, zip_uint64_t, zip_int64_t); -ZIP_EXTERN zip_source_t *zip_source_win32handle_create(void *, zip_uint64_t, zip_int64_t, zip_error_t *); -ZIP_EXTERN zip_source_t *zip_source_win32w(zip_t *, const wchar_t *, zip_uint64_t, zip_int64_t); -ZIP_EXTERN zip_source_t *zip_source_win32w_create(const wchar_t *, zip_uint64_t, zip_int64_t, zip_error_t *); +ZIP_EXTERN zip_source_t *_Nullable zip_source_win32a(zip_t *_Nonnull, const char *_Nonnull, zip_uint64_t, zip_int64_t); +ZIP_EXTERN zip_source_t *_Nullable zip_source_win32a_create(const char *_Nonnull, zip_uint64_t, zip_int64_t, zip_error_t *_Nullable); +ZIP_EXTERN zip_source_t *_Nullable zip_source_win32handle(zip_t *_Nonnull, void *_Nonnull, zip_uint64_t, zip_int64_t); +ZIP_EXTERN zip_source_t *_Nullable zip_source_win32handle_create(void *_Nonnull, zip_uint64_t, zip_int64_t, zip_error_t *_Nullable); +ZIP_EXTERN zip_source_t *_Nullable zip_source_win32w(zip_t *_Nonnull, const wchar_t *_Nonnull, zip_uint64_t, zip_int64_t); +ZIP_EXTERN zip_source_t *_Nullable zip_source_win32w_create(const wchar_t *_Nonnull, zip_uint64_t, zip_int64_t, zip_error_t *_Nullable); #endif +ZIP_EXTERN zip_source_t *_Nullable zip_source_window_create(zip_source_t *_Nonnull, zip_uint64_t, zip_int64_t, zip_error_t *_Nullable); ZIP_EXTERN zip_int64_t zip_source_write(zip_source_t *_Nonnull, const void *_Nullable, zip_uint64_t); -ZIP_EXTERN zip_source_t *_Nullable zip_source_zip(zip_t *_Nonnull, zip_t *_Nonnull, zip_uint64_t, zip_flags_t, zip_uint64_t, zip_int64_t); +ZIP_EXTERN zip_source_t *_Nullable zip_source_zip_file(zip_t *_Nonnull, zip_t *_Nonnull, zip_uint64_t, zip_flags_t, zip_uint64_t, zip_int64_t, const char *_Nullable); +ZIP_EXTERN zip_source_t *_Nullable zip_source_zip_file_create(zip_t *_Nonnull, zip_uint64_t, zip_flags_t, zip_uint64_t, zip_int64_t, const char *_Nullable, zip_error_t *_Nullable); ZIP_EXTERN int zip_stat(zip_t *_Nonnull, const char *_Nonnull, zip_flags_t, zip_stat_t *_Nonnull); ZIP_EXTERN int zip_stat_index(zip_t *_Nonnull, zip_uint64_t, zip_flags_t, zip_stat_t *_Nonnull); ZIP_EXTERN void zip_stat_init(zip_stat_t *_Nonnull); diff --git a/core/deps/libzip/lib/zip_add.c b/core/deps/libzip/lib/zip_add.c index ef04f1e51..9770139d6 100644 --- a/core/deps/libzip/lib/zip_add.c +++ b/core/deps/libzip/lib/zip_add.c @@ -1,9 +1,9 @@ /* zip_add.c -- add file via callback function - Copyright (C) 1999-2020 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/core/deps/libzip/lib/zip_add_dir.c b/core/deps/libzip/lib/zip_add_dir.c index 9999c8da2..c31fea365 100644 --- a/core/deps/libzip/lib/zip_add_dir.c +++ b/core/deps/libzip/lib/zip_add_dir.c @@ -1,9 +1,9 @@ /* zip_add_dir.c -- add directory - Copyright (C) 1999-2020 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/core/deps/libzip/lib/zip_add_entry.c b/core/deps/libzip/lib/zip_add_entry.c index 1c9fcff6a..bf12dd541 100644 --- a/core/deps/libzip/lib/zip_add_entry.c +++ b/core/deps/libzip/lib/zip_add_entry.c @@ -1,9 +1,9 @@ /* zip_add_entry.c -- create and init struct zip_entry - Copyright (C) 1999-2020 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/core/deps/libzip/lib/zip_algorithm_bzip2.c b/core/deps/libzip/lib/zip_algorithm_bzip2.c index 7434e5409..f25be1438 100644 --- a/core/deps/libzip/lib/zip_algorithm_bzip2.c +++ b/core/deps/libzip/lib/zip_algorithm_bzip2.c @@ -1,9 +1,9 @@ /* zip_algorithm_bzip2.c -- bzip2 (de)compression routines - Copyright (C) 2017-2020 Dieter Baron and Thomas Klausner + Copyright (C) 2017-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -58,7 +58,7 @@ maximum_compressed_size(zip_uint64_t uncompressed_size) { static void * -allocate(bool compress, int compression_flags, zip_error_t *error) { +allocate(bool compress, zip_uint32_t compression_flags, zip_error_t *error) { struct ctx *ctx; if ((ctx = (struct ctx *)malloc(sizeof(*ctx))) == NULL) { @@ -67,8 +67,10 @@ allocate(bool compress, int compression_flags, zip_error_t *error) { ctx->error = error; ctx->compress = compress; - ctx->compression_flags = compression_flags; - if (ctx->compression_flags < 1 || ctx->compression_flags > 9) { + if (compression_flags >= 1 && compression_flags <= 9) { + ctx->compression_flags = (int)compression_flags; + } + else { ctx->compression_flags = 9; } ctx->end_of_input = false; @@ -82,13 +84,15 @@ allocate(bool compress, int compression_flags, zip_error_t *error) { static void * -compress_allocate(zip_uint16_t method, int compression_flags, zip_error_t *error) { +compress_allocate(zip_uint16_t method, zip_uint32_t compression_flags, zip_error_t *error) { + (void)method; return allocate(true, compression_flags, error); } static void * -decompress_allocate(zip_uint16_t method, int compression_flags, zip_error_t *error) { +decompress_allocate(zip_uint16_t method, zip_uint32_t compression_flags, zip_error_t *error) { + (void)method; return allocate(false, compression_flags, error); } @@ -103,6 +107,7 @@ deallocate(void *ud) { static zip_uint16_t general_purpose_bit_flags(void *ud) { + (void)ud; return 0; } @@ -132,8 +137,6 @@ map_error(int ret) { case BZ_IO_ERROR: case BZ_OUTBUFF_FULL: case BZ_SEQUENCE_ERROR: - return ZIP_ER_INTERNAL; - default: return ZIP_ER_INTERNAL; } @@ -144,6 +147,9 @@ start(void *ud, zip_stat_t *st, zip_file_attributes_t *attributes) { struct ctx *ctx = (struct ctx *)ud; int ret; + (void)st; + (void)attributes; + ctx->zstr.avail_in = 0; ctx->zstr.next_in = NULL; ctx->zstr.avail_out = 0; @@ -213,6 +219,7 @@ end_of_input(void *ud) { static zip_compression_status_t process(void *ud, zip_uint8_t *data, zip_uint64_t *length) { struct ctx *ctx = (struct ctx *)ud; + unsigned int avail_out; int ret; @@ -221,7 +228,8 @@ process(void *ud, zip_uint8_t *data, zip_uint64_t *length) { return ZIP_COMPRESSION_NEED_DATA; } - ctx->zstr.avail_out = (unsigned int)ZIP_MIN(UINT_MAX, *length); + avail_out = (unsigned int)ZIP_MIN(UINT_MAX, *length); + ctx->zstr.avail_out = avail_out; ctx->zstr.next_out = (char *)data; if (ctx->compress) { @@ -231,7 +239,7 @@ process(void *ud, zip_uint8_t *data, zip_uint64_t *length) { ret = BZ2_bzDecompress(&ctx->zstr); } - *length = *length - ctx->zstr.avail_out; + *length = avail_out - ctx->zstr.avail_out; switch (ret) { case BZ_FINISH_OK: /* compression */ diff --git a/core/deps/libzip/lib/zip_algorithm_deflate.c b/core/deps/libzip/lib/zip_algorithm_deflate.c index 99d8a597b..3c85e2045 100644 --- a/core/deps/libzip/lib/zip_algorithm_deflate.c +++ b/core/deps/libzip/lib/zip_algorithm_deflate.c @@ -1,9 +1,9 @@ /* zip_algorithm_deflate.c -- deflate (de)compression routines - Copyright (C) 2017-2020 Dieter Baron and Thomas Klausner + Copyright (C) 2017-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -40,7 +40,8 @@ struct ctx { zip_error_t *error; bool compress; - int compression_flags; + int level; + int mem_level; bool end_of_input; z_stream zstr; }; @@ -60,7 +61,7 @@ maximum_compressed_size(zip_uint64_t uncompressed_size) { static void * -allocate(bool compress, int compression_flags, zip_error_t *error) { +allocate(bool compress, zip_uint32_t compression_flags, zip_error_t *error) { struct ctx *ctx; if ((ctx = (struct ctx *)malloc(sizeof(*ctx))) == NULL) { @@ -70,10 +71,13 @@ allocate(bool compress, int compression_flags, zip_error_t *error) { ctx->error = error; ctx->compress = compress; - ctx->compression_flags = compression_flags; - if (ctx->compression_flags < 1 || ctx->compression_flags > 9) { - ctx->compression_flags = Z_BEST_COMPRESSION; + if (compression_flags >= 1 && compression_flags <= 9) { + ctx->level = (int)compression_flags; } + else { + ctx->level = Z_BEST_COMPRESSION; + } + ctx->mem_level = compression_flags == TORRENTZIP_COMPRESSION_FLAGS ? TORRENTZIP_MEM_LEVEL : MAX_MEM_LEVEL; ctx->end_of_input = false; ctx->zstr.zalloc = Z_NULL; @@ -85,13 +89,15 @@ allocate(bool compress, int compression_flags, zip_error_t *error) { static void * -compress_allocate(zip_uint16_t method, int compression_flags, zip_error_t *error) { +compress_allocate(zip_uint16_t method, zip_uint32_t compression_flags, zip_error_t *error) { + (void)method; return allocate(true, compression_flags, error); } static void * -decompress_allocate(zip_uint16_t method, int compression_flags, zip_error_t *error) { +decompress_allocate(zip_uint16_t method, zip_uint32_t compression_flags, zip_error_t *error) { + (void)method; return allocate(false, compression_flags, error); } @@ -112,10 +118,10 @@ general_purpose_bit_flags(void *ud) { return 0; } - if (ctx->compression_flags < 3) { + if (ctx->level < 3) { return 2 << 1; } - else if (ctx->compression_flags > 7) { + else if (ctx->level > 7) { return 1 << 1; } return 0; @@ -127,6 +133,9 @@ start(void *ud, zip_stat_t *st, zip_file_attributes_t *attributes) { struct ctx *ctx = (struct ctx *)ud; int ret; + (void)st; + (void)attributes; + ctx->zstr.avail_in = 0; ctx->zstr.next_in = NULL; ctx->zstr.avail_out = 0; @@ -134,7 +143,7 @@ start(void *ud, zip_stat_t *st, zip_file_attributes_t *attributes) { if (ctx->compress) { /* negative value to tell zlib not to write a header */ - ret = deflateInit2(&ctx->zstr, ctx->compression_flags, Z_DEFLATED, -MAX_WBITS, MAX_MEM_LEVEL, Z_DEFAULT_STRATEGY); + ret = deflateInit2(&ctx->zstr, ctx->level, Z_DEFLATED, -MAX_WBITS, ctx->mem_level, Z_DEFAULT_STRATEGY); } else { ret = inflateInit2(&ctx->zstr, -MAX_WBITS); @@ -198,10 +207,12 @@ end_of_input(void *ud) { static zip_compression_status_t process(void *ud, zip_uint8_t *data, zip_uint64_t *length) { struct ctx *ctx = (struct ctx *)ud; + uInt avail_out; int ret; - ctx->zstr.avail_out = (uInt)ZIP_MIN(UINT_MAX, *length); + avail_out = (uInt)ZIP_MIN(UINT_MAX, *length); + ctx->zstr.avail_out = avail_out; ctx->zstr.next_out = (Bytef *)data; if (ctx->compress) { @@ -211,7 +222,7 @@ process(void *ud, zip_uint8_t *data, zip_uint64_t *length) { ret = inflate(&ctx->zstr, Z_SYNC_FLUSH); } - *length = *length - ctx->zstr.avail_out; + *length = avail_out - ctx->zstr.avail_out; switch (ret) { case Z_OK: diff --git a/core/deps/libzip/lib/zip_algorithm_xz.c b/core/deps/libzip/lib/zip_algorithm_xz.c index 25abaf2d2..d7a7142d4 100644 --- a/core/deps/libzip/lib/zip_algorithm_xz.c +++ b/core/deps/libzip/lib/zip_algorithm_xz.c @@ -1,10 +1,10 @@ /* zip_algorithm_xz.c -- LZMA/XZ (de)compression routines Bazed on zip_algorithm_deflate.c -- deflate (de)compression routines - Copyright (C) 2017-2020 Dieter Baron and Thomas Klausner + Copyright (C) 2017-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -104,14 +104,9 @@ maximum_compressed_size(zip_uint64_t uncompressed_size) { static void * -allocate(bool compress, int compression_flags, zip_error_t *error, zip_uint16_t method) { +allocate(bool compress, zip_uint32_t compression_flags, zip_error_t *error, zip_uint16_t method) { struct ctx *ctx; - if (compression_flags < 0) { - zip_error_set(error, ZIP_ER_INVAL, 0); - return NULL; - } - if ((ctx = (struct ctx *)malloc(sizeof(*ctx))) == NULL) { zip_error_set(error, ZIP_ER_MEMORY, 0); return NULL; @@ -119,12 +114,16 @@ allocate(bool compress, int compression_flags, zip_error_t *error, zip_uint16_t ctx->error = error; ctx->compress = compress; - ctx->compression_flags = (zip_uint32_t)compression_flags; + if (compression_flags <= 9) { + ctx->compression_flags = compression_flags; + } else { + ctx->compression_flags = 6; /* default value */ + } ctx->compression_flags |= LZMA_PRESET_EXTREME; ctx->end_of_input = false; memset(ctx->header, 0, sizeof(ctx->header)); ctx->header_bytes_offset = 0; - if (ZIP_CM_LZMA) { + if (method == ZIP_CM_LZMA) { ctx->header_state = INCOMPLETE; } else { @@ -137,13 +136,13 @@ allocate(bool compress, int compression_flags, zip_error_t *error, zip_uint16_t static void * -compress_allocate(zip_uint16_t method, int compression_flags, zip_error_t *error) { +compress_allocate(zip_uint16_t method, zip_uint32_t compression_flags, zip_error_t *error) { return allocate(true, compression_flags, error, method); } static void * -decompress_allocate(zip_uint16_t method, int compression_flags, zip_error_t *error) { +decompress_allocate(zip_uint16_t method, zip_uint32_t compression_flags, zip_error_t *error) { return allocate(false, compression_flags, error, method); } @@ -224,7 +223,7 @@ start(void *ud, zip_stat_t *st, zip_file_attributes_t *attributes) { zip_error_set(ctx->error, map_error(ret), 0); return false; } - + /* If general purpose bits 1 & 2 are both zero, write real uncompressed size in header. */ if ((attributes->valid & ZIP_FILE_ATTRIBUTES_GENERAL_PURPOSE_BIT_FLAGS) && (attributes->general_purpose_bit_mask & 0x6) == 0x6 && (attributes->general_purpose_bit_flags & 0x06) == 0 && (st->valid & ZIP_STAT_SIZE)) { ctx->uncompresssed_size = st->size; @@ -258,8 +257,8 @@ input(void *ud, zip_uint8_t *data, zip_uint64_t length) { /* For decompression of LZMA1: Have we read the full "lzma alone" header yet? */ if (ctx->method == ZIP_CM_LZMA && !ctx->compress && ctx->header_state == INCOMPLETE) { /* if not, get more of the data */ - zip_uint8_t got = ZIP_MIN(HEADER_BYTES_ZIP - ctx->header_bytes_offset, length); - memcpy(ctx->header + ctx->header_bytes_offset, data, got); + zip_uint8_t got = (zip_uint8_t)ZIP_MIN(HEADER_BYTES_ZIP - ctx->header_bytes_offset, length); + (void)memcpy_s(ctx->header + ctx->header_bytes_offset, sizeof(ctx->header) - ctx->header_bytes_offset, data, got); ctx->header_bytes_offset += got; length -= got; data += got; @@ -314,6 +313,7 @@ end_of_input(void *ud) { static zip_compression_status_t process(void *ud, zip_uint8_t *data, zip_uint64_t *length) { struct ctx *ctx = (struct ctx *)ud; + uInt avail_out; lzma_ret ret; /* for compression of LZMA1 */ if (ctx->method == ZIP_CM_LZMA && ctx->compress) { @@ -335,8 +335,8 @@ process(void *ud, zip_uint8_t *data, zip_uint64_t *length) { } if (ctx->header_state == OUTPUT) { /* write header */ - zip_uint8_t write_len = ZIP_MIN(HEADER_BYTES_ZIP - ctx->header_bytes_offset, *length); - memcpy(data, ctx->header + ctx->header_bytes_offset, write_len); + zip_uint8_t write_len = (zip_uint8_t)ZIP_MIN(HEADER_BYTES_ZIP - ctx->header_bytes_offset, *length); + (void)memcpy_s(data, *length, ctx->header + ctx->header_bytes_offset, write_len); ctx->header_bytes_offset += write_len; *length = write_len; if (ctx->header_bytes_offset == HEADER_BYTES_ZIP) { @@ -346,11 +346,12 @@ process(void *ud, zip_uint8_t *data, zip_uint64_t *length) { } } - ctx->zstr.avail_out = (uInt)ZIP_MIN(UINT_MAX, *length); + avail_out = (uInt)ZIP_MIN(UINT_MAX, *length); + ctx->zstr.avail_out = avail_out; ctx->zstr.next_out = (Bytef *)data; ret = lzma_code(&ctx->zstr, ctx->end_of_input ? LZMA_FINISH : LZMA_RUN); - *length = *length - ctx->zstr.avail_out; + *length = avail_out - ctx->zstr.avail_out; switch (ret) { case LZMA_OK: diff --git a/core/deps/libzip/lib/zip_algorithm_zstd.c b/core/deps/libzip/lib/zip_algorithm_zstd.c index c27e9fb39..d005da9d5 100644 --- a/core/deps/libzip/lib/zip_algorithm_zstd.c +++ b/core/deps/libzip/lib/zip_algorithm_zstd.c @@ -1,9 +1,9 @@ /* zip_algorithm_zstd.c -- zstd (de)compression routines - Copyright (C) 2020 Dieter Baron and Thomas Klausner + Copyright (C) 2020-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -33,7 +33,6 @@ #include "zipint.h" -#include #include #include #include @@ -56,21 +55,20 @@ maximum_compressed_size(zip_uint64_t uncompressed_size) { static void * -allocate(bool compress, int compression_flags, zip_error_t *error) { +allocate(bool compress, zip_uint32_t compression_flags, zip_error_t *error) { struct ctx *ctx; - /* 0: let zstd choose */ - if (compression_flags < 0 || compression_flags > 9) { - compression_flags = 0; - } - if ((ctx = (struct ctx *)malloc(sizeof(*ctx))) == NULL) { return NULL; } + ctx->compression_flags = (zip_int32_t)compression_flags; + if (ctx->compression_flags < ZSTD_minCLevel() || ctx->compression_flags > ZSTD_maxCLevel()) { + ctx->compression_flags = 0; /* let zstd choose */ + } + ctx->error = error; ctx->compress = compress; - ctx->compression_flags = compression_flags; ctx->end_of_input = false; ctx->zdstream = NULL; @@ -87,13 +85,15 @@ allocate(bool compress, int compression_flags, zip_error_t *error) { static void * -compress_allocate(zip_uint16_t method, int compression_flags, zip_error_t *error) { +compress_allocate(zip_uint16_t method, zip_uint32_t compression_flags, zip_error_t *error) { + (void)method; return allocate(true, compression_flags, error); } static void * -decompress_allocate(zip_uint16_t method, int compression_flags, zip_error_t *error) { +decompress_allocate(zip_uint16_t method, zip_uint32_t compression_flags, zip_error_t *error) { + (void)method; return allocate(false, compression_flags, error); } @@ -107,7 +107,7 @@ deallocate(void *ud) { static zip_uint16_t general_purpose_bit_flags(void *ud) { - /* struct ctx *ctx = (struct ctx *)ud; */ + (void)ud; return 0; } @@ -139,6 +139,10 @@ map_error(size_t ret) { static bool start(void *ud, zip_stat_t *st, zip_file_attributes_t *attributes) { struct ctx *ctx = (struct ctx *)ud; + + (void)st; + (void)attributes; + ctx->in.src = NULL; ctx->in.pos = 0; ctx->in.size = 0; diff --git a/core/deps/libzip/lib/zip_buffer.c b/core/deps/libzip/lib/zip_buffer.c index 3bfcc82c1..e2103f04c 100644 --- a/core/deps/libzip/lib/zip_buffer.c +++ b/core/deps/libzip/lib/zip_buffer.c @@ -1,9 +1,9 @@ /* zip_buffer.c -- bounds checked access to memory buffer - Copyright (C) 2014-2020 Dieter Baron and Thomas Klausner + Copyright (C) 2014-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -132,13 +132,20 @@ _zip_buffer_left(zip_buffer_t *buffer) { zip_uint64_t _zip_buffer_read(zip_buffer_t *buffer, zip_uint8_t *data, zip_uint64_t length) { + zip_uint64_t copied; + if (_zip_buffer_left(buffer) < length) { length = _zip_buffer_left(buffer); } - memcpy(data, _zip_buffer_get(buffer, length), length); + copied = 0; + while (copied < length) { + size_t n = ZIP_MIN(length - copied, SIZE_MAX); + (void)memcpy_s(data + copied, n, _zip_buffer_get(buffer, n), n); + copied += n; + } - return length; + return copied; } @@ -147,8 +154,14 @@ _zip_buffer_new(zip_uint8_t *data, zip_uint64_t size) { bool free_data = (data == NULL); zip_buffer_t *buffer; +#if ZIP_UINT64_MAX > SIZE_MAX + if (size > SIZE_MAX) { + return NULL; + } +#endif + if (data == NULL) { - if ((data = (zip_uint8_t *)malloc(size)) == NULL) { + if ((data = (zip_uint8_t *)malloc((size_t)size)) == NULL) { return NULL; } } @@ -221,7 +234,7 @@ _zip_buffer_put(zip_buffer_t *buffer, const void *src, size_t length) { return -1; } - memcpy(dst, src, length); + (void)memcpy_s(dst, length, src, length); return 0; } diff --git a/core/deps/libzip/lib/zip_close.c b/core/deps/libzip/lib/zip_close.c index 5bd327b2e..ddc2c2456 100644 --- a/core/deps/libzip/lib/zip_close.c +++ b/core/deps/libzip/lib/zip_close.c @@ -1,9 +1,9 @@ /* zip_close.c -- close zip archive and update changes - Copyright (C) 1999-2020 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 + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -45,6 +45,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 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); @@ -61,12 +62,12 @@ zip_close(zip_t *za) { changed = _zip_changed(za, &survivors); - /* don't create zip files with no entries */ - if (survivors == 0) { + if (survivors == 0 && !(za->ch_flags & ZIP_AFL_CREATE_OR_KEEP_FILE_FOR_EMPTY_ARCHIVE)) { + /* don't create zip files with no entries */ if ((za->open_flags & ZIP_TRUNCATE) || changed) { if (zip_source_remove(za->src) < 0) { if (!((zip_error_code_zip(zip_source_error(za->src)) == ZIP_ER_REMOVE) && (zip_error_code_system(zip_source_error(za->src)) == ENOENT))) { - _zip_error_set_from_source(&za->error, za->src); + zip_error_set_from_source(&za->error, za->src); return -1; } } @@ -75,7 +76,8 @@ zip_close(zip_t *za) { return 0; } - if (!changed) { + /* Always write empty archive if we are told to keep it, otherwise it wouldn't be created if the file doesn't already exist. */ + if (!changed && survivors > 0) { zip_discard(za); return 0; } @@ -105,6 +107,7 @@ zip_close(zip_t *za) { } filelist[j].idx = i; + filelist[j].name = zip_get_name(za, i, 0); j++; } if (j < survivors) { @@ -113,7 +116,11 @@ zip_close(zip_t *za) { return -1; } - if ((zip_source_supports(za->src) & ZIP_SOURCE_MAKE_COMMAND_BITMASK(ZIP_SOURCE_BEGIN_WRITE_CLONING)) == 0) { + if (ZIP_WANT_TORRENTZIP(za)) { + qsort(filelist, (size_t)survivors, sizeof(filelist[0]), torrentzip_compare_names); + } + + if (ZIP_WANT_TORRENTZIP(za) || (zip_source_supports(za->src) & ZIP_SOURCE_MAKE_COMMAND_BITMASK(ZIP_SOURCE_BEGIN_WRITE_CLONING)) == 0) { unchanged_offset = 0; } else { @@ -146,7 +153,7 @@ zip_close(zip_t *za) { } if (unchanged_offset == 0) { if (zip_source_begin_write(za->src) < 0) { - _zip_error_set_from_source(&za->error, za->src); + zip_error_set_from_source(&za->error, za->src); free(filelist); return -1; } @@ -178,7 +185,7 @@ zip_close(zip_t *za) { continue; } - new_data = (ZIP_ENTRY_DATA_CHANGED(entry) || ZIP_ENTRY_CHANGED(entry, ZIP_DIRENT_COMP_METHOD) || ZIP_ENTRY_CHANGED(entry, ZIP_DIRENT_ENCRYPTION_METHOD)); + new_data = (ZIP_ENTRY_DATA_CHANGED(entry) || ZIP_ENTRY_CHANGED(entry, ZIP_DIRENT_COMP_METHOD) || ZIP_ENTRY_CHANGED(entry, ZIP_DIRENT_ENCRYPTION_METHOD)) || (ZIP_WANT_TORRENTZIP(za) && !ZIP_IS_TORRENTZIP(za)); /* create new local directory entry */ if (entry->changes == NULL) { @@ -195,8 +202,12 @@ zip_close(zip_t *za) { break; } + if (ZIP_WANT_TORRENTZIP(za)) { + zip_dirent_torrentzip_normalize(entry->changes); + } + if ((off = zip_source_tell_write(za->src)) < 0) { - _zip_error_set_from_source(&za->error, za->src); + zip_error_set_from_source(&za->error, za->src); error = 1; break; } @@ -207,7 +218,7 @@ zip_close(zip_t *za) { zs = NULL; if (!ZIP_ENTRY_DATA_CHANGED(entry)) { - if ((zs = _zip_source_zip_new(za, za, i, ZIP_FL_UNCHANGED, 0, 0, NULL)) == NULL) { + if ((zs = zip_source_zip_file_create(za, i, ZIP_FL_UNCHANGED, 0, -1, NULL, &za->error)) == NULL) { error = 1; break; } @@ -240,7 +251,7 @@ zip_close(zip_t *za) { break; } if (zip_source_seek(za->src, (zip_int64_t)offset, SEEK_SET) < 0) { - _zip_error_set_from_source(&za->error, za->src); + zip_error_set_from_source(&za->error, za->src); error = 1; break; } @@ -267,7 +278,7 @@ zip_close(zip_t *za) { if (!error) { if (zip_source_commit_write(za->src) != 0) { - _zip_error_set_from_source(&za->error, za->src); + zip_error_set_from_source(&za->error, za->src); error = 1; } _zip_progress_end(za->progress); @@ -296,7 +307,7 @@ add_data(zip_t *za, zip_source_t *src, zip_dirent_t *de, zip_uint32_t changed) { bool needs_recompress, needs_decompress, needs_crc, needs_compress, needs_reencrypt, needs_decrypt, needs_encrypt; if (zip_source_stat(src, &st) < 0) { - _zip_error_set_from_source(&za->error, src); + zip_error_set_from_source(&za->error, src); return -1; } @@ -324,6 +335,7 @@ add_data(zip_t *za, zip_source_t *src, zip_dirent_t *de, zip_uint32_t changed) { flags = ZIP_EF_LOCAL; if ((st.valid & ZIP_STAT_SIZE) == 0) { + /* TODO: not valid for torrentzip */ flags |= ZIP_FL_FORCE_ZIP64; data_length = -1; } @@ -350,6 +362,7 @@ add_data(zip_t *za, zip_source_t *src, zip_dirent_t *de, zip_uint32_t changed) { } if (max_compressed_size > 0xffffffffu) { + /* TODO: not valid for torrentzip */ flags |= ZIP_FL_FORCE_ZIP64; } } @@ -360,7 +373,7 @@ add_data(zip_t *za, zip_source_t *src, zip_dirent_t *de, zip_uint32_t changed) { } if ((offstart = zip_source_tell_write(za->src)) < 0) { - _zip_error_set_from_source(&za->error, za->src); + zip_error_set_from_source(&za->error, za->src); return -1; } @@ -370,7 +383,7 @@ add_data(zip_t *za, zip_source_t *src, zip_dirent_t *de, zip_uint32_t changed) { return -1; } - needs_recompress = st.comp_method != ZIP_CM_ACTUAL(de->comp_method); + needs_recompress = ZIP_WANT_TORRENTZIP(za) || st.comp_method != ZIP_CM_ACTUAL(de->comp_method); needs_decompress = needs_recompress && (st.comp_method != ZIP_CM_STORE); /* in these cases we can compute the CRC ourselves, so we do */ needs_crc = (st.comp_method == ZIP_CM_STORE) || needs_decompress; @@ -383,6 +396,11 @@ add_data(zip_t *za, zip_source_t *src, zip_dirent_t *de, zip_uint32_t changed) { src_final = src; zip_source_keep(src_final); + if (!needs_decrypt && st.encryption_method == ZIP_EM_TRAD_PKWARE && (de->changed & ZIP_DIRENT_LAST_MOD)) { + /* PKWare encryption uses the last modification time for password verification, therefore we can't change it without re-encrypting. Ignoring the requested modification time change seems more sensible than failing to close the archive. */ + de->changed &= ~ZIP_DIRENT_LAST_MOD; + } + if (needs_decrypt) { zip_encryption_implementation impl; @@ -397,7 +415,6 @@ add_data(zip_t *za, zip_source_t *src, zip_dirent_t *de, zip_uint32_t changed) { return -1; } - zip_source_free(src_final); src_final = src_tmp; } @@ -407,17 +424,15 @@ add_data(zip_t *za, zip_source_t *src, zip_dirent_t *de, zip_uint32_t changed) { return -1; } - zip_source_free(src_final); src_final = src_tmp; } if (needs_crc) { - if ((src_tmp = zip_source_crc(za, src_final, 0)) == NULL) { + if ((src_tmp = zip_source_crc_create(src_final, 0, &za->error)) == NULL) { zip_source_free(src_final); return -1; } - zip_source_free(src_final); src_final = src_tmp; } @@ -427,7 +442,6 @@ add_data(zip_t *za, zip_source_t *src, zip_dirent_t *de, zip_uint32_t changed) { return -1; } - zip_source_free(src_final); src_final = src_tmp; } @@ -448,34 +462,48 @@ add_data(zip_t *za, zip_source_t *src, zip_dirent_t *de, zip_uint32_t changed) { zip_source_free(src_final); return -1; } + + if (de->encryption_method == ZIP_EM_TRAD_PKWARE) { + de->bitflags |= ZIP_GPBF_DATA_DESCRIPTOR; + + /* 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) { + zip_source_free(src_final); + return -1; + } + src_final = src_tmp; + } + } + if ((src_tmp = impl(za, src_final, de->encryption_method, ZIP_CODEC_ENCODE, password)) == NULL) { /* error set by impl */ zip_source_free(src_final); return -1; } - if (de->encryption_method == ZIP_EM_TRAD_PKWARE) { - de->bitflags |= ZIP_GPBF_DATA_DESCRIPTOR; - } - zip_source_free(src_final); src_final = src_tmp; } if ((offdata = zip_source_tell_write(za->src)) < 0) { - _zip_error_set_from_source(&za->error, za->src); + zip_error_set_from_source(&za->error, za->src); return -1; } ret = copy_source(za, src_final, data_length); if (zip_source_stat(src_final, &st) < 0) { - _zip_error_set_from_source(&za->error, src_final); + zip_error_set_from_source(&za->error, src_final); ret = -1; } if (zip_source_get_file_attributes(src_final, &attributes) != 0) { - _zip_error_set_from_source(&za->error, src_final); + zip_error_set_from_source(&za->error, src_final); ret = -1; } @@ -486,12 +514,12 @@ add_data(zip_t *za, zip_source_t *src, zip_dirent_t *de, zip_uint32_t changed) { } if ((offend = zip_source_tell_write(za->src)) < 0) { - _zip_error_set_from_source(&za->error, za->src); + zip_error_set_from_source(&za->error, za->src); return -1; } if (zip_source_seek_write(za->src, offstart, SEEK_SET) < 0) { - _zip_error_set_from_source(&za->error, za->src); + zip_error_set_from_source(&za->error, za->src); return -1; } @@ -512,6 +540,10 @@ add_data(zip_t *za, zip_source_t *src, zip_dirent_t *de, zip_uint32_t changed) { de->comp_size = (zip_uint64_t)(offend - offdata); _zip_dirent_apply_attributes(de, &attributes, (flags & ZIP_FL_FORCE_ZIP64) != 0, changed); + if (ZIP_WANT_TORRENTZIP(za)) { + zip_dirent_torrentzip_normalize(de); + } + if ((ret = _zip_dirent_write(za, de, flags)) < 0) return -1; @@ -522,7 +554,7 @@ add_data(zip_t *za, zip_source_t *src, zip_dirent_t *de, zip_uint32_t changed) { } if (zip_source_seek_write(za->src, offend, SEEK_SET) < 0) { - _zip_error_set_from_source(&za->error, za->src); + zip_error_set_from_source(&za->error, za->src); return -1; } @@ -539,7 +571,6 @@ add_data(zip_t *za, zip_source_t *src, zip_dirent_t *de, zip_uint32_t changed) { static int copy_data(zip_t *za, zip_uint64_t len) { DEFINE_BYTE_ARRAY(buf, BUFSIZE); - size_t n; double total = (double)len; if (!byte_array_init(buf, BUFSIZE)) { @@ -548,7 +579,8 @@ copy_data(zip_t *za, zip_uint64_t len) { } while (len > 0) { - n = len > BUFSIZE ? BUFSIZE : len; + zip_uint64_t n = ZIP_MIN(len, BUFSIZE); + if (_zip_read(za->src, buf, n, &za->error) < 0) { byte_array_fini(buf); return -1; @@ -579,7 +611,7 @@ copy_source(zip_t *za, zip_source_t *src, zip_int64_t data_length) { int ret; if (zip_source_open(src) < 0) { - _zip_error_set_from_source(&za->error, src); + zip_error_set_from_source(&za->error, src); return -1; } @@ -606,7 +638,7 @@ copy_source(zip_t *za, zip_source_t *src, zip_int64_t data_length) { } if (n < 0) { - _zip_error_set_from_source(&za->error, src); + zip_error_set_from_source(&za->error, src); ret = -1; } @@ -619,17 +651,15 @@ copy_source(zip_t *za, zip_source_t *src, zip_int64_t data_length) { static int write_cdir(zip_t *za, const zip_filelist_t *filelist, zip_uint64_t survivors) { - zip_int64_t cd_start, end, size; - - if ((cd_start = zip_source_tell_write(za->src)) < 0) { + if (zip_source_tell_write(za->src) < 0) { return -1; } - if ((size = _zip_cdir_write(za, filelist, survivors)) < 0) { + if (_zip_cdir_write(za, filelist, survivors) < 0) { return -1; } - if ((end = zip_source_tell_write(za->src)) < 0) { + if (zip_source_tell_write(za->src) < 0) { return -1; } @@ -645,7 +675,7 @@ _zip_changed(const zip_t *za, zip_uint64_t *survivorsp) { changed = 0; survivors = 0; - if (za->comment_changed || za->ch_flags != za->flags) { + if (za->comment_changed || (ZIP_WANT_TORRENTZIP(za) && !ZIP_IS_TORRENTZIP(za))) { changed = 1; } @@ -698,3 +728,18 @@ write_data_descriptor(zip_t *za, const zip_dirent_t *de, int is_zip64) { return ret; } + + +static int torrentzip_compare_names(const void *a, const void *b) { + const char *aname = ((const zip_filelist_t *)a)->name; + const char *bname = ((const zip_filelist_t *)b)->name; + + if (aname == NULL) { + return (bname != NULL) * -1; + } + else if (bname == NULL) { + return 1; + } + + return strcasecmp(aname, bname); +} \ No newline at end of file diff --git a/core/deps/libzip/lib/zip_crypto.h b/core/deps/libzip/lib/zip_crypto.h index c42bc7b04..0d74d1a41 100644 --- a/core/deps/libzip/lib/zip_crypto.h +++ b/core/deps/libzip/lib/zip_crypto.h @@ -1,9 +1,9 @@ /* zip_crypto.h -- crypto definitions - Copyright (C) 2017-2020 Dieter Baron and Thomas Klausner + Copyright (C) 2017-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/core/deps/libzip/lib/zip_crypto_commoncrypto.c b/core/deps/libzip/lib/zip_crypto_commoncrypto.c index f4c37d96b..b198be563 100644 --- a/core/deps/libzip/lib/zip_crypto_commoncrypto.c +++ b/core/deps/libzip/lib/zip_crypto_commoncrypto.c @@ -1,9 +1,9 @@ /* zip_crypto_commoncrypto.c -- CommonCrypto wrapper. - Copyright (C) 2018-2020 Dieter Baron and Thomas Klausner + Copyright (C) 2018-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/core/deps/libzip/lib/zip_crypto_commoncrypto.h b/core/deps/libzip/lib/zip_crypto_commoncrypto.h index 1eae1b707..01828cc64 100644 --- a/core/deps/libzip/lib/zip_crypto_commoncrypto.h +++ b/core/deps/libzip/lib/zip_crypto_commoncrypto.h @@ -3,7 +3,7 @@ Copyright (C) 2018 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/core/deps/libzip/lib/zip_crypto_gnutls.c b/core/deps/libzip/lib/zip_crypto_gnutls.c index a74bde8f6..1a25aa120 100644 --- a/core/deps/libzip/lib/zip_crypto_gnutls.c +++ b/core/deps/libzip/lib/zip_crypto_gnutls.c @@ -1,9 +1,9 @@ /* zip_crypto_gnutls.c -- GnuTLS wrapper. - Copyright (C) 2018-2020 Dieter Baron and Thomas Klausner + Copyright (C) 2018-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -98,15 +98,14 @@ _zip_crypto_aes_free(_zip_crypto_aes_t *aes) { _zip_crypto_hmac_t * _zip_crypto_hmac_new(const zip_uint8_t *secret, zip_uint64_t secret_length, zip_error_t *error) { _zip_crypto_hmac_t *hmac; - int ret; if ((hmac = (_zip_crypto_hmac_t *)malloc(sizeof(*hmac))) == NULL) { zip_error_set(error, ZIP_ER_MEMORY, 0); return NULL; } - if ((ret = gnutls_hmac_init(hmac, GNUTLS_MAC_SHA1, secret, secret_length)) < 0) { - /* TODO: set error */ + if (gnutls_hmac_init(hmac, GNUTLS_MAC_SHA1, secret, secret_length) < 0) { + zip_error_set(error, ZIP_ER_INTERNAL, 0); free(hmac); return NULL; } diff --git a/core/deps/libzip/lib/zip_crypto_gnutls.h b/core/deps/libzip/lib/zip_crypto_gnutls.h index 65cf62ecc..dc8b97a4d 100644 --- a/core/deps/libzip/lib/zip_crypto_gnutls.h +++ b/core/deps/libzip/lib/zip_crypto_gnutls.h @@ -1,9 +1,9 @@ /* zip_crypto_gnutls.h -- definitions for GnuTLS wrapper. - Copyright (C) 2018-2020 Dieter Baron and Thomas Klausner + Copyright (C) 2018-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/core/deps/libzip/lib/zip_crypto_mbedtls.c b/core/deps/libzip/lib/zip_crypto_mbedtls.c index 6aeb020c0..84544a821 100644 --- a/core/deps/libzip/lib/zip_crypto_mbedtls.c +++ b/core/deps/libzip/lib/zip_crypto_mbedtls.c @@ -1,9 +1,9 @@ /* zip_crypto_mbedtls.c -- mbed TLS wrapper - Copyright (C) 2018-2020 Dieter Baron and Thomas Klausner + Copyright (C) 2018-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -117,6 +117,8 @@ _zip_crypto_pbkdf2(const zip_uint8_t *key, zip_uint64_t key_length, const zip_ui mbedtls_md_context_t sha1_ctx; bool ok = true; +#if MBEDTLS_VERSION_NUMBER < 0x03030000 + mbedtls_md_init(&sha1_ctx); if (mbedtls_md_setup(&sha1_ctx, mbedtls_md_info_from_type(MBEDTLS_MD_SHA1), 1) != 0) { @@ -128,6 +130,13 @@ _zip_crypto_pbkdf2(const zip_uint8_t *key, zip_uint64_t key_length, const zip_ui } mbedtls_md_free(&sha1_ctx); + +#else + + ok = mbedtls_pkcs5_pbkdf2_hmac_ext(MBEDTLS_MD_SHA1, (const unsigned char *)key, (size_t)key_length, (const unsigned char *)salt, (size_t)salt_length, (unsigned int)iterations, (uint32_t)output_length, (unsigned char *)output) == 0; + +#endif // !defined(MBEDTLS_DEPRECATED_REMOVED) || MBEDTLS_VERSION_NUMBER < 0x03030000 + return ok; } diff --git a/core/deps/libzip/lib/zip_crypto_mbedtls.h b/core/deps/libzip/lib/zip_crypto_mbedtls.h index 0b06e99da..1151fff75 100644 --- a/core/deps/libzip/lib/zip_crypto_mbedtls.h +++ b/core/deps/libzip/lib/zip_crypto_mbedtls.h @@ -1,9 +1,9 @@ /* zip_crypto_mbedtls.h -- definitions for mbedtls wrapper - Copyright (C) 2018-2020 Dieter Baron and Thomas Klausner + Copyright (C) 2018-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/core/deps/libzip/lib/zip_crypto_openssl.c b/core/deps/libzip/lib/zip_crypto_openssl.c index 5cbc5ce2c..7f1da10ed 100644 --- a/core/deps/libzip/lib/zip_crypto_openssl.c +++ b/core/deps/libzip/lib/zip_crypto_openssl.c @@ -3,7 +3,7 @@ Copyright (C) 2018-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -40,21 +40,70 @@ #include #include -#if OPENSSL_VERSION_NUMBER < 0x1010000fL || (defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x02070000fL) -#define USE_OPENSSL_1_0_API +#ifdef USE_OPENSSL_3_API +static _zip_crypto_hmac_t* hmac_new() { + _zip_crypto_hmac_t *hmac = (_zip_crypto_hmac_t*)malloc(sizeof(*hmac)); + if (hmac != NULL) { + hmac->mac = NULL; + hmac->ctx = NULL; + } + return hmac; +} +static void hmac_free(_zip_crypto_hmac_t* hmac) { + if (hmac != NULL) { + if (hmac->ctx != NULL) { + EVP_MAC_CTX_free(hmac->ctx); + } + if (hmac->mac != NULL) { + EVP_MAC_free(hmac->mac); + } + free(hmac); + } +} #endif - _zip_crypto_aes_t * _zip_crypto_aes_new(const zip_uint8_t *key, zip_uint16_t key_size, zip_error_t *error) { _zip_crypto_aes_t *aes; + const EVP_CIPHER* cipher_type; + + switch (key_size) { + case 128: + cipher_type = EVP_aes_128_ecb(); + break; + case 192: + cipher_type = EVP_aes_192_ecb(); + break; + case 256: + cipher_type = EVP_aes_256_ecb(); + break; + default: + zip_error_set(error, ZIP_ER_INTERNAL, 0); + return NULL; + } +#ifdef USE_OPENSSL_1_0_API if ((aes = (_zip_crypto_aes_t *)malloc(sizeof(*aes))) == NULL) { zip_error_set(error, ZIP_ER_MEMORY, 0); return NULL; } + memset(aes, 0, sizeof(*aes)); +#else + if ((aes = EVP_CIPHER_CTX_new()) == NULL) { + zip_error_set(error, ZIP_ER_MEMORY, 0); + return NULL; + } +#endif - AES_set_encrypt_key(key, key_size, aes); + if (EVP_EncryptInit_ex(aes, cipher_type, NULL, key, NULL) != 1) { +#ifdef USE_OPENSSL_1_0_API + free(aes); +#else + EVP_CIPHER_CTX_free(aes); +#endif + zip_error_set(error, ZIP_ER_INTERNAL, 0); + return NULL; + } return aes; } @@ -65,8 +114,23 @@ _zip_crypto_aes_free(_zip_crypto_aes_t *aes) { return; } +#ifdef USE_OPENSSL_1_0_API + EVP_CIPHER_CTX_cleanup(aes); _zip_crypto_clear(aes, sizeof(*aes)); free(aes); +#else + EVP_CIPHER_CTX_free(aes); +#endif +} + + +bool +_zip_crypto_aes_encrypt_block(_zip_crypto_aes_t *aes, const zip_uint8_t *in, zip_uint8_t *out) { + int len; + if (EVP_EncryptUpdate(aes, out, &len, in, ZIP_CRYPTO_AES_BLOCK_LENGTH) != 1) { + return false; + } + return true; } @@ -79,13 +143,34 @@ _zip_crypto_hmac_new(const zip_uint8_t *secret, zip_uint64_t secret_length, zip_ return NULL; } +#ifdef USE_OPENSSL_3_API + if ((hmac = hmac_new()) == NULL + || (hmac->mac = EVP_MAC_fetch(NULL, "HMAC", "provider=default")) == NULL + || (hmac->ctx = EVP_MAC_CTX_new(hmac->mac)) == NULL) { + hmac_free(hmac); + zip_error_set(error, ZIP_ER_MEMORY, 0); + return NULL; + } + + { + OSSL_PARAM params[2]; + params[0] = OSSL_PARAM_construct_utf8_string("digest", "SHA1", 0); + params[1] = OSSL_PARAM_construct_end(); + + if (!EVP_MAC_init(hmac->ctx, (const unsigned char *)secret, secret_length, params)) { + zip_error_set(error, ZIP_ER_INTERNAL, 0); + hmac_free(hmac); + return NULL; + } + } +#else #ifdef USE_OPENSSL_1_0_API if ((hmac = (_zip_crypto_hmac_t *)malloc(sizeof(*hmac))) == NULL) { zip_error_set(error, ZIP_ER_MEMORY, 0); return NULL; } - HMAC_CTX_init(hmac); + HMAC_CTX_init(hmac); #else if ((hmac = HMAC_CTX_new()) == NULL) { zip_error_set(error, ZIP_ER_MEMORY, 0); @@ -102,6 +187,7 @@ _zip_crypto_hmac_new(const zip_uint8_t *secret, zip_uint64_t secret_length, zip_ #endif return NULL; } +#endif return hmac; } @@ -113,7 +199,9 @@ _zip_crypto_hmac_free(_zip_crypto_hmac_t *hmac) { return; } -#ifdef USE_OPENSSL_1_0_API +#if defined(USE_OPENSSL_3_API) + hmac_free(hmac); +#elif defined(USE_OPENSSL_1_0_API) HMAC_CTX_cleanup(hmac); _zip_crypto_clear(hmac, sizeof(*hmac)); free(hmac); @@ -125,9 +213,13 @@ _zip_crypto_hmac_free(_zip_crypto_hmac_t *hmac) { bool _zip_crypto_hmac_output(_zip_crypto_hmac_t *hmac, zip_uint8_t *data) { +#ifdef USE_OPENSSL_3_API + size_t length; + return EVP_MAC_final(hmac->ctx, data, &length, ZIP_CRYPTO_SHA1_LENGTH) == 1 && length == ZIP_CRYPTO_SHA1_LENGTH; +#else unsigned int length; - return HMAC_Final(hmac, data, &length) == 1; +#endif } diff --git a/core/deps/libzip/lib/zip_crypto_openssl.h b/core/deps/libzip/lib/zip_crypto_openssl.h index be0a8ca9f..198a90714 100644 --- a/core/deps/libzip/lib/zip_crypto_openssl.h +++ b/core/deps/libzip/lib/zip_crypto_openssl.h @@ -1,9 +1,9 @@ /* zip_crypto_openssl.h -- definitions for OpenSSL wrapper. - Copyright (C) 2018-2020 Dieter Baron and Thomas Klausner + Copyright (C) 2018-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -36,17 +36,34 @@ #define HAVE_SECURE_RANDOM -#include +#include #include -#define _zip_crypto_aes_t AES_KEY +#if OPENSSL_VERSION_NUMBER < 0x1010000fL || (defined(LIBRESSL_VERSION_NUMBER) && LIBRESSL_VERSION_NUMBER < 0x02070000fL) +#define USE_OPENSSL_1_0_API +#elif OPENSSL_VERSION_NUMBER < 0x3000000fL +#define USE_OPENSSL_1_1_API +#else +#define USE_OPENSSL_3_API +#endif + +#define _zip_crypto_aes_t EVP_CIPHER_CTX +#ifdef USE_OPENSSL_3_API +struct _zip_crypto_hmac_t { + EVP_MAC *mac; + EVP_MAC_CTX *ctx; +}; +typedef struct _zip_crypto_hmac_t _zip_crypto_hmac_t; +#define _zip_crypto_hmac(hmac, data, length) (EVP_MAC_update((hmac->ctx), (data), (length)) == 1) +#else #define _zip_crypto_hmac_t HMAC_CTX +#define _zip_crypto_hmac(hmac, data, length) (HMAC_Update((hmac), (data), (length)) == 1) +#endif void _zip_crypto_aes_free(_zip_crypto_aes_t *aes); -#define _zip_crypto_aes_encrypt_block(aes, in, out) (AES_encrypt((in), (out), (aes)), true) +bool _zip_crypto_aes_encrypt_block(_zip_crypto_aes_t *aes, const zip_uint8_t *in, zip_uint8_t *out); _zip_crypto_aes_t *_zip_crypto_aes_new(const zip_uint8_t *key, zip_uint16_t key_size, zip_error_t *error); -#define _zip_crypto_hmac(hmac, data, length) (HMAC_Update((hmac), (data), (length)) == 1) void _zip_crypto_hmac_free(_zip_crypto_hmac_t *hmac); _zip_crypto_hmac_t *_zip_crypto_hmac_new(const zip_uint8_t *secret, zip_uint64_t secret_length, zip_error_t *error); bool _zip_crypto_hmac_output(_zip_crypto_hmac_t *hmac, zip_uint8_t *data); diff --git a/core/deps/libzip/lib/zip_crypto_win.c b/core/deps/libzip/lib/zip_crypto_win.c index 6f9a59630..ee3ccc30a 100644 --- a/core/deps/libzip/lib/zip_crypto_win.c +++ b/core/deps/libzip/lib/zip_crypto_win.c @@ -1,9 +1,9 @@ /* zip_crypto_win.c -- Windows Crypto API wrapper. - Copyright (C) 2018-2020 Dieter Baron and Thomas Klausner + Copyright (C) 2018-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -254,7 +254,7 @@ pbkdf2(PUCHAR pbPassword, ULONG cbPassword, PUCHAR pbSalt, ULONG cbSalt, DWORD c for (j = 0; j < cIterations; j++) { if (j == 0) { /* construct first input for PRF */ - memcpy(U, pbSalt, cbSalt); + (void)memcpy_s(U, cbSalt, pbSalt, cbSalt); U[cbSalt] = (BYTE)((i & 0xFF000000) >> 24); U[cbSalt + 1] = (BYTE)((i & 0x00FF0000) >> 16); U[cbSalt + 2] = (BYTE)((i & 0x0000FF00) >> 8); @@ -262,7 +262,7 @@ pbkdf2(PUCHAR pbPassword, ULONG cbPassword, PUCHAR pbSalt, ULONG cbSalt, DWORD c dwULen = cbSalt + 4; } else { - memcpy(U, V, DIGEST_SIZE); + (void)memcpy_s(U, DIGEST_SIZE, V, DIGEST_SIZE); dwULen = DIGEST_SIZE; } @@ -274,11 +274,11 @@ pbkdf2(PUCHAR pbPassword, ULONG cbPassword, PUCHAR pbSalt, ULONG cbSalt, DWORD c } if (i != l) { - memcpy(&pbDerivedKey[(i - 1) * DIGEST_SIZE], Ti, DIGEST_SIZE); + (void)memcpy_s(&pbDerivedKey[(i - 1) * DIGEST_SIZE], cbDerivedKey - (i - 1) * DIGEST_SIZE, Ti, DIGEST_SIZE); } else { /* Take only the first r bytes */ - memcpy(&pbDerivedKey[(i - 1) * DIGEST_SIZE], Ti, r); + (void)memcpy_s(&pbDerivedKey[(i - 1) * DIGEST_SIZE], cbDerivedKey - (i - 1) * DIGEST_SIZE, Ti, r); } } diff --git a/core/deps/libzip/lib/zip_crypto_win.h b/core/deps/libzip/lib/zip_crypto_win.h index 9d3689152..a533fe2df 100644 --- a/core/deps/libzip/lib/zip_crypto_win.h +++ b/core/deps/libzip/lib/zip_crypto_win.h @@ -1,9 +1,9 @@ /* zip_crypto_win.h -- Windows Crypto API wrapper. - Copyright (C) 2018-2020 Dieter Baron and Thomas Klausner + Copyright (C) 2018-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/core/deps/libzip/lib/zip_delete.c b/core/deps/libzip/lib/zip_delete.c index 4ff4c1abe..676c16bf2 100644 --- a/core/deps/libzip/lib/zip_delete.c +++ b/core/deps/libzip/lib/zip_delete.c @@ -1,9 +1,9 @@ /* zip_delete.c -- delete file from zip archive - Copyright (C) 1999-2020 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/core/deps/libzip/lib/zip_dir_add.c b/core/deps/libzip/lib/zip_dir_add.c index da1e4a422..c01081916 100644 --- a/core/deps/libzip/lib/zip_dir_add.c +++ b/core/deps/libzip/lib/zip_dir_add.c @@ -1,9 +1,9 @@ /* zip_dir_add.c -- add directory - Copyright (C) 1999-2020 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -61,11 +61,11 @@ zip_dir_add(zip_t *za, const char *name, zip_flags_t flags) { len = strlen(name); if (name[len - 1] != '/') { - if ((s = (char *)malloc(len + 2)) == NULL) { + if (len > SIZE_MAX - 2 || (s = (char *)malloc(len + 2)) == NULL) { zip_error_set(&za->error, ZIP_ER_MEMORY, 0); return -1; } - strcpy(s, name); + (void)strncpy_s(s, len + 2, name, len); s[len] = '/'; s[len + 1] = '\0'; } diff --git a/core/deps/libzip/lib/zip_dirent.c b/core/deps/libzip/lib/zip_dirent.c index 5226a6e1f..45a2a6a29 100644 --- a/core/deps/libzip/lib/zip_dirent.c +++ b/core/deps/libzip/lib/zip_dirent.c @@ -1,9 +1,9 @@ /* zip_dirent.c -- read directory entry (local or central), clean dirent - Copyright (C) 1999-2020 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -37,6 +37,7 @@ #include #include #include +#include #include "zipint.h" @@ -127,15 +128,21 @@ _zip_cdir_write(zip_t *za, const zip_filelist_t *filelist, zip_uint64_t survivor zip_uint64_t i; bool is_zip64; int ret; + zip_uint32_t cdir_crc; if ((off = zip_source_tell_write(za->src)) < 0) { - _zip_error_set_from_source(&za->error, za->src); + zip_error_set_from_source(&za->error, za->src); return -1; } offset = (zip_uint64_t)off; is_zip64 = false; + if (ZIP_WANT_TORRENTZIP(za)) { + cdir_crc = (zip_uint32_t)crc32(0, NULL, 0); + za->write_crc = &cdir_crc; + } + for (i = 0; i < survivors; i++) { zip_entry_t *entry = za->entry + filelist[i].idx; @@ -145,15 +152,17 @@ _zip_cdir_write(zip_t *za, const zip_filelist_t *filelist, zip_uint64_t survivor is_zip64 = true; } + za->write_crc = NULL; + if ((off = zip_source_tell_write(za->src)) < 0) { - _zip_error_set_from_source(&za->error, za->src); + zip_error_set_from_source(&za->error, za->src); return -1; } size = (zip_uint64_t)off - offset; - if (offset > ZIP_UINT32_MAX || survivors > ZIP_UINT16_MAX) + if (offset > ZIP_UINT32_MAX || survivors > ZIP_UINT16_MAX) { is_zip64 = true; - + } if ((buffer = _zip_buffer_new(buf, sizeof(buf))) == NULL) { zip_error_set(&za->error, ZIP_ER_MEMORY, 0); @@ -186,7 +195,13 @@ _zip_cdir_write(zip_t *za, const zip_filelist_t *filelist, zip_uint64_t survivor comment = za->comment_changed ? za->comment_changes : za->comment_orig; - _zip_buffer_put_16(buffer, (zip_uint16_t)(comment ? comment->length : 0)); + if (ZIP_WANT_TORRENTZIP(za)) { + _zip_buffer_put_16(buffer, TORRENTZIP_SIGNATURE_LENGTH + TORRENTZIP_CRC_LENGTH); + } + else { + _zip_buffer_put_16(buffer, (zip_uint16_t)(comment ? comment->length : 0)); + } + if (!_zip_buffer_ok(buffer)) { zip_error_set(&za->error, ZIP_ER_INTERNAL, 0); @@ -201,7 +216,15 @@ _zip_cdir_write(zip_t *za, const zip_filelist_t *filelist, zip_uint64_t survivor _zip_buffer_free(buffer); - if (comment) { + if (ZIP_WANT_TORRENTZIP(za)) { + char torrentzip_comment[TORRENTZIP_SIGNATURE_LENGTH + TORRENTZIP_CRC_LENGTH + 1]; + snprintf(torrentzip_comment, sizeof(torrentzip_comment), TORRENTZIP_SIGNATURE "%08X", cdir_crc); + + if (_zip_write(za, torrentzip_comment, strlen(torrentzip_comment)) < 0) { + return -1; + } + } + else if (comment != NULL) { if (_zip_write(za, comment->raw, comment->length) < 0) { return -1; } @@ -219,7 +242,7 @@ _zip_dirent_clone(const zip_dirent_t *sde) { return NULL; if (sde) - memcpy(tde, sde, sizeof(*sde)); + (void)memcpy_s(tde, sizeof(*tde), sde, sizeof(*sde)); else _zip_dirent_init(tde); @@ -421,7 +444,7 @@ _zip_dirent_read(zip_dirent_t *zde, zip_source_t *src, zip_buffer_t *buffer, boo if (from_buffer) { if (_zip_buffer_left(buffer) < variable_size) { - zip_error_set(error, ZIP_ER_INCONS, 0); + zip_error_set(error, ZIP_ER_INCONS, ZIP_ER_DETAIL_VARIABLE_SIZE_OVERFLOW); return -1; } } @@ -437,7 +460,7 @@ _zip_dirent_read(zip_dirent_t *zde, zip_source_t *src, zip_buffer_t *buffer, boo zde->filename = _zip_read_string(buffer, src, filename_len, 1, error); if (!zde->filename) { if (zip_error_code_zip(error) == ZIP_ER_EOF) { - zip_error_set(error, ZIP_ER_INCONS, 0); + zip_error_set(error, ZIP_ER_INCONS, ZIP_ER_DETAIL_VARIABLE_SIZE_OVERFLOW); } if (!from_buffer) { _zip_buffer_free(buffer); @@ -447,7 +470,7 @@ _zip_dirent_read(zip_dirent_t *zde, zip_source_t *src, zip_buffer_t *buffer, boo if (zde->bitflags & ZIP_GPBF_ENCODING_UTF_8) { if (_zip_guess_encoding(zde->filename, ZIP_ENCODING_UTF8_KNOWN) == ZIP_ENCODING_ERROR) { - zip_error_set(error, ZIP_ER_INCONS, 0); + zip_error_set(error, ZIP_ER_INCONS, ZIP_ER_DETAIL_INVALID_UTF8_IN_FILENAME); if (!from_buffer) { _zip_buffer_free(buffer); } @@ -487,7 +510,7 @@ _zip_dirent_read(zip_dirent_t *zde, zip_source_t *src, zip_buffer_t *buffer, boo } if (zde->bitflags & ZIP_GPBF_ENCODING_UTF_8) { if (_zip_guess_encoding(zde->comment, ZIP_ENCODING_UTF8_KNOWN) == ZIP_ENCODING_ERROR) { - zip_error_set(error, ZIP_ER_INCONS, 0); + zip_error_set(error, ZIP_ER_INCONS, ZIP_ER_DETAIL_INVALID_UTF8_IN_COMMENT); if (!from_buffer) { _zip_buffer_free(buffer); } @@ -503,76 +526,18 @@ _zip_dirent_read(zip_dirent_t *zde, zip_source_t *src, zip_buffer_t *buffer, boo if (zde->uncomp_size == ZIP_UINT32_MAX || zde->comp_size == ZIP_UINT32_MAX || zde->offset == ZIP_UINT32_MAX) { zip_uint16_t got_len; - zip_buffer_t *ef_buffer; const zip_uint8_t *ef = _zip_ef_get_by_id(zde->extra_fields, &got_len, ZIP_EF_ZIP64, 0, local ? ZIP_EF_LOCAL : ZIP_EF_CENTRAL, error); - /* TODO: if got_len == 0 && !ZIP64_EOCD: no error, 0xffffffff is valid value */ - if (ef == NULL) { - if (!from_buffer) { - _zip_buffer_free(buffer); - } - return -1; - } - - if ((ef_buffer = _zip_buffer_new((zip_uint8_t *)ef, got_len)) == NULL) { - zip_error_set(error, ZIP_ER_MEMORY, 0); - if (!from_buffer) { - _zip_buffer_free(buffer); - } - return -1; - } - - if (zde->uncomp_size == ZIP_UINT32_MAX) { - zde->uncomp_size = _zip_buffer_get_64(ef_buffer); - } - else if (local) { - /* From appnote.txt: This entry in the Local header MUST - include BOTH original and compressed file size fields. */ - (void)_zip_buffer_skip(ef_buffer, 8); /* error is caught by _zip_buffer_eof() call */ - } - if (zde->comp_size == ZIP_UINT32_MAX) { - zde->comp_size = _zip_buffer_get_64(ef_buffer); - } - if (!local) { - if (zde->offset == ZIP_UINT32_MAX) { - zde->offset = _zip_buffer_get_64(ef_buffer); - } - if (zde->disk_number == ZIP_UINT16_MAX) { - zde->disk_number = _zip_buffer_get_32(ef_buffer); - } - } - - if (!_zip_buffer_eof(ef_buffer)) { - /* accept additional fields if values match */ - bool ok = true; - switch (got_len) { - case 28: - _zip_buffer_set_offset(ef_buffer, 24); - if (zde->disk_number != _zip_buffer_get_32(ef_buffer)) { - ok = false; - } - /* fallthrough */ - case 24: - _zip_buffer_set_offset(ef_buffer, 0); - if ((zde->uncomp_size != _zip_buffer_get_64(ef_buffer)) || (zde->comp_size != _zip_buffer_get_64(ef_buffer)) || (zde->offset != _zip_buffer_get_64(ef_buffer))) { - ok = false; - } - break; - - default: - ok = false; - } - if (!ok) { - zip_error_set(error, ZIP_ER_INCONS, 0); - _zip_buffer_free(ef_buffer); + if (ef != NULL) { + if (!zip_dirent_process_ef_zip64(zde, ef, got_len, local, error)) { if (!from_buffer) { _zip_buffer_free(buffer); } return -1; } } - _zip_buffer_free(ef_buffer); } + if (!_zip_buffer_ok(buffer)) { zip_error_set(error, ZIP_ER_INTERNAL, 0); if (!from_buffer) { @@ -599,6 +564,65 @@ _zip_dirent_read(zip_dirent_t *zde, zip_source_t *src, zip_buffer_t *buffer, boo return (zip_int64_t)size + (zip_int64_t)variable_size; } +bool zip_dirent_process_ef_zip64(zip_dirent_t* zde, const zip_uint8_t* ef, zip_uint64_t got_len, bool local, zip_error_t* error) { + zip_buffer_t *ef_buffer; + + if ((ef_buffer = _zip_buffer_new((zip_uint8_t *)ef, got_len)) == NULL) { + zip_error_set(error, ZIP_ER_MEMORY, 0); + return false; + } + + if (zde->uncomp_size == ZIP_UINT32_MAX) { + zde->uncomp_size = _zip_buffer_get_64(ef_buffer); + } + else if (local) { + /* From appnote.txt: This entry in the Local header MUST + include BOTH original and compressed file size fields. */ + (void)_zip_buffer_skip(ef_buffer, 8); /* error is caught by _zip_buffer_eof() call */ + } + if (zde->comp_size == ZIP_UINT32_MAX) { + zde->comp_size = _zip_buffer_get_64(ef_buffer); + } + if (!local) { + if (zde->offset == ZIP_UINT32_MAX) { + zde->offset = _zip_buffer_get_64(ef_buffer); + } + if (zde->disk_number == ZIP_UINT16_MAX) { + zde->disk_number = _zip_buffer_get_32(ef_buffer); + } + } + + if (!_zip_buffer_eof(ef_buffer)) { + /* accept additional fields if values match */ + bool ok = true; + switch (got_len) { + case 28: + _zip_buffer_set_offset(ef_buffer, 24); + if (zde->disk_number != _zip_buffer_get_32(ef_buffer)) { + ok = false; + } + /* fallthrough */ + case 24: + _zip_buffer_set_offset(ef_buffer, 0); + if ((zde->uncomp_size != _zip_buffer_get_64(ef_buffer)) || (zde->comp_size != _zip_buffer_get_64(ef_buffer)) || (zde->offset != _zip_buffer_get_64(ef_buffer))) { + ok = false; + } + break; + + default: + ok = false; + } + if (!ok) { + zip_error_set(error, ZIP_ER_INCONS, ZIP_ER_DETAIL_INVALID_ZIP64_EF); + _zip_buffer_free(ef_buffer); + return false; + } + } + _zip_buffer_free(ef_buffer); + + return true; +} + static zip_string_t * _zip_dirent_process_ef_utf_8(const zip_dirent_t *de, zip_uint16_t id, zip_string_t *str) { @@ -651,7 +675,7 @@ _zip_dirent_process_winzip_aes(zip_dirent_t *de, zip_error_t *error) { ef = _zip_ef_get_by_id(de->extra_fields, &ef_len, ZIP_EF_WINZIP_AES, 0, ZIP_EF_BOTH, NULL); if (ef == NULL || ef_len < 7) { - zip_error_set(error, ZIP_ER_INCONS, 0); + zip_error_set(error, ZIP_ER_INCONS, ZIP_ER_DETAIL_INVALID_WINZIPAES_EF); return false; } @@ -664,19 +688,18 @@ _zip_dirent_process_winzip_aes(zip_dirent_t *de, zip_error_t *error) { crc_valid = true; switch (_zip_buffer_get_16(buffer)) { - case 1: - break; + case 1: + break; - case 2: - if (de->uncomp_size < 20 /* TODO: constant */) { + case 2: crc_valid = false; - } - break; - - default: - zip_error_set(error, ZIP_ER_ENCRNOTSUPP, 0); - _zip_buffer_free(buffer); - return false; + /* TODO: When checking consistency, check that crc is 0. */ + break; + + default: + zip_error_set(error, ZIP_ER_ENCRNOTSUPP, 0); + _zip_buffer_free(buffer); + return false; } /* vendor */ @@ -704,7 +727,7 @@ _zip_dirent_process_winzip_aes(zip_dirent_t *de, zip_error_t *error) { } if (ef_len != 7) { - zip_error_set(error, ZIP_ER_INCONS, 0); + zip_error_set(error, ZIP_ER_INCONS, ZIP_ER_DETAIL_INVALID_WINZIPAES_EF); _zip_buffer_free(buffer); return false; } @@ -729,7 +752,7 @@ _zip_dirent_size(zip_source_t *src, zip_uint16_t flags, zip_error_t *error) { size = local ? LENTRYSIZE : CDENTRYSIZE; if (zip_source_seek(src, local ? 26 : 28, SEEK_CUR) < 0) { - _zip_error_set_from_source(error, src); + zip_error_set_from_source(error, src); return -1; } @@ -902,7 +925,13 @@ _zip_dirent_write(zip_t *za, zip_dirent_t *de, zip_flags_t flags) { _zip_buffer_put_16(buffer, (zip_uint16_t)de->comp_method); } - _zip_u2d_time(de->last_mod, &dostime, &dosdate); + if (ZIP_WANT_TORRENTZIP(za)) { + dostime = 0xbc00; + dosdate = 0x2198; + } + else { + _zip_u2d_time(de->last_mod, &dostime, &dosdate); + } _zip_buffer_put_16(buffer, dostime); _zip_buffer_put_16(buffer, dosdate); @@ -938,12 +967,15 @@ _zip_dirent_write(zip_t *za, zip_dirent_t *de, zip_flags_t flags) { } _zip_buffer_put_16(buffer, _zip_string_length(de->filename)); - /* TODO: check for overflow */ - ef_total_size = (zip_uint32_t)_zip_ef_size(de->extra_fields, flags) + (zip_uint32_t)_zip_ef_size(ef, ZIP_EF_BOTH); + ef_total_size = (zip_uint32_t)_zip_ef_size(ef, ZIP_EF_BOTH); + if (!ZIP_WANT_TORRENTZIP(za)) { + /* TODO: check for overflow */ + ef_total_size += (zip_uint32_t)_zip_ef_size(de->extra_fields, flags); + } _zip_buffer_put_16(buffer, (zip_uint16_t)ef_total_size); if ((flags & ZIP_FL_LOCAL) == 0) { - _zip_buffer_put_16(buffer, _zip_string_length(de->comment)); + _zip_buffer_put_16(buffer, ZIP_WANT_TORRENTZIP(za) ? 0 : _zip_string_length(de->comment)); _zip_buffer_put_16(buffer, (zip_uint16_t)de->disk_number); _zip_buffer_put_16(buffer, de->int_attrib); _zip_buffer_put_32(buffer, de->ext_attrib); @@ -982,13 +1014,13 @@ _zip_dirent_write(zip_t *za, zip_dirent_t *de, zip_flags_t flags) { } } _zip_ef_free(ef); - if (de->extra_fields) { + if (de->extra_fields && !ZIP_WANT_TORRENTZIP(za)) { if (_zip_ef_write(za, de->extra_fields, flags) < 0) { return -1; } } - if ((flags & ZIP_FL_LOCAL) == 0) { + if ((flags & ZIP_FL_LOCAL) == 0 && !ZIP_WANT_TORRENTZIP(za)) { if (de->comment) { if (_zip_string_write(za, de->comment) < 0) { return -1; @@ -1090,15 +1122,10 @@ _zip_get_dirent(zip_t *za, zip_uint64_t idx, zip_flags_t flags, zip_error_t *err void _zip_u2d_time(time_t intime, zip_uint16_t *dtime, zip_uint16_t *ddate) { struct tm *tpm; - -#ifdef HAVE_LOCALTIME_R struct tm tm; - tpm = localtime_r(&intime, &tm); -#else - tpm = localtime(&intime); -#endif + tpm = zip_localtime(&intime, &tm); if (tpm == NULL) { - /* if localtime() fails, return an arbitrary date (1980-01-01 00:00:00) */ + /* if localtime fails, return an arbitrary date (1980-01-01 00:00:00) */ *ddate = (1 << 5) + 1; *dtime = 0; return; @@ -1109,8 +1136,6 @@ _zip_u2d_time(time_t intime, zip_uint16_t *dtime, zip_uint16_t *ddate) { *ddate = (zip_uint16_t)(((tpm->tm_year + 1900 - 1980) << 9) + ((tpm->tm_mon + 1) << 5) + tpm->tm_mday); *dtime = (zip_uint16_t)(((tpm->tm_hour) << 11) + ((tpm->tm_min) << 5) + ((tpm->tm_sec) >> 1)); - - return; } @@ -1161,3 +1186,22 @@ _zip_dirent_apply_attributes(zip_dirent_t *de, zip_file_attributes_t *attributes de->version_madeby = (de->version_madeby & 0xff) | (zip_uint16_t)(attributes->host_system << 8); } } + + +/* _zip_dirent_torrent_normalize(de); + Set values suitable for torrentzip. +*/ + +void zip_dirent_torrentzip_normalize(zip_dirent_t *de) { + de->version_madeby = 0; + de->version_needed = 20; /* 2.0 */ + de->bitflags = 2; /* maximum compression */ + de->comp_method = ZIP_CM_DEFLATE; + de->compression_level = TORRENTZIP_COMPRESSION_FLAGS; + de->disk_number = 0; + de->int_attrib = 0; + de->ext_attrib = 0; + + /* last_mod, extra_fields, and comment are normalized in zip_dirent_write() directly */ + +} diff --git a/core/deps/libzip/lib/zip_discard.c b/core/deps/libzip/lib/zip_discard.c index a29a2884b..d1dc4f8b0 100644 --- a/core/deps/libzip/lib/zip_discard.c +++ b/core/deps/libzip/lib/zip_discard.c @@ -1,9 +1,9 @@ /* zip_discard.c -- discard and free struct zip - Copyright (C) 1999-2020 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/core/deps/libzip/lib/zip_entry.c b/core/deps/libzip/lib/zip_entry.c index 837b59c13..35a36e4a1 100644 --- a/core/deps/libzip/lib/zip_entry.c +++ b/core/deps/libzip/lib/zip_entry.c @@ -1,9 +1,9 @@ /* zip_entry.c -- struct zip_entry helper functions - Copyright (C) 1999-2020 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/core/deps/libzip/lib/zip_err_str.c b/core/deps/libzip/lib/zip_err_str.c deleted file mode 100644 index de141ffe7..000000000 --- a/core/deps/libzip/lib/zip_err_str.c +++ /dev/null @@ -1,84 +0,0 @@ -/* - This file was generated automatically by CMake - from zip.h; make changes there. -*/ - -#include "zipint.h" - -const char * const _zip_err_str[] = { - "No error", - "Multi-disk zip archives not supported", - "Renaming temporary file failed", - "Closing zip archive failed", - "Seek error", - "Read error", - "Write error", - "CRC error", - "Containing zip archive was closed", - "No such file", - "File already exists", - "Can't open file", - "Failure to create temporary file", - "Zlib error", - "Malloc failure", - "Entry has been changed", - "Compression method not supported", - "Premature end of file", - "Invalid argument", - "Not a zip archive", - "Internal error", - "Zip archive inconsistent", - "Can't remove file", - "Entry has been deleted", - "Encryption method not supported", - "Read-only archive", - "No password provided", - "Wrong password provided", - "Operation not supported", - "Resource still in use", - "Tell error", - "Compressed data invalid", - "Operation cancelled", -}; - -const int _zip_nerr_str = sizeof(_zip_err_str)/sizeof(_zip_err_str[0]); - -#define N ZIP_ET_NONE -#define S ZIP_ET_SYS -#define Z ZIP_ET_ZLIB - -const int _zip_err_type[] = { - N, - N, - S, - S, - S, - S, - S, - N, - N, - N, - N, - S, - S, - Z, - N, - N, - N, - N, - N, - N, - N, - N, - S, - N, - N, - N, - N, - N, - N, - N, - S, - N, - N, -}; diff --git a/core/deps/libzip/lib/zip_error.c b/core/deps/libzip/lib/zip_error.c index 9381d5bf8..c498e0860 100644 --- a/core/deps/libzip/lib/zip_error.c +++ b/core/deps/libzip/lib/zip_error.c @@ -1,9 +1,9 @@ /* zip_error.c -- zip_error_t helper functions - Copyright (C) 1999-2020 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -67,23 +67,24 @@ zip_error_init_with_code(zip_error_t *error, int ze) { zip_error_init(error); error->zip_err = ze; switch (zip_error_system_type(error)) { - case ZIP_ET_SYS: - error->sys_err = errno; - break; - - default: - error->sys_err = 0; - break; + case ZIP_ET_SYS: + case ZIP_ET_LIBZIP: + error->sys_err = errno; + break; + + default: + error->sys_err = 0; + break; } } ZIP_EXTERN int zip_error_system_type(const zip_error_t *error) { - if (error->zip_err < 0 || error->zip_err >= _zip_nerr_str) + if (error->zip_err < 0 || error->zip_err >= _zip_err_str_count) return ZIP_ET_NONE; - return _zip_err_type[error->zip_err]; + return _zip_err_str[error->zip_err].type; } @@ -131,7 +132,12 @@ zip_error_set(zip_error_t *err, int ze, int se) { void -_zip_error_set_from_source(zip_error_t *err, zip_source_t *src) { +zip_error_set_from_source(zip_error_t *err, zip_source_t *src) { + if (src == NULL) { + zip_error_set(err, ZIP_ER_INVAL, 0); + return; + } + _zip_error_copy(err, zip_source_error(src)); } diff --git a/core/deps/libzip/lib/zip_error_clear.c b/core/deps/libzip/lib/zip_error_clear.c index 9bcd506ec..94ff5062d 100644 --- a/core/deps/libzip/lib/zip_error_clear.c +++ b/core/deps/libzip/lib/zip_error_clear.c @@ -1,9 +1,9 @@ /* zip_error_clear.c -- clear zip error - Copyright (C) 1999-2020 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/core/deps/libzip/lib/zip_error_get.c b/core/deps/libzip/lib/zip_error_get.c index 9d0ec03ff..c0418f0d0 100644 --- a/core/deps/libzip/lib/zip_error_get.c +++ b/core/deps/libzip/lib/zip_error_get.c @@ -1,9 +1,9 @@ /* zip_error_get.c -- get zip error - Copyright (C) 1999-2020 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/core/deps/libzip/lib/zip_error_get_sys_type.c b/core/deps/libzip/lib/zip_error_get_sys_type.c index 3c9998c57..a22ffb036 100644 --- a/core/deps/libzip/lib/zip_error_get_sys_type.c +++ b/core/deps/libzip/lib/zip_error_get_sys_type.c @@ -1,9 +1,9 @@ /* zip_error_get_sys_type.c -- return type of system error code - Copyright (C) 1999-2020 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -37,8 +37,9 @@ ZIP_EXTERN int zip_error_get_sys_type(int ze) { - if (ze < 0 || ze >= _zip_nerr_str) + if (ze < 0 || ze >= _zip_err_str_count) { return 0; + } - return _zip_err_type[ze]; + return _zip_err_str[ze].type; } diff --git a/core/deps/libzip/lib/zip_error_strerror.c b/core/deps/libzip/lib/zip_error_strerror.c index d20b3b2fa..fe04cbb4f 100644 --- a/core/deps/libzip/lib/zip_error_strerror.c +++ b/core/deps/libzip/lib/zip_error_strerror.c @@ -1,9 +1,9 @@ /* zip_error_sterror.c -- get string representation of struct zip_error - Copyright (C) 1999-2020 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -39,45 +39,90 @@ #include "zipint.h" - ZIP_EXTERN const char * zip_error_strerror(zip_error_t *err) { - const char *zs, *ss; - char buf[128], *s; + const char *zip_error_string, *system_error_string; + char *s; + char *system_error_buffer = NULL; zip_error_fini(err); - if (err->zip_err < 0 || err->zip_err >= _zip_nerr_str) { - sprintf(buf, "Unknown error %d", err->zip_err); - zs = NULL; - ss = buf; + if (err->zip_err < 0 || err->zip_err >= _zip_err_str_count) { + system_error_buffer = (char *)malloc(128); + snprintf_s(system_error_buffer, 128, "Unknown error %d", err->zip_err); + system_error_buffer[128 - 1] = '\0'; /* make sure string is NUL-terminated */ + zip_error_string = NULL; + system_error_string = system_error_buffer; } else { - zs = _zip_err_str[err->zip_err]; - - switch (_zip_err_type[err->zip_err]) { - case ZIP_ET_SYS: - ss = strerror(err->sys_err); - break; - - case ZIP_ET_ZLIB: - ss = zError(err->sys_err); - break; - - default: - ss = NULL; + zip_error_string = _zip_err_str[err->zip_err].description; + + switch (_zip_err_str[err->zip_err].type) { + case ZIP_ET_SYS: { + size_t len = strerrorlen_s(err->sys_err) + 1; + system_error_buffer = malloc(len); + strerror_s(system_error_buffer, len, err->sys_err); + system_error_string = system_error_buffer; + break; + } + + case ZIP_ET_ZLIB: + system_error_string = zError(err->sys_err); + break; + + case ZIP_ET_LIBZIP: { + zip_uint8_t error = GET_ERROR_FROM_DETAIL(err->sys_err); + int index = GET_INDEX_FROM_DETAIL(err->sys_err); + + if (error == 0) { + system_error_string = NULL; + } + else if (error >= _zip_err_details_count) { + system_error_buffer = (char *)malloc(128); + snprintf_s(system_error_buffer, 128, "invalid detail error %u", error); + system_error_buffer[128 - 1] = '\0'; /* make sure string is NUL-terminated */ + system_error_string = system_error_buffer; + } + else if (_zip_err_details[error].type == ZIP_DETAIL_ET_ENTRY && index < MAX_DETAIL_INDEX) { + system_error_buffer = (char *)malloc(128); + snprintf_s(system_error_buffer, 128, "entry %d: %s", index, _zip_err_details[error].description); + system_error_buffer[128 - 1] = '\0'; /* make sure string is NUL-terminated */ + system_error_string = system_error_buffer; + } + else { + system_error_string = _zip_err_details[error].description; + } + break; + } + + default: + system_error_string = NULL; } } - if (ss == NULL) - return zs; + if (system_error_string == NULL) { + free(system_error_buffer); + return zip_error_string; + } else { - if ((s = (char *)malloc(strlen(ss) + (zs ? strlen(zs) + 2 : 0) + 1)) == NULL) - return _zip_err_str[ZIP_ER_MEMORY]; + size_t length = strlen(system_error_string); + if (zip_error_string) { + size_t length_error = strlen(zip_error_string); + if (length + length_error + 2 < length) { + free(system_error_buffer); + return _zip_err_str[ZIP_ER_MEMORY].description; + } + length += length_error + 2; + } + if (length == SIZE_MAX || (s = (char *)malloc(length + 1)) == NULL) { + free(system_error_buffer); + return _zip_err_str[ZIP_ER_MEMORY].description; + } - sprintf(s, "%s%s%s", (zs ? zs : ""), (zs ? ": " : ""), ss); + snprintf_s(s, length + 1, "%s%s%s", (zip_error_string ? zip_error_string : ""), (zip_error_string ? ": " : ""), system_error_string); err->str = s; + free(system_error_buffer); return s; } } diff --git a/core/deps/libzip/lib/zip_error_to_str.c b/core/deps/libzip/lib/zip_error_to_str.c index d315b1901..b60b78813 100644 --- a/core/deps/libzip/lib/zip_error_to_str.c +++ b/core/deps/libzip/lib/zip_error_to_str.c @@ -1,9 +1,9 @@ /* zip_error_to_str.c -- get string representation of zip error code - Copyright (C) 1999-2020 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -34,7 +34,6 @@ #include #include -#include #define _ZIP_COMPILING_DEPRECATED #include "zipint.h" @@ -42,25 +41,18 @@ ZIP_EXTERN int zip_error_to_str(char *buf, zip_uint64_t len, int ze, int se) { - const char *zs, *ss; + zip_error_t error; + const char *error_string; + int ret; - if (ze < 0 || ze >= _zip_nerr_str) - return snprintf(buf, len, "Unknown error %d", ze); + zip_error_init(&error); + zip_error_set(&error, ze, se); - zs = _zip_err_str[ze]; + error_string = zip_error_strerror(&error); - switch (_zip_err_type[ze]) { - case ZIP_ET_SYS: - ss = strerror(se); - break; + ret = snprintf_s(buf, ZIP_MIN(len, SIZE_MAX), error_string, strlen(error_string)); - case ZIP_ET_ZLIB: - ss = zError(se); - break; + zip_error_fini(&error); - default: - ss = NULL; - } - - return snprintf(buf, len, "%s%s%s", zs, (ss ? ": " : ""), (ss ? ss : "")); + return ret; } diff --git a/core/deps/libzip/lib/zip_extra_field.c b/core/deps/libzip/lib/zip_extra_field.c index 7424d8831..7aed12adb 100644 --- a/core/deps/libzip/lib/zip_extra_field.c +++ b/core/deps/libzip/lib/zip_extra_field.c @@ -1,9 +1,9 @@ /* zip_extra_field.c -- manipulate extra fields - Copyright (C) 2012-2020 Dieter Baron and Thomas Klausner + Copyright (C) 2012-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -219,7 +219,7 @@ _zip_ef_parse(const zip_uint8_t *data, zip_uint16_t len, zip_flags_t flags, zip_ ef_data = _zip_buffer_get(buffer, flen); if (ef_data == NULL) { - zip_error_set(error, ZIP_ER_INCONS, 0); + zip_error_set(error, ZIP_ER_INCONS, ZIP_ER_DETAIL_INVALID_EF_LENGTH); _zip_buffer_free(buffer); _zip_ef_free(ef_head); return false; @@ -243,11 +243,12 @@ _zip_ef_parse(const zip_uint8_t *data, zip_uint16_t len, zip_flags_t flags, zip_ if (!_zip_buffer_eof(buffer)) { /* Android APK files align stored file data with padding in extra fields; ignore. */ /* see https://android.googlesource.com/platform/build/+/master/tools/zipalign/ZipAlign.cpp */ + /* buffer is at most 64k long, so this can't overflow. */ size_t glen = _zip_buffer_left(buffer); zip_uint8_t *garbage; garbage = _zip_buffer_get(buffer, glen); - if (glen >= 4 || garbage == NULL || memcmp(garbage, "\0\0\0", glen) != 0) { - zip_error_set(error, ZIP_ER_INCONS, 0); + if (glen >= 4 || garbage == NULL || memcmp(garbage, "\0\0\0", (size_t)glen) != 0) { + zip_error_set(error, ZIP_ER_INCONS, ZIP_ER_DETAIL_EF_TRAILING_GARBAGE); _zip_buffer_free(buffer); _zip_ef_free(ef_head); return false; @@ -370,7 +371,7 @@ _zip_read_local_ef(zip_t *za, zip_uint64_t idx) { } if (zip_source_seek(za->src, (zip_int64_t)(e->orig->offset + 26), SEEK_SET) < 0) { - _zip_error_set_from_source(&za->error, za->src); + zip_error_set_from_source(&za->error, za->src); return -1; } diff --git a/core/deps/libzip/lib/zip_extra_field_api.c b/core/deps/libzip/lib/zip_extra_field_api.c index cf2b0e7f1..560c71bb2 100644 --- a/core/deps/libzip/lib/zip_extra_field_api.c +++ b/core/deps/libzip/lib/zip_extra_field_api.c @@ -1,9 +1,9 @@ /* zip_extra_field_api.c -- public extra fields API functions - Copyright (C) 2012-2020 Dieter Baron and Thomas Klausner + Copyright (C) 2012-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -56,6 +56,10 @@ zip_file_extra_field_delete(zip_t *za, zip_uint64_t idx, zip_uint16_t ef_idx, zi zip_error_set(&za->error, ZIP_ER_RDONLY, 0); return -1; } + if (ZIP_WANT_TORRENTZIP(za)) { + zip_error_set(&za->error, ZIP_ER_NOT_ALLOWED, 0); + return -1; + } if (_zip_file_extra_field_prepare_for_change(za, idx) < 0) return -1; @@ -88,6 +92,10 @@ zip_file_extra_field_delete_by_id(zip_t *za, zip_uint64_t idx, zip_uint16_t ef_i zip_error_set(&za->error, ZIP_ER_RDONLY, 0); return -1; } + if (ZIP_WANT_TORRENTZIP(za)) { + zip_error_set(&za->error, ZIP_ER_NOT_ALLOWED, 0); + return -1; + } if (_zip_file_extra_field_prepare_for_change(za, idx) < 0) return -1; @@ -236,6 +244,10 @@ zip_file_extra_field_set(zip_t *za, zip_uint64_t idx, zip_uint16_t ef_id, zip_ui zip_error_set(&za->error, ZIP_ER_RDONLY, 0); return -1; } + if (ZIP_WANT_TORRENTZIP(za)) { + zip_error_set(&za->error, ZIP_ER_NOT_ALLOWED, 0); + return -1; + } if (ZIP_EF_IS_INTERNAL(ef_id)) { zip_error_set(&za->error, ZIP_ER_INVAL, 0); diff --git a/core/deps/libzip/lib/zip_fclose.c b/core/deps/libzip/lib/zip_fclose.c index 4d6fc59ce..b820d98bd 100644 --- a/core/deps/libzip/lib/zip_fclose.c +++ b/core/deps/libzip/lib/zip_fclose.c @@ -1,9 +1,9 @@ /* zip_fclose.c -- close file in zip archive - Copyright (C) 1999-2020 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/core/deps/libzip/lib/zip_fdopen.c b/core/deps/libzip/lib/zip_fdopen.c index 14f243fbb..e72c55dca 100644 --- a/core/deps/libzip/lib/zip_fdopen.c +++ b/core/deps/libzip/lib/zip_fdopen.c @@ -1,9 +1,9 @@ /* zip_fdopen.c -- open read-only archive from file descriptor - Copyright (C) 2009-2020 Dieter Baron and Thomas Klausner + Copyright (C) 2009-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -51,6 +51,10 @@ zip_fdopen(int fd_orig, int _flags, int *zep) { return NULL; } +#ifndef ENABLE_FDOPEN + _zip_set_open_error(zep, NULL, ZIP_ER_OPNOTSUPP); + return NULL; +#else /* We dup() here to avoid messing with the passed in fd. We could not restore it to the original state in case of error. */ @@ -83,4 +87,5 @@ zip_fdopen(int fd_orig, int _flags, int *zep) { zip_error_fini(&error); close(fd_orig); return za; +#endif } diff --git a/core/deps/libzip/lib/zip_file_add.c b/core/deps/libzip/lib/zip_file_add.c index 40386c095..c2c41e156 100644 --- a/core/deps/libzip/lib/zip_file_add.c +++ b/core/deps/libzip/lib/zip_file_add.c @@ -1,9 +1,9 @@ /* zip_file_add.c -- add file via callback function - Copyright (C) 1999-2020 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/core/deps/libzip/lib/zip_file_error_clear.c b/core/deps/libzip/lib/zip_file_error_clear.c index 863dae762..a10bff80c 100644 --- a/core/deps/libzip/lib/zip_file_error_clear.c +++ b/core/deps/libzip/lib/zip_file_error_clear.c @@ -1,9 +1,9 @@ /* zip_file_error_clear.c -- clear zip file error - Copyright (C) 1999-2020 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/core/deps/libzip/lib/zip_file_error_get.c b/core/deps/libzip/lib/zip_file_error_get.c index a47797646..b93117bb9 100644 --- a/core/deps/libzip/lib/zip_file_error_get.c +++ b/core/deps/libzip/lib/zip_file_error_get.c @@ -1,9 +1,9 @@ /* zip_file_error_get.c -- get zip file error - Copyright (C) 1999-2020 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/core/deps/libzip/lib/zip_file_get_comment.c b/core/deps/libzip/lib/zip_file_get_comment.c index 746186a71..fa998f02e 100644 --- a/core/deps/libzip/lib/zip_file_get_comment.c +++ b/core/deps/libzip/lib/zip_file_get_comment.c @@ -1,9 +1,9 @@ /* zip_file_get_comment.c -- get file comment - Copyright (C) 2006-2020 Dieter Baron and Thomas Klausner + Copyright (C) 2006-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/core/deps/libzip/lib/zip_file_get_external_attributes.c b/core/deps/libzip/lib/zip_file_get_external_attributes.c index 6d4e0e490..a79bb3ed2 100644 --- a/core/deps/libzip/lib/zip_file_get_external_attributes.c +++ b/core/deps/libzip/lib/zip_file_get_external_attributes.c @@ -1,9 +1,9 @@ /* zip_file_get_external_attributes.c -- get opsys/external attributes - Copyright (C) 2013-2020 Dieter Baron and Thomas Klausner + Copyright (C) 2013-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/core/deps/libzip/lib/zip_file_get_offset.c b/core/deps/libzip/lib/zip_file_get_offset.c index eb9b0178c..72f4880e7 100644 --- a/core/deps/libzip/lib/zip_file_get_offset.c +++ b/core/deps/libzip/lib/zip_file_get_offset.c @@ -1,9 +1,9 @@ /* zip_file_get_offset.c -- get offset of file data in archive. - Copyright (C) 1999-2020 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -57,7 +57,7 @@ _zip_file_get_offset(const zip_t *za, zip_uint64_t idx, zip_error_t *error) { offset = za->entry[idx].orig->offset; if (zip_source_seek(za->src, (zip_int64_t)offset, SEEK_SET) < 0) { - _zip_error_set_from_source(error, za->src); + zip_error_set_from_source(error, za->src); return 0; } @@ -93,11 +93,11 @@ _zip_file_get_end(const zip_t *za, zip_uint64_t index, zip_error_t *error) { if (entry->bitflags & ZIP_GPBF_DATA_DESCRIPTOR) { zip_uint8_t buf[4]; if (zip_source_seek(za->src, (zip_int64_t)offset, SEEK_SET) < 0) { - _zip_error_set_from_source(error, za->src); + zip_error_set_from_source(error, za->src); return 0; } if (zip_source_read(za->src, buf, 4) != 4) { - _zip_error_set_from_source(error, za->src); + zip_error_set_from_source(error, za->src); return 0; } if (memcmp(buf, DATADES_MAGIC, 4) == 0) { diff --git a/core/deps/libzip/lib/zip_file_rename.c b/core/deps/libzip/lib/zip_file_rename.c index a830b6aa8..9ac25814a 100644 --- a/core/deps/libzip/lib/zip_file_rename.c +++ b/core/deps/libzip/lib/zip_file_rename.c @@ -1,9 +1,9 @@ /* zip_file_rename.c -- rename file in zip archive - Copyright (C) 1999-2020 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/core/deps/libzip/lib/zip_file_replace.c b/core/deps/libzip/lib/zip_file_replace.c index c824d7fba..4262d453e 100644 --- a/core/deps/libzip/lib/zip_file_replace.c +++ b/core/deps/libzip/lib/zip_file_replace.c @@ -1,9 +1,9 @@ /* zip_file_replace.c -- replace file via callback function - Copyright (C) 1999-2020 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/core/deps/libzip/lib/zip_file_set_comment.c b/core/deps/libzip/lib/zip_file_set_comment.c index 8c76f25ac..570f8e821 100644 --- a/core/deps/libzip/lib/zip_file_set_comment.c +++ b/core/deps/libzip/lib/zip_file_set_comment.c @@ -1,9 +1,9 @@ /* zip_file_set_comment.c -- set comment for file in archive - Copyright (C) 2006-2020 Dieter Baron and Thomas Klausner + Copyright (C) 2006-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -50,6 +50,10 @@ zip_file_set_comment(zip_t *za, zip_uint64_t idx, const char *comment, zip_uint1 zip_error_set(&za->error, ZIP_ER_RDONLY, 0); return -1; } + if (ZIP_WANT_TORRENTZIP(za)) { + zip_error_set(&za->error, ZIP_ER_NOT_ALLOWED, 0); + return -1; + } if (len > 0 && comment == NULL) { zip_error_set(&za->error, ZIP_ER_INVAL, 0); diff --git a/core/deps/libzip/lib/zip_file_set_encryption.c b/core/deps/libzip/lib/zip_file_set_encryption.c index 6025e4a82..1cdcd4ab6 100644 --- a/core/deps/libzip/lib/zip_file_set_encryption.c +++ b/core/deps/libzip/lib/zip_file_set_encryption.c @@ -1,9 +1,9 @@ /* zip_file_set_encryption.c -- set encryption for file in archive - Copyright (C) 2016-2020 Dieter Baron and Thomas Klausner + Copyright (C) 2016-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -51,6 +51,10 @@ zip_file_set_encryption(zip_t *za, zip_uint64_t idx, zip_uint16_t method, const zip_error_set(&za->error, ZIP_ER_RDONLY, 0); return -1; } + if (ZIP_WANT_TORRENTZIP(za)) { + zip_error_set(&za->error, ZIP_ER_NOT_ALLOWED, 0); + return -1; + } if (method != ZIP_EM_NONE && _zip_get_encryption_implementation(method, ZIP_CODEC_ENCODE) == NULL) { zip_error_set(&za->error, ZIP_ER_ENCRNOTSUPP, 0); diff --git a/core/deps/libzip/lib/zip_file_set_external_attributes.c b/core/deps/libzip/lib/zip_file_set_external_attributes.c index 0662f60d2..2e0429b8c 100644 --- a/core/deps/libzip/lib/zip_file_set_external_attributes.c +++ b/core/deps/libzip/lib/zip_file_set_external_attributes.c @@ -1,9 +1,9 @@ /* zip_file_set_external_attributes.c -- set external attributes for entry - Copyright (C) 2013-2020 Dieter Baron and Thomas Klausner + Copyright (C) 2013-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -47,6 +47,10 @@ zip_file_set_external_attributes(zip_t *za, zip_uint64_t idx, zip_flags_t flags, zip_error_set(&za->error, ZIP_ER_RDONLY, 0); return -1; } + if (ZIP_WANT_TORRENTZIP(za)) { + zip_error_set(&za->error, ZIP_ER_NOT_ALLOWED, 0); + return -1; + } e = za->entry + idx; diff --git a/core/deps/libzip/lib/zip_file_set_mtime.c b/core/deps/libzip/lib/zip_file_set_mtime.c index 2753d595e..4126f5a16 100644 --- a/core/deps/libzip/lib/zip_file_set_mtime.c +++ b/core/deps/libzip/lib/zip_file_set_mtime.c @@ -1,9 +1,9 @@ /* zip_file_set_mtime.c -- set modification time of entry. - Copyright (C) 2014-2020 Dieter Baron and Thomas Klausner + Copyright (C) 2014-2022 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -51,9 +51,18 @@ zip_file_set_mtime(zip_t *za, zip_uint64_t idx, time_t mtime, zip_flags_t flags) zip_error_set(&za->error, ZIP_ER_RDONLY, 0); return -1; } + if (ZIP_WANT_TORRENTZIP(za)) { + zip_error_set(&za->error, ZIP_ER_NOT_ALLOWED, 0); + return -1; + } e = za->entry + idx; + if (e->orig != NULL && e->orig->encryption_method == ZIP_EM_TRAD_PKWARE && !ZIP_ENTRY_CHANGED(e, ZIP_DIRENT_ENCRYPTION_METHOD) && !ZIP_ENTRY_DATA_CHANGED(e)) { + zip_error_set(&za->error, ZIP_ER_OPNOTSUPP, 0); + return -1; + } + if (e->changes == NULL) { if ((e->changes = _zip_dirent_clone(e->orig)) == NULL) { zip_error_set(&za->error, ZIP_ER_MEMORY, 0); diff --git a/core/deps/libzip/lib/zip_file_strerror.c b/core/deps/libzip/lib/zip_file_strerror.c index 2dcdba72b..5b5a00924 100644 --- a/core/deps/libzip/lib/zip_file_strerror.c +++ b/core/deps/libzip/lib/zip_file_strerror.c @@ -1,9 +1,9 @@ /* zip_file_sterror.c -- get string representation of zip file error - Copyright (C) 1999-2020 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/core/deps/libzip/lib/zip_fopen.c b/core/deps/libzip/lib/zip_fopen.c index 2da0cc5f0..e3cde9be0 100644 --- a/core/deps/libzip/lib/zip_fopen.c +++ b/core/deps/libzip/lib/zip_fopen.c @@ -1,9 +1,9 @@ /* zip_fopen.c -- open file in zip archive for reading - Copyright (C) 1999-2020 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/core/deps/libzip/lib/zip_fopen_encrypted.c b/core/deps/libzip/lib/zip_fopen_encrypted.c index 80160152a..d5880dcb9 100644 --- a/core/deps/libzip/lib/zip_fopen_encrypted.c +++ b/core/deps/libzip/lib/zip_fopen_encrypted.c @@ -1,9 +1,9 @@ /* zip_fopen_encrypted.c -- open file for reading with password - Copyright (C) 1999-2020 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/core/deps/libzip/lib/zip_fopen_index.c b/core/deps/libzip/lib/zip_fopen_index.c index 5fd5f1a61..a449b83a0 100644 --- a/core/deps/libzip/lib/zip_fopen_index.c +++ b/core/deps/libzip/lib/zip_fopen_index.c @@ -1,9 +1,9 @@ /* zip_fopen_index.c -- open file in zip archive for reading by index - Copyright (C) 1999-2020 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/core/deps/libzip/lib/zip_fopen_index_encrypted.c b/core/deps/libzip/lib/zip_fopen_index_encrypted.c index 280a5bd0c..40483709e 100644 --- a/core/deps/libzip/lib/zip_fopen_index_encrypted.c +++ b/core/deps/libzip/lib/zip_fopen_index_encrypted.c @@ -1,9 +1,9 @@ /* zip_fopen_index_encrypted.c -- open file for reading by index w/ password - Copyright (C) 1999-2020 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -49,11 +49,11 @@ zip_fopen_index_encrypted(zip_t *za, zip_uint64_t index, zip_flags_t flags, cons password = NULL; } - if ((src = _zip_source_zip_new(za, za, index, flags, 0, 0, password)) == NULL) + if ((src = zip_source_zip_file_create(za, index, flags, 0, -1, password, &za->error)) == NULL) return NULL; if (zip_source_open(src) < 0) { - _zip_error_set_from_source(&za->error, src); + zip_error_set_from_source(&za->error, src); zip_source_free(src); return NULL; } @@ -78,9 +78,7 @@ _zip_file_new(zip_t *za) { return NULL; } - zf->za = za; zip_error_init(&zf->error); - zf->eof = 0; zf->src = NULL; return zf; diff --git a/core/deps/libzip/lib/zip_fread.c b/core/deps/libzip/lib/zip_fread.c index ecf0c3b00..5b7da46ae 100644 --- a/core/deps/libzip/lib/zip_fread.c +++ b/core/deps/libzip/lib/zip_fread.c @@ -1,9 +1,9 @@ /* zip_fread.c -- read from file - Copyright (C) 1999-2020 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -50,11 +50,12 @@ zip_fread(zip_file_t *zf, void *outbuf, zip_uint64_t toread) { return -1; } - if ((zf->eof) || (toread == 0)) + if (toread == 0) { return 0; + } if ((n = zip_source_read(zf->src, outbuf, toread)) < 0) { - _zip_error_set_from_source(&zf->error, zf->src); + zip_error_set_from_source(&zf->error, zf->src); return -1; } diff --git a/core/deps/libzip/lib/zip_fseek.c b/core/deps/libzip/lib/zip_fseek.c index 21f344a6e..e68ffd367 100644 --- a/core/deps/libzip/lib/zip_fseek.c +++ b/core/deps/libzip/lib/zip_fseek.c @@ -1,9 +1,9 @@ /* zip_fseek.c -- seek in file - Copyright (C) 2016-2020 Dieter Baron and Thomas Klausner + Copyright (C) 2016-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -43,9 +43,19 @@ zip_fseek(zip_file_t *zf, zip_int64_t offset, int whence) { return -1; if (zip_source_seek(zf->src, offset, whence) < 0) { - _zip_error_set_from_source(&zf->error, zf->src); + zip_error_set_from_source(&zf->error, zf->src); return -1; } return 0; } + + +ZIP_EXTERN int +zip_file_is_seekable(zip_file_t *zfile) { + if (!zfile) { + return -1; + } + + return zip_source_is_seekable(zfile->src); +} diff --git a/core/deps/libzip/lib/zip_ftell.c b/core/deps/libzip/lib/zip_ftell.c index 2b36770af..bf3b03d34 100644 --- a/core/deps/libzip/lib/zip_ftell.c +++ b/core/deps/libzip/lib/zip_ftell.c @@ -1,9 +1,9 @@ /* zip_ftell.c -- tell position in file - Copyright (C) 2016-2020 Dieter Baron and Thomas Klausner + Copyright (C) 2016-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -46,7 +46,7 @@ zip_ftell(zip_file_t *zf) { res = zip_source_tell(zf->src); if (res < 0) { - _zip_error_set_from_source(&zf->error, zf->src); + zip_error_set_from_source(&zf->error, zf->src); return -1; } diff --git a/core/deps/libzip/lib/zip_get_archive_comment.c b/core/deps/libzip/lib/zip_get_archive_comment.c index 18a4b6106..ea9a00ab5 100644 --- a/core/deps/libzip/lib/zip_get_archive_comment.c +++ b/core/deps/libzip/lib/zip_get_archive_comment.c @@ -1,9 +1,9 @@ /* zip_get_archive_comment.c -- get archive comment - Copyright (C) 2006-2020 Dieter Baron and Thomas Klausner + Copyright (C) 2006-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/core/deps/libzip/lib/zip_get_archive_flag.c b/core/deps/libzip/lib/zip_get_archive_flag.c index 3185ac53a..fc200bdc4 100644 --- a/core/deps/libzip/lib/zip_get_archive_flag.c +++ b/core/deps/libzip/lib/zip_get_archive_flag.c @@ -1,9 +1,9 @@ /* zip_get_archive_flag.c -- get archive global flag - Copyright (C) 2008-2020 Dieter Baron and Thomas Klausner + Copyright (C) 2008-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/core/deps/libzip/lib/zip_get_encryption_implementation.c b/core/deps/libzip/lib/zip_get_encryption_implementation.c index c1643dafe..72e48fe87 100644 --- a/core/deps/libzip/lib/zip_get_encryption_implementation.c +++ b/core/deps/libzip/lib/zip_get_encryption_implementation.c @@ -1,9 +1,9 @@ /* zip_get_encryption_implementation.c -- get encryption implementation - Copyright (C) 2009-2020 Dieter Baron and Thomas Klausner + Copyright (C) 2009-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/core/deps/libzip/lib/zip_get_file_comment.c b/core/deps/libzip/lib/zip_get_file_comment.c index 28429bc87..d58e22ba6 100644 --- a/core/deps/libzip/lib/zip_get_file_comment.c +++ b/core/deps/libzip/lib/zip_get_file_comment.c @@ -1,9 +1,9 @@ /* zip_get_file_comment.c -- get file comment - Copyright (C) 2006-2020 Dieter Baron and Thomas Klausner + Copyright (C) 2006-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/core/deps/libzip/lib/zip_get_name.c b/core/deps/libzip/lib/zip_get_name.c index 1a4bab8f3..4828d7810 100644 --- a/core/deps/libzip/lib/zip_get_name.c +++ b/core/deps/libzip/lib/zip_get_name.c @@ -1,9 +1,9 @@ /* zip_get_name.c -- get filename for a file in zip file - Copyright (C) 1999-2020 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/core/deps/libzip/lib/zip_get_num_entries.c b/core/deps/libzip/lib/zip_get_num_entries.c index 3b18c7479..667dc5117 100644 --- a/core/deps/libzip/lib/zip_get_num_entries.c +++ b/core/deps/libzip/lib/zip_get_num_entries.c @@ -1,9 +1,9 @@ /* zip_get_num_entries.c -- get number of entries in archive - Copyright (C) 1999-2020 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/core/deps/libzip/lib/zip_get_num_files.c b/core/deps/libzip/lib/zip_get_num_files.c index 23d7c9c96..140e34f90 100644 --- a/core/deps/libzip/lib/zip_get_num_files.c +++ b/core/deps/libzip/lib/zip_get_num_files.c @@ -1,9 +1,9 @@ /* zip_get_num_files.c -- get number of files in archive - Copyright (C) 1999-2020 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/core/deps/libzip/lib/zip_hash.c b/core/deps/libzip/lib/zip_hash.c index 56e8d78ca..d3a954ec5 100644 --- a/core/deps/libzip/lib/zip_hash.c +++ b/core/deps/libzip/lib/zip_hash.c @@ -1,9 +1,9 @@ /* zip_hash.c -- hash table string -> uint64 - Copyright (C) 2015-2020 Dieter Baron and Thomas Klausner + Copyright (C) 2015-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/core/deps/libzip/lib/zip_io_util.c b/core/deps/libzip/lib/zip_io_util.c index 3678dd59d..9fcd10b4b 100644 --- a/core/deps/libzip/lib/zip_io_util.c +++ b/core/deps/libzip/lib/zip_io_util.c @@ -1,9 +1,9 @@ /* zip_io_util.c -- I/O helper functions - Copyright (C) 1999-2020 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -31,8 +31,10 @@ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +#include #include #include +#include #include "zipint.h" @@ -46,7 +48,7 @@ _zip_read(zip_source_t *src, zip_uint8_t *b, zip_uint64_t length, zip_error_t *e } if ((n = zip_source_read(src, b, length)) < 0) { - _zip_error_set_from_source(error, src); + zip_error_set_from_source(error, src); return -1; } @@ -81,7 +83,7 @@ _zip_read_data(zip_buffer_t *buffer, zip_source_t *src, size_t length, bool nulp free(r); return NULL; } - memcpy(r, data, length); + (void)memcpy_s(r, length, data, length); } else { if (_zip_read(src, r, length, error) < 0) { @@ -122,7 +124,7 @@ _zip_write(zip_t *za, const void *data, zip_uint64_t length) { zip_int64_t n; if ((n = zip_source_write(za->src, data, length)) < 0) { - _zip_error_set_from_source(&za->error, za->src); + zip_error_set_from_source(&za->error, za->src); return -1; } if ((zip_uint64_t)n != length) { @@ -130,5 +132,15 @@ _zip_write(zip_t *za, const void *data, zip_uint64_t length) { return -1; } + if (za->write_crc != NULL) { + zip_uint64_t position = 0; + while (position < length) { + zip_uint64_t nn = ZIP_MIN(UINT_MAX, length - position); + + *za->write_crc = (zip_uint32_t)crc32(*za->write_crc, (const Bytef *)data + position, (uInt)nn); + position += nn; + } + } + return 0; } diff --git a/core/deps/libzip/lib/zip_libzip_version.c b/core/deps/libzip/lib/zip_libzip_version.c index df1e55b9c..4200727fc 100644 --- a/core/deps/libzip/lib/zip_libzip_version.c +++ b/core/deps/libzip/lib/zip_libzip_version.c @@ -1,9 +1,9 @@ /* zip_libzip_version.c -- return run-time version of library - Copyright (C) 2017-2020 Dieter Baron and Thomas Klausner + Copyright (C) 2017-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/core/deps/libzip/lib/zip_memdup.c b/core/deps/libzip/lib/zip_memdup.c index 169186087..75d72c616 100644 --- a/core/deps/libzip/lib/zip_memdup.c +++ b/core/deps/libzip/lib/zip_memdup.c @@ -1,9 +1,9 @@ /* zip_memdup.c -- internal zip function, "strdup" with len - Copyright (C) 1999-2020 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -50,7 +50,7 @@ _zip_memdup(const void *mem, size_t len, zip_error_t *error) { return NULL; } - memcpy(ret, mem, len); + (void)memcpy_s(ret, len, mem, len); return ret; } diff --git a/core/deps/libzip/lib/zip_name_locate.c b/core/deps/libzip/lib/zip_name_locate.c index 308d843c2..4248dc2d3 100644 --- a/core/deps/libzip/lib/zip_name_locate.c +++ b/core/deps/libzip/lib/zip_name_locate.c @@ -1,9 +1,9 @@ /* zip_name_locate.c -- get index by name - Copyright (C) 1999-2020 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 + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -49,18 +49,38 @@ zip_name_locate(zip_t *za, const char *fname, zip_flags_t flags) { zip_int64_t _zip_name_locate(zip_t *za, const char *fname, zip_flags_t flags, zip_error_t *error) { int (*cmp)(const char *, const char *); + size_t fname_length; + zip_string_t *str = NULL; const char *fn, *p; zip_uint64_t i; - if (za == NULL) + if (za == NULL) { return -1; + } if (fname == NULL) { zip_error_set(error, ZIP_ER_INVAL, 0); return -1; } - if (flags & (ZIP_FL_NOCASE | ZIP_FL_NODIR | ZIP_FL_ENC_CP437)) { + fname_length = strlen(fname); + + if (fname_length > ZIP_UINT16_MAX) { + zip_error_set(error, ZIP_ER_INVAL, 0); + return -1; + } + + if ((flags & (ZIP_FL_ENC_UTF_8 | ZIP_FL_ENC_RAW)) == 0 && fname[0] != '\0') { + if ((str = _zip_string_new((const zip_uint8_t *)fname, (zip_uint16_t)strlen(fname), flags, error)) == NULL) { + return -1; + } + if ((fname = (const char *)_zip_string_get(str, NULL, 0, error)) == NULL) { + _zip_string_free(str); + return -1; + } + } + + if (flags & (ZIP_FL_NOCASE | ZIP_FL_NODIR | ZIP_FL_ENC_RAW | ZIP_FL_ENC_STRICT)) { /* can't use hash table */ cmp = (flags & ZIP_FL_NOCASE) ? strcasecmp : strcmp; @@ -79,14 +99,18 @@ _zip_name_locate(zip_t *za, const char *fname, zip_flags_t flags, zip_error_t *e if (cmp(fname, fn) == 0) { _zip_error_clear(error); + _zip_string_free(str); return (zip_int64_t)i; } } zip_error_set(error, ZIP_ER_NOENT, 0); + _zip_string_free(str); return -1; } else { - return _zip_hash_lookup(za->names, (const zip_uint8_t *)fname, flags, error); + zip_int64_t ret = _zip_hash_lookup(za->names, (const zip_uint8_t *)fname, flags, error); + _zip_string_free(str); + return ret; } } diff --git a/core/deps/libzip/lib/zip_new.c b/core/deps/libzip/lib/zip_new.c index d2a5fa14d..4f69c8a2f 100644 --- a/core/deps/libzip/lib/zip_new.c +++ b/core/deps/libzip/lib/zip_new.c @@ -1,9 +1,9 @@ /* zip_new.c -- create and init struct zip - Copyright (C) 1999-2020 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/core/deps/libzip/lib/zip_open.c b/core/deps/libzip/lib/zip_open.c index 292bfc84d..ee7e9decb 100644 --- a/core/deps/libzip/lib/zip_open.c +++ b/core/deps/libzip/lib/zip_open.c @@ -1,9 +1,9 @@ /* zip_open.c -- open zip archive by name - Copyright (C) 1999-2020 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 + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -32,6 +32,7 @@ */ +#include #include #include #include @@ -41,10 +42,11 @@ typedef enum { EXISTS_ERROR = -1, EXISTS_NOT = 0, EXISTS_OK } exists_t; static zip_t *_zip_allocate_new(zip_source_t *src, unsigned int flags, zip_error_t *error); static zip_int64_t _zip_checkcons(zip_t *za, zip_cdir_t *cdir, zip_error_t *error); +static void zip_check_torrentzip(zip_t *za, const zip_cdir_t *cdir); static zip_cdir_t *_zip_find_central_dir(zip_t *za, zip_uint64_t len); static exists_t _zip_file_exists(zip_source_t *src, zip_error_t *error); static int _zip_headercomp(const zip_dirent_t *, const zip_dirent_t *); -static unsigned char *_zip_memmem(const unsigned char *, size_t, const unsigned char *, size_t); +static const unsigned char *_zip_memmem(const unsigned char *, size_t, const unsigned char *, size_t); static zip_cdir_t *_zip_read_cdir(zip_t *za, zip_buffer_t *buffer, zip_uint64_t buf_offset, zip_error_t *error); static zip_cdir_t *_zip_read_eocd(zip_buffer_t *buffer, zip_uint64_t buf_offset, unsigned int flags, zip_error_t *error); static zip_cdir_t *_zip_read_eocd64(zip_source_t *src, zip_buffer_t *buffer, zip_uint64_t buf_offset, unsigned int flags, zip_error_t *error); @@ -77,9 +79,6 @@ zip_open(const char *fn, int _flags, int *zep) { ZIP_EXTERN zip_t * zip_open_from_source(zip_source_t *src, int _flags, zip_error_t *error) { - static zip_int64_t needed_support_read = -1; - static zip_int64_t needed_support_write = -1; - unsigned int flags; zip_int64_t supported; exists_t exists; @@ -91,15 +90,11 @@ zip_open_from_source(zip_source_t *src, int _flags, zip_error_t *error) { flags = (unsigned int)_flags; supported = zip_source_supports(src); - if (needed_support_read == -1) { - needed_support_read = zip_source_make_command_bitmap(ZIP_SOURCE_OPEN, ZIP_SOURCE_READ, ZIP_SOURCE_CLOSE, ZIP_SOURCE_SEEK, ZIP_SOURCE_TELL, ZIP_SOURCE_STAT, -1); - needed_support_write = zip_source_make_command_bitmap(ZIP_SOURCE_BEGIN_WRITE, ZIP_SOURCE_COMMIT_WRITE, ZIP_SOURCE_ROLLBACK_WRITE, ZIP_SOURCE_SEEK_WRITE, ZIP_SOURCE_TELL_WRITE, ZIP_SOURCE_REMOVE, -1); - } - if ((supported & needed_support_read) != needed_support_read) { + if ((supported & ZIP_SOURCE_SUPPORTS_SEEKABLE) != ZIP_SOURCE_SUPPORTS_SEEKABLE) { zip_error_set(error, ZIP_ER_OPNOTSUPP, 0); return NULL; } - if ((supported & needed_support_write) != needed_support_write) { + if ((supported & ZIP_SOURCE_SUPPORTS_WRITABLE) != ZIP_SOURCE_SUPPORTS_WRITABLE) { flags |= ZIP_RDONLY; } @@ -127,7 +122,7 @@ zip_open_from_source(zip_source_t *src, int _flags, zip_error_t *error) { return NULL; } if (zip_source_open(src) < 0) { - _zip_error_set_from_source(error, src); + zip_error_set_from_source(error, src); return NULL; } @@ -158,7 +153,7 @@ _zip_open(zip_source_t *src, unsigned int flags, zip_error_t *error) { zip_stat_init(&st); if (zip_source_stat(src, &st) < 0) { - _zip_error_set_from_source(error, src); + zip_error_set_from_source(error, src); return NULL; } if ((st.valid & ZIP_STAT_SIZE) == 0) { @@ -188,7 +183,16 @@ _zip_open(zip_source_t *src, unsigned int flags, zip_error_t *error) { za->entry = cdir->entry; za->nentry = cdir->nentry; za->nentry_alloc = cdir->nentry_alloc; - za->comment_orig = cdir->comment; + + zip_check_torrentzip(za, cdir); + + if (ZIP_IS_TORRENTZIP(za)) { + /* Torrentzip uses the archive comment to detect changes by tools that are not torrentzip aware. */ + _zip_string_free(cdir->comment); + } + else { + za->comment_orig = cdir->comment; + } free(cdir); @@ -224,8 +228,14 @@ void _zip_set_open_error(int *zep, const zip_error_t *err, int ze) { if (err) { ze = zip_error_code_zip(err); - if (zip_error_system_type(err) == ZIP_ET_SYS) { - errno = zip_error_code_system(err); + switch (zip_error_system_type(err)) { + case ZIP_ET_SYS: + case ZIP_ET_LIBZIP: + errno = zip_error_code_system(err); + break; + + default: + break; } } @@ -277,7 +287,7 @@ _zip_read_cdir(zip_t *za, zip_buffer_t *buffer, zip_uint64_t buf_offset, zip_err if (cd->offset + cd->size > buf_offset + eocd_offset) { /* cdir spans past EOCD record */ - zip_error_set(error, ZIP_ER_INCONS, 0); + zip_error_set(error, ZIP_ER_INCONS, ZIP_ER_DETAIL_CDIR_OVERLAPS_EOCD); _zip_cdir_free(cd); return NULL; } @@ -289,7 +299,7 @@ _zip_read_cdir(zip_t *za, zip_buffer_t *buffer, zip_uint64_t buf_offset, zip_err tail_len = _zip_buffer_left(buffer); if (tail_len < comment_len || ((za->open_flags & ZIP_CHECKCONS) && tail_len != comment_len)) { - zip_error_set(error, ZIP_ER_INCONS, 0); + zip_error_set(error, ZIP_ER_INCONS, ZIP_ER_DETAIL_COMMENT_LENGTH_INVALID); _zip_cdir_free(cd); return NULL; } @@ -308,7 +318,7 @@ _zip_read_cdir(zip_t *za, zip_buffer_t *buffer, zip_uint64_t buf_offset, zip_err _zip_buffer_set_offset(buffer, cd->offset - buf_offset); if ((data = _zip_buffer_get(buffer, cd->size)) == NULL) { - zip_error_set(error, ZIP_ER_INCONS, 0); + zip_error_set(error, ZIP_ER_INCONS, ZIP_ER_DETAIL_CDIR_LENGTH_INVALID); _zip_cdir_free(cd); return NULL; } @@ -322,7 +332,7 @@ _zip_read_cdir(zip_t *za, zip_buffer_t *buffer, zip_uint64_t buf_offset, zip_err cd_buffer = NULL; if (zip_source_seek(za->src, (zip_int64_t)cd->offset, SEEK_SET) < 0) { - _zip_error_set_from_source(error, za->src); + zip_error_set_from_source(error, za->src); _zip_cdir_free(cd); return NULL; } @@ -358,8 +368,11 @@ _zip_read_cdir(zip_t *za, zip_buffer_t *buffer, zip_uint64_t buf_offset, zip_err } if ((cd->entry[i].orig = _zip_dirent_new()) == NULL || (entry_size = _zip_dirent_read(cd->entry[i].orig, za->src, cd_buffer, false, error)) < 0) { - if (grown && zip_error_code_zip(error) == ZIP_ER_NOZIP) { - zip_error_set(error, ZIP_ER_INCONS, 0); + if (zip_error_code_zip(error) == ZIP_ER_INCONS) { + zip_error_set(error, ZIP_ER_INCONS, ADD_INDEX_TO_DETAIL(zip_error_code_system(error), i)); + } + else if (grown && zip_error_code_zip(error) == ZIP_ER_NOZIP) { + zip_error_set(error, ZIP_ER_INCONS, MAKE_DETAIL_WITH_INDEX(ZIP_ER_DETAIL_CDIR_ENTRY_INVALID, i)); } _zip_cdir_free(cd); _zip_buffer_free(cd_buffer); @@ -370,7 +383,7 @@ _zip_read_cdir(zip_t *za, zip_buffer_t *buffer, zip_uint64_t buf_offset, zip_err } if (i != cd->nentry || left > 0) { - zip_error_set(error, ZIP_ER_INCONS, 0); + zip_error_set(error, ZIP_ER_INCONS, ZIP_ER_DETAIL_CDIR_WRONG_ENTRIES_COUNT); _zip_buffer_free(cd_buffer); _zip_cdir_free(cd); return NULL; @@ -386,7 +399,7 @@ _zip_read_cdir(zip_t *za, zip_buffer_t *buffer, zip_uint64_t buf_offset, zip_err zip_int64_t offset = zip_source_tell(za->src); if (offset < 0) { - _zip_error_set_from_source(error, za->src); + zip_error_set_from_source(error, za->src); _zip_cdir_free(cd); return NULL; } @@ -394,7 +407,7 @@ _zip_read_cdir(zip_t *za, zip_buffer_t *buffer, zip_uint64_t buf_offset, zip_err } if (!ok) { - zip_error_set(error, ZIP_ER_INCONS, 0); + zip_error_set(error, ZIP_ER_INCONS, ZIP_ER_DETAIL_CDIR_LENGTH_INVALID); _zip_buffer_free(cd_buffer); _zip_cdir_free(cd); return NULL; @@ -443,17 +456,20 @@ _zip_checkcons(zip_t *za, zip_cdir_t *cd, zip_error_t *error) { } if (zip_source_seek(za->src, (zip_int64_t)cd->entry[i].orig->offset, SEEK_SET) < 0) { - _zip_error_set_from_source(error, za->src); + zip_error_set_from_source(error, za->src); return -1; } if (_zip_dirent_read(&temp, za->src, NULL, true, error) == -1) { + if (zip_error_code_zip(error) == ZIP_ER_INCONS) { + zip_error_set(error, ZIP_ER_INCONS, ADD_INDEX_TO_DETAIL(zip_error_code_system(error), i)); + } _zip_dirent_finalize(&temp); return -1; } if (_zip_headercomp(cd->entry[i].orig, &temp) != 0) { - zip_error_set(error, ZIP_ER_INCONS, 0); + zip_error_set(error, ZIP_ER_INCONS, MAKE_DETAIL_WITH_INDEX(ZIP_ER_DETAIL_ENTRY_HEADER_MISMATCH, i)); _zip_dirent_finalize(&temp); return -1; } @@ -486,9 +502,20 @@ _zip_headercomp(const zip_dirent_t *central, const zip_dirent_t *local) { if ((central->crc != local->crc) || (central->comp_size != local->comp_size) || (central->uncomp_size != local->uncomp_size)) { /* InfoZip stores valid values in local header even when data descriptor is used. - This is in violation of the appnote. */ - if (((local->bitflags & ZIP_GPBF_DATA_DESCRIPTOR) == 0 || local->crc != 0 || local->comp_size != 0 || local->uncomp_size != 0)) + This is in violation of the appnote. + macOS Archive sets the compressed size even when data descriptor is used ( but not the others), + also in violation of the appnote. + */ + /* if data descriptor is not used, the values must match */ + if ((local->bitflags & ZIP_GPBF_DATA_DESCRIPTOR) == 0) { return -1; + } + /* when using a data descriptor, the local header value must be zero or match */ + if ((local->crc != 0 && central->crc != local->crc) || + (local->comp_size != 0 && central->comp_size != local->comp_size) || + (local->uncomp_size != 0 && central->uncomp_size != local->uncomp_size)) { + return -1; + } } return 0; @@ -505,10 +532,15 @@ _zip_allocate_new(zip_source_t *src, unsigned int flags, zip_error_t *error) { za->src = src; za->open_flags = flags; + za->flags = 0; + za->ch_flags = 0; + za->write_crc = NULL; + if (flags & ZIP_RDONLY) { za->flags |= ZIP_AFL_RDONLY; za->ch_flags |= ZIP_AFL_RDONLY; } + return za; } @@ -537,7 +569,7 @@ _zip_file_exists(zip_source_t *src, zip_error_t *error) { static zip_cdir_t * _zip_find_central_dir(zip_t *za, zip_uint64_t len) { zip_cdir_t *cdir, *cdirnew; - zip_uint8_t *match; + const zip_uint8_t *match; zip_int64_t buf_offset; zip_uint64_t buflen; zip_int64_t a; @@ -560,7 +592,7 @@ _zip_find_central_dir(zip_t *za, zip_uint64_t len) { } } if ((buf_offset = zip_source_tell(za->src)) < 0) { - _zip_error_set_from_source(&za->error, za->src); + zip_error_set_from_source(&za->error, za->src); return NULL; } @@ -577,7 +609,8 @@ _zip_find_central_dir(zip_t *za, zip_uint64_t len) { zip_error_set(&error, ZIP_ER_NOZIP, 0); match = _zip_buffer_get(buffer, 0); - while ((match = _zip_memmem(match, _zip_buffer_left(buffer) - (EOCDLEN - 4), (const unsigned char *)EOCD_MAGIC, 4)) != NULL) { + /* The size of buffer never greater than CDBUFSIZE. */ + while (_zip_buffer_left(buffer) >= EOCDLEN && (match = _zip_memmem(match, (size_t)_zip_buffer_left(buffer) - (EOCDLEN - 4), (const unsigned char *)EOCD_MAGIC, 4)) != NULL) { _zip_buffer_set_offset(buffer, (zip_uint64_t)(match - _zip_buffer_data(buffer))); if ((cdirnew = _zip_read_cdir(za, buffer, (zip_uint64_t)buf_offset, &error)) != NULL) { if (cdir) { @@ -622,19 +655,28 @@ _zip_find_central_dir(zip_t *za, zip_uint64_t len) { } -static unsigned char * -_zip_memmem(const unsigned char *big, size_t biglen, const unsigned char *little, size_t littlelen) { +static const unsigned char *_zip_memmem(const unsigned char *big, size_t biglen, const unsigned char *little, size_t littlelen) { const unsigned char *p; - if ((biglen < littlelen) || (littlelen == 0)) + if (littlelen == 0) { + return big; + } + + if (biglen < littlelen) { return NULL; - p = big - 1; - while ((p = (const unsigned char *)memchr(p + 1, little[0], (size_t)(big - (p + 1)) + (size_t)(biglen - littlelen) + 1)) != NULL) { - if (memcmp(p + 1, little + 1, littlelen - 1) == 0) - return (unsigned char *)p; } - return NULL; + p = big; + while (true) { + p = (const unsigned char *)memchr(p, little[0], biglen - (littlelen - 1) - (size_t)(p - big)); + if (p == NULL) { + return NULL; + } + if (memcmp(p + 1, little + 1, littlelen - 1) == 0) { + return p; + } + p += 1; + } } @@ -644,7 +686,7 @@ _zip_read_eocd(zip_buffer_t *buffer, zip_uint64_t buf_offset, unsigned int flags zip_uint64_t i, nentry, size, offset, eocd_offset; if (_zip_buffer_left(buffer) < EOCDLEN) { - zip_error_set(error, ZIP_ER_INCONS, 0); + zip_error_set(error, ZIP_ER_INCONS, ZIP_ER_DETAIL_EOCD_LENGTH_INVALID); return NULL; } @@ -677,12 +719,12 @@ _zip_read_eocd(zip_buffer_t *buffer, zip_uint64_t buf_offset, unsigned int flags if (offset + size > buf_offset + eocd_offset) { /* cdir spans past EOCD record */ - zip_error_set(error, ZIP_ER_INCONS, 0); + zip_error_set(error, ZIP_ER_INCONS, ZIP_ER_DETAIL_CDIR_OVERLAPS_EOCD); return NULL; } if ((flags & ZIP_CHECKCONS) && offset + size != buf_offset + eocd_offset) { - zip_error_set(error, ZIP_ER_INCONS, 0); + zip_error_set(error, ZIP_ER_INCONS, ZIP_ER_DETAIL_CDIR_LENGTH_INVALID); return NULL; } @@ -723,7 +765,7 @@ _zip_read_eocd64(zip_source_t *src, zip_buffer_t *buffer, zip_uint64_t buf_offse /* does EOCD fit before EOCD locator? */ if (eocd_offset + EOCD64LEN > eocdloc_offset + buf_offset) { - zip_error_set(error, ZIP_ER_INCONS, 0); + zip_error_set(error, ZIP_ER_INCONS, ZIP_ER_DETAIL_EOCD64_OVERLAPS_EOCD); return NULL; } @@ -734,7 +776,7 @@ _zip_read_eocd64(zip_source_t *src, zip_buffer_t *buffer, zip_uint64_t buf_offse } else { if (zip_source_seek(src, (zip_int64_t)eocd_offset, SEEK_SET) < 0) { - _zip_error_set_from_source(error, src); + zip_error_set_from_source(error, src); return NULL; } if ((buffer = _zip_buffer_new_from_source(src, EOCD64LEN, eocd, error)) == NULL) { @@ -744,7 +786,7 @@ _zip_read_eocd64(zip_source_t *src, zip_buffer_t *buffer, zip_uint64_t buf_offse } if (memcmp(_zip_buffer_get(buffer, 4), EOCD64_MAGIC, 4) != 0) { - zip_error_set(error, ZIP_ER_INCONS, 0); + zip_error_set(error, ZIP_ER_INCONS, ZIP_ER_DETAIL_EOCD64_WRONG_MAGIC); if (free_buffer) { _zip_buffer_free(buffer); } @@ -756,7 +798,7 @@ _zip_read_eocd64(zip_source_t *src, zip_buffer_t *buffer, zip_uint64_t buf_offse /* is there a hole between EOCD and EOCD locator, or do they overlap? */ if ((flags & ZIP_CHECKCONS) && size + eocd_offset + 12 != buf_offset + eocdloc_offset) { - zip_error_set(error, ZIP_ER_INCONS, 0); + zip_error_set(error, ZIP_ER_INCONS, ZIP_ER_DETAIL_EOCD64_OVERLAPS_EOCD); if (free_buffer) { _zip_buffer_free(buffer); } @@ -778,7 +820,7 @@ _zip_read_eocd64(zip_source_t *src, zip_buffer_t *buffer, zip_uint64_t buf_offse eocd_disk = eocd_disk64; } if ((flags & ZIP_CHECKCONS) && (eocd_disk != eocd_disk64 || num_disks != num_disks64)) { - zip_error_set(error, ZIP_ER_INCONS, 0); + zip_error_set(error, ZIP_ER_INCONS, ZIP_ER_DETAIL_EOCD64_MISMATCH); if (free_buffer) { _zip_buffer_free(buffer); } @@ -825,16 +867,16 @@ _zip_read_eocd64(zip_source_t *src, zip_buffer_t *buffer, zip_uint64_t buf_offse } if (offset + size > buf_offset + eocd_offset) { /* cdir spans past EOCD record */ - zip_error_set(error, ZIP_ER_INCONS, 0); + zip_error_set(error, ZIP_ER_INCONS, ZIP_ER_DETAIL_CDIR_OVERLAPS_EOCD); return NULL; } if ((flags & ZIP_CHECKCONS) && offset + size != buf_offset + eocd_offset) { - zip_error_set(error, ZIP_ER_INCONS, 0); + zip_error_set(error, ZIP_ER_INCONS, ZIP_ER_DETAIL_CDIR_OVERLAPS_EOCD); return NULL; } if (nentry > size / CDENTRYSIZE) { - zip_error_set(error, ZIP_ER_INCONS, 0); + zip_error_set(error, ZIP_ER_INCONS, ZIP_ER_DETAIL_CDIR_INVALID); return NULL; } @@ -847,3 +889,79 @@ _zip_read_eocd64(zip_source_t *src, zip_buffer_t *buffer, zip_uint64_t buf_offse return cd; } + + +static int decode_hex(char c) { + if (c >= '0' && c <= '9') { + return c - '0'; + } + else if (c >= 'A' && c <= 'F') { + return c - 'A' + 10; + } + else { + return -1; + } +} + +/* _zip_check_torrentzip: + check whether ZA has a valid TORRENTZIP comment, i.e. is torrentzipped */ + +static void zip_check_torrentzip(zip_t *za, const zip_cdir_t *cdir) { + zip_uint32_t crc_should; + char buf[8+1]; + size_t i; + + if (cdir == NULL) { + return; + } + + if (_zip_string_length(cdir->comment) != TORRENTZIP_SIGNATURE_LENGTH + TORRENTZIP_CRC_LENGTH + || strncmp((const char *)cdir->comment->raw, TORRENTZIP_SIGNATURE, TORRENTZIP_SIGNATURE_LENGTH) != 0) + return; + + memcpy(buf, cdir->comment->raw + TORRENTZIP_SIGNATURE_LENGTH, TORRENTZIP_CRC_LENGTH); + buf[TORRENTZIP_CRC_LENGTH] = '\0'; + crc_should = 0; + for (i = 0; i < TORRENTZIP_CRC_LENGTH; i += 2) { + int low, high; + high = decode_hex((buf[i])); + low = decode_hex(buf[i + 1]); + if (high < 0 || low < 0) { + return; + } + crc_should = (crc_should << 8) + (high << 4) + low; + } + + { + zip_stat_t st; + zip_source_t* src_window; + zip_source_t* src_crc; + zip_uint8_t buffer[512]; + zip_int64_t ret; + + zip_stat_init(&st); + st.valid |= ZIP_STAT_SIZE | ZIP_STAT_CRC; + st.size = cdir->size; + st.crc = crc_should; + if ((src_window = _zip_source_window_new(za->src, cdir->offset, cdir->size, &st, 0, NULL, NULL, 0, false, NULL)) == NULL) { + return; + } + if ((src_crc = zip_source_crc_create(src_window, 1, NULL)) == NULL) { + zip_source_free(src_window); + return; + } + if (zip_source_open(src_crc) != 0) { + zip_source_free(src_crc); + return; + } + while ((ret = zip_source_read(src_crc, buffer, sizeof(buffer))) > 0) { + } + zip_source_free(src_crc); + if (ret < 0) { + return; + } + } + + /* TODO: if check consistency, check cdir entries for valid values */ + za->flags |= ZIP_AFL_IS_TORRENTZIP; +} diff --git a/core/deps/libzip/lib/zip_pkware.c b/core/deps/libzip/lib/zip_pkware.c index 1b1b461a0..6a8c9fcde 100644 --- a/core/deps/libzip/lib/zip_pkware.c +++ b/core/deps/libzip/lib/zip_pkware.c @@ -3,7 +3,7 @@ Copyright (C) 2009-2020 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/core/deps/libzip/lib/zip_progress.c b/core/deps/libzip/lib/zip_progress.c index a881df476..e080514b1 100644 --- a/core/deps/libzip/lib/zip_progress.c +++ b/core/deps/libzip/lib/zip_progress.c @@ -3,7 +3,7 @@ Copyright (C) 2017-2020 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/core/deps/libzip/lib/zip_random_unix.c b/core/deps/libzip/lib/zip_random_unix.c index 4aa9cc26e..867df7900 100644 --- a/core/deps/libzip/lib/zip_random_unix.c +++ b/core/deps/libzip/lib/zip_random_unix.c @@ -1,9 +1,9 @@ /* zip_random_unix.c -- fill the user's buffer with random stuff (Unix version) - Copyright (C) 2016-2020 Dieter Baron and Thomas Klausner + Copyright (C) 2016-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -83,6 +83,11 @@ zip_secure_random(zip_uint8_t *buffer, zip_uint16_t length) { #ifndef HAVE_RANDOM_UINT32 #include +#ifndef HAVE_RANDOM +#define srandom srand +#define random rand +#endif + zip_uint32_t zip_random_uint32(void) { static bool seeded = false; @@ -95,6 +100,7 @@ zip_random_uint32(void) { if (!seeded) { srandom((unsigned int)time(NULL)); + seeded = true; } return (zip_uint32_t)random(); diff --git a/core/deps/libzip/lib/zip_random_uwp.c b/core/deps/libzip/lib/zip_random_uwp.c index 7cff98e98..0883ce454 100644 --- a/core/deps/libzip/lib/zip_random_uwp.c +++ b/core/deps/libzip/lib/zip_random_uwp.c @@ -1,9 +1,9 @@ /* zip_random_uwp.c -- fill the user's buffer with random stuff (UWP version) - Copyright (C) 2017-2020 Dieter Baron and Thomas Klausner + Copyright (C) 2017-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -41,18 +41,17 @@ #include #include -#include ZIP_EXTERN bool zip_secure_random(zip_uint8_t *buffer, zip_uint16_t length) { BCRYPT_ALG_HANDLE hAlg = NULL; NTSTATUS hr = BCryptOpenAlgorithmProvider(&hAlg, BCRYPT_RNG_ALGORITHM, MS_PRIMITIVE_PROVIDER, 0); - if (hr != STATUS_SUCCESS || hAlg == NULL) { + if (!BCRYPT_SUCCESS(hr) || hAlg == NULL) { return false; } hr = BCryptGenRandom(&hAlg, buffer, length, 0); BCryptCloseAlgorithmProvider(&hAlg, 0); - if (hr != STATUS_SUCCESS) { + if (!BCRYPT_SUCCESS(hr)) { return false; } return true; @@ -75,6 +74,7 @@ zip_random_uint32(void) { if (!seeded) { srand((unsigned int)time(NULL)); + seeded = true; } return (zip_uint32_t)rand(); diff --git a/core/deps/libzip/lib/zip_random_win32.c b/core/deps/libzip/lib/zip_random_win32.c index 251735778..789b9c205 100644 --- a/core/deps/libzip/lib/zip_random_win32.c +++ b/core/deps/libzip/lib/zip_random_win32.c @@ -1,9 +1,9 @@ /* zip_random_win32.c -- fill the user's buffer with random stuff (Windows version) - Copyright (C) 2016-2020 Dieter Baron and Thomas Klausner + Copyright (C) 2016-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -74,6 +74,7 @@ zip_random_uint32(void) { if (!seeded) { srand((unsigned int)time(NULL)); + seeded = true; } return (zip_uint32_t)rand(); diff --git a/core/deps/libzip/lib/zip_rename.c b/core/deps/libzip/lib/zip_rename.c index eb1b3956b..c89b06c9e 100644 --- a/core/deps/libzip/lib/zip_rename.c +++ b/core/deps/libzip/lib/zip_rename.c @@ -1,9 +1,9 @@ /* zip_rename.c -- rename file in zip archive - Copyright (C) 1999-2020 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/core/deps/libzip/lib/zip_replace.c b/core/deps/libzip/lib/zip_replace.c index 2140223ac..96c083c3d 100644 --- a/core/deps/libzip/lib/zip_replace.c +++ b/core/deps/libzip/lib/zip_replace.c @@ -1,9 +1,9 @@ /* zip_replace.c -- replace file via callback function - Copyright (C) 1999-2020 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/core/deps/libzip/lib/zip_set_archive_comment.c b/core/deps/libzip/lib/zip_set_archive_comment.c index ce0c5d38a..7d06688e3 100644 --- a/core/deps/libzip/lib/zip_set_archive_comment.c +++ b/core/deps/libzip/lib/zip_set_archive_comment.c @@ -1,9 +1,9 @@ /* zip_set_archive_comment.c -- set archive comment - Copyright (C) 2006-2020 Dieter Baron and Thomas Klausner + Copyright (C) 2006-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -45,6 +45,10 @@ zip_set_archive_comment(zip_t *za, const char *comment, zip_uint16_t len) { zip_error_set(&za->error, ZIP_ER_RDONLY, 0); return -1; } + if (ZIP_WANT_TORRENTZIP(za)) { + zip_error_set(&za->error, ZIP_ER_NOT_ALLOWED, 0); + return -1; + } if (len > 0 && comment == NULL) { zip_error_set(&za->error, ZIP_ER_INVAL, 0); diff --git a/core/deps/libzip/lib/zip_set_archive_flag.c b/core/deps/libzip/lib/zip_set_archive_flag.c index fe9f62ff0..834ef5bac 100644 --- a/core/deps/libzip/lib/zip_set_archive_flag.c +++ b/core/deps/libzip/lib/zip_set_archive_flag.c @@ -1,9 +1,9 @@ /* zip_get_archive_flag.c -- set archive global flag - Copyright (C) 2008-2020 Dieter Baron and Thomas Klausner + Copyright (C) 2008-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -39,15 +39,26 @@ ZIP_EXTERN int zip_set_archive_flag(zip_t *za, zip_flags_t flag, int value) { unsigned int new_flags; - if (value) + if (flag == ZIP_AFL_IS_TORRENTZIP) { + zip_error_set(&za->error, ZIP_ER_INVAL, 0); + return -1; + } + + /* TODO: when setting ZIP_AFL_WANT_TORRENTZIP, we should error out if any changes have been made that are not allowed for torrentzip. */ + + if (value) { new_flags = za->ch_flags | flag; - else + } + else { new_flags = za->ch_flags & ~flag; + } - if (new_flags == za->ch_flags) + if (new_flags == za->ch_flags) { return 0; + } - if (ZIP_IS_RDONLY(za)) { + /* Allow removing ZIP_AFL_RDONLY if manually set, not if archive was opened read-only. */ + if (za->flags & ZIP_AFL_RDONLY) { zip_error_set(&za->error, ZIP_ER_RDONLY, 0); return -1; } diff --git a/core/deps/libzip/lib/zip_set_default_password.c b/core/deps/libzip/lib/zip_set_default_password.c index d89394927..4bab513f4 100644 --- a/core/deps/libzip/lib/zip_set_default_password.c +++ b/core/deps/libzip/lib/zip_set_default_password.c @@ -1,9 +1,9 @@ /* zip_set_default_password.c -- set default password for decryption - Copyright (C) 2009-2020 Dieter Baron and Thomas Klausner + Copyright (C) 2009-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/core/deps/libzip/lib/zip_set_file_comment.c b/core/deps/libzip/lib/zip_set_file_comment.c index d19121fa1..5d2b0b8a0 100644 --- a/core/deps/libzip/lib/zip_set_file_comment.c +++ b/core/deps/libzip/lib/zip_set_file_comment.c @@ -1,9 +1,9 @@ /* zip_set_file_comment.c -- set comment for file in archive - Copyright (C) 2006-2020 Dieter Baron and Thomas Klausner + Copyright (C) 2006-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/core/deps/libzip/lib/zip_set_file_compression.c b/core/deps/libzip/lib/zip_set_file_compression.c index 511c7d515..a193bb77f 100644 --- a/core/deps/libzip/lib/zip_set_file_compression.c +++ b/core/deps/libzip/lib/zip_set_file_compression.c @@ -1,9 +1,9 @@ /* zip_set_file_compression.c -- set compression for file in archive - Copyright (C) 2012-2020 Dieter Baron and Thomas Klausner + Copyright (C) 2012-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -40,7 +40,7 @@ zip_set_file_compression(zip_t *za, zip_uint64_t idx, zip_int32_t method, zip_ui zip_entry_t *e; zip_int32_t old_method; - if (idx >= za->nentry || flags > 9) { + if (idx >= za->nentry) { zip_error_set(&za->error, ZIP_ER_INVAL, 0); return -1; } @@ -49,6 +49,10 @@ zip_set_file_compression(zip_t *za, zip_uint64_t idx, zip_int32_t method, zip_ui zip_error_set(&za->error, ZIP_ER_RDONLY, 0); return -1; } + if (ZIP_WANT_TORRENTZIP(za)) { + zip_error_set(&za->error, ZIP_ER_NOT_ALLOWED, 0); + return -1; + } if (!zip_compression_method_supported(method, true)) { zip_error_set(&za->error, ZIP_ER_COMPNOTSUPP, 0); diff --git a/core/deps/libzip/lib/zip_set_name.c b/core/deps/libzip/lib/zip_set_name.c index 52676857e..f1bf703e4 100644 --- a/core/deps/libzip/lib/zip_set_name.c +++ b/core/deps/libzip/lib/zip_set_name.c @@ -1,9 +1,9 @@ /* zip_set_name.c -- rename helper function - Copyright (C) 1999-2020 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/core/deps/libzip/lib/zip_source_accept_empty.c b/core/deps/libzip/lib/zip_source_accept_empty.c index 754b80b76..e772aeea9 100644 --- a/core/deps/libzip/lib/zip_source_accept_empty.c +++ b/core/deps/libzip/lib/zip_source_accept_empty.c @@ -1,9 +1,9 @@ /* zip_source_accept_empty.c -- if empty source is a valid archive - Copyright (C) 2019-2020 Dieter Baron and Thomas Klausner + Copyright (C) 2019-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -37,7 +37,7 @@ bool zip_source_accept_empty(zip_source_t *src) { - int ret; + zip_int64_t ret; if ((zip_source_supports(src) & ZIP_SOURCE_MAKE_COMMAND_BITMASK(ZIP_SOURCE_ACCEPT_EMPTY)) == 0) { if (ZIP_SOURCE_IS_LAYERED(src)) { @@ -46,7 +46,7 @@ zip_source_accept_empty(zip_source_t *src) { return true; } - ret = (int)_zip_source_call(src, NULL, 0, ZIP_SOURCE_ACCEPT_EMPTY); + ret = _zip_source_call(src, NULL, 0, ZIP_SOURCE_ACCEPT_EMPTY); return ret != 0; } diff --git a/core/deps/libzip/lib/zip_source_begin_write.c b/core/deps/libzip/lib/zip_source_begin_write.c index 3981dc1f9..4a9d5d5d6 100644 --- a/core/deps/libzip/lib/zip_source_begin_write.c +++ b/core/deps/libzip/lib/zip_source_begin_write.c @@ -1,9 +1,9 @@ /* zip_source_begin_write.c -- start a new file for writing - Copyright (C) 2014-2020 Dieter Baron and Thomas Klausner + Copyright (C) 2014-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -37,6 +37,11 @@ ZIP_EXTERN int zip_source_begin_write(zip_source_t *src) { + if (ZIP_SOURCE_IS_LAYERED(src)) { + zip_error_set(&src->error, ZIP_ER_OPNOTSUPP, 0); + return -1; + } + if (ZIP_SOURCE_IS_OPEN_WRITING(src)) { zip_error_set(&src->error, ZIP_ER_INVAL, 0); return -1; diff --git a/core/deps/libzip/lib/zip_source_begin_write_cloning.c b/core/deps/libzip/lib/zip_source_begin_write_cloning.c index bfc63c8a6..df195fcd4 100644 --- a/core/deps/libzip/lib/zip_source_begin_write_cloning.c +++ b/core/deps/libzip/lib/zip_source_begin_write_cloning.c @@ -1,9 +1,9 @@ /* zip_source_begin_write_cloning.c -- clone part of file for writing - Copyright (C) 2017-2020 Dieter Baron and Thomas Klausner + Copyright (C) 2017-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -37,6 +37,11 @@ ZIP_EXTERN int zip_source_begin_write_cloning(zip_source_t *src, zip_uint64_t offset) { + if (ZIP_SOURCE_IS_LAYERED(src)) { + zip_error_set(&src->error, ZIP_ER_OPNOTSUPP, 0); + return -1; + } + if (ZIP_SOURCE_IS_OPEN_WRITING(src)) { zip_error_set(&src->error, ZIP_ER_INVAL, 0); return -1; diff --git a/core/deps/libzip/lib/zip_source_buffer.c b/core/deps/libzip/lib/zip_source_buffer.c index a54c4fc84..566729325 100644 --- a/core/deps/libzip/lib/zip_source_buffer.c +++ b/core/deps/libzip/lib/zip_source_buffer.c @@ -1,9 +1,9 @@ /* zip_source_buffer.c -- create zip data source from buffer - Copyright (C) 1999-2020 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 + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -50,8 +50,8 @@ struct buffer { zip_uint64_t shared_fragments; /* number of shared fragments */ struct buffer *shared_buffer; /* buffer fragments are shared with */ - zip_uint64_t size; /* size of buffer */ + zip_uint64_t size; /* size of buffer */ zip_uint64_t offset; /* current offset in buffer */ zip_uint64_t current_fragment; /* fragment current offset is in */ }; @@ -159,7 +159,7 @@ zip_source_buffer_fragment_with_attributes_create(const zip_buffer_fragment_t *f ctx->out = NULL; ctx->mtime = time(NULL); if (attributes) { - memcpy(&ctx->attributes, attributes, sizeof(ctx->attributes)); + (void)memcpy_s(&ctx->attributes, sizeof(ctx->attributes), attributes, sizeof(ctx->attributes)); } else { zip_file_attributes_init(&ctx->attributes); @@ -226,7 +226,7 @@ read_data(void *state, void *data, zip_uint64_t len, zip_source_cmd_t cmd) { return -1; } - memcpy(data, &ctx->attributes, sizeof(ctx->attributes)); + (void)memcpy_s(data, sizeof(ctx->attributes), &ctx->attributes, sizeof(ctx->attributes)); return sizeof(ctx->attributes); } @@ -287,7 +287,7 @@ read_data(void *state, void *data, zip_uint64_t len, zip_source_cmd_t cmd) { } case ZIP_SOURCE_SUPPORTS: - return zip_source_make_command_bitmap(ZIP_SOURCE_GET_FILE_ATTRIBUTES, ZIP_SOURCE_OPEN, ZIP_SOURCE_READ, ZIP_SOURCE_CLOSE, ZIP_SOURCE_STAT, ZIP_SOURCE_ERROR, ZIP_SOURCE_FREE, ZIP_SOURCE_SEEK, ZIP_SOURCE_TELL, ZIP_SOURCE_BEGIN_WRITE, ZIP_SOURCE_BEGIN_WRITE_CLONING, ZIP_SOURCE_COMMIT_WRITE, ZIP_SOURCE_REMOVE, ZIP_SOURCE_ROLLBACK_WRITE, ZIP_SOURCE_SEEK_WRITE, ZIP_SOURCE_TELL_WRITE, ZIP_SOURCE_WRITE, -1); + return zip_source_make_command_bitmap(ZIP_SOURCE_GET_FILE_ATTRIBUTES, ZIP_SOURCE_OPEN, ZIP_SOURCE_READ, ZIP_SOURCE_CLOSE, ZIP_SOURCE_STAT, ZIP_SOURCE_ERROR, ZIP_SOURCE_FREE, ZIP_SOURCE_SEEK, ZIP_SOURCE_TELL, ZIP_SOURCE_BEGIN_WRITE, ZIP_SOURCE_BEGIN_WRITE_CLONING, ZIP_SOURCE_COMMIT_WRITE, ZIP_SOURCE_REMOVE, ZIP_SOURCE_ROLLBACK_WRITE, ZIP_SOURCE_SEEK_WRITE, ZIP_SOURCE_TELL_WRITE, ZIP_SOURCE_WRITE, ZIP_SOURCE_SUPPORTS_REOPEN, -1); case ZIP_SOURCE_TELL: if (ctx->in->offset > ZIP_INT64_MAX) { @@ -344,6 +344,7 @@ buffer_clone(buffer_t *buffer, zip_uint64_t offset, zip_error_t *error) { fragment_offset = buffer->fragments[fragment].length; } + /* TODO: This should also consider the length of the fully shared fragments */ waste = buffer->fragments[fragment].length - fragment_offset; if (waste > offset) { zip_error_set(error, ZIP_ER_OPNOTSUPP, 0); @@ -356,18 +357,18 @@ buffer_clone(buffer_t *buffer, zip_uint64_t offset, zip_error_t *error) { #ifndef __clang_analyzer__ /* clone->fragments can't be null, since it was created with at least one fragment */ - clone->fragments[clone->nfragments - 1].length = fragment_offset; + clone->fragments[fragment].length = fragment_offset; #endif clone->fragment_offsets[clone->nfragments] = offset; clone->size = offset; - clone->first_owned_fragment = ZIP_MIN(buffer->first_owned_fragment, clone->nfragments - 1); + clone->first_owned_fragment = ZIP_MIN(buffer->first_owned_fragment, clone->nfragments); buffer->shared_buffer = clone; clone->shared_buffer = buffer; - buffer->shared_fragments = clone->nfragments; + buffer->shared_fragments = fragment + 1; clone->shared_fragments = fragment + 1; - + return clone; } @@ -376,6 +377,10 @@ static zip_uint64_t buffer_find_fragment(const buffer_t *buffer, zip_uint64_t offset) { zip_uint64_t low, high, mid; + if (buffer->nfragments == 0) { + return 0; + } + low = 0; high = buffer->nfragments - 1; @@ -429,12 +434,20 @@ buffer_grow_fragments(buffer_t *buffer, zip_uint64_t capacity, zip_error_t *erro return true; } - if ((fragments = realloc(buffer->fragments, sizeof(buffer->fragments[0]) * capacity)) == NULL) { + zip_uint64_t fragments_size = sizeof(buffer->fragments[0]) * capacity; + zip_uint64_t offsets_size = sizeof(buffer->fragment_offsets[0]) * (capacity + 1); + + if (capacity == ZIP_UINT64_MAX || fragments_size < capacity || fragments_size > SIZE_MAX|| offsets_size < capacity || offsets_size > SIZE_MAX) { + zip_error_set(error, ZIP_ER_MEMORY, 0); + return false; + } + + if ((fragments = realloc(buffer->fragments, (size_t)fragments_size)) == NULL) { zip_error_set(error, ZIP_ER_MEMORY, 0); return false; } buffer->fragments = fragments; - if ((offsets = realloc(buffer->fragment_offsets, sizeof(buffer->fragment_offsets[0]) * (capacity + 1))) == NULL) { + if ((offsets = realloc(buffer->fragment_offsets, (size_t)offsets_size)) == NULL) { zip_error_set(error, ZIP_ER_MEMORY, 0); return false; } @@ -493,6 +506,7 @@ buffer_new(const zip_buffer_fragment_t *fragments, zip_uint64_t nfragments, int buffer->fragments[j].data = fragments[i].data; buffer->fragments[j].length = fragments[i].length; buffer->fragment_offsets[i] = offset; + /* TODO: overflow */ offset += fragments[i].length; j++; } @@ -523,8 +537,11 @@ buffer_read(buffer_t *buffer, zip_uint8_t *data, zip_uint64_t length) { n = 0; while (n < length) { zip_uint64_t left = ZIP_MIN(length - n, buffer->fragments[i].length - fragment_offset); +#if ZIP_UINT64_MAX > SIZE_MAX + left = ZIP_MIN(left, SIZE_MAX); +#endif - memcpy(data + n, buffer->fragments[i].data + fragment_offset, left); + (void)memcpy_s(data + n, (size_t)left, buffer->fragments[i].data + fragment_offset, (size_t)left); if (left == buffer->fragments[i].length - fragment_offset) { i++; @@ -555,7 +572,7 @@ buffer_seek(buffer_t *buffer, void *data, zip_uint64_t len, zip_error_t *error) static zip_int64_t buffer_write(buffer_t *buffer, const zip_uint8_t *data, zip_uint64_t length, zip_error_t *error) { - zip_uint64_t n, i, fragment_offset, capacity; + zip_uint64_t copied, i, fragment_offset, capacity; if (buffer->offset + length + WRITE_FRAGMENT_SIZE - 1 < length) { zip_error_set(error, ZIP_ER_INVAL, 0); @@ -597,24 +614,30 @@ buffer_write(buffer_t *buffer, const zip_uint8_t *data, zip_uint64_t length, zip i = buffer->current_fragment; fragment_offset = buffer->offset - buffer->fragment_offsets[i]; - n = 0; - while (n < length) { - zip_uint64_t left = ZIP_MIN(length - n, buffer->fragments[i].length - fragment_offset); + copied = 0; + while (copied < length) { + zip_uint64_t n = ZIP_MIN(ZIP_MIN(length - copied, buffer->fragments[i].length - fragment_offset), SIZE_MAX); +#if ZIP_UINT64_MAX > SIZE_MAX + n = ZIP_MIN(n, SIZE_MAX); +#endif - memcpy(buffer->fragments[i].data + fragment_offset, data + n, left); + (void)memcpy_s(buffer->fragments[i].data + fragment_offset, (size_t)n, data + copied, (size_t)n); - if (left == buffer->fragments[i].length - fragment_offset) { + if (n == buffer->fragments[i].length - fragment_offset) { i++; + fragment_offset = 0; } - n += left; - fragment_offset = 0; + else { + fragment_offset += n; + } + copied += n; } - buffer->offset += n; + buffer->offset += copied; buffer->current_fragment = i; if (buffer->offset > buffer->size) { buffer->size = buffer->offset; } - return (zip_int64_t)n; + return (zip_int64_t)copied; } diff --git a/core/deps/libzip/lib/zip_source_call.c b/core/deps/libzip/lib/zip_source_call.c index 66b13d6e4..8c98fc2ef 100644 --- a/core/deps/libzip/lib/zip_source_call.c +++ b/core/deps/libzip/lib/zip_source_call.c @@ -1,9 +1,9 @@ /* zip_source_call.c -- invoke callback command on zip_source - Copyright (C) 2009-2020 Dieter Baron and Thomas Klausner + Copyright (C) 2009-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/core/deps/libzip/lib/zip_source_close.c b/core/deps/libzip/lib/zip_source_close.c index 264e4b0d3..f4f3ff2b3 100644 --- a/core/deps/libzip/lib/zip_source_close.c +++ b/core/deps/libzip/lib/zip_source_close.c @@ -1,9 +1,9 @@ /* zip_source_close.c -- close zip_source (stop reading) - Copyright (C) 2009-2020 Dieter Baron and Thomas Klausner + Copyright (C) 2009-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/core/deps/libzip/lib/zip_source_commit_write.c b/core/deps/libzip/lib/zip_source_commit_write.c index ec8cd8bc3..d7f567b80 100644 --- a/core/deps/libzip/lib/zip_source_commit_write.c +++ b/core/deps/libzip/lib/zip_source_commit_write.c @@ -1,9 +1,9 @@ /* zip_source_commit_write.c -- commit changes to file - Copyright (C) 2014-2020 Dieter Baron and Thomas Klausner + Copyright (C) 2014-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -37,6 +37,11 @@ ZIP_EXTERN int zip_source_commit_write(zip_source_t *src) { + if (ZIP_SOURCE_IS_LAYERED(src)) { + zip_error_set(&src->error, ZIP_ER_OPNOTSUPP, 0); + return -1; + } + if (!ZIP_SOURCE_IS_OPEN_WRITING(src)) { zip_error_set(&src->error, ZIP_ER_INVAL, 0); return -1; diff --git a/core/deps/libzip/lib/zip_source_compress.c b/core/deps/libzip/lib/zip_source_compress.c index 35a022cc2..3cf709ffa 100644 --- a/core/deps/libzip/lib/zip_source_compress.c +++ b/core/deps/libzip/lib/zip_source_compress.c @@ -1,9 +1,9 @@ /* zip_source_compress.c -- (de)compression routines - Copyright (C) 2017-2020 Dieter Baron and Thomas Klausner + Copyright (C) 2017-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -83,10 +83,10 @@ static struct implementation implementations[] = { static size_t implementations_size = sizeof(implementations) / sizeof(implementations[0]); -static zip_source_t *compression_source_new(zip_t *za, zip_source_t *src, zip_int32_t method, bool compress, int compression_flags); +static zip_source_t *compression_source_new(zip_t *za, zip_source_t *src, zip_int32_t method, bool compress, zip_uint32_t compression_flags); static zip_int64_t compress_callback(zip_source_t *, void *, void *, zip_uint64_t, zip_source_cmd_t); static void context_free(struct context *ctx); -static struct context *context_new(zip_int32_t method, bool compress, int compression_flags, zip_compression_algorithm_t *algorithm); +static struct context *context_new(zip_int32_t method, bool compress, zip_uint32_t compression_flags, zip_compression_algorithm_t *algorithm); static zip_int64_t compress_read(zip_source_t *, struct context *, void *, zip_uint64_t); zip_compression_algorithm_t * @@ -117,7 +117,7 @@ zip_compression_method_supported(zip_int32_t method, int compress) { } zip_source_t * -zip_source_compress(zip_t *za, zip_source_t *src, zip_int32_t method, int compression_flags) { +zip_source_compress(zip_t *za, zip_source_t *src, zip_int32_t method, zip_uint32_t compression_flags) { return compression_source_new(za, src, method, true, compression_flags); } @@ -128,7 +128,7 @@ zip_source_decompress(zip_t *za, zip_source_t *src, zip_int32_t method) { static zip_source_t * -compression_source_new(zip_t *za, zip_source_t *src, zip_int32_t method, bool compress, int compression_flags) { +compression_source_new(zip_t *za, zip_source_t *src, zip_int32_t method, bool compress, zip_uint32_t compression_flags) { struct context *ctx; zip_source_t *s2; zip_compression_algorithm_t *algorithm = NULL; @@ -158,7 +158,7 @@ compression_source_new(zip_t *za, zip_source_t *src, zip_int32_t method, bool co static struct context * -context_new(zip_int32_t method, bool compress, int compression_flags, zip_compression_algorithm_t *algorithm) { +context_new(zip_int32_t method, bool compress, zip_uint32_t compression_flags, zip_compression_algorithm_t *algorithm) { struct context *ctx; if ((ctx = (struct context *)malloc(sizeof(*ctx))) == NULL) { @@ -240,7 +240,7 @@ compress_read(zip_source_t *src, struct context *ctx, void *data, zip_uint64_t l if (ctx->can_store && (zip_uint64_t)ctx->first_read <= out_offset) { ctx->is_stored = true; ctx->size = (zip_uint64_t)ctx->first_read; - memcpy(data, ctx->buffer, ctx->size); + (void)memcpy_s(data, ctx->size, ctx->buffer, ctx->size); return (zip_int64_t)ctx->size; } end = true; @@ -257,7 +257,7 @@ compress_read(zip_source_t *src, struct context *ctx, void *data, zip_uint64_t l } if ((n = zip_source_read(src, ctx->buffer, sizeof(ctx->buffer))) < 0) { - _zip_error_set_from_source(&ctx->error, src); + zip_error_set_from_source(&ctx->error, src); end = true; break; } @@ -319,7 +319,7 @@ compress_callback(zip_source_t *src, void *ud, void *data, zip_uint64_t len, zip ctx->first_read = -1; if (zip_source_stat(src, &st) < 0 || zip_source_get_file_attributes(src, &attributes) < 0) { - _zip_error_set_from_source(&ctx->error, src); + zip_error_set_from_source(&ctx->error, src); return -1; } @@ -357,6 +357,7 @@ compress_callback(zip_source_t *src, void *ud, void *data, zip_uint64_t len, zip else { st->comp_method = ZIP_CM_STORE; st->valid |= ZIP_STAT_COMP_METHOD; + st->valid &= ~ZIP_STAT_COMP_SIZE; if (ctx->end_of_stream) { st->size = ctx->size; st->valid |= ZIP_STAT_SIZE; @@ -389,10 +390,9 @@ compress_callback(zip_source_t *src, void *ud, void *data, zip_uint64_t len, zip } case ZIP_SOURCE_SUPPORTS: - return ZIP_SOURCE_SUPPORTS_READABLE | zip_source_make_command_bitmap(ZIP_SOURCE_GET_FILE_ATTRIBUTES, -1); + return ZIP_SOURCE_SUPPORTS_READABLE | zip_source_make_command_bitmap(ZIP_SOURCE_GET_FILE_ATTRIBUTES, ZIP_SOURCE_SUPPORTS_REOPEN, -1); default: - zip_error_set(&ctx->error, ZIP_ER_INTERNAL, 0); - return -1; + return zip_source_pass_to_lower_layer(src, data, len, cmd); } } diff --git a/core/deps/libzip/lib/zip_source_crc.c b/core/deps/libzip/lib/zip_source_crc.c index cae73635a..435a084b7 100644 --- a/core/deps/libzip/lib/zip_source_crc.c +++ b/core/deps/libzip/lib/zip_source_crc.c @@ -1,9 +1,9 @@ /* zip_source_crc.c -- pass-through source that calculates CRC32 and size - Copyright (C) 2009-2020 Dieter Baron and Thomas Klausner + Copyright (C) 2009-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -52,16 +52,16 @@ static zip_int64_t crc_read(zip_source_t *, void *, void *, zip_uint64_t, zip_so zip_source_t * -zip_source_crc(zip_t *za, zip_source_t *src, int validate) { +zip_source_crc_create(zip_source_t *src, int validate, zip_error_t *error) { struct crc_context *ctx; if (src == NULL) { - zip_error_set(&za->error, ZIP_ER_INVAL, 0); + zip_error_set(error, ZIP_ER_INVAL, 0); return NULL; } if ((ctx = (struct crc_context *)malloc(sizeof(*ctx))) == NULL) { - zip_error_set(&za->error, ZIP_ER_MEMORY, 0); + zip_error_set(error, ZIP_ER_MEMORY, 0); return NULL; } @@ -72,7 +72,7 @@ zip_source_crc(zip_t *za, zip_source_t *src, int validate) { ctx->crc = (zip_uint32_t)crc32(0, NULL, 0); ctx->size = 0; - return zip_source_layered(za, src, crc_read, ctx); + return zip_source_layered_create(src, crc_read, ctx, error); } @@ -90,7 +90,7 @@ crc_read(zip_source_t *src, void *_ctx, void *data, zip_uint64_t len, zip_source case ZIP_SOURCE_READ: if ((n = zip_source_read(src, data, len)) < 0) { - _zip_error_set_from_source(&ctx->error, src); + zip_error_set_from_source(&ctx->error, src); return -1; } @@ -103,7 +103,7 @@ crc_read(zip_source_t *src, void *_ctx, void *data, zip_uint64_t len, zip_source struct zip_stat st; if (zip_source_stat(src, &st) < 0) { - _zip_error_set_from_source(&ctx->error, src); + zip_error_set_from_source(&ctx->error, src); return -1; } @@ -112,7 +112,8 @@ crc_read(zip_source_t *src, void *_ctx, void *data, zip_uint64_t len, zip_source return -1; } if ((st.valid & ZIP_STAT_SIZE) && st.size != ctx->size) { - zip_error_set(&ctx->error, ZIP_ER_INCONS, 0); + /* We don't have the index here, but the caller should know which file they are reading from. */ + zip_error_set(&ctx->error, ZIP_ER_INCONS, MAKE_DETAIL_WITH_INDEX(ZIP_ER_DETAIL_INVALID_FILE_LENGTH, MAX_DETAIL_INDEX)); return -1; } } @@ -140,6 +141,10 @@ crc_read(zip_source_t *src, void *_ctx, void *data, zip_uint64_t len, zip_source st = (zip_stat_t *)data; if (ctx->crc_complete) { + if ((st->valid & ZIP_STAT_SIZE) && st->size != ctx->size) { + zip_error_set(&ctx->error, ZIP_ER_DATA_LENGTH, 0); + return -1; + } /* TODO: Set comp_size, comp_method, encryption_method? After all, this only works for uncompressed data. */ st->size = ctx->size; @@ -163,11 +168,13 @@ crc_read(zip_source_t *src, void *_ctx, void *data, zip_uint64_t len, zip_source zip_int64_t mask = zip_source_supports(src); if (mask < 0) { - _zip_error_set_from_source(&ctx->error, src); + zip_error_set_from_source(&ctx->error, src); return -1; } - return mask & ~zip_source_make_command_bitmap(ZIP_SOURCE_BEGIN_WRITE, ZIP_SOURCE_COMMIT_WRITE, ZIP_SOURCE_ROLLBACK_WRITE, ZIP_SOURCE_SEEK_WRITE, ZIP_SOURCE_TELL_WRITE, ZIP_SOURCE_REMOVE, ZIP_SOURCE_GET_FILE_ATTRIBUTES, -1); + mask &= ~zip_source_make_command_bitmap(ZIP_SOURCE_BEGIN_WRITE, ZIP_SOURCE_COMMIT_WRITE, ZIP_SOURCE_ROLLBACK_WRITE, ZIP_SOURCE_SEEK_WRITE, ZIP_SOURCE_TELL_WRITE, ZIP_SOURCE_REMOVE, ZIP_SOURCE_GET_FILE_ATTRIBUTES, -1); + mask |= zip_source_make_command_bitmap(ZIP_SOURCE_FREE, -1); + return mask; } case ZIP_SOURCE_SEEK: { @@ -178,7 +185,7 @@ crc_read(zip_source_t *src, void *_ctx, void *data, zip_uint64_t len, zip_source return -1; } if (zip_source_seek(src, args->offset, args->whence) < 0 || (new_position = zip_source_tell(src)) < 0) { - _zip_error_set_from_source(&ctx->error, src); + zip_error_set_from_source(&ctx->error, src); return -1; } @@ -191,7 +198,6 @@ crc_read(zip_source_t *src, void *_ctx, void *data, zip_uint64_t len, zip_source return (zip_int64_t)ctx->position; default: - zip_error_set(&ctx->error, ZIP_ER_OPNOTSUPP, 0); - return -1; + return zip_source_pass_to_lower_layer(src, data, len, cmd); } } diff --git a/core/deps/libzip/lib/zip_source_error.c b/core/deps/libzip/lib/zip_source_error.c index 00998e839..dc7fa20cb 100644 --- a/core/deps/libzip/lib/zip_source_error.c +++ b/core/deps/libzip/lib/zip_source_error.c @@ -1,9 +1,9 @@ /* zip_source_error.c -- get last error from zip_source - Copyright (C) 2009-2020 Dieter Baron and Thomas Klausner + Copyright (C) 2009-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/core/deps/libzip/lib/zip_source_file.h b/core/deps/libzip/lib/zip_source_file.h index 43a464533..cca9fd2b5 100644 --- a/core/deps/libzip/lib/zip_source_file.h +++ b/core/deps/libzip/lib/zip_source_file.h @@ -1,9 +1,9 @@ /* zip_source_file.h -- header for common file operations - Copyright (C) 2020 Dieter Baron and Thomas Klausner + Copyright (C) 2020-2022 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -34,7 +34,7 @@ struct zip_source_file_stat { zip_uint64_t size; /* must be valid for regular files */ time_t mtime; /* must always be valid, is initialized to current time */ - bool exists; /* must always be vaild */ + bool exists; /* must always be valid */ bool regular_file; /* must always be valid */ }; diff --git a/core/deps/libzip/lib/zip_source_file_common.c b/core/deps/libzip/lib/zip_source_file_common.c index 32414361b..6c58320f1 100644 --- a/core/deps/libzip/lib/zip_source_file_common.c +++ b/core/deps/libzip/lib/zip_source_file_common.c @@ -1,9 +1,9 @@ /* zip_source_file_common.c -- create data source from file - Copyright (C) 1999-2020 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -54,6 +54,7 @@ zip_source_file_common_new(const char *fname, void *file, zip_uint64_t start, zi zip_source_file_context_t *ctx; zip_source_t *zs; zip_source_file_stat_t sb; + zip_uint64_t length; if (ops == NULL) { zip_error_set(error, ZIP_ER_INVAL, 0); @@ -82,10 +83,17 @@ zip_source_file_common_new(const char *fname, void *file, zip_uint64_t start, zi } if (len < 0) { - len = 0; + if (len == -1) { + len = ZIP_LENGTH_TO_END; + } + // TODO: return ZIP_ER_INVAL if len != ZIP_LENGTH_UNCHECKED? + length = 0; + } + else { + length = (zip_uint64_t)len; } - if (start > ZIP_INT64_MAX || start + (zip_uint64_t)len < start) { + if (start > ZIP_INT64_MAX || start + length < start) { zip_error_set(error, ZIP_ER_INVAL, 0); return NULL; } @@ -107,9 +115,9 @@ zip_source_file_common_new(const char *fname, void *file, zip_uint64_t start, zi } ctx->f = file; ctx->start = start; - ctx->len = (zip_uint64_t)len; + ctx->len = length; if (st) { - memcpy(&ctx->st, st, sizeof(ctx->st)); + (void)memcpy_s(&ctx->st, sizeof(ctx->st), st, sizeof(*st)); ctx->st.name = NULL; ctx->st.valid &= ~ZIP_STAT_NAME; } @@ -130,7 +138,7 @@ zip_source_file_common_new(const char *fname, void *file, zip_uint64_t start, zi zip_error_init(&ctx->error); zip_file_attributes_init(&ctx->attributes); - ctx->supports = ZIP_SOURCE_SUPPORTS_READABLE | zip_source_make_command_bitmap(ZIP_SOURCE_SUPPORTS, ZIP_SOURCE_TELL, -1); + ctx->supports = ZIP_SOURCE_SUPPORTS_READABLE | zip_source_make_command_bitmap(ZIP_SOURCE_SUPPORTS, ZIP_SOURCE_TELL, ZIP_SOURCE_SUPPORTS_REOPEN, -1); zip_source_file_stat_init(&sb); if (!ops->stat(ctx, &sb)) { @@ -169,9 +177,11 @@ zip_source_file_common_new(const char *fname, void *file, zip_uint64_t start, zi } if (ctx->len == 0) { - ctx->len = sb.size - ctx->start; - ctx->st.size = ctx->len; - ctx->st.valid |= ZIP_STAT_SIZE; + if (len != ZIP_LENGTH_UNCHECKED) { + ctx->len = sb.size - ctx->start; + ctx->st.size = ctx->len; + ctx->st.valid |= ZIP_STAT_SIZE; + } /* when using a partial file, don't allow writing */ if (ctx->fname && start == 0 && ops->write != NULL) { @@ -262,7 +272,7 @@ read_file(void *state, void *data, zip_uint64_t len, zip_source_cmd_t cmd) { zip_error_set(&ctx->error, ZIP_ER_INVAL, 0); return -1; } - memcpy(data, &ctx->attributes, sizeof(ctx->attributes)); + (void)memcpy_s(data, sizeof(ctx->attributes), &ctx->attributes, sizeof(ctx->attributes)); return sizeof(ctx->attributes); case ZIP_SOURCE_OPEN: @@ -272,7 +282,7 @@ read_file(void *state, void *data, zip_uint64_t len, zip_source_cmd_t cmd) { } } - if (ctx->start > 0) { // TODO: rewind on re-open + if (ctx->start > 0) { /* TODO: rewind on re-open */ if (ctx->ops->seek(ctx, ctx->f, (zip_int64_t)ctx->start, SEEK_SET) == false) { /* TODO: skip by reading */ return -1; @@ -355,7 +365,7 @@ read_file(void *state, void *data, zip_uint64_t len, zip_source_cmd_t cmd) { return -1; } - memcpy(data, &ctx->st, sizeof(ctx->st)); + (void)memcpy_s(data, sizeof(ctx->st), &ctx->st, sizeof(ctx->st)); return sizeof(ctx->st); } diff --git a/core/deps/libzip/lib/zip_source_file_stdio.c b/core/deps/libzip/lib/zip_source_file_stdio.c index 15817716c..6dcc56399 100644 --- a/core/deps/libzip/lib/zip_source_file_stdio.c +++ b/core/deps/libzip/lib/zip_source_file_stdio.c @@ -3,7 +3,7 @@ Copyright (C) 2020 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -78,7 +78,7 @@ zip_source_filep(zip_t *za, FILE *file, zip_uint64_t start, zip_int64_t len) { ZIP_EXTERN zip_source_t * zip_source_filep_create(FILE *file, zip_uint64_t start, zip_int64_t length, zip_error_t *error) { - if (file == NULL || length < -1) { + if (file == NULL || length < ZIP_LENGTH_UNCHECKED) { zip_error_set(error, ZIP_ER_INVAL, 0); return NULL; } @@ -176,33 +176,3 @@ _zip_stdio_op_tell(zip_source_file_context_t *ctx, void *f) { return offset; } - - -/* - * fopen replacement that sets the close-on-exec flag - * some implementations support an fopen 'e' flag for that, - * but e.g. macOS doesn't. - */ -FILE * -_zip_fopen_close_on_exec(const char *name, bool writeable) { - int fd; - int flags; - FILE *fp; - - flags = O_CLOEXEC; - if (writeable) { - flags |= O_RDWR; - } - else { - flags |= O_RDONLY; - } - - /* mode argument needed on Windows */ - if ((fd = open(name, flags, 0666)) < 0) { - return NULL; - } - if ((fp = fdopen(fd, writeable ? "r+b" : "rb")) == NULL) { - return NULL; - } - return fp; -} diff --git a/core/deps/libzip/lib/zip_source_file_stdio.h b/core/deps/libzip/lib/zip_source_file_stdio.h index 1bf698ce2..802e6071f 100644 --- a/core/deps/libzip/lib/zip_source_file_stdio.h +++ b/core/deps/libzip/lib/zip_source_file_stdio.h @@ -6,7 +6,7 @@ Copyright (C) 2020 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -42,6 +42,4 @@ bool _zip_stdio_op_seek(zip_source_file_context_t *ctx, void *f, zip_int64_t off bool _zip_stdio_op_stat(zip_source_file_context_t *ctx, zip_source_file_stat_t *st); zip_int64_t _zip_stdio_op_tell(zip_source_file_context_t *ctx, void *f); -FILE *_zip_fopen_close_on_exec(const char *name, bool writeable); - #endif /* _HAD_ZIP_SOURCE_FILE_STDIO_H */ diff --git a/core/deps/libzip/lib/zip_source_file_stdio_named.c b/core/deps/libzip/lib/zip_source_file_stdio_named.c index 5387c7663..1495d7dde 100644 --- a/core/deps/libzip/lib/zip_source_file_stdio_named.c +++ b/core/deps/libzip/lib/zip_source_file_stdio_named.c @@ -1,9 +1,9 @@ /* zip_source_file_stdio_named.c -- source for stdio file opened by name - Copyright (C) 1999-2020 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 + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -36,6 +36,7 @@ #include "zip_source_file.h" #include "zip_source_file_stdio.h" +#include #include #include #ifdef HAVE_UNISTD_H @@ -53,6 +54,8 @@ #define CAN_CLONE #endif +static int create_temp_file(zip_source_file_context_t *ctx, bool create_file); + static zip_int64_t _zip_stdio_op_commit_write(zip_source_file_context_t *ctx); static zip_int64_t _zip_stdio_op_create_temp_output(zip_source_file_context_t *ctx); #ifdef CAN_CLONE @@ -63,6 +66,7 @@ static zip_int64_t _zip_stdio_op_remove(zip_source_file_context_t *ctx); static void _zip_stdio_op_rollback_write(zip_source_file_context_t *ctx); static char *_zip_stdio_op_strdup(zip_source_file_context_t *ctx, const char *string); static zip_int64_t _zip_stdio_op_write(zip_source_file_context_t *ctx, const void *data, zip_uint64_t len); +static FILE *_zip_fopen_close_on_exec(const char *name, bool writeable); /* clang-format off */ static zip_source_file_operations_t ops_stdio_named = { @@ -97,7 +101,7 @@ zip_source_file(zip_t *za, const char *fname, zip_uint64_t start, zip_int64_t le ZIP_EXTERN zip_source_t * zip_source_file_create(const char *fname, zip_uint64_t start, zip_int64_t length, zip_error_t *error) { - if (fname == NULL || length < -1) { + if (fname == NULL || length < ZIP_LENGTH_UNCHECKED) { zip_error_set(error, ZIP_ER_INVAL, 0); return NULL; } @@ -123,82 +127,51 @@ _zip_stdio_op_commit_write(zip_source_file_context_t *ctx) { static zip_int64_t _zip_stdio_op_create_temp_output(zip_source_file_context_t *ctx) { - char *temp; - int tfd; - int mode; - FILE *tfp; - struct stat st; - - if ((temp = (char *)malloc(strlen(ctx->fname) + 8)) == NULL) { - zip_error_set(&ctx->error, ZIP_ER_MEMORY, 0); - return -1; - } - - if (stat(ctx->fname, &st) == 0) { - mode = st.st_mode; - } - else { - mode = -1; - } - - sprintf(temp, "%s.XXXXXX", ctx->fname); - - if ((tfd = _zip_mkstempm(temp, mode)) == -1) { - zip_error_set(&ctx->error, ZIP_ER_TMPOPEN, errno); - free(temp); + int fd = create_temp_file(ctx, true); + + if (fd < 0) { return -1; } - - if ((tfp = fdopen(tfd, "r+b")) == NULL) { + + if ((ctx->fout = fdopen(fd, "r+b")) == NULL) { zip_error_set(&ctx->error, ZIP_ER_TMPOPEN, errno); - close(tfd); - (void)remove(temp); - free(temp); + close(fd); + (void)remove(ctx->tmpname); + free(ctx->tmpname); + ctx->tmpname = NULL; return -1; } - ctx->fout = tfp; - ctx->tmpname = temp; - return 0; } #ifdef CAN_CLONE static zip_int64_t _zip_stdio_op_create_temp_output_cloning(zip_source_file_context_t *ctx, zip_uint64_t offset) { - char *temp; FILE *tfp; - + if (offset > ZIP_OFF_MAX) { zip_error_set(&ctx->error, ZIP_ER_SEEK, E2BIG); return -1; } - - if ((temp = (char *)malloc(strlen(ctx->fname) + 8)) == NULL) { - zip_error_set(&ctx->error, ZIP_ER_MEMORY, 0); - return -1; - } - sprintf(temp, "%s.XXXXXX", ctx->fname); - + #ifdef HAVE_CLONEFILE -#ifndef __clang_analyzer__ - /* we can't use mkstemp, since clonefile insists on creating the file */ - if (mktemp(temp) == NULL) { - zip_error_set(&ctx->error, ZIP_ER_TMPOPEN, errno); - free(temp); + /* clonefile insists on creating the file, so just create a name */ + if (create_temp_file(ctx, false) < 0) { return -1; } -#endif - - if (clonefile(ctx->fname, temp, 0) < 0) { + + if (clonefile(ctx->fname, ctx->tmpname, 0) < 0) { zip_error_set(&ctx->error, ZIP_ER_TMPOPEN, errno); - free(temp); + free(ctx->tmpname); + ctx->tmpname = NULL; return -1; } - if ((tfp = _zip_fopen_close_on_exec(temp, true)) == NULL) { + if ((tfp = _zip_fopen_close_on_exec(ctx->tmpname, true)) == NULL) { zip_error_set(&ctx->error, ZIP_ER_TMPOPEN, errno); - (void)remove(temp); - free(temp); + (void)remove(ctx->tmpname); + free(ctx->tmpname); + ctx->tmpname = NULL; return -1; } #else @@ -206,19 +179,16 @@ _zip_stdio_op_create_temp_output_cloning(zip_source_file_context_t *ctx, zip_uin int fd; struct file_clone_range range; struct stat st; - + if (fstat(fileno(ctx->f), &st) < 0) { zip_error_set(&ctx->error, ZIP_ER_TMPOPEN, errno); - free(temp); return -1; } - - if ((fd = mkstemp(temp)) < 0) { - zip_error_set(&ctx->error, ZIP_ER_TMPOPEN, errno); - free(temp); + + if ((fd = create_temp_file(ctx, true)) < 0) { return -1; } - + range.src_fd = fileno(ctx->f); range.src_offset = 0; range.src_length = ((offset + st.st_blksize - 1) / st.st_blksize) * st.st_blksize; @@ -229,16 +199,18 @@ _zip_stdio_op_create_temp_output_cloning(zip_source_file_context_t *ctx, zip_uin if (ioctl(fd, FICLONERANGE, &range) < 0) { zip_error_set(&ctx->error, ZIP_ER_TMPOPEN, errno); (void)close(fd); - (void)remove(temp); - free(temp); + (void)remove(ctx->tmpname); + free(ctx->tmpname); + ctx->tmpname = NULL; return -1; } if ((tfp = fdopen(fd, "r+b")) == NULL) { zip_error_set(&ctx->error, ZIP_ER_TMPOPEN, errno); (void)close(fd); - (void)remove(temp); - free(temp); + (void)remove(ctx->tmpname); + free(ctx->tmpname); + ctx->tmpname = NULL; return -1; } } @@ -246,19 +218,21 @@ _zip_stdio_op_create_temp_output_cloning(zip_source_file_context_t *ctx, zip_uin if (ftruncate(fileno(tfp), (off_t)offset) < 0) { (void)fclose(tfp); - (void)remove(temp); - free(temp); + (void)remove(ctx->tmpname); + free(ctx->tmpname); + ctx->tmpname = NULL; return -1; } if (fseeko(tfp, (off_t)offset, SEEK_SET) < 0) { - (void)fclose(tfp); - (void)remove(temp); - free(temp); zip_error_set(&ctx->error, ZIP_ER_TMPOPEN, errno); + (void)fclose(tfp); + (void)remove(ctx->tmpname); + free(ctx->tmpname); + ctx->tmpname = NULL; + return -1; } ctx->fout = tfp; - ctx->tmpname = temp; return 0; } @@ -311,3 +285,108 @@ _zip_stdio_op_write(zip_source_file_context_t *ctx, const void *data, zip_uint64 return (zip_int64_t)ret; } + + +static int create_temp_file(zip_source_file_context_t *ctx, bool create_file) { + char *temp; + int mode; + struct stat st; + int fd = 0; + char *start, *end; + + if (stat(ctx->fname, &st) == 0) { + mode = st.st_mode; + } + else { + mode = -1; + } + + size_t temp_size = strlen(ctx->fname) + 13; + if ((temp = (char *)malloc(temp_size)) == NULL) { + zip_error_set(&ctx->error, ZIP_ER_MEMORY, 0); + return -1; + } + snprintf_s(temp, temp_size, "%s.XXXXXX.part", ctx->fname); + end = temp + strlen(temp) - 5; + start = end - 6; + + for (;;) { + zip_uint32_t value = zip_random_uint32(); + char *xs = start; + + while (xs < end) { + char digit = value % 36; + if (digit < 10) { + *(xs++) = digit + '0'; + } + else { + *(xs++) = digit - 10 + 'a'; + } + value /= 36; + } + + if (create_file) { + if ((fd = open(temp, O_CREAT | O_EXCL | O_RDWR | O_CLOEXEC, mode == -1 ? 0666 : (mode_t)mode)) >= 0) { + if (mode != -1) { + /* open() honors umask(), which we don't want in this case */ +#ifdef HAVE_FCHMOD + (void)fchmod(fd, (mode_t)mode); +#else + (void)chmod(temp, (mode_t)mode); +#endif + } + break; + } + if (errno != EEXIST) { + zip_error_set(&ctx->error, ZIP_ER_TMPOPEN, errno); + free(temp); + return -1; + } + } + else { + if (stat(temp, &st) < 0) { + if (errno == ENOENT) { + break; + } + else { + zip_error_set(&ctx->error, ZIP_ER_TMPOPEN, errno); + free(temp); + return -1; + } + } + } + } + + ctx->tmpname = temp; + + return fd; /* initialized to 0 if !create_file */ +} + + +/* + * fopen replacement that sets the close-on-exec flag + * some implementations support an fopen 'e' flag for that, + * but e.g. macOS doesn't. + */ +static FILE *_zip_fopen_close_on_exec(const char *name, bool writeable) { + int fd; + int flags; + FILE *fp; + + flags = O_CLOEXEC; + if (writeable) { + flags |= O_RDWR; + } + else { + flags |= O_RDONLY; + } + + /* mode argument needed on Windows */ + if ((fd = open(name, flags, 0666)) < 0) { + return NULL; + } + if ((fp = fdopen(fd, writeable ? "r+b" : "rb")) == NULL) { + return NULL; + } + return fp; +} diff --git a/core/deps/libzip/lib/zip_source_file_win32.c b/core/deps/libzip/lib/zip_source_file_win32.c index 6547fc20e..624860b1c 100644 --- a/core/deps/libzip/lib/zip_source_file_win32.c +++ b/core/deps/libzip/lib/zip_source_file_win32.c @@ -1,9 +1,9 @@ /* zip_source_file_win32.c -- read-only Windows file source implementation - Copyright (C) 1999-2020 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 + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -69,7 +69,7 @@ zip_source_win32handle(zip_t *za, HANDLE h, zip_uint64_t start, zip_int64_t len) ZIP_EXTERN zip_source_t * zip_source_win32handle_create(HANDLE h, zip_uint64_t start, zip_int64_t length, zip_error_t *error) { - if (h == INVALID_HANDLE_VALUE || length < -1) { + if (h == INVALID_HANDLE_VALUE || length < ZIP_LENGTH_UNCHECKED) { zip_error_set(error, ZIP_ER_INVAL, 0); return NULL; } @@ -115,7 +115,7 @@ _zip_win32_op_seek(zip_source_file_context_t *ctx, void *f, zip_int64_t offset, break; default: zip_error_set(&ctx->error, ZIP_ER_SEEK, EINVAL); - return -1; + return false; } li.QuadPart = (LONGLONG)offset; @@ -184,7 +184,7 @@ _zip_stat_win32(zip_source_file_context_t *ctx, zip_source_file_stat_t *st, HAND zip_error_set(&ctx->error, ZIP_ER_READ, _zip_win32_error_to_errno(GetLastError())); return false; } - if (_zip_filetime_to_time_t(mtimeft, &mtime) < 0) { + if (!_zip_filetime_to_time_t(mtimeft, &mtime)) { zip_error_set(&ctx->error, ZIP_ER_READ, ERANGE); return false; } diff --git a/core/deps/libzip/lib/zip_source_file_win32.h b/core/deps/libzip/lib/zip_source_file_win32.h index 88e45b1f9..d86069eca 100644 --- a/core/deps/libzip/lib/zip_source_file_win32.h +++ b/core/deps/libzip/lib/zip_source_file_win32.h @@ -6,7 +6,7 @@ Copyright (C) 2020 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -73,4 +73,12 @@ zip_int64_t _zip_win32_op_tell(zip_source_file_context_t *ctx, void *f); bool _zip_filetime_to_time_t(FILETIME ft, time_t *t); int _zip_win32_error_to_errno(DWORD win32err); +#ifdef __clang__ +#define DONT_WARN_INCOMPATIBLE_FN_PTR_BEGIN _Pragma("GCC diagnostic push") _Pragma("GCC diagnostic ignored \"-Wincompatible-function-pointer-types\"") +#define DONT_WARN_INCOMPATIBLE_FN_PTR_END _Pragma("GCC diagnostic pop") +#else +#define DONT_WARN_INCOMPATIBLE_FN_PTR_BEGIN +#define DONT_WARN_INCOMPATIBLE_FN_PTR_END +#endif + #endif /* _HAD_ZIP_SOURCE_FILE_WIN32_H */ diff --git a/core/deps/libzip/lib/zip_source_file_win32_ansi.c b/core/deps/libzip/lib/zip_source_file_win32_ansi.c index f299692b8..58034cc2a 100644 --- a/core/deps/libzip/lib/zip_source_file_win32_ansi.c +++ b/core/deps/libzip/lib/zip_source_file_win32_ansi.c @@ -3,7 +3,7 @@ Copyright (C) 1999-2020 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -37,6 +37,7 @@ static char *ansi_allocate_tempname(const char *name, size_t extra_chars, size_t static void ansi_make_tempname(char *buf, size_t len, const char *name, zip_uint32_t i); /* clang-format off */ +DONT_WARN_INCOMPATIBLE_FN_PTR_BEGIN zip_win32_file_operations_t ops_ansi = { ansi_allocate_tempname, @@ -50,6 +51,7 @@ zip_win32_file_operations_t ops_ansi = { strdup }; +DONT_WARN_INCOMPATIBLE_FN_PTR_END /* clang-format on */ ZIP_EXTERN zip_source_t * @@ -63,7 +65,7 @@ zip_source_win32a(zip_t *za, const char *fname, zip_uint64_t start, zip_int64_t ZIP_EXTERN zip_source_t * zip_source_win32a_create(const char *fname, zip_uint64_t start, zip_int64_t length, zip_error_t *error) { - if (fname == NULL || length < -1) { + if (fname == NULL || length < ZIP_LENGTH_UNCHECKED) { zip_error_set(error, ZIP_ER_INVAL, 0); return NULL; } @@ -81,5 +83,5 @@ ansi_allocate_tempname(const char *name, size_t extra_chars, size_t *lengthp) { static void ansi_make_tempname(char *buf, size_t len, const char *name, zip_uint32_t i) { - snprintf(buf, len, "%s.%08x", name, i); + snprintf_s(buf, len, "%s.%08x", name, i); } diff --git a/core/deps/libzip/lib/zip_source_file_win32_named.c b/core/deps/libzip/lib/zip_source_file_win32_named.c index 1fe559180..855e605a9 100644 --- a/core/deps/libzip/lib/zip_source_file_win32_named.c +++ b/core/deps/libzip/lib/zip_source_file_win32_named.c @@ -3,7 +3,7 @@ Copyright (C) 1999-2020 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -99,7 +99,6 @@ _zip_win32_named_op_create_temp_output(zip_source_file_context_t *ctx) { zip_uint32_t value, i; HANDLE th = INVALID_HANDLE_VALUE; - void *temp = NULL; PSECURITY_DESCRIPTOR psd = NULL; PSECURITY_ATTRIBUTES psa = NULL; SECURITY_ATTRIBUTES sa; diff --git a/core/deps/libzip/lib/zip_source_file_win32_utf16.c b/core/deps/libzip/lib/zip_source_file_win32_utf16.c index 6aef2bb49..8f07d0210 100644 --- a/core/deps/libzip/lib/zip_source_file_win32_utf16.c +++ b/core/deps/libzip/lib/zip_source_file_win32_utf16.c @@ -3,7 +3,7 @@ Copyright (C) 1999-2020 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -39,6 +39,7 @@ static void utf16_make_tempname(char *buf, size_t len, const char *name, zip_uin static char *utf16_strdup(const char *string); /* clang-format off */ +DONT_WARN_INCOMPATIBLE_FN_PTR_BEGIN zip_win32_file_operations_t ops_utf16 = { utf16_allocate_tempname, @@ -52,6 +53,7 @@ zip_win32_file_operations_t ops_utf16 = { utf16_strdup }; +DONT_WARN_INCOMPATIBLE_FN_PTR_END /* clang-format on */ ZIP_EXTERN zip_source_t * @@ -65,7 +67,7 @@ zip_source_win32w(zip_t *za, const wchar_t *fname, zip_uint64_t start, zip_int64 ZIP_EXTERN zip_source_t * zip_source_win32w_create(const wchar_t *fname, zip_uint64_t start, zip_int64_t length, zip_error_t *error) { - if (fname == NULL || length < -1) { + if (fname == NULL || length < ZIP_LENGTH_UNCHECKED) { zip_error_set(error, ZIP_ER_INVAL, 0); return NULL; } @@ -101,7 +103,7 @@ static HANDLE __stdcall utf16_create_file(const char *name, DWORD access, DWORD static void utf16_make_tempname(char *buf, size_t len, const char *name, zip_uint32_t i) { - _snwprintf((wchar_t *)buf, len, L"%s.%08x", (const wchar_t *)name, i); + _snwprintf_s((wchar_t *)buf, len, len, L"%s.%08x", (const wchar_t *)name, i); } diff --git a/core/deps/libzip/lib/zip_source_file_win32_utf8.c b/core/deps/libzip/lib/zip_source_file_win32_utf8.c index d6728e34f..d154f97ae 100644 --- a/core/deps/libzip/lib/zip_source_file_win32_utf8.c +++ b/core/deps/libzip/lib/zip_source_file_win32_utf8.c @@ -3,7 +3,7 @@ Copyright (C) 1999-2020 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -49,7 +49,7 @@ zip_source_file_create(const char *fname, zip_uint64_t start, zip_int64_t length wchar_t *wfname; zip_source_t *source; - if (fname == NULL || length < -1) { + if (fname == NULL || length < ZIP_LENGTH_UNCHECKED) { zip_error_set(error, ZIP_ER_INVAL, 0); return NULL; } diff --git a/core/deps/libzip/lib/zip_source_free.c b/core/deps/libzip/lib/zip_source_free.c index 26504931e..1a800405c 100644 --- a/core/deps/libzip/lib/zip_source_free.c +++ b/core/deps/libzip/lib/zip_source_free.c @@ -1,9 +1,9 @@ /* zip_source_free.c -- free zip data source - Copyright (C) 1999-2020 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/core/deps/libzip/lib/zip_source_function.c b/core/deps/libzip/lib/zip_source_function.c index 5602f1d19..1fe6396e1 100644 --- a/core/deps/libzip/lib/zip_source_function.c +++ b/core/deps/libzip/lib/zip_source_function.c @@ -1,9 +1,9 @@ /* zip_source_function.c -- create zip data source from callback function - Copyright (C) 1999-2020 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 + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -61,6 +61,7 @@ zip_source_function_create(zip_source_callback zcb, void *ud, zip_error_t *error if (zs->supports < 0) { zs->supports = ZIP_SOURCE_SUPPORTS_READABLE; } + zs->supports |= zip_source_make_command_bitmap(ZIP_SOURCE_SUPPORTS, -1); return zs; } diff --git a/core/deps/libzip/lib/zip_source_get_file_attributes.c b/core/deps/libzip/lib/zip_source_get_file_attributes.c index 734767a0e..4771dc16b 100644 --- a/core/deps/libzip/lib/zip_source_get_file_attributes.c +++ b/core/deps/libzip/lib/zip_source_get_file_attributes.c @@ -3,7 +3,7 @@ Copyright (C) 2020 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -60,8 +60,10 @@ zip_source_get_file_attributes(zip_source_t *src, zip_file_attributes_t *attribu if (ZIP_SOURCE_IS_LAYERED(src)) { zip_file_attributes_t lower_attributes; + zip_file_attributes_init(&lower_attributes); + if (zip_source_get_file_attributes(src->src, &lower_attributes) < 0) { - _zip_error_set_from_source(&src->error, src->src); + zip_error_set_from_source(&src->error, src->src); return -1; } diff --git a/core/deps/libzip/lib/zip_source_is_deleted.c b/core/deps/libzip/lib/zip_source_is_deleted.c index 27c931fd4..838aa9096 100644 --- a/core/deps/libzip/lib/zip_source_is_deleted.c +++ b/core/deps/libzip/lib/zip_source_is_deleted.c @@ -1,9 +1,9 @@ /* zip_source_is_deleted.c -- was archive was removed? - Copyright (C) 2014-2020 Dieter Baron and Thomas Klausner + Copyright (C) 2014-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/core/deps/libzip/lib/zip_source_layered.c b/core/deps/libzip/lib/zip_source_layered.c index a02986929..62b78e68e 100644 --- a/core/deps/libzip/lib/zip_source_layered.c +++ b/core/deps/libzip/lib/zip_source_layered.c @@ -1,9 +1,9 @@ /* zip_source_layered.c -- create layered source - Copyright (C) 2009-2020 Dieter Baron and Thomas Klausner + Copyright (C) 2009-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -49,19 +49,27 @@ zip_source_layered(zip_t *za, zip_source_t *src, zip_source_layered_callback cb, zip_source_t * zip_source_layered_create(zip_source_t *src, zip_source_layered_callback cb, void *ud, zip_error_t *error) { zip_source_t *zs; + zip_int64_t lower_supports, supports; - if ((zs = _zip_source_new(error)) == NULL) + lower_supports = zip_source_supports(src); + supports = cb(src, ud, &lower_supports, sizeof(lower_supports), ZIP_SOURCE_SUPPORTS); + if (supports < 0) { + zip_error_set(error,ZIP_ER_INVAL, 0); /* Initialize in case cb doesn't return valid error. */ + cb(src, ud, error, sizeof(*error), ZIP_SOURCE_ERROR); return NULL; + } + + if ((zs = _zip_source_new(error)) == NULL) { + return NULL; + } - zip_source_keep(src); zs->src = src; zs->cb.l = cb; zs->ud = ud; + zs->supports = supports; - zs->supports = cb(src, ud, NULL, 0, ZIP_SOURCE_SUPPORTS); - if (zs->supports < 0) { - zs->supports = ZIP_SOURCE_SUPPORTS_READABLE; - } + /* Layered sources can't support writing, since we currently have no use case. If we want to revisit this, we have to define how the two sources interact. */ + zs->supports &= ~(ZIP_SOURCE_SUPPORTS_WRITABLE & ~ZIP_SOURCE_SUPPORTS_SEEKABLE); return zs; } diff --git a/core/deps/libzip/lib/zip_source_open.c b/core/deps/libzip/lib/zip_source_open.c index 442f1894f..b34fa2c6c 100644 --- a/core/deps/libzip/lib/zip_source_open.c +++ b/core/deps/libzip/lib/zip_source_open.c @@ -1,9 +1,9 @@ /* zip_source_open.c -- open zip_source (prepare for reading) - Copyright (C) 2009-2020 Dieter Baron and Thomas Klausner + Copyright (C) 2009-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -53,7 +53,7 @@ zip_source_open(zip_source_t *src) { else { if (ZIP_SOURCE_IS_LAYERED(src)) { if (zip_source_open(src->src) < 0) { - _zip_error_set_from_source(&src->error, src->src); + zip_error_set_from_source(&src->error, src->src); return -1; } } diff --git a/core/deps/libzip/lib/zip_mkstempm.c b/core/deps/libzip/lib/zip_source_pass_to_lower_layer.c similarity index 53% rename from core/deps/libzip/lib/zip_mkstempm.c rename to core/deps/libzip/lib/zip_source_pass_to_lower_layer.c index 41516d2ff..4a98222ec 100644 --- a/core/deps/libzip/lib/zip_mkstempm.c +++ b/core/deps/libzip/lib/zip_source_pass_to_lower_layer.c @@ -1,9 +1,9 @@ /* - zip_mkstempm.c -- mkstemp replacement that accepts a mode argument - Copyright (C) 2019-2020 Dieter Baron and Thomas Klausner + zip_source_pass_to_lower_layer.c -- pass command to lower layer + Copyright (C) 2022 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -31,63 +31,48 @@ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#include -#include -#include -#include - #include "zipint.h" -/* - * create temporary file with same permissions as previous one; - * or default permissions if there is no previous file - */ -int -_zip_mkstempm(char *path, int mode) { - int fd; - char *start, *end, *xs; - - int xcnt = 0; +zip_int64_t zip_source_pass_to_lower_layer(zip_source_t *src, void *data, zip_uint64_t length, zip_source_cmd_t command) { + switch (command) { + case ZIP_SOURCE_OPEN: + case ZIP_SOURCE_CLOSE: + case ZIP_SOURCE_FREE: + case ZIP_SOURCE_GET_FILE_ATTRIBUTES: + case ZIP_SOURCE_SUPPORTS_REOPEN: + return 0; - end = path + strlen(path); - start = end - 1; - while (start >= path && *start == 'X') { - xcnt++; - start--; - } - - if (xcnt == 0) { - errno = EINVAL; - return -1; - } + case ZIP_SOURCE_STAT: + return sizeof(zip_stat_t); - start++; + case ZIP_SOURCE_ACCEPT_EMPTY: + case ZIP_SOURCE_ERROR: + case ZIP_SOURCE_READ: + case ZIP_SOURCE_SEEK: + case ZIP_SOURCE_TELL: + return _zip_source_call(src, data, length, command); - for (;;) { - zip_uint32_t value = zip_random_uint32(); - xs = start; - - while (xs < end) { - char digit = value % 36; - if (digit < 10) { - *(xs++) = digit + '0'; - } - else { - *(xs++) = digit - 10 + 'a'; - } - value /= 36; - } + case ZIP_SOURCE_BEGIN_WRITE: + case ZIP_SOURCE_BEGIN_WRITE_CLONING: + case ZIP_SOURCE_COMMIT_WRITE: + case ZIP_SOURCE_REMOVE: + case ZIP_SOURCE_ROLLBACK_WRITE: + case ZIP_SOURCE_SEEK_WRITE: + case ZIP_SOURCE_TELL_WRITE: + case ZIP_SOURCE_WRITE: + zip_error_set(&src->error, ZIP_ER_OPNOTSUPP, 0); + return -1; - if ((fd = open(path, O_CREAT | O_EXCL | O_RDWR | O_CLOEXEC, mode == -1 ? 0666 : (mode_t)mode)) >= 0) { - if (mode != -1) { - /* open() honors umask(), which we don't want in this case */ - (void)chmod(path, (mode_t)mode); - } - return fd; - } - if (errno != EEXIST) { + case ZIP_SOURCE_SUPPORTS: + if (length < sizeof(zip_int64_t)) { + zip_error_set(&src->error, ZIP_ER_INTERNAL, 0); return -1; } + return *(zip_int64_t *)data; + + default: + zip_error_set(&src->error, ZIP_ER_OPNOTSUPP, 0); + return -1; } -} +} \ No newline at end of file diff --git a/core/deps/libzip/lib/zip_source_pkware_decode.c b/core/deps/libzip/lib/zip_source_pkware_decode.c index a1c9e3a9b..b4c482b31 100644 --- a/core/deps/libzip/lib/zip_source_pkware_decode.c +++ b/core/deps/libzip/lib/zip_source_pkware_decode.c @@ -3,7 +3,7 @@ Copyright (C) 2009-2020 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -85,7 +85,7 @@ decrypt_header(zip_source_t *src, struct trad_pkware *ctx) { bool ok = false; if ((n = zip_source_read(src, header, ZIP_CRYPTO_PKWARE_HEADERLEN)) < 0) { - _zip_error_set_from_source(&ctx->error, src); + zip_error_set_from_source(&ctx->error, src); return -1; } @@ -147,7 +147,7 @@ pkware_decrypt(zip_source_t *src, void *ud, void *data, zip_uint64_t len, zip_so case ZIP_SOURCE_READ: if ((n = zip_source_read(src, data, len)) < 0) { - _zip_error_set_from_source(&ctx->error, src); + zip_error_set_from_source(&ctx->error, src); return -1; } @@ -172,7 +172,7 @@ pkware_decrypt(zip_source_t *src, void *ud, void *data, zip_uint64_t len, zip_so } case ZIP_SOURCE_SUPPORTS: - return zip_source_make_command_bitmap(ZIP_SOURCE_OPEN, ZIP_SOURCE_READ, ZIP_SOURCE_CLOSE, ZIP_SOURCE_STAT, ZIP_SOURCE_ERROR, ZIP_SOURCE_FREE, -1); + return zip_source_make_command_bitmap(ZIP_SOURCE_OPEN, ZIP_SOURCE_READ, ZIP_SOURCE_CLOSE, ZIP_SOURCE_STAT, ZIP_SOURCE_ERROR, ZIP_SOURCE_FREE, ZIP_SOURCE_SUPPORTS_REOPEN, -1); case ZIP_SOURCE_ERROR: return zip_error_to_data(&ctx->error, data, len); @@ -182,8 +182,7 @@ pkware_decrypt(zip_source_t *src, void *ud, void *data, zip_uint64_t len, zip_so return 0; default: - zip_error_set(&ctx->error, ZIP_ER_INVAL, 0); - return -1; + return zip_source_pass_to_lower_layer(src, data, len, cmd); } } diff --git a/core/deps/libzip/lib/zip_source_pkware_encode.c b/core/deps/libzip/lib/zip_source_pkware_encode.c index 7c77e1e86..d89b9f4e8 100644 --- a/core/deps/libzip/lib/zip_source_pkware_encode.c +++ b/core/deps/libzip/lib/zip_source_pkware_encode.c @@ -3,7 +3,7 @@ Copyright (C) 2009-2020 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -42,6 +42,8 @@ struct trad_pkware { zip_pkware_keys_t keys; zip_buffer_t *buffer; bool eof; + bool mtime_set; + time_t mtime; zip_error_t error; }; @@ -50,7 +52,7 @@ static int encrypt_header(zip_source_t *, struct trad_pkware *); static zip_int64_t pkware_encrypt(zip_source_t *, void *, void *, zip_uint64_t, zip_source_cmd_t); static void trad_pkware_free(struct trad_pkware *); static struct trad_pkware *trad_pkware_new(const char *password, zip_error_t *error); - +static void set_mtime(struct trad_pkware* ctx, zip_stat_t* st); zip_source_t * zip_source_pkware_encode(zip_t *za, zip_source_t *src, zip_uint16_t em, int flags, const char *password) { @@ -81,16 +83,19 @@ zip_source_pkware_encode(zip_t *za, zip_source_t *src, zip_uint16_t em, int flag static int encrypt_header(zip_source_t *src, struct trad_pkware *ctx) { - struct zip_stat st; unsigned short dostime, dosdate; zip_uint8_t *header; - if (zip_source_stat(src, &st) != 0) { - _zip_error_set_from_source(&ctx->error, src); - return -1; + if (!ctx->mtime_set) { + struct zip_stat st; + if (zip_source_stat(src, &st) != 0) { + zip_error_set_from_source(&ctx->error, src); + return -1; + } + set_mtime(ctx, &st); } - _zip_u2d_time(st.mtime, &dostime, &dosdate); + _zip_u2d_time(ctx->mtime, &dostime, &dosdate); if ((ctx->buffer = _zip_buffer_new(NULL, ZIP_CRYPTO_PKWARE_HEADERLEN)) == NULL) { zip_error_set(&ctx->error, ZIP_ER_MEMORY, 0); @@ -156,7 +161,7 @@ pkware_encrypt(zip_source_t *src, void *ud, void *data, zip_uint64_t length, zip } if ((n = zip_source_read(src, data, length)) < 0) { - _zip_error_set_from_source(&ctx->error, src); + zip_error_set_from_source(&ctx->error, src); return -1; } @@ -182,6 +187,9 @@ pkware_encrypt(zip_source_t *src, void *ud, void *data, zip_uint64_t length, zip if (st->valid & ZIP_STAT_COMP_SIZE) { st->comp_size += ZIP_CRYPTO_PKWARE_HEADERLEN; } + set_mtime(ctx, st); + st->mtime = ctx->mtime; + st->valid |= ZIP_STAT_MTIME; return 0; } @@ -209,8 +217,7 @@ pkware_encrypt(zip_source_t *src, void *ud, void *data, zip_uint64_t length, zip return 0; default: - zip_error_set(&ctx->error, ZIP_ER_INVAL, 0); - return -1; + return zip_source_pass_to_lower_layer(src, data, length, cmd); } } @@ -230,6 +237,8 @@ trad_pkware_new(const char *password, zip_error_t *error) { return NULL; } ctx->buffer = NULL; + ctx->mtime_set = false; + ctx->mtime = 0; zip_error_init(&ctx->error); return ctx; @@ -247,3 +256,16 @@ trad_pkware_free(struct trad_pkware *ctx) { zip_error_fini(&ctx->error); free(ctx); } + + +static void set_mtime(struct trad_pkware* ctx, zip_stat_t* st) { + if (!ctx->mtime_set) { + if (st->valid & ZIP_STAT_MTIME) { + ctx->mtime = st->mtime; + } + else { + time(&ctx->mtime); + } + ctx->mtime_set = true; + } +} diff --git a/core/deps/libzip/lib/zip_source_read.c b/core/deps/libzip/lib/zip_source_read.c index f146ab065..0938fcb08 100644 --- a/core/deps/libzip/lib/zip_source_read.c +++ b/core/deps/libzip/lib/zip_source_read.c @@ -1,9 +1,9 @@ /* zip_source_read.c -- read data from zip_source - Copyright (C) 2009-2020 Dieter Baron and Thomas Klausner + Copyright (C) 2009-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/core/deps/libzip/lib/zip_source_remove.c b/core/deps/libzip/lib/zip_source_remove.c index a6ccd7eda..c1d73ab92 100644 --- a/core/deps/libzip/lib/zip_source_remove.c +++ b/core/deps/libzip/lib/zip_source_remove.c @@ -1,9 +1,9 @@ /* zip_source_remove.c -- remove empty archive - Copyright (C) 2014-2020 Dieter Baron and Thomas Klausner + Copyright (C) 2014-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -37,6 +37,11 @@ int zip_source_remove(zip_source_t *src) { + if (ZIP_SOURCE_IS_LAYERED(src)) { + zip_error_set(&src->error, ZIP_ER_OPNOTSUPP, 0); + return -1; + } + if (src->write_state == ZIP_SOURCE_WRITE_REMOVED) { return 0; } diff --git a/core/deps/libzip/lib/zip_source_rollback_write.c b/core/deps/libzip/lib/zip_source_rollback_write.c index d21b1ffe2..ea1a15107 100644 --- a/core/deps/libzip/lib/zip_source_rollback_write.c +++ b/core/deps/libzip/lib/zip_source_rollback_write.c @@ -1,9 +1,9 @@ /* zip_source_rollback_write.c -- discard changes - Copyright (C) 2014-2020 Dieter Baron and Thomas Klausner + Copyright (C) 2014-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -37,6 +37,10 @@ ZIP_EXTERN void zip_source_rollback_write(zip_source_t *src) { + if (ZIP_SOURCE_IS_LAYERED(src)) { + return; + } + if (src->write_state != ZIP_SOURCE_WRITE_OPEN && src->write_state != ZIP_SOURCE_WRITE_FAILED) { return; } diff --git a/core/deps/libzip/lib/zip_source_seek.c b/core/deps/libzip/lib/zip_source_seek.c index 29d1e968e..e3baad5ab 100644 --- a/core/deps/libzip/lib/zip_source_seek.c +++ b/core/deps/libzip/lib/zip_source_seek.c @@ -1,9 +1,9 @@ /* zip_source_seek.c -- seek to offset - Copyright (C) 2014-2020 Dieter Baron and Thomas Klausner + Copyright (C) 2014-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/core/deps/libzip/lib/zip_source_seek_write.c b/core/deps/libzip/lib/zip_source_seek_write.c index 5fa2a8129..34ae2f5af 100644 --- a/core/deps/libzip/lib/zip_source_seek_write.c +++ b/core/deps/libzip/lib/zip_source_seek_write.c @@ -1,9 +1,9 @@ /* zip_source_seek_write.c -- seek to offset for writing - Copyright (C) 2014-2020 Dieter Baron and Thomas Klausner + Copyright (C) 2014-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -39,6 +39,11 @@ ZIP_EXTERN int zip_source_seek_write(zip_source_t *src, zip_int64_t offset, int whence) { zip_source_args_seek_t args; + if (ZIP_SOURCE_IS_LAYERED(src)) { + zip_error_set(&src->error, ZIP_ER_OPNOTSUPP, 0); + return -1; + } + if (!ZIP_SOURCE_IS_OPEN_WRITING(src) || (whence != SEEK_SET && whence != SEEK_CUR && whence != SEEK_END)) { zip_error_set(&src->error, ZIP_ER_INVAL, 0); return -1; diff --git a/core/deps/libzip/lib/zip_source_stat.c b/core/deps/libzip/lib/zip_source_stat.c index 46eb92db5..05dcb84d7 100644 --- a/core/deps/libzip/lib/zip_source_stat.c +++ b/core/deps/libzip/lib/zip_source_stat.c @@ -1,9 +1,9 @@ /* zip_source_stat.c -- get meta information from zip_source - Copyright (C) 2009-2020 Dieter Baron and Thomas Klausner + Copyright (C) 2009-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -45,11 +45,15 @@ zip_source_stat(zip_source_t *src, zip_stat_t *st) { return -1; } + if (src->write_state == ZIP_SOURCE_WRITE_REMOVED) { + zip_error_set(&src->error, ZIP_ER_READ, ENOENT); + } + zip_stat_init(st); if (ZIP_SOURCE_IS_LAYERED(src)) { if (zip_source_stat(src->src, st) < 0) { - _zip_error_set_from_source(&src->error, src->src); + zip_error_set_from_source(&src->error, src->src); return -1; } } diff --git a/core/deps/libzip/lib/zip_source_supports.c b/core/deps/libzip/lib/zip_source_supports.c index b4575a74b..8fea2ae91 100644 --- a/core/deps/libzip/lib/zip_source_supports.c +++ b/core/deps/libzip/lib/zip_source_supports.c @@ -1,9 +1,9 @@ /* zip_source_supports.c -- check for supported functions - Copyright (C) 2014-2020 Dieter Baron and Thomas Klausner + Copyright (C) 2014-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -42,6 +42,10 @@ zip_source_supports(zip_source_t *src) { return src->supports; } +bool +zip_source_supports_reopen(zip_source_t *src) { + return (zip_source_supports(src) & ZIP_SOURCE_MAKE_COMMAND_BITMASK(ZIP_SOURCE_SUPPORTS_REOPEN)) != 0; +} ZIP_EXTERN zip_int64_t zip_source_make_command_bitmap(zip_source_cmd_t cmd0, ...) { @@ -63,3 +67,8 @@ zip_source_make_command_bitmap(zip_source_cmd_t cmd0, ...) { return bitmap; } + + +ZIP_EXTERN int zip_source_is_seekable(zip_source_t *src) { + return ZIP_SOURCE_CHECK_SUPPORTED(zip_source_supports(src->src), ZIP_SOURCE_SEEK); +} diff --git a/core/deps/libzip/lib/zip_source_tell.c b/core/deps/libzip/lib/zip_source_tell.c index b17412be7..49057ce56 100644 --- a/core/deps/libzip/lib/zip_source_tell.c +++ b/core/deps/libzip/lib/zip_source_tell.c @@ -1,9 +1,9 @@ /* zip_source_tell.c -- report current offset - Copyright (C) 2014-2020 Dieter Baron and Thomas Klausner + Copyright (C) 2014-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/core/deps/libzip/lib/zip_source_tell_write.c b/core/deps/libzip/lib/zip_source_tell_write.c index c09a79fcb..a5b0e5311 100644 --- a/core/deps/libzip/lib/zip_source_tell_write.c +++ b/core/deps/libzip/lib/zip_source_tell_write.c @@ -1,9 +1,9 @@ /* zip_source_tell_write.c -- report current offset for writing - Copyright (C) 2014-2020 Dieter Baron and Thomas Klausner + Copyright (C) 2014-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -37,6 +37,11 @@ ZIP_EXTERN zip_int64_t zip_source_tell_write(zip_source_t *src) { + if (ZIP_SOURCE_IS_LAYERED(src)) { + zip_error_set(&src->error, ZIP_ER_OPNOTSUPP, 0); + return -1; + } + if (!ZIP_SOURCE_IS_OPEN_WRITING(src)) { zip_error_set(&src->error, ZIP_ER_INVAL, 0); return -1; diff --git a/core/deps/libzip/lib/zip_source_window.c b/core/deps/libzip/lib/zip_source_window.c index b63ba1df4..524e27c83 100644 --- a/core/deps/libzip/lib/zip_source_window.c +++ b/core/deps/libzip/lib/zip_source_window.c @@ -1,9 +1,9 @@ /* zip_source_window.c -- return part of lower source - Copyright (C) 2012-2020 Dieter Baron and Thomas Klausner + Copyright (C) 2012-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -40,6 +40,7 @@ struct window { zip_uint64_t start; /* where in file we start reading */ zip_uint64_t end; /* where in file we stop reading */ + bool end_valid; /* whether end is set, otherwise read until EOF */ /* if not NULL, read file data for this file */ zip_t *source_archive; @@ -48,6 +49,7 @@ struct window { zip_uint64_t offset; /* offset in src for next read */ zip_stat_t stat; + zip_uint64_t stat_invalid; zip_file_attributes_t attributes; zip_error_t error; zip_int64_t supports; @@ -57,20 +59,28 @@ struct window { static zip_int64_t window_read(zip_source_t *, void *, void *, zip_uint64_t, zip_source_cmd_t); -zip_source_t * -zip_source_window(zip_t *za, zip_source_t *src, zip_uint64_t start, zip_uint64_t len) { - return _zip_source_window_new(src, start, len, NULL, 0, NULL, 0, &za->error); +ZIP_EXTERN zip_source_t * +zip_source_window_create(zip_source_t *src, zip_uint64_t start, zip_int64_t len, zip_error_t *error) { + return _zip_source_window_new(src, start, len, NULL, 0, NULL, NULL, 0, false, error); } zip_source_t * -_zip_source_window_new(zip_source_t *src, zip_uint64_t start, zip_uint64_t length, zip_stat_t *st, zip_file_attributes_t *attributes, zip_t *source_archive, zip_uint64_t source_index, zip_error_t *error) { +_zip_source_window_new(zip_source_t *src, zip_uint64_t start, zip_int64_t length, zip_stat_t *st, zip_uint64_t st_invalid, zip_file_attributes_t *attributes, zip_t *source_archive, zip_uint64_t source_index, bool take_ownership, zip_error_t *error) { + zip_source_t* window_source; struct window *ctx; - if (src == NULL || start + length < start || (source_archive == NULL && source_index != 0)) { + if (src == NULL || length < -1 || (source_archive == NULL && source_index != 0)) { zip_error_set(error, ZIP_ER_INVAL, 0); return NULL; } + + if (length >= 0) { + if (start + (zip_uint64_t)length < start) { + zip_error_set(error, ZIP_ER_INVAL, 0); + return NULL; + } + } if ((ctx = (struct window *)malloc(sizeof(*ctx))) == NULL) { zip_error_set(error, ZIP_ER_MEMORY, 0); @@ -78,10 +88,17 @@ _zip_source_window_new(zip_source_t *src, zip_uint64_t start, zip_uint64_t lengt } ctx->start = start; - ctx->end = start + length; + if (length == -1) { + ctx->end_valid = false; + } + else { + ctx->end = start + (zip_uint64_t)length; + ctx->end_valid = true; + } zip_stat_init(&ctx->stat); + ctx->stat_invalid = st_invalid; if (attributes != NULL) { - memcpy(&ctx->attributes, attributes, sizeof(ctx->attributes)); + (void)memcpy_s(&ctx->attributes, sizeof(ctx->attributes), attributes, sizeof(ctx->attributes)); } else { zip_file_attributes_init(&ctx->attributes); @@ -89,7 +106,7 @@ _zip_source_window_new(zip_source_t *src, zip_uint64_t start, zip_uint64_t lengt ctx->source_archive = source_archive; ctx->source_index = source_index; zip_error_init(&ctx->error); - ctx->supports = (zip_source_supports(src) & ZIP_SOURCE_SUPPORTS_SEEKABLE) | (zip_source_make_command_bitmap(ZIP_SOURCE_GET_FILE_ATTRIBUTES, ZIP_SOURCE_SUPPORTS, ZIP_SOURCE_TELL, -1)); + ctx->supports = (zip_source_supports(src) & (ZIP_SOURCE_SUPPORTS_SEEKABLE | ZIP_SOURCE_SUPPORTS_REOPEN)) | (zip_source_make_command_bitmap(ZIP_SOURCE_GET_FILE_ATTRIBUTES, ZIP_SOURCE_SUPPORTS, ZIP_SOURCE_TELL, ZIP_SOURCE_FREE, -1)); ctx->needs_seek = (ctx->supports & ZIP_SOURCE_MAKE_COMMAND_BITMASK(ZIP_SOURCE_SEEK)) ? true : false; if (st) { @@ -98,8 +115,12 @@ _zip_source_window_new(zip_source_t *src, zip_uint64_t start, zip_uint64_t lengt return NULL; } } - - return zip_source_layered_create(src, window_read, ctx, error); + + window_source = zip_source_layered_create(src, window_read, ctx, error); + if (window_source != NULL && !take_ownership) { + zip_source_keep(src); + } + return window_source; } @@ -149,7 +170,7 @@ window_read(zip_source_t *src, void *_ctx, void *data, zip_uint64_t len, zip_sou } if (ctx->end + offset < ctx->end) { /* zip archive data claims end of data past zip64 limits */ - zip_error_set(&ctx->error, ZIP_ER_INCONS, 0); + zip_error_set(&ctx->error, ZIP_ER_INCONS, MAKE_DETAIL_WITH_INDEX(ZIP_ER_DETAIL_CDIR_ENTRY_INVALID, ctx->source_index)); return -1; } ctx->start += offset; @@ -168,7 +189,7 @@ window_read(zip_source_t *src, void *_ctx, void *data, zip_uint64_t len, zip_sou for (n = 0; n < ctx->start; n += (zip_uint64_t)ret) { i = (ctx->start - n > BUFSIZE ? BUFSIZE : ctx->start - n); if ((ret = zip_source_read(src, b, i)) < 0) { - _zip_error_set_from_source(&ctx->error, src); + zip_error_set_from_source(&ctx->error, src); byte_array_fini(b); return -1; } @@ -186,15 +207,17 @@ window_read(zip_source_t *src, void *_ctx, void *data, zip_uint64_t len, zip_sou return 0; case ZIP_SOURCE_READ: - if (len > ctx->end - ctx->offset) + if (ctx->end_valid && len > ctx->end - ctx->offset) { len = ctx->end - ctx->offset; + } - if (len == 0) + if (len == 0) { return 0; + } if (ctx->needs_seek) { if (zip_source_seek(src, (zip_int64_t)ctx->offset, SEEK_SET) < 0) { - _zip_error_set_from_source(&ctx->error, src); + zip_error_set_from_source(&ctx->error, src); return -1; } } @@ -207,7 +230,7 @@ window_read(zip_source_t *src, void *_ctx, void *data, zip_uint64_t len, zip_sou ctx->offset += (zip_uint64_t)ret; if (ret == 0) { - if (ctx->offset < ctx->end) { + if (ctx->end_valid && ctx->offset < ctx->end) { zip_error_set(&ctx->error, ZIP_ER_EOF, 0); return -1; } @@ -215,12 +238,40 @@ window_read(zip_source_t *src, void *_ctx, void *data, zip_uint64_t len, zip_sou return ret; case ZIP_SOURCE_SEEK: { - zip_int64_t new_offset = zip_source_seek_compute_offset(ctx->offset - ctx->start, ctx->end - ctx->start, data, len, &ctx->error); + zip_int64_t new_offset; + + if (!ctx->end_valid) { + zip_source_args_seek_t *args = ZIP_SOURCE_GET_ARGS(zip_source_args_seek_t, data, len, &ctx->error); + + if (args == NULL) { + return -1; + } + if (args->whence == SEEK_END) { + if (zip_source_seek(src, args->offset, args->whence) < 0) { + zip_error_set_from_source(&ctx->error, src); + return -1; + } + new_offset = zip_source_tell(src); + if (new_offset < 0) { + zip_error_set_from_source(&ctx->error, src); + return -1; + } + if ((zip_uint64_t)new_offset < ctx->start) { + zip_error_set(&ctx->error, ZIP_ER_INVAL, 0); + (void)zip_source_seek(src, (zip_int64_t)ctx->offset, SEEK_SET); + return -1; + } + ctx->offset = (zip_uint64_t)new_offset; + return 0; + } + } + new_offset = zip_source_seek_compute_offset(ctx->offset - ctx->start, ctx->end - ctx->start, data, len, &ctx->error); + if (new_offset < 0) { return -1; } - + ctx->offset = (zip_uint64_t)new_offset + ctx->start; return 0; } @@ -233,6 +284,19 @@ window_read(zip_source_t *src, void *_ctx, void *data, zip_uint64_t len, zip_sou if (_zip_stat_merge(st, &ctx->stat, &ctx->error) < 0) { return -1; } + + if (!(ctx->stat.valid & ZIP_STAT_SIZE)) { + if (ctx->end_valid) { + st->valid |= ZIP_STAT_SIZE; + st->size = ctx->end - ctx->start; + } + else if (st->valid & ZIP_STAT_SIZE) { + st->size -= ctx->start; + } + } + + st->valid &= ~ctx->stat_invalid; + return 0; } @@ -242,7 +306,7 @@ window_read(zip_source_t *src, void *_ctx, void *data, zip_uint64_t len, zip_sou return -1; } - memcpy(data, &ctx->attributes, sizeof(ctx->attributes)); + (void)memcpy_s(data, sizeof(ctx->attributes), &ctx->attributes, sizeof(ctx->attributes)); return sizeof(ctx->attributes); case ZIP_SOURCE_SUPPORTS: @@ -252,8 +316,7 @@ window_read(zip_source_t *src, void *_ctx, void *data, zip_uint64_t len, zip_sou return (zip_int64_t)(ctx->offset - ctx->start); default: - zip_error_set(&ctx->error, ZIP_ER_OPNOTSUPP, 0); - return -1; + return zip_source_pass_to_lower_layer(src, data, len, cmd); } } diff --git a/core/deps/libzip/lib/zip_source_winzip_aes_decode.c b/core/deps/libzip/lib/zip_source_winzip_aes_decode.c index b2bb3cbb7..ee53fb419 100644 --- a/core/deps/libzip/lib/zip_source_winzip_aes_decode.c +++ b/core/deps/libzip/lib/zip_source_winzip_aes_decode.c @@ -1,9 +1,9 @@ /* zip_source_winzip_aes_decode.c -- Winzip AES decryption routines - Copyright (C) 2009-2020 Dieter Baron and Thomas Klausner + Copyright (C) 2009-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -36,6 +36,7 @@ #include #include "zipint.h" +#include "zip_crypto.h" struct winzip_aes { char *password; @@ -72,7 +73,7 @@ zip_source_winzip_aes_decode(zip_t *za, zip_source_t *src, zip_uint16_t encrypti } if (zip_source_stat(src, &st) != 0) { - _zip_error_set_from_source(&za->error, src); + zip_error_set_from_source(&za->error, src); return NULL; } @@ -107,7 +108,7 @@ decrypt_header(zip_source_t *src, struct winzip_aes *ctx) { headerlen = WINZIP_AES_PASSWORD_VERIFY_LENGTH + SALT_LENGTH(ctx->encryption_method); if ((n = zip_source_read(src, header, headerlen)) < 0) { - _zip_error_set_from_source(&ctx->error, src); + zip_error_set_from_source(&ctx->error, src); return -1; } @@ -131,9 +132,9 @@ decrypt_header(zip_source_t *src, struct winzip_aes *ctx) { static bool verify_hmac(zip_source_t *src, struct winzip_aes *ctx) { - unsigned char computed[SHA1_LENGTH], from_file[HMAC_LENGTH]; + unsigned char computed[ZIP_CRYPTO_SHA1_LENGTH], from_file[HMAC_LENGTH]; if (zip_source_read(src, from_file, HMAC_LENGTH) < HMAC_LENGTH) { - _zip_error_set_from_source(&ctx->error, src); + zip_error_set_from_source(&ctx->error, src); return false; } @@ -181,7 +182,7 @@ winzip_aes_decrypt(zip_source_t *src, void *ud, void *data, zip_uint64_t len, zi } if ((n = zip_source_read(src, data, len)) < 0) { - _zip_error_set_from_source(&ctx->error, src); + zip_error_set_from_source(&ctx->error, src); return -1; } ctx->current_position += (zip_uint64_t)n; @@ -211,7 +212,7 @@ winzip_aes_decrypt(zip_source_t *src, void *ud, void *data, zip_uint64_t len, zi } case ZIP_SOURCE_SUPPORTS: - return zip_source_make_command_bitmap(ZIP_SOURCE_OPEN, ZIP_SOURCE_READ, ZIP_SOURCE_CLOSE, ZIP_SOURCE_STAT, ZIP_SOURCE_ERROR, ZIP_SOURCE_FREE, -1); + return zip_source_make_command_bitmap(ZIP_SOURCE_OPEN, ZIP_SOURCE_READ, ZIP_SOURCE_CLOSE, ZIP_SOURCE_STAT, ZIP_SOURCE_ERROR, ZIP_SOURCE_FREE, ZIP_SOURCE_SUPPORTS_REOPEN, -1); case ZIP_SOURCE_ERROR: return zip_error_to_data(&ctx->error, data, len); @@ -221,8 +222,7 @@ winzip_aes_decrypt(zip_source_t *src, void *ud, void *data, zip_uint64_t len, zi return 0; default: - zip_error_set(&ctx->error, ZIP_ER_INVAL, 0); - return -1; + return zip_source_pass_to_lower_layer(src, data, len, cmd); } } diff --git a/core/deps/libzip/lib/zip_source_winzip_aes_encode.c b/core/deps/libzip/lib/zip_source_winzip_aes_encode.c index 19d5cf026..87e2865a0 100644 --- a/core/deps/libzip/lib/zip_source_winzip_aes_encode.c +++ b/core/deps/libzip/lib/zip_source_winzip_aes_encode.c @@ -1,9 +1,9 @@ /* zip_source_winzip_aes_encode.c -- Winzip AES encryption routines - Copyright (C) 2009-2020 Dieter Baron and Thomas Klausner + Copyright (C) 2009-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -36,13 +36,13 @@ #include #include "zipint.h" - +#include "zip_crypto.h" struct winzip_aes { char *password; zip_uint16_t encryption_method; - zip_uint8_t data[ZIP_MAX(WINZIP_AES_MAX_HEADER_LENGTH, SHA1_LENGTH)]; + zip_uint8_t data[ZIP_MAX(WINZIP_AES_MAX_HEADER_LENGTH, ZIP_CRYPTO_SHA1_LENGTH)]; zip_buffer_t *buffer; zip_winzip_aes_t *aes_ctx; @@ -139,7 +139,7 @@ winzip_aes_encrypt(zip_source_t *src, void *ud, void *data, zip_uint64_t length, } if ((ret = zip_source_read(src, data, length)) < 0) { - _zip_error_set_from_source(&ctx->error, src); + zip_error_set_from_source(&ctx->error, src); return -1; } @@ -207,8 +207,7 @@ winzip_aes_encrypt(zip_source_t *src, void *ud, void *data, zip_uint64_t length, return 0; default: - zip_error_set(&ctx->error, ZIP_ER_INVAL, 0); - return -1; + return zip_source_pass_to_lower_layer(src, data, length, cmd); } } diff --git a/core/deps/libzip/lib/zip_source_write.c b/core/deps/libzip/lib/zip_source_write.c index 33bf9c944..24dde9b24 100644 --- a/core/deps/libzip/lib/zip_source_write.c +++ b/core/deps/libzip/lib/zip_source_write.c @@ -1,9 +1,9 @@ /* zip_source_write.c -- start a new file for writing - Copyright (C) 2014-2020 Dieter Baron and Thomas Klausner + Copyright (C) 2014-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/core/deps/libzip/lib/zip_source_zip.c b/core/deps/libzip/lib/zip_source_zip.c index cb62540d5..faabf0d29 100644 --- a/core/deps/libzip/lib/zip_source_zip.c +++ b/core/deps/libzip/lib/zip_source_zip.c @@ -1,9 +1,9 @@ /* zip_source_zip.c -- create data source from zip file - Copyright (C) 1999-2020 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -34,23 +34,30 @@ #include +#define _ZIP_COMPILING_DEPRECATED #include "zipint.h" - -ZIP_EXTERN zip_source_t * -zip_source_zip(zip_t *za, zip_t *srcza, zip_uint64_t srcidx, zip_flags_t flags, zip_uint64_t start, zip_int64_t len) { +ZIP_EXTERN zip_source_t *zip_source_zip_create(zip_t *srcza, zip_uint64_t srcidx, zip_flags_t flags, zip_uint64_t start, zip_int64_t len, zip_error_t *error) { if (len < -1) { - zip_error_set(&za->error, ZIP_ER_INVAL, 0); + zip_error_set(error, ZIP_ER_INVAL, 0); return NULL; } - - if (len == -1) - len = 0; - - if (start == 0 && len == 0) + + if (len == 0) { + len = -1; + } + + if (start == 0 && len == -1) { flags |= ZIP_FL_COMPRESSED; - else + } + else { flags &= ~ZIP_FL_COMPRESSED; + } + + return zip_source_zip_file_create(srcza, srcidx, flags, start, len, NULL, error); +} + - return _zip_source_zip_new(za, srcza, srcidx, flags, start, (zip_uint64_t)len, NULL); +ZIP_EXTERN zip_source_t *zip_source_zip(zip_t *za, zip_t *srcza, zip_uint64_t srcidx, zip_flags_t flags, zip_uint64_t start, zip_int64_t len) { + return zip_source_zip_create(srcza, srcidx, flags, start, len, &za->error); } diff --git a/core/deps/libzip/lib/zip_source_zip_new.c b/core/deps/libzip/lib/zip_source_zip_new.c index ffb2bdf4b..ecccdd68f 100644 --- a/core/deps/libzip/lib/zip_source_zip_new.c +++ b/core/deps/libzip/lib/zip_source_zip_new.c @@ -1,9 +1,9 @@ /* zip_source_zip_new.c -- prepare data structures for zip_fopen/zip_source_zip - Copyright (C) 2012-2020 Dieter Baron and Thomas Klausner + Copyright (C) 2012-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -38,96 +38,210 @@ static void _zip_file_attributes_from_dirent(zip_file_attributes_t *attributes, zip_dirent_t *de); -zip_source_t * -_zip_source_zip_new(zip_t *za, zip_t *srcza, zip_uint64_t srcidx, zip_flags_t flags, zip_uint64_t start, zip_uint64_t len, const char *password) { +ZIP_EXTERN zip_source_t *zip_source_zip_file(zip_t* za, zip_t *srcza, zip_uint64_t srcidx, zip_flags_t flags, zip_uint64_t start, zip_int64_t len, const char *password) { + return zip_source_zip_file_create(srcza, srcidx, flags, start, len, password, &za->error); +} + + +ZIP_EXTERN zip_source_t *zip_source_zip_file_create(zip_t *srcza, zip_uint64_t srcidx, zip_flags_t flags, zip_uint64_t start, zip_int64_t len, const char *password, zip_error_t *error) { + /* TODO: We need to make sure that the returned source is invalidated when srcza is closed. */ zip_source_t *src, *s2; zip_stat_t st; zip_file_attributes_t attributes; zip_dirent_t *de; - bool partial_data, needs_crc, needs_decrypt, needs_decompress; + bool partial_data, needs_crc, encrypted, needs_decrypt, compressed, needs_decompress, changed_data, have_size, have_comp_size; + zip_flags_t stat_flags; + zip_int64_t data_len; + bool take_ownership = false; + bool empty_data = false; - if (za == NULL) { + if (srcza == NULL || srcidx >= srcza->nentry || len < -1) { + zip_error_set(error, ZIP_ER_INVAL, 0); return NULL; } - if (srcza == NULL || srcidx >= srcza->nentry) { - zip_error_set(&za->error, ZIP_ER_INVAL, 0); - return NULL; + if (flags & ZIP_FL_ENCRYPTED) { + flags |= ZIP_FL_COMPRESSED; } - if ((flags & ZIP_FL_UNCHANGED) == 0 && (ZIP_ENTRY_DATA_CHANGED(srcza->entry + srcidx) || srcza->entry[srcidx].deleted)) { - zip_error_set(&za->error, ZIP_ER_CHANGED, 0); - return NULL; + changed_data = false; + if ((flags & ZIP_FL_UNCHANGED) == 0) { + zip_entry_t *entry = srcza->entry + srcidx; + if (ZIP_ENTRY_DATA_CHANGED(entry)) { + if ((flags & ZIP_FL_COMPRESSED) || !zip_source_supports_reopen(entry->source)) { + zip_error_set(error, ZIP_ER_CHANGED, 0); + return NULL; + } + + changed_data = true; + } + else if (entry->deleted) { + zip_error_set(error, ZIP_ER_CHANGED, 0); + return NULL; + } } - if (zip_stat_index(srcza, srcidx, flags | ZIP_FL_UNCHANGED, &st) < 0) { - zip_error_set(&za->error, ZIP_ER_INTERNAL, 0); - return NULL; + stat_flags = flags; + if (!changed_data) { + stat_flags |= ZIP_FL_UNCHANGED; } - if (flags & ZIP_FL_ENCRYPTED) { - flags |= ZIP_FL_COMPRESSED; + if (zip_stat_index(srcza, srcidx, stat_flags, &st) < 0) { + zip_error_set(error, ZIP_ER_INTERNAL, 0); + return NULL; } - if ((start > 0 || len > 0) && (flags & ZIP_FL_COMPRESSED)) { - zip_error_set(&za->error, ZIP_ER_INVAL, 0); + if ((start > 0 || len >= 0) && (flags & ZIP_FL_COMPRESSED)) { + zip_error_set(error, ZIP_ER_INVAL, 0); return NULL; } + have_size = (st.valid & ZIP_STAT_SIZE) != 0; /* overflow or past end of file */ - if ((start > 0 || len > 0) && (start + len < start || start + len > st.size)) { - zip_error_set(&za->error, ZIP_ER_INVAL, 0); + if (len >= 0 && ((start > 0 && start + len < start) || (have_size && start + len > st.size))) { + zip_error_set(error, ZIP_ER_INVAL, 0); return NULL; } - if (len == 0) { - len = st.size - start; + if (len == -1) { + if (have_size) { + if (st.size - start > ZIP_INT64_MAX) { + zip_error_set(error, ZIP_ER_INVAL, 0); + return NULL; + } + data_len = (zip_int64_t)(st.size - start); + } + else { + data_len = -1; + } + } + else { + data_len = len; } - partial_data = len < st.size; - needs_decrypt = ((flags & ZIP_FL_ENCRYPTED) == 0) && (st.encryption_method != ZIP_EM_NONE); - needs_decompress = ((flags & ZIP_FL_COMPRESSED) == 0) && (st.comp_method != ZIP_CM_STORE); + if (have_size) { + partial_data = (zip_uint64_t)(data_len) < st.size; + } + else { + partial_data = true; + } + encrypted = (st.valid & ZIP_STAT_ENCRYPTION_METHOD) && (st.encryption_method != ZIP_EM_NONE); + needs_decrypt = ((flags & ZIP_FL_ENCRYPTED) == 0) && encrypted; + compressed = (st.valid & ZIP_STAT_COMP_METHOD) && (st.comp_method != ZIP_CM_STORE); + needs_decompress = ((flags & ZIP_FL_COMPRESSED) == 0) && compressed; /* when reading the whole file, check for CRC errors */ - needs_crc = ((flags & ZIP_FL_COMPRESSED) == 0 || st.comp_method == ZIP_CM_STORE) && !partial_data; + needs_crc = ((flags & ZIP_FL_COMPRESSED) == 0 || !compressed) && !partial_data && (st.valid & ZIP_STAT_CRC) != 0; if (needs_decrypt) { if (password == NULL) { - password = za->default_password; + password = srcza->default_password; } if (password == NULL) { - zip_error_set(&za->error, ZIP_ER_NOPASSWD, 0); + zip_error_set(error, ZIP_ER_NOPASSWD, 0); return NULL; } } - if ((de = _zip_get_dirent(srcza, srcidx, flags, &za->error)) == NULL) { + if ((de = _zip_get_dirent(srcza, srcidx, flags, error)) == NULL) { return NULL; } _zip_file_attributes_from_dirent(&attributes, de); - if (st.comp_size == 0) { - return zip_source_buffer_with_attributes(za, NULL, 0, 0, &attributes); + have_comp_size = (st.valid & ZIP_STAT_COMP_SIZE) != 0; + if (needs_decrypt || needs_decompress) { + empty_data = (have_comp_size && st.comp_size == 0); + } + else { + empty_data = (have_size && st.size == 0); + } + if (empty_data) { + src = zip_source_buffer_with_attributes_create(NULL, 0, 0, &attributes, error); + } + else { + src = NULL; } + + /* If we created source buffer above, we want the window source to take ownership of it. */ + take_ownership = src != NULL; + /* if we created a buffer source above, then treat it as if + reading the changed data - that way we don't need add another + special case to the code below that wraps it in the window + source */ + changed_data = changed_data || (src != NULL); + if (partial_data && !needs_decrypt && !needs_decompress) { struct zip_stat st2; + zip_t *source_archive; + zip_uint64_t source_index; + + if (changed_data) { + if (src == NULL) { + src = srcza->entry[srcidx].source; + } + source_archive = NULL; + source_index = 0; + } + else { + src = srcza->src; + source_archive = srcza; + source_index = srcidx; + } - st2.size = len; - st2.comp_size = len; st2.comp_method = ZIP_CM_STORE; - st2.mtime = st.mtime; - st2.valid = ZIP_STAT_SIZE | ZIP_STAT_COMP_SIZE | ZIP_STAT_COMP_METHOD | ZIP_STAT_MTIME; + st2.valid = ZIP_STAT_COMP_METHOD; + if (data_len >= 0) { + st2.size = (zip_uint64_t)data_len; + st2.comp_size = (zip_uint64_t)data_len; + st2.valid |= ZIP_STAT_SIZE | ZIP_STAT_COMP_SIZE; + } + if (st.valid & ZIP_STAT_MTIME) { + st2.mtime = st.mtime; + st2.valid |= ZIP_STAT_MTIME; + } - if ((src = _zip_source_window_new(srcza->src, start, len, &st2, &attributes, srcza, srcidx, &za->error)) == NULL) { + if ((src = _zip_source_window_new(src, start, data_len, &st2, ZIP_STAT_NAME, &attributes, source_archive, source_index, take_ownership, error)) == NULL) { + return NULL; + } + } + /* here we restrict src to file data, so no point in doing it for + source that already represents only the file data */ + else if (!changed_data) { + /* this branch is executed only for archive sources; we know + that stat data come from the archive too, so it's safe to + assume that st has a comp_size specified */ + if (st.comp_size > ZIP_INT64_MAX) { + zip_error_set(error, ZIP_ER_INVAL, 0); + return NULL; + } + /* despite the fact that we want the whole data file, we still + wrap the source into a window source to add st and + attributes and to have a source that positions the read + offset properly before each read for multiple zip_file_t + referring to the same underlying source */ + if ((src = _zip_source_window_new(srcza->src, 0, (zip_int64_t)st.comp_size, &st, ZIP_STAT_NAME, &attributes, srcza, srcidx, take_ownership, error)) == NULL) { return NULL; } } else { - if ((src = _zip_source_window_new(srcza->src, 0, st.comp_size, &st, &attributes, srcza, srcidx, &za->error)) == NULL) { + /* this branch gets executed when reading the whole changed + data file or when "reading" from a zero-sized source buffer + that we created above */ + if (src == NULL) { + src = srcza->entry[srcidx].source; + } + /* despite the fact that we want the whole data file, we still + wrap the source into a window source to add st and + attributes and to have a source that positions the read + offset properly before each read for multiple zip_file_t + referring to the same underlying source */ + if ((src = _zip_source_window_new(src, 0, data_len, &st, ZIP_STAT_NAME, &attributes, NULL, 0, take_ownership, error)) == NULL) { return NULL; } } + /* In all cases, src is a window source and therefore is owned by this function. */ + if (_zip_source_set_source_archive(src, srcza) < 0) { zip_source_free(src); return NULL; @@ -139,38 +253,45 @@ _zip_source_zip_new(zip_t *za, zip_t *srcza, zip_uint64_t srcidx, zip_flags_t fl zip_encryption_implementation enc_impl; if ((enc_impl = _zip_get_encryption_implementation(st.encryption_method, ZIP_CODEC_DECODE)) == NULL) { - zip_error_set(&za->error, ZIP_ER_ENCRNOTSUPP, 0); + zip_error_set(error, ZIP_ER_ENCRNOTSUPP, 0); return NULL; } - s2 = enc_impl(za, src, st.encryption_method, 0, password); - zip_source_free(src); + s2 = enc_impl(srcza, src, st.encryption_method, 0, password); if (s2 == NULL) { + zip_source_free(src); return NULL; } + src = s2; } if (needs_decompress) { - s2 = zip_source_decompress(za, src, st.comp_method); - zip_source_free(src); + s2 = zip_source_decompress(srcza, src, st.comp_method); if (s2 == NULL) { + zip_source_free(src); return NULL; } src = s2; } if (needs_crc) { - s2 = zip_source_crc(za, src, 1); - zip_source_free(src); + s2 = zip_source_crc_create(src, 1, error); if (s2 == NULL) { + zip_source_free(src); return NULL; } src = s2; } if (partial_data && (needs_decrypt || needs_decompress)) { - s2 = zip_source_window(za, src, start, len); - zip_source_free(src); + zip_stat_t st2; + zip_stat_init(&st2); + if (data_len >= 0) { + st2.valid = ZIP_STAT_SIZE; + st2.size = (zip_uint64_t)data_len; + } + s2 = _zip_source_window_new(src, start, data_len, &st2, ZIP_STAT_NAME, NULL, NULL, 0, true, error); if (s2 == NULL) { + zip_source_free(src); return NULL; } src = s2; diff --git a/core/deps/libzip/lib/zip_stat.c b/core/deps/libzip/lib/zip_stat.c index c328dcfb4..51d8026dd 100644 --- a/core/deps/libzip/lib/zip_stat.c +++ b/core/deps/libzip/lib/zip_stat.c @@ -1,9 +1,9 @@ /* zip_stat.c -- get information about file by name - Copyright (C) 1999-2020 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/core/deps/libzip/lib/zip_stat_index.c b/core/deps/libzip/lib/zip_stat_index.c index 62dc0455e..da33c09eb 100644 --- a/core/deps/libzip/lib/zip_stat_index.c +++ b/core/deps/libzip/lib/zip_stat_index.c @@ -3,7 +3,7 @@ Copyright (C) 1999-2020 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -39,22 +39,43 @@ ZIP_EXTERN int zip_stat_index(zip_t *za, zip_uint64_t index, zip_flags_t flags, zip_stat_t *st) { const char *name; zip_dirent_t *de; + zip_entry_t *entry; - if ((de = _zip_get_dirent(za, index, flags, NULL)) == NULL) + if ((de = _zip_get_dirent(za, index, flags, NULL)) == NULL) { return -1; + } - if ((name = zip_get_name(za, index, flags)) == NULL) + if ((name = zip_get_name(za, index, flags)) == NULL) { return -1; + } + entry = za->entry + index; if ((flags & ZIP_FL_UNCHANGED) == 0 && ZIP_ENTRY_DATA_CHANGED(za->entry + index)) { - zip_entry_t *entry = za->entry + index; if (zip_source_stat(entry->source, st) < 0) { zip_error_set(&za->error, ZIP_ER_CHANGED, 0); return -1; } + if (ZIP_CM_IS_DEFAULT(de->comp_method)) { + if (!(st->valid & ZIP_STAT_COMP_METHOD) || st->comp_method == ZIP_CM_STORE) { + st->valid &= ~(ZIP_STAT_COMP_SIZE|ZIP_STAT_COMP_METHOD); + } + } + else { + if ((st->valid & ZIP_STAT_COMP_METHOD) && st->comp_method != de->comp_method) { + st->valid &= ~ZIP_STAT_COMP_SIZE; + } + st->valid |= ZIP_STAT_COMP_METHOD; + st->comp_method = de->comp_method; + } + + if (((st->valid & (ZIP_STAT_COMP_METHOD|ZIP_STAT_SIZE)) == (ZIP_STAT_COMP_METHOD|ZIP_STAT_SIZE)) && st->comp_method == ZIP_CM_STORE) { + st->valid |= ZIP_STAT_COMP_SIZE; + st->comp_size = st->size; + } + if (entry->changes != NULL && entry->changes->changed & ZIP_DIRENT_LAST_MOD) { st->mtime = de->last_mod; st->valid |= ZIP_STAT_MTIME; @@ -70,6 +91,16 @@ zip_stat_index(zip_t *za, zip_uint64_t index, zip_flags_t flags, zip_stat_t *st) st->comp_method = (zip_uint16_t)de->comp_method; st->encryption_method = de->encryption_method; st->valid = (de->crc_valid ? ZIP_STAT_CRC : 0) | ZIP_STAT_SIZE | ZIP_STAT_MTIME | ZIP_STAT_COMP_SIZE | ZIP_STAT_COMP_METHOD | ZIP_STAT_ENCRYPTION_METHOD; + if (entry->changes != NULL && entry->changes->changed & ZIP_DIRENT_COMP_METHOD) { + st->valid &= ~ZIP_STAT_COMP_SIZE; + } + } + + if ((za->ch_flags & ZIP_AFL_WANT_TORRENTZIP) && (flags & ZIP_FL_UNCHANGED) == 0) { + st->comp_method = ZIP_CM_DEFLATE; + st->mtime = _zip_d2u_time(0xbc00, 0x2198); + st->valid |= ZIP_STAT_MTIME | ZIP_STAT_COMP_METHOD; + st->valid &= ~ZIP_STAT_COMP_SIZE; } st->index = index; diff --git a/core/deps/libzip/lib/zip_stat_init.c b/core/deps/libzip/lib/zip_stat_init.c index 0cf51efad..9c6088a79 100644 --- a/core/deps/libzip/lib/zip_stat_init.c +++ b/core/deps/libzip/lib/zip_stat_init.c @@ -1,9 +1,9 @@ /* zip_stat_init.c -- initialize struct zip_stat. - Copyright (C) 2006-2020 Dieter Baron and Thomas Klausner + Copyright (C) 2006-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/core/deps/libzip/lib/zip_strerror.c b/core/deps/libzip/lib/zip_strerror.c index 6adec16cd..7d8279318 100644 --- a/core/deps/libzip/lib/zip_strerror.c +++ b/core/deps/libzip/lib/zip_strerror.c @@ -1,9 +1,9 @@ /* zip_sterror.c -- get string representation of zip error - Copyright (C) 1999-2020 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/core/deps/libzip/lib/zip_string.c b/core/deps/libzip/lib/zip_string.c index 2c6f42826..1c964491c 100644 --- a/core/deps/libzip/lib/zip_string.c +++ b/core/deps/libzip/lib/zip_string.c @@ -1,9 +1,9 @@ /* zip_string.c -- string handling (with encoding) - Copyright (C) 2012-2020 Dieter Baron and Thomas Klausner + Copyright (C) 2012-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -150,7 +150,7 @@ _zip_string_new(const zip_uint8_t *raw, zip_uint16_t length, zip_flags_t flags, return NULL; } - memcpy(s->raw, raw, length); + (void)memcpy_s(s->raw, length + 1, raw, length); s->raw[length] = '\0'; s->length = length; s->encoding = ZIP_ENCODING_UNKNOWN; diff --git a/core/deps/libzip/lib/zip_unchange.c b/core/deps/libzip/lib/zip_unchange.c index 17e250099..d69a3dfe1 100644 --- a/core/deps/libzip/lib/zip_unchange.c +++ b/core/deps/libzip/lib/zip_unchange.c @@ -1,9 +1,9 @@ /* zip_unchange.c -- undo changes to file in zip archive - Copyright (C) 1999-2020 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 + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -46,14 +46,18 @@ zip_unchange(zip_t *za, zip_uint64_t idx) { int _zip_unchange(zip_t *za, zip_uint64_t idx, int allow_duplicates) { zip_int64_t i; - const char *orig_name, *changed_name; + bool renamed; if (idx >= za->nentry) { zip_error_set(&za->error, ZIP_ER_INVAL, 0); return -1; } - if (!allow_duplicates && za->entry[idx].changes && (za->entry[idx].changes->changed & ZIP_DIRENT_FILENAME)) { + renamed = za->entry[idx].changes && (za->entry[idx].changes->changed & ZIP_DIRENT_FILENAME); + if (!allow_duplicates && (renamed || za->entry[idx].deleted)) { + const char *orig_name = NULL; + const char *changed_name = NULL; + if (za->entry[idx].orig != NULL) { if ((orig_name = _zip_get_name(za, idx, ZIP_FL_UNCHANGED, &za->error)) == NULL) { return -1; @@ -65,12 +69,11 @@ _zip_unchange(zip_t *za, zip_uint64_t idx, int allow_duplicates) { return -1; } } - else { - orig_name = NULL; - } - if ((changed_name = _zip_get_name(za, idx, 0, &za->error)) == NULL) { - return -1; + if (renamed) { + if ((changed_name = _zip_get_name(za, idx, 0, &za->error)) == NULL) { + return -1; + } } if (orig_name) { @@ -78,9 +81,11 @@ _zip_unchange(zip_t *za, zip_uint64_t idx, int allow_duplicates) { return -1; } } - if (_zip_hash_delete(za->names, (const zip_uint8_t *)changed_name, &za->error) == false) { - _zip_hash_delete(za->names, (const zip_uint8_t *)orig_name, NULL); - return -1; + if (changed_name) { + if (_zip_hash_delete(za->names, (const zip_uint8_t *)changed_name, &za->error) == false) { + _zip_hash_delete(za->names, (const zip_uint8_t *)orig_name, NULL); + return -1; + } } } diff --git a/core/deps/libzip/lib/zip_unchange_all.c b/core/deps/libzip/lib/zip_unchange_all.c index b8bfd70e9..34f3702e0 100644 --- a/core/deps/libzip/lib/zip_unchange_all.c +++ b/core/deps/libzip/lib/zip_unchange_all.c @@ -1,9 +1,9 @@ /* zip_unchange.c -- undo changes to all files in zip archive - Copyright (C) 1999-2020 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/core/deps/libzip/lib/zip_unchange_archive.c b/core/deps/libzip/lib/zip_unchange_archive.c index ebf2bd58a..56a8e31f6 100644 --- a/core/deps/libzip/lib/zip_unchange_archive.c +++ b/core/deps/libzip/lib/zip_unchange_archive.c @@ -1,9 +1,9 @@ /* zip_unchange_archive.c -- undo global changes to ZIP archive - Copyright (C) 2006-2020 Dieter Baron and Thomas Klausner + Copyright (C) 2006-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/core/deps/libzip/lib/zip_unchange_data.c b/core/deps/libzip/lib/zip_unchange_data.c index 2a393add8..6bdecd187 100644 --- a/core/deps/libzip/lib/zip_unchange_data.c +++ b/core/deps/libzip/lib/zip_unchange_data.c @@ -1,9 +1,9 @@ /* zip_unchange_data.c -- undo helper function - Copyright (C) 1999-2020 Dieter Baron and Thomas Klausner + Copyright (C) 1999-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/core/deps/libzip/lib/zip_utf-8.c b/core/deps/libzip/lib/zip_utf-8.c index 51a47221e..678912f6b 100644 --- a/core/deps/libzip/lib/zip_utf-8.c +++ b/core/deps/libzip/lib/zip_utf-8.c @@ -1,9 +1,9 @@ /* zip_utf-8.c -- UTF-8 support functions for libzip - Copyright (C) 2011-2020 Dieter Baron and Thomas Klausner + Copyright (C) 2011-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/core/deps/libzip/lib/zip_winzip_aes.c b/core/deps/libzip/lib/zip_winzip_aes.c index 75b279a96..ce269036c 100644 --- a/core/deps/libzip/lib/zip_winzip_aes.c +++ b/core/deps/libzip/lib/zip_winzip_aes.c @@ -1,9 +1,9 @@ /* zip_winzip_aes.c -- Winzip AES de/encryption backend routines - Copyright (C) 2017-2020 Dieter Baron and Thomas Klausner + Copyright (C) 2017-2021 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -125,7 +125,7 @@ _zip_winzip_aes_new(const zip_uint8_t *password, zip_uint64_t password_length, c } if (password_verify) { - memcpy(password_verify, buffer + (2 * key_size / 8), WINZIP_AES_PASSWORD_VERIFY_LENGTH); + (void)memcpy_s(password_verify, WINZIP_AES_PASSWORD_VERIFY_LENGTH, buffer + (2 * key_size / 8), WINZIP_AES_PASSWORD_VERIFY_LENGTH); } return ctx; diff --git a/core/deps/libzip/lib/zipint.h b/core/deps/libzip/lib/zipint.h index 6036d2e42..4887b6c5c 100644 --- a/core/deps/libzip/lib/zipint.h +++ b/core/deps/libzip/lib/zipint.h @@ -3,10 +3,10 @@ /* zipint.h -- internal declarations. - Copyright (C) 1999-2020 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 + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions @@ -42,7 +42,9 @@ #include #endif -#ifndef _ZIP_COMPILING_DEPRECATED +#ifdef _ZIP_COMPILING_DEPRECATED +#define ZIP_DEPRECATED(x) +#else #define ZIP_DISABLE_DEPRECATED #endif @@ -67,6 +69,12 @@ #define EF_WINZIP_AES_SIZE 7 #define MAX_DATA_DESCRIPTOR_LENGTH 24 +#define TORRENTZIP_SIGNATURE "TORRENTZIPPED-" +#define TORRENTZIP_SIGNATURE_LENGTH 14 +#define TORRENTZIP_CRC_LENGTH 8 +#define TORRENTZIP_MEM_LEVEL 8 +#define TORRENTZIP_COMPRESSION_FLAGS ZIP_UINT16_MAX + #define ZIP_CRYPTO_PKWARE_HEADERLEN 12 #define ZIP_CM_REPLACED_DEFAULT (-2) @@ -76,7 +84,6 @@ #define WINZIP_AES_MAX_HEADER_LENGTH (16 + WINZIP_AES_PASSWORD_VERIFY_LENGTH) #define AES_BLOCK_SIZE 16 #define HMAC_LENGTH 10 -#define SHA1_LENGTH 20 #define SALT_LENGTH(method) ((method) == ZIP_EM_AES_128 ? 8 : ((method) == ZIP_EM_AES_192 ? 12 : 16)) #define ZIP_CM_IS_DEFAULT(x) ((x) == ZIP_CM_DEFAULT || (x) == ZIP_CM_REPLACED_DEFAULT) @@ -122,11 +129,11 @@ enum zip_compression_status { typedef enum zip_compression_status zip_compression_status_t; struct zip_compression_algorithm { - /* Return maxiumum compressed size for uncompressed data of given size. */ + /* Return maximum compressed size for uncompressed data of given size. */ zip_uint64_t (*maximum_compressed_size)(zip_uint64_t uncompressed_size); /* called once to create new context */ - void *(*allocate)(zip_uint16_t method, int compression_flags, zip_error_t *error); + void *(*allocate)(zip_uint16_t method, zip_uint32_t compression_flags, zip_error_t *error); /* called once to free context */ void (*deallocate)(void *ctx); @@ -170,25 +177,65 @@ const zip_uint8_t *zip_get_extra_field_by_id(zip_t *, int, int, zip_uint16_t, in user-supplied compression/encryption implementation is finished. Thus we will keep it private for now. */ -typedef zip_int64_t (*zip_source_layered_callback)(zip_source_t *, void *, void *, zip_uint64_t, enum zip_source_cmd); -zip_source_t *zip_source_compress(zip_t *za, zip_source_t *src, zip_int32_t cm, int compression_flags); -zip_source_t *zip_source_crc(zip_t *, zip_source_t *, int); +zip_source_t *zip_source_compress(zip_t *za, zip_source_t *src, zip_int32_t cm, zip_uint32_t compression_flags); +zip_source_t *zip_source_crc_create(zip_source_t *, int, zip_error_t *error); zip_source_t *zip_source_decompress(zip_t *za, zip_source_t *src, zip_int32_t cm); -zip_source_t *zip_source_layered(zip_t *, zip_source_t *, zip_source_layered_callback, void *); -zip_source_t *zip_source_layered_create(zip_source_t *src, zip_source_layered_callback cb, void *ud, zip_error_t *error); zip_source_t *zip_source_pkware_decode(zip_t *, zip_source_t *, zip_uint16_t, int, const char *); zip_source_t *zip_source_pkware_encode(zip_t *, zip_source_t *, zip_uint16_t, int, const char *); int zip_source_remove(zip_source_t *); zip_int64_t zip_source_supports(zip_source_t *src); -zip_source_t *zip_source_window(zip_t *, zip_source_t *, zip_uint64_t, zip_uint64_t); +bool zip_source_supports_reopen(zip_source_t *src); zip_source_t *zip_source_winzip_aes_decode(zip_t *, zip_source_t *, zip_uint16_t, int, const char *); zip_source_t *zip_source_winzip_aes_encode(zip_t *, zip_source_t *, zip_uint16_t, int, const char *); zip_source_t *zip_source_buffer_with_attributes(zip_t *za, const void *data, zip_uint64_t len, int freep, zip_file_attributes_t *attributes); +zip_source_t *zip_source_buffer_with_attributes_create(const void *data, zip_uint64_t len, int freep, zip_file_attributes_t *attributes, zip_error_t *error); /* error source for layered sources */ enum zip_les { ZIP_LES_NONE, ZIP_LES_UPPER, ZIP_LES_LOWER, ZIP_LES_INVAL }; +#define ZIP_DETAIL_ET_GLOBAL 0 +#define ZIP_DETAIL_ET_ENTRY 1 + +struct _zip_err_info { + int type; + const char *description; +}; + +extern const struct _zip_err_info _zip_err_str[]; +extern const int _zip_err_str_count; +extern const struct _zip_err_info _zip_err_details[]; +extern const int _zip_err_details_count; + +/* macros for libzip-internal errors */ +#define MAX_DETAIL_INDEX 0x7fffff +#define MAKE_DETAIL_WITH_INDEX(error, index) ((((index) > MAX_DETAIL_INDEX) ? MAX_DETAIL_INDEX : (int)(index)) << 8 | (error)) +#define GET_INDEX_FROM_DETAIL(error) (((error) >> 8) & MAX_DETAIL_INDEX) +#define GET_ERROR_FROM_DETAIL(error) ((error) & 0xff) +#define ADD_INDEX_TO_DETAIL(error, index) MAKE_DETAIL_WITH_INDEX(GET_ERROR_FROM_DETAIL(error), (index)) + +/* error code for libzip-internal errors */ +#define ZIP_ER_DETAIL_NO_DETAIL 0 /* G no detail */ +#define ZIP_ER_DETAIL_CDIR_OVERLAPS_EOCD 1 /* G central directory overlaps EOCD, or there is space between them */ +#define ZIP_ER_DETAIL_COMMENT_LENGTH_INVALID 2 /* G archive comment length incorrect */ +#define ZIP_ER_DETAIL_CDIR_LENGTH_INVALID 3 /* G central directory length invalid */ +#define ZIP_ER_DETAIL_CDIR_ENTRY_INVALID 4 /* E central header invalid */ +#define ZIP_ER_DETAIL_CDIR_WRONG_ENTRIES_COUNT 5 /* G central directory count of entries is incorrect */ +#define ZIP_ER_DETAIL_ENTRY_HEADER_MISMATCH 6 /* E local and central headers do not match */ +#define ZIP_ER_DETAIL_EOCD_LENGTH_INVALID 7 /* G wrong EOCD length */ +#define ZIP_ER_DETAIL_EOCD64_OVERLAPS_EOCD 8 /* G EOCD64 overlaps EOCD, or there is space between them */ +#define ZIP_ER_DETAIL_EOCD64_WRONG_MAGIC 9 /* G EOCD64 magic incorrect */ +#define ZIP_ER_DETAIL_EOCD64_MISMATCH 10 /* G EOCD64 and EOCD do not match */ +#define ZIP_ER_DETAIL_CDIR_INVALID 11 /* G invalid value in central directory */ +#define ZIP_ER_DETAIL_VARIABLE_SIZE_OVERFLOW 12 /* E variable size fields overflow header */ +#define ZIP_ER_DETAIL_INVALID_UTF8_IN_FILENAME 13 /* E invalid UTF-8 in filename */ +#define ZIP_ER_DETAIL_INVALID_UTF8_IN_COMMENT 13 /* E invalid UTF-8 in comment */ +#define ZIP_ER_DETAIL_INVALID_ZIP64_EF 14 /* E invalid Zip64 extra field */ +#define ZIP_ER_DETAIL_INVALID_WINZIPAES_EF 14 /* E invalid WinZip AES extra field */ +#define ZIP_ER_DETAIL_EF_TRAILING_GARBAGE 15 /* E garbage at end of extra fields */ +#define ZIP_ER_DETAIL_INVALID_EF_LENGTH 16 /* E extra field length is invalid */ +#define ZIP_ER_DETAIL_INVALID_FILE_LENGTH 17 /* E file length in header doesn't match actual file length */ + /* directory entry: general purpose bit flags */ #define ZIP_GPBF_ENCRYPTED 0x0001u /* is encrypted */ @@ -258,14 +305,14 @@ struct zip { zip_hash_t *names; /* hash table for name lookup */ zip_progress_t *progress; /* progress callback for zip_close() */ + + zip_uint32_t* write_crc; /* have _zip_write() compute CRC */ }; /* file in zip archive, part of API */ struct zip_file { - zip_t *za; /* zip archive containing this file */ zip_error_t error; /* error information */ - bool eof; zip_source_t *src; /* data source */ }; @@ -304,7 +351,7 @@ struct zip_dirent { zip_uint32_t ext_attrib; /* (c) external file attributes */ zip_uint64_t offset; /* (c) offset of local header */ - zip_uint16_t compression_level; /* level of compression to use (never valid in orig) */ + zip_uint32_t compression_level; /* level of compression to use (never valid in orig) */ zip_uint16_t encryption_method; /* encryption method, computed from other fields */ char *password; /* file specific encryption password */ }; @@ -414,7 +461,7 @@ struct zip_buffer { struct zip_filelist { zip_uint64_t idx; - /* TODO const char *name; */ + const char *name; }; typedef struct zip_filelist zip_filelist_t; @@ -427,10 +474,6 @@ struct _zip_pkware_keys { }; typedef struct _zip_pkware_keys zip_pkware_keys_t; -extern const char *const _zip_err_str[]; -extern const int _zip_nerr_str; -extern const int _zip_err_type[]; - #define ZIP_MAX(a, b) ((a) > (b) ? (a) : (b)) #define ZIP_MIN(a, b) ((a) < (b) ? (a) : (b)) @@ -439,6 +482,8 @@ extern const int _zip_err_type[]; #define ZIP_ENTRY_HAS_CHANGES(e) (ZIP_ENTRY_DATA_CHANGED(e) || (e)->deleted || ZIP_ENTRY_CHANGED((e), ZIP_DIRENT_ALL)) #define ZIP_IS_RDONLY(za) ((za)->ch_flags & ZIP_AFL_RDONLY) +#define ZIP_IS_TORRENTZIP(za) ((za)->flags & ZIP_AFL_IS_TORRENTZIP) +#define ZIP_WANT_TORRENTZIP(za) ((za)->ch_flags & ZIP_AFL_WANT_TORRENTZIP) #ifdef HAVE_EXPLICIT_MEMSET @@ -493,8 +538,11 @@ void _zip_dirent_finalize(zip_dirent_t *); void _zip_dirent_init(zip_dirent_t *); bool _zip_dirent_needs_zip64(const zip_dirent_t *, zip_flags_t); zip_dirent_t *_zip_dirent_new(void); +bool zip_dirent_process_ef_zip64(zip_dirent_t * zde, const zip_uint8_t * ef, zip_uint64_t got_len, bool local, zip_error_t * error); zip_int64_t _zip_dirent_read(zip_dirent_t *zde, zip_source_t *src, zip_buffer_t *buffer, bool local, zip_error_t *error); void _zip_dirent_set_version_needed(zip_dirent_t *de, bool force_zip64); +void zip_dirent_torrentzip_normalize(zip_dirent_t *de); + zip_int32_t _zip_dirent_size(zip_source_t *src, zip_uint16_t, zip_error_t *); int _zip_dirent_write(zip_t *za, zip_dirent_t *dirent, zip_flags_t flags); @@ -516,7 +564,6 @@ void _zip_error_clear(zip_error_t *); void _zip_error_get(const zip_error_t *, int *, int *); void _zip_error_copy(zip_error_t *dst, const zip_error_t *src); -void _zip_error_set_from_source(zip_error_t *, zip_source_t *); const zip_uint8_t *_zip_extract_extra_field_by_id(zip_error_t *, zip_uint16_t, int, const zip_uint8_t *, zip_uint16_t, zip_uint16_t *); @@ -538,7 +585,7 @@ zip_hash_t *_zip_hash_new(zip_error_t *error); bool _zip_hash_reserve_capacity(zip_hash_t *hash, zip_uint64_t capacity, zip_error_t *error); bool _zip_hash_revert(zip_hash_t *hash, zip_error_t *error); -int _zip_mkstempm(char *path, int mode); +int _zip_mkstempm(char *path, int mode, bool create_file); zip_t *_zip_open(zip_source_t *, unsigned int, zip_error_t *); @@ -569,16 +616,15 @@ bool _zip_source_had_error(zip_source_t *); void _zip_source_invalidate(zip_source_t *src); zip_source_t *_zip_source_new(zip_error_t *error); int _zip_source_set_source_archive(zip_source_t *, zip_t *); -zip_source_t *_zip_source_window_new(zip_source_t *src, zip_uint64_t start, zip_uint64_t length, zip_stat_t *st, zip_file_attributes_t *attributes, zip_t *source_archive, zip_uint64_t source_index, zip_error_t *error); -zip_source_t *_zip_source_zip_new(zip_t *, zip_t *, zip_uint64_t, zip_flags_t, zip_uint64_t, zip_uint64_t, const char *); +zip_source_t *_zip_source_window_new(zip_source_t *src, zip_uint64_t start, zip_int64_t length, zip_stat_t *st, zip_uint64_t st_invalid, zip_file_attributes_t *attributes, zip_t *source_archive, zip_uint64_t source_index, bool take_ownership, zip_error_t *error); int _zip_stat_merge(zip_stat_t *dst, const zip_stat_t *src, zip_error_t *error); -int _zip_string_equal(const zip_string_t *, const zip_string_t *); -void _zip_string_free(zip_string_t *); -zip_uint32_t _zip_string_crc32(const zip_string_t *); -const zip_uint8_t *_zip_string_get(zip_string_t *, zip_uint32_t *, zip_flags_t, zip_error_t *); -zip_uint16_t _zip_string_length(const zip_string_t *); -zip_string_t *_zip_string_new(const zip_uint8_t *, zip_uint16_t, zip_flags_t, zip_error_t *); +int _zip_string_equal(const zip_string_t *a, const zip_string_t *b); +void _zip_string_free(zip_string_t *string); +zip_uint32_t _zip_string_crc32(const zip_string_t *string); +const zip_uint8_t *_zip_string_get(zip_string_t *string, zip_uint32_t *lenp, zip_flags_t flags, zip_error_t *error); +zip_uint16_t _zip_string_length(const zip_string_t *string); +zip_string_t *_zip_string_new(const zip_uint8_t *raw, zip_uint16_t length, zip_flags_t flags, zip_error_t *error); int _zip_string_write(zip_t *za, const zip_string_t *string); bool _zip_winzip_aes_decrypt(zip_winzip_aes_t *ctx, zip_uint8_t *data, zip_uint64_t length); bool _zip_winzip_aes_encrypt(zip_winzip_aes_t *ctx, zip_uint8_t *data, zip_uint64_t length); diff --git a/core/deps/libzip/libzip-config.cmake.in b/core/deps/libzip/libzip-config.cmake.in index 5b9aa5580..806153036 100644 --- a/core/deps/libzip/libzip-config.cmake.in +++ b/core/deps/libzip/libzip-config.cmake.in @@ -1,9 +1,43 @@ @PACKAGE_INIT@ -# only needed for static library, and doesn't work as-is -#include(CMakeFindDependencyMacro) -#find_dependency(ZLIB::ZLIB) -# how to handle the optional dependencies? +# We need to supply transitive dependencies if this config is for a static library +set(IS_SHARED @BUILD_SHARED_LIBS@) +if (NOT IS_SHARED) + include(CMakeFindDependencyMacro) + set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_LIST_DIR}/modules") + + set(ENABLE_BZIP2 @BZIP2_FOUND@) + set(ENABLE_LZMA @LIBLZMA_FOUND@) + set(ENABLE_ZSTD @ZSTD_FOUND@) + set(ENABLE_GNUTLS @GNUTLS_FOUND@) + set(ENABLE_MBEDTLS @MBEDTLS_FOUND@) + set(ENABLE_OPENSSL @OPENSSL_FOUND@) + + find_dependency(ZLIB 1.1.2) + if(ENABLE_BZIP2) + find_dependency(BZip2) + endif() + + if(ENABLE_LZMA) + find_dependency(LibLZMA 5.2) + endif() + + if(ENABLE_ZSTD) + find_dependency(zstd 1.3.6) + endif() + + if(ENABLE_GNUTLS) + find_dependency(Nettle 3.0) + find_dependency(GnuTLS) + endif() + if(ENABLE_MBEDTLS) + find_dependency(MbedTLS 1.0) + endif() + if(ENABLE_OPENSSL) + find_dependency(OpenSSL) + endif() +endif() + # Provide all our library targets to users. include("${CMAKE_CURRENT_LIST_DIR}/libzip-targets.cmake") diff --git a/core/deps/libzip/libzip.pc.in b/core/deps/libzip/libzip.pc.in index 58b3dca7c..d51b0ab63 100644 --- a/core/deps/libzip/libzip.pc.in +++ b/core/deps/libzip/libzip.pc.in @@ -1,10 +1,10 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ +prefix=@CMAKE_INSTALL_PREFIX@ +exec_prefix=${prefix} bindir=@bindir@ libdir=@libdir@ includedir=@includedir@ -zipcmp=@bindir@/zipcmp +zipcmp=${bindir}/zipcmp Name: libzip Description: library for handling zip archives @@ -12,4 +12,3 @@ Version: @PROJECT_VERSION@ Libs: @PKG_CONFIG_RPATH@ -L${libdir} -lzip Libs.private: @LIBS@ Cflags: -I${includedir} - diff --git a/core/deps/libzip/man/CMakeLists.txt b/core/deps/libzip/man/CMakeLists.txt index 90d462a51..fe3f091f7 100644 --- a/core/deps/libzip/man/CMakeLists.txt +++ b/core/deps/libzip/man/CMakeLists.txt @@ -54,6 +54,7 @@ set(MAN_PAGES zip_libzip_version.3 zip_name_locate.3 zip_open.3 + zip_register_cancel_callback_with_state.3 zip_register_progress_callback.3 zip_register_progress_callback_with_state.3 zip_rename.3 @@ -74,6 +75,8 @@ set(MAN_PAGES zip_source_free.3 zip_source_function.3 zip_source_is_deleted.3 + zip_source_is_seekable.3 + zip_source_layered.3 zip_source_keep.3 zip_source_make_command_bitmap.3 zip_source_open.3 @@ -88,8 +91,10 @@ set(MAN_PAGES zip_source_win32a.3 zip_source_win32handle.3 zip_source_win32w.3 + zip_source_window_create.3 zip_source_write.3 zip_source_zip.3 + zip_source_zip_file.3 zip_stat.3 zip_stat_init.3 zip_unchange.3 @@ -114,7 +119,7 @@ foreach(MAN_PAGE ${MAN_PAGES}) #configure_file(${SOURCE_FILE} ${MAN_PAGE} COPYONLY) add_custom_command(OUTPUT ${MAN_PAGE} DEPENDS ${SOURCE_FILE} - COMMAND ${CMAKE_COMMAND} -E copy_if_different ${PROJECT_SOURCE_DIR}/man/${SOURCE_FILE} ${PROJECT_BINARY_DIR}/man/${MAN_PAGE} + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_SOURCE_DIR}/${SOURCE_FILE} ${CMAKE_CURRENT_BINARY_DIR}/${MAN_PAGE} COMMENT "Preparing ${MAN_PAGE}" ) @@ -123,18 +128,20 @@ foreach(MAN_PAGE ${MAN_PAGES}) string(REGEX REPLACE "[1-9]$" "mdoc" MDOC_FILE ${MAN_PAGE}) # html re-generation - add_custom_command(OUTPUT ${PROJECT_SOURCE_DIR}/man/${HTML_FILE} + add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${HTML_FILE} DEPENDS ${MDOC_FILE} - COMMAND ${CMAKE_COMMAND} -DIN=${MDOC_FILE} -DOUT=${HTML_FILE} -DDIR=${PROJECT_SOURCE_DIR}/man -P ${PROJECT_SOURCE_DIR}/man/update-html.cmake + COMMAND ${CMAKE_COMMAND} -DIN=${CMAKE_CURRENT_SOURCE_DIR}/${MDOC_FILE} -DOUT=${CMAKE_CURRENT_BINARY_DIR}/${HTML_FILE} -P ${CMAKE_CURRENT_SOURCE_DIR}/update-html.cmake + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_BINARY_DIR}/${HTML_FILE} ${CMAKE_CURRENT_SOURCE_DIR}/${HTML_FILE} ) - list(APPEND UPDATEHTML ${PROJECT_SOURCE_DIR}/man/${HTML_FILE}) + list(APPEND UPDATEHTML ${CMAKE_CURRENT_BINARY_DIR}/${HTML_FILE}) # man re-generation - add_custom_command(OUTPUT ${PROJECT_SOURCE_DIR}/man/${MAN_FILE} + add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${MAN_FILE} DEPENDS ${MDOC_FILE} - COMMAND ${CMAKE_COMMAND} -DIN=${MDOC_FILE} -DOUT=${MAN_FILE} -DDIR=${PROJECT_SOURCE_DIR}/man -P ${PROJECT_SOURCE_DIR}/man/update-man.cmake + COMMAND ${CMAKE_COMMAND} -DIN=${CMAKE_CURRENT_SOURCE_DIR}/${MDOC_FILE} -DOUT=${CMAKE_CURRENT_BINARY_DIR}/${MAN_FILE} -P ${CMAKE_CURRENT_SOURCE_DIR}/update-man.cmake + COMMAND ${CMAKE_COMMAND} -E copy_if_different ${CMAKE_CURRENT_BINARY_DIR}/${MAN_FILE} ${CMAKE_CURRENT_SOURCE_DIR}/${MAN_FILE} ) - list(APPEND UPDATEMAN ${PROJECT_SOURCE_DIR}/man/${MAN_FILE}) + list(APPEND UPDATEMAN ${CMAKE_CURRENT_BINARY_DIR}/${MAN_FILE}) endforeach() add_custom_target(man ALL DEPENDS ${MAN_PAGES}) add_custom_target(update-man DEPENDS ${UPDATEMAN}) diff --git a/core/deps/libzip/man/ZIP_SOURCE_GET_ARGS.html b/core/deps/libzip/man/ZIP_SOURCE_GET_ARGS.html index bea0f3c6f..cae3b3f48 100644 --- a/core/deps/libzip/man/ZIP_SOURCE_GET_ARGS.html +++ b/core/deps/libzip/man/ZIP_SOURCE_GET_ARGS.html @@ -5,7 +5,7 @@ Copyright (C) 2014-2017 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/core/deps/libzip/man/ZIP_SOURCE_GET_ARGS.man b/core/deps/libzip/man/ZIP_SOURCE_GET_ARGS.man index 0e23ebd2a..cd49d5fde 100644 --- a/core/deps/libzip/man/ZIP_SOURCE_GET_ARGS.man +++ b/core/deps/libzip/man/ZIP_SOURCE_GET_ARGS.man @@ -3,7 +3,7 @@ .\" Copyright (C) 2014-2017 Dieter Baron and Thomas Klausner .\" .\" This file is part of libzip, a library to manipulate ZIP archives. -.\" The authors can be contacted at +.\" The authors can be contacted at .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions diff --git a/core/deps/libzip/man/ZIP_SOURCE_GET_ARGS.mdoc b/core/deps/libzip/man/ZIP_SOURCE_GET_ARGS.mdoc index 2735964e1..3f8fb40ea 100644 --- a/core/deps/libzip/man/ZIP_SOURCE_GET_ARGS.mdoc +++ b/core/deps/libzip/man/ZIP_SOURCE_GET_ARGS.mdoc @@ -2,7 +2,7 @@ .\" Copyright (C) 2014-2017 Dieter Baron and Thomas Klausner .\" .\" This file is part of libzip, a library to manipulate ZIP archives. -.\" The authors can be contacted at +.\" The authors can be contacted at .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions diff --git a/core/deps/libzip/man/fix-man-links.sh b/core/deps/libzip/man/fix-man-links.sh deleted file mode 100644 index 53b7b0766..000000000 --- a/core/deps/libzip/man/fix-man-links.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/sh - -# -LINKBASE='http://pubs.opengroup.org/onlinepubs/9699919799/functions/' - -sed -E -e 's,(),\1'"$LINKBASE"'\2\3,g' -e "s,$LINKBASE"'(libzip|zip),\1,g' diff --git a/core/deps/libzip/man/libzip.html b/core/deps/libzip/man/libzip.html index bda14619d..693b04fd3 100644 --- a/core/deps/libzip/man/libzip.html +++ b/core/deps/libzip/man/libzip.html @@ -2,10 +2,10 @@ + + + + ZIP_REGISTER_CANCEL_CALLBACK_WITH_STATE(3) + + + + + + + + +
ZIP_REGISTER_CANCEL_CALLBACK_WITH_STATE(3)Library Functions ManualZIP_REGISTER_CANCEL_CALLBACK_WITH_STATE(3)
+
+
+

+zip_register_cancel_callback_with_state — +
allow cancelling during zip_close
+
+
+

+libzip (-lzip) +
+
+

+#include <zip.h> +

typedef int (*zip_cancel_callback)(zip_t *, void + *);

+

void +
+ zip_register_cancel_callback_with_state(zip_t + *archive, + zip_cancel_callback + callback, void + (*ud_free)(void *), void + *ud);

+
+
+

+This function can be used to cancel writing of a zip archive during + zip_close(3). +

The + zip_register_cancel_callback_with_state() function + registers a callback function callback for the zip + archive archive. The ud_free + function is called during cleanup for deleting the userdata supplied in + ud.

+

The callback function is called during + zip_close(3) in regular intervals + (after every zip archive entry that's completely written to disk, and while + writing data for entries) with zip archive archive and + the user-provided user-data ud as arguments. When the + callback function returns a non-zero value, writing is cancelled and + zip_close(3) returns an error.

+

The callback function should be fast, since it will be called + often.

+
+
+

+libzip(3), + zip_close(3), + zip_register_progress_callback_with_state(3) +
+
+

+zip_register_cancel_callback_with_state() was added in + libzip 1.6.0. +
+
+

+Dieter Baron + <dillo@nih.at> and + Thomas Klausner + <tk@giga.or.at> +
+
+ + + + + +
June 18, 2022NiH
+ + diff --git a/core/deps/libzip/man/zip_register_cancel_callback_with_state.man b/core/deps/libzip/man/zip_register_cancel_callback_with_state.man new file mode 100644 index 000000000..28a46a45c --- /dev/null +++ b/core/deps/libzip/man/zip_register_cancel_callback_with_state.man @@ -0,0 +1,90 @@ +.\" Automatically generated from an mdoc input file. Do not edit. +.\" zip_register_cancel_callback_with_state.mdoc -- allow cancelling during zip_close +.\" Copyright (C) 2021-2022 Dieter Baron and Thomas Klausner +.\" +.\" This file is part of libzip, a library to manipulate ZIP archives. +.\" The authors can be contacted at +.\" +.\" 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. +.\" 3. The names of the authors may not be used to endorse or promote +.\" products derived from this software without specific prior +.\" written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``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 AUTHORS 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. +.\" +.TH "ZIP_REGISTER_CANCEL_CALLBACK_WITH_STATE" "3" "June 18, 2022" "NiH" "Library Functions Manual" +.nh +.if n .ad l +.SH "NAME" +\fBzip_register_cancel_callback_with_state\fR +\- allow cancelling during zip_close +.SH "LIBRARY" +libzip (-lzip) +.SH "SYNOPSIS" +\fB#include \fR +.sp +\fItypedef int (*zip_cancel_callback)(zip_t *, void *);\fR +.sp +\fIvoid\fR +.br +.PD 0 +.HP 4n +\fBzip_register_cancel_callback_with_state\fR(\fIzip_t\ *archive\fR, \fIzip_cancel_callback\ callback\fR, \fIvoid\ (*ud_free)(void\ *)\fR, \fIvoid\ *ud\fR); +.PD +.SH "DESCRIPTION" +This function can be used to cancel writing of a zip archive during +zip_close(3). +.PP +The +\fBzip_register_cancel_callback_with_state\fR() +function registers a callback function +\fIcallback\fR +for the zip archive +\fIarchive\fR. +The +\fIud_free\fR +function is called during cleanup for deleting the userdata supplied in +\fIud\fR. +.PP +The callback function is called during +zip_close(3) +in regular intervals (after every zip archive entry that's completely +written to disk, and while writing data for entries) with zip archive +\fIarchive\fR +and the user-provided user-data +\fIud\fR +as arguments. +When the callback function returns a non-zero value, writing is cancelled and +zip_close(3) +returns an error. +.PP +The callback function should be fast, since it will be called often. +.SH "SEE ALSO" +libzip(3), +zip_close(3), +zip_register_progress_callback_with_state(3) +.SH "HISTORY" +\fBzip_register_cancel_callback_with_state\fR() +was added in libzip 1.6.0. +.SH "AUTHORS" +Dieter Baron <\fIdillo@nih.at\fR> +and +Thomas Klausner <\fItk@giga.or.at\fR> diff --git a/core/deps/libzip/man/zip_register_cancel_callback_with_state.mdoc b/core/deps/libzip/man/zip_register_cancel_callback_with_state.mdoc new file mode 100644 index 000000000..b0712cbbb --- /dev/null +++ b/core/deps/libzip/man/zip_register_cancel_callback_with_state.mdoc @@ -0,0 +1,84 @@ +.\" zip_register_cancel_callback_with_state.mdoc -- allow cancelling during zip_close +.\" Copyright (C) 2021-2022 Dieter Baron and Thomas Klausner +.\" +.\" This file is part of libzip, a library to manipulate ZIP archives. +.\" The authors can be contacted at +.\" +.\" 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. +.\" 3. The names of the authors may not be used to endorse or promote +.\" products derived from this software without specific prior +.\" written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``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 AUTHORS 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 June 18, 2022 +.Dt ZIP_REGISTER_CANCEL_CALLBACK_WITH_STATE 3 +.Os +.Sh NAME +.Nm zip_register_cancel_callback_with_state +.Nd allow cancelling during zip_close +.Sh LIBRARY +libzip (-lzip) +.Sh SYNOPSIS +.In zip.h +.Vt typedef int (*zip_cancel_callback)(zip_t *, void *); +.Ft void +.Fn zip_register_cancel_callback_with_state "zip_t *archive" "zip_cancel_callback callback" "void (*ud_free)(void *)" "void *ud" +.Sh DESCRIPTION +This function can be used to cancel writing of a zip archive during +.Xr zip_close 3 . +.Pp +The +.Fn zip_register_cancel_callback_with_state +function registers a callback function +.Ar callback +for the zip archive +.Ar archive . +The +.Ar ud_free +function is called during cleanup for deleting the userdata supplied in +.Ar ud . +.Pp +The callback function is called during +.Xr zip_close 3 +in regular intervals (after every zip archive entry that's completely +written to disk, and while writing data for entries) with zip archive +.Ar archive +and the user-provided user-data +.Ar ud +as arguments. +When the callback function returns a non-zero value, writing is cancelled and +.Xr zip_close 3 +returns an error. +.Pp +The callback function should be fast, since it will be called often. +.Sh SEE ALSO +.Xr libzip 3 , +.Xr zip_close 3 , +.Xr zip_register_progress_callback_with_state 3 +.Sh HISTORY +.Fn zip_register_cancel_callback_with_state +was added in libzip 1.6.0. +.Sh AUTHORS +.An -nosplit +.An Dieter Baron Aq Mt dillo@nih.at +and +.An Thomas Klausner Aq Mt tk@giga.or.at diff --git a/core/deps/libzip/man/zip_register_progress_callback.html b/core/deps/libzip/man/zip_register_progress_callback.html index e61b7ceb9..5ba547b0b 100644 --- a/core/deps/libzip/man/zip_register_progress_callback.html +++ b/core/deps/libzip/man/zip_register_progress_callback.html @@ -5,7 +5,7 @@ Copyright (C) 2016-2017 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/core/deps/libzip/man/zip_register_progress_callback.man b/core/deps/libzip/man/zip_register_progress_callback.man index 3d0e5b94d..2a1ed23d9 100644 --- a/core/deps/libzip/man/zip_register_progress_callback.man +++ b/core/deps/libzip/man/zip_register_progress_callback.man @@ -3,7 +3,7 @@ .\" Copyright (C) 2016-2017 Dieter Baron and Thomas Klausner .\" .\" This file is part of libzip, a library to manipulate ZIP archives. -.\" The authors can be contacted at +.\" The authors can be contacted at .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions diff --git a/core/deps/libzip/man/zip_register_progress_callback.mdoc b/core/deps/libzip/man/zip_register_progress_callback.mdoc index 9fd0cd0d7..f512bb0b8 100644 --- a/core/deps/libzip/man/zip_register_progress_callback.mdoc +++ b/core/deps/libzip/man/zip_register_progress_callback.mdoc @@ -2,7 +2,7 @@ .\" Copyright (C) 2016-2017 Dieter Baron and Thomas Klausner .\" .\" This file is part of libzip, a library to manipulate ZIP archives. -.\" The authors can be contacted at +.\" The authors can be contacted at .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions diff --git a/core/deps/libzip/man/zip_register_progress_callback_with_state.html b/core/deps/libzip/man/zip_register_progress_callback_with_state.html index 4faf331d5..086a16e0c 100644 --- a/core/deps/libzip/man/zip_register_progress_callback_with_state.html +++ b/core/deps/libzip/man/zip_register_progress_callback_with_state.html @@ -2,10 +2,10 @@ + + + + ZIP_SOURCE_IS_SEEKABLE(3) + + + + + + + + +
ZIP_SOURCE_IS_SEEKABLE(3)Library Functions ManualZIP_SOURCE_IS_SEEKABLE(3)
+
+
+

+zip_source_is_seekable — +
check if a source supports seeking
+
+
+

+libzip (-lzip) +
+
+

+#include <zip.h> +

int +
+ zip_source_is_seekable(zip_source_t + *source);

+
+
+

+The function zip_source_is_seekable() checks if + source supports seeking via + zip_source_seek(3). +
+
+

+If the source supports seeking, 1 is returned. Otherwise, 0 is returned. +
+
+

+libzip(3), + zip_source(3), + zip_source_seek(3) +
+
+

+zip_source_is_seekable() was added in libzip 1.10.0. +
+
+

+Dieter Baron + <dillo@nih.at> and + Thomas Klausner + <tk@giga.or.at> +
+
+ + + + + +
March 10, 2023NiH
+ + diff --git a/core/deps/libzip/man/zip_source_is_seekable.man b/core/deps/libzip/man/zip_source_is_seekable.man new file mode 100644 index 000000000..bd31d0fa4 --- /dev/null +++ b/core/deps/libzip/man/zip_source_is_seekable.man @@ -0,0 +1,70 @@ +.\" Automatically generated from an mdoc input file. Do not edit. +.\" zip_source_seek.mdoc -- set read offset in source +.\" Copyright (C) 2023 Dieter Baron and Thomas Klausner +.\" +.\" This file is part of libzip, a library to manipulate ZIP archives. +.\" The authors can be contacted at +.\" +.\" 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. +.\" 3. The names of the authors may not be used to endorse or promote +.\" products derived from this software without specific prior +.\" written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``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 AUTHORS 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. +.\" +.TH "ZIP_SOURCE_IS_SEEKABLE" "3" "March 10, 2023" "NiH" "Library Functions Manual" +.nh +.if n .ad l +.SH "NAME" +\fBzip_source_is_seekable\fR +\- check if a source supports seeking +.SH "LIBRARY" +libzip (-lzip) +.SH "SYNOPSIS" +\fB#include \fR +.sp +\fIint\fR +.br +.PD 0 +.HP 4n +\fBzip_source_is_seekable\fR(\fIzip_source_t\ *source\fR); +.PD +.SH "DESCRIPTION" +The function +\fBzip_source_is_seekable\fR() +checks if +\fIsource\fR +supports seeking via +zip_source_seek(3). +.SH "RETURN VALUES" +If the source supports seeking, 1 is returned. +Otherwise, 0 is returned. +.SH "SEE ALSO" +libzip(3), +zip_source(3), +zip_source_seek(3) +.SH "HISTORY" +\fBzip_source_is_seekable\fR() +was added in libzip 1.10.0. +.SH "AUTHORS" +Dieter Baron <\fIdillo@nih.at\fR> +and +Thomas Klausner <\fItk@giga.or.at\fR> diff --git a/core/deps/libzip/man/zip_source_is_seekable.mdoc b/core/deps/libzip/man/zip_source_is_seekable.mdoc new file mode 100644 index 000000000..ad90bc755 --- /dev/null +++ b/core/deps/libzip/man/zip_source_is_seekable.mdoc @@ -0,0 +1,65 @@ +.\" zip_source_seek.mdoc -- set read offset in source +.\" Copyright (C) 2023 Dieter Baron and Thomas Klausner +.\" +.\" This file is part of libzip, a library to manipulate ZIP archives. +.\" The authors can be contacted at +.\" +.\" 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. +.\" 3. The names of the authors may not be used to endorse or promote +.\" products derived from this software without specific prior +.\" written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``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 AUTHORS 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 10, 2023 +.Dt ZIP_SOURCE_IS_SEEKABLE 3 +.Os +.Sh NAME +.Nm zip_source_is_seekable +.Nd check if a source supports seeking +.Sh LIBRARY +libzip (-lzip) +.Sh SYNOPSIS +.In zip.h +.Ft int +.Fn zip_source_is_seekable "zip_source_t *source" +.Sh DESCRIPTION +The function +.Fn zip_source_is_seekable +checks if +.Fa source +supports seeking via +.Xr zip_source_seek 3 . +.Sh RETURN VALUES +If the source supports seeking, 1 is returned. +Otherwise, 0 is returned. +.Sh SEE ALSO +.Xr libzip 3 , +.Xr zip_source 3 , +.Xr zip_source_seek 3 +.Sh HISTORY +.Fn zip_source_is_seekable +was added in libzip 1.10.0. +.Sh AUTHORS +.An -nosplit +.An Dieter Baron Aq Mt dillo@nih.at +and +.An Thomas Klausner Aq Mt tk@giga.or.at diff --git a/core/deps/libzip/man/zip_source_keep.html b/core/deps/libzip/man/zip_source_keep.html index fc7d1d16f..0219d64a0 100644 --- a/core/deps/libzip/man/zip_source_keep.html +++ b/core/deps/libzip/man/zip_source_keep.html @@ -5,7 +5,7 @@ Copyright (C) 2014-2017 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/core/deps/libzip/man/zip_source_keep.man b/core/deps/libzip/man/zip_source_keep.man index 488673cbe..78a2d3958 100644 --- a/core/deps/libzip/man/zip_source_keep.man +++ b/core/deps/libzip/man/zip_source_keep.man @@ -3,7 +3,7 @@ .\" Copyright (C) 2014-2017 Dieter Baron and Thomas Klausner .\" .\" This file is part of libzip, a library to manipulate ZIP archives. -.\" The authors can be contacted at +.\" The authors can be contacted at .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions diff --git a/core/deps/libzip/man/zip_source_keep.mdoc b/core/deps/libzip/man/zip_source_keep.mdoc index 122c4f84a..0984d6c52 100644 --- a/core/deps/libzip/man/zip_source_keep.mdoc +++ b/core/deps/libzip/man/zip_source_keep.mdoc @@ -2,7 +2,7 @@ .\" Copyright (C) 2014-2017 Dieter Baron and Thomas Klausner .\" .\" This file is part of libzip, a library to manipulate ZIP archives. -.\" The authors can be contacted at +.\" The authors can be contacted at .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions diff --git a/core/deps/libzip/man/zip_source_layered.html b/core/deps/libzip/man/zip_source_layered.html new file mode 100644 index 000000000..c53905360 --- /dev/null +++ b/core/deps/libzip/man/zip_source_layered.html @@ -0,0 +1,215 @@ + + + + + + + ZIP_SOURCE_LAYERED(3) + + + + + + + + +
ZIP_SOURCE_LAYERED(3)Library Functions ManualZIP_SOURCE_LAYERED(3)
+
+
+

+zip_source_layered, + zip_source_layered_create — +
create layered data source from function
+
+
+

+libzip (-lzip) +
+
+

+#include <zip.h> +

zip_source_t * +
+ zip_source_layered(zip_t + *archive, zip_source_t + *source, + zip_source_layered_callback + fn, void + *userdata);

+

zip_source_t * +
+ zip_source_layered_create(zip_source_t + *source, + zip_source_layered_callback + fn, void *userdata, + zip_error_t *error);

+
+
+

+The functions zip_source_layered() and + zip_source_layered_create() create a layered zip + source from the user-provided function fn, which must be + of the following type: +

typedef zip_int64_t + (*p_source_layered_callback)(zip_source_t + *source, void *userdata, void + *data, zip_uint64_t length, + zip_source_cmd_t cmd);

+

archive or error are + used for reporting errors and can be NULL.

+

When called by the library, the first argument is the + source of the lower layer, the second argument is the + userdata argument supplied to the function. The next + two arguments are a buffer data of size + length when data is passed in or expected to be + returned, or else NULL and 0. The last argument, + cmd, specifies which action the function should + perform.

+

See + zip_source_function(3) for + a description of the commands.

+

A layered source transforms the data or metadata of the source + below in some way. Layered sources can't support writing and are not + sufficient to cleanly add support for additional compression or encryption + methods. This may be revised in a later release of libzip.

+

On success, the layered source takes ownership of + source. The caller should not free it.

+

The interaction with the lower layer depends on the command:

+
+

ZIP_SOURCE_ACCEPT_EMPTY

+If the layered source supports this command, the lower layer is not called + automatically. Otherwise, the return value of the lower source is used. +
+
+

ZIP_SOURCE_CLOSE

+The lower layer is closed after the callback returns. +
+
+

ZIP_SOURCE_ERROR

+The lower layer is not called automatically. If you need to retrieve error + information from the lower layer, use + zip_error_set_from_source(3) + or + zip_source_pass_to_lower_layer(3). +
+
+

ZIP_SOURCE_FREE

+The lower layer is freed after the callback returns. +
+
+

ZIP_SOURCE_GET_FILE_ATTRIBUTES

+The attributes of the lower layer are merged with the attributes returned by the + callback: information set by the callback wins over the lower layer, with the + following exceptions: the higher version_needed is used, + and general_purpose_bit_flags are only overwritten if + the corresponding bit is set in + general_purpose_bit_mask. +
+
+

ZIP_SOURCE_OPEN

+The lower layer is opened before the callback is called. +
+
+

ZIP_SOURCE_READ

+The lower layer is not called automatically. +
+
+

ZIP_SOURCE_SEEK

+The lower layer is not called automatically. +
+
+

ZIP_SOURCE_STAT

+data contains the stat information from the lower layer + when the callback is called. +
+
+

ZIP_SOURCE_SUPPORTS

+data contains the bitmap of commands supported by the + lower layer when the callback is called. Since layered sources can't support + writing, all commands related to writing are stripped from the returned + support bitmap. +
+
+

ZIP_SOURCE_TELL

+The lower layer is not called automatically. +
+
+
+

+Upon successful completion, the created source is returned. Otherwise, + NULL is returned and the error code in + archive or error is set to + indicate the error (unless it is NULL). +
+
+

+zip_source_layered() fails if: +
+
[]
+
Required memory could not be allocated.
+
+
+
+

+libzip(3), + zip_file_add(3), + zip_file_attributes_init(3), + zip_file_replace(3), + zip_source(3), + zip_source_function(3), + zip_source_pass_to_lower_layer(3) +
+
+

+zip_source_layered() and + zip_source_layered_create() were added in libzip 1.10. +
+
+

+Dieter Baron + <dillo@nih.at> and + Thomas Klausner + <tk@giga.or.at> +
+
+ + + + + +
January 20, 2023NiH
+ + diff --git a/core/deps/libzip/man/zip_source_layered.man b/core/deps/libzip/man/zip_source_layered.man new file mode 100644 index 000000000..eaa4690b1 --- /dev/null +++ b/core/deps/libzip/man/zip_source_layered.man @@ -0,0 +1,173 @@ +.\" Automatically generated from an mdoc input file. Do not edit. +.\" zip_source_layered.mdoc -- create layered source from function +.\" Copyright (C) 2004-2022 Dieter Baron and Thomas Klausner +.\" +.\" This file is part of libzip, a library to manipulate ZIP archives. +.\" The authors can be contacted at +.\" +.\" 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. +.\" 3. The names of the authors may not be used to endorse or promote +.\" products derived from this software without specific prior +.\" written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``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 AUTHORS 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. +.\" +.TH "ZIP_SOURCE_LAYERED" "3" "January 20, 2023" "NiH" "Library Functions Manual" +.nh +.if n .ad l +.SH "NAME" +\fBzip_source_layered\fR, +\fBzip_source_layered_create\fR +\- create layered data source from function +.SH "LIBRARY" +libzip (-lzip) +.SH "SYNOPSIS" +\fB#include \fR +.sp +\fIzip_source_t *\fR +.br +.PD 0 +.HP 4n +\fBzip_source_layered\fR(\fIzip_t\ *archive\fR, \fIzip_source_t\ *source\fR, \fIzip_source_layered_callback\ fn\fR, \fIvoid\ *userdata\fR); +.PD +.PP +\fIzip_source_t *\fR +.br +.PD 0 +.HP 4n +\fBzip_source_layered_create\fR(\fIzip_source_t\ *source\fR, \fIzip_source_layered_callback\ fn\fR, \fIvoid\ *userdata\fR, \fIzip_error_t\ *error\fR); +.PD +.SH "DESCRIPTION" +The functions +\fBzip_source_layered\fR() +and +\fBzip_source_layered_create\fR() +create a layered zip source from the user-provided function +\fIfn\fR, +which must be of the following type: +.PP +\fItypedef zip_int64_t\fR +\fB\fR(*\zip_source_layered_callback\fR)\fP\fR(\fIzip_source_t\ *source\fR, \fIvoid\ *userdata\fR, \fIvoid\ *data\fR, \fIzip_uint64_t\ length\fR, \fIzip_source_cmd_t\ cmd\fR) +.PP +\fIarchive\fR +or +\fIerror\fR +are used for reporting errors and can be +\fRNULL\fR. +.PP +When called by the library, the first argument is the +\fIsource\fR +of the lower layer, the second argument is the +\fIuserdata\fR +argument supplied to the function. +The next two arguments are a buffer +\fIdata\fR +of size +\fIlength\fR +when data is passed in or expected to be returned, or else +\fRNULL\fR +and 0. +The last argument, +\fIcmd\fR, +specifies which action the function should perform. +.PP +See +zip_source_function(3) +for a description of the commands. +.PP +A layered source transforms the data or metadata of the source below in some way. +Layered sources can't support writing and are not sufficient to cleanly add support for additional compression or encryption methods. +This may be revised in a later release of libzip. +.PP +On success, the layered source takes ownership of +\fIsource\fR. +The caller should not free it. +.PP +The interaction with the lower layer depends on the command: +.SS "\fRZIP_SOURCE_ACCEPT_EMPTY\fR" +If the layered source supports this command, the lower layer is not called automatically. +Otherwise, the return value of the lower source is used. +.SS "\fRZIP_SOURCE_CLOSE\fR" +The lower layer is closed after the callback returns. +.SS "\fRZIP_SOURCE_ERROR\fR" +The lower layer is not called automatically. +If you need to retrieve error information from the lower layer, use +zip_error_set_from_source(3) +or +zip_source_pass_to_lower_layer(3). +.SS "\fRZIP_SOURCE_FREE\fR" +The lower layer is freed after the callback returns. +.SS "\fRZIP_SOURCE_GET_FILE_ATTRIBUTES\fR" +The attributes of the lower layer are merged with the attributes returned by the callback: information set by the callback wins over the lower layer, with the following exceptions: the higher +\fIversion_needed\fR +is used, and +\fIgeneral_purpose_bit_flags\fR +are only overwritten if the corresponding bit is set in +\fIgeneral_purpose_bit_mask\fR. +.SS "\fRZIP_SOURCE_OPEN\fR" +The lower layer is opened before the callback is called. +.SS "\fRZIP_SOURCE_READ\fR" +The lower layer is not called automatically. +.SS "\fRZIP_SOURCE_SEEK\fR" +The lower layer is not called automatically. +.SS "\fRZIP_SOURCE_STAT\fR" +\fIdata\fR +contains the stat information from the lower layer when the callback is called. +.SS "\fRZIP_SOURCE_SUPPORTS\fR" +\fIdata\fR +contains the bitmap of commands supported by the lower layer when the callback is called. +Since layered sources can't support writing, all commands related to writing are stripped from the returned support bitmap. +.SS "\fRZIP_SOURCE_TELL\fR" +The lower layer is not called automatically. +.SH "RETURN VALUES" +Upon successful completion, the created source is returned. +Otherwise, +\fRNULL\fR +is returned and the error code in +\fIarchive\fR +or +\fIerror\fR +is set to indicate the error (unless +it is +\fRNULL\fR). +.SH "ERRORS" +\fBzip_source_layered\fR() +fails if: +.TP 19n +[\fRZIP_ER_MEMORY\fR] +Required memory could not be allocated. +.SH "SEE ALSO" +libzip(3), +zip_file_add(3), +zip_file_attributes_init(3), +zip_file_replace(3), +zip_source(3), +zip_source_function(3), +zip_source_pass_to_lower_layer(3) +.SH "HISTORY" +\fBzip_source_layered\fR() +and +\fBzip_source_layered_create\fR() +were added in libzip 1.10. +.SH "AUTHORS" +Dieter Baron <\fIdillo@nih.at\fR> +and +Thomas Klausner <\fItk@giga.or.at\fR> diff --git a/core/deps/libzip/man/zip_source_layered.mdoc b/core/deps/libzip/man/zip_source_layered.mdoc new file mode 100644 index 000000000..aba25a5d7 --- /dev/null +++ b/core/deps/libzip/man/zip_source_layered.mdoc @@ -0,0 +1,167 @@ +.\" zip_source_layered.mdoc -- create layered source from function +.\" Copyright (C) 2004-2022 Dieter Baron and Thomas Klausner +.\" +.\" This file is part of libzip, a library to manipulate ZIP archives. +.\" The authors can be contacted at +.\" +.\" 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. +.\" 3. The names of the authors may not be used to endorse or promote +.\" products derived from this software without specific prior +.\" written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``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 AUTHORS 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 January 20, 2023 +.Dt ZIP_SOURCE_LAYERED 3 +.Os +.Sh NAME +.Nm zip_source_layered , +.Nm zip_source_layered_create +.Nd create layered data source from function +.Sh LIBRARY +libzip (-lzip) +.Sh SYNOPSIS +.In zip.h +.Ft zip_source_t * +.Fn zip_source_layered "zip_t *archive" "zip_source_t *source" "zip_source_layered_callback fn" "void *userdata" +.Ft zip_source_t * +.Fn zip_source_layered_create "zip_source_t *source" "zip_source_layered_callback fn" "void *userdata" "zip_error_t *error" +.Sh DESCRIPTION +The functions +.Fn zip_source_layered +and +.Fn zip_source_layered_create +create a layered zip source from the user-provided function +.Ar fn , +which must be of the following type: +.Pp +.Ft typedef zip_int64_t +.Fo \fR(*\zip_source_layered_callback\fR)\fP +.Fa "zip_source_t *source" "void *userdata" "void *data" "zip_uint64_t length" "zip_source_cmd_t cmd" +.Fc +.Pp +.Ar archive +or +.Ar error +are used for reporting errors and can be +.Dv NULL . +.Pp +When called by the library, the first argument is the +.Ar source +of the lower layer, the second argument is the +.Ar userdata +argument supplied to the function. +The next two arguments are a buffer +.Ar data +of size +.Ar length +when data is passed in or expected to be returned, or else +.Dv NULL +and 0. +The last argument, +.Ar cmd , +specifies which action the function should perform. +.Pp +See +.Xr zip_source_function 3 +for a description of the commands. +.Pp +A layered source transforms the data or metadata of the source below in some way. +Layered sources can't support writing and are not sufficient to cleanly add support for additional compression or encryption methods. +This may be revised in a later release of libzip. +.Pp +On success, the layered source takes ownership of +.Ar source . +The caller should not free it. +.Pp +The interaction with the lower layer depends on the command: +.El +.Ss Dv ZIP_SOURCE_ACCEPT_EMPTY +If the layered source supports this command, the lower layer is not called automatically. +Otherwise, the return value of the lower source is used. +.Ss Dv ZIP_SOURCE_CLOSE +The lower layer is closed after the callback returns. +.Ss Dv ZIP_SOURCE_ERROR +The lower layer is not called automatically. +If you need to retrieve error information from the lower layer, use +.Xr zip_error_set_from_source 3 +or +.Xr zip_source_pass_to_lower_layer 3 . +.Ss Dv ZIP_SOURCE_FREE +The lower layer is freed after the callback returns. +.Ss Dv ZIP_SOURCE_GET_FILE_ATTRIBUTES +The attributes of the lower layer are merged with the attributes returned by the callback: information set by the callback wins over the lower layer, with the following exceptions: the higher +.Ar version_needed +is used, and +.Ar general_purpose_bit_flags +are only overwritten if the corresponding bit is set in +.Ar general_purpose_bit_mask . +.Ss Dv ZIP_SOURCE_OPEN +The lower layer is opened before the callback is called. +.Ss Dv ZIP_SOURCE_READ +The lower layer is not called automatically. +.Ss Dv ZIP_SOURCE_SEEK +The lower layer is not called automatically. +.Ss Dv ZIP_SOURCE_STAT +.Ar data +contains the stat information from the lower layer when the callback is called. +.Ss Dv ZIP_SOURCE_SUPPORTS +.Ar data +contains the bitmap of commands supported by the lower layer when the callback is called. +Since layered sources can't support writing, all commands related to writing are stripped from the returned support bitmap. +.Ss Dv ZIP_SOURCE_TELL +The lower layer is not called automatically. +.Sh RETURN VALUES +Upon successful completion, the created source is returned. +Otherwise, +.Dv NULL +is returned and the error code in +.Ar archive +or +.Ar error +is set to indicate the error (unless +it is +.Dv NULL ) . +.Sh ERRORS +.Fn zip_source_layered +fails if: +.Bl -tag -width Er +.It Bq Er ZIP_ER_MEMORY +Required memory could not be allocated. +.El +.Sh SEE ALSO +.Xr libzip 3 , +.Xr zip_file_add 3 , +.Xr zip_file_attributes_init 3 , +.Xr zip_file_replace 3 , +.Xr zip_source 3 , +.Xr zip_source_function 3 , +.Xr zip_source_pass_to_lower_layer 3 +.Sh HISTORY +.Fn zip_source_layered +and +.Fn zip_source_layered_create +were added in libzip 1.10. +.Sh AUTHORS +.An -nosplit +.An Dieter Baron Aq Mt dillo@nih.at +and +.An Thomas Klausner Aq Mt tk@giga.or.at diff --git a/core/deps/libzip/man/zip_source_make_command_bitmap.html b/core/deps/libzip/man/zip_source_make_command_bitmap.html index d6ce945eb..28c3ad825 100644 --- a/core/deps/libzip/man/zip_source_make_command_bitmap.html +++ b/core/deps/libzip/man/zip_source_make_command_bitmap.html @@ -5,7 +5,7 @@ Copyright (C) 2014-2017 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/core/deps/libzip/man/zip_source_make_command_bitmap.man b/core/deps/libzip/man/zip_source_make_command_bitmap.man index 3dc3ed5d0..6cba12f42 100644 --- a/core/deps/libzip/man/zip_source_make_command_bitmap.man +++ b/core/deps/libzip/man/zip_source_make_command_bitmap.man @@ -3,7 +3,7 @@ .\" Copyright (C) 2014-2017 Dieter Baron and Thomas Klausner .\" .\" This file is part of libzip, a library to manipulate ZIP archives. -.\" The authors can be contacted at +.\" The authors can be contacted at .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions diff --git a/core/deps/libzip/man/zip_source_make_command_bitmap.mdoc b/core/deps/libzip/man/zip_source_make_command_bitmap.mdoc index 28d296f2f..2b327e14d 100644 --- a/core/deps/libzip/man/zip_source_make_command_bitmap.mdoc +++ b/core/deps/libzip/man/zip_source_make_command_bitmap.mdoc @@ -2,7 +2,7 @@ .\" Copyright (C) 2014-2017 Dieter Baron and Thomas Klausner .\" .\" This file is part of libzip, a library to manipulate ZIP archives. -.\" The authors can be contacted at +.\" The authors can be contacted at .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions diff --git a/core/deps/libzip/man/zip_source_open.html b/core/deps/libzip/man/zip_source_open.html index 9dc5a579a..443d9fb59 100644 --- a/core/deps/libzip/man/zip_source_open.html +++ b/core/deps/libzip/man/zip_source_open.html @@ -5,7 +5,7 @@ Copyright (C) 2014-2017 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/core/deps/libzip/man/zip_source_open.man b/core/deps/libzip/man/zip_source_open.man index dc337baf6..2bf19207d 100644 --- a/core/deps/libzip/man/zip_source_open.man +++ b/core/deps/libzip/man/zip_source_open.man @@ -3,7 +3,7 @@ .\" Copyright (C) 2014-2017 Dieter Baron and Thomas Klausner .\" .\" This file is part of libzip, a library to manipulate ZIP archives. -.\" The authors can be contacted at +.\" The authors can be contacted at .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions diff --git a/core/deps/libzip/man/zip_source_open.mdoc b/core/deps/libzip/man/zip_source_open.mdoc index 00371f64f..521ba8808 100644 --- a/core/deps/libzip/man/zip_source_open.mdoc +++ b/core/deps/libzip/man/zip_source_open.mdoc @@ -2,7 +2,7 @@ .\" Copyright (C) 2014-2017 Dieter Baron and Thomas Klausner .\" .\" This file is part of libzip, a library to manipulate ZIP archives. -.\" The authors can be contacted at +.\" The authors can be contacted at .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions diff --git a/core/deps/libzip/man/zip_source_pass_to_lower_layer.mdoc b/core/deps/libzip/man/zip_source_pass_to_lower_layer.mdoc new file mode 100644 index 000000000..aaafc236f --- /dev/null +++ b/core/deps/libzip/man/zip_source_pass_to_lower_layer.mdoc @@ -0,0 +1,64 @@ +.\" zip_source_pass_to_lower_layer.mdoc -- pass command to lower layer +.\" Copyright (C) 2022 Dieter Baron and Thomas Klausner +.\" +.\" This file is part of libzip, a library to manipulate ZIP archives. +.\" The authors can be contacted at +.\" +.\" 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. +.\" 3. The names of the authors may not be used to endorse or promote +.\" products derived from this software without specific prior +.\" written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``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 AUTHORS 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 December 5, 2022 +.Dt ZIP_SOURCE_PASS_TO_LOWER_LAYER 3 +.Os +.Sh NAME +.Nm zip_source_pass_to_lower_layer +.Nd pass command to lower layer +.Sh LIBRARY +libzip (-lzip) +.Sh SYNOPSIS +.In zip.h +.Ft zip_int64_t +.Fn zip_source_pass_to_lower_layer "zip_source_t *source" "void *data" "zip_uint64_t length" "zip_source_cmd_t command" +.Sh DESCRIPTION +The functions +.Fn zip_source_pass_to_lower_layer +is used in a layered source callback to pass commands for which you don't want to change the result to the lower layer. +You can use it in the +.Dv default +case of the callback. +.Sh RETURN VALUES +The return value is meant to be returned by the callback. +.Sh SEE ALSO +.Xr libzip 3 , +.Xr zip_source 3 , +.Xr zip_source_layered 3 +.Sh HISTORY +.Fn zip_source_pass_to_lower_layer +was added in libzip 1.10. +.Sh AUTHORS +.An -nosplit +.An Dieter Baron Aq Mt dillo@nih.at +and +.An Thomas Klausner Aq Mt tk@giga.or.at diff --git a/core/deps/libzip/man/zip_source_read.html b/core/deps/libzip/man/zip_source_read.html index 1269a42e6..0fbde0ad1 100644 --- a/core/deps/libzip/man/zip_source_read.html +++ b/core/deps/libzip/man/zip_source_read.html @@ -2,10 +2,10 @@ + + + + ZIP_SOURCE_WINDOW_CREATE(3) + + + + + + + + +
ZIP_SOURCE_WINDOW_CREATE(3)Library Functions ManualZIP_SOURCE_WINDOW_CREATE(3)
+
+
+

+zip_source_window_create — +
create zip data source overlay
+
+
+

+libzip (-lzip) +
+
+

+#include <zip.h> +

zip_source_t * +
+ zip_source_window_create(zip_source_t + *source, zip_uint64_t + start, zip_int64_t + len, zip_error_t + *error);

+
+
+

+The zip_source_window_create() function create a zip + source from an underlying zip source, restricting access to a particular + window starting at byte start and having size + len. If len is -1, the window + spans to the end of the underlying source. +

zip_source_window() and + zip_source_window_create() don't take ownership of + source. The caller is responsible for freeing it. + (This is different to other layered sources.)

+
+
+

+Upon successful completion, the created source is returned. Otherwise, + NULL is returned and the error code in + error is set to indicate the error. +
+
+

+zip_source_window_create() fails if: +
+
[]
+
src is NULL; there is an + integer overflow adding start and + len; or len is less than + -1.
+
[]
+
Required memory could not be allocated.
+
+
+
+

+libzip(3), + zip_source(3) + zip_source(3) +
+
+

+zip_source_window_create() was added in libzip 1.8.0. +
+
+

+Dieter Baron + <dillo@nih.at> and + Thomas Klausner + <tk@giga.or.at> +
+
+ + + + + +
April 29, 2021NiH
+ + diff --git a/core/deps/libzip/man/zip_source_window_create.man b/core/deps/libzip/man/zip_source_window_create.man new file mode 100644 index 000000000..78d35313b --- /dev/null +++ b/core/deps/libzip/man/zip_source_window_create.man @@ -0,0 +1,104 @@ +.\" Automatically generated from an mdoc input file. Do not edit. +.\" zip_source_window_create.mdoc -- create zip data source overlay +.\" Copyright (C) 2021 Dieter Baron and Thomas Klausner +.\" +.\" This file is part of libzip, a library to manipulate ZIP archives. +.\" The authors can be contacted at +.\" +.\" 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. +.\" 3. The names of the authors may not be used to endorse or promote +.\" products derived from this software without specific prior +.\" written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``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 AUTHORS 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. +.\" +.TH "ZIP_SOURCE_WINDOW_CREATE" "3" "April 29, 2021" "NiH" "Library Functions Manual" +.nh +.if n .ad l +.SH "NAME" +\fBzip_source_window_create\fR +\- create zip data source overlay +.SH "LIBRARY" +libzip (-lzip) +.SH "SYNOPSIS" +\fB#include \fR +.sp +\fIzip_source_t *\fR +.br +.PD 0 +.HP 4n +\fBzip_source_window_create\fR(\fIzip_source_t\ *source\fR, \fIzip_uint64_t\ start\fR, \fIzip_int64_t\ len\fR, \fIzip_error_t\ *error\fR); +.PD +.SH "DESCRIPTION" +The +\fBzip_source_window_create\fR() +function create a zip source from an underlying zip source, +restricting access to a particular window starting at byte +\fIstart\fR +and having size +\fIlen\fR. +If +\fIlen\fR +is \-1, the window spans to the end of the underlying source. +.PP +\fBzip_source_window\fR() +and +\fBzip_source_window_create\fR() +don't take ownership of +\fIsource\fR. +The caller is responsible for freeing it. +(This is different to other layered sources.) +.SH "RETURN VALUES" +Upon successful completion, the created source is returned. +Otherwise, +\fRNULL\fR +is returned and the error code in +\fIerror\fR +is set to indicate the error. +.SH "ERRORS" +\fBzip_source_window_create\fR() +fails if: +.TP 19n +[\fRZIP_ER_INVAL\fR] +\fIsrc\fR +is +\fRNULL\fR; +there is an integer overflow adding +\fIstart\fR +and +\fIlen\fR; +or +\fIlen\fR +is less than \-1. +.TP 19n +[\fRZIP_ER_MEMORY\fR] +Required memory could not be allocated. +.SH "SEE ALSO" +libzip(3), +zip_source(3) +zip_source(3) +.SH "HISTORY" +\fBzip_source_window_create\fR() +was added in libzip 1.8.0. +.SH "AUTHORS" +Dieter Baron <\fIdillo@nih.at\fR> +and +Thomas Klausner <\fItk@giga.or.at\fR> diff --git a/core/deps/libzip/man/zip_source_window_create.mdoc b/core/deps/libzip/man/zip_source_window_create.mdoc new file mode 100644 index 000000000..2d4f1d17e --- /dev/null +++ b/core/deps/libzip/man/zip_source_window_create.mdoc @@ -0,0 +1,99 @@ +.\" zip_source_window_create.mdoc -- create zip data source overlay +.\" Copyright (C) 2021 Dieter Baron and Thomas Klausner +.\" +.\" This file is part of libzip, a library to manipulate ZIP archives. +.\" The authors can be contacted at +.\" +.\" 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. +.\" 3. The names of the authors may not be used to endorse or promote +.\" products derived from this software without specific prior +.\" written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``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 AUTHORS 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 April 29, 2021 +.Dt ZIP_SOURCE_WINDOW_CREATE 3 +.Os +.Sh NAME +.Nm zip_source_window_create +.Nd create zip data source overlay +.Sh LIBRARY +libzip (-lzip) +.Sh SYNOPSIS +.In zip.h +.Ft zip_source_t * +.Fn zip_source_window_create "zip_source_t *source" "zip_uint64_t start" "zip_int64_t len" "zip_error_t *error" +.Sh DESCRIPTION +The +.Fn zip_source_window_create +function create a zip source from an underlying zip source, +restricting access to a particular window starting at byte +.Ar start +and having size +.Ar len . +If +.Ar len +is \-1, the window spans to the end of the underlying source. +.Pp +.Fn zip_source_window +and +.Fn zip_source_window_create +don't take ownership of +.Ar source . +The caller is responsible for freeing it. +(This is different to other layered sources.) +.Sh RETURN VALUES +Upon successful completion, the created source is returned. +Otherwise, +.Dv NULL +is returned and the error code in +.Ar error +is set to indicate the error. +.Sh ERRORS +.Fn zip_source_window_create +fails if: +.Bl -tag -width Er +.It Bq Er ZIP_ER_INVAL +.Ar src +is +.Dv NULL ; +there is an integer overflow adding +.Ar start +and +.Ar len ; +or +.Ar len +is less than \-1. +.It Bq Er ZIP_ER_MEMORY +Required memory could not be allocated. +.El +.Sh SEE ALSO +.Xr libzip 3 , +.Xr zip_source 3 +.Xr zip_source 3 +.Sh HISTORY +.Fn zip_source_window_create +was added in libzip 1.8.0. +.Sh AUTHORS +.An -nosplit +.An Dieter Baron Aq Mt dillo@nih.at +and +.An Thomas Klausner Aq Mt tk@giga.or.at diff --git a/core/deps/libzip/man/zip_source_write.html b/core/deps/libzip/man/zip_source_write.html index 88749bce8..94052b8be 100644 --- a/core/deps/libzip/man/zip_source_write.html +++ b/core/deps/libzip/man/zip_source_write.html @@ -5,7 +5,7 @@ Copyright (C) 2014-2017 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/core/deps/libzip/man/zip_source_write.man b/core/deps/libzip/man/zip_source_write.man index 58d808ee2..4fb5cdb5d 100644 --- a/core/deps/libzip/man/zip_source_write.man +++ b/core/deps/libzip/man/zip_source_write.man @@ -3,7 +3,7 @@ .\" Copyright (C) 2014-2017 Dieter Baron and Thomas Klausner .\" .\" This file is part of libzip, a library to manipulate ZIP archives. -.\" The authors can be contacted at +.\" The authors can be contacted at .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions diff --git a/core/deps/libzip/man/zip_source_write.mdoc b/core/deps/libzip/man/zip_source_write.mdoc index 00836b034..fd033a85f 100644 --- a/core/deps/libzip/man/zip_source_write.mdoc +++ b/core/deps/libzip/man/zip_source_write.mdoc @@ -2,7 +2,7 @@ .\" Copyright (C) 2014-2017 Dieter Baron and Thomas Klausner .\" .\" This file is part of libzip, a library to manipulate ZIP archives. -.\" The authors can be contacted at +.\" The authors can be contacted at .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions diff --git a/core/deps/libzip/man/zip_source_zip.html b/core/deps/libzip/man/zip_source_zip.html index ec8dd752e..8708e6d5e 100644 --- a/core/deps/libzip/man/zip_source_zip.html +++ b/core/deps/libzip/man/zip_source_zip.html @@ -2,10 +2,10 @@ + + + + ZIP_SOURCE_ZIP_FILE(3) + + + + + + + + +
ZIP_SOURCE_ZIP_FILE(3)Library Functions ManualZIP_SOURCE_ZIP_FILE(3)
+
+
+

+zip_source_zip_file, + zip_source_zip_file_create — +
create data source from zip file
+
+
+

+libzip (-lzip) +
+
+

+#include <zip.h> +

zip_source_t * +
+ zip_source_zip_file(zip_t + *archive, zip_t + *srcarchive, zip_uint64_t + srcidx, zip_flags_t + flags, zip_uint64_t + start, zip_int64_t + length, const char + *password);

+

zip_source_t * +
+ zip_source_zip_file_create(zip_t + *srcarchive, zip_uint64_t + srcidx, zip_flags_t + flags, zip_uint64_t + start, zip_int64_t + length, const char + *password, zip_error_t + *error);

+
+
+

+The functions zip_source_zip_file() and + zip_source_zip_file_create() create a zip source from + a file in a zip archive. The srcarchive argument is the + (open) zip archive containing the source zip file at index + srcidx. length bytes from offset + start will be used in the zip_source. If + length is -1, the rest of the file, starting from + start, is used. +

If you intend to copy a file from one archive to another, using + the flag ZIP_FL_COMPRESSED is more efficient, as it + avoids recompressing the file data.

+

Supported flags are:

+
+
+
Get the compressed data. This is only supported if the complete file data + is requested (start == 0 and + length == -1). This is not supported for changed + data. Default is uncompressed.
+
+
Get the encrypted data. (This flag implies + ZIP_FL_COMPRESSED.) This is only supported if the + complete file data is requested (start == 0 and + length == -1). Default is decrypted.
+
+
Try to get the original data without any changes that may have been made + to srcarchive after opening it.
+
+
+
+

+Upon successful completion, the created source is returned. Otherwise, + NULL is returned and the error code in + archive or error is set to + indicate the error. +
+
+

+zip_source_zip_file() and + zip_source_zip_file_create() fail if: +
+
[]
+
Unchanged data was requested, but it is not available.
+
[]
+
srcarchive, srcidx, + start, or length are + invalid.
+
[]
+
Required memory could not be allocated.
+
+Additionally, it can return all error codes from + zip_stat_index() and + zip_fopen_index(). +
+
+

+libzip(3), + zip_file_add(3), + zip_file_replace(3), + zip_source(3) +
+
+

+zip_source_zip_file() and + zip_source_zip_file_create() were added in libzip + 1.10.0. +
+
+

+Dieter Baron + <dillo@nih.at> and + Thomas Klausner + <tk@giga.or.at> +
+
+ + + + + +
March 10, 2023NiH
+ + diff --git a/core/deps/libzip/man/zip_source_zip_file.man b/core/deps/libzip/man/zip_source_zip_file.man new file mode 100644 index 000000000..ae7f16a19 --- /dev/null +++ b/core/deps/libzip/man/zip_source_zip_file.man @@ -0,0 +1,159 @@ +.\" Automatically generated from an mdoc input file. Do not edit. +.\" zip_source_zip_file.mdoc -- create data source from zip file +.\" Copyright (C) 2004-2021 Dieter Baron and Thomas Klausner +.\" +.\" This file is part of libzip, a library to manipulate ZIP archives. +.\" The authors can be contacted at +.\" +.\" 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. +.\" 3. The names of the authors may not be used to endorse or promote +.\" products derived from this software without specific prior +.\" written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``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 AUTHORS 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. +.\" +.TH "ZIP_SOURCE_ZIP_FILE" "3" "March 10, 2023" "NiH" "Library Functions Manual" +.nh +.if n .ad l +.SH "NAME" +\fBzip_source_zip_file\fR, +\fBzip_source_zip_file_create\fR +\- create data source from zip file +.SH "LIBRARY" +libzip (-lzip) +.SH "SYNOPSIS" +\fB#include \fR +.sp +\fIzip_source_t *\fR +.br +.PD 0 +.HP 4n +\fBzip_source_zip_file\fR(\fIzip_t\ *archive\fR, \fIzip_t\ *srcarchive\fR, \fIzip_uint64_t\ srcidx\fR, \fIzip_flags_t\ flags\fR, \fIzip_uint64_t\ start\fR, \fIzip_int64_t\ length\fR, \fIconst\ char\ *password\fR); +.PD +.PP +\fIzip_source_t *\fR +.br +.PD 0 +.HP 4n +\fBzip_source_zip_file_create\fR(\fIzip_t\ *srcarchive\fR, \fIzip_uint64_t\ srcidx\fR, \fIzip_flags_t\ flags\fR, \fIzip_uint64_t\ start\fR, \fIzip_int64_t\ length\fR, \fIconst\ char\ *password\fR, \fIzip_error_t\ *error\fR); +.PD +.SH "DESCRIPTION" +The functions +\fBzip_source_zip_file\fR() +and +\fBzip_source_zip_file_create\fR() +create a zip source from a file in a zip archive. +The +\fIsrcarchive\fR +argument is the (open) zip archive containing the source zip file +at index +\fIsrcidx\fR. +\fIlength\fR +bytes from offset +\fIstart\fR +will be used in the zip_source. +If +\fIlength\fR +is \-1, the rest of the file, starting from +\fIstart\fR, +is used. +.PP +If you intend to copy a file from one archive to another, using the flag +\fRZIP_FL_COMPRESSED\fR +is more efficient, as it avoids recompressing the file data. +.PP +Supported flags are: +.TP 22n +\fRZIP_FL_COMPRESSED\fR +Get the compressed data. +This is only supported if the complete file data is requested +(\fIstart\fR +== 0 and +\fIlength\fR +== \-1). +This is not supported for changed data. +Default is uncompressed. +.TP 22n +\fRZIP_FL_ENCRYPTED\fR +Get the encrypted data. +(This flag implies +\fRZIP_FL_COMPRESSED\fR.) +This is only supported if the complete file data is requested +(\fIstart\fR +== 0 and +\fIlength\fR +== \-1). +Default is decrypted. +.TP 22n +\fRZIP_FL_UNCHANGED\fR +Try to get the original data without any changes that may have been +made to +\fIsrcarchive\fR +after opening it. +.SH "RETURN VALUES" +Upon successful completion, the created source is returned. +Otherwise, +\fRNULL\fR +is returned and the error code in +\fIarchive\fR +or +\fIerror\fR +is set to indicate the error. +.SH "ERRORS" +\fBzip_source_zip_file\fR() +and +\fBzip_source_zip_file_create\fR() +fail if: +.TP 19n +[\fRZIP_ER_CHANGED\fR] +Unchanged data was requested, but it is not available. +.TP 19n +[\fRZIP_ER_INVAL\fR] +\fIsrcarchive\fR, +\fIsrcidx\fR, +\fIstart\fR, +or +\fIlength\fR +are invalid. +.TP 19n +[\fRZIP_ER_MEMORY\fR] +Required memory could not be allocated. +.PD 0 +.PP +Additionally, it can return all error codes from +\fBzip_stat_index\fR() +and +\fBzip_fopen_index\fR(). +.PD +.SH "SEE ALSO" +libzip(3), +zip_file_add(3), +zip_file_replace(3), +zip_source(3) +.SH "HISTORY" +\fBzip_source_zip_file\fR() +and +\fBzip_source_zip_file_create\fR() +were added in libzip 1.10.0. +.SH "AUTHORS" +Dieter Baron <\fIdillo@nih.at\fR> +and +Thomas Klausner <\fItk@giga.or.at\fR> diff --git a/core/deps/libzip/man/zip_source_zip_file.mdoc b/core/deps/libzip/man/zip_source_zip_file.mdoc new file mode 100644 index 000000000..a0842b749 --- /dev/null +++ b/core/deps/libzip/man/zip_source_zip_file.mdoc @@ -0,0 +1,144 @@ +.\" zip_source_zip_file.mdoc -- create data source from zip file +.\" Copyright (C) 2004-2021 Dieter Baron and Thomas Klausner +.\" +.\" This file is part of libzip, a library to manipulate ZIP archives. +.\" The authors can be contacted at +.\" +.\" 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. +.\" 3. The names of the authors may not be used to endorse or promote +.\" products derived from this software without specific prior +.\" written permission. +.\" +.\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``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 AUTHORS 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 10, 2023 +.Dt ZIP_SOURCE_ZIP_FILE 3 +.Os +.Sh NAME +.Nm zip_source_zip_file , +.Nm zip_source_zip_file_create +.Nd create data source from zip file +.Sh LIBRARY +libzip (-lzip) +.Sh SYNOPSIS +.In zip.h +.Ft zip_source_t * +.Fn zip_source_zip_file "zip_t *archive" "zip_t *srcarchive" "zip_uint64_t srcidx" "zip_flags_t flags" "zip_uint64_t start" "zip_int64_t length" "const char *password" +.Ft zip_source_t * +.Fn zip_source_zip_file_create "zip_t *srcarchive" "zip_uint64_t srcidx" "zip_flags_t flags" "zip_uint64_t start" "zip_int64_t length" "const char *password" "zip_error_t *error" +.Sh DESCRIPTION +The functions +.Fn zip_source_zip_file +and +.Fn zip_source_zip_file_create +create a zip source from a file in a zip archive. +The +.Ar srcarchive +argument is the (open) zip archive containing the source zip file +at index +.Ar srcidx . +.Ar length +bytes from offset +.Ar start +will be used in the zip_source. +If +.Ar length +is \-1, the rest of the file, starting from +.Ar start , +is used. +.Pp +If you intend to copy a file from one archive to another, using the flag +.Dv ZIP_FL_COMPRESSED +is more efficient, as it avoids recompressing the file data. +.Pp +Supported flags are: +.Bl -tag -width 20n +.It Dv ZIP_FL_COMPRESSED +Get the compressed data. +This is only supported if the complete file data is requested +.Ar ( start +== 0 and +.Ar length +== \-1). +This is not supported for changed data. +Default is uncompressed. +.It Dv ZIP_FL_ENCRYPTED +Get the encrypted data. +(This flag implies +.Dv ZIP_FL_COMPRESSED . ) +This is only supported if the complete file data is requested +.Ar ( start +== 0 and +.Ar length +== \-1). +Default is decrypted. +.It Dv ZIP_FL_UNCHANGED +Try to get the original data without any changes that may have been +made to +.Ar srcarchive +after opening it. +.El +.Sh RETURN VALUES +Upon successful completion, the created source is returned. +Otherwise, +.Dv NULL +is returned and the error code in +.Ar archive +or +.Ar error +is set to indicate the error. +.Sh ERRORS +.Fn zip_source_zip_file +and +.Fn zip_source_zip_file_create +fail if: +.Bl -tag -width Er +.It Bq Er ZIP_ER_CHANGED +Unchanged data was requested, but it is not available. +.It Bq Er ZIP_ER_INVAL +.Ar srcarchive , +.Ar srcidx , +.Ar start , +or +.Ar length +are invalid. +.It Bq Er ZIP_ER_MEMORY +Required memory could not be allocated. +.El +Additionally, it can return all error codes from +.Fn zip_stat_index +and +.Fn zip_fopen_index . +.Sh SEE ALSO +.Xr libzip 3 , +.Xr zip_file_add 3 , +.Xr zip_file_replace 3 , +.Xr zip_source 3 +.Sh HISTORY +.Fn zip_source_zip_file +and +.Fn zip_source_zip_file_create +were added in libzip 1.10.0. +.Sh AUTHORS +.An -nosplit +.An Dieter Baron Aq Mt dillo@nih.at +and +.An Thomas Klausner Aq Mt tk@giga.or.at diff --git a/core/deps/libzip/man/zip_stat.html b/core/deps/libzip/man/zip_stat.html index 699c78f64..8cf0086ad 100644 --- a/core/deps/libzip/man/zip_stat.html +++ b/core/deps/libzip/man/zip_stat.html @@ -5,7 +5,7 @@ Copyright (C) 2003-2017 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/core/deps/libzip/man/zip_stat.man b/core/deps/libzip/man/zip_stat.man index 93b6fdd5c..d7d4338f2 100644 --- a/core/deps/libzip/man/zip_stat.man +++ b/core/deps/libzip/man/zip_stat.man @@ -3,7 +3,7 @@ .\" Copyright (C) 2003-2017 Dieter Baron and Thomas Klausner .\" .\" This file is part of libzip, a library to manipulate ZIP archives. -.\" The authors can be contacted at +.\" The authors can be contacted at .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions diff --git a/core/deps/libzip/man/zip_stat.mdoc b/core/deps/libzip/man/zip_stat.mdoc index 4d5661ef4..9871770a3 100644 --- a/core/deps/libzip/man/zip_stat.mdoc +++ b/core/deps/libzip/man/zip_stat.mdoc @@ -2,7 +2,7 @@ .\" Copyright (C) 2003-2017 Dieter Baron and Thomas Klausner .\" .\" This file is part of libzip, a library to manipulate ZIP archives. -.\" The authors can be contacted at +.\" The authors can be contacted at .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions diff --git a/core/deps/libzip/man/zip_stat_init.html b/core/deps/libzip/man/zip_stat_init.html index 99b36dee2..fd9c0f5a5 100644 --- a/core/deps/libzip/man/zip_stat_init.html +++ b/core/deps/libzip/man/zip_stat_init.html @@ -5,7 +5,7 @@ Copyright (C) 2006-2017 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/core/deps/libzip/man/zip_stat_init.man b/core/deps/libzip/man/zip_stat_init.man index 75f3ea9b4..2ba5857f5 100644 --- a/core/deps/libzip/man/zip_stat_init.man +++ b/core/deps/libzip/man/zip_stat_init.man @@ -3,7 +3,7 @@ .\" Copyright (C) 2006-2017 Dieter Baron and Thomas Klausner .\" .\" This file is part of libzip, a library to manipulate ZIP archives. -.\" The authors can be contacted at +.\" The authors can be contacted at .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions diff --git a/core/deps/libzip/man/zip_stat_init.mdoc b/core/deps/libzip/man/zip_stat_init.mdoc index 0d464a614..bb5a0ffbe 100644 --- a/core/deps/libzip/man/zip_stat_init.mdoc +++ b/core/deps/libzip/man/zip_stat_init.mdoc @@ -2,7 +2,7 @@ .\" Copyright (C) 2006-2017 Dieter Baron and Thomas Klausner .\" .\" This file is part of libzip, a library to manipulate ZIP archives. -.\" The authors can be contacted at +.\" The authors can be contacted at .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions diff --git a/core/deps/libzip/man/zip_unchange.html b/core/deps/libzip/man/zip_unchange.html index 671abede5..ebf1113af 100644 --- a/core/deps/libzip/man/zip_unchange.html +++ b/core/deps/libzip/man/zip_unchange.html @@ -5,7 +5,7 @@ Copyright (C) 2003-2017 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/core/deps/libzip/man/zip_unchange.man b/core/deps/libzip/man/zip_unchange.man index c7ec25f55..30db8a9d9 100644 --- a/core/deps/libzip/man/zip_unchange.man +++ b/core/deps/libzip/man/zip_unchange.man @@ -3,7 +3,7 @@ .\" Copyright (C) 2003-2017 Dieter Baron and Thomas Klausner .\" .\" This file is part of libzip, a library to manipulate ZIP archives. -.\" The authors can be contacted at +.\" The authors can be contacted at .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions diff --git a/core/deps/libzip/man/zip_unchange.mdoc b/core/deps/libzip/man/zip_unchange.mdoc index 6bde36bb5..3a2215588 100644 --- a/core/deps/libzip/man/zip_unchange.mdoc +++ b/core/deps/libzip/man/zip_unchange.mdoc @@ -2,7 +2,7 @@ .\" Copyright (C) 2003-2017 Dieter Baron and Thomas Klausner .\" .\" This file is part of libzip, a library to manipulate ZIP archives. -.\" The authors can be contacted at +.\" The authors can be contacted at .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions diff --git a/core/deps/libzip/man/zip_unchange_all.html b/core/deps/libzip/man/zip_unchange_all.html index ab94a0038..1c11f0baf 100644 --- a/core/deps/libzip/man/zip_unchange_all.html +++ b/core/deps/libzip/man/zip_unchange_all.html @@ -5,7 +5,7 @@ Copyright (C) 2003-2017 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/core/deps/libzip/man/zip_unchange_all.man b/core/deps/libzip/man/zip_unchange_all.man index 4fcbee320..f3aecea6f 100644 --- a/core/deps/libzip/man/zip_unchange_all.man +++ b/core/deps/libzip/man/zip_unchange_all.man @@ -3,7 +3,7 @@ .\" Copyright (C) 2003-2017 Dieter Baron and Thomas Klausner .\" .\" This file is part of libzip, a library to manipulate ZIP archives. -.\" The authors can be contacted at +.\" The authors can be contacted at .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions diff --git a/core/deps/libzip/man/zip_unchange_all.mdoc b/core/deps/libzip/man/zip_unchange_all.mdoc index b676eb557..01806ecb0 100644 --- a/core/deps/libzip/man/zip_unchange_all.mdoc +++ b/core/deps/libzip/man/zip_unchange_all.mdoc @@ -2,7 +2,7 @@ .\" Copyright (C) 2003-2017 Dieter Baron and Thomas Klausner .\" .\" This file is part of libzip, a library to manipulate ZIP archives. -.\" The authors can be contacted at +.\" The authors can be contacted at .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions diff --git a/core/deps/libzip/man/zip_unchange_archive.html b/core/deps/libzip/man/zip_unchange_archive.html index f40ea4edc..35b842c34 100644 --- a/core/deps/libzip/man/zip_unchange_archive.html +++ b/core/deps/libzip/man/zip_unchange_archive.html @@ -5,7 +5,7 @@ Copyright (C) 2006-2017 Dieter Baron and Thomas Klausner This file is part of libzip, a library to manipulate ZIP archives. - The authors can be contacted at + The authors can be contacted at Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions diff --git a/core/deps/libzip/man/zip_unchange_archive.man b/core/deps/libzip/man/zip_unchange_archive.man index 430eafc00..3f42fdc88 100644 --- a/core/deps/libzip/man/zip_unchange_archive.man +++ b/core/deps/libzip/man/zip_unchange_archive.man @@ -3,7 +3,7 @@ .\" Copyright (C) 2006-2017 Dieter Baron and Thomas Klausner .\" .\" This file is part of libzip, a library to manipulate ZIP archives. -.\" The authors can be contacted at +.\" The authors can be contacted at .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions diff --git a/core/deps/libzip/man/zip_unchange_archive.mdoc b/core/deps/libzip/man/zip_unchange_archive.mdoc index b3b3d3f1a..4ec381154 100644 --- a/core/deps/libzip/man/zip_unchange_archive.mdoc +++ b/core/deps/libzip/man/zip_unchange_archive.mdoc @@ -2,7 +2,7 @@ .\" Copyright (C) 2006-2017 Dieter Baron and Thomas Klausner .\" .\" This file is part of libzip, a library to manipulate ZIP archives. -.\" The authors can be contacted at +.\" The authors can be contacted at .\" .\" Redistribution and use in source and binary forms, with or without .\" modification, are permitted provided that the following conditions diff --git a/core/deps/libzip/man/zipcmp.html b/core/deps/libzip/man/zipcmp.html index ddb397e3d..93654497d 100644 --- a/core/deps/libzip/man/zipcmp.html +++ b/core/deps/libzip/man/zipcmp.html @@ -2,10 +2,10 @@