1 /* refint.c - referential integrity module */
3 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
5 * Copyright 2004-2007 The OpenLDAP Foundation.
6 * Portions Copyright 2004 Symas Corporation.
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted only as authorized by the OpenLDAP
13 * A copy of this license is available in the file LICENSE in the
14 * top-level directory of the distribution or, alternatively, at
15 * <http://www.OpenLDAP.org/license.html>.
18 * This work was initially developed by Symas Corp. for inclusion in
19 * OpenLDAP Software. This work was sponsored by Hewlett-Packard.
24 /* This module maintains referential integrity for a set of
25 * DN-valued attributes by searching for all references to a given
26 * DN whenever the DN is changed or its entry is deleted, and making
27 * the appropriate update.
29 * Updates are performed using the database rootdn in a separate task
30 * to allow the original operation to complete immediately.
33 #ifdef SLAPD_OVER_REFINT
37 #include <ac/string.h>
38 #include <ac/socket.h>
44 static slap_overinst refint;
46 /* The DN to use in the ModifiersName for all refint updates */
47 static BerValue refint_dn = BER_BVC("cn=Referential Integrity Overlay");
48 static BerValue refint_ndn = BER_BVC("cn=referential integrity overlay");
50 typedef struct refint_attrs_s {
51 struct refint_attrs_s *next;
52 AttributeDescription *attr;
59 typedef struct dependents_s {
60 struct dependents_s *next;
61 BerValue dn; /* target dn */
66 typedef struct refint_q {
67 struct refint_q *next;
68 struct refint_data_s *rdata;
69 dependent_data *attrs; /* entries and attrs returned from callback */
77 typedef struct refint_data_s {
78 const char *message; /* breadcrumbs */
79 struct refint_attrs_s *attrs; /* list of known attrs */
80 BerValue dn; /* basedn in parent, */
81 BerValue nothing; /* the nothing value, if needed */
82 BerValue nnothing; /* normalized nothingness */
86 ldap_pvt_thread_mutex_t qmutex;
89 #define RUNQ_INTERVAL 36000 /* a long time */
91 static MatchingRule *mr_dnSubtreeMatch;
98 static ConfigDriver refint_cf_gen;
100 static ConfigTable refintcfg[] = {
101 { "refint_attributes", "attribute...", 2, 0, 0,
102 ARG_MAGIC|REFINT_ATTRS, refint_cf_gen,
103 "( OLcfgOvAt:11.1 NAME 'olcRefintAttribute' "
104 "DESC 'Attributes for referential integrity' "
105 "EQUALITY caseIgnoreMatch "
106 "SYNTAX OMsDirectoryString )", NULL, NULL },
107 { "refint_nothing", "string", 2, 2, 0,
108 ARG_DN|ARG_MAGIC|REFINT_NOTHING, refint_cf_gen,
109 "( OLcfgOvAt:11.2 NAME 'olcRefintNothing' "
110 "DESC 'Replacement DN to supply when needed' "
111 "SYNTAX OMsDN SINGLE-VALUE )", NULL, NULL },
112 { NULL, NULL, 0, 0, 0, ARG_IGNORED }
115 static ConfigOCs refintocs[] = {
116 { "( OLcfgOvOc:11.1 "
117 "NAME 'olcRefintConfig' "
118 "DESC 'Referential integrity configuration' "
119 "SUP olcOverlayConfig "
120 "MAY ( olcRefintAttribute $ olcRefintNothing ) )",
121 Cft_Overlay, refintcfg },
126 refint_cf_gen(ConfigArgs *c)
128 slap_overinst *on = (slap_overinst *)c->bi;
129 refint_data *dd = (refint_data *)on->on_bi.bi_private;
130 refint_attrs *ip, *pip, **pipp = NULL;
131 AttributeDescription *ad;
133 int rc = ARG_BAD_CONF;
137 case SLAP_CONFIG_EMIT:
142 value_add_one( &c->rvalue_vals,
143 &ip->attr->ad_cname );
149 if ( !BER_BVISEMPTY( &dd->nothing )) {
150 rc = value_add_one( &c->rvalue_vals,
153 rc = value_add_one( &c->rvalue_nvals,
163 case LDAP_MOD_DELETE:
176 /* delete from linked list */
177 for ( i=0; i < c->valx; ++i ) {
178 pipp = &(*pipp)->next;
181 *pipp = (*pipp)->next;
183 /* AttributeDescriptions are global so
184 * shouldn't be freed here... */
190 if ( dd->nothing.bv_val )
191 ber_memfree ( dd->nothing.bv_val );
192 if ( dd->nnothing.bv_val )
193 ber_memfree ( dd->nnothing.bv_val );
194 dd->nothing.bv_len = 0;
195 dd->nnothing.bv_len = 0;
202 case SLAP_CONFIG_ADD:
203 /* fallthrough to LDAP_MOD_ADD */
208 for ( i=1; i < c->argc; ++i ) {
210 if ( slap_str2ad ( c->argv[i], &ad, &text )
213 sizeof ( refint_attrs ) );
215 ip->next = dd->attrs;
218 snprintf( c->cr_msg, sizeof( c->cr_msg ),
219 "%s <%s>: %s", c->argv[0], c->argv[i], text );
220 Debug ( LDAP_DEBUG_CONFIG|LDAP_DEBUG_NONE,
221 "%s: %s\n", c->log, c->cr_msg, 0 );
227 if ( dd->nothing.bv_val )
228 ber_memfree ( dd->nothing.bv_val );
229 if ( dd->nnothing.bv_val )
230 ber_memfree ( dd->nnothing.bv_val );
231 dd->nothing = c->value_dn;
232 dd->nnothing = c->value_ndn;
247 ** allocate new refint_data;
248 ** store in on_bi.bi_private;
258 slap_overinst *on = (slap_overinst *)be->bd_info;
259 refint_data *id = ch_calloc(1,sizeof(refint_data));
261 id->message = "_init";
262 on->on_bi.bi_private = id;
263 ldap_pvt_thread_mutex_init( &id->qmutex );
273 slap_overinst *on = (slap_overinst *)be->bd_info;
275 if ( on->on_bi.bi_private ) {
276 refint_data *id = on->on_bi.bi_private;
277 on->on_bi.bi_private = NULL;
278 ldap_pvt_thread_mutex_destroy( &id->qmutex );
285 ** initialize, copy basedn if not already set
295 slap_overinst *on = (slap_overinst *)be->bd_info;
296 refint_data *id = on->on_bi.bi_private;
297 id->message = "_open";
299 if ( BER_BVISNULL( &id->dn )) {
300 if ( BER_BVISNULL( &be->be_nsuffix[0] ))
302 ber_dupbv( &id->dn, &be->be_nsuffix[0] );
309 ** foreach configured attribute:
312 ** (do not) free id->message;
313 ** reset on_bi.bi_private;
314 ** free our config data;
324 slap_overinst *on = (slap_overinst *) be->bd_info;
325 refint_data *id = on->on_bi.bi_private;
326 refint_attrs *ii, *ij;
327 id->message = "_close";
329 for(ii = id->attrs; ii; ii = ij) {
335 ch_free( id->dn.bv_val );
336 BER_BVZERO( &id->dn );
337 ch_free( id->nothing.bv_val );
338 BER_BVZERO( &id->nothing );
339 ch_free( id->nnothing.bv_val );
340 BER_BVZERO( &id->nnothing );
347 ** generates a list of Attributes from search results
358 refint_q *rq = op->o_callback->sc_private;
359 refint_data *dd = rq->rdata;
360 refint_attrs *ia, *da = dd->attrs, *na;
364 Debug(LDAP_DEBUG_TRACE, "refint_search_cb <%s>\n",
365 rs->sr_entry ? rs->sr_entry->e_name.bv_val : "NOTHING", 0, 0);
367 if (rs->sr_type != REP_SEARCH || !rs->sr_entry) return(0);
370 ** foreach configured attribute type:
371 ** if this attr exists in the search result,
372 ** and it has a value matching the target:
374 ** if this is a delete and there's only one value:
375 ** allocate the same attr again;
379 ip = op->o_tmpalloc(sizeof(dependent_data), op->o_tmpmemctx );
380 ber_dupbv_x( &ip->dn, &rs->sr_entry->e_name, op->o_tmpmemctx );
381 ber_dupbv_x( &ip->ndn, &rs->sr_entry->e_nname, op->o_tmpmemctx );
382 ip->next = rq->attrs;
385 for(ia = da; ia; ia = ia->next) {
386 if ( (a = attr_find(rs->sr_entry->e_attrs, ia->attr) ) ) {
387 int first = -1, count = 0, deleted = 0;
391 for(i = 0, b = a->a_nvals; b[i].bv_val; i++) {
394 if(dnIsSuffix(&b[i], &rq->oldndn)) {
395 /* first match? create structure */
397 na = op->o_tmpcalloc( 1,
398 sizeof( refint_attrs ),
400 na->next = ip->attrs;
404 /* delete, or exact match? note it's first match */
405 if ( BER_BVISEMPTY( &rq->newdn ) &&
406 b[i].bv_len == rq->oldndn.bv_len )
412 /* if it's a rename, or a subordinate match,
413 * save old and build new dn */
414 if ( !BER_BVISEMPTY( &rq->newdn ) &&
415 b[i].bv_len != rq->oldndn.bv_len )
417 struct berval newsub, newdn, olddn, oldndn;
419 /* if not first, save first as well */
422 ber_dupbv_x( &olddn, &a->a_vals[first], op->o_tmpmemctx );
423 ber_bvarray_add_x( &na->old_vals, &olddn, op->o_tmpmemctx );
424 ber_dupbv_x( &oldndn, &a->a_nvals[first], op->o_tmpmemctx );
425 ber_bvarray_add_x( &na->old_nvals, &oldndn, op->o_tmpmemctx );
427 newsub = a->a_vals[first];
428 newsub.bv_len -= rq->olddn.bv_len + 1;
430 build_new_dn( &newdn, &rq->newdn, &newsub, op->o_tmpmemctx );
432 ber_bvarray_add_x( &na->new_vals, &newdn, op->o_tmpmemctx );
434 newsub = a->a_nvals[first];
435 newsub.bv_len -= rq->oldndn.bv_len + 1;
437 build_new_dn( &newdn, &rq->newndn, &newsub, op->o_tmpmemctx );
439 ber_bvarray_add_x( &na->new_nvals, &newdn, op->o_tmpmemctx );
444 ber_dupbv_x( &olddn, &a->a_vals[i], op->o_tmpmemctx );
445 ber_bvarray_add_x( &na->old_vals, &olddn, op->o_tmpmemctx );
446 ber_dupbv_x( &oldndn, &a->a_nvals[i], op->o_tmpmemctx );
447 ber_bvarray_add_x( &na->old_nvals, &oldndn, op->o_tmpmemctx );
449 newsub = a->a_vals[i];
450 newsub.bv_len -= rq->olddn.bv_len + 1;
452 build_new_dn( &newdn, &rq->newdn, &newsub, op->o_tmpmemctx );
454 ber_bvarray_add_x( &na->new_vals, &newdn, op->o_tmpmemctx );
456 newsub = a->a_nvals[i];
457 newsub.bv_len -= rq->oldndn.bv_len + 1;
459 build_new_dn( &newdn, &rq->newndn, &newsub, op->o_tmpmemctx );
461 ber_bvarray_add_x( &na->new_nvals, &newdn, op->o_tmpmemctx );
465 if ( BER_BVISEMPTY( &rq->newdn ) ) {
470 /* If this is a delete and no value would be left, and
471 * we have a nothing DN configured, allocate the attr again.
473 if ( count == deleted && !BER_BVISNULL(&dd->nothing) )
475 na = op->o_tmpcalloc( 1,
476 sizeof( refint_attrs ),
478 na->next = ip->attrs;
483 Debug( LDAP_DEBUG_TRACE, "refint_search_cb: %s: %s (#%d)\n",
484 a->a_desc->ad_cname.bv_val, rq->olddn.bv_val, count );
493 refint_qtask( void *ctx, void *arg )
495 struct re_s *rtask = arg;
496 refint_data *id = rtask->arg;
497 Connection conn = {0};
498 OperationBuffer opbuf;
500 SlapReply rs = {REP_RESULT};
501 slap_callback cb = { NULL, NULL, NULL, NULL };
504 dependent_data *dp, *dp_next;
505 refint_attrs *ra, *ip;
508 connection_fake_init( &conn, &opbuf, ctx );
512 ** build a search filter for all configured attributes;
513 ** populate our Operation;
514 ** pass our data (attr list, dn) to backend via sc_private;
515 ** call the backend search function;
516 ** nb: (|(one=thing)) is valid, but do smart formatting anyway;
517 ** nb: 16 is arbitrarily a dozen or so extra bytes;
521 ftop.f_choice = LDAP_FILTER_OR;
524 op->ors_filter = &ftop;
525 for(ip = id->attrs; ip; ip = ip->next) {
526 fptr = op->o_tmpcalloc( sizeof(Filter) + sizeof(MatchingRuleAssertion),
527 1, op->o_tmpmemctx );
528 /* Use (attr:dnSubtreeMatch:=value) to catch subtree rename
529 * and subtree delete where supported */
530 fptr->f_choice = LDAP_FILTER_EXT;
531 fptr->f_mra = (MatchingRuleAssertion *)(fptr+1);
532 fptr->f_mr_rule = mr_dnSubtreeMatch;
533 fptr->f_mr_rule_text = mr_dnSubtreeMatch->smr_str;
534 fptr->f_mr_desc = ip->attr;
535 fptr->f_mr_dnattrs = 0;
536 fptr->f_next = ftop.f_or;
542 ldap_pvt_thread_mutex_lock( &id->qmutex );
545 id->qhead = rq->next;
549 ldap_pvt_thread_mutex_unlock( &id->qmutex );
553 for (fptr = ftop.f_or; fptr; fptr=fptr->f_next )
554 fptr->f_mr_value = rq->oldndn;
556 filter2bv_x( op, op->ors_filter, &op->ors_filterstr );
558 /* callback gets the searched dn instead */
560 cb.sc_response = refint_search_cb;
561 op->o_callback = &cb;
562 op->o_tag = LDAP_REQ_SEARCH;
563 op->ors_scope = LDAP_SCOPE_SUBTREE;
564 op->ors_deref = LDAP_DEREF_NEVER;
565 op->ors_limit = NULL;
566 op->ors_slimit = SLAP_NO_LIMIT;
567 op->ors_tlimit = SLAP_NO_LIMIT;
570 op->ors_attrs = slap_anlist_no_attrs;
572 op->o_req_ndn = id->dn;
573 op->o_req_dn = id->dn;
575 op->o_dn = op->o_bd->be_rootdn;
576 op->o_ndn = op->o_bd->be_rootndn;
577 slap_op_time( &op->o_time, &op->o_tincr );
580 rc = op->o_bd->be_search(op, &rs);
582 op->o_tmpfree( op->ors_filterstr.bv_val, op->o_tmpmemctx );
584 if(rc != LDAP_SUCCESS) {
585 Debug( LDAP_DEBUG_TRACE,
586 "refint_response: search failed: %d\n",
591 /* safety? paranoid just in case */
593 Debug( LDAP_DEBUG_TRACE,
594 "refint_response: callback wiped out sc_private?!\n",
599 /* Set up the Modify requests */
600 cb.sc_response = &slap_null_cb;
601 op->o_tag = LDAP_REQ_MODIFY;
604 ** [our search callback builds a list of attrs]
606 ** make sure its dn has a backend;
607 ** build Modification* chain;
608 ** call the backend modify function;
612 for(dp = rq->attrs; dp; dp = dp_next) {
613 Modifications *m, *first = NULL;
617 op->orm_modlist = NULL;
619 op->o_req_dn = dp->dn;
620 op->o_req_ndn = dp->ndn;
621 op->o_bd = select_backend(&dp->ndn, 1);
623 Debug( LDAP_DEBUG_TRACE,
624 "refint_response: no backend for DN %s!\n",
625 dp->dn.bv_val, 0, 0 );
628 rs.sr_type = REP_RESULT;
629 for (ra = dp->attrs; ra; ra = dp->attrs) {
632 dp->attrs = ra->next;
633 /* Set our ModifiersName */
634 if ( SLAP_LASTMOD( op->o_bd )) {
635 m = op->o_tmpalloc( sizeof(Modifications) +
636 4*sizeof(BerValue), op->o_tmpmemctx );
637 m->sml_next = op->orm_modlist;
641 m->sml_op = LDAP_MOD_REPLACE;
642 m->sml_flags = SLAP_MOD_INTERNAL;
643 m->sml_desc = slap_schema.si_ad_modifiersName;
644 m->sml_type = m->sml_desc->ad_cname;
645 m->sml_values = (BerVarray)(m+1);
646 m->sml_nvalues = m->sml_values+2;
647 BER_BVZERO( &m->sml_values[1] );
648 BER_BVZERO( &m->sml_nvalues[1] );
649 m->sml_values[0] = refint_dn;
650 m->sml_nvalues[0] = refint_ndn;
652 if ( !BER_BVISEMPTY( &rq->newdn ) || ( ra->next &&
653 ra->attr == ra->next->attr ))
655 len = sizeof(Modifications);
657 if ( ra->new_vals == NULL ) {
658 len += 4*sizeof(BerValue);
661 m = op->o_tmpalloc( len, op->o_tmpmemctx );
662 m->sml_next = op->orm_modlist;
666 m->sml_op = LDAP_MOD_ADD;
668 m->sml_desc = ra->attr;
669 m->sml_type = ra->attr->ad_cname;
670 if ( ra->new_vals == NULL ) {
671 m->sml_values = (BerVarray)(m+1);
672 m->sml_nvalues = m->sml_values+2;
673 BER_BVZERO( &m->sml_values[1] );
674 BER_BVZERO( &m->sml_nvalues[1] );
675 if ( BER_BVISEMPTY( &rq->newdn )) {
676 op->o_tmpfree( ra, op->o_tmpmemctx );
678 dp->attrs = ra->next;
679 m->sml_values[0] = id->nothing;
680 m->sml_nvalues[0] = id->nnothing;
682 m->sml_values[0] = rq->newdn;
683 m->sml_nvalues[0] = rq->newndn;
686 m->sml_values = ra->new_vals;
687 m->sml_nvalues = ra->new_nvals;
691 len = sizeof(Modifications);
692 if ( ra->old_vals == NULL ) {
693 len += 4*sizeof(BerValue);
696 m = op->o_tmpalloc( len, op->o_tmpmemctx );
697 m->sml_next = op->orm_modlist;
701 m->sml_op = LDAP_MOD_DELETE;
703 m->sml_desc = ra->attr;
704 m->sml_type = ra->attr->ad_cname;
705 if ( ra->old_vals == NULL ) {
706 m->sml_values = (BerVarray)(m+1);
707 m->sml_nvalues = m->sml_values+2;
708 m->sml_values[0] = rq->olddn;
709 m->sml_nvalues[0] = rq->oldndn;
710 BER_BVZERO( &m->sml_values[1] );
711 BER_BVZERO( &m->sml_nvalues[1] );
713 m->sml_values = ra->old_vals;
714 m->sml_nvalues = ra->old_nvals;
716 op->o_tmpfree( ra, op->o_tmpmemctx );
719 op->o_dn = op->o_bd->be_rootdn;
720 op->o_ndn = op->o_bd->be_rootndn;
721 slap_op_time( &op->o_time, &op->o_tincr );
722 if((rc = op->o_bd->be_modify(op, &rs)) != LDAP_SUCCESS) {
723 Debug( LDAP_DEBUG_TRACE,
724 "refint_response: dependent modify failed: %d\n",
728 while (( m = op->orm_modlist )) {
729 op->orm_modlist = m->sml_next;
730 if ( m->sml_values && m->sml_values != (BerVarray)(m+1) ) {
731 ber_bvarray_free_x( m->sml_values, op->o_tmpmemctx );
732 ber_bvarray_free_x( m->sml_nvalues, op->o_tmpmemctx );
734 op->o_tmpfree( m, op->o_tmpmemctx );
735 if ( m == first ) break;
737 slap_mods_free( op->orm_modlist, 1 );
738 op->o_tmpfree( dp->ndn.bv_val, op->o_tmpmemctx );
739 op->o_tmpfree( dp->dn.bv_val, op->o_tmpmemctx );
740 op->o_tmpfree( dp, op->o_tmpmemctx );
743 if ( !BER_BVISNULL( &rq->newndn )) {
744 ch_free( rq->newndn.bv_val );
745 ch_free( rq->newdn.bv_val );
747 ch_free( rq->oldndn.bv_val );
748 ch_free( rq->olddn.bv_val );
753 for ( fptr = ftop.f_or; fptr; ) {
754 Filter *f_next = fptr->f_next;
755 op->o_tmpfree( fptr, op->o_tmpmemctx );
759 /* wait until we get explicitly scheduled again */
760 ldap_pvt_thread_mutex_lock( &slapd_rq.rq_mutex );
761 ldap_pvt_runqueue_stoptask( &slapd_rq, id->qtask );
762 ldap_pvt_runqueue_resched( &slapd_rq,id->qtask, 1 );
763 ldap_pvt_thread_mutex_unlock( &slapd_rq.rq_mutex );
770 ** search for matching records and modify them
779 slap_overinst *on = (slap_overinst *) op->o_bd->bd_info;
780 refint_data *id = on->on_bi.bi_private;
787 id->message = "_refint_response";
789 /* If the main op failed or is not a Delete or ModRdn, ignore it */
790 if (( op->o_tag != LDAP_REQ_DELETE && op->o_tag != LDAP_REQ_MODRDN ) ||
791 rs->sr_err != LDAP_SUCCESS )
792 return SLAP_CB_CONTINUE;
795 ** validate (and count) the list of attrs;
799 for(ip = id->attrs, ac = 0; ip; ip = ip->next, ac++);
801 Debug( LDAP_DEBUG_TRACE,
802 "refint_response called without any attributes\n", 0, 0, 0 );
803 return SLAP_CB_CONTINUE;
807 ** find the backend that matches our configured basedn;
808 ** make sure it exists and has search and modify methods;
812 db = select_backend(&id->dn, 1);
815 if (!db->be_search || !db->be_modify) {
816 Debug( LDAP_DEBUG_TRACE,
817 "refint_response: backend missing search and/or modify\n",
819 return SLAP_CB_CONTINUE;
822 Debug( LDAP_DEBUG_TRACE,
823 "refint_response: no backend for our baseDN %s??\n",
824 id->dn.bv_val, 0, 0 );
825 return SLAP_CB_CONTINUE;
828 rq = ch_calloc( 1, sizeof( refint_q ));
829 ber_dupbv( &rq->olddn, &op->o_req_dn );
830 ber_dupbv( &rq->oldndn, &op->o_req_ndn );
834 if(op->o_tag == LDAP_REQ_MODRDN) {
835 if ( op->oq_modrdn.rs_newSup ) {
836 pdn = *op->oq_modrdn.rs_newSup;
838 dnParent( &op->o_req_dn, &pdn );
840 build_new_dn( &rq->newdn, &pdn, &op->orr_newrdn, NULL );
841 if ( op->oq_modrdn.rs_nnewSup ) {
842 pdn = *op->oq_modrdn.rs_nnewSup;
844 dnParent( &op->o_req_ndn, &pdn );
846 build_new_dn( &rq->newndn, &pdn, &op->orr_nnewrdn, NULL );
849 ldap_pvt_thread_mutex_lock( &id->qmutex );
851 id->qtail->next = rq;
856 ldap_pvt_thread_mutex_unlock( &id->qmutex );
859 ldap_pvt_thread_mutex_lock( &slapd_rq.rq_mutex );
861 id->qtask = ldap_pvt_runqueue_insert( &slapd_rq, RUNQ_INTERVAL,
862 refint_qtask, id, "refint_qtask",
863 op->o_bd->be_suffix[0].bv_val );
866 if ( !ldap_pvt_runqueue_isrunning( &slapd_rq, id->qtask ) &&
867 !id->qtask->next_sched.tv_sec ) {
868 id->qtask->interval.tv_sec = 0;
869 ldap_pvt_runqueue_resched( &slapd_rq, id->qtask, 0 );
870 id->qtask->interval.tv_sec = RUNQ_INTERVAL;
874 ldap_pvt_thread_mutex_unlock( &slapd_rq.rq_mutex );
876 slap_wake_listener();
878 return SLAP_CB_CONTINUE;
882 ** init_module is last so the symbols resolve "for free" --
883 ** it expects to be called automagically during dynamic module initialization
886 int refint_initialize() {
889 mr_dnSubtreeMatch = mr_find( "dnSubtreeMatch" );
890 if ( mr_dnSubtreeMatch == NULL ) {
891 Debug( LDAP_DEBUG_ANY, "refint_initialize: "
892 "unable to find MatchingRule 'dnSubtreeMatch'.\n",
897 /* statically declared just after the #includes at top */
898 refint.on_bi.bi_type = "refint";
899 refint.on_bi.bi_db_init = refint_db_init;
900 refint.on_bi.bi_db_destroy = refint_db_destroy;
901 refint.on_bi.bi_db_open = refint_open;
902 refint.on_bi.bi_db_close = refint_close;
903 refint.on_response = refint_response;
905 refint.on_bi.bi_cf_ocs = refintocs;
906 rc = config_register_schema ( refintcfg, refintocs );
909 return(overlay_register(&refint));
912 #if SLAPD_OVER_REFINT == SLAPD_MOD_DYNAMIC && defined(PIC)
913 int init_module(int argc, char *argv[]) {
914 return refint_initialize();
918 #endif /* SLAPD_OVER_REFINT */