]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/acl.c
fix previous commit
[openldap] / servers / slapd / acl.c
index c4ac1d9acf2c981885d7a75d6e4c504054e026fc..e71d14fcca2ef5059df69accce86e1d2bcaa2b4a 100644 (file)
@@ -303,13 +303,13 @@ slap_access_allowed(
                                ( state->as_recorded & ACL_STATE_RECORDED_NV ) )
                        {
                                Debug( LDAP_DEBUG_ACL,
-                                       "slap_access_allowed: result from state (%s)\n",
+                                       "=> slap_access_allowed: result from state (%s)\n",
                                        attr, 0, 0 );
                                ret = state->as_result;
                                goto done;
                        } else {
                                Debug( LDAP_DEBUG_ACL,
-                                       "slap_access_allowed: no res from state (%s)\n",
+                                       "=> slap_access_allowed: no res from state (%s)\n",
                                        attr, 0, 0 );
                        }
                }
@@ -442,10 +442,15 @@ access_allowed_mask(
        assert( op->o_bd != NULL );
 
        /* this is enforced in backend_add() */
-       assert( op->o_bd->bd_info->bi_access_allowed );
+       if ( op->o_bd->bd_info->bi_access_allowed ) {
+               /* delegate to backend */
+               ret = op->o_bd->bd_info->bi_access_allowed( op, e, desc, val, access, state, &mask );
+
+       } else {
+               /* use default */
+               ret = slap_access_allowed( op, e, desc, val, access, state, &mask );
+       }
 
-       /* delegate to backend */
-       ret = op->o_bd->bd_info->bi_access_allowed( op, e, desc, val, access, state, &mask );
        if ( !ret ) {
                if ( ACL_IS_INVALID( mask ) ) {
                        Debug( LDAP_DEBUG_ACL,
@@ -915,11 +920,11 @@ acl_get(
                                        if ( vdnlen < patlen )
                                                continue;
        
-                                       if ( a->acl_dn_style == ACL_STYLE_BASE ) {
+                                       if ( a->acl_attrval_style == ACL_STYLE_BASE ) {
                                                if ( vdnlen > patlen )
                                                        continue;
        
-                                       } else if ( a->acl_dn_style == ACL_STYLE_ONE ) {
+                                       } else if ( a->acl_attrval_style == ACL_STYLE_ONE ) {
                                                int rdnlen = -1;
        
                                                if ( !DN_SEPARATOR( val->bv_val[vdnlen - patlen - 1] ) )
@@ -929,11 +934,11 @@ acl_get(
                                                if ( rdnlen != vdnlen - patlen - 1 )
                                                        continue;
        
-                                       } else if ( a->acl_dn_style == ACL_STYLE_SUBTREE ) {
+                                       } else if ( a->acl_attrval_style == ACL_STYLE_SUBTREE ) {
                                                if ( vdnlen > patlen && !DN_SEPARATOR( val->bv_val[vdnlen - patlen - 1] ) )
                                                        continue;
        
-                                       } else if ( a->acl_dn_style == ACL_STYLE_CHILDREN ) {
+                                       } else if ( a->acl_attrval_style == ACL_STYLE_CHILDREN ) {
                                                if ( vdnlen <= patlen )
                                                        continue;