From 068c73b01fa6b96dd6f181cafb0887bf69b04fb4 Mon Sep 17 00:00:00 2001 From: Pierangelo Masarati Date: Tue, 2 Apr 2002 14:25:01 +0000 Subject: [PATCH] appropriately detect the required conn --- servers/slapd/back-monitor/conn.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/servers/slapd/back-monitor/conn.c b/servers/slapd/back-monitor/conn.c index 96992a20a4..1b08de49ec 100644 --- a/servers/slapd/back-monitor/conn.c +++ b/servers/slapd/back-monitor/conn.c @@ -38,6 +38,8 @@ #include "slap.h" #include "back-monitor.h" +#define CONN_CN_PREFIX "Connection" + int monitor_subsys_conn_init( BackendDB *be @@ -257,9 +259,9 @@ conn_create( assert( ep != NULL ); snprintf( buf, sizeof( buf ), - "dn: cn=Connection %ld,%s\n" + "dn: cn=" CONN_CN_PREFIX " %ld,%s\n" SLAPD_MONITOR_OBJECTCLASSES - "cn: Connection %ld\n", + "cn: " CONN_CN_PREFIX " %ld\n", c->c_connid, monitor_subsys[SLAPD_MONITOR_CONN].mss_dn.bv_val, c->c_connid ); e = str2entry( buf ); @@ -269,14 +271,14 @@ conn_create( LDAP_LOG(( "operation", LDAP_LEVEL_CRIT, "monitor_subsys_conn_create: " "unable to create entry " - "'cn=Connection %ld,%s' entry\n", + "'cn=" CONN_CN_PREFIX " %ld,%s' entry\n", c->c_connid, monitor_subsys[SLAPD_MONITOR_CONN].mss_dn.bv_val )); #else Debug( LDAP_DEBUG_ANY, "monitor_subsys_conn_create: " "unable to create entry " - "'cn=Connection %ld,%s' entry\n", + "'cn=" CONN_CN_PREFIX " %ld,%s' entry\n", c->c_connid, monitor_subsys[SLAPD_MONITOR_CONN].mss_dn.bv_val, 0 ); #endif @@ -405,7 +407,8 @@ monitor_subsys_conn_create( assert( values ); assert( values[ 0 ][ 0 ] ); - connid = atol( values[ 0 ][ 0 ]->la_value.bv_val ); + connid = atol( values[ 0 ][ 0 ]->la_value.bv_val + + sizeof( CONN_CN_PREFIX ) ); ldap_rdnfree( values ); -- 2.39.5