From 288dccd150d4009769394dbda892c506fd11adf2 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Fri, 6 Jun 2025 17:26:20 +0100 Subject: [PATCH] mod_dav: add dav_get_base_path() API Resolves: RHEL-41069 --- httpd-2.4.62-r1926064.patch | 44 +++++++++++++++++++++++++++++++++++++ httpd.spec | 9 +++++++- pullrev.sh | 4 ++-- 3 files changed, 54 insertions(+), 3 deletions(-) create mode 100644 httpd-2.4.62-r1926064.patch diff --git a/httpd-2.4.62-r1926064.patch b/httpd-2.4.62-r1926064.patch new file mode 100644 index 0000000..350d52f --- /dev/null +++ b/httpd-2.4.62-r1926064.patch @@ -0,0 +1,44 @@ +# ./pullrev.sh 1926064 +http://svn.apache.org/viewvc?view=revision&revision=1926064 + +Since we can't jump from the 2.4.62-level MMN to the 2.4.64-level +MMN added in the upstream 2.4.x backport without adding all other APIs, +this patch defines a custom macro: + + #define AP_X_RH_DAV_GET_BASE_PATH 1 + +which can be tested in the mod_dav_svn code which consumes this. + +--- httpd-2.4.62/modules/dav/main/mod_dav.c ++++ httpd-2.4.62/modules/dav/main/mod_dav.c +@@ -250,6 +250,13 @@ + return dav_get_provider(r)->search; + } + ++DAV_DECLARE(const char *) dav_get_base_path(request_rec *r) ++{ ++ dav_dir_conf *conf = ap_get_module_config(r->per_dir_config, &dav_module); ++ ++ return conf && conf->base ? conf->base : NULL; ++} ++ + /* + * Command handler for the DAV directive, which is TAKE1. + */ +--- httpd-2.4.62/modules/dav/main/mod_dav.h ++++ httpd-2.4.62/modules/dav/main/mod_dav.h +@@ -430,6 +430,14 @@ + DAV_DECLARE(dav_error *) dav_get_resource(request_rec *r, int label_allowed, + int use_checked_in, dav_resource **res_p); + ++/* Defined for backported dav_get_base_path(). */ ++#define AP_X_RH_DAV_GET_BASE_PATH 1 ++ ++/* ++** If DavBasePath is configured for the request location, return the ++** configured path, otherwise NULL. ++*/ ++DAV_DECLARE(const char *) dav_get_base_path(request_rec *r); + + /* -------------------------------------------------------------------- + ** diff --git a/httpd.spec b/httpd.spec index 8495da6..a00e10e 100644 --- a/httpd.spec +++ b/httpd.spec @@ -13,7 +13,7 @@ Summary: Apache HTTP Server Name: httpd Version: 2.4.62 -Release: 4%{?dist} +Release: 5%{?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 @@ -88,6 +88,8 @@ Patch33: httpd-2.4.62-freebind.patch Patch34: httpd-2.4.53-separate-systemd-fns.patch # https://issues.redhat.com/browse/RHEL-5071 Patch35: httpd-2.4.57-r1912477+.patch +# https://issues.redhat.com/browse/RHEL-41069 +Patch36: httpd-2.4.62-r1926064.patch # Bug fixes # https://bugzilla.redhat.com/show_bug.cgi?id=1397243 @@ -260,6 +262,7 @@ written in the Lua programming language. %patch33 -p1 -b .freebind %patch34 -p1 -b .separatesystemd %patch35 -p1 -b .r1912477+ +%patch36 -p1 -b .r1926064 %patch100 -p1 -b .enable-sslv3 %patch101 -p1 -b .full-release @@ -828,6 +831,10 @@ exit $rv %{_rpmconfigdir}/macros.d/macros.httpd %changelog +* Fri Jun 06 2025 Joe Orton - 2.4.62-5 +- mod_dav: add dav_get_base_path() API +- Resolves: RHEL-41069 + * Wed Jan 29 2025 Luboš Uhliarik - 2.4.62-4 - Resolves: RHEL-66488 - Apache HTTPD no longer parse PHP files with unicode characters in the name diff --git a/pullrev.sh b/pullrev.sh index f57f15c..b1643db 100755 --- a/pullrev.sh +++ b/pullrev.sh @@ -6,8 +6,8 @@ if [ $# -lt 1 ]; then fi repo="https://svn.apache.org/repos/asf/httpd/httpd/trunk" -#repo="https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x" -ver=2.4.57 +repo="https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x" +ver=2.4.62 prefix="httpd-${ver}" suffix="${SUFFIX:-r$1${2:++}}" fn="${prefix}-${suffix}.patch"