Author: joeyh Date: 2005-10-19 22:54:03 +0000 (Wed, 19 Oct 2005) New Revision: 2458 Modified: bin/checklist bin/update bin/updatelist Log: mods for CVE merge Modified: bin/checklist ==================================================================--- bin/checklist 2005-10-19 21:14:18 UTC (rev 2457) +++ bin/checklist 2005-10-19 22:54:03 UTC (rev 2458) @@ -84,7 +84,7 @@ if ($html) { $condition=~s{bug #(\d+)}{<a href="http://bugs.debian.org/$1">bug #$1</a>}g; $condition=~s{unfixed}{<b>unfixed</b>}g; - $item=~s#((?:CAN|CVE)-\d+-\d+)#<a href="http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=$1">$1</a>#g; + $item=~s#(CVE-\d+-\d+)#<a href="http://www.cve.mitre.org/cgi-bin/cvename.cgi?name=$1">$1</a>#g; $item=~s#(DTSA-\d+-\d+)#<a href="http://secure-testing-master.debian.net/DTSA/$1.html">$1</a>#g; } @@ -108,9 +108,9 @@ $todos++; } elsif (/^\[/) { # Checking adv. number for a line starting with [ : Set $id to it - ($id)=m/((?:DSA|DTSA|CAN|CVE)-[^\s]+) /; + ($id)=m/((?:DSA|DTSA|CVE)-[^\s]+) /; } - elsif (/^((?:DSA|DTSA|CAN|CVE)-[^\s]+)/) { # Check for a line with an advisory at the start : Set $id to it + elsif (/^((?:DSA|DTSA|CVE)-[^\s]+)/) { # Check for a line with an advisory at the start : Set $id to it $id=$1; } elsif (/^\s+[!-]\s+(\S+)\s+(.*?)\s*$/) { # Deal with the rest of the lines Modified: bin/update ==================================================================--- bin/update 2005-10-19 21:14:18 UTC (rev 2457) +++ bin/update 2005-10-19 22:54:03 UTC (rev 2458) @@ -1,20 +1,13 @@ #!/bin/sh set -e -if [ ! -d CVE ] || [ ! -d CAN ]; then +if [ ! -d CVE ]; then echo "run in data subdirectory" >&2 exit 1 fi cd CVE -rm -f full-cve.html -wget --quiet http://www.cve.mitre.org/cve/downloads/full-cve.html -../../bin/updatelist full-cve.html ../DSA/list ../DTSA/list list > list.new +rm -f allitems.html +wget --quiet http://www.cve.mitre.org/cve/downloads/allitems.html +../../bin/updatelist allitems.html ../DSA/list ../DTSA/list list > list.new mv -f list.new list -cd .. - -cd CAN -rm -f full-can.html -wget --quiet http://www.cve.mitre.org/cve/candidates/downloads/full-can.html -../../bin/updatelist full-can.html ../DSA/list ../DTSA/list list > list.new -mv -f list.new list Modified: bin/updatelist ==================================================================--- bin/updatelist 2005-10-19 21:14:18 UTC (rev 2457) +++ bin/updatelist 2005-10-19 22:54:03 UTC (rev 2458) @@ -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 @@ 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 @@ 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; +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; } - elsif (m!<b>(CVE-\d+-\d+)</b>!) { - $can=$1; - $cans{$can}{can}=$can; - $listedcans{$can}=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 @@ 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"; } }