#include "slap.h"
#include "back-monitor.h"
+#define CONN_CN_PREFIX "Connection"
+
int
monitor_subsys_conn_init(
BackendDB *be
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;
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 );
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
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 );
connection_done(c);
return( -1 );
}
+
+ break;
}
}