19875486 Upgrade libxml2 to version 2.9.2 s11-update
authorPetr Sumbera <petr.sumbera@oracle.com>
Fri, 31 Oct 2014 07:12:22 -0700
branchs11-update
changeset 3510 12feed356915
parent 3509 57d05155ba20
child 3512 faf406e3f7c1
19875486 Upgrade libxml2 to version 2.9.2 19897311 libxml2 2.9.2 upgrade dropped use of the mapfile 19875570 problem in LIBRARY/LIBXML
components/libxml2/Makefile
components/libxml2/patches/01.configure.in.patch
components/libxml2/patches/CVE-2014-0191.patch
components/libxml2/patches/mapfile.patch
components/libxml2/patches/parser.patch
components/libxml2/patches/python26.patch
components/libxml2/patches/xmlcatalog.patch
--- a/components/libxml2/Makefile	Wed Dec 03 16:23:29 2014 -0800
+++ b/components/libxml2/Makefile	Fri Oct 31 07:12:22 2014 -0700
@@ -20,18 +20,18 @@
 #
 
 #
-# Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
+# Copyright (c) 2011, 2014, Oracle and/or its affiliates. All rights reserved.
 #
 
 include ../../make-rules/shared-macros.mk
 
 COMPONENT_NAME=		libxml2
-COMPONENT_VERSION=	2.9.1
+COMPONENT_VERSION=	2.9.2
 COMPONENT_PROJECT_URL=	http://xmlsoft.org/
 COMPONENT_SRC=		$(COMPONENT_NAME)-$(COMPONENT_VERSION)
 COMPONENT_ARCHIVE=	$(COMPONENT_SRC).tar.gz
 COMPONENT_ARCHIVE_HASH=	\
-    sha256:fd3c64cb66f2c4ea27e934d275904d92cec494a8e8405613780cbc8a71680fdb
+    sha256:5178c30b151d044aefb1b08bf54c3003a0ac55c59c866763997529d60770d5bc
 COMPONENT_ARCHIVE_URL=	ftp://xmlsoft.org/libxml2/$(COMPONENT_ARCHIVE)
 COMPONENT_BUGDB=	library/libxml
 
@@ -41,6 +41,8 @@
     sha256:96151685cec997e1f9f3387e3626d61e6284d4d6e66e0e440c209286c03e9cc7
 COMPONENT_ARCHIVE_URL_1= http://www.w3.org/XML/Test/$(COMPONENT_ARCHIVE_1)
 
+TPNO=			19552
+
 include ../../make-rules/prep.mk
 include ../../make-rules/configure.mk
 include ../../make-rules/ips.mk
@@ -53,11 +55,11 @@
 CONFIGURE_OPTIONS += --with-pic
 CONFIGURE_OPTIONS += --with-threads
 CONFIGURE_OPTIONS += --with-python=$(PYTHON.$(BITS))
+CONFIGURE_OPTIONS += --with-python-install-dir=$(PYTHON_VENDOR_PACKAGES)
 # Cannot link to lzma since it's not in /lib.
 CONFIGURE_OPTIONS += --without-lzma
 CONFIGURE_OPTIONS += CFLAGS="$(CFLAGS)"
 CONFIGURE_OPTIONS += LDFLAGS="$(LDFLAGS)"
-CONFIGURE_OPTIONS += PYTHON_VENDOR_PACKAGES=$(PYTHON_VENDOR_PACKAGES)
 
 COMPONENT_PREP_ACTION += (cd $(@D) ; cp ../mapfile libxml2.syms ; autoreconf -if)
 
