svn commit: samba r3737 - in branches/SAMBA_4_0/source: auth build/pidl build/smb_build lib lib/dcom lib/dcom/common lib/registry lib/registry/common lib/registry/reg_backend_dir lib/registry/reg_backend_gconf lib/registry/reg_backend_ldb lib/registry/reg_backend_nt4 lib/registry/reg_backend_rpc lib/registry/reg_backend_w95 lib/tdb libcli/auth librpc/rpc ntvfs ntvfs/cifs ntvfs/ipc ntvfs/nbench ntvfs/posix ntvfs/print ntvfs/simple ntvfs/unixuid rpc_server rpc_server/dcom rpc_server/remote smbd

tridge at samba.org tridge at samba.org
Mon Nov 15 09:44:31 GMT 2004


Metze,

 > > - Get rid of the register_subsystem() and register_backend() functions. 
 > 
 > why? there was a very good reason for adding them.

indeed.

I should probably explain for everyone why we changed quite a while
ago to register_backend() instead of having functions like
auth_register().

The problem with having subsystem specific names for registration
functions is that it makes it impossible to add a new type of
subsystem via a loadable module. 

Imagine you want to have a module that adds a 'foo' subsystem, and you
want another module that registers itself as a instance of 'foo' when
the 'foo' module is loaded. If you use foo_register() as the function
name, then the 2nd module has no way to load. If you use
regisier_backend("foo", ...) then the module can load, then get a
useful error message telling it that it cannot register as a 'foo'
instance, in which case it might decide to do the work itself, or
register itself somewhere else, or panic.

So we decided to make the register_backend() and similar functions
core functions, and to make subsystem names a constant string. That
gives us all the same functionality, but allows whole new subsystems
to be loaded as modules.

Cheers, Tridge



More information about the samba-technical mailing list