Skip to content

Commit 0a8961a

Browse files
TaaviEnielsdos
authored andcommitted
Log a warning when opcache lock file permissions could not be changed
Closes GH-18742.
1 parent 36891a6 commit 0a8961a

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,8 @@ PHP NEWS
121121
. Fixed ZTS OPcache build on Cygwin. (cmb)
122122
. Added opcache.file_cache_read_only. (Samuel Melrose)
123123
. Updated default value of opcache.jit_hot_loop. (Arnaud)
124+
. Log a warning when opcache lock file permissions could not be changed.
125+
(Taavi Eomäe)
124126

125127
- Output:
126128
. Fixed calculation of aligned buffer size. (cmb)

ext/opcache/zend_shared_alloc.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,9 @@ void zend_shared_alloc_create_lock(char *lockfile_path)
115115
zend_accel_error_noreturn(ACCEL_LOG_FATAL, "Unable to create opcache lock file in %s: %s (%d)", lockfile_path, strerror(errno), errno);
116116
}
117117

118-
fchmod(lock_file, 0666);
118+
if (fchmod(lock_file, 0666) == -1) {
119+
zend_accel_error(ACCEL_LOG_WARNING, "Unable to change opcache lock file permissions in %s: %s (%d)", lockfile_path, strerror(errno), errno);
120+
}
119121

120122
val = fcntl(lock_file, F_GETFD, 0);
121123
val |= FD_CLOEXEC;

0 commit comments

Comments
 (0)