From 65156b01bb6d8b19fb1b7f39d73175054cd17f38 Mon Sep 17 00:00:00 2001 From: Honza Horak Date: Mon, 15 May 2023 20:06:45 +0200 Subject: [PATCH] Replace whole repo with latest content from branch stream-4.2.3-rhel-8.8.0 Content corresponds with RHEL dist-git commit c0469e2 --- .gitignore | 50 ++++++++++++++++++++- CVE-2022-2309.patch | 104 -------------------------------------------- gating.yaml | 6 --- 3 files changed, 49 insertions(+), 111 deletions(-) delete mode 100644 CVE-2022-2309.patch delete mode 100644 gating.yaml diff --git a/.gitignore b/.gitignore index ca853af..14e244f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,50 @@ -SOURCES/lxml-4.2.3.tgz +lxml-2.2.7.tar.gz +lxml-2.2.7.tar.gz.asc +/lxml-2.2.8.tar.gz +/lxml-2.2.8.tar.gz.asc +/lxml-2.3.tar.gz +/lxml-2.3.tar.gz.asc +/lxml-2.3.1.tar.gz +/lxml-2.3.1.tar.gz.asc +/lxml-2.3.2.tar.gz +/lxml-2.3.2.tar.gz.asc +/lxml-2.3.3.tar.gz +/lxml-2.3.3.tar.gz.asc +/lxml-2.3.5.tar.gz +/lxml-2.3.5.tar.gz.asc +/lxml-3.0.tar.gz +/lxml-3.0.tar.gz.asc +/lxml-3.0.tgz +/lxml-3.0.tgz.asc +/lxml-3.0.1.tgz +/lxml-3.0.1.tgz.asc +/lxml-3.1.0.tgz +/lxml-3.1.0.tgz.asc +/lxml-3.2.0.tgz +/lxml-3.2.0.tgz.asc +/lxml-3.2.1.tgz +/lxml-3.2.1.tgz.asc +/lxml-3.2.3.tgz +/lxml-3.2.3.tgz.asc +/lxml-3.2.4.tgz +/lxml-3.2.4.tgz.asc +/lxml-3.3.0.tgz +/lxml-3.3.0.tgz.asc +/lxml-3.3.2.tgz +/lxml-3.3.2.tgz.asc +/lxml-3.3.3.tgz +/lxml-3.3.3.tgz.asc +/lxml-3.3.5.tgz +/lxml-3.3.5.tgz.asc +/lxml-3.3.6.tgz +/lxml-3.3.6.tgz.asc +/lxml-3.4.4.tgz +/lxml-3.4.4.tgz.asc +/lxml-3.6.4.tar.gz +/lxml-3.7.0.tar.gz +/lxml-3.7.1.tgz +/lxml-3.7.2.tgz +/lxml-3.8.0.tgz +/lxml-4.0.0.tgz +/lxml-4.1.1.tgz /lxml-4.2.3.tgz diff --git a/CVE-2022-2309.patch b/CVE-2022-2309.patch deleted file mode 100644 index 588d9ba..0000000 --- a/CVE-2022-2309.patch +++ /dev/null @@ -1,104 +0,0 @@ -diff --git a/src/lxml/apihelpers.pxi b/src/lxml/apihelpers.pxi -index 5eb3416..88a031d 100644 ---- a/src/lxml/apihelpers.pxi -+++ b/src/lxml/apihelpers.pxi -@@ -246,9 +246,10 @@ cdef dict _build_nsmap(xmlNode* c_node): - while c_node is not NULL and c_node.type == tree.XML_ELEMENT_NODE: - c_ns = c_node.nsDef - while c_ns is not NULL: -- prefix = funicodeOrNone(c_ns.prefix) -- if prefix not in nsmap: -- nsmap[prefix] = funicodeOrNone(c_ns.href) -+ if c_ns.prefix or c_ns.href: -+ prefix = funicodeOrNone(c_ns.prefix) -+ if prefix not in nsmap: -+ nsmap[prefix] = funicodeOrNone(c_ns.href) - c_ns = c_ns.next - c_node = c_node.parent - return nsmap -diff --git a/src/lxml/includes/xmlparser.pxd b/src/lxml/includes/xmlparser.pxd -index a196e34..45acfc8 100644 ---- a/src/lxml/includes/xmlparser.pxd -+++ b/src/lxml/includes/xmlparser.pxd -@@ -144,6 +144,7 @@ cdef extern from "libxml/parser.h": - void* userData - int* spaceTab - int spaceMax -+ int nsNr - bint html - bint progressive - int inSubset -diff --git a/src/lxml/iterparse.pxi b/src/lxml/iterparse.pxi -index 4c20506..3da7485 100644 ---- a/src/lxml/iterparse.pxi -+++ b/src/lxml/iterparse.pxi -@@ -419,7 +419,7 @@ cdef int _countNsDefs(xmlNode* c_node): - count = 0 - c_ns = c_node.nsDef - while c_ns is not NULL: -- count += 1 -+ count += (c_ns.href is not NULL) - c_ns = c_ns.next - return count - -@@ -430,9 +430,10 @@ cdef int _appendStartNsEvents(xmlNode* c_node, list event_list) except -1: - count = 0 - c_ns = c_node.nsDef - while c_ns is not NULL: -- ns_tuple = (funicode(c_ns.prefix) if c_ns.prefix is not NULL else '', -- funicode(c_ns.href)) -- event_list.append( (u"start-ns", ns_tuple) ) -- count += 1 -+ if c_ns.href: -+ ns_tuple = (funicodeOrEmpty(c_ns.prefix), -+ funicode(c_ns.href)) -+ event_list.append( (u"start-ns", ns_tuple) ) -+ count += 1 - c_ns = c_ns.next - return count -diff --git a/src/lxml/parser.pxi b/src/lxml/parser.pxi -index 3ed223b..f5ff6b2 100644 ---- a/src/lxml/parser.pxi -+++ b/src/lxml/parser.pxi -@@ -569,6 +569,9 @@ cdef class _ParserContext(_ResolverContext): - self._c_ctxt.disableSAX = 0 # work around bug in libxml2 - else: - xmlparser.xmlClearParserCtxt(self._c_ctxt) -+ # work around bug in libxml2 [2.9.10 .. 2.9.14]: -+ # https://gitlab.gnome.org/GNOME/libxml2/-/issues/378 -+ self._c_ctxt.nsNr = 0 - - cdef int prepare(self, bint set_document_loader=True) except -1: - cdef int result -diff --git a/src/lxml/tests/test_etree.py b/src/lxml/tests/test_etree.py -index 42613dc..db1f560 100644 ---- a/src/lxml/tests/test_etree.py -+++ b/src/lxml/tests/test_etree.py -@@ -1459,6 +1459,27 @@ class ETreeOnlyTestCase(HelperTestCase): - [1,2,1,4], - counts) - -+ def test_walk_after_parse_failure(self): -+ # This used to be an issue because libxml2 can leak empty namespaces -+ # between failed parser runs. iterwalk() failed to handle such a tree. -+ parser = etree.XMLParser() -+ -+ try: -+ etree.XML('''''', parser=parser) -+ except etree.XMLSyntaxError: -+ pass -+ else: -+ assert False, "invalid input did not fail to parse" -+ -+ et = etree.XML(''' ''', parser=parser) -+ try: -+ ns = next(etree.iterwalk(et, events=('start-ns',))) -+ except StopIteration: -+ # This would be the expected result, because there was no namespace -+ pass -+ else: -+ assert False, "Found unexpected namespace '%s'" % ns -+ - def test_itertext_comment_pi(self): - # https://bugs.launchpad.net/lxml/+bug/1844674 - XML = self.etree.XML diff --git a/gating.yaml b/gating.yaml deleted file mode 100644 index c190bde..0000000 --- a/gating.yaml +++ /dev/null @@ -1,6 +0,0 @@ ---- !Policy -product_versions: - - rhel-9 -decision_context: osci_compose_gate -rules: - - !PassingTestCaseRule {test_case_name: baseos-ci.brew-build.tier1.functional}