[TYPO3-core] RFC #3977: Bugfix: Permissions not set on extracted localization-files

Lars Houmark lars at houmark.com
Sat Apr 17 23:21:00 CEST 2010


Hi,

This is a SVN patch request.

Type: Bugfix

BT reference: http://bugs.typo3.org/view.php?id=3977

Branches: trunk, 4.3

Problem: When updating translations from TER in the EM, the unzipped 
files is not chmod'ed correctly, which can lead into problems, when they 
later need to be replaced if the language file is updated.

Solution: Improve t3lib::fixPermissions with an extra parameter, that 
makes it fix permissions recursively.

How to test:

First set in localconf.php:
$TYPO3_CONF_VARS['BE']['fileCreateMask'] = '0664';
$TYPO3_CONF_VARS['BE']['folderCreateMask'] = '0775';

Before adding the patch:

- Delete the typo3conf/l10n folder and any sub folders
- Delete all *l10n* zip files in typo3temp
- Select one language ie. de or dk in the EM - Translation handling mod
- Run the update

The typo3conf/l10n/ and subfolders are created, look inside different 
extension folders and see that different xml files have different chmod, 
some rw+rw+x, others only rw+r+x - depending on what they were in the 
zip file.

Apply the patch. Repeat the delete procedure and update again. All files 
and folders should have the correct chmod.

Notes:
In the process I simplified the t3lib_div::mkdir function, since the 
configuration and statement for fixing permissions was repeated there. 
The function now makes use of the fixPermissions function as well.

Besides that, minor CGL improvements.

The patch was originally made about 2 (or more?) years ago by Andreas 
Wolf, but never made it further. I have reviewed the solution, and 
thought about other potential implementations, but the swap of unzip 
method in the EM makes the it difficult to optimize the operation more, 
without having overhead in another way, which is why I ended up going 
with this one ;)

Patch is v3, as v1 and v2 is already in the bug tracker. The patch 
should apply to both trunk and the 4.3 branch (with offset).

-- Lars Houmark

-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: bug_3977_v3.diff
URL: <http://lists.typo3.org/pipermail/typo3-team-core/attachments/20100417/09e9865d/attachment.txt>


More information about the TYPO3-team-core mailing list