]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
plugins: acl - Replace EACCES with ENOACCESS
authorMarco Bettini <marco.bettini@open-xchange.com>
Tue, 25 Jul 2023 10:05:25 +0000 (10:05 +0000)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Fri, 6 Oct 2023 16:00:06 +0000 (16:00 +0000)
src/plugins/acl/acl-backend-vfile-acllist.c
src/plugins/acl/acl-backend-vfile.c

index e3c7e79b24a34e7a28d336880e666393fb4cc008..bdb7a2a3706231d0a7d9f085ed24fc5fc6e1f300 100644 (file)
@@ -253,7 +253,7 @@ acl_backend_vfile_acllist_try_rebuild(struct acl_backend_vfile *backend)
                                        perm.file_create_gid_origin);
        }
        if (fd == -1) {
-               if (errno == EACCES) {
+               if (ENOACCESS(errno)) {
                        /* Ignore silently if we can't create it */
                        return 0;
                }
index fdebeaa5be904b0b7d2917518c81fb95ebf53f64..1f1a988b6a34c1d66e72bb8e7e6bb010d3779f06 100644 (file)
@@ -284,7 +284,7 @@ acl_backend_vfile_read(struct acl_object *aclobj, const char *path,
                if (errno == ENOENT || errno == ENOTDIR) {
                        e_debug(event, "acl vfile: file %s not found", path);
                        validity->last_mtime = ACL_VFILE_VALIDITY_MTIME_NOTFOUND;
-               } else if (errno == EACCES) {
+               } else if (ENOACCESS(errno)) {
                        e_debug(event, "acl vfile: no access to file %s", path);
 
                        acl_object_remove_all_access(aclobj);
@@ -438,7 +438,7 @@ acl_backend_vfile_refresh(struct acl_object *aclobj, const char *path,
                        /* if the file used to exist, we have to re-read it */
                        return validity->last_mtime != ACL_VFILE_VALIDITY_MTIME_NOTFOUND ? 1 : 0;
                }
-               if (errno == EACCES)
+               if (ENOACCESS(errno))
                        return validity->last_mtime != ACL_VFILE_VALIDITY_MTIME_NOACCESS ? 1 : 0;
                e_error(event, "stat(%s) failed: %m", path);
                return -1;