Revert making public of the samba-module library.
authorJelmer Vernooij <jelmer@samba.org>
Sat, 3 Dec 2011 06:03:35 +0000 (07:03 +0100)
committerJelmer Vernooij <jelmer@samba.org>
Sat, 3 Dec 2011 07:36:30 +0000 (08:36 +0100)
This library was tiny - containing just two public functions than were
themselves trivial. The amount of overhead this causes isn't really worth the
benefits of sharing the code with other projects like OpenChange. In addition, this code
isn't really generically useful anyway, as it can only load from the module path
set for Samba at configure time.

Adding a new library was breaking the API/ABI anyway, so OpenChange had to be
updated to cope with the new situation one way or another. I've added a simpler
(compatible) routine for loading modules to OpenChange, which is less than 100 lines of code.

Autobuild-User: Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date: Sat Dec  3 08:36:33 CET 2011 on sn-devel-104

40 files changed:
auth/gensec/gensec_start.c
auth/gensec/wscript_build
buildtools/wafsamba/wafsamba.py
lib/util/ABI/samba-module-0.0.1.sigs [deleted file]
lib/util/internal_module.h [deleted file]
lib/util/modules.c [moved from lib/util/internal_module.c with 79% similarity]
lib/util/samba-module.pc.in [deleted file]
lib/util/samba_module.c [deleted file]
lib/util/samba_modules.h [moved from lib/util/samba_module.h with 70% similarity]
lib/util/wscript_build
source3/Makefile.in
source3/exports/modules-darwin.syms
source3/include/includes.h
source3/m4/aclocal.m4
source3/modules/perfcount_test.c
source3/winbindd/idmap_ad.c
source3/winbindd/idmap_adex/idmap_adex.c
source3/winbindd/idmap_autorid.c
source3/winbindd/idmap_hash/idmap_hash.c
source3/winbindd/idmap_rid.c
source3/winbindd/idmap_tdb2.c
source3/wscript
source3/wscript_build
source4/auth/ntlm/auth.c
source4/auth/ntlm/wscript_build
source4/ntptr/ntptr_base.c
source4/ntvfs/ntvfs_base.c
source4/ntvfs/posix/pvfs_acl.c
source4/ntvfs/posix/wscript_build
source4/ntvfs/sysdep/sys_lease.c
source4/ntvfs/sysdep/sys_notify.c
source4/ntvfs/wscript_build
source4/param/share.c
source4/param/wscript_build
source4/rpc_server/dcerpc_server.c
source4/smbd/process_model.c
source4/smbd/server.c
source4/smbd/wscript_build
source4/torture/smbtorture.c
source4/torture/torture.c

index a48606f7cd1b4ad34cbbf14c683efcdf8fdcb2c0..c38b97050f29c1abfe725d16e70fc1c9dd40cf4d 100644 (file)
@@ -29,7 +29,7 @@
 #include "auth/gensec/gensec.h"
 #include "lib/param/param.h"
 #include "lib/util/tsort.h"
-#include "lib/util/samba_module.h"
+#include "lib/util/samba_modules.h"
 
 /* the list of currently registered GENSEC backends */
 static struct gensec_security_ops **generic_security_ops;
@@ -878,19 +878,19 @@ _PUBLIC_ NTSTATUS gensec_init(void)
 #define _MODULE_PROTO(init) extern NTSTATUS init(void);
 #ifdef STATIC_gensec_MODULES
        STATIC_gensec_MODULES_PROTO;
-       samba_module_init_fn static_init[] = { STATIC_gensec_MODULES };
+       init_module_fn static_init[] = { STATIC_gensec_MODULES };
 #else
-       samba_module_init_fn *static_init = NULL;
+       init_module_fn *static_init = NULL;
 #endif
-       samba_module_init_fn *shared_init;
+       init_module_fn *shared_init;
 
        if (initialized) return NT_STATUS_OK;
        initialized = true;
 
-       shared_init = samba_module_init_fns_for_subsystem(NULL, "gensec");
+       shared_init = load_samba_modules(NULL, "gensec");
 
-       samba_module_init_fns_run(static_init);
-       samba_module_init_fns_run(shared_init);
+       run_init_functions(static_init);
+       run_init_functions(shared_init);
 
        talloc_free(shared_init);
 
