summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2010-10-14 18:34:55 +0000
committerMike Frysinger <vapier@gentoo.org>2010-10-14 18:34:55 +0000
commitcfa6488a1ad683865a8ad8aa9581e25c6216cd84 (patch)
tree38a436d7f09ce44c46d96c56500f693fcece681f /sys-apps/sed
parentold (diff)
downloadhistorical-cfa6488a1ad683865a8ad8aa9581e25c6216cd84.tar.gz
historical-cfa6488a1ad683865a8ad8aa9581e25c6216cd84.tar.bz2
historical-cfa6488a1ad683865a8ad8aa9581e25c6216cd84.zip
Add fix from upstream for infinite hangs on invalid multibyte sequences #284403 by Zer4tul.
Package-Manager: portage-2.2_rc96/cvs/Linux x86_64
Diffstat (limited to 'sys-apps/sed')
-rw-r--r--sys-apps/sed/ChangeLog10
-rw-r--r--sys-apps/sed/Manifest16
-rw-r--r--sys-apps/sed/files/sed-4.2.1-handle-incomplete-sequences-as-if-they-were-invalid.patch45
-rw-r--r--sys-apps/sed/sed-4.2.1-r1.ebuild69
4 files changed, 130 insertions, 10 deletions
diff --git a/sys-apps/sed/ChangeLog b/sys-apps/sed/ChangeLog
index e2271e04f5df..3c16314e5502 100644
--- a/sys-apps/sed/ChangeLog
+++ b/sys-apps/sed/ChangeLog
@@ -1,6 +1,14 @@
# ChangeLog for sys-apps/sed
# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-apps/sed/ChangeLog,v 1.104 2010/10/14 15:23:56 fauli Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/sed/ChangeLog,v 1.105 2010/10/14 18:34:55 vapier Exp $
+
+*sed-4.2.1-r1 (14 Oct 2010)
+
+ 14 Oct 2010; Mike Frysinger <vapier@gentoo.org> +sed-4.2.1-r1.ebuild,
+ +files/sed-4.2.1-handle-incomplete-sequences-as-if-they-were-invalid.patch
+ :
+ Add fix from upstream for infinite hangs on invalid multibyte sequences
+ #284403 by Zer4tul.
14 Oct 2010; Christian Faulhammer <fauli@gentoo.org> sed-4.2.1.ebuild:
stable x86, bug 340919
diff --git a/sys-apps/sed/Manifest b/sys-apps/sed/Manifest
index 51e1bc263303..ce6f172fb074 100644
--- a/sys-apps/sed/Manifest
+++ b/sys-apps/sed/Manifest
@@ -1,23 +1,21 @@
-----BEGIN PGP SIGNED MESSAGE-----
-Hash: SHA1
+Hash: SHA256
AUX dos2unix 39 RMD160 4044b51c2efeb08b73a1e986bcb1471070c75bc2 SHA1 ceb6ea1b12963324ff0131160e16fa3dbc4a206e SHA256 e1ed4ef63be934640783727968903ed9f8c382548a364f717b87087ff0a5fe41
-AUX sed-4.1.4-makeinfo-c-locale.patch 617 RMD160 83f62dca50d5c3e0d9cd787f317205cd4e89431a SHA1 1aa48c4f86c24f51576caed273b7b44376ad969f SHA256 5fa61306d210de7ad859e705d9df0a8c397cc309888b635510bf9b23d5df90c1
AUX sed-4.1.5-alloca.patch 413 RMD160 57a18c6dd60031c3c495e1aa6c7387f35372b83d SHA1 9ab28aff96f8da59c44632abf9fa0f4dd895de43 SHA256 9b371d7e3db5f6955536b4c4a23739b7d84448b9865046f0cc3bd3903a04009a
-AUX sed-4.1.5-prototypes.patch 228 RMD160 ef696698ab5b8b5f4500474412b2dadde0a3e57d SHA1 756ef351a463508077936a4aea4ee95e7e7fdfbb SHA256 987c44e3a0806242a20016de5c371da4e5bc328c70858cb575149baa27aab25d
+AUX sed-4.2.1-handle-incomplete-sequences-as-if-they-were-invalid.patch 1507 RMD160 7782deffc855946f0c34be01de7939e7f0927c4d SHA1 354b9c2a5ed26077aaf589dc6c8f5419eab7dfdc SHA256 11e8585a1ca572aa48632903040b3c81be75c764a401ede121f83c4555435746
AUX unix2dos 36 RMD160 a5081a06798106458311b0a628979575b77ffea6 SHA1 868114224967197337668b6cd634bde82ee6c52b SHA256 261d335cf9cd3b938d90e07ed66445b5512ab1e534e1bd68c322a3119d4201c9
-DIST sed-4.1.5.tar.gz 799584 RMD160 49b12e99a55c6d2e78ad236f0205e63e46444173 SHA1 8e575e8a44568392d5b6e089eab5da5cdbd45885 SHA256 be955bef7a81d69222e929689e0de0ecf64c13dc5b15b2ee5696d5ef66fdeec0
DIST sed-4.2.1.tar.bz2 899091 RMD160 f664dca0ca4472554ea0d595d544e232a3de51ad SHA1 ace93d23eabc00d3a8187ecf07d3a02b1b297810 SHA256 2ac3b36ca37bfeb43c4ef4025778cd66d89c77abb843d90552a515a7c9d2948f
DIST sed-4.2.tar.bz2 882586 RMD160 c0e901c6fc74a95633d89ef77dc609955f72c0fd SHA1 ee7af3cd1ebbc6cdf17a7d1abbce00db0c7b5a0d SHA256 ee7755e3ab038e7deecebdf44fd43ad65a96890962c3b44206cce672368b45c8
-EBUILD sed-4.1.5-r1.ebuild 1992 RMD160 acb4edcfe904c33f1571e4a54b64270ea5903959 SHA1 d657c4a6368481b951469a4b8dcca652c8c68e58 SHA256 04c3541d4d17cace54791709a56e3bc37eaaf0fb0e293938c375df6e421a8ce6
+EBUILD sed-4.2.1-r1.ebuild 1921 RMD160 d6c1b80fcd7088c52fe8293def16d1e58ae29c88 SHA1 e6e815c1835e554965fb34be699118f0e2d11ac6 SHA256 14c20190d057f2013e012b236e47db6958c9d2825a379cfeb9628de5356a16cd
EBUILD sed-4.2.1.ebuild 1823 RMD160 fedbde84596dd61ef28e11d9ae79b7590e9f1446 SHA1 45243608fdb3de379494f7940f1e8d85455809ba SHA256 bdd2f3f766f6c740d26d00f8c43b32dd21f4db657d3454d9c6c82ed3ef3d8995
EBUILD sed-4.2.ebuild 1717 RMD160 e5d40b81ec73582fedc4b6c2dd685d0b4fdf4881 SHA1 7c8718c44a0e2d5e645e7df165d5ce71b601a147 SHA256 f929056f93a8bdc9e59e098fc051ce97805d165be2ce66c3dd3292dc4bbdd0bd
-MISC ChangeLog 13393 RMD160 9f2a639896605460015f4e25024cae3a3468ac25 SHA1 79505bce7da31f0e1a16822add87d64f560cfe36 SHA256 1499d7efd2fa434e0fc8b3458b0e1bb41d2e4ecf057864e39ece219b995e8967
+MISC ChangeLog 13673 RMD160 2b6f6c3f1b7788f4c1ece456df6dd8ed671d48e3 SHA1 1cbee18321f8710b8fa40394d3d48e4d2a5df931 SHA256 8ad85fb2cd70478f74c1b6b2298d344bf51e84078a74e302394d53f9dc45308d
MISC metadata.xml 164 RMD160 f43cbec30b7074319087c9acffdb9354b17b0db3 SHA1 9c213f5803676c56439df3716be07d6692588856 SHA256 f5f2891f2a4791cd31350bb2bb572131ad7235cd0eeb124c9912c187ac10ce92
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.16 (GNU/Linux)
-iEYEARECAAYFAky3IQ0ACgkQNQqtfCuFneNSegCfeyBWRAVCUbxNoOHuX1DHmhBU
-ccQAnj9cSvVaHtl/6dCF9NjrljG6lIDY
-=dYWy
+iF4EAREIAAYFAky3TU0ACgkQTwhj9JtAlp4zNgEAkQSevtauPLFIxlE2gzxMHIlF
+GMklkrvCdekuiENl6JYA/3CYHeHJWlP6JJAK8Kxiqy/TsbdSI5ZcA4GUtjW7USiK
+=/0un
-----END PGP SIGNATURE-----
diff --git a/sys-apps/sed/files/sed-4.2.1-handle-incomplete-sequences-as-if-they-were-invalid.patch b/sys-apps/sed/files/sed-4.2.1-handle-incomplete-sequences-as-if-they-were-invalid.patch
new file mode 100644
index 000000000000..dfd9206d3bf4
--- /dev/null
+++ b/sys-apps/sed/files/sed-4.2.1-handle-incomplete-sequences-as-if-they-were-invalid.patch
@@ -0,0 +1,45 @@
+http://bugs.gentoo.org/284403
+
+From 20f68fb1abe862a98bc0378e5bb54d94bb98b8fe Mon Sep 17 00:00:00 2001
+From: Paolo Bonzini <bonzini@gnu.org>
+Date: Thu, 15 Oct 2009 19:56:12 +0200
+Subject: [PATCH] handle incomplete sequences as if they were invalid
+
+2009-10-15 Paolo Bonzini <bonzini@gnu.org>
+ WANG Yunfeng <uhuruh@gmail.com>
+
+ * sed/execute.c (str_append, str_append_modified): Handle incomplete
+ sequences as if they were invalid.
+---
+ ChangeLog | 6 ++++++
+ NEWS | 4 +++-
+ sed/execute.c | 6 +++---
+ 3 files changed, 12 insertions(+), 4 deletions(-)
+
+diff --git a/sed/execute.c b/sed/execute.c
+index 66cb809..d5903be 100644
+--- a/sed/execute.c
++++ b/sed/execute.c
+@@ -254,8 +254,8 @@ str_append(to, string, length)
+ {
+ size_t n = MBRLEN (string, length, &to->mbstate);
+
+- /* An invalid sequence is treated like a singlebyte character. */
+- if (n == (size_t) -1)
++ /* An invalid or imcomplete sequence is treated like a singlebyte character. */
++ if (n == (size_t) -1 || n == (size_t) -2)
+ {
+ memset (&to->mbstate, 0, sizeof (to->mbstate));
+ n = 1;
+@@ -341,7 +341,7 @@ str_append_modified(to, string, length, type)
+ /* Copy the new wide character to the end of the string. */
+ n = WCRTOMB (to->active + to->length, wc, &to->mbstate);
+ to->length += n;
+- if (n == -1)
++ if (n == -1 || n == -2)
+ {
+ fprintf (stderr, "Case conversion produced an invalid character!");
+ abort ();
+--
+1.7.3.1
+
diff --git a/sys-apps/sed/sed-4.2.1-r1.ebuild b/sys-apps/sed/sed-4.2.1-r1.ebuild
new file mode 100644
index 000000000000..1db2d9ce21c9
--- /dev/null
+++ b/sys-apps/sed/sed-4.2.1-r1.ebuild
@@ -0,0 +1,69 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/sys-apps/sed/sed-4.2.1-r1.ebuild,v 1.1 2010/10/14 18:34:55 vapier Exp $
+
+inherit eutils flag-o-matic toolchain-funcs
+
+DESCRIPTION="Super-useful stream editor"
+HOMEPAGE="http://sed.sourceforge.net/"
+SRC_URI="mirror://gnu/sed/${P}.tar.bz2"
+
+LICENSE="GPL-3"
+SLOT="0"
+KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~sparc-fbsd ~x86-fbsd"
+IUSE="acl nls selinux static"
+
+RDEPEND="nls? ( virtual/libintl )
+ acl? ( virtual/acl )"
+DEPEND="${RDEPEND}
+ nls? ( sys-devel/gettext )"
+
+src_bootstrap_sed() {
+ # make sure system-sed works #40786
+ export NO_SYS_SED=""
+ if ! type -p sed > /dev/null ; then
+ NO_SYS_SED="!!!"
+ ./bootstrap.sh || die "couldnt bootstrap"
+ cp sed/sed "${T}"/ || die "couldnt copy"
+ export PATH="${PATH}:${T}"
+ make clean || die "couldnt clean"
+ fi
+}
+
+src_unpack() {
+ unpack ${A}
+ cd "${S}"
+ epatch "${FILESDIR}"/${PN}-4.1.5-alloca.patch
+ epatch "${FILESDIR}"/${P}-handle-incomplete-sequences-as-if-they-were-invalid.patch #284403
+ # don't use sed here if we have to recover a broken host sed
+}
+
+src_compile() {
+ src_bootstrap_sed
+ # this has to be after the bootstrap portion
+ sed -i \
+ -e '/docdir =/s:=.*/doc:= $(datadir)/doc/'${PF}'/html:' \
+ doc/Makefile.in || die "sed html doc"
+
+ local myconf= bindir=/bin
+ if ! use userland_GNU ; then
+ myconf="--program-prefix=g"
+ bindir=/usr/bin
+ fi
+
+ use selinux || export ac_cv_{search_setfilecon,header_selinux_{context,selinux}_h}=no
+ use static && append-ldflags -static
+ econf \
+ --bindir=${bindir} \
+ $(use_enable acl) \
+ $(use_enable nls) \
+ ${myconf}
+ emake || die "build failed"
+}
+
+src_install() {
+ emake install DESTDIR="${D}" || die "Install failed"
+ dodoc NEWS README* THANKS AUTHORS BUGS ChangeLog
+ docinto examples
+ dodoc "${FILESDIR}"/{dos2unix,unix2dos}
+}