From: Dmitry Stogov Date: Wed, 16 Nov 2016 09:56:15 +0000 (+0300) Subject: Merge branch 'PHP-7.0' into PHP-7.1 X-Git-Tag: php-7.2.0alpha1~924^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=86460af56c520b7210d5e21afb7368d4a4d01e1d;p=php Merge branch 'PHP-7.0' into PHP-7.1 * PHP-7.0: Fixed bug #69090 (check cached files permissions) --- 86460af56c520b7210d5e21afb7368d4a4d01e1d diff --cc NEWS index 84c4f8715f,6c78480059..604ee8dedb --- a/NEWS +++ b/NEWS @@@ -5,20 -5,6 +5,23 @@@ PH - Calendar: . Fix integer overflows (Joshua Rogers) +- Date: + . Fixed bug #69587 (DateInterval properties and isset). (jhdxr) + +- Mbstring: + . Fixed bug #73532 (Null pointer dereference in mb_eregi). (Laruence) + ++- Opcache: ++ . Fixed bug #69090 (check cached files permissions) ++ +- SQLite3: + . Update to SQLite 3.15.1. (cmb) + +- XML: + . Fixed bug #72135 (malformed XML causes fault) (edgarsandi) + +10 Nov 2016, PHP 7.1.0RC6 + - Core: . Fixded bug #72736 (Slow performance when fetching large dataset with mysqli / PDO). (Dmitry) diff --cc ext/opcache/ZendAccelerator.c index 2f549cc011,7bd6b81371..9b6734fb49 --- a/ext/opcache/ZendAccelerator.c +++ b/ext/opcache/ZendAccelerator.c @@@ -1771,7 -1763,20 +1771,21 @@@ zend_op_array *persistent_compile_file( ZCG(counted) = 1; } + /* Revalidate acessibility of cached file */ + if (EXPECTED(persistent_script != NULL) && + UNEXPECTED(ZCG(accel_directives).validate_permission) && + file_handle->type == ZEND_HANDLE_FILENAME && + UNEXPECTED(access(file_handle->filename, R_OK) != 0)) { + if (type == ZEND_REQUIRE) { + zend_message_dispatcher(ZMSG_FAILED_REQUIRE_FOPEN, file_handle->filename TSRMLS_CC); + zend_bailout(); + } else { + zend_message_dispatcher(ZMSG_FAILED_INCLUDE_FOPEN, file_handle->filename TSRMLS_CC); + } + return NULL; + } + + HANDLE_BLOCK_INTERRUPTIONS(); SHM_UNPROTECT(); /* If script is found then validate_timestamps if option is enabled */ @@@ -2084,7 -2084,31 +2098,32 @@@ static void accel_activate(void } #endif + #ifndef ZEND_WIN32 + if (ZCG(accel_directives).validate_root) { + struct stat buf; + + if (stat("/", &buf) != 0) { + ZCG(root_hash) = 0; + } else { + zend_ulong x = buf.st_ino; + + #if SIZEOF_ZEND_LONG == 4 + x = ((x >> 16) ^ x) * 0x45d9f3b; + x = ((x >> 16) ^ x) * 0x45d9f3b; + x = (x >> 16) ^ x; + #elif SIZEOF_ZEND_LONG == 8 + x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9; + x = (x ^ (x >> 27)) * 0x94d049bb133111eb; + x = x ^ (x >> 31); + #endif + ZCG(root_hash) = x; + } + } else { + ZCG(root_hash) = 0; + } + #endif + + HANDLE_BLOCK_INTERRUPTIONS(); SHM_UNPROTECT(); if (ZCG(counted)) {