Project

General

Profile

Actions

Bug #62358

closed

Empty imageResource and read permission check on /

Added by Stephan Lucas about 10 years ago. Updated over 8 years ago.

Status:
Closed
Priority:
Could have
Assignee:
-
Category:
-
Target version:
-
Start date:
2014-10-20
Due date:
% Done:

0%

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

Description

I ran into trouble because of massive warning messages in typo3temp/logs/typo3.log. The messages had all an equal topic like:
Mon, 01 Jan 2014 23:59:59 +0200 [WARNING] request="xxxxxxxxx" component="TYPO3.CMS.Frontend.ContentObject.ContentObjectRenderer": The image "" could not be found and won't be included in frontend output

The source for the log entries resides in the \TYPO3\CMS\Frontend\Page\PageGenerator::renderContentWithHeader(). Around line 896 a background image for the body tag will included while configured:

if ($bgImg = $GLOBALS['TSFE']->cObj->getImgResource($GLOBALS['TSFE']->pSetup['bgImg'], $GLOBALS['TSFE']->pSetup['bgImg.'], 'bgImg')) {
    $bodyTag = preg_replace('/>$/', '', trim($bodyTag)) . ' background="' . $GLOBALS['TSFE']->absRefPrefix . $bgImg[3] . '">';
}

The function getImgResource() is called every time even if pSetup is empty. In the catch block of the getImgResource() the log entries are assembled.

But the trigger (throw) for the the try/catch resides in \TYPO3\CMS\Core\Resource\ResourceStorage::assureFolderReadPermission():

protected function assureFolderReadPermission(Folder $folder = NULL) {
    if (!$this->checkFolderActionPermission('read', $folder)) {
        throw new Exception\InsufficientFolderAccessPermissionsException('You are not allowed to access the given folder', 1375955684);
    }
}

I followed the permission function and finaly found the problem. In my case the root directory (/) had the permissions rwx--x--x. The check failed because TYPO3 tries to include an empty background image and has'nt the permission to read the / folder. I changed the permissions to rwxr-xr-x and the log is quiet now.

I'm not sure if this is realy a bug. But maybe there are some improvements:
  • The exception #1375955684 is catched, but the message and code gets not logged.
  • The install tool should check for read permission on /
  • getImgResource could earlier check for an empty file and skip this deep filesystem checks
Actions

Also available in: Atom PDF