summaryrefslogtreecommitdiffstats
path: root/usr/local/www/status_rrd_graph_img.php
diff options
context:
space:
mode:
authorRenato Botelho <garga@FreeBSD.org>2014-06-17 10:19:34 -0300
committerRenato Botelho <garga@FreeBSD.org>2014-06-17 10:19:54 -0300
commitd09ff9ef322608ea8c496121faccd3d778e71e25 (patch)
tree46bfb7c45183734729b285550f0ee86896c56a75 /usr/local/www/status_rrd_graph_img.php
parent65eb0f61a42e2690b9b7055409a7a2efba9a26a9 (diff)
downloadpfsense-d09ff9ef322608ea8c496121faccd3d778e71e25.zip
pfsense-d09ff9ef322608ea8c496121faccd3d778e71e25.tar.gz
Make sure variables are escaped, also replace exec calls to run rm by unlink_if_exists()
Diffstat (limited to 'usr/local/www/status_rrd_graph_img.php')
-rw-r--r--usr/local/www/status_rrd_graph_img.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/usr/local/www/status_rrd_graph_img.php b/usr/local/www/status_rrd_graph_img.php
index 321e6ab..1f0edc5 100644
--- a/usr/local/www/status_rrd_graph_img.php
+++ b/usr/local/www/status_rrd_graph_img.php
@@ -43,7 +43,7 @@ global $g;
$pgtitle = array(gettext("System"),gettext("RRD Graphs"),gettext("Image viewer"));
if ($_GET['database']) {
- $curdatabase = basename($_GET['database']);
+ $curdatabase = escapeshellarg(basename($_GET['database']));
} else {
$curdatabase = "wan-traffic.rrd";
}
@@ -56,7 +56,7 @@ if ($_GET['style']) {
/* this is used for temp name */
if ($_GET['graph']) {
- $curgraph = $_GET['graph'];
+ $curgraph = escapeshellarg($_GET['graph']);
} else {
$curgraph = "custom";
}
@@ -1246,14 +1246,14 @@ if(($graphcmdreturn <> 0) || (! $data)) {
log_error(sprintf(gettext('Failed to create graph with error code %1$s, the error is: %2$s'),$graphcmdreturn,$graphcmdoutput));
if(strstr($curdatabase, "queues")) {
log_error(sprintf(gettext("failed to create graph from %s%s, removing database"),$rrddbpath,$curdatabase));
- exec("/bin/rm -f $rrddbpath$curif$queues");
+ unlink_if_exists($rrddbpath . $curif . $queues);
flush();
usleep(500);
enable_rrd_graphing();
}
if(strstr($curdatabase, "queuesdrop")) {
log_error(sprintf(gettext("failed to create graph from %s%s, removing database"),$rrddbpath,$curdatabase));
- exec("/bin/rm -f $rrddbpath$curdatabase");
+ unlink_if_exists($rrddbpath . $curdatabase);
flush();
usleep(500);
enable_rrd_graphing();
OpenPOWER on IntegriCloud