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