From: Howard Chu Date: Wed, 3 Oct 2007 08:59:37 +0000 (+0000) Subject: From ITS#5164 - treat monitoredInfo normalization consistently, don't X-Git-Tag: OPENLDAP_REL_ENG_2_4_9~20^2~562 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=a2a83fe2394e09acd36c989127bcadc753279866;p=openldap From ITS#5164 - treat monitoredInfo normalization consistently, don't crash if SLAPI plugin doesn't register a description --- diff --git a/servers/slapd/back-monitor/conn.c b/servers/slapd/back-monitor/conn.c index 45ceade054..aeaa61f529 100644 --- a/servers/slapd/back-monitor/conn.c +++ b/servers/slapd/back-monitor/conn.c @@ -391,7 +391,7 @@ conn_create( buf2, buf3 ); - attr_merge_one( e, mi->mi_ad_monitoredInfo, &bv, NULL ); + attr_merge_normalize_one( e, mi->mi_ad_monitoredInfo, &bv, NULL ); #endif /* MONITOR_LEGACY_CONN */ bv.bv_len = snprintf( buf, sizeof( buf ), "%lu", c->c_connid ); diff --git a/servers/slapd/back-monitor/database.c b/servers/slapd/back-monitor/database.c index 2223997cb0..5bbbbbfbef 100644 --- a/servers/slapd/back-monitor/database.c +++ b/servers/slapd/back-monitor/database.c @@ -151,7 +151,7 @@ monitor_subsys_database_init_one( } ber_str2bv( bi->bi_type, 0, 0, &bv ); - attr_merge_one( e, mi->mi_ad_monitoredInfo, &bv, NULL ); + attr_merge_normalize_one( e, mi->mi_ad_monitoredInfo, &bv, NULL ); attr_merge_one( e, mi->mi_ad_monitorIsShadow, SLAP_SHADOW( be ) ? (struct berval *)&slap_true_bv : (struct berval *)&slap_false_bv, NULL ); @@ -295,7 +295,7 @@ monitor_subsys_database_init_one( return( -1 ); } ber_str2bv( on->on_bi.bi_type, 0, 0, &bv ); - attr_merge_one( e_overlay, mi->mi_ad_monitoredInfo, &bv, NULL ); + attr_merge_normalize_one( e_overlay, mi->mi_ad_monitoredInfo, &bv, NULL ); bv.bv_len = snprintf( buf, sizeof( buf ), "cn=Overlay %d,%s", j, ms_overlay->mss_dn.bv_val ); @@ -926,17 +926,21 @@ monitor_back_add_plugin( monitor_info_t *mi, Backend *be, Entry *e_database ) if ( rc != LDAP_SUCCESS ) { goto done; } - - snprintf( buf, sizeof(buf), - "plugin %d name: %s; " - "vendor: %s; " - "version: %s; " - "description: %s", - i, - srchdesc->spd_id, - srchdesc->spd_vendor, - srchdesc->spd_version, - srchdesc->spd_description ); + if ( srchdesc ) { + snprintf( buf, sizeof(buf), + "plugin %d name: %s; " + "vendor: %s; " + "version: %s; " + "description: %s", + i, + srchdesc->spd_id, + srchdesc->spd_vendor, + srchdesc->spd_version, + srchdesc->spd_description ); + } else { + snprintf( buf, sizeof(buf), + "plugin %d name: ", i ); + } ber_str2bv( buf, 0, 0, &bv ); attr_merge_normalize_one( e_database,