diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2003-04-16 12:13:07 +0000 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2003-04-16 12:13:07 +0000 |
commit | a8c95d79f83b4097ee20d5f3f1005c38ccf00186 (patch) | |
tree | 266efebe2aa517548513d2eee9a673f16b79d5af /source3/auth/auth_builtin.c | |
parent | cf00ce3e87a0d714fb38f709f9635b8a045866e3 (diff) | |
download | samba-a8c95d79f83b4097ee20d5f3f1005c38ccf00186.tar.gz samba-a8c95d79f83b4097ee20d5f3f1005c38ccf00186.tar.bz2 samba-a8c95d79f83b4097ee20d5f3f1005c38ccf00186.zip |
Add support for the new modules system to auth/ (merge from HEAD)
(This used to be commit c7a1de090db35835be1a1623bfc80c04065c5dd9)
Diffstat (limited to 'source3/auth/auth_builtin.c')
-rw-r--r-- | source3/auth/auth_builtin.c | 52 |
1 files changed, 7 insertions, 45 deletions
diff --git a/source3/auth/auth_builtin.c b/source3/auth/auth_builtin.c index a19c532fc9..509a4afba9 100644 --- a/source3/auth/auth_builtin.c +++ b/source3/auth/auth_builtin.c @@ -161,50 +161,12 @@ NTSTATUS auth_init_fixed_challenge(struct auth_context *auth_context, const char return NT_STATUS_OK; } -/** - * Outsorce an auth module to an external loadable .so - * - * Only works on systems with dlopen() etc. - **/ - -/* Plugin modules initialisation */ - -NTSTATUS auth_init_plugin(struct auth_context *auth_context, const char *param, auth_methods **auth_method) +int auth_builtin_init(void) { - void * dl_handle; - char *plugin_param, *plugin_name, *p; - auth_init_function plugin_init; - - if (param == NULL) { - DEBUG(0, ("auth_init_plugin: The plugin module needs an argument!\n")); - return NT_STATUS_UNSUCCESSFUL; - } - - plugin_name = smb_xstrdup(param); - p = strchr(plugin_name, ':'); - if (p) { - *p = 0; - plugin_param = p+1; - trim_string(plugin_param, " ", " "); - } else plugin_param = NULL; - - trim_string(plugin_name, " ", " "); - - DEBUG(5, ("auth_init_plugin: Trying to load auth plugin %s\n", plugin_name)); - dl_handle = sys_dlopen(plugin_name, RTLD_NOW ); - if (!dl_handle) { - DEBUG(0, ("auth_init_plugin: Failed to load auth plugin %s using sys_dlopen (%s)\n", - plugin_name, sys_dlerror())); - return NT_STATUS_UNSUCCESSFUL; - } - - plugin_init = sys_dlsym(dl_handle, "auth_init"); - if (!plugin_init){ - DEBUG(0, ("Failed to find function 'auth_init' using sys_dlsym in sam plugin %s (%s)\n", - plugin_name, sys_dlerror())); - return NT_STATUS_UNSUCCESSFUL; - } - - DEBUG(5, ("Starting sam plugin %s with paramater %s\n", plugin_name, plugin_param?plugin_param:"(null)")); - return plugin_init(auth_context, plugin_param, auth_method); + smb_register_auth("guest", auth_init_guest, AUTH_INTERFACE_VERSION); +#ifdef DEVELOPER + smb_register_auth("fixed_challenge", auth_init_fixed_challenge, AUTH_INTERFACE_VERSION); + smb_register_auth("name_to_ntstatus", auth_init_name_to_ntstatus, AUTH_INTERFACE_VERSION); +#endif + return True; } |