]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib: eaccess-error - Handle EROFS too
authorAki Tuomi <aki.tuomi@open-xchange.com>
Thu, 11 May 2023 10:39:25 +0000 (13:39 +0300)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Fri, 6 Oct 2023 16:00:06 +0000 (16:00 +0000)
This simplifies code since we can now call this
if ENOACCESS macro return TRUE.

src/lib/eacces-error.c

index d140d826b521847dd51f9a39b604f90916555b67..e08be4922dee44e31a02c7bf9cf6557dae9e6981 100644 (file)
@@ -201,6 +201,13 @@ eacces_error_get_full(const char *func, const char *path, bool creating)
                break;
        }
 
+       if (orig_errno == EROFS) {
+               str_append(errmsg, " Read-only file system");
+               str_append_c(errmsg, ')');
+               errno = orig_errno;
+               return str_c(errmsg);
+       }
+
        prev_path = path; ret = -1;
        while (strcmp(prev_path, "/") != 0) {
                if ((p = strrchr(prev_path, '/')) == NULL)