Skip to content
Snippets Groups Projects
Commit 9469e9d3 authored by Tomáš Plesník's avatar Tomáš Plesník
Browse files

bugfix: defined(%hash) is deprecated

parent eacc2606
No related branches found
No related tags found
No related merge requests found
# Warden.pm # Warden.pm
# #
# Copyright (C) 2011-2015 Cesnet z.s.p.o # Copyright (C) 2011-2014 Cesnet z.s.p.o
# #
# Use of this source is governed by a BSD-style license, see LICENSE file. # Use of this source is governed by a BSD-style license, see LICENSE file.
...@@ -221,7 +221,7 @@ sub saveNewEvent ...@@ -221,7 +221,7 @@ sub saveNewEvent
# authorize incoming client # authorize incoming client
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 (%client) {
# log incoming event # log incoming event
sendMsg("debug", sendMsg("debug",
"Incoming event: [client_id: '$client{'client_id'}', service: '$service', detected: '$detected', type: '$type', source_type: '$source_type', source: '$source', target_proto: '$target_proto', target_port: '$target_port', attack_scale: '$attack_scale', note: '$note', priority: '$priority', timeout: '$timeout']", "Incoming event: [client_id: '$client{'client_id'}', service: '$service', detected: '$detected', type: '$type', source_type: '$source_type', source: '$source', target_proto: '$target_proto', target_port: '$target_port', attack_scale: '$attack_scale', note: '$note', priority: '$priority', timeout: '$timeout']",
...@@ -326,7 +326,7 @@ sub getNewEvents ...@@ -326,7 +326,7 @@ sub getNewEvents
# authorize incoming client # authorize incoming client
my %client = authorizeClient($alt_names, $ip, $requested_type, $client_type, $function_name); my %client = authorizeClient($alt_names, $ip, $requested_type, $client_type, $function_name);
if (defined %client) { if (%client) {
# obtain events from database # obtain events from database
my $query = "SELECT id, hostname, service, detected, events.type, source_type, source, target_proto, target_port, attack_scale, note, priority, timeout FROM events INNER JOIN clients ON events.client_id = clients.client_id WHERE events.type != 'test' AND id > ? AND events.valid = 't'"; my $query = "SELECT id, hostname, service, detected, events.type, source_type, source, target_proto, target_port, attack_scale, note, priority, timeout FROM events INNER JOIN clients ON events.client_id = clients.client_id WHERE events.type != 'test' AND id > ? AND events.valid = 't'";
my @params = ($last_id); my @params = ($last_id);
...@@ -419,7 +419,7 @@ sub getLastId ...@@ -419,7 +419,7 @@ sub getLastId
# authorize incoming client # authorize incoming client
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 (%client) {
# obtain max event ID # obtain max event ID
my $sth = $DBH->prepare("SELECT max(id) FROM events;"); my $sth = $DBH->prepare("SELECT max(id) FROM events;");
unless (defined $sth) { unless (defined $sth) {
...@@ -462,7 +462,7 @@ sub getClientInfo ...@@ -462,7 +462,7 @@ sub getClientInfo
# authorize incoming client # authorize incoming client
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 (%client) {
# obtain all valid clients from DB # obtain all valid clients from DB
my $sth = $DBH->prepare("SELECT * FROM clients WHERE valid = 't' ORDER BY client_id ASC;"); my $sth = $DBH->prepare("SELECT * FROM clients WHERE valid = 't' ORDER BY client_id ASC;");
unless (defined $sth) { unless (defined $sth) {
......
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