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 22:11:33 UTC
svn commit: r1542084 - in /subversion/branches/1.7.x: ./
subversion/mod_dav_svn/dav_svn.h subversion/mod_dav_svn/mod_dav_svn.c
subversion/mod_dav_svn/repos.c subversion/mod_dav_svn/util.c
Author: breser
Date: Thu Nov 14 21:11:33 2013
New Revision: 1542084
URL: http://svn.apache.org/r1542084
Log:
Merge the 1.7.x-r1541790 branch:
* r1541790, r1542042
Don't break SVNListParentPath
Branch: ^/subversion/branches/1.7.x-r1541790
Justification:
The fix for modules crashing breaks SVNListParentPath
Votes:
+1: breser, stefan2, philip
Modified:
subversion/branches/1.7.x/ (props changed)
subversion/branches/1.7.x/subversion/mod_dav_svn/dav_svn.h
subversion/branches/1.7.x/subversion/mod_dav_svn/mod_dav_svn.c
subversion/branches/1.7.x/subversion/mod_dav_svn/repos.c
subversion/branches/1.7.x/subversion/mod_dav_svn/util.c
Propchange: subversion/branches/1.7.x/
------------------------------------------------------------------------------
Merged /subversion/trunk:r1541790,1542042
Merged /subversion/branches/1.7.x-r1541790:r1541792-1542083
Modified: subversion/branches/1.7.x/subversion/mod_dav_svn/dav_svn.h
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x/subversion/mod_dav_svn/dav_svn.h?rev=1542084&r1=1542083&r2=1542084&view=diff
==============================================================================
--- subversion/branches/1.7.x/subversion/mod_dav_svn/dav_svn.h (original)
+++ subversion/branches/1.7.x/subversion/mod_dav_svn/dav_svn.h Thu Nov 14 21:11:33 2013
@@ -841,6 +841,12 @@ dav_svn__simple_parse_uri(dav_svn__uri_i
const char *uri,
apr_pool_t *pool);
+/* Test the request R to determine if we should return the list of
+ * repositories at the parent path. Only true if SVNListParentPath directive
+ * is 'on' and the request is for our configured root path. */
+svn_boolean_t
+dav_svn__is_parentpath_list(request_rec *r);
+
int dav_svn__find_ns(const apr_array_header_t *namespaces, const char *uri);
Modified: subversion/branches/1.7.x/subversion/mod_dav_svn/mod_dav_svn.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x/subversion/mod_dav_svn/mod_dav_svn.c?rev=1542084&r1=1542083&r2=1542084&view=diff
==============================================================================
--- subversion/branches/1.7.x/subversion/mod_dav_svn/mod_dav_svn.c (original)
+++ subversion/branches/1.7.x/subversion/mod_dav_svn/mod_dav_svn.c Thu Nov 14 21:11:33 2013
@@ -934,21 +934,35 @@ static int dav_svn__translate_name(reque
const char *fs_path, *repos_basename, *repos_path, *slash;
const char *ignore_cleaned_uri, *ignore_relative_path;
int ignore_had_slash;
- dav_error *err;
dir_conf_t *conf = ap_get_module_config(r->per_dir_config, &dav_svn_module);
/* module is not configured, bail out early */
if (!conf->fs_path && !conf->fs_parent_path)
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)))
+ if (dav_svn__is_parentpath_list(r))
{
- dav_svn__log_err(r, err, APLOG_ERR);
- return HTTP_INTERNAL_SERVER_ERROR;
+ /* SVNListParentPath is on and the request is for the conf->root_dir,
+ * so just set the repos_basename to an empty string and the repos_path
+ * to NULL so we end up just reporting our parent path as the bogus
+ * path. */
+ repos_basename = "";
+ repos_path = NULL;
}
+ else
+ {
+ /* Retrieve path to repo and within repo for the request */
+ dav_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 (err)
+ {
+ dav_svn__log_err(r, err, APLOG_ERR);
+ return err->status;
+ }
+ }
+
if (conf->fs_parent_path)
{
fs_path = svn_dirent_join(conf->fs_parent_path, repos_basename,
Modified: subversion/branches/1.7.x/subversion/mod_dav_svn/repos.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x/subversion/mod_dav_svn/repos.c?rev=1542084&r1=1542083&r2=1542084&view=diff
==============================================================================
--- subversion/branches/1.7.x/subversion/mod_dav_svn/repos.c (original)
+++ subversion/branches/1.7.x/subversion/mod_dav_svn/repos.c Thu Nov 14 21:11:33 2013
@@ -1957,26 +1957,12 @@ get_resource(request_rec *r,
/* Special case: detect and build the SVNParentPath as a unique type
of private resource, iff the SVNListParentPath directive is 'on'. */
- if (fs_parent_path && dav_svn__get_list_parentpath_flag(r))
+ if (dav_svn__is_parentpath_list(r))
{
- char *uri = apr_pstrdup(r->pool, r->uri);
- char *parentpath = apr_pstrdup(r->pool, root_path);
- apr_size_t uri_len = strlen(uri);
- apr_size_t parentpath_len = strlen(parentpath);
-
- if (uri[uri_len-1] == '/')
- uri[uri_len-1] = '\0';
-
- if (parentpath[parentpath_len-1] == '/')
- parentpath[parentpath_len-1] = '\0';
-
- if (strcmp(parentpath, uri) == 0)
- {
- err = get_parentpath_resource(r, resource);
- if (err)
- return err;
- return NULL;
- }
+ err = get_parentpath_resource(r, resource);
+ if (err)
+ return err;
+ return NULL;
}
/* This does all the work of interpreting/splitting the request uri. */
Modified: subversion/branches/1.7.x/subversion/mod_dav_svn/util.c
URL: http://svn.apache.org/viewvc/subversion/branches/1.7.x/subversion/mod_dav_svn/util.c?rev=1542084&r1=1542083&r2=1542084&view=diff
==============================================================================
--- subversion/branches/1.7.x/subversion/mod_dav_svn/util.c (original)
+++ subversion/branches/1.7.x/subversion/mod_dav_svn/util.c Thu Nov 14 21:11:33 2013
@@ -412,6 +412,32 @@ dav_svn__simple_parse_uri(dav_svn__uri_i
"Unsupported URI form");
}
+svn_boolean_t
+dav_svn__is_parentpath_list(request_rec *r)
+{
+ const char *fs_parent_path = dav_svn__get_fs_parent_path(r);
+
+ if (fs_parent_path && dav_svn__get_list_parentpath_flag(r))
+ {
+ const char *root_path = dav_svn__get_root_dir(r);
+ char *uri = apr_pstrdup(r->pool, r->uri);
+ char *parentpath = apr_pstrdup(r->pool, root_path);
+ apr_size_t uri_len = strlen(uri);
+ apr_size_t parentpath_len = strlen(parentpath);
+
+ if (uri[uri_len-1] == '/')
+ uri[uri_len-1] = '\0';
+
+ if (parentpath[parentpath_len-1] == '/')
+ parentpath[parentpath_len-1] = '\0';
+
+ if (strcmp(parentpath, uri) == 0)
+ {
+ return TRUE;
+ }
+ }
+ return FALSE;
+}
/* ### move this into apr_xml */
int