[TYPO3-dev] Problem with t3lib_div:tempnam() with symLinked typo3temp-folder

Stefan Geith typo3dev2010.nospam1 at geithware.de
Mon Mar 8 16:55:04 CET 2010


Hi Devs,

for some reasons, I have a symlinked typo3temp-folder.

The only issues with this symlinked folder occur with the php-function 
tempnam(): it returns the name of the symlinked folder istead of the 
originally intended folder ...

Example:
/var/www/typo3temp is linked to /unsaved_data/typo3temp

then
   tempnam('/var/www/typo3temp/xxx')
returnes something like
   /unsaved_data/typo3temp/xxx_UX74F

and this breaks basedir-restrictions....


I did a quick (and dirty) fix fo this:
   public static function tempnam($filePrefix)	{
     $tmp = tempnam(PATH_site.'typo3temp/',$filePrefix);
     $n = strpos ($tmp, 'typo3temp/' . $filePrefix);
     if ($n) {
       $tmp = PATH_site . substr($tmp,$n);
     }
     return $tmp;
   }


Questions:
a) Is there an interest in fixing this ?
    Is this worth fixing ?
b) Any idea for a better solution ?
c) Should I create a patch and a bugtracker entry ?


/Stefan




More information about the TYPO3-dev mailing list