aboutsummaryrefslogtreecommitdiffstats
path: root/russian/security/copyadvisory.pl
blob: 13e186fbe8f9c59683ee1408e2d4d6530b0b6256 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
#!/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 <peterk@debian.org>
# © 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 (<SRC>)
{
	next if /\$Id/;

        # Header
        s/security update/обновление безопасности/;

        # Starting
	s/^(<p>)?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</>небезопасное создание временного файла</;
	s/>local root exploit</>локальная уязвимость суперпользователя</;
	s/>remote root exploit</>удалённая уязвимость суперпользователя</;
	s/>symlink attack</>атака через символьные ссылки</;
	s/>remote exploit</>удалённая уязвимость</;
	s/>missing input sanitising</>отсутствие очистки входных данных</;
	s/missing input validation/отсутствие очистки входных данных/;
	s/>the execution of arbitrary code</>выполнение произвольного кода</;
	s/>execution of arbitrary code</>выполнение произвольного кода</;
	s/>information disclosure</>раскрытие информации</;
	s/privilege escalation/повышений привилегий/;
	s/cross site/межсайтовый/;
	s/heap overflow/переполнение динамической памяти/;

        # Several/Multiple
	s/Several vulnerabilities/Несколько уязвимостей/;
	s/several vulnerabilities/несколько уязвимостей/;
	s/multiple vulnerabilities/многочисленные уязвимости/;
	s/>several</>несколько</;
	s/>multiple</>многочисленные</;

        # Fixed in
	s/This has been fixed in version/Эта уязвимость была исправлена в версии/;
	s/this problem has been fixed in/эта проблема была исправлена в/;
	s/this problem has been fixed$/эта проблема была исправлена/;
	s/this problem has(?: been)?$/эта проблема была/;
	s/This problem has been fixed/Эта проблема была исправлена/;
	s/this problem is fixed in/эта проблема была исправлена в/;
	s/this problem is fixed/эта проблема исправлена/;
	s/These problems have been fixed/Эти проблемы были исправлены/;
	s/these problems have been fixed in/эти проблемы были исправлены в/;
	s/these problems have been fixed$/эти проблемы были исправлены/;
	s/these problems have(?: been)?$/эти проблемы были/;
	s/these problem are fixed in/эти проблемы исправлены в/;
	s/these problem are fixed/эти проблемы исправлены/;
	s/these problems will be fixed soon/эти проблемы будут исправлены позже/;
	s/(?:been )?fixed in version/исправлены в версии/;
	s/\bin version\b/в версии/;
        s/\bversion\b/версии/;
	s/of the Debian package/пакета Debian/;
	s/upstream version/версии из основной ветки разработки/;

        # For the [..]
	s/([Ff])or the old stable distribution/В предыдущем стабильном выпуске/;
	s/([Ff])or the oldstable distribution/В предыдущем стабильном выпуске/;
	s/([Ff])or the old stable/В предыдущем стабильном/;
	s/([Ff])or the oldstable/В предыдущем стабильном/;
	s/([Ff])or the current stable distribution/В текущем стабильном выпуске/;
	s/([Ff])or the current stable/В текущем стабильном/;
	s/([Ff])or the Debian stable distribution/В стабильном выпуске Debian/;
	s/([Ff])or the stable distribution/В стабильном выпуске/;
	s/([Ff])or the stable/В стабильном/;
	s/([Ff])or the Debian unstable distribution/В нестабильном выпуске Debian/;
	s/([Ff])or the unstable distribution/В нестабильном выпуске/;
	s/([Ff])or the unstable/В нестабильном/;
	s/For the upcoming stable distribution/В готовящемся стабильном выпуске/;
	s/For the testing distribution/В тестируемом выпуске/;

        # Some other phrases related to fixing
	s/current stable distribution/текущем стабильном выпуске/;
	s/unstable distribution/нестабильном выпуске/;
	s/([Tt])he old stable distribution/Предыдущий стабильный выпуск/;
	s/([Tt])he oldstable distribution/Предыдущий стабильный выпуск/;
	s/^stable distribution/стабильный выпуск/;
	s/^unstable distribution/нестабильный выпуск/;
	s/does(?: not|n't) contain a(?:ny)? ([^ ]) package/пакет $1 отсутствует/;
	s/testing distribution/тестируемом выпуске/;
	s/\bis not affected by this problem/не подвержен данной проблеме/;
	s/does not contain ([[:word:]]*) packages?/пакет $1 отсутствует/;
	s/does not contain a(?:ny)? ([[:word:]]*) packages/пакеты $1 отсутствуют/;
	s/does not contain a(?:ny)? ([[:word:]]*) package/пакет $1 отсутствует/;
	s/this problem will be fixed soon/эта проблема будет исправлена позже/;

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

	print DST $_;
}

close SRC;
close DST;

# We're done
print "Copying done, remember to edit $dstfile\n";

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