]> git.sur5r.net Git - openldap/commitdiff
use bvmatch() instead of ber_bvcmp() when testing for match without ordering
authorPierangelo Masarati <ando@openldap.org>
Mon, 2 Sep 2002 19:39:06 +0000 (19:39 +0000)
committerPierangelo Masarati <ando@openldap.org>
Mon, 2 Sep 2002 19:39:06 +0000 (19:39 +0000)
servers/slapd/acl.c
servers/slapd/backend.c
servers/slapd/bind.c
servers/slapd/extended.c
servers/slapd/schema_prep.c

index fdb4cd1b6375ef892079f9eda457a4c10066b701..3db4fd14e7a8ef160146691494275374ffdffc9e 100644 (file)
@@ -605,17 +605,17 @@ acl_mask(
                         * user is bound as somebody in the same namespace as
                         * the entry, OR the given dn matches the dn pattern
                         */
-                       if ( ber_bvcmp( &b->a_dn_pat, &aci_bv_anonymous ) == 0 ) {
+                       if ( bvmatch( &b->a_dn_pat, &aci_bv_anonymous ) ) {
                                if ( op->o_ndn.bv_len != 0 ) {
                                        continue;
                                }
 
-                       } else if ( ber_bvcmp( &b->a_dn_pat, &aci_bv_users ) == 0 ) {
+                       } else if ( bvmatch( &b->a_dn_pat, &aci_bv_users ) ) {
                                if ( op->o_ndn.bv_len == 0 ) {
                                        continue;
                                }
 
-                       } else if ( ber_bvcmp( &b->a_dn_pat, &aci_bv_self ) == 0 ) {
+                       } else if ( bvmatch( &b->a_dn_pat, &aci_bv_self ) ) {
                                if ( op->o_ndn.bv_len == 0 ) {
                                        continue;
                                }
index b5f3fe0440bcf93671dd8308240a152f94aaddd0..987eb8832c67d62f7126888403fc0df32a47f4b0 100644 (file)
@@ -585,7 +585,7 @@ be_issuffix(
        int     i;
 
        for ( i = 0; be->be_nsuffix != NULL && be->be_nsuffix[i].bv_val != NULL; i++ ) {
-               if ( ber_bvcmp( &be->be_nsuffix[i], bvsuffix ) == 0 ) {
+               if ( bvmatch( &be->be_nsuffix[i], bvsuffix ) ) {
                        return( 1 );
                }
        }
@@ -821,7 +821,7 @@ backend_check_restrictions(
 
                {
                        struct berval bv = BER_BVC( LDAP_EXOP_START_TLS );
-                       if( ber_bvcmp( opdata, &bv ) == 0 ) {
+                       if( bvmatch( opdata, &bv ) ) {
                                session++;
                                starttls++;
                                break;
@@ -830,7 +830,7 @@ backend_check_restrictions(
 
                {
                        struct berval bv = BER_BVC( LDAP_EXOP_X_WHO_AM_I );
-                       if( ber_bvcmp( opdata, &bv ) == 0 ) {
+                       if( bvmatch( opdata, &bv ) ) {
                                break;
                        }
                }
index e27873b8d1ac89c055b84a751c2f0e4fe568c987..646b72f657ceec50b444242951c51e4818898a6e 100644 (file)
@@ -277,7 +277,7 @@ do_bind(
 
                ldap_pvt_thread_mutex_lock( &conn->c_mutex );
                if ( conn->c_sasl_bind_in_progress ) {
-                       if((ber_bvcmp(&conn->c_sasl_bind_mech, &mech) != 0)) {
+                       if( !bvmatch( &conn->c_sasl_bind_mech, &mech ) ) {
                                /* mechanism changed between bind steps */
                                slap_sasl_reset(conn);
                        }
index 2d315f36ce1a5b12dbb01bc6952ecf4afb1bed53..0da22bdfbbfdc46db73a3fb9282832524ba66a81 100644 (file)
@@ -288,7 +288,7 @@ find_extop( struct extop_list *list, struct berval *oid )
        struct extop_list *ext;
 
        for (ext = list; ext; ext = ext->next) {
-               if (ber_bvcmp(&ext->oid, oid) == 0)
+               if (bvmatch(&ext->oid, oid))
                        return(ext);
        }
        return(NULL);
index 85fc05ddf3e3fba08735479346cd435e4ce69cc2..25fb3ff286537b2045e26cda54fdbbf40b648be2 100644 (file)
@@ -177,7 +177,7 @@ static int objectSubClassIndexer(
                                        k, ocvalues[k].bv_val, sup->soc_cname.bv_val );
 #endif
 #endif
-                               if( ber_bvcmp( &ocvalues[k], &sup->soc_cname ) == 0 ) {
+                               if( bvmatch( &ocvalues[k], &sup->soc_cname ) ) {
                                        found++;
                                        break;
                                }