2 Unix SMB/CIFS implementation.
4 module to store/fetch session keys for the schannel server
6 Copyright (C) Andrew Tridgell 2004
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 3 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program. If not, see <http://www.gnu.org/licenses/>.
23 #include "lib/ldb/include/ldb.h"
25 #include "../lib/util/util_ldb.h"
26 #include "libcli/auth/libcli_auth.h"
27 #include "auth/auth.h"
28 #include "param/param.h"
29 #include "auth/gensec/schannel_state.h"
32 connect to the schannel ldb
34 struct ldb_context *schannel_db_connect(TALLOC_CTX *mem_ctx, struct tevent_context *ev_ctx,
35 struct loadparm_context *lp_ctx)
38 struct ldb_context *ldb;
40 const char *init_ldif =
42 "computerName: CASE_INSENSITIVE\n" \
43 "flatname: CASE_INSENSITIVE\n";
45 path = private_path(mem_ctx, lp_ctx, "schannel.ldb");
50 existed = file_exist(path);
52 ldb = ldb_wrap_connect(mem_ctx, ev_ctx, lp_ctx, path,
53 system_session(mem_ctx, lp_ctx),
54 NULL, LDB_FLG_NOSYNC, NULL);
61 gendb_add_ldif(ldb, init_ldif);