altarch-user / rpms / httpd

Forked from rpms/httpd 2 years ago
Clone

Blame SOURCES/httpd-2.4.6-r1507681+.patch

008793
# ./pullrev.sh 1507681 1533447
008793
008793
https://bugzilla.redhat.com/show_bug.cgi?id=1004046
008793
008793
http://svn.apache.org/viewvc?view=revision&revision=1507681
008793
http://svn.apache.org/viewvc?view=revision&revision=1533447
008793
008793
--- httpd-2.4.6/modules/dav/main/mod_dav.c
008793
+++ httpd-2.4.6/modules/dav/main/mod_dav.c
008793
@@ -2756,7 +2756,7 @@
008793
      * The multistatus responses will contain the information about any
008793
      * resource that fails the validation.
008793
      *
008793
-     * We check the parent resource, too, since this is a MOVE. Moving the
008793
+     * We check the parent resource, too, if this is a MOVE. Moving the
008793
      * resource effectively removes it from the parent collection, so we
008793
      * must ensure that we have met the appropriate conditions.
008793
      *
008793
@@ -2765,7 +2765,9 @@
008793
      */
008793
     if ((err = dav_validate_request(r, resource, depth, NULL,
008793
                                     &multi_response,
008793
-                                    DAV_VALIDATE_PARENT
008793
+                                    (is_move ? DAV_VALIDATE_PARENT
008793
+                                             : DAV_VALIDATE_RESOURCE
008793
+                                               | DAV_VALIDATE_NO_MODIFY)
008793
                                     | DAV_VALIDATE_USE_424,
008793
                                     NULL)) != NULL) {
008793
         err = dav_push_error(r->pool, err->status, 0,
008793
--- httpd-2.4.6/modules/dav/main/util.c
008793
+++ httpd-2.4.6/modules/dav/main/util.c
008793
@@ -954,13 +954,16 @@
008793
         /*
008793
         ** For methods other than LOCK:
008793
         **
008793
-        ** If we have no locks, then <seen_locktoken> can be set to true --
008793
+        ** If we have no locks or if the resource is not being modified
008793
+        ** (per RFC 4918 the lock token is not required on resources
008793
+        ** we are not changing), then <seen_locktoken> can be set to true --
008793
         ** pretending that we've already met the requirement of seeing one
008793
         ** of the resource's locks in the If: header.
008793
         **
008793
         ** Otherwise, it must be cleared and we'll look for one.
008793
         */
008793
-        seen_locktoken = (lock_list == NULL);
008793
+        seen_locktoken = (lock_list == NULL
008793
+                          || flags & DAV_VALIDATE_NO_MODIFY);
008793
     }
008793
 
008793
     /*
008793
--- httpd-2.4.6/modules/dav/main/mod_dav.h
008793
+++ httpd-2.4.6/modules/dav/main/mod_dav.h
008793
@@ -1297,6 +1297,9 @@
008793
                                            the 424 DAV:response */
008793
 #define DAV_VALIDATE_USE_424    0x0080  /* return 424 status, not 207 */
008793
 #define DAV_VALIDATE_IS_PARENT  0x0100  /* for internal use */
008793
+#define DAV_VALIDATE_NO_MODIFY  0x0200  /* resource is not being modified
008793
+                                           so allow even if lock token
008793
+                                           is not provided */
008793
 
008793
 /* Lock-null related public lock functions */
008793
 DAV_DECLARE(int) dav_get_resource_state(request_rec *r,