aboutsummaryrefslogtreecommitdiffstats
path: root/russian/lts/security/copyadvisory.pl
blob: 344ee2b515db91d441023940bbc67f7ca9f6d655 (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
#!/usr/bin/perl -w

# This script copies a LTS 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. It is based on copyadvistory.pl for usual security
# advisories.

# 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 LTS advisory from the English directory to the local one and adds\n";
	print "the translation-check header\n";
	exit;
}

# Locate advisory
$number = "dla-" . $number if $number !~ /^dla-/;
$year = 2014;
YEAR: while (-d "../../../english/lts/security/$year")
{
	last YEAR if -e "../../../english/lts/security/$year/$number.wml";
	$year ++;
}

# Create needed file and directory names
$srcdir = "../../../english/lts/security/$year";
die "Unable to locate English version of LTS 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/LTS security update/обновление безопасности LTS/;

        # 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/For Debian ([0-9] <q>\w+<\/q>),/В Debian $1/;

        # Some other phrases related to fixing
	s/([Tt])he old stable distribution/Предыдущий стабильный выпуск/;
	s/([Tt])he oldstable distribution/Предыдущий стабильный выпуск/;
	s/does(?: not|n't) contain a(?:ny)? ([^ ]) package/пакет $1 отсутствует/;
	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/эта проблема будет исправлена позже/;

        # Further information
        s/Further information about Debian LTS security advisories, how to apply/Дополнительную информацию о рекомендациях по безопасности Debian LTS,/;
        s/these updates to your system and frequently asked questions can be/о том, как применять эти обновления к вашей системе, а также ответы на часто/;
        s(found at: <a href="https://wiki.debian.org/LTS">https://wiki.debian.org/LTS)(задаваемые вопросы можно найти по адресу: <a href="https://wiki.debian.org/LTS">\\\nhttps://wiki.debian.org/LTS);

	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