Project

General

Profile

Actions

Bug #16411

closed

Files in typo3temp/GB have wrong permissions

Added by Andreas Stauder over 18 years ago. Updated over 14 years ago.

Status:
Closed
Priority:
Should have
Category:
Communication
Target version:
-
Start date:
2006-07-28
Due date:
% Done:

0%

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

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

class.tslib_gifbuilder.php (648 Bytes) class.tslib_gifbuilder.php Administrator Admin, 2007-04-03 14:57
class.tslib_menu.php (889 Bytes) class.tslib_menu.php Administrator Admin, 2007-04-03 15:03
class.tx_install.php (3.43 KB) class.tx_install.php Administrator Admin, 2007-04-03 15:03
class.t3lib_stdgraphic.php (2.51 KB) class.t3lib_stdgraphic.php Administrator Admin, 2007-09-17 22:42
class.t3lib_svbase.php (608 Bytes) class.t3lib_svbase.php Administrator Admin, 2007-09-17 22:46
fix-permissions.diff (521 Bytes) fix-permissions.diff Administrator Admin, 2008-05-21 11:08
3949_v1.diff (1.7 KB) 3949_v1.diff Administrator Admin, 2009-02-27 12:35

Related issues 3 (0 open3 closed)

Has duplicate TYPO3 Core - Bug #20098: Files in typo3temp/menu have wrong permissionsClosedChristian Kuhn2009-02-27

Actions
Has duplicate TYPO3 Core - Bug #16407: Files in typo3temp/menu have wrong permissionsClosedChristian Kuhn2006-07-26

Actions
Has duplicate TYPO3 Core - Bug #17768: GIFBUILDER creates wrong access rights in typo3temp/GB and typo3temp/menuClosedChristian Kuhn2007-11-08

Actions
Actions #1

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...

Actions #2

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);

Actions #3

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.

Actions #4

Updated by Jesuar ben over 16 years ago

hi,

have same bug in 4.2.0 this bug-fix dosen´t work anymore.

Actions #5

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.

Actions #6

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.

Actions #7

Updated by Christian Kuhn over 15 years ago

Confirmed. Will have a look.

Actions #8

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.

Actions #9

Updated by Michael Stucki over 15 years ago

Will be fixed in TYPO3 4.2.7.

Actions

Also available in: Atom PDF