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 );
213 for (next = on->on_next; on; on=next) {
222 over_back_response ( Operation *op, SlapReply *rs )
224 slap_overinfo *oi = op->o_callback->sc_private;
225 slap_overinst *on = oi->oi_list;
226 int rc = SLAP_CB_CONTINUE;
227 BackendDB *be = op->o_bd, db = *op->o_bd;
229 db.be_flags |= SLAP_DBFLAG_OVERLAY;
231 for (; on; on=on->on_next ) {
232 if ( on->on_response ) {
233 db.bd_info = (BackendInfo *)on;
234 rc = on->on_response( op, rs );
235 if ( rc != SLAP_CB_CONTINUE ) break;
246 AttributeDescription *desc,
248 slap_access_t access,
249 AccessControlState *state,
255 BackendDB *be = op->o_bd, db;
256 int rc = SLAP_CB_CONTINUE;
258 /* FIXME: used to happen for instance during abandon
259 * when global overlays are used... */
260 assert( op->o_bd != NULL );
262 bi = op->o_bd->bd_info;
263 /* Were we invoked on the frontend? */
264 if ( !bi->bi_access_allowed ) {
265 oi = frontendDB->bd_info->bi_private;
267 oi = op->o_bd->bd_info->bi_private;
271 for ( ; on; on = on->on_next ) {
272 if ( on->on_bi.bi_access_allowed ) {
273 /* NOTE: do not copy the structure until required */
274 if ( !SLAP_ISOVERLAY( op->o_bd ) ) {
276 db.be_flags |= SLAP_DBFLAG_OVERLAY;
280 op->o_bd->bd_info = (BackendInfo *)on;
281 rc = on->on_bi.bi_access_allowed( op, e,
282 desc, val, access, state, maskp );
283 if ( rc != SLAP_CB_CONTINUE ) break;
287 if ( rc == SLAP_CB_CONTINUE ) {
288 BI_access_allowed *bi_access_allowed;
290 /* if the database structure was changed, o_bd points to a
291 * copy of the structure; put the original bd_info in place */
292 if ( SLAP_ISOVERLAY( op->o_bd ) ) {
293 op->o_bd->bd_info = oi->oi_orig;
296 if ( oi->oi_orig->bi_access_allowed ) {
297 bi_access_allowed = oi->oi_orig->bi_access_allowed;
299 bi_access_allowed = slap_access_allowed;
302 rc = bi_access_allowed( op, e,
303 desc, val, access, state, maskp );
305 /* should not fall thru this far without anything happening... */
306 if ( rc == SLAP_CB_CONTINUE ) {
307 /* access not allowed */
312 op->o_bd->bd_info = bi;
321 struct berval *gr_ndn,
322 struct berval *op_ndn,
323 ObjectClass *group_oc,
324 AttributeDescription *group_at )
328 BackendInfo *bi = op->o_bd->bd_info;
329 BackendDB *be = op->o_bd, db;
330 int rc = SLAP_CB_CONTINUE;
332 /* FIXME: used to happen for instance during abandon
333 * when global overlays are used... */
334 assert( op->o_bd != NULL );
336 oi = op->o_bd->bd_info->bi_private;
339 for ( ; on; on = on->on_next ) {
340 if ( on->on_bi.bi_acl_group ) {
341 /* NOTE: do not copy the structure until required */
342 if ( !SLAP_ISOVERLAY( op->o_bd ) ) {
344 db.be_flags |= SLAP_DBFLAG_OVERLAY;
348 op->o_bd->bd_info = (BackendInfo *)on;
349 rc = on->on_bi.bi_acl_group( op, e,
350 gr_ndn, op_ndn, group_oc, group_at );
351 if ( rc != SLAP_CB_CONTINUE ) break;
355 if ( rc == SLAP_CB_CONTINUE ) {
356 BI_acl_group *bi_acl_group;
358 /* if the database structure was changed, o_bd points to a
359 * copy of the structure; put the original bd_info in place */
360 if ( SLAP_ISOVERLAY( op->o_bd ) ) {
361 op->o_bd->bd_info = oi->oi_orig;
364 if ( oi->oi_orig->bi_acl_group ) {
365 bi_acl_group = oi->oi_orig->bi_acl_group;
367 bi_acl_group = backend_group;
370 rc = bi_acl_group( op, e,
371 gr_ndn, op_ndn, group_oc, group_at );
373 /* should not fall thru this far without anything happening... */
374 if ( rc == SLAP_CB_CONTINUE ) {
375 /* access not allowed */
380 op->o_bd->bd_info = bi;
389 struct berval *entry_ndn,
390 AttributeDescription *entry_at,
392 slap_access_t access )
396 BackendInfo *bi = op->o_bd->bd_info;
397 BackendDB *be = op->o_bd, db;
398 int rc = SLAP_CB_CONTINUE;
400 /* FIXME: used to happen for instance during abandon
401 * when global overlays are used... */
402 assert( op->o_bd != NULL );
404 oi = op->o_bd->bd_info->bi_private;
407 for ( ; on; on = on->on_next ) {
408 if ( on->on_bi.bi_acl_attribute ) {
409 /* NOTE: do not copy the structure until required */
410 if ( !SLAP_ISOVERLAY( op->o_bd ) ) {
412 db.be_flags |= SLAP_DBFLAG_OVERLAY;
416 op->o_bd->bd_info = (BackendInfo *)on;
417 rc = on->on_bi.bi_acl_attribute( op, target,
418 entry_ndn, entry_at, vals, access );
419 if ( rc != SLAP_CB_CONTINUE ) break;
423 if ( rc == SLAP_CB_CONTINUE ) {
424 BI_acl_attribute *bi_acl_attribute;
426 /* if the database structure was changed, o_bd points to a
427 * copy of the structure; put the original bd_info in place */
428 if ( SLAP_ISOVERLAY( op->o_bd ) ) {
429 op->o_bd->bd_info = oi->oi_orig;
432 if ( oi->oi_orig->bi_acl_attribute ) {
433 bi_acl_attribute = oi->oi_orig->bi_acl_attribute;
435 bi_acl_attribute = backend_attribute;
438 rc = bi_acl_attribute( op, target,
439 entry_ndn, entry_at, vals, access );
441 /* should not fall thru this far without anything happening... */
442 if ( rc == SLAP_CB_CONTINUE ) {
443 /* access not allowed */
448 op->o_bd->bd_info = bi;
454 * default return code in case of missing backend function
455 * and overlay stack returning SLAP_CB_CONTINUE
457 static int op_rc[ op_last ] = {
458 LDAP_UNWILLING_TO_PERFORM, /* bind */
459 LDAP_UNWILLING_TO_PERFORM, /* unbind */
460 LDAP_UNWILLING_TO_PERFORM, /* search */
461 SLAP_CB_CONTINUE, /* compare; pass to frontend */
462 LDAP_UNWILLING_TO_PERFORM, /* modify */
463 LDAP_UNWILLING_TO_PERFORM, /* modrdn */
464 LDAP_UNWILLING_TO_PERFORM, /* add */
465 LDAP_UNWILLING_TO_PERFORM, /* delete */
466 LDAP_UNWILLING_TO_PERFORM, /* abandon */
467 LDAP_UNWILLING_TO_PERFORM, /* cancel */
468 LDAP_UNWILLING_TO_PERFORM, /* extended */
469 LDAP_SUCCESS, /* aux_operational */
470 LDAP_SUCCESS, /* aux_chk_referrals */
471 SLAP_CB_CONTINUE /* aux_chk_controls; pass to frontend */
477 slap_operation_t which,
483 int rc = SLAP_CB_CONTINUE;
485 for (; on; on=on->on_next ) {
486 func = &on->on_bi.bi_op_bind;
488 op->o_bd->bd_info = (BackendInfo *)on;
489 rc = func[which]( op, rs );
490 if ( rc != SLAP_CB_CONTINUE ) break;
494 func = &oi->oi_orig->bi_op_bind;
495 if ( func[which] && rc == SLAP_CB_CONTINUE ) {
496 op->o_bd->bd_info = oi->oi_orig;
497 rc = func[which]( op, rs );
499 /* should not fall thru this far without anything happening... */
500 if ( rc == SLAP_CB_CONTINUE ) {
504 /* The underlying backend didn't handle the request, make sure
505 * overlay cleanup is processed.
507 if ( rc == LDAP_UNWILLING_TO_PERFORM ) {
508 slap_callback *sc_next;
509 for ( ; op->o_callback && op->o_callback->sc_response !=
510 over_back_response; op->o_callback = sc_next ) {
511 sc_next = op->o_callback->sc_next;
512 if ( op->o_callback->sc_cleanup ) {
513 op->o_callback->sc_cleanup( op, rs );
524 slap_operation_t which
529 BackendDB *be = op->o_bd, db;
530 slap_callback cb = {NULL, over_back_response, NULL, NULL};
531 int rc = SLAP_CB_CONTINUE;
533 /* FIXME: used to happen for instance during abandon
534 * when global overlays are used... */
535 assert( op->o_bd != NULL );
537 oi = op->o_bd->bd_info->bi_private;
540 if ( !SLAP_ISOVERLAY( op->o_bd )) {
542 db.be_flags |= SLAP_DBFLAG_OVERLAY;
545 cb.sc_next = op->o_callback;
547 op->o_callback = &cb;
549 rc = overlay_op_walk( op, rs, which, oi, on );
552 op->o_callback = cb.sc_next;
557 over_op_bind( Operation *op, SlapReply *rs )
559 return over_op_func( op, rs, op_bind );
563 over_op_unbind( Operation *op, SlapReply *rs )
565 return over_op_func( op, rs, op_unbind );
569 over_op_search( Operation *op, SlapReply *rs )
571 return over_op_func( op, rs, op_search );
575 over_op_compare( Operation *op, SlapReply *rs )
577 return over_op_func( op, rs, op_compare );
581 over_op_modify( Operation *op, SlapReply *rs )
583 return over_op_func( op, rs, op_modify );
587 over_op_modrdn( Operation *op, SlapReply *rs )
589 return over_op_func( op, rs, op_modrdn );
593 over_op_add( Operation *op, SlapReply *rs )
595 return over_op_func( op, rs, op_add );
599 over_op_delete( Operation *op, SlapReply *rs )
601 return over_op_func( op, rs, op_delete );
605 over_op_abandon( Operation *op, SlapReply *rs )
607 return over_op_func( op, rs, op_abandon );
611 over_op_cancel( Operation *op, SlapReply *rs )
613 return over_op_func( op, rs, op_cancel );
617 over_op_extended( Operation *op, SlapReply *rs )
619 return over_op_func( op, rs, op_extended );
623 over_aux_operational( Operation *op, SlapReply *rs )
625 return over_op_func( op, rs, op_aux_operational );
629 over_aux_chk_referrals( Operation *op, SlapReply *rs )
631 return over_op_func( op, rs, op_aux_chk_referrals );
635 over_aux_chk_controls( Operation *op, SlapReply *rs )
637 return over_op_func( op, rs, op_aux_chk_controls );
647 over_connection_func(
650 enum conn_which which
656 int rc = SLAP_CB_CONTINUE;
657 BI_connection_init **func;
659 /* FIXME: used to happen for instance during abandon
660 * when global overlays are used... */
661 assert( bd != NULL );
663 oi = bd->bd_info->bi_private;
666 if ( !SLAP_ISOVERLAY( bd ) ) {
668 db.be_flags |= SLAP_DBFLAG_OVERLAY;
672 for ( ; on; on = on->on_next ) {
673 func = &on->on_bi.bi_connection_init;
674 if ( func[ which ] ) {
675 bd->bd_info = (BackendInfo *)on;
676 rc = func[ which ]( bd, conn );
677 if ( rc != SLAP_CB_CONTINUE ) break;
681 func = &oi->oi_orig->bi_connection_init;
682 if ( func[ which ] && rc == SLAP_CB_CONTINUE ) {
683 bd->bd_info = oi->oi_orig;
684 rc = func[ which ]( bd, conn );
686 /* should not fall thru this far without anything happening... */
687 if ( rc == SLAP_CB_CONTINUE ) {
688 rc = LDAP_UNWILLING_TO_PERFORM;
695 over_connection_init(
700 return over_connection_func( bd, conn, conn_init );
704 over_connection_destroy(
709 return over_connection_func( bd, conn, conn_destroy );
719 /* FIXME: check for duplicates? */
720 for ( tmp = overlays; tmp != NULL; tmp = tmp->on_next ) {
721 if ( strcmp( on->on_bi.bi_type, tmp->on_bi.bi_type ) == 0 ) {
722 Debug( LDAP_DEBUG_ANY,
723 "overlay_register(\"%s\"): "
724 "name already in use.\n",
725 on->on_bi.bi_type, 0, 0 );
729 if ( on->on_bi.bi_obsolete_names != NULL ) {
732 for ( i = 0; on->on_bi.bi_obsolete_names[ i ] != NULL; i++ ) {
733 if ( strcmp( on->on_bi.bi_obsolete_names[ i ], tmp->on_bi.bi_type ) == 0 ) {
734 Debug( LDAP_DEBUG_ANY,
735 "overlay_register(\"%s\"): "
736 "obsolete name \"%s\" already in use "
737 "by overlay \"%s\".\n",
739 on->on_bi.bi_obsolete_names[ i ],
740 tmp->on_bi.bi_type );
746 if ( tmp->on_bi.bi_obsolete_names != NULL ) {
749 for ( i = 0; tmp->on_bi.bi_obsolete_names[ i ] != NULL; i++ ) {
752 if ( strcmp( on->on_bi.bi_type, tmp->on_bi.bi_obsolete_names[ i ] ) == 0 ) {
753 Debug( LDAP_DEBUG_ANY,
754 "overlay_register(\"%s\"): "
755 "name already in use "
756 "as obsolete by overlay \"%s\".\n",
758 tmp->on_bi.bi_obsolete_names[ i ], 0 );
762 if ( on->on_bi.bi_obsolete_names != NULL ) {
763 for ( j = 0; on->on_bi.bi_obsolete_names[ j ] != NULL; j++ ) {
764 if ( strcmp( on->on_bi.bi_obsolete_names[ j ], tmp->on_bi.bi_obsolete_names[ i ] ) == 0 ) {
765 Debug( LDAP_DEBUG_ANY,
766 "overlay_register(\"%s\"): "
767 "obsolete name \"%s\" already in use "
768 "as obsolete by overlay \"%s\".\n",
770 on->on_bi.bi_obsolete_names[ j ],
771 tmp->on_bi.bi_type );
780 on->on_next = overlays;
786 * iterator on registered overlays; overlay_next( NULL ) returns the first
787 * overlay; subsequent calls with the previously returned value allow to
788 * iterate over the entire list; returns NULL when no more overlays are
805 * returns a specific registered overlay based on the type; NULL if not
810 overlay_find( const char *over_type )
812 slap_overinst *on = overlays;
814 assert( over_type != NULL );
816 for ( ; on; on = on->on_next ) {
817 if ( strcmp( on->on_bi.bi_type, over_type ) == 0 ) {
821 if ( on->on_bi.bi_obsolete_names != NULL ) {
824 for ( i = 0; on->on_bi.bi_obsolete_names[ i ] != NULL; i++ ) {
825 if ( strcmp( on->on_bi.bi_obsolete_names[ i ], over_type ) == 0 ) {
826 Debug( LDAP_DEBUG_ANY,
827 "overlay_find(\"%s\"): "
828 "obsolete name for \"%s\".\n",
829 on->on_bi.bi_obsolete_names[ i ],
830 on->on_bi.bi_type, 0 );
841 static const char overtype[] = "over";
844 * returns TRUE (1) if the database is actually an overlay instance;
845 * FALSE (0) otherwise.
849 overlay_is_over( BackendDB *be )
851 return be->bd_info->bi_type == overtype;
855 * returns TRUE (1) if the given database is actually an overlay
856 * instance and, somewhere in the list, contains the requested overlay;
857 * FALSE (0) otherwise.
861 overlay_is_inst( BackendDB *be, const char *over_type )
865 assert( be != NULL );
867 if ( !overlay_is_over( be ) ) {
871 on = ((slap_overinfo *)be->bd_info->bi_private)->oi_list;
872 for ( ; on; on = on->on_next ) {
873 if ( strcmp( on->on_bi.bi_type, over_type ) == 0 ) {
882 overlay_register_control( BackendDB *be, const char *oid )
887 if ( slap_find_control_id( oid, &cid ) == LDAP_CONTROL_NOT_FOUND ) {
891 if ( SLAP_ISGLOBALOVERLAY( be ) ) {
894 /* add to all backends... */
895 LDAP_STAILQ_FOREACH( bd, &backendDB, be_next ) {
900 bd->be_ctrls[ cid ] = 1;
901 bd->be_ctrls[ SLAP_MAX_CIDS ] = 1;
907 be->be_ctrls[ cid ] = 1;
908 be->be_ctrls[ SLAP_MAX_CIDS ] = 1;
915 overlay_destroy_one( BackendDB *be, slap_overinst *on )
917 slap_overinfo *oi = on->on_info;
918 slap_overinst **oidx;
920 for ( oidx = &oi->oi_list; *oidx; oidx = &(*oidx)->on_next ) {
923 if ( on->on_bi.bi_db_destroy ) {
924 BackendInfo *bi_orig = be->bd_info;
925 be->bd_info = (BackendInfo *)on;
926 on->on_bi.bi_db_destroy( be );
927 be->bd_info = bi_orig;
935 /* add an overlay to a particular backend. */
937 overlay_config( BackendDB *be, const char *ov )
939 slap_overinst *on = NULL, *on2 = NULL;
940 slap_overinfo *oi = NULL;
941 BackendInfo *bi = NULL;
943 on = overlay_find( ov );
945 Debug( LDAP_DEBUG_ANY, "overlay \"%s\" not found\n", ov, 0, 0 );
949 /* If this is the first overlay on this backend, set up the
950 * overlay info structure
952 if ( !overlay_is_over( be ) ) {
955 /* NOTE: the first time a global overlay is configured,
956 * frontendDB gets this flag; it is used later by overlays
957 * to determine if they're stacked on top of the frontendDB */
958 if ( be->bd_info == frontendDB->bd_info || SLAP_ISGLOBALOVERLAY( be ) ) {
960 if ( on->on_bi.bi_flags & SLAPO_BFLAG_DBONLY ) {
961 Debug( LDAP_DEBUG_ANY, "overlay_config(): "
962 "overlay \"%s\" cannot be global.\n",
967 } else if ( on->on_bi.bi_flags & SLAPO_BFLAG_GLOBONLY ) {
968 Debug( LDAP_DEBUG_ANY, "overlay_config(): "
969 "overlay \"%s\" can only be global.\n",
974 oi = ch_malloc( sizeof( slap_overinfo ) );
975 oi->oi_orig = be->bd_info;
976 oi->oi_bi = *be->bd_info;
980 SLAP_DBFLAGS( be ) |= SLAP_DBFLAG_GLOBAL_OVERLAY;
983 /* Save a pointer to ourself in bi_private.
985 oi->oi_bi.bi_private = oi;
987 bi = (BackendInfo *)oi;
989 bi->bi_type = (char *)overtype;
991 bi->bi_db_config = over_db_config;
992 bi->bi_db_open = over_db_open;
993 bi->bi_db_close = over_db_close;
994 bi->bi_db_destroy = over_db_destroy;
996 bi->bi_op_bind = over_op_bind;
997 bi->bi_op_unbind = over_op_unbind;
998 bi->bi_op_search = over_op_search;
999 bi->bi_op_compare = over_op_compare;
1000 bi->bi_op_modify = over_op_modify;
1001 bi->bi_op_modrdn = over_op_modrdn;
1002 bi->bi_op_add = over_op_add;
1003 bi->bi_op_delete = over_op_delete;
1004 bi->bi_op_abandon = over_op_abandon;
1005 bi->bi_op_cancel = over_op_cancel;
1007 bi->bi_extended = over_op_extended;
1010 * this is fine because it has the same
1011 * args of the operations; we need to rework
1012 * all the hooks to share the same args
1013 * of the operations...
1015 bi->bi_operational = over_aux_operational;
1016 bi->bi_chk_referrals = over_aux_chk_referrals;
1017 bi->bi_chk_controls = over_aux_chk_controls;
1019 /* these have specific arglists */
1020 bi->bi_access_allowed = over_access_allowed;
1021 bi->bi_acl_group = over_acl_group;
1022 bi->bi_acl_attribute = over_acl_attribute;
1024 bi->bi_connection_init = over_connection_init;
1025 bi->bi_connection_destroy = over_connection_destroy;
1030 if ( overlay_is_inst( be, ov ) ) {
1031 Debug( LDAP_DEBUG_ANY, "overlay_config(): "
1032 "overlay \"%s\" already in list\n",
1034 if ( SLAPO_SINGLE( be ) ) {
1039 oi = be->bd_info->bi_private;
1042 /* Insert new overlay on head of list. Overlays are executed
1043 * in reverse of config order...
1045 on2 = ch_calloc( 1, sizeof(slap_overinst) );
1048 on2->on_next = oi->oi_list;
1051 /* Any initialization needed? */
1052 if ( on->on_bi.bi_db_init ) {
1054 be->bd_info = (BackendInfo *)on2;
1055 rc = on2->on_bi.bi_db_init( be );
1056 be->bd_info = (BackendInfo *)oi;
1057 if ( rc ) return rc;