Skip to content
Snippets Groups Projects
Commit 6bec233b authored by pharook's avatar pharook
Browse files

Pokud "type" ve %VALID_STRINGS nebo samotny %VALID_STRINGS neni definovan,...

Pokud "type" ve %VALID_STRINGS nebo samotny %VALID_STRINGS neni definovan, nevaliduj, prijmi cokoliv + uprava regularniho vyrazu v grepu na levnejsi "eq".
parent 47c643d1
No related branches found
No related tags found
No related merge requests found
...@@ -220,9 +220,8 @@ sub saveNewEvent ...@@ -220,9 +220,8 @@ sub saveNewEvent
my %client = authorizeClient($alt_names, $ip, $service, $client_type, $function_name); my %client = authorizeClient($alt_names, $ip, $service, $client_type, $function_name);
if(defined %client) { if(defined %client) {
# check validity of event attributes - TYPE # if validator is configured, check validity of event attributes - TYPE
my $match = grep /$type/, @{$VALID_STRINGS{'type'}}; if (!exists $VALID_STRINGS{'type'} or grep $type eq $_, @{$VALID_STRINGS{'type'}}) {
if ($match) {
$sth=$DBH->prepare("INSERT INTO events VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?);"); $sth=$DBH->prepare("INSERT INTO events VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?);");
if (!defined $sth) { die("Cannot do insert statement in $function_name: $DBI::errstr\n") } if (!defined $sth) { die("Cannot do insert statement in $function_name: $DBI::errstr\n") }
$sth->execute(undef, $client{'dns'}, $service, $detected, $received, $type, $source_type, $source, $target_proto, $target_port, $attack_scale, $note, $priority, $timeout, $valid); $sth->execute(undef, $client{'dns'}, $service, $detected, $received, $type, $source_type, $source, $target_proto, $target_port, $attack_scale, $note, $priority, $timeout, $valid);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment