svn commit: r357783 - in vendor/libarchive/dist: . .github/workflows build build/ci build/ci/github_actions build/cmake build/release cat cat/test contrib cpio cpio/test libarchive libarchive/test ...

Martin Matuska mm at FreeBSD.org
Tue Feb 11 23:48:10 UTC 2020


Author: mm
Date: Tue Feb 11 23:48:03 2020
New Revision: 357783
URL: https://svnweb.freebsd.org/changeset/base/357783

Log:
  Update vendor/libarchive/dist to git 3288ebb0353beb51dfb09d444dedbe9235ead53d
  
  Libarchive 3.4.2
  
  Relevant vendor changes:
    PR #1289: atomic extraction support (bsdtar -x --safe-writes)
    PR #1308: big endian fix for UTF16 support in LHA reader
    PR #1326: reject RAR5 files that declare invalid header flags
    Issue #987: fix support 7z archive entries with Delta filter
    Issue #1317: fix compression output buffer handling in XAR writer
    Issue #1319: fix uname or gname longer than 32 characters in pax writer
    Issue #1325: fix use after free when archiving hardlinks in ISO9660 or XAR
    Use localtime_r() and gmtime_r() instead of localtime() and gmtime()

Added:
  vendor/libarchive/dist/build/release/
  vendor/libarchive/dist/build/release/Dockerfile
  vendor/libarchive/dist/build/release/release.sh   (contents, props changed)
  vendor/libarchive/dist/libarchive/archive_write_set_format_private.h   (contents, props changed)
  vendor/libarchive/dist/libarchive/test/test_read_format_7zip_delta4_lzma1.7z.uu
  vendor/libarchive/dist/libarchive/test/test_read_format_7zip_delta4_lzma2.7z.uu
  vendor/libarchive/dist/libarchive/test/test_read_format_rar5_block_size_is_too_small.rar.uu
  vendor/libarchive/dist/tar/test/test_option_safe_writes.c   (contents, props changed)
Modified:
  vendor/libarchive/dist/.github/workflows/ci.yml
  vendor/libarchive/dist/CMakeLists.txt
  vendor/libarchive/dist/Makefile.am
  vendor/libarchive/dist/NEWS
  vendor/libarchive/dist/build/ci/build.sh
  vendor/libarchive/dist/build/ci/github_actions/ci.cmd
  vendor/libarchive/dist/build/cmake/config.h.in
  vendor/libarchive/dist/build/version
  vendor/libarchive/dist/cat/bsdcat.h
  vendor/libarchive/dist/cat/test/test_0.c
  vendor/libarchive/dist/configure.ac
  vendor/libarchive/dist/contrib/archivetest.c
  vendor/libarchive/dist/cpio/cpio.c
  vendor/libarchive/dist/cpio/test/test_basic.c
  vendor/libarchive/dist/cpio/test/test_format_newc.c
  vendor/libarchive/dist/libarchive/CMakeLists.txt
  vendor/libarchive/dist/libarchive/archive.h
  vendor/libarchive/dist/libarchive/archive_acl_private.h
  vendor/libarchive/dist/libarchive/archive_blake2.h
  vendor/libarchive/dist/libarchive/archive_blake2_impl.h
  vendor/libarchive/dist/libarchive/archive_cmdline_private.h
  vendor/libarchive/dist/libarchive/archive_crc32.h
  vendor/libarchive/dist/libarchive/archive_cryptor_private.h
  vendor/libarchive/dist/libarchive/archive_digest_private.h
  vendor/libarchive/dist/libarchive/archive_endian.h
  vendor/libarchive/dist/libarchive/archive_entry.c
  vendor/libarchive/dist/libarchive/archive_entry_locale.h
  vendor/libarchive/dist/libarchive/archive_entry_private.h
  vendor/libarchive/dist/libarchive/archive_getdate.c
  vendor/libarchive/dist/libarchive/archive_getdate.h
  vendor/libarchive/dist/libarchive/archive_hmac_private.h
  vendor/libarchive/dist/libarchive/archive_openssl_evp_private.h
  vendor/libarchive/dist/libarchive/archive_openssl_hmac_private.h
  vendor/libarchive/dist/libarchive/archive_options_private.h
  vendor/libarchive/dist/libarchive/archive_pack_dev.c
  vendor/libarchive/dist/libarchive/archive_pack_dev.h
  vendor/libarchive/dist/libarchive/archive_pathmatch.h
  vendor/libarchive/dist/libarchive/archive_platform_acl.h
  vendor/libarchive/dist/libarchive/archive_platform_xattr.h
  vendor/libarchive/dist/libarchive/archive_ppmd7.c
  vendor/libarchive/dist/libarchive/archive_ppmd7_private.h
  vendor/libarchive/dist/libarchive/archive_ppmd8_private.h
  vendor/libarchive/dist/libarchive/archive_ppmd_private.h
  vendor/libarchive/dist/libarchive/archive_private.h
  vendor/libarchive/dist/libarchive/archive_random_private.h
  vendor/libarchive/dist/libarchive/archive_rb.h
  vendor/libarchive/dist/libarchive/archive_read.c
  vendor/libarchive/dist/libarchive/archive_read_disk_posix.c
  vendor/libarchive/dist/libarchive/archive_read_disk_private.h
  vendor/libarchive/dist/libarchive/archive_read_private.h
  vendor/libarchive/dist/libarchive/archive_read_set_options.3
  vendor/libarchive/dist/libarchive/archive_read_support_filter_uu.c
  vendor/libarchive/dist/libarchive/archive_read_support_format_7zip.c
  vendor/libarchive/dist/libarchive/archive_read_support_format_lha.c
  vendor/libarchive/dist/libarchive/archive_read_support_format_mtree.c
  vendor/libarchive/dist/libarchive/archive_read_support_format_rar.c
  vendor/libarchive/dist/libarchive/archive_read_support_format_rar5.c
  vendor/libarchive/dist/libarchive/archive_read_support_format_warc.c
  vendor/libarchive/dist/libarchive/archive_read_support_format_xar.c
  vendor/libarchive/dist/libarchive/archive_string.c
  vendor/libarchive/dist/libarchive/archive_string.h
  vendor/libarchive/dist/libarchive/archive_string_composition.h
  vendor/libarchive/dist/libarchive/archive_util.c
  vendor/libarchive/dist/libarchive/archive_windows.h
  vendor/libarchive/dist/libarchive/archive_write_disk.3
  vendor/libarchive/dist/libarchive/archive_write_disk_posix.c
  vendor/libarchive/dist/libarchive/archive_write_disk_private.h
  vendor/libarchive/dist/libarchive/archive_write_disk_windows.c
  vendor/libarchive/dist/libarchive/archive_write_private.h
  vendor/libarchive/dist/libarchive/archive_write_set_format.c
  vendor/libarchive/dist/libarchive/archive_write_set_format_7zip.c
  vendor/libarchive/dist/libarchive/archive_write_set_format_ar.c
  vendor/libarchive/dist/libarchive/archive_write_set_format_cpio.c
  vendor/libarchive/dist/libarchive/archive_write_set_format_cpio_newc.c
  vendor/libarchive/dist/libarchive/archive_write_set_format_gnutar.c
  vendor/libarchive/dist/libarchive/archive_write_set_format_iso9660.c
  vendor/libarchive/dist/libarchive/archive_write_set_format_pax.c
  vendor/libarchive/dist/libarchive/archive_write_set_format_shar.c
  vendor/libarchive/dist/libarchive/archive_write_set_format_ustar.c
  vendor/libarchive/dist/libarchive/archive_write_set_format_v7tar.c
  vendor/libarchive/dist/libarchive/archive_write_set_format_warc.c
  vendor/libarchive/dist/libarchive/archive_write_set_format_xar.c
  vendor/libarchive/dist/libarchive/archive_write_set_format_zip.c
  vendor/libarchive/dist/libarchive/archive_write_set_options.3
  vendor/libarchive/dist/libarchive/archive_xxhash.h
  vendor/libarchive/dist/libarchive/filter_fork.h
  vendor/libarchive/dist/libarchive/test/test_archive_write_set_format_filter_by_ext.c
  vendor/libarchive/dist/libarchive/test/test_compat_zip.c
  vendor/libarchive/dist/libarchive/test/test_fuzz.c
  vendor/libarchive/dist/libarchive/test/test_read_extract.c
  vendor/libarchive/dist/libarchive/test/test_read_format_7zip.c
  vendor/libarchive/dist/libarchive/test/test_read_format_7zip_packinfo_digests.c
  vendor/libarchive/dist/libarchive/test/test_read_format_gtar_sparse.c
  vendor/libarchive/dist/libarchive/test/test_read_format_rar5.c
  vendor/libarchive/dist/libarchive/test/test_read_format_zip.c
  vendor/libarchive/dist/libarchive/test/test_read_format_zip_7075_utf8_paths.c
  vendor/libarchive/dist/libarchive/test/test_read_format_zip_comment_stored.c
  vendor/libarchive/dist/libarchive/test/test_read_format_zip_extra_padding.c
  vendor/libarchive/dist/libarchive/test/test_read_format_zip_high_compression.c
  vendor/libarchive/dist/libarchive/test/test_read_format_zip_jar.c
  vendor/libarchive/dist/libarchive/test/test_read_format_zip_mac_metadata.c
  vendor/libarchive/dist/libarchive/test/test_read_format_zip_malformed.c
  vendor/libarchive/dist/libarchive/test/test_read_format_zip_msdos.c
  vendor/libarchive/dist/libarchive/test/test_read_format_zip_nested.c
  vendor/libarchive/dist/libarchive/test/test_read_format_zip_nofiletype.c
  vendor/libarchive/dist/libarchive/test/test_read_format_zip_padded.c
  vendor/libarchive/dist/libarchive/test/test_read_format_zip_sfx.c
  vendor/libarchive/dist/libarchive/test/test_read_format_zip_with_invalid_traditional_eocd.c
  vendor/libarchive/dist/libarchive/test/test_read_format_zip_zip64.c
  vendor/libarchive/dist/libarchive/test/test_read_pax_truncated.c
  vendor/libarchive/dist/libarchive/test/test_read_truncated_filter.c
  vendor/libarchive/dist/libarchive/test/test_sparse_basic.c
  vendor/libarchive/dist/libarchive/test/test_write_disk.c
  vendor/libarchive/dist/libarchive/test/test_write_format_cpio_empty.c
  vendor/libarchive/dist/libarchive/test/test_write_format_pax.c
  vendor/libarchive/dist/libarchive/test/test_write_format_shar_empty.c
  vendor/libarchive/dist/libarchive/test/test_write_format_tar.c
  vendor/libarchive/dist/libarchive/test/test_write_format_tar_sparse.c
  vendor/libarchive/dist/libarchive/test/test_write_format_xar.c
  vendor/libarchive/dist/libarchive/test/test_write_format_zip_file.c
  vendor/libarchive/dist/libarchive/test/test_write_format_zip_file_zip64.c
  vendor/libarchive/dist/libarchive_fe/err.h
  vendor/libarchive/dist/tar/bsdtar.1
  vendor/libarchive/dist/tar/bsdtar.c
  vendor/libarchive/dist/tar/bsdtar.h
  vendor/libarchive/dist/tar/cmdline.c
  vendor/libarchive/dist/tar/test/CMakeLists.txt
  vendor/libarchive/dist/tar/test/test_basic.c
  vendor/libarchive/dist/tar/test/test_copy.c
  vendor/libarchive/dist/tar/test/test_option_C_upper.c
  vendor/libarchive/dist/tar/test/test_option_s.c
  vendor/libarchive/dist/tar/util.c
  vendor/libarchive/dist/test_utils/test_common.h
  vendor/libarchive/dist/test_utils/test_main.c

