Project

General

Profile

Actions

Bug #23193

closed

Rendering images with ImageMagick fails to set file permissions

Added by Manuel Thaler about 14 years ago. Updated almost 6 years ago.

Status:
Closed
Priority:
Should have
Category:
-
Target version:
-
Start date:
2010-07-15
Due date:
% Done:

0%

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

Description

I've installed TYPO3 4.4. Everything worked well, except the Images in the Output seem to be screwed up.

Basically: If I insert an image in de BE in any content element, the image turns up. If I try to manipulate the image either in the size or in the rendering behaviour, the image doesn't turn up anymore. The images somehow seem to be created in the typo3temp/pics/ folder. But the file-permissions seem to turn wrong.

All image-files created in the content with any special behaviour own the filepermissions 6 0 0 which basically is wrong.

After changing the permissions with ftp-service, the pictures are beeing showed in the FE.

Basically what i know is the filepermissions (600) settings are beeing caused/set by tempnam().

I've tried to create the sub-folder pics in typo3temp either by ftp and by typo3. nothing helps me solving this problem so far.

(issue imported from #M15133)


Files

ScreenHunter_08 Jul. 15 14.00.gif (4.42 KB) ScreenHunter_08 Jul. 15 14.00.gif Administrator Admin, 2010-07-15 14:01
ScreenHunter_09 Jul. 15 14.34.gif (4.89 KB) ScreenHunter_09 Jul. 15 14.34.gif Administrator Admin, 2010-07-15 14:35
15133.diff (736 Bytes) 15133.diff Administrator Admin, 2010-07-15 18:11
bug_15133.diff (735 Bytes) bug_15133.diff Administrator Admin, 2010-07-15 18:33
bug_15133_v2.diff (1.05 KB) bug_15133_v2.diff Administrator Admin, 2010-07-25 21:37
15133_v4-4.4.diff (2.25 KB) 15133_v4-4.4.diff Administrator Admin, 2011-01-10 21:18
15133_v4-trunk.diff (2.25 KB) 15133_v4-trunk.diff Administrator Admin, 2011-01-10 21:18
Actions #1

Updated by Chris topher about 14 years ago

Hi Manuel,

there is an option in the Install Tool to set the file permissions. Search in "All Configuration".
Is the value which is set there correct? And is it used or is it not?

Actions #2

Updated by Manuel Thaler about 14 years ago

Hi Christopher

Thank you for your fast reply. To be honest: There is a file-permission-flag set in the install tool. I've quickly attached you a screenshot of the current setting in my system-installation.

Even if i change both of these values from 0755 to new 755 it doesn't help.

Actions #3

Updated by Manuel Thaler about 14 years ago

I also added new information about the current settings in the second screenshot. mybe this helps solving the problem...

Actions #4

Updated by Alexander Grein about 14 years ago

I can confirm that problem. It is typical for apache servers running fastcgi with php. typo3 needs to change the permissions after generating the temp files. otherwise the permissions will be 0600. The BE settings mentioned above seem not to work anymore since the update to 4.4.0.

Actions #5

Updated by Manuel Thaler about 14 years ago

To be honest, I've tried on and detected there is a thumbnail-preview in the system itsselfs which allows you to preview the files exactly the way it should work.

There is a public Function in class.t3lib_div.php which intends to repair / to fix file and folder permissions. But somehow it seems to be either the correct BE-Function/Class or the one from the FE with errors....

public static function fixPermissions($path, $recursive = FALSE) {

Actions #6

Updated by Chris topher about 14 years ago

It would be great, if you could figure out, how that worked in older versions and why it does not work anymore now.
I think then you already have the fix. :-)

Actions #7

Updated by Manuel Thaler about 14 years ago

I can make out two basic changes between an elder and the current TYPO3 version for so far:

first of all, earlier TYPO3 developer used "t3lib_div::" insted of the new used "self::" calls in their functions, seccondly they used to include a newer function called "fixPermissions()". These two are the main changes in the used procedures in my point of view.

f.e. in the function writeFileToTypo3tempDir($filepath,$content):

if (self::validPathStr($filepath) && $fI['basename'] && strlen($fI['basename'])<60) {
if (self::isFirstPartOfStr($fI['dirname'],$dirName)) {
self::mkdir_deep(PATH_site.'typo3temp/', $subdir);
self::writeFile($filepath, $content);

Earlier on the mentioned parts looked like this:
if (t3lib_div::validPathStr($filepath) && $fI['basename'] && strlen($fI['basename'])<60) {
if (t3lib_div::isFirstPartOfStr($fI['dirname'],$dirName)) {
t3lib_div::mkdir_deep(PATH_site.'typo3temp/', $subdir);
t3lib_div::writeFile($filepath, $content);

I also tried to check further files - such as PDF-Documents with a preview. The PDF Preview doesn't turn up in the FE. So there must definitively be somtehing wrong with the file permissions.

by the way: The use of 0755 instead of 755 should be taken, because the octdez() function, which is used in TYPO3.

Actions #8

Updated by Alexander Grein about 14 years ago

we think we solved the problem: just add

$path = (self::isAbsPath($path)) ? PATH_site . $path : $path;
before
if (self::isAllowedAbsPath($path)) {
in fixPermissions declareation.
The problem referes to a absolut path problem when the image path is put into the fixPermissions function. The "isAllowedAbsPath" will always return false if the path is not absolute.

Actions #9

Updated by Chris topher about 14 years ago

Using self:: is done for performance reasons. I think, this does not cause the problem.

The function fixPermissions() is new; most probably it is the reason for this issue.
It was integrated in #3977. Here is a diff-view:
http://forge.typo3.org/projects/typo3v4-core/repository/revisions/7430/diff

Actions #10

Updated by Manuel Thaler about 14 years ago

Alexander Grein: That's it! Nice, cheers!

Can you add the diff-view/Bugfix on this Thread? This seems to work very well!

Christopher: Maybe this didn't work in your point of view because might not have cleaned up the Cache. As soon I've cleaned it up - the pictures turned up well!

Thank you Alex!

By the way: does anyone in here know how i can pay the fee of 30 euros? the description isn't available here - or maybe I didn't finde it....

Actions #11

Updated by Chris topher about 14 years ago

Alex: Please attach the patch file here and send it as an RFC to Core List. Then it will be included in the next versions.
See http://typo3.org/teams/core/core-mailinglist-rules

Manuel, Alex: You should exchange your e mail addresses or phone numbers so that you can clear that.

Actions #12

Updated by Alexander Grein about 14 years ago

Hello Manuel,

you can use PayPal to send me the money.
My Email for this is a.grein [Klammeraffe] mediaessenz.de

Thanks!

Actions #13

Updated by Alexander Grein about 14 years ago

bug_0015133.diff is made against current trunk version

Actions #14

Updated by Alexander Grein about 14 years ago

Christopher:
I have looked into the core-mailing-ist-rules page, but get no idea, how to do this.
Can you please explain me, how i can do this.

Actions #15

Updated by Manuel Thaler about 14 years ago

Deutsche Anleitung zu diesem Thread:
http://www.typo3.net/forum/list/list_post//100055/

Actions #16

Updated by Manuel Thaler about 14 years ago

Hi Guys... actually i wanted to quit this thread, but didn't get any chance or button to finish up this right now... could you then please assign the complete flag? cheers

Actions #17

Updated by Chris topher about 14 years ago

@ Alex:
You need a newsreader. For example Outlook (Express), Windows Live Mail or Thunderbird.
Use the newsreader of your choice and subscribe to the newsgroups at lists.typo3.org
The port (if asked for) is 119.

You will see, that there are several newsgroups on that server; you need to subscribe to the one called typo3.teams.core.

This is the newsgroup you must post a new mail to.
Just have a look at all the other thread-starting-mails there. They all look as described here: http://typo3.org/teams/core/core-mailinglist-rules#c4741
Just copy that scheme and put in the title, description and so on from this bug report. Don't forget to attach the patch!

Happy posting!

Actions #18

Updated by Chris topher about 14 years ago

@ Manuel:
That is right that way.
This issue will be set to resolved, when Alex' bugfix has been integrated in the TYPO3 SVN repository. (The SVN repository is the place where the source code for the next versions of TYPO3 is stored.)

To get that done, Alex has to post his patch in the Core List (as described above).
In this thread (in Core List), you should then give your "+1 on reading and testing", because you successfully tested the patch. After at least two "+1"s the patch can be integrated in the repository (which will be done by a Core Developer).

Actions #19

Updated by Manuel Thaler about 14 years ago

Christopher
Thanx for guiding through and for your time and patiency. " Why do noobs always ask such adorable questions ;)"

Actions #20

Updated by Alexander Grein about 14 years ago

I have posted the request in the typo3 core list.

Christopher: Thanks for help.

Manuel: Please do the "+1 on reading and testing" part

Actions #21

Updated by Manuel Thaler almost 14 years ago

+1

Actions #22

Updated by Manuel Thaler almost 14 years ago

I'm sorry, but i don't find any +1 on reading and testing.... nowhere in bugtracker... how do I manage this? how do I set it to solved with patch status?

Actions #23

Updated by Christian Kuhn over 13 years ago

  • trunk rev. 10019
  • 4.4 rev. 10020
Actions #24

Updated by Benni Mack almost 6 years ago

  • Status changed from Resolved to Closed
Actions

Also available in: Atom PDF