diff options
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/firewall/vyatta-firewall.pl | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/scripts/firewall/vyatta-firewall.pl b/scripts/firewall/vyatta-firewall.pl index 74c4f9e..b1d8a25 100755 --- a/scripts/firewall/vyatta-firewall.pl +++ b/scripts/firewall/vyatta-firewall.pl @@ -362,7 +362,7 @@ sub update_rules { my $ctree = chain_configured(2, $name, $tree); if (defined($ctree)) { # chain name must be unique in both trees - printf STDERR 'Firewall config error: ' + Vyatta::Config::outputError(["firewall $tree $name"], 'Firewall config error: ' . "Rule set name \"$name\" already used in \"$ctree\"\n"; exit 1; } @@ -377,8 +377,8 @@ sub update_rules { # delete the chain if (Vyatta::IpTables::Mgr::chain_referenced($table, $name, $iptables_cmd)) { # disallow deleting a chain if it's still referenced - print STDERR 'Firewall config error: ' - . "Cannot delete rule set \"$name\" (still in use)\n"; + Vyatta::Config::outputError(["firewall $tree $name"],'Firewall config error: ' + . "Cannot delete rule set \"$name\" (still in use)\n"); exit 1; } delete_chain($table, "$name", $iptables_cmd); @@ -430,7 +430,7 @@ sub update_rules { delete_chain($table, "$name", $iptables_cmd); remove_refcnt($fw_tree_file, "$tree $name"); } - print STDERR "Firewall config error: $err_str\n"; + Vyatta::Config::outputError(["firewall $tree $name"],"Firewall config error: $err_str\n"); exit 1; } foreach (@rule_strs) { @@ -463,7 +463,7 @@ sub update_rules { my ($err_str, @rule_strs) = $node->rule(); if (defined($err_str)) { - print STDERR "Firewall config error: $err_str\n"; + Vyatta::Config::outputError(["firewall $tree $name rule $rule"],"Firewall config error: $err_str\n"); exit 1; } @@ -561,6 +561,7 @@ sub update_ints { print STDERR 'Firewall config error: ' . "\"Modify\" rule set \"$chain\" cannot be used for " . "\"local\"\n"; + exit 1; } |