]> granicus.if.org Git - php/commitdiff
Merge branch 'PHP-7.0' into PHP-7.1
authorDmitry Stogov <dmitry@zend.com>
Wed, 16 Nov 2016 09:56:15 +0000 (12:56 +0300)
committerDmitry Stogov <dmitry@zend.com>
Wed, 16 Nov 2016 09:56:15 +0000 (12:56 +0300)
* PHP-7.0:
  Fixed bug #69090 (check cached files permissions)

1  2 
NEWS
ext/opcache/ZendAccelerator.c
ext/opcache/ZendAccelerator.h
ext/opcache/zend_accelerator_module.c

diff --cc NEWS
index 84c4f8715f46cc2cfb7a80670bd3b1af425e98ed,6c78480059353225dc01e5785d9bb9aabaf76553..604ee8dedba7de1da8e8fb11393d391589e5188f
--- 1/NEWS
--- 2/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)
index 2f549cc011c13abfbac4d935e78386e2b9f8f242,7bd6b813715969ea77b27df12391943708c36afd..9b6734fb49fb0984bc1bada79744e08551e94b13
@@@ -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)) {
Simple merge
Simple merge