Ulrik Guenther
2005-Jun-11 12:49 UTC
[Samba] Very strange problems with file locking and Samba 3.0.14
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi everyone, at office, we have very strange problems with file locking. At first, I have to say that we have many different flavours of Windows running here as clients, it reaches from Windows 98 up to Windows XP Home Edition/Professional Edition. The following problem mainly exists with software like AutoCAD (LT 95/2000, 2000, 2003, 2005) and Microsoft Office (95, 97, 2000, XP): When one client opens a file for writing, lets say an AutoCAD drawing (*.dwg), Samba sets a DENY_WRITE on that file, sometimes with an oplock, depending on the client system, the output of smbstatus -L is the following: Locked files: Pid DenyMode Access R/W Oplock Name - -------------------------------------------------------------- 40526 DENY_WRITE 0x2019f RDWR NONE /path/to/ data/somedrawing.dwg Sat Jun 11 14:05:58 2005 After that, a second client (with different username, maybe different group) opens the same file with the same or a different version of the same program, after that, the output of smbclient -L is the following: Locked files: Pid DenyMode Access R/W Oplock Name - -------------------------------------------------------------- 40389 DENY_WRITE 0x3 RDWR NONE /path/to/data/ somedrawing.dwg Sat Jun 11 14:06:02 2005 As you can see, the lock has switched the owner, which should not occur. Additionally, the Access Mode has changed from 0x2019f to 0x3, whatever this means (I'm not too deep into SMB techs). The outcome of this whole procedure is, that data is *lost* (one client opens a file, changes it, second client opens while first is working, first client saves, second client saves too, work of first client is lost, etc...). What we wish to have is that p.e. AutoCAD says - when a second client tries to open a file which has already been opened by another client - "this file is already being edited. Cannot open for writing. Open read-only?". Does anyone have a clue why this is happening? I think it is a really strange behaviour, since under old NT4, it worked. Please help, we already lost a good bunch of data due to this problem named above :( Thanks anyone for listening; the smb.conf is attached to this mailing! Best regards, Ulrik Guenther ====smb.conf of server: [global] netbios name = SERVER1 workgroup = WORKGROUP server string = LDAP PDC ldap passwd sync = yes passdb backend = ldapsam:ldap://127.0.0.1/ ldap admin dn = cn=Manager,dc=workgroup,dc=local ldap suffix = dc=workgroup,dc=local ldap group suffix = ou=Groups ldap user suffix = ou=Users ldap machine suffix = ou=Computers syslog = yes log file = /data/samba/log/samba.log os level = 65 preferred master = yes domain master = yes local master = yes security = user encrypt passwords = yes domain logons = yes logon path = \\SERVER1\profiles\%U logon drive = H: logon home = \\SERVER1\homes\%U logon script = netlogon.bat add user script = /usr/local/sbin/smbldap-useradd -m "%u" ldap delete dn = yes add machine script = /usr/local/sbin/smbldap-useradd -w "%u" add group script = /usr/local/sbin/smbldap-groupadd -p "%g" add user to group script = /usr/local/sbin/smbldap-groupmod -m "% u" "%g" delete user from group script = /usr/local/sbin/smbldap-groupmod - x "%u" "%g" set primary group script = /usr/local/sbin/smbldap-usermod -g "% g" "%u" dos charset = 850 mangling method = hash2 mangling char = ~ mangle prefix = 6 display charset = ISO8859-1 unix charset = ISO8859-1 admin users = Administrator printcap name = cups load printers = yes [printers] comment = Drucker printing = CUPS printable = yes create mask = 0600 path = /data/printers browseable = yes guest ok = yes [netlogon] path = /data/netlogon comment = Network Logon Service read only = yes write list = @"Domain Admins" browseable = no guest ok = yes [profiles] comment = Nutzerprofile path = /data/profiles read only = no browseable = no create mask = 0664 directory mask = 0775 profile acls = Yes guest ok = yes force user = %U valid users = %U @"Domain Admins" [homes] comment = Dateien von %U (%u) read only = no create mask = 0644 directory mask = 0775 browseable = no [Programme] path = /data/shares/programme comment = Programme read only = no create mask = 0644 directory mask = 0775 browseable = yes guest ok = yes [Daten] path = /data/shares/daten comment = Daten read only = no create mask = 0664 directory mask = 0775 browseable = yes guest ok = no valid users = %U @"Domain Users" @"Domain Admins" oplocks = no [Admin] path = /data/shares/admin comment = administrative Freigabe read only = no create mask = 0644 directory mask = 0775 browseable = yes guest ok = no valid users = %U @"Domain Admins" force group = "Domain Admins" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.1 (Darwin) iD8DBQFCqt23y06DkvPH780RAv9iAJ0dzPcwXZwuOhbtp5ZlRUmkHQGGGACggFTI VgC1gZzuFQ7iSD0xXiPKw7w=hp0w -----END PGP SIGNATURE-----