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

Contents of /sarge-checks/checklist

Parent Directory Parent Directory | Revision Log Revision Log


Revision 311 - (show annotations) (download)
Sat Jan 22 04:38:11 2005 UTC (8 years, 4 months ago) by joeyh
File size: 2317 byte(s)
mark unfixed bugs in bold
1 #!/usr/bin/perl
2 # Must run on a machine with madison.
3 use URI::Escape;
4
5 my $html=0;
6 if ($ARGV[0] eq 'html') {
7 shift;
8 $html=1;
9 }
10
11 if (! @ARGV) {
12 die "usage: $0 [html] list\n";
13 }
14
15
16 my %data;
17 my $unprop = my $unfixed = my $todos = 0;
18
19 sub record {
20 my ($package, $condition, $item)=@_;
21
22 if ($html) {
23 $condition=~s{bug #(\d+)}{<a href="http://bugs.debian.org/$1">bug #$1</a>}g;
24 $condition=~s{unfixed}{<b>unfixed</b>}g;
25 $item=~s#((?:CAN|CVE)-\d+-\d+)#<a href="http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=$1">$1</a>#g;
26 }
27
28 push @{$data{$package}{$condition}}, $item;
29 }
30
31 foreach my $list (@ARGV) {
32 if (-d $list) {
33 $list="$list/list";
34 }
35
36 open (IN, $list) || die "open $list: $!";
37 while (<IN>) {
38 chomp;
39 if (/^\[/) {
40 ($id)=m/((?:DSA|CAN|CVE)-[^\s]+) /;
41 }
42 elsif (/^((?:DSA|CAN|CVE)-[^\s]+)/) {
43 $id=$1;
44 }
45 elsif (/^\s+[!-]\s+(.*?)\s+(.*)$/) {
46 my $package=$1;
47 my $version=$2;
48
49 my $maddy=`madison -s testing '$package'`;
50 if (! length $maddy) {
51 next;
52 }
53
54 if ($version=~/unfixed/) {
55 record($package, $version, $id);
56 $unfixed++;
57 }
58 else {
59 my @fields = split(/\s*\|\s*/, $maddy);
60 my $havver=$fields[1];
61 my $cmp=system("dpkg --compare-versions '$havver' '>=' '$version'");
62 if ($cmp != 0) {
63 if ($html) {
64 $havver='<a href="http://bjorn.haxx.se/debian/testing.pl?package='.uri_escape($package).'">'.$havver.'</a>';
65 }
66 record($package, "$version needed, have $havver", $id);
67 $unprop++;
68 }
69 }
70 }
71 elsif (/\s+TODO/) {
72 $todos++;
73 }
74 }
75 }
76
77
78 if ($html) {
79 print "<html><title>testing security issues</title>\n";
80 print "<ul>\n";
81 }
82
83 foreach my $package (sort keys %data) {
84 foreach my $condition (sort keys %{$data{$package}}) {
85 print "<li>" if $html;
86 print "$package $condition for ";
87 my $items=0;
88 foreach my $item (sort @{$data{$package}{$condition}}) {
89 print ", " if $items > 0;
90 print $item;
91 $items++;
92 }
93 print "\n";
94 }
95 }
96
97 if ($html) {
98 print "</ul>\n";
99 print "<hr>\n";
100 print "Total holes unfixed: $unfixed<br>\n";
101 print "Total holes fixed in unstable but not testing: $unprop<br>\n";
102 print "Number of TODO lines in <a href=\"http://svn.debian.org/wsvn/secure-testing/sarge-checks/?rev=0&sc=0\">records</a>: $todos<br>\n";
103 print "Last update: ".`date`."<br>\n";
104 print "</html>\n";
105 }

Properties

Name Value
svn:executable *

  ViewVC Help
Powered by ViewVC 1.1.5