Bug #16411
closed
Files in typo3temp/GB have wrong permissions
Added by Andreas Stauder over 18 years ago.
Updated over 14 years ago.
Description
All files generated from t3lib/class.t3lib_stdgraphic.php in the folder typo3temp/GB have Permission 600 set. This makes it impossible to run a server config, where PHP runs under the user but apache under www-data.
Owner will be the user and www-data cannot read the GIF.
Fix this:
Add in line 2737 in t3lib/class.t3lib_stdgraphic.php:
t3lib_div::fixPermissions($gifFileName);
This bug is related to 0003935
(issue imported from #M3949)
Files
Please check if that line is still correct - at least it seems wrong in 4.0.1...
Uploaded files from 3.4.2007 corrects the same bug in V4.1.1 :
in files:
typo3/sysext/cms/tslib/class.tslib_gifbuilder.php
typo3/sysext/cms/tslib/class.tslib_menu.php
typo3/sysext/install/mod/class.tx_install.php
The problem is, that theres assumed that the files are written by the webserver (e.g. www-data) whats not true with suphp where .php-files are execute under the specific user but GIFs are read by the webserver. So we have to give the webserver explicit access to the files.
I don't know if the bug in t3lib/class.t3lib_stdgraphic.php still exists. I forgot in witch case the script is used. If someone can tell me the use case for this script I can take a look in it.
hi,
have same bug in 4.2.0 this bug-fix dosen´t work anymore.
In 4.2.1, .gif files created by typo3/sysext/cms/tslib/class.tslib_gifbuilder.php don't get their permissions adapted. The attached diff fixes this.
The same problem occurs with any file written by ImageWrite, if it didn't exists previously. So it also appears when doing using the gdlib-Test of the install-tool.
Confirmed. Will have a look.
Attached 3949_v1.diff
The reason for all this is that the permissions with which a file is created by php is not the same for all environments (eg. depends on apache umask).
So there is $TYPO3_CONF_VARS['BE']['fileCreateMask'] that is used in t3lib_div::fixPermissions to set permissions for a file created by php / exec() explicitly.
Attached patch now calls fixPermissions in t3lib/class.t3lib_stdgraphic.php method ImageWrite. So this problem should be solved for every class using this API.
Additionally imagepng / imagegif and imagejpeg only return boolean, this is now fixed accordingly in the javadoc of the method.
Will be fixed in TYPO3 4.2.7.
Also available in: Atom
PDF