dovecot-2.1: acl: Fixed listing multiple shared namespaces.

dovecot at dovecot.org dovecot at dovecot.org
Fri Sep 16 16:02:09 EEST 2011


details:   http://hg.dovecot.org/dovecot-2.1/rev/4552430ae44e
changeset: 13469:4552430ae44e
user:      Timo Sirainen <tss at iki.fi>
date:      Fri Sep 16 16:01:53 2011 +0300
description:
acl: Fixed listing multiple shared namespaces.

diffstat:

 src/plugins/acl/acl-plugin.h         |  3 ++-
 src/plugins/acl/acl-shared-storage.c |  5 +++--
 2 files changed, 5 insertions(+), 3 deletions(-)

diffs (45 lines):

diff -r cfbca51c0ade -r 4552430ae44e src/plugins/acl/acl-plugin.h
--- a/src/plugins/acl/acl-plugin.h	Fri Sep 16 16:01:29 2011 +0300
+++ b/src/plugins/acl/acl-plugin.h	Fri Sep 16 16:01:53 2011 +0300
@@ -21,7 +21,6 @@
 	const char *const *groups;
 
 	struct acl_lookup_dict *acl_lookup_dict;
-	time_t last_shared_add_check;
 };
 
 struct acl_storage_rights_context {
@@ -32,6 +31,8 @@
 struct acl_mailbox_list {
 	union mailbox_list_module_context module_ctx;
 	struct acl_storage_rights_context rights;
+
+	time_t last_shared_add_check;
 };
 
 extern MODULE_CONTEXT_DEFINE(acl_storage_module, &mail_storage_module_register);
diff -r cfbca51c0ade -r 4552430ae44e src/plugins/acl/acl-shared-storage.c
--- a/src/plugins/acl/acl-shared-storage.c	Fri Sep 16 16:01:29 2011 +0300
+++ b/src/plugins/acl/acl-shared-storage.c	Fri Sep 16 16:01:53 2011 +0300
@@ -65,6 +65,7 @@
 int acl_shared_namespaces_add(struct mail_namespace *ns)
 {
 	struct acl_user *auser = ACL_USER_CONTEXT(ns->user);
+	struct acl_mailbox_list *alist = ACL_LIST_CONTEXT(ns->list);
 	struct mail_storage *storage = ns->storage;
 	struct acl_lookup_dict_iter *iter;
 	const char *name;
@@ -72,11 +73,11 @@
 	i_assert(ns->type == NAMESPACE_SHARED);
 	i_assert(strcmp(storage->name, SHARED_STORAGE_NAME) == 0);
 
-	if (ioloop_time < auser->last_shared_add_check + SHARED_NS_RETRY_SECS) {
+	if (ioloop_time < alist->last_shared_add_check + SHARED_NS_RETRY_SECS) {
 		/* already added, don't bother rechecking */
 		return 0;
 	}
-	auser->last_shared_add_check = ioloop_time;
+	alist->last_shared_add_check = ioloop_time;
 
 	iter = acl_lookup_dict_iterate_visible_init(auser->acl_lookup_dict);
 	while ((name = acl_lookup_dict_iterate_visible_next(iter)) != NULL) {


More information about the dovecot-cvs mailing list