On Mar 25, 2005, at 12:13 PM, Marcus Rueckert wrote:
> On 2005-03-25 07:52:26 -0600, Ben Collins-Sussman wrote:
>>> but how can i cleanly access the config options from other modules?
>
> i want to write a module which uses the same logic as svnserve for
> authentication. therefor i need to find the filesystem path of the
> repository to read conf/svnserve.conf to find the passwd file.
>
> what would be a proper way to get the path to it?
Aha, you're right. Sorry for misunderstanding. I think that
dav_svn_get_fs_path() and dav_svn_get_fs_parent_path() need to be
exported, so that your module can use them.
Then your module could steal this code from mod_dav_svn/repos.c:1193:
/* This does all the work of interpreting/splitting the request uri.
*/
err = dav_svn_split_uri(r, r->uri, root_path,
&cleaned_uri, &had_slash,
&repos_name, &relative, &repos_path);
if (err)
return err;
/* The path that we will eventually try to open as an svn
repository. Normally defined by the SVNPath directive. */
fs_path = dav_svn_get_fs_path(r);
/* If the SVNParentPath directive was used instead... */
fs_parent_path = dav_svn_get_fs_parent_path(r);
if (fs_parent_path != NULL)
{
/* ...then the URL to the repository is actually one implicit
component longer... */
root_path = svn_path_join(root_path, repos_name, r->pool);
/* ...and we need to specify exactly what repository to open. */
fs_path = svn_path_join(fs_parent_path, repos_name, r->pool);
}
... now 'fs_path' is the actualy path to the repository, and you can
read fs_path/conf/svnserve.conf.
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Fri Mar 25 19:27:15 2005