summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJavier Sánchez Parra <jsanchez@soleta.eu>2021-02-05 16:28:44 +0100
committerOpenGnSys Support Team <soporte-og@soleta.eu>2021-02-08 22:32:08 +0100
commitfd1de7940cbbca93f09850a5c581c73a369270d8 (patch)
treec367665245d3b39d843a9ab1145449e4a1fdcea1
parent8236193e8c45c629648651b2dedc106ba1acdc04 (diff)
#1019 Fix decoding of shell command parameters in queue mode
UMA report that "delete cached image" and "partition asistant" commands in queue mode do not work (non-queue mode works fine). WebConsole decodes and handles quirks of shell command parameters only when it is not queued. See shell() at restfunctions.php. Add shell command parameters decoding and handling when queued.
-rw-r--r--admin/WebConsole/comandos/gestores/gestor_Comandos.php15
1 files changed, 14 insertions, 1 deletions
diff --git a/admin/WebConsole/comandos/gestores/gestor_Comandos.php b/admin/WebConsole/comandos/gestores/gestor_Comandos.php
index 56b5a299..a90cde56 100644
--- a/admin/WebConsole/comandos/gestores/gestor_Comandos.php
+++ b/admin/WebConsole/comandos/gestores/gestor_Comandos.php
@@ -36,6 +36,18 @@ define('OG_CMD_ID_CREATE_INCREMENTAL_IMAGE', 14);
define('OG_CMD_ID_RESTORE_INCREMENTAL_IMAGE', 15);
define('OG_CMD_ID_SENDMESSAGE', 16);
+function clean_shell_params($cmd_id, $params) {
+ switch ($cmd_id) {
+ case OG_CMD_ID_DELETE_CACHED_IMAGE:
+ $params = substr($params, 0, -1);
+ case OG_CMD_ID_SCRIPT:
+ $params = rawurldecode($params);
+ break;
+ }
+
+ return $params;
+}
+
function run_command($idcomando, $cadenaip, $cadenamac, $netmasks_string,
$atributos) {
global $cmd;
@@ -206,7 +218,8 @@ if($sw_ejya=='on' || $sw_ejprg=="on" ){
$cmd->ParamSetValor("@descriaccion",$descricomando);
$cmd->ParamSetValor("@sesion",$sesion);
$cmd->ParamSetValor("@idcomando",$idcomando);
- $cmd->ParamSetValor("@parametros",$parametros);
+ $cmd->ParamSetValor("@parametros",
+ clean_shell_params($idcomando, $parametros));
$cmd->ParamSetValor("@fechahorareg",date("y/m/d H:i:s"));
if($sw_ejprg=="on") // Switch de ejecución con programación (se para el comando tarea para lanzarlo posteriormente)
$cmd->ParamSetValor("@estado",$ACCION_DETENIDA);