summaryrefslogtreecommitdiffstats
path: root/bin/updatelist
diff options
context:
space:
mode:
authorJoey Hess <joeyh@debian.org>2005-10-19 22:54:03 +0000
committerJoey Hess <joeyh@debian.org>2005-10-19 22:54:03 +0000
commitd31454f2569ac01179b429a148e17242a23da85f (patch)
tree0df25f86f95f53e285e2c460dc5e1df062b5d777 /bin/updatelist
parent05900fa9bcaeea8024a9f2e935bb14352f50a078 (diff)
mods for CVE merge
git-svn-id: svn+ssh://svn.debian.org/svn/secure-testing@2458 e39458fd-73e7-0310-bf30-c45bca0a0e42
Diffstat (limited to 'bin/updatelist')
-rwxr-xr-xbin/updatelist117
1 files changed, 54 insertions, 63 deletions
diff --git a/bin/updatelist b/bin/updatelist
index f145b252f5..c018df441a 100755
--- a/bin/updatelist
+++ b/bin/updatelist
@@ -1,10 +1,10 @@
#!/usr/bin/perl
-my $full_can_html=shift;
+my $html=shift;
my $dsa_list=shift;
my $dtsa_list=shift;
my $our_list=shift;
-my %cans;
+my %cves;
sub read_dsa {
my $list=shift;
@@ -15,16 +15,12 @@ sub read_dsa {
if (/^\[/) {
($dsa)=m/(DT?SA-.*?) /;
}
- if (/\{\s*(CAN|CVE)/) {
- my ($canlist)=m/\{(.*)\}/;
- foreach my $can (split ' ', $canlist) {
- $can=~s/CVE-/CAN-/g;
- next unless $can=~/^CAN-\d+/;
- $cans{$can}{can}=$can;
- push @{$cans{$can}{dsa}}, $dsa;
- $can=~s/CAN-/CVE-/g;
- $cans{$can}{can}=$can;
- push @{$cans{$can}{dsa}}, $dsa;
+ if (/\{\s*(CVE)/) {
+ my ($cvelist)=m/\{(.*)\}/;
+ foreach my $cve (split ' ', $cvelist) {
+ next unless $cve=~/^CVE-\d+/;
+ $cves{$cve}{cve}=$cve;
+ push @{$cves{$cve}{dsa}}, $dsa;
}
}
}
@@ -33,77 +29,72 @@ sub read_dsa {
read_dsa($dsa_list);
read_dsa($dtsa_list);
-my %listedcans;
+my %listedcves;
-open (FULL_CAN, "<$full_can_html") || die "$full_can_html: $!\n";
-my $can;
-while (<FULL_CAN>) {
- if (m!<b>(CAN-\d+-\d+)</b>!) {
- $can=$1;
- $cans{$can}{can}=$can;
- $listedcans{$can}=1;
- }
- elsif (m!<b>(CVE-\d+-\d+)</b>!) {
- $can=$1;
- $cans{$can}{can}=$can;
- $listedcans{$can}=1;
+open (HTML, "<$html") || die "$html: $!\n";
+my $cve;
+while (<HTML>) {
+ if (m!<b>(CVE-\d+-\d+)</b>!) {
+ $cve=$1;
+ $cves{$cve}{cve}=$cve;
+ $listedcves{$cve}=1;
}
if (m!\*\*\s+RESERVED\s+\*\*!) {
- $cans{$can}{reserved}=1;
+ $cves{$cve}{reserved}=1;
}
if (m!\*\*\s+REJECT\s+\*\*!) {
- $cans{$can}{rejected}=1;
+ $cves{$cve}{rejected}=1;
}
if (m!Description:\s*</b><br>\s*(.*)! &&
! m!\*\*\s+RESERVED\s+\*\*! && ! m!\*\*\s+REJECT\s+\*\*!) {
- $cans{$can}{description}="($1 ...)";
+ $cves{$cve}{description}="($1 ...)";
}
}
-close FULL_CAN;
+close HTML;
my $stopped=0;
my @out;
-sub docan {
- my $can=shift;
+sub docve {
+ my $cve=shift;
- push @out, "$can".(length $cans{$can}{description} ? " ".$cans{$can}{description} : "")."\n";
- if ($cans{$can}{reserved}) {
+ push @out, "$cve".(length $cves{$cve}{description} ? " ".$cves{$cve}{description} : "")."\n";
+ if ($cves{$cve}{reserved}) {
push @out, "\tRESERVED\n";
}
- if ($cans{$can}{rejected}) {
+ if ($cves{$cve}{rejected}) {
push @out, "\tREJECTED\n";
}
- if ($cans{$can}{dsa}) {
- push @out, "\t{".join(" ", @{$cans{$can}{dsa}})."}\n";
+ if ($cves{$cve}{dsa}) {
+ push @out, "\t{".join(" ", @{$cves{$cve}{dsa}})."}\n";
}
- if ($cans{$can}{notes}) {
- foreach (@{$cans{$can}{notes}}) {
+ if ($cves{$cve}{notes}) {
+ foreach (@{$cves{$cve}{notes}}) {
push @out, "\t$_\n";
}
}
- if (! $cans{$can}{reserved} && ! $cans{$can}{rejected} &&
- ! $cans{$can}{dsa} && ! $cans{$can}{notes} &&
+ if (! $cves{$cve}{reserved} && ! $cves{$cve}{rejected} &&
+ ! $cves{$cve}{dsa} && ! $cves{$cve}{notes} &&
! $stopped) {
push @out, "\tTODO: check\n";
}
- delete $cans{$can};
+ delete $cves{$cve};
}
open (IN, "<$our_list") || die "$our_list: $!\n";
-my $can;
+my $cve;
while (<IN>) {
chomp;
- if (/^((?:CAN|CVE)-(?:[0-9]+|[A-Z]+)-(?:[0-9]+|[A-Z]+))\s*(.*)/) {
+ if (/^(CVE-(?:[0-9]+|[A-Z]+)-(?:[0-9]+|[A-Z]+))\s*(.*)/) {
my $desc=$2;
- docan($can) if $can;
- $can=$1;
+ docve($cve) if $cve;
+ $cve=$1;
if (length $desc && $desc !~ /^\(.*\)$/ &&
- (! exists $cans{$can}{description} ||
- ! length $cans{$can}{description})) {
- $cans{$can}{description}=$desc;
+ (! exists $cves{$cve}{description} ||
+ ! length $cves{$cve}{description})) {
+ $cves{$cve}{description}=$desc;
}
}
elsif (/^\s+(RESERVED|REJECTED)\s*$/) {
@@ -115,37 +106,37 @@ while (<IN>) {
elsif (/^\s+{DT?SA.*/) {
# skip
}
- elsif (/^\s+(.*)/ && $can) {
- push @{$cans{$can}{notes}}, $1;
+ elsif (/^\s+(.*)/ && $cve) {
+ push @{$cves{$cve}{notes}}, $1;
}
elsif (/^STOP/) {
- docan($can) if $can;
+ docve($cve) if $cve;
push @out, "$_\n";
$stopped=1;
- $can='';
+ $cve='';
}
else {
- docan($can) if $can;
+ docve($cve) if $cve;
push @out, "$_\n" if length $_;
- $can='';
+ $cve='';
}
}
close IN;
-docan($can) if $can;
+docve($cve) if $cve;
-foreach my $can (reverse sort { $cans{$a}{can} cmp $cans{$b}{can} } keys %cans) {
- next unless $listedcans{$can};
- print $can.(length $cans{$can}{description} ? " ".$cans{$can}{description} : "")."\n";
- if ($cans{$can}{reserved}) {
+foreach my $cve (reverse sort { $cves{$a}{cve} cmp $cves{$b}{cve} } keys %cves) {
+ next unless $listedcves{$cve};
+ print $cve.(length $cves{$cve}{description} ? " ".$cves{$cve}{description} : "")."\n";
+ if ($cves{$cve}{reserved}) {
print "\tRESERVED\n";
}
- if ($cans{$can}{rejected}) {
+ if ($cves{$cve}{rejected}) {
print "\tREJECTED\n";
}
- if ($cans{$can}{dsa}) {
- print "\t{".join(" ", @{$cans{$can}{dsa}})."}\n";
+ if ($cves{$cve}{dsa}) {
+ print "\t{".join(" ", @{$cves{$cve}{dsa}})."}\n";
}
- if (!$cans{$can}{reserved} || $cans{$can}{rejected} || $cans{$can}{dsa}) {
+ if (!$cves{$cve}{reserved} || $cves{$cve}{rejected} || $cves{$cve}{dsa}) {
print "\tTODO: check\n";
}
}

© 2014-2024 Faster IT GmbH | imprint | privacy policy