[Samba] File locking with different (client) platforms

Andreas Albrecht andreas at aalbrecht.de
Sat Mar 15 10:03:17 GMT 2003


I have a problem with file locking on different platforms.
System environment:
Samba Server 2.2.3.a on Red Hat 7.3
Some Windows 2000 Clients with MS-Office 2000 and OpenOffice 1.0.1
Some Red Hat 8.0 Clients with Open Office 1.0.1

The Linux Clients mounts the Samba Shares with smbmount:
smbmount //<Server/shares> $HOME/path -o 
credentials=<file>,ip=<ip>,debug=0,workgroup=<name>,port=139,iocharset=8859-15

Working only with Windows clients is ok. If they open a document, the 
file is locked for other users in network.
On Samba Server Status (Swat) open files are visible:
Sharing-DenyNone, Read/Write, No Oplock (Winword), Excl.+Batch Oplock 
(OOWriter)

Working with OOWriter on Linux Workstation shows the following:
Sharing-DenyNone, Read/Write, No Oplock (OOWriter)

In practice file locking by opening the same document (on Samba-Server) 
between Winword and OpenOffice is working good.
Working with OO on both sides (Linux and Windows) is also ok.

But there is no file locking if someone opens a document with Word on 
Windows and then with OO on Linux or the other way round!

/proc/locks on SERVER shows the following by opening a document:
Winword (Windows Client):
POSIX ADVISORY WRITE 12115 08:02:162885 ...
POSIX ADVISORY WRITE 12115 08:02:162885 ...
POSIX ADVISORY WRITE 12115 08:02:162885 ...
OOwriter (Windows Client):
LEASE MANDATORY WRITE 12115 08:02:162885 ...
FLOCK MSNFS READ 12115 08:02:162885 ...
OOWriter (Linux Client): No entry !!!!!

Here I found an entry in the local /proc/locks on the Linux CLIENT (!):
OOWriter (Linux Client):
POSIX ADVISORY WRITE 2251 00:0e:19 ...


Is this a (logical) bug? Opening an with smbmount mounted file on a 
samba share, locks only in local filesystem, but not files on server?

Is there another way to work with inhomogenous environments?

Thank you
Andreas


Appendix: An extract from my smb.conf.

  [global]
	workgroup = XY
	netbios name = BS01
	server string = XY
	encrypt passwords = Yes
	passwd program = /usr/bin/passwd %u
	passwd chat = *New*password* %n\n *Retype*new*password* %n\n 
*passwd:*all*authentication*tokens*updated*successfully*
	log file = /var/log/samba/%m.log
	max log size = 100
	deadtime = 60
	socket options = TCP_NODELAY SO_RCVBUF=8192 SO_SNDBUF=8192
	show add printer wizard = No
	character set = ISO8859-15
	logon path =
	logon home =
	domain logons = Yes
	os level = 65
	preferred master = True
	domain master = True
	dns proxy = No
	wins proxy = Yes
	wins support = Yes
	valid chars = ä:Ä ü:Ü ö:Ö ß '
	hosts allow = 192.168.0. 127.
	strict locking = Yes

[XY]
	path = /xy
	valid users = …
	read only = No
	create mask = 0777
	directory mask = 0777
	browseable = No

[Public]
	path = /xy/public
	valid users = @…
	read only = No
	create mask = 0777
	directory mask = 0777




More information about the samba mailing list