-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsignatures_1step.cgi
executable file
·58 lines (41 loc) · 1.94 KB
/
signatures_1step.cgi
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
#!/usr/bin/perl
# Copyright (C) 2003-2019
# Emmanuel Saracco <emmanuel@esaracco.fr>
#
# GNU GENERAL PUBLIC LICENSE
require '../webmin/webmin-lib.pl';
require './clamav-lib.pl';
&clamav_check_acl ('signature_use');
($ENV{REQUEST_METHOD} eq 'POST') ? &ReadParseMime() : &ReadParse();
my ($_success, $_error) = ('', '');
my $sha1 = $in{'sha1'}||'';
my $size = $in{'size'}||0;
my $virus_name = $in{'virus_name'}||'';
my $upload = ($in{'upload'}) ? 1 : 0;
$_error = $in{'error'} if ($in{'error'});
# if there is no file to upload, error
if ($in{'main'} && !$upload)
{
&redirect ("/$module_name/signatures_main.cgi?error=1");
}
&clamav_header ($text{'LINK_SIGNATURES'}, 'signatures_main');
if ($upload)
{
($sha1, $size, $virus_name) = &clamav_build_signature (\%in);
}
print qq(<form method="POST" action="signatures_2step.cgi">);
printf qq(<input type="hidden" name="sha1" value="%s">), &html_escape($sha1);
printf qq(<input type="hidden" name="size" value="%s">), &html_escape($size);
print qq(<p>$text{'SIGNATURES_DESCRIPTION'}</p>);
print qq(<h2>$text{'SIGNATURES_THIRD_STEP'}</h2>);
print qq(<p>$text{'SIGNATURES_THIRD_STEP_DESCRIPTION'}</p>);
print qq(<table class="clamav keys-values">);
print qq(<tr><td nowrap>$text{'NAME'}: </td><td nowrap style="width:1px">);
print &clamav_display_combos_viruses_prefixes ($in{'prefix0'}, $in{'prefix1'});
printf qq(</td><td><input type="text" name="virus_name" value="%s" size=60></td>), &html_escape($virus_name);
printf qq(<tr><td nowrap>$text{'SIGNATURE'}: </td><td colspan=2>%s</td>), &html_escape($sha1);
printf qq(<tr><td nowrap>$text{'FILE_SIZE'}: </td><td colspan=2>%s</td>), &html_escape($size);
print qq(</table>);
print qq(<p/><div><button type="submit" name="next3" class="btn btn-success ui_form_end_submit"><i class="fa fa-fw fa-bolt"></i> <span>$text{'SIGNATURE_CREATE'}</span></button></div>);
print qq(</form>);
&clamav_footer ('signatures_main.cgi', $text{'RETURN_SIGNATURES_MAIN'}, $_success, $_error);