Michael Tokarev
2024-Mar-16 13:18 UTC
[Samba] samba allows rename to a locked file (from linux cifs mount)
16.03.2024 16:06, Ralph Boehme wrote:> On 3/16/24 06:59, Michael Tokarev via samba wrote: >> How to prevent rm and mv from touching a locked file? > > cf man smb.conf "kernel share modes" and > > git diff d40f57321a12~9..d40f57321a12Hello Ralph! I'm not sure we understand each other here. Yes I'm aware of "kernel share modes" and turning off support of these by default. I never bothered to find where exactly it has been removed. But I'm talking - hopefully - about something very different. With "kernel share modes", it is the host kernel (on top of which samba accesses files for the clients) is doing the concurrency checks. This does not work because kernel does not support this anymore. So I'm trying to go exactly the opposite route: I'm mounting a samba share on linux (with cifs, see $subject). So it is now samba who should prevent concurrent access, on top of whatever filesystem it uses, - exactly the same way as it does for windows clients. For one, a windows client can not remove a locked file from a samba-exported share. However, when linux tries to remove a locked file from a samba-exported share, samba allows it to do that, despite it knows the file is locked. This operation should not depend on the kernel share modes or kernel locking at all, it is solely within samba, - one client has this file locked, another client removes this file and should receive an error. Exactly the same this is done by samba when (linux) client is trying to open a locked file in write mode - it receives EBUSY error from samba, without "kernel share modes". What I'm missing? Thanks, /mjt
Ralph Boehme
2024-Mar-16 17:11 UTC
[Samba] samba allows rename to a locked file (from linux cifs mount)
On 3/16/24 14:18, Michael Tokarev wrote:> So I'm trying to go exactly the opposite route: I'm mounting a samba > share on linux (with cifs, see $subject).ah, missed that. Had read it as if you were acting on the Samba server directly. This smells like "strict rename" isn't enabled ? it isn't by default. -slow -------------- next part -------------- A non-text attachment was scrubbed... Name: OpenPGP_signature.asc Type: application/pgp-signature Size: 840 bytes Desc: OpenPGP digital signature URL: <http://lists.samba.org/pipermail/samba/attachments/20240316/3ee32a2c/OpenPGP_signature.sig>
Possibly Parallel Threads
- samba allows rename to a locked file (from linux cifs mount)
- samba allows rename to a locked file (from linux cifs mount)
- samba allows rename to a locked file (from linux cifs mount)
- samba allows rename to a locked file (from linux cifs mount)
- samba allows rename to a locked file (from linux cifs mount)