🔒 ♻️ Implement secure exec wrapper functions.

This commit is contained in:
Flat 2015-12-02 21:24:34 +09:00
commit 8e951ac72e
115 changed files with 1345 additions and 1986 deletions

View file

@ -7,16 +7,9 @@ include($_SERVER['DOCUMENT_ROOT']."/inc/main.php");
if ($_SESSION['user'] == 'admin') {
if (!empty($_GET['pkg'])) {
$v_pkg = escapeshellarg($_GET['pkg']);
exec (VESTA_CMD."v-update-sys-vesta ".$v_pkg, $output, $return_var);
$v_pkg = $_GET['pkg'];
v_exec('v-update-sys-vesta', [$v_pkg]);
}
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/");