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 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) {
224 over_back_response ( Operation *op, SlapReply *rs )
226 slap_overinfo *oi = op->o_callback->sc_private;
227 slap_overinst *on = oi->oi_list;
228 int rc = SLAP_CB_CONTINUE;
229 BackendDB *be = op->o_bd, db = *op->o_bd;
231 db.be_flags |= SLAP_DBFLAG_OVERLAY;
233 for (; on; on=on->on_next ) {
234 if ( on->on_response ) {
235 db.bd_info = (BackendInfo *)on;
236 rc = on->on_response( op, rs );
237 if ( rc != SLAP_CB_CONTINUE ) break;
240 /* Bypass the remaining on_response layers, but allow
241 * normal execution to continue.
243 if ( rc == SLAP_CB_BYPASS )
244 rc = SLAP_CB_CONTINUE;
249 #ifdef SLAP_OVERLAY_ACCESS
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;
326 overlay_entry_get_ov(
330 AttributeDescription *ad,
335 slap_overinfo *oi = on->on_info;
336 BackendDB *be = op->o_bd, db;
337 BackendInfo *bi = op->o_bd->bd_info;
338 int rc = SLAP_CB_CONTINUE;
340 for ( ; on; on = on->on_next ) {
341 if ( on->on_bi.bi_entry_get_rw ) {
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_entry_get_rw( op, dn,
352 if ( rc != SLAP_CB_CONTINUE ) break;
356 if ( rc == SLAP_CB_CONTINUE ) {
357 /* if the database structure was changed, o_bd points to a
358 * copy of the structure; put the original bd_info in place */
359 if ( SLAP_ISOVERLAY( op->o_bd ) ) {
360 op->o_bd->bd_info = oi->oi_orig;
363 if ( oi->oi_orig->bi_entry_get_rw ) {
364 rc = oi->oi_orig->bi_entry_get_rw( op, dn,
368 /* should not fall thru this far without anything happening... */
369 if ( rc == SLAP_CB_CONTINUE ) {
370 rc = LDAP_UNWILLING_TO_PERFORM;
374 op->o_bd->bd_info = bi;
384 AttributeDescription *ad,
391 assert( op->o_bd != NULL );
393 oi = op->o_bd->bd_info->bi_private;
396 return overlay_entry_get_ov( op, dn, oc, ad, rw, e, on );
400 overlay_entry_release_ov(
406 slap_overinfo *oi = on->on_info;
407 BackendDB *be = op->o_bd, db;
408 BackendInfo *bi = op->o_bd->bd_info;
409 int rc = SLAP_CB_CONTINUE;
411 for ( ; on; on = on->on_next ) {
412 if ( on->on_bi.bi_entry_release_rw ) {
413 /* NOTE: do not copy the structure until required */
414 if ( !SLAP_ISOVERLAY( op->o_bd ) ) {
416 db.be_flags |= SLAP_DBFLAG_OVERLAY;
420 op->o_bd->bd_info = (BackendInfo *)on;
421 rc = on->on_bi.bi_entry_release_rw( op, e, rw );
422 if ( rc != SLAP_CB_CONTINUE ) break;
426 if ( rc == SLAP_CB_CONTINUE ) {
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_entry_release_rw ) {
434 rc = oi->oi_orig->bi_entry_release_rw( op, e, rw );
437 /* should not fall thru this far without anything happening... */
438 if ( rc == SLAP_CB_CONTINUE ) {
444 op->o_bd->bd_info = bi;
450 over_entry_release_rw(
458 assert( op->o_bd != NULL );
460 oi = op->o_bd->bd_info->bi_private;
463 return overlay_entry_release_ov( op, e, rw, on );
470 struct berval *gr_ndn,
471 struct berval *op_ndn,
472 ObjectClass *group_oc,
473 AttributeDescription *group_at )
477 BackendInfo *bi = op->o_bd->bd_info;
478 BackendDB *be = op->o_bd, db;
479 int rc = SLAP_CB_CONTINUE;
481 /* FIXME: used to happen for instance during abandon
482 * when global overlays are used... */
483 assert( op->o_bd != NULL );
485 oi = op->o_bd->bd_info->bi_private;
488 for ( ; on; on = on->on_next ) {
489 if ( on->on_bi.bi_acl_group ) {
490 /* NOTE: do not copy the structure until required */
491 if ( !SLAP_ISOVERLAY( op->o_bd ) ) {
493 db.be_flags |= SLAP_DBFLAG_OVERLAY;
497 op->o_bd->bd_info = (BackendInfo *)on;
498 rc = on->on_bi.bi_acl_group( op, e,
499 gr_ndn, op_ndn, group_oc, group_at );
500 if ( rc != SLAP_CB_CONTINUE ) break;
504 if ( rc == SLAP_CB_CONTINUE ) {
505 BI_acl_group *bi_acl_group;
507 /* if the database structure was changed, o_bd points to a
508 * copy of the structure; put the original bd_info in place */
509 if ( SLAP_ISOVERLAY( op->o_bd ) ) {
510 op->o_bd->bd_info = oi->oi_orig;
513 if ( oi->oi_orig->bi_acl_group ) {
514 bi_acl_group = oi->oi_orig->bi_acl_group;
516 bi_acl_group = backend_group;
519 rc = bi_acl_group( op, e,
520 gr_ndn, op_ndn, group_oc, group_at );
522 /* should not fall thru this far without anything happening... */
523 if ( rc == SLAP_CB_CONTINUE ) {
524 /* access not allowed */
529 op->o_bd->bd_info = bi;
538 struct berval *entry_ndn,
539 AttributeDescription *entry_at,
541 slap_access_t access )
545 BackendInfo *bi = op->o_bd->bd_info;
546 BackendDB *be = op->o_bd, db;
547 int rc = SLAP_CB_CONTINUE;
549 /* FIXME: used to happen for instance during abandon
550 * when global overlays are used... */
551 assert( op->o_bd != NULL );
553 oi = op->o_bd->bd_info->bi_private;
556 for ( ; on; on = on->on_next ) {
557 if ( on->on_bi.bi_acl_attribute ) {
558 /* NOTE: do not copy the structure until required */
559 if ( !SLAP_ISOVERLAY( op->o_bd ) ) {
561 db.be_flags |= SLAP_DBFLAG_OVERLAY;
565 op->o_bd->bd_info = (BackendInfo *)on;
566 rc = on->on_bi.bi_acl_attribute( op, target,
567 entry_ndn, entry_at, vals, access );
568 if ( rc != SLAP_CB_CONTINUE ) break;
572 if ( rc == SLAP_CB_CONTINUE ) {
573 BI_acl_attribute *bi_acl_attribute;
575 /* if the database structure was changed, o_bd points to a
576 * copy of the structure; put the original bd_info in place */
577 if ( SLAP_ISOVERLAY( op->o_bd ) ) {
578 op->o_bd->bd_info = oi->oi_orig;
581 if ( oi->oi_orig->bi_acl_attribute ) {
582 bi_acl_attribute = oi->oi_orig->bi_acl_attribute;
584 bi_acl_attribute = backend_attribute;
587 rc = bi_acl_attribute( op, target,
588 entry_ndn, entry_at, vals, access );
590 /* should not fall thru this far without anything happening... */
591 if ( rc == SLAP_CB_CONTINUE ) {
592 /* access not allowed */
597 op->o_bd->bd_info = bi;
601 #endif /* SLAP_OVERLAY_ACCESS */
604 * default return code in case of missing backend function
605 * and overlay stack returning SLAP_CB_CONTINUE
607 static int op_rc[ op_last ] = {
608 LDAP_UNWILLING_TO_PERFORM, /* bind */
609 LDAP_UNWILLING_TO_PERFORM, /* unbind */
610 LDAP_UNWILLING_TO_PERFORM, /* search */
611 SLAP_CB_CONTINUE, /* compare; pass to frontend */
612 LDAP_UNWILLING_TO_PERFORM, /* modify */
613 LDAP_UNWILLING_TO_PERFORM, /* modrdn */
614 LDAP_UNWILLING_TO_PERFORM, /* add */
615 LDAP_UNWILLING_TO_PERFORM, /* delete */
616 LDAP_UNWILLING_TO_PERFORM, /* abandon */
617 LDAP_UNWILLING_TO_PERFORM, /* cancel */
618 LDAP_UNWILLING_TO_PERFORM, /* extended */
619 LDAP_SUCCESS, /* aux_operational */
620 LDAP_SUCCESS, /* aux_chk_referrals */
621 SLAP_CB_CONTINUE /* aux_chk_controls; pass to frontend */
627 slap_operation_t which,
633 int rc = SLAP_CB_CONTINUE;
635 for (; on; on=on->on_next ) {
636 func = &on->on_bi.bi_op_bind;
638 op->o_bd->bd_info = (BackendInfo *)on;
639 rc = func[which]( op, rs );
640 if ( rc != SLAP_CB_CONTINUE ) break;
643 if ( rc == SLAP_CB_BYPASS )
644 rc = SLAP_CB_CONTINUE;
646 func = &oi->oi_orig->bi_op_bind;
647 if ( func[which] && rc == SLAP_CB_CONTINUE ) {
648 op->o_bd->bd_info = oi->oi_orig;
649 rc = func[which]( op, rs );
651 /* should not fall thru this far without anything happening... */
652 if ( rc == SLAP_CB_CONTINUE ) {
656 /* The underlying backend didn't handle the request, make sure
657 * overlay cleanup is processed.
659 if ( rc == LDAP_UNWILLING_TO_PERFORM ) {
660 slap_callback *sc_next;
661 for ( ; op->o_callback && op->o_callback->sc_response !=
662 over_back_response; op->o_callback = sc_next ) {
663 sc_next = op->o_callback->sc_next;
664 if ( op->o_callback->sc_cleanup ) {
665 op->o_callback->sc_cleanup( op, rs );
676 slap_operation_t which
681 BackendDB *be = op->o_bd, db;
682 slap_callback cb = {NULL, over_back_response, NULL, NULL};
683 int rc = SLAP_CB_CONTINUE;
685 /* FIXME: used to happen for instance during abandon
686 * when global overlays are used... */
687 assert( op->o_bd != NULL );
689 oi = op->o_bd->bd_info->bi_private;
692 if ( !SLAP_ISOVERLAY( op->o_bd )) {
694 db.be_flags |= SLAP_DBFLAG_OVERLAY;
697 cb.sc_next = op->o_callback;
699 op->o_callback = &cb;
701 rc = overlay_op_walk( op, rs, which, oi, on );
704 op->o_callback = cb.sc_next;
709 over_op_bind( Operation *op, SlapReply *rs )
711 return over_op_func( op, rs, op_bind );
715 over_op_unbind( Operation *op, SlapReply *rs )
717 return over_op_func( op, rs, op_unbind );
721 over_op_search( Operation *op, SlapReply *rs )
723 return over_op_func( op, rs, op_search );
727 over_op_compare( Operation *op, SlapReply *rs )
729 return over_op_func( op, rs, op_compare );
733 over_op_modify( Operation *op, SlapReply *rs )
735 return over_op_func( op, rs, op_modify );
739 over_op_modrdn( Operation *op, SlapReply *rs )
741 return over_op_func( op, rs, op_modrdn );
745 over_op_add( Operation *op, SlapReply *rs )
747 return over_op_func( op, rs, op_add );
751 over_op_delete( Operation *op, SlapReply *rs )
753 return over_op_func( op, rs, op_delete );
757 over_op_abandon( Operation *op, SlapReply *rs )
759 return over_op_func( op, rs, op_abandon );
763 over_op_cancel( Operation *op, SlapReply *rs )
765 return over_op_func( op, rs, op_cancel );
769 over_op_extended( Operation *op, SlapReply *rs )
771 return over_op_func( op, rs, op_extended );
775 over_aux_operational( Operation *op, SlapReply *rs )
777 return over_op_func( op, rs, op_aux_operational );
781 over_aux_chk_referrals( Operation *op, SlapReply *rs )
783 return over_op_func( op, rs, op_aux_chk_referrals );
787 over_aux_chk_controls( Operation *op, SlapReply *rs )
789 return over_op_func( op, rs, op_aux_chk_controls );
799 over_connection_func(
802 enum conn_which which
808 int rc = SLAP_CB_CONTINUE;
809 BI_connection_init **func;
811 /* FIXME: used to happen for instance during abandon
812 * when global overlays are used... */
813 assert( bd != NULL );
815 oi = bd->bd_info->bi_private;
818 if ( !SLAP_ISOVERLAY( bd ) ) {
820 db.be_flags |= SLAP_DBFLAG_OVERLAY;
824 for ( ; on; on = on->on_next ) {
825 func = &on->on_bi.bi_connection_init;
826 if ( func[ which ] ) {
827 bd->bd_info = (BackendInfo *)on;
828 rc = func[ which ]( bd, conn );
829 if ( rc != SLAP_CB_CONTINUE ) break;
833 func = &oi->oi_orig->bi_connection_init;
834 if ( func[ which ] && rc == SLAP_CB_CONTINUE ) {
835 bd->bd_info = oi->oi_orig;
836 rc = func[ which ]( bd, conn );
838 /* should not fall thru this far without anything happening... */
839 if ( rc == SLAP_CB_CONTINUE ) {
840 rc = LDAP_UNWILLING_TO_PERFORM;
847 over_connection_init(
852 return over_connection_func( bd, conn, conn_init );
856 over_connection_destroy(
861 return over_connection_func( bd, conn, conn_destroy );
869 on->on_next = overlays;
875 * iterator on registered overlays; overlay_next( NULL ) returns the first
876 * overlay; * subsequent calls with the previously returned value allow to
877 * iterate * over the entire list; returns NULL when no more overlays are
894 * returns a specific registered overlay based on the type; NULL if not
899 overlay_find( const char *over_type )
901 slap_overinst *on = overlays;
903 assert( over_type != NULL );
905 for ( ; on; on = on->on_next ) {
906 if ( strcmp( on->on_bi.bi_type, over_type ) == 0 ) {
914 static const char overtype[] = "over";
917 * returns TRUE (1) if the database is actually an overlay instance;
918 * FALSE (0) otherwise.
922 overlay_is_over( BackendDB *be )
924 return be->bd_info->bi_type == overtype;
928 * returns TRUE (1) if the given database is actually an overlay
929 * instance and, somewhere in the list, contains the requested overlay;
930 * FALSE (0) otherwise.
934 overlay_is_inst( BackendDB *be, const char *over_type )
938 assert( be != NULL );
940 if ( !overlay_is_over( be ) ) {
944 on = ((slap_overinfo *)be->bd_info->bi_private)->oi_list;
945 for ( ; on; on = on->on_next ) {
946 if ( strcmp( on->on_bi.bi_type, over_type ) == 0 ) {
955 overlay_register_control( BackendDB *be, const char *oid )
960 if ( slap_find_control_id( oid, &cid ) == LDAP_CONTROL_NOT_FOUND ) {
964 if ( SLAP_DBFLAGS( be ) & SLAP_DBFLAG_GLOBAL_OVERLAY ) {
967 /* add to all backends... */
968 LDAP_STAILQ_FOREACH( bd, &backendDB, be_next ) {
973 bd->be_ctrls[ cid ] = 1;
974 bd->be_ctrls[ SLAP_MAX_CIDS ] = 1;
980 be->be_ctrls[ cid ] = 1;
981 be->be_ctrls[ SLAP_MAX_CIDS ] = 1;
988 overlay_destroy_one( BackendDB *be, slap_overinst *on )
990 slap_overinfo *oi = on->on_info;
991 slap_overinst **oidx;
993 for ( oidx = &oi->oi_list; *oidx; oidx = &(*oidx)->on_next ) {
996 if ( on->on_bi.bi_db_destroy ) {
997 BackendInfo *bi_orig = be->bd_info;
998 be->bd_info = (BackendInfo *)on;
999 on->on_bi.bi_db_destroy( be );
1000 be->bd_info = bi_orig;
1008 /* add an overlay to a particular backend. */
1010 overlay_config( BackendDB *be, const char *ov )
1012 slap_overinst *on = NULL, *on2 = NULL;
1013 slap_overinfo *oi = NULL;
1014 BackendInfo *bi = NULL;
1016 on = overlay_find( ov );
1018 Debug( LDAP_DEBUG_ANY, "overlay \"%s\" not found\n", ov, 0, 0 );
1022 /* If this is the first overlay on this backend, set up the
1023 * overlay info structure
1025 if ( !overlay_is_over( be ) ) {
1026 oi = ch_malloc( sizeof( slap_overinfo ) );
1027 oi->oi_orig = be->bd_info;
1028 oi->oi_bi = *be->bd_info;
1031 /* NOTE: the first time a global overlay is configured,
1032 * frontendDB gets this flag; it is used later by overlays
1033 * to determine if they're stacked on top of the frontendDB */
1034 if ( oi->oi_orig == frontendDB->bd_info ) {
1035 SLAP_DBFLAGS( be ) |= SLAP_DBFLAG_GLOBAL_OVERLAY;
1038 /* Save a pointer to ourself in bi_private.
1040 oi->oi_bi.bi_private = oi;
1042 bi = (BackendInfo *)oi;
1044 bi->bi_type = (char *)overtype;
1046 bi->bi_db_config = over_db_config;
1047 bi->bi_db_open = over_db_open;
1048 bi->bi_db_close = over_db_close;
1049 bi->bi_db_destroy = over_db_destroy;
1051 bi->bi_op_bind = over_op_bind;
1052 bi->bi_op_unbind = over_op_unbind;
1053 bi->bi_op_search = over_op_search;
1054 bi->bi_op_compare = over_op_compare;
1055 bi->bi_op_modify = over_op_modify;
1056 bi->bi_op_modrdn = over_op_modrdn;
1057 bi->bi_op_add = over_op_add;
1058 bi->bi_op_delete = over_op_delete;
1059 bi->bi_op_abandon = over_op_abandon;
1060 bi->bi_op_cancel = over_op_cancel;
1062 bi->bi_extended = over_op_extended;
1065 * this is fine because it has the same
1066 * args of the operations; we need to rework
1067 * all the hooks to share the same args
1068 * of the operations...
1070 bi->bi_operational = over_aux_operational;
1071 bi->bi_chk_referrals = over_aux_chk_referrals;
1072 bi->bi_chk_controls = over_aux_chk_controls;
1074 #ifdef SLAP_OVERLAY_ACCESS
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 bi->bi_access_allowed = over_access_allowed;
1079 bi->bi_acl_group = over_acl_group;
1080 bi->bi_acl_attribute = over_acl_attribute;
1081 #endif /* SLAP_OVERLAY_ACCESS */
1083 bi->bi_connection_init = over_connection_init;
1084 bi->bi_connection_destroy = over_connection_destroy;
1089 if ( overlay_is_inst( be, ov ) ) {
1090 Debug( LDAP_DEBUG_ANY, "overlay_config(): "
1091 "warning, overlay \"%s\" "
1092 "already in list\n", ov, 0, 0 );
1095 oi = be->bd_info->bi_private;
1098 /* Insert new overlay on head of list. Overlays are executed
1099 * in reverse of config order...
1101 on2 = ch_calloc( 1, sizeof(slap_overinst) );
1104 on2->on_next = oi->oi_list;
1107 /* Any initialization needed? */
1108 if ( on->on_bi.bi_db_init ) {
1110 be->bd_info = (BackendInfo *)on2;
1111 rc = on2->on_bi.bi_db_init( be );
1112 be->bd_info = (BackendInfo *)oi;
1114 oi->oi_list = on2->on_next;