mirror of
https://git.openldap.org/openldap/openldap.git
synced 2024-12-21 03:10:25 +08:00
ITS#5540 sean-burford-monitor-normalize-unified-080706.patch
This commit is contained in:
parent
05ec9552a7
commit
fb6dfb852d
@ -94,7 +94,7 @@ monitor_subsys_conn_init(
|
||||
} else {
|
||||
BER_BVSTR( &bv, "0" );
|
||||
}
|
||||
attr_merge_one( e, mi->mi_ad_monitorCounter, &bv, &bv );
|
||||
attr_merge_one( e, mi->mi_ad_monitorCounter, &bv, NULL );
|
||||
|
||||
mp = monitor_entrypriv_create();
|
||||
if ( mp == NULL ) {
|
||||
@ -133,7 +133,7 @@ monitor_subsys_conn_init(
|
||||
}
|
||||
|
||||
BER_BVSTR( &bv, "-1" );
|
||||
attr_merge_one( e, mi->mi_ad_monitorCounter, &bv, &bv );
|
||||
attr_merge_one( e, mi->mi_ad_monitorCounter, &bv, NULL );
|
||||
|
||||
mp = monitor_entrypriv_create();
|
||||
if ( mp == NULL ) {
|
||||
@ -172,7 +172,7 @@ monitor_subsys_conn_init(
|
||||
}
|
||||
|
||||
BER_BVSTR( &bv, "0" );
|
||||
attr_merge_one( e, mi->mi_ad_monitorCounter, &bv, &bv );
|
||||
attr_merge_one( e, mi->mi_ad_monitorCounter, &bv, NULL );
|
||||
|
||||
mp = monitor_entrypriv_create();
|
||||
if ( mp == NULL ) {
|
||||
@ -398,7 +398,7 @@ conn_create(
|
||||
attr_merge_one( e, mi->mi_ad_monitorConnectionNumber, &bv, NULL );
|
||||
|
||||
bv.bv_len = snprintf( buf, sizeof( buf ), "%ld", (long) c->c_protocol );
|
||||
attr_merge_one( e, mi->mi_ad_monitorConnectionProtocol, &bv, NULL );
|
||||
attr_merge_normalize_one( e, mi->mi_ad_monitorConnectionProtocol, &bv, NULL );
|
||||
|
||||
bv.bv_len = snprintf( buf, sizeof( buf ), "%ld", c->c_n_ops_received );
|
||||
attr_merge_one( e, mi->mi_ad_monitorConnectionOpsReceived, &bv, NULL );
|
||||
@ -428,31 +428,31 @@ conn_create(
|
||||
LDAP_STAILQ_EMPTY( &c->c_pending_ops ) ? "" : "p",
|
||||
connection_state2str( c->c_conn_state ),
|
||||
c->c_sasl_bind_in_progress ? "S" : "" );
|
||||
attr_merge_one( e, mi->mi_ad_monitorConnectionMask, &bv, NULL );
|
||||
attr_merge_normalize_one( e, mi->mi_ad_monitorConnectionMask, &bv, NULL );
|
||||
|
||||
attr_merge_one( e, mi->mi_ad_monitorConnectionAuthzDN,
|
||||
&c->c_dn, &c->c_ndn );
|
||||
|
||||
/* NOTE: client connections leave the c_peer_* fields NULL */
|
||||
assert( !BER_BVISNULL( &c->c_listener_url ) );
|
||||
attr_merge_one( e, mi->mi_ad_monitorConnectionListener,
|
||||
attr_merge_normalize_one( e, mi->mi_ad_monitorConnectionListener,
|
||||
&c->c_listener_url, NULL );
|
||||
|
||||
attr_merge_one( e, mi->mi_ad_monitorConnectionPeerDomain,
|
||||
attr_merge_normalize_one( e, mi->mi_ad_monitorConnectionPeerDomain,
|
||||
BER_BVISNULL( &c->c_peer_domain ) ? &bv_unknown : &c->c_peer_domain,
|
||||
NULL );
|
||||
|
||||
attr_merge_one( e, mi->mi_ad_monitorConnectionPeerAddress,
|
||||
attr_merge_normalize_one( e, mi->mi_ad_monitorConnectionPeerAddress,
|
||||
BER_BVISNULL( &c->c_peer_name ) ? &bv_unknown : &c->c_peer_name,
|
||||
NULL );
|
||||
|
||||
assert( !BER_BVISNULL( &c->c_sock_name ) );
|
||||
attr_merge_one( e, mi->mi_ad_monitorConnectionLocalAddress,
|
||||
attr_merge_normalize_one( e, mi->mi_ad_monitorConnectionLocalAddress,
|
||||
&c->c_sock_name, NULL );
|
||||
|
||||
attr_merge_one( e, mi->mi_ad_monitorConnectionStartTime, &bv2, NULL );
|
||||
attr_merge_normalize_one( e, mi->mi_ad_monitorConnectionStartTime, &bv2, NULL );
|
||||
|
||||
attr_merge_one( e, mi->mi_ad_monitorConnectionActivityTime, &bv3, NULL );
|
||||
attr_merge_normalize_one( e, mi->mi_ad_monitorConnectionActivityTime, &bv3, NULL );
|
||||
|
||||
mp = monitor_entrypriv_create();
|
||||
if ( mp == NULL ) {
|
||||
|
@ -66,7 +66,7 @@ init_readOnly( monitor_info_t *mi, Entry *e, slap_mask_t restrictops )
|
||||
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, tf );
|
||||
return attr_merge_one( e, mi->mi_ad_readOnly, tf, NULL );
|
||||
}
|
||||
|
||||
static int
|
||||
@ -162,9 +162,9 @@ monitor_subsys_database_init_one(
|
||||
rdnval, 0, 0 );
|
||||
} else {
|
||||
attr_merge( e, slap_schema.si_ad_namingContexts,
|
||||
be->be_suffix, be->be_nsuffix );
|
||||
be->be_suffix, NULL );
|
||||
attr_merge( e_database, slap_schema.si_ad_namingContexts,
|
||||
be->be_suffix, be->be_nsuffix );
|
||||
be->be_suffix, NULL );
|
||||
}
|
||||
}
|
||||
|
||||
@ -301,7 +301,7 @@ monitor_subsys_database_init_one(
|
||||
|
||||
} else {
|
||||
attr_merge( e_overlay, slap_schema.si_ad_namingContexts,
|
||||
be->be_suffix, be->be_nsuffix );
|
||||
be->be_suffix, NULL );
|
||||
}
|
||||
|
||||
mp_overlay = monitor_entrypriv_create();
|
||||
@ -405,9 +405,15 @@ monitor_back_register_database(
|
||||
if ( a ) {
|
||||
int j, k;
|
||||
|
||||
for ( j = 0; !BER_BVISNULL( &a->a_nvals[ j ] ); j++ ) {
|
||||
for ( k = 0; !BER_BVISNULL( &be->be_nsuffix[ k ] ); k++ ) {
|
||||
if ( dn_match( &a->a_nvals[ j ], &be->be_nsuffix[ k ] ) ) {
|
||||
/* FIXME: RFC 4512 defines namingContexts without an
|
||||
* equality matching rule, making comparisons
|
||||
* like this one tricky. We use a_vals and
|
||||
* be_suffix instead for now.
|
||||
*/
|
||||
for ( j = 0; !BER_BVISNULL( &a->a_vals[ j ] ); j++ ) {
|
||||
for ( k = 0; !BER_BVISNULL( &be->be_suffix[ k ] ); k++ ) {
|
||||
if ( dn_match( &a->a_vals[ j ],
|
||||
&be->be_suffix[ k ] ) ) {
|
||||
rc = 0;
|
||||
goto done;
|
||||
}
|
||||
|
@ -86,8 +86,8 @@ monitor_subsys_ops_init(
|
||||
return( -1 );
|
||||
}
|
||||
|
||||
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 );
|
||||
attr_merge_one( e_op, mi->mi_ad_monitorOpInitiated, &bv_zero, NULL );
|
||||
attr_merge_one( e_op, mi->mi_ad_monitorOpCompleted, &bv_zero, NULL );
|
||||
|
||||
mp = ( monitor_entry_t * )e_op->e_private;
|
||||
mp->mp_children = NULL;
|
||||
|
@ -104,7 +104,7 @@ monitor_subsys_rww_init(
|
||||
ber_dupbv( &monitor_rww[ i ].nrdn, &nrdn );
|
||||
|
||||
BER_BVSTR( &bv, "0" );
|
||||
attr_merge_normalize_one( e, mi->mi_ad_monitorCounter, &bv, NULL );
|
||||
attr_merge_one( e, mi->mi_ad_monitorCounter, &bv, NULL );
|
||||
|
||||
mp = monitor_entrypriv_create();
|
||||
if ( mp == NULL ) {
|
||||
|
@ -110,7 +110,7 @@ monitor_subsys_sent_init(
|
||||
ber_dupbv( &monitor_sent[ i ].nrdn, &nrdn );
|
||||
|
||||
BER_BVSTR( &bv, "0" );
|
||||
attr_merge_normalize_one( e, mi->mi_ad_monitorCounter, &bv, NULL );
|
||||
attr_merge_one( e, mi->mi_ad_monitorCounter, &bv, NULL );
|
||||
|
||||
mp = monitor_entrypriv_create();
|
||||
if ( mp == NULL ) {
|
||||
|
@ -277,8 +277,7 @@ fail:
|
||||
}
|
||||
for ( j = 0; be->be_suffix[j].bv_val != NULL; j++ ) {
|
||||
if( attr_merge_one( e, ad_namingContexts,
|
||||
&be->be_suffix[j],
|
||||
&be->be_nsuffix[0] ) )
|
||||
&be->be_suffix[j], NULL ) )
|
||||
{
|
||||
goto fail;
|
||||
}
|
||||
|
@ -684,6 +684,7 @@ static struct slap_schema_ad_map {
|
||||
"NAME 'monitorContext' "
|
||||
"DESC 'monitor context' "
|
||||
"SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 "
|
||||
"EQUALITY distinguishedNameMatch "
|
||||
"SINGLE-VALUE NO-USER-MODIFICATION "
|
||||
"USAGE dSAOperation )",
|
||||
rootDseAttribute, SLAP_AT_HIDE,
|
||||
@ -694,6 +695,7 @@ static struct slap_schema_ad_map {
|
||||
"NAME 'configContext' "
|
||||
"DESC 'config context' "
|
||||
"SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 "
|
||||
"EQUALITY distinguishedNameMatch "
|
||||
"SINGLE-VALUE NO-USER-MODIFICATION "
|
||||
"USAGE dSAOperation )",
|
||||
rootDseAttribute, SLAP_AT_HIDE,
|
||||
|
Loading…
Reference in New Issue
Block a user