1 /* backglue.c - backend glue */
3 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
5 * Copyright 2001-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>.
18 * Functions to glue a bunch of other backends into a single tree.
19 * All of the glued backends must share a common suffix. E.g., you
20 * can glue o=foo and ou=bar,o=foo but you can't glue o=foo and o=bar.
22 * The purpose of these functions is to allow you to split a single database
23 * into pieces (for load balancing purposes, whatever) but still be able
24 * to treat it as a single database after it's been split. As such, each
25 * of the glued backends should have identical rootdn.
33 #include <ac/string.h>
34 #include <ac/socket.h>
39 typedef struct gluenode {
44 typedef struct glueinfo {
50 static slap_overinst glue;
53 static BackendDB *glueBack;
55 static slap_response glue_op_response;
57 /* Just like select_backend, but only for our backends */
64 slap_overinst *on = (slap_overinst *)be->bd_info;
65 glueinfo *gi = (glueinfo *)on->on_bi.bi_private;
68 for (i = gi->gi_nodes-1; i >= 0; i--) {
69 assert( gi->gi_n[i].gn_be->be_nsuffix != NULL );
71 if (dnIsSuffix(dn, &gi->gi_n[i].gn_be->be_nsuffix[0])) {
72 return gi->gi_n[i].gn_be;
75 be->bd_info = on->on_info->oi_orig;
80 typedef struct glue_state {
91 glue_op_response ( Operation *op, SlapReply *rs )
93 glue_state *gs = op->o_callback->sc_private;
98 case REP_INTERMEDIATE:
99 return SLAP_CB_CONTINUE;
102 if (rs->sr_err == LDAP_SUCCESS ||
103 rs->sr_err == LDAP_SIZELIMIT_EXCEEDED ||
104 rs->sr_err == LDAP_TIMELIMIT_EXCEEDED ||
105 rs->sr_err == LDAP_ADMINLIMIT_EXCEEDED ||
106 rs->sr_err == LDAP_NO_SUCH_OBJECT ||
107 gs->err != LDAP_SUCCESS)
108 gs->err = rs->sr_err;
109 if (gs->err == LDAP_SUCCESS && gs->matched) {
110 ch_free (gs->matched);
114 if (gs->err != LDAP_SUCCESS && rs->sr_matched) {
116 len = strlen (rs->sr_matched);
117 if (len > gs->matchlen) {
119 ch_free (gs->matched);
120 gs->matched = ch_strdup (rs->sr_matched);
128 for (i=0; rs->sr_ref[i].bv_val; i++);
132 new = ch_malloc ((i+1)*sizeof(struct berval));
134 new = ch_realloc(gs->refs,
135 (j+i+1)*sizeof(struct berval));
137 for (k=0; k<i; j++,k++) {
138 ber_dupbv( &new[j], &rs->sr_ref[k] );
140 new[j].bv_val = NULL;
146 LDAPControl **newctrls;
148 for (i=0; rs->sr_ctrls[i]; i++);
152 newctrls = ch_malloc((i+1)*sizeof(LDAPControl *));
154 newctrls = ch_realloc(gs->ctrls,
155 (j+i+1)*sizeof(LDAPControl *));
157 for (k=0; k<i; j++,k++) {
158 newctrls[j] = ch_malloc(sizeof(LDAPControl));
159 *newctrls[j] = *rs->sr_ctrls[k];
160 if ( !BER_BVISNULL( &rs->sr_ctrls[k]->ldctl_value ))
161 ber_dupbv( &newctrls[j]->ldctl_value,
162 &rs->sr_ctrls[k]->ldctl_value );
166 gs->ctrls = newctrls;
173 glue_op_func ( Operation *op, SlapReply *rs )
175 slap_overinst *on = (slap_overinst *)op->o_bd->bd_info;
176 BackendDB *b0 = op->o_bd;
177 BackendInfo *bi0 = op->o_bd->bd_info;
179 slap_operation_t which = op_bind;
182 op->o_bd = glue_back_select (b0, &op->o_req_ndn);
184 /* If we're on the master backend, let overlay framework handle it */
185 if ( op->o_bd == b0 )
186 return SLAP_CB_CONTINUE;
188 b0->bd_info = on->on_info->oi_orig;
191 case LDAP_REQ_ADD: which = op_add; break;
192 case LDAP_REQ_DELETE: which = op_delete; break;
193 case LDAP_REQ_MODIFY: which = op_modify; break;
194 case LDAP_REQ_MODRDN: which = op_modrdn; break;
195 default: assert( 0 ); break;
198 func = &op->o_bd->bd_info->bi_op_bind;
200 rc = func[which]( op, rs );
202 rc = SLAP_CB_CONTINUE;
205 op->o_bd->bd_info = bi0;
210 glue_chk_referrals ( Operation *op, SlapReply *rs )
212 slap_overinst *on = (slap_overinst *)op->o_bd->bd_info;
213 BackendDB *b0 = op->o_bd;
214 BackendInfo *bi0 = op->o_bd->bd_info;
217 op->o_bd = glue_back_select (b0, &op->o_req_ndn);
218 if ( op->o_bd == b0 )
219 return SLAP_CB_CONTINUE;
221 b0->bd_info = on->on_info->oi_orig;
223 if ( op->o_bd->bd_info->bi_chk_referrals )
224 rc = ( *op->o_bd->bd_info->bi_chk_referrals )( op, rs );
226 rc = SLAP_CB_CONTINUE;
229 op->o_bd->bd_info = bi0;
234 glue_chk_controls ( Operation *op, SlapReply *rs )
236 slap_overinst *on = (slap_overinst *)op->o_bd->bd_info;
237 BackendDB *b0 = op->o_bd;
238 BackendInfo *bi0 = op->o_bd->bd_info;
239 int rc = SLAP_CB_CONTINUE;
241 op->o_bd = glue_back_select (b0, &op->o_req_ndn);
242 if ( op->o_bd == b0 )
243 return SLAP_CB_CONTINUE;
245 b0->bd_info = on->on_info->oi_orig;
247 /* if the subordinate database has overlays, the bi_chk_controls()
248 * hook is actually over_aux_chk_controls(); in case it actually
249 * wraps a missing hok, we need to mimic the behavior
250 * of the frontend applied to that database */
251 if ( op->o_bd->bd_info->bi_chk_controls ) {
252 rc = ( *op->o_bd->bd_info->bi_chk_controls )( op, rs );
256 if ( rc == SLAP_CB_CONTINUE ) {
257 rc = backend_check_controls( op, rs );
261 op->o_bd->bd_info = bi0;
266 glue_sub_search( Operation *op, SlapReply *rs, BackendDB *b0,
269 /* Process any overlays on the master backend */
270 if ( op->o_bd == b0 && on->on_next ) {
271 BackendInfo *bi = op->o_bd->bd_info;
272 int rc = SLAP_CB_CONTINUE;
273 for ( on=on->on_next; on; on=on->on_next ) {
274 op->o_bd->bd_info = (BackendInfo *)on;
275 if ( on->on_bi.bi_op_search ) {
276 rc = on->on_bi.bi_op_search( op, rs );
277 if ( rc != SLAP_CB_CONTINUE )
281 op->o_bd->bd_info = bi;
282 if ( rc != SLAP_CB_CONTINUE )
285 return op->o_bd->be_search( op, rs );
289 glue_op_search ( Operation *op, SlapReply *rs )
291 slap_overinst *on = (slap_overinst *)op->o_bd->bd_info;
292 glueinfo *gi = (glueinfo *)on->on_bi.bi_private;
293 BackendDB *b0 = op->o_bd;
294 BackendDB *b1 = NULL, *btmp;
295 BackendInfo *bi0 = op->o_bd->bd_info;
297 long stoptime = 0, starttime;
298 glue_state gs = {NULL, NULL, NULL, 0, 0, 0, 0};
299 slap_callback cb = { NULL, glue_op_response, NULL, NULL };
301 struct berval dn, ndn, *pdn;
305 cb.sc_next = op->o_callback;
307 starttime = op->o_time;
308 stoptime = slap_get_time () + op->ors_tlimit;
310 op->o_bd = glue_back_select (b0, &op->o_req_ndn);
311 b0->bd_info = on->on_info->oi_orig;
313 switch (op->ors_scope) {
314 case LDAP_SCOPE_BASE:
315 if ( op->o_bd == b0 )
316 return SLAP_CB_CONTINUE;
318 rs->sr_err = LDAP_UNWILLING_TO_PERFORM;
319 if (op->o_bd && op->o_bd->be_search) {
320 rs->sr_err = op->o_bd->be_search( op, rs );
324 case LDAP_SCOPE_ONELEVEL:
325 case LDAP_SCOPE_SUBTREE:
326 case LDAP_SCOPE_SUBORDINATE: /* FIXME */
327 op->o_callback = &cb;
328 rs->sr_err = gs.err = LDAP_UNWILLING_TO_PERFORM;
329 scope0 = op->ors_scope;
330 tlimit0 = op->ors_tlimit;
336 * Execute in reverse order, most specific first
338 for (i = gi->gi_nodes; i >= 0; i--) {
339 if ( i == gi->gi_nodes ) {
343 btmp = gi->gi_n[i].gn_be;
344 pdn = &gi->gi_n[i].gn_pdn;
346 if (!btmp || !btmp->be_search)
348 if (!dnIsSuffix(&btmp->be_nsuffix[0], &b1->be_nsuffix[0]))
350 if (get_no_subordinate_glue(op) && btmp != b1)
353 if (tlimit0 != SLAP_NO_LIMIT) {
354 op->o_time = slap_get_time();
355 op->ors_tlimit = stoptime - op->o_time;
356 if (op->ors_tlimit <= 0) {
357 rs->sr_err = gs.err = LDAP_TIMELIMIT_EXCEEDED;
370 assert( op->o_bd->be_suffix != NULL );
371 assert( op->o_bd->be_nsuffix != NULL );
373 if (scope0 == LDAP_SCOPE_ONELEVEL &&
376 op->ors_scope = LDAP_SCOPE_BASE;
377 op->o_req_dn = op->o_bd->be_suffix[0];
378 op->o_req_ndn = op->o_bd->be_nsuffix[0];
379 rs->sr_err = op->o_bd->be_search(op, rs);
380 if ( rs->sr_err == LDAP_NO_SUCH_OBJECT ) {
381 gs.err = LDAP_SUCCESS;
383 op->ors_scope = LDAP_SCOPE_ONELEVEL;
387 } else if (scope0 == LDAP_SCOPE_SUBTREE &&
388 dn_match(&op->o_bd->be_nsuffix[0], &ndn))
390 rs->sr_err = glue_sub_search( op, rs, b0, on );
392 } else if (scope0 == LDAP_SCOPE_SUBTREE &&
393 dnIsSuffix(&op->o_bd->be_nsuffix[0], &ndn))
395 op->o_req_dn = op->o_bd->be_suffix[0];
396 op->o_req_ndn = op->o_bd->be_nsuffix[0];
397 rs->sr_err = glue_sub_search( op, rs, b0, on );
398 if ( rs->sr_err == LDAP_NO_SUCH_OBJECT ) {
399 gs.err = LDAP_SUCCESS;
404 } else if (dnIsSuffix(&ndn, &op->o_bd->be_nsuffix[0])) {
405 rs->sr_err = glue_sub_search( op, rs, b0, on );
411 * Add errors that should result in dropping
414 case LDAP_SIZELIMIT_EXCEEDED:
415 case LDAP_TIMELIMIT_EXCEEDED:
416 case LDAP_ADMINLIMIT_EXCEEDED:
417 case LDAP_NO_SUCH_OBJECT:
418 #ifdef LDAP_CONTROL_X_CHAINING_BEHAVIOR
419 case LDAP_X_CANNOT_CHAIN:
420 #endif /* LDAP_CONTROL_X_CHAINING_BEHAVIOR */
428 op->ors_scope = scope0;
429 op->ors_tlimit = tlimit0;
430 op->o_time = starttime;
436 if ( op->o_abandon ) {
437 rs->sr_err = SLAPD_ABANDON;
439 op->o_callback = cb.sc_next;
441 rs->sr_matched = gs.matched;
442 rs->sr_ref = gs.refs;
443 rs->sr_ctrls = gs.ctrls;
445 send_ldap_result( op, rs );
449 op->o_bd->bd_info = bi0;
453 ber_bvarray_free(gs.refs);
455 for (i = gs.nctrls; --i >= 0; ) {
456 if (!BER_BVISNULL( &gs.ctrls[i]->ldctl_value ))
457 free(gs.ctrls[i]->ldctl_value.bv_val);
465 static BackendDB toolDB;
468 glue_tool_entry_open (
473 slap_overinfo *oi = (slap_overinfo *)b0->bd_info;
475 /* We don't know which backend to talk to yet, so just
476 * remember the mode and move on...
482 toolDB.bd_info = oi->oi_orig;
488 glue_tool_entry_close (
495 if (!glueBack->be_entry_close)
497 rc = glueBack->be_entry_close (glueBack);
502 static slap_overinst *
507 slap_overinfo *oi = (slap_overinfo *)bi;
510 for ( on = oi->oi_list; on; on=on->on_next ) {
511 if ( !strcmp( on->on_bi.bi_type, glue.on_bi.bi_type ))
517 /* This function will only be called in tool mode */
523 slap_overinst *on = glue_tool_inst( bi );
524 glueinfo *gi = on->on_bi.bi_private;
525 static int glueOpened = 0;
526 int i, j, same, bsame = 0, rc = 0;
528 if (glueOpened) return 0;
532 /* If we were invoked in tool mode, open all the underlying backends */
533 if (slapMode & SLAP_TOOL_MODE) {
534 for (i = 0; i<gi->gi_nodes; i++) {
536 /* Same bi_open as our main backend? */
537 if ( gi->gi_n[i].gn_be->bd_info->bi_open ==
538 on->on_info->oi_orig->bi_open )
541 /* Loop thru the bd_info's and make sure we only
542 * invoke their bi_open functions once each.
544 for ( j = 0; j<i; j++ ) {
545 if ( gi->gi_n[i].gn_be->bd_info->bi_open ==
546 gi->gi_n[j].gn_be->bd_info->bi_open ) {
551 /* OK, it's unique and non-NULL, call it. */
552 if ( !same && gi->gi_n[i].gn_be->bd_info->bi_open )
553 rc = gi->gi_n[i].gn_be->bd_info->bi_open(
554 gi->gi_n[i].gn_be->bd_info );
555 /* Let backend.c take care of the rest of startup */
557 rc = backend_startup_one( gi->gi_n[i].gn_be );
560 if ( !rc && !bsame && on->on_info->oi_orig->bi_open )
561 rc = on->on_info->oi_orig->bi_open( on->on_info->oi_orig );
563 } /* other case is impossible */
567 /* This function will only be called in tool mode */
573 static int glueClosed = 0;
576 if (glueClosed) return 0;
580 if (slapMode & SLAP_TOOL_MODE) {
581 rc = backend_shutdown( NULL );
587 glue_entry_release_rw (
598 b2.bd_info = (BackendInfo *)glue_tool_inst( op->o_bd->bd_info );
599 op->o_bd = glue_back_select (&b2, &e->e_nname);
601 if ( op->o_bd->be_release ) {
602 rc = op->o_bd->be_release( op, e, rw );
605 /* FIXME: mimic be_entry_release_rw
606 * when no be_release() available */
616 glue_tool_entry_first (
620 slap_overinst *on = glue_tool_inst( b0->bd_info );
621 glueinfo *gi = on->on_bi.bi_private;
624 /* If we're starting from scratch, start at the most general */
626 if ( toolDB.be_entry_open && toolDB.be_entry_first ) {
629 for (i = gi->gi_nodes-1; i >= 0; i--) {
630 if (gi->gi_n[i].gn_be->be_entry_open &&
631 gi->gi_n[i].gn_be->be_entry_first) {
632 glueBack = gi->gi_n[i].gn_be;
638 if (!glueBack || !glueBack->be_entry_open || !glueBack->be_entry_first ||
639 glueBack->be_entry_open (glueBack, glueMode) != 0)
642 return glueBack->be_entry_first (glueBack);
646 glue_tool_entry_next (
650 slap_overinst *on = glue_tool_inst( b0->bd_info );
651 glueinfo *gi = on->on_bi.bi_private;
655 if (!glueBack || !glueBack->be_entry_next)
658 rc = glueBack->be_entry_next (glueBack);
660 /* If we ran out of entries in one database, move on to the next */
662 if ( glueBack && glueBack->be_entry_close )
663 glueBack->be_entry_close (glueBack);
664 for (i=0; i<gi->gi_nodes; i++) {
665 if (gi->gi_n[i].gn_be == glueBack)
672 glueBack = gi->gi_n[i-1].gn_be;
673 rc = glue_tool_entry_first (b0);
680 glue_tool_entry_get (
685 if (!glueBack || !glueBack->be_entry_get)
688 return glueBack->be_entry_get (glueBack, id);
692 glue_tool_entry_put (
702 b2.bd_info = (BackendInfo *)glue_tool_inst( b0->bd_info );
703 be = glue_back_select (&b2, &e->e_nname);
704 if ( be == &b2 ) be = &toolDB;
706 if (!be->be_entry_put)
710 if ( be->be_entry_open ) {
711 rc = be->be_entry_open (be, glueMode);
716 } else if (be != glueBack) {
717 /* If this entry belongs in a different branch than the
718 * previous one, close the current database and open the
721 if ( glueBack->be_entry_close ) {
722 glueBack->be_entry_close (glueBack);
724 if ( be->be_entry_open ) {
725 rc = be->be_entry_open (be, glueMode);
732 return be->be_entry_put (be, e, text);
736 glue_tool_entry_reindex (
741 if (!glueBack || !glueBack->be_entry_reindex)
744 return glueBack->be_entry_reindex (glueBack, id);
752 slap_overinst *on = glue_tool_inst( b0->bd_info );
753 glueinfo *gi = on->on_bi.bi_private;
754 BackendInfo *bi = b0->bd_info;
757 /* just sync everyone */
758 for (i = 0; i<gi->gi_nodes; i++)
759 if (gi->gi_n[i].gn_be->be_sync)
760 gi->gi_n[i].gn_be->be_sync (gi->gi_n[i].gn_be);
761 b0->bd_info = on->on_info->oi_orig;
773 slap_overinst *on = (slap_overinst *)be->bd_info;
774 slap_overinfo *oi = on->on_info;
775 BackendInfo *bi = oi->oi_orig;
778 gi = ch_calloc( 1, sizeof(glueinfo));
779 on->on_bi.bi_private = gi;
780 dnParent( be->be_nsuffix, &gi->gi_pdn );
782 /* Currently the overlay framework doesn't handle these entry points
783 * but we need them....
785 oi->oi_bi.bi_open = glue_open;
786 oi->oi_bi.bi_close = glue_close;
788 oi->oi_bi.bi_entry_release_rw = glue_entry_release_rw;
790 /* Only advertise these if the root DB supports them */
791 if ( bi->bi_tool_entry_open )
792 oi->oi_bi.bi_tool_entry_open = glue_tool_entry_open;
793 if ( bi->bi_tool_entry_close )
794 oi->oi_bi.bi_tool_entry_close = glue_tool_entry_close;
795 if ( bi->bi_tool_entry_first )
796 oi->oi_bi.bi_tool_entry_first = glue_tool_entry_first;
797 if ( bi->bi_tool_entry_next )
798 oi->oi_bi.bi_tool_entry_next = glue_tool_entry_next;
799 if ( bi->bi_tool_entry_get )
800 oi->oi_bi.bi_tool_entry_get = glue_tool_entry_get;
801 if ( bi->bi_tool_entry_put )
802 oi->oi_bi.bi_tool_entry_put = glue_tool_entry_put;
803 if ( bi->bi_tool_entry_reindex )
804 oi->oi_bi.bi_tool_entry_reindex = glue_tool_entry_reindex;
805 if ( bi->bi_tool_sync )
806 oi->oi_bi.bi_tool_sync = glue_tool_sync;
808 /*FIXME : need to add support */
809 oi->oi_bi.bi_tool_dn2id_get = 0;
810 oi->oi_bi.bi_tool_id2entry_get = 0;
811 oi->oi_bi.bi_tool_entry_modify = 0;
813 SLAP_DBFLAGS( be ) |= SLAP_DBFLAG_GLUE_INSTANCE;
823 slap_overinst *on = (slap_overinst *)be->bd_info;
824 glueinfo *gi = (glueinfo *)on->on_bi.bi_private;
827 return SLAP_CB_CONTINUE;
835 slap_overinst *on = (slap_overinst *)be->bd_info;
837 on->on_info->oi_bi.bi_db_close = 0;
842 glue_sub_del( BackendDB *b0 )
847 /* Find the top backend for this subordinate */
849 while ( (be=LDAP_STAILQ_NEXT( be, be_next )) != NULL ) {
855 if ( SLAP_GLUE_SUBORDINATE( be ))
857 if ( !SLAP_GLUE_INSTANCE( be ))
859 if ( !dnIsSuffix( &b0->be_nsuffix[0], &be->be_nsuffix[0] ))
862 /* OK, got the right backend, find the overlay */
863 oi = (slap_overinfo *)be->bd_info;
864 for ( on=oi->oi_list; on; on=on->on_next ) {
865 if ( on->on_bi.bi_type == glue.on_bi.bi_type )
868 assert( on != NULL );
869 gi = on->on_bi.bi_private;
870 for ( i=0; i < gi->gi_nodes; i++ ) {
871 if ( gi->gi_n[i].gn_be == b0 ) {
874 for (j=i+1; j < gi->gi_nodes; j++)
875 gi->gi_n[j-1] = gi->gi_n[j];
882 rc = LDAP_NO_SUCH_OBJECT;
887 typedef struct glue_Addrec {
888 struct glue_Addrec *ga_next;
892 /* List of added subordinates */
893 static glue_Addrec *ga_list;
895 /* Attach all the subordinate backends to their superior */
899 glue_Addrec *ga, *gnext = NULL;
902 /* For all the subordinate backends */
903 for ( ga=ga_list; ga != NULL; ga = gnext ) {
908 /* Find the top backend for this subordinate */
910 while ( (be=LDAP_STAILQ_NEXT( be, be_next )) != NULL ) {
915 if ( SLAP_GLUE_SUBORDINATE( be ))
917 if ( !dnIsSuffix( &ga->ga_be->be_nsuffix[0], &be->be_nsuffix[0] ))
920 /* If it's not already configured, set up the overlay */
921 if ( !SLAP_GLUE_INSTANCE( be )) {
922 rc = overlay_config( be, glue.on_bi.bi_type );
926 /* Find the overlay instance */
927 oi = (slap_overinfo *)be->bd_info;
928 for ( on=oi->oi_list; on; on=on->on_next ) {
929 if ( on->on_bi.bi_type == glue.on_bi.bi_type )
932 assert( on != NULL );
933 gi = on->on_bi.bi_private;
934 gi = (glueinfo *)ch_realloc( gi, sizeof(glueinfo) +
935 gi->gi_nodes * sizeof(gluenode));
936 gi->gi_n[gi->gi_nodes].gn_be = ga->ga_be;
937 dnParent( &ga->ga_be->be_nsuffix[0],
938 &gi->gi_n[gi->gi_nodes].gn_pdn );
940 on->on_bi.bi_private = gi;
944 Debug( LDAP_DEBUG_ANY, "glue: no superior found for sub %s!\n",
945 ga->ga_be->be_suffix[0].bv_val, 0, 0 );
946 rc = LDAP_NO_SUCH_OBJECT;
958 glue_sub_add( BackendDB *be, int advert, int online )
963 SLAP_DBFLAGS( be ) |= SLAP_DBFLAG_GLUE_SUBORDINATE;
965 SLAP_DBFLAGS( be ) |= SLAP_DBFLAG_GLUE_ADVERTISE;
967 ga = ch_malloc( sizeof( glue_Addrec ));
968 ga->ga_next = ga_list;
973 rc = glue_sub_attach();
981 glue.on_bi.bi_type = "glue";
983 glue.on_bi.bi_db_init = glue_db_init;
984 glue.on_bi.bi_db_close = glue_db_close;
985 glue.on_bi.bi_db_destroy = glue_db_destroy;
987 glue.on_bi.bi_op_search = glue_op_search;
988 glue.on_bi.bi_op_modify = glue_op_func;
989 glue.on_bi.bi_op_modrdn = glue_op_func;
990 glue.on_bi.bi_op_add = glue_op_func;
991 glue.on_bi.bi_op_delete = glue_op_func;
993 glue.on_bi.bi_chk_referrals = glue_chk_referrals;
994 glue.on_bi.bi_chk_controls = glue_chk_controls;
996 return overlay_register( &glue );