webdav icon indicating copy to clipboard operation
webdav copied to clipboard

Blocking open files for other users.

Open bAG79 opened this issue 3 years ago • 3 comments

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?

bAG79 avatar Mar 26 '21 16:03 bAG79

#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 avatar Jun 16 '21 07:06 sxueck

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.

sxueck avatar Jun 16 '21 08:06 sxueck