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;
242 #ifdef SLAP_OVERLAY_ACCESS
247 AttributeDescription *desc,
249 slap_access_t access,
250 AccessControlState *state,
256 BackendDB *be = op->o_bd, db;
257 int rc = SLAP_CB_CONTINUE;
259 /* FIXME: used to happen for instance during abandon
260 * when global overlays are used... */
261 assert( op->o_bd != NULL );
263 bi = op->o_bd->bd_info;
264 /* Were we invoked on the frontend? */
265 if ( !bi->bi_access_allowed ) {
266 oi = frontendDB->bd_info->bi_private;
268 oi = op->o_bd->bd_info->bi_private;
272 for ( ; on; on = on->on_next ) {
273 if ( on->on_bi.bi_access_allowed ) {
274 /* NOTE: do not copy the structure until required */
275 if ( !SLAP_ISOVERLAY( op->o_bd ) ) {
277 db.be_flags |= SLAP_DBFLAG_OVERLAY;
281 op->o_bd->bd_info = (BackendInfo *)on;
282 rc = on->on_bi.bi_access_allowed( op, e,
283 desc, val, access, state, maskp );
284 if ( rc != SLAP_CB_CONTINUE ) break;
288 if ( rc == SLAP_CB_CONTINUE ) {
289 BI_access_allowed *bi_access_allowed;
291 /* if the database structure was changed, o_bd points to a
292 * copy of the structure; put the original bd_info in place */
293 if ( SLAP_ISOVERLAY( op->o_bd ) ) {
294 op->o_bd->bd_info = oi->oi_orig;
297 if ( oi->oi_orig->bi_access_allowed ) {
298 bi_access_allowed = oi->oi_orig->bi_access_allowed;
300 bi_access_allowed = slap_access_allowed;
303 rc = bi_access_allowed( op, e,
304 desc, val, access, state, maskp );
306 /* should not fall thru this far without anything happening... */
307 if ( rc == SLAP_CB_CONTINUE ) {
308 /* access not allowed */
313 op->o_bd->bd_info = bi;
322 struct berval *gr_ndn,
323 struct berval *op_ndn,
324 ObjectClass *group_oc,
325 AttributeDescription *group_at )
329 BackendInfo *bi = op->o_bd->bd_info;
330 BackendDB *be = op->o_bd, db;
331 int rc = SLAP_CB_CONTINUE;
333 /* FIXME: used to happen for instance during abandon
334 * when global overlays are used... */
335 assert( op->o_bd != NULL );
337 oi = op->o_bd->bd_info->bi_private;
340 for ( ; on; on = on->on_next ) {
341 if ( on->on_bi.bi_acl_group ) {
342 /* NOTE: do not copy the structure until required */
343 if ( !SLAP_ISOVERLAY( op->o_bd ) ) {
345 db.be_flags |= SLAP_DBFLAG_OVERLAY;
349 op->o_bd->bd_info = (BackendInfo *)on;
350 rc = on->on_bi.bi_acl_group( op, e,
351 gr_ndn, op_ndn, group_oc, group_at );
352 if ( rc != SLAP_CB_CONTINUE ) break;
356 if ( rc == SLAP_CB_CONTINUE ) {
357 BI_acl_group *bi_acl_group;
359 /* if the database structure was changed, o_bd points to a
360 * copy of the structure; put the original bd_info in place */
361 if ( SLAP_ISOVERLAY( op->o_bd ) ) {
362 op->o_bd->bd_info = oi->oi_orig;
365 if ( oi->oi_orig->bi_acl_group ) {
366 bi_acl_group = oi->oi_orig->bi_acl_group;
368 bi_acl_group = backend_group;
371 rc = bi_acl_group( op, e,
372 gr_ndn, op_ndn, group_oc, group_at );
374 /* should not fall thru this far without anything happening... */
375 if ( rc == SLAP_CB_CONTINUE ) {
376 /* access not allowed */
381 op->o_bd->bd_info = bi;
390 struct berval *entry_ndn,
391 AttributeDescription *entry_at,
393 slap_access_t access )
397 BackendInfo *bi = op->o_bd->bd_info;
398 BackendDB *be = op->o_bd, db;
399 int rc = SLAP_CB_CONTINUE;
401 /* FIXME: used to happen for instance during abandon
402 * when global overlays are used... */
403 assert( op->o_bd != NULL );
405 oi = op->o_bd->bd_info->bi_private;
408 for ( ; on; on = on->on_next ) {
409 if ( on->on_bi.bi_acl_attribute ) {
410 /* NOTE: do not copy the structure until required */
411 if ( !SLAP_ISOVERLAY( op->o_bd ) ) {
413 db.be_flags |= SLAP_DBFLAG_OVERLAY;
417 op->o_bd->bd_info = (BackendInfo *)on;
418 rc = on->on_bi.bi_acl_attribute( op, target,
419 entry_ndn, entry_at, vals, access );
420 if ( rc != SLAP_CB_CONTINUE ) break;
424 if ( rc == SLAP_CB_CONTINUE ) {
425 BI_acl_attribute *bi_acl_attribute;
427 /* if the database structure was changed, o_bd points to a
428 * copy of the structure; put the original bd_info in place */
429 if ( SLAP_ISOVERLAY( op->o_bd ) ) {
430 op->o_bd->bd_info = oi->oi_orig;
433 if ( oi->oi_orig->bi_acl_attribute ) {
434 bi_acl_attribute = oi->oi_orig->bi_acl_attribute;
436 bi_acl_attribute = backend_attribute;
439 rc = bi_acl_attribute( op, target,
440 entry_ndn, entry_at, vals, access );
442 /* should not fall thru this far without anything happening... */
443 if ( rc == SLAP_CB_CONTINUE ) {
444 /* access not allowed */
449 op->o_bd->bd_info = bi;
453 #endif /* SLAP_OVERLAY_ACCESS */
456 * default return code in case of missing backend function
457 * and overlay stack returning SLAP_CB_CONTINUE
459 static int op_rc[ op_last ] = {
460 LDAP_UNWILLING_TO_PERFORM, /* bind */
461 LDAP_UNWILLING_TO_PERFORM, /* unbind */
462 LDAP_UNWILLING_TO_PERFORM, /* search */
463 SLAP_CB_CONTINUE, /* compare; pass to frontend */
464 LDAP_UNWILLING_TO_PERFORM, /* modify */
465 LDAP_UNWILLING_TO_PERFORM, /* modrdn */
466 LDAP_UNWILLING_TO_PERFORM, /* add */
467 LDAP_UNWILLING_TO_PERFORM, /* delete */
468 LDAP_UNWILLING_TO_PERFORM, /* abandon */
469 LDAP_UNWILLING_TO_PERFORM, /* cancel */
470 LDAP_UNWILLING_TO_PERFORM, /* extended */
471 LDAP_SUCCESS, /* aux_operational */
472 LDAP_SUCCESS, /* aux_chk_referrals */
473 SLAP_CB_CONTINUE /* aux_chk_controls; pass to frontend */
479 slap_operation_t which,
485 int rc = SLAP_CB_CONTINUE;
487 for (; on; on=on->on_next ) {
488 func = &on->on_bi.bi_op_bind;
490 op->o_bd->bd_info = (BackendInfo *)on;
491 rc = func[which]( op, rs );
492 if ( rc != SLAP_CB_CONTINUE ) break;
496 func = &oi->oi_orig->bi_op_bind;
497 if ( func[which] && rc == SLAP_CB_CONTINUE ) {
498 op->o_bd->bd_info = oi->oi_orig;
499 rc = func[which]( op, rs );
501 /* should not fall thru this far without anything happening... */
502 if ( rc == SLAP_CB_CONTINUE ) {
506 /* The underlying backend didn't handle the request, make sure
507 * overlay cleanup is processed.
509 if ( rc == LDAP_UNWILLING_TO_PERFORM ) {
510 slap_callback *sc_next;
511 for ( ; op->o_callback && op->o_callback->sc_response !=
512 over_back_response; op->o_callback = sc_next ) {
513 sc_next = op->o_callback->sc_next;
514 if ( op->o_callback->sc_cleanup ) {
515 op->o_callback->sc_cleanup( op, rs );
526 slap_operation_t which
531 BackendDB *be = op->o_bd, db;
532 slap_callback cb = {NULL, over_back_response, NULL, NULL};
533 int rc = SLAP_CB_CONTINUE;
535 /* FIXME: used to happen for instance during abandon
536 * when global overlays are used... */
537 assert( op->o_bd != NULL );
539 oi = op->o_bd->bd_info->bi_private;
542 if ( !SLAP_ISOVERLAY( op->o_bd )) {
544 db.be_flags |= SLAP_DBFLAG_OVERLAY;
547 cb.sc_next = op->o_callback;
549 op->o_callback = &cb;
551 rc = overlay_op_walk( op, rs, which, oi, on );
554 op->o_callback = cb.sc_next;
559 over_op_bind( Operation *op, SlapReply *rs )
561 return over_op_func( op, rs, op_bind );
565 over_op_unbind( Operation *op, SlapReply *rs )
567 return over_op_func( op, rs, op_unbind );
571 over_op_search( Operation *op, SlapReply *rs )
573 return over_op_func( op, rs, op_search );
577 over_op_compare( Operation *op, SlapReply *rs )
579 return over_op_func( op, rs, op_compare );
583 over_op_modify( Operation *op, SlapReply *rs )
585 return over_op_func( op, rs, op_modify );
589 over_op_modrdn( Operation *op, SlapReply *rs )
591 return over_op_func( op, rs, op_modrdn );
595 over_op_add( Operation *op, SlapReply *rs )
597 return over_op_func( op, rs, op_add );
601 over_op_delete( Operation *op, SlapReply *rs )
603 return over_op_func( op, rs, op_delete );
607 over_op_abandon( Operation *op, SlapReply *rs )
609 return over_op_func( op, rs, op_abandon );
613 over_op_cancel( Operation *op, SlapReply *rs )
615 return over_op_func( op, rs, op_cancel );
619 over_op_extended( Operation *op, SlapReply *rs )
621 return over_op_func( op, rs, op_extended );
625 over_aux_operational( Operation *op, SlapReply *rs )
627 return over_op_func( op, rs, op_aux_operational );
631 over_aux_chk_referrals( Operation *op, SlapReply *rs )
633 return over_op_func( op, rs, op_aux_chk_referrals );
637 over_aux_chk_controls( Operation *op, SlapReply *rs )
639 return over_op_func( op, rs, op_aux_chk_controls );
649 over_connection_func(
652 enum conn_which which
658 int rc = SLAP_CB_CONTINUE;
659 BI_connection_init **func;
661 /* FIXME: used to happen for instance during abandon
662 * when global overlays are used... */
663 assert( bd != NULL );
665 oi = bd->bd_info->bi_private;
668 if ( !SLAP_ISOVERLAY( bd ) ) {
670 db.be_flags |= SLAP_DBFLAG_OVERLAY;
674 for ( ; on; on = on->on_next ) {
675 func = &on->on_bi.bi_connection_init;
676 if ( func[ which ] ) {
677 bd->bd_info = (BackendInfo *)on;
678 rc = func[ which ]( bd, conn );
679 if ( rc != SLAP_CB_CONTINUE ) break;
683 func = &oi->oi_orig->bi_connection_init;
684 if ( func[ which ] && rc == SLAP_CB_CONTINUE ) {
685 bd->bd_info = oi->oi_orig;
686 rc = func[ which ]( bd, conn );
688 /* should not fall thru this far without anything happening... */
689 if ( rc == SLAP_CB_CONTINUE ) {
690 rc = LDAP_UNWILLING_TO_PERFORM;
697 over_connection_init(
702 return over_connection_func( bd, conn, conn_init );
706 over_connection_destroy(
711 return over_connection_func( bd, conn, conn_destroy );
721 /* FIXME: check for duplicates? */
722 for ( tmp = overlays; tmp != NULL; tmp = tmp->on_next ) {
723 if ( strcmp( on->on_bi.bi_type, tmp->on_bi.bi_type ) == 0 ) {
724 Debug( LDAP_DEBUG_ANY,
725 "overlay_register(\"%s\"): "
726 "name already in use.\n",
727 on->on_bi.bi_type, 0, 0 );
731 if ( on->on_bi.bi_obsolete_names != NULL ) {
734 for ( i = 0; on->on_bi.bi_obsolete_names[ i ] != NULL; i++ ) {
735 if ( strcmp( on->on_bi.bi_obsolete_names[ i ], tmp->on_bi.bi_type ) == 0 ) {
736 Debug( LDAP_DEBUG_ANY,
737 "overlay_register(\"%s\"): "
738 "obsolete name \"%s\" already in use "
739 "by overlay \"%s\".\n",
741 on->on_bi.bi_obsolete_names[ i ],
742 tmp->on_bi.bi_type );
748 if ( tmp->on_bi.bi_obsolete_names != NULL ) {
751 for ( i = 0; tmp->on_bi.bi_obsolete_names[ i ] != NULL; i++ ) {
754 if ( strcmp( on->on_bi.bi_type, tmp->on_bi.bi_obsolete_names[ i ] ) == 0 ) {
755 Debug( LDAP_DEBUG_ANY,
756 "overlay_register(\"%s\"): "
757 "name already in use "
758 "as obsolete by overlay \"%s\".\n",
760 tmp->on_bi.bi_obsolete_names[ i ], 0 );
764 if ( on->on_bi.bi_obsolete_names != NULL ) {
765 for ( j = 0; on->on_bi.bi_obsolete_names[ j ] != NULL; j++ ) {
766 if ( strcmp( on->on_bi.bi_obsolete_names[ j ], tmp->on_bi.bi_obsolete_names[ i ] ) == 0 ) {
767 Debug( LDAP_DEBUG_ANY,
768 "overlay_register(\"%s\"): "
769 "obsolete name \"%s\" already in use "
770 "as obsolete by overlay \"%s\".\n",
772 on->on_bi.bi_obsolete_names[ j ],
773 tmp->on_bi.bi_type );
782 on->on_next = overlays;
788 * iterator on registered overlays; overlay_next( NULL ) returns the first
789 * overlay; subsequent calls with the previously returned value allow to
790 * iterate over the entire list; returns NULL when no more overlays are
807 * returns a specific registered overlay based on the type; NULL if not
812 overlay_find( const char *over_type )
814 slap_overinst *on = overlays;
816 assert( over_type != NULL );
818 for ( ; on; on = on->on_next ) {
819 if ( strcmp( on->on_bi.bi_type, over_type ) == 0 ) {
823 if ( on->on_bi.bi_obsolete_names != NULL ) {
826 for ( i = 0; on->on_bi.bi_obsolete_names[ i ] != NULL; i++ ) {
827 if ( strcmp( on->on_bi.bi_obsolete_names[ i ], over_type ) == 0 ) {
828 Debug( LDAP_DEBUG_ANY,
829 "overlay_find(\"%s\"): "
830 "obsolete name for \"%s\".\n",
831 on->on_bi.bi_obsolete_names[ i ],
832 on->on_bi.bi_type, 0 );
843 static const char overtype[] = "over";
846 * returns TRUE (1) if the database is actually an overlay instance;
847 * FALSE (0) otherwise.
851 overlay_is_over( BackendDB *be )
853 return be->bd_info->bi_type == overtype;
857 * returns TRUE (1) if the given database is actually an overlay
858 * instance and, somewhere in the list, contains the requested overlay;
859 * FALSE (0) otherwise.
863 overlay_is_inst( BackendDB *be, const char *over_type )
867 assert( be != NULL );
869 if ( !overlay_is_over( be ) ) {
873 on = ((slap_overinfo *)be->bd_info->bi_private)->oi_list;
874 for ( ; on; on = on->on_next ) {
875 if ( strcmp( on->on_bi.bi_type, over_type ) == 0 ) {
884 overlay_register_control( BackendDB *be, const char *oid )
889 if ( slap_find_control_id( oid, &cid ) == LDAP_CONTROL_NOT_FOUND ) {
893 if ( SLAP_ISGLOBALOVERLAY( be ) ) {
896 /* add to all backends... */
897 LDAP_STAILQ_FOREACH( bd, &backendDB, be_next ) {
902 bd->be_ctrls[ cid ] = 1;
903 bd->be_ctrls[ SLAP_MAX_CIDS ] = 1;
909 be->be_ctrls[ cid ] = 1;
910 be->be_ctrls[ SLAP_MAX_CIDS ] = 1;
917 overlay_destroy_one( BackendDB *be, slap_overinst *on )
919 slap_overinfo *oi = on->on_info;
920 slap_overinst **oidx;
922 for ( oidx = &oi->oi_list; *oidx; oidx = &(*oidx)->on_next ) {
925 if ( on->on_bi.bi_db_destroy ) {
926 BackendInfo *bi_orig = be->bd_info;
927 be->bd_info = (BackendInfo *)on;
928 on->on_bi.bi_db_destroy( be );
929 be->bd_info = bi_orig;
937 /* add an overlay to a particular backend. */
939 overlay_config( BackendDB *be, const char *ov )
941 slap_overinst *on = NULL, *on2 = NULL;
942 slap_overinfo *oi = NULL;
943 BackendInfo *bi = NULL;
945 on = overlay_find( ov );
947 Debug( LDAP_DEBUG_ANY, "overlay \"%s\" not found\n", ov, 0, 0 );
951 /* If this is the first overlay on this backend, set up the
952 * overlay info structure
954 if ( !overlay_is_over( be ) ) {
957 /* NOTE: the first time a global overlay is configured,
958 * frontendDB gets this flag; it is used later by overlays
959 * to determine if they're stacked on top of the frontendDB */
960 if ( be->bd_info == frontendDB->bd_info || SLAP_ISGLOBALOVERLAY( be ) ) {
962 if ( on->on_bi.bi_flags & SLAPO_BFLAG_DBONLY ) {
963 Debug( LDAP_DEBUG_ANY, "overlay_config(): "
964 "overlay \"%s\" cannot be global.\n",
969 } else if ( on->on_bi.bi_flags & SLAPO_BFLAG_GLOBONLY ) {
970 Debug( LDAP_DEBUG_ANY, "overlay_config(): "
971 "overlay \"%s\" can only be global.\n",
976 oi = ch_malloc( sizeof( slap_overinfo ) );
977 oi->oi_orig = be->bd_info;
978 oi->oi_bi = *be->bd_info;
982 SLAP_DBFLAGS( be ) |= SLAP_DBFLAG_GLOBAL_OVERLAY;
985 /* Save a pointer to ourself in bi_private.
987 oi->oi_bi.bi_private = oi;
989 bi = (BackendInfo *)oi;
991 bi->bi_type = (char *)overtype;
993 bi->bi_db_config = over_db_config;
994 bi->bi_db_open = over_db_open;
995 bi->bi_db_close = over_db_close;
996 bi->bi_db_destroy = over_db_destroy;
998 bi->bi_op_bind = over_op_bind;
999 bi->bi_op_unbind = over_op_unbind;
1000 bi->bi_op_search = over_op_search;
1001 bi->bi_op_compare = over_op_compare;
1002 bi->bi_op_modify = over_op_modify;
1003 bi->bi_op_modrdn = over_op_modrdn;
1004 bi->bi_op_add = over_op_add;
1005 bi->bi_op_delete = over_op_delete;
1006 bi->bi_op_abandon = over_op_abandon;
1007 bi->bi_op_cancel = over_op_cancel;
1009 bi->bi_extended = over_op_extended;
1012 * this is fine because it has the same
1013 * args of the operations; we need to rework
1014 * all the hooks to share the same args
1015 * of the operations...
1017 bi->bi_operational = over_aux_operational;
1018 bi->bi_chk_referrals = over_aux_chk_referrals;
1019 bi->bi_chk_controls = over_aux_chk_controls;
1021 #ifdef SLAP_OVERLAY_ACCESS
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;
1026 #endif /* SLAP_OVERLAY_ACCESS */
1028 bi->bi_connection_init = over_connection_init;
1029 bi->bi_connection_destroy = over_connection_destroy;
1034 if ( overlay_is_inst( be, ov ) ) {
1035 Debug( LDAP_DEBUG_ANY, "overlay_config(): "
1036 "overlay \"%s\" already in list\n",
1038 if ( SLAPO_SINGLE( be ) ) {
1043 oi = be->bd_info->bi_private;
1046 /* Insert new overlay on head of list. Overlays are executed
1047 * in reverse of config order...
1049 on2 = ch_calloc( 1, sizeof(slap_overinst) );
1052 on2->on_next = oi->oi_list;
1055 /* Any initialization needed? */
1056 if ( on->on_bi.bi_db_init ) {
1058 be->bd_info = (BackendInfo *)on2;
1059 rc = on2->on_bi.bi_db_init( be );
1060 be->bd_info = (BackendInfo *)oi;
1061 if ( rc ) return rc;