* selection.
*/
struct monitorcache {
- char *mc_ndn;
+ struct berval *mc_ndn;
Entry *mc_e;
};
struct monitorsubsys {
int mss_type;
char *mss_name;
- char *mss_rdn;
- char *mss_dn;
- char *mss_ndn;
+ struct berval *mss_rdn;
+ struct berval *mss_dn;
+ struct berval *mss_ndn;
int mss_flags;
#define MONITOR_HAS_VOLATILE_CH( mp ) \
/* update existing dynamic entry and subentries */
int ( *mss_update )( struct monitorinfo *, Entry * );
/* create new dynamic subentries */
- int ( *mss_create )( struct monitorinfo *, const char *ndn,
- Entry *, Entry ** );
+ int ( *mss_create )( struct monitorinfo *,
+ struct berval *ndn, Entry *, Entry ** );
/* modify entry and subentries */
int ( *mss_modify )( struct monitorinfo *, Entry *,
Modifications *modlist );
extern int monitor_cache_cmp LDAP_P(( const void *c1, const void *c2 ));
extern int monitor_cache_dup LDAP_P(( void *c1, void *c2 ));
extern int monitor_cache_add LDAP_P(( struct monitorinfo *mi, Entry *e ));
-extern int monitor_cache_get LDAP_P(( struct monitorinfo *mi, const char *ndn, Entry **ep ));
-extern int monitor_cache_dn2entry LDAP_P(( struct monitorinfo *mi, const char *ndn, Entry **ep, Entry **matched ));
+extern int monitor_cache_get LDAP_P(( struct monitorinfo *mi, struct berval *ndn, Entry **ep ));
+extern int monitor_cache_dn2entry LDAP_P(( struct monitorinfo *mi, struct berval *ndn, Entry **ep, Entry **matched ));
extern int monitor_cache_lock LDAP_P(( Entry *e ));
extern int monitor_cache_release LDAP_P(( struct monitorinfo *mi, Entry *e ));
*/
extern int monitor_entry_update LDAP_P(( struct monitorinfo *mi, Entry *e ));
-extern int monitor_entry_create LDAP_P(( struct monitorinfo *mi, const char *ndn, Entry *e_parent, Entry **ep ));
+extern int monitor_entry_create LDAP_P(( struct monitorinfo *mi, struct berval *ndn, Entry *e_parent, Entry **ep ));
extern int monitor_entry_modify LDAP_P(( struct monitorinfo *mi, Entry *e, Modifications *modlist ));
LDAP_END_DECL
LDAP_LOG(( "operation", LDAP_LEVEL_CRIT,
"monitor_subsys_backend_init: "
"unable to get entry '%s'\n",
- monitor_subsys[SLAPD_MONITOR_BACKEND].mss_ndn ));
+ monitor_subsys[SLAPD_MONITOR_BACKEND].mss_ndn->bv_val ));
#else
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_backend_init: "
"unable to get entry '%s'\n%s%s",
- monitor_subsys[SLAPD_MONITOR_BACKEND].mss_ndn,
+ monitor_subsys[SLAPD_MONITOR_BACKEND].mss_ndn->bv_val,
"", "" );
#endif
return( -1 );
#endif /* !SLAPD_MONITORSUBENTRY */
"cn: %d\n",
i,
- monitor_subsys[SLAPD_MONITOR_BACKEND].mss_dn,
+ monitor_subsys[SLAPD_MONITOR_BACKEND].mss_dn->bv_val,
i );
e = str2entry( buf );
"monitor_subsys_backend_init: "
"unable to create entry 'cn=%d,%s'\n",
i,
- monitor_subsys[SLAPD_MONITOR_BACKEND].mss_ndn ));
+ monitor_subsys[SLAPD_MONITOR_BACKEND].mss_ndn->bv_val ));
#else
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_backend_init: "
"unable to create entry 'cn=%d,%s'\n%s",
i,
- monitor_subsys[SLAPD_MONITOR_BACKEND].mss_ndn,
+ monitor_subsys[SLAPD_MONITOR_BACKEND].mss_ndn->bv_val,
"" );
#endif
return( -1 );
"monitor_subsys_backend_init: "
"unable to add entry 'cn=%d,%s'\n",
i,
- monitor_subsys[SLAPD_MONITOR_BACKEND].mss_ndn ));
+ monitor_subsys[SLAPD_MONITOR_BACKEND].mss_ndn->bv_val ));
#else
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_backend_init: "
"unable to add entry 'cn=%d,%s'\n%s",
i,
- monitor_subsys[SLAPD_MONITOR_BACKEND].mss_ndn,
+ monitor_subsys[SLAPD_MONITOR_BACKEND].mss_ndn->bv_val,
"" );
#endif
return( -1 );
)
{
+#if 0 /* not used yet */
struct monitorinfo *mi = (struct monitorinfo *) be->be_private;
+#endif
#ifdef NEW_LOGGING
LDAP_LOG(( "backend", LDAP_LEVEL_ENTRY,
const void *c2
)
{
- struct monitorcache *cc1 = ( struct monitorcache * )c1;
- struct monitorcache *cc2 = ( struct monitorcache * )c2;
+ struct monitorcache *cc1 = ( struct monitorcache * )c1;
+ struct monitorcache *cc2 = ( struct monitorcache * )c2;
+
+ int d = cc1->mc_ndn->bv_len - cc2->mc_ndn->bv_len;
/*
* case sensitive, because the dn MUST be normalized
*/
- return strcmp( cc1->mc_ndn, cc2->mc_ndn );
+ return d != 0 ? d : strcmp( cc1->mc_ndn->bv_val, cc2->mc_ndn->bv_val );
}
/*
{
struct monitorcache *cc1 = ( struct monitorcache * )c1;
struct monitorcache *cc2 = ( struct monitorcache * )c2;
+
+ int d = cc1->mc_ndn->bv_len - cc2->mc_ndn->bv_len;
+ int cmp;
/*
* case sensitive, because the dn MUST be normalized
*/
- return ( strcmp( cc1->mc_ndn, cc2->mc_ndn ) == 0 ) ? -1 : 0;
+ cmp = d != 0 ? d : strcmp( cc1->mc_ndn->bv_val, cc2->mc_ndn->bv_val );
+ return cmp == 0 ? -1 : 0;
}
/*
ldap_pvt_thread_mutex_init( &mp->mp_mutex );
mc = ( struct monitorcache * )ch_malloc( sizeof( struct monitorcache ) );
- mc->mc_ndn = e->e_ndn;
+ mc->mc_ndn = &e->e_nname;
mc->mc_e = e;
ldap_pvt_thread_mutex_lock( &mi->mi_cache_mutex );
rc = avl_insert( &mi->mi_cache, ( caddr_t )mc,
int
monitor_cache_get(
struct monitorinfo *mi,
- const char *ndn,
+ struct berval *ndn,
Entry **ep
)
{
assert( ndn != NULL );
assert( ep != NULL );
- tmp_mc.mc_ndn = ( char * )ndn;
+ tmp_mc.mc_ndn = ndn;
ldap_pvt_thread_mutex_lock( &mi->mi_cache_mutex );
mc = ( struct monitorcache * )avl_find( mi->mi_cache,
( caddr_t )&tmp_mc, monitor_cache_cmp );
int
monitor_cache_dn2entry(
struct monitorinfo *mi,
- const char *ndn,
+ struct berval *ndn,
Entry **ep,
Entry **matched
)
{
- int rc;
+ int rc;
- char *p_ndn;
- Entry *e_parent;
+ struct berval p_ndn = { 0L, NULL };
+ Entry *e_parent;
struct monitorentrypriv *mp;
assert( mi != NULL );
}
/* try with parent/ancestors */
- p_ndn = dn_parent( NULL, ndn );
- rc = monitor_cache_dn2entry( mi, p_ndn, &e_parent, matched );
+ if ( ndn && ndn->bv_len ) {
+ p_ndn.bv_val = dn_parent( NULL, ndn->bv_val );
+ }
+ if ( p_ndn.bv_val == NULL ) {
+ p_ndn.bv_val = "";
+ p_ndn.bv_len = 0;
+ } else {
+ p_ndn.bv_len = ndn->bv_len
+ - ( ber_len_t ) ( p_ndn.bv_val - ndn->bv_val );
+ }
+ rc = monitor_cache_dn2entry( mi, &p_ndn, &e_parent, matched );
if ( rc || e_parent == NULL) {
return( -1 );
}
Attribute *a;
/* get entry with reader lock */
- monitor_cache_dn2entry( mi, ndn->bv_val, &e, &matched );
+ monitor_cache_dn2entry( mi, ndn, &e, &matched );
if ( e == NULL ) {
send_ldap_result( conn, op, LDAP_NO_SUCH_OBJECT,
matched ? matched->e_dn : NULL,
LDAP_LOG(( "operation", LDAP_LEVEL_CRIT,
"monitor_subsys_conn_init: "
"unable to get entry '%s'\n",
- monitor_subsys[SLAPD_MONITOR_CONN].mss_ndn ));
+ monitor_subsys[SLAPD_MONITOR_CONN].mss_ndn->bv_val ));
#else
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_conn_init: "
"unable to get entry '%s'\n%s%s",
- monitor_subsys[SLAPD_MONITOR_CONN].mss_ndn,
+ monitor_subsys[SLAPD_MONITOR_CONN].mss_ndn->bv_val,
"", "" );
#endif
return( -1 );
"objectClass: extensibleObject\n"
#endif /* !SLAPD_MONITORSUBENTRY */
"cn: Total\n",
- monitor_subsys[SLAPD_MONITOR_CONN].mss_dn );
+ monitor_subsys[SLAPD_MONITOR_CONN].mss_dn->bv_val );
e = str2entry( buf );
if ( e == NULL ) {
LDAP_LOG(( "operation", LDAP_LEVEL_CRIT,
"monitor_subsys_conn_init: "
"unable to create entry 'cn=Total,%s'\n",
- monitor_subsys[SLAPD_MONITOR_CONN].mss_ndn ));
+ monitor_subsys[SLAPD_MONITOR_CONN].mss_ndn->bv_val ));
#else
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_conn_init: "
"unable to create entry 'cn=Total,%s'\n%s%s",
- monitor_subsys[SLAPD_MONITOR_CONN].mss_ndn,
+ monitor_subsys[SLAPD_MONITOR_CONN].mss_ndn->bv_val,
"", "" );
#endif
return( -1 );
LDAP_LOG(( "operation", LDAP_LEVEL_CRIT,
"monitor_subsys_conn_init: "
"unable to add entry 'cn=Total,%s'\n",
- monitor_subsys[SLAPD_MONITOR_CONN].mss_ndn ));
+ monitor_subsys[SLAPD_MONITOR_CONN].mss_ndn->bv_val ));
#else
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_conn_init: "
"unable to add entry 'cn=Total,%s'\n%s%s",
- monitor_subsys[SLAPD_MONITOR_CONN].mss_ndn,
+ monitor_subsys[SLAPD_MONITOR_CONN].mss_ndn->bv_val,
"", "" );
#endif
return( -1 );
"objectClass: extensibleObject\n"
#endif /* !SLAPD_MONITORSUBENTRY */
"cn: Current\n",
- monitor_subsys[SLAPD_MONITOR_CONN].mss_dn );
+ monitor_subsys[SLAPD_MONITOR_CONN].mss_dn->bv_val );
e = str2entry( buf );
if ( e == NULL ) {
LDAP_LOG(( "operation", LDAP_LEVEL_CRIT,
"monitor_subsys_conn_init: "
"unable to create entry 'cn=Current,%s'\n",
- monitor_subsys[SLAPD_MONITOR_CONN].mss_ndn ));
+ monitor_subsys[SLAPD_MONITOR_CONN].mss_ndn->bv_val ));
#else
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_conn_init: "
"unable to create entry 'cn=Current,%s'\n%s%s",
- monitor_subsys[SLAPD_MONITOR_CONN].mss_ndn,
+ monitor_subsys[SLAPD_MONITOR_CONN].mss_ndn->bv_val,
"", "" );
#endif
return( -1 );
LDAP_LOG(( "operation", LDAP_LEVEL_CRIT,
"monitor_subsys_conn_init: "
"unable to add entry 'cn=Current,%s'\n",
- monitor_subsys[SLAPD_MONITOR_CONN].mss_ndn ));
+ monitor_subsys[SLAPD_MONITOR_CONN].mss_ndn->bv_val ));
#else
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_conn_init: "
"unable to add entry 'cn=Current,%s'\n%s%s",
- monitor_subsys[SLAPD_MONITOR_CONN].mss_ndn,
+ monitor_subsys[SLAPD_MONITOR_CONN].mss_ndn->bv_val,
"", "" );
#endif
return( -1 );
"objectClass: extensibleObject\n"
#endif /* !SLAPD_MONITORSUBENTRY */
"cn: %ld\n",
- c->c_connid, monitor_subsys[SLAPD_MONITOR_CONN].mss_dn,
+ c->c_connid, monitor_subsys[SLAPD_MONITOR_CONN].mss_dn->bv_val,
c->c_connid );
e = str2entry( buf );
"unable to create entry "
"'cn=%ld,%s' entry\n",
c->c_connid,
- monitor_subsys[SLAPD_MONITOR_CONN].mss_dn ));
+ monitor_subsys[SLAPD_MONITOR_CONN].mss_dn->bv_val ));
#else
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_conn_create: "
"unable to create entry "
- "'cn=%ld,%s' entry\n%s",
+ "'cn=%ld,%s' entry\n",
c->c_connid,
- monitor_subsys[SLAPD_MONITOR_CONN].mss_dn, "" );
+ monitor_subsys[SLAPD_MONITOR_CONN].mss_dn->bv_val, 0 );
#endif
return( -1 );
}
int
monitor_subsys_conn_create(
struct monitorinfo *mi,
- const char *ndn,
+ struct berval *ndn,
Entry *e_parent,
Entry **ep
)
connection_done(c);
*ep = e;
+
} else {
- /* create exactly the required entry */
- char *rdn, *value;
- unsigned long connid;
+ char **values;
+ struct berval *rdn;
+ unsigned long connid;
- rdn = dn_rdn( NULL, ndn );
- value = rdn_attr_value( rdn );
- connid = atol( value );
- free( value );
- free( rdn );
+ /* create exactly the required entry */
+
+ if ( dnExtractRdn( ndn->bv_val, &rdn ) != LDAP_SUCCESS ) {
+ return( -1 );
+ }
+
+ if ( rdn_attrs( rdn->bv_val, NULL, &values ) != LDAP_SUCCESS ) {
+ ber_bvfree( rdn );
+ return( -1 );
+ }
+ ber_bvfree( rdn );
+
+ assert( values );
+ assert( values[ 0 ] );
+
+ connid = atol( values[ 0 ] );
+
+ ldap_value_free( values );
for ( c = connection_first( &connindex );
c != NULL;
LDAP_LOG(( "operation", LDAP_LEVEL_CRIT,
"monitor_subsys_database_init: "
"unable to get entry '%s'\n",
- monitor_subsys[SLAPD_MONITOR_DATABASE].mss_ndn ));
+ monitor_subsys[SLAPD_MONITOR_DATABASE].mss_ndn->bv_val ));
#else
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_database_init: "
"unable to get entry '%s'\n%s%s",
- monitor_subsys[SLAPD_MONITOR_DATABASE].mss_ndn,
+ monitor_subsys[SLAPD_MONITOR_DATABASE].mss_ndn->bv_val,
"", "" );
#endif
return( -1 );
#endif /* !SLAPD_MONITORSUBENTRY */
"cn: %d\n",
i,
- monitor_subsys[SLAPD_MONITOR_DATABASE].mss_dn,
+ monitor_subsys[SLAPD_MONITOR_DATABASE].mss_dn->bv_val,
i );
e = str2entry( buf );
"monitor_subsys_database_init: "
"unable to create entry 'cn=%d,%s'\n",
i,
- monitor_subsys[SLAPD_MONITOR_DATABASE].mss_ndn ));
+ monitor_subsys[SLAPD_MONITOR_DATABASE].mss_ndn->bv_val ));
#else
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_database_init: "
"unable to create entry 'cn=%d,%s'\n%s",
i,
- monitor_subsys[SLAPD_MONITOR_DATABASE].mss_ndn,
+ monitor_subsys[SLAPD_MONITOR_DATABASE].mss_ndn->bv_val,
"" );
#endif
return( -1 );
"monitor_subsys_database_init: "
"unable to add entry 'cn=%d,%s'\n",
i,
- monitor_subsys[SLAPD_MONITOR_DATABASE].mss_ndn ));
+ monitor_subsys[SLAPD_MONITOR_DATABASE].mss_ndn->bv_val ));
#else
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_database_init: "
- "unable to add entry 'cn=%d,%s'\n%s",
+ "unable to add entry 'cn=%d,%s'\n",
i,
- monitor_subsys[SLAPD_MONITOR_DATABASE].mss_ndn,
- "" );
+ monitor_subsys[SLAPD_MONITOR_DATABASE].mss_ndn->bv_val,
+ 0 );
#endif
return( -1 );
}
int
monitor_entry_create(
struct monitorinfo *mi,
- const char *ndn,
+ struct berval *ndn,
Entry *e_parent,
Entry **ep
)
struct monitorentrypriv *mp;
int i, rc;
char buf[1024], *end_of_line;
- struct berval dn, *ndn;
+ struct berval dn, *ndn;
const char *text;
struct berval val, *bv[2] = { &val, NULL };
return -1;
}
+ ber_bvecadd( &be->be_suffix, ber_bvdup( &dn ) );
ber_bvecadd( &be->be_nsuffix, ndn );
mi = ( struct monitorinfo * )ch_calloc( sizeof( struct monitorinfo ), 1 );
*/
e_tmp = NULL;
for ( i = 0; monitor_subsys[ i ].mss_name != NULL; i++ ) {
- int len = strlen( monitor_subsys[ i ].mss_name );
-
- monitor_subsys[ i ].mss_rdn = ch_calloc( sizeof( char ),
- 4 + len );
- strcpy( monitor_subsys[ i ].mss_rdn, "cn=" );
- strcat( monitor_subsys[ i ].mss_rdn,
- monitor_subsys[ i ].mss_name );
-
- monitor_subsys[ i ].mss_dn = ch_calloc( sizeof( char ),
- 4 + len + sizeof( SLAPD_MONITOR_DN ) );
- strcpy( monitor_subsys[ i ].mss_dn,
- monitor_subsys[ i ].mss_rdn );
- strcat( monitor_subsys[ i ].mss_dn, "," );
- strcat( monitor_subsys[ i ].mss_dn, SLAPD_MONITOR_DN );
+ int len = strlen( monitor_subsys[ i ].mss_name );
+ struct berval dn, *pdn;
+ int rc;
+
+ dn.bv_len = len + sizeof( "cn=" ) - 1;
+ dn.bv_val = ch_calloc( sizeof( char ), dn.bv_len + 1 );
+ strcpy( dn.bv_val, "cn=" );
+ strcat( dn.bv_val, monitor_subsys[ i ].mss_name );
+ pdn = NULL;
+ rc = dnPretty( NULL, &dn, &pdn );
+ if ( rc != LDAP_SUCCESS ) {
+#ifdef NEW_LOGGING
+ LDAP_LOG(( "operation", LDAP_LEVEL_CRIT,
+ "monitor RDN \"%s\" is invalid\n",
+ dn.bv_val ));
+#else
+ Debug( LDAP_DEBUG_ANY,
+ "monitor RDN \"%s\" is invalid\n",
+ dn.bv_val, 0, 0 );
+#endif
+ free( dn.bv_val );
+ return( -1 );
+ }
+ free( dn.bv_val );
+ monitor_subsys[ i ].mss_rdn = pdn;
+
+ dn.bv_len += sizeof( SLAPD_MONITOR_DN ); /* 1 for the , */
+ dn.bv_val = ch_calloc( sizeof( char ), dn.bv_len + 1 );
+ strcpy( dn.bv_val , monitor_subsys[ i ].mss_rdn->bv_val );
+ strcat( dn.bv_val, "," SLAPD_MONITOR_DN );
+ pdn = NULL;
+ rc = dnPretty( NULL, &dn, &pdn );
+ if ( rc != LDAP_SUCCESS ) {
+#ifdef NEW_LOGGING
+ LDAP_LOG(( "operation", LDAP_LEVEL_CRIT,
+ "monitor DN \"%s\" is invalid\n",
+ dn.bv_val ));
+#else
+ Debug( LDAP_DEBUG_ANY,
+ "monitor DN \"%s\" is invalid\n",
+ dn.bv_val, 0, 0 );
+#endif
+ free( dn.bv_val );
+ return( -1 );
+ }
+ monitor_subsys[ i ].mss_dn = pdn;
- monitor_subsys[ i ].mss_ndn
- = ch_strdup( monitor_subsys[ i ].mss_dn );
- dn_normalize( monitor_subsys[ i ].mss_ndn );
+ pdn = NULL;
+ dnNormalize( NULL, &dn, &pdn );
+ if ( rc != LDAP_SUCCESS ) {
+#ifdef NEW_LOGGING
+ LDAP_LOG(( "operation", LDAP_LEVEL_CRIT,
+ "monitor DN \"%s\" is invalid\n",
+ dn.bv_val ));
+#else
+ Debug( LDAP_DEBUG_ANY,
+ "monitor DN \"%s\" is invalid\n",
+ dn.bv_val, 0, 0 );
+#endif
+ free( dn.bv_val );
+ return( -1 );
+ }
+ free( dn.bv_val );
+ monitor_subsys[ i ].mss_ndn = pdn;
snprintf( buf, sizeof( buf ),
"dn: %s\n"
"objectClass: extensibleObject\n"
#endif /* !SLAPD_MONITORSUBENTRY */
"cn: %s\n",
- monitor_subsys[ i ].mss_dn,
+ monitor_subsys[ i ].mss_dn->bv_val,
monitor_subsys[ i ].mss_name );
e = str2entry( buf );
#ifdef NEW_LOGGING
LDAP_LOG(( "operation", LDAP_LEVEL_CRIT,
"unable to create '%s' entry\n",
- monitor_subsys[ i ].mss_dn ));
+ monitor_subsys[ i ].mss_dn->bv_val ));
#else
Debug( LDAP_DEBUG_ANY,
- "unable to create '%s' entry\n%s%s",
- monitor_subsys[ i ].mss_dn, "", "" );
+ "unable to create '%s' entry\n",
+ monitor_subsys[ i ].mss_dn->bv_val, 0, 0 );
#endif
return( -1 );
}
#ifdef NEW_LOGGING
LDAP_LOG(( "operation", LDAP_LEVEL_CRIT,
"unable to add entry '%s' to cache\n",
- monitor_subsys[ i ].mss_dn ));
+ monitor_subsys[ i ].mss_dn->bv_val ));
#else
Debug( LDAP_DEBUG_ANY,
- "unable to add entry '%s' to cache\n%s%s",
- monitor_subsys[ i ].mss_dn, "", "" );
+ "unable to add entry '%s' to cache\n",
+ monitor_subsys[ i ].mss_dn->bv_val, 0, 0 );
#endif
return -1;
}
LDAP_LOG(( "operation", LDAP_LEVEL_CRIT,
"monitor_subsys_log_init: "
"unable to get entry '%s'\n",
- monitor_subsys[SLAPD_MONITOR_LOG].mss_ndn ));
+ monitor_subsys[SLAPD_MONITOR_LOG].mss_ndn->bv_val ));
#else
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_log_init: "
"unable to get entry '%s'\n%s%s",
- monitor_subsys[SLAPD_MONITOR_LOG].mss_ndn,
+ monitor_subsys[SLAPD_MONITOR_LOG].mss_ndn->bv_val,
"", "" );
#endif
return( -1 );
{
int i, j, k, found, rc, nl = 0;
Attribute *a;
- char *desc = mod->sm_desc->ad_cname.bv_val;
- MatchingRule *mr = mod->sm_desc->ad_type->sat_equality;
+ MatchingRule *mr = mod->sm_desc->ad_type->sat_equality;
rc = check_constraints( mod, &nl );
if ( rc != LDAP_SUCCESS ) {
#endif
/* acquire and lock entry */
- monitor_cache_dn2entry( mi, ndn->bv_val, &e, &matched );
+ monitor_cache_dn2entry( mi, ndn, &e, &matched );
if ( e == NULL ) {
send_ldap_result( conn, op, LDAP_NO_SUCH_OBJECT,
matched ? matched->e_dn : NULL,
LDAP_LOG(( "operation", LDAP_LEVEL_CRIT,
"monitor_subsys_ops_init: "
"unable to get entry '%s'\n",
- monitor_subsys[SLAPD_MONITOR_OPS].mss_ndn ));
+ monitor_subsys[SLAPD_MONITOR_OPS].mss_ndn->bv_val ));
#else
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_ops_init: "
"unable to get entry '%s'\n%s%s",
- monitor_subsys[SLAPD_MONITOR_OPS].mss_ndn,
+ monitor_subsys[SLAPD_MONITOR_OPS].mss_ndn->bv_val,
"", "" );
#endif
return( -1 );
"objectClass: extensibleObject\n"
#endif /* !SLAPD_MONITORSUBENTRY */
"cn: Initiated\n",
- monitor_subsys[SLAPD_MONITOR_OPS].mss_dn );
+ monitor_subsys[SLAPD_MONITOR_OPS].mss_dn->bv_val );
e = str2entry( buf );
if ( e == NULL ) {
LDAP_LOG(( "operation", LDAP_LEVEL_CRIT,
"monitor_subsys_ops_init: "
"unable to create entry 'cn=Initiated,%s'\n",
- monitor_subsys[SLAPD_MONITOR_OPS].mss_ndn ));
+ monitor_subsys[SLAPD_MONITOR_OPS].mss_ndn->bv_val ));
#else
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_ops_init: "
"unable to create entry 'cn=Initiated,%s'\n%s%s",
- monitor_subsys[SLAPD_MONITOR_OPS].mss_ndn,
+ monitor_subsys[SLAPD_MONITOR_OPS].mss_ndn->bv_val,
"", "" );
#endif
return( -1 );
LDAP_LOG(( "operation", LDAP_LEVEL_CRIT,
"monitor_subsys_ops_init: "
"unable to add entry 'cn=Initiated,%s'\n",
- monitor_subsys[SLAPD_MONITOR_OPS].mss_ndn ));
+ monitor_subsys[SLAPD_MONITOR_OPS].mss_ndn->bv_val ));
#else
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_ops_init: "
"unable to add entry 'cn=Initiated,%s'\n%s%s",
- monitor_subsys[SLAPD_MONITOR_OPS].mss_ndn,
+ monitor_subsys[SLAPD_MONITOR_OPS].mss_ndn->bv_val,
"", "" );
#endif
return( -1 );
"objectClass: extensibleObject\n"
#endif /* !SLAPD_MONITORSUBENTRY */
"cn: Completed\n",
- monitor_subsys[SLAPD_MONITOR_OPS].mss_dn );
+ monitor_subsys[SLAPD_MONITOR_OPS].mss_dn->bv_val );
e = str2entry( buf );
if ( e == NULL ) {
LDAP_LOG(( "operation", LDAP_LEVEL_CRIT,
"monitor_subsys_ops_init: "
"unable to create entry 'cn=Completed,%s'\n",
- monitor_subsys[SLAPD_MONITOR_OPS].mss_ndn ));
+ monitor_subsys[SLAPD_MONITOR_OPS].mss_ndn->bv_val ));
#else
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_ops_init: "
"unable to create entry 'cn=Completed,%s'\n%s%s",
- monitor_subsys[SLAPD_MONITOR_OPS].mss_ndn,
+ monitor_subsys[SLAPD_MONITOR_OPS].mss_ndn->bv_val,
"", "" );
#endif
return( -1 );
LDAP_LOG(( "operation", LDAP_LEVEL_CRIT,
"monitor_subsys_ops_init: "
"unable to add entry 'cn=Completed,%s'\n",
- monitor_subsys[SLAPD_MONITOR_OPS].mss_ndn ));
+ monitor_subsys[SLAPD_MONITOR_OPS].mss_ndn->bv_val ));
#else
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_ops_init: "
"unable to add entry 'cn=Completed,%s'\n%s%s",
- monitor_subsys[SLAPD_MONITOR_OPS].mss_ndn,
+ monitor_subsys[SLAPD_MONITOR_OPS].mss_ndn->bv_val,
"", "" );
#endif
return( -1 );
*/
int monitor_subsys_conn_init LDAP_P(( BackendDB *be ));
int monitor_subsys_conn_update LDAP_P(( struct monitorinfo *mi, Entry *e ));
-int monitor_subsys_conn_create LDAP_P(( struct monitorinfo *mi, const char *ndn, Entry *e_parent, Entry **ep ));
+int monitor_subsys_conn_create LDAP_P(( struct monitorinfo *mi, struct berval *ndn, Entry *e_parent, Entry **ep ));
/*
* read waiters
int monitor_subsys_sent_update LDAP_P(( struct monitorinfo *mi, Entry *e ));
LDAP_END_DECL
+
#endif
Connection *conn,
Operation *op,
Filter *filter,
- struct berval **attrs,
+ struct berval **attrs,
int attrsonly,
Entry *e_parent,
int sub,
mp = ( struct monitorentrypriv * )e_parent->e_private;
e = mp->mp_children;
+ e_ch = NULL;
if ( MONITOR_HAS_VOLATILE_CH( mp ) ) {
monitor_entry_create( mi, NULL, e_parent, &e_ch );
}
/* get entry with reader lock */
- monitor_cache_dn2entry( mi, nbase->bv_val, &e, &matched );
+ monitor_cache_dn2entry( mi, nbase, &e, &matched );
if ( e == NULL ) {
send_ldap_result( conn, op, LDAP_NO_SUCH_OBJECT,
matched ? matched->e_dn : NULL,
LDAP_LOG(( "operation", LDAP_LEVEL_CRIT,
"monitor_subsys_sent_init: "
"unable to get entry '%s'\n",
- monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn ));
+ monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn->bv_val ));
#else
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_sent_init: "
"unable to get entry '%s'\n%s%s",
- monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn,
+ monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn->bv_val,
"", "" );
#endif
return( -1 );
"objectClass: extensibleObject\n"
#endif /* !SLAPD_MONITORSUBENTRY */
"cn: Entries\n",
- monitor_subsys[SLAPD_MONITOR_SENT].mss_dn );
+ monitor_subsys[SLAPD_MONITOR_SENT].mss_dn->bv_val );
e = str2entry( buf );
if ( e == NULL ) {
LDAP_LOG(( "operation", LDAP_LEVEL_CRIT,
"monitor_subsys_sent_init: "
"unable to create entry 'cn=Entries,%s'\n",
- monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn ));
+ monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn->bv_val ));
#else
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_sent_init: "
"unable to create entry 'cn=Entries,%s'\n%s%s",
- monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn,
+ monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn->bv_val,
"", "" );
#endif
return( -1 );
LDAP_LOG(( "operation", LDAP_LEVEL_CRIT,
"monitor_subsys_sent_init: "
"unable to add entry 'cn=Entries,%s'\n",
- monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn ));
+ monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn->bv_val ));
#else
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_sent_init: "
"unable to add entry 'cn=Entries,%s'\n%s%s",
- monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn,
+ monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn->bv_val,
"", "" );
#endif
return( -1 );
"objectClass: extensibleObject\n"
#endif /* !SLAPD_MONITORSUBENTRY */
"cn: Referrals\n",
- monitor_subsys[SLAPD_MONITOR_SENT].mss_dn );
+ monitor_subsys[SLAPD_MONITOR_SENT].mss_dn->bv_val );
e = str2entry( buf );
if ( e == NULL ) {
LDAP_LOG(( "operation", LDAP_LEVEL_CRIT,
"monitor_subsys_sent_init: "
"unable to create entry 'cn=Referrals,%s'\n",
- monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn ));
+ monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn->bv_val ));
#else
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_sent_init: "
"unable to create entry 'cn=Referrals,%s'\n%s%s",
- monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn,
+ monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn->bv_val,
"", "" );
#endif
return( -1 );
LDAP_LOG(( "operation", LDAP_LEVEL_CRIT,
"monitor_subsys_sent_init: "
"unable to add entry 'cn=Referrals,%s'\n",
- monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn ));
+ monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn->bv_val ));
#else
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_sent_init: "
"unable to add entry 'cn=Referrals,%s'\n%s%s",
- monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn,
+ monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn->bv_val,
"", "" );
#endif
return( -1 );
"objectClass: extensibleObject\n"
#endif /* !SLAPD_MONITORSUBENTRY */
"cn: PDU\n",
- monitor_subsys[SLAPD_MONITOR_SENT].mss_dn );
+ monitor_subsys[SLAPD_MONITOR_SENT].mss_dn->bv_val );
e = str2entry( buf );
if ( e == NULL ) {
LDAP_LOG(( "operation", LDAP_LEVEL_CRIT,
"monitor_subsys_sent_init: "
"unable to create entry 'cn=PDU,%s'\n",
- monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn ));
+ monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn->bv_val ));
#else
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_sent_init: "
"unable to create entry 'cn=PDU,%s'\n%s%s",
- monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn,
+ monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn->bv_val,
"", "" );
#endif
return( -1 );
LDAP_LOG(( "operation", LDAP_LEVEL_CRIT,
"monitor_subsys_sent_init: "
"unable to add entry 'cn=PDU,%s'\n",
- monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn ));
+ monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn->bv_val ));
#else
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_sent_init: "
"unable to add entry 'cn=PDU,%s'\n%s%s",
- monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn,
+ monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn->bv_val,
"", "" );
#endif
return( -1 );
"objectClass: extensibleObject\n"
#endif /* !SLAPD_MONITORSUBENTRY */
"cn: Bytes\n",
- monitor_subsys[SLAPD_MONITOR_SENT].mss_dn );
+ monitor_subsys[SLAPD_MONITOR_SENT].mss_dn->bv_val );
e = str2entry( buf );
if ( e == NULL ) {
LDAP_LOG(( "operation", LDAP_LEVEL_CRIT,
"monitor_subsys_sent_init: "
"unable to create entry 'cn=Bytes,%s'\n",
- monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn ));
+ monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn->bv_val ));
#else
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_sent_init: "
"unable to create entry 'cn=Bytes,%s'\n%s%s",
- monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn,
+ monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn->bv_val,
"", "" );
#endif
return( -1 );
LDAP_LOG(( "operation", LDAP_LEVEL_CRIT,
"monitor_subsys_sent_init: "
"unable to add entry 'cn=Bytes,%s'\n",
- monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn ));
+ monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn->bv_val ));
#else
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_sent_init: "
"unable to add entry 'cn=Bytes,%s'\n%s%s",
- monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn,
+ monitor_subsys[SLAPD_MONITOR_SENT].mss_ndn->bv_val,
"", "" );
#endif
return( -1 );
#ifdef NEW_LOGGING
LDAP_LOG(( "operation", LDAP_LEVEL_CRIT,
"monitor_subsys_thread_init: unable to get entry '%s'\n",
- monitor_subsys[SLAPD_MONITOR_THREAD].mss_ndn ));
+ monitor_subsys[SLAPD_MONITOR_THREAD].mss_ndn->bv_val ));
#else
Debug( LDAP_DEBUG_ANY,
"monitor_subsys_thread_init: unable to get entry '%s'\n",
- monitor_subsys[SLAPD_MONITOR_THREAD].mss_ndn, 0, 0 );
+ monitor_subsys[SLAPD_MONITOR_THREAD].mss_ndn->bv_val,
+ 0, 0 );
#endif
return( -1 );
}