aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Matuska <mm@FreeBSD.org>2016-06-21 15:18:22 +0000
committerMartin Matuska <mm@FreeBSD.org>2016-06-21 15:18:22 +0000
commita34769f8e41e568b958c47a99a6d363c097f0073 (patch)
tree5275a0c082e51ee8780f6a4daefb587eb4e6bd69
parent3786dd4a5cb7fea782850bc62a452d8b2b98b8e7 (diff)
downloadsrc-a34769f8e41e568b958c47a99a6d363c097f0073.tar.gz
src-a34769f8e41e568b958c47a99a6d363c097f0073.zip
Update vendor/libarchive to git f502a81fcd7c331204bf53cc40cbf966ebb28a42
Notes
Notes: svn path=/vendor/libarchive/dist/; revision=302056
-rw-r--r--configure.ac2
-rw-r--r--cpio/cpio.c2
-rw-r--r--cpio/test/test_option_version.c4
-rw-r--r--libarchive/archive_read_support_format_lha.c1
-rw-r--r--libarchive/archive_read_support_format_warc.c20
-rw-r--r--libarchive_fe/passphrase.c29
6 files changed, 36 insertions, 22 deletions
diff --git a/configure.ac b/configure.ac
index e15ceee1e5ff..64775fa63829 100644
--- a/configure.ac
+++ b/configure.ac
@@ -27,6 +27,7 @@ AC_CONFIG_AUX_DIR([build/autoconf])
AC_CONFIG_MACRO_DIR([build/autoconf])
# Must follow AC_CONFIG macros above...
AM_INIT_AUTOMAKE()
+AM_MAINTAINER_MODE([enable])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
# Libtool's "interface version" can be computed from the libarchive version.
@@ -845,6 +846,7 @@ if test "x$with_openssl" != "xno"; then
else
AC_CHECK_FUNCS([PKCS5_PBKDF2_HMAC_SHA1])
fi
+ AC_CHECK_LIB(crypto,EVP_CIPHER_CTX_init)
fi
# Probe libmd AFTER OpenSSL/libcrypto.
diff --git a/cpio/cpio.c b/cpio/cpio.c
index 4b69893b4579..c11ac163122d 100644
--- a/cpio/cpio.c
+++ b/cpio/cpio.c
@@ -498,7 +498,7 @@ long_help(void)
static void
version(void)
{
- fprintf(stdout,"bsdcpio %s -- %s\n",
+ fprintf(stdout,"bsdcpio %s - %s\n",
BSDCPIO_VERSION_STRING,
archive_version_details());
exit(0);
diff --git a/cpio/test/test_option_version.c b/cpio/test/test_option_version.c
index 2f2c40901700..32ba3000477e 100644
--- a/cpio/test/test_option_version.c
+++ b/cpio/test/test_option_version.c
@@ -59,8 +59,8 @@ verify(const char *p, size_t s)
++q; --s;
/* Separator. */
failure("Version: %s", p);
- assertEqualMem(q, "-- ", 3);
- q += 3; s -= 3;
+ assertEqualMem(q, "- ", 2);
+ q += 2; s -= 2;
/* libarchive name and version number */
assert(s > 11);
failure("Version: %s", p);
diff --git a/libarchive/archive_read_support_format_lha.c b/libarchive/archive_read_support_format_lha.c
index c359d83ef97a..dbfc1cd87c86 100644
--- a/libarchive/archive_read_support_format_lha.c
+++ b/libarchive/archive_read_support_format_lha.c
@@ -1712,6 +1712,7 @@ lha_crc16(uint16_t crc, const void *pp, size_t len)
for (;len >= 8; len -= 8) {
/* This if statement expects compiler optimization will
* remove the stament which will not be executed. */
+#undef bswap16
#if defined(_MSC_VER) && _MSC_VER >= 1400 /* Visual Studio */
# define bswap16(x) _byteswap_ushort(x)
#elif (defined(__GNUC__) && __GNUC__ >= 4 && __GNUC_MINOR__ >= 8) \
diff --git a/libarchive/archive_read_support_format_warc.c b/libarchive/archive_read_support_format_warc.c
index 46a59ea14ba8..9d8013287568 100644
--- a/libarchive/archive_read_support_format_warc.c
+++ b/libarchive/archive_read_support_format_warc.c
@@ -535,7 +535,8 @@ xstrpisotime(const char *s, char **endptr)
/* as a courtesy to our callers, and since this is a non-standard
* routine, we skip leading whitespace */
- for (; isspace(*s); s++);
+ while (isspace((unsigned char)*s))
+ ++s;
/* read year */
if ((tm.tm_year = strtoi_lim(s, &s, 1583, 4095)) < 0 || *s++ != '-') {
@@ -639,7 +640,9 @@ _warc_rdtyp(const char *buf, size_t bsz)
return WT_NONE;
}
/* overread whitespace */
- for (val += sizeof(_key) - 1U; val < eob && isspace(*val); val++);
+ val += sizeof(_key) - 1U;
+ while (val < eob && isspace((unsigned char)*val))
+ ++val;
if (val + 8U > eob) {
;
@@ -676,7 +679,9 @@ _warc_rduri(const char *buf, size_t bsz)
return res;
}
/* overread whitespace */
- for (val += sizeof(_key) - 1U; val < eob && isspace(*val); val++);
+ val += sizeof(_key) - 1U;
+ while (val < eob && isspace((unsigned char)*val))
+ ++val;
/* overread URL designators */
if ((uri = xmemmem(val, eob - val, "://", 3U)) == NULL) {
@@ -692,7 +697,8 @@ _warc_rduri(const char *buf, size_t bsz)
/* also massage eol to point to the first whitespace
* after the last non-whitespace character before
* the end of the line */
- for (; eol > uri && isspace(eol[-1]); eol--);
+ while (eol > uri && isspace((unsigned char)eol[-1]))
+ --eol;
/* now then, inspect the URI */
if (memcmp(val, "file", 4U) == 0) {
@@ -727,7 +733,7 @@ _warc_rdlen(const char *buf, size_t bsz)
/* strtol kindly overreads whitespace for us, so use that */
val += sizeof(_key) - 1U;
len = strtol(val, &on, 10);
- if (on == NULL || !isspace(*on)) {
+ if (on == NULL || !isspace((unsigned char)*on)) {
/* hm, can we trust that number? Best not. */
return -1;
}
@@ -750,7 +756,7 @@ _warc_rdrtm(const char *buf, size_t bsz)
/* xstrpisotime() kindly overreads whitespace for us, so use that */
val += sizeof(_key) - 1U;
res = xstrpisotime(val, &on);
- if (on == NULL || !isspace(*on)) {
+ if (on == NULL || !isspace((unsigned char)*on)) {
/* hm, can we trust that number? Best not. */
return (time_t)-1;
}
@@ -773,7 +779,7 @@ _warc_rdmtm(const char *buf, size_t bsz)
/* xstrpisotime() kindly overreads whitespace for us, so use that */
val += sizeof(_key) - 1U;
res = xstrpisotime(val, &on);
- if (on == NULL || !isspace(*on)) {
+ if (on == NULL || !isspace((unsigned char)*on)) {
/* hm, can we trust that number? Best not. */
return (time_t)-1;
}
diff --git a/libarchive_fe/passphrase.c b/libarchive_fe/passphrase.c
index 1eae0b888bcd..3322437588eb 100644
--- a/libarchive_fe/passphrase.c
+++ b/libarchive_fe/passphrase.c
@@ -121,14 +121,15 @@ readpassphrase(const char *prompt, char *buf, size_t bufsiz, int flags)
#else /* _WIN32 && !__CYGWIN__ */
-#include <termios.h>
-#include <signal.h>
+#include <assert.h>
#include <ctype.h>
#include <fcntl.h>
#ifdef HAVE_PATHS_H
#include <paths.h>
#endif
+#include <signal.h>
#include <string.h>
+#include <termios.h>
#include <unistd.h>
#ifdef TCSASOFT
@@ -142,11 +143,18 @@ readpassphrase(const char *prompt, char *buf, size_t bufsiz, int flags)
# define _POSIX_VDISABLE VDISABLE
#endif
-static volatile sig_atomic_t *signo;
+#define M(a,b) (a > b ? a : b)
+#define MAX_SIGNO M(M(M(SIGALRM, SIGHUP), \
+ M(SIGINT, SIGPIPE)), \
+ M(M(SIGQUIT, SIGTERM), \
+ M(M(SIGTSTP, SIGTTIN), SIGTTOU)))
+
+static volatile sig_atomic_t signo[MAX_SIGNO + 1];
static void
handler(int s)
{
+ assert(s <= MAX_SIGNO);
signo[s] = 1;
}
@@ -166,12 +174,8 @@ readpassphrase(const char *prompt, char *buf, size_t bufsiz, int flags)
return(NULL);
}
- if (signo == NULL) {
- signo = calloc(SIGRTMAX, sizeof(sig_atomic_t));
- }
-
restart:
- for (i = 0; i < SIGRTMAX; i++)
+ for (i = 0; i <= MAX_SIGNO; i++)
signo[i] = 0;
nr = -1;
save_errno = 0;
@@ -198,6 +202,7 @@ restart:
sigemptyset(&sa.sa_mask);
sa.sa_flags = 0; /* don't restart system calls */
sa.sa_handler = handler;
+ /* Keep this list in sync with MAX_SIGNO! */
(void)sigaction(SIGALRM, &sa, &savealrm);
(void)sigaction(SIGHUP, &sa, &savehup);
(void)sigaction(SIGINT, &sa, &saveint);
@@ -237,11 +242,11 @@ restart:
if (p < end) {
if ((flags & RPP_SEVENBIT))
ch &= 0x7f;
- if (isalpha(ch)) {
+ if (isalpha((unsigned char)ch)) {
if ((flags & RPP_FORCELOWER))
- ch = (char)tolower(ch);
+ ch = (char)tolower((unsigned char)ch);
if ((flags & RPP_FORCEUPPER))
- ch = (char)toupper(ch);
+ ch = (char)toupper((unsigned char)ch);
}
*p++ = ch;
}
@@ -276,7 +281,7 @@ restart:
* If we were interrupted by a signal, resend it to ourselves
* now that we have restored the signal handlers.
*/
- for (i = 0; i < SIGRTMAX; i++) {
+ for (i = 0; i <= MAX_SIGNO; i++) {
if (signo[i]) {
kill(getpid(), i);
switch (i) {