summaryrefslogtreecommitdiff
path: root/source3/auth/auth.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2002-05-24 03:43:52 +0000
committerAndrew Bartlett <abartlet@samba.org>2002-05-24 03:43:52 +0000
commit40669777a5f74617fdd80dea3ff5a45a9e9a1aa4 (patch)
tree5b9f16db2a15723ae6623b7bd5cacd91f25d21b5 /source3/auth/auth.c
parentb270d2d3ababe0b84e3e7f05573bf673082ba6b8 (diff)
downloadsamba-40669777a5f74617fdd80dea3ff5a45a9e9a1aa4.tar.gz
samba-40669777a5f74617fdd80dea3ff5a45a9e9a1aa4.tar.bz2
samba-40669777a5f74617fdd80dea3ff5a45a9e9a1aa4.zip
Move the authenticaion subsystem over to the same 'module:options' syntax
that the passdb code now uses. Similarly, move the 'pluggable' stuff over from passdb as well, allowing runtime loading of new authenticaion modules. (NOTE: The interfaces here can *and do* change - module writers are not assured source-level compatibilty, and certainly not binary compatibility). (This used to be commit 3897cf5e048f50be91ae434f636affc6d539d0d1)
Diffstat (limited to 'source3/auth/auth.c')
-rw-r--r--source3/auth/auth.c23
1 files changed, 20 insertions, 3 deletions
diff --git a/source3/auth/auth.c b/source3/auth/auth.c
index c40cef5519..55695fa9c2 100644
--- a/source3/auth/auth.c
+++ b/source3/auth/auth.c
@@ -25,7 +25,7 @@
/** List of various built-in authenticaion modules */
-const struct auth_init_function builtin_auth_init_functions[] = {
+const struct auth_init_function_entry builtin_auth_init_functions[] = {
{ "guest", auth_init_guest },
{ "rhosts", auth_init_rhosts },
{ "hostsequiv", auth_init_hostsequiv },
@@ -340,14 +340,31 @@ static NTSTATUS make_auth_context_text_list(struct auth_context **auth_context,
{
if (strequal(builtin_auth_init_functions[i].name, *text_list))
{
+
+ char *module_name = smb_xstrdup(*text_list);
+ char *module_params = NULL;
+ char *p;
+
+ p = strchr(module_name, ':');
+
+ if (p) {
+ *p = 0;
+
+ module_params = p+1;
+
+ trim_string(module_params, " ", " ");
+ }
+
+ trim_string(module_name, " ", " ");
+
DEBUG(5,("Found auth method %s (at pos %d)\n", *text_list, i));
- if (builtin_auth_init_functions[i].init(*auth_context, &t)) {
+ if (NT_STATUS_IS_OK(builtin_auth_init_functions[i].init(*auth_context, module_params, &t))) {
DEBUG(5,("auth method %s has a valid init\n", *text_list));
- t->name = builtin_auth_init_functions[i].name;
DLIST_ADD_END(list, t, tmp);
} else {
DEBUG(0,("auth method %s did not correctly init\n", *text_list));
}
+ SAFE_FREE(module_name);
break;
}
}