pcache.c \
ppolicy.c \
refint.c \
+ retcode.c \
rwm.c rwmconf.c rwmdn.c rwmmap.c \
syncprov.c \
translucent.c \
refint.la : refint.lo
$(LTLINK_MOD) -module -o $@ refint.lo version.lo $(LINK_LIBS)
+retcode.la : retcode.lo
+ $(LTLINK_MOD) -module -o $@ retcode.lo version.lo $(LINK_LIBS)
+
rwm_x.o: rwm.o rwmconf.o rwmdn.o rwmmap.o
$(LD) -r -o $@ rwm.o rwmconf.o rwmdn.o rwmmap.o
#if SLAPD_OVER_REFINT == SLAPD_MOD_STATIC
extern int refint_init();
#endif
+#if SLAPD_OVER_RETCODE == SLAPD_MOD_STATIC
+extern int retcode_init();
+#endif
#if SLAPD_OVER_RWM == SLAPD_MOD_STATIC
extern int rwm_init();
#endif
#if SLAPD_OVER_REFINT == SLAPD_MOD_STATIC
{ "Referential Integrity", refint_init },
#endif
+#if SLAPD_OVER_RETCODE == SLAPD_MOD_STATIC
+ { "Return Code", retcode_init },
+#endif
#if SLAPD_OVER_RWM == SLAPD_MOD_STATIC
{ "Rewrite/Remap", rwm_init },
#endif
return SLAP_CB_CONTINUE;
}
+#ifdef ENABLE_REWRITE
+static int
+rwm_conn_init( BackendDB *be, Connection *conn )
+{
+ slap_overinst *on = (slap_overinst *) be->bd_info;
+ struct ldaprwmap *rwmap =
+ (struct ldaprwmap *)on->on_bi.bi_private;
+
+ ( void )rewrite_session_init( rwmap->rwm_rw, conn );
+
+ return SLAP_CB_CONTINUE;
+}
+
+static int
+rwm_conn_destroy( BackendDB *be, Connection *conn )
+{
+ slap_overinst *on = (slap_overinst *) be->bd_info;
+ struct ldaprwmap *rwmap =
+ (struct ldaprwmap *)on->on_bi.bi_private;
+
+ ( void )rewrite_session_delete( rwmap->rwm_rw, conn );
+
+ return SLAP_CB_CONTINUE;
+}
+#endif /* ENABLE_REWRITE */
+
static int
rwm_op_bind( Operation *op, SlapReply *rs )
{
int rc;
#ifdef ENABLE_REWRITE
- ( void )rewrite_session_delete( rwmap->rwm_rw, op->o_conn );
- ( void )rewrite_session_init( rwmap->rwm_rw, op->o_conn );
-
rc = rwm_op_dn_massage( op, rs, "bindDN" );
#else /* ! ENABLE_REWRITE */
rc = 1;
rwm.on_bi.bi_operational = rwm_operational;
rwm.on_bi.bi_chk_referrals = 0 /* rwm_chk_referrals */ ;
+#ifdef ENABLE_REWRITE
+ rwm.on_bi.bi_connection_init = rwm_conn_init;
+ rwm.on_bi.bi_connection_destroy = rwm_conn_destroy;
+#endif /* ENABLE_REWRITE */
+
rwm.on_response = rwm_response;
return overlay_register( &rwm );