diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2005-12-26 16:46:55 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:47:45 -0500 |
commit | 448483199fb436309735f5203b3282fca2c517ec (patch) | |
tree | fcd663e46d0eac19b98037008a435bdd57ca7f8e /source4/lib/util.c | |
parent | ee10fb1a12391a76fe81e6e7a92d282ef885bc30 (diff) | |
download | samba-448483199fb436309735f5203b3282fca2c517ec.tar.gz samba-448483199fb436309735f5203b3282fca2c517ec.tar.bz2 samba-448483199fb436309735f5203b3282fca2c517ec.zip |
r12494: Support loading modules from .so files for most subsystems.
We now use a different system for initializing the modules for a subsystem.
Most subsystems now have an init function that looks something like this:
init_module_fn static_init[] = STATIC_AUTH_MODULES;
init_module_fn *shared_init = load_samba_modules(NULL, "auth");
run_init_functions(static_init);
run_init_functions(shared_init);
talloc_free(shared_init);
I hope to eliminate the other init functions later on (the
init_programname_subsystems; defines).
(This used to be commit b6d2ad4ce0a91c4be790dd258820c492ff1787ea)
Diffstat (limited to 'source4/lib/util.c')
-rw-r--r-- | source4/lib/util.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/source4/lib/util.c b/source4/lib/util.c index 3b4064098c..3443d137d6 100644 --- a/source4/lib/util.c +++ b/source4/lib/util.c @@ -690,6 +690,23 @@ char *smbd_tmp_path(TALLOC_CTX *mem_ctx, const char *name) return fname; } +char *modules_path(TALLOC_CTX* mem_ctx, const char *name) +{ + return talloc_asprintf(mem_ctx, "%s/%s", dyn_MODULESDIR, name); +} + +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; +} + void dump_data_pw(const char *msg, const uint8_t * data, size_t len) { #ifdef DEBUG_PASSWORD |