#!/usr/local/bin/perl # # DESCRIPTION # # $Id:$ # # Copyright (C) 1997-2003 Kees Cook # kees@outflux.net, http://outflux.net/ # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # http://www.gnu.org/copyleft/gpl.html # $|=1; require "cgi-lib.pl"; &ReadParse; print "Content-type: text/html
For text matching, patch name and patch description will be searched.
\n";
print "For description file matching, patch description file will be searched.
\n";
print "All searches use standard regular expression matching.
\n";
printf
"
Patch Name Size Critical Reboot Post Date
------------ -------- --- --- -----------
";
$buff = "%s %s%s %8d %-3s %-3s %s
%s
%s\n";
foreach $patch (sort MySort keys %patches) {
$posted = scalar(localtime($patches{$patch}{'date'}));
$posted =~ s/^\S+\s+(\S+) (..)\s+\S+\s+(\S+)$/\1 \2 \3/i;
printf($buff,
$patches{$patch}{'recommended patches'} == 1 ? "*" : " ",
$patches{$patch}{'path'},
$patches{$patch}{'name'},
&Filler(12-length($patch)),
$patches{$patch}{'size'},
$patches{$patch}{'critical'} == 1 ? "Yes" : "No",
$patches{$patch}{'reboot'} == 1 ? "Yes" : "No",
$posted,
$patches{$patch}{'path'} . ".txt",
$patches{$patch}{'description'},
$patches{$patch}{'super'}
)
if (&Match($patch));
}
print
" ------------ -------- --- --- -----------
Patch Name Size Critical Reboot Post Date
";
dbmclose(%record);
sub Match {
local($patch) = @_;
local($result);
return 1 if (!$tomatch || $tomatch =~ /^\.\*$/ || $tomatch =~ /^$/);
if ($howmatch =~ /text/) {
if ($patches{$patch}{'description'} =~ /($tomatch)/i) {
$patches{$patch}{'description'} =
$` . "" . $1 . "" . $';
return 1;
}
if ($patches{$patch}{'name'} =~ /($tomatch)/i) {
$patches{$patch}{'name'} =
$` . "" . $1 . "" . $';
return 1;
}
if ($patches{$patch}{'super'} =~ /($tomatch)/i) {
$patches{$patch}{'super'} =
$` . "" . $1 . "" . $';
return 1;
}
}
elsif ($howmatch =~ /file/) {
$result=0;
open(FILE,"<$patches{$patch}{'path'}.txt");
$result=grep(/$tomatch/i,