1 /* translucent.c - translucent proxy module */
3 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
5 * Copyright 2004-2007 The OpenLDAP Foundation.
6 * Portions Copyright 2005 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 #ifdef SLAPD_OVER_TRANSLUCENT
28 #include <ac/string.h>
29 #include <ac/socket.h>
37 typedef struct translucent_info {
38 BackendDB db; /* captive backend */
43 static ConfigLDAPadd translucent_ldadd;
44 static ConfigCfAdd translucent_cfadd;
46 static ConfigTable translucentcfg[] = {
47 { "translucent_strict", "on|off", 1, 2, 0,
48 ARG_ON_OFF|ARG_OFFSET,
49 (void *)offsetof(translucent_info, strict),
50 "( OLcfgOvAt:14.1 NAME 'olcTranslucentStrict' "
51 "DESC 'Reveal attribute deletion constraint violations' "
52 "SYNTAX OMsBoolean SINGLE-VALUE )", NULL, NULL },
53 { "translucent_no_glue", "on|off", 1, 2, 0,
54 ARG_ON_OFF|ARG_OFFSET,
55 (void *)offsetof(translucent_info, no_glue),
56 "( OLcfgOvAt:14.2 NAME 'olcTranslucentNoGlue' "
57 "DESC 'Disable automatic glue records for ADD and MODRDN' "
58 "SYNTAX OMsBoolean SINGLE-VALUE )", NULL, NULL },
59 { NULL, NULL, 0, 0, 0, ARG_IGNORED }
62 static ConfigOCs translucentocs[] = {
64 "NAME 'olcTranslucentConfig' "
65 "DESC 'Translucent configuration' "
66 "SUP olcOverlayConfig "
67 "MAY ( olcTranslucentStrict $ olcTranslucentNoGlue ) )",
68 Cft_Overlay, translucentcfg, NULL, translucent_cfadd },
70 "NAME 'olcTranslucentDatabase' "
71 "DESC 'Translucent target database configuration' "
72 "AUXILIARY )", Cft_Misc, translucentcfg, translucent_ldadd },
75 /* for translucent_init() */
78 translucent_ldadd( CfEntryInfo *cei, Entry *e, ConfigArgs *ca )
83 Debug(LDAP_DEBUG_TRACE, "==> translucent_ldadd\n", 0, 0, 0);
85 if ( cei->ce_type != Cft_Overlay || !cei->ce_bi ||
86 cei->ce_bi->bi_cf_ocs != translucentocs )
87 return LDAP_CONSTRAINT_VIOLATION;
89 on = (slap_overinst *)cei->ce_bi;
90 ov = on->on_bi.bi_private;
96 translucent_cfadd( Operation *op, SlapReply *rs, Entry *e, ConfigArgs *ca )
98 CfEntryInfo *cei = e->e_private;
99 slap_overinst *on = (slap_overinst *)cei->ce_bi;
100 translucent_info *ov = on->on_bi.bi_private;
103 Debug(LDAP_DEBUG_TRACE, "==> translucent_cfadd\n", 0, 0, 0);
105 /* FIXME: should not hardcode "olcDatabase" here */
106 bv.bv_len = snprintf( ca->cr_msg, sizeof( ca->cr_msg ),
107 "olcDatabase=%s", ov->db.bd_info->bi_type );
108 if ( bv.bv_len < 0 || bv.bv_len >= sizeof( ca->cr_msg ) ) {
111 bv.bv_val = ca->cr_msg;
114 /* We can only create this entry if the database is table-driven
116 if ( ov->db.bd_info->bi_cf_ocs )
117 config_build_entry( op, rs, cei, ca, &bv,
118 ov->db.bd_info->bi_cf_ocs,
119 &translucentocs[1] );
124 static slap_overinst translucent;
128 ** call syncrepl_add_glue() with the parent suffix;
132 static struct berval glue[] = { BER_BVC("top"), BER_BVC("glue"), BER_BVNULL };
134 void glue_parent(Operation *op) {
136 slap_overinst *on = (slap_overinst *) op->o_bd->bd_info;
137 struct berval ndn = BER_BVNULL;
142 dnParent( &op->o_req_ndn, &pdn );
143 ber_dupbv_x( &ndn, &pdn, op->o_tmpmemctx );
145 Debug(LDAP_DEBUG_TRACE, "=> glue_parent: fabricating glue for <%s>\n", ndn.bv_val, 0, 0);
149 ber_dupbv(&e->e_name, &ndn);
150 ber_dupbv(&e->e_nname, &ndn);
152 a = attr_alloc( slap_schema.si_ad_objectClass );
154 a->a_vals = ch_malloc(sizeof(struct berval) * 3);
155 ber_dupbv(&a->a_vals[0], &glue[0]);
156 ber_dupbv(&a->a_vals[1], &glue[1]);
157 ber_dupbv(&a->a_vals[2], &glue[2]);
158 a->a_nvals = a->a_vals;
159 a->a_next = e->e_attrs;
162 a = attr_alloc( slap_schema.si_ad_structuralObjectClass );
164 a->a_vals = ch_malloc(sizeof(struct berval) * 2);
165 ber_dupbv(&a->a_vals[0], &glue[1]);
166 ber_dupbv(&a->a_vals[1], &glue[2]);
167 a->a_nvals = a->a_vals;
168 a->a_next = e->e_attrs;
175 nop.o_bd->bd_info = (BackendInfo *) on->on_info->oi_orig;
176 syncrepl_add_glue(&nop, e);
177 nop.o_bd->bd_info = (BackendInfo *) on;
179 op->o_tmpfree( ndn.bv_val, op->o_tmpmemctx );
189 BerVarray dup_bervarray(BerVarray b) {
192 for(len = 0; b[len].bv_val; len++);
193 nb = ch_malloc((len+1) * sizeof(BerValue));
194 for(i = 0; i < len; i++) ber_dupbv(&nb[i], &b[i]);
195 nb[len].bv_val = NULL;
202 ** free only the Attribute*, not the contents;
205 void free_attr_chain(Attribute *b) {
207 for(a=b; a; a=a->a_next) {
217 ** if not bound as root, send ACCESS error;
218 ** if glue, glue_parent();
223 static int translucent_add(Operation *op, SlapReply *rs) {
224 slap_overinst *on = (slap_overinst *) op->o_bd->bd_info;
225 translucent_info *ov = on->on_bi.bi_private;
226 Debug(LDAP_DEBUG_TRACE, "==> translucent_add: %s\n",
227 op->o_req_dn.bv_val, 0, 0);
229 op->o_bd->bd_info = (BackendInfo *) on->on_info;
230 send_ldap_error(op, rs, LDAP_INSUFFICIENT_ACCESS,
231 "user modification of overlay database not permitted");
232 op->o_bd->bd_info = (BackendInfo *) on;
235 if(!ov->no_glue) glue_parent(op);
236 return(SLAP_CB_CONTINUE);
240 ** translucent_modrdn()
241 ** if not bound as root, send ACCESS error;
242 ** if !glue, glue_parent();
243 ** else return CONTINUE;
247 static int translucent_modrdn(Operation *op, SlapReply *rs) {
248 slap_overinst *on = (slap_overinst *) op->o_bd->bd_info;
249 translucent_info *ov = on->on_bi.bi_private;
250 Debug(LDAP_DEBUG_TRACE, "==> translucent_modrdn: %s -> %s\n",
251 op->o_req_dn.bv_val, op->orr_newrdn.bv_val, 0);
253 op->o_bd->bd_info = (BackendInfo *) on->on_info;
254 send_ldap_error(op, rs, LDAP_INSUFFICIENT_ACCESS,
255 "user modification of overlay database not permitted");
256 op->o_bd->bd_info = (BackendInfo *) on;
259 if(!ov->no_glue) glue_parent(op);
260 return(SLAP_CB_CONTINUE);
264 ** translucent_delete()
265 ** if not bound as root, send ACCESS error;
266 ** else return CONTINUE;
270 static int translucent_delete(Operation *op, SlapReply *rs) {
271 slap_overinst *on = (slap_overinst *) op->o_bd->bd_info;
272 Debug(LDAP_DEBUG_TRACE, "==> translucent_delete: %s\n",
273 op->o_req_dn.bv_val, 0, 0);
275 op->o_bd->bd_info = (BackendInfo *) on->on_info;
276 send_ldap_error(op, rs, LDAP_INSUFFICIENT_ACCESS,
277 "user modification of overlay database not permitted");
278 op->o_bd->bd_info = (BackendInfo *) on;
281 return(SLAP_CB_CONTINUE);
285 translucent_tag_cb( Operation *op, SlapReply *rs )
287 op->o_tag = LDAP_REQ_MODIFY;
288 op->orm_modlist = op->o_callback->sc_private;
289 rs->sr_tag = slap_req2res( op->o_tag );
291 return SLAP_CB_CONTINUE;
295 ** translucent_modify()
296 ** modify in local backend if exists in both;
297 ** otherwise, add to local backend;
298 ** fail if not defined in captive backend;
302 static int translucent_modify(Operation *op, SlapReply *rs) {
303 SlapReply nrs = { REP_RESULT };
306 slap_overinst *on = (slap_overinst *) op->o_bd->bd_info;
307 translucent_info *ov = on->on_bi.bi_private;
308 Entry *e = NULL, *re = NULL;
310 Modifications *m, **mm;
311 int del, rc, erc = 0;
312 slap_callback cb = { 0 };
314 Debug(LDAP_DEBUG_TRACE, "==> translucent_modify: %s\n",
315 op->o_req_dn.bv_val, 0, 0);
318 ** fetch entry from the captive backend;
319 ** if it did not exist, fail;
320 ** release it, if captive backend supports this;
325 rc = ov->db.bd_info->bi_entry_get_rw(&nop, &nop.o_req_ndn, NULL, NULL, 0, &re);
326 if(rc != LDAP_SUCCESS || re == NULL ) {
327 send_ldap_error((&nop), rs, LDAP_NO_SUCH_OBJECT,
328 "attempt to modify nonexistent local record");
333 ** fetch entry from local backend;
335 ** foreach Modification:
336 ** if attr not present in local:
337 ** if Mod == LDAP_MOD_DELETE:
338 ** if remote attr not present, return NO_SUCH;
339 ** if remote attr present, drop this Mod;
340 ** else force this Mod to LDAP_MOD_ADD;
345 op->o_bd->bd_info = (BackendInfo *) on->on_info;
346 rc = be_entry_get_rw(op, &op->o_req_ndn, NULL, NULL, 0, &e);
347 op->o_bd->bd_info = (BackendInfo *) on;
349 if(e && rc == LDAP_SUCCESS) {
350 Debug(LDAP_DEBUG_TRACE, "=> translucent_modify: found local entry\n", 0, 0, 0);
351 for(mm = &op->orm_modlist; *mm; ) {
353 for(a = e->e_attrs; a; a = a->a_next)
354 if(a->a_desc == m->sml_desc) break;
357 continue; /* found local attr */
359 if(m->sml_op == LDAP_MOD_DELETE) {
360 for(a = re->e_attrs; a; a = a->a_next)
361 if(a->a_desc == m->sml_desc) break;
362 /* not found remote attr */
364 erc = LDAP_NO_SUCH_ATTRIBUTE;
368 erc = LDAP_CONSTRAINT_VIOLATION;
371 Debug(LDAP_DEBUG_TRACE,
372 "=> translucent_modify: silently dropping delete: %s\n",
373 m->sml_desc->ad_cname.bv_val, 0, 0);
376 slap_mods_free(m, 1);
379 m->sml_op = LDAP_MOD_ADD;
382 erc = SLAP_CB_CONTINUE;
385 if(ov->db.bd_info->bi_entry_release_rw)
386 ov->db.bd_info->bi_entry_release_rw(&nop, re, 0);
390 op->o_bd->bd_info = (BackendInfo *) on->on_info;
391 be_entry_release_r(op, e);
392 op->o_bd->bd_info = (BackendInfo *) on;
393 if(erc == SLAP_CB_CONTINUE) {
396 send_ldap_error(op, rs, erc,
397 "attempt to delete nonexistent attribute");
402 /* don't leak remote entry copy */
404 if(ov->db.bd_info->bi_entry_release_rw)
405 ov->db.bd_info->bi_entry_release_rw(&nop, re, 0);
410 ** foreach Modification:
411 ** if MOD_ADD or MOD_REPLACE, add Attribute;
412 ** if no Modifications were suitable:
413 ** if strict, throw CONSTRAINT_VIOLATION;
414 ** else, return early SUCCESS;
415 ** fabricate Entry with new Attribute chain;
416 ** glue_parent() for this Entry;
417 ** call bi_op_add() in local backend;
421 Debug(LDAP_DEBUG_TRACE, "=> translucent_modify: fabricating local add\n", 0, 0, 0);
423 for(del = 0, ax = NULL, m = op->orm_modlist; m; m = m->sml_next) {
425 if(((m->sml_op & LDAP_MOD_OP) != LDAP_MOD_ADD) &&
426 ((m->sml_op & LDAP_MOD_OP) != LDAP_MOD_REPLACE)) {
427 Debug(LDAP_DEBUG_ANY,
428 "=> translucent_modify: silently dropped modification(%d): %s\n",
429 m->sml_op, m->sml_desc->ad_cname.bv_val, 0);
430 if((m->sml_op & LDAP_MOD_OP) == LDAP_MOD_DELETE) del++;
433 atmp.a_desc = m->sml_desc;
434 atmp.a_vals = m->sml_values;
435 atmp.a_nvals = m->sml_nvalues ? m->sml_nvalues : atmp.a_vals;
436 atmp.a_numvals = m->sml_numvals;
438 a = attr_dup( &atmp );
443 if(del && ov->strict) {
445 send_ldap_error(op, rs, LDAP_CONSTRAINT_VIOLATION,
446 "attempt to delete attributes from local database");
452 send_ldap_error(op, rs, LDAP_CONSTRAINT_VIOLATION,
453 "modification contained other than ADD or REPLACE");
456 /* rs->sr_text = "no valid modification found"; */
457 rs->sr_err = LDAP_SUCCESS;
458 send_ldap_result(op, rs);
463 ber_dupbv( &e->e_name, &op->o_req_dn );
464 ber_dupbv( &e->e_nname, &op->o_req_ndn );
467 nop.o_tag = LDAP_REQ_ADD;
472 cb.sc_response = translucent_tag_cb;
473 cb.sc_private = op->orm_modlist;
474 cb.sc_next = nop.o_callback;
475 nop.o_callback = &cb;
476 rc = on->on_info->oi_orig->bi_op_add(&nop, &nrs);
477 if ( nop.ora_e == e )
483 static int translucent_compare(Operation *op, SlapReply *rs) {
485 slap_overinst *on = (slap_overinst *) op->o_bd->bd_info;
486 translucent_info *ov = on->on_bi.bi_private;
487 AttributeAssertion *ava = op->orc_ava;
491 Debug(LDAP_DEBUG_TRACE, "==> translucent_compare: <%s> %s:%s\n",
492 op->o_req_dn.bv_val, ava->aa_desc->ad_cname.bv_val, ava->aa_value.bv_val);
495 ** if the local backend has an entry for this attribute:
496 ** CONTINUE and let it do the compare;
499 op->o_bd->bd_info = (BackendInfo *) on->on_info;
500 rc = be_entry_get_rw(op, &op->o_req_ndn, NULL, ava->aa_desc, 0, &e);
501 if(e && rc == LDAP_SUCCESS) {
502 be_entry_release_r(op, e);
503 op->o_bd->bd_info = (BackendInfo *) on;
504 return(SLAP_CB_CONTINUE);
506 op->o_bd->bd_info = (BackendInfo *) on;
509 ** call compare() in the captive backend;
510 ** return the result;
514 nop.o_callback = NULL;
515 rc = ov->db.bd_info->bi_op_compare(&nop, rs);
521 ** translucent_search_cb()
522 ** merge local data with the search result
526 static int translucent_search_cb(Operation *op, SlapReply *rs) {
528 Entry *e, *re = NULL;
529 Attribute *a, *ax, *an, *as = NULL;
530 Operation * original_op, local_op;
533 if(!op || !rs || rs->sr_type != REP_SEARCH || !rs->sr_entry)
534 return(SLAP_CB_CONTINUE);
536 Debug(LDAP_DEBUG_TRACE, "==> translucent_search_cb: %s\n",
537 rs->sr_entry->e_name.bv_val, 0, 0);
539 original_op = op->o_callback->sc_private;
540 on = (slap_overinst *) original_op->o_bd->bd_info;
541 local_op = *original_op;
543 local_op.o_bd->bd_info = (BackendInfo *) on->on_info->oi_orig;
544 rc = be_entry_get_rw(&local_op, &rs->sr_entry->e_nname, NULL, NULL, 0, &e);
545 local_op.o_bd->bd_info = (BackendInfo *) on;
548 ** if we got an entry from local backend:
549 ** make a copy of this search result;
550 ** foreach local attr:
551 ** foreach search result attr:
552 ** if match, result attr with local attr;
553 ** if new local, add to list;
554 ** append new local attrs to search result;
558 if(e && rc == LDAP_SUCCESS) {
559 re = entry_dup(rs->sr_entry);
560 for(ax = e->e_attrs; ax; ax = ax->a_next) {
562 if(is_at_operational(ax->a_desc->ad_type)) continue;
564 for(a = re->e_attrs; a; a = a->a_next) {
565 if(a->a_desc == ax->a_desc) {
566 if(a->a_vals != a->a_nvals)
567 ber_bvarray_free(a->a_nvals);
568 ber_bvarray_free(a->a_vals);
569 a->a_vals = dup_bervarray(ax->a_vals);
570 a->a_nvals = (ax->a_vals == ax->a_nvals) ?
571 a->a_vals : dup_bervarray(ax->a_nvals);
580 local_op.o_bd->bd_info = (BackendInfo *) on->on_info->oi_orig;
581 be_entry_release_r(&local_op, e);
582 local_op.o_bd->bd_info = (BackendInfo *) on;
584 /* literally append, so locals are always last */
587 for(ax = re->e_attrs; ax->a_next; ax = ax->a_next);
594 rs->sr_flags |= REP_ENTRY_MUSTBEFREED;
597 return(SLAP_CB_CONTINUE);
601 ** translucent_search()
602 ** search via captive backend;
603 ** override results with any local data;
607 static int translucent_search(Operation *op, SlapReply *rs) {
608 slap_overinst *on = (slap_overinst *) op->o_bd->bd_info;
610 translucent_info *ov = on->on_bi.bi_private;
611 slap_callback cb = { NULL, NULL, NULL, NULL };
613 Debug(LDAP_DEBUG_TRACE, "==> translucent_search: <%s> %s\n",
614 op->o_req_dn.bv_val, op->ors_filterstr.bv_val, 0);
616 cb.sc_response = (slap_response *) translucent_search_cb;
618 cb.sc_next = nop.o_callback;
620 nop.o_callback = &cb;
622 return (ov->db.bd_info->bi_op_search(&nop, rs));
627 ** translucent_bind()
628 ** pass bind request to captive backend;
632 static int translucent_bind(Operation *op, SlapReply *rs) {
633 slap_overinst *on = (slap_overinst *) op->o_bd->bd_info;
635 translucent_info *ov = on->on_bi.bi_private;
637 Debug(LDAP_DEBUG_TRACE, "translucent_bind: <%s> method %d\n",
638 op->o_req_dn.bv_val, op->orb_method, 0);
641 return (ov->db.bd_info->bi_op_bind(&nop, rs));
645 ** translucent_connection_destroy()
646 ** pass disconnect notification to captive backend;
650 static int translucent_connection_destroy(BackendDB *be, Connection *conn) {
651 slap_overinst *on = (slap_overinst *) be->bd_info;
652 translucent_info *ov = on->on_bi.bi_private;
655 Debug(LDAP_DEBUG_TRACE, "translucent_connection_destroy\n", 0, 0, 0);
657 rc = ov->db.bd_info->bi_connection_destroy(&ov->db, conn);
663 ** translucent_db_config()
664 ** pass config directives to captive backend;
665 ** parse unrecognized directives ourselves;
669 static int translucent_db_config(
677 slap_overinst *on = (slap_overinst *) be->bd_info;
678 translucent_info *ov = on->on_bi.bi_private;
680 Debug(LDAP_DEBUG_TRACE, "==> translucent_db_config: %s\n",
681 argc ? argv[0] : "", 0, 0);
683 /* Something for the captive database? */
684 if ( ov->db.bd_info && ov->db.bd_info->bi_db_config )
685 return ov->db.bd_info->bi_db_config( &ov->db, fname, lineno,
687 return SLAP_CONF_UNKNOWN;
691 ** translucent_db_init()
692 ** initialize the captive backend;
696 static int translucent_db_init(BackendDB *be, ConfigReply *cr) {
697 slap_overinst *on = (slap_overinst *) be->bd_info;
698 translucent_info *ov;
700 Debug(LDAP_DEBUG_TRACE, "==> translucent_db_init\n", 0, 0, 0);
702 ov = ch_calloc(1, sizeof(translucent_info));
703 on->on_bi.bi_private = ov;
705 ov->db.be_private = NULL;
706 ov->db.be_pcl_mutexp = &ov->db.be_pcl_mutex;
708 if ( !backend_db_init( "ldap", &ov->db, -1, NULL )) {
709 Debug( LDAP_DEBUG_CONFIG, "translucent: unable to open captive back-ldap\n", 0, 0, 0);
712 SLAP_DBFLAGS(be) |= SLAP_DBFLAG_NO_SCHEMA_CHECK;
713 SLAP_DBFLAGS(be) |= SLAP_DBFLAG_NOLASTMOD;
719 ** translucent_db_open()
720 ** if the captive backend has an open() method, call it;
724 static int translucent_db_open(BackendDB *be, ConfigReply *cr) {
725 slap_overinst *on = (slap_overinst *) be->bd_info;
726 translucent_info *ov = on->on_bi.bi_private;
729 Debug(LDAP_DEBUG_TRACE, "==> translucent_db_open\n", 0, 0, 0);
731 /* need to inherit something from the original database... */
732 ov->db.be_def_limit = be->be_def_limit;
733 ov->db.be_limits = be->be_limits;
734 ov->db.be_acl = be->be_acl;
735 ov->db.be_dfltaccess = be->be_dfltaccess;
737 rc = backend_startup_one( &ov->db, NULL );
739 if(rc) Debug(LDAP_DEBUG_TRACE,
740 "translucent: bi_db_open() returned error %d\n", rc, 0, 0);
746 ** translucent_db_close()
747 ** if the captive backend has a close() method, call it;
748 ** free any config data;
753 translucent_db_close( BackendDB *be, ConfigReply *cr )
755 slap_overinst *on = (slap_overinst *) be->bd_info;
756 translucent_info *ov = on->on_bi.bi_private;
759 Debug(LDAP_DEBUG_TRACE, "==> translucent_db_close\n", 0, 0, 0);
761 if ( ov && ov->db.bd_info && ov->db.bd_info->bi_db_close ) {
762 rc = ov->db.bd_info->bi_db_close(&ov->db, NULL);
769 ** translucent_db_destroy()
770 ** if the captive backend has a db_destroy() method, call it
775 translucent_db_destroy( BackendDB *be, ConfigReply *cr )
777 slap_overinst *on = (slap_overinst *) be->bd_info;
778 translucent_info *ov = on->on_bi.bi_private;
781 Debug(LDAP_DEBUG_TRACE, "==> translucent_db_destroy\n", 0, 0, 0);
784 if ( ov->db.be_private != NULL ) {
785 backend_stopdown_one( &ov->db );
789 on->on_bi.bi_private = NULL;
796 ** translucent_initialize()
797 ** initialize the slap_overinst with our entry points;
801 int translucent_initialize() {
805 Debug(LDAP_DEBUG_TRACE, "==> translucent_initialize\n", 0, 0, 0);
807 translucent.on_bi.bi_type = "translucent";
808 translucent.on_bi.bi_db_init = translucent_db_init;
809 translucent.on_bi.bi_db_config = translucent_db_config;
810 translucent.on_bi.bi_db_open = translucent_db_open;
811 translucent.on_bi.bi_db_close = translucent_db_close;
812 translucent.on_bi.bi_db_destroy = translucent_db_destroy;
813 translucent.on_bi.bi_op_bind = translucent_bind;
814 translucent.on_bi.bi_op_add = translucent_add;
815 translucent.on_bi.bi_op_modify = translucent_modify;
816 translucent.on_bi.bi_op_modrdn = translucent_modrdn;
817 translucent.on_bi.bi_op_delete = translucent_delete;
818 translucent.on_bi.bi_op_search = translucent_search;
819 translucent.on_bi.bi_op_compare = translucent_compare;
820 translucent.on_bi.bi_connection_destroy = translucent_connection_destroy;
822 translucent.on_bi.bi_cf_ocs = translucentocs;
823 rc = config_register_schema ( translucentcfg, translucentocs );
826 return(overlay_register(&translucent));
829 #if SLAPD_OVER_TRANSLUCENT == SLAPD_MOD_DYNAMIC && defined(PIC)
830 int init_module(int argc, char *argv[]) {
831 return translucent_initialize();
835 #endif /* SLAPD_OVER_TRANSLUCENT */