]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
Split NAMESPACE_FLAG_INTERNAL into distinct _NOQUOTA and _NOACL flags.
authorTimo Sirainen <tss@iki.fi>
Tue, 26 May 2009 03:41:12 +0000 (23:41 -0400)
committerTimo Sirainen <tss@iki.fi>
Tue, 26 May 2009 03:41:12 +0000 (23:41 -0400)
--HG--
branch : HEAD

src/lda/main.c
src/lib-storage/mail-namespace.c
src/lib-storage/mail-namespace.h
src/lmtp/client.c
src/plugins/acl/acl-lookup-dict.c
src/plugins/acl/acl-mailbox-list.c
src/plugins/acl/acl-storage.c
src/plugins/lazy-expunge/lazy-expunge-plugin.c
src/plugins/quota/quota-storage.c

index 4ae61a022b43653971572b6e33f4cf18db50a406..7f021fcaf90f02a48cb837599d8b1ebc0b3b4ef2 100644 (file)
@@ -410,7 +410,7 @@ int main(int argc, char *argv[])
        raw_ns_set.location = "/tmp";
 
        raw_ns = mail_namespaces_init_empty(raw_mail_user);
-       raw_ns->flags |= NAMESPACE_FLAG_INTERNAL;
+       raw_ns->flags |= NAMESPACE_FLAG_NOQUOTA | NAMESPACE_FLAG_NOACL;
        raw_ns->set = &raw_ns_set;
        if (mail_storage_create(raw_ns, "raw", 0, &errstr) < 0)
                i_fatal("Couldn't create internal raw storage: %s", errstr);
index 78a402714016ce91621d9bb705083fbe585d7e36..f32a0ce1fac9422170e46d6de0d54141d3e51cd7 100644 (file)
@@ -120,7 +120,7 @@ namespace_add(struct mail_user *user,
 
        if (ns->type == NAMESPACE_SHARED && strchr(ns->prefix, '%') != NULL) {
                /* dynamic shared namespace */
-               ns->flags |= NAMESPACE_FLAG_INTERNAL;
+               ns->flags |= NAMESPACE_FLAG_NOQUOTA | NAMESPACE_FLAG_NOACL;
                driver = "shared";
        } else {
                driver = NULL;
index f57ba7e727dd1b9e5b1ed39ba4fd6d61c5aacd06..b95c454879daff10cf1b0e30f5ba516635592edd 100644 (file)
@@ -21,15 +21,17 @@ enum namespace_flags {
        /* Namespace uses its own subscriptions. */
        NAMESPACE_FLAG_SUBSCRIPTIONS    = 0x10,
 
-       /* Namespace is created for internal use only. */
-       NAMESPACE_FLAG_INTERNAL         = 0x1000,
        /* Namespace was created automatically (for shared mailboxes) */
-       NAMESPACE_FLAG_AUTOCREATED      = 0x2000,
+       NAMESPACE_FLAG_AUTOCREATED      = 0x1000,
        /* Namespace has at least some usable mailboxes. Autocreated namespaces
           that don't have usable mailboxes may be removed automatically. */
-       NAMESPACE_FLAG_USABLE           = 0x4000,
+       NAMESPACE_FLAG_USABLE           = 0x2000,
        /* Automatically created namespace for a user that doesn't exist. */
-       NAMESPACE_FLAG_UNUSABLE         = 0x8000
+       NAMESPACE_FLAG_UNUSABLE         = 0x4000,
+       /* Don't track quota for this namespace */
+       NAMESPACE_FLAG_NOQUOTA          = 0x8000,
+       /* Don't enforce ACLs for this namespace */
+       NAMESPACE_FLAG_NOACL            = 0x10000
 };
 
 struct mail_namespace {
index a11e3c2b8b50c8cca83ef5852e45f000b5bc9234..6ee08a64d0fa696c0664d67d12bb5c9da77b8b60 100644 (file)
@@ -134,7 +134,7 @@ static void client_raw_user_create(struct client *client)
        raw_ns_set.location = "/tmp";
 
        raw_ns = mail_namespaces_init_empty(client->raw_mail_user);
-       raw_ns->flags |= NAMESPACE_FLAG_INTERNAL;
+       raw_ns->flags |= NAMESPACE_FLAG_NOQUOTA | NAMESPACE_FLAG_NOACL;
        raw_ns->set = &raw_ns_set;
        if (mail_storage_create(raw_ns, "raw", 0, &error) < 0)
                i_fatal("Couldn't create internal raw storage: %s", error);
index 3e5b871ae40290a70a3fa4dcda61c2738187ef15..acba4e09467be650634debe7ba682c8aec602d4b 100644 (file)
@@ -100,7 +100,7 @@ static int acl_lookup_dict_rebuild_add_backend(struct mail_namespace *ns,
        string_t *id;
        int ret, ret2 = 0;
 
-       if ((ns->flags & NAMESPACE_FLAG_INTERNAL) != 0 || ns->owner == NULL)
+       if ((ns->flags & NAMESPACE_FLAG_NOACL) != 0 || ns->owner == NULL)
                return 0;
 
        id = t_str_new(128);
index d0405a868dbdfba07ffa14d14aa94582151625a8..ea221838888d23928bce5881817d186d13f52b88 100644 (file)
@@ -568,7 +568,7 @@ void acl_mailbox_list_created(struct mailbox_list *list)
 
        if (auser == NULL) {
                /* ACLs disabled for this user */
-       } else if ((list->ns->flags & NAMESPACE_FLAG_INTERNAL) != 0) {
+       } else if ((list->ns->flags & NAMESPACE_FLAG_NOACL) != 0) {
                /* no ACL checks for internal namespaces (lda, shared) */
                if (list->ns->type == NAMESPACE_SHARED)
                        acl_mailbox_list_init_shared(list);
index effabea65625892ff26a2288097d1af3dd910962..626d1c48b3d01691ce0c5fd98209b16d51ccef61 100644 (file)
@@ -175,7 +175,7 @@ void acl_mail_storage_created(struct mail_storage *storage)
 
        if (auser == NULL) {
                /* ACLs disabled for this user */
-       } else if ((storage->ns->flags & NAMESPACE_FLAG_INTERNAL) != 0) {
+       } else if ((storage->ns->flags & NAMESPACE_FLAG_NOACL) != 0) {
                /* no ACL checks for internal namespaces (lda) */
        } else {
                astorage = p_new(storage->pool, struct acl_mail_storage, 1);
index 014a8e249035536b8f7632e659afc0cab726b8f3..c697c0d6ebfe15fa4ac5c8b68bae822a67fab26c 100644 (file)
@@ -385,7 +385,7 @@ static void lazy_expunge_mail_storage_init(struct mail_storage *storage)
        p = t_strsplit_spaces(luser->env, " ");
        for (i = 0; i < LAZY_NAMESPACE_COUNT; i++, p++) {
                if (strcmp(storage->ns->prefix, *p) == 0) {
-                       storage->ns->flags |= NAMESPACE_FLAG_INTERNAL;
+                       storage->ns->flags |= NAMESPACE_FLAG_NOQUOTA;
                        break;
                }
        }
index 2314bb59894f465a4a8db0dc19462c22f06f50d0..a8e6333e89dde99ccd6b7edc0e888c2423b0b8cd 100644 (file)
@@ -555,7 +555,7 @@ void quota_mailbox_list_created(struct mailbox_list *list)
        struct quota_root *root;
        bool add;
 
-       if ((list->ns->flags & NAMESPACE_FLAG_INTERNAL) != 0)
+       if ((list->ns->flags & NAMESPACE_FLAG_NOQUOTA) != 0)
                add = FALSE;
        else if (list->ns->owner == NULL) {
                /* see if we have a quota explicitly defined for