Thoughts on how to communicate to VFS functions that a CREATE is occurring

Richard Sharpe realrichardsharpe at gmail.com
Sat Apr 2 21:31:43 UTC 2016


On Sat, Apr 2, 2016 at 2:05 PM, Volker Lendecke
<Volker.Lendecke at sernet.de> wrote:
> On Sat, Apr 02, 2016 at 08:00:27AM -0700, Richard Sharpe wrote:
>> Hi folks,
>>
>> There are times in VFS functions where we want to know that the
>> current call was made from a CREATE vs other paths (like
>> GET_DFS_REFERRAL etc...)
>>
>> This allows the VFS modules to do interesting things.
>>
>> We now have a flags field in the struct smb_filename structure and one
>> obvious thing we could do is to add an SMB_FILENAME_CREATE_PATH flag
>> and set it in unix_convert.
>>
>> However, this has some problems. One is that it would have to be reset
>> somewhere and secondly there are some VFS functions that are not
>> passed a struct smb_filename that might want to know we are in the
>> create path. Indeed, they might want to know whether they were called
>> for a CREATE, a GETINFO or whatever.
>>
>> Perhaps the best approach is to have a field in the VFS handle that
>> indicates what request is being processed.
>>
>> Is there an easier way to handle this?
>
> Can you describe your highlevel requirement -- why do you
> need to know this?

When you are returning DFS referals on CREATE for some directories you
do not want to return OBJECT_NOT_FOUND when the client sends you a
valid GET_DFS_REFERRAL for objects that are not redirected.

However, it is hard to know, in the VFS, why you were called, and
SMB_VFS_STAT is called in both paths.

I really want to avoid modifying Samba as much as possible.

--
Richard Sharpe
(何以解憂?唯有杜康。--曹操)



More information about the samba-technical mailing list