Bug #16411
closedFiles in typo3temp/GB have wrong permissions
0%
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
Updated by Michael Stucki over 18 years ago
Please check if that line is still correct - at least it seems wrong in 4.0.1...
Updated by Andreas Stauder over 18 years ago
I never checks out a 4.0.1 Version. Is there a tar avail?
Anyway in the currently Version under http://svn.t3.digitaldistrict.de/cgi-bin/trac.cgi/browser/typo3/TYPO3core/branches/TYPO3_4-0/t3lib
line 2737 is unchanged.
If 'convert' in imageMagickExec() or 'combine' in combineExec() are called the fixPermission will be done.
CORRECTION: New Code should be
t3lib_div::fixPermissions($file);
NOT
t3lib_div::fixPermissions($gifFileName);
Updated by Batomo over 17 years ago
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.
Updated by Jesuar ben over 16 years ago
hi,
have same bug in 4.2.0 this bug-fix dosen´t work anymore.
Updated by Isidor Zeuner over 16 years ago
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.
Updated by Martin Schönbeck over 16 years ago
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.
Updated by Christian Kuhn over 15 years ago
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.