dovecot-2.0: maildir: If opening a mail fails with EACCES, log a...
dovecot at dovecot.org
dovecot at dovecot.org
Mon Aug 17 21:18:59 EEST 2009
details: http://hg.dovecot.org/dovecot-2.0/rev/3c33f864b4ae
changeset: 9806:3c33f864b4ae
user: Timo Sirainen <tss at iki.fi>
date: Mon Aug 17 14:18:52 2009 -0400
description:
maildir: If opening a mail fails with EACCES, log a better error message.
diffstat:
1 file changed, 14 insertions(+), 4 deletions(-)
src/lib-storage/index/maildir/maildir-mail.c | 18 ++++++++++++++----
diffs (35 lines):
diff -r 882a0a6cc92e -r 3c33f864b4ae src/lib-storage/index/maildir/maildir-mail.c
--- a/src/lib-storage/index/maildir/maildir-mail.c Mon Aug 17 13:05:32 2009 -0400
+++ b/src/lib-storage/index/maildir/maildir-mail.c Mon Aug 17 14:18:52 2009 -0400
@@ -22,8 +22,13 @@ do_open(struct maildir_mailbox *mbox, co
if (errno == ENOENT)
return 0;
- mail_storage_set_critical(&mbox->storage->storage,
- "open(%s) failed: %m", path);
+ if (errno == EACCES) {
+ mail_storage_set_critical(&mbox->storage->storage, "%s",
+ mail_error_eacces_msg("open", path));
+ } else {
+ mail_storage_set_critical(&mbox->storage->storage,
+ "open(%s) failed: %m", path);
+ }
return -1;
}
@@ -35,8 +40,13 @@ do_stat(struct maildir_mailbox *mbox, co
if (errno == ENOENT)
return 0;
- mail_storage_set_critical(&mbox->storage->storage,
- "stat(%s) failed: %m", path);
+ if (errno == EACCES) {
+ mail_storage_set_critical(&mbox->storage->storage, "%s",
+ mail_error_eacces_msg("stat", path));
+ } else {
+ mail_storage_set_critical(&mbox->storage->storage,
+ "stat(%s) failed: %m", path);
+ }
return -1;
}
More information about the dovecot-cvs
mailing list