1 /* backover.c - backend overlay routines */
3 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
5 * Copyright 2003-2006 The OpenLDAP Foundation.
8 * Redistribution and use in source and binary forms, with or without
9 * modification, are permitted only as authorized by the OpenLDAP
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>.
17 /* Functions to overlay other modules over a backend. */
23 #include <ac/string.h>
24 #include <ac/socket.h>
30 static slap_overinst *overlays;
45 slap_overinfo *oi = be->bd_info->bi_private;
46 slap_overinst *on = oi->oi_list;
47 BackendInfo *bi_orig = be->bd_info;
51 func = &oi->oi_orig->bi_db_open;
53 be->bd_info = oi->oi_orig;
54 rc = func[which]( be );
57 for (; on && rc == 0; on=on->on_next) {
58 be->bd_info = &on->on_bi;
59 func = &on->on_bi.bi_db_open;
61 rc = func[which]( be );
64 be->bd_info = bi_orig;
77 slap_overinfo *oi = be->bd_info->bi_private;
78 slap_overinst *on = oi->oi_list;
79 BackendInfo *bi_orig = be->bd_info;
80 struct ConfigOCs *be_cf_ocs = be->be_cf_ocs;
84 if ( oi->oi_orig->bi_db_config ) {
85 be->bd_info = oi->oi_orig;
86 be->be_cf_ocs = oi->oi_orig->bi_cf_ocs;
87 rc = oi->oi_orig->bi_db_config( be, fname, lineno,
90 if ( be->bd_info != oi->oi_orig ) {
92 slap_overinst *on2, **onp;
96 /* a database added an overlay;
97 * work it around... */
98 assert( overlay_is_over( be ) );
100 oi2 = ( slap_overinfo * )be->bd_info->bi_private;
103 /* need to put a uniqueness check here as well;
104 * note that in principle there could be more than
105 * one overlay as a result of multiple calls to
106 * overlay_config() */
107 be2.bd_info = (BackendInfo *)oi;
109 for ( i = 0, onp = &on2; *onp; i++, onp = &(*onp)->on_next ) {
110 if ( overlay_is_inst( &be2, (*onp)->on_bi.bi_type ) ) {
111 Debug( LDAP_DEBUG_ANY, "over_db_config(): "
112 "warning, freshly added "
113 "overlay #%d \"%s\" is already in list\n",
114 i, (*onp)->on_bi.bi_type, 0 );
116 /* NOTE: if the overlay already exists,
117 * there is no way to merge the results
118 * of the configuration that may have
119 * occurred during bi_db_config(); we
120 * just issue a warning, and the
121 * administrator should deal with this */
128 ch_free( be->bd_info );
131 be->bd_info = (BackendInfo *)oi;
132 if ( rc != SLAP_CONF_UNKNOWN ) return rc;
140 snprintf( ca.log, sizeof( ca.log ), "%s: line %d",
141 ca.fname, ca.lineno );
143 for (; on; on=on->on_next) {
144 rc = SLAP_CONF_UNKNOWN;
145 if (on->on_bi.bi_cf_ocs) {
148 ct = config_find_keyword( on->on_bi.bi_cf_ocs->co_table, &ca );
150 rc = config_add_vals( ct, &ca );
151 if ( rc != SLAP_CONF_UNKNOWN )
155 if (on->on_bi.bi_db_config && rc == SLAP_CONF_UNKNOWN) {
156 be->bd_info = &on->on_bi;
157 rc = on->on_bi.bi_db_config( be, fname, lineno,
159 if ( rc != SLAP_CONF_UNKNOWN ) break;
162 be->bd_info = bi_orig;
163 be->be_cf_ocs = be_cf_ocs;
173 return over_db_func( be, db_open );
181 slap_overinfo *oi = be->bd_info->bi_private;
182 slap_overinst *on = oi->oi_list;
183 BackendInfo *bi_orig = be->bd_info;
186 for (; on && rc == 0; on=on->on_next) {
187 be->bd_info = &on->on_bi;
188 if ( be->bd_info->bi_db_close ) {
189 rc = be->bd_info->bi_db_close( be );
193 if ( oi->oi_orig->bi_db_close ) {
194 be->bd_info = oi->oi_orig;
195 rc = be->bd_info->bi_db_close( be );
198 be->bd_info = bi_orig;
207 slap_overinfo *oi = be->bd_info->bi_private;
208 slap_overinst *on = oi->oi_list, *next;
211 rc = over_db_func( be, db_destroy );
214 for (next = on->on_next; on; on=next) {
225 over_back_response ( Operation *op, SlapReply *rs )
227 slap_overinfo *oi = op->o_callback->sc_private;
228 slap_overinst *on = oi->oi_list;
229 int rc = SLAP_CB_CONTINUE;
230 BackendDB *be = op->o_bd, db = *op->o_bd;
232 db.be_flags |= SLAP_DBFLAG_OVERLAY;
234 for (; on; on=on->on_next ) {
235 if ( on->on_response ) {
236 db.bd_info = (BackendInfo *)on;
237 rc = on->on_response( op, rs );
238 if ( rc != SLAP_CB_CONTINUE ) break;
241 /* Bypass the remaining on_response layers, but allow
242 * normal execution to continue.
244 if ( rc == SLAP_CB_BYPASS )
245 rc = SLAP_CB_CONTINUE;
254 AttributeDescription *desc,
256 slap_access_t access,
257 AccessControlState *state,
263 BackendDB *be = op->o_bd, db;
264 int rc = SLAP_CB_CONTINUE;
266 /* FIXME: used to happen for instance during abandon
267 * when global overlays are used... */
268 assert( op->o_bd != NULL );
270 bi = op->o_bd->bd_info;
271 /* Were we invoked on the frontend? */
272 if ( !bi->bi_access_allowed ) {
273 oi = frontendDB->bd_info->bi_private;
275 oi = op->o_bd->bd_info->bi_private;
279 for ( ; on; on = on->on_next ) {
280 if ( on->on_bi.bi_access_allowed ) {
281 /* NOTE: do not copy the structure until required */
282 if ( !SLAP_ISOVERLAY( op->o_bd ) ) {
284 db.be_flags |= SLAP_DBFLAG_OVERLAY;
288 op->o_bd->bd_info = (BackendInfo *)on;
289 rc = on->on_bi.bi_access_allowed( op, e,
290 desc, val, access, state, maskp );
291 if ( rc != SLAP_CB_CONTINUE ) break;
295 if ( rc == SLAP_CB_CONTINUE ) {
296 BI_access_allowed *bi_access_allowed;
298 /* if the database structure was changed, o_bd points to a
299 * copy of the structure; put the original bd_info in place */
300 if ( SLAP_ISOVERLAY( op->o_bd ) ) {
301 op->o_bd->bd_info = oi->oi_orig;
304 if ( oi->oi_orig->bi_access_allowed ) {
305 bi_access_allowed = oi->oi_orig->bi_access_allowed;
307 bi_access_allowed = slap_access_allowed;
310 rc = bi_access_allowed( op, e,
311 desc, val, access, state, maskp );
313 /* should not fall thru this far without anything happening... */
314 if ( rc == SLAP_CB_CONTINUE ) {
315 /* access not allowed */
320 op->o_bd->bd_info = bi;
329 struct berval *gr_ndn,
330 struct berval *op_ndn,
331 ObjectClass *group_oc,
332 AttributeDescription *group_at )
336 BackendInfo *bi = op->o_bd->bd_info;
337 BackendDB *be = op->o_bd, db;
338 int rc = SLAP_CB_CONTINUE;
340 /* FIXME: used to happen for instance during abandon
341 * when global overlays are used... */
342 assert( op->o_bd != NULL );
344 oi = op->o_bd->bd_info->bi_private;
347 for ( ; on; on = on->on_next ) {
348 if ( on->on_bi.bi_acl_group ) {
349 /* NOTE: do not copy the structure until required */
350 if ( !SLAP_ISOVERLAY( op->o_bd ) ) {
352 db.be_flags |= SLAP_DBFLAG_OVERLAY;
356 op->o_bd->bd_info = (BackendInfo *)on;
357 rc = on->on_bi.bi_acl_group( op, e,
358 gr_ndn, op_ndn, group_oc, group_at );
359 if ( rc != SLAP_CB_CONTINUE ) break;
363 if ( rc == SLAP_CB_CONTINUE ) {
364 BI_acl_group *bi_acl_group;
366 /* if the database structure was changed, o_bd points to a
367 * copy of the structure; put the original bd_info in place */
368 if ( SLAP_ISOVERLAY( op->o_bd ) ) {
369 op->o_bd->bd_info = oi->oi_orig;
372 if ( oi->oi_orig->bi_acl_group ) {
373 bi_acl_group = oi->oi_orig->bi_acl_group;
375 bi_acl_group = backend_group;
378 rc = bi_acl_group( op, e,
379 gr_ndn, op_ndn, group_oc, group_at );
381 /* should not fall thru this far without anything happening... */
382 if ( rc == SLAP_CB_CONTINUE ) {
383 /* access not allowed */
388 op->o_bd->bd_info = bi;
397 struct berval *entry_ndn,
398 AttributeDescription *entry_at,
400 slap_access_t access )
404 BackendInfo *bi = op->o_bd->bd_info;
405 BackendDB *be = op->o_bd, db;
406 int rc = SLAP_CB_CONTINUE;
408 /* FIXME: used to happen for instance during abandon
409 * when global overlays are used... */
410 assert( op->o_bd != NULL );
412 oi = op->o_bd->bd_info->bi_private;
415 for ( ; on; on = on->on_next ) {
416 if ( on->on_bi.bi_acl_attribute ) {
417 /* NOTE: do not copy the structure until required */
418 if ( !SLAP_ISOVERLAY( op->o_bd ) ) {
420 db.be_flags |= SLAP_DBFLAG_OVERLAY;
424 op->o_bd->bd_info = (BackendInfo *)on;
425 rc = on->on_bi.bi_acl_attribute( op, target,
426 entry_ndn, entry_at, vals, access );
427 if ( rc != SLAP_CB_CONTINUE ) break;
431 if ( rc == SLAP_CB_CONTINUE ) {
432 BI_acl_attribute *bi_acl_attribute;
434 /* if the database structure was changed, o_bd points to a
435 * copy of the structure; put the original bd_info in place */
436 if ( SLAP_ISOVERLAY( op->o_bd ) ) {
437 op->o_bd->bd_info = oi->oi_orig;
440 if ( oi->oi_orig->bi_acl_attribute ) {
441 bi_acl_attribute = oi->oi_orig->bi_acl_attribute;
443 bi_acl_attribute = backend_attribute;
446 rc = bi_acl_attribute( op, target,
447 entry_ndn, entry_at, vals, access );
449 /* should not fall thru this far without anything happening... */
450 if ( rc == SLAP_CB_CONTINUE ) {
451 /* access not allowed */
456 op->o_bd->bd_info = bi;
462 * default return code in case of missing backend function
463 * and overlay stack returning SLAP_CB_CONTINUE
465 static int op_rc[ op_last ] = {
466 LDAP_UNWILLING_TO_PERFORM, /* bind */
467 LDAP_UNWILLING_TO_PERFORM, /* unbind */
468 LDAP_UNWILLING_TO_PERFORM, /* search */
469 SLAP_CB_CONTINUE, /* compare; pass to frontend */
470 LDAP_UNWILLING_TO_PERFORM, /* modify */
471 LDAP_UNWILLING_TO_PERFORM, /* modrdn */
472 LDAP_UNWILLING_TO_PERFORM, /* add */
473 LDAP_UNWILLING_TO_PERFORM, /* delete */
474 LDAP_UNWILLING_TO_PERFORM, /* abandon */
475 LDAP_UNWILLING_TO_PERFORM, /* cancel */
476 LDAP_UNWILLING_TO_PERFORM, /* extended */
477 LDAP_SUCCESS, /* aux_operational */
478 LDAP_SUCCESS, /* aux_chk_referrals */
479 SLAP_CB_CONTINUE /* aux_chk_controls; pass to frontend */
485 slap_operation_t which,
491 int rc = SLAP_CB_CONTINUE;
493 for (; on; on=on->on_next ) {
494 func = &on->on_bi.bi_op_bind;
496 op->o_bd->bd_info = (BackendInfo *)on;
497 rc = func[which]( op, rs );
498 if ( rc != SLAP_CB_CONTINUE ) break;
501 if ( rc == SLAP_CB_BYPASS )
502 rc = SLAP_CB_CONTINUE;
504 func = &oi->oi_orig->bi_op_bind;
505 if ( func[which] && rc == SLAP_CB_CONTINUE ) {
506 op->o_bd->bd_info = oi->oi_orig;
507 rc = func[which]( op, rs );
509 /* should not fall thru this far without anything happening... */
510 if ( rc == SLAP_CB_CONTINUE ) {
514 /* The underlying backend didn't handle the request, make sure
515 * overlay cleanup is processed.
517 if ( rc == LDAP_UNWILLING_TO_PERFORM ) {
518 slap_callback *sc_next;
519 for ( ; op->o_callback && op->o_callback->sc_response !=
520 over_back_response; op->o_callback = sc_next ) {
521 sc_next = op->o_callback->sc_next;
522 if ( op->o_callback->sc_cleanup ) {
523 op->o_callback->sc_cleanup( op, rs );
534 slap_operation_t which
539 BackendDB *be = op->o_bd, db;
540 slap_callback cb = {NULL, over_back_response, NULL, NULL};
541 int rc = SLAP_CB_CONTINUE;
543 /* FIXME: used to happen for instance during abandon
544 * when global overlays are used... */
545 assert( op->o_bd != NULL );
547 oi = op->o_bd->bd_info->bi_private;
550 if ( !SLAP_ISOVERLAY( op->o_bd )) {
552 db.be_flags |= SLAP_DBFLAG_OVERLAY;
555 cb.sc_next = op->o_callback;
557 op->o_callback = &cb;
559 rc = overlay_op_walk( op, rs, which, oi, on );
562 op->o_callback = cb.sc_next;
567 over_op_bind( Operation *op, SlapReply *rs )
569 return over_op_func( op, rs, op_bind );
573 over_op_unbind( Operation *op, SlapReply *rs )
575 return over_op_func( op, rs, op_unbind );
579 over_op_search( Operation *op, SlapReply *rs )
581 return over_op_func( op, rs, op_search );
585 over_op_compare( Operation *op, SlapReply *rs )
587 return over_op_func( op, rs, op_compare );
591 over_op_modify( Operation *op, SlapReply *rs )
593 return over_op_func( op, rs, op_modify );
597 over_op_modrdn( Operation *op, SlapReply *rs )
599 return over_op_func( op, rs, op_modrdn );
603 over_op_add( Operation *op, SlapReply *rs )
605 return over_op_func( op, rs, op_add );
609 over_op_delete( Operation *op, SlapReply *rs )
611 return over_op_func( op, rs, op_delete );
615 over_op_abandon( Operation *op, SlapReply *rs )
617 return over_op_func( op, rs, op_abandon );
621 over_op_cancel( Operation *op, SlapReply *rs )
623 return over_op_func( op, rs, op_cancel );
627 over_op_extended( Operation *op, SlapReply *rs )
629 return over_op_func( op, rs, op_extended );
633 over_aux_operational( Operation *op, SlapReply *rs )
635 return over_op_func( op, rs, op_aux_operational );
639 over_aux_chk_referrals( Operation *op, SlapReply *rs )
641 return over_op_func( op, rs, op_aux_chk_referrals );
645 over_aux_chk_controls( Operation *op, SlapReply *rs )
647 return over_op_func( op, rs, op_aux_chk_controls );
657 over_connection_func(
660 enum conn_which which
666 int rc = SLAP_CB_CONTINUE;
667 BI_connection_init **func;
669 /* FIXME: used to happen for instance during abandon
670 * when global overlays are used... */
671 assert( bd != NULL );
673 oi = bd->bd_info->bi_private;
676 if ( !SLAP_ISOVERLAY( bd ) ) {
678 db.be_flags |= SLAP_DBFLAG_OVERLAY;
682 for ( ; on; on = on->on_next ) {
683 func = &on->on_bi.bi_connection_init;
684 if ( func[ which ] ) {
685 bd->bd_info = (BackendInfo *)on;
686 rc = func[ which ]( bd, conn );
687 if ( rc != SLAP_CB_CONTINUE ) break;
691 func = &oi->oi_orig->bi_connection_init;
692 if ( func[ which ] && rc == SLAP_CB_CONTINUE ) {
693 bd->bd_info = oi->oi_orig;
694 rc = func[ which ]( bd, conn );
696 /* should not fall thru this far without anything happening... */
697 if ( rc == SLAP_CB_CONTINUE ) {
698 rc = LDAP_UNWILLING_TO_PERFORM;
705 over_connection_init(
710 return over_connection_func( bd, conn, conn_init );
714 over_connection_destroy(
719 return over_connection_func( bd, conn, conn_destroy );
729 /* FIXME: check for duplicates? */
730 for ( tmp = overlays; tmp != NULL; tmp = tmp->on_next ) {
731 if ( strcmp( on->on_bi.bi_type, tmp->on_bi.bi_type ) == 0 ) {
732 Debug( LDAP_DEBUG_ANY,
733 "overlay_register(\"%s\"): "
734 "name already in use.\n",
735 on->on_bi.bi_type, 0, 0 );
739 if ( on->on_bi.bi_obsolete_names != NULL ) {
742 for ( i = 0; on->on_bi.bi_obsolete_names[ i ] != NULL; i++ ) {
743 if ( strcmp( on->on_bi.bi_obsolete_names[ i ], tmp->on_bi.bi_type ) == 0 ) {
744 Debug( LDAP_DEBUG_ANY,
745 "overlay_register(\"%s\"): "
746 "obsolete name \"%s\" already in use "
747 "by overlay \"%s\".\n",
749 on->on_bi.bi_obsolete_names[ i ],
750 tmp->on_bi.bi_type );
756 if ( tmp->on_bi.bi_obsolete_names != NULL ) {
759 for ( i = 0; tmp->on_bi.bi_obsolete_names[ i ] != NULL; i++ ) {
762 if ( strcmp( on->on_bi.bi_type, tmp->on_bi.bi_obsolete_names[ i ] ) == 0 ) {
763 Debug( LDAP_DEBUG_ANY,
764 "overlay_register(\"%s\"): "
765 "name already in use "
766 "as obsolete by overlay \"%s\".\n",
768 tmp->on_bi.bi_obsolete_names[ i ], 0 );
772 if ( on->on_bi.bi_obsolete_names != NULL ) {
773 for ( j = 0; on->on_bi.bi_obsolete_names[ j ] != NULL; j++ ) {
774 if ( strcmp( on->on_bi.bi_obsolete_names[ j ], tmp->on_bi.bi_obsolete_names[ i ] ) == 0 ) {
775 Debug( LDAP_DEBUG_ANY,
776 "overlay_register(\"%s\"): "
777 "obsolete name \"%s\" already in use "
778 "as obsolete by overlay \"%s\".\n",
780 on->on_bi.bi_obsolete_names[ j ],
781 tmp->on_bi.bi_type );
790 on->on_next = overlays;
796 * iterator on registered overlays; overlay_next( NULL ) returns the first
797 * overlay; subsequent calls with the previously returned value allow to
798 * iterate over the entire list; returns NULL when no more overlays are
815 * returns a specific registered overlay based on the type; NULL if not
820 overlay_find( const char *over_type )
822 slap_overinst *on = overlays;
824 assert( over_type != NULL );
826 for ( ; on; on = on->on_next ) {
827 if ( strcmp( on->on_bi.bi_type, over_type ) == 0 ) {
831 if ( on->on_bi.bi_obsolete_names != NULL ) {
834 for ( i = 0; on->on_bi.bi_obsolete_names[ i ] != NULL; i++ ) {
835 if ( strcmp( on->on_bi.bi_obsolete_names[ i ], over_type ) == 0 ) {
836 Debug( LDAP_DEBUG_ANY,
837 "overlay_find(\"%s\"): "
838 "obsolete name for \"%s\".\n",
839 on->on_bi.bi_obsolete_names[ i ],
840 on->on_bi.bi_type, 0 );
851 static const char overtype[] = "over";
854 * returns TRUE (1) if the database is actually an overlay instance;
855 * FALSE (0) otherwise.
859 overlay_is_over( BackendDB *be )
861 return be->bd_info->bi_type == overtype;
865 * returns TRUE (1) if the given database is actually an overlay
866 * instance and, somewhere in the list, contains the requested overlay;
867 * FALSE (0) otherwise.
871 overlay_is_inst( BackendDB *be, const char *over_type )
875 assert( be != NULL );
877 if ( !overlay_is_over( be ) ) {
881 on = ((slap_overinfo *)be->bd_info->bi_private)->oi_list;
882 for ( ; on; on = on->on_next ) {
883 if ( strcmp( on->on_bi.bi_type, over_type ) == 0 ) {
892 overlay_register_control( BackendDB *be, const char *oid )
897 if ( slap_find_control_id( oid, &cid ) == LDAP_CONTROL_NOT_FOUND ) {
901 if ( SLAP_ISGLOBALOVERLAY( be ) ) {
904 /* add to all backends... */
905 LDAP_STAILQ_FOREACH( bd, &backendDB, be_next ) {
910 bd->be_ctrls[ cid ] = 1;
911 bd->be_ctrls[ SLAP_MAX_CIDS ] = 1;
917 be->be_ctrls[ cid ] = 1;
918 be->be_ctrls[ SLAP_MAX_CIDS ] = 1;
925 overlay_destroy_one( BackendDB *be, slap_overinst *on )
927 slap_overinfo *oi = on->on_info;
928 slap_overinst **oidx;
930 for ( oidx = &oi->oi_list; *oidx; oidx = &(*oidx)->on_next ) {
933 if ( on->on_bi.bi_db_destroy ) {
934 BackendInfo *bi_orig = be->bd_info;
935 be->bd_info = (BackendInfo *)on;
936 on->on_bi.bi_db_destroy( be );
937 be->bd_info = bi_orig;
945 /* add an overlay to a particular backend. */
947 overlay_config( BackendDB *be, const char *ov )
949 slap_overinst *on = NULL, *on2 = NULL;
950 slap_overinfo *oi = NULL;
951 BackendInfo *bi = NULL;
953 on = overlay_find( ov );
955 Debug( LDAP_DEBUG_ANY, "overlay \"%s\" not found\n", ov, 0, 0 );
959 /* If this is the first overlay on this backend, set up the
960 * overlay info structure
962 if ( !overlay_is_over( be ) ) {
965 /* NOTE: the first time a global overlay is configured,
966 * frontendDB gets this flag; it is used later by overlays
967 * to determine if they're stacked on top of the frontendDB */
968 if ( be->bd_info == frontendDB->bd_info || SLAP_ISGLOBALOVERLAY( be ) ) {
970 if ( on->on_bi.bi_flags & SLAPO_BFLAG_DBONLY ) {
971 Debug( LDAP_DEBUG_ANY, "overlay_config(): "
972 "overlay \"%s\" cannot be global.\n",
977 } else if ( on->on_bi.bi_flags & SLAPO_BFLAG_GLOBONLY ) {
978 Debug( LDAP_DEBUG_ANY, "overlay_config(): "
979 "overlay \"%s\" can only be global.\n",
984 oi = ch_malloc( sizeof( slap_overinfo ) );
985 oi->oi_orig = be->bd_info;
986 oi->oi_bi = *be->bd_info;
990 SLAP_DBFLAGS( be ) |= SLAP_DBFLAG_GLOBAL_OVERLAY;
993 /* Save a pointer to ourself in bi_private.
995 oi->oi_bi.bi_private = oi;
997 bi = (BackendInfo *)oi;
999 bi->bi_type = (char *)overtype;
1001 bi->bi_db_config = over_db_config;
1002 bi->bi_db_open = over_db_open;
1003 bi->bi_db_close = over_db_close;
1004 bi->bi_db_destroy = over_db_destroy;
1006 bi->bi_op_bind = over_op_bind;
1007 bi->bi_op_unbind = over_op_unbind;
1008 bi->bi_op_search = over_op_search;
1009 bi->bi_op_compare = over_op_compare;
1010 bi->bi_op_modify = over_op_modify;
1011 bi->bi_op_modrdn = over_op_modrdn;
1012 bi->bi_op_add = over_op_add;
1013 bi->bi_op_delete = over_op_delete;
1014 bi->bi_op_abandon = over_op_abandon;
1015 bi->bi_op_cancel = over_op_cancel;
1017 bi->bi_extended = over_op_extended;
1020 * this is fine because it has the same
1021 * args of the operations; we need to rework
1022 * all the hooks to share the same args
1023 * of the operations...
1025 bi->bi_operational = over_aux_operational;
1026 bi->bi_chk_referrals = over_aux_chk_referrals;
1027 bi->bi_chk_controls = over_aux_chk_controls;
1029 /* these have specific arglists */
1030 bi->bi_access_allowed = over_access_allowed;
1031 bi->bi_acl_group = over_acl_group;
1032 bi->bi_acl_attribute = over_acl_attribute;
1034 bi->bi_connection_init = over_connection_init;
1035 bi->bi_connection_destroy = over_connection_destroy;
1040 if ( overlay_is_inst( be, ov ) ) {
1041 Debug( LDAP_DEBUG_ANY, "overlay_config(): "
1042 "overlay \"%s\" already in list\n",
1044 if ( SLAPO_SINGLE( be ) ) {
1049 oi = be->bd_info->bi_private;
1052 /* Insert new overlay on head of list. Overlays are executed
1053 * in reverse of config order...
1055 on2 = ch_calloc( 1, sizeof(slap_overinst) );
1058 on2->on_next = oi->oi_list;
1061 /* Any initialization needed? */
1062 if ( on->on_bi.bi_db_init ) {
1064 be->bd_info = (BackendInfo *)on2;
1065 rc = on2->on_bi.bi_db_init( be );
1066 be->bd_info = (BackendInfo *)oi;
1068 oi->oi_list = on2->on_next;