From e26dd87513044fa74c361400d4d6a5f5cd40aeae Mon Sep 17 00:00:00 2001 From: teastep Date: Wed, 18 Jul 2007 18:21:45 +0000 Subject: [PATCH] Validate log level in Policy File git-svn-id: https://shorewall.svn.sourceforge.net/svnroot/shorewall/trunk@6903 fbd18981-670d-0410-9b5c-8dc0c1a9a2bb --- Shorewall-common/changelog.txt | 2 ++ Shorewall-common/releasenotes.txt | 3 +++ Shorewall-perl/Shorewall/Policy.pm | 2 +- 3 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Shorewall-common/changelog.txt b/Shorewall-common/changelog.txt index e7eff70f6..6c5b827e0 100644 --- a/Shorewall-common/changelog.txt +++ b/Shorewall-common/changelog.txt @@ -9,6 +9,8 @@ Changes in 4.0.0 Final 4) Consolicate Common.pm + Config.pm and Interfaces.pm + Hosts.pm + Zones.pm. +5) Validate log level in policy file. + Changes in 4.0.0 RC 2 1) Fix zone type check in Tunnels File. diff --git a/Shorewall-common/releasenotes.txt b/Shorewall-common/releasenotes.txt index a9acd52ac..626e3aaa2 100644 --- a/Shorewall-common/releasenotes.txt +++ b/Shorewall-common/releasenotes.txt @@ -38,6 +38,9 @@ Problems corrected in 4.0.0 Final. specify SHOREWALL_COMPILER= and the original is saved in shorewall.conf.rpmsave. +3) The contents of the LOG LEVEL column in /etc/shorewall/policy are + now validated at compile time by Shorewall-perl. + Other changes in Shorewall 4.0.0 Final. 1) The Perl modules in /usr/share/shorewall-perl/Shorewall/ have been diff --git a/Shorewall-perl/Shorewall/Policy.pm b/Shorewall-perl/Shorewall/Policy.pm index ebef81d78..d605e0b3d 100644 --- a/Shorewall-perl/Shorewall/Policy.pm +++ b/Shorewall-perl/Shorewall/Policy.pm @@ -216,7 +216,7 @@ sub validate_policy() push @policy_chains, ( $chainref ); } - $chainref->{loglevel} = $loglevel if defined $loglevel && $loglevel ne ''; + $chainref->{loglevel} = validate_level( $loglevel ) if defined $loglevel && $loglevel ne ''; $chainref->{synparams} = do_ratelimit $synparams, 'ACCEPT' if $synparams ne ''; $chainref->{default} = $default if $default;