]> git.sur5r.net Git - openldap/commitdiff
Fix up last commit
authorKurt Zeilenga <kurt@openldap.org>
Wed, 16 Jan 2002 19:03:31 +0000 (19:03 +0000)
committerKurt Zeilenga <kurt@openldap.org>
Wed, 16 Jan 2002 19:03:31 +0000 (19:03 +0000)
include/lber_pvt.h
servers/slapd/acl.c

index 836b1be4f16387230a38494457cb88b1177ec002..d3affbb3b0e6fe92849d5e1281398ed9ca113f5a 100644 (file)
@@ -78,7 +78,7 @@ ber_pvt_socket_set_nonblock LDAP_P(( ber_socket_t sd, int nb ));
                        ? 1 : strncasecmp((v1)->bv_val, (v2)->bv_val, (v1)->bv_len) ))
 
 #define ber_bvccmp(v1,c) \
-       ((v1)->bv_len == 1 ? (v1)->bv_val[0] == c : 0)
+       ( (v1)->bv_len == 1 && (v1)->bv_val[0] == c )
 
 LDAP_END_DECL
 
index 30baf87fba89445328250b3e82b6c3d998fcefa8..3df2dd09635499ce97bb3ff31e6c6165c4b3c9ba 100644 (file)
@@ -532,17 +532,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 ( ber_bvstrcmp( &b->a_dn_pat, &aci_bv_anonymous ) == 0 ) {
                                if ( op->o_ndn.bv_len != 0 ) {
                                        continue;
                                }
 
-                       } else if ( ber_bvcmp( &b->a_dn_pat, &aci_bv_users ) == 0 ) {
+                       } else if ( ber_bvstrcmp( &b->a_dn_pat, &aci_bv_users ) == 0 ) {
                                if ( op->o_ndn.bv_len == 0 ) {
                                        continue;
                                }
 
-                       } else if ( ber_bvcmp( &b->a_dn_pat, &aci_bv_self ) == 0 ) {
+                       } else if ( ber_bvstrcmp( &b->a_dn_pat, &aci_bv_self ) == 0 ) {
                                if ( op->o_ndn.bv_len == 0 ) {
                                        continue;
                                }
@@ -552,8 +552,7 @@ acl_mask(
                                }
 
                        } else if ( b->a_dn_style == ACL_STYLE_REGEX ) {
-                               if ( b->a_dn_pat.bv_len != 1 || 
-                                   ber_bvccmp( &b->a_dn_pat, '*' ) != 0 ) {
+                               if ( ber_bvccmp( &b->a_dn_pat, '*' ) == 0 ) {
                                        int ret = regex_matches( b->a_dn_pat.bv_val,
                                                op->o_ndn.bv_val, e->e_ndn, matches );