Creating a VFS backend

Jeremy Allison jra at samba.org
Mon Aug 17 17:12:34 UTC 2020


On Wed, Aug 12, 2020 at 02:10:47PM -0700, Matthew DeVore via samba-technical wrote:
> Fortunately I was able to figure this out because of a private reply
> (which I only just now realized was private). The salient advise of
> that reply was to set the debuglevel to 10 and look for
> STATUS_NOT_IMPLEMENTED in the log output. After I did that, I manually
> traced some code path from the log message to see it was attempting to
> invoke createfile. I didn't instrument or log createfile calls at all,
> but had them return NOT_IMPLEMENTED, because I thought createfile only
> referred to making a file on disk. But that's actually used to open
> files as well. So after I replaced my createfile function pointer with
> NULL in my struct vfs_fn_pointers, my backend's get_dos_attributes fn
> got invoked, since the default implementation of createfile does that,
> apparently, when a file is being opened. So I'll proceed by
> implementing get_dos_attributes.

Yes, CreateFile is modelled after the Win32 CreateFile() API
call, which is the generic call to open any object (IPC pipes
as well as files and directories). Clients will be unhappy if
SMB_VFS_CREATEFILE() returns NOT_IMPLEMENTED :-).



More information about the samba-technical mailing list