arturobernalg opened a new pull request, #1258:
URL: https://github.com/apache/tomcat/pull/1258

   A depth 0 write lock on a collection does not prevent other clients from 
adding or removing its internal members. Without the lock token, PUT and MKCOL 
create new members and DELETE, MOVE and COPY remove, rename or add members of 
the locked collection.
   
   RFC 4918, section 7: "Clients MUST submit a lock-token they are authorized 
to use in any request that modifies a write-locked resource", and for 
collections this covers "any modification of an internal member URI". Section 
7.5 states that a collection write lock, "whether created with a "Depth: 0" or 
"Depth: infinity" header", protects any request that would create a new 
resource in the collection, remove an internal member URL or change the segment 
name of an internal member.
   
   `isLocked()` only considered ancestor locks with a depth greater than 0. The 
lock of the direct parent collection is now also checked, whatever its depth, 
for the requests that change its membership: PUT of a new resource, MKCOL, 
DELETE, the source of MOVE and the destination of COPY and MOVE.
   
   Tested on a local Tomcat with `LOCK /a/` and `Depth: 0`, requests sent 
without the lock token:
   
   | Request | before | after |
   |---|---|---|
   | `PUT /a/new` | 201 | 423 |
   | `MKCOL /a/sub/` | 201 | 423 |
   | `DELETE /a/m` | 204 | 423 |
   | `MOVE /a/m` to `/m2` | 201 | 423 |
   | `MOVE /a/m` to `/a/m3` | 201 | 423 |
   | `MOVE /out` to `/a/in` | 201 | 423 |
   | `COPY /out` to `/a/c` | 201 | 423 |
   | `PUT /a/m` (existing member) | 204 | 204 |
   | `PUT /a/new` with `If: </a> (<token>)` | 201 | 201 |
   
   httpd mod_dav rejects the same requests. The new test in TestWebdavServlet 
fails without the change.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to