Mercurial > dovecot > original-hg > dovecot-1.2
changeset 9335:a366666f4b50 HEAD
maildir: If opening a mail fails with EACCES, log a better error message.
author | Timo Sirainen <tss@iki.fi> |
---|---|
date | Mon, 17 Aug 2009 14:18:33 -0400 |
parents | 0d0a801a4d1e |
children | 366a327b028b |
files | src/lib-storage/index/maildir/maildir-mail.c |
diffstat | 1 files changed, 14 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/src/lib-storage/index/maildir/maildir-mail.c Mon Aug 17 12:29:09 2009 -0400 +++ b/src/lib-storage/index/maildir/maildir-mail.c Mon Aug 17 14:18:33 2009 -0400 @@ -22,8 +22,13 @@ 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 @@ 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; }