]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: Handle EROFS in mail_error_from_errno()
authorAki Tuomi <aki.tuomi@open-xchange.com>
Thu, 11 May 2023 10:34:08 +0000 (13:34 +0300)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Fri, 6 Oct 2023 16:00:06 +0000 (16:00 +0000)
src/lib-storage/mail-error.c

index a3c6e000451c49c733e6c5e4dec9ec1068f14740..3b3771e08b219166a1c0a76aaeb07edc930e5a9e 100644 (file)
@@ -7,9 +7,12 @@
 bool mail_error_from_errno(enum mail_error *error_r,
                           const char **error_string_r)
 {
-       if (ENOACCESS(errno)) {
+       if (errno == EACCES || errno == EPERM) {
                *error_r = MAIL_ERROR_PERM;
                *error_string_r = MAIL_ERRSTR_NO_PERMISSION;
+       } else if (errno == EROFS) {
+               *error_r = MAIL_ERROR_PERM;
+               *error_string_r = "Read only file system";
        } else if (ENOQUOTA(errno)) {
                *error_r = MAIL_ERROR_NOQUOTA;
                *error_string_r = MAIL_ERRSTR_NO_QUOTA;