]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
maildir: If opening a mail fails with EACCES, log a better error message.
authorTimo Sirainen <tss@iki.fi>
Mon, 17 Aug 2009 18:18:52 +0000 (14:18 -0400)
committerTimo Sirainen <tss@iki.fi>
Mon, 17 Aug 2009 18:18:52 +0000 (14:18 -0400)
--HG--
branch : HEAD

src/lib-storage/index/maildir/maildir-mail.c

index d96c6cbb2c5c1bd8891fc59cbfcaf9b1acfa0b3f..4a9765e69e4f4c1f64f1fd3de5806ea9a9bee5c8 100644 (file)
@@ -22,8 +22,13 @@ do_open(struct maildir_mailbox *mbox, const char *path, int *fd)
        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, const char *path, struct stat *st)
        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;
 }