]> git.sur5r.net Git - openldap/commitdiff
From ITS#5164 - treat monitoredInfo normalization consistently, don't
authorHoward Chu <hyc@openldap.org>
Wed, 3 Oct 2007 08:59:37 +0000 (08:59 +0000)
committerHoward Chu <hyc@openldap.org>
Wed, 3 Oct 2007 08:59:37 +0000 (08:59 +0000)
crash if SLAPI plugin doesn't register a description

servers/slapd/back-monitor/conn.c
servers/slapd/back-monitor/database.c

index 45ceade0546f23c1dd1a37f1c9841c0e3a5fcade..aeaa61f52986e1e9c2f3ae6b90cfbae532e910c4 100644 (file)
@@ -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 );
index 2223997cb0a29625abcc6c9d6c863ee2bcd7f97d..5bbbbbfbefaf09a21a15ecae834329057dd973a5 100644 (file)
@@ -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: <no description available>", i );
+               }
 
                ber_str2bv( buf, 0, 0, &bv );
                attr_merge_normalize_one( e_database,