Revert "[SECURITY] Fix OS command injection."

This commit is contained in:
Serghey Rodin 2015-12-11 21:14:49 +02:00
commit 39e9b6397b
115 changed files with 1980 additions and 1340 deletions

View file

@ -7,9 +7,16 @@ include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
if ($_SESSION['user'] == 'admin') {
if (!empty($_GET['pkg'])) {
$v_pkg = $_GET['pkg'];
v_exec('v-update-sys-vesta', [$v_pkg]);
$v_pkg = escapeshellarg($_GET['pkg']);
exec (VESTA_CMD."v-update-sys-vesta ".$v_pkg, $output, $return_var);
}
if ($return_var != 0) {
$error = implode('<br>', $output);
if (empty($error)) $error = 'Error: '.$v_pkg.' update failed';
$_SESSION['error_msg'] = $error;
}
unset($output);
}
header("Location: /list/updates/");