#!/usr/bin/perl -w # This script copies a security advisory named on the command line, and adds # the translation-check header to it. It also will create the # destination directory if necessary, and copy the Makefile from the source. # Written in 2000-2004 by Peter Karlsson # © Copyright 2000-2004 Software in the public interest, Inc. # This program is released under the GNU General Public License, v2. # $Id$ # Get command line $number = $ARGV[0]; use FindBin; use lib "$FindBin::Bin/../../Perl"; use Local::VCS; # Check usage. unless ($number) { print "Usage: $0 advisorynumber\n\n"; print "Copies the advisory from the English directory to the local one and adds\n"; print "the translation-check header\n"; exit; } # Locate advisory $number = "dsa-" . $number if $number !~ /^dsa-/; $year = 2004; YEAR: while (-d "../../english/security/$year") { last YEAR if -e "../../english/security/$year/$number.wml"; $year ++; } # Create needed file and directory names $srcdir = "../../english/security/$year"; die "Unable to locate English version of advisory $number.\n" if ! -d $srcdir; $srcfile= "$srcdir/$number.wml"; $dstdir = "./$year"; $dstfile= "$dstdir/$number.wml"; # Sanity checks die "File $srcfile does not exist\n" unless -e $srcfile; die "File $dstfile already exists\n" if -e $dstfile; mkdir $dstdir, 0755 unless -d $dstdir; my $VCS = Local::VCS->new(); my %file_info = $VCS->file_info($srcfile); $revision = $file_info{'cmt_rev'}; unless ($revision) { die "Could not get revision number - bug in script?\n"; } # Open the files open SRC, $srcfile or die "Could not read $srcfile ($!)\n"; open DST, ">$dstfile" or die "Could not create $dstfile ($!)\n"; # Insert the revision number print DST qq'#use wml::debian::translation-check translation="$revision" mindelta="1"\n'; # Copy the file while () { next if /\$Id/; # Header s/security update/обновление безопасности/; # Starting s/^(

)?A problem has been discovered in\b/$1Была обнаружена проблема в/; s/\bdiscovered a problem in\b/обнаружил проблему в/; s/It was discovered that/Было обнаружено, что/; # We recommend s/We recommend that you upgrade your (.*) package immediately/Рекомендуется немедленно обновить пакет $1/; s/We recommend that you upgrade your (.*) packages immediately/Рекомендуется немедленно обновить пакеты $1/; s/We recommend that you upgrade your (.*) and (.*) packages/Рекомендуется обновить пакеты $1 и $2/; s/We recommend that you upgrade your (.*) packages/Рекомендуется обновить пакеты $1/; s/We recommend that you upgrade your (.*) package/Рекомендуется обновить пакет $1/; s/We recommend that you update your (.*) package immediately/Рекомендуется немедленно обновить пакет $1/; s/We recommend that you update your (.*) packages immediately/Рекомендуется немедленно обновить пакеты $1/; s/We recommend that you update your (.*) packages/Рекомендуется обновить пакеты $1/; s/We recommend that you update your (.*) package/Рекомендуется обновить пакет $1/; # Vulnerabilities s/buffer overflows?/переполнение буфера/; s/integer overflow/переполнение целых чисел/; s/directory traversal/обход каталога/; s/format string vulnerability/уязвимость форматной строки/; s/format string vulnerabilities/уязвимости форматной строки/; s/insecure temporary files/небезопасные временные файлы/; s/>insecure temporary file creationнебезопасное создание временного файлаlocal root exploitлокальная уязвимость суперпользователяremote root exploitудалённая уязвимость суперпользователяsymlink attackатака через символьные ссылкиremote exploitудалённая уязвимостьmissing input sanitisingотсутствие очистки входных данныхthe execution of arbitrary codeвыполнение произвольного кодаexecution of arbitrary codeвыполнение произвольного кодаinformation disclosureраскрытие информацииseveralнесколькоmultipleмногочисленныеFor the detailed security status of (.*) please refer to/

С подробным статусом поддержки безопасности $1 можно ознакомиться на/; s/its security tracker page at\:/соответствующей странице отслеживания безопасности по адресу/; s/\For the detailed security status of (.*) please refer to its/

С подробным статусом поддержки безопасности $1 можно ознакомиться на/; s/security tracker page at\:/соответствующей странице отслеживания безопасности по адресу/; print DST $_; } close SRC; close DST; # We're done print "Copying done, remember to edit $dstfile\n";