|
|
|
Possible issue if exec() disabled
|
|
Date: 2006/05/14 02:12
|
By: plumbley
|
Status: User
|
|
|
Karma: 0  
|
|
Fresh Joomlapolitan  | Posts: 2 |   | |
|
Hi - please excuse CB newbie if this is known issue - I've just installed CB today. Let me know if this is a proper bug and I should put on the tracker.
Issue: com_comprofiler may generate notices and warnings if PHP exec() is disabled (as is the case with e.g. my host, for security reasons).
My setup: PHP 4.4.2 Apache 1.3.34 WinXP MySQL 4.1.18 (MySQL client libs 3.23.49) php.ini includes: * disable_functions shell_exec,exec,system,passthru,popen * error_reporting 2047 Joomla 1.0.8 CB 1.0 Stable
To Reproduce: (1) Login as administrator (2) Go to the CB Configuration Manager (.../administrator/index2.php?option=com_comprofiler&task=showconfig)
Results: Various notices and warnings starting with: Notice: Undefined variable: output in c:program filesapache groupapachehtdocsjoomlaadministratorcomponentscom_comprofilerimgToolbox.class.php on line 626 Notice: Undefined variable: status in c:program filesapache groupapachehtdocsjoomlaadministratorcomponentscom_comprofilerimgToolbox.class.php on line 626 Warning: exec() has been disabled for security reasons in c:program filesapache groupapachehtdocsjoomlaadministratorcomponentscom_comprofilerimgToolbox.class.php on line 626 ... Here's the relevant bit from imgToolbox.class.php:
| Code: | function testIM(){
exec('convert -version', $output, $status);
...
}
function testNetPBM(){
exec('jpegtopnm -version 2>&1', $output, $status);
...
}
|
I guess this is looking to see what image software can be used. Sadly none since our host has blocked it
Other impacts: Cursory view of imgToolbox.class.php suggests it may rely on availability of exec() elsewhere, but perhaps only the ones at lines 626 and 634 really matter since the others will not be called of those fail.
Possible solution/workround: check ini_get(disable_functions) and give up on the tests immediately if it contains "exec". Here's what I did to fix it for me.
| Code: | $ diff imgToolbox.class.php imgToolbox.class.php.old
625,628d624
< // Check if exec() is disabled, e.g. for security reasons
< function isExecDisabled(){
< return in_array( 'exec', explode( ',',ini_get( 'disable_functions' ) ) );
< }
630,632d625
< if($this->isExecDisabled()){
< return false; // exec() is disabled, so give up
< }
641,643d633
< if($this->isExecDisabled()){
< return false; // exec() is disabled, so give up
< }
|
I hope this is useful.
Best wishes,
Mark.
|
|
The topic has been locked. |
|
|
|
|
Re:Possible issue if exec() disabled
|
|
Date: 2006/06/21 05:12
|
By: Curros
|
Status: User
|
|
|
Karma: 0  
|
|
Fresh Joomlapolitan  | Posts: 2 |   | |
|
Hi y have the same problem but y can´t find the directory where one is the file ini_get
Help PLEASE!!!
|
|
The topic has been locked. |
|
|
|
Re:Possible issue if exec() disabled
|
|
Date: 2006/06/21 15:58
|
By: beat
|
Status: Admin
|
|
|
Karma: 294  
|
|
Admin  | Posts: 5992 |   | |
|
plumbley wrote: Hi - please excuse CB newbie if this is known issue - I've just installed CB today. Let me know if this is a proper bug and I should put on the tracker.
Issue: com_comprofiler may generate notices and warnings if PHP exec() is disabled (as is the case with e.g. my host, for security reasons).
My setup: PHP 4.4.2 Apache 1.3.34 WinXP MySQL 4.1.18 (MySQL client libs 3.23.49) php.ini includes: * disable_functions shell_exec,exec,system,passthru,popen * error_reporting 2047 Joomla 1.0.8 CB 1.0 Stable
To Reproduce: (1) Login as administrator (2) Go to the CB Configuration Manager (.../administrator/index2.php?option=com_comprofiler&task=showconfig)
Results: Various notices and warnings starting with: Notice: Undefined variable: output in c:program filesapache groupapachehtdocsjoomlaadministratorcomponentscom_comprofilerimgToolbox.class.php on line 626 Notice: Undefined variable: status in c:program filesapache groupapachehtdocsjoomlaadministratorcomponentscom_comprofilerimgToolbox.class.php on line 626 Warning: exec() has been disabled for security reasons in c:program filesapache groupapachehtdocsjoomlaadministratorcomponentscom_comprofilerimgToolbox.class.php on line 626 ... Here's the relevant bit from imgToolbox.class.php:
| Code: | function testIM(){
exec('convert -version', $output, $status);
...
}
function testNetPBM(){
exec('jpegtopnm -version 2>&1', $output, $status);
...
}
|
I guess this is looking to see what image software can be used. Sadly none since our host has blocked it
Other impacts: Cursory view of imgToolbox.class.php suggests it may rely on availability of exec() elsewhere, but perhaps only the ones at lines 626 and 634 really matter since the others will not be called of those fail.
Possible solution/workround: check ini_get(disable_functions) and give up on the tests immediately if it contains "exec". Here's what I did to fix it for me.
| Code: | $ diff imgToolbox.class.php imgToolbox.class.php.old
625,628d624
< // Check if exec() is disabled, e.g. for security reasons
< function isExecDisabled(){
< return in_array( 'exec', explode( ',',ini_get( 'disable_functions' ) ) );
< }
630,632d625
< if($this->isExecDisabled()){
< return false; // exec() is disabled, so give up
< }
641,643d633
< if($this->isExecDisabled()){
< return false; // exec() is disabled, so give up
< }
|
I hope this is useful.
Best wishes,
Mark.
Cool. Thanks for the hint. Please log it with link to this thread at the bug tracker on forge:
http://forge.joomla.org/sf/tracker/do/listArtifacts/projects.cb/tracker.bugs
Thanks Beat (beat) Community Builder Team Member
Before posting on forums: Read all CB Articles | Specially the FAQ | Help us help you CB links: Subscribe to CB documentation | Our templates | Paid Subscriptions | Get Hosting | Our Forge Visit my CB Profile | Read my CB Blog
-- help us spend more time coding by helping others in this forum, many thanks
|
|
The topic has been locked. |
|
|
|
|
Re:Possible issue if exec() disabled
|
|
Date: 2006/08/08 23:10
|
By: olz
|
Status: User
|
|
|
Karma: 0  
|
|
Fresh Joomlapolitan  | Posts: 1 |   | |
|
Hi!
It was not clearly for me which archive and that lines I have that to edit…
Sory may native language is portugues.
Thanks.
|
|
The topic has been locked. |
|
|
|
|
Re:Possible issue if exec() disabled
|
|
Date: 2006/10/05 04:19
|
By: dannorris
|
Status: User
|
|
|
Karma: 0  
|
|
Fresh Joomlapolitan  | Posts: 5 |   | |
|
hi mate, this sounds like what I need. However I am unsure where to paste your code that you have provided? and what to remove?
Thanks
|
|
The topic has been locked. |
|
|