dovecot-1.2: acl: When looking up ACL defaults, use global/local...
dovecot at dovecot.org
dovecot at dovecot.org
Sun Aug 16 03:42:31 EEST 2009
details: http://hg.dovecot.org/dovecot-1.2/rev/956d2f962e97
changeset: 9329:956d2f962e97
user: Timo Sirainen <tss at iki.fi>
date: Sat Aug 15 20:41:55 2009 -0400
description:
acl: When looking up ACL defaults, use global/local default files if they exist.
diffstat:
1 file changed, 10 insertions(+), 25 deletions(-)
src/plugins/acl/acl-api.c | 35 ++++++++++-------------------------
diffs (56 lines):
diff -r a1b1a8b6555e -r 956d2f962e97 src/plugins/acl/acl-api.c
--- a/src/plugins/acl/acl-api.c Fri Aug 14 18:46:44 2009 -0400
+++ b/src/plugins/acl/acl-api.c Sat Aug 15 20:41:55 2009 -0400
@@ -33,21 +33,13 @@ int acl_object_have_right(struct acl_obj
struct acl_backend *backend = aclobj->backend;
const struct acl_mask *have_mask;
- if (*aclobj->name == '\0') {
- /* we want to look up default rights */
+ if (backend->v.object_refresh_cache(aclobj) < 0)
+ return -1;
+
+ have_mask = acl_cache_get_my_rights(backend->cache, aclobj->name);
+ if (have_mask == NULL) {
if (acl_backend_get_default_rights(backend, &have_mask) < 0)
return -1;
- } else {
- if (backend->v.object_refresh_cache(aclobj) < 0)
- return -1;
-
- have_mask = acl_cache_get_my_rights(backend->cache,
- aclobj->name);
- if (have_mask == NULL) {
- if (acl_backend_get_default_rights(backend,
- &have_mask) < 0)
- return -1;
- }
}
return acl_cache_mask_isset(have_mask, right_idx);
@@ -91,20 +83,13 @@ static int acl_object_get_my_rights_real
struct acl_backend *backend = aclobj->backend;
const struct acl_mask *mask;
- if (*aclobj->name == '\0') {
- /* we want to look up default rights */
+ if (backend->v.object_refresh_cache(aclobj) < 0)
+ return -1;
+
+ mask = acl_cache_get_my_rights(backend->cache, aclobj->name);
+ if (mask == NULL) {
if (acl_backend_get_default_rights(backend, &mask) < 0)
return -1;
- } else {
- if (backend->v.object_refresh_cache(aclobj) < 0)
- return -1;
-
- mask = acl_cache_get_my_rights(backend->cache,
- aclobj->name);
- if (mask == NULL) {
- if (acl_backend_get_default_rights(backend, &mask) < 0)
- return -1;
- }
}
*rights_r = acl_backend_mask_get_names(backend, mask, pool);
More information about the dovecot-cvs
mailing list