From owner-svn-src-stable-10@freebsd.org Wed Dec 16 22:25:46 2020 Return-Path: Delivered-To: svn-src-stable-10@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 1299D4C8750; Wed, 16 Dec 2020 22:25:46 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Cx8pd72Qgz4Txf; Wed, 16 Dec 2020 22:25:45 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id E41D25DA3; Wed, 16 Dec 2020 22:25:45 +0000 (UTC) (envelope-from mm@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0BGMPjNr071789; Wed, 16 Dec 2020 22:25:45 GMT (envelope-from mm@FreeBSD.org) Received: (from mm@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0BGMPeep071764; Wed, 16 Dec 2020 22:25:40 GMT (envelope-from mm@FreeBSD.org) Message-Id: <202012162225.0BGMPeep071764@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: mm set sender to mm@FreeBSD.org using -f From: Martin Matuska Date: Wed, 16 Dec 2020 22:25:40 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r368708 - in stable/10: contrib/libarchive contrib/libarchive/libarchive contrib/libarchive/libarchive/test contrib/libarchive/test_utils lib/libarchive lib/libarchive/tests usr.bin/bsd... X-SVN-Group: stable-10 X-SVN-Commit-Author: mm X-SVN-Commit-Paths: in stable/10: contrib/libarchive contrib/libarchive/libarchive contrib/libarchive/libarchive/test contrib/libarchive/test_utils lib/libarchive lib/libarchive/tests usr.bin/bsdcat usr.bin/cpio usr.bin/... X-SVN-Commit-Revision: 368708 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 16 Dec 2020 22:25:46 -0000 Author: mm Date: Wed Dec 16 22:25:40 2020 New Revision: 368708 URL: https://svnweb.freebsd.org/changeset/base/368708 Log: MFC r368207,368607: MFC r368207: Update libarchive to 3.5.0 Relevant vendor changes: Issue #1258: add archive_read_support_filter_by_code() PR #1347: mtree digest reader support Issue #1381: skip hardlinks pointing to itself on extraction PR #1387: fix writing of cpio archives with hardlinks without file type PR #1388: fix rdev field in cpio format for device nodes PR #1389: completed support for UTF-8 encoding conversion PR #1405: more formats in archive_read_support_format_by_code() PR #1408: fix uninitialized size in rar5_read_data PR #1409: system extended attribute support PR #1435: support for decompression of symbolic links in zipx archives Issue #1456: memory leak after unsuccessful archive_write_open_filename MFC r368607: Sync libarchive with vendor. Vendor changes: Issue #1461: Unbreak build without lzma Issue #1462: warc reader: Fix build with gcc11 Issue #1463: Fix code compatibility in test_archive_read_support.c Issue #1464: Use built-in strnlen on platforms where not available Issue #1465: warc reader: fix undefined behaviour in deconst() function Added: stable/10/contrib/libarchive/libarchive/archive_read_support_filter_by_code.c - copied unchanged from r368234, head/contrib/libarchive/libarchive/archive_read_support_filter_by_code.c stable/10/contrib/libarchive/libarchive/test/test_read_format_zip_7z_lzma.zip.uu - copied unchanged from r368234, head/contrib/libarchive/libarchive/test/test_read_format_zip_7z_lzma.zip.uu Modified: stable/10/contrib/libarchive/COPYING stable/10/contrib/libarchive/NEWS stable/10/contrib/libarchive/libarchive/archive.h stable/10/contrib/libarchive/libarchive/archive_acl.c stable/10/contrib/libarchive/libarchive/archive_check_magic.c stable/10/contrib/libarchive/libarchive/archive_cryptor.c stable/10/contrib/libarchive/libarchive/archive_cryptor_private.h stable/10/contrib/libarchive/libarchive/archive_digest_private.h stable/10/contrib/libarchive/libarchive/archive_entry.c stable/10/contrib/libarchive/libarchive/archive_entry.h stable/10/contrib/libarchive/libarchive/archive_entry_private.h stable/10/contrib/libarchive/libarchive/archive_ppmd7.c stable/10/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c stable/10/contrib/libarchive/libarchive/archive_read_filter.3 stable/10/contrib/libarchive/libarchive/archive_read_set_format.c stable/10/contrib/libarchive/libarchive/archive_read_support_format_by_code.c stable/10/contrib/libarchive/libarchive/archive_read_support_format_cab.c stable/10/contrib/libarchive/libarchive/archive_read_support_format_empty.c stable/10/contrib/libarchive/libarchive/archive_read_support_format_mtree.c stable/10/contrib/libarchive/libarchive/archive_read_support_format_rar.c stable/10/contrib/libarchive/libarchive/archive_read_support_format_rar5.c stable/10/contrib/libarchive/libarchive/archive_read_support_format_warc.c stable/10/contrib/libarchive/libarchive/archive_read_support_format_zip.c stable/10/contrib/libarchive/libarchive/archive_string.c stable/10/contrib/libarchive/libarchive/archive_string.h stable/10/contrib/libarchive/libarchive/archive_util.c stable/10/contrib/libarchive/libarchive/archive_write.c stable/10/contrib/libarchive/libarchive/archive_write_add_filter_xz.c stable/10/contrib/libarchive/libarchive/archive_write_disk_posix.c stable/10/contrib/libarchive/libarchive/archive_write_open.3 stable/10/contrib/libarchive/libarchive/archive_write_open_fd.c stable/10/contrib/libarchive/libarchive/archive_write_open_file.c stable/10/contrib/libarchive/libarchive/archive_write_open_filename.c stable/10/contrib/libarchive/libarchive/archive_write_open_memory.c stable/10/contrib/libarchive/libarchive/archive_write_private.h stable/10/contrib/libarchive/libarchive/archive_write_set_format_7zip.c stable/10/contrib/libarchive/libarchive/archive_write_set_format_cpio.c stable/10/contrib/libarchive/libarchive/archive_write_set_format_cpio_newc.c stable/10/contrib/libarchive/libarchive/archive_write_set_format_iso9660.c stable/10/contrib/libarchive/libarchive/archive_write_set_format_mtree.c stable/10/contrib/libarchive/libarchive/archive_write_set_format_xar.c stable/10/contrib/libarchive/libarchive/archive_write_set_format_zip.c stable/10/contrib/libarchive/libarchive/test/test_archive_read_next_header_empty.c stable/10/contrib/libarchive/libarchive/test/test_archive_read_support.c stable/10/contrib/libarchive/libarchive/test/test_archive_string_conversion.c stable/10/contrib/libarchive/libarchive/test/test_entry.c stable/10/contrib/libarchive/libarchive/test/test_read_disk_directory_traversals.c stable/10/contrib/libarchive/libarchive/test/test_read_format_mtree.c stable/10/contrib/libarchive/libarchive/test/test_read_format_mtree.mtree.uu stable/10/contrib/libarchive/libarchive/test/test_read_format_raw.c stable/10/contrib/libarchive/libarchive/test/test_read_format_zip.c stable/10/contrib/libarchive/libarchive/test/test_read_set_format.c stable/10/contrib/libarchive/libarchive/test/test_write_disk_secure.c stable/10/contrib/libarchive/libarchive/test/test_write_format_cpio.c stable/10/contrib/libarchive/libarchive/test/test_write_format_warc.c stable/10/contrib/libarchive/test_utils/test_common.h stable/10/contrib/libarchive/test_utils/test_main.c stable/10/lib/libarchive/Makefile stable/10/lib/libarchive/config_freebsd.h stable/10/lib/libarchive/tests/Makefile stable/10/usr.bin/bsdcat/Makefile stable/10/usr.bin/cpio/Makefile stable/10/usr.bin/tar/Makefile Directory Properties: stable/10/ (props changed) Modified: stable/10/contrib/libarchive/COPYING ============================================================================== --- stable/10/contrib/libarchive/COPYING Wed Dec 16 22:25:20 2020 (r368707) +++ stable/10/contrib/libarchive/COPYING Wed Dec 16 22:25:40 2020 (r368708) @@ -15,7 +15,6 @@ the actual statements in the files are controlling. * The following source files are also subject in whole or in part to a 3-clause UC Regents copyright; please read the individual source files for details: - libarchive/archive_entry.c libarchive/archive_read_support_filter_compress.c libarchive/archive_write_add_filter_compress.c libarchive/mtree.5 Modified: stable/10/contrib/libarchive/NEWS ============================================================================== --- stable/10/contrib/libarchive/NEWS Wed Dec 16 22:25:20 2020 (r368707) +++ stable/10/contrib/libarchive/NEWS Wed Dec 16 22:25:40 2020 (r368708) @@ -1,3 +1,7 @@ +Dec 01, 2020: libarchive 3.5.0 released + +Oct 14, 2020: Support for system extended attributes + May 20, 2020: libarchive 3.4.3 released Apr 30, 2020: Support for pzstd compressed files Modified: stable/10/contrib/libarchive/libarchive/archive.h ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive.h Wed Dec 16 22:25:20 2020 (r368707) +++ stable/10/contrib/libarchive/libarchive/archive.h Wed Dec 16 22:25:40 2020 (r368708) @@ -36,7 +36,7 @@ * assert that ARCHIVE_VERSION_NUMBER >= 2012108. */ /* Note: Compiler will complain if this does not match archive_entry.h! */ -#define ARCHIVE_VERSION_NUMBER 3004003 +#define ARCHIVE_VERSION_NUMBER 3005000 #include #include /* for wchar_t */ @@ -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.3" +#define ARCHIVE_VERSION_ONLY_STRING "3.5.0" #define ARCHIVE_VERSION_STRING "libarchive " ARCHIVE_VERSION_ONLY_STRING __LA_DECL const char * archive_version_string(void); @@ -246,6 +246,8 @@ typedef int archive_open_callback(struct archive *, vo typedef int archive_close_callback(struct archive *, void *_client_data); +typedef int archive_free_callback(struct archive *, void *_client_data); + /* Switches from one client data object to the next/prev client data object. * This is useful for reading from different data blocks such as a set of files * that make up one large file. @@ -418,6 +420,7 @@ __LA_DECL int archive_read_support_compression_xz(stru #endif __LA_DECL int archive_read_support_filter_all(struct archive *); +__LA_DECL int archive_read_support_filter_by_code(struct archive *, int); __LA_DECL int archive_read_support_filter_bzip2(struct archive *); __LA_DECL int archive_read_support_filter_compress(struct archive *); __LA_DECL int archive_read_support_filter_gzip(struct archive *); @@ -817,9 +820,13 @@ __LA_DECL int archive_write_set_format_filter_by_ext(s __LA_DECL int archive_write_set_format_filter_by_ext_def(struct archive *a, const char *filename, const char * def_ext); __LA_DECL int archive_write_zip_set_compression_deflate(struct archive *); __LA_DECL int archive_write_zip_set_compression_store(struct archive *); +/* Deprecated; use archive_write_open2 instead */ __LA_DECL int archive_write_open(struct archive *, void *, archive_open_callback *, archive_write_callback *, archive_close_callback *); +__LA_DECL int archive_write_open2(struct archive *, void *, + archive_open_callback *, archive_write_callback *, + archive_close_callback *, archive_free_callback *); __LA_DECL int archive_write_open_fd(struct archive *, int _fd); __LA_DECL int archive_write_open_filename(struct archive *, const char *_file); __LA_DECL int archive_write_open_filename_w(struct archive *, Modified: stable/10/contrib/libarchive/libarchive/archive_acl.c ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive_acl.c Wed Dec 16 22:25:20 2020 (r368707) +++ stable/10/contrib/libarchive/libarchive/archive_acl.c Wed Dec 16 22:25:40 2020 (r368708) @@ -595,7 +595,7 @@ archive_acl_text_len(struct archive_acl *acl, int want else length += sizeof(uid_t) * 3 + 1; } else { - r = archive_mstring_get_mbs_l(&ap->name, &name, + r = archive_mstring_get_mbs_l(a, &ap->name, &name, &len, sc); if (r != 0) return (0); @@ -966,7 +966,7 @@ archive_acl_to_text_l(struct archive_acl *acl, ssize_t else prefix = NULL; r = archive_mstring_get_mbs_l( - &ap->name, &name, &len, sc); + NULL, &ap->name, &name, &len, sc); if (r != 0) return (NULL); if (count > 0) @@ -1398,14 +1398,14 @@ isint_w(const wchar_t *start, const wchar_t *end, int if (start >= end) return (0); while (start < end) { - if (*start < '0' || *start > '9') + if (*start < L'0' || *start > L'9') return (0); if (n > (INT_MAX / 10) || - (n == INT_MAX / 10 && (*start - '0') > INT_MAX % 10)) { + (n == INT_MAX / 10 && (*start - L'0') > INT_MAX % 10)) { n = INT_MAX; } else { n *= 10; - n += *start - '0'; + n += *start - L'0'; } start++; } Modified: stable/10/contrib/libarchive/libarchive/archive_check_magic.c ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive_check_magic.c Wed Dec 16 22:25:20 2020 (r368707) +++ stable/10/contrib/libarchive/libarchive/archive_check_magic.c Wed Dec 16 22:25:40 2020 (r368708) @@ -54,7 +54,7 @@ errmsg(const char *m) ssize_t written; while (s > 0) { - written = write(2, m, strlen(m)); + written = write(2, m, s); if (written <= 0) return; m += written; Modified: stable/10/contrib/libarchive/libarchive/archive_cryptor.c ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive_cryptor.c Wed Dec 16 22:25:20 2020 (r368707) +++ stable/10/contrib/libarchive/libarchive/archive_cryptor.c Wed Dec 16 22:25:40 2020 (r368708) @@ -347,8 +347,31 @@ aes_ctr_init(archive_crypto_ctx *ctx, const uint8_t *k static int aes_ctr_encrypt_counter(archive_crypto_ctx *ctx) { +#if NETTLE_VERSION_MAJOR < 3 aes_set_encrypt_key(&ctx->ctx, ctx->key_len, ctx->key); aes_encrypt(&ctx->ctx, AES_BLOCK_SIZE, ctx->encr_buf, ctx->nonce); +#else + switch(ctx->key_len) { + case AES128_KEY_SIZE: + aes128_set_encrypt_key(&ctx->ctx.c128, ctx->key); + aes128_encrypt(&ctx->ctx.c128, AES_BLOCK_SIZE, ctx->encr_buf, + ctx->nonce); + break; + case AES192_KEY_SIZE: + aes192_set_encrypt_key(&ctx->ctx.c192, ctx->key); + aes192_encrypt(&ctx->ctx.c192, AES_BLOCK_SIZE, ctx->encr_buf, + ctx->nonce); + break; + case AES256_KEY_SIZE: + aes256_set_encrypt_key(&ctx->ctx.c256, ctx->key); + aes256_encrypt(&ctx->ctx.c256, AES_BLOCK_SIZE, ctx->encr_buf, + ctx->nonce); + break; + default: + return -1; + break; + } +#endif return 0; } Modified: stable/10/contrib/libarchive/libarchive/archive_cryptor_private.h ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive_cryptor_private.h Wed Dec 16 22:25:20 2020 (r368707) +++ stable/10/contrib/libarchive/libarchive/archive_cryptor_private.h Wed Dec 16 22:25:40 2020 (r368708) @@ -104,9 +104,18 @@ typedef struct { #include #endif #include +#include typedef struct { +#if NETTLE_VERSION_MAJOR < 3 struct aes_ctx ctx; +#else + union { + struct aes128_ctx c128; + struct aes192_ctx c192; + struct aes256_ctx c256; + } ctx; +#endif uint8_t key[AES_MAX_KEY_SIZE]; unsigned key_len; uint8_t nonce[AES_BLOCK_SIZE]; Modified: stable/10/contrib/libarchive/libarchive/archive_digest_private.h ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive_digest_private.h Wed Dec 16 22:25:20 2020 (r368707) +++ stable/10/contrib/libarchive/libarchive/archive_digest_private.h Wed Dec 16 22:25:40 2020 (r368708) @@ -30,6 +30,10 @@ #ifndef __LIBARCHIVE_BUILD #error This header is only to be used internally to libarchive. #endif +#ifndef __LIBARCHIVE_CONFIG_H_INCLUDED +#error "Should have include config.h first!" +#endif + /* * Crypto support in various Operating Systems: * Modified: stable/10/contrib/libarchive/libarchive/archive_entry.c ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive_entry.c Wed Dec 16 22:25:20 2020 (r368707) +++ stable/10/contrib/libarchive/libarchive/archive_entry.c Wed Dec 16 22:25:40 2020 (r368708) @@ -208,6 +208,19 @@ archive_entry_clone(struct archive_entry *entry) /* Copy encryption status */ entry2->encryption = entry->encryption; + + /* Copy digests */ +#define copy_digest(_e2, _e, _t) \ + memcpy(_e2->digest._t, _e->digest._t, sizeof(_e2->digest._t)) + + copy_digest(entry2, entry, md5); + copy_digest(entry2, entry, rmd160); + copy_digest(entry2, entry, sha1); + copy_digest(entry2, entry, sha256); + copy_digest(entry2, entry, sha384); + copy_digest(entry2, entry, sha512); + +#undef copy_digest /* Copy ACL data over. */ archive_acl_copy(&entry2->acl, &entry->acl); @@ -450,7 +463,7 @@ int _archive_entry_gname_l(struct archive_entry *entry, const char **p, size_t *len, struct archive_string_conv *sc) { - return (archive_mstring_get_mbs_l(&entry->ae_gname, p, len, sc)); + return (archive_mstring_get_mbs_l(entry->archive, &entry->ae_gname, p, len, sc)); } const char * @@ -504,7 +517,7 @@ _archive_entry_hardlink_l(struct archive_entry *entry, *len = 0; return (0); } - return (archive_mstring_get_mbs_l(&entry->ae_hardlink, p, len, sc)); + return (archive_mstring_get_mbs_l(entry->archive, &entry->ae_hardlink, p, len, sc)); } la_int64_t @@ -595,7 +608,7 @@ int _archive_entry_pathname_l(struct archive_entry *entry, const char **p, size_t *len, struct archive_string_conv *sc) { - return (archive_mstring_get_mbs_l(&entry->ae_pathname, p, len, sc)); + return (archive_mstring_get_mbs_l(entry->archive, &entry->ae_pathname, p, len, sc)); } __LA_MODE_T @@ -723,7 +736,7 @@ _archive_entry_symlink_l(struct archive_entry *entry, *len = 0; return (0); } - return (archive_mstring_get_mbs_l( &entry->ae_symlink, p, len, sc)); + return (archive_mstring_get_mbs_l(entry->archive, &entry->ae_symlink, p, len, sc)); } la_int64_t @@ -769,7 +782,7 @@ int _archive_entry_uname_l(struct archive_entry *entry, const char **p, size_t *len, struct archive_string_conv *sc) { - return (archive_mstring_get_mbs_l(&entry->ae_uname, p, len, sc)); + return (archive_mstring_get_mbs_l(entry->archive, &entry->ae_uname, p, len, sc)); } int @@ -1414,6 +1427,62 @@ archive_entry_copy_mac_metadata(struct archive_entry * abort(); memcpy(entry->mac_metadata, p, s); } +} + +/* Digest handling */ +const unsigned char * +archive_entry_digest(struct archive_entry *entry, int type) +{ + switch (type) { + case ARCHIVE_ENTRY_DIGEST_MD5: + return entry->digest.md5; + case ARCHIVE_ENTRY_DIGEST_RMD160: + return entry->digest.rmd160; + case ARCHIVE_ENTRY_DIGEST_SHA1: + return entry->digest.sha1; + case ARCHIVE_ENTRY_DIGEST_SHA256: + return entry->digest.sha256; + case ARCHIVE_ENTRY_DIGEST_SHA384: + return entry->digest.sha384; + case ARCHIVE_ENTRY_DIGEST_SHA512: + return entry->digest.sha512; + default: + return NULL; + } +} + +int +archive_entry_set_digest(struct archive_entry *entry, int type, + const unsigned char *digest) +{ +#define copy_digest(_e, _t, _d)\ + memcpy(_e->digest._t, _d, sizeof(_e->digest._t)) + + switch (type) { + case ARCHIVE_ENTRY_DIGEST_MD5: + copy_digest(entry, md5, digest); + break; + case ARCHIVE_ENTRY_DIGEST_RMD160: + copy_digest(entry, rmd160, digest); + break; + case ARCHIVE_ENTRY_DIGEST_SHA1: + copy_digest(entry, sha1, digest); + break; + case ARCHIVE_ENTRY_DIGEST_SHA256: + copy_digest(entry, sha256, digest); + break; + case ARCHIVE_ENTRY_DIGEST_SHA384: + copy_digest(entry, sha384, digest); + break; + case ARCHIVE_ENTRY_DIGEST_SHA512: + copy_digest(entry, sha512, digest); + break; + default: + return ARCHIVE_WARN; + } + + return ARCHIVE_OK; +#undef copy_digest } /* Modified: stable/10/contrib/libarchive/libarchive/archive_entry.h ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive_entry.h Wed Dec 16 22:25:20 2020 (r368707) +++ stable/10/contrib/libarchive/libarchive/archive_entry.h Wed Dec 16 22:25:40 2020 (r368708) @@ -30,7 +30,7 @@ #define ARCHIVE_ENTRY_H_INCLUDED /* Note: Compiler will complain if this does not match archive.h! */ -#define ARCHIVE_VERSION_NUMBER 3004003 +#define ARCHIVE_VERSION_NUMBER 3005000 /* * Note: archive_entry.h is for use outside of libarchive; the @@ -395,6 +395,19 @@ __LA_DECL void archive_entry_copy_stat(struct archive_ __LA_DECL const void * archive_entry_mac_metadata(struct archive_entry *, size_t *); __LA_DECL void archive_entry_copy_mac_metadata(struct archive_entry *, const void *, size_t); + +/* + * Digest routine. This is used to query the raw hex digest for the + * given entry. The type of digest is provided as an argument. + */ +#define ARCHIVE_ENTRY_DIGEST_MD5 0x00000001 +#define ARCHIVE_ENTRY_DIGEST_RMD160 0x00000002 +#define ARCHIVE_ENTRY_DIGEST_SHA1 0x00000003 +#define ARCHIVE_ENTRY_DIGEST_SHA256 0x00000004 +#define ARCHIVE_ENTRY_DIGEST_SHA384 0x00000005 +#define ARCHIVE_ENTRY_DIGEST_SHA512 0x00000006 + +__LA_DECL const unsigned char * archive_entry_digest(struct archive_entry *, int /* type */); /* * ACL routines. This used to simply store and return text-format ACL Modified: stable/10/contrib/libarchive/libarchive/archive_entry_private.h ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive_entry_private.h Wed Dec 16 22:25:20 2020 (r368707) +++ stable/10/contrib/libarchive/libarchive/archive_entry_private.h Wed Dec 16 22:25:40 2020 (r368708) @@ -50,6 +50,15 @@ struct ae_sparse { int64_t length; }; +struct ae_digest { + unsigned char md5[16]; + unsigned char rmd160[20]; + unsigned char sha1[20]; + unsigned char sha256[32]; + unsigned char sha384[48]; + unsigned char sha512[64]; +}; + /* * Description of an archive entry. * @@ -162,6 +171,9 @@ struct archive_entry { void *mac_metadata; size_t mac_metadata_size; + /* Digest support. */ + struct ae_digest digest; + /* ACL support. */ struct archive_acl acl; @@ -180,5 +192,9 @@ struct archive_entry { /* Symlink type support */ int ae_symlink_type; }; + +int +archive_entry_set_digest(struct archive_entry *entry, int type, + const unsigned char *digest); #endif /* ARCHIVE_ENTRY_PRIVATE_H_INCLUDED */ Modified: stable/10/contrib/libarchive/libarchive/archive_ppmd7.c ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive_ppmd7.c Wed Dec 16 22:25:20 2020 (r368707) +++ stable/10/contrib/libarchive/libarchive/archive_ppmd7.c Wed Dec 16 22:25:40 2020 (r368708) @@ -4,7 +4,7 @@ This code is based on PPMd var.H (2001): Dmitry Shkari #include "archive_platform.h" -#include +#include #include "archive_ppmd7_private.h" Modified: stable/10/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c Wed Dec 16 22:25:20 2020 (r368707) +++ stable/10/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c Wed Dec 16 22:25:40 2020 (r368708) @@ -103,6 +103,10 @@ __FBSDID("$FreeBSD"); static int setup_mac_metadata(struct archive_read_disk *, struct archive_entry *, int *fd); +#ifdef ARCHIVE_XATTR_FREEBSD +static int setup_xattrs_namespace(struct archive_read_disk *, + struct archive_entry *, int *, int); +#endif static int setup_xattrs(struct archive_read_disk *, struct archive_entry *, int *fd); static int setup_sparse(struct archive_read_disk *, @@ -701,14 +705,13 @@ setup_xattr(struct archive_read_disk *a, struct archiv } static int -setup_xattrs(struct archive_read_disk *a, - struct archive_entry *entry, int *fd) +setup_xattrs_namespace(struct archive_read_disk *a, + struct archive_entry *entry, int *fd, int namespace) { char buff[512]; char *list, *p; ssize_t list_size; const char *path; - int namespace = EXTATTR_NAMESPACE_USER; path = NULL; @@ -727,6 +730,8 @@ setup_xattrs(struct archive_read_disk *a, if (list_size == -1 && errno == EOPNOTSUPP) return (ARCHIVE_OK); + if (list_size == -1 && errno == EPERM) + return (ARCHIVE_OK); if (list_size == -1) { archive_set_error(&a->archive, errno, "Couldn't list extended attributes"); @@ -760,7 +765,17 @@ setup_xattrs(struct archive_read_disk *a, size_t len = 255 & (int)*p; char *name; - strcpy(buff, "user."); + if (namespace == EXTATTR_NAMESPACE_SYSTEM) { + if (!strcmp(p + 1, "nfs4.acl") || + !strcmp(p + 1, "posix1e.acl_access") || + !strcmp(p + 1, "posix1e.acl_default")) { + p += 1 + len; + continue; + } + strcpy(buff, "system."); + } else { + strcpy(buff, "user."); + } name = buff + strlen(buff); memcpy(name, p + 1, len); name[len] = '\0'; @@ -769,6 +784,31 @@ setup_xattrs(struct archive_read_disk *a, } free(list); + return (ARCHIVE_OK); +} + +static int +setup_xattrs(struct archive_read_disk *a, + struct archive_entry *entry, int *fd) +{ + int namespaces[2]; + int i, res; + + namespaces[0] = EXTATTR_NAMESPACE_USER; + namespaces[1] = EXTATTR_NAMESPACE_SYSTEM; + + for (i = 0; i < 2; i++) { + res = setup_xattrs_namespace(a, entry, fd, + namespaces[i]); + switch (res) { + case (ARCHIVE_OK): + case (ARCHIVE_WARN): + break; + default: + return (res); + } + } + return (ARCHIVE_OK); } Modified: stable/10/contrib/libarchive/libarchive/archive_read_filter.3 ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive_read_filter.3 Wed Dec 16 22:25:20 2020 (r368707) +++ stable/10/contrib/libarchive/libarchive/archive_read_filter.3 Wed Dec 16 22:25:40 2020 (r368708) @@ -24,7 +24,7 @@ .\" .\" $FreeBSD$ .\" -.Dd August 14, 2014 +.Dd June 9, 2020 .Dt ARCHIVE_READ_FILTER 3 .Os .Sh NAME @@ -50,6 +50,8 @@ Streaming Archive Library (libarchive, -larchive) .Ft int .Fn archive_read_support_filter_all "struct archive *" .Ft int +.Fn archive_read_support_filter_by_code "struct archive *" "int" +.Ft int .Fn archive_read_support_filter_bzip2 "struct archive *" .Ft int .Fn archive_read_support_filter_compress "struct archive *" @@ -116,6 +118,14 @@ Note that is always enabled by default. .It Fn archive_read_support_filter_all Enables all available decompression filters. +.It Fn archive_read_support_filter_by_code +Enables a single filter specified by the filter code. +This function does not work with +.Cm ARCHIVE_FILTER_PROGRAM . +Note: In statically-linked executables, this will cause +your program to include support for every filter. +If executable size is a concern, you may wish to avoid +using this function. .It Fn archive_read_support_filter_program Data is fed through the specified external program before being dearchived. Note that this disables automatic detection of the compression format, Modified: stable/10/contrib/libarchive/libarchive/archive_read_set_format.c ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive_read_set_format.c Wed Dec 16 22:25:20 2020 (r368707) +++ stable/10/contrib/libarchive/libarchive/archive_read_set_format.c Wed Dec 16 22:25:40 2020 (r368708) @@ -61,6 +61,9 @@ archive_read_set_format(struct archive *_a, int code) case ARCHIVE_FORMAT_CPIO: strcpy(str, "cpio"); break; + case ARCHIVE_FORMAT_EMPTY: + strcpy(str, "empty"); + break; case ARCHIVE_FORMAT_ISO9660: strcpy(str, "iso9660"); break; @@ -76,8 +79,14 @@ archive_read_set_format(struct archive *_a, int code) case ARCHIVE_FORMAT_RAR_V5: strcpy(str, "rar5"); break; + case ARCHIVE_FORMAT_RAW: + strcpy(str, "raw"); + break; case ARCHIVE_FORMAT_TAR: strcpy(str, "tar"); + break; + case ARCHIVE_FORMAT_WARC: + strcpy(str, "warc"); break; case ARCHIVE_FORMAT_XAR: strcpy(str, "xar"); Copied: stable/10/contrib/libarchive/libarchive/archive_read_support_filter_by_code.c (from r368234, head/contrib/libarchive/libarchive/archive_read_support_filter_by_code.c) ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ stable/10/contrib/libarchive/libarchive/archive_read_support_filter_by_code.c Wed Dec 16 22:25:40 2020 (r368708, copy of r368234, head/contrib/libarchive/libarchive/archive_read_support_filter_by_code.c) @@ -0,0 +1,83 @@ +/*- + * Copyright (c) 2020 Martin Matuska + * All rights reserved. + * + * 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. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S) ``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 AUTHOR(S) 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. + */ + +#include "archive_platform.h" +__FBSDID("$FreeBSD$"); + +#include "archive.h" +#include "archive_private.h" + +int +archive_read_support_filter_by_code(struct archive *a, int filter_code) +{ + archive_check_magic(a, ARCHIVE_READ_MAGIC, + ARCHIVE_STATE_NEW, "archive_read_support_filter_by_code"); + + switch (filter_code) { + case ARCHIVE_FILTER_NONE: + return archive_read_support_filter_none(a); + break; + case ARCHIVE_FILTER_GZIP: + return archive_read_support_filter_gzip(a); + break; + case ARCHIVE_FILTER_BZIP2: + return archive_read_support_filter_bzip2(a); + break; + case ARCHIVE_FILTER_COMPRESS: + return archive_read_support_filter_compress(a); + break; + case ARCHIVE_FILTER_LZMA: + return archive_read_support_filter_lzma(a); + break; + case ARCHIVE_FILTER_XZ: + return archive_read_support_filter_xz(a); + break; + case ARCHIVE_FILTER_UU: + return archive_read_support_filter_uu(a); + break; + case ARCHIVE_FILTER_RPM: + return archive_read_support_filter_rpm(a); + break; + case ARCHIVE_FILTER_LZIP: + return archive_read_support_filter_lzip(a); + break; + case ARCHIVE_FILTER_LRZIP: + return archive_read_support_filter_lrzip(a); + break; + case ARCHIVE_FILTER_LZOP: + return archive_read_support_filter_lzop(a); + break; + case ARCHIVE_FILTER_GRZIP: + return archive_read_support_filter_grzip(a); + break; + case ARCHIVE_FILTER_LZ4: + return archive_read_support_filter_lz4(a); + break; + case ARCHIVE_FILTER_ZSTD: + return archive_read_support_filter_zstd(a); + break; + } + return (ARCHIVE_FATAL); +} Modified: stable/10/contrib/libarchive/libarchive/archive_read_support_format_by_code.c ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive_read_support_format_by_code.c Wed Dec 16 22:25:20 2020 (r368707) +++ stable/10/contrib/libarchive/libarchive/archive_read_support_format_by_code.c Wed Dec 16 22:25:40 2020 (r368708) @@ -26,6 +26,10 @@ #include "archive_platform.h" __FBSDID("$FreeBSD$"); +#ifdef HAVE_ERRNO_H +#include +#endif + #include "archive.h" #include "archive_private.h" @@ -48,6 +52,9 @@ archive_read_support_format_by_code(struct archive *a, case ARCHIVE_FORMAT_CPIO: return archive_read_support_format_cpio(a); break; + case ARCHIVE_FORMAT_EMPTY: + return archive_read_support_format_empty(a); + break; case ARCHIVE_FORMAT_ISO9660: return archive_read_support_format_iso9660(a); break; @@ -63,9 +70,15 @@ archive_read_support_format_by_code(struct archive *a, case ARCHIVE_FORMAT_RAR_V5: return archive_read_support_format_rar5(a); break; + case ARCHIVE_FORMAT_RAW: + return archive_read_support_format_raw(a); + break; case ARCHIVE_FORMAT_TAR: return archive_read_support_format_tar(a); break; + case ARCHIVE_FORMAT_WARC: + return archive_read_support_format_warc(a); + break; case ARCHIVE_FORMAT_XAR: return archive_read_support_format_xar(a); break; @@ -73,5 +86,7 @@ archive_read_support_format_by_code(struct archive *a, return archive_read_support_format_zip(a); break; } + archive_set_error(a, ARCHIVE_ERRNO_PROGRAMMER, + "Invalid format code specified"); return (ARCHIVE_FATAL); } Modified: stable/10/contrib/libarchive/libarchive/archive_read_support_format_cab.c ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive_read_support_format_cab.c Wed Dec 16 22:25:20 2020 (r368707) +++ stable/10/contrib/libarchive/libarchive/archive_read_support_format_cab.c Wed Dec 16 22:25:40 2020 (r368708) @@ -1172,7 +1172,7 @@ cab_checksum_finish(struct archive_read *a) cfdata->memimage + CFDATA_cbData, l, cfdata->sum_calculated); if (cfdata->sum_calculated != cfdata->sum) { archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT, - "Checksum error CFDATA[%d] %x:%x in %d bytes", + "Checksum error CFDATA[%d] %" PRIx32 ":%" PRIx32 " in %d bytes", cab->entry_cffolder->cfdata_index -1, cfdata->sum, cfdata->sum_calculated, cfdata->compressed_size); Modified: stable/10/contrib/libarchive/libarchive/archive_read_support_format_empty.c ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive_read_support_format_empty.c Wed Dec 16 22:25:20 2020 (r368707) +++ stable/10/contrib/libarchive/libarchive/archive_read_support_format_empty.c Wed Dec 16 22:25:40 2020 (r368708) @@ -47,7 +47,7 @@ archive_read_support_format_empty(struct archive *_a) r = __archive_read_register_format(a, NULL, - NULL, + "empty", archive_read_format_empty_bid, NULL, archive_read_format_empty_read_header, Modified: stable/10/contrib/libarchive/libarchive/archive_read_support_format_mtree.c ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive_read_support_format_mtree.c Wed Dec 16 22:25:20 2020 (r368707) +++ stable/10/contrib/libarchive/libarchive/archive_read_support_format_mtree.c Wed Dec 16 22:25:40 2020 (r368708) @@ -51,6 +51,7 @@ __FBSDID("$FreeBSD$"); #include "archive.h" #include "archive_entry.h" +#include "archive_entry_private.h" #include "archive_private.h" #include "archive_rb.h" #include "archive_read_private.h" @@ -1482,6 +1483,84 @@ parse_device(dev_t *pdev, struct archive *a, char *val #undef MAX_PACK_ARGS } +static int +parse_hex_nibble(char c) +{ + if (c >= '0' && c <= '9') + return c - '0'; + if (c >= 'a' && c <= 'f') + return 10 + c - 'a'; +#if 0 + /* XXX: Is uppercase something we should support? */ + if (c >= 'A' && c <= 'F') + return 10 + c - 'A'; +#endif + + return -1; +} + +static int +parse_digest(struct archive_read *a, struct archive_entry *entry, + const char *digest, int type) +{ + unsigned char digest_buf[64]; + int high, low; + size_t i, j, len; + + switch (type) { + case ARCHIVE_ENTRY_DIGEST_MD5: + len = sizeof(entry->digest.md5); + break; + case ARCHIVE_ENTRY_DIGEST_RMD160: + len = sizeof(entry->digest.rmd160); + break; + case ARCHIVE_ENTRY_DIGEST_SHA1: + len = sizeof(entry->digest.sha1); + break; + case ARCHIVE_ENTRY_DIGEST_SHA256: + len = sizeof(entry->digest.sha256); + break; + case ARCHIVE_ENTRY_DIGEST_SHA384: + len = sizeof(entry->digest.sha384); + break; + case ARCHIVE_ENTRY_DIGEST_SHA512: + len = sizeof(entry->digest.sha512); + break; + default: + archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER, + "Internal error: Unknown digest type"); + return ARCHIVE_FATAL; + } + + if (len > sizeof(digest_buf)) { + archive_set_error(&a->archive, ARCHIVE_ERRNO_PROGRAMMER, + "Internal error: Digest storage too large"); + return ARCHIVE_FATAL; + } + + len *= 2; + + if (strnlen(digest, len+1) != len) { + archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT, + "incorrect digest length, ignoring"); + return ARCHIVE_WARN; + } + + for (i = 0, j = 0; i < len; i += 2, j++) { + high = parse_hex_nibble(digest[i]); + low = parse_hex_nibble(digest[i+1]); + if (high == -1 || low == -1) { + archive_set_error(&a->archive, ARCHIVE_ERRNO_FILE_FORMAT, + "invalid digest data, ignoring"); + return ARCHIVE_WARN; + } + + digest_buf[j] = high << 4 | low; + } + + return archive_entry_set_digest(entry, type, digest_buf); +} + /* * Parse a single keyword and its value. */ @@ -1580,8 +1659,10 @@ parse_keyword(struct archive_read *a, struct mtree *mt } __LA_FALLTHROUGH; case 'm': - if (strcmp(key, "md5") == 0 || strcmp(key, "md5digest") == 0) - break; + if (strcmp(key, "md5") == 0 || strcmp(key, "md5digest") == 0) { + return parse_digest(a, entry, val, + ARCHIVE_ENTRY_DIGEST_MD5); + } if (strcmp(key, "mode") == 0) { if (val[0] >= '0' && val[0] <= '7') { *parsed_kws |= MTREE_HAS_PERM; @@ -1617,21 +1698,32 @@ parse_keyword(struct archive_read *a, struct mtree *mt return r; } if (strcmp(key, "rmd160") == 0 || - strcmp(key, "rmd160digest") == 0) - break; + strcmp(key, "rmd160digest") == 0) { + return parse_digest(a, entry, val, + ARCHIVE_ENTRY_DIGEST_RMD160); + } __LA_FALLTHROUGH; case 's': - if (strcmp(key, "sha1") == 0 || strcmp(key, "sha1digest") == 0) - break; + if (strcmp(key, "sha1") == 0 || + strcmp(key, "sha1digest") == 0) { + return parse_digest(a, entry, val, + ARCHIVE_ENTRY_DIGEST_SHA1); + } if (strcmp(key, "sha256") == 0 || - strcmp(key, "sha256digest") == 0) - break; + strcmp(key, "sha256digest") == 0) { + return parse_digest(a, entry, val, + ARCHIVE_ENTRY_DIGEST_SHA256); + } if (strcmp(key, "sha384") == 0 || - strcmp(key, "sha384digest") == 0) - break; + strcmp(key, "sha384digest") == 0) { + return parse_digest(a, entry, val, + ARCHIVE_ENTRY_DIGEST_SHA384); + } if (strcmp(key, "sha512") == 0 || - strcmp(key, "sha512digest") == 0) - break; + strcmp(key, "sha512digest") == 0) { + return parse_digest(a, entry, val, + ARCHIVE_ENTRY_DIGEST_SHA512); + } if (strcmp(key, "size") == 0) { archive_entry_set_size(entry, mtree_atol(&val, 10)); break; Modified: stable/10/contrib/libarchive/libarchive/archive_read_support_format_rar.c ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive_read_support_format_rar.c Wed Dec 16 22:25:20 2020 (r368707) +++ stable/10/contrib/libarchive/libarchive/archive_read_support_format_rar.c Wed Dec 16 22:25:40 2020 (r368708) @@ -151,6 +151,9 @@ #undef minimum #define minimum(a, b) ((a)<(b)?(a):(b)) +/* Stack overflow check */ +#define MAX_COMPRESS_DEPTH 1024 + /* Fields common to all headers */ struct rar_header { @@ -339,7 +342,7 @@ static int read_symlink_stored(struct archive_read *, static int read_data_stored(struct archive_read *, const void **, size_t *, int64_t *); static int read_data_compressed(struct archive_read *, const void **, size_t *, - int64_t *); + int64_t *, size_t); static int rar_br_preparation(struct archive_read *, struct rar_br *); static int parse_codes(struct archive_read *); static void free_codes(struct archive_read *); @@ -1025,7 +1028,7 @@ archive_read_format_rar_read_data(struct archive_read case COMPRESS_METHOD_NORMAL: case COMPRESS_METHOD_GOOD: case COMPRESS_METHOD_BEST: - ret = read_data_compressed(a, buff, size, offset); + ret = read_data_compressed(a, buff, size, offset, 0); if (ret != ARCHIVE_OK && ret != ARCHIVE_WARN) { __archive_ppmd7_functions.Ppmd7_Free(&rar->ppmd7_context); rar->start_new_table = 1; @@ -1876,8 +1879,11 @@ read_data_stored(struct archive_read *a, const void ** static int read_data_compressed(struct archive_read *a, const void **buff, size_t *size, - int64_t *offset) + int64_t *offset, size_t looper) { + if (looper++ > MAX_COMPRESS_DEPTH) + return (ARCHIVE_FATAL); + struct rar *rar; int64_t start, end, actualend; size_t bs; @@ -1975,7 +1981,7 @@ read_data_compressed(struct archive_read *a, const voi { case 0: rar->start_new_table = 1; - return read_data_compressed(a, buff, size, offset); + return read_data_compressed(a, buff, size, offset, looper); case 2: rar->ppmd_eod = 1;/* End Of ppmd Data. */ Modified: stable/10/contrib/libarchive/libarchive/archive_read_support_format_rar5.c ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive_read_support_format_rar5.c Wed Dec 16 22:25:20 2020 (r368707) +++ stable/10/contrib/libarchive/libarchive/archive_read_support_format_rar5.c Wed Dec 16 22:25:40 2020 (r368708) @@ -3831,7 +3831,7 @@ static int verify_checksums(struct archive_read* a) { DEBUG_CODE { printf("Checksum error: CRC32 " - "(was: %08x, expected: %08x)\n", + "(was: %08" PRIx32 ", expected: %08" PRIx32 ")\n", rar->file.calculated_crc32, rar->file.stored_crc32); } @@ -3845,7 +3845,7 @@ static int verify_checksums(struct archive_read* a) { } else { DEBUG_CODE { printf("Checksum OK: CRC32 " - "(%08x/%08x)\n", + "(%08" PRIx32 "/%08" PRIx32 ")\n", rar->file.stored_crc32, rar->file.calculated_crc32); } @@ -3905,6 +3905,9 @@ static int rar5_read_data(struct archive_read *a, cons size_t *size, int64_t *offset) { int ret; struct rar5* rar = get_context(a); + + if (size) + *size = 0; if(rar->file.dir > 0) { /* Don't process any data if this file entry was declared Modified: stable/10/contrib/libarchive/libarchive/archive_read_support_format_warc.c ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive_read_support_format_warc.c Wed Dec 16 22:25:20 2020 (r368707) +++ stable/10/contrib/libarchive/libarchive/archive_read_support_format_warc.c Wed Dec 16 22:25:40 2020 (r368708) @@ -337,6 +337,14 @@ start_over: mtime = rtime; } break; + case WT_NONE: + case WT_INFO: + case WT_META: + case WT_REQ: + case WT_RVIS: + case WT_CONV: + case WT_CONT: + case LAST_WT: default: fnam.len = 0U; fnam.str = NULL; @@ -361,6 +369,14 @@ start_over: break; } /* FALLTHROUGH */ + case WT_NONE: + case WT_INFO: + case WT_META: + case WT_REQ: + case WT_RVIS: + case WT_CONV: + case WT_CONT: + case LAST_WT: default: /* consume the content and start over */ _warc_skip(a); Modified: stable/10/contrib/libarchive/libarchive/archive_read_support_format_zip.c ============================================================================== --- stable/10/contrib/libarchive/libarchive/archive_read_support_format_zip.c Wed Dec 16 22:25:20 2020 (r368707) +++ stable/10/contrib/libarchive/libarchive/archive_read_support_format_zip.c Wed Dec 16 22:25:40 2020 (r368708) @@ -900,6 +900,79 @@ process_extra(struct archive_read *a, struct archive_e } /* + * Auxiliary function to uncompress data chunk from zipx archive + * (zip with lzma compression). + */ +static int +zipx_lzma_uncompress_buffer(const char *compressed_buffer, + size_t compressed_buffer_size, + char *uncompressed_buffer, + size_t uncompressed_buffer_size) +{ + int status = ARCHIVE_FATAL; + // length of 'lzma properties data' in lzma compressed + // data segment (stream) inside zip archive + const size_t lzma_params_length = 5; + // offset of 'lzma properties data' from the beginning of lzma stream + const size_t lzma_params_offset = 4; + // end position of 'lzma properties data' in lzma stream + const size_t lzma_params_end = lzma_params_offset + lzma_params_length; + if (compressed_buffer == NULL || + compressed_buffer_size < lzma_params_end || + uncompressed_buffer == NULL) + return status; + + // prepare header for lzma_alone_decoder to replace zipx header + // (see comments in 'zipx_lzma_alone_init' for justification) *** DIFF OUTPUT TRUNCATED AT 1000 LINES *** From owner-svn-src-stable-10@freebsd.org Thu Dec 17 05:24:19 2020 Return-Path: Delivered-To: svn-src-stable-10@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id EB8FF4AB1CC for ; Thu, 17 Dec 2020 05:24:19 +0000 (UTC) (envelope-from bounces+17430347-a243-svn-src-stable-10=freebsd.org@em4842.fdc-k.africa) Received: from pnkfpfkc.outbound-mail.sendgrid.net (pnkfpfkc.outbound-mail.sendgrid.net [50.31.63.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4CxL5b3Mswz4v77 for ; Thu, 17 Dec 2020 05:24:19 +0000 (UTC) (envelope-from bounces+17430347-a243-svn-src-stable-10=freebsd.org@em4842.fdc-k.africa) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fdc-k.africa; h=content-transfer-encoding:content-type:from:mime-version:to:subject:list-unsubscribe; s=s1; bh=2dSWQYel4yGeOADuPKNmrf3J5ed/lUxq9yS7By/XZew=; b=NNx42T8 cf+136/2G3c7EJUbwWvsM73Uea4RjY0PyTVyuiv5LsNElHB+vhyxB5u1Vlv8Z2HF pigLJsAG5R+84bJtz04DRNw5w7jJG4QBPzxTA6WQHclFZ/EcStIVcOhei1dofMom iNq/j10eVSG/hw4bgLYEjlrMNg5SMfUHjENw= Received: by filter2142p1las1.sendgrid.net with SMTP id filter2142p1las1-9889-5FDADFE6-1 2020-12-17 04:34:47.005234573 +0000 UTC m=+3168.656928624 Received: from MTc0MzAzNDc (unknown) by ismtpd0003p1sjc2.sendgrid.net (SG) with HTTP id OBygwgnbQg-qhyO6V0qP_w Thu, 17 Dec 2020 04:34:45.848 +0000 (UTC) Date: Thu, 17 Dec 2020 04:35:07 +0000 (UTC) From: "FDC Training" To: svn-src-stable-10@freebsd.org Message-ID: Subject: Invitation to GIS for Monitoring and Evaluation training JAN 2021 X-SG-EID: SVZPjFakM9SZqXbGnfFMekebc5RmO9NLdsSZAHDzhysWszP9hbN4nbQJyH3vmKiSv//Ovgy9XK7SjE SM9reeyNGDQ2SACMFH8PV97ywhwWZFVhcfUQu6YeDf0Q6iQISSZbq5M2Is26PVjLN+7blnHjSp0hGn Y3UH3pvCF33u99/7Xs2OchBK22Yya7cFGxPLBTK66EFMrz/nL/qH3csHfjhwoaokM+zgIi7nUwmMyf YkivuRiJxvXgVsvk0mWCkk X-Entity-ID: lgZohGoWIjvYsKzlUpYsxA== X-Rspamd-Queue-Id: 4CxL5b3Mswz4v77 X-Spamd-Bar: ++++++ Authentication-Results: mx1.freebsd.org; dkim=pass header.d=fdc-k.africa header.s=s1 header.b=NNx42T8 ; dmarc=pass (policy=none) header.from=fdc-k.africa; spf=pass (mx1.freebsd.org: domain of bounces@em4842.fdc-k.africa designates 50.31.63.28 as permitted sender) smtp.mailfrom=bounces@em4842.fdc-k.africa X-Spamd-Result: default: False [6.05 / 15.00]; R_SPF_ALLOW(0.00)[+ip4:50.31.32.0/19:c]; MV_CASE(0.50)[]; TO_DN_NONE(0.00)[]; DKIM_TRACE(0.00)[fdc-k.africa:+]; DMARC_POLICY_ALLOW(0.00)[fdc-k.africa,none]; FORGED_SENDER(0.30)[training@fdc-k.africa,bounces@em4842.fdc-k.africa]; RCVD_TLS_LAST(0.00)[]; RBL_DBL_DONT_QUERY_IPS(0.00)[50.31.63.28:from]; ASN(0.00)[asn:11377, ipnet:50.31.48.0/20, country:US]; MIME_TRACE(0.00)[0:~]; TAGGED_FROM(0.00)[17430347-a243-svn-src-stable-10=freebsd.org]; ARC_NA(0.00)[]; R_DKIM_ALLOW(0.00)[fdc-k.africa:s=s1]; FROM_NEQ_ENVFROM(0.00)[training@fdc-k.africa,bounces@em4842.fdc-k.africa]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_SPAM_SHORT(0.97)[0.971]; HAS_LIST_UNSUB(-0.01)[]; RCPT_COUNT_ONE(0.00)[1]; SPAMHAUS_ZRD(0.00)[50.31.63.28:from:127.0.2.255]; NEURAL_SPAM_MEDIUM(0.99)[0.990]; BAD_REP_POLICIES(0.10)[]; NEURAL_SPAM_LONG(1.00)[1.000]; MIME_HTML_ONLY(0.20)[]; RWL_MAILSPIKE_POSSIBLE(0.00)[50.31.63.28:from]; RBL_SENDERSCORE(2.00)[50.31.63.28:from]; RCVD_COUNT_TWO(0.00)[2]; MAILMAN_DEST(0.00)[svn-src-stable-10] X-Spam: Yes MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: svn-src-stable-10@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for only the 10-stable src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Dec 2020 05:24:20 -0000