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