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

Blocking open files for other users. #66

Open
bAG79 opened this issue Mar 26, 2021 · 3 comments
Open

Blocking open files for other users. #66

bAG79 opened this issue Mar 26, 2021 · 3 comments
Assignees
Labels

Comments

@bAG79
Copy link

bAG79 commented Mar 26, 2021

It is very important to block open files for other user's sessions. The SMB protocol works in a similar way. The WebDAV protocol also supports a mechanism for blocking open files. Is it possible to implement file locks or configure this lock via the config file?

@sxueck
Copy link
Contributor

sxueck commented Jun 16, 2021

#71 do you mean the lock/mutex?
i did not make too many changes to the code , the lock action behavior will only happen in file save/create...

@sxueck
Copy link
Contributor

sxueck commented Jun 16, 2021

your can see rfc4918

Although the write locks provide some help in preventing lost updates, they cannot guarantee that updates will never be lost. Consider the following scenario:
Two clients A and B are interested in editing the resource 'index.html'. Client A is an HTTP client rather than a WebDAV client, and so does not know how to perform locking.
Client A doesn't lock the document, but does a GET, and begins editing.
Client B does LOCK, performs a GET and begins editing.
Client B finishes editing, performs a PUT, then an UNLOCK.
Client A performs a PUT, overwriting and losing all of B's changes.

@hacdias hacdias added the bug label Jul 31, 2024
@hacdias
Copy link
Owner

hacdias commented Jul 31, 2024

This should indeed be fixed. The problem now is that we create a webdav.Handler per user, but we should instead do it per directory, so that they share the locks.

@hacdias hacdias self-assigned this Jul 31, 2024
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