You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@subversion.apache.org by br...@apache.org on 2013/11/14 03:58:39 UTC
svn commit: r1541790 - /subversion/trunk/subversion/mod_dav_svn/mod_dav_svn.c
Author: breser
Date: Thu Nov 14 02:58:39 2013
New Revision: 1541790
URL: http://svn.apache.org/r1541790
Log:
Fix the breakage of SVNListParentPath caused by the translate_name hook.
* 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.
Modified:
subversion/trunk/subversion/mod_dav_svn/mod_dav_svn.c
Modified: subversion/trunk/subversion/mod_dav_svn/mod_dav_svn.c
URL: http://svn.apache.org/viewvc/subversion/trunk/subversion/mod_dav_svn/mod_dav_svn.c?rev=1541790&r1=1541789&r2=1541790&view=diff
==============================================================================
--- subversion/trunk/subversion/mod_dav_svn/mod_dav_svn.c (original)
+++ subversion/trunk/subversion/mod_dav_svn/mod_dav_svn.c Thu Nov 14 02:58:39 2013
@@ -1100,7 +1100,8 @@ static int dav_svn__handler(request_rec
* 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;
@@ -1111,20 +1112,39 @@ static int dav_svn__translate_name(reque
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;
}