owncloud / owncloud/ocis

Folders can be locked and locking works partially

Open
#7,641 3 comments 0 reactions 0 assignees View on GitHub
Type:Bug
Dominant language
Go
Stars
2.1k
Forks
274
Avg merge
2d 1h
Merged PRs (30d)
103

Description

## Describe the bug

As per https://github.com/owncloud/ocis/issues/1284#issuecomment-1238336767 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
```console
curl -ueinstein:relativity -XLOCK "https://localhost:9200/remote.php/webdav/locked" -H "Content-Type: application/json" -d"" -vk
```
> Note that the behaviour is same for `dav` and `dav/spaces`
3. Upload a file inside the folder `locked` , this works
```console
curl -ueinstein:relativity -XPUT "https://localhost:9200/remote.php/webdav/locked/textfile.txt" -d"hello world" -vk
```
4. Create a new folder inside the locked folder i.e `locked/test`, doesn't work
```console
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`

```console
> 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
<

* Connection #0 to host localhost left intact
Sabre\DAV\Exception\Lockederror: locked by create container: error: locked by urn:uuid:7163a1d7-f88e-4cd7-bbaf-99561594f9d7%
```
Also, the folder looks like it is locked on the UI level as well

![Screenshot from 2023-11-02 10-03-08](https://github.com/owncloud/ocis/assets/41103328/2ea858cc-7634-422d-9479-78043d008ac2)

## Setup

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

```console
OCIS: dfc55c39ef167fd4cebf671a8b9e6e9cba7c1508
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.