]> git.sur5r.net Git - openldap/commitdiff
ITS#5540 sean-burford-monitor-normalize-unified-080706.patch
authorHoward Chu <hyc@openldap.org>
Tue, 27 Jan 2009 10:05:55 +0000 (10:05 +0000)
committerHoward Chu <hyc@openldap.org>
Tue, 27 Jan 2009 10:05:55 +0000 (10:05 +0000)
servers/slapd/back-monitor/conn.c
servers/slapd/back-monitor/database.c
servers/slapd/back-monitor/operation.c
servers/slapd/back-monitor/rww.c
servers/slapd/back-monitor/sent.c
servers/slapd/root_dse.c
servers/slapd/schema_prep.c

index 064aeb28e658cfda2902712bcea601d43cfa022d..d962a9fe4cd5be0de87998db4cbcb175908a61ec 100644 (file)
@@ -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 ) {
index 3b43f16c29249f28ce10b9e8875e7a17cd2be950..eb75a340f08eff109d0ec119c264fed33f0c14e2 100644 (file)
@@ -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;
                                        }
index 5605183d7d2b823261ac42b2114b2048112853e6..6f07777a4b89aab1cb2a73a370bf2937adb75224 100644 (file)
@@ -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;
index 9cdb4058feea631690ff82ca96deef4d7010fdc1..114d534002755934487747781d9dbc5089a13330 100644 (file)
@@ -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 ) {
index 856920d95821be6c9b17eed053b3885c6a461673..50b526ce2e79752d12f9044208f5b851df4d8bdb 100644 (file)
@@ -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 ) {
index 4871006693076253dbcc968f2f66c06fce4a4117..8b7322122e6f0cb82155bf9970b410e9aa704c4c 100644 (file)
@@ -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;
                        }
index 310c5464ad7d8d18f4a0faaee3866228ec7c7131..800c434884b19b573df79940e61626375d242c41 100644 (file)
@@ -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,