1 /* null.c - the null backend */
3 * Copyright 2002-2003 The OpenLDAP Foundation, All Rights Reserved.
4 * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
10 #include <ac/string.h>
20 null_back_bind( Operation *op, SlapReply *rs )
22 struct null_info *ni = (struct null_info *) op->o_bd->be_private;
24 if ( ni->bind_allowed ) {
25 /* front end will send result on success (0) */
29 rs->sr_err = LDAP_INVALID_CREDENTIALS;
30 send_ldap_result( op, rs );
35 /* add, delete, modify, modrdn, search */
37 null_back_success( Operation *op, SlapReply *rs )
39 rs->sr_err = LDAP_SUCCESS;
40 send_ldap_result( op, rs );
46 null_back_false( Operation *op, SlapReply *rs )
48 rs->sr_err = LDAP_COMPARE_FALSE;
49 send_ldap_result( op, rs );
61 struct null_info *ni = (struct null_info *) be->be_private;
64 fprintf( stderr, "%s: line %d: null database info is null!\n",
69 /* bind requests allowed */
70 if ( strcasecmp( argv[0], "bind" ) == 0 ) {
73 "%s: line %d: missing <on/off> in \"bind <on/off>\" line\n",
77 ni->bind_allowed = strcasecmp( argv[1], "off" );
82 "%s: line %d: unknown directive \"%s\" in null database definition (ignored)\n",
83 fname, lineno, argv[0] );
91 null_back_db_init( BackendDB *be )
95 ni = ch_calloc( 1, sizeof(struct null_info) );
102 null_back_db_destroy(
106 free( be->be_private );
112 null_back_initialize(
121 bi->bi_db_init = null_back_db_init;
122 bi->bi_db_config = null_back_db_config;
125 bi->bi_db_destroy = null_back_db_destroy;
127 bi->bi_op_bind = null_back_bind;
128 bi->bi_op_unbind = 0;
129 bi->bi_op_search = null_back_success;
130 bi->bi_op_compare = null_back_false;
131 bi->bi_op_modify = null_back_success;
132 bi->bi_op_modrdn = null_back_success;
133 bi->bi_op_add = null_back_success;
134 bi->bi_op_delete = null_back_success;
135 bi->bi_op_abandon = 0;
139 bi->bi_chk_referrals = 0;
141 bi->bi_connection_init = 0;
142 bi->bi_connection_destroy = 0;
147 #ifdef SLAPD_NULL_DYNAMIC
148 int back_null_LTX_init_module(
154 memset( &bi, '\0', sizeof(bi) );
156 bi.bi_init = null_back_initialize;
161 #endif /* SLAPD_NULL_DYNAMIC */