Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-32381

eZPlatformEncoreExtension throws an exception if an unrelated folder is not readable

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Medium Medium
    • None
    • None
    • None

    Description

      The code in method EzSystems\EzPlatformEncoreBundle\DependencyInjection\EzSystemsEzPlatformEncoreExtension\dumpConfigurationPathsToFile() will throw an exception if any folder or file in a bundle is not readable by the current user, even though it is only looking for config files which match a specific directory pattern.

      Although this is not necessarily a recommended configuration, it is not too uncommon to temporarily create a file or subfolder in a bundle which is not readable by the process executing the php application, be it apache or php-fpm. In fact, it might even be a good idea, for security reasons.

      Which leads me to say that the code in eZPlatformEncoreBundle which tries to find existing configuration for webpack encore should be improved. It should

      • only scan folders called `$bundle/Resources/encore`
      • throw if any folders with such name exist and are not readable
      • not throw if any other existing files / folders are not readable

       

      This can be done f.e. by replacing the usage of the Symfony Finder component with a simple foreach+file_exists loop (or waiting for Symfony to fix https://github.com/symfony/symfony/issues/40401 )

      Attachments

        Activity

          People

            Unassigned Unassigned
            72f8acac-185f-4a54-9470-a7473f50daab@accounts.ibexa.co Gaetano Giunta
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: