/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
- * Copyright 2003-2011 The OpenLDAP Foundation.
+ * Copyright 2003-2013 The OpenLDAP Foundation.
* Portions Copyright 2003 Howard Chu.
* All rights reserved.
*
{ "( OLcfgOvOc:3.2 "
"NAME 'olcChainDatabase' "
"DESC 'Chain remote server configuration' "
- "SUP olcLDAPConfig )",
+ "AUXILIARY )",
Cft_Misc, olcDatabaseDummy, chain_ldadd
#ifdef SLAP_CONFIG_DELETE
, NULL, chain_lddel
ldap_chain_t *lc = (ldap_chain_t *)on->on_bi.bi_private;
ldapinfo_t *li = (ldapinfo_t *) ce->ce_be->be_private;
- if (! avl_delete( &lc->lc_lai.lai_tree, li, ldap_chain_uri_cmp ) ) {
- Debug( LDAP_DEBUG_ANY, "slapd-chain: avl_delete failed. "
- "\"%s\" not found.\n", li->li_uri, 0, 0 );
+ if ( li != lc->lc_common_li ) {
+ if (! avl_delete( &lc->lc_lai.lai_tree, li, ldap_chain_uri_cmp ) ) {
+ Debug( LDAP_DEBUG_ANY, "slapd-chain: avl_delete failed. "
+ "\"%s\" not found.\n", li->li_uri, 0, 0 );
+ return -1;
+ }
+ } else if ( lc->lc_lai.lai_tree ) {
+ Debug( LDAP_DEBUG_ANY, "slapd-chain: cannot delete first underlying "
+ "LDAP database when other databases are still present.\n", 0, 0, 0 );
return -1;
+ } else {
+ lc->lc_common_li = NULL;
}
ce->ce_be->bd_info = lback;
BackendDB *be,
ConfigReply *cr )
{
+#ifdef LDAP_CONTROL_X_CHAINING_BEHAVIOR
+#ifdef SLAP_CONFIG_DELETE
+ overlay_unregister_control( be, LDAP_CONTROL_X_CHAINING_BEHAVIOR );
+#endif /* SLAP_CONFIG_DELETE */
+#endif /* LDAP_CONTROL_X_CHAINING_BEHAVIOR */
return ldap_chain_db_func( be, db_close );
}
if ( li->li_uri == NULL ) {
ber_str2bv( "cn=Common Connections", 0, 1,
- &li->li_monitor_info.lmi_rdn );
+ &li->li_monitor_info.lmi_conn_rdn );
+ ber_str2bv( "cn=Operations on Common Connections", 0, 1,
+ &li->li_monitor_info.lmi_conn_rdn );
} else {
char *ptr;
- li->li_monitor_info.lmi_rdn.bv_len
+ li->li_monitor_info.lmi_conn_rdn.bv_len
= STRLENOF( "cn=" ) + strlen( li->li_uri );
- ptr = li->li_monitor_info.lmi_rdn.bv_val
- = ch_malloc( li->li_monitor_info.lmi_rdn.bv_len + 1 );
+ ptr = li->li_monitor_info.lmi_conn_rdn.bv_val
+ = ch_malloc( li->li_monitor_info.lmi_conn_rdn.bv_len + 1 );
ptr = lutil_strcopy( ptr, "cn=" );
ptr = lutil_strcopy( ptr, li->li_uri );
ptr[ 0 ] = '\0';
+
+ li->li_monitor_info.lmi_ops_rdn.bv_len
+ = STRLENOF( "cn=Operations on " ) + strlen( li->li_uri );
+ ptr = li->li_monitor_info.lmi_ops_rdn.bv_val
+ = ch_malloc( li->li_monitor_info.lmi_ops_rdn.bv_len + 1 );
+ ptr = lutil_strcopy( ptr, "cn=Operations on " );
+ ptr = lutil_strcopy( ptr, li->li_uri );
+ ptr[ 0 ] = '\0';
}
}