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;
249 AttributeDescription *desc,
251 slap_access_t access,
252 AccessControlState *state,
258 BackendDB *be = op->o_bd, db;
259 int rc = SLAP_CB_CONTINUE;
261 /* FIXME: used to happen for instance during abandon
262 * when global overlays are used... */
263 assert( op->o_bd != NULL );
265 bi = op->o_bd->bd_info;
266 /* Were we invoked on the frontend? */
267 if ( !bi->bi_access_allowed ) {
268 oi = frontendDB->bd_info->bi_private;
270 oi = op->o_bd->bd_info->bi_private;
274 for ( ; on; on = on->on_next ) {
275 if ( on->on_bi.bi_access_allowed ) {
276 /* NOTE: do not copy the structure until required */
277 if ( !SLAP_ISOVERLAY( op->o_bd ) ) {
279 db.be_flags |= SLAP_DBFLAG_OVERLAY;
283 op->o_bd->bd_info = (BackendInfo *)on;
284 rc = on->on_bi.bi_access_allowed( op, e,
285 desc, val, access, state, maskp );
286 if ( rc != SLAP_CB_CONTINUE ) break;
290 if ( rc == SLAP_CB_CONTINUE ) {
291 BI_access_allowed *bi_access_allowed;
293 /* if the database structure was changed, o_bd points to a
294 * copy of the structure; put the original bd_info in place */
295 if ( SLAP_ISOVERLAY( op->o_bd ) ) {
296 op->o_bd->bd_info = oi->oi_orig;
299 if ( oi->oi_orig->bi_access_allowed ) {
300 bi_access_allowed = oi->oi_orig->bi_access_allowed;
302 bi_access_allowed = slap_access_allowed;
305 rc = bi_access_allowed( op, e,
306 desc, val, access, state, maskp );
308 /* should not fall thru this far without anything happening... */
309 if ( rc == SLAP_CB_CONTINUE ) {
310 /* access not allowed */
315 op->o_bd->bd_info = bi;
324 struct berval *gr_ndn,
325 struct berval *op_ndn,
326 ObjectClass *group_oc,
327 AttributeDescription *group_at )
331 BackendInfo *bi = op->o_bd->bd_info;
332 BackendDB *be = op->o_bd, db;
333 int rc = SLAP_CB_CONTINUE;
335 /* FIXME: used to happen for instance during abandon
336 * when global overlays are used... */
337 assert( op->o_bd != NULL );
339 oi = op->o_bd->bd_info->bi_private;
342 for ( ; on; on = on->on_next ) {
343 if ( on->on_bi.bi_acl_group ) {
344 /* NOTE: do not copy the structure until required */
345 if ( !SLAP_ISOVERLAY( op->o_bd ) ) {
347 db.be_flags |= SLAP_DBFLAG_OVERLAY;
351 op->o_bd->bd_info = (BackendInfo *)on;
352 rc = on->on_bi.bi_acl_group( op, e,
353 gr_ndn, op_ndn, group_oc, group_at );
354 if ( rc != SLAP_CB_CONTINUE ) break;
358 if ( rc == SLAP_CB_CONTINUE ) {
359 BI_acl_group *bi_acl_group;
361 /* if the database structure was changed, o_bd points to a
362 * copy of the structure; put the original bd_info in place */
363 if ( SLAP_ISOVERLAY( op->o_bd ) ) {
364 op->o_bd->bd_info = oi->oi_orig;
367 if ( oi->oi_orig->bi_acl_group ) {
368 bi_acl_group = oi->oi_orig->bi_acl_group;
370 bi_acl_group = backend_group;
373 rc = bi_acl_group( op, e,
374 gr_ndn, op_ndn, group_oc, group_at );
376 /* should not fall thru this far without anything happening... */
377 if ( rc == SLAP_CB_CONTINUE ) {
378 /* access not allowed */
383 op->o_bd->bd_info = bi;
392 struct berval *entry_ndn,
393 AttributeDescription *entry_at,
395 slap_access_t access )
399 BackendInfo *bi = op->o_bd->bd_info;
400 BackendDB *be = op->o_bd, db;
401 int rc = SLAP_CB_CONTINUE;
403 /* FIXME: used to happen for instance during abandon
404 * when global overlays are used... */
405 assert( op->o_bd != NULL );
407 oi = op->o_bd->bd_info->bi_private;
410 for ( ; on; on = on->on_next ) {
411 if ( on->on_bi.bi_acl_attribute ) {
412 /* NOTE: do not copy the structure until required */
413 if ( !SLAP_ISOVERLAY( op->o_bd ) ) {
415 db.be_flags |= SLAP_DBFLAG_OVERLAY;
419 op->o_bd->bd_info = (BackendInfo *)on;
420 rc = on->on_bi.bi_acl_attribute( op, target,
421 entry_ndn, entry_at, vals, access );
422 if ( rc != SLAP_CB_CONTINUE ) break;
426 if ( rc == SLAP_CB_CONTINUE ) {
427 BI_acl_attribute *bi_acl_attribute;
429 /* if the database structure was changed, o_bd points to a
430 * copy of the structure; put the original bd_info in place */
431 if ( SLAP_ISOVERLAY( op->o_bd ) ) {
432 op->o_bd->bd_info = oi->oi_orig;
435 if ( oi->oi_orig->bi_acl_attribute ) {
436 bi_acl_attribute = oi->oi_orig->bi_acl_attribute;
438 bi_acl_attribute = backend_attribute;
441 rc = bi_acl_attribute( op, target,
442 entry_ndn, entry_at, vals, access );
444 /* should not fall thru this far without anything happening... */
445 if ( rc == SLAP_CB_CONTINUE ) {
446 /* access not allowed */
451 op->o_bd->bd_info = bi;
457 * default return code in case of missing backend function
458 * and overlay stack returning SLAP_CB_CONTINUE
460 static int op_rc[ op_last ] = {
461 LDAP_UNWILLING_TO_PERFORM, /* bind */
462 LDAP_UNWILLING_TO_PERFORM, /* unbind */
463 LDAP_UNWILLING_TO_PERFORM, /* search */
464 SLAP_CB_CONTINUE, /* compare; pass to frontend */
465 LDAP_UNWILLING_TO_PERFORM, /* modify */
466 LDAP_UNWILLING_TO_PERFORM, /* modrdn */
467 LDAP_UNWILLING_TO_PERFORM, /* add */
468 LDAP_UNWILLING_TO_PERFORM, /* delete */
469 LDAP_UNWILLING_TO_PERFORM, /* abandon */
470 LDAP_UNWILLING_TO_PERFORM, /* cancel */
471 LDAP_UNWILLING_TO_PERFORM, /* extended */
472 LDAP_SUCCESS, /* aux_operational */
473 LDAP_SUCCESS, /* aux_chk_referrals */
474 SLAP_CB_CONTINUE /* aux_chk_controls; pass to frontend */
480 slap_operation_t which,
486 int rc = SLAP_CB_CONTINUE;
488 for (; on; on=on->on_next ) {
489 func = &on->on_bi.bi_op_bind;
491 op->o_bd->bd_info = (BackendInfo *)on;
492 rc = func[which]( op, rs );
493 if ( rc != SLAP_CB_CONTINUE ) break;
497 func = &oi->oi_orig->bi_op_bind;
498 if ( func[which] && rc == SLAP_CB_CONTINUE ) {
499 op->o_bd->bd_info = oi->oi_orig;
500 rc = func[which]( op, rs );
502 /* should not fall thru this far without anything happening... */
503 if ( rc == SLAP_CB_CONTINUE ) {
507 /* The underlying backend didn't handle the request, make sure
508 * overlay cleanup is processed.
510 if ( rc == LDAP_UNWILLING_TO_PERFORM ) {
511 slap_callback *sc_next;
512 for ( ; op->o_callback && op->o_callback->sc_response !=
513 over_back_response; op->o_callback = sc_next ) {
514 sc_next = op->o_callback->sc_next;
515 if ( op->o_callback->sc_cleanup ) {
516 op->o_callback->sc_cleanup( op, rs );
527 slap_operation_t which
532 BackendDB *be = op->o_bd, db;
533 slap_callback cb = {NULL, over_back_response, NULL, NULL};
534 int rc = SLAP_CB_CONTINUE;
536 /* FIXME: used to happen for instance during abandon
537 * when global overlays are used... */
538 assert( op->o_bd != NULL );
540 oi = op->o_bd->bd_info->bi_private;
543 if ( !SLAP_ISOVERLAY( op->o_bd )) {
545 db.be_flags |= SLAP_DBFLAG_OVERLAY;
548 cb.sc_next = op->o_callback;
550 op->o_callback = &cb;
552 rc = overlay_op_walk( op, rs, which, oi, on );
555 op->o_callback = cb.sc_next;
560 over_op_bind( Operation *op, SlapReply *rs )
562 return over_op_func( op, rs, op_bind );
566 over_op_unbind( Operation *op, SlapReply *rs )
568 return over_op_func( op, rs, op_unbind );
572 over_op_search( Operation *op, SlapReply *rs )
574 return over_op_func( op, rs, op_search );
578 over_op_compare( Operation *op, SlapReply *rs )
580 return over_op_func( op, rs, op_compare );
584 over_op_modify( Operation *op, SlapReply *rs )
586 return over_op_func( op, rs, op_modify );
590 over_op_modrdn( Operation *op, SlapReply *rs )
592 return over_op_func( op, rs, op_modrdn );
596 over_op_add( Operation *op, SlapReply *rs )
598 return over_op_func( op, rs, op_add );
602 over_op_delete( Operation *op, SlapReply *rs )
604 return over_op_func( op, rs, op_delete );
608 over_op_abandon( Operation *op, SlapReply *rs )
610 return over_op_func( op, rs, op_abandon );
614 over_op_cancel( Operation *op, SlapReply *rs )
616 return over_op_func( op, rs, op_cancel );
620 over_op_extended( Operation *op, SlapReply *rs )
622 return over_op_func( op, rs, op_extended );
626 over_aux_operational( Operation *op, SlapReply *rs )
628 return over_op_func( op, rs, op_aux_operational );
632 over_aux_chk_referrals( Operation *op, SlapReply *rs )
634 return over_op_func( op, rs, op_aux_chk_referrals );
638 over_aux_chk_controls( Operation *op, SlapReply *rs )
640 return over_op_func( op, rs, op_aux_chk_controls );
650 over_connection_func(
653 enum conn_which which
659 int rc = SLAP_CB_CONTINUE;
660 BI_connection_init **func;
662 /* FIXME: used to happen for instance during abandon
663 * when global overlays are used... */
664 assert( bd != NULL );
666 oi = bd->bd_info->bi_private;
669 if ( !SLAP_ISOVERLAY( bd ) ) {
671 db.be_flags |= SLAP_DBFLAG_OVERLAY;
675 for ( ; on; on = on->on_next ) {
676 func = &on->on_bi.bi_connection_init;
677 if ( func[ which ] ) {
678 bd->bd_info = (BackendInfo *)on;
679 rc = func[ which ]( bd, conn );
680 if ( rc != SLAP_CB_CONTINUE ) break;
684 func = &oi->oi_orig->bi_connection_init;
685 if ( func[ which ] && rc == SLAP_CB_CONTINUE ) {
686 bd->bd_info = oi->oi_orig;
687 rc = func[ which ]( bd, conn );
689 /* should not fall thru this far without anything happening... */
690 if ( rc == SLAP_CB_CONTINUE ) {
691 rc = LDAP_UNWILLING_TO_PERFORM;
698 over_connection_init(
703 return over_connection_func( bd, conn, conn_init );
707 over_connection_destroy(
712 return over_connection_func( bd, conn, conn_destroy );
722 /* FIXME: check for duplicates? */
723 for ( tmp = overlays; tmp != NULL; tmp = tmp->on_next ) {
724 if ( strcmp( on->on_bi.bi_type, tmp->on_bi.bi_type ) == 0 ) {
725 Debug( LDAP_DEBUG_ANY,
726 "overlay_register(\"%s\"): "
727 "name already in use.\n",
728 on->on_bi.bi_type, 0, 0 );
732 if ( on->on_bi.bi_obsolete_names != NULL ) {
735 for ( i = 0; on->on_bi.bi_obsolete_names[ i ] != NULL; i++ ) {
736 if ( strcmp( on->on_bi.bi_obsolete_names[ i ], tmp->on_bi.bi_type ) == 0 ) {
737 Debug( LDAP_DEBUG_ANY,
738 "overlay_register(\"%s\"): "
739 "obsolete name \"%s\" already in use "
740 "by overlay \"%s\".\n",
742 on->on_bi.bi_obsolete_names[ i ],
743 tmp->on_bi.bi_type );
749 if ( tmp->on_bi.bi_obsolete_names != NULL ) {
752 for ( i = 0; tmp->on_bi.bi_obsolete_names[ i ] != NULL; i++ ) {
755 if ( strcmp( on->on_bi.bi_type, tmp->on_bi.bi_obsolete_names[ i ] ) == 0 ) {
756 Debug( LDAP_DEBUG_ANY,
757 "overlay_register(\"%s\"): "
758 "name already in use "
759 "as obsolete by overlay \"%s\".\n",
761 tmp->on_bi.bi_obsolete_names[ i ], 0 );
765 if ( on->on_bi.bi_obsolete_names != NULL ) {
766 for ( j = 0; on->on_bi.bi_obsolete_names[ j ] != NULL; j++ ) {
767 if ( strcmp( on->on_bi.bi_obsolete_names[ j ], tmp->on_bi.bi_obsolete_names[ i ] ) == 0 ) {
768 Debug( LDAP_DEBUG_ANY,
769 "overlay_register(\"%s\"): "
770 "obsolete name \"%s\" already in use "
771 "as obsolete by overlay \"%s\".\n",
773 on->on_bi.bi_obsolete_names[ j ],
774 tmp->on_bi.bi_type );
783 on->on_next = overlays;
789 * iterator on registered overlays; overlay_next( NULL ) returns the first
790 * overlay; subsequent calls with the previously returned value allow to
791 * iterate over the entire list; returns NULL when no more overlays are
808 * returns a specific registered overlay based on the type; NULL if not
813 overlay_find( const char *over_type )
815 slap_overinst *on = overlays;
817 assert( over_type != NULL );
819 for ( ; on; on = on->on_next ) {
820 if ( strcmp( on->on_bi.bi_type, over_type ) == 0 ) {
824 if ( on->on_bi.bi_obsolete_names != NULL ) {
827 for ( i = 0; on->on_bi.bi_obsolete_names[ i ] != NULL; i++ ) {
828 if ( strcmp( on->on_bi.bi_obsolete_names[ i ], over_type ) == 0 ) {
829 Debug( LDAP_DEBUG_ANY,
830 "overlay_find(\"%s\"): "
831 "obsolete name for \"%s\".\n",
832 on->on_bi.bi_obsolete_names[ i ],
833 on->on_bi.bi_type, 0 );
844 static const char overtype[] = "over";
847 * returns TRUE (1) if the database is actually an overlay instance;
848 * FALSE (0) otherwise.
852 overlay_is_over( BackendDB *be )
854 return be->bd_info->bi_type == overtype;
858 * returns TRUE (1) if the given database is actually an overlay
859 * instance and, somewhere in the list, contains the requested overlay;
860 * FALSE (0) otherwise.
864 overlay_is_inst( BackendDB *be, const char *over_type )
868 assert( be != NULL );
870 if ( !overlay_is_over( be ) ) {
874 on = ((slap_overinfo *)be->bd_info->bi_private)->oi_list;
875 for ( ; on; on = on->on_next ) {
876 if ( strcmp( on->on_bi.bi_type, over_type ) == 0 ) {
885 overlay_register_control( BackendDB *be, const char *oid )
890 if ( slap_find_control_id( oid, &cid ) == LDAP_CONTROL_NOT_FOUND ) {
894 if ( SLAP_ISGLOBALOVERLAY( be ) ) {
897 /* add to all backends... */
898 LDAP_STAILQ_FOREACH( bd, &backendDB, be_next ) {
903 bd->be_ctrls[ cid ] = 1;
904 bd->be_ctrls[ SLAP_MAX_CIDS ] = 1;
910 be->be_ctrls[ cid ] = 1;
911 be->be_ctrls[ SLAP_MAX_CIDS ] = 1;
918 overlay_destroy_one( BackendDB *be, slap_overinst *on )
920 slap_overinfo *oi = on->on_info;
921 slap_overinst **oidx;
923 for ( oidx = &oi->oi_list; *oidx; oidx = &(*oidx)->on_next ) {
926 if ( on->on_bi.bi_db_destroy ) {
927 BackendInfo *bi_orig = be->bd_info;
928 be->bd_info = (BackendInfo *)on;
929 on->on_bi.bi_db_destroy( be );
930 be->bd_info = bi_orig;
938 /* add an overlay to a particular backend. */
940 overlay_config( BackendDB *be, const char *ov )
942 slap_overinst *on = NULL, *on2 = NULL;
943 slap_overinfo *oi = NULL;
944 BackendInfo *bi = NULL;
946 on = overlay_find( ov );
948 Debug( LDAP_DEBUG_ANY, "overlay \"%s\" not found\n", ov, 0, 0 );
952 /* If this is the first overlay on this backend, set up the
953 * overlay info structure
955 if ( !overlay_is_over( be ) ) {
958 /* NOTE: the first time a global overlay is configured,
959 * frontendDB gets this flag; it is used later by overlays
960 * to determine if they're stacked on top of the frontendDB */
961 if ( be->bd_info == frontendDB->bd_info || SLAP_ISGLOBALOVERLAY( be ) ) {
963 if ( on->on_bi.bi_flags & SLAPO_BFLAG_DBONLY ) {
964 Debug( LDAP_DEBUG_ANY, "overlay_config(): "
965 "overlay \"%s\" cannot be global.\n",
970 } else if ( on->on_bi.bi_flags & SLAPO_BFLAG_GLOBONLY ) {
971 Debug( LDAP_DEBUG_ANY, "overlay_config(): "
972 "overlay \"%s\" can only be global.\n",
977 oi = ch_malloc( sizeof( slap_overinfo ) );
978 oi->oi_orig = be->bd_info;
979 oi->oi_bi = *be->bd_info;
983 SLAP_DBFLAGS( be ) |= SLAP_DBFLAG_GLOBAL_OVERLAY;
986 /* Save a pointer to ourself in bi_private.
988 oi->oi_bi.bi_private = oi;
990 bi = (BackendInfo *)oi;
992 bi->bi_type = (char *)overtype;
994 bi->bi_db_config = over_db_config;
995 bi->bi_db_open = over_db_open;
996 bi->bi_db_close = over_db_close;
997 bi->bi_db_destroy = over_db_destroy;
999 bi->bi_op_bind = over_op_bind;
1000 bi->bi_op_unbind = over_op_unbind;
1001 bi->bi_op_search = over_op_search;
1002 bi->bi_op_compare = over_op_compare;
1003 bi->bi_op_modify = over_op_modify;
1004 bi->bi_op_modrdn = over_op_modrdn;
1005 bi->bi_op_add = over_op_add;
1006 bi->bi_op_delete = over_op_delete;
1007 bi->bi_op_abandon = over_op_abandon;
1008 bi->bi_op_cancel = over_op_cancel;
1010 bi->bi_extended = over_op_extended;
1013 * this is fine because it has the same
1014 * args of the operations; we need to rework
1015 * all the hooks to share the same args
1016 * of the operations...
1018 bi->bi_operational = over_aux_operational;
1019 bi->bi_chk_referrals = over_aux_chk_referrals;
1020 bi->bi_chk_controls = over_aux_chk_controls;
1022 /* these have specific arglists */
1023 bi->bi_access_allowed = over_access_allowed;
1024 bi->bi_acl_group = over_acl_group;
1025 bi->bi_acl_attribute = over_acl_attribute;
1027 bi->bi_connection_init = over_connection_init;
1028 bi->bi_connection_destroy = over_connection_destroy;
1033 if ( overlay_is_inst( be, ov ) ) {
1034 Debug( LDAP_DEBUG_ANY, "overlay_config(): "
1035 "overlay \"%s\" already in list\n",
1037 if ( SLAPO_SINGLE( be ) ) {
1042 oi = be->bd_info->bi_private;
1045 /* Insert new overlay on head of list. Overlays are executed
1046 * in reverse of config order...
1048 on2 = ch_calloc( 1, sizeof(slap_overinst) );
1051 on2->on_next = oi->oi_list;
1054 /* Any initialization needed? */
1055 if ( on->on_bi.bi_db_init ) {
1057 be->bd_info = (BackendInfo *)on2;
1058 rc = on2->on_bi.bi_db_init( be );
1059 be->bd_info = (BackendInfo *)oi;
1061 oi->oi_list = on2->on_next;