From 65d3bc6e19b1a5509f7fa25ddce2b02a81043ab0 Mon Sep 17 00:00:00 2001 From: teastep Date: Sat, 28 Jul 2007 16:37:14 +0000 Subject: [PATCH] Earlier validation of log level used in action invocation git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@6985 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb --- Shorewall-perl/Shorewall/Actions.pm | 7 ++++--- Shorewall-perl/Shorewall/Chains.pm | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/Shorewall-perl/Shorewall/Actions.pm b/Shorewall-perl/Shorewall/Actions.pm index 5687ce8a0..ce898ae0d 100644 --- a/Shorewall-perl/Shorewall/Actions.pm +++ b/Shorewall-perl/Shorewall/Actions.pm @@ -35,7 +35,6 @@ our @ISA = qw(Exporter); our @EXPORT = qw( merge_levels isolate_basic_target add_requiredby - createlogactionchain createactionchain find_logactionchain process_actions1 @@ -260,6 +259,10 @@ sub createlogactionchain( $$ ) { my $chain = $action; my $actionref = $actions{$action}; my $chainref; + + my ($lev, $tag) = split ':', $level; + + validate_level $lev; $chain = substr $chain, 0, 28 if ( length $chain ) > 28; @@ -269,8 +272,6 @@ sub createlogactionchain( $$ ) { $actionref = new_action $action unless $actionref; - $level = 'none' unless $level; - $logactionchains{"$action:$level"} = $chainref = new_chain 'filter', '%' . $chain . $actionref->{actchain}++; mark_referenced $chainref; # Just in case the action body is empty. diff --git a/Shorewall-perl/Shorewall/Chains.pm b/Shorewall-perl/Shorewall/Chains.pm index f7485ecd4..8d647ee2a 100644 --- a/Shorewall-perl/Shorewall/Chains.pm +++ b/Shorewall-perl/Shorewall/Chains.pm @@ -1274,7 +1274,7 @@ sub log_rule_limit( $$$$$$$$ ) { my $prefix; - $level = validate_level $level; + $level = validate_level $level; # Do this here again because this function can be called directly from user exits. return 1 if $level eq '';