Creating directories is a lesser citizen in Samba and the VFS ...

Jeremy Allison jra at samba.org
Wed Feb 18 22:24:47 MST 2015


On Wed, Feb 18, 2015 at 08:09:52PM -0800, Richard Sharpe wrote:
> Hi folks,
> 
> I notice that create_file_unixpath handles directories and files
> through different paths.
> 
> Files are handled through open_file_ntcreate and it is passed a newly
> created FSP which is passed all the way down to fd_open_atomic while
> directories are handled in open_directory, which is expected to create
> an FSP and hand it back.
> 
> open_directory does not create the FSP before calling mkdir_internal
> so it is very hard for a VFS module to tag directories FSPs with an
> FSP extension.
> 
> One way I can think to improve this might be to allow mkdir_internal
> to return, via a parameter, an FSP extension. This could be added as
> an additional parameter to the SMB_VFS_MKDIR VFS function.
> 
> Does that sound like a reasonable way to provide the ability to tag
> directories at create time? The alternative would be to create the FSP
> before mkdir_internal is called and pass the FSP down the line.

This is historical - mkdir_internal was originally
created for the SMB1 mkdir call which doesn't use
open fsp's.

Would be good to rework this as an fsp-based interface,
then port the old SMB1 code on top to use it.


More information about the samba-technical mailing list