subversion-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Branko Čibej <>
Subject Re: [Patch] Expression support for SVNPath and SVNParentPath
Date Thu, 15 Nov 2018 13:06:47 GMT
On 13.11.2018 17:50, Branko Čibej wrote:
> On 2015/02/25 17:35:57, Graham Leggett <> wrote:
>> Hi all,
>> The SVNParentPath directive allows a set of repos to be placed at an
> URL, but if you have more complex needs such as providing many customers
> (with separately mounted home directories) access to many repositories,
> this may not be enough.
>> The attached patch brings httpd v2.4 expression support to the SVNPath
> and SVNParentPath directories through the addition of an optional second
> parameter, which allows you to do stuff like this:
>> <LocationMatch ^/svn/(?<CUSTOMERNAME>[^/]+)/>
>> # customer has their own partition, inside is an “svn” directory with
> repos in it
>> SVNParentPath /home/partition %{env:MATCH_CUSTOMERNAME}/svn
>> # customer repos are protected by this group
>> require ldap-group
> cn=https://svn.${SERVER_SUFFIX}/%{env:MATCH_CUSTOMERNAME},ou=svn,ou=Groups,o=Somewhere
>> </LocationMatch>
> I'm trying to resurrect this branch and have hit a bit of a snag. I
> modified the HTTPd configuration we use for our automated tests so that
> it uses a LocationMatch with a match group and a suffix expression in
> SVNParentPath. However, the server is now crashing because
> dav_svn__get_root_dir() no longer returns a valid path.
> The configuration looks like this:
> <LocationMatch "^/svn-test-work/(?<REPOSITORIES>repositories)">
>   DAV           svn
>   ...
>   SVNParentPath "/dev/subversion/tests/cmdline/svn-test-work" "%{env:MATCH_REPOSITORIES}"
>   ...
> </LocationMatch>  
> and the parent path appears to be computed correctly, however,
> dav_svn__get_root_dir() is returning the actual regular expression from
> the LocationMatch line, i.e., it's returning
>     ^/svn-test-work/(?<REPOSITORIES>repositories)
> instead of
>     /svn-test-work/repositories
> which is the actual matched location, so of course later on
> svn_fspath__join() asserts because the former is not a canonical path.
> Graham, I presume that you tested this when you committed the original
> patch ... would you mind taking a look at the current code on the
> mod-dav-svn-locations branch? I don't think I changed anything
> significant when I was reworking the code, and I'm a bit lost in the
> expression stuff.
> This is the current diff from trunk:
> svn diff \
> (I pegged the trunk revision because that's when the latest merge to the
> branch was made.)

Actually, mod_dav_svn doesn't work within any <LocationMatch> block that
has a non-trivial regular expression; so apparently this is not a
problem on the branch but on trunk. However, I don't know how to fix it.
There's probably an obvious way to find the actual location of the
request instead of the <Location> block's parameter, and we should be
using that, but don't.

-- Brane

View raw message