]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
acl: Add acl_globals_only setting
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Mon, 19 Jun 2017 08:30:27 +0000 (11:30 +0300)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Mon, 19 Jun 2017 08:30:27 +0000 (11:30 +0300)
The local dovecot-acl files aren't even attempted to be looked up if this is
set. This is mainly useful to avoid unnecessary stat()s to dovecot-acl files
that never exist.

src/plugins/acl/acl-api-private.h
src/plugins/acl/acl-backend-vfile.c
src/plugins/acl/acl-backend.c

index e1aeac94f07adf3f61b411f985707f95a3ce34e5..6859779df31741338775bdb02bbd5e2d5d6e86f3 100644 (file)
@@ -59,6 +59,7 @@ struct acl_backend {
 
        bool owner:1;
        bool debug:1;
+       bool globals_only:1;
 };
 
 struct acl_mailbox_list_context {
index 9fb1798b60150cd5f746c484d4d0896e14dbdeda..5809d098766d5d88614d239c6276e6ab9fb1598d 100644 (file)
@@ -112,6 +112,9 @@ acl_backend_vfile_get_local_dir(struct acl_backend *backend,
        if (*name == '\0')
                name = NULL;
 
+       if (backend->globals_only)
+               return NULL;
+
        /* ACL files are very important. try to keep them among the main
           mail files. that's not possible though with a) if the mailbox is
           a file or b) if the mailbox path doesn't point to filesystem. */
index ab22b67587addee9d9a281e31725739fb54dd8c6..cece50d17c827066b53069b63d24686cf156be35 100644 (file)
@@ -175,6 +175,8 @@ struct acl_object *acl_backend_get_default_object(struct acl_backend *backend)
                    ns->type == MAIL_NAMESPACE_TYPE_SHARED)
                        default_name = "INBOX";
        }
+       backend->globals_only =
+               mail_user_plugin_getenv_bool(user, "acl_globals_only");
        backend->default_aclobj =
                acl_object_init_from_name(backend, default_name);
        return backend->default_aclobj;