HOR-1957 "Error al ejecutar el comando workspace-backup" SOLVED

Issue:
    Error al ejecutar el comando  workspace-backup
Cause:
    Incorrecto manejo de caracteres especiales al ejecutar un shell command
Solution:
    Se escapan los caracteres especiales al ejecutar un shell command
This commit is contained in:
Victor Saisa Lopez
2016-09-28 14:58:48 -04:00
parent 952877754d
commit 70a4ef0222
2 changed files with 4 additions and 4 deletions

View File

@@ -405,7 +405,7 @@ class DataBaseMaintenance
$dbPort = $aHost[1];
$command = 'mysqldump'
. ' --user=' . $this->user
. ' --password=' . str_replace('"', '\"', str_replace("'", "\'", quotemeta($this->passwd)))
. ' --password=' . escapeshellarg($this->passwd)
. ' --host=' . $dbHost
. ' --port=' . $dbPort
. ' --opt'
@@ -418,7 +418,7 @@ class DataBaseMaintenance
. ' --user=' . $this->user
. ' --opt'
. ' --skip-comments'
. ' --password=' . str_replace('"', '\"', str_replace("'", "\'", quotemeta($this->passwd)))
. ' --password=' . escapeshellarg($this->passwd)
. ' ' . $this->dbName
. ' > ' . $outfile;
}

View File

@@ -1402,7 +1402,7 @@ class workspaceTools
. ' --host=' . $dbHost
. ' --port=' . $dbPort
. ' --user=' . $parameters['dbUser']
. ' --password=' . str_replace('"', '\"', str_replace("'", "\'", quotemeta($parameters['dbPass'])))//no change! supports the type passwords: .\+*?[^]($)'"\"'
. ' --password=' . escapeshellarg($parameters['dbPass'])
. ' --database=' . mysql_real_escape_string($database)
. ' --default_character_set utf8'
. ' --execute="SOURCE ' . $filename . '"';
@@ -1410,7 +1410,7 @@ class workspaceTools
$command = 'mysql'
. ' --host=' . $dbHost
. ' --user=' . $parameters['dbUser']
. ' --password=' . str_replace('"', '\"', str_replace("'", "\'", quotemeta($parameters['dbPass'])))//no change! supports the type passwords: .\+*?[^]($)'"\"'
. ' --password=' . escapeshellarg($parameters['dbPass'])
. ' --database=' . mysql_real_escape_string($database)
. ' --default_character_set utf8'
. ' --execute="SOURCE ' . $filename . '"';