[TYPO3-dev] t3lib_div::fixPermissions lacks support for directories

Ernesto Baschny [cron IT] ernst at cron-it.de
Mon Mar 8 16:52:42 CET 2010


Stefan Geith schrieb am 08.03.2010 16:46:

> t3lib_div::fixPermissions($file) only supports Permissons for _files_.
> 
> Shouldn't it also support fixing permissions for directories ?
> For a project I had to create subdirectories of typo3temp and so a found
> out, that this is not supported.
> 
> Maybe fixPersmission could be changed like this:
> 
> ...
>   } elseif (@is_dir($file)) {
>     @chmod($file,
> octdec($GLOBALS['TYPO3_CONF_VARS']['BE']['folderCreateMask']));       
>     if($GLOBALS['TYPO3_CONF_VARS']['BE']['createGroup']) {   
>       @chgrp($file, $GLOBALS['TYPO3_CONF_VARS']['BE']['createGroup']);   
>     }
>   }
> ...
> 
> Is there an interest in fixing this ?
> Should I create a patch and a bugtracker entry ?

I think this is usually not needed, because if you need a new directory,
you create it with t3lib_div::mkdir, which respects folderCreateMask and
createGroup.

fixPermissions just exists because there are so many ways a "new file"
can be created.

So I have never had the need for that, but I would be of "neutral"
opinion if this would be considered as an addition for fixPermissions.

Thinking about an use-case maybe if you use "unzip" which creates
subdirectories, this might be useful. But then a
"fixPermissionsRecursive()" would also be useful.

Cheers,
Ernesto




More information about the TYPO3-dev mailing list