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 "auth/auth.h"
27 #include "param/param.h"
30 connect to the schannel ldb
32 struct ldb_context
*schannel_db_connect(TALLOC_CTX
*mem_ctx
, struct tevent_context
*ev_ctx
,
33 struct loadparm_context
*lp_ctx
)
36 struct ldb_context
*ldb
;
38 const char *init_ldif
=
40 "computerName: CASE_INSENSITIVE\n" \
41 "flatname: CASE_INSENSITIVE\n" \
44 "@IDXATTR: computerName\n\n";
46 path
= private_path(mem_ctx
, lp_ctx
, "schannel.ldb");
51 existed
= file_exist(path
);
53 ldb
= ldb_wrap_connect(mem_ctx
, ev_ctx
, lp_ctx
, path
,
54 system_session(lp_ctx
),
55 NULL
, LDB_FLG_NOSYNC
);
62 gendb_add_ldif(ldb
, init_ldif
);