From aa9f67163cd2df2a815ef585edad1951343b82c8 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Fri, 30 Dec 2005 22:46:16 +0000 Subject: r12620: Get rid of automatically generated lists of init functions of subsystems. This allows Samba libraries to be used by other projects (and parts of Samba to be built as shared libraries). (This used to be commit 44f0aba715bfedc7e1ee3d07e9a101a91dbd84b3) --- source4/lib/com/config.mk | 1 - source4/lib/com/main.c | 11 +++++++++-- source4/lib/ldb/tools/cmdline.c | 4 ++-- source4/lib/registry/reg_backend_rpc.c | 1 + source4/lib/registry/tools/regdiff.c | 3 --- source4/lib/registry/tools/regpatch.c | 3 --- source4/lib/registry/tools/regshell.c | 3 --- source4/lib/registry/tools/regtree.c | 3 --- 8 files changed, 12 insertions(+), 17 deletions(-) (limited to 'source4/lib') diff --git a/source4/lib/com/config.mk b/source4/lib/com/config.mk index 9e66502046..12f0481b0f 100644 --- a/source4/lib/com/config.mk +++ b/source4/lib/com/config.mk @@ -1,5 +1,4 @@ [SUBSYSTEM::COM] -INIT_FUNCTION = com_init OBJ_FILES = \ tables.o \ rot.o \ diff --git a/source4/lib/com/main.c b/source4/lib/com/main.c index 123ba49b09..f2e4f6473a 100644 --- a/source4/lib/com/main.c +++ b/source4/lib/com/main.c @@ -92,8 +92,15 @@ WERROR com_get_class_object(struct com_context *ctx, struct GUID *clsid, struct NTSTATUS com_init(void) { - init_module_fn static_init[] = STATIC_COM_MODULES; - init_module_fn *shared_init = load_samba_modules(NULL, "com"); + static BOOL initialized = False; + + init_module_fn static_init[] = STATIC_COM_MODULES; + init_module_fn *shared_init; + + if (initialized) return NT_STATUS_OK; + initialized = True; + + shared_init = load_samba_modules(NULL, "com"); run_init_functions(static_init); run_init_functions(shared_init); diff --git a/source4/lib/ldb/tools/cmdline.c b/source4/lib/ldb/tools/cmdline.c index a14434622f..c134c3befd 100644 --- a/source4/lib/ldb/tools/cmdline.c +++ b/source4/lib/ldb/tools/cmdline.c @@ -28,7 +28,6 @@ #include "ldb/tools/cmdline.h" #ifdef _SAMBA_BUILD_ #include "lib/cmdline/popt_common.h" -#include "smb_build.h" #include "auth/auth.h" #endif @@ -72,7 +71,8 @@ struct ldb_cmdline *ldb_cmdline_process(struct ldb_context *ldb, int argc, const }; #ifdef _SAMBA_BUILD_ - ldbsearch_init_subsystems; + gensec_init(); + r = ldb_register_samba_handlers(ldb); if (r != 0) { goto failed; diff --git a/source4/lib/registry/reg_backend_rpc.c b/source4/lib/registry/reg_backend_rpc.c index e799b3a8e4..32ecbec6c6 100644 --- a/source4/lib/registry/reg_backend_rpc.c +++ b/source4/lib/registry/reg_backend_rpc.c @@ -389,5 +389,6 @@ WERROR reg_open_remote(struct registry_context **ctx, struct cli_credentials *cr NTSTATUS registry_rpc_init(void) { + dcerpc_init(); return registry_register(®_backend_rpc); } diff --git a/source4/lib/registry/tools/regdiff.c b/source4/lib/registry/tools/regdiff.c index 68cc56f9dd..5b876ca025 100644 --- a/source4/lib/registry/tools/regdiff.c +++ b/source4/lib/registry/tools/regdiff.c @@ -22,7 +22,6 @@ #include "includes.h" #include "lib/registry/registry.h" #include "lib/cmdline/popt_common.h" -#include "smb_build.h" int main(int argc, char **argv) { @@ -45,8 +44,6 @@ int main(int argc, char **argv) POPT_TABLEEND }; - regdiff_init_subsystems; - registry_init(); pc = poptGetContext(argv[0], argc, (const char **) argv, long_options,0); diff --git a/source4/lib/registry/tools/regpatch.c b/source4/lib/registry/tools/regpatch.c index b8b8805486..6f5c79bc0e 100644 --- a/source4/lib/registry/tools/regpatch.c +++ b/source4/lib/registry/tools/regpatch.c @@ -22,7 +22,6 @@ #include "includes.h" #include "lib/registry/registry.h" #include "lib/cmdline/popt_common.h" -#include "smb_build.h" int main(int argc, char **argv) { @@ -41,8 +40,6 @@ int main(int argc, char **argv) POPT_TABLEEND }; - regpatch_init_subsystems; - registry_init(); pc = poptGetContext(argv[0], argc, (const char **) argv, long_options,0); diff --git a/source4/lib/registry/tools/regshell.c b/source4/lib/registry/tools/regshell.c index c858b37f4a..89493c761e 100644 --- a/source4/lib/registry/tools/regshell.c +++ b/source4/lib/registry/tools/regshell.c @@ -23,7 +23,6 @@ #include "lib/registry/registry.h" #include "lib/cmdline/popt_common.h" #include "system/time.h" -#include "smb_build.h" /* * ck/cd - change key @@ -415,8 +414,6 @@ static char **reg_completion(const char *text, int start, int end) POPT_TABLEEND }; - regshell_init_subsystems; - registry_init(); pc = poptGetContext(argv[0], argc, (const char **) argv, long_options,0); diff --git a/source4/lib/registry/tools/regtree.c b/source4/lib/registry/tools/regtree.c index 9a9121379b..d8f5d68a94 100644 --- a/source4/lib/registry/tools/regtree.c +++ b/source4/lib/registry/tools/regtree.c @@ -22,7 +22,6 @@ #include "includes.h" #include "lib/registry/registry.h" #include "lib/cmdline/popt_common.h" -#include "smb_build.h" static void print_tree(int l, struct registry_key *p, int fullpath, int novals) { @@ -98,8 +97,6 @@ int main(int argc, char **argv) POPT_TABLEEND }; - regtree_init_subsystems; - registry_init(); pc = poptGetContext(argv[0], argc, (const char **) argv, long_options,0); -- cgit