Project

General

Profile

Actions

Bug #53854

closed

Exception if a directory in storage isn't readable

Added by Alexander Opitz over 10 years ago. Updated over 10 years ago.

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

0%

Estimated time:
TYPO3 Version:
6.0
PHP Version:
Tags:
Complexity:
Is Regression:
No
Sprint Focus:

Description

Exception message: "You are not allowed to access the given folder"

For example if the fileadmin is an own mount, it may be that a lost+found directory is created which is only accessible for root


Related issues 1 (0 open1 closed)

Is duplicate of TYPO3 Core - Task #51512: Unreadable directories cause exceptionsClosedSteffen Ritter2013-08-29

Actions
Actions #1

Updated by Markus Klein over 10 years ago

Is this valid up to 6.2?

Actions #2

Updated by Alexander Opitz over 10 years ago

Yes it is.

Actions #3

Updated by Steffen Ritter over 10 years ago

  • Status changed from Accepted to Needs Feedback

Which "use case" are you talking about?
In general those exceptions are correct - in normal use cases they just should not be exposed to the UI

Actions #4

Updated by Stefan Froemken over 10 years ago

I have the same error:

Backtrace:

6 TYPO3\CMS\Core\Resource\ResourceStorage::assureFolderReadPermission(TYPO3\CMS\Core\Resource\Folder)

typo3_src-6.2.0-2014-01-16/typo3/sysext/core/Classes/Resource/ResourceStorage.php:
01990: $data = $this->driver->getFolderInfoByIdentifier($identifier);
01991: $folder = ResourceFactory::getInstance()->createFolderObject($this, $data['identifier'], $data['name']);
01992: $this->assureFolderReadPermission($folder);
01993:
01994: return $folder;

5 TYPO3\CMS\Core\Resource\ResourceStorage::getFolder("/user_upload/")

typo3_src-6.2.0-2014-01-16/typo3/sysext/core/Classes/Resource/ResourceStorage.php:
01979: */
01980: public function getDefaultFolder() {
01981: return $this->getFolder($this->driver->getDefaultFolder());
01982: }
01983:

4 TYPO3\CMS\Core\Resource\ResourceStorage::getDefaultFolder()

Actions #5

Updated by Alexander Opitz over 10 years ago

  • Status changed from Needs Feedback to New

@Steffen

Not only that the Exception is viewed to the User, also the rest of reading files/folders stops.

Actions #6

Updated by Stefan Froemken over 10 years ago

In ResourceStorage all rights for the redacteur are set to FALSE regardless if they are set in userGroup or not. I will move on with further debugging.

Stefan

Actions #7

Updated by Alexander Opitz over 10 years ago

This issue haven't to do with the editor/user rights in TYPO3 backend. It has to do with the user/process access rights on the file system of the operation system.

Actions #8

Updated by Stefan Froemken over 10 years ago

Oh dear. I think I have it. Have a look into:

$TCA['be_groups']['columns']['file_permissions']['config']['default'] = 'readFolder,writeFolder,addFolder,renameFolder,moveFolder,deleteFolder,readFile,writeFile,addFile,renameFile,moveFile,files_copy,deleteFile';

We have updated our TYPO3 4.7 to TYPO3 6.2 and these values are not set to be_user/be_group while update process. So for all users file_permissions is set to NULL. In combination with the default values from Storage where everything is FALSE it results FALSE for all rights, too.

I will set your defaults from TCA by SQL now, but I'm nearly sure that this is a problem in upgradeWizard.

Stefan

Actions #9

Updated by Stefan Froemken over 10 years ago

OK...Permissions are correct now, but now the next step checks for isWithinFileMount. This method calls isFirstPartOfStr with:
$str = /user_upload
$partStr = /user_upload/

You should see that this can't work. $this->canonicalizeAndCheckFileIdentifier($identifier); removes the appended / and that's why this method fails.

Stefan

Actions #10

Updated by Stefan Froemken over 10 years ago

I have added following to ResourceStorage in getFoldersInFolder:

foreach ($folderIdentifiers as $folderIdentifier) {
    try {
        $folders[$folderIdentifier] = $this->getFolder($folderIdentifier);
    } catch (Exception\InsufficientFolderAccessPermissionsException $e) {
    }
}

The Element Browser works now, but I don't know if this change will break somewhere else.

Stefan

Actions #11

Updated by Gerrit Code Review over 10 years ago

  • Status changed from New 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/26905

Actions #12

Updated by Steffen Ritter over 10 years ago

  • Status changed from Under Review to Closed

Closed as duplicate of issue
http://forge.typo3.org/issues/51512

Actions

Also available in: Atom PDF