libarchive-2.8.2:
- Fix NULL deference for short self-extracting zip archives - Don't dereference symlinks on Linux when reading ACLs - Better detection of SHA2 support for old OpenSSL versions - Fix parsing of input files for bsdtar -T - Do not leak setup_xattr into the global namespace - Fix build when an older libarchive is already installed - Use O_BINARY opening files in bsdtar - Include missing archive_crc32.h - Correctly include iconv.h required by libxml2
This commit is contained in:
parent
89bf6ebb9f
commit
11cd5c56c4
13
external/bsd/libarchive/dist/NEWS
vendored
13
external/bsd/libarchive/dist/NEWS
vendored
@ -1,3 +1,16 @@
|
||||
Mar 14, 2010: libarchive 2.8.2 released
|
||||
Mar 12, 2010: Fix NULL deference for short self-extracting zip archives.
|
||||
Mar 12, 2010: Don't dereference symlinks on Linux when reading ACLs.
|
||||
Mar 07, 2010: Better detction of SHA2 support for old OpenSSL versions.
|
||||
Mar 07, 2010: Fix parsing of input files for bsdtar -T.
|
||||
Mar 07, 2010: Do not leak setup_xattr into the global namespace.
|
||||
|
||||
Mar 06, 2010: libarchive 2.8.1 released
|
||||
Mar 06, 2010: Fix build when an older libarchive is already installed
|
||||
Mar 03, 2010: Use O_BINARY opening files in bsdtar
|
||||
Mar 02, 2010: Include missing archive_crc32.h
|
||||
Mar 01, 2010: Correctly include iconv.h required by libxml2.
|
||||
|
||||
Feb 04, 2010: libarchive 2.8.0 released
|
||||
Jan 17, 2010: Fix error handling for 'echo nonexistent | cpio -o'
|
||||
Jan 17, 2010: Don't use futimes() on Cygwin
|
||||
|
@ -129,13 +129,13 @@ extern "C" {
|
||||
* (ARCHIVE_API_VERSION * 1000000 + ARCHIVE_API_FEATURE * 1000)
|
||||
* #endif
|
||||
*/
|
||||
#define ARCHIVE_VERSION_NUMBER 2008000
|
||||
#define ARCHIVE_VERSION_NUMBER 2008002
|
||||
__LA_DECL int archive_version_number(void);
|
||||
|
||||
/*
|
||||
* Textual name/version of the library, useful for version displays.
|
||||
*/
|
||||
#define ARCHIVE_VERSION_STRING "libarchive 2.8.0"
|
||||
#define ARCHIVE_VERSION_STRING "libarchive 2.8.2"
|
||||
__LA_DECL const char * archive_version_string(void);
|
||||
|
||||
#if ARCHIVE_VERSION_NUMBER < 3000000
|
||||
|
66
external/bsd/libarchive/dist/libarchive/archive_crc32.h
vendored
Normal file
66
external/bsd/libarchive/dist/libarchive/archive_crc32.h
vendored
Normal file
@ -0,0 +1,66 @@
|
||||
/*-
|
||||
* Copyright (c) 2009 Joerg Sonnenberger
|
||||
* 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.
|
||||
*
|
||||
* $FreeBSD: head/lib/libarchive/archive_crc32.h 201102 2009-12-28 03:11:36Z kientzle $
|
||||
*/
|
||||
|
||||
#ifndef __LIBARCHIVE_BUILD
|
||||
#error This header is only to be used internally to libarchive.
|
||||
#endif
|
||||
|
||||
/*
|
||||
* When zlib is unavailable, we should still be able to validate
|
||||
* uncompressed zip archives. That requires us to be able to compute
|
||||
* the CRC32 check value. This is a drop-in compatible replacement
|
||||
* for crc32() from zlib. It's slower than the zlib implementation,
|
||||
* but still pretty fast: This runs about 300MB/s on my 3GHz P4
|
||||
* compared to about 800MB/s for the zlib implementation.
|
||||
*/
|
||||
static unsigned long
|
||||
crc32(unsigned long crc, const void *_p, size_t len)
|
||||
{
|
||||
unsigned long crc2, b, i;
|
||||
const unsigned char *p = _p;
|
||||
static volatile int crc_tbl_inited = 0;
|
||||
static unsigned long crc_tbl[256];
|
||||
|
||||
if (!crc_tbl_inited) {
|
||||
for (b = 0; b < 256; ++b) {
|
||||
crc2 = b;
|
||||
for (i = 8; i > 0; --i) {
|
||||
if (crc2 & 1)
|
||||
crc2 = (crc2 >> 1) ^ 0xedb88320UL;
|
||||
else
|
||||
crc2 = (crc2 >> 1);
|
||||
}
|
||||
crc_tbl[b] = crc2;
|
||||
}
|
||||
crc_tbl_inited = 1;
|
||||
}
|
||||
|
||||
crc = crc ^ 0xffffffffUL;
|
||||
while (len--)
|
||||
crc = crc_tbl[(crc ^ *p++) & 0xff] ^ (crc >> 8);
|
||||
return (crc ^ 0xffffffffUL);
|
||||
}
|
@ -210,7 +210,7 @@ archive_read_format_zip_bid(struct archive_read *a)
|
||||
/* Get 4k of data beyond where we stopped. */
|
||||
buff = __archive_read_ahead(a, offset + 4096,
|
||||
&bytes_avail);
|
||||
if (bytes_avail < offset + 1)
|
||||
if (buff == NULL)
|
||||
break;
|
||||
p = (const char *)buff + offset;
|
||||
while (p + 9 < (const char *)buff + bytes_avail) {
|
||||
|
@ -89,7 +89,7 @@ lafe_exclude_from_file(struct lafe_matching **matching, const char *pathname)
|
||||
const char *p;
|
||||
int ret = 0;
|
||||
|
||||
lr = lafe_line_reader(pathname, '\n');
|
||||
lr = lafe_line_reader(pathname, 0);
|
||||
while ((p = lafe_line_reader_next(lr)) != NULL) {
|
||||
if (lafe_exclude(matching, p) != 0)
|
||||
ret = -1;
|
||||
|
16
external/bsd/libarchive/dist/tar/write.c
vendored
16
external/bsd/libarchive/dist/tar/write.c
vendored
@ -95,6 +95,10 @@ __FBSDID("$FreeBSD: src/usr.bin/tar/write.c,v 1.79 2008/11/27 05:49:52 kientzle
|
||||
/* Fixed size of uname/gname caches. */
|
||||
#define name_cache_size 101
|
||||
|
||||
#ifndef O_BINARY
|
||||
#define O_BINARY 0
|
||||
#endif
|
||||
|
||||
static const char * const NO_NAME = "(noname)";
|
||||
|
||||
struct archive_dir_entry {
|
||||
@ -210,7 +214,7 @@ tar_mode_c(struct bsdtar *bsdtar)
|
||||
r = archive_write_set_compression_xz(a);
|
||||
break;
|
||||
case OPTION_LZMA:
|
||||
archive_write_set_compression_lzma(a);
|
||||
r = archive_write_set_compression_lzma(a);
|
||||
break;
|
||||
case 'z':
|
||||
r = archive_write_set_compression_gzip(a);
|
||||
@ -256,9 +260,9 @@ tar_mode_r(struct bsdtar *bsdtar)
|
||||
format = ARCHIVE_FORMAT_TAR_PAX_RESTRICTED;
|
||||
|
||||
#if defined(__BORLANDC__)
|
||||
bsdtar->fd = open(bsdtar->filename, O_RDWR | O_CREAT);
|
||||
bsdtar->fd = open(bsdtar->filename, O_RDWR | O_CREAT | O_BINARY);
|
||||
#else
|
||||
bsdtar->fd = open(bsdtar->filename, O_RDWR | O_CREAT, 0666);
|
||||
bsdtar->fd = open(bsdtar->filename, O_RDWR | O_CREAT | O_BINARY, 0666);
|
||||
#endif
|
||||
if (bsdtar->fd < 0)
|
||||
lafe_errc(1, errno,
|
||||
@ -353,7 +357,7 @@ tar_mode_u(struct bsdtar *bsdtar)
|
||||
/* Sanity-test some arguments and the file. */
|
||||
test_for_append(bsdtar);
|
||||
|
||||
bsdtar->fd = open(bsdtar->filename, O_RDWR);
|
||||
bsdtar->fd = open(bsdtar->filename, O_RDWR | O_BINARY);
|
||||
if (bsdtar->fd < 0)
|
||||
lafe_errc(1, errno,
|
||||
"Cannot open %s", bsdtar->filename);
|
||||
@ -843,7 +847,7 @@ write_hierarchy(struct bsdtar *bsdtar, struct archive *a, const char *path)
|
||||
#if defined(EXT2_IOC_GETFLAGS) && defined(EXT2_NODUMP_FL)
|
||||
/* Linux uses ioctl to read flags. */
|
||||
if (bsdtar->option_honor_nodump) {
|
||||
int fd = open(name, O_RDONLY | O_NONBLOCK);
|
||||
int fd = open(name, O_RDONLY | O_NONBLOCK | O_BINARY);
|
||||
if (fd >= 0) {
|
||||
unsigned long fflags;
|
||||
int r = ioctl(fd, EXT2_IOC_GETFLAGS, &fflags);
|
||||
@ -913,7 +917,7 @@ write_entry_backend(struct bsdtar *bsdtar, struct archive *a,
|
||||
|
||||
if (archive_entry_size(entry) > 0) {
|
||||
const char *pathname = archive_entry_sourcepath(entry);
|
||||
fd = open(pathname, O_RDONLY);
|
||||
fd = open(pathname, O_RDONLY | O_BINARY);
|
||||
if (fd == -1) {
|
||||
if (!bsdtar->verbose)
|
||||
lafe_warnc(errno,
|
||||
|
Loading…
Reference in New Issue
Block a user