#!/usr/bin/perl # Must run on a machine with madison. use URI::Escape; my $html=0; if ($ARGV[0] eq 'html') { shift; $html=1; } if (! @ARGV) { die "usage: $0 [html] list\n"; } my %data; my $unprop = my $unfixed = 0; sub record { my ($package, $condition, $item)=@_; if ($html) { $condition=~s{bug #(\d+)}{bug #$1}g; $item=~s#((?:CAN|CVE)-\d+-\d+)#$1#g; } push @{$data{$package}{$condition}}, $item; } foreach my $list (@ARGV) { if (-d $list) { $list="$list/list"; } open (IN, $list) || die "open $list: $!"; while () { chomp; if (/^\[/) { ($id)=m/((?:DSA|CAN|CVE)-[^\s]+) /; } elsif (/^((?:DSA|CAN|CVE)-[^\s]+)/) { $id=$1; } elsif (/^\s+[!-]\s+(.*?)\s+(.*)$/) { my $package=$1; my $version=$2; my $maddy=`madison -s testing '$package'`; if (! length $maddy) { next; } if ($version=~/unfixed/) { record($package, $version, $id); $unfixed++; } else { my @fields = split(/\s*\|\s*/, $maddy); my $havver=$fields[1]; my $cmp=system("dpkg --compare-versions '$havver' '>=' '$version'"); if ($cmp != 0) { if ($html) { $havver=''.$havver.''; } record($package, "$version needed, have $havver", $id); $unprop++; } } } } } if ($html) { print "testing security issues\n"; print "\n"; print "
\n"; print "Total holes unfixed: $unfixed
\n"; print "Total holes fixed in unstable but not testing: $unprop
\n"; print "Last update: ".`date`."
\n"; print "\n"; }