pkgsrc-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[pkgsrc/trunk]: pkgsrc/archivers/libarchive libarchive-3.2.1nb1: Merge a numb...
details: https://anonhg.NetBSD.org/pkgsrc/rev/1c2c2797eb47
branches: trunk
changeset: 348974:1c2c2797eb47
user: joerg <joerg%pkgsrc.org@localhost>
date: Tue Jun 21 13:39:21 2016 +0000
description:
libarchive-3.2.1nb1: Merge a number of bugfixes from upstream
(1) ctype misuse
(2) Don't depend on SIGRTMAX
(3) Link against libcrypto when using it for EVP support
diffstat:
archivers/libarchive/Makefile | 3 +-
archivers/libarchive/files/configure | 53 ++++++++-
archivers/libarchive/files/configure.ac | 8 +-
archivers/libarchive/files/libarchive/archive_read_support_format_lha.c | 1 +
archivers/libarchive/files/libarchive/archive_read_support_format_warc.c | 20 ++-
archivers/libarchive/files/libarchive_fe/passphrase.c | 25 +++-
6 files changed, 83 insertions(+), 27 deletions(-)
diffs (288 lines):
diff -r 75ea509f9213 -r 1c2c2797eb47 archivers/libarchive/Makefile
--- a/archivers/libarchive/Makefile Tue Jun 21 13:23:32 2016 +0000
+++ b/archivers/libarchive/Makefile Tue Jun 21 13:39:21 2016 +0000
@@ -1,7 +1,8 @@
-# $NetBSD: Makefile,v 1.43 2016/06/20 17:28:33 joerg Exp $
+# $NetBSD: Makefile,v 1.44 2016/06/21 13:39:21 joerg Exp $
.include "Makefile.common"
+PKGREVISION= 1
COMMENT= Library to read/create different archive formats
USE_LIBTOOL= yes
diff -r 75ea509f9213 -r 1c2c2797eb47 archivers/libarchive/files/configure
--- a/archivers/libarchive/files/configure Tue Jun 21 13:23:32 2016 +0000
+++ b/archivers/libarchive/files/configure Tue Jun 21 13:39:21 2016 +0000
@@ -14748,9 +14748,6 @@
/* end confdefs.h. */
#include <lzma.h>
- #if LZMA_VERSION < 50020000
- #error unsupported
- #endif
int
main ()
{
@@ -14759,13 +14756,12 @@
return 0;
}
_ACEOF
-if ac_fn_c_try_link "$LINENO"; then :
+if ac_fn_c_try_compile "$LINENO"; then :
ac_cv_lzma_has_mt=yes
else
ac_cv_lzma_has_mt=no
fi
-rm -f core conftest.err conftest.$ac_objext \
- conftest$ac_exeext conftest.$ac_ext
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lzma_has_mt" >&5
$as_echo "$ac_cv_lzma_has_mt" >&6; }
@@ -19483,6 +19479,51 @@
done
fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_CIPHER_CTX_init in -lcrypto" >&5
+$as_echo_n "checking for EVP_CIPHER_CTX_init in -lcrypto... " >&6; }
+if ${ac_cv_lib_crypto_EVP_CIPHER_CTX_init+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lcrypto $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char EVP_CIPHER_CTX_init ();
+int
+main ()
+{
+return EVP_CIPHER_CTX_init ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_crypto_EVP_CIPHER_CTX_init=yes
+else
+ ac_cv_lib_crypto_EVP_CIPHER_CTX_init=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_EVP_CIPHER_CTX_init" >&5
+$as_echo "$ac_cv_lib_crypto_EVP_CIPHER_CTX_init" >&6; }
+if test "x$ac_cv_lib_crypto_EVP_CIPHER_CTX_init" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBCRYPTO 1
+_ACEOF
+
+ LIBS="-lcrypto $LIBS"
+
+fi
+
fi
# Probe libmd AFTER OpenSSL/libcrypto.
diff -r 75ea509f9213 -r 1c2c2797eb47 archivers/libarchive/files/configure.ac
--- a/archivers/libarchive/files/configure.ac Tue Jun 21 13:23:32 2016 +0000
+++ b/archivers/libarchive/files/configure.ac Tue Jun 21 13:39:21 2016 +0000
@@ -374,11 +374,8 @@
AC_CACHE_CHECK(
[whether we have multithread support in lzma],
ac_cv_lzma_has_mt,
- [AC_LINK_IFELSE([
- AC_LANG_PROGRAM([[#include <lzma.h>]
- [#if LZMA_VERSION < 50020000]
- [#error unsupported]
- [#endif]],
+ [AC_COMPILE_IFELSE([
+ AC_LANG_PROGRAM([[#include <lzma.h>]],
[[lzma_stream_encoder_mt(0, 0);]])],
[ac_cv_lzma_has_mt=yes], [ac_cv_lzma_has_mt=no])])
if test "x$ac_cv_lzma_has_mt" != xno; then
@@ -849,6 +846,7 @@
else
AC_CHECK_FUNCS([PKCS5_PBKDF2_HMAC_SHA1])
fi
+ AC_CHECK_LIB(crypto,EVP_CIPHER_CTX_init)
fi
# Probe libmd AFTER OpenSSL/libcrypto.
diff -r 75ea509f9213 -r 1c2c2797eb47 archivers/libarchive/files/libarchive/archive_read_support_format_lha.c
--- a/archivers/libarchive/files/libarchive/archive_read_support_format_lha.c Tue Jun 21 13:23:32 2016 +0000
+++ b/archivers/libarchive/files/libarchive/archive_read_support_format_lha.c Tue Jun 21 13:39:21 2016 +0000
@@ -1712,6 +1712,7 @@
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 -r 75ea509f9213 -r 1c2c2797eb47 archivers/libarchive/files/libarchive/archive_read_support_format_warc.c
--- a/archivers/libarchive/files/libarchive/archive_read_support_format_warc.c Tue Jun 21 13:23:32 2016 +0000
+++ b/archivers/libarchive/files/libarchive/archive_read_support_format_warc.c Tue Jun 21 13:39:21 2016 +0000
@@ -535,7 +535,8 @@
/* 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 @@
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 @@
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 @@
/* 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 @@
/* 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 @@
/* 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 @@
/* 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 -r 75ea509f9213 -r 1c2c2797eb47 archivers/libarchive/files/libarchive_fe/passphrase.c
--- a/archivers/libarchive/files/libarchive_fe/passphrase.c Tue Jun 21 13:23:32 2016 +0000
+++ b/archivers/libarchive/files/libarchive_fe/passphrase.c Tue Jun 21 13:39:21 2016 +0000
@@ -121,14 +121,15 @@
#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 @@
# define _POSIX_VDISABLE VDISABLE
#endif
+#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;
static void
handler(int s)
{
+ assert(s <= MAX_SIGNO);
signo[s] = 1;
}
@@ -167,11 +175,11 @@
}
if (signo == NULL) {
- signo = calloc(SIGRTMAX, sizeof(sig_atomic_t));
+ signo = calloc(MAX_SIGNO + 1, 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 +206,7 @@
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 +246,11 @@
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 +285,7 @@
* 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) {
Home |
Main Index |
Thread Index |
Old Index