--- a/components/libxml2/patches/01.configure.in.patch	Wed Dec 03 16:23:29 2014 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,17 +0,0 @@
-# fix configure so that we can override the site-packages directory to match
-# the way we deliver python modules in Solaris.
-#
---- libxml2-2.7.6/configure.in.orig	Tue Oct  6 09:28:58 2009
-+++ libxml2-2.7.6/configure.in	Mon Mar 21 00:39:24 2011
-@@ -757,6 +757,10 @@
- if test "$PYTHON_INCLUDES" != ""
- then
-     PYTHON_SUBDIR=python
-+    if test "${PYTHON_VENDOR_PACKAGES}" != ""
-+    then
-+        PYTHON_SITE_PACKAGES=$PYTHON_VENDOR_PACKAGES
-+    fi
- else
-     PYTHON_SUBDIR=
- fi
-
--- a/components/libxml2/patches/CVE-2014-0191.patch	Wed Dec 03 16:23:29 2014 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,152 +0,0 @@
-Patch origin: upstream
-Patch status: will be part of next version
-
-https://git.gnome.org/browse/libxml2/commit/?id=9cd1c3cfbd32655d60572c0a413e017260c854df
-https://git.gnome.org/browse/libxml2/commit/?id=dd8367da17c2948981a51e52c8a6beb445edf825
-https://git.gnome.org/browse/libxml2/commit/?id=c35af8b18dddd0bdfb137ad6a056837a3d5ea651
-
-From 9cd1c3cfbd32655d60572c0a413e017260c854df Mon Sep 17 00:00:00 2001
-From: Daniel Veillard <[email protected]>
-Date: Tue, 22 Apr 2014 15:30:56 +0800
-Subject: Do not fetch external parameter entities
-
-Unless explicitely asked for when validating or replacing entities
-with their value. Problem pointed out by Daniel Berrange <[email protected]>
-
-diff --git a/parser.c b/parser.c
-index 9347ac9..c0dea05 100644
---- a/parser.c
-+++ b/parser.c
-@@ -2598,6 +2598,20 @@ xmlParserHandlePEReference(xmlParserCtxtPtr ctxt) {
- 		    xmlCharEncoding enc;
- 
- 		    /*
-+		     * Note: external parsed entities will not be loaded, it is
-+		     * not required for a non-validating parser, unless the
-+		     * option of validating, or substituting entities were
-+		     * given. Doing so is far more secure as the parser will
-+		     * only process data coming from the document entity by
-+		     * default.
-+		     */
-+                    if ((entity->etype == XML_EXTERNAL_PARAMETER_ENTITY) &&
-+		        ((ctxt->options & XML_PARSE_NOENT) == 0) &&
-+			((ctxt->options & XML_PARSE_DTDVALID) == 0) &&
-+			(ctxt->validate == 0))
-+			return;
-+
-+		    /*
- 		     * handle the extra spaces added before and after
- 		     * c.f. http://www.w3.org/TR/REC-xml#as-PE
- 		     * this is done independently.
--- 
-cgit v0.10.1
-
-From dd8367da17c2948981a51e52c8a6beb445edf825 Mon Sep 17 00:00:00 2001
-From: Daniel Veillard <[email protected]>
-Date: Wed, 11 Jun 2014 16:54:32 +0800
-Subject: Fix regressions introduced by CVE-2014-0191 patch
-
-A number of issues have been raised after the fix, and this patch
-tries to correct all of them, though most were related to
-postvalidation.
-https://bugzilla.gnome.org/show_bug.cgi?id=730290
-and other reports on list, off-list and on Red Hat bugzilla
-
-diff --git a/parser.c b/parser.c
-index c0dea05..ba70f9e 100644
---- a/parser.c
-+++ b/parser.c
-@@ -2598,8 +2598,8 @@ xmlParserHandlePEReference(xmlParserCtxtPtr ctxt) {
- 		    xmlCharEncoding enc;
- 
- 		    /*
--		     * Note: external parsed entities will not be loaded, it is
--		     * not required for a non-validating parser, unless the
-+		     * Note: external parameter entities will not be loaded, it
-+		     * is not required for a non-validating parser, unless the
- 		     * option of validating, or substituting entities were
- 		     * given. Doing so is far more secure as the parser will
- 		     * only process data coming from the document entity by
-@@ -2608,6 +2608,9 @@ xmlParserHandlePEReference(xmlParserCtxtPtr ctxt) {
-                     if ((entity->etype == XML_EXTERNAL_PARAMETER_ENTITY) &&
- 		        ((ctxt->options & XML_PARSE_NOENT) == 0) &&
- 			((ctxt->options & XML_PARSE_DTDVALID) == 0) &&
-+			((ctxt->options & XML_PARSE_DTDLOAD) == 0) &&
-+			((ctxt->options & XML_PARSE_DTDATTR) == 0) &&
-+			(ctxt->replaceEntities == 0) &&
- 			(ctxt->validate == 0))
- 			return;
- 
-@@ -12616,6 +12619,9 @@ xmlIOParseDTD(xmlSAXHandlerPtr sax, xmlParserInputBufferPtr input,
- 	return(NULL);
-     }
- 
-+    /* We are loading a DTD */
-+    ctxt->options |= XML_PARSE_DTDLOAD;
-+
-     /*
-      * Set-up the SAX context
-      */
-@@ -12743,6 +12749,9 @@ xmlSAXParseDTD(xmlSAXHandlerPtr sax, const xmlChar *ExternalID,
- 	return(NULL);
-     }
- 
-+    /* We are loading a DTD */
-+    ctxt->options |= XML_PARSE_DTDLOAD;
-+
-     /*
-      * Set-up the SAX context
-      */
--- 
-cgit v0.10.1
-
-From c35af8b18dddd0bdfb137ad6a056837a3d5ea651 Mon Sep 17 00:00:00 2001
-From: Daniel Veillard <[email protected]>
-Date: Wed, 11 Jun 2014 16:59:16 +0800
-Subject: Fixes for xmlInitParserCtxt
-
-let's make sure that parser options are updated too when a corrsponding
-global variable or other field of the context is set.
-
-diff --git a/parserInternals.c b/parserInternals.c
-index 98a5836..df204fd 100644
---- a/parserInternals.c
-+++ b/parserInternals.c
-@@ -1691,12 +1691,20 @@ xmlInitParserCtxt(xmlParserCtxtPtr ctxt)
-     ctxt->nsWellFormed = 1;
-     ctxt->valid = 1;
-     ctxt->loadsubset = xmlLoadExtDtdDefaultValue;
-+    if (ctxt->loadsubset) {
-+        ctxt->options |= XML_PARSE_DTDLOAD;
-+    }
-     ctxt->validate = xmlDoValidityCheckingDefaultValue;
-     ctxt->pedantic = xmlPedanticParserDefaultValue;
-+    if (ctxt->pedantic) {
-+        ctxt->options |= XML_PARSE_PEDANTIC;
-+    }
-     ctxt->linenumbers = xmlLineNumbersDefaultValue;
-     ctxt->keepBlanks = xmlKeepBlanksDefaultValue;
--    if (ctxt->keepBlanks == 0)
-+    if (ctxt->keepBlanks == 0) {
- 	ctxt->sax->ignorableWhitespace = xmlSAX2IgnorableWhitespace;
-+	ctxt->options |= XML_PARSE_NOBLANKS;
-+    }
- 
-     ctxt->vctxt.finishDtd = XML_CTXT_FINISH_DTD_0;
-     ctxt->vctxt.userData = ctxt;
-@@ -1708,8 +1716,12 @@ xmlInitParserCtxt(xmlParserCtxtPtr ctxt)
- 	else
- 	    ctxt->vctxt.warning = xmlParserValidityWarning;
- 	ctxt->vctxt.nodeMax = 0;
-+        ctxt->options |= XML_PARSE_DTDVALID;
-     }
-     ctxt->replaceEntities = xmlSubstituteEntitiesDefaultValue;
-+    if (ctxt->replaceEntities) {
-+        ctxt->options |= XML_PARSE_NOENT;
-+    }
-     ctxt->record_info = 0;
-     ctxt->nbChars = 0;
-     ctxt->checkIndex = 0;
--- 
-cgit v0.10.1
-
--- a/components/libxml2/patches/mapfile.patch	Wed Dec 03 16:23:29 2014 -0800
+++ b/components/libxml2/patches/mapfile.patch	Fri Oct 31 07:12:22 2014 -0700
@@ -3,18 +3,17 @@
 https://mail.gnome.org/archives/xml/2012-October/msg00038.html
 https://mail.gnome.org/archives/xml/2012-October/msg00039.html
 
