From 5eb89ef3d828caa5fc43cd8064f958010dbc8158 Mon Sep 17 00:00:00 2001 From: Amos Jeffries Date: Sat, 21 Sep 2024 20:27:11 +0000 Subject: [PATCH] Remove Edge Side Include (ESI) protocol (#1905) ESI feature has a number of bugs and security vulnerabilities. It is also rarely used and a survey of active community members has not revealed a need to keep maintaining this code. --- CREDITS | 9 - configure.ac | 35 - doc/Programming-Guide/03_MajorComponents.dox | 7 - doc/debug-sections.txt | 2 - doc/release-notes/release-7.sgml.in | 16 +- lib/Makefile.am | 3 - lib/libTrie/Makefile.am | 21 - lib/libTrie/Trie.cc | 44 - lib/libTrie/Trie.h | 75 - lib/libTrie/TrieCharTransform.h | 49 - lib/libTrie/TrieNode.cc | 52 - lib/libTrie/TrieNode.h | 85 - lib/libTrie/test/Makefile.am | 17 - lib/libTrie/test/trie.cc | 125 - squid.dox | 2 - src/HttpHeader.cc | 2 +- src/Makefile.am | 15 - src/Store.h | 7 - src/XactionInitiator.cc | 1 - src/XactionInitiator.h | 3 +- src/cache_cf.cc | 3 - src/cf.data.pre | 28 +- src/cf_gen_defines | 1 - src/client_side_reply.cc | 15 - src/client_side_request.cc | 4 +- src/esi/Assign.cc | 176 -- src/esi/Assign.h | 60 - src/esi/Attempt.h | 22 - src/esi/Context.cc | 93 - src/esi/Context.h | 165 -- src/esi/Element.h | 105 - src/esi/Esi.cc | 2260 ----------------- src/esi/Esi.h | 36 - src/esi/Except.h | 27 - src/esi/ExpatParser.cc | 109 - src/esi/ExpatParser.h | 50 - src/esi/Expression.cc | 1049 -------- src/esi/Expression.h | 22 - src/esi/Include.cc | 545 ---- src/esi/Include.h | 76 - src/esi/Libxml2Parser.cc | 156 -- src/esi/Libxml2Parser.h | 74 - src/esi/Literal.h | 46 - src/esi/Makefile.am | 50 - src/esi/Parser.cc | 64 - src/esi/Parser.h | 74 - src/esi/Segment.cc | 197 -- src/esi/Segment.h | 57 - src/esi/Sequence.cc | 396 --- src/esi/Sequence.h | 67 - src/esi/Var.h | 29 - src/esi/VarState.cc | 839 ------ src/esi/VarState.h | 172 -- src/http.cc | 4 - src/http/RegisteredHeaders.h | 4 +- src/main.cc | 8 - src/tests/stub_store.cc | 3 - test-suite/ESIExpressions.cc | 52 - test-suite/Makefile.am | 22 +- test-suite/buildtests/layer-01-minimal.opts | 3 - test-suite/buildtests/layer-02-maximus.opts | 1 - .../layer-04-noauth-everything.opts | 1 - test-suite/buildtests/os-mingw.opts | 1 - 63 files changed, 28 insertions(+), 7708 deletions(-) delete mode 100644 lib/libTrie/Makefile.am delete mode 100644 lib/libTrie/Trie.cc delete mode 100644 lib/libTrie/Trie.h delete mode 100644 lib/libTrie/TrieCharTransform.h delete mode 100644 lib/libTrie/TrieNode.cc delete mode 100644 lib/libTrie/TrieNode.h delete mode 100644 lib/libTrie/test/Makefile.am delete mode 100644 lib/libTrie/test/trie.cc delete mode 100644 src/esi/Assign.cc delete mode 100644 src/esi/Assign.h delete mode 100644 src/esi/Attempt.h delete mode 100644 src/esi/Context.cc delete mode 100644 src/esi/Context.h delete mode 100644 src/esi/Element.h delete mode 100644 src/esi/Esi.cc delete mode 100644 src/esi/Esi.h delete mode 100644 src/esi/Except.h delete mode 100644 src/esi/ExpatParser.cc delete mode 100644 src/esi/ExpatParser.h delete mode 100644 src/esi/Expression.cc delete mode 100644 src/esi/Expression.h delete mode 100644 src/esi/Include.cc delete mode 100644 src/esi/Include.h delete mode 100644 src/esi/Libxml2Parser.cc delete mode 100644 src/esi/Libxml2Parser.h delete mode 100644 src/esi/Literal.h delete mode 100644 src/esi/Makefile.am delete mode 100644 src/esi/Parser.cc delete mode 100644 src/esi/Parser.h delete mode 100644 src/esi/Segment.cc delete mode 100644 src/esi/Segment.h delete mode 100644 src/esi/Sequence.cc delete mode 100644 src/esi/Sequence.h delete mode 100644 src/esi/Var.h delete mode 100644 src/esi/VarState.cc delete mode 100644 src/esi/VarState.h delete mode 100644 test-suite/ESIExpressions.cc diff --git a/CREDITS b/CREDITS index 52ebd70e96..d26f68ba0c 100644 --- a/CREDITS +++ b/CREDITS @@ -1522,15 +1522,6 @@ src/auth/ntlm/smb_lm/: ============================================================================== -src/esi/Libxml2Parser.cc, -src/esi/Libxml2Parser.h: - - * The ESI Libxml2 parser is Copyright (c) 2004 by Joachim Bauch - * http://www.joachim-bauch.de - * mail@joachim-bauch.de - -============================================================================== - src/external_acl.c: Copyright (C) 2002 MARA Systems AB, Sweden diff --git a/configure.ac b/configure.ac index 285f05349e..19a5cbe7f8 100644 --- a/configure.ac +++ b/configure.ac @@ -817,38 +817,6 @@ AC_ARG_ENABLE(delay-pools, dnl disable generic/common adaptation support by default squid_opt_use_adaptation=no -AH_TEMPLATE([USE_SQUID_ESI],[whether to enable ESI processing]) -AC_ARG_ENABLE(esi,[ - AS_HELP_STRING([--enable-esi], - [Enable ESI for accelerators. ESI requires expat or xml2 library. - Enabling ESI will cause squid reverse proxies to be capable - of the Edge Acceleration Specification (www.esi.org).]) -],[ - SQUID_DEFINE_BOOL(USE_SQUID_ESI,$enable_esi) -]) -AC_MSG_NOTICE([Enable ESI processor: ${enable_esi:=no (auto)}]) - -# ESI support libraries: expat -SQUID_AUTO_LIB(expat,[ESI expat library],[LIBEXPAT]) -SQUID_CHECK_LIB_WORKS(expat,[ - PKG_CHECK_MODULES([LIBEXPAT],[expat],[:],[:]) - CPPFLAGS="$LIBEXPAT_CFLAGS $CPPFLAGS" - AC_CHECK_HEADERS(expat.h) -]) - -# ESI support libraries: xml2 -SQUID_AUTO_LIB(xml2,[ESI xml2 library],[LIBXML2]) -SQUID_CHECK_LIB_WORKS(xml2,[ - PKG_CHECK_MODULES([LIBXML2],[libxml-2.0],[:],[:]) - CPPFLAGS="$LIBXML2_CFLAGS $CPPFLAGS" - AC_CHECK_HEADERS(libxml/parser.h libxml/HTMLparser.h libxml/HTMLtree.h) -]) - -AS_IF([test "x$enable_esi" = "xyes" -a "x$LIBXML2_LIBS" = "x" -a "x$LIBEXPAT_LIBS" = "x"],[ - AC_MSG_ERROR([ESI processor requires libxml2 or libexpat]) -]) -AM_CONDITIONAL(ENABLE_ESI,[test "x$enable_esi" = "xyes"]) - AC_ARG_ENABLE(icap-client, AS_HELP_STRING([--disable-icap-client],[Disable the ICAP client.]),[ SQUID_YESNO([$enableval],[--enable-icap-client]) @@ -2519,8 +2487,6 @@ AC_CONFIG_FILES([ errors/Makefile icons/Makefile lib/Makefile - lib/libTrie/Makefile - lib/libTrie/test/Makefile lib/ntlmauth/Makefile lib/rfcnb/Makefile lib/smblib/Makefile @@ -2587,7 +2553,6 @@ AC_CONFIG_FILES([ src/DiskIO/IpcIo/Makefile src/DiskIO/Mmapped/Makefile src/error/Makefile - src/esi/Makefile src/eui/Makefile src/format/Makefile src/fs/Makefile diff --git a/doc/Programming-Guide/03_MajorComponents.dox b/doc/Programming-Guide/03_MajorComponents.dox index ce6a6606c9..f52ae3d931 100644 --- a/doc/Programming-Guide/03_MajorComponents.dox +++ b/doc/Programming-Guide/03_MajorComponents.dox @@ -338,11 +338,4 @@ TODO: get RFCs linked from ietf see (http://squid.nlanr.net/Squid/urn-support.html) URN Support in Squid . -\section ESI ESI -\par - ESI is an implementation of Edge Side Includes (http://www.esi.org). - ESI is implemented as a client side stream and a small - modification to client_side_reply.c to check whether - ESI should be inserted into the reply stream or not. - */ diff --git a/doc/debug-sections.txt b/doc/debug-sections.txt index 892042ae2c..3fdfd0e16a 100644 --- a/doc/debug-sections.txt +++ b/doc/debug-sections.txt @@ -138,8 +138,6 @@ section 83 TLS Server/Peer negotiation section 83 TLS session management section 84 Helper process maintenance section 85 Client-side Request Routines -section 86 ESI Expressions -section 86 ESI processing section 87 Client-side Stream routines. section 88 Client-side Reply Routines section 89 EUI-48 Lookup diff --git a/doc/release-notes/release-7.sgml.in b/doc/release-notes/release-7.sgml.in index e3150e65ff..f33c9992d6 100644 --- a/doc/release-notes/release-7.sgml.in +++ b/doc/release-notes/release-7.sgml.in @@ -199,6 +199,9 @@ This section gives an account of those changes in three categories: Removed directives