dovecot-1.2: mbox: Improve dotlock error logging more.

dovecot at dovecot.org dovecot at dovecot.org
Fri Feb 27 00:44:22 EET 2009


details:   http://hg.dovecot.org/dovecot-1.2/rev/1f2dfc6fbda9
changeset: 8788:1f2dfc6fbda9
user:      Timo Sirainen <tss at iki.fi>
date:      Thu Feb 26 17:44:17 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 5c3406520c3f -r 1f2dfc6fbda9 src/lib-storage/index/mbox/mbox-lock.c
--- a/src/lib-storage/index/mbox/mbox-lock.c	Thu Feb 26 16:43:51 2009 -0500
+++ b/src/lib-storage/index/mbox/mbox-lock.c	Thu Feb 26 17:44:17 2009 -0500
@@ -370,16 +370,22 @@ mbox_dotlock_log_eacces_error(struct mbo
 	errmsg = eacces_error_get_creating("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