Skip to content

Commit

Permalink
Fix the breakage of SVNListParentPath caused by the translate_name hook.
Browse files Browse the repository at this point in the history
* subversion/mod_dav_svn/mod_dav_svn.c
  (dav_svn__translate_name): dav_svn_split_uri() returns an error when hitting
    the root_dir, which means SVNListParentPath doesn't work.  Delay reutrning
    the error so we can check if the repos_basename is missing for
    SVNParentPath configurations.  


git-svn-id: https://svn.apache.org/repos/asf/subversion/trunk@1541790 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
breser committed Nov 14, 2013
1 parent ce4160a commit bed9114
Showing 1 changed file with 28 additions and 8 deletions.
36 changes: 28 additions & 8 deletions subversion/mod_dav_svn/mod_dav_svn.c
Original file line number Diff line number Diff line change
Expand Up @@ -1100,7 +1100,8 @@ static int dav_svn__handler(request_rec *r)
* that %f in logging formats will show as "svn:/path/to/repo/path/in/repo". */
static int dav_svn__translate_name(request_rec *r)
{
const char *fs_path, *repos_basename, *repos_path;
const char *fs_path, *repos_path;
const char *repos_basename = NULL;
const char *ignore_cleaned_uri, *ignore_relative_path;
int ignore_had_slash;
dav_error *err;
Expand All @@ -1111,20 +1112,39 @@ static int dav_svn__translate_name(request_rec *r)
return DECLINED;

/* Retrieve path to repo and within repo for the request */
if ((err = dav_svn_split_uri(r, r->uri, conf->root_dir, &ignore_cleaned_uri,
&ignore_had_slash, &repos_basename,
&ignore_relative_path, &repos_path)))
{
dav_svn__log_err(r, err, APLOG_ERR);
return HTTP_INTERNAL_SERVER_ERROR;
}
err = dav_svn_split_uri(r, r->uri, conf->root_dir, &ignore_cleaned_uri,
&ignore_had_slash, &repos_basename,
&ignore_relative_path, &repos_path);

if (conf->fs_parent_path)
{
if (err)
{
if (!repos_basename)
{
/* detect that there is no repos_basename. We can't error out
* here due to this because it would mean that SVNListParentPath
* wouldn't work. So set things up to just use the parent path
* as our bogus path. */
repos_basename = "";
repos_path = NULL;
}
else
{
dav_svn__log_err(r, err, APLOG_ERR);
return err->status;
}
}
fs_path = svn_dirent_join(conf->fs_parent_path, repos_basename,
r->pool);
}
else
{
if (err)
{
dav_svn__log_err(r, err, APLOG_ERR);
return err->status;
}
fs_path = conf->fs_path;
}

Expand Down

0 comments on commit bed9114

Please sign in to comment.