/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
- * Copyright 2000-2007 The OpenLDAP Foundation.
+ * Copyright 2000-2009 The OpenLDAP Foundation.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
a = attr_find( e->e_attrs, ad_olmBDBEntryCache );
assert( a != NULL );
bv.bv_val = buf;
- bv.bv_len = snprintf( buf, sizeof( buf ), "%d", bdb->bi_cache.c_cursize );
+ bv.bv_len = snprintf( buf, sizeof( buf ), "%lu", bdb->bi_cache.c_cursize );
ber_bvreplace( &a->a_vals[ 0 ], &bv );
a = attr_find( e->e_attrs, ad_olmBDBDNCache );
assert( a != NULL );
- bv.bv_len = snprintf( buf, sizeof( buf ), "%d", bdb->bi_cache.c_eiused );
+ bv.bv_len = snprintf( buf, sizeof( buf ), "%lu", bdb->bi_cache.c_eiused );
ber_bvreplace( &a->a_vals[ 0 ], &bv );
a = attr_find( e->e_attrs, ad_olmBDBIDLCache );
assert( a != NULL );
- bv.bv_len = snprintf( buf, sizeof( buf ), "%d", bdb->bi_idl_cache_size );
+ bv.bv_len = snprintf( buf, sizeof( buf ), "%lu", bdb->bi_idl_cache_size );
ber_bvreplace( &a->a_vals[ 0 ], &bv );
#ifdef BDB_MONITOR_IDX
argv[ 2 ] = s_oid[ i ].oid;
if ( parse_oidm( &c, 0, NULL ) != 0 ) {
- Debug( LDAP_DEBUG_ANY,
- "bdb_monitor_initialize: unable to add "
+ Debug( LDAP_DEBUG_ANY, LDAP_XSTRING(bdb_monitor_initialize)
+ ": unable to add "
"objectIdentifier \"%s=%s\"\n",
s_oid[ i ].name, s_oid[ i ].oid, 0 );
return 1;
for ( i = 0; s_at[ i ].desc != NULL; i++ ) {
code = register_at( s_at[ i ].desc, s_at[ i ].ad, 1 );
if ( code != LDAP_SUCCESS ) {
- Debug( LDAP_DEBUG_ANY,
- "bdb_monitor_initialize: register_at failed\n",
+ Debug( LDAP_DEBUG_ANY, LDAP_XSTRING(bdb_monitor_initialize)
+ ": register_at failed\n",
0, 0, 0 );
+ } else {
+ (*s_at[ i ].ad)->ad_type->sat_flags |= SLAP_AT_HIDE;
}
- (*s_at[ i ].ad)->ad_type->sat_flags |= SLAP_AT_HIDE;
}
for ( i = 0; s_oc[ i ].desc != NULL; i++ ) {
code = register_oc( s_oc[ i ].desc, s_oc[ i ].oc, 1 );
if ( code != LDAP_SUCCESS ) {
- Debug( LDAP_DEBUG_ANY,
- "bdb_monitor_initialize: register_oc failed\n",
+ Debug( LDAP_DEBUG_ANY, LDAP_XSTRING(bdb_monitor_initialize)
+ ": register_oc failed\n",
0, 0, 0 );
+ } else {
+ (*s_oc[ i ].oc)->soc_flags |= SLAP_OC_HIDE;
}
- (*s_oc[ i ].oc)->soc_flags |= SLAP_OC_HIDE;
}
return 0;
{
struct bdb_info *bdb = (struct bdb_info *) be->be_private;
- if ( SLAP_GLUE_SUBORDINATE( be ) ) {
- return 0;
- }
-
if ( bdb_monitor_initialize() == LDAP_SUCCESS ) {
/* monitoring in back-bdb is on by default */
SLAP_DBFLAGS( be ) |= SLAP_DBFLAG_MONITORING;
return 0;
}
- if ( SLAP_GLUE_SUBORDINATE( be ) ) {
- return 0;
- }
-
mi = backend_info( "monitor" );
if ( !mi || !mi->bi_extra ) {
SLAP_DBFLAGS( be ) ^= SLAP_DBFLAG_MONITORING;
static int warning = 0;
if ( warning++ == 0 ) {
- Debug( LDAP_DEBUG_ANY, "bdb_monitor_open: "
- "monitoring disabled; "
+ Debug( LDAP_DEBUG_ANY, LDAP_XSTRING(bdb_monitor_db_open)
+ ": monitoring disabled; "
"configure monitor database to enable\n",
0, 0, 0 );
}
{
struct berval bv, nbv;
ber_len_t pathlen = 0, len = 0;
- char path[ PATH_MAX ] = { '\0' };
+ char path[ MAXPATHLEN ] = { '\0' };
char *fname = bdb->bi_dbenv_home,
*ptr;
{
struct bdb_info *bdb = (struct bdb_info *) be->be_private;
- if ( SLAP_GLUE_SUBORDINATE( be ) ) {
- return 0;
- }
-
if ( !BER_BVISNULL( &bdb->bi_monitor.bdm_ndn ) ) {
BackendInfo *mi = backend_info( "monitor" );
monitor_extra_t *mbe;
int
bdb_monitor_db_destroy( BackendDB *be )
{
- if ( SLAP_GLUE_SUBORDINATE( be ) ) {
- return 0;
- }
-
#ifdef BDB_MONITOR_IDX
- {
- struct bdb_info *bdb = (struct bdb_info *) be->be_private;
+ struct bdb_info *bdb = (struct bdb_info *) be->be_private;
- /* TODO: free tree */
- ldap_pvt_thread_mutex_destroy( &bdb->bi_idx_mutex );
- avl_free( bdb->bi_idx, ch_free );
- }
+ /* TODO: free tree */
+ ldap_pvt_thread_mutex_destroy( &bdb->bi_idx_mutex );
+ avl_free( bdb->bi_idx, ch_free );
#endif /* BDB_MONITOR_IDX */
return 0;
{
int key;
- for ( key = 0; key < 8*sizeof(slap_mask_t) && !( bitmask & 0x1U ); key++ ) {
+ for ( key = 0; key < 8 * (int)sizeof(slap_mask_t) && !( bitmask & 0x1U );
+ key++ )
bitmask >>= 1;
- }
return key;
}