summaryrefslogtreecommitdiff
path: root/docs-xml
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2017-04-20 12:24:43 -0700
committerJeremy Allison <jra@samba.org>2017-04-22 01:17:00 +0200
commit306783d6f5d577a0b8bd31d659d8c802f22f0333 (patch)
tree20e1c5a45b027d061d3dc0cab9028bbccaef7ab7 /docs-xml
parent9342b3ebf7fe7b7565406bd9a606b6676c08b029 (diff)
downloadsamba-306783d6f5d577a0b8bd31d659d8c802f22f0333.tar.gz
lib: modules: Change XXX_init interface from XXX_init(void) to XXX_init(TALLOC_CTX *)
Not currently used - no logic changes inside. This will make it possible to pass down a long-lived talloc context from the loading function for modules to use instead of having them internally all use talloc_autofree_context() which is a hidden global. Updated all known module interface numbers, and added a WHATSNEW. Signed-off-by: Jeremy Allison <jra@samba.org> Signed-off-by: Ralph Böhme <slow@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Sat Apr 22 01:17:00 CEST 2017 on sn-devel-144
Diffstat (limited to 'docs-xml')
-rw-r--r--docs-xml/Samba3-Developers-Guide/modules.xml14
1 files changed, 12 insertions, 2 deletions
diff --git a/docs-xml/Samba3-Developers-Guide/modules.xml b/docs-xml/Samba3-Developers-Guide/modules.xml
index a74c1768443..f0d19f1b8e9 100644
--- a/docs-xml/Samba3-Developers-Guide/modules.xml
+++ b/docs-xml/Samba3-Developers-Guide/modules.xml
@@ -101,7 +101,7 @@ The prototype for these functions is:
</para>
<para><programlisting>
-NTSTATUS init_module(void);
+NTSTATUS init_module(TALLOC_CTX *);
</programlisting></para>
<para>This function should call one or more
@@ -111,7 +111,7 @@ NT_STATUS_UNSUCCESSFUL or a more useful nt error code on failure.</para>
<para>For example, pdb_ldap_init() contains: </para>
<para><programlisting>
-NTSTATUS pdb_ldap_init(void)
+NTSTATUS pdb_ldap_init(TALLOC_CTX *)
{
smb_register_passdb(PASSDB_INTERFACE_VERSION, "ldapsam", pdb_init_ldapsam);
smb_register_passdb(PASSDB_INTERFACE_VERSION, "ldapsam_nua", pdb_init_ldapsam_nua);
@@ -119,6 +119,16 @@ smb_register_passdb(PASSDB_INTERFACE_VERSION, "ldapsam_nua", pdb_init_ldapsam_nu
}
</programlisting></para>
+<para>
+The TALLOC_CTX pointer passed as a parameter must be a long-lived context,
+that will stay around for as long as the program that loads the module
+exists. It allows the caller to taloc_free any long lived data the
+module choses to place on this context on program exit (giving a cleaner
+valgrind trace). It should be used by modules in place of talloc_autofree_context(),
+use of which makes programs thread-unsafe. Modules that don't care about
+free on exist should use the NULL talloc context.
+</para>
+
<sect2>
<title>Static/Shared selection in configure.in</title>