[TYPO3-dam] dam_index external tools

Xavier Perseguers typo3 at perseguers.ch
Wed Apr 16 15:58:10 CEST 2008


Hi,

>> 1) the tests in both classes I described above and located in t3lib_dir 
>> do checks using the "@" prefix to functions is_dir() and 
>> is_executable(). That is any warning (such as the openbase_dir 
>> restriction) will not be put in the PHP error log. I think this is a 
>> problem that should be tackled with as it is complicated to track down 
>> such issues.
> 
> The @ prefix must not be removed. However, the error should be checked 
> for. The thing is that we can't afford to have random PHP messages 
> popping all over the place. So the use of @ is good. But obviously 
> situations where error can occure should be checked for and caught.

I further investigated this and found a weird behaviour:

In my Apache configuration I set this (stripped down):

php_admin_value open_basedir /var/www/somedir:/var/www/bin

in /var/www/bin, I have for instance

pdftotext -> /usr/bin/pdftotext

Now, if I try to test whether /var/www/bin/pdftotext is executable, I 
get that pdftotext is not within the allowed path (openbase_dir 
restriction). However If I create a dumb executable:

$ touch /var/www/bin/toto
$ chmod /var/www/bin/toto

then it's OK to test whether it is executable or not. This means that 
either is_executable (and is_link) PHP functions are buggy when dealing 
with symbolic links and openbase_dir restriction or it's only a bug on 
my distribution.

The only solution I found was to list *all* executables as "openbase_dir":

php_admin_value open_basedir /var/www/somedir:/var/www/bin/pdftotext

It seems very strange!


More information about the TYPO3-project-dam mailing list