Bug #55833
closedCreation of typo3temp/_processed_/ required write access to root folder
100%
Description
Steps to reproduce:
- Use an image file in you template that comes from the fallback storage (which uses
typo3temp/_processed_/
as processing folder) - make sure the imge gets resized (e.g. by setting the width property)
- Prevent write access for the Webserver to the TYPO3 root folder, but allow write access to
typo3temp/
- Open the Frontend
You will get an Exception:
#1323059807: You are not allowed to create directories in the folder "/"
The problem occurs during this call:
TYPO3\CMS\Core\Resource\ResourceStorage::createFolder("typo3temp/_processed_/")
Even if the typo3temp/
folder exists the ResourceStorage will check if the root directory is writable.
I would suggest to add a new createFolderRecursive method, which accepts an array of folder names that are created recursively. This would allow a permission check for every directory in the path, but only if the directory does not exist already.
Updated by Christian Weiske over 10 years ago
-This problem affects the vidi extension (and thus the media mangement extension) which is not able to create typo3temp/_processed_
anymore in 6.2. -
Updated by Sebastian Fischer over 10 years ago
Should the folder processed realy get created in typo3temp? The folder already exists in fileadmin. Cant this folder be used?
Updated by Guido Palacios over 10 years ago
Hello,
i don't know if this is the right place for posting following hint...
But in my case (Upgrade from 4.6 to 4.7 and then 4.7 to 6.2) clicking the fileadmin shows this error... The same when i try to select an image (in the occurring popup) via normal Image CE.
After several "comment-out" tries (Patch 1-4) in /Core/Classes/Resource/ResourceStorage.php nothing helped. Later i figured out that the problem was wrongly merged Database/File Mounts. They wasn't configured "relative" and the target was "/" and not "fileadmin/".
After changing this, the resource error doesn't appear anymore. the strange thing is - it's a windows xampp dev env.
Could this be a solution or do i don't understand the Bug-Report again?!
Cheers and best regards
Guido
Alexander Stehlik wrote:
Steps to reproduce:
- Use an image file in you template that comes from the fallback storage (which uses
typo3temp/_processed_/
as processing folder)- make sure the imge gets resized (e.g. by setting the width property)
- Prevent write access for the Webserver to the TYPO3 root folder, but allow write access to
typo3temp/
- Open the Frontend
You will get an Exception:
#1323059807: You are not allowed to create directories in the folder "/"
The problem occurs during this call:
[...]
Even if the
typo3temp/
folder exists the ResourceStorage will check if the root directory is writable.I would suggest to add a new createFolderRecursive method, which accepts an array of folder names that are created recursively. This would allow a permission check for every directory in the path, but only if the directory does not exist already.
Updated by Christian Weiske over 10 years ago
This problem also happens with "Help > About modules" and "Help > About TYPO3 CMS".
Updated by Bernhard Kraft over 10 years ago
This issue boils down to one of the new concepts in 6.2:
- New TYPO3 version don't assume that "typo3temp" must exist. If it doesn't it will create it.
- Therefore newer TYPO3 versions must have write permissions to the webroot "/" where typo3temp resides in.
Of course it sounds logically that it should also work when typo3temp/ has been manually created. But it currently doesn't because of an issue in ResourceStorage.php
The solution would be to fix method "checkFolderActionPermission" in ResourceStorage.php
In fact this method seems to be incomplete for its purpose. Besides the $action parameter it only gets one other parameter "$folder". But for many operations like "copy" or "move" and also "add" two parameters should be required: The source and the target. In the case of "add" both parameters could get concatenated and then traversed backwards to find the first non-existing folder. Those parent folder would have to be writable.
Updated by Bernhard Kraft over 10 years ago
The method "createFolder" is thus used in a way that it must be able to handle recursive creation of folders. If typo3temp doesn't exists, createFolders would be responsible for recursively creating it.
For this purpose it would be necessary to operate on the parts of a folder path. So I assume there is a method "splitPath" missing for the drivers.
Files in a filesystem tend to be organized in folders and files. A file can get specified by a path. So there needs to be a way to split up a path into its particles: instances of "Folder" and "File" in the case of FAL.
Updated by Adrien Crivelli about 10 years ago
Agree with Bernhard Kraft. It should find the first existing parent and check their rights instead of the root folder.
In my case we have a custom script deleting all files in typo3temp/
, but not the folder itself. After this operation TYPO3 fails to re-create typo3temp/_processed_/
because it does not have rights on typo3temp
parent, which actually has nothing to do with the creation of typo3temp
subfolders.
Updated by Mathias Schreiber almost 10 years ago
- Target version set to 7.1 (Cleanup)
- Sprint Focus set to On Location Sprint
Updated by Ingo Schmitt almost 10 years ago
- Status changed from New to In Progress
- Assignee set to Roman Schürmann
Updated by Gerrit Code Review almost 10 years ago
- Status changed from In Progress 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 http://review.typo3.org/36557
Updated by Gerrit Code Review almost 10 years ago
Patch set 1 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/36560
Updated by Sebastian Fischer almost 10 years ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset af5baf5591d4f4fddeeba98c012db9a0c11c5605.
Updated by Gerrit Code Review almost 10 years ago
- Status changed from Resolved to Under Review
Patch set 2 for branch TYPO3_6-2 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at http://review.typo3.org/36560
Updated by Sebastian Fischer almost 10 years ago
- Status changed from Under Review to Resolved
Applied in changeset 59a444969f2c05e0c56950571e417451e0512574.
Updated by Anja Leichsenring almost 9 years ago
- Sprint Focus deleted (
On Location Sprint)
Updated by Riccardo De Contardi about 7 years ago
- Status changed from Resolved to Closed