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

Clearing caches fail if cache folder is symlinked

    Details

      Description

      if any of the cache folders under ezp_root/var/ is symlinked to a dir outside the ezp_root, no cache will ever be cleaned. the ezDir::recursiveDelete() checks that the absolute path is outside the root and fails.

      test case:

      • mv ezpublish_legacy/var/cache /some/path/elsewhere
      • ln -s /some/path/elsewhere ezpublish_legacy/var/cache
      • clear caches from admin or command line
      • inspect the symlinked folder, all files all still there

      there are no errors in log, but hacking the recursiveDelete() to write a message with the result shows clearly that the return value is False.

        Issue Links

          Activity

          Hide
          Jérôme Vieilledent (Inactive) added a comment -

          Hi

          This check is done on purpose, see EZP-15823 and the associated commit.

          AFAICT, this behavior won't be fixed, but maybe doc can be updated on that regard...

          Show
          Jérôme Vieilledent (Inactive) added a comment - Hi This check is done on purpose, see EZP-15823 and the associated commit . AFAICT, this behavior won't be fixed, but maybe doc can be updated on that regard...
          Show
          Jérôme Vieilledent (Inactive) added a comment - PR: https://github.com/ezsystems/ezpublish-legacy/pull/981
          Show
          Jérôme Vieilledent (Inactive) added a comment - Fixed in master: https://github.com/ezsystems/ezpublish-legacy/commit/49583e15c89612e9833fec6a5676134393305e13
          Hide
          Jérôme Vieilledent (Inactive) added a comment -

          To be able to use symlinks with eZDir::recursiveDelete() :

          extract from site.ini

          # Directories eZDir is allowed to delete from (see eZDir::recursiveDelete()).
          # By default, it is only possible to delete from inside eZ Publish root directory.
          # Directories listed will be added as authorized directory prefixes.
          # Values must be absolute paths.
          AllowedDeletionDirs[]
          #AllowedDeletionDirs[]=/var/share/somedir
          

          Show
          Jérôme Vieilledent (Inactive) added a comment - To be able to use symlinks with eZDir::recursiveDelete() : extract from site.ini # Directories eZDir is allowed to delete from (see eZDir::recursiveDelete()). # By default, it is only possible to delete from inside eZ Publish root directory. # Directories listed will be added as authorized directory prefixes. # Values must be absolute paths. AllowedDeletionDirs[] #AllowedDeletionDirs[]=/var/share/somedir
          Hide
          Marcos Loureiro (Inactive) added a comment -

          QA Approved

          Show
          Marcos Loureiro (Inactive) added a comment - QA Approved

            People

            • Assignee:
              Unassigned
              Reporter:
              Paulo Bras (Inactive)
            • Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 3 hours
                3h