From 058e477264a2be7985b2f2851a80444611062ff3 Mon Sep 17 00:00:00 2001 From: Matt Tennant Date: Mon, 10 Oct 2011 11:13:04 -0700 Subject: [PATCH] Upgraded the expat Portage package Upgraded dev-libs/expat to version 2.0.1-r5 on amd64, arm, x86 BUG=chromium-os:21465 TEST=trybots: x86-generic-pre-flight-queue arm-generic-bin chromiumos-sdk Change-Id: I2425e67dd8e86ab8e61d37f73375067289f7a2b1 Reviewed-on: http://gerrit.chromium.org/gerrit/9794 Reviewed-by: Mike Frysinger Reviewed-by: David James Tested-by: Matt Tennant Commit-Ready: Matt Tennant --- .../dev-libs/expat/expat-2.0.1-r5.ebuild | 72 +++++++++++++++++++ .../expat-2.0.1-CVE-2009-3560-revised.patch | 16 +++++ .../expat-2.0.1-check_stopped_parser.patch | 14 ++++ .../files/expat-2.0.1-fix_bug_1990430.patch | 14 ++++ 4 files changed, 116 insertions(+) create mode 100644 sdk_container/src/third_party/portage-stable/dev-libs/expat/expat-2.0.1-r5.ebuild create mode 100644 sdk_container/src/third_party/portage-stable/dev-libs/expat/files/expat-2.0.1-CVE-2009-3560-revised.patch create mode 100644 sdk_container/src/third_party/portage-stable/dev-libs/expat/files/expat-2.0.1-check_stopped_parser.patch create mode 100644 sdk_container/src/third_party/portage-stable/dev-libs/expat/files/expat-2.0.1-fix_bug_1990430.patch diff --git a/sdk_container/src/third_party/portage-stable/dev-libs/expat/expat-2.0.1-r5.ebuild b/sdk_container/src/third_party/portage-stable/dev-libs/expat/expat-2.0.1-r5.ebuild new file mode 100644 index 0000000000..90b41957f0 --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/dev-libs/expat/expat-2.0.1-r5.ebuild @@ -0,0 +1,72 @@ +# Copyright 1999-2011 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/dev-libs/expat/expat-2.0.1-r5.ebuild,v 1.6 2011/10/05 05:55:18 maekke Exp $ + +EAPI=4 +inherit eutils libtool toolchain-funcs + +DESCRIPTION="XML parsing libraries" +HOMEPAGE="http://expat.sourceforge.net/" +SRC_URI="mirror://sourceforge/expat/${P}.tar.gz" + +LICENSE="MIT" +SLOT="0" +KEYWORDS="~alpha amd64 arm hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc x86 ~sparc-fbsd ~x86-fbsd" +IUSE="elibc_FreeBSD examples static-libs" + +src_prepare() { + epatch \ + "${FILESDIR}"/${P}-check_stopped_parser.patch \ + "${FILESDIR}"/${P}-fix_bug_1990430.patch \ + "${FILESDIR}"/${P}-CVE-2009-3560-revised.patch + + elibtoolize + epunt_cxx + + mkdir "${S}"-build{,u,w} || die +} + +src_configure() { + local myconf="$(use_enable static-libs static)" + + local d + for d in build buildu buildw; do + pushd "${S}"-${d} + [[ ${d} == buildu ]] && export GENTOO_CPPFLAGS="-UXML_UNICODE" + [[ ${d} == buildw ]] && export GENTOO_CPPFLAGS="-UXML_UNICODE -DXML_UNICODE_WCHAR_T" + CPPFLAGS="${CPPFLAGS} ${GENTOO_CPPFLAGS}" ECONF_SOURCE="${S}" econf ${myconf} + popd + done +} + +src_compile() { + cd "${S}"-build + emake + cd "${S}"-buildu + emake buildlib LIBRARY=libexpatu.la + cd "${S}"-buildw + emake buildlib LIBRARY=libexpatw.la +} + +src_install() { + dodoc Changes README + dohtml doc/* + + if use examples; then + insinto /usr/share/doc/${PF}/examples + doins examples/*.c + fi + + cd "${S}"-build + emake install DESTDIR="${D}" + cd "${S}"-buildu + emake installlib DESTDIR="${D}" LIBRARY=libexpatu.la + cd "${S}"-buildw + emake installlib DESTDIR="${D}" LIBRARY=libexpatw.la + + use static-libs || rm -f "${D}"usr/lib*/libexpat{,u,w}.la + + # libgeom in /lib and ifconfig in /sbin require it on FreeBSD since we + # stripped the libbsdxml copy starting from freebsd-lib-8.2-r1 + use elibc_FreeBSD && gen_usr_ldscript -a expat{,u,w} +} diff --git a/sdk_container/src/third_party/portage-stable/dev-libs/expat/files/expat-2.0.1-CVE-2009-3560-revised.patch b/sdk_container/src/third_party/portage-stable/dev-libs/expat/files/expat-2.0.1-CVE-2009-3560-revised.patch new file mode 100644 index 0000000000..301831f0dd --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/dev-libs/expat/files/expat-2.0.1-CVE-2009-3560-revised.patch @@ -0,0 +1,16 @@ +http://nvd.nist.gov/nvd.cfm?cvename=CVE-2009-3560 +http://bugs.gentoo.org/show_bug.cgi?id=303727 +http://cvs.fedoraproject.org/viewvc/rpms/expat/devel/ + +--- lib/xmlparse.c ++++ lib/xmlparse.c +@@ -3703,6 +3703,9 @@ doProlog(XML_Parser parser, + return XML_ERROR_UNCLOSED_TOKEN; + case XML_TOK_PARTIAL_CHAR: + return XML_ERROR_PARTIAL_CHAR; ++ case -XML_TOK_PROLOG_S: ++ tok = -tok; ++ break; + case XML_TOK_NONE: + #ifdef XML_DTD + /* for internal PE NOT referenced between declarations */ diff --git a/sdk_container/src/third_party/portage-stable/dev-libs/expat/files/expat-2.0.1-check_stopped_parser.patch b/sdk_container/src/third_party/portage-stable/dev-libs/expat/files/expat-2.0.1-check_stopped_parser.patch new file mode 100644 index 0000000000..a51e6baa33 --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/dev-libs/expat/files/expat-2.0.1-check_stopped_parser.patch @@ -0,0 +1,14 @@ +Fix segmentation fault in python tests +http://bugs.gentoo.org/197043 + +--- lib/xmlparse.c ++++ lib/xmlparse.c +@@ -2563,6 +2563,8 @@ + (int)(dataPtr - (ICHAR *)dataBuf)); + if (s == next) + break; ++ if (ps_parsing == XML_FINISHED || ps_parsing == XML_SUSPENDED) ++ break; + *eventPP = s; + } + } diff --git a/sdk_container/src/third_party/portage-stable/dev-libs/expat/files/expat-2.0.1-fix_bug_1990430.patch b/sdk_container/src/third_party/portage-stable/dev-libs/expat/files/expat-2.0.1-fix_bug_1990430.patch new file mode 100644 index 0000000000..17dc166a69 --- /dev/null +++ b/sdk_container/src/third_party/portage-stable/dev-libs/expat/files/expat-2.0.1-fix_bug_1990430.patch @@ -0,0 +1,14 @@ +http://expat.cvs.sourceforge.net/viewvc/expat/expat/lib/xmltok_impl.c?view=log (1.13 -> 1.15) +http://svn.python.org/view?view=rev&revision=74429 + +--- lib/xmltok_impl.c ++++ lib/xmltok_impl.c +@@ -1744,7 +1744,7 @@ + const char *end, + POSITION *pos) + { +- while (ptr != end) { ++ while (ptr < end) { + switch (BYTE_TYPE(enc, ptr)) { + #define LEAD_CASE(n) \ + case BT_LEAD ## n: \