extern struct monitorsubsys monitor_subsys[];
extern AttributeDescription *monitor_ad_desc;
-extern slap_mr_normalize_func *monitor_ad_normalize;
extern BackendDB *be_monitor;
/*
for ( i = nBackendInfo; i--; ) {
char buf[1024];
BackendInfo *bi;
- struct berval bv, nbv;
- int rc;
+ struct berval bv;
bi = &backendInfo[i];
bv.bv_val = bi->bi_type;
bv.bv_len = strlen( bv.bv_val );
- nbv.bv_val = NULL;
- if ( monitor_ad_normalize ) {
- rc = monitor_ad_normalize(
- 0,
- monitor_ad_desc->ad_type->sat_syntax,
- monitor_ad_desc->ad_type->sat_equality,
- &bv, &nbv );
- if ( rc ) {
- return( -1 );
- }
- }
-
- attr_merge_one( e, monitor_ad_desc, &bv,
- nbv.bv_val ? &nbv : NULL );
- attr_merge_one( e_backend, monitor_ad_desc, &bv,
- nbv.bv_val ? &nbv : NULL );
- ch_free( nbv.bv_val );
+ attr_merge_normalize_one( e, monitor_ad_desc, &bv );
+ attr_merge_normalize_one( e_backend, monitor_ad_desc, &bv );
if ( bi->bi_controls ) {
int j;
j, monitor_subsys[SLAPD_MONITOR_BACKEND].mss_dn.bv_val );
bv.bv_val = buf;
bv.bv_len = strlen( buf );
- attr_mergeit_one( e, ad_seeAlso, &bv );
+ attr_merge_normalize_one( e, ad_seeAlso, &bv );
break;
}
}
bv.bv_val = buf;
bv.bv_len = strlen( buf );
- attr_mergeit_one( e_database, monitor_ad_desc, &bv );
+ attr_merge_normalize_one( e_database, monitor_ad_desc, &bv );
i++;
* used by many functions to add description to entries
*/
AttributeDescription *monitor_ad_desc = NULL;
-slap_mr_normalize_func *monitor_ad_normalize = NULL;
BackendDB *be_monitor = NULL;
/*
return( -1 );
}
- if ( monitor_ad_desc->ad_type->sat_equality ) {
- monitor_ad_normalize = monitor_ad_desc->ad_type->sat_equality->smr_normalize;
- }
-
/*
* Create all the subsystem specific entries
*/
} else {
bv.bv_len = strlen( Versionstr );
}
- if ( attr_merge_one( e, monitor_ad_desc, &bv, NULL ) ) {
+ if ( attr_merge_normalize_one( e, monitor_ad_desc, &bv ) ) {
#ifdef NEW_LOGGING
LDAP_LOG( OPERATION, CRIT,
"unable to add description to '%s' entry\n",
#ifdef HAVE_TLS
if ( l[i]->sl_is_tls ) {
- struct berval bv, nbv;
+ struct berval bv;
bv.bv_val = "TLS";
bv.bv_len = sizeof("TLS")-1;
- nbv.bv_val = NULL;
- if ( monitor_ad_normalize ) {
- int rc;
-
- rc = monitor_ad_normalize(
- 0,
- monitor_ad_desc->ad_type->sat_syntax,
- monitor_ad_desc->ad_type->sat_equality,
- &bv, &nbv );
- if ( rc ) {
- return( -1 );
- }
- }
-
- attr_merge_one( e, monitor_ad_desc, &bv,
- nbv.bv_val ? &nbv : NULL );
- ch_free( nbv.bv_val );
+ attr_merge_normalize_one( e, monitor_ad_desc, &bv );
}
#endif /* HAVE_TLS */
#ifdef LDAP_CONNECTIONLESS
if ( l[i]->sl_is_udp ) {
- struct berval bv, nbv;
+ struct berval bv;
bv.bv_val = "UDP";
bv.bv_len = sizeof("UDP")-1;
- nbv.bv_val = NULL;
- if ( monitor_ad_normalize ) {
- int rc;
-
- rc = monitor_ad_normalize(
- 0,
- monitor_ad_desc->ad_type->sat_syntax,
- monitor_ad_desc->ad_type->sat_equality,
- &bv, &nbv );
- if ( rc ) {
- return( -1 );
- }
- }
-
- attr_merge_one( e, monitor_ad_desc, &bv,
- nbv.bv_val ? &nbv : NULL );
- ch_free( nbv.bv_val );
+ attr_merge_normalize_one( e, monitor_ad_desc, &bv );
}
#endif /* HAVE_TLS */
/* initialize the debug level(s) */
for ( i = 0; int_2_level[ i ].i != 0; i++ ) {
- if ( monitor_ad_normalize ) {
+ if ( monitor_ad_desc->ad_type->sat_equality->smr_normalize ) {
int rc;
- rc = monitor_ad_normalize(
+ rc = (*monitor_ad_desc->ad_type->sat_equality->smr_normalize)(
0,
monitor_ad_desc->ad_type->sat_syntax,
monitor_ad_desc->ad_type->sat_equality,
*/
if ( is_at_operational( mod->sm_desc->ad_type ) ) {
( void ) attr_delete( &e->e_attrs, mod->sm_desc );
- rc = attr_mergeit( e, mod->sm_desc, mod->sm_bvalues );
+ rc = attr_merge( e, mod->sm_desc, mod->sm_bvalues,
+ mod->sm_nvalues );
if ( rc != 0 ) {
rc = LDAP_OTHER;
break;
}
/* no - add them */
- if ( attr_merge( e, mod->sm_desc, mod->sm_bvalues,
- mod->sm_nvalues ) != 0 ) {
+ rc = attr_merge( e, mod->sm_desc, mod->sm_bvalues, mod->sm_nvalues );
+ if ( rc != LDAP_SUCCESS ) {
/* this should return result of attr_mergeit */
- return LDAP_OTHER;
+ return rc;
}
return LDAP_SUCCESS;
return rc;
}
- if ( mod->sm_bvalues != NULL &&
- attr_merge( e, mod->sm_desc, mod->sm_bvalues,
- mod->sm_nvalues ) != 0 ) {
- return LDAP_OTHER;
+ if ( mod->sm_bvalues != NULL ) {
+ rc = attr_merge( e, mod->sm_desc, mod->sm_bvalues,
+ mod->sm_nvalues );
+ if ( rc != LDAP_SUCCESS ) {
+ return rc;
+ }
}
return LDAP_SUCCESS;
}
if ( b == NULL || b[0].bv_val == NULL ) {
- struct berval bv, nbv;
+ struct berval bv;
bv.bv_val = buf;
bv.bv_len = strlen( buf );
- nbv.bv_val = NULL;
- if ( monitor_ad_normalize ) {
- int rc;
-
- rc = monitor_ad_normalize(
- 0,
- monitor_ad_desc->ad_type->sat_syntax,
- monitor_ad_desc->ad_type->sat_equality,
- &bv, &nbv );
- if ( rc ) {
- return( -1 );
- }
- }
-
- attr_merge_one( e, monitor_ad_desc, &bv,
- nbv.bv_val ? &nbv : NULL );
- ch_free( nbv.bv_val );
+ attr_merge_normalize_one( e, monitor_ad_desc, &bv );
}
return( 0 );
bv.bv_val = buf;
bv.bv_len = strlen( bv.bv_val );
- attr_merge_one( e, monitor_ad_desc, &bv, NULL );
+ attr_merge_normalize_one( e, monitor_ad_desc, &bv );
monitor_cache_release( mi, e );
bv.bv_val = buf;
bv.bv_len = strlen( buf );
- attr_merge_one( e, monitor_ad_desc, &bv, NULL );
+ attr_merge_normalize_one( e, monitor_ad_desc, &bv );
}
return( 0 );