summaryrefslogtreecommitdiffstats
path: root/usr
diff options
context:
space:
mode:
authorMatt Smith <mgsmith@netgate.com>2014-06-17 11:30:53 -0500
committerMatt Smith <mgsmith@netgate.com>2014-06-17 11:30:53 -0500
commit7be297a2cea1957f969e0bf95df93e993958016f (patch)
tree4be361e88e967cbfd2d4ca20b0c2121bbd837f28 /usr
parent1cfe54900afbf48a59e672e73b78746ce2731750 (diff)
downloadpfsense-7be297a2cea1957f969e0bf95df93e993958016f.zip
pfsense-7be297a2cea1957f969e0bf95df93e993958016f.tar.gz
Fix core dump on viewing invalid package log
Diffstat (limited to 'usr')
-rwxr-xr-xusr/local/www/diag_pkglogs.php6
-rwxr-xr-xusr/local/www/guiconfig.inc4
2 files changed, 7 insertions, 3 deletions
diff --git a/usr/local/www/diag_pkglogs.php b/usr/local/www/diag_pkglogs.php
index f2f089d..4b4be59 100755
--- a/usr/local/www/diag_pkglogs.php
+++ b/usr/local/www/diag_pkglogs.php
@@ -73,9 +73,11 @@ if(!$apkg) { // If we aren't looking for a specific package, locate the first pa
}
}
} elseif($apkg) {
- $pkgwithlogging = true;
$apkgid = get_pkg_id($apkg);
- $i = $apkgid;
+ if ($apkgid != -1) {
+ $pkgwithlogging = true;
+ $i = $apkgid;
+ }
}
$pgtitle = array(gettext("Status"),gettext("Package logs"));
diff --git a/usr/local/www/guiconfig.inc b/usr/local/www/guiconfig.inc
index 77a1f0d..785dc75 100755
--- a/usr/local/www/guiconfig.inc
+++ b/usr/local/www/guiconfig.inc
@@ -595,7 +595,9 @@ function dump_clog($logfile, $tail, $withorig = true, $grepfor = "", $grepinvert
$grepline .= " | /usr/bin/egrep " . escapeshellarg(implode("|", $grepfor));
if(is_array($grepinvert))
$grepline .= " | /usr/bin/egrep -v " . escapeshellarg(implode("|", $grepinvert));
- if(file_exists($logfile) && filesize($logfile) == 0) {
+ if (is_dir($logfile)) {
+ $logarr = array("File $logfile is a directory.");
+ } elseif(file_exists($logfile) && filesize($logfile) == 0) {
$logarr = array("Log file started.");
} else {
if($config['system']['disablesyslogclog']) {
OpenPOWER on IntegriCloud