summaryrefslogtreecommitdiff
path: root/source4/auth
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2006-04-06 16:08:46 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:00:22 -0500
commitc07125d13309cf40cf4c68884421a7c102c3494a (patch)
tree7133e906008c88210fb375d8fb6295801663db6d /source4/auth
parent317c4b81a5edf18eeb7f6358ca5b508e4af80bfd (diff)
downloadsamba-c07125d13309cf40cf4c68884421a7c102c3494a.tar.gz
samba-c07125d13309cf40cf4c68884421a7c102c3494a.tar.bz2
samba-c07125d13309cf40cf4c68884421a7c102c3494a.zip
r14952: Make sure the auth subsystem gets initialized if a gensec module needs it.
(This used to be commit ecf84248b48783fb0ccbeff4d37d930b21fb96df)
Diffstat (limited to 'source4/auth')
-rw-r--r--source4/auth/auth.c16
-rw-r--r--source4/auth/gensec/gensec.c4
-rw-r--r--source4/auth/gensec/gensec_krb5.c2
-rw-r--r--source4/auth/ntlmssp/ntlmssp.c3
4 files changed, 22 insertions, 3 deletions
diff --git a/source4/auth/auth.c b/source4/auth/auth.c
index b4a473a690..140aa57b15 100644
--- a/source4/auth/auth.c
+++ b/source4/auth/auth.c
@@ -333,10 +333,17 @@ const struct auth_critical_sizes *auth_interface_version(void)
return &critical_sizes;
}
-NTSTATUS server_service_auth_init(void)
+NTSTATUS auth_init(void)
{
+ static BOOL initialized = False;
+
init_module_fn static_init[] = STATIC_auth_MODULES;
- init_module_fn *shared_init = load_samba_modules(NULL, "auth");
+ init_module_fn *shared_init;
+
+ if (initialized) return NT_STATUS_OK;
+ initialized = True;
+
+ shared_init = load_samba_modules(NULL, "auth");
run_init_functions(static_init);
run_init_functions(shared_init);
@@ -345,3 +352,8 @@ NTSTATUS server_service_auth_init(void)
return NT_STATUS_OK;
}
+
+NTSTATUS server_service_auth_init(void)
+{
+ return auth_init();
+}
diff --git a/source4/auth/gensec/gensec.c b/source4/auth/gensec/gensec.c
index c334e54473..429aa433d7 100644
--- a/source4/auth/gensec/gensec.c
+++ b/source4/auth/gensec/gensec.c
@@ -1131,10 +1131,12 @@ NTSTATUS gensec_init(void)
static BOOL initialized = False;
init_module_fn static_init[] = STATIC_gensec_MODULES;
- init_module_fn *shared_init = load_samba_modules(NULL, "gensec");
+ init_module_fn *shared_init;
if (initialized) return NT_STATUS_OK;
initialized = True;
+
+ shared_init = load_samba_modules(NULL, "gensec");
run_init_functions(static_init);
run_init_functions(shared_init);
diff --git a/source4/auth/gensec/gensec_krb5.c b/source4/auth/gensec/gensec_krb5.c
index 9f5d38a01b..f2f3361bf9 100644
--- a/source4/auth/gensec/gensec_krb5.c
+++ b/source4/auth/gensec/gensec_krb5.c
@@ -754,6 +754,8 @@ NTSTATUS gensec_krb5_init(void)
{
NTSTATUS ret;
+ auth_init();
+
ret = gensec_register(&gensec_krb5_security_ops);
if (!NT_STATUS_IS_OK(ret)) {
DEBUG(0,("Failed to register '%s' gensec backend!\n",
diff --git a/source4/auth/ntlmssp/ntlmssp.c b/source4/auth/ntlmssp/ntlmssp.c
index dfef892976..fff0c9c7e9 100644
--- a/source4/auth/ntlmssp/ntlmssp.c
+++ b/source4/auth/ntlmssp/ntlmssp.c
@@ -404,6 +404,9 @@ static const struct gensec_security_ops gensec_ntlmssp_security_ops = {
NTSTATUS gensec_ntlmssp_init(void)
{
NTSTATUS ret;
+
+ auth_init();
+
ret = gensec_register(&gensec_ntlmssp_security_ops);
if (!NT_STATUS_IS_OK(ret)) {
DEBUG(0,("Failed to register '%s' gensec backend!\n",