-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Open
Labels
Description
Steps to reproduce
- admin creates folders
parentandparent/child - admin created files
parent/parent.txtandparent/child/child.txt - admin creates a public share for folder
parent - public tries to lock folder
childusing new webdav api endpoint version
curl -kv -XLOCK -uDPTMsy4r2TtFBpN: http://localhost/core/remote.php/dav/public-files/DPTMsy4r2TtFBpN/child --data \
'<?xml version='1.0' encoding='UTF-8'?>
<d:lockinfo xmlns:d='DAV:'>
<d:lockscope>
<d:exclusive/>
</d:lockscope>
</d:lockinfo>' | xmllint --format -
Expected behaviour
the response should be:
HTTP/1.1 405 Method Not Allowed
<?xml version="1.0" encoding="utf-8"?>
<d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns">
<s:exception>Sabre\DAV\Exception\MethodNotAllowed</s:exception>
<s:message>Locking not allowed from public endpoint</s:message>
</d:error>
Actual behaviour
but the response is:
< HTTP/1.1 403 Forbidden
<?xml version="1.0" encoding="utf-8"?>
<d:error xmlns:d="DAV:" xmlns:s="http://sabredav.org/ns">
<s:exception>Sabre\DAVACL\Exception\NeedPrivileges</s:exception>
<s:message>User did not have the required privileges ({DAV:}write-content) for path "public-files/DPTMsy4r2TtFBpN/child"</s:message>
<d:need-privileges>
<d:resource>
<d:href>/core/remote.php/dav/public-files/DPTMsy4r2TtFBpN/child</d:href>
<d:privilege>
<d:write-content/>
</d:privilege>
</d:resource>
</d:need-privileges>
</d:error>
Note: this issue does not persist on files of pubic share but only on the subfolders in the public share in new webdav api version
Server configuration
Operating system: ubuntu
Database: mysql
PHP version: 7.4
ownCloud version: ownCloud 10.13.0 prealpha (git)