Modified: vendor/libarchive/dist/.github/workflows/ci.yml
==============================================================================
--- vendor/libarchive/dist/.github/workflows/ci.yml	Tue Feb 11 23:17:58 2020	(r357782)
+++ vendor/libarchive/dist/.github/workflows/ci.yml	Tue Feb 11 23:48:03 2020	(r357783)
@@ -33,6 +33,14 @@ jobs:
       run: ./build/ci/build.sh -a install
       env:
         BS: ${{ matrix.bs }}
+    - name: Artifact
+      run: ./build/ci/build.sh -a artifact
+      env:
+        BS: ${{ matrix.bs }}
+    - uses: actions/upload-artifact at v1
+      with:
+        name: libarchive-macos-${{ matrix.bs }}-${{ github.sha }}
+        path: libarchive.tar.xz
 
   Ubuntu:
     runs-on: ubuntu-latest
@@ -66,7 +74,14 @@ jobs:
       run: ./build/ci/build.sh -a install
       env:
         BS: ${{ matrix.bs }}
-
+    - name: Artifact
+      run: ./build/ci/build.sh -a artifact
+      env:
+        BS: ${{ matrix.bs }}
+    - uses: actions/upload-artifact at v1
+      with:
+        name: libarchive-ubuntu-${{ matrix.bs }}-${{ matrix.crypto }}-${{ github.sha }}
+        path: libarchive.tar.xz
   Ubuntu-distcheck:
     runs-on: ubuntu-latest
     steps:
@@ -114,3 +129,12 @@ jobs:
       shell: cmd
       env:
         BE: ${{ matrix.be }}
+    - name: Artifact
+      run: ./build/ci/github_actions/ci.cmd artifact
+      shell: cmd
+      env:
+        BE: ${{ matrix.be }}
+    - uses: actions/upload-artifact at v1
+      with:
+        name: libarchive-windows-${{ matrix.be }}-${{ github.sha }}
+        path: libarchive.zip

Modified: vendor/libarchive/dist/CMakeLists.txt
==============================================================================
--- vendor/libarchive/dist/CMakeLists.txt	Tue Feb 11 23:17:58 2020	(r357782)
+++ vendor/libarchive/dist/CMakeLists.txt	Tue Feb 11 23:48:03 2020	(r357783)
@@ -18,7 +18,7 @@ endif()
 #   RelWithDebInfo : Release build with Debug Info
 #   MinSizeRel     : Release Min Size build
 IF(NOT CMAKE_BUILD_TYPE)
-  SET(CMAKE_BUILD_TYPE "Debug" CACHE STRING "Build Type" FORCE)
+  SET(CMAKE_BUILD_TYPE "Release" CACHE STRING "Build Type" FORCE)
 ENDIF(NOT CMAKE_BUILD_TYPE)
 # Set a value type to properly display CMAKE_BUILD_TYPE on GUI if the
 # value type is "UNINITIALIZED".
@@ -155,9 +155,9 @@ IF (MSVC)
   #################################################################
   # Set compile flags for debug build.
   # This is added into CMAKE_C_FLAGS when CMAKE_BUILD_TYPE is "Debug"
