From 3bf7121c691d9a3054dd23f2cd88aacb21d9f5c3 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Wed, 1 May 2024 16:10:52 +0100 Subject: [PATCH] add ServerTokens: Full-Release support --- httpd-2.4.59-full-release.patch | 44 +++++++++++++++++++++++++++++++++ httpd.spec | 7 +++++- 2 files changed, 50 insertions(+), 1 deletion(-) create mode 100644 httpd-2.4.59-full-release.patch diff --git a/httpd-2.4.59-full-release.patch b/httpd-2.4.59-full-release.patch new file mode 100644 index 0000000..da28640 --- /dev/null +++ b/httpd-2.4.59-full-release.patch @@ -0,0 +1,44 @@ +--- httpd-2.4.59/server/core.c.full-release ++++ httpd-2.4.59/server/core.c +@@ -3586,6 +3586,7 @@ + SrvTk_MINIMAL, /* eg: Apache/2.0.41 */ + SrvTk_OS, /* eg: Apache/2.0.41 (UNIX) */ + SrvTk_FULL, /* eg: Apache/2.0.41 (UNIX) PHP/4.2.2 FooBar/1.2b */ ++ SrvTk_FULL_RELEASE, /* eg: Apache/2.0.41 (UNIX) (Release 32.el7) PHP/4.2.2 FooBar/1.2b */ + SrvTk_PRODUCT_ONLY /* eg: Apache */ + }; + static enum server_token_type ap_server_tokens = SrvTk_FULL; +@@ -3662,7 +3663,10 @@ + else if (ap_server_tokens == SrvTk_MAJOR) { + ap_add_version_component(pconf, AP_SERVER_BASEPRODUCT "/" AP_SERVER_MAJORVERSION); + } +- else { ++ else if (ap_server_tokens == SrvTk_FULL_RELEASE) { ++ ap_add_version_component(pconf, AP_SERVER_BASEVERSION " (" PLATFORM ") (Release @RELEASE@)"); ++ } ++ else { + ap_add_version_component(pconf, AP_SERVER_BASEVERSION " (" PLATFORM ")"); + } + +@@ -3670,7 +3674,7 @@ + * Lock the server_banner string if we're not displaying + * the full set of tokens + */ +- if (ap_server_tokens != SrvTk_FULL) { ++ if (ap_server_tokens != SrvTk_FULL && ap_server_tokens != SrvTk_FULL_RELEASE) { + banner_locked++; + } + server_description = AP_SERVER_BASEVERSION " (" PLATFORM ")"; +@@ -3703,8 +3707,11 @@ + else if (!ap_cstr_casecmp(arg, "Full")) { + ap_server_tokens = SrvTk_FULL; + } ++ else if (!strcasecmp(arg, "Full-Release")) { ++ ap_server_tokens = SrvTk_FULL_RELEASE; ++ } + else { +- return "ServerTokens takes 1 argument: 'Prod(uctOnly)', 'Major', 'Minor', 'Min(imal)', 'OS', or 'Full'"; ++ return "ServerTokens takes 1 argument: 'Prod(uctOnly)', 'Major', 'Minor', 'Min(imal)', 'OS', 'Full' or 'Full-Release'"; + } + + return NULL; diff --git a/httpd.spec b/httpd.spec index 864c8b7..22a33f4 100644 --- a/httpd.spec +++ b/httpd.spec @@ -24,7 +24,7 @@ Summary: Apache HTTP Server Name: httpd Version: 2.4.59 -Release: 2%{?dist} +Release: 3%{?dist} URL: https://httpd.apache.org/ Source0: https://www.apache.org/dist/httpd/httpd-%{version}.tar.bz2 Source1: https://www.apache.org/dist/httpd/httpd-%{version}.tar.bz2.asc @@ -76,6 +76,7 @@ Source48: apache-poweredby.png Source49: httpd.sysusers # build/scripts patches +Patch1: httpd-2.4.59-full-release.patch Patch2: httpd-2.4.43-apxs.patch Patch3: httpd-2.4.43-deplibs.patch # Needed for socket activation and mod_systemd patch @@ -254,6 +255,7 @@ written in the Lua programming language. # Patch in the vendor string sed -i '/^#define PLATFORM/s/Unix/%{vstring}/' os/unix/os.h +sed -i 's/@RELEASE@/%{release}/' server/core.c # Prevent use of setcap in "install-suexec-caps" target. sed -i '/suexec/s,setcap ,echo Skipping setcap for ,' Makefile.in @@ -825,6 +827,9 @@ exit $rv %{_rpmconfigdir}/macros.d/macros.httpd %changelog +* Wed May 1 2024 Joe Orton - 2.4.59-3 +- add ServerTokens: Full-Release support + * Mon Apr 15 2024 Joe Orton - 2.4.59-2 - mod_ssl: add DH param handling fix (r1916863)