]> git.sur5r.net Git - openldap/blob - servers/slapd/back-passwd/init.c
34e486846c0792357e397613d5e0278d6749383a
[openldap] / servers / slapd / back-passwd / init.c
1 /* init.c - initialize passwd backend */
2 /* $OpenLDAP$ */
3 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
4  *
5  * Copyright 1998-2004 The OpenLDAP Foundation.
6  * All rights reserved.
7  *
8  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted only as authorized by the OpenLDAP
10  * Public License.
11  *
12  * A copy of this license is available in the file LICENSE in the
13  * top-level directory of the distribution or, alternatively, at
14  * <http://www.OpenLDAP.org/license.html>.
15  */
16
17 #include "portable.h"
18
19 #include <stdio.h>
20
21 #include <ac/socket.h>
22
23 #include "slap.h"
24 #include "back-passwd.h"
25 #include "external.h"
26
27 ldap_pvt_thread_mutex_t passwd_mutex;
28
29 #if SLAPD_PASSWD == SLAPD_MOD_DYNAMIC
30
31 int init_module(int argc, char *argv[]) {
32     BackendInfo bi;
33
34     memset( &bi, '\0', sizeof(bi) );
35     bi.bi_type = "passwd";
36     bi.bi_init = passwd_back_initialize;
37
38     backend_add(&bi);
39     return 0;
40 }
41
42 #endif /* SLAPD_PASSWD */
43
44 int
45 passwd_back_initialize(
46     BackendInfo *bi
47 )
48 {
49         ldap_pvt_thread_mutex_init( &passwd_mutex );
50
51         bi->bi_open = 0;
52         bi->bi_config = 0;
53         bi->bi_close = 0;
54         bi->bi_destroy = passwd_back_destroy;
55
56         bi->bi_db_init = 0;
57         bi->bi_db_config = passwd_back_db_config;
58         bi->bi_db_open = 0;
59         bi->bi_db_close = 0;
60         bi->bi_db_destroy = 0;
61
62         bi->bi_op_bind = 0;
63         bi->bi_op_unbind = 0;
64         bi->bi_op_search = passwd_back_search;
65         bi->bi_op_compare = 0;
66         bi->bi_op_modify = 0;
67         bi->bi_op_modrdn = 0;
68         bi->bi_op_add = 0;
69         bi->bi_op_delete = 0;
70         bi->bi_op_abandon = 0;
71
72         bi->bi_extended = 0;
73
74         bi->bi_chk_referrals = 0;
75
76         bi->bi_connection_init = 0;
77         bi->bi_connection_destroy = 0;
78
79         return 0;
80 }
81
82 int
83 passwd_back_destroy(
84         BackendInfo *bi
85 )
86 {
87         ldap_pvt_thread_mutex_destroy( &passwd_mutex );
88         return 0;
89 }