File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -86,6 +86,7 @@ PHP NEWS
86
86
. Fixed bug #73461 (Prohibit session save handler recursion). (Yasuo)
87
87
. PR #2233 Removed register_globals related code and "!" can be used as $_SESSION key name. (Yasuo)
88
88
. Improved bug #73100 fix. 'user' save handler can only be set by session_set_save_handler()
89
+ . Fixed bug #69582 (session not readable by root in CLI). (EvgeniySpinov)
89
90
90
91
- SOAP:
91
92
. Fixed bug #69137 (Peer verification fails when using a proxy with SoapClient)
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