dovecot-1.2: Split NAMESPACE_FLAG_INTERNAL into distinct _NOQUOT...

dovecot at dovecot.org dovecot at dovecot.org
Tue May 26 06:39:08 EEST 2009


details:   http://hg.dovecot.org/dovecot-1.2/rev/5a593a838f90
changeset: 9087:5a593a838f90
user:      Timo Sirainen <tss at iki.fi>
date:      Mon May 25 23:39:03 2009 -0400
description:
Split NAMESPACE_FLAG_INTERNAL into distinct _NOQUOTA and _NOACL flags.

diffstat:

8 files changed, 14 insertions(+), 12 deletions(-)
src/deliver/deliver.c                          |    2 +-
src/lib-storage/mail-namespace.c               |    2 +-
src/lib-storage/mail-namespace.h               |   12 +++++++-----
src/plugins/acl/acl-lookup-dict.c              |    2 +-
src/plugins/acl/acl-mailbox-list.c             |    2 +-
src/plugins/acl/acl-storage.c                  |    2 +-
src/plugins/lazy-expunge/lazy-expunge-plugin.c |    2 +-
src/plugins/quota/quota-storage.c              |    2 +-

diffs (110 lines):

diff -r c7db09d796b9 -r 5a593a838f90 src/deliver/deliver.c
--- a/src/deliver/deliver.c	Mon May 25 23:33:56 2009 -0400
+++ b/src/deliver/deliver.c	Mon May 25 23:39:03 2009 -0400
@@ -1172,7 +1172,7 @@ int main(int argc, char *argv[])
 	raw_mail_user = mail_user_init(user);
 	mail_user_set_home(raw_mail_user, NULL);
 	raw_ns = mail_namespaces_init_empty(raw_mail_user);
-	raw_ns->flags |= NAMESPACE_FLAG_INTERNAL;
+	raw_ns->flags |= NAMESPACE_FLAG_NOQUOTA | NAMESPACE_FLAG_NOACL;
 
 	if (mail_storage_create(raw_ns, "raw", "/tmp",
 				MAIL_STORAGE_FLAG_FULL_FS_ACCESS,
diff -r c7db09d796b9 -r 5a593a838f90 src/lib-storage/mail-namespace.c
--- a/src/lib-storage/mail-namespace.c	Mon May 25 23:33:56 2009 -0400
+++ b/src/lib-storage/mail-namespace.c	Mon May 25 23:39:03 2009 -0400
@@ -115,7 +115,7 @@ namespace_add_env(const char *data, unsi
 
 	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;
diff -r c7db09d796b9 -r 5a593a838f90 src/lib-storage/mail-namespace.h
--- a/src/lib-storage/mail-namespace.h	Mon May 25 23:33:56 2009 -0400
+++ b/src/lib-storage/mail-namespace.h	Mon May 25 23:39:03 2009 -0400
@@ -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 {
diff -r c7db09d796b9 -r 5a593a838f90 src/plugins/acl/acl-lookup-dict.c
--- a/src/plugins/acl/acl-lookup-dict.c	Mon May 25 23:33:56 2009 -0400
+++ b/src/plugins/acl/acl-lookup-dict.c	Mon May 25 23:39:03 2009 -0400
@@ -112,7 +112,7 @@ static int acl_lookup_dict_rebuild_add_b
 	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);
diff -r c7db09d796b9 -r 5a593a838f90 src/plugins/acl/acl-mailbox-list.c
--- a/src/plugins/acl/acl-mailbox-list.c	Mon May 25 23:33:56 2009 -0400
+++ b/src/plugins/acl/acl-mailbox-list.c	Mon May 25 23:39:03 2009 -0400
@@ -562,7 +562,7 @@ static void acl_mailbox_list_init_defaul
 
 void acl_mailbox_list_created(struct mailbox_list *list)
 {
-	if ((list->ns->flags & NAMESPACE_FLAG_INTERNAL) != 0) {
+	if ((list->ns->flags & NAMESPACE_FLAG_NOACL) != 0) {
 		/* no ACL checks for internal namespaces (deliver, shared) */
 		if (list->ns->type == NAMESPACE_SHARED)
 			acl_mailbox_list_init_shared(list);
diff -r c7db09d796b9 -r 5a593a838f90 src/plugins/acl/acl-storage.c
--- a/src/plugins/acl/acl-storage.c	Mon May 25 23:33:56 2009 -0400
+++ b/src/plugins/acl/acl-storage.c	Mon May 25 23:39:03 2009 -0400
@@ -172,7 +172,7 @@ void acl_mail_storage_created(struct mai
 	struct acl_mail_storage *astorage;
 	struct acl_backend *backend;
 
-	if ((storage->ns->flags & NAMESPACE_FLAG_INTERNAL) != 0) {
+	if ((storage->ns->flags & NAMESPACE_FLAG_NOACL) != 0) {
 		/* no ACL checks for internal namespaces (deliver) */
 	} else {
 		astorage = p_new(storage->pool, struct acl_mail_storage, 1);
diff -r c7db09d796b9 -r 5a593a838f90 src/plugins/lazy-expunge/lazy-expunge-plugin.c
--- a/src/plugins/lazy-expunge/lazy-expunge-plugin.c	Mon May 25 23:33:56 2009 -0400
+++ b/src/plugins/lazy-expunge/lazy-expunge-plugin.c	Mon May 25 23:39:03 2009 -0400
@@ -525,7 +525,7 @@ static void lazy_expunge_mail_storage_in
 	p = t_strsplit_spaces(getenv("LAZY_EXPUNGE"), " ");
 	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;
 		}
 	}
diff -r c7db09d796b9 -r 5a593a838f90 src/plugins/quota/quota-storage.c
--- a/src/plugins/quota/quota-storage.c	Mon May 25 23:33:56 2009 -0400
+++ b/src/plugins/quota/quota-storage.c	Mon May 25 23:39:03 2009 -0400
@@ -557,7 +557,7 @@ void quota_mailbox_list_created(struct m
 	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


More information about the dovecot-cvs mailing list