Log a warning when opcache lock file permissions could not be changed

Closes GH-18742.
This commit is contained in:
Taavi Eomäe 2025-06-02 17:37:40 +03:00 committed by Niels Dossche
parent 36891a6775
commit 0a8961a0e2
No known key found for this signature in database
GPG key ID: B8A8AD166DF0E2E5
2 changed files with 5 additions and 1 deletions

2
NEWS
View file

@ -121,6 +121,8 @@ PHP NEWS
. Fixed ZTS OPcache build on Cygwin. (cmb) . Fixed ZTS OPcache build on Cygwin. (cmb)
. Added opcache.file_cache_read_only. (Samuel Melrose) . Added opcache.file_cache_read_only. (Samuel Melrose)
. Updated default value of opcache.jit_hot_loop. (Arnaud) . Updated default value of opcache.jit_hot_loop. (Arnaud)
. Log a warning when opcache lock file permissions could not be changed.
(Taavi Eomäe)
- Output: - Output:
. Fixed calculation of aligned buffer size. (cmb) . Fixed calculation of aligned buffer size. (cmb)

View file

@ -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); 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 = fcntl(lock_file, F_GETFD, 0);
val |= FD_CLOEXEC; val |= FD_CLOEXEC;