mirror of
https://github.com/vincentmli/bpfire.git
synced 2026-04-09 18:45:54 +02:00
ids.cgi: Only read-in ignored hosts, if the ignore file exists.
Otherwise the CGI will crash. Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org> Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
This commit is contained in:
committed by
Michael Tremer
parent
7b82d83d7e
commit
fad7d1c4c6
@@ -103,7 +103,7 @@ if (($cgiparams{'WHITELIST'} eq $Lang::tr{'add'}) || ($cgiparams{'WHITELIST'} eq
|
||||
my $new_entry_remark = $cgiparams{'IGNORE_ENTRY_REMARK'};
|
||||
|
||||
# Read-in ignoredfile.
|
||||
&General::readhasharray($IDS::ignored_file, \%ignored);
|
||||
&General::readhasharray($IDS::ignored_file, \%ignored) if (-e $IDS::ignored_file);
|
||||
|
||||
# Check if we should edit an existing entry and got an ID.
|
||||
if (($cgiparams{'WHITELIST'} eq $Lang::tr{'update'}) && ($cgiparams{'ID'})) {
|
||||
@@ -165,7 +165,7 @@ if (($cgiparams{'WHITELIST'} eq $Lang::tr{'add'}) || ($cgiparams{'WHITELIST'} eq
|
||||
undef($cgiparams{'ID'});
|
||||
|
||||
# Read-in ignoredfile.
|
||||
&General::readhasharray($IDS::ignored_file, \%ignored);
|
||||
&General::readhasharray($IDS::ignored_file, \%ignored) if (-e $IDS::ignored_file);
|
||||
|
||||
# Grab the configured status of the corresponding entry.
|
||||
my $status = $ignored{$id}[2];
|
||||
@@ -199,7 +199,7 @@ if (($cgiparams{'WHITELIST'} eq $Lang::tr{'add'}) || ($cgiparams{'WHITELIST'} eq
|
||||
my %ignored = ();
|
||||
|
||||
# Read-in ignoredfile.
|
||||
&General::readhasharray($IDS::ignored_file, \%ignored);
|
||||
&General::readhasharray($IDS::ignored_file, \%ignored) if (-e $IDS::ignored_file);
|
||||
|
||||
# Drop entry from the hash.
|
||||
delete($ignored{$cgiparams{'ID'}});
|
||||
@@ -1071,7 +1071,7 @@ sub show_mainpage() {
|
||||
}
|
||||
|
||||
# Read-in ignored hosts.
|
||||
&General::readhasharray("$IDS::settingsdir/ignored", \%ignored);
|
||||
&General::readhasharray("$IDS::ignored_file", \%ignored) if (-e $IDS::ignored_file);
|
||||
|
||||
$checked{'ENABLE_IDS'}{'off'} = '';
|
||||
$checked{'ENABLE_IDS'}{'on'} = '';
|
||||
|
||||
Reference in New Issue
Block a user