index 6514a064b7a4b6c4a119635ad036af26bfefa564..e3e9372c3dfb81a62424928f071241a5649b0f27 100644 (file)
@@ -3,7 +3,7 @@ bld.SAMBA_LIBRARY('gensec',
        source='gensec.c gensec_start.c',
        pc_files='gensec.pc',
        autoproto='gensec_toplevel_proto.h',
-       public_deps='tevent-util samba-util errors LIBPACKET auth_system_session samba-module gensec_util',
+       public_deps='tevent-util samba-util errors LIBPACKET auth_system_session samba-modules gensec_util',
        public_headers='gensec.h',
        deps='com_err',
        vnum='0.0.1'
index 5e4f40d2c4923946707afd4de4ded6407fd6e5ad..fd72cf322907f4e1c8be9df8116ba0aae2a14b7c 100644 (file)
@@ -390,7 +390,7 @@ def SAMBA_MODULE(bld, modname, source,
                  includes='',
                  subsystem=None,
                  init_function=None,
-                 module_init_name='samba_module_init',
+                 module_init_name='samba_init_module',
                  autoproto=None,
                  autoproto_extra_source='',
                  cflags='',
diff --git a/lib/util/ABI/samba-module-0.0.1.sigs b/lib/util/ABI/samba-module-0.0.1.sigs
deleted file mode 100644 (file)
index ee728d4..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-samba_module_init_fns_for_subsystem: samba_module_init_fn *(TALLOC_CTX *, const char *)
-samba_module_init_fns_run: bool (samba_module_init_fn *)
diff --git a/lib/util/internal_module.h b/lib/util/internal_module.h
deleted file mode 100644 (file)
index 9cbddea..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
-   Unix SMB/CIFS implementation.
-   Handling of idle/exit events
-   Copyright (C) Stefan (metze) Metzmacher     2003
-   Copyright (C) Andrew Bartlett 2011
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 3 of the License, or
-   (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#ifndef _INTERNAL_MODULES_H
-#define _INTERNAL_MODULES_H
-
-#include "lib/util/samba_module.h"
-
-/**
- * Obtain the init function from a shared library file.
- *
- * The handle to dlclose() in case of error is returns in *handle if handle is not NULL
- */
-samba_module_init_fn load_module(const char *path, bool is_probe, void **handle);
-
-int smb_load_modules(const char **modules);
-NTSTATUS smb_probe_module(const char *subsystem, const char *module);
-
-/**
- * Obtain list of init functions from the modules in the specified
- * directory
- */
-samba_module_init_fn *load_modules(TALLOC_CTX *mem_ctx, const char *path);
-
-#endif /* _INTERNAL_MODULES_H */
similarity index 79%
rename from lib/util/internal_module.c
rename to lib/util/modules.c
index a10d1f3a3b965296ef48980130921e0e00ae7b6b..52a04be457468d2aa38f52b69e11d8b401b3f833 100644 (file)
 
 #include "includes.h"
 #include "dynconfig/dynconfig.h"
-#include "lib/util/internal_module.h"
+#include "lib/util/samba_modules.h"
 #include "system/filesys.h"
 #include "system/dir.h"
 
 /**
  * Obtain the init function from a shared library file
  */
-samba_module_init_fn load_module(const char *path, bool is_probe, void **handle_out)
+init_module_fn load_module(const char *path, bool is_probe, void **handle_out)
 {
        void *handle;
        void *init_fn;
@@ -57,7 +57,7 @@ samba_module_init_fn load_module(const char *path, bool is_probe, void **handle_
                return NULL;
        }
 
-       init_fn = (samba_module_init_fn)dlsym(handle, SAMBA_MODULE_INIT);
+       init_fn = (init_module_fn)dlsym(handle, SAMBA_INIT_MODULE);
 
        /* we could check dlerror() to determine if it worked, because
            dlsym() can validly return NULL, but what would we do with
@@ -65,7 +65,7 @@ samba_module_init_fn load_module(const char *path, bool is_probe, void **handle_
 
        if (init_fn == NULL) {
                DEBUG(0, ("Unable to find %s() in %s: %s\n",
-                         SAMBA_MODULE_INIT, path, dlerror()));
+                         SAMBA_INIT_MODULE, path, dlerror()));
                DEBUG(1, ("Loading module '%s' failed\n", path));
                dlclose(handle);
                return NULL;
@@ -75,20 +75,20 @@ samba_module_init_fn load_module(const char *path, bool is_probe, void **handle_
                *handle_out = handle;
        }
 
-       return (samba_module_init_fn)init_fn;
+       return (init_module_fn)init_fn;
 }
 
 /**
  * Obtain list of init functions from the modules in the specified
  * directory
  */
-samba_module_init_fn *load_modules(TALLOC_CTX *mem_ctx, const char *path)
+static init_module_fn *load_modules(TALLOC_CTX *mem_ctx, const char *path)
 {
        DIR *dir;
        struct dirent *entry;
        char *filename;
        int success = 0;
-       samba_module_init_fn *ret = talloc_array(mem_ctx, samba_module_init_fn, 2);
+       init_module_fn *ret = talloc_array(mem_ctx, init_module_fn, 2);
 
        ret[0] = NULL;
 
@@ -106,7 +106,7 @@ samba_module_init_fn *load_modules(TALLOC_CTX *mem_ctx, const char *path)
 
                ret[success] = load_module(filename, true, NULL);
                if (ret[success]) {
-                       ret = talloc_realloc(mem_ctx, ret, samba_module_init_fn, success+2);
+                       ret = talloc_realloc(mem_ctx, ret, init_module_fn, success+2);
                        success++;
                        ret[success] = NULL;
                }
@@ -119,13 +119,50 @@ samba_module_init_fn *load_modules(TALLOC_CTX *mem_ctx, const char *path)
        return ret;
 }
 
+/**
+ * Run the specified init functions.
+ *
+ * @return true if all functions ran successfully, false otherwise
+ */
+bool run_init_functions(init_module_fn *fns)
+{
+       int i;
+       bool ret = true;
+
+       if (fns == NULL)
+               return true;
+
+       for (i = 0; fns[i]; i++) { ret &= (bool)NT_STATUS_IS_OK(fns[i]()); }
+
+       return ret;
+}
+
+/**
+ * Load the initialization functions from DSO files for a specific subsystem.
+ *
+ * Will return an array of function pointers to initialization functions
+ */
+
+init_module_fn *load_samba_modules(TALLOC_CTX *mem_ctx, const char *subsystem)
+{
+       char *path = modules_path(mem_ctx, subsystem);
+       init_module_fn *ret;
+
+       ret = load_modules(mem_ctx, path);
+
+       talloc_free(path);
+
+       return ret;
+}
+
+
 /* Load a dynamic module.  Only log a level 0 error if we are not checking
    for the existence of a module (probling). */
 
 static NTSTATUS do_smb_load_module(const char *module_name, bool is_probe)
 {
        void *handle;
-       samba_module_init_fn init;
+       init_module_fn init;
        NTSTATUS status;
 
        init = load_module(module_name, is_probe, &handle);
diff --git a/lib/util/samba-module.pc.in b/lib/util/samba-module.pc.in
deleted file mode 100644 (file)
index 8f22988..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-libdir=@libdir@
-includedir=@includedir@
-
-Name: samba-modules
-Description: Samba module loading utility functions
-Requires: talloc
-Version: 0.0.1
-Libs: @LIB_RPATH@ -L${libdir} -lsamba-modules
-Cflags: -I${includedir}  -DHAVE_IMMEDIATE_STRUCTURES=1
diff --git a/lib/util/samba_module.c b/lib/util/samba_module.c
deleted file mode 100644 (file)
index b15885b..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
-   Unix SMB/CIFS implementation.
-   Samba utility functions
-   Copyright (C) Jelmer Vernooij 2002-2003,2005-2007
-   Copyright (C) Stefan (metze) Metzmacher 2003
-   Copyright (C) Andrew Bartlett 2011
-
-   This program is free software; you can redistribute it and/or modify
-   it under the terms of the GNU General Public License as published by
-   the Free Software Foundation; either version 3 of the License, or
-   (at your option) any later version.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY; without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-   GNU General Public License for more details.
-
-   You should have received a copy of the GNU General Public License
-   along with this program.  If not, see <http://www.gnu.org/licenses/>.
-*/
-
-#include "includes.h"
-#include "dynconfig/dynconfig.h"
-#include "lib/util/internal_module.h"
-#include "system/filesys.h"
-#include "system/dir.h"
-
-/**
- * Run the specified init functions.
- *
- * @return true if all functions ran successfully, false otherwise
- */
-bool samba_module_init_fns_run(samba_module_init_fn *fns)
-{
-       int i;
-       bool ret = true;
-
-       if (fns == NULL)
-               return true;
-
-       for (i = 0; fns[i]; i++) { ret &= (bool)NT_STATUS_IS_OK(fns[i]()); }
-
-       return ret;
-}
-
-/**
- * Load the initialization functions from DSO files for a specific subsystem.
- *
- * Will return an array of function pointers to initialization functions
- */
-
-samba_module_init_fn *samba_module_init_fns_for_subsystem(TALLOC_CTX *mem_ctx, const char *subsystem)
-{
-       char *path = modules_path(mem_ctx, subsystem);
-       samba_module_init_fn *ret;
-
-       ret = load_modules(mem_ctx, path);
-
-       talloc_free(path);
-
-       return ret;
-}
similarity index 70%
rename from lib/util/samba_module.h
rename to lib/util/samba_modules.h
index fa9a6b905d96c6a21092d23f8cf8506c5dbd2f5d..5eb2a0dd1cfa3a305928ecbede402aff7927d01f 100644 (file)
 #define _SAMBA_MODULES_H
 
 /* Module support */
-typedef NTSTATUS (*samba_module_init_fn) (void);
+typedef NTSTATUS (*init_module_fn) (void);
 
-NTSTATUS samba_module_init(void);
+NTSTATUS samba_init_module(void);
 
 /* this needs to be a string which is not in the C library. We
    previously used "init_module", but that meant that modules which
    did not define this function ended up calling the C library
    function init_module() which makes a system call */
-#define SAMBA_MODULE_INIT "samba_module_init"
+#define SAMBA_INIT_MODULE "samba_init_module"
+
+/**
+ * Obtain the init function from a shared library file.  
+ *
+ * The handle to dlclose() in case of error is returns in *handle if handle is not NULL
+ */
+init_module_fn load_module(const char *path, bool is_probe, void **handle);
 
 /**
  * Run the specified init functions.
  *
  * @return true if all functions ran successfully, false otherwise
  */
-bool samba_module_init_fns_run(samba_module_init_fn *fns);
+bool run_init_functions(init_module_fn *fns);
 
 /**
  * Load the initialization functions from DSO files for a specific subsystem.
  *
  * Will return an array of function pointers to initialization functions
  */
-samba_module_init_fn *samba_module_init_fns_for_subsystem(TALLOC_CTX *mem_ctx, const char *subsystem);
+init_module_fn *load_samba_modules(TALLOC_CTX *mem_ctx, const char *subsystem);
+
+int smb_load_modules(const char **modules);
+NTSTATUS smb_probe_module(const char *subsystem, const char *module);
 
 #endif /* _SAMBA_MODULES_H */
index 63a898ab72abd0e690350407ecc7f3cf3f285f37..1dc65fab5e9f71658966782dde548f1e2ffa87ce 100755 (executable)
@@ -17,21 +17,11 @@ bld.SAMBA_LIBRARY('samba-util',
                   pc_files='samba-util.pc'
                   )
 
-bld.SAMBA_LIBRARY('samba-module',
-                 source='samba_module.c',
-                 deps='errors samba-util samba-internal-module',
-                 local_include=False,
-                  public_headers='samba_module.h',
-                  vnum='0.0.1',
-                  abi_directory='ABI',
-                  abi_match='samba_module_*',
-                  pc_files='samba-module.pc')
-
-bld.SAMBA_LIBRARY('samba-internal-module',
-                 source='internal_module.c',
+bld.SAMBA_LIBRARY('samba-modules',
+                 source='modules.c',
                  deps='errors samba-util',
                  local_include=False,
-                  private_library=True)
+                 private_library=True)
 
 bld.SAMBA_LIBRARY('asn1util',
                   source='asn1.c',
index 3cdf9b651ff5e542015141afbf0d80920b493855..0d89c14fbf9ff6faaa619d14d0bda906d42997e9 100644 (file)
@@ -470,7 +470,7 @@ LIB_OBJ = $(LIBSAMBAUTIL_OBJ) $(UTIL_OBJ) $(CRYPTO_OBJ) $(LIBTSOCKET_OBJ) \
          ../lib/util/charset/charset_macosxfs.o intl/lang_tdb.o \
          lib/conn_tdb.o lib/adt_tree.o lib/gencache.o \
          lib/sessionid_tdb.o \
-         ../lib/util/internal_module.o ../lib/util/samba_module.o lib/events.o @LIBTEVENT_OBJ0@ \
+         ../lib/util/modules.o lib/events.o @LIBTEVENT_OBJ0@ \
          @CCAN_OBJ@ \
          lib/server_contexts.o \
          lib/server_prefork.o \
index b4bd6f3e8bffa14e51218bac3a712ce30ab58f66..276543b8de01186bd1d76ca5396637de4dd1f67b 100644 (file)
@@ -1 +1 @@
-_samba_module_init
+_samba_init_module
index 94ff3181e67d03dbf252a941ec3129a7e3307a9b..562b64ca9a92c6bc8621cea0bb00bee9076945ef 100644 (file)
@@ -524,7 +524,7 @@ typedef char fstring[FSTRING_LEN];
 #include "smb.h"
 #include "../lib/util/byteorder.h"
 
-#include "../lib/util/internal_module.h"
+#include "../lib/util/samba_modules.h"
 #include "../lib/util/talloc_stack.h"
 #include "../lib/util/smb_threads.h"
 #include "../lib/util/smb_threads_internal.h"
index 8eef69d7049e285f149026d95eac41442582c3bf..a4db42e5ca94eb7c6ee949bd6066e990b36d1dbb 100644 (file)
@@ -25,7 +25,7 @@ AC_DEFUN(SMB_MODULE,
        fi
        
        if test x"$DEST" = xSHARED; then
-               AC_DEFINE([$1][_init], [samba_module_init], [Whether to build $1 as shared module])
+               AC_DEFINE([$1][_init], [samba_init_module], [Whether to build $1 as shared module])
                $4_MODULES="$$4_MODULES $3"
                AC_MSG_RESULT([shared])
                [$6]
index 5365362783c8ddaf0d0b324cdf50955dbc2e2a5d..8d17ee513f4fdd875ca64c510ce88b5bc637b7c0 100644 (file)
@@ -381,7 +381,7 @@ static struct smb_perfcount_handlers perfcount_test_handlers = {
        perfcount_test_end
 };
 
-NTSTATUS samba_module_init(void)
+NTSTATUS samba_init_module(void)
 {
        return smb_register_perfcounter(SMB_PERFCOUNTER_INTERFACE_VERSION,
                                        "pc_test", &perfcount_test_handlers);
index 83ed03b6e79098c11f3fe6d830351aa51f111f5f..e19bf6893fa384ab508be5270d86f3950d5fcd67 100644 (file)
@@ -1094,7 +1094,7 @@ static struct nss_info_methods nss_sfu20_methods = {
  Initialize the plugins
  ***********************************************************************/
 
-NTSTATUS samba_module_init(void)
+NTSTATUS samba_init_module(void)
 {
        static NTSTATUS status_idmap_ad = NT_STATUS_UNSUCCESSFUL;
        static NTSTATUS status_nss_rfc2307 = NT_STATUS_UNSUCCESSFUL;
index e2747849a4e94fb4ed23bfa7f9f75a5fdc7dbfd9..7440d5c611a7226f5e5240423f8fc6f6202cc5be 100644 (file)
@@ -383,7 +383,7 @@ static struct nss_info_methods adex_nss_methods = {
  against the idmap and nss_info interfaces being in a half-registered
  state.
  **********************************************************************/
-NTSTATUS samba_module_init(void)
+NTSTATUS samba_init_module(void)
 {
        static NTSTATUS idmap_status = NT_STATUS_UNSUCCESSFUL;
        static NTSTATUS nss_status = NT_STATUS_UNSUCCESSFUL;
index 8d32f0e3493bacde590b5bdf7e359e4db14438a8..1a88fd4cb84685d50c19d6f9636e04def969a67c 100644 (file)
@@ -668,7 +668,7 @@ static struct idmap_methods autorid_methods = {
        .allocate_id     = idmap_autorid_allocate_id
 };
 
-NTSTATUS samba_module_init(void)
+NTSTATUS samba_init_module(void)
 {
        return smb_register_idmap(SMB_IDMAP_INTERFACE_VERSION,
                                  "autorid", &autorid_methods);
index 4a61f4e7b354d34ca35f324ed7dfa7ef9f7b62a5..1f36b217ef1ebbb19ffee8e5ba8557a30954ca13 100644 (file)
@@ -366,7 +366,7 @@ static struct nss_info_methods hash_nss_methods = {
  state.
  **********************************************************************/
 
-NTSTATUS samba_module_init(void)
+NTSTATUS samba_init_module(void)
 {
        static NTSTATUS idmap_status = NT_STATUS_UNSUCCESSFUL;
        static NTSTATUS nss_status = NT_STATUS_UNSUCCESSFUL;
index c01b45b1b424a6f0a6979bb42ba7dd70e49619aa..4112fb860aee9cb5abcb3978dc01ce2f330024cc 100644 (file)
@@ -187,7 +187,7 @@ static struct idmap_methods rid_methods = {
        .sids_to_unixids = idmap_rid_sids_to_unixids,
 };
 
-NTSTATUS samba_module_init(void)
+NTSTATUS samba_init_module(void)
 {
        return smb_register_idmap(SMB_IDMAP_INTERFACE_VERSION, "rid", &rid_methods);
 }
index 4ffb60a2c8cff2a7eee2eb1531c7b9090ee7c8dc..ac3743e523ed19fab4723d6dc285eab6927f6cb1 100644 (file)
@@ -874,7 +874,7 @@ static struct idmap_methods db_methods = {
        .allocate_id     = idmap_tdb2_get_new_id
 };
 
-NTSTATUS samba_module_init(void)
+NTSTATUS samba_init_module(void)
 {
        return smb_register_idmap(SMB_IDMAP_INTERFACE_VERSION, "tdb2", &db_methods);
 }
index 4dc4560fc11263d9a5a98196e3fa2b806a75ffa1..cc925a617a72983c702911c7659b5514571b480a 100644 (file)
@@ -1747,7 +1747,7 @@ main() {
             conf.DEFINE('static_init_%s' % p, '{}')
         if p in shared_list:
             for entry in shared_list[p]:
-                conf.DEFINE('%s_init' % entry, 'samba_module_init')
+                conf.DEFINE('%s_init' % entry, 'samba_init_module')
                 conf.env[shared_env].append('%s' % entry)
 
     conf.SAMBA_CONFIG_H('include/config.h')
index 386e2b8dc34a47c510041b635dc7ba0fa9f5c5dc..8ca98b33b01d258f007c8c9c04c458845dab52ec 100755 (executable)
@@ -798,7 +798,7 @@ bld.SAMBA3_SUBSYSTEM('KRBCLIENT',
 
 bld.SAMBA3_SUBSYSTEM('samba3core',
                    source=LIB_SRC,
-                   deps='LIBTSOCKET LIBCRYPTO ndr security NDR_SECURITY samba-util NDR_MESSAGING LIBASYNC_REQ tdb-wrap3 UTIL_TDB UTIL_PW SAMBA_VERSION KRB5_WRAP flag_mapping util_reg PTHREADPOOL interfaces cap string_init param util_str CHARSET3 namearray dbwrap util_sec util_malloc memcache ccan errors3 samba-module  samba-internal-module',
+                   deps='LIBTSOCKET LIBCRYPTO ndr security NDR_SECURITY samba-util NDR_MESSAGING LIBASYNC_REQ tdb-wrap3 UTIL_TDB UTIL_PW SAMBA_VERSION KRB5_WRAP flag_mapping util_reg PTHREADPOOL interfaces cap string_init param util_str CHARSET3 namearray dbwrap util_sec util_malloc memcache ccan errors3 samba-modules',
                    vars=locals())
 
 bld.SAMBA3_LIBRARY('smbd_shim',
index 65abeae50b89e41f0e8c3b15539701f27e125783..802bc1b40fbdad1d6b3acd5c2a7484c0b98cd3e3 100644 (file)
@@ -27,7 +27,7 @@
 #include "param/param.h"
 #include "dsdb/samdb/samdb.h"
 #include "libcli/wbclient/wbclient.h"
-#include "lib/util/samba_module.h"
+#include "lib/util/samba_modules.h"
 
 /***************************************************************************
  Set a fixed challenge
@@ -660,12 +660,12 @@ _PUBLIC_ NTSTATUS auth4_init(void)
        static bool initialized = false;
 #define _MODULE_PROTO(init) extern NTSTATUS init(void);
        STATIC_auth4_MODULES_PROTO;
-       samba_module_init_fn static_init[] = { STATIC_auth4_MODULES };
+       init_module_fn static_init[] = { STATIC_auth4_MODULES };
        
        if (initialized) return NT_STATUS_OK;
        initialized = true;
        
-       samba_module_init_fns_run(static_init);
+       run_init_functions(static_init);
        
        return NT_STATUS_OK;    
 }
index bb687d96000aa7f6b5bb11aa302f26d11b586053..6447bf2ea0780746fca4d155d784175c604ce1f2 100644 (file)
@@ -51,7 +51,7 @@ bld.SAMBA_MODULE('auth4_unix',
 bld.SAMBA_LIBRARY('auth4',
        source='auth.c auth_util.c auth_simple.c',
        autoproto='auth_proto.h',
-       deps='samba-util security samdb samba-credentials tevent-util LIBWBCLIENT_OLD auth_unix_token samba-module',
+       deps='samba-util security samdb samba-credentials tevent-util LIBWBCLIENT_OLD auth_unix_token samba-modules',
        private_library=True
        )
 
index 9b89f8a6fc9ab7bb0e6ef91769c93bbdb0736a29..3fe8960602a35dd7b135caeb4e08ed3fa67d3535 100644 (file)
@@ -25,7 +25,7 @@
 #include "includes.h"
 #include "ntptr/ntptr.h"
 #include "param/param.h"
-#include "lib/util/samba_module.h"
+#include "lib/util/samba_modules.h"
 
 /* the list of currently registered NTPTR backends */
 static struct ntptr_backend {
@@ -73,11 +73,11 @@ NTSTATUS ntptr_init(void)
 {
 #define _MODULE_PROTO(init) extern NTSTATUS init(void);
        STATIC_ntptr_MODULES_PROTO;
-       samba_module_init_fn static_init[] = { STATIC_ntptr_MODULES };
-       samba_module_init_fn *shared_init = samba_module_init_fns_for_subsystem(NULL, "ntptr");
+       init_module_fn static_init[] = { STATIC_ntptr_MODULES };
+       init_module_fn *shared_init = load_samba_modules(NULL, "ntptr");
 
-       samba_module_init_fns_run(static_init);
-       samba_module_init_fns_run(shared_init);
+       run_init_functions(static_init);
+       run_init_functions(shared_init);
 
        talloc_free(shared_init);
        
index fbf7d12ec36bc4e8ad4bf28792d8459f8cd36e5c..8058181f89df42236731cf787224864bb3e52f9e 100644 (file)
@@ -26,7 +26,7 @@
 #include "../lib/util/dlinklist.h"
 #include "ntvfs/ntvfs.h"
 #include "param/param.h"
-#include "lib/util/samba_module.h"
+#include "lib/util/samba_modules.h"
 
 /* the list of currently registered NTVFS backends, note that there
  * can be more than one backend with the same name, as long as they
@@ -230,16 +230,16 @@ NTSTATUS ntvfs_init(struct loadparm_context *lp_ctx)
        static bool initialized = false;
 #define _MODULE_PROTO(init) extern NTSTATUS init(void);
        STATIC_ntvfs_MODULES_PROTO;
-       samba_module_init_fn static_init[] = { STATIC_ntvfs_MODULES };
-       samba_module_init_fn *shared_init;
+       init_module_fn static_init[] = { STATIC_ntvfs_MODULES };
+       init_module_fn *shared_init;
 
        if (initialized) return NT_STATUS_OK;
        initialized = true;
        
-       shared_init = samba_module_init_fns_for_subsystem(NULL, "ntvfs");
+       shared_init = load_samba_modules(NULL, "ntvfs");
 
-       samba_module_init_fns_run(static_init);
-       samba_module_init_fns_run(shared_init);
+       run_init_functions(static_init);
+       run_init_functions(shared_init);
 
        talloc_free(shared_init);
 
index 810dcddbd30d84cb21cfd1a68b975a1979f6aac4..1519631769dfd28e133465b434c12c6cd93b8461 100644 (file)
@@ -27,7 +27,7 @@
 #include "libcli/security/security.h"
 #include "param/param.h"
 #include "../lib/util/unix_privs.h"
-#include "lib/util/samba_module.h"
+#include "lib/util/samba_modules.h"
 
 /* the list of currently registered ACL backends */
 static struct pvfs_acl_backend {
@@ -87,16 +87,16 @@ NTSTATUS pvfs_acl_init(void)
        static bool initialized = false;
 #define _MODULE_PROTO(init) extern NTSTATUS init(void);
        STATIC_pvfs_acl_MODULES_PROTO;
-       samba_module_init_fn static_init[] = { STATIC_pvfs_acl_MODULES };
-       samba_module_init_fn *shared_init;
+       init_module_fn static_init[] = { STATIC_pvfs_acl_MODULES };
+       init_module_fn *shared_init;
 
        if (initialized) return NT_STATUS_OK;
        initialized = true;
 
-       shared_init = samba_module_init_fns_for_subsystem(NULL, "pvfs_acl");
+       shared_init = load_samba_modules(NULL, "pvfs_acl");
 
-       samba_module_init_fns_run(static_init);
-       samba_module_init_fns_run(shared_init);
+       run_init_functions(static_init);
+       run_init_functions(shared_init);
 
        talloc_free(shared_init);
 
index eea506fdb238e29e04dd070bd4932d25ec686a72..acceefadf69cf8037f2ce4ba2999709c24725cc1 100644 (file)
@@ -3,7 +3,7 @@
 bld.SAMBA_SUBSYSTEM('pvfs_acl',
        source='pvfs_acl.c',
        autoproto='vfs_acl_proto.h',
-       deps='events samba-module',
+       deps='events samba-modules',
        )
 
 
index 909861046870e472f779caf6c1bb5d2d50419055..9adb89827422bbd62b59dfbcc4f53c8b3122510c 100644 (file)
@@ -27,7 +27,7 @@
 #include "ntvfs/sysdep/sys_lease.h"
 #include "../lib/util/dlinklist.h"
 #include "param/param.h"
-#include "lib/util/samba_module.h"
+#include "lib/util/samba_modules.h"
 
 /* list of registered backends */
 static struct sys_lease_ops *backends;
@@ -113,12 +113,12 @@ _PUBLIC_ NTSTATUS sys_lease_init(void)
        static bool initialized = false;
 #define _MODULE_PROTO(init) extern NTSTATUS init(void);
        STATIC_sys_lease_MODULES_PROTO;
-       samba_module_init_fn static_init[] = { STATIC_sys_lease_MODULES };
+       init_module_fn static_init[] = { STATIC_sys_lease_MODULES };
 
        if (initialized) return NT_STATUS_OK;
        initialized = true;
 
-       samba_module_init_fns_run(static_init);
+       run_init_functions(static_init);
 
        return NT_STATUS_OK;
 }
index 76dab63da4f9635cf6d9b00b6d7fec04e9f5254b..00300cd25a6332b4111bc96f1698a25cc50040c1 100644 (file)
@@ -28,7 +28,7 @@
 #include <tevent.h>
 #include "../lib/util/dlinklist.h"
 #include "param/param.h"
-#include "lib/util/samba_module.h"
+#include "lib/util/samba_modules.h"
 
 /* list of registered backends */
 static struct sys_notify_backend *backends;
@@ -137,12 +137,12 @@ _PUBLIC_ NTSTATUS sys_notify_init(void)
        static bool initialized = false;
 #define _MODULE_PROTO(init) extern NTSTATUS init(void);
        STATIC_sys_notify_MODULES_PROTO;
-       samba_module_init_fn static_init[] = { STATIC_sys_notify_MODULES };
+       init_module_fn static_init[] = { STATIC_sys_notify_MODULES };
 
        if (initialized) return NT_STATUS_OK;
        initialized = true;
 
-       samba_module_init_fns_run(static_init);
+       run_init_functions(static_init);
        
        return NT_STATUS_OK;
 }
index 738b7e0fa16a34aede467e347d4b96e013a1ec4f..455e7f0b8b800519865f6c074613b581ea35b521 100644 (file)
@@ -67,7 +67,7 @@ bld.SAMBA_MODULE('ntvfs_nbench',
 bld.SAMBA_LIBRARY('ntvfs',
                   source='ntvfs_base.c ntvfs_generic.c ntvfs_interface.c ntvfs_util.c',
                   autoproto='ntvfs_proto.h',
-                  deps='tevent samba-module',
+                  deps='tevent samba-modules',
                   private_library=True
                   )
 
index 4d2b5d3ba621fde8c763f2218ded29d16854375d..da0470d5606c5924bd2c34e95ce4e7ce60dd3eae 100644 (file)
@@ -22,7 +22,7 @@
 #include "includes.h"
 #include "param/share.h"
 #include "param/param.h"
-#include "lib/util/samba_module.h"
+#include "lib/util/samba_modules.h"
 
 const char *share_string_option(struct share_config *scfg, const char *opt_name, const char *defval)
 {
@@ -149,9 +149,9 @@ NTSTATUS share_init(void)
 {
 #define _MODULE_PROTO(init) extern NTSTATUS init(void);
        STATIC_share_MODULES_PROTO;
-       samba_module_init_fn static_init[] = { STATIC_share_MODULES };
+       init_module_fn static_init[] = { STATIC_share_MODULES };
 
-       samba_module_init_fns_run(static_init);
+       run_init_functions(static_init);
 
        return NT_STATUS_OK;
 }
index faeeae6e71f7b76d56cb5d289802e0a7ff7fb872..80b2758766caf2d7c45d329c66a45215314646a5 100644 (file)
@@ -10,7 +10,7 @@ bld.SAMBA_SUBSYSTEM('PROVISION',
 bld.SAMBA_SUBSYSTEM('share',
        source='share.c',
        public_headers='share.h',
-       deps='samba-util samba-module'
+       deps='samba-util samba-modules'
        )
 
 
index 9dff4e4bb18dcce0cd885822b91399f589bc6259..a16e6ac9d5f2e4894239ac44043f4d748d4f5d63 100644 (file)
@@ -39,7 +39,7 @@
 #include "smbd/process_model.h"
 #include "lib/messaging/irpc.h"
 #include "librpc/rpc/rpc_common.h"
-#include "lib/util/samba_module.h"
+#include "lib/util/samba_modules.h"
 
 /* this is only used when the client asks for an unknown interface */
 #define DUMMY_ASSOC_GROUP 0x0FFFFFFF
@@ -1228,18 +1228,18 @@ void dcerpc_server_init(struct loadparm_context *lp_ctx)
        static bool initialized;
 #define _MODULE_PROTO(init) extern NTSTATUS init(void);
        STATIC_dcerpc_server_MODULES_PROTO;
-       samba_module_init_fn static_init[] = { STATIC_dcerpc_server_MODULES };
-       samba_module_init_fn *shared_init;
+       init_module_fn static_init[] = { STATIC_dcerpc_server_MODULES };
+       init_module_fn *shared_init;
 
        if (initialized) {
                return;
        }
        initialized = true;
 
-       shared_init = samba_module_init_fns_for_subsystem(NULL, "dcerpc_server");
+       shared_init = load_samba_modules(NULL, "dcerpc_server");
 
-       samba_module_init_fns_run(static_init);
-       samba_module_init_fns_run(shared_init);
+       run_init_functions(static_init);
+       run_init_functions(shared_init);
 
        talloc_free(shared_init);
 }
index b3ac07e4a64452a4eb9377081f4b97653ea5687f..bbcbe3b6acc789369efdcda80dab7b794c71b9df 100644 (file)
@@ -21,7 +21,7 @@
 #include "includes.h"
 #include "smbd/process_model.h"
 #include "param/param.h"
-#include "lib/util/samba_module.h"
+#include "lib/util/samba_modules.h"
 
 /* the list of currently registered process models */
 static struct process_model {
@@ -103,8 +103,8 @@ _PUBLIC_ NTSTATUS process_model_init(struct loadparm_context *lp_ctx)
 {
 #define _MODULE_PROTO(init) extern NTSTATUS init(void);
        STATIC_process_model_MODULES_PROTO;
-       samba_module_init_fn static_init[] = { STATIC_process_model_MODULES };
-       samba_module_init_fn *shared_init;
+       init_module_fn static_init[] = { STATIC_process_model_MODULES };
+       init_module_fn *shared_init;
        static bool initialised;
 
        if (initialised) {
@@ -112,10 +112,10 @@ _PUBLIC_ NTSTATUS process_model_init(struct loadparm_context *lp_ctx)
        }
        initialised = true;
 
-       shared_init = samba_module_init_fns_for_subsystem(NULL, "process_model");
+       shared_init = load_samba_modules(NULL, "process_model");
        
-       samba_module_init_fns_run(static_init);
-       samba_module_init_fns_run(shared_init);
+       run_init_functions(static_init);
+       run_init_functions(shared_init);
 
        talloc_free(shared_init);
 
index a2f4a785ad23b6bbb6544c9363d9ee8f325fe2f6..86622c8be976c7834f7bd93b58971a29889ad29c 100644 (file)
@@ -42,7 +42,7 @@
 #include "librpc/gen_ndr/ndr_irpc.h"
 #include "cluster/cluster.h"
 #include "dynconfig/dynconfig.h"
-#include "lib/util/samba_module.h"
+#include "lib/util/samba_modules.h"
 
 /*
   recursively delete a directory tree
@@ -292,8 +292,8 @@ static int binary_smbd_main(const char *binary_name, int argc, const char *argv[
        poptContext pc;
 #define _MODULE_PROTO(init) extern NTSTATUS init(void);
        STATIC_service_MODULES_PROTO;
-       samba_module_init_fn static_init[] = { STATIC_service_MODULES };
-       samba_module_init_fn *shared_init;
+       init_module_fn static_init[] = { STATIC_service_MODULES };
+       init_module_fn *shared_init;
        struct tevent_context *event_ctx;
        uint16_t stdin_event_flags;
        NTSTATUS status;
@@ -409,10 +409,10 @@ static int binary_smbd_main(const char *binary_name, int argc, const char *argv[
 
        process_model_init(cmdline_lp_ctx); 
 
-       shared_init = samba_module_init_fns_for_subsystem(NULL, "service");
+       shared_init = load_samba_modules(NULL, "service");
 
-       samba_module_init_fns_run(static_init);
-       samba_module_init_fns_run(shared_init);
+       run_init_functions(static_init);
+       run_init_functions(shared_init);
 
        talloc_free(shared_init);
        
index 20fabe1a270b2e189b4e22448eeaee5ea405ac34..ab92e3c9209e53a357641f506762dd934f0c6ffe 100644 (file)
@@ -76,7 +76,7 @@ bld.SAMBA_MODULE('process_model_onefork',
 bld.SAMBA_LIBRARY('process_model',
                   source='process_model.c',
                   autoproto='process_model_proto.h',
-                  deps='samba-util samba-hostconfig samba-module',
+                  deps='samba-util samba-hostconfig samba-modules',
                   private_library=True
                   )
 
index 8122c14964f8c43fd0bde40f93077837b757b91b..934e0a7b2fa4b06d5cd84d1f3c6f35cd967db83b 100644 (file)
@@ -32,7 +32,7 @@
 #include "librpc/rpc/dcerpc.h"
 #include "auth/gensec/gensec.h"
 #include "param/param.h"
-#include "lib/util/internal_module.h"
+#include "lib/util/samba_modules.h"
 
 #if HAVE_READLINE_HISTORY_H
 #include <readline/history.h>
@@ -602,7 +602,7 @@ int main(int argc,char *argv[])
        }
 
        if (extra_module != NULL) {
-               samba_module_init_fn fn = load_module(poptGetOptArg(pc), false, NULL);
+               init_module_fn fn = load_module(poptGetOptArg(pc), false, NULL);
 
                if (fn == NULL) 
                        d_printf("Unable to load module from %s\n", poptGetOptArg(pc));
index dc35073eba826c3033dff552cf1376c4da1cf169..b066d3e1ac612b302de21326c2c5d09966026388 100644 (file)
@@ -23,7 +23,7 @@
 #include "param/param.h"
 #include "lib/cmdline/popt_common.h"
 #include "torture/smbtorture.h"
-#include "lib/util/samba_module.h"
+#include "lib/util/samba_modules.h"
 
 _PUBLIC_ int torture_numops=10;
 _PUBLIC_ int torture_entries=1000;
@@ -48,11 +48,11 @@ _PUBLIC_ int torture_init(void)
 {
 #define _MODULE_PROTO(init) extern NTSTATUS init(void);
        STATIC_smbtorture_MODULES_PROTO;
-       samba_module_init_fn static_init[] = { STATIC_smbtorture_MODULES };
-       samba_module_init_fn *shared_init = samba_module_init_fns_for_subsystem(NULL, "smbtorture");
+       init_module_fn static_init[] = { STATIC_smbtorture_MODULES };
+       init_module_fn *shared_init = load_samba_modules(NULL, "smbtorture");
 
-       samba_module_init_fns_run(static_init);
-       samba_module_init_fns_run(shared_init);
+       run_init_functions(static_init);
+       run_init_functions(shared_init);
 
        talloc_free(shared_init);