]> git.sur5r.net Git - openldap/blob - servers/slapd/back-passwd/init.c
s/forms/form in PADL copyright
[openldap] / servers / slapd / back-passwd / init.c
1 /* init.c - initialize passwd backend */
2 /* $OpenLDAP$ */
3 /*
4  * Copyright 1998-2003 The OpenLDAP Foundation, All Rights Reserved.
5  * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
6  */
7
8 #include "portable.h"
9
10 #include <stdio.h>
11
12 #include <ac/socket.h>
13
14 #include "slap.h"
15 #include "back-passwd.h"
16
17 ldap_pvt_thread_mutex_t passwd_mutex;
18
19 #ifdef SLAPD_PASSWD_DYNAMIC
20
21 int back_passwd_LTX_init_module(int argc, char *argv[]) {
22     BackendInfo bi;
23
24     memset( &bi, '\0', sizeof(bi) );
25     bi.bi_type = "passwd";
26     bi.bi_init = passwd_back_initialize;
27
28     backend_add(&bi);
29     return 0;
30 }
31
32 #endif /* SLAPD_PASSWD_DYNAMIC */
33
34 int
35 passwd_back_initialize(
36     BackendInfo *bi
37 )
38 {
39         ldap_pvt_thread_mutex_init( &passwd_mutex );
40
41         bi->bi_open = 0;
42         bi->bi_config = 0;
43         bi->bi_close = 0;
44         bi->bi_destroy = passwd_back_destroy;
45
46         bi->bi_db_init = 0;
47         bi->bi_db_config = passwd_back_db_config;
48         bi->bi_db_open = 0;
49         bi->bi_db_close = 0;
50         bi->bi_db_destroy = 0;
51
52         bi->bi_op_bind = 0;
53         bi->bi_op_unbind = 0;
54         bi->bi_op_search = passwd_back_search;
55         bi->bi_op_compare = 0;
56         bi->bi_op_modify = 0;
57         bi->bi_op_modrdn = 0;
58         bi->bi_op_add = 0;
59         bi->bi_op_delete = 0;
60         bi->bi_op_abandon = 0;
61
62         bi->bi_extended = 0;
63
64         bi->bi_chk_referrals = 0;
65
66         bi->bi_connection_init = 0;
67         bi->bi_connection_destroy = 0;
68
69         return 0;
70 }
71
72 int
73 passwd_back_destroy(
74         BackendInfo *bi
75 )
76 {
77         ldap_pvt_thread_mutex_destroy( &passwd_mutex );
78         return 0;
79 }