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

Diff of /bin/checklist

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

revision 229 by joeyh, Tue Nov 2 00:39:27 2004 UTC revision 230 by joeyh, Tue Jan 4 22:53:54 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 $html=0;
5    if ($ARGV[0] eq 'html') {
6            shift;
7            $html=1;
8    }
9    
10  if (! @ARGV) {  if (! @ARGV) {
11          die "usage: $0 list\n";          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) {  foreach my $list (@ARGV) {
# Line 23  foreach my $list (@ARGV) { Line 40  foreach my $list (@ARGV) {
40                          my $package=$1;                          my $package=$1;
41                          my $version=$2;                          my $version=$2;
42                          if ($version=~/unfixed/) {                          if ($version=~/unfixed/) {
43                                  print "$package $version for $id\n";                                  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;                                  next;
49                          }                          }
50                          my $maddy=`madison -s testing '$package'`;                          my $maddy=`madison -s testing '$package'`;
51                          if (length $maddy) {                          if (length $maddy) {
52                                  my @fields = split(/\s*\|\s*/, $maddy);                                  my @fields = split(/\s*\|\s*/, $maddy);
53                                  my $cmp=system("dpkg --compare-versions '$fields[1]' '>=' '$version'");                                  my $havver=$fields[1];
54                                    my $cmp=system("dpkg --compare-versions '$havver' '>=' '$version'");
55                                  if ($cmp != 0) {                                  if ($cmp != 0) {
56                                          print "$package $version needed, have $fields[1] for $id\n";                                          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                  }                  }
                 elsif (/HELP/) {  
                         print $_." ($id)\n";  
                 }  
64          }          }
65  }  }
66    
67    if ($html) {
68            print "</ul>\n";
69    }

Legend:
Removed from v.229  
changed lines
  Added in v.230

  ViewVC Help
Powered by ViewVC 1.1.5