]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
acl: Don't give admin rights to all owner mailboxes.
authorTimo Sirainen <tss@iki.fi>
Mon, 25 Jan 2010 18:40:25 +0000 (20:40 +0200)
committerTimo Sirainen <tss@iki.fi>
Mon, 25 Jan 2010 18:40:25 +0000 (20:40 +0200)
The SETACL IMAP command should already prevent this. If this situation is
created by modifying dovecot-acl file manually, it's probably intentional.

--HG--
branch : HEAD

src/plugins/acl/acl-backend-vfile.c

index f91fd91d93de22fca79d122588107a57ed70dd44..a8fb68539027daeee30d8124092edd78292c6e0b 100644 (file)
@@ -756,10 +756,9 @@ static void apply_owner_rights(struct acl_object *_aclobj)
 
 static void acl_backend_vfile_cache_rebuild(struct acl_object_vfile *aclobj)
 {
-       static const char *const admin_rights[] = { MAIL_ACL_ADMIN, NULL };
        struct mail_namespace *ns;
        struct acl_object *_aclobj = &aclobj->aclobj;
-       struct acl_rights_update ru, ru2;
+       struct acl_rights_update ru;
        enum acl_modify_mode add_mode;
        const struct acl_rights *rights;
        unsigned int i, count;
@@ -771,11 +770,6 @@ static void acl_backend_vfile_cache_rebuild(struct acl_object_vfile *aclobj)
                return;
 
        ns = mailbox_list_get_namespace(_aclobj->backend->list);
-       memset(&ru2, 0, sizeof(ru2));
-       ru2.modify_mode = ACL_MODIFY_MODE_ADD;
-       ru2.rights.id_type = ACL_ID_OWNER;
-       ru2.rights.rights = admin_rights;
-
        owner_applied = ns->type != NAMESPACE_PRIVATE;
 
        memset(&ru, 0, sizeof(ru));
@@ -806,20 +800,11 @@ static void acl_backend_vfile_cache_rebuild(struct acl_object_vfile *aclobj)
                           can't mess things up via them */
                        first_global = FALSE;
                        ru.neg_modify_mode = ACL_MODIFY_MODE_REPLACE;
-
-                       if (ns->type == NAMESPACE_PRIVATE) {
-                               /* make sure owner has admin rights
-                                  (at least before global ACLs are applied) */
-                               acl_cache_update(_aclobj->backend->cache,
-                                                _aclobj->name, &ru2);
-                       }
                }
                acl_cache_update(_aclobj->backend->cache, _aclobj->name, &ru);
        }
        if (!owner_applied && count > 0)
                apply_owner_rights(_aclobj);
-       else if (first_global && ns->type == NAMESPACE_PRIVATE)
-               acl_cache_update(_aclobj->backend->cache, _aclobj->name, &ru2);
 }
 
 static int acl_backend_vfile_object_refresh_cache(struct acl_object *_aclobj)