---- libxml2-2.9.0/configure.in	Mon Sep 10 20:52:46 2012
-+++ libxml2-2.9.0/configure.in	Fri Oct 26 08:16:02 2012
-@@ -82,7 +82,7 @@
-   VERSION_SCRIPT_FLAGS=-Wl,--version-script=
+--- libxml2-2.9.2/configure.ac	2014-10-15 21:06:15.000000000 -0700
++++ libxml2-2.9.2/configure.ac	2014-10-30 06:08:49.500465105 -0700
+@@ -83,6 +83,7 @@
  else
    case $host in
--  *-*-sunos*) VERSION_SCRIPT_FLAGS="-Wl,-M -Wl,";;
+   *-*-sunos*) VERSION_SCRIPT_FLAGS="-Wl,-M -Wl,";;
 +  *-*-solaris*) VERSION_SCRIPT_FLAGS="-Wl,-M -Wl,";;
    esac
  fi
  AC_SUBST(VERSION_SCRIPT_FLAGS)
-@@ -1149,7 +1153,7 @@
+@@ -1226,7 +1227,7 @@
      TEST_SAX=SAXtests
  fi
  AC_SUBST(WITH_SAX1)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/libxml2/patches/parser.patch	Fri Oct 31 07:12:22 2014 -0700
