subversion/subversion-1.14.1-r1926683.patch
2025-07-09 17:36:46 +01:00

61 lines
2.3 KiB
Diff

From 1a7310fe38e049d228731d17690dc3c4455ea28b Mon Sep 17 00:00:00 2001
From: Joe Orton <jorton@apache.org>
Date: Tue, 24 Jun 2025 09:44:06 +0000
Subject: [PATCH] mod_dav_svn: Use mod_dav's DAVBasePath setting to determine
the repository root path, allowing SVN to be configured via LocationMatch
like:
<LocationMatch ^/repos/svn(.*)>
DAV svn
SVNParentPath /srv/repos
DAVBasePath /repos
</LocationMatch>
by mapping URL path "/repos/svnfoo" to the filesystem path of
"/srv/repos/svnfoo". This partially addresses issues like SVN-4790
(with minimal added complexity), though does not provide as much
flexibility as discussed in SVN-2679. (resolves #28)
* subversion/mod_dav_svn/mod_dav_svn.c
(dav_svn__get_root_dir): Retrieve and return the setting from
DavBasePath via dav_get_base_path() where that API is available
and DavBasePath is configured.
(dav_svn__translate_name): Use dav_svn__get_root_dir() to determine
the repos root for the same reason.
git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1926683 13f79535-47bb-0310-9956-ffa450edef68
---
subversion/mod_dav_svn/mod_dav_svn.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/subversion/mod_dav_svn/mod_dav_svn.c b/subversion/mod_dav_svn/mod_dav_svn.c
index 72f4470f62624..9b13134f33545 100644
--- a/subversion/mod_dav_svn/mod_dav_svn.c
+++ b/subversion/mod_dav_svn/mod_dav_svn.c
@@ -781,6 +781,15 @@ const char *
dav_svn__get_root_dir(request_rec *r)
{
dir_conf_t *conf;
+#ifdef AP_X_RH_DAV_GET_BASE_PATH
+ const char *base;
+
+ /* Inherit the root path from mod_dav's DavBasePath iff configured
+ where e.g. LocationMatch is used for the repos. */
+ base = dav_get_base_path(r);
+ if (base)
+ return base;
+#endif
conf = ap_get_module_config(r->per_dir_config, &dav_svn_module);
return conf->root_dir;
@@ -1225,7 +1234,7 @@ static int dav_svn__translate_name(request_rec *r)
else
{
/* Retrieve path to repo and within repo for the request */
- dav_error *err = dav_svn_split_uri(r, r->uri, conf->root_dir,
+ dav_error *err = dav_svn_split_uri(r, r->uri, dav_svn__get_root_dir(r),
&ignore_cleaned_uri,
&ignore_had_slash, &repos_basename,
&ignore_relative_path, &repos_path);