#include "slap.h"
#include "sets.h"
+#include "lber_pvt.h"
/*
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 );
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;
}
* user is bound as somebody in the same namespace as
* the entry, OR the given dn matches the dn pattern
*/
- if ( ber_cmp( &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_cmp( &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_cmp( &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;
}
}
} else if ( b->a_dn_style == ACL_STYLE_REGEX ) {
- if ( b->a_dn_pat.bv_len != 1 ||
- ber_charcmp( &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 );
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 );
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;
}
if ( strcmp( b->a_dn_pat.bv_val, op->o_ndn.bv_val + odnlen - patlen ) != 0 )
continue;
-
}
}
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 ) )
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 ) )
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 ) )
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 ) )
b->a_group_oc, b->a_group_at);
if ( ndn.bv_val )
free( ndn.bv_val );
- if ( rc != 0 )
- {
+ if ( rc != 0 ) {
continue;
}
}
if (aci_get_part(&bv, 0, '=', &left) < 0
|| aci_get_part(&bv, 1, '=', &right) < 0)
{
- if (ber_casecmp(attr, &bv) == 0)
+ if (ber_bvstrcasecmp(attr, &bv) == 0)
return(1);
} else if (val == NULL) {
- if (ber_casecmp(attr, &left) == 0)
+ if (ber_bvstrcasecmp(attr, &left) == 0)
return(1);
} else {
- if (ber_casecmp(attr, &left) == 0) {
+ if (ber_bvstrcasecmp(attr, &left) == 0) {
/* this is experimental code that implements a
* simple (prefix) match of the attribute value.
* the ACI draft does not provide for aci's that
if (aci_get_part(&right, 0, '*', &left) < 0
|| right.bv_len <= left.bv_len)
{
- if (ber_casecmp(val, &right) == 0)
+ if (ber_bvstrcasecmp(val, &right) == 0)
return(1);
} else if (val->bv_len >= left.bv_len) {
if (strncasecmp( val->bv_val, left.bv_val, left.bv_len ) == 0)
int i, found;
if (attr == NULL || attr->bv_len == 0
- || ber_casecmp( attr, &aci_bv_entry ) == 0) {
+ || ber_bvstrcasecmp( attr, &aci_bv_entry ) == 0) {
attr = &aci_bv_br_entry;
}
for (i = 0; aci_get_part(list, i, '$', &perm) >= 0; i++) {
if (aci_get_part(&perm, 0, ';', &actn) < 0)
continue;
- if (ber_casecmp( &aci_bv_grant, &actn ) == 0) {
+ if (ber_bvstrcasecmp( &aci_bv_grant, &actn ) == 0) {
mask = grant;
- } else if (ber_casecmp( &aci_bv_deny, &actn ) == 0) {
+ } else if (ber_bvstrcasecmp( &aci_bv_deny, &actn ) == 0) {
mask = deny;
} else {
continue;
/* check that the scope is "entry" */
if (aci_get_part(aci, 1, '#', &bv) < 0
- || ber_casecmp( &aci_bv_entry, &bv ) != 0)
+ || ber_bvstrcasecmp( &aci_bv_entry, &bv ) != 0)
{
return(0);
}
if (aci_get_part(aci, 4, '#', &sdn) < 0)
return(0);
- if (ber_casecmp( &aci_bv_access_id, &bv ) == 0) {
+ if (ber_bvstrcasecmp( &aci_bv_access_id, &bv ) == 0) {
struct berval ndn;
rc = 1;
if ( dnNormalize2(NULL, &sdn, &ndn) == LDAP_SUCCESS ) {
return(rc);
}
- if (ber_casecmp( &aci_bv_self, &bv ) == 0) {
+ if (ber_bvstrcasecmp( &aci_bv_self, &bv ) == 0) {
if (dn_match(&op->o_ndn, &e->e_nname))
return(1);
- } else if (ber_casecmp( &aci_bv_dnattr, &bv ) == 0) {
+ } else if (ber_bvstrcasecmp( &aci_bv_dnattr, &bv ) == 0) {
Attribute *at;
AttributeDescription *ad = NULL;
const char *text;
return rc;
- } else if (ber_casecmp( &aci_bv_group, &bv ) == 0) {
+ } else if (ber_bvstrcasecmp( &aci_bv_group, &bv ) == 0) {
if (aci_group_member(&sdn, &GroupClass, &GroupAttr, be, e, conn, op, matches))
return(1);
- } else if (ber_casecmp( &aci_bv_role, &bv ) == 0) {
+ } else if (ber_bvstrcasecmp( &aci_bv_role, &bv ) == 0) {
if (aci_group_member(&sdn, &RoleClass, &RoleAttr, be, e, conn, op, matches))
return(1);
- } else if (ber_casecmp( &aci_bv_set, &bv ) == 0) {
+ } else if (ber_bvstrcasecmp( &aci_bv_set, &bv ) == 0) {
if (aci_match_set(&sdn, be, e, conn, op, 0))
return(1);
- } else if (ber_casecmp( &aci_bv_set_ref, &bv ) == 0) {
+ } else if (ber_bvstrcasecmp( &aci_bv_set_ref, &bv ) == 0) {
if (aci_match_set(&sdn, be, e, conn, op, 1))
return(1);