-  # Enable level 4 C4061: The enumerate has no associated handler in a switch
-  #                       statement.
-  SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /we4061")
+  # Enable level 4 C4062: The enumerate has no associated handler in a switch
+  #                       statement and there is no default that can catch it.
+  SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /we4062")
   # Enable level 4 C4254: A larger bit field was assigned to a smaller bit
   #                       field.
   SET(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /we4254")
@@ -287,6 +287,10 @@ IF("${CMAKE_C_PLATFORM_ID}" MATCHES "^(HP-UX)$")
   ADD_DEFINITIONS(-D_XOPEN_SOURCE=500) # Ask wchar.h for mbstate_t
 ENDIF()
 
+IF(MINGW)
+  ADD_DEFINITIONS(-D__USE_MINGW_ANSI_STDIO)
+ENDIF()
+
 #
 INCLUDE(CheckCSourceCompiles)
 INCLUDE(CheckCSourceRuns)
@@ -1392,6 +1396,7 @@ CHECK_FUNCTION_EXISTS_GLIBC(wctomb HAVE_WCTOMB)
 CHECK_FUNCTION_EXISTS_GLIBC(_ctime64_s HAVE__CTIME64_S)
 CHECK_FUNCTION_EXISTS_GLIBC(_fseeki64 HAVE__FSEEKI64)
 CHECK_FUNCTION_EXISTS_GLIBC(_get_timezone HAVE__GET_TIMEZONE)
+CHECK_FUNCTION_EXISTS_GLIBC(_gmtime64_s HAVE__GMTIME64_S)
 CHECK_FUNCTION_EXISTS_GLIBC(_localtime64_s HAVE__LOCALTIME64_S)
 CHECK_FUNCTION_EXISTS_GLIBC(_mkgmtime64 HAVE__MKGMTIME64)
 

Modified: vendor/libarchive/dist/Makefile.am
==============================================================================
--- vendor/libarchive/dist/Makefile.am	Tue Feb 11 23:17:58 2020	(r357782)
+++ vendor/libarchive/dist/Makefile.am	Tue Feb 11 23:48:03 2020	(r357783)
@@ -228,6 +228,7 @@ libarchive_la_SOURCES= \
 	libarchive/archive_write_set_format_iso9660.c \
 	libarchive/archive_write_set_format_mtree.c \
 	libarchive/archive_write_set_format_pax.c \
+	libarchive/archive_write_set_format_private.h \
 	libarchive/archive_write_set_format_raw.c \
 	libarchive/archive_write_set_format_shar.c \
 	libarchive/archive_write_set_format_ustar.c \
@@ -751,7 +752,9 @@ libarchive_test_EXTRA_DIST=\
 	libarchive/test/test_read_format_7zip_copy_2.7z.uu \
 	libarchive/test/test_read_format_7zip_deflate.7z.uu \
 	libarchive/test/test_read_format_7zip_delta_lzma1.7z.uu \
+	libarchive/test/test_read_format_7zip_delta4_lzma1.7z.uu \
 	libarchive/test/test_read_format_7zip_delta_lzma2.7z.uu \
+	libarchive/test/test_read_format_7zip_delta4_lzma2.7z.uu \
 	libarchive/test/test_read_format_7zip_empty_archive.7z.uu \
 	libarchive/test/test_read_format_7zip_empty_file.7z.uu \
 	libarchive/test/test_read_format_7zip_encryption.7z.uu \
@@ -876,6 +879,7 @@ libarchive_test_EXTRA_DIST=\
 	libarchive/test/test_read_format_rar5_win32.rar.uu \
 	libarchive/test/test_read_format_rar5_arm_filter_on_window_boundary.rar.uu \
 	libarchive/test/test_read_format_rar5_different_winsize_on_merge.rar.uu \
+	libarchive/test/test_read_format_rar5_block_size_is_too_small.rar.uu \
 	libarchive/test/test_read_format_raw.bufr.uu \
 	libarchive/test/test_read_format_raw.data.gz.uu \
 	libarchive/test/test_read_format_raw.data.Z.uu \
@@ -1081,6 +1085,7 @@ bsdtar_test_SOURCES= \
 	tar/test/test_option_q.c \
 	tar/test/test_option_r.c \
 	tar/test/test_option_s.c \
+	tar/test/test_option_safe_writes.c \
 	tar/test/test_option_uid_uname.c \
 	tar/test/test_option_uuencode.c \
 	tar/test/test_option_xattrs.c \

Modified: vendor/libarchive/dist/NEWS
==============================================================================
--- vendor/libarchive/dist/NEWS	Tue Feb 11 23:17:58 2020	(r357782)
+++ vendor/libarchive/dist/NEWS	Tue Feb 11 23:48:03 2020	(r357783)
@@ -1,3 +1,11 @@
+Feb 11, 2020: libarchive 3.4.2 released
+
+Jan 23, 2020: Important fixes for writing XAR archives
+
+Jan 20, 2020: New tar option: --safe-writes (atomical file extraction)
+
+Jan 03, 2020: Support mbed TLS (PolarSSL) as optional crypto provider
+
 Dec 30, 2019: libarchive 3.4.1 released
 
 Dec 11, 2019: New pax write option "xattrhdr"

Modified: vendor/libarchive/dist/build/ci/build.sh
==============================================================================
--- vendor/libarchive/dist/build/ci/build.sh	Tue Feb 11 23:17:58 2020	(r357782)
+++ vendor/libarchive/dist/build/ci/build.sh	Tue Feb 11 23:48:03 2020	(r357783)
@@ -42,6 +42,7 @@ while getopts a:b:c:d:s: opt; do
 				test) ;;
 				install) ;;
 				distcheck) ;;
+				artifact) ;;
 				*) inputerror "Invalid action (-a)" ;;
 			esac
 			ACTIONS="${ACTIONS} ${OPTARG}"
@@ -147,11 +148,15 @@ for action in ${ACTIONS}; do
 		install)
 			${MAKE} ${MAKE_ARGS} install DESTDIR="${BUILDDIR}/destdir"
 			RET="$?"
-			cd ${BUILDDIR}/destdir && ls -lR .
+			cd "${BUILDDIR}/destdir" && ls -lR .
 		;;
 		distcheck)
 			${MAKE} ${MAKE_ARGS} distcheck
 			RET="$?"
+		;;
+		artifact)
+			tar -c -J -C "${BUILDDIR}/destdir" -f "${CURDIR}/libarchive.tar.xz" usr
+			ls -l "${CURDIR}/libarchive.tar.xz"
 		;;
 	esac
 	if [ "${RET}" != "0" ]; then

Modified: vendor/libarchive/dist/build/ci/github_actions/ci.cmd
==============================================================================
--- vendor/libarchive/dist/build/ci/github_actions/ci.cmd	Tue Feb 11 23:17:58 2020	(r357782)
+++ vendor/libarchive/dist/build/ci/github_actions/ci.cmd	Tue Feb 11 23:48:03 2020	(r357783)
@@ -1,5 +1,6 @@
 @ECHO OFF
 SET ZLIB_VERSION=1.2.11
