From 9469e9d3b88ffc850adca44ea2670947bbe7800a Mon Sep 17 00:00:00 2001
From: Tomas Plesnik <plesnik@ics.muni.cz>
Date: Wed, 18 Mar 2015 17:03:29 +0100
Subject: [PATCH] bugfix: defined(%hash) is deprecated

---
 src/warden-server/lib/Warden.pm | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/src/warden-server/lib/Warden.pm b/src/warden-server/lib/Warden.pm
index 3c14812..32390b3 100755
--- a/src/warden-server/lib/Warden.pm
+++ b/src/warden-server/lib/Warden.pm
@@ -1,6 +1,6 @@
 # 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.
 
@@ -221,7 +221,7 @@ sub saveNewEvent
 
   # authorize incoming client
   my %client = authorizeClient($alt_names, $ip, $service, $client_type, $function_name);
-  if (defined %client) {
+  if (%client) {
     # log incoming event
     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']",
@@ -326,7 +326,7 @@ sub getNewEvents
 
   # authorize incoming client
   my %client = authorizeClient($alt_names, $ip, $requested_type, $client_type, $function_name);
-  if (defined %client) {
+  if (%client) {
     # 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 @params = ($last_id);
@@ -419,7 +419,7 @@ sub getLastId
 
   # authorize incoming client
   my %client = authorizeClient($alt_names, $ip, $service, $client_type, $function_name);
-  if (defined %client) {
+  if (%client) {
     # obtain max event ID
     my $sth = $DBH->prepare("SELECT max(id) FROM events;");
     unless (defined $sth) {
@@ -462,7 +462,7 @@ sub getClientInfo
 
   # authorize incoming client
   my %client = authorizeClient($alt_names, $ip, $service, $client_type, $function_name);
-  if (defined %client) {
+  if (%client) {
     # obtain all valid clients from DB
     my $sth = $DBH->prepare("SELECT * FROM clients WHERE valid = 't' ORDER BY client_id ASC;");
     unless (defined $sth) {
-- 
GitLab