VFS version error
sm25541994 at gmail.com
Mon Mar 2 07:02:52 MST 2015
Thank you, the ways you said works fine. I was working with
when i execute skel_transparent , open call executes more than no of times
the file has been opened.
But i suppose it should be executed only once when one file is opened. So,
why are so many open calls getting executed using vfs?
or Am I getting the context of open call wrong?
Sorry for inconvenience.
On Sat, Feb 28, 2015 at 3:59 PM, Richard Sharpe <realrichardsharpe at gmail.com
> On Sat, Feb 28, 2015 at 6:49 AM, Richard Sharpe
> <realrichardsharpe at gmail.com> wrote:
> > On Fri, Feb 27, 2015 at 11:11 PM, Sharayu Mantri <sm25541994 at gmail.com>
> >> Sir,
> >> I want to intercept vfs open, close, opendir, mkdir and other calls. I
> >> understand the need of multi-threading. So , i want start with
> >> skel_transparent.
> > OK, having looked at the two modules I now understand.
> > You took a demo module I wrote years ago and have now got that to work
> > on Samba 3.6.3. That uses multi-threading, but it is not what you want
> > to do.
> > Then you took the transparent skelaton and tried to use that as a
> > starting point for your own module and that has a symbol problem.
> > The only big difference I can see is that the init function is not
> > declared before it is used.
> > How did you build the module?
> > You might be better off to start with the instructions on the Wiki and
> > construct a module from scratch rather than use the skelaton one. I am
> > pretty sure there are no automatic tests to ensure it still works.
> > Also, you are working with Samba 3.6.x which none of the developers
> > work with these days.
> >> You said the symbol should be changed. I don't understand. Can you
> >> please?
> 1. I would suggest that you start from scratch and only implement one
> of the VFS functions that simply has a DEBUG statement in it (so you
> can see that it has been called when looking at the log) and calls
> SMB_VFS_NEXT_<fn> (whatever function you are implementing.)
> 2. Be careful how you build. If you look in Makefile.in in
> examples/VFS for 3.6.x you will see that when it compiles the module
> it does -D$*_init=init_samba_module.
> That is, it is changing the actual name of the function
> <module_name>_init to init_samba_module. The reason for this is that
> VFS modules have to be able to function as statically linked code and
> as dynamically linked from dl_open. If it is a .so that is linked with
> dl_open, there has to be a standard symbol (well, not really, I guess.
> We could have used snprintf to construct the symbol ...) which is
> init_samba_module, but in the code we call it
> vfs_skel_transparent_init. Herein lies the problem. The example is
> broken, and no one has noticed until now.
> The file that it lives in is called skel_transparent.c and the
> Makefile.in (when converted to Makefile) uses that name and does
> -Dskel_transparent_init=init_samba_module which is not the name of the
> symbol in the file.
> There are two ways to fix this:
> 1. rename skel_transparent.c to vfs_skel_transparent.c
> 2. Change the code to have that function called skel_transparent_init.
> However, you should really think about what you want to do because
> Samba 3.6 is not getting any further development and is several years
> old. You would be better off working with Samba 4.1.x or even 4.2.0
> (which should be out soon.)
> Unfortunately, things have changed with Samba 4.x and I have not yet
> updated the Wiki page. Maybe in the next month or so.
> Richard Sharpe
More information about the samba-technical