]> git.sur5r.net Git - openldap/blob - servers/slapd/back-shell/init.c
d0de95129b4c9ae978c9e52681092a97484a9045
[openldap] / servers / slapd / back-shell / init.c
1 /* init.c - initialize shell backend */
2 /* $OpenLDAP$ */
3 /*
4  * Copyright 1998-2000 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 "shell.h"
16
17 #ifdef SLAPD_SHELL_DYNAMIC
18
19 int back_shell_LTX_init_module(int argc, char *argv[]) {
20     BackendInfo bi;
21
22     memset( &bi, '\0', sizeof(bi) );
23     bi.bi_type = "shell";
24     bi.bi_init = shell_back_initialize;
25
26     backend_add(&bi);
27     return 0;
28 }
29
30 #endif /* SLAPD_SHELL_DYNAMIC */
31
32 int
33 shell_back_initialize(
34     BackendInfo *bi
35 )
36 {
37         bi->bi_open = 0;
38         bi->bi_config = 0;
39         bi->bi_close = 0;
40         bi->bi_destroy = 0;
41
42         bi->bi_db_init = shell_back_db_init;
43         bi->bi_db_config = shell_back_db_config;
44         bi->bi_db_open = 0;
45         bi->bi_db_close = 0;
46         bi->bi_db_destroy = shell_back_db_destroy;
47
48         bi->bi_op_bind = shell_back_bind;
49         bi->bi_op_unbind = shell_back_unbind;
50         bi->bi_op_search = shell_back_search;
51         bi->bi_op_compare = shell_back_compare;
52         bi->bi_op_modify = shell_back_modify;
53         bi->bi_op_modrdn = shell_back_modrdn;
54         bi->bi_op_add = shell_back_add;
55         bi->bi_op_delete = shell_back_delete;
56         bi->bi_op_abandon = shell_back_abandon;
57
58         bi->bi_extended = 0;
59
60         bi->bi_acl_group = 0;
61         bi->bi_chk_referrals = 0;
62
63 #ifdef HAVE_CYRUS_SASL
64         bi->bi_sasl_authorize = 0;
65         bi->bi_sasl_getsecret = 0;
66         bi->bi_sasl_putsecret = 0;
67 #endif /* HAVE_CYRUS_SASL */
68
69         bi->bi_connection_init = 0;
70         bi->bi_connection_destroy = 0;
71
72         return 0;
73 }
74
75 int
76 shell_back_db_init(
77     Backend     *be
78 )
79 {
80         struct shellinfo        *si;
81
82         si = (struct shellinfo *) ch_calloc( 1, sizeof(struct shellinfo) );
83
84         be->be_private = si;
85
86         return si == NULL;
87 }
88
89 int
90 shell_back_db_destroy(
91     Backend     *be
92 )
93 {
94         free( be->be_private );
95         return 0;
96 }