From d21b15ff57aa39337e76a06da74a55e48f4b0696 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Thu, 27 Feb 2003 01:54:41 +0000 Subject: - Rename 'modules = ' to 'preload modules = ' - Add smb_probe_module() - Add init_modules() - Call these functions (This used to be commit f8f21653225792c0001d183c6efe8b7d89a0785d) --- source3/lib/module.c | 35 ++++++++++++++++++++++++++++++++--- 1 file changed, 32 insertions(+), 3 deletions(-) (limited to 'source3/lib') diff --git a/source3/lib/module.c b/source3/lib/module.c index dd94f79950..4e2fe48af7 100644 --- a/source3/lib/module.c +++ b/source3/lib/module.c @@ -75,18 +75,47 @@ int smb_load_modules(const char **modules) return success; } +int smb_probe_module(const char *subsystem, const char *module) +{ + pstring full_path; + + /* Check for absolute path */ + if(module[0] == '/')return smb_load_module(module); + + pstrcpy(full_path, lib_path(subsystem)); + pstrcat(full_path, "/"); + pstrcat(full_path, module); + pstrcat(full_path, "."); + pstrcat(full_path, shlib_ext()); + + return smb_load_module(full_path); +} + #else /* HAVE_DLOPEN */ int smb_load_module(const char *module_name) { - DEBUG(0,("This samba executable has not been build with plugin support")); + DEBUG(0,("This samba executable has not been built with plugin support")); return False; } int smb_load_modules(const char **modules) { - DEBUG(0,("This samba executable has not been build with plugin support")); - return -1; + DEBUG(0,("This samba executable has not been built with plugin support")); + return False; +} + +int smb_probe_module(const char *subsystem, const char *module) +{ + DEBUG(0,("This samba executable has not been built with plugin support, not probing")); + return False; } #endif /* HAVE_DLOPEN */ + +void init_modules(void) +{ + if(lp_preload_modules()) + smb_load_modules(lp_preload_modules()); + /* FIXME: load static modules */ +} -- cgit