From 25f5cb0d4b4a6c2418c219d975eb95e393b4e9af Mon Sep 17 00:00:00 2001 From: Stefan Schantl Date: Wed, 14 Feb 2018 08:58:18 +0100 Subject: [PATCH] ids.cgi: Move function to call oinkmaster to ids-functions.pl Signed-off-by: Stefan Schantl --- config/cfgroot/ids-functions.pl | 8 ++++++++ html/cgi-bin/ids.cgi | 11 ++++++----- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/config/cfgroot/ids-functions.pl b/config/cfgroot/ids-functions.pl index 75f806f2db..024a4f72e0 100644 --- a/config/cfgroot/ids-functions.pl +++ b/config/cfgroot/ids-functions.pl @@ -147,4 +147,12 @@ sub downloadruleset { return; } +# +## A tiny wrapper function to call the oinkmaster script. +# +sub oinkmaster () { + # Call oinkmaster to generate ruleset. + system("/usr/local/bin/oinkmaster.pl -v -s -u file://$rulestarball -C /var/ipfire/snort/oinkmaster.conf -o /etc/snort/rules 2>&1 |logger -t oinkmaster"); +} + 1; diff --git a/html/cgi-bin/ids.cgi b/html/cgi-bin/ids.cgi index c7c246ea5e..47a70c61d6 100644 --- a/html/cgi-bin/ids.cgi +++ b/html/cgi-bin/ids.cgi @@ -598,11 +598,12 @@ END exit; } -sub oinkmaster () { - # Call oinkmaster to generate ruleset. - system("/usr/local/bin/oinkmaster.pl -v -s -u file://$rulestarball -C /var/ipfire/snort/oinkmaster.conf -o /etc/snort/rules 2>&1 |logger -t oinkmaster"); -} - +# +## Private function to read-in and parse rules of a given rulefile. +# +## The given file will be read, parsed and all valid rules will be stored by ID, +## message/description and it's state in the snortrules hash. +# sub readrulesfile ($) { my $rulefile = shift; -- 2.39.2