commit:     1efb38b2ae71a0cf0dc13480491b3cba754ccc1c
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Sep 23 07:16:47 2022 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Sep 23 07:16:54 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1efb38b2

net-proxy/squid: fix build w/ libxml2-2.10.0

Closes: https://bugs.gentoo.org/866518
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../files/squid-4.17-fix-libxml2-2.10.0.patch      | 30 ++++++++++++++++++++++
 net-proxy/squid/squid-4.17-r1.ebuild               |  1 +
 net-proxy/squid/squid-5.4.1-r2.ebuild              |  1 +
 3 files changed, 32 insertions(+)

diff --git a/net-proxy/squid/files/squid-4.17-fix-libxml2-2.10.0.patch 
b/net-proxy/squid/files/squid-4.17-fix-libxml2-2.10.0.patch
new file mode 100644
index 000000000000..ebc0cd698e14
--- /dev/null
+++ b/net-proxy/squid/files/squid-4.17-fix-libxml2-2.10.0.patch
@@ -0,0 +1,30 @@
+https://bugs.gentoo.org/866518
+https://github.com/squid-cache/squid/commit/c4e6b7c2a12fa218089fe839f769ffc8ae18dea4
+
+From c4e6b7c2a12fa218089fe839f769ffc8ae18dea4 Mon Sep 17 00:00:00 2001
+From: Nick Wellnhofer <[email protected]>
+Date: Sun, 20 Feb 2022 19:42:40 +0000
+Subject: [PATCH] ESI: Drop incorrect and unnecessary xmlSetFeature() call
+ (#988)
+
+xmlSetFeature() has been deprecated for 10+ years and will eventually be
+removed from libxml2. Squid calls xmlSetFeature() with the wrong
+argument: a nil `value` pointer instead of a pointer to a zero value.
+When called with a nil `value`, the function does nothing but returning
+an error. Squid does not check whether xmlSetFeature() call is
+successful, and the bug went unnoticed since libxml2 support was added
+in commit 964b44c.
+
+Since libxml2 does not substitute entities by default, the call can be
+removed to achieve the intended effect.
+--- a/src/esi/Libxml2Parser.cc
++++ b/src/esi/Libxml2Parser.cc
+@@ -118,7 +118,6 @@ ESILibxml2Parser::ESILibxml2Parser(ESIParserClient 
*aClient) : theClient (aClien
+ 
+     /* TODO: grab the document encoding from the headers */
+     parser = xmlCreatePushParserCtxt(&sax, static_cast<void *>(this), NULL, 
0, NULL);
+-    xmlSetFeature(parser, "substitute entities", 0);
+ 
+     if (entity_doc == NULL)
+         entity_doc = htmlNewDoc(NULL, NULL);
+

diff --git a/net-proxy/squid/squid-4.17-r1.ebuild 
b/net-proxy/squid/squid-4.17-r1.ebuild
index 106d72f54d7e..32578aaf7326 100644
--- a/net-proxy/squid/squid-4.17-r1.ebuild
+++ b/net-proxy/squid/squid-4.17-r1.ebuild
@@ -80,6 +80,7 @@ pkg_pretend() {
 src_prepare() {
        eapply "${FILESDIR}/${PN}-4.3-gentoo.patch"
        eapply "${FILESDIR}/${PN}-4.17-use-system-libltdl.patch"
+       eapply "${FILESDIR}/${PN}-4.17-fix-libxml2-2.10.0.patch"
 
        sed -i -e 's:/usr/local/squid/etc:/etc/squid:' \
                INSTALL QUICKSTART \

diff --git a/net-proxy/squid/squid-5.4.1-r2.ebuild 
b/net-proxy/squid/squid-5.4.1-r2.ebuild
index 94456703bd17..4a8f16e2cd05 100644
--- a/net-proxy/squid/squid-5.4.1-r2.ebuild
+++ b/net-proxy/squid/squid-5.4.1-r2.ebuild
@@ -82,6 +82,7 @@ pkg_pretend() {
 src_prepare() {
        eapply "${FILESDIR}/${PN}-5.3-gentoo.patch"
        eapply "${FILESDIR}/${PN}-4.17-use-system-libltdl.patch"
+       eapply "${FILESDIR}/${PN}-4.17-fix-libxml2-2.10.0.patch"
 
        sed -i -e 's:/usr/local/squid/etc:/etc/squid:' \
                INSTALL QUICKSTART \

Reply via email to