From 71a67e829158042497e013d2dc61094dac4f1f6b Mon Sep 17 00:00:00 2001 From: hkosaka Date: Fri, 30 Nov 2012 06:18:29 +0000 Subject: [PATCH] 2012-11-30 Hirofumi Kosaka * lib/PandoraFMS/SNMPServer.pm: Added missing safe_output() for trap filters. This fixed a bug that a backslash could not escape its following character. Merged from 4.0 branch. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7212 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_server/ChangeLog | 8 ++++++++ pandora_server/lib/PandoraFMS/SNMPServer.pm | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/pandora_server/ChangeLog b/pandora_server/ChangeLog index b3d258ad45..361f8e9d54 100644 --- a/pandora_server/ChangeLog +++ b/pandora_server/ChangeLog @@ -1,3 +1,11 @@ +2012-11-30 Hirofumi Kosaka + + * lib/PandoraFMS/SNMPServer.pm: Added missing safe_output() + for trap filters. This fixed a bug that a backslash could not + escape its following character. + + Merged from 4.0 branch. + 2012-11-28 Ramon Novoa * lib/PandoraFMS/NetworkServer.pm, diff --git a/pandora_server/lib/PandoraFMS/SNMPServer.pm b/pandora_server/lib/PandoraFMS/SNMPServer.pm index 26c9bd9e7d..cf155f143d 100644 --- a/pandora_server/lib/PandoraFMS/SNMPServer.pm +++ b/pandora_server/lib/PandoraFMS/SNMPServer.pm @@ -238,7 +238,7 @@ sub matches_filter ($$$) { # Get filters my @filters = get_db_rows ($dbh, 'SELECT filter FROM tsnmp_filter'); foreach my $filter (@filters) { - my $regexp = $filter->{'filter'}; + my $regexp = safe_output($filter->{'filter'}) ; if ($string =~ m/$regexp/i) { logger($pa_config, "Trap '$string' matches filter '$regexp'. Discarding...", 10); return 1;