return( -1 );
}
- bv.bv_val = bi->bi_type;
- bv.bv_len = strlen( bv.bv_val );
-
+ ber_str2bv( bi->bi_type, 0, 0, &bv );
attr_merge_normalize_one( e, mi->mi_ad_monitoredInfo,
&bv, NULL );
attr_merge_normalize_one( e_backend, mi->mi_ad_monitoredInfo,
int j;
for ( j = 0; bi->bi_controls[ j ]; j++ ) {
- bv.bv_val = bi->bi_controls[ j ];
- bv.bv_len = strlen( bv.bv_val );
- attr_merge_one( e, slap_schema.si_ad_supportedControl, &bv, NULL );
+ ber_str2bv( bi->bi_controls[ j ], 0, 0, &bv );
+ attr_merge_one( e, slap_schema.si_ad_supportedControl,
+ &bv, &bv );
}
}
snprintf( buf, sizeof( buf ), "cn=Database %d,%s",
j, ms_database->mss_dn.bv_val );
- dn.bv_val = buf;
- dn.bv_len = strlen( buf );
+ ber_str2bv( buf, 0, 0, &dn );
attr_merge_normalize_one( e, mi->mi_ad_seeAlso,
&dn, NULL );
}
}
BER_BVSTR( &bv, "0" );
- attr_merge_one( e, mi->mi_ad_monitorCounter, &bv, NULL );
+ attr_merge_one( e, mi->mi_ad_monitorCounter, &bv, &bv );
mp = monitor_entrypriv_create();
if ( mp == NULL ) {
}
BER_BVSTR( &bv, "0" );
- attr_merge_one( e, mi->mi_ad_monitorCounter, &bv, NULL );
+ attr_merge_one( e, mi->mi_ad_monitorCounter, &bv, &bv );
mp = monitor_entrypriv_create();
if ( mp == NULL ) {
buf3
);
- bv.bv_val = buf;
- bv.bv_len = strlen( buf );
- attr_merge_one( e, mi->mi_ad_monitoredInfo, &bv, NULL );
+ ber_str2bv( buf, 0, 0, &bv );
+ attr_merge_one( e, mi->mi_ad_monitoredInfo, &bv, &bv );
/* connection number */
snprintf( buf, sizeof( buf ), "%ld", c->c_connid );
- bv.bv_val = buf;
- bv.bv_len = strlen( buf );
- attr_merge_one( e, mi->mi_ad_monitorConnectionNumber, &bv, NULL );
+ ber_str2bv( buf, 0, 0, &bv );
+ attr_merge_one( e, mi->mi_ad_monitorConnectionNumber, &bv, &bv );
/* authz DN */
attr_merge_one( e, mi->mi_ad_monitorConnectionAuthzDN,
/* local address */
attr_merge_one( e, mi->mi_ad_monitorConnectionLocalAddress,
- &c->c_sock_name, NULL );
+ &c->c_sock_name, &bv );
/* peer address */
attr_merge_one( e, mi->mi_ad_monitorConnectionPeerAddress,
- &c->c_peer_name, NULL );
+ &c->c_peer_name, &bv );
mp = monitor_entrypriv_create();
if ( mp == NULL ) {
struct berval *tf = ( ( restrictops & SLAP_RESTRICT_OP_MASK ) == SLAP_RESTRICT_OP_WRITES ) ?
(struct berval *)&slap_true_bv : (struct berval *)&slap_false_bv;
- return attr_merge_one( e, mi->mi_ad_readOnly, tf, NULL );
+ return attr_merge_one( e, mi->mi_ad_readOnly, tf, tf );
}
static int
for ( i = 0; restricted_ops[ i ].op.bv_val; i++ ) {
if ( restrictops & restricted_ops[ i ].tag ) {
rc = attr_merge_one( e, mi->mi_ad_restrictedOperation,
- &restricted_ops[ i ].op, NULL );
+ &restricted_ops[ i ].op,
+ &restricted_ops[ i ].op );
if ( rc ) {
return rc;
}
for ( i = 0; restricted_exops[ i ].op.bv_val; i++ ) {
if ( restrictops & restricted_exops[ i ].tag ) {
rc = attr_merge_one( e, mi->mi_ad_restrictedOperation,
- &restricted_exops[ i ].op, NULL );
+ &restricted_exops[ i ].op,
+ &restricted_exops[ i ].op );
if ( rc ) {
return rc;
}
break;
}
- bv.bv_val = on->on_bi.bi_type;
- bv.bv_len = strlen( bv.bv_val );
+ ber_str2bv( on->on_bi.bi_type, 0, 0, &bv );
attr_merge_normalize_one( e, mi->mi_ad_monitorOverlay,
&bv, NULL );
snprintf( buf, sizeof( buf ),
"cn=Overlay %d,%s",
j, ms_overlay->mss_dn.bv_val );
- bv.bv_val = buf;
- bv.bv_len = strlen( buf );
+ ber_str2bv( buf, 0, 0, &bv );
attr_merge_normalize_one( e, mi->mi_ad_seeAlso,
&bv, NULL );
}
if ( !bvmatch( &a->a_vals[ 0 ], tf ) ) {
attr_delete( &e->e_attrs, mi->mi_ad_readOnly );
- rc = attr_merge_one( e, mi->mi_ad_readOnly, tf, NULL );
+ rc = attr_merge_one( e, mi->mi_ad_readOnly, tf, tf );
}
if ( rc == LDAP_SUCCESS ) {
for ( i = 0; !BER_BVISNULL( &restricted_ops[ i ].op ); i++ ) {
if ( rp_add & restricted_ops[ i ].tag ) {
attr_merge_one( e, mi->mi_ad_restrictedOperation,
- &restricted_ops[ i ].op, NULL );
+ &restricted_ops[ i ].op,
+ &restricted_ops[ i ].op );
}
}
for ( i = 0; !BER_BVISNULL( &restricted_exops[ i ].op ); i++ ) {
if ( rp_add & restricted_exops[ i ].tag ) {
attr_merge_one( e, mi->mi_ad_restrictedOperation,
- &restricted_exops[ i ].op, NULL );
+ &restricted_exops[ i ].op,
+ &restricted_exops[ i ].op );
}
}
}
srchdesc->spd_version,
srchdesc->spd_description );
- bv.bv_val = buf;
- bv.bv_len = strlen( buf );
+ ber_str2bv( buf, 0, 0, &bv );
attr_merge_normalize_one( e_database,
mi->mi_ad_monitoredInfo, &bv, NULL );
#include "portable.h"
#include <stdio.h>
+#include <ac/string.h>
#include "slap.h"
#include "back-monitor.h"
if ( l[ i ]->sl_is_tls ) {
struct berval bv;
- bv.bv_val = "TLS";
- bv.bv_len = sizeof("TLS")-1;
-
+ BER_BVSTR( &bv, "TLS" );
attr_merge_normalize_one( e, mi->mi_ad_monitoredInfo,
&bv, NULL );
}
}
}
- attr_merge( e, mi->mi_ad_description, desc, NULL );
+ attr_merge_normalize( e, mi->mi_ad_description, desc, NULL );
monitor_cache_release( mi, e );
return( -1 );
}
- attr_merge_one( e_op, mi->mi_ad_monitorOpInitiated, &bv_zero, NULL );
- attr_merge_one( e_op, mi->mi_ad_monitorOpCompleted, &bv_zero, NULL );
+ attr_merge_one( e_op, mi->mi_ad_monitorOpInitiated, &bv_zero, &bv_zero );
+ attr_merge_one( e_op, mi->mi_ad_monitorOpCompleted, &bv_zero, &bv_zero );
mp = ( monitor_entry_t * )e_op->e_private;
mp->mp_children = NULL;
return( -1 );
}
- bv.bv_val = on->on_bi.bi_type;
- bv.bv_len = strlen( bv.bv_val );
-
+ ber_str2bv( on->on_bi.bi_type, 0, 0, &bv );
attr_merge_normalize_one( e, mi->mi_ad_monitoredInfo,
&bv, NULL );
attr_merge_normalize_one( e_overlay, mi->mi_ad_monitoredInfo,
snprintf( buf, sizeof( buf ), "cn=Database %d,%s",
j, ms_database->mss_dn.bv_val );
- dn.bv_val = buf;
- dn.bv_len = strlen( buf );
+ ber_str2bv( buf, 0, 0, &dn );
attr_merge_normalize_one( e, mi->mi_ad_seeAlso,
&dn, NULL );
}
ber_dupbv( &monitor_rww[ i ].nrdn, &nrdn );
BER_BVSTR( &bv, "0" );
- attr_merge_one( e, mi->mi_ad_monitorCounter, &bv, NULL );
+ attr_merge_one( e, mi->mi_ad_monitorCounter, &bv, &bv );
mp = monitor_entrypriv_create();
if ( mp == NULL ) {
ber_dupbv( &monitor_sent[ i ].nrdn, &nrdn );
BER_BVSTR( &bv, "0" );
- attr_merge_one( e, mi->mi_ad_monitorCounter, &bv, NULL );
+ attr_merge_one( e, mi->mi_ad_monitorCounter, &bv, &bv );
mp = monitor_entrypriv_create();
if ( mp == NULL ) {