dovecot-2.2: lib-storage: Improved EACCES error messages for som...

dovecot at dovecot.org dovecot at dovecot.org
Thu Nov 21 23:02:46 EET 2013


details:   http://hg.dovecot.org/dovecot-2.2/rev/af96719b5d9c
changeset: 16997:af96719b5d9c
user:      Timo Sirainen <tss at iki.fi>
date:      Thu Nov 21 23:02:33 2013 +0200
description:
lib-storage: Improved EACCES error messages for some stat() calls

diffstat:

 src/lib-storage/mailbox-list.c |  9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diffs (26 lines):

diff -r d2e95af17305 -r af96719b5d9c src/lib-storage/mailbox-list.c
--- a/src/lib-storage/mailbox-list.c	Wed Nov 20 23:29:13 2013 +0200
+++ b/src/lib-storage/mailbox-list.c	Thu Nov 21 23:02:33 2013 +0200
@@ -868,7 +868,10 @@
 	if (path == NULL) {
 		/* no filesystem support in storage */
 	} else if (stat(path, &st) < 0) {
-		if (!ENOTFOUND(errno)) {
+		if (errno == EACCES) {
+			mailbox_list_set_critical(list, "%s",
+				mail_error_eacces_msg("stat", path));
+		} else if (!ENOTFOUND(errno)) {
 			mailbox_list_set_critical(list, "stat(%s) failed: %m",
 						  path);
 		} else if (list->mail_set->mail_debug) {
@@ -1052,7 +1055,9 @@
 
 	/* get the first existing parent directory's permissions */
 	if (stat_first_parent(expanded, &root_dir, &st) < 0) {
-		*error_r = t_strdup_printf("stat(%s) failed: %m", root_dir);
+		*error_r = errno == EACCES ?
+			mail_error_eacces_msg("stat", root_dir) :
+			t_strdup_printf("stat(%s) failed: %m", root_dir);
 		return -1;
 	}
 


More information about the dovecot-cvs mailing list