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>
31 struct null_info *ni = (struct null_info *) be->be_private;
33 if( ni->bind_allowed )
34 /* front end with send result on success (0) */
36 send_ldap_result( conn, op, LDAP_INVALID_CREDENTIALS,
37 NULL, NULL, NULL, NULL );
38 return LDAP_INVALID_CREDENTIALS;
48 send_ldap_result( conn, op, LDAP_SUCCESS, NULL, NULL, NULL, NULL );
59 AttributeAssertion *ava
62 send_ldap_result( conn, op, LDAP_COMPARE_FALSE, NULL, NULL, NULL, NULL );
75 send_ldap_result( conn, op, LDAP_SUCCESS, NULL, NULL, NULL, NULL );
86 Modifications *modlist )
88 send_ldap_result( conn, op, LDAP_SUCCESS, NULL, NULL, NULL, NULL );
99 struct berval *newrdn,
100 struct berval *nnewrdn,
102 struct berval *newSuperior,
103 struct berval *nnewSuperior )
105 send_ldap_result( conn, op, LDAP_SUCCESS, NULL, NULL, NULL, NULL );
115 struct berval *nbase,
121 struct berval *filterstr,
122 AttributeName *attrs,
125 send_search_result( conn, op, LDAP_SUCCESS, NULL, NULL, NULL, NULL, 0 );
138 struct null_info *ni = (struct null_info *) be->be_private;
141 fprintf( stderr, "%s: line %d: null database info is null!\n",
146 /* bind requests allowed */
147 if ( strcasecmp( argv[0], "bind" ) == 0 ) {
150 "%s: line %d: missing <on/off> in \"bind <on/off>\" line\n",
154 ni->bind_allowed = strcasecmp( argv[1], "off" );
159 "%s: line %d: unknown directive \"%s\" in null database definition (ignored)\n",
160 fname, lineno, argv[0] );
168 null_back_db_init( BackendDB *be )
170 be->be_private = ch_calloc( 1, sizeof(struct null_info) );
175 null_back_db_destroy(
179 free( be->be_private );
185 null_back_initialize(
194 bi->bi_db_init = null_back_db_init;
195 bi->bi_db_config = null_back_db_config;
198 bi->bi_db_destroy = null_back_db_destroy;
200 bi->bi_op_bind = null_back_bind;
201 bi->bi_op_unbind = 0;
202 bi->bi_op_search = null_back_search;
203 bi->bi_op_compare = null_back_compare;
204 bi->bi_op_modify = null_back_modify;
205 bi->bi_op_modrdn = null_back_modrdn;
206 bi->bi_op_add = null_back_add;
207 bi->bi_op_delete = null_back_delete;
208 bi->bi_op_abandon = 0;
212 bi->bi_acl_group = 0;
213 bi->bi_acl_attribute = 0;
214 bi->bi_chk_referrals = 0;
216 bi->bi_connection_init = 0;
217 bi->bi_connection_destroy = 0;
222 #ifdef SLAPD_NULL_DYNAMIC
223 int back_null_LTX_init_module(
229 memset( &bi, '\0', sizeof(bi) );
231 bi.bi_init = null_back_initialize;
236 #endif /* SLAPD_NULL_DYNAMIC */