]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-index: Replace EACCES with ENOACCESS
authorMarco Bettini <marco.bettini@open-xchange.com>
Tue, 4 Jul 2023 13:05:47 +0000 (13:05 +0000)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Fri, 6 Oct 2023 16:00:06 +0000 (16:00 +0000)
src/lib-index/mail-index-alloc-cache.c
src/lib-index/mail-index.c
src/lib-index/mail-transaction-log-file.c

index fe52754ea5cabbdfc0f506251d6b245be9ed4c80..f7c8f1de34892fc277a9f86f82d3c85cf8c4f201 100644 (file)
@@ -150,7 +150,7 @@ mail_index_alloc_cache_get(struct event *parent_event, const char *mailbox_path,
        } else if (stat(index_dir, &st) < 0) {
                if (errno == ENOENT) {
                        /* it'll be created later */
-               } else if (errno == EACCES) {
+               } else if (ENOACCESS(errno)) {
                        e_error(parent_event, "%s",
                                eacces_error_get("stat", index_dir));
                } else {
index 3837f59d2db7487319c7905ebfe646950020e7ee..a2fec7acba350ee9e5eceeadfcdc3ce43f7e707b 100644 (file)
@@ -497,7 +497,7 @@ int mail_index_try_open_only(struct mail_index *index)
                index->readonly = FALSE;
        }
 
-       if (index->fd == -1 && errno == EACCES) {
+       if (index->fd == -1 && ENOACCESS(errno)) {
                index->fd = open(index->filepath, O_RDONLY);
                index->readonly = TRUE;
        }
@@ -1086,7 +1086,7 @@ void mail_index_file_set_syscall_error(struct mail_index *index,
                        return;
        }
 
-       if (errno == EACCES) {
+       if (ENOACCESS(errno)) {
                function = t_strcut(function, '(');
                if (strcmp(function, "creat") == 0 ||
                    str_begins_with(function, "file_dotlock_"))
index 88c35b7dfec2c95f39da11d4717f34aca3b07f06..254affb76197ec7cc80f028fcd5912e519eeb061 100644 (file)
@@ -906,7 +906,7 @@ int mail_transaction_log_file_open(struct mail_transaction_log_file *file,
                } else {
                        file->fd = nfs_safe_open(file->filepath, O_RDONLY);
                }
-               if (file->fd == -1 && errno == EACCES) {
+               if (file->fd == -1 && ENOACCESS(errno)) {
                        file->fd = nfs_safe_open(file->filepath, O_RDONLY);
                        index->readonly = TRUE;
                }