summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTony Vroon <chainsaw@gentoo.org>2015-01-28 09:45:40 +0000
committerTony Vroon <chainsaw@gentoo.org>2015-01-28 09:45:40 +0000
commit320a42a30ca2905c931e10f4ab5857165dce81f8 (patch)
tree3ea34ca0cf4b3d98cdd97b51579efc2f5317f88b /app-arch/zip
parentMake compiler calls visible. (diff)
downloadgentoo-2-320a42a30ca2905c931e10f4ab5857165dce81f8.tar.gz
gentoo-2-320a42a30ca2905c931e10f4ab5857165dce81f8.tar.bz2
gentoo-2-320a42a30ca2905c931e10f4ab5857165dce81f8.zip
Upstream 3.1C fileio & zipnote changes backported by Rafał "galtgendo" Mużyło, closes bug #322047. Incorrect printf usage changed to fputs by Ted Tanberry, closes bug #512414.
(Portage version: 2.2.15/cvs/Linux x86_64, signed Manifest commit with key 0xB5058F9A)
Diffstat (limited to 'app-arch/zip')
-rw-r--r--app-arch/zip/ChangeLog12
-rw-r--r--app-arch/zip/files/zip-3.0-format-security.patch20
-rw-r--r--app-arch/zip/files/zip-3.0-zipnote-freeze.patch61
-rw-r--r--app-arch/zip/zip-3.0-r3.ebuild63
4 files changed, 154 insertions, 2 deletions
diff --git a/app-arch/zip/ChangeLog b/app-arch/zip/ChangeLog
index 1e8a04bcca20..c8f5cbe21c52 100644
--- a/app-arch/zip/ChangeLog
+++ b/app-arch/zip/ChangeLog
@@ -1,6 +1,14 @@
# ChangeLog for app-arch/zip
-# Copyright 1999-2014 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/app-arch/zip/ChangeLog,v 1.103 2014/01/18 01:45:41 vapier Exp $
+# Copyright 1999-2015 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/app-arch/zip/ChangeLog,v 1.104 2015/01/28 09:45:40 chainsaw Exp $
+
+*zip-3.0-r3 (28 Jan 2015)
+
+ 28 Jan 2015; Tony Vroon <chainsaw@gentoo.org> +zip-3.0-r3.ebuild,
+ +files/zip-3.0-format-security.patch, +files/zip-3.0-zipnote-freeze.patch:
+ Upstream 3.1C fileio & zipnote changes backported by Rafał "galtgendo"
+ Mużyło, closes bug #322047. Incorrect printf usage changed to fputs by Ted
+ Tanberry, closes bug #512414.
18 Jan 2014; Mike Frysinger <vapier@gentoo.org> zip-3.0-r1.ebuild,
zip-3.0-r2.ebuild:
diff --git a/app-arch/zip/files/zip-3.0-format-security.patch b/app-arch/zip/files/zip-3.0-format-security.patch
new file mode 100644
index 000000000000..1edc2d6a1b88
--- /dev/null
+++ b/app-arch/zip/files/zip-3.0-format-security.patch
@@ -0,0 +1,20 @@
+--- zip.c
++++ zip.c
+@@ -1028,7 +1028,7 @@
+
+ for (i = 0; i < sizeof(text)/sizeof(char *); i++)
+ {
+- printf(text[i]);
++ fputs(text[i], stdout);
+ putchar('\n');
+ }
+ #ifdef DOS
+@@ -1225,7 +1225,7 @@
+ CR_MAJORVER, CR_MINORVER, CR_BETA_VER, CR_VERSION_DATE);
+ for (i = 0; i < sizeof(cryptnote)/sizeof(char *); i++)
+ {
+- printf(cryptnote[i]);
++ fputs(cryptnote[i], stdout);
+ putchar('\n');
+ }
+ ++i; /* crypt support means there IS at least one compilation option */
diff --git a/app-arch/zip/files/zip-3.0-zipnote-freeze.patch b/app-arch/zip/files/zip-3.0-zipnote-freeze.patch
new file mode 100644
index 000000000000..cfe78f0a100a
--- /dev/null
+++ b/app-arch/zip/files/zip-3.0-zipnote-freeze.patch
@@ -0,0 +1,61 @@
+diff -dupr zip30-old/fileio.c zip30/fileio.c
+--- zip30-old/fileio.c 2008-05-28 20:13:24.000000000 +0200
++++ zip30/fileio.c 2012-06-12 17:30:29.794547493 +0200
+@@ -3502,7 +3502,7 @@ zwchar *local_to_wide_string(local_strin
+ if ((wc_string = (wchar_t *)malloc((wsize + 1) * sizeof(wchar_t))) == NULL) {
+ ZIPERR(ZE_MEM, "local_to_wide_string");
+ }
+- wsize = mbstowcs(wc_string, local_string, strlen(local_string) + 1);
++ wsize = mbstowcs(wc_string, local_string, wsize + 1);
+ wc_string[wsize] = (wchar_t) 0;
+
+ /* in case wchar_t is not zwchar */
+diff -dupr zip30-old/zipfile.c zip30/zipfile.c
+--- zip30/zipfile.c 2008-07-01 00:15:30.000000000 +0200
++++ zip30/zipfile.c 2012-06-10 01:59:42.571706181 +0200
+@@ -5406,6 +5406,8 @@ int putlocal(z, rewrite)
+ if (z->flg & UTF8_BIT) {
+ /* If this flag is set, then restore UTF-8 as path name */
+ use_uname = 1;
++ tempzn -= nam;
+ nam = strlen(z->uname);
++ tempzn += nam;
+ } else {
+ /* use extra field */
+ add_Unicode_Path_local_extra_field(z);
+@@ -5647,7 +5650,9 @@ int putcentral(z)
+ if (z->flg & UTF8_BIT) {
+ /* If this flag is set, then restore UTF-8 as path name */
+ use_uname = 1;
++ tempzn -= nam;
+ nam = strlen(z->uname);
++ tempzn += nam;
+ } else {
+ add_Unicode_Path_cen_extra_field(z);
+ }
+diff -dupr zip30/zipnote.c zip30/zipnote.c
+--- zip30/zipnote.c 2008-05-08 04:17:08.000000000 +0200
++++ zip30/zipnote.c 2012-06-10 02:33:36.372663528 +0200
+@@ -575,6 +575,13 @@ char **argv; /* command line
+ strcpy(z->iname, a+2);
+ #endif
+
++#ifdef UNICODE_SUPPORT
++#define UTF8_BIT (1 << 11)
++ if (using_utf8) {
++ z->uname = z->iname;
++ }
++#endif
++
+ /*
+ * Don't update z->nam here, we need the old value a little later.....
+ * The update is handled in zipcopy().
+@@ -661,7 +668,7 @@ char **argv; /* command line
+ if ((r = zipcopy(z)) != ZE_OK)
+ ziperr(r, "was copying an entry");
+ }
+- fclose(x);
++ fclose(in_file);
+
+ /* Write central directory and end of central directory with new comments */
+ if ((c = zftello(y)) == (zoff_t)-1) /* get start of central */
diff --git a/app-arch/zip/zip-3.0-r3.ebuild b/app-arch/zip/zip-3.0-r3.ebuild
new file mode 100644
index 000000000000..40958f432c97
--- /dev/null
+++ b/app-arch/zip/zip-3.0-r3.ebuild
@@ -0,0 +1,63 @@
+# Copyright 1999-2015 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/app-arch/zip/zip-3.0-r3.ebuild,v 1.1 2015/01/28 09:45:40 chainsaw Exp $
+
+EAPI="5"
+inherit toolchain-funcs eutils flag-o-matic
+
+MY_P="${PN}${PV//.}"
+DESCRIPTION="Info ZIP (encryption support)"
+HOMEPAGE="http://www.info-zip.org/"
+SRC_URI="mirror://sourceforge/infozip/${MY_P}.zip"
+
+LICENSE="Info-ZIP"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~x86-fbsd ~arm-linux"
+IUSE="bzip2 crypt natspec unicode"
+
+RDEPEND="bzip2? ( app-arch/bzip2 )
+ natspec? ( dev-libs/libnatspec )"
+DEPEND="${RDEPEND}
+ app-arch/unzip"
+
+S=${WORKDIR}/${MY_P}
+
+src_prepare() {
+ epatch "${FILESDIR}"/${P}-no-crypt.patch #238398
+ epatch "${FILESDIR}"/${P}-pic.patch
+ epatch "${FILESDIR}"/${P}-exec-stack.patch #122849
+ epatch "${FILESDIR}"/${P}-build.patch #200995
+ epatch "${FILESDIR}"/${P}-zipnote-freeze.patch #322047
+ epatch "${FILESDIR}"/${P}-format-security.patch #512414
+ use natspec && epatch "${FILESDIR}"/${PN}-3.0-natspec.patch #275244
+}
+
+src_configure() {
+ append-cppflags \
+ -DLARGE_FILE_SUPPORT \
+ -DUIDGID_NOT_16BIT \
+ -D$(usex bzip2 '' NO)BZIP2_SUPPORT \
+ -D$(usex crypt '' NO)CRYPT \
+ -D$(usex unicode '' NO)UNICODE_SUPPORT
+ # Third arg disables bzip2 logic as we handle it ourselves above.
+ sh ./unix/configure "$(tc-getCC)" "-I. -DUNIX ${CFLAGS} ${CPPFLAGS}" "${T}" || die
+ if use bzip2 ; then
+ sed -i -e "s:LFLAGS2=:&'-lbz2 ':" flags || die
+ fi
+}
+
+src_compile() {
+ emake \
+ CPP="$(tc-getCPP)" \
+ -f unix/Makefile generic
+}
+
+src_install() {
+ dobin zip zipnote zipsplit
+ doman man/zip{,note,split}.1
+ if use crypt ; then
+ dobin zipcloak
+ doman man/zipcloak.1
+ fi
+ dodoc BUGS CHANGES README* TODO WHATSNEW WHERE proginfo/*.txt
+}