Project

General

Profile

Actions

Bug #62358

closed

Empty imageResource and read permission check on /

Added by Stephan Lucas over 9 years ago. Updated almost 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 #1

Updated by Riccardo De Contardi about 8 years ago

  • Description updated (diff)
  • Status changed from New to Needs Feedback

I am ashamed for this very long answer time;

could it be that your problem has been solved with https://forge.typo3.org/issues/55833 ? could you try with the latest 6.2 version or 7.6 ? Thank you!

Actions #2

Updated by Riccardo De Contardi almost 8 years ago

  • Description updated (diff)
  • Status changed from Needs Feedback to Closed

No feedback within the last 90 days => closing this ticket.

If you think that this is the wrong decision or experience this issue again, then please open a new ticket and add a relation to this ticket number.

Thank you

Actions

Also available in: Atom PDF