diff --git a/config/cfgroot/ids-functions.pl b/config/cfgroot/ids-functions.pl index 75f806f2d..024a4f72e 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 c7c246ea5..47a70c61d 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;