[Samba] locks directory over nfs

Alon Shalita shalitaa at tau.ac.il
Thu Feb 26 14:40:31 GMT 2004


Hello.

In our samba configuration, the lock directory is located on an NFS mount.
It seems that for some reason this causes many problems:
Some applications fail to save files properly (eg matlab), some applications
fail to print (eg acrobat reader), and each time those application fail,
we got a message on the log saying

[2004/02/16 10:19:35, 0] tdb/tdbutil.c:tdb_log(724)
  tdb(/usr/local/lib/samba-3.0.1/var/locks/locking.tdb): expand_file ftruncate to 8192 failed (Permission denied)

(for file problems)

and

[2004/02/19 15:42:23, 0] tdb/tdbutil.c:tdb_log(724)
  tdb(/usr/local/lib/samba-3.0.1/var/locks/printing/hpcs.tdb): expand_file ftruncate to 73728 failed (Permission denied)

(for the print problem).

The premission on those files are 755, with owner of root (the server
runs as root). The nfs server where the files are located premit root
to accesss files as root (has no_root_squash).

When tring exactly the same configuration on a local disk (I just copied
the locking directory to a local direcotry, and did mount --bind) -
no errors on the log, and all operations go well.

After doing some strace on the code, we saw the smbd is trying to change
the locking.tdb file when running in user permissions. Our guess is that
the server opens the file when running as root, switch to the calling
user (setuid) and then accesses the file again. This works fine with a
local disk but not with NFS where permissions are checked on every access.

We saw this behavior on samba 3.0.1 and 3.0.2a, on i386 linux machine.

Is it a bug in samba ? 

Thanks,
Alon


More information about the samba mailing list