Gentoo Archives: gentoo-commits

From: Sam James <sam@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: net-proxy/squid/files/, net-proxy/squid/
Date: Fri, 23 Sep 2022 07:42:13
Message-Id: 1663917414.1efb38b2ae71a0cf0dc13480491b3cba754ccc1c.sam@gentoo
1 commit: 1efb38b2ae71a0cf0dc13480491b3cba754ccc1c
2 Author: Sam James <sam <AT> gentoo <DOT> org>
3 AuthorDate: Fri Sep 23 07:16:47 2022 +0000
4 Commit: Sam James <sam <AT> gentoo <DOT> org>
5 CommitDate: Fri Sep 23 07:16:54 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=1efb38b2
7
8 net-proxy/squid: fix build w/ libxml2-2.10.0
9
10 Closes: https://bugs.gentoo.org/866518
11 Signed-off-by: Sam James <sam <AT> gentoo.org>
12
13 .../files/squid-4.17-fix-libxml2-2.10.0.patch | 30 ++++++++++++++++++++++
14 net-proxy/squid/squid-4.17-r1.ebuild | 1 +
15 net-proxy/squid/squid-5.4.1-r2.ebuild | 1 +
16 3 files changed, 32 insertions(+)
17
18 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
19 new file mode 100644
20 index 000000000000..ebc0cd698e14
21 --- /dev/null
22 +++ b/net-proxy/squid/files/squid-4.17-fix-libxml2-2.10.0.patch
23 @@ -0,0 +1,30 @@
24 +https://bugs.gentoo.org/866518
25 +https://github.com/squid-cache/squid/commit/c4e6b7c2a12fa218089fe839f769ffc8ae18dea4
26 +
27 +From c4e6b7c2a12fa218089fe839f769ffc8ae18dea4 Mon Sep 17 00:00:00 2001
28 +From: Nick Wellnhofer <wellnhofer@×××××.de>
29 +Date: Sun, 20 Feb 2022 19:42:40 +0000
30 +Subject: [PATCH] ESI: Drop incorrect and unnecessary xmlSetFeature() call
31 + (#988)
32 +
33 +xmlSetFeature() has been deprecated for 10+ years and will eventually be
34 +removed from libxml2. Squid calls xmlSetFeature() with the wrong
35 +argument: a nil `value` pointer instead of a pointer to a zero value.
36 +When called with a nil `value`, the function does nothing but returning
37 +an error. Squid does not check whether xmlSetFeature() call is
38 +successful, and the bug went unnoticed since libxml2 support was added
39 +in commit 964b44c.
40 +
41 +Since libxml2 does not substitute entities by default, the call can be
42 +removed to achieve the intended effect.
43 +--- a/src/esi/Libxml2Parser.cc
44 ++++ b/src/esi/Libxml2Parser.cc
45 +@@ -118,7 +118,6 @@ ESILibxml2Parser::ESILibxml2Parser(ESIParserClient *aClient) : theClient (aClien
46 +
47 + /* TODO: grab the document encoding from the headers */
48 + parser = xmlCreatePushParserCtxt(&sax, static_cast<void *>(this), NULL, 0, NULL);
49 +- xmlSetFeature(parser, "substitute entities", 0);
50 +
51 + if (entity_doc == NULL)
52 + entity_doc = htmlNewDoc(NULL, NULL);
53 +
54
55 diff --git a/net-proxy/squid/squid-4.17-r1.ebuild b/net-proxy/squid/squid-4.17-r1.ebuild
56 index 106d72f54d7e..32578aaf7326 100644
57 --- a/net-proxy/squid/squid-4.17-r1.ebuild
58 +++ b/net-proxy/squid/squid-4.17-r1.ebuild
59 @@ -80,6 +80,7 @@ pkg_pretend() {
60 src_prepare() {
61 eapply "${FILESDIR}/${PN}-4.3-gentoo.patch"
62 eapply "${FILESDIR}/${PN}-4.17-use-system-libltdl.patch"
63 + eapply "${FILESDIR}/${PN}-4.17-fix-libxml2-2.10.0.patch"
64
65 sed -i -e 's:/usr/local/squid/etc:/etc/squid:' \
66 INSTALL QUICKSTART \
67
68 diff --git a/net-proxy/squid/squid-5.4.1-r2.ebuild b/net-proxy/squid/squid-5.4.1-r2.ebuild
69 index 94456703bd17..4a8f16e2cd05 100644
70 --- a/net-proxy/squid/squid-5.4.1-r2.ebuild
71 +++ b/net-proxy/squid/squid-5.4.1-r2.ebuild
72 @@ -82,6 +82,7 @@ pkg_pretend() {
73 src_prepare() {
74 eapply "${FILESDIR}/${PN}-5.3-gentoo.patch"
75 eapply "${FILESDIR}/${PN}-4.17-use-system-libltdl.patch"
76 + eapply "${FILESDIR}/${PN}-4.17-fix-libxml2-2.10.0.patch"
77
78 sed -i -e 's:/usr/local/squid/etc:/etc/squid:' \
79 INSTALL QUICKSTART \