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

Users can unlock foreign locks in groupfolders #170

Closed
susnux opened this issue Sep 27, 2023 · 9 comments
Closed

Users can unlock foreign locks in groupfolders #170

susnux opened this issue Sep 27, 2023 · 9 comments
Labels
0. Needs triage bug Something isn't working

Comments

@susnux
Copy link
Contributor

susnux commented Sep 27, 2023

See #169

But for this one it is a bug, as their is no real owner of the files.
The reason for this bug is still the same, but for groupfolders we should not assume any member a owner and allow them to unlock, but only the managers.

@susnux susnux added bug Something isn't working 0. Needs triage labels Sep 27, 2023
@Rello
Copy link

Rello commented Sep 27, 2023

was introduced here
#140

@susnux
Copy link
Contributor Author

susnux commented Sep 27, 2023

As i wrote in the on the linked issue, this makes sense for user shares.
But for group folders it is weird.

@max-nextcloud
Copy link
Collaborator

Fixed by #171

@vincib
Copy link

vincib commented Nov 28, 2023

Hi. I'd like to reopen this one :
we have a NC 27.1.4 using files_lock 27.0.2 and we have the following issue :

  • on a groupfolder
  • user A is locking a file
  • user B try to lock the file
  • user B get a message :
            "status": "failure",
            "statuscode": 423,
            "message": "File is currently locked by <email of user A>"

@vincib
Copy link

vincib commented Nov 28, 2023

FYI, I have the following in the oc_files_lock table:

MariaDB@cloud1 [cloud8]> select * from oc_files_lock where file_id=1946631;
+------+----------------------------------+---------+-------------------------------------------------+------------+------+-------+-----+-------+
| id   | user_id           | file_id | token                                           | creation   | type | scope | ttl | owner |
+------+----------------------------------+---------+-------------------------------------------------+------------+------+-------+-----+-------+
| 6393 | <email of user A> | 1946631 | files_lock/d438f017-95d8-402a-83be-47952d7f8e34 | 1701179522 |    0 |     0 |   0 |       |

and we are using redis as distributed / local & lock storage.

@max-nextcloud
Copy link
Collaborator

user B get a message : "File is currently locked by "

Sounds like the intended behavior to me. This issue was about user B being able to unlock the file despite it being locked by user A.

My impression is that there are a lot of different expectations as to how locks should behave. What's the behavior you would expect @vincib ?

@susnux
Copy link
Contributor Author

susnux commented Dec 5, 2023

Sounds like the intended behavior to me.

I agree I would also expect this behavior as the file is already locked

@camlafit
Copy link

camlafit commented Dec 8, 2023

Hello

I think @vincib has miss an information, B try also to unlock the file. This user could be admin and same error occurs.
In this case behavior expected should be to unlock the file.

@camlafit
Copy link

Hello

We have continue to investigate.
This touble looks occurred when user A has only read permission. With desktop client locks looks applied anyway.
Lock is not removed and block next user B with write permission.

Thanks a lot

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0. Needs triage bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants