File tree Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Expand file tree Collapse file tree 2 files changed +11
-2
lines changed Original file line number Diff line number Diff line change 8
8
- ZIP:
9
9
DE57
. Fixed bug #70103 (ZipArchive::addGlob ignores remove_all_path option). (cmb)
10
10
11
+ - Session:
12
+ . Fixed bug #69582 (session not readable by root in CLI). (EvgeniySpinov)
13
+
11
14
19 Jan 2017 PHP 7.0.15
12
15
13
16
- Core:
Original file line number Diff line number Diff line change @@ -196,8 +196,14 @@ static void ps_files_open(ps_files *data, const char *key)
196
196
if (data -> fd != -1 ) {
197
197
#ifndef PHP_WIN32
198
198
/* check that this session file was created by us or root – we
199
- don't want to end up accepting the sessions of another webapp */
200
- if (fstat (data -> fd , & sbuf ) || (sbuf .st_uid != 0 && sbuf .st_uid != getuid () && sbuf .st_uid != geteuid ())) {
199
+ don't want to end up accepting the sessions of another webapp
200
+
201
+ If the process is ran by root, we ignore session file ownership
202
+ Use case: session is initiated by Apache under non-root and then
203
+ accessed by backend with root permissions to execute some system tasks.
204
+
205
+ */
206
+ if (zend_fstat (data -> fd , & sbuf ) || (sbuf .st_uid != 0 && sbuf .st_uid != getuid () && sbuf .st_uid != geteuid () && getuid () != 0 )) {
201
207
close (data -> fd );
202
208
data -> fd = -1 ;
203
209
php_error_docref (NULL , E_WARNING , "Session data file is not created by your uid" );
You can’t perform that action at this time.
0 commit comments