-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Open
Labels
Milestone
Description
Steps to reproduce
- lock "textfile1.txt" and "textfile2.txt"
curl -u uu1:uu1 -X LOCK "http://localhost/owncloud-core/remote.php/dav/files/uu1/textfile1.txt" -d "<?xml version='1.0' encoding='UTF-8'?><d:lockinfo xmlns:d='DAV:'> <d:lockscope><d:exclusive/></d:lockscope><d:owner>lock fom textfile1</d:owner></d:lockinfo>" | xmllint --format -
<d:locktoken>
<d:href>opaquelocktoken:f900492b-47b3-4f69-9374-9dc2c3a8779f</d:href>
</d:locktoken>
<d:owner>lock fom textfile1</d:owner>
curl -u uu1:uu1 -X LOCK "http://localhost/owncloud-core/remote.php/dav/files/uu1/textfile2.txt" -d "<?xml version='1.0' encoding='UTF-8'?><d:lockinfo xmlns:d='DAV:'> <d:lockscope><d:exclusive/></d:lockscope><d:owner>lock fom textfile2</d:owner></d:lockinfo>" | xmllint --format -
<d:locktoken>
<d:href>opaquelocktoken:95ece69c-fa1e-4faf-9c6b-8c103981d2ed</d:href>
</d:locktoken>
<d:owner>lock fom textfile2</d:owner>
- move "textfile2.txt" to "textfile1.txt" by supplying both tokens
curl -u uu1:uu1 -X MOVE "http://localhost/owncloud-core/remote.php/dav/files/uu1/textfile2.txt" -H "Destination: http://localhost/owncloud-core/remote.php/dav/files/uu1/textfile1.txt" -H "If: (<opaquelocktoken:95ece69c-fa1e-4faf-9c6b-8c103981d2ed>) (<opaquelocktoken:f900492b-47b3-4f69-9374-9dc2c3a8779f>)"
- check the lock on "textfile1.txt"
curl -u uu1:uu1 -X PROPFIND http://localhost/owncloud-core/remote.php/webdav/textfile1.txt -d "<?xml version='1.0' encoding='UTF-8'?> <d:propfind xmlns:d='DAV:'> <d:prop><d:lockdiscovery/></d:prop> </d:propfind>" | xmllint --format -
Expected behaviour
token of "textfile1.txt" is preserved
https://tools.ietf.org/html/rfc4918#section-7.6:
A successful MOVE request on a write locked resource MUST NOT move
the write lock with the resource. However, if there is an existing
lock at the destination, the server MUST add the moved resource to
the destination lock scope.
Actual behaviour
<d:locktoken>
<d:href>opaquelocktoken:95ece69c-fa1e-4faf-9c6b-8c103981d2ed</d:href>
</d:locktoken>
<d:owner>lock fom textfile2</d:owner>
</d:activelock>