Bug #53854
Exception if a directory in storage isn't readable
Status: | Closed | Start date: | 2013-11-22 | |
---|---|---|---|---|
Priority: | Should have | Due date: | ||
Assigned To: | - | % Done: | 0% |
|
Category: | File Abstraction Layer (FAL) | Spent time: | - | |
Target version: | - | |||
TYPO3 Version: | 6.0 | Is Regression: | No | |
PHP Version: | Sprint Focus: | |||
Complexity: |
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
Associated revisions
[BUGFIX] Exception if directories are not readable
If a user has listing rights on a folder which contains
folders he does not have access to the user currently
will end up with Exceptions in folder trees, file lists
as well as element browsers.
Before FAL these folders just have been shown "locked".
This change introduces an "InaccessibleFolder" object
which will be created by the storage if a Folder is
requested which exists but there is no read access while
the user is allowed to list the contents of the parent
folder.
In addition the components have been adapted to use this
new information for a graceful behaviour.
WIP: Did not adapt the tests yet, since I need to do some
urgent customer work. Feel free to go on with that.
Resolves: #51512, #53854
Releases: 6.2
Change-Id: If5c234fe66d1930e4cc0cb16279d2f77874d82db
Reviewed-on: https://review.typo3.org/26905
Tested-by: Ingo Schmitt
Reviewed-by: Anja Leichsenring
Tested-by: Anja Leichsenring
Reviewed-by: Ingo Schmitt
Reviewed-by: Steffen Ritter
Tested-by: Steffen Ritter
History
#1 Updated by Markus Klein over 1 year ago
Is this valid up to 6.2?
#2 Updated by Alexander Opitz over 1 year ago
Yes it is.
#3 Updated by Steffen Ritter over 1 year 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
#4 Updated by Stefan Froemken over 1 year 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()
#5 Updated by Alexander Opitz over 1 year 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.
#6 Updated by Stefan Froemken over 1 year 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
#7 Updated by Alexander Opitz over 1 year 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.
#8 Updated by Stefan Froemken over 1 year 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
#9 Updated by Stefan Froemken over 1 year 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
#10 Updated by Stefan Froemken over 1 year 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
#11 Updated by Gerrit Code Review over 1 year 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
#12 Updated by Steffen Ritter over 1 year ago
- Status changed from Under Review to Closed
Closed as duplicate of issue
http://forge.typo3.org/issues/51512