+SET BZIP2_VERSION=b7a672291188a6469f71dd13ad14f2f9a7344fc8
 IF NOT "%BE%"=="mingw-gcc" (
   IF NOT "%BE%"=="msvc" (
     ECHO Environment variable BE must be mingw-gcc or msvc
@@ -7,20 +8,31 @@ IF NOT "%BE%"=="mingw-gcc" (
   )
 )
 
+SET ORIGPATH=%PATH%
+IF "%BE%"=="mingw-gcc" (
+  SET MINGWPATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\Program Files\cmake\bin;C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw64\bin
+)
+
 IF "%1"=="deplibs" (
   IF NOT EXIST build_ci\libs (
     MKDIR build_ci\libs
   )
   CD build_ci\libs
-  IF NOT EXIST zlib-%ZLIB_VERSION%.tar.gz (
-    curl -o zlib-%ZLIB_VERSION%.tar.gz https://www.zlib.net/zlib-%ZLIB_VERSION%.tar.gz
+  IF NOT EXIST zlib-%ZLIB_VERSION%.zip (
+    curl -L -o zlib-%ZLIB_VERSION%.zip https://github.com/libarchive/zlib/archive/v%ZLIB_VERSION%.zip
   )
   IF NOT EXIST zlib-%ZLIB_VERSION% (
-    tar -x -z -f zlib-%ZLIB_VERSION%.tar.gz
+    tar -x -f zlib-%ZLIB_VERSION%.zip
   )
+  IF NOT EXIST bzip2-%BZIP2_VERSION%.zip (
+    curl -L -o bzip2-%BZIP2_VERSION%.zip https://github.com/libarchive/bzip2/archive/%BZIP2_VERSION%.zip
+  )
+  IF NOT EXIST bzip2-%BZIP2_VERSION% (
+    tar -x -f bzip2-%BZIP2_VERSION%.zip
+  )
   CD zlib-%ZLIB_VERSION%
   IF "%BE%"=="mingw-gcc" (
-    SET PATH=C:\Program Files\cmake\bin;C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw64\bin
+    SET PATH=%MINGWPATH%
     cmake -G "MinGW Makefiles" -D CMAKE_BUILD_TYPE="Release" . || EXIT /b 1
     mingw32-make || EXIT /b 1
     mingw32-make test || EXIT /b 1
@@ -31,49 +43,66 @@ IF "%1"=="deplibs" (
     cmake --build . --target RUN_TESTS --config Release || EXIT /b 1
     cmake --build . --target INSTALL --config Release || EXIT /b 1
   )
+  CD ..
+  CD bzip2-%BZIP2_VERSION%
+  IF "%BE%"=="mingw-gcc" (
+    SET PATH=%MINGWPATH%
+    cmake -G "MinGW Makefiles" -D CMAKE_BUILD_TYPE="Release" -D ENABLE_LIB_ONLY=ON -D ENABLE_SHARED_LIB=OFF -D ENABLE_STATIC_LIB=ON . || EXIT /b 1
+    mingw32-make || EXIT /b 1
+    REM mingw32-make test || EXIT /b 1
+    mingw32-make install || EXIT /b 1
+  ) ELSE IF "%BE%"=="msvc" (
+    cmake -G "Visual Studio 16 2019" -D CMAKE_BUILD_TYPE="Release" -D ENABLE_LIB_ONLY=ON -D ENABLE_SHARED_LIB=OFF -D ENABLE_STATIC_LIB=ON . || EXIT /b 1
+    cmake --build . --target ALL_BUILD --config Release || EXIT /b 1
+    REM cmake --build . --target RUN_TESTS --config Release || EXIT /b 1
+    cmake --build . --target INSTALL --config Release || EXIT /b 1
+  )
+  CD ..
 ) ELSE IF "%1%"=="configure" (
   IF "%BE%"=="mingw-gcc" (
-    SET PATH=C:\Program Files\cmake\bin;C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw64\bin
+    SET PATH=%MINGWPATH%
     MKDIR build_ci\cmake
     CD build_ci\cmake
-    cmake -G "MinGW Makefiles" ..\.. || EXIT /b 1
+    cmake -G "MinGW Makefiles" -D ZLIB_LIBRARY="C:/Program Files (x86)/zlib/lib/libzlibstatic.a" -D ZLIB_INCLUDE_DIR="C:/Program Files (x86)/zlib/include" -D BZIP2_LIBRARIES="C:/Program Files (x86)/bzip2/lib/libbz2.a" -D BZIP2_INCLUDE_DIR="C:/Program Files (x86)/bzip2/include" ..\.. || EXIT /b 1
   ) ELSE IF "%BE%"=="msvc" (
     MKDIR build_ci\cmake
     CD build_ci\cmake
-    cmake -G "Visual Studio 16 2019" -D CMAKE_BUILD_TYPE="Release" ..\.. || EXIT /b 1
+    cmake -G "Visual Studio 16 2019" -D CMAKE_BUILD_TYPE="Release" -D ZLIB_LIBRARY="C:/Program Files (x86)/zlib/lib/zlibstatic.lib" -D ZLIB_INCLUDE_DIR="C:/Program Files (x86)/zlib/include" -D BZIP2_LIBRARIES="C:/Program Files (x86)/bzip2/lib/bz2.lib" -D BZIP2_INCLUDE_DIR="C:/Program Files (x86)/bzip2/include" ..\.. || EXIT /b 1
   )
 ) ELSE IF "%1%"=="build" (
   IF "%BE%"=="mingw-gcc" (
-    SET PATH=C:\Program Files\cmake\bin;C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw64\bin
+    SET PATH=%MINGWPATH%
     CD build_ci\cmake
-    mingw32-make || EXIT /b 1
+    mingw32-make VERBOSE=1 || EXIT /b 1
   ) ELSE IF "%BE%"=="msvc" (
     CD build_ci\cmake
-    cmake --build . --target ALL_BUILD --config Release
+    cmake --build . --target ALL_BUILD --config Release || EXIT /b 1
   )
 ) ELSE IF "%1%"=="test" (
   IF "%BE%"=="mingw-gcc" (
-    SET PATH=C:\Program Files\cmake\bin;C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw64\bin
-    COPY "C:\Program Files (x86)\zlib\bin\libzlib.dll" build_ci\cmake\bin\
+    SET PATH=%MINGWPATH%
     CD build_ci\cmake
     SET SKIP_TEST_SPARSE=1
-    mingw32-make test
+    mingw32-make test VERBOSE=1 || EXIT /b 1
   ) ELSE IF "%BE%"=="msvc" (
     ECHO "Skipping tests on this platform"
     EXIT /b 0
     REM CD build_ci\cmake
-    REM cmake --build . --target RUN_TESTS --config Release
+    REM cmake --build . --target RUN_TESTS --config Release || EXIT /b 1
   )
 ) ELSE IF "%1%"=="install" (
   IF "%BE%"=="mingw-gcc" (
-    SET PATH=C:\Program Files\cmake\bin;C:\ProgramData\chocolatey\lib\mingw\tools\install\mingw64\bin
+    SET PATH=%MINGWPATH%
     CD build_ci\cmake
-    mingw32-make install DESTDIR=%cd%\destdir
+    mingw32-make install || EXIT /b 1
   ) ELSE IF "%BE%"=="msvc" (
-    cmake --build . --target INSTALL --config Release
+    CD build_ci\cmake
+    cmake --build . --target INSTALL --config Release || EXIT /b 1
   )
+) ELSE IF "%1"=="artifact" (
+    tar -c -C "C:\Program Files (x86)" --format=zip -f libarchive.zip libarchive
 ) ELSE (
-  ECHO "Usage: %0% deplibs|configure|build|test|install"
+  ECHO "Usage: %0% deplibs|configure|build|test|install|artifact"
   @EXIT /b 0
 )
 @EXIT /b 0

Modified: vendor/libarchive/dist/build/cmake/config.h.in
==============================================================================
--- vendor/libarchive/dist/build/cmake/config.h.in	Tue Feb 11 23:17:58 2020	(r357782)
+++ vendor/libarchive/dist/build/cmake/config.h.in	Tue Feb 11 23:48:03 2020	(r357783)
@@ -1210,6 +1210,9 @@ typedef uint64_t uintmax_t;
 /* Define to 1 if you have the `_get_timezone' function. */
 #cmakedefine HAVE__GET_TIMEZONE 1
 
+/* Define to 1 if you have the `_gmtime64_s' function. */
+#cmakedefine HAVE__GMTIME64_S 1
+
 /* Define to 1 if you have the `_localtime64_s' function. */
 #cmakedefine HAVE__LOCALTIME64_S 1
 

Added: vendor/libarchive/dist/build/release/Dockerfile
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ vendor/libarchive/dist/build/release/Dockerfile	Tue Feb 11 23:48:03 2020	(r357783)
@@ -0,0 +1,11 @@
+FROM ubuntu:18.04
+RUN apt-get update && apt-get install -y build-essential autoconf automake libtool pkg-config cmake libssl-dev libacl1-dev libbz2-dev liblzma-dev libzip-dev liblz4-dev libzstd-dev lzop groff ghostscript bsdmainutils zip
+ADD . $HOME/libarchive/
+ADD "http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD" $HOME/libarchive/build/autoconf/config.guess
+ADD "http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD" $HOME/libarchive/build/autoconf/config.sub
+WORKDIR $HOME/libarchive
+RUN /bin/sh build/clean.sh
+RUN /bin/sh build/autogen.sh
+ENV SKIP_OPEN_FD_ERR_TEST=1 SKIP_TEST_SPARSE=1
+RUN ./configure
+RUN make V=1 distcheck

Added: vendor/libarchive/dist/build/release/release.sh
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ vendor/libarchive/dist/build/release/release.sh	Tue Feb 11 23:48:03 2020	(r357783)
@@ -0,0 +1,8 @@
+#!/bin/sh
+ID=$(docker build -q -f build/release/Dockerfile .)
+if [ -z "$ID" ]; then
+	echo "Failed to build docker image"
+	exit 1
+else
+	docker run $ID sh -c "tar -c -f - libarchive-*" | tar -x -f -
+fi

Modified: vendor/libarchive/dist/build/version
==============================================================================
--- vendor/libarchive/dist/build/version	Tue Feb 11 23:17:58 2020	(r357782)
+++ vendor/libarchive/dist/build/version	Tue Feb 11 23:48:03 2020	(r357783)
@@ -1 +1 @@
-3004002dev
+3004002

Modified: vendor/libarchive/dist/cat/bsdcat.h
==============================================================================
--- vendor/libarchive/dist/cat/bsdcat.h	Tue Feb 11 23:17:58 2020	(r357782)
+++ vendor/libarchive/dist/cat/bsdcat.h	Tue Feb 11 23:48:03 2020	(r357783)
@@ -23,6 +23,9 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
+#ifndef BSDCAT_H_INCLUDED
+#define BSDCAT_H_INCLUDED
+
 #if defined(PLATFORM_CONFIG_H)
 /* Use hand-built config.h in environments that need it. */
 #include PLATFORM_CONFIG_H
@@ -54,3 +57,5 @@ void usage(FILE *stream, int eval);
 void bsdcat_next(void);
 void bsdcat_print_error(void);
 void bsdcat_read_to_stdout(const char* filename);
+
+#endif

Modified: vendor/libarchive/dist/cat/test/test_0.c
==============================================================================
--- vendor/libarchive/dist/cat/test/test_0.c	Tue Feb 11 23:17:58 2020	(r357782)
+++ vendor/libarchive/dist/cat/test/test_0.c	Tue Feb 11 23:48:03 2020	(r357783)
@@ -59,7 +59,7 @@ DEFINE_TEST(test_0)
 	 * we know some option that will succeed.
 	 */
 	if (0 != systemf("%s --version >" DEV_NULL, testprog)) {
-		failure("Unable to successfully run: %s --version\n", testprog, testprog);
+		failure("Unable to successfully run: %s --version\n", testprog);
 		assert(0);
 	}
 

Modified: vendor/libarchive/dist/configure.ac
==============================================================================
--- vendor/libarchive/dist/configure.ac	Tue Feb 11 23:17:58 2020	(r357782)
+++ vendor/libarchive/dist/configure.ac	Tue Feb 11 23:48:03 2020	(r357783)
@@ -4,7 +4,7 @@ dnl First, define all of the version numbers up front.
 dnl In particular, this allows the version macro to be used in AC_INIT
 
 dnl These first two version numbers are updated automatically on each release.
-m4_define([LIBARCHIVE_VERSION_S],[3.4.2dev])
+m4_define([LIBARCHIVE_VERSION_S],[3.4.2])
 m4_define([LIBARCHIVE_VERSION_N],[3004002])
 
 dnl bsdtar and bsdcpio versioning tracks libarchive
@@ -641,7 +641,7 @@ AC_CHECK_FUNCS([strchr strdup strerror strncpy_s strrc
 AC_CHECK_FUNCS([tzset unlinkat unsetenv utime utimensat utimes vfork])
 AC_CHECK_FUNCS([wcrtomb wcscmp wcscpy wcslen wctomb wmemcmp wmemcpy wmemmove])
 AC_CHECK_FUNCS([_ctime64_s _fseeki64])
-AC_CHECK_FUNCS([_get_timezone _localtime64_s _mkgmtime64])
+AC_CHECK_FUNCS([_get_timezone _gmtime64_s _localtime64_s _mkgmtime64])
 # detects cygwin-1.7, as opposed to older versions
 AC_CHECK_FUNCS([cygwin_conv_path])
 

Modified: vendor/libarchive/dist/contrib/archivetest.c
==============================================================================
--- vendor/libarchive/dist/contrib/archivetest.c	Tue Feb 11 23:17:58 2020	(r357782)
+++ vendor/libarchive/dist/contrib/archivetest.c	Tue Feb 11 23:48:03 2020	(r357783)
@@ -37,10 +37,14 @@
 #include <archive.h>
 #include <archive_entry.h>
 
-const char *errnostr(int errno)
+#if defined __MINGW32__
+#include <getopt.h>
+#endif
+
+static const char *errnostr(int e)
 {
 	char *estr;
-	switch(errno) {
+	switch(e) {
 		case ARCHIVE_EOF:
 			estr = "ARCHIVE_EOF";
 		break;
@@ -66,12 +70,12 @@ const char *errnostr(int errno)
 	return (estr);
 }
 
-void usage(const char *prog)
+static void usage(const char *prog)
 {
 	fprintf(stderr, "Usage: %s [-f filename] [-h] [-q] [-s]\n", prog);
 }
 
-void printhelp()
+static void printhelp()
 {
 	fprintf(stdout, "archivetest: verify reading archives with "
 	    "libarchive\n\n"
@@ -84,7 +88,7 @@ void printhelp()
 	    "\n%s\n", archive_version_details());
 }
 
-int v_print(int verbose, const char *format, ...)
+static int v_print(int verbose, const char *format, ...)
 {
 	int r = 0;
 
@@ -139,6 +143,8 @@ int main(int argc, char *argv[])
 					fprintf(stderr, "Unknown option "
 					    "character '\\x%x'.\n", optopt);
 				usage(argv[0]);
+				exit(1);
+				break;
 			default:
 				exit(1);
 		}

Modified: vendor/libarchive/dist/cpio/cpio.c
==============================================================================
--- vendor/libarchive/dist/cpio/cpio.c	Tue Feb 11 23:17:58 2020	(r357782)
+++ vendor/libarchive/dist/cpio/cpio.c	Tue Feb 11 23:48:03 2020	(r357783)
@@ -1139,6 +1139,14 @@ list_item_verbose(struct cpio *cpio, struct archive_en
 	const char		*fmt;
 	time_t			 mtime;
 	static time_t		 now;
+	struct tm		*ltime;
+#if defined(HAVE_LOCALTIME_R) || defined(HAVE__LOCALTIME64_S)
+	struct tm		tmbuf;
+#endif
+#if defined(HAVE__LOCALTIME64_S)
+	errno_t			terr;
+	__time64_t		tmptime;
+#endif
 
 	if (!now)
 		time(&now);
@@ -1186,7 +1194,19 @@ list_item_verbose(struct cpio *cpio, struct archive_en
 	else
 		fmt = cpio->day_first ? "%e %b %H:%M" : "%b %e %H:%M";
 #endif
-	strftime(date, sizeof(date), fmt, localtime(&mtime));
+#if defined(HAVE_LOCALTIME_R)
+	ltime = localtime_r(&mtime, &tmbuf);
+#elif defined(HAVE__LOCALTIME64_S)
+	tmptime = mtime;
+	terr = _localtime64_s(&tmbuf, &tmptime);
+	if (terr)
+		ltime = NULL;
+	else
+		ltime = &tmbuf;
+#else
+	ltime = localtime(&mtime);
+#endif
+	strftime(date, sizeof(date), fmt, ltime);
 
 	fprintf(out, "%s%3d %-8s %-8s %8s %12s %s",
 	    archive_entry_strmode(entry),

Modified: vendor/libarchive/dist/cpio/test/test_basic.c
==============================================================================
--- vendor/libarchive/dist/cpio/test/test_basic.c	Tue Feb 11 23:17:58 2020	(r357782)
+++ vendor/libarchive/dist/cpio/test/test_basic.c	Tue Feb 11 23:48:03 2020	(r357783)
@@ -33,15 +33,15 @@ verify_files(const char *msg)
 	 */
 
 	/* Regular file with 2 links. */
-	failure(msg);
+	failure("%s", msg);
 	assertIsReg("file", 0644);
-	failure(msg);
+	failure("%s", msg);
 	assertFileSize("file", 10);
-	failure(msg);
+	failure("%s", msg);
 	assertFileNLinks("file", 2);
 
 	/* Another name for the same file. */
-	failure(msg);
+	failure("%s", msg);
 	assertIsHardlink("linkfile", "file");
 
 	/* Symlink */
@@ -49,11 +49,11 @@ verify_files(const char *msg)
 		assertIsSymlink("symlink", "file", 0);
 
 	/* Another file with 1 link and different permissions. */
-	failure(msg);
+	failure("%s", msg);
 	assertIsReg("file2", 0777);
-	failure(msg);
+	failure("%s", msg);
 	assertFileSize("file2", 10);
-	failure(msg);
+	failure("%s", msg);
 	assertFileNLinks("file2", 1);
 
 	/* dir */

Modified: vendor/libarchive/dist/cpio/test/test_format_newc.c
==============================================================================
--- vendor/libarchive/dist/cpio/test/test_format_newc.c	Tue Feb 11 23:17:58 2020	(r357782)
+++ vendor/libarchive/dist/cpio/test/test_format_newc.c	Tue Feb 11 23:48:03 2020	(r357783)
@@ -205,9 +205,11 @@ DEFINE_TEST(test_format_newc)
 	gid = from_hex(e + 30, 8); /* gid */
 	assertEqualMem(e + 38, "00000003", 8); /* nlink */
 	t = from_hex(e + 46, 8); /* mtime */
-	failure("t=0x%08x now=0x%08x=%d", t, now, now);
+	failure("t=%#08jx now=%#08jx=%jd", (intmax_t)t, (intmax_t)now,
+	    (intmax_t)now);
 	assert(t <= now); /* File wasn't created in future. */
-	failure("t=0x%08x now - 2=0x%08x = %d", t, now - 2, now - 2);
+	failure("t=%#08jx now - 2=%#08jx=%jd", (intmax_t)t, (intmax_t)now - 2,
+	    (intmax_t)now - 2);
 	assert(t >= now - 2); /* File was created w/in last 2 secs. */
 	failure("newc format stores body only with last appearance of a link\n"
 	    "       first appearance should be empty, so this file size\n"
@@ -243,7 +245,8 @@ DEFINE_TEST(test_format_newc)
 		assertEqualInt(gid, from_hex(e + 30, 8)); /* gid */
 		assertEqualMem(e + 38, "00000001", 8); /* nlink */
 		t2 = from_hex(e + 46, 8); /* mtime */
-		failure("First entry created at t=0x%08x this entry created at t2=0x%08x", t, t2);
+		failure("First entry created at t=%#08jx this entry created"
+		    " at t2=%#08jx", (intmax_t)t, (intmax_t)t2);
 		assert(t2 == t || t2 == t + 1); /* Almost same as first entry. */
 		assertEqualMem(e + 54, "00000005", 8); /* File size */
 		fs = from_hex(e + 54, 8);
@@ -278,7 +281,8 @@ DEFINE_TEST(test_format_newc)
 	assertEqualInt(nlinks("dir"), from_hex(e + 38, 8)); /* nlinks */
 #endif
 	t2 = from_hex(e + 46, 8); /* mtime */
-	failure("First entry created at t=0x%08x this entry created at t2=0x%08x", t, t2);
+	failure("First entry created at t=%#08jx this entry created at"
+	    "t2=%#08jx", (intmax_t)t, (intmax_t)t2);
 	assert(t2 == t || t2 == t + 1); /* Almost same as first entry. */
 	assertEqualMem(e + 54, "00000000", 8); /* File size */
 	fs = from_hex(e + 54, 8);
@@ -311,7 +315,8 @@ DEFINE_TEST(test_format_newc)
 	assertEqualInt(gid, from_hex(e + 30, 8)); /* gid */
 	assertEqualMem(e + 38, "00000003", 8); /* nlink */
 	t2 = from_hex(e + 46, 8); /* mtime */
-	failure("First entry created at t=0x%08x this entry created at t2=0x%08x", t, t2);
+	failure("First entry created at t=%#08jx this entry created at"
+	    "t2=%#08jx", (intmax_t)t, (intmax_t)t2);
 	assert(t2 == t || t2 == t + 1); /* Almost same as first entry. */
 	assertEqualInt(10, from_hex(e + 54, 8)); /* File size */
 	fs = from_hex(e + 54, 8);

Modified: vendor/libarchive/dist/libarchive/CMakeLists.txt
==============================================================================
--- vendor/libarchive/dist/libarchive/CMakeLists.txt	Tue Feb 11 23:17:58 2020	(r357782)
+++ vendor/libarchive/dist/libarchive/CMakeLists.txt	Tue Feb 11 23:48:03 2020	(r357783)
@@ -150,6 +150,7 @@ SET(libarchive_SOURCES
   archive_write_set_format_iso9660.c
   archive_write_set_format_mtree.c
   archive_write_set_format_pax.c
+  archive_write_set_format_private.h
   archive_write_set_format_raw.c
   archive_write_set_format_shar.c
   archive_write_set_format_ustar.c

Modified: vendor/libarchive/dist/libarchive/archive.h
==============================================================================
--- vendor/libarchive/dist/libarchive/archive.h	Tue Feb 11 23:17:58 2020	(r357782)
+++ vendor/libarchive/dist/libarchive/archive.h	Tue Feb 11 23:48:03 2020	(r357783)
@@ -155,7 +155,7 @@ __LA_DECL int		archive_version_number(void);
 /*
  * Textual name/version of the library, useful for version displays.
  */
-#define	ARCHIVE_VERSION_ONLY_STRING "3.4.2dev"
+#define	ARCHIVE_VERSION_ONLY_STRING "3.4.2"
 #define	ARCHIVE_VERSION_STRING "libarchive " ARCHIVE_VERSION_ONLY_STRING
 __LA_DECL const char *	archive_version_string(void);
 
@@ -693,6 +693,8 @@ __LA_DECL int archive_read_set_passphrase_callback(str
 #define ARCHIVE_EXTRACT_SECURE_NOABSOLUTEPATHS (0x10000)
 /* Default: Do not clear no-change flags when unlinking object */
 #define	ARCHIVE_EXTRACT_CLEAR_NOCHANGE_FFLAGS	(0x20000)
+/* Default: Do not extract atomically (using rename) */
+#define	ARCHIVE_EXTRACT_SAFE_WRITES		(0x40000)
 
 __LA_DECL int archive_read_extract(struct archive *, struct archive_entry *,
 		     int flags);

Modified: vendor/libarchive/dist/libarchive/archive_acl_private.h
==============================================================================
--- vendor/libarchive/dist/libarchive/archive_acl_private.h	Tue Feb 11 23:17:58 2020	(r357782)
+++ vendor/libarchive/dist/libarchive/archive_acl_private.h	Tue Feb 11 23:48:03 2020	(r357783)
@@ -25,12 +25,12 @@
  * $FreeBSD$
  */
 
+#ifndef ARCHIVE_ACL_PRIVATE_H_INCLUDED
+#define ARCHIVE_ACL_PRIVATE_H_INCLUDED
+
 #ifndef __LIBARCHIVE_BUILD
 #error This header is only to be used internally to libarchive.
 #endif
-
-#ifndef ARCHIVE_ACL_PRIVATE_H_INCLUDED
-#define	ARCHIVE_ACL_PRIVATE_H_INCLUDED
 
 #include "archive_string.h"
 

Modified: vendor/libarchive/dist/libarchive/archive_blake2.h
==============================================================================
--- vendor/libarchive/dist/libarchive/archive_blake2.h	Tue Feb 11 23:17:58 2020	(r357782)
+++ vendor/libarchive/dist/libarchive/archive_blake2.h	Tue Feb 11 23:48:03 2020	(r357783)
@@ -12,8 +12,9 @@
    More information about the BLAKE2 hash function can be found at
    https://blake2.net.
 */
-#ifndef BLAKE2_H
-#define BLAKE2_H
+
+#ifndef ARCHIVE_BLAKE2_H
+#define ARCHIVE_BLAKE2_H
 
 #include <stddef.h>
 #include <stdint.h>

Modified: vendor/libarchive/dist/libarchive/archive_blake2_impl.h
==============================================================================
--- vendor/libarchive/dist/libarchive/archive_blake2_impl.h	Tue Feb 11 23:17:58 2020	(r357782)
+++ vendor/libarchive/dist/libarchive/archive_blake2_impl.h	Tue Feb 11 23:48:03 2020	(r357783)
@@ -12,8 +12,9 @@
    More information about the BLAKE2 hash function can be found at
    https://blake2.net.
 */
-#ifndef BLAKE2_IMPL_H
-#define BLAKE2_IMPL_H
+
+#ifndef ARCHIVE_BLAKE2_IMPL_H
+#define ARCHIVE_BLAKE2_IMPL_H
 
 #include <stdint.h>
 #include <string.h>

Modified: vendor/libarchive/dist/libarchive/archive_cmdline_private.h
==============================================================================
--- vendor/libarchive/dist/libarchive/archive_cmdline_private.h	Tue Feb 11 23:17:58 2020	(r357782)
+++ vendor/libarchive/dist/libarchive/archive_cmdline_private.h	Tue Feb 11 23:48:03 2020	(r357783)
@@ -25,14 +25,14 @@
  * $FreeBSD$
  */
 
+#ifndef ARCHIVE_CMDLINE_PRIVATE_H
+#define ARCHIVE_CMDLINE_PRIVATE_H
+
 #ifndef __LIBARCHIVE_BUILD
 #ifndef __LIBARCHIVE_TEST
 #error This header is only to be used internally to libarchive.
 #endif
 #endif
-
-#ifndef ARCHIVE_CMDLINE_PRIVATE_H
-#define ARCHIVE_CMDLINE_PRIVATE_H
 
 struct archive_cmdline {
         char            *path;

Modified: vendor/libarchive/dist/libarchive/archive_crc32.h
==============================================================================
--- vendor/libarchive/dist/libarchive/archive_crc32.h	Tue Feb 11 23:17:58 2020	(r357782)
+++ vendor/libarchive/dist/libarchive/archive_crc32.h	Tue Feb 11 23:48:03 2020	(r357783)
@@ -25,6 +25,9 @@
  * $FreeBSD: head/lib/libarchive/archive_crc32.h 201102 2009-12-28 03:11:36Z kientzle $
  */
 
+#ifndef ARCHIVE_CRC32_H
+#define ARCHIVE_CRC32_H
+
 #ifndef __LIBARCHIVE_BUILD
 #error This header is only to be used internally to libarchive.
 #endif
@@ -76,3 +79,5 @@ crc32(unsigned long crc, const void *_p, size_t len)
 		crc = crc_tbl[(crc ^ *p++) & 0xff] ^ (crc >> 8);
 	return (crc ^ 0xffffffffUL);
 }
+
+#endif

Modified: vendor/libarchive/dist/libarchive/archive_cryptor_private.h
==============================================================================
--- vendor/libarchive/dist/libarchive/archive_cryptor_private.h	Tue Feb 11 23:17:58 2020	(r357782)
+++ vendor/libarchive/dist/libarchive/archive_cryptor_private.h	Tue Feb 11 23:48:03 2020	(r357783)
@@ -23,13 +23,12 @@
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
 
-#ifndef __LIBARCHIVE_BUILD
-#error This header is only to be used internally to libarchive.
-#endif
-
 #ifndef ARCHIVE_CRYPTOR_PRIVATE_H_INCLUDED
 #define ARCHIVE_CRYPTOR_PRIVATE_H_INCLUDED
 
+#ifndef __LIBARCHIVE_BUILD
+#error This header is only to be used internally to libarchive.
+#endif
 /*
  * On systems that do not support any recognized crypto libraries,
  * the archive_cryptor.c file will normally define no usable symbols.

Modified: vendor/libarchive/dist/libarchive/archive_digest_private.h
==============================================================================
--- vendor/libarchive/dist/libarchive/archive_digest_private.h	Tue Feb 11 23:17:58 2020	(r357782)
+++ vendor/libarchive/dist/libarchive/archive_digest_private.h	Tue Feb 11 23:48:03 2020	(r357783)
@@ -24,13 +24,12 @@
 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */
 
+#ifndef ARCHIVE_DIGEST_PRIVATE_H_INCLUDED
+#define ARCHIVE_DIGEST_PRIVATE_H_INCLUDED
+
 #ifndef __LIBARCHIVE_BUILD
 #error This header is only to be used internally to libarchive.
 #endif
-
-#ifndef ARCHIVE_CRYPTO_PRIVATE_H_INCLUDED
-#define ARCHIVE_CRYPTO_PRIVATE_H_INCLUDED
-
 /*
  * Crypto support in various Operating Systems:
  *

Modified: vendor/libarchive/dist/libarchive/archive_endian.h
==============================================================================
--- vendor/libarchive/dist/libarchive/archive_endian.h	Tue Feb 11 23:17:58 2020	(r357782)
+++ vendor/libarchive/dist/libarchive/archive_endian.h	Tue Feb 11 23:48:03 2020	(r357783)
@@ -28,16 +28,15 @@
  * Borrowed from FreeBSD's <sys/endian.h>
  */
 
-#ifndef __LIBARCHIVE_BUILD
-#error This header is only to be used internally to libarchive.
-#endif
+#ifndef ARCHIVE_ENDIAN_H_INCLUDED
+#define ARCHIVE_ENDIAN_H_INCLUDED
 
 /* Note:  This is a purely internal header! */
 /* Do not use this outside of libarchive internal code! */
 
-#ifndef ARCHIVE_ENDIAN_H_INCLUDED
-#define ARCHIVE_ENDIAN_H_INCLUDED
-
+#ifndef __LIBARCHIVE_BUILD
+#error This header is only to be used internally to libarchive.
+#endif
 
 /*
  * Disabling inline keyword for compilers known to choke on it:

Modified: vendor/libarchive/dist/libarchive/archive_entry.c
==============================================================================
--- vendor/libarchive/dist/libarchive/archive_entry.c	Tue Feb 11 23:17:58 2020	(r357782)
+++ vendor/libarchive/dist/libarchive/archive_entry.c	Tue Feb 11 23:48:03 2020	(r357783)
@@ -1699,7 +1699,7 @@ static const struct flag {
 	const wchar_t	*wname;
 	unsigned long	 set;
 	unsigned long	 clear;
-} flags[] = {
+} fileflags[] = {
 	/* Preferred (shorter) names per flag first, all prefixed by "no" */
 #ifdef SF_APPEND
 	{ "nosappnd",	L"nosappnd",		SF_APPEND,	0},
@@ -1876,7 +1876,7 @@ ae_fflagstostr(unsigned long bitset, unsigned long bit
 
 	bits = bitset | bitclear;
 	length = 0;
-	for (flag = flags; flag->name != NULL; flag++)
+	for (flag = fileflags; flag->name != NULL; flag++)
 		if (bits & (flag->set | flag->clear)) {
 			length += strlen(flag->name) + 1;
 			bits &= ~(flag->set | flag->clear);
@@ -1889,7 +1889,7 @@ ae_fflagstostr(unsigned long bitset, unsigned long bit
 		return (NULL);
 
 	dp = string;
-	for (flag = flags; flag->name != NULL; flag++) {
+	for (flag = fileflags; flag->name != NULL; flag++) {
 		if (bitset & flag->set || bitclear & flag->clear) {
 			sp = flag->name + 2;
 		} else if (bitset & flag->clear  ||  bitclear & flag->set) {
@@ -1941,7 +1941,7 @@ ae_strtofflags(const char *s, unsigned long *setp, uns
 		    *end != ' '  &&  *end != ',')
 			end++;
 		length = end - start;
-		for (flag = flags; flag->name != NULL; flag++) {
+		for (flag = fileflags; flag->name != NULL; flag++) {
 			size_t flag_length = strlen(flag->name);
 			if (length == flag_length
 			    && memcmp(start, flag->name, length) == 0) {
@@ -2009,7 +2009,7 @@ ae_wcstofflags(const wchar_t *s, unsigned long *setp, 
 		    *end != L' '  &&  *end != L',')
 			end++;
 		length = end - start;
-		for (flag = flags; flag->wname != NULL; flag++) {
+		for (flag = fileflags; flag->wname != NULL; flag++) {
 			size_t flag_length = wcslen(flag->wname);
 			if (length == flag_length
 			    && wmemcmp(start, flag->wname, length) == 0) {

Modified: vendor/libarchive/dist/libarchive/archive_entry_locale.h
==============================================================================
--- vendor/libarchive/dist/libarchive/archive_entry_locale.h	Tue Feb 11 23:17:58 2020	(r357782)
+++ vendor/libarchive/dist/libarchive/archive_entry_locale.h	Tue Feb 11 23:48:03 2020	(r357783)
@@ -25,12 +25,12 @@
  * $FreeBSD$
  */
 
+#ifndef ARCHIVE_ENTRY_LOCALE_H_INCLUDED
+#define ARCHIVE_ENTRY_LOCALE_H_INCLUDED
+
 #ifndef __LIBARCHIVE_BUILD
 #error This header is only to be used internally to libarchive.
 #endif
-
-#ifndef ARCHIVE_ENTRY_LOCALE_H_INCLUDED
-#define	ARCHIVE_ENTRY_LOCALE_H_INCLUDED
 
 struct archive_entry;
 struct archive_string_conv;

Modified: vendor/libarchive/dist/libarchive/archive_entry_private.h
==============================================================================
--- vendor/libarchive/dist/libarchive/archive_entry_private.h	Tue Feb 11 23:17:58 2020	(r357782)
+++ vendor/libarchive/dist/libarchive/archive_entry_private.h	Tue Feb 11 23:48:03 2020	(r357783)
@@ -25,12 +25,12 @@
  * $FreeBSD: head/lib/libarchive/archive_entry_private.h 201096 2009-12-28 02:41:27Z kientzle $
  */
 
+#ifndef ARCHIVE_ENTRY_PRIVATE_H_INCLUDED
+#define ARCHIVE_ENTRY_PRIVATE_H_INCLUDED
+
 #ifndef __LIBARCHIVE_BUILD
 #error This header is only to be used internally to libarchive.
 #endif
-
-#ifndef ARCHIVE_ENTRY_PRIVATE_H_INCLUDED
-#define	ARCHIVE_ENTRY_PRIVATE_H_INCLUDED
 
 #include "archive_acl_private.h"
 #include "archive_string.h"

Modified: vendor/libarchive/dist/libarchive/archive_getdate.c
==============================================================================
--- vendor/libarchive/dist/libarchive/archive_getdate.c	Tue Feb 11 23:17:58 2020	(r357782)
+++ vendor/libarchive/dist/libarchive/archive_getdate.c	Tue Feb 11 23:48:03 2020	(r357783)
@@ -27,6 +27,7 @@
 **  This code is in the public domain and has no copyright.
 */
 
+#include "archive_platform.h"
 #ifdef __FreeBSD__
 #include <sys/cdefs.h>
 __FBSDID("$FreeBSD$");
@@ -694,8 +695,16 @@ Convert(time_t Month, time_t Day, time_t Year,
 	signed char DaysInMonth[12] = {
 		31, 0, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31
 	};
-	time_t	Julian;
-	int	i;
+	time_t		Julian;
+	int		i;
+	struct tm	*ltime;
+#if defined(HAVE_LOCALTIME_R) || defined(HAVE__LOCALTIME64_S)
+	struct tm	tmbuf;
+#endif
+#if defined(HAVE__LOCALTIME64_S)
+	errno_t		terr;
+	__time64_t	tmptime;
+#endif
 
 	if (Year < 69)
 		Year += 2000;
@@ -722,21 +731,64 @@ Convert(time_t Month, time_t Day, time_t Year,
 	Julian *= DAY;
 	Julian += Timezone;
 	Julian += Hours * HOUR + Minutes * MINUTE + Seconds;
+#if defined(HAVE_LOCALTIME_R)
+	ltime = localtime_r(&Julian, &tmbuf);
+#elif defined(HAVE__LOCALTIME64_S)
+	tmptime = Julian;
+	terr = _localtime64_s(&tmbuf, &tmptime);
+	if (terr)
+		ltime = NULL;
+	else
+		ltime = &tmbuf;
+#else
+	ltime = localtime(&Julian);
+#endif
 	if (DSTmode == DSTon
-	    || (DSTmode == DSTmaybe && localtime(&Julian)->tm_isdst))
+	    || (DSTmode == DSTmaybe && ltime->tm_isdst))
 		Julian -= HOUR;
 	return Julian;
 }
 
-
 static time_t
 DSTcorrect(time_t Start, time_t Future)
 {
-	time_t	StartDay;
-	time_t	FutureDay;
+	time_t		StartDay;
+	time_t		FutureDay;
+	struct tm	*ltime;
+#if defined(HAVE_LOCALTIME_R) || defined(HAVE__LOCALTIME64_S)
+	struct tm	tmbuf;
+#endif
+#if defined(HAVE__LOCALTIME64_S)
+	errno_t		terr;
+	__time64_t	tmptime;
+#endif
 
-	StartDay = (localtime(&Start)->tm_hour + 1) % 24;
-	FutureDay = (localtime(&Future)->tm_hour + 1) % 24;
+#if defined(HAVE_LOCALTIME_R)
+	ltime = localtime_r(&Start, &tmbuf);
+#elif defined(HAVE__LOCALTIME64_S)
+	tmptime = Start;
+	terr = _localtime64_s(&tmbuf, &tmptime);
+	if (terr)
+		ltime = NULL;
+	else
+		ltime = &tmbuf;
+#else
+	ltime = localtime(&Start);
+#endif
+	StartDay = (ltime->tm_hour + 1) % 24;
+#if defined(HAVE_LOCALTIME_R)
+	ltime = localtime_r(&Future, &tmbuf);
+#elif defined(HAVE__LOCALTIME64_S)
+	tmptime = Future;
+	terr = _localtime64_s(&tmbuf, &tmptime);
+	if (terr)
+		ltime = NULL;
+	else
+		ltime = &tmbuf;
+#else
+	ltime = localtime(&Future);
+#endif
+	FutureDay = (ltime->tm_hour + 1) % 24;
 	return (Future - Start) + (StartDay - FutureDay) * HOUR;
 }
 
@@ -747,9 +799,27 @@ RelativeDate(time_t Start, time_t zone, int dstmode,
 {
 	struct tm	*tm;
 	time_t	t, now;
+#if defined(HAVE_GMTIME_R) || defined(HAVE__GMTIME64_S)
+	struct tm	tmbuf;
+#endif
+#if defined(HAVE__GMTIME64_S)
+	errno_t		terr;
+	__time64_t	tmptime;
+#endif
 
 	t = Start - zone;
+#if defined(HAVE_GMTIME_R)
+	tm = gmtime_r(&t, &tmbuf);
+#elif defined(HAVE__GMTIME64_S)
+	tmptime = t;
+	terr = _gmtime64_s(&tmbuf, &tmptime);
+	if (terr)
+		tm = NULL;
+	else
+		tm = &tmbuf;
+#else
 	tm = gmtime(&t);
+#endif
 	now = Start;
 	now += DAY * ((DayNumber - tm->tm_wday + 7) % 7);
 	now += 7 * DAY * (DayOrdinal <= 0 ? DayOrdinal : DayOrdinal - 1);
@@ -765,10 +835,28 @@ RelativeMonth(time_t Start, time_t Timezone, time_t Re
 	struct tm	*tm;
 	time_t	Month;
 	time_t	Year;
+#if defined(HAVE_LOCALTIME_R) || defined(HAVE__LOCALTIME64_S)
+	struct tm	tmbuf;
+#endif
+#if defined(HAVE__LOCALTIME64_S)
+	errno_t		terr;
+	__time64_t	tmptime;
+#endif
 
 	if (RelMonth == 0)
 		return 0;
+#if defined(HAVE_LOCALTIME_R)
+	tm = localtime_r(&Start, &tmbuf);
+#elif defined(HAVE__LOCALTIME64_S)
+	tmptime = Start;
+	terr = _localtime64_s(&tmbuf, &tmptime);
+	if (terr)
+		tm = NULL;
+	else
+		tm = &tmbuf;
+#else
 	tm = localtime(&Start);
+#endif
 	Month = 12 * (tm->tm_year + 1900) + tm->tm_mon + RelMonth;
 	Year = Month / 12;
 	Month = Month % 12 + 1;
@@ -905,6 +993,10 @@ __archive_get_date(time_t now, const char *p)
 	time_t		Start;
 	time_t		tod;
 	long		tzone;
+#if defined(HAVE__LOCALTIME64_S) || defined(HAVE__GMTIME64_S)
+	errno_t		terr;
+	__time64_t	tmptime;
+#endif
 
 	/* Clear out the parsed token array. */
 	memset(tokens, 0, sizeof(tokens));
@@ -913,20 +1005,44 @@ __archive_get_date(time_t now, const char *p)
 	gds = &_gds;
 
 	/* Look up the current time. */
+#if defined(HAVE_LOCALTIME_R)
+	tm = localtime_r(&now, &local);
+#elif defined(HAVE__LOCALTIME64_S)
+	tmptime = now;
+	terr = _localtime64_s(&local, &tmptime);
+	if (terr)
+		tm = NULL;
+	else
+		tm = &local;
+#else
 	memset(&local, 0, sizeof(local));
-	tm = localtime (&now);
+	tm = localtime(&now);

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***


More information about the svn-src-vendor mailing list