diff options
author | Yasuo Ohgaki <yohgaki@php.net> | 2016-09-09 11:32:20 +0900 |
---|---|---|
committer | Yasuo Ohgaki <yohgaki@php.net> | 2016-09-09 11:32:20 +0900 |
commit | 0e3b30fad18427d44e2afab67a9ccf8a13da95ea (patch) | |
tree | a74757cf9ab5dba35ec3b5f4289972b81ab18ac2 | |
parent | 4fda0a94795b62d8923a21f1fd41392d275d3cbf (diff) | |
parent | 38553e853b65eb84f919e4f5c5b9e702f1842b62 (diff) | |
download | php-git-0e3b30fad18427d44e2afab67a9ccf8a13da95ea.tar.gz |
Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
Fixed Bug #68015 Session does not report invalid uid for files save handler
-rw-r--r-- | ext/session/mod_files.c | 2 | ||||
-rw-r--r-- | ext/session/tests/016.phpt | 8 |
2 files changed, 8 insertions, 2 deletions
diff --git a/ext/session/mod_files.c b/ext/session/mod_files.c index 521fadd1ee..ed32f3564c 100644 --- a/ext/session/mod_files.c +++ b/ext/session/mod_files.c @@ -175,6 +175,7 @@ static void ps_files_open(ps_files *data, const char *key) } if (!ps_files_path_create(buf, sizeof(buf), data, key)) { + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to create session data file path. Too short session ID, invalid save_path or path lentgth exceeds MAXPATHLEN(%d)", MAXPATHLEN); return; } @@ -199,6 +200,7 @@ static void ps_files_open(ps_files *data, const char *key) if (fstat(data->fd, &sbuf) || (sbuf.st_uid != 0 && sbuf.st_uid != getuid() && sbuf.st_uid != geteuid())) { close(data->fd); data->fd = -1; + php_error_docref(NULL TSRMLS_CC, E_WARNING, "Session data file is not created by your uid"); return; } #endif diff --git a/ext/session/tests/016.phpt b/ext/session/tests/016.phpt index 82a85d2705..c1965df5cb 100644 --- a/ext/session/tests/016.phpt +++ b/ext/session/tests/016.phpt @@ -22,5 +22,9 @@ session_write_close(); print "I live\n"; ?> --EXPECTF-- -Warning: session_write_close(): Failed to write session data (files). Please verify that the current setting of session.save_path is correct (123;:/really%scompletely:::/invalid;;,23123;213) in %s on line %d -I live +Warning: session_start(): Failed to create session data file path. Too short session ID, invalid save_path or path lentgth exceeds MAXPATHLEN(%d) in %s on line 4 + +Warning: session_write_close(): Failed to create session data file path. Too short session ID, invalid save_path or path lentgth exceeds MAXPATHLEN(%d) in %s on line 6 + +Warning: session_write_close(): Failed to write session data (files). Please verify that the current setting of session.save_path is correct (123;:/really\completely:::/invalid;;,23123;213) in %s on line 6 +I live
\ No newline at end of file |