#!/usr/bin/perl # Must run on a machine with dak ls. # # To check for un-updated binary kernel packages, also needs grep-dctrl # and a Sources file for the distribution. Set the location of the Sources # file in SOURCES_FILE in the environment. use warnings; use strict; use URI::Escape; use Getopt::Long; my $html=0; my $debug=0; my $suite="testing"; my $sta="http://security.debian.org/debian-security/dists/testing/updates/main/source/Sources.gz"; my $output; if (! GetOptions( "html" => \$html, "debug" => \$debug, "suite=s" => \$suite, "sta=s" => \$sta, "output=s", \$output) || ! @ARGV) { die "usage: $0 [--suite suite] [--sta sta-mirror] [--html] [--output=file] [--debug] list ...\n"; } my $stasources=`tempfile`; chomp $stasources; system("wget -q -O $stasources $sta"); if (defined $output) { open (OUT, ">$output.tmp.$$") || die "output.tmp.$$: $!"; # Set the output to a file } else { open (OUT, ">&STDOUT"); # Set the output to stdout } if ($html) { # It's HTML, so we need a header print OUT "$suite security issues\n"; print OUT <<"EOF";

Note:The information in the Security Bug Tracker is more detailed and likely more accurate.

EOF # This is being run against something it's not meant to be, so print a warning if ($suite ne 'testing' && $suite ne 'unstable') { print OUT <<"EOF";

Warning: This page is the result of running the testing security check script against the $suite distribution. As data is only gathered for the testing distribution, results may be innacurate if a package has changed its name, if a vulnerability affects $suite and not testing, or if a vulnerability has been fixed in $suite by the security team.

EOF } print OUT "\n"; print OUT "
\n"; print OUT "Key: "; foreach my $keyline (@urgencies) { next if $keyline eq 'unimportant'; print OUT " $keyline  "; } print OUT "
"; print OUT "Total holes unfixed: $unfixed
\n"; print OUT "Total holes fixed in unstable (or experimental) but not $suite: $unprop_all ($fixedsta fixed in secure-testing archive)"; if ($unprop_all != $unprop) { print OUT " (+".($unprop - $unprop_all)." on some arches)"; } print OUT "
\n"; print OUT "Total number of kernel image packages not up to date: $need_rebuild
\n"; print OUT "Number of TODO lines in records: $todos
\n"; print OUT "Maintained by the testing security team
\n"; print OUT "Last update: ".`date`."
\n"; print OUT "\n"; } close OUT; if (defined $output) { rename("$output.tmp.$$", $output) || die "rename: $!"; } unlink $stasources;