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

User can unlock file locked by other user in shared folders #169

Open
susnux opened this issue Sep 27, 2023 · 2 comments
Open

User can unlock file locked by other user in shared folders #169

susnux opened this issue Sep 27, 2023 · 2 comments
Labels
0. Needs triage bug Something isn't working enhancement New feature or request

Comments

@susnux
Copy link
Contributor

susnux commented Sep 27, 2023

Scenario:
User A creates a shared directory.
User B creates a file in that directory and locks the file
User A tries to unlock that file.

What happens:
The file gets unlocked without errors.

What should happen / is expected:
The file stays locked and the server returns 403. Because the lock is owned by user B.

Why does this happen
The initial test if the owner of the lock and the current user are the same, fails ✔️

if ($isSameOwner && $isSameType) {

But then the next check allows to unlock, because the file is created inside the shared directory it is owned implicitly by the sharing user, and we allow file owners always to unlock:

if ($request->getType() === ILock::TYPE_USER && $request->getNode()->getOwner()->getUID() === $this->userId) {


I am not sure if this is a feature or a bug. So probably two solutions here:

  1. Allow configure whether file owners are allowed to always unlock
  2. Document that file owners always can unlock their files and note that files in shared folders are always owned by the folder owner.
@susnux susnux added bug Something isn't working enhancement New feature or request 0. Needs triage labels Sep 27, 2023
@Rello
Copy link

Rello commented Sep 27, 2023

was introduced here
#140

@camlafit
Copy link

hello

We have some trouble I thinks related as explained at #170 (comment)

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 enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants