]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/acl.c
Fix previous commit
[openldap] / servers / slapd / acl.c
index 30baf87fba89445328250b3e82b6c3d998fcefa8..6feaa84a493c2ec97ff3f9ca27de0c48fd703b61 100644 (file)
@@ -379,7 +379,7 @@ acl_get(
                                        if ( dnlen <= patlen )
                                                continue;
 
-                                       if ( !DN_SEPARATOR( e->e_ndn[dnlen - patlen - 1] ) || DN_ESCAPE( e->e_ndn[dnlen - patlen - 2] ) )
+                                       if ( !DN_SEPARATOR( e->e_ndn[dnlen - patlen - 1] ) )
                                                continue;
 
                                        rdnlen = dn_rdnlen( NULL, &e->e_nname );
@@ -387,13 +387,13 @@ acl_get(
                                                continue;
 
                                } else if ( a->acl_dn_style == ACL_STYLE_SUBTREE ) {
-                                       if ( dnlen > patlen && ( !DN_SEPARATOR( e->e_ndn[dnlen - patlen - 1] ) || DN_ESCAPE( e->e_ndn[dnlen - patlen - 2] ) ) )
+                                       if ( dnlen > patlen && !DN_SEPARATOR( e->e_ndn[dnlen - patlen - 1] ) )
                                                continue;
 
                                } else if ( a->acl_dn_style == ACL_STYLE_CHILDREN ) {
                                        if ( dnlen <= patlen )
                                                continue;
-                                       if ( !DN_SEPARATOR( e->e_ndn[dnlen - patlen - 1] ) || DN_ESCAPE( e->e_ndn[dnlen - patlen - 2] ) )
+                                       if ( !DN_SEPARATOR( e->e_ndn[dnlen - patlen - 1] ) )
                                                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 );
 
@@ -582,7 +581,7 @@ acl_mask(
                                        if ( odnlen <= patlen )
                                                continue;
 
-                                       if ( !DN_SEPARATOR( op->o_ndn.bv_val[odnlen - patlen - 1] ) || DN_ESCAPE( op->o_ndn.bv_val[odnlen - patlen - 2] ) )
+                                       if ( !DN_SEPARATOR( op->o_ndn.bv_val[odnlen - patlen - 1] ) )
                                                continue;
 
                                        rdnlen = dn_rdnlen( NULL, &op->o_ndn );
@@ -590,13 +589,13 @@ acl_mask(
                                                continue;
 
                                } else if ( b->a_dn_style == ACL_STYLE_SUBTREE ) {
-                                       if ( odnlen > patlen && ( !DN_SEPARATOR( op->o_ndn.bv_val[odnlen - patlen - 1] ) || DN_ESCAPE( op->o_ndn.bv_val[odnlen - patlen - 2] ) ) )
+                                       if ( odnlen > patlen && !DN_SEPARATOR( op->o_ndn.bv_val[odnlen - patlen - 1] ) )
                                                continue;
 
                                } else if ( b->a_dn_style == ACL_STYLE_CHILDREN ) {
                                        if ( odnlen <= patlen )
                                                continue;
-                                       if ( !DN_SEPARATOR( op->o_ndn.bv_val[odnlen - patlen - 1] ) || DN_ESCAPE( op->o_ndn.bv_val[odnlen - patlen - 2] ) )
+                                       if ( !DN_SEPARATOR( op->o_ndn.bv_val[odnlen - patlen - 1] ) )
                                                continue;
                                }
 
@@ -615,7 +614,7 @@ acl_mask(
                                b->a_sockurl_pat, 0, 0 );
 #endif
 
-                       if ( strcmp( b->a_sockurl_pat, "*" ) != 0) {
+                       if ( ber_strccmp( b->a_sockurl_pat, '*' ) != 0) {
                                if ( b->a_sockurl_style == ACL_STYLE_REGEX) {
                                        if (!regex_matches( b->a_sockurl_pat, conn->c_listener_url,
                                                        e->e_ndn, matches ) ) 
@@ -638,7 +637,7 @@ acl_mask(
                        Debug( LDAP_DEBUG_ACL, "<= check a_domain_pat: %s\n",
                                b->a_domain_pat, 0, 0 );
 #endif
-                       if ( strcmp( b->a_domain_pat, "*" ) != 0) {
+                       if ( ber_strccmp( b->a_domain_pat, '*' ) != 0) {
                                if ( b->a_domain_style == ACL_STYLE_REGEX) {
                                        if (!regex_matches( b->a_domain_pat, conn->c_peer_domain,
                                                        e->e_ndn, matches ) ) 
@@ -661,7 +660,7 @@ acl_mask(
                        Debug( LDAP_DEBUG_ACL, "<= check a_peername_path: %s\n",
                                b->a_peername_pat, 0, 0 );
 #endif
-                       if ( strcmp( b->a_peername_pat, "*" ) != 0) {
+                       if ( ber_strccmp( b->a_peername_pat, '*' ) != 0) {
                                if ( b->a_peername_style == ACL_STYLE_REGEX) {
                                        if (!regex_matches( b->a_peername_pat, conn->c_peer_name,
                                                        e->e_ndn, matches ) ) 
@@ -684,7 +683,7 @@ acl_mask(
                        Debug( LDAP_DEBUG_ACL, "<= check a_sockname_path: %s\n",
                                b->a_sockname_pat, 0, 0 );
 #endif
-                       if ( strcmp( b->a_sockname_pat, "*" ) != 0) {
+                       if ( ber_strccmp( b->a_sockname_pat, '*' ) != 0) {
                                if ( b->a_sockname_style == ACL_STYLE_REGEX) {
                                        if (!regex_matches( b->a_sockname_pat, conn->c_sock_name,
                                                        e->e_ndn, matches ) ) 
@@ -795,8 +794,7 @@ acl_mask(
                                b->a_group_oc, b->a_group_at);
                        if ( ndn.bv_val )
                                free( ndn.bv_val );
-                       if ( rc != 0 )
-                       {
+                       if ( rc != 0 ) {
                                continue;
                        }
                }