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

Folders can be locked and locking works partially #7641

Open
SwikritiT opened this issue Nov 1, 2023 · 3 comments
Open

Folders can be locked and locking works partially #7641

SwikritiT opened this issue Nov 1, 2023 · 3 comments
Labels

Comments

@SwikritiT
Copy link
Contributor

SwikritiT commented Nov 1, 2023

Describe the bug

As per #1284 (comment) ocis doesn't support locking a folder and doesn't have the plan to do so. Sending a LOCK request to the folder returns success status code and it also partially works. While a user can upload new files inside the folder, they however cannot create a new folder inside a folder that is locked.

Steps to reproduce

Steps to reproduce the behavior:

  1. As user Einstein create a folder locked
  2. Lock the folder locked, this works
curl -ueinstein:relativity -XLOCK "https://localhost:9200/remote.php/webdav/locked" -H "Content-Type: application/json" -d"<?xml version='1.0' encoding='UTF-8'?><d:lockinfo xmlns:d='DAV:'><d:lockscope><d:exclusive/></d:lockscope></d:lockinfo>" -vk 

Note that the behaviour is same for dav and dav/spaces

  1. Upload a file inside the folder locked , this works
curl -ueinstein:relativity -XPUT "https://localhost:9200/remote.php/webdav/locked/textfile.txt" -d"hello world" -vk
  1. Create a new folder inside the locked folder i.e locked/test, doesn't work
curl -u einstein:relativity -XMKCOL "https://localhost:9200/remote.php/webdav/locked/test" -vk

Expected behavior

The request should be successful. As the locking of the folder is not supported.

Actual behavior

The folder cannot be created and the request returns with 423 Locked

> MKCOL /remote.php/webdav/locked/test HTTP/1.1
> Host: localhost:9200
> Authorization: Basic ZWluc3RlaW46cmVsYXRpdml0eQ==
> User-Agent: curl/7.81.0
> Accept: */*
> 
* TLSv1.2 (IN), TLS header, Supplemental data (23):
* TLSv1.3 (IN), TLS handshake, Newsession Ticket (4):
* TLSv1.2 (IN), TLS header, Supplemental data (23):
* Mark bundle as not supporting multiuse
< HTTP/1.1 423 Locked
< Access-Control-Allow-Origin: *
< Content-Length: 278
< Content-Security-Policy: default-src 'none';
< Content-Type: text/xml; charset=utf-8
< Date: Thu, 02 Nov 2023 04:08:03 GMT
< Vary: Origin
< X-Content-Type-Options: nosniff
< X-Download-Options: noopen
< X-Frame-Options: SAMEORIGIN
< X-Permitted-Cross-Domain-Policies: none
< X-Request-Id: swikriti-OptiPlex-3070/1sUYtYpeM4-000261
< X-Robots-Tag: none
< X-Xss-Protection: 1; mode=block
< 
<?xml version="1.0" encoding="UTF-8"?>
* Connection #0 to host localhost left intact
<d:error xmlns:d="DAV" xmlns:s="http://sabredav.org/ns"><s:exception>Sabre\DAV\Exception\Locked</s:exception><s:message>error: locked by create container: error: locked by urn:uuid:7163a1d7-f88e-4cd7-bbaf-99561594f9d7</s:message></d:error>%            

Also, the folder looks like it is locked on the UI level as well

Screenshot from 2023-11-02 10-03-08

Setup

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

OCIS: dfc55c39ef167fd4cebf671a8b9e6e9cba7c1508

@SwikritiT SwikritiT changed the title Uploading new files inside a locked folder works Creating new folder inside a "locked" folder doesn't work Nov 2, 2023
@SwikritiT
Copy link
Contributor Author

Hi, @ScharfViktor I have updated this issue, if the folder is not supposed to be locked then I think this behavior as explained in the issue is a bug. Please go through this and you can close the issue if this is not relevant.

@SwikritiT SwikritiT changed the title Creating new folder inside a "locked" folder doesn't work Folders can be locked and locking works partially Nov 2, 2023
@ScharfViktor
Copy link
Contributor

I suggest:

  • create please only one test: user tries to lock folder and expect forbidden status code.
  • put to expected failures file and link with this issue
  • delete all steps related creating lock for folder

@SwikritiT
Copy link
Contributor Author

Note that the behavior is the same in public links as well. Public user can lock the folder partially as described in this issue if they have enough permission.

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

2 participants