dovecot-1.1: mbox: Improve dotlock error logging more.
dovecot at dovecot.org
dovecot at dovecot.org
Fri Feb 27 00:43:59 EET 2009
details: http://hg.dovecot.org/dovecot-1.1/rev/8c99c4d2eaad
changeset: 8175:8c99c4d2eaad
user: Timo Sirainen <tss at iki.fi>
date: Thu Feb 26 17:43:21 2009 -0500
description:
mbox: Improve dotlock error logging more.
diffstat:
1 file changed, 10 insertions(+), 4 deletions(-)
src/lib-storage/index/mbox/mbox-lock.c | 14 ++++++++++----
diffs (30 lines):
diff -r 51f4b25c7bd3 -r 8c99c4d2eaad src/lib-storage/index/mbox/mbox-lock.c
--- a/src/lib-storage/index/mbox/mbox-lock.c Thu Feb 26 13:55:37 2009 -0500
+++ b/src/lib-storage/index/mbox/mbox-lock.c Thu Feb 26 17:43:21 2009 -0500
@@ -363,16 +363,22 @@ mbox_dotlock_log_eacces_error(struct mbo
errmsg = mail_storage_create_eacces_msg("file_dotlock_create", path);
dir = strrchr(path, '/');
dir = dir == NULL ? "." : t_strdup_until(path, dir);
- if (stat(dir, &st) == 0 &&
- (st.st_mode & 02) == 0 && /* not world-writable */
- (st.st_mode & 020) != 0) { /* group-writable */
+ if (!mbox->mbox_privileged_locking) {
+ dir = mailbox_list_get_path(mbox->storage->storage.list, NULL,
+ MAILBOX_LIST_PATH_TYPE_DIR);
+ mail_storage_set_critical(&mbox->storage->storage,
+ "%s (under root dir %s -> no privileged locking)",
+ errmsg, dir);
+ } else if (stat(dir, &st) == 0 &&
+ (st.st_mode & 02) == 0 && /* not world-writable */
+ (st.st_mode & 020) != 0) { /* group-writable */
group = getgrgid(st.st_gid);
mail_storage_set_critical(&mbox->storage->storage,
"%s (set mail_privileged_group=%s)", errmsg,
group == NULL ? dec2str(st.st_gid) : group->gr_name);
} else {
mail_storage_set_critical(&mbox->storage->storage,
- "%s (nonstandard permissions in %s)", errmsg, path);
+ "%s (nonstandard permissions in %s)", errmsg, dir);
}
errno = orig_errno;
}
More information about the dovecot-cvs
mailing list