From: Pierangelo Masarati Date: Tue, 16 Mar 2004 01:22:34 +0000 (+0000) Subject: handle overlays X-Git-Tag: OPENLDAP_REL_ENG_2_2_BP~287 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=27f28d527084c724883b1e03f6fd87d91b942b3c;p=openldap handle overlays --- diff --git a/servers/slapd/back-monitor/back-monitor.h b/servers/slapd/back-monitor/back-monitor.h index 5659bc5a53..7d31c25ee2 100644 --- a/servers/slapd/back-monitor/back-monitor.h +++ b/servers/slapd/back-monitor/back-monitor.h @@ -94,6 +94,7 @@ struct monitorinfo { AttributeDescription *mi_ad_monitorConnectionLocalAddress; AttributeDescription *mi_ad_monitorConnectionPeerAddress; AttributeDescription *mi_ad_monitorTimestamp; + AttributeDescription *mi_ad_monitorOverlay; /* * Generic description attribute diff --git a/servers/slapd/back-monitor/database.c b/servers/slapd/back-monitor/database.c index 64ccde172e..4988d7e3f3 100644 --- a/servers/slapd/back-monitor/database.c +++ b/servers/slapd/back-monitor/database.c @@ -66,11 +66,18 @@ monitor_subsys_database_init( e_tmp = NULL; for ( i = nBackendDB; i--; ) { - char buf[ BACKMONITOR_BUFSIZE ]; - int j; + char buf[ BACKMONITOR_BUFSIZE ]; + int j; + slap_overinfo *oi = NULL; be = &backendDB[i]; + if ( strcmp( be->bd_info->bi_type, "over" ) == 0 ) { + oi = (slap_overinfo *)be->bd_info; + + be = &oi->oi_bd; + } + /* Subordinates are not exposed as their own naming context */ if ( SLAP_GLUE_SUBORDINATE( be ) ) { continue; @@ -125,6 +132,19 @@ monitor_subsys_database_init( be->be_suffix, be->be_nsuffix ); } + if ( oi != NULL ) { + slap_overinst *on = oi->oi_list; + + for ( ; on; on = on->on_next ) { + struct berval bv; + + bv.bv_val = on->on_bi.bi_type; + bv.bv_len = strlen( bv.bv_val ); + attr_merge_normalize_one( e, mi->mi_ad_monitorOverlay, + &bv, NULL ); + } + } + for ( j = nBackendInfo; j--; ) { if ( backendInfo[ j ].bi_type == be->bd_info->bi_type ) { struct berval bv; diff --git a/servers/slapd/back-monitor/init.c b/servers/slapd/back-monitor/init.c index 54292418f0..15c7b395a8 100644 --- a/servers/slapd/back-monitor/init.c +++ b/servers/slapd/back-monitor/init.c @@ -323,6 +323,7 @@ monitor_back_db_open( "$ seeAlso " "$ monitoredInfo " "$ managedInfo " + "$ monitorOverlay " ") )", SLAP_OC_OPERATIONAL|SLAP_OC_HIDE, offsetof(struct monitorinfo, mi_oc_monitor) }, { "monitorServer", "( 1.3.6.1.4.1.4203.666.3.7 " @@ -440,6 +441,13 @@ monitor_back_db_open( "NO-USER-MODIFICATION " "USAGE directoryOperation )", SLAP_AT_FINAL|SLAP_AT_HIDE, offsetof(struct monitorinfo, mi_ad_monitorTimestamp) }, + { "monitorOverlay", "( 1.3.6.1.4.1.4203.666.1.27 " + "NAME 'monitorOverlay' " + "DESC 'name of overlays defined for a give database' " + "SUP monitoredInfo " + "NO-USER-MODIFICATION " + "USAGE directoryOperation )", SLAP_AT_HIDE, + offsetof(struct monitorinfo, mi_ad_monitorOverlay) }, #ifdef INTEGRATE_CORE_SCHEMA { NULL, NULL, 0, -1 }, /* description */ { NULL, NULL, 0, -1 }, /* seeAlso */