Project

General

Profile

Actions

Bug #71328

closed

File Abstraction Layer: Update storage index fails when it encounters unreadable directories (e.g., .git)

Added by Martin Terber over 8 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Should have
Assignee:
Category:
File Abstraction Layer (FAL)
Target version:
-
Start date:
2015-11-04
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
Tags:
fal, scheduler, storage, iterator
Complexity:
easy
Is Regression:
No
Sprint Focus:
On Location Sprint

Description

We have an installation of 6.2.14 with very strict security policies.
It was impossible to get FAL's scheduler tasks up and running without patching the core:

The execution of task "File Abstraction Layer: Update storage index (scheduler)" failed with the following message: RecursiveDirectoryIterator::__construct(/installationpath/fileadmin/user_upload/.git/logs): failed to open dir: Permission denied

This makes adding file outside of the backend hard.
We have inmplemented a working soultion that is suitable for the TYPO3 core.
The RecursiveIteratorIterator can be called with a second flag, making it ignore unreadable directories:

Two occurrences can be replaced without breaking :

1.
typo3/sysext/core/Classes/Resource/Driver/LocalDriver.php:472

$iterator = new \RecursiveIteratorIterator(
new \RecursiveDirectoryIterator($path, $iteratorMode),
\RecursiveIteratorIterator::SELF_FIRST,
\RecursiveIteratorIterator::CATCH_GET_CHILD
);

2.
/typo3/sysext/scheduler/Classes/Task/RecyclerGarbageCollectionTask.php:80

$directoryContent = new \RecursiveIteratorIterator(
new \RecursiveDirectoryIterator($directory),
\RecursiveIteratorIterator::LEAVES_ONLY,
\RecursiveIteratorIterator::CATCH_GET_CHILD
);

See attached patch.


Files

Actions #1

Updated by Martin Terber over 8 years ago

  • Assignee set to Steffen Ritter

Hi Steffen, I don't know if assigning the issue is necessary. Feel free to assign it to someone else.

Actions #2

Updated by Martin Terber over 8 years ago

Correction: The patch actually provides three occurrences.

Actions #3

Updated by Martin Terber over 7 years ago

  • Assignee deleted (Steffen Ritter)
  • Target version deleted (6.2.16)
Actions #4

Updated by Martin Terber over 7 years ago

I was not able to reproduce this in TYPO3 8.4.0.
The Scheduler task "File Abstraction Layer: Update storage index (scheduler)" is executed successfully without errors.

Unfortunately, I was not able to reproduce it in 6.2.26 locally.
However, I don't know if this means this bug is obsolete.

Actions #5

Updated by Sascha Egerer over 7 years ago

  • Status changed from New to Accepted
  • Assignee set to Sascha Egerer
Actions #6

Updated by Gerrit Code Review over 7 years ago

  • Status changed from Accepted to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/49852

Actions #7

Updated by Gerrit Code Review over 7 years ago

Patch set 2 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/49852

Actions #8

Updated by Jan Helke over 7 years ago

  • Sprint Focus set to On Location Sprint
Actions #9

Updated by Gerrit Code Review over 7 years ago

Patch set 3 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/49852

Actions #10

Updated by Gerrit Code Review over 7 years ago

Patch set 1 for branch TYPO3_7-6 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/50128

Actions #11

Updated by Sascha Egerer over 7 years ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100
Actions #12

Updated by Benni Mack over 5 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF