[Samba] File locking with smbd

Gerald (Jerry) Carter jerry at samba.org
Tue Oct 26 13:01:20 GMT 2004


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Ron Cococcia wrote:

| Does smbd have the capability to lock files that it has in
| use?  Is it  possible that if it were to lock files, that
| I misconfigured/miscompiled  smbd?  I'd prefer to not use a
| kludge like popen("smbstatus") or  popen("lsof").  I might
| consider examining the last modification  timestamp on the
| file too, but I don't know if there might be other
| cases where that wouldn't work.

smbd maps Windows byte range locks onto POSIX locks.
kernel oplock support could help you find out if
the client has a lease on the file (through smbd).

I doubt you are guaranteed that the windows client
has an oplock or a byte range lock on the file you
are interested in (unless you know the client application
really well).





cheers, jerry
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFBfkqgIR7qMdg1EfYRAsJHAJ0bch1dEt0zdlN3YIdoSYPUZtda8QCgs9ZS
vplLg9Ffcrm7HNstw64S7RA=
=B2/r
-----END PGP SIGNATURE-----


More information about the samba mailing list