pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/archivers/libarchive/files Import libarchive 3.4.0
details: https://anonhg.NetBSD.org/pkgsrc/rev/0f86ceedef98
branches: trunk
changeset: 401677:0f86ceedef98
user: joerg <joerg%pkgsrc.org@localhost>
date: Sun Sep 22 09:51:28 2019 +0000
description:
Import libarchive 3.4.0
diffstat:
archivers/libarchive/files/build/autoconf/test-driver | 10 +-
archivers/libarchive/files/contrib/archivetest.c | 218 +
archivers/libarchive/files/contrib/shar/tree.c | 3 +-
archivers/libarchive/files/cpio/test/test_option_L_upper.c | 14 +-
archivers/libarchive/files/doc/html/archive_entry_misc.3.html | 91 +
archivers/libarchive/files/doc/man/archive_entry_misc.3 | 48 +
archivers/libarchive/files/doc/pdf/archive_entry_misc.3.pdf | Bin
archivers/libarchive/files/doc/text/archive_entry_misc.3.txt | 36 +
archivers/libarchive/files/doc/wiki/ManPageArchiveEntryMisc3.wiki | 40 +
archivers/libarchive/files/doc/wiki/ManPageArchiveReadAddPassphrase3.wiki | 6 +-
archivers/libarchive/files/doc/wiki/ManPageArchiveWriteSetPassphrase3.wiki | 6 +-
archivers/libarchive/files/libarchive/archive_blake2.h | 194 +
archivers/libarchive/files/libarchive/archive_blake2_impl.h | 160 +
archivers/libarchive/files/libarchive/archive_blake2s_ref.c | 367 +
archivers/libarchive/files/libarchive/archive_blake2sp_ref.c | 359 +
archivers/libarchive/files/libarchive/archive_disk_acl_sunos.c | 6 +-
archivers/libarchive/files/libarchive/archive_entry_misc.3 | 62 +
archivers/libarchive/files/libarchive/archive_hmac.c | 1 +
archivers/libarchive/files/libarchive/archive_ppmd8.c | 1287 +++
archivers/libarchive/files/libarchive/archive_ppmd8_private.h | 148 +
archivers/libarchive/files/libarchive/archive_read_set_format.c | 3 +
archivers/libarchive/files/libarchive/archive_read_support_filter_gzip.c | 52 +-
archivers/libarchive/files/libarchive/archive_read_support_format_by_code.c | 3 +
archivers/libarchive/files/libarchive/archive_read_support_format_rar5.c | 4030 ++++++++++
archivers/libarchive/files/libarchive/archive_write_add_filter_b64encode.c | 10 +-
archivers/libarchive/files/libarchive/test/test_read_format_mtree_noprint.mtree.uu | 4 +
archivers/libarchive/files/libarchive/test/test_read_format_rar5.c | 1196 ++
archivers/libarchive/files/libarchive/test/test_read_format_rar5_arm.rar.uu | 916 ++
archivers/libarchive/files/libarchive/test/test_read_format_rar5_blake2.rar.uu | 18 +
archivers/libarchive/files/libarchive/test/test_read_format_rar5_compressed.rar.uu | 13 +
archivers/libarchive/files/libarchive/test/test_read_format_rar5_distance_overflow.rar.uu | 9 +
archivers/libarchive/files/libarchive/test/test_read_format_rar5_extra_field_version.rar.uu | 10 +
archivers/libarchive/files/libarchive/test/test_read_format_rar5_fileattr.rar.uu | 13 +
archivers/libarchive/files/libarchive/test/test_read_format_rar5_hardlink.rar.uu | 6 +
archivers/libarchive/files/libarchive/test/test_read_format_rar5_invalid_dict_reference.rar.uu | 9 +
archivers/libarchive/files/libarchive/test/test_read_format_rar5_leftshift1.rar.uu | 9 +
archivers/libarchive/files/libarchive/test/test_read_format_rar5_leftshift2.rar.uu | 6 +
archivers/libarchive/files/libarchive/test/test_read_format_rar5_multiarchive.part01.rar.uu | 345 +
archivers/libarchive/files/libarchive/test/test_read_format_rar5_multiarchive.part02.rar.uu | 345 +
archivers/libarchive/files/libarchive/test/test_read_format_rar5_multiarchive.part03.rar.uu | 345 +
archivers/libarchive/files/libarchive/test/test_read_format_rar5_multiarchive.part04.rar.uu | 345 +
archivers/libarchive/files/libarchive/test/test_read_format_rar5_multiarchive.part05.rar.uu | 345 +
archivers/libarchive/files/libarchive/test/test_read_format_rar5_multiarchive.part06.rar.uu | 345 +
archivers/libarchive/files/libarchive/test/test_read_format_rar5_multiarchive.part07.rar.uu | 345 +
archivers/libarchive/files/libarchive/test/test_read_format_rar5_multiarchive.part08.rar.uu | 208 +
archivers/libarchive/files/libarchive/test/test_read_format_rar5_multiarchive_solid.part01.rar.uu | 299 +
archivers/libarchive/files/libarchive/test/test_read_format_rar5_multiarchive_solid.part02.rar.uu | 299 +
archivers/libarchive/files/libarchive/test/test_read_format_rar5_multiarchive_solid.part03.rar.uu | 299 +
archivers/libarchive/files/libarchive/test/test_read_format_rar5_multiarchive_solid.part04.rar.uu | 76 +
archivers/libarchive/files/libarchive/test/test_read_format_rar5_multiple_files.rar.uu | 40 +
archivers/libarchive/files/libarchive/test/test_read_format_rar5_multiple_files_solid.rar.uu | 19 +
archivers/libarchive/files/libarchive/test/test_read_format_rar5_nonempty_dir_stream.rar.uu | 9 +
archivers/libarchive/files/libarchive/test/test_read_format_rar5_owner.rar.uu | 8 +
archivers/libarchive/files/libarchive/test/test_read_format_rar5_readtables_overflow.rar.uu | 15 +
archivers/libarchive/files/libarchive/test/test_read_format_rar5_solid.rar.uu | 27 +
archivers/libarchive/files/libarchive/test/test_read_format_rar5_stored.rar.uu | 6 +
archivers/libarchive/files/libarchive/test/test_read_format_rar5_stored_manyfiles.rar.uu | 61 +
archivers/libarchive/files/libarchive/test/test_read_format_rar5_symlink.rar.uu | 8 +
archivers/libarchive/files/libarchive/test/test_read_format_rar5_truncated_huff.rar.uu | 7 +
archivers/libarchive/files/libarchive/test/test_read_format_rar5_win32.rar.uu | 69 +
archivers/libarchive/files/libarchive/test/test_read_format_rar_ppmd_use_after_free.rar.uu | 10 +
archivers/libarchive/files/libarchive/test/test_read_format_raw.data.gz.uu | 4 +
archivers/libarchive/files/libarchive/test/test_read_format_tar_empty_with_gnulabel.c | 53 +
archivers/libarchive/files/libarchive/test/test_read_format_tar_empty_with_gnulabel.tar.uu | 231 +
archivers/libarchive/files/libarchive/test/test_read_format_zip_7075_utf8_paths.c | 102 +
archivers/libarchive/files/libarchive/test/test_read_format_zip_7075_utf8_paths.zip.uu | 20 +
archivers/libarchive/files/libarchive/test/test_read_format_zip_bz2_hang.zip.uu | 5 +
archivers/libarchive/files/libarchive/test/test_read_format_zip_bzip2.zipx.uu | 19 +
archivers/libarchive/files/libarchive/test/test_read_format_zip_bzip2_multi.zipx.uu | 96 +
archivers/libarchive/files/libarchive/test/test_read_format_zip_extra_padding.c | 93 +
archivers/libarchive/files/libarchive/test/test_read_format_zip_extra_padding.zip.uu | 7 +
archivers/libarchive/files/libarchive/test/test_read_format_zip_lzma.zipx.uu | 19 +
archivers/libarchive/files/libarchive/test/test_read_format_zip_lzma_alone_leak.zipx.uu | 5 +
archivers/libarchive/files/libarchive/test/test_read_format_zip_lzma_multi.zipx.uu | 95 +
archivers/libarchive/files/libarchive/test/test_read_format_zip_ppmd8.zipx.uu | 17 +
archivers/libarchive/files/libarchive/test/test_read_format_zip_ppmd8_crash_1.zipx.uu | 4 +
archivers/libarchive/files/libarchive/test/test_read_format_zip_ppmd8_crash_2.zipx.uu | 4 +
archivers/libarchive/files/libarchive/test/test_read_format_zip_ppmd8_multi.zipx.uu | 84 +
archivers/libarchive/files/libarchive/test/test_read_format_zip_xz_multi.zipx.uu | 125 +
archivers/libarchive/files/tar/test/test_option_C_mtree.c | 18 +-
archivers/libarchive/files/tar/test/test_option_exclude_vcs.c | 230 +
81 files changed, 14436 insertions(+), 33 deletions(-)
diffs (truncated from 15037 to 300 lines):
diff -r ed50fe76fd64 -r 0f86ceedef98 archivers/libarchive/files/build/autoconf/test-driver
--- a/archivers/libarchive/files/build/autoconf/test-driver Sun Sep 22 09:50:54 2019 +0000
+++ b/archivers/libarchive/files/build/autoconf/test-driver Sun Sep 22 09:51:28 2019 +0000
@@ -1,9 +1,9 @@
#! /bin/sh
# test-driver - basic testsuite driver script.
-scriptversion=2013-07-13.22; # UTC
+scriptversion=2018-03-07.03; # UTC
-# Copyright (C) 2011-2014 Free Software Foundation, Inc.
+# Copyright (C) 2011-2018 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -16,7 +16,7 @@
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
+# along with this program. If not, see <https://www.gnu.org/licenses/>.
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
@@ -140,9 +140,9 @@
# Local Variables:
# mode: shell-script
# sh-indentation: 2
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
+# time-stamp-time-zone: "UTC0"
# time-stamp-end: "; # UTC"
# End:
diff -r ed50fe76fd64 -r 0f86ceedef98 archivers/libarchive/files/contrib/archivetest.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/archivers/libarchive/files/contrib/archivetest.c Sun Sep 22 09:51:28 2019 +0000
@@ -0,0 +1,218 @@
+/*-
+ * Copyright (c) 2019 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.
+ */
+
+/*
+ * Archivetest verifies reading archives with libarchive
+ *
+ * It may be used to reproduce failures in testcases discovered by OSS-Fuzz
+ * https://github.com/google/oss-fuzz/blob/master/projects/libarchive
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <stdarg.h>
+#include <ctype.h>
+#include <archive.h>
+#include <archive_entry.h>
+
+const char *errnostr(int errno)
+{
+ char *estr;
+ switch(errno) {
+ case ARCHIVE_EOF:
+ estr = "ARCHIVE_EOF";
+ break;
+ case ARCHIVE_OK:
+ estr = "ARCHIVE_OK";
+ break;
+ case ARCHIVE_WARN:
+ estr = "ARCHIVE_WARN";
+ break;
+ case ARCHIVE_RETRY:
+ estr = "ARCHIVE_RETRY";
+ break;
+ case ARCHIVE_FAILED:
+ estr = "ARCHIVE_FAILED";
+ break;
+ case ARCHIVE_FATAL:
+ estr = "ARCHIVE_FATAL";
+ break;
+ default:
+ estr = "Unknown";
+ break;
+ }
+ return (estr);
+}
+
+void usage(const char *prog)
+{
+ fprintf(stderr, "Usage: %s [-f filename] [-h] [-q] [-s]\n", prog);
+}
+
+void printhelp()
+{
+ fprintf(stdout, "archivetest: verify reading archives with "
+ "libarchive\n\n"
+ "Options:\n"
+ " -f filename Filename to verify\n"
+ " -h Show this help\n"
+ " -q Quiet mode\n"
+ " -s Verify only headers (skip data)\n\n"
+ "If no filename is specified, data is read from standard input.\n"
+ "\n%s\n", archive_version_details());
+}
+
+int v_print(int verbose, const char *format, ...)
+{
+ int r = 0;
+
+ if (verbose) {
+ va_list args;
+
+ va_start(args, format);
+ r = vfprintf(stdout, format, args);
+ va_end(args);
+ }
+ return (r);
+}
+
+int main(int argc, char *argv[])
+{
+ struct archive *a;
+ struct archive_entry *entry;
+ char *filename;
+ const char *p;
+ char buffer[4096];
+ int c;
+ int v, skip_data;
+ int r = ARCHIVE_OK;
+ int format_printed;
+
+ filename = NULL;
+ skip_data = 0;
+ v = 1;
+
+ while ((c = getopt (argc, argv, "f:hqs")) != -1) {
+ switch (c) {
+ case 'f':
+ filename = optarg;
+ break;
+ case 'h':
+ printhelp();
+ exit(0);
+ case 'q':
+ v = 0;
+ break;
+ case 's':
+ skip_data = 1;
+ break;
+ case '?':
+ if (optopt == 'f')
+ fprintf(stderr, "Option -%c requires "
+ "an argument.\n", optopt);
+ else if (isprint(optopt))
+ fprintf(stderr, "Unknown option '-%c'"
+ ".\n", optopt);
+ else
+ fprintf(stderr, "Unknown option "
+ "character '\\x%x'.\n", optopt);
+ usage(argv[0]);
+ default:
+ exit(1);
+ }
+ }
+
+ a = archive_read_new();
+
+ archive_read_support_filter_all(a);
+ archive_read_support_format_all(a);
+
+ v_print(v, "Data source: ");
+
+ if (filename == NULL) {
+ v_print(v, "standard input\n");
+ r = archive_read_open_fd(a, STDIN_FILENO, 4096);
+ } else {
+ v_print(v, "filename: %s\n", filename);
+ r = archive_read_open_filename(a, filename, 4096);
+ }
+
+ if (r != ARCHIVE_OK) {
+ archive_read_free(a);
+ fprintf(stderr, "Invalid or unsupported data source\n");
+ exit(1);
+ }
+
+ format_printed = 0;
+ c = 1;
+
+ while (1) {
+ r = archive_read_next_header(a, &entry);
+ if (r == ARCHIVE_FATAL) {
+ v_print(v, "Entry %d: fatal error reading "
+ "header\n", c);
+ break;
+ }
+ if (!format_printed) {
+ v_print(v, "Filter: %s\nFormat: %s\n",
+ archive_filter_name(a, 0), archive_format_name(a));
+ format_printed = 1;
+ }
+ if (r == ARCHIVE_RETRY)
+ continue;
+ if (r == ARCHIVE_EOF)
+ break;
+ p = archive_entry_pathname(entry);
+ v_print(v, "Entry %d: %s, pathname", c, errnostr(r));
+ if (p == NULL || p[0] == '\0')
+ v_print(v, " unreadable");
+ else
+ v_print(v, ": %s", p);
+ v_print(v, ", data: ");
+ if (skip_data) {
+ v_print(v, "skipping");
+ } else {
+ while ((r = archive_read_data(a, buffer, 4096) > 0))
+ ;
+ if (r == ARCHIVE_FATAL) {
+ v_print(v, "ERROR\nError string: %s\n",
+ archive_error_string(a));
+ break;
+ }
+ v_print(v, "OK");
+ }
+ v_print(v, "\n");
+ c++;
+ }
+
+ v_print(v, "Last return code: %s (%d)\n", errnostr(r), r);
+ if (r == ARCHIVE_EOF || r == ARCHIVE_OK) {
+ archive_read_free(a);
+ exit(0);
+ }
+ v_print(v, "Error string: %s\n", archive_error_string(a));
+ archive_read_free(a);
+ exit(2);
+}
diff -r ed50fe76fd64 -r 0f86ceedef98 archivers/libarchive/files/contrib/shar/tree.c
--- a/archivers/libarchive/files/contrib/shar/tree.c Sun Sep 22 09:50:54 2019 +0000
+++ b/archivers/libarchive/files/contrib/shar/tree.c Sun Sep 22 09:51:28 2019 +0000
@@ -530,8 +530,7 @@
/* Release anything remaining in the stack. */
while (t->stack != NULL)
tree_pop(t);
- if (t->buff)
- free(t->buff);
+ free(t->buff);
/* chdir() back to where we started. */
if (t->initialDirFd >= 0) {
fchdir(t->initialDirFd);
diff -r ed50fe76fd64 -r 0f86ceedef98 archivers/libarchive/files/cpio/test/test_option_L_upper.c
--- a/archivers/libarchive/files/cpio/test/test_option_L_upper.c Sun Sep 22 09:50:54 2019 +0000
+++ b/archivers/libarchive/files/cpio/test/test_option_L_upper.c Sun Sep 22 09:51:28 2019 +0000
@@ -30,8 +30,10 @@
* tests won't run on Windows. */
#if defined(_WIN32) && !defined(__CYGWIN__)
#define CAT "type"
+#define SEP "\\"
#else
#define CAT "cat"
+#define SEP "/"
#endif
DEFINE_TEST(test_option_L_upper)
@@ -51,7 +53,7 @@
fprintf(filelist, "file\n");
/* Symlink to above file. */
- assertMakeSymlink("symlink", "file");
+ assertMakeSymlink("symlink", "file", 0);
fprintf(filelist, "symlink\n");
fclose(filelist);
@@ -61,7 +63,7 @@
assertTextFileContents("1 block\n", "copy.err");
failure("Regular -p without -L should preserve symlinks.");
- assertIsSymlink("copy/symlink", NULL);
+ assertIsSymlink("copy/symlink", NULL, 0);
Home |
Main Index |
Thread Index |
Old Index