dovecot-2.0: mbox: Allow mail_privileged_group locking for INBOX...
dovecot at dovecot.org
dovecot at dovecot.org
Thu Nov 18 20:57:22 EET 2010
details: http://hg.dovecot.org/dovecot-2.0/rev/1afad049f37f
changeset: 12444:1afad049f37f
user: Timo Sirainen <tss at iki.fi>
date: Thu Nov 18 18:56:34 2010 +0000
description:
mbox: Allow mail_privileged_group locking for INBOXes also in inbox=no namespaces.
diffstat:
src/lib-storage/index/mbox/mbox-lock.c | 6 +++++-
src/lib-storage/index/mbox/mbox-storage.c | 2 +-
2 files changed, 6 insertions(+), 2 deletions(-)
diffs (28 lines):
diff -r 94c5d2189006 -r 1afad049f37f src/lib-storage/index/mbox/mbox-lock.c
--- a/src/lib-storage/index/mbox/mbox-lock.c Thu Nov 18 18:51:34 2010 +0000
+++ b/src/lib-storage/index/mbox/mbox-lock.c Thu Nov 18 18:56:34 2010 +0000
@@ -348,7 +348,11 @@
errmsg = eacces_error_get_creating("file_dotlock_create", path);
dir = strrchr(path, '/');
dir = dir == NULL ? "." : t_strdup_until(path, dir);
- if (!mbox->box.inbox_any) {
+ /* allow privileged locking for
+ a) user's own INBOX,
+ b) another user's shared INBOX, and
+ c) anything called INBOX (in inbox=no namespace) */
+ if (!mbox->box.inbox_any && strcmp(mbox->box.name, "INBOX") != 0) {
mail_storage_set_critical(&mbox->storage->storage,
"%s (not INBOX -> no privileged locking)", errmsg);
} else if (!mbox->mbox_privileged_locking) {
diff -r 94c5d2189006 -r 1afad049f37f src/lib-storage/index/mbox/mbox-storage.c
--- a/src/lib-storage/index/mbox/mbox-storage.c Thu Nov 18 18:51:34 2010 +0000
+++ b/src/lib-storage/index/mbox/mbox-storage.c Thu Nov 18 18:56:34 2010 +0000
@@ -403,7 +403,7 @@
}
move_to_memory = want_memory_indexes(mbox->storage, box->path);
- if (box->inbox_any) {
+ if (box->inbox_any || strcmp(box->name, "INBOX") == 0) {
/* if INBOX isn't under the root directory, it's probably in
/var/mail and we want to allow privileged dotlocking */
rootdir = mailbox_list_get_path(box->list, NULL,
More information about the dovecot-cvs
mailing list