Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

files cannot be deleted using only the fileId #6736

Closed
individual-it opened this issue Jul 7, 2023 · 2 comments
Closed

files cannot be deleted using only the fileId #6736

individual-it opened this issue Jul 7, 2023 · 2 comments
Labels

Comments

@individual-it
Copy link
Member

Describe the bug

A lot of file-operations can be done by only knowing the fileId. E.g

  • PROPFIND
  • PUT
  • MOVE

but its impossible to delete a file only by the fileId

Steps to reproduce

Steps to reproduce the behavior:

  1. create a file in any folder
  2. get the fileId of the file
  3. try a PROPFIND using that fileId. e.g. curl -uadmin:admin -k 'https://localhost:9200/remote.php/dav/spaces/33c9baa8-450f-4873-a049-7beb8227face$136ffc9b-d317-4219-a0c3-084d5e070c60!0b8eff1a-8401-4bda-a7e7-8333e44e4ded' -XPROPFIND
  4. try to DELETE the file using the fileId: curl -uadmin:admin -k 'https://localhost:9200/remote.php/dav/spaces/33c9baa8-450f-4873-a049-7beb8227face$136ffc9b-d317-4219-a0c3-084d5e070c60!0b8eff1a-8401-4bda-a7e7-8333e44e4ded' -XDELETE

Expected behavior

File should be deleted

Actual behavior

confusing error message is shown:

<?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>deleting spaces via dav is not allowed</s:message></d:error>

Setup

Please describe how you started the server and provide a list of relevant environment variables or configuration files.

PROXY_ENABLE_BASIC_AUTH=true ocis/bin/ocis server

@kobergj
Copy link
Collaborator

kobergj commented Jul 7, 2023

The webdav delete handler expects a relative path since cs3org/reva#2828 This was probably an easy way to block deleting spaces via dav.

Even though I have written it it doesn't seem right to me any more. We should accept ids as for the other endpoints. We should still block deleting spaces via dav but we need another way to identify them

@nirajacharya2
Copy link
Contributor

duplicate of #9619

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants