Hi all,

A more common scenario for deploying mod_dav in a mass hosting environment is 
following some kind of templating scenario, where elements of the URL are 
inserted into the directory path to make up the actual effective path being 
used for mod_dav.

The previous DirectoryMatch/LocationMatch patch gives mod_dav a fighting chance 
of working, but there is one major limitation - elements matched in the URL 
path regex cannot be inserted into the effective path, until now.

The attached patch allows mod_dav to treat the incoming path as an expression. 
This allows us to do flexible mapping from the URL directly to the filesystem, 
like this:

<DirectoryMatch /path/to/dav/%{env:MATCH_CUSTOMERNAME} 
^/path/to/dav/(?<CUSTOMERNAME>[^/]+)/>
  DAV on
  require ldap-group stuff=%{env:MATCH_CUSTOMERNAME}, more=stuff
</DirectoryMatch>

Obviously with an expression being used mod_dav must check if the path is 
canonical after the expression is applied (think a customer called “..”). This 
patch includes such a check, and non canonical paths are rejected, the same way 
mod_dav_svn does.

The patch that follows this one is for mod_dav_svn, and will be sent to the 
[email protected] list. The mod_dav_svn patch to follow depends on 
this patch, and the previous core.c patch.

Regards,
Graham
—

Attachment: httpd-mod_dav-expression2.patch
Description: Binary data

Reply via email to