s4:auth Add dependency from the operational module onto auth
authorAndrew Bartlett <abartlet@samba.org>
Thu, 15 Apr 2010 22:42:12 +0000 (08:42 +1000)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 20 May 2010 07:39:10 +0000 (17:39 +1000)
We had to split up the auth module into a module loaded by main deamon
and a subsystem we manually init in the operational module.

Andrew Bartlett

source4/auth/auth.h
source4/auth/ntlm/auth.c
source4/auth/ntlm/auth_server_service.c [new file with mode: 0644]
source4/auth/ntlm/wscript_build
source4/dsdb/samdb/ldb_modules/operational.c
source4/dsdb/samdb/ldb_modules/wscript_build

index 2678d2ca6601fa92b5d88157f6555f2fe8d2e816..0e32c504dde499d3810e736b5cc3b8328e0779c1 100644 (file)
@@ -283,6 +283,7 @@ NTSTATUS auth_check_password(struct auth_context *auth_ctx,
                             struct auth_serversupplied_info **server_info);
 NTSTATUS auth_init(void);
 NTSTATUS auth_register(const struct auth_operations *ops);
+NTSTATUS server_service_auth_init(void);
 NTSTATUS authenticate_username_pw(TALLOC_CTX *mem_ctx,
                                           struct tevent_context *ev,
                                           struct messaging_context *msg,
index b5f3afc86dea581cf9a81b0e8cd10bc7d41c88e1..3f1ee669c9dab6c556ce8a89a631ab941b0d68fd 100644 (file)
@@ -645,8 +645,3 @@ _PUBLIC_ NTSTATUS auth_init(void)
        
        return NT_STATUS_OK;    
 }
-
-NTSTATUS server_service_auth_init(void)
-{
-       return auth_init();
-}
diff --git a/source4/auth/ntlm/auth_server_service.c b/source4/auth/ntlm/auth_server_service.c
new file mode 100644 (file)
index 0000000..df47117
--- /dev/null
@@ -0,0 +1,26 @@
+/*
+   Unix SMB/CIFS implementation.
+   Password and authentication handling
+   Copyright (C) Andrew Bartlett         2010
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.
+*/
+
+#include "includes.h"
+#include "auth/auth.h"
+
+NTSTATUS server_service_auth_init(void)
+{
+       return auth_init();
+}
index 03a812f577d067d28d473ca4cd282c60c2403fe8..673b5fc7fef64efed349febfbfeade1a21cef195 100644 (file)
@@ -52,12 +52,17 @@ bld.SAMBA_SUBSYSTEM('PAM_ERRORS',
        )
 
 
-bld.SAMBA_MODULE('auth',
+bld.SAMBA_SUBSYSTEM('auth',
        source='auth.c auth_util.c auth_simple.c',
        autoproto='auth_proto.h',
+       deps='LIBSAMBA-UTIL LIBSECURITY SAMDB CREDENTIALS UTIL_TEVENT',
+       )
+
+bld.SAMBA_MODULE('auth_server_service',
+       source='auth_server_service.c',
        subsystem='service',
        init_function='server_service_auth_init',
-       deps='LIBSAMBA-UTIL LIBSECURITY SAMDB CREDENTIALS UTIL_TEVENT',
+       deps='auth',
        internal_module=True
        )
 
index e17409e07860f3525373920fd6fe0cbc268d3eb6..acd8b801616cd6b5d42fa0a9d46acf736cd70e04 100644 (file)
@@ -784,7 +784,10 @@ static int operational_search(struct ldb_module *module, struct ldb_request *req
 static int operational_init(struct ldb_module *ctx)
 {
        struct operational_data *data;
-       int ret = ldb_next_init(ctx);
+       int ret;
+       auth_init();
+
+       ret = ldb_next_init(ctx);
 
        if (ret != LDB_SUCCESS) {
                return ret;
index 370b548eb202c6a63395a426c753bb7a770ab380..0a222fea452e9bd9cd5fe22901f572cb901bfc56 100644 (file)
@@ -262,7 +262,7 @@ bld.SAMBA_MODULE('ldb_operational',
        source='operational.c',
        subsystem='LIBLDB',
        init_function='LDB_MODULE(operational)',
-       deps='talloc tevent LIBSAMBA-UTIL SAMDB_COMMON DSDB_MODULE_HELPERS auth'
+       deps='talloc tevent LIBSAMBA-UTIL SAMDB_COMMON DSDB_MODULE_HELPERS auth auth_session'
        )