@@ -0,0 +1,31 @@
+Patch origin: upstream
+Patch status: will be part of next version
+
+From 72a46a519ce7326d9a00f0b6a7f2a8e958cd1675 Mon Sep 17 00:00:00 2001
+From: Daniel Veillard <[email protected]>
+Date: Thu, 23 Oct 2014 11:35:36 +0800
+Subject: Fix missing entities after CVE-2014-3660 fix
+
+For https://bugzilla.gnome.org/show_bug.cgi?id=738805
+
+The fix for CVE-2014-3660 introduced a regression in some case
+where entity substitution is required and the entity is used
+first in anotther entity referenced from an attribute value
+
+diff --git a/parser.c b/parser.c
+index 67c9dfd..a8d1b67 100644
+--- a/parser.c
++++ b/parser.c
+@@ -7235,7 +7235,8 @@ xmlParseReference(xmlParserCtxtPtr ctxt) {
+      * far more secure as the parser will only process data coming from
+      * the document entity by default.
+      */
+-    if ((ent->checked == 0) &&
++    if (((ent->checked == 0) ||
++         ((ent->children == NULL) && (ctxt->options & XML_PARSE_NOENT))) &&
+         ((ent->etype != XML_EXTERNAL_GENERAL_PARSED_ENTITY) ||
+          (ctxt->options & (XML_PARSE_NOENT | XML_PARSE_DTDVALID)))) {
+ 	unsigned long oldnbent = ctxt->nbentities;
+-- 
+cgit v0.10.1
+
--- a/components/libxml2/patches/python26.patch	Wed Dec 03 16:23:29 2014 -0800
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,20 +0,0 @@
-See:
-
-https://mail.gnome.org/archives/xml/2013-April/msg00039.html
-
---- libxml2-2.9.1/python/libxml_wrap.h	2013-04-01 19:25:28.000000000 -0700
-+++ libxml2-2.9.1/python/libxml_wrap.h	2013-04-23 07:55:11.268714627 -0700
-@@ -34,11 +34,11 @@
- #define PyBytes_AsString PyString_AsString
- #define PyBytes_AS_STRING PyString_AS_STRING
- #define PyBytes_GET_SIZE PyString_GET_SIZE
--
-+#endif
-+#ifndef PyCapsule_New
- #define PyCapsule_New PyCObject_FromVoidPtrAndDesc
- #define PyCapsule_CheckExact PyCObject_Check
- #define PyCapsule_GetPointer(o, n) PyCObject_GetDesc((o))
--
- #endif
- #endif
- 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/components/libxml2/patches/xmlcatalog.patch	Fri Oct 31 07:12:22 2014 -0700
@@ -0,0 +1,29 @@
+Patch origin: upstream
+Patch status: will be part of next version
+
+From f65128f38289d77ff322d63aef2858cc0a819c34 Mon Sep 17 00:00:00 2001
+From: Daniel Veillard <[email protected]>
+Date: Fri, 17 Oct 2014 17:13:41 +0800
+Subject: Revert "Missing initialization for the catalog module"
+
+This reverts commit 054c716ea1bf001544127a4ab4f4346d1b9947e7.
+As this break xmlcatalog command
+https://bugzilla.redhat.com/show_bug.cgi?id=1153753
+
+diff --git a/parser.c b/parser.c
+index 1d93967..67c9dfd 100644
+--- a/parser.c
++++ b/parser.c
+@@ -14830,9 +14830,6 @@ xmlInitParser(void) {
+ #ifdef LIBXML_XPATH_ENABLED
+ 	xmlXPathInit();
+ #endif
+-#ifdef LIBXML_CATALOG_ENABLED
+-        xmlInitializeCatalog();
+-#endif
+ 	xmlParserInitialized = 1;
+ #ifdef LIBXML_THREAD_ENABLED
+     }
+-- 
+cgit v0.10.1
+