~ubuntu-branches/ubuntu/intrepid/samba/intrepid-updates

« back to all changes in this revision

Viewing changes to docs/htmldocs/Samba3-Developers-Guide/modules.html

  • Committer: Bazaar Package Importer
  • Author(s): Chuck Short
  • Date: 2008-06-02 09:01:46 UTC
  • mfrom: (0.25.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20080602090146-92ur4nx39ccg708r
Tags: 2:3.0.30-2ubuntu1
* Merge from debian unstable, remaining changes:
  * debian/patches/VERSION.patch
    - set SAMABA_VERSION_VENDOR_SUFFIX to Ubuntu
  * debian/smb.conf
    - add "(Samba, Ubuntu)" to server string.
    - comment out the default [homes] shares, and a comment about
      "value users = %S to show users how to restrict access to 
      \\server\useranem to only username.
    - Add map to guest = Bad user, maps bad username to guest access.
      (LP: #32067)
  * debian/samba-common.postinst:
    - Fix upgrade from a first installation done with feisty, edgy, or dapper.
      (LP: #201059)
    - When populating the new sambashare group, it's not an error if the user
      simply doesn't exist; test for this case and the install continue 
      instead of aborting. (LP: #206036)
  * debian/smba-common.config:
    - do not change priority to HIGH if dhclient3 is installed
    - used priority medium instead of hight for the workgroup question
  * debian/winbind.files
    - insclude additional files
  * debian/patches/fix-documentation.patch:
    - fix typos in net(8) and smb.conf(5) man pages
  * debian/mksambapasswd.awk:
    - Don't add user with UID less than 1000 to smbpasswd.
  * debian/samba.init:
    - add 'status' option for LSB conformance.
  * Updated control version.
  * Dropped Changes:
    - Dropped debian/patches/fix-smbprinting-os2.patch. Accepted upstream.
    - Dropped debian/patches/fix-documentation.patch. Accepted upstream.
     

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Chapter�8.�Modules</title><link rel="stylesheet" href="samba.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.71.0"><link rel="start" href="index.html" title="SAMBA Developers Guide"><link rel="up" href="pt02.html" title="Part�II.�Samba Basics"><link rel="prev" href="contributing.html" title="Chapter�7.�Contributing code"><link rel="next" href="pt03.html" title="Part�III.�Samba Subsystems"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter�8.�Modules</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="contributing.html">Prev</a>�</td><th width="60%" align="center">Part�II.�Samba Basics</th><td width="20%" align="right">�<a accesskey="n" href="pt03.html">Next</a></td></tr></table><hr></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="modules"></a>Chapter�8.�Modules</h2></div><div><div class="author"><h3 class="author"><span class="firstname">Jelmer</span> <span class="surname">Vernooij</span></h3><div class="affiliation"><span class="orgname">Samba Team<br></span><div class="address"><p><code class="email">&lt;<a href="mailto:jelmer@samba.org">jelmer@samba.org</a>&gt;</code></p></div></div></div></div><div><p class="pubdate"> 19 March 2003 </p></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="modules.html#id324208">Advantages</a></span></dt><dt><span class="sect1"><a href="modules.html#id324243">Loading modules</a></span></dt><dd><dl><dt><span class="sect2"><a href="modules.html#id324266">Static modules</a></span></dt><dt><span class="sect2"><a href="modules.html#id324295">Shared modules</a></span></dt></dl></dd><dt><span class="sect1"><a href="modules.html#id324315">Writing modules</a></span></dt><dd><dl><dt><span class="sect2"><a href="modules.html#id324358">Static/Shared selection in configure.in</a></span></dt></dl></dd></dl></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id324208"></a>Advantages</h2></div></div></div><p>
 
1
<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>Chapter�8.�Modules</title><link rel="stylesheet" href="../samba.css" type="text/css"><meta name="generator" content="DocBook XSL Stylesheets V1.73.2"><link rel="start" href="index.html" title="SAMBA Developers Guide"><link rel="up" href="pt02.html" title="Part�II.�Samba Basics"><link rel="prev" href="contributing.html" title="Chapter�7.�Contributing code"><link rel="next" href="pt03.html" title="Part�III.�Samba Subsystems"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter�8.�Modules</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="contributing.html">Prev</a>�</td><th width="60%" align="center">Part�II.�Samba Basics</th><td width="20%" align="right">�<a accesskey="n" href="pt03.html">Next</a></td></tr></table><hr></div><div class="chapter" lang="en"><div class="titlepage"><div><div><h2 class="title"><a name="modules"></a>Chapter�8.�Modules</h2></div><div><div class="author"><h3 class="author"><span class="firstname">Jelmer</span> <span class="surname">Vernooij</span></h3><div class="affiliation"><span class="orgname">Samba Team<br></span><div class="address"><p><code class="email">&lt;<a class="email" href="mailto:jelmer@samba.org">jelmer@samba.org</a>&gt;</code></p></div></div></div></div><div><p class="pubdate"> 19 March 2003 </p></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="modules.html#id347970">Advantages</a></span></dt><dt><span class="sect1"><a href="modules.html#id348003">Loading modules</a></span></dt><dd><dl><dt><span class="sect2"><a href="modules.html#id348025">Static modules</a></span></dt><dt><span class="sect2"><a href="modules.html#id348054">Shared modules</a></span></dt></dl></dd><dt><span class="sect1"><a href="modules.html#id348073">Writing modules</a></span></dt><dd><dl><dt><span class="sect2"><a href="modules.html#id348114">Static/Shared selection in configure.in</a></span></dt></dl></dd></dl></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id347970"></a>Advantages</h2></div></div></div><p>
2
2
The new modules system has the following advantages:
3
3
</p><table class="simplelist" border="0" summary="Simple list"><tr><td>Transparent loading of static and shared modules (no need 
4
 
for a subsystem to know about modules)</td></tr><tr><td>Simple selection between shared and static modules at configure time</td></tr><tr><td>"preload modules" option for increasing performance for stable modules</td></tr><tr><td>No nasty #define stuff anymore</td></tr><tr><td>All backends are available as plugin now (including pdb_ldap and pdb_tdb)</td></tr></table></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id324243"></a>Loading modules</h2></div></div></div><p>
 
4
for a subsystem to know about modules)</td></tr><tr><td>Simple selection between shared and static modules at configure time</td></tr><tr><td>"preload modules" option for increasing performance for stable modules</td></tr><tr><td>No nasty #define stuff anymore</td></tr><tr><td>All backends are available as plugin now (including pdb_ldap and pdb_tdb)</td></tr></table></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id348003"></a>Loading modules</h2></div></div></div><p>
5
5
Some subsystems in samba use different backends. These backends can be 
6
6
either statically linked in to samba or available as a plugin. A subsystem 
7
7
should have a function that allows a module to register itself. For example, 
11
11
</pre><p>
12
12
This function will be called by the initialisation function of the module to 
13
13
register itself. 
14
 
</p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id324266"></a>Static modules</h3></div></div></div><p>
 
14
</p><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id348025"></a>Static modules</h3></div></div></div><p>
15
15
The modules system compiles a list of initialisation functions for the 
16
16
static modules of each subsystem. This is a define. For example, 
17
17
it is here currently (from <code class="filename">include/config.h</code>): 
21
21
</pre><p>
22
22
These functions should be called before the subsystem is used. That 
23
23
should be done when the subsystem is initialised or first used. 
24
 
</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id324295"></a>Shared modules</h3></div></div></div><p>
 
24
</p></div><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id348054"></a>Shared modules</h3></div></div></div><p>
25
25
If a subsystem needs a certain backend, it should check if it has 
26
26
already been registered. If the backend hasn't been registered already, 
27
27
the subsystem should call smb_probe_module(char *subsystem, char *backend).
31
31
absolute path specified in 'backend'.
32
32
</p><p>After smb_probe_module() has been executed, the subsystem 
33
33
should check again if the module has been registered. 
34
 
</p></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id324315"></a>Writing modules</h2></div></div></div><p>
 
34
</p></div></div><div class="sect1" lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="id348073"></a>Writing modules</h2></div></div></div><p>
35
35
Each module has an initialisation function. For modules that are 
36
36
included with samba this name is '<em class="replaceable"><code>subsystem</code></em>_<em class="replaceable"><code>backend</code></em>_init'. For external modules (that will never be built-in, but only available as a module) this name is always 'init_module'. (In the case of modules included with samba, the configure system will add a #define subsystem_backend_init() init_module()).
37
37
The prototype for these functions is:
46
46
smb_register_passdb(PASSDB_INTERFACE_VERSION, "ldapsam_nua", pdb_init_ldapsam_nua);
47
47
        return NT_STATUS_OK;
48
48
}
49
 
</pre><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id324358"></a>Static/Shared selection in configure.in</h3></div></div></div><p>
 
49
</pre><div class="sect2" lang="en"><div class="titlepage"><div><div><h3 class="title"><a name="id348114"></a>Static/Shared selection in configure.in</h3></div></div></div><p>
50
50
Some macros in configure.in generate the various defines and substs that 
51
51
are necessary for the system to work correct. All modules that should 
52
52
be built by default have to be added to the variable 'default_modules'.