From: Ralf Haferkamp Date: Fri, 9 Nov 2012 14:42:48 +0000 (+0100) Subject: ITS#7436 slapo-deref: call overlay_register_control in db_open X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=f86e0cd8dcff8aa7725bafe92c9fa2cd4590c368;p=openldap ITS#7436 slapo-deref: call overlay_register_control in db_open --- diff --git a/servers/slapd/overlays/deref.c b/servers/slapd/overlays/deref.c index 2f4f564d23..ddc45748bc 100644 --- a/servers/slapd/overlays/deref.c +++ b/servers/slapd/overlays/deref.c @@ -516,6 +516,21 @@ deref_op_search( Operation *op, SlapReply *rs ) return SLAP_CB_CONTINUE; } +static int +deref_db_open( BackendDB *be, ConfigReply *cr) +{ + return overlay_register_control( be, LDAP_CONTROL_X_DEREF ); +} + +#ifdef SLAP_CONFIG_DELETE +static int +deref_db_close( BackendDB *be, ConfigReply *cr) +{ + overlay_unregister_control( be, LDAP_CONTROL_X_DEREF ); + return 0; +} +#endif /* SLAP_CONFIG_DELETE */ + int deref_initialize(void) { @@ -532,6 +547,10 @@ deref_initialize(void) } deref.on_bi.bi_type = "deref"; + deref.on_bi.bi_db_open = deref_db_open; +#ifdef SLAP_CONFIG_DELETE + deref.on_bi.bi_db_close = deref_db_close; +#endif /* SLAP_CONFIG_DELETE */ deref.on_bi.bi_op_search = deref_op_search; return overlay_register( &deref );