From d9c64f2c8e4daaec06ae63235563191d1e03c966 Mon Sep 17 00:00:00 2001 From: Mohit Mehta Date: Thu, 2 Jul 2009 12:14:37 -0700 Subject: Fix Bug 4554 check for existing firewall ruleset fails when applying it to a zone during boot * use isActive to check if firewall ruleset has been succesfully committed * fix templates to fail inside an action field when a command fails --- scripts/zone-mgmt/vyatta-zone.pl | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'scripts/zone-mgmt') diff --git a/scripts/zone-mgmt/vyatta-zone.pl b/scripts/zone-mgmt/vyatta-zone.pl index 7d2206cb..8760b6a6 100755 --- a/scripts/zone-mgmt/vyatta-zone.pl +++ b/scripts/zone-mgmt/vyatta-zone.pl @@ -689,6 +689,14 @@ sub check_zones_validity { return; } +sub check_fwruleset_isActive { + my ($ruleset_type, $ruleset_name) = @_; + my $error = Vyatta::Zone::is_fwruleset_active('isActive', + $ruleset_type, $ruleset_name); + return "Invalid firewall ruleset $ruleset_type $ruleset_name" if $error; + return; +} + # # main # @@ -739,6 +747,9 @@ my ($error, $warning); ($error, $warning) = set_default_policy($zone_name, $default_policy) if $action eq 'set-default-policy'; +($error, $warning) = check_fwruleset_isActive($ruleset_type, $ruleset_name) + if $action eq 'is-fwruleset-active'; + if (defined $warning) { print "$warning\n"; } -- cgit v1.2.3