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

@ -9,7 +9,7 @@ include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
// Check token
if ((!isset($_POST['token'])) || ($_SESSION['token'] != $_POST['token'])) {
header('location: /login/');
exit;
exit();
}
$service = $_POST['service'];
@ -27,14 +27,16 @@ if ($_SESSION['user'] == 'admin') {
}
if ((!empty($_POST['system'])) && ($action == 'restart')) {
v_exec('v-restart-system', ['yes'], false);
exec (VESTA_CMD."v-restart-system yes", $output, $return_var);
$_SESSION['error_srv'] = 'The system is going down for reboot NOW!';
unset($output);
header("Location: /list/server/");
exit;
}
foreach ($service as $value) {
v_exec($cmd, [$value], false);
$value = escapeshellarg($value);
exec (VESTA_CMD.$cmd." ".$value, $output, $return_var);
}
}