1
0
forked from jengelh/openldap2
openldap2/0010-Fix-exposure-of-SSS-VLV-controls-ITS-6647.dif

47 lines
1.4 KiB
Plaintext
Raw Normal View History

From aa567ba586b3f78ce9199929f2a058c17d0a6e29 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 bb779e6..010a0b9 100644
--- a/servers/slapd/overlays/sssvlv.c
+++ b/servers/slapd/overlays/sssvlv.c
@@ -1292,6 +1292,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;
}
}
@@ -1327,6 +1331,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