]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/acl.c
Fix previous commit
[openldap] / servers / slapd / acl.c
index 3df2dd09635499ce97bb3ff31e6c6165c4b3c9ba..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;
                                }
 
@@ -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_bvstrcmp( &b->a_dn_pat, &aci_bv_anonymous ) == 0 ) {
+                       if ( ber_bvcmp( &b->a_dn_pat, &aci_bv_anonymous ) == 0 ) {
                                if ( op->o_ndn.bv_len != 0 ) {
                                        continue;
                                }
 
-                       } else if ( ber_bvstrcmp( &b->a_dn_pat, &aci_bv_users ) == 0 ) {
+                       } else if ( ber_bvcmp( &b->a_dn_pat, &aci_bv_users ) == 0 ) {
                                if ( op->o_ndn.bv_len == 0 ) {
                                        continue;
                                }
 
-                       } else if ( ber_bvstrcmp( &b->a_dn_pat, &aci_bv_self ) == 0 ) {
+                       } else if ( ber_bvcmp( &b->a_dn_pat, &aci_bv_self ) == 0 ) {
                                if ( op->o_ndn.bv_len == 0 ) {
                                        continue;
                                }
@@ -581,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 );
@@ -589,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;
                                }
 
@@ -614,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 ) ) 
@@ -637,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 ) ) 
@@ -660,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 ) ) 
@@ -683,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 ) ) 
@@ -794,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;
                        }
                }