From 65983132726007a490cd35aae1fbc371bf39826b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Taavi=20Eom=C3=A4e?= Date: Mon, 2 Jun 2025 17:37:40 +0300 Subject: [PATCH] Log a warning when opcache lock file permissions could not be changed --- ext/opcache/zend_shared_alloc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ext/opcache/zend_shared_alloc.c b/ext/opcache/zend_shared_alloc.c index 8516493dd8708..37dbe59f3d55c 100644 --- a/ext/opcache/zend_shared_alloc.c +++ b/ext/opcache/zend_shared_alloc.c @@ -115,7 +115,9 @@ void zend_shared_alloc_create_lock(char *lockfile_path) zend_accel_error_noreturn(ACCEL_LOG_FATAL, "Unable to create opcache lock file in %s: %s (%d)", lockfile_path, strerror(errno), errno); } - fchmod(lock_file, 0666); + if (fchmod(lock_file, 0666) == -1) { + zend_accel_error(ACCEL_LOG_WARNING, "Unable to change opcache lock file permissions in %s: %s (%d)", lockfile_path, strerror(errno), errno); + } val = fcntl(lock_file, F_GETFD, 0); val |= FD_CLOEXEC;