From 9d81f45b63fe16ba4e698266e95f14c9bb499138 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pablo=20de=20la=20Concepci=C3=B3n=20Sanz?= Date: Mon, 22 Feb 2010 20:18:37 +0000 Subject: [PATCH] =?UTF-8?q?2010-02-22=20=20Pablo=20de=20la=20Concepci?= =?UTF-8?q?=C3=B3n=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * lib/PandoraFMS/DataServer.pm: Fixed bug #2926077 there were one more place where the timestamp should be checked. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@2403 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_server/ChangeLog | 5 +++++ pandora_server/lib/PandoraFMS/DataServer.pm | 11 ++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/pandora_server/ChangeLog b/pandora_server/ChangeLog index 675eda93e6..8fa744806c 100644 --- a/pandora_server/ChangeLog +++ b/pandora_server/ChangeLog @@ -1,3 +1,8 @@ +2010-02-22 Pablo de la ConcepciĆ³n + + * lib/PandoraFMS/DataServer.pm: Fixed bug #2926077 there were one + more place where the timestamp should be checked. + 2010-02-22 Pablo de la ConcepciĆ³n * lib/PandoraFMS/Core.pm: Updated documentation, fixed wrong parameters diff --git a/pandora_server/lib/PandoraFMS/DataServer.pm b/pandora_server/lib/PandoraFMS/DataServer.pm index 2207ce7146..88ebac6ff7 100644 --- a/pandora_server/lib/PandoraFMS/DataServer.pm +++ b/pandora_server/lib/PandoraFMS/DataServer.pm @@ -391,9 +391,14 @@ sub process_module_data ($$$$$$$$$) { logger($pa_config, "Invalid timestamp '$timestamp' from module '$module_name' agent '$agent_name'.", 3); return; } - - my $utimestamp = timelocal($6, $5, $4, $3, $2 - 1, $1 - 1900); - + my $utimestamp; + eval { + $utimestamp = timelocal($6, $5, $4, $3, $2 - 1, $1 - 1900); + }; + if ($@) { + logger($pa_config, "Invalid timestamp '$timestamp' from module '$module_name' agent '$agent_name'.", 3); + return; + } #my $value = get_tag_value ($data, 'data', ''); my $dataObject = get_module_data($data, $agent_name, $module_name, $module_type); my $extraMacros = get_macros_for_data($data, $agent_name, $module_name, $module_type);