/[secure-testing]/data/checklist
ViewVC logotype

Diff of /data/checklist

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

sarge-checks/checklist.pl revision 2 by joeyh, Wed Oct 27 21:07:41 2004 UTC sarge-checks/checklist revision 239 by joeyh, Wed Jan 5 10:34:41 2005 UTC
# Line 1  Line 1 
1  #!/usr/bin/perl  #!/usr/bin/perl
2  # Must run on a machine with madison.  # Must run on a machine with madison.
3    
4  my $list=shift;  my $html=0;
5  if (! $list) {  if ($ARGV[0] eq 'html') {
6          die "usage: $0 list\n";          shift;
7            $html=1;
8  }  }
9    
10  open (IN, $list) || die "open $list: $!";  if (! @ARGV) {
11  while (<IN>) {          die "usage: $0 [html] list\n";
12          chomp;  }
13          if (/^\[/) {  
14                  ($id)=m/(DSA-.*?) /;  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          elsif (/^CAN-/) {          return $out;
26                  $id=$_;  }
27    
28    my $unprop = my $unfixed = 0;
29    
30    foreach my $list (@ARGV) {
31            if (-d $list) {
32                    $list="$list/list";
33          }          }
34          elsif (/^\s+[!-]\s+(.*?)\s+(.*)$/) {  
35                  my $package=$1;          open (IN, $list) || die "open $list: $!";
36                  my $version=$2;          while (<IN>) {
37                  if ($version=~/unfixed/) {                  chomp;
38                          print "$package $version for $id\n";                  if (/^\[/) {
39                          next;                          ($id)=m/((?:DSA|CAN|CVE)-.*?) /;
40                    }
41                    elsif (/^(DSA|CAN|CVE)-/) {
42                            $id=$_;
43                  }                  }
44                  my $maddy=`madison -s testing '$package'`;                  elsif (/^\s+[!-]\s+(.*?)\s+(.*)$/) {
45                  if (length $maddy) {                          my $package=$1;
46                          my @fields = split(/\s*\|\s*/, $maddy);                          my $version=$2;
47                          my $cmp=system("dpkg --compare-versions '$fields[1]' '>=' '$version'");                          if ($version=~/unfixed/) {
48                          if ($cmp != 0) {                                  print "<li>" if $html;
49                                  print "$package $version needed, have $fields[1] for $id\n";                                  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          elsif (/HELP/) {  }
70                  print $_." ($id)\n";  
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  }  }

Legend:
Removed from v.2  
changed lines
  Added in v.239

  ViewVC Help
Powered by ViewVC 1.1.5