Description
Symfony version(s) affected
6.4.5
Description
Hi,
we're runnning our Symfony project in a php environment with open_basedir restrictions. Since upgrading to 6.4.5 the behavior of the cache:clear command changed. We now get a "Warning: is_readable(): open_basedir restriction in effect. File(/proc/mounts) is not within the allowed path(s): ..." warning. It gets triggered by the isNfs(string $dir) method in Symfony\Bundle\FrameworkBundle\Command\CacheClearCommand.
I was able to narrow it down to this commit:
[FrameworkBundle] Prevent silenced warning by checking if /proc/mount… (349b3e7)
How to reproduce
To reproduce run symfony in an php environment with config
open_basedir = /var/www/
or likely and run the cache:clear command.
Possible Solution
Since is_readable() produces meaningful output even when restricted by open_basedir config, changing the if statement from
if ('/' === \DIRECTORY_SEPARATOR && is_readable('/proc/mounts') && $files = @file('/proc/mounts'))
to
if ('/' === \DIRECTORY_SEPARATOR && @is_readable('/proc/mounts') && $files = @file('/proc/mounts'))
would suppress the error without having any negative side effects.
Additional Context
No response