Bug #78138 [NEW]: Opcache incorrectly handles PHAR files when validate_permission option enabled

From: Date: Mon, 10 Jun 2019 15:18:57 +0000
Subject: Bug #78138 [NEW]: Opcache incorrectly handles PHAR files when validate_permission option enabled
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-221205@lists.php.net to get a copy of this message
From:             alex at cgi-central dot net
Operating system: Linux
PHP version:      7.3.6
Package:          opcache
Bug Type:         Bug
Bug description:Opcache incorrectly handles PHAR files when validate_permission option enabled

Description:
------------
When option opcache.validate_permission is enabled, only first access to
a file inside PHAR archive is succesfull. 

All the following attempts to include or require a file from PHAR
archive fail with error
--
Warning: include(): Failed opening
'phar:///var/www/html/33.phar/test.php' for inclusion
--

In same time, file_get_contents('phar:///var/www/html/33.phar/test.php')
works fine as expected, so that is definitely an opcache issue. It
happens even with "opcache.enable" is set to "off", so there is no quick
workaround.


Test script:
---------------
There is a short test script:
 https://github.com/alex-scott/php-phar-bug

Expected result:
----------------
The index.php file expected to output "OK" on each run.

Actual result:
--------------
Only first-run displays "OK", the following runs display error 

Warning: include(): Failed opening
'phar:///var/www/html/33.phar/test.php' for inclusion

-- 
Edit bug report at https://bugs.php.net/bug.php?id=78138&edit=1
-- 
Try a snapshot (PHP 5.4):   https://bugs.php.net/fix.php?id=78138&r=trysnapshot54
Try a snapshot (PHP 5.5):   https://bugs.php.net/fix.php?id=78138&r=trysnapshot55
Try a snapshot (trunk):     https://bugs.php.net/fix.php?id=78138&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=78138&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=78138&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=78138&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=78138&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=78138&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=78138&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=78138&r=notwrong
Not enough info:            https://bugs.php.net/fix.php?id=78138&r=notenoughinfo
Submitted twice:            https://bugs.php.net/fix.php?id=78138&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=78138&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=78138&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=78138&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=78138&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=78138&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=78138&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=78138&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=78138&r=mysqlcfg



Thread (4 messages)

« previous php.bugs (#221205) next »