CVS update: samba/source/rpc_client

Tim Potter tpot at
Mon Nov 9 23:29:29 GMT 1998

> But as Andrew said, I'd like to take a look at it also.

OK.  I've uploaded my source directory to ~tpot/samba so that people can
take a look.

A quick overview: I've added a struct vfs_ops to the connection struct in
smb.h which defines a file descriptor i/o interface similar to the
smbwrapper stuff.  There's also a connect and disconnect hook which are
run when a service is connected to and disconnected from respectively. 
Use the newly added "vfs object" parameter in smb.conf to specify the
object file containing the vfs back end functions for a particular share
(just wondering whether this could be made global to apply to all shares). 
They are dynamically loaded using the -ldl library (added to
but I just remembered the code isn't #ifdef'ed so if you don't have -ldl
it won't compile - oops).  Take a look at source/smbd/vfs.c for the code
for this.  Does anyone have any hints for debugging code loaded
dynamically by dlopen() with gdb?  It's turned out to be a bit of a hassle
but it's pretty neat not having to recompile/relink samba when making

All (excluding bugs of course) i/o on the served file handles has been
changed to use the vfs interface.  A number of functions have been
renamed, modified to take either a connection_struct or a files_struct as
extra parameters, and moved to vfs.c.  

An example filesystem is in source/vfs/dummyfs.c which implements most of
a "virtual" filesystem contained wholly in memory.  All writes are sunk
and reads return dummy data.  There are still quite a few deficiencies in
this still - it's actually quite hard to implement most of the UNIX i/o
interface externally.  File sizes are not implemented and no locking is
done either.  I seem to be spending more time debugging this then actually
doing real samba stuff.  I initially wrote this for testing purposes but
it would be nice if it was a "worked example" of an external filesystem.

Anyway, enjoy and I will appreciate any comments and appreciate even more
any problems people can see and/or fix.  (-:


> Cheers,
> 	Jeremy.
> -- 
> --------------------------------------------------------
> Buying an operating system without source is like buying
> a self-assembly Space Shuttle with no instructions.
> --------------------------------------------------------

More information about the samba-technical mailing list