/[secure-testing]/sarge-checks/checklist
ViewVC logotype

Contents of /sarge-checks/checklist

Parent Directory Parent Directory | Revision Log Revision Log


Revision 230 - (show annotations) (download)
Tue Jan 4 22:53:54 2005 UTC (8 years, 4 months ago) by joeyh
File size: 1455 byte(s)
add html output mode
1 #!/usr/bin/perl
2 # Must run on a machine with madison.
3
4 my $html=0;
5 if ($ARGV[0] eq 'html') {
6 shift;
7 $html=1;
8 }
9
10 if (! @ARGV) {
11 die "usage: $0 [html] list\n";
12 }
13
14 if ($html) {
15 print "<title>testing security issues</title>\n";
16 print "<ul>\n";
17 }
18
19 sub printid {
20 my $id=shift;
21 $id=~s#((?:CAN|CVE)-\d+-\d+)#<a href="http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=$1">$1</a>#g if $html;
22 return $id;
23 }
24
25 foreach my $list (@ARGV) {
26 if (-d $list) {
27 $list="$list/list";
28 }
29
30 open (IN, $list) || die "open $list: $!";
31 while (<IN>) {
32 chomp;
33 if (/^\[/) {
34 ($id)=m/((?:DSA|CAN|CVE)-.*?) /;
35 }
36 elsif (/^(DSA|CAN|CVE)-/) {
37 $id=$_;
38 }
39 elsif (/^\s+[!-]\s+(.*?)\s+(.*)$/) {
40 my $package=$1;
41 my $version=$2;
42 if ($version=~/unfixed/) {
43 if ($html) {
44 print "<li>";
45 $version=~s!bug #(\d+)!<a href="http://bugs.debian.org/$1">bug #$1</a>!g;
46 }
47 print "$package $version for ".printid($id)."\n";
48 next;
49 }
50 my $maddy=`madison -s testing '$package'`;
51 if (length $maddy) {
52 my @fields = split(/\s*\|\s*/, $maddy);
53 my $havver=$fields[1];
54 my $cmp=system("dpkg --compare-versions '$havver' '>=' '$version'");
55 if ($cmp != 0) {
56 if ($html) {
57 print "<li>";
58 $havver='<a href="http://bjorn.haxx.se/debian/testing.pl?package='.$package.'">'.$havever.'</a>';
59 }
60 print "$package $version needed, have $havver for ".printid($id)."\n";
61 }
62 }
63 }
64 }
65 }
66
67 if ($html) {
68 print "</ul>\n";
69 }

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.5