#71328File Abstraction Layer: Update storage index fails when it encounters unreadable directories (e.g., .git)
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.