Bug #25699
closedindexing of external files may be prevented by php's open_basedir restriction (Bug 18520 in core)
0%
Description
See
http://forge.typo3.org/issues/18520
***
class.external_parser.php tries to check the existence with is_file(). This fails in my case because of an existing open-basedir-restriction in php.
(issue imported from #M7969)
Updated by Christian Hernmarck about 13 years ago
What's going on with this issue?
what can I do to push this? In the core, bug 18520 has all patches for 4.3,4.4 and 4.5
I saw that in the new master branch someone (I'm new to git - could not see details..) worked on this file but instead of adding the open_basedir check (s)he kicked out the safemode check:
4.5 branch:
switch($extension) {
case 'pdf':
// PDF
if ($indexerConfig['pdftools']) {
$pdfPath = rtrim($indexerConfig['pdftools'], '/').'/';
if ($safeModeEnabled || (@is_file($pdfPath . 'pdftotext' . $exe) && @is_file($pdfPath . 'pdfinfo' . $exe))) {
$this->app['pdfinfo'] = $pdfPath.'pdfinfo'.$exe;
$this->app['pdftotext'] = $pdfPath.'pdftotext'.$exe;
// PDF mode:
$this->pdf_mode = t3lib_div::intInRange($indexerConfig['pdf_mode'],-100,100);
$extOK = TRUE;
} else $this->pObj->log_setTSlogMessage(sprintf($this->sL('LLL:EXT:indexed_search/locallang.xml:pdfToolsNotFound'), $pdfPath), 3);
} else $this->pObj->log_setTSlogMessage($this->sL('LLL:EXT:indexed_search/locallang.xml:pdfToolsDisabled'), 1);
break;
new master branch:
switch($extension) {
case 'pdf':
// PDF
if ($indexerConfig['pdftools']) {
$pdfPath = rtrim($indexerConfig['pdftools'], '/').'/';
if (@is_file($pdfPath . 'pdftotext' . $exe) && @is_file($pdfPath . 'pdfinfo' . $exe)) {
$this->app['pdfinfo'] = $pdfPath.'pdfinfo'.$exe;
$this->app['pdftotext'] = $pdfPath.'pdftotext'.$exe;
// PDF mode:
$this->pdf_mode = t3lib_div::intInRange($indexerConfig['pdf_mode'],-100,100);
$extOK = TRUE;
} else $this->pObj->log_setTSlogMessage(sprintf($this->sL('LLL:EXT:indexed_search/locallang.xml:pdfToolsNotFound'), $pdfPath), 3);
} else $this->pObj->log_setTSlogMessage($this->sL('LLL:EXT:indexed_search/locallang.xml:pdfToolsDisabled'), 1);
break;
I'll do some tests but I think is_file won't return true if either safemode is enabled (ok this will be no more a problem with PHP6...) or open_basedir is set (and does not include the path to the file...)
is_file needs php access to the file (open_basedir) - exec does not....
/Ch
Updated by Oliver Hader over 11 years ago
- Project changed from 1382 to TYPO3 Core
Updated by Wouter Wolters over 9 years ago
- Status changed from New to Needs Feedback
- TYPO3 Version set to 4.5
- Is Regression set to No
Hi,
as this issue is very old. Does the problem still exists within newer versions of TYPO3 CMS (6.2.9)?
Updated by Christian Hernmarck over 9 years ago
Yes - it does.
in Classes/FileContentParser.php we have this, as an example:
if (@is_file(($pdfPath . 'pdftotext' . $exe)) && @is_file(($pdfPath . 'pdfinfo' . $exe))) {
this won't pass when open_basedir ist activated - with this one it works:
if (ini_get('open_basedir') || (@is_file(($pdfPath . 'pdftotext' . $exe)) && @is_file(($pdfPath . 'pdfinfo' . $exe)))) {
php.ini:
open_basedir = "/var/www/virtual/<domain>:/usr/share/php:/var/www/webapps/:/usr/bin/"
I don't get an error (is_file... is not in allowed directory) but it's always false... even if file is there...)
Updated by Christian Hernmarck over 9 years ago
Sorry guys
I was wrong.
is_file works with open_basedir
It works with 6.2.9 out of the box.
My fault...
Updated by Alexander Opitz over 9 years ago
So this issue and #18520 can be closed?
Updated by Alexander Opitz about 9 years ago
- Status changed from Needs Feedback to Closed
No feedback within the last 90 days => closing this issue.
If you think that this is the wrong decision or experience this issue again, then please write to the mailing list typo3.teams.bugs with issue number and an explanation or open a new ticket and add a relation to this ticket number.