Mercurial > dovecot > original-hg > dovecot-1.2
changeset 5869:38ff50597e54 HEAD
Owner parameter wasn't set correctly. Take user's groups from acl_groups
environment.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Tue, 03 Jul 2007 00:30:48 +0300 |
parents | cff069467884 |
children | c9b49ed99d28 |
files | src/plugins/acl/acl-mailbox-list.c |
diffstat | 1 files changed, 8 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- 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 @@ 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 @@ 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");