Project

General

Profile

Actions

Bug #55833

closed

Creation of typo3temp/_processed_/ required write access to root folder

Added by Alexander Stehlik almost 11 years ago. Updated about 7 years ago.

Status:
Closed
Priority:
Should have
Category:
File Abstraction Layer (FAL)
Target version:
Start date:
2014-02-10
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
6.2
PHP Version:
5.4
Tags:
Complexity:
medium
Is Regression:
No
Sprint Focus:

Description

Steps to reproduce:

  1. Use an image file in you template that comes from the fallback storage (which uses typo3temp/_processed_/ as processing folder)
  2. make sure the imge gets resized (e.g. by setting the width property)
  3. Prevent write access for the Webserver to the TYPO3 root folder, but allow write access to typo3temp/
  4. 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.


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Bug #56388: _preocessed_ not using fileCreateMaskClosed2014-02-27

Actions
Actions #1

Updated by Steffen Ritter almost 11 years ago

  • Target version deleted (6.2.0)
Actions #2

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. -

Actions #3

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?

Actions #4

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:

  1. Use an image file in you template that comes from the fallback storage (which uses typo3temp/_processed_/ as processing folder)
  2. make sure the imge gets resized (e.g. by setting the width property)
  3. Prevent write access for the Webserver to the TYPO3 root folder, but allow write access to typo3temp/
  4. 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.

Actions #5

Updated by Christian Weiske over 10 years ago

This problem also happens with "Help > About modules" and "Help > About TYPO3 CMS".

Actions #6

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.

Actions #7

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.

Actions #8

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.

Actions #9

Updated by Mathias Schreiber almost 10 years ago

  • Target version set to 7.1 (Cleanup)
  • Sprint Focus set to On Location Sprint
Actions #10

Updated by Ingo Schmitt almost 10 years ago

  • Status changed from New to In Progress
  • Assignee set to Roman Schürmann
Actions #11

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

Actions #12

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

Actions #13

Updated by Sebastian Fischer almost 10 years ago

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

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

Actions #15

Updated by Sebastian Fischer almost 10 years ago

  • Status changed from Under Review to Resolved
Actions #16

Updated by Anja Leichsenring almost 9 years ago

  • Sprint Focus deleted (On Location Sprint)
Actions #17

Updated by Riccardo De Contardi about 7 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF