Creating directories is a lesser citizen in Samba and the VFS ...
realrichardsharpe at gmail.com
Thu Feb 19 07:40:11 MST 2015
On Thu, Feb 19, 2015 at 1:45 AM, Volker Lendecke
<Volker.Lendecke at sernet.de> wrote:
> On Wed, Feb 18, 2015 at 08:09:52PM -0800, Richard Sharpe wrote:
>> 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.
> If you ask me, I'd prefer the second solution. With a very
> brief look at open_directory and open_file_ntcreate my
> impression is that we need to merge the two more.
OK, I will put some thought into the second approach.
More information about the samba-technical