PM-849 safe_mode SOLVED
- Se tienen modos deseguridad que no permiten ejecutar shell_exec. - ya no se valida por safe_mode pero si se valida que no este entre las funciones restringidas, ademas de probar que se puede ejecutar shell_exec.
This commit is contained in:
@@ -1257,13 +1257,24 @@ class workspaceTools
|
|||||||
{
|
{
|
||||||
mysql_query("CREATE DATABASE IF NOT EXISTS " . mysql_real_escape_string($database));
|
mysql_query("CREATE DATABASE IF NOT EXISTS " . mysql_real_escape_string($database));
|
||||||
|
|
||||||
// Check for safe mode and if mysql exist on server
|
//check function shell_exec
|
||||||
|
$disabled_functions = ini_get('disable_functions');
|
||||||
|
$flag = false;
|
||||||
|
if ($disabled_functions!='') {
|
||||||
|
$arr = explode(',', $disabled_functions);
|
||||||
|
sort($arr);
|
||||||
|
if (in_array("shell_exec", $arr)) {
|
||||||
|
$flag = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Check if mysql exist on server
|
||||||
$flagFunction = null;
|
$flagFunction = null;
|
||||||
if ( !ini_get('safe_mode') ) {
|
if ( !$flag ) {
|
||||||
$flagFunction = shell_exec('mysql --version');
|
$flagFunction = shell_exec('mysql --version');
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !ini_get('safe_mode') && !is_null($flagFunction) ) {
|
if ( !$flag && !is_null($flagFunction) ) {
|
||||||
$command = 'mysql'
|
$command = 'mysql'
|
||||||
. ' --host=' . $parameters['dbHost']
|
. ' --host=' . $parameters['dbHost']
|
||||||
. ' --user=' . $parameters['dbUser']
|
. ' --user=' . $parameters['dbUser']
|
||||||
|
|||||||
Reference in New Issue
Block a user