Grumble. By not passing an FSP into READDIR etc we make it harder for OEMs to avoid modifying Samba

Richard Sharpe realrichardsharpe at gmail.com
Mon Oct 7 16:15:39 MDT 2013


On Mon, Oct 7, 2013 at 10:49 AM, Jeremy Allison <jra at samba.org> wrote:
> On Mon, Oct 07, 2013 at 10:41:51AM -0700, Richard Sharpe wrote:
>> Hi folks,
>>
>> We want to play games in READDIR that would have been enabled at
>> OPENDIR/FDOPENDIR time by noticing certain things and adding an FSP
>> Extension that allowed us to easily detect that we are in the
>> situation we are interested in and can then play the games we want to
>> play.
>>
>> Unfortunately, there is no FSP passed into READDIR ... sigh. Not even in Master.
>
> There is a way to get there from here :-). It's ugly, but doable.
>
> vfs_readdir() takes an SMB_STRUCT_DIR *, which should have been returned
> from vfs_fdopendir(). vfs_fdopendir *does* take a fsp, and so you can
> add an associative cache inside opendir that links fsp's to SMB_STRUCT_DIR *
> pointers. The inside vfs_readdir() do the fsp lookup.

That is kind of ugly :-(

> Of course I'm happy to review any changes to the VFS for 4.2.x (going
> into master now !).

Could we pass the struct dptr_struct down one more later?

Or, could we define a callback that OPENDIR and FSOPENDIR can call, or
a void ** ptr that was passed in that these functions could provide
some state that would be handed back on READDIR requests?

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


More information about the samba-technical mailing list