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

Contents of /sarge-checks/checklist

Parent Directory Parent Directory | Revision Log Revision Log


Revision 239 - (show annotations) (download)
Wed Jan 5 10:34:41 2005 UTC (8 years, 4 months ago) by joeyh
File size: 1651 byte(s)
add some stats
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 formatout {
20 my $out=shift;
21 if ($html) {
22 $out=~s#((?:CAN|CVE)-\d+-\d+)#<a href="http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=$1">$1</a>#g;
23 $out=~s{bug #(\d+)}{<a href="http://bugs.debian.org/$1">bug #$1</a>}g;
24 }
25 return $out;
26 }
27
28 my $unprop = my $unfixed = 0;
29
30 foreach my $list (@ARGV) {
31 if (-d $list) {
32 $list="$list/list";
33 }
34
35 open (IN, $list) || die "open $list: $!";
36 while (<IN>) {
37 chomp;
38 if (/^\[/) {
39 ($id)=m/((?:DSA|CAN|CVE)-.*?) /;
40 }
41 elsif (/^(DSA|CAN|CVE)-/) {
42 $id=$_;
43 }
44 elsif (/^\s+[!-]\s+(.*?)\s+(.*)$/) {
45 my $package=$1;
46 my $version=$2;
47 if ($version=~/unfixed/) {
48 print "<li>" if $html;
49 print formatout("$package $version for $id\n");
50 $unprop++;
51 next;
52 }
53 my $maddy=`madison -s testing '$package'`;
54 if (length $maddy) {
55 my @fields = split(/\s*\|\s*/, $maddy);
56 my $havver=$fields[1];
57 my $cmp=system("dpkg --compare-versions '$havver' '>=' '$version'");
58 if ($cmp != 0) {
59 if ($html) {
60 print "<li>";
61 $havver='<a href="http://bjorn.haxx.se/debian/testing.pl?package='.$package.'">'.$havver.'</a>';
62 }
63 print formatout("$package $version needed, have $havver for $id\n");
64 $unfixed++;
65 }
66 }
67 }
68 }
69 }
70
71 if ($html) {
72 print "</ul>\n";
73 print "<hr>\n";
74 print "Total unfixed: $unfixed\n";
75 print "Total fixed in unstable but not testing: $unprop\n";
76 print "Last update: ".`date`;
77 }

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.5