[Samba] samba allows rename to a locked file (from linux cifs mount)

Michael Tokarev mjt at tls.msk.ru
Sat Mar 16 05:59:10 UTC 2024


Hi!

When I mount a samba share on linux (with mount -t cifs), samba correctly return
EBUSY when trying to open a file for writing which is locked by some other client.

However, I can trivially rename or (remove and create anew) such file from linux
without any restrictions.  After doing so, windows clients fail to open this
(replaced) file exactly the same way as if I replaced it behind samba's back
(on the server filesystem directly).

How to prevent rm and mv from touching a locked file?

Thanks,

/mjt



More information about the samba mailing list