]> git.sur5r.net Git - openldap/blob - servers/slapd/back-shell/init.c
Backout the input exhaustion change, it loops. Still looking for
[openldap] / servers / slapd / back-shell / init.c
1 /* init.c - initialize shell backend */
2
3 #include "portable.h"
4
5 #include <stdio.h>
6
7 #include <ac/socket.h>
8
9 #include "slap.h"
10 #include "shell.h"
11
12 #ifdef SLAPD_SHELL_DYNAMIC
13 #include <gmodule.h>
14
15 G_MODULE_EXPORT void init_module(int argc, char *argv[]) {
16    BackendInfo bi;
17
18    bi.bi_type = "shell";
19    bi.bi_init = shell_back_initialize;
20
21    backend_add(&bi);
22 }
23
24 #endif /* SLAPD_SHELL_DYNAMIC */
25
26 int
27 shell_back_initialize(
28     BackendInfo *bi
29 )
30 {
31         bi->bi_open = 0;
32         bi->bi_config = 0;
33         bi->bi_close = 0;
34         bi->bi_destroy = 0;
35
36         bi->bi_db_init = shell_back_db_init;
37         bi->bi_db_config = shell_back_db_config;
38         bi->bi_db_open = 0;
39         bi->bi_db_close = 0;
40         bi->bi_db_destroy = shell_back_db_destroy;
41
42         bi->bi_op_bind = shell_back_bind;
43         bi->bi_op_unbind = shell_back_unbind;
44         bi->bi_op_search = shell_back_search;
45         bi->bi_op_compare = shell_back_compare;
46         bi->bi_op_modify = shell_back_modify;
47         bi->bi_op_modrdn = shell_back_modrdn;
48         bi->bi_op_add = shell_back_add;
49         bi->bi_op_delete = shell_back_delete;
50         bi->bi_op_abandon = shell_back_abandon;
51
52         bi->bi_acl_group = 0;
53
54         bi->bi_connection_init = 0;
55         bi->bi_connection_destroy = 0;
56
57         return 0;
58 }
59
60 int
61 shell_back_db_init(
62     Backend     *be
63 )
64 {
65         struct shellinfo        *si;
66
67         si = (struct shellinfo *) ch_calloc( 1, sizeof(struct shellinfo) );
68
69         be->be_private = si;
70
71         return si == NULL;
72 }
73
74 int
75 shell_back_db_destroy(
76     Backend     *be
77 )
78 {
79         free( be->be_private );
80         return 0;
81 }