]> git.sur5r.net Git - openldap/commitdiff
New call to unregister controls registered form overlays
authorRalf Haferkamp <ralf@openldap.org>
Thu, 1 Jul 2010 11:28:47 +0000 (11:28 +0000)
committerQuanah Gibson-Mount <quanah@openldap.org>
Mon, 7 Nov 2011 20:00:45 +0000 (12:00 -0800)
servers/slapd/backover.c
servers/slapd/proto-slap.h

index 36950a584bb5fea9faf4704dfc9a5be518c24d6c..f332b335f206088f85ca6b024284e65fe08012a3 100644 (file)
@@ -1090,6 +1090,36 @@ overlay_register_control( BackendDB *be, const char *oid )
        return 0;
 }
 
+#ifdef SLAP_CONFIG_DELETE
+void
+overlay_unregister_control( BackendDB *be, const char *oid )
+{
+       int             gotit = 0;
+       int             cid;
+
+       if ( slap_find_control_id( oid, &cid ) == LDAP_CONTROL_NOT_FOUND ) {
+               return;
+       }
+
+       if ( SLAP_ISGLOBALOVERLAY( be ) ) {
+               BackendDB *bd;
+
+               /* remove from all backends... */
+               LDAP_STAILQ_FOREACH( bd, &backendDB, be_next ) {
+                       if ( bd == be->bd_self ) {
+                               gotit = 1;
+                       }
+
+                       bd->be_ctrls[ cid ] = 0;
+               }
+       }
+
+       if ( !gotit ) {
+               be->bd_self->be_ctrls[ cid ] = 0;
+       }
+}
+#endif /* SLAP_CONFIG_DELETE */
+
 void
 overlay_destroy_one( BackendDB *be, slap_overinst *on )
 {
index 05b979a9d52a2bd20694fc9498604b3221768203..8acf6f8f676efab2a972ffa8b4ec237d051626b5 100644 (file)
@@ -484,6 +484,9 @@ LDAP_SLAPD_F (void) overlay_move LDAP_P((
 #ifdef SLAP_CONFIG_DELETE
 LDAP_SLAPD_F (void) overlay_remove LDAP_P((
        BackendDB *be, slap_overinst *on ));
+LDAP_SLAPD_F (void) overlay_unregister_control LDAP_P((
+       BackendDB *be,
+       const char *oid ));
 #endif /* SLAP_CONFIG_DELETE */
 LDAP_SLAPD_F (int) overlay_callback_after_backover LDAP_P((
        Operation *op, slap_callback *sc, int append ));