summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
Diffstat (limited to 'source4')
-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",