mirror of
https://github.com/pfsense/pfsense.git
synced 2025-10-26 11:38:35 +00:00
Fix core dump on viewing invalid package log
This commit is contained in:
parent
7145cd87d1
commit
b67cdd05ab
@ -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"));
|
||||
|
||||
@ -612,7 +612,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.");
|
||||
} elsif(file_exists($logfile) && filesize($logfile) == 0) {
|
||||
$logarr = array("Log file started.");
|
||||
} else {
|
||||
if($config['system']['disablesyslogclog']) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user