How to turn O_RDWR opened file to O_RDONLY in vfs-module?

Jiri Sasek jiri.sasek at
Mon Jan 6 08:03:14 MST 2014

Hi all,

My primary interest is to create a VFS module to emulate WORM (Write 
Once Read Many) on Samba share. My idea is to set the O_RDONLY on 
already existing files. Put it into <worm>_open() VFS-call so in case if 
the "(int) flags" (4-th parameter) is set to O_RDWR then set the file as 
read-only and leave the job on the local filesystem which will disallow 
the further write() ops.

Is here anyone who knows the Samba internals and can point me to 
appropriate struct/call?

Many thanks in advance,


More information about the samba-technical mailing list