X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;ds=inline;f=servers%2Fslapd%2Fback-monitor%2Fconn.c;h=ae877020b70893cc627f6a68177bee27697af5c1;hb=0f966d2fdb392865cf615324519526c6ee1e4485;hp=9ea0a66be81aa52f6974443054cb8ad15f6cbeba;hpb=090ef02589a805fcc5834b8701aead7ea2b1e93a;p=openldap diff --git a/servers/slapd/back-monitor/conn.c b/servers/slapd/back-monitor/conn.c index 9ea0a66be8..ae877020b7 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 @@ -157,6 +159,11 @@ monitor_subsys_conn_init( return( -1 ); } + bv[1].bv_val = NULL; + bv[0].bv_val = "0"; + bv[0].bv_len = 1; + attr_merge( e, monitor_ad_desc, bv ); + mp = ( struct monitorentrypriv * )ch_calloc( sizeof( struct monitorentrypriv ), 1 ); e->e_private = ( void * )mp; mp->mp_next = e_tmp; @@ -257,9 +264,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 +276,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 +412,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 ); @@ -417,6 +425,8 @@ monitor_subsys_conn_create( connection_done(c); return( -1 ); } + + break; } }