| 9 |
|
|
| 10 |
my $html=0; |
my $html=0; |
| 11 |
my $suite="testing"; |
my $suite="testing"; |
| 12 |
if (! GetOptions("html" => \$html, "suite=s" => \$suite) || ! @ARGV) { |
my $output; |
| 13 |
die "usage: $0 [--suite suite] [--html] list ...\n"; |
if (! GetOptions( |
| 14 |
|
"html" => \$html, |
| 15 |
|
"suite=s" => \$suite, |
| 16 |
|
"output=s", \$output) |
| 17 |
|
|| ! @ARGV) { |
| 18 |
|
die "usage: $0 [--suite suite] [--html] [--output=file] list ...\n"; |
| 19 |
} |
} |
| 20 |
|
|
| 21 |
|
if (defined $output) { |
| 22 |
|
open (OUT, ">$output.tmp.$$") || die "output.tmp.$$: $!"; |
| 23 |
|
} |
| 24 |
|
else { |
| 25 |
|
open (OUT, ">&STDOUT"); |
| 26 |
|
} |
| 27 |
|
|
| 28 |
|
if ($html) { |
| 29 |
|
print OUT "<html><title>$suite security issues</title>\n"; |
| 30 |
|
if ($suite ne 'testing' && $suite ne 'unstable') { |
| 31 |
|
print OUT <<"EOF"; |
| 32 |
|
<p> |
| 33 |
|
<em>Warning:</em> This page is the result of running the testing security |
| 34 |
|
check script against the $suite distribution. As data is only gathered for |
| 35 |
|
the testing distribution, results may be innecurate if a package has |
| 36 |
|
changed its name, if a vulnerability affects $suite and not testing, or if a |
| 37 |
|
vulnerability has been fixed in $suite by the $suite security team. |
| 38 |
|
</p> |
| 39 |
|
EOF |
| 40 |
|
} |
| 41 |
|
print OUT "<ul>\n"; |
| 42 |
|
} |
| 43 |
|
|
| 44 |
|
|
| 45 |
my %data; |
my %data; |
| 46 |
my %needkernel=qw/2.4.27 0 2.6.11 0/; |
my %needkernel=qw/2.4.27 0 2.6.11 0/; |
| 47 |
my $list_unknown=1; #set to 1 to display kernel images with unknown source version |
my $list_unknown=1; #set to 1 to display kernel images with unknown source version |
| 169 |
} |
} |
| 170 |
|
|
| 171 |
|
|
|
if ($html) { |
|
|
print "<html><title>$suite security issues</title>\n"; |
|
|
if ($suite ne 'testing' && $suite ne 'unstable') { |
|
|
print <<"EOF"; |
|
|
<p> |
|
|
<em>Warning:</em> 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 innecurate 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 $suite security team. |
|
|
</p> |
|
|
EOF |
|
|
} |
|
|
print "<ul>\n"; |
|
|
} |
|
|
|
|
| 172 |
foreach my $package (sort keys %data) { |
foreach my $package (sort keys %data) { |
| 173 |
foreach my $condition (sort keys %{$data{$package}}) { |
foreach my $condition (sort keys %{$data{$package}}) { |
| 174 |
print "<li>" if $html; |
print OUT "<li>" if $html; |
| 175 |
print "$package $condition for "; |
print OUT "$package $condition for "; |
| 176 |
my $items=0; |
my $items=0; |
| 177 |
foreach my $i (sort @{$data{$package}{$condition}}) { |
foreach my $i (sort @{$data{$package}{$condition}}) { |
| 178 |
print ", " if $items > 0; |
print OUT ", " if $items > 0; |
| 179 |
|
|
| 180 |
if ($html) { |
if ($html) { |
| 181 |
my $color=$colormap{$i->{urgency}}; |
my $color=$colormap{$i->{urgency}}; |
| 182 |
print "<span style=\"background:$color\">"; |
print OUT "<span style=\"background:$color\">"; |
| 183 |
} |
} |
| 184 |
print $i->{item}; |
print OUT $i->{item}; |
| 185 |
if ($html) { |
if ($html) { |
| 186 |
print "</span>"; |
print OUT "</span>"; |
| 187 |
} |
} |
| 188 |
|
|
| 189 |
$items++; |
$items++; |
| 190 |
} |
} |
| 191 |
print "\n"; |
print OUT "\n"; |
| 192 |
} |
} |
| 193 |
} |
} |
| 194 |
|
|
| 230 |
|
|
| 231 |
foreach $package (sort keys %images) { |
foreach $package (sort keys %images) { |
| 232 |
if ($images{$package} eq "0") { |
if ($images{$package} eq "0") { |
| 233 |
print "<li>" if ($html && $list_unknown); |
print OUT "<li>" if ($html && $list_unknown); |
| 234 |
print "$package built from kernel-source-$version $needkernel{$version} needed, current version unknown\n" if $list_unknown; |
print OUT "$package built from kernel-source-$version $needkernel{$version} needed, current version unknown\n" if $list_unknown; |
| 235 |
} elsif (!system("dpkg --compare-versions $needkernel{$version} gt $images{$package}")) { |
} elsif (!system("dpkg --compare-versions $needkernel{$version} gt $images{$package}")) { |
| 236 |
print "<li>" if $html; |
print OUT "<li>" if $html; |
| 237 |
print "$package built from kernel-source-$version $needkernel{$version} needed, have $images{$package}\n"; |
print OUT "$package built from kernel-source-$version $needkernel{$version} needed, have $images{$package}\n"; |
| 238 |
$need_rebuild++; |
$need_rebuild++; |
| 239 |
} |
} |
| 240 |
} |
} |
| 244 |
|
|
| 245 |
|
|
| 246 |
if ($html) { |
if ($html) { |
| 247 |
print "</ul>\n"; |
print OUT "</ul>\n"; |
| 248 |
print "<hr>\n"; |
print OUT "<hr>\n"; |
| 249 |
print "Total holes unfixed: $unfixed<br>\n"; |
print OUT "Total holes unfixed: $unfixed<br>\n"; |
| 250 |
print "Total holes fixed in unstable but not $suite: $unprop_all"; |
print OUT "Total holes fixed in unstable but not $suite: $unprop_all"; |
| 251 |
if ($unprop_all != $unprop) { |
if ($unprop_all != $unprop) { |
| 252 |
print " (+".($unprop - $unprop_all)." on some arches)"; |
print OUT " (+".($unprop - $unprop_all)." on some arches)"; |
| 253 |
} |
} |
| 254 |
print "<br>\n"; |
print OUT "<br>\n"; |
| 255 |
print "Total number of kernel image packages not up to date: $need_rebuild<br>\n"; |
print OUT "Total number of kernel image packages not up to date: $need_rebuild<br>\n"; |
| 256 |
print "Number of TODO lines in <a href=\"http://svn.debian.org/wsvn/secure-testing/data/?rev=0&sc=0\">records</a>: $todos<br>\n"; |
print OUT "Number of TODO lines in <a href=\"http://svn.debian.org/wsvn/secure-testing/data/?rev=0&sc=0\">records</a>: $todos<br>\n"; |
| 257 |
print "Maintained by the <a href=\"http://secure-testing.alioth.debian.org/\">testing security team</a><br>\n"; |
print OUT "Maintained by the <a href=\"http://secure-testing.alioth.debian.org/\">testing security team</a><br>\n"; |
| 258 |
print "Last update: ".`date`."<br>\n"; |
print OUT "Last update: ".`date`."<br>\n"; |
| 259 |
print "</html>\n"; |
print OUT "</html>\n"; |
| 260 |
|
} |
| 261 |
|
|
| 262 |
|
close OUT; |
| 263 |
|
if (defined $output) { |
| 264 |
|
rename("$output.tmp.$$", $output) || die "rename: $!"; |
| 265 |
} |
} |