Software: Apache/2.0.54 (Fedora). PHP/5.0.4 uname -a: Linux mina-info.me 2.6.17-1.2142_FC4smp #1 SMP Tue Jul 11 22:57:02 EDT 2006 i686 uid=48(apache) gid=48(apache) groups=48(apache) Safe-mode: OFF (not secure) /usr/bin/X11/./../../share/doc/samba-3.0.23a/htmldocs/Samba3-ByExample/../Samba3-Developers-Guide/ drwxr-xr-x |
Viewing file: Select action/file-type: Table of Contents The new modules system has the following advantages:
Some subsystems in samba use different backends. These backends can be either statically linked in to samba or available as a plugin. A subsystem should have a function that allows a module to register itself. For example, the passdb subsystem has: NTSTATUS smb_register_passdb(int version, const char *name, pdb_init_function init); This function will be called by the initialisation function of the module to register itself.
The modules system compiles a list of initialisation functions for the
static modules of each subsystem. This is a define. For example,
it is here currently (from /* Static init functions */ #define static_init_pdb { pdb_mysql_init(); pdb_ldap_init(); pdb_smbpasswd_init(); pdb_tdbsam_init(); pdb_guest_init();} These functions should be called before the subsystem is used. That should be done when the subsystem is initialised or first used. If a subsystem needs a certain backend, it should check if it has already been registered. If the backend hasn't been registered already, the subsystem should call smb_probe_module(char *subsystem, char *backend). This function tries to load the correct module from a certain path ($LIBDIR/subsystem/backend.so). If the first character in 'backend' is a slash, smb_probe_module() tries to load the module from the absolute path specified in 'backend'. After smb_probe_module() has been executed, the subsystem should check again if the module has been registered.
Each module has an initialisation function. For modules that are
included with samba this name is ' NTSTATUS init_module(void); This function should call one or more registration functions. The function should return NT_STATUS_OK on success and NT_STATUS_UNSUCCESSFUL or a more useful nt error code on failure. For example, pdb_ldap_init() contains: NTSTATUS pdb_ldap_init(void) { smb_register_passdb(PASSDB_INTERFACE_VERSION, "ldapsam", pdb_init_ldapsam); smb_register_passdb(PASSDB_INTERFACE_VERSION, "ldapsam_nua", pdb_init_ldapsam_nua); return NT_STATUS_OK; } Some macros in configure.in generate the various defines and substs that are necessary for the system to work correct. All modules that should be built by default have to be added to the variable 'default_modules'. For example, if ldap is found, pdb_ldap is added to this variable. On the bottom of configure.in, SMB_MODULE() should be called for each module and SMB_SUBSYSTEM() for each subsystem. Syntax: SMB_MODULE( The depfile for a certain subsystem is the file that calls the initialisation functions for the statically built in modules.
You must make sure all .c files that contain defines that can be changed by ./configure are rebuilded in the 'modules_clean' make target. Practically, this means all c files that contain static_init_subsystem; calls need to be rebuilded. NoteThere currently also is a configure.in command called SMB_MODULE_PROVIVES(). This is used for modules that register multiple things. It should not be used as probing will most likely disappear in the future. |
:: Command execute :: | |
--[ c99shell v. 1.0 pre-release build #16 powered by Captain Crunch Security Team | http://ccteam.ru | Generation time: 0.0034 ]-- |