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;
60 typedef struct dependents_s {
61 struct dependents_s *next;
62 BerValue dn; /* target dn */
67 typedef struct refint_q {
68 struct refint_q *next;
69 struct refint_data_s *rdata;
70 dependent_data *attrs; /* entries and attrs returned from callback */
78 typedef struct refint_data_s {
79 const char *message; /* breadcrumbs */
80 struct refint_attrs_s *attrs; /* list of known attrs */
81 BerValue dn; /* basedn in parent, */
82 BerValue nothing; /* the nothing value, if needed */
83 BerValue nnothing; /* normalized nothingness */
87 ldap_pvt_thread_mutex_t qmutex;
90 #define RUNQ_INTERVAL 36000 /* a long time */
92 static MatchingRule *mr_dnSubtreeMatch;
99 static ConfigDriver refint_cf_gen;
101 static ConfigTable refintcfg[] = {
102 { "refint_attributes", "attribute...", 2, 0, 0,
103 ARG_MAGIC|REFINT_ATTRS, refint_cf_gen,
104 "( OLcfgOvAt:11.1 NAME 'olcRefintAttribute' "
105 "DESC 'Attributes for referential integrity' "
106 "EQUALITY caseIgnoreMatch "
107 "SYNTAX OMsDirectoryString )", NULL, NULL },
108 { "refint_nothing", "string", 2, 2, 0,
109 ARG_DN|ARG_MAGIC|REFINT_NOTHING, refint_cf_gen,
110 "( OLcfgOvAt:11.2 NAME 'olcRefintNothing' "
111 "DESC 'Replacement DN to supply when needed' "
112 "SYNTAX OMsDN SINGLE-VALUE )", NULL, NULL },
113 { NULL, NULL, 0, 0, 0, ARG_IGNORED }
116 static ConfigOCs refintocs[] = {
117 { "( OLcfgOvOc:11.1 "
118 "NAME 'olcRefintConfig' "
119 "DESC 'Referential integrity configuration' "
120 "SUP olcOverlayConfig "
121 "MAY ( olcRefintAttribute $ olcRefintNothing ) )",
122 Cft_Overlay, refintcfg },
127 refint_cf_gen(ConfigArgs *c)
129 slap_overinst *on = (slap_overinst *)c->bi;
130 refint_data *dd = (refint_data *)on->on_bi.bi_private;
131 refint_attrs *ip, *pip, **pipp = NULL;
132 AttributeDescription *ad;
134 int rc = ARG_BAD_CONF;
138 case SLAP_CONFIG_EMIT:
143 value_add_one( &c->rvalue_vals,
144 &ip->attr->ad_cname );
150 if ( !BER_BVISEMPTY( &dd->nothing )) {
151 rc = value_add_one( &c->rvalue_vals,
154 rc = value_add_one( &c->rvalue_nvals,
164 case LDAP_MOD_DELETE:
177 /* delete from linked list */
178 for ( i=0; i < c->valx; ++i ) {
179 pipp = &(*pipp)->next;
182 *pipp = (*pipp)->next;
184 /* AttributeDescriptions are global so
185 * shouldn't be freed here... */
191 if ( dd->nothing.bv_val )
192 ber_memfree ( dd->nothing.bv_val );
193 if ( dd->nnothing.bv_val )
194 ber_memfree ( dd->nnothing.bv_val );
195 dd->nothing.bv_len = 0;
196 dd->nnothing.bv_len = 0;
203 case SLAP_CONFIG_ADD:
204 /* fallthrough to LDAP_MOD_ADD */
209 for ( i=1; i < c->argc; ++i ) {
211 if ( slap_str2ad ( c->argv[i], &ad, &text )
214 sizeof ( refint_attrs ) );
216 ip->next = dd->attrs;
219 snprintf( c->cr_msg, sizeof( c->cr_msg ),
220 "%s <%s>: %s", c->argv[0], c->argv[i], text );
221 Debug ( LDAP_DEBUG_CONFIG|LDAP_DEBUG_NONE,
222 "%s: %s\n", c->log, c->cr_msg, 0 );
228 if ( dd->nothing.bv_val )
229 ber_memfree ( dd->nothing.bv_val );
230 if ( dd->nnothing.bv_val )
231 ber_memfree ( dd->nnothing.bv_val );
232 dd->nothing = c->value_dn;
233 dd->nnothing = c->value_ndn;
248 ** allocate new refint_data;
249 ** store in on_bi.bi_private;
259 slap_overinst *on = (slap_overinst *)be->bd_info;
260 refint_data *id = ch_calloc(1,sizeof(refint_data));
262 id->message = "_init";
263 on->on_bi.bi_private = id;
264 ldap_pvt_thread_mutex_init( &id->qmutex );
274 slap_overinst *on = (slap_overinst *)be->bd_info;
276 if ( on->on_bi.bi_private ) {
277 refint_data *id = on->on_bi.bi_private;
278 on->on_bi.bi_private = NULL;
279 ldap_pvt_thread_mutex_destroy( &id->qmutex );
286 ** initialize, copy basedn if not already set
296 slap_overinst *on = (slap_overinst *)be->bd_info;
297 refint_data *id = on->on_bi.bi_private;
298 id->message = "_open";
300 if ( BER_BVISNULL( &id->dn )) {
301 if ( BER_BVISNULL( &be->be_nsuffix[0] ))
303 ber_dupbv( &id->dn, &be->be_nsuffix[0] );
310 ** foreach configured attribute:
313 ** (do not) free id->message;
314 ** reset on_bi.bi_private;
315 ** free our config data;
325 slap_overinst *on = (slap_overinst *) be->bd_info;
326 refint_data *id = on->on_bi.bi_private;
327 refint_attrs *ii, *ij;
328 id->message = "_close";
330 for(ii = id->attrs; ii; ii = ij) {
336 ch_free( id->dn.bv_val );
337 BER_BVZERO( &id->dn );
338 ch_free( id->nothing.bv_val );
339 BER_BVZERO( &id->nothing );
340 ch_free( id->nnothing.bv_val );
341 BER_BVZERO( &id->nnothing );
348 ** generates a list of Attributes from search results
359 refint_q *rq = op->o_callback->sc_private;
360 refint_data *dd = rq->rdata;
361 refint_attrs *ia, *da = dd->attrs, *na;
365 Debug(LDAP_DEBUG_TRACE, "refint_search_cb <%s>\n",
366 rs->sr_entry ? rs->sr_entry->e_name.bv_val : "NOTHING", 0, 0);
368 if (rs->sr_type != REP_SEARCH || !rs->sr_entry) return(0);
371 ** foreach configured attribute type:
372 ** if this attr exists in the search result,
373 ** and it has a value matching the target:
375 ** if this is a delete and there's only one value:
376 ** allocate the same attr again;
380 ip = op->o_tmpalloc(sizeof(dependent_data), op->o_tmpmemctx );
381 ber_dupbv_x( &ip->dn, &rs->sr_entry->e_name, op->o_tmpmemctx );
382 ber_dupbv_x( &ip->ndn, &rs->sr_entry->e_nname, op->o_tmpmemctx );
383 ip->next = rq->attrs;
386 for(ia = da; ia; ia = ia->next) {
387 if ( (a = attr_find(rs->sr_entry->e_attrs, ia->attr) ) ) {
388 int first = -1, count = 0, deleted = 0;
392 for(i = 0, b = a->a_nvals; b[i].bv_val; i++) {
395 if(dnIsSuffix(&b[i], &rq->oldndn)) {
396 /* first match? create structure */
398 na = op->o_tmpcalloc( 1,
399 sizeof( refint_attrs ),
401 na->next = ip->attrs;
405 /* delete, or exact match? note it's first match */
406 if ( BER_BVISEMPTY( &rq->newdn ) &&
407 b[i].bv_len == rq->oldndn.bv_len )
413 /* if it's a rename, or a subordinate match,
414 * save old and build new dn */
415 if ( !BER_BVISEMPTY( &rq->newdn ) &&
416 b[i].bv_len != rq->oldndn.bv_len )
418 struct berval newsub, newdn, olddn, oldndn;
420 /* if not first, save first as well */
423 ber_dupbv_x( &olddn, &a->a_vals[first], op->o_tmpmemctx );
424 ber_bvarray_add_x( &na->old_vals, &olddn, op->o_tmpmemctx );
425 ber_dupbv_x( &oldndn, &a->a_nvals[first], op->o_tmpmemctx );
426 ber_bvarray_add_x( &na->old_nvals, &oldndn, op->o_tmpmemctx );
429 newsub = a->a_vals[first];
430 newsub.bv_len -= rq->olddn.bv_len + 1;
432 build_new_dn( &newdn, &rq->newdn, &newsub, op->o_tmpmemctx );
434 ber_bvarray_add_x( &na->new_vals, &newdn, op->o_tmpmemctx );
436 newsub = a->a_nvals[first];
437 newsub.bv_len -= rq->oldndn.bv_len + 1;
439 build_new_dn( &newdn, &rq->newndn, &newsub, op->o_tmpmemctx );
441 ber_bvarray_add_x( &na->new_nvals, &newdn, op->o_tmpmemctx );
446 ber_dupbv_x( &olddn, &a->a_vals[i], op->o_tmpmemctx );
447 ber_bvarray_add_x( &na->old_vals, &olddn, op->o_tmpmemctx );
448 ber_dupbv_x( &oldndn, &a->a_nvals[i], op->o_tmpmemctx );
449 ber_bvarray_add_x( &na->old_nvals, &oldndn, op->o_tmpmemctx );
452 newsub = a->a_vals[i];
453 newsub.bv_len -= rq->olddn.bv_len + 1;
455 build_new_dn( &newdn, &rq->newdn, &newsub, op->o_tmpmemctx );
457 ber_bvarray_add_x( &na->new_vals, &newdn, op->o_tmpmemctx );
459 newsub = a->a_nvals[i];
460 newsub.bv_len -= rq->oldndn.bv_len + 1;
462 build_new_dn( &newdn, &rq->newndn, &newsub, op->o_tmpmemctx );
464 ber_bvarray_add_x( &na->new_nvals, &newdn, op->o_tmpmemctx );
468 if ( BER_BVISEMPTY( &rq->newdn ) ) {
473 /* If this is a delete and no value would be left, and
474 * we have a nothing DN configured, allocate the attr again.
476 if ( count == deleted && !BER_BVISNULL(&dd->nothing) )
478 na = op->o_tmpcalloc( 1,
479 sizeof( refint_attrs ),
481 na->next = ip->attrs;
486 Debug( LDAP_DEBUG_TRACE, "refint_search_cb: %s: %s (#%d)\n",
487 a->a_desc->ad_cname.bv_val, rq->olddn.bv_val, count );
496 refint_qtask( void *ctx, void *arg )
498 struct re_s *rtask = arg;
499 refint_data *id = rtask->arg;
500 Connection conn = {0};
501 OperationBuffer opbuf;
503 SlapReply rs = {REP_RESULT};
504 slap_callback cb = { NULL, NULL, NULL, NULL };
507 dependent_data *dp, *dp_next;
508 refint_attrs *ra, *ip;
511 connection_fake_init( &conn, &opbuf, ctx );
515 ** build a search filter for all configured attributes;
516 ** populate our Operation;
517 ** pass our data (attr list, dn) to backend via sc_private;
518 ** call the backend search function;
519 ** nb: (|(one=thing)) is valid, but do smart formatting anyway;
520 ** nb: 16 is arbitrarily a dozen or so extra bytes;
524 ftop.f_choice = LDAP_FILTER_OR;
527 op->ors_filter = &ftop;
528 for(ip = id->attrs; ip; ip = ip->next) {
529 fptr = op->o_tmpcalloc( sizeof(Filter) + sizeof(MatchingRuleAssertion),
530 1, op->o_tmpmemctx );
531 /* Use (attr:dnSubtreeMatch:=value) to catch subtree rename
532 * and subtree delete where supported */
533 fptr->f_choice = LDAP_FILTER_EXT;
534 fptr->f_mra = (MatchingRuleAssertion *)(fptr+1);
535 fptr->f_mr_rule = mr_dnSubtreeMatch;
536 fptr->f_mr_rule_text = mr_dnSubtreeMatch->smr_str;
537 fptr->f_mr_desc = ip->attr;
538 fptr->f_mr_dnattrs = 0;
539 fptr->f_next = ftop.f_or;
545 ldap_pvt_thread_mutex_lock( &id->qmutex );
548 id->qhead = rq->next;
552 ldap_pvt_thread_mutex_unlock( &id->qmutex );
556 for (fptr = ftop.f_or; fptr; fptr=fptr->f_next )
557 fptr->f_mr_value = rq->oldndn;
559 filter2bv_x( op, op->ors_filter, &op->ors_filterstr );
561 /* callback gets the searched dn instead */
563 cb.sc_response = refint_search_cb;
564 op->o_callback = &cb;
565 op->o_tag = LDAP_REQ_SEARCH;
566 op->ors_scope = LDAP_SCOPE_SUBTREE;
567 op->ors_deref = LDAP_DEREF_NEVER;
568 op->ors_limit = NULL;
569 op->ors_slimit = SLAP_NO_LIMIT;
570 op->ors_tlimit = SLAP_NO_LIMIT;
573 op->ors_attrs = slap_anlist_no_attrs;
575 op->o_req_ndn = id->dn;
576 op->o_req_dn = id->dn;
578 op->o_dn = op->o_bd->be_rootdn;
579 op->o_ndn = op->o_bd->be_rootndn;
580 slap_op_time( &op->o_time, &op->o_tincr );
583 rc = op->o_bd->be_search(op, &rs);
585 op->o_tmpfree( op->ors_filterstr.bv_val, op->o_tmpmemctx );
587 if(rc != LDAP_SUCCESS) {
588 Debug( LDAP_DEBUG_TRACE,
589 "refint_response: search failed: %d\n",
594 /* safety? paranoid just in case */
596 Debug( LDAP_DEBUG_TRACE,
597 "refint_response: callback wiped out sc_private?!\n",
602 /* Set up the Modify requests */
603 cb.sc_response = &slap_null_cb;
604 op->o_tag = LDAP_REQ_MODIFY;
607 ** [our search callback builds a list of attrs]
609 ** make sure its dn has a backend;
610 ** build Modification* chain;
611 ** call the backend modify function;
615 for(dp = rq->attrs; dp; dp = dp_next) {
616 Modifications *m, *first = NULL;
620 op->orm_modlist = NULL;
622 op->o_req_dn = dp->dn;
623 op->o_req_ndn = dp->ndn;
624 op->o_bd = select_backend(&dp->ndn, 1);
626 Debug( LDAP_DEBUG_TRACE,
627 "refint_response: no backend for DN %s!\n",
628 dp->dn.bv_val, 0, 0 );
631 rs.sr_type = REP_RESULT;
632 for (ra = dp->attrs; ra; ra = dp->attrs) {
635 dp->attrs = ra->next;
636 /* Set our ModifiersName */
637 if ( SLAP_LASTMOD( op->o_bd )) {
638 m = op->o_tmpalloc( sizeof(Modifications) +
639 4*sizeof(BerValue), op->o_tmpmemctx );
640 m->sml_next = op->orm_modlist;
644 m->sml_op = LDAP_MOD_REPLACE;
645 m->sml_flags = SLAP_MOD_INTERNAL;
646 m->sml_desc = slap_schema.si_ad_modifiersName;
647 m->sml_type = m->sml_desc->ad_cname;
649 m->sml_values = (BerVarray)(m+1);
650 m->sml_nvalues = m->sml_values+2;
651 BER_BVZERO( &m->sml_values[1] );
652 BER_BVZERO( &m->sml_nvalues[1] );
653 m->sml_values[0] = refint_dn;
654 m->sml_nvalues[0] = refint_ndn;
656 if ( !BER_BVISEMPTY( &rq->newdn ) || ( ra->next &&
657 ra->attr == ra->next->attr ))
659 len = sizeof(Modifications);
661 if ( ra->new_vals == NULL ) {
662 len += 4*sizeof(BerValue);
665 m = op->o_tmpalloc( len, op->o_tmpmemctx );
666 m->sml_next = op->orm_modlist;
670 m->sml_op = LDAP_MOD_ADD;
672 m->sml_desc = ra->attr;
673 m->sml_type = ra->attr->ad_cname;
674 if ( ra->new_vals == NULL ) {
675 m->sml_values = (BerVarray)(m+1);
676 m->sml_nvalues = m->sml_values+2;
677 BER_BVZERO( &m->sml_values[1] );
678 BER_BVZERO( &m->sml_nvalues[1] );
680 if ( BER_BVISEMPTY( &rq->newdn )) {
681 op->o_tmpfree( ra, op->o_tmpmemctx );
683 dp->attrs = ra->next;
684 m->sml_values[0] = id->nothing;
685 m->sml_nvalues[0] = id->nnothing;
687 m->sml_values[0] = rq->newdn;
688 m->sml_nvalues[0] = rq->newndn;
691 m->sml_values = ra->new_vals;
692 m->sml_nvalues = ra->new_nvals;
693 m->sml_numvals = ra->ra_numvals;
697 len = sizeof(Modifications);
698 if ( ra->old_vals == NULL ) {
699 len += 4*sizeof(BerValue);
702 m = op->o_tmpalloc( len, op->o_tmpmemctx );
703 m->sml_next = op->orm_modlist;
707 m->sml_op = LDAP_MOD_DELETE;
709 m->sml_desc = ra->attr;
710 m->sml_type = ra->attr->ad_cname;
711 if ( ra->old_vals == NULL ) {
713 m->sml_values = (BerVarray)(m+1);
714 m->sml_nvalues = m->sml_values+2;
715 m->sml_values[0] = rq->olddn;
716 m->sml_nvalues[0] = rq->oldndn;
717 BER_BVZERO( &m->sml_values[1] );
718 BER_BVZERO( &m->sml_nvalues[1] );
720 m->sml_values = ra->old_vals;
721 m->sml_nvalues = ra->old_nvals;
722 m->sml_numvals = ra->ra_numvals;
724 op->o_tmpfree( ra, op->o_tmpmemctx );
727 op->o_dn = op->o_bd->be_rootdn;
728 op->o_ndn = op->o_bd->be_rootndn;
729 slap_op_time( &op->o_time, &op->o_tincr );
730 if((rc = op->o_bd->be_modify(op, &rs)) != LDAP_SUCCESS) {
731 Debug( LDAP_DEBUG_TRACE,
732 "refint_response: dependent modify failed: %d\n",
736 while (( m = op->orm_modlist )) {
737 op->orm_modlist = m->sml_next;
738 if ( m->sml_values && m->sml_values != (BerVarray)(m+1) ) {
739 ber_bvarray_free_x( m->sml_values, op->o_tmpmemctx );
740 ber_bvarray_free_x( m->sml_nvalues, op->o_tmpmemctx );
742 op->o_tmpfree( m, op->o_tmpmemctx );
743 if ( m == first ) break;
745 slap_mods_free( op->orm_modlist, 1 );
746 op->o_tmpfree( dp->ndn.bv_val, op->o_tmpmemctx );
747 op->o_tmpfree( dp->dn.bv_val, op->o_tmpmemctx );
748 op->o_tmpfree( dp, op->o_tmpmemctx );
751 if ( !BER_BVISNULL( &rq->newndn )) {
752 ch_free( rq->newndn.bv_val );
753 ch_free( rq->newdn.bv_val );
755 ch_free( rq->oldndn.bv_val );
756 ch_free( rq->olddn.bv_val );
761 for ( fptr = ftop.f_or; fptr; ) {
762 Filter *f_next = fptr->f_next;
763 op->o_tmpfree( fptr, op->o_tmpmemctx );
767 /* wait until we get explicitly scheduled again */
768 ldap_pvt_thread_mutex_lock( &slapd_rq.rq_mutex );
769 ldap_pvt_runqueue_stoptask( &slapd_rq, id->qtask );
770 ldap_pvt_runqueue_resched( &slapd_rq,id->qtask, 1 );
771 ldap_pvt_thread_mutex_unlock( &slapd_rq.rq_mutex );
778 ** search for matching records and modify them
787 slap_overinst *on = (slap_overinst *) op->o_bd->bd_info;
788 refint_data *id = on->on_bi.bi_private;
795 id->message = "_refint_response";
797 /* If the main op failed or is not a Delete or ModRdn, ignore it */
798 if (( op->o_tag != LDAP_REQ_DELETE && op->o_tag != LDAP_REQ_MODRDN ) ||
799 rs->sr_err != LDAP_SUCCESS )
800 return SLAP_CB_CONTINUE;
803 ** validate (and count) the list of attrs;
807 for(ip = id->attrs, ac = 0; ip; ip = ip->next, ac++);
809 Debug( LDAP_DEBUG_TRACE,
810 "refint_response called without any attributes\n", 0, 0, 0 );
811 return SLAP_CB_CONTINUE;
815 ** find the backend that matches our configured basedn;
816 ** make sure it exists and has search and modify methods;
820 db = select_backend(&id->dn, 1);
823 if (!db->be_search || !db->be_modify) {
824 Debug( LDAP_DEBUG_TRACE,
825 "refint_response: backend missing search and/or modify\n",
827 return SLAP_CB_CONTINUE;
830 Debug( LDAP_DEBUG_TRACE,
831 "refint_response: no backend for our baseDN %s??\n",
832 id->dn.bv_val, 0, 0 );
833 return SLAP_CB_CONTINUE;
836 rq = ch_calloc( 1, sizeof( refint_q ));
837 ber_dupbv( &rq->olddn, &op->o_req_dn );
838 ber_dupbv( &rq->oldndn, &op->o_req_ndn );
842 if(op->o_tag == LDAP_REQ_MODRDN) {
843 if ( op->oq_modrdn.rs_newSup ) {
844 pdn = *op->oq_modrdn.rs_newSup;
846 dnParent( &op->o_req_dn, &pdn );
848 build_new_dn( &rq->newdn, &pdn, &op->orr_newrdn, NULL );
849 if ( op->oq_modrdn.rs_nnewSup ) {
850 pdn = *op->oq_modrdn.rs_nnewSup;
852 dnParent( &op->o_req_ndn, &pdn );
854 build_new_dn( &rq->newndn, &pdn, &op->orr_nnewrdn, NULL );
857 ldap_pvt_thread_mutex_lock( &id->qmutex );
859 id->qtail->next = rq;
864 ldap_pvt_thread_mutex_unlock( &id->qmutex );
867 ldap_pvt_thread_mutex_lock( &slapd_rq.rq_mutex );
869 id->qtask = ldap_pvt_runqueue_insert( &slapd_rq, RUNQ_INTERVAL,
870 refint_qtask, id, "refint_qtask",
871 op->o_bd->be_suffix[0].bv_val );
874 if ( !ldap_pvt_runqueue_isrunning( &slapd_rq, id->qtask ) &&
875 !id->qtask->next_sched.tv_sec ) {
876 id->qtask->interval.tv_sec = 0;
877 ldap_pvt_runqueue_resched( &slapd_rq, id->qtask, 0 );
878 id->qtask->interval.tv_sec = RUNQ_INTERVAL;
882 ldap_pvt_thread_mutex_unlock( &slapd_rq.rq_mutex );
884 slap_wake_listener();
886 return SLAP_CB_CONTINUE;
890 ** init_module is last so the symbols resolve "for free" --
891 ** it expects to be called automagically during dynamic module initialization
894 int refint_initialize() {
897 mr_dnSubtreeMatch = mr_find( "dnSubtreeMatch" );
898 if ( mr_dnSubtreeMatch == NULL ) {
899 Debug( LDAP_DEBUG_ANY, "refint_initialize: "
900 "unable to find MatchingRule 'dnSubtreeMatch'.\n",
905 /* statically declared just after the #includes at top */
906 refint.on_bi.bi_type = "refint";
907 refint.on_bi.bi_db_init = refint_db_init;
908 refint.on_bi.bi_db_destroy = refint_db_destroy;
909 refint.on_bi.bi_db_open = refint_open;
910 refint.on_bi.bi_db_close = refint_close;
911 refint.on_response = refint_response;
913 refint.on_bi.bi_cf_ocs = refintocs;
914 rc = config_register_schema ( refintcfg, refintocs );
917 return(overlay_register(&refint));
920 #if SLAPD_OVER_REFINT == SLAPD_MOD_DYNAMIC && defined(PIC)
921 int init_module(int argc, char *argv[]) {
922 return refint_initialize();
926 #endif /* SLAPD_OVER_REFINT */