]> git.ipfire.org Git - thirdparty/apache/httpd.git/commitdiff
mod_dav: Make sure that when we prepare an If URL for Etag comparison,
authorWilliam A. Rowe Jr <wrowe@apache.org>
Thu, 27 Jun 2013 16:44:56 +0000 (16:44 +0000)
committerWilliam A. Rowe Jr <wrowe@apache.org>
Thu, 27 Jun 2013 16:44:56 +0000 (16:44 +0000)
we compare unencoded paths.

PR: 53910
Submitted by: Timothy Wood <tjw omnigroup com>
Backports: r1470940, r1477530
Reviewed by: minfrin, wrowe, rjung

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.2.x@1497435 13f79535-47bb-0310-9956-ffa450edef68

CHANGES
STATUS
modules/dav/main/util.c

diff --git a/CHANGES b/CHANGES
index 0a8b573e2e84c4c760f130f436b2112a17068d14..75363d6d86655e8edc685354f63f496dfffe2757 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -28,6 +28,9 @@ Changes with Apache 2.2.25
      to configure an IO timeout as an error in the balancer.
      [Daniel Ruggeri]
 
+  *) mod_dav: Make sure that when we prepare an If URL for Etag comparison,
+     we compare unencoded paths. PR 53910 [Timothy Wood <tjw omnigroup.com>]
+
 Changes with Apache 2.2.24
 
   *) SECURITY: CVE-2012-3499 (cve.mitre.org)
diff --git a/STATUS b/STATUS
index 5198c16dacf82c55eb050b75bbd3937b088ec766..0f0151b30a6daab79bc2c83bea42ec132e0506cf 100644 (file)
--- a/STATUS
+++ b/STATUS
@@ -96,17 +96,6 @@ RELEASE SHOWSTOPPERS:
 PATCHES ACCEPTED TO BACKPORT FROM TRUNK:
   [ start all new proposals below, under PATCHES PROPOSED. ]
   
-  * mod_dav: Make sure that when we prepare an If URL for Etag comparison,     
-    we compare unencoded paths. PR 53910 [Timothy Wood <tjw omnigroup com>]
-    trunk patch: http://svn.apache.org/r1470940
-                 http://svn.apache.org/r1477530
-    2.2.x patch: trunk patch works (minus CHANGES)
-    +1: minfrin, wrowe
-    +1: rjung (if the "rv" argument in dav_new_error() gets removed.
-               "rv" doesn't exist in the 2.2 file and the additional
-               argument also is not allowed in 2.2.x, in short:
-               trunk patch doesn't compile :( )
-
   * mod_dav: Sending a If or If-Match header with an invalid ETag doesn't
     result in a 412 Precondition Failed. PR54610
     [Timothy Wood <tjw omnigroup com>]
index 6ab880b426dbb9a339f6a61df83af46b906bde27..3fd2b86026b0da804267db023548d5fcb14088ad 100644 (file)
@@ -634,9 +634,18 @@ static dav_error * dav_process_if_header(request_rec *r, dav_if_header **p_ih)
 
             /* clean up the URI a bit */
             ap_getparents(parsed_uri.path);
+
+            /* the resources we will compare to have unencoded paths */
+            if (ap_unescape_url(parsed_uri.path) != OK) {
+                return dav_new_error(r->pool, HTTP_BAD_REQUEST,
+                           DAV_ERR_IF_TAGGED,
+                           "Invalid percent encoded URI in tagged If-header.");
+            }
+
             uri_len = strlen(parsed_uri.path);
-            if (uri_len > 1 && parsed_uri.path[uri_len - 1] == '/')
+            if (uri_len > 1 && parsed_uri.path[uri_len - 1] == '/') {
                 parsed_uri.path[--uri_len] = '\0';
+            }
 
             uri = parsed_uri.path;
             list_type = tagged;