From: Howard Chu Date: Tue, 27 Jan 2009 10:05:55 +0000 (+0000) Subject: ITS#5540 sean-burford-monitor-normalize-unified-080706.patch X-Git-Tag: ACLCHECK_0~932 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=fb6dfb852d558b2fd775050079569758b61a066c;p=openldap ITS#5540 sean-burford-monitor-normalize-unified-080706.patch --- diff --git a/servers/slapd/back-monitor/conn.c b/servers/slapd/back-monitor/conn.c index 064aeb28e6..d962a9fe4c 100644 --- a/servers/slapd/back-monitor/conn.c +++ b/servers/slapd/back-monitor/conn.c @@ -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 ) { diff --git a/servers/slapd/back-monitor/database.c b/servers/slapd/back-monitor/database.c index 3b43f16c29..eb75a340f0 100644 --- a/servers/slapd/back-monitor/database.c +++ b/servers/slapd/back-monitor/database.c @@ -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; } diff --git a/servers/slapd/back-monitor/operation.c b/servers/slapd/back-monitor/operation.c index 5605183d7d..6f07777a4b 100644 --- a/servers/slapd/back-monitor/operation.c +++ b/servers/slapd/back-monitor/operation.c @@ -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; diff --git a/servers/slapd/back-monitor/rww.c b/servers/slapd/back-monitor/rww.c index 9cdb4058fe..114d534002 100644 --- a/servers/slapd/back-monitor/rww.c +++ b/servers/slapd/back-monitor/rww.c @@ -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 ) { diff --git a/servers/slapd/back-monitor/sent.c b/servers/slapd/back-monitor/sent.c index 856920d958..50b526ce2e 100644 --- a/servers/slapd/back-monitor/sent.c +++ b/servers/slapd/back-monitor/sent.c @@ -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 ) { diff --git a/servers/slapd/root_dse.c b/servers/slapd/root_dse.c index 4871006693..8b7322122e 100644 --- a/servers/slapd/root_dse.c +++ b/servers/slapd/root_dse.c @@ -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; } diff --git a/servers/slapd/schema_prep.c b/servers/slapd/schema_prep.c index 310c5464ad..800c434884 100644 --- a/servers/slapd/schema_prep.c +++ b/servers/slapd/schema_prep.c @@ -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,