[Samba] How do I lock a shared file?

Volker Lendecke Volker.Lendecke at SerNet.DE
Thu Sep 5 06:14:00 MDT 2013


On Thu, Sep 05, 2013 at 02:08:27PM +0200, steve wrote:
> > This is a feature of the SMB protocol that a client can
> > explicitly request. It's called share modes. There is no
> > option where you can enable this for all open files. This
> > would not make sense, as very often a single client opens a
> > file more than once simultaneously.
> > 
> > What is your exact use case for this feature?
> > 
> School classes often have projects with files that many students will
> need to edit. We are surprised that there is no way for a user to find
> out if a file is already open. It causes chaos for us unless we do all
> our work in LibreOffice.

Your clients are Linux? Well, indeed there is no good
support for locking files across applications. If your
clients are Windows then that should work fine, Windows
traditionally was better at that.

Linux programs like vim do it on their own, like many
editors do. But many programs don't do that well. That's why
version control systems like git and all the other ones
exist. Certainly overkill for 6-year-olds, but it allows
more parallel work.

Also, nobody forces applications to keep files open while
they are edited. For example even some Windows native editor
(I don't remember which) loads files into memory and closes
the file until saving.

Volker

-- 
SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
phone: +49-551-370000-0, fax: +49-551-370000-9
AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen
http://www.sernet.de, mailto:kontakt at sernet.de

*****************************************************************
visit us on it-sa:IT security exhibitions in Nürnberg, Germany
October 8th - 10th 2013, hall 12, booth 333
free tickets available via code 270691 on: www.it-sa.de/gutschein
******************************************************************


More information about the samba mailing list