From babd1922b0c60a14d38dbd2a61b3bf00c4f17ba0 Mon Sep 17 00:00:00 2001 From: Marco Bettini Date: Tue, 25 Jul 2023 10:05:25 +0000 Subject: [PATCH] plugins: acl - Replace EACCES with ENOACCESS --- src/plugins/acl/acl-backend-vfile-acllist.c | 2 +- src/plugins/acl/acl-backend-vfile.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/plugins/acl/acl-backend-vfile-acllist.c b/src/plugins/acl/acl-backend-vfile-acllist.c index e3c7e79b24..bdb7a2a370 100644 --- a/src/plugins/acl/acl-backend-vfile-acllist.c +++ b/src/plugins/acl/acl-backend-vfile-acllist.c @@ -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; } diff --git a/src/plugins/acl/acl-backend-vfile.c b/src/plugins/acl/acl-backend-vfile.c index fdebeaa5be..1f1a988b6a 100644 --- a/src/plugins/acl/acl-backend-vfile.c +++ b/src/plugins/acl/acl-backend-vfile.c @@ -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; -- 2.47.3