openldap2/0010-Fix-exposure-of-SSS-VLV-controls-ITS-6647.dif

47 lines
1.4 KiB
Plaintext
Raw Normal View History

From b5ddeac919d767a390d7d9e3c2dac092cc4232e1 Mon Sep 17 00:00:00 2001
From: ralf <ralf>
Date: Fri, 22 Jan 2010 17:01:25 +0000
Subject: Fix exposure of SSS/VLV controls (ITS#6647)
Fixes bnc#648479
Contains the following upstream commits:
- Unregister VLV control as well when last overlay instance
is removed (additional fix for ITS#6647)
diff --git a/servers/slapd/overlays/sssvlv.c b/servers/slapd/overlays/sssvlv.c
index ce3da34..7ffed1b 100644
--- a/servers/slapd/overlays/sssvlv.c
+++ b/servers/slapd/overlays/sssvlv.c
@@ -1295,6 +1295,10 @@ static int sssvlv_db_init(
if ( rc != LDAP_SUCCESS ) {
Debug( LDAP_DEBUG_ANY, "Failed to register VLV Request control '%s' (%d)\n",
LDAP_CONTROL_VLVREQUEST, rc, 0 );
+#ifdef SLAP_CONFIG_DELETE
+ overlay_unregister_control( be, LDAP_CONTROL_SORTREQUEST );
+ unregister_supported_control( LDAP_CONTROL_SORTREQUEST );
+#endif /* SLAP_CONFIG_DELETE */
return rc;
}
}
@@ -1330,6 +1334,15 @@ static int sssvlv_db_destroy(
ldap_pvt_thread_mutex_destroy( &sort_conns_mutex );
}
+#ifdef SLAP_CONFIG_DELETE
+ overlay_unregister_control( be, LDAP_CONTROL_SORTREQUEST );
+ overlay_unregister_control( be, LDAP_CONTROL_VLVREQUEST );
+ if ( ov_count == 0 ) {
+ unregister_supported_control( LDAP_CONTROL_SORTREQUEST );
+ unregister_supported_control( LDAP_CONTROL_VLVREQUEST );
+ }
+#endif /* SLAP_CONFIG_DELETE */
+
if ( si ) {
ch_free( si );
on->on_bi.bi_private = NULL;
--
1.7.3.4