Author: svn-role
Date: Wed Jan 15 04:04:13 2014
New Revision: 1558292

URL: http://svn.apache.org/r1558292
Log:
Merge r1557320 from trunk:

 * r1557320
   Resolve segfault while handling OPTIONS request in unusual server
   configuration.
   Justification:
     User triggerable segfaults are bad.
   Votes:
     +1: breser, rhuijben, stefan2

Modified:
    subversion/branches/1.8.x/   (props changed)
    subversion/branches/1.8.x/STATUS
    subversion/branches/1.8.x/subversion/mod_dav_svn/repos.c

Propchange: subversion/branches/1.8.x/
------------------------------------------------------------------------------
  Merged /subversion/trunk:r1557320

Modified: subversion/branches/1.8.x/STATUS
URL: 
http://svn.apache.org/viewvc/subversion/branches/1.8.x/STATUS?rev=1558292&r1=1558291&r2=1558292&view=diff
==============================================================================
--- subversion/branches/1.8.x/STATUS (original)
+++ subversion/branches/1.8.x/STATUS Wed Jan 15 04:04:13 2014
@@ -285,11 +285,3 @@ Veto-blocked changes:
 Approved changes:
 =================
 
- * r1557320
-   Resolve segfault while handling OPTIONS request in unusual server
-   configuration.
-   Justification:
-     User triggerable segfaults are bad.
-   Votes:
-     +1: breser, rhuijben, stefan2
-

Modified: subversion/branches/1.8.x/subversion/mod_dav_svn/repos.c
URL: 
http://svn.apache.org/viewvc/subversion/branches/1.8.x/subversion/mod_dav_svn/repos.c?rev=1558292&r1=1558291&r2=1558292&view=diff
==============================================================================
--- subversion/branches/1.8.x/subversion/mod_dav_svn/repos.c (original)
+++ subversion/branches/1.8.x/subversion/mod_dav_svn/repos.c Wed Jan 15 
04:04:13 2014
@@ -1971,6 +1971,25 @@ get_resource(request_rec *r,
      of private resource, iff the SVNListParentPath directive is 'on'. */
   if (dav_svn__is_parentpath_list(r))
     {
+      /* Only allow GET and HEAD on the parentpath resource
+       * httpd uses the same method_number for HEAD as GET */
+      if (r->method_number != M_GET)
+        {
+          int status;
+
+          /* Marshall the error back to the client by generating by
+           * way of the dav_svn__error_response_tag trick. */
+          err = dav_svn__new_error(r->pool, HTTP_METHOD_NOT_ALLOWED,
+                                   SVN_ERR_APMOD_MALFORMED_URI,
+                                   "The URI does not contain the name "
+                                   "of a repository.");
+          /* can't use r->allowed since the default handler isn't called */
+          apr_table_setn(r->headers_out, "Allow", "GET,HEAD");
+          status = dav_svn__error_response_tag(r, err);
+
+          return dav_push_error(r->pool, status, err->error_id, NULL, err);
+        }
+
       err = get_parentpath_resource(r, resource);
       if (err)
         return err;


Reply via email to