1 /* backover.c - backend overlay routines */
3 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
5 * Copyright 2003-2007 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 ca.table = on->on_bi.bi_cf_ocs->co_type;
151 rc = config_add_vals( ct, &ca );
152 if ( rc != SLAP_CONF_UNKNOWN )
156 if (on->on_bi.bi_db_config && rc == SLAP_CONF_UNKNOWN) {
157 be->bd_info = &on->on_bi;
158 rc = on->on_bi.bi_db_config( be, fname, lineno,
160 if ( rc != SLAP_CONF_UNKNOWN ) break;
163 be->bd_info = bi_orig;
164 be->be_cf_ocs = be_cf_ocs;
174 return over_db_func( be, db_open );
182 slap_overinfo *oi = be->bd_info->bi_private;
183 slap_overinst *on = oi->oi_list;
184 BackendInfo *bi_orig = be->bd_info;
187 for (; on && rc == 0; on=on->on_next) {
188 be->bd_info = &on->on_bi;
189 if ( be->bd_info->bi_db_close ) {
190 rc = be->bd_info->bi_db_close( be );
194 if ( oi->oi_orig->bi_db_close ) {
195 be->bd_info = oi->oi_orig;
196 rc = be->bd_info->bi_db_close( be );
199 be->bd_info = bi_orig;
208 slap_overinfo *oi = be->bd_info->bi_private;
209 slap_overinst *on = oi->oi_list, *next;
212 rc = over_db_func( be, db_destroy );
215 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;
251 overlay_entry_get_ov(
255 AttributeDescription *ad,
260 slap_overinfo *oi = on->on_info;
261 BackendDB *be = op->o_bd, db;
262 BackendInfo *bi = op->o_bd->bd_info;
263 int rc = SLAP_CB_CONTINUE;
265 for ( ; on; on = on->on_next ) {
266 if ( on->on_bi.bi_entry_get_rw ) {
267 /* NOTE: do not copy the structure until required */
268 if ( !SLAP_ISOVERLAY( op->o_bd ) ) {
270 db.be_flags |= SLAP_DBFLAG_OVERLAY;
274 op->o_bd->bd_info = (BackendInfo *)on;
275 rc = on->on_bi.bi_entry_get_rw( op, dn,
277 if ( rc != SLAP_CB_CONTINUE ) break;
281 if ( rc == SLAP_CB_CONTINUE ) {
282 /* if the database structure was changed, o_bd points to a
283 * copy of the structure; put the original bd_info in place */
284 if ( SLAP_ISOVERLAY( op->o_bd ) ) {
285 op->o_bd->bd_info = oi->oi_orig;
288 if ( oi->oi_orig->bi_entry_get_rw ) {
289 rc = oi->oi_orig->bi_entry_get_rw( op, dn,
293 /* should not fall thru this far without anything happening... */
294 if ( rc == SLAP_CB_CONTINUE ) {
295 rc = LDAP_UNWILLING_TO_PERFORM;
299 op->o_bd->bd_info = bi;
309 AttributeDescription *ad,
316 assert( op->o_bd != NULL );
318 oi = op->o_bd->bd_info->bi_private;
321 return overlay_entry_get_ov( op, dn, oc, ad, rw, e, on );
325 overlay_entry_release_ov(
331 slap_overinfo *oi = on->on_info;
332 BackendDB *be = op->o_bd, db;
333 BackendInfo *bi = op->o_bd->bd_info;
334 int rc = SLAP_CB_CONTINUE;
336 for ( ; on; on = on->on_next ) {
337 if ( on->on_bi.bi_entry_release_rw ) {
338 /* NOTE: do not copy the structure until required */
339 if ( !SLAP_ISOVERLAY( op->o_bd ) ) {
341 db.be_flags |= SLAP_DBFLAG_OVERLAY;
345 op->o_bd->bd_info = (BackendInfo *)on;
346 rc = on->on_bi.bi_entry_release_rw( op, e, rw );
347 if ( rc != SLAP_CB_CONTINUE ) break;
351 if ( rc == SLAP_CB_CONTINUE ) {
352 /* if the database structure was changed, o_bd points to a
353 * copy of the structure; put the original bd_info in place */
354 if ( SLAP_ISOVERLAY( op->o_bd ) ) {
355 op->o_bd->bd_info = oi->oi_orig;
358 if ( oi->oi_orig->bi_entry_release_rw ) {
359 rc = oi->oi_orig->bi_entry_release_rw( op, e, rw );
362 /* should not fall thru this far without anything happening... */
363 if ( rc == SLAP_CB_CONTINUE ) {
369 op->o_bd->bd_info = bi;
375 over_entry_release_rw(
383 assert( op->o_bd != NULL );
385 oi = op->o_bd->bd_info->bi_private;
388 return overlay_entry_release_ov( op, e, rw, on );
391 #ifdef SLAP_OVERLAY_ACCESS
396 AttributeDescription *desc,
398 slap_access_t access,
399 AccessControlState *state,
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 bi = op->o_bd->bd_info;
413 /* Were we invoked on the frontend? */
414 if ( !bi->bi_access_allowed ) {
415 oi = frontendDB->bd_info->bi_private;
417 oi = op->o_bd->bd_info->bi_private;
421 for ( ; on; on = on->on_next ) {
422 if ( on->on_bi.bi_access_allowed ) {
423 /* NOTE: do not copy the structure until required */
424 if ( !SLAP_ISOVERLAY( op->o_bd ) ) {
426 db.be_flags |= SLAP_DBFLAG_OVERLAY;
430 op->o_bd->bd_info = (BackendInfo *)on;
431 rc = on->on_bi.bi_access_allowed( op, e,
432 desc, val, access, state, maskp );
433 if ( rc != SLAP_CB_CONTINUE ) break;
437 if ( rc == SLAP_CB_CONTINUE ) {
438 BI_access_allowed *bi_access_allowed;
440 /* if the database structure was changed, o_bd points to a
441 * copy of the structure; put the original bd_info in place */
442 if ( SLAP_ISOVERLAY( op->o_bd ) ) {
443 op->o_bd->bd_info = oi->oi_orig;
446 if ( oi->oi_orig->bi_access_allowed ) {
447 bi_access_allowed = oi->oi_orig->bi_access_allowed;
449 bi_access_allowed = slap_access_allowed;
452 rc = bi_access_allowed( op, e,
453 desc, val, access, state, maskp );
455 /* should not fall thru this far without anything happening... */
456 if ( rc == SLAP_CB_CONTINUE ) {
457 /* access not allowed */
462 op->o_bd->bd_info = bi;
471 struct berval *gr_ndn,
472 struct berval *op_ndn,
473 ObjectClass *group_oc,
474 AttributeDescription *group_at )
478 BackendInfo *bi = op->o_bd->bd_info;
479 BackendDB *be = op->o_bd, db;
480 int rc = SLAP_CB_CONTINUE;
482 /* FIXME: used to happen for instance during abandon
483 * when global overlays are used... */
484 assert( op->o_bd != NULL );
486 oi = op->o_bd->bd_info->bi_private;
489 for ( ; on; on = on->on_next ) {
490 if ( on->on_bi.bi_acl_group ) {
491 /* NOTE: do not copy the structure until required */
492 if ( !SLAP_ISOVERLAY( op->o_bd ) ) {
494 db.be_flags |= SLAP_DBFLAG_OVERLAY;
498 op->o_bd->bd_info = (BackendInfo *)on;
499 rc = on->on_bi.bi_acl_group( op, e,
500 gr_ndn, op_ndn, group_oc, group_at );
501 if ( rc != SLAP_CB_CONTINUE ) break;
505 if ( rc == SLAP_CB_CONTINUE ) {
506 BI_acl_group *bi_acl_group;
508 /* if the database structure was changed, o_bd points to a
509 * copy of the structure; put the original bd_info in place */
510 if ( SLAP_ISOVERLAY( op->o_bd ) ) {
511 op->o_bd->bd_info = oi->oi_orig;
514 if ( oi->oi_orig->bi_acl_group ) {
515 bi_acl_group = oi->oi_orig->bi_acl_group;
517 bi_acl_group = backend_group;
520 rc = bi_acl_group( op, e,
521 gr_ndn, op_ndn, group_oc, group_at );
523 /* should not fall thru this far without anything happening... */
524 if ( rc == SLAP_CB_CONTINUE ) {
525 /* access not allowed */
530 op->o_bd->bd_info = bi;
539 struct berval *entry_ndn,
540 AttributeDescription *entry_at,
542 slap_access_t access )
546 BackendInfo *bi = op->o_bd->bd_info;
547 BackendDB *be = op->o_bd, db;
548 int rc = SLAP_CB_CONTINUE;
550 /* FIXME: used to happen for instance during abandon
551 * when global overlays are used... */
552 assert( op->o_bd != NULL );
554 oi = op->o_bd->bd_info->bi_private;
557 for ( ; on; on = on->on_next ) {
558 if ( on->on_bi.bi_acl_attribute ) {
559 /* NOTE: do not copy the structure until required */
560 if ( !SLAP_ISOVERLAY( op->o_bd ) ) {
562 db.be_flags |= SLAP_DBFLAG_OVERLAY;
566 op->o_bd->bd_info = (BackendInfo *)on;
567 rc = on->on_bi.bi_acl_attribute( op, target,
568 entry_ndn, entry_at, vals, access );
569 if ( rc != SLAP_CB_CONTINUE ) break;
573 if ( rc == SLAP_CB_CONTINUE ) {
574 BI_acl_attribute *bi_acl_attribute;
576 /* if the database structure was changed, o_bd points to a
577 * copy of the structure; put the original bd_info in place */
578 if ( SLAP_ISOVERLAY( op->o_bd ) ) {
579 op->o_bd->bd_info = oi->oi_orig;
582 if ( oi->oi_orig->bi_acl_attribute ) {
583 bi_acl_attribute = oi->oi_orig->bi_acl_attribute;
585 bi_acl_attribute = backend_attribute;
588 rc = bi_acl_attribute( op, target,
589 entry_ndn, entry_at, vals, access );
591 /* should not fall thru this far without anything happening... */
592 if ( rc == SLAP_CB_CONTINUE ) {
593 /* access not allowed */
598 op->o_bd->bd_info = bi;
602 #endif /* SLAP_OVERLAY_ACCESS */
605 * default return code in case of missing backend function
606 * and overlay stack returning SLAP_CB_CONTINUE
608 static int op_rc[ op_last ] = {
609 LDAP_UNWILLING_TO_PERFORM, /* bind */
610 LDAP_UNWILLING_TO_PERFORM, /* unbind */
611 LDAP_UNWILLING_TO_PERFORM, /* search */
612 SLAP_CB_CONTINUE, /* compare; pass to frontend */
613 LDAP_UNWILLING_TO_PERFORM, /* modify */
614 LDAP_UNWILLING_TO_PERFORM, /* modrdn */
615 LDAP_UNWILLING_TO_PERFORM, /* add */
616 LDAP_UNWILLING_TO_PERFORM, /* delete */
617 LDAP_UNWILLING_TO_PERFORM, /* abandon */
618 LDAP_UNWILLING_TO_PERFORM, /* cancel */
619 LDAP_UNWILLING_TO_PERFORM, /* extended */
620 LDAP_SUCCESS, /* aux_operational */
621 LDAP_SUCCESS, /* aux_chk_referrals */
622 SLAP_CB_CONTINUE /* aux_chk_controls; pass to frontend */
628 slap_operation_t which,
634 int rc = SLAP_CB_CONTINUE;
636 for (; on; on=on->on_next ) {
637 func = &on->on_bi.bi_op_bind;
639 op->o_bd->bd_info = (BackendInfo *)on;
640 rc = func[which]( op, rs );
641 if ( rc != SLAP_CB_CONTINUE ) break;
644 if ( rc == SLAP_CB_BYPASS )
645 rc = SLAP_CB_CONTINUE;
647 func = &oi->oi_orig->bi_op_bind;
648 if ( func[which] && rc == SLAP_CB_CONTINUE ) {
649 op->o_bd->bd_info = oi->oi_orig;
650 rc = func[which]( op, rs );
652 /* should not fall thru this far without anything happening... */
653 if ( rc == SLAP_CB_CONTINUE ) {
657 /* The underlying backend didn't handle the request, make sure
658 * overlay cleanup is processed.
660 if ( rc == LDAP_UNWILLING_TO_PERFORM ) {
661 slap_callback *sc_next;
662 for ( ; op->o_callback && op->o_callback->sc_response !=
663 over_back_response; op->o_callback = sc_next ) {
664 sc_next = op->o_callback->sc_next;
665 if ( op->o_callback->sc_cleanup ) {
666 op->o_callback->sc_cleanup( op, rs );
677 slap_operation_t which
682 BackendDB *be = op->o_bd, db;
683 slap_callback cb = {NULL, over_back_response, NULL, NULL};
684 int rc = SLAP_CB_CONTINUE;
686 /* FIXME: used to happen for instance during abandon
687 * when global overlays are used... */
688 assert( op->o_bd != NULL );
690 oi = op->o_bd->bd_info->bi_private;
693 if ( !SLAP_ISOVERLAY( op->o_bd )) {
695 db.be_flags |= SLAP_DBFLAG_OVERLAY;
698 cb.sc_next = op->o_callback;
700 op->o_callback = &cb;
702 rc = overlay_op_walk( op, rs, which, oi, on );
705 op->o_callback = cb.sc_next;
710 over_op_bind( Operation *op, SlapReply *rs )
712 return over_op_func( op, rs, op_bind );
716 over_op_unbind( Operation *op, SlapReply *rs )
718 return over_op_func( op, rs, op_unbind );
722 over_op_search( Operation *op, SlapReply *rs )
724 return over_op_func( op, rs, op_search );
728 over_op_compare( Operation *op, SlapReply *rs )
730 return over_op_func( op, rs, op_compare );
734 over_op_modify( Operation *op, SlapReply *rs )
736 return over_op_func( op, rs, op_modify );
740 over_op_modrdn( Operation *op, SlapReply *rs )
742 return over_op_func( op, rs, op_modrdn );
746 over_op_add( Operation *op, SlapReply *rs )
748 return over_op_func( op, rs, op_add );
752 over_op_delete( Operation *op, SlapReply *rs )
754 return over_op_func( op, rs, op_delete );
758 over_op_abandon( Operation *op, SlapReply *rs )
760 return over_op_func( op, rs, op_abandon );
764 over_op_cancel( Operation *op, SlapReply *rs )
766 return over_op_func( op, rs, op_cancel );
770 over_op_extended( Operation *op, SlapReply *rs )
772 return over_op_func( op, rs, op_extended );
776 over_aux_operational( Operation *op, SlapReply *rs )
778 return over_op_func( op, rs, op_aux_operational );
782 over_aux_chk_referrals( Operation *op, SlapReply *rs )
784 return over_op_func( op, rs, op_aux_chk_referrals );
788 over_aux_chk_controls( Operation *op, SlapReply *rs )
790 return over_op_func( op, rs, op_aux_chk_controls );
800 over_connection_func(
803 enum conn_which which
809 int rc = SLAP_CB_CONTINUE;
810 BI_connection_init **func;
812 /* FIXME: used to happen for instance during abandon
813 * when global overlays are used... */
814 assert( bd != NULL );
816 oi = bd->bd_info->bi_private;
819 if ( !SLAP_ISOVERLAY( bd ) ) {
821 db.be_flags |= SLAP_DBFLAG_OVERLAY;
825 for ( ; on; on = on->on_next ) {
826 func = &on->on_bi.bi_connection_init;
827 if ( func[ which ] ) {
828 bd->bd_info = (BackendInfo *)on;
829 rc = func[ which ]( bd, conn );
830 if ( rc != SLAP_CB_CONTINUE ) break;
834 func = &oi->oi_orig->bi_connection_init;
835 if ( func[ which ] && rc == SLAP_CB_CONTINUE ) {
836 bd->bd_info = oi->oi_orig;
837 rc = func[ which ]( bd, conn );
839 /* should not fall thru this far without anything happening... */
840 if ( rc == SLAP_CB_CONTINUE ) {
841 rc = LDAP_UNWILLING_TO_PERFORM;
848 over_connection_init(
853 return over_connection_func( bd, conn, conn_init );
857 over_connection_destroy(
862 return over_connection_func( bd, conn, conn_destroy );
870 on->on_next = overlays;
876 * iterator on registered overlays; overlay_next( NULL ) returns the first
877 * overlay; * subsequent calls with the previously returned value allow to
878 * iterate * over the entire list; returns NULL when no more overlays are
895 * returns a specific registered overlay based on the type; NULL if not
900 overlay_find( const char *over_type )
902 slap_overinst *on = overlays;
904 assert( over_type != NULL );
906 for ( ; on; on = on->on_next ) {
907 if ( strcmp( on->on_bi.bi_type, over_type ) == 0 ) {
915 static const char overtype[] = "over";
918 * returns TRUE (1) if the database is actually an overlay instance;
919 * FALSE (0) otherwise.
923 overlay_is_over( BackendDB *be )
925 return be->bd_info->bi_type == overtype;
929 * returns TRUE (1) if the given database is actually an overlay
930 * instance and, somewhere in the list, contains the requested overlay;
931 * FALSE (0) otherwise.
935 overlay_is_inst( BackendDB *be, const char *over_type )
939 assert( be != NULL );
941 if ( !overlay_is_over( be ) ) {
945 on = ((slap_overinfo *)be->bd_info->bi_private)->oi_list;
946 for ( ; on; on = on->on_next ) {
947 if ( strcmp( on->on_bi.bi_type, over_type ) == 0 ) {
956 overlay_register_control( BackendDB *be, const char *oid )
961 if ( slap_find_control_id( oid, &cid ) == LDAP_CONTROL_NOT_FOUND ) {
965 if ( SLAP_DBFLAGS( be ) & SLAP_DBFLAG_GLOBAL_OVERLAY ) {
968 /* add to all backends... */
969 LDAP_STAILQ_FOREACH( bd, &backendDB, be_next ) {
974 bd->be_ctrls[ cid ] = 1;
975 bd->be_ctrls[ SLAP_MAX_CIDS ] = 1;
981 be->be_ctrls[ cid ] = 1;
982 be->be_ctrls[ SLAP_MAX_CIDS ] = 1;
989 overlay_destroy_one( BackendDB *be, slap_overinst *on )
991 slap_overinfo *oi = on->on_info;
992 slap_overinst **oidx;
994 for ( oidx = &oi->oi_list; *oidx; oidx = &(*oidx)->on_next ) {
997 if ( on->on_bi.bi_db_destroy ) {
998 BackendInfo *bi_orig = be->bd_info;
999 be->bd_info = (BackendInfo *)on;
1000 on->on_bi.bi_db_destroy( be );
1001 be->bd_info = bi_orig;
1009 /* add an overlay to a particular backend. */
1011 overlay_config( BackendDB *be, const char *ov )
1013 slap_overinst *on = NULL, *on2 = NULL;
1014 slap_overinfo *oi = NULL;
1015 BackendInfo *bi = NULL;
1017 on = overlay_find( ov );
1019 Debug( LDAP_DEBUG_ANY, "overlay \"%s\" not found\n", ov, 0, 0 );
1023 /* If this is the first overlay on this backend, set up the
1024 * overlay info structure
1026 if ( !overlay_is_over( be ) ) {
1027 oi = ch_malloc( sizeof( slap_overinfo ) );
1028 oi->oi_orig = be->bd_info;
1029 oi->oi_bi = *be->bd_info;
1032 /* NOTE: the first time a global overlay is configured,
1033 * frontendDB gets this flag; it is used later by overlays
1034 * to determine if they're stacked on top of the frontendDB */
1035 if ( oi->oi_orig == frontendDB->bd_info ) {
1036 SLAP_DBFLAGS( be ) |= SLAP_DBFLAG_GLOBAL_OVERLAY;
1039 /* Save a pointer to ourself in bi_private.
1041 oi->oi_bi.bi_private = oi;
1043 bi = (BackendInfo *)oi;
1045 bi->bi_type = (char *)overtype;
1047 bi->bi_db_config = over_db_config;
1048 bi->bi_db_open = over_db_open;
1049 bi->bi_db_close = over_db_close;
1050 bi->bi_db_destroy = over_db_destroy;
1052 bi->bi_op_bind = over_op_bind;
1053 bi->bi_op_unbind = over_op_unbind;
1054 bi->bi_op_search = over_op_search;
1055 bi->bi_op_compare = over_op_compare;
1056 bi->bi_op_modify = over_op_modify;
1057 bi->bi_op_modrdn = over_op_modrdn;
1058 bi->bi_op_add = over_op_add;
1059 bi->bi_op_delete = over_op_delete;
1060 bi->bi_op_abandon = over_op_abandon;
1061 bi->bi_op_cancel = over_op_cancel;
1063 bi->bi_extended = over_op_extended;
1066 * this is fine because it has the same
1067 * args of the operations; we need to rework
1068 * all the hooks to share the same args
1069 * of the operations...
1071 bi->bi_operational = over_aux_operational;
1072 bi->bi_chk_referrals = over_aux_chk_referrals;
1073 bi->bi_chk_controls = over_aux_chk_controls;
1075 /* these have specific arglists */
1076 bi->bi_entry_get_rw = over_entry_get_rw;
1077 bi->bi_entry_release_rw = over_entry_release_rw;
1078 #ifdef SLAP_OVERLAY_ACCESS
1079 bi->bi_access_allowed = over_access_allowed;
1080 bi->bi_acl_group = over_acl_group;
1081 bi->bi_acl_attribute = over_acl_attribute;
1082 #endif /* SLAP_OVERLAY_ACCESS */
1084 bi->bi_connection_init = over_connection_init;
1085 bi->bi_connection_destroy = over_connection_destroy;
1090 if ( overlay_is_inst( be, ov ) ) {
1091 Debug( LDAP_DEBUG_ANY, "overlay_config(): "
1092 "warning, overlay \"%s\" "
1093 "already in list\n", ov, 0, 0 );
1096 oi = be->bd_info->bi_private;
1099 /* Insert new overlay on head of list. Overlays are executed
1100 * in reverse of config order...
1102 on2 = ch_calloc( 1, sizeof(slap_overinst) );
1105 on2->on_next = oi->oi_list;
1108 /* Any initialization needed? */
1109 if ( on->on_bi.bi_db_init ) {
1111 be->bd_info = (BackendInfo *)on2;
1112 rc = on2->on_bi.bi_db_init( be );
1113 be->bd_info = (BackendInfo *)oi;
1115 oi->oi_list = on2->on_next;