> In particular I am looking at a machine running Linux exporting its
> local filesystem using Samba, with a Windows client accessing the
> file share. If I use byte range locking (fcntl() on Linux, LockFile()
> on Windows) things work as expected, and applications using the
> file system locally and remotely see the locks set by the other.


> However, if a program on the Windows client opens a file with a
> share mode that denies access to other processes, I can't seem to
> detect this in a local Linux process, either with fcntl() or with flock().
> I included the test programs I used below. I have seen references
> that this should be possible
> (http://lists.samba.org/archive/samba...ry/080455.html
> last paragraph) but I may be misunderstanding things.


There seems to be a library for accessing Samba's database of share modes
in the Samba source tree (for version 3.0.28). The relevant files are

../bin/libsmbsharemodes.so
../bin/libsmbsharemodes.a
../include/smb_share_modes.h
../libsmb/smb_share_modes.c
../libsmb/smb_share_modes.o

On the other hand, it doesn't appear to be possible to use local system
calls to detect share modes because their semantics are too different from
file locks, see threads below.

http://lists.samba.org/archive/samba...ct.html#130305
http://lists.samba.org/archive/samba...ead.html#39425

Peter
--
To unsubscribe from this list go to the following URL and read the
instructions: https://lists.samba.org/mailman/listinfo/samba