dovecot: Owner parameter wasn't set correctly. Take user's group...
dovecot at dovecot.org
dovecot at dovecot.org
Tue Jul 3 00:30:52 EEST 2007
details: http://hg.dovecot.org/dovecot/rev/38ff50597e54
changeset: 5869:38ff50597e54
user: Timo Sirainen <tss at iki.fi>
date: Tue Jul 03 00:30:48 2007 +0300
description:
Owner parameter wasn't set correctly. Take user's groups from acl_groups
environment.
diffstat:
1 file changed, 8 insertions(+), 3 deletions(-)
src/plugins/acl/acl-mailbox-list.c | 11 ++++++++---
diffs (36 lines):
diff -r cff069467884 -r 38ff50597e54 src/plugins/acl/acl-mailbox-list.c
--- a/src/plugins/acl/acl-mailbox-list.c Mon Jul 02 23:53:22 2007 +0300
+++ b/src/plugins/acl/acl-mailbox-list.c Tue Jul 03 00:30:48 2007 +0300
@@ -353,6 +353,7 @@ void acl_mailbox_list_created(struct mai
struct mail_namespace *ns;
enum mailbox_list_flags flags;
const char *acl_env, *current_username, *owner_username;
+ bool owner = TRUE;
if (acl_next_hook_mailbox_list_created != NULL)
acl_next_hook_mailbox_list_created(list);
@@ -367,17 +368,21 @@ void acl_mailbox_list_created(struct mai
current_username = getenv("MASTER_USER");
if (current_username == NULL)
current_username = owner_username;
+ else
+ owner = strcmp(current_username, owner_username) == 0;
/* We don't care about the username for non-private mailboxes.
It's used only when checking if we're the mailbox owner. We never
are for shared/public mailboxes. */
ns = mailbox_list_get_namespace(list);
if (ns->type != NAMESPACE_PRIVATE)
- owner_username = NULL;
+ owner = FALSE;
/* FIXME: set groups */
- backend = acl_backend_init(acl_env, list, current_username, NULL,
- owner_username);
+ backend = acl_backend_init(acl_env, list, current_username,
+ getenv("ACL_GROUPS") == NULL ? NULL :
+ t_strsplit(getenv("ACL_GROUPS"), ","),
+ owner);
if (backend == NULL)
i_fatal("ACL backend initialization failed");
More information about the dovecot-cvs
mailing list