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

Also available in: Atom PDF