diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2003-03-30 12:42:18 +0000 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2003-03-30 12:42:18 +0000 |
commit | 7ea0ef92cbd49db6d7ae0d1e72b8f4f1f1fb7e7c (patch) | |
tree | aacbc2f53acbcb8068d9dac1c4baa5b3443efb1a /source3/lib/module.c | |
parent | 01f0236f58775e2bf60250caf2b9740bd9f988ea (diff) | |
download | samba-7ea0ef92cbd49db6d7ae0d1e72b8f4f1f1fb7e7c.tar.gz samba-7ea0ef92cbd49db6d7ae0d1e72b8f4f1f1fb7e7c.tar.bz2 samba-7ea0ef92cbd49db6d7ae0d1e72b8f4f1f1fb7e7c.zip |
- Point users at the HOWTO Collection instead of 'README' in modules/mysql.c
- Make passdb work with absolute paths (passdb backend = /path/to/smbpasswd.so works now). vfs, rpc and charset will follow
(This used to be commit 794d3ed03619a4e41558d9ff65783a1aa1b2be90)
Diffstat (limited to 'source3/lib/module.c')
-rw-r--r-- | source3/lib/module.c | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/source3/lib/module.c b/source3/lib/module.c index bf37078bb9..e400945a8b 100644 --- a/source3/lib/module.c +++ b/source3/lib/module.c @@ -80,7 +80,7 @@ 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); + if(strchr_m(module, '/'))return smb_load_module(module); pstrcpy(full_path, lib_path(subsystem)); pstrcat(full_path, "/"); @@ -117,7 +117,31 @@ int smb_probe_module(const char *subsystem, const char *module) void init_modules(void) { + /* FIXME: This can cause undefined symbol errors : + * smb_register_vfs() isn't available in nmbd, for example */ if(lp_preload_modules()) smb_load_modules(lp_preload_modules()); - /* FIXME: load static modules */ +} + + +/************************************************************************* + * This functions /path/to/foobar.so -> foobar + ************************************************************************/ +void module_path_get_name(char *path, pstring name) +{ + char *s; + + /* First, make the path relative */ + s = strrchr_m(path, '/'); + if(s) pstrcpy(name, s+1); + else pstrcpy(name, path); + + if (dyn_SHLIBEXT && *dyn_SHLIBEXT && strlen(dyn_SHLIBEXT) < strlen(name)) { + int n = strlen(name) - strlen(dyn_SHLIBEXT); + + /* Remove extension if necessary */ + if (name[n-1] == '.' && !strcmp(name+n, dyn_SHLIBEXT)) { + name[n-1] = '\0'; + } + } } |